@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,296 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* sharkcraft.adoption-state/v1
|
|
3
|
+
*
|
|
4
|
+
* Persistent state for the onboarding adoption workflow. Written under
|
|
5
|
+
* `sharkcraft/onboarding/adoption/adoption-state.json` whenever a patch is
|
|
6
|
+
* generated. Captures source draft + target file hashes so freshness can be
|
|
7
|
+
* computed deterministically without re-running inference.
|
|
8
|
+
*
|
|
9
|
+
* Writes are confined to `sharkcraft/onboarding/adoption/` — never live config.
|
|
10
|
+
*/
|
|
11
|
+
import { createHash } from 'node:crypto';
|
|
12
|
+
import { existsSync, mkdirSync, readFileSync, readdirSync, renameSync, statSync, writeFileSync, } from 'node:fs';
|
|
13
|
+
import * as nodePath from 'node:path';
|
|
14
|
+
import { AdoptionCategory } from "./onboarding-adoption.js";
|
|
15
|
+
export const ADOPTION_STATE_SCHEMA = 'sharkcraft.adoption-state/v1';
|
|
16
|
+
export var AdoptionFreshnessStatus;
|
|
17
|
+
(function (AdoptionFreshnessStatus) {
|
|
18
|
+
AdoptionFreshnessStatus["Fresh"] = "fresh";
|
|
19
|
+
AdoptionFreshnessStatus["Stale"] = "stale";
|
|
20
|
+
AdoptionFreshnessStatus["Unknown"] = "unknown";
|
|
21
|
+
})(AdoptionFreshnessStatus || (AdoptionFreshnessStatus = {}));
|
|
22
|
+
const ADOPTION_DIR_RELATIVE = nodePath.join('sharkcraft', 'onboarding', 'adoption');
|
|
23
|
+
const ADOPTION_DRAFT_DIR_RELATIVE = nodePath.join('sharkcraft', 'onboarding');
|
|
24
|
+
const STATE_FILENAME = 'adoption-state.json';
|
|
25
|
+
export function adoptionDir(projectRoot) {
|
|
26
|
+
return nodePath.resolve(projectRoot, ADOPTION_DIR_RELATIVE);
|
|
27
|
+
}
|
|
28
|
+
export function adoptionStatePath(projectRoot) {
|
|
29
|
+
return nodePath.join(adoptionDir(projectRoot), STATE_FILENAME);
|
|
30
|
+
}
|
|
31
|
+
export function adoptionHistoryDir(projectRoot) {
|
|
32
|
+
return nodePath.join(adoptionDir(projectRoot), 'history');
|
|
33
|
+
}
|
|
34
|
+
function readSafe(absolute) {
|
|
35
|
+
try {
|
|
36
|
+
return readFileSync(absolute, 'utf8');
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function sha256(s) {
|
|
43
|
+
return createHash('sha256').update(s).digest('hex');
|
|
44
|
+
}
|
|
45
|
+
export function hashFile(absolute) {
|
|
46
|
+
const body = readSafe(absolute);
|
|
47
|
+
if (body === null)
|
|
48
|
+
return null;
|
|
49
|
+
return sha256(body);
|
|
50
|
+
}
|
|
51
|
+
function buildCategoryIds(plan) {
|
|
52
|
+
const out = {
|
|
53
|
+
[AdoptionCategory.SafeToAdopt]: [],
|
|
54
|
+
[AdoptionCategory.ManualReview]: [],
|
|
55
|
+
[AdoptionCategory.LowConfidence]: [],
|
|
56
|
+
[AdoptionCategory.Conflict]: [],
|
|
57
|
+
[AdoptionCategory.AlreadyCovered]: [],
|
|
58
|
+
[AdoptionCategory.Skipped]: [],
|
|
59
|
+
};
|
|
60
|
+
for (const it of plan.items) {
|
|
61
|
+
out[it.category].push(`${it.kind}:${it.id}`);
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
[AdoptionCategory.SafeToAdopt]: out[AdoptionCategory.SafeToAdopt],
|
|
65
|
+
[AdoptionCategory.ManualReview]: out[AdoptionCategory.ManualReview],
|
|
66
|
+
[AdoptionCategory.LowConfidence]: out[AdoptionCategory.LowConfidence],
|
|
67
|
+
[AdoptionCategory.Conflict]: out[AdoptionCategory.Conflict],
|
|
68
|
+
[AdoptionCategory.AlreadyCovered]: out[AdoptionCategory.AlreadyCovered],
|
|
69
|
+
[AdoptionCategory.Skipped]: out[AdoptionCategory.Skipped],
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
/** Collect every draft file under sharkcraft/onboarding/ that the adoption
|
|
73
|
+
* plan derived items from. We always include the directory listing for
|
|
74
|
+
* robustness — a draft can affect the plan without being explicitly named. */
|
|
75
|
+
function collectDraftFileHashes(projectRoot) {
|
|
76
|
+
const dir = nodePath.resolve(projectRoot, ADOPTION_DRAFT_DIR_RELATIVE);
|
|
77
|
+
if (!existsSync(dir))
|
|
78
|
+
return [];
|
|
79
|
+
const files = [];
|
|
80
|
+
const visit = (d) => {
|
|
81
|
+
let entries;
|
|
82
|
+
try {
|
|
83
|
+
entries = readdirSync(d);
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
for (const e of entries) {
|
|
89
|
+
if (e === 'adoption')
|
|
90
|
+
continue; // never include adoption outputs as drafts
|
|
91
|
+
const full = nodePath.join(d, e);
|
|
92
|
+
let st;
|
|
93
|
+
try {
|
|
94
|
+
st = statSync(full);
|
|
95
|
+
}
|
|
96
|
+
catch {
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
if (st.isDirectory()) {
|
|
100
|
+
visit(full);
|
|
101
|
+
}
|
|
102
|
+
else if (st.isFile() && /\.(draft\.ts|draft\.md|md|ts)$/.test(e)) {
|
|
103
|
+
const body = readSafe(full);
|
|
104
|
+
if (body !== null) {
|
|
105
|
+
files.push({
|
|
106
|
+
relativePath: nodePath.relative(projectRoot, full).split(nodePath.sep).join('/'),
|
|
107
|
+
hash: sha256(body),
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
visit(dir);
|
|
114
|
+
return files.sort((a, b) => a.relativePath.localeCompare(b.relativePath));
|
|
115
|
+
}
|
|
116
|
+
function collectTargetHashes(projectRoot, targets) {
|
|
117
|
+
const out = [];
|
|
118
|
+
for (const t of targets) {
|
|
119
|
+
if (t.beforeHash) {
|
|
120
|
+
out.push({ relativePath: t.relativePath, hash: t.beforeHash });
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
const full = nodePath.resolve(projectRoot, t.relativePath);
|
|
124
|
+
const h = hashFile(full);
|
|
125
|
+
out.push({ relativePath: t.relativePath, hash: h ?? '(missing)' });
|
|
126
|
+
}
|
|
127
|
+
return out;
|
|
128
|
+
}
|
|
129
|
+
export function buildAdoptionState(input) {
|
|
130
|
+
const now = new Date().toISOString();
|
|
131
|
+
const state = {
|
|
132
|
+
schema: ADOPTION_STATE_SCHEMA,
|
|
133
|
+
projectRoot: input.projectRoot,
|
|
134
|
+
createdAt: input.previousCreatedAt ?? now,
|
|
135
|
+
updatedAt: now,
|
|
136
|
+
sharkcraftVersion: input.sharkcraftVersion ?? '0.1.0-alpha.2',
|
|
137
|
+
command: input.command,
|
|
138
|
+
sourceDraftFiles: collectDraftFileHashes(input.projectRoot),
|
|
139
|
+
targetFiles: collectTargetHashes(input.projectRoot, input.targets),
|
|
140
|
+
generatedFiles: input.generatedFiles,
|
|
141
|
+
patchPath: input.patchPath,
|
|
142
|
+
summaryPath: input.summaryPath,
|
|
143
|
+
...(input.reportPath ? { reportPath: input.reportPath } : {}),
|
|
144
|
+
diffFormat: input.diffFormat,
|
|
145
|
+
confidenceThreshold: input.plan.confidence,
|
|
146
|
+
includedKinds: input.plan.included,
|
|
147
|
+
excludedKinds: input.plan.excluded,
|
|
148
|
+
categories: buildCategoryIds(input.plan),
|
|
149
|
+
freshness: { status: AdoptionFreshnessStatus.Fresh, staleReasons: [] },
|
|
150
|
+
warnings: input.warnings ?? [],
|
|
151
|
+
nextCommands: input.nextCommands ??
|
|
152
|
+
[
|
|
153
|
+
'shrk onboard adopt status',
|
|
154
|
+
'shrk onboard adopt review',
|
|
155
|
+
'git apply sharkcraft/onboarding/adoption/adopt.patch',
|
|
156
|
+
],
|
|
157
|
+
};
|
|
158
|
+
return state;
|
|
159
|
+
}
|
|
160
|
+
export function writeAdoptionState(projectRoot, state) {
|
|
161
|
+
const target = adoptionStatePath(projectRoot);
|
|
162
|
+
const dir = nodePath.dirname(target);
|
|
163
|
+
if (!existsSync(dir))
|
|
164
|
+
mkdirSync(dir, { recursive: true });
|
|
165
|
+
if (!target.startsWith(adoptionDir(projectRoot))) {
|
|
166
|
+
throw new Error(`adoption state path escapes adoption dir: ${target}`);
|
|
167
|
+
}
|
|
168
|
+
writeFileSync(target, JSON.stringify(state, null, 2) + '\n', 'utf8');
|
|
169
|
+
return target;
|
|
170
|
+
}
|
|
171
|
+
export function readAdoptionState(projectRoot) {
|
|
172
|
+
const target = adoptionStatePath(projectRoot);
|
|
173
|
+
const body = readSafe(target);
|
|
174
|
+
if (body === null)
|
|
175
|
+
return null;
|
|
176
|
+
try {
|
|
177
|
+
const parsed = JSON.parse(body);
|
|
178
|
+
if (parsed.schema !== ADOPTION_STATE_SCHEMA)
|
|
179
|
+
return null;
|
|
180
|
+
return parsed;
|
|
181
|
+
}
|
|
182
|
+
catch {
|
|
183
|
+
return null;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Recompute freshness from disk. Compares stored hashes against current file
|
|
188
|
+
* content. A patch is stale when any target or draft file changed since the
|
|
189
|
+
* state was written (or when state files are missing).
|
|
190
|
+
*/
|
|
191
|
+
export function computeAdoptionFreshness(projectRoot, state) {
|
|
192
|
+
if (!state) {
|
|
193
|
+
return {
|
|
194
|
+
status: AdoptionFreshnessStatus.Unknown,
|
|
195
|
+
staleReasons: ['no adoption state on disk'],
|
|
196
|
+
changedTargets: [],
|
|
197
|
+
changedDrafts: [],
|
|
198
|
+
missingTargets: [],
|
|
199
|
+
missingDrafts: [],
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
const reasons = [];
|
|
203
|
+
const changedTargets = [];
|
|
204
|
+
const changedDrafts = [];
|
|
205
|
+
const missingTargets = [];
|
|
206
|
+
const missingDrafts = [];
|
|
207
|
+
for (const t of state.targetFiles) {
|
|
208
|
+
const full = nodePath.resolve(projectRoot, t.relativePath);
|
|
209
|
+
if (!existsSync(full)) {
|
|
210
|
+
// The "(missing)" placeholder means "the target didn't exist when we
|
|
211
|
+
// wrote the patch" — that's a create-file hunk. If it still doesn't
|
|
212
|
+
// exist, that's fresh. If it now exists, that's a stale-target change.
|
|
213
|
+
if (t.hash === '(missing)')
|
|
214
|
+
continue;
|
|
215
|
+
missingTargets.push(t.relativePath);
|
|
216
|
+
reasons.push(`target file vanished: ${t.relativePath}`);
|
|
217
|
+
continue;
|
|
218
|
+
}
|
|
219
|
+
const current = hashFile(full);
|
|
220
|
+
if (t.hash === '(missing)') {
|
|
221
|
+
// Target was created since plan-time.
|
|
222
|
+
changedTargets.push(t);
|
|
223
|
+
reasons.push(`target file created after patch: ${t.relativePath}`);
|
|
224
|
+
continue;
|
|
225
|
+
}
|
|
226
|
+
if (current && current !== t.hash) {
|
|
227
|
+
changedTargets.push(t);
|
|
228
|
+
reasons.push(`target file changed: ${t.relativePath}`);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
// Drafts: compare against the directory now. Any added/removed/edited file
|
|
232
|
+
// is a stale signal.
|
|
233
|
+
const currentDrafts = collectDraftFileHashes(projectRoot);
|
|
234
|
+
const currentByPath = new Map(currentDrafts.map((f) => [f.relativePath, f.hash]));
|
|
235
|
+
const previousByPath = new Map(state.sourceDraftFiles.map((f) => [f.relativePath, f.hash]));
|
|
236
|
+
for (const [path, hash] of previousByPath) {
|
|
237
|
+
if (!currentByPath.has(path)) {
|
|
238
|
+
missingDrafts.push(path);
|
|
239
|
+
reasons.push(`draft file removed: ${path}`);
|
|
240
|
+
continue;
|
|
241
|
+
}
|
|
242
|
+
if (currentByPath.get(path) !== hash) {
|
|
243
|
+
changedDrafts.push({ relativePath: path, hash });
|
|
244
|
+
reasons.push(`draft file changed: ${path}`);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
for (const [path, hash] of currentByPath) {
|
|
248
|
+
if (!previousByPath.has(path)) {
|
|
249
|
+
changedDrafts.push({ relativePath: path, hash });
|
|
250
|
+
reasons.push(`new draft file appeared: ${path}`);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
const status = reasons.length === 0 ? AdoptionFreshnessStatus.Fresh : AdoptionFreshnessStatus.Stale;
|
|
254
|
+
return {
|
|
255
|
+
status,
|
|
256
|
+
staleReasons: reasons,
|
|
257
|
+
changedTargets,
|
|
258
|
+
changedDrafts,
|
|
259
|
+
missingTargets,
|
|
260
|
+
missingDrafts,
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
export function archivePreviousAdoptionOutputs(projectRoot, timestamp = new Date().toISOString().replace(/[:.]/g, '-')) {
|
|
264
|
+
const dir = adoptionDir(projectRoot);
|
|
265
|
+
if (!existsSync(dir))
|
|
266
|
+
return { archived: [], historyDir: adoptionHistoryDir(projectRoot) };
|
|
267
|
+
const history = adoptionHistoryDir(projectRoot);
|
|
268
|
+
if (!existsSync(history))
|
|
269
|
+
mkdirSync(history, { recursive: true });
|
|
270
|
+
const archived = [];
|
|
271
|
+
for (const name of ['adoption-state.json', 'adopt.patch', 'adoption-plan.md', 'adopt-summary.json']) {
|
|
272
|
+
const src = nodePath.join(dir, name);
|
|
273
|
+
if (!existsSync(src))
|
|
274
|
+
continue;
|
|
275
|
+
const dest = nodePath.join(history, `${timestamp}-${name}`);
|
|
276
|
+
if (existsSync(dest)) {
|
|
277
|
+
// Never overwrite history.
|
|
278
|
+
continue;
|
|
279
|
+
}
|
|
280
|
+
renameSync(src, dest);
|
|
281
|
+
archived.push(dest);
|
|
282
|
+
}
|
|
283
|
+
return { archived, historyDir: history };
|
|
284
|
+
}
|
|
285
|
+
export function updateAdoptionStateAfterRegenerate(input) {
|
|
286
|
+
const previous = readAdoptionState(input.projectRoot);
|
|
287
|
+
const archived = input.archivePrevious
|
|
288
|
+
? archivePreviousAdoptionOutputs(input.projectRoot)
|
|
289
|
+
: null;
|
|
290
|
+
const state = buildAdoptionState({
|
|
291
|
+
...input,
|
|
292
|
+
...(previous ? { previousCreatedAt: previous.createdAt } : {}),
|
|
293
|
+
});
|
|
294
|
+
const statePath = writeAdoptionState(input.projectRoot, state);
|
|
295
|
+
return { state, archived, statePath };
|
|
296
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { IAdoptionStateFile } from './adoption-state.js';
|
|
2
|
+
export declare enum ThreeWayVerdict {
|
|
3
|
+
Safe = "safe",
|
|
4
|
+
ProbablySafe = "probably-safe",
|
|
5
|
+
StaleTarget = "stale-target",
|
|
6
|
+
StaleDraft = "stale-draft",
|
|
7
|
+
ManualReview = "manual-review",
|
|
8
|
+
CreateFileSafe = "create-file-safe",
|
|
9
|
+
Conflict = "conflict"
|
|
10
|
+
}
|
|
11
|
+
export interface IThreeWayPreviewInput {
|
|
12
|
+
/** Project root. Used to read the current file content. */
|
|
13
|
+
projectRoot: string;
|
|
14
|
+
/** Target relative to projectRoot. */
|
|
15
|
+
relativePath: string;
|
|
16
|
+
/** The base hash recorded in adoption-state (the hash captured when the
|
|
17
|
+
* patch was rendered). For create-file hunks this is "(missing)". */
|
|
18
|
+
baseHash: string;
|
|
19
|
+
/** Optional append-block body. When provided, we can check whether the
|
|
20
|
+
* append-block contents already exist in the file (the patch would be a
|
|
21
|
+
* no-op) or whether they conflict with existing content. */
|
|
22
|
+
appendBlock?: string;
|
|
23
|
+
/** If the draft for this target changed since the state was written, the
|
|
24
|
+
* patch is also stale. Caller computes this from the draft-file diff. */
|
|
25
|
+
draftChangedSinceState?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface IThreeWayPreviewResult {
|
|
28
|
+
relativePath: string;
|
|
29
|
+
verdict: ThreeWayVerdict;
|
|
30
|
+
reasons: readonly string[];
|
|
31
|
+
/** Whether the file is currently present on disk. */
|
|
32
|
+
targetExists: boolean;
|
|
33
|
+
/** Whether the current file hash equals the recorded base hash. */
|
|
34
|
+
targetUnchanged: boolean;
|
|
35
|
+
/** When appendBlock is provided: whether the file already contains it. */
|
|
36
|
+
alreadyApplied: boolean;
|
|
37
|
+
}
|
|
38
|
+
export declare function previewThreeWay(input: IThreeWayPreviewInput): IThreeWayPreviewResult;
|
|
39
|
+
export interface IThreeWayPreviewBatchResult {
|
|
40
|
+
perTarget: readonly IThreeWayPreviewResult[];
|
|
41
|
+
summary: Record<ThreeWayVerdict, number>;
|
|
42
|
+
}
|
|
43
|
+
export declare function previewThreeWayBatch(projectRoot: string, targets: readonly IAdoptionStateFile[], options?: {
|
|
44
|
+
draftsChanged?: boolean;
|
|
45
|
+
}): IThreeWayPreviewBatchResult;
|
|
46
|
+
//# sourceMappingURL=adoption-three-way.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adoption-three-way.d.ts","sourceRoot":"","sources":["../src/adoption-three-way.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,oBAAY,eAAe;IACzB,IAAI,SAAS;IACb,YAAY,kBAAkB;IAC9B,WAAW,iBAAiB;IAC5B,UAAU,gBAAgB;IAC1B,YAAY,kBAAkB;IAC9B,cAAc,qBAAqB;IACnC,QAAQ,aAAa;CACtB;AAED,MAAM,WAAW,qBAAqB;IACpC,2DAA2D;IAC3D,WAAW,EAAE,MAAM,CAAC;IACpB,sCAAsC;IACtC,YAAY,EAAE,MAAM,CAAC;IACrB;0EACsE;IACtE,QAAQ,EAAE,MAAM,CAAC;IACjB;;iEAE6D;IAC7D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;8EAC0E;IAC1E,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,MAAM,WAAW,sBAAsB;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,eAAe,CAAC;IACzB,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,qDAAqD;IACrD,YAAY,EAAE,OAAO,CAAC;IACtB,mEAAmE;IACnE,eAAe,EAAE,OAAO,CAAC;IACzB,0EAA0E;IAC1E,cAAc,EAAE,OAAO,CAAC;CACzB;AA6BD,wBAAgB,eAAe,CAAC,KAAK,EAAE,qBAAqB,GAAG,sBAAsB,CAoHpF;AAED,MAAM,WAAW,2BAA2B;IAC1C,SAAS,EAAE,SAAS,sBAAsB,EAAE,CAAC;IAC7C,OAAO,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;CAC1C;AAED,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,SAAS,kBAAkB,EAAE,EACtC,OAAO,GAAE;IAAE,aAAa,CAAC,EAAE,OAAO,CAAA;CAAO,GACxC,2BAA2B,CAoB7B"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Three-way merge preview for adoption patches.
|
|
3
|
+
*
|
|
4
|
+
* Inputs (the three "sides"):
|
|
5
|
+
* - base: the file hash recorded in adoption-state.json
|
|
6
|
+
* - current: the file content on disk right now
|
|
7
|
+
* - proposed: the append block from the adoption patch
|
|
8
|
+
*
|
|
9
|
+
* Output: a verdict per target — safe | probably-safe | stale-target |
|
|
10
|
+
* stale-draft | manual-review | create-file-safe | conflict.
|
|
11
|
+
*
|
|
12
|
+
* This is read-only. It never writes or mutates the target.
|
|
13
|
+
*/
|
|
14
|
+
import { createHash } from 'node:crypto';
|
|
15
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
16
|
+
import * as nodePath from 'node:path';
|
|
17
|
+
export var ThreeWayVerdict;
|
|
18
|
+
(function (ThreeWayVerdict) {
|
|
19
|
+
ThreeWayVerdict["Safe"] = "safe";
|
|
20
|
+
ThreeWayVerdict["ProbablySafe"] = "probably-safe";
|
|
21
|
+
ThreeWayVerdict["StaleTarget"] = "stale-target";
|
|
22
|
+
ThreeWayVerdict["StaleDraft"] = "stale-draft";
|
|
23
|
+
ThreeWayVerdict["ManualReview"] = "manual-review";
|
|
24
|
+
ThreeWayVerdict["CreateFileSafe"] = "create-file-safe";
|
|
25
|
+
ThreeWayVerdict["Conflict"] = "conflict";
|
|
26
|
+
})(ThreeWayVerdict || (ThreeWayVerdict = {}));
|
|
27
|
+
function sha256(s) {
|
|
28
|
+
return createHash('sha256').update(s).digest('hex');
|
|
29
|
+
}
|
|
30
|
+
/** Detect whether the file already ends with (a non-trivial chunk of) the
|
|
31
|
+
* append block. Used to flag "patch already applied" rather than "conflict". */
|
|
32
|
+
function endsWith(content, fragment) {
|
|
33
|
+
// The fragment may have leading/trailing whitespace that's not in the file.
|
|
34
|
+
// Compare on trimmed content vs trimmed fragment, and also check raw EOF.
|
|
35
|
+
if (fragment.length === 0)
|
|
36
|
+
return false;
|
|
37
|
+
if (content.endsWith(fragment))
|
|
38
|
+
return true;
|
|
39
|
+
const t = content.trimEnd();
|
|
40
|
+
const f = fragment.trimEnd();
|
|
41
|
+
return t.endsWith(f);
|
|
42
|
+
}
|
|
43
|
+
/** Whether the file already contains *every* line of the fragment (probably
|
|
44
|
+
* applied in a different order or with reformatting). */
|
|
45
|
+
function containsAllLines(content, fragment) {
|
|
46
|
+
const lines = fragment.split('\n').map((l) => l.trim()).filter(Boolean);
|
|
47
|
+
if (lines.length === 0)
|
|
48
|
+
return false;
|
|
49
|
+
for (const l of lines) {
|
|
50
|
+
if (!content.includes(l))
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
export function previewThreeWay(input) {
|
|
56
|
+
const full = nodePath.resolve(input.projectRoot, input.relativePath);
|
|
57
|
+
const exists = existsSync(full);
|
|
58
|
+
const reasons = [];
|
|
59
|
+
// Case A: the patch was a "create file" — base hash is the sentinel.
|
|
60
|
+
if (input.baseHash === '(missing)') {
|
|
61
|
+
if (!exists) {
|
|
62
|
+
return {
|
|
63
|
+
relativePath: input.relativePath,
|
|
64
|
+
verdict: ThreeWayVerdict.CreateFileSafe,
|
|
65
|
+
reasons: ['target file does not exist; create-file hunk is safe'],
|
|
66
|
+
targetExists: false,
|
|
67
|
+
targetUnchanged: true,
|
|
68
|
+
alreadyApplied: false,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
// The file now exists where it didn't at plan-time. That's a stale-target.
|
|
72
|
+
return {
|
|
73
|
+
relativePath: input.relativePath,
|
|
74
|
+
verdict: ThreeWayVerdict.StaleTarget,
|
|
75
|
+
reasons: ['target file was created after the patch was generated'],
|
|
76
|
+
targetExists: true,
|
|
77
|
+
targetUnchanged: false,
|
|
78
|
+
alreadyApplied: false,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
if (!exists) {
|
|
82
|
+
return {
|
|
83
|
+
relativePath: input.relativePath,
|
|
84
|
+
verdict: ThreeWayVerdict.StaleTarget,
|
|
85
|
+
reasons: ['target file was deleted after the patch was generated'],
|
|
86
|
+
targetExists: false,
|
|
87
|
+
targetUnchanged: false,
|
|
88
|
+
alreadyApplied: false,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
const body = readFileSync(full, 'utf8');
|
|
92
|
+
const currentHash = sha256(body);
|
|
93
|
+
const targetUnchanged = currentHash === input.baseHash;
|
|
94
|
+
let alreadyApplied = false;
|
|
95
|
+
if (input.appendBlock) {
|
|
96
|
+
alreadyApplied = endsWith(body, input.appendBlock) || containsAllLines(body, input.appendBlock);
|
|
97
|
+
}
|
|
98
|
+
if (alreadyApplied) {
|
|
99
|
+
reasons.push('the append block already appears in the target — patch is a no-op');
|
|
100
|
+
}
|
|
101
|
+
if (input.draftChangedSinceState) {
|
|
102
|
+
reasons.push('source draft changed after the patch was generated');
|
|
103
|
+
}
|
|
104
|
+
// Case B: target hash unchanged → safe.
|
|
105
|
+
if (targetUnchanged) {
|
|
106
|
+
if (input.draftChangedSinceState) {
|
|
107
|
+
return {
|
|
108
|
+
relativePath: input.relativePath,
|
|
109
|
+
verdict: ThreeWayVerdict.StaleDraft,
|
|
110
|
+
reasons,
|
|
111
|
+
targetExists: true,
|
|
112
|
+
targetUnchanged: true,
|
|
113
|
+
alreadyApplied,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
return {
|
|
117
|
+
relativePath: input.relativePath,
|
|
118
|
+
verdict: alreadyApplied ? ThreeWayVerdict.ManualReview : ThreeWayVerdict.Safe,
|
|
119
|
+
reasons: reasons.length === 0
|
|
120
|
+
? ['target file unchanged since the patch was generated']
|
|
121
|
+
: reasons,
|
|
122
|
+
targetExists: true,
|
|
123
|
+
targetUnchanged: true,
|
|
124
|
+
alreadyApplied,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
// Case C: target changed. If the append block is present, the patch was
|
|
128
|
+
// already applied — manual review (or no-op).
|
|
129
|
+
if (alreadyApplied) {
|
|
130
|
+
return {
|
|
131
|
+
relativePath: input.relativePath,
|
|
132
|
+
verdict: ThreeWayVerdict.ManualReview,
|
|
133
|
+
reasons: ['target changed since the patch was generated, but the append block is present'],
|
|
134
|
+
targetExists: true,
|
|
135
|
+
targetUnchanged: false,
|
|
136
|
+
alreadyApplied: true,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
// Case D: target changed but the file still ends with content (i.e. the
|
|
140
|
+
// file wasn't truncated to empty). For an append-only patch with a small
|
|
141
|
+
// context window, git apply may still work — call it "probably-safe".
|
|
142
|
+
if (body.trimEnd().length > 0) {
|
|
143
|
+
return {
|
|
144
|
+
relativePath: input.relativePath,
|
|
145
|
+
verdict: ThreeWayVerdict.ProbablySafe,
|
|
146
|
+
reasons: ['target changed since the patch was generated; review before applying'],
|
|
147
|
+
targetExists: true,
|
|
148
|
+
targetUnchanged: false,
|
|
149
|
+
alreadyApplied: false,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
// Case E: target became empty or unrecognisable.
|
|
153
|
+
return {
|
|
154
|
+
relativePath: input.relativePath,
|
|
155
|
+
verdict: ThreeWayVerdict.ManualReview,
|
|
156
|
+
reasons: ['target file is empty or unrecognisable — re-render patch'],
|
|
157
|
+
targetExists: true,
|
|
158
|
+
targetUnchanged: false,
|
|
159
|
+
alreadyApplied: false,
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
export function previewThreeWayBatch(projectRoot, targets, options = {}) {
|
|
163
|
+
const perTarget = targets.map((t) => previewThreeWay({
|
|
164
|
+
projectRoot,
|
|
165
|
+
relativePath: t.relativePath,
|
|
166
|
+
baseHash: t.hash,
|
|
167
|
+
...(options.draftsChanged ? { draftChangedSinceState: true } : {}),
|
|
168
|
+
}));
|
|
169
|
+
const summary = {
|
|
170
|
+
[ThreeWayVerdict.Safe]: 0,
|
|
171
|
+
[ThreeWayVerdict.ProbablySafe]: 0,
|
|
172
|
+
[ThreeWayVerdict.StaleTarget]: 0,
|
|
173
|
+
[ThreeWayVerdict.StaleDraft]: 0,
|
|
174
|
+
[ThreeWayVerdict.ManualReview]: 0,
|
|
175
|
+
[ThreeWayVerdict.CreateFileSafe]: 0,
|
|
176
|
+
[ThreeWayVerdict.Conflict]: 0,
|
|
177
|
+
};
|
|
178
|
+
for (const r of perTarget)
|
|
179
|
+
summary[r.verdict] += 1;
|
|
180
|
+
return { perTarget, summary };
|
|
181
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { type IImpactAnalysis } from './impact-analysis.js';
|
|
2
|
+
import { type ITaskRiskReport } from './task-risk.js';
|
|
3
|
+
import type { ISharkcraftInspection } from './sharkcraft-inspector.js';
|
|
4
|
+
export declare const AGENT_BRIEF_SCHEMA = "sharkcraft.agent-brief/v1";
|
|
5
|
+
export declare enum BriefMode {
|
|
6
|
+
Compact = "compact",
|
|
7
|
+
Full = "full",
|
|
8
|
+
Review = "review",
|
|
9
|
+
Implementation = "implementation",
|
|
10
|
+
Handoff = "handoff"
|
|
11
|
+
}
|
|
12
|
+
export interface IAgentBriefInput {
|
|
13
|
+
task?: string;
|
|
14
|
+
mode?: BriefMode;
|
|
15
|
+
files?: readonly string[];
|
|
16
|
+
since?: string;
|
|
17
|
+
staged?: boolean;
|
|
18
|
+
bundleId?: string;
|
|
19
|
+
sessionId?: string;
|
|
20
|
+
/** Optional path to a quality baseline JSON, for comparison. */
|
|
21
|
+
qualityBaselineFile?: string;
|
|
22
|
+
/** Cap on token-equivalent budget for the body. Default: 6000. */
|
|
23
|
+
maxTokens?: number;
|
|
24
|
+
/** When true, also produce chunked output via `chunks`. */
|
|
25
|
+
chunked?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Per-section budget (token-equivalent). Keys match section ids; values are
|
|
28
|
+
* max tokens. Unknown keys are ignored.
|
|
29
|
+
*/
|
|
30
|
+
sectionBudgets?: Record<string, number>;
|
|
31
|
+
}
|
|
32
|
+
export interface IAgentBriefSection {
|
|
33
|
+
id: string;
|
|
34
|
+
title: string;
|
|
35
|
+
body: string;
|
|
36
|
+
}
|
|
37
|
+
export interface IAgentBriefChunk {
|
|
38
|
+
/** Filename for the chunk (e.g. `01-task.md`). */
|
|
39
|
+
file: string;
|
|
40
|
+
/** Section id (matches IAgentBriefSection.id, or "index"). */
|
|
41
|
+
sectionId: string;
|
|
42
|
+
title: string;
|
|
43
|
+
body: string;
|
|
44
|
+
/** Token-equivalent estimate (chars/4). */
|
|
45
|
+
tokenEstimate: number;
|
|
46
|
+
}
|
|
47
|
+
export interface IAgentBrief {
|
|
48
|
+
schema: typeof AGENT_BRIEF_SCHEMA;
|
|
49
|
+
task: string;
|
|
50
|
+
mode: BriefMode;
|
|
51
|
+
generatedAt: string;
|
|
52
|
+
projectRoot: string;
|
|
53
|
+
sections: readonly IAgentBriefSection[];
|
|
54
|
+
/** Markdown serialization of the brief. */
|
|
55
|
+
markdown: string;
|
|
56
|
+
/** Top suggested next commands. */
|
|
57
|
+
suggestedCommands: readonly string[];
|
|
58
|
+
/** Optional impact summary if files/bundle/since produced one. */
|
|
59
|
+
impact?: IImpactAnalysis;
|
|
60
|
+
/** Per-task risk report when a task is provided. */
|
|
61
|
+
taskRisk?: ITaskRiskReport;
|
|
62
|
+
/** Source flags used to compute the brief. */
|
|
63
|
+
inputs: {
|
|
64
|
+
files: readonly string[];
|
|
65
|
+
since: string | null;
|
|
66
|
+
staged: boolean;
|
|
67
|
+
bundleId: string | null;
|
|
68
|
+
sessionId: string | null;
|
|
69
|
+
};
|
|
70
|
+
warnings: readonly string[];
|
|
71
|
+
/** Token-equivalent estimate (chars/4) for the full markdown body. */
|
|
72
|
+
totalTokenEstimate: number;
|
|
73
|
+
/** Chunked output when input.chunked is true. */
|
|
74
|
+
chunks?: readonly IAgentBriefChunk[];
|
|
75
|
+
}
|
|
76
|
+
export declare function buildAgentBrief(inspection: ISharkcraftInspection, input: IAgentBriefInput): Promise<IAgentBrief>;
|
|
77
|
+
//# sourceMappingURL=agent-brief.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-brief.d.ts","sourceRoot":"","sources":["../src/agent-brief.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAS3E,OAAO,EAAuB,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC3E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAEvE,eAAO,MAAM,kBAAkB,8BAA8B,CAAC;AAE9D,oBAAY,SAAS;IACnB,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,cAAc,mBAAmB;IACjC,OAAO,YAAY;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gEAAgE;IAChE,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACzC;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,gBAAgB;IAC/B,kDAAkD;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,8DAA8D;IAC9D,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,2CAA2C;IAC3C,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,OAAO,kBAAkB,CAAC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACxC,2CAA2C;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,mCAAmC;IACnC,iBAAiB,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,kEAAkE;IAClE,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,oDAAoD;IACpD,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,8CAA8C;IAC9C,MAAM,EAAE;QACN,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;QACzB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;QACrB,MAAM,EAAE,OAAO,CAAC;QAChB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;QACxB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;KAC1B,CAAC;IACF,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,sEAAsE;IACtE,kBAAkB,EAAE,MAAM,CAAC;IAC3B,iDAAiD;IACjD,MAAM,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAC;CACtC;AAmVD,wBAAsB,eAAe,CACnC,UAAU,EAAE,qBAAqB,EACjC,KAAK,EAAE,gBAAgB,GACtB,OAAO,CAAC,WAAW,CAAC,CAqItB"}
|