create-agdf 0.30.0 → 0.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/generated/.agdf/control/README.md +5 -0
- package/generated/.agdf/control/templates/BRAND.md +28 -0
- package/generated/.agdf/control/templates/artefacts/PRD.md +11 -0
- package/generated/.agdf/control/templates/artefacts/SD.md +4 -0
- package/generated/.agdf/control/templates/artefacts/UX_INTENT_DEFINITION.md +1 -1
- package/generated/.opencode/agdf-interaction-locales.json +436 -2
- package/generated/.opencode/contracts/gate-artifact-preparation.md +9 -3
- package/generated/.opencode/contracts/interaction.md +10 -4
- package/generated/.opencode/contracts/modes.md +5 -0
- package/generated/.opencode/contracts/prd-definition.md +40 -1
- package/generated/.opencode/contracts/quality.md +35 -0
- package/generated/.opencode/contracts/request-activation.md +6 -3
- package/generated/.opencode/contracts/sd-definition.md +46 -0
- package/generated/.opencode/contracts/tp-definition.md +8 -0
- package/generated/.opencode/contracts/ur-definition.md +9 -5
- package/generated/.opencode/skills/agdf-ux-intent-definition/SKILL.md +31 -2
- package/generated/plugins/agdf/.claude-plugin/plugin.json +1 -1
- package/generated/plugins/agdf/.codex-plugin/plugin.json +1 -1
- package/generated/plugins/agdf/companion/events.mjs +119 -0
- package/generated/plugins/agdf/companion/figure.mjs +242 -111
- package/generated/plugins/agdf/companion/gate-bar.mjs +10 -28
- package/generated/plugins/agdf/companion/localization.mjs +15 -32
- package/generated/plugins/agdf/companion/notice.mjs +20 -10
- package/generated/plugins/agdf/companion/register.mjs +310 -66
- package/generated/plugins/agdf/companion/run-state.mjs +89 -90
- package/generated/plugins/agdf/companion/state.mjs +6 -32
- package/generated/plugins/agdf/companion/view.mjs +199 -24
- package/generated/plugins/agdf/control/README.md +5 -0
- package/generated/plugins/agdf/control/templates/BRAND.md +28 -0
- package/generated/plugins/agdf/control/templates/artefacts/PRD.md +11 -0
- package/generated/plugins/agdf/control/templates/artefacts/SD.md +4 -0
- package/generated/plugins/agdf/control/templates/artefacts/UX_INTENT_DEFINITION.md +1 -1
- package/generated/plugins/agdf/mcp/server/README.md +26 -2
- package/generated/plugins/agdf/mcp/server/package.json +3 -3
- package/generated/plugins/agdf/mcp/server/src/generation-runtime.js +14 -3
- package/generated/plugins/agdf/mcp/server/src/generation.js +8 -2
- package/generated/plugins/agdf/mcp/server/src/main.js +5 -1
- package/generated/plugins/agdf/mcp/server/src/next-action.js +227 -0
- package/generated/plugins/agdf/mcp/server/src/prepared-call-transport.js +306 -0
- package/generated/plugins/agdf/mcp/server/src/safe-read-continuation.js +62 -0
- package/generated/plugins/agdf/mcp/server/src/server.js +155 -37
- package/generated/plugins/agdf/mcp/server/ui/cockpit.html +130 -33
- package/generated/plugins/agdf/mcp/server/ui/decision-manifest.json +3 -3
- package/generated/plugins/agdf/mcp/server/ui/decision.html +3 -3
- package/generated/plugins/agdf/mcp/server/ui/manifest.json +3 -3
- package/generated/plugins/agdf/meta/agdf-interaction-locales.json +436 -2
- package/generated/plugins/agdf/meta/agdf-mcp-capability.json +1 -1
- package/generated/plugins/agdf/meta/agdf-plugin.definition.json +1 -1
- package/generated/plugins/agdf/meta/contracts/gate-artifact-preparation.md +9 -3
- package/generated/plugins/agdf/meta/contracts/interaction.md +10 -4
- package/generated/plugins/agdf/meta/contracts/modes.md +5 -0
- package/generated/plugins/agdf/meta/contracts/prd-definition.md +40 -1
- package/generated/plugins/agdf/meta/contracts/quality.md +35 -0
- package/generated/plugins/agdf/meta/contracts/request-activation.md +6 -3
- package/generated/plugins/agdf/meta/contracts/sd-definition.md +46 -0
- package/generated/plugins/agdf/meta/contracts/tp-definition.md +8 -0
- package/generated/plugins/agdf/meta/contracts/ur-definition.md +9 -5
- package/generated/plugins/agdf/meta/copilot-payload-baseline.json +3 -3
- package/generated/plugins/agdf/meta/distribution-profile-history.json +14 -0
- package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/agdf-interaction-locales.json +436 -2
- package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/agdf-plugin.definition.json +1 -1
- package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/gate-artifact-preparation.md +9 -3
- package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/interaction.md +10 -4
- package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/modes.md +5 -0
- package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/prd-definition.md +40 -1
- package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/quality.md +35 -0
- package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/request-activation.md +6 -3
- package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/sd-definition.md +46 -0
- package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/tp-definition.md +8 -0
- package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/ur-definition.md +9 -5
- package/generated/plugins/agdf/runtime/create-agdf/lib/cli/command-registry.js +2 -1
- package/generated/plugins/agdf/runtime/create-agdf/lib/cli/parse-args.js +7 -4
- package/generated/plugins/agdf/runtime/create-agdf/lib/cli/project-read-command.js +29 -0
- package/generated/plugins/agdf/runtime/create-agdf/lib/cli/validation-handlers.js +2 -1
- package/generated/plugins/agdf/runtime/create-agdf/lib/mcp-dispatch-runtime.js +36 -7
- package/generated/plugins/agdf/runtime/create-agdf/lib/mcp-lifecycle/package.js +7 -0
- package/generated/plugins/agdf/runtime/create-agdf/lib/mcp-lifecycle/plugin-runtime.js +34 -6
- package/generated/plugins/agdf/runtime/create-agdf/lib/mcp-lifecycle/prepared-call-journal.js +269 -0
- package/generated/plugins/agdf/runtime/create-agdf/lib/mcp-worker-runtime.js +86 -83
- package/generated/plugins/agdf/runtime/create-agdf/lib/runtime/validator-application.js +2 -2
- package/generated/plugins/agdf/runtime/create-agdf/package.json +1 -1
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/companion/events.js +157 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/companion/figure-state.js +38 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/companion/journal.js +186 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/companion/run-view.js +227 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/acceptance-criteria.js +2 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/closeout-readiness.js +24 -6
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/decision-content-placeholder.js +4 -1
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/gate-check.js +49 -7
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/gate-policy-inputs.js +2 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/gate-policy-pure.js +7 -3
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/prd-readiness.js +7 -2
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/report-decision.js +9 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/traceability-readiness.js +57 -8
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/ur-readiness.js +15 -2
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/artifact-readiness.js +5 -3
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/authoring-inputs.js +107 -22
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/cockpit-list.js +10 -8
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/cockpit-session.js +11 -3
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/cockpit-work.js +4 -2
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/cockpit.js +47 -33
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/contract.js +64 -24
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/material-recording-calls.js +54 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/project-state.js +2 -1
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/run-classification.js +31 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/selection.js +6 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/service.js +32 -5
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/work-situation.js +25 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-read/cockpit-worker.js +1 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/authoring-text-handoff.js +3 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/input-resolution.js +7 -5
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/material-limits.js +4 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/prepared-control-calls.js +137 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/presentation-delivery.js +4 -1
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-command-contract.js +10 -4
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-command-schema.js +9 -3
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-command-service.js +35 -11
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-create-command.js +6 -1
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-identity.js +2 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-inventory-reader.js +54 -5
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-inventory.js +12 -27
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-material.js +25 -7
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-presentation-render.js +113 -28
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-revision.js +38 -20
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-source-revisions.js +37 -17
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-state-reader.js +10 -3
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-steps.js +8 -5
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-title.js +43 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/index.js +3 -1
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/interaction-catalog-validation.js +7 -1
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/interaction-catalog.js +8 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/interaction-presentation.js +31 -10
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/mcp-input-hints.js +30 -1
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/mcp-tool-errors.js +5 -3
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/resources/canonical-init-plan.js +1 -1
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/runtime/plugin-provenance.js +9 -2
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/contract.js +6 -4
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/delivery-intake.js +3 -1
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/mcp-continuation.js +25 -2
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/prd-definition.js +3 -2
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/readiness-findings.js +7 -0
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/sd-definition.js +4 -2
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/service.js +17 -4
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/tp-definition.js +4 -2
- package/generated/plugins/agdf/runtime/runtime-manifest.json +2 -2
- package/generated/plugins/agdf/scripts/check-runtime-integrity.mjs +4 -3
- package/generated/plugins/agdf/skills/ux-intent-definition/SKILL.md +31 -2
- package/generated/plugins/agdf/skills/ux-intent-definition/help.md +8 -1
- package/generated/plugins/agdf/submission/openai/availability.md +1 -1
- package/generated/plugins/agdf/submission/openai/capability-matrix.json +1 -1
- package/generated/plugins/agdf/submission/openai/release-notes.md +5 -8
- package/generated/plugins/agdf/submission/openai/reviewer-cases.json +1 -1
- package/generated/plugins/agdf-planning/.codex-plugin/plugin.json +1 -1
- package/generated/plugins/agdf-planning/plugin.json +1 -1
- package/generated/plugins/copilot/agdf/.agdf-payload-inventory.json +358 -203
- package/generated/plugins/copilot/agdf/control/README.md +5 -0
- package/generated/plugins/copilot/agdf/control/templates/BRAND.md +28 -0
- package/generated/plugins/copilot/agdf/control/templates/artefacts/PRD.md +11 -0
- package/generated/plugins/copilot/agdf/control/templates/artefacts/SD.md +4 -0
- package/generated/plugins/copilot/agdf/control/templates/artefacts/UX_INTENT_DEFINITION.md +1 -1
- package/generated/plugins/copilot/agdf/mcp/server/README.md +26 -2
- package/generated/plugins/copilot/agdf/mcp/server/package.json +3 -3
- package/generated/plugins/copilot/agdf/mcp/server/src/generation-runtime.js +14 -3
- package/generated/plugins/copilot/agdf/mcp/server/src/generation.js +8 -2
- package/generated/plugins/copilot/agdf/mcp/server/src/main.js +5 -1
- package/generated/plugins/copilot/agdf/mcp/server/src/next-action.js +227 -0
- package/generated/plugins/copilot/agdf/mcp/server/src/prepared-call-transport.js +306 -0
- package/generated/plugins/copilot/agdf/mcp/server/src/safe-read-continuation.js +62 -0
- package/generated/plugins/copilot/agdf/mcp/server/src/server.js +155 -37
- package/generated/plugins/copilot/agdf/meta/agdf-plugin.definition.json +1 -1
- package/generated/plugins/copilot/agdf/meta/distribution-profile-history.json +14 -0
- package/generated/plugins/copilot/agdf/plugin.json +1 -1
- package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/agdf-interaction-locales.json +436 -2
- package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/agdf-plugin.definition.json +1 -1
- package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/gate-artifact-preparation.md +9 -3
- package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/interaction.md +10 -4
- package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/modes.md +5 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/prd-definition.md +40 -1
- package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/quality.md +35 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/request-activation.md +6 -3
- package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/sd-definition.md +46 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/tp-definition.md +8 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/ur-definition.md +9 -5
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/command-registry.js +2 -1
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/parse-args.js +7 -4
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/project-read-command.js +29 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/validation-handlers.js +2 -1
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/mcp-dispatch-runtime.js +36 -7
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/mcp-lifecycle/package.js +7 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/mcp-lifecycle/plugin-runtime.js +34 -6
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/mcp-lifecycle/prepared-call-journal.js +269 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/mcp-worker-runtime.js +81 -78
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/runtime/validator-application.js +2 -2
- package/generated/plugins/copilot/agdf/runtime/create-agdf/package.json +1 -1
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/companion/events.js +157 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/companion/figure-state.js +38 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/companion/journal.js +186 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/companion/run-view.js +227 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/acceptance-criteria.js +2 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/closeout-readiness.js +24 -6
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/decision-content-placeholder.js +4 -1
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/gate-check.js +49 -7
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/gate-policy-inputs.js +2 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/gate-policy-pure.js +7 -3
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/prd-readiness.js +7 -2
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/report-decision.js +9 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/traceability-readiness.js +57 -8
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/ur-readiness.js +15 -2
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/artifact-readiness.js +5 -3
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/authoring-inputs.js +107 -22
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/contract.js +64 -24
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/material-recording-calls.js +54 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/project-state.js +2 -1
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/run-classification.js +31 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/selection.js +6 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/service.js +32 -5
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/work-situation.js +25 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/authoring-text-handoff.js +3 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/input-resolution.js +7 -5
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/material-limits.js +4 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/prepared-control-calls.js +137 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/presentation-delivery.js +4 -1
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-command-contract.js +10 -4
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-command-schema.js +9 -3
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-command-service.js +35 -11
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-create-command.js +6 -1
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-identity.js +2 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-inventory-reader.js +54 -5
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-inventory.js +12 -27
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-material.js +25 -7
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-presentation-render.js +113 -28
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-revision.js +38 -20
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-source-revisions.js +37 -17
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-state-reader.js +10 -3
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-steps.js +8 -5
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-title.js +43 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/index.js +3 -1
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/interaction-catalog-validation.js +7 -1
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/interaction-catalog.js +8 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/interaction-presentation.js +31 -10
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/mcp-input-hints.js +30 -1
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/mcp-tool-errors.js +5 -3
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/resources/canonical-init-plan.js +1 -1
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/runtime/plugin-provenance.js +9 -2
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/contract.js +6 -4
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/delivery-intake.js +3 -1
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/mcp-continuation.js +25 -2
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/prd-definition.js +3 -2
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/readiness-findings.js +7 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/sd-definition.js +4 -2
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/service.js +17 -4
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/tp-definition.js +4 -2
- package/generated/plugins/copilot/agdf/runtime/runtime-manifest.json +2 -2
- package/generated/plugins/copilot/agdf/skills/agdf-interaction-locales.json +1 -1
- package/generated/plugins/copilot/agdf/skills/agdf-ux-intent-definition/SKILL.md +31 -2
- package/generated/plugins/copilot/agdf/skills/contracts/gate-artifact-preparation.md +9 -3
- package/generated/plugins/copilot/agdf/skills/contracts/interaction.md +10 -4
- package/generated/plugins/copilot/agdf/skills/contracts/modes.md +5 -0
- package/generated/plugins/copilot/agdf/skills/contracts/prd-definition.md +40 -1
- package/generated/plugins/copilot/agdf/skills/contracts/quality.md +35 -0
- package/generated/plugins/copilot/agdf/skills/contracts/request-activation.md +6 -3
- package/generated/plugins/copilot/agdf/skills/contracts/sd-definition.md +46 -0
- package/generated/plugins/copilot/agdf/skills/contracts/tp-definition.md +8 -0
- package/generated/plugins/copilot/agdf/skills/contracts/ur-definition.md +9 -5
- package/generated/submissions/openai/agdf/.codex-plugin/plugin.json +1 -1
- package/generated/submissions/openai/agdf/meta/agdf-interaction-locales.json +436 -2
- package/generated/submissions/openai/agdf/meta/agdf-plugin.definition.json +1 -1
- package/generated/submissions/openai/agdf/meta/contracts/gate-artifact-preparation.md +9 -3
- package/generated/submissions/openai/agdf/meta/contracts/interaction.md +10 -4
- package/generated/submissions/openai/agdf/meta/contracts/modes.md +5 -0
- package/generated/submissions/openai/agdf/meta/contracts/prd-definition.md +40 -1
- package/generated/submissions/openai/agdf/meta/contracts/quality.md +35 -0
- package/generated/submissions/openai/agdf/meta/contracts/request-activation.md +6 -3
- package/generated/submissions/openai/agdf/meta/contracts/sd-definition.md +46 -0
- package/generated/submissions/openai/agdf/meta/contracts/tp-definition.md +8 -0
- package/generated/submissions/openai/agdf/meta/contracts/ur-definition.md +9 -5
- package/generated/submissions/openai/agdf/meta/copilot-payload-baseline.json +3 -3
- package/generated/submissions/openai/agdf/meta/distribution-profile-history.json +14 -0
- package/generated/submissions/openai/agdf/plugin.json +1 -1
- package/generated/submissions/openai/agdf/skills/ux-intent-definition/SKILL.md +31 -2
- package/generated/submissions/openai/agdf/skills/ux-intent-definition/help.md +8 -1
- package/generated/submissions/openai/agdf/submission/openai/availability.md +1 -1
- package/generated/submissions/openai/agdf/submission/openai/capability-matrix.json +1 -1
- package/generated/submissions/openai/agdf/submission/openai/inventory.json +24 -24
- package/generated/submissions/openai/agdf/submission/openai/listing.json +1 -1
- package/generated/submissions/openai/agdf/submission/openai/readiness.json +2 -2
- package/generated/submissions/openai/agdf/submission/openai/readiness.md +2 -2
- package/generated/submissions/openai/agdf/submission/openai/release-notes.md +5 -8
- package/generated/submissions/openai/agdf/submission/openai/reviewer-cases.json +1 -1
- package/lib/cli/command-registry.js +2 -1
- package/lib/cli/parse-args.js +7 -4
- package/lib/cli/project-read-command.js +29 -0
- package/lib/cli/validation-handlers.js +2 -1
- package/lib/mcp-dispatch-runtime.js +36 -7
- package/lib/mcp-lifecycle/package.js +7 -0
- package/lib/mcp-lifecycle/plugin-runtime.js +34 -6
- package/lib/mcp-lifecycle/prepared-call-journal.js +269 -0
- package/lib/mcp-worker-runtime.js +86 -83
- package/lib/runtime/validator-application.js +2 -2
- package/lib/scaffold/plan.js +2 -0
- package/package.json +1 -1
- package/runtime/core/lib/companion/events.js +157 -0
- package/runtime/core/lib/companion/figure-state.js +38 -0
- package/runtime/core/lib/companion/journal.js +186 -0
- package/runtime/core/lib/companion/run-view.js +227 -0
- package/runtime/core/lib/control-evaluation/acceptance-criteria.js +2 -0
- package/runtime/core/lib/control-evaluation/closeout-readiness.js +24 -6
- package/runtime/core/lib/control-evaluation/decision-content-placeholder.js +4 -1
- package/runtime/core/lib/control-evaluation/gate-check.js +49 -7
- package/runtime/core/lib/control-evaluation/gate-policy-inputs.js +2 -0
- package/runtime/core/lib/control-evaluation/gate-policy-pure.js +7 -3
- package/runtime/core/lib/control-evaluation/prd-readiness.js +7 -2
- package/runtime/core/lib/control-evaluation/report-decision.js +9 -0
- package/runtime/core/lib/control-evaluation/traceability-readiness.js +57 -8
- package/runtime/core/lib/control-evaluation/ur-readiness.js +15 -2
- package/runtime/core/lib/control-inspect/artifact-readiness.js +5 -3
- package/runtime/core/lib/control-inspect/authoring-inputs.js +107 -22
- package/runtime/core/lib/control-inspect/cockpit-list.js +10 -8
- package/runtime/core/lib/control-inspect/cockpit-session.js +11 -3
- package/runtime/core/lib/control-inspect/cockpit-work.js +4 -2
- package/runtime/core/lib/control-inspect/cockpit.js +47 -33
- package/runtime/core/lib/control-inspect/contract.js +64 -24
- package/runtime/core/lib/control-inspect/material-recording-calls.js +54 -0
- package/runtime/core/lib/control-inspect/project-state.js +2 -1
- package/runtime/core/lib/control-inspect/run-classification.js +31 -0
- package/runtime/core/lib/control-inspect/selection.js +6 -0
- package/runtime/core/lib/control-inspect/service.js +32 -5
- package/runtime/core/lib/control-inspect/work-situation.js +25 -0
- package/runtime/core/lib/control-read/cockpit-worker.js +1 -0
- package/runtime/core/lib/control-state/authoring-text-handoff.js +3 -0
- package/runtime/core/lib/control-state/input-resolution.js +7 -5
- package/runtime/core/lib/control-state/material-limits.js +4 -0
- package/runtime/core/lib/control-state/prepared-control-calls.js +137 -0
- package/runtime/core/lib/control-state/presentation-delivery.js +4 -1
- package/runtime/core/lib/control-state/run-command-contract.js +10 -4
- package/runtime/core/lib/control-state/run-command-schema.js +9 -3
- package/runtime/core/lib/control-state/run-command-service.js +35 -11
- package/runtime/core/lib/control-state/run-create-command.js +6 -1
- package/runtime/core/lib/control-state/run-identity.js +2 -0
- package/runtime/core/lib/control-state/run-inventory-reader.js +54 -5
- package/runtime/core/lib/control-state/run-inventory.js +12 -27
- package/runtime/core/lib/control-state/run-material.js +25 -7
- package/runtime/core/lib/control-state/run-presentation-render.js +113 -28
- package/runtime/core/lib/control-state/run-revision.js +38 -20
- package/runtime/core/lib/control-state/run-source-revisions.js +37 -17
- package/runtime/core/lib/control-state/run-state-reader.js +10 -3
- package/runtime/core/lib/control-state/run-steps.js +8 -5
- package/runtime/core/lib/control-state/run-title.js +43 -0
- package/runtime/core/lib/index.js +3 -1
- package/runtime/core/lib/interaction-catalog-validation.js +7 -1
- package/runtime/core/lib/interaction-catalog.js +8 -0
- package/runtime/core/lib/interaction-presentation.js +31 -10
- package/runtime/core/lib/mcp-input-hints.js +30 -1
- package/runtime/core/lib/mcp-tool-errors.js +5 -3
- package/runtime/core/lib/resources/canonical-init-plan.js +1 -1
- package/runtime/core/lib/runtime/plugin-provenance.js +9 -2
- package/runtime/core/lib/skill-dispatch/contract.js +6 -4
- package/runtime/core/lib/skill-dispatch/delivery-intake.js +3 -1
- package/runtime/core/lib/skill-dispatch/mcp-continuation.js +25 -2
- package/runtime/core/lib/skill-dispatch/prd-definition.js +3 -2
- package/runtime/core/lib/skill-dispatch/readiness-findings.js +7 -0
- package/runtime/core/lib/skill-dispatch/sd-definition.js +4 -2
- package/runtime/core/lib/skill-dispatch/service.js +17 -4
- package/runtime/core/lib/skill-dispatch/tp-definition.js +4 -2
- package/generated/plugins/agdf/companion/core.mjs +0 -16
- package/generated/plugins/agdf/companion/locales.json +0 -200
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { createPreparedCallTransport, preparedTransportSchema } from './prepared-call-transport.js';
|
|
2
|
+
import { appendSafeReadContinuation, nextActionOutputSchema } from './safe-read-continuation.js';
|
|
3
|
+
import { createNextActionProjection } from './next-action.js';
|
|
1
4
|
import { boundStdioOutput } from './stdio-output.js';
|
|
2
5
|
import { McpServer, ProtocolError, ProtocolErrorCode, fromJsonSchema } from "@modelcontextprotocol/server";
|
|
3
6
|
import { serveStdio, StdioServerTransport } from "@modelcontextprotocol/server/stdio";
|
|
@@ -11,14 +14,40 @@ import { requestDeclaresMcpAppUi, requestMcpClientInfo, requestMcpClientCapabili
|
|
|
11
14
|
|
|
12
15
|
export const SERVER_NAME = "agdf-mcp";
|
|
13
16
|
|
|
14
|
-
|
|
17
|
+
// A folded follow-up read is a convenience. Hosts move large tool output into
|
|
18
|
+
// files (Claude Code from roughly 80 KB of text), which costs the model more
|
|
19
|
+
// round trips than a separate read, so a read is inlined only below this size.
|
|
20
|
+
const INLINE_READ_TEXT_BYTES = 48 * 1024;
|
|
21
|
+
const byteLength = value => Buffer.byteLength(typeof value === 'string' ? value : JSON.stringify(value), 'utf8');
|
|
22
|
+
|
|
23
|
+
function omittedFollowup(nextRead) {
|
|
24
|
+
return { ...nextRead, result: null, failure: {
|
|
25
|
+
code: 'read_followup_output_limit', phase: 'wire_budget', original_effect_unchanged: true,
|
|
26
|
+
instruction: 'The original result and receipt are unchanged. Its follow-up read was not inlined to keep this response small; run only that supplied read call separately.',
|
|
27
|
+
} };
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function toolResult(runtime, name, input, result, { serialize = runtime.serialize, consume = runtime.consumeToolResult,
|
|
31
|
+
provider, peer, facts, preparedCalls, actions, nextRead } = {}) {
|
|
15
32
|
// A generation must supply its own descriptor. Never reinterpret old results
|
|
16
33
|
// with the facade's current runtime. Local owners project after postprocessing.
|
|
17
|
-
const emit = value => {
|
|
34
|
+
const emit = (value, { followup, decorate = true } = {}) => {
|
|
18
35
|
const projected = Object.hasOwn(value._meta ?? {}, 'agdf/tool-result') || runtime.requiresProjectedResult ? value
|
|
19
36
|
: runtime.projectToolResult(name, input, value, facts);
|
|
20
|
-
const { domain, metadata, descriptor } =
|
|
21
|
-
|
|
37
|
+
const { domain, metadata, descriptor } = consume(name, projected);
|
|
38
|
+
// Validate and bound the canonical domain with its existing owner first.
|
|
39
|
+
// Additive MCP navigation has its own explicit wire projection; it is not
|
|
40
|
+
// passed back into a closed Core result serializer as canonical state.
|
|
41
|
+
const canonical = JSON.parse(serialize(domain));
|
|
42
|
+
const navigable = followup ? { ...canonical, next_read: followup } : canonical;
|
|
43
|
+
const decorated = decorate && preparedCalls ? preparedCalls.decorate(navigable) : navigable;
|
|
44
|
+
if (decorated.next_read?.result?.report?.material_transport?.instructions) {
|
|
45
|
+
const transport = decorated.next_read.result.report.material_transport;
|
|
46
|
+
transport.instructions = transport.instructions.replaceAll('response.structuredContent.report',
|
|
47
|
+
'response.structuredContent.next_read.result.report').replaceAll('JSON.parse(response.content[0].text).report',
|
|
48
|
+
'JSON.parse(response.content[0].text).next_read.result.report');
|
|
49
|
+
}
|
|
50
|
+
const text = JSON.stringify(actions ? actions.project(decorated) : decorated);
|
|
22
51
|
const response = {
|
|
23
52
|
content: [{ type: 'text', text: domain.presentation_delivery?.text ?? text },
|
|
24
53
|
...(descriptor.failed ? [{ type: 'text', text: descriptor.message }] : [])],
|
|
@@ -29,18 +58,29 @@ function toolResult(runtime, name, input, result, serialize = runtime.serialize,
|
|
|
29
58
|
};
|
|
30
59
|
return response;
|
|
31
60
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
61
|
+
const withinLimit = response => !runtime.responseLimit || byteLength(response) <= runtime.responseLimit;
|
|
62
|
+
// Optional additions are dropped before the result itself is touched: first the
|
|
63
|
+
// inlined read, then the transport decoration (whose recovery copies can double
|
|
64
|
+
// large forms). Only a canonical result that alone exceeds the limit becomes
|
|
65
|
+
// resource_limit, so navigation can never turn a committed write into unknown.
|
|
66
|
+
const variants = [
|
|
67
|
+
...(nextRead?.result ? [{ followup: nextRead, inlineRead: true }] : []),
|
|
68
|
+
...(nextRead ? [{ followup: nextRead.result ? omittedFollowup(nextRead) : nextRead }] : []),
|
|
69
|
+
{}, { decorate: false },
|
|
70
|
+
];
|
|
71
|
+
for (const { inlineRead, ...variant } of variants) {
|
|
72
|
+
const response = emit(result, variant);
|
|
73
|
+
if (withinLimit(response) && (!inlineRead || byteLength(response.content[0].text) <= INLINE_READ_TEXT_BYTES)) return response;
|
|
39
74
|
}
|
|
75
|
+
// The fallback itself is projected, checked and measured; no recursive call.
|
|
76
|
+
const limitFacts = { code: 'resource_limit', dispatch: 'unknown' };
|
|
77
|
+
const failure = runtime.projectToolResult(name, input, runtime.failure('resource_limit', name, input, limitFacts), limitFacts);
|
|
78
|
+
const response = emit(failure);
|
|
79
|
+
if (!withinLimit(response)) throw Error('tool_result_invalid');
|
|
40
80
|
return response;
|
|
41
81
|
}
|
|
42
82
|
|
|
43
|
-
export function buildAgdfServer({ runtime, executor, era } = {}) {
|
|
83
|
+
export function buildAgdfServer({ runtime, executor, era, preparedCallStore } = {}) {
|
|
44
84
|
if (!runtime?.definition || typeof runtime.serialize !== "function") {
|
|
45
85
|
throw new TypeError("AGDF MCP runtime is required");
|
|
46
86
|
}
|
|
@@ -48,6 +88,15 @@ export function buildAgdfServer({ runtime, executor, era } = {}) {
|
|
|
48
88
|
throw new TypeError("AGDF MCP owned runtime is required");
|
|
49
89
|
}
|
|
50
90
|
const tools = runtime.tools ?? [{ name: runtime.definition.name, definition: runtime.definition, parse: runtime.parse, execute: runtime.execute }];
|
|
91
|
+
// Discovery and retained reads share the original SDK validators. Compile
|
|
92
|
+
// lazily; constructing the transport never validates or executes a request.
|
|
93
|
+
const schemaProvider = new AjvJsonSchemaValidator();
|
|
94
|
+
const deferredSchemas = { getValidator(schema) {
|
|
95
|
+
let validate;
|
|
96
|
+
return value => (validate ??= schemaProvider.getValidator(schema))(value);
|
|
97
|
+
} };
|
|
98
|
+
const inspectTool = tools.find(tool => tool.name === 'agdf_inspect');
|
|
99
|
+
const validateInspect = inspectTool && deferredSchemas.getValidator(inspectTool.definition.inputSchema);
|
|
51
100
|
const dispatchExecutor = executor ?? {
|
|
52
101
|
execute: async (argumentsValue, { toolName, signal } = {}) => {
|
|
53
102
|
const tool = tools.find((entry) => entry.name === (toolName ?? runtime.definition.name));
|
|
@@ -59,7 +108,14 @@ export function buildAgdfServer({ runtime, executor, era } = {}) {
|
|
|
59
108
|
},
|
|
60
109
|
close: async () => runtime.close?.(),
|
|
61
110
|
};
|
|
62
|
-
const registrations = new Map()
|
|
111
|
+
const registrations = new Map(), preparedCalls = createPreparedCallTransport({
|
|
112
|
+
store: preparedCallStore,
|
|
113
|
+
// A read reference retains a supplied canonical request, never an inferred
|
|
114
|
+
// target. Validate the unwrapped arguments with the original SDK schema.
|
|
115
|
+
validateRead: call => inspectTool?.definition.annotations?.readOnlyHint === true
|
|
116
|
+
&& validateInspect(call.arguments).valid,
|
|
117
|
+
}),
|
|
118
|
+
actions = createNextActionProjection({ isAvailable: call => preparedCalls.isAvailable(call) });
|
|
63
119
|
class AgdfServer extends McpServer {
|
|
64
120
|
async connect(transport) {
|
|
65
121
|
return super.connect(capabilityTransport(transport, message => modernToolUiDenial(message,
|
|
@@ -68,7 +124,8 @@ export function buildAgdfServer({ runtime, executor, era } = {}) {
|
|
|
68
124
|
}
|
|
69
125
|
const server = new AgdfServer(
|
|
70
126
|
{ name: SERVER_NAME, version: runtime.trustedContext.expectedVersion },
|
|
71
|
-
{ capabilities: { tools: {}, ...(runtime.ui ? { resources: {} } : {}) }
|
|
127
|
+
{ capabilities: { tools: {}, ...(runtime.ui ? { resources: {} } : {}) },
|
|
128
|
+
instructions: 'Use the returned next_action.call as the normal path for reads and writes. Fill only its named inputs from actual authored content, review or a new deliberate reply; ready calls retain inputs:{} and are forwarded unchanged. The adapter retains the exact target, Run, revision, selectors and original operation identity. Do not reconstruct raw reads or status requests, retype references or use cloning helpers. Owned plugin references retain their original lifetime across reconnects at the same runtime; other connections use explicit recovery_only instructions and the saved original request. A safe inspect may already be included as next_read.result; consume it without repeating it. next_read.tool/arguments describe that executed read; next_read.call is its supplied retry only. A terminal action stops work. No reference or continuation grants authority or approval.' },
|
|
72
129
|
);
|
|
73
130
|
// Capability checks guard execution and resource access. Codex must first
|
|
74
131
|
// discover the plugin tool metadata before selecting its UI-capable route.
|
|
@@ -81,26 +138,66 @@ export function buildAgdfServer({ runtime, executor, era } = {}) {
|
|
|
81
138
|
connection_id: randomUUID(), server_module: fileURLToPath(import.meta.url),
|
|
82
139
|
version: runtime.trustedContext.expectedVersion,
|
|
83
140
|
}) : undefined;
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
141
|
+
// The handler validates a result before choosing its follow-up read; the
|
|
142
|
+
// response variants then reuse that validation instead of repeating it.
|
|
143
|
+
const consumed = new WeakMap();
|
|
144
|
+
const consume = (name, value) => {
|
|
145
|
+
if (!consumed.has(value)) consumed.set(value, runtime.consumeToolResult(name, value));
|
|
146
|
+
return consumed.get(value);
|
|
147
|
+
};
|
|
148
|
+
const respond = (name, input, result, serialize, context, facts, nextRead) => toolResult(runtime, name, input, result, {
|
|
149
|
+
serialize, consume, provider, facts, preparedCalls, actions, nextRead, peer: provider ? {
|
|
150
|
+
client_info: requestMcpClientInfo(server.server, context), capabilities: requestMcpClientCapabilities(server.server, context),
|
|
151
|
+
} : undefined });
|
|
152
|
+
// Companion events (SD SDD-006): only the process that executed a call journals its final result.
|
|
153
|
+
// Behind the generation facade (projected results) the generation has journaled every result it
|
|
154
|
+
// produced; a failure thrown here (lost connection, unknown response, unavailable generation,
|
|
155
|
+
// expired session) never reached a generation result, so the facade journals it itself.
|
|
156
|
+
const journaling = () => !runtime.requiresProjectedResult && typeof runtime.observeOutcome === 'function';
|
|
157
|
+
const journalingFailures = () => typeof runtime.observeOutcome === 'function';
|
|
158
|
+
const journal = (name, input, projected) => {
|
|
159
|
+
try { return runtime.observeOutcome(name, input, projected) === true; } catch { return false; /* notification only */ }
|
|
160
|
+
};
|
|
161
|
+
// Whether a result the generation returned left an event there (it journals what it produces).
|
|
162
|
+
const generationJournaled = (name, input, result) => {
|
|
163
|
+
if (!runtime.requiresProjectedResult || !result) return false;
|
|
164
|
+
try { return runtime.observesOutcome?.(name, input, result) === true; } catch { return false; }
|
|
165
|
+
};
|
|
87
166
|
const uiAllowed = (context) => !gated || requestDeclaresMcpAppUi(server.server, context, runtime.ui.mimeType);
|
|
88
167
|
const supportsUi = context => !!runtime.ui && requestDeclaresMcpAppUi(server.server, context, runtime.ui.mimeType);
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
168
|
+
const nextRead = async (result, context) => appendSafeReadContinuation(result, {
|
|
169
|
+
allowed: !context.signal?.aborted && !!inspectTool && inspectTool.definition.annotations?.readOnlyHint === true
|
|
170
|
+
&& uiAllowed(context) && (!inspectTool.requiresUi || supportsUi(context)),
|
|
171
|
+
validate: call => ['working_directory', 'presentation_language', 'primary_target', 'target_source']
|
|
172
|
+
.every(key => typeof call.arguments[key] === 'string' && call.arguments[key].length)
|
|
173
|
+
&& validateInspect(call.arguments).valid,
|
|
174
|
+
execute: async call => {
|
|
175
|
+
const name = call.tool;
|
|
176
|
+
const input = runtime.prepareInput?.(name, call.arguments) ?? call.arguments;
|
|
177
|
+
const parentOwned = typeof inspectTool.parentOwned === 'function' ? inspectTool.parentOwned(input) : inspectTool.parentOwned;
|
|
178
|
+
let observed = parentOwned
|
|
179
|
+
? await inspectTool.execute(inspectTool.parse(input), context.signal,
|
|
180
|
+
{ client: requestMcpClientInfo(server.server, context), uiSupported: supportsUi(context) })
|
|
181
|
+
: await dispatchExecutor.execute(input, { signal: context.signal, toolName: name,
|
|
182
|
+
trusted: runtime.prepareDispatch?.(name, input) });
|
|
183
|
+
if (runtime.postprocessToolResult) observed = await runtime.postprocessToolResult(name, input, observed,
|
|
184
|
+
{ uiSupported: supportsUi(context), client: requestMcpClientInfo(server.server, context) });
|
|
185
|
+
const projected = runtime.projectToolResult(name, input, observed);
|
|
186
|
+
const { domain } = runtime.consumeToolResult(name, projected);
|
|
187
|
+
return JSON.parse((inspectTool.serialize ?? runtime.serialize)(domain));
|
|
188
|
+
},
|
|
189
|
+
});
|
|
97
190
|
for (const tool of tools) {
|
|
98
191
|
const { name, definition, serialize } = tool;
|
|
99
|
-
const schema = fromJsonSchema(definition.inputSchema, { getValidator(inputSchema) {
|
|
192
|
+
const schema = fromJsonSchema(preparedTransportSchema(name, definition.inputSchema), { getValidator(inputSchema) {
|
|
100
193
|
const validate = deferredSchemas.getValidator(inputSchema);
|
|
101
194
|
return input => {
|
|
102
195
|
const checked = validate(input);
|
|
103
196
|
if (checked.valid) return checked;
|
|
197
|
+
const preparedHint = preparedCalls.validationHint(name, input);
|
|
198
|
+
// Validation has already failed. The exact transport correction is more
|
|
199
|
+
// useful here than every unrelated alternative in the raw-command union.
|
|
200
|
+
if (preparedHint) return { ...checked, errorMessage: preparedHint };
|
|
104
201
|
const hint = runtime.inputValidationHint?.(name, input);
|
|
105
202
|
return hint ? { ...checked, errorMessage: `${hint} Schema: ${checked.errorMessage}` } : checked;
|
|
106
203
|
};
|
|
@@ -111,7 +208,7 @@ export function buildAgdfServer({ runtime, executor, era } = {}) {
|
|
|
111
208
|
description: definition.description,
|
|
112
209
|
annotations: definition.annotations,
|
|
113
210
|
inputSchema: schema,
|
|
114
|
-
...(definition.outputSchema ? { outputSchema: fromJsonSchema(definition.outputSchema, deferredSchemas) } : {}),
|
|
211
|
+
...(definition.outputSchema ? { outputSchema: fromJsonSchema(nextActionOutputSchema(name, definition.outputSchema), deferredSchemas) } : {}),
|
|
115
212
|
...(definition._meta ? { _meta: definition._meta } : {}),
|
|
116
213
|
},
|
|
117
214
|
async (argumentsValue, context) => {
|
|
@@ -123,10 +220,14 @@ export function buildAgdfServer({ runtime, executor, era } = {}) {
|
|
|
123
220
|
const failure = runtime.projectToolResult(name, argumentsValue, runtime.failure(denied, name, argumentsValue, facts), facts);
|
|
124
221
|
return respond(name, argumentsValue, failure, serialize ?? runtime.serialize, context, facts);
|
|
125
222
|
}
|
|
126
|
-
|
|
127
|
-
let phase =
|
|
223
|
+
let parentOwned;
|
|
224
|
+
let phase = 'parse';
|
|
225
|
+
// Whether this call's result already left a companion event (written here or by its generation).
|
|
226
|
+
let journaled = false;
|
|
128
227
|
try {
|
|
129
228
|
phase = 'parse';
|
|
229
|
+
argumentsValue = preparedCalls.resolve(name, argumentsValue);
|
|
230
|
+
parentOwned = typeof tool.parentOwned === 'function' ? tool.parentOwned(argumentsValue) : tool.parentOwned;
|
|
130
231
|
argumentsValue = runtime.prepareInput?.(name, argumentsValue) ?? argumentsValue;
|
|
131
232
|
phase = parentOwned ? 'parse' : 'execute';
|
|
132
233
|
let result;
|
|
@@ -134,17 +235,34 @@ export function buildAgdfServer({ runtime, executor, era } = {}) {
|
|
|
134
235
|
const parsed = tool.parse(argumentsValue); phase = 'execute';
|
|
135
236
|
result = await tool.execute(parsed, context.signal,
|
|
136
237
|
{ client: requestMcpClientInfo(server.server, context), uiSupported: supportsUi(context) });
|
|
137
|
-
} else
|
|
138
|
-
|
|
238
|
+
} else {
|
|
239
|
+
result = await dispatchExecutor.execute(argumentsValue, { signal: context.signal, toolName: name,
|
|
240
|
+
trusted: runtime.prepareDispatch?.(name, argumentsValue) });
|
|
241
|
+
}
|
|
242
|
+
// Behind the facade the generation journaled the result it returned.
|
|
243
|
+
journaled = generationJournaled(name, argumentsValue, result);
|
|
139
244
|
if (runtime.postprocessToolResult) result = await runtime.postprocessToolResult(name, argumentsValue, result,
|
|
140
245
|
{ uiSupported: supportsUi(context), client: requestMcpClientInfo(server.server, context) });
|
|
141
|
-
|
|
246
|
+
// Validate the producer and its canonical domain before consuming any
|
|
247
|
+
// supplied continuation. Malformed output must not start another read.
|
|
248
|
+
const checked = Object.hasOwn(result._meta ?? {}, 'agdf/tool-result') || runtime.requiresProjectedResult ? result
|
|
249
|
+
: runtime.projectToolResult(name, argumentsValue, result);
|
|
250
|
+
const { domain } = consume(name, checked);
|
|
251
|
+
if (journaling()) journaled = journal(name, argumentsValue, checked);
|
|
252
|
+
const continued = await nextRead(domain, context);
|
|
253
|
+
return respond(name, argumentsValue, checked, serialize ?? runtime.serialize, context, undefined, continued.next_read);
|
|
142
254
|
} catch (error) {
|
|
255
|
+
// A facade failure raised after its generation had replied carries that reply.
|
|
256
|
+
journaled ||= generationJournaled(name, argumentsValue, error?.generationResult);
|
|
143
257
|
const facts = runtime.normalizeFailure(error, { phase });
|
|
144
|
-
const
|
|
258
|
+
const help = phase === 'parse' ? preparedCalls.validationHint(name, argumentsValue) : '';
|
|
259
|
+
const failure = { ...runtime.failure(facts.code, name, argumentsValue, { ...facts, elapsed_ms: performance.now() - started }),
|
|
260
|
+
...(help ? { prepared_call_help: help } : {}) };
|
|
145
261
|
// A local execution/delivery failure is owned here, including malformed
|
|
146
262
|
// producer output. It never causes re-execution or a second write.
|
|
147
263
|
const projected = runtime.projectToolResult(name, argumentsValue, failure, facts);
|
|
264
|
+
// One call leaves at most one event: a failure after its result left an event adds none.
|
|
265
|
+
if (journalingFailures() && !journaled) journal(name, argumentsValue, projected);
|
|
148
266
|
return respond(name, argumentsValue, projected, serialize ?? runtime.serialize, context, facts);
|
|
149
267
|
}
|
|
150
268
|
},
|
|
@@ -166,7 +284,7 @@ export function buildAgdfServer({ runtime, executor, era } = {}) {
|
|
|
166
284
|
const listedTools = tools.map(({ name, definition }) => ({
|
|
167
285
|
name, description: definition.description, inputSchema: server.toolInputSchemaJson(name),
|
|
168
286
|
annotations: definition.annotations, ...(definition._meta ? { _meta: definition._meta } : {}),
|
|
169
|
-
...(definition.outputSchema ? { outputSchema: definition.outputSchema } : {}),
|
|
287
|
+
...(definition.outputSchema ? { outputSchema: nextActionOutputSchema(name, definition.outputSchema) } : {}),
|
|
170
288
|
}));
|
|
171
289
|
const listedResource = { uri: resource.uri, name: runtime.ui.label ?? 'AGDF Cockpit', mimeType: resource.mimeType, _meta: resource._meta };
|
|
172
290
|
server.server.removeRequestHandler("tools/list");
|
|
@@ -177,14 +295,14 @@ export function buildAgdfServer({ runtime, executor, era } = {}) {
|
|
|
177
295
|
}
|
|
178
296
|
}
|
|
179
297
|
return Object.assign(server, {
|
|
180
|
-
closeAgdfRuntime: async () => { await dispatchExecutor.close(); return runtime.close?.(); },
|
|
298
|
+
closeAgdfRuntime: async () => { preparedCalls.close(); actions.close(); await dispatchExecutor.close(); return runtime.close?.(); },
|
|
181
299
|
});
|
|
182
300
|
}
|
|
183
301
|
|
|
184
|
-
export function serveAgdfStdio({ runtime, executor, onerror } = {}) {
|
|
302
|
+
export function serveAgdfStdio({ runtime, executor, onerror, preparedCallStore } = {}) {
|
|
185
303
|
const instances = new Set();
|
|
186
304
|
const handle = serveStdio(({ era }) => {
|
|
187
|
-
const server = buildAgdfServer({ runtime, executor, era });
|
|
305
|
+
const server = buildAgdfServer({ runtime, executor, era, preparedCallStore });
|
|
188
306
|
instances.add(server);
|
|
189
307
|
return server;
|
|
190
308
|
}, {
|