@shrkcrft/cli 0.1.0-alpha.29 → 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 +76 -0
- package/dist/commands/baseline.command.d.ts.map +1 -1
- package/dist/commands/baseline.command.js +599 -75
- 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 +164 -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 +1260 -324
- 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 +8 -1
- 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 +20 -0
- package/dist/commands/docs-references.command.d.ts.map +1 -0
- package/dist/commands/docs-references.command.js +520 -0
- package/dist/commands/doctor.command.d.ts.map +1 -1
- package/dist/commands/doctor.command.js +60 -5
- 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 +54 -0
- package/dist/commands/gates.command.d.ts.map +1 -1
- package/dist/commands/gates.command.js +1314 -64
- 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 +62 -0
- package/dist/commands/generated.command.d.ts.map +1 -1
- package/dist/commands/generated.command.js +639 -156
- 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 +203 -25
- 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 +362 -74
- 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 +67 -0
- package/dist/gates/gate-rule-globs.d.ts.map +1 -0
- package/dist/gates/gate-rule-globs.js +139 -0
- package/dist/gates/gate-rule-view.d.ts +25 -6
- package/dist/gates/gate-rule-view.d.ts.map +1 -1
- package/dist/gates/gate-rule-view.js +105 -77
- 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 +225 -4
- package/dist/gates/rule-coverage.d.ts.map +1 -1
- package/dist/gates/rule-coverage.js +610 -43
- package/dist/gates/run-gate-planes.d.ts +58 -0
- package/dist/gates/run-gate-planes.d.ts.map +1 -0
- package/dist/gates/run-gate-planes.js +403 -0
- 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 +204 -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
|
@@ -15,6 +15,21 @@ export declare function runGraphImpact(args: ParsedArgs): Promise<number>;
|
|
|
15
15
|
* radius of ONE node; hubs = the nodes with the biggest blast radius).
|
|
16
16
|
*/
|
|
17
17
|
export declare function runGraphHubs(args: ParsedArgs): Promise<number>;
|
|
18
|
+
/**
|
|
19
|
+
* Every module with an import edge INTO the target — the query a module
|
|
20
|
+
* relocation or deletion actually needs.
|
|
21
|
+
*
|
|
22
|
+
* `graph callers <Symbol>` is symbol-scoped and counts call sites, so it misses
|
|
23
|
+
* the two edges that decide whether a module can move: a type-only import (no
|
|
24
|
+
* call site exists) and a re-export (the module stays publicly surfaced under
|
|
25
|
+
* another path). `graph context <file>` lists importers but frames them as
|
|
26
|
+
* "what surrounds the file you are about to edit". Neither answers "enumerate
|
|
27
|
+
* everything that would break", which is why the task otherwise falls back to a
|
|
28
|
+
* hand-rolled grep that misses aliased specifiers, `.js`-suffixed ESM
|
|
29
|
+
* specifiers, and re-export chains — the exact edges the graph already
|
|
30
|
+
* resolves.
|
|
31
|
+
*/
|
|
32
|
+
export declare function runGraphImporters(args: ParsedArgs): Promise<number>;
|
|
18
33
|
export declare function runGraphCallers(args: ParsedArgs): Promise<number>;
|
|
19
34
|
/**
|
|
20
35
|
* `shrk graph path <from> <to>` — does code A actually reach code B?
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph-code-subverbs.d.ts","sourceRoot":"","sources":["../../src/commands/graph-code-subverbs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"graph-code-subverbs.d.ts","sourceRoot":"","sources":["../../src/commands/graph-code-subverbs.ts"],"names":[],"mappings":"AA8BA,OAAO,EAAiE,KAAK,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAqKxH,wBAAsB,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAkBrE;AA4FD,wBAAsB,cAAc,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAgHtE;AAiBD,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CA0G1E;AAID,wBAAsB,YAAY,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CA+EpE;AAID,wBAAsB,cAAc,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CA+GtE;AAID,wBAAsB,cAAc,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAwEtE;AAID,wBAAsB,eAAe,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CA2MvE;AAID,wBAAsB,cAAc,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CA+HtE;AAID;;;;;;GAMG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAgEpE;AAID;;;;;;;;;;;;;GAaG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CA0FzE;AA4CD,wBAAsB,eAAe,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAiGvE;AAyBD;;;;;;;;;;;;GAYG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAgHpE"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* focused. The entry command imports each `run*` and routes when the
|
|
6
6
|
* first positional matches the subverb name.
|
|
7
7
|
*/
|
|
8
|
-
import { buildFullIndex, changedFilesSince, detectChangedAndDeleted, detectGraphFreshness, EdgeKind, GraphQueryApi, GraphStore, hasCallGraphReferences, isGraphStoreCorruptError, NodeKind, updateChanged, } from '@shrkcrft/graph';
|
|
8
|
+
import { buildFullIndex, changedFilesSince, detectChangedAndDeleted, detectGraphFreshness, EdgeKind, GraphQueryApi, GraphStore, graphFreshnessBehind, graphFreshnessCoverage, graphFreshnessRemedy, hasCallGraphReferences, isGraphStoreCorruptError, NodeKind, updateChanged, } from '@shrkcrft/graph';
|
|
9
9
|
import { analyzeGraphImpact } from '@shrkcrft/impact-engine';
|
|
10
10
|
import { BridgeStore, RuleGraphQueryApi } from '@shrkcrft/rule-graph';
|
|
11
11
|
import { FrameworkQueryApi, FrameworkStore } from '@shrkcrft/framework-scanners';
|
|
@@ -15,6 +15,9 @@ import { compactArrayToColumnar } from '@shrkcrft/compress';
|
|
|
15
15
|
import { flagBool, flagNumber, flagPositiveInt, flagString, resolveCwd } from "../command-registry.js";
|
|
16
16
|
import { asJson, header, kv } from "../output/format-output.js";
|
|
17
17
|
import { maybeRunInWatchMode } from "../output/watch-loop.js";
|
|
18
|
+
import { indexBehindHint } from "../graph/index-behind-hint.js";
|
|
19
|
+
import { settleVerdict } from "../gates/settle-verdict.js";
|
|
20
|
+
import { verdictLine } from "../gates/verdict-line.js";
|
|
18
21
|
/**
|
|
19
22
|
* Opt-in `--table`/`--compact`: columnarise each homogeneous object-array field
|
|
20
23
|
* of a graph `--json` payload (compact, still valid JSON, reversible via
|
|
@@ -133,21 +136,6 @@ function resultStaleness(api, cwd, paths) {
|
|
|
133
136
|
: null,
|
|
134
137
|
};
|
|
135
138
|
}
|
|
136
|
-
/**
|
|
137
|
-
* A "the index is N files behind" qualifier for a not-found / empty result, so
|
|
138
|
-
* an agent doesn't read a bare "not-found" as "this symbol doesn't exist / is
|
|
139
|
-
* safe to create" when the truth is "it's in a file the index hasn't seen yet."
|
|
140
|
-
* Runs the full freshness walk — only call it on the rare miss path.
|
|
141
|
-
*/
|
|
142
|
-
function indexBehindHint(cwd) {
|
|
143
|
-
const f = detectGraphFreshness(cwd);
|
|
144
|
-
if (!f.hasIndex)
|
|
145
|
-
return null;
|
|
146
|
-
const behind = f.modified.length + f.added.length + f.deleted.length;
|
|
147
|
-
if (behind === 0)
|
|
148
|
-
return null;
|
|
149
|
-
return `Index is ${behind} file(s) behind (${f.modified.length} modified, ${f.added.length} new, ${f.deleted.length} deleted) — run \`shrk graph index --changed\` and retry.`;
|
|
150
|
-
}
|
|
151
139
|
/**
|
|
152
140
|
* Reject a stray positional on a subverb that takes NO file argument
|
|
153
141
|
* (status/cycles/unresolved/index). These previously printed a byte-identical
|
|
@@ -295,6 +283,16 @@ export async function runGraphCycles(args) {
|
|
|
295
283
|
const typeOnlyLoopCount = Math.max(0, api.cycles({ includeTypeEdges: true }).length - runtimeCycles.length);
|
|
296
284
|
const filtered = allCycles.filter((c) => c.size >= minSize);
|
|
297
285
|
const limited = filtered.slice(0, limit);
|
|
286
|
+
// A cycle verdict is DERIVED from the persisted index: over an index behind
|
|
287
|
+
// the working tree, a cycle among the changed files cannot show, so the
|
|
288
|
+
// clean answer is NOT VERIFIED (2), never "No cycles ✓" (round 11 review
|
|
289
|
+
// R11-GAP-1). THE freshness authority decides — `detectGraphFreshness`, the
|
|
290
|
+
// one `graph status` reads — through the shared coverage record.
|
|
291
|
+
const freshness = detectGraphFreshness(cwd);
|
|
292
|
+
const staleCoverage = graphFreshnessCoverage(freshness, 'graph index');
|
|
293
|
+
const settled = settleVerdict(0, staleCoverage ? [staleCoverage] : []);
|
|
294
|
+
const behind = graphFreshnessBehind(freshness);
|
|
295
|
+
const indexState = !freshness.hasIndex ? 'unmeasured' : behind > 0 ? 'stale' : 'fresh';
|
|
298
296
|
if (wantJson) {
|
|
299
297
|
process.stdout.write(asJson({
|
|
300
298
|
ok: true,
|
|
@@ -306,17 +304,31 @@ export async function runGraphCycles(args) {
|
|
|
306
304
|
size: c.size,
|
|
307
305
|
paths: c.paths ?? c.nodeIds.map((id) => id.replace(/^file:/, '')),
|
|
308
306
|
})),
|
|
307
|
+
freshness: {
|
|
308
|
+
state: indexState,
|
|
309
|
+
behind,
|
|
310
|
+
...(staleCoverage ? { nextCommand: graphFreshnessRemedy(freshness) } : {}),
|
|
311
|
+
},
|
|
312
|
+
...(staleCoverage ? { coverage: staleCoverage } : {}),
|
|
313
|
+
exitCode: settled.exit,
|
|
314
|
+
verdict: settled.verdict,
|
|
315
|
+
shortfalls: settled.shortfalls,
|
|
309
316
|
}) + '\n');
|
|
310
|
-
return
|
|
317
|
+
return settled.exit;
|
|
311
318
|
}
|
|
312
319
|
process.stdout.write(header('Graph cycles'));
|
|
313
320
|
process.stdout.write(kv('total', String(filtered.length)) + '\n');
|
|
321
|
+
if (staleCoverage) {
|
|
322
|
+
process.stdout.write(kv('index', `${indexState} — ${behind} change(s) since it was built; run \`${graphFreshnessRemedy(freshness)}\``) + '\n');
|
|
323
|
+
}
|
|
314
324
|
if (!includeTypeEdges && typeOnlyLoopCount > 0) {
|
|
315
325
|
process.stdout.write(kv('type-only loops', `${typeOnlyLoopCount} (excluded — compile-time only; --include-type-edges to audit)`) + '\n');
|
|
316
326
|
}
|
|
327
|
+
const kind = includeTypeEdges ? '' : 'runtime ';
|
|
317
328
|
if (filtered.length === 0) {
|
|
318
|
-
|
|
319
|
-
|
|
329
|
+
const line = verdictLine(settled, `No ${kind}cycles in the file-import graph. ✓`, `No ${kind}cycles in the INDEXED graph — but the index is behind the working tree, so a cycle among the changed files cannot show.`);
|
|
330
|
+
process.stdout.write(`\n${line}\n`);
|
|
331
|
+
return settled.exit;
|
|
320
332
|
}
|
|
321
333
|
process.stdout.write(kv('shown', `${limited.length}/${filtered.length}`) + '\n');
|
|
322
334
|
process.stdout.write('\n');
|
|
@@ -335,7 +347,10 @@ export async function runGraphCycles(args) {
|
|
|
335
347
|
if (filtered.length > limit) {
|
|
336
348
|
process.stdout.write(`\n(${filtered.length - limit} more — pass --limit ${filtered.length} to see all)\n`);
|
|
337
349
|
}
|
|
338
|
-
|
|
350
|
+
const tail = verdictLine(settled, '');
|
|
351
|
+
if (tail)
|
|
352
|
+
process.stdout.write(`\n${tail}\n`);
|
|
353
|
+
return settled.exit;
|
|
339
354
|
}
|
|
340
355
|
function parseLimit(args) {
|
|
341
356
|
const raw = flagString(args, 'limit');
|
|
@@ -407,6 +422,12 @@ export async function runGraphUnresolved(args) {
|
|
|
407
422
|
g.specifiers = [...new Set(g.specifiers)].sort();
|
|
408
423
|
const total = list.reduce((n, g) => n + g.specifiers.length, 0);
|
|
409
424
|
const limited = list.slice(0, limit);
|
|
425
|
+
// A listing (not a verdict verb, so its exit is unchanged) — but a ✓ over an
|
|
426
|
+
// index behind the working tree is a clean answer derived from a stale input,
|
|
427
|
+
// so it is dropped and the gap named (the shared freshness record).
|
|
428
|
+
const freshness = detectGraphFreshness(cwd);
|
|
429
|
+
const stale = graphFreshnessCoverage(freshness) !== undefined;
|
|
430
|
+
const behind = graphFreshnessBehind(freshness);
|
|
410
431
|
if (wantJson) {
|
|
411
432
|
process.stdout.write(asJson({
|
|
412
433
|
ok: true,
|
|
@@ -417,6 +438,11 @@ export async function runGraphUnresolved(args) {
|
|
|
417
438
|
path: g.path ?? g.from.replace(/^file:/, ''),
|
|
418
439
|
unresolved: g.specifiers,
|
|
419
440
|
})),
|
|
441
|
+
freshness: {
|
|
442
|
+
state: !freshness.hasIndex ? 'unmeasured' : stale ? 'stale' : 'fresh',
|
|
443
|
+
behind,
|
|
444
|
+
...(stale ? { nextCommand: graphFreshnessRemedy(freshness) } : {}),
|
|
445
|
+
},
|
|
420
446
|
}) + '\n');
|
|
421
447
|
return 0;
|
|
422
448
|
}
|
|
@@ -424,7 +450,9 @@ export async function runGraphUnresolved(args) {
|
|
|
424
450
|
process.stdout.write(kv('total edges', String(total)) + '\n');
|
|
425
451
|
process.stdout.write(kv('files', String(list.length)) + '\n');
|
|
426
452
|
if (list.length === 0) {
|
|
427
|
-
process.stdout.write(
|
|
453
|
+
process.stdout.write(stale
|
|
454
|
+
? `\nNo unresolved imports in the INDEXED graph — the index is ${behind} change(s) behind the working tree; run \`${graphFreshnessRemedy(freshness)}\` for a current answer.\n`
|
|
455
|
+
: '\nNo unresolved imports. ✓\n');
|
|
428
456
|
return 0;
|
|
429
457
|
}
|
|
430
458
|
process.stdout.write(kv('shown', `${limited.length}/${list.length}`) + '\n');
|
|
@@ -564,7 +592,10 @@ export async function runGraphStatus(args) {
|
|
|
564
592
|
// `stale` (disk drift) are orthogonal — a store can be digest-valid yet
|
|
565
593
|
// stale — so precedence is corrupt > stale > fresh.
|
|
566
594
|
const fresh = detectGraphFreshness(cwd);
|
|
567
|
-
|
|
595
|
+
// Files AND workspace package entries (a package.json-only edit changes what
|
|
596
|
+
// a bare import resolves to while every source file is byte-identical).
|
|
597
|
+
const behind = graphFreshnessBehind(fresh);
|
|
598
|
+
const pkgsChanged = fresh.packagesChanged;
|
|
568
599
|
const state = !verify.ok ? 'corrupt' : behind > 0 ? 'stale' : 'fresh';
|
|
569
600
|
const payload = {
|
|
570
601
|
ok: verify.ok,
|
|
@@ -586,7 +617,11 @@ export async function runGraphStatus(args) {
|
|
|
586
617
|
modifiedSinceIndex: fresh.modified.length,
|
|
587
618
|
newSinceIndex: fresh.added.length,
|
|
588
619
|
deletedSinceIndex: fresh.deleted.length,
|
|
589
|
-
|
|
620
|
+
packagesChangedSinceIndex: pkgsChanged.length,
|
|
621
|
+
...(pkgsChanged.length > 0 ? { packagesChanged: pkgsChanged } : {}),
|
|
622
|
+
// An incremental update does not re-resolve unchanged files' imports of a
|
|
623
|
+
// package whose entry changed; only a full index does.
|
|
624
|
+
...(behind > 0 ? { nextCommand: graphFreshnessRemedy(fresh) } : {}),
|
|
590
625
|
};
|
|
591
626
|
if (wantJson) {
|
|
592
627
|
process.stdout.write(asJson(payload) + '\n');
|
|
@@ -594,7 +629,11 @@ export async function runGraphStatus(args) {
|
|
|
594
629
|
}
|
|
595
630
|
process.stdout.write(header('Graph status'));
|
|
596
631
|
process.stdout.write(kv('schema', payload.schema) + '\n');
|
|
597
|
-
|
|
632
|
+
// "files indexed", not "files": this is the size of the STORED snapshot, and
|
|
633
|
+
// it deliberately does not move when a new file appears on disk — that shows
|
|
634
|
+
// up on the `drift` line below. Reading it as a live count is how an added
|
|
635
|
+
// file looks invisible to the index.
|
|
636
|
+
process.stdout.write(kv('files indexed', String(payload.fileCount)) + '\n');
|
|
598
637
|
process.stdout.write(kv('nodes', String(payload.nodeCount)) + '\n');
|
|
599
638
|
process.stdout.write(kv('edges', String(payload.edgeCount)) + '\n');
|
|
600
639
|
process.stdout.write(kv('packages', String(payload.workspacePackages.length)) + '\n');
|
|
@@ -608,7 +647,11 @@ export async function runGraphStatus(args) {
|
|
|
608
647
|
process.stdout.write(kv('last indexed', payload.lastIndexedAt) + '\n');
|
|
609
648
|
process.stdout.write(kv('state', payload.state) + '\n');
|
|
610
649
|
if (behind > 0) {
|
|
611
|
-
|
|
650
|
+
const pkgPart = pkgsChanged.length > 0
|
|
651
|
+
? `, ${pkgsChanged.length} workspace package(s) changed (${pkgsChanged.slice(0, 3).join(', ')}${pkgsChanged.length > 3 ? `, +${pkgsChanged.length - 3} more` : ''})`
|
|
652
|
+
: '';
|
|
653
|
+
const remedy = `\`${graphFreshnessRemedy(fresh)}\``;
|
|
654
|
+
process.stdout.write(kv('drift', `${fresh.modified.length} modified, ${fresh.added.length} new, ${fresh.deleted.length} deleted${pkgPart} since index — run ${remedy}`) + '\n');
|
|
612
655
|
}
|
|
613
656
|
return verify.ok ? 0 : 1;
|
|
614
657
|
}
|
|
@@ -1078,6 +1121,141 @@ export async function runGraphHubs(args) {
|
|
|
1078
1121
|
}
|
|
1079
1122
|
return 0;
|
|
1080
1123
|
}
|
|
1124
|
+
// ─── shrk graph importers ─────────────────────────────────────────────
|
|
1125
|
+
/**
|
|
1126
|
+
* Every module with an import edge INTO the target — the query a module
|
|
1127
|
+
* relocation or deletion actually needs.
|
|
1128
|
+
*
|
|
1129
|
+
* `graph callers <Symbol>` is symbol-scoped and counts call sites, so it misses
|
|
1130
|
+
* the two edges that decide whether a module can move: a type-only import (no
|
|
1131
|
+
* call site exists) and a re-export (the module stays publicly surfaced under
|
|
1132
|
+
* another path). `graph context <file>` lists importers but frames them as
|
|
1133
|
+
* "what surrounds the file you are about to edit". Neither answers "enumerate
|
|
1134
|
+
* everything that would break", which is why the task otherwise falls back to a
|
|
1135
|
+
* hand-rolled grep that misses aliased specifiers, `.js`-suffixed ESM
|
|
1136
|
+
* specifiers, and re-export chains — the exact edges the graph already
|
|
1137
|
+
* resolves.
|
|
1138
|
+
*/
|
|
1139
|
+
export async function runGraphImporters(args) {
|
|
1140
|
+
const cwd = resolveCwd(args);
|
|
1141
|
+
const wantJson = flagBool(args, 'json');
|
|
1142
|
+
const target = args.positional[1];
|
|
1143
|
+
if (!target) {
|
|
1144
|
+
process.stderr.write('Usage: shrk graph importers <file|module-specifier> [--mode import|reexport|type-only|all] [--limit N|0] [--no-refresh]\n');
|
|
1145
|
+
return 2;
|
|
1146
|
+
}
|
|
1147
|
+
const modeRaw = flagString(args, 'mode') ?? 'all';
|
|
1148
|
+
if (!IMPORTER_MODES.includes(modeRaw)) {
|
|
1149
|
+
process.stderr.write(`Unknown --mode "${modeRaw}" for 'shrk graph importers'. Valid: ${IMPORTER_MODES.join(', ')}.\n`);
|
|
1150
|
+
return 2;
|
|
1151
|
+
}
|
|
1152
|
+
const mode = modeRaw;
|
|
1153
|
+
const limit = resolveListLimit(args, 200);
|
|
1154
|
+
maybeRefresh(args, cwd);
|
|
1155
|
+
const api = loadOrFail(cwd, wantJson);
|
|
1156
|
+
if (!api)
|
|
1157
|
+
return 1;
|
|
1158
|
+
const file = resolveModuleTarget(api, target);
|
|
1159
|
+
if (!file) {
|
|
1160
|
+
const behind = indexBehindHint(cwd);
|
|
1161
|
+
const payload = { ok: false, error: 'not-found', target, ...(behind ? { hint: behind } : {}) };
|
|
1162
|
+
if (wantJson) {
|
|
1163
|
+
process.stdout.write(asJson(payload) + '\n');
|
|
1164
|
+
return 1;
|
|
1165
|
+
}
|
|
1166
|
+
process.stderr.write(`No module matched "${target}". Pass a repo-relative file path or a package specifier.${behind ? ' ' + behind : ''}\n`);
|
|
1167
|
+
return 1;
|
|
1168
|
+
}
|
|
1169
|
+
const all = api.importerEdgesOf(file.id);
|
|
1170
|
+
const selected = all.filter((e) => matchesImporterMode(e, mode));
|
|
1171
|
+
// Targeted staleness over the target + the reported importers, same as
|
|
1172
|
+
// `callers`: drop importers whose file is gone, flag those that changed.
|
|
1173
|
+
const fresh = resultStaleness(api, cwd, [file.path, ...selected.map((e) => e.node.path)]);
|
|
1174
|
+
const live = selected.filter((e) => !e.node.path || !fresh.deletedSet.has(e.node.path));
|
|
1175
|
+
const counts = {
|
|
1176
|
+
import: all.filter((e) => e.kind === 'import' && !e.typeOnly).length,
|
|
1177
|
+
reexport: all.filter((e) => e.kind === 'reexport').length,
|
|
1178
|
+
typeOnly: all.filter((e) => e.typeOnly).length,
|
|
1179
|
+
};
|
|
1180
|
+
const payload = {
|
|
1181
|
+
schema: 'sharkcraft.graph-importers/v1',
|
|
1182
|
+
module: nodeSummary(file),
|
|
1183
|
+
mode,
|
|
1184
|
+
total: live.length,
|
|
1185
|
+
counts,
|
|
1186
|
+
importers: live.slice(0, limit).map((e) => ({
|
|
1187
|
+
...nodeSummary(e.node),
|
|
1188
|
+
edge: e.typeOnly ? 'type-only' : e.kind,
|
|
1189
|
+
})),
|
|
1190
|
+
...(counts.reexport > 0
|
|
1191
|
+
? {
|
|
1192
|
+
note: `${counts.reexport} importer(s) RE-EXPORT this module — deleting or moving it changes a public surface. ` +
|
|
1193
|
+
'Run with --mode reexport to isolate the bridge chain.',
|
|
1194
|
+
}
|
|
1195
|
+
: {}),
|
|
1196
|
+
...(fresh.field ?? {}),
|
|
1197
|
+
};
|
|
1198
|
+
if (wantJson) {
|
|
1199
|
+
process.stdout.write(asJson(maybeColumnarize(payload, args)) + '\n');
|
|
1200
|
+
return 0;
|
|
1201
|
+
}
|
|
1202
|
+
process.stdout.write(header(`Graph importers: ${file.path ?? file.id} (${mode})`));
|
|
1203
|
+
process.stdout.write(kv('total', String(live.length)) + '\n');
|
|
1204
|
+
process.stdout.write(kv('by edge', `${counts.import} value · ${counts.typeOnly} type-only · ${counts.reexport} re-export`) + '\n');
|
|
1205
|
+
if (payload.note)
|
|
1206
|
+
process.stdout.write(` ⓘ ${payload.note}\n`);
|
|
1207
|
+
for (const i of payload.importers.slice(0, Math.min(50, limit))) {
|
|
1208
|
+
process.stdout.write(` ${i.path ?? i.id} [${i.edge}]\n`);
|
|
1209
|
+
}
|
|
1210
|
+
if (live.length > Math.min(50, limit)) {
|
|
1211
|
+
process.stdout.write(` … (${live.length - Math.min(50, limit)} more — pass --limit 0 for all)\n`);
|
|
1212
|
+
}
|
|
1213
|
+
if (fresh.field) {
|
|
1214
|
+
process.stdout.write(`\n ⚠ ${fresh.modified.length} result file(s) changed, ${fresh.deleted.length} deleted since indexing — run \`shrk graph index --changed\`.\n`);
|
|
1215
|
+
}
|
|
1216
|
+
return 0;
|
|
1217
|
+
}
|
|
1218
|
+
const IMPORTER_MODES = ['import', 'reexport', 'type-only', 'all'];
|
|
1219
|
+
/**
|
|
1220
|
+
* `--mode import` means a VALUE import specifically. A type-only edge is
|
|
1221
|
+
* reported under `type-only` and nowhere else, so the three narrow modes
|
|
1222
|
+
* partition the set and an author cannot double-count by summing them.
|
|
1223
|
+
*/
|
|
1224
|
+
function matchesImporterMode(edge, mode) {
|
|
1225
|
+
if (mode === 'all')
|
|
1226
|
+
return true;
|
|
1227
|
+
if (mode === 'type-only')
|
|
1228
|
+
return edge.typeOnly;
|
|
1229
|
+
if (mode === 'reexport')
|
|
1230
|
+
return edge.kind === 'reexport';
|
|
1231
|
+
return edge.kind === 'import' && !edge.typeOnly;
|
|
1232
|
+
}
|
|
1233
|
+
/**
|
|
1234
|
+
* Resolve an importers target to a FILE node, from either a repo-relative path
|
|
1235
|
+
* or a package specifier — both name the same node, and an author asking "who
|
|
1236
|
+
* imports @scope/pkg" should not have to know its entry path first.
|
|
1237
|
+
*/
|
|
1238
|
+
function resolveModuleTarget(api, target) {
|
|
1239
|
+
const direct = api.findFile(target);
|
|
1240
|
+
if (direct)
|
|
1241
|
+
return direct;
|
|
1242
|
+
if (target.startsWith('file:'))
|
|
1243
|
+
return api.neighbours(target)?.node;
|
|
1244
|
+
// A package or aliased specifier: whichever file the INDEXER resolved it to.
|
|
1245
|
+
// Deriving the entry point here instead would be a second resolver that
|
|
1246
|
+
// disagrees with the graph on exactly the aliased edges this query exists to
|
|
1247
|
+
// surface.
|
|
1248
|
+
const bySpecifier = api.fileForSpecifier(target);
|
|
1249
|
+
if (bySpecifier)
|
|
1250
|
+
return bySpecifier;
|
|
1251
|
+
// A path missing its extension, or a directory meaning its index.
|
|
1252
|
+
for (const ext of ['.ts', '.tsx', '.js', '.jsx', '/index.ts', '/index.js']) {
|
|
1253
|
+
const f = api.findFile(target + ext);
|
|
1254
|
+
if (f)
|
|
1255
|
+
return f;
|
|
1256
|
+
}
|
|
1257
|
+
return undefined;
|
|
1258
|
+
}
|
|
1081
1259
|
// ─── shrk graph callers ───────────────────────────────────────────────
|
|
1082
1260
|
export async function runGraphCallers(args) {
|
|
1083
1261
|
const cwd = resolveCwd(args);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph.command.d.ts","sourceRoot":"","sources":["../../src/commands/graph.command.ts"],"names":[],"mappings":"AAUA,OAAO,
|
|
1
|
+
{"version":3,"file":"graph.command.d.ts","sourceRoot":"","sources":["../../src/commands/graph.command.ts"],"names":[],"mappings":"AAUA,OAAO,EAIL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAiLhC,eAAO,MAAM,YAAY,EAAE,eAyO1B,CAAC"}
|
|
@@ -1,32 +1,23 @@
|
|
|
1
1
|
import { mkdirSync, writeFileSync } from 'node:fs';
|
|
2
2
|
import * as nodePath from 'node:path';
|
|
3
3
|
import { analyzeImportGraph, buildKnowledgeGraph, findGraphPath, getGraphNode, inspectSharkcraft, } from '@shrkcrft/inspector';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { flagBool, flagString, resolveCwd, } from "../command-registry.js";
|
|
5
|
+
import { nearest } from "../dispatch/closest-match.js";
|
|
6
|
+
import { isVerbShaped } from "../dispatch/guard-invocation.js";
|
|
7
|
+
import { PositionalMode } from "../dispatch/positional-mode.js";
|
|
8
|
+
import { usageExitFor } from "../exit-codes.js";
|
|
6
9
|
import { asJson, header, kv } from "../output/format-output.js";
|
|
7
10
|
/**
|
|
8
|
-
* The code-intelligence subverbs
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* the
|
|
12
|
-
*
|
|
11
|
+
* The flags the code-intelligence subverbs accept — the UNION of every flag
|
|
12
|
+
* any of them reads, plus the global / meta flags, so a real flag is never
|
|
13
|
+
* false-rejected (a25 §2.1). Declared as each code subverb's `flags`
|
|
14
|
+
* (`GRAPH_SUBVERBS`): the dispatcher refuses any other flag BEFORE the subverb
|
|
15
|
+
* runs, exiting `usageExitFor` — 3 on the verdict verb `graph cycles`, 2
|
|
16
|
+
* elsewhere. (Round 11 moved this out of an inline guard in `run`.)
|
|
13
17
|
*/
|
|
14
|
-
const CODE_GRAPH_SUBVERBS = new Set([
|
|
15
|
-
'index',
|
|
16
|
-
'status',
|
|
17
|
-
'search',
|
|
18
|
-
'context',
|
|
19
|
-
'impact',
|
|
20
|
-
'path',
|
|
21
|
-
'hubs',
|
|
22
|
-
'callers',
|
|
23
|
-
'cycles',
|
|
24
|
-
'unresolved',
|
|
25
|
-
'deps',
|
|
26
|
-
]);
|
|
27
18
|
const CODE_GRAPH_ALLOWED_FLAGS = new Set([
|
|
28
19
|
// code-subverb flags (union across index/status/search/context/impact/path/
|
|
29
|
-
// hubs/callers/cycles/unresolved/deps)
|
|
20
|
+
// hubs/callers/importers/cycles/unresolved/deps)
|
|
30
21
|
'changed',
|
|
31
22
|
'compact',
|
|
32
23
|
'depth',
|
|
@@ -58,7 +49,53 @@ const CODE_GRAPH_ALLOWED_FLAGS = new Set([
|
|
|
58
49
|
'no-color',
|
|
59
50
|
'color',
|
|
60
51
|
]);
|
|
61
|
-
import { runGraphCallers, runGraphContext, runGraphCycles, runGraphDeps, runGraphHubs, runGraphImpact, runGraphIndex, runGraphPath, runGraphSearch, runGraphStatus, runGraphUnresolved, } from "./graph-code-subverbs.js";
|
|
52
|
+
import { runGraphCallers, runGraphContext, runGraphCycles, runGraphDeps, runGraphHubs, runGraphImpact, runGraphImporters, runGraphIndex, runGraphPath, runGraphSearch, runGraphStatus, runGraphUnresolved, } from "./graph-code-subverbs.js";
|
|
53
|
+
function codeGraphSubverb(name, description, usage, positionals) {
|
|
54
|
+
return {
|
|
55
|
+
name,
|
|
56
|
+
description,
|
|
57
|
+
usage,
|
|
58
|
+
flags: CODE_GRAPH_ALLOWED_FLAGS,
|
|
59
|
+
...(positionals !== undefined ? { positionals } : {}),
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Every subverb `graph` dispatches from `positional[0]` — the code-intelligence
|
|
64
|
+
* family (each with the code-graph flag set) plus the knowledge-graph `why` /
|
|
65
|
+
* `export` / `imports`. Any other token is an asset-graph node id (Free).
|
|
66
|
+
* Declared so `help graph importers` prints real usage and the command index
|
|
67
|
+
* lists them (they have no catalog rows of their own).
|
|
68
|
+
*/
|
|
69
|
+
const GRAPH_SUBVERBS = [
|
|
70
|
+
codeGraphSubverb('index', 'Build or refresh the code graph (`--changed` for incremental; `--watch` keeps it fresh).', 'shrk graph index [--changed] [--since <ref>] [--full] [--watch [--paths a,b] [--debounce N] [--once]] [--json]'),
|
|
71
|
+
codeGraphSubverb('status', 'Code-graph freshness, counts, and the unresolved-import summary.', 'shrk graph status [--json]'),
|
|
72
|
+
codeGraphSubverb('search', 'Find files / symbols / packages in the code graph.', 'shrk graph search <query> [--kind file|symbol|package] [--limit N] [--json]', PositionalMode.Free),
|
|
73
|
+
codeGraphSubverb('context', 'Inspect one file or symbol with bridge enrichment.', 'shrk graph context <fileOrSymbol> [--depth N] [--limit N|0] [--no-bridge] [--no-framework] [--json]', PositionalMode.Free),
|
|
74
|
+
codeGraphSubverb('impact', 'The reverse dependent closure of a file or symbol.', 'shrk graph impact <fileOrSymbol> [--max-depth N] [--limit N|0] [--full] [--json]', PositionalMode.Free),
|
|
75
|
+
codeGraphSubverb('path', 'Is code A wired to code B? The shortest import / call path.', 'shrk graph path <from> <to> [--max-depth N] [--no-refresh] [--json]', PositionalMode.Free),
|
|
76
|
+
codeGraphSubverb('hubs', 'The most-depended-on symbols / files (load-bearing code; scope it to a subsystem).', 'shrk graph hubs [--limit N] [--path <dir>] [--mode <mode>] [--json]'),
|
|
77
|
+
codeGraphSubverb('callers', 'The files that call / reference a symbol, as path:line.', 'shrk graph callers <symbol> [--mode call|reference] [--limit N|0] [--no-refresh] [--json]', PositionalMode.Free),
|
|
78
|
+
codeGraphSubverb('importers', 'Every module that imports a module — alias / type-only / re-export aware.', 'shrk graph importers <file|module-specifier> [--mode import|reexport|type-only|all] [--limit N|0] [--no-refresh] [--json]', PositionalMode.Free),
|
|
79
|
+
codeGraphSubverb('cycles', 'The import cycles (type-only edges excluded unless --include-type-edges).', 'shrk graph cycles [--include-type-edges] [--min-size N] [--limit N] [--json]'),
|
|
80
|
+
codeGraphSubverb('unresolved', 'The unresolved imports, grouped by file.', 'shrk graph unresolved [--json]'),
|
|
81
|
+
codeGraphSubverb('deps', 'Inbound / outbound package dependencies.', 'shrk graph deps <package-name> [--json]', PositionalMode.Free),
|
|
82
|
+
{
|
|
83
|
+
name: 'why',
|
|
84
|
+
description: 'The shortest-path explanation between two knowledge-graph nodes.',
|
|
85
|
+
usage: 'shrk graph why <fromId> <toId> [--json]',
|
|
86
|
+
positionals: PositionalMode.Free,
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
name: 'export',
|
|
90
|
+
description: 'Write the knowledge graph as dot / mermaid / json.',
|
|
91
|
+
usage: 'shrk graph export --format dot|mermaid|json --output <file>',
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: 'imports',
|
|
95
|
+
description: 'Import-graph analysis: cycles, fan-in / fan-out, orphans.',
|
|
96
|
+
usage: 'shrk graph imports [--cycles] [--fan-in] [--fan-out] [--orphans] [--json]',
|
|
97
|
+
},
|
|
98
|
+
];
|
|
62
99
|
const KNOWN_KINDS = [
|
|
63
100
|
'knowledge',
|
|
64
101
|
'rule',
|
|
@@ -72,27 +109,19 @@ const KNOWN_KINDS = [
|
|
|
72
109
|
];
|
|
73
110
|
export const graphCommand = {
|
|
74
111
|
name: 'graph',
|
|
75
|
-
|
|
112
|
+
// Free: any token that names no subverb is an asset-graph node id.
|
|
113
|
+
positionals: PositionalMode.Free,
|
|
114
|
+
subverbs: GRAPH_SUBVERBS,
|
|
115
|
+
description: 'Show the SharkCraft knowledge graph and the code-intelligence graph surface. Use `shrk graph <id>` for asset-graph nodes and `shrk graph index|status|search|context|impact|path|hubs|callers|importers|cycles|unresolved|deps|why|export` for code-graph workflows.',
|
|
76
116
|
usage: 'shrk [--cwd <dir>] graph [<id>] [--type <kind>] [--format text|json|dot|mermaid] [--output <file>] [--json]\n' +
|
|
77
|
-
'shrk graph index|status|search|context|impact|path|hubs|callers|cycles|unresolved|deps|why|export ...\n' +
|
|
117
|
+
'shrk graph index|status|search|context|impact|path|hubs|callers|importers|cycles|unresolved|deps|why|export ...\n' +
|
|
78
118
|
'shrk graph path <from> <to> — is code A wired to code B? (shortest import/call path)\n' +
|
|
79
119
|
'shrk graph hubs [--limit N] [--path <dir>] — most-depended-on symbols/files (load-bearing code; scope to a subsystem)',
|
|
80
120
|
async run(args) {
|
|
81
121
|
// Code-intelligence subverbs (R65) don't need the knowledge graph —
|
|
82
|
-
// dispatch them before the expensive inspection so they stay fast.
|
|
122
|
+
// dispatch them before the expensive inspection so they stay fast. Their
|
|
123
|
+
// flags were already judged by the dispatcher (GRAPH_SUBVERBS `flags`).
|
|
83
124
|
const earlySub = args.positional[0];
|
|
84
|
-
// Reject unknown/misspelled flags on the code-graph family BEFORE dispatch:
|
|
85
|
-
// an unrecognized flag must never parse as a silent success (a25 §2.1). Any
|
|
86
|
-
// real flag is in the union allow-set, so this only fires on a genuine typo.
|
|
87
|
-
if (typeof earlySub === 'string' && CODE_GRAPH_SUBVERBS.has(earlySub)) {
|
|
88
|
-
const unknown = firstUnknownFlag(args, CODE_GRAPH_ALLOWED_FLAGS);
|
|
89
|
-
if (unknown) {
|
|
90
|
-
const dash = unknown.length === 1 ? '-' : '--';
|
|
91
|
-
process.stderr.write(`unknown option '${dash}${unknown}' for 'shrk graph ${earlySub}'. ` +
|
|
92
|
-
`Run 'shrk graph --help' for valid flags.\n`);
|
|
93
|
-
return ExitCode.NotVerified;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
125
|
if (earlySub === 'index')
|
|
97
126
|
return runGraphIndex(args);
|
|
98
127
|
if (earlySub === 'status')
|
|
@@ -109,6 +138,8 @@ export const graphCommand = {
|
|
|
109
138
|
return runGraphHubs(args);
|
|
110
139
|
if (earlySub === 'callers')
|
|
111
140
|
return runGraphCallers(args);
|
|
141
|
+
if (earlySub === 'importers')
|
|
142
|
+
return runGraphImporters(args);
|
|
112
143
|
if (earlySub === 'cycles')
|
|
113
144
|
return runGraphCycles(args);
|
|
114
145
|
if (earlySub === 'unresolved')
|
|
@@ -214,6 +245,17 @@ export const graphCommand = {
|
|
|
214
245
|
if (id) {
|
|
215
246
|
const node = getGraphNode(graph, typeFlag ? { kind: typeFlag, id } : { id });
|
|
216
247
|
if (!node) {
|
|
248
|
+
// A verb-shaped id one typo from a graph subverb (`graph statsu`,
|
|
249
|
+
// `graph importrs foo`) is a mistyped verb, not a missing node: name
|
|
250
|
+
// the closest subverb and exit as the usage error it is — never the
|
|
251
|
+
// failure verdict 1 of an absent node.
|
|
252
|
+
const sub = isVerbShaped(id) ? nearest(id, GRAPH_SUBVERBS.map((s) => s.name)) : undefined;
|
|
253
|
+
if (sub !== undefined) {
|
|
254
|
+
process.stderr.write(`\`shrk graph\` has no \`${id}\` subcommand, and no graph node is named "${id}".\n` +
|
|
255
|
+
` Did you mean \`shrk graph ${sub}\`?\n` +
|
|
256
|
+
' Run `shrk help graph` for usage.\n');
|
|
257
|
+
return usageExitFor('graph');
|
|
258
|
+
}
|
|
217
259
|
process.stderr.write(`No graph node for "${id}".\n`);
|
|
218
260
|
return 1;
|
|
219
261
|
}
|
|
@@ -1,21 +1,45 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type CommandRegistry } from '../command-registry.js';
|
|
2
|
+
import { type ISurfaceSummary } from '../surface/surface-summary.js';
|
|
3
|
+
/** `help`'s arguments: a ParsedArgs subset (callers may pass positional + flags only). */
|
|
4
|
+
interface IHelpArgs {
|
|
5
|
+
positional: string[];
|
|
6
|
+
flags: Map<string, string | boolean>;
|
|
7
|
+
globalCwd?: string;
|
|
8
|
+
}
|
|
2
9
|
/**
|
|
3
10
|
* Product start screen for bare `shrk` / `shrk --help`. Shows the
|
|
4
11
|
* curated ~20-command "starter" surface organized by workflow phase.
|
|
5
12
|
* Everything else stays callable; users see the full ~70-verb catalog
|
|
6
13
|
* via `shrk --full-help` or browse it through `shrk surface list`.
|
|
7
14
|
*
|
|
15
|
+
* `shown(command)` is the repository's surface: a curated line whose command
|
|
16
|
+
* `surface.hidden` hides, or the surface gate refuses (`surface.disabled`,
|
|
17
|
+
* experimental, tool-maintenance), is dropped — and a section left empty with
|
|
18
|
+
* it. The default shows every line (the text is then byte-identical to the
|
|
19
|
+
* pre-round-11 screen).
|
|
20
|
+
*
|
|
8
21
|
* Returns the lines (without trailing newline). Pulled into a function
|
|
9
22
|
* so tests can assert on the structure without grepping stdout.
|
|
10
23
|
*/
|
|
11
|
-
export declare function renderStartScreen(): string;
|
|
24
|
+
export declare function renderStartScreen(shown?: (command: string) => boolean): string;
|
|
25
|
+
/**
|
|
26
|
+
* `--full-help`, rendered FROM the surface summary. Without `all` it lists
|
|
27
|
+
* exactly the views whose `visibleInHelp` is true — every one at least once —
|
|
28
|
+
* so `surface.hidden`, profiles, `surface.disabled` and the tool-maintenance
|
|
29
|
+
* host gate all reach it. With `all` it lists every view, annotated
|
|
30
|
+
* `(hidden)` / `(gated: …)` rather than dropped.
|
|
31
|
+
*
|
|
32
|
+
* Placement (not visibility) still reads the catalog: a visible view on the
|
|
33
|
+
* rent-paying surface goes under its top-level verb or group; an explain /
|
|
34
|
+
* dry-run view goes in its own section (and, when it is also rent-paying, in
|
|
35
|
+
* its group too).
|
|
36
|
+
*/
|
|
37
|
+
export declare function renderFullHelp(registry: CommandRegistry, summary: ISurfaceSummary, all: boolean): string;
|
|
12
38
|
export declare function makeHelpCommand(registry: CommandRegistry): {
|
|
13
39
|
name: string;
|
|
14
40
|
description: string;
|
|
15
41
|
usage: string;
|
|
16
|
-
run(args:
|
|
17
|
-
positional: string[];
|
|
18
|
-
flags: Map<string, string | boolean>;
|
|
19
|
-
}): number;
|
|
42
|
+
run(args: IHelpArgs): number | Promise<number>;
|
|
20
43
|
};
|
|
44
|
+
export {};
|
|
21
45
|
//# sourceMappingURL=help.command.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.command.d.ts","sourceRoot":"","sources":["../../src/commands/help.command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"help.command.d.ts","sourceRoot":"","sources":["../../src/commands/help.command.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAW1E,OAAO,EAIL,KAAK,eAAe,EACrB,MAAM,+BAA+B,CAAC;AAIvC,0FAA0F;AAC1F,UAAU,SAAS;IACjB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAwJD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,GAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAoB,GAAG,MAAM,CA0B1F;AA0DD;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,eAAe,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,OAAO,GAAG,MAAM,CAmFxG;AAcD,wBAAgB,eAAe,CAAC,QAAQ,EAAE,eAAe;;;;cAO3C,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;EA6GjD"}
|