@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,254 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Merge preview for the adoption patch. Read-only. Produces text/markdown/html/
|
|
3
|
+
* json renderings showing exactly what the user would need to merge manually.
|
|
4
|
+
*/
|
|
5
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
6
|
+
import * as nodePath from 'node:path';
|
|
7
|
+
import { AdoptionCategory, } from "./onboarding-adoption.js";
|
|
8
|
+
import { computeAdoptionFreshness, readAdoptionState, } from "./adoption-state.js";
|
|
9
|
+
import { previewThreeWayBatch, ThreeWayVerdict, } from "./adoption-three-way.js";
|
|
10
|
+
export function buildAdoptionMergePreview(input) {
|
|
11
|
+
const state = readAdoptionState(input.projectRoot);
|
|
12
|
+
const freshness = computeAdoptionFreshness(input.projectRoot, state);
|
|
13
|
+
const threeWay = state
|
|
14
|
+
? previewThreeWayBatch(input.projectRoot, state.targetFiles, {
|
|
15
|
+
draftsChanged: freshness.changedDrafts.length > 0,
|
|
16
|
+
})
|
|
17
|
+
: { perTarget: [], summary: emptySummary() };
|
|
18
|
+
const recommended = recommendCommands(freshness, threeWay, state);
|
|
19
|
+
return {
|
|
20
|
+
schema: 'sharkcraft.adoption-merge-preview/v1',
|
|
21
|
+
projectRoot: input.projectRoot,
|
|
22
|
+
state,
|
|
23
|
+
freshness,
|
|
24
|
+
threeWay,
|
|
25
|
+
safeAppend: input.plan.byCategory[AdoptionCategory.SafeToAdopt],
|
|
26
|
+
manualReview: input.plan.byCategory[AdoptionCategory.ManualReview],
|
|
27
|
+
lowConfidence: input.plan.byCategory[AdoptionCategory.LowConfidence],
|
|
28
|
+
alreadyCovered: input.plan.byCategory[AdoptionCategory.AlreadyCovered],
|
|
29
|
+
conflicts: input.plan.byCategory[AdoptionCategory.Conflict],
|
|
30
|
+
recommendedCommands: recommended,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function emptySummary() {
|
|
34
|
+
return {
|
|
35
|
+
[ThreeWayVerdict.Safe]: 0,
|
|
36
|
+
[ThreeWayVerdict.ProbablySafe]: 0,
|
|
37
|
+
[ThreeWayVerdict.StaleTarget]: 0,
|
|
38
|
+
[ThreeWayVerdict.StaleDraft]: 0,
|
|
39
|
+
[ThreeWayVerdict.ManualReview]: 0,
|
|
40
|
+
[ThreeWayVerdict.CreateFileSafe]: 0,
|
|
41
|
+
[ThreeWayVerdict.Conflict]: 0,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function recommendCommands(freshness, threeWay, state) {
|
|
45
|
+
if (!state) {
|
|
46
|
+
return [
|
|
47
|
+
'shrk onboard --write-drafts',
|
|
48
|
+
'shrk onboard adopt --write-patch --diff-format unified',
|
|
49
|
+
];
|
|
50
|
+
}
|
|
51
|
+
if (freshness.status !== 'fresh' ||
|
|
52
|
+
threeWay.summary[ThreeWayVerdict.StaleTarget] > 0 ||
|
|
53
|
+
threeWay.summary[ThreeWayVerdict.StaleDraft] > 0) {
|
|
54
|
+
return [
|
|
55
|
+
'shrk onboard adopt regenerate',
|
|
56
|
+
'shrk onboard adopt status',
|
|
57
|
+
];
|
|
58
|
+
}
|
|
59
|
+
return [
|
|
60
|
+
'shrk onboard adopt review',
|
|
61
|
+
'shrk onboard adopt check',
|
|
62
|
+
`git apply ${nodePath.posix.join('sharkcraft', 'onboarding', 'adoption', 'adopt.patch')}`,
|
|
63
|
+
];
|
|
64
|
+
}
|
|
65
|
+
// ─── Renderers ────────────────────────────────────────────────────────────────
|
|
66
|
+
export function renderAdoptionMergePreviewText(p) {
|
|
67
|
+
const out = [];
|
|
68
|
+
out.push('=== Onboarding adoption — merge preview ===');
|
|
69
|
+
if (!p.state) {
|
|
70
|
+
out.push('No adoption-state.json on disk.');
|
|
71
|
+
out.push('Run: shrk onboard adopt --write-patch');
|
|
72
|
+
return out.join('\n') + '\n';
|
|
73
|
+
}
|
|
74
|
+
out.push(` patch ${p.state.patchPath}`);
|
|
75
|
+
out.push(` format ${p.state.diffFormat}`);
|
|
76
|
+
out.push(` freshness ${p.freshness.status}`);
|
|
77
|
+
if (p.freshness.staleReasons.length > 0) {
|
|
78
|
+
out.push(' stale reasons:');
|
|
79
|
+
for (const r of p.freshness.staleReasons)
|
|
80
|
+
out.push(` - ${r}`);
|
|
81
|
+
}
|
|
82
|
+
out.push('');
|
|
83
|
+
out.push('Three-way verdicts:');
|
|
84
|
+
for (const tw of p.threeWay.perTarget) {
|
|
85
|
+
out.push(` ${tw.verdict.padEnd(18)} ${tw.relativePath}`);
|
|
86
|
+
for (const r of tw.reasons)
|
|
87
|
+
out.push(` ${r}`);
|
|
88
|
+
}
|
|
89
|
+
out.push('');
|
|
90
|
+
out.push(`Safe append blocks ${p.safeAppend.length}`);
|
|
91
|
+
out.push(`Manual review items ${p.manualReview.length}`);
|
|
92
|
+
out.push(`Low-confidence items ${p.lowConfidence.length}`);
|
|
93
|
+
out.push(`Already covered ${p.alreadyCovered.length}`);
|
|
94
|
+
out.push(`Conflicts ${p.conflicts.length}`);
|
|
95
|
+
out.push('');
|
|
96
|
+
out.push('Recommended commands:');
|
|
97
|
+
for (const c of p.recommendedCommands)
|
|
98
|
+
out.push(` $ ${c}`);
|
|
99
|
+
return out.join('\n') + '\n';
|
|
100
|
+
}
|
|
101
|
+
export function renderAdoptionMergePreviewMarkdown(p) {
|
|
102
|
+
const out = [];
|
|
103
|
+
out.push('# SharkCraft onboarding — merge preview');
|
|
104
|
+
out.push('');
|
|
105
|
+
if (!p.state) {
|
|
106
|
+
out.push('_No adoption state on disk._');
|
|
107
|
+
out.push('');
|
|
108
|
+
out.push('```');
|
|
109
|
+
out.push('shrk onboard --write-drafts');
|
|
110
|
+
out.push('shrk onboard adopt --write-patch');
|
|
111
|
+
out.push('```');
|
|
112
|
+
return out.join('\n') + '\n';
|
|
113
|
+
}
|
|
114
|
+
out.push(`- **Patch**: \`${p.state.patchPath}\``);
|
|
115
|
+
out.push(`- **Format**: \`${p.state.diffFormat}\``);
|
|
116
|
+
out.push(`- **Freshness**: \`${p.freshness.status}\``);
|
|
117
|
+
if (p.freshness.staleReasons.length > 0) {
|
|
118
|
+
out.push(' - Stale reasons:');
|
|
119
|
+
for (const r of p.freshness.staleReasons)
|
|
120
|
+
out.push(` - ${r}`);
|
|
121
|
+
}
|
|
122
|
+
out.push('');
|
|
123
|
+
out.push('## Three-way verdicts per target');
|
|
124
|
+
out.push('');
|
|
125
|
+
out.push('| Target | Verdict | Notes |');
|
|
126
|
+
out.push('|---|---|---|');
|
|
127
|
+
for (const tw of p.threeWay.perTarget) {
|
|
128
|
+
const notes = tw.reasons.join('; ').replace(/\|/g, '\\|');
|
|
129
|
+
out.push(`| \`${tw.relativePath}\` | \`${tw.verdict}\` | ${notes} |`);
|
|
130
|
+
}
|
|
131
|
+
out.push('');
|
|
132
|
+
out.push('## Items by category');
|
|
133
|
+
out.push('');
|
|
134
|
+
renderCategoryMd(out, 'Safe to append', p.safeAppend);
|
|
135
|
+
renderCategoryMd(out, 'Manual review', p.manualReview);
|
|
136
|
+
renderCategoryMd(out, 'Low-confidence', p.lowConfidence);
|
|
137
|
+
renderCategoryMd(out, 'Already covered', p.alreadyCovered);
|
|
138
|
+
renderCategoryMd(out, 'Conflicts', p.conflicts);
|
|
139
|
+
out.push('');
|
|
140
|
+
out.push('## Recommended commands');
|
|
141
|
+
out.push('');
|
|
142
|
+
out.push('```');
|
|
143
|
+
for (const c of p.recommendedCommands)
|
|
144
|
+
out.push(c);
|
|
145
|
+
out.push('```');
|
|
146
|
+
return out.join('\n') + '\n';
|
|
147
|
+
}
|
|
148
|
+
function renderCategoryMd(out, title, items) {
|
|
149
|
+
if (items.length === 0)
|
|
150
|
+
return;
|
|
151
|
+
out.push(`### ${title} (${items.length})`);
|
|
152
|
+
for (const it of items) {
|
|
153
|
+
out.push(`- **${it.kind}** \`${it.id}\` — ${it.title}`);
|
|
154
|
+
out.push(` - reason: ${it.reason}`);
|
|
155
|
+
}
|
|
156
|
+
out.push('');
|
|
157
|
+
}
|
|
158
|
+
function escapeHtml(s) {
|
|
159
|
+
return s
|
|
160
|
+
.replace(/&/g, '&')
|
|
161
|
+
.replace(/</g, '<')
|
|
162
|
+
.replace(/>/g, '>')
|
|
163
|
+
.replace(/"/g, '"')
|
|
164
|
+
.replace(/'/g, ''');
|
|
165
|
+
}
|
|
166
|
+
const HTML_BASE_CSS = `
|
|
167
|
+
*{box-sizing:border-box}body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;margin:0;background:#0f1419;color:#e6e1cf;padding:2rem;line-height:1.55}
|
|
168
|
+
h1,h2,h3{margin-top:1.4rem;color:#bae67e}
|
|
169
|
+
table{border-collapse:collapse;width:100%;margin:.8rem 0}
|
|
170
|
+
th,td{text-align:left;padding:.4rem .6rem;border-bottom:1px solid #2a3138}
|
|
171
|
+
th{background:#1c2329;color:#9aa5b0}
|
|
172
|
+
.badge{display:inline-block;padding:.1rem .5rem;border-radius:.25rem;font-size:.75rem;font-weight:600;text-transform:uppercase}
|
|
173
|
+
.b-safe{background:#28432e;color:#bae67e}.b-probably{background:#3a3a2e;color:#ffd580}.b-stale{background:#4a2e2e;color:#ff7f7f}
|
|
174
|
+
.b-manual{background:#2e3a4a;color:#7fd0ff}.b-create{background:#28433f;color:#7fe6cf}.b-conflict{background:#5a1f1f;color:#ff9f9f}
|
|
175
|
+
pre{background:#1c2329;padding:.8rem;border-radius:.4rem;overflow-x:auto}
|
|
176
|
+
code{background:#1c2329;padding:.05rem .3rem;border-radius:.2rem}
|
|
177
|
+
.note{padding:.6rem .8rem;background:#1c2329;border-left:3px solid #bae67e;border-radius:.2rem;margin:.6rem 0}
|
|
178
|
+
@media (prefers-color-scheme: light){body{background:#fafaf7;color:#1f2329}h1,h2,h3{color:#266a2e}th{background:#eee;color:#222}pre,code{background:#eee}.note{background:#eee;border-left-color:#266a2e}}
|
|
179
|
+
`;
|
|
180
|
+
const VERDICT_CSS = {
|
|
181
|
+
[ThreeWayVerdict.Safe]: 'b-safe',
|
|
182
|
+
[ThreeWayVerdict.ProbablySafe]: 'b-probably',
|
|
183
|
+
[ThreeWayVerdict.StaleTarget]: 'b-stale',
|
|
184
|
+
[ThreeWayVerdict.StaleDraft]: 'b-stale',
|
|
185
|
+
[ThreeWayVerdict.ManualReview]: 'b-manual',
|
|
186
|
+
[ThreeWayVerdict.CreateFileSafe]: 'b-create',
|
|
187
|
+
[ThreeWayVerdict.Conflict]: 'b-conflict',
|
|
188
|
+
};
|
|
189
|
+
export function renderAdoptionMergePreviewHtml(p) {
|
|
190
|
+
const out = [];
|
|
191
|
+
out.push('<!doctype html>');
|
|
192
|
+
out.push('<html lang="en"><head><meta charset="utf-8"><title>SharkCraft adoption — merge preview</title>');
|
|
193
|
+
out.push(`<style>${HTML_BASE_CSS}</style></head><body>`);
|
|
194
|
+
out.push('<h1>SharkCraft onboarding — merge preview</h1>');
|
|
195
|
+
if (!p.state) {
|
|
196
|
+
out.push('<p class="note">No adoption state on disk.</p>');
|
|
197
|
+
out.push('<pre><code>shrk onboard --write-drafts\nshrk onboard adopt --write-patch</code></pre>');
|
|
198
|
+
out.push('</body></html>');
|
|
199
|
+
return out.join('\n') + '\n';
|
|
200
|
+
}
|
|
201
|
+
out.push('<h2>Patch metadata</h2>');
|
|
202
|
+
out.push('<table>');
|
|
203
|
+
out.push(`<tr><th>Patch</th><td><code>${escapeHtml(p.state.patchPath)}</code></td></tr>`);
|
|
204
|
+
out.push(`<tr><th>Format</th><td><code>${escapeHtml(p.state.diffFormat)}</code></td></tr>`);
|
|
205
|
+
out.push(`<tr><th>Freshness</th><td><span class="badge ${p.freshness.status === 'fresh' ? 'b-safe' : 'b-stale'}">${escapeHtml(p.freshness.status)}</span></td></tr>`);
|
|
206
|
+
out.push('</table>');
|
|
207
|
+
if (p.freshness.staleReasons.length > 0) {
|
|
208
|
+
out.push('<p class="note"><strong>Stale reasons:</strong></p><ul>');
|
|
209
|
+
for (const r of p.freshness.staleReasons)
|
|
210
|
+
out.push(`<li>${escapeHtml(r)}</li>`);
|
|
211
|
+
out.push('</ul>');
|
|
212
|
+
}
|
|
213
|
+
out.push('<h2>Three-way verdicts per target</h2>');
|
|
214
|
+
out.push('<table><thead><tr><th>Target</th><th>Verdict</th><th>Notes</th></tr></thead><tbody>');
|
|
215
|
+
for (const tw of p.threeWay.perTarget) {
|
|
216
|
+
const cls = VERDICT_CSS[tw.verdict];
|
|
217
|
+
out.push(`<tr><td><code>${escapeHtml(tw.relativePath)}</code></td>` +
|
|
218
|
+
`<td><span class="badge ${cls}">${escapeHtml(tw.verdict)}</span></td>` +
|
|
219
|
+
`<td>${tw.reasons.map(escapeHtml).join('<br>')}</td></tr>`);
|
|
220
|
+
}
|
|
221
|
+
out.push('</tbody></table>');
|
|
222
|
+
renderCategoryHtml(out, 'Safe to append', p.safeAppend);
|
|
223
|
+
renderCategoryHtml(out, 'Manual review', p.manualReview);
|
|
224
|
+
renderCategoryHtml(out, 'Low-confidence', p.lowConfidence);
|
|
225
|
+
renderCategoryHtml(out, 'Already covered', p.alreadyCovered);
|
|
226
|
+
renderCategoryHtml(out, 'Conflicts', p.conflicts);
|
|
227
|
+
out.push('<h2>Recommended commands</h2>');
|
|
228
|
+
out.push('<pre>');
|
|
229
|
+
for (const c of p.recommendedCommands)
|
|
230
|
+
out.push(escapeHtml(c));
|
|
231
|
+
out.push('</pre>');
|
|
232
|
+
out.push('</body></html>');
|
|
233
|
+
return out.join('\n') + '\n';
|
|
234
|
+
}
|
|
235
|
+
function renderCategoryHtml(out, title, items) {
|
|
236
|
+
if (items.length === 0)
|
|
237
|
+
return;
|
|
238
|
+
out.push(`<h2>${escapeHtml(title)} (${items.length})</h2>`);
|
|
239
|
+
out.push('<table><thead><tr><th>Kind</th><th>Id</th><th>Title</th><th>Reason</th></tr></thead><tbody>');
|
|
240
|
+
for (const it of items) {
|
|
241
|
+
out.push(`<tr><td><code>${escapeHtml(it.kind)}</code></td>` +
|
|
242
|
+
`<td><code>${escapeHtml(it.id)}</code></td>` +
|
|
243
|
+
`<td>${escapeHtml(it.title)}</td>` +
|
|
244
|
+
`<td>${escapeHtml(it.reason)}</td></tr>`);
|
|
245
|
+
}
|
|
246
|
+
out.push('</tbody></table>');
|
|
247
|
+
}
|
|
248
|
+
/** Reusable: read the unified patch body if it exists. */
|
|
249
|
+
export function loadAdoptPatchBody(projectRoot) {
|
|
250
|
+
const p = nodePath.join(projectRoot, 'sharkcraft', 'onboarding', 'adoption', 'adopt.patch');
|
|
251
|
+
if (!existsSync(p))
|
|
252
|
+
return null;
|
|
253
|
+
return readFileSync(p, 'utf8');
|
|
254
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adoption report renderers — text / markdown / html / json.
|
|
3
|
+
*
|
|
4
|
+
* Built from the adoption plan + (optionally) adoption state. Self-contained
|
|
5
|
+
* HTML output (no external assets, no JS, dark-mode aware). Never writes
|
|
6
|
+
* outside the adoption directory.
|
|
7
|
+
*/
|
|
8
|
+
import { type IAdoptionPlan } from './onboarding-adoption.js';
|
|
9
|
+
import { type IAdoptionState, type IComputeFreshnessResult } from './adoption-state.js';
|
|
10
|
+
import { type IThreeWayPreviewBatchResult } from './adoption-three-way.js';
|
|
11
|
+
export type AdoptionReportFormat = 'text' | 'markdown' | 'html' | 'json';
|
|
12
|
+
export interface IAdoptionReport {
|
|
13
|
+
schema: 'sharkcraft.adoption-report/v1';
|
|
14
|
+
projectRoot: string;
|
|
15
|
+
generatedAt: string;
|
|
16
|
+
state: IAdoptionState | null;
|
|
17
|
+
freshness: IComputeFreshnessResult;
|
|
18
|
+
threeWay: IThreeWayPreviewBatchResult;
|
|
19
|
+
plan: IAdoptionPlan;
|
|
20
|
+
recommendedCommands: readonly string[];
|
|
21
|
+
safetyNotes: readonly string[];
|
|
22
|
+
}
|
|
23
|
+
export interface IBuildAdoptionReportInput {
|
|
24
|
+
projectRoot: string;
|
|
25
|
+
plan: IAdoptionPlan;
|
|
26
|
+
state: IAdoptionState | null;
|
|
27
|
+
}
|
|
28
|
+
export declare function buildAdoptionReport(input: IBuildAdoptionReportInput): IAdoptionReport;
|
|
29
|
+
export declare function renderAdoptionReportText(r: IAdoptionReport): string;
|
|
30
|
+
export declare function renderAdoptionReportMarkdown(r: IAdoptionReport): string;
|
|
31
|
+
export declare function renderAdoptionReportHtml(r: IAdoptionReport): string;
|
|
32
|
+
export declare function renderAdoptionReportJson(r: IAdoptionReport): string;
|
|
33
|
+
//# sourceMappingURL=adoption-report-renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adoption-report-renderer.d.ts","sourceRoot":"","sources":["../src/adoption-report-renderer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,uBAAuB,EAC7B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAGL,KAAK,2BAA2B,EACjC,MAAM,yBAAyB,CAAC;AAEjC,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;AAEzE,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,+BAA+B,CAAC;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,cAAc,GAAG,IAAI,CAAC;IAC7B,SAAS,EAAE,uBAAuB,CAAC;IACnC,QAAQ,EAAE,2BAA2B,CAAC;IACtC,IAAI,EAAE,aAAa,CAAC;IACpB,mBAAmB,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,yBAAyB;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,aAAa,CAAC;IACpB,KAAK,EAAE,cAAc,GAAG,IAAI,CAAC;CAC9B;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,yBAAyB,GAAG,eAAe,CAsBrF;AAqCD,wBAAgB,wBAAwB,CAAC,CAAC,EAAE,eAAe,GAAG,MAAM,CA+BnE;AAED,wBAAgB,4BAA4B,CAAC,CAAC,EAAE,eAAe,GAAG,MAAM,CAgDvE;AA+CD,wBAAgB,wBAAwB,CAAC,CAAC,EAAE,eAAe,GAAG,MAAM,CAwDnE;AAiBD,wBAAgB,wBAAwB,CAAC,CAAC,EAAE,eAAe,GAAG,MAAM,CAEnE"}
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adoption report renderers — text / markdown / html / json.
|
|
3
|
+
*
|
|
4
|
+
* Built from the adoption plan + (optionally) adoption state. Self-contained
|
|
5
|
+
* HTML output (no external assets, no JS, dark-mode aware). Never writes
|
|
6
|
+
* outside the adoption directory.
|
|
7
|
+
*/
|
|
8
|
+
import { AdoptionCategory, } from "./onboarding-adoption.js";
|
|
9
|
+
import { computeAdoptionFreshness, } from "./adoption-state.js";
|
|
10
|
+
import { previewThreeWayBatch, ThreeWayVerdict, } from "./adoption-three-way.js";
|
|
11
|
+
export function buildAdoptionReport(input) {
|
|
12
|
+
const freshness = computeAdoptionFreshness(input.projectRoot, input.state);
|
|
13
|
+
const threeWay = input.state
|
|
14
|
+
? previewThreeWayBatch(input.projectRoot, input.state.targetFiles, {
|
|
15
|
+
draftsChanged: freshness.changedDrafts.length > 0,
|
|
16
|
+
})
|
|
17
|
+
: { perTarget: [], summary: emptyVerdictSummary() };
|
|
18
|
+
return {
|
|
19
|
+
schema: 'sharkcraft.adoption-report/v1',
|
|
20
|
+
projectRoot: input.projectRoot,
|
|
21
|
+
generatedAt: new Date().toISOString(),
|
|
22
|
+
state: input.state,
|
|
23
|
+
freshness,
|
|
24
|
+
threeWay,
|
|
25
|
+
plan: input.plan,
|
|
26
|
+
recommendedCommands: buildRecommended(input.state, freshness),
|
|
27
|
+
safetyNotes: [
|
|
28
|
+
'MCP never writes — adoption outputs are always written by the CLI.',
|
|
29
|
+
'The user must review the patch before applying. `git apply --check` is recommended.',
|
|
30
|
+
'Adoption only appends to existing files. It never overwrites existing entries.',
|
|
31
|
+
],
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function emptyVerdictSummary() {
|
|
35
|
+
return {
|
|
36
|
+
[ThreeWayVerdict.Safe]: 0,
|
|
37
|
+
[ThreeWayVerdict.ProbablySafe]: 0,
|
|
38
|
+
[ThreeWayVerdict.StaleTarget]: 0,
|
|
39
|
+
[ThreeWayVerdict.StaleDraft]: 0,
|
|
40
|
+
[ThreeWayVerdict.ManualReview]: 0,
|
|
41
|
+
[ThreeWayVerdict.CreateFileSafe]: 0,
|
|
42
|
+
[ThreeWayVerdict.Conflict]: 0,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function buildRecommended(state, freshness) {
|
|
46
|
+
if (!state) {
|
|
47
|
+
return [
|
|
48
|
+
'shrk onboard --write-drafts',
|
|
49
|
+
'shrk onboard adopt --write-patch --diff-format unified',
|
|
50
|
+
'shrk onboard adopt report --format html --output /tmp/adoption.html',
|
|
51
|
+
];
|
|
52
|
+
}
|
|
53
|
+
if (freshness.status !== 'fresh') {
|
|
54
|
+
return ['shrk onboard adopt regenerate', 'shrk onboard adopt status'];
|
|
55
|
+
}
|
|
56
|
+
return [
|
|
57
|
+
'shrk onboard adopt check',
|
|
58
|
+
'shrk onboard adopt merge-preview --format markdown',
|
|
59
|
+
`git apply ${state.patchPath}`,
|
|
60
|
+
];
|
|
61
|
+
}
|
|
62
|
+
// ─── Renderers ────────────────────────────────────────────────────────────────
|
|
63
|
+
export function renderAdoptionReportText(r) {
|
|
64
|
+
const out = [];
|
|
65
|
+
out.push('=== Onboarding adoption — report ===');
|
|
66
|
+
out.push(` generated ${r.generatedAt}`);
|
|
67
|
+
if (r.state) {
|
|
68
|
+
out.push(` patch ${r.state.patchPath}`);
|
|
69
|
+
out.push(` format ${r.state.diffFormat}`);
|
|
70
|
+
out.push(` freshness ${r.freshness.status}`);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
out.push(' state (none on disk)');
|
|
74
|
+
}
|
|
75
|
+
out.push('');
|
|
76
|
+
out.push('## Categories');
|
|
77
|
+
for (const cat of Object.values(AdoptionCategory)) {
|
|
78
|
+
const items = r.plan.byCategory[cat];
|
|
79
|
+
out.push(` ${cat.padEnd(18)} ${items.length}`);
|
|
80
|
+
}
|
|
81
|
+
out.push('');
|
|
82
|
+
if (r.state && r.threeWay.perTarget.length > 0) {
|
|
83
|
+
out.push('## Three-way verdicts');
|
|
84
|
+
for (const tw of r.threeWay.perTarget) {
|
|
85
|
+
out.push(` ${tw.verdict.padEnd(18)} ${tw.relativePath}`);
|
|
86
|
+
}
|
|
87
|
+
out.push('');
|
|
88
|
+
}
|
|
89
|
+
out.push('## Recommended commands');
|
|
90
|
+
for (const c of r.recommendedCommands)
|
|
91
|
+
out.push(` $ ${c}`);
|
|
92
|
+
out.push('');
|
|
93
|
+
out.push('## Safety');
|
|
94
|
+
for (const s of r.safetyNotes)
|
|
95
|
+
out.push(` - ${s}`);
|
|
96
|
+
return out.join('\n') + '\n';
|
|
97
|
+
}
|
|
98
|
+
export function renderAdoptionReportMarkdown(r) {
|
|
99
|
+
const out = [];
|
|
100
|
+
out.push('# SharkCraft onboarding adoption — report');
|
|
101
|
+
out.push('');
|
|
102
|
+
out.push(`Generated: \`${r.generatedAt}\``);
|
|
103
|
+
if (r.state) {
|
|
104
|
+
out.push(`- Patch: \`${r.state.patchPath}\``);
|
|
105
|
+
out.push(`- Format: \`${r.state.diffFormat}\``);
|
|
106
|
+
out.push(`- Freshness: \`${r.freshness.status}\``);
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
out.push('- State: _(no adoption state on disk)_');
|
|
110
|
+
}
|
|
111
|
+
out.push('');
|
|
112
|
+
out.push('## Executive summary');
|
|
113
|
+
out.push('');
|
|
114
|
+
out.push('| Category | Count |');
|
|
115
|
+
out.push('|---|---|');
|
|
116
|
+
for (const cat of Object.values(AdoptionCategory)) {
|
|
117
|
+
out.push(`| \`${cat}\` | ${r.plan.byCategory[cat].length} |`);
|
|
118
|
+
}
|
|
119
|
+
out.push('');
|
|
120
|
+
if (r.state && r.threeWay.perTarget.length > 0) {
|
|
121
|
+
out.push('## Three-way verdicts');
|
|
122
|
+
out.push('');
|
|
123
|
+
out.push('| Target | Verdict | Notes |');
|
|
124
|
+
out.push('|---|---|---|');
|
|
125
|
+
for (const tw of r.threeWay.perTarget) {
|
|
126
|
+
out.push(`| \`${tw.relativePath}\` | \`${tw.verdict}\` | ${tw.reasons.join('; ')} |`);
|
|
127
|
+
}
|
|
128
|
+
out.push('');
|
|
129
|
+
}
|
|
130
|
+
renderItemSectionMd(out, 'Safe to adopt', r.plan.byCategory[AdoptionCategory.SafeToAdopt]);
|
|
131
|
+
renderItemSectionMd(out, 'Manual review', r.plan.byCategory[AdoptionCategory.ManualReview]);
|
|
132
|
+
renderItemSectionMd(out, 'Conflicts', r.plan.byCategory[AdoptionCategory.Conflict]);
|
|
133
|
+
renderItemSectionMd(out, 'Skipped / low-confidence', [
|
|
134
|
+
...r.plan.byCategory[AdoptionCategory.LowConfidence],
|
|
135
|
+
...r.plan.byCategory[AdoptionCategory.Skipped],
|
|
136
|
+
]);
|
|
137
|
+
out.push('## Recommended commands');
|
|
138
|
+
out.push('');
|
|
139
|
+
out.push('```');
|
|
140
|
+
for (const c of r.recommendedCommands)
|
|
141
|
+
out.push(c);
|
|
142
|
+
out.push('```');
|
|
143
|
+
out.push('');
|
|
144
|
+
out.push('## Safety');
|
|
145
|
+
for (const s of r.safetyNotes)
|
|
146
|
+
out.push(`- ${s}`);
|
|
147
|
+
out.push('');
|
|
148
|
+
return out.join('\n') + '\n';
|
|
149
|
+
}
|
|
150
|
+
function renderItemSectionMd(out, title, items) {
|
|
151
|
+
if (items.length === 0)
|
|
152
|
+
return;
|
|
153
|
+
out.push(`### ${title} (${items.length})`);
|
|
154
|
+
for (const it of items) {
|
|
155
|
+
out.push(`- **${it.kind}** \`${it.id}\` — ${it.title}`);
|
|
156
|
+
out.push(` - reason: ${it.reason}`);
|
|
157
|
+
}
|
|
158
|
+
out.push('');
|
|
159
|
+
}
|
|
160
|
+
function escapeHtml(s) {
|
|
161
|
+
return s
|
|
162
|
+
.replace(/&/g, '&')
|
|
163
|
+
.replace(/</g, '<')
|
|
164
|
+
.replace(/>/g, '>')
|
|
165
|
+
.replace(/"/g, '"')
|
|
166
|
+
.replace(/'/g, ''');
|
|
167
|
+
}
|
|
168
|
+
const HTML_CSS = `
|
|
169
|
+
*{box-sizing:border-box}body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;margin:0;background:#0f1419;color:#e6e1cf;padding:2rem;line-height:1.55}
|
|
170
|
+
h1,h2,h3{margin-top:1.4rem;color:#bae67e}
|
|
171
|
+
table{border-collapse:collapse;width:100%;margin:.8rem 0}
|
|
172
|
+
th,td{text-align:left;padding:.4rem .6rem;border-bottom:1px solid #2a3138}
|
|
173
|
+
th{background:#1c2329;color:#9aa5b0}
|
|
174
|
+
.badge{display:inline-block;padding:.1rem .5rem;border-radius:.25rem;font-size:.75rem;font-weight:600;text-transform:uppercase}
|
|
175
|
+
.b-safe{background:#28432e;color:#bae67e}.b-stale{background:#4a2e2e;color:#ff7f7f}
|
|
176
|
+
.b-manual{background:#2e3a4a;color:#7fd0ff}.b-probably{background:#3a3a2e;color:#ffd580}
|
|
177
|
+
.b-create{background:#28433f;color:#7fe6cf}.b-conflict{background:#5a1f1f;color:#ff9f9f}
|
|
178
|
+
pre{background:#1c2329;padding:.8rem;border-radius:.4rem;overflow-x:auto}
|
|
179
|
+
code{background:#1c2329;padding:.05rem .3rem;border-radius:.2rem}
|
|
180
|
+
.note{padding:.6rem .8rem;background:#1c2329;border-left:3px solid #bae67e;border-radius:.2rem;margin:.6rem 0}
|
|
181
|
+
@media (prefers-color-scheme: light){body{background:#fafaf7;color:#1f2329}h1,h2,h3{color:#266a2e}th{background:#eee;color:#222}pre,code{background:#eee}.note{background:#eee;border-left-color:#266a2e}}
|
|
182
|
+
`;
|
|
183
|
+
const VERDICT_CSS = {
|
|
184
|
+
[ThreeWayVerdict.Safe]: 'b-safe',
|
|
185
|
+
[ThreeWayVerdict.ProbablySafe]: 'b-probably',
|
|
186
|
+
[ThreeWayVerdict.StaleTarget]: 'b-stale',
|
|
187
|
+
[ThreeWayVerdict.StaleDraft]: 'b-stale',
|
|
188
|
+
[ThreeWayVerdict.ManualReview]: 'b-manual',
|
|
189
|
+
[ThreeWayVerdict.CreateFileSafe]: 'b-create',
|
|
190
|
+
[ThreeWayVerdict.Conflict]: 'b-conflict',
|
|
191
|
+
};
|
|
192
|
+
export function renderAdoptionReportHtml(r) {
|
|
193
|
+
const out = [];
|
|
194
|
+
out.push('<!doctype html>');
|
|
195
|
+
out.push('<html lang="en"><head><meta charset="utf-8"><title>SharkCraft adoption report</title>');
|
|
196
|
+
out.push(`<style>${HTML_CSS}</style></head><body>`);
|
|
197
|
+
out.push('<h1>SharkCraft onboarding adoption — report</h1>');
|
|
198
|
+
out.push('<p class="note"><strong>MCP never writes.</strong> The user must review the patch before applying.</p>');
|
|
199
|
+
out.push('<h2>Status</h2>');
|
|
200
|
+
out.push('<table>');
|
|
201
|
+
out.push(`<tr><th>Generated</th><td><code>${escapeHtml(r.generatedAt)}</code></td></tr>`);
|
|
202
|
+
if (r.state) {
|
|
203
|
+
out.push(`<tr><th>Patch</th><td><code>${escapeHtml(r.state.patchPath)}</code></td></tr>`);
|
|
204
|
+
out.push(`<tr><th>Format</th><td><code>${escapeHtml(r.state.diffFormat)}</code></td></tr>`);
|
|
205
|
+
out.push(`<tr><th>Freshness</th><td><span class="badge ${r.freshness.status === 'fresh' ? 'b-safe' : 'b-stale'}">${escapeHtml(r.freshness.status)}</span></td></tr>`);
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
out.push('<tr><th>State</th><td><em>no adoption state on disk</em></td></tr>');
|
|
209
|
+
}
|
|
210
|
+
out.push('</table>');
|
|
211
|
+
out.push('<h2>Categories</h2>');
|
|
212
|
+
out.push('<table><thead><tr><th>Category</th><th>Count</th></tr></thead><tbody>');
|
|
213
|
+
for (const cat of Object.values(AdoptionCategory)) {
|
|
214
|
+
out.push(`<tr><td><code>${escapeHtml(cat)}</code></td><td>${r.plan.byCategory[cat].length}</td></tr>`);
|
|
215
|
+
}
|
|
216
|
+
out.push('</tbody></table>');
|
|
217
|
+
if (r.state && r.threeWay.perTarget.length > 0) {
|
|
218
|
+
out.push('<h2>Three-way verdicts</h2>');
|
|
219
|
+
out.push('<table><thead><tr><th>Target</th><th>Verdict</th><th>Notes</th></tr></thead><tbody>');
|
|
220
|
+
for (const tw of r.threeWay.perTarget) {
|
|
221
|
+
const cls = VERDICT_CSS[tw.verdict];
|
|
222
|
+
out.push(`<tr><td><code>${escapeHtml(tw.relativePath)}</code></td>` +
|
|
223
|
+
`<td><span class="badge ${cls}">${escapeHtml(tw.verdict)}</span></td>` +
|
|
224
|
+
`<td>${tw.reasons.map(escapeHtml).join('<br>')}</td></tr>`);
|
|
225
|
+
}
|
|
226
|
+
out.push('</tbody></table>');
|
|
227
|
+
}
|
|
228
|
+
renderItemSectionHtml(out, 'Safe to adopt', r.plan.byCategory[AdoptionCategory.SafeToAdopt]);
|
|
229
|
+
renderItemSectionHtml(out, 'Manual review', r.plan.byCategory[AdoptionCategory.ManualReview]);
|
|
230
|
+
renderItemSectionHtml(out, 'Conflicts', r.plan.byCategory[AdoptionCategory.Conflict]);
|
|
231
|
+
renderItemSectionHtml(out, 'Skipped / low-confidence', [...r.plan.byCategory[AdoptionCategory.LowConfidence], ...r.plan.byCategory[AdoptionCategory.Skipped]]);
|
|
232
|
+
out.push('<h2>Recommended commands</h2><pre>');
|
|
233
|
+
for (const c of r.recommendedCommands)
|
|
234
|
+
out.push(escapeHtml(c));
|
|
235
|
+
out.push('</pre>');
|
|
236
|
+
out.push('<h2>Safety</h2><ul>');
|
|
237
|
+
for (const s of r.safetyNotes)
|
|
238
|
+
out.push(`<li>${escapeHtml(s)}</li>`);
|
|
239
|
+
out.push('</ul></body></html>');
|
|
240
|
+
return out.join('\n') + '\n';
|
|
241
|
+
}
|
|
242
|
+
function renderItemSectionHtml(out, title, items) {
|
|
243
|
+
if (items.length === 0)
|
|
244
|
+
return;
|
|
245
|
+
out.push(`<h2>${escapeHtml(title)} (${items.length})</h2>`);
|
|
246
|
+
out.push('<table><thead><tr><th>Kind</th><th>Id</th><th>Title</th><th>Reason</th></tr></thead><tbody>');
|
|
247
|
+
for (const it of items) {
|
|
248
|
+
out.push(`<tr><td><code>${escapeHtml(it.kind)}</code></td>` +
|
|
249
|
+
`<td><code>${escapeHtml(it.id)}</code></td>` +
|
|
250
|
+
`<td>${escapeHtml(it.title)}</td>` +
|
|
251
|
+
`<td>${escapeHtml(it.reason)}</td></tr>`);
|
|
252
|
+
}
|
|
253
|
+
out.push('</tbody></table>');
|
|
254
|
+
}
|
|
255
|
+
export function renderAdoptionReportJson(r) {
|
|
256
|
+
return JSON.stringify(r, null, 2) + '\n';
|
|
257
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { AdoptionCategory } from './onboarding-adoption.js';
|
|
2
|
+
import type { AdoptionKind, IAdoptionItem, IAdoptionPatchTarget, IAdoptionPlan } from './onboarding-adoption.js';
|
|
3
|
+
export declare const ADOPTION_STATE_SCHEMA = "sharkcraft.adoption-state/v1";
|
|
4
|
+
export declare enum AdoptionFreshnessStatus {
|
|
5
|
+
Fresh = "fresh",
|
|
6
|
+
Stale = "stale",
|
|
7
|
+
Unknown = "unknown"
|
|
8
|
+
}
|
|
9
|
+
export interface IAdoptionStateCategorySummary {
|
|
10
|
+
[AdoptionCategory.SafeToAdopt]: readonly string[];
|
|
11
|
+
[AdoptionCategory.ManualReview]: readonly string[];
|
|
12
|
+
[AdoptionCategory.LowConfidence]: readonly string[];
|
|
13
|
+
[AdoptionCategory.Conflict]: readonly string[];
|
|
14
|
+
[AdoptionCategory.AlreadyCovered]: readonly string[];
|
|
15
|
+
[AdoptionCategory.Skipped]: readonly string[];
|
|
16
|
+
}
|
|
17
|
+
export interface IAdoptionStateFile {
|
|
18
|
+
relativePath: string;
|
|
19
|
+
hash: string;
|
|
20
|
+
}
|
|
21
|
+
export interface IAdoptionStateFreshness {
|
|
22
|
+
status: AdoptionFreshnessStatus;
|
|
23
|
+
staleReasons: readonly string[];
|
|
24
|
+
}
|
|
25
|
+
export interface IAdoptionState {
|
|
26
|
+
schema: typeof ADOPTION_STATE_SCHEMA;
|
|
27
|
+
projectRoot: string;
|
|
28
|
+
createdAt: string;
|
|
29
|
+
updatedAt: string;
|
|
30
|
+
sharkcraftVersion: string;
|
|
31
|
+
command: string;
|
|
32
|
+
sourceDraftFiles: readonly IAdoptionStateFile[];
|
|
33
|
+
targetFiles: readonly IAdoptionStateFile[];
|
|
34
|
+
/** Patch + summary + report files this run produced. Relative to projectRoot. */
|
|
35
|
+
generatedFiles: readonly string[];
|
|
36
|
+
patchPath: string;
|
|
37
|
+
summaryPath: string;
|
|
38
|
+
reportPath?: string;
|
|
39
|
+
diffFormat: 'pseudo' | 'unified';
|
|
40
|
+
confidenceThreshold: 'high' | 'medium' | 'low';
|
|
41
|
+
includedKinds: readonly AdoptionKind[];
|
|
42
|
+
excludedKinds: readonly AdoptionKind[];
|
|
43
|
+
categories: IAdoptionStateCategorySummary;
|
|
44
|
+
freshness: IAdoptionStateFreshness;
|
|
45
|
+
warnings: readonly string[];
|
|
46
|
+
nextCommands: readonly string[];
|
|
47
|
+
}
|
|
48
|
+
export declare function adoptionDir(projectRoot: string): string;
|
|
49
|
+
export declare function adoptionStatePath(projectRoot: string): string;
|
|
50
|
+
export declare function adoptionHistoryDir(projectRoot: string): string;
|
|
51
|
+
export declare function hashFile(absolute: string): string | null;
|
|
52
|
+
export interface IBuildAdoptionStateInput {
|
|
53
|
+
projectRoot: string;
|
|
54
|
+
command: string;
|
|
55
|
+
patchPath: string;
|
|
56
|
+
summaryPath: string;
|
|
57
|
+
reportPath?: string;
|
|
58
|
+
diffFormat: 'pseudo' | 'unified';
|
|
59
|
+
plan: IAdoptionPlan;
|
|
60
|
+
targets: readonly IAdoptionPatchTarget[];
|
|
61
|
+
generatedFiles: readonly string[];
|
|
62
|
+
warnings?: readonly string[];
|
|
63
|
+
nextCommands?: readonly string[];
|
|
64
|
+
sharkcraftVersion?: string;
|
|
65
|
+
/** When provided, preserve the prior createdAt (so updatedAt reflects regen). */
|
|
66
|
+
previousCreatedAt?: string;
|
|
67
|
+
}
|
|
68
|
+
export declare function buildAdoptionState(input: IBuildAdoptionStateInput): IAdoptionState;
|
|
69
|
+
export declare function writeAdoptionState(projectRoot: string, state: IAdoptionState): string;
|
|
70
|
+
export declare function readAdoptionState(projectRoot: string): IAdoptionState | null;
|
|
71
|
+
export interface IComputeFreshnessResult extends IAdoptionStateFreshness {
|
|
72
|
+
changedTargets: readonly IAdoptionStateFile[];
|
|
73
|
+
changedDrafts: readonly IAdoptionStateFile[];
|
|
74
|
+
missingTargets: readonly string[];
|
|
75
|
+
missingDrafts: readonly string[];
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Recompute freshness from disk. Compares stored hashes against current file
|
|
79
|
+
* content. A patch is stale when any target or draft file changed since the
|
|
80
|
+
* state was written (or when state files are missing).
|
|
81
|
+
*/
|
|
82
|
+
export declare function computeAdoptionFreshness(projectRoot: string, state: IAdoptionState | null): IComputeFreshnessResult;
|
|
83
|
+
/** Archive the previous adoption-state.json + adopt.patch under history/. */
|
|
84
|
+
export interface IArchiveAdoptionStateResult {
|
|
85
|
+
archived: readonly string[];
|
|
86
|
+
historyDir: string;
|
|
87
|
+
}
|
|
88
|
+
export declare function archivePreviousAdoptionOutputs(projectRoot: string, timestamp?: string): IArchiveAdoptionStateResult;
|
|
89
|
+
/** Convenience used by `shrk onboard adopt regenerate`. */
|
|
90
|
+
export interface IUpdateAdoptionStateInput extends Omit<IBuildAdoptionStateInput, 'previousCreatedAt'> {
|
|
91
|
+
/** When the user passes --force, we still archive previous outputs first. */
|
|
92
|
+
archivePrevious: boolean;
|
|
93
|
+
}
|
|
94
|
+
export declare function updateAdoptionStateAfterRegenerate(input: IUpdateAdoptionStateInput): {
|
|
95
|
+
state: IAdoptionState;
|
|
96
|
+
archived: IArchiveAdoptionStateResult | null;
|
|
97
|
+
statePath: string;
|
|
98
|
+
};
|
|
99
|
+
export type { IAdoptionItem };
|
|
100
|
+
//# sourceMappingURL=adoption-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adoption-state.d.ts","sourceRoot":"","sources":["../src/adoption-state.ts"],"names":[],"mappings":"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"}
|