@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,521 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Template authoring previews.
|
|
3
|
+
*
|
|
4
|
+
* Mirror of `knowledge-authoring.ts` for templates. Templates are TS-shaped
|
|
5
|
+
* objects (not knowledge entries), so the draft body is a TS const literal
|
|
6
|
+
* rather than a JSON-style entry. The CLI adapter writes drafts under
|
|
7
|
+
* `.sharkcraft/authoring/templates/` and records provenance with
|
|
8
|
+
* `AssetKind.Template`.
|
|
9
|
+
*
|
|
10
|
+
* Hard rules (same as knowledge-authoring):
|
|
11
|
+
* - Never mutates `sharkcraft/templates.ts` or any pack's
|
|
12
|
+
* `assets/templates.ts`.
|
|
13
|
+
* - Update preserves all unspecified fields verbatim.
|
|
14
|
+
* - Remove always reports reverse references and refuses by default
|
|
15
|
+
* when any remain (unless `forcePreview`).
|
|
16
|
+
*
|
|
17
|
+
* Scope: update + remove only. `scaffold` / `add` already ship at
|
|
18
|
+
* `packages/cli/src/commands/templates.command.ts`.
|
|
19
|
+
*/
|
|
20
|
+
export const TEMPLATE_AUTHORING_SCHEMA = 'sharkcraft.template-authoring/v1';
|
|
21
|
+
export var TemplateAuthoringOperation;
|
|
22
|
+
(function (TemplateAuthoringOperation) {
|
|
23
|
+
TemplateAuthoringOperation["Update"] = "update";
|
|
24
|
+
TemplateAuthoringOperation["Remove"] = "remove";
|
|
25
|
+
})(TemplateAuthoringOperation || (TemplateAuthoringOperation = {}));
|
|
26
|
+
function nowIso() {
|
|
27
|
+
return new Date().toISOString();
|
|
28
|
+
}
|
|
29
|
+
function clone(v) {
|
|
30
|
+
return JSON.parse(JSON.stringify(v));
|
|
31
|
+
}
|
|
32
|
+
function fileSafeId(id) {
|
|
33
|
+
return id.replace(/[^a-zA-Z0-9]+/g, '-');
|
|
34
|
+
}
|
|
35
|
+
function idToConst(id) {
|
|
36
|
+
return id
|
|
37
|
+
.split(/[.\-]/)
|
|
38
|
+
.map((p, i) => (i === 0 ? p : p.charAt(0).toUpperCase() + p.slice(1)))
|
|
39
|
+
.join('') + 'Template';
|
|
40
|
+
}
|
|
41
|
+
function applyTemplateUpdateOps(current, ops, changes) {
|
|
42
|
+
// Strip runtime resolvers — drafts cannot represent function bodies.
|
|
43
|
+
const cur = clone({
|
|
44
|
+
...current,
|
|
45
|
+
files: undefined,
|
|
46
|
+
changes: undefined,
|
|
47
|
+
targetPath: typeof current.targetPath === 'function' ? undefined : current.targetPath,
|
|
48
|
+
content: typeof current.content === 'function' ? undefined : current.content,
|
|
49
|
+
});
|
|
50
|
+
const next = clone(cur);
|
|
51
|
+
if (ops.setName !== undefined) {
|
|
52
|
+
changes.push({ op: 'replace', field: 'name', before: cur.name, after: ops.setName });
|
|
53
|
+
next.name = ops.setName;
|
|
54
|
+
}
|
|
55
|
+
if (ops.setDescription !== undefined) {
|
|
56
|
+
changes.push({
|
|
57
|
+
op: 'replace',
|
|
58
|
+
field: 'description',
|
|
59
|
+
before: cur.description,
|
|
60
|
+
after: ops.setDescription,
|
|
61
|
+
});
|
|
62
|
+
next.description = ops.setDescription;
|
|
63
|
+
}
|
|
64
|
+
if (ops.addTags && ops.addTags.length > 0) {
|
|
65
|
+
const set = new Set(next.tags);
|
|
66
|
+
const added = [];
|
|
67
|
+
for (const t of ops.addTags)
|
|
68
|
+
if (!set.has(t)) {
|
|
69
|
+
set.add(t);
|
|
70
|
+
added.push(t);
|
|
71
|
+
}
|
|
72
|
+
next.tags = [...set];
|
|
73
|
+
if (added.length > 0)
|
|
74
|
+
changes.push({ op: 'add', field: 'tags', after: added });
|
|
75
|
+
}
|
|
76
|
+
if (ops.removeTags && ops.removeTags.length > 0) {
|
|
77
|
+
const removed = next.tags.filter((t) => ops.removeTags.includes(t));
|
|
78
|
+
next.tags = next.tags.filter((t) => !ops.removeTags.includes(t));
|
|
79
|
+
if (removed.length > 0)
|
|
80
|
+
changes.push({ op: 'remove', field: 'tags', before: removed });
|
|
81
|
+
}
|
|
82
|
+
if (ops.addScope && ops.addScope.length > 0) {
|
|
83
|
+
const set = new Set(next.scope);
|
|
84
|
+
const added = [];
|
|
85
|
+
for (const t of ops.addScope)
|
|
86
|
+
if (!set.has(t)) {
|
|
87
|
+
set.add(t);
|
|
88
|
+
added.push(t);
|
|
89
|
+
}
|
|
90
|
+
next.scope = [...set];
|
|
91
|
+
if (added.length > 0)
|
|
92
|
+
changes.push({ op: 'add', field: 'scope', after: added });
|
|
93
|
+
}
|
|
94
|
+
if (ops.removeScope && ops.removeScope.length > 0) {
|
|
95
|
+
const removed = next.scope.filter((t) => ops.removeScope.includes(t));
|
|
96
|
+
next.scope = next.scope.filter((t) => !ops.removeScope.includes(t));
|
|
97
|
+
if (removed.length > 0)
|
|
98
|
+
changes.push({ op: 'remove', field: 'scope', before: removed });
|
|
99
|
+
}
|
|
100
|
+
if (ops.addAppliesWhen && ops.addAppliesWhen.length > 0) {
|
|
101
|
+
const set = new Set(next.appliesWhen);
|
|
102
|
+
const added = [];
|
|
103
|
+
for (const t of ops.addAppliesWhen)
|
|
104
|
+
if (!set.has(t)) {
|
|
105
|
+
set.add(t);
|
|
106
|
+
added.push(t);
|
|
107
|
+
}
|
|
108
|
+
next.appliesWhen = [...set];
|
|
109
|
+
if (added.length > 0)
|
|
110
|
+
changes.push({ op: 'add', field: 'appliesWhen', after: added });
|
|
111
|
+
}
|
|
112
|
+
if (ops.removeAppliesWhen && ops.removeAppliesWhen.length > 0) {
|
|
113
|
+
const removed = next.appliesWhen.filter((t) => ops.removeAppliesWhen.includes(t));
|
|
114
|
+
next.appliesWhen = next.appliesWhen.filter((t) => !ops.removeAppliesWhen.includes(t));
|
|
115
|
+
if (removed.length > 0)
|
|
116
|
+
changes.push({ op: 'remove', field: 'appliesWhen', before: removed });
|
|
117
|
+
}
|
|
118
|
+
if (ops.addRelated && ops.addRelated.length > 0) {
|
|
119
|
+
const cur = next.related ? [...next.related] : [];
|
|
120
|
+
const set = new Set(cur);
|
|
121
|
+
const added = [];
|
|
122
|
+
for (const t of ops.addRelated)
|
|
123
|
+
if (!set.has(t)) {
|
|
124
|
+
set.add(t);
|
|
125
|
+
added.push(t);
|
|
126
|
+
}
|
|
127
|
+
next.related = [...set];
|
|
128
|
+
if (added.length > 0)
|
|
129
|
+
changes.push({ op: 'add', field: 'related', after: added });
|
|
130
|
+
}
|
|
131
|
+
if (ops.removeRelated && ops.removeRelated.length > 0) {
|
|
132
|
+
const cur = next.related ?? [];
|
|
133
|
+
const removed = cur.filter((t) => ops.removeRelated.includes(t));
|
|
134
|
+
next.related = cur.filter((t) => !ops.removeRelated.includes(t));
|
|
135
|
+
if (removed.length > 0)
|
|
136
|
+
changes.push({ op: 'remove', field: 'related', before: removed });
|
|
137
|
+
}
|
|
138
|
+
// metadata.* updates
|
|
139
|
+
const md = next.metadata ? { ...next.metadata } : {};
|
|
140
|
+
let mdTouched = false;
|
|
141
|
+
if (ops.addRequiredProfileIds && ops.addRequiredProfileIds.length > 0) {
|
|
142
|
+
const existing = md.requiredProfileIds ? [...md.requiredProfileIds] : [];
|
|
143
|
+
const set = new Set(existing);
|
|
144
|
+
const added = [];
|
|
145
|
+
for (const id of ops.addRequiredProfileIds) {
|
|
146
|
+
if (!set.has(id)) {
|
|
147
|
+
set.add(id);
|
|
148
|
+
added.push(id);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
md.requiredProfileIds = [...set];
|
|
152
|
+
if (added.length > 0) {
|
|
153
|
+
mdTouched = true;
|
|
154
|
+
changes.push({ op: 'add', field: 'metadata.requiredProfileIds', after: added });
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
if (ops.removeRequiredProfileIds && ops.removeRequiredProfileIds.length > 0) {
|
|
158
|
+
const existing = md.requiredProfileIds ?? [];
|
|
159
|
+
const removed = existing.filter((id) => ops.removeRequiredProfileIds.includes(id));
|
|
160
|
+
md.requiredProfileIds = existing.filter((id) => !ops.removeRequiredProfileIds.includes(id));
|
|
161
|
+
if (removed.length > 0) {
|
|
162
|
+
mdTouched = true;
|
|
163
|
+
changes.push({
|
|
164
|
+
op: 'remove',
|
|
165
|
+
field: 'metadata.requiredProfileIds',
|
|
166
|
+
before: removed,
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
if (ops.addForbiddenPathFragments && ops.addForbiddenPathFragments.length > 0) {
|
|
171
|
+
const existing = md.forbiddenPathFragments ? [...md.forbiddenPathFragments] : [];
|
|
172
|
+
const set = new Set(existing);
|
|
173
|
+
const added = [];
|
|
174
|
+
for (const f of ops.addForbiddenPathFragments) {
|
|
175
|
+
if (!set.has(f)) {
|
|
176
|
+
set.add(f);
|
|
177
|
+
added.push(f);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
md.forbiddenPathFragments = [...set];
|
|
181
|
+
if (added.length > 0) {
|
|
182
|
+
mdTouched = true;
|
|
183
|
+
changes.push({ op: 'add', field: 'metadata.forbiddenPathFragments', after: added });
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
if (ops.removeForbiddenPathFragments && ops.removeForbiddenPathFragments.length > 0) {
|
|
187
|
+
const existing = md.forbiddenPathFragments ?? [];
|
|
188
|
+
const removed = existing.filter((f) => ops.removeForbiddenPathFragments.includes(f));
|
|
189
|
+
md.forbiddenPathFragments = existing.filter((f) => !ops.removeForbiddenPathFragments.includes(f));
|
|
190
|
+
if (removed.length > 0) {
|
|
191
|
+
mdTouched = true;
|
|
192
|
+
changes.push({
|
|
193
|
+
op: 'remove',
|
|
194
|
+
field: 'metadata.forbiddenPathFragments',
|
|
195
|
+
before: removed,
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
if (mdTouched)
|
|
200
|
+
next.metadata = md;
|
|
201
|
+
if (ops.addPostGenerationNote) {
|
|
202
|
+
const cur = next.postGenerationNotes ? [...next.postGenerationNotes] : [];
|
|
203
|
+
cur.push(ops.addPostGenerationNote);
|
|
204
|
+
next.postGenerationNotes = cur;
|
|
205
|
+
changes.push({
|
|
206
|
+
op: 'add',
|
|
207
|
+
field: 'postGenerationNotes',
|
|
208
|
+
after: [ops.addPostGenerationNote],
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
return next;
|
|
212
|
+
}
|
|
213
|
+
function findReverseReferences(templateId, ctx) {
|
|
214
|
+
const out = [];
|
|
215
|
+
// Knowledge entries referencing this template via `references[kind=template]`.
|
|
216
|
+
for (const k of ctx.knowledgeEntries ?? []) {
|
|
217
|
+
for (const ref of k.references ?? []) {
|
|
218
|
+
if (ref.kind === 'template' && ref.id === templateId) {
|
|
219
|
+
out.push({
|
|
220
|
+
fromKind: 'knowledge',
|
|
221
|
+
fromId: k.id,
|
|
222
|
+
field: 'references[kind=template]',
|
|
223
|
+
...(ref.note ? { note: ref.note } : {}),
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
for (const rel of k.related ?? []) {
|
|
228
|
+
if (rel === templateId) {
|
|
229
|
+
out.push({ fromKind: 'knowledge', fromId: k.id, field: 'related' });
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
// Pipelines whose steps reference the template id.
|
|
234
|
+
for (const p of ctx.pipelines ?? []) {
|
|
235
|
+
for (const step of p.steps ?? []) {
|
|
236
|
+
for (const r of step.references ?? []) {
|
|
237
|
+
if (r === templateId) {
|
|
238
|
+
out.push({
|
|
239
|
+
fromKind: 'pipeline',
|
|
240
|
+
fromId: p.id,
|
|
241
|
+
field: `steps[${step.id}].references`,
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
// Presets that include this template.
|
|
248
|
+
for (const preset of ctx.presets ?? []) {
|
|
249
|
+
const templates = preset.templates;
|
|
250
|
+
if (templates) {
|
|
251
|
+
for (const t of templates) {
|
|
252
|
+
if (t.id === templateId) {
|
|
253
|
+
out.push({ fromKind: 'preset', fromId: preset.id, field: 'templates' });
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
const includes = preset.includes;
|
|
258
|
+
if (includes?.templateIds) {
|
|
259
|
+
for (const id of includes.templateIds) {
|
|
260
|
+
if (id === templateId) {
|
|
261
|
+
out.push({
|
|
262
|
+
fromKind: 'preset',
|
|
263
|
+
fromId: preset.id,
|
|
264
|
+
field: 'includes.templateIds',
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
// Pack ownership (informational — a pack-owned template requires editing the pack).
|
|
271
|
+
if (ctx.packTemplateIds && ctx.packTemplateIds.has(templateId)) {
|
|
272
|
+
out.push({
|
|
273
|
+
fromKind: 'pack',
|
|
274
|
+
fromId: ctx.packTemplateIds.get(templateId),
|
|
275
|
+
field: 'pack-contributed',
|
|
276
|
+
note: 'template is contributed by a pack — removal must happen in the pack source',
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
return out;
|
|
280
|
+
}
|
|
281
|
+
function buildUpdateDraftBody(next, opId) {
|
|
282
|
+
const constName = idToConst(next.id);
|
|
283
|
+
// We can't faithfully reproduce the `files` / `changes` / `targetPath` /
|
|
284
|
+
// `content` resolvers — they're typically functions. The draft shows the
|
|
285
|
+
// metadata fields only; the user merges them into the existing const.
|
|
286
|
+
const lines = [];
|
|
287
|
+
lines.push(`// Generated by \`shrk templates ${opId}\` (preview only — not yet written).`);
|
|
288
|
+
lines.push(`// Replace the EXISTING template literal for \`${next.id}\` in your`);
|
|
289
|
+
lines.push(`// templates source file with the metadata fields below.`);
|
|
290
|
+
lines.push(`// Runtime resolvers (\`files\` / \`changes\` / \`targetPath\` / \`content\`)`);
|
|
291
|
+
lines.push(`// are not represented here — keep your existing implementation.`);
|
|
292
|
+
lines.push('');
|
|
293
|
+
lines.push(`export const ${constName}: Partial<ITemplateDefinition> = {`);
|
|
294
|
+
lines.push(` id: ${JSON.stringify(next.id)},`);
|
|
295
|
+
lines.push(` name: ${JSON.stringify(next.name)},`);
|
|
296
|
+
lines.push(` description: ${JSON.stringify(next.description)},`);
|
|
297
|
+
lines.push(` tags: ${JSON.stringify(next.tags)},`);
|
|
298
|
+
lines.push(` scope: ${JSON.stringify(next.scope)},`);
|
|
299
|
+
lines.push(` appliesWhen: ${JSON.stringify(next.appliesWhen)},`);
|
|
300
|
+
if (next.related && next.related.length > 0) {
|
|
301
|
+
lines.push(` related: ${JSON.stringify(next.related)},`);
|
|
302
|
+
}
|
|
303
|
+
if (next.postGenerationNotes && next.postGenerationNotes.length > 0) {
|
|
304
|
+
lines.push(` postGenerationNotes: ${JSON.stringify(next.postGenerationNotes, null, 2).split('\n').join('\n ')},`);
|
|
305
|
+
}
|
|
306
|
+
if (next.metadata) {
|
|
307
|
+
lines.push(` metadata: ${JSON.stringify(next.metadata, null, 2).split('\n').join('\n ')},`);
|
|
308
|
+
}
|
|
309
|
+
lines.push(`};`);
|
|
310
|
+
lines.push('');
|
|
311
|
+
return lines.join('\n');
|
|
312
|
+
}
|
|
313
|
+
function buildRemovalNoticeBody(current) {
|
|
314
|
+
return (`# Template removal preview — ${current.id}\n` +
|
|
315
|
+
`\n` +
|
|
316
|
+
`To remove this template, delete the matching template literal from\n` +
|
|
317
|
+
`your templates source file. Look for the entry with:\n` +
|
|
318
|
+
`\n` +
|
|
319
|
+
` id: ${JSON.stringify(current.id)},\n` +
|
|
320
|
+
` name: ${JSON.stringify(current.name)},\n` +
|
|
321
|
+
`\n` +
|
|
322
|
+
`After removing, run \`shrk templates drift --min-severity warning\` and\n` +
|
|
323
|
+
`\`shrk self-config doctor\` to confirm nothing references the deleted id.\n`);
|
|
324
|
+
}
|
|
325
|
+
function buildExplainer(input, result) {
|
|
326
|
+
const lines = [];
|
|
327
|
+
lines.push(`# Template authoring preview — ${result.operation} ${result.templateId}`);
|
|
328
|
+
lines.push('');
|
|
329
|
+
if (!result.ok) {
|
|
330
|
+
lines.push(`> Refused: ${result.refusal ?? 'unknown reason'}.`);
|
|
331
|
+
lines.push('');
|
|
332
|
+
}
|
|
333
|
+
lines.push(`Generated: ${nowIso()}`);
|
|
334
|
+
lines.push('');
|
|
335
|
+
lines.push('## What this preview is');
|
|
336
|
+
lines.push('');
|
|
337
|
+
lines.push('Preview-only. Nothing was written to `sharkcraft/templates.ts` or to ' +
|
|
338
|
+
"any pack's `assets/templates.ts`. The draft on disk is for review only.");
|
|
339
|
+
lines.push('');
|
|
340
|
+
if (input.reason) {
|
|
341
|
+
lines.push('## Reason');
|
|
342
|
+
lines.push('');
|
|
343
|
+
lines.push(input.reason);
|
|
344
|
+
lines.push('');
|
|
345
|
+
}
|
|
346
|
+
if (result.reverseReferences && result.reverseReferences.length > 0) {
|
|
347
|
+
lines.push('## Reverse references');
|
|
348
|
+
lines.push('');
|
|
349
|
+
for (const r of result.reverseReferences) {
|
|
350
|
+
lines.push(`- **${r.fromKind}** \`${r.fromId}\` → \`${r.field}\`${r.note ? ` — ${r.note}` : ''}`);
|
|
351
|
+
}
|
|
352
|
+
lines.push('');
|
|
353
|
+
}
|
|
354
|
+
lines.push('## Next commands');
|
|
355
|
+
lines.push('');
|
|
356
|
+
for (const c of result.nextCommands)
|
|
357
|
+
lines.push(`- \`${c}\``);
|
|
358
|
+
lines.push('');
|
|
359
|
+
return lines.join('\n');
|
|
360
|
+
}
|
|
361
|
+
function nextCommandsForUpdate() {
|
|
362
|
+
return [
|
|
363
|
+
'# Replace the existing template literal with the metadata fields in the draft.',
|
|
364
|
+
'shrk templates drift --min-severity warning',
|
|
365
|
+
'shrk self-config doctor',
|
|
366
|
+
'shrk packs signature-status',
|
|
367
|
+
];
|
|
368
|
+
}
|
|
369
|
+
function nextCommandsForRemove() {
|
|
370
|
+
return [
|
|
371
|
+
'# Delete the template literal from the templates source file.',
|
|
372
|
+
'shrk templates drift --min-severity warning',
|
|
373
|
+
'shrk self-config doctor',
|
|
374
|
+
'shrk packs signature-status',
|
|
375
|
+
];
|
|
376
|
+
}
|
|
377
|
+
function emptyDraftFile(id, op, language) {
|
|
378
|
+
const slug = fileSafeId(id);
|
|
379
|
+
const ext = language === 'typescript' ? 'draft.ts' : 'md';
|
|
380
|
+
return {
|
|
381
|
+
path: `.sharkcraft/authoring/templates/template-${op}-${slug}.${ext}`,
|
|
382
|
+
body: '',
|
|
383
|
+
language,
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
export function buildTemplateAuthoringPreview(input, context) {
|
|
387
|
+
const warnings = [];
|
|
388
|
+
const existing = context.templates.find((t) => t.id === input.id);
|
|
389
|
+
const slug = fileSafeId(input.id);
|
|
390
|
+
if (!existing) {
|
|
391
|
+
const refused = {
|
|
392
|
+
schema: TEMPLATE_AUTHORING_SCHEMA,
|
|
393
|
+
generatedAt: nowIso(),
|
|
394
|
+
operation: input.operation,
|
|
395
|
+
templateId: input.id,
|
|
396
|
+
ok: false,
|
|
397
|
+
refusal: input.operation === TemplateAuthoringOperation.Update
|
|
398
|
+
? `No template with id "${input.id}" exists. Use \`shrk templates scaffold --id ${input.id}\` to create a new one.`
|
|
399
|
+
: `No template with id "${input.id}" exists — nothing to remove.`,
|
|
400
|
+
tsDraft: emptyDraftFile(input.id, input.operation, 'typescript'),
|
|
401
|
+
explainer: emptyDraftFile(input.id, input.operation, 'markdown'),
|
|
402
|
+
warnings,
|
|
403
|
+
nextCommands: input.operation === TemplateAuthoringOperation.Update
|
|
404
|
+
? [`shrk templates scaffold --id ${input.id}`]
|
|
405
|
+
: [],
|
|
406
|
+
};
|
|
407
|
+
refused.tsDraft = {
|
|
408
|
+
path: `.sharkcraft/authoring/templates/template-${input.operation}-${slug}.draft.ts`,
|
|
409
|
+
body: `// Refused — template "${input.id}" does not exist.\n`,
|
|
410
|
+
language: 'typescript',
|
|
411
|
+
};
|
|
412
|
+
refused.explainer = {
|
|
413
|
+
path: `.sharkcraft/authoring/templates/template-${input.operation}-${slug}.md`,
|
|
414
|
+
body: buildExplainer(input, refused),
|
|
415
|
+
language: 'markdown',
|
|
416
|
+
};
|
|
417
|
+
return refused;
|
|
418
|
+
}
|
|
419
|
+
switch (input.operation) {
|
|
420
|
+
case TemplateAuthoringOperation.Update: {
|
|
421
|
+
const changes = [];
|
|
422
|
+
const next = applyTemplateUpdateOps(existing, input.updateOps ?? {}, changes);
|
|
423
|
+
if (changes.length === 0) {
|
|
424
|
+
warnings.push('No update ops produced changes. Preview will mirror the current metadata.');
|
|
425
|
+
}
|
|
426
|
+
const result = {
|
|
427
|
+
schema: TEMPLATE_AUTHORING_SCHEMA,
|
|
428
|
+
generatedAt: nowIso(),
|
|
429
|
+
operation: input.operation,
|
|
430
|
+
templateId: input.id,
|
|
431
|
+
ok: true,
|
|
432
|
+
tsDraft: {
|
|
433
|
+
path: `.sharkcraft/authoring/templates/template-update-${slug}.draft.ts`,
|
|
434
|
+
body: buildUpdateDraftBody(next, 'update'),
|
|
435
|
+
language: 'typescript',
|
|
436
|
+
},
|
|
437
|
+
explainer: emptyDraftFile(input.id, input.operation, 'markdown'),
|
|
438
|
+
warnings,
|
|
439
|
+
nextCommands: nextCommandsForUpdate(),
|
|
440
|
+
current: existing,
|
|
441
|
+
next,
|
|
442
|
+
patch: {
|
|
443
|
+
schema: 'sharkcraft.template-authoring-patch/v1',
|
|
444
|
+
operation: input.operation,
|
|
445
|
+
templateId: input.id,
|
|
446
|
+
changes,
|
|
447
|
+
},
|
|
448
|
+
};
|
|
449
|
+
result.explainer = {
|
|
450
|
+
path: `.sharkcraft/authoring/templates/template-update-${slug}.md`,
|
|
451
|
+
body: buildExplainer(input, result),
|
|
452
|
+
language: 'markdown',
|
|
453
|
+
};
|
|
454
|
+
return result;
|
|
455
|
+
}
|
|
456
|
+
case TemplateAuthoringOperation.Remove: {
|
|
457
|
+
const reverseReferences = findReverseReferences(input.id, context);
|
|
458
|
+
if (reverseReferences.length > 0 && !input.forcePreview) {
|
|
459
|
+
const refused = {
|
|
460
|
+
schema: TEMPLATE_AUTHORING_SCHEMA,
|
|
461
|
+
generatedAt: nowIso(),
|
|
462
|
+
operation: input.operation,
|
|
463
|
+
templateId: input.id,
|
|
464
|
+
ok: false,
|
|
465
|
+
refusal: `Refused: ${reverseReferences.length} reference(s) point at "${input.id}". Pass --force-preview to preview removal anyway, or update those references first.`,
|
|
466
|
+
tsDraft: emptyDraftFile(input.id, input.operation, 'typescript'),
|
|
467
|
+
explainer: emptyDraftFile(input.id, input.operation, 'markdown'),
|
|
468
|
+
warnings,
|
|
469
|
+
reverseReferences,
|
|
470
|
+
current: existing,
|
|
471
|
+
nextCommands: [
|
|
472
|
+
`# Update each reference to a different template, then re-run.`,
|
|
473
|
+
`shrk templates remove ${input.id} --force-preview --reason "<why>"`,
|
|
474
|
+
],
|
|
475
|
+
};
|
|
476
|
+
refused.tsDraft = {
|
|
477
|
+
path: `.sharkcraft/authoring/templates/template-remove-${slug}.draft.ts`,
|
|
478
|
+
body: `// Refused — ${reverseReferences.length} reverse reference(s).\n`,
|
|
479
|
+
language: 'typescript',
|
|
480
|
+
};
|
|
481
|
+
refused.explainer = {
|
|
482
|
+
path: `.sharkcraft/authoring/templates/template-remove-${slug}.md`,
|
|
483
|
+
body: buildExplainer(input, refused),
|
|
484
|
+
language: 'markdown',
|
|
485
|
+
};
|
|
486
|
+
return refused;
|
|
487
|
+
}
|
|
488
|
+
const result = {
|
|
489
|
+
schema: TEMPLATE_AUTHORING_SCHEMA,
|
|
490
|
+
generatedAt: nowIso(),
|
|
491
|
+
operation: input.operation,
|
|
492
|
+
templateId: input.id,
|
|
493
|
+
ok: true,
|
|
494
|
+
tsDraft: {
|
|
495
|
+
path: `.sharkcraft/authoring/templates/template-remove-${slug}.draft.ts`,
|
|
496
|
+
body: `// Template removal notice for ${existing.id} — see .md file for details.\n`,
|
|
497
|
+
language: 'typescript',
|
|
498
|
+
},
|
|
499
|
+
explainer: emptyDraftFile(input.id, input.operation, 'markdown'),
|
|
500
|
+
warnings,
|
|
501
|
+
reverseReferences,
|
|
502
|
+
current: existing,
|
|
503
|
+
patch: {
|
|
504
|
+
schema: 'sharkcraft.template-authoring-patch/v1',
|
|
505
|
+
operation: input.operation,
|
|
506
|
+
templateId: input.id,
|
|
507
|
+
changes: [{ op: 'remove', field: '*', before: { id: existing.id, name: existing.name } }],
|
|
508
|
+
},
|
|
509
|
+
nextCommands: nextCommandsForRemove(),
|
|
510
|
+
};
|
|
511
|
+
const removalBody = buildRemovalNoticeBody(existing) + '\n' +
|
|
512
|
+
buildExplainer(input, result);
|
|
513
|
+
result.explainer = {
|
|
514
|
+
path: `.sharkcraft/authoring/templates/template-remove-${slug}.md`,
|
|
515
|
+
body: removalBody,
|
|
516
|
+
language: 'markdown',
|
|
517
|
+
};
|
|
518
|
+
return result;
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { IInferTemplateBodyOptions, IInferredTemplateScaffold } from './template-body-inference.js';
|
|
2
|
+
export type TemplateInferenceProvenance = 'ast' | 'lightweight' | 'regex';
|
|
3
|
+
export interface IInferredTemplateScaffoldV2 extends IInferredTemplateScaffold {
|
|
4
|
+
provenance: TemplateInferenceProvenance;
|
|
5
|
+
confidenceReasons: readonly string[];
|
|
6
|
+
/** Decorators detected on the primary class (TS API only). */
|
|
7
|
+
decorators: readonly string[];
|
|
8
|
+
/** JSDoc on the primary class/function (best-effort). */
|
|
9
|
+
jsdoc?: string;
|
|
10
|
+
/** Public method signatures (TS API only). */
|
|
11
|
+
publicMethods: readonly string[];
|
|
12
|
+
}
|
|
13
|
+
export interface IInferTemplateBodyV2Result {
|
|
14
|
+
scaffold: IInferredTemplateScaffoldV2 | null;
|
|
15
|
+
reason?: string;
|
|
16
|
+
provenance: TemplateInferenceProvenance | 'skipped';
|
|
17
|
+
}
|
|
18
|
+
export declare function inferTemplateBodyV2(options: IInferTemplateBodyOptions): Promise<IInferTemplateBodyV2Result>;
|
|
19
|
+
//# sourceMappingURL=template-body-inference-v2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template-body-inference-v2.d.ts","sourceRoot":"","sources":["../src/template-body-inference-v2.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EACV,yBAAyB,EAEzB,yBAAyB,EAC1B,MAAM,8BAA8B,CAAC;AAEtC,MAAM,MAAM,2BAA2B,GAAG,KAAK,GAAG,aAAa,GAAG,OAAO,CAAC;AAE1E,MAAM,WAAW,2BAA4B,SAAQ,yBAAyB;IAC5E,UAAU,EAAE,2BAA2B,CAAC;IACxC,iBAAiB,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,8DAA8D;IAC9D,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9B,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8CAA8C;IAC9C,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,EAAE,2BAA2B,GAAG,IAAI,CAAC;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,2BAA2B,GAAG,SAAS,CAAC;CACrD;AAgBD,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,0BAA0B,CAAC,CAwFrC"}
|