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/cli/program.js
CHANGED
|
@@ -31,20 +31,25 @@ exports.buildProgram = buildProgram;
|
|
|
31
31
|
* `tsconfig.test.json` and transforms `commander`'s ESM on the way in, see `jest.config.js` — and
|
|
32
32
|
* black-box by `test/cli/program.integration.test.ts`, which spawns the compiled `dist/` and so
|
|
33
33
|
* exercises the real ESM `import()` this file actually ships with.
|
|
34
|
-
* `buildCliCommands`/`listRegisteredCliCommands` (`./registrar.ts`) still carry
|
|
35
|
-
*
|
|
34
|
+
* `buildCliCommands`/`listRegisteredCliCommands` (`./registrar.ts`) still carry the dispatch
|
|
35
|
+
* behaviour. What this file adds of its own is presentation: how `--help` renders the declaration each
|
|
36
|
+
* command carries (task-120 — the positional's name and required-ness, `(required)` on an option, the
|
|
37
|
+
* example and exit-code footer), covered by `test/cli/help-describes-every-command.test.ts`.
|
|
36
38
|
*/
|
|
37
39
|
const node_fs_1 = require("node:fs");
|
|
38
40
|
const node_path_1 = require("node:path");
|
|
41
|
+
const registry_1 = require("../core/registry");
|
|
39
42
|
// Direct module import, not the `../core` barrel — the same path `./registrar.ts` already uses for the
|
|
40
43
|
// other two exit-code mappings (task-101; keeps this file out of the barrel's merge surface).
|
|
41
44
|
const exit_code_1 = require("../core/exit-code");
|
|
45
|
+
const storage_1 = require("../storage");
|
|
42
46
|
const registrar_1 = require("./registrar");
|
|
43
47
|
const init_command_1 = require("./init-command");
|
|
44
48
|
const mcp_command_1 = require("./mcp-command");
|
|
45
49
|
const error_1 = require("./error");
|
|
46
50
|
const exit_1 = require("./exit");
|
|
47
51
|
const output_1 = require("./output");
|
|
52
|
+
const suggest_1 = require("./suggest");
|
|
48
53
|
/**
|
|
49
54
|
* The CLI version, read from `package.json` deterministically (REQ-SYS-07 — no wall-clock, no
|
|
50
55
|
* inference): the manifest sits two levels up from this module in both the `src/cli/` source layout
|
|
@@ -75,8 +80,9 @@ async function buildProgram(modules, options) {
|
|
|
75
80
|
// and the process ends through `exitWith`, the single exit seam of `./exit.ts`, like every other
|
|
76
81
|
// outcome.
|
|
77
82
|
//
|
|
78
|
-
// COMMANDER'S OWN MESSAGES ARE
|
|
79
|
-
// its
|
|
83
|
+
// COMMANDER'S OWN MESSAGES ARE NOT REPEATED: for every error it raises, Commander has already written
|
|
84
|
+
// its message before calling this — in the active `--format` since task-130, through the
|
|
85
|
+
// `configureOutput` hooks below — so nothing is added on top of it. The ONE outcome where
|
|
80
86
|
// it writes no error message at all is an invocation it found incomplete — a noun with no verb —
|
|
81
87
|
// where it prints help to stderr and nothing else; `spec-005` §1 requires a non-zero exit to carry
|
|
82
88
|
// an error message *always*, so that outcome (and only that one, flagged by `needsErrorLine`) gets
|
|
@@ -92,35 +98,81 @@ async function buildProgram(modules, options) {
|
|
|
92
98
|
// set before it dispatches) with the global options removed.
|
|
93
99
|
program.exitOverride((error) => {
|
|
94
100
|
const termination = (0, exit_code_1.classifyParseOutcome)(error);
|
|
95
|
-
if (termination.needsErrorLine)
|
|
96
|
-
|
|
97
|
-
|
|
101
|
+
if (termination.needsErrorLine) {
|
|
102
|
+
const { reason, hint } = incompleteInvocationReason(program.args);
|
|
103
|
+
(0, error_1.emitError)(reason, { format: activeFormat(program), ...(hint !== undefined ? { hint } : {}) });
|
|
104
|
+
}
|
|
105
|
+
const deferred = (0, exit_1.exitWith)(termination.exitCode);
|
|
106
|
+
// Commander ends the process itself, at ITS code, as soon as this callback returns. When the exit
|
|
107
|
+
// is waiting for queued output to drain (task-249, `bug-222` — e.g. a long `--help` into a pipe),
|
|
108
|
+
// returning would let Commander cut that output short at the wrong code; throwing hands control
|
|
109
|
+
// back to the entry point, which leaves the deferred exit to happen.
|
|
110
|
+
if (deferred)
|
|
111
|
+
throw new exit_1.DeferredExit(termination.exitCode);
|
|
112
|
+
});
|
|
113
|
+
// Commander's own refusals in the active `--format` (task-130, `bug-114`, spec-005 §3.2). Commander
|
|
114
|
+
// writes an error through `outputError` and the help it prints for an incomplete invocation through
|
|
115
|
+
// `writeErr`, so these two hooks are the whole parse path's stderr. Every error goes through
|
|
116
|
+
// `emitError` (`src/cli/error.ts`) in every format, so it has spec-005 §3's shape: the `error:` line,
|
|
117
|
+
// then a `hint:` line when a suggestion applies (task-179, `bug-104`; `commanderRefusal`). Under
|
|
118
|
+
// `json`/`yaml` the message becomes the same `{error, hint?}` object a WingFoil refusal is, and the
|
|
119
|
+
// help text — which would bury that object — is not written: `--help` itself writes to stdout and is
|
|
120
|
+
// unaffected.
|
|
121
|
+
// `--format` is read when the error fires; Commander has parsed the root program's options by then,
|
|
122
|
+
// wherever on the command line they stand. Installed before the first `.command()`, like the callback
|
|
123
|
+
// above, because `copyInheritedSettings` copies the output configuration at registration time.
|
|
124
|
+
program.configureOutput({
|
|
125
|
+
writeErr: (text) => {
|
|
126
|
+
if (activeFormat(program) === 'console')
|
|
127
|
+
process.stderr.write(text);
|
|
128
|
+
},
|
|
129
|
+
outputError: (text) => {
|
|
130
|
+
(0, error_1.emitError)(...commanderRefusal(program, text, activeFormat(program)));
|
|
131
|
+
},
|
|
98
132
|
});
|
|
133
|
+
// How a command is listed under its parent (task-120, `bug-128`). Commander's own `subcommandTerm`
|
|
134
|
+
// renders each registered argument from the flag Commander ENFORCES, which is why every derived verb
|
|
135
|
+
// used to read `[positionals...]`; this renders the positional the operation declares instead,
|
|
136
|
+
// `<id>` when core refuses its absence and `[section]` when it does not. Installed before the first
|
|
137
|
+
// `.command()` for the same reason as the callback above: `copyInheritedSettings` copies the help
|
|
138
|
+
// configuration at registration time.
|
|
139
|
+
const declaredPositionals = new Map();
|
|
140
|
+
program.configureHelp({ subcommandTerm: (command) => subcommandTerm(command, declaredPositionals.get(command)) });
|
|
99
141
|
// Register `-V, --version` so `wingfoil --version` prints the version and exits 0
|
|
100
142
|
// (spec-008-cli-grammar §1, bug-001-cli-version-flag) — Commander handles it before any command.
|
|
101
|
-
|
|
143
|
+
// It prints the build stamp `<semver> (<sha>)`, the value every commit's `WingFoil-Version:` trailer
|
|
144
|
+
// carries (task-192, `dl-111` Action 3); the MCP server keeps announcing the bare semver below.
|
|
145
|
+
program.version((0, storage_1.readBuildStamp)());
|
|
102
146
|
program
|
|
103
|
-
.
|
|
147
|
+
// Until P5.1.4 gives `console` a human rendering (`dl-043`), the help says what the default prints
|
|
148
|
+
// and that no output is coloured (spec-008 §2, task-156, `bug-152`, `bug-203`).
|
|
149
|
+
.option('--format <format>', 'output format (console|json|yaml); console prints indented JSON for now, unless the command defines its own', 'console')
|
|
104
150
|
.option('--verbose', 'emit diagnostic logs to stderr')
|
|
105
|
-
.option('--no-color', 'disable ANSI colors')
|
|
151
|
+
.option('--no-color', 'disable ANSI colors (accepted; no output is colored yet)')
|
|
106
152
|
.option('--no-interactive', 'fail on missing args instead of prompting');
|
|
107
153
|
// `wingfoil init` is a SPECIAL bootstrap command (task-029, P5.1.1): it runs BEFORE config exists,
|
|
108
154
|
// so it is NOT a `CORE_MODULES` noun-verb op — it is wired directly here and drives `runInit`
|
|
109
155
|
// (./init-command.ts). The wizard/`--template`/prompt-matrix logic is fully unit-tested in
|
|
110
|
-
// ./init-command.ts; this registration is
|
|
111
|
-
//
|
|
156
|
+
// ./init-command.ts; this registration is a thin `commander` seam, and `test/cli/program.test.ts`
|
|
157
|
+
// pins it (the command is registered and drives `runInit` with the resolved options).
|
|
112
158
|
program
|
|
113
159
|
.command('init')
|
|
114
|
-
.description('
|
|
115
|
-
|
|
116
|
-
|
|
160
|
+
.description('scaffold .wingfoil/ in the current git repository and commit it')
|
|
161
|
+
// bug-140: the legal values come from the template registry, the same list `--template` resolves
|
|
162
|
+
// against and the missing-argument error names (./init-command.ts).
|
|
163
|
+
.option('--template <name>', `methodology template, one of: ${storage_1.TEMPLATE_NAMES.join(', ')} (required without a terminal or with --no-interactive)`)
|
|
164
|
+
.addHelpText('after', leafHelpFooter(`wingfoil init --template ${storage_1.TEMPLATE_NAMES[0] ?? '<name>'}`))
|
|
165
|
+
.allowExcessArguments(true)
|
|
166
|
+
.action(async (localOpts, command) => {
|
|
167
|
+
if (refusedInvalidFormat(program) || refusedSurplus(program, 'init', command.args))
|
|
168
|
+
return;
|
|
117
169
|
const globalOpts = program.opts();
|
|
118
170
|
let root;
|
|
119
171
|
try {
|
|
120
172
|
root = options.resolveRoot();
|
|
121
173
|
}
|
|
122
174
|
catch (error) {
|
|
123
|
-
(0, error_1.emitError)(error instanceof Error ? error.message : String(error), { format:
|
|
175
|
+
(0, error_1.emitError)(error instanceof Error ? error.message : String(error), { format: activeFormat(program) });
|
|
124
176
|
(0, exit_1.exitWith)(1);
|
|
125
177
|
return;
|
|
126
178
|
}
|
|
@@ -130,73 +182,228 @@ async function buildProgram(modules, options) {
|
|
|
130
182
|
// starts the long-running production MCP server over stdio rather than wrapping a `CORE_MODULES`
|
|
131
183
|
// noun-verb op, so — like `init` above — it is wired directly here and drives `runMcp`
|
|
132
184
|
// (./mcp-command.ts). The pre-flight (resolve-root / error / exit 1) is unit-tested in
|
|
133
|
-
// ./mcp-command.ts with an injected server-start; this registration is
|
|
134
|
-
// `
|
|
185
|
+
// ./mcp-command.ts with an injected server-start; this registration is a thin `commander` seam, and
|
|
186
|
+
// `test/cli/program.test.ts` pins it (the command is registered and drives `runMcp`).
|
|
135
187
|
program
|
|
136
188
|
.command('mcp')
|
|
137
189
|
.description('start the WingFoil MCP server (read-only Resources and role Prompts) over stdio')
|
|
138
|
-
.
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
190
|
+
.addHelpText('after', leafHelpFooter('wingfoil mcp'))
|
|
191
|
+
.allowExcessArguments(true)
|
|
192
|
+
.action(async (_localOpts, command) => {
|
|
193
|
+
if (refusedInvalidFormat(program) || refusedSurplus(program, 'mcp', command.args))
|
|
194
|
+
return;
|
|
195
|
+
await (0, mcp_command_1.runMcp)({ resolveRoot: options.resolveRoot, version: readPackageVersion(), format: activeFormat(program) });
|
|
142
196
|
});
|
|
143
197
|
const nounCommands = new Map();
|
|
144
198
|
for (const command of (0, registrar_1.buildCliCommands)(modules, options)) {
|
|
145
199
|
const target = resolveCommandTarget(program, nounCommands, command);
|
|
146
|
-
// A
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
//
|
|
152
|
-
//
|
|
153
|
-
//
|
|
154
|
-
//
|
|
200
|
+
// A flat command IS its noun (`paths`), so only a nested verb's noun takes the module's own line.
|
|
201
|
+
if (command.verb && command.nounDescription !== undefined)
|
|
202
|
+
nounCommands.get(command.noun)?.description(command.nounDescription);
|
|
203
|
+
if (command.description !== undefined)
|
|
204
|
+
target.description(command.description);
|
|
205
|
+
// The operand (task-025's `positionals` seam, named by task-120). PARSING is the same for every
|
|
206
|
+
// derived command whatever it declares: Commander accepts any number of operands and WingFoil
|
|
207
|
+
// decides what to refuse, with its own message — `dl-082-cli-parameter-shape` gives each command at
|
|
208
|
+
// most ONE positional, the identity of its target, and `./registrar.ts` refuses a surplus operand,
|
|
209
|
+
// and a missing required one, at exit `2` before anything is read (task-129, `bug-171`, `bug-131`;
|
|
210
|
+
// task-179, `bug-180`, `bug-168`), rather than leave it to a Commander arity error, whose wording
|
|
211
|
+
// would differ from command to command. A declared positional is registered as an OPTIONAL variadic
|
|
212
|
+
// argument under its declared name: marking it required to Commander would replace WingFoil's
|
|
213
|
+
// `missing required argument: <id>` with Commander's own refusal, so required-ness is RENDERED here
|
|
214
|
+
// (the usage line below, `subcommandTerm`) and enforced by the registrar. A command that declares none registers no argument — so `--help` shows
|
|
215
|
+
// none — and allows excess arguments, so that the surplus reaches the registrar's refusal.
|
|
216
|
+
if (command.positional) {
|
|
217
|
+
target.argument(`[${command.positional.name}...]`, command.positional.description);
|
|
218
|
+
declaredPositionals.set(target, command.positional);
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
target.allowExcessArguments(true);
|
|
222
|
+
}
|
|
155
223
|
// Plus this command's own `--{flag}` options (task-028-implement-paths-category's
|
|
156
224
|
// `CoreOperation.flags`, e.g. `paths`'s `--list`): Commander rejects an unknown option, so each
|
|
157
225
|
// declared flag must be registered explicitly.
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
target.option(`--${name}`, `${name} flag`);
|
|
226
|
+
for (const flag of command.flags ?? []) {
|
|
227
|
+
target.option(`--${flag.name}`, flag.description ?? '');
|
|
161
228
|
}
|
|
162
229
|
// Value-bearing `--{name} <value>` options (task-020-implement-memory-add's `memory add
|
|
163
230
|
// --type/--title/--tags`): Commander rejects an unknown option, so each declared option must be
|
|
164
231
|
// registered explicitly with a `<value>` operand (distinguishing it from a boolean `--flag`).
|
|
232
|
+
// `required` is rendered in the description, not enforced by Commander (`requiredOption` would
|
|
233
|
+
// replace core's refusal, exactly as for the positional above).
|
|
165
234
|
for (const option of command.options ?? []) {
|
|
166
|
-
|
|
235
|
+
const flags = `--${option.name} <${option.valueName ?? 'value'}>`;
|
|
236
|
+
const description = [option.description, option.required === true ? '(required)' : undefined].filter(Boolean).join(' ');
|
|
237
|
+
// A repeatable option (task-110, `memory add --set`) collects every occurrence in order;
|
|
238
|
+
// Commander's default for a value option is last-one-wins, which would drop all but one.
|
|
239
|
+
if (option.repeatable === true) {
|
|
240
|
+
target.option(flags, description, (value, previous) => [...(previous ?? []), value]);
|
|
241
|
+
}
|
|
242
|
+
else {
|
|
243
|
+
target.option(flags, description);
|
|
244
|
+
}
|
|
167
245
|
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
//
|
|
172
|
-
|
|
246
|
+
target.usage(['[options]', ...positionalTerm(command.positional)].join(' '));
|
|
247
|
+
if (command.example !== undefined)
|
|
248
|
+
target.addHelpText('after', leafHelpFooter(command.example));
|
|
249
|
+
// The action reads the operands and options off the invoked command itself: Commander passes the
|
|
250
|
+
// declared argument's values first only when one is registered, so the command object — always the
|
|
251
|
+
// LAST callback argument — is the one shape both kinds of command share. Forward the operands
|
|
252
|
+
// (task-025), collapse this command's declared flags into a `{ name: boolean }` record (task-028)
|
|
253
|
+
// and its declared value options into a `{ name: value }` record (task-020) for `run`.
|
|
254
|
+
target.action(async (...actionArgs) => {
|
|
255
|
+
const invoked = actionArgs[actionArgs.length - 1];
|
|
173
256
|
const globalOpts = program.opts();
|
|
174
|
-
|
|
257
|
+
const options = invoked.opts();
|
|
258
|
+
await command.run(globalOpts.format, invoked.args, buildFlagValues(command, options), buildOptionValues(command, options));
|
|
175
259
|
});
|
|
176
260
|
}
|
|
177
261
|
return program;
|
|
178
262
|
}
|
|
179
263
|
/**
|
|
180
|
-
*
|
|
264
|
+
* How `--help` shows a declared positional: `<name>` when the operation refuses its absence, `[name]`
|
|
265
|
+
* when it does not — one element or none, so callers can spread it into a list of terms.
|
|
266
|
+
*/
|
|
267
|
+
function positionalTerm(positional) {
|
|
268
|
+
if (!positional)
|
|
269
|
+
return [];
|
|
270
|
+
return [positional.required === true ? `<${positional.name}>` : `[${positional.name}]`];
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* A command's line in its parent's command list — Commander's own term (`name`, then `[options]` when
|
|
274
|
+
* it has options of its own, then its arguments), with the DECLARED positional in place of the
|
|
275
|
+
* registered variadic argument (task-120). A command with no declared positional — Commander's own
|
|
276
|
+
* `help [command]` included — keeps Commander's rendering of whatever it registered.
|
|
277
|
+
*/
|
|
278
|
+
function subcommandTerm(command, positional) {
|
|
279
|
+
const argumentTerms = positional
|
|
280
|
+
? positionalTerm(positional)
|
|
281
|
+
: command.registeredArguments.map((argument) => {
|
|
282
|
+
const name = `${argument.name()}${argument.variadic ? '...' : ''}`;
|
|
283
|
+
return argument.required ? `<${name}>` : `[${name}]`;
|
|
284
|
+
});
|
|
285
|
+
return [command.name(), ...(command.options.length > 0 ? ['[options]'] : []), ...argumentTerms].join(' ');
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* The text after a command's own help (`spec-008-cli-grammar` §8, `P5.1.4-cli-ux.feature`): one example
|
|
289
|
+
* invocation, and the three exit codes of `spec-005` §1, the same for every command. Leaf commands
|
|
290
|
+
* only — a noun's help lists its verbs, and each verb carries its own.
|
|
291
|
+
*/
|
|
292
|
+
function leafHelpFooter(example) {
|
|
293
|
+
return [
|
|
294
|
+
'',
|
|
295
|
+
'Example:',
|
|
296
|
+
` $ ${example}`,
|
|
297
|
+
'',
|
|
298
|
+
'Exit codes:',
|
|
299
|
+
' 0 success',
|
|
300
|
+
' 1 the command line was valid, but the operation failed',
|
|
301
|
+
' 2 the command line is wrong: unknown command or option, missing or invalid argument',
|
|
302
|
+
].join('\n');
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* The invalid-`--format` refusal of the two hand-wired bootstrap commands (task-179, `bug-226`): checked
|
|
306
|
+
* FIRST, before the surplus operand, as the registrar checks it first for every derived command — the
|
|
307
|
+
* value decides how every later error is rendered, so one order holds for every command
|
|
308
|
+
* (`spec-008-cli-grammar` §1). Console text at exit `2`, the same {@link invalidFormatReason} line
|
|
309
|
+
* (`spec-005` §2). `mcp` used to fall back to `console` and start; it is refused like any command.
|
|
310
|
+
*
|
|
311
|
+
* @returns `true` when the invocation was refused (the caller returns).
|
|
312
|
+
*/
|
|
313
|
+
function refusedInvalidFormat(program) {
|
|
314
|
+
const value = program.opts().format;
|
|
315
|
+
if ((0, output_1.isValidFormat)(value))
|
|
316
|
+
return false;
|
|
317
|
+
(0, exit_1.exitWith)(2, `error: ${(0, output_1.invalidFormatReason)(value)}`);
|
|
318
|
+
return true;
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* The surplus-operand refusal of the two hand-wired bootstrap commands (`bug-179`, task-165). `init`
|
|
322
|
+
* and `mcp` declare no positional, so any operand is a surplus (`spec-008-cli-grammar` §1): refused at
|
|
323
|
+
* exit `2` with the same {@link extraOperandsReason} wording the registrar gives every `CORE_MODULES`
|
|
324
|
+
* command (task-129), in the active `--format`, before the project root is resolved — so nothing is
|
|
325
|
+
* read or written. Both commands allow excess arguments so the surplus reaches this check instead of
|
|
326
|
+
* Commander's own `too many arguments` refusal, whose wording differs.
|
|
327
|
+
*
|
|
328
|
+
* @returns `true` when the invocation was refused (the caller returns), `false` when it had no operand.
|
|
329
|
+
*/
|
|
330
|
+
function refusedSurplus(program, name, operands) {
|
|
331
|
+
if (operands.length === 0)
|
|
332
|
+
return false;
|
|
333
|
+
(0, error_1.emitError)((0, registry_1.extraOperandsReason)(name, undefined, operands.length), { format: activeFormat(program) });
|
|
334
|
+
(0, exit_1.exitWith)(2);
|
|
335
|
+
return true;
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* The `--format` an error is rendered in: the parsed global option when it is a valid format, else
|
|
339
|
+
* `console` — an invalid value is itself refused in console text by the registrar (spec-005 §2), and a
|
|
340
|
+
* parse error can fire before `--format` has a usable value at all (task-130, `bug-114`).
|
|
341
|
+
*/
|
|
342
|
+
function activeFormat(program) {
|
|
343
|
+
const value = program.getOptionValue('format');
|
|
344
|
+
return typeof value === 'string' && (0, output_1.isValidFormat)(value) ? value : 'console';
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* Commander's error text as {@link emitError} arguments (task-130, `bug-114`; task-179, `bug-104`).
|
|
348
|
+
* Commander writes `error: <reason>\n`, and for an unknown command or option its closest match on a
|
|
349
|
+
* line of its own, `(Did you mean <name>?)`. The first line without its `error: ` prefix is the reason.
|
|
350
|
+
* The `hint` is spec-005 §3.1's `did you mean "<name>"?`:
|
|
351
|
+
*
|
|
352
|
+
* - for an **unknown command**, WingFoil's own match (`./suggest.ts`, Levenshtein distance ≤ 2,
|
|
353
|
+
* `spec-008` §1) against the commands of the level the token was typed at; Commander's suggestion,
|
|
354
|
+
* from a different algorithm, is dropped;
|
|
355
|
+
* - for an **unknown option**, Commander's match, re-worded into the same `hint:` shape — `spec-008` §1
|
|
356
|
+
* fixes the algorithm for commands only, and Commander knows every option a command inherits.
|
|
357
|
+
*
|
|
358
|
+
* Any other line is kept, joined to the reason, so nothing Commander said is dropped.
|
|
359
|
+
*/
|
|
360
|
+
function commanderRefusal(program, text, format) {
|
|
361
|
+
const [first = '', ...rest] = text.split('\n').map((line) => line.trim()).filter((line) => line !== '');
|
|
362
|
+
const suggestion = /^\(Did you mean (.*)\?\)$/;
|
|
363
|
+
const reason = [first.replace(/^error: /, ''), ...rest.filter((line) => !suggestion.test(line))].join(' ');
|
|
364
|
+
const unknownCommand = /^unknown command '(.*)'$/.exec(reason)?.[1];
|
|
365
|
+
const suggested = unknownCommand !== undefined
|
|
366
|
+
? (0, suggest_1.closestCommand)(unknownCommand, commandsBeside(program))
|
|
367
|
+
: rest.map((line) => suggestion.exec(line)?.[1]).find((match) => match !== undefined);
|
|
368
|
+
return [reason, { format, ...(suggested !== undefined ? { hint: (0, suggest_1.unknownCommandHint)(suggested) } : {}) }];
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* The names (and aliases) of the commands an unknown command was typed among: walk the root program's
|
|
372
|
+
* operands from the top, descending into each known command, and stop at the first operand no command
|
|
373
|
+
* at that level answers to — the one Commander refused. The list is the one Commander itself would
|
|
374
|
+
* consider there (`Help#visibleCommands`, its built-in `help` included).
|
|
375
|
+
*/
|
|
376
|
+
function commandsBeside(program) {
|
|
377
|
+
let level = program;
|
|
378
|
+
for (const operand of program.args) {
|
|
379
|
+
const next = level.commands.find((command) => command.name() === operand || command.aliases().includes(operand));
|
|
380
|
+
if (next === undefined)
|
|
381
|
+
break;
|
|
382
|
+
level = next;
|
|
383
|
+
}
|
|
384
|
+
return program
|
|
385
|
+
.createHelp()
|
|
386
|
+
.visibleCommands(level)
|
|
387
|
+
.flatMap((command) => [command.name(), ...command.aliases()]);
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* The refusal (spec-005 §3.1) for an invocation Commander found incomplete —
|
|
181
391
|
* task-103-a-missing-verb-exits-2-with-an-error-line (`bug-103`). Commander supplies no message on
|
|
182
392
|
* this path, so the wording is a **ruling**, recorded here rather than left to the reader:
|
|
183
393
|
*
|
|
184
|
-
* - `wingfoil dna`, `wingfoil memory`, and `wingfoil` with no arguments at all →
|
|
185
|
-
*
|
|
186
|
-
* <command
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
* through `help` is the same mistake and a script should have one shape to grep. The single quotes
|
|
194
|
-
* are Commander's; `spec-005` §4's example shows double ones, and reconciling the two spellings
|
|
195
|
-
* (along with the missing `hint:` suggestion) is `bug-104`'s, which owns both lines at once. Picking
|
|
196
|
-
* a third spelling here would make that reconciliation harder, not easier.
|
|
394
|
+
* - `wingfoil dna`, `wingfoil memory`, and `wingfoil` with no arguments at all → the one
|
|
395
|
+
* missing-operand shape every command uses (task-179, `bug-168`; `missingOperandReason`):
|
|
396
|
+
* `missing required argument: <command>`, with the incomplete invocation and the token that would
|
|
397
|
+
* complete it as the `hint:` line, `usage: wingfoil dna <command>`. `<command>` rather than `<verb>`
|
|
398
|
+
* matches Commander's own placeholder in the usage line it prints above, under `console`.
|
|
399
|
+
* - `wingfoil help nosuchnoun` → `unknown command 'nosuchnoun'`, byte-for-byte the reason `wingfoil
|
|
400
|
+
* nosuchnoun` emits, because asking about an unknown noun through `help` is the same mistake and a
|
|
401
|
+
* script should have one shape to grep. It carries no `hint:` line: the suggestion on this path is
|
|
402
|
+
* `bug-115`'s (v0.4), out of task-179's scope.
|
|
197
403
|
*
|
|
198
404
|
* @param operands - the root program's `args`: the invocation's operands, global options already
|
|
199
405
|
* removed by Commander itself. This function never re-parses argv.
|
|
406
|
+
* @returns the reason, and the hint when there is one.
|
|
200
407
|
*/
|
|
201
408
|
function incompleteInvocationReason(operands) {
|
|
202
409
|
const [first, second] = operands;
|
|
@@ -204,8 +411,8 @@ function incompleteInvocationReason(operands) {
|
|
|
204
411
|
// `Command#_dispatchHelpCommand` falls through to `_dispatchSubcommand`, whose `if (!subCommand)`
|
|
205
412
|
// raises it. `help` alone and `help <known-noun>` exit 0 and never arrive here.
|
|
206
413
|
if (first === 'help' && second !== undefined)
|
|
207
|
-
return `unknown command '${second}'
|
|
208
|
-
return
|
|
414
|
+
return { reason: `unknown command '${second}'` };
|
|
415
|
+
return { reason: (0, registry_1.missingOperandReason)('command'), hint: `usage: ${['wingfoil', ...operands, '<command>'].join(' ')}` };
|
|
209
416
|
}
|
|
210
417
|
/**
|
|
211
418
|
* The Commander `Command` a `CliCommand` registers itself on: a flat, no-verb command
|
|
@@ -232,12 +439,12 @@ function resolveCommandTarget(program, nounCommands, command) {
|
|
|
232
439
|
* `CliCommand.run`'s already-optional `flags` parameter.
|
|
233
440
|
*/
|
|
234
441
|
function buildFlagValues(command, options) {
|
|
235
|
-
const flagNames = command.flags ?? [];
|
|
442
|
+
const flagNames = (command.flags ?? []).map((flag) => flag.name);
|
|
236
443
|
if (flagNames.length === 0)
|
|
237
444
|
return undefined;
|
|
238
445
|
const flagValues = {};
|
|
239
446
|
for (const name of flagNames) {
|
|
240
|
-
flagValues[name] = Boolean(options[name]);
|
|
447
|
+
flagValues[name] = Boolean(options[commanderKey(name)]);
|
|
241
448
|
}
|
|
242
449
|
return flagValues;
|
|
243
450
|
}
|
|
@@ -246,7 +453,8 @@ function buildFlagValues(command, options) {
|
|
|
246
453
|
* into a `{ name: value }` record read from Commander's parsed options object (task-020), so
|
|
247
454
|
* `command.run` never has to know Commander's option-object shape. An option the invocation omitted is
|
|
248
455
|
* simply absent from the record (not present-as-`undefined`), so a core op can distinguish "not given"
|
|
249
|
-
* from an empty string
|
|
456
|
+
* from an empty string; a repeatable option (task-110) is the array of its occurrences. Returns
|
|
457
|
+
* `undefined` when the command declares no value options (every command
|
|
250
458
|
* before task-020-implement-memory-add), matching `CliCommand.run`'s already-optional `options` param.
|
|
251
459
|
*/
|
|
252
460
|
function buildOptionValues(command, options) {
|
|
@@ -258,6 +466,8 @@ function buildOptionValues(command, options) {
|
|
|
258
466
|
const value = options[commanderKey(name)];
|
|
259
467
|
if (typeof value === 'string')
|
|
260
468
|
optionValues[name] = value;
|
|
469
|
+
else if (Array.isArray(value))
|
|
470
|
+
optionValues[name] = value.filter((item) => typeof item === 'string');
|
|
261
471
|
}
|
|
262
472
|
return optionValues;
|
|
263
473
|
}
|
package/dist/cli/program.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"program.js","sourceRoot":"","sources":["../../src/cli/program.ts"],"names":[],"mappings":";;AAqEA,oCAwHC;AA7LD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,qCAAuC;AACvC,yCAAiC;AAMjC,uGAAuG;AACvG,8FAA8F;AAC9F,iDAAyD;AAEzD,2CAA2F;AAC3F,iDAA+D;AAC/D,+CAAuC;AACvC,mCAAoC;AACpC,iCAAkC;AAClC,qCAAyC;AAEzC;;;;;GAKG;AACH,SAAS,kBAAkB;IACzB,MAAM,YAAY,GAAG,IAAA,gBAAI,EAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;IACjE,OAAQ,IAAI,CAAC,KAAK,CAAC,IAAA,sBAAY,EAAC,YAAY,EAAE,OAAO,CAAC,CAAyB,CAAC,OAAO,CAAC;AAC1F,CAAC;AAED;;;;;;GAMG;AACI,KAAK,UAAU,YAAY,CAAC,OAA8B,EAAE,OAA6B;IAC9F,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,CAAC;IAC3D,MAAM,OAAO,GAAG,IAAI,WAAW,CAAC,UAAU,CAAC,CAAC;IAC5C,gFAAgF;IAChF,+FAA+F;IAC/F,iGAAiG;IACjG,oGAAoG;IACpG,+FAA+F;IAC/F,qFAAqF;IACrF,qGAAqG;IACrG,iGAAiG;IACjG,WAAW;IACX,EAAE;IACF,oGAAoG;IACpG,mGAAmG;IACnG,iGAAiG;IACjG,mGAAmG;IACnG,mGAAmG;IACnG,yDAAyD;IACzD,mEAAmE;IACnE,EAAE;IACF,0FAA0F;IAC1F,qGAAqG;IACrG,iGAAiG;IACjG,+FAA+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I,KAAK,QAAQ,CAAC,CAAC;IACvH,CAAC;IACD,OAAO,YAAY,CAAC;AACtB,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAS,YAAY,CAAC,IAAY;IAChC,OAAO,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE,CAAC,MAAM,EAAE,IAAY,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;AACvF,CAAC"}
|
package/dist/cli/registrar.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* operation regardless of `mutates`"). No business logic lives outside `run`: it only (a)
|
|
8
8
|
* validates the global `--format` flag, (b) turns the invocation into typed params via the
|
|
9
9
|
* caller-supplied `buildParams`, (c) calls the one core function, (d) renders the resulting
|
|
10
|
-
* `CoreResult` via `renderSuccess
|
|
10
|
+
* `CoreResult` via `renderSuccess` (plus `emitWarnings` for its warnings, task-169)/`emitError` and terminates via `exitWith` — matching spec-005
|
|
11
11
|
* §1's "exactly one process exit call per invocation".
|
|
12
12
|
*
|
|
13
13
|
* Deliberately Commander-independent (see `./program.ts`'s module doc for why): this module owns
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* unit-testable; wiring this command model onto a real `commander` `Command` tree is a separate,
|
|
16
16
|
* thin, mechanical concern.
|
|
17
17
|
*/
|
|
18
|
-
import type { CoreModule, CoreOption, ParamsBuilder } from '../core/registry';
|
|
18
|
+
import type { CoreFlag, CoreModule, CoreOption, CorePositional, ParamsBuilder } from '../core/registry';
|
|
19
19
|
/** Ambient dependencies {@link buildCliCommands} needs: how to resolve the project root and how to shape each operation's params. */
|
|
20
20
|
export interface BuildCommandsOptions {
|
|
21
21
|
/** Resolves the project root a core call needs — an ambient/environment concern, not a CLI flag. */
|
|
@@ -32,10 +32,18 @@ export interface CliCommand {
|
|
|
32
32
|
readonly noun: string;
|
|
33
33
|
readonly verb: string;
|
|
34
34
|
readonly mutates: boolean;
|
|
35
|
-
/** Copied from `
|
|
35
|
+
/** Copied from `CoreModule.description` — the noun's one-line summary (task-120). */
|
|
36
|
+
readonly nounDescription?: string;
|
|
37
|
+
/** Copied from `CoreOperation.description` — the command's one-line summary (task-120). */
|
|
38
|
+
readonly description?: string;
|
|
39
|
+
/** Copied from `CoreOperation.positional` — the operand `--help` names; absent when it reads none (task-120). */
|
|
40
|
+
readonly positional?: CorePositional;
|
|
41
|
+
/** Copied from `CoreOperation.example` — the invocation `--help` shows under `Example:` (task-120). */
|
|
42
|
+
readonly example?: string;
|
|
43
|
+
/** Copied from `CoreOperation.flags` (`../core/registry.ts`) — the boolean flags `program.ts`
|
|
36
44
|
* registers as Commander `--{name}` options for this command (empty/absent for every command
|
|
37
|
-
* before task-028-implement-paths-category;
|
|
38
|
-
readonly flags?: readonly
|
|
45
|
+
* before task-028-implement-paths-category; `--list` for `paths`). */
|
|
46
|
+
readonly flags?: readonly CoreFlag[];
|
|
39
47
|
/** Copied from `CoreOperation.options` (`../core/registry.ts`) — the value-bearing `--{name} <value>`
|
|
40
48
|
* options `program.ts` registers for this command (task-020-implement-memory-add; empty/absent for
|
|
41
49
|
* every command before it). */
|
|
@@ -47,12 +55,13 @@ export interface CliCommand {
|
|
|
47
55
|
* `wingfoil dna set project.license --value MIT` -> `['project.license']`, one positional per
|
|
48
56
|
* command since `dl-082-cli-parameter-shape`), this command's own parsed `--{flag}`
|
|
49
57
|
* values (task-028, e.g. `{ list: true }`), and its parsed value-bearing `--{name} <value>` OPTIONS
|
|
50
|
-
* (task-020, e.g. `{ type: 'decision', title: 'Use PostgreSQL' }
|
|
58
|
+
* (task-020, e.g. `{ type: 'decision', title: 'Use PostgreSQL' }`; a repeatable option's value is
|
|
59
|
+
* the array of its occurrences, task-110). All are additive/optional — a
|
|
51
60
|
* command that reads no positional and declares no flags/options is still called exactly as before:
|
|
52
61
|
* `run(format)`. The single-positional read ops (`dna show`, `paths`) read `positionals[0]` via
|
|
53
62
|
* `ParamsContext.positional`.
|
|
54
63
|
*/
|
|
55
|
-
readonly run: (formatValue: string, positionals?: readonly string[], flags?: Readonly<Record<string, boolean>>, options?: Readonly<Record<string, string>>) => Promise<void>;
|
|
64
|
+
readonly run: (formatValue: string, positionals?: readonly string[], flags?: Readonly<Record<string, boolean>>, options?: Readonly<Record<string, string | readonly string[]>>) => Promise<void>;
|
|
56
65
|
}
|
|
57
66
|
/**
|
|
58
67
|
* Derive one `CliCommand` per operation in `modules`, in `enumerateOperations`'s deterministic
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registrar.d.ts","sourceRoot":"","sources":["../../src/cli/registrar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"registrar.d.ts","sourceRoot":"","sources":["../../src/cli/registrar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAaxG,qIAAqI;AACrI,MAAM,WAAW,oBAAoB;IACnC,oGAAoG;IACpG,QAAQ,CAAC,WAAW,EAAE,MAAM,MAAM,CAAC;IACnC,iHAAiH;IACjH,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC;CACrC;AAED;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,qFAAqF;IACrF,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,2FAA2F;IAC3F,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,iHAAiH;IACjH,QAAQ,CAAC,UAAU,CAAC,EAAE,cAAc,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