@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,647 @@
|
|
|
1
|
+
import * as nodePath from 'node:path';
|
|
2
|
+
import { inspectSharkcraft, inspectionReferenceLookup } from '@shrkcrft/inspector';
|
|
3
|
+
import { applyPresetPlan, previewResolvedPresetApplication, recommendPresets, resolvePreset, resolvePresetReferences, } from '@shrkcrft/presets';
|
|
4
|
+
import { flagBool, resolveCwd, } from "../command-registry.js";
|
|
5
|
+
import { asJson, header, kv } from "../output/format-output.js";
|
|
6
|
+
function compact(p) {
|
|
7
|
+
return {
|
|
8
|
+
id: p.id,
|
|
9
|
+
title: p.title,
|
|
10
|
+
description: p.description,
|
|
11
|
+
tags: p.tags ?? [],
|
|
12
|
+
appliesTo: p.appliesTo ?? [],
|
|
13
|
+
weight: p.weight ?? 5,
|
|
14
|
+
counts: {
|
|
15
|
+
knowledge: p.includes.knowledge?.length ?? 0,
|
|
16
|
+
rules: p.includes.rules?.length ?? 0,
|
|
17
|
+
paths: p.includes.paths?.length ?? 0,
|
|
18
|
+
templates: p.includes.templates?.length ?? 0,
|
|
19
|
+
pipelines: p.includes.pipelines?.length ?? 0,
|
|
20
|
+
docs: countKv(p.includes.docs),
|
|
21
|
+
tasks: countKv(p.includes.tasks),
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function countKv(v) {
|
|
26
|
+
if (!v)
|
|
27
|
+
return 0;
|
|
28
|
+
if (v instanceof Map)
|
|
29
|
+
return v.size;
|
|
30
|
+
return Object.keys(v).length;
|
|
31
|
+
}
|
|
32
|
+
export const presetsListCommand = {
|
|
33
|
+
name: 'list',
|
|
34
|
+
description: 'List built-in and discovered presets.',
|
|
35
|
+
usage: 'shrk [--cwd <dir>] presets list [--json]',
|
|
36
|
+
async run(args) {
|
|
37
|
+
const inspection = await inspectSharkcraft({ cwd: resolveCwd(args) });
|
|
38
|
+
const presets = inspection.presetRegistry.list();
|
|
39
|
+
if (flagBool(args, 'json')) {
|
|
40
|
+
process.stdout.write(asJson(presets.map((p) => ({
|
|
41
|
+
...compact(p),
|
|
42
|
+
source: inspection.presetSources.get(p.id) ?? null,
|
|
43
|
+
}))) + '\n');
|
|
44
|
+
return 0;
|
|
45
|
+
}
|
|
46
|
+
process.stdout.write(header(`Presets (${presets.length})`));
|
|
47
|
+
for (const p of presets) {
|
|
48
|
+
const src = inspection.presetSources.get(p.id);
|
|
49
|
+
const srcLabel = src?.type === 'pack' ? `[pack:${src.packageName}]` : '[builtin]';
|
|
50
|
+
process.stdout.write(` ${p.id.padEnd(22)} ${srcLabel.padEnd(28)} ${p.title}\n`);
|
|
51
|
+
if (p.tags?.length) {
|
|
52
|
+
process.stdout.write(` tags=[${p.tags.join(', ')}]\n`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return 0;
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
export const presetsGetCommand = {
|
|
59
|
+
name: 'get',
|
|
60
|
+
description: 'Show full details for one preset.',
|
|
61
|
+
usage: 'shrk presets get <id> [--json]',
|
|
62
|
+
async run(args) {
|
|
63
|
+
const id = args.positional[0];
|
|
64
|
+
if (!id) {
|
|
65
|
+
process.stderr.write('Usage: shrk presets get <id>\n');
|
|
66
|
+
return 2;
|
|
67
|
+
}
|
|
68
|
+
const inspection = await inspectSharkcraft({ cwd: resolveCwd(args) });
|
|
69
|
+
const preset = inspection.presetRegistry.get(id);
|
|
70
|
+
if (!preset) {
|
|
71
|
+
process.stderr.write(`No preset with id "${id}".\n`);
|
|
72
|
+
return 1;
|
|
73
|
+
}
|
|
74
|
+
const resolved = resolvePreset(inspection.presetRegistry, id);
|
|
75
|
+
const references = resolvePresetReferences(resolved, inspectionReferenceLookup(inspection));
|
|
76
|
+
if (flagBool(args, 'json')) {
|
|
77
|
+
process.stdout.write(asJson({
|
|
78
|
+
preset,
|
|
79
|
+
composedFrom: resolved.composedFrom,
|
|
80
|
+
includes: resolved.includes,
|
|
81
|
+
recommendedNextCommands: resolved.recommendedNextCommands,
|
|
82
|
+
postInstallNotes: resolved.postInstallNotes,
|
|
83
|
+
safetyNotes: resolved.safetyNotes,
|
|
84
|
+
references,
|
|
85
|
+
issues: resolved.issues,
|
|
86
|
+
}) + '\n');
|
|
87
|
+
return 0;
|
|
88
|
+
}
|
|
89
|
+
process.stdout.write(header(`Preset: ${preset.id}`));
|
|
90
|
+
process.stdout.write(kv('title', preset.title) + '\n');
|
|
91
|
+
process.stdout.write(kv('description', preset.description) + '\n');
|
|
92
|
+
process.stdout.write(kv('tags', (preset.tags ?? []).join(', ')) + '\n');
|
|
93
|
+
process.stdout.write(kv('appliesTo', (preset.appliesTo ?? []).join(', ')) + '\n');
|
|
94
|
+
if (resolved.composedFrom.length > 1) {
|
|
95
|
+
process.stdout.write(kv('composed from', resolved.composedFrom.join(' → ')) + '\n');
|
|
96
|
+
}
|
|
97
|
+
process.stdout.write('\nIncludes (after composition):\n');
|
|
98
|
+
process.stdout.write(` knowledge ${resolved.includes.knowledge?.length ?? 0}\n`);
|
|
99
|
+
process.stdout.write(` rules ${resolved.includes.rules?.length ?? 0}\n`);
|
|
100
|
+
process.stdout.write(` paths ${resolved.includes.paths?.length ?? 0}\n`);
|
|
101
|
+
process.stdout.write(` templates ${resolved.includes.templates?.length ?? 0}\n`);
|
|
102
|
+
process.stdout.write(` pipelines ${resolved.includes.pipelines?.length ?? 0}\n`);
|
|
103
|
+
if (resolved.includes.knowledgeIds?.length ||
|
|
104
|
+
resolved.includes.ruleIds?.length ||
|
|
105
|
+
resolved.includes.pathConventionIds?.length ||
|
|
106
|
+
resolved.includes.templateIds?.length ||
|
|
107
|
+
resolved.includes.pipelineIds?.length) {
|
|
108
|
+
process.stdout.write('\nReferences (existing assets, not embedded):\n');
|
|
109
|
+
describeReferences(references);
|
|
110
|
+
if (references.totalMissing > 0) {
|
|
111
|
+
process.stdout.write(`\n${references.totalMissing} referenced id(s) are missing. Install the relevant pack or add them locally.\n`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (resolved.recommendedNextCommands.length) {
|
|
115
|
+
process.stdout.write('\nRecommended next commands:\n');
|
|
116
|
+
for (const cmd of resolved.recommendedNextCommands) {
|
|
117
|
+
process.stdout.write(` $ ${cmd}\n`);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
if (resolved.postInstallNotes.length) {
|
|
121
|
+
process.stdout.write('\nPost-install notes:\n');
|
|
122
|
+
for (const n of resolved.postInstallNotes) {
|
|
123
|
+
process.stdout.write(` • ${n}\n`);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if (resolved.issues.length) {
|
|
127
|
+
process.stdout.write('\nIssues:\n');
|
|
128
|
+
for (const i of resolved.issues) {
|
|
129
|
+
process.stdout.write(` ${i.severity.toUpperCase()} ${i.code}: ${i.message}\n`);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return 0;
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
export const presetsExplainCommand = {
|
|
136
|
+
name: 'explain',
|
|
137
|
+
description: 'Explain why a preset exists and when to use it. Surfaces title, description, composition chain, the appliesTo profiles in natural language, the recommended next commands, and a short narrative pulled from the preset description.',
|
|
138
|
+
usage: 'shrk presets explain <id> [--json]',
|
|
139
|
+
async run(args) {
|
|
140
|
+
const id = args.positional[0];
|
|
141
|
+
if (!id) {
|
|
142
|
+
process.stderr.write('Usage: shrk presets explain <id>\n');
|
|
143
|
+
return 2;
|
|
144
|
+
}
|
|
145
|
+
const inspection = await inspectSharkcraft({ cwd: resolveCwd(args) });
|
|
146
|
+
const preset = inspection.presetRegistry.get(id);
|
|
147
|
+
if (!preset) {
|
|
148
|
+
process.stderr.write(`No preset with id "${id}".\n`);
|
|
149
|
+
return 1;
|
|
150
|
+
}
|
|
151
|
+
const resolved = resolvePreset(inspection.presetRegistry, id);
|
|
152
|
+
const composedFrom = resolved.composedFrom.length > 1 ? resolved.composedFrom : [];
|
|
153
|
+
const appliesNatural = (preset.appliesTo ?? []).map(humanizeProfile);
|
|
154
|
+
const recs = recommendPresets(inspection.presetRegistry.list(), {
|
|
155
|
+
profiles: inspection.workspace.profiles,
|
|
156
|
+
limit: 5,
|
|
157
|
+
});
|
|
158
|
+
const recRank = recs.findIndex((r) => r.preset.id === preset.id);
|
|
159
|
+
const recScore = recRank >= 0 ? recs[recRank].score : 0;
|
|
160
|
+
if (flagBool(args, 'json')) {
|
|
161
|
+
process.stdout.write(asJson({
|
|
162
|
+
presetId: preset.id,
|
|
163
|
+
title: preset.title,
|
|
164
|
+
description: preset.description,
|
|
165
|
+
tags: preset.tags ?? [],
|
|
166
|
+
appliesTo: preset.appliesTo ?? [],
|
|
167
|
+
appliesNatural,
|
|
168
|
+
composedFrom,
|
|
169
|
+
recommendedNextCommands: resolved.recommendedNextCommands,
|
|
170
|
+
counts: {
|
|
171
|
+
knowledge: resolved.includes.knowledge?.length ?? 0,
|
|
172
|
+
rules: resolved.includes.rules?.length ?? 0,
|
|
173
|
+
paths: resolved.includes.paths?.length ?? 0,
|
|
174
|
+
templates: resolved.includes.templates?.length ?? 0,
|
|
175
|
+
pipelines: resolved.includes.pipelines?.length ?? 0,
|
|
176
|
+
},
|
|
177
|
+
recommendationRank: recRank >= 0 ? recRank + 1 : null,
|
|
178
|
+
recommendationScore: recScore,
|
|
179
|
+
}) + '\n');
|
|
180
|
+
return 0;
|
|
181
|
+
}
|
|
182
|
+
process.stdout.write(header(`Preset explain: ${preset.id}`));
|
|
183
|
+
process.stdout.write(` ${preset.title}\n`);
|
|
184
|
+
process.stdout.write(` ${preset.description}\n\n`);
|
|
185
|
+
if (preset.tags?.length) {
|
|
186
|
+
process.stdout.write(`tags: ${preset.tags.join(', ')}\n`);
|
|
187
|
+
}
|
|
188
|
+
if (appliesNatural.length) {
|
|
189
|
+
process.stdout.write('\nApplies when this repo:\n');
|
|
190
|
+
for (const a of appliesNatural)
|
|
191
|
+
process.stdout.write(` • ${a}\n`);
|
|
192
|
+
}
|
|
193
|
+
if (composedFrom.length) {
|
|
194
|
+
process.stdout.write('\nComposed from (lower layers applied first, this preset wins):\n');
|
|
195
|
+
for (const c of composedFrom)
|
|
196
|
+
process.stdout.write(` → ${c}\n`);
|
|
197
|
+
}
|
|
198
|
+
process.stdout.write('\nWhat you get (after composition):\n');
|
|
199
|
+
process.stdout.write(` knowledge entries ${resolved.includes.knowledge?.length ?? 0}\n`);
|
|
200
|
+
process.stdout.write(` rules ${resolved.includes.rules?.length ?? 0}\n`);
|
|
201
|
+
process.stdout.write(` path conventions ${resolved.includes.paths?.length ?? 0}\n`);
|
|
202
|
+
process.stdout.write(` templates ${resolved.includes.templates?.length ?? 0}\n`);
|
|
203
|
+
process.stdout.write(` pipelines ${resolved.includes.pipelines?.length ?? 0}\n`);
|
|
204
|
+
if (resolved.recommendedNextCommands.length) {
|
|
205
|
+
process.stdout.write('\nNext after applying:\n');
|
|
206
|
+
for (const c of resolved.recommendedNextCommands)
|
|
207
|
+
process.stdout.write(` $ ${c}\n`);
|
|
208
|
+
}
|
|
209
|
+
if (recRank >= 0) {
|
|
210
|
+
process.stdout.write(`\nFor this repo: rank ${recRank + 1} of ${recs.length} (score ${recScore}).\n`);
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
process.stdout.write('\nFor this repo: not currently recommended — pass `--preset ' + preset.id + '` to apply explicitly.\n');
|
|
214
|
+
}
|
|
215
|
+
return 0;
|
|
216
|
+
},
|
|
217
|
+
};
|
|
218
|
+
function humanizeProfile(profile) {
|
|
219
|
+
// Map WorkspaceProfile string values back to a short natural-language
|
|
220
|
+
// clause. Keep the mapping local — adding new profiles to the engine
|
|
221
|
+
// shouldn't break this command; unknown profiles fall through verbatim.
|
|
222
|
+
const map = {
|
|
223
|
+
'has-typescript': 'uses TypeScript',
|
|
224
|
+
'has-bun': 'uses Bun',
|
|
225
|
+
'has-nx': 'is an Nx workspace',
|
|
226
|
+
'has-turborepo': 'is a Turborepo workspace',
|
|
227
|
+
'has-package-workspaces': 'uses package workspaces (npm/pnpm/yarn)',
|
|
228
|
+
'has-react': 'uses React',
|
|
229
|
+
'has-next': 'uses Next.js',
|
|
230
|
+
'has-angular': 'uses Angular',
|
|
231
|
+
'has-vue': 'uses Vue',
|
|
232
|
+
'has-nestjs': 'uses NestJS',
|
|
233
|
+
'has-mcp-sdk': 'depends on the MCP SDK',
|
|
234
|
+
'has-tests': 'has a test runner',
|
|
235
|
+
'has-eslint': 'uses ESLint',
|
|
236
|
+
'has-biome': 'uses Biome',
|
|
237
|
+
'has-github-actions': 'has GitHub Actions',
|
|
238
|
+
'is-library': 'is published as a library',
|
|
239
|
+
'is-service': 'runs as a service',
|
|
240
|
+
'is-monorepo': 'is a monorepo',
|
|
241
|
+
'is-frontend': 'is a frontend',
|
|
242
|
+
'is-backend': 'is a backend',
|
|
243
|
+
};
|
|
244
|
+
return map[profile] ?? profile;
|
|
245
|
+
}
|
|
246
|
+
export const presetsRecommendCommand = {
|
|
247
|
+
name: 'recommend',
|
|
248
|
+
description: 'Recommend presets based on the detected project profile.',
|
|
249
|
+
usage: 'shrk [--cwd <dir>] presets recommend [--limit N] [--json]',
|
|
250
|
+
async run(args) {
|
|
251
|
+
const inspection = await inspectSharkcraft({ cwd: resolveCwd(args) });
|
|
252
|
+
const limitFlag = args.flags.get('limit');
|
|
253
|
+
const limit = typeof limitFlag === 'string' ? Number(limitFlag) || 5 : 5;
|
|
254
|
+
const recs = recommendPresets(inspection.presetRegistry.list(), {
|
|
255
|
+
profiles: inspection.workspace.profiles,
|
|
256
|
+
limit,
|
|
257
|
+
});
|
|
258
|
+
if (flagBool(args, 'json')) {
|
|
259
|
+
process.stdout.write(asJson({
|
|
260
|
+
detectedProfiles: inspection.workspace.profiles,
|
|
261
|
+
recommendations: recs.map((r) => ({
|
|
262
|
+
preset: compact(r.preset),
|
|
263
|
+
score: r.score,
|
|
264
|
+
confidence: r.confidence,
|
|
265
|
+
reasons: r.reasons,
|
|
266
|
+
})),
|
|
267
|
+
}) + '\n');
|
|
268
|
+
return 0;
|
|
269
|
+
}
|
|
270
|
+
process.stdout.write(header('Preset recommendations'));
|
|
271
|
+
process.stdout.write(kv('detected profiles', inspection.workspace.profiles.join(', ') || '(none)') + '\n\n');
|
|
272
|
+
if (recs.length === 0) {
|
|
273
|
+
process.stdout.write('No matching presets — try `shrk presets list`.\n');
|
|
274
|
+
return 0;
|
|
275
|
+
}
|
|
276
|
+
for (const r of recs) {
|
|
277
|
+
process.stdout.write(` ${r.preset.id.padEnd(22)} confidence=${r.confidence.padEnd(6)} score=${r.score}\n`);
|
|
278
|
+
for (const reason of r.reasons) {
|
|
279
|
+
process.stdout.write(` • ${reason}\n`);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
return 0;
|
|
283
|
+
},
|
|
284
|
+
};
|
|
285
|
+
function describePlan(plan, force, merge) {
|
|
286
|
+
const lines = [];
|
|
287
|
+
lines.push(`Plan for ${plan.presetId} → ${plan.sharkcraftDir}`);
|
|
288
|
+
if (force)
|
|
289
|
+
lines.push(' mode: --force (will overwrite existing files)');
|
|
290
|
+
else if (merge)
|
|
291
|
+
lines.push(' mode: --merge (append to existing where supported)');
|
|
292
|
+
else
|
|
293
|
+
lines.push(' mode: default (skip existing files)');
|
|
294
|
+
lines.push('');
|
|
295
|
+
for (const e of plan.entries) {
|
|
296
|
+
const tag = e.status === 'create'
|
|
297
|
+
? 'CREATE '
|
|
298
|
+
: e.status === 'overwrite-with-force'
|
|
299
|
+
? 'OVERWRITE '
|
|
300
|
+
: e.status === 'merge-additive'
|
|
301
|
+
? 'APPEND '
|
|
302
|
+
: 'SKIP-EXISTING';
|
|
303
|
+
lines.push(` ${tag} ${e.relPath}`);
|
|
304
|
+
}
|
|
305
|
+
if (plan.warnings.length) {
|
|
306
|
+
lines.push('');
|
|
307
|
+
for (const w of plan.warnings)
|
|
308
|
+
lines.push(` WARN ${w}`);
|
|
309
|
+
}
|
|
310
|
+
return lines.join('\n');
|
|
311
|
+
}
|
|
312
|
+
export const presetsPreviewCommand = {
|
|
313
|
+
name: 'preview',
|
|
314
|
+
description: 'Preview the files a preset would write into the target sharkcraft/ folder.',
|
|
315
|
+
usage: 'shrk [--cwd <dir>] presets preview <id> [--force] [--merge] [--json]',
|
|
316
|
+
async run(args) {
|
|
317
|
+
const id = args.positional[0];
|
|
318
|
+
if (!id) {
|
|
319
|
+
process.stderr.write('Usage: shrk presets preview <id>\n');
|
|
320
|
+
return 2;
|
|
321
|
+
}
|
|
322
|
+
const cwd = resolveCwd(args);
|
|
323
|
+
const inspection = await inspectSharkcraft({ cwd });
|
|
324
|
+
const preset = inspection.presetRegistry.get(id);
|
|
325
|
+
if (!preset) {
|
|
326
|
+
process.stderr.write(`No preset with id "${id}".\n`);
|
|
327
|
+
return 1;
|
|
328
|
+
}
|
|
329
|
+
const force = flagBool(args, 'force');
|
|
330
|
+
const merge = flagBool(args, 'merge');
|
|
331
|
+
const resolved = resolvePreset(inspection.presetRegistry, id);
|
|
332
|
+
const references = resolvePresetReferences(resolved, inspectionReferenceLookup(inspection));
|
|
333
|
+
const plan = previewResolvedPresetApplication(resolved, { projectRoot: cwd, force, merge });
|
|
334
|
+
if (flagBool(args, 'json')) {
|
|
335
|
+
process.stdout.write(asJson({
|
|
336
|
+
composedFrom: resolved.composedFrom,
|
|
337
|
+
issues: resolved.issues,
|
|
338
|
+
references,
|
|
339
|
+
plan,
|
|
340
|
+
}) + '\n');
|
|
341
|
+
return 0;
|
|
342
|
+
}
|
|
343
|
+
process.stdout.write(header(`Preset preview: ${id}`));
|
|
344
|
+
if (resolved.composedFrom.length > 1) {
|
|
345
|
+
process.stdout.write(kv('composed from', resolved.composedFrom.join(' → ')) + '\n');
|
|
346
|
+
}
|
|
347
|
+
if (resolved.issues.length) {
|
|
348
|
+
for (const i of resolved.issues) {
|
|
349
|
+
process.stdout.write(` ${i.severity.toUpperCase()} ${i.code}: ${i.message}\n`);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
process.stdout.write(describePlan(plan, force, merge) + '\n');
|
|
353
|
+
if (references.totalReferenced > 0) {
|
|
354
|
+
process.stdout.write('\nReferenced assets (resolved against current inspection):\n');
|
|
355
|
+
describeReferences(references);
|
|
356
|
+
}
|
|
357
|
+
process.stdout.write('\nRe-run with `shrk presets apply ' + id + ' --write` to write.\n');
|
|
358
|
+
return 0;
|
|
359
|
+
},
|
|
360
|
+
};
|
|
361
|
+
function describeReferences(refs) {
|
|
362
|
+
for (const [label, group] of [
|
|
363
|
+
['knowledge', refs.knowledge],
|
|
364
|
+
['rules', refs.rules],
|
|
365
|
+
['paths', refs.paths],
|
|
366
|
+
['templates', refs.templates],
|
|
367
|
+
['pipelines', refs.pipelines],
|
|
368
|
+
]) {
|
|
369
|
+
if (!group.resolved.length && !group.missing.length)
|
|
370
|
+
continue;
|
|
371
|
+
process.stdout.write(` ${label}:\n`);
|
|
372
|
+
for (const id of group.resolved)
|
|
373
|
+
process.stdout.write(` OK ${id}\n`);
|
|
374
|
+
for (const id of group.missing)
|
|
375
|
+
process.stdout.write(` MISSING ${id}\n`);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
export const presetsApplyCommand = {
|
|
379
|
+
name: 'apply',
|
|
380
|
+
description: 'Apply a preset to the target repo. Dry-run by default; pass --write to persist. Never overwrites existing files unless --force; --merge appends to mergable files.',
|
|
381
|
+
usage: 'shrk [--cwd <dir>] presets apply <id> [--write] [--force] [--merge] [--json]',
|
|
382
|
+
async run(args) {
|
|
383
|
+
const id = args.positional[0];
|
|
384
|
+
if (!id) {
|
|
385
|
+
process.stderr.write('Usage: shrk presets apply <id> [--write]\n');
|
|
386
|
+
return 2;
|
|
387
|
+
}
|
|
388
|
+
const cwd = resolveCwd(args);
|
|
389
|
+
const inspection = await inspectSharkcraft({ cwd });
|
|
390
|
+
const preset = inspection.presetRegistry.get(id);
|
|
391
|
+
if (!preset) {
|
|
392
|
+
process.stderr.write(`No preset with id "${id}".\n`);
|
|
393
|
+
return 1;
|
|
394
|
+
}
|
|
395
|
+
const force = flagBool(args, 'force');
|
|
396
|
+
const merge = flagBool(args, 'merge');
|
|
397
|
+
const write = flagBool(args, 'write');
|
|
398
|
+
const resolved = resolvePreset(inspection.presetRegistry, id);
|
|
399
|
+
if (resolved.issues.some((i) => i.severity === 'error')) {
|
|
400
|
+
process.stderr.write('Refusing to apply: composition errors:\n');
|
|
401
|
+
for (const i of resolved.issues) {
|
|
402
|
+
process.stderr.write(` ${i.severity.toUpperCase()} ${i.code}: ${i.message}\n`);
|
|
403
|
+
}
|
|
404
|
+
return 1;
|
|
405
|
+
}
|
|
406
|
+
const plan = previewResolvedPresetApplication(resolved, { projectRoot: cwd, force, merge });
|
|
407
|
+
if (flagBool(args, 'json')) {
|
|
408
|
+
if (!write) {
|
|
409
|
+
process.stdout.write(asJson({ mode: 'dry-run', plan }) + '\n');
|
|
410
|
+
return 0;
|
|
411
|
+
}
|
|
412
|
+
const result = applyPresetPlan(plan);
|
|
413
|
+
process.stdout.write(asJson({ mode: 'write', plan, result }) + '\n');
|
|
414
|
+
return 0;
|
|
415
|
+
}
|
|
416
|
+
process.stdout.write(header(`Preset apply: ${id}`));
|
|
417
|
+
process.stdout.write(describePlan(plan, force, merge) + '\n');
|
|
418
|
+
if (!write) {
|
|
419
|
+
process.stdout.write('\nDry-run — re-run with --write to persist.\n');
|
|
420
|
+
return 0;
|
|
421
|
+
}
|
|
422
|
+
const result = applyPresetPlan(plan);
|
|
423
|
+
process.stdout.write(`\nWrote ${result.written.length} file(s).\n`);
|
|
424
|
+
for (const p of result.written) {
|
|
425
|
+
process.stdout.write(` + ${p}\n`);
|
|
426
|
+
}
|
|
427
|
+
if (result.skipped.length) {
|
|
428
|
+
process.stdout.write('\nSkipped:\n');
|
|
429
|
+
for (const p of result.skipped) {
|
|
430
|
+
process.stdout.write(` - ${p}\n`);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
if (preset.recommendedNextCommands?.length) {
|
|
434
|
+
process.stdout.write('\nNext:\n');
|
|
435
|
+
for (const cmd of preset.recommendedNextCommands) {
|
|
436
|
+
process.stdout.write(` $ ${cmd}\n`);
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
return 0;
|
|
440
|
+
},
|
|
441
|
+
};
|
|
442
|
+
export const presetsDoctorCommand = {
|
|
443
|
+
name: 'doctor',
|
|
444
|
+
description: 'Check whether the current repo matches a preset baseline (missing files / entries / templates / pipelines).',
|
|
445
|
+
usage: 'shrk [--cwd <dir>] presets doctor <id> [--json]',
|
|
446
|
+
async run(args) {
|
|
447
|
+
const id = args.positional[0];
|
|
448
|
+
if (!id) {
|
|
449
|
+
process.stderr.write('Usage: shrk presets doctor <id>\n');
|
|
450
|
+
return 2;
|
|
451
|
+
}
|
|
452
|
+
const cwd = resolveCwd(args);
|
|
453
|
+
const inspection = await inspectSharkcraft({ cwd });
|
|
454
|
+
const preset = inspection.presetRegistry.get(id);
|
|
455
|
+
if (!preset) {
|
|
456
|
+
process.stderr.write(`No preset with id "${id}".\n`);
|
|
457
|
+
return 1;
|
|
458
|
+
}
|
|
459
|
+
const resolved = resolvePreset(inspection.presetRegistry, id);
|
|
460
|
+
const references = resolvePresetReferences(resolved, inspectionReferenceLookup(inspection));
|
|
461
|
+
const plan = previewResolvedPresetApplication(resolved, { projectRoot: cwd });
|
|
462
|
+
const missing = plan.entries
|
|
463
|
+
.filter((e) => e.status === 'create')
|
|
464
|
+
.map((e) => e.relPath);
|
|
465
|
+
const present = plan.entries
|
|
466
|
+
.filter((e) => e.status !== 'create')
|
|
467
|
+
.map((e) => e.relPath);
|
|
468
|
+
if (flagBool(args, 'json')) {
|
|
469
|
+
process.stdout.write(asJson({
|
|
470
|
+
presetId: preset.id,
|
|
471
|
+
missing,
|
|
472
|
+
present,
|
|
473
|
+
references,
|
|
474
|
+
issues: resolved.issues,
|
|
475
|
+
conforms: missing.length === 0 && references.totalMissing === 0,
|
|
476
|
+
}) + '\n');
|
|
477
|
+
return missing.length === 0 && references.totalMissing === 0 ? 0 : 1;
|
|
478
|
+
}
|
|
479
|
+
process.stdout.write(header(`Preset doctor: ${preset.id}`));
|
|
480
|
+
process.stdout.write(kv('present files', String(present.length)) + '\n');
|
|
481
|
+
process.stdout.write(kv('missing files', String(missing.length)) + '\n');
|
|
482
|
+
if (references.totalReferenced > 0) {
|
|
483
|
+
process.stdout.write(kv('referenced ids', `${references.totalReferenced - references.totalMissing}/${references.totalReferenced}`) + '\n');
|
|
484
|
+
}
|
|
485
|
+
process.stdout.write('\n');
|
|
486
|
+
for (const m of missing)
|
|
487
|
+
process.stdout.write(` MISSING file ${m}\n`);
|
|
488
|
+
for (const m of references.missing) {
|
|
489
|
+
process.stdout.write(` MISSING ${m.kind.padEnd(8)} ${m.id}\n`);
|
|
490
|
+
}
|
|
491
|
+
for (const i of resolved.issues) {
|
|
492
|
+
process.stdout.write(` ${i.severity.toUpperCase().padEnd(8)} ${i.code}: ${i.message}\n`);
|
|
493
|
+
}
|
|
494
|
+
const conforms = missing.length === 0 && references.totalMissing === 0 && resolved.issues.length === 0;
|
|
495
|
+
process.stdout.write(`\nVerdict: ${conforms ? 'matches ✓' : `not conforming — run \`shrk presets patch ${preset.id} --write\``}\n`);
|
|
496
|
+
return conforms ? 0 : 1;
|
|
497
|
+
},
|
|
498
|
+
};
|
|
499
|
+
/**
|
|
500
|
+
* `shrk presets diff <id>` — show what's missing compared to a preset. Dry-run
|
|
501
|
+
* preview; never writes. `shrk presets patch <id> --write` writes only the
|
|
502
|
+
* missing pieces (existing files untouched).
|
|
503
|
+
*/
|
|
504
|
+
function buildDiff(resolved, references, plan) {
|
|
505
|
+
return {
|
|
506
|
+
missingFiles: plan.entries.filter((e) => e.status === 'create').map((e) => e.relPath),
|
|
507
|
+
existingFiles: plan.entries.filter((e) => e.status === 'skip-existing').map((e) => e.relPath),
|
|
508
|
+
conflictFiles: plan.entries.filter((e) => e.status === 'overwrite-with-force').map((e) => e.relPath),
|
|
509
|
+
missingKnowledgeIds: [...references.knowledge.missing],
|
|
510
|
+
missingRuleIds: [...references.rules.missing],
|
|
511
|
+
missingPathIds: [...references.paths.missing],
|
|
512
|
+
missingTemplateIds: [...references.templates.missing],
|
|
513
|
+
missingPipelineIds: [...references.pipelines.missing],
|
|
514
|
+
composedFrom: resolved.composedFrom,
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
export const presetsDiffCommand = {
|
|
518
|
+
name: 'diff',
|
|
519
|
+
description: 'Show what the current repo is missing compared to a preset. Always read-only — pair with `shrk presets patch` to write the missing pieces.',
|
|
520
|
+
usage: 'shrk [--cwd <dir>] presets diff <id> [--json]',
|
|
521
|
+
async run(args) {
|
|
522
|
+
const id = args.positional[0];
|
|
523
|
+
if (!id) {
|
|
524
|
+
process.stderr.write('Usage: shrk presets diff <id>\n');
|
|
525
|
+
return 2;
|
|
526
|
+
}
|
|
527
|
+
const cwd = resolveCwd(args);
|
|
528
|
+
const inspection = await inspectSharkcraft({ cwd });
|
|
529
|
+
if (!inspection.presetRegistry.has(id)) {
|
|
530
|
+
process.stderr.write(`No preset with id "${id}".\n`);
|
|
531
|
+
return 1;
|
|
532
|
+
}
|
|
533
|
+
const resolved = resolvePreset(inspection.presetRegistry, id);
|
|
534
|
+
const references = resolvePresetReferences(resolved, inspectionReferenceLookup(inspection));
|
|
535
|
+
const plan = previewResolvedPresetApplication(resolved, { projectRoot: cwd });
|
|
536
|
+
const diff = buildDiff(resolved, references, plan);
|
|
537
|
+
if (flagBool(args, 'json')) {
|
|
538
|
+
process.stdout.write(asJson({ presetId: id, diff }) + '\n');
|
|
539
|
+
return 0;
|
|
540
|
+
}
|
|
541
|
+
process.stdout.write(header(`Preset diff: ${id}`));
|
|
542
|
+
if (diff.composedFrom.length > 1) {
|
|
543
|
+
process.stdout.write(kv('composed from', diff.composedFrom.join(' → ')) + '\n');
|
|
544
|
+
}
|
|
545
|
+
process.stdout.write(kv('summary', `missing files=${diff.missingFiles.length}, existing files=${diff.existingFiles.length}, missing refs=${diff.missingKnowledgeIds.length +
|
|
546
|
+
diff.missingRuleIds.length +
|
|
547
|
+
diff.missingPathIds.length +
|
|
548
|
+
diff.missingTemplateIds.length +
|
|
549
|
+
diff.missingPipelineIds.length}`) + '\n\n');
|
|
550
|
+
if (diff.missingFiles.length) {
|
|
551
|
+
process.stdout.write('Missing files:\n');
|
|
552
|
+
for (const p of diff.missingFiles)
|
|
553
|
+
process.stdout.write(` + ${p}\n`);
|
|
554
|
+
process.stdout.write('\n');
|
|
555
|
+
}
|
|
556
|
+
if (diff.existingFiles.length) {
|
|
557
|
+
process.stdout.write('Existing (preset would skip):\n');
|
|
558
|
+
for (const p of diff.existingFiles)
|
|
559
|
+
process.stdout.write(` = ${p}\n`);
|
|
560
|
+
process.stdout.write('\n');
|
|
561
|
+
}
|
|
562
|
+
const groups = [
|
|
563
|
+
['missing knowledge ids', diff.missingKnowledgeIds],
|
|
564
|
+
['missing rule ids', diff.missingRuleIds],
|
|
565
|
+
['missing path ids', diff.missingPathIds],
|
|
566
|
+
['missing template ids', diff.missingTemplateIds],
|
|
567
|
+
['missing pipeline ids', diff.missingPipelineIds],
|
|
568
|
+
];
|
|
569
|
+
for (const [label, ids] of groups) {
|
|
570
|
+
if (!ids.length)
|
|
571
|
+
continue;
|
|
572
|
+
process.stdout.write(`${label}:\n`);
|
|
573
|
+
for (const id2 of ids)
|
|
574
|
+
process.stdout.write(` - ${id2}\n`);
|
|
575
|
+
process.stdout.write('\n');
|
|
576
|
+
}
|
|
577
|
+
const conforms = diff.missingFiles.length === 0 &&
|
|
578
|
+
diff.missingKnowledgeIds.length === 0 &&
|
|
579
|
+
diff.missingRuleIds.length === 0 &&
|
|
580
|
+
diff.missingPathIds.length === 0 &&
|
|
581
|
+
diff.missingTemplateIds.length === 0 &&
|
|
582
|
+
diff.missingPipelineIds.length === 0;
|
|
583
|
+
process.stdout.write(conforms
|
|
584
|
+
? 'Verdict: repo matches preset ✓\n'
|
|
585
|
+
: `Verdict: run \`shrk presets patch ${id} --write\` to write the missing pieces.\n`);
|
|
586
|
+
return conforms ? 0 : 1;
|
|
587
|
+
},
|
|
588
|
+
};
|
|
589
|
+
/**
|
|
590
|
+
* `shrk presets patch <id>` — write only the missing pieces. Dry-run by default;
|
|
591
|
+
* `--write` persists. Never overwrites existing files (use `presets apply --force`
|
|
592
|
+
* for that).
|
|
593
|
+
*/
|
|
594
|
+
export const presetsPatchCommand = {
|
|
595
|
+
name: 'patch',
|
|
596
|
+
description: 'Write only the missing files from a preset (never overwrites existing files). Dry-run by default; --write persists.',
|
|
597
|
+
usage: 'shrk [--cwd <dir>] presets patch <id> [--write] [--json]',
|
|
598
|
+
async run(args) {
|
|
599
|
+
const id = args.positional[0];
|
|
600
|
+
if (!id) {
|
|
601
|
+
process.stderr.write('Usage: shrk presets patch <id> [--write]\n');
|
|
602
|
+
return 2;
|
|
603
|
+
}
|
|
604
|
+
const cwd = resolveCwd(args);
|
|
605
|
+
const inspection = await inspectSharkcraft({ cwd });
|
|
606
|
+
if (!inspection.presetRegistry.has(id)) {
|
|
607
|
+
process.stderr.write(`No preset with id "${id}".\n`);
|
|
608
|
+
return 1;
|
|
609
|
+
}
|
|
610
|
+
const write = flagBool(args, 'write');
|
|
611
|
+
const resolved = resolvePreset(inspection.presetRegistry, id);
|
|
612
|
+
const plan = previewResolvedPresetApplication(resolved, { projectRoot: cwd });
|
|
613
|
+
// Filter to only create-status entries (true patch — never touches existing).
|
|
614
|
+
const patchPlan = {
|
|
615
|
+
...plan,
|
|
616
|
+
entries: plan.entries.filter((e) => e.status === 'create'),
|
|
617
|
+
};
|
|
618
|
+
if (flagBool(args, 'json')) {
|
|
619
|
+
if (!write) {
|
|
620
|
+
process.stdout.write(asJson({ mode: 'dry-run', plan: patchPlan }) + '\n');
|
|
621
|
+
return 0;
|
|
622
|
+
}
|
|
623
|
+
const result = applyPresetPlan(patchPlan);
|
|
624
|
+
process.stdout.write(asJson({ mode: 'write', plan: patchPlan, result }) + '\n');
|
|
625
|
+
return 0;
|
|
626
|
+
}
|
|
627
|
+
process.stdout.write(header(`Preset patch: ${id}`));
|
|
628
|
+
if (patchPlan.entries.length === 0) {
|
|
629
|
+
process.stdout.write('Nothing to patch — repo already matches.\n');
|
|
630
|
+
return 0;
|
|
631
|
+
}
|
|
632
|
+
for (const e of patchPlan.entries)
|
|
633
|
+
process.stdout.write(` + ${e.relPath}\n`);
|
|
634
|
+
if (!write) {
|
|
635
|
+
process.stdout.write('\nDry-run — re-run with --write to persist.\n');
|
|
636
|
+
return 0;
|
|
637
|
+
}
|
|
638
|
+
const result = applyPresetPlan(patchPlan);
|
|
639
|
+
process.stdout.write(`\nWrote ${result.written.length} file(s).\n`);
|
|
640
|
+
return 0;
|
|
641
|
+
},
|
|
642
|
+
};
|
|
643
|
+
// Re-export the suggested-cwd helper for tests that don't want to spin up the
|
|
644
|
+
// real CLI.
|
|
645
|
+
export function _presetSuggestedTargetRoot(cwd) {
|
|
646
|
+
return nodePath.resolve(cwd);
|
|
647
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ICommandHandler } from '../command-registry.js';
|
|
2
|
+
export declare const profilesListCommand: ICommandHandler;
|
|
3
|
+
export declare const profilesGetCommand: ICommandHandler;
|
|
4
|
+
export declare const profilesDoctorCommand: ICommandHandler;
|
|
5
|
+
export declare const profilesSearchCommand: ICommandHandler;
|
|
6
|
+
export declare const profilesCommand: ICommandHandler;
|
|
7
|
+
//# sourceMappingURL=profiles.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profiles.command.d.ts","sourceRoot":"","sources":["../../src/commands/profiles.command.ts"],"names":[],"mappings":"AAWA,OAAO,EAIL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAUhC,eAAO,MAAM,mBAAmB,EAAE,eA4BjC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,eAiChC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,eAsBnC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,eA8BnC,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,eAe7B,CAAC"}
|