@shrkcrft/cli 0.1.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +15 -0
- package/dist/asset-preview/apply-action-hint-stub.d.ts +28 -0
- package/dist/asset-preview/apply-action-hint-stub.d.ts.map +1 -0
- package/dist/asset-preview/apply-action-hint-stub.js +170 -0
- package/dist/asset-preview/apply-asset-preview.d.ts +31 -0
- package/dist/asset-preview/apply-asset-preview.d.ts.map +1 -0
- package/dist/asset-preview/apply-asset-preview.js +210 -0
- package/dist/asset-preview/apply-knowledge-stale-fix.d.ts +37 -0
- package/dist/asset-preview/apply-knowledge-stale-fix.d.ts.map +1 -0
- package/dist/asset-preview/apply-knowledge-stale-fix.js +344 -0
- package/dist/asset-preview/apply-missing-barrel.d.ts +15 -0
- package/dist/asset-preview/apply-missing-barrel.d.ts.map +1 -0
- package/dist/asset-preview/apply-missing-barrel.js +65 -0
- package/dist/asset-preview/apply-template-drift-fix.d.ts +21 -0
- package/dist/asset-preview/apply-template-drift-fix.d.ts.map +1 -0
- package/dist/asset-preview/apply-template-drift-fix.js +125 -0
- package/dist/asset-preview/apply-template-update.d.ts +43 -0
- package/dist/asset-preview/apply-template-update.d.ts.map +1 -0
- package/dist/asset-preview/apply-template-update.js +257 -0
- package/dist/asset-preview/entry-mutator.d.ts +106 -0
- package/dist/asset-preview/entry-mutator.d.ts.map +1 -0
- package/dist/asset-preview/entry-mutator.js +428 -0
- package/dist/authoring/authoring-kit.d.ts +36 -0
- package/dist/authoring/authoring-kit.d.ts.map +1 -0
- package/dist/authoring/authoring-kit.js +106 -0
- package/dist/command-registry.d.ts +158 -0
- package/dist/command-registry.d.ts.map +1 -0
- package/dist/command-registry.js +348 -0
- package/dist/commands/apply.command.d.ts +3 -0
- package/dist/commands/apply.command.d.ts.map +1 -0
- package/dist/commands/apply.command.js +879 -0
- package/dist/commands/architecture.command.d.ts +5 -0
- package/dist/commands/architecture.command.d.ts.map +1 -0
- package/dist/commands/architecture.command.js +141 -0
- package/dist/commands/ask.command.d.ts +3 -0
- package/dist/commands/ask.command.d.ts.map +1 -0
- package/dist/commands/ask.command.js +58 -0
- package/dist/commands/audit.command.d.ts +3 -0
- package/dist/commands/audit.command.d.ts.map +1 -0
- package/dist/commands/audit.command.js +141 -0
- package/dist/commands/biome.command.d.ts +7 -0
- package/dist/commands/biome.command.d.ts.map +1 -0
- package/dist/commands/biome.command.js +350 -0
- package/dist/commands/boundaries.command.d.ts +9 -0
- package/dist/commands/boundaries.command.d.ts.map +1 -0
- package/dist/commands/boundaries.command.js +314 -0
- package/dist/commands/brief.command.d.ts +3 -0
- package/dist/commands/brief.command.d.ts.map +1 -0
- package/dist/commands/brief.command.js +206 -0
- package/dist/commands/bundle.command.d.ts +3 -0
- package/dist/commands/bundle.command.d.ts.map +1 -0
- package/dist/commands/bundle.command.js +1183 -0
- package/dist/commands/changes.command.d.ts +3 -0
- package/dist/commands/changes.command.d.ts.map +1 -0
- package/dist/commands/changes.command.js +155 -0
- package/dist/commands/check.command.d.ts +3 -0
- package/dist/commands/check.command.d.ts.map +1 -0
- package/dist/commands/check.command.js +553 -0
- package/dist/commands/checks.command.d.ts +29 -0
- package/dist/commands/checks.command.d.ts.map +1 -0
- package/dist/commands/checks.command.js +521 -0
- package/dist/commands/ci.command.d.ts +3 -0
- package/dist/commands/ci.command.d.ts.map +1 -0
- package/dist/commands/ci.command.js +680 -0
- package/dist/commands/codemod.command.d.ts +3 -0
- package/dist/commands/codemod.command.d.ts.map +1 -0
- package/dist/commands/codemod.command.js +130 -0
- package/dist/commands/command-catalog.d.ts +265 -0
- package/dist/commands/command-catalog.d.ts.map +1 -0
- package/dist/commands/command-catalog.js +3242 -0
- package/dist/commands/commands.command.d.ts +92 -0
- package/dist/commands/commands.command.d.ts.map +1 -0
- package/dist/commands/commands.command.js +1208 -0
- package/dist/commands/constructs.command.d.ts +15 -0
- package/dist/commands/constructs.command.d.ts.map +1 -0
- package/dist/commands/constructs.command.js +669 -0
- package/dist/commands/context.command.d.ts +3 -0
- package/dist/commands/context.command.d.ts.map +1 -0
- package/dist/commands/context.command.js +120 -0
- package/dist/commands/contract-gate.command.d.ts +5 -0
- package/dist/commands/contract-gate.command.d.ts.map +1 -0
- package/dist/commands/contract-gate.command.js +208 -0
- package/dist/commands/contract-templates.command.d.ts +8 -0
- package/dist/commands/contract-templates.command.d.ts.map +1 -0
- package/dist/commands/contract-templates.command.js +151 -0
- package/dist/commands/contract.command.d.ts +3 -0
- package/dist/commands/contract.command.d.ts.map +1 -0
- package/dist/commands/contract.command.js +105 -0
- package/dist/commands/conventions.command.d.ts +8 -0
- package/dist/commands/conventions.command.d.ts.map +1 -0
- package/dist/commands/conventions.command.js +169 -0
- package/dist/commands/coverage.command.d.ts +3 -0
- package/dist/commands/coverage.command.d.ts.map +1 -0
- package/dist/commands/coverage.command.js +56 -0
- package/dist/commands/daily.commands.d.ts +5 -0
- package/dist/commands/daily.commands.d.ts.map +1 -0
- package/dist/commands/daily.commands.js +224 -0
- package/dist/commands/dashboard-export.command.d.ts +4 -0
- package/dist/commands/dashboard-export.command.d.ts.map +1 -0
- package/dist/commands/dashboard-export.command.js +86 -0
- package/dist/commands/dashboard.command.d.ts +3 -0
- package/dist/commands/dashboard.command.d.ts.map +1 -0
- package/dist/commands/dashboard.command.js +106 -0
- package/dist/commands/dev.command.d.ts +3 -0
- package/dist/commands/dev.command.d.ts.map +1 -0
- package/dist/commands/dev.command.js +1392 -0
- package/dist/commands/diagnostics.command.d.ts +5 -0
- package/dist/commands/diagnostics.command.d.ts.map +1 -0
- package/dist/commands/diagnostics.command.js +97 -0
- package/dist/commands/docs.command.d.ts +4 -0
- package/dist/commands/docs.command.d.ts.map +1 -0
- package/dist/commands/docs.command.js +34 -0
- package/dist/commands/doctor.command.d.ts +7 -0
- package/dist/commands/doctor.command.d.ts.map +1 -0
- package/dist/commands/doctor.command.js +681 -0
- package/dist/commands/drift.command.d.ts +3 -0
- package/dist/commands/drift.command.d.ts.map +1 -0
- package/dist/commands/drift.command.js +124 -0
- package/dist/commands/eslint.command.d.ts +7 -0
- package/dist/commands/eslint.command.d.ts.map +1 -0
- package/dist/commands/eslint.command.js +423 -0
- package/dist/commands/explore.command.d.ts +3 -0
- package/dist/commands/explore.command.d.ts.map +1 -0
- package/dist/commands/explore.command.js +65 -0
- package/dist/commands/export-bundle.command.d.ts +6 -0
- package/dist/commands/export-bundle.command.d.ts.map +1 -0
- package/dist/commands/export-bundle.command.js +96 -0
- package/dist/commands/export.command.d.ts +3 -0
- package/dist/commands/export.command.d.ts.map +1 -0
- package/dist/commands/export.command.js +83 -0
- package/dist/commands/feedback-dispatch.command.d.ts +12 -0
- package/dist/commands/feedback-dispatch.command.d.ts.map +1 -0
- package/dist/commands/feedback-dispatch.command.js +63 -0
- package/dist/commands/feedback.command.d.ts +11 -0
- package/dist/commands/feedback.command.d.ts.map +1 -0
- package/dist/commands/feedback.command.js +336 -0
- package/dist/commands/fix.command.d.ts +3 -0
- package/dist/commands/fix.command.d.ts.map +1 -0
- package/dist/commands/fix.command.js +776 -0
- package/dist/commands/gen.command.d.ts +3 -0
- package/dist/commands/gen.command.d.ts.map +1 -0
- package/dist/commands/gen.command.js +136 -0
- package/dist/commands/git.command.d.ts +6 -0
- package/dist/commands/git.command.d.ts.map +1 -0
- package/dist/commands/git.command.js +81 -0
- package/dist/commands/graph.command.d.ts +3 -0
- package/dist/commands/graph.command.d.ts.map +1 -0
- package/dist/commands/graph.command.js +287 -0
- package/dist/commands/grounding.command.d.ts +7 -0
- package/dist/commands/grounding.command.d.ts.map +1 -0
- package/dist/commands/grounding.command.js +54 -0
- package/dist/commands/help.command.d.ts +20 -0
- package/dist/commands/help.command.d.ts.map +1 -0
- package/dist/commands/help.command.js +127 -0
- package/dist/commands/helper.command.d.ts +6 -0
- package/dist/commands/helper.command.d.ts.map +1 -0
- package/dist/commands/helper.command.js +170 -0
- package/dist/commands/ide.command.d.ts +6 -0
- package/dist/commands/ide.command.d.ts.map +1 -0
- package/dist/commands/ide.command.js +340 -0
- package/dist/commands/impact.command.d.ts +3 -0
- package/dist/commands/impact.command.d.ts.map +1 -0
- package/dist/commands/impact.command.js +819 -0
- package/dist/commands/import.command.d.ts +3 -0
- package/dist/commands/import.command.d.ts.map +1 -0
- package/dist/commands/import.command.js +115 -0
- package/dist/commands/infer.command.d.ts +3 -0
- package/dist/commands/infer.command.d.ts.map +1 -0
- package/dist/commands/infer.command.js +227 -0
- package/dist/commands/ingest.command.d.ts +6 -0
- package/dist/commands/ingest.command.d.ts.map +1 -0
- package/dist/commands/ingest.command.js +532 -0
- package/dist/commands/init.command.d.ts +3 -0
- package/dist/commands/init.command.d.ts.map +1 -0
- package/dist/commands/init.command.js +301 -0
- package/dist/commands/inspect.command.d.ts +3 -0
- package/dist/commands/inspect.command.d.ts.map +1 -0
- package/dist/commands/inspect.command.js +122 -0
- package/dist/commands/knowledge-author.command.d.ts +22 -0
- package/dist/commands/knowledge-author.command.d.ts.map +1 -0
- package/dist/commands/knowledge-author.command.js +366 -0
- package/dist/commands/knowledge-propose.command.d.ts +3 -0
- package/dist/commands/knowledge-propose.command.d.ts.map +1 -0
- package/dist/commands/knowledge-propose.command.js +125 -0
- package/dist/commands/knowledge.command.d.ts +18 -0
- package/dist/commands/knowledge.command.d.ts.map +1 -0
- package/dist/commands/knowledge.command.js +538 -0
- package/dist/commands/languages.command.d.ts +3 -0
- package/dist/commands/languages.command.d.ts.map +1 -0
- package/dist/commands/languages.command.js +300 -0
- package/dist/commands/lint.command.d.ts +15 -0
- package/dist/commands/lint.command.d.ts.map +1 -0
- package/dist/commands/lint.command.js +194 -0
- package/dist/commands/mcp.command.d.ts +3 -0
- package/dist/commands/mcp.command.d.ts.map +1 -0
- package/dist/commands/mcp.command.js +74 -0
- package/dist/commands/memory.command.d.ts +11 -0
- package/dist/commands/memory.command.d.ts.map +1 -0
- package/dist/commands/memory.command.js +264 -0
- package/dist/commands/onboard.command.d.ts +3 -0
- package/dist/commands/onboard.command.d.ts.map +1 -0
- package/dist/commands/onboard.command.js +650 -0
- package/dist/commands/orchestrate.command.d.ts +3 -0
- package/dist/commands/orchestrate.command.d.ts.map +1 -0
- package/dist/commands/orchestrate.command.js +49 -0
- package/dist/commands/owners.command.d.ts +5 -0
- package/dist/commands/owners.command.d.ts.map +1 -0
- package/dist/commands/owners.command.js +113 -0
- package/dist/commands/ownership.command.d.ts +5 -0
- package/dist/commands/ownership.command.d.ts.map +1 -0
- package/dist/commands/ownership.command.js +117 -0
- package/dist/commands/pack-author.command.d.ts +30 -0
- package/dist/commands/pack-author.command.d.ts.map +1 -0
- package/dist/commands/pack-author.command.js +242 -0
- package/dist/commands/packs-new.d.ts +27 -0
- package/dist/commands/packs-new.d.ts.map +1 -0
- package/dist/commands/packs-new.js +805 -0
- package/dist/commands/packs.command.d.ts +15 -0
- package/dist/commands/packs.command.d.ts.map +1 -0
- package/dist/commands/packs.command.js +958 -0
- package/dist/commands/paths.command.d.ts +6 -0
- package/dist/commands/paths.command.d.ts.map +1 -0
- package/dist/commands/paths.command.js +97 -0
- package/dist/commands/pipelines.command.d.ts +9 -0
- package/dist/commands/pipelines.command.d.ts.map +1 -0
- package/dist/commands/pipelines.command.js +308 -0
- package/dist/commands/plan-check.command.d.ts +27 -0
- package/dist/commands/plan-check.command.d.ts.map +1 -0
- package/dist/commands/plan-check.command.js +150 -0
- package/dist/commands/plan-simulate.command.d.ts +3 -0
- package/dist/commands/plan-simulate.command.d.ts.map +1 -0
- package/dist/commands/plan-simulate.command.js +60 -0
- package/dist/commands/plan.command.d.ts +8 -0
- package/dist/commands/plan.command.d.ts.map +1 -0
- package/dist/commands/plan.command.js +139 -0
- package/dist/commands/playbooks.command.d.ts +10 -0
- package/dist/commands/playbooks.command.d.ts.map +1 -0
- package/dist/commands/playbooks.command.js +296 -0
- package/dist/commands/plugin.command.d.ts +11 -0
- package/dist/commands/plugin.command.d.ts.map +1 -0
- package/dist/commands/plugin.command.js +394 -0
- package/dist/commands/policy.command.d.ts +8 -0
- package/dist/commands/policy.command.d.ts.map +1 -0
- package/dist/commands/policy.command.js +451 -0
- package/dist/commands/pr.command.d.ts +3 -0
- package/dist/commands/pr.command.d.ts.map +1 -0
- package/dist/commands/pr.command.js +132 -0
- package/dist/commands/preflight.command.d.ts +3 -0
- package/dist/commands/preflight.command.d.ts.map +1 -0
- package/dist/commands/preflight.command.js +102 -0
- package/dist/commands/presets.command.d.ts +17 -0
- package/dist/commands/presets.command.d.ts.map +1 -0
- package/dist/commands/presets.command.js +647 -0
- package/dist/commands/profiles.command.d.ts +7 -0
- package/dist/commands/profiles.command.d.ts.map +1 -0
- package/dist/commands/profiles.command.js +151 -0
- package/dist/commands/provenance.command.d.ts +26 -0
- package/dist/commands/provenance.command.d.ts.map +1 -0
- package/dist/commands/provenance.command.js +237 -0
- package/dist/commands/quality.command.d.ts +5 -0
- package/dist/commands/quality.command.d.ts.map +1 -0
- package/dist/commands/quality.command.js +69 -0
- package/dist/commands/recommend.command.d.ts +4 -0
- package/dist/commands/recommend.command.d.ts.map +1 -0
- package/dist/commands/recommend.command.js +270 -0
- package/dist/commands/registrations.command.d.ts +3 -0
- package/dist/commands/registrations.command.d.ts.map +1 -0
- package/dist/commands/registrations.command.js +300 -0
- package/dist/commands/registry.command.d.ts +4 -0
- package/dist/commands/registry.command.d.ts.map +1 -0
- package/dist/commands/registry.command.js +37 -0
- package/dist/commands/release.command.d.ts +4 -0
- package/dist/commands/release.command.d.ts.map +1 -0
- package/dist/commands/release.command.js +639 -0
- package/dist/commands/repo.command.d.ts +3 -0
- package/dist/commands/repo.command.d.ts.map +1 -0
- package/dist/commands/repo.command.js +24 -0
- package/dist/commands/report.command.d.ts +3 -0
- package/dist/commands/report.command.d.ts.map +1 -0
- package/dist/commands/report.command.js +511 -0
- package/dist/commands/reposet.command.d.ts +6 -0
- package/dist/commands/reposet.command.d.ts.map +1 -0
- package/dist/commands/reposet.command.js +120 -0
- package/dist/commands/review.command.d.ts +3 -0
- package/dist/commands/review.command.d.ts.map +1 -0
- package/dist/commands/review.command.js +354 -0
- package/dist/commands/risk.command.d.ts +3 -0
- package/dist/commands/risk.command.d.ts.map +1 -0
- package/dist/commands/risk.command.js +56 -0
- package/dist/commands/rounds.command.d.ts +8 -0
- package/dist/commands/rounds.command.d.ts.map +1 -0
- package/dist/commands/rounds.command.js +180 -0
- package/dist/commands/rules.command.d.ts +49 -0
- package/dist/commands/rules.command.d.ts.map +1 -0
- package/dist/commands/rules.command.js +435 -0
- package/dist/commands/runtime.command.d.ts +3 -0
- package/dist/commands/runtime.command.d.ts.map +1 -0
- package/dist/commands/runtime.command.js +56 -0
- package/dist/commands/safety.command.d.ts +3 -0
- package/dist/commands/safety.command.d.ts.map +1 -0
- package/dist/commands/safety.command.js +117 -0
- package/dist/commands/scaffolds.command.d.ts +5 -0
- package/dist/commands/scaffolds.command.d.ts.map +1 -0
- package/dist/commands/scaffolds.command.js +122 -0
- package/dist/commands/schemas.command.d.ts +21 -0
- package/dist/commands/schemas.command.d.ts.map +1 -0
- package/dist/commands/schemas.command.js +296 -0
- package/dist/commands/search.command.d.ts +12 -0
- package/dist/commands/search.command.d.ts.map +1 -0
- package/dist/commands/search.command.js +275 -0
- package/dist/commands/self-config.command.d.ts +7 -0
- package/dist/commands/self-config.command.d.ts.map +1 -0
- package/dist/commands/self-config.command.js +156 -0
- package/dist/commands/self.command.d.ts +3 -0
- package/dist/commands/self.command.d.ts.map +1 -0
- package/dist/commands/self.command.js +117 -0
- package/dist/commands/simulate.command.d.ts +3 -0
- package/dist/commands/simulate.command.d.ts.map +1 -0
- package/dist/commands/simulate.command.js +54 -0
- package/dist/commands/spec.command.d.ts +29 -0
- package/dist/commands/spec.command.d.ts.map +1 -0
- package/dist/commands/spec.command.js +985 -0
- package/dist/commands/start-here.command.d.ts +3 -0
- package/dist/commands/start-here.command.d.ts.map +1 -0
- package/dist/commands/start-here.command.js +35 -0
- package/dist/commands/stats.command.d.ts +3 -0
- package/dist/commands/stats.command.d.ts.map +1 -0
- package/dist/commands/stats.command.js +88 -0
- package/dist/commands/surface.command.d.ts +15 -0
- package/dist/commands/surface.command.d.ts.map +1 -0
- package/dist/commands/surface.command.js +328 -0
- package/dist/commands/task-context.command.d.ts +7 -0
- package/dist/commands/task-context.command.d.ts.map +1 -0
- package/dist/commands/task-context.command.js +646 -0
- package/dist/commands/task.command.d.ts +3 -0
- package/dist/commands/task.command.d.ts.map +1 -0
- package/dist/commands/task.command.js +301 -0
- package/dist/commands/template-quality.command.d.ts +5 -0
- package/dist/commands/template-quality.command.d.ts.map +1 -0
- package/dist/commands/template-quality.command.js +128 -0
- package/dist/commands/templates.command.d.ts +26 -0
- package/dist/commands/templates.command.d.ts.map +1 -0
- package/dist/commands/templates.command.js +964 -0
- package/dist/commands/test.command.d.ts +3 -0
- package/dist/commands/test.command.d.ts.map +1 -0
- package/dist/commands/test.command.js +262 -0
- package/dist/commands/tests.command.d.ts +5 -0
- package/dist/commands/tests.command.d.ts.map +1 -0
- package/dist/commands/tests.command.js +97 -0
- package/dist/commands/trace.command.d.ts +3 -0
- package/dist/commands/trace.command.d.ts.map +1 -0
- package/dist/commands/trace.command.js +121 -0
- package/dist/commands/upgrade.command.d.ts +4 -0
- package/dist/commands/upgrade.command.d.ts.map +1 -0
- package/dist/commands/upgrade.command.js +43 -0
- package/dist/commands/version.command.d.ts +3 -0
- package/dist/commands/version.command.d.ts.map +1 -0
- package/dist/commands/version.command.js +10 -0
- package/dist/commands/why.command.d.ts +24 -0
- package/dist/commands/why.command.d.ts.map +1 -0
- package/dist/commands/why.command.js +119 -0
- package/dist/dashboard/dashboard-api-server.d.ts +21 -0
- package/dist/dashboard/dashboard-api-server.d.ts.map +1 -0
- package/dist/dashboard/dashboard-api-server.js +410 -0
- package/dist/dashboard/live-session-server.d.ts +18 -0
- package/dist/dashboard/live-session-server.d.ts.map +1 -0
- package/dist/dashboard/live-session-server.js +133 -0
- package/dist/diff/collect-changed-paths.d.ts +27 -0
- package/dist/diff/collect-changed-paths.d.ts.map +1 -0
- package/dist/diff/collect-changed-paths.js +68 -0
- package/dist/doctor/doctor-tags.d.ts +63 -0
- package/dist/doctor/doctor-tags.d.ts.map +1 -0
- package/dist/doctor/doctor-tags.js +146 -0
- package/dist/export/export-formats.d.ts +22 -0
- package/dist/export/export-formats.d.ts.map +1 -0
- package/dist/export/export-formats.js +135 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -0
- package/dist/init/detected-block.d.ts +57 -0
- package/dist/init/detected-block.d.ts.map +1 -0
- package/dist/init/detected-block.js +197 -0
- package/dist/init/gitignore.d.ts +30 -0
- package/dist/init/gitignore.d.ts.map +1 -0
- package/dist/init/gitignore.js +110 -0
- package/dist/init/init-templates.d.ts +6 -0
- package/dist/init/init-templates.d.ts.map +1 -0
- package/dist/init/init-templates.js +413 -0
- package/dist/main.d.ts +18 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +699 -0
- package/dist/output/failure-hints.d.ts +55 -0
- package/dist/output/failure-hints.d.ts.map +1 -0
- package/dist/output/failure-hints.js +159 -0
- package/dist/output/format-output.d.ts +9 -0
- package/dist/output/format-output.d.ts.map +1 -0
- package/dist/output/format-output.js +26 -0
- package/dist/output/print-error.d.ts +3 -0
- package/dist/output/print-error.d.ts.map +1 -0
- package/dist/output/print-error.js +14 -0
- package/dist/output/watch-loop.d.ts +37 -0
- package/dist/output/watch-loop.d.ts.map +1 -0
- package/dist/output/watch-loop.js +115 -0
- package/dist/schemas/json-schemas.d.ts +1630 -0
- package/dist/schemas/json-schemas.d.ts.map +1 -0
- package/dist/schemas/json-schemas.js +811 -0
- package/dist/surface/about.d.ts +10 -0
- package/dist/surface/about.d.ts.map +1 -0
- package/dist/surface/about.js +53 -0
- package/dist/surface/load-surface-context.d.ts +34 -0
- package/dist/surface/load-surface-context.d.ts.map +1 -0
- package/dist/surface/load-surface-context.js +100 -0
- package/dist/surface/no-args-landing.d.ts +7 -0
- package/dist/surface/no-args-landing.d.ts.map +1 -0
- package/dist/surface/no-args-landing.js +36 -0
- package/dist/surface/not-enabled-error.d.ts +24 -0
- package/dist/surface/not-enabled-error.d.ts.map +1 -0
- package/dist/surface/not-enabled-error.js +36 -0
- package/dist/surface/profiles.d.ts +37 -0
- package/dist/surface/profiles.d.ts.map +1 -0
- package/dist/surface/profiles.js +151 -0
- package/dist/surface/shape-defaults.d.ts +21 -0
- package/dist/surface/shape-defaults.d.ts.map +1 -0
- package/dist/surface/shape-defaults.js +50 -0
- package/dist/surface/spine-extractor.d.ts +38 -0
- package/dist/surface/spine-extractor.d.ts.map +1 -0
- package/dist/surface/spine-extractor.js +100 -0
- package/dist/surface/surface-config-writer.d.ts +59 -0
- package/dist/surface/surface-config-writer.d.ts.map +1 -0
- package/dist/surface/surface-config-writer.js +135 -0
- package/dist/surface/surface-summary.d.ts +66 -0
- package/dist/surface/surface-summary.d.ts.map +1 -0
- package/dist/surface/surface-summary.js +162 -0
- package/dist/surface/tier.d.ts +100 -0
- package/dist/surface/tier.d.ts.map +1 -0
- package/dist/surface/tier.js +172 -0
- package/dist/task-next/apply-batch-runner.d.ts +42 -0
- package/dist/task-next/apply-batch-runner.d.ts.map +1 -0
- package/dist/task-next/apply-batch-runner.js +192 -0
- package/dist/task-next/task-next-ranker.d.ts +75 -0
- package/dist/task-next/task-next-ranker.d.ts.map +1 -0
- package/dist/task-next/task-next-ranker.js +179 -0
- package/dist/usage/usage-log.d.ts +54 -0
- package/dist/usage/usage-log.d.ts.map +1 -0
- package/dist/usage/usage-log.js +105 -0
- package/dist/validation/run-validation-loop.d.ts +38 -0
- package/dist/validation/run-validation-loop.d.ts.map +1 -0
- package/dist/validation/run-validation-loop.js +100 -0
- package/package.json +73 -0
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import * as nodePath from 'node:path';
|
|
3
|
+
import { detectProjectRoot, inspectWorkspace } from '@shrkcrft/workspace';
|
|
4
|
+
import { applyPresetPlan, BUILTIN_PRESETS, PresetRegistry, previewPresetApplication, recommendPresets } from '@shrkcrft/presets';
|
|
5
|
+
import { listBuiltInSurfaceProfiles, suggestSurfaceProfile } from '@shrkcrft/inspector';
|
|
6
|
+
import { INIT_FILES } from "../init/init-templates.js";
|
|
7
|
+
import { buildDetectedBlock, renderDetectedBlockText } from "../init/detected-block.js";
|
|
8
|
+
import { ensureSharkcraftGitignore, renderGitignorePatch } from "../init/gitignore.js";
|
|
9
|
+
import { applySurfaceTextEdit } from "../surface/surface-config-writer.js";
|
|
10
|
+
import { flagBool, flagString, resolveCwd } from "../command-registry.js";
|
|
11
|
+
import { bullet, header } from "../output/format-output.js";
|
|
12
|
+
const LEGACY_PRESET_ID = 'legacy-init';
|
|
13
|
+
async function resolveSurfaceProfile(cwd, override) {
|
|
14
|
+
if (override) {
|
|
15
|
+
const all = listBuiltInSurfaceProfiles();
|
|
16
|
+
if (!all.includes(override)) {
|
|
17
|
+
throw new Error(`Unknown --surface-profile "${override}". Choose one of: ${all.join(', ')}.`);
|
|
18
|
+
}
|
|
19
|
+
return {
|
|
20
|
+
profile: override,
|
|
21
|
+
reason: 'explicit --surface-profile override.',
|
|
22
|
+
source: 'override',
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
const ws = await inspectWorkspace({ startDir: cwd });
|
|
26
|
+
const sug = suggestSurfaceProfile(ws.profiles);
|
|
27
|
+
return {
|
|
28
|
+
profile: sug.profile,
|
|
29
|
+
reason: sug.reason,
|
|
30
|
+
source: 'detected',
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Inject the chosen surface profile into the generated
|
|
35
|
+
* `sharkcraft.config.ts`. Idempotent: if a `surface:` block already
|
|
36
|
+
* names the same profile, the file is left untouched.
|
|
37
|
+
*/
|
|
38
|
+
function injectSurfaceProfile(sharkcraftDir, decision) {
|
|
39
|
+
const configFile = nodePath.join(sharkcraftDir, 'sharkcraft.config.ts');
|
|
40
|
+
if (!existsSync(configFile)) {
|
|
41
|
+
return { written: false, configFile, alreadyMatched: false };
|
|
42
|
+
}
|
|
43
|
+
const original = readFileSync(configFile, 'utf8');
|
|
44
|
+
const profileRegex = /profile\s*:\s*['"]([^'"]+)['"]/m;
|
|
45
|
+
const existing = profileRegex.exec(original);
|
|
46
|
+
if (existing && existing[1] === decision.profile) {
|
|
47
|
+
return { written: false, configFile, alreadyMatched: true };
|
|
48
|
+
}
|
|
49
|
+
const updated = applySurfaceTextEdit(original, {
|
|
50
|
+
profile: decision.profile,
|
|
51
|
+
enabled: [],
|
|
52
|
+
hidden: [],
|
|
53
|
+
});
|
|
54
|
+
const comment = `// surface.profile picked by \`shrk init\` (${decision.source}): ${decision.reason}\n`;
|
|
55
|
+
// Insert the comment immediately above the surface block so it survives
|
|
56
|
+
// re-writes of the surface block itself.
|
|
57
|
+
const final = updated.replace(/(^\s*surface\s*:\s*\{)/m, `${comment}$1`);
|
|
58
|
+
writeFileSync(configFile, final, 'utf8');
|
|
59
|
+
return { written: true, configFile, alreadyMatched: false };
|
|
60
|
+
}
|
|
61
|
+
async function pickAutoPreset(cwd) {
|
|
62
|
+
const ws = await inspectWorkspace({ startDir: cwd });
|
|
63
|
+
const recs = recommendPresets([...BUILTIN_PRESETS], {
|
|
64
|
+
profiles: ws.profiles,
|
|
65
|
+
limit: 1,
|
|
66
|
+
});
|
|
67
|
+
const top = recs[0];
|
|
68
|
+
if (!top) {
|
|
69
|
+
return { presetId: 'generic', profiles: ws.profiles, reasons: ['no high-signal preset matched; fell back to generic'] };
|
|
70
|
+
}
|
|
71
|
+
return { presetId: top.preset.id, profiles: ws.profiles, reasons: top.reasons };
|
|
72
|
+
}
|
|
73
|
+
async function applyPresetInit(cwd, mode) {
|
|
74
|
+
const registry = new PresetRegistry([...BUILTIN_PRESETS]);
|
|
75
|
+
const preset = registry.get(mode.presetId);
|
|
76
|
+
if (!preset) {
|
|
77
|
+
process.stderr.write(`Unknown preset: ${mode.presetId}. Run \`shrk presets list\` to see options.\n`);
|
|
78
|
+
return 1;
|
|
79
|
+
}
|
|
80
|
+
const plan = previewPresetApplication(preset, {
|
|
81
|
+
projectRoot: cwd,
|
|
82
|
+
force: mode.force,
|
|
83
|
+
merge: mode.merge,
|
|
84
|
+
});
|
|
85
|
+
if (mode.dryRun) {
|
|
86
|
+
process.stdout.write(header('SharkCraft init — dry-run'));
|
|
87
|
+
process.stdout.write(`Preset: ${preset.id} — ${preset.title}\n`);
|
|
88
|
+
process.stdout.write(`Folder: ${plan.sharkcraftDir}\n`);
|
|
89
|
+
if (mode.showDetectedProfiles) {
|
|
90
|
+
try {
|
|
91
|
+
const ws = await inspectWorkspace({ startDir: cwd });
|
|
92
|
+
process.stdout.write(`Detected profiles: ${ws.profiles.join(', ') || '(none)'}\n`);
|
|
93
|
+
// Include the structured Detected block so the user sees
|
|
94
|
+
// exactly what was detected vs. what was guessed/inferred.
|
|
95
|
+
const detected = buildDetectedBlock(cwd, ws);
|
|
96
|
+
process.stdout.write(header('Detected'));
|
|
97
|
+
process.stdout.write(renderDetectedBlockText(detected) + '\n');
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
// best-effort; do not fail dry-run on inspect errors
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
process.stdout.write('\nWould write:\n');
|
|
104
|
+
for (const entry of plan.entries) {
|
|
105
|
+
process.stdout.write(bullet(`[${entry.status}] ${entry.relPath}`) + '\n');
|
|
106
|
+
}
|
|
107
|
+
for (const warn of plan.warnings) {
|
|
108
|
+
process.stdout.write(bullet(`(warning) ${warn}`) + '\n');
|
|
109
|
+
}
|
|
110
|
+
process.stdout.write('\nNext:\n');
|
|
111
|
+
for (const cmd of preset.recommendedNextCommands ?? [
|
|
112
|
+
'shrk init --zero-config --write',
|
|
113
|
+
'shrk doctor',
|
|
114
|
+
'shrk context --task "<task>"',
|
|
115
|
+
]) {
|
|
116
|
+
process.stdout.write(bullet(`$ ${cmd}`) + '\n');
|
|
117
|
+
}
|
|
118
|
+
if (!mode.skipGitignore) {
|
|
119
|
+
const patch = ensureSharkcraftGitignore({ cwd, dryRun: true });
|
|
120
|
+
process.stdout.write('\n' + renderGitignorePatch(patch, true));
|
|
121
|
+
}
|
|
122
|
+
process.stdout.write('\nRun with --write to persist.\n');
|
|
123
|
+
return 0;
|
|
124
|
+
}
|
|
125
|
+
const result = applyPresetPlan(plan);
|
|
126
|
+
// Inject the surface profile into the generated config so the
|
|
127
|
+
// user starts from a sensible default rather than the empty fallback.
|
|
128
|
+
let surfaceProfileResult = null;
|
|
129
|
+
if (mode.surfaceProfile) {
|
|
130
|
+
surfaceProfileResult = injectSurfaceProfile(plan.sharkcraftDir, {
|
|
131
|
+
profile: mode.surfaceProfile,
|
|
132
|
+
reason: mode.surfaceProfileReason ?? 'configured by init.',
|
|
133
|
+
source: 'override',
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
process.stdout.write(header('SharkCraft initialized'));
|
|
137
|
+
process.stdout.write(`Preset: ${preset.id} — ${preset.title}\n`);
|
|
138
|
+
process.stdout.write(`Folder: ${plan.sharkcraftDir}\n`);
|
|
139
|
+
if (surfaceProfileResult) {
|
|
140
|
+
if (surfaceProfileResult.written) {
|
|
141
|
+
process.stdout.write(`Surface profile: ${mode.surfaceProfile} (written to sharkcraft.config.ts)\n`);
|
|
142
|
+
}
|
|
143
|
+
else if (surfaceProfileResult.alreadyMatched) {
|
|
144
|
+
process.stdout.write(`Surface profile: ${mode.surfaceProfile} (already set; no change)\n`);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
if (mode.showDetectedProfiles) {
|
|
148
|
+
try {
|
|
149
|
+
const ws = await inspectWorkspace({ startDir: cwd });
|
|
150
|
+
process.stdout.write(`Detected profiles: ${ws.profiles.join(', ') || '(none)'}\n`);
|
|
151
|
+
}
|
|
152
|
+
catch {
|
|
153
|
+
/* ignore */
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
if (result.written.length) {
|
|
157
|
+
process.stdout.write('\nCreated files:\n');
|
|
158
|
+
for (const p of result.written)
|
|
159
|
+
process.stdout.write(bullet(p) + '\n');
|
|
160
|
+
}
|
|
161
|
+
if (result.skipped.length) {
|
|
162
|
+
process.stdout.write('\nSkipped (already exist; use --force to overwrite):\n');
|
|
163
|
+
for (const p of result.skipped)
|
|
164
|
+
process.stdout.write(bullet(p) + '\n');
|
|
165
|
+
}
|
|
166
|
+
if (!mode.skipGitignore) {
|
|
167
|
+
const patch = ensureSharkcraftGitignore({ cwd, dryRun: false });
|
|
168
|
+
if (patch.added.length > 0) {
|
|
169
|
+
process.stdout.write('\n' + renderGitignorePatch(patch, false));
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
process.stdout.write('\nNext:\n');
|
|
173
|
+
for (const cmd of preset.recommendedNextCommands ?? [
|
|
174
|
+
'shrk doctor',
|
|
175
|
+
'shrk context --task "<task>"',
|
|
176
|
+
]) {
|
|
177
|
+
process.stdout.write(bullet(`$ ${cmd}`) + '\n');
|
|
178
|
+
}
|
|
179
|
+
process.stdout.write(bullet('Start the MCP server: `shrk mcp serve` (or run it via Claude Code)') + '\n');
|
|
180
|
+
return 0;
|
|
181
|
+
}
|
|
182
|
+
function applyLegacyInit(cwd, force) {
|
|
183
|
+
const { root } = detectProjectRoot(cwd);
|
|
184
|
+
const sharkcraftDir = nodePath.join(root, 'sharkcraft');
|
|
185
|
+
if (existsSync(sharkcraftDir) && !force) {
|
|
186
|
+
process.stderr.write(`sharkcraft/ already exists at ${sharkcraftDir}. Use --force to overwrite individual files.\n`);
|
|
187
|
+
return 1;
|
|
188
|
+
}
|
|
189
|
+
mkdirSync(sharkcraftDir, { recursive: true });
|
|
190
|
+
const created = [];
|
|
191
|
+
const skipped = [];
|
|
192
|
+
for (const file of INIT_FILES) {
|
|
193
|
+
const fullPath = nodePath.join(sharkcraftDir, file.relativePath);
|
|
194
|
+
mkdirSync(nodePath.dirname(fullPath), { recursive: true });
|
|
195
|
+
if (existsSync(fullPath) && !force) {
|
|
196
|
+
skipped.push(file.relativePath);
|
|
197
|
+
continue;
|
|
198
|
+
}
|
|
199
|
+
writeFileSync(fullPath, file.content, 'utf8');
|
|
200
|
+
created.push(file.relativePath);
|
|
201
|
+
}
|
|
202
|
+
process.stdout.write(header('SharkCraft initialized'));
|
|
203
|
+
process.stdout.write(`Preset: ${LEGACY_PRESET_ID} (full seed)\n`);
|
|
204
|
+
process.stdout.write(`Folder: ${sharkcraftDir}\n`);
|
|
205
|
+
if (created.length) {
|
|
206
|
+
process.stdout.write('\nCreated files:\n');
|
|
207
|
+
for (const c of created)
|
|
208
|
+
process.stdout.write(bullet(c) + '\n');
|
|
209
|
+
}
|
|
210
|
+
if (skipped.length) {
|
|
211
|
+
process.stdout.write('\nSkipped (already exist; use --force to overwrite):\n');
|
|
212
|
+
for (const s of skipped)
|
|
213
|
+
process.stdout.write(bullet(s) + '\n');
|
|
214
|
+
}
|
|
215
|
+
process.stdout.write('\nNext:\n');
|
|
216
|
+
process.stdout.write(bullet('Run `shrk inspect` to see your project summary.') + '\n');
|
|
217
|
+
process.stdout.write(bullet('Run `shrk knowledge list` to see what was seeded.') + '\n');
|
|
218
|
+
process.stdout.write(bullet('Customize sharkcraft/rules.ts, paths.ts, templates.ts.') + '\n');
|
|
219
|
+
return 0;
|
|
220
|
+
}
|
|
221
|
+
export const initCommand = {
|
|
222
|
+
name: 'init',
|
|
223
|
+
description: 'Initialize a sharkcraft/ folder in the current repository. Pass --preset <id> to apply a built-in preset (default: generic). Use --zero-config or --preset auto to detect the workspace and pick a preset automatically. Use --legacy for the full pre-preset seed.',
|
|
224
|
+
usage: 'shrk init [--preset <id|auto>] [--zero-config] [--dry-run] [--write] [--legacy] [--force] [--merge] [--suggest-only] [--no-gitignore] [--surface-profile <id>]',
|
|
225
|
+
async run(args) {
|
|
226
|
+
const force = flagBool(args, 'force');
|
|
227
|
+
const merge = flagBool(args, 'merge');
|
|
228
|
+
const cwd = resolveCwd(args);
|
|
229
|
+
const skipGitignore = flagBool(args, 'no-gitignore');
|
|
230
|
+
if (flagBool(args, 'legacy')) {
|
|
231
|
+
const code = applyLegacyInit(cwd, force);
|
|
232
|
+
if (code === 0 && !skipGitignore) {
|
|
233
|
+
const patch = ensureSharkcraftGitignore({ cwd, dryRun: false });
|
|
234
|
+
if (patch.added.length > 0) {
|
|
235
|
+
process.stdout.write('\n' + renderGitignorePatch(patch, false));
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
return code;
|
|
239
|
+
}
|
|
240
|
+
// Suggest-only mode: detect profiles + print recommendations, do nothing else.
|
|
241
|
+
if (flagBool(args, 'suggest-only')) {
|
|
242
|
+
const ws = await inspectWorkspace({ startDir: cwd });
|
|
243
|
+
const recs = recommendPresets([...BUILTIN_PRESETS], { profiles: ws.profiles });
|
|
244
|
+
process.stdout.write(header('Suggested presets'));
|
|
245
|
+
process.stdout.write(`Detected profiles: ${ws.profiles.join(', ') || '(none)'}\n\n`);
|
|
246
|
+
for (const r of recs) {
|
|
247
|
+
process.stdout.write(` ${r.preset.id.padEnd(22)} ${r.confidence.padEnd(6)} ${r.preset.title}\n`);
|
|
248
|
+
}
|
|
249
|
+
return 0;
|
|
250
|
+
}
|
|
251
|
+
const rawPreset = flagString(args, 'preset');
|
|
252
|
+
const zeroConfig = flagBool(args, 'zero-config');
|
|
253
|
+
const isAuto = zeroConfig || rawPreset === 'auto';
|
|
254
|
+
let presetId;
|
|
255
|
+
let showDetected = false;
|
|
256
|
+
if (isAuto) {
|
|
257
|
+
const picked = await pickAutoPreset(cwd);
|
|
258
|
+
presetId = picked.presetId;
|
|
259
|
+
showDetected = true;
|
|
260
|
+
process.stdout.write(header('Zero-config preset selection'));
|
|
261
|
+
process.stdout.write(`Detected profiles: ${picked.profiles.join(', ') || '(none)'}\n`);
|
|
262
|
+
process.stdout.write(`Picked preset: ${presetId}\n`);
|
|
263
|
+
if (picked.reasons.length) {
|
|
264
|
+
process.stdout.write('Reasons:\n');
|
|
265
|
+
for (const r of picked.reasons)
|
|
266
|
+
process.stdout.write(bullet(r) + '\n');
|
|
267
|
+
}
|
|
268
|
+
process.stdout.write('\n');
|
|
269
|
+
}
|
|
270
|
+
else {
|
|
271
|
+
presetId = rawPreset ?? 'generic';
|
|
272
|
+
}
|
|
273
|
+
// Dry-run default for zero-config; explicit --dry-run also wins.
|
|
274
|
+
const dryRunFlag = flagBool(args, 'dry-run');
|
|
275
|
+
const writeFlag = flagBool(args, 'write');
|
|
276
|
+
const dryRun = (isAuto && !writeFlag) || (dryRunFlag && !writeFlag);
|
|
277
|
+
// Surface profile detection / override.
|
|
278
|
+
const surfaceProfileFlag = flagString(args, 'surface-profile');
|
|
279
|
+
let surfaceDecision = null;
|
|
280
|
+
try {
|
|
281
|
+
surfaceDecision = await resolveSurfaceProfile(cwd, surfaceProfileFlag ?? undefined);
|
|
282
|
+
}
|
|
283
|
+
catch (e) {
|
|
284
|
+
process.stderr.write(`${e.message}\n`);
|
|
285
|
+
return 2;
|
|
286
|
+
}
|
|
287
|
+
if (dryRun) {
|
|
288
|
+
process.stdout.write(`Surface profile: ${surfaceDecision.profile} (${surfaceDecision.source}) — ${surfaceDecision.reason}\n`);
|
|
289
|
+
}
|
|
290
|
+
return applyPresetInit(cwd, {
|
|
291
|
+
presetId,
|
|
292
|
+
dryRun,
|
|
293
|
+
force,
|
|
294
|
+
merge,
|
|
295
|
+
showDetectedProfiles: showDetected,
|
|
296
|
+
skipGitignore,
|
|
297
|
+
surfaceProfile: surfaceDecision.profile,
|
|
298
|
+
surfaceProfileReason: surfaceDecision.reason,
|
|
299
|
+
});
|
|
300
|
+
},
|
|
301
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspect.command.d.ts","sourceRoot":"","sources":["../../src/commands/inspect.command.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAIhC,eAAO,MAAM,cAAc,EAAE,eAqJ5B,CAAC"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { inspectSharkcraft, buildProjectOverview, renderOverviewText } from '@shrkcrft/inspector';
|
|
2
|
+
import { flagBool, flagNumber, resolveCwd, } from "../command-registry.js";
|
|
3
|
+
import { asJson, bullet, header, kv } from "../output/format-output.js";
|
|
4
|
+
import { buildDetectedBlock, renderDetectedBlockText } from "../init/detected-block.js";
|
|
5
|
+
export const inspectCommand = {
|
|
6
|
+
name: 'inspect',
|
|
7
|
+
description: 'Inspect the current repository (project, frameworks, package manager, sharkcraft setup). Prints a Detected block so a brand-new user can see what zero-config init would do. `--no-config` tolerates a missing sharkcraft/ folder without warnings. `--debug` emits per-loader timing/status; `--no-cache` bypasses the persistent loader cache; `--loader-timeout <ms>` bounds each TS-asset import.',
|
|
8
|
+
usage: 'shrk [--cwd <dir>] inspect [--no-config] [--json] [--debug] [--no-cache] [--loader-timeout <ms>]',
|
|
9
|
+
async run(args) {
|
|
10
|
+
const cwd = resolveCwd(args);
|
|
11
|
+
const noConfig = flagBool(args, 'no-config');
|
|
12
|
+
const noCache = flagBool(args, 'no-cache');
|
|
13
|
+
const debug = flagBool(args, 'debug');
|
|
14
|
+
const loaderTimeout = flagNumber(args, 'loader-timeout');
|
|
15
|
+
const inspectOpts = {
|
|
16
|
+
cwd,
|
|
17
|
+
useCache: !noCache,
|
|
18
|
+
};
|
|
19
|
+
if (typeof loaderTimeout === 'number' && loaderTimeout > 0) {
|
|
20
|
+
inspectOpts.loaderTimeoutMs = loaderTimeout;
|
|
21
|
+
}
|
|
22
|
+
const inspection = await inspectSharkcraft(inspectOpts);
|
|
23
|
+
const overview = buildProjectOverview(inspection.workspace, inspection.config?.projectName);
|
|
24
|
+
const detected = buildDetectedBlock(cwd, inspection.workspace);
|
|
25
|
+
if (flagBool(args, 'json')) {
|
|
26
|
+
process.stdout.write(asJson({
|
|
27
|
+
targetRoot: inspection.projectRoot,
|
|
28
|
+
overview,
|
|
29
|
+
workspace: {
|
|
30
|
+
projectRoot: inspection.workspace.projectRoot,
|
|
31
|
+
packageManager: inspection.workspace.packageManager,
|
|
32
|
+
frameworks: inspection.workspace.frameworks,
|
|
33
|
+
hasTypeScript: inspection.workspace.hasTypeScript,
|
|
34
|
+
scripts: Object.keys(inspection.workspace.scripts),
|
|
35
|
+
},
|
|
36
|
+
detected,
|
|
37
|
+
noConfig,
|
|
38
|
+
sharkcraft: {
|
|
39
|
+
hasFolder: inspection.hasSharkcraftFolder,
|
|
40
|
+
configFile: inspection.configFile,
|
|
41
|
+
sharkcraftDir: inspection.sharkcraftDir,
|
|
42
|
+
knowledgeCount: inspection.knowledgeEntries.length,
|
|
43
|
+
ruleCount: inspection.ruleService.list().length,
|
|
44
|
+
pathCount: inspection.pathService.list().length,
|
|
45
|
+
templateCount: inspection.templates.length,
|
|
46
|
+
},
|
|
47
|
+
loader: {
|
|
48
|
+
inspectionElapsedMs: inspection.inspectionElapsedMs,
|
|
49
|
+
cacheEnabled: inspection.cacheEnabled,
|
|
50
|
+
cacheDir: inspection.cacheDir,
|
|
51
|
+
diagnostics: inspection.loaderDiagnostics,
|
|
52
|
+
},
|
|
53
|
+
}) + '\n');
|
|
54
|
+
return 0;
|
|
55
|
+
}
|
|
56
|
+
process.stdout.write(header('Target'));
|
|
57
|
+
process.stdout.write(kv('root', inspection.projectRoot) + '\n');
|
|
58
|
+
process.stdout.write(header('Project'));
|
|
59
|
+
process.stdout.write(renderOverviewText(overview) + '\n');
|
|
60
|
+
process.stdout.write(header('Package manager'));
|
|
61
|
+
process.stdout.write(kv('manager', inspection.workspace.packageManager.manager) + '\n');
|
|
62
|
+
if (inspection.workspace.packageManager.version) {
|
|
63
|
+
process.stdout.write(kv('version', inspection.workspace.packageManager.version) + '\n');
|
|
64
|
+
}
|
|
65
|
+
if (inspection.workspace.packageManager.evidence.length) {
|
|
66
|
+
process.stdout.write(kv('evidence', inspection.workspace.packageManager.evidence.join(', ')) + '\n');
|
|
67
|
+
}
|
|
68
|
+
if (inspection.workspace.frameworks.length) {
|
|
69
|
+
process.stdout.write(header('Frameworks'));
|
|
70
|
+
for (const f of inspection.workspace.frameworks) {
|
|
71
|
+
process.stdout.write(bullet(`${f.name}${f.version ? ` (${f.version})` : ''}`) + '\n');
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
process.stdout.write(header('Detected'));
|
|
75
|
+
process.stdout.write(renderDetectedBlockText(detected) + '\n');
|
|
76
|
+
process.stdout.write(header('SharkCraft setup'));
|
|
77
|
+
process.stdout.write(kv('folder', inspection.sharkcraftDir ?? '(missing)') + '\n');
|
|
78
|
+
process.stdout.write(kv('config', inspection.configFile ?? '(none)') + '\n');
|
|
79
|
+
process.stdout.write(kv('knowledge entries', inspection.knowledgeEntries.length) + '\n');
|
|
80
|
+
process.stdout.write(kv('rules', inspection.ruleService.list().length) + '\n');
|
|
81
|
+
process.stdout.write(kv('path conventions', inspection.pathService.list().length) + '\n');
|
|
82
|
+
process.stdout.write(kv('templates', inspection.templates.length) + '\n');
|
|
83
|
+
// Under --no-config, downgrade missing-sharkcraft warnings so the
|
|
84
|
+
// small-repo experience is friendly. Filter out the canonical "no
|
|
85
|
+
// sharkcraft/" warning the inspector emits when the folder is absent.
|
|
86
|
+
const warningsToShow = noConfig
|
|
87
|
+
? inspection.warnings.filter((w) => !/sharkcraft.*not found|sharkcraft.*missing|no\s+sharkcraft/i.test(w))
|
|
88
|
+
: inspection.warnings;
|
|
89
|
+
if (warningsToShow.length) {
|
|
90
|
+
process.stdout.write(header('Warnings'));
|
|
91
|
+
for (const w of warningsToShow)
|
|
92
|
+
process.stdout.write(bullet(w) + '\n');
|
|
93
|
+
}
|
|
94
|
+
// Surface failed/timed-out/slow loaders outside of --debug so the
|
|
95
|
+
// user is not silently flying blind when a pack asset fails to load.
|
|
96
|
+
const problematic = inspection.loaderDiagnostics.filter((d) => d.status !== 'ok' || d.slow);
|
|
97
|
+
if (problematic.length > 0) {
|
|
98
|
+
process.stdout.write(header('Loader diagnostics'));
|
|
99
|
+
for (const d of problematic) {
|
|
100
|
+
process.stdout.write(bullet(`${d.kind} ${d.status} ${d.elapsedMs}ms ${d.filePath}${d.errorMessage ? ' — ' + d.errorMessage : ''}${d.suggestedNextCommand ? ' (try: ' + d.suggestedNextCommand + ')' : ''}`) + '\n');
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
if (debug) {
|
|
104
|
+
process.stdout.write(header('Loader timing (--debug)'));
|
|
105
|
+
process.stdout.write(kv('inspection elapsed', `${inspection.inspectionElapsedMs}ms`) + '\n');
|
|
106
|
+
process.stdout.write(kv('cache', inspection.cacheEnabled ? `on (${inspection.cacheDir})` : 'off') + '\n');
|
|
107
|
+
process.stdout.write(kv('loader entries', inspection.loaderDiagnostics.length) + '\n');
|
|
108
|
+
for (const d of inspection.loaderDiagnostics) {
|
|
109
|
+
process.stdout.write(` ${d.kind.padEnd(10)} ${d.status.padEnd(12)} ${String(d.elapsedMs).padStart(5)}ms count=${d.count}${d.deduped ? ' (deduped)' : ''}${d.largeFile ? ' (large)' : ''} ${d.filePath}\n`);
|
|
110
|
+
if (d.errorMessage)
|
|
111
|
+
process.stdout.write(` error: ${d.errorMessage}\n`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (!inspection.hasSharkcraftFolder) {
|
|
115
|
+
process.stdout.write('\nNo sharkcraft/ folder yet. Next: `shrk init --zero-config` to preview a preset based on detection above.\n');
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
process.stdout.write('\nNext: run `shrk doctor` to validate setup, then `shrk context --task "<task>"`.\n');
|
|
119
|
+
}
|
|
120
|
+
return 0;
|
|
121
|
+
},
|
|
122
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Knowledge authoring CLI surface.
|
|
3
|
+
*
|
|
4
|
+
* - `shrk knowledge add` — preview a new knowledge entry.
|
|
5
|
+
* - `shrk knowledge update <id>` — preview an incremental change.
|
|
6
|
+
* - `shrk knowledge remove <id>` — preview a removal (refuses if
|
|
7
|
+
* reverse references exist unless --force-preview).
|
|
8
|
+
* - `shrk knowledge author preview` — alias that classifies the
|
|
9
|
+
* operation by which flags were passed.
|
|
10
|
+
* - `shrk knowledge lint [--fix-preview]` — classify findings.
|
|
11
|
+
*
|
|
12
|
+
* All commands default to preview-only. Files land under
|
|
13
|
+
* `.sharkcraft/authoring/` (drafts) or `.sharkcraft/fixes/` (lint output).
|
|
14
|
+
* No direct mutation of `sharkcraft/knowledge.ts` or pack source.
|
|
15
|
+
*/
|
|
16
|
+
import { type ICommandHandler } from '../command-registry.js';
|
|
17
|
+
export declare const knowledgeAddCommand: ICommandHandler;
|
|
18
|
+
export declare const knowledgeUpdateCommand: ICommandHandler;
|
|
19
|
+
export declare const knowledgeRemoveCommand: ICommandHandler;
|
|
20
|
+
export declare const knowledgeLintCommand: ICommandHandler;
|
|
21
|
+
export declare const knowledgeAuthorPreviewCommand: ICommandHandler;
|
|
22
|
+
//# sourceMappingURL=knowledge-author.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledge-author.command.d.ts","sourceRoot":"","sources":["../../src/commands/knowledge-author.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAoBH,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAwChC,eAAO,MAAM,mBAAmB,EAAE,eAgEjC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,eA0GpC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,eAoEpC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,eA2DlC,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,eAmB3C,CAAC"}
|