slang-workflows

v0.1.2
io.github.shofer-dev/slang-workflows Checked 3 days ago Published 5 months ago

Provable, declarative multi-agent workflows for Claude Code (typed .slang, non-LLM executor).

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

list_workflows List workflows

Discover .slang workflow files in the project (.claude/workflows/) and global (~/.claude/workflows/) directories. Returns each flow's name, title, params, and agent count.

get_slang_grammar Get slang grammar

Return a concise slang grammar cheatsheet (constructs + a complete example) so you can GENERATE a workflow on the fly and run it inline via run_workflow(source). Validate generated source with validate_workflow(source) first; run_workflow also rejects parse/static-analysis errors.

validate_workflow Validate workflow

Parse and statically analyze one workflow (deadlock detection, unknown refs, missing converge/budget, orphan outputs) without running it. Identify it by `name` or absolute `path`.

ParameterTypeDescription
namestringFlow name or .slang filename (project scope preferred).
pathstringAbsolute path to a .slang file (overrides `name`).
sourcestringInline .slang source to validate (overrides name/path) — validate generated flows before running.

run_workflow Run workflow

Parse and run a .slang workflow to completion, dispatching each agent through the Claude Agent SDK and validating results against output contracts. Identify it by `name` or `path`; pass flow `params` as an object. Returns the final flow status and each agent's output. Rejects parse/static-analysis errors before running. Default runs synchronously (returns the final status + each agent's output). Pass background:true to start the run and return a workflow_id immediately, then poll get_trace/get_topology/get_workflow_state to watch it live; @Human escalation only works in synchronous runs.

ParameterTypeDescription
backgroundbooleanStart the run and return a workflow_id immediately, then poll get_trace/get_topology/get_workflow_state. (@Human escalation unsupported in background.)
modelstringDefault model for agents without api_configuration (e.g. sonnet).
namestringFlow name or .slang filename.
paramsobjectFlow parameters as a key/value object.
pathstringAbsolute path to a .slang file (overrides `name`).
sourcestringInline .slang source (overrides name/path) — e.g. a workflow an LLM generated on the fly.

get_workflow_state Get workflow state

Return the serialized FlowState for a run started by `run_workflow`: per-agent status, opIndex, bindings, round, budget usage, and flow status. Identify it by `workflow_id`.

ParameterTypeDescription
workflow_id *stringId returned by run_workflow.

get_topology Get workflow topology (Mermaid)

Return the current agent topology of a run as a Mermaid flowchart (nodes colored by status, plus live sending/waiting edges). Render it inline. Identify it by `workflow_id`.

ParameterTypeDescription
workflow_id *stringId returned by run_workflow.

get_trace Get workflow trace (Mermaid sequence + event log)

Return a run's execution trace as a Mermaid `sequenceDiagram` (round-by-round: who staked/routed to whom, commits, escalations, terminal event) plus the raw event log. The timeline counterpart to `get_topology`'s snapshot. Render the diagram inline. Identify it by `workflow_id`.

ParameterTypeDescription
workflow_id *stringId returned by run_workflow.