@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,350 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import * as nodePath from 'node:path';
|
|
3
|
+
import { inspectSharkcraft } from '@shrkcrft/inspector';
|
|
4
|
+
import { flagBool, flagString, resolveCwd, } from "../command-registry.js";
|
|
5
|
+
import { asJson, header } from "../output/format-output.js";
|
|
6
|
+
/**
|
|
7
|
+
* Biome bridge. Biome's rule grammar is narrower than ESLint's, so this
|
|
8
|
+
* adapter is intentionally smaller: scaffold a `biome.sharkcraft.json` that
|
|
9
|
+
* ignores any generated paths SharkCraft tracks, and documents which
|
|
10
|
+
* SharkCraft rules Biome cannot express (so the user knows to keep
|
|
11
|
+
* `shrk check boundaries` in CI for those).
|
|
12
|
+
*/
|
|
13
|
+
const SCAFFOLD_DEFAULT_RELPATH = 'biome.sharkcraft.json';
|
|
14
|
+
function renderBiomeSnippet(generatedGlobs) {
|
|
15
|
+
const ignored = generatedGlobs.length > 0 ? generatedGlobs : ['**/dist/**', '**/build/**'];
|
|
16
|
+
const config = {
|
|
17
|
+
$schema: 'https://biomejs.dev/schemas/1.9.0/schema.json',
|
|
18
|
+
organizeImports: { enabled: true },
|
|
19
|
+
formatter: { enabled: true },
|
|
20
|
+
linter: {
|
|
21
|
+
enabled: true,
|
|
22
|
+
rules: { recommended: true },
|
|
23
|
+
},
|
|
24
|
+
// Generated paths SharkCraft tracks — Biome should skip them.
|
|
25
|
+
files: { ignore: ignored },
|
|
26
|
+
};
|
|
27
|
+
return JSON.stringify(config, null, 2) + '\n';
|
|
28
|
+
}
|
|
29
|
+
const BIOME_NOTES = `\
|
|
30
|
+
# Biome bridge — limitations
|
|
31
|
+
|
|
32
|
+
Biome cannot express SharkCraft's cross-layer / cross-package boundary
|
|
33
|
+
rules. Keep \`shrk check boundaries\` in CI for those.
|
|
34
|
+
|
|
35
|
+
Run on every PR:
|
|
36
|
+
$ shrk check boundaries --changed-only --json > boundaries.json
|
|
37
|
+
$ shrk ci scaffold github-actions --quickstart # one-flag setup
|
|
38
|
+
`;
|
|
39
|
+
export const biomeScaffoldCommand = {
|
|
40
|
+
name: 'scaffold',
|
|
41
|
+
description: 'Scaffold a minimal Biome config that ignores SharkCraft generated paths. Documents which SharkCraft rules Biome cannot express. Dry-run by default; `--write` persists.',
|
|
42
|
+
usage: 'shrk biome scaffold [--output <path>] [--preset auto] [--write] [--force] [--json]',
|
|
43
|
+
async run(args) {
|
|
44
|
+
const cwd = resolveCwd(args);
|
|
45
|
+
const presetMode = flagString(args, 'preset');
|
|
46
|
+
if (presetMode && presetMode !== 'auto') {
|
|
47
|
+
process.stderr.write(`Unknown --preset value "${presetMode}" (only "auto" is supported).\n`);
|
|
48
|
+
return 2;
|
|
49
|
+
}
|
|
50
|
+
let generatedGlobs = [];
|
|
51
|
+
try {
|
|
52
|
+
const inspection = await inspectSharkcraft({ cwd });
|
|
53
|
+
const pathList = inspection.pathService.list();
|
|
54
|
+
generatedGlobs = pathList
|
|
55
|
+
.filter((p) => p.tags?.some((t) => /generated|build|dist|output/i.test(t)))
|
|
56
|
+
.map((p) => (typeof p.metadata?.path === 'string' ? p.metadata.path : null))
|
|
57
|
+
.filter((g) => typeof g === 'string' && g.length > 0);
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
// best-effort — the scaffold still works without sharkcraft/.
|
|
61
|
+
}
|
|
62
|
+
const body = renderBiomeSnippet(generatedGlobs);
|
|
63
|
+
const outputRel = flagString(args, 'output') ?? SCAFFOLD_DEFAULT_RELPATH;
|
|
64
|
+
const outputAbs = nodePath.isAbsolute(outputRel) ? outputRel : nodePath.join(cwd, outputRel);
|
|
65
|
+
if (flagBool(args, 'json')) {
|
|
66
|
+
const mode = flagBool(args, 'write') ? 'write' : 'dry-run';
|
|
67
|
+
process.stdout.write(asJson({ mode, output: outputAbs, bytes: body.length, body }) + '\n');
|
|
68
|
+
if (mode !== 'write')
|
|
69
|
+
return 0;
|
|
70
|
+
}
|
|
71
|
+
if (!flagBool(args, 'write')) {
|
|
72
|
+
process.stdout.write(header('Biome scaffold — dry-run'));
|
|
73
|
+
process.stdout.write(`output: ${outputAbs}\n`);
|
|
74
|
+
process.stdout.write(`bytes: ${body.length}\n\n`);
|
|
75
|
+
process.stdout.write(body);
|
|
76
|
+
process.stdout.write('\n' + BIOME_NOTES);
|
|
77
|
+
process.stdout.write('\nRun with --write to persist.\n');
|
|
78
|
+
return 0;
|
|
79
|
+
}
|
|
80
|
+
if (existsSync(outputAbs) && !flagBool(args, 'force')) {
|
|
81
|
+
process.stderr.write(`Refusing to overwrite existing file: ${outputAbs}. Pass --force.\n`);
|
|
82
|
+
return 1;
|
|
83
|
+
}
|
|
84
|
+
mkdirSync(nodePath.dirname(outputAbs), { recursive: true });
|
|
85
|
+
writeFileSync(outputAbs, body, 'utf8');
|
|
86
|
+
process.stdout.write(`Wrote ${outputAbs}\n${BIOME_NOTES}`);
|
|
87
|
+
return 0;
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
export const biomeReportCommand = {
|
|
91
|
+
name: 'report',
|
|
92
|
+
description: 'Convert `shrk check boundaries --json` output to a Biome-adjacent diagnostics JSON shape. Biome cannot natively consume this, but Biome-result-consuming tooling can.',
|
|
93
|
+
usage: 'shrk biome report [--from <path>] [--output <path>] [--json]',
|
|
94
|
+
async run(args) {
|
|
95
|
+
const cwd = resolveCwd(args);
|
|
96
|
+
const from = flagString(args, 'from');
|
|
97
|
+
const fromAbs = from
|
|
98
|
+
? nodePath.isAbsolute(from)
|
|
99
|
+
? from
|
|
100
|
+
: nodePath.join(cwd, from)
|
|
101
|
+
: null;
|
|
102
|
+
if (!fromAbs) {
|
|
103
|
+
process.stderr.write('No --from <boundary-report.json> passed. Generate one first:\n' +
|
|
104
|
+
' $ shrk check boundaries --json > boundaries.json\n' +
|
|
105
|
+
' $ shrk biome report --from boundaries.json > biome-adjacent.json\n');
|
|
106
|
+
return 2;
|
|
107
|
+
}
|
|
108
|
+
if (!existsSync(fromAbs)) {
|
|
109
|
+
process.stderr.write(`--from file not found: ${fromAbs}\n`);
|
|
110
|
+
return 1;
|
|
111
|
+
}
|
|
112
|
+
let report;
|
|
113
|
+
try {
|
|
114
|
+
report = JSON.parse(readFileSync(fromAbs, 'utf8'));
|
|
115
|
+
}
|
|
116
|
+
catch (e) {
|
|
117
|
+
process.stderr.write(`Failed to parse boundary report JSON: ${e.message}\n`);
|
|
118
|
+
return 1;
|
|
119
|
+
}
|
|
120
|
+
const out = [];
|
|
121
|
+
for (const v of report.violations ?? []) {
|
|
122
|
+
const path = v.file ?? '<unknown>';
|
|
123
|
+
const diag = {
|
|
124
|
+
category: 'sharkcraft/boundary-violation',
|
|
125
|
+
severity: 'error',
|
|
126
|
+
location: { path: nodePath.isAbsolute(path) ? path : nodePath.join(cwd, path) },
|
|
127
|
+
description: (v.reason ?? 'SharkCraft boundary violation') +
|
|
128
|
+
(v.source && v.target ? ` (${v.source} → ${v.target})` : ''),
|
|
129
|
+
source: 'sharkcraft',
|
|
130
|
+
};
|
|
131
|
+
if (typeof v.line === 'number')
|
|
132
|
+
diag.location.line = v.line;
|
|
133
|
+
if (typeof v.column === 'number')
|
|
134
|
+
diag.location.column = v.column;
|
|
135
|
+
out.push(diag);
|
|
136
|
+
}
|
|
137
|
+
const text = asJson({
|
|
138
|
+
schema: 'sharkcraft.biome-adjacent/v1',
|
|
139
|
+
tool: 'sharkcraft',
|
|
140
|
+
generatedAt: new Date().toISOString(),
|
|
141
|
+
diagnostics: out,
|
|
142
|
+
note: 'Adjacent to Biome — not native Biome output. See `shrk biome explain-limitations`.',
|
|
143
|
+
}) + '\n';
|
|
144
|
+
const outputRel = flagString(args, 'output');
|
|
145
|
+
if (outputRel) {
|
|
146
|
+
const outputAbs = nodePath.isAbsolute(outputRel) ? outputRel : nodePath.join(cwd, outputRel);
|
|
147
|
+
mkdirSync(nodePath.dirname(outputAbs), { recursive: true });
|
|
148
|
+
writeFileSync(outputAbs, text, 'utf8');
|
|
149
|
+
process.stdout.write(`Wrote ${outputAbs}\n`);
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
process.stdout.write(text);
|
|
153
|
+
}
|
|
154
|
+
return out.length > 0 ? 1 : 0;
|
|
155
|
+
},
|
|
156
|
+
};
|
|
157
|
+
const BIOME_LIMITATIONS = `\
|
|
158
|
+
# Biome bridge — limitations
|
|
159
|
+
|
|
160
|
+
What the bridge **can** do today:
|
|
161
|
+
|
|
162
|
+
• \`shrk biome scaffold\` — emit a minimal biome.json that ignores
|
|
163
|
+
SharkCraft generated paths and lists the SharkCraft rules Biome
|
|
164
|
+
cannot express.
|
|
165
|
+
• \`shrk biome report\` — convert \`shrk check boundaries --json\`
|
|
166
|
+
output to a Biome-adjacent diagnostics shape that Biome-result-
|
|
167
|
+
consuming tooling can ingest. **Not native Biome output** — Biome
|
|
168
|
+
has no public custom-rule plugin surface today.
|
|
169
|
+
|
|
170
|
+
What the bridge **cannot** express in Biome:
|
|
171
|
+
|
|
172
|
+
• All cross-layer / cross-package boundary rules. Biome's lint
|
|
173
|
+
grammar is narrower than ESLint's.
|
|
174
|
+
• Plan safety, pack signatures, knowledge stale-check, template
|
|
175
|
+
drift, self-config doctor. None of these have a Biome analog.
|
|
176
|
+
• Custom SharkCraft rules with action hints.
|
|
177
|
+
|
|
178
|
+
Recommendation: use Biome for fast file-local linting / formatting;
|
|
179
|
+
keep \`shrk doctor\`, \`shrk check boundaries\`, \`shrk safety audit\`
|
|
180
|
+
in CI.
|
|
181
|
+
|
|
182
|
+
If you need a single tool to ingest SharkCraft findings, prefer
|
|
183
|
+
\`shrk eslint report\` (native ESLint result format) or
|
|
184
|
+
\`shrk checks aggregate\` (universal protocol). The Biome adjacent
|
|
185
|
+
report is a fallback for repos that have standardized on Biome and
|
|
186
|
+
don't want to add ESLint just for SharkCraft.
|
|
187
|
+
`;
|
|
188
|
+
function buildBiomeBridgeInventory(rules, paths) {
|
|
189
|
+
const rows = [];
|
|
190
|
+
for (const r of rules) {
|
|
191
|
+
const tagText = (r.tags ?? []).join(' ').toLowerCase();
|
|
192
|
+
let status = 'not-bridgeable';
|
|
193
|
+
let notes = 'No Biome analog — keep in `shrk doctor` / `shrk check boundaries`.';
|
|
194
|
+
if (tagText.includes('format') || tagText.includes('style') || tagText.includes('naming')) {
|
|
195
|
+
status = 'bridgeable';
|
|
196
|
+
notes = "Likely covered by Biome's built-in linter/formatter recommended rules.";
|
|
197
|
+
}
|
|
198
|
+
else if (tagText.includes('import') || tagText.includes('boundary') || tagText.includes('layer')) {
|
|
199
|
+
status = 'adjacent';
|
|
200
|
+
notes = 'Adjacent — `shrk biome report` re-emits boundary findings; Biome itself cannot enforce.';
|
|
201
|
+
}
|
|
202
|
+
else if (tagText.includes('safety') || tagText.includes('signing') || tagText.includes('plan') || tagText.includes('pack')) {
|
|
203
|
+
status = 'not-bridgeable';
|
|
204
|
+
notes = 'Plan / pack / signing semantics — Biome has no concept.';
|
|
205
|
+
}
|
|
206
|
+
rows.push({ kind: 'rule', id: r.id, status, notes });
|
|
207
|
+
}
|
|
208
|
+
for (const p of paths) {
|
|
209
|
+
const tagText = (p.tags ?? []).join(' ').toLowerCase();
|
|
210
|
+
const isGenerated = /generated|build|dist|output/.test(tagText);
|
|
211
|
+
rows.push({
|
|
212
|
+
kind: 'path',
|
|
213
|
+
id: p.id,
|
|
214
|
+
status: isGenerated ? 'bridgeable' : 'adjacent',
|
|
215
|
+
notes: isGenerated
|
|
216
|
+
? "Goes in biome.json `files.ignore`."
|
|
217
|
+
: 'Adjacent: SharkCraft surfaces for context; not directly enforceable.',
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
rows.push({
|
|
221
|
+
kind: 'boundary',
|
|
222
|
+
id: 'check-boundaries',
|
|
223
|
+
status: 'adjacent',
|
|
224
|
+
notes: '`shrk biome report` emits Biome-adjacent diagnostics; Biome cannot enforce.',
|
|
225
|
+
});
|
|
226
|
+
rows.push({
|
|
227
|
+
kind: 'safety',
|
|
228
|
+
id: 'plan-signing / pack-signatures / knowledge-stale / template-drift / self-config',
|
|
229
|
+
status: 'not-bridgeable',
|
|
230
|
+
notes: 'CI gate only — Biome has no semantic for any of these.',
|
|
231
|
+
});
|
|
232
|
+
return rows;
|
|
233
|
+
}
|
|
234
|
+
export const biomeRulesCommand = {
|
|
235
|
+
name: 'rules',
|
|
236
|
+
description: 'Inventory which SharkCraft constructs can be bridged to Biome (bridgeable / adjacent / not-bridgeable). Read-only.',
|
|
237
|
+
usage: 'shrk biome rules [--json] [--filter bridgeable|adjacent|not-bridgeable]',
|
|
238
|
+
async run(args) {
|
|
239
|
+
const cwd = resolveCwd(args);
|
|
240
|
+
let rules = [];
|
|
241
|
+
let paths = [];
|
|
242
|
+
try {
|
|
243
|
+
const inspection = await inspectSharkcraft({ cwd });
|
|
244
|
+
rules = inspection.ruleService.list().map((r) => ({ id: r.id, tags: r.tags ?? [] }));
|
|
245
|
+
paths = inspection.pathService.list().map((p) => ({ id: p.id, tags: p.tags ?? [] }));
|
|
246
|
+
}
|
|
247
|
+
catch {
|
|
248
|
+
// best-effort
|
|
249
|
+
}
|
|
250
|
+
const inventory = buildBiomeBridgeInventory(rules, paths);
|
|
251
|
+
const filter = flagString(args, 'filter');
|
|
252
|
+
const filtered = filter ? inventory.filter((r) => r.status === filter) : inventory;
|
|
253
|
+
if (flagBool(args, 'json')) {
|
|
254
|
+
process.stdout.write(asJson({ total: inventory.length, rows: filtered }) + '\n');
|
|
255
|
+
return 0;
|
|
256
|
+
}
|
|
257
|
+
process.stdout.write(header(`Biome bridge inventory (${filtered.length} of ${inventory.length})`));
|
|
258
|
+
const buckets = {
|
|
259
|
+
bridgeable: [],
|
|
260
|
+
adjacent: [],
|
|
261
|
+
'not-bridgeable': [],
|
|
262
|
+
};
|
|
263
|
+
for (const r of filtered)
|
|
264
|
+
buckets[r.status].push(r);
|
|
265
|
+
for (const status of ['bridgeable', 'adjacent', 'not-bridgeable']) {
|
|
266
|
+
const rows = buckets[status];
|
|
267
|
+
if (!rows.length)
|
|
268
|
+
continue;
|
|
269
|
+
process.stdout.write(`\n[${status}] ${rows.length}\n`);
|
|
270
|
+
for (const r of rows) {
|
|
271
|
+
process.stdout.write(` ${r.kind.padEnd(9)} ${r.id}\n`);
|
|
272
|
+
process.stdout.write(` ${r.notes}\n`);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
process.stdout.write('\nKeep in CI: `shrk check boundaries`, `shrk safety audit`, `shrk packs doctor`, `shrk knowledge stale-check`, `shrk templates drift`.\n');
|
|
276
|
+
return 0;
|
|
277
|
+
},
|
|
278
|
+
};
|
|
279
|
+
export const biomeExplainLimitationsCommand = {
|
|
280
|
+
name: 'explain-limitations',
|
|
281
|
+
description: 'Print the honest list of what cannot be bridged from SharkCraft to Biome and what to keep in CI.',
|
|
282
|
+
usage: 'shrk biome explain-limitations [--json]',
|
|
283
|
+
async run(args) {
|
|
284
|
+
if (flagBool(args, 'json')) {
|
|
285
|
+
process.stdout.write(asJson({
|
|
286
|
+
bridgeable: [
|
|
287
|
+
'generated path ignores',
|
|
288
|
+
'formatter / organizeImports defaults',
|
|
289
|
+
],
|
|
290
|
+
adjacent: [
|
|
291
|
+
'shrk check boundaries (via `shrk biome report`, non-native shape)',
|
|
292
|
+
],
|
|
293
|
+
notBridgeable: [
|
|
294
|
+
'cross-layer boundary rules',
|
|
295
|
+
'plan signing',
|
|
296
|
+
'pack signatures',
|
|
297
|
+
'knowledge stale-check',
|
|
298
|
+
'template drift',
|
|
299
|
+
'self-config doctor',
|
|
300
|
+
'custom SharkCraft rules with action hints',
|
|
301
|
+
],
|
|
302
|
+
keepInCi: [
|
|
303
|
+
'shrk doctor',
|
|
304
|
+
'shrk check boundaries',
|
|
305
|
+
'shrk safety audit',
|
|
306
|
+
'shrk packs doctor',
|
|
307
|
+
'shrk knowledge stale-check',
|
|
308
|
+
'shrk templates drift',
|
|
309
|
+
],
|
|
310
|
+
}) + '\n');
|
|
311
|
+
return 0;
|
|
312
|
+
}
|
|
313
|
+
process.stdout.write(BIOME_LIMITATIONS);
|
|
314
|
+
return 0;
|
|
315
|
+
},
|
|
316
|
+
};
|
|
317
|
+
export const biomeCommand = {
|
|
318
|
+
name: 'biome',
|
|
319
|
+
description: 'Biome bridge. `scaffold` emits a minimal biome.json that ignores SharkCraft generated paths; `report` converts boundary JSON to a Biome-adjacent diagnostics shape; `rules` inventories what can be bridged; `explain-limitations` documents what cannot. `config` is an alias for `scaffold`.',
|
|
320
|
+
usage: 'shrk biome <scaffold|config|report|rules|explain-limitations> [...flags]',
|
|
321
|
+
async run(args) {
|
|
322
|
+
const verb = args.positional[0];
|
|
323
|
+
if (verb === 'scaffold' || verb === 'config') {
|
|
324
|
+
return biomeScaffoldCommand.run({
|
|
325
|
+
...args,
|
|
326
|
+
positional: args.positional.slice(1),
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
if (verb === 'report') {
|
|
330
|
+
return biomeReportCommand.run({
|
|
331
|
+
...args,
|
|
332
|
+
positional: args.positional.slice(1),
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
if (verb === 'rules') {
|
|
336
|
+
return biomeRulesCommand.run({
|
|
337
|
+
...args,
|
|
338
|
+
positional: args.positional.slice(1),
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
if (verb === 'explain-limitations') {
|
|
342
|
+
return biomeExplainLimitationsCommand.run({
|
|
343
|
+
...args,
|
|
344
|
+
positional: args.positional.slice(1),
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
process.stderr.write('Usage: shrk biome <scaffold|config|report|rules|explain-limitations> [...flags]\n');
|
|
348
|
+
return 2;
|
|
349
|
+
},
|
|
350
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ICommandHandler } from '../command-registry.js';
|
|
2
|
+
export declare const boundariesListCommand: ICommandHandler;
|
|
3
|
+
export declare const boundariesGetCommand: ICommandHandler;
|
|
4
|
+
export declare const boundariesExplainCommand: ICommandHandler;
|
|
5
|
+
export declare const boundariesInferCommand: ICommandHandler;
|
|
6
|
+
/** Polyglot enforcement subcommand. */
|
|
7
|
+
export declare const boundariesEnforceCommand: ICommandHandler;
|
|
8
|
+
export declare const boundariesSuggestCommand: ICommandHandler;
|
|
9
|
+
//# sourceMappingURL=boundaries.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boundaries.command.d.ts","sourceRoot":"","sources":["../../src/commands/boundaries.command.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAwB,KAAK,eAAe,EAA+B,MAAM,wBAAwB,CAAC;AAGjH,eAAO,MAAM,qBAAqB,EAAE,eAuBnC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,eAqClC,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,eAmDtC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,eAyEpC,CAAC;AAsCF,uCAAuC;AACvC,eAAO,MAAM,wBAAwB,EAAE,eAqEtC,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,eA0CtC,CAAC"}
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
import { mkdirSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import * as nodePath from 'node:path';
|
|
3
|
+
import { buildOnboardingPlan, buildPolyglotBoundaryReport, inspectSharkcraft, renderPolyglotBoundaryReportMarkdown, renderPolyglotBoundaryReportText, suggestBoundaryFixes, } from '@shrkcrft/inspector';
|
|
4
|
+
import { evaluateBoundaries, loadTsconfigPaths, scanImports, } from '@shrkcrft/boundaries';
|
|
5
|
+
import { flagBool, flagString, resolveCwd } from "../command-registry.js";
|
|
6
|
+
import { asJson, header, kv } from "../output/format-output.js";
|
|
7
|
+
export const boundariesListCommand = {
|
|
8
|
+
name: 'list',
|
|
9
|
+
description: 'List all registered boundary rules (local + pack-contributed).',
|
|
10
|
+
usage: 'shrk [--cwd <dir>] boundaries list [--json]',
|
|
11
|
+
async run(args) {
|
|
12
|
+
const inspection = await inspectSharkcraft({ cwd: resolveCwd(args) });
|
|
13
|
+
const rules = inspection.boundaryRegistry.list();
|
|
14
|
+
if (flagBool(args, 'json')) {
|
|
15
|
+
process.stdout.write(asJson(rules) + '\n');
|
|
16
|
+
return 0;
|
|
17
|
+
}
|
|
18
|
+
process.stdout.write(header(`Boundary rules (${rules.length})`));
|
|
19
|
+
if (rules.length === 0) {
|
|
20
|
+
process.stdout.write(' (none registered)\n');
|
|
21
|
+
return 0;
|
|
22
|
+
}
|
|
23
|
+
for (const r of rules) {
|
|
24
|
+
process.stdout.write(` ${(r.severity ?? 'warning').toUpperCase().padEnd(8)} ${r.id.padEnd(36)} ${r.title}\n`);
|
|
25
|
+
}
|
|
26
|
+
return 0;
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
export const boundariesGetCommand = {
|
|
30
|
+
name: 'get',
|
|
31
|
+
description: 'Show one boundary rule (by id) in full.',
|
|
32
|
+
usage: 'shrk [--cwd <dir>] boundaries get <ruleId> [--json]',
|
|
33
|
+
async run(args) {
|
|
34
|
+
const id = args.positional[0];
|
|
35
|
+
if (!id) {
|
|
36
|
+
process.stderr.write('Usage: shrk boundaries get <ruleId>\n');
|
|
37
|
+
return 2;
|
|
38
|
+
}
|
|
39
|
+
const inspection = await inspectSharkcraft({ cwd: resolveCwd(args) });
|
|
40
|
+
const rule = inspection.boundaryRegistry.get(id);
|
|
41
|
+
if (!rule) {
|
|
42
|
+
process.stderr.write(`No boundary rule with id "${id}".\n`);
|
|
43
|
+
return 1;
|
|
44
|
+
}
|
|
45
|
+
if (flagBool(args, 'json')) {
|
|
46
|
+
process.stdout.write(asJson(rule) + '\n');
|
|
47
|
+
return 0;
|
|
48
|
+
}
|
|
49
|
+
process.stdout.write(header(`Boundary rule: ${rule.id}`));
|
|
50
|
+
process.stdout.write(kv('title', rule.title) + '\n');
|
|
51
|
+
process.stdout.write(kv('severity', rule.severity ?? 'warning') + '\n');
|
|
52
|
+
if (rule.from && rule.from.length > 0) {
|
|
53
|
+
process.stdout.write(kv('from', rule.from.join(', ')) + '\n');
|
|
54
|
+
}
|
|
55
|
+
if (rule.forbiddenImports && rule.forbiddenImports.length > 0) {
|
|
56
|
+
process.stdout.write(kv('forbidden', rule.forbiddenImports.join(', ')) + '\n');
|
|
57
|
+
}
|
|
58
|
+
if (rule.allowedImports && rule.allowedImports.length > 0) {
|
|
59
|
+
process.stdout.write(kv('allowed', rule.allowedImports.join(', ')) + '\n');
|
|
60
|
+
}
|
|
61
|
+
if (rule.suggestedFix) {
|
|
62
|
+
process.stdout.write(kv('suggestedFix', rule.suggestedFix) + '\n');
|
|
63
|
+
}
|
|
64
|
+
return 0;
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
export const boundariesExplainCommand = {
|
|
68
|
+
name: 'explain',
|
|
69
|
+
description: 'Explain a boundary rule: where it came from (local vs pack), what it forbids, what to do about violations.',
|
|
70
|
+
usage: 'shrk [--cwd <dir>] boundaries explain <ruleId> [--json]',
|
|
71
|
+
async run(args) {
|
|
72
|
+
const id = args.positional[0];
|
|
73
|
+
if (!id) {
|
|
74
|
+
process.stderr.write('Usage: shrk boundaries explain <ruleId>\n');
|
|
75
|
+
return 2;
|
|
76
|
+
}
|
|
77
|
+
const inspection = await inspectSharkcraft({ cwd: resolveCwd(args) });
|
|
78
|
+
const rule = inspection.boundaryRegistry.get(id);
|
|
79
|
+
if (!rule) {
|
|
80
|
+
process.stderr.write(`No boundary rule with id "${id}".\n`);
|
|
81
|
+
return 1;
|
|
82
|
+
}
|
|
83
|
+
const source = inspection.boundarySources.get(id);
|
|
84
|
+
const explanation = {
|
|
85
|
+
id: rule.id,
|
|
86
|
+
title: rule.title,
|
|
87
|
+
severity: rule.severity ?? 'warning',
|
|
88
|
+
origin: source ? (source.type === 'pack' ? `pack: ${source.packageName}` : 'local') : 'unknown',
|
|
89
|
+
from: rule.from ?? [],
|
|
90
|
+
forbiddenImports: rule.forbiddenImports ?? [],
|
|
91
|
+
allowedImports: rule.allowedImports ?? [],
|
|
92
|
+
suggestedFix: rule.suggestedFix,
|
|
93
|
+
howToFix: 'Adjust the offending import to either (a) drop the disallowed dependency, (b) use a public interface from the allowed list, or (c) move the importer into a layer where this dependency is permitted.',
|
|
94
|
+
};
|
|
95
|
+
if (flagBool(args, 'json')) {
|
|
96
|
+
process.stdout.write(asJson(explanation) + '\n');
|
|
97
|
+
return 0;
|
|
98
|
+
}
|
|
99
|
+
process.stdout.write(header(`Boundary explain: ${rule.id}`));
|
|
100
|
+
process.stdout.write(kv('title', rule.title) + '\n');
|
|
101
|
+
process.stdout.write(kv('severity', rule.severity ?? 'warning') + '\n');
|
|
102
|
+
process.stdout.write(kv('origin', explanation.origin) + '\n');
|
|
103
|
+
if (explanation.from.length > 0) {
|
|
104
|
+
process.stdout.write(kv('applies to', explanation.from.join(', ')) + '\n');
|
|
105
|
+
}
|
|
106
|
+
if (explanation.forbiddenImports.length > 0) {
|
|
107
|
+
process.stdout.write(kv('forbidden', explanation.forbiddenImports.join(', ')) + '\n');
|
|
108
|
+
}
|
|
109
|
+
if (explanation.allowedImports.length > 0) {
|
|
110
|
+
process.stdout.write(kv('allowed', explanation.allowedImports.join(', ')) + '\n');
|
|
111
|
+
}
|
|
112
|
+
if (rule.suggestedFix)
|
|
113
|
+
process.stdout.write(`\nSuggested fix: ${rule.suggestedFix}\n`);
|
|
114
|
+
process.stdout.write(`\nHow to fix: ${explanation.howToFix}\n`);
|
|
115
|
+
return 0;
|
|
116
|
+
},
|
|
117
|
+
};
|
|
118
|
+
export const boundariesInferCommand = {
|
|
119
|
+
name: 'infer',
|
|
120
|
+
description: 'Infer candidate boundary rules from the current repo (monorepo structure, package boundaries, naming heuristics). Dry-run by default; --write-drafts writes to sharkcraft/boundary-drafts/boundaries.draft.ts. --language all|java|csharp|python|go|rust adds polyglot suggestions.',
|
|
121
|
+
usage: 'shrk [--cwd <dir>] boundaries infer [--write-drafts] [--language all|java|csharp|python|go|rust] [--json]',
|
|
122
|
+
async run(args) {
|
|
123
|
+
const cwd = resolveCwd(args);
|
|
124
|
+
const inspection = await inspectSharkcraft({ cwd });
|
|
125
|
+
const plan = buildOnboardingPlan(inspection, {});
|
|
126
|
+
const inferred = plan.inferredBoundaryRules;
|
|
127
|
+
const langFlag = flagString(args, 'language');
|
|
128
|
+
let languageSuggestions = null;
|
|
129
|
+
if (langFlag) {
|
|
130
|
+
const { suggestLanguageBoundaries } = await import('@shrkcrft/inspector');
|
|
131
|
+
const lang = langFlag.toLowerCase();
|
|
132
|
+
languageSuggestions = suggestLanguageBoundaries(cwd, lang === 'all' ? {} : { language: lang });
|
|
133
|
+
}
|
|
134
|
+
const wantJson = flagBool(args, 'json');
|
|
135
|
+
const writeDrafts = flagBool(args, 'write-drafts');
|
|
136
|
+
if (writeDrafts) {
|
|
137
|
+
const outDir = nodePath.join(cwd, 'sharkcraft', 'boundary-drafts');
|
|
138
|
+
mkdirSync(outDir, { recursive: true });
|
|
139
|
+
const outFile = nodePath.join(outDir, 'boundaries.draft.ts');
|
|
140
|
+
if (!outFile.startsWith(outDir + nodePath.sep)) {
|
|
141
|
+
process.stderr.write('Refusing to write outside boundary-drafts dir.\n');
|
|
142
|
+
return 1;
|
|
143
|
+
}
|
|
144
|
+
const body = renderInferredBoundariesDraft(inferred);
|
|
145
|
+
writeFileSync(outFile, body, 'utf8');
|
|
146
|
+
if (wantJson) {
|
|
147
|
+
process.stdout.write(asJson({ mode: 'write-drafts', outFile, bytes: body.length, count: inferred.length }) +
|
|
148
|
+
'\n');
|
|
149
|
+
return 0;
|
|
150
|
+
}
|
|
151
|
+
process.stdout.write(header('Boundary inference (write-drafts)'));
|
|
152
|
+
process.stdout.write(kv('outFile', outFile) + '\n');
|
|
153
|
+
process.stdout.write(kv('count', String(inferred.length)) + '\n');
|
|
154
|
+
return 0;
|
|
155
|
+
}
|
|
156
|
+
if (wantJson) {
|
|
157
|
+
process.stdout.write(asJson({ inferred, ...(languageSuggestions ? { languageSuggestions } : {}) }) + '\n');
|
|
158
|
+
return 0;
|
|
159
|
+
}
|
|
160
|
+
process.stdout.write(header(`Inferred boundary rules (${inferred.length})`));
|
|
161
|
+
if (inferred.length === 0) {
|
|
162
|
+
process.stdout.write(' (no candidates inferred)\n');
|
|
163
|
+
}
|
|
164
|
+
for (const r of inferred) {
|
|
165
|
+
process.stdout.write(` ${r.severity.toUpperCase().padEnd(8)} ${r.id.padEnd(36)} ${r.title}\n`);
|
|
166
|
+
process.stdout.write(` reason: ${r.reason}\n`);
|
|
167
|
+
}
|
|
168
|
+
if (languageSuggestions && languageSuggestions.suggestions.length > 0) {
|
|
169
|
+
process.stdout.write(`\nPolyglot suggestions (${languageSuggestions.suggestions.length}):\n`);
|
|
170
|
+
for (const s of languageSuggestions.suggestions) {
|
|
171
|
+
process.stdout.write(` ${s.severity.toUpperCase().padEnd(8)} [${s.language}] ${s.id.padEnd(48)} ${s.title}\n`);
|
|
172
|
+
process.stdout.write(` reason: ${s.reason}\n`);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
process.stdout.write('\nDry-run only. Re-run with `--write-drafts` to write sharkcraft/boundary-drafts/boundaries.draft.ts.\n');
|
|
176
|
+
return 0;
|
|
177
|
+
},
|
|
178
|
+
};
|
|
179
|
+
function renderInferredBoundariesDraft(rules) {
|
|
180
|
+
const lines = [];
|
|
181
|
+
lines.push('// Boundary rules inferred by `shrk boundaries infer --write-drafts`.');
|
|
182
|
+
lines.push('// Review and copy keepers into sharkcraft/boundaries.ts.');
|
|
183
|
+
lines.push('export default [');
|
|
184
|
+
for (const r of rules) {
|
|
185
|
+
lines.push(` {`);
|
|
186
|
+
lines.push(` id: '${r.id}',`);
|
|
187
|
+
lines.push(` title: ${JSON.stringify(r.title)},`);
|
|
188
|
+
lines.push(` severity: '${r.severity}',`);
|
|
189
|
+
lines.push(` from: ${JSON.stringify(r.from)},`);
|
|
190
|
+
if (r.forbiddenImports && r.forbiddenImports.length > 0) {
|
|
191
|
+
lines.push(` forbiddenImports: ${JSON.stringify(r.forbiddenImports)},`);
|
|
192
|
+
}
|
|
193
|
+
if (r.allowedImports && r.allowedImports.length > 0) {
|
|
194
|
+
lines.push(` allowedImports: ${JSON.stringify(r.allowedImports)},`);
|
|
195
|
+
}
|
|
196
|
+
lines.push(` suggestedFix: ${JSON.stringify(r.suggestedFix)},`);
|
|
197
|
+
lines.push(` // reason: ${r.reason}`);
|
|
198
|
+
lines.push(` },`);
|
|
199
|
+
}
|
|
200
|
+
lines.push('];');
|
|
201
|
+
return lines.join('\n') + '\n';
|
|
202
|
+
}
|
|
203
|
+
/** Polyglot enforcement subcommand. */
|
|
204
|
+
export const boundariesEnforceCommand = {
|
|
205
|
+
name: 'enforce',
|
|
206
|
+
description: 'Polyglot boundary enforcement report. Read-only; CLI-only — never mutates source.',
|
|
207
|
+
usage: 'shrk [--cwd <dir>] boundaries enforce [--language all|java|csharp|python|go|rust|typescript] [--changed-only|--since <ref>|--staged|--files a,b,c] [--format text|markdown|json]',
|
|
208
|
+
async run(args) {
|
|
209
|
+
const cwd = resolveCwd(args);
|
|
210
|
+
const langFlag = (flagString(args, 'language') ?? 'all').toLowerCase();
|
|
211
|
+
const languages = langFlag === 'all' ? undefined : [langFlag];
|
|
212
|
+
const report = buildPolyglotBoundaryReport({ projectRoot: cwd, ...(languages ? { languages } : {}) });
|
|
213
|
+
// Changed-only filtering against the polyglot report.
|
|
214
|
+
const changedOnly = flagBool(args, 'changed-only');
|
|
215
|
+
const staged = flagBool(args, 'staged');
|
|
216
|
+
const since = flagString(args, 'since');
|
|
217
|
+
const filesRaw = flagString(args, 'files');
|
|
218
|
+
const fileList = filesRaw
|
|
219
|
+
? filesRaw.split(',').map((s) => s.trim()).filter(Boolean)
|
|
220
|
+
: [];
|
|
221
|
+
const wantChangedScope = changedOnly || staged || Boolean(since) || fileList.length > 0;
|
|
222
|
+
const { filterViolationsToChangedScope } = await import('@shrkcrft/inspector');
|
|
223
|
+
const filtered = wantChangedScope
|
|
224
|
+
? filterViolationsToChangedScope(report.violations, {
|
|
225
|
+
projectRoot: cwd,
|
|
226
|
+
...(fileList.length > 0 ? { files: fileList } : {}),
|
|
227
|
+
...(staged ? { staged: true } : {}),
|
|
228
|
+
...(since ? { since } : {}),
|
|
229
|
+
...(changedOnly && !staged && !since && fileList.length === 0
|
|
230
|
+
? { includeWorktree: true }
|
|
231
|
+
: {}),
|
|
232
|
+
})
|
|
233
|
+
: null;
|
|
234
|
+
const finalViolations = filtered ? filtered.includedViolations : report.violations;
|
|
235
|
+
const errors = finalViolations.filter((v) => v.severity === 'error').length;
|
|
236
|
+
const warnings = finalViolations.filter((v) => v.severity === 'warning').length;
|
|
237
|
+
const format = (flagString(args, 'format') ?? 'text').toLowerCase();
|
|
238
|
+
if (flagBool(args, 'json') || format === 'json') {
|
|
239
|
+
const payload = {
|
|
240
|
+
...report,
|
|
241
|
+
violations: finalViolations,
|
|
242
|
+
counts: { ...report.counts, errors, warnings },
|
|
243
|
+
...(filtered
|
|
244
|
+
? {
|
|
245
|
+
changedScope: {
|
|
246
|
+
mode: filtered.mode,
|
|
247
|
+
changedFiles: filtered.changedFiles,
|
|
248
|
+
ignoredLegacyCount: filtered.ignoredLegacyCount,
|
|
249
|
+
ignoredLegacyByRule: filtered.ignoredLegacyByRule,
|
|
250
|
+
},
|
|
251
|
+
}
|
|
252
|
+
: {}),
|
|
253
|
+
};
|
|
254
|
+
process.stdout.write(JSON.stringify(payload, null, 2) + '\n');
|
|
255
|
+
return errors > 0 ? 1 : 0;
|
|
256
|
+
}
|
|
257
|
+
if (format === 'markdown' || format === 'md') {
|
|
258
|
+
process.stdout.write(renderPolyglotBoundaryReportMarkdown({ ...report, violations: finalViolations, counts: { ...report.counts, errors, warnings } }) + '\n');
|
|
259
|
+
return errors > 0 ? 1 : 0;
|
|
260
|
+
}
|
|
261
|
+
// Default text path: render via existing renderer and append changed-scope footer.
|
|
262
|
+
process.stdout.write(renderPolyglotBoundaryReportText({ ...report, violations: finalViolations, counts: { ...report.counts, errors, warnings } }));
|
|
263
|
+
if (filtered) {
|
|
264
|
+
process.stdout.write(`\nMode: ${filtered.mode}\n`);
|
|
265
|
+
process.stdout.write(`Changed files: ${filtered.changedFiles.length}\n`);
|
|
266
|
+
process.stdout.write(`Legacy ignored: ${filtered.ignoredLegacyCount}\n`);
|
|
267
|
+
if (finalViolations.length === 0) {
|
|
268
|
+
process.stdout.write('No polyglot boundary violations introduced by changed files.\n');
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
return errors > 0 ? 1 : 0;
|
|
272
|
+
},
|
|
273
|
+
};
|
|
274
|
+
export const boundariesSuggestCommand = {
|
|
275
|
+
name: 'suggest',
|
|
276
|
+
description: 'Suggest fixes for boundary violations (by rule id, file, or all).',
|
|
277
|
+
usage: 'shrk boundaries suggest [<ruleId or file>] [--json]',
|
|
278
|
+
async run(args) {
|
|
279
|
+
const cwd = resolveCwd(args);
|
|
280
|
+
const inspection = await inspectSharkcraft({ cwd });
|
|
281
|
+
const rules = inspection.boundaryRegistry.list();
|
|
282
|
+
if (rules.length === 0) {
|
|
283
|
+
process.stderr.write('No boundary rules configured.\n');
|
|
284
|
+
return 0;
|
|
285
|
+
}
|
|
286
|
+
const scan = scanImports({ projectRoot: cwd });
|
|
287
|
+
const tsconfigPaths = loadTsconfigPaths(cwd);
|
|
288
|
+
const evalResult = evaluateBoundaries(scan, rules, {
|
|
289
|
+
...(tsconfigPaths.aliases.size > 0 ? { tsconfigPaths } : {}),
|
|
290
|
+
});
|
|
291
|
+
const filter = args.positional[0];
|
|
292
|
+
const filtered = filter
|
|
293
|
+
? evalResult.violations.filter((v) => v.ruleId === filter || v.file.includes(filter))
|
|
294
|
+
: evalResult.violations;
|
|
295
|
+
const suggestions = suggestBoundaryFixes(inspection, filtered.map((v) => ({
|
|
296
|
+
ruleId: v.ruleId,
|
|
297
|
+
file: v.file,
|
|
298
|
+
line: v.line,
|
|
299
|
+
importSpecifier: v.importSpecifier,
|
|
300
|
+
...(v.suggestedFix ? { suggestedFix: v.suggestedFix } : {}),
|
|
301
|
+
})));
|
|
302
|
+
if (flagBool(args, 'json')) {
|
|
303
|
+
process.stdout.write(asJson(suggestions) + '\n');
|
|
304
|
+
return 0;
|
|
305
|
+
}
|
|
306
|
+
process.stdout.write(header(`Boundary fix suggestions (${suggestions.length})`));
|
|
307
|
+
for (const s of suggestions) {
|
|
308
|
+
process.stdout.write(` ${s.ruleId} ${s.file}:${s.line}\n`);
|
|
309
|
+
for (const sug of s.suggestions)
|
|
310
|
+
process.stdout.write(` ↳ ${sug}\n`);
|
|
311
|
+
}
|
|
312
|
+
return 0;
|
|
313
|
+
},
|
|
314
|
+
};
|