@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,190 @@
|
|
|
1
|
+
import { hasActionHints } from '@shrkcrft/knowledge';
|
|
2
|
+
import { resolvePreset, resolvePresetReferences } from '@shrkcrft/presets';
|
|
3
|
+
import { inspectionReferenceLookup } from "./reference-lookup.js";
|
|
4
|
+
function pct(covered, total) {
|
|
5
|
+
if (total === 0)
|
|
6
|
+
return 100;
|
|
7
|
+
return Math.round((covered / total) * 100);
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Deterministic coverage report. Different from AI-readiness — focuses on
|
|
11
|
+
* **relationships**: do entries link to each other in a way that lets an
|
|
12
|
+
* agent traverse the project intelligence?
|
|
13
|
+
*/
|
|
14
|
+
export function buildCoverageReport(inspection) {
|
|
15
|
+
const suggestions = [];
|
|
16
|
+
const categories = [];
|
|
17
|
+
// 1. Templates with description ≥ 5 chars.
|
|
18
|
+
{
|
|
19
|
+
const total = inspection.templates.length;
|
|
20
|
+
const missing = [];
|
|
21
|
+
let covered = 0;
|
|
22
|
+
for (const t of inspection.templates) {
|
|
23
|
+
if (typeof t.description === 'string' && t.description.trim().length >= 5) {
|
|
24
|
+
covered += 1;
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
missing.push(`${t.id} — description missing or too short`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
categories.push({
|
|
31
|
+
id: 'template-descriptions',
|
|
32
|
+
title: 'Templates have a meaningful description',
|
|
33
|
+
total,
|
|
34
|
+
covered,
|
|
35
|
+
score: pct(covered, total),
|
|
36
|
+
missing,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
// 2. Templates with related rules / paths.
|
|
40
|
+
{
|
|
41
|
+
const total = inspection.templates.length;
|
|
42
|
+
const missing = [];
|
|
43
|
+
let covered = 0;
|
|
44
|
+
for (const t of inspection.templates) {
|
|
45
|
+
const related = t.related ?? [];
|
|
46
|
+
if (related.length > 0)
|
|
47
|
+
covered += 1;
|
|
48
|
+
else
|
|
49
|
+
missing.push(`${t.id} — no related rules/paths declared`);
|
|
50
|
+
}
|
|
51
|
+
categories.push({
|
|
52
|
+
id: 'template-related',
|
|
53
|
+
title: 'Templates declare related rules/paths',
|
|
54
|
+
total,
|
|
55
|
+
covered,
|
|
56
|
+
score: pct(covered, total),
|
|
57
|
+
missing,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
// 3. Critical/high knowledge entries with action hints.
|
|
61
|
+
{
|
|
62
|
+
const eligible = inspection.knowledgeEntries.filter((e) => {
|
|
63
|
+
const p = String(e.priority);
|
|
64
|
+
return p === 'critical' || p === 'high';
|
|
65
|
+
});
|
|
66
|
+
const total = eligible.length;
|
|
67
|
+
const missing = [];
|
|
68
|
+
let covered = 0;
|
|
69
|
+
for (const e of eligible) {
|
|
70
|
+
if (hasActionHints(e))
|
|
71
|
+
covered += 1;
|
|
72
|
+
else
|
|
73
|
+
missing.push(`${e.id} — no actionHints`);
|
|
74
|
+
}
|
|
75
|
+
categories.push({
|
|
76
|
+
id: 'hint-coverage',
|
|
77
|
+
title: 'Critical/high entries carry actionHints',
|
|
78
|
+
total,
|
|
79
|
+
covered,
|
|
80
|
+
score: pct(covered, total),
|
|
81
|
+
missing,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
// 4. Pipelines whose steps reference existing templates/rules/paths.
|
|
85
|
+
{
|
|
86
|
+
const total = inspection.pipelines.length;
|
|
87
|
+
const missing = [];
|
|
88
|
+
let covered = 0;
|
|
89
|
+
for (const p of inspection.pipelines) {
|
|
90
|
+
const refs = [];
|
|
91
|
+
for (const step of p.steps ?? []) {
|
|
92
|
+
for (const ref of step.references ?? [])
|
|
93
|
+
refs.push(ref);
|
|
94
|
+
}
|
|
95
|
+
if (refs.length === 0) {
|
|
96
|
+
missing.push(`${p.id} — no step references`);
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
const allResolve = refs.every((id) => inspection.templates.some((t) => t.id === id) ||
|
|
100
|
+
inspection.knowledgeEntries.some((e) => e.id === id));
|
|
101
|
+
if (allResolve)
|
|
102
|
+
covered += 1;
|
|
103
|
+
else
|
|
104
|
+
missing.push(`${p.id} — some step references unknown ids`);
|
|
105
|
+
}
|
|
106
|
+
categories.push({
|
|
107
|
+
id: 'pipeline-step-refs',
|
|
108
|
+
title: 'Pipelines reference resolvable templates/rules',
|
|
109
|
+
total,
|
|
110
|
+
covered,
|
|
111
|
+
score: pct(covered, total),
|
|
112
|
+
missing,
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
// 5. Presets — references resolve.
|
|
116
|
+
{
|
|
117
|
+
const refLookup = inspectionReferenceLookup(inspection);
|
|
118
|
+
const presets = inspection.presetRegistry.list();
|
|
119
|
+
const total = presets.length;
|
|
120
|
+
const missing = [];
|
|
121
|
+
let covered = 0;
|
|
122
|
+
for (const p of presets) {
|
|
123
|
+
const resolved = resolvePreset(inspection.presetRegistry, p.id);
|
|
124
|
+
const refs = resolvePresetReferences(resolved, refLookup);
|
|
125
|
+
if (refs.totalMissing === 0 && resolved.issues.length === 0) {
|
|
126
|
+
covered += 1;
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
missing.push(`${p.id} — ${resolved.issues.length} composition issues, ${refs.totalMissing} missing refs`);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
categories.push({
|
|
133
|
+
id: 'preset-references',
|
|
134
|
+
title: 'Presets compose + reference assets that resolve',
|
|
135
|
+
total,
|
|
136
|
+
covered,
|
|
137
|
+
score: pct(covered, total),
|
|
138
|
+
missing,
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
// 6. Boundary rules — suggested fix present.
|
|
142
|
+
{
|
|
143
|
+
const rules = inspection.boundaryRegistry.list();
|
|
144
|
+
const total = rules.length;
|
|
145
|
+
const missing = [];
|
|
146
|
+
let covered = 0;
|
|
147
|
+
for (const r of rules) {
|
|
148
|
+
if (typeof r.suggestedFix === 'string' && r.suggestedFix.trim().length > 0)
|
|
149
|
+
covered += 1;
|
|
150
|
+
else
|
|
151
|
+
missing.push(`${r.id} — no suggestedFix`);
|
|
152
|
+
}
|
|
153
|
+
categories.push({
|
|
154
|
+
id: 'boundary-fixes',
|
|
155
|
+
title: 'Boundary rules ship a suggestedFix',
|
|
156
|
+
total,
|
|
157
|
+
covered,
|
|
158
|
+
score: pct(covered, total),
|
|
159
|
+
missing,
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
// 7. Packs — at least one doc.
|
|
163
|
+
{
|
|
164
|
+
const packs = inspection.packs.discoveredPacks.filter((p) => p.valid);
|
|
165
|
+
const total = packs.length;
|
|
166
|
+
const missing = [];
|
|
167
|
+
let covered = 0;
|
|
168
|
+
for (const p of packs) {
|
|
169
|
+
const docs = p.manifest?.contributions.docsFiles ?? [];
|
|
170
|
+
if (docs.length > 0)
|
|
171
|
+
covered += 1;
|
|
172
|
+
else
|
|
173
|
+
missing.push(`${p.packageName} — no docsFiles`);
|
|
174
|
+
}
|
|
175
|
+
categories.push({
|
|
176
|
+
id: 'pack-docs',
|
|
177
|
+
title: 'Packs ship at least one doc',
|
|
178
|
+
total,
|
|
179
|
+
covered,
|
|
180
|
+
score: pct(covered, total),
|
|
181
|
+
missing,
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
const overall = Math.round(categories.reduce((s, c) => s + c.score, 0) / Math.max(categories.length, 1));
|
|
185
|
+
if (overall < 60)
|
|
186
|
+
suggestions.push('Pair every critical rule with action hints + verification commands.');
|
|
187
|
+
if (overall < 80)
|
|
188
|
+
suggestions.push('Make templates declare related rules/paths (`template.related`).');
|
|
189
|
+
return { categories, overall, suggestions };
|
|
190
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { type IKnowledgeEntry } from '@shrkcrft/knowledge';
|
|
2
|
+
export declare const CUSTOM_CHECK_REPORT_SCHEMA = "sharkcraft.custom-check/v1";
|
|
3
|
+
export declare const CUSTOM_CHECKS_REGISTRY_SCHEMA = "sharkcraft.custom-checks-registry/v1";
|
|
4
|
+
export declare enum CustomCheckScope {
|
|
5
|
+
ChangedOnly = "changed-only",
|
|
6
|
+
Staged = "staged",
|
|
7
|
+
All = "all"
|
|
8
|
+
}
|
|
9
|
+
export declare enum CustomCheckKind {
|
|
10
|
+
ImportGraph = "import-graph",
|
|
11
|
+
AstShape = "ast-shape",
|
|
12
|
+
TextShape = "text-shape",
|
|
13
|
+
ProjectScript = "project-script",
|
|
14
|
+
ExternalTool = "external-tool"
|
|
15
|
+
}
|
|
16
|
+
export declare enum CustomCheckSafety {
|
|
17
|
+
ReadOnly = "read-only",
|
|
18
|
+
WritesReport = "writes-report",
|
|
19
|
+
WritesPreview = "writes-preview"
|
|
20
|
+
}
|
|
21
|
+
export declare enum CustomCheckOutput {
|
|
22
|
+
Json = "json",
|
|
23
|
+
Text = "text",
|
|
24
|
+
ExitCode = "exit-code"
|
|
25
|
+
}
|
|
26
|
+
export declare enum CustomCheckStatus {
|
|
27
|
+
Pass = "pass",
|
|
28
|
+
Warn = "warn",
|
|
29
|
+
Fail = "fail",
|
|
30
|
+
Skipped = "skipped"
|
|
31
|
+
}
|
|
32
|
+
export interface ICustomCheckDescriptor {
|
|
33
|
+
/** Stable id (must be unique across the registry). */
|
|
34
|
+
id: string;
|
|
35
|
+
/** The rule that owns this check. The engine fills this in from context. */
|
|
36
|
+
ownerRuleId?: string;
|
|
37
|
+
/** Shell command to run (never executed unless --execute). */
|
|
38
|
+
command: string;
|
|
39
|
+
/** Where the script writes its report (relative to repo root). */
|
|
40
|
+
reportPath?: string;
|
|
41
|
+
/** Optional human description. */
|
|
42
|
+
description?: string;
|
|
43
|
+
scope?: CustomCheckScope;
|
|
44
|
+
kind?: CustomCheckKind;
|
|
45
|
+
safety?: CustomCheckSafety;
|
|
46
|
+
output?: CustomCheckOutput;
|
|
47
|
+
/** Tags for filtering. */
|
|
48
|
+
tags?: readonly string[];
|
|
49
|
+
}
|
|
50
|
+
export interface ICustomCheckFinding {
|
|
51
|
+
severity: 'error' | 'warning' | 'info';
|
|
52
|
+
file?: string;
|
|
53
|
+
message: string;
|
|
54
|
+
suggestedAction?: string;
|
|
55
|
+
safeToAutoFix?: boolean;
|
|
56
|
+
}
|
|
57
|
+
export interface ICustomCheckReport {
|
|
58
|
+
schema: typeof CUSTOM_CHECK_REPORT_SCHEMA;
|
|
59
|
+
checkId: string;
|
|
60
|
+
ruleId?: string;
|
|
61
|
+
generatedAt: string;
|
|
62
|
+
status: CustomCheckStatus;
|
|
63
|
+
findings: readonly ICustomCheckFinding[];
|
|
64
|
+
/** Free-form metadata copied verbatim from the script. */
|
|
65
|
+
metadata?: Readonly<Record<string, unknown>>;
|
|
66
|
+
}
|
|
67
|
+
export interface ICustomCheckRegistryEntry {
|
|
68
|
+
descriptor: ICustomCheckDescriptor;
|
|
69
|
+
ruleId: string;
|
|
70
|
+
/** Validation findings about the descriptor itself. */
|
|
71
|
+
warnings: readonly string[];
|
|
72
|
+
}
|
|
73
|
+
export interface ICustomCheckRegistry {
|
|
74
|
+
schema: typeof CUSTOM_CHECKS_REGISTRY_SCHEMA;
|
|
75
|
+
generatedAt: string;
|
|
76
|
+
entries: readonly ICustomCheckRegistryEntry[];
|
|
77
|
+
duplicates: readonly {
|
|
78
|
+
id: string;
|
|
79
|
+
ruleIds: readonly string[];
|
|
80
|
+
}[];
|
|
81
|
+
invalid: readonly {
|
|
82
|
+
ruleId: string;
|
|
83
|
+
reason: string;
|
|
84
|
+
}[];
|
|
85
|
+
}
|
|
86
|
+
/** Read the descriptors a rule declares under `metadata.checks`. */
|
|
87
|
+
export declare function readDescriptorsFromRule(rule: IKnowledgeEntry): readonly ICustomCheckDescriptor[];
|
|
88
|
+
export declare function buildCustomChecksRegistry(entries: readonly IKnowledgeEntry[]): ICustomCheckRegistry;
|
|
89
|
+
export interface ICustomCheckDoctorReport {
|
|
90
|
+
schema: 'sharkcraft.custom-checks-doctor/v1';
|
|
91
|
+
generatedAt: string;
|
|
92
|
+
totalChecks: number;
|
|
93
|
+
warnings: number;
|
|
94
|
+
errors: number;
|
|
95
|
+
details: readonly {
|
|
96
|
+
ruleId: string;
|
|
97
|
+
checkId: string;
|
|
98
|
+
severity: 'error' | 'warning' | 'info';
|
|
99
|
+
message: string;
|
|
100
|
+
}[];
|
|
101
|
+
}
|
|
102
|
+
export declare function doctorCustomChecks(registry: ICustomCheckRegistry): ICustomCheckDoctorReport;
|
|
103
|
+
/**
|
|
104
|
+
* Parse a custom-check report from a known location. Supports the JSON
|
|
105
|
+
* convention (preferred), and a text fallback that turns each line into
|
|
106
|
+
* a `severity:warning, message: line` finding.
|
|
107
|
+
*/
|
|
108
|
+
export declare function parseCustomCheckReportFromFile(filePath: string, expectedCheckId?: string): {
|
|
109
|
+
ok: true;
|
|
110
|
+
report: ICustomCheckReport;
|
|
111
|
+
} | {
|
|
112
|
+
ok: false;
|
|
113
|
+
reason: string;
|
|
114
|
+
};
|
|
115
|
+
export declare function parseCustomCheckReport(raw: string, expectedCheckId?: string): {
|
|
116
|
+
ok: true;
|
|
117
|
+
report: ICustomCheckReport;
|
|
118
|
+
} | {
|
|
119
|
+
ok: false;
|
|
120
|
+
reason: string;
|
|
121
|
+
};
|
|
122
|
+
export interface IRunCustomCheckOptions {
|
|
123
|
+
cwd: string;
|
|
124
|
+
/** When false (default) the runner prints the command and exits without spawning. */
|
|
125
|
+
execute?: boolean;
|
|
126
|
+
/** Override the descriptor reportPath. */
|
|
127
|
+
reportPath?: string;
|
|
128
|
+
/** Optional environment additions. */
|
|
129
|
+
env?: Record<string, string>;
|
|
130
|
+
/** Maximum runtime in ms. */
|
|
131
|
+
timeoutMs?: number;
|
|
132
|
+
}
|
|
133
|
+
export interface IRunCustomCheckResult {
|
|
134
|
+
schema: 'sharkcraft.custom-check-run/v1';
|
|
135
|
+
checkId: string;
|
|
136
|
+
ownerRuleId?: string;
|
|
137
|
+
command: string;
|
|
138
|
+
executed: boolean;
|
|
139
|
+
exitCode: number | null;
|
|
140
|
+
stderr?: string;
|
|
141
|
+
stdoutSummary?: string;
|
|
142
|
+
report?: ICustomCheckReport;
|
|
143
|
+
reason?: string;
|
|
144
|
+
}
|
|
145
|
+
export declare function runCustomCheck(descriptor: ICustomCheckDescriptor, options: IRunCustomCheckOptions): IRunCustomCheckResult;
|
|
146
|
+
//# sourceMappingURL=custom-checks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-checks.d.ts","sourceRoot":"","sources":["../src/custom-checks.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,KAAK,eAAe,EAAiB,MAAM,qBAAqB,CAAC;AAE1E,eAAO,MAAM,0BAA0B,+BAA+B,CAAC;AACvE,eAAO,MAAM,6BAA6B,yCAAyC,CAAC;AAEpF,oBAAY,gBAAgB;IAC1B,WAAW,iBAAiB;IAC5B,MAAM,WAAW;IACjB,GAAG,QAAQ;CACZ;AAED,oBAAY,eAAe;IACzB,WAAW,iBAAiB;IAC5B,QAAQ,cAAc;IACtB,SAAS,eAAe;IACxB,aAAa,mBAAmB;IAChC,YAAY,kBAAkB;CAC/B;AAED,oBAAY,iBAAiB;IAC3B,QAAQ,cAAc;IACtB,YAAY,kBAAkB;IAC9B,aAAa,mBAAmB;CACjC;AAED,oBAAY,iBAAiB;IAC3B,IAAI,SAAS;IACb,IAAI,SAAS;IACb,QAAQ,cAAc;CACvB;AAED,oBAAY,iBAAiB;IAC3B,IAAI,SAAS;IACb,IAAI,SAAS;IACb,IAAI,SAAS;IACb,OAAO,YAAY;CACpB;AAED,MAAM,WAAW,sBAAsB;IACrC,sDAAsD;IACtD,EAAE,EAAE,MAAM,CAAC;IACX,4EAA4E;IAC5E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8DAA8D;IAC9D,OAAO,EAAE,MAAM,CAAC;IAChB,kEAAkE;IAClE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kCAAkC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,IAAI,CAAC,EAAE,eAAe,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1C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sCAAsC;IACtC,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,gCAAgC,CAAC;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,cAAc,CAC5B,UAAU,EAAE,sBAAsB,EAClC,OAAO,EAAE,sBAAsB,GAC9B,qBAAqB,CAiCvB"}
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom checks registry and report convention.
|
|
3
|
+
*
|
|
4
|
+
* A "custom check" is a deterministic, project-script-style validation a
|
|
5
|
+
* rule wants attached to it. The engine never executes the script unless
|
|
6
|
+
* the user explicitly opts in (`shrk checks run --execute`). The report
|
|
7
|
+
* convention is `sharkcraft.custom-check/v1`.
|
|
8
|
+
*
|
|
9
|
+
* Custom-check metadata lives on the rule entry under
|
|
10
|
+
* `metadata.checks: ICustomCheckDescriptor[]`. The engine never invents
|
|
11
|
+
* a check; we only inventory what authors declare.
|
|
12
|
+
*
|
|
13
|
+
* Hard rules:
|
|
14
|
+
* - No spawning a process by default.
|
|
15
|
+
* - Read-only inventory unless `--execute` is set explicitly.
|
|
16
|
+
* - Three input formats supported: JSON-report (preferred), text
|
|
17
|
+
* output, command-only (exit-code = signal).
|
|
18
|
+
*/
|
|
19
|
+
import { spawnSync } from 'node:child_process';
|
|
20
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
21
|
+
import * as nodePath from 'node:path';
|
|
22
|
+
import { KnowledgeType } from '@shrkcrft/knowledge';
|
|
23
|
+
export const CUSTOM_CHECK_REPORT_SCHEMA = 'sharkcraft.custom-check/v1';
|
|
24
|
+
export const CUSTOM_CHECKS_REGISTRY_SCHEMA = 'sharkcraft.custom-checks-registry/v1';
|
|
25
|
+
export var CustomCheckScope;
|
|
26
|
+
(function (CustomCheckScope) {
|
|
27
|
+
CustomCheckScope["ChangedOnly"] = "changed-only";
|
|
28
|
+
CustomCheckScope["Staged"] = "staged";
|
|
29
|
+
CustomCheckScope["All"] = "all";
|
|
30
|
+
})(CustomCheckScope || (CustomCheckScope = {}));
|
|
31
|
+
export var CustomCheckKind;
|
|
32
|
+
(function (CustomCheckKind) {
|
|
33
|
+
CustomCheckKind["ImportGraph"] = "import-graph";
|
|
34
|
+
CustomCheckKind["AstShape"] = "ast-shape";
|
|
35
|
+
CustomCheckKind["TextShape"] = "text-shape";
|
|
36
|
+
CustomCheckKind["ProjectScript"] = "project-script";
|
|
37
|
+
CustomCheckKind["ExternalTool"] = "external-tool";
|
|
38
|
+
})(CustomCheckKind || (CustomCheckKind = {}));
|
|
39
|
+
export var CustomCheckSafety;
|
|
40
|
+
(function (CustomCheckSafety) {
|
|
41
|
+
CustomCheckSafety["ReadOnly"] = "read-only";
|
|
42
|
+
CustomCheckSafety["WritesReport"] = "writes-report";
|
|
43
|
+
CustomCheckSafety["WritesPreview"] = "writes-preview";
|
|
44
|
+
})(CustomCheckSafety || (CustomCheckSafety = {}));
|
|
45
|
+
export var CustomCheckOutput;
|
|
46
|
+
(function (CustomCheckOutput) {
|
|
47
|
+
CustomCheckOutput["Json"] = "json";
|
|
48
|
+
CustomCheckOutput["Text"] = "text";
|
|
49
|
+
CustomCheckOutput["ExitCode"] = "exit-code";
|
|
50
|
+
})(CustomCheckOutput || (CustomCheckOutput = {}));
|
|
51
|
+
export var CustomCheckStatus;
|
|
52
|
+
(function (CustomCheckStatus) {
|
|
53
|
+
CustomCheckStatus["Pass"] = "pass";
|
|
54
|
+
CustomCheckStatus["Warn"] = "warn";
|
|
55
|
+
CustomCheckStatus["Fail"] = "fail";
|
|
56
|
+
CustomCheckStatus["Skipped"] = "skipped";
|
|
57
|
+
})(CustomCheckStatus || (CustomCheckStatus = {}));
|
|
58
|
+
const ID_RE = /^[a-z][a-z0-9.-]+$/;
|
|
59
|
+
/** Read the descriptors a rule declares under `metadata.checks`. */
|
|
60
|
+
export function readDescriptorsFromRule(rule) {
|
|
61
|
+
const md = rule.metadata;
|
|
62
|
+
const raw = md?.['checks'];
|
|
63
|
+
if (!Array.isArray(raw))
|
|
64
|
+
return [];
|
|
65
|
+
return raw.map((r) => ({ ...r, ownerRuleId: rule.id }));
|
|
66
|
+
}
|
|
67
|
+
export function buildCustomChecksRegistry(entries) {
|
|
68
|
+
const out = [];
|
|
69
|
+
const idIndex = new Map();
|
|
70
|
+
const invalid = [];
|
|
71
|
+
for (const e of entries) {
|
|
72
|
+
if (String(e.type) !== KnowledgeType.Rule)
|
|
73
|
+
continue;
|
|
74
|
+
const descriptors = readDescriptorsFromRule(e);
|
|
75
|
+
for (const d of descriptors) {
|
|
76
|
+
const warnings = [];
|
|
77
|
+
if (!d.id || typeof d.id !== 'string') {
|
|
78
|
+
invalid.push({ ruleId: e.id, reason: 'check entry missing string id' });
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
if (!ID_RE.test(d.id)) {
|
|
82
|
+
warnings.push(`id "${d.id}" should match ${ID_RE.source}`);
|
|
83
|
+
}
|
|
84
|
+
if (!d.command || typeof d.command !== 'string') {
|
|
85
|
+
invalid.push({ ruleId: e.id, reason: `check "${d.id}" missing command` });
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
if (d.output === CustomCheckOutput.Json && !d.reportPath) {
|
|
89
|
+
warnings.push(`check "${d.id}" declares JSON output but has no reportPath`);
|
|
90
|
+
}
|
|
91
|
+
if (d.safety === undefined) {
|
|
92
|
+
warnings.push(`check "${d.id}" did not declare safety; defaulting to read-only`);
|
|
93
|
+
}
|
|
94
|
+
const list = idIndex.get(d.id) ?? [];
|
|
95
|
+
list.push(e.id);
|
|
96
|
+
idIndex.set(d.id, list);
|
|
97
|
+
out.push({ descriptor: d, ruleId: e.id, warnings });
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
const duplicates = [];
|
|
101
|
+
for (const [id, ruleIds] of idIndex) {
|
|
102
|
+
if (ruleIds.length > 1)
|
|
103
|
+
duplicates.push({ id, ruleIds });
|
|
104
|
+
}
|
|
105
|
+
return {
|
|
106
|
+
schema: CUSTOM_CHECKS_REGISTRY_SCHEMA,
|
|
107
|
+
generatedAt: new Date().toISOString(),
|
|
108
|
+
entries: out,
|
|
109
|
+
duplicates,
|
|
110
|
+
invalid,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
export function doctorCustomChecks(registry) {
|
|
114
|
+
const details = [];
|
|
115
|
+
for (const inv of registry.invalid) {
|
|
116
|
+
details.push({ ruleId: inv.ruleId, checkId: '(invalid)', severity: 'error', message: inv.reason });
|
|
117
|
+
}
|
|
118
|
+
for (const dup of registry.duplicates) {
|
|
119
|
+
details.push({
|
|
120
|
+
ruleId: dup.ruleIds.join(','),
|
|
121
|
+
checkId: dup.id,
|
|
122
|
+
severity: 'error',
|
|
123
|
+
message: `duplicate check id "${dup.id}" declared by rules ${dup.ruleIds.join(', ')}`,
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
for (const e of registry.entries) {
|
|
127
|
+
for (const w of e.warnings) {
|
|
128
|
+
details.push({
|
|
129
|
+
ruleId: e.ruleId,
|
|
130
|
+
checkId: e.descriptor.id,
|
|
131
|
+
severity: 'warning',
|
|
132
|
+
message: w,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return {
|
|
137
|
+
schema: 'sharkcraft.custom-checks-doctor/v1',
|
|
138
|
+
generatedAt: new Date().toISOString(),
|
|
139
|
+
totalChecks: registry.entries.length,
|
|
140
|
+
warnings: details.filter((d) => d.severity === 'warning').length,
|
|
141
|
+
errors: details.filter((d) => d.severity === 'error').length,
|
|
142
|
+
details,
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Parse a custom-check report from a known location. Supports the JSON
|
|
147
|
+
* convention (preferred), and a text fallback that turns each line into
|
|
148
|
+
* a `severity:warning, message: line` finding.
|
|
149
|
+
*/
|
|
150
|
+
export function parseCustomCheckReportFromFile(filePath, expectedCheckId) {
|
|
151
|
+
if (!existsSync(filePath)) {
|
|
152
|
+
return { ok: false, reason: `report file does not exist: ${filePath}` };
|
|
153
|
+
}
|
|
154
|
+
const raw = readFileSync(filePath, 'utf8');
|
|
155
|
+
return parseCustomCheckReport(raw, expectedCheckId);
|
|
156
|
+
}
|
|
157
|
+
export function parseCustomCheckReport(raw, expectedCheckId) {
|
|
158
|
+
const trimmed = raw.trim();
|
|
159
|
+
if (trimmed.length === 0)
|
|
160
|
+
return { ok: false, reason: 'empty report' };
|
|
161
|
+
if (trimmed.startsWith('{')) {
|
|
162
|
+
let parsed;
|
|
163
|
+
try {
|
|
164
|
+
parsed = JSON.parse(trimmed);
|
|
165
|
+
}
|
|
166
|
+
catch (e) {
|
|
167
|
+
return { ok: false, reason: `JSON parse failed: ${e.message}` };
|
|
168
|
+
}
|
|
169
|
+
if (parsed['schema'] !== CUSTOM_CHECK_REPORT_SCHEMA) {
|
|
170
|
+
return {
|
|
171
|
+
ok: false,
|
|
172
|
+
reason: `report schema mismatch — got "${String(parsed['schema'])}" expected "${CUSTOM_CHECK_REPORT_SCHEMA}"`,
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
if (typeof parsed['checkId'] !== 'string') {
|
|
176
|
+
return { ok: false, reason: 'report missing checkId' };
|
|
177
|
+
}
|
|
178
|
+
if (expectedCheckId && parsed['checkId'] !== expectedCheckId) {
|
|
179
|
+
return {
|
|
180
|
+
ok: false,
|
|
181
|
+
reason: `report checkId "${String(parsed['checkId'])}" does not match expected "${expectedCheckId}"`,
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
const findingsRaw = Array.isArray(parsed['findings']) ? parsed['findings'] : [];
|
|
185
|
+
const findings = findingsRaw.map((f) => ({
|
|
186
|
+
severity: f['severity'] ?? 'warning',
|
|
187
|
+
file: typeof f['file'] === 'string' ? f['file'] : undefined,
|
|
188
|
+
message: typeof f['message'] === 'string' ? f['message'] : '(no message)',
|
|
189
|
+
suggestedAction: typeof f['suggestedAction'] === 'string' ? f['suggestedAction'] : undefined,
|
|
190
|
+
safeToAutoFix: typeof f['safeToAutoFix'] === 'boolean' ? f['safeToAutoFix'] : false,
|
|
191
|
+
}));
|
|
192
|
+
const status = parsed['status'] ?? CustomCheckStatus.Pass;
|
|
193
|
+
return {
|
|
194
|
+
ok: true,
|
|
195
|
+
report: {
|
|
196
|
+
schema: CUSTOM_CHECK_REPORT_SCHEMA,
|
|
197
|
+
checkId: parsed['checkId'],
|
|
198
|
+
ruleId: typeof parsed['ruleId'] === 'string' ? parsed['ruleId'] : undefined,
|
|
199
|
+
generatedAt: typeof parsed['generatedAt'] === 'string' ? parsed['generatedAt'] : new Date().toISOString(),
|
|
200
|
+
status,
|
|
201
|
+
findings,
|
|
202
|
+
metadata: parsed['metadata'] ?? undefined,
|
|
203
|
+
},
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
// Text fallback: every non-empty line becomes a finding.
|
|
207
|
+
const findings = trimmed
|
|
208
|
+
.split('\n')
|
|
209
|
+
.map((l) => l.trim())
|
|
210
|
+
.filter((l) => l.length > 0)
|
|
211
|
+
.map((l) => ({ severity: 'warning', message: l }));
|
|
212
|
+
return {
|
|
213
|
+
ok: true,
|
|
214
|
+
report: {
|
|
215
|
+
schema: CUSTOM_CHECK_REPORT_SCHEMA,
|
|
216
|
+
checkId: expectedCheckId ?? '(text)',
|
|
217
|
+
generatedAt: new Date().toISOString(),
|
|
218
|
+
status: findings.length > 0 ? CustomCheckStatus.Warn : CustomCheckStatus.Pass,
|
|
219
|
+
findings,
|
|
220
|
+
},
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
export function runCustomCheck(descriptor, options) {
|
|
224
|
+
const result = {
|
|
225
|
+
schema: 'sharkcraft.custom-check-run/v1',
|
|
226
|
+
checkId: descriptor.id,
|
|
227
|
+
ownerRuleId: descriptor.ownerRuleId,
|
|
228
|
+
command: descriptor.command,
|
|
229
|
+
executed: false,
|
|
230
|
+
exitCode: null,
|
|
231
|
+
};
|
|
232
|
+
if (!options.execute) {
|
|
233
|
+
result.reason = 'execute flag not set; printing command only';
|
|
234
|
+
return result;
|
|
235
|
+
}
|
|
236
|
+
const child = spawnSync(descriptor.command, {
|
|
237
|
+
cwd: options.cwd,
|
|
238
|
+
shell: true,
|
|
239
|
+
encoding: 'utf8',
|
|
240
|
+
env: { ...process.env, ...(options.env ?? {}) },
|
|
241
|
+
timeout: options.timeoutMs ?? 60_000,
|
|
242
|
+
maxBuffer: 8 * 1024 * 1024,
|
|
243
|
+
});
|
|
244
|
+
result.executed = true;
|
|
245
|
+
result.exitCode = child.status ?? null;
|
|
246
|
+
if (child.stderr)
|
|
247
|
+
result.stderr = String(child.stderr).slice(0, 4_000);
|
|
248
|
+
if (child.stdout)
|
|
249
|
+
result.stdoutSummary = String(child.stdout).slice(0, 4_000);
|
|
250
|
+
const reportPath = options.reportPath ?? descriptor.reportPath;
|
|
251
|
+
if (reportPath) {
|
|
252
|
+
const abs = nodePath.isAbsolute(reportPath) ? reportPath : nodePath.resolve(options.cwd, reportPath);
|
|
253
|
+
const parsed = parseCustomCheckReportFromFile(abs, descriptor.id);
|
|
254
|
+
if (parsed.ok)
|
|
255
|
+
result.report = parsed.report;
|
|
256
|
+
else
|
|
257
|
+
result.reason = `parse failed: ${parsed.reason}`;
|
|
258
|
+
}
|
|
259
|
+
return result;
|
|
260
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { IDashboardAdoptionResponse, IDashboardArchitectureResponse, IDashboardBoundaryResponse, IDashboardCapabilitiesResponse, IDashboardCommandsResponse, IDashboardCoverageResponse, IDashboardDoctorResponse, IDashboardDriftResponse, IDashboardGraphNodeResponse, IDashboardGraphPathResponse, IDashboardGraphResponse, IDashboardHealthResponse, IDashboardMcpResponse, IDashboardOnboardingResponse, IDashboardOverviewResponse, IDashboardPacksResponse, IDashboardPipelinesResponse, IDashboardPresetsResponse, IDashboardQualityResponse, IDashboardReportsResponse, IDashboardReviewResponse, IDashboardSafetyResponse, IDashboardScaffoldsResponse, IDashboardSchemasResponse, IDashboardSessionDetailResponse, IDashboardSessionsResponse, IDashboardStatsResponse } from '@shrkcrft/dashboard-api';
|
|
2
|
+
import type { ISharkcraftInspection } from '../sharkcraft-inspector.js';
|
|
3
|
+
import { type IQualityConfig } from '../quality-report.js';
|
|
4
|
+
export declare function buildDashboardOverview(inspection: ISharkcraftInspection): Promise<IDashboardOverviewResponse>;
|
|
5
|
+
export declare function buildDashboardDoctor(inspection: ISharkcraftInspection): IDashboardDoctorResponse;
|
|
6
|
+
export declare function buildDashboardQuality(inspection: ISharkcraftInspection, options?: {
|
|
7
|
+
qualityConfig?: IQualityConfig;
|
|
8
|
+
}): Promise<IDashboardQualityResponse>;
|
|
9
|
+
export declare function buildDashboardSafety(inspection: ISharkcraftInspection, catalog: ReadonlyArray<{
|
|
10
|
+
command: string;
|
|
11
|
+
description: string;
|
|
12
|
+
category: string;
|
|
13
|
+
safetyLevel: string;
|
|
14
|
+
writesFiles: boolean;
|
|
15
|
+
writesSource: boolean;
|
|
16
|
+
runsShell: boolean;
|
|
17
|
+
requiresReview: boolean;
|
|
18
|
+
mcpAvailable: boolean;
|
|
19
|
+
}>, mcpTools: ReadonlyArray<{
|
|
20
|
+
name: string;
|
|
21
|
+
description: string;
|
|
22
|
+
}>): IDashboardSafetyResponse;
|
|
23
|
+
export declare function buildDashboardCommands(catalog: ReadonlyArray<{
|
|
24
|
+
command: string;
|
|
25
|
+
description: string;
|
|
26
|
+
category: string;
|
|
27
|
+
safetyLevel: string;
|
|
28
|
+
}>): IDashboardCommandsResponse;
|
|
29
|
+
export declare function buildDashboardPacks(inspection: ISharkcraftInspection): IDashboardPacksResponse;
|
|
30
|
+
export declare function buildDashboardPresets(inspection: ISharkcraftInspection): IDashboardPresetsResponse;
|
|
31
|
+
export declare function buildDashboardPipelines(inspection: ISharkcraftInspection): IDashboardPipelinesResponse;
|
|
32
|
+
export declare function buildDashboardSessions(projectRoot: string): IDashboardSessionsResponse;
|
|
33
|
+
export declare function buildDashboardSessionDetail(projectRoot: string, sessionId: string): IDashboardSessionDetailResponse;
|
|
34
|
+
export declare function buildDashboardArchitecture(inspection: ISharkcraftInspection): IDashboardArchitectureResponse;
|
|
35
|
+
export declare function buildDashboardBoundaries(inspection: ISharkcraftInspection): IDashboardBoundaryResponse;
|
|
36
|
+
export declare function buildDashboardDrift(inspection: ISharkcraftInspection): IDashboardDriftResponse;
|
|
37
|
+
export declare function buildDashboardCoverage(inspection: ISharkcraftInspection): IDashboardCoverageResponse;
|
|
38
|
+
export declare function buildDashboardGraph(inspection: ISharkcraftInspection): IDashboardGraphResponse;
|
|
39
|
+
export declare function buildDashboardGraphNode(inspection: ISharkcraftInspection, id: string): IDashboardGraphNodeResponse;
|
|
40
|
+
export declare function buildDashboardGraphPath(inspection: ISharkcraftInspection, from: string, to: string): IDashboardGraphPathResponse;
|
|
41
|
+
export declare function buildDashboardOnboarding(inspection: ISharkcraftInspection): IDashboardOnboardingResponse;
|
|
42
|
+
export declare function buildDashboardAdoption(inspection: ISharkcraftInspection): IDashboardAdoptionResponse;
|
|
43
|
+
export declare function buildDashboardReports(inspection: ISharkcraftInspection): IDashboardReportsResponse;
|
|
44
|
+
export declare function buildDashboardReview(_inspection: ISharkcraftInspection, options?: {
|
|
45
|
+
packetPath?: string;
|
|
46
|
+
}): IDashboardReviewResponse;
|
|
47
|
+
export declare function buildDashboardScaffolds(inspection: ISharkcraftInspection): Promise<IDashboardScaffoldsResponse>;
|
|
48
|
+
export declare function buildDashboardSchemas(): IDashboardSchemasResponse;
|
|
49
|
+
export declare function buildDashboardMcpSummary(toolNames: ReadonlyArray<{
|
|
50
|
+
name: string;
|
|
51
|
+
description?: string;
|
|
52
|
+
}>): IDashboardMcpResponse;
|
|
53
|
+
export declare function buildDashboardHealth(uptimeSeconds: number): IDashboardHealthResponse;
|
|
54
|
+
export declare function buildDashboardStats(cwd: string, opts?: {
|
|
55
|
+
maxTopFiles?: number;
|
|
56
|
+
language?: string;
|
|
57
|
+
}): Promise<IDashboardStatsResponse>;
|
|
58
|
+
export declare function buildDashboardCapabilities(availability?: Partial<IDashboardCapabilitiesResponse>): IDashboardCapabilitiesResponse;
|
|
59
|
+
//# sourceMappingURL=dashboard-data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard-data.d.ts","sourceRoot":"","sources":["../../src/dashboard/dashboard-data.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACV,0BAA0B,EAC1B,8BAA8B,EAC9B,0BAA0B,EAC1B,8BAA8B,EAC9B,0BAA0B,EAC1B,0BAA0B,EAC1B,wBAAwB,EACxB,uBAAuB,EACvB,2BAA2B,EAC3B,2BAA2B,EAC3B,uBAAuB,EACvB,wBAAwB,EACxB,qBAAqB,EACrB,4BAA4B,EAC5B,0BAA0B,EAC1B,uBAAuB,EACvB,2BAA2B,EAC3B,yBAAyB,EACzB,yBAAyB,EACzB,yBAAyB,EACzB,wBAAwB,EACxB,wBAAwB,EACxB,2BAA2B,EAC3B,yBAAyB,EACzB,+BAA+B,EAC/B,0BAA0B,EAC1B,uBAAuB,EAIxB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAgBxE,OAAO,EAAsB,KAAK,cAAc,EAAE,MAA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