You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Agent-mode API: the machine-facing interface for LLM consumers
agent_api.rs — complete agent-facing API:
- AST-as-JSON bridge: parse_to_json(), json_to_program(), validate_json_ast()
Agents can produce AST directly as JSON, skip text parsing entirely
- Structured errors: AgentError with error code, Kategoria level, context,
and Remediation suggestions with confidence scores and AstPatch fixes
- TypeError→AgentError conversion for all 14 error kinds with tailored
remediations (e.g., LinearUsedTwice → "remove second use" or "clone")
- Valid moves API: variables in scope, callable functions, spawnable agents,
linear obligations, budget remaining, protocol state
- Grammar summary card: 10 top-level forms, 14 statements, 12 expressions,
10 types, 54 keywords, 14 operators, 10 cost entries, 11 Harvard rules
- Full validation pipeline: parse→typecheck→summarize in single JSON call
CLI commands: agent-parse, agent-validate, agent-moves, agent-card, agent-from-json
Design rationale: the text syntax is the human interface. The AST-JSON +
structured errors + valid-next-moves API is the agent interface. 007 needs
both. This implements the second.
169 tests (160 + 9 new). Zero clippy warnings.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0 commit comments