@shrkcrft/inspector 0.1.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +15 -0
- package/dist/acceptance-replay.d.ts +63 -0
- package/dist/acceptance-replay.d.ts.map +1 -0
- package/dist/acceptance-replay.js +240 -0
- package/dist/action-hint-diagnostics.d.ts +32 -0
- package/dist/action-hint-diagnostics.d.ts.map +1 -0
- package/dist/action-hint-diagnostics.js +133 -0
- package/dist/adoption-check.d.ts +28 -0
- package/dist/adoption-check.d.ts.map +1 -0
- package/dist/adoption-check.js +181 -0
- package/dist/adoption-checkpoint.d.ts +97 -0
- package/dist/adoption-checkpoint.d.ts.map +1 -0
- package/dist/adoption-checkpoint.js +209 -0
- package/dist/adoption-merge-preview.d.ts +28 -0
- package/dist/adoption-merge-preview.d.ts.map +1 -0
- package/dist/adoption-merge-preview.js +254 -0
- package/dist/adoption-report-renderer.d.ts +33 -0
- package/dist/adoption-report-renderer.d.ts.map +1 -0
- package/dist/adoption-report-renderer.js +257 -0
- package/dist/adoption-state.d.ts +100 -0
- package/dist/adoption-state.d.ts.map +1 -0
- package/dist/adoption-state.js +296 -0
- package/dist/adoption-three-way.d.ts +46 -0
- package/dist/adoption-three-way.d.ts.map +1 -0
- package/dist/adoption-three-way.js +181 -0
- package/dist/agent-brief.d.ts +77 -0
- package/dist/agent-brief.d.ts.map +1 -0
- package/dist/agent-brief.js +490 -0
- package/dist/agent-contract-gate.d.ts +108 -0
- package/dist/agent-contract-gate.d.ts.map +1 -0
- package/dist/agent-contract-gate.js +412 -0
- package/dist/agent-contract-templates.d.ts +63 -0
- package/dist/agent-contract-templates.d.ts.map +1 -0
- package/dist/agent-contract-templates.js +346 -0
- package/dist/agent-contract.d.ts +65 -0
- package/dist/agent-contract.d.ts.map +1 -0
- package/dist/agent-contract.js +555 -0
- package/dist/agent-handoff.d.ts +123 -0
- package/dist/agent-handoff.d.ts.map +1 -0
- package/dist/agent-handoff.js +470 -0
- package/dist/agent-instructions.d.ts +2 -0
- package/dist/agent-instructions.d.ts.map +1 -0
- package/dist/agent-instructions.js +21 -0
- package/dist/agent-orchestration.d.ts +61 -0
- package/dist/agent-orchestration.d.ts.map +1 -0
- package/dist/agent-orchestration.js +285 -0
- package/dist/agent-task-prep.d.ts +31 -0
- package/dist/agent-task-prep.d.ts.map +1 -0
- package/dist/agent-task-prep.js +73 -0
- package/dist/ai-readiness.d.ts +30 -0
- package/dist/ai-readiness.d.ts.map +1 -0
- package/dist/ai-readiness.js +279 -0
- package/dist/api-report.d.ts +51 -0
- package/dist/api-report.d.ts.map +1 -0
- package/dist/api-report.js +254 -0
- package/dist/apply-dispatch-trace.d.ts +93 -0
- package/dist/apply-dispatch-trace.d.ts.map +1 -0
- package/dist/apply-dispatch-trace.js +283 -0
- package/dist/apply-gate-result.d.ts +52 -0
- package/dist/apply-gate-result.d.ts.map +1 -0
- package/dist/apply-gate-result.js +44 -0
- package/dist/architecture-map.d.ts +118 -0
- package/dist/architecture-map.d.ts.map +1 -0
- package/dist/architecture-map.js +543 -0
- package/dist/area-explore.d.ts +75 -0
- package/dist/area-explore.d.ts.map +1 -0
- package/dist/area-explore.js +438 -0
- package/dist/area-map.d.ts +43 -0
- package/dist/area-map.d.ts.map +1 -0
- package/dist/area-map.js +197 -0
- package/dist/asset-provenance.d.ts +123 -0
- package/dist/asset-provenance.d.ts.map +1 -0
- package/dist/asset-provenance.js +209 -0
- package/dist/barrel-operations.d.ts +45 -0
- package/dist/barrel-operations.d.ts.map +1 -0
- package/dist/barrel-operations.js +159 -0
- package/dist/boundaries-changed-only.d.ts +62 -0
- package/dist/boundaries-changed-only.d.ts.map +1 -0
- package/dist/boundaries-changed-only.js +97 -0
- package/dist/boundary-suggestions.d.ts +20 -0
- package/dist/boundary-suggestions.d.ts.map +1 -0
- package/dist/boundary-suggestions.js +51 -0
- package/dist/bundle-diff.d.ts +98 -0
- package/dist/bundle-diff.d.ts.map +1 -0
- package/dist/bundle-diff.js +531 -0
- package/dist/bundle-replay.d.ts +68 -0
- package/dist/bundle-replay.d.ts.map +1 -0
- package/dist/bundle-replay.js +273 -0
- package/dist/bundle-validate-html.d.ts +11 -0
- package/dist/bundle-validate-html.d.ts.map +1 -0
- package/dist/bundle-validate-html.js +60 -0
- package/dist/change-intent.d.ts +36 -0
- package/dist/change-intent.d.ts.map +1 -0
- package/dist/change-intent.js +259 -0
- package/dist/changed-preflight.d.ts +59 -0
- package/dist/changed-preflight.d.ts.map +1 -0
- package/dist/changed-preflight.js +358 -0
- package/dist/changed-scope.d.ts +112 -0
- package/dist/changed-scope.d.ts.map +1 -0
- package/dist/changed-scope.js +172 -0
- package/dist/changes-summary.d.ts +87 -0
- package/dist/changes-summary.d.ts.map +1 -0
- package/dist/changes-summary.js +323 -0
- package/dist/check-result-v1.d.ts +90 -0
- package/dist/check-result-v1.d.ts.map +1 -0
- package/dist/check-result-v1.js +335 -0
- package/dist/ci-integrity-report.d.ts +38 -0
- package/dist/ci-integrity-report.d.ts.map +1 -0
- package/dist/ci-integrity-report.js +324 -0
- package/dist/ci-permissions-fix.d.ts +38 -0
- package/dist/ci-permissions-fix.d.ts.map +1 -0
- package/dist/ci-permissions-fix.js +201 -0
- package/dist/ci-permissions.d.ts +51 -0
- package/dist/ci-permissions.d.ts.map +1 -0
- package/dist/ci-permissions.js +431 -0
- package/dist/ci-predict.d.ts +42 -0
- package/dist/ci-predict.d.ts.map +1 -0
- package/dist/ci-predict.js +300 -0
- package/dist/ci-scaffold.d.ts +47 -0
- package/dist/ci-scaffold.d.ts.map +1 -0
- package/dist/ci-scaffold.js +638 -0
- package/dist/codemod-assist.d.ts +97 -0
- package/dist/codemod-assist.d.ts.map +1 -0
- package/dist/codemod-assist.js +261 -0
- package/dist/command-recommender.d.ts +25 -0
- package/dist/command-recommender.d.ts.map +1 -0
- package/dist/command-recommender.js +145 -0
- package/dist/command-suggester.d.ts +61 -0
- package/dist/command-suggester.d.ts.map +1 -0
- package/dist/command-suggester.js +159 -0
- package/dist/command-taxonomy.d.ts +38 -0
- package/dist/command-taxonomy.d.ts.map +1 -0
- package/dist/command-taxonomy.js +164 -0
- package/dist/compliance-evidence.d.ts +58 -0
- package/dist/compliance-evidence.d.ts.map +1 -0
- package/dist/compliance-evidence.js +260 -0
- package/dist/compliance-profiles.d.ts +42 -0
- package/dist/compliance-profiles.d.ts.map +1 -0
- package/dist/compliance-profiles.js +171 -0
- package/dist/construct-adoption-diff.d.ts +55 -0
- package/dist/construct-adoption-diff.d.ts.map +1 -0
- package/dist/construct-adoption-diff.js +331 -0
- package/dist/construct-adoption.d.ts +71 -0
- package/dist/construct-adoption.d.ts.map +1 -0
- package/dist/construct-adoption.js +331 -0
- package/dist/construct-inference.d.ts +44 -0
- package/dist/construct-inference.d.ts.map +1 -0
- package/dist/construct-inference.js +391 -0
- package/dist/construct-registry.d.ts +32 -0
- package/dist/construct-registry.d.ts.map +1 -0
- package/dist/construct-registry.js +198 -0
- package/dist/contract-file-rule.d.ts +37 -0
- package/dist/contract-file-rule.d.ts.map +1 -0
- package/dist/contract-file-rule.js +99 -0
- package/dist/contract-template-registry.d.ts +28 -0
- package/dist/contract-template-registry.d.ts.map +1 -0
- package/dist/contract-template-registry.js +161 -0
- package/dist/contradictions.d.ts +52 -0
- package/dist/contradictions.d.ts.map +1 -0
- package/dist/contradictions.js +391 -0
- package/dist/convention-registry.d.ts +44 -0
- package/dist/convention-registry.d.ts.map +1 -0
- package/dist/convention-registry.js +195 -0
- package/dist/coverage-report.d.ts +25 -0
- package/dist/coverage-report.d.ts.map +1 -0
- package/dist/coverage-report.js +190 -0
- package/dist/custom-checks.d.ts +146 -0
- package/dist/custom-checks.d.ts.map +1 -0
- package/dist/custom-checks.js +260 -0
- package/dist/dashboard/dashboard-data.d.ts +59 -0
- package/dist/dashboard/dashboard-data.d.ts.map +1 -0
- package/dist/dashboard/dashboard-data.js +653 -0
- package/dist/dashboard-export.d.ts +67 -0
- package/dist/dashboard-export.d.ts.map +1 -0
- package/dist/dashboard-export.js +203 -0
- package/dist/decision-records.d.ts +47 -0
- package/dist/decision-records.d.ts.map +1 -0
- package/dist/decision-records.js +255 -0
- package/dist/demo-package.d.ts +49 -0
- package/dist/demo-package.d.ts.map +1 -0
- package/dist/demo-package.js +305 -0
- package/dist/demo-script.d.ts +25 -0
- package/dist/demo-script.d.ts.map +1 -0
- package/dist/demo-script.js +198 -0
- package/dist/demo-workflow.d.ts +28 -0
- package/dist/demo-workflow.d.ts.map +1 -0
- package/dist/demo-workflow.js +178 -0
- package/dist/dev-cycle.d.ts +41 -0
- package/dist/dev-cycle.d.ts.map +1 -0
- package/dist/dev-cycle.js +94 -0
- package/dist/dev-session-html.d.ts +13 -0
- package/dist/dev-session-html.d.ts.map +1 -0
- package/dist/dev-session-html.js +223 -0
- package/dist/dev-session-report.d.ts +11 -0
- package/dist/dev-session-report.d.ts.map +1 -0
- package/dist/dev-session-report.js +206 -0
- package/dist/dev-session.d.ts +257 -0
- package/dist/dev-session.d.ts.map +1 -0
- package/dist/dev-session.js +568 -0
- package/dist/diagnostics-suggest.d.ts +17 -0
- package/dist/diagnostics-suggest.d.ts.map +1 -0
- package/dist/diagnostics-suggest.js +69 -0
- package/dist/docs-check.d.ts +40 -0
- package/dist/docs-check.d.ts.map +1 -0
- package/dist/docs-check.js +221 -0
- package/dist/doctor-acknowledgements.d.ts +69 -0
- package/dist/doctor-acknowledgements.d.ts.map +1 -0
- package/dist/doctor-acknowledgements.js +150 -0
- package/dist/doctor-result.d.ts +51 -0
- package/dist/doctor-result.d.ts.map +1 -0
- package/dist/doctor-result.js +7 -0
- package/dist/doctor-suppressions.d.ts +91 -0
- package/dist/doctor-suppressions.d.ts.map +1 -0
- package/dist/doctor-suppressions.js +238 -0
- package/dist/drift-baseline.d.ts +29 -0
- package/dist/drift-baseline.d.ts.map +1 -0
- package/dist/drift-baseline.js +80 -0
- package/dist/drift.d.ts +38 -0
- package/dist/drift.d.ts.map +1 -0
- package/dist/drift.js +107 -0
- package/dist/entrypoint-matrix.d.ts +61 -0
- package/dist/entrypoint-matrix.d.ts.map +1 -0
- package/dist/entrypoint-matrix.js +221 -0
- package/dist/examples-check.d.ts +36 -0
- package/dist/examples-check.d.ts.map +1 -0
- package/dist/examples-check.js +168 -0
- package/dist/execution-graph.d.ts +98 -0
- package/dist/execution-graph.d.ts.map +1 -0
- package/dist/execution-graph.js +484 -0
- package/dist/export-bundle.d.ts +10 -0
- package/dist/export-bundle.d.ts.map +1 -0
- package/dist/export-bundle.js +90 -0
- package/dist/failure-diagnostics.d.ts +63 -0
- package/dist/failure-diagnostics.d.ts.map +1 -0
- package/dist/failure-diagnostics.js +243 -0
- package/dist/feature-bundle.d.ts +111 -0
- package/dist/feature-bundle.d.ts.map +1 -0
- package/dist/feature-bundle.js +211 -0
- package/dist/feedback-actions-v2.d.ts +65 -0
- package/dist/feedback-actions-v2.d.ts.map +1 -0
- package/dist/feedback-actions-v2.js +183 -0
- package/dist/feedback-ingestion.d.ts +96 -0
- package/dist/feedback-ingestion.d.ts.map +1 -0
- package/dist/feedback-ingestion.js +400 -0
- package/dist/fix-preview.d.ts +82 -0
- package/dist/fix-preview.d.ts.map +1 -0
- package/dist/fix-preview.js +365 -0
- package/dist/fuzzy-impact.d.ts +50 -0
- package/dist/fuzzy-impact.d.ts.map +1 -0
- package/dist/fuzzy-impact.js +446 -0
- package/dist/generated-code.d.ts +97 -0
- package/dist/generated-code.d.ts.map +1 -0
- package/dist/generated-code.js +395 -0
- package/dist/git-helpers.d.ts +26 -0
- package/dist/git-helpers.d.ts.map +1 -0
- package/dist/git-helpers.js +110 -0
- package/dist/golden-output.d.ts +33 -0
- package/dist/golden-output.d.ts.map +1 -0
- package/dist/golden-output.js +92 -0
- package/dist/grounding/build-grounding.d.ts +53 -0
- package/dist/grounding/build-grounding.d.ts.map +1 -0
- package/dist/grounding/build-grounding.js +51 -0
- package/dist/grounding/nx-projects.d.ts +29 -0
- package/dist/grounding/nx-projects.d.ts.map +1 -0
- package/dist/grounding/nx-projects.js +109 -0
- package/dist/grounding/validate-extracted-plan.d.ts +20 -0
- package/dist/grounding/validate-extracted-plan.d.ts.map +1 -0
- package/dist/grounding/validate-extracted-plan.js +127 -0
- package/dist/healing-plan.d.ts +33 -0
- package/dist/healing-plan.d.ts.map +1 -0
- package/dist/healing-plan.js +346 -0
- package/dist/helper-registry.d.ts +90 -0
- package/dist/helper-registry.d.ts.map +1 -0
- package/dist/helper-registry.js +529 -0
- package/dist/impact-analysis.d.ts +150 -0
- package/dist/impact-analysis.d.ts.map +1 -0
- package/dist/impact-analysis.js +697 -0
- package/dist/impact-graph-render.d.ts +51 -0
- package/dist/impact-graph-render.d.ts.map +1 -0
- package/dist/impact-graph-render.js +139 -0
- package/dist/impact-graph.d.ts +17 -0
- package/dist/impact-graph.d.ts.map +1 -0
- package/dist/impact-graph.js +119 -0
- package/dist/impact-render.d.ts +22 -0
- package/dist/impact-render.d.ts.map +1 -0
- package/dist/impact-render.js +413 -0
- package/dist/import-graph-analysis.d.ts +28 -0
- package/dist/import-graph-analysis.d.ts.map +1 -0
- package/dist/import-graph-analysis.js +193 -0
- package/dist/import-hygiene.d.ts +93 -0
- package/dist/import-hygiene.d.ts.map +1 -0
- package/dist/import-hygiene.js +366 -0
- package/dist/index.d.ts +223 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +233 -0
- package/dist/ingest-adoption.d.ts +50 -0
- package/dist/ingest-adoption.d.ts.map +1 -0
- package/dist/ingest-adoption.js +183 -0
- package/dist/ingest-apply.d.ts +80 -0
- package/dist/ingest-apply.d.ts.map +1 -0
- package/dist/ingest-apply.js +227 -0
- package/dist/ingest-body-extractor.d.ts +28 -0
- package/dist/ingest-body-extractor.d.ts.map +1 -0
- package/dist/ingest-body-extractor.js +129 -0
- package/dist/ingest-drafts.d.ts +16 -0
- package/dist/ingest-drafts.d.ts.map +1 -0
- package/dist/ingest-drafts.js +482 -0
- package/dist/inspector-cache.d.ts +41 -0
- package/dist/inspector-cache.d.ts.map +1 -0
- package/dist/inspector-cache.js +104 -0
- package/dist/install-smoke.d.ts +44 -0
- package/dist/install-smoke.d.ts.map +1 -0
- package/dist/install-smoke.js +31 -0
- package/dist/knowledge-authoring.d.ts +151 -0
- package/dist/knowledge-authoring.d.ts.map +1 -0
- package/dist/knowledge-authoring.js +586 -0
- package/dist/knowledge-graph.d.ts +76 -0
- package/dist/knowledge-graph.d.ts.map +1 -0
- package/dist/knowledge-graph.js +336 -0
- package/dist/knowledge-lint.d.ts +97 -0
- package/dist/knowledge-lint.d.ts.map +1 -0
- package/dist/knowledge-lint.js +302 -0
- package/dist/knowledge-rename.d.ts +38 -0
- package/dist/knowledge-rename.d.ts.map +1 -0
- package/dist/knowledge-rename.js +88 -0
- package/dist/knowledge-stale.d.ts +124 -0
- package/dist/knowledge-stale.d.ts.map +1 -0
- package/dist/knowledge-stale.js +892 -0
- package/dist/languages/command-inference.d.ts +27 -0
- package/dist/languages/command-inference.d.ts.map +1 -0
- package/dist/languages/command-inference.js +214 -0
- package/dist/languages/dependency-scan.d.ts +33 -0
- package/dist/languages/dependency-scan.d.ts.map +1 -0
- package/dist/languages/dependency-scan.js +343 -0
- package/dist/languages/index.d.ts +14 -0
- package/dist/languages/index.d.ts.map +1 -0
- package/dist/languages/index.js +13 -0
- package/dist/languages/language-boundaries.d.ts +30 -0
- package/dist/languages/language-boundaries.d.ts.map +1 -0
- package/dist/languages/language-boundaries.js +176 -0
- package/dist/languages/language-cache.d.ts +54 -0
- package/dist/languages/language-cache.d.ts.map +1 -0
- package/dist/languages/language-cache.js +236 -0
- package/dist/languages/language-detection.d.ts +30 -0
- package/dist/languages/language-detection.d.ts.map +1 -0
- package/dist/languages/language-detection.js +584 -0
- package/dist/languages/language-id.d.ts +15 -0
- package/dist/languages/language-id.d.ts.map +1 -0
- package/dist/languages/language-id.js +15 -0
- package/dist/languages/language-runner.d.ts +90 -0
- package/dist/languages/language-runner.d.ts.map +1 -0
- package/dist/languages/language-runner.js +346 -0
- package/dist/languages/polyglot-boundary.d.ts +80 -0
- package/dist/languages/polyglot-boundary.d.ts.map +1 -0
- package/dist/languages/polyglot-boundary.js +373 -0
- package/dist/languages/polyglot-ci.d.ts +25 -0
- package/dist/languages/polyglot-ci.d.ts.map +1 -0
- package/dist/languages/polyglot-ci.js +278 -0
- package/dist/languages/test-impact.d.ts +19 -0
- package/dist/languages/test-impact.d.ts.map +1 -0
- package/dist/languages/test-impact.js +157 -0
- package/dist/loader-diagnostics.d.ts +40 -0
- package/dist/loader-diagnostics.d.ts.map +1 -0
- package/dist/loader-diagnostics.js +49 -0
- package/dist/memory-diff.d.ts +60 -0
- package/dist/memory-diff.d.ts.map +1 -0
- package/dist/memory-diff.js +302 -0
- package/dist/migration-profile-registry.d.ts +26 -0
- package/dist/migration-profile-registry.d.ts.map +1 -0
- package/dist/migration-profile-registry.js +135 -0
- package/dist/migration-readiness.d.ts +101 -0
- package/dist/migration-readiness.d.ts.map +1 -0
- package/dist/migration-readiness.js +253 -0
- package/dist/monorepo-onboarding.d.ts +51 -0
- package/dist/monorepo-onboarding.d.ts.map +1 -0
- package/dist/monorepo-onboarding.js +235 -0
- package/dist/onboarding-adoption-diff.d.ts +53 -0
- package/dist/onboarding-adoption-diff.d.ts.map +1 -0
- package/dist/onboarding-adoption-diff.js +285 -0
- package/dist/onboarding-adoption.d.ts +136 -0
- package/dist/onboarding-adoption.d.ts.map +1 -0
- package/dist/onboarding-adoption.js +702 -0
- package/dist/onboarding-agent-import.d.ts +40 -0
- package/dist/onboarding-agent-import.d.ts.map +1 -0
- package/dist/onboarding-agent-import.js +114 -0
- package/dist/onboarding-diff.d.ts +39 -0
- package/dist/onboarding-diff.d.ts.map +1 -0
- package/dist/onboarding-diff.js +240 -0
- package/dist/onboarding-drafts.d.ts +28 -0
- package/dist/onboarding-drafts.d.ts.map +1 -0
- package/dist/onboarding-drafts.js +234 -0
- package/dist/onboarding-report.d.ts +8 -0
- package/dist/onboarding-report.d.ts.map +1 -0
- package/dist/onboarding-report.js +239 -0
- package/dist/onboarding.d.ts +134 -0
- package/dist/onboarding.d.ts.map +1 -0
- package/dist/onboarding.js +729 -0
- package/dist/ownership.d.ts +38 -0
- package/dist/ownership.d.ts.map +1 -0
- package/dist/ownership.js +102 -0
- package/dist/pack-author-ux.d.ts +58 -0
- package/dist/pack-author-ux.d.ts.map +1 -0
- package/dist/pack-author-ux.js +219 -0
- package/dist/pack-author.d.ts +94 -0
- package/dist/pack-author.d.ts.map +1 -0
- package/dist/pack-author.js +208 -0
- package/dist/pack-compatibility.d.ts +21 -0
- package/dist/pack-compatibility.d.ts.map +1 -0
- package/dist/pack-compatibility.js +114 -0
- package/dist/pack-contributions-inventory.d.ts +121 -0
- package/dist/pack-contributions-inventory.d.ts.map +1 -0
- package/dist/pack-contributions-inventory.js +732 -0
- package/dist/pack-docs.d.ts +11 -0
- package/dist/pack-docs.d.ts.map +1 -0
- package/dist/pack-docs.js +101 -0
- package/dist/pack-doctor.d.ts +50 -0
- package/dist/pack-doctor.d.ts.map +1 -0
- package/dist/pack-doctor.js +302 -0
- package/dist/pack-helper-registry.d.ts +29 -0
- package/dist/pack-helper-registry.d.ts.map +1 -0
- package/dist/pack-helper-registry.js +144 -0
- package/dist/pack-pending.d.ts +68 -0
- package/dist/pack-pending.d.ts.map +1 -0
- package/dist/pack-pending.js +189 -0
- package/dist/pack-quality-score.d.ts +44 -0
- package/dist/pack-quality-score.d.ts.map +1 -0
- package/dist/pack-quality-score.js +155 -0
- package/dist/pack-release-check.d.ts +24 -0
- package/dist/pack-release-check.d.ts.map +1 -0
- package/dist/pack-release-check.js +258 -0
- package/dist/pack-signature-status.d.ts +72 -0
- package/dist/pack-signature-status.d.ts.map +1 -0
- package/dist/pack-signature-status.js +222 -0
- package/dist/pack-symbol-compat.d.ts +60 -0
- package/dist/pack-symbol-compat.d.ts.map +1 -0
- package/dist/pack-symbol-compat.js +371 -0
- package/dist/pack-test-runner.d.ts +59 -0
- package/dist/pack-test-runner.d.ts.map +1 -0
- package/dist/pack-test-runner.js +211 -0
- package/dist/pipeline-command-dictionary.d.ts +2 -0
- package/dist/pipeline-command-dictionary.d.ts.map +1 -0
- package/dist/pipeline-command-dictionary.js +20 -0
- package/dist/pipeline-lint.d.ts +30 -0
- package/dist/pipeline-lint.d.ts.map +1 -0
- package/dist/pipeline-lint.js +134 -0
- package/dist/plan-dependency-graph.d.ts +25 -0
- package/dist/plan-dependency-graph.d.ts.map +1 -0
- package/dist/plan-dependency-graph.js +195 -0
- package/dist/plan-review.d.ts +64 -0
- package/dist/plan-review.d.ts.map +1 -0
- package/dist/plan-review.js +242 -0
- package/dist/plan-simulation.d.ts +108 -0
- package/dist/plan-simulation.d.ts.map +1 -0
- package/dist/plan-simulation.js +767 -0
- package/dist/playbook-registry.d.ts +25 -0
- package/dist/playbook-registry.d.ts.map +1 -0
- package/dist/playbook-registry.js +148 -0
- package/dist/playbook-script.d.ts +60 -0
- package/dist/playbook-script.d.ts.map +1 -0
- package/dist/playbook-script.js +161 -0
- package/dist/plugin-lifecycle-profile-registry.d.ts +52 -0
- package/dist/plugin-lifecycle-profile-registry.d.ts.map +1 -0
- package/dist/plugin-lifecycle-profile-registry.js +202 -0
- package/dist/plugin-lifecycle.d.ts +132 -0
- package/dist/plugin-lifecycle.d.ts.map +1 -0
- package/dist/plugin-lifecycle.js +477 -0
- package/dist/policy-engine.d.ts +101 -0
- package/dist/policy-engine.d.ts.map +1 -0
- package/dist/policy-engine.js +321 -0
- package/dist/policy-override-audit.d.ts +18 -0
- package/dist/policy-override-audit.d.ts.map +1 -0
- package/dist/policy-override-audit.js +54 -0
- package/dist/policy-overrides.d.ts +35 -0
- package/dist/policy-overrides.d.ts.map +1 -0
- package/dist/policy-overrides.js +84 -0
- package/dist/policy-test.d.ts +83 -0
- package/dist/policy-test.d.ts.map +1 -0
- package/dist/policy-test.js +342 -0
- package/dist/pr-summary.d.ts +34 -0
- package/dist/pr-summary.d.ts.map +1 -0
- package/dist/pr-summary.js +220 -0
- package/dist/product-coherence.d.ts +21 -0
- package/dist/product-coherence.d.ts.map +1 -0
- package/dist/product-coherence.js +158 -0
- package/dist/profile-registry.d.ts +42 -0
- package/dist/profile-registry.d.ts.map +1 -0
- package/dist/profile-registry.js +104 -0
- package/dist/project-coupling-audit.d.ts +64 -0
- package/dist/project-coupling-audit.d.ts.map +1 -0
- package/dist/project-coupling-audit.js +282 -0
- package/dist/project-overview.d.ts +14 -0
- package/dist/project-overview.d.ts.map +1 -0
- package/dist/project-overview.js +27 -0
- package/dist/propose-knowledge.d.ts +64 -0
- package/dist/propose-knowledge.d.ts.map +1 -0
- package/dist/propose-knowledge.js +367 -0
- package/dist/quality-baseline.d.ts +123 -0
- package/dist/quality-baseline.d.ts.map +1 -0
- package/dist/quality-baseline.js +433 -0
- package/dist/quality-html.d.ts +7 -0
- package/dist/quality-html.d.ts.map +1 -0
- package/dist/quality-html.js +64 -0
- package/dist/quality-report.d.ts +49 -0
- package/dist/quality-report.d.ts.map +1 -0
- package/dist/quality-report.js +296 -0
- package/dist/query-resolver.d.ts +38 -0
- package/dist/query-resolver.d.ts.map +1 -0
- package/dist/query-resolver.js +163 -0
- package/dist/ranker-explainability.d.ts +91 -0
- package/dist/ranker-explainability.d.ts.map +1 -0
- package/dist/ranker-explainability.js +550 -0
- package/dist/reference-lookup.d.ts +8 -0
- package/dist/reference-lookup.d.ts.map +1 -0
- package/dist/reference-lookup.js +18 -0
- package/dist/registration-hint-registry.d.ts +55 -0
- package/dist/registration-hint-registry.d.ts.map +1 -0
- package/dist/registration-hint-registry.js +327 -0
- package/dist/registry-lifecycle.d.ts +47 -0
- package/dist/registry-lifecycle.d.ts.map +1 -0
- package/dist/registry-lifecycle.js +214 -0
- package/dist/release-readiness.d.ts +64 -0
- package/dist/release-readiness.d.ts.map +1 -0
- package/dist/release-readiness.js +456 -0
- package/dist/release-smoke.d.ts +138 -0
- package/dist/release-smoke.d.ts.map +1 -0
- package/dist/release-smoke.js +459 -0
- package/dist/release-train.d.ts +33 -0
- package/dist/release-train.d.ts.map +1 -0
- package/dist/release-train.js +104 -0
- package/dist/repo-memory.d.ts +95 -0
- package/dist/repo-memory.d.ts.map +1 -0
- package/dist/repo-memory.js +614 -0
- package/dist/report-site.d.ts +92 -0
- package/dist/report-site.d.ts.map +1 -0
- package/dist/report-site.js +658 -0
- package/dist/reposet.d.ts +56 -0
- package/dist/reposet.d.ts.map +1 -0
- package/dist/reposet.js +160 -0
- package/dist/repository-intelligence.d.ts +145 -0
- package/dist/repository-intelligence.d.ts.map +1 -0
- package/dist/repository-intelligence.js +729 -0
- package/dist/repository-knowledge-model.d.ts +218 -0
- package/dist/repository-knowledge-model.d.ts.map +1 -0
- package/dist/repository-knowledge-model.js +939 -0
- package/dist/repository-map.d.ts +72 -0
- package/dist/repository-map.d.ts.map +1 -0
- package/dist/repository-map.js +332 -0
- package/dist/repository-stats.d.ts +66 -0
- package/dist/repository-stats.d.ts.map +1 -0
- package/dist/repository-stats.js +329 -0
- package/dist/review-comment-renderer.d.ts +59 -0
- package/dist/review-comment-renderer.d.ts.map +1 -0
- package/dist/review-comment-renderer.js +181 -0
- package/dist/review-comment-v2.d.ts +9 -0
- package/dist/review-comment-v2.d.ts.map +1 -0
- package/dist/review-comment-v2.js +178 -0
- package/dist/review-html.d.ts +13 -0
- package/dist/review-html.d.ts.map +1 -0
- package/dist/review-html.js +79 -0
- package/dist/review-packet-v2.d.ts +29 -0
- package/dist/review-packet-v2.d.ts.map +1 -0
- package/dist/review-packet-v2.js +71 -0
- package/dist/review-packet-v3.d.ts +22 -0
- package/dist/review-packet-v3.d.ts.map +1 -0
- package/dist/review-packet-v3.js +181 -0
- package/dist/review-packet.d.ts +49 -0
- package/dist/review-packet.d.ts.map +1 -0
- package/dist/review-packet.js +129 -0
- package/dist/risk-signals.d.ts +28 -0
- package/dist/risk-signals.d.ts.map +1 -0
- package/dist/risk-signals.js +68 -0
- package/dist/role-views.d.ts +50 -0
- package/dist/role-views.d.ts.map +1 -0
- package/dist/role-views.js +334 -0
- package/dist/rounds.d.ts +52 -0
- package/dist/rounds.d.ts.map +1 -0
- package/dist/rounds.js +172 -0
- package/dist/rule-drift.d.ts +42 -0
- package/dist/rule-drift.d.ts.map +1 -0
- package/dist/rule-drift.js +148 -0
- package/dist/rule-quality.d.ts +73 -0
- package/dist/rule-quality.d.ts.map +1 -0
- package/dist/rule-quality.js +356 -0
- package/dist/rule-scaffold.d.ts +71 -0
- package/dist/rule-scaffold.d.ts.map +1 -0
- package/dist/rule-scaffold.js +258 -0
- package/dist/safety-audit-deep.d.ts +38 -0
- package/dist/safety-audit-deep.d.ts.map +1 -0
- package/dist/safety-audit-deep.js +162 -0
- package/dist/safety-audit.d.ts +91 -0
- package/dist/safety-audit.d.ts.map +1 -0
- package/dist/safety-audit.js +138 -0
- package/dist/safety-html.d.ts +7 -0
- package/dist/safety-html.d.ts.map +1 -0
- package/dist/safety-html.js +70 -0
- package/dist/scaffold-coverage.d.ts +46 -0
- package/dist/scaffold-coverage.d.ts.map +1 -0
- package/dist/scaffold-coverage.js +273 -0
- package/dist/scaffold-patterns.d.ts +38 -0
- package/dist/scaffold-patterns.d.ts.map +1 -0
- package/dist/scaffold-patterns.js +282 -0
- package/dist/schema-inventory.d.ts +55 -0
- package/dist/schema-inventory.d.ts.map +1 -0
- package/dist/schema-inventory.js +301 -0
- package/dist/search-index.d.ts +75 -0
- package/dist/search-index.d.ts.map +1 -0
- package/dist/search-index.js +531 -0
- package/dist/search-tuning-explain.d.ts +68 -0
- package/dist/search-tuning-explain.d.ts.map +1 -0
- package/dist/search-tuning-explain.js +207 -0
- package/dist/search-tuning-registry.d.ts +54 -0
- package/dist/search-tuning-registry.d.ts.map +1 -0
- package/dist/search-tuning-registry.js +303 -0
- package/dist/self-audit.d.ts +59 -0
- package/dist/self-audit.d.ts.map +1 -0
- package/dist/self-audit.js +192 -0
- package/dist/self-config-doctor-v2.d.ts +57 -0
- package/dist/self-config-doctor-v2.d.ts.map +1 -0
- package/dist/self-config-doctor-v2.js +653 -0
- package/dist/self-config-doctor.d.ts +47 -0
- package/dist/self-config-doctor.d.ts.map +1 -0
- package/dist/self-config-doctor.js +432 -0
- package/dist/sharkcraft-inspector.d.ts +73 -0
- package/dist/sharkcraft-inspector.d.ts.map +1 -0
- package/dist/sharkcraft-inspector.js +745 -0
- package/dist/spec/spec-cross-validate.d.ts +17 -0
- package/dist/spec/spec-cross-validate.d.ts.map +1 -0
- package/dist/spec/spec-cross-validate.js +53 -0
- package/dist/spec/spec-discovery.d.ts +27 -0
- package/dist/spec/spec-discovery.d.ts.map +1 -0
- package/dist/spec/spec-discovery.js +78 -0
- package/dist/spec/spec-review.d.ts +36 -0
- package/dist/spec/spec-review.d.ts.map +1 -0
- package/dist/spec/spec-review.js +37 -0
- package/dist/stability-map.d.ts +62 -0
- package/dist/stability-map.d.ts.map +1 -0
- package/dist/stability-map.js +404 -0
- package/dist/start-here.d.ts +49 -0
- package/dist/start-here.d.ts.map +1 -0
- package/dist/start-here.js +259 -0
- package/dist/surface-profile-detect.d.ts +42 -0
- package/dist/surface-profile-detect.d.ts.map +1 -0
- package/dist/surface-profile-detect.js +76 -0
- package/dist/symbol-index.d.ts +108 -0
- package/dist/symbol-index.d.ts.map +1 -0
- package/dist/symbol-index.js +483 -0
- package/dist/task-decompose.d.ts +38 -0
- package/dist/task-decompose.d.ts.map +1 -0
- package/dist/task-decompose.js +154 -0
- package/dist/task-packet.d.ts +104 -0
- package/dist/task-packet.d.ts.map +1 -0
- package/dist/task-packet.js +156 -0
- package/dist/task-ranker.d.ts +51 -0
- package/dist/task-ranker.d.ts.map +1 -0
- package/dist/task-ranker.js +410 -0
- package/dist/task-risk.d.ts +84 -0
- package/dist/task-risk.d.ts.map +1 -0
- package/dist/task-risk.js +731 -0
- package/dist/task-routing-hint-registry.d.ts +36 -0
- package/dist/task-routing-hint-registry.d.ts.map +1 -0
- package/dist/task-routing-hint-registry.js +186 -0
- package/dist/template-authoring.d.ts +113 -0
- package/dist/template-authoring.d.ts.map +1 -0
- package/dist/template-authoring.js +521 -0
- package/dist/template-body-inference-v2.d.ts +19 -0
- package/dist/template-body-inference-v2.d.ts.map +1 -0
- package/dist/template-body-inference-v2.js +468 -0
- package/dist/template-body-inference.d.ts +59 -0
- package/dist/template-body-inference.d.ts.map +1 -0
- package/dist/template-body-inference.js +277 -0
- package/dist/template-drift.d.ts +39 -0
- package/dist/template-drift.d.ts.map +1 -0
- package/dist/template-drift.js +353 -0
- package/dist/template-lint.d.ts +31 -0
- package/dist/template-lint.d.ts.map +1 -0
- package/dist/template-lint.js +113 -0
- package/dist/test-definitions.d.ts +41 -0
- package/dist/test-definitions.d.ts.map +1 -0
- package/dist/test-definitions.js +6 -0
- package/dist/test-impact.d.ts +30 -0
- package/dist/test-impact.d.ts.map +1 -0
- package/dist/test-impact.js +173 -0
- package/dist/test-runner.d.ts +87 -0
- package/dist/test-runner.d.ts.map +1 -0
- package/dist/test-runner.js +560 -0
- package/dist/uncertainty-report.d.ts +46 -0
- package/dist/uncertainty-report.d.ts.map +1 -0
- package/dist/uncertainty-report.js +108 -0
- package/dist/uncertainty.d.ts +38 -0
- package/dist/uncertainty.d.ts.map +1 -0
- package/dist/uncertainty.js +115 -0
- package/dist/universal-search.d.ts +64 -0
- package/dist/universal-search.d.ts.map +1 -0
- package/dist/universal-search.js +347 -0
- package/dist/upgrade-advisor.d.ts +22 -0
- package/dist/upgrade-advisor.d.ts.map +1 -0
- package/dist/upgrade-advisor.js +109 -0
- package/dist/why-file.d.ts +75 -0
- package/dist/why-file.d.ts.map +1 -0
- package/dist/why-file.js +202 -0
- package/dist/workflow-simulation.d.ts +46 -0
- package/dist/workflow-simulation.d.ts.map +1 -0
- package/dist/workflow-simulation.js +154 -0
- package/package.json +66 -0
|
@@ -0,0 +1,482 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import * as nodePath from 'node:path';
|
|
3
|
+
import { renderRepositoryKnowledgeModelJson, renderRepositoryKnowledgeModelMarkdown, } from "./repository-knowledge-model.js";
|
|
4
|
+
import { renderGeneratedCodeReportMarkdown } from "./generated-code.js";
|
|
5
|
+
import { renderContradictionReportMarkdown } from "./contradictions.js";
|
|
6
|
+
import { renderStabilityMapMarkdown } from "./stability-map.js";
|
|
7
|
+
export function writeIngestDrafts(model, options) {
|
|
8
|
+
const outDir = nodePath.resolve(options.outDir ?? nodePath.join(options.projectRoot, 'sharkcraft', 'ingestion'));
|
|
9
|
+
ensureDir(outDir);
|
|
10
|
+
const files = [];
|
|
11
|
+
const write = (relName, body) => {
|
|
12
|
+
const full = nodePath.join(outDir, relName);
|
|
13
|
+
if (!full.startsWith(outDir + nodePath.sep)) {
|
|
14
|
+
throw new Error(`draft path escapes outDir: ${relName}`);
|
|
15
|
+
}
|
|
16
|
+
ensureDir(nodePath.dirname(full));
|
|
17
|
+
writeFileSync(full, body, 'utf8');
|
|
18
|
+
files.push({ path: full, bytes: Buffer.byteLength(body, 'utf8') });
|
|
19
|
+
};
|
|
20
|
+
// 1) Main JSON model.
|
|
21
|
+
write('repository-knowledge-model.json', renderRepositoryKnowledgeModelJson(model));
|
|
22
|
+
// 2) Per-section markdown summaries.
|
|
23
|
+
write('REPO_OVERVIEW.md', renderRepoOverviewMarkdown(model));
|
|
24
|
+
write('ARCHITECTURE_MODEL.md', renderArchitectureMarkdown(model));
|
|
25
|
+
write('BUSINESS_LOGIC_MODEL.md', renderBusinessLogicMarkdown(model));
|
|
26
|
+
write('RULES_AND_CONVENTIONS.md', renderRulesMarkdown(model));
|
|
27
|
+
write('DEPENDENCY_BOUNDARIES.md', renderBoundariesMarkdown(model));
|
|
28
|
+
write('DOMAIN_MAP.md', renderDomainMapMarkdown(model));
|
|
29
|
+
write('WORKFLOW_MAP.md', renderWorkflowMapMarkdown(model));
|
|
30
|
+
write('CHANGE_PROTOCOL.md', renderChangeProtocolMarkdown(model));
|
|
31
|
+
write('RISK_AREAS.md', renderRiskAreasMarkdown(model));
|
|
32
|
+
write('CONTRADICTIONS.md', renderContradictionReportMarkdown(model.contradictions));
|
|
33
|
+
write('OPEN_QUESTIONS.md', renderOpenQuestionsMarkdown(model));
|
|
34
|
+
write('GENERATED_VS_HANDWRITTEN.md', renderGeneratedCodeReportMarkdown(model.generatedVsHandwritten));
|
|
35
|
+
write('STABILITY.md', renderStabilityMapMarkdown(model.stableExperimentalDeprecated));
|
|
36
|
+
write('TASK_CONTEXT_HINTS.md', renderTaskContextHintsMarkdown(model));
|
|
37
|
+
write('REPOSITORY_KNOWLEDGE_MODEL.md', renderRepositoryKnowledgeModelMarkdown(model));
|
|
38
|
+
// 3) Draft TS files.
|
|
39
|
+
write('generated/knowledge.draft.ts', renderKnowledgeDraft(model));
|
|
40
|
+
write('generated/rules.draft.ts', renderRulesDraft(model));
|
|
41
|
+
write('generated/paths.draft.ts', renderPathsDraft(model));
|
|
42
|
+
write('generated/boundaries.draft.ts', renderBoundariesDraft(model));
|
|
43
|
+
write('generated/constructs.draft.ts', renderConstructsDraft(model));
|
|
44
|
+
write('generated/policies.draft.ts', renderPoliciesDraft(model));
|
|
45
|
+
write('generated/playbooks.draft.ts', renderPlaybooksDraft(model));
|
|
46
|
+
write('generated/templates.draft.ts', renderTemplatesDraft(model));
|
|
47
|
+
write('generated/pipelines.draft.ts', renderPipelinesDraft(model));
|
|
48
|
+
write('generated/presets.draft.ts', renderPresetsDraft(model));
|
|
49
|
+
return { outDir, files };
|
|
50
|
+
}
|
|
51
|
+
function ensureDir(dir) {
|
|
52
|
+
if (!existsSync(dir))
|
|
53
|
+
mkdirSync(dir, { recursive: true });
|
|
54
|
+
}
|
|
55
|
+
function renderRepoOverviewMarkdown(model) {
|
|
56
|
+
const o = model.repositoryOverview;
|
|
57
|
+
const lines = [];
|
|
58
|
+
lines.push(`# Repository overview — ${o.projectName}`);
|
|
59
|
+
lines.push('');
|
|
60
|
+
if (o.description)
|
|
61
|
+
lines.push(`> ${o.description}`);
|
|
62
|
+
lines.push('');
|
|
63
|
+
lines.push(`- Package manager: **${o.packageManager}**`);
|
|
64
|
+
lines.push(`- TypeScript: **${o.detectedLanguages.includes('typescript') ? 'yes' : 'no'}**`);
|
|
65
|
+
lines.push(`- Frameworks: ${o.frameworks.join(', ') || '_(none detected)_'}`);
|
|
66
|
+
lines.push(`- Languages: ${o.detectedLanguages.join(', ') || '_(unknown)_'}`);
|
|
67
|
+
lines.push(`- Monorepo: ${o.monorepo ? 'yes' : 'no'}`);
|
|
68
|
+
lines.push(`- Top-level dirs: ${o.topLevelDirs.map((d) => '`' + d + '`').join(', ')}`);
|
|
69
|
+
lines.push(`- Scripts: ${o.knownScripts.map((s) => '`' + s + '`').join(', ') || '_(none)_'}`);
|
|
70
|
+
lines.push(`- SharkCraft folder present: **${o.hasSharkcraftFolder ? 'yes' : 'no'}**`);
|
|
71
|
+
return lines.join('\n');
|
|
72
|
+
}
|
|
73
|
+
function renderArchitectureMarkdown(model) {
|
|
74
|
+
const a = model.architectureModel;
|
|
75
|
+
const lines = ['# Architecture model', ''];
|
|
76
|
+
if (a.layers.length === 0) {
|
|
77
|
+
lines.push('_No layers detected._');
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
lines.push('## Layers / areas');
|
|
81
|
+
lines.push('');
|
|
82
|
+
lines.push('| Id | Files | Paths |');
|
|
83
|
+
lines.push('|---|---|---|');
|
|
84
|
+
for (const l of a.layers) {
|
|
85
|
+
lines.push(`| \`${l.id}\` | ${l.fileCount} | ${l.paths.map((p) => '`' + p + '`').join(', ')} |`);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (a.publicApis.length > 0) {
|
|
89
|
+
lines.push('');
|
|
90
|
+
lines.push('## Public APIs');
|
|
91
|
+
lines.push('');
|
|
92
|
+
for (const p of a.publicApis)
|
|
93
|
+
lines.push(`- \`${p}\``);
|
|
94
|
+
}
|
|
95
|
+
if (a.notes.length > 0) {
|
|
96
|
+
lines.push('');
|
|
97
|
+
lines.push('## Notes');
|
|
98
|
+
lines.push('');
|
|
99
|
+
for (const n of a.notes)
|
|
100
|
+
lines.push(`- ${n}`);
|
|
101
|
+
}
|
|
102
|
+
return lines.join('\n');
|
|
103
|
+
}
|
|
104
|
+
function renderBusinessLogicMarkdown(model) {
|
|
105
|
+
const b = model.businessLogicModel;
|
|
106
|
+
const lines = ['# Business logic model', ''];
|
|
107
|
+
lines.push('## Entities');
|
|
108
|
+
lines.push('');
|
|
109
|
+
if (b.entities.length === 0)
|
|
110
|
+
lines.push('_None detected — entities are usually surfaced via constructs._');
|
|
111
|
+
else {
|
|
112
|
+
for (const e of b.entities) {
|
|
113
|
+
lines.push(`### ${e.title}`);
|
|
114
|
+
lines.push('');
|
|
115
|
+
lines.push(e.summary);
|
|
116
|
+
lines.push('');
|
|
117
|
+
lines.push(`Paths: ${e.paths.map((p) => '`' + p + '`').join(', ') || '_(unknown)_'}`);
|
|
118
|
+
lines.push('');
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
lines.push('## Workflows');
|
|
122
|
+
lines.push('');
|
|
123
|
+
if (b.workflows.length === 0)
|
|
124
|
+
lines.push('_None detected._');
|
|
125
|
+
else {
|
|
126
|
+
for (const w of b.workflows) {
|
|
127
|
+
lines.push(`### ${w.title}`);
|
|
128
|
+
lines.push('');
|
|
129
|
+
lines.push(w.summary);
|
|
130
|
+
lines.push('');
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
if (b.invariants.length > 0) {
|
|
134
|
+
lines.push('## Invariants');
|
|
135
|
+
lines.push('');
|
|
136
|
+
for (const inv of b.invariants)
|
|
137
|
+
lines.push(`- ${inv}`);
|
|
138
|
+
}
|
|
139
|
+
return lines.join('\n');
|
|
140
|
+
}
|
|
141
|
+
function renderRulesMarkdown(model) {
|
|
142
|
+
const r = model.rulesAndConventions;
|
|
143
|
+
const lines = ['# Rules & conventions', ''];
|
|
144
|
+
lines.push(`## Inferred rules (${r.rules.length})`);
|
|
145
|
+
lines.push('');
|
|
146
|
+
for (const rule of r.rules) {
|
|
147
|
+
lines.push(`### ${rule.title} (\`${rule.id}\`)`);
|
|
148
|
+
lines.push('');
|
|
149
|
+
lines.push(`Priority: **${rule.priority}** · Source: ${rule.source}`);
|
|
150
|
+
lines.push('');
|
|
151
|
+
lines.push(rule.content);
|
|
152
|
+
lines.push('');
|
|
153
|
+
lines.push(`Reason: ${rule.reason}`);
|
|
154
|
+
lines.push('');
|
|
155
|
+
}
|
|
156
|
+
lines.push(`## Path conventions (${r.paths.length})`);
|
|
157
|
+
lines.push('');
|
|
158
|
+
for (const p of r.paths) {
|
|
159
|
+
lines.push(`- **${p.title}** (\`${p.id}\`) — ${p.content}`);
|
|
160
|
+
}
|
|
161
|
+
lines.push('');
|
|
162
|
+
lines.push(`## Verification commands (${r.verificationCommands.length})`);
|
|
163
|
+
lines.push('');
|
|
164
|
+
for (const v of r.verificationCommands) {
|
|
165
|
+
lines.push(`- \`${v.command}\` — ${v.label}${v.trusted ? '' : ' _(needs review)_'}`);
|
|
166
|
+
}
|
|
167
|
+
return lines.join('\n');
|
|
168
|
+
}
|
|
169
|
+
function renderBoundariesMarkdown(model) {
|
|
170
|
+
const b = model.dependencyBoundaries;
|
|
171
|
+
const lines = ['# Dependency boundaries', ''];
|
|
172
|
+
if (b.rules.length === 0)
|
|
173
|
+
lines.push('_No inferred boundaries — consider adding layer rules manually._');
|
|
174
|
+
else {
|
|
175
|
+
for (const rule of b.rules) {
|
|
176
|
+
lines.push(`### ${rule.title} (\`${rule.id}\`)`);
|
|
177
|
+
lines.push('');
|
|
178
|
+
lines.push(`Severity: **${rule.severity}**`);
|
|
179
|
+
lines.push('');
|
|
180
|
+
lines.push(`From: ${rule.from.map((p) => '`' + p + '`').join(', ')}`);
|
|
181
|
+
if (rule.forbiddenImports?.length) {
|
|
182
|
+
lines.push(`Forbidden: ${rule.forbiddenImports.map((p) => '`' + p + '`').join(', ')}`);
|
|
183
|
+
}
|
|
184
|
+
if (rule.allowedImports?.length) {
|
|
185
|
+
lines.push(`Allowed: ${rule.allowedImports.map((p) => '`' + p + '`').join(', ')}`);
|
|
186
|
+
}
|
|
187
|
+
lines.push('');
|
|
188
|
+
lines.push(`Suggested fix: ${rule.suggestedFix}`);
|
|
189
|
+
lines.push(`Reason: ${rule.reason}`);
|
|
190
|
+
lines.push('');
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
lines.push('## Import graph summary');
|
|
194
|
+
lines.push('');
|
|
195
|
+
lines.push(`- Files scanned: ${b.importGraphSummary.nodeCount}`);
|
|
196
|
+
lines.push(`- Workspace packages: ${b.importGraphSummary.edgeCount}`);
|
|
197
|
+
if (b.importGraphSummary.cycles.length > 0) {
|
|
198
|
+
lines.push(`- Cycles: ${b.importGraphSummary.cycles.length}`);
|
|
199
|
+
for (const c of b.importGraphSummary.cycles)
|
|
200
|
+
lines.push(` - ${c}`);
|
|
201
|
+
}
|
|
202
|
+
return lines.join('\n');
|
|
203
|
+
}
|
|
204
|
+
function renderDomainMapMarkdown(model) {
|
|
205
|
+
const d = model.domainMap;
|
|
206
|
+
const lines = ['# Domain map', ''];
|
|
207
|
+
lines.push('## Areas');
|
|
208
|
+
lines.push('');
|
|
209
|
+
if (d.areas.length === 0)
|
|
210
|
+
lines.push('_None._');
|
|
211
|
+
else {
|
|
212
|
+
lines.push('| Id | Kind | Files | Paths |');
|
|
213
|
+
lines.push('|---|---|---|---|');
|
|
214
|
+
for (const a of d.areas) {
|
|
215
|
+
lines.push(`| \`${a.id}\` | ${a.kind} | ${a.fileCount} | ${a.paths.map((p) => '`' + p + '`').join(', ')} |`);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
lines.push('');
|
|
219
|
+
lines.push('## Constructs');
|
|
220
|
+
lines.push('');
|
|
221
|
+
if (d.constructs.length === 0)
|
|
222
|
+
lines.push('_None._');
|
|
223
|
+
else {
|
|
224
|
+
for (const c of d.constructs) {
|
|
225
|
+
lines.push(`- **${c.title}** (\`${c.id}\`) — ${c.paths.length} path(s)`);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
return lines.join('\n');
|
|
229
|
+
}
|
|
230
|
+
function renderWorkflowMapMarkdown(model) {
|
|
231
|
+
const lines = ['# Workflow map', ''];
|
|
232
|
+
for (const w of model.workflowMap.workflows) {
|
|
233
|
+
lines.push(`### ${w.title} (\`${w.id}\`)`);
|
|
234
|
+
lines.push('');
|
|
235
|
+
lines.push(`Source: ${w.source}`);
|
|
236
|
+
lines.push('');
|
|
237
|
+
for (const step of w.steps)
|
|
238
|
+
lines.push(`- ${step}`);
|
|
239
|
+
lines.push('');
|
|
240
|
+
}
|
|
241
|
+
return lines.join('\n');
|
|
242
|
+
}
|
|
243
|
+
function renderChangeProtocolMarkdown(model) {
|
|
244
|
+
const lines = ['# Change protocol', ''];
|
|
245
|
+
for (const c of model.changeProtocol.entries) {
|
|
246
|
+
lines.push(`## ${c.title}`);
|
|
247
|
+
lines.push('');
|
|
248
|
+
for (const step of c.steps)
|
|
249
|
+
lines.push(`- ${step}`);
|
|
250
|
+
lines.push('');
|
|
251
|
+
if (c.recommendedCommands.length) {
|
|
252
|
+
lines.push('Commands:');
|
|
253
|
+
lines.push('');
|
|
254
|
+
for (const cmd of c.recommendedCommands)
|
|
255
|
+
lines.push(`- \`${cmd}\``);
|
|
256
|
+
lines.push('');
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
return lines.join('\n');
|
|
260
|
+
}
|
|
261
|
+
function renderRiskAreasMarkdown(model) {
|
|
262
|
+
const lines = ['# Risk areas', ''];
|
|
263
|
+
if (model.riskAreas.length === 0)
|
|
264
|
+
lines.push('_No risk areas surfaced._');
|
|
265
|
+
else {
|
|
266
|
+
lines.push('| Path | Score | Reason | Recommendation |');
|
|
267
|
+
lines.push('|---|---|---|---|');
|
|
268
|
+
for (const r of model.riskAreas) {
|
|
269
|
+
lines.push(`| \`${r.path}\` | ${r.score} | ${r.reason} | ${r.recommendation} |`);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
return lines.join('\n');
|
|
273
|
+
}
|
|
274
|
+
function renderOpenQuestionsMarkdown(model) {
|
|
275
|
+
const lines = ['# Open questions', ''];
|
|
276
|
+
if (model.openQuestions.length === 0)
|
|
277
|
+
lines.push('_None._');
|
|
278
|
+
else
|
|
279
|
+
for (const q of model.openQuestions)
|
|
280
|
+
lines.push(`- ${q}`);
|
|
281
|
+
return lines.join('\n');
|
|
282
|
+
}
|
|
283
|
+
function renderTaskContextHintsMarkdown(model) {
|
|
284
|
+
const lines = ['# Task context hints', ''];
|
|
285
|
+
for (const h of model.taskContextHints) {
|
|
286
|
+
lines.push(`- **${h.trigger}** — ${h.hint}${h.recommendedCommand ? ` _(\`${h.recommendedCommand}\`)_` : ''}`);
|
|
287
|
+
}
|
|
288
|
+
return lines.join('\n');
|
|
289
|
+
}
|
|
290
|
+
// ─── Draft TS emitters ─────────────────────────────────────────────────────
|
|
291
|
+
function header(comment) {
|
|
292
|
+
return `/**\n * ${comment}\n *\n * This is a DRAFT — review and copy entries into the canonical sharkcraft/*.ts file.\n * Generated by \`shrk ingest repository --write-drafts\`.\n */\n`;
|
|
293
|
+
}
|
|
294
|
+
function renderKnowledgeDraft(model) {
|
|
295
|
+
const entries = [];
|
|
296
|
+
for (const e of model.businessLogicModel.entities) {
|
|
297
|
+
entries.push(` {
|
|
298
|
+
id: 'concept.${e.id}',
|
|
299
|
+
title: ${JSON.stringify(e.title)},
|
|
300
|
+
description: ${JSON.stringify(e.summary)},
|
|
301
|
+
content: ${JSON.stringify(e.summary)},
|
|
302
|
+
tags: ['domain', 'entity'],
|
|
303
|
+
}`);
|
|
304
|
+
}
|
|
305
|
+
for (const w of model.businessLogicModel.workflows) {
|
|
306
|
+
entries.push(` {
|
|
307
|
+
id: 'workflow.${w.id}',
|
|
308
|
+
title: ${JSON.stringify(w.title)},
|
|
309
|
+
description: ${JSON.stringify(w.summary)},
|
|
310
|
+
content: ${JSON.stringify(w.summary)},
|
|
311
|
+
tags: ['domain', 'workflow'],
|
|
312
|
+
}`);
|
|
313
|
+
}
|
|
314
|
+
for (let i = 0; i < model.businessLogicModel.invariants.length; i += 1) {
|
|
315
|
+
const inv = model.businessLogicModel.invariants[i] ?? '';
|
|
316
|
+
entries.push(` {
|
|
317
|
+
id: 'invariant.${i}',
|
|
318
|
+
title: 'Invariant ${i}',
|
|
319
|
+
description: ${JSON.stringify(inv)},
|
|
320
|
+
content: ${JSON.stringify(inv)},
|
|
321
|
+
tags: ['invariant'],
|
|
322
|
+
}`);
|
|
323
|
+
}
|
|
324
|
+
return `${header('Knowledge entries inferred from repository ingestion.')}
|
|
325
|
+
export const ingestedKnowledge = [
|
|
326
|
+
${entries.join(',\n')}
|
|
327
|
+
];
|
|
328
|
+
|
|
329
|
+
export default ingestedKnowledge;
|
|
330
|
+
`;
|
|
331
|
+
}
|
|
332
|
+
function renderRulesDraft(model) {
|
|
333
|
+
const entries = [];
|
|
334
|
+
for (const r of model.rulesAndConventions.rules) {
|
|
335
|
+
entries.push(` defineRule({
|
|
336
|
+
id: ${JSON.stringify(r.id)},
|
|
337
|
+
title: ${JSON.stringify(r.title)},
|
|
338
|
+
priority: ${JSON.stringify(r.priority)},
|
|
339
|
+
content: ${JSON.stringify(r.content)},
|
|
340
|
+
reason: ${JSON.stringify(r.reason)},
|
|
341
|
+
})`);
|
|
342
|
+
}
|
|
343
|
+
return `${header('Rules inferred from repository ingestion.')}
|
|
344
|
+
import { defineRule } from '@shrkcrft/rules';
|
|
345
|
+
|
|
346
|
+
export const ingestedRules = [
|
|
347
|
+
${entries.join(',\n')}
|
|
348
|
+
];
|
|
349
|
+
|
|
350
|
+
export default ingestedRules;
|
|
351
|
+
`;
|
|
352
|
+
}
|
|
353
|
+
function renderPathsDraft(model) {
|
|
354
|
+
const entries = model.rulesAndConventions.paths.map((p) => ` definePath({
|
|
355
|
+
id: ${JSON.stringify(p.id)},
|
|
356
|
+
title: ${JSON.stringify(p.title)},
|
|
357
|
+
content: ${JSON.stringify(p.content)},
|
|
358
|
+
patterns: ${JSON.stringify(p.patterns)},
|
|
359
|
+
})`);
|
|
360
|
+
return `${header('Path conventions inferred from repository ingestion.')}
|
|
361
|
+
import { definePath } from '@shrkcrft/paths';
|
|
362
|
+
|
|
363
|
+
export const ingestedPaths = [
|
|
364
|
+
${entries.join(',\n')}
|
|
365
|
+
];
|
|
366
|
+
|
|
367
|
+
export default ingestedPaths;
|
|
368
|
+
`;
|
|
369
|
+
}
|
|
370
|
+
function renderBoundariesDraft(model) {
|
|
371
|
+
const entries = model.dependencyBoundaries.rules.map((b) => ` defineBoundary({
|
|
372
|
+
id: ${JSON.stringify(b.id)},
|
|
373
|
+
title: ${JSON.stringify(b.title)},
|
|
374
|
+
severity: ${JSON.stringify(b.severity)},
|
|
375
|
+
from: ${JSON.stringify(b.from)},
|
|
376
|
+
${b.forbiddenImports ? `forbiddenImports: ${JSON.stringify(b.forbiddenImports)},` : ''}
|
|
377
|
+
${b.allowedImports ? `allowedImports: ${JSON.stringify(b.allowedImports)},` : ''}
|
|
378
|
+
suggestedFix: ${JSON.stringify(b.suggestedFix)},
|
|
379
|
+
})`);
|
|
380
|
+
return `${header('Dependency-boundary rules inferred from repository ingestion.')}
|
|
381
|
+
import { defineBoundary } from '@shrkcrft/boundaries';
|
|
382
|
+
|
|
383
|
+
export const ingestedBoundaries = [
|
|
384
|
+
${entries.join(',\n')}
|
|
385
|
+
];
|
|
386
|
+
|
|
387
|
+
export default ingestedBoundaries;
|
|
388
|
+
`;
|
|
389
|
+
}
|
|
390
|
+
function renderConstructsDraft(model) {
|
|
391
|
+
const entries = model.domainMap.constructs.map((c) => ` defineConstruct({
|
|
392
|
+
id: ${JSON.stringify(c.id)},
|
|
393
|
+
type: 'inferred',
|
|
394
|
+
title: ${JSON.stringify(c.title)},
|
|
395
|
+
files: ${JSON.stringify(c.paths)},
|
|
396
|
+
})`);
|
|
397
|
+
return `${header('Constructs inferred from repository ingestion.')}
|
|
398
|
+
import { defineConstruct } from '@shrkcrft/plugin-api';
|
|
399
|
+
|
|
400
|
+
export const ingestedConstructs = [
|
|
401
|
+
${entries.join(',\n')}
|
|
402
|
+
];
|
|
403
|
+
|
|
404
|
+
export default ingestedConstructs;
|
|
405
|
+
`;
|
|
406
|
+
}
|
|
407
|
+
function renderPoliciesDraft(model) {
|
|
408
|
+
const entries = [];
|
|
409
|
+
for (const p of model.generatedVsHandwritten.recommendedPolicyRules) {
|
|
410
|
+
entries.push(` {
|
|
411
|
+
id: ${JSON.stringify(p.suggestedId)},
|
|
412
|
+
title: ${JSON.stringify(p.title)},
|
|
413
|
+
description: ${JSON.stringify(p.description)},
|
|
414
|
+
patterns: ${JSON.stringify(p.patterns)},
|
|
415
|
+
}`);
|
|
416
|
+
}
|
|
417
|
+
return `${header('Policy rules inferred from repository ingestion.')}
|
|
418
|
+
export const ingestedPolicies = [
|
|
419
|
+
${entries.join(',\n')}
|
|
420
|
+
];
|
|
421
|
+
|
|
422
|
+
export default ingestedPolicies;
|
|
423
|
+
`;
|
|
424
|
+
}
|
|
425
|
+
function renderPlaybooksDraft(model) {
|
|
426
|
+
const entries = model.changeProtocol.entries.map((p) => ` {
|
|
427
|
+
id: ${JSON.stringify(p.id)},
|
|
428
|
+
title: ${JSON.stringify(p.title)},
|
|
429
|
+
steps: ${JSON.stringify(p.steps)},
|
|
430
|
+
commands: ${JSON.stringify(p.recommendedCommands)},
|
|
431
|
+
}`);
|
|
432
|
+
return `${header('Playbooks inferred from repository ingestion.')}
|
|
433
|
+
export const ingestedPlaybooks = [
|
|
434
|
+
${entries.join(',\n')}
|
|
435
|
+
];
|
|
436
|
+
|
|
437
|
+
export default ingestedPlaybooks;
|
|
438
|
+
`;
|
|
439
|
+
}
|
|
440
|
+
function renderTemplatesDraft(model) {
|
|
441
|
+
const safe = model.inferredTemplates.filter((t) => t.confidence !== 'low');
|
|
442
|
+
const entries = safe.map((t) => ` // ${t.id} — ${t.confidence} confidence: ${t.reason}\n /* template body left as a draft — copy from sharkcraft/onboarding once reviewed */`);
|
|
443
|
+
return `${header('Templates inferred from repository ingestion (high/medium confidence only).')}
|
|
444
|
+
// To keep the draft safe, the actual template bodies are not auto-emitted here.
|
|
445
|
+
// Run \`shrk infer templates --ast\` to produce runnable bodies, then copy
|
|
446
|
+
// reviewed entries into sharkcraft/templates.ts.
|
|
447
|
+
|
|
448
|
+
export const ingestedTemplates: unknown[] = [
|
|
449
|
+
${entries.join(',\n')}
|
|
450
|
+
];
|
|
451
|
+
|
|
452
|
+
export default ingestedTemplates;
|
|
453
|
+
`;
|
|
454
|
+
}
|
|
455
|
+
function renderPipelinesDraft(model) {
|
|
456
|
+
const entries = model.inferredPipelines.map((p) => ` {
|
|
457
|
+
id: ${JSON.stringify(p.id)},
|
|
458
|
+
title: ${JSON.stringify(p.title)},
|
|
459
|
+
description: ${JSON.stringify(p.description)},
|
|
460
|
+
steps: ${JSON.stringify(p.steps)},
|
|
461
|
+
}`);
|
|
462
|
+
return `${header('Pipelines inferred from repository ingestion.')}
|
|
463
|
+
export const ingestedPipelines = [
|
|
464
|
+
${entries.join(',\n')}
|
|
465
|
+
];
|
|
466
|
+
|
|
467
|
+
export default ingestedPipelines;
|
|
468
|
+
`;
|
|
469
|
+
}
|
|
470
|
+
function renderPresetsDraft(model) {
|
|
471
|
+
const ids = model.presets.map((r) => r.preset.id);
|
|
472
|
+
return `${header('Local preset bundle inferred from repository ingestion.')}
|
|
473
|
+
export const ingestedPresetBundle = {
|
|
474
|
+
id: 'local.bundle',
|
|
475
|
+
title: 'Local preset bundle',
|
|
476
|
+
description: 'Bundle of presets ranked for this repo by the ingestion pipeline.',
|
|
477
|
+
members: ${JSON.stringify(ids)},
|
|
478
|
+
};
|
|
479
|
+
|
|
480
|
+
export default ingestedPresetBundle;
|
|
481
|
+
`;
|
|
482
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export type LoaderAssetKind = 'knowledge' | 'rules' | 'paths' | 'docs' | 'templates' | 'pipelines' | 'presets' | 'boundaries';
|
|
2
|
+
export type LoaderAssetStatus = 'ok' | 'failed' | 'timeout';
|
|
3
|
+
export interface ICachedAssetEntry {
|
|
4
|
+
v: 1;
|
|
5
|
+
filePath: string;
|
|
6
|
+
mtimeMs: number;
|
|
7
|
+
sizeBytes: number;
|
|
8
|
+
contentHashPrefix: string;
|
|
9
|
+
status: LoaderAssetStatus;
|
|
10
|
+
elapsedMs: number;
|
|
11
|
+
recordedAtMs: number;
|
|
12
|
+
kind: LoaderAssetKind;
|
|
13
|
+
ids: readonly string[];
|
|
14
|
+
warningCount: number;
|
|
15
|
+
errorMessage?: string;
|
|
16
|
+
timedOut?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface IInspectorCache {
|
|
19
|
+
readonly enabled: boolean;
|
|
20
|
+
readonly dir: string;
|
|
21
|
+
/** Get the persisted entry for a path (regardless of freshness). */
|
|
22
|
+
get(filePath: string): ICachedAssetEntry | null;
|
|
23
|
+
/** Persist (best-effort) — no-op when disabled. */
|
|
24
|
+
put(entry: ICachedAssetEntry): void;
|
|
25
|
+
/** True iff the on-disk entry matches the current file fingerprint. */
|
|
26
|
+
isFreshFor(filePath: string, entry: ICachedAssetEntry): boolean;
|
|
27
|
+
/** Inspect the resolved cache directory for diagnostics. */
|
|
28
|
+
list(): readonly ICachedAssetEntry[];
|
|
29
|
+
}
|
|
30
|
+
export interface IInspectorCacheOptions {
|
|
31
|
+
projectRoot: string;
|
|
32
|
+
enabled?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export declare function createInspectorCache(options: IInspectorCacheOptions): IInspectorCache;
|
|
35
|
+
export interface IFileFingerprint {
|
|
36
|
+
mtimeMs: number;
|
|
37
|
+
sizeBytes: number;
|
|
38
|
+
contentHashPrefix: string;
|
|
39
|
+
}
|
|
40
|
+
export declare function computeFileFingerprint(filePath: string): IFileFingerprint | null;
|
|
41
|
+
//# sourceMappingURL=inspector-cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspector-cache.d.ts","sourceRoot":"","sources":["../src/inspector-cache.ts"],"names":[],"mappings":"AAWA,MAAM,MAAM,eAAe,GACvB,WAAW,GACX,OAAO,GACP,OAAO,GACP,MAAM,GACN,WAAW,GACX,WAAW,GACX,SAAS,GACT,YAAY,CAAC;AAEjB,MAAM,MAAM,iBAAiB,GAAG,IAAI,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE5D,MAAM,WAAW,iBAAiB;IAChC,CAAC,EAAE,CAAC,CAAC;IACL,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,MAAM,EAAE,iBAAiB,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,eAAe,CAAC;IACtB,GAAG,EAAE,SAAS,MAAM,EAAE,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,oEAAoE;IACpE,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,iBAAiB,GAAG,IAAI,CAAC;IAChD,mDAAmD;IACnD,GAAG,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACpC,uEAAuE;IACvE,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC;IAChE,4DAA4D;IAC5D,IAAI,IAAI,SAAS,iBAAiB,EAAE,CAAC;CACtC;AAED,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAgFD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,sBAAsB,GAAG,eAAe,CAErF;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAYhF"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync, statSync, writeFileSync, } from 'node:fs';
|
|
3
|
+
import * as nodePath from 'node:path';
|
|
4
|
+
const CACHE_REL_DIR = '.sharkcraft/cache/inspector/v1';
|
|
5
|
+
function fileKey(filePath) {
|
|
6
|
+
const abs = nodePath.resolve(filePath);
|
|
7
|
+
return createHash('sha256').update(abs).digest('hex').slice(0, 32);
|
|
8
|
+
}
|
|
9
|
+
class DiskInspectorCache {
|
|
10
|
+
enabled;
|
|
11
|
+
dir;
|
|
12
|
+
constructor(options) {
|
|
13
|
+
this.enabled = options.enabled ?? true;
|
|
14
|
+
this.dir = nodePath.join(options.projectRoot, CACHE_REL_DIR);
|
|
15
|
+
if (this.enabled && !existsSync(this.dir)) {
|
|
16
|
+
try {
|
|
17
|
+
mkdirSync(this.dir, { recursive: true });
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
// best-effort
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
get(filePath) {
|
|
25
|
+
if (!this.enabled)
|
|
26
|
+
return null;
|
|
27
|
+
const fp = nodePath.join(this.dir, fileKey(filePath) + '.json');
|
|
28
|
+
if (!existsSync(fp))
|
|
29
|
+
return null;
|
|
30
|
+
try {
|
|
31
|
+
const raw = readFileSync(fp, 'utf8');
|
|
32
|
+
const parsed = JSON.parse(raw);
|
|
33
|
+
if (parsed.v !== 1)
|
|
34
|
+
return null;
|
|
35
|
+
return parsed;
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
put(entry) {
|
|
42
|
+
if (!this.enabled)
|
|
43
|
+
return;
|
|
44
|
+
const fp = nodePath.join(this.dir, fileKey(entry.filePath) + '.json');
|
|
45
|
+
try {
|
|
46
|
+
writeFileSync(fp, JSON.stringify(entry));
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
// best-effort
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
isFreshFor(filePath, entry) {
|
|
53
|
+
if (!this.enabled)
|
|
54
|
+
return false;
|
|
55
|
+
try {
|
|
56
|
+
const st = statSync(filePath);
|
|
57
|
+
return st.mtimeMs === entry.mtimeMs && st.size === entry.sizeBytes;
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
list() {
|
|
64
|
+
if (!this.enabled || !existsSync(this.dir))
|
|
65
|
+
return [];
|
|
66
|
+
const out = [];
|
|
67
|
+
try {
|
|
68
|
+
for (const name of readdirSync(this.dir)) {
|
|
69
|
+
if (!name.endsWith('.json'))
|
|
70
|
+
continue;
|
|
71
|
+
try {
|
|
72
|
+
const raw = readFileSync(nodePath.join(this.dir, name), 'utf8');
|
|
73
|
+
const parsed = JSON.parse(raw);
|
|
74
|
+
if (parsed.v === 1)
|
|
75
|
+
out.push(parsed);
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
// skip
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
// best-effort
|
|
84
|
+
}
|
|
85
|
+
return out;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
export function createInspectorCache(options) {
|
|
89
|
+
return new DiskInspectorCache(options);
|
|
90
|
+
}
|
|
91
|
+
export function computeFileFingerprint(filePath) {
|
|
92
|
+
try {
|
|
93
|
+
const st = statSync(filePath);
|
|
94
|
+
const buf = readFileSync(filePath);
|
|
95
|
+
return {
|
|
96
|
+
mtimeMs: st.mtimeMs,
|
|
97
|
+
sizeBytes: st.size,
|
|
98
|
+
contentHashPrefix: createHash('sha256').update(buf).digest('hex').slice(0, 16),
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `shrk install smoke` — verify the installed CLI is callable.
|
|
3
|
+
*
|
|
4
|
+
* Declares a deterministic plan of safe commands to run after install (no
|
|
5
|
+
* network, no shell tricks). The CLI command runs each plan step with the
|
|
6
|
+
* inherited environment and reports pass/fail per step.
|
|
7
|
+
*
|
|
8
|
+
* Plan steps:
|
|
9
|
+
* - resolve the local `shrk` binary
|
|
10
|
+
* - shrk version
|
|
11
|
+
* - shrk help
|
|
12
|
+
* - shrk commands primary
|
|
13
|
+
* - shrk runtime doctor
|
|
14
|
+
* - shrk release readiness (only if inside the SharkCraft repo)
|
|
15
|
+
*/
|
|
16
|
+
export declare const INSTALL_SMOKE_SCHEMA = "sharkcraft.install-smoke/v1";
|
|
17
|
+
export interface IInstallSmokeStep {
|
|
18
|
+
id: string;
|
|
19
|
+
title: string;
|
|
20
|
+
command: readonly string[];
|
|
21
|
+
/** When true, failure is non-fatal. */
|
|
22
|
+
optional?: boolean;
|
|
23
|
+
/** When set, the step is only attempted if running inside the SharkCraft repo. */
|
|
24
|
+
requiresRepo?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface IInstallSmokeStepResult {
|
|
27
|
+
step: IInstallSmokeStep;
|
|
28
|
+
status: 'pass' | 'fail' | 'skipped';
|
|
29
|
+
exitCode: number | null;
|
|
30
|
+
durationMs: number;
|
|
31
|
+
stdoutTail: string;
|
|
32
|
+
stderrTail: string;
|
|
33
|
+
reason?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface IInstallSmokeReport {
|
|
36
|
+
schema: typeof INSTALL_SMOKE_SCHEMA;
|
|
37
|
+
generatedAt: string;
|
|
38
|
+
projectRoot: string;
|
|
39
|
+
isSharkcraftRepo: boolean;
|
|
40
|
+
steps: readonly IInstallSmokeStepResult[];
|
|
41
|
+
ok: boolean;
|
|
42
|
+
}
|
|
43
|
+
export declare function getInstallSmokePlan(): readonly IInstallSmokeStep[];
|
|
44
|
+
//# sourceMappingURL=install-smoke.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install-smoke.d.ts","sourceRoot":"","sources":["../src/install-smoke.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,eAAO,MAAM,oBAAoB,gCAAgC,CAAC;AAElE,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,uCAAuC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kFAAkF;IAClF,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,iBAAiB,CAAC;IACxB,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACpC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,OAAO,oBAAoB,CAAC;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,KAAK,EAAE,SAAS,uBAAuB,EAAE,CAAC;IAC1C,EAAE,EAAE,OAAO,CAAC;CACb;AAeD,wBAAgB,mBAAmB,IAAI,SAAS,iBAAiB,EAAE,CAElE"}
|