@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,57 @@
|
|
|
1
|
+
import { type IWorkspaceSummary } from '@shrkcrft/workspace';
|
|
2
|
+
export declare enum DetectedConfidence {
|
|
3
|
+
Detected = "detected",
|
|
4
|
+
Inferred = "inferred",
|
|
5
|
+
NotFound = "not-found"
|
|
6
|
+
}
|
|
7
|
+
export interface IDetectedRow {
|
|
8
|
+
key: string;
|
|
9
|
+
value: string;
|
|
10
|
+
confidence: DetectedConfidence;
|
|
11
|
+
evidence?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface IDetectedRoots {
|
|
14
|
+
source: readonly string[];
|
|
15
|
+
test: readonly string[];
|
|
16
|
+
packages: readonly string[];
|
|
17
|
+
generated: readonly string[];
|
|
18
|
+
}
|
|
19
|
+
export interface IDetectedScripts {
|
|
20
|
+
build: string | null;
|
|
21
|
+
test: string | null;
|
|
22
|
+
typecheck: string | null;
|
|
23
|
+
lint: string | null;
|
|
24
|
+
start: string | null;
|
|
25
|
+
}
|
|
26
|
+
export interface IDetectedConfigs {
|
|
27
|
+
tsconfig: boolean;
|
|
28
|
+
eslint: boolean;
|
|
29
|
+
biome: boolean;
|
|
30
|
+
githubActions: boolean;
|
|
31
|
+
nx: boolean;
|
|
32
|
+
turbo: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface IDetectedPresetPick {
|
|
35
|
+
presetId: string;
|
|
36
|
+
title: string;
|
|
37
|
+
confidence: 'high' | 'medium' | 'low';
|
|
38
|
+
reasons: readonly string[];
|
|
39
|
+
}
|
|
40
|
+
export interface IDetectedBlock {
|
|
41
|
+
workspaceFlavor: string;
|
|
42
|
+
packageManager: string;
|
|
43
|
+
frameworks: readonly string[];
|
|
44
|
+
hasTypeScript: boolean;
|
|
45
|
+
roots: IDetectedRoots;
|
|
46
|
+
scripts: IDetectedScripts;
|
|
47
|
+
configs: IDetectedConfigs;
|
|
48
|
+
recommendedPreset: IDetectedPresetPick | null;
|
|
49
|
+
notGuessed: readonly string[];
|
|
50
|
+
}
|
|
51
|
+
export declare function buildDetectedBlock(cwd: string, summary: IWorkspaceSummary): IDetectedBlock;
|
|
52
|
+
/**
|
|
53
|
+
* Render the Detected block as plain text lines (one per line, no
|
|
54
|
+
* trailing newline). Callers add their own header / spacing.
|
|
55
|
+
*/
|
|
56
|
+
export declare function renderDetectedBlockText(block: IDetectedBlock): string;
|
|
57
|
+
//# sourceMappingURL=detected-block.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detected-block.d.ts","sourceRoot":"","sources":["../../src/init/detected-block.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAoB,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAG/E,oBAAY,kBAAkB;IAC5B,QAAQ,aAAa;IACrB,QAAQ,aAAa;IACrB,QAAQ,cAAc;CACvB;AAED,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,kBAAkB,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACxB,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;IACf,aAAa,EAAE,OAAO,CAAC;IACvB,EAAE,EAAE,OAAO,CAAC;IACZ,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;IACtC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CAC5B;AAED,MAAM,WAAW,cAAc;IAC7B,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9B,aAAa,EAAE,OAAO,CAAC;IACvB,KAAK,EAAE,cAAc,CAAC;IACtB,OAAO,EAAE,gBAAgB,CAAC;IAC1B,OAAO,EAAE,gBAAgB,CAAC;IAC1B,iBAAiB,EAAE,mBAAmB,GAAG,IAAI,CAAC;IAC9C,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;CAC/B;AAmHD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,GAAG,cAAc,CAe1F;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,CA0DrE"}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared "Detected" block builder used by `shrk inspect` and
|
|
3
|
+
* `shrk init`.
|
|
4
|
+
*
|
|
5
|
+
* Given the workspace summary and the cwd, this produces a structured
|
|
6
|
+
* snapshot of what SharkCraft can detect about the project without
|
|
7
|
+
* touching any config it has not been asked to touch. The block is
|
|
8
|
+
* read-only; it never writes files and never executes scripts.
|
|
9
|
+
*
|
|
10
|
+
* Why a shared module: both `inspect` and `init` need the same
|
|
11
|
+
* detection summary to give the user a coherent first-60-second story
|
|
12
|
+
* — "here is what I see; here is what I will do next". Duplicating it
|
|
13
|
+
* across two command files makes it drift.
|
|
14
|
+
*/
|
|
15
|
+
import { existsSync } from 'node:fs';
|
|
16
|
+
import * as nodePath from 'node:path';
|
|
17
|
+
import { WorkspaceProfile } from '@shrkcrft/workspace';
|
|
18
|
+
import { BUILTIN_PRESETS, recommendPresets } from '@shrkcrft/presets';
|
|
19
|
+
export var DetectedConfidence;
|
|
20
|
+
(function (DetectedConfidence) {
|
|
21
|
+
DetectedConfidence["Detected"] = "detected";
|
|
22
|
+
DetectedConfidence["Inferred"] = "inferred";
|
|
23
|
+
DetectedConfidence["NotFound"] = "not-found";
|
|
24
|
+
})(DetectedConfidence || (DetectedConfidence = {}));
|
|
25
|
+
const SOURCE_DIR_CANDIDATES = ['src', 'lib', 'app', 'source'];
|
|
26
|
+
const TEST_DIR_CANDIDATES = ['tests', 'test', '__tests__', 'spec', 'specs'];
|
|
27
|
+
const PACKAGE_DIR_CANDIDATES = ['packages', 'libs', 'apps'];
|
|
28
|
+
const GENERATED_DIR_CANDIDATES = ['dist', 'build', 'out', 'coverage', '.next', '.turbo'];
|
|
29
|
+
function fileExists(root, rel) {
|
|
30
|
+
return existsSync(nodePath.join(root, rel));
|
|
31
|
+
}
|
|
32
|
+
function detectRoots(cwd) {
|
|
33
|
+
return {
|
|
34
|
+
source: SOURCE_DIR_CANDIDATES.filter((d) => fileExists(cwd, d)),
|
|
35
|
+
test: TEST_DIR_CANDIDATES.filter((d) => fileExists(cwd, d)),
|
|
36
|
+
packages: PACKAGE_DIR_CANDIDATES.filter((d) => fileExists(cwd, d)),
|
|
37
|
+
generated: GENERATED_DIR_CANDIDATES.filter((d) => fileExists(cwd, d)),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function pickScript(scripts, prefer, contains) {
|
|
41
|
+
for (const name of prefer) {
|
|
42
|
+
if (typeof scripts[name] === 'string' && scripts[name].trim() !== '')
|
|
43
|
+
return name;
|
|
44
|
+
}
|
|
45
|
+
for (const [name, body] of Object.entries(scripts)) {
|
|
46
|
+
if (typeof body !== 'string')
|
|
47
|
+
continue;
|
|
48
|
+
for (const needle of contains) {
|
|
49
|
+
if (body.includes(needle) || name.includes(needle))
|
|
50
|
+
return name;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
function detectScripts(summary) {
|
|
56
|
+
const scripts = summary.scripts;
|
|
57
|
+
return {
|
|
58
|
+
build: pickScript(scripts, ['build', 'build:dist'], ['build']),
|
|
59
|
+
test: pickScript(scripts, ['test'], ['bun test', 'jest', 'vitest', 'mocha']),
|
|
60
|
+
typecheck: pickScript(scripts, ['typecheck', 'tsc', 'type-check'], ['tsc']),
|
|
61
|
+
lint: pickScript(scripts, ['lint'], ['eslint', 'biome']),
|
|
62
|
+
start: pickScript(scripts, ['start', 'dev', 'serve'], ['start', 'serve', 'dev']),
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function detectConfigs(cwd, summary) {
|
|
66
|
+
return {
|
|
67
|
+
tsconfig: summary.tsConfig !== null,
|
|
68
|
+
eslint: fileExists(cwd, '.eslintrc') ||
|
|
69
|
+
fileExists(cwd, '.eslintrc.js') ||
|
|
70
|
+
fileExists(cwd, '.eslintrc.cjs') ||
|
|
71
|
+
fileExists(cwd, '.eslintrc.json') ||
|
|
72
|
+
fileExists(cwd, '.eslintrc.yaml') ||
|
|
73
|
+
fileExists(cwd, '.eslintrc.yml') ||
|
|
74
|
+
fileExists(cwd, 'eslint.config.js') ||
|
|
75
|
+
fileExists(cwd, 'eslint.config.mjs') ||
|
|
76
|
+
fileExists(cwd, 'eslint.config.cjs') ||
|
|
77
|
+
fileExists(cwd, 'eslint.config.ts') ||
|
|
78
|
+
summary.profiles.includes(WorkspaceProfile.HasEslint),
|
|
79
|
+
biome: fileExists(cwd, 'biome.json') ||
|
|
80
|
+
fileExists(cwd, 'biome.jsonc') ||
|
|
81
|
+
summary.profiles.includes(WorkspaceProfile.HasBiome),
|
|
82
|
+
githubActions: fileExists(cwd, '.github/workflows') ||
|
|
83
|
+
summary.profiles.includes(WorkspaceProfile.HasGithubActions),
|
|
84
|
+
nx: summary.profiles.includes(WorkspaceProfile.HasNx) || fileExists(cwd, 'nx.json'),
|
|
85
|
+
turbo: summary.profiles.includes(WorkspaceProfile.HasTurborepo) || fileExists(cwd, 'turbo.json'),
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
function detectWorkspaceFlavor(summary, configs) {
|
|
89
|
+
if (configs.nx)
|
|
90
|
+
return 'Nx workspace';
|
|
91
|
+
if (configs.turbo)
|
|
92
|
+
return 'Turborepo workspace';
|
|
93
|
+
if (summary.profiles.includes(WorkspaceProfile.HasPackageWorkspaces)) {
|
|
94
|
+
return 'npm/pnpm/yarn workspaces';
|
|
95
|
+
}
|
|
96
|
+
if (summary.profiles.includes(WorkspaceProfile.IsMonorepo)) {
|
|
97
|
+
return 'monorepo (untyped)';
|
|
98
|
+
}
|
|
99
|
+
return 'single package';
|
|
100
|
+
}
|
|
101
|
+
function pickRecommendedPreset(summary) {
|
|
102
|
+
const recs = recommendPresets([...BUILTIN_PRESETS], {
|
|
103
|
+
profiles: summary.profiles,
|
|
104
|
+
limit: 1,
|
|
105
|
+
});
|
|
106
|
+
const top = recs[0];
|
|
107
|
+
if (!top)
|
|
108
|
+
return null;
|
|
109
|
+
const preset = top.preset;
|
|
110
|
+
return {
|
|
111
|
+
presetId: preset.id,
|
|
112
|
+
title: preset.title,
|
|
113
|
+
confidence: top.confidence,
|
|
114
|
+
reasons: top.reasons,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
function notGuessedFor(roots, configs) {
|
|
118
|
+
const missing = [];
|
|
119
|
+
if (roots.source.length === 0)
|
|
120
|
+
missing.push('source roots (no src/lib/app dir detected)');
|
|
121
|
+
if (roots.test.length === 0)
|
|
122
|
+
missing.push('test roots (no tests/test/__tests__ dir detected)');
|
|
123
|
+
if (!configs.tsconfig)
|
|
124
|
+
missing.push('tsconfig.json (no TypeScript config detected)');
|
|
125
|
+
if (!configs.eslint && !configs.biome) {
|
|
126
|
+
missing.push('lint config (no ESLint or Biome config detected)');
|
|
127
|
+
}
|
|
128
|
+
return missing;
|
|
129
|
+
}
|
|
130
|
+
export function buildDetectedBlock(cwd, summary) {
|
|
131
|
+
const roots = detectRoots(cwd);
|
|
132
|
+
const configs = detectConfigs(cwd, summary);
|
|
133
|
+
const scripts = detectScripts(summary);
|
|
134
|
+
return {
|
|
135
|
+
workspaceFlavor: detectWorkspaceFlavor(summary, configs),
|
|
136
|
+
packageManager: summary.packageManager.manager,
|
|
137
|
+
frameworks: summary.frameworks.map((f) => f.name),
|
|
138
|
+
hasTypeScript: summary.hasTypeScript,
|
|
139
|
+
roots,
|
|
140
|
+
scripts,
|
|
141
|
+
configs,
|
|
142
|
+
recommendedPreset: pickRecommendedPreset(summary),
|
|
143
|
+
notGuessed: notGuessedFor(roots, configs),
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Render the Detected block as plain text lines (one per line, no
|
|
148
|
+
* trailing newline). Callers add their own header / spacing.
|
|
149
|
+
*/
|
|
150
|
+
export function renderDetectedBlockText(block) {
|
|
151
|
+
const lines = [];
|
|
152
|
+
const pad = (k) => ` ${k.padEnd(20)}`;
|
|
153
|
+
lines.push(`${pad('workspace flavor')} ${block.workspaceFlavor}`);
|
|
154
|
+
lines.push(`${pad('package manager')} ${block.packageManager}`);
|
|
155
|
+
lines.push(`${pad('frameworks')} ${block.frameworks.length ? block.frameworks.join(', ') : '(none)'}`);
|
|
156
|
+
lines.push(`${pad('typescript')} ${block.hasTypeScript ? 'yes' : 'no'}`);
|
|
157
|
+
lines.push(`${pad('source roots')} ${block.roots.source.length ? block.roots.source.join(', ') : '(not detected)'}`);
|
|
158
|
+
lines.push(`${pad('test roots')} ${block.roots.test.length ? block.roots.test.join(', ') : '(not detected)'}`);
|
|
159
|
+
if (block.roots.packages.length) {
|
|
160
|
+
lines.push(`${pad('package roots')} ${block.roots.packages.join(', ')}`);
|
|
161
|
+
}
|
|
162
|
+
if (block.roots.generated.length) {
|
|
163
|
+
lines.push(`${pad('generated dirs')} ${block.roots.generated.join(', ')}`);
|
|
164
|
+
}
|
|
165
|
+
lines.push(`${pad('scripts')} ${[
|
|
166
|
+
block.scripts.build && `build=${block.scripts.build}`,
|
|
167
|
+
block.scripts.test && `test=${block.scripts.test}`,
|
|
168
|
+
block.scripts.typecheck && `typecheck=${block.scripts.typecheck}`,
|
|
169
|
+
block.scripts.lint && `lint=${block.scripts.lint}`,
|
|
170
|
+
block.scripts.start && `start=${block.scripts.start}`,
|
|
171
|
+
]
|
|
172
|
+
.filter(Boolean)
|
|
173
|
+
.join(' ') || '(none detected)'}`);
|
|
174
|
+
lines.push(`${pad('configs')} ${[
|
|
175
|
+
block.configs.tsconfig && 'tsconfig',
|
|
176
|
+
block.configs.eslint && 'eslint',
|
|
177
|
+
block.configs.biome && 'biome',
|
|
178
|
+
block.configs.githubActions && 'github-actions',
|
|
179
|
+
block.configs.nx && 'nx.json',
|
|
180
|
+
block.configs.turbo && 'turbo.json',
|
|
181
|
+
]
|
|
182
|
+
.filter(Boolean)
|
|
183
|
+
.join(', ') || '(none detected)'}`);
|
|
184
|
+
if (block.recommendedPreset) {
|
|
185
|
+
lines.push(`${pad('recommended preset')} ${block.recommendedPreset.presetId} (${block.recommendedPreset.confidence})`);
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
lines.push(`${pad('recommended preset')} (none matched — would fall back to generic)`);
|
|
189
|
+
}
|
|
190
|
+
if (block.notGuessed.length) {
|
|
191
|
+
lines.push(' not guessed:');
|
|
192
|
+
for (const n of block.notGuessed) {
|
|
193
|
+
lines.push(` • ${n}`);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
return lines.join('\n');
|
|
197
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** Patterns SharkCraft needs ignored. Order is stable for diff output. */
|
|
2
|
+
export declare const SHARKCRAFT_GITIGNORE_PATTERNS: readonly string[];
|
|
3
|
+
export interface IGitignorePatch {
|
|
4
|
+
/** Absolute path of the .gitignore file (created or updated). */
|
|
5
|
+
readonly path: string;
|
|
6
|
+
/** True if the file did not exist before this call. */
|
|
7
|
+
readonly created: boolean;
|
|
8
|
+
/** Patterns that were already present before this call. */
|
|
9
|
+
readonly alreadyPresent: readonly string[];
|
|
10
|
+
/** Patterns that this patch adds. Empty when nothing to do. */
|
|
11
|
+
readonly added: readonly string[];
|
|
12
|
+
/** New file body the patch would write (or wrote, when `dryRun: false`). */
|
|
13
|
+
readonly nextBody: string;
|
|
14
|
+
/** True if `dryRun: false` actually wrote. */
|
|
15
|
+
readonly wrote: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface IGitignorePatchOptions {
|
|
18
|
+
/** Project root that owns the `.gitignore`. */
|
|
19
|
+
readonly cwd: string;
|
|
20
|
+
/** When true, compute the patch without writing. Default true. */
|
|
21
|
+
readonly dryRun?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Computes (and optionally applies) the gitignore patch that ensures all
|
|
25
|
+
* SharkCraft local-state directories are ignored. Idempotent.
|
|
26
|
+
*/
|
|
27
|
+
export declare function ensureSharkcraftGitignore(options: IGitignorePatchOptions): IGitignorePatch;
|
|
28
|
+
/** Render a short human summary of the patch. */
|
|
29
|
+
export declare function renderGitignorePatch(patch: IGitignorePatch, dryRun: boolean): string;
|
|
30
|
+
//# sourceMappingURL=gitignore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitignore.d.ts","sourceRoot":"","sources":["../../src/init/gitignore.ts"],"names":[],"mappings":"AAeA,0EAA0E;AAC1E,eAAO,MAAM,6BAA6B,EAAE,SAAS,MAAM,EAY1D,CAAC;AAKF,MAAM,WAAW,eAAe;IAC9B,iEAAiE;IACjE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,uDAAuD;IACvD,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,2DAA2D;IAC3D,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,+DAA+D;IAC/D,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,4EAA4E;IAC5E,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,8CAA8C;IAC9C,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,sBAAsB;IACrC,+CAA+C;IAC/C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,kEAAkE;IAClE,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,sBAAsB,GAC9B,eAAe,CA+DjB;AAED,iDAAiD;AACjD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,CAapF"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `.gitignore` safety for SharkCraft local state.
|
|
3
|
+
*
|
|
4
|
+
* `init` (any preset path) and `doctor --check-gitignore` rely on this to
|
|
5
|
+
* make sure the directories SharkCraft writes locally — sessions, reports,
|
|
6
|
+
* fixes, authoring drafts, memory snapshots, tmp, cache — never land in
|
|
7
|
+
* commits by accident. Project-config under `sharkcraft/` (the
|
|
8
|
+
* deterministic input the engine consumes) stays committed.
|
|
9
|
+
*
|
|
10
|
+
* Idempotent: running the patch twice is a no-op.
|
|
11
|
+
* Preview-first: callers pass `dryRun: true` to inspect the diff.
|
|
12
|
+
*/
|
|
13
|
+
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
|
|
14
|
+
import * as nodePath from 'node:path';
|
|
15
|
+
/** Patterns SharkCraft needs ignored. Order is stable for diff output. */
|
|
16
|
+
export const SHARKCRAFT_GITIGNORE_PATTERNS = [
|
|
17
|
+
'.sharkcraft/sessions/',
|
|
18
|
+
'.sharkcraft/reports/',
|
|
19
|
+
'.sharkcraft/fixes/',
|
|
20
|
+
'.sharkcraft/authoring/',
|
|
21
|
+
'.sharkcraft/memory/',
|
|
22
|
+
'.sharkcraft/tmp/',
|
|
23
|
+
'.sharkcraft/cache/',
|
|
24
|
+
// Local-only command usage log (writes only; no exfiltration).
|
|
25
|
+
'.sharkcraft/usage/',
|
|
26
|
+
// Cached project-shape detection.
|
|
27
|
+
'.sharkcraft/shape.json',
|
|
28
|
+
];
|
|
29
|
+
const MARKER_START = '# >>> sharkcraft local state (managed by `shrk init`)';
|
|
30
|
+
const MARKER_END = '# <<< sharkcraft local state';
|
|
31
|
+
/**
|
|
32
|
+
* Computes (and optionally applies) the gitignore patch that ensures all
|
|
33
|
+
* SharkCraft local-state directories are ignored. Idempotent.
|
|
34
|
+
*/
|
|
35
|
+
export function ensureSharkcraftGitignore(options) {
|
|
36
|
+
const cwd = options.cwd;
|
|
37
|
+
const dryRun = options.dryRun !== false;
|
|
38
|
+
const filePath = nodePath.join(cwd, '.gitignore');
|
|
39
|
+
const existingBody = existsSync(filePath) ? readFileSync(filePath, 'utf8') : '';
|
|
40
|
+
const created = existingBody.length === 0;
|
|
41
|
+
const existingLines = existingBody.split(/\r?\n/);
|
|
42
|
+
const presentSet = new Set();
|
|
43
|
+
for (const line of existingLines) {
|
|
44
|
+
const trimmed = line.trim();
|
|
45
|
+
if (!trimmed || trimmed.startsWith('#'))
|
|
46
|
+
continue;
|
|
47
|
+
presentSet.add(trimmed);
|
|
48
|
+
}
|
|
49
|
+
const alreadyPresent = [];
|
|
50
|
+
const toAdd = [];
|
|
51
|
+
for (const pattern of SHARKCRAFT_GITIGNORE_PATTERNS) {
|
|
52
|
+
if (presentSet.has(pattern))
|
|
53
|
+
alreadyPresent.push(pattern);
|
|
54
|
+
else
|
|
55
|
+
toAdd.push(pattern);
|
|
56
|
+
}
|
|
57
|
+
if (toAdd.length === 0) {
|
|
58
|
+
return {
|
|
59
|
+
path: filePath,
|
|
60
|
+
created: false,
|
|
61
|
+
alreadyPresent,
|
|
62
|
+
added: [],
|
|
63
|
+
nextBody: existingBody,
|
|
64
|
+
wrote: false,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
const block = [
|
|
68
|
+
MARKER_START,
|
|
69
|
+
...toAdd,
|
|
70
|
+
MARKER_END,
|
|
71
|
+
].join('\n');
|
|
72
|
+
// Append the managed block; preserve trailing newline behaviour.
|
|
73
|
+
let nextBody;
|
|
74
|
+
if (existingBody.length === 0) {
|
|
75
|
+
nextBody = block + '\n';
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
const needsLeadingNewline = !existingBody.endsWith('\n');
|
|
79
|
+
nextBody = existingBody + (needsLeadingNewline ? '\n\n' : '\n') + block + '\n';
|
|
80
|
+
}
|
|
81
|
+
let wrote = false;
|
|
82
|
+
if (!dryRun) {
|
|
83
|
+
writeFileSync(filePath, nextBody, 'utf8');
|
|
84
|
+
wrote = true;
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
path: filePath,
|
|
88
|
+
created,
|
|
89
|
+
alreadyPresent,
|
|
90
|
+
added: toAdd,
|
|
91
|
+
nextBody,
|
|
92
|
+
wrote,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
/** Render a short human summary of the patch. */
|
|
96
|
+
export function renderGitignorePatch(patch, dryRun) {
|
|
97
|
+
const lines = [];
|
|
98
|
+
lines.push(`.gitignore — ${dryRun ? 'preview' : 'updated'}`);
|
|
99
|
+
lines.push(` file: ${patch.path}`);
|
|
100
|
+
lines.push(` created file: ${patch.created ? 'yes' : 'no'}`);
|
|
101
|
+
lines.push(` patterns kept: ${patch.alreadyPresent.length}`);
|
|
102
|
+
lines.push(` patterns added: ${patch.added.length}`);
|
|
103
|
+
if (patch.added.length > 0) {
|
|
104
|
+
lines.push('');
|
|
105
|
+
lines.push(' Would add:');
|
|
106
|
+
for (const p of patch.added)
|
|
107
|
+
lines.push(` + ${p}`);
|
|
108
|
+
}
|
|
109
|
+
return lines.join('\n') + '\n';
|
|
110
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init-templates.d.ts","sourceRoot":"","sources":["../../src/init/init-templates.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,UAAU,EAAE,SAAS,SAAS,EA4Z1C,CAAC"}
|