@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,127 @@
|
|
|
1
|
+
import { header } from "../output/format-output.js";
|
|
2
|
+
/**
|
|
3
|
+
* Short product start screen for bare `shrk` / `shrk --help`. Pruned
|
|
4
|
+
* to the core tier set; extended verbs live one link away via
|
|
5
|
+
* `shrk surface list`.
|
|
6
|
+
*
|
|
7
|
+
* Returns the lines (without trailing newline). Pulled into a function
|
|
8
|
+
* so tests can assert on the structure without grepping stdout.
|
|
9
|
+
*/
|
|
10
|
+
export function renderStartScreen() {
|
|
11
|
+
const lines = [];
|
|
12
|
+
lines.push('SharkCraft CLI — deterministic, local-first project intelligence for AI coding agents.');
|
|
13
|
+
lines.push('Usage: shrk [--cwd <dir>] <command> [...args]');
|
|
14
|
+
lines.push('');
|
|
15
|
+
lines.push('Core (always on):');
|
|
16
|
+
lines.push(' $ shrk recommend "<task>" — what should I do?');
|
|
17
|
+
lines.push(' $ shrk doctor — is the workspace healthy?');
|
|
18
|
+
lines.push(' $ shrk context --task "<task>" — focused context for a task');
|
|
19
|
+
lines.push(' $ shrk init — create sharkcraft/ + config skeleton');
|
|
20
|
+
lines.push(' $ shrk check boundaries — boundary enforcement');
|
|
21
|
+
lines.push(' $ shrk surface list — every command grouped by tier');
|
|
22
|
+
lines.push('');
|
|
23
|
+
lines.push('Discover the rest (extended tier — always callable):');
|
|
24
|
+
lines.push(' $ shrk surface list — full surface, grouped by tier and profile');
|
|
25
|
+
lines.push(' $ shrk surface profiles — named profiles (small-app / monorepo / ci / agent / pack-author)');
|
|
26
|
+
lines.push(' $ shrk surface explain <cmd> — why a command has its current tier');
|
|
27
|
+
lines.push(' $ shrk help <command> — usage for a specific command');
|
|
28
|
+
lines.push(' $ shrk --full-help — the long, exhaustive help');
|
|
29
|
+
lines.push(' $ shrk --about — what shrk is and is not');
|
|
30
|
+
lines.push('');
|
|
31
|
+
lines.push('Free-form input is fine — `shrk "<task>"` routes to `shrk recommend`.');
|
|
32
|
+
return lines.join('\n') + '\n';
|
|
33
|
+
}
|
|
34
|
+
export function makeHelpCommand(registry) {
|
|
35
|
+
return {
|
|
36
|
+
name: 'help',
|
|
37
|
+
description: 'Show CLI help. Bare `shrk help` prints a short start screen — pass `--full` for the long catalog.',
|
|
38
|
+
usage: 'shrk help [<command>] [--full]',
|
|
39
|
+
run(args) {
|
|
40
|
+
const requested = args.positional[0];
|
|
41
|
+
const wantsFull = args.flags.get('full') === true ||
|
|
42
|
+
args.flags.get('verbose') === true ||
|
|
43
|
+
args.flags.get('full-help') === true;
|
|
44
|
+
if (requested) {
|
|
45
|
+
// Multi-segment help. `shrk help "pack author"` or
|
|
46
|
+
// positional args ["pack", "author"] resolve through the trie.
|
|
47
|
+
const tokens = args.positional[0]?.includes(' ')
|
|
48
|
+
? args.positional[0].split(/\s+/).filter(Boolean)
|
|
49
|
+
: args.positional.filter(Boolean);
|
|
50
|
+
const { handler, matchedPath, node } = registry.resolve(tokens);
|
|
51
|
+
if (handler && matchedPath.join(' ') === tokens.join(' ')) {
|
|
52
|
+
// Exact match on a callable command.
|
|
53
|
+
const canonical = registry.listCommandAliases().get(tokens[0]);
|
|
54
|
+
process.stdout.write(`${matchedPath.join(' ')} — ${handler.description}\n${handler.usage}\n`);
|
|
55
|
+
if (canonical && tokens.length === 1) {
|
|
56
|
+
process.stdout.write(`(alias for: ${canonical})\n`);
|
|
57
|
+
}
|
|
58
|
+
return 0;
|
|
59
|
+
}
|
|
60
|
+
if (node.children.size > 0) {
|
|
61
|
+
// It's a group (with or without its own handler). List children.
|
|
62
|
+
const aliasNote = matchedPath.length === 1 && registry.listGroupAliases().get(tokens[0]) !== undefined
|
|
63
|
+
? ` (alias for: ${registry.listGroupAliases().get(tokens[0])})`
|
|
64
|
+
: '';
|
|
65
|
+
const groupLabel = matchedPath.length > 0 ? matchedPath.join(' ') : tokens.join(' ');
|
|
66
|
+
process.stdout.write(header(`shrk ${groupLabel}${aliasNote}`));
|
|
67
|
+
if (handler) {
|
|
68
|
+
process.stdout.write(` (this group is itself callable)\n`);
|
|
69
|
+
process.stdout.write(` ${groupLabel.padEnd(20)} — ${handler.description}\n`);
|
|
70
|
+
process.stdout.write(` ${handler.usage}\n\n`);
|
|
71
|
+
}
|
|
72
|
+
for (const [name, child] of node.children) {
|
|
73
|
+
if (child.handler) {
|
|
74
|
+
process.stdout.write(` ${groupLabel} ${name.padEnd(12)} — ${child.handler.description}\n`);
|
|
75
|
+
process.stdout.write(` ${child.handler.usage}\n`);
|
|
76
|
+
}
|
|
77
|
+
else if (child.children.size > 0) {
|
|
78
|
+
// Nested subgroup — show one-line summary.
|
|
79
|
+
const verbList = [...child.children.keys()].slice(0, 4).join(', ');
|
|
80
|
+
process.stdout.write(` ${groupLabel} ${name.padEnd(12)} — subgroup: ${verbList}…\n`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return 0;
|
|
84
|
+
}
|
|
85
|
+
process.stderr.write(`Unknown command: ${tokens.join(' ')}\n`);
|
|
86
|
+
return 1;
|
|
87
|
+
}
|
|
88
|
+
if (!wantsFull) {
|
|
89
|
+
process.stdout.write(renderStartScreen());
|
|
90
|
+
return 0;
|
|
91
|
+
}
|
|
92
|
+
process.stdout.write(`SharkCraft CLI — structured project intelligence for AI coding agents\n`);
|
|
93
|
+
process.stdout.write(`Usage: shrk [--cwd <dir>] <command> [...args]\n`);
|
|
94
|
+
process.stdout.write(header('Top-level commands'));
|
|
95
|
+
for (const c of registry.list()) {
|
|
96
|
+
process.stdout.write(` ${c.name.padEnd(10)} — ${c.description}\n`);
|
|
97
|
+
}
|
|
98
|
+
// Show each canonical group once.
|
|
99
|
+
const canonicalGroups = [];
|
|
100
|
+
const aliasMap = registry.listGroupAliases();
|
|
101
|
+
const seen = new Set();
|
|
102
|
+
for (const g of registry.listGroups()) {
|
|
103
|
+
const canonical = aliasMap.get(g) ?? g;
|
|
104
|
+
if (!seen.has(canonical)) {
|
|
105
|
+
seen.add(canonical);
|
|
106
|
+
canonicalGroups.push(canonical);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
const aliasesByCanonical = new Map();
|
|
110
|
+
for (const [alias, canonical] of aliasMap.entries()) {
|
|
111
|
+
const list = aliasesByCanonical.get(canonical) ?? [];
|
|
112
|
+
list.push(alias);
|
|
113
|
+
aliasesByCanonical.set(canonical, list);
|
|
114
|
+
}
|
|
115
|
+
for (const group of canonicalGroups) {
|
|
116
|
+
const aliases = aliasesByCanonical.get(group) ?? [];
|
|
117
|
+
const aliasNote = aliases.length ? ` (also: ${aliases.join(', ')})` : '';
|
|
118
|
+
process.stdout.write(header(`shrk ${group} <sub>${aliasNote}`));
|
|
119
|
+
for (const s of registry.listGroup(group)) {
|
|
120
|
+
process.stdout.write(` ${group} ${s.name.padEnd(10)} — ${s.description}\n`);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
process.stdout.write('\nRun `shrk help <command>` for detailed usage.\n');
|
|
124
|
+
return 0;
|
|
125
|
+
},
|
|
126
|
+
};
|
|
127
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ICommandHandler } from '../command-registry.js';
|
|
2
|
+
export declare const helperListCommand: ICommandHandler;
|
|
3
|
+
export declare const helperGetCommand: ICommandHandler;
|
|
4
|
+
export declare const helperPlanCommand: ICommandHandler;
|
|
5
|
+
export declare const helperCommand: ICommandHandler;
|
|
6
|
+
//# sourceMappingURL=helper.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helper.command.d.ts","sourceRoot":"","sources":["../../src/commands/helper.command.ts"],"names":[],"mappings":"AAoBA,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAUhC,eAAO,MAAM,iBAAiB,EAAE,eAgB/B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,eA6B9B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,eAiF/B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,eAqB3B,CAAC"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `shrk helper` commands.
|
|
3
|
+
*
|
|
4
|
+
* shrk helper list
|
|
5
|
+
* shrk helper get <id>
|
|
6
|
+
* shrk helper plan <id> --var k=v [--dry-run] [--output <plan.json>]
|
|
7
|
+
*
|
|
8
|
+
* Dry-run by default; never writes source.
|
|
9
|
+
*/
|
|
10
|
+
import { mkdirSync, writeFileSync } from 'node:fs';
|
|
11
|
+
import * as nodePath from 'node:path';
|
|
12
|
+
import { buildHelperPlan, HELPERS, HELPER_SYNTHETIC_TEMPLATE, helperPlanToSavedPlan, renderHelperPlanText, } from '@shrkcrft/inspector';
|
|
13
|
+
import { savePlanToFile, signPlan } from '@shrkcrft/generator';
|
|
14
|
+
import { flagBool, flagString, flagVars, resolveCwd, } from "../command-registry.js";
|
|
15
|
+
import { asJson, header } from "../output/format-output.js";
|
|
16
|
+
function writePlanFile(content, outputArg, cwd) {
|
|
17
|
+
const abs = nodePath.isAbsolute(outputArg) ? outputArg : nodePath.resolve(cwd, outputArg);
|
|
18
|
+
mkdirSync(nodePath.dirname(abs), { recursive: true });
|
|
19
|
+
writeFileSync(abs, content + '\n', 'utf8');
|
|
20
|
+
return abs;
|
|
21
|
+
}
|
|
22
|
+
export const helperListCommand = {
|
|
23
|
+
name: 'list',
|
|
24
|
+
description: 'List available helpers (one-shot plan generators).',
|
|
25
|
+
usage: 'shrk helper list [--json]',
|
|
26
|
+
async run(args) {
|
|
27
|
+
if (flagBool(args, 'json')) {
|
|
28
|
+
process.stdout.write(asJson(HELPERS) + '\n');
|
|
29
|
+
return 0;
|
|
30
|
+
}
|
|
31
|
+
process.stdout.write(header(`Helpers (${HELPERS.length})`));
|
|
32
|
+
for (const h of HELPERS) {
|
|
33
|
+
const marker = h.destructive ? '[destructive] ' : ' ';
|
|
34
|
+
process.stdout.write(` ${marker}${h.id.padEnd(34)} ${h.description}\n`);
|
|
35
|
+
}
|
|
36
|
+
return 0;
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
export const helperGetCommand = {
|
|
40
|
+
name: 'get',
|
|
41
|
+
description: 'Show a helper definition (variables, safety flags).',
|
|
42
|
+
usage: 'shrk helper get <id> [--json]',
|
|
43
|
+
async run(args) {
|
|
44
|
+
const id = args.positional[0];
|
|
45
|
+
if (!id) {
|
|
46
|
+
process.stderr.write('Usage: shrk helper get <id>\n');
|
|
47
|
+
return 2;
|
|
48
|
+
}
|
|
49
|
+
const def = HELPERS.find((h) => h.id === id);
|
|
50
|
+
if (!def) {
|
|
51
|
+
process.stderr.write(`Unknown helper: ${id}\n`);
|
|
52
|
+
return 1;
|
|
53
|
+
}
|
|
54
|
+
if (flagBool(args, 'json')) {
|
|
55
|
+
process.stdout.write(asJson(def) + '\n');
|
|
56
|
+
return 0;
|
|
57
|
+
}
|
|
58
|
+
process.stdout.write(header(`Helper: ${def.id}`));
|
|
59
|
+
process.stdout.write(` description ${def.description}\n`);
|
|
60
|
+
process.stdout.write(` destructive ${def.destructive ? 'yes' : 'no'}\n`);
|
|
61
|
+
process.stdout.write(` review ${def.requiresHumanReview ? 'human review required' : 'auto'}\n`);
|
|
62
|
+
process.stdout.write(` variables ${def.variables.length}\n`);
|
|
63
|
+
for (const v of def.variables) {
|
|
64
|
+
process.stdout.write(` • ${v.name}${v.required ? ' (required)' : ''} — ${v.description}\n`);
|
|
65
|
+
}
|
|
66
|
+
return 0;
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
export const helperPlanCommand = {
|
|
70
|
+
name: 'plan',
|
|
71
|
+
description: 'Generate a plan-only helper plan (dry-run by default). Pass --save-plan <file> to emit a saved plan that flows through `shrk apply`.',
|
|
72
|
+
usage: 'shrk helper plan <id> --var k=v [--output <plan.json>] [--save-plan <file>] [--sign] [--json]',
|
|
73
|
+
async run(args) {
|
|
74
|
+
const id = args.positional[0];
|
|
75
|
+
if (!id) {
|
|
76
|
+
process.stderr.write('Usage: shrk helper plan <id> --var k=v\n');
|
|
77
|
+
return 2;
|
|
78
|
+
}
|
|
79
|
+
const def = HELPERS.find((h) => h.id === id);
|
|
80
|
+
if (!def) {
|
|
81
|
+
process.stderr.write(`Unknown helper: ${id}\n`);
|
|
82
|
+
return 1;
|
|
83
|
+
}
|
|
84
|
+
// Helpers with requiresProfile must error explicitly when no
|
|
85
|
+
// profile is available. Today the helper-registry detects this inside
|
|
86
|
+
// buildHelperPlan via requireProfile(); we surface a friendly message.
|
|
87
|
+
if ('requiresProfile' in def && def.requiresProfile) {
|
|
88
|
+
process.stderr.write(`Helper "${id}" requires a plugin-lifecycle profile. Available:\n $ shrk plugin lifecycle profiles\n`);
|
|
89
|
+
// Still try to build the plan; the registry throws with the same idea.
|
|
90
|
+
}
|
|
91
|
+
const cwd = resolveCwd(args);
|
|
92
|
+
const vars = flagVars(args);
|
|
93
|
+
try {
|
|
94
|
+
const plan = buildHelperPlan({ helperId: id, projectRoot: cwd, vars });
|
|
95
|
+
const savePlanPath = flagString(args, 'save-plan');
|
|
96
|
+
if (savePlanPath) {
|
|
97
|
+
const saved = helperPlanToSavedPlan(plan, cwd);
|
|
98
|
+
let toWrite = saved;
|
|
99
|
+
if (flagBool(args, 'sign')) {
|
|
100
|
+
const signed = signPlan(toWrite);
|
|
101
|
+
if (signed.ok)
|
|
102
|
+
toWrite = signed.value;
|
|
103
|
+
}
|
|
104
|
+
const abs = nodePath.isAbsolute(savePlanPath)
|
|
105
|
+
? savePlanPath
|
|
106
|
+
: nodePath.resolve(cwd, savePlanPath);
|
|
107
|
+
const writeResult = savePlanToFile(toWrite, abs);
|
|
108
|
+
if (!writeResult.ok) {
|
|
109
|
+
process.stderr.write(`Failed to save plan: ${writeResult.error.message}\n`);
|
|
110
|
+
return 1;
|
|
111
|
+
}
|
|
112
|
+
if (!flagBool(args, 'json')) {
|
|
113
|
+
process.stdout.write(renderHelperPlanText(plan));
|
|
114
|
+
process.stdout.write(`\nSaved plan to ${abs}\nApply: shrk apply ${abs} --verify-signature\n`);
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
process.stdout.write(asJson({ saved: abs, plan, synthetic: HELPER_SYNTHETIC_TEMPLATE }) + '\n');
|
|
118
|
+
}
|
|
119
|
+
return 0;
|
|
120
|
+
}
|
|
121
|
+
const output = flagString(args, 'output');
|
|
122
|
+
if (flagBool(args, 'json')) {
|
|
123
|
+
const body = asJson(plan);
|
|
124
|
+
if (output) {
|
|
125
|
+
const abs = writePlanFile(body, output, cwd);
|
|
126
|
+
process.stdout.write(`Wrote ${abs}\n`);
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
process.stdout.write(body + '\n');
|
|
130
|
+
}
|
|
131
|
+
return 0;
|
|
132
|
+
}
|
|
133
|
+
process.stdout.write(renderHelperPlanText(plan));
|
|
134
|
+
if (plan.destructive) {
|
|
135
|
+
process.stdout.write('\n⚠ DESTRUCTIVE — human approval required.\n');
|
|
136
|
+
}
|
|
137
|
+
if (output) {
|
|
138
|
+
const abs = writePlanFile(asJson(plan), output, cwd);
|
|
139
|
+
process.stdout.write(`\nSaved plan to ${abs}\n`);
|
|
140
|
+
}
|
|
141
|
+
return 0;
|
|
142
|
+
}
|
|
143
|
+
catch (e) {
|
|
144
|
+
process.stderr.write(`${e.message}\n`);
|
|
145
|
+
return 2;
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
};
|
|
149
|
+
export const helperCommand = {
|
|
150
|
+
name: 'helper',
|
|
151
|
+
description: 'Helper plan generators (list / get / plan). Plan-only, dry-run default.',
|
|
152
|
+
usage: 'shrk helper list|get <id>|plan <id> --var k=v',
|
|
153
|
+
async run(args) {
|
|
154
|
+
const sub = args.positional[0];
|
|
155
|
+
if (sub === 'list') {
|
|
156
|
+
args.positional = args.positional.slice(1);
|
|
157
|
+
return helperListCommand.run(args);
|
|
158
|
+
}
|
|
159
|
+
if (sub === 'get') {
|
|
160
|
+
args.positional = args.positional.slice(1);
|
|
161
|
+
return helperGetCommand.run(args);
|
|
162
|
+
}
|
|
163
|
+
if (sub === 'plan') {
|
|
164
|
+
args.positional = args.positional.slice(1);
|
|
165
|
+
return helperPlanCommand.run(args);
|
|
166
|
+
}
|
|
167
|
+
process.stderr.write('Usage: shrk helper list|get <id>|plan <id>\n');
|
|
168
|
+
return 2;
|
|
169
|
+
},
|
|
170
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ICommandHandler } from '../command-registry.js';
|
|
2
|
+
export declare const ideFileCommand: ICommandHandler;
|
|
3
|
+
export declare const ideProjectCommand: ICommandHandler;
|
|
4
|
+
export declare const ideSymbolCommand: ICommandHandler;
|
|
5
|
+
export declare const ideCommand: ICommandHandler;
|
|
6
|
+
//# sourceMappingURL=ide.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ide.command.d.ts","sourceRoot":"","sources":["../../src/commands/ide.command.ts"],"names":[],"mappings":"AAQA,OAAO,EAIL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AA0ChC,eAAO,MAAM,cAAc,EAAE,eAiI5B,CAAC;AAwCF,eAAO,MAAM,iBAAiB,EAAE,eAuF/B,CAAC;AAsBF,eAAO,MAAM,gBAAgB,EAAE,eAuG9B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,eA+BxB,CAAC"}
|
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
import { existsSync, statSync } from 'node:fs';
|
|
2
|
+
import * as nodePath from 'node:path';
|
|
3
|
+
import { buildAiReadinessReport, buildPackSignatureStatusReport, inspectSharkcraft, runDoctor, } from '@shrkcrft/inspector';
|
|
4
|
+
import { flagBool, resolveCwd, } from "../command-registry.js";
|
|
5
|
+
import { asJson, header } from "../output/format-output.js";
|
|
6
|
+
function relativise(cwd, file) {
|
|
7
|
+
const abs = nodePath.isAbsolute(file) ? file : nodePath.resolve(cwd, file);
|
|
8
|
+
return nodePath.relative(cwd, abs);
|
|
9
|
+
}
|
|
10
|
+
export const ideFileCommand = {
|
|
11
|
+
name: 'file',
|
|
12
|
+
description: 'Emit per-file SharkCraft signals as one JSON record (applicable rules + relevant knowledge + suggested commands). Read-only. Designed for IDE extensions.',
|
|
13
|
+
usage: 'shrk ide file <path> [--json]',
|
|
14
|
+
async run(args) {
|
|
15
|
+
const target = args.positional[0];
|
|
16
|
+
if (!target) {
|
|
17
|
+
process.stderr.write('Usage: shrk ide file <path> [--json]\n');
|
|
18
|
+
return 2;
|
|
19
|
+
}
|
|
20
|
+
const cwd = resolveCwd(args);
|
|
21
|
+
const abs = nodePath.isAbsolute(target) ? target : nodePath.resolve(cwd, target);
|
|
22
|
+
const exists = existsSync(abs);
|
|
23
|
+
const isDirectory = exists ? safeIsDir(abs) : false;
|
|
24
|
+
let report;
|
|
25
|
+
try {
|
|
26
|
+
const inspection = await inspectSharkcraft({ cwd });
|
|
27
|
+
const rules = inspection.ruleService.list();
|
|
28
|
+
const knowledge = inspection.knowledgeEntries;
|
|
29
|
+
// We don't have a per-file query in the engine; the deterministic
|
|
30
|
+
// approach is: surface rules whose `pathPatterns` or content
|
|
31
|
+
// mention this file's path segments, then suggest the smallest set
|
|
32
|
+
// of next commands.
|
|
33
|
+
const relPath = relativise(cwd, abs);
|
|
34
|
+
const fileTokens = relPath.split(/[\\/.]/).filter((t) => t.length >= 3);
|
|
35
|
+
const applicableRules = rules
|
|
36
|
+
.filter((r) => fileTokens.some((tok) => {
|
|
37
|
+
const hay = (r.content + ' ' + (r.title ?? '') + ' ' + (r.tags ?? []).join(' ')).toLowerCase();
|
|
38
|
+
return hay.includes(tok.toLowerCase());
|
|
39
|
+
}))
|
|
40
|
+
.slice(0, 25)
|
|
41
|
+
.map((r) => ({
|
|
42
|
+
id: r.id,
|
|
43
|
+
title: r.title,
|
|
44
|
+
priority: r.priority,
|
|
45
|
+
advisory: Boolean(r.advisory),
|
|
46
|
+
appliesWhen: r.appliesWhen,
|
|
47
|
+
}));
|
|
48
|
+
const relevantKnowledge = knowledge
|
|
49
|
+
.filter((k) => fileTokens.some((tok) => {
|
|
50
|
+
const hay = (k.content + ' ' + (k.title ?? '') + ' ' + (k.tags ?? []).join(' ')).toLowerCase();
|
|
51
|
+
return hay.includes(tok.toLowerCase());
|
|
52
|
+
}))
|
|
53
|
+
.slice(0, 25)
|
|
54
|
+
.map((k) => ({ id: k.id, title: k.title, type: k.type, priority: k.priority }));
|
|
55
|
+
const suggestedCommands = [];
|
|
56
|
+
suggestedCommands.push(`shrk why "${relPath}"`);
|
|
57
|
+
if (applicableRules.length > 0) {
|
|
58
|
+
suggestedCommands.push(`shrk rules relevant --task "edit ${relPath}"`);
|
|
59
|
+
}
|
|
60
|
+
if (relevantKnowledge.length > 0) {
|
|
61
|
+
suggestedCommands.push(`shrk knowledge search "${nodePath.basename(relPath)}"`);
|
|
62
|
+
}
|
|
63
|
+
suggestedCommands.push('shrk impact');
|
|
64
|
+
suggestedCommands.push('shrk check boundaries --changed-only');
|
|
65
|
+
const notes = [];
|
|
66
|
+
if (!exists)
|
|
67
|
+
notes.push('file does not exist on disk');
|
|
68
|
+
if (isDirectory)
|
|
69
|
+
notes.push('path is a directory; results are heuristic');
|
|
70
|
+
report = {
|
|
71
|
+
schema: 'sharkcraft.ide.file/v1',
|
|
72
|
+
generatedAt: new Date().toISOString(),
|
|
73
|
+
cwd,
|
|
74
|
+
file: {
|
|
75
|
+
path: abs,
|
|
76
|
+
relativePath: relPath,
|
|
77
|
+
exists,
|
|
78
|
+
isDirectory,
|
|
79
|
+
},
|
|
80
|
+
applicableRules,
|
|
81
|
+
relevantKnowledge,
|
|
82
|
+
suggestedCommands,
|
|
83
|
+
notes,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
catch (e) {
|
|
87
|
+
// If sharkcraft/ is absent or broken, still produce a useful skeleton.
|
|
88
|
+
const relPath = relativise(cwd, abs);
|
|
89
|
+
report = {
|
|
90
|
+
schema: 'sharkcraft.ide.file/v1',
|
|
91
|
+
generatedAt: new Date().toISOString(),
|
|
92
|
+
cwd,
|
|
93
|
+
file: { path: abs, relativePath: relPath, exists, isDirectory },
|
|
94
|
+
applicableRules: [],
|
|
95
|
+
relevantKnowledge: [],
|
|
96
|
+
suggestedCommands: [
|
|
97
|
+
'shrk init --zero-config',
|
|
98
|
+
'shrk doctor',
|
|
99
|
+
],
|
|
100
|
+
notes: [
|
|
101
|
+
`inspectSharkcraft failed: ${e.message}`,
|
|
102
|
+
'run `shrk init --zero-config` to set up the workspace',
|
|
103
|
+
],
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
if (flagBool(args, 'json') || !process.stdout.isTTY) {
|
|
107
|
+
process.stdout.write(asJson(report) + '\n');
|
|
108
|
+
return 0;
|
|
109
|
+
}
|
|
110
|
+
process.stdout.write(header(`IDE file report: ${report.file.relativePath}`));
|
|
111
|
+
process.stdout.write(`exists: ${report.file.exists}\n`);
|
|
112
|
+
process.stdout.write(`directory: ${report.file.isDirectory}\n\n`);
|
|
113
|
+
process.stdout.write(`applicable rules (${report.applicableRules.length}):\n`);
|
|
114
|
+
for (const r of report.applicableRules.slice(0, 10)) {
|
|
115
|
+
process.stdout.write(` • ${r.id}${r.priority ? ` [${r.priority}]` : ''} — ${r.title ?? ''}\n`);
|
|
116
|
+
}
|
|
117
|
+
process.stdout.write(`\nrelevant knowledge (${report.relevantKnowledge.length}):\n`);
|
|
118
|
+
for (const k of report.relevantKnowledge.slice(0, 10)) {
|
|
119
|
+
process.stdout.write(` • ${k.id}${k.priority ? ` [${k.priority}]` : ''} — ${k.title ?? ''}\n`);
|
|
120
|
+
}
|
|
121
|
+
process.stdout.write(`\nsuggested commands:\n`);
|
|
122
|
+
for (const c of report.suggestedCommands)
|
|
123
|
+
process.stdout.write(` $ ${c}\n`);
|
|
124
|
+
if (report.notes.length > 0) {
|
|
125
|
+
process.stdout.write('\nnotes:\n');
|
|
126
|
+
for (const n of report.notes)
|
|
127
|
+
process.stdout.write(` • ${n}\n`);
|
|
128
|
+
}
|
|
129
|
+
process.stdout.write(`\n(pass --json for the machine surface — schema ${report.schema})\n`);
|
|
130
|
+
return 0;
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
function safeIsDir(p) {
|
|
134
|
+
try {
|
|
135
|
+
return statSync(p).isDirectory();
|
|
136
|
+
}
|
|
137
|
+
catch {
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
export const ideProjectCommand = {
|
|
142
|
+
name: 'project',
|
|
143
|
+
description: 'Emit workspace-wide SharkCraft signals as one JSON record (active packs, presets, framework, doctor summary, CI status, signature status). Read-only.',
|
|
144
|
+
usage: 'shrk ide project [--json]',
|
|
145
|
+
async run(args) {
|
|
146
|
+
const cwd = resolveCwd(args);
|
|
147
|
+
const inspection = await inspectSharkcraft({ cwd });
|
|
148
|
+
const doctor = runDoctor(inspection);
|
|
149
|
+
const ai = buildAiReadinessReport(inspection);
|
|
150
|
+
const sig = buildPackSignatureStatusReport(inspection);
|
|
151
|
+
const cfg = inspection.config;
|
|
152
|
+
const verificationIds = (cfg?.verificationCommands ?? [])
|
|
153
|
+
.map((v) => v.id)
|
|
154
|
+
.filter((id) => typeof id === 'string');
|
|
155
|
+
// Active presets — every preset in the registry that recommends with
|
|
156
|
+
// confidence ≥ 'medium' against the detected profiles.
|
|
157
|
+
const activePresets = inspection.presetRegistry
|
|
158
|
+
.list()
|
|
159
|
+
.filter((p) => {
|
|
160
|
+
const appliesTo = p.appliesTo;
|
|
161
|
+
if (!appliesTo)
|
|
162
|
+
return false;
|
|
163
|
+
return inspection.workspace.profiles.some((prof) => appliesTo.includes(prof));
|
|
164
|
+
})
|
|
165
|
+
.slice(0, 25)
|
|
166
|
+
.map((p) => ({ id: p.id }));
|
|
167
|
+
const report = {
|
|
168
|
+
schema: 'sharkcraft.ide.project/v1',
|
|
169
|
+
generatedAt: new Date().toISOString(),
|
|
170
|
+
cwd,
|
|
171
|
+
workspace: {
|
|
172
|
+
framework: inspection.workspace.framework ?? null,
|
|
173
|
+
profiles: inspection.workspace.profiles,
|
|
174
|
+
hasSharkcraftFolder: inspection.hasSharkcraftFolder,
|
|
175
|
+
},
|
|
176
|
+
activePacks: (inspection.packs.validPacks ?? []).map((p) => ({
|
|
177
|
+
name: p.packageName,
|
|
178
|
+
version: p.packageVersion,
|
|
179
|
+
})),
|
|
180
|
+
activePresets,
|
|
181
|
+
configuredVerificationCommandIds: verificationIds,
|
|
182
|
+
doctor: {
|
|
183
|
+
passed: doctor.passed,
|
|
184
|
+
errors: doctor.summary.errors,
|
|
185
|
+
warnings: doctor.summary.warnings,
|
|
186
|
+
info: doctor.summary.info,
|
|
187
|
+
ok: doctor.summary.ok,
|
|
188
|
+
},
|
|
189
|
+
aiReadiness: { score: ai.score, grade: ai.grade },
|
|
190
|
+
signatureStatus: {
|
|
191
|
+
total: sig.summary.total,
|
|
192
|
+
present: sig.summary.present,
|
|
193
|
+
stale: sig.summary.stale,
|
|
194
|
+
missing: sig.summary.missing,
|
|
195
|
+
dev: sig.summary.dev,
|
|
196
|
+
},
|
|
197
|
+
suggestedCommands: [
|
|
198
|
+
'shrk doctor',
|
|
199
|
+
'shrk check boundaries --changed-only',
|
|
200
|
+
'shrk packs signature-status',
|
|
201
|
+
'shrk drift rules',
|
|
202
|
+
],
|
|
203
|
+
};
|
|
204
|
+
if (flagBool(args, 'json') || !process.stdout.isTTY) {
|
|
205
|
+
process.stdout.write(asJson(report) + '\n');
|
|
206
|
+
return 0;
|
|
207
|
+
}
|
|
208
|
+
process.stdout.write(header(`IDE project report`));
|
|
209
|
+
process.stdout.write(`framework: ${report.workspace.framework ?? '(unknown)'}\n`);
|
|
210
|
+
process.stdout.write(`profiles: ${report.workspace.profiles.join(', ') || '(none)'}\n`);
|
|
211
|
+
process.stdout.write(`packs: ${report.activePacks.length}\n`);
|
|
212
|
+
process.stdout.write(`presets: ${report.activePresets.length}\n`);
|
|
213
|
+
process.stdout.write(`doctor: ${report.doctor.errors} err / ${report.doctor.warnings} warn / ${report.doctor.ok} ok\n`);
|
|
214
|
+
process.stdout.write(`ai-ready: ${report.aiReadiness.score}/100 (${report.aiReadiness.grade})\n`);
|
|
215
|
+
process.stdout.write(`signatures: ${report.signatureStatus.present} present / ${report.signatureStatus.stale} stale / ${report.signatureStatus.missing} missing / ${report.signatureStatus.dev} dev\n`);
|
|
216
|
+
process.stdout.write(`\n(pass --json for the machine surface — schema ${report.schema})\n`);
|
|
217
|
+
return 0;
|
|
218
|
+
},
|
|
219
|
+
};
|
|
220
|
+
export const ideSymbolCommand = {
|
|
221
|
+
name: 'symbol',
|
|
222
|
+
description: 'Emit per-symbol SharkCraft signals (knowledge anchors / rule references / suggested commands) as one JSON record. Read-only.',
|
|
223
|
+
usage: 'shrk ide symbol <name> [--json]',
|
|
224
|
+
async run(args) {
|
|
225
|
+
const symbol = args.positional[0];
|
|
226
|
+
if (!symbol) {
|
|
227
|
+
process.stderr.write('Usage: shrk ide symbol <name> [--json]\n');
|
|
228
|
+
return 2;
|
|
229
|
+
}
|
|
230
|
+
const cwd = resolveCwd(args);
|
|
231
|
+
const inspection = await inspectSharkcraft({ cwd });
|
|
232
|
+
const references = [];
|
|
233
|
+
const symbolLower = symbol.toLowerCase();
|
|
234
|
+
const matchInString = (s) => typeof s === 'string' && s.toLowerCase().includes(symbolLower);
|
|
235
|
+
for (const entry of inspection.knowledgeEntries) {
|
|
236
|
+
const kind = entry.type === 'rule' ? 'rule' : 'knowledge';
|
|
237
|
+
const anchors = entry.anchors;
|
|
238
|
+
if (anchors) {
|
|
239
|
+
for (const a of anchors) {
|
|
240
|
+
if (a.kind === 'symbol' && a.symbol === symbol) {
|
|
241
|
+
references.push({
|
|
242
|
+
sourceKind: kind,
|
|
243
|
+
sourceId: entry.id,
|
|
244
|
+
sourceTitle: entry.title,
|
|
245
|
+
matchedField: 'anchors',
|
|
246
|
+
});
|
|
247
|
+
break;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
const refs = entry.references;
|
|
252
|
+
if (refs) {
|
|
253
|
+
for (const r of refs) {
|
|
254
|
+
if (r.kind === 'symbol' && r.symbol === symbol) {
|
|
255
|
+
references.push({
|
|
256
|
+
sourceKind: kind,
|
|
257
|
+
sourceId: entry.id,
|
|
258
|
+
sourceTitle: entry.title,
|
|
259
|
+
matchedField: 'references',
|
|
260
|
+
});
|
|
261
|
+
break;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
if (matchInString(entry.title) && !references.some((x) => x.sourceId === entry.id)) {
|
|
266
|
+
references.push({
|
|
267
|
+
sourceKind: kind,
|
|
268
|
+
sourceId: entry.id,
|
|
269
|
+
sourceTitle: entry.title,
|
|
270
|
+
matchedField: 'title',
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
else if (matchInString(entry.content) &&
|
|
274
|
+
!references.some((x) => x.sourceId === entry.id)) {
|
|
275
|
+
references.push({
|
|
276
|
+
sourceKind: kind,
|
|
277
|
+
sourceId: entry.id,
|
|
278
|
+
sourceTitle: entry.title,
|
|
279
|
+
matchedField: 'content',
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
const report = {
|
|
284
|
+
schema: 'sharkcraft.ide.symbol/v1',
|
|
285
|
+
generatedAt: new Date().toISOString(),
|
|
286
|
+
cwd,
|
|
287
|
+
symbol,
|
|
288
|
+
references: references.slice(0, 50),
|
|
289
|
+
suggestedCommands: [
|
|
290
|
+
`shrk impact --symbol ${symbol}`,
|
|
291
|
+
`shrk trace --symbol ${symbol}`,
|
|
292
|
+
`shrk knowledge search "${symbol}"`,
|
|
293
|
+
],
|
|
294
|
+
notes: references.length === 0
|
|
295
|
+
? ['no anchors / rules reference this symbol']
|
|
296
|
+
: [],
|
|
297
|
+
};
|
|
298
|
+
if (flagBool(args, 'json') || !process.stdout.isTTY) {
|
|
299
|
+
process.stdout.write(asJson(report) + '\n');
|
|
300
|
+
return 0;
|
|
301
|
+
}
|
|
302
|
+
process.stdout.write(header(`IDE symbol report: ${symbol}`));
|
|
303
|
+
process.stdout.write(`references (${report.references.length}):\n`);
|
|
304
|
+
for (const r of report.references.slice(0, 10)) {
|
|
305
|
+
process.stdout.write(` • ${r.sourceKind}:${r.sourceId} (matched in ${r.matchedField})\n`);
|
|
306
|
+
}
|
|
307
|
+
process.stdout.write(`\nsuggested commands:\n`);
|
|
308
|
+
for (const c of report.suggestedCommands)
|
|
309
|
+
process.stdout.write(` $ ${c}\n`);
|
|
310
|
+
return 0;
|
|
311
|
+
},
|
|
312
|
+
};
|
|
313
|
+
export const ideCommand = {
|
|
314
|
+
name: 'ide',
|
|
315
|
+
description: 'IDE data surface — read-only JSON reports per file / project / symbol. Designed for IDE extensions to consume.',
|
|
316
|
+
usage: 'shrk ide file <path> [--json] | shrk ide project [--json] | shrk ide symbol <name> [--json]',
|
|
317
|
+
async run(args) {
|
|
318
|
+
const verb = args.positional[0];
|
|
319
|
+
if (verb === 'file') {
|
|
320
|
+
return ideFileCommand.run({
|
|
321
|
+
...args,
|
|
322
|
+
positional: args.positional.slice(1),
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
if (verb === 'project') {
|
|
326
|
+
return ideProjectCommand.run({
|
|
327
|
+
...args,
|
|
328
|
+
positional: args.positional.slice(1),
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
if (verb === 'symbol') {
|
|
332
|
+
return ideSymbolCommand.run({
|
|
333
|
+
...args,
|
|
334
|
+
positional: args.positional.slice(1),
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
process.stderr.write('Usage: shrk ide <file|project|symbol> [...args] [--json]\n');
|
|
338
|
+
return 2;
|
|
339
|
+
},
|
|
340
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"impact.command.d.ts","sourceRoot":"","sources":["../../src/commands/impact.command.ts"],"names":[],"mappings":"AAsBA,OAAO,EAML,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AA0QhC,eAAO,MAAM,aAAa,EAAE,eAoV3B,CAAC"}
|