@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,483 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lightweight AST-backed symbol index.
|
|
3
|
+
*
|
|
4
|
+
* Uses the TypeScript compiler API (single-file `createSourceFile`, no
|
|
5
|
+
* full program type-checking) to identify exported / local declarations
|
|
6
|
+
* and re-exports in a TS / TSX / JS / JSX file. Falls back to a text
|
|
7
|
+
* scan when the file cannot be parsed.
|
|
8
|
+
*
|
|
9
|
+
* The index is intentionally per-file (no whole-program graph). Callers
|
|
10
|
+
* that need cross-file resolution stitch results together themselves.
|
|
11
|
+
*
|
|
12
|
+
* Schema: sharkcraft.symbol-index/v1
|
|
13
|
+
*/
|
|
14
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
15
|
+
import * as nodePath from 'node:path';
|
|
16
|
+
import * as ts from 'typescript';
|
|
17
|
+
export const SYMBOL_INDEX_SCHEMA = 'sharkcraft.symbol-index/v1';
|
|
18
|
+
export var SymbolDeclarationKind;
|
|
19
|
+
(function (SymbolDeclarationKind) {
|
|
20
|
+
SymbolDeclarationKind["Class"] = "class";
|
|
21
|
+
SymbolDeclarationKind["Function"] = "function";
|
|
22
|
+
SymbolDeclarationKind["Interface"] = "interface";
|
|
23
|
+
SymbolDeclarationKind["TypeAlias"] = "type-alias";
|
|
24
|
+
SymbolDeclarationKind["Enum"] = "enum";
|
|
25
|
+
SymbolDeclarationKind["Const"] = "const";
|
|
26
|
+
SymbolDeclarationKind["Let"] = "let";
|
|
27
|
+
SymbolDeclarationKind["Var"] = "var";
|
|
28
|
+
SymbolDeclarationKind["Module"] = "module";
|
|
29
|
+
SymbolDeclarationKind["Namespace"] = "namespace";
|
|
30
|
+
SymbolDeclarationKind["Unknown"] = "unknown";
|
|
31
|
+
})(SymbolDeclarationKind || (SymbolDeclarationKind = {}));
|
|
32
|
+
export var SymbolVisibility;
|
|
33
|
+
(function (SymbolVisibility) {
|
|
34
|
+
SymbolVisibility["Export"] = "export";
|
|
35
|
+
SymbolVisibility["Local"] = "local";
|
|
36
|
+
SymbolVisibility["ReExport"] = "re-export";
|
|
37
|
+
SymbolVisibility["Default"] = "default";
|
|
38
|
+
})(SymbolVisibility || (SymbolVisibility = {}));
|
|
39
|
+
export var SymbolResolution;
|
|
40
|
+
(function (SymbolResolution) {
|
|
41
|
+
SymbolResolution["ExactExport"] = "exact-export";
|
|
42
|
+
SymbolResolution["ExactLocal"] = "exact-local";
|
|
43
|
+
SymbolResolution["ExactReExport"] = "exact-reexport";
|
|
44
|
+
SymbolResolution["ProbableText"] = "probable-text";
|
|
45
|
+
SymbolResolution["Missing"] = "missing";
|
|
46
|
+
SymbolResolution["Unknown"] = "unknown";
|
|
47
|
+
})(SymbolResolution || (SymbolResolution = {}));
|
|
48
|
+
function pickKindFromNode(node) {
|
|
49
|
+
if (ts.isClassDeclaration(node))
|
|
50
|
+
return SymbolDeclarationKind.Class;
|
|
51
|
+
if (ts.isFunctionDeclaration(node))
|
|
52
|
+
return SymbolDeclarationKind.Function;
|
|
53
|
+
if (ts.isInterfaceDeclaration(node))
|
|
54
|
+
return SymbolDeclarationKind.Interface;
|
|
55
|
+
if (ts.isTypeAliasDeclaration(node))
|
|
56
|
+
return SymbolDeclarationKind.TypeAlias;
|
|
57
|
+
if (ts.isEnumDeclaration(node))
|
|
58
|
+
return SymbolDeclarationKind.Enum;
|
|
59
|
+
if (ts.isVariableStatement(node)) {
|
|
60
|
+
const flags = node.declarationList.flags;
|
|
61
|
+
if (flags & ts.NodeFlags.Const)
|
|
62
|
+
return SymbolDeclarationKind.Const;
|
|
63
|
+
if (flags & ts.NodeFlags.Let)
|
|
64
|
+
return SymbolDeclarationKind.Let;
|
|
65
|
+
return SymbolDeclarationKind.Var;
|
|
66
|
+
}
|
|
67
|
+
if (ts.isModuleDeclaration(node)) {
|
|
68
|
+
if (node.flags & ts.NodeFlags.Namespace)
|
|
69
|
+
return SymbolDeclarationKind.Namespace;
|
|
70
|
+
return SymbolDeclarationKind.Module;
|
|
71
|
+
}
|
|
72
|
+
return SymbolDeclarationKind.Unknown;
|
|
73
|
+
}
|
|
74
|
+
function isExported(node) {
|
|
75
|
+
if (!ts.canHaveModifiers(node))
|
|
76
|
+
return false;
|
|
77
|
+
const mods = ts.getModifiers(node);
|
|
78
|
+
return !!mods && mods.some((m) => m.kind === ts.SyntaxKind.ExportKeyword);
|
|
79
|
+
}
|
|
80
|
+
function isDefault(node) {
|
|
81
|
+
if (!ts.canHaveModifiers(node))
|
|
82
|
+
return false;
|
|
83
|
+
const mods = ts.getModifiers(node);
|
|
84
|
+
return !!mods && mods.some((m) => m.kind === ts.SyntaxKind.DefaultKeyword);
|
|
85
|
+
}
|
|
86
|
+
function lineOf(sf, node) {
|
|
87
|
+
return sf.getLineAndCharacterOfPosition(node.getStart(sf)).line + 1;
|
|
88
|
+
}
|
|
89
|
+
export function buildSymbolIndex(fileAbsPath, content, options = {}) {
|
|
90
|
+
const filePath = options.virtualPath ?? fileAbsPath;
|
|
91
|
+
let text;
|
|
92
|
+
if (content !== undefined) {
|
|
93
|
+
text = content;
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
if (!existsSync(fileAbsPath)) {
|
|
97
|
+
return {
|
|
98
|
+
schema: SYMBOL_INDEX_SCHEMA,
|
|
99
|
+
file: filePath,
|
|
100
|
+
parsed: false,
|
|
101
|
+
parseError: 'file not found',
|
|
102
|
+
exports: [],
|
|
103
|
+
locals: [],
|
|
104
|
+
reExports: [],
|
|
105
|
+
hasDefaultExport: false,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
try {
|
|
109
|
+
text = readFileSync(fileAbsPath, 'utf8');
|
|
110
|
+
}
|
|
111
|
+
catch (e) {
|
|
112
|
+
return {
|
|
113
|
+
schema: SYMBOL_INDEX_SCHEMA,
|
|
114
|
+
file: filePath,
|
|
115
|
+
parsed: false,
|
|
116
|
+
parseError: e.message,
|
|
117
|
+
exports: [],
|
|
118
|
+
locals: [],
|
|
119
|
+
reExports: [],
|
|
120
|
+
hasDefaultExport: false,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
const ext = nodePath.extname(filePath).toLowerCase();
|
|
125
|
+
const scriptKind = pickScriptKind(ext);
|
|
126
|
+
let sf;
|
|
127
|
+
try {
|
|
128
|
+
sf = ts.createSourceFile(filePath, text, ts.ScriptTarget.Latest, true, scriptKind);
|
|
129
|
+
}
|
|
130
|
+
catch (e) {
|
|
131
|
+
return {
|
|
132
|
+
schema: SYMBOL_INDEX_SCHEMA,
|
|
133
|
+
file: filePath,
|
|
134
|
+
parsed: false,
|
|
135
|
+
parseError: e.message,
|
|
136
|
+
exports: [],
|
|
137
|
+
locals: [],
|
|
138
|
+
reExports: [],
|
|
139
|
+
hasDefaultExport: false,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
const exportsList = [];
|
|
143
|
+
const localsList = [];
|
|
144
|
+
const reExportsList = [];
|
|
145
|
+
let hasDefaultExport = false;
|
|
146
|
+
let defaultExportName;
|
|
147
|
+
for (const stmt of sf.statements) {
|
|
148
|
+
// export { foo, bar } from "./mod" / export * from "./mod"
|
|
149
|
+
if (ts.isExportDeclaration(stmt)) {
|
|
150
|
+
const fromSpec = stmt.moduleSpecifier && ts.isStringLiteral(stmt.moduleSpecifier)
|
|
151
|
+
? stmt.moduleSpecifier.text
|
|
152
|
+
: '';
|
|
153
|
+
const star = !stmt.exportClause;
|
|
154
|
+
if (star && fromSpec) {
|
|
155
|
+
reExportsList.push({
|
|
156
|
+
name: '*',
|
|
157
|
+
from: fromSpec,
|
|
158
|
+
star: true,
|
|
159
|
+
line: lineOf(sf, stmt),
|
|
160
|
+
});
|
|
161
|
+
continue;
|
|
162
|
+
}
|
|
163
|
+
if (stmt.exportClause && ts.isNamedExports(stmt.exportClause)) {
|
|
164
|
+
for (const spec of stmt.exportClause.elements) {
|
|
165
|
+
const name = spec.name.text;
|
|
166
|
+
if (fromSpec) {
|
|
167
|
+
reExportsList.push({
|
|
168
|
+
name,
|
|
169
|
+
from: fromSpec,
|
|
170
|
+
star: false,
|
|
171
|
+
line: lineOf(sf, spec),
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
// `export { foo }` — local re-export of a name imported above.
|
|
176
|
+
exportsList.push({
|
|
177
|
+
name,
|
|
178
|
+
kind: SymbolDeclarationKind.Unknown,
|
|
179
|
+
visibility: SymbolVisibility.Export,
|
|
180
|
+
line: lineOf(sf, spec),
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
continue;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
// export default …
|
|
188
|
+
if (ts.isExportAssignment(stmt)) {
|
|
189
|
+
hasDefaultExport = true;
|
|
190
|
+
if (ts.isIdentifier(stmt.expression)) {
|
|
191
|
+
defaultExportName = stmt.expression.text;
|
|
192
|
+
}
|
|
193
|
+
continue;
|
|
194
|
+
}
|
|
195
|
+
// export default function/class …
|
|
196
|
+
if ((ts.isFunctionDeclaration(stmt) || ts.isClassDeclaration(stmt)) &&
|
|
197
|
+
isDefault(stmt)) {
|
|
198
|
+
hasDefaultExport = true;
|
|
199
|
+
const name = stmt.name?.text;
|
|
200
|
+
if (name)
|
|
201
|
+
defaultExportName = name;
|
|
202
|
+
// Also surface the name (if any) in exportsList for findability.
|
|
203
|
+
if (name) {
|
|
204
|
+
exportsList.push({
|
|
205
|
+
name,
|
|
206
|
+
kind: pickKindFromNode(stmt),
|
|
207
|
+
visibility: SymbolVisibility.Default,
|
|
208
|
+
line: lineOf(sf, stmt),
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
continue;
|
|
212
|
+
}
|
|
213
|
+
const exported = isExported(stmt);
|
|
214
|
+
// export const / let / var …
|
|
215
|
+
if (ts.isVariableStatement(stmt)) {
|
|
216
|
+
const kind = pickKindFromNode(stmt);
|
|
217
|
+
for (const d of stmt.declarationList.declarations) {
|
|
218
|
+
if (!ts.isIdentifier(d.name))
|
|
219
|
+
continue;
|
|
220
|
+
const entry = {
|
|
221
|
+
name: d.name.text,
|
|
222
|
+
kind,
|
|
223
|
+
visibility: exported ? SymbolVisibility.Export : SymbolVisibility.Local,
|
|
224
|
+
line: lineOf(sf, d),
|
|
225
|
+
};
|
|
226
|
+
(exported ? exportsList : localsList).push(entry);
|
|
227
|
+
}
|
|
228
|
+
continue;
|
|
229
|
+
}
|
|
230
|
+
if (ts.isClassDeclaration(stmt) ||
|
|
231
|
+
ts.isFunctionDeclaration(stmt) ||
|
|
232
|
+
ts.isInterfaceDeclaration(stmt) ||
|
|
233
|
+
ts.isTypeAliasDeclaration(stmt) ||
|
|
234
|
+
ts.isEnumDeclaration(stmt)) {
|
|
235
|
+
const name = stmt.name?.text;
|
|
236
|
+
if (!name)
|
|
237
|
+
continue;
|
|
238
|
+
const entry = {
|
|
239
|
+
name,
|
|
240
|
+
kind: pickKindFromNode(stmt),
|
|
241
|
+
visibility: exported ? SymbolVisibility.Export : SymbolVisibility.Local,
|
|
242
|
+
line: lineOf(sf, stmt),
|
|
243
|
+
};
|
|
244
|
+
(exported ? exportsList : localsList).push(entry);
|
|
245
|
+
continue;
|
|
246
|
+
}
|
|
247
|
+
if (ts.isModuleDeclaration(stmt) && stmt.name && ts.isIdentifier(stmt.name)) {
|
|
248
|
+
const entry = {
|
|
249
|
+
name: stmt.name.text,
|
|
250
|
+
kind: pickKindFromNode(stmt),
|
|
251
|
+
visibility: exported ? SymbolVisibility.Export : SymbolVisibility.Local,
|
|
252
|
+
line: lineOf(sf, stmt),
|
|
253
|
+
};
|
|
254
|
+
(exported ? exportsList : localsList).push(entry);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
return {
|
|
258
|
+
schema: SYMBOL_INDEX_SCHEMA,
|
|
259
|
+
file: filePath,
|
|
260
|
+
parsed: true,
|
|
261
|
+
exports: exportsList,
|
|
262
|
+
locals: localsList,
|
|
263
|
+
reExports: reExportsList,
|
|
264
|
+
hasDefaultExport,
|
|
265
|
+
...(defaultExportName ? { defaultExportName } : {}),
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
function pickScriptKind(ext) {
|
|
269
|
+
switch (ext) {
|
|
270
|
+
case '.tsx':
|
|
271
|
+
return ts.ScriptKind.TSX;
|
|
272
|
+
case '.jsx':
|
|
273
|
+
return ts.ScriptKind.JSX;
|
|
274
|
+
case '.js':
|
|
275
|
+
case '.mjs':
|
|
276
|
+
case '.cjs':
|
|
277
|
+
return ts.ScriptKind.JS;
|
|
278
|
+
default:
|
|
279
|
+
return ts.ScriptKind.TS;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Resolve a symbol within a single file using the AST index. Returns the
|
|
284
|
+
* resolution kind + a small explanation. No cross-file traversal.
|
|
285
|
+
*/
|
|
286
|
+
export function resolveSymbolInFile(fileAbsPath, symbol) {
|
|
287
|
+
if (!symbol) {
|
|
288
|
+
return { resolution: SymbolResolution.Unknown, message: 'No symbol provided.' };
|
|
289
|
+
}
|
|
290
|
+
const idx = buildSymbolIndex(fileAbsPath);
|
|
291
|
+
if (!idx.parsed) {
|
|
292
|
+
// Text-scan fallback.
|
|
293
|
+
try {
|
|
294
|
+
const text = readFileSync(fileAbsPath, 'utf8');
|
|
295
|
+
if (text.includes(symbol)) {
|
|
296
|
+
return {
|
|
297
|
+
resolution: SymbolResolution.ProbableText,
|
|
298
|
+
message: `\`${symbol}\` appears in the file text but the AST could not be parsed.`,
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
return { resolution: SymbolResolution.Missing, message: `\`${symbol}\` not found.` };
|
|
302
|
+
}
|
|
303
|
+
catch {
|
|
304
|
+
return { resolution: SymbolResolution.Unknown, message: 'Could not read file.' };
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
const exp = idx.exports.find((e) => e.name === symbol);
|
|
308
|
+
if (exp) {
|
|
309
|
+
return {
|
|
310
|
+
resolution: SymbolResolution.ExactExport,
|
|
311
|
+
message: `Exact exported declaration of \`${symbol}\` (${exp.kind}) at line ${exp.line}.`,
|
|
312
|
+
entry: exp,
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
const local = idx.locals.find((e) => e.name === symbol);
|
|
316
|
+
if (local) {
|
|
317
|
+
return {
|
|
318
|
+
resolution: SymbolResolution.ExactLocal,
|
|
319
|
+
message: `Local (non-exported) declaration of \`${symbol}\` (${local.kind}) at line ${local.line}.`,
|
|
320
|
+
entry: local,
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
const re = idx.reExports.find((r) => r.name === symbol || (r.star && r.from.length > 0));
|
|
324
|
+
if (re) {
|
|
325
|
+
return {
|
|
326
|
+
resolution: SymbolResolution.ExactReExport,
|
|
327
|
+
message: `Re-exported via \`export${re.star ? ' *' : ` { ${symbol} }`} from "${re.from}"\` at line ${re.line}.`,
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
return {
|
|
331
|
+
resolution: SymbolResolution.Missing,
|
|
332
|
+
message: `Symbol \`${symbol}\` not declared or re-exported in this file.`,
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
// ── Project-wide symbol resolution ──────────────────────────────────────
|
|
336
|
+
import { readdirSync, statSync } from 'node:fs';
|
|
337
|
+
const DEFAULT_SKIP_DIRS = new Set([
|
|
338
|
+
'node_modules',
|
|
339
|
+
'dist',
|
|
340
|
+
'build',
|
|
341
|
+
'.git',
|
|
342
|
+
'.sharkcraft',
|
|
343
|
+
'coverage',
|
|
344
|
+
'target',
|
|
345
|
+
'out',
|
|
346
|
+
]);
|
|
347
|
+
const TS_EXTS = new Set(['.ts', '.tsx', '.js', '.jsx', '.mjs', '.cjs']);
|
|
348
|
+
function walk(dir, accept, out) {
|
|
349
|
+
let names;
|
|
350
|
+
try {
|
|
351
|
+
names = readdirSync(dir);
|
|
352
|
+
}
|
|
353
|
+
catch {
|
|
354
|
+
return;
|
|
355
|
+
}
|
|
356
|
+
for (const name of names) {
|
|
357
|
+
if (DEFAULT_SKIP_DIRS.has(name))
|
|
358
|
+
continue;
|
|
359
|
+
const full = nodePath.join(dir, name);
|
|
360
|
+
let stat;
|
|
361
|
+
try {
|
|
362
|
+
stat = statSync(full);
|
|
363
|
+
}
|
|
364
|
+
catch {
|
|
365
|
+
continue;
|
|
366
|
+
}
|
|
367
|
+
if (stat.isDirectory())
|
|
368
|
+
walk(full, accept, out);
|
|
369
|
+
else if (stat.isFile() && accept(full))
|
|
370
|
+
out.push(full);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
export function findSymbolInProject(projectRoot, symbol, options = {}) {
|
|
374
|
+
const language = options.language ?? 'auto';
|
|
375
|
+
const accept = (file) => {
|
|
376
|
+
const ext = nodePath.extname(file).toLowerCase();
|
|
377
|
+
if (language === 'auto' || language === 'typescript')
|
|
378
|
+
return TS_EXTS.has(ext);
|
|
379
|
+
if (language === 'java')
|
|
380
|
+
return ext === '.java';
|
|
381
|
+
if (language === 'csharp')
|
|
382
|
+
return ext === '.cs';
|
|
383
|
+
if (language === 'python')
|
|
384
|
+
return ext === '.py';
|
|
385
|
+
if (language === 'go')
|
|
386
|
+
return ext === '.go';
|
|
387
|
+
if (language === 'rust')
|
|
388
|
+
return ext === '.rs';
|
|
389
|
+
return false;
|
|
390
|
+
};
|
|
391
|
+
const files = [];
|
|
392
|
+
walk(projectRoot, accept, files);
|
|
393
|
+
const limited = files.slice(0, options.maxFiles ?? 4000);
|
|
394
|
+
const exactMatches = [];
|
|
395
|
+
const textMatches = [];
|
|
396
|
+
const diagnostics = [];
|
|
397
|
+
for (const f of limited) {
|
|
398
|
+
let text;
|
|
399
|
+
try {
|
|
400
|
+
text = readFileSync(f, 'utf8');
|
|
401
|
+
}
|
|
402
|
+
catch {
|
|
403
|
+
continue;
|
|
404
|
+
}
|
|
405
|
+
if (!text.includes(symbol))
|
|
406
|
+
continue;
|
|
407
|
+
const rel = nodePath.relative(projectRoot, f);
|
|
408
|
+
if (TS_EXTS.has(nodePath.extname(f).toLowerCase())) {
|
|
409
|
+
const idx = buildSymbolIndex(f);
|
|
410
|
+
if (!idx.parsed) {
|
|
411
|
+
textMatches.push({
|
|
412
|
+
file: f,
|
|
413
|
+
relativePath: rel,
|
|
414
|
+
resolution: SymbolResolution.ProbableText,
|
|
415
|
+
message: idx.parseError ?? 'parse error',
|
|
416
|
+
});
|
|
417
|
+
continue;
|
|
418
|
+
}
|
|
419
|
+
const exp = idx.exports.find((e) => e.name === symbol);
|
|
420
|
+
if (exp) {
|
|
421
|
+
exactMatches.push({
|
|
422
|
+
file: f,
|
|
423
|
+
relativePath: rel,
|
|
424
|
+
resolution: SymbolResolution.ExactExport,
|
|
425
|
+
message: `exported ${exp.kind} at line ${exp.line}`,
|
|
426
|
+
kind: exp.kind,
|
|
427
|
+
visibility: exp.visibility,
|
|
428
|
+
line: exp.line,
|
|
429
|
+
});
|
|
430
|
+
continue;
|
|
431
|
+
}
|
|
432
|
+
const local = idx.locals.find((e) => e.name === symbol);
|
|
433
|
+
if (local) {
|
|
434
|
+
exactMatches.push({
|
|
435
|
+
file: f,
|
|
436
|
+
relativePath: rel,
|
|
437
|
+
resolution: SymbolResolution.ExactLocal,
|
|
438
|
+
message: `local ${local.kind} at line ${local.line} — not exported`,
|
|
439
|
+
kind: local.kind,
|
|
440
|
+
visibility: local.visibility,
|
|
441
|
+
line: local.line,
|
|
442
|
+
});
|
|
443
|
+
continue;
|
|
444
|
+
}
|
|
445
|
+
textMatches.push({
|
|
446
|
+
file: f,
|
|
447
|
+
relativePath: rel,
|
|
448
|
+
resolution: SymbolResolution.ProbableText,
|
|
449
|
+
message: 'token appears in file text',
|
|
450
|
+
});
|
|
451
|
+
}
|
|
452
|
+
else {
|
|
453
|
+
// Non-TS: text-only.
|
|
454
|
+
textMatches.push({
|
|
455
|
+
file: f,
|
|
456
|
+
relativePath: rel,
|
|
457
|
+
resolution: SymbolResolution.ProbableText,
|
|
458
|
+
message: 'token appears in file text (no AST scanner for this language)',
|
|
459
|
+
});
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
if (files.length > limited.length) {
|
|
463
|
+
diagnostics.push(`scanned the first ${limited.length} files (${files.length - limited.length} skipped — bump --max-files to increase)`);
|
|
464
|
+
}
|
|
465
|
+
// Primary file: only if exactly one exported declaration.
|
|
466
|
+
const exportedMatches = exactMatches.filter((m) => m.resolution === SymbolResolution.ExactExport);
|
|
467
|
+
let primaryFile;
|
|
468
|
+
if (exportedMatches.length === 1) {
|
|
469
|
+
primaryFile = exportedMatches[0].relativePath;
|
|
470
|
+
}
|
|
471
|
+
else if (exportedMatches.length === 0 && exactMatches.length === 1) {
|
|
472
|
+
primaryFile = exactMatches[0].relativePath;
|
|
473
|
+
}
|
|
474
|
+
return {
|
|
475
|
+
schema: 'sharkcraft.symbol-impact/v1',
|
|
476
|
+
symbol,
|
|
477
|
+
language,
|
|
478
|
+
exactMatches,
|
|
479
|
+
textMatches,
|
|
480
|
+
...(primaryFile ? { primaryFile } : {}),
|
|
481
|
+
diagnostics,
|
|
482
|
+
};
|
|
483
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ISharkcraftInspection } from './sharkcraft-inspector.js';
|
|
2
|
+
export declare const TASK_DECOMPOSE_SCHEMA = "sharkcraft.task-decomposition/v1";
|
|
3
|
+
export declare enum TaskVerb {
|
|
4
|
+
Create = "create",
|
|
5
|
+
Add = "add",
|
|
6
|
+
Refactor = "refactor",
|
|
7
|
+
Fix = "fix",
|
|
8
|
+
Test = "test",
|
|
9
|
+
Document = "document",
|
|
10
|
+
Review = "review",
|
|
11
|
+
Migrate = "migrate",
|
|
12
|
+
Remove = "remove",
|
|
13
|
+
Unknown = "unknown"
|
|
14
|
+
}
|
|
15
|
+
export interface ITaskSubtask {
|
|
16
|
+
id: string;
|
|
17
|
+
title: string;
|
|
18
|
+
reason: string;
|
|
19
|
+
relatedTemplateIds: readonly string[];
|
|
20
|
+
relatedPipelineIds: readonly string[];
|
|
21
|
+
riskLevel: 'low' | 'medium' | 'high';
|
|
22
|
+
}
|
|
23
|
+
export interface ITaskDecomposition {
|
|
24
|
+
schema: typeof TASK_DECOMPOSE_SCHEMA;
|
|
25
|
+
task: string;
|
|
26
|
+
verb: TaskVerb;
|
|
27
|
+
domainHints: readonly string[];
|
|
28
|
+
subtasks: readonly ITaskSubtask[];
|
|
29
|
+
suggestedTemplateIds: readonly string[];
|
|
30
|
+
suggestedPipelineIds: readonly string[];
|
|
31
|
+
requiredVariables: readonly string[];
|
|
32
|
+
riskAreas: readonly string[];
|
|
33
|
+
validationSuggestions: readonly string[];
|
|
34
|
+
recommendedOrder: readonly string[];
|
|
35
|
+
}
|
|
36
|
+
export declare function detectVerb(task: string): TaskVerb;
|
|
37
|
+
export declare function decomposeTask(inspection: ISharkcraftInspection, task: string): ITaskDecomposition;
|
|
38
|
+
//# sourceMappingURL=task-decompose.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-decompose.d.ts","sourceRoot":"","sources":["../src/task-decompose.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAGvE,eAAO,MAAM,qBAAqB,qCAAqC,CAAC;AAExE,oBAAY,QAAQ;IAClB,MAAM,WAAW;IACjB,GAAG,QAAQ;IACX,QAAQ,aAAa;IACrB,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,OAAO,YAAY;CACpB;AAkCD,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,kBAAkB,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,SAAS,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;CACtC;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,OAAO,qBAAqB,CAAC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC;IACf,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,QAAQ,EAAE,SAAS,YAAY,EAAE,CAAC;IAClC,oBAAoB,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,oBAAoB,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,iBAAiB,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,qBAAqB,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,CAMjD;AAOD,wBAAgB,aAAa,CAC3B,UAAU,EAAE,qBAAqB,EACjC,IAAI,EAAE,MAAM,GACX,kBAAkB,CAqFpB"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { rankAll } from "./task-ranker.js";
|
|
2
|
+
export const TASK_DECOMPOSE_SCHEMA = 'sharkcraft.task-decomposition/v1';
|
|
3
|
+
export var TaskVerb;
|
|
4
|
+
(function (TaskVerb) {
|
|
5
|
+
TaskVerb["Create"] = "create";
|
|
6
|
+
TaskVerb["Add"] = "add";
|
|
7
|
+
TaskVerb["Refactor"] = "refactor";
|
|
8
|
+
TaskVerb["Fix"] = "fix";
|
|
9
|
+
TaskVerb["Test"] = "test";
|
|
10
|
+
TaskVerb["Document"] = "document";
|
|
11
|
+
TaskVerb["Review"] = "review";
|
|
12
|
+
TaskVerb["Migrate"] = "migrate";
|
|
13
|
+
TaskVerb["Remove"] = "remove";
|
|
14
|
+
TaskVerb["Unknown"] = "unknown";
|
|
15
|
+
})(TaskVerb || (TaskVerb = {}));
|
|
16
|
+
const VERB_PATTERNS = [
|
|
17
|
+
{ verb: TaskVerb.Create, words: ['create', 'generate', 'scaffold', 'build', 'implement', 'new'] },
|
|
18
|
+
{ verb: TaskVerb.Add, words: ['add', 'introduce', 'extend', 'expose'] },
|
|
19
|
+
{ verb: TaskVerb.Refactor, words: ['refactor', 'rewrite', 'rename', 'extract'] },
|
|
20
|
+
{ verb: TaskVerb.Fix, words: ['fix', 'patch', 'repair', 'bug'] },
|
|
21
|
+
{ verb: TaskVerb.Test, words: ['test', 'spec', 'coverage'] },
|
|
22
|
+
{ verb: TaskVerb.Document, words: ['document', 'doc', 'readme'] },
|
|
23
|
+
{ verb: TaskVerb.Review, words: ['review', 'audit'] },
|
|
24
|
+
{ verb: TaskVerb.Migrate, words: ['migrate', 'upgrade', 'port'] },
|
|
25
|
+
{ verb: TaskVerb.Remove, words: ['remove', 'delete', 'drop'] },
|
|
26
|
+
];
|
|
27
|
+
const DOMAIN_HINTS = [
|
|
28
|
+
'plugin',
|
|
29
|
+
'policy',
|
|
30
|
+
'capability',
|
|
31
|
+
'adapter',
|
|
32
|
+
'service',
|
|
33
|
+
'component',
|
|
34
|
+
'api',
|
|
35
|
+
'table',
|
|
36
|
+
'auth',
|
|
37
|
+
'route',
|
|
38
|
+
'controller',
|
|
39
|
+
'middleware',
|
|
40
|
+
'queue',
|
|
41
|
+
'job',
|
|
42
|
+
'worker',
|
|
43
|
+
'cli',
|
|
44
|
+
'mcp',
|
|
45
|
+
];
|
|
46
|
+
export function detectVerb(task) {
|
|
47
|
+
const lower = task.toLowerCase();
|
|
48
|
+
for (const { verb, words } of VERB_PATTERNS) {
|
|
49
|
+
if (words.some((w) => new RegExp(`\\b${w}`).test(lower)))
|
|
50
|
+
return verb;
|
|
51
|
+
}
|
|
52
|
+
return TaskVerb.Unknown;
|
|
53
|
+
}
|
|
54
|
+
function detectDomainHints(task) {
|
|
55
|
+
const lower = task.toLowerCase();
|
|
56
|
+
return DOMAIN_HINTS.filter((d) => lower.includes(d));
|
|
57
|
+
}
|
|
58
|
+
export function decomposeTask(inspection, task) {
|
|
59
|
+
const verb = detectVerb(task);
|
|
60
|
+
const domainHints = detectDomainHints(task);
|
|
61
|
+
const ranking = rankAll(inspection, task, 6);
|
|
62
|
+
const subtasks = [];
|
|
63
|
+
if (verb === TaskVerb.Create || verb === TaskVerb.Add) {
|
|
64
|
+
if (domainHints.includes('plugin') || domainHints.includes('capability')) {
|
|
65
|
+
subtasks.push(stepFor('contract', 'Create plugin contract / interface', ranking, 'low'));
|
|
66
|
+
subtasks.push(stepFor('cross-impl', 'Create cross / shared implementation', ranking, 'medium'));
|
|
67
|
+
subtasks.push(stepFor('defaults', 'Wire defaults / registration', ranking, 'medium'));
|
|
68
|
+
}
|
|
69
|
+
else if (domainHints.includes('adapter')) {
|
|
70
|
+
subtasks.push(stepFor('adapter-iface', 'Define adapter interface', ranking, 'low'));
|
|
71
|
+
subtasks.push(stepFor('adapter-impl', 'Implement adapter', ranking, 'medium'));
|
|
72
|
+
}
|
|
73
|
+
else if (domainHints.includes('service') || domainHints.includes('controller')) {
|
|
74
|
+
subtasks.push(stepFor('service', 'Implement service', ranking, 'medium'));
|
|
75
|
+
subtasks.push(stepFor('service-tests', 'Add unit tests', ranking, 'low'));
|
|
76
|
+
}
|
|
77
|
+
else if (domainHints.includes('component') || domainHints.includes('cli')) {
|
|
78
|
+
subtasks.push(stepFor('feature', 'Implement primary unit', ranking, 'medium'));
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
subtasks.push(stepFor('feature', 'Implement primary unit', ranking, 'medium'));
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
else if (verb === TaskVerb.Refactor || verb === TaskVerb.Migrate) {
|
|
85
|
+
subtasks.push(stepFor('analyze', 'Map current behavior', ranking, 'low'));
|
|
86
|
+
subtasks.push(stepFor('plan', 'Plan the refactor / migration steps', ranking, 'medium'));
|
|
87
|
+
subtasks.push(stepFor('apply', 'Apply changes', ranking, 'high'));
|
|
88
|
+
}
|
|
89
|
+
else if (verb === TaskVerb.Fix) {
|
|
90
|
+
subtasks.push(stepFor('reproduce', 'Reproduce the bug locally', ranking, 'low'));
|
|
91
|
+
subtasks.push(stepFor('fix', 'Apply the fix', ranking, 'medium'));
|
|
92
|
+
subtasks.push(stepFor('regression', 'Add regression test', ranking, 'low'));
|
|
93
|
+
}
|
|
94
|
+
else if (verb === TaskVerb.Test) {
|
|
95
|
+
subtasks.push(stepFor('cases', 'Enumerate cases', ranking, 'low'));
|
|
96
|
+
subtasks.push(stepFor('spec', 'Write tests', ranking, 'low'));
|
|
97
|
+
}
|
|
98
|
+
else if (verb === TaskVerb.Remove) {
|
|
99
|
+
subtasks.push(stepFor('locate', 'Locate all references', ranking, 'low'));
|
|
100
|
+
subtasks.push(stepFor('delete', 'Delete', ranking, 'high'));
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
subtasks.push(stepFor('explore', 'Explore + plan', ranking, 'low'));
|
|
104
|
+
}
|
|
105
|
+
subtasks.push({
|
|
106
|
+
id: `${subtasks.length + 1}-validate`,
|
|
107
|
+
title: 'Validate (boundaries, types, tests)',
|
|
108
|
+
reason: 'Required by policy: changes must pass boundary check and tests.',
|
|
109
|
+
relatedTemplateIds: [],
|
|
110
|
+
relatedPipelineIds: [],
|
|
111
|
+
riskLevel: 'low',
|
|
112
|
+
});
|
|
113
|
+
const suggestedTemplateIds = ranking.templates.slice(0, 5).map((t) => t.item.id);
|
|
114
|
+
const suggestedPipelineIds = ranking.pipelines.slice(0, 3).map((p) => p.item.id);
|
|
115
|
+
const requiredVariables = uniqueStrings(ranking.templates
|
|
116
|
+
.slice(0, 5)
|
|
117
|
+
.flatMap((t) => (t.item.variables ?? []).filter((v) => v.required).map((v) => v.name)));
|
|
118
|
+
const riskAreas = uniqueStrings(ranking.paths.slice(0, 5).map((p) => p.item.id));
|
|
119
|
+
const validationSuggestions = uniqueStrings([
|
|
120
|
+
'shrk doctor',
|
|
121
|
+
'shrk check boundaries',
|
|
122
|
+
'bun x tsc -p tsconfig.base.json --noEmit',
|
|
123
|
+
'bun test',
|
|
124
|
+
]);
|
|
125
|
+
const recommendedOrder = subtasks.map((s) => s.id);
|
|
126
|
+
return {
|
|
127
|
+
schema: TASK_DECOMPOSE_SCHEMA,
|
|
128
|
+
task,
|
|
129
|
+
verb,
|
|
130
|
+
domainHints,
|
|
131
|
+
subtasks,
|
|
132
|
+
suggestedTemplateIds,
|
|
133
|
+
suggestedPipelineIds,
|
|
134
|
+
requiredVariables,
|
|
135
|
+
riskAreas,
|
|
136
|
+
validationSuggestions,
|
|
137
|
+
recommendedOrder,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
function stepFor(slug, title, ranking, risk) {
|
|
141
|
+
const tpl = ranking.templates[0]?.item.id;
|
|
142
|
+
const pipe = ranking.pipelines[0]?.item.id;
|
|
143
|
+
return {
|
|
144
|
+
id: `${slug}`,
|
|
145
|
+
title,
|
|
146
|
+
reason: 'derived from verb + domain hints',
|
|
147
|
+
relatedTemplateIds: tpl ? [tpl] : [],
|
|
148
|
+
relatedPipelineIds: pipe ? [pipe] : [],
|
|
149
|
+
riskLevel: risk,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
function uniqueStrings(xs) {
|
|
153
|
+
return [...new Set(xs)];
|
|
154
|
+
}
|