@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,550 @@
|
|
|
1
|
+
import { buildSearchIndex, searchIndex, } from "./search-index.js";
|
|
2
|
+
import { listSearchTuning, tuningBoostFor, } from "./search-tuning-registry.js";
|
|
3
|
+
import { rankAll } from "./task-ranker.js";
|
|
4
|
+
export const RANKER_EXPLAINABILITY_SCHEMA = 'sharkcraft.ranker-explainability/v1';
|
|
5
|
+
export var RankerExplainKind;
|
|
6
|
+
(function (RankerExplainKind) {
|
|
7
|
+
RankerExplainKind["Knowledge"] = "knowledge";
|
|
8
|
+
RankerExplainKind["Template"] = "template";
|
|
9
|
+
RankerExplainKind["Rule"] = "rule";
|
|
10
|
+
RankerExplainKind["Helper"] = "helper";
|
|
11
|
+
RankerExplainKind["Playbook"] = "playbook";
|
|
12
|
+
RankerExplainKind["Construct"] = "construct";
|
|
13
|
+
RankerExplainKind["Policy"] = "policy";
|
|
14
|
+
RankerExplainKind["Command"] = "command";
|
|
15
|
+
RankerExplainKind["Path"] = "path";
|
|
16
|
+
RankerExplainKind["Preset"] = "preset";
|
|
17
|
+
RankerExplainKind["Pipeline"] = "pipeline";
|
|
18
|
+
})(RankerExplainKind || (RankerExplainKind = {}));
|
|
19
|
+
function sourceLabel(s) {
|
|
20
|
+
if (!s)
|
|
21
|
+
return 'local';
|
|
22
|
+
if (s.loader)
|
|
23
|
+
return s.loader;
|
|
24
|
+
if (s.origin)
|
|
25
|
+
return s.origin;
|
|
26
|
+
return 'local';
|
|
27
|
+
}
|
|
28
|
+
function listRegistryHits(inspection) {
|
|
29
|
+
const out = [];
|
|
30
|
+
for (const r of inspection.ruleService.list()) {
|
|
31
|
+
out.push({
|
|
32
|
+
id: r.id,
|
|
33
|
+
kind: 'rule',
|
|
34
|
+
title: r.title ?? r.id,
|
|
35
|
+
source: sourceLabel(r.source),
|
|
36
|
+
...(r.tags ? { tags: r.tags } : {}),
|
|
37
|
+
...(r.appliesWhen ? { appliesWhen: r.appliesWhen } : {}),
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
for (const p of inspection.pathService.list()) {
|
|
41
|
+
out.push({
|
|
42
|
+
id: p.id,
|
|
43
|
+
kind: 'path',
|
|
44
|
+
title: p.title ?? p.id,
|
|
45
|
+
source: sourceLabel(p.source),
|
|
46
|
+
...(p.tags ? { tags: p.tags } : {}),
|
|
47
|
+
...(p.appliesWhen ? { appliesWhen: p.appliesWhen } : {}),
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
for (const t of inspection.templates) {
|
|
51
|
+
out.push({
|
|
52
|
+
id: t.id,
|
|
53
|
+
kind: 'template',
|
|
54
|
+
title: t.name ?? t.id,
|
|
55
|
+
source: 'local',
|
|
56
|
+
...(t.tags ? { tags: t.tags } : {}),
|
|
57
|
+
...(t.appliesWhen ? { appliesWhen: t.appliesWhen } : {}),
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
for (const k of inspection.knowledgeEntries) {
|
|
61
|
+
if (!out.some((o) => o.id === k.id)) {
|
|
62
|
+
out.push({
|
|
63
|
+
id: k.id,
|
|
64
|
+
kind: 'knowledge',
|
|
65
|
+
title: k.title ?? k.id,
|
|
66
|
+
source: sourceLabel(k.source),
|
|
67
|
+
...(k.tags ? { tags: k.tags } : {}),
|
|
68
|
+
...(k.appliesWhen ? { appliesWhen: k.appliesWhen } : {}),
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
for (const p of inspection.pipelines) {
|
|
73
|
+
out.push({
|
|
74
|
+
id: p.id,
|
|
75
|
+
kind: 'pipeline',
|
|
76
|
+
title: p.title ?? p.id,
|
|
77
|
+
source: 'local',
|
|
78
|
+
...(p.tags ? { tags: p.tags } : {}),
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
for (const p of inspection.presetRegistry.list()) {
|
|
82
|
+
out.push({
|
|
83
|
+
id: p.id,
|
|
84
|
+
kind: 'preset',
|
|
85
|
+
title: p.title ?? p.id,
|
|
86
|
+
source: 'local',
|
|
87
|
+
...(p.tags ? { tags: p.tags } : {}),
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
return out;
|
|
91
|
+
}
|
|
92
|
+
function levenshtein(a, b) {
|
|
93
|
+
const m = a.length;
|
|
94
|
+
const n = b.length;
|
|
95
|
+
if (m === 0)
|
|
96
|
+
return n;
|
|
97
|
+
if (n === 0)
|
|
98
|
+
return m;
|
|
99
|
+
const dp = new Array(n + 1);
|
|
100
|
+
for (let j = 0; j <= n; j += 1)
|
|
101
|
+
dp[j] = j;
|
|
102
|
+
for (let i = 1; i <= m; i += 1) {
|
|
103
|
+
let prev = dp[0];
|
|
104
|
+
dp[0] = i;
|
|
105
|
+
for (let j = 1; j <= n; j += 1) {
|
|
106
|
+
const tmp = dp[j];
|
|
107
|
+
const cost = a[i - 1] === b[j - 1] ? 0 : 1;
|
|
108
|
+
dp[j] = Math.min(dp[j] + 1, dp[j - 1] + 1, prev + cost);
|
|
109
|
+
prev = tmp;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return dp[n];
|
|
113
|
+
}
|
|
114
|
+
function nearestIds(hits, target, limit = 5) {
|
|
115
|
+
return hits
|
|
116
|
+
.map((h) => ({ id: h.id, kind: h.kind, distance: levenshtein(h.id, target) }))
|
|
117
|
+
.filter((h) => h.distance <= Math.max(3, Math.floor(target.length * 0.4)))
|
|
118
|
+
.sort((a, b) => a.distance - b.distance)
|
|
119
|
+
.slice(0, limit);
|
|
120
|
+
}
|
|
121
|
+
function tokenize(s) {
|
|
122
|
+
return s
|
|
123
|
+
.toLowerCase()
|
|
124
|
+
.split(/[^a-z0-9]+/)
|
|
125
|
+
.filter((t) => t.length >= 3);
|
|
126
|
+
}
|
|
127
|
+
function rankForTask(inspection, task) {
|
|
128
|
+
const all = rankAll(inspection, task, 50);
|
|
129
|
+
return {
|
|
130
|
+
rules: all.rules.map((r) => ({ id: r.item.id, score: r.score, reasons: r.reasons })),
|
|
131
|
+
paths: all.paths.map((r) => ({ id: r.item.id, score: r.score, reasons: r.reasons })),
|
|
132
|
+
templates: all.templates.map((r) => ({ id: r.item.id, score: r.score, reasons: r.reasons })),
|
|
133
|
+
pipelines: all.pipelines.map((r) => ({ id: r.item.id, score: r.score, reasons: r.reasons })),
|
|
134
|
+
presets: all.presets.map((r) => ({ id: r.item.id, score: r.score, reasons: r.reasons })),
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
function suggestedFixes(taskOrQuery, hit, matched, missing) {
|
|
138
|
+
const out = [];
|
|
139
|
+
const lower = taskOrQuery.toLowerCase();
|
|
140
|
+
const tokens = new Set(tokenize(taskOrQuery));
|
|
141
|
+
const itemTags = new Set((hit.tags ?? []).map((t) => t.toLowerCase()));
|
|
142
|
+
const itemAW = new Set((hit.appliesWhen ?? []).map((t) => t.toLowerCase()));
|
|
143
|
+
if (missing.some((s) => s.signal === 'token-hits-title')) {
|
|
144
|
+
out.push(`Mention one of these tokens in title/description so token hits score: ${[...tokens].slice(0, 5).join(', ')}`);
|
|
145
|
+
}
|
|
146
|
+
if (missing.some((s) => s.signal === 'tags')) {
|
|
147
|
+
const candidate = inferDomainTags(lower);
|
|
148
|
+
if (candidate.length > 0) {
|
|
149
|
+
out.push(`Add a tag matching the task domain: ${candidate.filter((t) => !itemTags.has(t)).join(', ')}`);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
if (missing.some((s) => s.signal === 'appliesWhen')) {
|
|
153
|
+
const candidate = inferDomainAppliesWhen(lower);
|
|
154
|
+
if (candidate.length > 0) {
|
|
155
|
+
out.push(`Declare an appliesWhen value matching task intent: ${candidate.filter((a) => !itemAW.has(a)).join(', ')}`);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
if (matched.length === 0 && missing.length > 0) {
|
|
159
|
+
out.push('No signals matched. Add tags/appliesWhen referencing the task domain, or include domain tokens in the title.');
|
|
160
|
+
}
|
|
161
|
+
return out;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Generic domain-token inference. Project-specific tokens (e.g.
|
|
165
|
+
* "primitive", "adapter", "sandbox") move to pack-contributed search-tuning
|
|
166
|
+
* rather than hardcoded heuristics in the engine.
|
|
167
|
+
*/
|
|
168
|
+
function inferDomainTags(taskLower) {
|
|
169
|
+
const out = [];
|
|
170
|
+
if (/\bplugin\b/.test(taskLower))
|
|
171
|
+
out.push('plugin');
|
|
172
|
+
if (/\brenderer\b/.test(taskLower))
|
|
173
|
+
out.push('renderer');
|
|
174
|
+
if (/\b(angular|react)\b/.test(taskLower))
|
|
175
|
+
out.push(/\bangular\b/.test(taskLower) ? 'angular' : 'react');
|
|
176
|
+
if (/\b(layout|drag|drop)\b/.test(taskLower))
|
|
177
|
+
out.push('layout');
|
|
178
|
+
return Array.from(new Set(out));
|
|
179
|
+
}
|
|
180
|
+
function inferDomainAppliesWhen(taskLower) {
|
|
181
|
+
const out = [];
|
|
182
|
+
if (/\b(create|add|new|generate|build)\b/.test(taskLower))
|
|
183
|
+
out.push('generate-code');
|
|
184
|
+
if (/\bplugin\b/.test(taskLower))
|
|
185
|
+
out.push('create-plugin');
|
|
186
|
+
if (/\b(rename|move)\b/.test(taskLower))
|
|
187
|
+
out.push('refactor');
|
|
188
|
+
if (/\bcapability\b/.test(taskLower))
|
|
189
|
+
out.push('create-capability');
|
|
190
|
+
return Array.from(new Set(out));
|
|
191
|
+
}
|
|
192
|
+
function commonSuggestedCommands(found, hit) {
|
|
193
|
+
if (!found) {
|
|
194
|
+
return [
|
|
195
|
+
'shrk commands suggest "<partial id>"',
|
|
196
|
+
'shrk find <text>',
|
|
197
|
+
'shrk search <text> --explain',
|
|
198
|
+
];
|
|
199
|
+
}
|
|
200
|
+
const out = [];
|
|
201
|
+
out.push(`shrk why-not ${hit?.id ?? '<id>'} --for-task "<task>"`);
|
|
202
|
+
out.push('shrk search "<task>" --explain');
|
|
203
|
+
out.push('shrk search tuning explain "<task>"');
|
|
204
|
+
out.push('shrk coverage scaffolds --task "<task>"');
|
|
205
|
+
return out;
|
|
206
|
+
}
|
|
207
|
+
function deriveMatchedAndMissing(hit, taskOrQuery) {
|
|
208
|
+
if (!hit)
|
|
209
|
+
return { matched: [], missing: [] };
|
|
210
|
+
const taskTokens = new Set(tokenize(taskOrQuery));
|
|
211
|
+
const titleTokens = new Set(tokenize(hit.title));
|
|
212
|
+
const idTokens = new Set(tokenize(hit.id));
|
|
213
|
+
const tagSet = new Set((hit.tags ?? []).map((t) => t.toLowerCase()));
|
|
214
|
+
const awSet = new Set((hit.appliesWhen ?? []).map((t) => t.toLowerCase()));
|
|
215
|
+
const inferredTags = new Set(inferDomainTags(taskOrQuery.toLowerCase()));
|
|
216
|
+
const inferredAW = new Set(inferDomainAppliesWhen(taskOrQuery.toLowerCase()));
|
|
217
|
+
const titleHits = [];
|
|
218
|
+
for (const t of taskTokens)
|
|
219
|
+
if (titleTokens.has(t))
|
|
220
|
+
titleHits.push(t);
|
|
221
|
+
const idHits = [];
|
|
222
|
+
for (const t of taskTokens)
|
|
223
|
+
if (idTokens.has(t))
|
|
224
|
+
idHits.push(t);
|
|
225
|
+
const tagHits = [];
|
|
226
|
+
for (const t of inferredTags)
|
|
227
|
+
if (tagSet.has(t))
|
|
228
|
+
tagHits.push(t);
|
|
229
|
+
const awHits = [];
|
|
230
|
+
for (const a of inferredAW)
|
|
231
|
+
if (awSet.has(a))
|
|
232
|
+
awHits.push(a);
|
|
233
|
+
const matched = [];
|
|
234
|
+
const missing = [];
|
|
235
|
+
if (titleHits.length > 0)
|
|
236
|
+
matched.push({ signal: 'token-hits-title', matched: true, detail: titleHits.join(', ') });
|
|
237
|
+
else
|
|
238
|
+
missing.push({ signal: 'token-hits-title', matched: false });
|
|
239
|
+
if (idHits.length > 0)
|
|
240
|
+
matched.push({ signal: 'id-tokens', matched: true, detail: idHits.join(', ') });
|
|
241
|
+
else
|
|
242
|
+
missing.push({ signal: 'id-tokens', matched: false });
|
|
243
|
+
if (tagHits.length > 0)
|
|
244
|
+
matched.push({ signal: 'tags', matched: true, detail: tagHits.join(', ') });
|
|
245
|
+
else
|
|
246
|
+
missing.push({ signal: 'tags', matched: false });
|
|
247
|
+
if (awHits.length > 0)
|
|
248
|
+
matched.push({ signal: 'appliesWhen', matched: true, detail: awHits.join(', ') });
|
|
249
|
+
else
|
|
250
|
+
missing.push({ signal: 'appliesWhen', matched: false });
|
|
251
|
+
return { matched, missing };
|
|
252
|
+
}
|
|
253
|
+
function gatherTuningTrace(hit, tuning, taskOrQuery) {
|
|
254
|
+
if (!hit)
|
|
255
|
+
return [];
|
|
256
|
+
const tokens = tokenize(taskOrQuery);
|
|
257
|
+
const boost = tuningBoostFor({
|
|
258
|
+
id: hit.id,
|
|
259
|
+
kind: hit.kind,
|
|
260
|
+
...(hit.tags ? { tags: hit.tags } : {}),
|
|
261
|
+
source: hit.source,
|
|
262
|
+
}, tokens, tuning);
|
|
263
|
+
if (!boost.composition || boost.composition.length === 0) {
|
|
264
|
+
if (boost.reasons.length === 0)
|
|
265
|
+
return [];
|
|
266
|
+
return [{ tuningId: '(combined)', reasons: boost.reasons, delta: boost.delta ?? 0 }];
|
|
267
|
+
}
|
|
268
|
+
const traces = [];
|
|
269
|
+
for (const c of boost.composition) {
|
|
270
|
+
for (const x of c.contributors) {
|
|
271
|
+
traces.push({
|
|
272
|
+
tuningId: x.tuningId,
|
|
273
|
+
reasons: [`${c.key} ${x.value > 0 ? '+' : ''}${x.value}`],
|
|
274
|
+
delta: x.value,
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
return traces;
|
|
279
|
+
}
|
|
280
|
+
export function explainRankerDecision(inspection, request, options = {}) {
|
|
281
|
+
const topN = options.topN ?? 10;
|
|
282
|
+
const hits = listRegistryHits(inspection);
|
|
283
|
+
const id = request.id;
|
|
284
|
+
const found = hits.find((h) => h.id === id);
|
|
285
|
+
const taskOrQuery = request.task ?? request.query ?? '';
|
|
286
|
+
const tuning = listSearchTuning(inspection);
|
|
287
|
+
// Build search-based ranking for query mode (no task).
|
|
288
|
+
let ranker;
|
|
289
|
+
let documentSnapshot;
|
|
290
|
+
let searchScore;
|
|
291
|
+
let searchRank;
|
|
292
|
+
let searchThreshold;
|
|
293
|
+
if (request.task) {
|
|
294
|
+
ranker = rankForTask(inspection, request.task);
|
|
295
|
+
}
|
|
296
|
+
if (request.query) {
|
|
297
|
+
const index = buildSearchIndex(inspection);
|
|
298
|
+
const result = searchIndex(index, { query: request.query, limit: Math.max(topN, 20), explain: true }, inspection);
|
|
299
|
+
const targetHit = result.hits.find((h) => h.document.id === id);
|
|
300
|
+
if (targetHit) {
|
|
301
|
+
documentSnapshot = targetHit.document;
|
|
302
|
+
searchScore = targetHit.score;
|
|
303
|
+
searchRank = result.hits.indexOf(targetHit) + 1;
|
|
304
|
+
}
|
|
305
|
+
const tail = result.hits[Math.min(topN, result.hits.length) - 1];
|
|
306
|
+
if (tail)
|
|
307
|
+
searchThreshold = tail.score;
|
|
308
|
+
}
|
|
309
|
+
// For task ranking, find which kind contains the target.
|
|
310
|
+
let rank;
|
|
311
|
+
let score;
|
|
312
|
+
let threshold;
|
|
313
|
+
let kindContainer;
|
|
314
|
+
if (ranker) {
|
|
315
|
+
for (const key of ['rules', 'paths', 'templates', 'pipelines', 'presets']) {
|
|
316
|
+
const arr = ranker[key];
|
|
317
|
+
const idx = arr.findIndex((r) => r.id === id);
|
|
318
|
+
if (idx >= 0) {
|
|
319
|
+
rank = idx + 1;
|
|
320
|
+
score = arr[idx].score;
|
|
321
|
+
const tail = arr[Math.min(topN, arr.length) - 1];
|
|
322
|
+
threshold = tail ? tail.score : 0;
|
|
323
|
+
kindContainer = key;
|
|
324
|
+
break;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
const included = ranker ? !!(rank && rank <= topN) : !!(searchRank && searchRank <= topN);
|
|
329
|
+
// Matched / missing signals derived from the task/query vs hit metadata.
|
|
330
|
+
const sig = deriveMatchedAndMissing(found, taskOrQuery);
|
|
331
|
+
// Items that outranked the target.
|
|
332
|
+
const outranked = [];
|
|
333
|
+
if (ranker && kindContainer) {
|
|
334
|
+
const arr = ranker[kindContainer];
|
|
335
|
+
const myIdx = arr.findIndex((r) => r.id === id);
|
|
336
|
+
if (myIdx > 0) {
|
|
337
|
+
for (const better of arr.slice(0, myIdx)) {
|
|
338
|
+
outranked.push({ id: better.id, kind: kindContainer.slice(0, -1), score: better.score, reasons: better.reasons.slice(0, 3) });
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
if (!ranker && request.query && documentSnapshot && searchRank && searchRank > 1) {
|
|
343
|
+
const index = buildSearchIndex(inspection);
|
|
344
|
+
const r = searchIndex(index, { query: request.query, limit: Math.max(topN, 20), explain: true }, inspection);
|
|
345
|
+
for (let i = 0; i < searchRank - 1; i += 1) {
|
|
346
|
+
const h = r.hits[i];
|
|
347
|
+
if (!h)
|
|
348
|
+
break;
|
|
349
|
+
outranked.push({ id: h.document.id, kind: String(h.document.kind), score: h.score, reasons: h.reasons.slice(0, 3) });
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
const tuningTrace = gatherTuningTrace(found, tuning, taskOrQuery);
|
|
353
|
+
const matchedSignals = sig.matched;
|
|
354
|
+
const missingSignals = sig.missing;
|
|
355
|
+
const suggestedMetadataFixes = found
|
|
356
|
+
? suggestedFixes(taskOrQuery, found, matchedSignals, missingSignals)
|
|
357
|
+
: [];
|
|
358
|
+
const suggestedCommands = commonSuggestedCommands(!!found, found);
|
|
359
|
+
const diagnostics = [];
|
|
360
|
+
if (!found)
|
|
361
|
+
diagnostics.push(`id "${id}" was not found in any registry`);
|
|
362
|
+
if (found && !taskOrQuery)
|
|
363
|
+
diagnostics.push('no --for-task or --for-query provided — only structural info available');
|
|
364
|
+
if (options.whyNot && included)
|
|
365
|
+
diagnostics.push('why-not asked, but the id IS included for this task');
|
|
366
|
+
if (!options.whyNot && !found)
|
|
367
|
+
diagnostics.push('cannot include a missing id — see nearestIds[]');
|
|
368
|
+
const report = {
|
|
369
|
+
schema: RANKER_EXPLAINABILITY_SCHEMA,
|
|
370
|
+
generatedAt: new Date().toISOString(),
|
|
371
|
+
request,
|
|
372
|
+
found: !!found,
|
|
373
|
+
...(found ? { resolvedKind: found.kind } : {}),
|
|
374
|
+
included,
|
|
375
|
+
...(rank !== undefined ? { rank } : searchRank !== undefined ? { rank: searchRank } : {}),
|
|
376
|
+
...(score !== undefined ? { score } : searchScore !== undefined ? { score: searchScore } : {}),
|
|
377
|
+
...(threshold !== undefined ? { threshold } : searchThreshold !== undefined ? { threshold: searchThreshold } : {}),
|
|
378
|
+
matchedSignals,
|
|
379
|
+
missingSignals,
|
|
380
|
+
outrankedBy: outranked.slice(0, 5),
|
|
381
|
+
tuningTrace,
|
|
382
|
+
suggestedMetadataFixes,
|
|
383
|
+
suggestedCommands,
|
|
384
|
+
nearestIds: found ? [] : nearestIds(hits, id),
|
|
385
|
+
diagnostics,
|
|
386
|
+
};
|
|
387
|
+
return report;
|
|
388
|
+
}
|
|
389
|
+
// ── Rendering ───────────────────────────────────────────────────────────
|
|
390
|
+
export function renderRankerExplainText(report, whyNot) {
|
|
391
|
+
const lines = [];
|
|
392
|
+
const heading = whyNot ? `=== shrk why-not ${report.request.id} ===` : `=== shrk why ${report.request.id} ===`;
|
|
393
|
+
lines.push(heading);
|
|
394
|
+
if (report.request.task)
|
|
395
|
+
lines.push(`task: ${report.request.task}`);
|
|
396
|
+
if (report.request.query)
|
|
397
|
+
lines.push(`query: ${report.request.query}`);
|
|
398
|
+
lines.push('');
|
|
399
|
+
lines.push(`found: ${report.found ? 'yes' : 'no'}`);
|
|
400
|
+
if (report.resolvedKind)
|
|
401
|
+
lines.push(`kind: ${report.resolvedKind}`);
|
|
402
|
+
lines.push(`included: ${report.included ? 'yes' : 'no'}`);
|
|
403
|
+
if (report.rank !== undefined)
|
|
404
|
+
lines.push(`rank: ${report.rank}`);
|
|
405
|
+
if (report.score !== undefined)
|
|
406
|
+
lines.push(`score: ${report.score}`);
|
|
407
|
+
if (report.threshold !== undefined)
|
|
408
|
+
lines.push(`threshold: ${report.threshold}`);
|
|
409
|
+
lines.push('');
|
|
410
|
+
if (report.matchedSignals.length > 0) {
|
|
411
|
+
lines.push('Matched signals:');
|
|
412
|
+
for (const s of report.matchedSignals) {
|
|
413
|
+
lines.push(` + ${s.signal}${s.detail ? `: ${s.detail}` : ''}`);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
else {
|
|
417
|
+
lines.push('Matched signals: (none)');
|
|
418
|
+
}
|
|
419
|
+
if (report.missingSignals.length > 0) {
|
|
420
|
+
lines.push('Missing signals:');
|
|
421
|
+
for (const s of report.missingSignals) {
|
|
422
|
+
lines.push(` - ${s.signal}`);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
if (report.outrankedBy.length > 0) {
|
|
426
|
+
lines.push('');
|
|
427
|
+
lines.push('Outranked by:');
|
|
428
|
+
for (const o of report.outrankedBy) {
|
|
429
|
+
lines.push(` [${o.score}] ${o.id} (${o.kind}) ${o.reasons.join('; ')}`);
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
if (report.tuningTrace.length > 0) {
|
|
433
|
+
lines.push('');
|
|
434
|
+
lines.push('Search tuning trace:');
|
|
435
|
+
for (const t of report.tuningTrace) {
|
|
436
|
+
lines.push(` · ${t.tuningId} delta=${t.delta} ${t.reasons.join('; ')}`);
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
if (report.suggestedMetadataFixes.length > 0) {
|
|
440
|
+
lines.push('');
|
|
441
|
+
lines.push('Suggested metadata fixes:');
|
|
442
|
+
for (const f of report.suggestedMetadataFixes)
|
|
443
|
+
lines.push(` • ${f}`);
|
|
444
|
+
}
|
|
445
|
+
if (report.suggestedCommands.length > 0) {
|
|
446
|
+
lines.push('');
|
|
447
|
+
lines.push('Next commands:');
|
|
448
|
+
for (const c of report.suggestedCommands)
|
|
449
|
+
lines.push(` $ ${c}`);
|
|
450
|
+
}
|
|
451
|
+
if (report.nearestIds.length > 0) {
|
|
452
|
+
lines.push('');
|
|
453
|
+
lines.push('Nearest ids:');
|
|
454
|
+
for (const n of report.nearestIds)
|
|
455
|
+
lines.push(` ~ ${n.id} (${n.kind}) distance=${n.distance}`);
|
|
456
|
+
}
|
|
457
|
+
if (report.diagnostics.length > 0) {
|
|
458
|
+
lines.push('');
|
|
459
|
+
lines.push('Diagnostics:');
|
|
460
|
+
for (const d of report.diagnostics)
|
|
461
|
+
lines.push(` · ${d}`);
|
|
462
|
+
}
|
|
463
|
+
return lines.join('\n') + '\n';
|
|
464
|
+
}
|
|
465
|
+
function escHtml(s) {
|
|
466
|
+
return s.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
|
467
|
+
}
|
|
468
|
+
export function renderRankerExplainMarkdown(report, whyNot) {
|
|
469
|
+
const lines = [];
|
|
470
|
+
lines.push(`# ${whyNot ? 'shrk why-not' : 'shrk why'} \`${report.request.id}\``);
|
|
471
|
+
if (report.request.task)
|
|
472
|
+
lines.push(`Task: \`${report.request.task}\``);
|
|
473
|
+
if (report.request.query)
|
|
474
|
+
lines.push(`Query: \`${report.request.query}\``);
|
|
475
|
+
lines.push('');
|
|
476
|
+
lines.push('| Field | Value |');
|
|
477
|
+
lines.push('| --- | --- |');
|
|
478
|
+
lines.push(`| found | ${report.found ? 'yes' : 'no'} |`);
|
|
479
|
+
if (report.resolvedKind)
|
|
480
|
+
lines.push(`| kind | ${report.resolvedKind} |`);
|
|
481
|
+
lines.push(`| included | ${report.included ? 'yes' : 'no'} |`);
|
|
482
|
+
if (report.rank !== undefined)
|
|
483
|
+
lines.push(`| rank | ${report.rank} |`);
|
|
484
|
+
if (report.score !== undefined)
|
|
485
|
+
lines.push(`| score | ${report.score} |`);
|
|
486
|
+
if (report.threshold !== undefined)
|
|
487
|
+
lines.push(`| threshold | ${report.threshold} |`);
|
|
488
|
+
lines.push('');
|
|
489
|
+
if (report.matchedSignals.length > 0) {
|
|
490
|
+
lines.push('## Matched signals');
|
|
491
|
+
for (const s of report.matchedSignals)
|
|
492
|
+
lines.push(`- ${s.signal}${s.detail ? `: ${s.detail}` : ''}`);
|
|
493
|
+
lines.push('');
|
|
494
|
+
}
|
|
495
|
+
if (report.missingSignals.length > 0) {
|
|
496
|
+
lines.push('## Missing signals');
|
|
497
|
+
for (const s of report.missingSignals)
|
|
498
|
+
lines.push(`- ${s.signal}`);
|
|
499
|
+
lines.push('');
|
|
500
|
+
}
|
|
501
|
+
if (report.outrankedBy.length > 0) {
|
|
502
|
+
lines.push('## Outranked by');
|
|
503
|
+
for (const o of report.outrankedBy) {
|
|
504
|
+
lines.push(`- \`${o.id}\` (${o.kind}) score=${o.score} — ${o.reasons.join('; ')}`);
|
|
505
|
+
}
|
|
506
|
+
lines.push('');
|
|
507
|
+
}
|
|
508
|
+
if (report.tuningTrace.length > 0) {
|
|
509
|
+
lines.push('## Search tuning trace');
|
|
510
|
+
for (const t of report.tuningTrace) {
|
|
511
|
+
lines.push(`- \`${t.tuningId}\` delta=${t.delta} — ${t.reasons.join('; ')}`);
|
|
512
|
+
}
|
|
513
|
+
lines.push('');
|
|
514
|
+
}
|
|
515
|
+
if (report.suggestedMetadataFixes.length > 0) {
|
|
516
|
+
lines.push('## Suggested metadata fixes');
|
|
517
|
+
for (const f of report.suggestedMetadataFixes)
|
|
518
|
+
lines.push(`- ${f}`);
|
|
519
|
+
lines.push('');
|
|
520
|
+
}
|
|
521
|
+
if (report.suggestedCommands.length > 0) {
|
|
522
|
+
lines.push('## Next commands');
|
|
523
|
+
for (const c of report.suggestedCommands)
|
|
524
|
+
lines.push(`- \`${c}\``);
|
|
525
|
+
lines.push('');
|
|
526
|
+
}
|
|
527
|
+
if (report.nearestIds.length > 0) {
|
|
528
|
+
lines.push('## Nearest ids');
|
|
529
|
+
for (const n of report.nearestIds)
|
|
530
|
+
lines.push(`- \`${n.id}\` (${n.kind}) distance=${n.distance}`);
|
|
531
|
+
lines.push('');
|
|
532
|
+
}
|
|
533
|
+
if (report.diagnostics.length > 0) {
|
|
534
|
+
lines.push('## Diagnostics');
|
|
535
|
+
for (const d of report.diagnostics)
|
|
536
|
+
lines.push(`- ${d}`);
|
|
537
|
+
lines.push('');
|
|
538
|
+
}
|
|
539
|
+
return lines.join('\n');
|
|
540
|
+
}
|
|
541
|
+
export function renderRankerExplainHtml(report, whyNot) {
|
|
542
|
+
const md = renderRankerExplainMarkdown(report, whyNot);
|
|
543
|
+
return [
|
|
544
|
+
'<!doctype html><html><head><meta charset="utf-8">',
|
|
545
|
+
`<title>SharkCraft — ${whyNot ? 'why-not' : 'why'} ${escHtml(report.request.id)}</title>`,
|
|
546
|
+
'<style>body{font:14px/1.5 -apple-system,sans-serif;max-width:880px;margin:24px auto;padding:0 16px}h1{font-size:20px;border-bottom:1px solid #d0d7de;padding-bottom:8px}h2{font-size:16px;margin-top:24px}code{background:#f6f8fa;padding:1px 4px;border-radius:4px;font-size:12px}table{border-collapse:collapse}th,td{border:1px solid #d0d7de;padding:4px 10px}</style></head><body>',
|
|
547
|
+
'<pre>' + escHtml(md) + '</pre>',
|
|
548
|
+
'</body></html>',
|
|
549
|
+
].join('\n');
|
|
550
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IReferenceLookup } from '@shrkcrft/presets';
|
|
2
|
+
import type { ISharkcraftInspection } from './sharkcraft-inspector.js';
|
|
3
|
+
/**
|
|
4
|
+
* Adapt a SharkCraft inspection to the {@link IReferenceLookup} contract the
|
|
5
|
+
* preset reference resolver expects. Pure read-through; no state.
|
|
6
|
+
*/
|
|
7
|
+
export declare function inspectionReferenceLookup(inspection: ISharkcraftInspection): IReferenceLookup;
|
|
8
|
+
//# sourceMappingURL=reference-lookup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reference-lookup.d.ts","sourceRoot":"","sources":["../src/reference-lookup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAEvE;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,qBAAqB,GAChC,gBAAgB,CAalB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adapt a SharkCraft inspection to the {@link IReferenceLookup} contract the
|
|
3
|
+
* preset reference resolver expects. Pure read-through; no state.
|
|
4
|
+
*/
|
|
5
|
+
export function inspectionReferenceLookup(inspection) {
|
|
6
|
+
const knowledgeIds = new Set(inspection.knowledgeEntries.map((e) => e.id));
|
|
7
|
+
const ruleIds = new Set(inspection.ruleService.list().map((r) => r.id));
|
|
8
|
+
const pathIds = new Set(inspection.pathService.list().map((p) => p.id));
|
|
9
|
+
const templateIds = new Set(inspection.templates.map((t) => t.id));
|
|
10
|
+
const pipelineIds = new Set(inspection.pipelines.map((p) => p.id));
|
|
11
|
+
return {
|
|
12
|
+
hasKnowledge: (id) => knowledgeIds.has(id),
|
|
13
|
+
hasRule: (id) => ruleIds.has(id),
|
|
14
|
+
hasPath: (id) => pathIds.has(id),
|
|
15
|
+
hasTemplate: (id) => templateIds.has(id),
|
|
16
|
+
hasPipeline: (id) => pipelineIds.has(id),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type IRegistrationHint, type IRegistrationHintOperation } from '@shrkcrft/plugin-api';
|
|
2
|
+
import type { ISharkcraftInspection } from './sharkcraft-inspector.js';
|
|
3
|
+
export declare const REGISTRATION_HINT_REGISTRY_SCHEMA = "sharkcraft.registration-hint-registry/v1";
|
|
4
|
+
export declare enum RegistrationHintSource {
|
|
5
|
+
Local = "local",
|
|
6
|
+
Pack = "pack",
|
|
7
|
+
Fixture = "fixture"
|
|
8
|
+
}
|
|
9
|
+
export interface IRegistrationHintEntry {
|
|
10
|
+
readonly hint: IRegistrationHint;
|
|
11
|
+
readonly source: RegistrationHintSource;
|
|
12
|
+
readonly packageName?: string;
|
|
13
|
+
readonly sourceFile: string;
|
|
14
|
+
}
|
|
15
|
+
export interface IRegistrationHintDoctorIssue {
|
|
16
|
+
readonly severity: 'info' | 'warning' | 'error';
|
|
17
|
+
readonly code: string;
|
|
18
|
+
readonly message: string;
|
|
19
|
+
readonly hintId?: string;
|
|
20
|
+
readonly source?: string;
|
|
21
|
+
}
|
|
22
|
+
export declare function loadRegistrationHints(inspection: ISharkcraftInspection): Promise<{
|
|
23
|
+
entries: readonly IRegistrationHintEntry[];
|
|
24
|
+
issues: readonly IRegistrationHintDoctorIssue[];
|
|
25
|
+
}>;
|
|
26
|
+
export declare function listRegistrationHints(inspection: ISharkcraftInspection): Promise<readonly IRegistrationHintEntry[]>;
|
|
27
|
+
export declare function getRegistrationHint(inspection: ISharkcraftInspection, hintId: string): Promise<IRegistrationHintEntry | null>;
|
|
28
|
+
export interface IRegistrationHintPreviewOperation {
|
|
29
|
+
readonly kind: IRegistrationHintOperation['kind'];
|
|
30
|
+
readonly anchor?: string;
|
|
31
|
+
readonly snippet?: string;
|
|
32
|
+
/** Pretty-printed description for human review. */
|
|
33
|
+
readonly description: string;
|
|
34
|
+
}
|
|
35
|
+
export interface IRegistrationHintPreview {
|
|
36
|
+
readonly schema: 'sharkcraft.registration-hint-preview/v1';
|
|
37
|
+
readonly hintId: string;
|
|
38
|
+
readonly title: string;
|
|
39
|
+
readonly targetFile: string | null;
|
|
40
|
+
readonly candidates: readonly string[];
|
|
41
|
+
/** True when discovery is ambiguous (multiple candidates) or no file matches. */
|
|
42
|
+
readonly ambiguous: boolean;
|
|
43
|
+
readonly requiresHumanReview: boolean;
|
|
44
|
+
readonly operations: readonly IRegistrationHintPreviewOperation[];
|
|
45
|
+
readonly missingVariables: readonly string[];
|
|
46
|
+
readonly safetyNotes: readonly string[];
|
|
47
|
+
readonly validationCommands: readonly string[];
|
|
48
|
+
readonly nextCommand: string;
|
|
49
|
+
}
|
|
50
|
+
export interface IRegistrationHintPreviewOptions {
|
|
51
|
+
readonly variables?: Readonly<Record<string, string>>;
|
|
52
|
+
}
|
|
53
|
+
export declare function previewRegistrationHint(inspection: ISharkcraftInspection, hintId: string, options?: IRegistrationHintPreviewOptions): Promise<IRegistrationHintPreview | null>;
|
|
54
|
+
export declare function listRegistrationHintIssues(inspection: ISharkcraftInspection): Promise<readonly IRegistrationHintDoctorIssue[]>;
|
|
55
|
+
//# sourceMappingURL=registration-hint-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registration-hint-registry.d.ts","sourceRoot":"","sources":["../src/registration-hint-registry.ts"],"names":[],"mappings":"AAaA,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,0BAA0B,EAChC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAEvE,eAAO,MAAM,iCAAiC,6CAA6C,CAAC;AAE5F,oBAAY,sBAAsB;IAChC,KAAK,UAAU;IACf,IAAI,SAAS;IACb,OAAO,YAAY;CACpB;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,sBAAsB,CAAC;IACxC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;IAChD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AA4BD,wBAAsB,qBAAqB,CACzC,UAAU,EAAE,qBAAqB,GAChC,OAAO,CAAC;IACT,OAAO,EAAE,SAAS,sBAAsB,EAAE,CAAC;IAC3C,MAAM,EAAE,SAAS,4BAA4B,EAAE,CAAC;CACjD,CAAC,CAoFD;AAED,wBAAsB,qBAAqB,CACzC,UAAU,EAAE,qBAAqB,GAChC,OAAO,CAAC,SAAS,sBAAsB,EAAE,CAAC,CAG5C;AAED,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,qBAAqB,EACjC,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC,CAGxC;AAMD,MAAM,WAAW,iCAAiC;IAChD,QAAQ,CAAC,IAAI,EAAE,0BAA0B,CAAC,MAAM,CAAC,CAAC;IAClD,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,mDAAmD;IACnD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,MAAM,EAAE,yCAAyC,CAAC;IAC3D,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,iFAAiF;IACjF,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,mBAAmB,EAAE,OAAO,CAAC;IACtC,QAAQ,CAAC,UAAU,EAAE,SAAS,iCAAiC,EAAE,CAAC;IAClE,QAAQ,CAAC,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7C,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,QAAQ,CAAC,kBAAkB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,SAAS,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACvD;AAED,wBAAsB,uBAAuB,CAC3C,UAAU,EAAE,qBAAqB,EACjC,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,+BAAoC,GAC5C,OAAO,CAAC,wBAAwB,GAAG,IAAI,CAAC,CAgD1C;AA6FD,wBAAsB,0BAA0B,CAC9C,UAAU,EAAE,qBAAqB,GAChC,OAAO,CAAC,SAAS,4BAA4B,EAAE,CAAC,CAwClD"}
|