@shrkcrft/cli 0.1.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +15 -0
- package/dist/asset-preview/apply-action-hint-stub.d.ts +28 -0
- package/dist/asset-preview/apply-action-hint-stub.d.ts.map +1 -0
- package/dist/asset-preview/apply-action-hint-stub.js +170 -0
- package/dist/asset-preview/apply-asset-preview.d.ts +31 -0
- package/dist/asset-preview/apply-asset-preview.d.ts.map +1 -0
- package/dist/asset-preview/apply-asset-preview.js +210 -0
- package/dist/asset-preview/apply-knowledge-stale-fix.d.ts +37 -0
- package/dist/asset-preview/apply-knowledge-stale-fix.d.ts.map +1 -0
- package/dist/asset-preview/apply-knowledge-stale-fix.js +344 -0
- package/dist/asset-preview/apply-missing-barrel.d.ts +15 -0
- package/dist/asset-preview/apply-missing-barrel.d.ts.map +1 -0
- package/dist/asset-preview/apply-missing-barrel.js +65 -0
- package/dist/asset-preview/apply-template-drift-fix.d.ts +21 -0
- package/dist/asset-preview/apply-template-drift-fix.d.ts.map +1 -0
- package/dist/asset-preview/apply-template-drift-fix.js +125 -0
- package/dist/asset-preview/apply-template-update.d.ts +43 -0
- package/dist/asset-preview/apply-template-update.d.ts.map +1 -0
- package/dist/asset-preview/apply-template-update.js +257 -0
- package/dist/asset-preview/entry-mutator.d.ts +106 -0
- package/dist/asset-preview/entry-mutator.d.ts.map +1 -0
- package/dist/asset-preview/entry-mutator.js +428 -0
- package/dist/authoring/authoring-kit.d.ts +36 -0
- package/dist/authoring/authoring-kit.d.ts.map +1 -0
- package/dist/authoring/authoring-kit.js +106 -0
- package/dist/command-registry.d.ts +158 -0
- package/dist/command-registry.d.ts.map +1 -0
- package/dist/command-registry.js +348 -0
- package/dist/commands/apply.command.d.ts +3 -0
- package/dist/commands/apply.command.d.ts.map +1 -0
- package/dist/commands/apply.command.js +879 -0
- package/dist/commands/architecture.command.d.ts +5 -0
- package/dist/commands/architecture.command.d.ts.map +1 -0
- package/dist/commands/architecture.command.js +141 -0
- package/dist/commands/ask.command.d.ts +3 -0
- package/dist/commands/ask.command.d.ts.map +1 -0
- package/dist/commands/ask.command.js +58 -0
- package/dist/commands/audit.command.d.ts +3 -0
- package/dist/commands/audit.command.d.ts.map +1 -0
- package/dist/commands/audit.command.js +141 -0
- package/dist/commands/biome.command.d.ts +7 -0
- package/dist/commands/biome.command.d.ts.map +1 -0
- package/dist/commands/biome.command.js +350 -0
- package/dist/commands/boundaries.command.d.ts +9 -0
- package/dist/commands/boundaries.command.d.ts.map +1 -0
- package/dist/commands/boundaries.command.js +314 -0
- package/dist/commands/brief.command.d.ts +3 -0
- package/dist/commands/brief.command.d.ts.map +1 -0
- package/dist/commands/brief.command.js +206 -0
- package/dist/commands/bundle.command.d.ts +3 -0
- package/dist/commands/bundle.command.d.ts.map +1 -0
- package/dist/commands/bundle.command.js +1183 -0
- package/dist/commands/changes.command.d.ts +3 -0
- package/dist/commands/changes.command.d.ts.map +1 -0
- package/dist/commands/changes.command.js +155 -0
- package/dist/commands/check.command.d.ts +3 -0
- package/dist/commands/check.command.d.ts.map +1 -0
- package/dist/commands/check.command.js +553 -0
- package/dist/commands/checks.command.d.ts +29 -0
- package/dist/commands/checks.command.d.ts.map +1 -0
- package/dist/commands/checks.command.js +521 -0
- package/dist/commands/ci.command.d.ts +3 -0
- package/dist/commands/ci.command.d.ts.map +1 -0
- package/dist/commands/ci.command.js +680 -0
- package/dist/commands/codemod.command.d.ts +3 -0
- package/dist/commands/codemod.command.d.ts.map +1 -0
- package/dist/commands/codemod.command.js +130 -0
- package/dist/commands/command-catalog.d.ts +265 -0
- package/dist/commands/command-catalog.d.ts.map +1 -0
- package/dist/commands/command-catalog.js +3242 -0
- package/dist/commands/commands.command.d.ts +92 -0
- package/dist/commands/commands.command.d.ts.map +1 -0
- package/dist/commands/commands.command.js +1208 -0
- package/dist/commands/constructs.command.d.ts +15 -0
- package/dist/commands/constructs.command.d.ts.map +1 -0
- package/dist/commands/constructs.command.js +669 -0
- package/dist/commands/context.command.d.ts +3 -0
- package/dist/commands/context.command.d.ts.map +1 -0
- package/dist/commands/context.command.js +120 -0
- package/dist/commands/contract-gate.command.d.ts +5 -0
- package/dist/commands/contract-gate.command.d.ts.map +1 -0
- package/dist/commands/contract-gate.command.js +208 -0
- package/dist/commands/contract-templates.command.d.ts +8 -0
- package/dist/commands/contract-templates.command.d.ts.map +1 -0
- package/dist/commands/contract-templates.command.js +151 -0
- package/dist/commands/contract.command.d.ts +3 -0
- package/dist/commands/contract.command.d.ts.map +1 -0
- package/dist/commands/contract.command.js +105 -0
- package/dist/commands/conventions.command.d.ts +8 -0
- package/dist/commands/conventions.command.d.ts.map +1 -0
- package/dist/commands/conventions.command.js +169 -0
- package/dist/commands/coverage.command.d.ts +3 -0
- package/dist/commands/coverage.command.d.ts.map +1 -0
- package/dist/commands/coverage.command.js +56 -0
- package/dist/commands/daily.commands.d.ts +5 -0
- package/dist/commands/daily.commands.d.ts.map +1 -0
- package/dist/commands/daily.commands.js +224 -0
- package/dist/commands/dashboard-export.command.d.ts +4 -0
- package/dist/commands/dashboard-export.command.d.ts.map +1 -0
- package/dist/commands/dashboard-export.command.js +86 -0
- package/dist/commands/dashboard.command.d.ts +3 -0
- package/dist/commands/dashboard.command.d.ts.map +1 -0
- package/dist/commands/dashboard.command.js +106 -0
- package/dist/commands/dev.command.d.ts +3 -0
- package/dist/commands/dev.command.d.ts.map +1 -0
- package/dist/commands/dev.command.js +1392 -0
- package/dist/commands/diagnostics.command.d.ts +5 -0
- package/dist/commands/diagnostics.command.d.ts.map +1 -0
- package/dist/commands/diagnostics.command.js +97 -0
- package/dist/commands/docs.command.d.ts +4 -0
- package/dist/commands/docs.command.d.ts.map +1 -0
- package/dist/commands/docs.command.js +34 -0
- package/dist/commands/doctor.command.d.ts +7 -0
- package/dist/commands/doctor.command.d.ts.map +1 -0
- package/dist/commands/doctor.command.js +681 -0
- package/dist/commands/drift.command.d.ts +3 -0
- package/dist/commands/drift.command.d.ts.map +1 -0
- package/dist/commands/drift.command.js +124 -0
- package/dist/commands/eslint.command.d.ts +7 -0
- package/dist/commands/eslint.command.d.ts.map +1 -0
- package/dist/commands/eslint.command.js +423 -0
- package/dist/commands/explore.command.d.ts +3 -0
- package/dist/commands/explore.command.d.ts.map +1 -0
- package/dist/commands/explore.command.js +65 -0
- package/dist/commands/export-bundle.command.d.ts +6 -0
- package/dist/commands/export-bundle.command.d.ts.map +1 -0
- package/dist/commands/export-bundle.command.js +96 -0
- package/dist/commands/export.command.d.ts +3 -0
- package/dist/commands/export.command.d.ts.map +1 -0
- package/dist/commands/export.command.js +83 -0
- package/dist/commands/feedback-dispatch.command.d.ts +12 -0
- package/dist/commands/feedback-dispatch.command.d.ts.map +1 -0
- package/dist/commands/feedback-dispatch.command.js +63 -0
- package/dist/commands/feedback.command.d.ts +11 -0
- package/dist/commands/feedback.command.d.ts.map +1 -0
- package/dist/commands/feedback.command.js +336 -0
- package/dist/commands/fix.command.d.ts +3 -0
- package/dist/commands/fix.command.d.ts.map +1 -0
- package/dist/commands/fix.command.js +776 -0
- package/dist/commands/gen.command.d.ts +3 -0
- package/dist/commands/gen.command.d.ts.map +1 -0
- package/dist/commands/gen.command.js +136 -0
- package/dist/commands/git.command.d.ts +6 -0
- package/dist/commands/git.command.d.ts.map +1 -0
- package/dist/commands/git.command.js +81 -0
- package/dist/commands/graph.command.d.ts +3 -0
- package/dist/commands/graph.command.d.ts.map +1 -0
- package/dist/commands/graph.command.js +287 -0
- package/dist/commands/grounding.command.d.ts +7 -0
- package/dist/commands/grounding.command.d.ts.map +1 -0
- package/dist/commands/grounding.command.js +54 -0
- package/dist/commands/help.command.d.ts +20 -0
- package/dist/commands/help.command.d.ts.map +1 -0
- package/dist/commands/help.command.js +127 -0
- package/dist/commands/helper.command.d.ts +6 -0
- package/dist/commands/helper.command.d.ts.map +1 -0
- package/dist/commands/helper.command.js +170 -0
- package/dist/commands/ide.command.d.ts +6 -0
- package/dist/commands/ide.command.d.ts.map +1 -0
- package/dist/commands/ide.command.js +340 -0
- package/dist/commands/impact.command.d.ts +3 -0
- package/dist/commands/impact.command.d.ts.map +1 -0
- package/dist/commands/impact.command.js +819 -0
- package/dist/commands/import.command.d.ts +3 -0
- package/dist/commands/import.command.d.ts.map +1 -0
- package/dist/commands/import.command.js +115 -0
- package/dist/commands/infer.command.d.ts +3 -0
- package/dist/commands/infer.command.d.ts.map +1 -0
- package/dist/commands/infer.command.js +227 -0
- package/dist/commands/ingest.command.d.ts +6 -0
- package/dist/commands/ingest.command.d.ts.map +1 -0
- package/dist/commands/ingest.command.js +532 -0
- package/dist/commands/init.command.d.ts +3 -0
- package/dist/commands/init.command.d.ts.map +1 -0
- package/dist/commands/init.command.js +301 -0
- package/dist/commands/inspect.command.d.ts +3 -0
- package/dist/commands/inspect.command.d.ts.map +1 -0
- package/dist/commands/inspect.command.js +122 -0
- package/dist/commands/knowledge-author.command.d.ts +22 -0
- package/dist/commands/knowledge-author.command.d.ts.map +1 -0
- package/dist/commands/knowledge-author.command.js +366 -0
- package/dist/commands/knowledge-propose.command.d.ts +3 -0
- package/dist/commands/knowledge-propose.command.d.ts.map +1 -0
- package/dist/commands/knowledge-propose.command.js +125 -0
- package/dist/commands/knowledge.command.d.ts +18 -0
- package/dist/commands/knowledge.command.d.ts.map +1 -0
- package/dist/commands/knowledge.command.js +538 -0
- package/dist/commands/languages.command.d.ts +3 -0
- package/dist/commands/languages.command.d.ts.map +1 -0
- package/dist/commands/languages.command.js +300 -0
- package/dist/commands/lint.command.d.ts +15 -0
- package/dist/commands/lint.command.d.ts.map +1 -0
- package/dist/commands/lint.command.js +194 -0
- package/dist/commands/mcp.command.d.ts +3 -0
- package/dist/commands/mcp.command.d.ts.map +1 -0
- package/dist/commands/mcp.command.js +74 -0
- package/dist/commands/memory.command.d.ts +11 -0
- package/dist/commands/memory.command.d.ts.map +1 -0
- package/dist/commands/memory.command.js +264 -0
- package/dist/commands/onboard.command.d.ts +3 -0
- package/dist/commands/onboard.command.d.ts.map +1 -0
- package/dist/commands/onboard.command.js +650 -0
- package/dist/commands/orchestrate.command.d.ts +3 -0
- package/dist/commands/orchestrate.command.d.ts.map +1 -0
- package/dist/commands/orchestrate.command.js +49 -0
- package/dist/commands/owners.command.d.ts +5 -0
- package/dist/commands/owners.command.d.ts.map +1 -0
- package/dist/commands/owners.command.js +113 -0
- package/dist/commands/ownership.command.d.ts +5 -0
- package/dist/commands/ownership.command.d.ts.map +1 -0
- package/dist/commands/ownership.command.js +117 -0
- package/dist/commands/pack-author.command.d.ts +30 -0
- package/dist/commands/pack-author.command.d.ts.map +1 -0
- package/dist/commands/pack-author.command.js +242 -0
- package/dist/commands/packs-new.d.ts +27 -0
- package/dist/commands/packs-new.d.ts.map +1 -0
- package/dist/commands/packs-new.js +805 -0
- package/dist/commands/packs.command.d.ts +15 -0
- package/dist/commands/packs.command.d.ts.map +1 -0
- package/dist/commands/packs.command.js +958 -0
- package/dist/commands/paths.command.d.ts +6 -0
- package/dist/commands/paths.command.d.ts.map +1 -0
- package/dist/commands/paths.command.js +97 -0
- package/dist/commands/pipelines.command.d.ts +9 -0
- package/dist/commands/pipelines.command.d.ts.map +1 -0
- package/dist/commands/pipelines.command.js +308 -0
- package/dist/commands/plan-check.command.d.ts +27 -0
- package/dist/commands/plan-check.command.d.ts.map +1 -0
- package/dist/commands/plan-check.command.js +150 -0
- package/dist/commands/plan-simulate.command.d.ts +3 -0
- package/dist/commands/plan-simulate.command.d.ts.map +1 -0
- package/dist/commands/plan-simulate.command.js +60 -0
- package/dist/commands/plan.command.d.ts +8 -0
- package/dist/commands/plan.command.d.ts.map +1 -0
- package/dist/commands/plan.command.js +139 -0
- package/dist/commands/playbooks.command.d.ts +10 -0
- package/dist/commands/playbooks.command.d.ts.map +1 -0
- package/dist/commands/playbooks.command.js +296 -0
- package/dist/commands/plugin.command.d.ts +11 -0
- package/dist/commands/plugin.command.d.ts.map +1 -0
- package/dist/commands/plugin.command.js +394 -0
- package/dist/commands/policy.command.d.ts +8 -0
- package/dist/commands/policy.command.d.ts.map +1 -0
- package/dist/commands/policy.command.js +451 -0
- package/dist/commands/pr.command.d.ts +3 -0
- package/dist/commands/pr.command.d.ts.map +1 -0
- package/dist/commands/pr.command.js +132 -0
- package/dist/commands/preflight.command.d.ts +3 -0
- package/dist/commands/preflight.command.d.ts.map +1 -0
- package/dist/commands/preflight.command.js +102 -0
- package/dist/commands/presets.command.d.ts +17 -0
- package/dist/commands/presets.command.d.ts.map +1 -0
- package/dist/commands/presets.command.js +647 -0
- package/dist/commands/profiles.command.d.ts +7 -0
- package/dist/commands/profiles.command.d.ts.map +1 -0
- package/dist/commands/profiles.command.js +151 -0
- package/dist/commands/provenance.command.d.ts +26 -0
- package/dist/commands/provenance.command.d.ts.map +1 -0
- package/dist/commands/provenance.command.js +237 -0
- package/dist/commands/quality.command.d.ts +5 -0
- package/dist/commands/quality.command.d.ts.map +1 -0
- package/dist/commands/quality.command.js +69 -0
- package/dist/commands/recommend.command.d.ts +4 -0
- package/dist/commands/recommend.command.d.ts.map +1 -0
- package/dist/commands/recommend.command.js +270 -0
- package/dist/commands/registrations.command.d.ts +3 -0
- package/dist/commands/registrations.command.d.ts.map +1 -0
- package/dist/commands/registrations.command.js +300 -0
- package/dist/commands/registry.command.d.ts +4 -0
- package/dist/commands/registry.command.d.ts.map +1 -0
- package/dist/commands/registry.command.js +37 -0
- package/dist/commands/release.command.d.ts +4 -0
- package/dist/commands/release.command.d.ts.map +1 -0
- package/dist/commands/release.command.js +639 -0
- package/dist/commands/repo.command.d.ts +3 -0
- package/dist/commands/repo.command.d.ts.map +1 -0
- package/dist/commands/repo.command.js +24 -0
- package/dist/commands/report.command.d.ts +3 -0
- package/dist/commands/report.command.d.ts.map +1 -0
- package/dist/commands/report.command.js +511 -0
- package/dist/commands/reposet.command.d.ts +6 -0
- package/dist/commands/reposet.command.d.ts.map +1 -0
- package/dist/commands/reposet.command.js +120 -0
- package/dist/commands/review.command.d.ts +3 -0
- package/dist/commands/review.command.d.ts.map +1 -0
- package/dist/commands/review.command.js +354 -0
- package/dist/commands/risk.command.d.ts +3 -0
- package/dist/commands/risk.command.d.ts.map +1 -0
- package/dist/commands/risk.command.js +56 -0
- package/dist/commands/rounds.command.d.ts +8 -0
- package/dist/commands/rounds.command.d.ts.map +1 -0
- package/dist/commands/rounds.command.js +180 -0
- package/dist/commands/rules.command.d.ts +49 -0
- package/dist/commands/rules.command.d.ts.map +1 -0
- package/dist/commands/rules.command.js +435 -0
- package/dist/commands/runtime.command.d.ts +3 -0
- package/dist/commands/runtime.command.d.ts.map +1 -0
- package/dist/commands/runtime.command.js +56 -0
- package/dist/commands/safety.command.d.ts +3 -0
- package/dist/commands/safety.command.d.ts.map +1 -0
- package/dist/commands/safety.command.js +117 -0
- package/dist/commands/scaffolds.command.d.ts +5 -0
- package/dist/commands/scaffolds.command.d.ts.map +1 -0
- package/dist/commands/scaffolds.command.js +122 -0
- package/dist/commands/schemas.command.d.ts +21 -0
- package/dist/commands/schemas.command.d.ts.map +1 -0
- package/dist/commands/schemas.command.js +296 -0
- package/dist/commands/search.command.d.ts +12 -0
- package/dist/commands/search.command.d.ts.map +1 -0
- package/dist/commands/search.command.js +275 -0
- package/dist/commands/self-config.command.d.ts +7 -0
- package/dist/commands/self-config.command.d.ts.map +1 -0
- package/dist/commands/self-config.command.js +156 -0
- package/dist/commands/self.command.d.ts +3 -0
- package/dist/commands/self.command.d.ts.map +1 -0
- package/dist/commands/self.command.js +117 -0
- package/dist/commands/simulate.command.d.ts +3 -0
- package/dist/commands/simulate.command.d.ts.map +1 -0
- package/dist/commands/simulate.command.js +54 -0
- package/dist/commands/spec.command.d.ts +29 -0
- package/dist/commands/spec.command.d.ts.map +1 -0
- package/dist/commands/spec.command.js +985 -0
- package/dist/commands/start-here.command.d.ts +3 -0
- package/dist/commands/start-here.command.d.ts.map +1 -0
- package/dist/commands/start-here.command.js +35 -0
- package/dist/commands/stats.command.d.ts +3 -0
- package/dist/commands/stats.command.d.ts.map +1 -0
- package/dist/commands/stats.command.js +88 -0
- package/dist/commands/surface.command.d.ts +15 -0
- package/dist/commands/surface.command.d.ts.map +1 -0
- package/dist/commands/surface.command.js +328 -0
- package/dist/commands/task-context.command.d.ts +7 -0
- package/dist/commands/task-context.command.d.ts.map +1 -0
- package/dist/commands/task-context.command.js +646 -0
- package/dist/commands/task.command.d.ts +3 -0
- package/dist/commands/task.command.d.ts.map +1 -0
- package/dist/commands/task.command.js +301 -0
- package/dist/commands/template-quality.command.d.ts +5 -0
- package/dist/commands/template-quality.command.d.ts.map +1 -0
- package/dist/commands/template-quality.command.js +128 -0
- package/dist/commands/templates.command.d.ts +26 -0
- package/dist/commands/templates.command.d.ts.map +1 -0
- package/dist/commands/templates.command.js +964 -0
- package/dist/commands/test.command.d.ts +3 -0
- package/dist/commands/test.command.d.ts.map +1 -0
- package/dist/commands/test.command.js +262 -0
- package/dist/commands/tests.command.d.ts +5 -0
- package/dist/commands/tests.command.d.ts.map +1 -0
- package/dist/commands/tests.command.js +97 -0
- package/dist/commands/trace.command.d.ts +3 -0
- package/dist/commands/trace.command.d.ts.map +1 -0
- package/dist/commands/trace.command.js +121 -0
- package/dist/commands/upgrade.command.d.ts +4 -0
- package/dist/commands/upgrade.command.d.ts.map +1 -0
- package/dist/commands/upgrade.command.js +43 -0
- package/dist/commands/version.command.d.ts +3 -0
- package/dist/commands/version.command.d.ts.map +1 -0
- package/dist/commands/version.command.js +10 -0
- package/dist/commands/why.command.d.ts +24 -0
- package/dist/commands/why.command.d.ts.map +1 -0
- package/dist/commands/why.command.js +119 -0
- package/dist/dashboard/dashboard-api-server.d.ts +21 -0
- package/dist/dashboard/dashboard-api-server.d.ts.map +1 -0
- package/dist/dashboard/dashboard-api-server.js +410 -0
- package/dist/dashboard/live-session-server.d.ts +18 -0
- package/dist/dashboard/live-session-server.d.ts.map +1 -0
- package/dist/dashboard/live-session-server.js +133 -0
- package/dist/diff/collect-changed-paths.d.ts +27 -0
- package/dist/diff/collect-changed-paths.d.ts.map +1 -0
- package/dist/diff/collect-changed-paths.js +68 -0
- package/dist/doctor/doctor-tags.d.ts +63 -0
- package/dist/doctor/doctor-tags.d.ts.map +1 -0
- package/dist/doctor/doctor-tags.js +146 -0
- package/dist/export/export-formats.d.ts +22 -0
- package/dist/export/export-formats.d.ts.map +1 -0
- package/dist/export/export-formats.js +135 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -0
- package/dist/init/detected-block.d.ts +57 -0
- package/dist/init/detected-block.d.ts.map +1 -0
- package/dist/init/detected-block.js +197 -0
- package/dist/init/gitignore.d.ts +30 -0
- package/dist/init/gitignore.d.ts.map +1 -0
- package/dist/init/gitignore.js +110 -0
- package/dist/init/init-templates.d.ts +6 -0
- package/dist/init/init-templates.d.ts.map +1 -0
- package/dist/init/init-templates.js +413 -0
- package/dist/main.d.ts +18 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +699 -0
- package/dist/output/failure-hints.d.ts +55 -0
- package/dist/output/failure-hints.d.ts.map +1 -0
- package/dist/output/failure-hints.js +159 -0
- package/dist/output/format-output.d.ts +9 -0
- package/dist/output/format-output.d.ts.map +1 -0
- package/dist/output/format-output.js +26 -0
- package/dist/output/print-error.d.ts +3 -0
- package/dist/output/print-error.d.ts.map +1 -0
- package/dist/output/print-error.js +14 -0
- package/dist/output/watch-loop.d.ts +37 -0
- package/dist/output/watch-loop.d.ts.map +1 -0
- package/dist/output/watch-loop.js +115 -0
- package/dist/schemas/json-schemas.d.ts +1630 -0
- package/dist/schemas/json-schemas.d.ts.map +1 -0
- package/dist/schemas/json-schemas.js +811 -0
- package/dist/surface/about.d.ts +10 -0
- package/dist/surface/about.d.ts.map +1 -0
- package/dist/surface/about.js +53 -0
- package/dist/surface/load-surface-context.d.ts +34 -0
- package/dist/surface/load-surface-context.d.ts.map +1 -0
- package/dist/surface/load-surface-context.js +100 -0
- package/dist/surface/no-args-landing.d.ts +7 -0
- package/dist/surface/no-args-landing.d.ts.map +1 -0
- package/dist/surface/no-args-landing.js +36 -0
- package/dist/surface/not-enabled-error.d.ts +24 -0
- package/dist/surface/not-enabled-error.d.ts.map +1 -0
- package/dist/surface/not-enabled-error.js +36 -0
- package/dist/surface/profiles.d.ts +37 -0
- package/dist/surface/profiles.d.ts.map +1 -0
- package/dist/surface/profiles.js +151 -0
- package/dist/surface/shape-defaults.d.ts +21 -0
- package/dist/surface/shape-defaults.d.ts.map +1 -0
- package/dist/surface/shape-defaults.js +50 -0
- package/dist/surface/spine-extractor.d.ts +38 -0
- package/dist/surface/spine-extractor.d.ts.map +1 -0
- package/dist/surface/spine-extractor.js +100 -0
- package/dist/surface/surface-config-writer.d.ts +59 -0
- package/dist/surface/surface-config-writer.d.ts.map +1 -0
- package/dist/surface/surface-config-writer.js +135 -0
- package/dist/surface/surface-summary.d.ts +66 -0
- package/dist/surface/surface-summary.d.ts.map +1 -0
- package/dist/surface/surface-summary.js +162 -0
- package/dist/surface/tier.d.ts +100 -0
- package/dist/surface/tier.d.ts.map +1 -0
- package/dist/surface/tier.js +172 -0
- package/dist/task-next/apply-batch-runner.d.ts +42 -0
- package/dist/task-next/apply-batch-runner.d.ts.map +1 -0
- package/dist/task-next/apply-batch-runner.js +192 -0
- package/dist/task-next/task-next-ranker.d.ts +75 -0
- package/dist/task-next/task-next-ranker.d.ts.map +1 -0
- package/dist/task-next/task-next-ranker.js +179 -0
- package/dist/usage/usage-log.d.ts +54 -0
- package/dist/usage/usage-log.d.ts.map +1 -0
- package/dist/usage/usage-log.js +105 -0
- package/dist/validation/run-validation-loop.d.ts +38 -0
- package/dist/validation/run-validation-loop.d.ts.map +1 -0
- package/dist/validation/run-validation-loop.js +100 -0
- package/package.json +73 -0
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IDs of pipelines treated as the "spine" — pipelines whose
|
|
3
|
+
* referenced commands are tier=Core regardless of any other catalog
|
|
4
|
+
* derivation rule.
|
|
5
|
+
*
|
|
6
|
+
* Today only `engine.feature-dev` exists in the engine repo.
|
|
7
|
+
* `engine.safe-generation` is a planned second spine pipeline; if a
|
|
8
|
+
* project ships it, it's automatically picked up here.
|
|
9
|
+
*/
|
|
10
|
+
export const SPINE_PIPELINE_IDS = Object.freeze([
|
|
11
|
+
'engine.feature-dev',
|
|
12
|
+
'engine.safe-generation',
|
|
13
|
+
]);
|
|
14
|
+
/**
|
|
15
|
+
* Verbs the spine derivation is allowed to promote to core. The
|
|
16
|
+
* spine pipelines reference write verbs (`apply`, `gen`, `plan
|
|
17
|
+
* review`) too, but those are power-user surfaces; letting them
|
|
18
|
+
* drift into core inflates the "brutally small" promise. Anything
|
|
19
|
+
* outside this allowlist stays tier=extended even when the spine
|
|
20
|
+
* references it.
|
|
21
|
+
*/
|
|
22
|
+
const CORE_SPINE_VERB_ALLOWLIST = new Set([
|
|
23
|
+
'context',
|
|
24
|
+
'check boundaries',
|
|
25
|
+
]);
|
|
26
|
+
/**
|
|
27
|
+
* Extract the catalog command names referenced from spine
|
|
28
|
+
* pipelines AND in the core verb allowlist. The function does NOT
|
|
29
|
+
* execute any pipeline — it walks `steps[].cliCommands[]` and parses
|
|
30
|
+
* out the verb path.
|
|
31
|
+
*
|
|
32
|
+
* Parsing rule: each `cliCommands` entry is a shell-style string like
|
|
33
|
+
* `bun run shrk plan review /tmp/plan.json`. The parser strips a
|
|
34
|
+
* leading `bun run shrk` or `shrk` and returns the first 1-2 tokens
|
|
35
|
+
* as a command path. Multi-token paths are joined with a space so
|
|
36
|
+
* they match {@link ICommandCatalogEntry.command} entries that already
|
|
37
|
+
* use this form (`pack author status`, `plan review`).
|
|
38
|
+
*/
|
|
39
|
+
export function extractSpineCommands(pipelines) {
|
|
40
|
+
const out = new Set();
|
|
41
|
+
const spineIds = new Set(SPINE_PIPELINE_IDS);
|
|
42
|
+
for (const pipeline of pipelines) {
|
|
43
|
+
if (!spineIds.has(pipeline.id))
|
|
44
|
+
continue;
|
|
45
|
+
for (const step of pipeline.steps ?? []) {
|
|
46
|
+
for (const raw of step.cliCommands ?? []) {
|
|
47
|
+
const verb = parseCommandVerb(raw);
|
|
48
|
+
if (verb && CORE_SPINE_VERB_ALLOWLIST.has(verb))
|
|
49
|
+
out.add(verb);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return out;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Parse a single CLI command string into its catalog `command`
|
|
57
|
+
* path. Returns `undefined` if the string doesn't reference shrk.
|
|
58
|
+
*
|
|
59
|
+
* Examples:
|
|
60
|
+
* `bun run shrk doctor` → `doctor`
|
|
61
|
+
* `bun run shrk plan review /tmp/plan.json` → `plan review`
|
|
62
|
+
* `bun run shrk pack author status` → `pack author status`
|
|
63
|
+
* `bun run shrk context --task "<task>"` → `context`
|
|
64
|
+
* `bun x tsc` → undefined
|
|
65
|
+
*/
|
|
66
|
+
export function parseCommandVerb(raw) {
|
|
67
|
+
let tokens = raw.trim().split(/\s+/);
|
|
68
|
+
if (tokens.length === 0)
|
|
69
|
+
return undefined;
|
|
70
|
+
// Drop leading `bun run` / `npx` / `pnpm exec` wrappers.
|
|
71
|
+
const wrappers = new Set(['bun', 'npx', 'pnpm', 'yarn']);
|
|
72
|
+
if (wrappers.has(tokens[0])) {
|
|
73
|
+
tokens = tokens.slice(1);
|
|
74
|
+
if (tokens[0] === 'run' || tokens[0] === 'exec' || tokens[0] === 'x') {
|
|
75
|
+
tokens = tokens.slice(1);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
// Drop the `shrk` binary name.
|
|
79
|
+
if (tokens[0] !== 'shrk')
|
|
80
|
+
return undefined;
|
|
81
|
+
tokens = tokens.slice(1);
|
|
82
|
+
// Stop at the first flag, placeholder (`<...>`), path-looking arg
|
|
83
|
+
// (`/tmp/...`, `./...`), or quoted-string arg. Placeholders +
|
|
84
|
+
// positional args inflate the verb path so we exclude them.
|
|
85
|
+
const verbTokens = [];
|
|
86
|
+
for (const t of tokens) {
|
|
87
|
+
if (t.startsWith('-'))
|
|
88
|
+
break;
|
|
89
|
+
if (t.startsWith('<') || t.endsWith('>'))
|
|
90
|
+
break;
|
|
91
|
+
if (t.startsWith('/') || t.startsWith('./') || t.startsWith('../'))
|
|
92
|
+
break;
|
|
93
|
+
if (t.startsWith('"') || t.startsWith("'"))
|
|
94
|
+
break;
|
|
95
|
+
verbTokens.push(t);
|
|
96
|
+
}
|
|
97
|
+
if (verbTokens.length === 0)
|
|
98
|
+
return undefined;
|
|
99
|
+
return verbTokens.join(' ');
|
|
100
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { ISurfaceConfig } from '@shrkcrft/config';
|
|
2
|
+
export interface ISurfaceConfigEdit {
|
|
3
|
+
/** What changed. */
|
|
4
|
+
field: 'enabled' | 'hidden';
|
|
5
|
+
/** Command name that was added/removed. */
|
|
6
|
+
command: string;
|
|
7
|
+
/** Operation. */
|
|
8
|
+
operation: 'add' | 'remove';
|
|
9
|
+
}
|
|
10
|
+
export interface ISurfaceConfigDiff {
|
|
11
|
+
configFile: string;
|
|
12
|
+
before: ISurfaceConfig;
|
|
13
|
+
after: ISurfaceConfig;
|
|
14
|
+
edits: readonly ISurfaceConfigEdit[];
|
|
15
|
+
/** Suggested next-command if the user wants to apply. */
|
|
16
|
+
nextCommand: string;
|
|
17
|
+
}
|
|
18
|
+
export interface ISurfaceConfigWriteResult {
|
|
19
|
+
configFile: string;
|
|
20
|
+
edits: readonly ISurfaceConfigEdit[];
|
|
21
|
+
/** Whether the file existed before the write. */
|
|
22
|
+
fileExisted: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Mutate the `surface.enabled[]` array in
|
|
26
|
+
* `sharkcraft.config.ts`. Preview-first: the caller computes the diff
|
|
27
|
+
* via {@link planSurfaceEdit} and only applies it via
|
|
28
|
+
* {@link applySurfaceEdit} when `--write` is passed.
|
|
29
|
+
*/
|
|
30
|
+
export declare function planSurfaceEdit(configFile: string, before: ISurfaceConfig | undefined, edits: readonly ISurfaceConfigEdit[]): ISurfaceConfigDiff;
|
|
31
|
+
/**
|
|
32
|
+
* Apply a previously-planned surface edit to the config file.
|
|
33
|
+
*
|
|
34
|
+
* Strategy:
|
|
35
|
+
* 1. Read the config file as text.
|
|
36
|
+
* 2. If a `surface:` block exists, replace it.
|
|
37
|
+
* 3. Otherwise, append it before the final `})` / `});` of the
|
|
38
|
+
* default-exported config object.
|
|
39
|
+
*
|
|
40
|
+
* The mutator is intentionally text-based (not AST). The config shape
|
|
41
|
+
* is small and the surface block is well-defined; an AST pass would
|
|
42
|
+
* add complexity for no extra correctness. Unit tests lock the behavior.
|
|
43
|
+
*/
|
|
44
|
+
export declare function applySurfaceEdit(diff: ISurfaceConfigDiff): ISurfaceConfigWriteResult;
|
|
45
|
+
/**
|
|
46
|
+
* Render the surface block as a TS object literal.
|
|
47
|
+
*/
|
|
48
|
+
export declare function renderSurfaceBlock(surface: ISurfaceConfig, indent?: string): string;
|
|
49
|
+
/**
|
|
50
|
+
* Compute the new file body given the desired surface block.
|
|
51
|
+
*
|
|
52
|
+
* If the file already has a `surface: { ... }` block, replace it.
|
|
53
|
+
* Otherwise, insert before the closing `})` / `});` of the config
|
|
54
|
+
* literal.
|
|
55
|
+
*/
|
|
56
|
+
export declare function applySurfaceTextEdit(original: string, surface: ISurfaceConfig): string;
|
|
57
|
+
/** Default config file path for a project. */
|
|
58
|
+
export declare function defaultConfigFile(sharkcraftDir: string): string;
|
|
59
|
+
//# sourceMappingURL=surface-config-writer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"surface-config-writer.d.ts","sourceRoot":"","sources":["../../src/surface/surface-config-writer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,MAAM,WAAW,kBAAkB;IACjC,oBAAoB;IACpB,KAAK,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B,2CAA2C;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB;IACjB,SAAS,EAAE,KAAK,GAAG,QAAQ,CAAC;CAC7B;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,cAAc,CAAC;IACvB,KAAK,EAAE,cAAc,CAAC;IACtB,KAAK,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACrC,yDAAyD;IACzD,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,yBAAyB;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACrC,iDAAiD;IACjD,WAAW,EAAE,OAAO,CAAC;CACtB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,cAAc,GAAG,SAAS,EAClC,KAAK,EAAE,SAAS,kBAAkB,EAAE,GACnC,kBAAkB,CA0BpB;AAOD;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,kBAAkB,GACvB,yBAAyB,CAe3B;AAmBD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAO,GAAG,MAAM,CAsBjF;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,MAAM,CAgBtF;AAED,8CAA8C;AAC9C,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAE/D"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import * as nodePath from 'node:path';
|
|
3
|
+
/**
|
|
4
|
+
* Mutate the `surface.enabled[]` array in
|
|
5
|
+
* `sharkcraft.config.ts`. Preview-first: the caller computes the diff
|
|
6
|
+
* via {@link planSurfaceEdit} and only applies it via
|
|
7
|
+
* {@link applySurfaceEdit} when `--write` is passed.
|
|
8
|
+
*/
|
|
9
|
+
export function planSurfaceEdit(configFile, before, edits) {
|
|
10
|
+
const beforeNormalised = {
|
|
11
|
+
enabled: [...(before?.enabled ?? [])],
|
|
12
|
+
hidden: [...(before?.hidden ?? [])],
|
|
13
|
+
};
|
|
14
|
+
const afterEnabled = new Set(beforeNormalised.enabled ?? []);
|
|
15
|
+
const afterHidden = new Set(beforeNormalised.hidden ?? []);
|
|
16
|
+
for (const edit of edits) {
|
|
17
|
+
const target = edit.field === 'enabled' ? afterEnabled : afterHidden;
|
|
18
|
+
if (edit.operation === 'add')
|
|
19
|
+
target.add(edit.command);
|
|
20
|
+
else
|
|
21
|
+
target.delete(edit.command);
|
|
22
|
+
}
|
|
23
|
+
const after = {
|
|
24
|
+
enabled: [...afterEnabled].sort(),
|
|
25
|
+
hidden: [...afterHidden].sort(),
|
|
26
|
+
};
|
|
27
|
+
return {
|
|
28
|
+
configFile,
|
|
29
|
+
before: beforeNormalised,
|
|
30
|
+
after,
|
|
31
|
+
edits,
|
|
32
|
+
nextCommand: edits.length > 0 ? edits.map((e) => describeEdit(e)).join(', ') : '(no-op)',
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function describeEdit(edit) {
|
|
36
|
+
const verb = edit.operation === 'add' ? '+' : '-';
|
|
37
|
+
return `${verb} surface.${edit.field}: ${edit.command}`;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Apply a previously-planned surface edit to the config file.
|
|
41
|
+
*
|
|
42
|
+
* Strategy:
|
|
43
|
+
* 1. Read the config file as text.
|
|
44
|
+
* 2. If a `surface:` block exists, replace it.
|
|
45
|
+
* 3. Otherwise, append it before the final `})` / `});` of the
|
|
46
|
+
* default-exported config object.
|
|
47
|
+
*
|
|
48
|
+
* The mutator is intentionally text-based (not AST). The config shape
|
|
49
|
+
* is small and the surface block is well-defined; an AST pass would
|
|
50
|
+
* add complexity for no extra correctness. Unit tests lock the behavior.
|
|
51
|
+
*/
|
|
52
|
+
export function applySurfaceEdit(diff) {
|
|
53
|
+
if (diff.edits.length === 0) {
|
|
54
|
+
return { configFile: diff.configFile, edits: [], fileExisted: true };
|
|
55
|
+
}
|
|
56
|
+
const fileExisted = fileExists(diff.configFile);
|
|
57
|
+
const original = fileExisted ? readFileSync(diff.configFile, 'utf8') : DEFAULT_CONFIG_BODY;
|
|
58
|
+
const updated = applySurfaceTextEdit(original, diff.after);
|
|
59
|
+
writeFileSync(diff.configFile, updated, 'utf8');
|
|
60
|
+
return {
|
|
61
|
+
configFile: diff.configFile,
|
|
62
|
+
edits: diff.edits,
|
|
63
|
+
fileExisted,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function fileExists(p) {
|
|
67
|
+
try {
|
|
68
|
+
readFileSync(p, 'utf8');
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
const DEFAULT_CONFIG_BODY = `import { defineSharkCraftConfig } from '@shrkcrft/config';
|
|
76
|
+
|
|
77
|
+
export default defineSharkCraftConfig({
|
|
78
|
+
});
|
|
79
|
+
`;
|
|
80
|
+
const SURFACE_BLOCK_REGEX = /(^\s*surface\s*:\s*\{[\s\S]*?\}\s*,?\s*\n)/m;
|
|
81
|
+
/**
|
|
82
|
+
* Render the surface block as a TS object literal.
|
|
83
|
+
*/
|
|
84
|
+
export function renderSurfaceBlock(surface, indent = ' ') {
|
|
85
|
+
const lines = [];
|
|
86
|
+
lines.push(`${indent}surface: {`);
|
|
87
|
+
if (surface.profile) {
|
|
88
|
+
lines.push(`${indent} profile: ${JSON.stringify(surface.profile)},`);
|
|
89
|
+
}
|
|
90
|
+
if (surface.enabled && surface.enabled.length > 0) {
|
|
91
|
+
lines.push(`${indent} enabled: [`);
|
|
92
|
+
for (const name of surface.enabled)
|
|
93
|
+
lines.push(`${indent} ${JSON.stringify(name)},`);
|
|
94
|
+
lines.push(`${indent} ],`);
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
lines.push(`${indent} enabled: [],`);
|
|
98
|
+
}
|
|
99
|
+
if (surface.hidden && surface.hidden.length > 0) {
|
|
100
|
+
lines.push(`${indent} hidden: [`);
|
|
101
|
+
for (const name of surface.hidden)
|
|
102
|
+
lines.push(`${indent} ${JSON.stringify(name)},`);
|
|
103
|
+
lines.push(`${indent} ],`);
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
lines.push(`${indent} hidden: [],`);
|
|
107
|
+
}
|
|
108
|
+
lines.push(`${indent}},`);
|
|
109
|
+
return lines.join('\n') + '\n';
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Compute the new file body given the desired surface block.
|
|
113
|
+
*
|
|
114
|
+
* If the file already has a `surface: { ... }` block, replace it.
|
|
115
|
+
* Otherwise, insert before the closing `})` / `});` of the config
|
|
116
|
+
* literal.
|
|
117
|
+
*/
|
|
118
|
+
export function applySurfaceTextEdit(original, surface) {
|
|
119
|
+
const block = renderSurfaceBlock(surface);
|
|
120
|
+
if (SURFACE_BLOCK_REGEX.test(original)) {
|
|
121
|
+
return original.replace(SURFACE_BLOCK_REGEX, block);
|
|
122
|
+
}
|
|
123
|
+
// Insert before the closing `})` / `});` of the config object.
|
|
124
|
+
// Prefer the last `})` so nested objects don't trip us up.
|
|
125
|
+
const closeRegex = /(\n)(\}\)\s*;?\s*)$/m;
|
|
126
|
+
if (closeRegex.test(original)) {
|
|
127
|
+
return original.replace(closeRegex, `\n${block}$2`);
|
|
128
|
+
}
|
|
129
|
+
// Fallback: append at end with a defineSharkCraftConfig wrapper.
|
|
130
|
+
return `${original}\n${DEFAULT_CONFIG_BODY.replace('})', `${block}})`)}`;
|
|
131
|
+
}
|
|
132
|
+
/** Default config file path for a project. */
|
|
133
|
+
export function defaultConfigFile(sharkcraftDir) {
|
|
134
|
+
return nodePath.join(sharkcraftDir, 'sharkcraft.config.ts');
|
|
135
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { CommandTier, type ICommandCatalogEntry } from '../commands/command-catalog.js';
|
|
2
|
+
import { TierSource, type ITierResolution, type ITierResolverContext } from './tier.js';
|
|
3
|
+
export declare const SURFACE_SUMMARY_SCHEMA = "sharkcraft.surface.v1";
|
|
4
|
+
/** Per-command snapshot used in {@link ISurfaceSummary}. */
|
|
5
|
+
export interface ISurfaceCommandView {
|
|
6
|
+
command: string;
|
|
7
|
+
tier: CommandTier;
|
|
8
|
+
source: TierSource;
|
|
9
|
+
detail?: string;
|
|
10
|
+
/** Whether the command is callable in this project's surface configuration. */
|
|
11
|
+
callable: boolean;
|
|
12
|
+
/** Whether the command shows in default `--help` output. */
|
|
13
|
+
visibleInHelp: boolean;
|
|
14
|
+
/** True if `surface.hidden[]` contains the command. */
|
|
15
|
+
hidden: boolean;
|
|
16
|
+
/** True if `surface.enabled[]` contains the command. */
|
|
17
|
+
enabled: boolean;
|
|
18
|
+
/** Pack contribution source, if any. */
|
|
19
|
+
pack?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface ISurfaceTotals {
|
|
22
|
+
core: number;
|
|
23
|
+
extended: number;
|
|
24
|
+
experimental: number;
|
|
25
|
+
/** Sum of (core + extended visibleInHelp). */
|
|
26
|
+
visible: number;
|
|
27
|
+
/** Sum of all callable commands (core + extended). */
|
|
28
|
+
callable: number;
|
|
29
|
+
}
|
|
30
|
+
export interface ISurfaceSummary {
|
|
31
|
+
schema: typeof SURFACE_SUMMARY_SCHEMA;
|
|
32
|
+
tiers: {
|
|
33
|
+
core: readonly ISurfaceCommandView[];
|
|
34
|
+
extended: readonly ISurfaceCommandView[];
|
|
35
|
+
experimental: readonly ISurfaceCommandView[];
|
|
36
|
+
};
|
|
37
|
+
totals: ISurfaceTotals;
|
|
38
|
+
/**
|
|
39
|
+
* Warnings — e.g. a `surface.enabled` entry that doesn't match any
|
|
40
|
+
* catalog command, or an attempt to hide a core command.
|
|
41
|
+
*/
|
|
42
|
+
warnings: readonly ISurfaceWarning[];
|
|
43
|
+
/** Stable hash of (catalog + context). Used in test snapshots. */
|
|
44
|
+
hash: string;
|
|
45
|
+
}
|
|
46
|
+
export interface ISurfaceWarning {
|
|
47
|
+
command: string;
|
|
48
|
+
code: 'unknown-command' | 'cannot-hide-core' | 'cannot-disable-core' | 'enable-noop' | 'tier-override-conflict';
|
|
49
|
+
message: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Build the canonical surface summary used by `shrk surface list`
|
|
53
|
+
* (text + JSON), the `--about` landing, the help renderer's hidden-set,
|
|
54
|
+
* and the MCP gating layer.
|
|
55
|
+
*
|
|
56
|
+
* Implementation note: deterministic. Same context + catalog → same
|
|
57
|
+
* summary, byte-for-byte. The `hash` field is the SHA-256 prefix of
|
|
58
|
+
* the canonical JSON form (sans the hash itself) — useful for cache
|
|
59
|
+
* keys and snapshot tests.
|
|
60
|
+
*/
|
|
61
|
+
export declare function buildSurfaceSummary(context: ITierResolverContext): ISurfaceSummary;
|
|
62
|
+
/** Look up a single command's tier resolution from a summary. */
|
|
63
|
+
export declare function findCommandInSummary(summary: ISurfaceSummary, command: string): ISurfaceCommandView | undefined;
|
|
64
|
+
/** Resolve a single tier given a context (no summary needed). */
|
|
65
|
+
export declare function resolveTierForCommand(entry: ICommandCatalogEntry, context: ITierResolverContext): ITierResolution;
|
|
66
|
+
//# sourceMappingURL=surface-summary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"surface-summary.d.ts","sourceRoot":"","sources":["../../src/surface/surface-summary.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EAGX,KAAK,oBAAoB,EAC1B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAKL,UAAU,EACV,KAAK,eAAe,EACpB,KAAK,oBAAoB,EAC1B,MAAM,WAAW,CAAC;AAEnB,eAAO,MAAM,sBAAsB,0BAA0B,CAAC;AAE9D,4DAA4D;AAC5D,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,WAAW,CAAC;IAClB,MAAM,EAAE,UAAU,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+EAA+E;IAC/E,QAAQ,EAAE,OAAO,CAAC;IAClB,4DAA4D;IAC5D,aAAa,EAAE,OAAO,CAAC;IACvB,uDAAuD;IACvD,MAAM,EAAE,OAAO,CAAC;IAChB,wDAAwD;IACxD,OAAO,EAAE,OAAO,CAAC;IACjB,wCAAwC;IACxC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,8CAA8C;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,sDAAsD;IACtD,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,OAAO,sBAAsB,CAAC;IACtC,KAAK,EAAE;QACL,IAAI,EAAE,SAAS,mBAAmB,EAAE,CAAC;QACrC,QAAQ,EAAE,SAAS,mBAAmB,EAAE,CAAC;QACzC,YAAY,EAAE,SAAS,mBAAmB,EAAE,CAAC;KAC9C,CAAC;IACF,MAAM,EAAE,cAAc,CAAC;IACvB;;;OAGG;IACH,QAAQ,EAAE,SAAS,eAAe,EAAE,CAAC;IACrC,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,iBAAiB,GAAG,kBAAkB,GAAG,qBAAqB,GAAG,aAAa,GAAG,wBAAwB,CAAC;IAChH,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,oBAAoB,GAC5B,eAAe,CAoFjB;AAkFD,iEAAiE;AACjE,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,MAAM,GACd,mBAAmB,GAAG,SAAS,CAMjC;AAED,iEAAiE;AACjE,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,oBAAoB,EAC3B,OAAO,EAAE,oBAAoB,GAC5B,eAAe,CAEjB"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { CommandTier, COMMAND_CATALOG, defaultShowInHelp, } from "../commands/command-catalog.js";
|
|
3
|
+
import { BOOTSTRAP_COMMANDS, isCallable, isVisibleInDefaultHelp, resolveTier, TierSource, } from "./tier.js";
|
|
4
|
+
export const SURFACE_SUMMARY_SCHEMA = 'sharkcraft.surface.v1';
|
|
5
|
+
/**
|
|
6
|
+
* Build the canonical surface summary used by `shrk surface list`
|
|
7
|
+
* (text + JSON), the `--about` landing, the help renderer's hidden-set,
|
|
8
|
+
* and the MCP gating layer.
|
|
9
|
+
*
|
|
10
|
+
* Implementation note: deterministic. Same context + catalog → same
|
|
11
|
+
* summary, byte-for-byte. The `hash` field is the SHA-256 prefix of
|
|
12
|
+
* the canonical JSON form (sans the hash itself) — useful for cache
|
|
13
|
+
* keys and snapshot tests.
|
|
14
|
+
*/
|
|
15
|
+
export function buildSurfaceSummary(context) {
|
|
16
|
+
const core = [];
|
|
17
|
+
const extended = [];
|
|
18
|
+
const experimental = [];
|
|
19
|
+
const warnings = [];
|
|
20
|
+
const hiddenSet = new Set(context.surfaceConfig?.hidden ?? []);
|
|
21
|
+
const enabledSet = new Set(context.surfaceConfig?.enabled ?? []);
|
|
22
|
+
const knownCommands = new Set();
|
|
23
|
+
for (const entry of COMMAND_CATALOG) {
|
|
24
|
+
knownCommands.add(entry.command);
|
|
25
|
+
const view = makeCommandView(entry, context, hiddenSet, enabledSet, warnings);
|
|
26
|
+
pushIntoBucket(view, core, extended, experimental);
|
|
27
|
+
}
|
|
28
|
+
// Surface bootstrap meta-flags (e.g. `--about`) that aren't
|
|
29
|
+
// ordinary catalog entries. They sit in core for visibility but have
|
|
30
|
+
// no catalog row.
|
|
31
|
+
for (const bootstrap of BOOTSTRAP_COMMANDS) {
|
|
32
|
+
if (knownCommands.has(bootstrap))
|
|
33
|
+
continue;
|
|
34
|
+
core.push({
|
|
35
|
+
command: bootstrap,
|
|
36
|
+
tier: CommandTier.Core,
|
|
37
|
+
source: TierSource.Bootstrap,
|
|
38
|
+
detail: 'bootstrap meta-flag',
|
|
39
|
+
callable: true,
|
|
40
|
+
visibleInHelp: true,
|
|
41
|
+
hidden: false,
|
|
42
|
+
enabled: false,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
// Sort each bucket alphabetically for stable output.
|
|
46
|
+
const sortByName = (a, b) => a.command.localeCompare(b.command);
|
|
47
|
+
core.sort(sortByName);
|
|
48
|
+
extended.sort(sortByName);
|
|
49
|
+
experimental.sort(sortByName);
|
|
50
|
+
// Audit warnings for config keys that don't correspond to anything.
|
|
51
|
+
for (const name of enabledSet) {
|
|
52
|
+
if (!knownCommands.has(name) && !BOOTSTRAP_COMMANDS.includes(name)) {
|
|
53
|
+
warnings.push({
|
|
54
|
+
command: name,
|
|
55
|
+
code: 'unknown-command',
|
|
56
|
+
message: `surface.enabled[] references unknown command: ${name}`,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
for (const name of hiddenSet) {
|
|
61
|
+
if (!knownCommands.has(name) && !BOOTSTRAP_COMMANDS.includes(name)) {
|
|
62
|
+
warnings.push({
|
|
63
|
+
command: name,
|
|
64
|
+
code: 'unknown-command',
|
|
65
|
+
message: `surface.hidden[] references unknown command: ${name}`,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
const totals = {
|
|
70
|
+
core: core.length,
|
|
71
|
+
extended: extended.length,
|
|
72
|
+
experimental: experimental.length,
|
|
73
|
+
visible: core.length + extended.filter((c) => c.visibleInHelp).length,
|
|
74
|
+
callable: core.length +
|
|
75
|
+
extended.length +
|
|
76
|
+
experimental.filter((c) => c.callable).length,
|
|
77
|
+
};
|
|
78
|
+
const summaryWithoutHash = {
|
|
79
|
+
schema: SURFACE_SUMMARY_SCHEMA,
|
|
80
|
+
tiers: { core, extended, experimental },
|
|
81
|
+
totals,
|
|
82
|
+
warnings,
|
|
83
|
+
};
|
|
84
|
+
const hash = createHash('sha256')
|
|
85
|
+
.update(JSON.stringify(summaryWithoutHash))
|
|
86
|
+
.digest('hex')
|
|
87
|
+
.slice(0, 16);
|
|
88
|
+
return { ...summaryWithoutHash, hash };
|
|
89
|
+
}
|
|
90
|
+
function makeCommandView(entry, context, hiddenSet, enabledSet, warnings) {
|
|
91
|
+
const resolution = resolveTier(entry, context);
|
|
92
|
+
const isHidden = hiddenSet.has(entry.command);
|
|
93
|
+
const isEnabled = enabledSet.has(entry.command);
|
|
94
|
+
// Cross-check the config against the derived tier.
|
|
95
|
+
if (resolution.tier === CommandTier.Core) {
|
|
96
|
+
if (isHidden) {
|
|
97
|
+
warnings.push({
|
|
98
|
+
command: entry.command,
|
|
99
|
+
code: 'cannot-hide-core',
|
|
100
|
+
message: `Cannot hide core command: ${entry.command}. Remove from surface.hidden.`,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
if (isEnabled) {
|
|
104
|
+
// Enabling a core command is harmless but pointless.
|
|
105
|
+
warnings.push({
|
|
106
|
+
command: entry.command,
|
|
107
|
+
code: 'enable-noop',
|
|
108
|
+
message: `Enabling a core command is a no-op: ${entry.command}`,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
// Cross-check explicit override against the resolver. If the catalog
|
|
113
|
+
// says Experimental but the resolver promoted to Core (spine /
|
|
114
|
+
// bootstrap), surface a warning so the override is corrected.
|
|
115
|
+
if (entry.tier !== undefined &&
|
|
116
|
+
entry.tier !== resolution.tier &&
|
|
117
|
+
resolution.source !== TierSource.Override) {
|
|
118
|
+
warnings.push({
|
|
119
|
+
command: entry.command,
|
|
120
|
+
code: 'tier-override-conflict',
|
|
121
|
+
message: `Catalog declares tier=${entry.tier} but mechanical derivation resolved to ${resolution.tier} (${resolution.source}). Remove the override.`,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
const view = {
|
|
125
|
+
command: entry.command,
|
|
126
|
+
tier: resolution.tier,
|
|
127
|
+
source: resolution.source,
|
|
128
|
+
callable: isCallable(resolution),
|
|
129
|
+
visibleInHelp: isVisibleInDefaultHelp(resolution, isHidden) && defaultShowInHelp(entry),
|
|
130
|
+
hidden: isHidden,
|
|
131
|
+
enabled: isEnabled,
|
|
132
|
+
};
|
|
133
|
+
if (resolution.detail)
|
|
134
|
+
view.detail = resolution.detail;
|
|
135
|
+
const pack = context.packContributions.get(entry.command);
|
|
136
|
+
if (pack)
|
|
137
|
+
view.pack = pack;
|
|
138
|
+
return view;
|
|
139
|
+
}
|
|
140
|
+
function pushIntoBucket(view, core, extended, experimental) {
|
|
141
|
+
switch (view.tier) {
|
|
142
|
+
case CommandTier.Core:
|
|
143
|
+
core.push(view);
|
|
144
|
+
break;
|
|
145
|
+
case CommandTier.Extended:
|
|
146
|
+
extended.push(view);
|
|
147
|
+
break;
|
|
148
|
+
case CommandTier.Experimental:
|
|
149
|
+
experimental.push(view);
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
/** Look up a single command's tier resolution from a summary. */
|
|
154
|
+
export function findCommandInSummary(summary, command) {
|
|
155
|
+
return (summary.tiers.core.find((c) => c.command === command) ??
|
|
156
|
+
summary.tiers.extended.find((c) => c.command === command) ??
|
|
157
|
+
summary.tiers.experimental.find((c) => c.command === command));
|
|
158
|
+
}
|
|
159
|
+
/** Resolve a single tier given a context (no summary needed). */
|
|
160
|
+
export function resolveTierForCommand(entry, context) {
|
|
161
|
+
return resolveTier(entry, context);
|
|
162
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import type { ISurfaceConfig } from '@shrkcrft/config';
|
|
2
|
+
import { CommandTier, type ICommandCatalogEntry } from '../commands/command-catalog.js';
|
|
3
|
+
/**
|
|
4
|
+
* Bootstrap commands. Always tier=Core regardless of any other
|
|
5
|
+
* derivation rule. Listed here (and only here) so the rule is mechanical:
|
|
6
|
+
* a fresh repo with NO `sharkcraft.config.ts` can always reach these.
|
|
7
|
+
*
|
|
8
|
+
* Tokens are catalog `command` strings (the same form as
|
|
9
|
+
* {@link ICommandCatalogEntry.command}). Multi-token entries (e.g.
|
|
10
|
+
* `pack author status`) are matched exactly.
|
|
11
|
+
*
|
|
12
|
+
* Brutally small set. Discovery verbs (`commands`, `start-here`) live
|
|
13
|
+
* in extended tier; users find them via `shrk surface list` or `shrk
|
|
14
|
+
* recommend`.
|
|
15
|
+
*/
|
|
16
|
+
export declare const BOOTSTRAP_COMMANDS: readonly string[];
|
|
17
|
+
/**
|
|
18
|
+
* Source explanations for tier classification. Returned by the
|
|
19
|
+
* resolver so `shrk surface explain <name>` can describe why a
|
|
20
|
+
* command's tier is what it is.
|
|
21
|
+
*/
|
|
22
|
+
export declare enum TierSource {
|
|
23
|
+
Bootstrap = "bootstrap",
|
|
24
|
+
Spine = "spine",
|
|
25
|
+
PackContribution = "pack-contribution",
|
|
26
|
+
Override = "override",
|
|
27
|
+
Hidden = "hidden-flag",
|
|
28
|
+
Default = "default"
|
|
29
|
+
}
|
|
30
|
+
export interface ITierResolution {
|
|
31
|
+
/** Resolved tier (post-derivation, post-config). */
|
|
32
|
+
tier: CommandTier;
|
|
33
|
+
/** Why the tier resolved that way. */
|
|
34
|
+
source: TierSource;
|
|
35
|
+
/** Human-readable detail (e.g. "in engine.feature-dev spine pipeline"). */
|
|
36
|
+
detail?: string;
|
|
37
|
+
/** True if the user's surface config flipped the default. */
|
|
38
|
+
configApplied?: boolean;
|
|
39
|
+
}
|
|
40
|
+
export interface ITierResolverContext {
|
|
41
|
+
/** Catalog command names ({@link ICommandCatalogEntry.command}) referenced by spine pipelines. */
|
|
42
|
+
spineCommands: ReadonlySet<string>;
|
|
43
|
+
/** Catalog command names contributed by loaded packs (pack-contributed commands). */
|
|
44
|
+
packContributions: ReadonlyMap<string, string>;
|
|
45
|
+
/** User's `sharkcraft.config.ts surface{}` block (may be undefined for a fresh repo). */
|
|
46
|
+
surfaceConfig: ISurfaceConfig | undefined;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Mechanically derive a command's tier.
|
|
50
|
+
*
|
|
51
|
+
* Resolution order (HIGHEST wins, never demotes Core):
|
|
52
|
+
*
|
|
53
|
+
* 1. Bootstrap set → Core.
|
|
54
|
+
* 2. Spine pipeline reference → Core.
|
|
55
|
+
* 3. Pack contribution → Experimental (unless in surface.enabled).
|
|
56
|
+
* 4. Explicit catalog `tier` override → that value (cannot demote Core).
|
|
57
|
+
* 5. Catalog overlay `hidden` verdict → Experimental.
|
|
58
|
+
* 6. Otherwise → Extended.
|
|
59
|
+
*
|
|
60
|
+
* After derivation, the user's `surface.enabled` / `surface.hidden`
|
|
61
|
+
* config can flip a single dimension:
|
|
62
|
+
*
|
|
63
|
+
* - `surface.enabled` contains the command → promote Experimental
|
|
64
|
+
* to Extended (callable, visible in `surface list` only — `--help`
|
|
65
|
+
* visibility is governed by the catalog's own defaultShowInHelp).
|
|
66
|
+
* - `surface.hidden` contains the command AND tier is Extended →
|
|
67
|
+
* remains Extended-tier but hidden from `--help`. The visibility
|
|
68
|
+
* flip is read by the help renderer, not by the tier resolver
|
|
69
|
+
* directly.
|
|
70
|
+
*
|
|
71
|
+
* Core commands cannot be hidden or disabled. Attempts to do so are
|
|
72
|
+
* surfaced as warnings by `shrk doctor` and `shrk surface list --json`.
|
|
73
|
+
*/
|
|
74
|
+
export declare function resolveTier(entry: ICommandCatalogEntry, context: ITierResolverContext): ITierResolution;
|
|
75
|
+
/**
|
|
76
|
+
* Is the command callable from the CLI / MCP in the current
|
|
77
|
+
* surface configuration?
|
|
78
|
+
*
|
|
79
|
+
* - Core: always callable.
|
|
80
|
+
* - Extended: always callable.
|
|
81
|
+
* - Experimental: callable only if in `surface.enabled`.
|
|
82
|
+
*
|
|
83
|
+
* The resolver's promotion of Experimental → Extended already accounts
|
|
84
|
+
* for `enabled[]`, so this is a simple tier check.
|
|
85
|
+
*/
|
|
86
|
+
export declare function isCallable(resolution: ITierResolution): boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Should the command be visible in `--help` output?
|
|
89
|
+
*
|
|
90
|
+
* - Core: always visible.
|
|
91
|
+
* - Extended: visible unless in `surface.hidden` (the help renderer
|
|
92
|
+
* checks the config and consults `defaultShowInHelp(entry)`).
|
|
93
|
+
* - Experimental: never visible in `--help`; only in `surface list`.
|
|
94
|
+
*
|
|
95
|
+
* The caller still consults `defaultShowInHelp(entry)` for the
|
|
96
|
+
* underlying surface/lifecycle gating; this function answers "does
|
|
97
|
+
* the tier permit visibility at all?".
|
|
98
|
+
*/
|
|
99
|
+
export declare function isVisibleInDefaultHelp(resolution: ITierResolution, hiddenByConfig: boolean): boolean;
|
|
100
|
+
//# sourceMappingURL=tier.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tier.d.ts","sourceRoot":"","sources":["../../src/surface/tier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EACL,WAAW,EACX,KAAK,oBAAoB,EAC1B,MAAM,gCAAgC,CAAC;AAExC;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAW9C,CAAC;AAEH;;;;GAIG;AACH,oBAAY,UAAU;IACpB,SAAS,cAAc;IACvB,KAAK,UAAU;IACf,gBAAgB,sBAAsB;IACtC,QAAQ,aAAa;IACrB,MAAM,gBAAgB;IACtB,OAAO,YAAY;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,oDAAoD;IACpD,IAAI,EAAE,WAAW,CAAC;IAClB,sCAAsC;IACtC,MAAM,EAAE,UAAU,CAAC;IACnB,2EAA2E;IAC3E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,6DAA6D;IAC7D,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,oBAAoB;IACnC,kGAAkG;IAClG,aAAa,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACnC,qFAAqF;IACrF,iBAAiB,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/C,yFAAyF;IACzF,aAAa,EAAE,cAAc,GAAG,SAAS,CAAC;CAC3C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,oBAAoB,EAC3B,OAAO,EAAE,oBAAoB,GAC5B,eAAe,CA4EjB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,UAAU,EAAE,eAAe,GAAG,OAAO,CAK/D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,eAAe,EAC3B,cAAc,EAAE,OAAO,GACtB,OAAO,CAKT"}
|