@shrkcrft/inspector 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/acceptance-replay.d.ts +63 -0
- package/dist/acceptance-replay.d.ts.map +1 -0
- package/dist/acceptance-replay.js +240 -0
- package/dist/action-hint-diagnostics.d.ts +32 -0
- package/dist/action-hint-diagnostics.d.ts.map +1 -0
- package/dist/action-hint-diagnostics.js +133 -0
- package/dist/adoption-check.d.ts +28 -0
- package/dist/adoption-check.d.ts.map +1 -0
- package/dist/adoption-check.js +181 -0
- package/dist/adoption-checkpoint.d.ts +97 -0
- package/dist/adoption-checkpoint.d.ts.map +1 -0
- package/dist/adoption-checkpoint.js +209 -0
- package/dist/adoption-merge-preview.d.ts +28 -0
- package/dist/adoption-merge-preview.d.ts.map +1 -0
- package/dist/adoption-merge-preview.js +254 -0
- package/dist/adoption-report-renderer.d.ts +33 -0
- package/dist/adoption-report-renderer.d.ts.map +1 -0
- package/dist/adoption-report-renderer.js +257 -0
- package/dist/adoption-state.d.ts +100 -0
- package/dist/adoption-state.d.ts.map +1 -0
- package/dist/adoption-state.js +296 -0
- package/dist/adoption-three-way.d.ts +46 -0
- package/dist/adoption-three-way.d.ts.map +1 -0
- package/dist/adoption-three-way.js +181 -0
- package/dist/agent-brief.d.ts +77 -0
- package/dist/agent-brief.d.ts.map +1 -0
- package/dist/agent-brief.js +490 -0
- package/dist/agent-contract-gate.d.ts +108 -0
- package/dist/agent-contract-gate.d.ts.map +1 -0
- package/dist/agent-contract-gate.js +412 -0
- package/dist/agent-contract-templates.d.ts +63 -0
- package/dist/agent-contract-templates.d.ts.map +1 -0
- package/dist/agent-contract-templates.js +346 -0
- package/dist/agent-contract.d.ts +65 -0
- package/dist/agent-contract.d.ts.map +1 -0
- package/dist/agent-contract.js +555 -0
- package/dist/agent-handoff.d.ts +123 -0
- package/dist/agent-handoff.d.ts.map +1 -0
- package/dist/agent-handoff.js +470 -0
- package/dist/agent-instructions.d.ts +2 -0
- package/dist/agent-instructions.d.ts.map +1 -0
- package/dist/agent-instructions.js +21 -0
- package/dist/agent-orchestration.d.ts +61 -0
- package/dist/agent-orchestration.d.ts.map +1 -0
- package/dist/agent-orchestration.js +285 -0
- package/dist/agent-task-prep.d.ts +31 -0
- package/dist/agent-task-prep.d.ts.map +1 -0
- package/dist/agent-task-prep.js +73 -0
- package/dist/ai-readiness.d.ts +30 -0
- package/dist/ai-readiness.d.ts.map +1 -0
- package/dist/ai-readiness.js +279 -0
- package/dist/api-report.d.ts +51 -0
- package/dist/api-report.d.ts.map +1 -0
- package/dist/api-report.js +254 -0
- package/dist/apply-dispatch-trace.d.ts +93 -0
- package/dist/apply-dispatch-trace.d.ts.map +1 -0
- package/dist/apply-dispatch-trace.js +283 -0
- package/dist/apply-gate-result.d.ts +52 -0
- package/dist/apply-gate-result.d.ts.map +1 -0
- package/dist/apply-gate-result.js +44 -0
- package/dist/architecture-map.d.ts +118 -0
- package/dist/architecture-map.d.ts.map +1 -0
- package/dist/architecture-map.js +543 -0
- package/dist/area-explore.d.ts +75 -0
- package/dist/area-explore.d.ts.map +1 -0
- package/dist/area-explore.js +438 -0
- package/dist/area-map.d.ts +43 -0
- package/dist/area-map.d.ts.map +1 -0
- package/dist/area-map.js +197 -0
- package/dist/asset-provenance.d.ts +123 -0
- package/dist/asset-provenance.d.ts.map +1 -0
- package/dist/asset-provenance.js +209 -0
- package/dist/barrel-operations.d.ts +45 -0
- package/dist/barrel-operations.d.ts.map +1 -0
- package/dist/barrel-operations.js +159 -0
- package/dist/boundaries-changed-only.d.ts +62 -0
- package/dist/boundaries-changed-only.d.ts.map +1 -0
- package/dist/boundaries-changed-only.js +97 -0
- package/dist/boundary-suggestions.d.ts +20 -0
- package/dist/boundary-suggestions.d.ts.map +1 -0
- package/dist/boundary-suggestions.js +51 -0
- package/dist/bundle-diff.d.ts +98 -0
- package/dist/bundle-diff.d.ts.map +1 -0
- package/dist/bundle-diff.js +531 -0
- package/dist/bundle-replay.d.ts +68 -0
- package/dist/bundle-replay.d.ts.map +1 -0
- package/dist/bundle-replay.js +273 -0
- package/dist/bundle-validate-html.d.ts +11 -0
- package/dist/bundle-validate-html.d.ts.map +1 -0
- package/dist/bundle-validate-html.js +60 -0
- package/dist/change-intent.d.ts +36 -0
- package/dist/change-intent.d.ts.map +1 -0
- package/dist/change-intent.js +259 -0
- package/dist/changed-preflight.d.ts +59 -0
- package/dist/changed-preflight.d.ts.map +1 -0
- package/dist/changed-preflight.js +358 -0
- package/dist/changed-scope.d.ts +112 -0
- package/dist/changed-scope.d.ts.map +1 -0
- package/dist/changed-scope.js +172 -0
- package/dist/changes-summary.d.ts +87 -0
- package/dist/changes-summary.d.ts.map +1 -0
- package/dist/changes-summary.js +323 -0
- package/dist/check-result-v1.d.ts +90 -0
- package/dist/check-result-v1.d.ts.map +1 -0
- package/dist/check-result-v1.js +335 -0
- package/dist/ci-integrity-report.d.ts +38 -0
- package/dist/ci-integrity-report.d.ts.map +1 -0
- package/dist/ci-integrity-report.js +324 -0
- package/dist/ci-permissions-fix.d.ts +38 -0
- package/dist/ci-permissions-fix.d.ts.map +1 -0
- package/dist/ci-permissions-fix.js +201 -0
- package/dist/ci-permissions.d.ts +51 -0
- package/dist/ci-permissions.d.ts.map +1 -0
- package/dist/ci-permissions.js +431 -0
- package/dist/ci-predict.d.ts +42 -0
- package/dist/ci-predict.d.ts.map +1 -0
- package/dist/ci-predict.js +300 -0
- package/dist/ci-scaffold.d.ts +47 -0
- package/dist/ci-scaffold.d.ts.map +1 -0
- package/dist/ci-scaffold.js +638 -0
- package/dist/codemod-assist.d.ts +97 -0
- package/dist/codemod-assist.d.ts.map +1 -0
- package/dist/codemod-assist.js +261 -0
- package/dist/command-recommender.d.ts +25 -0
- package/dist/command-recommender.d.ts.map +1 -0
- package/dist/command-recommender.js +145 -0
- package/dist/command-suggester.d.ts +61 -0
- package/dist/command-suggester.d.ts.map +1 -0
- package/dist/command-suggester.js +159 -0
- package/dist/command-taxonomy.d.ts +38 -0
- package/dist/command-taxonomy.d.ts.map +1 -0
- package/dist/command-taxonomy.js +164 -0
- package/dist/compliance-evidence.d.ts +58 -0
- package/dist/compliance-evidence.d.ts.map +1 -0
- package/dist/compliance-evidence.js +260 -0
- package/dist/compliance-profiles.d.ts +42 -0
- package/dist/compliance-profiles.d.ts.map +1 -0
- package/dist/compliance-profiles.js +171 -0
- package/dist/construct-adoption-diff.d.ts +55 -0
- package/dist/construct-adoption-diff.d.ts.map +1 -0
- package/dist/construct-adoption-diff.js +331 -0
- package/dist/construct-adoption.d.ts +71 -0
- package/dist/construct-adoption.d.ts.map +1 -0
- package/dist/construct-adoption.js +331 -0
- package/dist/construct-inference.d.ts +44 -0
- package/dist/construct-inference.d.ts.map +1 -0
- package/dist/construct-inference.js +391 -0
- package/dist/construct-registry.d.ts +32 -0
- package/dist/construct-registry.d.ts.map +1 -0
- package/dist/construct-registry.js +198 -0
- package/dist/contract-file-rule.d.ts +37 -0
- package/dist/contract-file-rule.d.ts.map +1 -0
- package/dist/contract-file-rule.js +99 -0
- package/dist/contract-template-registry.d.ts +28 -0
- package/dist/contract-template-registry.d.ts.map +1 -0
- package/dist/contract-template-registry.js +161 -0
- package/dist/contradictions.d.ts +52 -0
- package/dist/contradictions.d.ts.map +1 -0
- package/dist/contradictions.js +391 -0
- package/dist/convention-registry.d.ts +44 -0
- package/dist/convention-registry.d.ts.map +1 -0
- package/dist/convention-registry.js +195 -0
- package/dist/coverage-report.d.ts +25 -0
- package/dist/coverage-report.d.ts.map +1 -0
- package/dist/coverage-report.js +190 -0
- package/dist/custom-checks.d.ts +146 -0
- package/dist/custom-checks.d.ts.map +1 -0
- package/dist/custom-checks.js +260 -0
- package/dist/dashboard/dashboard-data.d.ts +59 -0
- package/dist/dashboard/dashboard-data.d.ts.map +1 -0
- package/dist/dashboard/dashboard-data.js +653 -0
- package/dist/dashboard-export.d.ts +67 -0
- package/dist/dashboard-export.d.ts.map +1 -0
- package/dist/dashboard-export.js +203 -0
- package/dist/decision-records.d.ts +47 -0
- package/dist/decision-records.d.ts.map +1 -0
- package/dist/decision-records.js +255 -0
- package/dist/demo-package.d.ts +49 -0
- package/dist/demo-package.d.ts.map +1 -0
- package/dist/demo-package.js +305 -0
- package/dist/demo-script.d.ts +25 -0
- package/dist/demo-script.d.ts.map +1 -0
- package/dist/demo-script.js +198 -0
- package/dist/demo-workflow.d.ts +28 -0
- package/dist/demo-workflow.d.ts.map +1 -0
- package/dist/demo-workflow.js +178 -0
- package/dist/dev-cycle.d.ts +41 -0
- package/dist/dev-cycle.d.ts.map +1 -0
- package/dist/dev-cycle.js +94 -0
- package/dist/dev-session-html.d.ts +13 -0
- package/dist/dev-session-html.d.ts.map +1 -0
- package/dist/dev-session-html.js +223 -0
- package/dist/dev-session-report.d.ts +11 -0
- package/dist/dev-session-report.d.ts.map +1 -0
- package/dist/dev-session-report.js +206 -0
- package/dist/dev-session.d.ts +257 -0
- package/dist/dev-session.d.ts.map +1 -0
- package/dist/dev-session.js +568 -0
- package/dist/diagnostics-suggest.d.ts +17 -0
- package/dist/diagnostics-suggest.d.ts.map +1 -0
- package/dist/diagnostics-suggest.js +69 -0
- package/dist/docs-check.d.ts +40 -0
- package/dist/docs-check.d.ts.map +1 -0
- package/dist/docs-check.js +221 -0
- package/dist/doctor-acknowledgements.d.ts +69 -0
- package/dist/doctor-acknowledgements.d.ts.map +1 -0
- package/dist/doctor-acknowledgements.js +150 -0
- package/dist/doctor-result.d.ts +51 -0
- package/dist/doctor-result.d.ts.map +1 -0
- package/dist/doctor-result.js +7 -0
- package/dist/doctor-suppressions.d.ts +91 -0
- package/dist/doctor-suppressions.d.ts.map +1 -0
- package/dist/doctor-suppressions.js +238 -0
- package/dist/drift-baseline.d.ts +29 -0
- package/dist/drift-baseline.d.ts.map +1 -0
- package/dist/drift-baseline.js +80 -0
- package/dist/drift.d.ts +38 -0
- package/dist/drift.d.ts.map +1 -0
- package/dist/drift.js +107 -0
- package/dist/entrypoint-matrix.d.ts +61 -0
- package/dist/entrypoint-matrix.d.ts.map +1 -0
- package/dist/entrypoint-matrix.js +221 -0
- package/dist/examples-check.d.ts +36 -0
- package/dist/examples-check.d.ts.map +1 -0
- package/dist/examples-check.js +168 -0
- package/dist/execution-graph.d.ts +98 -0
- package/dist/execution-graph.d.ts.map +1 -0
- package/dist/execution-graph.js +484 -0
- package/dist/export-bundle.d.ts +10 -0
- package/dist/export-bundle.d.ts.map +1 -0
- package/dist/export-bundle.js +90 -0
- package/dist/failure-diagnostics.d.ts +63 -0
- package/dist/failure-diagnostics.d.ts.map +1 -0
- package/dist/failure-diagnostics.js +243 -0
- package/dist/feature-bundle.d.ts +111 -0
- package/dist/feature-bundle.d.ts.map +1 -0
- package/dist/feature-bundle.js +211 -0
- package/dist/feedback-actions-v2.d.ts +65 -0
- package/dist/feedback-actions-v2.d.ts.map +1 -0
- package/dist/feedback-actions-v2.js +183 -0
- package/dist/feedback-ingestion.d.ts +96 -0
- package/dist/feedback-ingestion.d.ts.map +1 -0
- package/dist/feedback-ingestion.js +400 -0
- package/dist/fix-preview.d.ts +82 -0
- package/dist/fix-preview.d.ts.map +1 -0
- package/dist/fix-preview.js +365 -0
- package/dist/fuzzy-impact.d.ts +50 -0
- package/dist/fuzzy-impact.d.ts.map +1 -0
- package/dist/fuzzy-impact.js +446 -0
- package/dist/generated-code.d.ts +97 -0
- package/dist/generated-code.d.ts.map +1 -0
- package/dist/generated-code.js +395 -0
- package/dist/git-helpers.d.ts +26 -0
- package/dist/git-helpers.d.ts.map +1 -0
- package/dist/git-helpers.js +110 -0
- package/dist/golden-output.d.ts +33 -0
- package/dist/golden-output.d.ts.map +1 -0
- package/dist/golden-output.js +92 -0
- package/dist/grounding/build-grounding.d.ts +53 -0
- package/dist/grounding/build-grounding.d.ts.map +1 -0
- package/dist/grounding/build-grounding.js +51 -0
- package/dist/grounding/nx-projects.d.ts +29 -0
- package/dist/grounding/nx-projects.d.ts.map +1 -0
- package/dist/grounding/nx-projects.js +109 -0
- package/dist/grounding/validate-extracted-plan.d.ts +20 -0
- package/dist/grounding/validate-extracted-plan.d.ts.map +1 -0
- package/dist/grounding/validate-extracted-plan.js +127 -0
- package/dist/healing-plan.d.ts +33 -0
- package/dist/healing-plan.d.ts.map +1 -0
- package/dist/healing-plan.js +346 -0
- package/dist/helper-registry.d.ts +90 -0
- package/dist/helper-registry.d.ts.map +1 -0
- package/dist/helper-registry.js +529 -0
- package/dist/impact-analysis.d.ts +150 -0
- package/dist/impact-analysis.d.ts.map +1 -0
- package/dist/impact-analysis.js +697 -0
- package/dist/impact-graph-render.d.ts +51 -0
- package/dist/impact-graph-render.d.ts.map +1 -0
- package/dist/impact-graph-render.js +139 -0
- package/dist/impact-graph.d.ts +17 -0
- package/dist/impact-graph.d.ts.map +1 -0
- package/dist/impact-graph.js +119 -0
- package/dist/impact-render.d.ts +22 -0
- package/dist/impact-render.d.ts.map +1 -0
- package/dist/impact-render.js +413 -0
- package/dist/import-graph-analysis.d.ts +28 -0
- package/dist/import-graph-analysis.d.ts.map +1 -0
- package/dist/import-graph-analysis.js +193 -0
- package/dist/import-hygiene.d.ts +93 -0
- package/dist/import-hygiene.d.ts.map +1 -0
- package/dist/import-hygiene.js +366 -0
- package/dist/index.d.ts +223 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +233 -0
- package/dist/ingest-adoption.d.ts +50 -0
- package/dist/ingest-adoption.d.ts.map +1 -0
- package/dist/ingest-adoption.js +183 -0
- package/dist/ingest-apply.d.ts +80 -0
- package/dist/ingest-apply.d.ts.map +1 -0
- package/dist/ingest-apply.js +227 -0
- package/dist/ingest-body-extractor.d.ts +28 -0
- package/dist/ingest-body-extractor.d.ts.map +1 -0
- package/dist/ingest-body-extractor.js +129 -0
- package/dist/ingest-drafts.d.ts +16 -0
- package/dist/ingest-drafts.d.ts.map +1 -0
- package/dist/ingest-drafts.js +482 -0
- package/dist/inspector-cache.d.ts +41 -0
- package/dist/inspector-cache.d.ts.map +1 -0
- package/dist/inspector-cache.js +104 -0
- package/dist/install-smoke.d.ts +44 -0
- package/dist/install-smoke.d.ts.map +1 -0
- package/dist/install-smoke.js +31 -0
- package/dist/knowledge-authoring.d.ts +151 -0
- package/dist/knowledge-authoring.d.ts.map +1 -0
- package/dist/knowledge-authoring.js +586 -0
- package/dist/knowledge-graph.d.ts +76 -0
- package/dist/knowledge-graph.d.ts.map +1 -0
- package/dist/knowledge-graph.js +336 -0
- package/dist/knowledge-lint.d.ts +97 -0
- package/dist/knowledge-lint.d.ts.map +1 -0
- package/dist/knowledge-lint.js +302 -0
- package/dist/knowledge-rename.d.ts +38 -0
- package/dist/knowledge-rename.d.ts.map +1 -0
- package/dist/knowledge-rename.js +88 -0
- package/dist/knowledge-stale.d.ts +124 -0
- package/dist/knowledge-stale.d.ts.map +1 -0
- package/dist/knowledge-stale.js +892 -0
- package/dist/languages/command-inference.d.ts +27 -0
- package/dist/languages/command-inference.d.ts.map +1 -0
- package/dist/languages/command-inference.js +214 -0
- package/dist/languages/dependency-scan.d.ts +33 -0
- package/dist/languages/dependency-scan.d.ts.map +1 -0
- package/dist/languages/dependency-scan.js +343 -0
- package/dist/languages/index.d.ts +14 -0
- package/dist/languages/index.d.ts.map +1 -0
- package/dist/languages/index.js +13 -0
- package/dist/languages/language-boundaries.d.ts +30 -0
- package/dist/languages/language-boundaries.d.ts.map +1 -0
- package/dist/languages/language-boundaries.js +176 -0
- package/dist/languages/language-cache.d.ts +54 -0
- package/dist/languages/language-cache.d.ts.map +1 -0
- package/dist/languages/language-cache.js +236 -0
- package/dist/languages/language-detection.d.ts +30 -0
- package/dist/languages/language-detection.d.ts.map +1 -0
- package/dist/languages/language-detection.js +584 -0
- package/dist/languages/language-id.d.ts +15 -0
- package/dist/languages/language-id.d.ts.map +1 -0
- package/dist/languages/language-id.js +15 -0
- package/dist/languages/language-runner.d.ts +90 -0
- package/dist/languages/language-runner.d.ts.map +1 -0
- package/dist/languages/language-runner.js +346 -0
- package/dist/languages/polyglot-boundary.d.ts +80 -0
- package/dist/languages/polyglot-boundary.d.ts.map +1 -0
- package/dist/languages/polyglot-boundary.js +373 -0
- package/dist/languages/polyglot-ci.d.ts +25 -0
- package/dist/languages/polyglot-ci.d.ts.map +1 -0
- package/dist/languages/polyglot-ci.js +278 -0
- package/dist/languages/test-impact.d.ts +19 -0
- package/dist/languages/test-impact.d.ts.map +1 -0
- package/dist/languages/test-impact.js +157 -0
- package/dist/loader-diagnostics.d.ts +40 -0
- package/dist/loader-diagnostics.d.ts.map +1 -0
- package/dist/loader-diagnostics.js +49 -0
- package/dist/memory-diff.d.ts +60 -0
- package/dist/memory-diff.d.ts.map +1 -0
- package/dist/memory-diff.js +302 -0
- package/dist/migration-profile-registry.d.ts +26 -0
- package/dist/migration-profile-registry.d.ts.map +1 -0
- package/dist/migration-profile-registry.js +135 -0
- package/dist/migration-readiness.d.ts +101 -0
- package/dist/migration-readiness.d.ts.map +1 -0
- package/dist/migration-readiness.js +253 -0
- package/dist/monorepo-onboarding.d.ts +51 -0
- package/dist/monorepo-onboarding.d.ts.map +1 -0
- package/dist/monorepo-onboarding.js +235 -0
- package/dist/onboarding-adoption-diff.d.ts +53 -0
- package/dist/onboarding-adoption-diff.d.ts.map +1 -0
- package/dist/onboarding-adoption-diff.js +285 -0
- package/dist/onboarding-adoption.d.ts +136 -0
- package/dist/onboarding-adoption.d.ts.map +1 -0
- package/dist/onboarding-adoption.js +702 -0
- package/dist/onboarding-agent-import.d.ts +40 -0
- package/dist/onboarding-agent-import.d.ts.map +1 -0
- package/dist/onboarding-agent-import.js +114 -0
- package/dist/onboarding-diff.d.ts +39 -0
- package/dist/onboarding-diff.d.ts.map +1 -0
- package/dist/onboarding-diff.js +240 -0
- package/dist/onboarding-drafts.d.ts +28 -0
- package/dist/onboarding-drafts.d.ts.map +1 -0
- package/dist/onboarding-drafts.js +234 -0
- package/dist/onboarding-report.d.ts +8 -0
- package/dist/onboarding-report.d.ts.map +1 -0
- package/dist/onboarding-report.js +239 -0
- package/dist/onboarding.d.ts +134 -0
- package/dist/onboarding.d.ts.map +1 -0
- package/dist/onboarding.js +729 -0
- package/dist/ownership.d.ts +38 -0
- package/dist/ownership.d.ts.map +1 -0
- package/dist/ownership.js +102 -0
- package/dist/pack-author-ux.d.ts +58 -0
- package/dist/pack-author-ux.d.ts.map +1 -0
- package/dist/pack-author-ux.js +219 -0
- package/dist/pack-author.d.ts +94 -0
- package/dist/pack-author.d.ts.map +1 -0
- package/dist/pack-author.js +208 -0
- package/dist/pack-compatibility.d.ts +21 -0
- package/dist/pack-compatibility.d.ts.map +1 -0
- package/dist/pack-compatibility.js +114 -0
- package/dist/pack-contributions-inventory.d.ts +121 -0
- package/dist/pack-contributions-inventory.d.ts.map +1 -0
- package/dist/pack-contributions-inventory.js +732 -0
- package/dist/pack-docs.d.ts +11 -0
- package/dist/pack-docs.d.ts.map +1 -0
- package/dist/pack-docs.js +101 -0
- package/dist/pack-doctor.d.ts +50 -0
- package/dist/pack-doctor.d.ts.map +1 -0
- package/dist/pack-doctor.js +302 -0
- package/dist/pack-helper-registry.d.ts +29 -0
- package/dist/pack-helper-registry.d.ts.map +1 -0
- package/dist/pack-helper-registry.js +144 -0
- package/dist/pack-pending.d.ts +68 -0
- package/dist/pack-pending.d.ts.map +1 -0
- package/dist/pack-pending.js +189 -0
- package/dist/pack-quality-score.d.ts +44 -0
- package/dist/pack-quality-score.d.ts.map +1 -0
- package/dist/pack-quality-score.js +155 -0
- package/dist/pack-release-check.d.ts +24 -0
- package/dist/pack-release-check.d.ts.map +1 -0
- package/dist/pack-release-check.js +258 -0
- package/dist/pack-signature-status.d.ts +72 -0
- package/dist/pack-signature-status.d.ts.map +1 -0
- package/dist/pack-signature-status.js +222 -0
- package/dist/pack-symbol-compat.d.ts +60 -0
- package/dist/pack-symbol-compat.d.ts.map +1 -0
- package/dist/pack-symbol-compat.js +371 -0
- package/dist/pack-test-runner.d.ts +59 -0
- package/dist/pack-test-runner.d.ts.map +1 -0
- package/dist/pack-test-runner.js +211 -0
- package/dist/pipeline-command-dictionary.d.ts +2 -0
- package/dist/pipeline-command-dictionary.d.ts.map +1 -0
- package/dist/pipeline-command-dictionary.js +20 -0
- package/dist/pipeline-lint.d.ts +30 -0
- package/dist/pipeline-lint.d.ts.map +1 -0
- package/dist/pipeline-lint.js +134 -0
- package/dist/plan-dependency-graph.d.ts +25 -0
- package/dist/plan-dependency-graph.d.ts.map +1 -0
- package/dist/plan-dependency-graph.js +195 -0
- package/dist/plan-review.d.ts +64 -0
- package/dist/plan-review.d.ts.map +1 -0
- package/dist/plan-review.js +242 -0
- package/dist/plan-simulation.d.ts +108 -0
- package/dist/plan-simulation.d.ts.map +1 -0
- package/dist/plan-simulation.js +767 -0
- package/dist/playbook-registry.d.ts +25 -0
- package/dist/playbook-registry.d.ts.map +1 -0
- package/dist/playbook-registry.js +148 -0
- package/dist/playbook-script.d.ts +60 -0
- package/dist/playbook-script.d.ts.map +1 -0
- package/dist/playbook-script.js +161 -0
- package/dist/plugin-lifecycle-profile-registry.d.ts +52 -0
- package/dist/plugin-lifecycle-profile-registry.d.ts.map +1 -0
- package/dist/plugin-lifecycle-profile-registry.js +202 -0
- package/dist/plugin-lifecycle.d.ts +132 -0
- package/dist/plugin-lifecycle.d.ts.map +1 -0
- package/dist/plugin-lifecycle.js +477 -0
- package/dist/policy-engine.d.ts +101 -0
- package/dist/policy-engine.d.ts.map +1 -0
- package/dist/policy-engine.js +321 -0
- package/dist/policy-override-audit.d.ts +18 -0
- package/dist/policy-override-audit.d.ts.map +1 -0
- package/dist/policy-override-audit.js +54 -0
- package/dist/policy-overrides.d.ts +35 -0
- package/dist/policy-overrides.d.ts.map +1 -0
- package/dist/policy-overrides.js +84 -0
- package/dist/policy-test.d.ts +83 -0
- package/dist/policy-test.d.ts.map +1 -0
- package/dist/policy-test.js +342 -0
- package/dist/pr-summary.d.ts +34 -0
- package/dist/pr-summary.d.ts.map +1 -0
- package/dist/pr-summary.js +220 -0
- package/dist/product-coherence.d.ts +21 -0
- package/dist/product-coherence.d.ts.map +1 -0
- package/dist/product-coherence.js +158 -0
- package/dist/profile-registry.d.ts +42 -0
- package/dist/profile-registry.d.ts.map +1 -0
- package/dist/profile-registry.js +104 -0
- package/dist/project-coupling-audit.d.ts +64 -0
- package/dist/project-coupling-audit.d.ts.map +1 -0
- package/dist/project-coupling-audit.js +282 -0
- package/dist/project-overview.d.ts +14 -0
- package/dist/project-overview.d.ts.map +1 -0
- package/dist/project-overview.js +27 -0
- package/dist/propose-knowledge.d.ts +64 -0
- package/dist/propose-knowledge.d.ts.map +1 -0
- package/dist/propose-knowledge.js +367 -0
- package/dist/quality-baseline.d.ts +123 -0
- package/dist/quality-baseline.d.ts.map +1 -0
- package/dist/quality-baseline.js +433 -0
- package/dist/quality-html.d.ts +7 -0
- package/dist/quality-html.d.ts.map +1 -0
- package/dist/quality-html.js +64 -0
- package/dist/quality-report.d.ts +49 -0
- package/dist/quality-report.d.ts.map +1 -0
- package/dist/quality-report.js +296 -0
- package/dist/query-resolver.d.ts +38 -0
- package/dist/query-resolver.d.ts.map +1 -0
- package/dist/query-resolver.js +163 -0
- package/dist/ranker-explainability.d.ts +91 -0
- package/dist/ranker-explainability.d.ts.map +1 -0
- package/dist/ranker-explainability.js +550 -0
- package/dist/reference-lookup.d.ts +8 -0
- package/dist/reference-lookup.d.ts.map +1 -0
- package/dist/reference-lookup.js +18 -0
- package/dist/registration-hint-registry.d.ts +55 -0
- package/dist/registration-hint-registry.d.ts.map +1 -0
- package/dist/registration-hint-registry.js +327 -0
- package/dist/registry-lifecycle.d.ts +47 -0
- package/dist/registry-lifecycle.d.ts.map +1 -0
- package/dist/registry-lifecycle.js +214 -0
- package/dist/release-readiness.d.ts +64 -0
- package/dist/release-readiness.d.ts.map +1 -0
- package/dist/release-readiness.js +456 -0
- package/dist/release-smoke.d.ts +138 -0
- package/dist/release-smoke.d.ts.map +1 -0
- package/dist/release-smoke.js +459 -0
- package/dist/release-train.d.ts +33 -0
- package/dist/release-train.d.ts.map +1 -0
- package/dist/release-train.js +104 -0
- package/dist/repo-memory.d.ts +95 -0
- package/dist/repo-memory.d.ts.map +1 -0
- package/dist/repo-memory.js +614 -0
- package/dist/report-site.d.ts +92 -0
- package/dist/report-site.d.ts.map +1 -0
- package/dist/report-site.js +658 -0
- package/dist/reposet.d.ts +56 -0
- package/dist/reposet.d.ts.map +1 -0
- package/dist/reposet.js +160 -0
- package/dist/repository-intelligence.d.ts +145 -0
- package/dist/repository-intelligence.d.ts.map +1 -0
- package/dist/repository-intelligence.js +729 -0
- package/dist/repository-knowledge-model.d.ts +218 -0
- package/dist/repository-knowledge-model.d.ts.map +1 -0
- package/dist/repository-knowledge-model.js +939 -0
- package/dist/repository-map.d.ts +72 -0
- package/dist/repository-map.d.ts.map +1 -0
- package/dist/repository-map.js +332 -0
- package/dist/repository-stats.d.ts +66 -0
- package/dist/repository-stats.d.ts.map +1 -0
- package/dist/repository-stats.js +329 -0
- package/dist/review-comment-renderer.d.ts +59 -0
- package/dist/review-comment-renderer.d.ts.map +1 -0
- package/dist/review-comment-renderer.js +181 -0
- package/dist/review-comment-v2.d.ts +9 -0
- package/dist/review-comment-v2.d.ts.map +1 -0
- package/dist/review-comment-v2.js +178 -0
- package/dist/review-html.d.ts +13 -0
- package/dist/review-html.d.ts.map +1 -0
- package/dist/review-html.js +79 -0
- package/dist/review-packet-v2.d.ts +29 -0
- package/dist/review-packet-v2.d.ts.map +1 -0
- package/dist/review-packet-v2.js +71 -0
- package/dist/review-packet-v3.d.ts +22 -0
- package/dist/review-packet-v3.d.ts.map +1 -0
- package/dist/review-packet-v3.js +181 -0
- package/dist/review-packet.d.ts +49 -0
- package/dist/review-packet.d.ts.map +1 -0
- package/dist/review-packet.js +129 -0
- package/dist/risk-signals.d.ts +28 -0
- package/dist/risk-signals.d.ts.map +1 -0
- package/dist/risk-signals.js +68 -0
- package/dist/role-views.d.ts +50 -0
- package/dist/role-views.d.ts.map +1 -0
- package/dist/role-views.js +334 -0
- package/dist/rounds.d.ts +52 -0
- package/dist/rounds.d.ts.map +1 -0
- package/dist/rounds.js +172 -0
- package/dist/rule-drift.d.ts +42 -0
- package/dist/rule-drift.d.ts.map +1 -0
- package/dist/rule-drift.js +148 -0
- package/dist/rule-quality.d.ts +73 -0
- package/dist/rule-quality.d.ts.map +1 -0
- package/dist/rule-quality.js +356 -0
- package/dist/rule-scaffold.d.ts +71 -0
- package/dist/rule-scaffold.d.ts.map +1 -0
- package/dist/rule-scaffold.js +258 -0
- package/dist/safety-audit-deep.d.ts +38 -0
- package/dist/safety-audit-deep.d.ts.map +1 -0
- package/dist/safety-audit-deep.js +162 -0
- package/dist/safety-audit.d.ts +91 -0
- package/dist/safety-audit.d.ts.map +1 -0
- package/dist/safety-audit.js +138 -0
- package/dist/safety-html.d.ts +7 -0
- package/dist/safety-html.d.ts.map +1 -0
- package/dist/safety-html.js +70 -0
- package/dist/scaffold-coverage.d.ts +46 -0
- package/dist/scaffold-coverage.d.ts.map +1 -0
- package/dist/scaffold-coverage.js +273 -0
- package/dist/scaffold-patterns.d.ts +38 -0
- package/dist/scaffold-patterns.d.ts.map +1 -0
- package/dist/scaffold-patterns.js +282 -0
- package/dist/schema-inventory.d.ts +55 -0
- package/dist/schema-inventory.d.ts.map +1 -0
- package/dist/schema-inventory.js +301 -0
- package/dist/search-index.d.ts +75 -0
- package/dist/search-index.d.ts.map +1 -0
- package/dist/search-index.js +531 -0
- package/dist/search-tuning-explain.d.ts +68 -0
- package/dist/search-tuning-explain.d.ts.map +1 -0
- package/dist/search-tuning-explain.js +207 -0
- package/dist/search-tuning-registry.d.ts +54 -0
- package/dist/search-tuning-registry.d.ts.map +1 -0
- package/dist/search-tuning-registry.js +303 -0
- package/dist/self-audit.d.ts +59 -0
- package/dist/self-audit.d.ts.map +1 -0
- package/dist/self-audit.js +192 -0
- package/dist/self-config-doctor-v2.d.ts +57 -0
- package/dist/self-config-doctor-v2.d.ts.map +1 -0
- package/dist/self-config-doctor-v2.js +653 -0
- package/dist/self-config-doctor.d.ts +47 -0
- package/dist/self-config-doctor.d.ts.map +1 -0
- package/dist/self-config-doctor.js +432 -0
- package/dist/sharkcraft-inspector.d.ts +73 -0
- package/dist/sharkcraft-inspector.d.ts.map +1 -0
- package/dist/sharkcraft-inspector.js +745 -0
- package/dist/spec/spec-cross-validate.d.ts +17 -0
- package/dist/spec/spec-cross-validate.d.ts.map +1 -0
- package/dist/spec/spec-cross-validate.js +53 -0
- package/dist/spec/spec-discovery.d.ts +27 -0
- package/dist/spec/spec-discovery.d.ts.map +1 -0
- package/dist/spec/spec-discovery.js +78 -0
- package/dist/spec/spec-review.d.ts +36 -0
- package/dist/spec/spec-review.d.ts.map +1 -0
- package/dist/spec/spec-review.js +37 -0
- package/dist/stability-map.d.ts +62 -0
- package/dist/stability-map.d.ts.map +1 -0
- package/dist/stability-map.js +404 -0
- package/dist/start-here.d.ts +49 -0
- package/dist/start-here.d.ts.map +1 -0
- package/dist/start-here.js +259 -0
- package/dist/surface-profile-detect.d.ts +42 -0
- package/dist/surface-profile-detect.d.ts.map +1 -0
- package/dist/surface-profile-detect.js +76 -0
- package/dist/symbol-index.d.ts +108 -0
- package/dist/symbol-index.d.ts.map +1 -0
- package/dist/symbol-index.js +483 -0
- package/dist/task-decompose.d.ts +38 -0
- package/dist/task-decompose.d.ts.map +1 -0
- package/dist/task-decompose.js +154 -0
- package/dist/task-packet.d.ts +104 -0
- package/dist/task-packet.d.ts.map +1 -0
- package/dist/task-packet.js +156 -0
- package/dist/task-ranker.d.ts +51 -0
- package/dist/task-ranker.d.ts.map +1 -0
- package/dist/task-ranker.js +410 -0
- package/dist/task-risk.d.ts +84 -0
- package/dist/task-risk.d.ts.map +1 -0
- package/dist/task-risk.js +731 -0
- package/dist/task-routing-hint-registry.d.ts +36 -0
- package/dist/task-routing-hint-registry.d.ts.map +1 -0
- package/dist/task-routing-hint-registry.js +186 -0
- package/dist/template-authoring.d.ts +113 -0
- package/dist/template-authoring.d.ts.map +1 -0
- package/dist/template-authoring.js +521 -0
- package/dist/template-body-inference-v2.d.ts +19 -0
- package/dist/template-body-inference-v2.d.ts.map +1 -0
- package/dist/template-body-inference-v2.js +468 -0
- package/dist/template-body-inference.d.ts +59 -0
- package/dist/template-body-inference.d.ts.map +1 -0
- package/dist/template-body-inference.js +277 -0
- package/dist/template-drift.d.ts +39 -0
- package/dist/template-drift.d.ts.map +1 -0
- package/dist/template-drift.js +353 -0
- package/dist/template-lint.d.ts +31 -0
- package/dist/template-lint.d.ts.map +1 -0
- package/dist/template-lint.js +113 -0
- package/dist/test-definitions.d.ts +41 -0
- package/dist/test-definitions.d.ts.map +1 -0
- package/dist/test-definitions.js +6 -0
- package/dist/test-impact.d.ts +30 -0
- package/dist/test-impact.d.ts.map +1 -0
- package/dist/test-impact.js +173 -0
- package/dist/test-runner.d.ts +87 -0
- package/dist/test-runner.d.ts.map +1 -0
- package/dist/test-runner.js +560 -0
- package/dist/uncertainty-report.d.ts +46 -0
- package/dist/uncertainty-report.d.ts.map +1 -0
- package/dist/uncertainty-report.js +108 -0
- package/dist/uncertainty.d.ts +38 -0
- package/dist/uncertainty.d.ts.map +1 -0
- package/dist/uncertainty.js +115 -0
- package/dist/universal-search.d.ts +64 -0
- package/dist/universal-search.d.ts.map +1 -0
- package/dist/universal-search.js +347 -0
- package/dist/upgrade-advisor.d.ts +22 -0
- package/dist/upgrade-advisor.d.ts.map +1 -0
- package/dist/upgrade-advisor.js +109 -0
- package/dist/why-file.d.ts +75 -0
- package/dist/why-file.d.ts.map +1 -0
- package/dist/why-file.js +202 -0
- package/dist/workflow-simulation.d.ts +46 -0
- package/dist/workflow-simulation.d.ts.map +1 -0
- package/dist/workflow-simulation.js +154 -0
- package/package.json +66 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Codemod-assist (NOT a codemod engine).
|
|
3
|
+
*
|
|
4
|
+
* Inventory + plan + checklist for a rule's cleanup work. Source is never
|
|
5
|
+
* rewritten by default. The output:
|
|
6
|
+
* - lists affected files (when a rule has a custom-check that produced
|
|
7
|
+
* a parsed report, or when the user passes a target list).
|
|
8
|
+
* - groups by risk (low/medium/high) using consumer counts when an
|
|
9
|
+
* impact-analysis hint is supplied.
|
|
10
|
+
* - emits a project-script template under `.sharkcraft/fixes/` when
|
|
11
|
+
* asked.
|
|
12
|
+
* - clearly states "this needs manual / ts-morph / jscodeshift work
|
|
13
|
+
* for the rewrite step".
|
|
14
|
+
*
|
|
15
|
+
* Hard rules:
|
|
16
|
+
* - No source mutation.
|
|
17
|
+
* - No spawning of external tools.
|
|
18
|
+
* - The "checklist" is text — not a workflow runner.
|
|
19
|
+
*/
|
|
20
|
+
import type { IKnowledgeEntry } from '@shrkcrft/knowledge';
|
|
21
|
+
import type { ICustomCheckReport } from './custom-checks.js';
|
|
22
|
+
export declare const CODEMOD_ASSIST_SCHEMA = "sharkcraft.codemod-assist/v1";
|
|
23
|
+
export declare enum CodemodRiskBand {
|
|
24
|
+
Low = "low",
|
|
25
|
+
Medium = "medium",
|
|
26
|
+
High = "high",
|
|
27
|
+
Unknown = "unknown"
|
|
28
|
+
}
|
|
29
|
+
export interface ICodemodAffectedFile {
|
|
30
|
+
path: string;
|
|
31
|
+
/** Unique consumers, from impact-analysis when available. */
|
|
32
|
+
consumerCount?: number;
|
|
33
|
+
/** Free-form notes copied from the check report. */
|
|
34
|
+
note?: string;
|
|
35
|
+
/** Risk band determined by the planner. */
|
|
36
|
+
risk: CodemodRiskBand;
|
|
37
|
+
/** Suggested first action — copy/rewrite/delete/manual. */
|
|
38
|
+
suggestedAction: 'rewrite' | 'delete' | 'manual' | 'review';
|
|
39
|
+
}
|
|
40
|
+
export interface ICodemodAssistInput {
|
|
41
|
+
rule: IKnowledgeEntry;
|
|
42
|
+
/**
|
|
43
|
+
* Optional list of files that match the rule's check (typically
|
|
44
|
+
* supplied from a parsed `sharkcraft.custom-check/v1` report).
|
|
45
|
+
*/
|
|
46
|
+
affectedFiles?: readonly {
|
|
47
|
+
path: string;
|
|
48
|
+
note?: string;
|
|
49
|
+
}[];
|
|
50
|
+
/** Map of file path → unique consumer count (impact-analysis output). */
|
|
51
|
+
consumerCounts?: ReadonlyMap<string, number>;
|
|
52
|
+
/**
|
|
53
|
+
* Free-form recommended external tool. Defaults derived from rule tags.
|
|
54
|
+
*/
|
|
55
|
+
recommendedExternalTool?: string;
|
|
56
|
+
}
|
|
57
|
+
export interface ICodemodAssistChecklistItem {
|
|
58
|
+
id: string;
|
|
59
|
+
description: string;
|
|
60
|
+
/** What command should the agent / human run for this item. */
|
|
61
|
+
suggestedCommand?: string;
|
|
62
|
+
/** Risk band for this item. */
|
|
63
|
+
risk: CodemodRiskBand;
|
|
64
|
+
}
|
|
65
|
+
export interface ICodemodAssistReport {
|
|
66
|
+
schema: typeof CODEMOD_ASSIST_SCHEMA;
|
|
67
|
+
generatedAt: string;
|
|
68
|
+
ruleId: string;
|
|
69
|
+
ruleTitle: string;
|
|
70
|
+
/** What the engine can validate locally. */
|
|
71
|
+
enginePromise: readonly string[];
|
|
72
|
+
/** What it cannot do (clearly stated). */
|
|
73
|
+
engineLimits: readonly string[];
|
|
74
|
+
affectedFiles: readonly ICodemodAffectedFile[];
|
|
75
|
+
riskGroups: {
|
|
76
|
+
low: readonly string[];
|
|
77
|
+
medium: readonly string[];
|
|
78
|
+
high: readonly string[];
|
|
79
|
+
unknown: readonly string[];
|
|
80
|
+
};
|
|
81
|
+
recommendedExternalTool: string;
|
|
82
|
+
checklist: readonly ICodemodAssistChecklistItem[];
|
|
83
|
+
/** Optional project-script template the agent can save under .sharkcraft/fixes/. */
|
|
84
|
+
scriptTemplate: {
|
|
85
|
+
path: string;
|
|
86
|
+
body: string;
|
|
87
|
+
};
|
|
88
|
+
/** Suggested validation commands after the rewrite is done. */
|
|
89
|
+
validationCommands: readonly string[];
|
|
90
|
+
}
|
|
91
|
+
export declare function buildCodemodAssistReport(input: ICodemodAssistInput): ICodemodAssistReport;
|
|
92
|
+
export declare function affectedFromCheckReport(report: ICustomCheckReport): readonly {
|
|
93
|
+
path: string;
|
|
94
|
+
note?: string;
|
|
95
|
+
}[];
|
|
96
|
+
export declare function renderCodemodAssistMarkdown(report: ICodemodAssistReport): string;
|
|
97
|
+
//# sourceMappingURL=codemod-assist.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codemod-assist.d.ts","sourceRoot":"","sources":["../src/codemod-assist.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,eAAO,MAAM,qBAAqB,iCAAiC,CAAC;AAEpE,oBAAY,eAAe;IACzB,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,OAAO,YAAY;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oDAAoD;IACpD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,IAAI,EAAE,eAAe,CAAC;IACtB,2DAA2D;IAC3D,eAAe,EAAE,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;CAC7D;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,eAAe,CAAC;IACtB;;;OAGG;IACH,aAAa,CAAC,EAAE,SAAS;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC3D,yEAAyE;IACzE,cAAc,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7C;;OAEG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAClC;AAED,MAAM,WAAW,2BAA2B;IAC1C,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,+DAA+D;IAC/D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,+BAA+B;IAC/B,IAAI,EAAE,eAAe,CAAC;CACvB;AAED,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,OAAO,qBAAqB,CAAC;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,4CAA4C;IAC5C,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,0CAA0C;IAC1C,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,aAAa,EAAE,SAAS,oBAAoB,EAAE,CAAC;IAC/C,UAAU,EAAE;QACV,GAAG,EAAE,SAAS,MAAM,EAAE,CAAC;QACvB,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;QAC1B,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;QACxB,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;KAC5B,CAAC;IACF,uBAAuB,EAAE,MAAM,CAAC;IAChC,SAAS,EAAE,SAAS,2BAA2B,EAAE,CAAC;IAClD,oFAAoF;IACpF,cAAc,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/C,+DAA+D;IAC/D,kBAAkB,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC;AAmGD,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,mBAAmB,GAAG,oBAAoB,CAiGzF;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,kBAAkB,GAAG,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,CAO9G;AAED,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,oBAAoB,GAAG,MAAM,CA2ChF"}
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
export const CODEMOD_ASSIST_SCHEMA = 'sharkcraft.codemod-assist/v1';
|
|
2
|
+
export var CodemodRiskBand;
|
|
3
|
+
(function (CodemodRiskBand) {
|
|
4
|
+
CodemodRiskBand["Low"] = "low";
|
|
5
|
+
CodemodRiskBand["Medium"] = "medium";
|
|
6
|
+
CodemodRiskBand["High"] = "high";
|
|
7
|
+
CodemodRiskBand["Unknown"] = "unknown";
|
|
8
|
+
})(CodemodRiskBand || (CodemodRiskBand = {}));
|
|
9
|
+
const DELETE_TAGS = new Set(['delete', 'cleanup', 'noreexport', 'no-reexport', 're-export', 'reexport-proxy']);
|
|
10
|
+
const REWRITE_TAGS = new Set(['rewrite', 'refactor', 'imports', 'rename']);
|
|
11
|
+
function defaultExternalTool(rule, fallback) {
|
|
12
|
+
if (fallback)
|
|
13
|
+
return fallback;
|
|
14
|
+
const tagsLower = new Set(rule.tags.map((t) => t.toLowerCase()));
|
|
15
|
+
if (tagsLower.has('imports') || rule.id.toLowerCase().includes('reexport')) {
|
|
16
|
+
return 'ts-morph or jscodeshift (manual rewrite of consumers)';
|
|
17
|
+
}
|
|
18
|
+
if (tagsLower.has('lint') || tagsLower.has('style')) {
|
|
19
|
+
return 'eslint custom rule + autofix (when safe)';
|
|
20
|
+
}
|
|
21
|
+
if (tagsLower.has('boundaries') || tagsLower.has('architecture')) {
|
|
22
|
+
return 'manual review + targeted rename via shrk knowledge rename-symbol';
|
|
23
|
+
}
|
|
24
|
+
return 'ts-morph (or manual edits when scope is small)';
|
|
25
|
+
}
|
|
26
|
+
function bandForFile(consumerCount) {
|
|
27
|
+
if (consumerCount === undefined)
|
|
28
|
+
return CodemodRiskBand.Unknown;
|
|
29
|
+
if (consumerCount === 0)
|
|
30
|
+
return CodemodRiskBand.Low;
|
|
31
|
+
if (consumerCount <= 5)
|
|
32
|
+
return CodemodRiskBand.Medium;
|
|
33
|
+
return CodemodRiskBand.High;
|
|
34
|
+
}
|
|
35
|
+
function suggestedActionForRule(rule) {
|
|
36
|
+
const lower = rule.id.toLowerCase();
|
|
37
|
+
if (lower.includes('reexport') || lower.includes('proxy'))
|
|
38
|
+
return 'delete';
|
|
39
|
+
const tags = new Set(rule.tags.map((t) => t.toLowerCase()));
|
|
40
|
+
for (const t of tags)
|
|
41
|
+
if (DELETE_TAGS.has(t))
|
|
42
|
+
return 'delete';
|
|
43
|
+
for (const t of tags)
|
|
44
|
+
if (REWRITE_TAGS.has(t))
|
|
45
|
+
return 'rewrite';
|
|
46
|
+
return 'review';
|
|
47
|
+
}
|
|
48
|
+
function fileSafeId(id) {
|
|
49
|
+
return id.replace(/[^a-zA-Z0-9]+/g, '-');
|
|
50
|
+
}
|
|
51
|
+
function buildScriptTemplate(rule, suggestedAction) {
|
|
52
|
+
const safeId = fileSafeId(rule.id);
|
|
53
|
+
const path = `.sharkcraft/fixes/codemod-${safeId}.template.ts`;
|
|
54
|
+
const body = `/**
|
|
55
|
+
* Codemod-assist template for "${rule.id}".
|
|
56
|
+
*
|
|
57
|
+
* Auto-generated by \`shrk codemod plan --rule ${rule.id}\`. The engine
|
|
58
|
+
* does NOT rewrite source. This file is a starting point for the
|
|
59
|
+
* project-script that does. Suggested first action: ${suggestedAction}.
|
|
60
|
+
*
|
|
61
|
+
* Convention: the script should write a sharkcraft.custom-check/v1
|
|
62
|
+
* report to .sharkcraft/reports/custom-check-${safeId}.json so
|
|
63
|
+
* \`shrk checks run ${safeId}\` can parse it.
|
|
64
|
+
*/
|
|
65
|
+
import { writeFileSync } from 'node:fs';
|
|
66
|
+
|
|
67
|
+
const REPORT_PATH = '.sharkcraft/reports/custom-check-${safeId}.json';
|
|
68
|
+
|
|
69
|
+
function findOffenders(): string[] {
|
|
70
|
+
// TODO: walk the repo and return paths matching the rule shape.
|
|
71
|
+
return [];
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function planRewrite(file: string): { ok: boolean; message: string } {
|
|
75
|
+
// TODO: open the file with ts-morph / jscodeshift / regex and decide.
|
|
76
|
+
return { ok: true, message: \`would ${suggestedAction} \${file}\` };
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function main(): void {
|
|
80
|
+
const offenders = findOffenders();
|
|
81
|
+
const findings = offenders.map((file) => {
|
|
82
|
+
const plan = planRewrite(file);
|
|
83
|
+
return {
|
|
84
|
+
severity: plan.ok ? 'info' : 'error',
|
|
85
|
+
file,
|
|
86
|
+
message: plan.message,
|
|
87
|
+
suggestedAction: '${suggestedAction}',
|
|
88
|
+
safeToAutoFix: false,
|
|
89
|
+
};
|
|
90
|
+
});
|
|
91
|
+
const report = {
|
|
92
|
+
schema: 'sharkcraft.custom-check/v1',
|
|
93
|
+
checkId: '${safeId}',
|
|
94
|
+
ruleId: '${rule.id}',
|
|
95
|
+
generatedAt: new Date().toISOString(),
|
|
96
|
+
status: findings.some((f) => f.severity === 'error') ? 'fail' : findings.length > 0 ? 'warn' : 'pass',
|
|
97
|
+
findings,
|
|
98
|
+
};
|
|
99
|
+
writeFileSync(REPORT_PATH, JSON.stringify(report, null, 2) + '\\n');
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
main();
|
|
103
|
+
`;
|
|
104
|
+
return { path, body };
|
|
105
|
+
}
|
|
106
|
+
export function buildCodemodAssistReport(input) {
|
|
107
|
+
const rule = input.rule;
|
|
108
|
+
const suggestion = suggestedActionForRule(rule);
|
|
109
|
+
const externalTool = defaultExternalTool(rule, input.recommendedExternalTool);
|
|
110
|
+
const counts = input.consumerCounts ?? new Map();
|
|
111
|
+
const affected = (input.affectedFiles ?? []).map((f) => {
|
|
112
|
+
const consumerCount = counts.get(f.path);
|
|
113
|
+
return {
|
|
114
|
+
path: f.path,
|
|
115
|
+
note: f.note,
|
|
116
|
+
consumerCount,
|
|
117
|
+
risk: bandForFile(consumerCount),
|
|
118
|
+
suggestedAction: suggestion,
|
|
119
|
+
};
|
|
120
|
+
});
|
|
121
|
+
const groups = {
|
|
122
|
+
low: affected.filter((a) => a.risk === CodemodRiskBand.Low).map((a) => a.path),
|
|
123
|
+
medium: affected.filter((a) => a.risk === CodemodRiskBand.Medium).map((a) => a.path),
|
|
124
|
+
high: affected.filter((a) => a.risk === CodemodRiskBand.High).map((a) => a.path),
|
|
125
|
+
unknown: affected.filter((a) => a.risk === CodemodRiskBand.Unknown).map((a) => a.path),
|
|
126
|
+
};
|
|
127
|
+
const checklist = [];
|
|
128
|
+
let counter = 1;
|
|
129
|
+
if (groups.low.length > 0) {
|
|
130
|
+
checklist.push({
|
|
131
|
+
id: `codemod-${counter++}`,
|
|
132
|
+
risk: CodemodRiskBand.Low,
|
|
133
|
+
description: `Low-risk: ${groups.low.length} file(s) with no consumers — safe to ${suggestion} first.`,
|
|
134
|
+
suggestedCommand: `shrk codemod inventory --rule ${rule.id} --risk low`,
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
if (groups.medium.length > 0) {
|
|
138
|
+
checklist.push({
|
|
139
|
+
id: `codemod-${counter++}`,
|
|
140
|
+
risk: CodemodRiskBand.Medium,
|
|
141
|
+
description: `Medium-risk: ${groups.medium.length} file(s) with 1–5 consumers — ${suggestion} after re-import sweep.`,
|
|
142
|
+
suggestedCommand: `shrk impact analyze --files ${groups.medium.slice(0, 3).join(',')}`,
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
if (groups.high.length > 0) {
|
|
146
|
+
checklist.push({
|
|
147
|
+
id: `codemod-${counter++}`,
|
|
148
|
+
risk: CodemodRiskBand.High,
|
|
149
|
+
description: `High-risk: ${groups.high.length} file(s) with >5 consumers — schedule with owners before rewriting.`,
|
|
150
|
+
suggestedCommand: `shrk impact analyze --files ${groups.high.slice(0, 3).join(',')}`,
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
if (groups.unknown.length > 0) {
|
|
154
|
+
checklist.push({
|
|
155
|
+
id: `codemod-${counter++}`,
|
|
156
|
+
risk: CodemodRiskBand.Unknown,
|
|
157
|
+
description: `Unknown risk: ${groups.unknown.length} file(s) — run impact-analysis to fill in consumer counts.`,
|
|
158
|
+
suggestedCommand: `shrk impact analyze --files ${groups.unknown.slice(0, 3).join(',')}`,
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
checklist.push({
|
|
162
|
+
id: `codemod-${counter++}`,
|
|
163
|
+
risk: CodemodRiskBand.Unknown,
|
|
164
|
+
description: `Use ${externalTool} for the actual rewrite — engine does not touch source.`,
|
|
165
|
+
});
|
|
166
|
+
checklist.push({
|
|
167
|
+
id: `codemod-${counter++}`,
|
|
168
|
+
risk: CodemodRiskBand.Unknown,
|
|
169
|
+
description: 'After rewriting, re-run the rule\'s custom check + boundaries + tests.',
|
|
170
|
+
suggestedCommand: `shrk checks run codemod-${fileSafeId(rule.id)} --execute`,
|
|
171
|
+
});
|
|
172
|
+
const validation = [
|
|
173
|
+
'shrk doctor',
|
|
174
|
+
'shrk check boundaries',
|
|
175
|
+
'bun x tsc -p tsconfig.base.json --noEmit',
|
|
176
|
+
'bun test',
|
|
177
|
+
];
|
|
178
|
+
return {
|
|
179
|
+
schema: CODEMOD_ASSIST_SCHEMA,
|
|
180
|
+
generatedAt: new Date().toISOString(),
|
|
181
|
+
ruleId: rule.id,
|
|
182
|
+
ruleTitle: rule.title,
|
|
183
|
+
enginePromise: [
|
|
184
|
+
'inventory affected files (when a check report or target list is supplied)',
|
|
185
|
+
'group by risk via consumer count when impact-analysis output is provided',
|
|
186
|
+
'suggest the rewrite strategy and the external tool',
|
|
187
|
+
'emit a project-script template under .sharkcraft/fixes/',
|
|
188
|
+
'list the validation commands to run after rewrite',
|
|
189
|
+
],
|
|
190
|
+
engineLimits: [
|
|
191
|
+
'no source rewrite — the engine never edits the offending files',
|
|
192
|
+
'no AST traversal — use ts-morph / jscodeshift for safe rewrites',
|
|
193
|
+
'no spawn of external tools — the agent runs them after review',
|
|
194
|
+
'consumer counts are absent when impact-analysis output is not provided',
|
|
195
|
+
],
|
|
196
|
+
affectedFiles: affected,
|
|
197
|
+
riskGroups: groups,
|
|
198
|
+
recommendedExternalTool: externalTool,
|
|
199
|
+
checklist,
|
|
200
|
+
scriptTemplate: buildScriptTemplate(rule, suggestion),
|
|
201
|
+
validationCommands: validation,
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
export function affectedFromCheckReport(report) {
|
|
205
|
+
const out = [];
|
|
206
|
+
for (const f of report.findings) {
|
|
207
|
+
if (!f.file)
|
|
208
|
+
continue;
|
|
209
|
+
out.push({ path: f.file, note: f.message });
|
|
210
|
+
}
|
|
211
|
+
return out;
|
|
212
|
+
}
|
|
213
|
+
export function renderCodemodAssistMarkdown(report) {
|
|
214
|
+
const lines = [];
|
|
215
|
+
lines.push(`# Codemod-assist for ${report.ruleId}`);
|
|
216
|
+
lines.push('');
|
|
217
|
+
lines.push(`> ${report.ruleTitle}`);
|
|
218
|
+
lines.push('');
|
|
219
|
+
lines.push(`Generated: ${report.generatedAt}`);
|
|
220
|
+
lines.push('');
|
|
221
|
+
lines.push('## What the engine can do');
|
|
222
|
+
for (const p of report.enginePromise)
|
|
223
|
+
lines.push(`- ${p}`);
|
|
224
|
+
lines.push('');
|
|
225
|
+
lines.push('## What the engine cannot do');
|
|
226
|
+
for (const p of report.engineLimits)
|
|
227
|
+
lines.push(`- ${p}`);
|
|
228
|
+
lines.push('');
|
|
229
|
+
lines.push('## Affected files');
|
|
230
|
+
if (report.affectedFiles.length === 0) {
|
|
231
|
+
lines.push('_(no files supplied — pass `--from-report <path>` or `--targets a,b,c`)_');
|
|
232
|
+
}
|
|
233
|
+
else {
|
|
234
|
+
lines.push('| Risk | Consumers | File | Note |');
|
|
235
|
+
lines.push('| --- | --- | --- | --- |');
|
|
236
|
+
for (const f of report.affectedFiles) {
|
|
237
|
+
lines.push(`| ${f.risk} | ${f.consumerCount ?? '?'} | \`${f.path}\` | ${f.note ?? ''} |`);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
lines.push('');
|
|
241
|
+
lines.push(`## Recommended external tool: ${report.recommendedExternalTool}`);
|
|
242
|
+
lines.push('');
|
|
243
|
+
lines.push('## Checklist');
|
|
244
|
+
for (const c of report.checklist) {
|
|
245
|
+
lines.push(`- [ ] (${c.risk}) ${c.description}`);
|
|
246
|
+
if (c.suggestedCommand)
|
|
247
|
+
lines.push(` $ ${c.suggestedCommand}`);
|
|
248
|
+
}
|
|
249
|
+
lines.push('');
|
|
250
|
+
lines.push('## Validation commands (after rewrite)');
|
|
251
|
+
for (const v of report.validationCommands)
|
|
252
|
+
lines.push(`- $ ${v}`);
|
|
253
|
+
lines.push('');
|
|
254
|
+
lines.push('## Project-script template (preview)');
|
|
255
|
+
lines.push('Save this under `' + report.scriptTemplate.path + '` and customise:');
|
|
256
|
+
lines.push('');
|
|
257
|
+
lines.push('```typescript');
|
|
258
|
+
lines.push(report.scriptTemplate.body);
|
|
259
|
+
lines.push('```');
|
|
260
|
+
return lines.join('\n') + '\n';
|
|
261
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type IUncertaintyReport } from './uncertainty-report.js';
|
|
2
|
+
import type { ISharkcraftInspection } from './sharkcraft-inspector.js';
|
|
3
|
+
export declare const COMMAND_RECOMMENDER_SCHEMA = "sharkcraft.command-recommender/v1";
|
|
4
|
+
export interface ICommandRecommendation {
|
|
5
|
+
command: string;
|
|
6
|
+
why: string;
|
|
7
|
+
safetyLevel: 'read-only' | 'writes-drafts' | 'writes-session' | 'writes-source' | 'runs-shell';
|
|
8
|
+
docsLink?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ICommandRecommendationReport {
|
|
11
|
+
schema: typeof COMMAND_RECOMMENDER_SCHEMA;
|
|
12
|
+
generatedAt: string;
|
|
13
|
+
query: string;
|
|
14
|
+
role?: string;
|
|
15
|
+
recommendations: readonly ICommandRecommendation[];
|
|
16
|
+
nextCommand: string;
|
|
17
|
+
warnings: readonly string[];
|
|
18
|
+
/** Uncertainty report (confidence + reasons + safe fallback). */
|
|
19
|
+
uncertainty: IUncertaintyReport;
|
|
20
|
+
}
|
|
21
|
+
export declare function recommendCommands(inspection: ISharkcraftInspection, query: string, options?: {
|
|
22
|
+
fromError?: string;
|
|
23
|
+
role?: string;
|
|
24
|
+
}): Promise<ICommandRecommendationReport>;
|
|
25
|
+
//# sourceMappingURL=command-recommender.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-recommender.d.ts","sourceRoot":"","sources":["../src/command-recommender.ts"],"names":[],"mappings":"AASA,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAEvE,eAAO,MAAM,0BAA0B,sCAAsC,CAAC;AAE9E,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,WAAW,GAAG,eAAe,GAAG,gBAAgB,GAAG,eAAe,GAAG,YAAY,CAAC;IAC/F,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,4BAA4B;IAC3C,MAAM,EAAE,OAAO,0BAA0B,CAAC;IAC1C,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,SAAS,sBAAsB,EAAE,CAAC;IACnD,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,iEAAiE;IACjE,WAAW,EAAE,kBAAkB,CAAC;CACjC;AA0DD,wBAAsB,iBAAiB,CACrC,UAAU,EAAE,qBAAqB,EACjC,KAAK,EAAE,MAAM,EACb,OAAO,GAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,GAClD,OAAO,CAAC,4BAA4B,CAAC,CAoFvC"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deterministic command recommender.
|
|
3
|
+
*
|
|
4
|
+
* Given an input ("what I want to do" or stderr blob), surface the
|
|
5
|
+
* most relevant commands from the catalog + diagnostics + start-here
|
|
6
|
+
* flow + intent classification. No AI, no embeddings.
|
|
7
|
+
*/
|
|
8
|
+
import { classifyChangeIntent, ChangeIntentKind } from "./change-intent.js";
|
|
9
|
+
import { buildDiagnosticByCode, listDiagnostics } from "./failure-diagnostics.js";
|
|
10
|
+
import { buildUncertaintyReport, } from "./uncertainty-report.js";
|
|
11
|
+
export const COMMAND_RECOMMENDER_SCHEMA = 'sharkcraft.command-recommender/v1';
|
|
12
|
+
const RECIPES = [
|
|
13
|
+
{
|
|
14
|
+
match: /review|pr|pull[-\s]?request/i,
|
|
15
|
+
recommendations: [
|
|
16
|
+
{ command: 'shrk review packet --v3 --since main', why: 'Generate an agent-ready PR review packet.' },
|
|
17
|
+
{ command: 'shrk impact --since main', why: 'See what changed and what depends on it.' },
|
|
18
|
+
{ command: 'shrk report site --output .sharkcraft/reports/site', why: 'Render the local read-only review site.' },
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
match: /start|begin|new task|feature/i,
|
|
23
|
+
recommendations: [
|
|
24
|
+
{ command: 'shrk brief "<task>"', why: 'Pre-work brief for the agent.' },
|
|
25
|
+
{ command: 'shrk dev start "<task>"', why: 'Start a tracked dev session.' },
|
|
26
|
+
{ command: 'shrk intent "<task>"', why: 'Classify the change intent first.' },
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
match: /publish|release|tag|alpha|beta/i,
|
|
31
|
+
recommendations: [
|
|
32
|
+
{ command: 'shrk release readiness --strict', why: 'Confirm release gates.' },
|
|
33
|
+
{ command: 'shrk release smoke --scenario all', why: 'Validate the release smoke matrix.' },
|
|
34
|
+
{ command: 'bun run release:preflight', why: 'Run the full preflight.' },
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
match: /pack/i,
|
|
39
|
+
recommendations: [
|
|
40
|
+
{ command: 'shrk packs doctor --release --require-signatures', why: 'Validate discovered packs.' },
|
|
41
|
+
{ command: 'shrk packs compat <pack> --consumer-root .', why: 'Detect helper/symbol-missing issues.' },
|
|
42
|
+
{ command: 'shrk packs quality <path>', why: 'Score pack maturity.' },
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
match: /boundary|architecture|layer/i,
|
|
47
|
+
recommendations: [
|
|
48
|
+
{ command: 'shrk architecture map', why: 'Layered architecture summary.' },
|
|
49
|
+
{ command: 'shrk check boundaries', why: 'Boundary scan.' },
|
|
50
|
+
{ command: 'shrk drift', why: 'Drift report.' },
|
|
51
|
+
],
|
|
52
|
+
},
|
|
53
|
+
];
|
|
54
|
+
function safetyLevelFor(command) {
|
|
55
|
+
if (/^shrk (gen|init|apply|import|presets apply --write|packs (sign|new))/i.test(command))
|
|
56
|
+
return 'writes-source';
|
|
57
|
+
if (/^shrk (onboard|brief|dev start|handoff|export|report site|impact|ci scaffold|simulate|orchestrate)/i.test(command))
|
|
58
|
+
return 'writes-drafts';
|
|
59
|
+
if (/^shrk (session|dev report)/i.test(command))
|
|
60
|
+
return 'writes-session';
|
|
61
|
+
if (/^bun |^npm |^node |^git /i.test(command))
|
|
62
|
+
return 'runs-shell';
|
|
63
|
+
return 'read-only';
|
|
64
|
+
}
|
|
65
|
+
export async function recommendCommands(inspection, query, options = {}) {
|
|
66
|
+
const warnings = [];
|
|
67
|
+
const trimmed = query.trim();
|
|
68
|
+
let recommendations = [];
|
|
69
|
+
// Recipe matching by query.
|
|
70
|
+
for (const r of RECIPES) {
|
|
71
|
+
if (r.match.test(trimmed)) {
|
|
72
|
+
for (const rec of r.recommendations)
|
|
73
|
+
recommendations.push({ ...rec, safetyLevel: safetyLevelFor(rec.command) });
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
// If a stderr-like input was provided, do a diagnostic-suggest pass.
|
|
77
|
+
if (options.fromError && options.fromError.length > 0) {
|
|
78
|
+
for (const e of listDiagnostics()) {
|
|
79
|
+
const built = buildDiagnosticByCode(e.code, {});
|
|
80
|
+
if (new RegExp(e.code, 'i').test(options.fromError) || new RegExp(built.problem.slice(0, 20), 'i').test(options.fromError)) {
|
|
81
|
+
recommendations.push({
|
|
82
|
+
command: built.nextCommand,
|
|
83
|
+
why: `Diagnostic match: ${e.code}.`,
|
|
84
|
+
safetyLevel: safetyLevelFor(built.nextCommand),
|
|
85
|
+
...(built.docsLink ? { docsLink: built.docsLink } : {}),
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
// Intent-driven fallback.
|
|
91
|
+
if (recommendations.length === 0) {
|
|
92
|
+
const intent = await classifyChangeIntent(trimmed, inspection);
|
|
93
|
+
recommendations.push({
|
|
94
|
+
command: intent.suggestedFirstCommand,
|
|
95
|
+
why: `Intent fallback (${intent.kind}, confidence ${intent.confidence}).`,
|
|
96
|
+
safetyLevel: safetyLevelFor(intent.suggestedFirstCommand),
|
|
97
|
+
});
|
|
98
|
+
if (intent.kind === ChangeIntentKind.Unknown) {
|
|
99
|
+
recommendations.push({ command: 'shrk start-here', why: 'No clear intent — start here.', safetyLevel: 'read-only' });
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
// Dedup by command (keep first).
|
|
103
|
+
const seen = new Set();
|
|
104
|
+
recommendations = recommendations.filter((r) => (seen.has(r.command) ? false : (seen.add(r.command), true)));
|
|
105
|
+
// Top of list = first recommendation.
|
|
106
|
+
const nextCommand = recommendations[0]?.command ?? 'shrk start-here';
|
|
107
|
+
// Build an uncertainty report from the recommendation signals.
|
|
108
|
+
const usedRecipe = RECIPES.some((r) => r.match.test(trimmed));
|
|
109
|
+
let confidence = 'medium';
|
|
110
|
+
const reasons = [];
|
|
111
|
+
const missing = [];
|
|
112
|
+
const increase = [];
|
|
113
|
+
if (usedRecipe) {
|
|
114
|
+
confidence = 'high';
|
|
115
|
+
reasons.push(`Recipe matched the query "${trimmed}".`);
|
|
116
|
+
}
|
|
117
|
+
else if (recommendations.length > 0 && recommendations[0]?.why.startsWith('Intent fallback')) {
|
|
118
|
+
confidence = 'low';
|
|
119
|
+
reasons.push('No recipe matched — fell back to intent classification.');
|
|
120
|
+
missing.push({ id: 'no-recipe-match', message: 'No recommender recipe matched the query.' });
|
|
121
|
+
increase.push('Add a routing hint or recommender recipe for this task class.');
|
|
122
|
+
}
|
|
123
|
+
else if (recommendations.length === 0) {
|
|
124
|
+
confidence = 'unknown';
|
|
125
|
+
reasons.push('No recommendations could be produced.');
|
|
126
|
+
}
|
|
127
|
+
const uncertainty = buildUncertaintyReport({
|
|
128
|
+
confidence,
|
|
129
|
+
reasons,
|
|
130
|
+
missingSignals: missing,
|
|
131
|
+
suggestedCommands: recommendations.slice(0, 3).map((r) => r.command),
|
|
132
|
+
safeFallbackCommand: 'shrk start-here',
|
|
133
|
+
whatWouldIncreaseConfidence: increase,
|
|
134
|
+
});
|
|
135
|
+
return {
|
|
136
|
+
schema: COMMAND_RECOMMENDER_SCHEMA,
|
|
137
|
+
generatedAt: new Date().toISOString(),
|
|
138
|
+
query: trimmed,
|
|
139
|
+
...(options.role ? { role: options.role } : {}),
|
|
140
|
+
recommendations,
|
|
141
|
+
nextCommand,
|
|
142
|
+
warnings,
|
|
143
|
+
uncertainty,
|
|
144
|
+
};
|
|
145
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Command discovery + did-you-mean.
|
|
3
|
+
*
|
|
4
|
+
* Provides typo-tolerant ranking over a SharkCraft command catalog. Used by
|
|
5
|
+
* `shrk commands suggest <partial>`, `shrk commands explain <cmd>`, and the
|
|
6
|
+
* "Unknown subcommand → did you mean …" path in `runCli`.
|
|
7
|
+
*
|
|
8
|
+
* Pure, deterministic, fixture-friendly.
|
|
9
|
+
*
|
|
10
|
+
* Schema: sharkcraft.command-suggestions/v1
|
|
11
|
+
*/
|
|
12
|
+
export declare const COMMAND_SUGGESTIONS_SCHEMA = "sharkcraft.command-suggestions/v1";
|
|
13
|
+
export interface ICommandEntryLike {
|
|
14
|
+
command: string;
|
|
15
|
+
description: string;
|
|
16
|
+
category: string;
|
|
17
|
+
safetyLevel: string;
|
|
18
|
+
writesFiles: boolean;
|
|
19
|
+
writesSource: boolean;
|
|
20
|
+
runsShell: boolean;
|
|
21
|
+
requiresReview: boolean;
|
|
22
|
+
mcpAvailable: boolean;
|
|
23
|
+
aliases: readonly string[];
|
|
24
|
+
}
|
|
25
|
+
export interface ICommandSuggestion {
|
|
26
|
+
command: string;
|
|
27
|
+
category: string;
|
|
28
|
+
description: string;
|
|
29
|
+
safetyLevel: string;
|
|
30
|
+
score: number;
|
|
31
|
+
reasons: readonly string[];
|
|
32
|
+
/** When true, the suggestion writes to source — useful for --safe-only filtering. */
|
|
33
|
+
writesSource: boolean;
|
|
34
|
+
/** When false, the suggestion can't be invoked via MCP. */
|
|
35
|
+
mcpAvailable: boolean;
|
|
36
|
+
}
|
|
37
|
+
export interface ICommandSuggestionsOptions {
|
|
38
|
+
/** Cap returned suggestions. Default 10. */
|
|
39
|
+
limit?: number;
|
|
40
|
+
/** Exclude suggestions that write source. */
|
|
41
|
+
safeOnly?: boolean;
|
|
42
|
+
/** Only show MCP-callable commands. */
|
|
43
|
+
mcpSafeOnly?: boolean;
|
|
44
|
+
/** Filter by category. */
|
|
45
|
+
category?: string;
|
|
46
|
+
}
|
|
47
|
+
export declare function suggestCommands(catalog: readonly ICommandEntryLike[], partial: string, options?: ICommandSuggestionsOptions): {
|
|
48
|
+
schema: typeof COMMAND_SUGGESTIONS_SCHEMA;
|
|
49
|
+
query: string;
|
|
50
|
+
suggestions: readonly ICommandSuggestion[];
|
|
51
|
+
};
|
|
52
|
+
/** Suggests at most `limit` did-you-mean candidates for an unknown command path. */
|
|
53
|
+
export declare function suggestDidYouMean(catalog: readonly ICommandEntryLike[], attempted: readonly string[], limit?: number): readonly ICommandSuggestion[];
|
|
54
|
+
export interface ICommandExplanation {
|
|
55
|
+
schema: 'sharkcraft.command-explain/v1';
|
|
56
|
+
query: string;
|
|
57
|
+
exact?: ICommandEntryLike;
|
|
58
|
+
candidates: readonly ICommandSuggestion[];
|
|
59
|
+
}
|
|
60
|
+
export declare function explainCommand(catalog: readonly ICommandEntryLike[], query: string): ICommandExplanation;
|
|
61
|
+
//# sourceMappingURL=command-suggester.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-suggester.d.ts","sourceRoot":"","sources":["../src/command-suggester.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,eAAO,MAAM,0BAA0B,sCAAsC,CAAC;AAE9E,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,cAAc,EAAE,OAAO,CAAC;IACxB,YAAY,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CAC5B;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,qFAAqF;IACrF,YAAY,EAAE,OAAO,CAAC;IACtB,2DAA2D;IAC3D,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,0BAA0B;IACzC,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uCAAuC;IACvC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAuGD,wBAAgB,eAAe,CAC7B,OAAO,EAAE,SAAS,iBAAiB,EAAE,EACrC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,0BAA+B,GACvC;IACD,MAAM,EAAE,OAAO,0BAA0B,CAAC;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,SAAS,kBAAkB,EAAE,CAAC;CAC5C,CA4BA;AAED,oFAAoF;AACpF,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,SAAS,iBAAiB,EAAE,EACrC,SAAS,EAAE,SAAS,MAAM,EAAE,EAC5B,KAAK,SAAI,GACR,SAAS,kBAAkB,EAAE,CAK/B;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,+BAA+B,CAAC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,UAAU,EAAE,SAAS,kBAAkB,EAAE,CAAC;CAC3C;AAED,wBAAgB,cAAc,CAC5B,OAAO,EAAE,SAAS,iBAAiB,EAAE,EACrC,KAAK,EAAE,MAAM,GACZ,mBAAmB,CAUrB"}
|