@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,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plan-only plugin lifecycle helpers driven by a resolved profile.
|
|
3
|
+
*
|
|
4
|
+
* Lifecycle helpers never write source directly. They emit a structured plan
|
|
5
|
+
* containing:
|
|
6
|
+
* - replaceOps: safe `replace` plan operations against the profile's
|
|
7
|
+
* key-table file, barrels, and other registry files.
|
|
8
|
+
* - manualSteps: things the planned-operation model cannot do today
|
|
9
|
+
* (rename a folder, delete a folder) when folder ops are
|
|
10
|
+
* not requested or not safe.
|
|
11
|
+
* - conflicts: anchors that could not be found — surfaced as advisory
|
|
12
|
+
* hints (no failure).
|
|
13
|
+
* - destructive: `true` for remove; `true` for rename when files need to
|
|
14
|
+
* be renamed on disk.
|
|
15
|
+
*
|
|
16
|
+
* The engine has no project-specific knowledge: every path / key style / barrel
|
|
17
|
+
* comes from the supplied `IPluginLifecycleProfile`. A pack contributes the
|
|
18
|
+
* profile via `pluginLifecycleProfileFiles` on the manifest.
|
|
19
|
+
*/
|
|
20
|
+
import { type IPluginLifecycleProfile } from '@shrkcrft/plugin-api';
|
|
21
|
+
export declare enum PluginLifecycleAction {
|
|
22
|
+
Rename = "rename",
|
|
23
|
+
Remove = "remove"
|
|
24
|
+
}
|
|
25
|
+
export interface IPluginLifecycleManualStep {
|
|
26
|
+
kind: 'delete-file' | 'delete-folder' | 'rename-file' | 'rename-folder';
|
|
27
|
+
targetPath: string;
|
|
28
|
+
newPath?: string;
|
|
29
|
+
reason: string;
|
|
30
|
+
}
|
|
31
|
+
export interface IPluginLifecycleReplaceOp {
|
|
32
|
+
targetPath: string;
|
|
33
|
+
operation: {
|
|
34
|
+
kind: 'replace';
|
|
35
|
+
find: string;
|
|
36
|
+
replaceWith: string;
|
|
37
|
+
description: string;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export interface IPluginLifecycleFolderOp {
|
|
41
|
+
kind: 'rename-folder' | 'delete-folder';
|
|
42
|
+
targetPath: string;
|
|
43
|
+
newPath?: string;
|
|
44
|
+
safety: 'safe' | 'unsafe';
|
|
45
|
+
safetyReason?: string;
|
|
46
|
+
reason: string;
|
|
47
|
+
}
|
|
48
|
+
export interface IPluginLifecyclePlan {
|
|
49
|
+
schema: 'sharkcraft.plugin-lifecycle/v1';
|
|
50
|
+
action: PluginLifecycleAction;
|
|
51
|
+
/** Profile id (e.g. "my-monorepo"). Engine does not constrain this to a literal. */
|
|
52
|
+
profile: string;
|
|
53
|
+
oldName: string;
|
|
54
|
+
newName?: string;
|
|
55
|
+
destructive: boolean;
|
|
56
|
+
humanApprovalRequired: boolean;
|
|
57
|
+
replaceOps: ReadonlyArray<IPluginLifecycleReplaceOp>;
|
|
58
|
+
manualSteps: ReadonlyArray<IPluginLifecycleManualStep>;
|
|
59
|
+
/** Structured folder operations when --emit-folder-ops is requested. */
|
|
60
|
+
folderOps?: ReadonlyArray<IPluginLifecycleFolderOp>;
|
|
61
|
+
conflicts: ReadonlyArray<string>;
|
|
62
|
+
validationCommands: ReadonlyArray<string>;
|
|
63
|
+
}
|
|
64
|
+
export interface IBuildPluginRenameInput {
|
|
65
|
+
projectRoot: string;
|
|
66
|
+
profile: IPluginLifecycleProfile;
|
|
67
|
+
oldName: string;
|
|
68
|
+
newName: string;
|
|
69
|
+
/** When true, also emit structured folder rename ops in `folderOps[]`. */
|
|
70
|
+
emitFolderOps?: boolean;
|
|
71
|
+
}
|
|
72
|
+
export declare function buildPluginRenamePlan(input: IBuildPluginRenameInput): IPluginLifecyclePlan;
|
|
73
|
+
export interface IBuildPluginRemoveInput {
|
|
74
|
+
projectRoot: string;
|
|
75
|
+
profile: IPluginLifecycleProfile;
|
|
76
|
+
oldName: string;
|
|
77
|
+
/** When true, also emit structured folder delete ops in `folderOps[]`. */
|
|
78
|
+
emitFolderOps?: boolean;
|
|
79
|
+
}
|
|
80
|
+
export declare function buildPluginRemovePlan(input: IBuildPluginRemoveInput): IPluginLifecyclePlan;
|
|
81
|
+
/**
|
|
82
|
+
* Convert a plugin-lifecycle plan into a saved plan (synthetic
|
|
83
|
+
* templateId) so it can flow through `shrk apply`. ReplaceOps become
|
|
84
|
+
* `expectedChanges` carrying their operation intent; folderOps[] is copied
|
|
85
|
+
* through. The plan is unsigned by this helper; call `signPlan` separately.
|
|
86
|
+
*/
|
|
87
|
+
export declare const PLUGIN_LIFECYCLE_SYNTHETIC_TEMPLATE = "__plugin-lifecycle__";
|
|
88
|
+
export declare function pluginLifecyclePlanToSavedPlan(plan: IPluginLifecyclePlan, projectRoot: string): {
|
|
89
|
+
schema: 'sharkcraft.plan/v2';
|
|
90
|
+
templateId: string;
|
|
91
|
+
name?: string;
|
|
92
|
+
variables: Record<string, string>;
|
|
93
|
+
projectRoot: string;
|
|
94
|
+
createdAt: string;
|
|
95
|
+
expectedChanges: {
|
|
96
|
+
type: string;
|
|
97
|
+
relativePath: string;
|
|
98
|
+
sizeBytes: number;
|
|
99
|
+
operation: IPluginLifecycleReplaceOp['operation'];
|
|
100
|
+
}[];
|
|
101
|
+
folderOps?: {
|
|
102
|
+
kind: 'rename-folder' | 'delete-folder';
|
|
103
|
+
targetPath: string;
|
|
104
|
+
newPath?: string;
|
|
105
|
+
reason?: string;
|
|
106
|
+
}[];
|
|
107
|
+
note?: string;
|
|
108
|
+
};
|
|
109
|
+
export declare function renderPluginLifecyclePlanText(plan: IPluginLifecyclePlan): string;
|
|
110
|
+
export interface IPluginLifecycleListingInput {
|
|
111
|
+
projectRoot: string;
|
|
112
|
+
profile: IPluginLifecycleProfile;
|
|
113
|
+
}
|
|
114
|
+
export declare function buildPluginLifecycleListing(input: IPluginLifecycleListingInput): {
|
|
115
|
+
pluginsByLayer: Readonly<Record<string, ReadonlyArray<string>>>;
|
|
116
|
+
pluginKeys: ReadonlyArray<{
|
|
117
|
+
key: string;
|
|
118
|
+
value: string;
|
|
119
|
+
}>;
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
* Doctor check: a profile is valid if every declared file exists and the
|
|
123
|
+
* key-table file (if any) parses. This stays read-only; no fs mutations.
|
|
124
|
+
*/
|
|
125
|
+
export interface IPluginLifecycleProfileDoctorEntry {
|
|
126
|
+
readonly id: 'missing-key-table' | 'missing-barrel' | 'missing-plugin-root' | 'ok';
|
|
127
|
+
readonly severity: 'info' | 'warning' | 'error';
|
|
128
|
+
readonly path?: string;
|
|
129
|
+
readonly message: string;
|
|
130
|
+
}
|
|
131
|
+
export declare function checkPluginLifecycleProfileHealth(projectRoot: string, profile: IPluginLifecycleProfile): readonly IPluginLifecycleProfileDoctorEntry[];
|
|
132
|
+
//# sourceMappingURL=plugin-lifecycle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-lifecycle.d.ts","sourceRoot":"","sources":["../src/plugin-lifecycle.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,477 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plan-only plugin lifecycle helpers driven by a resolved profile.
|
|
3
|
+
*
|
|
4
|
+
* Lifecycle helpers never write source directly. They emit a structured plan
|
|
5
|
+
* containing:
|
|
6
|
+
* - replaceOps: safe `replace` plan operations against the profile's
|
|
7
|
+
* key-table file, barrels, and other registry files.
|
|
8
|
+
* - manualSteps: things the planned-operation model cannot do today
|
|
9
|
+
* (rename a folder, delete a folder) when folder ops are
|
|
10
|
+
* not requested or not safe.
|
|
11
|
+
* - conflicts: anchors that could not be found — surfaced as advisory
|
|
12
|
+
* hints (no failure).
|
|
13
|
+
* - destructive: `true` for remove; `true` for rename when files need to
|
|
14
|
+
* be renamed on disk.
|
|
15
|
+
*
|
|
16
|
+
* The engine has no project-specific knowledge: every path / key style / barrel
|
|
17
|
+
* comes from the supplied `IPluginLifecycleProfile`. A pack contributes the
|
|
18
|
+
* profile via `pluginLifecycleProfileFiles` on the manifest.
|
|
19
|
+
*/
|
|
20
|
+
import { existsSync, readFileSync, readdirSync } from 'node:fs';
|
|
21
|
+
import { checkFolderOpSafety } from '@shrkcrft/generator';
|
|
22
|
+
import { join } from 'node:path';
|
|
23
|
+
import { CaseStyle, } from '@shrkcrft/plugin-api';
|
|
24
|
+
export var PluginLifecycleAction;
|
|
25
|
+
(function (PluginLifecycleAction) {
|
|
26
|
+
PluginLifecycleAction["Rename"] = "rename";
|
|
27
|
+
PluginLifecycleAction["Remove"] = "remove";
|
|
28
|
+
})(PluginLifecycleAction || (PluginLifecycleAction = {}));
|
|
29
|
+
function readFileSafe(absPath) {
|
|
30
|
+
if (!existsSync(absPath))
|
|
31
|
+
return null;
|
|
32
|
+
try {
|
|
33
|
+
return readFileSync(absPath, 'utf8');
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function escapeRegex(s) {
|
|
40
|
+
return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Build a global regex that matches `${segment}/${name}` only when
|
|
44
|
+
* `name` ends at a true token boundary (the next character is NOT an
|
|
45
|
+
* identifier-continuation: kebab `-`, underscore `_`, digit, letter, or
|
|
46
|
+
* dot). Prevents `data` from matching inside `dataflow`, `data-flow`, or
|
|
47
|
+
* `data.foo`.
|
|
48
|
+
*/
|
|
49
|
+
function segmentBoundaryRegex(segment, name) {
|
|
50
|
+
return new RegExp(`${escapeRegex(segment)}/${escapeRegex(name)}(?![A-Za-z0-9_\\-.])`, 'g');
|
|
51
|
+
}
|
|
52
|
+
function splitWords(input) {
|
|
53
|
+
if (!input)
|
|
54
|
+
return [];
|
|
55
|
+
// kebab / snake split
|
|
56
|
+
if (input.includes('-') || input.includes('_')) {
|
|
57
|
+
return input.split(/[-_]/).filter(Boolean);
|
|
58
|
+
}
|
|
59
|
+
// camel / pascal split on case boundaries
|
|
60
|
+
return input.split(/(?=[A-Z])/).map((w) => w.toLowerCase()).filter(Boolean);
|
|
61
|
+
}
|
|
62
|
+
function toCase(input, style) {
|
|
63
|
+
const words = splitWords(input);
|
|
64
|
+
if (words.length === 0)
|
|
65
|
+
return input;
|
|
66
|
+
switch (style) {
|
|
67
|
+
case CaseStyle.Kebab:
|
|
68
|
+
return words.map((w) => w.toLowerCase()).join('-');
|
|
69
|
+
case CaseStyle.UpperSnake:
|
|
70
|
+
return words.map((w) => w.toUpperCase()).join('_');
|
|
71
|
+
case CaseStyle.Pascal:
|
|
72
|
+
return words.map((w) => w.charAt(0).toUpperCase() + w.slice(1).toLowerCase()).join('');
|
|
73
|
+
case CaseStyle.Camel: {
|
|
74
|
+
return words
|
|
75
|
+
.map((w, i) => i === 0
|
|
76
|
+
? w.toLowerCase()
|
|
77
|
+
: w.charAt(0).toUpperCase() + w.slice(1).toLowerCase())
|
|
78
|
+
.join('');
|
|
79
|
+
}
|
|
80
|
+
default:
|
|
81
|
+
return input;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
function pluginKeysEntryRegex(keyTable, name) {
|
|
85
|
+
const key = toCase(name, keyTable.keyCase);
|
|
86
|
+
const value = toCase(name, keyTable.valueCase);
|
|
87
|
+
return new RegExp(`\\s*${escapeRegex(key)}:\\s*['"]${escapeRegex(value)}['"],?\\n`);
|
|
88
|
+
}
|
|
89
|
+
function findFirstMatch(content, re) {
|
|
90
|
+
if (!content)
|
|
91
|
+
return null;
|
|
92
|
+
const m = content.match(re);
|
|
93
|
+
return m ? m[0] : null;
|
|
94
|
+
}
|
|
95
|
+
function loadProfileContext(projectRoot, profile) {
|
|
96
|
+
const keyTablePath = profile.keyTable?.path ? join(projectRoot, profile.keyTable.path) : null;
|
|
97
|
+
const keyTableContent = keyTablePath ? readFileSafe(keyTablePath) : null;
|
|
98
|
+
const barrels = (profile.barrels ?? []).map((b) => {
|
|
99
|
+
const absPath = join(projectRoot, b.path);
|
|
100
|
+
return { barrel: b, absPath, content: readFileSafe(absPath) };
|
|
101
|
+
});
|
|
102
|
+
return { projectRoot, keyTablePath, keyTableContent, barrels };
|
|
103
|
+
}
|
|
104
|
+
export function buildPluginRenamePlan(input) {
|
|
105
|
+
const { projectRoot, profile, oldName, newName } = input;
|
|
106
|
+
const ctx = loadProfileContext(projectRoot, profile);
|
|
107
|
+
const replaceOps = [];
|
|
108
|
+
const manualSteps = [];
|
|
109
|
+
const conflicts = [];
|
|
110
|
+
// Key-table entry rename
|
|
111
|
+
if (profile.keyTable && ctx.keyTableContent) {
|
|
112
|
+
const keyTablePath = profile.keyTable.path;
|
|
113
|
+
const keysFind = findFirstMatch(ctx.keyTableContent, pluginKeysEntryRegex(profile.keyTable, oldName));
|
|
114
|
+
if (keysFind) {
|
|
115
|
+
const oldKey = toCase(oldName, profile.keyTable.keyCase);
|
|
116
|
+
const newKey = toCase(newName, profile.keyTable.keyCase);
|
|
117
|
+
const oldValue = toCase(oldName, profile.keyTable.valueCase);
|
|
118
|
+
const newValue = toCase(newName, profile.keyTable.valueCase);
|
|
119
|
+
replaceOps.push({
|
|
120
|
+
targetPath: keyTablePath,
|
|
121
|
+
operation: {
|
|
122
|
+
kind: 'replace',
|
|
123
|
+
find: keysFind,
|
|
124
|
+
replaceWith: keysFind
|
|
125
|
+
.replace(new RegExp(escapeRegex(oldKey)), newKey)
|
|
126
|
+
.replace(new RegExp(`['"]${escapeRegex(oldValue)}['"]`), `'${newValue}'`),
|
|
127
|
+
description: `Rename key-table entry ${oldKey} → ${newKey}; '${oldValue}' → '${newValue}'.`,
|
|
128
|
+
},
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
conflicts.push(`Key-table entry for "${oldName}" not found in ${keyTablePath}.`);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
// Barrel exports: word/token-bounded matching prevents substring
|
|
136
|
+
// overlap (e.g. `data` matching inside `dataflow`). A segment match is
|
|
137
|
+
// valid only when the character after `${segment}/${name}` is NOT a
|
|
138
|
+
// kebab/identifier continuation character (so `data` doesn't pre-match
|
|
139
|
+
// `dataflow`, `data-flow`, or `data_flow`).
|
|
140
|
+
for (const { barrel, content } of ctx.barrels) {
|
|
141
|
+
if (!content)
|
|
142
|
+
continue;
|
|
143
|
+
const segment = barrel.exportSegment ?? 'plugins';
|
|
144
|
+
const segmentMatchRe = segmentBoundaryRegex(segment, oldName);
|
|
145
|
+
if (segmentMatchRe.test(content)) {
|
|
146
|
+
const lines = content.split('\n');
|
|
147
|
+
for (const line of lines) {
|
|
148
|
+
// Reset lastIndex so the global regex doesn't skip lines.
|
|
149
|
+
segmentMatchRe.lastIndex = 0;
|
|
150
|
+
if (segmentMatchRe.test(line)) {
|
|
151
|
+
replaceOps.push({
|
|
152
|
+
targetPath: barrel.path,
|
|
153
|
+
operation: {
|
|
154
|
+
kind: 'replace',
|
|
155
|
+
find: line + '\n',
|
|
156
|
+
replaceWith: line.replace(segmentBoundaryRegex(segment, oldName), `${segment}/${newName}`) + '\n',
|
|
157
|
+
description: `Update barrel export from ${segment}/${oldName} to ${segment}/${newName}.`,
|
|
158
|
+
},
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
conflicts.push(`No barrel export referencing "${segment}/${oldName}" in ${barrel.path}.`);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
// Plugin folder renames — manual unless folder ops requested at the caller
|
|
168
|
+
const folderOps = [];
|
|
169
|
+
for (const root of profile.pluginRoots) {
|
|
170
|
+
const oldDir = join(projectRoot, root.path, oldName);
|
|
171
|
+
if (existsSync(oldDir)) {
|
|
172
|
+
if (input.emitFolderOps) {
|
|
173
|
+
const safety = checkFolderOpSafety(projectRoot, `${root.path}/${oldName}`, 'rename-folder');
|
|
174
|
+
folderOps.push({
|
|
175
|
+
kind: 'rename-folder',
|
|
176
|
+
targetPath: `${root.path}/${oldName}`,
|
|
177
|
+
newPath: `${root.path}/${newName}`,
|
|
178
|
+
safety: safety.safety,
|
|
179
|
+
...(safety.reason ? { safetyReason: safety.reason } : {}),
|
|
180
|
+
reason: 'Structured rename-folder op. Apply rejects unsafe paths automatically; humans still review.',
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
manualSteps.push({
|
|
185
|
+
kind: 'rename-folder',
|
|
186
|
+
targetPath: `${root.path}/${oldName}`,
|
|
187
|
+
newPath: `${root.path}/${newName}`,
|
|
188
|
+
reason: 'Rename plugin folder. Plan v2 has no rename-folder op by default; pass `--emit-folder-ops` to include them in the plan.',
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
return {
|
|
194
|
+
schema: 'sharkcraft.plugin-lifecycle/v1',
|
|
195
|
+
action: PluginLifecycleAction.Rename,
|
|
196
|
+
profile: profile.id,
|
|
197
|
+
oldName,
|
|
198
|
+
newName,
|
|
199
|
+
destructive: manualSteps.length > 0 || folderOps.length > 0,
|
|
200
|
+
humanApprovalRequired: true,
|
|
201
|
+
replaceOps,
|
|
202
|
+
manualSteps,
|
|
203
|
+
...(folderOps.length > 0 ? { folderOps } : {}),
|
|
204
|
+
conflicts,
|
|
205
|
+
validationCommands: profile.validationCommands ?? [
|
|
206
|
+
'shrk check boundaries --changed-only',
|
|
207
|
+
'shrk doctor',
|
|
208
|
+
],
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
export function buildPluginRemovePlan(input) {
|
|
212
|
+
const { projectRoot, profile, oldName } = input;
|
|
213
|
+
const ctx = loadProfileContext(projectRoot, profile);
|
|
214
|
+
const replaceOps = [];
|
|
215
|
+
const manualSteps = [];
|
|
216
|
+
const folderOps = [];
|
|
217
|
+
const conflicts = [];
|
|
218
|
+
if (profile.keyTable && ctx.keyTableContent) {
|
|
219
|
+
const keyTablePath = profile.keyTable.path;
|
|
220
|
+
const keysFind = findFirstMatch(ctx.keyTableContent, pluginKeysEntryRegex(profile.keyTable, oldName));
|
|
221
|
+
if (keysFind) {
|
|
222
|
+
const oldKey = toCase(oldName, profile.keyTable.keyCase);
|
|
223
|
+
replaceOps.push({
|
|
224
|
+
targetPath: keyTablePath,
|
|
225
|
+
operation: {
|
|
226
|
+
kind: 'replace',
|
|
227
|
+
find: keysFind,
|
|
228
|
+
replaceWith: '',
|
|
229
|
+
description: `Remove key-table entry ${oldKey}.`,
|
|
230
|
+
},
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
else {
|
|
234
|
+
conflicts.push(`Key-table entry for "${oldName}" not found in ${keyTablePath}.`);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
for (const { barrel, content } of ctx.barrels) {
|
|
238
|
+
if (!content)
|
|
239
|
+
continue;
|
|
240
|
+
const segment = barrel.exportSegment ?? 'plugins';
|
|
241
|
+
const segmentMatchRe = segmentBoundaryRegex(segment, oldName);
|
|
242
|
+
const lines = content.split('\n');
|
|
243
|
+
for (const line of lines) {
|
|
244
|
+
segmentMatchRe.lastIndex = 0;
|
|
245
|
+
if (segmentMatchRe.test(line)) {
|
|
246
|
+
replaceOps.push({
|
|
247
|
+
targetPath: barrel.path,
|
|
248
|
+
operation: {
|
|
249
|
+
kind: 'replace',
|
|
250
|
+
find: line + '\n',
|
|
251
|
+
replaceWith: '',
|
|
252
|
+
description: `Remove barrel export referencing ${segment}/${oldName} from ${barrel.path}.`,
|
|
253
|
+
},
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
for (const root of profile.pluginRoots) {
|
|
259
|
+
const oldDir = join(projectRoot, root.path, oldName);
|
|
260
|
+
if (existsSync(oldDir)) {
|
|
261
|
+
if (input.emitFolderOps) {
|
|
262
|
+
const safety = checkFolderOpSafety(projectRoot, `${root.path}/${oldName}`, 'delete-folder');
|
|
263
|
+
folderOps.push({
|
|
264
|
+
kind: 'delete-folder',
|
|
265
|
+
targetPath: `${root.path}/${oldName}`,
|
|
266
|
+
safety: safety.safety,
|
|
267
|
+
...(safety.reason ? { safetyReason: safety.reason } : {}),
|
|
268
|
+
reason: 'Structured delete-folder op. Apply rejects unsafe paths and requires `--allow-delete-folder`.',
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
else {
|
|
272
|
+
manualSteps.push({
|
|
273
|
+
kind: 'delete-folder',
|
|
274
|
+
targetPath: `${root.path}/${oldName}`,
|
|
275
|
+
reason: 'Delete plugin folder. Destructive; plan v2 has no delete-folder op by default. Use `git rm -r` after the plan is applied, or pass `--emit-folder-ops`.',
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
return {
|
|
281
|
+
schema: 'sharkcraft.plugin-lifecycle/v1',
|
|
282
|
+
action: PluginLifecycleAction.Remove,
|
|
283
|
+
profile: profile.id,
|
|
284
|
+
oldName,
|
|
285
|
+
destructive: true,
|
|
286
|
+
humanApprovalRequired: true,
|
|
287
|
+
replaceOps,
|
|
288
|
+
manualSteps,
|
|
289
|
+
...(folderOps.length > 0 ? { folderOps } : {}),
|
|
290
|
+
conflicts,
|
|
291
|
+
validationCommands: profile.validationCommands ?? [
|
|
292
|
+
'shrk check boundaries --changed-only',
|
|
293
|
+
'shrk doctor',
|
|
294
|
+
],
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Convert a plugin-lifecycle plan into a saved plan (synthetic
|
|
299
|
+
* templateId) so it can flow through `shrk apply`. ReplaceOps become
|
|
300
|
+
* `expectedChanges` carrying their operation intent; folderOps[] is copied
|
|
301
|
+
* through. The plan is unsigned by this helper; call `signPlan` separately.
|
|
302
|
+
*/
|
|
303
|
+
export const PLUGIN_LIFECYCLE_SYNTHETIC_TEMPLATE = '__plugin-lifecycle__';
|
|
304
|
+
export function pluginLifecyclePlanToSavedPlan(plan, projectRoot) {
|
|
305
|
+
// Drop redundant no-op replace entries (find == replaceWith).
|
|
306
|
+
const seen = new Set();
|
|
307
|
+
const filteredReplaceOps = plan.replaceOps.filter((op) => {
|
|
308
|
+
if (op.operation.find === op.operation.replaceWith)
|
|
309
|
+
return false;
|
|
310
|
+
const key = `${op.targetPath}::${op.operation.find}`;
|
|
311
|
+
if (seen.has(key))
|
|
312
|
+
return false;
|
|
313
|
+
seen.add(key);
|
|
314
|
+
return true;
|
|
315
|
+
});
|
|
316
|
+
// Compute the post-apply file size for each replace op against the
|
|
317
|
+
// current file, so apply-time divergence detection doesn't false-positive
|
|
318
|
+
// size-changes against a sentinel value.
|
|
319
|
+
const expectedChanges = filteredReplaceOps.map((op) => {
|
|
320
|
+
const abs = join(projectRoot, op.targetPath);
|
|
321
|
+
let sizeBytes = Buffer.byteLength(op.operation.replaceWith, 'utf8');
|
|
322
|
+
const existing = readFileSafe(abs);
|
|
323
|
+
if (existing !== null) {
|
|
324
|
+
// Compute the size as the file would look after the replace at save
|
|
325
|
+
// time. Apply will re-evaluate against the (potentially newer) file
|
|
326
|
+
// and `diffPlanChanges` compares this to the size produced by the
|
|
327
|
+
// live evaluator.
|
|
328
|
+
const findCount = (existing.match(new RegExp(escapeRegex(op.operation.find), 'g')) ?? []).length;
|
|
329
|
+
if (findCount === 1) {
|
|
330
|
+
const next = existing.replace(op.operation.find, op.operation.replaceWith);
|
|
331
|
+
sizeBytes = Buffer.byteLength(next, 'utf8');
|
|
332
|
+
}
|
|
333
|
+
else {
|
|
334
|
+
sizeBytes = Buffer.byteLength(existing, 'utf8');
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
return {
|
|
338
|
+
type: 'replace',
|
|
339
|
+
relativePath: op.targetPath,
|
|
340
|
+
sizeBytes,
|
|
341
|
+
operation: op.operation,
|
|
342
|
+
};
|
|
343
|
+
});
|
|
344
|
+
const out = {
|
|
345
|
+
schema: 'sharkcraft.plan/v2',
|
|
346
|
+
templateId: PLUGIN_LIFECYCLE_SYNTHETIC_TEMPLATE,
|
|
347
|
+
variables: {
|
|
348
|
+
profile: plan.profile,
|
|
349
|
+
oldName: plan.oldName,
|
|
350
|
+
...(plan.newName ? { newName: plan.newName } : {}),
|
|
351
|
+
action: plan.action,
|
|
352
|
+
},
|
|
353
|
+
projectRoot,
|
|
354
|
+
createdAt: new Date().toISOString(),
|
|
355
|
+
expectedChanges,
|
|
356
|
+
};
|
|
357
|
+
if (plan.folderOps && plan.folderOps.length > 0) {
|
|
358
|
+
out.folderOps = plan.folderOps.map((fo) => {
|
|
359
|
+
const entry = {
|
|
360
|
+
kind: fo.kind,
|
|
361
|
+
targetPath: fo.targetPath,
|
|
362
|
+
reason: fo.reason,
|
|
363
|
+
};
|
|
364
|
+
if (fo.newPath !== undefined)
|
|
365
|
+
entry.newPath = fo.newPath;
|
|
366
|
+
return entry;
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
return out;
|
|
370
|
+
}
|
|
371
|
+
export function renderPluginLifecyclePlanText(plan) {
|
|
372
|
+
const lines = [];
|
|
373
|
+
lines.push(`=== Plugin ${plan.action} (${plan.profile} profile) ===`);
|
|
374
|
+
lines.push(` oldName ${plan.oldName}`);
|
|
375
|
+
if (plan.newName)
|
|
376
|
+
lines.push(` newName ${plan.newName}`);
|
|
377
|
+
lines.push(` destructive ${plan.destructive ? 'YES' : 'no'}`);
|
|
378
|
+
lines.push(` approval ${plan.humanApprovalRequired ? 'human review required' : 'auto'}`);
|
|
379
|
+
lines.push('');
|
|
380
|
+
lines.push(`Planned replace ops (${plan.replaceOps.length}):`);
|
|
381
|
+
for (const op of plan.replaceOps) {
|
|
382
|
+
lines.push(` • ${op.targetPath}`);
|
|
383
|
+
lines.push(` ${op.operation.description}`);
|
|
384
|
+
}
|
|
385
|
+
if (plan.manualSteps.length > 0) {
|
|
386
|
+
lines.push('');
|
|
387
|
+
lines.push(`Manual steps required (${plan.manualSteps.length}):`);
|
|
388
|
+
for (const step of plan.manualSteps) {
|
|
389
|
+
lines.push(` • [${step.kind}] ${step.targetPath}${step.newPath ? ` → ${step.newPath}` : ''}`);
|
|
390
|
+
lines.push(` ${step.reason}`);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
if (plan.conflicts.length > 0) {
|
|
394
|
+
lines.push('');
|
|
395
|
+
lines.push(`Conflicts (${plan.conflicts.length}):`);
|
|
396
|
+
for (const c of plan.conflicts)
|
|
397
|
+
lines.push(` • ${c}`);
|
|
398
|
+
}
|
|
399
|
+
lines.push('');
|
|
400
|
+
lines.push(`Validation commands:`);
|
|
401
|
+
for (const c of plan.validationCommands)
|
|
402
|
+
lines.push(` $ ${c}`);
|
|
403
|
+
return lines.join('\n') + '\n';
|
|
404
|
+
}
|
|
405
|
+
export function buildPluginLifecycleListing(input) {
|
|
406
|
+
const { projectRoot, profile } = input;
|
|
407
|
+
const layers = {};
|
|
408
|
+
for (const root of profile.pluginRoots) {
|
|
409
|
+
const dir = join(projectRoot, root.path);
|
|
410
|
+
if (!existsSync(dir))
|
|
411
|
+
continue;
|
|
412
|
+
let entries;
|
|
413
|
+
try {
|
|
414
|
+
entries = readdirSync(dir, { withFileTypes: true });
|
|
415
|
+
}
|
|
416
|
+
catch {
|
|
417
|
+
continue;
|
|
418
|
+
}
|
|
419
|
+
layers[root.path] = entries
|
|
420
|
+
.filter((e) => e.isDirectory())
|
|
421
|
+
.map((e) => String(e.name));
|
|
422
|
+
}
|
|
423
|
+
const pluginKeys = [];
|
|
424
|
+
if (profile.keyTable) {
|
|
425
|
+
const keyTableContent = readFileSafe(join(projectRoot, profile.keyTable.path));
|
|
426
|
+
if (keyTableContent) {
|
|
427
|
+
const re = /(^|\n)\s*([A-Za-z_][A-Za-z0-9_]*):\s*'([A-Za-z_][A-Za-z0-9_-]*)'/g;
|
|
428
|
+
let match;
|
|
429
|
+
while ((match = re.exec(keyTableContent)) !== null) {
|
|
430
|
+
pluginKeys.push({ key: match[2], value: match[3] });
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
return { pluginsByLayer: layers, pluginKeys };
|
|
435
|
+
}
|
|
436
|
+
export function checkPluginLifecycleProfileHealth(projectRoot, profile) {
|
|
437
|
+
const out = [];
|
|
438
|
+
if (profile.keyTable) {
|
|
439
|
+
const abs = join(projectRoot, profile.keyTable.path);
|
|
440
|
+
if (!existsSync(abs)) {
|
|
441
|
+
out.push({
|
|
442
|
+
id: 'missing-key-table',
|
|
443
|
+
severity: 'warning',
|
|
444
|
+
path: profile.keyTable.path,
|
|
445
|
+
message: `keyTable.path "${profile.keyTable.path}" not found in this workspace.`,
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
for (const b of profile.barrels ?? []) {
|
|
450
|
+
if (!existsSync(join(projectRoot, b.path))) {
|
|
451
|
+
out.push({
|
|
452
|
+
id: 'missing-barrel',
|
|
453
|
+
severity: 'warning',
|
|
454
|
+
path: b.path,
|
|
455
|
+
message: `Barrel "${b.id}" path "${b.path}" not found.`,
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
for (const r of profile.pluginRoots) {
|
|
460
|
+
if (!existsSync(join(projectRoot, r.path))) {
|
|
461
|
+
out.push({
|
|
462
|
+
id: 'missing-plugin-root',
|
|
463
|
+
severity: 'warning',
|
|
464
|
+
path: r.path,
|
|
465
|
+
message: `Plugin root "${r.id}" path "${r.path}" not found.`,
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
if (out.length === 0) {
|
|
470
|
+
out.push({
|
|
471
|
+
id: 'ok',
|
|
472
|
+
severity: 'info',
|
|
473
|
+
message: `Profile "${profile.id}" looks healthy in this workspace.`,
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
return out;
|
|
477
|
+
}
|