@shrkcrft/inspector 0.1.0-alpha.1
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 +57 -0
- package/dist/area-map.d.ts.map +1 -0
- package/dist/area-map.js +214 -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 +382 -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 +38 -0
- package/dist/git-helpers.d.ts.map +1 -0
- package/dist/git-helpers.js +173 -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 +422 -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 +224 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +234 -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-merge.d.ts +71 -0
- package/dist/onboarding-drafts-merge.d.ts.map +1 -0
- package/dist/onboarding-drafts-merge.js +174 -0
- package/dist/onboarding-drafts.d.ts +42 -0
- package/dist/onboarding-drafts.d.ts.map +1 -0
- package/dist/onboarding-drafts.js +268 -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 +73 -0
- package/dist/pack-symbol-compat.d.ts.map +1 -0
- package/dist/pack-symbol-compat.js +519 -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 +81 -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 +65 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared uncertainty report shape.
|
|
3
|
+
*
|
|
4
|
+
* Extends `IUncertaintySummary` with a richer surface: reasons /
|
|
5
|
+
* missingSignals / conflictingSignals / suggestedCommands /
|
|
6
|
+
* safeFallbackCommand / whatWouldIncreaseConfidence.
|
|
7
|
+
*
|
|
8
|
+
* Pure, deterministic; can be derived from `IUncertaintySummary` or a
|
|
9
|
+
* fresh task packet.
|
|
10
|
+
*/
|
|
11
|
+
import { buildUncertaintySummary, UncertaintyLevel, } from "./uncertainty.js";
|
|
12
|
+
export const UNCERTAINTY_REPORT_SCHEMA = 'sharkcraft.uncertainty-report/v1';
|
|
13
|
+
function levelToString(level) {
|
|
14
|
+
if (level === UncertaintyLevel.High)
|
|
15
|
+
return 'high';
|
|
16
|
+
if (level === UncertaintyLevel.Medium)
|
|
17
|
+
return 'medium';
|
|
18
|
+
return 'low';
|
|
19
|
+
}
|
|
20
|
+
export function uncertaintyReportFromSummary(summary, fallback = 'shrk task "<task>" --commands-first') {
|
|
21
|
+
const missing = [];
|
|
22
|
+
const conflicting = [];
|
|
23
|
+
const reasons = [];
|
|
24
|
+
for (const s of summary.uncertainty) {
|
|
25
|
+
if (s.code.startsWith('conflict-')) {
|
|
26
|
+
conflicting.push({ id: s.code, message: s.message });
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
missing.push({ id: s.code, message: s.message });
|
|
30
|
+
}
|
|
31
|
+
reasons.push(s.message);
|
|
32
|
+
}
|
|
33
|
+
const increaseConfidence = missing.map((m) => {
|
|
34
|
+
if (m.id.startsWith('no-template'))
|
|
35
|
+
return 'Add a matching template (shrk templates list).';
|
|
36
|
+
if (m.id.startsWith('no-pipeline'))
|
|
37
|
+
return 'Add a pipeline (sharkcraft/pipelines.ts).';
|
|
38
|
+
if (m.id.startsWith('no-path-convention'))
|
|
39
|
+
return 'Add a path convention (shrk paths list).';
|
|
40
|
+
if (m.id.startsWith('no-validation-command'))
|
|
41
|
+
return 'Declare verificationCommands on the matched rule.';
|
|
42
|
+
if (m.id.startsWith('weak-knowledge'))
|
|
43
|
+
return 'Add knowledge with broader appliesWhen tokens.';
|
|
44
|
+
if (m.id.startsWith('low-ranker-confidence'))
|
|
45
|
+
return 'Add search-tuning bias for the task tokens.';
|
|
46
|
+
return `Resolve "${m.id}".`;
|
|
47
|
+
});
|
|
48
|
+
return {
|
|
49
|
+
schema: UNCERTAINTY_REPORT_SCHEMA,
|
|
50
|
+
confidence: levelToString(summary.confidence),
|
|
51
|
+
reasons,
|
|
52
|
+
missingSignals: missing,
|
|
53
|
+
conflictingSignals: conflicting,
|
|
54
|
+
suggestedCommands: summary.suggestedCommands,
|
|
55
|
+
safeFallbackCommand: fallback,
|
|
56
|
+
whatWouldIncreaseConfidence: Array.from(new Set(increaseConfidence)),
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export function buildUncertaintyReportFromPacket(packet) {
|
|
60
|
+
const summary = buildUncertaintySummary(packet);
|
|
61
|
+
return uncertaintyReportFromSummary(summary);
|
|
62
|
+
}
|
|
63
|
+
export function buildUncertaintyReport(input) {
|
|
64
|
+
return {
|
|
65
|
+
schema: UNCERTAINTY_REPORT_SCHEMA,
|
|
66
|
+
confidence: input.confidence,
|
|
67
|
+
reasons: input.reasons ?? [],
|
|
68
|
+
missingSignals: input.missingSignals ?? [],
|
|
69
|
+
conflictingSignals: input.conflictingSignals ?? [],
|
|
70
|
+
suggestedCommands: input.suggestedCommands ?? [],
|
|
71
|
+
safeFallbackCommand: input.safeFallbackCommand,
|
|
72
|
+
whatWouldIncreaseConfidence: input.whatWouldIncreaseConfidence ?? [],
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
export function renderUncertaintyReportText(report) {
|
|
76
|
+
const lines = [];
|
|
77
|
+
lines.push(`Confidence: ${report.confidence.toUpperCase()}`);
|
|
78
|
+
if (report.confidence === 'low' || report.confidence === 'unknown') {
|
|
79
|
+
lines.push('⚠ Low confidence — review carefully before acting on these recommendations.');
|
|
80
|
+
}
|
|
81
|
+
if (report.reasons.length > 0) {
|
|
82
|
+
lines.push('Reasons:');
|
|
83
|
+
for (const r of report.reasons.slice(0, 6))
|
|
84
|
+
lines.push(` • ${r}`);
|
|
85
|
+
}
|
|
86
|
+
if (report.missingSignals.length > 0) {
|
|
87
|
+
lines.push('Missing signals:');
|
|
88
|
+
for (const m of report.missingSignals.slice(0, 6))
|
|
89
|
+
lines.push(` • ${m.id} — ${m.message}`);
|
|
90
|
+
}
|
|
91
|
+
if (report.conflictingSignals.length > 0) {
|
|
92
|
+
lines.push('Conflicting signals:');
|
|
93
|
+
for (const c of report.conflictingSignals.slice(0, 6))
|
|
94
|
+
lines.push(` • ${c.id} — ${c.message}`);
|
|
95
|
+
}
|
|
96
|
+
if (report.whatWouldIncreaseConfidence.length > 0) {
|
|
97
|
+
lines.push('What would increase confidence:');
|
|
98
|
+
for (const w of report.whatWouldIncreaseConfidence.slice(0, 6))
|
|
99
|
+
lines.push(` • ${w}`);
|
|
100
|
+
}
|
|
101
|
+
if (report.suggestedCommands.length > 0) {
|
|
102
|
+
lines.push('Suggested commands:');
|
|
103
|
+
for (const c of report.suggestedCommands.slice(0, 6))
|
|
104
|
+
lines.push(` • ${c}`);
|
|
105
|
+
}
|
|
106
|
+
lines.push(`Safe fallback: ${report.safeFallbackCommand}`);
|
|
107
|
+
return lines.join('\n');
|
|
108
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Uncertainty reporting.
|
|
3
|
+
*
|
|
4
|
+
* Builds a small `IUncertaintySummary` that `task` / `context` / `brief` /
|
|
5
|
+
* `contract` / `handoff` can surface so the agent does not miss silently.
|
|
6
|
+
*
|
|
7
|
+
* Signals:
|
|
8
|
+
* - no template matched
|
|
9
|
+
* - no playbook matched
|
|
10
|
+
* - no helper matched
|
|
11
|
+
* - no path convention matched
|
|
12
|
+
* - weak knowledge matches only
|
|
13
|
+
* - low ranker confidence
|
|
14
|
+
* - missing validation command
|
|
15
|
+
* - missing scaffold coverage axis
|
|
16
|
+
*
|
|
17
|
+
* Pure, deterministic. Schema: sharkcraft.uncertainty/v1.
|
|
18
|
+
*/
|
|
19
|
+
import type { ITaskPacket } from './task-packet.js';
|
|
20
|
+
export declare const UNCERTAINTY_SCHEMA = "sharkcraft.uncertainty/v1";
|
|
21
|
+
export declare enum UncertaintyLevel {
|
|
22
|
+
High = "high",
|
|
23
|
+
Medium = "medium",
|
|
24
|
+
Low = "low"
|
|
25
|
+
}
|
|
26
|
+
export interface IUncertaintySignal {
|
|
27
|
+
code: string;
|
|
28
|
+
message: string;
|
|
29
|
+
}
|
|
30
|
+
export interface IUncertaintySummary {
|
|
31
|
+
schema: typeof UNCERTAINTY_SCHEMA;
|
|
32
|
+
confidence: UncertaintyLevel;
|
|
33
|
+
uncertainty: readonly IUncertaintySignal[];
|
|
34
|
+
suggestedCommands: readonly string[];
|
|
35
|
+
}
|
|
36
|
+
export declare function buildUncertaintySummary(packet: ITaskPacket): IUncertaintySummary;
|
|
37
|
+
export declare function renderUncertaintyText(summary: IUncertaintySummary): string;
|
|
38
|
+
//# sourceMappingURL=uncertainty.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uncertainty.d.ts","sourceRoot":"","sources":["../src/uncertainty.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,eAAO,MAAM,kBAAkB,8BAA8B,CAAC;AAE9D,oBAAY,gBAAgB;IAC1B,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,GAAG,QAAQ;CACZ;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,OAAO,kBAAkB,CAAC;IAClC,UAAU,EAAE,gBAAgB,CAAC;IAC7B,WAAW,EAAE,SAAS,kBAAkB,EAAE,CAAC;IAC3C,iBAAiB,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC;AAgBD,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,WAAW,GAAG,mBAAmB,CAgEhF;AAsBD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,mBAAmB,GAAG,MAAM,CAc1E"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
export const UNCERTAINTY_SCHEMA = 'sharkcraft.uncertainty/v1';
|
|
2
|
+
export var UncertaintyLevel;
|
|
3
|
+
(function (UncertaintyLevel) {
|
|
4
|
+
UncertaintyLevel["High"] = "high";
|
|
5
|
+
UncertaintyLevel["Medium"] = "medium";
|
|
6
|
+
UncertaintyLevel["Low"] = "low";
|
|
7
|
+
})(UncertaintyLevel || (UncertaintyLevel = {}));
|
|
8
|
+
function thresholdForTokens(taskTokens) {
|
|
9
|
+
// Heuristic: weak token-hit thresholds adapt to task length.
|
|
10
|
+
if (taskTokens >= 6)
|
|
11
|
+
return { weakScore: 6 };
|
|
12
|
+
if (taskTokens >= 3)
|
|
13
|
+
return { weakScore: 4 };
|
|
14
|
+
return { weakScore: 3 };
|
|
15
|
+
}
|
|
16
|
+
function tokenize(s) {
|
|
17
|
+
return s
|
|
18
|
+
.toLowerCase()
|
|
19
|
+
.split(/[^a-z0-9]+/)
|
|
20
|
+
.filter((t) => t.length >= 3);
|
|
21
|
+
}
|
|
22
|
+
export function buildUncertaintySummary(packet) {
|
|
23
|
+
const signals = [];
|
|
24
|
+
const task = packet.task;
|
|
25
|
+
const taskTokens = tokenize(task);
|
|
26
|
+
const threshold = thresholdForTokens(taskTokens.length);
|
|
27
|
+
if (packet.relevantTemplates.length === 0) {
|
|
28
|
+
signals.push({
|
|
29
|
+
code: 'no-template-matched',
|
|
30
|
+
message: `No template matched the task — consider adding one.`,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
if (packet.recommendedPipelines.length === 0) {
|
|
34
|
+
signals.push({
|
|
35
|
+
code: 'no-pipeline-matched',
|
|
36
|
+
message: 'No recommended pipeline.',
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
if (packet.relevantPaths.length === 0) {
|
|
40
|
+
signals.push({
|
|
41
|
+
code: 'no-path-convention-matched',
|
|
42
|
+
message: 'No path convention matched.',
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
if (packet.verificationCommands.length === 0) {
|
|
46
|
+
signals.push({
|
|
47
|
+
code: 'no-validation-command',
|
|
48
|
+
message: 'No verification commands declared on the matching rules.',
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
// Weak knowledge matches when ranker scores cluster under the threshold.
|
|
52
|
+
const ranking = packet.rankingReasons;
|
|
53
|
+
if (ranking?.rules && ranking.rules.length > 0) {
|
|
54
|
+
const top = ranking.rules[0]?.score ?? 0;
|
|
55
|
+
if (top < threshold.weakScore) {
|
|
56
|
+
signals.push({
|
|
57
|
+
code: 'weak-knowledge-matches',
|
|
58
|
+
message: `Top knowledge match score is ${top} (< threshold ${threshold.weakScore}).`,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
// Low ranker confidence overall.
|
|
63
|
+
if (packet.relevantTemplates.length === 0 && packet.relevantPaths.length === 0) {
|
|
64
|
+
signals.push({
|
|
65
|
+
code: 'low-ranker-confidence',
|
|
66
|
+
message: 'Both templates and paths missed — the ranker has low confidence.',
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
const confidence = signals.length === 0
|
|
70
|
+
? UncertaintyLevel.High
|
|
71
|
+
: signals.length <= 2
|
|
72
|
+
? UncertaintyLevel.Medium
|
|
73
|
+
: UncertaintyLevel.Low;
|
|
74
|
+
const suggestedCommands = buildSuggestedCommands(task, signals);
|
|
75
|
+
return {
|
|
76
|
+
schema: UNCERTAINTY_SCHEMA,
|
|
77
|
+
confidence,
|
|
78
|
+
uncertainty: signals,
|
|
79
|
+
suggestedCommands,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
function buildSuggestedCommands(task, signals) {
|
|
83
|
+
const out = [];
|
|
84
|
+
if (signals.some((s) => s.code === 'no-template-matched' || s.code === 'no-path-convention-matched')) {
|
|
85
|
+
out.push(`shrk coverage scaffolds --task "${task}"`);
|
|
86
|
+
}
|
|
87
|
+
if (signals.some((s) => s.code === 'weak-knowledge-matches' || s.code === 'low-ranker-confidence')) {
|
|
88
|
+
out.push(`shrk why-not <id> --for-task "${task}"`);
|
|
89
|
+
out.push(`shrk search tuning explain "${task}"`);
|
|
90
|
+
out.push(`shrk search "${task}" --explain`);
|
|
91
|
+
}
|
|
92
|
+
if (signals.some((s) => s.code === 'no-validation-command')) {
|
|
93
|
+
out.push('shrk fix preview --action-hints');
|
|
94
|
+
}
|
|
95
|
+
if (out.length === 0)
|
|
96
|
+
out.push(`shrk brief "${task}"`);
|
|
97
|
+
return out;
|
|
98
|
+
}
|
|
99
|
+
export function renderUncertaintyText(summary) {
|
|
100
|
+
const lines = [];
|
|
101
|
+
lines.push(`Confidence: ${summary.confidence}`);
|
|
102
|
+
if (summary.uncertainty.length === 0) {
|
|
103
|
+
lines.push('No uncertainty signals — coverage looks complete.');
|
|
104
|
+
return lines.join('\n');
|
|
105
|
+
}
|
|
106
|
+
lines.push('Uncertainty:');
|
|
107
|
+
for (const s of summary.uncertainty)
|
|
108
|
+
lines.push(` - ${s.message}`);
|
|
109
|
+
if (summary.suggestedCommands.length > 0) {
|
|
110
|
+
lines.push('Suggested:');
|
|
111
|
+
for (const c of summary.suggestedCommands)
|
|
112
|
+
lines.push(` $ ${c}`);
|
|
113
|
+
}
|
|
114
|
+
return lines.join('\n');
|
|
115
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { type IUncertaintyReport } from './uncertainty-report.js';
|
|
2
|
+
import type { ISharkcraftInspection } from './sharkcraft-inspector.js';
|
|
3
|
+
export declare const UNIVERSAL_SEARCH_SCHEMA = "sharkcraft.universal-search/v2";
|
|
4
|
+
export declare enum SearchResultKind {
|
|
5
|
+
Command = "command",
|
|
6
|
+
McpTool = "mcp-tool",
|
|
7
|
+
Knowledge = "knowledge",
|
|
8
|
+
Rule = "rule",
|
|
9
|
+
Path = "path",
|
|
10
|
+
Convention = "convention",
|
|
11
|
+
Template = "template",
|
|
12
|
+
Helper = "helper",
|
|
13
|
+
Playbook = "playbook",
|
|
14
|
+
Construct = "construct",
|
|
15
|
+
Policy = "policy",
|
|
16
|
+
Decision = "decision",
|
|
17
|
+
ScaffoldPattern = "scaffold-pattern",
|
|
18
|
+
ContractTemplate = "contract-template",
|
|
19
|
+
MigrationProfile = "migration-profile",
|
|
20
|
+
PluginLifecycleProfile = "plugin-lifecycle-profile",
|
|
21
|
+
FeedbackRule = "feedback-rule",
|
|
22
|
+
TaskRoutingHint = "task-routing-hint",
|
|
23
|
+
Docs = "docs",
|
|
24
|
+
Report = "report",
|
|
25
|
+
Action = "action"
|
|
26
|
+
}
|
|
27
|
+
export interface IUniversalSearchHit {
|
|
28
|
+
readonly kind: SearchResultKind;
|
|
29
|
+
readonly id: string;
|
|
30
|
+
readonly title: string;
|
|
31
|
+
readonly source: 'builtin' | 'local' | 'pack' | 'fixture';
|
|
32
|
+
readonly packageName?: string;
|
|
33
|
+
readonly score: number;
|
|
34
|
+
readonly reasons: readonly string[];
|
|
35
|
+
readonly snippet?: string;
|
|
36
|
+
readonly nextCommand?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface IUniversalSearchSections {
|
|
39
|
+
readonly bestActions: readonly IUniversalSearchHit[];
|
|
40
|
+
readonly commands: readonly IUniversalSearchHit[];
|
|
41
|
+
readonly contributions: readonly IUniversalSearchHit[];
|
|
42
|
+
readonly knowledge: readonly IUniversalSearchHit[];
|
|
43
|
+
readonly validation: readonly IUniversalSearchHit[];
|
|
44
|
+
}
|
|
45
|
+
export interface IUniversalSearchReport {
|
|
46
|
+
readonly schema: typeof UNIVERSAL_SEARCH_SCHEMA;
|
|
47
|
+
readonly generatedAt: string;
|
|
48
|
+
readonly query: string;
|
|
49
|
+
readonly sections: IUniversalSearchSections;
|
|
50
|
+
readonly uncertainty: IUncertaintyReport;
|
|
51
|
+
readonly whyTheseRanked: readonly string[];
|
|
52
|
+
readonly nextSuggestions: readonly string[];
|
|
53
|
+
}
|
|
54
|
+
export interface IUniversalSearchOptions {
|
|
55
|
+
readonly kind?: SearchResultKind;
|
|
56
|
+
readonly source?: 'builtin' | 'local' | 'pack' | 'fixture';
|
|
57
|
+
readonly limit?: number;
|
|
58
|
+
readonly commandsOnly?: boolean;
|
|
59
|
+
readonly actionsOnly?: boolean;
|
|
60
|
+
}
|
|
61
|
+
export declare function buildUniversalSearch(inspection: ISharkcraftInspection, query: string, options?: IUniversalSearchOptions): Promise<IUniversalSearchReport>;
|
|
62
|
+
export declare function renderUniversalSearchText(report: IUniversalSearchReport): string;
|
|
63
|
+
export declare function renderUniversalSearchMarkdown(report: IUniversalSearchReport): string;
|
|
64
|
+
//# sourceMappingURL=universal-search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"universal-search.d.ts","sourceRoot":"","sources":["../src/universal-search.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAgC,KAAK,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAGhG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAEvE,eAAO,MAAM,uBAAuB,mCAAmC,CAAC;AAExE,oBAAY,gBAAgB;IAC1B,OAAO,YAAY;IACnB,OAAO,aAAa;IACpB,SAAS,cAAc;IACvB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,UAAU,eAAe;IACzB,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,SAAS,cAAc;IACvB,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,eAAe,qBAAqB;IACpC,gBAAgB,sBAAsB;IACtC,gBAAgB,sBAAsB;IACtC,sBAAsB,6BAA6B;IACnD,YAAY,kBAAkB;IAC9B,eAAe,sBAAsB;IACrC,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,MAAM,WAAW;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;IAC1D,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,WAAW,EAAE,SAAS,mBAAmB,EAAE,CAAC;IACrD,QAAQ,CAAC,QAAQ,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAClD,QAAQ,CAAC,aAAa,EAAE,SAAS,mBAAmB,EAAE,CAAC;IACvD,QAAQ,CAAC,SAAS,EAAE,SAAS,mBAAmB,EAAE,CAAC;IACnD,QAAQ,CAAC,UAAU,EAAE,SAAS,mBAAmB,EAAE,CAAC;CACrD;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,MAAM,EAAE,OAAO,uBAAuB,CAAC;IAChD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,wBAAwB,CAAC;IAC5C,QAAQ,CAAC,WAAW,EAAE,kBAAkB,CAAC;IACzC,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;CAC7C;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACjC,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;IAC3D,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;CAChC;AA+CD,wBAAsB,oBAAoB,CACxC,UAAU,EAAE,qBAAqB,EACjC,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,sBAAsB,CAAC,CAiPjC;AAED,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,sBAAsB,GAAG,MAAM,CAmDhF;AAED,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,sBAAsB,GAAG,MAAM,CA8BpF"}
|
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Universal search (v2).
|
|
3
|
+
*
|
|
4
|
+
* `shrk search "<query>"` becomes a discovery palette across every
|
|
5
|
+
* contribution kind the workspace can produce. Output is a 7-section
|
|
6
|
+
* report — read-only, deterministic.
|
|
7
|
+
*
|
|
8
|
+
* 1. Best actions
|
|
9
|
+
* 2. Exact / strong command matches
|
|
10
|
+
* 3. Relevant project / pack contributions
|
|
11
|
+
* 4. Relevant knowledge / docs
|
|
12
|
+
* 5. Relevant validation commands
|
|
13
|
+
* 6. Uncertainty / no-match explanation
|
|
14
|
+
* 7. Why these ranked
|
|
15
|
+
*/
|
|
16
|
+
import { buildPackContributionsInventory } from "./pack-contributions-inventory.js";
|
|
17
|
+
import { listConventions } from "./convention-registry.js";
|
|
18
|
+
import { listPackHelpers } from "./pack-helper-registry.js";
|
|
19
|
+
import { explainTaskRouting } from "./task-routing-hint-registry.js";
|
|
20
|
+
import { listPluginLifecycleProfiles } from "./plugin-lifecycle-profile-registry.js";
|
|
21
|
+
import { uncertaintyReportFromSummary } from "./uncertainty-report.js";
|
|
22
|
+
import { buildUncertaintySummary } from "./uncertainty.js";
|
|
23
|
+
import { buildTaskPacket } from "./task-packet.js";
|
|
24
|
+
export const UNIVERSAL_SEARCH_SCHEMA = 'sharkcraft.universal-search/v2';
|
|
25
|
+
export var SearchResultKind;
|
|
26
|
+
(function (SearchResultKind) {
|
|
27
|
+
SearchResultKind["Command"] = "command";
|
|
28
|
+
SearchResultKind["McpTool"] = "mcp-tool";
|
|
29
|
+
SearchResultKind["Knowledge"] = "knowledge";
|
|
30
|
+
SearchResultKind["Rule"] = "rule";
|
|
31
|
+
SearchResultKind["Path"] = "path";
|
|
32
|
+
SearchResultKind["Convention"] = "convention";
|
|
33
|
+
SearchResultKind["Template"] = "template";
|
|
34
|
+
SearchResultKind["Helper"] = "helper";
|
|
35
|
+
SearchResultKind["Playbook"] = "playbook";
|
|
36
|
+
SearchResultKind["Construct"] = "construct";
|
|
37
|
+
SearchResultKind["Policy"] = "policy";
|
|
38
|
+
SearchResultKind["Decision"] = "decision";
|
|
39
|
+
SearchResultKind["ScaffoldPattern"] = "scaffold-pattern";
|
|
40
|
+
SearchResultKind["ContractTemplate"] = "contract-template";
|
|
41
|
+
SearchResultKind["MigrationProfile"] = "migration-profile";
|
|
42
|
+
SearchResultKind["PluginLifecycleProfile"] = "plugin-lifecycle-profile";
|
|
43
|
+
SearchResultKind["FeedbackRule"] = "feedback-rule";
|
|
44
|
+
SearchResultKind["TaskRoutingHint"] = "task-routing-hint";
|
|
45
|
+
SearchResultKind["Docs"] = "docs";
|
|
46
|
+
SearchResultKind["Report"] = "report";
|
|
47
|
+
SearchResultKind["Action"] = "action";
|
|
48
|
+
})(SearchResultKind || (SearchResultKind = {}));
|
|
49
|
+
function score(text, q) {
|
|
50
|
+
const reasons = [];
|
|
51
|
+
let s = 0;
|
|
52
|
+
const tLower = text.toLowerCase();
|
|
53
|
+
const qLower = q.toLowerCase();
|
|
54
|
+
if (tLower === qLower) {
|
|
55
|
+
s += 20;
|
|
56
|
+
reasons.push('exact match');
|
|
57
|
+
}
|
|
58
|
+
else if (tLower.includes(qLower)) {
|
|
59
|
+
s += 10;
|
|
60
|
+
reasons.push('substring match');
|
|
61
|
+
}
|
|
62
|
+
const tokens = qLower.split(/[^a-z0-9]+/).filter((x) => x.length >= 3);
|
|
63
|
+
for (const tok of tokens) {
|
|
64
|
+
if (tLower.includes(tok)) {
|
|
65
|
+
s += 3;
|
|
66
|
+
reasons.push(`token "${tok}"`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return { score: s, reasons };
|
|
70
|
+
}
|
|
71
|
+
function makeHit(kind, id, title, source, packageName, raw, nextCommand, snippet) {
|
|
72
|
+
return {
|
|
73
|
+
kind,
|
|
74
|
+
id,
|
|
75
|
+
title,
|
|
76
|
+
source,
|
|
77
|
+
...(packageName ? { packageName } : {}),
|
|
78
|
+
score: raw.score,
|
|
79
|
+
reasons: raw.reasons,
|
|
80
|
+
...(snippet ? { snippet } : {}),
|
|
81
|
+
...(nextCommand ? { nextCommand } : {}),
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
export async function buildUniversalSearch(inspection, query, options = {}) {
|
|
85
|
+
const q = query.trim();
|
|
86
|
+
const limit = options.limit ?? 8;
|
|
87
|
+
// Pull pieces we'll rank against.
|
|
88
|
+
const inv = buildPackContributionsInventory(inspection);
|
|
89
|
+
const conventions = await listConventions(inspection);
|
|
90
|
+
const helpers = await listPackHelpers(inspection);
|
|
91
|
+
const routing = await explainTaskRouting(inspection, q);
|
|
92
|
+
const lifecycle = await listPluginLifecycleProfiles(inspection);
|
|
93
|
+
const knowledgeEntries = inspection.knowledgeEntries;
|
|
94
|
+
const allHits = [];
|
|
95
|
+
// Knowledge
|
|
96
|
+
for (const k of knowledgeEntries) {
|
|
97
|
+
const s = score(`${k.id} ${k.title} ${(k.tags ?? []).join(' ')}`, q);
|
|
98
|
+
if (s.score > 0) {
|
|
99
|
+
allHits.push(makeHit(SearchResultKind.Knowledge, k.id, k.title, k.source?.loader === 'pack' ? 'pack' : 'local', undefined, s, `shrk knowledge get ${k.id}`, k.summary?.slice(0, 120)));
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
// Conventions
|
|
103
|
+
for (const c of conventions) {
|
|
104
|
+
const s = score(`${c.convention.id} ${c.convention.title} ${(c.convention.tags ?? []).join(' ')}`, q);
|
|
105
|
+
if (s.score > 0) {
|
|
106
|
+
allHits.push(makeHit(SearchResultKind.Convention, c.convention.id, c.convention.title, c.source === 'pack' ? 'pack' : 'local', c.packageName, s, `shrk conventions get ${c.convention.id}`));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
// Pack helpers
|
|
110
|
+
for (const h of helpers) {
|
|
111
|
+
const s = score(`${h.helper.id} ${h.helper.title} ${(h.helper.tags ?? []).join(' ')}`, q);
|
|
112
|
+
if (s.score > 0) {
|
|
113
|
+
allHits.push(makeHit(SearchResultKind.Helper, h.helper.id, h.helper.title, h.source === 'pack' ? 'pack' : 'local', h.packageName, s, `shrk helper plan ${h.helper.id}`));
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
// Plugin lifecycle profiles
|
|
117
|
+
for (const p of lifecycle) {
|
|
118
|
+
const s = score(`${p.profile.id} ${p.profile.title} ${(p.profile.tags ?? []).join(' ')}`, q);
|
|
119
|
+
if (s.score > 0) {
|
|
120
|
+
allHits.push(makeHit(SearchResultKind.PluginLifecycleProfile, p.profile.id, p.profile.title, p.source === 'pack' ? 'pack' : 'local', p.packageName, s, `shrk plugin lifecycle profile ${p.profile.id}`));
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
// Pack contributions (catch-all for kinds we didn't iterate above)
|
|
124
|
+
for (const e of inv.entries) {
|
|
125
|
+
if (allHits.find((h) => h.id === e.id && String(h.kind) === e.kind))
|
|
126
|
+
continue;
|
|
127
|
+
const s = score(`${e.id} ${e.title ?? ''}`, q);
|
|
128
|
+
if (s.score > 0) {
|
|
129
|
+
const kindMap = {
|
|
130
|
+
knowledge: SearchResultKind.Knowledge,
|
|
131
|
+
rule: SearchResultKind.Rule,
|
|
132
|
+
path: SearchResultKind.Path,
|
|
133
|
+
'path-convention': SearchResultKind.Path,
|
|
134
|
+
template: SearchResultKind.Template,
|
|
135
|
+
pipeline: SearchResultKind.Action,
|
|
136
|
+
playbook: SearchResultKind.Playbook,
|
|
137
|
+
construct: SearchResultKind.Construct,
|
|
138
|
+
'scaffold-pattern': SearchResultKind.ScaffoldPattern,
|
|
139
|
+
policy: SearchResultKind.Policy,
|
|
140
|
+
decision: SearchResultKind.Decision,
|
|
141
|
+
'contract-template': SearchResultKind.ContractTemplate,
|
|
142
|
+
'migration-profile': SearchResultKind.MigrationProfile,
|
|
143
|
+
'plugin-lifecycle-profile': SearchResultKind.PluginLifecycleProfile,
|
|
144
|
+
'feedback-rule': SearchResultKind.FeedbackRule,
|
|
145
|
+
'task-routing-hint': SearchResultKind.TaskRoutingHint,
|
|
146
|
+
helper: SearchResultKind.Helper,
|
|
147
|
+
convention: SearchResultKind.Convention,
|
|
148
|
+
docs: SearchResultKind.Docs,
|
|
149
|
+
};
|
|
150
|
+
const kind = kindMap[e.kind] ?? SearchResultKind.Action;
|
|
151
|
+
allHits.push(makeHit(kind, e.id, e.title ?? e.id, e.source, e.packageName, s, undefined));
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
// Routing hints — promote them as "best actions".
|
|
155
|
+
const routingHits = routing.slice(0, limit).map((m) => ({
|
|
156
|
+
kind: SearchResultKind.Action,
|
|
157
|
+
id: m.hint.id,
|
|
158
|
+
title: m.hint.title,
|
|
159
|
+
source: m.source === 'pack' ? 'pack' : 'local',
|
|
160
|
+
...(m.packageName ? { packageName: m.packageName } : {}),
|
|
161
|
+
score: m.score,
|
|
162
|
+
reasons: m.reasons,
|
|
163
|
+
...(m.hint.recommends.commands && m.hint.recommends.commands.length > 0
|
|
164
|
+
? { nextCommand: m.hint.recommends.commands[0] }
|
|
165
|
+
: {}),
|
|
166
|
+
}));
|
|
167
|
+
// Filter by options.
|
|
168
|
+
let filtered = allHits;
|
|
169
|
+
if (options.kind)
|
|
170
|
+
filtered = filtered.filter((h) => h.kind === options.kind);
|
|
171
|
+
if (options.source)
|
|
172
|
+
filtered = filtered.filter((h) => h.source === options.source);
|
|
173
|
+
filtered.sort((a, b) => b.score - a.score);
|
|
174
|
+
const sections = {
|
|
175
|
+
bestActions: routingHits.slice(0, limit),
|
|
176
|
+
commands: filtered.filter((h) => h.nextCommand && h.kind !== SearchResultKind.Knowledge).slice(0, limit),
|
|
177
|
+
contributions: filtered
|
|
178
|
+
.filter((h) => [
|
|
179
|
+
SearchResultKind.Convention,
|
|
180
|
+
SearchResultKind.Helper,
|
|
181
|
+
SearchResultKind.Template,
|
|
182
|
+
SearchResultKind.Playbook,
|
|
183
|
+
SearchResultKind.Construct,
|
|
184
|
+
SearchResultKind.Policy,
|
|
185
|
+
SearchResultKind.ContractTemplate,
|
|
186
|
+
SearchResultKind.MigrationProfile,
|
|
187
|
+
SearchResultKind.PluginLifecycleProfile,
|
|
188
|
+
SearchResultKind.ScaffoldPattern,
|
|
189
|
+
SearchResultKind.FeedbackRule,
|
|
190
|
+
SearchResultKind.TaskRoutingHint,
|
|
191
|
+
SearchResultKind.Path,
|
|
192
|
+
SearchResultKind.Rule,
|
|
193
|
+
].includes(h.kind))
|
|
194
|
+
.slice(0, limit),
|
|
195
|
+
knowledge: filtered.filter((h) => h.kind === SearchResultKind.Knowledge || h.kind === SearchResultKind.Docs).slice(0, limit),
|
|
196
|
+
validation: filtered
|
|
197
|
+
.filter((h) => /\bvalidat|doctor|drift|stale|safety|check\b/i.test(h.title))
|
|
198
|
+
.slice(0, limit),
|
|
199
|
+
};
|
|
200
|
+
// Apply commandsOnly / actionsOnly.
|
|
201
|
+
if (options.commandsOnly) {
|
|
202
|
+
return {
|
|
203
|
+
schema: UNIVERSAL_SEARCH_SCHEMA,
|
|
204
|
+
generatedAt: new Date().toISOString(),
|
|
205
|
+
query: q,
|
|
206
|
+
sections: {
|
|
207
|
+
bestActions: [],
|
|
208
|
+
commands: sections.commands,
|
|
209
|
+
contributions: [],
|
|
210
|
+
knowledge: [],
|
|
211
|
+
validation: [],
|
|
212
|
+
},
|
|
213
|
+
uncertainty: uncertaintyReportFromSummary(buildUncertaintySummary(buildTaskPacket(inspection, q))),
|
|
214
|
+
whyTheseRanked: [`Filtered to commands-only.`],
|
|
215
|
+
nextSuggestions: [],
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
if (options.actionsOnly) {
|
|
219
|
+
return {
|
|
220
|
+
schema: UNIVERSAL_SEARCH_SCHEMA,
|
|
221
|
+
generatedAt: new Date().toISOString(),
|
|
222
|
+
query: q,
|
|
223
|
+
sections: {
|
|
224
|
+
bestActions: sections.bestActions,
|
|
225
|
+
commands: [],
|
|
226
|
+
contributions: [],
|
|
227
|
+
knowledge: [],
|
|
228
|
+
validation: [],
|
|
229
|
+
},
|
|
230
|
+
uncertainty: uncertaintyReportFromSummary(buildUncertaintySummary(buildTaskPacket(inspection, q))),
|
|
231
|
+
whyTheseRanked: [`Filtered to actions-only (task routing hints).`],
|
|
232
|
+
nextSuggestions: [],
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
// Uncertainty.
|
|
236
|
+
const packet = buildTaskPacket(inspection, q);
|
|
237
|
+
const uncertainty = uncertaintyReportFromSummary(buildUncertaintySummary(packet), `shrk search "${q}"`);
|
|
238
|
+
const totalHits = sections.bestActions.length +
|
|
239
|
+
sections.commands.length +
|
|
240
|
+
sections.contributions.length +
|
|
241
|
+
sections.knowledge.length +
|
|
242
|
+
sections.validation.length;
|
|
243
|
+
const nextSuggestions = [];
|
|
244
|
+
if (totalHits === 0) {
|
|
245
|
+
nextSuggestions.push(`shrk coverage scaffolds --task "${q}"`, `shrk feedback ingest <file>`, `shrk why <id> --for-task "${q}"`, `shrk commands suggest "${q}"`);
|
|
246
|
+
}
|
|
247
|
+
const whyTheseRanked = [
|
|
248
|
+
'Scoring: exact match +20, substring +10, token ≥3 chars +3 per match.',
|
|
249
|
+
'Best actions come from pack/local task routing hints (highest score first).',
|
|
250
|
+
'Validation section filters titles for `doctor / drift / stale / safety / check`.',
|
|
251
|
+
];
|
|
252
|
+
return {
|
|
253
|
+
schema: UNIVERSAL_SEARCH_SCHEMA,
|
|
254
|
+
generatedAt: new Date().toISOString(),
|
|
255
|
+
query: q,
|
|
256
|
+
sections,
|
|
257
|
+
uncertainty,
|
|
258
|
+
whyTheseRanked,
|
|
259
|
+
nextSuggestions,
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
export function renderUniversalSearchText(report) {
|
|
263
|
+
const lines = [];
|
|
264
|
+
lines.push(`=== shrk search "${report.query}" ===`);
|
|
265
|
+
lines.push('');
|
|
266
|
+
const renderSection = (title, hits) => {
|
|
267
|
+
lines.push(`▶ ${title} (${hits.length})`);
|
|
268
|
+
if (hits.length === 0) {
|
|
269
|
+
lines.push(' (none)');
|
|
270
|
+
}
|
|
271
|
+
else {
|
|
272
|
+
for (const h of hits) {
|
|
273
|
+
const src = h.source === 'pack' ? `pack:${h.packageName ?? '?'}` : h.source;
|
|
274
|
+
lines.push(` • [${h.kind}] ${h.id.padEnd(28)} ${h.title} [${src}] score=${h.score}`);
|
|
275
|
+
if (h.snippet)
|
|
276
|
+
lines.push(` ${h.snippet}`);
|
|
277
|
+
if (h.nextCommand)
|
|
278
|
+
lines.push(` → ${h.nextCommand}`);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
lines.push('');
|
|
282
|
+
};
|
|
283
|
+
renderSection('Best actions', report.sections.bestActions);
|
|
284
|
+
renderSection('Exact / strong command matches', report.sections.commands);
|
|
285
|
+
renderSection('Relevant project / pack contributions', report.sections.contributions);
|
|
286
|
+
renderSection('Relevant knowledge / docs', report.sections.knowledge);
|
|
287
|
+
renderSection('Relevant validation commands', report.sections.validation);
|
|
288
|
+
lines.push('▶ Uncertainty');
|
|
289
|
+
lines.push(` confidence: ${report.uncertainty.confidence.toUpperCase()}`);
|
|
290
|
+
if (report.uncertainty.confidence === 'low' || report.uncertainty.confidence === 'unknown') {
|
|
291
|
+
lines.push(' ⚠ Low confidence — see "What would increase confidence" below.');
|
|
292
|
+
}
|
|
293
|
+
for (const r of report.uncertainty.reasons.slice(0, 4))
|
|
294
|
+
lines.push(` • ${r}`);
|
|
295
|
+
if (report.uncertainty.whatWouldIncreaseConfidence.length > 0) {
|
|
296
|
+
lines.push(' What would increase confidence:');
|
|
297
|
+
for (const w of report.uncertainty.whatWouldIncreaseConfidence.slice(0, 4)) {
|
|
298
|
+
lines.push(` • ${w}`);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
lines.push(` safe fallback: ${report.uncertainty.safeFallbackCommand}`);
|
|
302
|
+
lines.push('');
|
|
303
|
+
if (report.nextSuggestions.length > 0) {
|
|
304
|
+
lines.push('▶ No matches — try:');
|
|
305
|
+
for (const s of report.nextSuggestions)
|
|
306
|
+
lines.push(` $ ${s}`);
|
|
307
|
+
lines.push('');
|
|
308
|
+
}
|
|
309
|
+
lines.push('▶ Why these ranked');
|
|
310
|
+
for (const w of report.whyTheseRanked)
|
|
311
|
+
lines.push(` • ${w}`);
|
|
312
|
+
return lines.join('\n') + '\n';
|
|
313
|
+
}
|
|
314
|
+
export function renderUniversalSearchMarkdown(report) {
|
|
315
|
+
const lines = [];
|
|
316
|
+
lines.push(`# Search "${report.query}"`);
|
|
317
|
+
lines.push('');
|
|
318
|
+
const renderSection = (title, hits) => {
|
|
319
|
+
lines.push(`## ${title}`);
|
|
320
|
+
if (hits.length === 0) {
|
|
321
|
+
lines.push('(none)');
|
|
322
|
+
}
|
|
323
|
+
else {
|
|
324
|
+
lines.push('| Kind | Id | Title | Source | Score | Next |');
|
|
325
|
+
lines.push('| --- | --- | --- | --- | --- | --- |');
|
|
326
|
+
for (const h of hits) {
|
|
327
|
+
const src = h.source === 'pack' ? `pack:${h.packageName ?? '?'}` : h.source;
|
|
328
|
+
lines.push(`| \`${h.kind}\` | \`${h.id}\` | ${h.title} | ${src} | ${h.score} | ${h.nextCommand ?? ''} |`);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
lines.push('');
|
|
332
|
+
};
|
|
333
|
+
renderSection('Best actions', report.sections.bestActions);
|
|
334
|
+
renderSection('Exact / strong command matches', report.sections.commands);
|
|
335
|
+
renderSection('Relevant project / pack contributions', report.sections.contributions);
|
|
336
|
+
renderSection('Relevant knowledge / docs', report.sections.knowledge);
|
|
337
|
+
renderSection('Relevant validation commands', report.sections.validation);
|
|
338
|
+
lines.push(`## Uncertainty`);
|
|
339
|
+
lines.push(`- confidence: **${report.uncertainty.confidence.toUpperCase()}**`);
|
|
340
|
+
for (const r of report.uncertainty.reasons.slice(0, 4))
|
|
341
|
+
lines.push(`- ${r}`);
|
|
342
|
+
lines.push('');
|
|
343
|
+
lines.push('## Why these ranked');
|
|
344
|
+
for (const w of report.whyTheseRanked)
|
|
345
|
+
lines.push(`- ${w}`);
|
|
346
|
+
return lines.join('\n') + '\n';
|
|
347
|
+
}
|