@shrkcrft/inspector 0.1.0-alpha.1
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 +57 -0
- package/dist/area-map.d.ts.map +1 -0
- package/dist/area-map.js +214 -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 +382 -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 +38 -0
- package/dist/git-helpers.d.ts.map +1 -0
- package/dist/git-helpers.js +173 -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 +422 -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 +224 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +234 -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-merge.d.ts +71 -0
- package/dist/onboarding-drafts-merge.d.ts.map +1 -0
- package/dist/onboarding-drafts-merge.js +174 -0
- package/dist/onboarding-drafts.d.ts +42 -0
- package/dist/onboarding-drafts.d.ts.map +1 -0
- package/dist/onboarding-drafts.js +268 -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 +73 -0
- package/dist/pack-symbol-compat.d.ts.map +1 -0
- package/dist/pack-symbol-compat.js +519 -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 +81 -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 +65 -0
|
@@ -0,0 +1,555 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent contract.
|
|
3
|
+
*
|
|
4
|
+
* Given a task, role, and mode, compose a deterministic safety contract
|
|
5
|
+
* combining existing systems (intent, task risk, impact, ownership,
|
|
6
|
+
* boundaries, policies, playbooks, constructs, templates, role views).
|
|
7
|
+
*
|
|
8
|
+
* Read-only. No model calls, no telemetry, no embeddings.
|
|
9
|
+
*/
|
|
10
|
+
import { classifyChangeIntent, ChangeIntentKind, } from "./change-intent.js";
|
|
11
|
+
import { buildTaskRiskReport, TaskRiskLevel, } from "./task-risk.js";
|
|
12
|
+
import { analyzeImpact, ImpactInputKind } from "./impact-analysis.js";
|
|
13
|
+
import { loadOwnershipRules, impactFor as ownershipImpactFor } from "./ownership.js";
|
|
14
|
+
import { listPlaybooks, recommendPlaybooks } from "./playbook-registry.js";
|
|
15
|
+
import { listConstructs, loadConstructs } from "./construct-registry.js";
|
|
16
|
+
import { RoleId } from "./role-views.js";
|
|
17
|
+
import { ContractFileRuleKind, ContractFileRuleSeverity, } from "./contract-file-rule.js";
|
|
18
|
+
export const AGENT_CONTRACT_SCHEMA = 'sharkcraft.agent-contract/v1';
|
|
19
|
+
export var AgentContractMode;
|
|
20
|
+
(function (AgentContractMode) {
|
|
21
|
+
AgentContractMode["Conservative"] = "conservative";
|
|
22
|
+
AgentContractMode["Balanced"] = "balanced";
|
|
23
|
+
AgentContractMode["Aggressive"] = "aggressive";
|
|
24
|
+
})(AgentContractMode || (AgentContractMode = {}));
|
|
25
|
+
const ROLE_FROM_STRING = new Map([
|
|
26
|
+
['developer', RoleId.Developer],
|
|
27
|
+
['reviewer', RoleId.Reviewer],
|
|
28
|
+
['architect', RoleId.Architect],
|
|
29
|
+
['release-manager', RoleId.ReleaseManager],
|
|
30
|
+
['release', RoleId.ReleaseManager],
|
|
31
|
+
['security', RoleId.Security],
|
|
32
|
+
['ai-agent', RoleId.AiAgent],
|
|
33
|
+
['ai', RoleId.AiAgent],
|
|
34
|
+
]);
|
|
35
|
+
function resolveRole(input) {
|
|
36
|
+
if (!input)
|
|
37
|
+
return RoleId.Developer;
|
|
38
|
+
const key = String(input).toLowerCase();
|
|
39
|
+
return ROLE_FROM_STRING.get(key) ?? RoleId.Developer;
|
|
40
|
+
}
|
|
41
|
+
function resolveMode(input) {
|
|
42
|
+
const v = String(input ?? '').toLowerCase();
|
|
43
|
+
if (v === 'conservative')
|
|
44
|
+
return AgentContractMode.Conservative;
|
|
45
|
+
if (v === 'aggressive')
|
|
46
|
+
return AgentContractMode.Aggressive;
|
|
47
|
+
return AgentContractMode.Balanced;
|
|
48
|
+
}
|
|
49
|
+
function uniq(xs) {
|
|
50
|
+
return [...new Set(xs)];
|
|
51
|
+
}
|
|
52
|
+
function isPublicApiPath(file) {
|
|
53
|
+
return (file.endsWith('/index.ts') ||
|
|
54
|
+
file.includes('plugin-api/') ||
|
|
55
|
+
file.includes('public-api/'));
|
|
56
|
+
}
|
|
57
|
+
function isAdapterPath(file) {
|
|
58
|
+
return file.includes('/adapters/') || file.includes('adapter');
|
|
59
|
+
}
|
|
60
|
+
function isReleaseTask(intent) {
|
|
61
|
+
return intent.kind === ChangeIntentKind.Release;
|
|
62
|
+
}
|
|
63
|
+
function isMigrationTask(intent) {
|
|
64
|
+
return intent.kind === ChangeIntentKind.Migration;
|
|
65
|
+
}
|
|
66
|
+
function buildBoundaryHints(impact, files) {
|
|
67
|
+
const out = [];
|
|
68
|
+
if (impact) {
|
|
69
|
+
for (const b of impact.potentialBoundaryRisks) {
|
|
70
|
+
out.push(`${b.ruleId} — ${b.reason}`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
for (const f of files) {
|
|
74
|
+
if (isAdapterPath(f))
|
|
75
|
+
out.push(`adapter boundary likely touched (${f})`);
|
|
76
|
+
}
|
|
77
|
+
return uniq(out).slice(0, 10);
|
|
78
|
+
}
|
|
79
|
+
function buildPolicyHints(impact) {
|
|
80
|
+
if (!impact)
|
|
81
|
+
return [];
|
|
82
|
+
return uniq(impact.affectedPolicies.map((p) => `${p.policyId} — ${p.reason}`)).slice(0, 10);
|
|
83
|
+
}
|
|
84
|
+
function buildLikelyTests(impact) {
|
|
85
|
+
if (!impact)
|
|
86
|
+
return [];
|
|
87
|
+
return uniq(impact.likelyTests).slice(0, 10);
|
|
88
|
+
}
|
|
89
|
+
function buildImpactedAreas(impact) {
|
|
90
|
+
if (!impact)
|
|
91
|
+
return [];
|
|
92
|
+
const set = new Set();
|
|
93
|
+
for (const a of impact.affectedAreas ?? [])
|
|
94
|
+
set.add(a.id);
|
|
95
|
+
return [...set].slice(0, 10);
|
|
96
|
+
}
|
|
97
|
+
function buildPublicApiRisks(intent, files, impact) {
|
|
98
|
+
const out = [];
|
|
99
|
+
const apiFiles = files.filter(isPublicApiPath);
|
|
100
|
+
for (const f of apiFiles)
|
|
101
|
+
out.push(`public API file touched: ${f}`);
|
|
102
|
+
if (intent.domains.includes('plugin') &&
|
|
103
|
+
(intent.kind === ChangeIntentKind.Architecture ||
|
|
104
|
+
intent.kind === ChangeIntentKind.Feature ||
|
|
105
|
+
intent.kind === ChangeIntentKind.Migration)) {
|
|
106
|
+
out.push('Plugin-api / public API may change — require API review.');
|
|
107
|
+
}
|
|
108
|
+
return uniq(out).slice(0, 10);
|
|
109
|
+
}
|
|
110
|
+
function buildOwnershipReview(impact) {
|
|
111
|
+
if (!impact)
|
|
112
|
+
return [];
|
|
113
|
+
const own = impact.affectedOwnership;
|
|
114
|
+
const out = [];
|
|
115
|
+
if (own && own.requiredReviewFiles.length > 0) {
|
|
116
|
+
for (const f of own.requiredReviewFiles)
|
|
117
|
+
out.push(f);
|
|
118
|
+
}
|
|
119
|
+
return uniq(out).slice(0, 10);
|
|
120
|
+
}
|
|
121
|
+
function buildForbiddenFiles(role, intent) {
|
|
122
|
+
const out = [];
|
|
123
|
+
// Releases and migrations: never auto-edit packaging or signature material.
|
|
124
|
+
if (isReleaseTask(intent)) {
|
|
125
|
+
out.push('package.json (do not bump version without explicit approval)');
|
|
126
|
+
out.push('CHANGELOG.md (release manager approval required)');
|
|
127
|
+
}
|
|
128
|
+
// AI agent must never write to git internals or release-affecting files.
|
|
129
|
+
if (role === RoleId.AiAgent) {
|
|
130
|
+
out.push('.git/**');
|
|
131
|
+
out.push('.npmrc');
|
|
132
|
+
out.push('package.json (do not modify without explicit human approval)');
|
|
133
|
+
}
|
|
134
|
+
return uniq(out);
|
|
135
|
+
}
|
|
136
|
+
function buildForbiddenFilesDetailed(role, intent) {
|
|
137
|
+
const out = [];
|
|
138
|
+
if (isReleaseTask(intent)) {
|
|
139
|
+
out.push({
|
|
140
|
+
pattern: 'package.json',
|
|
141
|
+
kind: ContractFileRuleKind.Exact,
|
|
142
|
+
reason: 'Release task: do not bump version without explicit approval.',
|
|
143
|
+
severity: ContractFileRuleSeverity.Error,
|
|
144
|
+
});
|
|
145
|
+
out.push({
|
|
146
|
+
pattern: 'CHANGELOG.md',
|
|
147
|
+
kind: ContractFileRuleKind.Exact,
|
|
148
|
+
reason: 'Release manager approval required.',
|
|
149
|
+
severity: ContractFileRuleSeverity.Error,
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
if (role === RoleId.AiAgent) {
|
|
153
|
+
out.push({
|
|
154
|
+
pattern: '.git/**',
|
|
155
|
+
kind: ContractFileRuleKind.Glob,
|
|
156
|
+
reason: 'Never write to git internals.',
|
|
157
|
+
severity: ContractFileRuleSeverity.Error,
|
|
158
|
+
});
|
|
159
|
+
out.push({
|
|
160
|
+
pattern: '.npmrc',
|
|
161
|
+
kind: ContractFileRuleKind.Exact,
|
|
162
|
+
reason: 'Registry credentials surface.',
|
|
163
|
+
severity: ContractFileRuleSeverity.Error,
|
|
164
|
+
});
|
|
165
|
+
out.push({
|
|
166
|
+
pattern: 'package.json',
|
|
167
|
+
kind: ContractFileRuleKind.Exact,
|
|
168
|
+
reason: 'AI agent must not modify without explicit human approval.',
|
|
169
|
+
severity: ContractFileRuleSeverity.Error,
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
return out;
|
|
173
|
+
}
|
|
174
|
+
function buildAllowedFilesDetailed(files, intent) {
|
|
175
|
+
const out = [];
|
|
176
|
+
for (const f of files) {
|
|
177
|
+
if (isPublicApiPath(f))
|
|
178
|
+
continue;
|
|
179
|
+
out.push({ pattern: f, kind: ContractFileRuleKind.Exact });
|
|
180
|
+
}
|
|
181
|
+
if (out.length === 0 && intent.likelyTemplates.length > 0) {
|
|
182
|
+
// Allow generated files under common template targets.
|
|
183
|
+
out.push({ pattern: 'packages/**', kind: ContractFileRuleKind.Glob });
|
|
184
|
+
}
|
|
185
|
+
return out;
|
|
186
|
+
}
|
|
187
|
+
function buildForbiddenCommands(role, intent) {
|
|
188
|
+
const out = [
|
|
189
|
+
'shrk apply <plan.json> --allow-divergent (without explicit human approval)',
|
|
190
|
+
];
|
|
191
|
+
if (isReleaseTask(intent) || isMigrationTask(intent)) {
|
|
192
|
+
out.push('git push --tags');
|
|
193
|
+
out.push('npm publish');
|
|
194
|
+
out.push('bun publish');
|
|
195
|
+
}
|
|
196
|
+
if (role === RoleId.AiAgent) {
|
|
197
|
+
out.push('Any MCP tool that writes (none exist; MCP is read-only).');
|
|
198
|
+
out.push('shrk apply (auto-apply without human in the loop)');
|
|
199
|
+
out.push('Pack-contributed verification commands (run via local CLI only).');
|
|
200
|
+
}
|
|
201
|
+
return uniq(out);
|
|
202
|
+
}
|
|
203
|
+
function buildAllowedCommands(role, intent) {
|
|
204
|
+
const t = JSON.stringify(intent.task || '<task>');
|
|
205
|
+
const out = [
|
|
206
|
+
`shrk brief ${t}`,
|
|
207
|
+
`shrk intent ${t}`,
|
|
208
|
+
`shrk risk ${t} --include-memory`,
|
|
209
|
+
`shrk impact --since main`,
|
|
210
|
+
'shrk check boundaries',
|
|
211
|
+
];
|
|
212
|
+
if (role === RoleId.AiAgent) {
|
|
213
|
+
out.push(`shrk handoff ${t}`);
|
|
214
|
+
out.push(`shrk orchestrate ${t} --mode conservative`);
|
|
215
|
+
out.push(`shrk agent graph ${t} --role ai-agent`);
|
|
216
|
+
}
|
|
217
|
+
if (role === RoleId.Reviewer || role === RoleId.Architect) {
|
|
218
|
+
out.push('shrk review packet --v3 --since main');
|
|
219
|
+
out.push('shrk owners impact --since main');
|
|
220
|
+
out.push('shrk policy run --explain-overrides');
|
|
221
|
+
}
|
|
222
|
+
if (role === RoleId.ReleaseManager) {
|
|
223
|
+
out.push('shrk release readiness --strict');
|
|
224
|
+
out.push('shrk release smoke --scenario all');
|
|
225
|
+
}
|
|
226
|
+
return uniq(out);
|
|
227
|
+
}
|
|
228
|
+
function buildRequiredValidations(intent, risk) {
|
|
229
|
+
const out = new Set();
|
|
230
|
+
out.add('bun x tsc -p tsconfig.base.json --noEmit');
|
|
231
|
+
out.add('bun test');
|
|
232
|
+
out.add('shrk doctor');
|
|
233
|
+
out.add('shrk check boundaries');
|
|
234
|
+
if (intent.kind === ChangeIntentKind.Architecture ||
|
|
235
|
+
intent.domains.includes('boundaries')) {
|
|
236
|
+
out.add('shrk architecture violations');
|
|
237
|
+
}
|
|
238
|
+
if (risk.riskLevel === TaskRiskLevel.High || risk.riskLevel === TaskRiskLevel.Critical) {
|
|
239
|
+
out.add('shrk policy run --explain-overrides');
|
|
240
|
+
out.add('shrk safety audit --deep');
|
|
241
|
+
}
|
|
242
|
+
if (isReleaseTask(intent)) {
|
|
243
|
+
out.add('bun run release:preflight');
|
|
244
|
+
out.add('shrk release readiness --strict');
|
|
245
|
+
}
|
|
246
|
+
if (isMigrationTask(intent)) {
|
|
247
|
+
out.add('shrk migration readiness');
|
|
248
|
+
}
|
|
249
|
+
return [...out];
|
|
250
|
+
}
|
|
251
|
+
function buildRequiredReviews(role, intent, risk, hasPublicApi, hasAdapter) {
|
|
252
|
+
const out = new Set();
|
|
253
|
+
if (risk.riskLevel === TaskRiskLevel.High ||
|
|
254
|
+
risk.riskLevel === TaskRiskLevel.Critical ||
|
|
255
|
+
intent.requiredHumanReview) {
|
|
256
|
+
out.add('human review (risk-driven)');
|
|
257
|
+
}
|
|
258
|
+
if (hasPublicApi)
|
|
259
|
+
out.add('API review (plugin-api / public-api change)');
|
|
260
|
+
if (hasAdapter)
|
|
261
|
+
out.add('adapter-boundary review');
|
|
262
|
+
if (role === RoleId.AiAgent) {
|
|
263
|
+
out.add('human in the loop — agent must NOT auto-apply');
|
|
264
|
+
}
|
|
265
|
+
return [...out];
|
|
266
|
+
}
|
|
267
|
+
function buildRequiredPlanReviews(intent) {
|
|
268
|
+
const lower = intent.task.toLowerCase();
|
|
269
|
+
const out = [];
|
|
270
|
+
if (lower.includes('plan') ||
|
|
271
|
+
lower.includes('update operation') ||
|
|
272
|
+
lower.includes('saved plan') ||
|
|
273
|
+
intent.kind === ChangeIntentKind.Migration) {
|
|
274
|
+
out.push('shrk plan review <plan.json>');
|
|
275
|
+
out.push('shrk plan simulate <plan.json> --include-boundaries --include-impact');
|
|
276
|
+
}
|
|
277
|
+
return out;
|
|
278
|
+
}
|
|
279
|
+
function buildHumanApprovalGates(role, intent, risk, hasPublicApi) {
|
|
280
|
+
const out = new Set();
|
|
281
|
+
if (risk.riskLevel === TaskRiskLevel.High ||
|
|
282
|
+
risk.riskLevel === TaskRiskLevel.Critical ||
|
|
283
|
+
intent.requiredHumanReview) {
|
|
284
|
+
out.add('Approve before apply (risk-driven).');
|
|
285
|
+
}
|
|
286
|
+
if (isReleaseTask(intent)) {
|
|
287
|
+
out.add('Approve before any publish / tag step.');
|
|
288
|
+
out.add('Approve preflight result before tagging.');
|
|
289
|
+
}
|
|
290
|
+
if (isMigrationTask(intent)) {
|
|
291
|
+
out.add('Approve migration readiness before applying.');
|
|
292
|
+
}
|
|
293
|
+
if (hasPublicApi)
|
|
294
|
+
out.add('Approve any public-API change explicitly.');
|
|
295
|
+
if (role === RoleId.AiAgent)
|
|
296
|
+
out.add('Human runs the apply step; agent never auto-applies.');
|
|
297
|
+
return [...out];
|
|
298
|
+
}
|
|
299
|
+
function buildRollbackPlan(intent) {
|
|
300
|
+
const out = [
|
|
301
|
+
'git restore -SW <changed files> (before commit)',
|
|
302
|
+
'git revert <commit-sha> (after commit)',
|
|
303
|
+
];
|
|
304
|
+
if (isReleaseTask(intent)) {
|
|
305
|
+
out.push('npm unpublish (within 72h) only with explicit authorization.');
|
|
306
|
+
out.push('Tag rollback: do not force-push; cut a follow-up release instead.');
|
|
307
|
+
}
|
|
308
|
+
return out;
|
|
309
|
+
}
|
|
310
|
+
function buildDefinitionOfDone(intent, validations) {
|
|
311
|
+
const out = [
|
|
312
|
+
'All listed validations pass.',
|
|
313
|
+
'No new boundary violations.',
|
|
314
|
+
'Plan was reviewed and applied via CLI (not MCP).',
|
|
315
|
+
];
|
|
316
|
+
if (intent.kind !== ChangeIntentKind.Docs) {
|
|
317
|
+
out.push('Tests cover new public surfaces.');
|
|
318
|
+
}
|
|
319
|
+
if (isReleaseTask(intent)) {
|
|
320
|
+
out.push('CHANGELOG entry exists; preflight is green.');
|
|
321
|
+
}
|
|
322
|
+
if (validations.includes('shrk migration readiness')) {
|
|
323
|
+
out.push('Migration readiness verdict is "ready".');
|
|
324
|
+
}
|
|
325
|
+
return out;
|
|
326
|
+
}
|
|
327
|
+
function buildAllowedFiles(files, intent) {
|
|
328
|
+
const out = [];
|
|
329
|
+
for (const f of files) {
|
|
330
|
+
if (isPublicApiPath(f))
|
|
331
|
+
continue;
|
|
332
|
+
out.push(f);
|
|
333
|
+
}
|
|
334
|
+
if (out.length === 0 && intent.likelyTemplates.length > 0) {
|
|
335
|
+
out.push('(target files derived from chosen template at gen time)');
|
|
336
|
+
}
|
|
337
|
+
return uniq(out);
|
|
338
|
+
}
|
|
339
|
+
function buildSafetyNotes(role, intent, risk) {
|
|
340
|
+
const out = [
|
|
341
|
+
'MCP is read-only — never call write-style MCP tools (none exist).',
|
|
342
|
+
'CLI is the only write path. Apply requires --verify-signature for signed plans.',
|
|
343
|
+
];
|
|
344
|
+
if (role === RoleId.AiAgent) {
|
|
345
|
+
out.push('Agent contract requires explicit human approval before apply.');
|
|
346
|
+
out.push('Always run shrk handoff / shrk brief before first action.');
|
|
347
|
+
}
|
|
348
|
+
if (risk.riskLevel === TaskRiskLevel.High || risk.riskLevel === TaskRiskLevel.Critical) {
|
|
349
|
+
out.push(`Risk level is ${risk.riskLevel} — extra approval required.`);
|
|
350
|
+
}
|
|
351
|
+
if (isReleaseTask(intent)) {
|
|
352
|
+
out.push('Release work must not auto-publish; preflight + readiness required.');
|
|
353
|
+
}
|
|
354
|
+
return out;
|
|
355
|
+
}
|
|
356
|
+
function buildRecommendedNextCommand(role, intent) {
|
|
357
|
+
const t = JSON.stringify(intent.task || '<task>');
|
|
358
|
+
if (role === RoleId.AiAgent)
|
|
359
|
+
return `shrk handoff ${t}`;
|
|
360
|
+
if (role === RoleId.ReleaseManager)
|
|
361
|
+
return 'shrk release readiness --strict';
|
|
362
|
+
if (role === RoleId.Security)
|
|
363
|
+
return 'shrk safety audit --deep';
|
|
364
|
+
if (role === RoleId.Architect)
|
|
365
|
+
return 'shrk architecture map --risk --signals';
|
|
366
|
+
if (role === RoleId.Reviewer)
|
|
367
|
+
return 'shrk review packet --v3 --since main';
|
|
368
|
+
return `shrk brief ${t}`;
|
|
369
|
+
}
|
|
370
|
+
export async function buildAgentContract(task, inspection, options = {}) {
|
|
371
|
+
const trimmed = (task || '').trim();
|
|
372
|
+
const role = resolveRole(options.role);
|
|
373
|
+
const mode = resolveMode(options.mode);
|
|
374
|
+
const intent = await classifyChangeIntent(trimmed, inspection);
|
|
375
|
+
const risk = await buildTaskRiskReport(trimmed, inspection, {
|
|
376
|
+
...(options.files ? { files: options.files } : {}),
|
|
377
|
+
...(options.since ? { since: options.since } : {}),
|
|
378
|
+
...(options.staged ? { staged: true } : {}),
|
|
379
|
+
includeMemory: true,
|
|
380
|
+
});
|
|
381
|
+
let impact = null;
|
|
382
|
+
try {
|
|
383
|
+
const impactInput = {
|
|
384
|
+
task: trimmed,
|
|
385
|
+
inputKind: (options.files && options.files.length > 0) ? ImpactInputKind.Files : ImpactInputKind.Task,
|
|
386
|
+
};
|
|
387
|
+
if (options.files && options.files.length > 0)
|
|
388
|
+
impactInput.files = options.files;
|
|
389
|
+
impact = await analyzeImpact(inspection, impactInput);
|
|
390
|
+
}
|
|
391
|
+
catch {
|
|
392
|
+
impact = null;
|
|
393
|
+
}
|
|
394
|
+
// Make sure ownership rules are loaded so risk.ownershipGaps has context.
|
|
395
|
+
try {
|
|
396
|
+
await loadOwnershipRules(inspection.projectRoot);
|
|
397
|
+
}
|
|
398
|
+
catch {
|
|
399
|
+
/* best-effort */
|
|
400
|
+
}
|
|
401
|
+
void ownershipImpactFor; // referenced for future direct calls
|
|
402
|
+
await loadConstructs(inspection);
|
|
403
|
+
const constructList = listConstructs(inspection) ?? [];
|
|
404
|
+
const playbooks = await listPlaybooks(inspection);
|
|
405
|
+
const recommended = recommendPlaybooks(playbooks, trimmed);
|
|
406
|
+
const files = options.files ?? risk.affectedFiles;
|
|
407
|
+
const hasAdapter = files.some(isAdapterPath);
|
|
408
|
+
const hasPublicApi = files.some(isPublicApiPath);
|
|
409
|
+
const allowedCommands = buildAllowedCommands(role, intent);
|
|
410
|
+
const forbiddenCommands = buildForbiddenCommands(role, intent);
|
|
411
|
+
const allowedFiles = buildAllowedFiles(files, intent);
|
|
412
|
+
const forbiddenFiles = buildForbiddenFiles(role, intent);
|
|
413
|
+
const allowedFilesDetailed = buildAllowedFilesDetailed(files, intent);
|
|
414
|
+
const forbiddenFilesDetailed = buildForbiddenFilesDetailed(role, intent);
|
|
415
|
+
const requiredValidations = buildRequiredValidations(intent, risk);
|
|
416
|
+
const requiredReviews = buildRequiredReviews(role, intent, risk, hasPublicApi, hasAdapter);
|
|
417
|
+
const requiredPlanReviews = buildRequiredPlanReviews(intent);
|
|
418
|
+
const humanApprovalGates = buildHumanApprovalGates(role, intent, risk, hasPublicApi);
|
|
419
|
+
const rollbackPlan = buildRollbackPlan(intent);
|
|
420
|
+
const definitionOfDone = buildDefinitionOfDone(intent, requiredValidations);
|
|
421
|
+
const safetyNotes = buildSafetyNotes(role, intent, risk);
|
|
422
|
+
const recommendedNextCommand = buildRecommendedNextCommand(role, intent);
|
|
423
|
+
const relevantConstructs = uniq([
|
|
424
|
+
...intent.likelyConstructs,
|
|
425
|
+
...risk.affectedConstructs,
|
|
426
|
+
...constructList
|
|
427
|
+
.filter((c) => trimmed.toLowerCase().includes(c.id.toLowerCase()))
|
|
428
|
+
.map((c) => c.id),
|
|
429
|
+
]).slice(0, 12);
|
|
430
|
+
const relevantPlaybooks = recommended.slice(0, 5).map((r) => r.playbook.id);
|
|
431
|
+
const relevantTemplates = intent.likelyTemplates.slice(0, 10);
|
|
432
|
+
const relevantPolicies = buildPolicyHints(impact);
|
|
433
|
+
const relevantBoundaries = buildBoundaryHints(impact, files);
|
|
434
|
+
const likelyTests = buildLikelyTests(impact);
|
|
435
|
+
const impactedAreas = buildImpactedAreas(impact);
|
|
436
|
+
const publicApiRisks = buildPublicApiRisks(intent, files, impact);
|
|
437
|
+
const ownershipReview = buildOwnershipReview(impact);
|
|
438
|
+
return {
|
|
439
|
+
schema: AGENT_CONTRACT_SCHEMA,
|
|
440
|
+
generatedAt: new Date().toISOString(),
|
|
441
|
+
task: trimmed,
|
|
442
|
+
intent,
|
|
443
|
+
taskRisk: risk,
|
|
444
|
+
role,
|
|
445
|
+
mode,
|
|
446
|
+
allowedFiles,
|
|
447
|
+
forbiddenFiles,
|
|
448
|
+
allowedFilesDetailed,
|
|
449
|
+
forbiddenFilesDetailed,
|
|
450
|
+
allowedCommands,
|
|
451
|
+
forbiddenCommands,
|
|
452
|
+
requiredValidations,
|
|
453
|
+
requiredReviews,
|
|
454
|
+
requiredPlanReviews,
|
|
455
|
+
humanApprovalGates,
|
|
456
|
+
rollbackPlan,
|
|
457
|
+
definitionOfDone,
|
|
458
|
+
relevantConstructs,
|
|
459
|
+
relevantPolicies,
|
|
460
|
+
relevantBoundaries,
|
|
461
|
+
relevantPlaybooks,
|
|
462
|
+
relevantTemplates,
|
|
463
|
+
likelyTests,
|
|
464
|
+
impactedAreas,
|
|
465
|
+
publicApiRisks,
|
|
466
|
+
ownershipReview,
|
|
467
|
+
recommendedNextCommand,
|
|
468
|
+
safetyNotes,
|
|
469
|
+
};
|
|
470
|
+
}
|
|
471
|
+
function listLines(title, items) {
|
|
472
|
+
if (items.length === 0)
|
|
473
|
+
return '';
|
|
474
|
+
return `${title}:\n${items.map((i) => ` • ${i}`).join('\n')}\n\n`;
|
|
475
|
+
}
|
|
476
|
+
export function renderAgentContractText(c) {
|
|
477
|
+
let out = `=== Agent contract ===\n`;
|
|
478
|
+
out += ` task ${c.task || '(empty)'}\n`;
|
|
479
|
+
out += ` intent ${c.intent.kind} / ${c.intent.confidence}\n`;
|
|
480
|
+
out += ` role ${c.role}\n`;
|
|
481
|
+
out += ` mode ${c.mode}\n`;
|
|
482
|
+
out += ` risk ${c.taskRisk.riskLevel} (score ${c.taskRisk.score})\n`;
|
|
483
|
+
out += ` approval ${c.taskRisk.humanApprovalRequired ? 'REQUIRED' : 'not required by risk gate'}\n\n`;
|
|
484
|
+
out += listLines('Allowed files', c.allowedFiles);
|
|
485
|
+
out += listLines('Forbidden files', c.forbiddenFiles);
|
|
486
|
+
out += listLines('Allowed commands', c.allowedCommands);
|
|
487
|
+
out += listLines('Forbidden commands', c.forbiddenCommands);
|
|
488
|
+
out += listLines('Required validations', c.requiredValidations);
|
|
489
|
+
out += listLines('Required reviews', c.requiredReviews);
|
|
490
|
+
out += listLines('Required plan reviews', c.requiredPlanReviews);
|
|
491
|
+
out += listLines('Human approval gates', c.humanApprovalGates);
|
|
492
|
+
out += listLines('Rollback plan', c.rollbackPlan);
|
|
493
|
+
out += listLines('Definition of done', c.definitionOfDone);
|
|
494
|
+
out += listLines('Relevant constructs', c.relevantConstructs);
|
|
495
|
+
out += listLines('Relevant policies', c.relevantPolicies);
|
|
496
|
+
out += listLines('Relevant boundaries', c.relevantBoundaries);
|
|
497
|
+
out += listLines('Relevant playbooks', c.relevantPlaybooks);
|
|
498
|
+
out += listLines('Relevant templates', c.relevantTemplates);
|
|
499
|
+
out += listLines('Likely tests', c.likelyTests);
|
|
500
|
+
out += listLines('Impacted areas', c.impactedAreas);
|
|
501
|
+
out += listLines('Public API risks', c.publicApiRisks);
|
|
502
|
+
out += listLines('Ownership review', c.ownershipReview);
|
|
503
|
+
out += listLines('Safety notes', c.safetyNotes);
|
|
504
|
+
out += `Recommended next command:\n $ ${c.recommendedNextCommand}\n`;
|
|
505
|
+
return out;
|
|
506
|
+
}
|
|
507
|
+
function mdList(title, items) {
|
|
508
|
+
if (items.length === 0)
|
|
509
|
+
return '';
|
|
510
|
+
return `## ${title}\n${items.map((i) => `- ${i}`).join('\n')}\n\n`;
|
|
511
|
+
}
|
|
512
|
+
export function renderAgentContractMarkdown(c) {
|
|
513
|
+
let out = `# Agent contract\n\n`;
|
|
514
|
+
out += `- **task**: ${c.task || '(empty)'}\n`;
|
|
515
|
+
out += `- **intent**: ${c.intent.kind} (${c.intent.confidence})\n`;
|
|
516
|
+
out += `- **role**: ${c.role}\n`;
|
|
517
|
+
out += `- **mode**: ${c.mode}\n`;
|
|
518
|
+
out += `- **risk**: ${c.taskRisk.riskLevel} (score ${c.taskRisk.score})\n`;
|
|
519
|
+
out += `- **approval**: ${c.taskRisk.humanApprovalRequired ? 'REQUIRED' : 'not required by risk gate'}\n`;
|
|
520
|
+
out += `- **generated**: ${c.generatedAt}\n\n`;
|
|
521
|
+
out += mdList('Allowed files', c.allowedFiles);
|
|
522
|
+
out += mdList('Forbidden files', c.forbiddenFiles);
|
|
523
|
+
out += mdList('Allowed commands', c.allowedCommands);
|
|
524
|
+
out += mdList('Forbidden commands', c.forbiddenCommands);
|
|
525
|
+
out += mdList('Required validations', c.requiredValidations);
|
|
526
|
+
out += mdList('Required reviews', c.requiredReviews);
|
|
527
|
+
out += mdList('Required plan reviews', c.requiredPlanReviews);
|
|
528
|
+
out += mdList('Human approval gates', c.humanApprovalGates);
|
|
529
|
+
out += mdList('Rollback plan', c.rollbackPlan);
|
|
530
|
+
out += mdList('Definition of done', c.definitionOfDone);
|
|
531
|
+
out += mdList('Relevant constructs', c.relevantConstructs);
|
|
532
|
+
out += mdList('Relevant policies', c.relevantPolicies);
|
|
533
|
+
out += mdList('Relevant boundaries', c.relevantBoundaries);
|
|
534
|
+
out += mdList('Relevant playbooks', c.relevantPlaybooks);
|
|
535
|
+
out += mdList('Relevant templates', c.relevantTemplates);
|
|
536
|
+
out += mdList('Likely tests', c.likelyTests);
|
|
537
|
+
out += mdList('Impacted areas', c.impactedAreas);
|
|
538
|
+
out += mdList('Public API risks', c.publicApiRisks);
|
|
539
|
+
out += mdList('Ownership review', c.ownershipReview);
|
|
540
|
+
out += mdList('Safety notes', c.safetyNotes);
|
|
541
|
+
out += `**Recommended next command**: \`${c.recommendedNextCommand}\`\n`;
|
|
542
|
+
return out;
|
|
543
|
+
}
|
|
544
|
+
function htmlEscape(s) {
|
|
545
|
+
return s
|
|
546
|
+
.replace(/&/g, '&')
|
|
547
|
+
.replace(/</g, '<')
|
|
548
|
+
.replace(/>/g, '>')
|
|
549
|
+
.replace(/"/g, '"')
|
|
550
|
+
.replace(/'/g, ''');
|
|
551
|
+
}
|
|
552
|
+
export function renderAgentContractHtml(c) {
|
|
553
|
+
const md = renderAgentContractMarkdown(c);
|
|
554
|
+
return `<!doctype html><html><head><meta charset="utf-8"><title>Agent contract</title></head><body><pre>${htmlEscape(md)}</pre></body></html>\n`;
|
|
555
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent handoff packet.
|
|
3
|
+
*
|
|
4
|
+
* `brief` is the *pre-work* context for an agent. `handoff` is the
|
|
5
|
+
* *continue-from-here* context: it captures current task status, what was
|
|
6
|
+
* already done, what remains, and the single next safe command — so a
|
|
7
|
+
* different agent (or the same agent after a context reset) can pick up
|
|
8
|
+
* without redoing discovery.
|
|
9
|
+
*
|
|
10
|
+
* Read-only. Sources state from:
|
|
11
|
+
* - a passed-in task string + inspection
|
|
12
|
+
* - an existing dev session (sessionId)
|
|
13
|
+
* - an existing feature bundle (bundleId)
|
|
14
|
+
* - optionally a git ref (`since`) for changed-files surfacing
|
|
15
|
+
*
|
|
16
|
+
* Never writes (the CLI write step is the caller's responsibility).
|
|
17
|
+
*/
|
|
18
|
+
import { type ITaskRiskReport } from './task-risk.js';
|
|
19
|
+
import { type IAgentContract } from './agent-contract.js';
|
|
20
|
+
import { type ITaskExecutionGraph } from './execution-graph.js';
|
|
21
|
+
import { type IPlanSimulationReport } from './plan-simulation.js';
|
|
22
|
+
import { type IMemoryRiskReport } from './repo-memory.js';
|
|
23
|
+
import { type IUncertaintyReport } from './uncertainty-report.js';
|
|
24
|
+
import type { ISharkcraftInspection } from './sharkcraft-inspector.js';
|
|
25
|
+
export declare const AGENT_HANDOFF_SCHEMA = "sharkcraft.agent-handoff/v1";
|
|
26
|
+
export interface IAgentHandoffInput {
|
|
27
|
+
task?: string;
|
|
28
|
+
/** Existing dev session to continue. */
|
|
29
|
+
sessionId?: string;
|
|
30
|
+
/** Existing feature bundle to continue. */
|
|
31
|
+
bundleId?: string;
|
|
32
|
+
/** Git ref to surface "since this point" changed files. */
|
|
33
|
+
since?: string;
|
|
34
|
+
/** Generate chunked output. */
|
|
35
|
+
chunked?: boolean;
|
|
36
|
+
/** Output destination filename (chunks live in the same dir if chunked). */
|
|
37
|
+
output?: string;
|
|
38
|
+
/** Fold an agent contract summary into the handoff. */
|
|
39
|
+
includeContract?: boolean;
|
|
40
|
+
/** Include the same pre-work brief content (matches `shrk brief`). */
|
|
41
|
+
includeBrief?: boolean;
|
|
42
|
+
/** Include a summary of the task execution graph. */
|
|
43
|
+
includeExecutionGraph?: boolean;
|
|
44
|
+
/** Include memory-driven warnings. */
|
|
45
|
+
includeMemory?: boolean;
|
|
46
|
+
/** Include plan simulation summary when a plan path is supplied. */
|
|
47
|
+
includePlanSimulation?: string;
|
|
48
|
+
/** Role for contract/handoff personalisation. */
|
|
49
|
+
role?: string;
|
|
50
|
+
/** Mode for contract personalisation. */
|
|
51
|
+
mode?: string;
|
|
52
|
+
}
|
|
53
|
+
export interface IAgentHandoffChunk {
|
|
54
|
+
file: string;
|
|
55
|
+
sectionId: string;
|
|
56
|
+
title: string;
|
|
57
|
+
body: string;
|
|
58
|
+
tokenEstimate: number;
|
|
59
|
+
}
|
|
60
|
+
export interface IAgentHandoffReport {
|
|
61
|
+
schema: typeof AGENT_HANDOFF_SCHEMA;
|
|
62
|
+
generatedAt: string;
|
|
63
|
+
projectRoot: string;
|
|
64
|
+
task: string;
|
|
65
|
+
knownContext: readonly string[];
|
|
66
|
+
doNotTouch: readonly string[];
|
|
67
|
+
relevantFiles: readonly string[];
|
|
68
|
+
relevantRules: readonly string[];
|
|
69
|
+
currentStatus: string;
|
|
70
|
+
nextSafeCommand: string;
|
|
71
|
+
validationExpectations: readonly string[];
|
|
72
|
+
humanApprovalPoints: readonly string[];
|
|
73
|
+
availableArtifacts: readonly {
|
|
74
|
+
kind: string;
|
|
75
|
+
path: string;
|
|
76
|
+
}[];
|
|
77
|
+
safetyNote: string;
|
|
78
|
+
markdown: string;
|
|
79
|
+
chunks?: readonly IAgentHandoffChunk[];
|
|
80
|
+
/** Per-task risk summary (best-effort; only when a task is provided). */
|
|
81
|
+
taskRiskSummary?: {
|
|
82
|
+
level: string;
|
|
83
|
+
score: number;
|
|
84
|
+
reasons: readonly string[];
|
|
85
|
+
};
|
|
86
|
+
/** Full task-risk report (when --include-memory/--include-contract drove memory-weighted risk). */
|
|
87
|
+
taskRisk?: ITaskRiskReport;
|
|
88
|
+
/** Full agent contract when --include-contract was set. */
|
|
89
|
+
contract?: IAgentContract;
|
|
90
|
+
/** Short contract summary text. */
|
|
91
|
+
contractSummary?: {
|
|
92
|
+
role: string;
|
|
93
|
+
mode: string;
|
|
94
|
+
forbiddenCommands: readonly string[];
|
|
95
|
+
requiredValidations: readonly string[];
|
|
96
|
+
requiredReviews: readonly string[];
|
|
97
|
+
humanApprovalGates: readonly string[];
|
|
98
|
+
recommendedNextCommand: string;
|
|
99
|
+
contractHash: string;
|
|
100
|
+
};
|
|
101
|
+
/** Execution graph (full) when --include-execution-graph. */
|
|
102
|
+
executionGraph?: ITaskExecutionGraph;
|
|
103
|
+
/** Short execution graph summary. */
|
|
104
|
+
executionGraphSummary?: {
|
|
105
|
+
nodes: number;
|
|
106
|
+
edges: number;
|
|
107
|
+
humanApprovalNodes: readonly string[];
|
|
108
|
+
};
|
|
109
|
+
/** Plan simulation when --include-plan-simulation <plan.json>. */
|
|
110
|
+
planSimulation?: IPlanSimulationReport;
|
|
111
|
+
/** Memory-derived risk (when --include-memory and an index exists). */
|
|
112
|
+
memoryRisk?: IMemoryRiskReport;
|
|
113
|
+
source: {
|
|
114
|
+
kind: 'task-only' | 'session' | 'bundle' | 'session+bundle';
|
|
115
|
+
sessionId?: string;
|
|
116
|
+
bundleId?: string;
|
|
117
|
+
};
|
|
118
|
+
/** Uncertainty report (confidence + signals + safe fallback). */
|
|
119
|
+
uncertainty?: IUncertaintyReport;
|
|
120
|
+
}
|
|
121
|
+
export declare function buildAgentHandoff(inspection: ISharkcraftInspection, input: IAgentHandoffInput): Promise<IAgentHandoffReport>;
|
|
122
|
+
export declare function defaultHandoffOutputPath(projectRoot: string, task: string): string;
|
|
123
|
+
//# sourceMappingURL=agent-handoff.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-handoff.d.ts","sourceRoot":"","sources":["../src/agent-handoff.ts"],"names":[],"mappings":"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"}
|