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
package/dist/validation/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.matchesIgnoreGlob = exports.loadIgnoreGlobs = exports.isBinaryContent = exports.scanProjectSurface = exports.scanText = exports.DEFAULT_IGNORE_FILE = exports.SCAN_SURFACE_ROOTS = exports.SECRET_PATTERNS = exports.parseYaml = exports.ID_CHAR_CLASS = exports.patternToRegExp = exports.generateId = exports.runValidation = exports.emitUnknownFieldWarning = exports.toValidationError = exports.ValidationError = exports.EXIT_VALIDATION = exports.EXIT_INTEGRITY = exports.E_YAML_PARSE_ERROR = exports.E_VALIDATION = void 0;
|
|
3
|
+
exports.matchesIgnoreGlob = exports.loadIgnoreGlobs = exports.isBinaryContent = exports.scanProjectSurface = exports.scanText = exports.DEFAULT_IGNORE_FILE = exports.SCAN_SURFACE_ROOTS = exports.SECRET_PATTERNS = exports.refuseNewerFormat = exports.newerFormatMessage = exports.newerFormatIssue = exports.isNewerFormatError = exports.formatField = exports.WORKFLOWS_YAML_FORMAT = exports.WORKFLOW_FORMAT = exports.ROLES_YAML_FORMAT = exports.MEMORY_YAML_FORMAT = exports.MEMORY_TEMPLATE_FORMAT = exports.E_INVALID_FORMAT = exports.DNA_YAML_FORMAT = exports.DIRECTIVE_FORMAT = exports.ADAPTER_MANIFEST_FORMAT = exports.isBlankIdentityName = exports.isAttributableIdentity = exports.hasReservedDomain = exports.attributionEmailIssue = exports.isVersionIncrease = exports.parseYaml = exports.ID_CHAR_CLASS = exports.patternToSource = exports.patternToRegExp = exports.patternTokens = exports.isNumericToken = exports.isIdPiece = exports.idPatternIssues = exports.generateId = exports.runValidation = exports.withWarningSink = exports.reportWarning = exports.emitUnknownFieldWarning = exports.toValidationError = exports.formatDiagnostic = exports.DiagnosticsError = exports.ValidationError = exports.EXIT_VALIDATION = exports.EXIT_INTEGRITY = exports.E_YAML_PARSE_ERROR = exports.E_VALIDATION = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* `src/validation` — the shared validation & ID module (spec-009-validation-strategy,
|
|
6
6
|
* task-002-validation-id-engine). Single entry point every schema (spec-001/002/003 and the
|
|
@@ -13,18 +13,50 @@ Object.defineProperty(exports, "E_YAML_PARSE_ERROR", { enumerable: true, get: fu
|
|
|
13
13
|
Object.defineProperty(exports, "EXIT_INTEGRITY", { enumerable: true, get: function () { return errors_1.EXIT_INTEGRITY; } });
|
|
14
14
|
Object.defineProperty(exports, "EXIT_VALIDATION", { enumerable: true, get: function () { return errors_1.EXIT_VALIDATION; } });
|
|
15
15
|
Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return errors_1.ValidationError; } });
|
|
16
|
+
var diagnostic_1 = require("./diagnostic");
|
|
17
|
+
Object.defineProperty(exports, "DiagnosticsError", { enumerable: true, get: function () { return diagnostic_1.DiagnosticsError; } });
|
|
18
|
+
Object.defineProperty(exports, "formatDiagnostic", { enumerable: true, get: function () { return diagnostic_1.formatDiagnostic; } });
|
|
16
19
|
var error_mapper_1 = require("./error-mapper");
|
|
17
20
|
Object.defineProperty(exports, "toValidationError", { enumerable: true, get: function () { return error_mapper_1.toValidationError; } });
|
|
18
21
|
var warning_1 = require("./warning");
|
|
19
22
|
Object.defineProperty(exports, "emitUnknownFieldWarning", { enumerable: true, get: function () { return warning_1.emitUnknownFieldWarning; } });
|
|
23
|
+
Object.defineProperty(exports, "reportWarning", { enumerable: true, get: function () { return warning_1.reportWarning; } });
|
|
24
|
+
Object.defineProperty(exports, "withWarningSink", { enumerable: true, get: function () { return warning_1.withWarningSink; } });
|
|
20
25
|
var two_pass_1 = require("./two-pass");
|
|
21
26
|
Object.defineProperty(exports, "runValidation", { enumerable: true, get: function () { return two_pass_1.runValidation; } });
|
|
22
27
|
var id_1 = require("./id");
|
|
23
28
|
Object.defineProperty(exports, "generateId", { enumerable: true, get: function () { return id_1.generateId; } });
|
|
29
|
+
Object.defineProperty(exports, "idPatternIssues", { enumerable: true, get: function () { return id_1.idPatternIssues; } });
|
|
30
|
+
Object.defineProperty(exports, "isIdPiece", { enumerable: true, get: function () { return id_1.isIdPiece; } });
|
|
31
|
+
Object.defineProperty(exports, "isNumericToken", { enumerable: true, get: function () { return id_1.isNumericToken; } });
|
|
32
|
+
Object.defineProperty(exports, "patternTokens", { enumerable: true, get: function () { return id_1.patternTokens; } });
|
|
24
33
|
Object.defineProperty(exports, "patternToRegExp", { enumerable: true, get: function () { return id_1.patternToRegExp; } });
|
|
34
|
+
Object.defineProperty(exports, "patternToSource", { enumerable: true, get: function () { return id_1.patternToSource; } });
|
|
25
35
|
Object.defineProperty(exports, "ID_CHAR_CLASS", { enumerable: true, get: function () { return id_1.ID_CHAR_CLASS; } });
|
|
26
36
|
var yaml_1 = require("./yaml");
|
|
27
37
|
Object.defineProperty(exports, "parseYaml", { enumerable: true, get: function () { return yaml_1.parseYaml; } });
|
|
38
|
+
var config_version_1 = require("./config-version");
|
|
39
|
+
Object.defineProperty(exports, "isVersionIncrease", { enumerable: true, get: function () { return config_version_1.isVersionIncrease; } });
|
|
40
|
+
var identity_1 = require("./identity");
|
|
41
|
+
Object.defineProperty(exports, "attributionEmailIssue", { enumerable: true, get: function () { return identity_1.attributionEmailIssue; } });
|
|
42
|
+
Object.defineProperty(exports, "hasReservedDomain", { enumerable: true, get: function () { return identity_1.hasReservedDomain; } });
|
|
43
|
+
Object.defineProperty(exports, "isAttributableIdentity", { enumerable: true, get: function () { return identity_1.isAttributableIdentity; } });
|
|
44
|
+
Object.defineProperty(exports, "isBlankIdentityName", { enumerable: true, get: function () { return identity_1.isBlankIdentityName; } });
|
|
45
|
+
var format_1 = require("./format");
|
|
46
|
+
Object.defineProperty(exports, "ADAPTER_MANIFEST_FORMAT", { enumerable: true, get: function () { return format_1.ADAPTER_MANIFEST_FORMAT; } });
|
|
47
|
+
Object.defineProperty(exports, "DIRECTIVE_FORMAT", { enumerable: true, get: function () { return format_1.DIRECTIVE_FORMAT; } });
|
|
48
|
+
Object.defineProperty(exports, "DNA_YAML_FORMAT", { enumerable: true, get: function () { return format_1.DNA_YAML_FORMAT; } });
|
|
49
|
+
Object.defineProperty(exports, "E_INVALID_FORMAT", { enumerable: true, get: function () { return format_1.E_INVALID_FORMAT; } });
|
|
50
|
+
Object.defineProperty(exports, "MEMORY_TEMPLATE_FORMAT", { enumerable: true, get: function () { return format_1.MEMORY_TEMPLATE_FORMAT; } });
|
|
51
|
+
Object.defineProperty(exports, "MEMORY_YAML_FORMAT", { enumerable: true, get: function () { return format_1.MEMORY_YAML_FORMAT; } });
|
|
52
|
+
Object.defineProperty(exports, "ROLES_YAML_FORMAT", { enumerable: true, get: function () { return format_1.ROLES_YAML_FORMAT; } });
|
|
53
|
+
Object.defineProperty(exports, "WORKFLOW_FORMAT", { enumerable: true, get: function () { return format_1.WORKFLOW_FORMAT; } });
|
|
54
|
+
Object.defineProperty(exports, "WORKFLOWS_YAML_FORMAT", { enumerable: true, get: function () { return format_1.WORKFLOWS_YAML_FORMAT; } });
|
|
55
|
+
Object.defineProperty(exports, "formatField", { enumerable: true, get: function () { return format_1.formatField; } });
|
|
56
|
+
Object.defineProperty(exports, "isNewerFormatError", { enumerable: true, get: function () { return format_1.isNewerFormatError; } });
|
|
57
|
+
Object.defineProperty(exports, "newerFormatIssue", { enumerable: true, get: function () { return format_1.newerFormatIssue; } });
|
|
58
|
+
Object.defineProperty(exports, "newerFormatMessage", { enumerable: true, get: function () { return format_1.newerFormatMessage; } });
|
|
59
|
+
Object.defineProperty(exports, "refuseNewerFormat", { enumerable: true, get: function () { return format_1.refuseNewerFormat; } });
|
|
28
60
|
var secret_scan_1 = require("./secret-scan");
|
|
29
61
|
Object.defineProperty(exports, "SECRET_PATTERNS", { enumerable: true, get: function () { return secret_scan_1.SECRET_PATTERNS; } });
|
|
30
62
|
Object.defineProperty(exports, "SCAN_SURFACE_ROOTS", { enumerable: true, get: function () { return secret_scan_1.SCAN_SURFACE_ROOTS; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/validation/index.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,mCAMkB;AALhB,sGAAA,YAAY,OAAA;AACZ,4GAAA,kBAAkB,OAAA;AAClB,wGAAA,cAAc,OAAA;AACd,yGAAA,eAAe,OAAA;AACf,yGAAA,eAAe,OAAA;AAGjB,+CAAmD;AAA1C,iHAAA,iBAAiB,OAAA;AAC1B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/validation/index.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,mCAMkB;AALhB,sGAAA,YAAY,OAAA;AACZ,4GAAA,kBAAkB,OAAA;AAClB,wGAAA,cAAc,OAAA;AACd,yGAAA,eAAe,OAAA;AACf,yGAAA,eAAe,OAAA;AAGjB,2CAAkE;AAAzD,8GAAA,gBAAgB,OAAA;AAAE,8GAAA,gBAAgB,OAAA;AAE3C,+CAAmD;AAA1C,iHAAA,iBAAiB,OAAA;AAC1B,qCAAoF;AAA3E,kHAAA,uBAAuB,OAAA;AAAE,wGAAA,aAAa,OAAA;AAAE,0GAAA,eAAe,OAAA;AAEhE,uCAA2C;AAAlC,yGAAA,aAAa,OAAA;AAEtB,2BAA8I;AAArI,gGAAA,UAAU,OAAA;AAAE,qGAAA,eAAe,OAAA;AAAE,+FAAA,SAAS,OAAA;AAAE,oGAAA,cAAc,OAAA;AAAE,mGAAA,aAAa,OAAA;AAAE,qGAAA,eAAe,OAAA;AAAE,qGAAA,eAAe,OAAA;AAAE,mGAAA,aAAa,OAAA;AAC/H,+BAAmC;AAA1B,iGAAA,SAAS,OAAA;AAClB,mDAAqD;AAA5C,mHAAA,iBAAiB,OAAA;AAC1B,uCAAmH;AAA1G,iHAAA,qBAAqB,OAAA;AAAE,6GAAA,iBAAiB,OAAA;AAAE,kHAAA,sBAAsB,OAAA;AAAE,+GAAA,mBAAmB,OAAA;AAE9F,mCAekB;AAdhB,iHAAA,uBAAuB,OAAA;AACvB,0GAAA,gBAAgB,OAAA;AAChB,yGAAA,eAAe,OAAA;AACf,0GAAA,gBAAgB,OAAA;AAChB,gHAAA,sBAAsB,OAAA;AACtB,4GAAA,kBAAkB,OAAA;AAClB,2GAAA,iBAAiB,OAAA;AACjB,yGAAA,eAAe,OAAA;AACf,+GAAA,qBAAqB,OAAA;AACrB,qGAAA,WAAW,OAAA;AACX,4GAAA,kBAAkB,OAAA;AAClB,0GAAA,gBAAgB,OAAA;AAChB,4GAAA,kBAAkB,OAAA;AAClB,2GAAA,iBAAiB,OAAA;AAEnB,6CASuB;AARrB,8GAAA,eAAe,OAAA;AACf,iHAAA,kBAAkB,OAAA;AAClB,kHAAA,mBAAmB,OAAA;AACnB,uGAAA,QAAQ,OAAA;AACR,iHAAA,kBAAkB,OAAA;AAClB,8GAAA,eAAe,OAAA;AACf,8GAAA,eAAe,OAAA;AACf,gHAAA,iBAAiB,OAAA"}
|
|
@@ -74,19 +74,22 @@ export interface ScanTextOptions {
|
|
|
74
74
|
/**
|
|
75
75
|
* Scan one file's already-decoded text content (spec-007 §4): evaluate {@link SECRET_PATTERNS} in
|
|
76
76
|
* declared order against every line, apply the §3 exclusions, and classify each surviving finding by
|
|
77
|
-
* severity. This is the seam
|
|
78
|
-
*
|
|
77
|
+
* severity. This is the seam spec-007 §4 step 5's callers use per file about to be written or
|
|
78
|
+
* committed: `init`'s pre-write pass over the built-in templates calls it (`verifyBuiltinTemplates`,
|
|
79
|
+
* `src/core/builtin-integrity.ts`, task-135), and a future commit-time gate would.
|
|
79
80
|
*/
|
|
80
81
|
export declare function scanText(content: string, filePath: string, options?: ScanTextOptions): ScanResult;
|
|
81
82
|
/** Null-byte sniff on the first 8KB (spec-007 §1) — binary files are out of scan scope. */
|
|
82
83
|
export declare function isBinaryContent(buf: Buffer): boolean;
|
|
83
84
|
/**
|
|
84
|
-
* Default scan-surface roots (spec-007 §1): `.wingfoil/` once `init` exists, plus
|
|
85
|
-
* self-hosted analog
|
|
86
|
-
* the
|
|
87
|
-
*
|
|
85
|
+
* Default scan-surface roots (spec-007 §1): `.wingfoil/` once `init` exists, plus `docs/04_memory/`,
|
|
86
|
+
* this repository's own Memory folder — spec-007 §1's self-hosted analog, which followed the
|
|
87
|
+
* configuration to the repository root in `task-111-configuration-moves-to-the-repository-root`
|
|
88
|
+
* (before it, the analog named the nested dogfooding copies of both folders). A root with no indexed
|
|
89
|
+
* files contributes nothing, so {@link scanProjectSurface} is safe to call before `init` has ever run,
|
|
90
|
+
* and on a project whose Memory lives elsewhere.
|
|
88
91
|
*/
|
|
89
|
-
export declare const SCAN_SURFACE_ROOTS: readonly [".wingfoil", "docs/
|
|
92
|
+
export declare const SCAN_SURFACE_ROOTS: readonly [".wingfoil", "docs/04_memory"];
|
|
90
93
|
/** Default path (root-relative) of the `security-ignore` glob list (spec-007 §3). */
|
|
91
94
|
export declare const DEFAULT_IGNORE_FILE = ".wingfoil/security-ignore";
|
|
92
95
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secret-scan.d.ts","sourceRoot":"","sources":["../../src/validation/secret-scan.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"secret-scan.d.ts","sourceRoot":"","sources":["../../src/validation/secret-scan.ts"],"names":[],"mappings":"AAqBA,2FAA2F;AAC3F,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,MAAM,CAAC;AAE9C,6FAA6F;AAC7F,MAAM,WAAW,aAAa;IAC5B,uFAAuF;IACvF,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,8DAA8D;IAC9D,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,sFAAsF;IACtF,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAClC,oGAAoG;IACpG,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAWD;;;;GAI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FAA2F;AAC3F,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAGpD;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,0CAA2C,CAAC;AAE3E,qFAAqF;AACrF,eAAO,MAAM,mBAAmB,8BAA8B,CAAC;AAoE/D;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,EAAE,CAMhE;AA8BD,0GAA0G;AAC1G,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAErF;AAED,8CAA8C;AAC9C,MAAM,WAAW,kBAAkB;IACjC,4EAA4E;IAC5E,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1C,mGAAmG;IACnG,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;CAClC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,kBAAuB,GAAG,UAAU,CAY7F"}
|
|
@@ -13,10 +13,12 @@ exports.scanProjectSurface = scanProjectSurface;
|
|
|
13
13
|
* `wingfoil audit`) re-implements its own regex list and lets the patterns drift.
|
|
14
14
|
*
|
|
15
15
|
* `SECRET_PATTERNS` reproduces spec-007 §2's ten named rules; each JS `RegExp` below carries a
|
|
16
|
-
* comment quoting the exact spec-007 YAML `regex:` string it implements.
|
|
16
|
+
* comment quoting the exact spec-007 YAML `regex:` string it implements. Four of spec-007's patterns
|
|
17
17
|
* use the PCRE inline mode-modifier syntax `(?i)`/`(?im)` in their YAML text — JS `RegExp` has no
|
|
18
|
-
* such inline syntax (`new RegExp('(?i)...')` throws `SyntaxError`) — so that flag is
|
|
19
|
-
* equivalent JS `i` flag instead
|
|
18
|
+
* such inline syntax on Node 22 (`new RegExp('(?i)...')` throws `SyntaxError`) — so that flag is
|
|
19
|
+
* moved to the equivalent JS `i` flag instead, except on `generic-api-key-assignment`, whose YAML
|
|
20
|
+
* also holds a case-sensitive `(?-i:…)` group: there the key words are case-folded letter by letter
|
|
21
|
+
* (`caseless`) and no flag is set. This is a mechanical syntax translation, not a semantic rewrite:
|
|
20
22
|
* the matched shape is unchanged, so it satisfies spec-007's Consequences-section instruction to
|
|
21
23
|
* "reproduce the pattern table in §2 verbatim (or import it as data)" rather than hand-roll
|
|
22
24
|
* alternative regexes.
|
|
@@ -24,6 +26,14 @@ exports.scanProjectSurface = scanProjectSurface;
|
|
|
24
26
|
const child_process_1 = require("child_process");
|
|
25
27
|
const fs_1 = require("fs");
|
|
26
28
|
const path_1 = require("path");
|
|
29
|
+
/**
|
|
30
|
+
* Case-fold the letters of a regex source fragment (`token` → `[Tt][Oo][Kk][Ee][Nn]`), leaving every
|
|
31
|
+
* other character as written. It stands in for spec-007's PCRE `(?i)` on a pattern that also needs a
|
|
32
|
+
* case-sensitive part, which a JS `i` flag cannot express (bug-228).
|
|
33
|
+
*/
|
|
34
|
+
function caseless(source) {
|
|
35
|
+
return source.replace(/[a-z]/gi, (ch) => `[${ch.toUpperCase()}${ch.toLowerCase()}]`);
|
|
36
|
+
}
|
|
27
37
|
/**
|
|
28
38
|
* The canonical secret-hygiene pattern set (spec-007 §2), in the fixed declaration order every scan
|
|
29
39
|
* must evaluate patterns in (determinism, REQ-SYS-07, spec-007 §4 step 3). Adding, removing, or
|
|
@@ -41,9 +51,15 @@ exports.SECRET_PATTERNS = [
|
|
|
41
51
|
id: 'generic-api-key-assignment',
|
|
42
52
|
description: 'Variable assignment that looks like an API key/secret/token',
|
|
43
53
|
severity: 'block',
|
|
44
|
-
// spec-007 §2 (case-insensitive per its `(?i)` marker)
|
|
45
|
-
//
|
|
46
|
-
|
|
54
|
+
// spec-007 §2 (case-insensitive key words per its `(?i)` marker; the `(?-i:…)` group is
|
|
55
|
+
// case-SENSITIVE, bug-228):
|
|
56
|
+
// '(?i)(api[_-]?key|secret|token|passwd|password)\s*[:=]\s*["\']?(?-i:(?![a-z]+(?:-[a-z]+)+(?![A-Za-z0-9_\-\/+=])))[A-Za-z0-9_\-\/+=]{16,}["\']?'
|
|
57
|
+
// The lookahead refuses a value made only of lower-case words joined by hyphens — prose such as
|
|
58
|
+
// a hyphenated name after a colon, not a key. JS has no `(?-i:…)` group on Node 22, so instead of
|
|
59
|
+
// the `i` flag the key words are case-folded one letter at a time (`caseless`): the matched
|
|
60
|
+
// shape is the spec's, and only the lookahead stays case-sensitive.
|
|
61
|
+
regex: new RegExp(`(${['api[_-]?key', 'secret', 'token', 'passwd', 'password'].map(caseless).join('|')})` +
|
|
62
|
+
`\\s*[:=]\\s*["']?(?![a-z]+(?:-[a-z]+)+(?![A-Za-z0-9_\\-/+=]))[A-Za-z0-9_\\-/+=]{16,}["']?`),
|
|
47
63
|
},
|
|
48
64
|
{
|
|
49
65
|
id: 'aws-access-key-id',
|
|
@@ -103,9 +119,13 @@ exports.SECRET_PATTERNS = [
|
|
|
103
119
|
// promoted warn → block by dl-036-secret-scan-warn-severity-vs-req-sec-08 (spec-007 §2 amended)
|
|
104
120
|
severity: 'block',
|
|
105
121
|
// spec-007 §2 (case-insensitive per its `(?im)` marker; the `m` is a no-op here because the
|
|
106
|
-
// scan procedure already evaluates one line at a time, so `^`/`$` anchor to that line either way)
|
|
107
|
-
//
|
|
108
|
-
|
|
122
|
+
// scan procedure already evaluates one line at a time, so `^`/`$` anchor to that line either way).
|
|
123
|
+
// The optional prefix — indentation, an `export` keyword, a `-`/`*` list marker — is
|
|
124
|
+
// bug-037's amendment (task-135): a column-0 anchor let those lines through. bug-190's (task-182)
|
|
125
|
+
// adds a `#` comment, a list marker before the keyword, `readonly` and `declare` (with flags such
|
|
126
|
+
// as `-x`), and PowerShell's `$env:` scope.
|
|
127
|
+
// '^\s*(?:#+\s*)?(?:[-*]\s+)?(?:(?:export|readonly|declare)(?:\s+-[A-Za-z]+)*\s+)?(?:\$env:)?[A-Z0-9_]*(SECRET|TOKEN|PASSWORD|API_KEY|PRIVATE_KEY)[A-Z0-9_]*\s*=\s*\S+'
|
|
128
|
+
regex: /^\s*(?:#+\s*)?(?:[-*]\s+)?(?:(?:export|readonly|declare)(?:\s+-[A-Za-z]+)*\s+)?(?:\$env:)?[A-Z0-9_]*(SECRET|TOKEN|PASSWORD|API_KEY|PRIVATE_KEY)[A-Z0-9_]*\s*=\s*\S+/i,
|
|
109
129
|
},
|
|
110
130
|
];
|
|
111
131
|
const FENCE_DELIMITER_RE = /^`{3,}/;
|
|
@@ -158,8 +178,9 @@ function matchLine(line, pattern, lineNumber, filePath) {
|
|
|
158
178
|
/**
|
|
159
179
|
* Scan one file's already-decoded text content (spec-007 §4): evaluate {@link SECRET_PATTERNS} in
|
|
160
180
|
* declared order against every line, apply the §3 exclusions, and classify each surviving finding by
|
|
161
|
-
* severity. This is the seam
|
|
162
|
-
*
|
|
181
|
+
* severity. This is the seam spec-007 §4 step 5's callers use per file about to be written or
|
|
182
|
+
* committed: `init`'s pre-write pass over the built-in templates calls it (`verifyBuiltinTemplates`,
|
|
183
|
+
* `src/core/builtin-integrity.ts`, task-135), and a future commit-time gate would.
|
|
163
184
|
*/
|
|
164
185
|
function scanText(content, filePath, options = {}) {
|
|
165
186
|
const lines = content.split(/\r\n|\r|\n/);
|
|
@@ -219,12 +240,14 @@ function isBinaryContent(buf) {
|
|
|
219
240
|
return head.includes(0);
|
|
220
241
|
}
|
|
221
242
|
/**
|
|
222
|
-
* Default scan-surface roots (spec-007 §1): `.wingfoil/` once `init` exists, plus
|
|
223
|
-
* self-hosted analog
|
|
224
|
-
* the
|
|
225
|
-
*
|
|
243
|
+
* Default scan-surface roots (spec-007 §1): `.wingfoil/` once `init` exists, plus `docs/04_memory/`,
|
|
244
|
+
* this repository's own Memory folder — spec-007 §1's self-hosted analog, which followed the
|
|
245
|
+
* configuration to the repository root in `task-111-configuration-moves-to-the-repository-root`
|
|
246
|
+
* (before it, the analog named the nested dogfooding copies of both folders). A root with no indexed
|
|
247
|
+
* files contributes nothing, so {@link scanProjectSurface} is safe to call before `init` has ever run,
|
|
248
|
+
* and on a project whose Memory lives elsewhere.
|
|
226
249
|
*/
|
|
227
|
-
exports.SCAN_SURFACE_ROOTS = ['.wingfoil', 'docs/
|
|
250
|
+
exports.SCAN_SURFACE_ROOTS = ['.wingfoil', 'docs/04_memory'];
|
|
228
251
|
/** Default path (root-relative) of the `security-ignore` glob list (spec-007 §3). */
|
|
229
252
|
exports.DEFAULT_IGNORE_FILE = '.wingfoil/security-ignore';
|
|
230
253
|
/** `git ls-files -s` mode of a gitlink (submodule commit) — not a blob, nothing to read. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secret-scan.js","sourceRoot":"","sources":["../../src/validation/secret-scan.ts"],"names":[],"mappings":";;;AA8OA,4BA2CC;AAaD,0CAGC;AAoFD,0CAMC;AA+BD,8CAEC;AA+BD,gDAYC;AA/cD;;;;;;;;;;;;;;GAcG;AACH,iDAA6C;AAC7C,2BAA8C;AAC9C,+BAA4B;AAiB5B;;;;GAIG;AACU,QAAA,eAAe,GAA6B;IACvD;QACE,EAAE,EAAE,iBAAiB;QACrB,WAAW,EAAE,gCAAgC;QAC7C,QAAQ,EAAE,OAAO;QACjB,2EAA2E;QAC3E,KAAK,EAAE,2DAA2D;KACnE;IACD;QACE,EAAE,EAAE,4BAA4B;QAChC,WAAW,EAAE,6DAA6D;QAC1E,QAAQ,EAAE,OAAO;QACjB,wDAAwD;QACxD,4FAA4F;QAC5F,KAAK,EAAE,uFAAuF;KAC/F;IACD;QACE,EAAE,EAAE,mBAAmB;QACvB,WAAW,EAAE,yBAAyB;QACtC,QAAQ,EAAE,OAAO;QACjB,gFAAgF;QAChF,KAAK,EAAE,gEAAgE;KACxE;IACD;QACE,EAAE,EAAE,uBAAuB;QAC3B,WAAW,EAAE,+EAA+E;QAC5F,QAAQ,EAAE,OAAO;QACjB,wDAAwD;QACxD,uEAAuE;QACvE,KAAK,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AAE,IAAI,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC;IAC3E,CAAC;IACD,OAAO,gBAAgB,CAAC,OAAO,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -1,18 +1,32 @@
|
|
|
1
|
+
/** Where a raised warning goes: one operator-facing sentence, no prefix. */
|
|
2
|
+
export type WarningSink = (text: string) => void;
|
|
1
3
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* Unknown-ness is decided against the schema's own declared key set (`schema.shape`), NOT against
|
|
5
|
-
* the passthrough-parsed output. Under `.passthrough()` the parsed object retains every unknown
|
|
6
|
-
* key, so a `raw` vs `parsed` diff is always empty — the "known-defective mechanism" spec-009 §2
|
|
7
|
-
* explicitly warns against. Diffing raw keys against `schema.shape` is the correct mechanism.
|
|
8
|
-
*
|
|
9
|
-
* The same diff is applied recursively at every nesting level that is itself a `.passthrough()`
|
|
10
|
-
* object schema (spec-009 §2: "the same diff is applied recursively at each nesting level that
|
|
11
|
-
* itself has a `.passthrough()` schema, so unknown fields inside nested config blocks are reported
|
|
12
|
-
* too, not only at the document root"). This matters because the files this module guards —
|
|
13
|
-
* `memory.yaml`, `dna.yaml`, `workflows.yaml` — all carry deeply nested config blocks (per-type
|
|
14
|
-
* state machines, phase objects, etc.), where an unknown field would otherwise go undetected.
|
|
4
|
+
* Run `run` with `sink` receiving every warning {@link reportWarning} raises inside it, its awaited
|
|
5
|
+
* continuations included. Returns what `run` returns.
|
|
15
6
|
*/
|
|
7
|
+
export declare function withWarningSink<T>(sink: WarningSink, run: () => T): T;
|
|
8
|
+
/**
|
|
9
|
+
* Raise one warning: to the sink {@link withWarningSink} installed around the running operation, or,
|
|
10
|
+
* with none installed, to stderr as `Warning: <text>`.
|
|
11
|
+
*/
|
|
12
|
+
export declare function reportWarning(text: string): void;
|
|
13
|
+
/**
|
|
14
|
+
* Run `run` with each distinct warning raised inside it passed on once (task-228, the B3 handover: a
|
|
15
|
+
* pipeline that loads one file twice raises its warning twice), after `rewrite` (identity by default).
|
|
16
|
+
* The warnings go to the sink installed around the call, or to stderr outside any.
|
|
17
|
+
*/
|
|
18
|
+
export declare function withDistinctWarnings<T>(run: () => T, rewrite?: (text: string) => string): T;
|
|
19
|
+
/**
|
|
20
|
+
* A **notice**: an informational line an operation prints while it runs, neither a warning nor an error
|
|
21
|
+
* — `agent execute`'s launch banner (`spec-016` §3.3 step 13, task-228). It travels like a warning, to
|
|
22
|
+
* the sink the surface installs ({@link withNoticeSink}); the CLI renders it in the active `--format`
|
|
23
|
+
* on stderr. Outside any sink it is written to stderr as is.
|
|
24
|
+
*/
|
|
25
|
+
export type NoticeSink = (text: string) => void;
|
|
26
|
+
/** Run `run` with `sink` receiving every notice {@link reportNotice} raises inside it. */
|
|
27
|
+
export declare function withNoticeSink<T>(sink: NoticeSink, run: () => T): T;
|
|
28
|
+
/** Raise one notice: to the installed sink, or, with none, to stderr as a bare line. */
|
|
29
|
+
export declare function reportNotice(text: string): void;
|
|
16
30
|
/**
|
|
17
31
|
* Minimal structural view of a Zod object schema: only its declared top-level `shape` is needed.
|
|
18
32
|
* Typed structurally rather than as `AnyZodObject` (spec-009 §2's listing) because Zod 4 — the
|
|
@@ -23,9 +37,9 @@ export interface HasShape {
|
|
|
23
37
|
readonly shape: Record<string, unknown>;
|
|
24
38
|
}
|
|
25
39
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* are no unknown fields.
|
|
40
|
+
* Raise one warning (spec-009 §2) listing every raw key not declared in `schema`'s shape, recursively
|
|
41
|
+
* through nested passthrough object/array-of-object schemas, through {@link reportWarning} (`bug-202`):
|
|
42
|
+
* `<file>: unknown field(s) ignored: <paths>`. Raises nothing when there are no unknown fields.
|
|
29
43
|
*/
|
|
30
44
|
export declare function emitUnknownFieldWarning(raw: Record<string, unknown>, schema: HasShape, filePath: string): void;
|
|
31
45
|
//# sourceMappingURL=warning.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"warning.d.ts","sourceRoot":"","sources":["../../src/validation/warning.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"warning.d.ts","sourceRoot":"","sources":["../../src/validation/warning.ts"],"names":[],"mappings":"AA2BA,4EAA4E;AAC5E,MAAM,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;AAIjD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,CAErE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAIhD;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,OAAO,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAuB,GAAG,CAAC,CAU3G;AAED;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;AAIhD,0FAA0F;AAC1F,wBAAgB,cAAc,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,CAEnE;AAED,wFAAwF;AACxF,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAI/C;AAED;;;;;GAKG;AACH,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACzC;AAwED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5B,MAAM,EAAE,QAAQ,EAChB,QAAQ,EAAE,MAAM,GACf,IAAI,CAKN"}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.withWarningSink = withWarningSink;
|
|
4
|
+
exports.reportWarning = reportWarning;
|
|
5
|
+
exports.withDistinctWarnings = withDistinctWarnings;
|
|
6
|
+
exports.withNoticeSink = withNoticeSink;
|
|
7
|
+
exports.reportNotice = reportNotice;
|
|
8
|
+
exports.emitUnknownFieldWarning = emitUnknownFieldWarning;
|
|
2
9
|
/**
|
|
3
|
-
* Unknown-field warning policy for `.passthrough()` schemas (spec-009-validation-strategy §2)
|
|
10
|
+
* Unknown-field warning policy for `.passthrough()` schemas (spec-009-validation-strategy §2), and the
|
|
11
|
+
* **warning sink** every warning raised while an operation runs goes through (task-218, `bug-202`).
|
|
4
12
|
*
|
|
5
13
|
* Unknown-ness is decided against the schema's own declared key set (`schema.shape`), NOT against
|
|
6
14
|
* the passthrough-parsed output. Under `.passthrough()` the parsed object retains every unknown
|
|
@@ -13,9 +21,68 @@
|
|
|
13
21
|
* too, not only at the document root"). This matters because the files this module guards —
|
|
14
22
|
* `memory.yaml`, `dna.yaml`, `workflows.yaml` — all carry deeply nested config blocks (per-type
|
|
15
23
|
* state machines, phase objects, etc.), where an unknown field would otherwise go undetected.
|
|
24
|
+
*
|
|
25
|
+
* **The sink.** A loader deep inside `src/` does not know the surface it serves or its `--format`, so it
|
|
26
|
+
* never writes a warning itself: it hands it to {@link reportWarning}. The surface that runs the
|
|
27
|
+
* operation installs a sink around the call ({@link withWarningSink}) — the CLI registrar renders each
|
|
28
|
+
* warning through `src/cli/warning.ts`, the one renderer, in the active `--format`, at the moment it is
|
|
29
|
+
* raised, so it precedes whatever the command prints after it (an error, or `agent execute`'s pre-flight
|
|
30
|
+
* refusal, `spec-016` §3.3 step 8). The mode travels in an `AsyncLocalStorage`, as the dry run's does,
|
|
31
|
+
* so no loader signature changes. Outside any sink (the MCP server, a library caller) the warning is
|
|
32
|
+
* written to stderr as `Warning: <text>`, the line these loaders always wrote.
|
|
16
33
|
*/
|
|
17
|
-
|
|
18
|
-
|
|
34
|
+
const node_async_hooks_1 = require("node:async_hooks");
|
|
35
|
+
const sinkStore = new node_async_hooks_1.AsyncLocalStorage();
|
|
36
|
+
/**
|
|
37
|
+
* Run `run` with `sink` receiving every warning {@link reportWarning} raises inside it, its awaited
|
|
38
|
+
* continuations included. Returns what `run` returns.
|
|
39
|
+
*/
|
|
40
|
+
function withWarningSink(sink, run) {
|
|
41
|
+
return sinkStore.run(sink, run);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Raise one warning: to the sink {@link withWarningSink} installed around the running operation, or,
|
|
45
|
+
* with none installed, to stderr as `Warning: <text>`.
|
|
46
|
+
*/
|
|
47
|
+
function reportWarning(text) {
|
|
48
|
+
const sink = sinkStore.getStore();
|
|
49
|
+
if (sink !== undefined)
|
|
50
|
+
sink(text);
|
|
51
|
+
else
|
|
52
|
+
process.stderr.write(`Warning: ${text}\n`);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Run `run` with each distinct warning raised inside it passed on once (task-228, the B3 handover: a
|
|
56
|
+
* pipeline that loads one file twice raises its warning twice), after `rewrite` (identity by default).
|
|
57
|
+
* The warnings go to the sink installed around the call, or to stderr outside any.
|
|
58
|
+
*/
|
|
59
|
+
function withDistinctWarnings(run, rewrite = (text) => text) {
|
|
60
|
+
const outer = sinkStore.getStore();
|
|
61
|
+
const seen = new Set();
|
|
62
|
+
return sinkStore.run((text) => {
|
|
63
|
+
const shown = rewrite(text);
|
|
64
|
+
if (seen.has(shown))
|
|
65
|
+
return;
|
|
66
|
+
seen.add(shown);
|
|
67
|
+
if (outer !== undefined)
|
|
68
|
+
outer(shown);
|
|
69
|
+
else
|
|
70
|
+
process.stderr.write(`Warning: ${shown}\n`);
|
|
71
|
+
}, run);
|
|
72
|
+
}
|
|
73
|
+
const noticeStore = new node_async_hooks_1.AsyncLocalStorage();
|
|
74
|
+
/** Run `run` with `sink` receiving every notice {@link reportNotice} raises inside it. */
|
|
75
|
+
function withNoticeSink(sink, run) {
|
|
76
|
+
return noticeStore.run(sink, run);
|
|
77
|
+
}
|
|
78
|
+
/** Raise one notice: to the installed sink, or, with none, to stderr as a bare line. */
|
|
79
|
+
function reportNotice(text) {
|
|
80
|
+
const sink = noticeStore.getStore();
|
|
81
|
+
if (sink !== undefined)
|
|
82
|
+
sink(text);
|
|
83
|
+
else
|
|
84
|
+
process.stderr.write(`${text}\n`);
|
|
85
|
+
}
|
|
19
86
|
/** True when `v` is a Zod object schema (structurally: exposes a `.shape` record). */
|
|
20
87
|
function isHasShape(v) {
|
|
21
88
|
return (typeof v === 'object' &&
|
|
@@ -68,14 +135,14 @@ function collectUnknownFields(raw, schema, prefix) {
|
|
|
68
135
|
return out;
|
|
69
136
|
}
|
|
70
137
|
/**
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
* are no unknown fields.
|
|
138
|
+
* Raise one warning (spec-009 §2) listing every raw key not declared in `schema`'s shape, recursively
|
|
139
|
+
* through nested passthrough object/array-of-object schemas, through {@link reportWarning} (`bug-202`):
|
|
140
|
+
* `<file>: unknown field(s) ignored: <paths>`. Raises nothing when there are no unknown fields.
|
|
74
141
|
*/
|
|
75
142
|
function emitUnknownFieldWarning(raw, schema, filePath) {
|
|
76
143
|
const unknown = collectUnknownFields(raw, schema, '');
|
|
77
144
|
if (unknown.length > 0) {
|
|
78
|
-
|
|
145
|
+
reportWarning(`${filePath}: unknown field(s) ignored: ${unknown.join(', ')}`);
|
|
79
146
|
}
|
|
80
147
|
}
|
|
81
148
|
//# sourceMappingURL=warning.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"warning.js","sourceRoot":"","sources":["../../src/validation/warning.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"warning.js","sourceRoot":"","sources":["../../src/validation/warning.ts"],"names":[],"mappings":";;AAoCA,0CAEC;AAMD,sCAIC;AAOD,oDAUC;AAaD,wCAEC;AAGD,oCAIC;AAuFD,0DASC;AAvLD;;;;;;;;;;;;;;;;;;;;;;;;GA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AM,GAAG,CAAC,EAAE,CAAC;QACvB,aAAa,CAAC,GAAG,QAAQ,+BAA+B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAChF,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layer 3 — the token-binding file `.wingfoil/workflows/bindings.yaml` (spec-003-workflows-yaml-schema
|
|
3
|
+
* § "Layer 3", `dl-090` Q1 (a), Q2 (c), Q3 (a), Q4, Q5 (c), Q6), and the **built-in** binding table
|
|
4
|
+
* (spec-003 § "Action expressions"). Every `actions:` and `checks:` token of a workflow resolves through
|
|
5
|
+
* one of the two: a token WingFoil implements itself is built in and may not be rebound; every other
|
|
6
|
+
* token is bound by the project here, or is unbound (`W_WORKFLOW_UNBOUND_TOKEN`, a warning in v0.3).
|
|
7
|
+
*
|
|
8
|
+
* Like `./schema.ts`, this module holds the **structural** (Zod) shape plus the pure readings the
|
|
9
|
+
* loader's checks and later commands share ({@link tokenName}, {@link isBuiltinToken},
|
|
10
|
+
* {@link resolveToken}, {@link isWholeInterpolation}, {@link runsAgentExecute}). The loader rows
|
|
11
|
+
* themselves are run by `src/core/loaders.ts` with `src/core/workflow-diagnostics.ts`
|
|
12
|
+
* (spec-009-validation-strategy §1). Every object node is `.passthrough()` per spec-009 §2, except
|
|
13
|
+
* where spec-003's shape is strict.
|
|
14
|
+
*
|
|
15
|
+
* Nothing here runs a binding: in v0.3 the loader validates and `workflow show` / `workflow next`
|
|
16
|
+
* display (spec-003 § "What v0.3 does with these fields"); the v1.0 engine executes (P4.10, P4.12).
|
|
17
|
+
*/
|
|
18
|
+
import { z } from 'zod';
|
|
19
|
+
/** The bindings file, relative to `.wingfoil/` — the `file` of its diagnostics (spec-003 Layer 3). */
|
|
20
|
+
export declare const BINDINGS_FILE: "workflows/bindings.yaml";
|
|
21
|
+
/** A check token's binding: a command and a severity (`dl-090` Q4; default `reject`). */
|
|
22
|
+
export declare const CheckBinding: z.ZodObject<{
|
|
23
|
+
run: z.ZodArray<z.ZodString>;
|
|
24
|
+
severity: z.ZodDefault<z.ZodEnum<{
|
|
25
|
+
warn: "warn";
|
|
26
|
+
reject: "reject";
|
|
27
|
+
}>>;
|
|
28
|
+
args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
29
|
+
}, z.core.$loose>;
|
|
30
|
+
export type CheckBinding = z.infer<typeof CheckBinding>;
|
|
31
|
+
/** An action token's binding: exactly one of `run` (a command) or `manual: true` (`dl-090` Q2 (c)). */
|
|
32
|
+
export declare const ActionBinding: z.ZodObject<{
|
|
33
|
+
run: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
34
|
+
manual: z.ZodOptional<z.ZodLiteral<true>>;
|
|
35
|
+
args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
36
|
+
}, z.core.$loose>;
|
|
37
|
+
export type ActionBinding = z.infer<typeof ActionBinding>;
|
|
38
|
+
/** One collection entry: a scalar, or a map keyed by its `id` (else its `name`) field. */
|
|
39
|
+
declare const CollectionEntry: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
|
|
40
|
+
/** One entry of a collection (spec-003 § "Collections"): a scalar, or a map keyed by its `id` / `name` field. */
|
|
41
|
+
export type CollectionEntry = z.infer<typeof CollectionEntry>;
|
|
42
|
+
/**
|
|
43
|
+
* The key of one collection entry (spec-003 § "Collections"): the entry itself for a scalar, the
|
|
44
|
+
* entry's `id` field, else its `name` field, for a map. `null` when a map entry has neither as a
|
|
45
|
+
* scalar.
|
|
46
|
+
*/
|
|
47
|
+
export declare function collectionEntryKey(entry: CollectionEntry): string | null;
|
|
48
|
+
/** One collection-key problem: the entry's index and the message (`E_BINDING_COLLECTION_KEY`). */
|
|
49
|
+
export interface CollectionKeyIssue {
|
|
50
|
+
readonly index: number;
|
|
51
|
+
readonly message: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* The key problems of one collection (spec-003 § "Collections"), in entry order: a map entry with no
|
|
55
|
+
* `id` / `name`, a key outside spec-009's ID characters, a key already used by an earlier entry.
|
|
56
|
+
*/
|
|
57
|
+
export declare function collectionKeyIssues(entries: readonly CollectionEntry[]): CollectionKeyIssue[];
|
|
58
|
+
/**
|
|
59
|
+
* Layer 3 — `.wingfoil/workflows/bindings.yaml`. Optional: an absent file is no bindings. A `dl-149` file
|
|
60
|
+
* kind (`dl-153` (A)): `format` is optional (absent = 1), and a newer one is refused by the loader before
|
|
61
|
+
* this structural pass.
|
|
62
|
+
*/
|
|
63
|
+
export declare const BindingsYaml: z.ZodObject<{
|
|
64
|
+
version: z.ZodOptional<z.ZodNumber>;
|
|
65
|
+
format: z.ZodOptional<z.ZodNumber>;
|
|
66
|
+
checks: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
67
|
+
run: z.ZodArray<z.ZodString>;
|
|
68
|
+
severity: z.ZodDefault<z.ZodEnum<{
|
|
69
|
+
warn: "warn";
|
|
70
|
+
reject: "reject";
|
|
71
|
+
}>>;
|
|
72
|
+
args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
73
|
+
}, z.core.$loose>>>;
|
|
74
|
+
actions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
75
|
+
run: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
76
|
+
manual: z.ZodOptional<z.ZodLiteral<true>>;
|
|
77
|
+
args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
78
|
+
}, z.core.$loose>>>;
|
|
79
|
+
collections: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>>>;
|
|
80
|
+
}, z.core.$loose>;
|
|
81
|
+
export type BindingsYaml = z.infer<typeof BindingsYaml>;
|
|
82
|
+
/**
|
|
83
|
+
* The name of an action or check token: the text before its first `(` or `:`, trimmed
|
|
84
|
+
* (`memory.add(type: adr)` → `memory.add`; `tests.coverage(min: 80)` → `tests.coverage`;
|
|
85
|
+
* `frontmatter.required: [title]` → `frontmatter.required`). A prose check keeps its prose, which no
|
|
86
|
+
* binding key names, so it stays unbound.
|
|
87
|
+
*/
|
|
88
|
+
export declare function tokenName(token: string): string;
|
|
89
|
+
/** The `type:` argument of a `memory.add(...)` token, or `null` (`memory.add(type: tech-spec)` → `tech-spec`). */
|
|
90
|
+
export declare function memoryAddType(token: string): string | null;
|
|
91
|
+
/** The Memory verbs a workflow action may emit (spec-003 § "Action expressions", `dl-079` (A)). */
|
|
92
|
+
export type ActionMemoryVerb = 'add' | 'submit' | 'approve' | 'reject' | 'deprecate' | 'start' | 'finalize' | 'sync' | 'assign';
|
|
93
|
+
/** How a token resolves: the binding kind spec-003's built-in table and Layer 3 name. */
|
|
94
|
+
export type BindingKind = 'wingfoil' | 'manual' | 'agent' | 'run' | 'unbound';
|
|
95
|
+
/** A token's resolved binding — what `workflow show` / `workflow next` report (task-216). */
|
|
96
|
+
export interface TokenBinding {
|
|
97
|
+
readonly kind: BindingKind;
|
|
98
|
+
/** `built-in` for spec-003's table, `project` for `bindings.yaml`, `none` when unbound. */
|
|
99
|
+
readonly source: 'built-in' | 'project' | 'none';
|
|
100
|
+
/**
|
|
101
|
+
* The command, as an argument vector, when the binding names one: the built-in command prefix
|
|
102
|
+
* (`wingfoil memory add --type <T>`, `wingfoil init`, `wingfoil agent execute`), or the project's
|
|
103
|
+
* `run`. The step's own operands (element id, `--workflow`, `--step`) are the caller's.
|
|
104
|
+
*/
|
|
105
|
+
readonly argv?: readonly string[];
|
|
106
|
+
/**
|
|
107
|
+
* The Memory commit the step is expected to produce: the element type when the token names it
|
|
108
|
+
* (`null` for the workflow's own element), and the candidate verbs. A `set_state` lists three;
|
|
109
|
+
* which one applies follows spec-003's rule under the verb table (approval, last state, else start).
|
|
110
|
+
*/
|
|
111
|
+
readonly expectedCommit?: {
|
|
112
|
+
readonly type: string | null;
|
|
113
|
+
readonly verbs: readonly ActionMemoryVerb[];
|
|
114
|
+
};
|
|
115
|
+
/** A check binding's severity (`dl-090` Q4). */
|
|
116
|
+
readonly severity?: 'warn' | 'reject';
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* The Memory type a typed state action names — the `T` of `<T>.set_state(…)` / `<T>.sync_state(…)` —
|
|
120
|
+
* or `null` for `element.set_state` / `element.sync_state` (the workflow's own element, not a type) and
|
|
121
|
+
* for any other token. The core check `E_WORKFLOW_ELEMENT_TYPE_UNKNOWN` (spec-003, `bug-282`) checks it
|
|
122
|
+
* against `memory.yaml`.
|
|
123
|
+
*/
|
|
124
|
+
export declare function typedStateType(token: string): string | null;
|
|
125
|
+
/**
|
|
126
|
+
* Whether `name` (a {@link tokenName}) is a **built-in** token (spec-003's built-in table):
|
|
127
|
+
* `memory.add|submit|approve|reject|deprecate`, `element.set_state`, `<type>.set_state`,
|
|
128
|
+
* `<type>.sync_state`, `element.set_release`, `config.init` and every `agent.*`. A project may not
|
|
129
|
+
* rebind one (`E_BINDING_BUILTIN_TOKEN`).
|
|
130
|
+
*/
|
|
131
|
+
export declare function isBuiltinToken(name: string): boolean;
|
|
132
|
+
/**
|
|
133
|
+
* Resolve one token to its binding (spec-003 § "Action expressions" built-in table, Layer 3): an
|
|
134
|
+
* action resolves through the built-in table first, then `bindings.actions`; a check only through
|
|
135
|
+
* `bindings.checks` (no check is built in, and none may be bound to an agent). An unresolved token is
|
|
136
|
+
* `{ kind: 'unbound', source: 'none' }`. Pure and total: the same inputs give the same answer.
|
|
137
|
+
*
|
|
138
|
+
* @param token - The token as written in `actions:` / `checks:` / `awaits.evidence`, arguments included.
|
|
139
|
+
* @param role - Whether the token is an action or a check.
|
|
140
|
+
* @param bindings - The validated `bindings.yaml`, or `null` when the project has none.
|
|
141
|
+
*/
|
|
142
|
+
export declare function resolveToken(token: string, role: 'action' | 'check', bindings: BindingsYaml | null): TokenBinding;
|
|
143
|
+
/** Whether one `run` element interpolates only as a whole element (`dl-090` Q3 (a)). */
|
|
144
|
+
export declare function isWholeInterpolation(element: string): boolean;
|
|
145
|
+
/**
|
|
146
|
+
* Whether an argument vector runs `wingfoil agent execute` (`E_BINDING_AGENT_CHECK`, `dl-090` Q6): an
|
|
147
|
+
* `agent`, `execute` pair after a `wingfoil` program — called directly, through `npx`, or as the
|
|
148
|
+
* built `cli.js`.
|
|
149
|
+
*/
|
|
150
|
+
export declare function runsAgentExecute(run: readonly string[]): boolean;
|
|
151
|
+
export {};
|
|
152
|
+
//# sourceMappingURL=bindings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bindings.d.ts","sourceRoot":"","sources":["../../src/workflow/bindings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,sGAAsG;AACtG,eAAO,MAAM,aAAa,EAAG,yBAAkC,CAAC;AAoBhE,yFAAyF;AACzF,eAAO,MAAM,YAAY;;;;;;;iBAMT,CAAC;AACjB,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAExD,uGAAuG;AACvG,eAAO,MAAM,aAAa;;;;iBAWtB,CAAC;AACL,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAE1D,0FAA0F;AAC1F,QAAA,MAAM,eAAe,uGAAoF,CAAC;AAC1G,iHAAiH;AACjH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE9D;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,GAAG,IAAI,CAIxE;AAUD,kGAAkG;AAClG,MAAM,WAAW,kBAA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