wingfoil 0.2.2 → 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 +83 -43
- 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 +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +2 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/init-command.d.ts.map +1 -1
- package/dist/cli/init-command.js +4 -2
- 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 +162 -40
- package/dist/cli/program.js.map +1 -1
- package/dist/cli/registrar.d.ts +1 -1
- package/dist/cli/registrar.d.ts.map +1 -1
- package/dist/cli/registrar.js +67 -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.d.ts.map +1 -1
- package/dist/core/exit-code.js +6 -7
- package/dist/core/exit-code.js.map +1 -1
- 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 +184 -10
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1045 -185
- package/dist/core/index.js.map +1 -1
- package/dist/core/init.d.ts +45 -5
- package/dist/core/init.d.ts.map +1 -1
- package/dist/core/init.js +134 -24
- 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 +82 -10
- 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 +34 -29
- package/dist/directives/schema.d.ts.map +1 -1
- package/dist/directives/schema.js +35 -29
- 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 +8 -4
- 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 +110 -24
- package/dist/memory/add.d.ts.map +1 -1
- package/dist/memory/add.js +251 -64
- package/dist/memory/add.js.map +1 -1
- package/dist/memory/audit.d.ts +152 -39
- package/dist/memory/audit.d.ts.map +1 -1
- package/dist/memory/audit.js +257 -103
- 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 +73 -12
- package/dist/memory/history.d.ts.map +1 -1
- package/dist/memory/history.js +128 -44
- 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 +34 -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 +134 -46
- 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 +170 -16
- 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 +14 -0
- package/dist/validation/id.d.ts.map +1 -1
- package/dist/validation/id.js +35 -11
- 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 +30 -1
- package/dist/validation/index.js.map +1 -1
- package/dist/validation/secret-scan.d.ts +3 -2
- package/dist/validation/secret-scan.d.ts.map +1 -1
- package/dist/validation/secret-scan.js +32 -11
- 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 +163 -15
- package/dist/workflow/schema.js.map +1 -1
- package/package.json +18 -8
package/dist/core/context.js
CHANGED
|
@@ -1,35 +1,71 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.WrittenTimestamp = exports.CONTEXT_PAYLOAD_FORMAT = void 0;
|
|
3
37
|
exports.selectDirectivesById = selectDirectivesById;
|
|
4
38
|
exports.resolveRoleDirectives = resolveRoleDirectives;
|
|
39
|
+
exports.validateExecutionContext = validateExecutionContext;
|
|
40
|
+
exports.serializeExecutionContext = serializeExecutionContext;
|
|
5
41
|
exports.assembleExecutionContext = assembleExecutionContext;
|
|
6
42
|
/**
|
|
7
|
-
*
|
|
8
|
-
* `
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* directives and 0 directives of other roles."
|
|
43
|
+
* The `spec-012-context-loader-relevance-filtering` context builder: the `directive-loader`
|
|
44
|
+
* ({@link resolveRoleDirectives}, §5), the `dna-loader` (§4), the call into the `relevance-filter`
|
|
45
|
+
* (`./relevance.ts`, §6), the validator (P5.4.4 sc. 3) and the canonical serializer (§7), behind one
|
|
46
|
+
* public entry, {@link assembleExecutionContext} (task-176; task-037 built the directive half,
|
|
47
|
+
* REQ-STATE-05).
|
|
13
48
|
*
|
|
14
|
-
*
|
|
15
|
-
* `
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* header previously recorded as an open gap — together with the `wingfoil://memory/{type}` collection
|
|
19
|
-
* Resource, the other surface that bug covered (`task-069-fix-archived-excluded-from-agent-context`).
|
|
49
|
+
* Every read is pinned to `spec-012` §2's `stateRef`: the entry resolves it once to a commit sha
|
|
50
|
+
* (`resolveRevision`) and reads every pillar and every Memory document at that sha through task-137's
|
|
51
|
+
* `…AtRev` readers. The working tree is never read, so the same `(role, element, stateRef, limits)`
|
|
52
|
+
* yields the same bytes (§8, REQ-SYS-07).
|
|
20
53
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* REQ-STATE-06) and v0.3 (`REQ-SYS-07`, `REQ-PERF-01`, `REQ-STATE-09`, the real `agent execute`
|
|
26
|
-
* CLI/MCP surface) — see this task's Execution Notes for the full scope decision. This module wraps
|
|
27
|
-
* only existing, already-shipped primitives: `loadDirectives`/`loadRolesYaml` (`./loaders`),
|
|
28
|
-
* `findMemoryDocumentByTypeAndId` and `isArchivedStatus` (`../memory`, task-011/task-035) — no
|
|
29
|
-
* scan/parse logic and no second status predicate is reimplemented here.
|
|
54
|
+
* **Archived elements never reach a context** (REQ-STATE-06, the `{deprecated, superseded}` set
|
|
55
|
+
* ratified by `dl-028-archived-states-excluded-from-context`): an archived subject element is refused,
|
|
56
|
+
* and archived candidates are dropped by the relevance filter — both through the shared
|
|
57
|
+
* `isArchivedStatus`.
|
|
30
58
|
*/
|
|
59
|
+
const jsYaml = __importStar(require("js-yaml"));
|
|
60
|
+
const js_yaml_1 = require("js-yaml");
|
|
31
61
|
const memory_1 = require("../memory");
|
|
62
|
+
const storage_1 = require("../storage");
|
|
63
|
+
const validation_1 = require("../validation");
|
|
32
64
|
const builtin_asset_1 = require("./builtin-asset");
|
|
65
|
+
const loaders_1 = require("./loaders");
|
|
66
|
+
const relevance_1 = require("./relevance");
|
|
67
|
+
const revision_1 = require("./revision");
|
|
68
|
+
const types_1 = require("./types");
|
|
33
69
|
/** `assignments` is a plain object parsed from YAML, so a role named `toString`, `constructor`,
|
|
34
70
|
* `valueOf`, `hasOwnProperty` or `__proto__` would otherwise resolve to an inherited
|
|
35
71
|
* `Object.prototype` member instead of `undefined`. Read own properties only. */
|
|
@@ -138,55 +174,555 @@ function resolveRoleDirectives(directiveFiles, rolesYaml, role) {
|
|
|
138
174
|
return { directives: [...selection.byId.values()], warnings };
|
|
139
175
|
}
|
|
140
176
|
/**
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
177
|
+
* The sections {@link validateExecutionContext} checks, in §7 order, with the shape each must have.
|
|
178
|
+
* The name is the {@link ExecutionContext} property, so the refusal names what to address.
|
|
179
|
+
*/
|
|
180
|
+
const REQUIRED_SECTIONS = [
|
|
181
|
+
['element', (value) => isRecord(value)],
|
|
182
|
+
['dna', (value) => isRecord(value) && Array.isArray(value.modules)],
|
|
183
|
+
['directives', (value) => Array.isArray(value)],
|
|
184
|
+
['memory', (value) => Array.isArray(value)],
|
|
185
|
+
];
|
|
186
|
+
function isRecord(value) {
|
|
187
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
188
|
+
}
|
|
189
|
+
function missingSection(name) {
|
|
190
|
+
return `invalid execution context: missing '${name}' section`;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Validate an assembled context before anything uses it (P5.4.4 sc. 3). The first section that is
|
|
194
|
+
* absent, or not of its section's shape, refuses the context with `VALIDATION` and the scenario's
|
|
195
|
+
* message, verbatim: `invalid execution context: missing '<section>' section`. Sections are checked in
|
|
196
|
+
* §7 order — `element`, `dna`, `directives`, `memory` — so the refusal is deterministic.
|
|
197
|
+
*/
|
|
198
|
+
function validateExecutionContext(candidate) {
|
|
199
|
+
const value = isRecord(candidate) ? candidate : {};
|
|
200
|
+
for (const [name, hasShape] of REQUIRED_SECTIONS) {
|
|
201
|
+
if (!hasShape(value[name]))
|
|
202
|
+
return (0, types_1.coreErr)({ code: 'VALIDATION', message: missingSection(name) });
|
|
203
|
+
}
|
|
204
|
+
return (0, types_1.coreOk)(candidate);
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* The payload's format version (`dl-150` option B, the `dl-149` format key): the first field of the
|
|
208
|
+
* header comment. A change to the bytes §7 pins is a new format.
|
|
209
|
+
*/
|
|
210
|
+
exports.CONTEXT_PAYLOAD_FORMAT = 1;
|
|
211
|
+
/**
|
|
212
|
+
* A YAML timestamp scalar exactly as its document wrote it (`bug-232`, review F1 of task-255): the
|
|
213
|
+
* frontmatter the payload carries holds one of these where js-yaml's default schema would hold a
|
|
214
|
+
* `Date`, so `2026-10-05`, `2026-10-05T00:00:00Z` and `2026-10-05 10:00:00 +02:00` are re-emitted
|
|
215
|
+
* unchanged rather than normalized to an instant.
|
|
216
|
+
*/
|
|
217
|
+
class WrittenTimestamp {
|
|
218
|
+
text;
|
|
219
|
+
constructor(
|
|
220
|
+
/** The scalar's text, as written. */
|
|
221
|
+
text) {
|
|
222
|
+
this.text = text;
|
|
223
|
+
}
|
|
224
|
+
/** The text as written, so `JSON.stringify` of a context renders the timestamp as the document did. */
|
|
225
|
+
toJSON() {
|
|
226
|
+
return this.text;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
exports.WrittenTimestamp = WrittenTimestamp;
|
|
230
|
+
// js-yaml 4 exports its built-in types as `types`; `@types/js-yaml` does not declare that export.
|
|
231
|
+
const types = jsYaml.types;
|
|
232
|
+
/** js-yaml's timestamp tag and resolution, constructing a {@link WrittenTimestamp} instead of a `Date`. */
|
|
233
|
+
const WRITTEN_TIMESTAMP_TYPE = new js_yaml_1.Type('tag:yaml.org,2002:timestamp', {
|
|
234
|
+
kind: 'scalar',
|
|
235
|
+
resolve: (data) => types.timestamp.resolve(data),
|
|
236
|
+
construct: (data) => new WrittenTimestamp(data),
|
|
237
|
+
instanceOf: WrittenTimestamp,
|
|
238
|
+
represent: (value) => value.text,
|
|
239
|
+
});
|
|
240
|
+
/**
|
|
241
|
+
* The schema the payload's frontmatter is read and dumped with: js-yaml's default schema (same implicit
|
|
242
|
+
* and explicit types, so it accepts what the scan accepted) with {@link WRITTEN_TIMESTAMP_TYPE} in place
|
|
243
|
+
* of the timestamp type. A timestamp is written back as written; a quoted date is a string that a reader
|
|
244
|
+
* could take for a timestamp, so the dump keeps it quoted.
|
|
245
|
+
*/
|
|
246
|
+
const PAYLOAD_YAML_SCHEMA = js_yaml_1.CORE_SCHEMA.extend({
|
|
247
|
+
implicit: [WRITTEN_TIMESTAMP_TYPE, types.merge],
|
|
248
|
+
explicit: [types.binary, types.omap, types.pairs, types.set],
|
|
249
|
+
});
|
|
250
|
+
/** `value` with every `Date` — a value a caller built itself, never one the builder read — as its
|
|
251
|
+
* ISO-8601 UTC text, at any depth, so {@link serializeExecutionContext} accepts it. */
|
|
252
|
+
function withDatesAsWritten(value) {
|
|
253
|
+
if (value instanceof WrittenTimestamp)
|
|
254
|
+
return value;
|
|
255
|
+
if (value instanceof Date)
|
|
256
|
+
return new WrittenTimestamp(value.toISOString());
|
|
257
|
+
if (Array.isArray(value))
|
|
258
|
+
return value.map(withDatesAsWritten);
|
|
259
|
+
if (isRecord(value))
|
|
260
|
+
return Object.fromEntries(Object.entries(value).map(([key, entry]) => [key, withDatesAsWritten(entry)]));
|
|
261
|
+
return value;
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* The frontmatter of each document at `paths`, as commit `sha` holds it, read with
|
|
265
|
+
* {@link PAYLOAD_YAML_SCHEMA} so its timestamps keep their text (`bug-232`). Every path was read and
|
|
266
|
+
* parsed at `sha` by the scan already, with a schema that accepts the same documents, and each one
|
|
267
|
+
* has a frontmatter block: the element is found, and a document carried, by its frontmatter's `type`
|
|
268
|
+
* and `id`.
|
|
269
|
+
*/
|
|
270
|
+
function writtenFrontmatter(root, sha, paths) {
|
|
271
|
+
return (0, storage_1.readPathsAtRev)(root, sha, [...paths]).map((raw) => (0, js_yaml_1.load)((0, storage_1.splitFrontmatter)(raw).frontmatter, { schema: PAYLOAD_YAML_SCHEMA }));
|
|
272
|
+
}
|
|
273
|
+
/** YAML for the payload: keys sorted ascending (§7), no line folding and no anchors, dates as written
|
|
274
|
+
* (`bug-232`), so the text is a function of the value alone. */
|
|
275
|
+
function canonicalYaml(value) {
|
|
276
|
+
return (0, js_yaml_1.dump)(withDatesAsWritten(value), { schema: PAYLOAD_YAML_SCHEMA, sortKeys: true, lineWidth: -1, noRefs: true });
|
|
277
|
+
}
|
|
278
|
+
function yamlBlock(value) {
|
|
279
|
+
return '```yaml\n' + canonicalYaml(value) + '```';
|
|
280
|
+
}
|
|
281
|
+
/** A body as §7 carries it: verbatim, without the blank lines before it or the whitespace after it. */
|
|
282
|
+
function trimBody(body) {
|
|
283
|
+
return body.replace(/^(?:[ \t]*\r?\n)+/, '').trimEnd();
|
|
284
|
+
}
|
|
285
|
+
/** The line that closes the body keyed `key` (`dl-150` B). */
|
|
286
|
+
function endMarker(key) {
|
|
287
|
+
return `<!-- end:${key} -->`;
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* A body between its markers: `<!-- begin:<key> -->`, the trimmed body, `<!-- end:<key> -->`, each on
|
|
291
|
+
* its own line; an empty body leaves the two markers adjacent.
|
|
292
|
+
*/
|
|
293
|
+
function markedBody(key, body) {
|
|
294
|
+
const trimmed = trimBody(body);
|
|
295
|
+
return [`<!-- begin:${key} -->`, ...(trimmed.length > 0 ? [trimmed] : []), endMarker(key)].join('\n');
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Whether `body`, once canonicalized (§7), holds the line that closes it — the one body a reader could
|
|
299
|
+
* not split by `dl-150` B's rule, so it never enters a payload.
|
|
300
|
+
*/
|
|
301
|
+
function closesItself(key, body) {
|
|
302
|
+
const marker = endMarker(key);
|
|
303
|
+
return canonicalize(body).split('\n').includes(marker);
|
|
304
|
+
}
|
|
305
|
+
function selfClosingProblem(what, key) {
|
|
306
|
+
return `${what} cannot enter an execution context: its body holds the line ${JSON.stringify(endMarker(key))} that closes it`;
|
|
307
|
+
}
|
|
308
|
+
/** The marker key of a directive body. */
|
|
309
|
+
function directiveKey(id) {
|
|
310
|
+
return `directive:${id}`;
|
|
311
|
+
}
|
|
312
|
+
/** Whether a Memory document can be named in the payload: a string `type` and `id`, each fit for a
|
|
313
|
+
* heading and a marker (no control character, no `-->`). */
|
|
314
|
+
function isNameable(type, id) {
|
|
315
|
+
return (typeof type === 'string' &&
|
|
316
|
+
typeof id === 'string' &&
|
|
317
|
+
type.length > 0 &&
|
|
318
|
+
id.length > 0 &&
|
|
319
|
+
headerFieldProblem('type', type) === undefined &&
|
|
320
|
+
headerFieldProblem('id', id) === undefined);
|
|
321
|
+
}
|
|
322
|
+
/** §7's canonicalization: LF only, no trailing whitespace on any line, exactly one trailing `\n`. */
|
|
323
|
+
function canonicalize(text) {
|
|
324
|
+
return (text
|
|
325
|
+
.replace(/\r\n?/g, '\n')
|
|
326
|
+
.replace(/[ \t]+$/gm, '')
|
|
327
|
+
.replace(/\n+$/, '') + '\n');
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Why `value` cannot sit in the payload's header comment, or `undefined` when it can. The header is one
|
|
331
|
+
* line inside `<!-- … -->`: a line break would split it, and `-->` would close the comment early and
|
|
332
|
+
* let the rest of the value pass for payload content. Control characters are refused with them.
|
|
333
|
+
*/
|
|
334
|
+
function headerFieldProblem(name, value) {
|
|
335
|
+
// eslint-disable-next-line no-control-regex
|
|
336
|
+
if (/[\u0000-\u001f\u007f]/.test(value) || value.includes('-->')) {
|
|
337
|
+
return `invalid ${name} ${JSON.stringify(value)}: it may hold no control character and no '-->'`;
|
|
338
|
+
}
|
|
339
|
+
return undefined;
|
|
340
|
+
}
|
|
341
|
+
/** The first body in `context` that {@link closesItself}, as its refusal; `undefined` when none does.
|
|
342
|
+
* The element first, then directives in payload order. */
|
|
343
|
+
function selfClosingBody(context) {
|
|
344
|
+
const { element } = context;
|
|
345
|
+
const elementKey = `${element.type}:${element.id}`;
|
|
346
|
+
if (closesItself(elementKey, element.body))
|
|
347
|
+
return selfClosingProblem(`element '${elementKey}'`, elementKey);
|
|
348
|
+
for (const directive of context.directives) {
|
|
349
|
+
const key = directiveKey(directive.frontmatter.id);
|
|
350
|
+
if (closesItself(key, directive.body))
|
|
351
|
+
return selfClosingProblem(`directive '${directive.frontmatter.id}'`, key);
|
|
352
|
+
}
|
|
353
|
+
return undefined;
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* Render a context as `spec-012` §7's canonical Markdown payload, format {@link CONTEXT_PAYLOAD_FORMAT}
|
|
357
|
+
* (`dl-150` option B) — the bytes §8 holds identical across builds. Fixed headings in a fixed order,
|
|
358
|
+
* one blank line between blocks; frontmatter and DNA sections as fenced YAML with sorted keys; every
|
|
359
|
+
* directive and document body verbatim between `<!-- begin:<key> -->`/`<!-- end:<key> -->` markers
|
|
360
|
+
* (`<type>:<id>` for the element and Memory, `directive:<id>` for a directive), so a body's own
|
|
361
|
+
* headings never pass for §7's; ids rather than paths; the header names only the format, role, element
|
|
362
|
+
* and the resolved sha. `warnings` are not rendered.
|
|
363
|
+
*
|
|
364
|
+
* @throws Error `invalid execution context: missing '<section>' section` when `context` does not
|
|
365
|
+
* validate ({@link validateExecutionContext}): a partial payload is never rendered. Error `invalid
|
|
366
|
+
* role …` (or `element type`/`element id`/`directive id`) when a header field or a directive id holds
|
|
367
|
+
* a control character or `-->`; `invalid Memory document <path>: …` for a document it cannot name;
|
|
368
|
+
* `… cannot enter an execution context: its body holds the line … that closes it` for a body that
|
|
369
|
+
* holds its own end marker.
|
|
370
|
+
*/
|
|
371
|
+
function serializeExecutionContext(context) {
|
|
372
|
+
const valid = validateExecutionContext(context);
|
|
373
|
+
if (!valid.ok)
|
|
374
|
+
throw new Error(valid.error.message);
|
|
375
|
+
const unsafe = headerFieldProblem('role', context.role) ??
|
|
376
|
+
headerFieldProblem('element type', context.element.type) ??
|
|
377
|
+
headerFieldProblem('element id', context.element.id) ??
|
|
378
|
+
context.directives.map((directive) => headerFieldProblem('directive id', directive.frontmatter.id)).find((problem) => problem !== undefined) ??
|
|
379
|
+
selfClosingBody(context);
|
|
380
|
+
if (unsafe !== undefined)
|
|
381
|
+
throw new Error(unsafe);
|
|
382
|
+
const { role, stateRef, element, dna, directives, memory } = context;
|
|
383
|
+
// The header comment sits on the title's next line, as §7's template shows.
|
|
384
|
+
const blocks = [
|
|
385
|
+
`# WingFoil Agent Context\n<!-- format: ${exports.CONTEXT_PAYLOAD_FORMAT} | role: ${role} | element: ${element.type}:${element.id} | state: ${stateRef} -->`,
|
|
386
|
+
];
|
|
387
|
+
blocks.push('## 1. Task', yamlBlock(element.frontmatter), markedBody(`${element.type}:${element.id}`, element.body));
|
|
388
|
+
blocks.push('## 2. Project DNA');
|
|
389
|
+
for (const [name, value] of Object.entries(dna))
|
|
390
|
+
blocks.push(`### ${name}`, yamlBlock(value));
|
|
391
|
+
blocks.push(`## 3. Directives (${role} + global)`);
|
|
392
|
+
for (const directive of directives) {
|
|
393
|
+
blocks.push(`### ${directive.frontmatter.id}`, markedBody(directiveKey(directive.frontmatter.id), directive.body));
|
|
394
|
+
}
|
|
395
|
+
blocks.push(`## 4. Relevant Memory (${memory.length} documents)`);
|
|
396
|
+
for (const doc of memory) {
|
|
397
|
+
if (!isNameable(doc.type, doc.id)) {
|
|
398
|
+
throw new Error(`invalid Memory document ${doc.path}: an execution context names a document by a type and an id that hold no control character and no '-->'`);
|
|
399
|
+
}
|
|
400
|
+
const key = `${doc.type}:${doc.id}`;
|
|
401
|
+
if (closesItself(key, doc.body))
|
|
402
|
+
throw new Error(selfClosingProblem(`Memory document '${key}'`, key));
|
|
403
|
+
blocks.push(`### ${key}`, yamlBlock(doc.frontmatter), markedBody(key, doc.body));
|
|
404
|
+
}
|
|
405
|
+
return canonicalize(blocks.join('\n\n'));
|
|
406
|
+
}
|
|
407
|
+
function asNames(value) {
|
|
408
|
+
const entries = typeof value === 'string' ? [value] : Array.isArray(value) ? value : [];
|
|
409
|
+
return entries.filter((entry) => typeof entry === 'string' && entry.trim().length > 0);
|
|
410
|
+
}
|
|
411
|
+
/** A path with `\` read as `/` and no trailing `/`, so `src/core/` and `src/core` compare equal. */
|
|
412
|
+
function normalizePath(path) {
|
|
413
|
+
return path.replace(/\\/g, '/').replace(/\/+$/, '');
|
|
414
|
+
}
|
|
415
|
+
/** Leading characters an entry's token never starts with: quotes and backticks. */
|
|
416
|
+
const TOKEN_LEAD = /^[`'"]+/;
|
|
417
|
+
/** Trailing characters an entry's token never ends with: list and sentence punctuation, quotes and
|
|
418
|
+
* backticks (`bug-233`). */
|
|
419
|
+
const TOKEN_TRAIL = /[`'".,;:!?]+$/;
|
|
420
|
+
/**
|
|
421
|
+
* The tokens one `modules:`/`scope:` value names (`spec-012` §4, `bug-233`): parenthesised text is
|
|
422
|
+
* set aside, the rest is split on commas into entries, and each entry is read by its leading token
|
|
423
|
+
* with surrounding quotes, backticks and trailing punctuation stripped — `src/mcp/server.ts, src/cli
|
|
424
|
+
* (the \`wingfoil mcp\` command)` names `src/mcp/server.ts` and `src/cli`.
|
|
425
|
+
*/
|
|
426
|
+
function entryTokens(entry) {
|
|
427
|
+
let text = entry;
|
|
428
|
+
for (let previous = ''; previous !== text;) {
|
|
429
|
+
previous = text;
|
|
430
|
+
text = text.replace(/\([^()]*\)/g, ' ');
|
|
431
|
+
}
|
|
432
|
+
return text
|
|
433
|
+
.split(',')
|
|
434
|
+
.map((part) => part.trim().split(/\s+/)[0].replace(TOKEN_LEAD, '').replace(TOKEN_TRAIL, ''))
|
|
435
|
+
.filter((token) => token.length > 0);
|
|
436
|
+
}
|
|
437
|
+
/** Whether `inner` equals `outer` or lies under it at a segment boundary. */
|
|
438
|
+
function isAtOrUnder(inner, outer) {
|
|
439
|
+
return outer.length > 0 && (inner === outer || inner.startsWith(`${outer}/`));
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* Whether one token of a `modules:`/`scope:` entry selects `module` (`spec-012` §4, approver ruling D3
|
|
443
|
+
* and `bug-233`): it equals the module's `name`, or — as a path, compared at segment boundaries — the
|
|
444
|
+
* module's `path` equals it, lies under it (`src` selects `src/core`), or holds it (`src/mcp/server.ts`
|
|
445
|
+
* selects `src/mcp`). `src/co` selects nothing.
|
|
446
|
+
*/
|
|
447
|
+
function tokenSelectsModule(token, module) {
|
|
448
|
+
if (token === module.name)
|
|
449
|
+
return true;
|
|
450
|
+
if (module.path === undefined)
|
|
451
|
+
return false;
|
|
452
|
+
const named = normalizePath(token);
|
|
453
|
+
const path = normalizePath(module.path);
|
|
454
|
+
return isAtOrUnder(path, named) || isAtOrUnder(named, path);
|
|
455
|
+
}
|
|
456
|
+
/** The note recorded when the element names modules and none of them matches (ruling D3). */
|
|
457
|
+
function noModuleMatchNote(entries) {
|
|
458
|
+
return `no module matches the element's modules:/scope: (${entries.map((entry) => JSON.stringify(entry)).join(', ')}); all modules included`;
|
|
459
|
+
}
|
|
460
|
+
/** The top-level keys of a `dna.yaml` text that has already validated, in the order the file
|
|
461
|
+
* declares them. */
|
|
462
|
+
function declaredKeyOrder(raw, label) {
|
|
463
|
+
return Object.keys((0, validation_1.parseYaml)(raw, label));
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* `spec-012` §4, the `dna-loader`: `project`, `stacks` (`dl-151` A) and `team` always, `paths` whole
|
|
467
|
+
* (every category), and the `modules` the tokens of the element's `modules:`/`scope:` entries select
|
|
468
|
+
* ({@link entryTokens}, {@link tokenSelectsModule}), in
|
|
469
|
+
* `dna.yaml` order. Every module when it names none — and also when it names some and none matches,
|
|
470
|
+
* which then returns a note (ruling D3) for the caller's diagnostics. Sections are inserted in
|
|
471
|
+
* `declaredOrder`, the file's own key order.
|
|
472
|
+
*/
|
|
473
|
+
function selectDnaSections(dna, declaredOrder, frontmatter) {
|
|
474
|
+
const entries = [...asNames(frontmatter.modules), ...asNames(frontmatter.scope)];
|
|
475
|
+
const tokens = entries.flatMap(entryTokens);
|
|
476
|
+
const matched = dna.modules.filter((module) => tokens.some((token) => tokenSelectsModule(token, module)));
|
|
477
|
+
const unmatched = entries.length > 0 && matched.length === 0;
|
|
478
|
+
const sections = {
|
|
479
|
+
project: dna.project,
|
|
480
|
+
modules: matched.length === 0 ? dna.modules : matched,
|
|
481
|
+
stacks: dna.stacks,
|
|
482
|
+
team: dna.team,
|
|
483
|
+
paths: dna.paths,
|
|
484
|
+
};
|
|
485
|
+
const selection = {};
|
|
486
|
+
for (const key of declaredOrder)
|
|
487
|
+
if (sections[key] !== undefined)
|
|
488
|
+
selection[key] = sections[key];
|
|
489
|
+
return unmatched
|
|
490
|
+
? { selection: selection, note: noModuleMatchNote(entries) }
|
|
491
|
+
: { selection: selection };
|
|
492
|
+
}
|
|
493
|
+
/** The Markdown body of each resolved directive, read at `sha` (`DirectiveFile.path` is relative to
|
|
494
|
+
* `.wingfoil/`). */
|
|
495
|
+
function withBodies(root, sha, directives) {
|
|
496
|
+
return directives.map((directive) => {
|
|
497
|
+
const raw = (0, storage_1.readPathAtRev)(root, sha, `.wingfoil/${directive.path.split(/[\\/]/).join('/')}`) ?? '';
|
|
498
|
+
return { ...directive, body: (0, storage_1.splitFrontmatter)(raw).body };
|
|
499
|
+
});
|
|
500
|
+
}
|
|
501
|
+
function stringField(frontmatter, key) {
|
|
502
|
+
const value = frontmatter[key];
|
|
503
|
+
return typeof value === 'string' ? value : undefined;
|
|
504
|
+
}
|
|
505
|
+
/** The pillar file whose absence at `stateRef` leaves each section unset, keyed by the refusal. */
|
|
506
|
+
const ABSENT_PILLAR_FILE = {
|
|
507
|
+
[missingSection('element')]: loaders_1.MEMORY_YAML_PATH,
|
|
508
|
+
[missingSection('dna')]: loaders_1.DNA_YAML_PATH,
|
|
509
|
+
[missingSection('directives')]: loaders_1.ROLES_YAML_PATH,
|
|
510
|
+
};
|
|
511
|
+
function isPositiveInteger(value) {
|
|
512
|
+
return typeof value === 'number' && Number.isInteger(value) && value > 0;
|
|
513
|
+
}
|
|
514
|
+
/**
|
|
515
|
+
* A request the builder refuses before reading anything (`VALIDATION`): a role or element field that
|
|
516
|
+
* cannot sit in the payload header (`headerFieldProblem`), or limits that are not positive integers —
|
|
517
|
+
* `NaN`, a fraction, zero or a negative number would make §6's bounding meaningless.
|
|
518
|
+
*/
|
|
519
|
+
function requestProblem(request) {
|
|
520
|
+
const header = headerFieldProblem('role', request.role) ??
|
|
521
|
+
headerFieldProblem('element type', request.element.type) ??
|
|
522
|
+
headerFieldProblem('element id', request.element.id);
|
|
523
|
+
if (header !== undefined)
|
|
524
|
+
return { code: 'VALIDATION', message: header };
|
|
525
|
+
const { limits } = request;
|
|
526
|
+
if (limits !== undefined && !(isPositiveInteger(limits.maxDocs) && isPositiveInteger(limits.maxBytes))) {
|
|
527
|
+
return {
|
|
528
|
+
code: 'VALIDATION',
|
|
529
|
+
message: `invalid context limits: maxDocs and maxBytes must be positive integers (got ${String(limits.maxDocs)}, ${String(limits.maxBytes)})`,
|
|
530
|
+
};
|
|
531
|
+
}
|
|
532
|
+
return undefined;
|
|
533
|
+
}
|
|
534
|
+
/** Ranks with no bound: used only to learn which unnameable documents would have been relevant. */
|
|
535
|
+
const UNBOUNDED = { maxDocs: Number.MAX_SAFE_INTEGER, maxBytes: Number.MAX_SAFE_INTEGER };
|
|
536
|
+
/**
|
|
537
|
+
* The Memory documents §7 can carry (`dl-150` B), before §6 ranks them: a document needs a nameable
|
|
538
|
+
* `type` and `id` ({@link isNameable}) for its heading and markers, and a body that does not hold its
|
|
539
|
+
* own end marker ({@link closesItself}). An unnameable document is reported only when §6 would have
|
|
540
|
+
* found it relevant — a repository's frontmatter-less files (grandfathered plans) would otherwise be
|
|
541
|
+
* reported in every context; a self-closing one is always reported. Neither takes a slot in the
|
|
542
|
+
* bounds, so the documents carried are what §6 selects among the rest.
|
|
543
|
+
*/
|
|
544
|
+
function payloadCandidates(documents, element) {
|
|
545
|
+
const carried = [];
|
|
546
|
+
const unnamed = [];
|
|
547
|
+
const left = [];
|
|
548
|
+
for (const doc of documents) {
|
|
549
|
+
const { type, id } = doc.frontmatter;
|
|
550
|
+
if (!isNameable(type, id)) {
|
|
551
|
+
unnamed.push(doc);
|
|
552
|
+
continue;
|
|
553
|
+
}
|
|
554
|
+
const key = `${type}:${id}`;
|
|
555
|
+
if (closesItself(key, doc.body)) {
|
|
556
|
+
const reason = `its body holds the line ${JSON.stringify(endMarker(key))} that closes it in an execution context`;
|
|
557
|
+
left.push({ path: doc.path, diagnostic: (0, memory_1.memoryUnreadableDiagnostic)(doc.path, reason) });
|
|
558
|
+
}
|
|
559
|
+
else
|
|
560
|
+
carried.push(doc);
|
|
561
|
+
}
|
|
562
|
+
for (const doc of (0, relevance_1.selectRelevantMemoryDocuments)(unnamed, element, UNBOUNDED).documents) {
|
|
563
|
+
const reason = 'no string type and id, so an execution context cannot name it';
|
|
564
|
+
left.push({ path: doc.path, diagnostic: (0, memory_1.memoryUnreadableDiagnostic)(doc.path, reason) });
|
|
565
|
+
}
|
|
566
|
+
// A path is reported at most once, so no two compare equal.
|
|
567
|
+
left.sort((a, b) => (a.path < b.path ? -1 : 1));
|
|
568
|
+
return { carried, left: left.map((entry) => entry.diagnostic) };
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* The refusal of a subject that commit `sha` holds in a `format:` newer than this build reads (task-195,
|
|
572
|
+
* `bug-263`), or `undefined`. The tolerant scan leaves such a document out as `W_MEMORY_UNREADABLE`, so
|
|
573
|
+
* the subject looks absent; the lookup by (`type`, `id`) refuses exactly that case with the `dl-149`
|
|
574
|
+
* `ValidationError` (`E_INVALID_FORMAT`), which becomes `VALIDATION` here, as every verb that names the
|
|
575
|
+
* element refuses it. Called only when the scan did not find the subject, so a context that builds pays
|
|
576
|
+
* nothing for it.
|
|
577
|
+
*/
|
|
578
|
+
function newerFormatSubject(root, sha, memoryYaml, wanted, label) {
|
|
579
|
+
try {
|
|
580
|
+
(0, memory_1.findMemoryDocumentByTypeAndIdAtRev)(root, sha, memoryYaml, wanted.type, wanted.id, { includeArchived: true });
|
|
581
|
+
}
|
|
582
|
+
catch (error) {
|
|
583
|
+
if (!(0, validation_1.isNewerFormatError)(error))
|
|
584
|
+
throw error;
|
|
585
|
+
return {
|
|
586
|
+
code: 'VALIDATION',
|
|
587
|
+
message: `element '${label}' at ${sha} is written in a newer format: ${error.message}`,
|
|
588
|
+
details: { issues: error.issues },
|
|
589
|
+
};
|
|
590
|
+
}
|
|
591
|
+
return undefined;
|
|
592
|
+
}
|
|
593
|
+
/**
|
|
594
|
+
* Build the execution context for `request` — `spec-012`'s single public entry (§1), the context
|
|
595
|
+
* `agent execute` (task-218) and the `{role}-session` Prompt (task-195) hand an agent.
|
|
596
|
+
*
|
|
597
|
+
* The §3 pipeline, every read at the one commit `request.stateRef` resolves to:
|
|
147
598
|
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
599
|
+
* 1. **resolve-element**: every Memory document at that commit is read once
|
|
600
|
+
* (`loadMemoryDocumentsAtRev`); the element is found in that snapshot. Absent → `NOT_FOUND`;
|
|
601
|
+
* archived (`isArchivedStatus`) → `VALIDATION`, since an archived document never enters a context
|
|
602
|
+
* (REQ-STATE-06). A `draft` element assembles.
|
|
603
|
+
* 2. **load-dna** (§4): see `selectDnaSections`; modules match by name or path (ruling D3, `bug-233`).
|
|
604
|
+
* 3. **load-directives** (§5): {@link resolveRoleDirectives} over the directives and `roles.yaml` at the
|
|
605
|
+
* commit; its warnings become `context.warnings`.
|
|
606
|
+
* 4. **filter-memory** (§6): `selectRelevantMemoryDocuments` over the same snapshot, within
|
|
607
|
+
* `request.limits`, among the documents §7 can carry (`dl-150` B, `payloadCandidates`): one with
|
|
608
|
+
* no nameable `type` and `id` is left out, and reported only when it would have been relevant; one
|
|
609
|
+
* whose body holds its own end marker is left out and reported. Both reports are
|
|
610
|
+
* `W_MEMORY_UNREADABLE` lines on the success warnings, after the scan's own, in path order.
|
|
611
|
+
* 5. **validate** (P5.4.4 sc. 3) and **serialize** (§7).
|
|
151
612
|
*
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
* during that walk has unparseable frontmatter. This function adds no `try`/`catch` of its own.
|
|
613
|
+
* A pillar file the commit does not hold leaves its section unset, and step 5 refuses the context:
|
|
614
|
+
* no `roles.yaml` → `missing 'directives'`, no `dna.yaml` → `missing 'dna'`, no `memory.yaml` →
|
|
615
|
+
* `missing 'element'`; the refusal's `details.cause` names the file (`no .wingfoil/roles.yaml at <sha>`).
|
|
616
|
+
* Before any read, a role or element field holding a control character or `-->`, or limits that are
|
|
617
|
+
* not positive integers, are refused as `VALIDATION`. After the reads, an element or directive body
|
|
618
|
+
* that holds its own end marker, or a directive id holding a control character or `-->`, refuses the
|
|
619
|
+
* context as `VALIDATION`: neither may be dropped (§5 never truncates a directive).
|
|
160
620
|
*
|
|
161
|
-
*
|
|
162
|
-
* `
|
|
163
|
-
* (`../memory`, the set ratified by `dl-028-archived-states-excluded-from-context`) — is dropped,
|
|
164
|
-
* leaving `memory` empty. That is REQ-STATE-06's Fit Criterion as amended: "a `deprecated` or
|
|
165
|
-
* `superseded` document never appears in an assembled agent context". The filter is applied to the
|
|
166
|
-
* lookup's *result* rather than pushed into `findMemoryDocumentByTypeAndId`, because that same
|
|
167
|
-
* primitive also serves `wingfoil://memory/{type}/{id}`, where explicit retrieval of archived content
|
|
168
|
-
* must keep working.
|
|
621
|
+
* A subject the commit holds in a `format:` newer than this build reads is refused as `VALIDATION` with
|
|
622
|
+
* the `dl-149` `E_INVALID_FORMAT` text (task-195, `bug-263`), not reported as absent.
|
|
169
623
|
*
|
|
170
|
-
*
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
* `resolve-element` stage), and blanking the context for a task still in `draft` would defeat the
|
|
174
|
-
* point of assembling it. dl-028 ratified the archived set as `{deprecated, superseded}` and did not
|
|
175
|
-
* put `draft` in it.
|
|
624
|
+
* A Memory document that does not parse is left out and reported (task-171): as a `W_MEMORY_UNREADABLE`
|
|
625
|
+
* line in the result's `warnings` on success, and in `details.unreadable` of a `NOT_FOUND` refusal, so
|
|
626
|
+
* a subject that does not parse is not reported as merely absent. Neither reaches the payload.
|
|
176
627
|
*
|
|
177
|
-
*
|
|
178
|
-
*
|
|
179
|
-
*
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
628
|
+
* Expected failures are returned, never thrown: a `stateRef` that is malformed or names no commit is
|
|
629
|
+
* the `RevisionError`'s own `CoreError`. A pillar file (`dna.yaml`, `roles.yaml`, a directive) that
|
|
630
|
+
* does not parse still throws `ValidationError`, as its loader does.
|
|
631
|
+
*/
|
|
632
|
+
function assembleExecutionContext(root, request) {
|
|
633
|
+
const refused = requestProblem(request);
|
|
634
|
+
if (refused !== undefined)
|
|
635
|
+
return (0, types_1.coreErr)(refused);
|
|
636
|
+
let sha;
|
|
637
|
+
try {
|
|
638
|
+
sha = (0, revision_1.resolveRevision)(root, request.stateRef);
|
|
639
|
+
}
|
|
640
|
+
catch (error) {
|
|
641
|
+
if (error instanceof revision_1.RevisionError)
|
|
642
|
+
return (0, types_1.coreErr)(error.toCoreError());
|
|
643
|
+
throw error;
|
|
644
|
+
}
|
|
645
|
+
const { role, element: wanted } = request;
|
|
646
|
+
const label = `${wanted.type}:${wanted.id}`;
|
|
647
|
+
// The scan is tolerant (task-171, `bug-031`): a document it cannot read is left out and reported as
|
|
648
|
+
// `W_MEMORY_UNREADABLE`, so one malformed sibling no longer fails every context. It reads archived
|
|
649
|
+
// documents too — the archived subject is refused below, and §6 drops archived candidates itself.
|
|
650
|
+
const diagnostics = [];
|
|
651
|
+
const memoryYaml = (0, loaders_1.loadMemoryYamlAtRev)(root, sha);
|
|
652
|
+
const documents = memoryYaml === null
|
|
653
|
+
? null
|
|
654
|
+
: (0, memory_1.loadMemoryDocumentsAtRev)(root, sha, memoryYaml, { onDiagnostic: (diagnostic) => diagnostics.push(diagnostic) });
|
|
655
|
+
const unreadable = diagnostics.map(validation_1.formatDiagnostic);
|
|
656
|
+
const found = documents?.find((doc) => stringField(doc.frontmatter, 'type') === wanted.type && stringField(doc.frontmatter, 'id') === wanted.id);
|
|
657
|
+
if (documents !== null && found === undefined) {
|
|
658
|
+
// A subject written in a newer format exists: it is refused for its format (`bug-263`).
|
|
659
|
+
const newer = newerFormatSubject(root, sha, memoryYaml, wanted, label);
|
|
660
|
+
if (newer !== undefined)
|
|
661
|
+
return (0, types_1.coreErr)(newer);
|
|
662
|
+
// A subject whose own frontmatter does not parse is among the unreadable files: name them, so the
|
|
663
|
+
// refusal does not read as a bare "not found".
|
|
664
|
+
return (0, types_1.coreErr)({
|
|
665
|
+
code: 'NOT_FOUND',
|
|
666
|
+
message: `element '${label}' not found at ${sha}`,
|
|
667
|
+
...(unreadable.length > 0 ? { details: { unreadable } } : {}),
|
|
668
|
+
});
|
|
669
|
+
}
|
|
670
|
+
const status = found === undefined ? undefined : stringField(found.frontmatter, 'status');
|
|
671
|
+
if ((0, memory_1.isArchivedStatus)(status)) {
|
|
672
|
+
return (0, types_1.coreErr)({
|
|
673
|
+
code: 'VALIDATION',
|
|
674
|
+
message: `element '${label}' is ${status}: an archived element never enters an execution context`,
|
|
675
|
+
});
|
|
676
|
+
}
|
|
677
|
+
const element = found === undefined ? undefined : { ...found, type: wanted.type, id: wanted.id };
|
|
678
|
+
const frontmatter = element?.frontmatter ?? {};
|
|
679
|
+
// `loadDnaYamlAtRev` validates; the raw text gives the declared section order, which the
|
|
680
|
+
// Zod-parsed object loses (schema keys come first there). `loadDnaYamlAtRev` is non-null whenever
|
|
681
|
+
// the raw read is: both read the same path at the same sha.
|
|
682
|
+
const dnaRaw = (0, storage_1.readPathAtRev)(root, sha, loaders_1.DNA_YAML_PATH);
|
|
683
|
+
const dnaSelected = dnaRaw === null
|
|
684
|
+
? undefined
|
|
685
|
+
: selectDnaSections((0, loaders_1.loadDnaYamlAtRev)(root, sha), declaredKeyOrder(dnaRaw, `${sha}:${loaders_1.DNA_YAML_PATH}`), frontmatter);
|
|
686
|
+
const dna = dnaSelected?.selection;
|
|
687
|
+
const rolesYaml = (0, loaders_1.loadRolesYamlAtRev)(root, sha);
|
|
688
|
+
const resolution = rolesYaml === null ? undefined : resolveRoleDirectives((0, loaders_1.loadDirectivesAtRev)(root, sha), rolesYaml, role);
|
|
689
|
+
const directives = resolution === undefined ? undefined : withBodies(root, sha, resolution.directives);
|
|
690
|
+
const candidates = documents === null ? undefined : payloadCandidates(documents, { ...wanted, frontmatter });
|
|
691
|
+
const relevant = candidates === undefined
|
|
692
|
+
? undefined
|
|
693
|
+
: (0, relevance_1.selectRelevantMemoryDocuments)(candidates.carried, { ...wanted, frontmatter }, request.limits ?? relevance_1.DEFAULT_CONTEXT_LIMITS);
|
|
694
|
+
// The payload carries the frontmatter as written (`bug-232`): the element and the selected documents
|
|
695
|
+
// are re-read at the commit with the payload's schema. Selection above used the scan's parse.
|
|
696
|
+
const carried = [...(element === undefined ? [] : [element]), ...(relevant?.documents ?? [])];
|
|
697
|
+
const written = writtenFrontmatter(root, sha, carried.map((doc) => doc.path));
|
|
698
|
+
const offset = carried.length - (relevant?.documents.length ?? 0);
|
|
699
|
+
const validated = validateExecutionContext({
|
|
700
|
+
role,
|
|
701
|
+
stateRef: sha,
|
|
702
|
+
element: element === undefined ? undefined : { ...element, frontmatter: written[0] },
|
|
703
|
+
dna,
|
|
704
|
+
directives,
|
|
705
|
+
memory: relevant?.documents.map((doc, index) => ({ ...doc, frontmatter: written[offset + index] })),
|
|
706
|
+
warnings: resolution?.warnings ?? [],
|
|
707
|
+
});
|
|
708
|
+
if (!validated.ok) {
|
|
709
|
+
// Every section the builder can leave unset is unset by an absent pillar file (an absent
|
|
710
|
+
// `memory.yaml` unsets `element` before `memory`), so the refusal always names one. The message
|
|
711
|
+
// stays P5.4.4's, verbatim.
|
|
712
|
+
const cause = `no ${ABSENT_PILLAR_FILE[validated.error.message]} at ${sha}`;
|
|
713
|
+
return (0, types_1.coreErr)({ ...validated.error, details: { cause } });
|
|
714
|
+
}
|
|
715
|
+
const context = validated.value;
|
|
716
|
+
const unfit = context.directives.map((directive) => headerFieldProblem('directive id', directive.frontmatter.id)).find((problem) => problem !== undefined) ??
|
|
717
|
+
selfClosingBody(context);
|
|
718
|
+
if (unfit !== undefined)
|
|
719
|
+
return (0, types_1.coreErr)({ code: 'VALIDATION', message: unfit });
|
|
720
|
+
// In §3 stage order: the DNA note (ruling D3), then the relevance note (P5.3.3 sc. 3).
|
|
721
|
+
const notes = [dnaSelected?.note, relevant?.note].filter((note) => note !== undefined);
|
|
722
|
+
// Unreadable files are about the repository, not the context: they ride the success-warning channel
|
|
723
|
+
// (task-169), as `memory search` carries them (task-171), and never enter the payload.
|
|
724
|
+
// `candidates` is set whenever `memory.yaml` is, and without it the context was refused above.
|
|
725
|
+
const warnings = [...unreadable, ...candidates.left.map(validation_1.formatDiagnostic)];
|
|
726
|
+
return (0, types_1.coreOk)({ context, payload: serializeExecutionContext(context), notes }, undefined, warnings);
|
|
191
727
|
}
|
|
192
728
|
//# sourceMappingURL=context.js.map
|