@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,329 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Repository statistics — per-language file counts, bytes, line totals,
|
|
3
|
+
* code/comment/blank line breakdowns, averages, and the top-N largest
|
|
4
|
+
* files in the workspace.
|
|
5
|
+
*
|
|
6
|
+
* Deterministic and read-only: given the same project, two consecutive
|
|
7
|
+
* calls produce the same output (modulo `generatedAt`).
|
|
8
|
+
*
|
|
9
|
+
* Comment detection is line-prefix based (`//`, `#`, `--`, `<!--`) and
|
|
10
|
+
* tracks the most common single-line and block forms per language. It is
|
|
11
|
+
* intentionally not a real parser — that would couple this module to
|
|
12
|
+
* every language toolchain we support.
|
|
13
|
+
*/
|
|
14
|
+
import { readdirSync, readFileSync, statSync } from 'node:fs';
|
|
15
|
+
import * as nodePath from 'node:path';
|
|
16
|
+
export const REPOSITORY_STATS_SCHEMA = 'sharkcraft.repository-stats/v1';
|
|
17
|
+
const IGNORED_DIR_NAMES = new Set([
|
|
18
|
+
'node_modules',
|
|
19
|
+
'.git',
|
|
20
|
+
'.nx',
|
|
21
|
+
'.sharkcraft',
|
|
22
|
+
'.claude',
|
|
23
|
+
'.idea',
|
|
24
|
+
'.vscode',
|
|
25
|
+
'.next',
|
|
26
|
+
'.nuxt',
|
|
27
|
+
'.svelte-kit',
|
|
28
|
+
'.turbo',
|
|
29
|
+
'dist',
|
|
30
|
+
'build',
|
|
31
|
+
'out',
|
|
32
|
+
'target',
|
|
33
|
+
'bin',
|
|
34
|
+
'obj',
|
|
35
|
+
'__pycache__',
|
|
36
|
+
'.venv',
|
|
37
|
+
'venv',
|
|
38
|
+
'vendor',
|
|
39
|
+
'coverage',
|
|
40
|
+
'.gradle',
|
|
41
|
+
'.mvn',
|
|
42
|
+
]);
|
|
43
|
+
var CommentSyntax;
|
|
44
|
+
(function (CommentSyntax) {
|
|
45
|
+
CommentSyntax["CFamily"] = "c-family";
|
|
46
|
+
CommentSyntax["Hash"] = "hash";
|
|
47
|
+
CommentSyntax["Html"] = "html";
|
|
48
|
+
CommentSyntax["Sql"] = "sql";
|
|
49
|
+
CommentSyntax["Lua"] = "lua";
|
|
50
|
+
CommentSyntax["Lisp"] = "lisp";
|
|
51
|
+
CommentSyntax["None"] = "none";
|
|
52
|
+
})(CommentSyntax || (CommentSyntax = {}));
|
|
53
|
+
const LANGUAGES = [
|
|
54
|
+
{ id: 'typescript', extensions: ['.ts', '.tsx', '.mts', '.cts'], comment: CommentSyntax.CFamily },
|
|
55
|
+
{ id: 'javascript', extensions: ['.js', '.jsx', '.mjs', '.cjs'], comment: CommentSyntax.CFamily },
|
|
56
|
+
{ id: 'java', extensions: ['.java'], comment: CommentSyntax.CFamily },
|
|
57
|
+
{ id: 'kotlin', extensions: ['.kt', '.kts'], comment: CommentSyntax.CFamily },
|
|
58
|
+
{ id: 'scala', extensions: ['.scala'], comment: CommentSyntax.CFamily },
|
|
59
|
+
{ id: 'groovy', extensions: ['.groovy'], comment: CommentSyntax.CFamily },
|
|
60
|
+
{ id: 'csharp', extensions: ['.cs'], comment: CommentSyntax.CFamily },
|
|
61
|
+
{ id: 'cpp', extensions: ['.cpp', '.cc', '.cxx', '.hpp', '.hh', '.hxx'], comment: CommentSyntax.CFamily },
|
|
62
|
+
{ id: 'c', extensions: ['.c', '.h'], comment: CommentSyntax.CFamily },
|
|
63
|
+
{ id: 'go', extensions: ['.go'], comment: CommentSyntax.CFamily },
|
|
64
|
+
{ id: 'rust', extensions: ['.rs'], comment: CommentSyntax.CFamily },
|
|
65
|
+
{ id: 'swift', extensions: ['.swift'], comment: CommentSyntax.CFamily },
|
|
66
|
+
{ id: 'php', extensions: ['.php'], comment: CommentSyntax.CFamily },
|
|
67
|
+
{ id: 'dart', extensions: ['.dart'], comment: CommentSyntax.CFamily },
|
|
68
|
+
{ id: 'python', extensions: ['.py', '.pyi'], comment: CommentSyntax.Hash },
|
|
69
|
+
{ id: 'ruby', extensions: ['.rb'], comment: CommentSyntax.Hash },
|
|
70
|
+
{ id: 'shell', extensions: ['.sh', '.bash', '.zsh', '.fish'], comment: CommentSyntax.Hash },
|
|
71
|
+
{ id: 'perl', extensions: ['.pl', '.pm'], comment: CommentSyntax.Hash },
|
|
72
|
+
{ id: 'r', extensions: ['.r', '.R'], comment: CommentSyntax.Hash },
|
|
73
|
+
{ id: 'yaml', extensions: ['.yaml', '.yml'], comment: CommentSyntax.Hash },
|
|
74
|
+
{ id: 'toml', extensions: ['.toml'], comment: CommentSyntax.Hash },
|
|
75
|
+
{ id: 'ini', extensions: ['.ini', '.cfg', '.conf'], comment: CommentSyntax.Hash },
|
|
76
|
+
{ id: 'dockerfile', extensions: ['.dockerfile'], comment: CommentSyntax.Hash },
|
|
77
|
+
{ id: 'makefile', extensions: ['.mk'], comment: CommentSyntax.Hash },
|
|
78
|
+
{ id: 'html', extensions: ['.html', '.htm'], comment: CommentSyntax.Html },
|
|
79
|
+
{ id: 'xml', extensions: ['.xml', '.xsd', '.xsl'], comment: CommentSyntax.Html },
|
|
80
|
+
{ id: 'vue', extensions: ['.vue'], comment: CommentSyntax.Html },
|
|
81
|
+
{ id: 'svelte', extensions: ['.svelte'], comment: CommentSyntax.Html },
|
|
82
|
+
{ id: 'sql', extensions: ['.sql'], comment: CommentSyntax.Sql },
|
|
83
|
+
{ id: 'css', extensions: ['.css', '.scss', '.sass', '.less'], comment: CommentSyntax.CFamily },
|
|
84
|
+
{ id: 'lua', extensions: ['.lua'], comment: CommentSyntax.Lua },
|
|
85
|
+
{ id: 'elixir', extensions: ['.ex', '.exs'], comment: CommentSyntax.Hash },
|
|
86
|
+
{ id: 'clojure', extensions: ['.clj', '.cljs'], comment: CommentSyntax.Lisp },
|
|
87
|
+
{ id: 'lisp', extensions: ['.lisp', '.lsp', '.el'], comment: CommentSyntax.Lisp },
|
|
88
|
+
{ id: 'json', extensions: ['.json', '.jsonc'], comment: CommentSyntax.None },
|
|
89
|
+
{ id: 'markdown', extensions: ['.md', '.mdx'], comment: CommentSyntax.None },
|
|
90
|
+
{ id: 'text', extensions: ['.txt'], comment: CommentSyntax.None },
|
|
91
|
+
];
|
|
92
|
+
const EXTENSION_INDEX = (() => {
|
|
93
|
+
const m = new Map();
|
|
94
|
+
for (const def of LANGUAGES) {
|
|
95
|
+
for (const ext of def.extensions) {
|
|
96
|
+
m.set(ext.toLowerCase(), def);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return m;
|
|
100
|
+
})();
|
|
101
|
+
const BASENAME_OVERRIDES = new Map([
|
|
102
|
+
['dockerfile', 'dockerfile'],
|
|
103
|
+
['makefile', 'makefile'],
|
|
104
|
+
['gnumakefile', 'makefile'],
|
|
105
|
+
]);
|
|
106
|
+
function walkRepository(root, maxFiles) {
|
|
107
|
+
const out = [];
|
|
108
|
+
const stack = [root];
|
|
109
|
+
let truncated = false;
|
|
110
|
+
while (stack.length > 0) {
|
|
111
|
+
if (out.length >= maxFiles) {
|
|
112
|
+
truncated = true;
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
const cur = stack.pop();
|
|
116
|
+
let entries;
|
|
117
|
+
try {
|
|
118
|
+
entries = readdirSync(cur);
|
|
119
|
+
}
|
|
120
|
+
catch {
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
for (const entry of entries) {
|
|
124
|
+
if (IGNORED_DIR_NAMES.has(entry))
|
|
125
|
+
continue;
|
|
126
|
+
const abs = nodePath.join(cur, entry);
|
|
127
|
+
let st;
|
|
128
|
+
try {
|
|
129
|
+
st = statSync(abs);
|
|
130
|
+
}
|
|
131
|
+
catch {
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
if (st.isDirectory()) {
|
|
135
|
+
stack.push(abs);
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
if (st.isFile()) {
|
|
139
|
+
out.push(abs);
|
|
140
|
+
if (out.length >= maxFiles) {
|
|
141
|
+
truncated = true;
|
|
142
|
+
break;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return { files: out, truncated };
|
|
148
|
+
}
|
|
149
|
+
function classify(absPath) {
|
|
150
|
+
const base = nodePath.basename(absPath).toLowerCase();
|
|
151
|
+
const override = BASENAME_OVERRIDES.get(base);
|
|
152
|
+
if (override) {
|
|
153
|
+
const def = LANGUAGES.find((d) => d.id === override);
|
|
154
|
+
if (def)
|
|
155
|
+
return def;
|
|
156
|
+
}
|
|
157
|
+
const ext = nodePath.extname(absPath).toLowerCase();
|
|
158
|
+
if (!ext)
|
|
159
|
+
return null;
|
|
160
|
+
return EXTENSION_INDEX.get(ext) ?? null;
|
|
161
|
+
}
|
|
162
|
+
function countLines(text, syntax) {
|
|
163
|
+
if (text.length === 0)
|
|
164
|
+
return { total: 0, code: 0, comment: 0, blank: 0 };
|
|
165
|
+
const lines = text.split(/\r?\n/);
|
|
166
|
+
// Trailing empty entry from final newline shouldn't count.
|
|
167
|
+
if (lines.length > 0 && lines[lines.length - 1] === '')
|
|
168
|
+
lines.pop();
|
|
169
|
+
let code = 0;
|
|
170
|
+
let comment = 0;
|
|
171
|
+
let blank = 0;
|
|
172
|
+
let inBlock = false;
|
|
173
|
+
for (const raw of lines) {
|
|
174
|
+
const trimmed = raw.trim();
|
|
175
|
+
if (trimmed.length === 0) {
|
|
176
|
+
blank++;
|
|
177
|
+
continue;
|
|
178
|
+
}
|
|
179
|
+
if (inBlock) {
|
|
180
|
+
comment++;
|
|
181
|
+
if (syntax === CommentSyntax.CFamily && trimmed.includes('*/'))
|
|
182
|
+
inBlock = false;
|
|
183
|
+
else if (syntax === CommentSyntax.Html && trimmed.includes('-->'))
|
|
184
|
+
inBlock = false;
|
|
185
|
+
else if (syntax === CommentSyntax.Sql && trimmed.includes('*/'))
|
|
186
|
+
inBlock = false;
|
|
187
|
+
continue;
|
|
188
|
+
}
|
|
189
|
+
if (isCommentLine(trimmed, syntax)) {
|
|
190
|
+
comment++;
|
|
191
|
+
if (opensBlockComment(trimmed, syntax))
|
|
192
|
+
inBlock = true;
|
|
193
|
+
continue;
|
|
194
|
+
}
|
|
195
|
+
code++;
|
|
196
|
+
}
|
|
197
|
+
return { total: lines.length, code, comment, blank };
|
|
198
|
+
}
|
|
199
|
+
function isCommentLine(trimmed, syntax) {
|
|
200
|
+
switch (syntax) {
|
|
201
|
+
case CommentSyntax.CFamily:
|
|
202
|
+
return trimmed.startsWith('//') || trimmed.startsWith('/*') || trimmed.startsWith('*');
|
|
203
|
+
case CommentSyntax.Hash:
|
|
204
|
+
return trimmed.startsWith('#');
|
|
205
|
+
case CommentSyntax.Html:
|
|
206
|
+
return trimmed.startsWith('<!--');
|
|
207
|
+
case CommentSyntax.Sql:
|
|
208
|
+
return trimmed.startsWith('--') || trimmed.startsWith('/*');
|
|
209
|
+
case CommentSyntax.Lua:
|
|
210
|
+
return trimmed.startsWith('--');
|
|
211
|
+
case CommentSyntax.Lisp:
|
|
212
|
+
return trimmed.startsWith(';');
|
|
213
|
+
case CommentSyntax.None:
|
|
214
|
+
default:
|
|
215
|
+
return false;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
function opensBlockComment(trimmed, syntax) {
|
|
219
|
+
if (syntax === CommentSyntax.CFamily || syntax === CommentSyntax.Sql) {
|
|
220
|
+
return trimmed.includes('/*') && !trimmed.includes('*/');
|
|
221
|
+
}
|
|
222
|
+
if (syntax === CommentSyntax.Html) {
|
|
223
|
+
return trimmed.startsWith('<!--') && !trimmed.includes('-->');
|
|
224
|
+
}
|
|
225
|
+
return false;
|
|
226
|
+
}
|
|
227
|
+
export async function buildRepositoryStats(opts) {
|
|
228
|
+
const projectRoot = nodePath.resolve(opts.cwd);
|
|
229
|
+
const maxFiles = opts.maxFiles ?? 50_000;
|
|
230
|
+
const maxTop = opts.maxTopFiles ?? 10;
|
|
231
|
+
const filter = opts.language?.toLowerCase();
|
|
232
|
+
const walk = walkRepository(projectRoot, maxFiles);
|
|
233
|
+
const accs = new Map();
|
|
234
|
+
const allFiles = [];
|
|
235
|
+
for (const abs of walk.files) {
|
|
236
|
+
const def = classify(abs);
|
|
237
|
+
if (!def)
|
|
238
|
+
continue;
|
|
239
|
+
if (filter && def.id !== filter)
|
|
240
|
+
continue;
|
|
241
|
+
let bytes = 0;
|
|
242
|
+
let counts = { total: 0, code: 0, comment: 0, blank: 0 };
|
|
243
|
+
try {
|
|
244
|
+
const st = statSync(abs);
|
|
245
|
+
bytes = st.size;
|
|
246
|
+
if (bytes > 0 && bytes < 4_000_000) {
|
|
247
|
+
const text = readFileSync(abs, 'utf8');
|
|
248
|
+
counts = countLines(text, def.comment);
|
|
249
|
+
}
|
|
250
|
+
else if (bytes >= 4_000_000) {
|
|
251
|
+
// Skip line counting for very large files but still tally bytes.
|
|
252
|
+
counts = { total: 0, code: 0, comment: 0, blank: 0 };
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
catch {
|
|
256
|
+
continue;
|
|
257
|
+
}
|
|
258
|
+
let acc = accs.get(def.id);
|
|
259
|
+
if (!acc) {
|
|
260
|
+
acc = {
|
|
261
|
+
def,
|
|
262
|
+
files: 0,
|
|
263
|
+
bytes: 0,
|
|
264
|
+
totalLines: 0,
|
|
265
|
+
codeLines: 0,
|
|
266
|
+
commentLines: 0,
|
|
267
|
+
blankLines: 0,
|
|
268
|
+
largest: null,
|
|
269
|
+
};
|
|
270
|
+
accs.set(def.id, acc);
|
|
271
|
+
}
|
|
272
|
+
acc.files++;
|
|
273
|
+
acc.bytes += bytes;
|
|
274
|
+
acc.totalLines += counts.total;
|
|
275
|
+
acc.codeLines += counts.code;
|
|
276
|
+
acc.commentLines += counts.comment;
|
|
277
|
+
acc.blankLines += counts.blank;
|
|
278
|
+
if (!acc.largest || bytes > acc.largest.bytes) {
|
|
279
|
+
acc.largest = {
|
|
280
|
+
path: nodePath.relative(projectRoot, abs).replace(/\\/g, '/'),
|
|
281
|
+
bytes,
|
|
282
|
+
lines: counts.total,
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
allFiles.push({
|
|
286
|
+
path: nodePath.relative(projectRoot, abs).replace(/\\/g, '/'),
|
|
287
|
+
language: def.id,
|
|
288
|
+
bytes,
|
|
289
|
+
lines: counts.total,
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
const byLanguage = [];
|
|
293
|
+
for (const acc of accs.values()) {
|
|
294
|
+
byLanguage.push({
|
|
295
|
+
language: acc.def.id,
|
|
296
|
+
extensions: acc.def.extensions,
|
|
297
|
+
files: acc.files,
|
|
298
|
+
bytes: acc.bytes,
|
|
299
|
+
totalLines: acc.totalLines,
|
|
300
|
+
codeLines: acc.codeLines,
|
|
301
|
+
commentLines: acc.commentLines,
|
|
302
|
+
blankLines: acc.blankLines,
|
|
303
|
+
averageFileBytes: acc.files > 0 ? Math.round(acc.bytes / acc.files) : 0,
|
|
304
|
+
averageFileLines: acc.files > 0 ? Math.round(acc.totalLines / acc.files) : 0,
|
|
305
|
+
largestFile: acc.largest,
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
byLanguage.sort((a, b) => b.files - a.files || b.bytes - a.bytes);
|
|
309
|
+
const totals = byLanguage.reduce((acc, l) => ({
|
|
310
|
+
files: acc.files + l.files,
|
|
311
|
+
bytes: acc.bytes + l.bytes,
|
|
312
|
+
totalLines: acc.totalLines + l.totalLines,
|
|
313
|
+
codeLines: acc.codeLines + l.codeLines,
|
|
314
|
+
commentLines: acc.commentLines + l.commentLines,
|
|
315
|
+
blankLines: acc.blankLines + l.blankLines,
|
|
316
|
+
}), { files: 0, bytes: 0, totalLines: 0, codeLines: 0, commentLines: 0, blankLines: 0 });
|
|
317
|
+
allFiles.sort((a, b) => b.bytes - a.bytes);
|
|
318
|
+
const topFiles = allFiles.slice(0, Math.max(0, maxTop));
|
|
319
|
+
return {
|
|
320
|
+
schema: REPOSITORY_STATS_SCHEMA,
|
|
321
|
+
generatedAt: new Date().toISOString(),
|
|
322
|
+
projectRoot,
|
|
323
|
+
totals,
|
|
324
|
+
byLanguage,
|
|
325
|
+
topFiles,
|
|
326
|
+
ignoredDirectories: [...IGNORED_DIR_NAMES].sort((a, b) => a.localeCompare(b)),
|
|
327
|
+
truncated: walk.truncated,
|
|
328
|
+
};
|
|
329
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { IReviewPacket } from './review-packet.js';
|
|
2
|
+
export interface IRenderReviewCommentOptions {
|
|
3
|
+
/** Optional title for the comment header. */
|
|
4
|
+
title?: string;
|
|
5
|
+
/** Include the AI reviewer instructions block. Default true. */
|
|
6
|
+
includeReviewerInstructions?: boolean;
|
|
7
|
+
/** Include the artifacts note at the bottom. Default true. */
|
|
8
|
+
includeArtifactsNote?: boolean;
|
|
9
|
+
/** Output format. 'github' wraps long sections in <details>, 'markdown' is plain. Default 'github'. */
|
|
10
|
+
format?: 'github' | 'markdown';
|
|
11
|
+
/** Truncate changed files list to N entries. Default 20. */
|
|
12
|
+
maxFiles?: number;
|
|
13
|
+
/** Truncate relevant rules list to N entries. Default 30. */
|
|
14
|
+
maxRules?: number;
|
|
15
|
+
/** Wrap long sections in <details> (GitHub-only). Default true when format='github'. */
|
|
16
|
+
collapseLongSections?: boolean;
|
|
17
|
+
/** Include boundary issues section. Default true. */
|
|
18
|
+
includeBoundaries?: boolean;
|
|
19
|
+
/** Include coverage summary when artifact is provided. */
|
|
20
|
+
includeCoverage?: boolean;
|
|
21
|
+
/** Include drift summary when artifact is provided. */
|
|
22
|
+
includeDrift?: boolean;
|
|
23
|
+
/** Optional boundaries artifact (parsed from `shrk check boundaries --json`). */
|
|
24
|
+
boundariesArtifact?: {
|
|
25
|
+
counts?: {
|
|
26
|
+
error?: number;
|
|
27
|
+
warning?: number;
|
|
28
|
+
info?: number;
|
|
29
|
+
};
|
|
30
|
+
rulesEvaluated?: number;
|
|
31
|
+
};
|
|
32
|
+
/** Optional coverage artifact (parsed from `shrk coverage --json`). */
|
|
33
|
+
coverageArtifact?: {
|
|
34
|
+
overall?: number;
|
|
35
|
+
categories?: readonly {
|
|
36
|
+
id: string;
|
|
37
|
+
score: number;
|
|
38
|
+
}[];
|
|
39
|
+
};
|
|
40
|
+
/** Optional drift artifact (parsed from `shrk drift --json`). */
|
|
41
|
+
driftArtifact?: {
|
|
42
|
+
stale?: readonly {
|
|
43
|
+
id: string;
|
|
44
|
+
}[];
|
|
45
|
+
total?: number;
|
|
46
|
+
};
|
|
47
|
+
/** Artifact links/names to render in the artifacts section. */
|
|
48
|
+
artifactLinks?: readonly {
|
|
49
|
+
name: string;
|
|
50
|
+
href?: string;
|
|
51
|
+
}[];
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Render a review packet as a human-readable Markdown PR comment. The function
|
|
55
|
+
* accepts a packet read from JSON (the runtime shape may have extra fields —
|
|
56
|
+
* we read only the documented ones). Returns Markdown only.
|
|
57
|
+
*/
|
|
58
|
+
export declare function renderReviewComment(packet: IReviewPacket, options?: IRenderReviewCommentOptions): string;
|
|
59
|
+
//# sourceMappingURL=review-comment-renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review-comment-renderer.d.ts","sourceRoot":"","sources":["../src/review-comment-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,WAAW,2BAA2B;IAC1C,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gEAAgE;IAChE,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC,8DAA8D;IAC9D,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,uGAAuG;IACvG,MAAM,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;IAC/B,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wFAAwF;IACxF,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,qDAAqD;IACrD,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,0DAA0D;IAC1D,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,uDAAuD;IACvD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,iFAAiF;IACjF,kBAAkB,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE;YAAE,KAAK,CAAC,EAAE,MAAM,CAAC;YAAC,OAAO,CAAC,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;QAAC,cAAc,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/G,uEAAuE;IACvE,gBAAgB,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,SAAS;YAAE,EAAE,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,EAAE,CAAA;KAAE,CAAC;IAC/F,iEAAiE;IACjE,aAAa,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,SAAS;YAAE,EAAE,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACtE,+DAA+D;IAC/D,aAAa,CAAC,EAAE,SAAS;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC5D;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,aAAa,EACrB,OAAO,GAAE,2BAAgC,GACxC,MAAM,CAsJR"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Render a review packet as a human-readable Markdown PR comment. The function
|
|
3
|
+
* accepts a packet read from JSON (the runtime shape may have extra fields —
|
|
4
|
+
* we read only the documented ones). Returns Markdown only.
|
|
5
|
+
*/
|
|
6
|
+
export function renderReviewComment(packet, options = {}) {
|
|
7
|
+
const includeReviewer = options.includeReviewerInstructions !== false;
|
|
8
|
+
const includeArtifacts = options.includeArtifactsNote !== false;
|
|
9
|
+
const includeBoundaries = options.includeBoundaries !== false;
|
|
10
|
+
const includeCoverage = options.includeCoverage === true && options.coverageArtifact !== undefined;
|
|
11
|
+
const includeDrift = options.includeDrift === true && options.driftArtifact !== undefined;
|
|
12
|
+
const format = options.format ?? 'github';
|
|
13
|
+
const maxFiles = options.maxFiles ?? 20;
|
|
14
|
+
const maxRules = options.maxRules ?? 30;
|
|
15
|
+
const collapse = options.collapseLongSections !== false && format === 'github';
|
|
16
|
+
const out = [];
|
|
17
|
+
const title = options.title ?? 'SharkCraft review';
|
|
18
|
+
out.push(`## ${title}`);
|
|
19
|
+
out.push('');
|
|
20
|
+
out.push(renderSummary(packet, options));
|
|
21
|
+
out.push('');
|
|
22
|
+
// Changed files — collapsible when long.
|
|
23
|
+
out.push('### Changed files');
|
|
24
|
+
out.push('');
|
|
25
|
+
if (packet.changedFiles.length === 0) {
|
|
26
|
+
out.push('_No changed files detected._');
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
const slice = packet.changedFiles.slice(0, maxFiles);
|
|
30
|
+
const overflow = packet.changedFiles.length > maxFiles;
|
|
31
|
+
if (collapse && packet.changedFiles.length > 10) {
|
|
32
|
+
out.push('<details>');
|
|
33
|
+
out.push(`<summary>${packet.changedFiles.length} file(s) — click to expand</summary>`);
|
|
34
|
+
out.push('');
|
|
35
|
+
}
|
|
36
|
+
for (const f of slice)
|
|
37
|
+
out.push(`- \`${f}\``);
|
|
38
|
+
if (overflow)
|
|
39
|
+
out.push(`- …and ${packet.changedFiles.length - maxFiles} more.`);
|
|
40
|
+
if (collapse && packet.changedFiles.length > 10) {
|
|
41
|
+
out.push('');
|
|
42
|
+
out.push('</details>');
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
out.push('');
|
|
46
|
+
out.push('### Risks');
|
|
47
|
+
out.push('');
|
|
48
|
+
const risks = collectRisks(packet);
|
|
49
|
+
if (risks.length === 0) {
|
|
50
|
+
out.push('_No risks flagged by the deterministic checks._');
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
for (const r of risks)
|
|
54
|
+
out.push(`- ${r}`);
|
|
55
|
+
}
|
|
56
|
+
out.push('');
|
|
57
|
+
if (includeBoundaries) {
|
|
58
|
+
out.push('### Boundary issues');
|
|
59
|
+
out.push('');
|
|
60
|
+
if (packet.boundaryViolations.length === 0) {
|
|
61
|
+
out.push('_No boundary violations in the change set._');
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
for (const v of packet.boundaryViolations) {
|
|
65
|
+
out.push(`- **${v.severity.toUpperCase()}** \`${v.file}:${v.line}\` imports \`${v.importSpecifier}\` — rule \`${v.ruleId}\``);
|
|
66
|
+
if (v.message)
|
|
67
|
+
out.push(` - ${v.message}`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
out.push('');
|
|
71
|
+
}
|
|
72
|
+
if (includeCoverage) {
|
|
73
|
+
out.push('### Coverage summary');
|
|
74
|
+
out.push('');
|
|
75
|
+
const a = options.coverageArtifact;
|
|
76
|
+
if (typeof a.overall === 'number') {
|
|
77
|
+
out.push(`- Overall: **${a.overall}%**`);
|
|
78
|
+
}
|
|
79
|
+
if (Array.isArray(a.categories)) {
|
|
80
|
+
const low = a.categories.filter((c) => c.score < 80);
|
|
81
|
+
if (low.length === 0) {
|
|
82
|
+
out.push('- No categories below 80%.');
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
for (const c of low)
|
|
86
|
+
out.push(`- ${c.id}: ${c.score}%`);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
out.push('');
|
|
90
|
+
}
|
|
91
|
+
if (includeDrift) {
|
|
92
|
+
out.push('### Drift summary');
|
|
93
|
+
out.push('');
|
|
94
|
+
const a = options.driftArtifact;
|
|
95
|
+
const stale = Array.isArray(a.stale) ? a.stale.length : 0;
|
|
96
|
+
out.push(`- Stale entries: **${stale}** of ${a.total ?? '?'}`);
|
|
97
|
+
if (Array.isArray(a.stale)) {
|
|
98
|
+
for (const s of a.stale.slice(0, 10))
|
|
99
|
+
out.push(` - ${s.id}`);
|
|
100
|
+
}
|
|
101
|
+
out.push('');
|
|
102
|
+
}
|
|
103
|
+
out.push('### Suggested checks');
|
|
104
|
+
out.push('');
|
|
105
|
+
if (packet.verificationCommands.length === 0) {
|
|
106
|
+
out.push('_No verification commands configured._');
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
for (const c of packet.verificationCommands) {
|
|
110
|
+
out.push(`- \`${c}\``);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
out.push('');
|
|
114
|
+
if (packet.relevantRules.length > 0) {
|
|
115
|
+
out.push('### Relevant rules');
|
|
116
|
+
out.push('');
|
|
117
|
+
const rules = packet.relevantRules.slice(0, maxRules);
|
|
118
|
+
for (const r of rules) {
|
|
119
|
+
out.push(`- **${r.id}** — ${r.title}`);
|
|
120
|
+
}
|
|
121
|
+
if (packet.relevantRules.length > maxRules) {
|
|
122
|
+
out.push(`- …and ${packet.relevantRules.length - maxRules} more.`);
|
|
123
|
+
}
|
|
124
|
+
out.push('');
|
|
125
|
+
}
|
|
126
|
+
if (includeReviewer && packet.reviewerInstructions) {
|
|
127
|
+
out.push('### AI reviewer instructions');
|
|
128
|
+
out.push('');
|
|
129
|
+
if (collapse) {
|
|
130
|
+
out.push('<details>');
|
|
131
|
+
out.push('<summary>Click to expand</summary>');
|
|
132
|
+
out.push('');
|
|
133
|
+
}
|
|
134
|
+
out.push(packet.reviewerInstructions);
|
|
135
|
+
if (collapse) {
|
|
136
|
+
out.push('');
|
|
137
|
+
out.push('</details>');
|
|
138
|
+
}
|
|
139
|
+
out.push('');
|
|
140
|
+
}
|
|
141
|
+
if (options.artifactLinks && options.artifactLinks.length > 0) {
|
|
142
|
+
out.push('### Artifacts');
|
|
143
|
+
out.push('');
|
|
144
|
+
for (const a of options.artifactLinks) {
|
|
145
|
+
out.push(a.href ? `- [\`${a.name}\`](${a.href})` : `- \`${a.name}\``);
|
|
146
|
+
}
|
|
147
|
+
out.push('');
|
|
148
|
+
}
|
|
149
|
+
if (includeArtifacts) {
|
|
150
|
+
out.push('---');
|
|
151
|
+
out.push('_Generated by `shrk review render-comment`. The full review packet JSON is uploaded as a CI artifact._');
|
|
152
|
+
}
|
|
153
|
+
return out.join('\n').replace(/\n{3,}/g, '\n\n');
|
|
154
|
+
}
|
|
155
|
+
function renderSummary(packet, options) {
|
|
156
|
+
const parts = [
|
|
157
|
+
`${packet.changedFiles.length} file(s) changed`,
|
|
158
|
+
`${packet.boundaryViolations.length} boundary violation(s)`,
|
|
159
|
+
`${packet.missingTestsHeuristic.length} potentially missing test(s)`,
|
|
160
|
+
];
|
|
161
|
+
if (options.coverageArtifact?.overall !== undefined) {
|
|
162
|
+
parts.push(`coverage ${options.coverageArtifact.overall}%`);
|
|
163
|
+
}
|
|
164
|
+
if (options.driftArtifact?.stale && options.driftArtifact.stale.length > 0) {
|
|
165
|
+
parts.push(`${options.driftArtifact.stale.length} stale`);
|
|
166
|
+
}
|
|
167
|
+
return `**Summary:** ${parts.join(' · ')}`;
|
|
168
|
+
}
|
|
169
|
+
function collectRisks(packet) {
|
|
170
|
+
const out = [];
|
|
171
|
+
if (packet.boundaryViolations.length > 0) {
|
|
172
|
+
out.push(`${packet.boundaryViolations.length} boundary violation(s) in changed files — see below.`);
|
|
173
|
+
}
|
|
174
|
+
if (packet.missingTestsHeuristic.length > 0) {
|
|
175
|
+
out.push(`Possibly missing tests: ${packet.missingTestsHeuristic.length} source file(s) without a sibling spec.`);
|
|
176
|
+
for (const m of packet.missingTestsHeuristic.slice(0, 5)) {
|
|
177
|
+
out.push(` • ${m}`);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
return out;
|
|
181
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IReviewPacketV2 } from './review-packet-v2.js';
|
|
2
|
+
export interface IRenderReviewCommentV2Options {
|
|
3
|
+
format?: 'github' | 'gitlab' | 'markdown' | 'html';
|
|
4
|
+
maxFiles?: number;
|
|
5
|
+
maxItems?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function renderReviewCommentV2Html(packet: IReviewPacketV2, options?: Omit<IRenderReviewCommentV2Options, 'format'>): string;
|
|
8
|
+
export declare function renderReviewCommentV2(packet: IReviewPacketV2, options?: IRenderReviewCommentV2Options): string;
|
|
9
|
+
//# sourceMappingURL=review-comment-v2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review-comment-v2.d.ts","sourceRoot":"","sources":["../src/review-comment-v2.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,MAAM,WAAW,6BAA6B;IAC5C,MAAM,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAC;IACnD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,eAAe,EACvB,OAAO,GAAE,IAAI,CAAC,6BAA6B,EAAE,QAAQ,CAAM,GAC1D,MAAM,CA8GR;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,eAAe,EACvB,OAAO,GAAE,6BAAkC,GAC1C,MAAM,CA6FR"}
|