@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,27 @@
|
|
|
1
|
+
import { type ILanguageProfileReport } from './language-detection.js';
|
|
2
|
+
import { LanguageId } from './language-id.js';
|
|
3
|
+
export declare const LANGUAGE_COMMAND_SET_SCHEMA = "sharkcraft.language-command-set/v1";
|
|
4
|
+
export interface ILanguageCommandSet {
|
|
5
|
+
schema: typeof LANGUAGE_COMMAND_SET_SCHEMA;
|
|
6
|
+
language: LanguageId;
|
|
7
|
+
install?: string;
|
|
8
|
+
restore?: string;
|
|
9
|
+
typecheck?: string;
|
|
10
|
+
test?: string;
|
|
11
|
+
lint?: string;
|
|
12
|
+
format?: string;
|
|
13
|
+
build?: string;
|
|
14
|
+
package?: string;
|
|
15
|
+
run?: string;
|
|
16
|
+
notes: readonly string[];
|
|
17
|
+
}
|
|
18
|
+
export interface ILanguageCommandReport {
|
|
19
|
+
schema: typeof LANGUAGE_COMMAND_SET_SCHEMA;
|
|
20
|
+
generatedAt: string;
|
|
21
|
+
projectRoot: string;
|
|
22
|
+
profiles: readonly ILanguageCommandSet[];
|
|
23
|
+
}
|
|
24
|
+
export declare function buildLanguageCommandReport(projectRoot: string, cached?: ILanguageProfileReport): ILanguageCommandReport;
|
|
25
|
+
export declare function renderLanguageCommandsText(r: ILanguageCommandReport): string;
|
|
26
|
+
export declare function renderLanguageCommandsMarkdown(r: ILanguageCommandReport): string;
|
|
27
|
+
//# sourceMappingURL=command-inference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-inference.d.ts","sourceRoot":"","sources":["../../src/languages/command-inference.ts"],"names":[],"mappings":"AAUA,OAAO,EAGL,KAAK,sBAAsB,EAC5B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,eAAO,MAAM,2BAA2B,uCAAuC,CAAC;AAEhF,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,OAAO,2BAA2B,CAAC;IAC3C,QAAQ,EAAE,UAAU,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,OAAO,2BAA2B,CAAC;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,SAAS,mBAAmB,EAAE,CAAC;CAC1C;AAoID,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,MAAM,EACnB,MAAM,CAAC,EAAE,sBAAsB,GAC9B,sBAAsB,CAQxB;AAED,wBAAgB,0BAA0B,CAAC,CAAC,EAAE,sBAAsB,GAAG,MAAM,CAoB5E;AAED,wBAAgB,8BAA8B,CAAC,CAAC,EAAE,sBAAsB,GAAG,MAAM,CAoBhF"}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Polyglot command inference.
|
|
3
|
+
*
|
|
4
|
+
* Given a `ILanguageProfileReport`, produce a deterministic per-language
|
|
5
|
+
* `ILanguageCommandSet` for install / typecheck / test / lint / format /
|
|
6
|
+
* build / package / run. The set is *advisory* — `shrk apply` still only runs
|
|
7
|
+
* commands in `sharkcraft.config.ts verificationCommands[]`.
|
|
8
|
+
*/
|
|
9
|
+
import { existsSync } from 'node:fs';
|
|
10
|
+
import * as nodePath from 'node:path';
|
|
11
|
+
import { detectLanguageProfiles, } from "./language-detection.js";
|
|
12
|
+
import { LanguageId } from "./language-id.js";
|
|
13
|
+
export const LANGUAGE_COMMAND_SET_SCHEMA = 'sharkcraft.language-command-set/v1';
|
|
14
|
+
function commandSetFor(root, p) {
|
|
15
|
+
const notes = [];
|
|
16
|
+
switch (p.language) {
|
|
17
|
+
case LanguageId.TypeScript:
|
|
18
|
+
case LanguageId.JavaScript: {
|
|
19
|
+
const pm = p.packageManager ?? 'npm';
|
|
20
|
+
const out = {
|
|
21
|
+
schema: LANGUAGE_COMMAND_SET_SCHEMA,
|
|
22
|
+
language: p.language,
|
|
23
|
+
install: `${pm} install`,
|
|
24
|
+
test: pm === 'bun' ? 'bun test' : `${pm} test`,
|
|
25
|
+
typecheck: 'bun x tsc --noEmit',
|
|
26
|
+
notes,
|
|
27
|
+
};
|
|
28
|
+
if (existsSync(nodePath.join(root, '.eslintrc')) || existsSync(nodePath.join(root, '.eslintrc.json')) || existsSync(nodePath.join(root, '.eslintrc.cjs'))) {
|
|
29
|
+
out.lint = `${pm === 'bun' ? 'bun x' : 'npx'} eslint .`;
|
|
30
|
+
}
|
|
31
|
+
if (existsSync(nodePath.join(root, '.prettierrc')) || existsSync(nodePath.join(root, '.prettierrc.json'))) {
|
|
32
|
+
out.format = `${pm === 'bun' ? 'bun x' : 'npx'} prettier --check .`;
|
|
33
|
+
}
|
|
34
|
+
return out;
|
|
35
|
+
}
|
|
36
|
+
case LanguageId.Java: {
|
|
37
|
+
if (p.buildTool === 'maven') {
|
|
38
|
+
return {
|
|
39
|
+
schema: LANGUAGE_COMMAND_SET_SCHEMA,
|
|
40
|
+
language: p.language,
|
|
41
|
+
install: 'mvn install -DskipTests',
|
|
42
|
+
test: 'mvn test',
|
|
43
|
+
typecheck: 'mvn compile',
|
|
44
|
+
build: 'mvn package',
|
|
45
|
+
package: 'mvn package',
|
|
46
|
+
run: p.frameworkSignals.includes('spring-boot') ? 'mvn spring-boot:run' : 'mvn exec:java',
|
|
47
|
+
notes,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
// Gradle path
|
|
51
|
+
const wrapperPresent = existsSync(nodePath.join(root, 'gradlew'));
|
|
52
|
+
const gradleCmd = wrapperPresent ? './gradlew' : 'gradle';
|
|
53
|
+
if (!wrapperPresent)
|
|
54
|
+
notes.push('No gradle wrapper detected — falling back to system `gradle`.');
|
|
55
|
+
return {
|
|
56
|
+
schema: LANGUAGE_COMMAND_SET_SCHEMA,
|
|
57
|
+
language: p.language,
|
|
58
|
+
install: `${gradleCmd} dependencies --refresh-dependencies`,
|
|
59
|
+
test: `${gradleCmd} test`,
|
|
60
|
+
typecheck: `${gradleCmd} check`,
|
|
61
|
+
build: `${gradleCmd} build`,
|
|
62
|
+
package: `${gradleCmd} build`,
|
|
63
|
+
run: p.frameworkSignals.includes('spring-boot') ? `${gradleCmd} bootRun` : `${gradleCmd} run`,
|
|
64
|
+
notes,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
case LanguageId.CSharp:
|
|
68
|
+
return {
|
|
69
|
+
schema: LANGUAGE_COMMAND_SET_SCHEMA,
|
|
70
|
+
language: p.language,
|
|
71
|
+
restore: 'dotnet restore',
|
|
72
|
+
test: 'dotnet test',
|
|
73
|
+
typecheck: 'dotnet build --no-restore',
|
|
74
|
+
build: 'dotnet build',
|
|
75
|
+
format: 'dotnet format --verify-no-changes',
|
|
76
|
+
run: 'dotnet run',
|
|
77
|
+
notes,
|
|
78
|
+
};
|
|
79
|
+
case LanguageId.Python: {
|
|
80
|
+
const pm = p.packageManager;
|
|
81
|
+
if (pm === 'uv') {
|
|
82
|
+
return {
|
|
83
|
+
schema: LANGUAGE_COMMAND_SET_SCHEMA,
|
|
84
|
+
language: p.language,
|
|
85
|
+
install: 'uv sync',
|
|
86
|
+
test: 'uv run pytest',
|
|
87
|
+
typecheck: p.frameworkSignals.includes('mypy') ? 'uv run mypy .' : undefined,
|
|
88
|
+
lint: p.frameworkSignals.includes('ruff') ? 'uv run ruff check .' : undefined,
|
|
89
|
+
format: p.frameworkSignals.includes('ruff') ? 'uv run ruff format --check .' : undefined,
|
|
90
|
+
notes,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
if (pm === 'poetry') {
|
|
94
|
+
return {
|
|
95
|
+
schema: LANGUAGE_COMMAND_SET_SCHEMA,
|
|
96
|
+
language: p.language,
|
|
97
|
+
install: 'poetry install',
|
|
98
|
+
test: 'poetry run pytest',
|
|
99
|
+
typecheck: p.frameworkSignals.includes('mypy') ? 'poetry run mypy .' : undefined,
|
|
100
|
+
lint: p.frameworkSignals.includes('ruff') ? 'poetry run ruff check .' : undefined,
|
|
101
|
+
notes,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
schema: LANGUAGE_COMMAND_SET_SCHEMA,
|
|
106
|
+
language: p.language,
|
|
107
|
+
install: 'python -m pip install -r requirements.txt',
|
|
108
|
+
test: 'python -m pytest',
|
|
109
|
+
typecheck: p.frameworkSignals.includes('mypy') ? 'mypy .' : undefined,
|
|
110
|
+
lint: p.frameworkSignals.includes('ruff') ? 'ruff check .' : undefined,
|
|
111
|
+
build: existsSync(nodePath.join(root, 'pyproject.toml')) ? 'python -m build' : undefined,
|
|
112
|
+
notes,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
case LanguageId.Go:
|
|
116
|
+
return {
|
|
117
|
+
schema: LANGUAGE_COMMAND_SET_SCHEMA,
|
|
118
|
+
language: p.language,
|
|
119
|
+
install: 'go mod download',
|
|
120
|
+
test: 'go test ./...',
|
|
121
|
+
typecheck: 'go vet ./...',
|
|
122
|
+
build: 'go build ./...',
|
|
123
|
+
format: 'gofmt -l .',
|
|
124
|
+
run: 'go run ./...',
|
|
125
|
+
notes,
|
|
126
|
+
};
|
|
127
|
+
case LanguageId.Rust:
|
|
128
|
+
return {
|
|
129
|
+
schema: LANGUAGE_COMMAND_SET_SCHEMA,
|
|
130
|
+
language: p.language,
|
|
131
|
+
install: 'cargo fetch',
|
|
132
|
+
test: 'cargo test',
|
|
133
|
+
typecheck: 'cargo check',
|
|
134
|
+
lint: 'cargo clippy -- -D warnings',
|
|
135
|
+
format: 'cargo fmt --check',
|
|
136
|
+
build: 'cargo build',
|
|
137
|
+
run: 'cargo run',
|
|
138
|
+
notes,
|
|
139
|
+
};
|
|
140
|
+
default:
|
|
141
|
+
return { schema: LANGUAGE_COMMAND_SET_SCHEMA, language: p.language, notes };
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
export function buildLanguageCommandReport(projectRoot, cached) {
|
|
145
|
+
const profiles = cached ?? detectLanguageProfiles(projectRoot);
|
|
146
|
+
return {
|
|
147
|
+
schema: LANGUAGE_COMMAND_SET_SCHEMA,
|
|
148
|
+
generatedAt: new Date().toISOString(),
|
|
149
|
+
projectRoot,
|
|
150
|
+
profiles: profiles.profiles.map((p) => commandSetFor(projectRoot, p)),
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
export function renderLanguageCommandsText(r) {
|
|
154
|
+
let out = `=== Language commands ===\n`;
|
|
155
|
+
out += ` project root ${r.projectRoot}\n\n`;
|
|
156
|
+
for (const c of r.profiles) {
|
|
157
|
+
out += `[${c.language}]\n`;
|
|
158
|
+
if (c.install)
|
|
159
|
+
out += ` install : ${c.install}\n`;
|
|
160
|
+
if (c.restore)
|
|
161
|
+
out += ` restore : ${c.restore}\n`;
|
|
162
|
+
if (c.typecheck)
|
|
163
|
+
out += ` typecheck: ${c.typecheck}\n`;
|
|
164
|
+
if (c.test)
|
|
165
|
+
out += ` test : ${c.test}\n`;
|
|
166
|
+
if (c.lint)
|
|
167
|
+
out += ` lint : ${c.lint}\n`;
|
|
168
|
+
if (c.format)
|
|
169
|
+
out += ` format : ${c.format}\n`;
|
|
170
|
+
if (c.build)
|
|
171
|
+
out += ` build : ${c.build}\n`;
|
|
172
|
+
if (c.package)
|
|
173
|
+
out += ` package : ${c.package}\n`;
|
|
174
|
+
if (c.run)
|
|
175
|
+
out += ` run : ${c.run}\n`;
|
|
176
|
+
if (c.notes.length) {
|
|
177
|
+
for (const n of c.notes)
|
|
178
|
+
out += ` note : ${n}\n`;
|
|
179
|
+
}
|
|
180
|
+
out += `\n`;
|
|
181
|
+
}
|
|
182
|
+
return out;
|
|
183
|
+
}
|
|
184
|
+
export function renderLanguageCommandsMarkdown(r) {
|
|
185
|
+
let out = `# Language commands\n\n`;
|
|
186
|
+
out += `- **project root**: ${r.projectRoot}\n\n`;
|
|
187
|
+
for (const c of r.profiles) {
|
|
188
|
+
out += `## ${c.language}\n`;
|
|
189
|
+
if (c.install)
|
|
190
|
+
out += `- **install**: \`${c.install}\`\n`;
|
|
191
|
+
if (c.restore)
|
|
192
|
+
out += `- **restore**: \`${c.restore}\`\n`;
|
|
193
|
+
if (c.typecheck)
|
|
194
|
+
out += `- **typecheck**: \`${c.typecheck}\`\n`;
|
|
195
|
+
if (c.test)
|
|
196
|
+
out += `- **test**: \`${c.test}\`\n`;
|
|
197
|
+
if (c.lint)
|
|
198
|
+
out += `- **lint**: \`${c.lint}\`\n`;
|
|
199
|
+
if (c.format)
|
|
200
|
+
out += `- **format**: \`${c.format}\`\n`;
|
|
201
|
+
if (c.build)
|
|
202
|
+
out += `- **build**: \`${c.build}\`\n`;
|
|
203
|
+
if (c.package)
|
|
204
|
+
out += `- **package**: \`${c.package}\`\n`;
|
|
205
|
+
if (c.run)
|
|
206
|
+
out += `- **run**: \`${c.run}\`\n`;
|
|
207
|
+
if (c.notes.length) {
|
|
208
|
+
for (const n of c.notes)
|
|
209
|
+
out += `- _note_: ${n}\n`;
|
|
210
|
+
}
|
|
211
|
+
out += `\n`;
|
|
212
|
+
}
|
|
213
|
+
return out;
|
|
214
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { LanguageId } from './language-id.js';
|
|
2
|
+
export declare const POLYGLOT_DEPENDENCY_GRAPH_SCHEMA = "sharkcraft.polyglot-dependency-graph/v1";
|
|
3
|
+
export interface IPolyglotImportEdge {
|
|
4
|
+
from: string;
|
|
5
|
+
to: string;
|
|
6
|
+
language: LanguageId;
|
|
7
|
+
external?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface IPolyglotLanguageDeps {
|
|
10
|
+
language: LanguageId;
|
|
11
|
+
filesScanned: number;
|
|
12
|
+
imports: readonly IPolyglotImportEdge[];
|
|
13
|
+
internalEdges: readonly IPolyglotImportEdge[];
|
|
14
|
+
externalDeps: readonly string[];
|
|
15
|
+
unresolvedDeps: readonly string[];
|
|
16
|
+
confidence: 'low' | 'medium' | 'high';
|
|
17
|
+
limitations: readonly string[];
|
|
18
|
+
}
|
|
19
|
+
export interface IPolyglotDependencyGraph {
|
|
20
|
+
schema: typeof POLYGLOT_DEPENDENCY_GRAPH_SCHEMA;
|
|
21
|
+
generatedAt: string;
|
|
22
|
+
projectRoot: string;
|
|
23
|
+
perLanguage: readonly IPolyglotLanguageDeps[];
|
|
24
|
+
notes: readonly string[];
|
|
25
|
+
}
|
|
26
|
+
declare const LANG_EXTENSIONS: Record<string, readonly string[]>;
|
|
27
|
+
export declare function scanPolyglotDependencies(projectRoot: string, options?: {
|
|
28
|
+
languages?: readonly LanguageId[];
|
|
29
|
+
}): IPolyglotDependencyGraph;
|
|
30
|
+
export declare function renderPolyglotDependenciesText(g: IPolyglotDependencyGraph): string;
|
|
31
|
+
export declare function _exportLangExtensionsForTests(): typeof LANG_EXTENSIONS;
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=dependency-scan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dependency-scan.d.ts","sourceRoot":"","sources":["../../src/languages/dependency-scan.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG9C,eAAO,MAAM,gCAAgC,4CAA4C,CAAC;AAE1F,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,UAAU,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,UAAU,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,SAAS,mBAAmB,EAAE,CAAC;IACxC,aAAa,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAC9C,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,UAAU,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;IACtC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,OAAO,gCAAgC,CAAC;IAChD,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,SAAS,qBAAqB,EAAE,CAAC;IAC9C,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1B;AAyND,QAAA,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAMtD,CAAC;AAkCF,wBAAgB,wBAAwB,CACtC,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE;IAAE,SAAS,CAAC,EAAE,SAAS,UAAU,EAAE,CAAA;CAAO,GAClD,wBAAwB,CAqC1B;AAED,wBAAgB,8BAA8B,CAAC,CAAC,EAAE,wBAAwB,GAAG,MAAM,CAWlF;AAED,wBAAgB,6BAA6B,IAAI,OAAO,eAAe,CAEtE"}
|
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Polyglot dependency scan.
|
|
3
|
+
*
|
|
4
|
+
* Parses common import / use / using / package directives across Java, C#,
|
|
5
|
+
* Python, Go, Rust. The output is approximate (no compiler integration); each
|
|
6
|
+
* profile carries its own confidence + a `limitations` block. Pure regex
|
|
7
|
+
* scanning, no AST library.
|
|
8
|
+
*/
|
|
9
|
+
import { readFileSync, readdirSync, statSync } from 'node:fs';
|
|
10
|
+
import * as nodePath from 'node:path';
|
|
11
|
+
import { LanguageId } from "./language-id.js";
|
|
12
|
+
import { detectLanguageProfiles } from "./language-detection.js";
|
|
13
|
+
export const POLYGLOT_DEPENDENCY_GRAPH_SCHEMA = 'sharkcraft.polyglot-dependency-graph/v1';
|
|
14
|
+
function tryRead(file) {
|
|
15
|
+
try {
|
|
16
|
+
return readFileSync(file, 'utf8');
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function rel(root, abs) {
|
|
23
|
+
return nodePath.relative(root, abs).replace(/\\/g, '/');
|
|
24
|
+
}
|
|
25
|
+
function scanJava(root, files) {
|
|
26
|
+
const imports = [];
|
|
27
|
+
const externals = new Set();
|
|
28
|
+
const internalPackages = new Set();
|
|
29
|
+
let filesScanned = 0;
|
|
30
|
+
// First pass: catalogue `package com.foo;` declarations so we can classify
|
|
31
|
+
// `import com.foo.Bar;` as internal vs external.
|
|
32
|
+
for (const file of files) {
|
|
33
|
+
const body = tryRead(file);
|
|
34
|
+
if (!body)
|
|
35
|
+
continue;
|
|
36
|
+
const pkg = /^\s*package\s+([a-zA-Z0-9_.]+)\s*;/m.exec(body);
|
|
37
|
+
if (pkg)
|
|
38
|
+
internalPackages.add(pkg[1]);
|
|
39
|
+
}
|
|
40
|
+
for (const file of files) {
|
|
41
|
+
const body = tryRead(file);
|
|
42
|
+
if (!body)
|
|
43
|
+
continue;
|
|
44
|
+
filesScanned++;
|
|
45
|
+
const r = rel(root, file);
|
|
46
|
+
const importRe = /^\s*import\s+(?:static\s+)?([a-zA-Z0-9_.*]+)\s*;/gm;
|
|
47
|
+
for (const m of body.matchAll(importRe)) {
|
|
48
|
+
const target = m[1].replace(/\.\*$/, '');
|
|
49
|
+
const isInternal = [...internalPackages].some((p) => target === p || target.startsWith(p + '.'));
|
|
50
|
+
imports.push({ from: r, to: target, language: LanguageId.Java, external: !isInternal });
|
|
51
|
+
if (!isInternal)
|
|
52
|
+
externals.add(target);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
language: LanguageId.Java,
|
|
57
|
+
filesScanned,
|
|
58
|
+
imports,
|
|
59
|
+
internalEdges: imports.filter((e) => !e.external),
|
|
60
|
+
externalDeps: [...externals].sort(),
|
|
61
|
+
unresolvedDeps: [],
|
|
62
|
+
confidence: filesScanned > 0 ? 'medium' : 'low',
|
|
63
|
+
limitations: ['Java imports parsed by regex; star imports collapsed.'],
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function scanCSharp(root, files) {
|
|
67
|
+
const imports = [];
|
|
68
|
+
const externals = new Set();
|
|
69
|
+
const internalNamespaces = new Set();
|
|
70
|
+
let filesScanned = 0;
|
|
71
|
+
for (const file of files) {
|
|
72
|
+
const body = tryRead(file);
|
|
73
|
+
if (!body)
|
|
74
|
+
continue;
|
|
75
|
+
// Both file-scoped `namespace X.Y;` and block `namespace X.Y { … }`.
|
|
76
|
+
for (const m of body.matchAll(/^\s*namespace\s+([A-Za-z0-9_.]+)\s*[;{]/gm)) {
|
|
77
|
+
internalNamespaces.add(m[1]);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
for (const file of files) {
|
|
81
|
+
const body = tryRead(file);
|
|
82
|
+
if (!body)
|
|
83
|
+
continue;
|
|
84
|
+
filesScanned++;
|
|
85
|
+
const r = rel(root, file);
|
|
86
|
+
for (const m of body.matchAll(/^\s*using\s+(?:static\s+)?([A-Za-z0-9_.]+)\s*;/gm)) {
|
|
87
|
+
const target = m[1];
|
|
88
|
+
const isInternal = [...internalNamespaces].some((ns) => target === ns || target.startsWith(ns + '.'));
|
|
89
|
+
imports.push({ from: r, to: target, language: LanguageId.CSharp, external: !isInternal });
|
|
90
|
+
if (!isInternal)
|
|
91
|
+
externals.add(target);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return {
|
|
95
|
+
language: LanguageId.CSharp,
|
|
96
|
+
filesScanned,
|
|
97
|
+
imports,
|
|
98
|
+
internalEdges: imports.filter((e) => !e.external),
|
|
99
|
+
externalDeps: [...externals].sort(),
|
|
100
|
+
unresolvedDeps: [],
|
|
101
|
+
confidence: filesScanned > 0 ? 'medium' : 'low',
|
|
102
|
+
limitations: ['C# usings parsed by regex; alias usings (`using X = Y;`) not categorised.'],
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
function scanPython(root, files) {
|
|
106
|
+
const imports = [];
|
|
107
|
+
const externals = new Set();
|
|
108
|
+
const unresolved = new Set();
|
|
109
|
+
let filesScanned = 0;
|
|
110
|
+
// Internal modules are derived from the files themselves: every directory
|
|
111
|
+
// chain rooted at a known src/ or top-level is considered local.
|
|
112
|
+
const localModules = new Set();
|
|
113
|
+
for (const f of files) {
|
|
114
|
+
const r = rel(root, f);
|
|
115
|
+
const parts = r.split('/');
|
|
116
|
+
if (parts.length > 0)
|
|
117
|
+
localModules.add(parts[0]);
|
|
118
|
+
if (r.startsWith('src/') && parts.length > 1)
|
|
119
|
+
localModules.add(parts[1]);
|
|
120
|
+
}
|
|
121
|
+
for (const file of files) {
|
|
122
|
+
const body = tryRead(file);
|
|
123
|
+
if (!body)
|
|
124
|
+
continue;
|
|
125
|
+
filesScanned++;
|
|
126
|
+
const r = rel(root, file);
|
|
127
|
+
for (const m of body.matchAll(/^\s*(?:import\s+([A-Za-z_][A-Za-z0-9_.]*)(?:\s+as\s+\w+)?|from\s+(\.?\.?[A-Za-z_][A-Za-z0-9_.]*)\s+import\s+[^\n]+)/gm)) {
|
|
128
|
+
const target = (m[1] ?? m[2] ?? '').trim();
|
|
129
|
+
if (!target)
|
|
130
|
+
continue;
|
|
131
|
+
const top = target.replace(/^\.+/, '').split('.')[0];
|
|
132
|
+
const isInternal = target.startsWith('.') || localModules.has(top);
|
|
133
|
+
imports.push({ from: r, to: target, language: LanguageId.Python, external: !isInternal });
|
|
134
|
+
if (!isInternal)
|
|
135
|
+
externals.add(top);
|
|
136
|
+
else if (target.startsWith('.') && !target.match(/^\.+[A-Za-z_]/))
|
|
137
|
+
unresolved.add(target);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return {
|
|
141
|
+
language: LanguageId.Python,
|
|
142
|
+
filesScanned,
|
|
143
|
+
imports,
|
|
144
|
+
internalEdges: imports.filter((e) => !e.external),
|
|
145
|
+
externalDeps: [...externals].sort(),
|
|
146
|
+
unresolvedDeps: [...unresolved].sort(),
|
|
147
|
+
confidence: filesScanned > 0 ? 'medium' : 'low',
|
|
148
|
+
limitations: ['Python imports parsed by regex; conditional / runtime imports may be missed.'],
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
function scanGo(root, files) {
|
|
152
|
+
const imports = [];
|
|
153
|
+
const externals = new Set();
|
|
154
|
+
let filesScanned = 0;
|
|
155
|
+
// Detect the module name from go.mod for internal classification.
|
|
156
|
+
let modulePrefix = '';
|
|
157
|
+
const goMod = tryRead(nodePath.join(root, 'go.mod'));
|
|
158
|
+
if (goMod) {
|
|
159
|
+
const m = /^module\s+([^\s]+)/m.exec(goMod);
|
|
160
|
+
if (m)
|
|
161
|
+
modulePrefix = m[1];
|
|
162
|
+
}
|
|
163
|
+
for (const file of files) {
|
|
164
|
+
const body = tryRead(file);
|
|
165
|
+
if (!body)
|
|
166
|
+
continue;
|
|
167
|
+
filesScanned++;
|
|
168
|
+
const r = rel(root, file);
|
|
169
|
+
// Single-line `import "x"`
|
|
170
|
+
for (const m of body.matchAll(/^\s*import\s+"([^"]+)"/gm)) {
|
|
171
|
+
const target = m[1];
|
|
172
|
+
const isInternal = modulePrefix.length > 0 && (target === modulePrefix || target.startsWith(modulePrefix + '/'));
|
|
173
|
+
imports.push({ from: r, to: target, language: LanguageId.Go, external: !isInternal });
|
|
174
|
+
if (!isInternal)
|
|
175
|
+
externals.add(target);
|
|
176
|
+
}
|
|
177
|
+
// Block import (foo "x" or alias)
|
|
178
|
+
const blockMatch = body.match(/import\s*\(([\s\S]*?)\)/m);
|
|
179
|
+
if (blockMatch) {
|
|
180
|
+
for (const line of blockMatch[1].split('\n')) {
|
|
181
|
+
const lm = /\s*(?:[A-Za-z_]\w*\s+)?"([^"]+)"/.exec(line);
|
|
182
|
+
if (!lm)
|
|
183
|
+
continue;
|
|
184
|
+
const target = lm[1];
|
|
185
|
+
const isInternal = modulePrefix.length > 0 && (target === modulePrefix || target.startsWith(modulePrefix + '/'));
|
|
186
|
+
imports.push({ from: r, to: target, language: LanguageId.Go, external: !isInternal });
|
|
187
|
+
if (!isInternal)
|
|
188
|
+
externals.add(target);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
return {
|
|
193
|
+
language: LanguageId.Go,
|
|
194
|
+
filesScanned,
|
|
195
|
+
imports,
|
|
196
|
+
internalEdges: imports.filter((e) => !e.external),
|
|
197
|
+
externalDeps: [...externals].sort(),
|
|
198
|
+
unresolvedDeps: [],
|
|
199
|
+
confidence: filesScanned > 0 ? 'high' : 'low',
|
|
200
|
+
limitations: modulePrefix ? [] : ['No `module` directive in go.mod — internal classification may be incorrect.'],
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
function scanRust(root, files) {
|
|
204
|
+
const imports = [];
|
|
205
|
+
const externals = new Set();
|
|
206
|
+
let filesScanned = 0;
|
|
207
|
+
// First crate name from Cargo.toml.
|
|
208
|
+
const cargo = tryRead(nodePath.join(root, 'Cargo.toml'));
|
|
209
|
+
let crateName = '';
|
|
210
|
+
if (cargo) {
|
|
211
|
+
const m = /name\s*=\s*"([^"]+)"/.exec(cargo);
|
|
212
|
+
if (m)
|
|
213
|
+
crateName = m[1].replace(/-/g, '_');
|
|
214
|
+
}
|
|
215
|
+
for (const file of files) {
|
|
216
|
+
const body = tryRead(file);
|
|
217
|
+
if (!body)
|
|
218
|
+
continue;
|
|
219
|
+
filesScanned++;
|
|
220
|
+
const r = rel(root, file);
|
|
221
|
+
for (const m of body.matchAll(/^\s*use\s+([A-Za-z_][A-Za-z0-9_:]*)/gm)) {
|
|
222
|
+
const target = m[1];
|
|
223
|
+
const head = target.split('::')[0];
|
|
224
|
+
const isInternal = head === 'crate' || head === 'super' || head === 'self' || head === crateName;
|
|
225
|
+
imports.push({ from: r, to: target, language: LanguageId.Rust, external: !isInternal });
|
|
226
|
+
if (!isInternal)
|
|
227
|
+
externals.add(head);
|
|
228
|
+
}
|
|
229
|
+
for (const m of body.matchAll(/^\s*mod\s+([A-Za-z_][A-Za-z0-9_]*)\s*;/gm)) {
|
|
230
|
+
imports.push({ from: r, to: 'mod::' + m[1], language: LanguageId.Rust, external: false });
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
return {
|
|
234
|
+
language: LanguageId.Rust,
|
|
235
|
+
filesScanned,
|
|
236
|
+
imports,
|
|
237
|
+
internalEdges: imports.filter((e) => !e.external),
|
|
238
|
+
externalDeps: [...externals].sort(),
|
|
239
|
+
unresolvedDeps: [],
|
|
240
|
+
confidence: filesScanned > 0 ? 'medium' : 'low',
|
|
241
|
+
limitations: ['Rust `use` parsed by regex; grouped `use foo::{a, b};` only records `foo` head.'],
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
const LANG_EXTENSIONS = {
|
|
245
|
+
[LanguageId.Java]: ['.java'],
|
|
246
|
+
[LanguageId.CSharp]: ['.cs'],
|
|
247
|
+
[LanguageId.Python]: ['.py'],
|
|
248
|
+
[LanguageId.Go]: ['.go'],
|
|
249
|
+
[LanguageId.Rust]: ['.rs'],
|
|
250
|
+
};
|
|
251
|
+
function collectFilesByExtension(root, exts) {
|
|
252
|
+
// Walk the tree limited by the same ignored-dir rules.
|
|
253
|
+
const out = [];
|
|
254
|
+
const ignored = new Set(['node_modules', '.git', 'target', 'build', 'bin', 'obj', 'dist', 'out', '__pycache__', '.venv', 'venv', 'vendor']);
|
|
255
|
+
const stack = [root];
|
|
256
|
+
while (stack.length > 0 && out.length < 25000) {
|
|
257
|
+
const cur = stack.pop();
|
|
258
|
+
let entries;
|
|
259
|
+
try {
|
|
260
|
+
entries = readdirSync(cur);
|
|
261
|
+
}
|
|
262
|
+
catch {
|
|
263
|
+
continue;
|
|
264
|
+
}
|
|
265
|
+
for (const e of entries) {
|
|
266
|
+
if (ignored.has(e))
|
|
267
|
+
continue;
|
|
268
|
+
const abs = nodePath.join(cur, e);
|
|
269
|
+
let st;
|
|
270
|
+
try {
|
|
271
|
+
st = statSync(abs);
|
|
272
|
+
}
|
|
273
|
+
catch {
|
|
274
|
+
continue;
|
|
275
|
+
}
|
|
276
|
+
if (st.isDirectory()) {
|
|
277
|
+
stack.push(abs);
|
|
278
|
+
continue;
|
|
279
|
+
}
|
|
280
|
+
if (st.isFile() && exts.some((x) => abs.endsWith(x)))
|
|
281
|
+
out.push(abs);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
return out;
|
|
285
|
+
}
|
|
286
|
+
export function scanPolyglotDependencies(projectRoot, options = {}) {
|
|
287
|
+
const cached = detectLanguageProfiles(projectRoot);
|
|
288
|
+
const wanted = options.languages && options.languages.length > 0
|
|
289
|
+
? new Set(options.languages)
|
|
290
|
+
: new Set([LanguageId.Java, LanguageId.CSharp, LanguageId.Python, LanguageId.Go, LanguageId.Rust]);
|
|
291
|
+
const perLanguage = [];
|
|
292
|
+
void cached;
|
|
293
|
+
if (wanted.has(LanguageId.Java)) {
|
|
294
|
+
const files = collectFilesByExtension(projectRoot, LANG_EXTENSIONS[LanguageId.Java]);
|
|
295
|
+
if (files.length > 0)
|
|
296
|
+
perLanguage.push(scanJava(projectRoot, files));
|
|
297
|
+
}
|
|
298
|
+
if (wanted.has(LanguageId.CSharp)) {
|
|
299
|
+
const files = collectFilesByExtension(projectRoot, LANG_EXTENSIONS[LanguageId.CSharp]);
|
|
300
|
+
if (files.length > 0)
|
|
301
|
+
perLanguage.push(scanCSharp(projectRoot, files));
|
|
302
|
+
}
|
|
303
|
+
if (wanted.has(LanguageId.Python)) {
|
|
304
|
+
const files = collectFilesByExtension(projectRoot, LANG_EXTENSIONS[LanguageId.Python]);
|
|
305
|
+
if (files.length > 0)
|
|
306
|
+
perLanguage.push(scanPython(projectRoot, files));
|
|
307
|
+
}
|
|
308
|
+
if (wanted.has(LanguageId.Go)) {
|
|
309
|
+
const files = collectFilesByExtension(projectRoot, LANG_EXTENSIONS[LanguageId.Go]);
|
|
310
|
+
if (files.length > 0)
|
|
311
|
+
perLanguage.push(scanGo(projectRoot, files));
|
|
312
|
+
}
|
|
313
|
+
if (wanted.has(LanguageId.Rust)) {
|
|
314
|
+
const files = collectFilesByExtension(projectRoot, LANG_EXTENSIONS[LanguageId.Rust]);
|
|
315
|
+
if (files.length > 0)
|
|
316
|
+
perLanguage.push(scanRust(projectRoot, files));
|
|
317
|
+
}
|
|
318
|
+
return {
|
|
319
|
+
schema: POLYGLOT_DEPENDENCY_GRAPH_SCHEMA,
|
|
320
|
+
generatedAt: new Date().toISOString(),
|
|
321
|
+
projectRoot,
|
|
322
|
+
perLanguage,
|
|
323
|
+
notes: ['Regex-based scan — no compiler / AST integration.'],
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
export function renderPolyglotDependenciesText(g) {
|
|
327
|
+
let out = `=== Polyglot dependencies ===\n`;
|
|
328
|
+
out += ` project root ${g.projectRoot}\n`;
|
|
329
|
+
out += ` languages ${g.perLanguage.map((p) => p.language).join(', ') || '(none)'}\n\n`;
|
|
330
|
+
for (const p of g.perLanguage) {
|
|
331
|
+
out += `[${p.language}] files=${p.filesScanned} imports=${p.imports.length} internal=${p.internalEdges.length} external=${p.externalDeps.length} confidence=${p.confidence}\n`;
|
|
332
|
+
if (p.externalDeps.length)
|
|
333
|
+
out += ` external deps: ${p.externalDeps.slice(0, 12).join(', ')}${p.externalDeps.length > 12 ? ', …' : ''}\n`;
|
|
334
|
+
if (p.limitations.length)
|
|
335
|
+
for (const l of p.limitations)
|
|
336
|
+
out += ` note: ${l}\n`;
|
|
337
|
+
out += `\n`;
|
|
338
|
+
}
|
|
339
|
+
return out;
|
|
340
|
+
}
|
|
341
|
+
export function _exportLangExtensionsForTests() {
|
|
342
|
+
return LANG_EXTENSIONS;
|
|
343
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Polyglot language module barrel.
|
|
3
|
+
*/
|
|
4
|
+
export * from './language-id.js';
|
|
5
|
+
export * from './language-detection.js';
|
|
6
|
+
export * from './command-inference.js';
|
|
7
|
+
export * from './dependency-scan.js';
|
|
8
|
+
export * from './test-impact.js';
|
|
9
|
+
export * from './language-boundaries.js';
|
|
10
|
+
export * from './polyglot-boundary.js';
|
|
11
|
+
export * from './polyglot-ci.js';
|
|
12
|
+
export * from './language-cache.js';
|
|
13
|
+
export * from './language-runner.js';
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/languages/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Polyglot language module barrel.
|
|
3
|
+
*/
|
|
4
|
+
export * from "./language-id.js";
|
|
5
|
+
export * from "./language-detection.js";
|
|
6
|
+
export * from "./command-inference.js";
|
|
7
|
+
export * from "./dependency-scan.js";
|
|
8
|
+
export * from "./test-impact.js";
|
|
9
|
+
export * from "./language-boundaries.js";
|
|
10
|
+
export * from "./polyglot-boundary.js";
|
|
11
|
+
export * from "./polyglot-ci.js";
|
|
12
|
+
export * from "./language-cache.js";
|
|
13
|
+
export * from "./language-runner.js";
|