@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
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { type ICommandCatalogEntry } from '../commands/command-catalog.js';
|
|
2
|
+
import type { CommandRegistry } from '../command-registry.js';
|
|
3
|
+
import type { ICommandIndexEntry } from './command-index-entry.js';
|
|
4
|
+
import type { ICommandIndex } from './i-command-index.js';
|
|
5
|
+
/**
|
|
6
|
+
* THE command index — the one answer to "does this command / subverb / meta
|
|
7
|
+
* flag exist, what does it do, who is it for".
|
|
8
|
+
*
|
|
9
|
+
* Before round 11 there were three disagreeing inventories: the dispatch trie
|
|
10
|
+
* (326 handler paths), COMMAND_CATALOG (442 rows, 55 of them flag variants of
|
|
11
|
+
* another row) and help's own catalog walk. `surface list` enumerated the
|
|
12
|
+
* catalog, so 75 registered verbs were absent from "the callable-command
|
|
13
|
+
* inventory", and a command-string check against it would have deleted correct
|
|
14
|
+
* commands. The index is built from the registry (what actually dispatches)
|
|
15
|
+
* and JOINED with the catalog (what documents it):
|
|
16
|
+
*
|
|
17
|
+
* (a) every `registry.listAll()` path → `Trie`
|
|
18
|
+
* (b) every subverb a handler declares (`subverbs`) → `Subverb` (declared)
|
|
19
|
+
* (c) every catalog path dispatched internally by a
|
|
20
|
+
* real handler (`check wiring`, `graph status`) → `Subverb`
|
|
21
|
+
* (d) catalog-documented command groups (`paths`) → `Trie`
|
|
22
|
+
* (e) the bootstrap meta flags → `Meta`
|
|
23
|
+
*
|
|
24
|
+
* Catalog rows that only add flags or placeholders fold into `variants`.
|
|
25
|
+
* `surface list`, `help`, `commands doctor`, the surface gate and the
|
|
26
|
+
* command-string resolver all read this — never COMMAND_CATALOG directly.
|
|
27
|
+
*/
|
|
28
|
+
/** Meta flags `runCliInner` handles before dispatch. Always callable. */
|
|
29
|
+
export declare const META_COMMANDS: readonly {
|
|
30
|
+
path: string;
|
|
31
|
+
description: string;
|
|
32
|
+
usage: string;
|
|
33
|
+
}[];
|
|
34
|
+
/** A token that can be a command-path segment (not a flag, placeholder, quote or path). */
|
|
35
|
+
export declare function isCommandWord(token: string): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* The command path a catalog `command` string documents: its leading run of
|
|
38
|
+
* command words, stopping at the first flag, placeholder, quoted argument or
|
|
39
|
+
* path (`impact graph <impact.json>` → `impact graph`,
|
|
40
|
+
* `architecture violations --changed-only` → `architecture violations`).
|
|
41
|
+
*/
|
|
42
|
+
export declare function cleanCommandPath(command: string): string;
|
|
43
|
+
/**
|
|
44
|
+
* Build the command index. With a registry it is the dispatch table joined
|
|
45
|
+
* with the catalog; without one it degrades to the catalog, relabelled
|
|
46
|
+
* (`registryBacked: false`, every entry `Catalog`) rather than passed off as
|
|
47
|
+
* the dispatch table.
|
|
48
|
+
*
|
|
49
|
+
* `catalog` defaults to COMMAND_CATALOG; a test passes its own rows to prove a
|
|
50
|
+
* join (an undeclared internal subverb) against a registry of its own.
|
|
51
|
+
*/
|
|
52
|
+
export declare function buildCommandIndex(registry?: CommandRegistry, catalog?: readonly ICommandCatalogEntry[]): ICommandIndex;
|
|
53
|
+
/** The entry at `path`, or the entry a folded variant / alias spelling belongs to. */
|
|
54
|
+
export declare function findCommandIndexEntry(index: ICommandIndex, command: string): ICommandIndexEntry | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* The known subverb names directly below `path`: the next token of every index
|
|
57
|
+
* entry under it, at any depth (`ci scaffold gitlab` makes `scaffold` a known
|
|
58
|
+
* subverb of `ci` even though `ci scaffold` has no row of its own). Sorted,
|
|
59
|
+
* distinct.
|
|
60
|
+
*/
|
|
61
|
+
export declare function subverbNamesOf(index: ICommandIndex, path: string): string[];
|
|
62
|
+
/**
|
|
63
|
+
* The index of `registry` (over COMMAND_CATALOG), built once per registry and
|
|
64
|
+
* shared — the dispatcher guard, the help intercept, `help` and the active
|
|
65
|
+
* index all read the same object.
|
|
66
|
+
*/
|
|
67
|
+
export declare function commandIndexFor(registry: CommandRegistry): ICommandIndex;
|
|
68
|
+
/** Called by `runCliInner` with the registry it dispatches from. */
|
|
69
|
+
export declare function setActiveCommandRegistry(registry: CommandRegistry | undefined): void;
|
|
70
|
+
/**
|
|
71
|
+
* The index of the registry this CLI run dispatches from, or `undefined`
|
|
72
|
+
* outside `runCli` (a direct engine call) — callers then degrade loudly
|
|
73
|
+
* (`buildCommandIndex()` relabelled as the catalog, or no command resolver →
|
|
74
|
+
* NOT VERIFIED), never to a silent guess.
|
|
75
|
+
*/
|
|
76
|
+
export declare function getActiveCommandIndex(): ICommandIndex | undefined;
|
|
77
|
+
//# sourceMappingURL=command-index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-index.d.ts","sourceRoot":"","sources":["../../src/surface/command-index.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,oBAAoB,EAC1B,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,eAAe,EAAmB,MAAM,wBAAwB,CAAC;AAI/E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,yEAAyE;AACzE,eAAO,MAAM,aAAa,EAAE,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAsBrF,CAAC;AAIL,2FAA2F;AAC3F,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAOxD;AA0FD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,CAAC,EAAE,eAAe,EAC1B,OAAO,GAAE,SAAS,oBAAoB,EAAoB,GACzD,aAAa,CA8Hf;AAED,sFAAsF;AACtF,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,aAAa,EACpB,OAAO,EAAE,MAAM,GACd,kBAAkB,GAAG,SAAS,CAOhC;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAW3E;AAaD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,eAAe,GAAG,aAAa,CAOxE;AAED,oEAAoE;AACpE,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,eAAe,GAAG,SAAS,GAAG,IAAI,CAEpF;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,IAAI,aAAa,GAAG,SAAS,CAEjE"}
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
import { COMMAND_CATALOG, CommandAudience, commandAudience, } from "../commands/command-catalog.js";
|
|
2
|
+
import { CommandDispatchKind } from "./command-dispatch-kind.js";
|
|
3
|
+
/**
|
|
4
|
+
* THE command index — the one answer to "does this command / subverb / meta
|
|
5
|
+
* flag exist, what does it do, who is it for".
|
|
6
|
+
*
|
|
7
|
+
* Before round 11 there were three disagreeing inventories: the dispatch trie
|
|
8
|
+
* (326 handler paths), COMMAND_CATALOG (442 rows, 55 of them flag variants of
|
|
9
|
+
* another row) and help's own catalog walk. `surface list` enumerated the
|
|
10
|
+
* catalog, so 75 registered verbs were absent from "the callable-command
|
|
11
|
+
* inventory", and a command-string check against it would have deleted correct
|
|
12
|
+
* commands. The index is built from the registry (what actually dispatches)
|
|
13
|
+
* and JOINED with the catalog (what documents it):
|
|
14
|
+
*
|
|
15
|
+
* (a) every `registry.listAll()` path → `Trie`
|
|
16
|
+
* (b) every subverb a handler declares (`subverbs`) → `Subverb` (declared)
|
|
17
|
+
* (c) every catalog path dispatched internally by a
|
|
18
|
+
* real handler (`check wiring`, `graph status`) → `Subverb`
|
|
19
|
+
* (d) catalog-documented command groups (`paths`) → `Trie`
|
|
20
|
+
* (e) the bootstrap meta flags → `Meta`
|
|
21
|
+
*
|
|
22
|
+
* Catalog rows that only add flags or placeholders fold into `variants`.
|
|
23
|
+
* `surface list`, `help`, `commands doctor`, the surface gate and the
|
|
24
|
+
* command-string resolver all read this — never COMMAND_CATALOG directly.
|
|
25
|
+
*/
|
|
26
|
+
/** Meta flags `runCliInner` handles before dispatch. Always callable. */
|
|
27
|
+
export const META_COMMANDS = Object.freeze([
|
|
28
|
+
{
|
|
29
|
+
path: '--about',
|
|
30
|
+
description: 'What shrk is and is not — the in-binary philosophy summary.',
|
|
31
|
+
usage: 'shrk --about',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
path: '--full-help',
|
|
35
|
+
description: 'Long help: every visible command (add --all for the whole catalog).',
|
|
36
|
+
usage: 'shrk --full-help [--all]',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
path: '--help',
|
|
40
|
+
description: 'The short start screen (same as `shrk help`).',
|
|
41
|
+
usage: 'shrk --help',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
path: '--version',
|
|
45
|
+
description: 'Print the installed shrk version.',
|
|
46
|
+
usage: 'shrk --version',
|
|
47
|
+
},
|
|
48
|
+
]);
|
|
49
|
+
const COMMAND_WORD = /^[a-z0-9][a-z0-9-]*$/i;
|
|
50
|
+
/** A token that can be a command-path segment (not a flag, placeholder, quote or path). */
|
|
51
|
+
export function isCommandWord(token) {
|
|
52
|
+
return COMMAND_WORD.test(token);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The command path a catalog `command` string documents: its leading run of
|
|
56
|
+
* command words, stopping at the first flag, placeholder, quoted argument or
|
|
57
|
+
* path (`impact graph <impact.json>` → `impact graph`,
|
|
58
|
+
* `architecture violations --changed-only` → `architecture violations`).
|
|
59
|
+
*/
|
|
60
|
+
export function cleanCommandPath(command) {
|
|
61
|
+
const out = [];
|
|
62
|
+
for (const token of command.trim().split(/\s+/)) {
|
|
63
|
+
if (!isCommandWord(token))
|
|
64
|
+
break;
|
|
65
|
+
out.push(token);
|
|
66
|
+
}
|
|
67
|
+
return out.join(' ');
|
|
68
|
+
}
|
|
69
|
+
function groupCatalogRows(catalog) {
|
|
70
|
+
const byPath = new Map();
|
|
71
|
+
for (const row of catalog) {
|
|
72
|
+
const path = cleanCommandPath(row.command);
|
|
73
|
+
if (path.length === 0)
|
|
74
|
+
continue;
|
|
75
|
+
const list = byPath.get(path) ?? [];
|
|
76
|
+
list.push(row);
|
|
77
|
+
byPath.set(path, list);
|
|
78
|
+
}
|
|
79
|
+
return byPath;
|
|
80
|
+
}
|
|
81
|
+
function sortedUnique(values) {
|
|
82
|
+
return [...new Set(values.filter((v) => v.length > 0))].sort();
|
|
83
|
+
}
|
|
84
|
+
function makeEntry(input) {
|
|
85
|
+
const rows = input.rows ?? [];
|
|
86
|
+
const base = rows.find((r) => r.command.trim() === input.path) ?? rows[0];
|
|
87
|
+
const variants = sortedUnique(rows.map((r) => r.command.trim()).filter((c) => c !== input.path));
|
|
88
|
+
const description = base?.description ?? input.subverb?.description ?? input.handler?.description ?? '';
|
|
89
|
+
const usage = input.subverb?.usage ?? input.handler?.usage;
|
|
90
|
+
const aliasParent = input.aliasParent ?? input.parent;
|
|
91
|
+
const subverbAliases = (input.subverb?.aliases ?? []).map((a) => aliasParent ? `${aliasParent} ${a}` : a);
|
|
92
|
+
const aliases = sortedUnique([
|
|
93
|
+
...(base?.aliases ?? []),
|
|
94
|
+
...(input.aliases ?? []),
|
|
95
|
+
...subverbAliases,
|
|
96
|
+
]);
|
|
97
|
+
const positionals = input.subverb?.positionals ?? input.handler?.positionals;
|
|
98
|
+
return {
|
|
99
|
+
path: input.path,
|
|
100
|
+
tokens: input.path.split(' '),
|
|
101
|
+
dispatch: input.dispatch,
|
|
102
|
+
description,
|
|
103
|
+
...(usage ? { usage } : {}),
|
|
104
|
+
catalogued: rows.length > 0,
|
|
105
|
+
...(base ? { catalogEntry: base } : {}),
|
|
106
|
+
variants,
|
|
107
|
+
aliases,
|
|
108
|
+
audience: base ? commandAudience(base) : [CommandAudience.Human],
|
|
109
|
+
...(input.parent !== undefined ? { parent: input.parent } : {}),
|
|
110
|
+
...(input.declared !== undefined ? { declared: input.declared } : {}),
|
|
111
|
+
...(positionals !== undefined ? { positionals } : {}),
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
/** Top-level alias spellings of `path` (`playbook list` for `playbooks list`). */
|
|
115
|
+
function aliasSpellings(path, topAliases) {
|
|
116
|
+
const head = path[0];
|
|
117
|
+
if (head === undefined)
|
|
118
|
+
return [];
|
|
119
|
+
return (topAliases.get(head) ?? []).map((alias) => [alias, ...path.slice(1)].join(' '));
|
|
120
|
+
}
|
|
121
|
+
function collectTopAliases(registry) {
|
|
122
|
+
const out = new Map();
|
|
123
|
+
const add = (alias, canonical) => {
|
|
124
|
+
const list = out.get(canonical) ?? [];
|
|
125
|
+
if (!list.includes(alias))
|
|
126
|
+
list.push(alias);
|
|
127
|
+
out.set(canonical, list);
|
|
128
|
+
};
|
|
129
|
+
for (const [alias, canonical] of registry.listGroupAliases())
|
|
130
|
+
add(alias, canonical);
|
|
131
|
+
for (const [alias, canonical] of registry.listCommandAliases())
|
|
132
|
+
add(alias, canonical);
|
|
133
|
+
return out;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Build the command index. With a registry it is the dispatch table joined
|
|
137
|
+
* with the catalog; without one it degrades to the catalog, relabelled
|
|
138
|
+
* (`registryBacked: false`, every entry `Catalog`) rather than passed off as
|
|
139
|
+
* the dispatch table.
|
|
140
|
+
*
|
|
141
|
+
* `catalog` defaults to COMMAND_CATALOG; a test passes its own rows to prove a
|
|
142
|
+
* join (an undeclared internal subverb) against a registry of its own.
|
|
143
|
+
*/
|
|
144
|
+
export function buildCommandIndex(registry, catalog = COMMAND_CATALOG) {
|
|
145
|
+
const rowsByPath = groupCatalogRows(catalog);
|
|
146
|
+
const entries = new Map();
|
|
147
|
+
if (registry) {
|
|
148
|
+
const topAliases = collectTopAliases(registry);
|
|
149
|
+
const all = registry.listAll();
|
|
150
|
+
// (a) every registered handler path.
|
|
151
|
+
for (const { path, handler } of all) {
|
|
152
|
+
const p = path.join(' ');
|
|
153
|
+
entries.set(p, makeEntry({
|
|
154
|
+
path: p,
|
|
155
|
+
dispatch: CommandDispatchKind.Trie,
|
|
156
|
+
rows: rowsByPath.get(p),
|
|
157
|
+
handler,
|
|
158
|
+
aliases: aliasSpellings(path, topAliases),
|
|
159
|
+
}));
|
|
160
|
+
}
|
|
161
|
+
// (b) subverbs a handler declares — nested ones too (`search tuning list`).
|
|
162
|
+
// A real trie child of the same name wins. `parent` stays the handler that
|
|
163
|
+
// dispatches the whole chain; aliases are spelled under the direct parent.
|
|
164
|
+
const addDeclared = (handlerPath, parentPath, specs) => {
|
|
165
|
+
for (const subverb of specs) {
|
|
166
|
+
const tokens = [...parentPath, subverb.name];
|
|
167
|
+
const p = tokens.join(' ');
|
|
168
|
+
if (!entries.has(p)) {
|
|
169
|
+
entries.set(p, makeEntry({
|
|
170
|
+
path: p,
|
|
171
|
+
dispatch: CommandDispatchKind.Subverb,
|
|
172
|
+
rows: rowsByPath.get(p),
|
|
173
|
+
subverb,
|
|
174
|
+
parent: handlerPath.join(' '),
|
|
175
|
+
aliasParent: parentPath.join(' '),
|
|
176
|
+
declared: true,
|
|
177
|
+
aliases: aliasSpellings(tokens, topAliases),
|
|
178
|
+
}));
|
|
179
|
+
}
|
|
180
|
+
if (subverb.subverbs)
|
|
181
|
+
addDeclared(handlerPath, tokens, subverb.subverbs);
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
for (const { path, handler } of all) {
|
|
185
|
+
addDeclared(path, path, handler.subverbs ?? []);
|
|
186
|
+
}
|
|
187
|
+
// (c)/(d) catalog paths the trie does not list verbatim.
|
|
188
|
+
for (const [p, rows] of rowsByPath) {
|
|
189
|
+
if (entries.has(p))
|
|
190
|
+
continue;
|
|
191
|
+
const res = registry.resolve(p.split(' '));
|
|
192
|
+
if (res.matchedPath.length === 0)
|
|
193
|
+
continue; // nothing dispatches it — `commands doctor` reports the row
|
|
194
|
+
const canonical = [...res.matchedPath, ...res.rest].join(' ');
|
|
195
|
+
const existing = entries.get(canonical);
|
|
196
|
+
if (existing) {
|
|
197
|
+
// An alias spelling of a path already indexed (`playbook list`).
|
|
198
|
+
entries.set(canonical, {
|
|
199
|
+
...existing,
|
|
200
|
+
catalogued: true,
|
|
201
|
+
...(existing.catalogEntry ? {} : rows[0] ? { catalogEntry: rows[0] } : {}),
|
|
202
|
+
variants: sortedUnique([...existing.variants, ...rows.map((r) => r.command.trim())]),
|
|
203
|
+
aliases: sortedUnique([...existing.aliases, p]),
|
|
204
|
+
});
|
|
205
|
+
continue;
|
|
206
|
+
}
|
|
207
|
+
if (res.rest.length === 0) {
|
|
208
|
+
// (d) A documented command group with no handler of its own.
|
|
209
|
+
if (res.node.children.size > 0) {
|
|
210
|
+
entries.set(canonical, makeEntry({ path: canonical, dispatch: CommandDispatchKind.Trie, rows }));
|
|
211
|
+
}
|
|
212
|
+
continue;
|
|
213
|
+
}
|
|
214
|
+
// (c) Dispatched internally by the deepest matched handler. A pure group
|
|
215
|
+
// node cannot dispatch a positional, so its "subverb" is not real.
|
|
216
|
+
if (!res.handler)
|
|
217
|
+
continue;
|
|
218
|
+
entries.set(canonical, makeEntry({
|
|
219
|
+
path: canonical,
|
|
220
|
+
dispatch: CommandDispatchKind.Subverb,
|
|
221
|
+
rows,
|
|
222
|
+
parent: res.matchedPath.join(' '),
|
|
223
|
+
declared: false,
|
|
224
|
+
}));
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
for (const [p, rows] of rowsByPath) {
|
|
229
|
+
entries.set(p, makeEntry({ path: p, dispatch: CommandDispatchKind.Catalog, rows }));
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
// (e) bootstrap meta flags.
|
|
233
|
+
for (const meta of META_COMMANDS) {
|
|
234
|
+
if (entries.has(meta.path))
|
|
235
|
+
continue;
|
|
236
|
+
const rows = rowsByPath.get(meta.path);
|
|
237
|
+
entries.set(meta.path, {
|
|
238
|
+
path: meta.path,
|
|
239
|
+
tokens: [meta.path],
|
|
240
|
+
dispatch: CommandDispatchKind.Meta,
|
|
241
|
+
description: rows?.[0]?.description ?? meta.description,
|
|
242
|
+
usage: meta.usage,
|
|
243
|
+
catalogued: (rows?.length ?? 0) > 0,
|
|
244
|
+
...(rows?.[0] ? { catalogEntry: rows[0] } : {}),
|
|
245
|
+
variants: [],
|
|
246
|
+
aliases: [],
|
|
247
|
+
audience: [CommandAudience.Human, CommandAudience.Agent],
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
const sorted = [...entries.values()].sort((a, b) => a.path.localeCompare(b.path));
|
|
251
|
+
return {
|
|
252
|
+
entries: sorted,
|
|
253
|
+
byPath: new Map(sorted.map((e) => [e.path, e])),
|
|
254
|
+
registryBacked: registry !== undefined,
|
|
255
|
+
...(registry ? { registry } : {}),
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
/** The entry at `path`, or the entry a folded variant / alias spelling belongs to. */
|
|
259
|
+
export function findCommandIndexEntry(index, command) {
|
|
260
|
+
const exact = index.byPath.get(command.trim());
|
|
261
|
+
if (exact)
|
|
262
|
+
return exact;
|
|
263
|
+
const clean = cleanCommandPath(command);
|
|
264
|
+
const byClean = index.byPath.get(clean);
|
|
265
|
+
if (byClean)
|
|
266
|
+
return byClean;
|
|
267
|
+
return index.entries.find((e) => e.aliases.includes(clean) || e.variants.includes(command.trim()));
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* The known subverb names directly below `path`: the next token of every index
|
|
271
|
+
* entry under it, at any depth (`ci scaffold gitlab` makes `scaffold` a known
|
|
272
|
+
* subverb of `ci` even though `ci scaffold` has no row of its own). Sorted,
|
|
273
|
+
* distinct.
|
|
274
|
+
*/
|
|
275
|
+
export function subverbNamesOf(index, path) {
|
|
276
|
+
const depth = path.length === 0 ? 0 : path.split(' ').length;
|
|
277
|
+
const prefix = path.length === 0 ? '' : `${path} `;
|
|
278
|
+
const out = new Set();
|
|
279
|
+
for (const e of index.entries) {
|
|
280
|
+
if (e.tokens.length <= depth)
|
|
281
|
+
continue;
|
|
282
|
+
if (prefix.length > 0 && !e.path.startsWith(prefix))
|
|
283
|
+
continue;
|
|
284
|
+
const name = e.tokens[depth];
|
|
285
|
+
if (name !== undefined && !name.startsWith('-'))
|
|
286
|
+
out.add(name);
|
|
287
|
+
}
|
|
288
|
+
return [...out].sort();
|
|
289
|
+
}
|
|
290
|
+
// ── The active index ──────────────────────────────────────────────────────
|
|
291
|
+
//
|
|
292
|
+
// `runCliInner` registers the registry it dispatches from, once per run, so a
|
|
293
|
+
// command (or a warm site feeding the inspector's command resolver) reads the
|
|
294
|
+
// SAME index without importing main.ts — which imports every command and would
|
|
295
|
+
// be circular. Built lazily: most runs never ask.
|
|
296
|
+
let activeRegistry;
|
|
297
|
+
const INDEX_BY_REGISTRY = new WeakMap();
|
|
298
|
+
/**
|
|
299
|
+
* The index of `registry` (over COMMAND_CATALOG), built once per registry and
|
|
300
|
+
* shared — the dispatcher guard, the help intercept, `help` and the active
|
|
301
|
+
* index all read the same object.
|
|
302
|
+
*/
|
|
303
|
+
export function commandIndexFor(registry) {
|
|
304
|
+
let index = INDEX_BY_REGISTRY.get(registry);
|
|
305
|
+
if (!index) {
|
|
306
|
+
index = buildCommandIndex(registry);
|
|
307
|
+
INDEX_BY_REGISTRY.set(registry, index);
|
|
308
|
+
}
|
|
309
|
+
return index;
|
|
310
|
+
}
|
|
311
|
+
/** Called by `runCliInner` with the registry it dispatches from. */
|
|
312
|
+
export function setActiveCommandRegistry(registry) {
|
|
313
|
+
activeRegistry = registry;
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* The index of the registry this CLI run dispatches from, or `undefined`
|
|
317
|
+
* outside `runCli` (a direct engine call) — callers then degrade loudly
|
|
318
|
+
* (`buildCommandIndex()` relabelled as the catalog, or no command resolver →
|
|
319
|
+
* NOT VERIFIED), never to a silent guess.
|
|
320
|
+
*/
|
|
321
|
+
export function getActiveCommandIndex() {
|
|
322
|
+
return activeRegistry ? commandIndexFor(activeRegistry) : undefined;
|
|
323
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { CommandRegistry } from '../command-registry.js';
|
|
2
|
+
import type { ICommandIndexEntry } from './command-index-entry.js';
|
|
3
|
+
/**
|
|
4
|
+
* The complete dispatchable command inventory: every registered handler path,
|
|
5
|
+
* every declared or catalog-documented subverb, and the bootstrap meta flags —
|
|
6
|
+
* joined with the catalog by clean path.
|
|
7
|
+
*/
|
|
8
|
+
export interface ICommandIndex {
|
|
9
|
+
/** Sorted by path. */
|
|
10
|
+
readonly entries: readonly ICommandIndexEntry[];
|
|
11
|
+
readonly byPath: ReadonlyMap<string, ICommandIndexEntry>;
|
|
12
|
+
/**
|
|
13
|
+
* True when built from a command registry. False only for the registry-less
|
|
14
|
+
* fallback (a direct engine call outside `runCli`), which lists catalog rows
|
|
15
|
+
* whose dispatch is unproven — relabelled `catalog`, never passed off as the
|
|
16
|
+
* dispatch table.
|
|
17
|
+
*/
|
|
18
|
+
readonly registryBacked: boolean;
|
|
19
|
+
/** The registry the index was built from, for alias-aware trie descent. */
|
|
20
|
+
readonly registry?: CommandRegistry;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=i-command-index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i-command-index.d.ts","sourceRoot":"","sources":["../../src/surface/i-command-index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEnE;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,sBAAsB;IACtB,QAAQ,CAAC,OAAO,EAAE,SAAS,kBAAkB,EAAE,CAAC;IAChD,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IACzD;;;;;OAKG;IACH,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,2EAA2E;IAC3E,QAAQ,CAAC,QAAQ,CAAC,EAAE,eAAe,CAAC;CACrC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What `resolveCommandString` checks NON-shrk commands against.
|
|
3
|
+
*
|
|
4
|
+
* Each field is optional: an absent set means "cannot check that family", and
|
|
5
|
+
* the resolver reports those strings `NotShrk` (skipped, counted) instead of
|
|
6
|
+
* inventing an answer.
|
|
7
|
+
*/
|
|
8
|
+
export interface ICommandStringContext {
|
|
9
|
+
/** Root `package.json` script names, for `<pm> run <script>`. */
|
|
10
|
+
readonly scripts?: ReadonlySet<string>;
|
|
11
|
+
/** Registered MCP tool names, for bare tool ids (`get_task_packet`). */
|
|
12
|
+
readonly mcpToolNames?: ReadonlySet<string>;
|
|
13
|
+
/**
|
|
14
|
+
* The project root a path-mode argument is looked up under — the
|
|
15
|
+
* dispatcher's cwd. Absent → no argument names a file (a disk-free reading):
|
|
16
|
+
* a verb-shaped token under a path-mode command is then a verb it lacks.
|
|
17
|
+
*/
|
|
18
|
+
readonly root?: string;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=i-command-string-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i-command-string-context.d.ts","sourceRoot":"","sources":["../../src/surface/i-command-string-context.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB;IACpC,iEAAiE;IACjE,QAAQ,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACvC,wEAAwE;IACxE,QAAQ,CAAC,YAAY,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC5C;;;;OAIG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { SurfaceLayer } from './surface-layer.js';
|
|
2
|
+
/**
|
|
3
|
+
* Why a command is denied by `surface.disabled`: the selector that named it
|
|
4
|
+
* and the layer that declared that selector. Carried on the tier resolution
|
|
5
|
+
* and the surface view so the refusal text and `surface explain` name the
|
|
6
|
+
* remedy that actually works (`surface allow` for a config deny, `surface
|
|
7
|
+
* enable` over a profile deny).
|
|
8
|
+
*/
|
|
9
|
+
export interface ISurfaceDenial {
|
|
10
|
+
readonly selector: string;
|
|
11
|
+
readonly origin: SurfaceLayer;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=i-surface-denial.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i-surface-denial.d.ts","sourceRoot":"","sources":["../../src/surface/i-surface-denial.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;CAC/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ISharkcraftInspection } from '@shrkcrft/inspector';
|
|
2
|
+
import type { ISurfaceConfig } from '@shrkcrft/config';
|
|
2
3
|
import { type ISurfaceProfile } from './profiles.js';
|
|
3
4
|
import type { ITierResolverContext } from './tier.js';
|
|
4
5
|
export interface LoadSurfaceContextOptions {
|
|
@@ -28,7 +29,22 @@ export interface ILoadedSurfaceContext {
|
|
|
28
29
|
* engine repo — `ICommandPlugin` exists in the plugin-api but no
|
|
29
30
|
* pack contributes commands today; future packs will populate
|
|
30
31
|
* the inspection's pack discovery).
|
|
31
|
-
* 4. Read the user's `surface{}` config block
|
|
32
|
+
* 4. Read the user's `surface{}` config block and compose it with the
|
|
33
|
+
* active profile ({@link composeSurfaceConfig}).
|
|
34
|
+
* 5. Detect the host (`detectSharkcraftRepo`, the one authority): outside
|
|
35
|
+
* SharkCraft's own repository, tool-maintenance commands are gated.
|
|
36
|
+
*
|
|
37
|
+
* The CLI surface gate, the MCP gate, `surface list/explain` and `--help` all
|
|
38
|
+
* read this ONE context, so they cannot disagree about what is visible or
|
|
39
|
+
* callable here.
|
|
32
40
|
*/
|
|
33
41
|
export declare function loadSurfaceContext(options: LoadSurfaceContextOptions): Promise<ILoadedSurfaceContext>;
|
|
42
|
+
/**
|
|
43
|
+
* Compose the project's `surface{}` block with the active profile — the one
|
|
44
|
+
* merge. Each list is the union of the profile's and the config's entries;
|
|
45
|
+
* `explicitSurface` keeps the config's OWN `enabled` / `disabled` whenever a
|
|
46
|
+
* profile is active, because the deny rule needs the layer ("an explicit
|
|
47
|
+
* config `enabled` overrides a profile's deny, never a config deny").
|
|
48
|
+
*/
|
|
49
|
+
export declare function composeSurfaceConfig(rawConfig: ISurfaceConfig | undefined, activeProfile: ISurfaceProfile | undefined): Pick<ITierResolverContext, 'surfaceConfig' | 'explicitSurface'>;
|
|
34
50
|
//# sourceMappingURL=load-surface-context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-surface-context.d.ts","sourceRoot":"","sources":["../../src/surface/load-surface-context.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"load-surface-context.d.ts","sourceRoot":"","sources":["../../src/surface/load-surface-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,qBAAqB,EAC3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAgC,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AACnF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAEtD,MAAM,WAAW,yBAAyB;IACxC,GAAG,EAAE,MAAM,CAAC;IACZ,oEAAoE;IACpE,UAAU,CAAC,EAAE,qBAAqB,CAAC;CACpC;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,oBAAoB,CAAC;IAC9B,UAAU,EAAE,qBAAqB,CAAC;IAClC;;;;OAIG;IACH,iBAAiB,EAAE,SAAS,eAAe,EAAE,CAAC;IAC9C,0EAA0E;IAC1E,aAAa,CAAC,EAAE,eAAe,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,qBAAqB,CAAC,CA+BhC;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,cAAc,GAAG,SAAS,EACrC,aAAa,EAAE,eAAe,GAAG,SAAS,GACzC,IAAI,CAAC,oBAAoB,EAAE,eAAe,GAAG,iBAAiB,CAAC,CAsBjE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { inspectSharkcraft } from '@shrkcrft/inspector';
|
|
1
|
+
import { detectSharkcraftRepo, inspectSharkcraft, } from '@shrkcrft/inspector';
|
|
2
2
|
import { extractSpineCommands } from "./spine-extractor.js";
|
|
3
3
|
import { BUILTIN_PROFILES, getProfile } from "./profiles.js";
|
|
4
4
|
/**
|
|
@@ -11,7 +11,14 @@ import { BUILTIN_PROFILES, getProfile } from "./profiles.js";
|
|
|
11
11
|
* engine repo — `ICommandPlugin` exists in the plugin-api but no
|
|
12
12
|
* pack contributes commands today; future packs will populate
|
|
13
13
|
* the inspection's pack discovery).
|
|
14
|
-
* 4. Read the user's `surface{}` config block
|
|
14
|
+
* 4. Read the user's `surface{}` config block and compose it with the
|
|
15
|
+
* active profile ({@link composeSurfaceConfig}).
|
|
16
|
+
* 5. Detect the host (`detectSharkcraftRepo`, the one authority): outside
|
|
17
|
+
* SharkCraft's own repository, tool-maintenance commands are gated.
|
|
18
|
+
*
|
|
19
|
+
* The CLI surface gate, the MCP gate, `surface list/explain` and `--help` all
|
|
20
|
+
* read this ONE context, so they cannot disagree about what is visible or
|
|
21
|
+
* callable here.
|
|
15
22
|
*/
|
|
16
23
|
export async function loadSurfaceContext(options) {
|
|
17
24
|
const inspection = options.inspection ?? (await inspectSharkcraft({ cwd: options.cwd }));
|
|
@@ -24,22 +31,49 @@ export async function loadSurfaceContext(options) {
|
|
|
24
31
|
const activeProfile = profileId
|
|
25
32
|
? getProfile(profileId, packProfiles)
|
|
26
33
|
: undefined;
|
|
27
|
-
|
|
28
|
-
|
|
34
|
+
const composed = composeSurfaceConfig(rawConfig, activeProfile);
|
|
35
|
+
const isToolRepo = detectSharkcraftRepo(inspection.projectRoot ?? options.cwd);
|
|
36
|
+
return {
|
|
37
|
+
inspection,
|
|
38
|
+
context: {
|
|
39
|
+
spineCommands,
|
|
40
|
+
packContributions,
|
|
41
|
+
surfaceConfig: composed.surfaceConfig,
|
|
42
|
+
isToolRepo,
|
|
43
|
+
...(composed.explicitSurface ? { explicitSurface: composed.explicitSurface } : {}),
|
|
44
|
+
},
|
|
45
|
+
availableProfiles: [...BUILTIN_PROFILES, ...packProfiles],
|
|
46
|
+
...(activeProfile ? { activeProfile } : {}),
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Compose the project's `surface{}` block with the active profile — the one
|
|
51
|
+
* merge. Each list is the union of the profile's and the config's entries;
|
|
52
|
+
* `explicitSurface` keeps the config's OWN `enabled` / `disabled` whenever a
|
|
53
|
+
* profile is active, because the deny rule needs the layer ("an explicit
|
|
54
|
+
* config `enabled` overrides a profile's deny, never a config deny").
|
|
55
|
+
*/
|
|
56
|
+
export function composeSurfaceConfig(rawConfig, activeProfile) {
|
|
57
|
+
const profileId = rawConfig?.profile;
|
|
29
58
|
const mergedHidden = mergeUnique(activeProfile?.hidden, rawConfig?.hidden);
|
|
30
59
|
const mergedEnabled = mergeUnique(activeProfile?.enabled, rawConfig?.enabled);
|
|
60
|
+
const mergedDisabled = mergeUnique(activeProfile?.disabled, rawConfig?.disabled);
|
|
31
61
|
const surfaceConfig = rawConfig || activeProfile
|
|
32
62
|
? {
|
|
33
63
|
...(profileId ? { profile: profileId } : {}),
|
|
34
64
|
...(mergedHidden.length > 0 ? { hidden: mergedHidden } : {}),
|
|
35
65
|
...(mergedEnabled.length > 0 ? { enabled: mergedEnabled } : {}),
|
|
66
|
+
...(mergedDisabled.length > 0 ? { disabled: mergedDisabled } : {}),
|
|
36
67
|
}
|
|
37
68
|
: undefined;
|
|
69
|
+
if (!activeProfile)
|
|
70
|
+
return { surfaceConfig };
|
|
38
71
|
return {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
72
|
+
surfaceConfig,
|
|
73
|
+
explicitSurface: {
|
|
74
|
+
enabled: [...(rawConfig?.enabled ?? [])],
|
|
75
|
+
disabled: [...(rawConfig?.disabled ?? [])],
|
|
76
|
+
},
|
|
43
77
|
};
|
|
44
78
|
}
|
|
45
79
|
function mergeUnique(a, b) {
|
|
@@ -65,13 +99,17 @@ function collectPackProfiles(inspection) {
|
|
|
65
99
|
description: typeof r.description === 'string' ? r.description : `Pack profile (${pack.packageName})`,
|
|
66
100
|
source: 'pack',
|
|
67
101
|
pack: pack.packageName,
|
|
68
|
-
...(Array.isArray(r.hidden) ? { hidden: r.hidden
|
|
69
|
-
...(Array.isArray(r.enabled) ? { enabled: r.enabled
|
|
102
|
+
...(Array.isArray(r.hidden) ? { hidden: stringsOf(r.hidden) } : {}),
|
|
103
|
+
...(Array.isArray(r.enabled) ? { enabled: stringsOf(r.enabled) } : {}),
|
|
104
|
+
...(Array.isArray(r.disabled) ? { disabled: stringsOf(r.disabled) } : {}),
|
|
70
105
|
});
|
|
71
106
|
}
|
|
72
107
|
}
|
|
73
108
|
return out;
|
|
74
109
|
}
|
|
110
|
+
function stringsOf(values) {
|
|
111
|
+
return values.filter((s) => typeof s === 'string');
|
|
112
|
+
}
|
|
75
113
|
/**
|
|
76
114
|
* Collect pack-contributed CLI command names. Today the pack
|
|
77
115
|
* manifest schema has no `commandFiles[]` contribution slot, so this
|