@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,17 +1,67 @@
|
|
|
1
1
|
import { flagBool, flagString, resolveCwd } from "../command-registry.js";
|
|
2
|
+
import { PositionalMode } from "../dispatch/positional-mode.js";
|
|
2
3
|
import { asJson, header } from "../output/format-output.js";
|
|
3
4
|
import { BUILTIN_PROFILES, getProfile } from "../surface/profiles.js";
|
|
5
|
+
import { CommandDispatchKind } from "../surface/command-dispatch-kind.js";
|
|
6
|
+
import { buildCommandIndex } from "../surface/command-index.js";
|
|
7
|
+
import { settleVerdict } from "../gates/settle-verdict.js";
|
|
8
|
+
import { verdictLine } from "../gates/verdict-line.js";
|
|
4
9
|
import { buildCommandSafetyMatrix, COMMAND_CATALOG, CommandLifecycle, commandLifecycle, CommandSurface, commandSurface, commandTaskRole, defaultShowInHelp, R46_OVERLAY, renderCommandSafetyMatrixMarkdown, SafetyLevel } from "./command-catalog.js";
|
|
5
10
|
import { buildCommandTaxonomy, buildPrimaryCommandsReport, renderCommandTaxonomyMarkdown, renderCommandTaxonomyText, renderPrimaryCommandsText } from '@shrkcrft/inspector';
|
|
6
|
-
|
|
11
|
+
/**
|
|
12
|
+
* `catalog` is the rows `commands doctor` checks against `registry` (default
|
|
13
|
+
* COMMAND_CATALOG) — injectable so a test can prove a catalog/registry join
|
|
14
|
+
* end to end through the verb. Every other subcommand browses COMMAND_CATALOG.
|
|
15
|
+
*/
|
|
16
|
+
export function makeCommandsCommand(registry, catalog = COMMAND_CATALOG) {
|
|
7
17
|
return {
|
|
8
18
|
name: 'commands',
|
|
9
|
-
|
|
10
|
-
|
|
19
|
+
// `suggest` / `explain` were hard-deleted (folded into the unknown-command
|
|
20
|
+
// did-you-mean and `shrk explain` — see command-catalog.ts) but still
|
|
21
|
+
// advertised here, so `commands suggest x` fell through to the default
|
|
22
|
+
// listing at exit 0. The declared set below is what `run` actually handles;
|
|
23
|
+
// anything else is an unknown subcommand.
|
|
24
|
+
description: 'Browse the command catalog. Default view is compact (primary + common); pass --all for the full catalog, or --profile <id> (e.g. agent) for the surface a profile sees. Subcommands: primary | advanced | deprecated | hidden | retirement-plan | docs-check | surface | profile | machine | legacy | overlaps | taxonomy | matrix | tree | search | entrypoints | doctor | ux-check.',
|
|
25
|
+
usage: 'shrk commands [primary|advanced|deprecated|hidden|retirement-plan|docs-check|surface <s>|profile [<id>]|machine|legacy|overlaps|taxonomy|matrix|tree|search <q>|entrypoints|doctor|ux-check] [--all] [--profile <id>] [--safety <level>] [--category <name>] [--json]',
|
|
26
|
+
positionals: PositionalMode.None,
|
|
27
|
+
subverbs: [
|
|
28
|
+
{ name: 'primary', description: 'The primary (spine) commands.', usage: 'shrk commands primary [--json]' },
|
|
29
|
+
{ name: 'advanced', description: 'The advanced commands.', usage: 'shrk commands advanced [--json]' },
|
|
30
|
+
{ name: 'deprecated', description: 'Deprecated commands and their replacements.', usage: 'shrk commands deprecated [--json]' },
|
|
31
|
+
{ name: 'hidden', description: 'Commands hidden from default help.', usage: 'shrk commands hidden [--json]' },
|
|
32
|
+
{ name: 'retirement-plan', description: 'The command retirement plan.', usage: 'shrk commands retirement-plan [--json]' },
|
|
33
|
+
{ name: 'docs-check', description: 'Catalog rows vs the docs that mention them.', usage: 'shrk commands docs-check [--json]' },
|
|
34
|
+
{ name: 'surface', description: 'The catalog filtered to one command surface.', usage: 'shrk commands surface <surface> [--json]', positionals: PositionalMode.Free },
|
|
35
|
+
{
|
|
36
|
+
name: 'profile',
|
|
37
|
+
description: 'List surface profiles, or render the catalog as one profile sees it.',
|
|
38
|
+
usage: 'shrk commands profile [<id>] [--json]',
|
|
39
|
+
positionals: PositionalMode.Free,
|
|
40
|
+
},
|
|
41
|
+
{ name: 'machine', description: 'Machine-oriented (JSON / MCP) commands.', usage: 'shrk commands machine [--json]' },
|
|
42
|
+
{ name: 'legacy', description: 'Legacy command spellings.', usage: 'shrk commands legacy [--json]' },
|
|
43
|
+
{ name: 'overlaps', description: 'Commands that overlap, and which to prefer.', usage: 'shrk commands overlaps [--json]' },
|
|
44
|
+
{
|
|
45
|
+
name: 'taxonomy',
|
|
46
|
+
description: 'The command taxonomy.',
|
|
47
|
+
usage: 'shrk commands taxonomy [--format text|markdown|json] [--output <path>] [--write-docs] [--json]',
|
|
48
|
+
},
|
|
49
|
+
{ name: 'matrix', description: 'The command safety matrix.', usage: 'shrk commands matrix [--format markdown|json] [--json]' },
|
|
50
|
+
{ name: 'tree', description: 'The command tree.', usage: 'shrk commands tree [--json]' },
|
|
51
|
+
{ name: 'search', description: 'Filter the catalog by a query.', usage: 'shrk commands search <query> [--json]', positionals: PositionalMode.Free },
|
|
52
|
+
{
|
|
53
|
+
name: 'entrypoints',
|
|
54
|
+
aliases: ['workflows'],
|
|
55
|
+
description: 'The entrypoint matrix (human / agent / machine / debug).',
|
|
56
|
+
usage: 'shrk commands entrypoints [--json]',
|
|
57
|
+
},
|
|
58
|
+
{ name: 'doctor', description: 'Registry ↔ catalog ↔ index consistency.', usage: 'shrk commands doctor [--json]' },
|
|
59
|
+
{ name: 'ux-check', description: 'Command UX checks.', usage: 'shrk commands ux-check [--json]' },
|
|
60
|
+
],
|
|
11
61
|
async run(args) {
|
|
12
62
|
const sub = args.positional[0];
|
|
13
63
|
if (sub === 'doctor') {
|
|
14
|
-
return runCommandsDoctor(args, registry);
|
|
64
|
+
return runCommandsDoctor(args, registry, catalog);
|
|
15
65
|
}
|
|
16
66
|
if (sub === 'ux-check') {
|
|
17
67
|
return runCommandsUxCheck(args);
|
|
@@ -879,12 +929,18 @@ async function runCommandsUxCheck(args) {
|
|
|
879
929
|
}
|
|
880
930
|
return report.passed ? 0 : 1;
|
|
881
931
|
}
|
|
882
|
-
/**
|
|
883
|
-
|
|
932
|
+
/**
|
|
933
|
+
* Pure: build the doctor report. Exported for tests.
|
|
934
|
+
*
|
|
935
|
+
* `catalog` defaults to COMMAND_CATALOG. A test passes its own rows (with a
|
|
936
|
+
* registry of its own) to prove a join end to end — every check below reads
|
|
937
|
+
* the SAME rows, so a fixture catalog is never mixed with the real one.
|
|
938
|
+
*/
|
|
939
|
+
export function buildCommandsDoctorReport(registry, catalog = COMMAND_CATALOG) {
|
|
884
940
|
const issues = [];
|
|
885
941
|
// 1. No duplicate commands.
|
|
886
942
|
const seen = new Set();
|
|
887
|
-
for (const e of
|
|
943
|
+
for (const e of catalog) {
|
|
888
944
|
if (seen.has(e.command)) {
|
|
889
945
|
issues.push({
|
|
890
946
|
code: 'duplicate-command',
|
|
@@ -896,7 +952,7 @@ export function buildCommandsDoctorReport(registry) {
|
|
|
896
952
|
}
|
|
897
953
|
// 2. Every entry has a safety level + description + category.
|
|
898
954
|
const validLevels = new Set(Object.values(SafetyLevel));
|
|
899
|
-
for (const e of
|
|
955
|
+
for (const e of catalog) {
|
|
900
956
|
if (!e.description || e.description.trim().length === 0) {
|
|
901
957
|
issues.push({
|
|
902
958
|
code: 'missing-description',
|
|
@@ -920,7 +976,7 @@ export function buildCommandsDoctorReport(registry) {
|
|
|
920
976
|
}
|
|
921
977
|
}
|
|
922
978
|
// 3. writes-source ⇒ not MCP-available.
|
|
923
|
-
for (const e of
|
|
979
|
+
for (const e of catalog) {
|
|
924
980
|
if (e.writesSource && e.mcpAvailable) {
|
|
925
981
|
issues.push({
|
|
926
982
|
code: 'writes-source-via-mcp',
|
|
@@ -930,7 +986,7 @@ export function buildCommandsDoctorReport(registry) {
|
|
|
930
986
|
}
|
|
931
987
|
}
|
|
932
988
|
// 4. writesSource ⇒ writesFiles.
|
|
933
|
-
for (const e of
|
|
989
|
+
for (const e of catalog) {
|
|
934
990
|
if (e.writesSource && !e.writesFiles) {
|
|
935
991
|
issues.push({
|
|
936
992
|
code: 'writes-source-without-writes-files',
|
|
@@ -940,7 +996,7 @@ export function buildCommandsDoctorReport(registry) {
|
|
|
940
996
|
}
|
|
941
997
|
}
|
|
942
998
|
// 5. runs-shell safety level ⇒ runsShell flag (and vice versa).
|
|
943
|
-
for (const e of
|
|
999
|
+
for (const e of catalog) {
|
|
944
1000
|
if (e.safetyLevel === SafetyLevel.RunsShell && !e.runsShell) {
|
|
945
1001
|
issues.push({
|
|
946
1002
|
code: 'shell-level-without-flag',
|
|
@@ -959,7 +1015,7 @@ export function buildCommandsDoctorReport(registry) {
|
|
|
959
1015
|
const sub = registry.listGroup(g);
|
|
960
1016
|
registeredSub += sub.length;
|
|
961
1017
|
}
|
|
962
|
-
for (const e of
|
|
1018
|
+
for (const e of catalog) {
|
|
963
1019
|
const parts = e.command.split(' ');
|
|
964
1020
|
const top = parts[0];
|
|
965
1021
|
const second = parts[1];
|
|
@@ -995,7 +1051,7 @@ export function buildCommandsDoctorReport(registry) {
|
|
|
995
1051
|
}
|
|
996
1052
|
// 7. Registered commands without a catalog entry.
|
|
997
1053
|
for (const c of registry.list()) {
|
|
998
|
-
const inCatalog =
|
|
1054
|
+
const inCatalog = catalog.some((e) => e.command === c.name || e.command.startsWith(c.name + ' '));
|
|
999
1055
|
if (!inCatalog) {
|
|
1000
1056
|
// Promoted to error for primary verbs: if a user types
|
|
1001
1057
|
// `shrk help <cmd>` we should be able to print catalog metadata
|
|
@@ -1025,7 +1081,7 @@ export function buildCommandsDoctorReport(registry) {
|
|
|
1025
1081
|
// canonical target carries the entry.
|
|
1026
1082
|
const aliasGroups = new Set(registry.listGroupAliases().keys());
|
|
1027
1083
|
const catalogTopWords = new Set();
|
|
1028
|
-
for (const e of
|
|
1084
|
+
for (const e of catalog) {
|
|
1029
1085
|
const top = e.command.split(/\s+/)[0];
|
|
1030
1086
|
if (top)
|
|
1031
1087
|
catalogTopWords.add(top);
|
|
@@ -1042,51 +1098,134 @@ export function buildCommandsDoctorReport(registry) {
|
|
|
1042
1098
|
}
|
|
1043
1099
|
}
|
|
1044
1100
|
}
|
|
1101
|
+
// 9. Exhaustiveness, at PATH granularity, over THE command index (what
|
|
1102
|
+
// `surface list` and `help` show). Checks 6–8 only compared top-level
|
|
1103
|
+
// handlers and groups, so 75 registered 2-level paths (`knowledge list`,
|
|
1104
|
+
// `gates check`, …) with no catalog row — and so no safety metadata — read
|
|
1105
|
+
// as "OK ✓".
|
|
1106
|
+
let indexEntries = 0;
|
|
1107
|
+
let uncatalogued = 0;
|
|
1108
|
+
const handlerPaths = registry ? registry.listAll().map(({ path }) => path.join(' ')) : [];
|
|
1109
|
+
let unreached = [];
|
|
1110
|
+
if (registry) {
|
|
1111
|
+
const index = buildCommandIndex(registry, catalog);
|
|
1112
|
+
indexEntries = index.entries.length;
|
|
1113
|
+
// The pass below examines INDEX rows. A registered handler path the index
|
|
1114
|
+
// join dropped was never examined — an unexamined unit, not a clean one.
|
|
1115
|
+
unreached = handlerPaths.filter((p) => !index.byPath.has(p));
|
|
1116
|
+
for (const e of index.entries) {
|
|
1117
|
+
if (e.dispatch === CommandDispatchKind.Meta)
|
|
1118
|
+
continue;
|
|
1119
|
+
if (!e.catalogued) {
|
|
1120
|
+
uncatalogued += 1;
|
|
1121
|
+
issues.push({
|
|
1122
|
+
code: 'registry-path-not-in-catalog',
|
|
1123
|
+
message: `"${e.path}" is registered and dispatchable but has no catalog row (no safety metadata) — add one to command-catalog.ts`,
|
|
1124
|
+
severity: 'warning',
|
|
1125
|
+
});
|
|
1126
|
+
}
|
|
1127
|
+
// A catalog row documenting an internal subverb of a handler that
|
|
1128
|
+
// DECLARES its subverbs — but not this one — documents a verb the handler
|
|
1129
|
+
// does not dispatch. (Handlers that declare nothing stay unchecked.)
|
|
1130
|
+
if (e.dispatch === CommandDispatchKind.Subverb && e.declared === false && e.parent) {
|
|
1131
|
+
const parentTokens = e.parent.split(' ');
|
|
1132
|
+
const declared = registry.getAt(parentTokens)?.subverbs;
|
|
1133
|
+
const name = e.tokens[parentTokens.length];
|
|
1134
|
+
if (declared && name !== undefined && !declared.some((s) => s.name === name || s.aliases?.includes(name))) {
|
|
1135
|
+
issues.push({
|
|
1136
|
+
code: 'undeclared-internal-subverb',
|
|
1137
|
+
message: `catalog documents "${e.path}" but "${e.parent}" declares its subverbs and "${name}" is not one of them`,
|
|
1138
|
+
severity: 'error',
|
|
1139
|
+
});
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1045
1144
|
const errors = issues.filter((i) => i.severity === 'error').length;
|
|
1046
1145
|
const warnings = issues.filter((i) => i.severity === 'warning').length;
|
|
1047
1146
|
return {
|
|
1048
1147
|
passed: errors === 0,
|
|
1049
1148
|
issues,
|
|
1050
1149
|
summary: {
|
|
1051
|
-
catalogEntries:
|
|
1150
|
+
catalogEntries: catalog.length,
|
|
1052
1151
|
registeredCommands: registered,
|
|
1053
1152
|
registeredSubcommands: registeredSub,
|
|
1054
1153
|
errors,
|
|
1055
1154
|
warnings,
|
|
1155
|
+
indexEntries,
|
|
1156
|
+
uncatalogued,
|
|
1157
|
+
},
|
|
1158
|
+
// Without a registry the path-level pass examined nothing — say so rather
|
|
1159
|
+
// than let a catalog-only run read as a full exhaustiveness check.
|
|
1160
|
+
coverage: {
|
|
1161
|
+
unit: 'registered command paths',
|
|
1162
|
+
expected: handlerPaths.length,
|
|
1163
|
+
examined: handlerPaths.length - unreached.length,
|
|
1164
|
+
...(unreached.length > 0
|
|
1165
|
+
? {
|
|
1166
|
+
unexamined: unreached.slice(0, 20),
|
|
1167
|
+
unexaminedTotal: unreached.length,
|
|
1168
|
+
reason: 'not reached by the command index',
|
|
1169
|
+
}
|
|
1170
|
+
: {}),
|
|
1171
|
+
...(registry ? {} : { reason: 'no command registry was supplied' }),
|
|
1056
1172
|
},
|
|
1057
1173
|
};
|
|
1058
1174
|
}
|
|
1059
|
-
|
|
1060
|
-
|
|
1175
|
+
/**
|
|
1176
|
+
* The exit-0 sentence. A ✓ only when there is nothing at all to report — "OK ✓"
|
|
1177
|
+
* under 78 warnings read as a clean catalog (policy-lint's §13 precedent).
|
|
1178
|
+
*/
|
|
1179
|
+
function commandsDoctorCleanLine(report) {
|
|
1180
|
+
const infos = report.issues.filter((i) => i.severity === 'info').length;
|
|
1181
|
+
if (report.summary.warnings > 0) {
|
|
1182
|
+
return `\nNo blocking catalog drift — ${report.summary.warnings} warning(s) reported above.`;
|
|
1183
|
+
}
|
|
1184
|
+
if (infos > 0)
|
|
1185
|
+
return `\nNo catalog drift — ${infos} note(s) reported above.`;
|
|
1186
|
+
return '\nVerdict: OK ✓';
|
|
1187
|
+
}
|
|
1188
|
+
function runCommandsDoctor(args, registry, catalog = COMMAND_CATALOG) {
|
|
1189
|
+
const report = buildCommandsDoctorReport(registry, catalog);
|
|
1061
1190
|
const strict = flagBool(args, 'strict');
|
|
1062
1191
|
// `--strict` promotes any catalog drift (warnings AND info) to a
|
|
1063
1192
|
// failing verdict. Without --strict, only errors fail the verdict.
|
|
1064
1193
|
const failed = report.summary.errors > 0 || (strict && report.summary.warnings > 0);
|
|
1194
|
+
// Settle first, render second: the path-level pass must have examined every
|
|
1195
|
+
// registered path for a clean verdict to be a pass.
|
|
1196
|
+
const settled = settleVerdict(failed ? 1 : 0, [report.coverage]);
|
|
1065
1197
|
if (flagBool(args, 'json')) {
|
|
1066
1198
|
process.stdout.write(asJson({
|
|
1067
1199
|
...report,
|
|
1068
1200
|
strict,
|
|
1069
|
-
verdict:
|
|
1201
|
+
verdict: settled.exit === 0 ? 'clean' : settled.exit === 1 ? 'drift' : 'not-verified',
|
|
1202
|
+
exitCode: settled.exit,
|
|
1203
|
+
shortfalls: settled.shortfalls,
|
|
1070
1204
|
}) + '\n');
|
|
1071
|
-
return
|
|
1205
|
+
return settled.exit;
|
|
1072
1206
|
}
|
|
1073
1207
|
process.stdout.write(header('Command catalog doctor'));
|
|
1074
1208
|
process.stdout.write(` catalogEntries: ${report.summary.catalogEntries}\n` +
|
|
1075
1209
|
` registered: ${report.summary.registeredCommands}\n` +
|
|
1076
1210
|
` subcommands: ${report.summary.registeredSubcommands}\n` +
|
|
1211
|
+
` index entries: ${report.summary.indexEntries}\n` +
|
|
1212
|
+
` uncatalogued: ${report.summary.uncatalogued}\n` +
|
|
1077
1213
|
` errors: ${report.summary.errors}\n` +
|
|
1078
1214
|
` warnings: ${report.summary.warnings}\n` +
|
|
1079
1215
|
(strict ? ` strict: on\n` : '') +
|
|
1080
1216
|
'\n');
|
|
1081
1217
|
if (report.issues.length === 0) {
|
|
1082
1218
|
process.stdout.write('No issues.\n');
|
|
1083
|
-
return 0;
|
|
1084
1219
|
}
|
|
1085
1220
|
for (const i of report.issues) {
|
|
1086
1221
|
process.stdout.write(` ${i.severity.toUpperCase().padEnd(8)} ${i.code.padEnd(34)} ${i.message}\n`);
|
|
1087
1222
|
}
|
|
1088
|
-
|
|
1089
|
-
|
|
1223
|
+
if (settled.exit === 1)
|
|
1224
|
+
process.stdout.write('\nVerdict: CATALOG DRIFT\n');
|
|
1225
|
+
const line = verdictLine(settled, commandsDoctorCleanLine(report));
|
|
1226
|
+
if (line)
|
|
1227
|
+
process.stdout.write(line + '\n');
|
|
1228
|
+
return settled.exit;
|
|
1090
1229
|
}
|
|
1091
1230
|
function printCatalog(args, entries) {
|
|
1092
1231
|
if (flagBool(args, 'json')) {
|
|
@@ -1166,7 +1305,7 @@ function printCompactCatalog(args, entries) {
|
|
|
1166
1305
|
process.stdout.write(' $ shrk commands overlaps — overlapping surfaces + preferred entrypoint\n');
|
|
1167
1306
|
process.stdout.write(' $ shrk commands retirement-plan — lifecycle backlog\n');
|
|
1168
1307
|
process.stdout.write(' $ shrk commands taxonomy — domain grouping\n');
|
|
1169
|
-
process.stdout.write(' $ shrk
|
|
1308
|
+
process.stdout.write(' $ shrk explain <cmd> — detail for one command\n');
|
|
1170
1309
|
return 0;
|
|
1171
1310
|
}
|
|
1172
1311
|
function sortByCommand(entries) {
|
|
@@ -1304,15 +1443,21 @@ function extractShrkRefs(content) {
|
|
|
1304
1443
|
}
|
|
1305
1444
|
async function runCommandsDocsCheck(args) {
|
|
1306
1445
|
const report = await buildDocsCheckReport();
|
|
1446
|
+
// Zero docs read checked nothing: a ✓ over it is the "check that cannot
|
|
1447
|
+
// fail" this round removes — NOT VERIFIED (2), never a pass.
|
|
1448
|
+
const examinedNothing = report.filesChecked === 0;
|
|
1449
|
+
const exit = !report.passed ? 1 : examinedNothing ? 2 : 0;
|
|
1307
1450
|
if (flagBool(args, 'json')) {
|
|
1308
|
-
process.stdout.write(asJson(report) + '\n');
|
|
1309
|
-
return
|
|
1451
|
+
process.stdout.write(asJson({ ...report, exitCode: exit, ...(examinedNothing ? { verdict: 'not-verified' } : {}) }) + '\n');
|
|
1452
|
+
return exit;
|
|
1310
1453
|
}
|
|
1311
1454
|
process.stdout.write(header('Commands docs-check'));
|
|
1312
1455
|
process.stdout.write(` files ${report.filesChecked} errors ${report.summary.errors} warnings ${report.summary.warnings} info ${report.summary.info}\n\n`);
|
|
1313
1456
|
if (report.issues.length === 0) {
|
|
1314
|
-
process.stdout.write(
|
|
1315
|
-
|
|
1457
|
+
process.stdout.write(examinedNothing
|
|
1458
|
+
? `NOT VERIFIED: 0 of ${DOCS_TO_CHECK.length} docs to check exist here (${DOCS_TO_CHECK.join(', ')}) — nothing was checked (this is not a pass).\n`
|
|
1459
|
+
: 'No docs drift detected. ✓\n');
|
|
1460
|
+
return exit;
|
|
1316
1461
|
}
|
|
1317
1462
|
for (const i of report.issues) {
|
|
1318
1463
|
const tag = `[${i.severity.padEnd(8)}] ${i.code.padEnd(28)}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compress.command.d.ts","sourceRoot":"","sources":["../../src/commands/compress.command.ts"],"names":[],"mappings":"AASA,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"compress.command.d.ts","sourceRoot":"","sources":["../../src/commands/compress.command.ts"],"names":[],"mappings":"AASA,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AA+FhC,eAAO,MAAM,eAAe,EAAE,eA6H7B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,eA4B3B,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { readFileSync } from 'node:fs';
|
|
|
2
2
|
import { Buffer } from 'node:buffer';
|
|
3
3
|
import { compressContent, ECompressionStrategy, EContentType, } from '@shrkcrft/compress';
|
|
4
4
|
import { flagBool, flagNumber, flagString, resolveCwd, } from "../command-registry.js";
|
|
5
|
+
import { PositionalMode } from "../dispatch/positional-mode.js";
|
|
5
6
|
import { asJson } from "../output/format-output.js";
|
|
6
7
|
import { ccrDir, openCcrStore } from "../output/ccr-store-config.js";
|
|
7
8
|
const CONTENT_TYPES = new Set(Object.values(EContentType));
|
|
@@ -85,6 +86,9 @@ const COMPRESS_BOOLEAN_FLAGS = new Set([
|
|
|
85
86
|
]);
|
|
86
87
|
export const compressCommand = {
|
|
87
88
|
name: 'compress',
|
|
89
|
+
// positional[0] is the input FILE (`-` / --stdin read stdin); a verb-shaped
|
|
90
|
+
// non-file is refused before it becomes an ENOENT.
|
|
91
|
+
positionals: PositionalMode.Path,
|
|
88
92
|
description: 'Compress a blob (file or stdin) deterministically to cut tokens — JSON→table, logs/search/diffs→signal. Reversible via `shrk expand`. NOTE: `--type code` emits a LOSSY outline (function bodies elided) — good for fitting more code into context, NOT for line-accurate reading; use plain Read (or `--lossless`) to inspect a file.',
|
|
89
93
|
usage: 'shrk [--cwd <dir>] compress [<file>|-] [--stdin] [--type <content-type>] [--query <text>] [--max <n>] [--lossless] [--no-cache] [--json]',
|
|
90
94
|
booleanFlags: COMPRESS_BOOLEAN_FLAGS,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constructs.command.d.ts","sourceRoot":"","sources":["../../src/commands/constructs.command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constructs.command.d.ts","sourceRoot":"","sources":["../../src/commands/constructs.command.ts"],"names":[],"mappings":"AAgCA,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAoKhC,eAAO,MAAM,qBAAqB,EAAE,eA2BnC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,eAmDlC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,eAgGpC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,eAyErC,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,eAyDtC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,eA2BpC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,eAiClC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,eAiBrC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,eAkBrC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,eA2BrC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,eA8BrC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,eA0DpC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,eAqMpC,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { mkdirSync, writeFileSync } from 'node:fs';
|
|
2
2
|
import * as nodePath from 'node:path';
|
|
3
|
-
import { AdoptionCheckpointStatus, buildConstructAdoptionDiff, buildConstructAdoptionPlan, buildSearchIndex, ConstructAdoptionCategory, evaluateAdoptionCheckpoint, hashDiffBody, inferConstructs, InferredConstructConfidence, inspectSharkcraft, loadConstructs, loadPlaybooks, readAdoptionCheckpoint, readConstructAdoptionStatus, recordAdoptionCheckpoint, renderConstructAdoptionDiff, renderConstructAdoptionMarkdown, renderConstructDraftsModule, searchIndex, SearchKind, traceConstruct, writeConstructAdoption, } from '@shrkcrft/inspector';
|
|
3
|
+
import { AdoptionCheckpointStatus, buildConstructAdoptionDiff, buildDeclaredXrefReport, buildConstructAdoptionPlan, buildSearchIndex, ConstructAdoptionCategory, ContributionKind, evaluateAdoptionCheckpoint, hashDiffBody, inferConstructs, InferredConstructConfidence, inspectSharkcraft, loadConstructs, loadPlaybooks, readAdoptionCheckpoint, readConstructAdoptionStatus, recordAdoptionCheckpoint, renderConstructAdoptionDiff, renderConstructAdoptionMarkdown, renderConstructDraftsModule, searchIndex, SearchKind, traceConstruct, writeConstructAdoption, } from '@shrkcrft/inspector';
|
|
4
4
|
import { GraphQueryApi, GraphStore } from '@shrkcrft/graph';
|
|
5
5
|
import { flagBool, flagNumber, flagString, resolveCwd, } from "../command-registry.js";
|
|
6
|
+
import { PositionalMode } from "../dispatch/positional-mode.js";
|
|
7
|
+
import { writeRejectedEntriesNote } from "../output/rejected-entries-note.js";
|
|
6
8
|
import { asJson, header } from "../output/format-output.js";
|
|
7
9
|
/**
|
|
8
10
|
* A construct subverb was handed an id that is NOT a registered construct.
|
|
@@ -129,19 +131,25 @@ export const constructsListCommand = {
|
|
|
129
131
|
description: 'List registered constructs.',
|
|
130
132
|
usage: 'shrk constructs list [--type <type>] [--json]',
|
|
131
133
|
async run(args) {
|
|
132
|
-
const { constructs } = await loadAll(args);
|
|
134
|
+
const { constructs, inspection } = await loadAll(args);
|
|
133
135
|
const type = flagString(args, 'type');
|
|
134
136
|
const list = type ? constructs.filter((c) => c.type === type) : constructs;
|
|
137
|
+
// A construct (or facet) its loader refused is named (round 12, 12.1) —
|
|
138
|
+
// an id-less one used to vanish, and one without `type` crashed this list.
|
|
139
|
+
const kinds = [ContributionKind.Construct, ContributionKind.ConstructFacet];
|
|
140
|
+
const note = { next: 'shrk packs contributions' };
|
|
135
141
|
if (flagBool(args, 'json')) {
|
|
136
142
|
process.stdout.write(asJson(list) + '\n');
|
|
143
|
+
await writeRejectedEntriesNote(inspection, kinds, { ...note, json: true });
|
|
137
144
|
return 0;
|
|
138
145
|
}
|
|
139
146
|
process.stdout.write(header(`Constructs (${list.length})`));
|
|
140
147
|
if (list.length === 0)
|
|
141
148
|
process.stdout.write(' (none)\n');
|
|
142
149
|
for (const c of list) {
|
|
143
|
-
process.stdout.write(` ${c.id.padEnd(40)} ${c.type.padEnd(12)} ${c.title}\n`);
|
|
150
|
+
process.stdout.write(` ${c.id.padEnd(40)} ${String(c.type ?? '').padEnd(12)} ${c.title ?? ''}\n`);
|
|
144
151
|
}
|
|
152
|
+
await writeRejectedEntriesNote(inspection, kinds, note);
|
|
145
153
|
return 0;
|
|
146
154
|
},
|
|
147
155
|
};
|
|
@@ -388,18 +396,29 @@ export const constructsRelatedCommand = {
|
|
|
388
396
|
process.stderr.write('Usage: shrk constructs related <id>\n');
|
|
389
397
|
return 2;
|
|
390
398
|
}
|
|
391
|
-
const { constructs } = await loadAll(args);
|
|
399
|
+
const { constructs, inspection } = await loadAll(args);
|
|
392
400
|
const c = constructs.find((x) => x.id === id);
|
|
393
401
|
if (!c) {
|
|
394
402
|
return emitConstructMiss(id, args);
|
|
395
403
|
}
|
|
404
|
+
// Each id annotated from THE declared cross-reference collector: the
|
|
405
|
+
// namespace(s) it resolved into, or UNRESOLVED. The `[kind]` label is the
|
|
406
|
+
// FIELD's kind — it used to be the only thing printed, so a dangling id
|
|
407
|
+
// rendered exactly like a live one.
|
|
408
|
+
const xrefs = await buildDeclaredXrefReport(inspection);
|
|
409
|
+
const rowFor = new Map(xrefs.rows
|
|
410
|
+
.filter((r) => r.sourceKind === 'construct' && r.sourceId === id)
|
|
411
|
+
.map((r) => [`${r.field}|${r.targetId}`, r]));
|
|
396
412
|
const related = [
|
|
397
|
-
...(c.relatedKnowledge ?? []).map((
|
|
398
|
-
...(c.relatedRules ?? []).map((
|
|
399
|
-
...(c.relatedTemplates ?? []).map((
|
|
400
|
-
...(c.relatedPipelines ?? []).map((
|
|
401
|
-
...(c.relatedPathConventions ?? []).map((
|
|
402
|
-
]
|
|
413
|
+
...(c.relatedKnowledge ?? []).map((rid) => ({ kind: 'knowledge', id: rid, field: 'relatedKnowledge' })),
|
|
414
|
+
...(c.relatedRules ?? []).map((rid) => ({ kind: 'rule', id: rid, field: 'relatedRules' })),
|
|
415
|
+
...(c.relatedTemplates ?? []).map((rid) => ({ kind: 'template', id: rid, field: 'relatedTemplates' })),
|
|
416
|
+
...(c.relatedPipelines ?? []).map((rid) => ({ kind: 'pipeline', id: rid, field: 'relatedPipelines' })),
|
|
417
|
+
...(c.relatedPathConventions ?? []).map((rid) => ({ kind: 'path', id: rid, field: 'relatedPathConventions' })),
|
|
418
|
+
].map((r) => {
|
|
419
|
+
const row = rowFor.get(`${r.field}|${r.id}`);
|
|
420
|
+
return { kind: r.kind, id: r.id, resolvedAs: row?.resolvedAs ?? [], status: row?.status ?? 'unverified' };
|
|
421
|
+
});
|
|
403
422
|
if (flagBool(args, 'json')) {
|
|
404
423
|
process.stdout.write(asJson({ id, related }) + '\n');
|
|
405
424
|
return 0;
|
|
@@ -409,8 +428,16 @@ export const constructsRelatedCommand = {
|
|
|
409
428
|
process.stdout.write(' (none)\n');
|
|
410
429
|
return 0;
|
|
411
430
|
}
|
|
412
|
-
for (const r of related)
|
|
413
|
-
|
|
431
|
+
for (const r of related) {
|
|
432
|
+
const resolved = r.status === 'ok'
|
|
433
|
+
? `→ ${r.resolvedAs.join(' | ')}`
|
|
434
|
+
: r.status === 'dangling'
|
|
435
|
+
? 'UNRESOLVED — no registry has this id'
|
|
436
|
+
: r.status === 'wrong-kind'
|
|
437
|
+
? `WRONG KIND — resolves as ${r.resolvedAs.join(' | ')}`
|
|
438
|
+
: 'NOT VERIFIED';
|
|
439
|
+
process.stdout.write(` • [${r.kind}] ${r.id} ${resolved}\n`);
|
|
440
|
+
}
|
|
414
441
|
return 0;
|
|
415
442
|
},
|
|
416
443
|
};
|
|
@@ -634,6 +661,17 @@ export const constructsInferCommand = {
|
|
|
634
661
|
};
|
|
635
662
|
export const constructsAdoptCommand = {
|
|
636
663
|
name: 'adopt',
|
|
664
|
+
// An unknown token used to fall through to the adoption plan at exit 0.
|
|
665
|
+
positionals: PositionalMode.None,
|
|
666
|
+
subverbs: [
|
|
667
|
+
{ name: 'status', description: 'Construct-adoption status.', usage: 'shrk constructs adopt status [--json]' },
|
|
668
|
+
{ name: 'review', description: 'Review the construct-adoption plan.', usage: 'shrk constructs adopt review [--json]' },
|
|
669
|
+
{
|
|
670
|
+
name: 'diff',
|
|
671
|
+
description: 'Diff the adoption plan against constructs.ts.',
|
|
672
|
+
usage: 'shrk constructs adopt diff [--format text|markdown|html|json] [--record-checkpoint]',
|
|
673
|
+
},
|
|
674
|
+
],
|
|
637
675
|
description: 'Build a construct-adoption plan from inferred drafts; classify safe / manual / low-confidence / already-covered / conflict. Never modifies constructs.ts.',
|
|
638
676
|
usage: 'shrk constructs adopt [--dry-run|--write-patch] [--confidence high|medium|low] [--include facets,publicApi,events,tokens] [--json]\n shrk constructs adopt status [--json]\n shrk constructs adopt review [--json]\n shrk constructs adopt diff [--format text|markdown|html|json]',
|
|
639
677
|
async run(args) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.command.d.ts","sourceRoot":"","sources":["../../src/commands/context.command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.command.d.ts","sourceRoot":"","sources":["../../src/commands/context.command.ts"],"names":[],"mappings":"AAmBA,OAAO,EAML,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AA+ChC,eAAO,MAAM,cAAc,EAAE,eAiL5B,CAAC"}
|
|
@@ -3,8 +3,13 @@ import { buildContext } from '@shrkcrft/context';
|
|
|
3
3
|
import { loadIntentBenchmark, runIntentBenchmark, STARTER_INTENT_BENCHMARK, writeBenchmarkRun, } from '@shrkcrft/context-planner';
|
|
4
4
|
import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
|
|
5
5
|
import * as nodePath from 'node:path';
|
|
6
|
-
import { buildUniversalSearch,
|
|
6
|
+
import { buildUniversalSearch, rankRecommendationCandidates, recommendationReportFromRanking, renderOverviewText, buildProjectOverview, } from '@shrkcrft/inspector';
|
|
7
7
|
import { flagBool, flagNumber, flagString, flagList, resolveCwd, } from "../command-registry.js";
|
|
8
|
+
import { PositionalMode } from "../dispatch/positional-mode.js";
|
|
9
|
+
import { catalogCommandSafety } from "../surface/catalog-command-safety.js";
|
|
10
|
+
import { dropNotApplicable } from "../surface/audience-applicability.js";
|
|
11
|
+
import { loadSurfaceContext } from "../surface/load-surface-context.js";
|
|
12
|
+
import { buildSurfaceSummary } from "../surface/surface-summary.js";
|
|
8
13
|
import { asJson, header } from "../output/format-output.js";
|
|
9
14
|
/**
|
|
10
15
|
* Budget used for the DEFAULT full human-text orientation view when the caller
|
|
@@ -40,6 +45,22 @@ function minimalContext(task, result, commands) {
|
|
|
40
45
|
}
|
|
41
46
|
export const contextCommand = {
|
|
42
47
|
name: 'context',
|
|
48
|
+
// The task is `--task "<task>"`; a bare token is no subverb and no task.
|
|
49
|
+
positionals: PositionalMode.None,
|
|
50
|
+
subverbs: [
|
|
51
|
+
{ name: 'build', description: 'Build the persisted task context.', usage: 'shrk context build --task "<task>" [--json]' },
|
|
52
|
+
{ name: 'refresh', description: 'Refresh the persisted task context.', usage: 'shrk context refresh [--json]' },
|
|
53
|
+
{ name: 'status', description: 'The persisted task context status.', usage: 'shrk context status [--json]' },
|
|
54
|
+
{
|
|
55
|
+
name: 'benchmark',
|
|
56
|
+
description: 'Score context retrieval against sharkcraft/intent-benchmark.json (`seed` writes a starter).',
|
|
57
|
+
usage: 'shrk context benchmark [seed] [--no-persist] [--json]',
|
|
58
|
+
positionals: PositionalMode.None,
|
|
59
|
+
subverbs: [
|
|
60
|
+
{ name: 'seed', description: 'Write a starter intent benchmark.', usage: 'shrk context benchmark seed [--json]' },
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
],
|
|
43
64
|
description: 'Build relevant AI-ready context for a task (token-budgeted). Subcommands: build / refresh / status.',
|
|
44
65
|
usage: 'shrk context [build|refresh|status] --task "<task>" [--max-tokens 3000] [--framework x] [--area y] [--json] [--compact] [--full]',
|
|
45
66
|
async run(args) {
|
|
@@ -112,8 +133,18 @@ export const contextCommand = {
|
|
|
112
133
|
let routingMatches = [];
|
|
113
134
|
let searchReport = null;
|
|
114
135
|
try {
|
|
115
|
-
|
|
116
|
-
|
|
136
|
+
// THE ranked list — the same one `shrk recommend` and MCP
|
|
137
|
+
// `recommend_commands` render, so a matched routing hint's commands
|
|
138
|
+
// reach "Top commands" here too, attributed.
|
|
139
|
+
const ranked = await rankRecommendationCandidates(inspection, task, {
|
|
140
|
+
safetyOf: (command) => catalogCommandSafety(command),
|
|
141
|
+
});
|
|
142
|
+
// THE audience filter `shrk recommend` applies: outside SharkCraft's own
|
|
143
|
+
// repository a tool-maintenance command (a recipe's `release readiness`)
|
|
144
|
+
// is no recommendation — it exits 78 there.
|
|
145
|
+
const { context: surfaceContext } = await loadSurfaceContext({ cwd: inspection.projectRoot, inspection });
|
|
146
|
+
commandRecommendations = dropNotApplicable(recommendationReportFromRanking(ranked), buildSurfaceSummary(surfaceContext));
|
|
147
|
+
routingMatches = ranked.routingMatches;
|
|
117
148
|
searchReport = await buildUniversalSearch(inspection, task, {});
|
|
118
149
|
}
|
|
119
150
|
catch {
|
|
@@ -146,9 +177,13 @@ export const contextCommand = {
|
|
|
146
177
|
process.stdout.write(`omitted (budget): ${result.omittedSections.join(', ')}\n`);
|
|
147
178
|
}
|
|
148
179
|
if (commandRecommendations && commandRecommendations.recommendations.length > 0) {
|
|
149
|
-
|
|
180
|
+
const confident = commandRecommendations.confident;
|
|
181
|
+
process.stdout.write(confident
|
|
182
|
+
? '\nTop commands:\n'
|
|
183
|
+
: '\nTop commands (no confident match — weak candidates, verify before acting):\n');
|
|
150
184
|
for (const r of commandRecommendations.recommendations.slice(0, 4)) {
|
|
151
|
-
|
|
185
|
+
const mark = !confident || r.weak === true ? '?' : '$';
|
|
186
|
+
process.stdout.write(` ${mark} ${r.command}${r.attribution ? ` — ${r.attribution}` : ''}\n`);
|
|
152
187
|
}
|
|
153
188
|
}
|
|
154
189
|
if (routingMatches.length > 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract-templates.command.d.ts","sourceRoot":"","sources":["../../src/commands/contract-templates.command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"contract-templates.command.d.ts","sourceRoot":"","sources":["../../src/commands/contract-templates.command.ts"],"names":[],"mappings":"AAWA,OAAO,EAIL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAIhC,eAAO,MAAM,2BAA2B,EAAE,eAwBzC,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,eAgCxC,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,eAuC3C,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,eA0B9C,CAAC;AAEF,2EAA2E;AAC3E,eAAO,MAAM,uBAAuB,EAAE,eAkBrC,CAAC"}
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
import { mkdirSync, writeFileSync } from 'node:fs';
|
|
2
2
|
import * as nodePath from 'node:path';
|
|
3
|
-
import { getContractTemplate, listContractTemplates, recommendContractTemplate, renderContractTemplateMarkdown, renderContractTemplateText, } from '@shrkcrft/inspector';
|
|
3
|
+
import { ContributionKind, getContractTemplate, inspectSharkcraft, listContractTemplates, recommendContractTemplate, renderContractTemplateMarkdown, renderContractTemplateText, } from '@shrkcrft/inspector';
|
|
4
4
|
import { flagBool, flagString, resolveCwd, } from "../command-registry.js";
|
|
5
5
|
import { asJson } from "../output/format-output.js";
|
|
6
|
+
import { writeRejectedEntriesNote } from "../output/rejected-entries-note.js";
|
|
6
7
|
export const contractTemplateListCommand = {
|
|
7
8
|
name: 'list',
|
|
8
9
|
description: 'List built-in contract templates. Read-only.',
|
|
9
10
|
usage: 'shrk contract template list [--json]',
|
|
10
11
|
async run(args) {
|
|
11
12
|
const list = listContractTemplates();
|
|
13
|
+
// A contributed contract template its loader refused is named (round 12,
|
|
14
|
+
// 12.1) — it used to read `Invalid contract template at <file>; skipped.`
|
|
15
|
+
// on no surface at all.
|
|
16
|
+
const inspection = await inspectSharkcraft({ cwd: resolveCwd(args) });
|
|
17
|
+
const note = { next: 'shrk packs contributions' };
|
|
12
18
|
if (flagBool(args, 'json')) {
|
|
13
19
|
process.stdout.write(asJson(list) + '\n');
|
|
20
|
+
await writeRejectedEntriesNote(inspection, [ContributionKind.ContractTemplate], { ...note, json: true });
|
|
14
21
|
return 0;
|
|
15
22
|
}
|
|
16
23
|
for (const t of list) {
|
|
@@ -18,6 +25,7 @@ export const contractTemplateListCommand = {
|
|
|
18
25
|
process.stdout.write(` role: ${t.role} / mode: ${t.mode}\n`);
|
|
19
26
|
process.stdout.write(` ${t.description}\n\n`);
|
|
20
27
|
}
|
|
28
|
+
await writeRejectedEntriesNote(inspection, [ContributionKind.ContractTemplate], note);
|
|
21
29
|
return 0;
|
|
22
30
|
},
|
|
23
31
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract.command.d.ts","sourceRoot":"","sources":["../../src/commands/contract.command.ts"],"names":[],"mappings":"AASA,OAAO,EAIL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"contract.command.d.ts","sourceRoot":"","sources":["../../src/commands/contract.command.ts"],"names":[],"mappings":"AASA,OAAO,EAIL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AA6BhC,eAAO,MAAM,eAAe,EAAE,eAuH7B,CAAC"}
|