@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,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centralised failure-to-success hint formatter.
|
|
3
|
+
*
|
|
4
|
+
* Keeps the "next command" message consistent across high-friction
|
|
5
|
+
* commands. Each helper emits a compact one-paragraph "Next commands"
|
|
6
|
+
* block on stdout.
|
|
7
|
+
*/
|
|
8
|
+
export interface IFailureHint {
|
|
9
|
+
label: string;
|
|
10
|
+
command: string;
|
|
11
|
+
/** Optional doc link. */
|
|
12
|
+
doc?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function renderFailureHints(hints: readonly IFailureHint[]): string;
|
|
15
|
+
export declare function doctorHints(): IFailureHint[];
|
|
16
|
+
export declare function staleKnowledgeHints(): IFailureHint[];
|
|
17
|
+
export declare function templateDriftHints(): IFailureHint[];
|
|
18
|
+
export declare function fuzzyImpactAmbiguousHints(): IFailureHint[];
|
|
19
|
+
export declare function agentTestMissingExpectedHints(): IFailureHint[];
|
|
20
|
+
export declare function ciReportEmptyHints(): IFailureHint[];
|
|
21
|
+
export declare function feedbackRulesDoctorHints(): IFailureHint[];
|
|
22
|
+
/**
|
|
23
|
+
* Standardised error footer for important failures.
|
|
24
|
+
*
|
|
25
|
+
* Next:
|
|
26
|
+
* <command>
|
|
27
|
+
*
|
|
28
|
+
* Why:
|
|
29
|
+
* <one sentence>
|
|
30
|
+
*
|
|
31
|
+
* More detail (optional):
|
|
32
|
+
* <command>
|
|
33
|
+
*
|
|
34
|
+
* Centralized so unknown-command / ambiguous-command / apply-rejected /
|
|
35
|
+
* signature-mismatch / contract-gate-blocked / folder-op-unsafe /
|
|
36
|
+
* doctor-failed / self-config-doctor-failed / stale-pack-signature /
|
|
37
|
+
* project-coupling-audit / templates-drift / knowledge-stale-check all
|
|
38
|
+
* read the same way.
|
|
39
|
+
*/
|
|
40
|
+
export interface IErrorFooter {
|
|
41
|
+
next: string;
|
|
42
|
+
why: string;
|
|
43
|
+
more?: string | readonly string[];
|
|
44
|
+
}
|
|
45
|
+
export declare function renderErrorFooter(footer: IErrorFooter): string;
|
|
46
|
+
export type ErrorFooterKind = 'unknown-command' | 'ambiguous-command' | 'apply-rejected' | 'signature-mismatch' | 'contract-gate-blocked' | 'folder-op-unsafe' | 'doctor-failed' | 'self-config-doctor-failed' | 'stale-pack-signature' | 'project-coupling-audit-failed' | 'templates-drift-failed' | 'knowledge-stale-check-failed';
|
|
47
|
+
/**
|
|
48
|
+
* Canonical footer per failure kind. Returns `undefined` if the
|
|
49
|
+
* caller wants to fall through to a bespoke message (we don't crash if
|
|
50
|
+
* a new kind is added without a wired footer).
|
|
51
|
+
*/
|
|
52
|
+
export declare function errorFooterFor(kind: ErrorFooterKind, context?: {
|
|
53
|
+
task?: string;
|
|
54
|
+
}): IErrorFooter | undefined;
|
|
55
|
+
//# sourceMappingURL=failure-hints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"failure-hints.d.ts","sourceRoot":"","sources":["../../src/output/failure-hints.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,yBAAyB;IACzB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,SAAS,YAAY,EAAE,GAAG,MAAM,CAUzE;AAID,wBAAgB,WAAW,IAAI,YAAY,EAAE,CAM5C;AAED,wBAAgB,mBAAmB,IAAI,YAAY,EAAE,CAMpD;AAED,wBAAgB,kBAAkB,IAAI,YAAY,EAAE,CAMnD;AAED,wBAAgB,yBAAyB,IAAI,YAAY,EAAE,CAK1D;AAED,wBAAgB,6BAA6B,IAAI,YAAY,EAAE,CAK9D;AAED,wBAAgB,kBAAkB,IAAI,YAAY,EAAE,CAKnD;AAED,wBAAgB,wBAAwB,IAAI,YAAY,EAAE,CAKzD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC;CACnC;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAiB9D;AAED,MAAM,MAAM,eAAe,GACvB,iBAAiB,GACjB,mBAAmB,GACnB,gBAAgB,GAChB,oBAAoB,GACpB,uBAAuB,GACvB,kBAAkB,GAClB,eAAe,GACf,2BAA2B,GAC3B,sBAAsB,GACtB,+BAA+B,GAC/B,wBAAwB,GACxB,8BAA8B,CAAC;AAEnC;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,YAAY,GAAG,SAAS,CA4E3G"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
export function renderFailureHints(hints) {
|
|
2
|
+
if (hints.length === 0)
|
|
3
|
+
return '';
|
|
4
|
+
const lines = [];
|
|
5
|
+
lines.push('');
|
|
6
|
+
lines.push('Next commands:');
|
|
7
|
+
for (const h of hints) {
|
|
8
|
+
lines.push(` $ ${h.command} # ${h.label}`);
|
|
9
|
+
if (h.doc)
|
|
10
|
+
lines.push(` docs: ${h.doc}`);
|
|
11
|
+
}
|
|
12
|
+
return lines.join('\n') + '\n';
|
|
13
|
+
}
|
|
14
|
+
// ── Convenience hint builders ──────────────────────────────────────────
|
|
15
|
+
export function doctorHints() {
|
|
16
|
+
return [
|
|
17
|
+
{ label: 'preview fix suggestions', command: 'shrk fix preview --action-hints' },
|
|
18
|
+
{ label: 'list suppressions', command: 'shrk doctor suppressions list' },
|
|
19
|
+
{ label: 'watch loop', command: 'shrk doctor --watch --once' },
|
|
20
|
+
];
|
|
21
|
+
}
|
|
22
|
+
export function staleKnowledgeHints() {
|
|
23
|
+
return [
|
|
24
|
+
{ label: 'preview rename', command: 'shrk knowledge rename-symbol <old> <new> --dry-run' },
|
|
25
|
+
{ label: 'list references', command: 'shrk knowledge references <id>' },
|
|
26
|
+
{ label: 'fix preview', command: 'shrk fix preview --knowledge-stale' },
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
export function templateDriftHints() {
|
|
30
|
+
return [
|
|
31
|
+
{ label: 'fix preview', command: 'shrk fix preview --template-drift' },
|
|
32
|
+
{ label: 'inspect template', command: 'shrk templates get <id>' },
|
|
33
|
+
{ label: 'verify paths', command: 'shrk templates verify-paths' },
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
export function fuzzyImpactAmbiguousHints() {
|
|
37
|
+
return [
|
|
38
|
+
{ label: 'resolve only', command: 'shrk impact <query> --resolve-only' },
|
|
39
|
+
{ label: 'trace alternatives', command: 'shrk trace <query>' },
|
|
40
|
+
];
|
|
41
|
+
}
|
|
42
|
+
export function agentTestMissingExpectedHints() {
|
|
43
|
+
return [
|
|
44
|
+
{ label: 'explain a missing id', command: 'shrk why <id> --for-task "<task>"' },
|
|
45
|
+
{ label: 'explain why not', command: 'shrk why-not <id> --for-task "<task>"' },
|
|
46
|
+
];
|
|
47
|
+
}
|
|
48
|
+
export function ciReportEmptyHints() {
|
|
49
|
+
return [
|
|
50
|
+
{ label: 'scaffold integrity gates', command: 'shrk ci scaffold github-actions --with-integrity' },
|
|
51
|
+
{ label: 'run gates locally', command: 'shrk quality --ci' },
|
|
52
|
+
];
|
|
53
|
+
}
|
|
54
|
+
export function feedbackRulesDoctorHints() {
|
|
55
|
+
return [
|
|
56
|
+
{ label: 'list rules', command: 'shrk feedback rules list --with-pack-rules' },
|
|
57
|
+
{ label: 'ingest sample', command: 'shrk feedback ingest <file> --with-pack-rules' },
|
|
58
|
+
];
|
|
59
|
+
}
|
|
60
|
+
export function renderErrorFooter(footer) {
|
|
61
|
+
const lines = [];
|
|
62
|
+
lines.push('');
|
|
63
|
+
lines.push('Next:');
|
|
64
|
+
lines.push(` $ ${footer.next}`);
|
|
65
|
+
lines.push('');
|
|
66
|
+
lines.push('Why:');
|
|
67
|
+
lines.push(` ${footer.why}`);
|
|
68
|
+
if (footer.more) {
|
|
69
|
+
lines.push('');
|
|
70
|
+
lines.push('More detail:');
|
|
71
|
+
const moreCommands = typeof footer.more === 'string' ? [footer.more] : footer.more;
|
|
72
|
+
for (const cmd of moreCommands) {
|
|
73
|
+
lines.push(` $ ${cmd}`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return lines.join('\n') + '\n';
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Canonical footer per failure kind. Returns `undefined` if the
|
|
80
|
+
* caller wants to fall through to a bespoke message (we don't crash if
|
|
81
|
+
* a new kind is added without a wired footer).
|
|
82
|
+
*/
|
|
83
|
+
export function errorFooterFor(kind, context) {
|
|
84
|
+
const task = context?.task ?? '<task>';
|
|
85
|
+
switch (kind) {
|
|
86
|
+
case 'unknown-command':
|
|
87
|
+
return {
|
|
88
|
+
next: `shrk recommend "${task}"`,
|
|
89
|
+
why: 'Free-form input routes to the canonical human entrypoint — `shrk recommend` ranks commands for a query without writes.',
|
|
90
|
+
more: ['shrk commands', 'shrk commands suggest "<partial>"', 'shrk start-here'],
|
|
91
|
+
};
|
|
92
|
+
case 'ambiguous-command':
|
|
93
|
+
return {
|
|
94
|
+
next: 'shrk commands suggest "<partial>"',
|
|
95
|
+
why: 'Multiple commands matched the input — narrow it down or pick the canonical entrypoint.',
|
|
96
|
+
more: ['shrk commands explain <cmd>', 'shrk commands overlaps'],
|
|
97
|
+
};
|
|
98
|
+
case 'apply-rejected':
|
|
99
|
+
return {
|
|
100
|
+
next: 'shrk plan review <plan.json>',
|
|
101
|
+
why: 'The apply gate refused the plan — review the safety report before retrying.',
|
|
102
|
+
more: ['shrk plan verify <plan.json>', 'shrk safety audit --deep'],
|
|
103
|
+
};
|
|
104
|
+
case 'signature-mismatch':
|
|
105
|
+
return {
|
|
106
|
+
next: 'shrk plan verify <plan.json>',
|
|
107
|
+
why: 'The plan signature does not match the source content — re-sign or regenerate before retrying.',
|
|
108
|
+
more: ['shrk plan sign <plan.json>', 'shrk gen <template> --save-plan <plan.json>'],
|
|
109
|
+
};
|
|
110
|
+
case 'contract-gate-blocked':
|
|
111
|
+
return {
|
|
112
|
+
next: 'shrk contract status <id>',
|
|
113
|
+
why: 'The contract gate refused the apply — inspect the contract before approving.',
|
|
114
|
+
more: ['shrk contract check <id>', 'shrk contract approve <id>'],
|
|
115
|
+
};
|
|
116
|
+
case 'folder-op-unsafe':
|
|
117
|
+
return {
|
|
118
|
+
next: 'shrk plan review <plan.json>',
|
|
119
|
+
why: 'The plan touches files outside the project scope — review before applying.',
|
|
120
|
+
more: ['shrk safety audit --deep', 'shrk check boundaries --changed-only'],
|
|
121
|
+
};
|
|
122
|
+
case 'doctor-failed':
|
|
123
|
+
return {
|
|
124
|
+
next: 'shrk doctor',
|
|
125
|
+
why: 'Workspace doctor reported errors — fix or suppress them before continuing.',
|
|
126
|
+
more: ['shrk doctor suppressions list', 'shrk fix preview --action-hints', 'shrk self-config doctor'],
|
|
127
|
+
};
|
|
128
|
+
case 'self-config-doctor-failed':
|
|
129
|
+
return {
|
|
130
|
+
next: 'shrk self-config doctor',
|
|
131
|
+
why: 'The cross-reference doctor reported issues — fix the contributions or rebuild the graph.',
|
|
132
|
+
more: ['shrk packs doctor --require-signatures', 'shrk self-config graph'],
|
|
133
|
+
};
|
|
134
|
+
case 'stale-pack-signature':
|
|
135
|
+
return {
|
|
136
|
+
next: 'shrk packs sign <pack>',
|
|
137
|
+
why: 'A pack manifest changed after it was signed — re-sign to restore the trust chain.',
|
|
138
|
+
more: ['shrk packs verify <pack>', 'shrk packs signature-status'],
|
|
139
|
+
};
|
|
140
|
+
case 'project-coupling-audit-failed':
|
|
141
|
+
return {
|
|
142
|
+
next: 'shrk audit project-coupling audit --token "<token>" --fail-on engine',
|
|
143
|
+
why: 'Project-specific tokens leaked into the SharkCraft engine — move them into the appropriate pack.',
|
|
144
|
+
more: ['shrk impact --files "<file>"', 'shrk explore packages/<pkg>'],
|
|
145
|
+
};
|
|
146
|
+
case 'templates-drift-failed':
|
|
147
|
+
return {
|
|
148
|
+
next: 'shrk templates drift --min-severity warning',
|
|
149
|
+
why: 'A template body diverged from its declared shape — regenerate or update the template.',
|
|
150
|
+
more: ['shrk fix preview --template-drift', 'shrk templates verify-paths'],
|
|
151
|
+
};
|
|
152
|
+
case 'knowledge-stale-check-failed':
|
|
153
|
+
return {
|
|
154
|
+
next: 'shrk knowledge stale-check --ci',
|
|
155
|
+
why: 'A knowledge anchor moved or vanished — refresh the anchor or remove the entry.',
|
|
156
|
+
more: ['shrk fix preview --knowledge-stale', 'shrk knowledge references <id>'],
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function header(text: string): string;
|
|
2
|
+
export declare function bullet(text: string): string;
|
|
3
|
+
export declare function kv(key: string, value: string | number | boolean | undefined | null): string;
|
|
4
|
+
export declare function asJson(value: unknown): string;
|
|
5
|
+
export declare function table(rows: readonly (readonly string[])[]): string;
|
|
6
|
+
export interface PrintOptions {
|
|
7
|
+
json?: boolean;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=format-output.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-output.d.ts","sourceRoot":"","sources":["../../src/output/format-output.ts"],"names":[],"mappings":"AAAA,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE3C;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE3C;AAED,wBAAgB,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,CAG3F;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAE7C;AAED,wBAAgB,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,GAAG,MAAM,CAWlE;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export function header(text) {
|
|
2
|
+
return `\n=== ${text} ===\n`;
|
|
3
|
+
}
|
|
4
|
+
export function bullet(text) {
|
|
5
|
+
return ` • ${text}`;
|
|
6
|
+
}
|
|
7
|
+
export function kv(key, value) {
|
|
8
|
+
const v = value === undefined || value === null ? '(none)' : String(value);
|
|
9
|
+
return ` ${key.padEnd(18)} ${v}`;
|
|
10
|
+
}
|
|
11
|
+
export function asJson(value) {
|
|
12
|
+
return JSON.stringify(value, null, 2);
|
|
13
|
+
}
|
|
14
|
+
export function table(rows) {
|
|
15
|
+
if (rows.length === 0)
|
|
16
|
+
return '';
|
|
17
|
+
const widths = [];
|
|
18
|
+
for (const row of rows) {
|
|
19
|
+
for (let i = 0; i < row.length; i += 1) {
|
|
20
|
+
widths[i] = Math.max(widths[i] ?? 0, (row[i] ?? '').length);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return rows
|
|
24
|
+
.map((row) => row.map((cell, i) => (cell ?? '').padEnd(widths[i] ?? 0)).join(' ').trimEnd())
|
|
25
|
+
.join('\n');
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"print-error.d.ts","sourceRoot":"","sources":["../../src/output/print-error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,wBAAgB,UAAU,CAAC,KAAK,EAAE,QAAQ,GAAG,KAAK,GAAG,IAAI,CAWxD"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export function printError(error) {
|
|
2
|
+
if ('code' in error) {
|
|
3
|
+
const ae = error;
|
|
4
|
+
process.stderr.write(`Error [${ae.code}]: ${ae.message}\n`);
|
|
5
|
+
if (ae.suggestion)
|
|
6
|
+
process.stderr.write(` hint: ${ae.suggestion}\n`);
|
|
7
|
+
if (ae.details && Object.keys(ae.details).length) {
|
|
8
|
+
process.stderr.write(` details: ${JSON.stringify(ae.details)}\n`);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
process.stderr.write(`Error: ${error.message}\n`);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export interface IWatchLoopOptions {
|
|
2
|
+
cwd: string;
|
|
3
|
+
/** Run a single iteration and exit. */
|
|
4
|
+
once?: boolean;
|
|
5
|
+
/** Debounce delay (ms). Default 300. */
|
|
6
|
+
debounce?: number;
|
|
7
|
+
/** Extra paths to watch (relative to cwd). Defaults to `sharkcraft/`. */
|
|
8
|
+
paths?: readonly string[];
|
|
9
|
+
}
|
|
10
|
+
export interface IWatchLoopHandlers {
|
|
11
|
+
/** Produce one snapshot. */
|
|
12
|
+
snapshot(): Promise<void>;
|
|
13
|
+
/** Optional cleanup. */
|
|
14
|
+
shutdown?: () => Promise<void> | void;
|
|
15
|
+
}
|
|
16
|
+
export declare function runWatchLoop(options: IWatchLoopOptions, handlers: IWatchLoopHandlers): Promise<number>;
|
|
17
|
+
/**
|
|
18
|
+
* Build a "plan" describing what a watch loop would do — used by MCP / tests
|
|
19
|
+
* to verify watch wiring without keeping a process open.
|
|
20
|
+
*/
|
|
21
|
+
export interface IWatchPlan {
|
|
22
|
+
schema: 'sharkcraft.watch-plan/v1';
|
|
23
|
+
cwd: string;
|
|
24
|
+
debounce: number;
|
|
25
|
+
paths: readonly string[];
|
|
26
|
+
steps: readonly string[];
|
|
27
|
+
}
|
|
28
|
+
export declare function buildWatchPlan(options: IWatchLoopOptions, steps: readonly string[]): IWatchPlan;
|
|
29
|
+
import type { ParsedArgs } from '../command-registry.js';
|
|
30
|
+
/**
|
|
31
|
+
* Run a command's `run` function inside a watch loop when --watch is set.
|
|
32
|
+
*
|
|
33
|
+
* @returns null if --watch is not set (caller proceeds as before), otherwise
|
|
34
|
+
* the exit code of the watch loop.
|
|
35
|
+
*/
|
|
36
|
+
export declare function maybeRunInWatchMode(args: ParsedArgs, runner: (innerArgs: ParsedArgs) => Promise<number>): Promise<number | null>;
|
|
37
|
+
//# sourceMappingURL=watch-loop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watch-loop.d.ts","sourceRoot":"","sources":["../../src/output/watch-loop.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,uCAAuC;IACvC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yEAAyE;IACzE,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,kBAAkB;IACjC,4BAA4B;IAC5B,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,wBAAwB;IACxB,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CACvC;AAED,wBAAsB,YAAY,CAChC,OAAO,EAAE,iBAAiB,EAC1B,QAAQ,EAAE,kBAAkB,GAC3B,OAAO,CAAC,MAAM,CAAC,CA6DjB;AAED;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,0BAA0B,CAAC;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1B;AAED,wBAAgB,cAAc,CAC5B,OAAO,EAAE,iBAAiB,EAC1B,KAAK,EAAE,SAAS,MAAM,EAAE,GACvB,UAAU,CAYZ;AAED,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGzD;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,CAAC,SAAS,EAAE,UAAU,KAAK,OAAO,CAAC,MAAM,CAAC,GACjD,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA0BxB"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lightweight watch loop helper.
|
|
3
|
+
*
|
|
4
|
+
* Reused by doctor / knowledge stale-check / templates drift / test agent /
|
|
5
|
+
* `shrk watch integrity`. Debounces fs change events, runs the supplied
|
|
6
|
+
* snapshot once at startup, and short-circuits when --once is passed.
|
|
7
|
+
*
|
|
8
|
+
* Linux: falls back to a non-recursive watcher when `recursive: true` throws.
|
|
9
|
+
*/
|
|
10
|
+
import { existsSync, watch as fsWatch } from 'node:fs';
|
|
11
|
+
import * as nodePath from 'node:path';
|
|
12
|
+
export async function runWatchLoop(options, handlers) {
|
|
13
|
+
const cwd = options.cwd;
|
|
14
|
+
const debounce = options.debounce ?? 300;
|
|
15
|
+
const watchPaths = (options.paths && options.paths.length > 0
|
|
16
|
+
? options.paths
|
|
17
|
+
: ['sharkcraft']).map((p) => (nodePath.isAbsolute(p) ? p : nodePath.join(cwd, p)));
|
|
18
|
+
// Initial snapshot.
|
|
19
|
+
await handlers.snapshot();
|
|
20
|
+
if (options.once) {
|
|
21
|
+
if (handlers.shutdown)
|
|
22
|
+
await handlers.shutdown();
|
|
23
|
+
return 0;
|
|
24
|
+
}
|
|
25
|
+
const existing = watchPaths.filter((p) => existsSync(p));
|
|
26
|
+
if (existing.length === 0) {
|
|
27
|
+
process.stderr.write(`[watch] no watchable paths under ${cwd}. Add sharkcraft/ or pass --paths.\n`);
|
|
28
|
+
if (handlers.shutdown)
|
|
29
|
+
await handlers.shutdown();
|
|
30
|
+
return 1;
|
|
31
|
+
}
|
|
32
|
+
process.stdout.write('\n[watch] running — Ctrl-C to stop.\n');
|
|
33
|
+
let timer;
|
|
34
|
+
const schedule = () => {
|
|
35
|
+
if (timer)
|
|
36
|
+
clearTimeout(timer);
|
|
37
|
+
timer = setTimeout(async () => {
|
|
38
|
+
try {
|
|
39
|
+
await handlers.snapshot();
|
|
40
|
+
}
|
|
41
|
+
catch (e) {
|
|
42
|
+
process.stderr.write(`[watch] error: ${e.message}\n`);
|
|
43
|
+
}
|
|
44
|
+
}, debounce);
|
|
45
|
+
};
|
|
46
|
+
const watchers = [];
|
|
47
|
+
for (const p of existing) {
|
|
48
|
+
try {
|
|
49
|
+
watchers.push(fsWatch(p, { recursive: true }, () => schedule()));
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
// Linux fallback — non-recursive top-level watch.
|
|
53
|
+
watchers.push(fsWatch(p, () => schedule()));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return new Promise((resolve) => {
|
|
57
|
+
process.on('SIGINT', () => {
|
|
58
|
+
for (const w of watchers)
|
|
59
|
+
w.close();
|
|
60
|
+
if (handlers.shutdown)
|
|
61
|
+
Promise.resolve(handlers.shutdown()).finally(() => {
|
|
62
|
+
process.stdout.write('\n[watch] stopped.\n');
|
|
63
|
+
resolve(0);
|
|
64
|
+
});
|
|
65
|
+
else {
|
|
66
|
+
process.stdout.write('\n[watch] stopped.\n');
|
|
67
|
+
resolve(0);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
export function buildWatchPlan(options, steps) {
|
|
73
|
+
const watchPaths = (options.paths && options.paths.length > 0
|
|
74
|
+
? options.paths
|
|
75
|
+
: ['sharkcraft']);
|
|
76
|
+
return {
|
|
77
|
+
schema: 'sharkcraft.watch-plan/v1',
|
|
78
|
+
cwd: options.cwd,
|
|
79
|
+
debounce: options.debounce ?? 300,
|
|
80
|
+
paths: watchPaths,
|
|
81
|
+
steps,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
import { flagBool, flagNumber, resolveCwd } from "../command-registry.js";
|
|
85
|
+
/**
|
|
86
|
+
* Run a command's `run` function inside a watch loop when --watch is set.
|
|
87
|
+
*
|
|
88
|
+
* @returns null if --watch is not set (caller proceeds as before), otherwise
|
|
89
|
+
* the exit code of the watch loop.
|
|
90
|
+
*/
|
|
91
|
+
export async function maybeRunInWatchMode(args, runner) {
|
|
92
|
+
if (!flagBool(args, 'watch'))
|
|
93
|
+
return null;
|
|
94
|
+
const cwd = resolveCwd(args);
|
|
95
|
+
const debounce = flagNumber(args, 'debounce') ?? 300;
|
|
96
|
+
const once = flagBool(args, 'once');
|
|
97
|
+
// Strip --watch so the inner snapshot doesn't recurse.
|
|
98
|
+
const innerFlags = new Map(args.flags);
|
|
99
|
+
innerFlags.delete('watch');
|
|
100
|
+
innerFlags.delete('once');
|
|
101
|
+
innerFlags.delete('debounce');
|
|
102
|
+
const innerArgs = {
|
|
103
|
+
positional: args.positional,
|
|
104
|
+
flags: innerFlags,
|
|
105
|
+
multiFlags: args.multiFlags,
|
|
106
|
+
...(args.globalCwd ? { globalCwd: args.globalCwd } : {}),
|
|
107
|
+
};
|
|
108
|
+
return runWatchLoop({ cwd, debounce, once }, {
|
|
109
|
+
snapshot: async () => {
|
|
110
|
+
const ts = new Date().toLocaleTimeString();
|
|
111
|
+
process.stdout.write(`\n[watch] ${ts}\n`);
|
|
112
|
+
await runner(innerArgs);
|
|
113
|
+
},
|
|
114
|
+
});
|
|
115
|
+
}
|