dynamic extensions
Each example is a complete workflow spec.
dynamic extension consumer
Use structured args when selecting multiple stable catalog names.
Do not list generated tool names in step.tools.
{
"name": "dynamic-consumer",
"args": { "hint": "JSON args: { extensions: string[] }" },
"phases": [
{
"id": "inspect",
"kind": "single",
"step": {
"summary": "Inspect with extensions",
"prompt": "Inspect the task with the requested capabilities.",
"dynamicExtensions": "{args.extensions}"
}
}
]
}
dynamic extension builder
The builder searches, reuses, repairs, or creates one capability, then inspects fast-feedback diagnostics before a consumer starts.
The consumer receives stable catalog names through dynamicExtensions, never generated tool names or revisions.
{
"name": "dynamic-builder",
"description": "Build and consume one task-specific capability.",
"schemas": {
"BuilderResult": {
"type": "object",
"properties": {
"status": { "type": "string", "enum": ["validated", "blocked"] },
"extensionNames": { "type": "array", "maxItems": 1, "items": { "type": "string", "minLength": 1 } },
"summary": { "type": "string", "minLength": 1 },
"evidence": { "type": "array", "items": { "type": "string", "minLength": 1 } },
"blockers": { "type": "array", "items": { "type": "string", "minLength": 1 } },
"workingCopyPath": { "type": "string", "minLength": 1 }
},
"required": ["status", "extensionNames", "summary", "evidence", "blockers", "workingCopyPath"]
},
"UseResult": {
"type": "object",
"properties": {
"status": { "type": "string" },
"result": { "type": "string" },
"evidence": { "type": "array", "items": { "type": "string" } }
},
"required": ["status", "result", "evidence"]
},
"HumanReport": {
"type": "object",
"properties": {
"status": { "type": "string", "enum": ["validated", "blocked", "incomplete"] },
"summary": { "type": "string", "minLength": 1 },
"next_steps": { "type": "array", "items": { "type": "string", "minLength": 1 } },
"workingCopyPath": { "type": "string", "minLength": 1 }
},
"required": ["status", "summary", "next_steps"]
}
},
"phases": [
{
"id": "build",
"kind": "single",
"step": {
"summary": "Build one validated capability",
"prompt": "Build one Pi extension for repository dependency provenance under its returned workingCopyPath. Read applicable AGENTS.md instructions. Search before creating; inspect candidates when relevant. Keep a safe name, minimal manifest, and readable index.ts. Call validate_dynamic_extension and inspect diagnostics. Publication is not proof the extension works: repair load/test failures before returning an extension name to the consumer. If stale, copy the current revision and reconcile intent without deleting the previous working copy. Always return workingCopyPath for recovery, even when blocked. Return validated with the stable catalog name only after publication and repair; otherwise return blocked with diagnostic evidence.",
"tools": ["search_dynamic_extensions", "create_dynamic_extension", "copy_dynamic_extension", "validate_dynamic_extension"],
"model": "large",
"schema": "BuilderResult"
}
},
{
"id": "use",
"kind": "single",
"when": "{build.results | where status == \"validated\"}",
"step": {
"summary": "Use the validated capability",
"prompt": "Use the validated repository dependency provenance capability for the supplied target. Return structured evidence and do not modify files.",
"dynamicExtensions": "{build.results[].extensionNames[]}",
"tools": ["read", "grep", "find", "ls"],
"model": "small",
"schema": "UseResult"
}
},
{
"id": "report",
"kind": "single",
"step": {
"summary": "Report capability status",
"prompt": "Prepare a concise report for the human and agent from builder results {build.results} and consumer results {use.results}. Mark blocked or incomplete explicitly; do not infer successful use from an empty result. If blocked, include the builder's workingCopyPath verbatim for recovery.",
"model": "large",
"schema": "HumanReport"
}
}
],
"return": "{build.results}",
"report": "{report.results}"
}