wingfoil 0.2.1 → 0.3.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/README.md +88 -42
- package/dist/agent/discovery.d.ts +72 -0
- package/dist/agent/discovery.d.ts.map +1 -0
- package/dist/agent/discovery.js +210 -0
- package/dist/agent/discovery.js.map +1 -0
- package/dist/agent/execute.d.ts +206 -0
- package/dist/agent/execute.d.ts.map +1 -0
- package/dist/agent/execute.js +581 -0
- package/dist/agent/execute.js.map +1 -0
- package/dist/agent/index.d.ts +23 -0
- package/dist/agent/index.d.ts.map +1 -0
- package/dist/agent/index.js +85 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/agent/launch.d.ts +133 -0
- package/dist/agent/launch.d.ts.map +1 -0
- package/dist/agent/launch.js +380 -0
- package/dist/agent/launch.js.map +1 -0
- package/dist/agent/manifest.d.ts +30 -0
- package/dist/agent/manifest.d.ts.map +1 -0
- package/dist/agent/manifest.js +93 -0
- package/dist/agent/manifest.js.map +1 -0
- package/dist/agent/placeholders.d.ts +49 -0
- package/dist/agent/placeholders.d.ts.map +1 -0
- package/dist/agent/placeholders.js +177 -0
- package/dist/agent/placeholders.js.map +1 -0
- package/dist/agent/run-log.d.ts +254 -0
- package/dist/agent/run-log.d.ts.map +1 -0
- package/dist/agent/run-log.js +612 -0
- package/dist/agent/run-log.js.map +1 -0
- package/dist/agent/schema.d.ts +100 -0
- package/dist/agent/schema.d.ts.map +1 -0
- package/dist/agent/schema.js +89 -0
- package/dist/agent/schema.js.map +1 -0
- package/dist/agent/step.d.ts +41 -0
- package/dist/agent/step.d.ts.map +1 -0
- package/dist/agent/step.js +95 -0
- package/dist/agent/step.js.map +1 -0
- package/dist/build-info.json +4 -0
- package/dist/cli/error.d.ts +11 -2
- package/dist/cli/error.d.ts.map +1 -1
- package/dist/cli/error.js +27 -6
- package/dist/cli/error.js.map +1 -1
- package/dist/cli/exit.d.ts +33 -3
- package/dist/cli/exit.d.ts.map +1 -1
- package/dist/cli/exit.js +54 -3
- package/dist/cli/exit.js.map +1 -1
- package/dist/cli/index.d.ts +2 -2
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +3 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/init-command.d.ts.map +1 -1
- package/dist/cli/init-command.js +6 -3
- package/dist/cli/init-command.js.map +1 -1
- package/dist/cli/mcp-command.d.ts +13 -4
- package/dist/cli/mcp-command.d.ts.map +1 -1
- package/dist/cli/mcp-command.js +25 -8
- package/dist/cli/mcp-command.js.map +1 -1
- package/dist/cli/output.d.ts +12 -4
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js +15 -4
- package/dist/cli/output.js.map +1 -1
- package/dist/cli/program.d.ts +1 -1
- package/dist/cli/program.d.ts.map +1 -1
- package/dist/cli/program.js +270 -60
- package/dist/cli/program.js.map +1 -1
- package/dist/cli/registrar.d.ts +16 -7
- package/dist/cli/registrar.d.ts.map +1 -1
- package/dist/cli/registrar.js +71 -6
- package/dist/cli/registrar.js.map +1 -1
- package/dist/cli/suggest.d.ts +20 -0
- package/dist/cli/suggest.d.ts.map +1 -0
- package/dist/cli/suggest.js +49 -0
- package/dist/cli/suggest.js.map +1 -0
- package/dist/cli/warning.d.ts +26 -0
- package/dist/cli/warning.d.ts.map +1 -0
- package/dist/cli/warning.js +66 -0
- package/dist/cli/warning.js.map +1 -0
- package/dist/cli.js +11 -2
- package/dist/cli.js.map +1 -1
- package/dist/core/agent-execute.d.ts +44 -0
- package/dist/core/agent-execute.d.ts.map +1 -0
- package/dist/core/agent-execute.js +71 -0
- package/dist/core/agent-execute.js.map +1 -0
- package/dist/core/agent-list.d.ts +95 -0
- package/dist/core/agent-list.d.ts.map +1 -0
- package/dist/core/agent-list.js +207 -0
- package/dist/core/agent-list.js.map +1 -0
- package/dist/core/agent-show.d.ts +44 -0
- package/dist/core/agent-show.d.ts.map +1 -0
- package/dist/core/agent-show.js +188 -0
- package/dist/core/agent-show.js.map +1 -0
- package/dist/core/approval-authority.d.ts +17 -14
- package/dist/core/approval-authority.d.ts.map +1 -1
- package/dist/core/approval-authority.js +9 -9
- package/dist/core/approval-authority.js.map +1 -1
- package/dist/core/builtin-asset.d.ts +18 -15
- package/dist/core/builtin-asset.d.ts.map +1 -1
- package/dist/core/builtin-asset.js +17 -14
- package/dist/core/builtin-asset.js.map +1 -1
- package/dist/core/builtin-integrity.d.ts +12 -2
- package/dist/core/builtin-integrity.d.ts.map +1 -1
- package/dist/core/builtin-integrity.js +85 -9
- package/dist/core/builtin-integrity.js.map +1 -1
- package/dist/core/confinement.d.ts +3 -1
- package/dist/core/confinement.d.ts.map +1 -1
- package/dist/core/confinement.js +7 -4
- package/dist/core/confinement.js.map +1 -1
- package/dist/core/context.d.ts +150 -98
- package/dist/core/context.d.ts.map +1 -1
- package/dist/core/context.js +602 -66
- package/dist/core/context.js.map +1 -1
- package/dist/core/directive-assign.d.ts +33 -7
- package/dist/core/directive-assign.d.ts.map +1 -1
- package/dist/core/directive-assign.js +67 -27
- package/dist/core/directive-assign.js.map +1 -1
- package/dist/core/directive-scope.d.ts +36 -0
- package/dist/core/directive-scope.d.ts.map +1 -0
- package/dist/core/directive-scope.js +34 -0
- package/dist/core/directive-scope.js.map +1 -0
- package/dist/core/directives-list.d.ts +13 -3
- package/dist/core/directives-list.d.ts.map +1 -1
- package/dist/core/directives-list.js +18 -6
- package/dist/core/directives-list.js.map +1 -1
- package/dist/core/dry-run.d.ts +33 -0
- package/dist/core/dry-run.d.ts.map +1 -0
- package/dist/core/dry-run.js +45 -0
- package/dist/core/dry-run.js.map +1 -0
- package/dist/core/element-ref.d.ts +23 -0
- package/dist/core/element-ref.d.ts.map +1 -0
- package/dist/core/element-ref.js +24 -0
- package/dist/core/element-ref.js.map +1 -0
- package/dist/core/error-details.d.ts +20 -0
- package/dist/core/error-details.d.ts.map +1 -0
- package/dist/core/error-details.js +65 -0
- package/dist/core/error-details.js.map +1 -0
- package/dist/core/exit-code.js +6 -6
- package/dist/core/git-identity.d.ts +46 -11
- package/dist/core/git-identity.d.ts.map +1 -1
- package/dist/core/git-identity.js +140 -27
- package/dist/core/git-identity.js.map +1 -1
- package/dist/core/index.d.ts +189 -14
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1241 -238
- package/dist/core/index.js.map +1 -1
- package/dist/core/init.d.ts +50 -8
- package/dist/core/init.d.ts.map +1 -1
- package/dist/core/init.js +139 -27
- package/dist/core/init.js.map +1 -1
- package/dist/core/loaders.d.ts +170 -14
- package/dist/core/loaders.d.ts.map +1 -1
- package/dist/core/loaders.js +570 -89
- package/dist/core/loaders.js.map +1 -1
- package/dist/core/memory-add-link.d.ts +28 -0
- package/dist/core/memory-add-link.d.ts.map +1 -0
- package/dist/core/memory-add-link.js +67 -0
- package/dist/core/memory-add-link.js.map +1 -0
- package/dist/core/memory-add-type.d.ts +25 -1
- package/dist/core/memory-add-type.d.ts.map +1 -1
- package/dist/core/memory-add-type.js +59 -1
- package/dist/core/memory-add-type.js.map +1 -1
- package/dist/core/memory-amend.d.ts +80 -0
- package/dist/core/memory-amend.d.ts.map +1 -0
- package/dist/core/memory-amend.js +160 -0
- package/dist/core/memory-amend.js.map +1 -0
- package/dist/core/memory-supersede.d.ts +28 -0
- package/dist/core/memory-supersede.d.ts.map +1 -0
- package/dist/core/memory-supersede.js +79 -0
- package/dist/core/memory-supersede.js.map +1 -0
- package/dist/core/memory-transition.d.ts +190 -30
- package/dist/core/memory-transition.d.ts.map +1 -1
- package/dist/core/memory-transition.js +480 -59
- package/dist/core/memory-transition.js.map +1 -1
- package/dist/core/registry.d.ts +147 -23
- package/dist/core/registry.d.ts.map +1 -1
- package/dist/core/registry.js +50 -0
- package/dist/core/registry.js.map +1 -1
- package/dist/core/relevance.d.ts +74 -12
- package/dist/core/relevance.d.ts.map +1 -1
- package/dist/core/relevance.js +45 -27
- package/dist/core/relevance.js.map +1 -1
- package/dist/core/require-reason.d.ts.map +1 -1
- package/dist/core/require-reason.js +6 -5
- package/dist/core/require-reason.js.map +1 -1
- package/dist/core/required-fields.d.ts +28 -0
- package/dist/core/required-fields.d.ts.map +1 -0
- package/dist/core/required-fields.js +60 -0
- package/dist/core/required-fields.js.map +1 -0
- package/dist/core/revision.d.ts +82 -0
- package/dist/core/revision.d.ts.map +1 -0
- package/dist/core/revision.js +144 -0
- package/dist/core/revision.js.map +1 -0
- package/dist/core/types.d.ts +28 -2
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js +12 -3
- package/dist/core/types.js.map +1 -1
- package/dist/core/workflow-core-checks.d.ts +34 -0
- package/dist/core/workflow-core-checks.d.ts.map +1 -0
- package/dist/core/workflow-core-checks.js +403 -0
- package/dist/core/workflow-core-checks.js.map +1 -0
- package/dist/core/workflow-create-remove.d.ts +65 -0
- package/dist/core/workflow-create-remove.d.ts.map +1 -0
- package/dist/core/workflow-create-remove.js +277 -0
- package/dist/core/workflow-create-remove.js.map +1 -0
- package/dist/core/workflow-deduction.d.ts +48 -0
- package/dist/core/workflow-deduction.d.ts.map +1 -0
- package/dist/core/workflow-deduction.js +523 -0
- package/dist/core/workflow-deduction.js.map +1 -0
- package/dist/core/workflow-diagnostics.d.ts +83 -0
- package/dist/core/workflow-diagnostics.d.ts.map +1 -0
- package/dist/core/workflow-diagnostics.js +375 -0
- package/dist/core/workflow-diagnostics.js.map +1 -0
- package/dist/core/workflow-exit-state.d.ts +125 -0
- package/dist/core/workflow-exit-state.d.ts.map +1 -0
- package/dist/core/workflow-exit-state.js +243 -0
- package/dist/core/workflow-exit-state.js.map +1 -0
- package/dist/core/workflow-finalize.d.ts +37 -0
- package/dist/core/workflow-finalize.d.ts.map +1 -0
- package/dist/core/workflow-finalize.js +153 -0
- package/dist/core/workflow-finalize.js.map +1 -0
- package/dist/core/workflow-list-show.d.ts +176 -0
- package/dist/core/workflow-list-show.d.ts.map +1 -0
- package/dist/core/workflow-list-show.js +268 -0
- package/dist/core/workflow-list-show.js.map +1 -0
- package/dist/core/workflow-next.d.ts +268 -0
- package/dist/core/workflow-next.d.ts.map +1 -0
- package/dist/core/workflow-next.js +503 -0
- package/dist/core/workflow-next.js.map +1 -0
- package/dist/core/workflow-registry.d.ts +52 -0
- package/dist/core/workflow-registry.d.ts.map +1 -0
- package/dist/core/workflow-registry.js +158 -0
- package/dist/core/workflow-registry.js.map +1 -0
- package/dist/core/workflow-start-end.d.ts +71 -0
- package/dist/core/workflow-start-end.d.ts.map +1 -0
- package/dist/core/workflow-start-end.js +298 -0
- package/dist/core/workflow-start-end.js.map +1 -0
- package/dist/core/workflow-status.d.ts +83 -0
- package/dist/core/workflow-status.d.ts.map +1 -0
- package/dist/core/workflow-status.js +125 -0
- package/dist/core/workflow-status.js.map +1 -0
- package/dist/core/write-guard.d.ts +51 -8
- package/dist/core/write-guard.d.ts.map +1 -1
- package/dist/core/write-guard.js +139 -9
- package/dist/core/write-guard.js.map +1 -1
- package/dist/directives/index.d.ts +3 -2
- package/dist/directives/index.d.ts.map +1 -1
- package/dist/directives/index.js +5 -3
- package/dist/directives/index.js.map +1 -1
- package/dist/directives/schema.d.ts +35 -30
- package/dist/directives/schema.d.ts.map +1 -1
- package/dist/directives/schema.js +36 -30
- package/dist/directives/schema.js.map +1 -1
- package/dist/directives/version.d.ts +28 -0
- package/dist/directives/version.d.ts.map +1 -0
- package/dist/directives/version.js +51 -0
- package/dist/directives/version.js.map +1 -0
- package/dist/dna/edit.d.ts +7 -6
- package/dist/dna/edit.d.ts.map +1 -1
- package/dist/dna/edit.js +96 -41
- package/dist/dna/edit.js.map +1 -1
- package/dist/dna/mutate.js +18 -3
- package/dist/dna/mutate.js.map +1 -1
- package/dist/dna/path.d.ts +2 -2
- package/dist/dna/roles.d.ts +1 -1
- package/dist/dna/schema.d.ts +61 -3
- package/dist/dna/schema.d.ts.map +1 -1
- package/dist/dna/schema.js +121 -6
- package/dist/dna/schema.js.map +1 -1
- package/dist/mcp/dna-resource.d.ts.map +1 -1
- package/dist/mcp/dna-resource.js +4 -4
- package/dist/mcp/dna-resource.js.map +1 -1
- package/dist/mcp/index.d.ts +9 -5
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +13 -2
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/memory-resource.d.ts.map +1 -1
- package/dist/mcp/memory-resource.js +30 -19
- package/dist/mcp/memory-resource.js.map +1 -1
- package/dist/mcp/prompt.d.ts +61 -24
- package/dist/mcp/prompt.d.ts.map +1 -1
- package/dist/mcp/prompt.js +176 -47
- package/dist/mcp/prompt.js.map +1 -1
- package/dist/mcp/read-only.d.ts +39 -0
- package/dist/mcp/read-only.d.ts.map +1 -1
- package/dist/mcp/read-only.js +61 -0
- package/dist/mcp/read-only.js.map +1 -1
- package/dist/mcp/registrar.d.ts +10 -0
- package/dist/mcp/registrar.d.ts.map +1 -1
- package/dist/mcp/registrar.js +48 -12
- package/dist/mcp/registrar.js.map +1 -1
- package/dist/mcp/server.d.ts +21 -14
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +41 -15
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/session-resource.d.ts +13 -0
- package/dist/mcp/session-resource.d.ts.map +1 -0
- package/dist/mcp/session-resource.js +65 -0
- package/dist/mcp/session-resource.js.map +1 -0
- package/dist/mcp/workflow-resource.d.ts +18 -0
- package/dist/mcp/workflow-resource.d.ts.map +1 -1
- package/dist/mcp/workflow-resource.js +37 -8
- package/dist/mcp/workflow-resource.js.map +1 -1
- package/dist/memory/add.d.ts +160 -17
- package/dist/memory/add.d.ts.map +1 -1
- package/dist/memory/add.js +361 -51
- package/dist/memory/add.js.map +1 -1
- package/dist/memory/audit.d.ts +165 -32
- package/dist/memory/audit.d.ts.map +1 -1
- package/dist/memory/audit.js +267 -97
- package/dist/memory/audit.js.map +1 -1
- package/dist/memory/commit-message.d.ts +60 -38
- package/dist/memory/commit-message.d.ts.map +1 -1
- package/dist/memory/commit-message.js +167 -21
- package/dist/memory/commit-message.js.map +1 -1
- package/dist/memory/entry.d.ts.map +1 -1
- package/dist/memory/entry.js +1 -2
- package/dist/memory/entry.js.map +1 -1
- package/dist/memory/frontmatter-edit.d.ts +16 -4
- package/dist/memory/frontmatter-edit.d.ts.map +1 -1
- package/dist/memory/frontmatter-edit.js +13 -1
- package/dist/memory/frontmatter-edit.js.map +1 -1
- package/dist/memory/git-log.d.ts +18 -6
- package/dist/memory/git-log.d.ts.map +1 -1
- package/dist/memory/git-log.js +40 -13
- package/dist/memory/git-log.js.map +1 -1
- package/dist/memory/history.d.ts +74 -13
- package/dist/memory/history.d.ts.map +1 -1
- package/dist/memory/history.js +129 -45
- package/dist/memory/history.js.map +1 -1
- package/dist/memory/index.d.ts +13 -11
- package/dist/memory/index.d.ts.map +1 -1
- package/dist/memory/index.js +38 -3
- package/dist/memory/index.js.map +1 -1
- package/dist/memory/query.d.ts +161 -19
- package/dist/memory/query.d.ts.map +1 -1
- package/dist/memory/query.js +435 -55
- package/dist/memory/query.js.map +1 -1
- package/dist/memory/schema.d.ts +52 -3
- package/dist/memory/schema.d.ts.map +1 -1
- package/dist/memory/schema.js +132 -8
- package/dist/memory/schema.js.map +1 -1
- package/dist/memory/state-machine.d.ts +65 -10
- package/dist/memory/state-machine.d.ts.map +1 -1
- package/dist/memory/state-machine.js +136 -48
- package/dist/memory/state-machine.js.map +1 -1
- package/dist/memory/submit.d.ts +52 -3
- package/dist/memory/submit.d.ts.map +1 -1
- package/dist/memory/submit.js +118 -11
- package/dist/memory/submit.js.map +1 -1
- package/dist/storage/build-stamp.d.ts +18 -0
- package/dist/storage/build-stamp.d.ts.map +1 -0
- package/dist/storage/build-stamp.js +68 -0
- package/dist/storage/build-stamp.js.map +1 -0
- package/dist/storage/builtin-adapters.d.ts +32 -0
- package/dist/storage/builtin-adapters.d.ts.map +1 -0
- package/dist/storage/builtin-adapters.js +100 -0
- package/dist/storage/builtin-adapters.js.map +1 -0
- package/dist/storage/builtin-directives.d.ts +0 -29
- package/dist/storage/builtin-directives.d.ts.map +1 -1
- package/dist/storage/builtin-directives.js +9 -4
- package/dist/storage/builtin-directives.js.map +1 -1
- package/dist/storage/commit.d.ts +310 -3
- package/dist/storage/commit.d.ts.map +1 -1
- package/dist/storage/commit.js +807 -33
- package/dist/storage/commit.js.map +1 -1
- package/dist/storage/document.d.ts +6 -0
- package/dist/storage/document.d.ts.map +1 -1
- package/dist/storage/document.js +10 -1
- package/dist/storage/document.js.map +1 -1
- package/dist/storage/dry-run.d.ts +65 -0
- package/dist/storage/dry-run.d.ts.map +1 -0
- package/dist/storage/dry-run.js +150 -0
- package/dist/storage/dry-run.js.map +1 -0
- package/dist/storage/errors.d.ts +26 -0
- package/dist/storage/errors.d.ts.map +1 -1
- package/dist/storage/errors.js +27 -1
- package/dist/storage/errors.js.map +1 -1
- package/dist/storage/frontmatter.d.ts +1 -1
- package/dist/storage/frontmatter.js +1 -1
- package/dist/storage/git-read.d.ts +64 -0
- package/dist/storage/git-read.d.ts.map +1 -0
- package/dist/storage/git-read.js +107 -0
- package/dist/storage/git-read.js.map +1 -0
- package/dist/storage/index.d.ts +13 -5
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +39 -2
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/layout.d.ts +2 -2
- package/dist/storage/layout.d.ts.map +1 -1
- package/dist/storage/layout.js +2 -7
- package/dist/storage/layout.js.map +1 -1
- package/dist/storage/memory-path.d.ts +18 -5
- package/dist/storage/memory-path.d.ts.map +1 -1
- package/dist/storage/memory-path.js +41 -5
- package/dist/storage/memory-path.js.map +1 -1
- package/dist/storage/snapshot.js +1 -1
- package/dist/storage/templates.d.ts +33 -6
- package/dist/storage/templates.d.ts.map +1 -1
- package/dist/storage/templates.js +182 -17
- package/dist/storage/templates.js.map +1 -1
- package/dist/validation/config-version.d.ts +19 -0
- package/dist/validation/config-version.d.ts.map +1 -0
- package/dist/validation/config-version.js +53 -0
- package/dist/validation/config-version.js.map +1 -0
- package/dist/validation/diagnostic.d.ts +40 -0
- package/dist/validation/diagnostic.d.ts.map +1 -0
- package/dist/validation/diagnostic.js +41 -0
- package/dist/validation/diagnostic.js.map +1 -0
- package/dist/validation/format.d.ts +74 -0
- package/dist/validation/format.d.ts.map +1 -0
- package/dist/validation/format.js +104 -0
- package/dist/validation/format.js.map +1 -0
- package/dist/validation/id.d.ts +40 -0
- package/dist/validation/id.d.ts.map +1 -1
- package/dist/validation/id.js +99 -12
- package/dist/validation/id.js.map +1 -1
- package/dist/validation/identity.d.ts +40 -0
- package/dist/validation/identity.d.ts.map +1 -0
- package/dist/validation/identity.js +78 -0
- package/dist/validation/identity.js.map +1 -0
- package/dist/validation/index.d.ts +9 -3
- package/dist/validation/index.d.ts.map +1 -1
- package/dist/validation/index.js +33 -1
- package/dist/validation/index.js.map +1 -1
- package/dist/validation/secret-scan.d.ts +10 -7
- package/dist/validation/secret-scan.d.ts.map +1 -1
- package/dist/validation/secret-scan.js +39 -16
- package/dist/validation/secret-scan.js.map +1 -1
- package/dist/validation/warning.d.ts +30 -16
- package/dist/validation/warning.d.ts.map +1 -1
- package/dist/validation/warning.js +74 -7
- package/dist/validation/warning.js.map +1 -1
- package/dist/workflow/bindings.d.ts +152 -0
- package/dist/workflow/bindings.d.ts.map +1 -0
- package/dist/workflow/bindings.js +249 -0
- package/dist/workflow/bindings.js.map +1 -0
- package/dist/workflow/create.d.ts +13 -0
- package/dist/workflow/create.d.ts.map +1 -0
- package/dist/workflow/create.js +41 -0
- package/dist/workflow/create.js.map +1 -0
- package/dist/workflow/deduce.d.ts +400 -0
- package/dist/workflow/deduce.d.ts.map +1 -0
- package/dist/workflow/deduce.js +1109 -0
- package/dist/workflow/deduce.js.map +1 -0
- package/dist/workflow/manifest-edit.d.ts +19 -0
- package/dist/workflow/manifest-edit.d.ts.map +1 -0
- package/dist/workflow/manifest-edit.js +124 -0
- package/dist/workflow/manifest-edit.js.map +1 -0
- package/dist/workflow/schema.d.ts +158 -19
- package/dist/workflow/schema.d.ts.map +1 -1
- package/dist/workflow/schema.js +190 -16
- package/dist/workflow/schema.js.map +1 -1
- package/package.json +37 -13
|
@@ -0,0 +1,581 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ATTRIBUTION_LINE_PREFIX = exports.MCP_UNREACHABLE_MESSAGE = exports.MCP_PREFLIGHT_TIMEOUT_MS = exports.FRESH_MODE = exports.DEFAULT_ROLE_WARNING = exports.DEFAULT_ROLE = void 0;
|
|
4
|
+
exports.handoffLine = handoffLine;
|
|
5
|
+
exports.attributionLine = attributionLine;
|
|
6
|
+
exports.renderBootstrap = renderBootstrap;
|
|
7
|
+
exports.runningBuildMcpServer = runningBuildMcpServer;
|
|
8
|
+
exports.renderMcpTemplate = renderMcpTemplate;
|
|
9
|
+
exports.withRunFiles = withRunFiles;
|
|
10
|
+
exports.agentCommandFound = agentCommandFound;
|
|
11
|
+
exports.selectAgent = selectAgent;
|
|
12
|
+
exports.mcpPreflight = mcpPreflight;
|
|
13
|
+
exports.agentExecutePipeline = agentExecutePipeline;
|
|
14
|
+
exports.launchPlan = launchPlan;
|
|
15
|
+
/**
|
|
16
|
+
* `wingfoil agent execute`, the pre-launch half (`spec-016-agent-execution` §3, task-218): everything
|
|
17
|
+
* the command does before it spawns the agent — the stepless (`adhoc`) form, `--element` with an
|
|
18
|
+
* optional `--role` and `--agent`, and the step forms `--next`, `--workflow <ref>`, `--step <key>`
|
|
19
|
+
* (task-235, `./step.ts`). The launch (§3.3 steps 13–18) is `./launch.ts` (task-228).
|
|
20
|
+
*
|
|
21
|
+
* The pipeline ({@link agentExecutePipeline}) is §3.3's, in its order, and the first failure stops it:
|
|
22
|
+
*
|
|
23
|
+
* 2. With a step form, `workflow next`'s deduction at `HEAD` first (task-235): its commit is the `HEAD`
|
|
24
|
+
* every later read takes, and a `spec-003` error in the registry refuses here. Then `dna.yaml` and
|
|
25
|
+
* `memory.yaml` at that `HEAD` (the stepless form resolves `HEAD` itself and reads no workflow file);
|
|
26
|
+
* the adapter tree listed, every entry that is not an adapter printed as a warning (`bug-290`).
|
|
27
|
+
* 3. Resolution (§3.2 steps 1–5): the step ({@link selectFrontierStep}), its workflow and phase; the
|
|
28
|
+
* element (`--element`, else the step's, {@link stepTargetElement}) at `HEAD`; the role (`--role`, else
|
|
29
|
+
* the step's, {@link resolveStepRole}, else — stepless — the `developer` default with a warning,
|
|
30
|
+
* approver ruling R18); never `approver` (`REQ-SEC-03`); the agent ({@link selectAgent}); its adapter
|
|
31
|
+
* (`loadAdapter`, at `HEAD`).
|
|
32
|
+
* 4. The adapter's `command` on `PATH` or at its repository path ({@link agentCommandFound}).
|
|
33
|
+
* 5. The git identity (`requireGitIdentity`), since the record is committed.
|
|
34
|
+
* 6. The run log declared and unmodified (`runLogPreflight`, task-206).
|
|
35
|
+
* 7. The execution context assembled and validated at `state_ref` (`assembleExecutionContext`, task-176).
|
|
36
|
+
* 8. Its warnings printed (`dl-050` option 4): `ExecutionContext.warnings` (the role's §5.1 directive
|
|
37
|
+
* warnings, in their order), then the documents the builder could not read (`W_MEMORY_UNREADABLE`,
|
|
38
|
+
* task-171's handover) — through the warning sink, so the CLI renders each one at once, before the
|
|
39
|
+
* pre-flight. The builder's `notes` (`spec-012` §3: the DNA note, P5.3.3 sc. 3's "no relevant
|
|
40
|
+
* Memory") are not warnings and are not printed: they reach the agent with the Prompt (task-195).
|
|
41
|
+
* 9. The run id (§4.3, `nextRunId`).
|
|
42
|
+
* 10. The bootstrap (§2.4) and the temporary files (§2.3), in the OS temporary directory
|
|
43
|
+
* ({@link withRunFiles}), removed on every exit path.
|
|
44
|
+
* 11. The MCP pre-flight against the running build ({@link mcpPreflight}, §2.5).
|
|
45
|
+
* 12. The terminal check, last, so every earlier refusal is reachable without a terminal.
|
|
46
|
+
*
|
|
47
|
+
* Then the caller's `launch` runs, with the temporary files still in place and the function that hands
|
|
48
|
+
* the signals over from their cleanup to the launch (`withRunFiles`' `release`).
|
|
49
|
+
*
|
|
50
|
+
* Each distinct warning is printed once, and a label naming the resolved commit reads `HEAD:`
|
|
51
|
+
* (`withDistinctWarnings`; task-218's review F5).
|
|
52
|
+
*
|
|
53
|
+
* **Baseline.** Every gating read is at the one `HEAD` commit resolved at step 2 (`dl-080` (B), the
|
|
54
|
+
* `command-baseline` directive), which is also `state_ref`. Nothing is written to the repository: the
|
|
55
|
+
* only files written are the temporary ones, outside it.
|
|
56
|
+
*
|
|
57
|
+
* **Determinism.** The bootstrap and the run id are pure functions of committed state and the request
|
|
58
|
+
* (`REQ-SYS-07`); the temporary-file paths and the Node executable are host values that never reach the
|
|
59
|
+
* context (`spec-016` Consequences).
|
|
60
|
+
*/
|
|
61
|
+
const node_fs_1 = require("node:fs");
|
|
62
|
+
const node_os_1 = require("node:os");
|
|
63
|
+
const node_path_1 = require("node:path");
|
|
64
|
+
const index_js_1 = require("@modelcontextprotocol/sdk/client/index.js");
|
|
65
|
+
const stdio_js_1 = require("@modelcontextprotocol/sdk/client/stdio.js");
|
|
66
|
+
const storage_1 = require("../storage");
|
|
67
|
+
const validation_1 = require("../validation");
|
|
68
|
+
const warning_1 = require("../validation/warning");
|
|
69
|
+
const query_1 = require("../memory/query");
|
|
70
|
+
const roles_1 = require("../dna/roles");
|
|
71
|
+
const approval_authority_1 = require("../core/approval-authority");
|
|
72
|
+
const context_1 = require("../core/context");
|
|
73
|
+
const git_identity_1 = require("../core/git-identity");
|
|
74
|
+
const loaders_1 = require("../core/loaders");
|
|
75
|
+
const revision_1 = require("../core/revision");
|
|
76
|
+
const types_1 = require("../core/types");
|
|
77
|
+
const discovery_1 = require("./discovery");
|
|
78
|
+
const run_log_1 = require("./run-log");
|
|
79
|
+
const step_1 = require("./step");
|
|
80
|
+
/** The role of a run with no step and no `--role` (`X_cli-cmds.md:223`, approver ruling R18). */
|
|
81
|
+
exports.DEFAULT_ROLE = 'developer';
|
|
82
|
+
/** The warning that says the role was defaulted (§3.2 step 3). */
|
|
83
|
+
exports.DEFAULT_ROLE_WARNING = `no --role given and no workflow step to take one from: running as the default role '${exports.DEFAULT_ROLE}'`;
|
|
84
|
+
/** The mode that runs: `fresh`, the only one in v0.3 (§3.2 step 6). */
|
|
85
|
+
exports.FRESH_MODE = 'fresh';
|
|
86
|
+
/** How long the MCP pre-flight may take, start-up included, before it counts as unreachable. */
|
|
87
|
+
exports.MCP_PREFLIGHT_TIMEOUT_MS = 30000;
|
|
88
|
+
/** P5.4.3 sc. 3, verbatim (§3.7 `MCP_UNREACHABLE`). */
|
|
89
|
+
exports.MCP_UNREACHABLE_MESSAGE = 'context pre-load failed: MCP server unreachable';
|
|
90
|
+
/** §2.4's two handoff literals. */
|
|
91
|
+
const HANDOFF_SECTION = 'Record your handoff in the element\'s "## Execution Notes" section.';
|
|
92
|
+
const HANDOFF_FALLBACK = "Record your handoff in the element's body and in your commit messages.";
|
|
93
|
+
/**
|
|
94
|
+
* §2.4's `{handoff_line}`: the section line when the element type's template has a `## Execution
|
|
95
|
+
* Notes` heading line, the fallback otherwise.
|
|
96
|
+
*/
|
|
97
|
+
function handoffLine(templateHasExecutionNotes) {
|
|
98
|
+
return templateHasExecutionNotes ? HANDOFF_SECTION : HANDOFF_FALLBACK;
|
|
99
|
+
}
|
|
100
|
+
/** The fixed opening of §2.4's attribution line (task-228, `git-conventions` §7). */
|
|
101
|
+
exports.ATTRIBUTION_LINE_PREFIX = 'End every commit you write, except an approve or reject commit, with the trailer paragraph';
|
|
102
|
+
/** §2.4's attribution line for `agent`: the rule of `git-conventions` §7, with the entry that signs. */
|
|
103
|
+
function attributionLine(agent) {
|
|
104
|
+
return `${exports.ATTRIBUTION_LINE_PREFIX} "Co-Authored-By: ${agent.name} <${agent.email}>" and "AI-Model: <the model identifier you run as>"; to a commit wingfoil writes, add them with git commit --amend --no-edit --trailer, never as a paragraph of their own (git-conventions §7, §8).`;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* The session Resource the bootstrap names (§2.4, task-236): `wingfoil://session/<role>/<type>:<id>/<sha>`, the
|
|
108
|
+
* concrete form of the MCP server's `wingfoil://session/{role}/{element}/{state}` template (`spec-004` §2.1). A
|
|
109
|
+
* Resource, not the `{role}-session` Prompt that serves the same text: an agent CLI may give its model a tool to
|
|
110
|
+
* read Resources and none to get Prompts (Claude Code 2.1.296, the `claude-code` built-in's by-hand pass).
|
|
111
|
+
*/
|
|
112
|
+
function sessionContextUri(role, element, stateRef) {
|
|
113
|
+
return `wingfoil://session/${role}/${element}/${stateRef}`;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* The bootstrap prompt (§2.4): the only text WingFoil puts into the agent's initial prompt. Pure, with
|
|
117
|
+
* no clock and no host data, LF-terminated. Its last line hands the agent the attribution rule and the
|
|
118
|
+
* entry that signs (task-228). A change to any literal here is a revision of `spec-016`.
|
|
119
|
+
*/
|
|
120
|
+
function renderBootstrap(input) {
|
|
121
|
+
const contextInstruction = `Read the MCP resource "${sessionContextUri(input.role, input.element, input.stateRef)}".`;
|
|
122
|
+
return [
|
|
123
|
+
`WingFoil run ${input.runId}: act as role "${input.role}" on element ${input.element}.`,
|
|
124
|
+
`Your context is assembled at commit ${input.stateRef} and served by the "wingfoil" MCP server`,
|
|
125
|
+
`registered for this session. Load it before any other action: ${contextInstruction}`,
|
|
126
|
+
input.handoff,
|
|
127
|
+
attributionLine(input.agent),
|
|
128
|
+
'',
|
|
129
|
+
].join('\n');
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* The server `agent execute` registers and pre-flights (§2.5): the build that is running it — the Node
|
|
133
|
+
* executable, and `[<that build's cli.js>, "mcp"]`, `cli.js` sitting one directory above this module in
|
|
134
|
+
* the compiled layout (`dist/agent/` → `dist/cli.js`).
|
|
135
|
+
*/
|
|
136
|
+
function runningBuildMcpServer() {
|
|
137
|
+
return { command: process.execPath, args: [(0, node_path_1.join)(__dirname, '..', 'cli.js'), 'mcp'] };
|
|
138
|
+
}
|
|
139
|
+
/** `mcp.template`'s placeholder tokens: the narrow class, so JSON braces are left alone (§2.3). */
|
|
140
|
+
const TEMPLATE_TOKEN_RE = /\{([a-z][a-z0-9_]*)\}/g;
|
|
141
|
+
/**
|
|
142
|
+
* Render `mcp.template` (§2.3): `{mcp_command}` becomes the executable as JSON string content (the
|
|
143
|
+
* template quotes it; a quote or a backslash in the path stays valid), `{mcp_args}` the argv as a JSON
|
|
144
|
+
* array. The manifest validator admits no other placeholder there, so any other token is left as is.
|
|
145
|
+
*/
|
|
146
|
+
function renderMcpTemplate(template, server) {
|
|
147
|
+
return template.replace(TEMPLATE_TOKEN_RE, (token, name) => {
|
|
148
|
+
if (name === 'mcp_command')
|
|
149
|
+
return JSON.stringify(server.command).slice(1, -1);
|
|
150
|
+
if (name === 'mcp_args')
|
|
151
|
+
return JSON.stringify(server.args);
|
|
152
|
+
return token;
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
/** Each file's basename inside the run's temporary directory. */
|
|
156
|
+
const RUN_FILE_BASENAMES = {
|
|
157
|
+
bootstrap_file: 'bootstrap.txt',
|
|
158
|
+
mcp_config_file: 'mcp-config.json',
|
|
159
|
+
};
|
|
160
|
+
/** The signals that end `agent execute` before the spawn, and so must not leave the temporary files behind. */
|
|
161
|
+
const CLEANUP_SIGNALS = process.platform === 'win32' ? ['SIGINT', 'SIGTERM'] : ['SIGINT', 'SIGTERM', 'SIGHUP'];
|
|
162
|
+
/**
|
|
163
|
+
* Write `files` into a fresh directory of the operating system's temporary directory (never the
|
|
164
|
+
* repository, §2.3), owner-only, run `work` with their absolute paths, and remove the directory when
|
|
165
|
+
* `work` settles — resolved, rejected or thrown alike.
|
|
166
|
+
*
|
|
167
|
+
* A `SIGINT`, `SIGTERM` or `SIGHUP` that arrives meanwhile (a pre-flight interrupted from the keyboard,
|
|
168
|
+
* task-218's review) removes the directory too, then ends the process by that same signal. `work`
|
|
169
|
+
* receives `release`, which removes that handling: the launch calls it when it takes the signals over
|
|
170
|
+
* (§3.3 step 15).
|
|
171
|
+
*/
|
|
172
|
+
async function withRunFiles(files, work) {
|
|
173
|
+
// The listeners go in before the directory exists (review fix 1), so no signal can leave it behind.
|
|
174
|
+
let dir;
|
|
175
|
+
const listeners = CLEANUP_SIGNALS.map((signal) => [
|
|
176
|
+
signal,
|
|
177
|
+
() => {
|
|
178
|
+
// The directory goes before the listeners: a second signal meanwhile runs this again, harmlessly.
|
|
179
|
+
if (dir !== undefined)
|
|
180
|
+
(0, node_fs_1.rmSync)(dir, { recursive: true, force: true });
|
|
181
|
+
release();
|
|
182
|
+
process.kill(process.pid, signal);
|
|
183
|
+
},
|
|
184
|
+
]);
|
|
185
|
+
let held = true;
|
|
186
|
+
function release() {
|
|
187
|
+
if (!held)
|
|
188
|
+
return;
|
|
189
|
+
held = false;
|
|
190
|
+
for (const [signal, listener] of listeners)
|
|
191
|
+
process.removeListener(signal, listener);
|
|
192
|
+
}
|
|
193
|
+
for (const [signal, listener] of listeners)
|
|
194
|
+
process.on(signal, listener);
|
|
195
|
+
try {
|
|
196
|
+
dir = (0, node_fs_1.mkdtempSync)((0, node_path_1.join)((0, node_os_1.tmpdir)(), 'wingfoil-run-'));
|
|
197
|
+
const paths = {};
|
|
198
|
+
for (const name of Object.keys(RUN_FILE_BASENAMES).sort()) {
|
|
199
|
+
const text = files[name];
|
|
200
|
+
if (text === undefined)
|
|
201
|
+
continue;
|
|
202
|
+
const path = (0, node_path_1.join)(dir, RUN_FILE_BASENAMES[name]);
|
|
203
|
+
(0, node_fs_1.writeFileSync)(path, text, { encoding: 'utf-8', mode: 0o600 });
|
|
204
|
+
paths[name] = path;
|
|
205
|
+
}
|
|
206
|
+
return await work(paths, release);
|
|
207
|
+
}
|
|
208
|
+
finally {
|
|
209
|
+
// Removed before the last listeners come out, so no signal in between can leave it behind.
|
|
210
|
+
if (dir !== undefined)
|
|
211
|
+
(0, node_fs_1.rmSync)(dir, { recursive: true, force: true });
|
|
212
|
+
release();
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
/** Whether `path` is a regular file this process may execute. */
|
|
216
|
+
function isExecutableFile(path) {
|
|
217
|
+
try {
|
|
218
|
+
if (!(0, node_fs_1.statSync)(path).isFile())
|
|
219
|
+
return false;
|
|
220
|
+
(0, node_fs_1.accessSync)(path, node_fs_1.constants.X_OK);
|
|
221
|
+
return true;
|
|
222
|
+
}
|
|
223
|
+
catch {
|
|
224
|
+
return false;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* §3.3 step 4: whether the adapter's `command` can be started — a name holding no path separator is
|
|
229
|
+
* looked up on `searchPath` (`PATH`), in order; anything else is a path, resolved against the project
|
|
230
|
+
* root when relative. Either way it must be an executable regular file. Nothing is run, and no shell is
|
|
231
|
+
* involved (`dl-090` Q3 (a)).
|
|
232
|
+
*/
|
|
233
|
+
function agentCommandFound(root, command, searchPath) {
|
|
234
|
+
if ((0, node_path_1.isAbsolute)(command) || command.includes('/') || command.includes('\\'))
|
|
235
|
+
return isExecutableFile((0, node_path_1.resolve)(root, command));
|
|
236
|
+
const extensions = process.platform === 'win32' ? ['', ...(process.env.PATHEXT ?? '.EXE;.CMD;.BAT').split(';')] : [''];
|
|
237
|
+
return (searchPath ?? '')
|
|
238
|
+
.split(node_path_1.delimiter)
|
|
239
|
+
.filter((dir) => dir !== '')
|
|
240
|
+
.some((dir) => extensions.some((extension) => isExecutableFile((0, node_path_1.join)(dir, `${command}${extension}`))));
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* §3.2 step 4 (the role already checked): with `agentName`, that `team.agents` entry, which must
|
|
244
|
+
* execute `role` and declare an `adapter`; without it, the first entry in declared order that does both.
|
|
245
|
+
*/
|
|
246
|
+
function selectAgent(dna, role, agentName) {
|
|
247
|
+
const agents = dna.team.agents ?? [];
|
|
248
|
+
const refuse = (message) => (0, types_1.coreErr)({ code: 'VALIDATION', message });
|
|
249
|
+
if (agentName === undefined) {
|
|
250
|
+
const found = agents.find((agent) => agent.adapter !== undefined && agent.executes_as.includes(role));
|
|
251
|
+
return found === undefined ? refuse(`no agent in dna.yaml with an adapter executes as role '${role}'`) : (0, types_1.coreOk)(found);
|
|
252
|
+
}
|
|
253
|
+
const named = agents.find((agent) => agent.name === agentName);
|
|
254
|
+
if (named === undefined)
|
|
255
|
+
return refuse(`unknown agent '${agentName}'`);
|
|
256
|
+
if (!named.executes_as.includes(role))
|
|
257
|
+
return refuse(`agent '${agentName}' does not execute as role '${role}'`);
|
|
258
|
+
if (named.adapter === undefined)
|
|
259
|
+
return refuse(`agent '${agentName}' declares no adapter`);
|
|
260
|
+
return (0, types_1.coreOk)(named);
|
|
261
|
+
}
|
|
262
|
+
/** `text` on one line, every spelling of `root` removed (`<root>/x` → `x`), so no absolute path leaks. */
|
|
263
|
+
function withoutRoot(text, root) {
|
|
264
|
+
return text.replace(/\s*\n\s*/g, '; ').trim().split(`${root}/`).join('').split(root).join('.');
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* §3.3 step 11: start the server, complete MCP `initialize`, get the `{role}-session` Prompt with
|
|
268
|
+
* `element` and `state`, read the session Resource the bootstrap names (§2.4, task-236), and close. The
|
|
269
|
+
* project's own registration (`.mcp.json`) is not read (§2.5). Any failure — the server does not start,
|
|
270
|
+
* exits, refuses the Prompt or the Resource, returns no text, or exceeds `timeoutMs` — is `IO` with
|
|
271
|
+
* P5.4.3 sc. 3's message verbatim, its cause as a `dl-055` detail line with the project root removed.
|
|
272
|
+
*
|
|
273
|
+
* Both carriers are checked, the Prompt first: the agent reads the Resource, and the Prompt serves the same
|
|
274
|
+
* text to a client that gets Prompts; one deadline covers the whole exchange.
|
|
275
|
+
*/
|
|
276
|
+
async function mcpPreflight(input) {
|
|
277
|
+
const env = Object.fromEntries(Object.entries(process.env).filter((entry) => entry[1] !== undefined));
|
|
278
|
+
const transport = new stdio_js_1.StdioClientTransport({ command: input.server.command, args: [...input.server.args], cwd: input.root, env, stderr: 'pipe' });
|
|
279
|
+
let serverStderr = '';
|
|
280
|
+
transport.stderr?.on('data', (chunk) => {
|
|
281
|
+
serverStderr += chunk.toString();
|
|
282
|
+
});
|
|
283
|
+
const client = new index_js_1.Client({ name: 'wingfoil-agent-execute', version: '1' }, { capabilities: {} });
|
|
284
|
+
// One deadline for the whole exchange, start-up included (task-218's review: a limit per request let
|
|
285
|
+
// the pre-flight take about twice it against REQ-PERF-01's 30 s).
|
|
286
|
+
let timer;
|
|
287
|
+
const deadline = new Promise((_resolve, reject) => {
|
|
288
|
+
timer = setTimeout(() => reject(new Error(`no answer within ${input.timeoutMs} ms`)), input.timeoutMs);
|
|
289
|
+
});
|
|
290
|
+
const exchange = async () => {
|
|
291
|
+
await client.connect(transport, { timeout: input.timeoutMs });
|
|
292
|
+
const prompt = await client.getPrompt({ name: `${input.role}-session`, arguments: { element: input.element, state: input.stateRef } }, { timeout: input.timeoutMs });
|
|
293
|
+
const content = prompt.messages[0]?.content;
|
|
294
|
+
if (content === undefined || content.type !== 'text' || content.text === '') {
|
|
295
|
+
throw new Error(`the ${input.role}-session prompt returned no context text`);
|
|
296
|
+
}
|
|
297
|
+
// task-236: the Resource the bootstrap names — what the agent will actually read.
|
|
298
|
+
const uri = sessionContextUri(input.role, input.element, input.stateRef);
|
|
299
|
+
const resource = await client.readResource({ uri }, { timeout: input.timeoutMs });
|
|
300
|
+
const entry = resource.contents[0];
|
|
301
|
+
if (entry === undefined || !('text' in entry) || entry.text === '') {
|
|
302
|
+
throw new Error(`the session resource ${uri} returned no context text`);
|
|
303
|
+
}
|
|
304
|
+
};
|
|
305
|
+
try {
|
|
306
|
+
await Promise.race([exchange(), deadline]);
|
|
307
|
+
return (0, types_1.coreOk)(undefined);
|
|
308
|
+
}
|
|
309
|
+
catch (error) {
|
|
310
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
311
|
+
const said = serverStderr.trim().split('\n').filter((line) => line.trim() !== '').pop();
|
|
312
|
+
const cause = withoutRoot(said === undefined ? reason : `${reason} (server: ${said})`, input.root);
|
|
313
|
+
return (0, types_1.coreErr)({ code: 'IO', message: exports.MCP_UNREACHABLE_MESSAGE, details: { cause, issues: [{ detail: cause }] } });
|
|
314
|
+
}
|
|
315
|
+
finally {
|
|
316
|
+
clearTimeout(timer);
|
|
317
|
+
await client.close().catch(() => undefined);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
/** The process's own terminals: stdin and stdout both. */
|
|
321
|
+
function processHasTerminal() {
|
|
322
|
+
return process.stdin.isTTY === true && process.stdout.isTTY === true;
|
|
323
|
+
}
|
|
324
|
+
/** `VALIDATION` from a loader's `ValidationError`, its issues as `dl-055` details. */
|
|
325
|
+
function validationRefusal(error) {
|
|
326
|
+
return (0, types_1.coreErr)({ code: 'VALIDATION', message: error.message, details: { issues: error.issues } });
|
|
327
|
+
}
|
|
328
|
+
/** The committed pillar files the pipeline reads, or the refusal of an absent or invalid one. */
|
|
329
|
+
function loadCommittedConfig(root, sha) {
|
|
330
|
+
try {
|
|
331
|
+
const dna = (0, loaders_1.loadDnaYamlAtRev)(root, sha);
|
|
332
|
+
if (dna === null)
|
|
333
|
+
return (0, types_1.coreErr)({ code: 'NOT_FOUND', message: `${loaders_1.DNA_YAML_PATH} is not committed at HEAD, which agent execute reads: commit it first` });
|
|
334
|
+
const memoryYaml = (0, loaders_1.loadMemoryYamlAtRev)(root, sha);
|
|
335
|
+
if (memoryYaml === null)
|
|
336
|
+
return (0, types_1.coreErr)({ code: 'NOT_FOUND', message: `${loaders_1.MEMORY_YAML_PATH} is not committed at HEAD, which agent execute reads: commit it first` });
|
|
337
|
+
return (0, types_1.coreOk)({ dna, memoryYaml });
|
|
338
|
+
}
|
|
339
|
+
catch (error) {
|
|
340
|
+
if (error instanceof validation_1.ValidationError)
|
|
341
|
+
return validationRefusal(error);
|
|
342
|
+
throw error;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* §3.2 step 2: the element must exist at `HEAD` → else `NOT_FOUND` `element not found: <type>:<id>`, the
|
|
347
|
+
* documents the scan could not read as `details.unreadable` (task-171) so the refusal does not read as
|
|
348
|
+
* a bare absence. An archived element is found here and refused by the context builder.
|
|
349
|
+
*/
|
|
350
|
+
function requireElement(root, sha, memoryYaml, element) {
|
|
351
|
+
const unreadable = [];
|
|
352
|
+
const found = (0, query_1.findMemoryDocumentByTypeAndIdAtRev)(root, sha, memoryYaml, element.type, element.id, {
|
|
353
|
+
includeArchived: true,
|
|
354
|
+
onDiagnostic: (diagnostic) => unreadable.push(diagnostic),
|
|
355
|
+
});
|
|
356
|
+
if (found !== undefined)
|
|
357
|
+
return (0, types_1.coreOk)(found.path);
|
|
358
|
+
return (0, types_1.coreErr)({
|
|
359
|
+
code: 'NOT_FOUND',
|
|
360
|
+
message: `element not found: ${element.type}:${element.id}`,
|
|
361
|
+
...(unreadable.length > 0 ? { details: unreadableDetails(unreadable.map(validation_1.formatDiagnostic)) } : {}),
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* `details` naming the documents a scan could not read: `unreadable` (task-171's key) and the same
|
|
366
|
+
* lines as `dl-055` detail lines, so the CLI and the MCP surface show them (`errorDetails`).
|
|
367
|
+
*/
|
|
368
|
+
function unreadableDetails(lines) {
|
|
369
|
+
return { unreadable: lines, issues: lines.map((detail) => ({ detail })) };
|
|
370
|
+
}
|
|
371
|
+
/** Root-relative path of the element type's template file, or `undefined` when the type declares none. */
|
|
372
|
+
function templatePathOf(memoryYaml, type) {
|
|
373
|
+
const file = memoryYaml.types[type]?.template?.file;
|
|
374
|
+
return file === undefined ? undefined : `.wingfoil/${file}`;
|
|
375
|
+
}
|
|
376
|
+
/** Whether the element type's template, at `sha`, has a `## Execution Notes` heading line (§2.4). */
|
|
377
|
+
function templateHasExecutionNotes(root, sha, templatePath) {
|
|
378
|
+
if (templatePath === undefined)
|
|
379
|
+
return false;
|
|
380
|
+
const text = (0, storage_1.readPathAtRev)(root, sha, templatePath);
|
|
381
|
+
return text !== null && (0, run_log_1.executionNotesSection)(text) !== null;
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Run `agent execute`'s pipeline up to the spawn (§3.3 steps 2–12, see the module doc), then
|
|
385
|
+
* `launch` with the prepared launch, while its temporary files exist. Warnings go through the warning
|
|
386
|
+
* sink as they arise. Returns the first refusal, or what `launch` returns.
|
|
387
|
+
*
|
|
388
|
+
* @param root - The project root, already known to be initialized.
|
|
389
|
+
*/
|
|
390
|
+
async function agentExecutePipeline(root, request, host, launch) {
|
|
391
|
+
// Each distinct warning is printed once — the pipeline and the context builder both load dna.yaml
|
|
392
|
+
// (task-218's review F5) — and a label naming the resolved commit reads `HEAD:`, the baseline every
|
|
393
|
+
// read of the run is at (spec-008 §11).
|
|
394
|
+
let sha;
|
|
395
|
+
return (0, warning_1.withDistinctWarnings)(() => runPipeline(root, request, host, launch, (resolved) => (sha = resolved)), (text) => (sha === undefined ? text : text.split(`${sha}:`).join('HEAD:')));
|
|
396
|
+
}
|
|
397
|
+
/** {@link agentExecutePipeline}'s body; `onHead` learns the commit step 2 resolved. */
|
|
398
|
+
async function runPipeline(root, request, host, launch, onHead) {
|
|
399
|
+
// Step 2 — one HEAD, every gating read at it. A step form reads the deduction first, so the HEAD it was
|
|
400
|
+
// deduced at is the one every later read takes (task-235); a registry error refuses here.
|
|
401
|
+
const deduced = request.step === undefined ? undefined : (0, step_1.readNextAtHead)(root, request.step.workflow);
|
|
402
|
+
if (deduced !== undefined && !deduced.ok && deduced.error.code === 'VALIDATION')
|
|
403
|
+
return deduced;
|
|
404
|
+
let sha;
|
|
405
|
+
try {
|
|
406
|
+
// The deduction of a repository with no commit has no commit either: resolving HEAD then refuses it.
|
|
407
|
+
sha = deduced?.ok === true && deduced.value.baseline.commit !== '' ? deduced.value.baseline.commit : (0, revision_1.resolveRevision)(root, 'HEAD');
|
|
408
|
+
}
|
|
409
|
+
catch (error) {
|
|
410
|
+
if (error instanceof revision_1.RevisionError)
|
|
411
|
+
return (0, types_1.coreErr)(error.toCoreError());
|
|
412
|
+
throw error;
|
|
413
|
+
}
|
|
414
|
+
onHead(sha);
|
|
415
|
+
const config = loadCommittedConfig(root, sha);
|
|
416
|
+
if (!config.ok)
|
|
417
|
+
return config;
|
|
418
|
+
const { dna, memoryYaml } = config.value;
|
|
419
|
+
for (const diagnostic of (0, discovery_1.adapterTreeDiagnosticsAtRev)(root, sha))
|
|
420
|
+
(0, warning_1.reportWarning)((0, validation_1.formatDiagnostic)(diagnostic));
|
|
421
|
+
// A name in both built-in/ and custom/ is refused where the tree is listed (§2.1), before resolution.
|
|
422
|
+
// Every adapter read takes the one resolved commit, spelled `HEAD` in messages (task-235's review F3).
|
|
423
|
+
const duplicate = (0, discovery_1.duplicateAdapterRefusal)(root, sha, 'HEAD');
|
|
424
|
+
if (duplicate !== undefined)
|
|
425
|
+
return duplicate;
|
|
426
|
+
// Step 3 — resolution (§3.2 steps 1–5).
|
|
427
|
+
// §3.2 step 1 — the step (a step form only), which names the run's workflow and phase.
|
|
428
|
+
let step;
|
|
429
|
+
if (deduced !== undefined) {
|
|
430
|
+
if (!deduced.ok)
|
|
431
|
+
return deduced;
|
|
432
|
+
const selected = (0, step_1.selectFrontierStep)(deduced.value, request.step.key);
|
|
433
|
+
if (!selected.ok)
|
|
434
|
+
return selected;
|
|
435
|
+
step = selected.value;
|
|
436
|
+
}
|
|
437
|
+
// §3.2 step 2 — the element: `--element`, else the step's; it must exist at HEAD.
|
|
438
|
+
let target;
|
|
439
|
+
if (step === undefined) {
|
|
440
|
+
target = request.element; // the stepless form always names its element (the caller's usage check)
|
|
441
|
+
}
|
|
442
|
+
else {
|
|
443
|
+
const stepElement = (0, step_1.stepTargetElement)(step, deduced.ok ? deduced.value.instance : null, request.element);
|
|
444
|
+
if (!stepElement.ok)
|
|
445
|
+
return stepElement;
|
|
446
|
+
target = stepElement.value;
|
|
447
|
+
}
|
|
448
|
+
const elementRef = `${target.type}:${target.id}`;
|
|
449
|
+
const element = requireElement(root, sha, memoryYaml, target);
|
|
450
|
+
if (!element.ok)
|
|
451
|
+
return element;
|
|
452
|
+
// §3.2 step 3 — the role: `--role`, else the step's, else (stepless) the developer default, with a warning.
|
|
453
|
+
let role;
|
|
454
|
+
if (step === undefined) {
|
|
455
|
+
if (request.role === undefined)
|
|
456
|
+
(0, warning_1.reportWarning)(exports.DEFAULT_ROLE_WARNING);
|
|
457
|
+
role = request.role ?? exports.DEFAULT_ROLE;
|
|
458
|
+
}
|
|
459
|
+
else {
|
|
460
|
+
const stepRole = (0, step_1.resolveStepRole)(dna, step, request.role);
|
|
461
|
+
if (!stepRole.ok)
|
|
462
|
+
return stepRole;
|
|
463
|
+
role = stepRole.value;
|
|
464
|
+
}
|
|
465
|
+
if (!(0, roles_1.isRoleDefined)(dna, role))
|
|
466
|
+
return (0, types_1.coreErr)({ code: 'VALIDATION', message: `unknown role '${role}' (not defined in dna.yaml)` });
|
|
467
|
+
if (role === approval_authority_1.APPROVER_ROLE)
|
|
468
|
+
return (0, types_1.coreErr)({ code: 'VALIDATION', message: `role '${approval_authority_1.APPROVER_ROLE}' is never executed by an agent` });
|
|
469
|
+
const agent = selectAgent(dna, role, request.agent);
|
|
470
|
+
if (!agent.ok)
|
|
471
|
+
return agent;
|
|
472
|
+
const adapter = (0, discovery_1.loadAdapter)(root, agent.value.adapter, sha, 'HEAD');
|
|
473
|
+
if (!adapter.ok)
|
|
474
|
+
return adapter;
|
|
475
|
+
const manifest = adapter.value.manifest;
|
|
476
|
+
// Step 4 — the agent CLI can be started.
|
|
477
|
+
if (!agentCommandFound(root, manifest.command, host.searchPath ?? process.env.PATH)) {
|
|
478
|
+
return (0, types_1.coreErr)({ code: 'IO', message: `agent command '${manifest.command}' not found (adapter '${adapter.value.name}')` });
|
|
479
|
+
}
|
|
480
|
+
// Step 5 — the identity the record commit (step 17) needs.
|
|
481
|
+
const identity = (0, git_identity_1.requireGitIdentity)(root);
|
|
482
|
+
if (!identity.ok)
|
|
483
|
+
return identity;
|
|
484
|
+
// Step 6 — the run log, declared and unmodified (`paths` is passthrough; `runs` is spec-016 §4.1's).
|
|
485
|
+
const runs = dna.paths?.['runs'];
|
|
486
|
+
const logPath = (0, run_log_1.runLogPreflight)(root, runs, target.id);
|
|
487
|
+
if (!logPath.ok)
|
|
488
|
+
return logPath;
|
|
489
|
+
// Step 7 — the context, assembled and validated at state_ref.
|
|
490
|
+
const assembled = (0, context_1.assembleExecutionContext)(root, { role, element: target, stateRef: sha });
|
|
491
|
+
// The element was found at this same commit (step 3), so the builder's NOT_FOUND with
|
|
492
|
+
// `details.unreadable` cannot arise here; its refusals pass through as they are.
|
|
493
|
+
if (!assembled.ok)
|
|
494
|
+
return assembled;
|
|
495
|
+
// Step 8 — its warnings, before the pre-flight (dl-050 option 4); the notes reach the agent with the Prompt.
|
|
496
|
+
for (const warning of [...assembled.value.context.warnings, ...(assembled.warnings ?? [])]) {
|
|
497
|
+
(0, warning_1.reportWarning)(warning);
|
|
498
|
+
}
|
|
499
|
+
// Step 9 — the run id.
|
|
500
|
+
// `n` counts per (element, phase), whatever the workflow (§4.3).
|
|
501
|
+
const phase = step?.phase ?? run_log_1.ADHOC_PHASE;
|
|
502
|
+
const runId = (0, run_log_1.nextRunId)(root, { logPath: logPath.value, element: elementRef, phase, stateRef: sha });
|
|
503
|
+
if (!runId.ok)
|
|
504
|
+
return runId;
|
|
505
|
+
// Step 10 — the bootstrap and the temporary files.
|
|
506
|
+
const templatePath = templatePathOf(memoryYaml, target.type);
|
|
507
|
+
const bootstrap = renderBootstrap({
|
|
508
|
+
role,
|
|
509
|
+
element: elementRef,
|
|
510
|
+
runId: runId.value,
|
|
511
|
+
stateRef: sha,
|
|
512
|
+
handoff: handoffLine(templateHasExecutionNotes(root, sha, templatePath)),
|
|
513
|
+
// A team.agents entry that declares an adapter declares an email (dna.yaml schema, dl-158 Rule 2 (ii)).
|
|
514
|
+
agent: { name: agent.value.name, email: agent.value.email ?? '' },
|
|
515
|
+
});
|
|
516
|
+
const mcpServer = host.mcpServer ?? runningBuildMcpServer();
|
|
517
|
+
const files = {
|
|
518
|
+
...(manifest.prompt.via === 'file' ? { bootstrap_file: bootstrap } : {}),
|
|
519
|
+
...(manifest.mcp.via === 'config-file' ? { mcp_config_file: renderMcpTemplate(manifest.mcp.template, mcpServer) } : {}),
|
|
520
|
+
};
|
|
521
|
+
// Under `config-arg` the rendered template is not a file but one whole argv element (§2.3 `{mcp_config}`).
|
|
522
|
+
const mcpConfig = manifest.mcp.via === 'config-arg' ? renderMcpTemplate(manifest.mcp.template, mcpServer) : undefined;
|
|
523
|
+
return withRunFiles(files, async (paths, releaseSignals) => {
|
|
524
|
+
// Step 11 — the MCP pre-flight.
|
|
525
|
+
const preflight = await mcpPreflight({
|
|
526
|
+
root,
|
|
527
|
+
server: mcpServer,
|
|
528
|
+
role,
|
|
529
|
+
element: elementRef,
|
|
530
|
+
stateRef: sha,
|
|
531
|
+
timeoutMs: host.mcpTimeoutMs ?? exports.MCP_PREFLIGHT_TIMEOUT_MS,
|
|
532
|
+
});
|
|
533
|
+
if (!preflight.ok)
|
|
534
|
+
return preflight;
|
|
535
|
+
// Step 12 — the terminal check, last.
|
|
536
|
+
const isTerminal = host.isTerminal ?? processHasTerminal;
|
|
537
|
+
if (manifest.launch.interactive.terminal === 'required' && !isTerminal()) {
|
|
538
|
+
return (0, types_1.coreErr)({ code: 'VALIDATION', message: 'interactive launch needs a terminal on stdin and stdout' });
|
|
539
|
+
}
|
|
540
|
+
return launch({
|
|
541
|
+
runId: runId.value,
|
|
542
|
+
element: elementRef,
|
|
543
|
+
workflow: step?.workflow ?? run_log_1.NO_WORKFLOW,
|
|
544
|
+
phase,
|
|
545
|
+
role,
|
|
546
|
+
// Every v0.3 run is fresh, whatever the step's allowedModes; the phase's separation of executors is not checked (§3.2 step 6, P4.12 in v1.0).
|
|
547
|
+
mode: exports.FRESH_MODE,
|
|
548
|
+
agent: agent.value,
|
|
549
|
+
adapter: adapter.value,
|
|
550
|
+
stateRef: sha,
|
|
551
|
+
logPath: logPath.value,
|
|
552
|
+
elementPath: element.value,
|
|
553
|
+
templatePath,
|
|
554
|
+
bootstrap,
|
|
555
|
+
mcpServer,
|
|
556
|
+
files: paths,
|
|
557
|
+
mcpConfig,
|
|
558
|
+
}, releaseSignals);
|
|
559
|
+
});
|
|
560
|
+
}
|
|
561
|
+
/** The plan of `prepared` (a pure function of it, host paths excluded). */
|
|
562
|
+
function launchPlan(prepared) {
|
|
563
|
+
return {
|
|
564
|
+
dryRun: true,
|
|
565
|
+
subject: (0, run_log_1.recordSubject)(prepared.runId),
|
|
566
|
+
paths: [prepared.logPath],
|
|
567
|
+
run: {
|
|
568
|
+
id: prepared.runId,
|
|
569
|
+
element: prepared.element,
|
|
570
|
+
workflow: prepared.workflow,
|
|
571
|
+
phase: prepared.phase,
|
|
572
|
+
role: prepared.role,
|
|
573
|
+
mode: prepared.mode,
|
|
574
|
+
agent: prepared.agent.name,
|
|
575
|
+
adapter: `${prepared.adapter.kind}/${prepared.adapter.name}`,
|
|
576
|
+
state_ref: prepared.stateRef,
|
|
577
|
+
},
|
|
578
|
+
bootstrap: prepared.bootstrap,
|
|
579
|
+
};
|
|
580
|
+
}
|
|
581
|
+
//# sourceMappingURL=execute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../src/agent/execute.ts"],"names":[],"mappings":";;;AAiGA,kCAEC;AAuBD,0CAEC;AAiBD,0CAUC;AAaD,sDAEC;AAUD,8CAMC;AAwBD,oCAsCC;AAmBD,8CAOC;AAMD,kCAYC;AA4BD,oCA4CC;AAqID,oDAcC;AAyLD,gCAkBC;AAtsBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,qCAA8F;AAC9F,qCAAiC;AACjC,yCAAiE;AAEjE,wEAAmE;AACnE,wEAAiF;AAEjF,wCAA2C;AAC3C,8CAAmF;AACnF,mDAA4E;AAC5E,2CAAqE;AACrE,wCAA6C;AAG7C,mEA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E,GAAG;YACb,OAAO,EAAE,OAAO,CAAC,KAAK;YACtB,WAAW,EAAE,OAAO,CAAC,KAAK;YAC1B,YAAY;YACZ,SAAS;YACT,SAAS;YACT,KAAK,EAAE,KAAK;YACZ,SAAS;SACV,EAAE,cAAc,CAAC,CAAC;IACrB,CAAC,CAAC,CAAC;AACL,CAAC;AAyBD,2EAA2E;AAC3E,SAAgB,UAAU,CAAC,QAAwB;IACjD,OAAO;QACL,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE,IAAA,uBAAa,EAAC,QAAQ,CAAC,KAAK,CAAC;QACtC,KAAK,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC;QACzB,GAAG,EAAE;YACH,EAAE,EAAE,QAAQ,CAAC,KAAK;YAClB,OAAO,EAAE,QAAQ,CAAC,OAAO;YACzB,QAAQ,EAAE,QAAQ,CAAC,QAAQ;YAC3B,KAAK,EAAE,QAAQ,CAAC,KAAK;YACrB,IAAI,EAAE,QAAQ,CAAC,IAAI;YACnB,IAAI,EAAE,QAAQ,CAAC,IAAI;YACnB,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI;YAC1B,OAAO,EAAE,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,IAAI,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE;YAC5D,SAAS,EAAE,QAAQ,CAAC,QAAQ;SAC7B;QACD,SAAS,EAAE,QAAQ,CAAC,SAAS;KAC9B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `agent` module — launching an agent's own CLI through a declared adapter (`adr-012`,
|
|
3
|
+
* `spec-016-agent-execution` §1). It owns adapter manifest loading and validation (task-177: the strict
|
|
4
|
+
* schema §2.2, the placeholder rules §2.3, discovery and loading at a revision §2.1, §3.2 step 5, and
|
|
5
|
+
* the report of what under `.wingfoil/agents/` is not an adapter, `bug-290`), the run log (task-206),
|
|
6
|
+
* `agent execute`'s pipeline up to the spawn (task-218, `./execute.ts`) and the launch (task-228,
|
|
7
|
+
* `./launch.ts`). Its operations are registered under the `agent` `CoreModule` (`src/core/index.ts`).
|
|
8
|
+
*/
|
|
9
|
+
export declare const MODULE_NAME: "agent";
|
|
10
|
+
export { ADAPTER_MANIFEST_FORMAT, AdapterManifest } from './schema';
|
|
11
|
+
export { E_ADAPTER_MANIFEST, parseAdapterManifest } from './manifest';
|
|
12
|
+
export type { AdapterKind, AdapterSource } from './manifest';
|
|
13
|
+
export { ADAPTER_PLACEHOLDERS, E_ADAPTER_PLACEHOLDER, placeholderIssues, requiredPlaceholderIssues } from './placeholders';
|
|
14
|
+
export type { AdapterPlaceholder } from './placeholders';
|
|
15
|
+
export { adapterTreeDiagnosticsAtRev, ADAPTERS_DIR_PATH, duplicateAdapterRefusal, E_ADAPTER_DUPLICATE, listAdaptersAtRev, loadAdapter, W_ADAPTER_IGNORED } from './discovery';
|
|
16
|
+
export type { AdapterEntry, LoadedAdapter } from './discovery';
|
|
17
|
+
export { ADHOC_PHASE, deriveNotesField, executionNotesSection, formatRunId, isRunId, isRunLogPath, nextRunId, NO_WORKFLOW, NOT_REPORTED, notesField, parseRunLog, readRunLogAt, readRunLogsAt, recordRun, recordSubject, requireWritableRunLog, resolveRunLogPath, runIdElementId, RUN_RECORD_KEYS, RUN_TOKEN_KEYS, runLogDirPrefix, runLogPreflight, serializeRunRecord, } from './run-log';
|
|
18
|
+
export type { DeriveNotesFieldInput, NextRunIdInput, NotesFieldInput, RecordedRun, ReportedCount, RunRecord, RunTokens, } from './run-log';
|
|
19
|
+
export { assignedSessionId, launchAgent, launchBanner, LOOKUP_TIMEOUT_MS, readJsonPath, renderLaunchArgv, runSummaryLine, SESSION_ID_NAMESPACE, uuidV5, } from './launch';
|
|
20
|
+
export type { LaunchHost, LaunchInput, LaunchValues, RecordedLaunch, SpawnAgent } from './launch';
|
|
21
|
+
export { agentCommandFound, attributionLine, ATTRIBUTION_LINE_PREFIX, agentExecutePipeline, DEFAULT_ROLE, DEFAULT_ROLE_WARNING, FRESH_MODE, handoffLine, launchPlan, MCP_PREFLIGHT_TIMEOUT_MS, MCP_UNREACHABLE_MESSAGE, mcpPreflight, renderBootstrap, renderMcpTemplate, runningBuildMcpServer, selectAgent, withRunFiles, } from './execute';
|
|
22
|
+
export type { AgentExecuteHost, AgentExecuteRequest, AgentLaunchPlan, BootstrapInput, McpPreflightInput, McpServerCommand, PreparedLaunch, RunFileName, } from './execute';
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agent/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,EAAG,OAAgB,CAAC;AAE5C,OAAO,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACtE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAC3H,YAAY,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC9K,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,qBAAqB,EACrB,WAAW,EACX,OAAO,EACP,YAAY,EACZ,SAAS,EACT,WAAW,EACX,YAAY,EACZ,UAAU,EACV,WAAW,EACX,YAAY,EACZ,aAAa,EACb,SAAS,EACT,aAAa,EACb,qBAAqB,EACrB,iBAAiB,E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