@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,653 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dashboard data service. Functions return plain JSON-compatible payloads —
|
|
3
|
+
* never start an HTTP server, never call out to the network. The dashboard
|
|
4
|
+
* API server wraps these with @shrkcrft/dashboard-api envelopes.
|
|
5
|
+
*
|
|
6
|
+
* Each builder:
|
|
7
|
+
* - catches expected missing-file cases and reports them as `warnings`
|
|
8
|
+
* - returns `available: false` when a feature has no data yet
|
|
9
|
+
* - includes copyable CLI command hints
|
|
10
|
+
* - includes safety metadata where relevant
|
|
11
|
+
*/
|
|
12
|
+
import { existsSync, statSync } from 'node:fs';
|
|
13
|
+
import * as nodePath from 'node:path';
|
|
14
|
+
import { buildAiReadinessReport } from "../ai-readiness.js";
|
|
15
|
+
import { runDoctor } from "../sharkcraft-inspector.js";
|
|
16
|
+
import { DoctorSeverity } from "../doctor-result.js";
|
|
17
|
+
import { buildCoverageReport } from "../coverage-report.js";
|
|
18
|
+
import { buildDriftReport } from "../drift.js";
|
|
19
|
+
import { buildKnowledgeGraph, findGraphPath, getGraphNode } from "../knowledge-graph.js";
|
|
20
|
+
import { buildOnboardingPlan } from "../onboarding.js";
|
|
21
|
+
import { ADOPTION_STATE_SCHEMA, adoptionDir, computeAdoptionFreshness, readAdoptionState, } from "../adoption-state.js";
|
|
22
|
+
import { listDevSessionsDetailed, scanDevSession } from "../dev-session.js";
|
|
23
|
+
import { loadScaffoldPatternsFromInspection } from "../scaffold-patterns.js";
|
|
24
|
+
import { buildQualityReport } from "../quality-report.js";
|
|
25
|
+
import { buildSafetyAudit } from "../safety-audit.js";
|
|
26
|
+
import { buildRepositoryStats } from "../repository-stats.js";
|
|
27
|
+
/* -------------------------------------------------------------------------- */
|
|
28
|
+
/* shared helpers */
|
|
29
|
+
/* -------------------------------------------------------------------------- */
|
|
30
|
+
function artifactRef(id, path, opts) {
|
|
31
|
+
let exists = false;
|
|
32
|
+
let bytes;
|
|
33
|
+
let modifiedAt;
|
|
34
|
+
try {
|
|
35
|
+
const st = statSync(path);
|
|
36
|
+
exists = true;
|
|
37
|
+
bytes = st.size;
|
|
38
|
+
modifiedAt = st.mtime.toISOString();
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
exists = false;
|
|
42
|
+
}
|
|
43
|
+
const ref = { id, path, exists };
|
|
44
|
+
if (bytes !== undefined)
|
|
45
|
+
ref.bytes = bytes;
|
|
46
|
+
if (modifiedAt !== undefined)
|
|
47
|
+
ref.modifiedAt = modifiedAt;
|
|
48
|
+
if (opts?.title)
|
|
49
|
+
ref.title = opts.title;
|
|
50
|
+
if (opts?.format)
|
|
51
|
+
ref.format = opts.format;
|
|
52
|
+
return ref;
|
|
53
|
+
}
|
|
54
|
+
function commandHint(command, purpose, safety) {
|
|
55
|
+
return safety ? { command, purpose, safety } : { command, purpose };
|
|
56
|
+
}
|
|
57
|
+
function mapSafetyLevel(level) {
|
|
58
|
+
switch (level) {
|
|
59
|
+
case 'read-only':
|
|
60
|
+
case 'writes-drafts':
|
|
61
|
+
case 'writes-source':
|
|
62
|
+
case 'runs-shell':
|
|
63
|
+
return level;
|
|
64
|
+
case 'writes-session':
|
|
65
|
+
return 'writes-drafts';
|
|
66
|
+
case 'requires-review':
|
|
67
|
+
return 'writes-source';
|
|
68
|
+
default:
|
|
69
|
+
return 'unknown';
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
function mapDoctorSeverity(s) {
|
|
73
|
+
switch (s) {
|
|
74
|
+
case DoctorSeverity.Ok:
|
|
75
|
+
return 'ok';
|
|
76
|
+
case DoctorSeverity.Info:
|
|
77
|
+
return 'info';
|
|
78
|
+
case DoctorSeverity.Warning:
|
|
79
|
+
return 'warning';
|
|
80
|
+
case DoctorSeverity.Error:
|
|
81
|
+
return 'error';
|
|
82
|
+
default:
|
|
83
|
+
return 'info';
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
/* -------------------------------------------------------------------------- */
|
|
87
|
+
/* overview / doctor */
|
|
88
|
+
/* -------------------------------------------------------------------------- */
|
|
89
|
+
export async function buildDashboardOverview(inspection) {
|
|
90
|
+
const readiness = buildAiReadinessReport(inspection);
|
|
91
|
+
const scaffolds = await loadScaffoldPatternsFromInspection(inspection);
|
|
92
|
+
return {
|
|
93
|
+
readiness: { score: readiness.score, verdict: readiness.grade },
|
|
94
|
+
sharkcraftPresent: inspection.hasSharkcraftFolder,
|
|
95
|
+
configPresent: inspection.configFile != null,
|
|
96
|
+
summary: {
|
|
97
|
+
rules: inspection.ruleService.list().length,
|
|
98
|
+
paths: inspection.pathService.list().length,
|
|
99
|
+
templates: inspection.templateRegistry.list().length,
|
|
100
|
+
pipelines: inspection.pipelineRegistry.list().length,
|
|
101
|
+
presets: inspection.presetRegistry.list().length,
|
|
102
|
+
packs: inspection.packs.discoveredPacks.length,
|
|
103
|
+
scaffoldPatterns: scaffolds.patterns.length,
|
|
104
|
+
knowledgeEntries: inspection.knowledgeEntries.length,
|
|
105
|
+
},
|
|
106
|
+
topRecommendations: readiness.topRecommendations.slice(0, 5),
|
|
107
|
+
featureAvailability: {
|
|
108
|
+
adoption: existsSync(nodePath.join(inspection.projectRoot, 'sharkcraft', 'onboarding', 'adoption')),
|
|
109
|
+
onboarding: existsSync(nodePath.join(inspection.projectRoot, 'sharkcraft', 'onboarding')),
|
|
110
|
+
sessions: existsSync(nodePath.join(inspection.projectRoot, '.sharkcraft', 'sessions')),
|
|
111
|
+
packs: inspection.packs.discoveredPacks.length > 0,
|
|
112
|
+
presets: inspection.presetRegistry.list().length > 0,
|
|
113
|
+
scaffolds: scaffolds.patterns.length > 0,
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
export function buildDashboardDoctor(inspection) {
|
|
118
|
+
const doctor = runDoctor(inspection);
|
|
119
|
+
const checks = doctor.checks.map((c) => {
|
|
120
|
+
const level = mapDoctorSeverity(c.severity);
|
|
121
|
+
return {
|
|
122
|
+
id: c.id,
|
|
123
|
+
label: c.title,
|
|
124
|
+
level,
|
|
125
|
+
...(c.message ? { message: c.message } : {}),
|
|
126
|
+
...(c.fix ? { fix: c.fix } : {}),
|
|
127
|
+
};
|
|
128
|
+
});
|
|
129
|
+
return {
|
|
130
|
+
verdict: doctor.passed ? 'ready' : 'not-ready',
|
|
131
|
+
readinessScore: buildAiReadinessReport(inspection).score,
|
|
132
|
+
checks,
|
|
133
|
+
summary: doctor.summary,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
/* -------------------------------------------------------------------------- */
|
|
137
|
+
/* quality / safety */
|
|
138
|
+
/* -------------------------------------------------------------------------- */
|
|
139
|
+
export async function buildDashboardQuality(inspection, options) {
|
|
140
|
+
const report = await buildQualityReport({
|
|
141
|
+
inspection,
|
|
142
|
+
config: options?.qualityConfig ?? {},
|
|
143
|
+
skipShell: true,
|
|
144
|
+
});
|
|
145
|
+
return {
|
|
146
|
+
score: report.score,
|
|
147
|
+
readiness: report.overall,
|
|
148
|
+
gates: report.gates.map((g) => ({
|
|
149
|
+
id: g.id,
|
|
150
|
+
status: (g.passed ? 'pass' : g.blocking ? 'fail' : 'warn'),
|
|
151
|
+
...(g.notes && g.notes.length > 0 ? { message: g.notes.join('; ') } : {}),
|
|
152
|
+
})),
|
|
153
|
+
blockers: report.gates.filter((g) => !g.passed && g.blocking).map((g) => g.label),
|
|
154
|
+
warnings: report.gates.filter((g) => !g.passed && !g.blocking).map((g) => g.label),
|
|
155
|
+
artifacts: [],
|
|
156
|
+
commandHints: [
|
|
157
|
+
commandHint('shrk report quality --format html --output ./quality.html', 'Render the polished HTML report', 'read-only'),
|
|
158
|
+
commandHint('shrk quality --json', 'Get the raw JSON for CI', 'read-only'),
|
|
159
|
+
],
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
export function buildDashboardSafety(inspection, catalog, mcpTools) {
|
|
163
|
+
const audit = buildSafetyAudit({
|
|
164
|
+
inspection,
|
|
165
|
+
catalog,
|
|
166
|
+
mcpTools,
|
|
167
|
+
});
|
|
168
|
+
return {
|
|
169
|
+
mcpReadOnly: !audit.mcp.anyWritable,
|
|
170
|
+
writeCapableCommands: audit.commands.writesSource
|
|
171
|
+
.concat(audit.commands.writesDrafts)
|
|
172
|
+
.concat(audit.commands.writesSession)
|
|
173
|
+
.map((c) => c.command),
|
|
174
|
+
shellRunningCommands: audit.commands.runsShell.map((c) => c.command),
|
|
175
|
+
verificationCommandTrust: audit.verifications.pack.length > 0
|
|
176
|
+
? 'mixed'
|
|
177
|
+
: audit.verifications.untrusted.length > 0
|
|
178
|
+
? 'pack-untrusted'
|
|
179
|
+
: 'config-only',
|
|
180
|
+
packSigning: {
|
|
181
|
+
required: false,
|
|
182
|
+
verified: audit.packs.signedAndVerified,
|
|
183
|
+
unsigned: audit.packs.unsigned,
|
|
184
|
+
},
|
|
185
|
+
planSigning: {
|
|
186
|
+
verifySignatureSupported: true,
|
|
187
|
+
hmacBased: true,
|
|
188
|
+
},
|
|
189
|
+
recommendations: [...audit.recommendations],
|
|
190
|
+
safetyTags: [],
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
/* -------------------------------------------------------------------------- */
|
|
194
|
+
/* commands / packs / presets / pipelines */
|
|
195
|
+
/* -------------------------------------------------------------------------- */
|
|
196
|
+
export function buildDashboardCommands(catalog) {
|
|
197
|
+
const groups = new Map();
|
|
198
|
+
for (const c of catalog)
|
|
199
|
+
groups.set(c.category, c.category);
|
|
200
|
+
return {
|
|
201
|
+
version: '1',
|
|
202
|
+
commands: catalog.map((c) => ({
|
|
203
|
+
id: c.command,
|
|
204
|
+
name: c.command,
|
|
205
|
+
description: c.description,
|
|
206
|
+
safety: { level: mapSafetyLevel(c.safetyLevel) },
|
|
207
|
+
group: c.category,
|
|
208
|
+
})),
|
|
209
|
+
groups: Array.from(groups.entries()).map(([id, label]) => ({ id, label })),
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
export function buildDashboardPacks(inspection) {
|
|
213
|
+
const packs = inspection.packs.discoveredPacks.map((p) => {
|
|
214
|
+
const counts = (p.resolvedCounts ?? p.contributionCounts ?? {});
|
|
215
|
+
return {
|
|
216
|
+
id: p.packageName,
|
|
217
|
+
name: p.packageName,
|
|
218
|
+
version: p.packageVersion,
|
|
219
|
+
signed: p.signatureStatus === 'verified',
|
|
220
|
+
resolvedCounts: counts,
|
|
221
|
+
source: p.packageName,
|
|
222
|
+
warnings: p.validationIssues.map((v) => `${v.field}: ${v.message}`),
|
|
223
|
+
};
|
|
224
|
+
});
|
|
225
|
+
return { available: packs.length > 0, packs };
|
|
226
|
+
}
|
|
227
|
+
export function buildDashboardPresets(inspection) {
|
|
228
|
+
const presets = inspection.presetRegistry.list().map((p) => {
|
|
229
|
+
const src = inspection.presetSources.get(p.id);
|
|
230
|
+
const out = {
|
|
231
|
+
id: p.id,
|
|
232
|
+
title: p.title ?? p.id,
|
|
233
|
+
...(p.description ? { description: p.description } : {}),
|
|
234
|
+
...(src ? { source: src.packageName ?? src.type } : {}),
|
|
235
|
+
};
|
|
236
|
+
return out;
|
|
237
|
+
});
|
|
238
|
+
return { available: presets.length > 0, presets };
|
|
239
|
+
}
|
|
240
|
+
export function buildDashboardPipelines(inspection) {
|
|
241
|
+
const pipelines = inspection.pipelineRegistry.list().map((p) => ({
|
|
242
|
+
id: p.id,
|
|
243
|
+
title: p.title ?? p.id,
|
|
244
|
+
steps: Array.isArray(p.steps) ? p.steps.length : 0,
|
|
245
|
+
}));
|
|
246
|
+
return { available: pipelines.length > 0, pipelines };
|
|
247
|
+
}
|
|
248
|
+
/* -------------------------------------------------------------------------- */
|
|
249
|
+
/* sessions */
|
|
250
|
+
/* -------------------------------------------------------------------------- */
|
|
251
|
+
export function buildDashboardSessions(projectRoot) {
|
|
252
|
+
try {
|
|
253
|
+
const items = listDevSessionsDetailed(projectRoot);
|
|
254
|
+
return {
|
|
255
|
+
available: true,
|
|
256
|
+
sessions: items.map((it) => {
|
|
257
|
+
const out = { id: it.id };
|
|
258
|
+
if (it.task)
|
|
259
|
+
out.task = it.task;
|
|
260
|
+
if (it.phase)
|
|
261
|
+
out.status = it.phase;
|
|
262
|
+
if (it.createdAt)
|
|
263
|
+
out.startedAt = it.createdAt;
|
|
264
|
+
return out;
|
|
265
|
+
}),
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
catch {
|
|
269
|
+
return { available: false, sessions: [] };
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
export function buildDashboardSessionDetail(projectRoot, sessionId) {
|
|
273
|
+
const load = scanDevSession(projectRoot, sessionId);
|
|
274
|
+
if (!load) {
|
|
275
|
+
return {
|
|
276
|
+
available: false,
|
|
277
|
+
sessionId,
|
|
278
|
+
artifacts: [],
|
|
279
|
+
commandHints: [commandHint(`shrk dev list`, 'List known sessions', 'read-only')],
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
const sessionDir = nodePath.join(projectRoot, '.sharkcraft', 'sessions', sessionId);
|
|
283
|
+
const artifacts = [];
|
|
284
|
+
artifacts.push(artifactRef('session-state', nodePath.join(sessionDir, 'session.json'), { format: 'json' }));
|
|
285
|
+
for (const r of load.reportsOnDisk) {
|
|
286
|
+
artifacts.push(artifactRef(`report-${r}`, nodePath.join(sessionDir, 'reports', r)));
|
|
287
|
+
}
|
|
288
|
+
const detail = {
|
|
289
|
+
available: true,
|
|
290
|
+
sessionId,
|
|
291
|
+
task: load.task,
|
|
292
|
+
artifacts,
|
|
293
|
+
plans: load.plansOnDisk.map((p) => ({ id: p, path: nodePath.join(sessionDir, 'plans', p) })),
|
|
294
|
+
commandHints: [
|
|
295
|
+
commandHint(`shrk dev open ${sessionId} --serve --live --port 0`, 'Open the session HTML report and watch updates', 'read-only'),
|
|
296
|
+
commandHint(`shrk report session ${sessionId} --format html --output ./session.html`, 'Render a standalone HTML report', 'read-only'),
|
|
297
|
+
],
|
|
298
|
+
};
|
|
299
|
+
if (load.state) {
|
|
300
|
+
detail.status = load.state.phase;
|
|
301
|
+
detail.startedAt = load.state.createdAt;
|
|
302
|
+
}
|
|
303
|
+
return detail;
|
|
304
|
+
}
|
|
305
|
+
/* -------------------------------------------------------------------------- */
|
|
306
|
+
/* architecture / graph */
|
|
307
|
+
/* -------------------------------------------------------------------------- */
|
|
308
|
+
export function buildDashboardArchitecture(inspection) {
|
|
309
|
+
return {
|
|
310
|
+
available: true,
|
|
311
|
+
boundaries: buildDashboardBoundaries(inspection),
|
|
312
|
+
drift: buildDashboardDrift(inspection),
|
|
313
|
+
coverage: buildDashboardCoverage(inspection),
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
export function buildDashboardBoundaries(inspection) {
|
|
317
|
+
const rules = inspection.boundaryRegistry.list();
|
|
318
|
+
return {
|
|
319
|
+
available: rules.length > 0,
|
|
320
|
+
violations: [],
|
|
321
|
+
ruleCount: rules.length,
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
export function buildDashboardDrift(inspection) {
|
|
325
|
+
const drift = buildDriftReport(inspection);
|
|
326
|
+
return {
|
|
327
|
+
available: true,
|
|
328
|
+
items: drift.findings.map((f, idx) => ({
|
|
329
|
+
id: `${f.category}-${idx}`,
|
|
330
|
+
kind: f.category,
|
|
331
|
+
message: f.message,
|
|
332
|
+
severity: f.severity,
|
|
333
|
+
})),
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
export function buildDashboardCoverage(inspection) {
|
|
337
|
+
const coverage = buildCoverageReport(inspection);
|
|
338
|
+
return {
|
|
339
|
+
available: true,
|
|
340
|
+
axes: coverage.categories.map((c) => ({
|
|
341
|
+
id: c.id,
|
|
342
|
+
label: c.title,
|
|
343
|
+
score: c.score,
|
|
344
|
+
missing: c.missing,
|
|
345
|
+
})),
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
export function buildDashboardGraph(inspection) {
|
|
349
|
+
const graph = buildKnowledgeGraph(inspection);
|
|
350
|
+
return {
|
|
351
|
+
available: true,
|
|
352
|
+
nodes: graph.nodes.map((n) => ({ id: n.id, kind: n.kind, label: n.title })),
|
|
353
|
+
edges: graph.edges.map((e) => ({ from: e.from, to: e.to, kind: e.relation })),
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
export function buildDashboardGraphNode(inspection, id) {
|
|
357
|
+
const graph = buildKnowledgeGraph(inspection);
|
|
358
|
+
const result = getGraphNode(graph, { id });
|
|
359
|
+
if (!result || !result.node) {
|
|
360
|
+
return { id, found: false, inbound: [], outbound: [] };
|
|
361
|
+
}
|
|
362
|
+
return {
|
|
363
|
+
id,
|
|
364
|
+
found: true,
|
|
365
|
+
node: { id: result.node.id, kind: result.node.kind, label: result.node.title },
|
|
366
|
+
inbound: result.incoming.map((e) => ({ from: e.from, kind: e.relation })),
|
|
367
|
+
outbound: result.outgoing.map((e) => ({ to: e.to, kind: e.relation })),
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
export function buildDashboardGraphPath(inspection, from, to) {
|
|
371
|
+
const graph = buildKnowledgeGraph(inspection);
|
|
372
|
+
const result = findGraphPath(graph, { id: from }, { id: to });
|
|
373
|
+
if (!result.found)
|
|
374
|
+
return { from, to, found: false };
|
|
375
|
+
return {
|
|
376
|
+
from,
|
|
377
|
+
to,
|
|
378
|
+
found: true,
|
|
379
|
+
path: result.steps.map((s) => s.node),
|
|
380
|
+
...(result.reason ? { explanation: result.reason } : {}),
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
/* -------------------------------------------------------------------------- */
|
|
384
|
+
/* onboarding / adoption */
|
|
385
|
+
/* -------------------------------------------------------------------------- */
|
|
386
|
+
export function buildDashboardOnboarding(inspection) {
|
|
387
|
+
const plan = buildOnboardingPlan(inspection);
|
|
388
|
+
const draftsDir = nodePath.join(inspection.projectRoot, 'sharkcraft', 'onboarding', 'drafts');
|
|
389
|
+
return {
|
|
390
|
+
available: true,
|
|
391
|
+
draftsPath: draftsDir,
|
|
392
|
+
hasDrafts: existsSync(draftsDir),
|
|
393
|
+
summary: {
|
|
394
|
+
inferredRules: plan.inferredRules.length,
|
|
395
|
+
inferredPaths: plan.inferredPathConventions.length,
|
|
396
|
+
inferredTemplates: plan.inferredTemplateCandidates.length,
|
|
397
|
+
importedAgents: plan.detectedInstructionFiles.length,
|
|
398
|
+
},
|
|
399
|
+
commandHints: [
|
|
400
|
+
commandHint('shrk onboard --dry-run', 'Preview onboarding output without writing', 'read-only'),
|
|
401
|
+
commandHint('shrk onboard --write-drafts', 'Write inferred drafts under sharkcraft/onboarding/', 'writes-drafts'),
|
|
402
|
+
],
|
|
403
|
+
};
|
|
404
|
+
}
|
|
405
|
+
export function buildDashboardAdoption(inspection) {
|
|
406
|
+
const state = readAdoptionState(inspection.projectRoot);
|
|
407
|
+
const artifacts = [];
|
|
408
|
+
if (state) {
|
|
409
|
+
if (state.patchPath)
|
|
410
|
+
artifacts.push(artifactRef('adoption-patch', state.patchPath, { format: 'patch' }));
|
|
411
|
+
if (state.summaryPath)
|
|
412
|
+
artifacts.push(artifactRef('adoption-summary', state.summaryPath, { format: 'markdown' }));
|
|
413
|
+
if (state.reportPath)
|
|
414
|
+
artifacts.push(artifactRef('adoption-report', state.reportPath, { format: 'html' }));
|
|
415
|
+
}
|
|
416
|
+
const nextCommands = [];
|
|
417
|
+
if (!state) {
|
|
418
|
+
nextCommands.push(commandHint('shrk onboard --write-drafts', 'Generate onboarding drafts first', 'writes-drafts'), commandHint('shrk onboard adopt --write-patch', 'Build the first adoption patch', 'writes-drafts'));
|
|
419
|
+
return { available: false, nextCommands, artifacts };
|
|
420
|
+
}
|
|
421
|
+
const freshness = computeAdoptionFreshness(inspection.projectRoot, state);
|
|
422
|
+
if (freshness.status !== 'fresh') {
|
|
423
|
+
nextCommands.push(commandHint('shrk onboard adopt regenerate', 'Regenerate the adoption patch from current state', 'writes-drafts'));
|
|
424
|
+
}
|
|
425
|
+
nextCommands.push(commandHint('shrk onboard adopt status', 'Inspect adoption freshness', 'read-only'), commandHint('shrk onboard adopt merge-preview --format markdown', 'See what would change before applying', 'read-only'), commandHint('shrk onboard adopt check', 'Validate the patch can be applied', 'read-only'));
|
|
426
|
+
return {
|
|
427
|
+
available: true,
|
|
428
|
+
state: {
|
|
429
|
+
schema: ADOPTION_STATE_SCHEMA,
|
|
430
|
+
patchPath: state.patchPath,
|
|
431
|
+
summaryPath: state.summaryPath,
|
|
432
|
+
...(state.reportPath ? { reportPath: state.reportPath } : {}),
|
|
433
|
+
diffFormat: state.diffFormat,
|
|
434
|
+
freshness: {
|
|
435
|
+
status: freshness.status,
|
|
436
|
+
staleReasons: [...freshness.staleReasons],
|
|
437
|
+
changedTargets: freshness.changedTargets.map((f) => f.relativePath),
|
|
438
|
+
changedDrafts: freshness.changedDrafts.map((f) => f.relativePath),
|
|
439
|
+
missingTargets: [...freshness.missingTargets],
|
|
440
|
+
missingDrafts: [...freshness.missingDrafts],
|
|
441
|
+
},
|
|
442
|
+
categories: {
|
|
443
|
+
safeToAdopt: state.categories['safe-to-adopt']?.length ?? 0,
|
|
444
|
+
manualReview: state.categories['manual-review']?.length ?? 0,
|
|
445
|
+
lowConfidence: state.categories['low-confidence']?.length ?? 0,
|
|
446
|
+
conflicts: state.categories['conflict']?.length ?? 0,
|
|
447
|
+
alreadyCovered: state.categories['already-covered']?.length ?? 0,
|
|
448
|
+
skipped: state.categories['skipped']?.length ?? 0,
|
|
449
|
+
},
|
|
450
|
+
},
|
|
451
|
+
nextCommands,
|
|
452
|
+
artifacts,
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
/* -------------------------------------------------------------------------- */
|
|
456
|
+
/* reports / review / scaffolds */
|
|
457
|
+
/* -------------------------------------------------------------------------- */
|
|
458
|
+
export function buildDashboardReports(inspection) {
|
|
459
|
+
const projectRoot = inspection.projectRoot;
|
|
460
|
+
const sessionRoot = nodePath.join(projectRoot, '.sharkcraft', 'sessions');
|
|
461
|
+
const adoptionRoot = adoptionDir(projectRoot);
|
|
462
|
+
const reports = [
|
|
463
|
+
{
|
|
464
|
+
id: 'quality',
|
|
465
|
+
title: 'Quality report',
|
|
466
|
+
availableFormats: ['text', 'markdown', 'html', 'json'],
|
|
467
|
+
commandHint: 'shrk report quality --format html --output ./quality.html',
|
|
468
|
+
artifacts: [],
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
id: 'safety',
|
|
472
|
+
title: 'Safety audit',
|
|
473
|
+
availableFormats: ['text', 'markdown', 'html', 'json'],
|
|
474
|
+
commandHint: 'shrk report safety --format html --output ./safety.html',
|
|
475
|
+
artifacts: [],
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
id: 'adoption',
|
|
479
|
+
title: 'Adoption report',
|
|
480
|
+
availableFormats: ['text', 'markdown', 'html', 'json'],
|
|
481
|
+
commandHint: 'shrk report adoption --format html --output ./adoption.html',
|
|
482
|
+
artifacts: existsSync(adoptionRoot) ? [artifactRef('adoption-dir', adoptionRoot)] : [],
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
id: 'review',
|
|
486
|
+
title: 'Review packet renderer',
|
|
487
|
+
availableFormats: ['text', 'markdown', 'html', 'json'],
|
|
488
|
+
commandHint: 'shrk report review <packet.json> --format html --output ./review.html',
|
|
489
|
+
artifacts: [],
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
id: 'session',
|
|
493
|
+
title: 'Dev session report',
|
|
494
|
+
availableFormats: ['text', 'markdown', 'html', 'json'],
|
|
495
|
+
commandHint: 'shrk report session <id> --format html --output ./session.html',
|
|
496
|
+
artifacts: existsSync(sessionRoot) ? [artifactRef('sessions-dir', sessionRoot)] : [],
|
|
497
|
+
},
|
|
498
|
+
];
|
|
499
|
+
return { available: true, reports };
|
|
500
|
+
}
|
|
501
|
+
export function buildDashboardReview(_inspection, options) {
|
|
502
|
+
const path = options?.packetPath;
|
|
503
|
+
if (!path) {
|
|
504
|
+
return {
|
|
505
|
+
available: false,
|
|
506
|
+
affectedAreas: [],
|
|
507
|
+
relevantRules: [],
|
|
508
|
+
suggestedChecks: [],
|
|
509
|
+
artifacts: [],
|
|
510
|
+
commandHints: [
|
|
511
|
+
commandHint('shrk review build --since main', 'Generate a review packet from a diff', 'read-only'),
|
|
512
|
+
],
|
|
513
|
+
};
|
|
514
|
+
}
|
|
515
|
+
if (!existsSync(path)) {
|
|
516
|
+
return {
|
|
517
|
+
available: false,
|
|
518
|
+
packetPath: path,
|
|
519
|
+
affectedAreas: [],
|
|
520
|
+
relevantRules: [],
|
|
521
|
+
suggestedChecks: [],
|
|
522
|
+
artifacts: [],
|
|
523
|
+
commandHints: [],
|
|
524
|
+
};
|
|
525
|
+
}
|
|
526
|
+
return {
|
|
527
|
+
available: true,
|
|
528
|
+
packetPath: path,
|
|
529
|
+
affectedAreas: [],
|
|
530
|
+
relevantRules: [],
|
|
531
|
+
suggestedChecks: [],
|
|
532
|
+
artifacts: [artifactRef('review-packet', path, { format: 'json' })],
|
|
533
|
+
commandHints: [
|
|
534
|
+
commandHint(`shrk report review ${path} --format html --output ./review.html`, 'Render the packet as HTML', 'read-only'),
|
|
535
|
+
],
|
|
536
|
+
};
|
|
537
|
+
}
|
|
538
|
+
export async function buildDashboardScaffolds(inspection) {
|
|
539
|
+
const result = await loadScaffoldPatternsFromInspection(inspection);
|
|
540
|
+
return {
|
|
541
|
+
available: result.patterns.length > 0,
|
|
542
|
+
patterns: result.patterns.map((p) => ({
|
|
543
|
+
id: p.pattern.id,
|
|
544
|
+
title: p.pattern.title,
|
|
545
|
+
templateId: p.pattern.templateId,
|
|
546
|
+
source: p.source.packageName ?? p.source.type,
|
|
547
|
+
confidence: p.pattern.confidence,
|
|
548
|
+
matchPaths: [...p.pattern.matchPaths],
|
|
549
|
+
appliesWhen: [...p.pattern.appliesWhen],
|
|
550
|
+
})),
|
|
551
|
+
warnings: [...result.warnings],
|
|
552
|
+
};
|
|
553
|
+
}
|
|
554
|
+
/* -------------------------------------------------------------------------- */
|
|
555
|
+
/* schemas / mcp / health / capabilities */
|
|
556
|
+
/* -------------------------------------------------------------------------- */
|
|
557
|
+
export function buildDashboardSchemas() {
|
|
558
|
+
return {
|
|
559
|
+
schemas: [
|
|
560
|
+
{ id: 'sharkcraft.dashboard-api/v1', title: 'Dashboard API envelope' },
|
|
561
|
+
{ id: 'sharkcraft.adoption-state/v1', title: 'Adoption state' },
|
|
562
|
+
{ id: 'sharkcraft.adoption-summary/v1', title: 'Adoption summary' },
|
|
563
|
+
{ id: 'sharkcraft.adoption-merge-preview/v1', title: 'Adoption merge preview' },
|
|
564
|
+
{ id: 'sharkcraft.adoption-report/v1', title: 'Adoption report' },
|
|
565
|
+
{ id: 'sharkcraft.scaffold-pattern/v1', title: 'Scaffold pattern' },
|
|
566
|
+
{ id: 'sharkcraft.inferred-template-candidate/v2', title: 'Inferred template candidate (v2)' },
|
|
567
|
+
{ id: 'sharkcraft.dev-session/v1', title: 'Dev session state' },
|
|
568
|
+
{ id: 'sharkcraft.quality-report/v1', title: 'Quality report' },
|
|
569
|
+
{ id: 'sharkcraft.safety-audit/v1', title: 'Safety audit' },
|
|
570
|
+
],
|
|
571
|
+
};
|
|
572
|
+
}
|
|
573
|
+
export function buildDashboardMcpSummary(toolNames) {
|
|
574
|
+
return {
|
|
575
|
+
readOnly: true,
|
|
576
|
+
transports: ['stdio', 'http'],
|
|
577
|
+
tools: toolNames.map((t) => {
|
|
578
|
+
const tool = { name: t.name, readOnly: true };
|
|
579
|
+
if (t.description)
|
|
580
|
+
tool.description = t.description;
|
|
581
|
+
return tool;
|
|
582
|
+
}),
|
|
583
|
+
};
|
|
584
|
+
}
|
|
585
|
+
export function buildDashboardHealth(uptimeSeconds) {
|
|
586
|
+
return {
|
|
587
|
+
ok: true,
|
|
588
|
+
readOnly: true,
|
|
589
|
+
apiVersion: '1',
|
|
590
|
+
schemaId: 'sharkcraft.dashboard-api/v1',
|
|
591
|
+
uptimeSeconds,
|
|
592
|
+
capabilitiesUrl: '/api/capabilities',
|
|
593
|
+
};
|
|
594
|
+
}
|
|
595
|
+
export async function buildDashboardStats(cwd, opts) {
|
|
596
|
+
const stats = await buildRepositoryStats({
|
|
597
|
+
cwd,
|
|
598
|
+
...(opts?.maxTopFiles !== undefined ? { maxTopFiles: opts.maxTopFiles } : {}),
|
|
599
|
+
...(opts?.language ? { language: opts.language } : {}),
|
|
600
|
+
});
|
|
601
|
+
return {
|
|
602
|
+
schema: stats.schema,
|
|
603
|
+
generatedAt: stats.generatedAt,
|
|
604
|
+
projectRoot: stats.projectRoot,
|
|
605
|
+
totals: stats.totals,
|
|
606
|
+
byLanguage: stats.byLanguage.map((l) => ({
|
|
607
|
+
language: l.language,
|
|
608
|
+
extensions: l.extensions,
|
|
609
|
+
files: l.files,
|
|
610
|
+
bytes: l.bytes,
|
|
611
|
+
totalLines: l.totalLines,
|
|
612
|
+
codeLines: l.codeLines,
|
|
613
|
+
commentLines: l.commentLines,
|
|
614
|
+
blankLines: l.blankLines,
|
|
615
|
+
averageFileBytes: l.averageFileBytes,
|
|
616
|
+
averageFileLines: l.averageFileLines,
|
|
617
|
+
largestFile: l.largestFile,
|
|
618
|
+
})),
|
|
619
|
+
topFiles: stats.topFiles,
|
|
620
|
+
ignoredDirectories: stats.ignoredDirectories,
|
|
621
|
+
truncated: stats.truncated,
|
|
622
|
+
commandHints: [
|
|
623
|
+
commandHint('shrk stats', 'Refresh repository statistics from the CLI', 'read-only'),
|
|
624
|
+
commandHint('shrk stats --json', 'Emit machine-readable stats', 'read-only'),
|
|
625
|
+
commandHint('shrk stats --language typescript', 'Filter to a single language', 'read-only'),
|
|
626
|
+
],
|
|
627
|
+
};
|
|
628
|
+
}
|
|
629
|
+
export function buildDashboardCapabilities(availability = {}) {
|
|
630
|
+
return {
|
|
631
|
+
readOnly: true,
|
|
632
|
+
supportsSessions: true,
|
|
633
|
+
supportsQuality: true,
|
|
634
|
+
supportsSafety: true,
|
|
635
|
+
supportsAdoption: true,
|
|
636
|
+
supportsScaffolds: true,
|
|
637
|
+
supportsReports: true,
|
|
638
|
+
supportsGraph: true,
|
|
639
|
+
supportsReview: true,
|
|
640
|
+
supportsPacks: true,
|
|
641
|
+
supportsPresets: true,
|
|
642
|
+
supportsPipelines: true,
|
|
643
|
+
supportsMcpSummary: true,
|
|
644
|
+
supportsLiveSessionEvents: true,
|
|
645
|
+
writeEndpoints: [],
|
|
646
|
+
dangerousActions: [],
|
|
647
|
+
commandHints: [
|
|
648
|
+
commandHint('shrk dashboard --serve', 'Start the local read-only dashboard API', 'read-only'),
|
|
649
|
+
commandHint('shrk dev open <id> --serve --live --port 0', 'Open a live session view', 'read-only'),
|
|
650
|
+
],
|
|
651
|
+
...availability,
|
|
652
|
+
};
|
|
653
|
+
}
|