maias

v0.5.1
io.github.MAIAS-project/maias Checked 4 days ago Published 4 months ago

Validate, query, safely edit, and wireframe MAIAS app-IA documents: cascading renames, atomic edits.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

validate Validate a MAIAS document

JSON Schema validation plus semantic lint (dangling targets, orphans, registry membership, …) for a MAIAS file. Returns { valid, diagnostics[] } with line/col positions.

ParameterTypeDescription
file *stringPath to a .yaml or .json MAIAS document

query Query a MAIAS document graph

Graph utilities over a MAIAS file: get one screen, list screens/flows, reachability analysis, orphan detection, "what links here" for a screen id, a text outline of the structure (tree — show this to the user after creating or restructuring a document), and a Mermaid flowchart (mermaid — renders in GitHub/Claude/Obsidian). tree and mermaid return plain text, not JSON; mermaid accepts an optional flow to scope the diagram.

ParameterTypeDescription
file *stringPath to the MAIAS document
operation *string
flowstringmermaid: scope the diagram to one flow
refsbooleantree: append each screen's outbound targets and states
screen_idstringScreen id — required for 'screen' and 'what_links_here'

edit Safely edit a MAIAS document

Reference-safe edits: rename_screen cascades to flows, the navigation registry, and every target; add_screen registers the screen; remove_screen refuses to leave dangling references unless cascade is set. Writes the result back to the file (canonically formatted when format_output is true).

ParameterTypeDescription
file *stringPath to the MAIAS document
operation *string
cascadebooleanremove_screen: also remove inbound references
flowstringFlow to append the new screen to (add_screen)
format_outputbooleanWrite canonical form (default true)
new_idstringNew id (rename_screen)
registrystringRegistry list for add_screen (default secondary)
screenobjectScreen object per the spec (add_screen)
screen_idstringTarget screen id (rename_screen / remove_screen)

edit_elements Safely edit a screen's elements

Batch edit of a screen's `elements` list (or a declared state's list): insert, update, remove, move. The batch is atomic — a failing op refuses the whole batch and the file is untouched. Ops apply sequentially, so each op's index addresses the list as left by the previous ops (0-based; insert at list length appends; move's `to` is the final index). `update.set` patches only the given keys — an explicit null deletes a key, `x_` fields not named survive. An op introducing a `target` that matches no screen is refused, as is editing a state the screen does not declare. Pass `expect` so a stale…

ParameterTypeDescription
file *stringPath to the MAIAS document
ops *arrayOperations, applied in order, all-or-nothing
screen_id *stringScreen whose elements are edited
format_outputbooleanWrite canonical form (default true)

wireframe Render an HTML wireframe board

Deterministic mobile wireframes from a MAIAS file: one self-contained HTML file (inline CSS, no JS, no external URLs) with one phone frame per screen, flows as rows, and click-through anchors between frames. Pass out to write the file (recommended — returns a summary); without out the raw HTML is returned as text (large). Refuses documents with validation errors (dangling targets become dead links) unless force is set.

ParameterTypeDescription
file *stringPath to the MAIAS document
accentstringHex accent colour (e.g. #0A84FF) replacing the default wireframe grey
flowstringRender only this flow
forcebooleanRender despite validation errors
outstringWrite the HTML here (e.g. <app>-wireframes.html); when absent the HTML is returned as text
statesbooleanAlso emit declared empty/loading/error variants as extra frames