@shrkcrft/cli 0.1.0-alpha.30 → 0.1.0-alpha.31
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/dist/asset-preview/apply-asset-preview.js +1 -1
- package/dist/authoring/authoring-kit.d.ts +9 -1
- package/dist/authoring/authoring-kit.d.ts.map +1 -1
- package/dist/authoring/authoring-kit.js +26 -13
- package/dist/bootstrap/unlinked-workspace-dependency.d.ts +11 -0
- package/dist/bootstrap/unlinked-workspace-dependency.d.ts.map +1 -0
- package/dist/bootstrap/unlinked-workspace-dependency.js +99 -0
- package/dist/command-registry.d.ts +100 -1
- package/dist/command-registry.d.ts.map +1 -1
- package/dist/command-registry.js +130 -3
- package/dist/commands/api-diff.command.d.ts.map +1 -1
- package/dist/commands/api-diff.command.js +12 -0
- package/dist/commands/apply.command.d.ts.map +1 -1
- package/dist/commands/apply.command.js +3 -0
- package/dist/commands/arch.command.d.ts.map +1 -1
- package/dist/commands/arch.command.js +26 -7
- package/dist/commands/architecture.command.d.ts.map +1 -1
- package/dist/commands/architecture.command.js +8 -2
- package/dist/commands/baseline.command.d.ts +54 -3
- package/dist/commands/baseline.command.d.ts.map +1 -1
- package/dist/commands/baseline.command.js +582 -74
- package/dist/commands/biome.command.d.ts.map +1 -1
- package/dist/commands/biome.command.js +20 -0
- package/dist/commands/boundaries.command.d.ts +9 -1
- package/dist/commands/boundaries.command.d.ts.map +1 -1
- package/dist/commands/boundaries.command.js +88 -20
- package/dist/commands/bundle.command.d.ts.map +1 -1
- package/dist/commands/bundle.command.js +57 -11
- package/dist/commands/cache-align.command.d.ts.map +1 -1
- package/dist/commands/cache-align.command.js +3 -1
- package/dist/commands/changelog-data.d.ts.map +1 -1
- package/dist/commands/changelog-data.js +138 -0
- package/dist/commands/changes.command.d.ts.map +1 -1
- package/dist/commands/changes.command.js +15 -0
- package/dist/commands/check.command.d.ts.map +1 -1
- package/dist/commands/check.command.js +1241 -322
- package/dist/commands/checks.command.d.ts.map +1 -1
- package/dist/commands/checks.command.js +188 -40
- package/dist/commands/ci.command.d.ts.map +1 -1
- package/dist/commands/ci.command.js +35 -2
- package/dist/commands/code-intel.command.d.ts.map +1 -1
- package/dist/commands/code-intel.command.js +3 -0
- package/dist/commands/command-catalog.d.ts +23 -1
- package/dist/commands/command-catalog.d.ts.map +1 -1
- package/dist/commands/command-catalog.js +152 -35
- package/dist/commands/commands.command.d.ts +21 -3
- package/dist/commands/commands.command.d.ts.map +1 -1
- package/dist/commands/commands.command.js +172 -27
- package/dist/commands/compress.command.d.ts.map +1 -1
- package/dist/commands/compress.command.js +4 -0
- package/dist/commands/constructs.command.d.ts.map +1 -1
- package/dist/commands/constructs.command.js +50 -12
- package/dist/commands/context.command.d.ts.map +1 -1
- package/dist/commands/context.command.js +40 -5
- package/dist/commands/contract-templates.command.d.ts.map +1 -1
- package/dist/commands/contract-templates.command.js +9 -1
- package/dist/commands/contract.command.d.ts.map +1 -1
- package/dist/commands/contract.command.js +35 -0
- package/dist/commands/conventions.command.d.ts.map +1 -1
- package/dist/commands/conventions.command.js +189 -29
- package/dist/commands/coverage.command.d.ts.map +1 -1
- package/dist/commands/coverage.command.js +9 -0
- package/dist/commands/daily.commands.d.ts +0 -1
- package/dist/commands/daily.commands.d.ts.map +1 -1
- package/dist/commands/daily.commands.js +12 -76
- package/dist/commands/dashboard.command.d.ts.map +1 -1
- package/dist/commands/dashboard.command.js +10 -0
- package/dist/commands/dev.command.d.ts.map +1 -1
- package/dist/commands/dev.command.js +45 -2
- package/dist/commands/diagnostics.command.d.ts +0 -2
- package/dist/commands/diagnostics.command.d.ts.map +1 -1
- package/dist/commands/diagnostics.command.js +5 -78
- package/dist/commands/diff-check.command.d.ts +6 -4
- package/dist/commands/diff-check.command.d.ts.map +1 -1
- package/dist/commands/diff-check.command.js +190 -103
- package/dist/commands/docs-references.command.d.ts +13 -0
- package/dist/commands/docs-references.command.d.ts.map +1 -1
- package/dist/commands/docs-references.command.js +269 -72
- package/dist/commands/doctor.command.d.ts.map +1 -1
- package/dist/commands/doctor.command.js +58 -4
- package/dist/commands/drift.command.d.ts.map +1 -1
- package/dist/commands/drift.command.js +17 -4
- package/dist/commands/eslint.command.d.ts.map +1 -1
- package/dist/commands/eslint.command.js +20 -0
- package/dist/commands/export.command.d.ts.map +1 -1
- package/dist/commands/export.command.js +23 -1
- package/dist/commands/feedback-dispatch.command.d.ts.map +1 -1
- package/dist/commands/feedback-dispatch.command.js +29 -0
- package/dist/commands/feedback.command.d.ts.map +1 -1
- package/dist/commands/feedback.command.js +6 -1
- package/dist/commands/finish.command.d.ts.map +1 -1
- package/dist/commands/finish.command.js +32 -8
- package/dist/commands/fix.command.d.ts.map +1 -1
- package/dist/commands/fix.command.js +19 -0
- package/dist/commands/gate.command.d.ts +6 -1
- package/dist/commands/gate.command.d.ts.map +1 -1
- package/dist/commands/gate.command.js +50 -124
- package/dist/commands/gates.command.d.ts +52 -0
- package/dist/commands/gates.command.d.ts.map +1 -1
- package/dist/commands/gates.command.js +811 -185
- package/dist/commands/gen.command.d.ts.map +1 -1
- package/dist/commands/gen.command.js +4 -0
- package/dist/commands/generated.command.d.ts +33 -3
- package/dist/commands/generated.command.d.ts.map +1 -1
- package/dist/commands/generated.command.js +499 -147
- package/dist/commands/graph-code-subverbs.d.ts +15 -0
- package/dist/commands/graph-code-subverbs.d.ts.map +1 -1
- package/dist/commands/graph-code-subverbs.js +198 -24
- package/dist/commands/graph.command.d.ts.map +1 -1
- package/dist/commands/graph.command.js +79 -37
- package/dist/commands/help.command.d.ts +30 -6
- package/dist/commands/help.command.d.ts.map +1 -1
- package/dist/commands/help.command.js +323 -199
- package/dist/commands/helper.command.d.ts +1 -0
- package/dist/commands/helper.command.d.ts.map +1 -1
- package/dist/commands/helper.command.js +195 -56
- package/dist/commands/impact.command.d.ts.map +1 -1
- package/dist/commands/impact.command.js +115 -12
- package/dist/commands/infer.command.d.ts.map +1 -1
- package/dist/commands/infer.command.js +20 -45
- package/dist/commands/ingest.command.d.ts +0 -1
- package/dist/commands/ingest.command.d.ts.map +1 -1
- package/dist/commands/ingest.command.js +25 -41
- package/dist/commands/knowledge-author.command.d.ts +0 -3
- package/dist/commands/knowledge-author.command.d.ts.map +1 -1
- package/dist/commands/knowledge-author.command.js +10 -23
- package/dist/commands/knowledge.command.d.ts.map +1 -1
- package/dist/commands/knowledge.command.js +469 -129
- package/dist/commands/languages.command.d.ts.map +1 -1
- package/dist/commands/languages.command.js +27 -0
- package/dist/commands/lint.command.d.ts.map +1 -1
- package/dist/commands/lint.command.js +3 -0
- package/dist/commands/mcp.command.d.ts +18 -0
- package/dist/commands/mcp.command.d.ts.map +1 -1
- package/dist/commands/mcp.command.js +33 -8
- package/dist/commands/onboard.command.d.ts.map +1 -1
- package/dist/commands/onboard.command.js +20 -0
- package/dist/commands/owners.command.d.ts.map +1 -1
- package/dist/commands/owners.command.js +14 -2
- package/dist/commands/packs-new.d.ts +13 -1
- package/dist/commands/packs-new.d.ts.map +1 -1
- package/dist/commands/packs-new.js +500 -335
- package/dist/commands/packs.command.d.ts.map +1 -1
- package/dist/commands/packs.command.js +378 -36
- package/dist/commands/paths.command.d.ts.map +1 -1
- package/dist/commands/paths.command.js +9 -1
- package/dist/commands/pipelines.command.d.ts.map +1 -1
- package/dist/commands/pipelines.command.js +7 -1
- package/dist/commands/plan-check.command.d.ts.map +1 -1
- package/dist/commands/plan-check.command.js +3 -0
- package/dist/commands/plan.command.d.ts.map +1 -1
- package/dist/commands/plan.command.js +3 -0
- package/dist/commands/playbooks.command.d.ts.map +1 -1
- package/dist/commands/playbooks.command.js +7 -2
- package/dist/commands/policy-lint.command.d.ts +19 -2
- package/dist/commands/policy-lint.command.d.ts.map +1 -1
- package/dist/commands/policy-lint.command.js +224 -65
- package/dist/commands/policy.command.d.ts.map +1 -1
- package/dist/commands/policy.command.js +6 -1
- package/dist/commands/pr.command.d.ts.map +1 -1
- package/dist/commands/pr.command.js +14 -0
- package/dist/commands/presets.command.d.ts.map +1 -1
- package/dist/commands/presets.command.js +12 -27
- package/dist/commands/profiles.command.d.ts.map +1 -1
- package/dist/commands/profiles.command.js +94 -26
- package/dist/commands/provenance.command.js +1 -1
- package/dist/commands/quality.command.d.ts.map +1 -1
- package/dist/commands/quality.command.js +129 -33
- package/dist/commands/recommend.command.d.ts +20 -4
- package/dist/commands/recommend.command.d.ts.map +1 -1
- package/dist/commands/recommend.command.js +172 -278
- package/dist/commands/registrations.command.d.ts.map +1 -1
- package/dist/commands/registrations.command.js +138 -13
- package/dist/commands/registry-lifecycle-run.d.ts +14 -0
- package/dist/commands/registry-lifecycle-run.d.ts.map +1 -0
- package/dist/commands/registry-lifecycle-run.js +336 -0
- package/dist/commands/registry.command.d.ts.map +1 -1
- package/dist/commands/registry.command.js +235 -62
- package/dist/commands/release.command.d.ts.map +1 -1
- package/dist/commands/release.command.js +99 -20
- package/dist/commands/report.command.d.ts.map +1 -1
- package/dist/commands/report.command.js +38 -2
- package/dist/commands/reuse-coverage.command.d.ts +23 -0
- package/dist/commands/reuse-coverage.command.d.ts.map +1 -0
- package/dist/commands/reuse-coverage.command.js +536 -0
- package/dist/commands/reuse.command.d.ts +3 -18
- package/dist/commands/reuse.command.d.ts.map +1 -1
- package/dist/commands/reuse.command.js +395 -244
- package/dist/commands/review.command.d.ts.map +1 -1
- package/dist/commands/review.command.js +33 -1
- package/dist/commands/rounds.command.d.ts.map +1 -1
- package/dist/commands/rounds.command.js +5 -0
- package/dist/commands/safety.command.d.ts.map +1 -1
- package/dist/commands/safety.command.js +9 -0
- package/dist/commands/scaffolds.command.d.ts.map +1 -1
- package/dist/commands/scaffolds.command.js +97 -25
- package/dist/commands/search.command.d.ts +0 -8
- package/dist/commands/search.command.d.ts.map +1 -1
- package/dist/commands/search.command.js +136 -28
- package/dist/commands/self-config-xrefs.command.d.ts +24 -0
- package/dist/commands/self-config-xrefs.command.d.ts.map +1 -0
- package/dist/commands/self-config-xrefs.command.js +170 -0
- package/dist/commands/self-config.command.d.ts.map +1 -1
- package/dist/commands/self-config.command.js +261 -65
- package/dist/commands/smart-context.command.d.ts.map +1 -1
- package/dist/commands/smart-context.command.js +39 -3
- package/dist/commands/spec.command.d.ts.map +1 -1
- package/dist/commands/spec.command.js +3 -0
- package/dist/commands/stats.command.d.ts.map +1 -1
- package/dist/commands/stats.command.js +3 -0
- package/dist/commands/surface.command.d.ts +6 -1
- package/dist/commands/surface.command.d.ts.map +1 -1
- package/dist/commands/surface.command.js +256 -54
- package/dist/commands/task-context.command.js +1 -1
- package/dist/commands/task.command.d.ts.map +1 -1
- package/dist/commands/task.command.js +22 -1
- package/dist/commands/templates.command.d.ts +4 -0
- package/dist/commands/templates.command.d.ts.map +1 -1
- package/dist/commands/templates.command.js +109 -22
- package/dist/commands/test.command.d.ts.map +1 -1
- package/dist/commands/test.command.js +161 -33
- package/dist/commands/tests.command.d.ts.map +1 -1
- package/dist/commands/tests.command.js +29 -3
- package/dist/commands/trace.command.d.ts.map +1 -1
- package/dist/commands/trace.command.js +29 -4
- package/dist/commands/watch.command.d.ts.map +1 -1
- package/dist/commands/watch.command.js +3 -0
- package/dist/commands/why.command.d.ts.map +1 -1
- package/dist/commands/why.command.js +3 -0
- package/dist/commands/wiring.command.d.ts +18 -4
- package/dist/commands/wiring.command.d.ts.map +1 -1
- package/dist/commands/wiring.command.js +360 -73
- package/dist/dashboard/code-intelligence-data.js +4 -4
- package/dist/diff/deleted-orphan-coverage.d.ts +32 -0
- package/dist/diff/deleted-orphan-coverage.d.ts.map +1 -0
- package/dist/diff/deleted-orphan-coverage.js +107 -0
- package/dist/diff/deleted-orphan-scope-notes.d.ts +23 -0
- package/dist/diff/deleted-orphan-scope-notes.d.ts.map +1 -0
- package/dist/diff/deleted-orphan-scope-notes.js +49 -0
- package/dist/diff/deleted-orphans.d.ts +32 -0
- package/dist/diff/deleted-orphans.d.ts.map +1 -1
- package/dist/diff/deleted-orphans.js +42 -2
- package/dist/dispatch/closest-match.d.ts +15 -0
- package/dist/dispatch/closest-match.d.ts.map +1 -0
- package/dist/dispatch/closest-match.js +47 -0
- package/dist/dispatch/global-flags.d.ts +94 -0
- package/dist/dispatch/global-flags.d.ts.map +1 -0
- package/dist/dispatch/global-flags.js +123 -0
- package/dist/dispatch/guard-invocation-input.d.ts +24 -0
- package/dist/dispatch/guard-invocation-input.d.ts.map +1 -0
- package/dist/dispatch/guard-invocation-input.js +1 -0
- package/dist/dispatch/guard-invocation.d.ts +33 -0
- package/dist/dispatch/guard-invocation.d.ts.map +1 -0
- package/dist/dispatch/guard-invocation.js +183 -0
- package/dist/dispatch/help-intercept.d.ts +22 -0
- package/dist/dispatch/help-intercept.d.ts.map +1 -0
- package/dist/dispatch/help-intercept.js +42 -0
- package/dist/dispatch/i-declared-invocation.d.ts +17 -0
- package/dist/dispatch/i-declared-invocation.d.ts.map +1 -0
- package/dist/dispatch/i-declared-invocation.js +1 -0
- package/dist/dispatch/i-unknown-flag-refusal-input.d.ts +28 -0
- package/dist/dispatch/i-unknown-flag-refusal-input.d.ts.map +1 -0
- package/dist/dispatch/i-unknown-flag-refusal-input.js +1 -0
- package/dist/dispatch/invocation-rejection-kind.d.ts +15 -0
- package/dist/dispatch/invocation-rejection-kind.d.ts.map +1 -0
- package/dist/dispatch/invocation-rejection-kind.js +15 -0
- package/dist/dispatch/invocation-rejection.d.ts +18 -0
- package/dist/dispatch/invocation-rejection.d.ts.map +1 -0
- package/dist/dispatch/invocation-rejection.js +1 -0
- package/dist/dispatch/judge-invocation.d.ts +24 -0
- package/dist/dispatch/judge-invocation.d.ts.map +1 -0
- package/dist/dispatch/judge-invocation.js +50 -0
- package/dist/dispatch/positional-mode.d.ts +18 -0
- package/dist/dispatch/positional-mode.d.ts.map +1 -0
- package/dist/dispatch/positional-mode.js +18 -0
- package/dist/dispatch/read-tracking-map.d.ts +28 -0
- package/dist/dispatch/read-tracking-map.d.ts.map +1 -0
- package/dist/dispatch/read-tracking-map.js +58 -0
- package/dist/dispatch/refuse-sibling-valve-flags.d.ts +30 -0
- package/dist/dispatch/refuse-sibling-valve-flags.d.ts.map +1 -0
- package/dist/dispatch/refuse-sibling-valve-flags.js +65 -0
- package/dist/dispatch/subverb-spec.d.ts +26 -0
- package/dist/dispatch/subverb-spec.d.ts.map +1 -0
- package/dist/dispatch/subverb-spec.js +1 -0
- package/dist/dispatch/undocumented-flag-reads.d.ts +22 -0
- package/dist/dispatch/undocumented-flag-reads.d.ts.map +1 -0
- package/dist/dispatch/undocumented-flag-reads.js +283 -0
- package/dist/dispatch/unknown-flag-refusal-mode.d.ts +13 -0
- package/dist/dispatch/unknown-flag-refusal-mode.d.ts.map +1 -0
- package/dist/dispatch/unknown-flag-refusal-mode.js +13 -0
- package/dist/dispatch/unknown-flag-refusal.d.ts +22 -0
- package/dist/dispatch/unknown-flag-refusal.d.ts.map +1 -0
- package/dist/dispatch/unknown-flag-refusal.js +57 -0
- package/dist/dispatch/unread-flags.d.ts +152 -0
- package/dist/dispatch/unread-flags.d.ts.map +1 -0
- package/dist/dispatch/unread-flags.js +295 -0
- package/dist/dispatch/verdict-valve-flag.d.ts +21 -0
- package/dist/dispatch/verdict-valve-flag.d.ts.map +1 -0
- package/dist/dispatch/verdict-valve-flag.js +21 -0
- package/dist/dispatch/walk-declared-subverbs.d.ts +14 -0
- package/dist/dispatch/walk-declared-subverbs.d.ts.map +1 -0
- package/dist/dispatch/walk-declared-subverbs.js +28 -0
- package/dist/exit-codes.d.ts +41 -3
- package/dist/exit-codes.d.ts.map +1 -1
- package/dist/exit-codes.js +153 -14
- package/dist/finish/run-finish.d.ts +72 -5
- package/dist/finish/run-finish.d.ts.map +1 -1
- package/dist/finish/run-finish.js +453 -104
- package/dist/gates/accepted-empty-note.d.ts +10 -0
- package/dist/gates/accepted-empty-note.d.ts.map +1 -0
- package/dist/gates/accepted-empty-note.js +11 -0
- package/dist/gates/allow-empty.d.ts +25 -0
- package/dist/gates/allow-empty.d.ts.map +1 -0
- package/dist/gates/allow-empty.js +27 -0
- package/dist/gates/asset-doctor-failing-units.d.ts +16 -0
- package/dist/gates/asset-doctor-failing-units.d.ts.map +1 -0
- package/dist/gates/asset-doctor-failing-units.js +14 -0
- package/dist/gates/asset-doctor-failure-line.d.ts +16 -0
- package/dist/gates/asset-doctor-failure-line.d.ts.map +1 -0
- package/dist/gates/asset-doctor-failure-line.js +28 -0
- package/dist/gates/empty-rule-advice-lines.d.ts +15 -0
- package/dist/gates/empty-rule-advice-lines.d.ts.map +1 -0
- package/dist/gates/empty-rule-advice-lines.js +20 -0
- package/dist/gates/gate-envelope.d.ts +85 -8
- package/dist/gates/gate-envelope.d.ts.map +1 -1
- package/dist/gates/gate-envelope.js +56 -7
- package/dist/gates/gate-rule-globs.d.ts +37 -3
- package/dist/gates/gate-rule-globs.d.ts.map +1 -1
- package/dist/gates/gate-rule-globs.js +78 -40
- package/dist/gates/gate-rule-view.d.ts +17 -4
- package/dist/gates/gate-rule-view.d.ts.map +1 -1
- package/dist/gates/gate-rule-view.js +105 -90
- package/dist/gates/i-coverage-dead-glob.d.ts +19 -0
- package/dist/gates/i-coverage-dead-glob.d.ts.map +1 -0
- package/dist/gates/i-coverage-dead-glob.js +1 -0
- package/dist/gates/i-coverage-negation.d.ts +13 -0
- package/dist/gates/i-coverage-negation.d.ts.map +1 -0
- package/dist/gates/i-coverage-negation.js +1 -0
- package/dist/gates/i-registration-query-settle-input.d.ts +18 -0
- package/dist/gates/i-registration-query-settle-input.d.ts.map +1 -0
- package/dist/gates/i-registration-query-settle-input.js +1 -0
- package/dist/gates/i-unit-state-note-row.d.ts +16 -0
- package/dist/gates/i-unit-state-note-row.d.ts.map +1 -0
- package/dist/gates/i-unit-state-note-row.js +1 -0
- package/dist/gates/i-unit-state-notes.d.ts +32 -0
- package/dist/gates/i-unit-state-notes.d.ts.map +1 -0
- package/dist/gates/i-unit-state-notes.js +1 -0
- package/dist/gates/incomplete-registry-inventory.d.ts +19 -0
- package/dist/gates/incomplete-registry-inventory.d.ts.map +1 -0
- package/dist/gates/incomplete-registry-inventory.js +63 -0
- package/dist/gates/measure-registration-roles.d.ts +10 -0
- package/dist/gates/measure-registration-roles.d.ts.map +1 -0
- package/dist/gates/measure-registration-roles.js +9 -0
- package/dist/gates/plane-verdict.d.ts +14 -0
- package/dist/gates/plane-verdict.d.ts.map +1 -0
- package/dist/gates/plane-verdict.js +22 -0
- package/dist/gates/qualify-clean-for-units.d.ts +12 -0
- package/dist/gates/qualify-clean-for-units.d.ts.map +1 -0
- package/dist/gates/qualify-clean-for-units.js +18 -0
- package/dist/gates/registration-graph-verdict.d.ts +34 -0
- package/dist/gates/registration-graph-verdict.d.ts.map +1 -0
- package/dist/gates/registration-graph-verdict.js +70 -0
- package/dist/gates/registration-roles.d.ts +9 -0
- package/dist/gates/registration-roles.d.ts.map +1 -0
- package/dist/gates/registration-roles.js +1 -0
- package/dist/gates/registry-liveness.d.ts +11 -0
- package/dist/gates/registry-liveness.d.ts.map +1 -0
- package/dist/gates/registry-liveness.js +13 -0
- package/dist/gates/rule-coverage.d.ts +187 -4
- package/dist/gates/rule-coverage.d.ts.map +1 -1
- package/dist/gates/rule-coverage.js +501 -49
- package/dist/gates/run-gate-planes.d.ts +14 -0
- package/dist/gates/run-gate-planes.d.ts.map +1 -1
- package/dist/gates/run-gate-planes.js +172 -30
- package/dist/gates/scaffold-selftest.d.ts +56 -0
- package/dist/gates/scaffold-selftest.d.ts.map +1 -0
- package/dist/gates/scaffold-selftest.js +119 -0
- package/dist/gates/seam-rejected-rules.d.ts +28 -0
- package/dist/gates/seam-rejected-rules.d.ts.map +1 -0
- package/dist/gates/seam-rejected-rules.js +95 -0
- package/dist/gates/self-test-check.d.ts +29 -0
- package/dist/gates/self-test-check.d.ts.map +1 -0
- package/dist/gates/self-test-check.js +1 -0
- package/dist/gates/self-test-subject.d.ts +28 -0
- package/dist/gates/self-test-subject.d.ts.map +1 -0
- package/dist/gates/self-test-subject.js +1 -0
- package/dist/gates/self-test.d.ts +20 -0
- package/dist/gates/self-test.d.ts.map +1 -0
- package/dist/gates/self-test.js +82 -0
- package/dist/gates/settle-verdict.d.ts +14 -0
- package/dist/gates/settle-verdict.d.ts.map +1 -0
- package/dist/gates/settle-verdict.js +13 -0
- package/dist/gates/settled-verdict.d.ts +8 -0
- package/dist/gates/settled-verdict.d.ts.map +1 -0
- package/dist/gates/settled-verdict.js +1 -0
- package/dist/gates/template-registry-coverage.d.ts +18 -0
- package/dist/gates/template-registry-coverage.d.ts.map +1 -0
- package/dist/gates/template-registry-coverage.js +24 -0
- package/dist/gates/unit-state-notes.d.ts +40 -0
- package/dist/gates/unit-state-notes.d.ts.map +1 -0
- package/dist/gates/unit-state-notes.js +71 -0
- package/dist/gates/verdict-line.d.ts +18 -0
- package/dist/gates/verdict-line.d.ts.map +1 -0
- package/dist/gates/verdict-line.js +40 -0
- package/dist/graph/graph-reuse-lookup.d.ts +10 -0
- package/dist/graph/graph-reuse-lookup.d.ts.map +1 -0
- package/dist/graph/graph-reuse-lookup.js +41 -0
- package/dist/graph/index-behind-hint.d.ts +11 -0
- package/dist/graph/index-behind-hint.d.ts.map +1 -0
- package/dist/graph/index-behind-hint.js +27 -0
- package/dist/knowledge/knowledge-stale-gate-flags.d.ts +3 -0
- package/dist/knowledge/knowledge-stale-gate-flags.d.ts.map +1 -0
- package/dist/knowledge/knowledge-stale-gate-flags.js +1 -0
- package/dist/knowledge/knowledge-stale-gate-input.d.ts +3 -0
- package/dist/knowledge/knowledge-stale-gate-input.d.ts.map +1 -0
- package/dist/knowledge/knowledge-stale-gate-input.js +1 -0
- package/dist/knowledge/knowledge-stale-gate-result.d.ts +3 -0
- package/dist/knowledge/knowledge-stale-gate-result.d.ts.map +1 -0
- package/dist/knowledge/knowledge-stale-gate-result.js +1 -0
- package/dist/knowledge/knowledge-stale-gate.d.ts +10 -0
- package/dist/knowledge/knowledge-stale-gate.d.ts.map +1 -0
- package/dist/knowledge/knowledge-stale-gate.js +9 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +200 -83
- package/dist/output/failure-hints.d.ts.map +1 -1
- package/dist/output/failure-hints.js +11 -9
- package/dist/output/rejected-entries-note.d.ts +57 -0
- package/dist/output/rejected-entries-note.d.ts.map +1 -0
- package/dist/output/rejected-entries-note.js +103 -0
- package/dist/output/stdout-is-pipe.d.ts +13 -0
- package/dist/output/stdout-is-pipe.d.ts.map +1 -0
- package/dist/output/stdout-is-pipe.js +21 -0
- package/dist/packs/stale-build-warning.d.ts +11 -0
- package/dist/packs/stale-build-warning.d.ts.map +1 -0
- package/dist/packs/stale-build-warning.js +23 -0
- package/dist/quality/run-quality.d.ts +123 -0
- package/dist/quality/run-quality.d.ts.map +1 -0
- package/dist/quality/run-quality.js +442 -0
- package/dist/schemas/json-schemas.d.ts +184 -3
- package/dist/schemas/json-schemas.d.ts.map +1 -1
- package/dist/schemas/json-schemas.js +113 -2
- package/dist/shrk.d.ts +3 -0
- package/dist/shrk.d.ts.map +1 -0
- package/dist/shrk.js +30 -0
- package/dist/surface/audience-applicability.d.ts +26 -0
- package/dist/surface/audience-applicability.d.ts.map +1 -0
- package/dist/surface/audience-applicability.js +60 -0
- package/dist/surface/catalog-command-safety.d.ts +18 -0
- package/dist/surface/catalog-command-safety.d.ts.map +1 -0
- package/dist/surface/catalog-command-safety.js +62 -0
- package/dist/surface/cli-command-resolver.d.ts +21 -0
- package/dist/surface/cli-command-resolver.d.ts.map +1 -0
- package/dist/surface/cli-command-resolver.js +87 -0
- package/dist/surface/command-dispatch-kind.d.ts +20 -0
- package/dist/surface/command-dispatch-kind.d.ts.map +1 -0
- package/dist/surface/command-dispatch-kind.js +20 -0
- package/dist/surface/command-index-entry.d.ts +40 -0
- package/dist/surface/command-index-entry.d.ts.map +1 -0
- package/dist/surface/command-index-entry.js +1 -0
- package/dist/surface/command-index.d.ts +77 -0
- package/dist/surface/command-index.d.ts.map +1 -0
- package/dist/surface/command-index.js +323 -0
- package/dist/surface/i-command-index.d.ts +22 -0
- package/dist/surface/i-command-index.d.ts.map +1 -0
- package/dist/surface/i-command-index.js +1 -0
- package/dist/surface/i-command-string-context.d.ts +20 -0
- package/dist/surface/i-command-string-context.d.ts.map +1 -0
- package/dist/surface/i-command-string-context.js +1 -0
- package/dist/surface/i-surface-denial.d.ts +13 -0
- package/dist/surface/i-surface-denial.d.ts.map +1 -0
- package/dist/surface/i-surface-denial.js +1 -0
- package/dist/surface/load-surface-context.d.ts +17 -1
- package/dist/surface/load-surface-context.d.ts.map +1 -1
- package/dist/surface/load-surface-context.js +48 -10
- package/dist/surface/not-enabled-error.d.ts +38 -4
- package/dist/surface/not-enabled-error.d.ts.map +1 -1
- package/dist/surface/not-enabled-error.js +96 -6
- package/dist/surface/profiles.d.ts +7 -0
- package/dist/surface/profiles.d.ts.map +1 -1
- package/dist/surface/resolve-command-string.d.ts +10 -0
- package/dist/surface/resolve-command-string.d.ts.map +1 -0
- package/dist/surface/resolve-command-string.js +572 -0
- package/dist/surface/surface-config-writer.d.ts +7 -2
- package/dist/surface/surface-config-writer.d.ts.map +1 -1
- package/dist/surface/surface-config-writer.js +25 -6
- package/dist/surface/surface-layer.d.ts +11 -0
- package/dist/surface/surface-layer.d.ts.map +1 -0
- package/dist/surface/surface-layer.js +11 -0
- package/dist/surface/surface-refusal-reason.d.ts +16 -0
- package/dist/surface/surface-refusal-reason.d.ts.map +1 -0
- package/dist/surface/surface-refusal-reason.js +16 -0
- package/dist/surface/surface-selector.d.ts +26 -0
- package/dist/surface/surface-selector.d.ts.map +1 -0
- package/dist/surface/surface-selector.js +42 -0
- package/dist/surface/surface-summary.d.ts +61 -18
- package/dist/surface/surface-summary.d.ts.map +1 -1
- package/dist/surface/surface-summary.js +147 -60
- package/dist/surface/tier.d.ts +85 -22
- package/dist/surface/tier.d.ts.map +1 -1
- package/dist/surface/tier.js +132 -30
- package/dist/usage/usage-log.d.ts +6 -1
- package/dist/usage/usage-log.d.ts.map +1 -1
- package/dist/usage/usage-log.js +7 -2
- package/dist/validation/run-validation-loop.d.ts +9 -0
- package/dist/validation/run-validation-loop.d.ts.map +1 -1
- package/dist/validation/run-validation-loop.js +14 -11
- package/dist/validation/typecheck-emitted.d.ts +8 -9
- package/dist/validation/typecheck-emitted.d.ts.map +1 -1
- package/dist/validation/typecheck-emitted.js +17 -97
- package/package.json +34 -34
|
@@ -1,38 +1,61 @@
|
|
|
1
|
+
import { detectSharkcraftRepo } from '@shrkcrft/inspector';
|
|
2
|
+
import { resolveCwd } from "../command-registry.js";
|
|
1
3
|
import { header } from "../output/format-output.js";
|
|
2
|
-
import {
|
|
4
|
+
import { nearest } from "../dispatch/closest-match.js";
|
|
5
|
+
import { CommandDispatchKind } from "../surface/command-dispatch-kind.js";
|
|
6
|
+
import { commandIndexFor, findCommandIndexEntry, subverbNamesOf, } from "../surface/command-index.js";
|
|
7
|
+
import { loadSurfaceContext } from "../surface/load-surface-context.js";
|
|
8
|
+
import { buildSurfaceSummary, findCommandInSummary, } from "../surface/surface-summary.js";
|
|
9
|
+
import { TierSource } from "../surface/tier.js";
|
|
10
|
+
import { defaultShowInHelp, isExplainFamily } from "./command-catalog.js";
|
|
3
11
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
12
|
+
* Help's topics come from THE command index — the same inventory `surface
|
|
13
|
+
* list`, `commands doctor`, the command-string resolver and the dispatcher's
|
|
14
|
+
* help intercept read (one memoised object per registry). It used to walk
|
|
15
|
+
* COMMAND_CATALOG itself (a third inventory), so a registered verb with no
|
|
16
|
+
* catalog row had no help and a catalog row nothing dispatches still did.
|
|
7
17
|
*/
|
|
8
|
-
function
|
|
18
|
+
function helpIndex(registry) {
|
|
19
|
+
return commandIndexFor(registry);
|
|
20
|
+
}
|
|
21
|
+
/** Every command path (and alias spelling) the index knows — help topics. */
|
|
22
|
+
function indexHelpPaths(index) {
|
|
9
23
|
const paths = new Set();
|
|
10
|
-
for (const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
24
|
+
for (const e of index.entries) {
|
|
25
|
+
if (e.dispatch === CommandDispatchKind.Meta)
|
|
26
|
+
continue;
|
|
27
|
+
paths.add(e.path);
|
|
28
|
+
for (const a of e.aliases)
|
|
29
|
+
paths.add(a);
|
|
15
30
|
}
|
|
16
31
|
return paths;
|
|
17
32
|
}
|
|
18
33
|
/**
|
|
19
|
-
* Render help for
|
|
20
|
-
*
|
|
21
|
-
* discoverable from any
|
|
34
|
+
* Render help for an index path the trie could not resolve verbatim — a
|
|
35
|
+
* subverb its parent dispatches from a positional (`check wiring`) — plus its
|
|
36
|
+
* sibling verbs under the same parent so the family is discoverable from any
|
|
37
|
+
* one member.
|
|
22
38
|
*/
|
|
23
|
-
function
|
|
39
|
+
function renderIndexHelp(index, tokens) {
|
|
24
40
|
const want = tokens.join(' ');
|
|
25
|
-
const entry =
|
|
26
|
-
if (!entry)
|
|
41
|
+
const entry = findCommandIndexEntry(index, want);
|
|
42
|
+
if (!entry || entry.dispatch === CommandDispatchKind.Meta)
|
|
27
43
|
return undefined;
|
|
28
|
-
let out = `${
|
|
29
|
-
|
|
44
|
+
let out = `${entry.path} — ${entry.description}\n`;
|
|
45
|
+
// A catalog-documented subverb its handler does not declare has no usage of
|
|
46
|
+
// its own: fall back to the dispatching handler's, so help always shows how
|
|
47
|
+
// to invoke it (and never an empty page).
|
|
48
|
+
const usage = entry.usage ?? (entry.parent ? index.byPath.get(entry.parent)?.usage : undefined);
|
|
49
|
+
if (usage)
|
|
50
|
+
out += `${usage}\n`;
|
|
51
|
+
const extra = EXTRA_HELP_LINES[entry.path];
|
|
30
52
|
if (extra)
|
|
31
53
|
out += extra.join('\n') + '\n';
|
|
32
|
-
const parent = tokens.slice(0, -1).join(' ');
|
|
54
|
+
const parent = entry.tokens.slice(0, -1).join(' ');
|
|
33
55
|
if (parent.length > 0) {
|
|
34
|
-
const siblings =
|
|
35
|
-
.
|
|
56
|
+
const siblings = subverbNamesOf(index, parent)
|
|
57
|
+
.map((name) => `${parent} ${name}`)
|
|
58
|
+
.filter((p) => p !== entry.path)
|
|
36
59
|
.sort();
|
|
37
60
|
if (siblings.length > 0) {
|
|
38
61
|
out += `\nSiblings: ${siblings.join(', ')}\n`;
|
|
@@ -46,64 +69,28 @@ function firstSentence(description) {
|
|
|
46
69
|
const head = dot > 0 ? description.slice(0, dot + 1) : description;
|
|
47
70
|
return head.length > 100 ? head.slice(0, 97).trimEnd() + '…' : head;
|
|
48
71
|
}
|
|
49
|
-
/** Levenshtein edit distance — small, local helper for the unknown-topic guard. */
|
|
50
|
-
function editDistance(a, b) {
|
|
51
|
-
const m = a.length;
|
|
52
|
-
const n = b.length;
|
|
53
|
-
if (m === 0)
|
|
54
|
-
return n;
|
|
55
|
-
if (n === 0)
|
|
56
|
-
return m;
|
|
57
|
-
let prev = Array.from({ length: n + 1 }, (_, i) => i);
|
|
58
|
-
let curr = new Array(n + 1);
|
|
59
|
-
for (let i = 1; i <= m; i += 1) {
|
|
60
|
-
curr[0] = i;
|
|
61
|
-
for (let j = 1; j <= n; j += 1) {
|
|
62
|
-
const cost = a[i - 1] === b[j - 1] ? 0 : 1;
|
|
63
|
-
curr[j] = Math.min(prev[j] + 1, curr[j - 1] + 1, prev[j - 1] + cost);
|
|
64
|
-
}
|
|
65
|
-
[prev, curr] = [curr, prev];
|
|
66
|
-
}
|
|
67
|
-
return prev[n];
|
|
68
|
-
}
|
|
69
72
|
/**
|
|
70
|
-
* The set of real, callable help topics:
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
73
|
+
* The set of real, callable top-level help topics: the first token of every
|
|
74
|
+
* index path, plus every top-level alias. Used only to suggest a near-typo
|
|
75
|
+
* when an unknown topic is requested — never to fabricate one that isn't real.
|
|
76
|
+
* The suggestion goes through the ONE did-you-mean scorer (`nearest`, the
|
|
77
|
+
* `max(1, len/4)`-edit tolerance main.ts uses), ties broken lexically.
|
|
74
78
|
*/
|
|
75
|
-
function realHelpTopics(
|
|
79
|
+
function realHelpTopics(index) {
|
|
76
80
|
const topics = new Set();
|
|
77
|
-
for (const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Nearest real topic to `attempt` within a typo-tolerant edit-distance bound,
|
|
90
|
-
* or undefined when nothing is close enough. Mirrors main.ts's confidence
|
|
91
|
-
* tolerance (`max(1, len/4)` edits) so a fingers-on-keys typo suggests but a
|
|
92
|
-
* genuinely-unrelated token does not. Deterministic: ties break lexically.
|
|
93
|
-
*/
|
|
94
|
-
function nearestHelpTopic(attempt, topics) {
|
|
95
|
-
const lower = attempt.toLowerCase();
|
|
96
|
-
const tolerance = Math.max(1, Math.floor(lower.length / 4));
|
|
97
|
-
let best;
|
|
98
|
-
let bestDist = Number.POSITIVE_INFINITY;
|
|
99
|
-
for (const topic of topics) {
|
|
100
|
-
const dist = editDistance(lower, topic.toLowerCase());
|
|
101
|
-
if (dist < bestDist || (dist === bestDist && best !== undefined && topic < best)) {
|
|
102
|
-
bestDist = dist;
|
|
103
|
-
best = topic;
|
|
81
|
+
for (const e of index.entries) {
|
|
82
|
+
if (e.dispatch === CommandDispatchKind.Meta)
|
|
83
|
+
continue;
|
|
84
|
+
const head = e.tokens[0];
|
|
85
|
+
if (head)
|
|
86
|
+
topics.add(head);
|
|
87
|
+
for (const a of e.aliases) {
|
|
88
|
+
const aliasHead = a.split(' ')[0];
|
|
89
|
+
if (aliasHead)
|
|
90
|
+
topics.add(aliasHead);
|
|
104
91
|
}
|
|
105
92
|
}
|
|
106
|
-
return
|
|
93
|
+
return topics;
|
|
107
94
|
}
|
|
108
95
|
const EXTRA_HELP_LINES = Object.freeze({
|
|
109
96
|
graph: [
|
|
@@ -115,54 +102,91 @@ const EXTRA_HELP_LINES = Object.freeze({
|
|
|
115
102
|
' graph context — inspect one file or symbol with bridge enrichment',
|
|
116
103
|
' graph impact — reverse dependent closure for a file or symbol',
|
|
117
104
|
' graph callers — files that call/reference a symbol',
|
|
105
|
+
' graph importers — every module that imports a module (alias/type-only/re-export aware)',
|
|
118
106
|
' graph cycles — list import cycles',
|
|
119
107
|
' graph unresolved — list unresolved imports grouped by file',
|
|
120
108
|
' graph deps — inbound/outbound package dependencies',
|
|
121
109
|
' graph why — shortest-path explanation in the knowledge graph',
|
|
122
110
|
],
|
|
123
111
|
});
|
|
112
|
+
const START_SECTIONS = [
|
|
113
|
+
{
|
|
114
|
+
title: 'Bootstrap:',
|
|
115
|
+
lines: [
|
|
116
|
+
{ command: 'init', text: ' $ shrk init --infer --write — scan the repo + populate sharkcraft/ from real signals (new repos)' },
|
|
117
|
+
{ command: 'doctor', text: ' $ shrk doctor — is the workspace healthy?' },
|
|
118
|
+
{ command: 'onboard', text: ' $ shrk onboard — analyze an existing repo (advisory)' },
|
|
119
|
+
],
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
title: 'Use it for a task:',
|
|
123
|
+
lines: [
|
|
124
|
+
{ command: 'recommend', text: ' $ shrk recommend "<task>" — what should I do?' },
|
|
125
|
+
{ command: 'context', text: ' $ shrk context --task "<task>" — token-budgeted relevant context' },
|
|
126
|
+
{ command: 'task', text: ' $ shrk task "<task>" — full AI-ready task packet (JSON)' },
|
|
127
|
+
{ command: 'why', text: ' $ shrk why <file> — which rules govern this file' },
|
|
128
|
+
{ command: 'impact', text: ' $ shrk impact <file> — blast radius: what breaks if I change this' },
|
|
129
|
+
],
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
title: 'Generate code safely:',
|
|
133
|
+
lines: [
|
|
134
|
+
{ command: 'gen', text: ' $ shrk gen <template> <name> — generate from template (dry-run by default)' },
|
|
135
|
+
{ command: 'apply', text: ' $ shrk apply <plan.json> — apply a reviewed plan (CLI is the only write path)' },
|
|
136
|
+
{ command: 'check boundaries', text: ' $ shrk check boundaries — enforce layer / import boundaries' },
|
|
137
|
+
{ command: 'quality', text: ' $ shrk quality — pre-PR gate (doctor + boundaries + coverage + drift)' },
|
|
138
|
+
],
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
title: 'Browse what shrk knows:',
|
|
142
|
+
lines: [
|
|
143
|
+
{ command: 'graph status', text: ' $ shrk graph status — code-graph freshness and health' },
|
|
144
|
+
{ command: 'coverage', text: ' $ shrk coverage — what knowledge is missing' },
|
|
145
|
+
{ command: 'knowledge list', text: ' $ shrk knowledge list — knowledge entries' },
|
|
146
|
+
],
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
title: 'Run shrk for an agent:',
|
|
150
|
+
lines: [
|
|
151
|
+
{ command: 'mcp serve', text: ' $ shrk mcp serve — start the MCP server (stdio) for live queries' },
|
|
152
|
+
{ command: 'dashboard', text: ' $ shrk dashboard — start the local read-only dashboard' },
|
|
153
|
+
],
|
|
154
|
+
},
|
|
155
|
+
];
|
|
124
156
|
/**
|
|
125
157
|
* Product start screen for bare `shrk` / `shrk --help`. Shows the
|
|
126
158
|
* curated ~20-command "starter" surface organized by workflow phase.
|
|
127
159
|
* Everything else stays callable; users see the full ~70-verb catalog
|
|
128
160
|
* via `shrk --full-help` or browse it through `shrk surface list`.
|
|
129
161
|
*
|
|
162
|
+
* `shown(command)` is the repository's surface: a curated line whose command
|
|
163
|
+
* `surface.hidden` hides, or the surface gate refuses (`surface.disabled`,
|
|
164
|
+
* experimental, tool-maintenance), is dropped — and a section left empty with
|
|
165
|
+
* it. The default shows every line (the text is then byte-identical to the
|
|
166
|
+
* pre-round-11 screen).
|
|
167
|
+
*
|
|
130
168
|
* Returns the lines (without trailing newline). Pulled into a function
|
|
131
169
|
* so tests can assert on the structure without grepping stdout.
|
|
132
170
|
*/
|
|
133
|
-
export function renderStartScreen() {
|
|
171
|
+
export function renderStartScreen(shown = () => true) {
|
|
134
172
|
const lines = [];
|
|
135
173
|
lines.push('SharkCraft CLI — deterministic, local-first project intelligence for AI coding agents.');
|
|
136
174
|
lines.push('Usage: shrk [--cwd <dir>] <command> [...args]');
|
|
137
175
|
lines.push('');
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
lines.push(
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
lines.push(' $ shrk apply <plan.json> — apply a reviewed plan (CLI is the only write path)');
|
|
153
|
-
lines.push(' $ shrk check boundaries — enforce layer / import boundaries');
|
|
154
|
-
lines.push(' $ shrk quality — pre-PR gate (doctor + boundaries + coverage + drift)');
|
|
155
|
-
lines.push('');
|
|
156
|
-
lines.push('Browse what shrk knows:');
|
|
157
|
-
lines.push(' $ shrk graph status — code-graph freshness and health');
|
|
158
|
-
lines.push(' $ shrk coverage — what knowledge is missing');
|
|
159
|
-
lines.push(' $ shrk knowledge list — knowledge entries');
|
|
160
|
-
lines.push('');
|
|
161
|
-
lines.push('Run shrk for an agent:');
|
|
162
|
-
lines.push(' $ shrk mcp serve — start the MCP server (stdio) for live queries');
|
|
163
|
-
lines.push(' $ shrk dashboard — start the local read-only dashboard');
|
|
164
|
-
lines.push('');
|
|
165
|
-
lines.push('Discover the rest (everything stays callable — this screen shows ~17 of ~70 verbs):');
|
|
176
|
+
let dropped = 0;
|
|
177
|
+
for (const section of START_SECTIONS) {
|
|
178
|
+
const kept = section.lines.filter((l) => shown(l.command));
|
|
179
|
+
dropped += section.lines.length - kept.length;
|
|
180
|
+
if (kept.length === 0)
|
|
181
|
+
continue;
|
|
182
|
+
lines.push(section.title);
|
|
183
|
+
for (const l of kept)
|
|
184
|
+
lines.push(l.text);
|
|
185
|
+
lines.push('');
|
|
186
|
+
}
|
|
187
|
+
lines.push(dropped === 0
|
|
188
|
+
? 'Discover the rest (everything stays callable — this screen shows ~17 of ~70 verbs):'
|
|
189
|
+
: `Discover the rest (${dropped} curated command(s) are hidden or disabled by this repository's surface config):`);
|
|
166
190
|
lines.push(' $ shrk surface list — full catalog by tier');
|
|
167
191
|
lines.push(' $ shrk help <command> — usage for a specific command');
|
|
168
192
|
lines.push(' $ shrk --full-help — long, exhaustive help (incl. the explain/dry-run family)');
|
|
@@ -171,11 +195,169 @@ export function renderStartScreen() {
|
|
|
171
195
|
lines.push('Free-form input is fine — `shrk "<task>"` routes to `shrk recommend`.');
|
|
172
196
|
return lines.join('\n') + '\n';
|
|
173
197
|
}
|
|
198
|
+
/**
|
|
199
|
+
* The surface this repository presents — THE visibility authority: the
|
|
200
|
+
* surface summary over this registry's index, composed with the project's
|
|
201
|
+
* `surface{}` config, its profile and the host (tool repo or consumer). The
|
|
202
|
+
* start screen and `--full-help` render it, so `surface explain X` →
|
|
203
|
+
* `visible-in-help` and the help output can no longer disagree.
|
|
204
|
+
*
|
|
205
|
+
* Failure-soft: when the workspace cannot be loaded, the DEFAULT surface (no
|
|
206
|
+
* config; the host still detected) is rendered and one note says so.
|
|
207
|
+
*/
|
|
208
|
+
async function helpSurface(registry, cwd) {
|
|
209
|
+
const index = helpIndex(registry);
|
|
210
|
+
try {
|
|
211
|
+
const { context } = await loadSurfaceContext({ cwd });
|
|
212
|
+
return { summary: buildSurfaceSummary(context, index) };
|
|
213
|
+
}
|
|
214
|
+
catch (e) {
|
|
215
|
+
const context = {
|
|
216
|
+
spineCommands: new Set(),
|
|
217
|
+
packContributions: new Map(),
|
|
218
|
+
surfaceConfig: undefined,
|
|
219
|
+
isToolRepo: detectSharkcraftRepo(cwd),
|
|
220
|
+
};
|
|
221
|
+
return {
|
|
222
|
+
summary: buildSurfaceSummary(context, index),
|
|
223
|
+
note: `note: surface config not loaded (${e instanceof Error ? e.message : String(e)}) — showing the default surface.\n`,
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
/** A curated start-screen line stays unless this repository hides or gates its command. */
|
|
228
|
+
function startScreenFilter(summary) {
|
|
229
|
+
return (command) => {
|
|
230
|
+
const view = findCommandInSummary(summary, command);
|
|
231
|
+
return view === undefined || (view.callable && !view.hidden);
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
/** `(hidden)` / `(gated: …)` for `--full-help --all`. */
|
|
235
|
+
function helpAnnotation(v) {
|
|
236
|
+
const notes = [];
|
|
237
|
+
if (!v.visibleInHelp)
|
|
238
|
+
notes.push('hidden');
|
|
239
|
+
if (!v.callable) {
|
|
240
|
+
notes.push(v.source === TierSource.ToolMaintenance
|
|
241
|
+
? 'gated: tool-maintenance'
|
|
242
|
+
: v.source === TierSource.Disabled
|
|
243
|
+
? 'gated: disabled'
|
|
244
|
+
: 'gated');
|
|
245
|
+
}
|
|
246
|
+
return notes.length > 0 ? ` (${notes.join(', ')})` : '';
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* `--full-help`, rendered FROM the surface summary. Without `all` it lists
|
|
250
|
+
* exactly the views whose `visibleInHelp` is true — every one at least once —
|
|
251
|
+
* so `surface.hidden`, profiles, `surface.disabled` and the tool-maintenance
|
|
252
|
+
* host gate all reach it. With `all` it lists every view, annotated
|
|
253
|
+
* `(hidden)` / `(gated: …)` rather than dropped.
|
|
254
|
+
*
|
|
255
|
+
* Placement (not visibility) still reads the catalog: a visible view on the
|
|
256
|
+
* rent-paying surface goes under its top-level verb or group; an explain /
|
|
257
|
+
* dry-run view goes in its own section (and, when it is also rent-paying, in
|
|
258
|
+
* its group too).
|
|
259
|
+
*/
|
|
260
|
+
export function renderFullHelp(registry, summary, all) {
|
|
261
|
+
const index = helpIndex(registry);
|
|
262
|
+
const views = [...summary.tiers.core, ...summary.tiers.extended, ...summary.tiers.experimental];
|
|
263
|
+
const listed = views.filter((v) => all || v.visibleInHelp);
|
|
264
|
+
const rowOf = (v) => index.byPath.get(v.command)?.catalogEntry;
|
|
265
|
+
const inExplainFamily = (v) => {
|
|
266
|
+
const row = rowOf(v);
|
|
267
|
+
return row !== undefined && isExplainFamily(row);
|
|
268
|
+
};
|
|
269
|
+
const explainOnly = (v) => {
|
|
270
|
+
if (all)
|
|
271
|
+
return false;
|
|
272
|
+
const row = rowOf(v);
|
|
273
|
+
return row !== undefined && isExplainFamily(row) && !defaultShowInHelp(row);
|
|
274
|
+
};
|
|
275
|
+
// Registration order (init, inspect, doctor, …) — the order the top-level
|
|
276
|
+
// list has always had — then alphabetical.
|
|
277
|
+
const rank = new Map();
|
|
278
|
+
for (const name of [...registry.list().map((c) => c.name), ...registry.listGroups()]) {
|
|
279
|
+
if (!rank.has(name))
|
|
280
|
+
rank.set(name, rank.size);
|
|
281
|
+
}
|
|
282
|
+
const headRank = (path) => rank.get(path.split(' ')[0] ?? '') ?? Number.MAX_SAFE_INTEGER;
|
|
283
|
+
const byRegistration = (a, b) => headRank(a.command) - headRank(b.command) || a.command.localeCompare(b.command);
|
|
284
|
+
const line = (v, width) => ` ${v.command.padEnd(width)} — ${firstSentence(v.description) || '(no description)'}${all ? helpAnnotation(v) : ''}\n`;
|
|
285
|
+
let out = 'SharkCraft CLI — structured project intelligence for AI coding agents\n';
|
|
286
|
+
out += 'Usage: shrk [--cwd <dir>] <command> [...args]\n';
|
|
287
|
+
const main = listed.filter((v) => v.dispatch !== CommandDispatchKind.Meta && !explainOnly(v));
|
|
288
|
+
out += header('Top-level commands');
|
|
289
|
+
for (const v of main.filter((m) => !m.command.includes(' ')).sort(byRegistration))
|
|
290
|
+
out += line(v, 10);
|
|
291
|
+
if (!all) {
|
|
292
|
+
const hiddenCount = views.filter((v) => v.dispatch !== CommandDispatchKind.Meta && !v.visibleInHelp).length;
|
|
293
|
+
if (hiddenCount > 0) {
|
|
294
|
+
out +=
|
|
295
|
+
`\n …and ${hiddenCount} more hidden from default help (not on the curated surface, or hidden / gated by ` +
|
|
296
|
+
"this repository's surface config). Run `shrk --full-help --all` to see them, or `shrk surface list` to browse by tier.\n";
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
const groups = new Map();
|
|
300
|
+
for (const v of main) {
|
|
301
|
+
const head = v.command.split(' ')[0] ?? '';
|
|
302
|
+
if (!v.command.includes(' ') || head.length === 0)
|
|
303
|
+
continue;
|
|
304
|
+
const members = groups.get(head) ?? [];
|
|
305
|
+
members.push(v);
|
|
306
|
+
groups.set(head, members);
|
|
307
|
+
}
|
|
308
|
+
const aliasesByCanonical = new Map();
|
|
309
|
+
for (const [alias, canonical] of registry.listGroupAliases().entries()) {
|
|
310
|
+
const list = aliasesByCanonical.get(canonical) ?? [];
|
|
311
|
+
list.push(alias);
|
|
312
|
+
aliasesByCanonical.set(canonical, list);
|
|
313
|
+
}
|
|
314
|
+
const heads = [...groups.keys()].sort((a, b) => headRank(a) - headRank(b) || a.localeCompare(b));
|
|
315
|
+
for (const head of heads) {
|
|
316
|
+
const members = (groups.get(head) ?? []).sort((a, b) => a.command.localeCompare(b.command));
|
|
317
|
+
const aliases = aliasesByCanonical.get(head) ?? [];
|
|
318
|
+
out += header(`shrk ${head} <sub>${aliases.length ? ` (also: ${aliases.join(', ')})` : ''}`);
|
|
319
|
+
const width = Math.min(28, Math.max(...members.map((m) => m.command.length)));
|
|
320
|
+
for (const v of members)
|
|
321
|
+
out += line(v, width);
|
|
322
|
+
}
|
|
323
|
+
// Explain / dry-run family — several carry an Advanced surface, so they are
|
|
324
|
+
// not rent-paying, yet this section is WHY `visibleInHelp` counts them: they
|
|
325
|
+
// show what a gate, ranker, or graph SEES before you act.
|
|
326
|
+
const explain = listed.filter(inExplainFamily).sort((a, b) => a.command.localeCompare(b.command));
|
|
327
|
+
if (explain.length > 0) {
|
|
328
|
+
out += header('Inspect / explain (dry-run what a gate, ranker, or graph sees)');
|
|
329
|
+
for (const v of explain)
|
|
330
|
+
out += line(v, 24);
|
|
331
|
+
out += ' (also: shrk check wiring --explain <ruleId>)\n';
|
|
332
|
+
}
|
|
333
|
+
const meta = listed.filter((v) => v.dispatch === CommandDispatchKind.Meta);
|
|
334
|
+
if (meta.length > 0) {
|
|
335
|
+
out += header('Meta flags');
|
|
336
|
+
for (const v of meta)
|
|
337
|
+
out += line(v, 12);
|
|
338
|
+
}
|
|
339
|
+
out += '\nRun `shrk help <command>` for detailed usage.\n';
|
|
340
|
+
return out;
|
|
341
|
+
}
|
|
342
|
+
/** Bare `help` / `--help` (start screen) and `--full-help [--all]`, over the repository's surface. */
|
|
343
|
+
async function runListing(registry, args, wantsFull) {
|
|
344
|
+
const { summary, note } = await helpSurface(registry, resolveCwd({ ...args, multiFlags: new Map() }));
|
|
345
|
+
if (note)
|
|
346
|
+
process.stderr.write(note);
|
|
347
|
+
if (!wantsFull) {
|
|
348
|
+
process.stdout.write(renderStartScreen(startScreenFilter(summary)));
|
|
349
|
+
return 0;
|
|
350
|
+
}
|
|
351
|
+
process.stdout.write(renderFullHelp(registry, summary, args.flags.get('all') === true));
|
|
352
|
+
return 0;
|
|
353
|
+
}
|
|
174
354
|
export function makeHelpCommand(registry) {
|
|
175
355
|
return {
|
|
176
356
|
name: 'help',
|
|
177
357
|
description: 'Show CLI help. Bare `shrk help` prints a short start screen — pass `--full` for the long catalog.',
|
|
178
|
-
usage: 'shrk help [<command>] [--full]',
|
|
358
|
+
usage: 'shrk help [<command>] [--full [--all]] · shrk <command> [...] --help | -h (anywhere before `--`; runs nothing)',
|
|
359
|
+
// Topic help is synchronous (it reads only the command index); the start
|
|
360
|
+
// screen and `--full-help` read the repository's surface, so they are async.
|
|
179
361
|
run(args) {
|
|
180
362
|
const requested = args.positional[0];
|
|
181
363
|
const wantsFull = args.flags.get('full') === true ||
|
|
@@ -196,21 +378,38 @@ export function makeHelpCommand(registry) {
|
|
|
196
378
|
// that exits 0. Error out honestly instead, with a did-you-mean when
|
|
197
379
|
// a real topic is a near-typo of the request.
|
|
198
380
|
const attempt = tokens.join(' ');
|
|
199
|
-
|
|
200
|
-
//
|
|
201
|
-
//
|
|
202
|
-
const
|
|
203
|
-
if (
|
|
204
|
-
process.stdout.write(
|
|
381
|
+
const index = helpIndex(registry);
|
|
382
|
+
// The trie matched nothing, but the INDEX may still know the path
|
|
383
|
+
// under an alias spelling or as a folded variant.
|
|
384
|
+
const viaIndex = renderIndexHelp(index, tokens);
|
|
385
|
+
if (viaIndex !== undefined) {
|
|
386
|
+
process.stdout.write(viaIndex);
|
|
205
387
|
return 0;
|
|
206
388
|
}
|
|
207
389
|
process.stderr.write(`no such help topic: '${attempt}'\n`);
|
|
208
|
-
const suggestion =
|
|
209
|
-
nearestHelpTopic(attempt, catalogHelpPaths());
|
|
390
|
+
const suggestion = nearest(attempt, realHelpTopics(index)) ?? nearest(attempt, indexHelpPaths(index));
|
|
210
391
|
if (suggestion)
|
|
211
392
|
process.stderr.write(`Did you mean: ${suggestion}?\n`);
|
|
212
393
|
return 1;
|
|
213
394
|
}
|
|
395
|
+
// A tail the trie did not consume (`graph importers`, `check wiring`,
|
|
396
|
+
// `templates lst`) is answered by the INDEX alone: a declared or
|
|
397
|
+
// catalogued subverb prints its own help; anything else is an unknown
|
|
398
|
+
// topic (exit 1) — never the parent group's listing at exit 0.
|
|
399
|
+
if (tokens.length > matchedPath.length) {
|
|
400
|
+
const index = helpIndex(registry);
|
|
401
|
+
const indexHelp = renderIndexHelp(index, tokens);
|
|
402
|
+
if (indexHelp !== undefined) {
|
|
403
|
+
process.stdout.write(indexHelp);
|
|
404
|
+
return 0;
|
|
405
|
+
}
|
|
406
|
+
const attempt = tokens.join(' ');
|
|
407
|
+
process.stderr.write(`no such help topic: '${attempt}'\n`);
|
|
408
|
+
const near = nearest(attempt, indexHelpPaths(index));
|
|
409
|
+
if (near)
|
|
410
|
+
process.stderr.write(`Did you mean: shrk help ${near}?\n`);
|
|
411
|
+
return 1;
|
|
412
|
+
}
|
|
214
413
|
if (handler && matchedPath.join(' ') === tokens.join(' ') && node.children.size === 0) {
|
|
215
414
|
// Exact match on a callable command.
|
|
216
415
|
const canonical = registry.listCommandAliases().get(tokens[0]);
|
|
@@ -248,101 +447,26 @@ export function makeHelpCommand(registry) {
|
|
|
248
447
|
}
|
|
249
448
|
return 0;
|
|
250
449
|
}
|
|
251
|
-
// The trie could not resolve the full path, but the
|
|
252
|
-
//
|
|
253
|
-
//
|
|
254
|
-
//
|
|
450
|
+
// The trie could not resolve the full path, but the INDEX may still
|
|
451
|
+
// list it. Verbs like `check wiring` are dispatched from inside their
|
|
452
|
+
// parent's handler on a positional, so they are real, callable and
|
|
453
|
+
// documented — yet never trie nodes. Falling through to "Unknown
|
|
255
454
|
// command" made an entire documented surface look non-existent.
|
|
256
|
-
const
|
|
257
|
-
|
|
258
|
-
|
|
455
|
+
const index = helpIndex(registry);
|
|
456
|
+
const indexHelp = renderIndexHelp(index, tokens);
|
|
457
|
+
if (indexHelp !== undefined) {
|
|
458
|
+
process.stdout.write(indexHelp);
|
|
259
459
|
return 0;
|
|
260
460
|
}
|
|
261
461
|
process.stderr.write(`no such help topic: '${tokens.join(' ')}'\n`);
|
|
262
|
-
const near =
|
|
462
|
+
const near = nearest(tokens.join(' '), indexHelpPaths(index));
|
|
263
463
|
if (near)
|
|
264
464
|
process.stderr.write(`Did you mean: shrk help ${near}?\n`);
|
|
265
465
|
return 1;
|
|
266
466
|
}
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
}
|
|
271
|
-
const wantsAll = args.flags.get('all') === true;
|
|
272
|
-
process.stdout.write(`SharkCraft CLI — structured project intelligence for AI coding agents\n`);
|
|
273
|
-
process.stdout.write(`Usage: shrk [--cwd <dir>] <command> [...args]\n`);
|
|
274
|
-
// The catalog has ~360 entries; only ~30 top-level verbs pay
|
|
275
|
-
// rent (see PRIMARY_VERBS_ALLOWLIST in command-catalog.ts).
|
|
276
|
-
// Default --full-help filters to that set; `--full-help --all`
|
|
277
|
-
// dumps the entire catalog for power users.
|
|
278
|
-
const visibleVerbs = new Set();
|
|
279
|
-
if (!wantsAll) {
|
|
280
|
-
for (const entry of COMMAND_CATALOG) {
|
|
281
|
-
if (defaultShowInHelp(entry)) {
|
|
282
|
-
const verb = entry.command.split(/\s+/)[0] ?? '';
|
|
283
|
-
if (verb)
|
|
284
|
-
visibleVerbs.add(verb);
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
const visibleTopLevel = registry.list().filter((c) => {
|
|
289
|
-
if (wantsAll)
|
|
290
|
-
return true;
|
|
291
|
-
return visibleVerbs.has(c.name);
|
|
292
|
-
});
|
|
293
|
-
process.stdout.write(header('Top-level commands'));
|
|
294
|
-
for (const c of visibleTopLevel) {
|
|
295
|
-
process.stdout.write(` ${c.name.padEnd(10)} — ${c.description}\n`);
|
|
296
|
-
}
|
|
297
|
-
if (!wantsAll) {
|
|
298
|
-
const hiddenCount = registry.list().length - visibleTopLevel.length;
|
|
299
|
-
if (hiddenCount > 0) {
|
|
300
|
-
process.stdout.write(`\n …and ${hiddenCount} more, hidden from default help. Run \`shrk --full-help --all\` to see them, ` +
|
|
301
|
-
`or \`shrk surface list\` to browse by tier.\n`);
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
// Show each canonical group once — also filtered by the allowlist
|
|
305
|
-
// unless --all was passed.
|
|
306
|
-
const canonicalGroups = [];
|
|
307
|
-
const aliasMap = registry.listGroupAliases();
|
|
308
|
-
const seen = new Set();
|
|
309
|
-
for (const g of registry.listGroups()) {
|
|
310
|
-
const canonical = aliasMap.get(g) ?? g;
|
|
311
|
-
if (!seen.has(canonical)) {
|
|
312
|
-
seen.add(canonical);
|
|
313
|
-
if (wantsAll || visibleVerbs.has(canonical)) {
|
|
314
|
-
canonicalGroups.push(canonical);
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
const aliasesByCanonical = new Map();
|
|
319
|
-
for (const [alias, canonical] of aliasMap.entries()) {
|
|
320
|
-
const list = aliasesByCanonical.get(canonical) ?? [];
|
|
321
|
-
list.push(alias);
|
|
322
|
-
aliasesByCanonical.set(canonical, list);
|
|
323
|
-
}
|
|
324
|
-
for (const group of canonicalGroups) {
|
|
325
|
-
const aliases = aliasesByCanonical.get(group) ?? [];
|
|
326
|
-
const aliasNote = aliases.length ? ` (also: ${aliases.join(', ')})` : '';
|
|
327
|
-
process.stdout.write(header(`shrk ${group} <sub>${aliasNote}`));
|
|
328
|
-
for (const s of registry.listGroup(group)) {
|
|
329
|
-
process.stdout.write(` ${group} ${s.name.padEnd(10)} — ${s.description}\n`);
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
// Explain / dry-run family — several carry an Advanced surface and are
|
|
333
|
-
// filtered out of the listings above, so surface them explicitly. These
|
|
334
|
-
// show you what a gate, ranker, or graph SEES before you act; an agent
|
|
335
|
-
// would otherwise find them only by guessing (the #4.4 friction).
|
|
336
|
-
const explainFamily = listExplainFamily();
|
|
337
|
-
if (explainFamily.length > 0) {
|
|
338
|
-
process.stdout.write(header('Inspect / explain (dry-run what a gate, ranker, or graph sees)'));
|
|
339
|
-
for (const e of explainFamily) {
|
|
340
|
-
process.stdout.write(` ${e.command.padEnd(24)} — ${firstSentence(e.description)}\n`);
|
|
341
|
-
}
|
|
342
|
-
process.stdout.write(' (also: shrk check wiring --explain <ruleId>)\n');
|
|
343
|
-
}
|
|
344
|
-
process.stdout.write('\nRun `shrk help <command>` for detailed usage.\n');
|
|
345
|
-
return 0;
|
|
467
|
+
// No topic: the start screen or `--full-help`, over THIS repository's
|
|
468
|
+
// surface (the one visibility authority — see renderFullHelp).
|
|
469
|
+
return runListing(registry, args, wantsFull);
|
|
346
470
|
},
|
|
347
471
|
};
|
|
348
472
|
}
|
|
@@ -2,5 +2,6 @@ import { type ICommandHandler } from '../command-registry.js';
|
|
|
2
2
|
export declare const helperListCommand: ICommandHandler;
|
|
3
3
|
export declare const helperGetCommand: ICommandHandler;
|
|
4
4
|
export declare const helperPlanCommand: ICommandHandler;
|
|
5
|
+
export declare const helperDoctorCommand: ICommandHandler;
|
|
5
6
|
export declare const helperCommand: ICommandHandler;
|
|
6
7
|
//# sourceMappingURL=helper.command.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.command.d.ts","sourceRoot":"","sources":["../../src/commands/helper.command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"helper.command.d.ts","sourceRoot":"","sources":["../../src/commands/helper.command.ts"],"names":[],"mappings":"AA6BA,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAsBhC,eAAO,MAAM,iBAAiB,EAAE,eA2C/B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,eAiD9B,CAAC;AAyBF,eAAO,MAAM,iBAAiB,EAAE,eAgF/B,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,eAkEjC,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,eA2B3B,CAAC"}
|