@shrkcrft/cli 0.1.0-alpha.2
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/LICENSE +21 -0
- package/README.md +15 -0
- package/dist/asset-preview/apply-action-hint-stub.d.ts +28 -0
- package/dist/asset-preview/apply-action-hint-stub.d.ts.map +1 -0
- package/dist/asset-preview/apply-action-hint-stub.js +170 -0
- package/dist/asset-preview/apply-asset-preview.d.ts +31 -0
- package/dist/asset-preview/apply-asset-preview.d.ts.map +1 -0
- package/dist/asset-preview/apply-asset-preview.js +210 -0
- package/dist/asset-preview/apply-knowledge-stale-fix.d.ts +37 -0
- package/dist/asset-preview/apply-knowledge-stale-fix.d.ts.map +1 -0
- package/dist/asset-preview/apply-knowledge-stale-fix.js +344 -0
- package/dist/asset-preview/apply-missing-barrel.d.ts +15 -0
- package/dist/asset-preview/apply-missing-barrel.d.ts.map +1 -0
- package/dist/asset-preview/apply-missing-barrel.js +65 -0
- package/dist/asset-preview/apply-template-drift-fix.d.ts +21 -0
- package/dist/asset-preview/apply-template-drift-fix.d.ts.map +1 -0
- package/dist/asset-preview/apply-template-drift-fix.js +125 -0
- package/dist/asset-preview/apply-template-update.d.ts +43 -0
- package/dist/asset-preview/apply-template-update.d.ts.map +1 -0
- package/dist/asset-preview/apply-template-update.js +257 -0
- package/dist/asset-preview/entry-mutator.d.ts +106 -0
- package/dist/asset-preview/entry-mutator.d.ts.map +1 -0
- package/dist/asset-preview/entry-mutator.js +428 -0
- package/dist/authoring/authoring-kit.d.ts +36 -0
- package/dist/authoring/authoring-kit.d.ts.map +1 -0
- package/dist/authoring/authoring-kit.js +106 -0
- package/dist/command-registry.d.ts +158 -0
- package/dist/command-registry.d.ts.map +1 -0
- package/dist/command-registry.js +348 -0
- package/dist/commands/apply.command.d.ts +3 -0
- package/dist/commands/apply.command.d.ts.map +1 -0
- package/dist/commands/apply.command.js +879 -0
- package/dist/commands/architecture.command.d.ts +5 -0
- package/dist/commands/architecture.command.d.ts.map +1 -0
- package/dist/commands/architecture.command.js +141 -0
- package/dist/commands/ask.command.d.ts +3 -0
- package/dist/commands/ask.command.d.ts.map +1 -0
- package/dist/commands/ask.command.js +58 -0
- package/dist/commands/audit.command.d.ts +3 -0
- package/dist/commands/audit.command.d.ts.map +1 -0
- package/dist/commands/audit.command.js +141 -0
- package/dist/commands/biome.command.d.ts +7 -0
- package/dist/commands/biome.command.d.ts.map +1 -0
- package/dist/commands/biome.command.js +350 -0
- package/dist/commands/boundaries.command.d.ts +9 -0
- package/dist/commands/boundaries.command.d.ts.map +1 -0
- package/dist/commands/boundaries.command.js +314 -0
- package/dist/commands/brief.command.d.ts +3 -0
- package/dist/commands/brief.command.d.ts.map +1 -0
- package/dist/commands/brief.command.js +206 -0
- package/dist/commands/bundle.command.d.ts +3 -0
- package/dist/commands/bundle.command.d.ts.map +1 -0
- package/dist/commands/bundle.command.js +1183 -0
- package/dist/commands/changes.command.d.ts +3 -0
- package/dist/commands/changes.command.d.ts.map +1 -0
- package/dist/commands/changes.command.js +155 -0
- package/dist/commands/check.command.d.ts +3 -0
- package/dist/commands/check.command.d.ts.map +1 -0
- package/dist/commands/check.command.js +553 -0
- package/dist/commands/checks.command.d.ts +29 -0
- package/dist/commands/checks.command.d.ts.map +1 -0
- package/dist/commands/checks.command.js +521 -0
- package/dist/commands/ci.command.d.ts +3 -0
- package/dist/commands/ci.command.d.ts.map +1 -0
- package/dist/commands/ci.command.js +680 -0
- package/dist/commands/codemod.command.d.ts +3 -0
- package/dist/commands/codemod.command.d.ts.map +1 -0
- package/dist/commands/codemod.command.js +130 -0
- package/dist/commands/command-catalog.d.ts +265 -0
- package/dist/commands/command-catalog.d.ts.map +1 -0
- package/dist/commands/command-catalog.js +3242 -0
- package/dist/commands/commands.command.d.ts +92 -0
- package/dist/commands/commands.command.d.ts.map +1 -0
- package/dist/commands/commands.command.js +1208 -0
- package/dist/commands/constructs.command.d.ts +15 -0
- package/dist/commands/constructs.command.d.ts.map +1 -0
- package/dist/commands/constructs.command.js +669 -0
- package/dist/commands/context.command.d.ts +3 -0
- package/dist/commands/context.command.d.ts.map +1 -0
- package/dist/commands/context.command.js +120 -0
- package/dist/commands/contract-gate.command.d.ts +5 -0
- package/dist/commands/contract-gate.command.d.ts.map +1 -0
- package/dist/commands/contract-gate.command.js +208 -0
- package/dist/commands/contract-templates.command.d.ts +8 -0
- package/dist/commands/contract-templates.command.d.ts.map +1 -0
- package/dist/commands/contract-templates.command.js +151 -0
- package/dist/commands/contract.command.d.ts +3 -0
- package/dist/commands/contract.command.d.ts.map +1 -0
- package/dist/commands/contract.command.js +105 -0
- package/dist/commands/conventions.command.d.ts +8 -0
- package/dist/commands/conventions.command.d.ts.map +1 -0
- package/dist/commands/conventions.command.js +169 -0
- package/dist/commands/coverage.command.d.ts +3 -0
- package/dist/commands/coverage.command.d.ts.map +1 -0
- package/dist/commands/coverage.command.js +56 -0
- package/dist/commands/daily.commands.d.ts +5 -0
- package/dist/commands/daily.commands.d.ts.map +1 -0
- package/dist/commands/daily.commands.js +224 -0
- package/dist/commands/dashboard-export.command.d.ts +4 -0
- package/dist/commands/dashboard-export.command.d.ts.map +1 -0
- package/dist/commands/dashboard-export.command.js +86 -0
- package/dist/commands/dashboard.command.d.ts +3 -0
- package/dist/commands/dashboard.command.d.ts.map +1 -0
- package/dist/commands/dashboard.command.js +106 -0
- package/dist/commands/dev.command.d.ts +3 -0
- package/dist/commands/dev.command.d.ts.map +1 -0
- package/dist/commands/dev.command.js +1392 -0
- package/dist/commands/diagnostics.command.d.ts +5 -0
- package/dist/commands/diagnostics.command.d.ts.map +1 -0
- package/dist/commands/diagnostics.command.js +97 -0
- package/dist/commands/docs.command.d.ts +4 -0
- package/dist/commands/docs.command.d.ts.map +1 -0
- package/dist/commands/docs.command.js +34 -0
- package/dist/commands/doctor.command.d.ts +7 -0
- package/dist/commands/doctor.command.d.ts.map +1 -0
- package/dist/commands/doctor.command.js +681 -0
- package/dist/commands/drift.command.d.ts +3 -0
- package/dist/commands/drift.command.d.ts.map +1 -0
- package/dist/commands/drift.command.js +124 -0
- package/dist/commands/eslint.command.d.ts +7 -0
- package/dist/commands/eslint.command.d.ts.map +1 -0
- package/dist/commands/eslint.command.js +423 -0
- package/dist/commands/explore.command.d.ts +3 -0
- package/dist/commands/explore.command.d.ts.map +1 -0
- package/dist/commands/explore.command.js +65 -0
- package/dist/commands/export-bundle.command.d.ts +6 -0
- package/dist/commands/export-bundle.command.d.ts.map +1 -0
- package/dist/commands/export-bundle.command.js +96 -0
- package/dist/commands/export.command.d.ts +3 -0
- package/dist/commands/export.command.d.ts.map +1 -0
- package/dist/commands/export.command.js +83 -0
- package/dist/commands/feedback-dispatch.command.d.ts +12 -0
- package/dist/commands/feedback-dispatch.command.d.ts.map +1 -0
- package/dist/commands/feedback-dispatch.command.js +63 -0
- package/dist/commands/feedback.command.d.ts +11 -0
- package/dist/commands/feedback.command.d.ts.map +1 -0
- package/dist/commands/feedback.command.js +336 -0
- package/dist/commands/fix.command.d.ts +3 -0
- package/dist/commands/fix.command.d.ts.map +1 -0
- package/dist/commands/fix.command.js +776 -0
- package/dist/commands/gen.command.d.ts +3 -0
- package/dist/commands/gen.command.d.ts.map +1 -0
- package/dist/commands/gen.command.js +136 -0
- package/dist/commands/git.command.d.ts +6 -0
- package/dist/commands/git.command.d.ts.map +1 -0
- package/dist/commands/git.command.js +81 -0
- package/dist/commands/graph.command.d.ts +3 -0
- package/dist/commands/graph.command.d.ts.map +1 -0
- package/dist/commands/graph.command.js +287 -0
- package/dist/commands/grounding.command.d.ts +7 -0
- package/dist/commands/grounding.command.d.ts.map +1 -0
- package/dist/commands/grounding.command.js +54 -0
- package/dist/commands/help.command.d.ts +20 -0
- package/dist/commands/help.command.d.ts.map +1 -0
- package/dist/commands/help.command.js +127 -0
- package/dist/commands/helper.command.d.ts +6 -0
- package/dist/commands/helper.command.d.ts.map +1 -0
- package/dist/commands/helper.command.js +170 -0
- package/dist/commands/ide.command.d.ts +6 -0
- package/dist/commands/ide.command.d.ts.map +1 -0
- package/dist/commands/ide.command.js +340 -0
- package/dist/commands/impact.command.d.ts +3 -0
- package/dist/commands/impact.command.d.ts.map +1 -0
- package/dist/commands/impact.command.js +819 -0
- package/dist/commands/import.command.d.ts +3 -0
- package/dist/commands/import.command.d.ts.map +1 -0
- package/dist/commands/import.command.js +115 -0
- package/dist/commands/infer.command.d.ts +3 -0
- package/dist/commands/infer.command.d.ts.map +1 -0
- package/dist/commands/infer.command.js +227 -0
- package/dist/commands/ingest.command.d.ts +6 -0
- package/dist/commands/ingest.command.d.ts.map +1 -0
- package/dist/commands/ingest.command.js +532 -0
- package/dist/commands/init.command.d.ts +3 -0
- package/dist/commands/init.command.d.ts.map +1 -0
- package/dist/commands/init.command.js +301 -0
- package/dist/commands/inspect.command.d.ts +3 -0
- package/dist/commands/inspect.command.d.ts.map +1 -0
- package/dist/commands/inspect.command.js +122 -0
- package/dist/commands/knowledge-author.command.d.ts +22 -0
- package/dist/commands/knowledge-author.command.d.ts.map +1 -0
- package/dist/commands/knowledge-author.command.js +366 -0
- package/dist/commands/knowledge-propose.command.d.ts +3 -0
- package/dist/commands/knowledge-propose.command.d.ts.map +1 -0
- package/dist/commands/knowledge-propose.command.js +125 -0
- package/dist/commands/knowledge.command.d.ts +18 -0
- package/dist/commands/knowledge.command.d.ts.map +1 -0
- package/dist/commands/knowledge.command.js +538 -0
- package/dist/commands/languages.command.d.ts +3 -0
- package/dist/commands/languages.command.d.ts.map +1 -0
- package/dist/commands/languages.command.js +300 -0
- package/dist/commands/lint.command.d.ts +15 -0
- package/dist/commands/lint.command.d.ts.map +1 -0
- package/dist/commands/lint.command.js +194 -0
- package/dist/commands/mcp.command.d.ts +3 -0
- package/dist/commands/mcp.command.d.ts.map +1 -0
- package/dist/commands/mcp.command.js +74 -0
- package/dist/commands/memory.command.d.ts +11 -0
- package/dist/commands/memory.command.d.ts.map +1 -0
- package/dist/commands/memory.command.js +264 -0
- package/dist/commands/onboard.command.d.ts +3 -0
- package/dist/commands/onboard.command.d.ts.map +1 -0
- package/dist/commands/onboard.command.js +650 -0
- package/dist/commands/orchestrate.command.d.ts +3 -0
- package/dist/commands/orchestrate.command.d.ts.map +1 -0
- package/dist/commands/orchestrate.command.js +49 -0
- package/dist/commands/owners.command.d.ts +5 -0
- package/dist/commands/owners.command.d.ts.map +1 -0
- package/dist/commands/owners.command.js +113 -0
- package/dist/commands/ownership.command.d.ts +5 -0
- package/dist/commands/ownership.command.d.ts.map +1 -0
- package/dist/commands/ownership.command.js +117 -0
- package/dist/commands/pack-author.command.d.ts +30 -0
- package/dist/commands/pack-author.command.d.ts.map +1 -0
- package/dist/commands/pack-author.command.js +242 -0
- package/dist/commands/packs-new.d.ts +27 -0
- package/dist/commands/packs-new.d.ts.map +1 -0
- package/dist/commands/packs-new.js +805 -0
- package/dist/commands/packs.command.d.ts +15 -0
- package/dist/commands/packs.command.d.ts.map +1 -0
- package/dist/commands/packs.command.js +958 -0
- package/dist/commands/paths.command.d.ts +6 -0
- package/dist/commands/paths.command.d.ts.map +1 -0
- package/dist/commands/paths.command.js +97 -0
- package/dist/commands/pipelines.command.d.ts +9 -0
- package/dist/commands/pipelines.command.d.ts.map +1 -0
- package/dist/commands/pipelines.command.js +308 -0
- package/dist/commands/plan-check.command.d.ts +27 -0
- package/dist/commands/plan-check.command.d.ts.map +1 -0
- package/dist/commands/plan-check.command.js +150 -0
- package/dist/commands/plan-simulate.command.d.ts +3 -0
- package/dist/commands/plan-simulate.command.d.ts.map +1 -0
- package/dist/commands/plan-simulate.command.js +60 -0
- package/dist/commands/plan.command.d.ts +8 -0
- package/dist/commands/plan.command.d.ts.map +1 -0
- package/dist/commands/plan.command.js +139 -0
- package/dist/commands/playbooks.command.d.ts +10 -0
- package/dist/commands/playbooks.command.d.ts.map +1 -0
- package/dist/commands/playbooks.command.js +296 -0
- package/dist/commands/plugin.command.d.ts +11 -0
- package/dist/commands/plugin.command.d.ts.map +1 -0
- package/dist/commands/plugin.command.js +394 -0
- package/dist/commands/policy.command.d.ts +8 -0
- package/dist/commands/policy.command.d.ts.map +1 -0
- package/dist/commands/policy.command.js +451 -0
- package/dist/commands/pr.command.d.ts +3 -0
- package/dist/commands/pr.command.d.ts.map +1 -0
- package/dist/commands/pr.command.js +132 -0
- package/dist/commands/preflight.command.d.ts +3 -0
- package/dist/commands/preflight.command.d.ts.map +1 -0
- package/dist/commands/preflight.command.js +102 -0
- package/dist/commands/presets.command.d.ts +17 -0
- package/dist/commands/presets.command.d.ts.map +1 -0
- package/dist/commands/presets.command.js +647 -0
- package/dist/commands/profiles.command.d.ts +7 -0
- package/dist/commands/profiles.command.d.ts.map +1 -0
- package/dist/commands/profiles.command.js +151 -0
- package/dist/commands/provenance.command.d.ts +26 -0
- package/dist/commands/provenance.command.d.ts.map +1 -0
- package/dist/commands/provenance.command.js +237 -0
- package/dist/commands/quality.command.d.ts +5 -0
- package/dist/commands/quality.command.d.ts.map +1 -0
- package/dist/commands/quality.command.js +69 -0
- package/dist/commands/recommend.command.d.ts +4 -0
- package/dist/commands/recommend.command.d.ts.map +1 -0
- package/dist/commands/recommend.command.js +270 -0
- package/dist/commands/registrations.command.d.ts +3 -0
- package/dist/commands/registrations.command.d.ts.map +1 -0
- package/dist/commands/registrations.command.js +300 -0
- package/dist/commands/registry.command.d.ts +4 -0
- package/dist/commands/registry.command.d.ts.map +1 -0
- package/dist/commands/registry.command.js +37 -0
- package/dist/commands/release.command.d.ts +4 -0
- package/dist/commands/release.command.d.ts.map +1 -0
- package/dist/commands/release.command.js +639 -0
- package/dist/commands/repo.command.d.ts +3 -0
- package/dist/commands/repo.command.d.ts.map +1 -0
- package/dist/commands/repo.command.js +24 -0
- package/dist/commands/report.command.d.ts +3 -0
- package/dist/commands/report.command.d.ts.map +1 -0
- package/dist/commands/report.command.js +511 -0
- package/dist/commands/reposet.command.d.ts +6 -0
- package/dist/commands/reposet.command.d.ts.map +1 -0
- package/dist/commands/reposet.command.js +120 -0
- package/dist/commands/review.command.d.ts +3 -0
- package/dist/commands/review.command.d.ts.map +1 -0
- package/dist/commands/review.command.js +354 -0
- package/dist/commands/risk.command.d.ts +3 -0
- package/dist/commands/risk.command.d.ts.map +1 -0
- package/dist/commands/risk.command.js +56 -0
- package/dist/commands/rounds.command.d.ts +8 -0
- package/dist/commands/rounds.command.d.ts.map +1 -0
- package/dist/commands/rounds.command.js +180 -0
- package/dist/commands/rules.command.d.ts +49 -0
- package/dist/commands/rules.command.d.ts.map +1 -0
- package/dist/commands/rules.command.js +435 -0
- package/dist/commands/runtime.command.d.ts +3 -0
- package/dist/commands/runtime.command.d.ts.map +1 -0
- package/dist/commands/runtime.command.js +56 -0
- package/dist/commands/safety.command.d.ts +3 -0
- package/dist/commands/safety.command.d.ts.map +1 -0
- package/dist/commands/safety.command.js +117 -0
- package/dist/commands/scaffolds.command.d.ts +5 -0
- package/dist/commands/scaffolds.command.d.ts.map +1 -0
- package/dist/commands/scaffolds.command.js +122 -0
- package/dist/commands/schemas.command.d.ts +21 -0
- package/dist/commands/schemas.command.d.ts.map +1 -0
- package/dist/commands/schemas.command.js +296 -0
- package/dist/commands/search.command.d.ts +12 -0
- package/dist/commands/search.command.d.ts.map +1 -0
- package/dist/commands/search.command.js +275 -0
- package/dist/commands/self-config.command.d.ts +7 -0
- package/dist/commands/self-config.command.d.ts.map +1 -0
- package/dist/commands/self-config.command.js +156 -0
- package/dist/commands/self.command.d.ts +3 -0
- package/dist/commands/self.command.d.ts.map +1 -0
- package/dist/commands/self.command.js +117 -0
- package/dist/commands/simulate.command.d.ts +3 -0
- package/dist/commands/simulate.command.d.ts.map +1 -0
- package/dist/commands/simulate.command.js +54 -0
- package/dist/commands/spec.command.d.ts +29 -0
- package/dist/commands/spec.command.d.ts.map +1 -0
- package/dist/commands/spec.command.js +985 -0
- package/dist/commands/start-here.command.d.ts +3 -0
- package/dist/commands/start-here.command.d.ts.map +1 -0
- package/dist/commands/start-here.command.js +35 -0
- package/dist/commands/stats.command.d.ts +3 -0
- package/dist/commands/stats.command.d.ts.map +1 -0
- package/dist/commands/stats.command.js +88 -0
- package/dist/commands/surface.command.d.ts +15 -0
- package/dist/commands/surface.command.d.ts.map +1 -0
- package/dist/commands/surface.command.js +328 -0
- package/dist/commands/task-context.command.d.ts +7 -0
- package/dist/commands/task-context.command.d.ts.map +1 -0
- package/dist/commands/task-context.command.js +646 -0
- package/dist/commands/task.command.d.ts +3 -0
- package/dist/commands/task.command.d.ts.map +1 -0
- package/dist/commands/task.command.js +301 -0
- package/dist/commands/template-quality.command.d.ts +5 -0
- package/dist/commands/template-quality.command.d.ts.map +1 -0
- package/dist/commands/template-quality.command.js +128 -0
- package/dist/commands/templates.command.d.ts +26 -0
- package/dist/commands/templates.command.d.ts.map +1 -0
- package/dist/commands/templates.command.js +964 -0
- package/dist/commands/test.command.d.ts +3 -0
- package/dist/commands/test.command.d.ts.map +1 -0
- package/dist/commands/test.command.js +262 -0
- package/dist/commands/tests.command.d.ts +5 -0
- package/dist/commands/tests.command.d.ts.map +1 -0
- package/dist/commands/tests.command.js +97 -0
- package/dist/commands/trace.command.d.ts +3 -0
- package/dist/commands/trace.command.d.ts.map +1 -0
- package/dist/commands/trace.command.js +121 -0
- package/dist/commands/upgrade.command.d.ts +4 -0
- package/dist/commands/upgrade.command.d.ts.map +1 -0
- package/dist/commands/upgrade.command.js +43 -0
- package/dist/commands/version.command.d.ts +3 -0
- package/dist/commands/version.command.d.ts.map +1 -0
- package/dist/commands/version.command.js +10 -0
- package/dist/commands/why.command.d.ts +24 -0
- package/dist/commands/why.command.d.ts.map +1 -0
- package/dist/commands/why.command.js +119 -0
- package/dist/dashboard/dashboard-api-server.d.ts +21 -0
- package/dist/dashboard/dashboard-api-server.d.ts.map +1 -0
- package/dist/dashboard/dashboard-api-server.js +410 -0
- package/dist/dashboard/live-session-server.d.ts +18 -0
- package/dist/dashboard/live-session-server.d.ts.map +1 -0
- package/dist/dashboard/live-session-server.js +133 -0
- package/dist/diff/collect-changed-paths.d.ts +27 -0
- package/dist/diff/collect-changed-paths.d.ts.map +1 -0
- package/dist/diff/collect-changed-paths.js +68 -0
- package/dist/doctor/doctor-tags.d.ts +63 -0
- package/dist/doctor/doctor-tags.d.ts.map +1 -0
- package/dist/doctor/doctor-tags.js +146 -0
- package/dist/export/export-formats.d.ts +22 -0
- package/dist/export/export-formats.d.ts.map +1 -0
- package/dist/export/export-formats.js +135 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -0
- package/dist/init/detected-block.d.ts +57 -0
- package/dist/init/detected-block.d.ts.map +1 -0
- package/dist/init/detected-block.js +197 -0
- package/dist/init/gitignore.d.ts +30 -0
- package/dist/init/gitignore.d.ts.map +1 -0
- package/dist/init/gitignore.js +110 -0
- package/dist/init/init-templates.d.ts +6 -0
- package/dist/init/init-templates.d.ts.map +1 -0
- package/dist/init/init-templates.js +413 -0
- package/dist/main.d.ts +18 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +699 -0
- package/dist/output/failure-hints.d.ts +55 -0
- package/dist/output/failure-hints.d.ts.map +1 -0
- package/dist/output/failure-hints.js +159 -0
- package/dist/output/format-output.d.ts +9 -0
- package/dist/output/format-output.d.ts.map +1 -0
- package/dist/output/format-output.js +26 -0
- package/dist/output/print-error.d.ts +3 -0
- package/dist/output/print-error.d.ts.map +1 -0
- package/dist/output/print-error.js +14 -0
- package/dist/output/watch-loop.d.ts +37 -0
- package/dist/output/watch-loop.d.ts.map +1 -0
- package/dist/output/watch-loop.js +115 -0
- package/dist/schemas/json-schemas.d.ts +1630 -0
- package/dist/schemas/json-schemas.d.ts.map +1 -0
- package/dist/schemas/json-schemas.js +811 -0
- package/dist/surface/about.d.ts +10 -0
- package/dist/surface/about.d.ts.map +1 -0
- package/dist/surface/about.js +53 -0
- package/dist/surface/load-surface-context.d.ts +34 -0
- package/dist/surface/load-surface-context.d.ts.map +1 -0
- package/dist/surface/load-surface-context.js +100 -0
- package/dist/surface/no-args-landing.d.ts +7 -0
- package/dist/surface/no-args-landing.d.ts.map +1 -0
- package/dist/surface/no-args-landing.js +36 -0
- package/dist/surface/not-enabled-error.d.ts +24 -0
- package/dist/surface/not-enabled-error.d.ts.map +1 -0
- package/dist/surface/not-enabled-error.js +36 -0
- package/dist/surface/profiles.d.ts +37 -0
- package/dist/surface/profiles.d.ts.map +1 -0
- package/dist/surface/profiles.js +151 -0
- package/dist/surface/shape-defaults.d.ts +21 -0
- package/dist/surface/shape-defaults.d.ts.map +1 -0
- package/dist/surface/shape-defaults.js +50 -0
- package/dist/surface/spine-extractor.d.ts +38 -0
- package/dist/surface/spine-extractor.d.ts.map +1 -0
- package/dist/surface/spine-extractor.js +100 -0
- package/dist/surface/surface-config-writer.d.ts +59 -0
- package/dist/surface/surface-config-writer.d.ts.map +1 -0
- package/dist/surface/surface-config-writer.js +135 -0
- package/dist/surface/surface-summary.d.ts +66 -0
- package/dist/surface/surface-summary.d.ts.map +1 -0
- package/dist/surface/surface-summary.js +162 -0
- package/dist/surface/tier.d.ts +100 -0
- package/dist/surface/tier.d.ts.map +1 -0
- package/dist/surface/tier.js +172 -0
- package/dist/task-next/apply-batch-runner.d.ts +42 -0
- package/dist/task-next/apply-batch-runner.d.ts.map +1 -0
- package/dist/task-next/apply-batch-runner.js +192 -0
- package/dist/task-next/task-next-ranker.d.ts +75 -0
- package/dist/task-next/task-next-ranker.d.ts.map +1 -0
- package/dist/task-next/task-next-ranker.js +179 -0
- package/dist/usage/usage-log.d.ts +54 -0
- package/dist/usage/usage-log.d.ts.map +1 -0
- package/dist/usage/usage-log.js +105 -0
- package/dist/validation/run-validation-loop.d.ts +38 -0
- package/dist/validation/run-validation-loop.d.ts.map +1 -0
- package/dist/validation/run-validation-loop.js +100 -0
- package/package.json +73 -0
package/dist/main.js
ADDED
|
@@ -0,0 +1,699 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { CommandRegistry, extractGlobalCwd, parseArgs, } from "./command-registry.js";
|
|
3
|
+
import { initCommand } from "./commands/init.command.js";
|
|
4
|
+
import { inspectCommand } from "./commands/inspect.command.js";
|
|
5
|
+
import { doctorAcknowledgeCommand, doctorAcknowledgementsCommand, doctorCommand, doctorSuppressCommand, doctorSuppressionsCommand, } from "./commands/doctor.command.js";
|
|
6
|
+
import { knowledgeAnchorsCommand, knowledgeGetCommand, knowledgeListCommand, knowledgeReferencesCommand, knowledgeRenameFileCommand, knowledgeRenameSymbolCommand, knowledgeSearchCommand, knowledgeStaleCheckCommand, knowledgeUpdateAnchorCommand, knowledgeVerifyCommand, } from "./commands/knowledge.command.js";
|
|
7
|
+
import { knowledgeAddCommand, knowledgeLintCommand, knowledgeRemoveCommand, knowledgeUpdateCommand, } from "./commands/knowledge-author.command.js";
|
|
8
|
+
import { knowledgeProposeCommand } from "./commands/knowledge-propose.command.js";
|
|
9
|
+
import { provenanceDoctorCommand, provenanceListCommand, provenanceMissingCommand, provenanceReportCommand, provenanceShowCommand, } from "./commands/provenance.command.js";
|
|
10
|
+
import { packAuthorPendingCommand, packAuthorPreviewCommand, packAuthorStatusCommand, packAuthorValidateCommand, } from "./commands/pack-author.command.js";
|
|
11
|
+
import { rulesAddCommand, rulesDoctorCommand, rulesGetCommand, rulesLintCommand, rulesListCommand, rulesRelevantCommand, rulesRemoveCommand, rulesScaffoldCommand, rulesUpdateCommand, } from "./commands/rules.command.js";
|
|
12
|
+
import { checksListCommand, checksDoctorCommand, checksRunCommand, checksParseReportCommand, checksImportCommand, checksAggregateCommand, checksReportCommand, checksConvertCommand, } from "./commands/checks.command.js";
|
|
13
|
+
import { codemodCommand } from "./commands/codemod.command.js";
|
|
14
|
+
import { pathsListCommand, pathsGetCommand, pathsSearchCommand, pathsBestCommand, } from "./commands/paths.command.js";
|
|
15
|
+
import { templatesAddCommand, templatesDoctorCommand, templatesDriftCommand, templatesGetCommand, templatesListCommand, templatesPreviewCommand, templatesRemoveCommand, templatesScaffoldCommand, templatesSearchCommand, templatesSmokeCommand, templatesUpdateCommand, templatesVarsCommand, templatesVerifyPathsCommand, } from "./commands/templates.command.js";
|
|
16
|
+
import { pipelinesListCommand, pipelinesGetCommand, pipelinesContextCommand, pipelinesPlanCommand, pipelinesScriptCommand, pipelinesNextCommand, pipelinesVarsCommand, } from "./commands/pipelines.command.js";
|
|
17
|
+
import { packsListCommand, packsContributionsCommand, packsConflictsCommand, packsSignatureStatusCommand, packsGetCommand, packsInspectCommand, packsDoctorCommand, packsReleaseCheckCommand, packsCompatCommand, packsSignCommand, packsVerifyCommand, packsDevStatusCommand, packsWatchCommand, } from "./commands/packs.command.js";
|
|
18
|
+
import { packsNewCommand, packsTestCommand } from "./commands/packs-new.js";
|
|
19
|
+
import { presetsListCommand, presetsGetCommand, presetsExplainCommand, presetsRecommendCommand, presetsPreviewCommand, presetsApplyCommand, presetsDoctorCommand, presetsDiffCommand, presetsPatchCommand, } from "./commands/presets.command.js";
|
|
20
|
+
import { taskCommand } from "./commands/task.command.js";
|
|
21
|
+
import { preflightCommand } from "./commands/preflight.command.js";
|
|
22
|
+
import { checkCommand } from "./commands/check.command.js";
|
|
23
|
+
import { driftCommand } from "./commands/drift.command.js";
|
|
24
|
+
import { graphCommand } from "./commands/graph.command.js";
|
|
25
|
+
import { coverageCommand } from "./commands/coverage.command.js";
|
|
26
|
+
import { statsCommand } from "./commands/stats.command.js";
|
|
27
|
+
import { reviewCommand } from "./commands/review.command.js";
|
|
28
|
+
import { onboardCommand } from "./commands/onboard.command.js";
|
|
29
|
+
import { contradictionsCommand, generatedCommand, ingestCommand, } from "./commands/ingest.command.js";
|
|
30
|
+
import { contextBuildCommand, contextRefreshCommand, contextStatusCommand, understandTaskCommand, validateChangeCommand, } from "./commands/task-context.command.js";
|
|
31
|
+
import { testCommand } from "./commands/test.command.js";
|
|
32
|
+
import { planParentCommand, planReviewCommand } from "./commands/plan.command.js";
|
|
33
|
+
import { devCommand } from "./commands/dev.command.js";
|
|
34
|
+
import { explainCommand, } from "./commands/daily.commands.js";
|
|
35
|
+
import { schemasListCommand, schemasGetCommand, schemasInventoryCommand, schemasWriteCommand, schemasEmitCommand, } from "./commands/schemas.command.js";
|
|
36
|
+
import { contextCommand } from "./commands/context.command.js";
|
|
37
|
+
import { diffParentCommand, diffRoundsCommand, roundsCaptureCommand, roundsListCommand, roundsParentCommand, roundsShowCommand, } from "./commands/rounds.command.js";
|
|
38
|
+
import { genCommand } from "./commands/gen.command.js";
|
|
39
|
+
import { applyCommand } from "./commands/apply.command.js";
|
|
40
|
+
import { groundingCommand } from "./commands/grounding.command.js";
|
|
41
|
+
import { planCheckCommand } from "./commands/plan-check.command.js";
|
|
42
|
+
import { whyCommand } from "./commands/why.command.js";
|
|
43
|
+
import { specParentCommand, specCreateCommand, specReviewCommand, specImplementCommand, specVerifyCommand, specListCommand, specShowCommand, specStatusCommand, specLintCommand, } from "./commands/spec.command.js";
|
|
44
|
+
import { exportCommand } from "./commands/export.command.js";
|
|
45
|
+
import { dashboardCommand } from "./commands/dashboard.command.js";
|
|
46
|
+
import { dashboardDiffCommand, dashboardExportCommand, } from "./commands/dashboard-export.command.js";
|
|
47
|
+
import { importCommand } from "./commands/import.command.js";
|
|
48
|
+
import { askCommand } from "./commands/ask.command.js";
|
|
49
|
+
import { mcpCommand } from "./commands/mcp.command.js";
|
|
50
|
+
import { versionCommand } from "./commands/version.command.js";
|
|
51
|
+
import { makeHelpCommand } from "./commands/help.command.js";
|
|
52
|
+
import { qualityCommand } from "./commands/quality.command.js";
|
|
53
|
+
import { ciCommand } from "./commands/ci.command.js";
|
|
54
|
+
import { eslintCommand } from "./commands/eslint.command.js";
|
|
55
|
+
import { biomeCommand } from "./commands/biome.command.js";
|
|
56
|
+
import { ideCommand } from "./commands/ide.command.js";
|
|
57
|
+
import { makeCommandsCommand } from "./commands/commands.command.js";
|
|
58
|
+
import { safetyCommand } from "./commands/safety.command.js";
|
|
59
|
+
import { pluginCommand } from "./commands/plugin.command.js";
|
|
60
|
+
import { profilesCommand } from "./commands/profiles.command.js";
|
|
61
|
+
import { auditProjectCouplingCommand } from "./commands/audit.command.js";
|
|
62
|
+
import { conventionsCommand } from "./commands/conventions.command.js";
|
|
63
|
+
import { selfConfigCommand } from "./commands/self-config.command.js";
|
|
64
|
+
import { helperCommand } from "./commands/helper.command.js";
|
|
65
|
+
import { registryCommand } from "./commands/registry.command.js";
|
|
66
|
+
import { registrationsCommand } from "./commands/registrations.command.js";
|
|
67
|
+
import { boundariesListCommand, boundariesGetCommand, boundariesExplainCommand, boundariesInferCommand, } from "./commands/boundaries.command.js";
|
|
68
|
+
import { scaffoldsListCommand, scaffoldsGetCommand, scaffoldsDoctorCommand, } from "./commands/scaffolds.command.js";
|
|
69
|
+
import { inferCommand } from "./commands/infer.command.js";
|
|
70
|
+
import { reportCommand } from "./commands/report.command.js";
|
|
71
|
+
import { bundleCommand } from "./commands/bundle.command.js";
|
|
72
|
+
import { impactCommand } from "./commands/impact.command.js";
|
|
73
|
+
import { traceCommand } from "./commands/trace.command.js";
|
|
74
|
+
import { feedbackCommand } from "./commands/feedback-dispatch.command.js";
|
|
75
|
+
import { searchCommand } from "./commands/search.command.js";
|
|
76
|
+
import { briefCommand } from "./commands/brief.command.js";
|
|
77
|
+
import { releaseCommand, installSmokeCommand } from "./commands/release.command.js";
|
|
78
|
+
import { startHereCommand } from "./commands/start-here.command.js";
|
|
79
|
+
import { docsCheckCommand, examplesCheckCommand } from "./commands/docs.command.js";
|
|
80
|
+
import { selfAuditCommand } from "./commands/self.command.js";
|
|
81
|
+
import { diagnosticsListCommand } from "./commands/diagnostics.command.js";
|
|
82
|
+
import { architectureMapCommand } from "./commands/architecture.command.js";
|
|
83
|
+
import { orchestrateCommand } from "./commands/orchestrate.command.js";
|
|
84
|
+
import { simulateCommand } from "./commands/simulate.command.js";
|
|
85
|
+
import { reposetInitCommand, reposetListCommand, reposetDoctorCommand, reposetMapCommand, } from "./commands/reposet.command.js";
|
|
86
|
+
import { recommendCommand } from "./commands/recommend.command.js";
|
|
87
|
+
import { surfaceCommand } from "./commands/surface.command.js";
|
|
88
|
+
import { upgradeCheckCommand, upgradePlanCommand } from "./commands/upgrade.command.js";
|
|
89
|
+
import { architectureViolationsCommand, architectureAreaCommand, } from "./commands/architecture.command.js";
|
|
90
|
+
import { riskCommand } from "./commands/risk.command.js";
|
|
91
|
+
import { contractCommand } from "./commands/contract.command.js";
|
|
92
|
+
import { contractApproveCommand, contractCheckCommand, contractStatusCommand, } from "./commands/contract-gate.command.js";
|
|
93
|
+
import { planSimulateCommand } from "./commands/plan-simulate.command.js";
|
|
94
|
+
import { memoryBuildCommand, memoryDiagnosticsCommand, memoryDiffCommand, memoryDriftCommand, memoryFilesCommand, memoryReportCommand, memoryResetCommand, memoryRiskCommand, memorySnapshotsCommand, } from "./commands/memory.command.js";
|
|
95
|
+
import { constructsAdoptCommand, constructsApiCommand, constructsEventsCommand, constructsFacetsCommand, constructsFilesCommand, constructsGetCommand, constructsImpactCommand, constructsInferCommand, constructsListCommand, constructsRelatedCommand, constructsSearchCommand, constructsTokensCommand, constructsTraceCommand, } from "./commands/constructs.command.js";
|
|
96
|
+
import { playbooksBriefCommand, playbooksGetCommand, playbooksListCommand, playbooksPreviewCommand, playbooksRecommendCommand, playbooksRunbookCommand, playbooksScriptCommand, playbooksValidateCommand, } from "./commands/playbooks.command.js";
|
|
97
|
+
import { repoAreasCommand } from "./commands/repo.command.js";
|
|
98
|
+
import { policyCheckCommand, policyListCommand, policyGetCommand, policySnapshotCommand, policyTestCommand, policyRunCommand, } from "./commands/policy.command.js";
|
|
99
|
+
import { ownersListCommand, ownersMatchCommand, ownersImpactCommand } from "./commands/owners.command.js";
|
|
100
|
+
import { ownershipListCommand, ownershipForCommand, ownershipAffectedCommand, } from "./commands/ownership.command.js";
|
|
101
|
+
import { runtimeDoctorCommand } from "./commands/runtime.command.js";
|
|
102
|
+
import { testsImpactCommand, testsSuggestCommand, testsMissingCommand } from "./commands/tests.command.js";
|
|
103
|
+
import { gitChangedCommand, gitRootCommand, gitBranchCommand, gitStatusSummaryCommand, } from "./commands/git.command.js";
|
|
104
|
+
import { templatesLintCommand, templatesTestCommand, templatesSnapshotCommand, } from "./commands/template-quality.command.js";
|
|
105
|
+
import { boundariesEnforceCommand, boundariesSuggestCommand } from "./commands/boundaries.command.js";
|
|
106
|
+
import { languagesCommand } from "./commands/languages.command.js";
|
|
107
|
+
import { fixCommand } from "./commands/fix.command.js";
|
|
108
|
+
// unified lint aggregator.
|
|
109
|
+
import { lintCommand } from "./commands/lint.command.js";
|
|
110
|
+
import { changesCommand } from "./commands/changes.command.js";
|
|
111
|
+
import { exploreCommand } from "./commands/explore.command.js";
|
|
112
|
+
import { prCommand } from "./commands/pr.command.js";
|
|
113
|
+
import { suggestDidYouMean } from '@shrkcrft/inspector';
|
|
114
|
+
import { COMMAND_CATALOG } from "./commands/command-catalog.js";
|
|
115
|
+
import { errorFooterFor, renderErrorFooter } from "./output/failure-hints.js";
|
|
116
|
+
import { renderAbout } from "./surface/about.js";
|
|
117
|
+
import { renderNoArgsLanding } from "./surface/no-args-landing.js";
|
|
118
|
+
import { loadSurfaceContext } from "./surface/load-surface-context.js";
|
|
119
|
+
import { buildSurfaceSummary, findCommandInSummary } from "./surface/surface-summary.js";
|
|
120
|
+
import { makeSurfaceNotEnabledError, renderSurfaceNotEnabledText, SURFACE_NOT_ENABLED_EXIT_CODE, } from "./surface/not-enabled-error.js";
|
|
121
|
+
import { extractCommandPath, recordUsage, sanitizeFlagNames, } from "./usage/usage-log.js";
|
|
122
|
+
import { loadProjectConfig } from '@shrkcrft/config';
|
|
123
|
+
export function buildRegistry() {
|
|
124
|
+
const registry = new CommandRegistry();
|
|
125
|
+
registry.register(initCommand);
|
|
126
|
+
registry.register(inspectCommand);
|
|
127
|
+
registry.register(doctorCommand);
|
|
128
|
+
registry.registerSubcommand('doctor', doctorSuppressCommand);
|
|
129
|
+
registry.registerSubcommand('doctor', doctorSuppressionsCommand);
|
|
130
|
+
// Acknowledgements with required reason + expiry.
|
|
131
|
+
registry.registerSubcommand('doctor', doctorAcknowledgeCommand);
|
|
132
|
+
registry.registerSubcommand('doctor', doctorAcknowledgementsCommand);
|
|
133
|
+
registry.register(contextCommand);
|
|
134
|
+
registry.register(genCommand);
|
|
135
|
+
registry.register(applyCommand);
|
|
136
|
+
// `shrk grounding` thin context primer.
|
|
137
|
+
registry.register(groundingCommand);
|
|
138
|
+
// feedback3 — `shrk why <file>` (closes the dangling ide-suggested verb).
|
|
139
|
+
registry.register(whyCommand);
|
|
140
|
+
// spec verb + subcommands.
|
|
141
|
+
registry.register(specParentCommand);
|
|
142
|
+
registry.registerSubcommand('spec', specCreateCommand);
|
|
143
|
+
registry.registerSubcommand('spec', specReviewCommand);
|
|
144
|
+
registry.registerSubcommand('spec', specImplementCommand);
|
|
145
|
+
registry.registerSubcommand('spec', specVerifyCommand);
|
|
146
|
+
registry.registerSubcommand('spec', specListCommand);
|
|
147
|
+
registry.registerSubcommand('spec', specShowCommand);
|
|
148
|
+
registry.registerSubcommand('spec', specStatusCommand);
|
|
149
|
+
registry.registerSubcommand('spec', specLintCommand);
|
|
150
|
+
// rounds capture + diff.
|
|
151
|
+
registry.register(roundsParentCommand);
|
|
152
|
+
registry.registerSubcommand('rounds', roundsCaptureCommand);
|
|
153
|
+
registry.registerSubcommand('rounds', roundsListCommand);
|
|
154
|
+
registry.registerSubcommand('rounds', roundsShowCommand);
|
|
155
|
+
registry.register(diffParentCommand);
|
|
156
|
+
registry.registerSubcommand('diff', diffRoundsCommand);
|
|
157
|
+
registry.register(exportCommand);
|
|
158
|
+
registry.register(dashboardCommand);
|
|
159
|
+
registry.registerSubcommand('dashboard', dashboardExportCommand);
|
|
160
|
+
registry.registerSubcommand('dashboard', dashboardDiffCommand);
|
|
161
|
+
registry.register(importCommand);
|
|
162
|
+
registry.register(taskCommand);
|
|
163
|
+
registry.register(explainCommand);
|
|
164
|
+
registry.register(checkCommand);
|
|
165
|
+
// changed-only preflight orchestrator.
|
|
166
|
+
registry.register(preflightCommand);
|
|
167
|
+
registry.register(driftCommand);
|
|
168
|
+
registry.register(graphCommand);
|
|
169
|
+
registry.register(coverageCommand);
|
|
170
|
+
registry.register(statsCommand);
|
|
171
|
+
registry.register(reviewCommand);
|
|
172
|
+
registry.register(onboardCommand);
|
|
173
|
+
registry.register(ingestCommand);
|
|
174
|
+
registry.register(contradictionsCommand);
|
|
175
|
+
registry.register(generatedCommand);
|
|
176
|
+
registry.register(understandTaskCommand);
|
|
177
|
+
registry.register(validateChangeCommand);
|
|
178
|
+
// contextBuildCommand / contextRefreshCommand / contextStatusCommand are
|
|
179
|
+
// dispatched from inside contextCommand based on the first positional arg
|
|
180
|
+
// (avoids breaking `shrk context --task "..."` flat usage).
|
|
181
|
+
void contextBuildCommand;
|
|
182
|
+
void contextRefreshCommand;
|
|
183
|
+
void contextStatusCommand;
|
|
184
|
+
registry.register(testCommand);
|
|
185
|
+
registry.register(planParentCommand);
|
|
186
|
+
registry.register(devCommand);
|
|
187
|
+
registry.register(askCommand);
|
|
188
|
+
registry.register(mcpCommand);
|
|
189
|
+
registry.register(versionCommand);
|
|
190
|
+
registry.register(qualityCommand);
|
|
191
|
+
registry.register(ciCommand);
|
|
192
|
+
registry.register(eslintCommand);
|
|
193
|
+
registry.register(biomeCommand);
|
|
194
|
+
registry.register(ideCommand);
|
|
195
|
+
registry.register(pluginCommand);
|
|
196
|
+
registry.register(profilesCommand);
|
|
197
|
+
registry.registerSubcommand('audit', auditProjectCouplingCommand);
|
|
198
|
+
registry.register(conventionsCommand);
|
|
199
|
+
registry.register(selfConfigCommand);
|
|
200
|
+
registry.register(helperCommand);
|
|
201
|
+
registry.register(registryCommand);
|
|
202
|
+
registry.register(registrationsCommand);
|
|
203
|
+
registry.register(makeCommandsCommand(registry));
|
|
204
|
+
registry.register(safetyCommand);
|
|
205
|
+
registry.register(inferCommand);
|
|
206
|
+
registry.register(reportCommand);
|
|
207
|
+
registry.register(bundleCommand);
|
|
208
|
+
registry.register(impactCommand);
|
|
209
|
+
registry.register(traceCommand);
|
|
210
|
+
registry.register(feedbackCommand);
|
|
211
|
+
registry.register(fixCommand);
|
|
212
|
+
// unified lint verb (knowledge / rules / templates aggregator).
|
|
213
|
+
registry.register(lintCommand);
|
|
214
|
+
registry.register(changesCommand);
|
|
215
|
+
registry.register(prCommand);
|
|
216
|
+
registry.register(searchCommand);
|
|
217
|
+
registry.register(briefCommand);
|
|
218
|
+
registry.register(releaseCommand);
|
|
219
|
+
registry.register(startHereCommand);
|
|
220
|
+
registry.register(exploreCommand);
|
|
221
|
+
registry.register(orchestrateCommand);
|
|
222
|
+
registry.register(simulateCommand);
|
|
223
|
+
registry.register(recommendCommand);
|
|
224
|
+
// Adaptive surface introspection + management.
|
|
225
|
+
registry.register(surfaceCommand);
|
|
226
|
+
registry.register(riskCommand);
|
|
227
|
+
registry.register(contractCommand);
|
|
228
|
+
// contract gates — dispatched from inside contractCommand when the
|
|
229
|
+
// first positional is check/approve/status (avoids subcommand-routing
|
|
230
|
+
// collision with the task-string form `shrk contract "<task>"`).
|
|
231
|
+
void contractCheckCommand;
|
|
232
|
+
void contractApproveCommand;
|
|
233
|
+
void contractStatusCommand;
|
|
234
|
+
registry.registerSubcommand('plan', planSimulateCommand);
|
|
235
|
+
// register `plan review` as a proper subcommand so the catalog
|
|
236
|
+
// and registry agree. The internal dispatch in planParentCommand still
|
|
237
|
+
// works (acts as a fallback for direct invocation), but the canonical
|
|
238
|
+
// wire-up is now explicit.
|
|
239
|
+
registry.registerSubcommand('plan', planReviewCommand);
|
|
240
|
+
// `shrk plan check <path>` validates external plans.
|
|
241
|
+
registry.registerSubcommand('plan', planCheckCommand);
|
|
242
|
+
registry.registerSubcommand('memory', memoryBuildCommand);
|
|
243
|
+
registry.registerSubcommand('memory', memoryReportCommand);
|
|
244
|
+
registry.registerSubcommand('memory', memoryRiskCommand);
|
|
245
|
+
registry.registerSubcommand('memory', memoryFilesCommand);
|
|
246
|
+
registry.registerSubcommand('memory', memoryDiagnosticsCommand);
|
|
247
|
+
registry.registerSubcommand('memory', memoryResetCommand);
|
|
248
|
+
registry.registerSubcommand('memory', memoryDiffCommand);
|
|
249
|
+
registry.registerSubcommand('memory', memoryDriftCommand);
|
|
250
|
+
registry.registerSubcommand('memory', memorySnapshotsCommand);
|
|
251
|
+
registry.register(languagesCommand);
|
|
252
|
+
registry.registerSubcommand('docs', docsCheckCommand);
|
|
253
|
+
registry.registerSubcommand('examples', examplesCheckCommand);
|
|
254
|
+
registry.registerSubcommand('self', selfAuditCommand);
|
|
255
|
+
registry.registerSubcommand('install', installSmokeCommand);
|
|
256
|
+
registry.registerSubcommand('diagnostics', diagnosticsListCommand);
|
|
257
|
+
registry.registerSubcommand('architecture', architectureMapCommand);
|
|
258
|
+
registry.registerSubcommand('architecture', architectureViolationsCommand);
|
|
259
|
+
registry.registerSubcommand('architecture', architectureAreaCommand);
|
|
260
|
+
registry.registerSubcommand('reposet', reposetInitCommand);
|
|
261
|
+
registry.registerSubcommand('reposet', reposetListCommand);
|
|
262
|
+
registry.registerSubcommand('reposet', reposetDoctorCommand);
|
|
263
|
+
registry.registerSubcommand('reposet', reposetMapCommand);
|
|
264
|
+
registry.registerSubcommand('upgrade', upgradeCheckCommand);
|
|
265
|
+
registry.registerSubcommand('upgrade', upgradePlanCommand);
|
|
266
|
+
registry.registerSubcommand('boundaries', boundariesListCommand);
|
|
267
|
+
registry.registerSubcommand('boundaries', boundariesGetCommand);
|
|
268
|
+
registry.registerSubcommand('boundaries', boundariesExplainCommand);
|
|
269
|
+
registry.registerSubcommand('boundaries', boundariesInferCommand);
|
|
270
|
+
registry.registerSubcommand('boundaries', boundariesSuggestCommand);
|
|
271
|
+
registry.registerSubcommand('boundaries', boundariesEnforceCommand);
|
|
272
|
+
registry.registerSubcommand('repo', repoAreasCommand);
|
|
273
|
+
registry.registerSubcommand('policy', policyListCommand);
|
|
274
|
+
registry.registerSubcommand('policy', policyGetCommand);
|
|
275
|
+
registry.registerSubcommand('policy', policyTestCommand);
|
|
276
|
+
registry.registerSubcommand('policy', policyRunCommand);
|
|
277
|
+
registry.registerSubcommand('policy', policyCheckCommand);
|
|
278
|
+
registry.registerSubcommand('policy', policySnapshotCommand);
|
|
279
|
+
registry.registerSubcommand('owners', ownersListCommand);
|
|
280
|
+
registry.registerSubcommand('owners', ownersMatchCommand);
|
|
281
|
+
registry.registerSubcommand('owners', ownersImpactCommand);
|
|
282
|
+
registry.registerSubcommand('ownership', ownershipListCommand);
|
|
283
|
+
registry.registerSubcommand('ownership', ownershipForCommand);
|
|
284
|
+
registry.registerSubcommand('ownership', ownershipAffectedCommand);
|
|
285
|
+
registry.registerSubcommand('runtime', runtimeDoctorCommand);
|
|
286
|
+
registry.registerSubcommand('constructs', constructsListCommand);
|
|
287
|
+
registry.registerSubcommand('constructs', constructsGetCommand);
|
|
288
|
+
registry.registerSubcommand('constructs', constructsTraceCommand);
|
|
289
|
+
registry.registerSubcommand('constructs', constructsApiCommand);
|
|
290
|
+
registry.registerSubcommand('constructs', constructsEventsCommand);
|
|
291
|
+
registry.registerSubcommand('constructs', constructsTokensCommand);
|
|
292
|
+
registry.registerSubcommand('constructs', constructsFacetsCommand);
|
|
293
|
+
registry.registerSubcommand('constructs', constructsSearchCommand);
|
|
294
|
+
registry.registerSubcommand('constructs', constructsInferCommand);
|
|
295
|
+
registry.registerSubcommand('constructs', constructsAdoptCommand);
|
|
296
|
+
registry.registerSubcommand('constructs', constructsImpactCommand);
|
|
297
|
+
registry.registerSubcommand('constructs', constructsRelatedCommand);
|
|
298
|
+
registry.registerSubcommand('constructs', constructsFilesCommand);
|
|
299
|
+
registry.registerSubcommand('playbooks', playbooksListCommand);
|
|
300
|
+
registry.registerSubcommand('playbooks', playbooksGetCommand);
|
|
301
|
+
registry.registerSubcommand('playbooks', playbooksRecommendCommand);
|
|
302
|
+
registry.registerSubcommand('playbooks', playbooksRunbookCommand);
|
|
303
|
+
registry.registerSubcommand('playbooks', playbooksBriefCommand);
|
|
304
|
+
registry.registerSubcommand('playbooks', playbooksScriptCommand);
|
|
305
|
+
registry.registerSubcommand('playbooks', playbooksPreviewCommand);
|
|
306
|
+
registry.registerSubcommand('playbooks', playbooksValidateCommand);
|
|
307
|
+
registry.aliasGroup('construct', 'constructs');
|
|
308
|
+
registry.aliasGroup('playbook', 'playbooks');
|
|
309
|
+
registry.registerSubcommand('tests', testsImpactCommand);
|
|
310
|
+
registry.registerSubcommand('tests', testsSuggestCommand);
|
|
311
|
+
registry.registerSubcommand('tests', testsMissingCommand);
|
|
312
|
+
registry.registerSubcommand('git', gitChangedCommand);
|
|
313
|
+
registry.registerSubcommand('git', gitRootCommand);
|
|
314
|
+
registry.registerSubcommand('git', gitBranchCommand);
|
|
315
|
+
registry.registerSubcommand('git', gitStatusSummaryCommand);
|
|
316
|
+
registry.registerSubcommand('templates', templatesLintCommand);
|
|
317
|
+
registry.registerSubcommand('templates', templatesTestCommand);
|
|
318
|
+
registry.registerSubcommand('templates', templatesSnapshotCommand);
|
|
319
|
+
registry.registerSubcommand('knowledge', knowledgeListCommand);
|
|
320
|
+
registry.registerSubcommand('knowledge', knowledgeGetCommand);
|
|
321
|
+
registry.registerSubcommand('knowledge', knowledgeSearchCommand);
|
|
322
|
+
registry.registerSubcommand('knowledge', knowledgeStaleCheckCommand);
|
|
323
|
+
registry.registerSubcommand('knowledge', knowledgeVerifyCommand);
|
|
324
|
+
registry.registerSubcommand('knowledge', knowledgeReferencesCommand);
|
|
325
|
+
registry.registerSubcommand('knowledge', knowledgeAnchorsCommand);
|
|
326
|
+
registry.registerSubcommand('knowledge', knowledgeRenameSymbolCommand);
|
|
327
|
+
registry.registerSubcommand('knowledge', knowledgeRenameFileCommand);
|
|
328
|
+
registry.registerSubcommand('knowledge', knowledgeUpdateAnchorCommand);
|
|
329
|
+
// knowledge authoring preview surface.
|
|
330
|
+
registry.registerSubcommand('knowledge', knowledgeAddCommand);
|
|
331
|
+
registry.registerSubcommand('knowledge', knowledgeUpdateCommand);
|
|
332
|
+
registry.registerSubcommand('knowledge', knowledgeRemoveCommand);
|
|
333
|
+
registry.registerSubcommand('knowledge', knowledgeLintCommand);
|
|
334
|
+
// propose stub entries for uncovered exports (AST-driven).
|
|
335
|
+
registry.registerSubcommand('knowledge', knowledgeProposeCommand);
|
|
336
|
+
registry.registerSubcommand('rules', rulesListCommand);
|
|
337
|
+
registry.registerSubcommand('rules', rulesGetCommand);
|
|
338
|
+
registry.registerSubcommand('rules', rulesRelevantCommand);
|
|
339
|
+
registry.registerSubcommand('rules', rulesScaffoldCommand);
|
|
340
|
+
// `rules update` thin wrapper over knowledge update.
|
|
341
|
+
registry.registerSubcommand('rules', rulesUpdateCommand);
|
|
342
|
+
// authoring symmetry: rules add / rules remove (parity with knowledge).
|
|
343
|
+
registry.registerSubcommand('rules', rulesAddCommand);
|
|
344
|
+
registry.registerSubcommand('rules', rulesRemoveCommand);
|
|
345
|
+
registry.registerSubcommand('rules', rulesDoctorCommand);
|
|
346
|
+
registry.registerSubcommand('rules', rulesLintCommand);
|
|
347
|
+
// custom checks registry.
|
|
348
|
+
registry.registerSubcommand('checks', checksListCommand);
|
|
349
|
+
registry.registerSubcommand('checks', checksDoctorCommand);
|
|
350
|
+
registry.registerSubcommand('checks', checksRunCommand);
|
|
351
|
+
registry.registerSubcommand('checks', checksParseReportCommand);
|
|
352
|
+
// universal check-result protocol.
|
|
353
|
+
registry.registerSubcommand('checks', checksImportCommand);
|
|
354
|
+
registry.registerSubcommand('checks', checksAggregateCommand);
|
|
355
|
+
registry.registerSubcommand('checks', checksReportCommand);
|
|
356
|
+
registry.registerSubcommand('checks', checksConvertCommand);
|
|
357
|
+
// codemod-assist (NOT a codemod engine).
|
|
358
|
+
registry.register(codemodCommand);
|
|
359
|
+
registry.registerSubcommand('paths', pathsListCommand);
|
|
360
|
+
registry.registerSubcommand('paths', pathsGetCommand);
|
|
361
|
+
registry.registerSubcommand('paths', pathsSearchCommand);
|
|
362
|
+
registry.registerSubcommand('paths', pathsBestCommand);
|
|
363
|
+
registry.registerSubcommand('templates', templatesListCommand);
|
|
364
|
+
registry.registerSubcommand('templates', templatesGetCommand);
|
|
365
|
+
registry.registerSubcommand('templates', templatesSearchCommand);
|
|
366
|
+
registry.registerSubcommand('templates', templatesPreviewCommand);
|
|
367
|
+
registry.registerSubcommand('templates', templatesVarsCommand);
|
|
368
|
+
registry.registerSubcommand('templates', templatesDriftCommand);
|
|
369
|
+
registry.registerSubcommand('templates', templatesVerifyPathsCommand);
|
|
370
|
+
registry.registerSubcommand('templates', templatesSmokeCommand);
|
|
371
|
+
// authoring stack: scaffold / add / doctor.
|
|
372
|
+
registry.registerSubcommand('templates', templatesScaffoldCommand);
|
|
373
|
+
registry.registerSubcommand('templates', templatesAddCommand);
|
|
374
|
+
registry.registerSubcommand('templates', templatesDoctorCommand);
|
|
375
|
+
// authoring parity: update / remove.
|
|
376
|
+
registry.registerSubcommand('templates', templatesUpdateCommand);
|
|
377
|
+
registry.registerSubcommand('templates', templatesRemoveCommand);
|
|
378
|
+
registry.registerSubcommand('pipelines', pipelinesListCommand);
|
|
379
|
+
registry.registerSubcommand('pipelines', pipelinesGetCommand);
|
|
380
|
+
registry.registerSubcommand('pipelines', pipelinesContextCommand);
|
|
381
|
+
registry.registerSubcommand('pipelines', pipelinesPlanCommand);
|
|
382
|
+
registry.registerSubcommand('pipelines', pipelinesScriptCommand);
|
|
383
|
+
registry.registerSubcommand('pipelines', pipelinesNextCommand);
|
|
384
|
+
registry.registerSubcommand('pipelines', pipelinesVarsCommand);
|
|
385
|
+
registry.registerSubcommand('packs', packsListCommand);
|
|
386
|
+
registry.registerSubcommand('packs', packsContributionsCommand);
|
|
387
|
+
registry.registerSubcommand('packs', packsConflictsCommand);
|
|
388
|
+
registry.registerSubcommand('packs', packsSignatureStatusCommand);
|
|
389
|
+
registry.registerSubcommand('packs', packsGetCommand);
|
|
390
|
+
registry.registerSubcommand('packs', packsInspectCommand);
|
|
391
|
+
registry.registerSubcommand('packs', packsDoctorCommand);
|
|
392
|
+
registry.registerSubcommand('packs', packsSignCommand);
|
|
393
|
+
registry.registerSubcommand('packs', packsVerifyCommand);
|
|
394
|
+
registry.registerSubcommand('packs', packsNewCommand);
|
|
395
|
+
registry.registerSubcommand('packs', packsTestCommand);
|
|
396
|
+
registry.registerSubcommand('packs', packsReleaseCheckCommand);
|
|
397
|
+
registry.registerSubcommand('packs', packsCompatCommand);
|
|
398
|
+
registry.registerSubcommand('packs', packsDevStatusCommand);
|
|
399
|
+
registry.registerSubcommand('packs', packsWatchCommand);
|
|
400
|
+
// pack authoring moved to a 3-level group: `shrk pack author <verb>`.
|
|
401
|
+
// The old `pack-author <verb>` shape is gone (no backward-compat shim).
|
|
402
|
+
// `shrk packs pending` survives as a convenience for the pending view.
|
|
403
|
+
registry.registerAt(['pack', 'author', packAuthorStatusCommand.name], packAuthorStatusCommand);
|
|
404
|
+
registry.registerAt(['pack', 'author', packAuthorPreviewCommand.name], packAuthorPreviewCommand);
|
|
405
|
+
registry.registerAt(['pack', 'author', packAuthorPendingCommand.name], packAuthorPendingCommand);
|
|
406
|
+
registry.registerAt(['pack', 'author', packAuthorValidateCommand.name], packAuthorValidateCommand);
|
|
407
|
+
registry.registerSubcommand('packs', packAuthorPendingCommand);
|
|
408
|
+
// provenance ledger CLI.
|
|
409
|
+
registry.registerSubcommand('provenance', provenanceListCommand);
|
|
410
|
+
registry.registerSubcommand('provenance', provenanceShowCommand);
|
|
411
|
+
registry.registerSubcommand('provenance', provenanceReportCommand);
|
|
412
|
+
// missing / doctor verbs.
|
|
413
|
+
registry.registerSubcommand('provenance', provenanceMissingCommand);
|
|
414
|
+
registry.registerSubcommand('provenance', provenanceDoctorCommand);
|
|
415
|
+
registry.registerSubcommand('schemas', schemasListCommand);
|
|
416
|
+
registry.registerSubcommand('schemas', schemasGetCommand);
|
|
417
|
+
registry.registerSubcommand('schemas', schemasInventoryCommand);
|
|
418
|
+
registry.registerSubcommand('schemas', schemasWriteCommand);
|
|
419
|
+
// preview-first emission + preflight drift check.
|
|
420
|
+
registry.registerSubcommand('schemas', schemasEmitCommand);
|
|
421
|
+
registry.registerSubcommand('scaffolds', scaffoldsListCommand);
|
|
422
|
+
registry.registerSubcommand('scaffolds', scaffoldsGetCommand);
|
|
423
|
+
registry.registerSubcommand('scaffolds', scaffoldsDoctorCommand);
|
|
424
|
+
registry.registerSubcommand('presets', presetsListCommand);
|
|
425
|
+
registry.registerSubcommand('presets', presetsGetCommand);
|
|
426
|
+
registry.registerSubcommand('presets', presetsExplainCommand);
|
|
427
|
+
registry.registerSubcommand('presets', presetsRecommendCommand);
|
|
428
|
+
registry.registerSubcommand('presets', presetsPreviewCommand);
|
|
429
|
+
registry.registerSubcommand('presets', presetsApplyCommand);
|
|
430
|
+
registry.registerSubcommand('presets', presetsDoctorCommand);
|
|
431
|
+
registry.registerSubcommand('presets', presetsDiffCommand);
|
|
432
|
+
registry.registerSubcommand('presets', presetsPatchCommand);
|
|
433
|
+
// release subcommand additions — register under 'release' group via 'train'.
|
|
434
|
+
// We pass 'train' as the canonical name; users invoke `shrk release train <verb>`.
|
|
435
|
+
// Convenience aliases so users can say either form.
|
|
436
|
+
registry.aliasGroup('pipeline', 'pipelines');
|
|
437
|
+
registry.aliasGroup('schema', 'schemas');
|
|
438
|
+
registry.aliasGroup('preset', 'presets');
|
|
439
|
+
registry.aliasGroup('scaffold', 'scaffolds');
|
|
440
|
+
const help = makeHelpCommand(registry);
|
|
441
|
+
registry.register(help);
|
|
442
|
+
return registry;
|
|
443
|
+
}
|
|
444
|
+
export async function runCli(argv) {
|
|
445
|
+
const usageStart = performance.now();
|
|
446
|
+
const { cwd: probeCwd, rest: probeArgv } = extractGlobalCwd(argv);
|
|
447
|
+
let exitCode = 0;
|
|
448
|
+
try {
|
|
449
|
+
exitCode = await runCliInner(argv);
|
|
450
|
+
return exitCode;
|
|
451
|
+
}
|
|
452
|
+
finally {
|
|
453
|
+
// append one local usage entry. Failure is silent.
|
|
454
|
+
try {
|
|
455
|
+
const command = extractCommandPath(probeArgv);
|
|
456
|
+
if (command.length > 0) {
|
|
457
|
+
const flags = sanitizeFlagNames(probeArgv);
|
|
458
|
+
const enabled = await isUsageEnabled(probeCwd ?? process.cwd());
|
|
459
|
+
recordUsage({
|
|
460
|
+
cwd: probeCwd ?? process.cwd(),
|
|
461
|
+
command,
|
|
462
|
+
exitCode,
|
|
463
|
+
durationMs: performance.now() - usageStart,
|
|
464
|
+
flags,
|
|
465
|
+
enabled,
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
catch {
|
|
470
|
+
// ignore — usage log must never fail the CLI
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* Resolve whether the local usage log is enabled. Order:
|
|
476
|
+
* 1. `SHARKCRAFT_USAGE_DISABLED=1` env → false (disabled).
|
|
477
|
+
* 2. `sharkcraft.config.ts usage.enabled === false` → false.
|
|
478
|
+
* 3. Otherwise → true.
|
|
479
|
+
*/
|
|
480
|
+
async function isUsageEnabled(cwd) {
|
|
481
|
+
if (process.env.SHARKCRAFT_USAGE_DISABLED === '1')
|
|
482
|
+
return false;
|
|
483
|
+
try {
|
|
484
|
+
const result = await loadProjectConfig(cwd);
|
|
485
|
+
if (!result.ok)
|
|
486
|
+
return true;
|
|
487
|
+
return result.value.config.usage?.enabled !== false;
|
|
488
|
+
}
|
|
489
|
+
catch {
|
|
490
|
+
return true;
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
async function runCliInner(argv) {
|
|
494
|
+
const registry = buildRegistry();
|
|
495
|
+
// Pre-parse the global --cwd so it can appear anywhere (incl. before the command).
|
|
496
|
+
const { cwd: globalCwd, rest: cleanArgv } = extractGlobalCwd(argv);
|
|
497
|
+
const [first] = cleanArgv;
|
|
498
|
+
// bare invocation lands on the curated tiered view.
|
|
499
|
+
if (!first) {
|
|
500
|
+
const landing = await renderNoArgsLanding(globalCwd ?? process.cwd());
|
|
501
|
+
process.stdout.write(landing);
|
|
502
|
+
return 0;
|
|
503
|
+
}
|
|
504
|
+
// Top-level meta flags.
|
|
505
|
+
if (first === '--help' || first === '-h') {
|
|
506
|
+
return registry.get('help').run(parseArgs([], { globalCwd }));
|
|
507
|
+
}
|
|
508
|
+
if (first === '--full-help') {
|
|
509
|
+
return registry.get('help').run(parseArgs(['--full'], { globalCwd }));
|
|
510
|
+
}
|
|
511
|
+
if (first === '--version' || first === '-v') {
|
|
512
|
+
return registry.get('version').run(parseArgs([], { globalCwd }));
|
|
513
|
+
}
|
|
514
|
+
// `shrk --about` prints the in-binary philosophy summary.
|
|
515
|
+
if (first === '--about') {
|
|
516
|
+
process.stdout.write(renderAbout());
|
|
517
|
+
return 0;
|
|
518
|
+
}
|
|
519
|
+
// greedy trie descent. Handles 1-, 2-, and 3-level commands uniformly
|
|
520
|
+
// (`shrk doctor`, `shrk packs list`, `shrk pack author status`). The
|
|
521
|
+
// resolver stops when it hits a flag or a token that isn't a child of the
|
|
522
|
+
// current node, returning the deepest handler + the leftover tokens.
|
|
523
|
+
const { handler, matchedPath, rest: leftover, node } = registry.resolve(cleanArgv);
|
|
524
|
+
// `--help` / `-h` immediately after a (sub)group → render help for that
|
|
525
|
+
// path. This works at any depth.
|
|
526
|
+
if (leftover[0] === '--help' || leftover[0] === '-h') {
|
|
527
|
+
return registry.get('help').run(parseArgs([matchedPath.join(' ')], { globalCwd }));
|
|
528
|
+
}
|
|
529
|
+
if (handler) {
|
|
530
|
+
// gate experimental commands. Bootstrap commands and core/extended
|
|
531
|
+
// tiers pass through; experimental commands return the structured
|
|
532
|
+
// not-enabled error unless `surface.enabled[]` contains them.
|
|
533
|
+
const gateReason = await checkSurfaceGate(matchedPath, globalCwd ?? process.cwd());
|
|
534
|
+
if (gateReason) {
|
|
535
|
+
const err = makeSurfaceNotEnabledError(gateReason.command, { reason: gateReason.detail });
|
|
536
|
+
process.stderr.write(renderSurfaceNotEnabledText(err));
|
|
537
|
+
return SURFACE_NOT_ENABLED_EXIT_CODE;
|
|
538
|
+
}
|
|
539
|
+
return await handler.run(parseArgs(leftover, { globalCwd }));
|
|
540
|
+
}
|
|
541
|
+
// No handler at the deepest match. If we landed on a group node (has
|
|
542
|
+
// children), show that group's help so the user discovers the verbs.
|
|
543
|
+
if (matchedPath.length > 0 && node.children.size > 0) {
|
|
544
|
+
return registry.get('help').run(parseArgs([matchedPath.join(' ')], { globalCwd }));
|
|
545
|
+
}
|
|
546
|
+
// Genuinely unknown — fall back to free-form / did-you-mean.
|
|
547
|
+
const probe = cleanArgv.filter((t) => typeof t === 'string' && t.length > 0 && !t.startsWith('-'));
|
|
548
|
+
if (looksLikeFreeFormTask(probe)) {
|
|
549
|
+
printFreeFormTaskHint(probe.join(' '));
|
|
550
|
+
return 2;
|
|
551
|
+
}
|
|
552
|
+
const attempted = probe.slice(0, 2).join(' ');
|
|
553
|
+
process.stderr.write(`Unknown command: ${attempted}\n`);
|
|
554
|
+
printDidYouMean(attempted);
|
|
555
|
+
return 2;
|
|
556
|
+
}
|
|
557
|
+
/**
|
|
558
|
+
* Heuristic for "this looks like a task, not a command".
|
|
559
|
+
*
|
|
560
|
+
* - At least two non-flag tokens (commands have at most two tokens: a
|
|
561
|
+
* top-level + a subcommand verb).
|
|
562
|
+
* - Or one token that matches a known free-form verb (rename / add / fix /
|
|
563
|
+
* refactor / remove / migrate / implement / update / build / …).
|
|
564
|
+
* - Never matches `--`-prefixed flag tokens.
|
|
565
|
+
*
|
|
566
|
+
* The function is deterministic and accepts only positional tokens.
|
|
567
|
+
* Exported for tests.
|
|
568
|
+
*/
|
|
569
|
+
export function looksLikeFreeFormTask(tokens) {
|
|
570
|
+
const clean = tokens.filter((t) => t.length > 0 && !t.startsWith('-'));
|
|
571
|
+
if (clean.length < 2)
|
|
572
|
+
return false;
|
|
573
|
+
// 3+ tokens is almost always a sentence, not a command — `shrk` only has
|
|
574
|
+
// 2 levels (top + sub), so anything beyond that has no chance of being a
|
|
575
|
+
// real path.
|
|
576
|
+
if (clean.length >= 3)
|
|
577
|
+
return true;
|
|
578
|
+
// 2 tokens: only treat as a task if the first token is a recognisable
|
|
579
|
+
// task verb. Otherwise it's plausibly a typo of a subcommand and we let
|
|
580
|
+
// the regular did-you-mean handle it.
|
|
581
|
+
const verbs = new Set([
|
|
582
|
+
'rename',
|
|
583
|
+
'add',
|
|
584
|
+
'fix',
|
|
585
|
+
'refactor',
|
|
586
|
+
'remove',
|
|
587
|
+
'delete',
|
|
588
|
+
'migrate',
|
|
589
|
+
'wire',
|
|
590
|
+
'create',
|
|
591
|
+
'implement',
|
|
592
|
+
'update',
|
|
593
|
+
'introduce',
|
|
594
|
+
'build',
|
|
595
|
+
'extract',
|
|
596
|
+
'move',
|
|
597
|
+
'inline',
|
|
598
|
+
'generate',
|
|
599
|
+
'scaffold',
|
|
600
|
+
'explain',
|
|
601
|
+
'document',
|
|
602
|
+
'review',
|
|
603
|
+
'test',
|
|
604
|
+
'design',
|
|
605
|
+
'refresh',
|
|
606
|
+
'reorganise',
|
|
607
|
+
'reorganize',
|
|
608
|
+
'restructure',
|
|
609
|
+
'split',
|
|
610
|
+
'merge',
|
|
611
|
+
'reduce',
|
|
612
|
+
'simplify',
|
|
613
|
+
]);
|
|
614
|
+
return verbs.has(clean[0].toLowerCase());
|
|
615
|
+
}
|
|
616
|
+
function printFreeFormTaskHint(task) {
|
|
617
|
+
process.stderr.write(`\nThis looks like a task, not a command.\n` +
|
|
618
|
+
`\n` +
|
|
619
|
+
`Recommended:\n` +
|
|
620
|
+
` $ shrk recommend "${task}"\n` +
|
|
621
|
+
`\n` +
|
|
622
|
+
`Why:\n` +
|
|
623
|
+
` \`shrk recommend\` is the canonical human entrypoint for "what should I do?".\n` +
|
|
624
|
+
`\n` +
|
|
625
|
+
`More detail:\n` +
|
|
626
|
+
` $ shrk start-here\n` +
|
|
627
|
+
` $ shrk commands\n`);
|
|
628
|
+
}
|
|
629
|
+
/**
|
|
630
|
+
* Check whether the resolved command path is gated by the
|
|
631
|
+
* surface tier model. Returns `null` if the command is callable
|
|
632
|
+
* (core/extended), or `{ command, detail }` if it is an experimental
|
|
633
|
+
* command not enabled in the current repo's surface config.
|
|
634
|
+
*
|
|
635
|
+
* Failure-soft: any error loading the inspection (fresh repo, no
|
|
636
|
+
* config, etc.) lets the command through. The gate must NEVER false-
|
|
637
|
+
* positive a bootstrap call — the bootstrap set in `tier.ts` plus
|
|
638
|
+
* spine-derived core commands always pass through cleanly.
|
|
639
|
+
*/
|
|
640
|
+
async function checkSurfaceGate(matchedPath, cwd) {
|
|
641
|
+
const candidate = matchedPath.join(' ');
|
|
642
|
+
if (candidate.length === 0)
|
|
643
|
+
return null;
|
|
644
|
+
try {
|
|
645
|
+
const { context } = await loadSurfaceContext({ cwd });
|
|
646
|
+
const summary = buildSurfaceSummary(context);
|
|
647
|
+
// Try the full path first; fall back to the top-level token. The
|
|
648
|
+
// catalog uses both shapes ("doctor" and "plan review").
|
|
649
|
+
const view = findCommandInSummary(summary, candidate) ??
|
|
650
|
+
findCommandInSummary(summary, matchedPath[0] ?? '');
|
|
651
|
+
if (!view)
|
|
652
|
+
return null;
|
|
653
|
+
if (view.callable)
|
|
654
|
+
return null;
|
|
655
|
+
return { command: view.command, detail: view.detail };
|
|
656
|
+
}
|
|
657
|
+
catch {
|
|
658
|
+
return null;
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
function printDidYouMean(attempted) {
|
|
662
|
+
const candidates = suggestDidYouMean(COMMAND_CATALOG, [attempted], 3);
|
|
663
|
+
if (candidates.length === 0) {
|
|
664
|
+
process.stderr.write("Tip: run `shrk commands suggest \"<partial>\"` or `shrk help` to discover commands.\n");
|
|
665
|
+
const footer = errorFooterFor('unknown-command', { task: attempted });
|
|
666
|
+
if (footer)
|
|
667
|
+
process.stderr.write(renderErrorFooter(footer));
|
|
668
|
+
return;
|
|
669
|
+
}
|
|
670
|
+
process.stderr.write('Did you mean:\n');
|
|
671
|
+
for (const c of candidates) {
|
|
672
|
+
process.stderr.write(` shrk ${c.command} — ${c.description}\n`);
|
|
673
|
+
}
|
|
674
|
+
// append the standardised next-command footer so the user
|
|
675
|
+
// always has a deterministic exit route.
|
|
676
|
+
const footer = errorFooterFor('unknown-command', { task: attempted });
|
|
677
|
+
if (footer)
|
|
678
|
+
process.stderr.write(renderErrorFooter(footer));
|
|
679
|
+
}
|
|
680
|
+
// Entry point when invoked directly.
|
|
681
|
+
//
|
|
682
|
+
// Bun exposes `import.meta.main`; Node does not. When Node runs the
|
|
683
|
+
// compiled `dist/main.js` directly the path-suffix check (`main.js`)
|
|
684
|
+
// catches it. The npm bin shim points at `shrk` so that suffix also
|
|
685
|
+
// triggers it. Source dev under Bun still runs via `main.ts`.
|
|
686
|
+
const isMain = typeof import.meta !== 'undefined' && import.meta.main === true;
|
|
687
|
+
const entryPath = process.argv[1] ?? '';
|
|
688
|
+
if (isMain ||
|
|
689
|
+
entryPath.endsWith('main.ts') ||
|
|
690
|
+
entryPath.endsWith('main.js') ||
|
|
691
|
+
entryPath.endsWith('shrk') ||
|
|
692
|
+
entryPath.endsWith('shrk.js') ||
|
|
693
|
+
entryPath.endsWith('shrk.cmd')) {
|
|
694
|
+
const argv = process.argv.slice(2);
|
|
695
|
+
runCli(argv).then((code) => process.exit(code), (err) => {
|
|
696
|
+
process.stderr.write(`Fatal: ${err instanceof Error ? err.message : String(err)}\n`);
|
|
697
|
+
process.exit(1);
|
|
698
|
+
});
|
|
699
|
+
}
|