@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,511 @@
|
|
|
1
|
+
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import * as nodePath from 'node:path';
|
|
3
|
+
import { buildAdoptionReport, buildCoverageReport, buildDriftReport, buildOnboardingAdoptionPlan, buildOnboardingPlan, buildQualityReport, buildReportSite, buildSafetyAudit, inspectSharkcraft, readAdoptionState, renderAdoptionReportHtml, renderAdoptionReportMarkdown, renderAdoptionReportText, renderDevSessionHtml, renderDevSessionFinalReport, renderImpactGraph, renderImpactHtml, renderImpactMarkdown, renderImpactText, renderReviewComment, renderReviewHtml, renderQualityHtml, renderSafetyHtml, scanDevSession, } from '@shrkcrft/inspector';
|
|
4
|
+
import { flagBool, flagString, resolveCwd, } from "../command-registry.js";
|
|
5
|
+
import { asJson } from "../output/format-output.js";
|
|
6
|
+
import { COMMAND_CATALOG } from "./command-catalog.js";
|
|
7
|
+
const VALID_FORMATS = new Set(['text', 'markdown', 'html', 'json']);
|
|
8
|
+
export const reportCommand = {
|
|
9
|
+
name: 'report',
|
|
10
|
+
description: 'Render runtime reports in text / markdown / html / json. Subcommands: adoption / session / quality / safety / review / coverage / drift / graph.',
|
|
11
|
+
usage: 'shrk report <adoption|session <id>|quality|safety|review <packet.json>|coverage|drift|graph> [--format text|markdown|html|json] [--output <path>] [--collapse-long-sections] [--max-items N] [--include-raw-json] [--json]',
|
|
12
|
+
async run(args) {
|
|
13
|
+
const sub = args.positional[0];
|
|
14
|
+
const sliced = { ...args, positional: args.positional.slice(1) };
|
|
15
|
+
switch (sub) {
|
|
16
|
+
case 'adoption':
|
|
17
|
+
return reportAdoption(sliced);
|
|
18
|
+
case 'session':
|
|
19
|
+
return reportSession(sliced);
|
|
20
|
+
case 'quality':
|
|
21
|
+
return reportQuality(sliced);
|
|
22
|
+
case 'safety':
|
|
23
|
+
return reportSafety(sliced);
|
|
24
|
+
case 'review':
|
|
25
|
+
return reportReview(sliced);
|
|
26
|
+
case 'coverage':
|
|
27
|
+
return reportCoverage(sliced);
|
|
28
|
+
case 'drift':
|
|
29
|
+
return reportDrift(sliced);
|
|
30
|
+
case 'graph':
|
|
31
|
+
return reportGraph(sliced);
|
|
32
|
+
case 'site':
|
|
33
|
+
return reportSite(sliced);
|
|
34
|
+
case 'impact':
|
|
35
|
+
return reportImpact(sliced);
|
|
36
|
+
case 'language':
|
|
37
|
+
case 'languages':
|
|
38
|
+
return reportLanguage(sliced);
|
|
39
|
+
default:
|
|
40
|
+
process.stderr.write('Usage: shrk report <adoption|session <id>|quality|safety|review <packet.json>|coverage|drift|graph|site|impact <impact.json>|language> [options]\n');
|
|
41
|
+
return 2;
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
async function reportLanguage(args) {
|
|
46
|
+
const cwd = resolveCwd(args);
|
|
47
|
+
const { detectLanguageProfiles, buildLanguageCommandReport, scanPolyglotDependencies, buildPolyglotBoundaryReport, loadRepositoryMemory, renderLanguageProfilesMarkdown, renderLanguageProfilesText, renderLanguageCommandsMarkdown, renderLanguageCommandsText, renderPolyglotDependenciesText, renderPolyglotBoundaryReportText, renderPolyglotBoundaryReportMarkdown, } = await import('@shrkcrft/inspector');
|
|
48
|
+
const profiles = detectLanguageProfiles(cwd);
|
|
49
|
+
const commands = buildLanguageCommandReport(cwd, profiles);
|
|
50
|
+
const deps = scanPolyglotDependencies(cwd);
|
|
51
|
+
const includeBoundaries = flagBool(args, 'include-boundaries');
|
|
52
|
+
const includeMemory = flagBool(args, 'include-memory');
|
|
53
|
+
const boundary = includeBoundaries ? buildPolyglotBoundaryReport({ projectRoot: cwd, cached: profiles, graph: deps }) : undefined;
|
|
54
|
+
const memory = includeMemory ? loadRepositoryMemory(cwd) : undefined;
|
|
55
|
+
const format = resolveFormat(args, 'text');
|
|
56
|
+
const combined = { profiles, commands, dependencies: deps, ...(boundary ? { boundary } : {}), ...(memory ? { memoryHotspots: memory.languageHotspots ?? [] } : {}) };
|
|
57
|
+
let body;
|
|
58
|
+
if (format === 'json')
|
|
59
|
+
body = JSON.stringify(versioned('language', combined), null, 2) + '\n';
|
|
60
|
+
else if (format === 'markdown') {
|
|
61
|
+
body =
|
|
62
|
+
renderLanguageProfilesMarkdown(profiles) +
|
|
63
|
+
'\n' +
|
|
64
|
+
renderLanguageCommandsMarkdown(commands) +
|
|
65
|
+
'\n## Polyglot dependencies\n\n```text\n' +
|
|
66
|
+
renderPolyglotDependenciesText(deps) +
|
|
67
|
+
'```\n' +
|
|
68
|
+
(boundary ? '\n' + renderPolyglotBoundaryReportMarkdown(boundary) : '') +
|
|
69
|
+
(memory && memory.languageHotspots ? '\n## Memory hotspots by language\n\n' + memory.languageHotspots.map((h) => `- \`${h.language}\` — ${h.fileCount} files, weight ${h.totalWeight}`).join('\n') + '\n' : '');
|
|
70
|
+
}
|
|
71
|
+
else if (format === 'html') {
|
|
72
|
+
body = baseHtml('SharkCraft language report', `<h1>Language report</h1><pre>${escapeHtml(renderLanguageProfilesText(profiles) + '\n' +
|
|
73
|
+
renderLanguageCommandsText(commands) + '\n' +
|
|
74
|
+
renderPolyglotDependenciesText(deps) +
|
|
75
|
+
(boundary ? '\n' + renderPolyglotBoundaryReportText(boundary) : '') +
|
|
76
|
+
(memory && memory.languageHotspots ? '\n' + memory.languageHotspots.map((h) => `- ${h.language} — ${h.fileCount} files, weight ${h.totalWeight}`).join('\n') : ''))}</pre>`);
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
body =
|
|
80
|
+
renderLanguageProfilesText(profiles) +
|
|
81
|
+
'\n' +
|
|
82
|
+
renderLanguageCommandsText(commands) +
|
|
83
|
+
'\n' +
|
|
84
|
+
renderPolyglotDependenciesText(deps) +
|
|
85
|
+
(boundary ? '\n' + renderPolyglotBoundaryReportText(boundary) : '') +
|
|
86
|
+
(memory && memory.languageHotspots ? '\n=== Memory hotspots by language ===\n' + memory.languageHotspots.map((h) => ` - ${h.language}: ${h.fileCount} files, weight ${h.totalWeight}`).join('\n') + '\n' : '');
|
|
87
|
+
}
|
|
88
|
+
return writeOrPrint(args, cwd, body);
|
|
89
|
+
}
|
|
90
|
+
async function reportSite(args) {
|
|
91
|
+
const cwd = resolveCwd(args);
|
|
92
|
+
const inspection = await inspectSharkcraft({ cwd });
|
|
93
|
+
const output = flagString(args, 'output') ?? '.sharkcraft/reports/site';
|
|
94
|
+
const abs = nodePath.isAbsolute(output) ? output : nodePath.resolve(cwd, output);
|
|
95
|
+
const opts = {};
|
|
96
|
+
const bundle = flagString(args, 'bundle');
|
|
97
|
+
if (bundle)
|
|
98
|
+
opts.bundleId = bundle;
|
|
99
|
+
const review = flagString(args, 'review');
|
|
100
|
+
if (review)
|
|
101
|
+
opts.reviewPacketFile = review;
|
|
102
|
+
const impactFlag = flagString(args, 'impact');
|
|
103
|
+
if (impactFlag) {
|
|
104
|
+
opts.impactFile = nodePath.isAbsolute(impactFlag) ? impactFlag : nodePath.resolve(cwd, impactFlag);
|
|
105
|
+
}
|
|
106
|
+
const impactDirFlag = flagString(args, 'impact-dir');
|
|
107
|
+
if (impactDirFlag) {
|
|
108
|
+
opts.impactDir = nodePath.isAbsolute(impactDirFlag)
|
|
109
|
+
? impactDirFlag
|
|
110
|
+
: nodePath.resolve(cwd, impactDirFlag);
|
|
111
|
+
}
|
|
112
|
+
if (flagBool(args, 'with-impact-graphs'))
|
|
113
|
+
opts.withImpactGraphs = true;
|
|
114
|
+
if (flagBool(args, 'render-impact-graphs')) {
|
|
115
|
+
opts.withImpactGraphs = true;
|
|
116
|
+
opts.renderImpactGraphs = true;
|
|
117
|
+
}
|
|
118
|
+
const title = flagString(args, 'title');
|
|
119
|
+
if (title)
|
|
120
|
+
opts.title = title;
|
|
121
|
+
const brand = flagString(args, 'brand');
|
|
122
|
+
if (brand)
|
|
123
|
+
opts.brand = brand;
|
|
124
|
+
const safetyUrl = flagString(args, 'safety-matrix');
|
|
125
|
+
if (safetyUrl)
|
|
126
|
+
opts.safetyMatrixUrl = safetyUrl;
|
|
127
|
+
const compatUrl = flagString(args, 'runtime-compat');
|
|
128
|
+
if (compatUrl)
|
|
129
|
+
opts.runtimeCompatibilityUrl = compatUrl;
|
|
130
|
+
const bundleDiff = flagString(args, 'bundle-diff');
|
|
131
|
+
if (bundleDiff)
|
|
132
|
+
opts.bundleDiffFile = nodePath.isAbsolute(bundleDiff) ? bundleDiff : nodePath.resolve(cwd, bundleDiff);
|
|
133
|
+
const packCompat = flagString(args, 'pack-compat');
|
|
134
|
+
if (packCompat)
|
|
135
|
+
opts.packCompatFile = nodePath.isAbsolute(packCompat) ? packCompat : nodePath.resolve(cwd, packCompat);
|
|
136
|
+
const r = await buildReportSite(inspection, abs, opts);
|
|
137
|
+
// Also write languages.html alongside the rest of the site.
|
|
138
|
+
try {
|
|
139
|
+
const { detectLanguageProfiles, buildLanguageCommandReport, scanPolyglotDependencies, renderLanguageProfilesMarkdown, renderLanguageCommandsMarkdown, renderPolyglotDependenciesText, } = await import('@shrkcrft/inspector');
|
|
140
|
+
const profiles = detectLanguageProfiles(cwd);
|
|
141
|
+
const commands = buildLanguageCommandReport(cwd, profiles);
|
|
142
|
+
const deps = scanPolyglotDependencies(cwd);
|
|
143
|
+
const md = renderLanguageProfilesMarkdown(profiles) +
|
|
144
|
+
'\n' +
|
|
145
|
+
renderLanguageCommandsMarkdown(commands) +
|
|
146
|
+
'\n## Polyglot dependencies\n\n```text\n' +
|
|
147
|
+
renderPolyglotDependenciesText(deps) +
|
|
148
|
+
'```\n';
|
|
149
|
+
const html = baseHtml('Languages — SharkCraft report site', `<h1>Languages</h1><pre>${escapeHtml(md)}</pre>`);
|
|
150
|
+
const langFile = nodePath.join(r.outputDir, 'languages.html');
|
|
151
|
+
writeFileSync(langFile, html, 'utf8');
|
|
152
|
+
r.files.push(langFile);
|
|
153
|
+
}
|
|
154
|
+
catch {
|
|
155
|
+
// Best-effort; never break report site on language detection failures.
|
|
156
|
+
}
|
|
157
|
+
if (flagBool(args, 'manifest')) {
|
|
158
|
+
const { buildReportSiteManifest } = await import('@shrkcrft/inspector');
|
|
159
|
+
const manifest = buildReportSiteManifest(r, Boolean(bundle || review));
|
|
160
|
+
process.stdout.write(asJson(manifest) + '\n');
|
|
161
|
+
return 0;
|
|
162
|
+
}
|
|
163
|
+
if (flagBool(args, 'json')) {
|
|
164
|
+
process.stdout.write(asJson({
|
|
165
|
+
outputDir: r.outputDir,
|
|
166
|
+
files: r.files,
|
|
167
|
+
pages: r.pages,
|
|
168
|
+
impactCount: r.impactCount,
|
|
169
|
+
hasReview: r.hasReview,
|
|
170
|
+
...(r.impactGraphFiles ? { impactGraphFiles: r.impactGraphFiles } : {}),
|
|
171
|
+
...(r.impactSvgFiles ? { impactSvgFiles: r.impactSvgFiles } : {}),
|
|
172
|
+
...(r.impactRenderDiagnostics ? { impactRenderDiagnostics: r.impactRenderDiagnostics } : {}),
|
|
173
|
+
}) + '\n');
|
|
174
|
+
return 0;
|
|
175
|
+
}
|
|
176
|
+
process.stdout.write(`Wrote ${r.files.length} file(s) → ${r.outputDir}\n`);
|
|
177
|
+
for (const f of r.files)
|
|
178
|
+
process.stdout.write(` + ${f}\n`);
|
|
179
|
+
if (r.impactGraphFiles && r.impactGraphFiles.length > 0) {
|
|
180
|
+
process.stdout.write(`\nEmbedded ${r.impactGraphFiles.length} impact-graph artifact(s).\n`);
|
|
181
|
+
}
|
|
182
|
+
if (r.impactSvgFiles && r.impactSvgFiles.length > 0) {
|
|
183
|
+
process.stdout.write(`Rendered ${r.impactSvgFiles.length} impact-graph SVG(s) via ${[
|
|
184
|
+
...new Set(r.impactSvgFiles.map((f) => f.renderer)),
|
|
185
|
+
].join('/')}.\n`);
|
|
186
|
+
}
|
|
187
|
+
else if (r.impactRenderDiagnostics && r.impactRenderDiagnostics.length > 0) {
|
|
188
|
+
const skipped = r.impactRenderDiagnostics.filter((d) => !d.rendered);
|
|
189
|
+
if (skipped.length > 0) {
|
|
190
|
+
const reasons = [...new Set(skipped.map((s) => s.reason).filter(Boolean))];
|
|
191
|
+
process.stdout.write(`Skipped SVG rendering for ${skipped.length} graph(s): ${reasons.join(', ') || 'renderer-missing'}.\n`);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
return 0;
|
|
195
|
+
}
|
|
196
|
+
function resolveFormat(args, defaultIfJsonFlag = 'text') {
|
|
197
|
+
const f = flagString(args, 'format');
|
|
198
|
+
if (f && !VALID_FORMATS.has(f)) {
|
|
199
|
+
process.stderr.write(`Invalid --format "${f}". Use text|markdown|html|json.\n`);
|
|
200
|
+
process.exit(2);
|
|
201
|
+
}
|
|
202
|
+
if (f)
|
|
203
|
+
return f;
|
|
204
|
+
if (flagBool(args, 'json'))
|
|
205
|
+
return 'json';
|
|
206
|
+
return defaultIfJsonFlag;
|
|
207
|
+
}
|
|
208
|
+
function writeOrPrint(args, cwd, body) {
|
|
209
|
+
const out = flagString(args, 'output');
|
|
210
|
+
if (out) {
|
|
211
|
+
const abs = nodePath.isAbsolute(out) ? out : nodePath.resolve(cwd, out);
|
|
212
|
+
writeFileSync(abs, body, 'utf8');
|
|
213
|
+
if (flagBool(args, 'json'))
|
|
214
|
+
process.stdout.write(asJson({ wrote: abs, bytes: Buffer.byteLength(body) }) + '\n');
|
|
215
|
+
else
|
|
216
|
+
process.stdout.write(`Wrote report to ${abs}\n`);
|
|
217
|
+
return 0;
|
|
218
|
+
}
|
|
219
|
+
process.stdout.write(body);
|
|
220
|
+
return 0;
|
|
221
|
+
}
|
|
222
|
+
async function reportAdoption(args) {
|
|
223
|
+
const cwd = resolveCwd(args);
|
|
224
|
+
const inspection = await inspectSharkcraft({ cwd });
|
|
225
|
+
const plan = buildOnboardingPlan(inspection, {});
|
|
226
|
+
const adoption = buildOnboardingAdoptionPlan({ inspection, plan });
|
|
227
|
+
const state = readAdoptionState(cwd);
|
|
228
|
+
const report = buildAdoptionReport({ projectRoot: cwd, plan: adoption, state });
|
|
229
|
+
const format = resolveFormat(args);
|
|
230
|
+
let body;
|
|
231
|
+
if (format === 'json')
|
|
232
|
+
body = JSON.stringify(versioned('adoption', report), null, 2) + '\n';
|
|
233
|
+
else if (format === 'markdown')
|
|
234
|
+
body = renderAdoptionReportMarkdown(report);
|
|
235
|
+
else if (format === 'html')
|
|
236
|
+
body = renderAdoptionReportHtml(report);
|
|
237
|
+
else
|
|
238
|
+
body = renderAdoptionReportText(report);
|
|
239
|
+
return writeOrPrint(args, cwd, body);
|
|
240
|
+
}
|
|
241
|
+
async function reportSession(args) {
|
|
242
|
+
const id = args.positional[0];
|
|
243
|
+
if (!id) {
|
|
244
|
+
process.stderr.write('Usage: shrk report session <id> [--format html|markdown|json]\n');
|
|
245
|
+
return 2;
|
|
246
|
+
}
|
|
247
|
+
const cwd = resolveCwd(args);
|
|
248
|
+
const load = scanDevSession(cwd, id);
|
|
249
|
+
if (!load || !load.state) {
|
|
250
|
+
process.stderr.write(`Session not found: ${id}\n`);
|
|
251
|
+
return 1;
|
|
252
|
+
}
|
|
253
|
+
const format = resolveFormat(args);
|
|
254
|
+
let body;
|
|
255
|
+
if (format === 'json')
|
|
256
|
+
body = JSON.stringify(versioned('session', { id, state: load.state }), null, 2) + '\n';
|
|
257
|
+
else if (format === 'html')
|
|
258
|
+
body = renderDevSessionHtml(load);
|
|
259
|
+
else if (format === 'markdown' || format === 'text')
|
|
260
|
+
body = renderDevSessionFinalReport(load, {});
|
|
261
|
+
else
|
|
262
|
+
body = JSON.stringify(load, null, 2) + '\n';
|
|
263
|
+
return writeOrPrint(args, cwd, body);
|
|
264
|
+
}
|
|
265
|
+
async function reportQuality(args) {
|
|
266
|
+
const cwd = resolveCwd(args);
|
|
267
|
+
const inspection = await inspectSharkcraft({ cwd });
|
|
268
|
+
const cfgUnknown = inspection.config;
|
|
269
|
+
const cfg = cfgUnknown?.qualityGates ?? {};
|
|
270
|
+
const report = await buildQualityReport({
|
|
271
|
+
inspection,
|
|
272
|
+
config: cfg,
|
|
273
|
+
strict: flagBool(args, 'strict'),
|
|
274
|
+
});
|
|
275
|
+
const format = resolveFormat(args);
|
|
276
|
+
let body;
|
|
277
|
+
if (format === 'json')
|
|
278
|
+
body = JSON.stringify(versioned('quality', report), null, 2) + '\n';
|
|
279
|
+
else if (format === 'html')
|
|
280
|
+
body = renderQualityHtml(report);
|
|
281
|
+
else
|
|
282
|
+
body = renderQualityText(report);
|
|
283
|
+
return writeOrPrint(args, cwd, body);
|
|
284
|
+
}
|
|
285
|
+
async function reportSafety(args) {
|
|
286
|
+
const cwd = resolveCwd(args);
|
|
287
|
+
const inspection = await inspectSharkcraft({ cwd });
|
|
288
|
+
// Lazy-load MCP tool list (kept consistent with `shrk safety audit`).
|
|
289
|
+
const mcpMod = (await import('@shrkcrft/mcp-server'));
|
|
290
|
+
const tools = mcpMod.ALL_TOOLS ?? [];
|
|
291
|
+
const audit = buildSafetyAudit({
|
|
292
|
+
inspection,
|
|
293
|
+
catalog: COMMAND_CATALOG,
|
|
294
|
+
mcpTools: tools.map((t) => ({ name: t.name, description: t.description, canWrite: false })),
|
|
295
|
+
planSecretEnv: 'SHARKCRAFT_PLAN_SECRET',
|
|
296
|
+
planSecretConfigured: typeof process.env.SHARKCRAFT_PLAN_SECRET === 'string' && process.env.SHARKCRAFT_PLAN_SECRET.length > 0,
|
|
297
|
+
});
|
|
298
|
+
const format = resolveFormat(args);
|
|
299
|
+
let body;
|
|
300
|
+
if (format === 'json')
|
|
301
|
+
body = JSON.stringify(versioned('safety', audit), null, 2) + '\n';
|
|
302
|
+
else if (format === 'html')
|
|
303
|
+
body = renderSafetyHtml(audit);
|
|
304
|
+
else
|
|
305
|
+
body = renderSafetyText(audit);
|
|
306
|
+
return writeOrPrint(args, cwd, body);
|
|
307
|
+
}
|
|
308
|
+
async function reportReview(args) {
|
|
309
|
+
const file = args.positional[0];
|
|
310
|
+
if (!file) {
|
|
311
|
+
process.stderr.write('Usage: shrk report review <packet.json> [--format html|markdown|json]\n');
|
|
312
|
+
return 2;
|
|
313
|
+
}
|
|
314
|
+
const cwd = resolveCwd(args);
|
|
315
|
+
const abs = nodePath.isAbsolute(file) ? file : nodePath.resolve(cwd, file);
|
|
316
|
+
if (!existsSync(abs)) {
|
|
317
|
+
process.stderr.write(`Packet not found: ${abs}\n`);
|
|
318
|
+
return 1;
|
|
319
|
+
}
|
|
320
|
+
const packet = JSON.parse(readFileSync(abs, 'utf8'));
|
|
321
|
+
const format = resolveFormat(args);
|
|
322
|
+
let body;
|
|
323
|
+
if (format === 'json')
|
|
324
|
+
body = JSON.stringify(versioned('review', packet), null, 2) + '\n';
|
|
325
|
+
else if (format === 'html')
|
|
326
|
+
body = renderReviewHtml(packet, {
|
|
327
|
+
...(flagBool(args, 'collapse-long-sections') ? { collapseLongSections: true } : {}),
|
|
328
|
+
...(flagString(args, 'max-items') ? { maxItems: parseInt(flagString(args, 'max-items'), 10) } : {}),
|
|
329
|
+
});
|
|
330
|
+
else
|
|
331
|
+
body = renderReviewComment(packet, {});
|
|
332
|
+
return writeOrPrint(args, cwd, body);
|
|
333
|
+
}
|
|
334
|
+
async function reportCoverage(args) {
|
|
335
|
+
const cwd = resolveCwd(args);
|
|
336
|
+
const inspection = await inspectSharkcraft({ cwd });
|
|
337
|
+
const r = buildCoverageReport(inspection);
|
|
338
|
+
const format = resolveFormat(args);
|
|
339
|
+
let body;
|
|
340
|
+
if (format === 'json')
|
|
341
|
+
body = JSON.stringify(versioned('coverage', r), null, 2) + '\n';
|
|
342
|
+
else if (format === 'markdown')
|
|
343
|
+
body = renderCoverageMarkdown(r);
|
|
344
|
+
else if (format === 'html')
|
|
345
|
+
body = renderCoverageHtml(r);
|
|
346
|
+
else
|
|
347
|
+
body = renderCoverageText(r);
|
|
348
|
+
return writeOrPrint(args, cwd, body);
|
|
349
|
+
}
|
|
350
|
+
async function reportDrift(args) {
|
|
351
|
+
const cwd = resolveCwd(args);
|
|
352
|
+
const inspection = await inspectSharkcraft({ cwd });
|
|
353
|
+
const r = buildDriftReport(inspection);
|
|
354
|
+
const format = resolveFormat(args);
|
|
355
|
+
let body;
|
|
356
|
+
if (format === 'json')
|
|
357
|
+
body = JSON.stringify(versioned('drift', r), null, 2) + '\n';
|
|
358
|
+
else if (format === 'markdown')
|
|
359
|
+
body = renderDriftMarkdown(r);
|
|
360
|
+
else if (format === 'html')
|
|
361
|
+
body = renderDriftHtml(r);
|
|
362
|
+
else
|
|
363
|
+
body = renderDriftText(r);
|
|
364
|
+
return writeOrPrint(args, cwd, body);
|
|
365
|
+
}
|
|
366
|
+
async function reportImpact(args) {
|
|
367
|
+
const file = args.positional[0];
|
|
368
|
+
if (!file) {
|
|
369
|
+
process.stderr.write('Usage: shrk report impact <impact-report.json> [--format html|markdown|text|json] [--include-graph [--graph-format mermaid|dot]]\n');
|
|
370
|
+
return 2;
|
|
371
|
+
}
|
|
372
|
+
const cwd = resolveCwd(args);
|
|
373
|
+
const abs = nodePath.isAbsolute(file) ? file : nodePath.resolve(cwd, file);
|
|
374
|
+
if (!existsSync(abs)) {
|
|
375
|
+
process.stderr.write(`Impact report not found: ${abs}\n`);
|
|
376
|
+
return 1;
|
|
377
|
+
}
|
|
378
|
+
const impact = JSON.parse(readFileSync(abs, 'utf8'));
|
|
379
|
+
const format = resolveFormat(args, 'text');
|
|
380
|
+
let body;
|
|
381
|
+
if (format === 'json')
|
|
382
|
+
body = JSON.stringify(versioned('impact', impact), null, 2) + '\n';
|
|
383
|
+
else if (format === 'markdown')
|
|
384
|
+
body = renderImpactMarkdown(impact);
|
|
385
|
+
else if (format === 'html')
|
|
386
|
+
body = renderImpactHtml(impact);
|
|
387
|
+
else
|
|
388
|
+
body = renderImpactText(impact);
|
|
389
|
+
if (flagBool(args, 'include-graph')) {
|
|
390
|
+
const gfmt = (flagString(args, 'graph-format') ?? 'mermaid');
|
|
391
|
+
const graph = renderImpactGraph(impact, gfmt);
|
|
392
|
+
if (format === 'html') {
|
|
393
|
+
// Embed the graph source as preformatted text (no JS rendering).
|
|
394
|
+
const escaped = graph
|
|
395
|
+
.replace(/&/g, '&')
|
|
396
|
+
.replace(/</g, '<')
|
|
397
|
+
.replace(/>/g, '>');
|
|
398
|
+
body = body.replace(/<\/body>/i, `<h2>Dependency graph (${gfmt})</h2><pre>${escaped}</pre></body>`);
|
|
399
|
+
}
|
|
400
|
+
else if (format === 'markdown') {
|
|
401
|
+
body += `\n\n## Dependency graph (${gfmt})\n\n\`\`\`${gfmt}\n${graph}\`\`\`\n`;
|
|
402
|
+
}
|
|
403
|
+
else if (format !== 'json') {
|
|
404
|
+
body += `\n--- Dependency graph (${gfmt}) ---\n${graph}`;
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
return writeOrPrint(args, cwd, body);
|
|
408
|
+
}
|
|
409
|
+
async function reportGraph(args) {
|
|
410
|
+
const cwd = resolveCwd(args);
|
|
411
|
+
const inspection = await inspectSharkcraft({ cwd });
|
|
412
|
+
// We don't include the whole graph by default to keep the body sane;
|
|
413
|
+
// include counts + node-type breakdown.
|
|
414
|
+
const summary = {
|
|
415
|
+
nodes: {
|
|
416
|
+
knowledge: inspection.knowledgeEntries.length,
|
|
417
|
+
templates: inspection.templates.length,
|
|
418
|
+
pipelines: inspection.pipelines.length,
|
|
419
|
+
packs: inspection.packs.validPacks.length,
|
|
420
|
+
},
|
|
421
|
+
};
|
|
422
|
+
const format = resolveFormat(args);
|
|
423
|
+
let body;
|
|
424
|
+
if (format === 'json')
|
|
425
|
+
body = JSON.stringify(versioned('graph', summary), null, 2) + '\n';
|
|
426
|
+
else
|
|
427
|
+
body = JSON.stringify(summary, null, 2) + '\n';
|
|
428
|
+
return writeOrPrint(args, cwd, body);
|
|
429
|
+
}
|
|
430
|
+
function versioned(kind, payload) {
|
|
431
|
+
return {
|
|
432
|
+
schema: 'sharkcraft.runtime-report/v1',
|
|
433
|
+
reportKind: kind,
|
|
434
|
+
generatedAt: new Date().toISOString(),
|
|
435
|
+
payload,
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
// ─── Tiny text/markdown renderers used by the group ───────────────────────────
|
|
439
|
+
function renderQualityText(r) {
|
|
440
|
+
const out = [];
|
|
441
|
+
out.push('=== Quality report ===');
|
|
442
|
+
out.push(` overall ${r.overall}`);
|
|
443
|
+
out.push(` score ${r.score}`);
|
|
444
|
+
out.push(` blockers ${r.blockers}`);
|
|
445
|
+
out.push(` warnings ${r.warnings}`);
|
|
446
|
+
out.push('');
|
|
447
|
+
for (const g of r.gates) {
|
|
448
|
+
const tag = g.passed ? 'OK ' : g.blocking ? 'FAIL' : 'WARN';
|
|
449
|
+
out.push(` ${tag} ${g.id.padEnd(18)} ${g.label}`);
|
|
450
|
+
}
|
|
451
|
+
return out.join('\n') + '\n';
|
|
452
|
+
}
|
|
453
|
+
function renderSafetyText(audit) {
|
|
454
|
+
const out = [];
|
|
455
|
+
out.push('=== Safety audit ===');
|
|
456
|
+
out.push(` MCP anyWritable ${audit.mcp.anyWritable}`);
|
|
457
|
+
out.push(` writes-source ${audit.commands.writesSource.length}`);
|
|
458
|
+
out.push(` writes-drafts ${audit.commands.writesDrafts.length}`);
|
|
459
|
+
out.push(` writes-session ${audit.commands.writesSession.length}`);
|
|
460
|
+
out.push(` runs-shell ${audit.commands.runsShell.length}`);
|
|
461
|
+
out.push(` read-only ${audit.commands.readOnly.length}`);
|
|
462
|
+
out.push('');
|
|
463
|
+
if (audit.recommendations.length > 0) {
|
|
464
|
+
out.push('Recommendations:');
|
|
465
|
+
for (const r of audit.recommendations)
|
|
466
|
+
out.push(` - ${r}`);
|
|
467
|
+
}
|
|
468
|
+
return out.join('\n') + '\n';
|
|
469
|
+
}
|
|
470
|
+
function renderCoverageText(r) {
|
|
471
|
+
const counts = r.counts ?? {};
|
|
472
|
+
const out = ['=== Coverage ==='];
|
|
473
|
+
for (const [k, v] of Object.entries(counts))
|
|
474
|
+
out.push(` ${k.padEnd(22)} ${v}`);
|
|
475
|
+
return out.join('\n') + '\n';
|
|
476
|
+
}
|
|
477
|
+
function renderCoverageMarkdown(r) {
|
|
478
|
+
const counts = r.counts ?? {};
|
|
479
|
+
const lines = ['# Coverage', '', '| Axis | Count |', '|---|---|'];
|
|
480
|
+
for (const [k, v] of Object.entries(counts))
|
|
481
|
+
lines.push(`| \`${k}\` | ${v} |`);
|
|
482
|
+
return lines.join('\n') + '\n';
|
|
483
|
+
}
|
|
484
|
+
function renderCoverageHtml(r) {
|
|
485
|
+
return baseHtml('SharkCraft coverage', `<h1>Coverage</h1><pre>${JSON.stringify(r, null, 2)}</pre>`);
|
|
486
|
+
}
|
|
487
|
+
function renderDriftText(r) {
|
|
488
|
+
const counts = r.counts ?? {};
|
|
489
|
+
const out = ['=== Drift ==='];
|
|
490
|
+
for (const [k, v] of Object.entries(counts))
|
|
491
|
+
out.push(` ${k.padEnd(22)} ${v}`);
|
|
492
|
+
return out.join('\n') + '\n';
|
|
493
|
+
}
|
|
494
|
+
function renderDriftMarkdown(r) {
|
|
495
|
+
const counts = r.counts ?? {};
|
|
496
|
+
const lines = ['# Drift', '', '| Severity | Count |', '|---|---|'];
|
|
497
|
+
for (const [k, v] of Object.entries(counts))
|
|
498
|
+
lines.push(`| \`${k}\` | ${v} |`);
|
|
499
|
+
return lines.join('\n') + '\n';
|
|
500
|
+
}
|
|
501
|
+
function renderDriftHtml(r) {
|
|
502
|
+
return baseHtml('SharkCraft drift', `<h1>Drift</h1><pre>${escapeHtml(JSON.stringify(r, null, 2))}</pre>`);
|
|
503
|
+
}
|
|
504
|
+
function baseHtml(title, content) {
|
|
505
|
+
return `<!doctype html><html><head><meta charset="utf-8"><title>${escapeHtml(title)}</title>
|
|
506
|
+
<style>body{font-family:-apple-system,Segoe UI,Roboto,sans-serif;background:#0f1419;color:#e6e1cf;padding:2rem;line-height:1.55}pre{background:#1c2329;padding:.8rem;border-radius:.4rem;overflow-x:auto}h1{color:#bae67e}@media (prefers-color-scheme: light){body{background:#fafaf7;color:#1f2329}pre{background:#eee}}</style>
|
|
507
|
+
</head><body>${content}</body></html>\n`;
|
|
508
|
+
}
|
|
509
|
+
function escapeHtml(s) {
|
|
510
|
+
return s.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
|
511
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ICommandHandler } from '../command-registry.js';
|
|
2
|
+
export declare const reposetInitCommand: ICommandHandler;
|
|
3
|
+
export declare const reposetListCommand: ICommandHandler;
|
|
4
|
+
export declare const reposetDoctorCommand: ICommandHandler;
|
|
5
|
+
export declare const reposetMapCommand: ICommandHandler;
|
|
6
|
+
//# sourceMappingURL=reposet.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reposet.command.d.ts","sourceRoot":"","sources":["../../src/commands/reposet.command.ts"],"names":[],"mappings":"AAQA,OAAO,EAIL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AA8BhC,eAAO,MAAM,kBAAkB,EAAE,eAoBhC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,eAehC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,eAyBlC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,eA2B/B,CAAC"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import * as nodePath from 'node:path';
|
|
3
|
+
import { buildReposetMap, loadReposetConfig, previewReposetInit, renderReposetMapText, } from '@shrkcrft/inspector';
|
|
4
|
+
import { flagBool, flagString, resolveCwd, } from "../command-registry.js";
|
|
5
|
+
import { asJson } from "../output/format-output.js";
|
|
6
|
+
function requireConfig(cwd, opts) {
|
|
7
|
+
const cfg = loadReposetConfig(cwd);
|
|
8
|
+
if (!cfg) {
|
|
9
|
+
if (opts?.json) {
|
|
10
|
+
// Emit a structured JSON envelope on stdout so callers that
|
|
11
|
+
// pass `--json` always get parseable output, even on misconfiguration.
|
|
12
|
+
process.stdout.write(asJson({
|
|
13
|
+
ok: false,
|
|
14
|
+
error: 'reposet-config-missing',
|
|
15
|
+
message: 'No reposet config found.',
|
|
16
|
+
hint: 'Run `shrk reposet init --dry-run` to preview a starter file.',
|
|
17
|
+
}) + '\n');
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
process.stderr.write('No reposet config found. Run `shrk reposet init --dry-run` to preview a starter file.\n');
|
|
21
|
+
}
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
return cfg;
|
|
25
|
+
}
|
|
26
|
+
export const reposetInitCommand = {
|
|
27
|
+
name: 'init',
|
|
28
|
+
description: 'Preview a reposet starter config (sharkcraft.reposet.json). Dry-run by default.',
|
|
29
|
+
usage: 'shrk reposet init [--write] [--dry-run]',
|
|
30
|
+
async run(args) {
|
|
31
|
+
const cwd = resolveCwd(args);
|
|
32
|
+
const preview = previewReposetInit(cwd);
|
|
33
|
+
if (flagBool(args, 'write')) {
|
|
34
|
+
if (existsSync(preview.targetPath)) {
|
|
35
|
+
process.stderr.write(`Refusing to overwrite ${preview.targetPath}\n`);
|
|
36
|
+
return 1;
|
|
37
|
+
}
|
|
38
|
+
mkdirSync(nodePath.dirname(preview.targetPath), { recursive: true });
|
|
39
|
+
writeFileSync(preview.targetPath, preview.body, 'utf8');
|
|
40
|
+
process.stdout.write(`Wrote ${preview.targetPath}\n`);
|
|
41
|
+
return 0;
|
|
42
|
+
}
|
|
43
|
+
process.stdout.write(`# Dry-run — would write ${preview.targetPath}\n${preview.body}\n`);
|
|
44
|
+
return 0;
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
export const reposetListCommand = {
|
|
48
|
+
name: 'list',
|
|
49
|
+
description: 'List repos in the local reposet config.',
|
|
50
|
+
usage: 'shrk reposet list [--json]',
|
|
51
|
+
async run(args) {
|
|
52
|
+
const cwd = resolveCwd(args);
|
|
53
|
+
const cfg = requireConfig(cwd);
|
|
54
|
+
if (!cfg)
|
|
55
|
+
return 1;
|
|
56
|
+
if (flagBool(args, 'json')) {
|
|
57
|
+
process.stdout.write(asJson(cfg) + '\n');
|
|
58
|
+
return 0;
|
|
59
|
+
}
|
|
60
|
+
for (const r of cfg.repos)
|
|
61
|
+
process.stdout.write(`${r.id.padEnd(20)} ${r.role.padEnd(12)} ${r.root}\n`);
|
|
62
|
+
return 0;
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
export const reposetDoctorCommand = {
|
|
66
|
+
name: 'doctor',
|
|
67
|
+
description: 'Sanity-check the reposet: every root exists.',
|
|
68
|
+
usage: 'shrk reposet doctor [--parallel] [--concurrency <n>] [--json]',
|
|
69
|
+
async run(args) {
|
|
70
|
+
const cwd = resolveCwd(args);
|
|
71
|
+
const wantJson = flagBool(args, 'json');
|
|
72
|
+
const cfg = requireConfig(cwd, { json: wantJson });
|
|
73
|
+
if (!cfg)
|
|
74
|
+
return 1;
|
|
75
|
+
const parallel = flagBool(args, 'parallel');
|
|
76
|
+
const concurrency = Number(flagString(args, 'concurrency') ?? '4');
|
|
77
|
+
const map = await buildReposetMap(cfg, { parallel, concurrency });
|
|
78
|
+
const missing = map.repos.filter((r) => !r.exists);
|
|
79
|
+
if (wantJson) {
|
|
80
|
+
process.stdout.write(asJson({ ok: missing.length === 0, missing }) + '\n');
|
|
81
|
+
return missing.length === 0 ? 0 : 1;
|
|
82
|
+
}
|
|
83
|
+
process.stdout.write(renderReposetMapText(map));
|
|
84
|
+
if (missing.length === 0) {
|
|
85
|
+
process.stdout.write('All repos present.\n');
|
|
86
|
+
return 0;
|
|
87
|
+
}
|
|
88
|
+
process.stdout.write(`${missing.length} repo(s) missing.\n`);
|
|
89
|
+
return 1;
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
export const reposetMapCommand = {
|
|
93
|
+
name: 'map',
|
|
94
|
+
description: 'Aggregate map across the reposet — read-only.',
|
|
95
|
+
usage: 'shrk reposet map [--parallel] [--concurrency <n>] [--json] [--output <file>]',
|
|
96
|
+
async run(args) {
|
|
97
|
+
const cwd = resolveCwd(args);
|
|
98
|
+
const cfg = requireConfig(cwd);
|
|
99
|
+
if (!cfg)
|
|
100
|
+
return 1;
|
|
101
|
+
const parallel = flagBool(args, 'parallel');
|
|
102
|
+
const concurrency = Number(flagString(args, 'concurrency') ?? '4');
|
|
103
|
+
const map = await buildReposetMap(cfg, { parallel, concurrency });
|
|
104
|
+
if (flagBool(args, 'json')) {
|
|
105
|
+
process.stdout.write(asJson(map) + '\n');
|
|
106
|
+
return 0;
|
|
107
|
+
}
|
|
108
|
+
const output = flagString(args, 'output');
|
|
109
|
+
const body = renderReposetMapText(map);
|
|
110
|
+
if (output) {
|
|
111
|
+
const abs = nodePath.isAbsolute(output) ? output : nodePath.resolve(cwd, output);
|
|
112
|
+
mkdirSync(nodePath.dirname(abs), { recursive: true });
|
|
113
|
+
writeFileSync(abs, body, 'utf8');
|
|
114
|
+
process.stdout.write(`Wrote ${abs}\n`);
|
|
115
|
+
return 0;
|
|
116
|
+
}
|
|
117
|
+
process.stdout.write(body);
|
|
118
|
+
return 0;
|
|
119
|
+
},
|
|
120
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review.command.d.ts","sourceRoot":"","sources":["../../src/commands/review.command.ts"],"names":[],"mappings":"AAgBA,OAAO,EAML,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AA6GhC,eAAO,MAAM,aAAa,EAAE,eA+E3B,CAAC"}
|