@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,301 @@
|
|
|
1
|
+
import { buildKnowledgeStaleReport, buildScaffoldCoverageReport, buildSpecList, buildTaskPacket, buildTemplateDriftReport, buildUncertaintySummary, decomposeTask, entrypointBanner, inspectSharkcraft, lintKnowledge, renderScaffoldCoverageMarkdown, renderUncertaintyText, runDoctor, } from '@shrkcrft/inspector';
|
|
2
|
+
import { SpecStatus } from '@shrkcrft/generator';
|
|
3
|
+
import { flagBool, flagNumber, flagList, resolveCwd, } from "../command-registry.js";
|
|
4
|
+
import { asJson, header, kv } from "../output/format-output.js";
|
|
5
|
+
import { buildTaskNextReport } from "../task-next/task-next-ranker.js";
|
|
6
|
+
function compactTaskPacket(p) {
|
|
7
|
+
return {
|
|
8
|
+
task: p.task,
|
|
9
|
+
detectedProfiles: p.detectedProfiles,
|
|
10
|
+
recommendedPipelines: p.recommendedPipelines,
|
|
11
|
+
presetRecommendations: p.presetRecommendations.map((r) => ({
|
|
12
|
+
id: r.preset.id,
|
|
13
|
+
score: r.score,
|
|
14
|
+
confidence: r.confidence,
|
|
15
|
+
})),
|
|
16
|
+
relevantRules: p.relevantRules.map((r) => ({ id: r.id, title: r.title })),
|
|
17
|
+
relevantPaths: p.relevantPaths.map((r) => ({ id: r.id, title: r.title })),
|
|
18
|
+
relevantTemplates: p.relevantTemplates.map((t) => ({ id: t.id, name: t.name })),
|
|
19
|
+
recommendedMcpTools: p.recommendedMcpTools,
|
|
20
|
+
recommendedCliCommands: p.recommendedCliCommands,
|
|
21
|
+
forbiddenActions: p.forbiddenActions,
|
|
22
|
+
verificationCommands: p.verificationCommands,
|
|
23
|
+
humanReviewPoints: p.humanReviewPoints,
|
|
24
|
+
tokenEstimate: p.tokenEstimate,
|
|
25
|
+
contextTokens: p.context.totalTokens,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* DX#1 — Minimal JSON shape for agent / skill consumption.
|
|
30
|
+
*
|
|
31
|
+
* The default `--json` emits the full packet (~18 keys). For planning
|
|
32
|
+
* loops where the agent only reads rules / templates / verification
|
|
33
|
+
* IDs / recommended commands, that's ~75% noise. The compact shape
|
|
34
|
+
* below carries just the load-bearing fields. Agents that want the
|
|
35
|
+
* full packet pass `--json` without `--compact`.
|
|
36
|
+
*
|
|
37
|
+
* The schema marker is intentionally distinct so consumers can tell
|
|
38
|
+
* the two shapes apart at a glance.
|
|
39
|
+
*/
|
|
40
|
+
function minimalTaskPacket(p) {
|
|
41
|
+
return {
|
|
42
|
+
schema: 'sharkcraft.task-packet/v1-compact',
|
|
43
|
+
task: p.task,
|
|
44
|
+
relevantRules: p.relevantRules.map((r) => ({
|
|
45
|
+
id: r.id,
|
|
46
|
+
title: r.title,
|
|
47
|
+
...(r.priority !== undefined ? { priority: r.priority } : {}),
|
|
48
|
+
})),
|
|
49
|
+
relevantTemplates: p.relevantTemplates.map((t) => ({
|
|
50
|
+
id: t.id,
|
|
51
|
+
name: t.name,
|
|
52
|
+
...(t.appliesWhen.length > 0 ? { appliesWhen: t.appliesWhen } : {}),
|
|
53
|
+
})),
|
|
54
|
+
verificationCommands: p.verificationCommands,
|
|
55
|
+
recommendedMcpTools: p.recommendedMcpTools,
|
|
56
|
+
recommendedCliCommands: p.recommendedCliCommands,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export const taskCommand = {
|
|
60
|
+
name: 'task',
|
|
61
|
+
description: 'Build an AI-ready task packet: relevant context, action hints, recommended pipeline, templates, paths, verification commands. Pass `--next` to skip the packet and survey the workspace for the highest-leverage next action.',
|
|
62
|
+
usage: 'shrk [--cwd <dir>] task "<task>" [--max-tokens 4000] [--scope x,y] [--explain-ranking] [--json] [--compact] OR shrk task --next [--json]',
|
|
63
|
+
async run(args) {
|
|
64
|
+
const positional = args.positional;
|
|
65
|
+
// `--next` short-circuits the packet build. Survey doctor / lint /
|
|
66
|
+
// drift / stale, propose ONE highest-leverage action with the runnable
|
|
67
|
+
// command. Pure ranker over existing JSON outputs.
|
|
68
|
+
if (flagBool(args, 'next')) {
|
|
69
|
+
const inspection = await inspectSharkcraft({ cwd: resolveCwd(args) });
|
|
70
|
+
const [doctorRes, staleRes, driftRes] = await Promise.all([
|
|
71
|
+
runDoctor(inspection),
|
|
72
|
+
Promise.resolve(buildKnowledgeStaleReport(inspection)),
|
|
73
|
+
Promise.resolve(buildTemplateDriftReport(inspection, {})),
|
|
74
|
+
]);
|
|
75
|
+
const knowledgeLint = lintKnowledge(inspection.knowledgeEntries, {});
|
|
76
|
+
const categories = {};
|
|
77
|
+
for (const f of knowledgeLint.findings) {
|
|
78
|
+
categories[f.category] = (categories[f.category] ?? 0) + 1;
|
|
79
|
+
}
|
|
80
|
+
// Surface implementing-but-unverified specs to the ranker.
|
|
81
|
+
const specSummaries = buildSpecList(resolveCwd(args)).entries;
|
|
82
|
+
const implementingUnverified = specSummaries
|
|
83
|
+
.filter((s) => s.status === SpecStatus.Implementing && !s.hasVerification)
|
|
84
|
+
.map((s) => ({ id: s.id, title: s.title }));
|
|
85
|
+
const report = buildTaskNextReport({
|
|
86
|
+
doctor: doctorRes,
|
|
87
|
+
stale: staleRes,
|
|
88
|
+
drift: driftRes,
|
|
89
|
+
knowledgeLint: { categories },
|
|
90
|
+
specs: { implementingUnverified },
|
|
91
|
+
});
|
|
92
|
+
if (flagBool(args, 'json')) {
|
|
93
|
+
process.stdout.write(asJson(report) + '\n');
|
|
94
|
+
return 0;
|
|
95
|
+
}
|
|
96
|
+
process.stdout.write(header('Task — next highest-leverage action'));
|
|
97
|
+
if (!report.nextAction) {
|
|
98
|
+
process.stdout.write(' No outstanding work. ✓\n');
|
|
99
|
+
return 0;
|
|
100
|
+
}
|
|
101
|
+
const a = report.nextAction;
|
|
102
|
+
process.stdout.write(` kind: ${a.kind}\n`);
|
|
103
|
+
process.stdout.write(` command: ${a.command}\n`);
|
|
104
|
+
process.stdout.write(` reason: ${a.reason}\n`);
|
|
105
|
+
process.stdout.write(` resolves: ${a.resolves}\n`);
|
|
106
|
+
process.stdout.write(` auto-apply: ${a.autoApplyEligible ? 'yes (mechanically safe)' : 'no (review needed)'}\n`);
|
|
107
|
+
if (report.secondary.length > 0) {
|
|
108
|
+
process.stdout.write('\nThen consider:\n');
|
|
109
|
+
for (const s of report.secondary) {
|
|
110
|
+
process.stdout.write(` • ${s.command} — ${s.reason}\n`);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return 0;
|
|
114
|
+
}
|
|
115
|
+
if (positional[0] === 'decompose') {
|
|
116
|
+
const task = positional.slice(1).join(' ').trim();
|
|
117
|
+
if (!task) {
|
|
118
|
+
process.stderr.write('Usage: shrk task decompose "<task>"\n');
|
|
119
|
+
return 2;
|
|
120
|
+
}
|
|
121
|
+
const inspection = await inspectSharkcraft({ cwd: resolveCwd(args) });
|
|
122
|
+
const d = decomposeTask(inspection, task);
|
|
123
|
+
if (flagBool(args, 'json')) {
|
|
124
|
+
process.stdout.write(asJson(d) + '\n');
|
|
125
|
+
return 0;
|
|
126
|
+
}
|
|
127
|
+
process.stdout.write(header(`Decompose: ${task}`));
|
|
128
|
+
process.stdout.write(kv('verb', d.verb) + '\n');
|
|
129
|
+
process.stdout.write(kv('domain hints', d.domainHints.join(', ') || '(none)') + '\n');
|
|
130
|
+
process.stdout.write('Subtasks:\n');
|
|
131
|
+
for (const s of d.subtasks)
|
|
132
|
+
process.stdout.write(` ${s.id.padEnd(14)} (${s.riskLevel}) ${s.title}\n`);
|
|
133
|
+
process.stdout.write('Templates: ' + d.suggestedTemplateIds.join(', ') + '\n');
|
|
134
|
+
return 0;
|
|
135
|
+
}
|
|
136
|
+
const task = positional.join(' ').trim();
|
|
137
|
+
if (!task) {
|
|
138
|
+
process.stderr.write('Usage: shrk task "<task>"\n');
|
|
139
|
+
return 2;
|
|
140
|
+
}
|
|
141
|
+
const inspection = await inspectSharkcraft({ cwd: resolveCwd(args) });
|
|
142
|
+
const maxTokens = flagNumber(args, 'max-tokens') ?? 3500;
|
|
143
|
+
const scope = flagList(args, 'scope');
|
|
144
|
+
const explainRanking = flagBool(args, 'explain-ranking') || flagBool(args, 'json');
|
|
145
|
+
const packet = buildTaskPacket(inspection, task, {
|
|
146
|
+
maxTokens,
|
|
147
|
+
...(scope.length ? { scope } : {}),
|
|
148
|
+
explainRanking,
|
|
149
|
+
});
|
|
150
|
+
// Uncertainty summary always computed; coverage gaps when requested.
|
|
151
|
+
const uncertainty = buildUncertaintySummary(packet);
|
|
152
|
+
const showCoverageGaps = flagBool(args, 'show-coverage-gaps');
|
|
153
|
+
const coverage = showCoverageGaps
|
|
154
|
+
? await buildScaffoldCoverageReport(inspection, { task })
|
|
155
|
+
: null;
|
|
156
|
+
if (flagBool(args, 'json')) {
|
|
157
|
+
// DX#1 — `--compact` emits a minimal shape for agent / skill
|
|
158
|
+
// consumption (~25% of the bytes). The full shape stays the
|
|
159
|
+
// default so existing consumers don't break.
|
|
160
|
+
if (flagBool(args, 'compact')) {
|
|
161
|
+
process.stdout.write(asJson(minimalTaskPacket(packet)) + '\n');
|
|
162
|
+
return 0;
|
|
163
|
+
}
|
|
164
|
+
process.stdout.write(asJson({
|
|
165
|
+
...compactTaskPacket(packet),
|
|
166
|
+
context: packet.context,
|
|
167
|
+
rankingReasons: packet.rankingReasons ?? null,
|
|
168
|
+
suggestedGen: packet.suggestedGen ?? null,
|
|
169
|
+
uncertainty,
|
|
170
|
+
...(coverage ? { coverage } : {}),
|
|
171
|
+
}) + '\n');
|
|
172
|
+
return 0;
|
|
173
|
+
}
|
|
174
|
+
process.stdout.write(header(`Task packet: ${task}`));
|
|
175
|
+
// Entrypoint banner so the operator sees this is the machine-json class.
|
|
176
|
+
// The banner now carries the canonical-entrypoint pointer; the separate
|
|
177
|
+
// NOTE has been folded into the banner to avoid spamming the output.
|
|
178
|
+
process.stdout.write(`(${entrypointBanner('task')})\n\n`);
|
|
179
|
+
process.stdout.write(kv('detected profiles', packet.detectedProfiles.join(', ') || '(none)') + '\n');
|
|
180
|
+
process.stdout.write(kv('context tokens', `${packet.context.totalTokens} / ${packet.context.maxTokens}`) + '\n');
|
|
181
|
+
process.stdout.write(kv('total token est.', String(packet.tokenEstimate)) + '\n');
|
|
182
|
+
// Commands-first summary at the top so the agent sees the action
|
|
183
|
+
// path before the long context body. `--commands-first` collapses the
|
|
184
|
+
// output to just commands + uncertainty.
|
|
185
|
+
// Text mode defaults to commands-first; pass `--verbose` or
|
|
186
|
+
// `--full` to print the full packet. JSON output is unchanged.
|
|
187
|
+
const commandsFirst = flagBool(args, 'commands-first');
|
|
188
|
+
const actionsOnly = flagBool(args, 'actions-only');
|
|
189
|
+
const verbose = flagBool(args, 'verbose') || flagBool(args, 'full');
|
|
190
|
+
if (packet.recommendedCliCommands.length > 0) {
|
|
191
|
+
process.stdout.write('\nTop commands (command-first):\n');
|
|
192
|
+
for (const c of packet.recommendedCliCommands.slice(0, 5)) {
|
|
193
|
+
process.stdout.write(` $ ${c}\n`);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
if (packet.suggestedGen) {
|
|
197
|
+
process.stdout.write('\nSuggested generation:\n');
|
|
198
|
+
process.stdout.write(` $ ${packet.suggestedGen.dryRunCommand}\n`);
|
|
199
|
+
}
|
|
200
|
+
if (commandsFirst || actionsOnly || !verbose) {
|
|
201
|
+
if (!verbose && !commandsFirst && !actionsOnly) {
|
|
202
|
+
process.stdout.write('\n(text mode is summary-only — pass --verbose for the full packet, --json for machine output.)\n');
|
|
203
|
+
}
|
|
204
|
+
// Render uncertainty and stop — caller asked for action-only output.
|
|
205
|
+
process.stdout.write('\n' + renderUncertaintyText(uncertainty) + '\n');
|
|
206
|
+
return 0;
|
|
207
|
+
}
|
|
208
|
+
if (packet.recommendedPipelines.length) {
|
|
209
|
+
process.stdout.write('\nRecommended pipelines:\n');
|
|
210
|
+
for (const r of packet.recommendedPipelines) {
|
|
211
|
+
process.stdout.write(` • ${r.pipelineId} — ${r.reason}\n`);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
if (packet.presetRecommendations.length) {
|
|
215
|
+
process.stdout.write('\nPreset recommendations (informational):\n');
|
|
216
|
+
for (const r of packet.presetRecommendations) {
|
|
217
|
+
process.stdout.write(` • ${r.preset.id} (confidence=${r.confidence}, score=${r.score})\n`);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
if (packet.relevantRules.length) {
|
|
221
|
+
process.stdout.write('\nRelevant rules:\n');
|
|
222
|
+
for (const r of packet.relevantRules.slice(0, 10)) {
|
|
223
|
+
process.stdout.write(` • ${r.id} ${r.title}\n`);
|
|
224
|
+
}
|
|
225
|
+
if (packet.relevantRules.length > 10) {
|
|
226
|
+
process.stdout.write(` … (${packet.relevantRules.length - 10} more)\n`);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
if (packet.relevantPaths.length) {
|
|
230
|
+
process.stdout.write('\nRelevant paths:\n');
|
|
231
|
+
for (const p of packet.relevantPaths.slice(0, 6)) {
|
|
232
|
+
process.stdout.write(` • ${p.id} ${p.title}\n`);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
if (packet.relevantTemplates.length) {
|
|
236
|
+
process.stdout.write('\nRelevant templates:\n');
|
|
237
|
+
for (const t of packet.relevantTemplates.slice(0, 6)) {
|
|
238
|
+
process.stdout.write(` • ${t.id} ${t.name}\n`);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
if (packet.suggestedGen) {
|
|
242
|
+
process.stdout.write('\nSuggested generation (dry-run first):\n');
|
|
243
|
+
process.stdout.write(` $ ${packet.suggestedGen.dryRunCommand}\n`);
|
|
244
|
+
process.stdout.write(` $ ${packet.suggestedGen.applyCommand}\n`);
|
|
245
|
+
if (packet.suggestedGen.requiredVariables.length) {
|
|
246
|
+
process.stdout.write(` required vars: ${packet.suggestedGen.requiredVariables.join(', ')} — fill in or run \`shrk templates vars ${packet.suggestedGen.templateId}\` first.\n`);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
if (packet.recommendedCliCommands.length) {
|
|
250
|
+
process.stdout.write('\nCLI commands:\n');
|
|
251
|
+
for (const c of packet.recommendedCliCommands)
|
|
252
|
+
process.stdout.write(` $ ${c}\n`);
|
|
253
|
+
}
|
|
254
|
+
if (packet.recommendedMcpTools.length) {
|
|
255
|
+
process.stdout.write('\nMCP tools:\n');
|
|
256
|
+
for (const t of packet.recommendedMcpTools)
|
|
257
|
+
process.stdout.write(` • ${t}\n`);
|
|
258
|
+
}
|
|
259
|
+
if (packet.forbiddenActions.length) {
|
|
260
|
+
process.stdout.write('\nForbidden actions:\n');
|
|
261
|
+
for (const f of packet.forbiddenActions)
|
|
262
|
+
process.stdout.write(` • ${f}\n`);
|
|
263
|
+
}
|
|
264
|
+
if (packet.verificationCommands.length) {
|
|
265
|
+
process.stdout.write('\nVerification commands:\n');
|
|
266
|
+
for (const v of packet.verificationCommands)
|
|
267
|
+
process.stdout.write(` $ ${v}\n`);
|
|
268
|
+
}
|
|
269
|
+
if (packet.humanReviewPoints.length) {
|
|
270
|
+
process.stdout.write('\nHuman-review checkpoints:\n');
|
|
271
|
+
for (const h of packet.humanReviewPoints)
|
|
272
|
+
process.stdout.write(` • ${h}\n`);
|
|
273
|
+
}
|
|
274
|
+
if (packet.rankingReasons && flagBool(args, 'explain-ranking')) {
|
|
275
|
+
process.stdout.write('\nRanking explanations:\n');
|
|
276
|
+
for (const [label, items] of [
|
|
277
|
+
['pipelines', packet.rankingReasons.pipelines],
|
|
278
|
+
['templates', packet.rankingReasons.templates],
|
|
279
|
+
['presets', packet.rankingReasons.presets],
|
|
280
|
+
['rules', packet.rankingReasons.rules],
|
|
281
|
+
['paths', packet.rankingReasons.paths],
|
|
282
|
+
]) {
|
|
283
|
+
if (!items?.length)
|
|
284
|
+
continue;
|
|
285
|
+
process.stdout.write(` ${label}:\n`);
|
|
286
|
+
for (const r of items) {
|
|
287
|
+
process.stdout.write(` [${r.score}] ${r.id} — ${r.reasons.join('; ')}\n`);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
process.stdout.write('\nContext body (token-budgeted):\n');
|
|
292
|
+
process.stdout.write(packet.context.body + '\n');
|
|
293
|
+
// Uncertainty footer.
|
|
294
|
+
process.stdout.write('\n' + renderUncertaintyText(uncertainty) + '\n');
|
|
295
|
+
if (coverage) {
|
|
296
|
+
process.stdout.write('\n');
|
|
297
|
+
process.stdout.write(renderScaffoldCoverageMarkdown(coverage));
|
|
298
|
+
}
|
|
299
|
+
return 0;
|
|
300
|
+
},
|
|
301
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type ICommandHandler } from '../command-registry.js';
|
|
2
|
+
export declare const templatesLintCommand: ICommandHandler;
|
|
3
|
+
export declare const templatesTestCommand: ICommandHandler;
|
|
4
|
+
export declare const templatesSnapshotCommand: ICommandHandler;
|
|
5
|
+
//# sourceMappingURL=template-quality.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template-quality.command.d.ts","sourceRoot":"","sources":["../../src/commands/template-quality.command.ts"],"names":[],"mappings":"AAOA,OAAO,EAIL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAGhC,eAAO,MAAM,oBAAoB,EAAE,eAkClC,CAAC;AAqDF,eAAO,MAAM,oBAAoB,EAAE,eAmBlC,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,eAuBtC,CAAC"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { mkdirSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import * as nodePath from 'node:path';
|
|
3
|
+
import { inspectSharkcraft, lintTemplates, testTemplates, } from '@shrkcrft/inspector';
|
|
4
|
+
import { flagBool, flagString, resolveCwd, } from "../command-registry.js";
|
|
5
|
+
import { asJson, header } from "../output/format-output.js";
|
|
6
|
+
export const templatesLintCommand = {
|
|
7
|
+
name: 'lint',
|
|
8
|
+
description: 'Lint registered templates (titles, vars, target safety, placeholders). --fix-preview emits a TODO patch per finding under .sharkcraft/fixes/templates-lint/ (preview only — never mutates source).',
|
|
9
|
+
usage: 'shrk templates lint [<id>] [--fix-preview] [--json]',
|
|
10
|
+
async run(args) {
|
|
11
|
+
const cwd = resolveCwd(args);
|
|
12
|
+
const inspection = await inspectSharkcraft({ cwd });
|
|
13
|
+
const ids = args.positional.length > 0 ? args.positional : undefined;
|
|
14
|
+
const report = lintTemplates(inspection, ids);
|
|
15
|
+
const fixPreview = flagBool(args, 'fix-preview');
|
|
16
|
+
if (flagBool(args, 'json')) {
|
|
17
|
+
process.stdout.write(asJson(report) + '\n');
|
|
18
|
+
if (fixPreview)
|
|
19
|
+
writeFixPreviewPatches(cwd, report.results);
|
|
20
|
+
return report.summary.errors > 0 ? 1 : 0;
|
|
21
|
+
}
|
|
22
|
+
process.stdout.write(header(`Template lint`));
|
|
23
|
+
for (const r of report.results) {
|
|
24
|
+
const tag = r.passed ? 'OK' : 'FAIL';
|
|
25
|
+
process.stdout.write(` ${tag} ${r.templateId} (${r.issues.length} issues)\n`);
|
|
26
|
+
for (const i of r.issues)
|
|
27
|
+
process.stdout.write(` [${i.severity}] ${i.code}: ${i.message}\n`);
|
|
28
|
+
}
|
|
29
|
+
if (fixPreview) {
|
|
30
|
+
const wrote = writeFixPreviewPatches(cwd, report.results);
|
|
31
|
+
if (wrote > 0) {
|
|
32
|
+
process.stdout.write(`\nWrote ${wrote} fix-preview patch(es) under .sharkcraft/fixes/templates-lint/\n`);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
process.stdout.write('\nNo fix-preview patches needed.\n');
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return report.summary.errors > 0 ? 1 : 0;
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
/** Write a per-template TODO patch under `.sharkcraft/fixes/templates-lint/`. */
|
|
42
|
+
function writeFixPreviewPatches(cwd, results) {
|
|
43
|
+
const dir = nodePath.join(cwd, '.sharkcraft', 'fixes', 'templates-lint');
|
|
44
|
+
let wrote = 0;
|
|
45
|
+
for (const r of results) {
|
|
46
|
+
if (r.passed || r.issues.length === 0)
|
|
47
|
+
continue;
|
|
48
|
+
mkdirSync(dir, { recursive: true });
|
|
49
|
+
const safeId = r.templateId.replace(/[^a-z0-9.-]/gi, '-').toLowerCase();
|
|
50
|
+
const patchPath = nodePath.join(dir, `${safeId}.patch.md`);
|
|
51
|
+
const body = renderLintPatch(r);
|
|
52
|
+
writeFileSync(patchPath, body, 'utf8');
|
|
53
|
+
wrote += 1;
|
|
54
|
+
}
|
|
55
|
+
return wrote;
|
|
56
|
+
}
|
|
57
|
+
function renderLintPatch(r) {
|
|
58
|
+
const lines = [];
|
|
59
|
+
lines.push(`# Template lint fix preview: ${r.templateId}`);
|
|
60
|
+
lines.push('');
|
|
61
|
+
lines.push('Preview-only — this file documents the issues found and the smallest');
|
|
62
|
+
lines.push('change you can apply. SharkCraft never mutates source automatically.');
|
|
63
|
+
lines.push('');
|
|
64
|
+
lines.push('## Issues');
|
|
65
|
+
for (const i of r.issues) {
|
|
66
|
+
lines.push(`- [${i.severity}] **${i.code}** — ${i.message}`);
|
|
67
|
+
}
|
|
68
|
+
lines.push('');
|
|
69
|
+
lines.push('## Suggested actions');
|
|
70
|
+
lines.push('');
|
|
71
|
+
lines.push('1. Update the template definition (id / title / variables / files).');
|
|
72
|
+
lines.push('2. Validate:');
|
|
73
|
+
lines.push(' - `shrk templates lint`');
|
|
74
|
+
lines.push(' - `shrk templates drift --min-severity warning`');
|
|
75
|
+
lines.push(' - `shrk self-config doctor`');
|
|
76
|
+
lines.push('3. If this is a pack-contributed template, also run:');
|
|
77
|
+
lines.push(' - `shrk packs signature-status`');
|
|
78
|
+
lines.push(' - `shrk packs sign --if-needed`');
|
|
79
|
+
lines.push('');
|
|
80
|
+
return lines.join('\n') + '\n';
|
|
81
|
+
}
|
|
82
|
+
export const templatesTestCommand = {
|
|
83
|
+
name: 'test',
|
|
84
|
+
description: 'Render each template against example variables.',
|
|
85
|
+
usage: 'shrk templates test [<id>] [--json]',
|
|
86
|
+
async run(args) {
|
|
87
|
+
const cwd = resolveCwd(args);
|
|
88
|
+
const inspection = await inspectSharkcraft({ cwd });
|
|
89
|
+
const ids = args.positional.length > 0 ? args.positional : undefined;
|
|
90
|
+
const results = testTemplates(inspection, ids);
|
|
91
|
+
if (flagBool(args, 'json')) {
|
|
92
|
+
process.stdout.write(asJson(results) + '\n');
|
|
93
|
+
return results.every((r) => r.passed) ? 0 : 1;
|
|
94
|
+
}
|
|
95
|
+
for (const r of results) {
|
|
96
|
+
process.stdout.write(` ${r.passed ? 'OK' : 'FAIL'} ${r.templateId} renders=${r.renderedChanges} conflicts=${r.conflicts}\n`);
|
|
97
|
+
for (const e of r.errors)
|
|
98
|
+
process.stdout.write(` ! ${e}\n`);
|
|
99
|
+
}
|
|
100
|
+
return results.every((r) => r.passed) ? 0 : 1;
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
export const templatesSnapshotCommand = {
|
|
104
|
+
name: 'snapshot',
|
|
105
|
+
description: 'Print the rendered output of a template.',
|
|
106
|
+
usage: 'shrk templates snapshot <id>',
|
|
107
|
+
async run(args) {
|
|
108
|
+
const id = args.positional[0];
|
|
109
|
+
if (!id) {
|
|
110
|
+
process.stderr.write('Usage: shrk templates snapshot <id>\n');
|
|
111
|
+
return 2;
|
|
112
|
+
}
|
|
113
|
+
const cwd = resolveCwd(args);
|
|
114
|
+
const inspection = await inspectSharkcraft({ cwd });
|
|
115
|
+
const tpl = inspection.templateRegistry.get(id);
|
|
116
|
+
if (!tpl) {
|
|
117
|
+
process.stderr.write(`Unknown template: ${id}\n`);
|
|
118
|
+
return 1;
|
|
119
|
+
}
|
|
120
|
+
const results = testTemplates(inspection, [id]);
|
|
121
|
+
if (flagBool(args, 'json'))
|
|
122
|
+
process.stdout.write(asJson(results[0]) + '\n');
|
|
123
|
+
else
|
|
124
|
+
process.stdout.write(`${id}: renders=${results[0]?.renderedChanges} conflicts=${results[0]?.conflicts}\n`);
|
|
125
|
+
void flagString;
|
|
126
|
+
return 0;
|
|
127
|
+
},
|
|
128
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type ICommandHandler } from '../command-registry.js';
|
|
2
|
+
export declare const templatesVarsCommand: ICommandHandler;
|
|
3
|
+
export declare const templatesListCommand: ICommandHandler;
|
|
4
|
+
export declare const templatesGetCommand: ICommandHandler;
|
|
5
|
+
export declare const templatesSearchCommand: ICommandHandler;
|
|
6
|
+
export declare const templatesPreviewCommand: ICommandHandler;
|
|
7
|
+
export declare const templatesDriftCommand: ICommandHandler;
|
|
8
|
+
export declare const templatesVerifyPathsCommand: ICommandHandler;
|
|
9
|
+
export declare const templatesSmokeCommand: ICommandHandler;
|
|
10
|
+
export declare const templatesScaffoldCommand: ICommandHandler;
|
|
11
|
+
/**
|
|
12
|
+
* `shrk templates add` is an alias of `templates scaffold`.
|
|
13
|
+
*/
|
|
14
|
+
export declare const templatesAddCommand: ICommandHandler;
|
|
15
|
+
/**
|
|
16
|
+
* `shrk templates doctor` aggregates the existing drift + lint
|
|
17
|
+
* signals into one structured report. Read-only.
|
|
18
|
+
*
|
|
19
|
+
* Distinct from `templates lint` (which surfaces test-style findings)
|
|
20
|
+
* and `templates drift` (which compares declared vs. rendered output)
|
|
21
|
+
* by combining them with a clean/dirty verdict + per-template summary.
|
|
22
|
+
*/
|
|
23
|
+
export declare const templatesDoctorCommand: ICommandHandler;
|
|
24
|
+
export declare const templatesUpdateCommand: ICommandHandler;
|
|
25
|
+
export declare const templatesRemoveCommand: ICommandHandler;
|
|
26
|
+
//# sourceMappingURL=templates.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.command.d.ts","sourceRoot":"","sources":["../../src/commands/templates.command.ts"],"names":[],"mappings":"AAyBA,OAAO,EAML,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAKhC,eAAO,MAAM,oBAAoB,EAAE,eA6DlC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,eAmBlC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,eA+CjC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,eAgBpC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,eAiDrC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,eAWnC,CAAC;AAyKF,eAAO,MAAM,2BAA2B,EAAE,eA+BzC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,eAOnC,CAAC;AA2GF,eAAO,MAAM,wBAAwB,EAAE,eA+FtC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,eAKjC,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,EAAE,eAyCpC,CAAC;AAwHF,eAAO,MAAM,sBAAsB,EAAE,eAiKpC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,eAkEpC,CAAC"}
|