@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,6 @@
|
|
|
1
|
+
import { type ICommandHandler } from '../command-registry.js';
|
|
2
|
+
export declare const pathsListCommand: ICommandHandler;
|
|
3
|
+
export declare const pathsGetCommand: ICommandHandler;
|
|
4
|
+
export declare const pathsSearchCommand: ICommandHandler;
|
|
5
|
+
export declare const pathsBestCommand: ICommandHandler;
|
|
6
|
+
//# sourceMappingURL=paths.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.command.d.ts","sourceRoot":"","sources":["../../src/commands/paths.command.ts"],"names":[],"mappings":"AAEA,OAAO,EAML,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAGhC,eAAO,MAAM,gBAAgB,EAAE,eAmB9B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,eAuB7B,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,eAsBhC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,eA0B9B,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { inspectSharkcraft } from '@shrkcrft/inspector';
|
|
2
|
+
import { formatEntryCompact, formatEntryFull } from '@shrkcrft/knowledge';
|
|
3
|
+
import { flagBool, flagNumber, flagString, flagList, resolveCwd, } from "../command-registry.js";
|
|
4
|
+
import { asJson, header } from "../output/format-output.js";
|
|
5
|
+
export const pathsListCommand = {
|
|
6
|
+
name: 'list',
|
|
7
|
+
description: 'List path conventions.',
|
|
8
|
+
usage: 'shrk paths list [--json]',
|
|
9
|
+
async run(args) {
|
|
10
|
+
const inspection = await inspectSharkcraft({ cwd: resolveCwd(args) });
|
|
11
|
+
const paths = inspection.pathService.list();
|
|
12
|
+
if (flagBool(args, 'json')) {
|
|
13
|
+
process.stdout.write(asJson(paths) + '\n');
|
|
14
|
+
return 0;
|
|
15
|
+
}
|
|
16
|
+
process.stdout.write(header(`Path conventions (${paths.length})`));
|
|
17
|
+
for (const p of paths) {
|
|
18
|
+
const target = p.metadata?.path ?? '(unknown)';
|
|
19
|
+
process.stdout.write(` ${p.id.padEnd(30)} → ${target}\n`);
|
|
20
|
+
process.stdout.write(` ${p.title} (priority=${p.priority})\n`);
|
|
21
|
+
}
|
|
22
|
+
return 0;
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
export const pathsGetCommand = {
|
|
26
|
+
name: 'get',
|
|
27
|
+
description: 'Get one path convention.',
|
|
28
|
+
usage: 'shrk paths get <id> [--json]',
|
|
29
|
+
async run(args) {
|
|
30
|
+
const id = args.positional[0];
|
|
31
|
+
if (!id) {
|
|
32
|
+
process.stderr.write('Usage: shrk paths get <id>\n');
|
|
33
|
+
return 2;
|
|
34
|
+
}
|
|
35
|
+
const inspection = await inspectSharkcraft({ cwd: resolveCwd(args) });
|
|
36
|
+
const path = inspection.pathService.get(id);
|
|
37
|
+
if (!path) {
|
|
38
|
+
process.stderr.write(`No path convention with id "${id}".\n`);
|
|
39
|
+
return 1;
|
|
40
|
+
}
|
|
41
|
+
if (flagBool(args, 'json')) {
|
|
42
|
+
process.stdout.write(asJson(path) + '\n');
|
|
43
|
+
return 0;
|
|
44
|
+
}
|
|
45
|
+
process.stdout.write(formatEntryFull(path) + '\n');
|
|
46
|
+
return 0;
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
export const pathsSearchCommand = {
|
|
50
|
+
name: 'search',
|
|
51
|
+
description: 'Search path conventions.',
|
|
52
|
+
usage: 'shrk paths search <query> [--scope x,y] [--limit 10]',
|
|
53
|
+
async run(args) {
|
|
54
|
+
const query = args.positional.join(' ').trim();
|
|
55
|
+
const scope = flagList(args, 'scope');
|
|
56
|
+
const limit = flagNumber(args, 'limit') ?? 10;
|
|
57
|
+
const inspection = await inspectSharkcraft({ cwd: resolveCwd(args) });
|
|
58
|
+
const results = inspection.pathService.search({
|
|
59
|
+
query: query.length ? query : undefined,
|
|
60
|
+
scope: scope.length ? scope : undefined,
|
|
61
|
+
limit,
|
|
62
|
+
});
|
|
63
|
+
if (flagBool(args, 'json')) {
|
|
64
|
+
process.stdout.write(asJson(results) + '\n');
|
|
65
|
+
return 0;
|
|
66
|
+
}
|
|
67
|
+
process.stdout.write(header(`Path conventions (${results.length})`));
|
|
68
|
+
for (const r of results)
|
|
69
|
+
process.stdout.write(formatEntryCompact(r) + '\n');
|
|
70
|
+
return 0;
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
export const pathsBestCommand = {
|
|
74
|
+
name: 'best',
|
|
75
|
+
description: 'Pick the best path for a task.',
|
|
76
|
+
usage: 'shrk paths best --task "<task>"',
|
|
77
|
+
async run(args) {
|
|
78
|
+
const task = flagString(args, 'task');
|
|
79
|
+
if (!task) {
|
|
80
|
+
process.stderr.write('Missing --task\n');
|
|
81
|
+
return 2;
|
|
82
|
+
}
|
|
83
|
+
const inspection = await inspectSharkcraft({ cwd: resolveCwd(args) });
|
|
84
|
+
const selection = inspection.pathService.findBestForTask(task);
|
|
85
|
+
if (!selection) {
|
|
86
|
+
process.stdout.write('No matching path convention.\n');
|
|
87
|
+
return 0;
|
|
88
|
+
}
|
|
89
|
+
if (flagBool(args, 'json')) {
|
|
90
|
+
process.stdout.write(asJson(selection) + '\n');
|
|
91
|
+
return 0;
|
|
92
|
+
}
|
|
93
|
+
process.stdout.write(`Best: ${selection.convention.id} → ${selection.convention.metadata?.path}\n`);
|
|
94
|
+
process.stdout.write(`Reason: ${selection.reason} (score=${selection.score})\n`);
|
|
95
|
+
return 0;
|
|
96
|
+
},
|
|
97
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ICommandHandler } from '../command-registry.js';
|
|
2
|
+
export declare const pipelinesListCommand: ICommandHandler;
|
|
3
|
+
export declare const pipelinesGetCommand: ICommandHandler;
|
|
4
|
+
export declare const pipelinesContextCommand: ICommandHandler;
|
|
5
|
+
export declare const pipelinesPlanCommand: ICommandHandler;
|
|
6
|
+
export declare const pipelinesScriptCommand: ICommandHandler;
|
|
7
|
+
export declare const pipelinesNextCommand: ICommandHandler;
|
|
8
|
+
export declare const pipelinesVarsCommand: ICommandHandler;
|
|
9
|
+
//# sourceMappingURL=pipelines.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipelines.command.d.ts","sourceRoot":"","sources":["../../src/commands/pipelines.command.ts"],"names":[],"mappings":"AAUA,OAAO,EAOL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAGhC,eAAO,MAAM,oBAAoB,EAAE,eA2BlC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,eAuBjC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,eAsDrC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,eA+DlC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,eAoCpC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,eA6ClC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,eAiElC,CAAC"}
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
import { inspectSharkcraft, buildProjectOverview, renderOverviewText } from '@shrkcrft/inspector';
|
|
2
|
+
import { buildContext } from '@shrkcrft/context';
|
|
3
|
+
import { findNextStep, formatPipelineCompact, formatPipelineFull, interpolatePipeline, renderPipelineScript, } from '@shrkcrft/pipelines';
|
|
4
|
+
import { flagBool, flagNumber, flagString, flagList, flagVars, resolveCwd, } from "../command-registry.js";
|
|
5
|
+
import { asJson, header, kv } from "../output/format-output.js";
|
|
6
|
+
export const pipelinesListCommand = {
|
|
7
|
+
name: 'list',
|
|
8
|
+
description: 'List available pipelines.',
|
|
9
|
+
usage: 'shrk pipelines list [--json]',
|
|
10
|
+
async run(args) {
|
|
11
|
+
const inspection = await inspectSharkcraft({ cwd: resolveCwd(args) });
|
|
12
|
+
const list = inspection.pipelineRegistry.list();
|
|
13
|
+
if (flagBool(args, 'json')) {
|
|
14
|
+
process.stdout.write(asJson(list.map((p) => ({
|
|
15
|
+
id: p.id,
|
|
16
|
+
title: p.title,
|
|
17
|
+
description: p.description,
|
|
18
|
+
tags: p.tags ?? [],
|
|
19
|
+
scope: p.scope ?? [],
|
|
20
|
+
appliesWhen: p.appliesWhen ?? [],
|
|
21
|
+
stepCount: p.steps.length,
|
|
22
|
+
}))) + '\n');
|
|
23
|
+
return 0;
|
|
24
|
+
}
|
|
25
|
+
process.stdout.write(header(`Pipelines (${list.length})`));
|
|
26
|
+
for (const p of list)
|
|
27
|
+
process.stdout.write(formatPipelineCompact(p) + '\n');
|
|
28
|
+
return 0;
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
export const pipelinesGetCommand = {
|
|
32
|
+
name: 'get',
|
|
33
|
+
description: 'Show one pipeline by id.',
|
|
34
|
+
usage: 'shrk pipelines get <id> [--json]',
|
|
35
|
+
async run(args) {
|
|
36
|
+
const id = args.positional[0];
|
|
37
|
+
if (!id) {
|
|
38
|
+
process.stderr.write('Usage: shrk pipelines get <id>\n');
|
|
39
|
+
return 2;
|
|
40
|
+
}
|
|
41
|
+
const inspection = await inspectSharkcraft({ cwd: resolveCwd(args) });
|
|
42
|
+
const pipeline = inspection.pipelineRegistry.get(id);
|
|
43
|
+
if (!pipeline) {
|
|
44
|
+
process.stderr.write(`No pipeline with id "${id}".\n`);
|
|
45
|
+
return 1;
|
|
46
|
+
}
|
|
47
|
+
if (flagBool(args, 'json')) {
|
|
48
|
+
process.stdout.write(asJson(pipeline) + '\n');
|
|
49
|
+
return 0;
|
|
50
|
+
}
|
|
51
|
+
process.stdout.write(formatPipelineFull(pipeline) + '\n');
|
|
52
|
+
return 0;
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
export const pipelinesContextCommand = {
|
|
56
|
+
name: 'context',
|
|
57
|
+
description: 'Combine a pipeline with a task-specific context. Returns the pipeline + relevant rules/paths/templates for the task.',
|
|
58
|
+
usage: 'shrk pipelines context <id> --task "<task>" [--max-tokens 3000] [--json]',
|
|
59
|
+
async run(args) {
|
|
60
|
+
const id = args.positional[0];
|
|
61
|
+
if (!id) {
|
|
62
|
+
process.stderr.write('Usage: shrk pipelines context <id> --task "<task>"\n');
|
|
63
|
+
return 2;
|
|
64
|
+
}
|
|
65
|
+
const task = flagString(args, 'task');
|
|
66
|
+
if (!task) {
|
|
67
|
+
process.stderr.write('Missing --task\n');
|
|
68
|
+
return 2;
|
|
69
|
+
}
|
|
70
|
+
const maxTokens = flagNumber(args, 'max-tokens') ?? flagNumber(args, 'maxTokens') ?? 3000;
|
|
71
|
+
const scope = flagList(args, 'scope');
|
|
72
|
+
const inspection = await inspectSharkcraft({ cwd: resolveCwd(args) });
|
|
73
|
+
const pipeline = inspection.pipelineRegistry.get(id);
|
|
74
|
+
if (!pipeline) {
|
|
75
|
+
process.stderr.write(`No pipeline with id "${id}".\n`);
|
|
76
|
+
return 1;
|
|
77
|
+
}
|
|
78
|
+
const overview = buildProjectOverview(inspection.workspace, inspection.config?.projectName);
|
|
79
|
+
const ctxResult = buildContext(inspection.knowledgeEntries, {
|
|
80
|
+
task,
|
|
81
|
+
scope,
|
|
82
|
+
maxTokens,
|
|
83
|
+
projectOverview: renderOverviewText(overview),
|
|
84
|
+
});
|
|
85
|
+
if (flagBool(args, 'json')) {
|
|
86
|
+
process.stdout.write(asJson({
|
|
87
|
+
pipeline,
|
|
88
|
+
context: ctxResult,
|
|
89
|
+
}) + '\n');
|
|
90
|
+
return 0;
|
|
91
|
+
}
|
|
92
|
+
process.stdout.write(header(`Pipeline + context: ${pipeline.id}`));
|
|
93
|
+
process.stdout.write(formatPipelineFull(pipeline) + '\n');
|
|
94
|
+
process.stdout.write('\n');
|
|
95
|
+
process.stdout.write(header(`Task context: ${task}`));
|
|
96
|
+
process.stdout.write(`tokens ≈ ${ctxResult.totalTokens} / ${ctxResult.maxTokens}, sections: ${ctxResult.sections.length}\n\n`);
|
|
97
|
+
process.stdout.write(ctxResult.body + '\n');
|
|
98
|
+
return 0;
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
export const pipelinesPlanCommand = {
|
|
102
|
+
name: 'plan',
|
|
103
|
+
description: 'Describe what running the pipeline would do for the given task. Does not execute anything.',
|
|
104
|
+
usage: 'shrk pipelines plan <id> --task "<task>" [--json]',
|
|
105
|
+
async run(args) {
|
|
106
|
+
const id = args.positional[0];
|
|
107
|
+
if (!id) {
|
|
108
|
+
process.stderr.write('Usage: shrk pipelines plan <id> --task "<task>"\n');
|
|
109
|
+
return 2;
|
|
110
|
+
}
|
|
111
|
+
const task = flagString(args, 'task') ?? '<task>';
|
|
112
|
+
const inspection = await inspectSharkcraft({ cwd: resolveCwd(args) });
|
|
113
|
+
const pipeline = inspection.pipelineRegistry.get(id);
|
|
114
|
+
if (!pipeline) {
|
|
115
|
+
process.stderr.write(`No pipeline with id "${id}".\n`);
|
|
116
|
+
return 1;
|
|
117
|
+
}
|
|
118
|
+
const interpolated = pipeline.steps.map((step) => ({
|
|
119
|
+
id: step.id,
|
|
120
|
+
type: step.type,
|
|
121
|
+
description: step.description,
|
|
122
|
+
required: step.required !== false,
|
|
123
|
+
humanReview: step.humanReview === true,
|
|
124
|
+
enabledWhen: step.enabledWhen,
|
|
125
|
+
instruction: step.instruction
|
|
126
|
+
? step.instruction.replace(/<task>/g, task)
|
|
127
|
+
: undefined,
|
|
128
|
+
mcpTools: step.mcpTools ?? [],
|
|
129
|
+
cliCommands: (step.cliCommands ?? []).map((c) => c.replace(/<task>/g, task)),
|
|
130
|
+
references: step.references ?? [],
|
|
131
|
+
}));
|
|
132
|
+
if (flagBool(args, 'json')) {
|
|
133
|
+
process.stdout.write(asJson({
|
|
134
|
+
pipeline: { id: pipeline.id, title: pipeline.title, description: pipeline.description },
|
|
135
|
+
task,
|
|
136
|
+
steps: interpolated,
|
|
137
|
+
}) + '\n');
|
|
138
|
+
return 0;
|
|
139
|
+
}
|
|
140
|
+
process.stdout.write(header(`Plan: ${pipeline.title} (task: ${task})`));
|
|
141
|
+
for (let i = 0; i < interpolated.length; i += 1) {
|
|
142
|
+
const step = interpolated[i];
|
|
143
|
+
const req = step.required ? '' : ' (optional)';
|
|
144
|
+
const review = step.humanReview ? ' — human review' : '';
|
|
145
|
+
const when = step.enabledWhen ? ` — when ${step.enabledWhen}` : '';
|
|
146
|
+
process.stdout.write(`\n${i + 1}. [${step.type}] ${step.id}${req}${review}${when}\n`);
|
|
147
|
+
if (step.description)
|
|
148
|
+
process.stdout.write(` ${step.description}\n`);
|
|
149
|
+
if (step.instruction)
|
|
150
|
+
process.stdout.write(` instruction: ${step.instruction}\n`);
|
|
151
|
+
if (step.mcpTools.length)
|
|
152
|
+
process.stdout.write(` mcpTools: ${step.mcpTools.join(', ')}\n`);
|
|
153
|
+
for (const c of step.cliCommands)
|
|
154
|
+
process.stdout.write(` $ ${c}\n`);
|
|
155
|
+
if (step.references.length) {
|
|
156
|
+
process.stdout.write(` references: ${step.references.join(', ')}\n`);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
process.stdout.write('\n');
|
|
160
|
+
return 0;
|
|
161
|
+
},
|
|
162
|
+
};
|
|
163
|
+
export const pipelinesScriptCommand = {
|
|
164
|
+
name: 'script',
|
|
165
|
+
description: 'Render a copy-pasteable shell script for the pipeline. apply/write steps include a manual-confirm prompt.',
|
|
166
|
+
usage: 'shrk pipelines script <id> --task "<task>" [--var key=value ...] [--include-optional <stepId>] [--json]',
|
|
167
|
+
async run(args) {
|
|
168
|
+
const id = args.positional[0];
|
|
169
|
+
if (!id) {
|
|
170
|
+
process.stderr.write('Usage: shrk pipelines script <id> --task "<task>"\n');
|
|
171
|
+
return 2;
|
|
172
|
+
}
|
|
173
|
+
const task = flagString(args, 'task') ?? '<task>';
|
|
174
|
+
const inputs = flagVars(args);
|
|
175
|
+
const includeOptionalList = flagList(args, 'include-optional');
|
|
176
|
+
const inspection = await inspectSharkcraft({ cwd: resolveCwd(args) });
|
|
177
|
+
const pipeline = inspection.pipelineRegistry.get(id);
|
|
178
|
+
if (!pipeline) {
|
|
179
|
+
process.stderr.write(`No pipeline with id "${id}".\n`);
|
|
180
|
+
return 1;
|
|
181
|
+
}
|
|
182
|
+
const interp = interpolatePipeline(pipeline, {
|
|
183
|
+
task,
|
|
184
|
+
projectRoot: inspection.projectRoot,
|
|
185
|
+
inputs,
|
|
186
|
+
includeOptional: includeOptionalList,
|
|
187
|
+
});
|
|
188
|
+
const script = renderPipelineScript(interp);
|
|
189
|
+
if (flagBool(args, 'json')) {
|
|
190
|
+
process.stdout.write(asJson({ pipelineId: pipeline.id, task, script }) + '\n');
|
|
191
|
+
return 0;
|
|
192
|
+
}
|
|
193
|
+
process.stdout.write(script + '\n');
|
|
194
|
+
return 0;
|
|
195
|
+
},
|
|
196
|
+
};
|
|
197
|
+
export const pipelinesNextCommand = {
|
|
198
|
+
name: 'next',
|
|
199
|
+
description: 'Return the next non-skipped step in the pipeline. Useful for "what should I do now?".',
|
|
200
|
+
usage: 'shrk pipelines next <id> --task "<task>" [--var key=value ...] [--include-optional <stepId>] [--json]',
|
|
201
|
+
async run(args) {
|
|
202
|
+
const id = args.positional[0];
|
|
203
|
+
if (!id) {
|
|
204
|
+
process.stderr.write('Usage: shrk pipelines next <id> --task "<task>"\n');
|
|
205
|
+
return 2;
|
|
206
|
+
}
|
|
207
|
+
const task = flagString(args, 'task') ?? '<task>';
|
|
208
|
+
const inputs = flagVars(args);
|
|
209
|
+
const includeOptionalList = flagList(args, 'include-optional');
|
|
210
|
+
const inspection = await inspectSharkcraft({ cwd: resolveCwd(args) });
|
|
211
|
+
const pipeline = inspection.pipelineRegistry.get(id);
|
|
212
|
+
if (!pipeline) {
|
|
213
|
+
process.stderr.write(`No pipeline with id "${id}".\n`);
|
|
214
|
+
return 1;
|
|
215
|
+
}
|
|
216
|
+
const interp = interpolatePipeline(pipeline, {
|
|
217
|
+
task,
|
|
218
|
+
projectRoot: inspection.projectRoot,
|
|
219
|
+
inputs,
|
|
220
|
+
includeOptional: includeOptionalList,
|
|
221
|
+
});
|
|
222
|
+
const next = findNextStep(interp);
|
|
223
|
+
if (!next) {
|
|
224
|
+
if (flagBool(args, 'json'))
|
|
225
|
+
process.stdout.write('null\n');
|
|
226
|
+
else
|
|
227
|
+
process.stdout.write('(no remaining steps)\n');
|
|
228
|
+
return 0;
|
|
229
|
+
}
|
|
230
|
+
if (flagBool(args, 'json')) {
|
|
231
|
+
process.stdout.write(asJson(next) + '\n');
|
|
232
|
+
return 0;
|
|
233
|
+
}
|
|
234
|
+
process.stdout.write(`Next step: [${next.type}] ${next.id}${next.humanReview ? ' — HUMAN REVIEW' : ''}\n`);
|
|
235
|
+
if (next.description)
|
|
236
|
+
process.stdout.write(` ${next.description}\n`);
|
|
237
|
+
if (next.instruction)
|
|
238
|
+
process.stdout.write(` instruction: ${next.instruction}\n`);
|
|
239
|
+
if (next.mcpTools.length)
|
|
240
|
+
process.stdout.write(` mcpTools: ${next.mcpTools.join(', ')}\n`);
|
|
241
|
+
for (const c of next.cliCommands)
|
|
242
|
+
process.stdout.write(` $ ${c}\n`);
|
|
243
|
+
return 0;
|
|
244
|
+
},
|
|
245
|
+
};
|
|
246
|
+
export const pipelinesVarsCommand = {
|
|
247
|
+
name: 'vars',
|
|
248
|
+
description: 'Show the inputs a pipeline accepts (required/optional/defaults) plus optional steps.',
|
|
249
|
+
usage: 'shrk [--cwd <dir>] pipelines vars <pipelineId> [--json]',
|
|
250
|
+
async run(args) {
|
|
251
|
+
const id = args.positional[0];
|
|
252
|
+
if (!id) {
|
|
253
|
+
process.stderr.write('Usage: shrk pipelines vars <pipelineId>\n');
|
|
254
|
+
return 2;
|
|
255
|
+
}
|
|
256
|
+
const inspection = await inspectSharkcraft({ cwd: resolveCwd(args) });
|
|
257
|
+
const pipeline = inspection.pipelineRegistry.get(id);
|
|
258
|
+
if (!pipeline) {
|
|
259
|
+
process.stderr.write(`No pipeline with id "${id}".\n`);
|
|
260
|
+
return 1;
|
|
261
|
+
}
|
|
262
|
+
const optionalSteps = (pipeline.steps ?? []).filter((s) => s.required === false);
|
|
263
|
+
if (flagBool(args, 'json')) {
|
|
264
|
+
process.stdout.write(asJson({
|
|
265
|
+
id: pipeline.id,
|
|
266
|
+
title: pipeline.title,
|
|
267
|
+
inputs: pipeline.inputs?.map((v) => ({
|
|
268
|
+
name: v.name,
|
|
269
|
+
required: v.required ?? false,
|
|
270
|
+
description: v.description ?? '',
|
|
271
|
+
default: v.default,
|
|
272
|
+
choices: v.choices ?? [],
|
|
273
|
+
})) ?? [],
|
|
274
|
+
optionalSteps: optionalSteps.map((s) => ({ id: s.id, description: s.description })),
|
|
275
|
+
}) + '\n');
|
|
276
|
+
return 0;
|
|
277
|
+
}
|
|
278
|
+
process.stdout.write(header(`Pipeline inputs: ${pipeline.id}`));
|
|
279
|
+
process.stdout.write(kv('title', pipeline.title) + '\n');
|
|
280
|
+
process.stdout.write(kv('description', pipeline.description ?? '') + '\n\n');
|
|
281
|
+
const inputs = pipeline.inputs ?? [];
|
|
282
|
+
if (inputs.length === 0) {
|
|
283
|
+
process.stdout.write('(no inputs)\n');
|
|
284
|
+
}
|
|
285
|
+
for (const v of inputs) {
|
|
286
|
+
const tag = v.required ? '*required' : ' optional';
|
|
287
|
+
process.stdout.write(` ${tag} ${v.name}\n`);
|
|
288
|
+
if (v.description)
|
|
289
|
+
process.stdout.write(` ${v.description}\n`);
|
|
290
|
+
if (v.default)
|
|
291
|
+
process.stdout.write(` default: ${v.default}\n`);
|
|
292
|
+
if (v.choices?.length) {
|
|
293
|
+
process.stdout.write(` choices: ${v.choices.join(', ')}\n`);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
if (optionalSteps.length) {
|
|
297
|
+
process.stdout.write('\nOptional steps (include with --include-optional):\n');
|
|
298
|
+
for (const s of optionalSteps) {
|
|
299
|
+
process.stdout.write(` ${s.id}\n`);
|
|
300
|
+
if (s.description)
|
|
301
|
+
process.stdout.write(` ${s.description}\n`);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
const sampleVars = inputs.map((v) => `--var ${v.name}=${v.default ?? '<value>'}`).join(' ');
|
|
305
|
+
process.stdout.write(`\nExample:\n $ shrk pipelines script ${pipeline.id} --task "<task>" ${sampleVars}\n`);
|
|
306
|
+
return 0;
|
|
307
|
+
},
|
|
308
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `shrk plan check <path>` — validate ANY external plan/spec file
|
|
3
|
+
* against the live workspace. Read-only; never modifies the input
|
|
4
|
+
* file.
|
|
5
|
+
*
|
|
6
|
+
* Two built-in extractors:
|
|
7
|
+
* - `sharkcraft.spec/v1` (spec.md format)
|
|
8
|
+
* - `markdown-frontmatter-loose` (any YAML frontmatter; --field-map remaps)
|
|
9
|
+
*/
|
|
10
|
+
import { type ISpecValidationIssue } from '@shrkcrft/generator';
|
|
11
|
+
import { type ICommandHandler } from '../command-registry.js';
|
|
12
|
+
export declare const PLAN_CHECK_SCHEMA = "sharkcraft.plan-check/v1";
|
|
13
|
+
export interface IPlanCheckReport {
|
|
14
|
+
readonly schema: typeof PLAN_CHECK_SCHEMA;
|
|
15
|
+
readonly source: string;
|
|
16
|
+
readonly extractorId: string;
|
|
17
|
+
readonly verdict: 'pass' | 'warn' | 'fail';
|
|
18
|
+
readonly errors: readonly ISpecValidationIssue[];
|
|
19
|
+
readonly warnings: readonly ISpecValidationIssue[];
|
|
20
|
+
readonly nx?: {
|
|
21
|
+
readonly enabled: boolean;
|
|
22
|
+
readonly affectedProjects?: readonly string[];
|
|
23
|
+
readonly note?: string;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export declare const planCheckCommand: ICommandHandler;
|
|
27
|
+
//# sourceMappingURL=plan-check.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan-check.command.d.ts","sourceRoot":"","sources":["../../src/commands/plan-check.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAML,KAAK,oBAAoB,EAC1B,MAAM,qBAAqB,CAAC;AAO7B,OAAO,EAIL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAGhC,eAAO,MAAM,iBAAiB,6BAA6B,CAAC;AAE5D,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,MAAM,EAAE,OAAO,iBAAiB,CAAC;IAC1C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IAC3C,QAAQ,CAAC,MAAM,EAAE,SAAS,oBAAoB,EAAE,CAAC;IACjD,QAAQ,CAAC,QAAQ,EAAE,SAAS,oBAAoB,EAAE,CAAC;IACnD,QAAQ,CAAC,EAAE,CAAC,EAAE;QACZ,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;QAC1B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;QAC9C,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;CACH;AAED,eAAO,MAAM,gBAAgB,EAAE,eAyE9B,CAAC"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `shrk plan check <path>` — validate ANY external plan/spec file
|
|
3
|
+
* against the live workspace. Read-only; never modifies the input
|
|
4
|
+
* file.
|
|
5
|
+
*
|
|
6
|
+
* Two built-in extractors:
|
|
7
|
+
* - `sharkcraft.spec/v1` (spec.md format)
|
|
8
|
+
* - `markdown-frontmatter-loose` (any YAML frontmatter; --field-map remaps)
|
|
9
|
+
*/
|
|
10
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
11
|
+
import * as nodePath from 'node:path';
|
|
12
|
+
import { getExtractorById, pickExtractor, } from '@shrkcrft/generator';
|
|
13
|
+
import { inspectSharkcraft, loadNxProjects, mapFilesToProjects, validateExtractedPlan, } from '@shrkcrft/inspector';
|
|
14
|
+
import { flagBool, flagString, resolveCwd, } from "../command-registry.js";
|
|
15
|
+
import { asJson, header } from "../output/format-output.js";
|
|
16
|
+
export const PLAN_CHECK_SCHEMA = 'sharkcraft.plan-check/v1';
|
|
17
|
+
export const planCheckCommand = {
|
|
18
|
+
name: 'check',
|
|
19
|
+
description: 'Validate an external plan/spec file against the live workspace. Read-only — the input file is never modified. Supports two built-in extractors and an optional --field-map.',
|
|
20
|
+
usage: 'shrk plan check <path> [--extractor sharkcraft.spec/v1|markdown-frontmatter-loose] [--field-map <json>] [--json] [--strict]',
|
|
21
|
+
async run(args) {
|
|
22
|
+
const path = args.positional[0];
|
|
23
|
+
if (!path) {
|
|
24
|
+
process.stderr.write('Usage: shrk plan check <path> [--extractor <id>] [--field-map <json>]\n');
|
|
25
|
+
return 2;
|
|
26
|
+
}
|
|
27
|
+
const cwd = resolveCwd(args);
|
|
28
|
+
const absPath = nodePath.isAbsolute(path) ? path : nodePath.resolve(cwd, path);
|
|
29
|
+
if (!existsSync(absPath)) {
|
|
30
|
+
process.stderr.write(`Plan file not found: ${absPath}\n`);
|
|
31
|
+
return 1;
|
|
32
|
+
}
|
|
33
|
+
const extractor = pickExtractorFromFlag(args, absPath);
|
|
34
|
+
if (!extractor) {
|
|
35
|
+
process.stderr.write(`Refusing: no extractor accepts "${path}". Pass --extractor sharkcraft.spec/v1 | markdown-frontmatter-loose.\n`);
|
|
36
|
+
return 1;
|
|
37
|
+
}
|
|
38
|
+
const fieldMap = parseFieldMap(flagString(args, 'field-map'));
|
|
39
|
+
if (fieldMap === 'invalid') {
|
|
40
|
+
process.stderr.write('Refusing: --field-map must be valid JSON of shape {"externalKey":"canonicalKey",...}.\n');
|
|
41
|
+
return 1;
|
|
42
|
+
}
|
|
43
|
+
const raw = readFileSync(absPath, 'utf8');
|
|
44
|
+
const extracted = extractor.extract(raw, {
|
|
45
|
+
source: nodePath.relative(cwd, absPath) || absPath,
|
|
46
|
+
...(fieldMap ? { fieldMap } : {}),
|
|
47
|
+
});
|
|
48
|
+
if (!extracted.ok) {
|
|
49
|
+
process.stderr.write(`Extractor "${extractor.id}" refused: ${extracted.error.message}\n`);
|
|
50
|
+
return 1;
|
|
51
|
+
}
|
|
52
|
+
const inspection = await inspectSharkcraft({ cwd });
|
|
53
|
+
const validation = validateExtractedPlan(extracted.value, inspection);
|
|
54
|
+
const verdict = validation.errors.length > 0
|
|
55
|
+
? 'fail'
|
|
56
|
+
: validation.warnings.length > 0
|
|
57
|
+
? 'warn'
|
|
58
|
+
: 'pass';
|
|
59
|
+
const nxReport = buildNxReport(cwd, extracted.value);
|
|
60
|
+
const report = {
|
|
61
|
+
schema: PLAN_CHECK_SCHEMA,
|
|
62
|
+
source: extracted.value.source,
|
|
63
|
+
extractorId: extractor.id,
|
|
64
|
+
verdict,
|
|
65
|
+
errors: validation.errors,
|
|
66
|
+
warnings: validation.warnings,
|
|
67
|
+
...(nxReport ? { nx: nxReport } : {}),
|
|
68
|
+
};
|
|
69
|
+
if (flagBool(args, 'json')) {
|
|
70
|
+
process.stdout.write(asJson(report) + '\n');
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
renderHuman(report);
|
|
74
|
+
}
|
|
75
|
+
if (verdict === 'fail')
|
|
76
|
+
return 1;
|
|
77
|
+
if (verdict === 'warn' && flagBool(args, 'strict'))
|
|
78
|
+
return 1;
|
|
79
|
+
return 0;
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
function pickExtractorFromFlag(args, absPath) {
|
|
83
|
+
const explicit = flagString(args, 'extractor');
|
|
84
|
+
if (explicit)
|
|
85
|
+
return getExtractorById(explicit);
|
|
86
|
+
return pickExtractor(absPath);
|
|
87
|
+
}
|
|
88
|
+
function parseFieldMap(raw) {
|
|
89
|
+
if (!raw)
|
|
90
|
+
return null;
|
|
91
|
+
try {
|
|
92
|
+
const parsed = JSON.parse(raw);
|
|
93
|
+
if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed))
|
|
94
|
+
return 'invalid';
|
|
95
|
+
const out = {};
|
|
96
|
+
for (const [k, v] of Object.entries(parsed)) {
|
|
97
|
+
if (typeof v !== 'string')
|
|
98
|
+
return 'invalid';
|
|
99
|
+
out[k] = v;
|
|
100
|
+
}
|
|
101
|
+
return out;
|
|
102
|
+
}
|
|
103
|
+
catch {
|
|
104
|
+
return 'invalid';
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
function buildNxReport(cwd, extracted) {
|
|
108
|
+
const graph = loadNxProjects(cwd);
|
|
109
|
+
if (!graph)
|
|
110
|
+
return undefined;
|
|
111
|
+
const files = extracted.affectedFiles ?? [];
|
|
112
|
+
if (files.length === 0) {
|
|
113
|
+
return { enabled: true, note: 'no affectedFiles declared — skipping project mapping' };
|
|
114
|
+
}
|
|
115
|
+
const projects = mapFilesToProjects(files, graph);
|
|
116
|
+
return {
|
|
117
|
+
enabled: true,
|
|
118
|
+
affectedProjects: projects,
|
|
119
|
+
...(projects.length > 1
|
|
120
|
+
? { note: `plan touches ${projects.length} projects: ${projects.join(', ')}` }
|
|
121
|
+
: {}),
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
function renderHuman(report) {
|
|
125
|
+
process.stdout.write(header(`Plan check: ${report.source}`));
|
|
126
|
+
process.stdout.write(` extractor: ${report.extractorId}\n`);
|
|
127
|
+
process.stdout.write(` verdict: ${report.verdict.toUpperCase()}\n`);
|
|
128
|
+
process.stdout.write(` errors: ${report.errors.length}\n`);
|
|
129
|
+
process.stdout.write(` warnings: ${report.warnings.length}\n`);
|
|
130
|
+
if (report.nx) {
|
|
131
|
+
if (report.nx.affectedProjects) {
|
|
132
|
+
process.stdout.write(` nx projects: ${report.nx.affectedProjects.join(', ') || '(none)'}\n`);
|
|
133
|
+
}
|
|
134
|
+
else if (report.nx.note) {
|
|
135
|
+
process.stdout.write(` nx: ${report.nx.note}\n`);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
if (report.errors.length > 0) {
|
|
139
|
+
process.stdout.write('\nErrors:\n');
|
|
140
|
+
for (const e of report.errors) {
|
|
141
|
+
process.stdout.write(` [${e.code}] ${e.field}: ${e.message}\n`);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
if (report.warnings.length > 0) {
|
|
145
|
+
process.stdout.write('\nWarnings:\n');
|
|
146
|
+
for (const w of report.warnings) {
|
|
147
|
+
process.stdout.write(` [${w.code}] ${w.field}: ${w.message}\n`);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan-simulate.command.d.ts","sourceRoot":"","sources":["../../src/commands/plan-simulate.command.ts"],"names":[],"mappings":"AASA,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAGhC,eAAO,MAAM,mBAAmB,EAAE,eAsDjC,CAAC"}
|