@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,490 @@
|
|
|
1
|
+
import { analyzeImpact } from "./impact-analysis.js";
|
|
2
|
+
import { buildCoverageReport } from "./coverage-report.js";
|
|
3
|
+
import { buildDriftReport } from "./drift.js";
|
|
4
|
+
import { buildTaskPacket } from "./task-packet.js";
|
|
5
|
+
import { compareQualityBaseline } from "./quality-baseline.js";
|
|
6
|
+
import { listConstructs, loadConstructs } from "./construct-registry.js";
|
|
7
|
+
import { listPlaybooks, loadPlaybooks, recommendPlaybooks } from "./playbook-registry.js";
|
|
8
|
+
import { scanDevSession } from "./dev-session.js";
|
|
9
|
+
import { readFeatureBundle } from "./feature-bundle.js";
|
|
10
|
+
import { buildTaskRiskReport } from "./task-risk.js";
|
|
11
|
+
export const AGENT_BRIEF_SCHEMA = 'sharkcraft.agent-brief/v1';
|
|
12
|
+
export var BriefMode;
|
|
13
|
+
(function (BriefMode) {
|
|
14
|
+
BriefMode["Compact"] = "compact";
|
|
15
|
+
BriefMode["Full"] = "full";
|
|
16
|
+
BriefMode["Review"] = "review";
|
|
17
|
+
BriefMode["Implementation"] = "implementation";
|
|
18
|
+
BriefMode["Handoff"] = "handoff";
|
|
19
|
+
})(BriefMode || (BriefMode = {}));
|
|
20
|
+
const SAFETY_NOTE = 'MCP is read-only. Use CLI for writes. Apply requires explicit human action.';
|
|
21
|
+
function inferMode(input) {
|
|
22
|
+
if (input.mode)
|
|
23
|
+
return input.mode;
|
|
24
|
+
const taskGiven = (input.task ?? '').trim().length > 0;
|
|
25
|
+
const hasDiff = Boolean(input.since || input.staged || (input.files && input.files.length > 0));
|
|
26
|
+
if (input.sessionId && !taskGiven)
|
|
27
|
+
return BriefMode.Handoff;
|
|
28
|
+
if (input.bundleId && !taskGiven)
|
|
29
|
+
return BriefMode.Handoff;
|
|
30
|
+
if (hasDiff && !taskGiven)
|
|
31
|
+
return BriefMode.Review;
|
|
32
|
+
return BriefMode.Implementation;
|
|
33
|
+
}
|
|
34
|
+
function clipMarkdown(md, maxTokens) {
|
|
35
|
+
// Rough token estimate: 4 chars per token.
|
|
36
|
+
const maxChars = maxTokens * 4;
|
|
37
|
+
if (md.length <= maxChars)
|
|
38
|
+
return md;
|
|
39
|
+
return md.slice(0, maxChars) + '\n\n_…truncated to respect maxTokens budget_\n';
|
|
40
|
+
}
|
|
41
|
+
function tokenEstimate(s) {
|
|
42
|
+
return Math.ceil(s.length / 4);
|
|
43
|
+
}
|
|
44
|
+
function trimSectionBody(body, maxTokens) {
|
|
45
|
+
const maxChars = Math.max(40, maxTokens * 4);
|
|
46
|
+
if (body.length <= maxChars)
|
|
47
|
+
return body;
|
|
48
|
+
return body.slice(0, maxChars) + '\n\n_…section trimmed to respect section-budget._';
|
|
49
|
+
}
|
|
50
|
+
/** Chunk index ordering for stable file naming. */
|
|
51
|
+
const SECTION_ORDER = [
|
|
52
|
+
'task',
|
|
53
|
+
'project-overview',
|
|
54
|
+
'rules',
|
|
55
|
+
'paths',
|
|
56
|
+
'templates',
|
|
57
|
+
'pipeline',
|
|
58
|
+
'action-hints',
|
|
59
|
+
'forbidden',
|
|
60
|
+
'impact',
|
|
61
|
+
'boundary',
|
|
62
|
+
'policy',
|
|
63
|
+
'ownership',
|
|
64
|
+
'coverage',
|
|
65
|
+
'drift',
|
|
66
|
+
'quality',
|
|
67
|
+
'bundle',
|
|
68
|
+
'session',
|
|
69
|
+
'playbooks',
|
|
70
|
+
'constructs',
|
|
71
|
+
'suggested-commands',
|
|
72
|
+
'safety',
|
|
73
|
+
];
|
|
74
|
+
async function gatherImpact(inspection, input) {
|
|
75
|
+
const files = [...(input.files ?? [])];
|
|
76
|
+
const planTargets = [];
|
|
77
|
+
if (input.bundleId) {
|
|
78
|
+
const b = readFeatureBundle(inspection.projectRoot, input.bundleId);
|
|
79
|
+
if (b) {
|
|
80
|
+
for (const f of b.affectedFiles)
|
|
81
|
+
files.push(f);
|
|
82
|
+
for (const p of b.plans)
|
|
83
|
+
for (const t of p.expectedTargets)
|
|
84
|
+
planTargets.push(t);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
if (files.length === 0 && planTargets.length === 0 && !input.task)
|
|
88
|
+
return null;
|
|
89
|
+
return analyzeImpact(inspection, {
|
|
90
|
+
...(input.task ? { task: input.task } : {}),
|
|
91
|
+
files,
|
|
92
|
+
planTargets,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
function section(id, title, body) {
|
|
96
|
+
return { id, title, body };
|
|
97
|
+
}
|
|
98
|
+
function projectOverviewSection(inspection) {
|
|
99
|
+
const ws = inspection.workspace;
|
|
100
|
+
const lines = [];
|
|
101
|
+
lines.push(`- **Name:** ${ws.packageName ?? '(unknown)'}`);
|
|
102
|
+
const frameworks = (ws.frameworks ?? [])
|
|
103
|
+
.map((f) => (typeof f === 'string' ? f : f.id ?? f.name ?? ''))
|
|
104
|
+
.filter(Boolean);
|
|
105
|
+
lines.push(`- **Frameworks:** ${frameworks.join(', ') || '(none detected)'}`);
|
|
106
|
+
lines.push(`- **TypeScript:** ${ws.hasTypeScript ? 'yes' : 'no'}`);
|
|
107
|
+
const pmRaw = ws.packageManager;
|
|
108
|
+
const pm = typeof pmRaw === 'string'
|
|
109
|
+
? pmRaw
|
|
110
|
+
: pmRaw?.name ?? '(unknown)';
|
|
111
|
+
lines.push(`- **Package manager:** ${pm}`);
|
|
112
|
+
const packs = inspection.packs.validPacks ?? [];
|
|
113
|
+
lines.push(`- **Packs:** ${packs.length > 0 ? packs.map((p) => p.packageName).join(', ') : '(none)'}`);
|
|
114
|
+
return section('project-overview', 'Project overview', lines.join('\n'));
|
|
115
|
+
}
|
|
116
|
+
function rulesSection(packet, limit) {
|
|
117
|
+
const lines = [];
|
|
118
|
+
for (const r of packet.relevantRules.slice(0, limit)) {
|
|
119
|
+
lines.push(`- **${r.id}**${r.title ? ` — ${r.title}` : ''}`);
|
|
120
|
+
}
|
|
121
|
+
if (lines.length === 0)
|
|
122
|
+
lines.push('_No directly relevant rules._');
|
|
123
|
+
return section('rules', 'Relevant rules', lines.join('\n'));
|
|
124
|
+
}
|
|
125
|
+
function pathsSection(packet, limit) {
|
|
126
|
+
const lines = [];
|
|
127
|
+
for (const p of packet.relevantPaths.slice(0, limit)) {
|
|
128
|
+
lines.push(`- \`${p.id}\` ${p.title ? `— ${p.title}` : ''}`);
|
|
129
|
+
}
|
|
130
|
+
if (lines.length === 0)
|
|
131
|
+
lines.push('_No path conventions matched._');
|
|
132
|
+
return section('paths', 'Path conventions', lines.join('\n'));
|
|
133
|
+
}
|
|
134
|
+
function templatesSection(packet, limit) {
|
|
135
|
+
const lines = [];
|
|
136
|
+
for (const t of packet.relevantTemplates.slice(0, limit)) {
|
|
137
|
+
lines.push(`- \`${t.id}\` — ${t.name ?? ''}`);
|
|
138
|
+
}
|
|
139
|
+
if (lines.length === 0)
|
|
140
|
+
lines.push('_No templates matched._');
|
|
141
|
+
return section('templates', 'Templates', lines.join('\n'));
|
|
142
|
+
}
|
|
143
|
+
function pipelineSection(packet) {
|
|
144
|
+
const top = packet.recommendedPipelines[0];
|
|
145
|
+
if (!top)
|
|
146
|
+
return section('pipeline', 'Recommended pipeline', '_None recommended._');
|
|
147
|
+
return section('pipeline', 'Recommended pipeline', `\`${top.pipelineId}\` — ${top.reason ?? 'best match by task ranker'}`);
|
|
148
|
+
}
|
|
149
|
+
function actionHintsSection(packet) {
|
|
150
|
+
const lines = [];
|
|
151
|
+
const h = packet.actionHints;
|
|
152
|
+
if (h.commands.length > 0) {
|
|
153
|
+
lines.push('**Commands:**');
|
|
154
|
+
for (const c of h.commands.slice(0, 5))
|
|
155
|
+
lines.push(`- \`${c}\``);
|
|
156
|
+
}
|
|
157
|
+
if (h.mcpTools.length > 0) {
|
|
158
|
+
lines.push('**MCP tools:**');
|
|
159
|
+
for (const m of h.mcpTools.slice(0, 5))
|
|
160
|
+
lines.push(`- \`${m}\``);
|
|
161
|
+
}
|
|
162
|
+
if (h.verificationCommands.length > 0) {
|
|
163
|
+
lines.push('**Verification:**');
|
|
164
|
+
for (const v of h.verificationCommands.slice(0, 5))
|
|
165
|
+
lines.push(`- \`${v}\``);
|
|
166
|
+
}
|
|
167
|
+
if (lines.length === 0)
|
|
168
|
+
lines.push('_No action hints surfaced._');
|
|
169
|
+
return section('action-hints', 'Action hints', lines.join('\n'));
|
|
170
|
+
}
|
|
171
|
+
function forbiddenSection(packet) {
|
|
172
|
+
const lines = [];
|
|
173
|
+
if (packet.forbiddenActions.length === 0)
|
|
174
|
+
lines.push('_None._');
|
|
175
|
+
else
|
|
176
|
+
for (const f of packet.forbiddenActions.slice(0, 12))
|
|
177
|
+
lines.push(`- ${f}`);
|
|
178
|
+
return section('forbidden', 'Forbidden actions', lines.join('\n'));
|
|
179
|
+
}
|
|
180
|
+
function safetySection() {
|
|
181
|
+
return section('safety', 'Safety', SAFETY_NOTE);
|
|
182
|
+
}
|
|
183
|
+
function impactSection(impact) {
|
|
184
|
+
if (!impact)
|
|
185
|
+
return section('impact', 'Impact', '_No impact analysis available._');
|
|
186
|
+
const lines = [];
|
|
187
|
+
lines.push(`- **Risk:** ${impact.risk}`);
|
|
188
|
+
lines.push(`- **Direct dependents:** ${impact.directDependents.length}`);
|
|
189
|
+
lines.push(`- **Transitive dependents:** ${impact.transitiveDependents.length}`);
|
|
190
|
+
lines.push(`- **Areas:** ${impact.affectedAreas.map((a) => a.id).slice(0, 4).join(', ') || '(none)'}`);
|
|
191
|
+
if (impact.affectedTemplates.length > 0)
|
|
192
|
+
lines.push(`- **Templates:** ${impact.affectedTemplates.map((t) => t.id).join(', ')}`);
|
|
193
|
+
if (impact.affectedConstructs.length > 0)
|
|
194
|
+
lines.push(`- **Constructs:** ${impact.affectedConstructs.map((c) => c.id).join(', ')}`);
|
|
195
|
+
for (const r of impact.riskReasons.slice(0, 4))
|
|
196
|
+
lines.push(` • ${r.code}: ${r.message}`);
|
|
197
|
+
return section('impact', 'Impact', lines.join('\n'));
|
|
198
|
+
}
|
|
199
|
+
function ownershipSection(impact) {
|
|
200
|
+
if (!impact?.affectedOwnership) {
|
|
201
|
+
return section('ownership', 'Ownership', '_No ownership data._');
|
|
202
|
+
}
|
|
203
|
+
const o = impact.affectedOwnership;
|
|
204
|
+
const lines = [];
|
|
205
|
+
if (o.owners.length > 0)
|
|
206
|
+
lines.push(`- **Owners:** ${o.owners.join(', ')}`);
|
|
207
|
+
if (o.reviewers.length > 0)
|
|
208
|
+
lines.push(`- **Reviewers:** ${o.reviewers.join(', ')}`);
|
|
209
|
+
if (o.requiredReviewFiles.length > 0) {
|
|
210
|
+
lines.push(`- **Required review** on: ${o.requiredReviewFiles.slice(0, 5).join(', ')}`);
|
|
211
|
+
}
|
|
212
|
+
if (lines.length === 0)
|
|
213
|
+
lines.push('_No ownership matches._');
|
|
214
|
+
return section('ownership', 'Ownership', lines.join('\n'));
|
|
215
|
+
}
|
|
216
|
+
function policySection(impact) {
|
|
217
|
+
if (!impact || impact.affectedPolicies.length === 0) {
|
|
218
|
+
return section('policy', 'Policy concerns', '_None detected._');
|
|
219
|
+
}
|
|
220
|
+
const lines = [];
|
|
221
|
+
for (const p of impact.affectedPolicies) {
|
|
222
|
+
lines.push(`- [${p.severity}] **${p.policyId}** — ${p.reason}`);
|
|
223
|
+
}
|
|
224
|
+
return section('policy', 'Policy concerns', lines.join('\n'));
|
|
225
|
+
}
|
|
226
|
+
function boundarySection(impact) {
|
|
227
|
+
if (!impact || impact.potentialBoundaryRisks.length === 0) {
|
|
228
|
+
return section('boundary', 'Boundary concerns', '_None detected._');
|
|
229
|
+
}
|
|
230
|
+
const lines = [];
|
|
231
|
+
for (const b of impact.potentialBoundaryRisks.slice(0, 6)) {
|
|
232
|
+
lines.push(`- [${b.severity}] \`${b.ruleId}\` — ${b.reason}`);
|
|
233
|
+
}
|
|
234
|
+
return section('boundary', 'Boundary concerns', lines.join('\n'));
|
|
235
|
+
}
|
|
236
|
+
function suggestedCommandsSection(impact, packet) {
|
|
237
|
+
const lines = [];
|
|
238
|
+
const commands = new Set();
|
|
239
|
+
for (const c of impact?.suggestedTestCommands ?? [])
|
|
240
|
+
commands.add(c);
|
|
241
|
+
for (const c of impact?.suggestedValidationCommands ?? [])
|
|
242
|
+
commands.add(c);
|
|
243
|
+
for (const c of packet.recommendedCliCommands ?? [])
|
|
244
|
+
commands.add(c);
|
|
245
|
+
for (const c of [...commands].slice(0, 10))
|
|
246
|
+
lines.push(`- \`${c}\``);
|
|
247
|
+
return {
|
|
248
|
+
section: section('suggested-commands', 'Suggested commands', lines.join('\n') || '_None._'),
|
|
249
|
+
commands: [...commands],
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
async function bundleHandoffSection(inspection, bundleId) {
|
|
253
|
+
const b = readFeatureBundle(inspection.projectRoot, bundleId);
|
|
254
|
+
if (!b)
|
|
255
|
+
return section('bundle', 'Bundle handoff', `_Bundle "${bundleId}" not found._`);
|
|
256
|
+
const lines = [];
|
|
257
|
+
lines.push(`- **Bundle:** ${b.id}`);
|
|
258
|
+
lines.push(`- **Status:** ${b.status}`);
|
|
259
|
+
lines.push(`- **Risk:** ${b.riskLevel}`);
|
|
260
|
+
lines.push(`- **Plans:** ${b.plans.length}`);
|
|
261
|
+
lines.push(`- **Validations:** ${b.validations.length}`);
|
|
262
|
+
lines.push(`- **Next:** ${b.nextAction ?? '(none)'}`);
|
|
263
|
+
return section('bundle', 'Bundle handoff', lines.join('\n'));
|
|
264
|
+
}
|
|
265
|
+
async function sessionHandoffSection(inspection, sessionId) {
|
|
266
|
+
const load = scanDevSession(inspection.projectRoot, sessionId);
|
|
267
|
+
if (!load)
|
|
268
|
+
return section('session', 'Session handoff', `_Session "${sessionId}" not found._`);
|
|
269
|
+
const state = load.state;
|
|
270
|
+
const lines = [];
|
|
271
|
+
lines.push(`- **Session:** ${load.id}`);
|
|
272
|
+
lines.push(`- **Task:** ${load.task || '(none)'}`);
|
|
273
|
+
lines.push(`- **Phase:** ${state?.phase ?? '(legacy)'}`);
|
|
274
|
+
lines.push(`- **Plans:** ${state?.plans.length ?? 0}`);
|
|
275
|
+
lines.push(`- **Applied:** ${state?.appliedPlans.length ?? 0}`);
|
|
276
|
+
if (state?.nextAction)
|
|
277
|
+
lines.push(`- **Next:** \`${state.nextAction}\``);
|
|
278
|
+
return section('session', 'Session handoff', lines.join('\n'));
|
|
279
|
+
}
|
|
280
|
+
async function coverageSection(inspection) {
|
|
281
|
+
try {
|
|
282
|
+
const cov = buildCoverageReport(inspection);
|
|
283
|
+
const lines = [`- **Overall:** ${cov.overall}`];
|
|
284
|
+
for (const c of cov.categories.slice(0, 5)) {
|
|
285
|
+
lines.push(`- \`${c.id}\` ${c.score}`);
|
|
286
|
+
}
|
|
287
|
+
return section('coverage', 'Coverage', lines.join('\n'));
|
|
288
|
+
}
|
|
289
|
+
catch {
|
|
290
|
+
return section('coverage', 'Coverage', '_unavailable_');
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
async function driftSection(inspection) {
|
|
294
|
+
try {
|
|
295
|
+
const d = buildDriftReport(inspection);
|
|
296
|
+
return section('drift', 'Drift', `errors=${d.counts.error} warnings=${d.counts.warning} info=${d.counts.info}`);
|
|
297
|
+
}
|
|
298
|
+
catch {
|
|
299
|
+
return section('drift', 'Drift', '_unavailable_');
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
async function qualitySection(inspection, baselineFile) {
|
|
303
|
+
if (!baselineFile)
|
|
304
|
+
return section('quality', 'Quality baseline', '_No baseline provided._');
|
|
305
|
+
const cmp = await compareQualityBaseline(inspection, baselineFile);
|
|
306
|
+
if (!cmp)
|
|
307
|
+
return section('quality', 'Quality baseline', `_No baseline at ${baselineFile}._`);
|
|
308
|
+
const lines = [
|
|
309
|
+
`- **Baseline score:** ${cmp.baseline.qualityScore}`,
|
|
310
|
+
`- **Current score:** ${cmp.current.qualityScore}`,
|
|
311
|
+
`- **Regressions:** ${cmp.regressions.length}`,
|
|
312
|
+
`- **Improvements:** ${cmp.improvements.length}`,
|
|
313
|
+
];
|
|
314
|
+
return section('quality', 'Quality baseline', lines.join('\n'));
|
|
315
|
+
}
|
|
316
|
+
function sectionsToMarkdown(task, mode, sections) {
|
|
317
|
+
const lines = [];
|
|
318
|
+
lines.push(`# SharkCraft brief: ${task || '(no task)'}`);
|
|
319
|
+
lines.push('');
|
|
320
|
+
lines.push(`_Mode: \`${mode}\` — ${new Date().toISOString()}_`);
|
|
321
|
+
for (const s of sections) {
|
|
322
|
+
lines.push('');
|
|
323
|
+
lines.push(`## ${s.title}`);
|
|
324
|
+
lines.push('');
|
|
325
|
+
lines.push(s.body);
|
|
326
|
+
}
|
|
327
|
+
lines.push('');
|
|
328
|
+
return lines.join('\n');
|
|
329
|
+
}
|
|
330
|
+
export async function buildAgentBrief(inspection, input) {
|
|
331
|
+
// Warm registries so impact / brief can include constructs / playbooks.
|
|
332
|
+
await loadConstructs(inspection);
|
|
333
|
+
await loadPlaybooks(inspection);
|
|
334
|
+
const mode = inferMode(input);
|
|
335
|
+
const task = (input.task ?? '').trim();
|
|
336
|
+
const packet = buildTaskPacket(inspection, task || 'general project work', {
|
|
337
|
+
maxTokens: 3500,
|
|
338
|
+
});
|
|
339
|
+
const impact = await gatherImpact(inspection, input);
|
|
340
|
+
const sections = [];
|
|
341
|
+
if (task) {
|
|
342
|
+
sections.push(section('task', 'Task', task));
|
|
343
|
+
}
|
|
344
|
+
sections.push(projectOverviewSection(inspection));
|
|
345
|
+
if (mode !== BriefMode.Compact) {
|
|
346
|
+
sections.push(rulesSection(packet, 8));
|
|
347
|
+
sections.push(pathsSection(packet, 8));
|
|
348
|
+
sections.push(templatesSection(packet, 6));
|
|
349
|
+
sections.push(pipelineSection(packet));
|
|
350
|
+
sections.push(actionHintsSection(packet));
|
|
351
|
+
sections.push(forbiddenSection(packet));
|
|
352
|
+
}
|
|
353
|
+
else {
|
|
354
|
+
sections.push(rulesSection(packet, 4));
|
|
355
|
+
sections.push(pathsSection(packet, 4));
|
|
356
|
+
sections.push(templatesSection(packet, 4));
|
|
357
|
+
sections.push(actionHintsSection(packet));
|
|
358
|
+
}
|
|
359
|
+
if (mode === BriefMode.Full || mode === BriefMode.Review) {
|
|
360
|
+
sections.push(impactSection(impact));
|
|
361
|
+
sections.push(boundarySection(impact));
|
|
362
|
+
sections.push(policySection(impact));
|
|
363
|
+
sections.push(ownershipSection(impact));
|
|
364
|
+
sections.push(await coverageSection(inspection));
|
|
365
|
+
sections.push(await driftSection(inspection));
|
|
366
|
+
if (input.qualityBaselineFile)
|
|
367
|
+
sections.push(await qualitySection(inspection, input.qualityBaselineFile));
|
|
368
|
+
}
|
|
369
|
+
if (mode === BriefMode.Implementation) {
|
|
370
|
+
sections.push(impactSection(impact));
|
|
371
|
+
sections.push(boundarySection(impact));
|
|
372
|
+
sections.push(policySection(impact));
|
|
373
|
+
}
|
|
374
|
+
if (mode === BriefMode.Handoff) {
|
|
375
|
+
if (input.bundleId)
|
|
376
|
+
sections.push(await bundleHandoffSection(inspection, input.bundleId));
|
|
377
|
+
if (input.sessionId)
|
|
378
|
+
sections.push(await sessionHandoffSection(inspection, input.sessionId));
|
|
379
|
+
sections.push(impactSection(impact));
|
|
380
|
+
}
|
|
381
|
+
// Playbook recommendation.
|
|
382
|
+
if (task) {
|
|
383
|
+
const playbooks = listPlaybooks(inspection);
|
|
384
|
+
const recs = recommendPlaybooks(playbooks, task).slice(0, 3);
|
|
385
|
+
if (recs.length > 0) {
|
|
386
|
+
const lines = recs.map((r) => `- \`${r.playbook.id}\` (${r.score}) — ${r.reasons.slice(0, 3).join(', ')}`);
|
|
387
|
+
sections.push(section('playbooks', 'Suggested playbooks', lines.join('\n')));
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
// Construct hints when impact mentions any.
|
|
391
|
+
if (impact && impact.affectedConstructs.length > 0) {
|
|
392
|
+
const allConstructs = listConstructs(inspection);
|
|
393
|
+
const lines = impact.affectedConstructs.map((c) => {
|
|
394
|
+
const def = allConstructs.find((x) => x.id === c.id);
|
|
395
|
+
return `- \`${c.id}\` (${c.type})${def?.description ? ` — ${def.description}` : ''}`;
|
|
396
|
+
});
|
|
397
|
+
sections.push(section('constructs', 'Affected constructs', lines.join('\n')));
|
|
398
|
+
}
|
|
399
|
+
// Always include suggested commands + safety.
|
|
400
|
+
const { section: cmdSection, commands } = suggestedCommandsSection(impact, packet);
|
|
401
|
+
sections.push(cmdSection);
|
|
402
|
+
sections.push(safetySection());
|
|
403
|
+
// Apply per-section budgets when requested.
|
|
404
|
+
const trimmedSections = input.sectionBudgets && Object.keys(input.sectionBudgets).length > 0
|
|
405
|
+
? sections.map((s) => {
|
|
406
|
+
const budget = input.sectionBudgets[s.id];
|
|
407
|
+
if (typeof budget !== 'number' || budget <= 0)
|
|
408
|
+
return s;
|
|
409
|
+
return { ...s, body: trimSectionBody(s.body, budget) };
|
|
410
|
+
})
|
|
411
|
+
: sections;
|
|
412
|
+
const markdown = clipMarkdown(sectionsToMarkdown(task || '(no task)', mode, trimmedSections), input.maxTokens ?? 6000);
|
|
413
|
+
const brief = {
|
|
414
|
+
schema: AGENT_BRIEF_SCHEMA,
|
|
415
|
+
task: task || '',
|
|
416
|
+
mode,
|
|
417
|
+
generatedAt: new Date().toISOString(),
|
|
418
|
+
projectRoot: inspection.projectRoot,
|
|
419
|
+
sections: trimmedSections,
|
|
420
|
+
markdown,
|
|
421
|
+
suggestedCommands: commands,
|
|
422
|
+
inputs: {
|
|
423
|
+
files: input.files ?? [],
|
|
424
|
+
since: input.since ?? null,
|
|
425
|
+
staged: input.staged ?? false,
|
|
426
|
+
bundleId: input.bundleId ?? null,
|
|
427
|
+
sessionId: input.sessionId ?? null,
|
|
428
|
+
},
|
|
429
|
+
warnings: [],
|
|
430
|
+
totalTokenEstimate: tokenEstimate(markdown),
|
|
431
|
+
};
|
|
432
|
+
if (impact)
|
|
433
|
+
brief.impact = impact;
|
|
434
|
+
// Attach a task-risk summary when a task is provided. Best-effort.
|
|
435
|
+
if (task) {
|
|
436
|
+
try {
|
|
437
|
+
brief.taskRisk = await buildTaskRiskReport(task, inspection, {
|
|
438
|
+
...(input.files && input.files.length > 0 ? { files: input.files } : {}),
|
|
439
|
+
...(input.since ? { since: input.since } : {}),
|
|
440
|
+
...(input.staged ? { staged: true } : {}),
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
catch {
|
|
444
|
+
/* best-effort */
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
if (input.chunked) {
|
|
448
|
+
brief.chunks = buildBriefChunks(brief, trimmedSections);
|
|
449
|
+
}
|
|
450
|
+
return brief;
|
|
451
|
+
}
|
|
452
|
+
function buildBriefChunks(brief, sections) {
|
|
453
|
+
const ordered = [...sections].sort((a, b) => {
|
|
454
|
+
const ia = SECTION_ORDER.indexOf(a.id);
|
|
455
|
+
const ib = SECTION_ORDER.indexOf(b.id);
|
|
456
|
+
return (ia === -1 ? 99 : ia) - (ib === -1 ? 99 : ib);
|
|
457
|
+
});
|
|
458
|
+
const chunks = [];
|
|
459
|
+
const indexLines = [];
|
|
460
|
+
indexLines.push(`# SharkCraft brief — index`);
|
|
461
|
+
indexLines.push('');
|
|
462
|
+
indexLines.push(`_Mode: \`${brief.mode}\` — ${brief.generatedAt}_`);
|
|
463
|
+
if (brief.task)
|
|
464
|
+
indexLines.push(`_Task: ${brief.task}_`);
|
|
465
|
+
indexLines.push('');
|
|
466
|
+
indexLines.push('Read the chunks in order:');
|
|
467
|
+
for (let i = 0; i < ordered.length; i += 1) {
|
|
468
|
+
const s = ordered[i];
|
|
469
|
+
const idx = String(i + 1).padStart(2, '0');
|
|
470
|
+
const file = `${idx}-${s.id}.md`;
|
|
471
|
+
indexLines.push(`- [${s.title}](${file})`);
|
|
472
|
+
const body = `# ${s.title}\n\n${s.body}\n\n---\n\n_Safety: MCP is read-only. Use CLI for writes. Apply requires explicit human action._\n`;
|
|
473
|
+
chunks.push({
|
|
474
|
+
file,
|
|
475
|
+
sectionId: s.id,
|
|
476
|
+
title: s.title,
|
|
477
|
+
body,
|
|
478
|
+
tokenEstimate: tokenEstimate(body),
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
const indexBody = indexLines.join('\n') + '\n';
|
|
482
|
+
chunks.unshift({
|
|
483
|
+
file: '00-index.md',
|
|
484
|
+
sectionId: 'index',
|
|
485
|
+
title: 'Index',
|
|
486
|
+
body: indexBody,
|
|
487
|
+
tokenEstimate: tokenEstimate(indexBody),
|
|
488
|
+
});
|
|
489
|
+
return chunks;
|
|
490
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import type { IAgentContract } from './agent-contract.js';
|
|
2
|
+
import type { IPlanSimulationReport } from './plan-simulation.js';
|
|
3
|
+
import type { ISharkcraftInspection } from './sharkcraft-inspector.js';
|
|
4
|
+
export declare const AGENT_CONTRACT_APPROVAL_SCHEMA = "sharkcraft.agent-contract-approval/v1";
|
|
5
|
+
export declare const AGENT_CONTRACT_GATE_SCHEMA = "sharkcraft.agent-contract-gate/v1";
|
|
6
|
+
export interface IAgentContractApproval {
|
|
7
|
+
schema: typeof AGENT_CONTRACT_APPROVAL_SCHEMA;
|
|
8
|
+
/** Stable hash of the contract this approval is bound to. */
|
|
9
|
+
contractHash: string;
|
|
10
|
+
/** Short contract id (slug + timestamp) for human readability. */
|
|
11
|
+
contractId?: string;
|
|
12
|
+
approvedBy: string;
|
|
13
|
+
reason: string;
|
|
14
|
+
approvedAt: string;
|
|
15
|
+
/** Specific gates the approver acknowledged. */
|
|
16
|
+
approvedGates: readonly string[];
|
|
17
|
+
/** ISO timestamp at which the approval expires; absent = no expiry. */
|
|
18
|
+
expiresAt?: string;
|
|
19
|
+
/** Optional HMAC signature when SHARKCRAFT_CONTRACT_SECRET is set. */
|
|
20
|
+
signature?: {
|
|
21
|
+
algo: 'sha256';
|
|
22
|
+
hmac: string;
|
|
23
|
+
signedAt: string;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export declare enum ContractGateStatus {
|
|
27
|
+
Pass = "pass",
|
|
28
|
+
RequiresApproval = "requires-approval",
|
|
29
|
+
Fail = "fail",
|
|
30
|
+
Warn = "warn"
|
|
31
|
+
}
|
|
32
|
+
export interface IContractGateResult {
|
|
33
|
+
id: string;
|
|
34
|
+
description: string;
|
|
35
|
+
status: ContractGateStatus;
|
|
36
|
+
detail?: string;
|
|
37
|
+
}
|
|
38
|
+
export declare enum ContractApprovalExpiryStatus {
|
|
39
|
+
Valid = "valid",
|
|
40
|
+
ExpiresSoon = "expires-soon",
|
|
41
|
+
Expired = "expired",
|
|
42
|
+
NoExpiry = "no-expiry",
|
|
43
|
+
Absent = "absent"
|
|
44
|
+
}
|
|
45
|
+
export interface IContractApprovalExpiry {
|
|
46
|
+
status: ContractApprovalExpiryStatus;
|
|
47
|
+
/** Milliseconds until expiry — negative when already expired. Absent for `absent` / `no-expiry`. */
|
|
48
|
+
expiresInMs?: number;
|
|
49
|
+
/** ISO timestamp at which the approval expires. */
|
|
50
|
+
expiresAt?: string;
|
|
51
|
+
/** ISO timestamp at which the approval expired (only set when `status === Expired`). */
|
|
52
|
+
expiredAt?: string;
|
|
53
|
+
/** Warning when the approval has no expiry and the contract is high/critical risk. */
|
|
54
|
+
noExpiryWarning?: string;
|
|
55
|
+
}
|
|
56
|
+
export interface IContractCheckReport {
|
|
57
|
+
schema: typeof AGENT_CONTRACT_GATE_SCHEMA;
|
|
58
|
+
generatedAt: string;
|
|
59
|
+
contractHash: string;
|
|
60
|
+
contractId?: string;
|
|
61
|
+
task: string;
|
|
62
|
+
role: string;
|
|
63
|
+
mode: string;
|
|
64
|
+
gates: readonly IContractGateResult[];
|
|
65
|
+
approval?: IAgentContractApproval;
|
|
66
|
+
approvalStatus: 'absent' | 'present' | 'expired' | 'mismatched' | 'unsigned' | 'verified' | 'invalid';
|
|
67
|
+
approvalMessage?: string;
|
|
68
|
+
/** Expiry detail (status + remaining time). */
|
|
69
|
+
approvalExpiry?: IContractApprovalExpiry;
|
|
70
|
+
pass: boolean;
|
|
71
|
+
blockingGates: readonly string[];
|
|
72
|
+
warnGates: readonly string[];
|
|
73
|
+
planSimulation?: IPlanSimulationReport;
|
|
74
|
+
notes: readonly string[];
|
|
75
|
+
}
|
|
76
|
+
export interface ICheckContractOptions {
|
|
77
|
+
planPath?: string;
|
|
78
|
+
approvalPath?: string;
|
|
79
|
+
/** Override secret env name; default `SHARKCRAFT_CONTRACT_SECRET`. */
|
|
80
|
+
secretEnv?: string;
|
|
81
|
+
}
|
|
82
|
+
export declare function computeContractHash(contract: IAgentContract): string;
|
|
83
|
+
export declare function signApproval(a: IAgentContractApproval, secret: string): IAgentContractApproval;
|
|
84
|
+
export declare function verifyApproval(a: IAgentContractApproval, secret: string): {
|
|
85
|
+
ok: boolean;
|
|
86
|
+
message: string;
|
|
87
|
+
};
|
|
88
|
+
export interface IBuildApprovalInput {
|
|
89
|
+
contractHash: string;
|
|
90
|
+
contractId?: string;
|
|
91
|
+
approvedBy: string;
|
|
92
|
+
reason: string;
|
|
93
|
+
approvedGates?: readonly string[];
|
|
94
|
+
expiresAt?: string;
|
|
95
|
+
/** When set, secret env (default `SHARKCRAFT_CONTRACT_SECRET`) signs the approval. */
|
|
96
|
+
secretEnv?: string;
|
|
97
|
+
}
|
|
98
|
+
export declare function buildApproval(input: IBuildApprovalInput): IAgentContractApproval;
|
|
99
|
+
/**
|
|
100
|
+
* Parse a relative expiry string like `1h`, `2d`, `30m`, `45s`, `1w` and return
|
|
101
|
+
* an absolute ISO timestamp from `from` (default now). Returns null when the
|
|
102
|
+
* input cannot be parsed.
|
|
103
|
+
*/
|
|
104
|
+
export declare function parseRelativeExpiry(input: string, from?: Date): string | null;
|
|
105
|
+
export declare function checkAgentContract(inspection: ISharkcraftInspection, contract: IAgentContract, options?: ICheckContractOptions): Promise<IContractCheckReport>;
|
|
106
|
+
export declare function renderContractCheckText(r: IContractCheckReport): string;
|
|
107
|
+
export declare function renderContractCheckMarkdown(r: IContractCheckReport): string;
|
|
108
|
+
//# sourceMappingURL=agent-contract-gate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-contract-gate.d.ts","sourceRoot":"","sources":["../src/agent-contract-gate.ts"],"names":[],"mappings":"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"}
|