@shrkcrft/inspector 0.1.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +15 -0
- package/dist/acceptance-replay.d.ts +63 -0
- package/dist/acceptance-replay.d.ts.map +1 -0
- package/dist/acceptance-replay.js +240 -0
- package/dist/action-hint-diagnostics.d.ts +32 -0
- package/dist/action-hint-diagnostics.d.ts.map +1 -0
- package/dist/action-hint-diagnostics.js +133 -0
- package/dist/adoption-check.d.ts +28 -0
- package/dist/adoption-check.d.ts.map +1 -0
- package/dist/adoption-check.js +181 -0
- package/dist/adoption-checkpoint.d.ts +97 -0
- package/dist/adoption-checkpoint.d.ts.map +1 -0
- package/dist/adoption-checkpoint.js +209 -0
- package/dist/adoption-merge-preview.d.ts +28 -0
- package/dist/adoption-merge-preview.d.ts.map +1 -0
- package/dist/adoption-merge-preview.js +254 -0
- package/dist/adoption-report-renderer.d.ts +33 -0
- package/dist/adoption-report-renderer.d.ts.map +1 -0
- package/dist/adoption-report-renderer.js +257 -0
- package/dist/adoption-state.d.ts +100 -0
- package/dist/adoption-state.d.ts.map +1 -0
- package/dist/adoption-state.js +296 -0
- package/dist/adoption-three-way.d.ts +46 -0
- package/dist/adoption-three-way.d.ts.map +1 -0
- package/dist/adoption-three-way.js +181 -0
- package/dist/agent-brief.d.ts +77 -0
- package/dist/agent-brief.d.ts.map +1 -0
- package/dist/agent-brief.js +490 -0
- package/dist/agent-contract-gate.d.ts +108 -0
- package/dist/agent-contract-gate.d.ts.map +1 -0
- package/dist/agent-contract-gate.js +412 -0
- package/dist/agent-contract-templates.d.ts +63 -0
- package/dist/agent-contract-templates.d.ts.map +1 -0
- package/dist/agent-contract-templates.js +346 -0
- package/dist/agent-contract.d.ts +65 -0
- package/dist/agent-contract.d.ts.map +1 -0
- package/dist/agent-contract.js +555 -0
- package/dist/agent-handoff.d.ts +123 -0
- package/dist/agent-handoff.d.ts.map +1 -0
- package/dist/agent-handoff.js +470 -0
- package/dist/agent-instructions.d.ts +2 -0
- package/dist/agent-instructions.d.ts.map +1 -0
- package/dist/agent-instructions.js +21 -0
- package/dist/agent-orchestration.d.ts +61 -0
- package/dist/agent-orchestration.d.ts.map +1 -0
- package/dist/agent-orchestration.js +285 -0
- package/dist/agent-task-prep.d.ts +31 -0
- package/dist/agent-task-prep.d.ts.map +1 -0
- package/dist/agent-task-prep.js +73 -0
- package/dist/ai-readiness.d.ts +30 -0
- package/dist/ai-readiness.d.ts.map +1 -0
- package/dist/ai-readiness.js +279 -0
- package/dist/api-report.d.ts +51 -0
- package/dist/api-report.d.ts.map +1 -0
- package/dist/api-report.js +254 -0
- package/dist/apply-dispatch-trace.d.ts +93 -0
- package/dist/apply-dispatch-trace.d.ts.map +1 -0
- package/dist/apply-dispatch-trace.js +283 -0
- package/dist/apply-gate-result.d.ts +52 -0
- package/dist/apply-gate-result.d.ts.map +1 -0
- package/dist/apply-gate-result.js +44 -0
- package/dist/architecture-map.d.ts +118 -0
- package/dist/architecture-map.d.ts.map +1 -0
- package/dist/architecture-map.js +543 -0
- package/dist/area-explore.d.ts +75 -0
- package/dist/area-explore.d.ts.map +1 -0
- package/dist/area-explore.js +438 -0
- package/dist/area-map.d.ts +57 -0
- package/dist/area-map.d.ts.map +1 -0
- package/dist/area-map.js +214 -0
- package/dist/asset-provenance.d.ts +123 -0
- package/dist/asset-provenance.d.ts.map +1 -0
- package/dist/asset-provenance.js +209 -0
- package/dist/barrel-operations.d.ts +45 -0
- package/dist/barrel-operations.d.ts.map +1 -0
- package/dist/barrel-operations.js +159 -0
- package/dist/boundaries-changed-only.d.ts +62 -0
- package/dist/boundaries-changed-only.d.ts.map +1 -0
- package/dist/boundaries-changed-only.js +97 -0
- package/dist/boundary-suggestions.d.ts +20 -0
- package/dist/boundary-suggestions.d.ts.map +1 -0
- package/dist/boundary-suggestions.js +51 -0
- package/dist/bundle-diff.d.ts +98 -0
- package/dist/bundle-diff.d.ts.map +1 -0
- package/dist/bundle-diff.js +531 -0
- package/dist/bundle-replay.d.ts +68 -0
- package/dist/bundle-replay.d.ts.map +1 -0
- package/dist/bundle-replay.js +273 -0
- package/dist/bundle-validate-html.d.ts +11 -0
- package/dist/bundle-validate-html.d.ts.map +1 -0
- package/dist/bundle-validate-html.js +60 -0
- package/dist/change-intent.d.ts +36 -0
- package/dist/change-intent.d.ts.map +1 -0
- package/dist/change-intent.js +259 -0
- package/dist/changed-preflight.d.ts +59 -0
- package/dist/changed-preflight.d.ts.map +1 -0
- package/dist/changed-preflight.js +358 -0
- package/dist/changed-scope.d.ts +112 -0
- package/dist/changed-scope.d.ts.map +1 -0
- package/dist/changed-scope.js +172 -0
- package/dist/changes-summary.d.ts +87 -0
- package/dist/changes-summary.d.ts.map +1 -0
- package/dist/changes-summary.js +323 -0
- package/dist/check-result-v1.d.ts +90 -0
- package/dist/check-result-v1.d.ts.map +1 -0
- package/dist/check-result-v1.js +335 -0
- package/dist/ci-integrity-report.d.ts +38 -0
- package/dist/ci-integrity-report.d.ts.map +1 -0
- package/dist/ci-integrity-report.js +324 -0
- package/dist/ci-permissions-fix.d.ts +38 -0
- package/dist/ci-permissions-fix.d.ts.map +1 -0
- package/dist/ci-permissions-fix.js +382 -0
- package/dist/ci-permissions.d.ts +51 -0
- package/dist/ci-permissions.d.ts.map +1 -0
- package/dist/ci-permissions.js +431 -0
- package/dist/ci-predict.d.ts +42 -0
- package/dist/ci-predict.d.ts.map +1 -0
- package/dist/ci-predict.js +300 -0
- package/dist/ci-scaffold.d.ts +47 -0
- package/dist/ci-scaffold.d.ts.map +1 -0
- package/dist/ci-scaffold.js +638 -0
- package/dist/codemod-assist.d.ts +97 -0
- package/dist/codemod-assist.d.ts.map +1 -0
- package/dist/codemod-assist.js +261 -0
- package/dist/command-recommender.d.ts +25 -0
- package/dist/command-recommender.d.ts.map +1 -0
- package/dist/command-recommender.js +145 -0
- package/dist/command-suggester.d.ts +61 -0
- package/dist/command-suggester.d.ts.map +1 -0
- package/dist/command-suggester.js +159 -0
- package/dist/command-taxonomy.d.ts +38 -0
- package/dist/command-taxonomy.d.ts.map +1 -0
- package/dist/command-taxonomy.js +164 -0
- package/dist/compliance-evidence.d.ts +58 -0
- package/dist/compliance-evidence.d.ts.map +1 -0
- package/dist/compliance-evidence.js +260 -0
- package/dist/compliance-profiles.d.ts +42 -0
- package/dist/compliance-profiles.d.ts.map +1 -0
- package/dist/compliance-profiles.js +171 -0
- package/dist/construct-adoption-diff.d.ts +55 -0
- package/dist/construct-adoption-diff.d.ts.map +1 -0
- package/dist/construct-adoption-diff.js +331 -0
- package/dist/construct-adoption.d.ts +71 -0
- package/dist/construct-adoption.d.ts.map +1 -0
- package/dist/construct-adoption.js +331 -0
- package/dist/construct-inference.d.ts +44 -0
- package/dist/construct-inference.d.ts.map +1 -0
- package/dist/construct-inference.js +391 -0
- package/dist/construct-registry.d.ts +32 -0
- package/dist/construct-registry.d.ts.map +1 -0
- package/dist/construct-registry.js +198 -0
- package/dist/contract-file-rule.d.ts +37 -0
- package/dist/contract-file-rule.d.ts.map +1 -0
- package/dist/contract-file-rule.js +99 -0
- package/dist/contract-template-registry.d.ts +28 -0
- package/dist/contract-template-registry.d.ts.map +1 -0
- package/dist/contract-template-registry.js +161 -0
- package/dist/contradictions.d.ts +52 -0
- package/dist/contradictions.d.ts.map +1 -0
- package/dist/contradictions.js +391 -0
- package/dist/convention-registry.d.ts +44 -0
- package/dist/convention-registry.d.ts.map +1 -0
- package/dist/convention-registry.js +195 -0
- package/dist/coverage-report.d.ts +25 -0
- package/dist/coverage-report.d.ts.map +1 -0
- package/dist/coverage-report.js +190 -0
- package/dist/custom-checks.d.ts +146 -0
- package/dist/custom-checks.d.ts.map +1 -0
- package/dist/custom-checks.js +260 -0
- package/dist/dashboard/dashboard-data.d.ts +59 -0
- package/dist/dashboard/dashboard-data.d.ts.map +1 -0
- package/dist/dashboard/dashboard-data.js +653 -0
- package/dist/dashboard-export.d.ts +67 -0
- package/dist/dashboard-export.d.ts.map +1 -0
- package/dist/dashboard-export.js +203 -0
- package/dist/decision-records.d.ts +47 -0
- package/dist/decision-records.d.ts.map +1 -0
- package/dist/decision-records.js +255 -0
- package/dist/demo-package.d.ts +49 -0
- package/dist/demo-package.d.ts.map +1 -0
- package/dist/demo-package.js +305 -0
- package/dist/demo-script.d.ts +25 -0
- package/dist/demo-script.d.ts.map +1 -0
- package/dist/demo-script.js +198 -0
- package/dist/demo-workflow.d.ts +28 -0
- package/dist/demo-workflow.d.ts.map +1 -0
- package/dist/demo-workflow.js +178 -0
- package/dist/dev-cycle.d.ts +41 -0
- package/dist/dev-cycle.d.ts.map +1 -0
- package/dist/dev-cycle.js +94 -0
- package/dist/dev-session-html.d.ts +13 -0
- package/dist/dev-session-html.d.ts.map +1 -0
- package/dist/dev-session-html.js +223 -0
- package/dist/dev-session-report.d.ts +11 -0
- package/dist/dev-session-report.d.ts.map +1 -0
- package/dist/dev-session-report.js +206 -0
- package/dist/dev-session.d.ts +257 -0
- package/dist/dev-session.d.ts.map +1 -0
- package/dist/dev-session.js +568 -0
- package/dist/diagnostics-suggest.d.ts +17 -0
- package/dist/diagnostics-suggest.d.ts.map +1 -0
- package/dist/diagnostics-suggest.js +69 -0
- package/dist/docs-check.d.ts +40 -0
- package/dist/docs-check.d.ts.map +1 -0
- package/dist/docs-check.js +221 -0
- package/dist/doctor-acknowledgements.d.ts +69 -0
- package/dist/doctor-acknowledgements.d.ts.map +1 -0
- package/dist/doctor-acknowledgements.js +150 -0
- package/dist/doctor-result.d.ts +51 -0
- package/dist/doctor-result.d.ts.map +1 -0
- package/dist/doctor-result.js +7 -0
- package/dist/doctor-suppressions.d.ts +91 -0
- package/dist/doctor-suppressions.d.ts.map +1 -0
- package/dist/doctor-suppressions.js +238 -0
- package/dist/drift-baseline.d.ts +29 -0
- package/dist/drift-baseline.d.ts.map +1 -0
- package/dist/drift-baseline.js +80 -0
- package/dist/drift.d.ts +38 -0
- package/dist/drift.d.ts.map +1 -0
- package/dist/drift.js +107 -0
- package/dist/entrypoint-matrix.d.ts +61 -0
- package/dist/entrypoint-matrix.d.ts.map +1 -0
- package/dist/entrypoint-matrix.js +221 -0
- package/dist/examples-check.d.ts +36 -0
- package/dist/examples-check.d.ts.map +1 -0
- package/dist/examples-check.js +168 -0
- package/dist/execution-graph.d.ts +98 -0
- package/dist/execution-graph.d.ts.map +1 -0
- package/dist/execution-graph.js +484 -0
- package/dist/export-bundle.d.ts +10 -0
- package/dist/export-bundle.d.ts.map +1 -0
- package/dist/export-bundle.js +90 -0
- package/dist/failure-diagnostics.d.ts +63 -0
- package/dist/failure-diagnostics.d.ts.map +1 -0
- package/dist/failure-diagnostics.js +243 -0
- package/dist/feature-bundle.d.ts +111 -0
- package/dist/feature-bundle.d.ts.map +1 -0
- package/dist/feature-bundle.js +211 -0
- package/dist/feedback-actions-v2.d.ts +65 -0
- package/dist/feedback-actions-v2.d.ts.map +1 -0
- package/dist/feedback-actions-v2.js +183 -0
- package/dist/feedback-ingestion.d.ts +96 -0
- package/dist/feedback-ingestion.d.ts.map +1 -0
- package/dist/feedback-ingestion.js +400 -0
- package/dist/fix-preview.d.ts +82 -0
- package/dist/fix-preview.d.ts.map +1 -0
- package/dist/fix-preview.js +365 -0
- package/dist/fuzzy-impact.d.ts +50 -0
- package/dist/fuzzy-impact.d.ts.map +1 -0
- package/dist/fuzzy-impact.js +446 -0
- package/dist/generated-code.d.ts +97 -0
- package/dist/generated-code.d.ts.map +1 -0
- package/dist/generated-code.js +395 -0
- package/dist/git-helpers.d.ts +38 -0
- package/dist/git-helpers.d.ts.map +1 -0
- package/dist/git-helpers.js +173 -0
- package/dist/golden-output.d.ts +33 -0
- package/dist/golden-output.d.ts.map +1 -0
- package/dist/golden-output.js +92 -0
- package/dist/grounding/build-grounding.d.ts +53 -0
- package/dist/grounding/build-grounding.d.ts.map +1 -0
- package/dist/grounding/build-grounding.js +51 -0
- package/dist/grounding/nx-projects.d.ts +29 -0
- package/dist/grounding/nx-projects.d.ts.map +1 -0
- package/dist/grounding/nx-projects.js +109 -0
- package/dist/grounding/validate-extracted-plan.d.ts +20 -0
- package/dist/grounding/validate-extracted-plan.d.ts.map +1 -0
- package/dist/grounding/validate-extracted-plan.js +127 -0
- package/dist/healing-plan.d.ts +33 -0
- package/dist/healing-plan.d.ts.map +1 -0
- package/dist/healing-plan.js +346 -0
- package/dist/helper-registry.d.ts +90 -0
- package/dist/helper-registry.d.ts.map +1 -0
- package/dist/helper-registry.js +529 -0
- package/dist/impact-analysis.d.ts +150 -0
- package/dist/impact-analysis.d.ts.map +1 -0
- package/dist/impact-analysis.js +697 -0
- package/dist/impact-graph-render.d.ts +51 -0
- package/dist/impact-graph-render.d.ts.map +1 -0
- package/dist/impact-graph-render.js +139 -0
- package/dist/impact-graph.d.ts +17 -0
- package/dist/impact-graph.d.ts.map +1 -0
- package/dist/impact-graph.js +119 -0
- package/dist/impact-render.d.ts +22 -0
- package/dist/impact-render.d.ts.map +1 -0
- package/dist/impact-render.js +422 -0
- package/dist/import-graph-analysis.d.ts +28 -0
- package/dist/import-graph-analysis.d.ts.map +1 -0
- package/dist/import-graph-analysis.js +193 -0
- package/dist/import-hygiene.d.ts +93 -0
- package/dist/import-hygiene.d.ts.map +1 -0
- package/dist/import-hygiene.js +366 -0
- package/dist/index.d.ts +224 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +234 -0
- package/dist/ingest-adoption.d.ts +50 -0
- package/dist/ingest-adoption.d.ts.map +1 -0
- package/dist/ingest-adoption.js +183 -0
- package/dist/ingest-apply.d.ts +80 -0
- package/dist/ingest-apply.d.ts.map +1 -0
- package/dist/ingest-apply.js +227 -0
- package/dist/ingest-body-extractor.d.ts +28 -0
- package/dist/ingest-body-extractor.d.ts.map +1 -0
- package/dist/ingest-body-extractor.js +129 -0
- package/dist/ingest-drafts.d.ts +16 -0
- package/dist/ingest-drafts.d.ts.map +1 -0
- package/dist/ingest-drafts.js +482 -0
- package/dist/inspector-cache.d.ts +41 -0
- package/dist/inspector-cache.d.ts.map +1 -0
- package/dist/inspector-cache.js +104 -0
- package/dist/install-smoke.d.ts +44 -0
- package/dist/install-smoke.d.ts.map +1 -0
- package/dist/install-smoke.js +31 -0
- package/dist/knowledge-authoring.d.ts +151 -0
- package/dist/knowledge-authoring.d.ts.map +1 -0
- package/dist/knowledge-authoring.js +586 -0
- package/dist/knowledge-graph.d.ts +76 -0
- package/dist/knowledge-graph.d.ts.map +1 -0
- package/dist/knowledge-graph.js +336 -0
- package/dist/knowledge-lint.d.ts +97 -0
- package/dist/knowledge-lint.d.ts.map +1 -0
- package/dist/knowledge-lint.js +302 -0
- package/dist/knowledge-rename.d.ts +38 -0
- package/dist/knowledge-rename.d.ts.map +1 -0
- package/dist/knowledge-rename.js +88 -0
- package/dist/knowledge-stale.d.ts +124 -0
- package/dist/knowledge-stale.d.ts.map +1 -0
- package/dist/knowledge-stale.js +892 -0
- package/dist/languages/command-inference.d.ts +27 -0
- package/dist/languages/command-inference.d.ts.map +1 -0
- package/dist/languages/command-inference.js +214 -0
- package/dist/languages/dependency-scan.d.ts +33 -0
- package/dist/languages/dependency-scan.d.ts.map +1 -0
- package/dist/languages/dependency-scan.js +343 -0
- package/dist/languages/index.d.ts +14 -0
- package/dist/languages/index.d.ts.map +1 -0
- package/dist/languages/index.js +13 -0
- package/dist/languages/language-boundaries.d.ts +30 -0
- package/dist/languages/language-boundaries.d.ts.map +1 -0
- package/dist/languages/language-boundaries.js +176 -0
- package/dist/languages/language-cache.d.ts +54 -0
- package/dist/languages/language-cache.d.ts.map +1 -0
- package/dist/languages/language-cache.js +236 -0
- package/dist/languages/language-detection.d.ts +30 -0
- package/dist/languages/language-detection.d.ts.map +1 -0
- package/dist/languages/language-detection.js +584 -0
- package/dist/languages/language-id.d.ts +15 -0
- package/dist/languages/language-id.d.ts.map +1 -0
- package/dist/languages/language-id.js +15 -0
- package/dist/languages/language-runner.d.ts +90 -0
- package/dist/languages/language-runner.d.ts.map +1 -0
- package/dist/languages/language-runner.js +346 -0
- package/dist/languages/polyglot-boundary.d.ts +80 -0
- package/dist/languages/polyglot-boundary.d.ts.map +1 -0
- package/dist/languages/polyglot-boundary.js +373 -0
- package/dist/languages/polyglot-ci.d.ts +25 -0
- package/dist/languages/polyglot-ci.d.ts.map +1 -0
- package/dist/languages/polyglot-ci.js +278 -0
- package/dist/languages/test-impact.d.ts +19 -0
- package/dist/languages/test-impact.d.ts.map +1 -0
- package/dist/languages/test-impact.js +157 -0
- package/dist/loader-diagnostics.d.ts +40 -0
- package/dist/loader-diagnostics.d.ts.map +1 -0
- package/dist/loader-diagnostics.js +49 -0
- package/dist/memory-diff.d.ts +60 -0
- package/dist/memory-diff.d.ts.map +1 -0
- package/dist/memory-diff.js +302 -0
- package/dist/migration-profile-registry.d.ts +26 -0
- package/dist/migration-profile-registry.d.ts.map +1 -0
- package/dist/migration-profile-registry.js +135 -0
- package/dist/migration-readiness.d.ts +101 -0
- package/dist/migration-readiness.d.ts.map +1 -0
- package/dist/migration-readiness.js +253 -0
- package/dist/monorepo-onboarding.d.ts +51 -0
- package/dist/monorepo-onboarding.d.ts.map +1 -0
- package/dist/monorepo-onboarding.js +235 -0
- package/dist/onboarding-adoption-diff.d.ts +53 -0
- package/dist/onboarding-adoption-diff.d.ts.map +1 -0
- package/dist/onboarding-adoption-diff.js +285 -0
- package/dist/onboarding-adoption.d.ts +136 -0
- package/dist/onboarding-adoption.d.ts.map +1 -0
- package/dist/onboarding-adoption.js +702 -0
- package/dist/onboarding-agent-import.d.ts +40 -0
- package/dist/onboarding-agent-import.d.ts.map +1 -0
- package/dist/onboarding-agent-import.js +114 -0
- package/dist/onboarding-diff.d.ts +39 -0
- package/dist/onboarding-diff.d.ts.map +1 -0
- package/dist/onboarding-diff.js +240 -0
- package/dist/onboarding-drafts-merge.d.ts +71 -0
- package/dist/onboarding-drafts-merge.d.ts.map +1 -0
- package/dist/onboarding-drafts-merge.js +174 -0
- package/dist/onboarding-drafts.d.ts +42 -0
- package/dist/onboarding-drafts.d.ts.map +1 -0
- package/dist/onboarding-drafts.js +268 -0
- package/dist/onboarding-report.d.ts +8 -0
- package/dist/onboarding-report.d.ts.map +1 -0
- package/dist/onboarding-report.js +239 -0
- package/dist/onboarding.d.ts +134 -0
- package/dist/onboarding.d.ts.map +1 -0
- package/dist/onboarding.js +729 -0
- package/dist/ownership.d.ts +38 -0
- package/dist/ownership.d.ts.map +1 -0
- package/dist/ownership.js +102 -0
- package/dist/pack-author-ux.d.ts +58 -0
- package/dist/pack-author-ux.d.ts.map +1 -0
- package/dist/pack-author-ux.js +219 -0
- package/dist/pack-author.d.ts +94 -0
- package/dist/pack-author.d.ts.map +1 -0
- package/dist/pack-author.js +208 -0
- package/dist/pack-compatibility.d.ts +21 -0
- package/dist/pack-compatibility.d.ts.map +1 -0
- package/dist/pack-compatibility.js +114 -0
- package/dist/pack-contributions-inventory.d.ts +121 -0
- package/dist/pack-contributions-inventory.d.ts.map +1 -0
- package/dist/pack-contributions-inventory.js +732 -0
- package/dist/pack-docs.d.ts +11 -0
- package/dist/pack-docs.d.ts.map +1 -0
- package/dist/pack-docs.js +101 -0
- package/dist/pack-doctor.d.ts +50 -0
- package/dist/pack-doctor.d.ts.map +1 -0
- package/dist/pack-doctor.js +302 -0
- package/dist/pack-helper-registry.d.ts +29 -0
- package/dist/pack-helper-registry.d.ts.map +1 -0
- package/dist/pack-helper-registry.js +144 -0
- package/dist/pack-pending.d.ts +68 -0
- package/dist/pack-pending.d.ts.map +1 -0
- package/dist/pack-pending.js +189 -0
- package/dist/pack-quality-score.d.ts +44 -0
- package/dist/pack-quality-score.d.ts.map +1 -0
- package/dist/pack-quality-score.js +155 -0
- package/dist/pack-release-check.d.ts +24 -0
- package/dist/pack-release-check.d.ts.map +1 -0
- package/dist/pack-release-check.js +258 -0
- package/dist/pack-signature-status.d.ts +72 -0
- package/dist/pack-signature-status.d.ts.map +1 -0
- package/dist/pack-signature-status.js +222 -0
- package/dist/pack-symbol-compat.d.ts +73 -0
- package/dist/pack-symbol-compat.d.ts.map +1 -0
- package/dist/pack-symbol-compat.js +519 -0
- package/dist/pack-test-runner.d.ts +59 -0
- package/dist/pack-test-runner.d.ts.map +1 -0
- package/dist/pack-test-runner.js +211 -0
- package/dist/pipeline-command-dictionary.d.ts +2 -0
- package/dist/pipeline-command-dictionary.d.ts.map +1 -0
- package/dist/pipeline-command-dictionary.js +20 -0
- package/dist/pipeline-lint.d.ts +30 -0
- package/dist/pipeline-lint.d.ts.map +1 -0
- package/dist/pipeline-lint.js +134 -0
- package/dist/plan-dependency-graph.d.ts +25 -0
- package/dist/plan-dependency-graph.d.ts.map +1 -0
- package/dist/plan-dependency-graph.js +195 -0
- package/dist/plan-review.d.ts +64 -0
- package/dist/plan-review.d.ts.map +1 -0
- package/dist/plan-review.js +242 -0
- package/dist/plan-simulation.d.ts +108 -0
- package/dist/plan-simulation.d.ts.map +1 -0
- package/dist/plan-simulation.js +767 -0
- package/dist/playbook-registry.d.ts +25 -0
- package/dist/playbook-registry.d.ts.map +1 -0
- package/dist/playbook-registry.js +148 -0
- package/dist/playbook-script.d.ts +60 -0
- package/dist/playbook-script.d.ts.map +1 -0
- package/dist/playbook-script.js +161 -0
- package/dist/plugin-lifecycle-profile-registry.d.ts +52 -0
- package/dist/plugin-lifecycle-profile-registry.d.ts.map +1 -0
- package/dist/plugin-lifecycle-profile-registry.js +202 -0
- package/dist/plugin-lifecycle.d.ts +132 -0
- package/dist/plugin-lifecycle.d.ts.map +1 -0
- package/dist/plugin-lifecycle.js +477 -0
- package/dist/policy-engine.d.ts +101 -0
- package/dist/policy-engine.d.ts.map +1 -0
- package/dist/policy-engine.js +321 -0
- package/dist/policy-override-audit.d.ts +18 -0
- package/dist/policy-override-audit.d.ts.map +1 -0
- package/dist/policy-override-audit.js +54 -0
- package/dist/policy-overrides.d.ts +35 -0
- package/dist/policy-overrides.d.ts.map +1 -0
- package/dist/policy-overrides.js +84 -0
- package/dist/policy-test.d.ts +83 -0
- package/dist/policy-test.d.ts.map +1 -0
- package/dist/policy-test.js +342 -0
- package/dist/pr-summary.d.ts +34 -0
- package/dist/pr-summary.d.ts.map +1 -0
- package/dist/pr-summary.js +220 -0
- package/dist/product-coherence.d.ts +21 -0
- package/dist/product-coherence.d.ts.map +1 -0
- package/dist/product-coherence.js +158 -0
- package/dist/profile-registry.d.ts +42 -0
- package/dist/profile-registry.d.ts.map +1 -0
- package/dist/profile-registry.js +104 -0
- package/dist/project-coupling-audit.d.ts +64 -0
- package/dist/project-coupling-audit.d.ts.map +1 -0
- package/dist/project-coupling-audit.js +282 -0
- package/dist/project-overview.d.ts +14 -0
- package/dist/project-overview.d.ts.map +1 -0
- package/dist/project-overview.js +27 -0
- package/dist/propose-knowledge.d.ts +64 -0
- package/dist/propose-knowledge.d.ts.map +1 -0
- package/dist/propose-knowledge.js +367 -0
- package/dist/quality-baseline.d.ts +123 -0
- package/dist/quality-baseline.d.ts.map +1 -0
- package/dist/quality-baseline.js +433 -0
- package/dist/quality-html.d.ts +7 -0
- package/dist/quality-html.d.ts.map +1 -0
- package/dist/quality-html.js +64 -0
- package/dist/quality-report.d.ts +49 -0
- package/dist/quality-report.d.ts.map +1 -0
- package/dist/quality-report.js +296 -0
- package/dist/query-resolver.d.ts +38 -0
- package/dist/query-resolver.d.ts.map +1 -0
- package/dist/query-resolver.js +163 -0
- package/dist/ranker-explainability.d.ts +91 -0
- package/dist/ranker-explainability.d.ts.map +1 -0
- package/dist/ranker-explainability.js +550 -0
- package/dist/reference-lookup.d.ts +8 -0
- package/dist/reference-lookup.d.ts.map +1 -0
- package/dist/reference-lookup.js +18 -0
- package/dist/registration-hint-registry.d.ts +55 -0
- package/dist/registration-hint-registry.d.ts.map +1 -0
- package/dist/registration-hint-registry.js +327 -0
- package/dist/registry-lifecycle.d.ts +47 -0
- package/dist/registry-lifecycle.d.ts.map +1 -0
- package/dist/registry-lifecycle.js +214 -0
- package/dist/release-readiness.d.ts +64 -0
- package/dist/release-readiness.d.ts.map +1 -0
- package/dist/release-readiness.js +456 -0
- package/dist/release-smoke.d.ts +138 -0
- package/dist/release-smoke.d.ts.map +1 -0
- package/dist/release-smoke.js +459 -0
- package/dist/release-train.d.ts +33 -0
- package/dist/release-train.d.ts.map +1 -0
- package/dist/release-train.js +104 -0
- package/dist/repo-memory.d.ts +95 -0
- package/dist/repo-memory.d.ts.map +1 -0
- package/dist/repo-memory.js +614 -0
- package/dist/report-site.d.ts +92 -0
- package/dist/report-site.d.ts.map +1 -0
- package/dist/report-site.js +658 -0
- package/dist/reposet.d.ts +56 -0
- package/dist/reposet.d.ts.map +1 -0
- package/dist/reposet.js +160 -0
- package/dist/repository-intelligence.d.ts +145 -0
- package/dist/repository-intelligence.d.ts.map +1 -0
- package/dist/repository-intelligence.js +729 -0
- package/dist/repository-knowledge-model.d.ts +218 -0
- package/dist/repository-knowledge-model.d.ts.map +1 -0
- package/dist/repository-knowledge-model.js +939 -0
- package/dist/repository-map.d.ts +72 -0
- package/dist/repository-map.d.ts.map +1 -0
- package/dist/repository-map.js +332 -0
- package/dist/repository-stats.d.ts +66 -0
- package/dist/repository-stats.d.ts.map +1 -0
- package/dist/repository-stats.js +329 -0
- package/dist/review-comment-renderer.d.ts +59 -0
- package/dist/review-comment-renderer.d.ts.map +1 -0
- package/dist/review-comment-renderer.js +181 -0
- package/dist/review-comment-v2.d.ts +9 -0
- package/dist/review-comment-v2.d.ts.map +1 -0
- package/dist/review-comment-v2.js +178 -0
- package/dist/review-html.d.ts +13 -0
- package/dist/review-html.d.ts.map +1 -0
- package/dist/review-html.js +79 -0
- package/dist/review-packet-v2.d.ts +29 -0
- package/dist/review-packet-v2.d.ts.map +1 -0
- package/dist/review-packet-v2.js +81 -0
- package/dist/review-packet-v3.d.ts +22 -0
- package/dist/review-packet-v3.d.ts.map +1 -0
- package/dist/review-packet-v3.js +181 -0
- package/dist/review-packet.d.ts +49 -0
- package/dist/review-packet.d.ts.map +1 -0
- package/dist/review-packet.js +129 -0
- package/dist/risk-signals.d.ts +28 -0
- package/dist/risk-signals.d.ts.map +1 -0
- package/dist/risk-signals.js +68 -0
- package/dist/role-views.d.ts +50 -0
- package/dist/role-views.d.ts.map +1 -0
- package/dist/role-views.js +334 -0
- package/dist/rounds.d.ts +52 -0
- package/dist/rounds.d.ts.map +1 -0
- package/dist/rounds.js +172 -0
- package/dist/rule-drift.d.ts +42 -0
- package/dist/rule-drift.d.ts.map +1 -0
- package/dist/rule-drift.js +148 -0
- package/dist/rule-quality.d.ts +73 -0
- package/dist/rule-quality.d.ts.map +1 -0
- package/dist/rule-quality.js +356 -0
- package/dist/rule-scaffold.d.ts +71 -0
- package/dist/rule-scaffold.d.ts.map +1 -0
- package/dist/rule-scaffold.js +258 -0
- package/dist/safety-audit-deep.d.ts +38 -0
- package/dist/safety-audit-deep.d.ts.map +1 -0
- package/dist/safety-audit-deep.js +162 -0
- package/dist/safety-audit.d.ts +91 -0
- package/dist/safety-audit.d.ts.map +1 -0
- package/dist/safety-audit.js +138 -0
- package/dist/safety-html.d.ts +7 -0
- package/dist/safety-html.d.ts.map +1 -0
- package/dist/safety-html.js +70 -0
- package/dist/scaffold-coverage.d.ts +46 -0
- package/dist/scaffold-coverage.d.ts.map +1 -0
- package/dist/scaffold-coverage.js +273 -0
- package/dist/scaffold-patterns.d.ts +38 -0
- package/dist/scaffold-patterns.d.ts.map +1 -0
- package/dist/scaffold-patterns.js +282 -0
- package/dist/schema-inventory.d.ts +55 -0
- package/dist/schema-inventory.d.ts.map +1 -0
- package/dist/schema-inventory.js +301 -0
- package/dist/search-index.d.ts +75 -0
- package/dist/search-index.d.ts.map +1 -0
- package/dist/search-index.js +531 -0
- package/dist/search-tuning-explain.d.ts +68 -0
- package/dist/search-tuning-explain.d.ts.map +1 -0
- package/dist/search-tuning-explain.js +207 -0
- package/dist/search-tuning-registry.d.ts +54 -0
- package/dist/search-tuning-registry.d.ts.map +1 -0
- package/dist/search-tuning-registry.js +303 -0
- package/dist/self-audit.d.ts +59 -0
- package/dist/self-audit.d.ts.map +1 -0
- package/dist/self-audit.js +192 -0
- package/dist/self-config-doctor-v2.d.ts +57 -0
- package/dist/self-config-doctor-v2.d.ts.map +1 -0
- package/dist/self-config-doctor-v2.js +653 -0
- package/dist/self-config-doctor.d.ts +47 -0
- package/dist/self-config-doctor.d.ts.map +1 -0
- package/dist/self-config-doctor.js +432 -0
- package/dist/sharkcraft-inspector.d.ts +73 -0
- package/dist/sharkcraft-inspector.d.ts.map +1 -0
- package/dist/sharkcraft-inspector.js +745 -0
- package/dist/spec/spec-cross-validate.d.ts +17 -0
- package/dist/spec/spec-cross-validate.d.ts.map +1 -0
- package/dist/spec/spec-cross-validate.js +53 -0
- package/dist/spec/spec-discovery.d.ts +27 -0
- package/dist/spec/spec-discovery.d.ts.map +1 -0
- package/dist/spec/spec-discovery.js +78 -0
- package/dist/spec/spec-review.d.ts +36 -0
- package/dist/spec/spec-review.d.ts.map +1 -0
- package/dist/spec/spec-review.js +37 -0
- package/dist/stability-map.d.ts +62 -0
- package/dist/stability-map.d.ts.map +1 -0
- package/dist/stability-map.js +404 -0
- package/dist/start-here.d.ts +49 -0
- package/dist/start-here.d.ts.map +1 -0
- package/dist/start-here.js +259 -0
- package/dist/surface-profile-detect.d.ts +42 -0
- package/dist/surface-profile-detect.d.ts.map +1 -0
- package/dist/surface-profile-detect.js +76 -0
- package/dist/symbol-index.d.ts +108 -0
- package/dist/symbol-index.d.ts.map +1 -0
- package/dist/symbol-index.js +483 -0
- package/dist/task-decompose.d.ts +38 -0
- package/dist/task-decompose.d.ts.map +1 -0
- package/dist/task-decompose.js +154 -0
- package/dist/task-packet.d.ts +104 -0
- package/dist/task-packet.d.ts.map +1 -0
- package/dist/task-packet.js +156 -0
- package/dist/task-ranker.d.ts +51 -0
- package/dist/task-ranker.d.ts.map +1 -0
- package/dist/task-ranker.js +410 -0
- package/dist/task-risk.d.ts +84 -0
- package/dist/task-risk.d.ts.map +1 -0
- package/dist/task-risk.js +731 -0
- package/dist/task-routing-hint-registry.d.ts +36 -0
- package/dist/task-routing-hint-registry.d.ts.map +1 -0
- package/dist/task-routing-hint-registry.js +186 -0
- package/dist/template-authoring.d.ts +113 -0
- package/dist/template-authoring.d.ts.map +1 -0
- package/dist/template-authoring.js +521 -0
- package/dist/template-body-inference-v2.d.ts +19 -0
- package/dist/template-body-inference-v2.d.ts.map +1 -0
- package/dist/template-body-inference-v2.js +468 -0
- package/dist/template-body-inference.d.ts +59 -0
- package/dist/template-body-inference.d.ts.map +1 -0
- package/dist/template-body-inference.js +277 -0
- package/dist/template-drift.d.ts +39 -0
- package/dist/template-drift.d.ts.map +1 -0
- package/dist/template-drift.js +353 -0
- package/dist/template-lint.d.ts +31 -0
- package/dist/template-lint.d.ts.map +1 -0
- package/dist/template-lint.js +113 -0
- package/dist/test-definitions.d.ts +41 -0
- package/dist/test-definitions.d.ts.map +1 -0
- package/dist/test-definitions.js +6 -0
- package/dist/test-impact.d.ts +30 -0
- package/dist/test-impact.d.ts.map +1 -0
- package/dist/test-impact.js +173 -0
- package/dist/test-runner.d.ts +87 -0
- package/dist/test-runner.d.ts.map +1 -0
- package/dist/test-runner.js +560 -0
- package/dist/uncertainty-report.d.ts +46 -0
- package/dist/uncertainty-report.d.ts.map +1 -0
- package/dist/uncertainty-report.js +108 -0
- package/dist/uncertainty.d.ts +38 -0
- package/dist/uncertainty.d.ts.map +1 -0
- package/dist/uncertainty.js +115 -0
- package/dist/universal-search.d.ts +64 -0
- package/dist/universal-search.d.ts.map +1 -0
- package/dist/universal-search.js +347 -0
- package/dist/upgrade-advisor.d.ts +22 -0
- package/dist/upgrade-advisor.d.ts.map +1 -0
- package/dist/upgrade-advisor.js +109 -0
- package/dist/why-file.d.ts +75 -0
- package/dist/why-file.d.ts.map +1 -0
- package/dist/why-file.js +202 -0
- package/dist/workflow-simulation.d.ts +46 -0
- package/dist/workflow-simulation.d.ts.map +1 -0
- package/dist/workflow-simulation.js +154 -0
- package/package.json +65 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
export declare const IMPORT_HYGIENE_SCHEMA = "sharkcraft.import-hygiene/v1";
|
|
2
|
+
export declare enum ImportHygieneFindingKind {
|
|
3
|
+
InlineTypeImport = "inline-type-import",
|
|
4
|
+
RuntimeRequire = "runtime-require",
|
|
5
|
+
DynamicImport = "dynamic-import"
|
|
6
|
+
}
|
|
7
|
+
export type ImportHygieneSeverity = 'info' | 'warning' | 'error';
|
|
8
|
+
export interface IImportHygieneFinding {
|
|
9
|
+
readonly file: string;
|
|
10
|
+
readonly line: number;
|
|
11
|
+
readonly column?: number;
|
|
12
|
+
readonly kind: ImportHygieneFindingKind;
|
|
13
|
+
readonly severity: ImportHygieneSeverity;
|
|
14
|
+
readonly snippet: string;
|
|
15
|
+
readonly suggestedFix: string;
|
|
16
|
+
readonly allowlisted: boolean;
|
|
17
|
+
readonly reason?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface IImportHygieneReport {
|
|
20
|
+
readonly schema: typeof IMPORT_HYGIENE_SCHEMA;
|
|
21
|
+
readonly generatedAt: string;
|
|
22
|
+
readonly projectRoot: string;
|
|
23
|
+
readonly findings: readonly IImportHygieneFinding[];
|
|
24
|
+
readonly counts: Readonly<Record<string, number>>;
|
|
25
|
+
readonly verdict: 'ok' | 'warnings' | 'errors';
|
|
26
|
+
readonly nextCommand: string;
|
|
27
|
+
}
|
|
28
|
+
export interface IImportHygieneOptions {
|
|
29
|
+
/** Restrict scan to a set of relative file paths (e.g. changed files). */
|
|
30
|
+
readonly files?: readonly string[];
|
|
31
|
+
/** Roots to scan; defaults to `packages/*\/src`. */
|
|
32
|
+
readonly roots?: readonly string[];
|
|
33
|
+
/** Skip allowlist loading; useful for tests. */
|
|
34
|
+
readonly skipAllowlist?: boolean;
|
|
35
|
+
/** Path to the allowlist JSON; defaults to `sharkcraft/import-hygiene.allowlist.json`. */
|
|
36
|
+
readonly allowlistFile?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Strict mode: treat allowlist entries with TODO-shaped reasons as
|
|
39
|
+
* un-allowlisted. The finding then keeps its original severity instead of
|
|
40
|
+
* being downgraded to info.
|
|
41
|
+
*/
|
|
42
|
+
readonly strictAllowlistReasons?: boolean;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Sentinel value used by the draft-allowlist generator for the
|
|
46
|
+
* `reason` field. A human is expected to replace this with a real
|
|
47
|
+
* justification before the entry is allowed to suppress a finding.
|
|
48
|
+
*/
|
|
49
|
+
export declare const ALLOWLIST_TODO_REASON_PREFIX = "TODO:";
|
|
50
|
+
export declare function isTodoReason(reason: string | undefined | null): boolean;
|
|
51
|
+
export interface IAllowlistEntry {
|
|
52
|
+
/** Relative file path. */
|
|
53
|
+
readonly path: string;
|
|
54
|
+
/** Optional: restrict to specific finding kind. */
|
|
55
|
+
readonly kind?: ImportHygieneFindingKind;
|
|
56
|
+
/** Free-form reason — required. */
|
|
57
|
+
readonly reason: string;
|
|
58
|
+
/** Optional ISO date after which this allowlist entry should be re-evaluated. */
|
|
59
|
+
readonly expiresAt?: string;
|
|
60
|
+
}
|
|
61
|
+
export declare function buildImportHygieneReport(projectRoot: string, options?: IImportHygieneOptions): IImportHygieneReport;
|
|
62
|
+
export interface IImportHygieneAllowlistDraft {
|
|
63
|
+
readonly schema: 'sharkcraft.import-hygiene-allowlist/v1';
|
|
64
|
+
readonly comment: string;
|
|
65
|
+
readonly allow: ReadonlyArray<IAllowlistEntry>;
|
|
66
|
+
}
|
|
67
|
+
export interface IEmitAllowlistOptions {
|
|
68
|
+
/**
|
|
69
|
+
* Restrict the emitted draft to a specific finding kind. Defaults to
|
|
70
|
+
* `dynamic-import` — runtime requires and inline type imports require
|
|
71
|
+
* deliberate justification per case and should never be batched.
|
|
72
|
+
*/
|
|
73
|
+
readonly kind?: ImportHygieneFindingKind | 'all';
|
|
74
|
+
/** Skip entries that already appear in the loaded allowlist. */
|
|
75
|
+
readonly skipExisting?: boolean;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Build a draft allowlist JSON from the current report. Each candidate
|
|
79
|
+
* gets a `TODO:` reason placeholder so the operator MUST fill in real
|
|
80
|
+
* justification before strict mode will accept it.
|
|
81
|
+
*
|
|
82
|
+
* Behaviour:
|
|
83
|
+
* - Only findings that are NOT already allowlisted are emitted (unless
|
|
84
|
+
* `skipExisting=false`).
|
|
85
|
+
* - For `dynamic-import`, entries are batched by path so a single CLI
|
|
86
|
+
* boundary file collapses to one entry instead of N.
|
|
87
|
+
* - `runtime-require` and `inline-type-import` are NOT included by default
|
|
88
|
+
* and must be opted-in via `kind=all` or the specific kind — those
|
|
89
|
+
* patterns require per-case justification.
|
|
90
|
+
*/
|
|
91
|
+
export declare function emitImportHygieneAllowlistDraft(report: IImportHygieneReport, options?: IEmitAllowlistOptions): IImportHygieneAllowlistDraft;
|
|
92
|
+
export declare function renderImportHygieneText(report: IImportHygieneReport): string;
|
|
93
|
+
//# sourceMappingURL=import-hygiene.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import-hygiene.d.ts","sourceRoot":"","sources":["../src/import-hygiene.ts"],"names":[],"mappings":"AAsBA,eAAO,MAAM,qBAAqB,iCAAiC,CAAC;AAEpE,oBAAY,wBAAwB;IAClC,gBAAgB,uBAAuB;IACvC,cAAc,oBAAoB;IAClC,aAAa,mBAAmB;CACjC;AAED,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;AAEjE,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,wBAAwB,CAAC;IACxC,QAAQ,CAAC,QAAQ,EAAE,qBAAqB,CAAC;IACzC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,MAAM,EAAE,OAAO,qBAAqB,CAAC;IAC9C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,SAAS,qBAAqB,EAAE,CAAC;IACpD,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAClD,QAAQ,CAAC,OAAO,EAAE,IAAI,GAAG,UAAU,GAAG,QAAQ,CAAC;IAC/C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,qBAAqB;IACpC,0EAA0E;IAC1E,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,oDAAoD;IACpD,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,gDAAgD;IAChD,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IACjC,0FAA0F;IAC1F,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC;;;;OAIG;IACH,QAAQ,CAAC,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAC3C;AAED;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,UAAU,CAAC;AAEpD,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,OAAO,CAKvE;AAED,MAAM,WAAW,eAAe;IAC9B,0BAA0B;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,mDAAmD;IACnD,QAAQ,CAAC,IAAI,CAAC,EAAE,wBAAwB,CAAC;IACzC,mCAAmC;IACnC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,iFAAiF;IACjF,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAwOD,wBAAgB,wBAAwB,CACtC,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,qBAA0B,GAClC,oBAAoB,CAwCtB;AAID,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,MAAM,EAAE,wCAAwC,CAAC;IAC1D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,eAAe,CAAC,CAAC;CAChD;AAED,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,wBAAwB,GAAG,KAAK,CAAC;IACjD,gEAAgE;IAChE,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;CACjC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,oBAAoB,EAC5B,OAAO,GAAE,qBAA0B,GAClC,4BAA4B,CAyB9B;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,oBAAoB,GAAG,MAAM,CAiB5E"}
|
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Import hygiene checker.
|
|
3
|
+
*
|
|
4
|
+
* Detects bad import patterns that hide module dependencies or invent
|
|
5
|
+
* cycles where none exist:
|
|
6
|
+
*
|
|
7
|
+
* - inline-type-import: `import('./x').Type` used as a type annotation.
|
|
8
|
+
* - runtime-require: `require('./x')` inside a normal TS/TSX source.
|
|
9
|
+
* - dynamic-import: `await import('./x')` or `import('./x')` used
|
|
10
|
+
* as a runtime escape hatch in normal engine
|
|
11
|
+
* source. Allowlisted entries (e.g. legitimate
|
|
12
|
+
* lazy-load boundaries between CLI subcommand
|
|
13
|
+
* modules) opt out via
|
|
14
|
+
* `sharkcraft/import-hygiene.allowlist.json`.
|
|
15
|
+
*
|
|
16
|
+
* Read-only: scans source files; never writes.
|
|
17
|
+
*
|
|
18
|
+
* Schema: sharkcraft.import-hygiene/v1
|
|
19
|
+
*/
|
|
20
|
+
import { existsSync, readFileSync, readdirSync, statSync } from 'node:fs';
|
|
21
|
+
import * as nodePath from 'node:path';
|
|
22
|
+
export const IMPORT_HYGIENE_SCHEMA = 'sharkcraft.import-hygiene/v1';
|
|
23
|
+
export var ImportHygieneFindingKind;
|
|
24
|
+
(function (ImportHygieneFindingKind) {
|
|
25
|
+
ImportHygieneFindingKind["InlineTypeImport"] = "inline-type-import";
|
|
26
|
+
ImportHygieneFindingKind["RuntimeRequire"] = "runtime-require";
|
|
27
|
+
ImportHygieneFindingKind["DynamicImport"] = "dynamic-import";
|
|
28
|
+
})(ImportHygieneFindingKind || (ImportHygieneFindingKind = {}));
|
|
29
|
+
/**
|
|
30
|
+
* Sentinel value used by the draft-allowlist generator for the
|
|
31
|
+
* `reason` field. A human is expected to replace this with a real
|
|
32
|
+
* justification before the entry is allowed to suppress a finding.
|
|
33
|
+
*/
|
|
34
|
+
export const ALLOWLIST_TODO_REASON_PREFIX = 'TODO:';
|
|
35
|
+
export function isTodoReason(reason) {
|
|
36
|
+
if (!reason)
|
|
37
|
+
return true;
|
|
38
|
+
const trimmed = reason.trim();
|
|
39
|
+
if (trimmed.length === 0)
|
|
40
|
+
return true;
|
|
41
|
+
return trimmed.toUpperCase().startsWith('TODO');
|
|
42
|
+
}
|
|
43
|
+
const INLINE_TYPE_RE = /import\s*\(\s*['"][^'"]+['"]\s*\)\s*\./g;
|
|
44
|
+
const RUNTIME_REQUIRE_RE = /\brequire\s*\(\s*['"][^'"]+['"]\s*\)/g;
|
|
45
|
+
const DYNAMIC_IMPORT_RE = /(?:^|[^.\w])(?:await\s+)?import\s*\(\s*['"][^'"]+['"]\s*\)/g;
|
|
46
|
+
/** Type-only `typeof import('x')` is a TS type expression — never a runtime call. */
|
|
47
|
+
const TYPEOF_IMPORT_PREFIX = /typeof\s+$/;
|
|
48
|
+
function loadAllowlist(projectRoot, allowlistFile) {
|
|
49
|
+
const path = allowlistFile
|
|
50
|
+
? (nodePath.isAbsolute(allowlistFile) ? allowlistFile : nodePath.join(projectRoot, allowlistFile))
|
|
51
|
+
: nodePath.join(projectRoot, 'sharkcraft', 'import-hygiene.allowlist.json');
|
|
52
|
+
if (!existsSync(path))
|
|
53
|
+
return [];
|
|
54
|
+
try {
|
|
55
|
+
const raw = readFileSync(path, 'utf8');
|
|
56
|
+
const json = JSON.parse(raw);
|
|
57
|
+
return json.allow ?? [];
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
return [];
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
function listSourceFiles(root) {
|
|
64
|
+
const out = [];
|
|
65
|
+
function walk(dir) {
|
|
66
|
+
let entries = [];
|
|
67
|
+
try {
|
|
68
|
+
entries = readdirSync(dir, { withFileTypes: true });
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
for (const e of entries) {
|
|
74
|
+
const name = String(e.name);
|
|
75
|
+
if (name === 'node_modules' || name === 'dist' || name === '.sharkcraft')
|
|
76
|
+
continue;
|
|
77
|
+
const abs = nodePath.join(dir, name);
|
|
78
|
+
if (e.isDirectory())
|
|
79
|
+
walk(abs);
|
|
80
|
+
else if (e.isFile()) {
|
|
81
|
+
if (/\.(ts|tsx)$/.test(name) && !/\.d\.ts$/.test(name))
|
|
82
|
+
out.push(abs);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
if (existsSync(root) && statSync(root).isDirectory())
|
|
87
|
+
walk(root);
|
|
88
|
+
return out;
|
|
89
|
+
}
|
|
90
|
+
function scanFile(projectRoot, absFile, allowlist, strictReasons = false) {
|
|
91
|
+
const findings = [];
|
|
92
|
+
let rawContent;
|
|
93
|
+
try {
|
|
94
|
+
rawContent = readFileSync(absFile, 'utf8');
|
|
95
|
+
}
|
|
96
|
+
catch {
|
|
97
|
+
return findings;
|
|
98
|
+
}
|
|
99
|
+
const relFile = nodePath.relative(projectRoot, absFile);
|
|
100
|
+
const lines = rawContent.split('\n');
|
|
101
|
+
// Strip block and line comments before regex scanning so the checker
|
|
102
|
+
// doesn't false-positive on docstrings / inline comments. Replace each
|
|
103
|
+
// comment character with a space so line/column offsets stay accurate.
|
|
104
|
+
const content = stripCommentsPreservingOffsets(rawContent);
|
|
105
|
+
function lineColOf(idx) {
|
|
106
|
+
let line = 1;
|
|
107
|
+
let lineStart = 0;
|
|
108
|
+
for (let i = 0; i < idx; i++) {
|
|
109
|
+
if (content[i] === '\n') {
|
|
110
|
+
line += 1;
|
|
111
|
+
lineStart = i + 1;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return { line, column: idx - lineStart + 1 };
|
|
115
|
+
}
|
|
116
|
+
function isAllowed(kind) {
|
|
117
|
+
return allowlist.find((a) => a.path === relFile && (a.kind === undefined || a.kind === kind));
|
|
118
|
+
}
|
|
119
|
+
function record(kind, idx, severity) {
|
|
120
|
+
const allowed = isAllowed(kind);
|
|
121
|
+
// In strict mode, allowlist entries with empty/TODO reasons do NOT
|
|
122
|
+
// suppress findings. The entry is still surfaced (allowlisted=true,
|
|
123
|
+
// reasonAccepted=false) so the operator can see what needs explaining.
|
|
124
|
+
const reasonAccepted = allowed ? !isTodoReason(allowed.reason) : false;
|
|
125
|
+
const effectiveAllowed = allowed && (!strictReasons || reasonAccepted);
|
|
126
|
+
const { line, column } = lineColOf(idx);
|
|
127
|
+
const snippet = (lines[line - 1] ?? '').trim().slice(0, 200);
|
|
128
|
+
let suggestedFix = '';
|
|
129
|
+
switch (kind) {
|
|
130
|
+
case ImportHygieneFindingKind.InlineTypeImport:
|
|
131
|
+
suggestedFix = `Replace with a top-level \`import type { ... } from './...';\` statement.`;
|
|
132
|
+
break;
|
|
133
|
+
case ImportHygieneFindingKind.RuntimeRequire:
|
|
134
|
+
suggestedFix = `Replace with a top-level \`import { ... } from '...';\`. Node built-ins gain nothing from lazy require (they're already in memory); for real circular dependencies, extract the shared types into a neutral lower-level module instead of hiding the cycle.`;
|
|
135
|
+
break;
|
|
136
|
+
case ImportHygieneFindingKind.DynamicImport:
|
|
137
|
+
suggestedFix = effectiveAllowed
|
|
138
|
+
? `Allowlisted as intentional lazy-load.`
|
|
139
|
+
: allowed && !reasonAccepted
|
|
140
|
+
? `Allowlist entry has a TODO/empty reason — replace it with a real justification or remove the entry.`
|
|
141
|
+
: `Convert to a top-level import; if this is intentional code-splitting, add an allowlist entry with a justification.`;
|
|
142
|
+
break;
|
|
143
|
+
}
|
|
144
|
+
findings.push({
|
|
145
|
+
file: relFile,
|
|
146
|
+
line,
|
|
147
|
+
column,
|
|
148
|
+
kind,
|
|
149
|
+
severity: effectiveAllowed ? 'info' : severity,
|
|
150
|
+
snippet,
|
|
151
|
+
suggestedFix,
|
|
152
|
+
allowlisted: allowed !== undefined,
|
|
153
|
+
...(allowed?.reason ? { reason: allowed.reason } : {}),
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
// 1) Inline type imports: `import('./...').Type`.
|
|
157
|
+
INLINE_TYPE_RE.lastIndex = 0;
|
|
158
|
+
let m;
|
|
159
|
+
while ((m = INLINE_TYPE_RE.exec(content)) !== null) {
|
|
160
|
+
record(ImportHygieneFindingKind.InlineTypeImport, m.index, 'error');
|
|
161
|
+
}
|
|
162
|
+
// 2) Runtime `require(...)`.
|
|
163
|
+
// Always `error`. Node built-ins (`node:fs`, `node:path`, …) are
|
|
164
|
+
// already resolved before any user code runs — there is no lazy-load
|
|
165
|
+
// benefit, and `require('node:fs') as typeof import('node:fs')` is
|
|
166
|
+
// a hack to satisfy strict TS where a top-level `import` would have
|
|
167
|
+
// typed the call for free. Cross-module requires are even worse —
|
|
168
|
+
// they hide dependencies from static analysis. Use the allowlist
|
|
169
|
+
// (with a documented `reason`) for the rare legitimate case.
|
|
170
|
+
RUNTIME_REQUIRE_RE.lastIndex = 0;
|
|
171
|
+
while ((m = RUNTIME_REQUIRE_RE.exec(content)) !== null) {
|
|
172
|
+
record(ImportHygieneFindingKind.RuntimeRequire, m.index, 'error');
|
|
173
|
+
}
|
|
174
|
+
// 3) Dynamic `import(...)` / `await import(...)`.
|
|
175
|
+
DYNAMIC_IMPORT_RE.lastIndex = 0;
|
|
176
|
+
while ((m = DYNAMIC_IMPORT_RE.exec(content)) !== null) {
|
|
177
|
+
// Skip the inline-type-import case (already recorded by INLINE_TYPE_RE).
|
|
178
|
+
const after = content.slice(m.index + m[0].length, m.index + m[0].length + 2);
|
|
179
|
+
if (after.startsWith('.'))
|
|
180
|
+
continue;
|
|
181
|
+
// Skip TS type-only `typeof import('x')` — it's a type expression.
|
|
182
|
+
const before = content.slice(Math.max(0, m.index - 16), m.index + (m[0][0] === 'i' ? 0 : 1));
|
|
183
|
+
if (TYPEOF_IMPORT_PREFIX.test(before))
|
|
184
|
+
continue;
|
|
185
|
+
record(ImportHygieneFindingKind.DynamicImport, m.index, 'warning');
|
|
186
|
+
}
|
|
187
|
+
return findings;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Replace comment characters with spaces so regex scans don't false-positive
|
|
191
|
+
* on docstrings / inline comments. Strings are SKIPPED (their contents are
|
|
192
|
+
* preserved verbatim) so we can still extract the module specifier from a
|
|
193
|
+
* `require('x')` call after this pass. Line and column offsets stay accurate
|
|
194
|
+
* because every replacement is character-for-character.
|
|
195
|
+
*/
|
|
196
|
+
function stripCommentsPreservingOffsets(source) {
|
|
197
|
+
const buf = [];
|
|
198
|
+
let i = 0;
|
|
199
|
+
while (i < source.length) {
|
|
200
|
+
const ch = source[i];
|
|
201
|
+
const next = source[i + 1];
|
|
202
|
+
// Block comment.
|
|
203
|
+
if (ch === '/' && next === '*') {
|
|
204
|
+
buf.push(' ');
|
|
205
|
+
i += 2;
|
|
206
|
+
while (i < source.length) {
|
|
207
|
+
const c = source[i];
|
|
208
|
+
const n = source[i + 1];
|
|
209
|
+
if (c === '*' && n === '/') {
|
|
210
|
+
buf.push(' ');
|
|
211
|
+
i += 2;
|
|
212
|
+
break;
|
|
213
|
+
}
|
|
214
|
+
buf.push(c === '\n' ? '\n' : ' ');
|
|
215
|
+
i += 1;
|
|
216
|
+
}
|
|
217
|
+
continue;
|
|
218
|
+
}
|
|
219
|
+
// Line comment.
|
|
220
|
+
if (ch === '/' && next === '/') {
|
|
221
|
+
while (i < source.length && source[i] !== '\n') {
|
|
222
|
+
buf.push(' ');
|
|
223
|
+
i += 1;
|
|
224
|
+
}
|
|
225
|
+
continue;
|
|
226
|
+
}
|
|
227
|
+
// String literal — preserve contents verbatim. We do walk through it
|
|
228
|
+
// so that comment delimiters inside strings (e.g. `"//"` as data) don't
|
|
229
|
+
// start a fake comment.
|
|
230
|
+
if (ch === '"' || ch === '\'' || ch === '`') {
|
|
231
|
+
const quote = ch;
|
|
232
|
+
buf.push(ch);
|
|
233
|
+
i += 1;
|
|
234
|
+
while (i < source.length) {
|
|
235
|
+
const c = source[i] ?? '';
|
|
236
|
+
if (c === '\\' && i + 1 < source.length) {
|
|
237
|
+
buf.push(c);
|
|
238
|
+
buf.push(source[i + 1] ?? '');
|
|
239
|
+
i += 2;
|
|
240
|
+
continue;
|
|
241
|
+
}
|
|
242
|
+
buf.push(c);
|
|
243
|
+
i += 1;
|
|
244
|
+
if (c === quote)
|
|
245
|
+
break;
|
|
246
|
+
}
|
|
247
|
+
continue;
|
|
248
|
+
}
|
|
249
|
+
buf.push(ch ?? '');
|
|
250
|
+
i += 1;
|
|
251
|
+
}
|
|
252
|
+
return buf.join('');
|
|
253
|
+
}
|
|
254
|
+
function defaultRoots(projectRoot) {
|
|
255
|
+
const pkgsDir = nodePath.join(projectRoot, 'packages');
|
|
256
|
+
if (!existsSync(pkgsDir))
|
|
257
|
+
return [projectRoot];
|
|
258
|
+
const out = [];
|
|
259
|
+
for (const name of readdirSync(pkgsDir)) {
|
|
260
|
+
const src = nodePath.join(pkgsDir, name, 'src');
|
|
261
|
+
if (existsSync(src) && statSync(src).isDirectory())
|
|
262
|
+
out.push(src);
|
|
263
|
+
}
|
|
264
|
+
return out;
|
|
265
|
+
}
|
|
266
|
+
export function buildImportHygieneReport(projectRoot, options = {}) {
|
|
267
|
+
const allowlist = options.skipAllowlist
|
|
268
|
+
? []
|
|
269
|
+
: loadAllowlist(projectRoot, options.allowlistFile);
|
|
270
|
+
const roots = options.roots ?? defaultRoots(projectRoot);
|
|
271
|
+
let scanned;
|
|
272
|
+
if (options.files && options.files.length > 0) {
|
|
273
|
+
scanned = options.files
|
|
274
|
+
.map((f) => (nodePath.isAbsolute(f) ? f : nodePath.join(projectRoot, f)))
|
|
275
|
+
.filter((f) => existsSync(f) && /\.(ts|tsx)$/.test(f) && !/\.d\.ts$/.test(f));
|
|
276
|
+
}
|
|
277
|
+
else {
|
|
278
|
+
scanned = roots.flatMap(listSourceFiles).filter((f) => !/__tests__|\/__fixtures__/.test(f));
|
|
279
|
+
}
|
|
280
|
+
const findings = [];
|
|
281
|
+
const strictReasons = options.strictAllowlistReasons === true;
|
|
282
|
+
for (const f of scanned)
|
|
283
|
+
findings.push(...scanFile(projectRoot, f, allowlist, strictReasons));
|
|
284
|
+
const counts = { total: findings.length };
|
|
285
|
+
for (const f of findings) {
|
|
286
|
+
counts[f.kind] = (counts[f.kind] ?? 0) + 1;
|
|
287
|
+
counts[f.severity] = (counts[f.severity] ?? 0) + 1;
|
|
288
|
+
}
|
|
289
|
+
const errorCount = counts['error'] ?? 0;
|
|
290
|
+
const warnCount = counts['warning'] ?? 0;
|
|
291
|
+
const verdict = errorCount > 0 ? 'errors' : warnCount > 0 ? 'warnings' : 'ok';
|
|
292
|
+
return {
|
|
293
|
+
schema: IMPORT_HYGIENE_SCHEMA,
|
|
294
|
+
generatedAt: new Date().toISOString(),
|
|
295
|
+
projectRoot,
|
|
296
|
+
findings,
|
|
297
|
+
counts,
|
|
298
|
+
verdict,
|
|
299
|
+
nextCommand: verdict === 'errors'
|
|
300
|
+
? 'Replace inline imports and runtime requires with top-level ESM imports.'
|
|
301
|
+
: verdict === 'warnings'
|
|
302
|
+
? 'Review dynamic imports; allowlist legitimate lazy-load boundaries with a reason.'
|
|
303
|
+
: 'shrk check imports --changed-only',
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Build a draft allowlist JSON from the current report. Each candidate
|
|
308
|
+
* gets a `TODO:` reason placeholder so the operator MUST fill in real
|
|
309
|
+
* justification before strict mode will accept it.
|
|
310
|
+
*
|
|
311
|
+
* Behaviour:
|
|
312
|
+
* - Only findings that are NOT already allowlisted are emitted (unless
|
|
313
|
+
* `skipExisting=false`).
|
|
314
|
+
* - For `dynamic-import`, entries are batched by path so a single CLI
|
|
315
|
+
* boundary file collapses to one entry instead of N.
|
|
316
|
+
* - `runtime-require` and `inline-type-import` are NOT included by default
|
|
317
|
+
* and must be opted-in via `kind=all` or the specific kind — those
|
|
318
|
+
* patterns require per-case justification.
|
|
319
|
+
*/
|
|
320
|
+
export function emitImportHygieneAllowlistDraft(report, options = {}) {
|
|
321
|
+
const allowKind = options.kind ?? ImportHygieneFindingKind.DynamicImport;
|
|
322
|
+
const wantKind = (k) => allowKind === 'all' || allowKind === k;
|
|
323
|
+
// Group: path|kind → reason placeholder.
|
|
324
|
+
const seen = new Map();
|
|
325
|
+
for (const f of report.findings) {
|
|
326
|
+
if (!wantKind(f.kind))
|
|
327
|
+
continue;
|
|
328
|
+
if (options.skipExisting !== false && f.allowlisted)
|
|
329
|
+
continue;
|
|
330
|
+
const key = `${f.file}|${f.kind}`;
|
|
331
|
+
if (seen.has(key))
|
|
332
|
+
continue;
|
|
333
|
+
const placeholder = `${ALLOWLIST_TODO_REASON_PREFIX} explain why this ${f.kind} is intentional (added by shrk check imports --emit-allowlist)`;
|
|
334
|
+
seen.set(key, { path: f.file, kind: f.kind, reason: placeholder });
|
|
335
|
+
}
|
|
336
|
+
// Sort deterministically.
|
|
337
|
+
const entries = [...seen.values()].sort((a, b) => {
|
|
338
|
+
if (a.path !== b.path)
|
|
339
|
+
return a.path.localeCompare(b.path);
|
|
340
|
+
return (a.kind ?? '').localeCompare(b.kind ?? '');
|
|
341
|
+
});
|
|
342
|
+
return {
|
|
343
|
+
schema: 'sharkcraft.import-hygiene-allowlist/v1',
|
|
344
|
+
comment: 'Allowlist for legitimate dynamic imports. Each entry must carry a non-TODO reason. The checker downgrades these from warning to info; strict mode (--fail-on-unexplained-allowlist) rejects entries whose reason is still a TODO placeholder.',
|
|
345
|
+
allow: entries,
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
export function renderImportHygieneText(report) {
|
|
349
|
+
const lines = [];
|
|
350
|
+
lines.push(`=== Import hygiene (${report.verdict.toUpperCase()}) ===`);
|
|
351
|
+
lines.push(` scanned files (with findings) ${new Set(report.findings.map((f) => f.file)).size}`);
|
|
352
|
+
lines.push(` errors ${report.counts['error'] ?? 0}`);
|
|
353
|
+
lines.push(` warnings ${report.counts['warning'] ?? 0}`);
|
|
354
|
+
lines.push(` info ${report.counts['info'] ?? 0}`);
|
|
355
|
+
lines.push('');
|
|
356
|
+
for (const f of report.findings) {
|
|
357
|
+
const tag = f.allowlisted ? '[allowlisted]' : `[${f.severity}]`;
|
|
358
|
+
lines.push(` ${tag} ${f.file}:${f.line}:${f.column ?? 0} ${f.kind}`);
|
|
359
|
+
lines.push(` ${f.snippet}`);
|
|
360
|
+
if (!f.allowlisted)
|
|
361
|
+
lines.push(` fix: ${f.suggestedFix}`);
|
|
362
|
+
}
|
|
363
|
+
lines.push('');
|
|
364
|
+
lines.push(`Next: ${report.nextCommand}`);
|
|
365
|
+
return lines.join('\n') + '\n';
|
|
366
|
+
}
|