harnery 0.35.0 → 0.37.0
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/dist/commander.d.ts +30 -5
- package/dist/commander.d.ts.map +1 -1
- package/dist/commander.js +128 -96
- package/dist/commands/agents.d.ts +23 -3
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +464 -242
- package/dist/commands/artifacts.d.ts.map +1 -1
- package/dist/commands/artifacts.js +26 -1
- package/dist/commands/backup.d.ts.map +1 -1
- package/dist/commands/backup.js +10 -10
- package/dist/commands/browse-session.d.ts.map +1 -1
- package/dist/commands/browse-session.js +12 -0
- package/dist/commands/browse.d.ts +1 -1
- package/dist/commands/browse.d.ts.map +1 -1
- package/dist/commands/browse.js +16 -4
- package/dist/commands/conversations.d.ts +10 -0
- package/dist/commands/conversations.d.ts.map +1 -0
- package/dist/commands/conversations.js +201 -0
- package/dist/commands/deinit.d.ts.map +1 -1
- package/dist/commands/deinit.js +5 -0
- package/dist/commands/diagnostics.d.ts +4 -0
- package/dist/commands/diagnostics.d.ts.map +1 -0
- package/dist/commands/diagnostics.js +229 -0
- package/dist/commands/docs.d.ts.map +1 -1
- package/dist/commands/docs.js +13 -2
- package/dist/commands/doctor.d.ts +5 -0
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +51 -7
- package/dist/commands/fetch.js +6 -5
- package/dist/commands/files.d.ts +34 -0
- package/dist/commands/files.d.ts.map +1 -0
- package/dist/commands/files.js +166 -0
- package/dist/commands/governor.d.ts.map +1 -1
- package/dist/commands/governor.js +18 -12
- package/dist/commands/inbox.d.ts +5 -0
- package/dist/commands/inbox.d.ts.map +1 -0
- package/dist/commands/inbox.js +57 -0
- package/dist/commands/init.d.ts +4 -5
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +63 -13
- package/dist/commands/ledger-v3.d.ts.map +1 -1
- package/dist/commands/ledger-v3.js +417 -2
- package/dist/commands/logs.d.ts +4 -0
- package/dist/commands/logs.d.ts.map +1 -0
- package/dist/commands/logs.js +169 -0
- package/dist/commands/messages.d.ts +5 -0
- package/dist/commands/messages.d.ts.map +1 -0
- package/dist/commands/messages.js +45 -0
- package/dist/commands/outline.d.ts +1 -1
- package/dist/commands/outline.d.ts.map +1 -1
- package/dist/commands/outline.js +2 -2
- package/dist/commands/qa-run.d.ts +4 -0
- package/dist/commands/qa-run.d.ts.map +1 -0
- package/dist/commands/qa-run.js +141 -0
- package/dist/commands/read.d.ts +1 -1
- package/dist/commands/read.d.ts.map +1 -1
- package/dist/commands/read.js +2 -2
- package/dist/commands/resources.d.ts +4 -0
- package/dist/commands/resources.d.ts.map +1 -0
- package/dist/commands/resources.js +29 -0
- package/dist/commands/semantic.d.ts.map +1 -1
- package/dist/commands/semantic.js +54 -2
- package/dist/commands/storage.d.ts +4 -0
- package/dist/commands/storage.d.ts.map +1 -0
- package/dist/commands/storage.js +238 -0
- package/dist/commands/supervisor.d.ts +4 -0
- package/dist/commands/supervisor.d.ts.map +1 -0
- package/dist/commands/supervisor.js +101 -0
- package/dist/commands/tunnel.d.ts +5 -1
- package/dist/commands/tunnel.d.ts.map +1 -1
- package/dist/commands/tunnel.js +44 -31
- package/dist/commands/web.d.ts +3 -0
- package/dist/commands/web.d.ts.map +1 -1
- package/dist/commands/web.js +84 -7
- package/dist/commands/work.js +3 -3
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +17 -13
- package/dist/core/adapters/profiles.d.ts +1 -1
- package/dist/core/agents/cli.js +215 -41
- package/dist/core/agents/health.d.ts +17 -0
- package/dist/core/agents/health.d.ts.map +1 -0
- package/dist/core/agents/health.js +109 -0
- package/dist/core/agents/live-authority-v3.d.ts +47 -1
- package/dist/core/agents/live-authority-v3.d.ts.map +1 -1
- package/dist/core/agents/live-authority-v3.js +244 -10
- package/dist/core/agents/live-lifecycle-v3.js +6 -1
- package/dist/core/agents/live-observation-v3.d.ts.map +1 -1
- package/dist/core/agents/live-observation-v3.js +6 -1
- package/dist/core/agents/mailbox.d.ts +92 -0
- package/dist/core/agents/mailbox.d.ts.map +1 -0
- package/dist/core/agents/mailbox.js +325 -0
- package/dist/core/agents/reconcile-coordination-v3.d.ts +44 -0
- package/dist/core/agents/reconcile-coordination-v3.d.ts.map +1 -0
- package/dist/core/agents/reconcile-coordination-v3.js +58 -0
- package/dist/core/agents/render/prompt-context.d.ts +14 -3
- package/dist/core/agents/render/prompt-context.d.ts.map +1 -1
- package/dist/core/agents/render/prompt-context.js +54 -16
- package/dist/core/agents/render/session-context.d.ts +8 -0
- package/dist/core/agents/render/session-context.d.ts.map +1 -1
- package/dist/core/agents/render/session-context.js +34 -3
- package/dist/core/agents/rules/commit-conflict.d.ts.map +1 -1
- package/dist/core/agents/rules/commit-conflict.js +50 -1
- package/dist/core/agents/rules/stop-hook.d.ts +2 -0
- package/dist/core/agents/rules/stop-hook.d.ts.map +1 -1
- package/dist/core/agents/rules/stop-hook.js +93 -16
- package/dist/core/agents/rules/verdict.d.ts +1 -0
- package/dist/core/agents/rules/verdict.d.ts.map +1 -1
- package/dist/core/agents/session-events.d.ts.map +1 -1
- package/dist/core/agents/session-events.js +4 -0
- package/dist/core/agents/session-finalization-state-v3.js +1 -1
- package/dist/core/agents/session-finalizer-v3.js +9 -2
- package/dist/core/agents/state/activity-log.d.ts +3 -0
- package/dist/core/agents/state/activity-log.d.ts.map +1 -1
- package/dist/core/agents/state/activity-log.js +6 -3
- package/dist/core/agents/state/heartbeat-writer.d.ts +6 -0
- package/dist/core/agents/state/heartbeat-writer.d.ts.map +1 -1
- package/dist/core/agents/state/heartbeat-writer.js +18 -0
- package/dist/core/agents/state/live-coordination-view.d.ts +5 -7
- package/dist/core/agents/state/live-coordination-view.d.ts.map +1 -1
- package/dist/core/agents/state/live-coordination-view.js +15 -90
- package/dist/core/agents/state/live-coordination-writer.d.ts +12 -0
- package/dist/core/agents/state/live-coordination-writer.d.ts.map +1 -0
- package/dist/core/agents/state/live-coordination-writer.js +92 -0
- package/dist/core/artifacts/index.d.ts +47 -1
- package/dist/core/artifacts/index.d.ts.map +1 -1
- package/dist/core/artifacts/index.js +191 -6
- package/dist/core/config.d.ts +74 -4
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +141 -4
- package/dist/core/conversations/archive.d.ts +49 -0
- package/dist/core/conversations/archive.d.ts.map +1 -0
- package/dist/core/conversations/archive.js +136 -0
- package/dist/core/conversations/catalog.d.ts +10 -0
- package/dist/core/conversations/catalog.d.ts.map +1 -0
- package/dist/core/conversations/catalog.js +72 -0
- package/dist/core/conversations/context-pack.d.ts +6 -0
- package/dist/core/conversations/context-pack.d.ts.map +1 -0
- package/dist/core/conversations/context-pack.js +60 -0
- package/dist/core/conversations/contract.d.ts +155 -0
- package/dist/core/conversations/contract.d.ts.map +1 -0
- package/dist/core/conversations/contract.js +1 -0
- package/dist/core/conversations/evaluation.d.ts +16 -0
- package/dist/core/conversations/evaluation.d.ts.map +1 -0
- package/dist/core/conversations/evaluation.js +9 -0
- package/dist/core/conversations/index.d.ts +10 -0
- package/dist/core/conversations/index.d.ts.map +1 -0
- package/dist/core/conversations/index.js +9 -0
- package/dist/core/conversations/lifecycle.d.ts +28 -0
- package/dist/core/conversations/lifecycle.d.ts.map +1 -0
- package/dist/core/conversations/lifecycle.js +29 -0
- package/dist/core/conversations/normalize.d.ts +14 -0
- package/dist/core/conversations/normalize.d.ts.map +1 -0
- package/dist/core/conversations/normalize.js +82 -0
- package/dist/core/conversations/query.d.ts +8 -0
- package/dist/core/conversations/query.d.ts.map +1 -0
- package/dist/core/conversations/query.js +280 -0
- package/dist/core/conversations/search-index.d.ts +9 -0
- package/dist/core/conversations/search-index.d.ts.map +1 -0
- package/dist/core/conversations/search-index.js +29 -0
- package/dist/core/diagnostics/advice.d.ts +9 -0
- package/dist/core/diagnostics/advice.d.ts.map +1 -0
- package/dist/core/diagnostics/advice.js +112 -0
- package/dist/core/diagnostics/bundle.d.ts +35 -0
- package/dist/core/diagnostics/bundle.d.ts.map +1 -0
- package/dist/core/diagnostics/bundle.js +874 -0
- package/dist/core/diagnostics/comparison.d.ts +5 -0
- package/dist/core/diagnostics/comparison.d.ts.map +1 -0
- package/dist/core/diagnostics/comparison.js +444 -0
- package/dist/core/diagnostics/contract.d.ts +245 -0
- package/dist/core/diagnostics/contract.d.ts.map +1 -0
- package/dist/core/diagnostics/contract.js +18 -0
- package/dist/core/diagnostics/identity.d.ts +3 -0
- package/dist/core/diagnostics/identity.d.ts.map +1 -0
- package/dist/core/diagnostics/identity.js +10 -0
- package/dist/core/diagnostics/index.d.ts +8 -0
- package/dist/core/diagnostics/index.d.ts.map +1 -0
- package/dist/core/diagnostics/index.js +7 -0
- package/dist/core/diagnostics/replay.d.ts +8 -0
- package/dist/core/diagnostics/replay.d.ts.map +1 -0
- package/dist/core/diagnostics/replay.js +213 -0
- package/dist/core/diagnostics/sanitize.d.ts +9 -0
- package/dist/core/diagnostics/sanitize.d.ts.map +1 -0
- package/dist/core/diagnostics/sanitize.js +84 -0
- package/dist/core/events/legacy-storage/canary.d.ts +18 -0
- package/dist/core/events/legacy-storage/canary.d.ts.map +1 -0
- package/dist/core/events/legacy-storage/canary.js +150 -0
- package/dist/core/events/legacy-storage/compression.d.ts +13 -0
- package/dist/core/events/legacy-storage/compression.d.ts.map +1 -0
- package/dist/core/events/legacy-storage/compression.js +107 -0
- package/dist/core/events/legacy-storage/fence.d.ts +15 -0
- package/dist/core/events/legacy-storage/fence.d.ts.map +1 -0
- package/dist/core/events/legacy-storage/fence.js +115 -0
- package/dist/core/events/legacy-storage/index.d.ts +7 -0
- package/dist/core/events/legacy-storage/index.d.ts.map +1 -0
- package/dist/core/events/legacy-storage/index.js +6 -0
- package/dist/core/events/legacy-storage/inventory.d.ts +10 -0
- package/dist/core/events/legacy-storage/inventory.d.ts.map +1 -0
- package/dist/core/events/legacy-storage/inventory.js +40 -0
- package/dist/core/events/legacy-storage/manifest.d.ts +23 -0
- package/dist/core/events/legacy-storage/manifest.d.ts.map +1 -0
- package/dist/core/events/legacy-storage/manifest.js +108 -0
- package/dist/core/events/legacy-storage/reader.d.ts +15 -0
- package/dist/core/events/legacy-storage/reader.d.ts.map +1 -0
- package/dist/core/events/legacy-storage/reader.js +154 -0
- package/dist/core/events/v3/archive-retention.d.ts +33 -0
- package/dist/core/events/v3/archive-retention.d.ts.map +1 -0
- package/dist/core/events/v3/archive-retention.js +195 -0
- package/dist/core/events/v3/authority-outbox.d.ts +7 -2
- package/dist/core/events/v3/authority-outbox.d.ts.map +1 -1
- package/dist/core/events/v3/authority-outbox.js +16 -3
- package/dist/core/events/v3/base-contract.d.ts +81 -41
- package/dist/core/events/v3/base-contract.d.ts.map +1 -1
- package/dist/core/events/v3/base-contract.js +17 -7
- package/dist/core/events/v3/bootstrap.d.ts +39 -0
- package/dist/core/events/v3/bootstrap.d.ts.map +1 -1
- package/dist/core/events/v3/bootstrap.js +167 -3
- package/dist/core/events/v3/capabilities.d.ts +1 -1
- package/dist/core/events/v3/capabilities.d.ts.map +1 -1
- package/dist/core/events/v3/capabilities.js +4 -3
- package/dist/core/events/v3/control-witness.d.ts +44 -0
- package/dist/core/events/v3/control-witness.d.ts.map +1 -0
- package/dist/core/events/v3/control-witness.js +233 -0
- package/dist/core/events/v3/control-writer.d.ts +4 -0
- package/dist/core/events/v3/control-writer.d.ts.map +1 -0
- package/dist/core/events/v3/control-writer.js +16 -0
- package/dist/core/events/v3/control.d.ts +8 -2
- package/dist/core/events/v3/control.d.ts.map +1 -1
- package/dist/core/events/v3/control.js +46 -18
- package/dist/core/events/v3/coordination-transaction-recovery.d.ts +42 -0
- package/dist/core/events/v3/coordination-transaction-recovery.d.ts.map +1 -0
- package/dist/core/events/v3/coordination-transaction-recovery.js +342 -0
- package/dist/core/events/v3/coordination-view.d.ts.map +1 -1
- package/dist/core/events/v3/coordination-view.js +16 -1
- package/dist/core/events/v3/generated.d.ts +1 -1
- package/dist/core/events/v3/generated.js +1 -1
- package/dist/core/events/v3/index.d.ts +5 -2
- package/dist/core/events/v3/index.d.ts.map +1 -1
- package/dist/core/events/v3/index.js +4 -1
- package/dist/core/events/v3/live-route-observer.d.ts +31 -0
- package/dist/core/events/v3/live-route-observer.d.ts.map +1 -0
- package/dist/core/events/v3/live-route-observer.js +58 -0
- package/dist/core/events/v3/live-routing.d.ts +13 -21
- package/dist/core/events/v3/live-routing.d.ts.map +1 -1
- package/dist/core/events/v3/live-routing.js +46 -41
- package/dist/core/events/v3/producers/coordination-recorder.d.ts +11 -1
- package/dist/core/events/v3/producers/coordination-recorder.d.ts.map +1 -1
- package/dist/core/events/v3/producers/coordination-recorder.js +76 -10
- package/dist/core/events/v3/producers/diagnostic-summaries.d.ts +129 -0
- package/dist/core/events/v3/producers/diagnostic-summaries.d.ts.map +1 -0
- package/dist/core/events/v3/producers/diagnostic-summaries.js +499 -0
- package/dist/core/events/v3/producers/hook-base.d.ts +1 -1
- package/dist/core/events/v3/producers/hook-base.d.ts.map +1 -1
- package/dist/core/events/v3/producers/hook-base.js +14 -3
- package/dist/core/events/v3/producers/intake.d.ts +7 -0
- package/dist/core/events/v3/producers/intake.d.ts.map +1 -1
- package/dist/core/events/v3/producers/intake.js +26 -2
- package/dist/core/events/v3/producers/producer-state-observer.d.ts +8 -0
- package/dist/core/events/v3/producers/producer-state-observer.d.ts.map +1 -0
- package/dist/core/events/v3/producers/producer-state-observer.js +45 -0
- package/dist/core/events/v3/producers/recorder.d.ts +71 -1
- package/dist/core/events/v3/producers/recorder.d.ts.map +1 -1
- package/dist/core/events/v3/producers/recorder.js +441 -25
- package/dist/core/events/v3/reader.d.ts +51 -0
- package/dist/core/events/v3/reader.d.ts.map +1 -1
- package/dist/core/events/v3/reader.js +181 -1
- package/dist/core/events/v3/rotation-config.d.ts +9 -0
- package/dist/core/events/v3/rotation-config.d.ts.map +1 -0
- package/dist/core/events/v3/rotation-config.js +91 -0
- package/dist/core/events/v3/runtime-build.d.ts +11 -0
- package/dist/core/events/v3/runtime-build.d.ts.map +1 -0
- package/dist/core/events/v3/runtime-build.js +39 -0
- package/dist/core/events/v3/runtime-identity.d.ts +5 -0
- package/dist/core/events/v3/runtime-identity.d.ts.map +1 -0
- package/dist/core/events/v3/runtime-identity.js +18 -0
- package/dist/core/events/v3/runtime-telemetry-capabilities.d.ts +6 -5
- package/dist/core/events/v3/runtime-telemetry-capabilities.d.ts.map +1 -1
- package/dist/core/events/v3/runtime-telemetry-capabilities.js +1 -1
- package/dist/core/events/v3/support-storage/classify.d.ts +46 -0
- package/dist/core/events/v3/support-storage/classify.d.ts.map +1 -0
- package/dist/core/events/v3/support-storage/classify.js +149 -0
- package/dist/core/events/v3/support-storage/eligibility.d.ts +29 -0
- package/dist/core/events/v3/support-storage/eligibility.d.ts.map +1 -0
- package/dist/core/events/v3/support-storage/eligibility.js +35 -0
- package/dist/core/events/v3/support-storage/index.d.ts +10 -0
- package/dist/core/events/v3/support-storage/index.d.ts.map +1 -0
- package/dist/core/events/v3/support-storage/index.js +9 -0
- package/dist/core/events/v3/support-storage/inventory.d.ts +30 -0
- package/dist/core/events/v3/support-storage/inventory.d.ts.map +1 -0
- package/dist/core/events/v3/support-storage/inventory.js +94 -0
- package/dist/core/events/v3/support-storage/logical-authority.d.ts +14 -0
- package/dist/core/events/v3/support-storage/logical-authority.d.ts.map +1 -0
- package/dist/core/events/v3/support-storage/logical-authority.js +104 -0
- package/dist/core/events/v3/support-storage/maintenance.d.ts +98 -0
- package/dist/core/events/v3/support-storage/maintenance.d.ts.map +1 -0
- package/dist/core/events/v3/support-storage/maintenance.js +352 -0
- package/dist/core/events/v3/support-storage/pack-contract.d.ts +59 -0
- package/dist/core/events/v3/support-storage/pack-contract.d.ts.map +1 -0
- package/dist/core/events/v3/support-storage/pack-contract.js +249 -0
- package/dist/core/events/v3/support-storage/pack-reader.d.ts +34 -0
- package/dist/core/events/v3/support-storage/pack-reader.d.ts.map +1 -0
- package/dist/core/events/v3/support-storage/pack-reader.js +258 -0
- package/dist/core/events/v3/support-storage/pack-writer.d.ts +30 -0
- package/dist/core/events/v3/support-storage/pack-writer.d.ts.map +1 -0
- package/dist/core/events/v3/support-storage/pack-writer.js +268 -0
- package/dist/core/events/v3/support-storage/recovery.d.ts +15 -0
- package/dist/core/events/v3/support-storage/recovery.d.ts.map +1 -0
- package/dist/core/events/v3/support-storage/recovery.js +22 -0
- package/dist/core/events/v3/turn-telemetry.d.ts +14 -8
- package/dist/core/events/v3/turn-telemetry.d.ts.map +1 -1
- package/dist/core/events/v3/turn-telemetry.js +32 -2
- package/dist/core/events/v3/writer.d.ts +13 -1
- package/dist/core/events/v3/writer.d.ts.map +1 -1
- package/dist/core/events/v3/writer.js +126 -12
- package/dist/core/governor/plan-read.d.ts.map +1 -1
- package/dist/core/governor/plan-read.js +5 -21
- package/dist/core/governor/planning.js +6 -8
- package/dist/core/governor/service-read.d.ts +12 -0
- package/dist/core/governor/service-read.d.ts.map +1 -1
- package/dist/core/governor/service-read.js +266 -2
- package/dist/core/governor/service.d.ts +1 -0
- package/dist/core/governor/service.d.ts.map +1 -1
- package/dist/core/governor/service.js +53 -18
- package/dist/core/guard/evidence-v3.d.ts.map +1 -1
- package/dist/core/guard/evidence-v3.js +2 -0
- package/dist/core/hooks/adapter/events.d.ts.map +1 -1
- package/dist/core/hooks/adapter/events.js +1 -0
- package/dist/core/hooks/adapter/output.d.ts +12 -2
- package/dist/core/hooks/adapter/output.d.ts.map +1 -1
- package/dist/core/hooks/adapter/output.js +23 -5
- package/dist/core/hooks/adapter/runtime-telemetry.d.ts +27 -4
- package/dist/core/hooks/adapter/runtime-telemetry.d.ts.map +1 -1
- package/dist/core/hooks/adapter/runtime-telemetry.js +307 -6
- package/dist/core/hooks/cli.js +380 -207
- package/dist/core/hooks/effects/image-capture.d.ts +1 -1
- package/dist/core/hooks/effects/image-capture.d.ts.map +1 -1
- package/dist/core/hooks/effects/image-capture.js +4 -2
- package/dist/core/hooks/health.d.ts +59 -0
- package/dist/core/hooks/health.d.ts.map +1 -0
- package/dist/core/hooks/health.js +84 -0
- package/dist/core/hooks/remediation-cap.d.ts +8 -3
- package/dist/core/hooks/remediation-cap.d.ts.map +1 -1
- package/dist/core/hooks/remediation-cap.js +3 -11
- package/dist/core/hooks/resolve/coord-root.d.ts +22 -9
- package/dist/core/hooks/resolve/coord-root.d.ts.map +1 -1
- package/dist/core/hooks/resolve/coord-root.js +92 -11
- package/dist/core/hooks/resolve/owner.d.ts.map +1 -1
- package/dist/core/hooks/resolve/owner.js +5 -0
- package/dist/core/hooks/resolve/transcript.d.ts +8 -0
- package/dist/core/hooks/resolve/transcript.d.ts.map +1 -1
- package/dist/core/hooks/resolve/transcript.js +11 -0
- package/dist/core/inbox/contract.d.ts +64 -0
- package/dist/core/inbox/contract.d.ts.map +1 -0
- package/dist/core/inbox/contract.js +13 -0
- package/dist/core/inbox/index.d.ts +5 -0
- package/dist/core/inbox/index.d.ts.map +1 -0
- package/dist/core/inbox/index.js +4 -0
- package/dist/core/inbox/lifecycle.d.ts +22 -0
- package/dist/core/inbox/lifecycle.d.ts.map +1 -0
- package/dist/core/inbox/lifecycle.js +41 -0
- package/dist/core/inbox/service.d.ts +36 -0
- package/dist/core/inbox/service.d.ts.map +1 -0
- package/dist/core/inbox/service.js +210 -0
- package/dist/core/inbox/watcher.d.ts +7 -0
- package/dist/core/inbox/watcher.d.ts.map +1 -0
- package/dist/core/inbox/watcher.js +26 -0
- package/dist/core/presence/codec-digest.d.ts.map +1 -1
- package/dist/core/presence/codec-digest.js +14 -3
- package/dist/core/presence/relay-client.d.ts +1 -0
- package/dist/core/presence/relay-client.d.ts.map +1 -1
- package/dist/core/presence/relay-client.js +52 -8
- package/dist/core/resources/contract.d.ts +90 -0
- package/dist/core/resources/contract.d.ts.map +1 -0
- package/dist/core/resources/contract.js +2 -0
- package/dist/core/resources/index.d.ts +6 -0
- package/dist/core/resources/index.d.ts.map +1 -0
- package/dist/core/resources/index.js +5 -0
- package/dist/core/resources/sampler.d.ts +27 -0
- package/dist/core/resources/sampler.d.ts.map +1 -0
- package/dist/core/resources/sampler.js +357 -0
- package/dist/core/resources/service-status.d.ts +3 -0
- package/dist/core/resources/service-status.d.ts.map +1 -0
- package/dist/core/resources/service-status.js +48 -0
- package/dist/core/resources/service.d.ts +26 -0
- package/dist/core/resources/service.d.ts.map +1 -0
- package/dist/core/resources/service.js +292 -0
- package/dist/core/resources/storage.d.ts +13 -0
- package/dist/core/resources/storage.d.ts.map +1 -0
- package/dist/core/resources/storage.js +30 -0
- package/dist/core/semantic/adapters.d.ts +11 -8
- package/dist/core/semantic/adapters.d.ts.map +1 -1
- package/dist/core/semantic/adapters.js +169 -31
- package/dist/core/semantic/contract.d.ts +532 -48
- package/dist/core/semantic/contract.d.ts.map +1 -1
- package/dist/core/semantic/contract.js +104 -3
- package/dist/core/semantic/index.d.ts +7 -3
- package/dist/core/semantic/index.d.ts.map +1 -1
- package/dist/core/semantic/index.js +7 -3
- package/dist/core/semantic/once.d.ts +6 -1
- package/dist/core/semantic/once.d.ts.map +1 -1
- package/dist/core/semantic/once.js +80 -9
- package/dist/core/semantic/prompt.d.ts.map +1 -1
- package/dist/core/semantic/prompt.js +14 -1
- package/dist/core/semantic/review.d.ts +144 -0
- package/dist/core/semantic/review.d.ts.map +1 -0
- package/dist/core/semantic/review.js +544 -0
- package/dist/core/semantic/routes.d.ts +10 -0
- package/dist/core/semantic/routes.d.ts.map +1 -0
- package/dist/core/semantic/routes.js +21 -0
- package/dist/core/semantic/scheduler.d.ts +14 -3
- package/dist/core/semantic/scheduler.d.ts.map +1 -1
- package/dist/core/semantic/scheduler.js +30 -6
- package/dist/core/semantic/service-status.d.ts +20 -0
- package/dist/core/semantic/service-status.d.ts.map +1 -1
- package/dist/core/semantic/service-status.js +60 -4
- package/dist/core/semantic/service.d.ts +1 -0
- package/dist/core/semantic/service.d.ts.map +1 -1
- package/dist/core/semantic/service.js +104 -15
- package/dist/core/semantic/soak.d.ts +75 -0
- package/dist/core/semantic/soak.d.ts.map +1 -0
- package/dist/core/semantic/soak.js +476 -0
- package/dist/core/semantic/storage.d.ts +11 -1
- package/dist/core/semantic/storage.d.ts.map +1 -1
- package/dist/core/semantic/storage.js +4 -3
- package/dist/core/semantic/usage.d.ts +43 -0
- package/dist/core/semantic/usage.d.ts.map +1 -0
- package/dist/core/semantic/usage.js +193 -0
- package/dist/core/semantic/validate.d.ts +3 -1
- package/dist/core/semantic/validate.d.ts.map +1 -1
- package/dist/core/semantic/validate.js +34 -1
- package/dist/core/storage/atomic-json.d.ts +3 -0
- package/dist/core/storage/atomic-json.d.ts.map +1 -0
- package/dist/core/storage/atomic-json.js +15 -0
- package/dist/core/storage/buffer.d.ts +28 -0
- package/dist/core/storage/buffer.d.ts.map +1 -0
- package/dist/core/storage/buffer.js +101 -0
- package/dist/core/storage/builtins.d.ts +3 -0
- package/dist/core/storage/builtins.d.ts.map +1 -0
- package/dist/core/storage/builtins.js +722 -0
- package/dist/core/storage/catalog.d.ts +19 -0
- package/dist/core/storage/catalog.d.ts.map +1 -0
- package/dist/core/storage/catalog.js +365 -0
- package/dist/core/storage/config.d.ts +16 -0
- package/dist/core/storage/config.d.ts.map +1 -0
- package/dist/core/storage/config.js +311 -0
- package/dist/core/storage/contract.d.ts +275 -0
- package/dist/core/storage/contract.d.ts.map +1 -0
- package/dist/core/storage/contract.js +3 -0
- package/dist/core/storage/durable-history.d.ts +36 -0
- package/dist/core/storage/durable-history.d.ts.map +1 -0
- package/dist/core/storage/durable-history.js +606 -0
- package/dist/core/storage/health.d.ts +4 -0
- package/dist/core/storage/health.d.ts.map +1 -0
- package/dist/core/storage/health.js +65 -0
- package/dist/core/storage/index.d.ts +16 -0
- package/dist/core/storage/index.d.ts.map +1 -0
- package/dist/core/storage/index.js +15 -0
- package/dist/core/storage/inventory.d.ts +25 -0
- package/dist/core/storage/inventory.d.ts.map +1 -0
- package/dist/core/storage/inventory.js +666 -0
- package/dist/core/storage/jsonl.d.ts +52 -0
- package/dist/core/storage/jsonl.d.ts.map +1 -0
- package/dist/core/storage/jsonl.js +156 -0
- package/dist/core/storage/log-retention.d.ts +52 -0
- package/dist/core/storage/log-retention.d.ts.map +1 -0
- package/dist/core/storage/log-retention.js +419 -0
- package/dist/core/storage/logger.d.ts +84 -0
- package/dist/core/storage/logger.d.ts.map +1 -0
- package/dist/core/storage/logger.js +413 -0
- package/dist/core/storage/maintenance-providers.d.ts +26 -0
- package/dist/core/storage/maintenance-providers.d.ts.map +1 -0
- package/dist/core/storage/maintenance-providers.js +141 -0
- package/dist/core/storage/maintenance.d.ts +125 -0
- package/dist/core/storage/maintenance.d.ts.map +1 -0
- package/dist/core/storage/maintenance.js +609 -0
- package/dist/core/storage/metrics.d.ts +60 -0
- package/dist/core/storage/metrics.d.ts.map +1 -0
- package/dist/core/storage/metrics.js +134 -0
- package/dist/core/storage/policy.d.ts +7 -0
- package/dist/core/storage/policy.d.ts.map +1 -0
- package/dist/core/storage/policy.js +110 -0
- package/dist/core/storage/process-log.d.ts +38 -0
- package/dist/core/storage/process-log.d.ts.map +1 -0
- package/dist/core/storage/process-log.js +165 -0
- package/dist/core/storage/query.d.ts +48 -0
- package/dist/core/storage/query.d.ts.map +1 -0
- package/dist/core/storage/query.js +346 -0
- package/dist/core/storage/receipts.d.ts +23 -0
- package/dist/core/storage/receipts.d.ts.map +1 -0
- package/dist/core/storage/receipts.js +117 -0
- package/dist/core/storage/segments.d.ts +84 -0
- package/dist/core/storage/segments.d.ts.map +1 -0
- package/dist/core/storage/segments.js +542 -0
- package/dist/core/storage/sink-graph.d.ts +65 -0
- package/dist/core/storage/sink-graph.d.ts.map +1 -0
- package/dist/core/storage/sink-graph.js +213 -0
- package/dist/core/storage/storm-control.d.ts +23 -0
- package/dist/core/storage/storm-control.d.ts.map +1 -0
- package/dist/core/storage/storm-control.js +59 -0
- package/dist/core/supervisor/activity.d.ts +4 -0
- package/dist/core/supervisor/activity.d.ts.map +1 -0
- package/dist/core/supervisor/activity.js +141 -0
- package/dist/core/supervisor/contract.d.ts +268 -0
- package/dist/core/supervisor/contract.d.ts.map +1 -0
- package/dist/core/supervisor/contract.js +35 -0
- package/dist/core/supervisor/explanations.d.ts +4 -0
- package/dist/core/supervisor/explanations.d.ts.map +1 -0
- package/dist/core/supervisor/explanations.js +71 -0
- package/dist/core/supervisor/findings.d.ts +20 -0
- package/dist/core/supervisor/findings.d.ts.map +1 -0
- package/dist/core/supervisor/findings.js +399 -0
- package/dist/core/supervisor/history.d.ts +9 -0
- package/dist/core/supervisor/history.d.ts.map +1 -0
- package/dist/core/supervisor/history.js +46 -0
- package/dist/core/supervisor/hook-health-alerts.d.ts +14 -0
- package/dist/core/supervisor/hook-health-alerts.d.ts.map +1 -0
- package/dist/core/supervisor/hook-health-alerts.js +70 -0
- package/dist/core/supervisor/hook-health-storage.d.ts +5 -0
- package/dist/core/supervisor/hook-health-storage.d.ts.map +1 -0
- package/dist/core/supervisor/hook-health-storage.js +24 -0
- package/dist/core/supervisor/hook-health.d.ts +72 -0
- package/dist/core/supervisor/hook-health.d.ts.map +1 -0
- package/dist/core/supervisor/hook-health.js +203 -0
- package/dist/core/supervisor/hooks.d.ts +10 -0
- package/dist/core/supervisor/hooks.d.ts.map +1 -0
- package/dist/core/supervisor/hooks.js +28 -0
- package/dist/core/supervisor/index.d.ts +15 -0
- package/dist/core/supervisor/index.d.ts.map +1 -0
- package/dist/core/supervisor/index.js +14 -0
- package/dist/core/supervisor/log-feed.d.ts +9 -0
- package/dist/core/supervisor/log-feed.d.ts.map +1 -0
- package/dist/core/supervisor/log-feed.js +103 -0
- package/dist/core/supervisor/service.d.ts +29 -0
- package/dist/core/supervisor/service.d.ts.map +1 -0
- package/dist/core/supervisor/service.js +450 -0
- package/dist/core/supervisor/services.d.ts +11 -0
- package/dist/core/supervisor/services.d.ts.map +1 -0
- package/dist/core/supervisor/services.js +155 -0
- package/dist/core/supervisor/status.d.ts +3 -0
- package/dist/core/supervisor/status.d.ts.map +1 -0
- package/dist/core/supervisor/status.js +48 -0
- package/dist/core/supervisor/storage.d.ts +30 -0
- package/dist/core/supervisor/storage.d.ts.map +1 -0
- package/dist/core/supervisor/storage.js +73 -0
- package/dist/core/supervisor/timeline.d.ts +3 -0
- package/dist/core/supervisor/timeline.d.ts.map +1 -0
- package/dist/core/supervisor/timeline.js +87 -0
- package/dist/core/work/state.d.ts.map +1 -1
- package/dist/core/work/state.js +10 -14
- package/dist/core/workflow/admission.d.ts +23 -0
- package/dist/core/workflow/admission.d.ts.map +1 -0
- package/dist/core/workflow/admission.js +136 -0
- package/dist/core/workflow/engine.d.ts.map +1 -1
- package/dist/core/workflow/engine.js +77 -2
- package/dist/core/workflow/index.d.ts +3 -2
- package/dist/core/workflow/index.d.ts.map +1 -1
- package/dist/core/workflow/index.js +2 -1
- package/dist/core/workflow/live-session-v3.d.ts.map +1 -1
- package/dist/core/workflow/live-session-v3.js +2 -1
- package/dist/core/workflow/proof.d.ts +2 -1
- package/dist/core/workflow/proof.d.ts.map +1 -1
- package/dist/core/workflow/proof.js +39 -1
- package/dist/core/workflow/run-state.d.ts +3 -2
- package/dist/core/workflow/run-state.d.ts.map +1 -1
- package/dist/core/workflow/run-state.js +8 -1
- package/dist/core/workflow/types.d.ts +33 -1
- package/dist/core/workflow/types.d.ts.map +1 -1
- package/dist/core/workflow/types.js +2 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/lazy-commands.d.ts +26 -0
- package/dist/lazy-commands.d.ts.map +1 -0
- package/dist/lazy-commands.js +210 -0
- package/dist/lib/browser/client.d.ts +5 -0
- package/dist/lib/browser/client.d.ts.map +1 -1
- package/dist/lib/browser/client.js +1 -0
- package/dist/lib/browser/index.d.ts +2 -0
- package/dist/lib/browser/index.d.ts.map +1 -1
- package/dist/lib/browser/index.js +2 -0
- package/dist/lib/browser/qa-run-contracts.d.ts +173 -0
- package/dist/lib/browser/qa-run-contracts.d.ts.map +1 -0
- package/dist/lib/browser/qa-run-contracts.js +226 -0
- package/dist/lib/browser/qa-run.d.ts +51 -0
- package/dist/lib/browser/qa-run.d.ts.map +1 -0
- package/dist/lib/browser/qa-run.js +684 -0
- package/dist/lib/coord-root-id.d.ts +9 -0
- package/dist/lib/coord-root-id.d.ts.map +1 -0
- package/dist/lib/coord-root-id.js +17 -0
- package/dist/lib/docs-lint.d.ts +2 -0
- package/dist/lib/docs-lint.d.ts.map +1 -1
- package/dist/lib/docs-lint.js +45 -80
- package/dist/lib/docs-metadata-audit.d.ts +3 -0
- package/dist/lib/docs-metadata-audit.d.ts.map +1 -1
- package/dist/lib/docs-metadata-audit.js +13 -23
- package/dist/lib/docs-metadata-sync.d.ts +1 -0
- package/dist/lib/docs-metadata-sync.d.ts.map +1 -1
- package/dist/lib/docs-metadata-sync.js +28 -10
- package/dist/lib/docs-repository-view.d.ts +22 -0
- package/dist/lib/docs-repository-view.d.ts.map +1 -0
- package/dist/lib/docs-repository-view.js +185 -0
- package/dist/lib/http/client.d.ts +11 -5
- package/dist/lib/http/client.d.ts.map +1 -1
- package/dist/lib/http/client.js +22 -4
- package/dist/lib/http/index.d.ts +1 -1
- package/dist/lib/http/index.d.ts.map +1 -1
- package/dist/lib/http/index.js +1 -1
- package/dist/lib/indexer-exclusions.d.ts +27 -0
- package/dist/lib/indexer-exclusions.d.ts.map +1 -0
- package/dist/lib/indexer-exclusions.js +176 -0
- package/dist/lib/instructions/apply.d.ts +3 -1
- package/dist/lib/instructions/apply.d.ts.map +1 -1
- package/dist/lib/instructions/apply.js +74 -3
- package/dist/lib/instructions/templates.d.ts.map +1 -1
- package/dist/lib/instructions/templates.js +11 -0
- package/dist/lib/local-file-url.d.ts +9 -0
- package/dist/lib/local-file-url.d.ts.map +1 -0
- package/dist/lib/local-file-url.js +20 -0
- package/dist/lib/web-performance.d.ts +118 -0
- package/dist/lib/web-performance.d.ts.map +1 -0
- package/dist/lib/web-performance.js +192 -0
- package/package.json +40 -2
- package/schemas/config.schema.json +58 -0
- package/schemas/event-v3.schema.json +324 -112
- package/src/commander.ts +488 -95
- package/src/commands/agents.ts +617 -237
- package/src/commands/artifacts.ts +40 -2
- package/src/commands/backup.ts +18 -14
- package/src/commands/browse-session.ts +12 -0
- package/src/commands/browse.ts +21 -7
- package/src/commands/conversations.ts +279 -0
- package/src/commands/deinit.ts +6 -0
- package/src/commands/diagnostics.ts +271 -0
- package/src/commands/docs.ts +25 -6
- package/src/commands/doctor.ts +75 -9
- package/src/commands/fetch.ts +7 -6
- package/src/commands/files.ts +243 -0
- package/src/commands/governor.ts +21 -12
- package/src/commands/inbox.ts +61 -0
- package/src/commands/init.ts +78 -16
- package/src/commands/ledger-v3.ts +503 -1
- package/src/commands/logs.ts +224 -0
- package/src/commands/messages.ts +61 -0
- package/src/commands/outline.ts +6 -2
- package/src/commands/qa-run.ts +184 -0
- package/src/commands/read.ts +6 -2
- package/src/commands/resources.ts +38 -0
- package/src/commands/semantic.ts +66 -1
- package/src/commands/storage.ts +310 -0
- package/src/commands/supervisor.ts +141 -0
- package/src/commands/tunnel.ts +66 -52
- package/src/commands/web.ts +96 -7
- package/src/commands/work.ts +3 -3
- package/src/commands/workflow.ts +21 -13
- package/src/core/agents/cli.ts +265 -55
- package/src/core/agents/health.ts +142 -0
- package/src/core/agents/live-authority-v3.ts +341 -10
- package/src/core/agents/live-lifecycle-v3.ts +6 -1
- package/src/core/agents/live-observation-v3.ts +6 -1
- package/src/core/agents/mailbox.ts +373 -0
- package/src/core/agents/reconcile-coordination-v3.ts +77 -0
- package/src/core/agents/render/prompt-context.ts +66 -15
- package/src/core/agents/render/session-context.ts +37 -3
- package/src/core/agents/rules/commit-conflict.ts +58 -1
- package/src/core/agents/rules/stop-hook.ts +105 -20
- package/src/core/agents/rules/verdict.ts +1 -0
- package/src/core/agents/session-events.ts +4 -0
- package/src/core/agents/session-finalization-state-v3.ts +1 -1
- package/src/core/agents/session-finalizer-v3.ts +8 -2
- package/src/core/agents/state/activity-log.ts +7 -2
- package/src/core/agents/state/heartbeat-writer.ts +27 -0
- package/src/core/agents/state/live-coordination-view.ts +16 -105
- package/src/core/agents/state/live-coordination-writer.ts +141 -0
- package/src/core/artifacts/index.ts +260 -11
- package/src/core/config.ts +235 -5
- package/src/core/conversations/archive.ts +237 -0
- package/src/core/conversations/catalog.ts +79 -0
- package/src/core/conversations/context-pack.ts +72 -0
- package/src/core/conversations/contract.ts +178 -0
- package/src/core/conversations/evaluation.ts +30 -0
- package/src/core/conversations/index.ts +9 -0
- package/src/core/conversations/lifecycle.ts +63 -0
- package/src/core/conversations/normalize.ts +105 -0
- package/src/core/conversations/query.ts +318 -0
- package/src/core/conversations/search-index.ts +48 -0
- package/src/core/diagnostics/advice.ts +147 -0
- package/src/core/diagnostics/bundle.ts +1142 -0
- package/src/core/diagnostics/comparison.ts +565 -0
- package/src/core/diagnostics/contract.ts +311 -0
- package/src/core/diagnostics/identity.ts +11 -0
- package/src/core/diagnostics/index.ts +7 -0
- package/src/core/diagnostics/replay.ts +314 -0
- package/src/core/diagnostics/sanitize.ts +97 -0
- package/src/core/events/legacy-storage/canary.ts +177 -0
- package/src/core/events/legacy-storage/compression.ts +130 -0
- package/src/core/events/legacy-storage/fence.ts +129 -0
- package/src/core/events/legacy-storage/index.ts +6 -0
- package/src/core/events/legacy-storage/inventory.ts +51 -0
- package/src/core/events/legacy-storage/manifest.ts +136 -0
- package/src/core/events/legacy-storage/reader.ts +178 -0
- package/src/core/events/v3/archive-retention.ts +251 -0
- package/src/core/events/v3/authority-outbox.ts +22 -1
- package/src/core/events/v3/base-contract.ts +17 -7
- package/src/core/events/v3/bootstrap.ts +195 -2
- package/src/core/events/v3/capabilities.ts +5 -3
- package/src/core/events/v3/control-witness.ts +339 -0
- package/src/core/events/v3/control-writer.ts +16 -0
- package/src/core/events/v3/control.ts +54 -18
- package/src/core/events/v3/coordination-transaction-recovery.ts +477 -0
- package/src/core/events/v3/coordination-view.ts +17 -1
- package/src/core/events/v3/generated.ts +1 -1
- package/src/core/events/v3/index.ts +14 -2
- package/src/core/events/v3/live-route-observer.ts +80 -0
- package/src/core/events/v3/live-routing.ts +65 -46
- package/src/core/events/v3/producers/coordination-recorder.ts +95 -10
- package/src/core/events/v3/producers/diagnostic-summaries.ts +593 -0
- package/src/core/events/v3/producers/hook-base.ts +15 -3
- package/src/core/events/v3/producers/intake.ts +31 -2
- package/src/core/events/v3/producers/producer-state-observer.ts +52 -0
- package/src/core/events/v3/producers/recorder.ts +681 -34
- package/src/core/events/v3/reader.ts +243 -2
- package/src/core/events/v3/rotation-config.ts +98 -0
- package/src/core/events/v3/runtime-build.ts +41 -0
- package/src/core/events/v3/runtime-identity.ts +16 -0
- package/src/core/events/v3/runtime-telemetry-capabilities.ts +14 -8
- package/src/core/events/v3/support-storage/classify.ts +209 -0
- package/src/core/events/v3/support-storage/eligibility.ts +58 -0
- package/src/core/events/v3/support-storage/index.ts +9 -0
- package/src/core/events/v3/support-storage/inventory.ts +135 -0
- package/src/core/events/v3/support-storage/logical-authority.ts +117 -0
- package/src/core/events/v3/support-storage/maintenance.ts +501 -0
- package/src/core/events/v3/support-storage/pack-contract.ts +337 -0
- package/src/core/events/v3/support-storage/pack-reader.ts +346 -0
- package/src/core/events/v3/support-storage/pack-writer.ts +352 -0
- package/src/core/events/v3/support-storage/recovery.ts +43 -0
- package/src/core/events/v3/turn-telemetry.ts +58 -7
- package/src/core/events/v3/writer.ts +168 -16
- package/src/core/governor/plan-read.ts +5 -18
- package/src/core/governor/planning.ts +5 -8
- package/src/core/governor/service-read.ts +320 -2
- package/src/core/governor/service.ts +49 -22
- package/src/core/guard/evidence-v3.ts +1 -0
- package/src/core/hooks/adapter/events.ts +1 -0
- package/src/core/hooks/adapter/output.ts +23 -5
- package/src/core/hooks/adapter/runtime-telemetry.ts +408 -13
- package/src/core/hooks/cli.ts +404 -233
- package/src/core/hooks/effects/image-capture.ts +4 -1
- package/src/core/hooks/health.ts +146 -0
- package/src/core/hooks/remediation-cap.ts +12 -6
- package/src/core/hooks/resolve/coord-root.ts +91 -11
- package/src/core/hooks/resolve/owner.ts +4 -0
- package/src/core/hooks/resolve/transcript.ts +18 -0
- package/src/core/inbox/contract.ts +81 -0
- package/src/core/inbox/index.ts +4 -0
- package/src/core/inbox/lifecycle.ts +104 -0
- package/src/core/inbox/service.ts +305 -0
- package/src/core/inbox/watcher.ts +36 -0
- package/src/core/presence/codec-digest.ts +15 -9
- package/src/core/presence/relay-client.ts +55 -7
- package/src/core/resources/contract.ts +98 -0
- package/src/core/resources/index.ts +5 -0
- package/src/core/resources/sampler.ts +458 -0
- package/src/core/resources/service-status.ts +62 -0
- package/src/core/resources/service.ts +337 -0
- package/src/core/resources/storage.ts +44 -0
- package/src/core/semantic/adapters.ts +200 -41
- package/src/core/semantic/contract.ts +135 -3
- package/src/core/semantic/index.ts +76 -2
- package/src/core/semantic/once.ts +93 -7
- package/src/core/semantic/prompt.ts +13 -1
- package/src/core/semantic/review.ts +803 -0
- package/src/core/semantic/routes.ts +30 -0
- package/src/core/semantic/scheduler.ts +49 -5
- package/src/core/semantic/service-status.ts +99 -5
- package/src/core/semantic/service.ts +116 -15
- package/src/core/semantic/soak.ts +638 -0
- package/src/core/semantic/storage.ts +20 -6
- package/src/core/semantic/usage.ts +272 -0
- package/src/core/semantic/validate.ts +31 -0
- package/src/core/storage/atomic-json.ts +15 -0
- package/src/core/storage/buffer.ts +124 -0
- package/src/core/storage/builtins.ts +972 -0
- package/src/core/storage/catalog.ts +467 -0
- package/src/core/storage/config.ts +423 -0
- package/src/core/storage/contract.ts +342 -0
- package/src/core/storage/durable-history.ts +738 -0
- package/src/core/storage/health.ts +76 -0
- package/src/core/storage/index.ts +15 -0
- package/src/core/storage/inventory.ts +859 -0
- package/src/core/storage/jsonl.ts +213 -0
- package/src/core/storage/log-retention.ts +555 -0
- package/src/core/storage/logger.ts +548 -0
- package/src/core/storage/maintenance-providers.ts +200 -0
- package/src/core/storage/maintenance.ts +929 -0
- package/src/core/storage/metrics.ts +199 -0
- package/src/core/storage/policy.ts +141 -0
- package/src/core/storage/process-log.ts +203 -0
- package/src/core/storage/query.ts +418 -0
- package/src/core/storage/receipts.ts +162 -0
- package/src/core/storage/segments.ts +721 -0
- package/src/core/storage/sink-graph.ts +343 -0
- package/src/core/storage/storm-control.ts +91 -0
- package/src/core/supervisor/activity.ts +193 -0
- package/src/core/supervisor/contract.ts +312 -0
- package/src/core/supervisor/explanations.ts +104 -0
- package/src/core/supervisor/findings.ts +788 -0
- package/src/core/supervisor/history.ts +61 -0
- package/src/core/supervisor/hook-health-alerts.ts +108 -0
- package/src/core/supervisor/hook-health-storage.ts +25 -0
- package/src/core/supervisor/hook-health.ts +301 -0
- package/src/core/supervisor/hooks.ts +35 -0
- package/src/core/supervisor/index.ts +14 -0
- package/src/core/supervisor/log-feed.ts +131 -0
- package/src/core/supervisor/service.ts +511 -0
- package/src/core/supervisor/services.ts +203 -0
- package/src/core/supervisor/status.ts +59 -0
- package/src/core/supervisor/storage.ts +126 -0
- package/src/core/supervisor/timeline.ts +133 -0
- package/src/core/work/state.ts +12 -21
- package/src/core/workflow/admission.ts +215 -0
- package/src/core/workflow/engine.ts +93 -1
- package/src/core/workflow/index.ts +10 -0
- package/src/core/workflow/live-session-v3.ts +2 -4
- package/src/core/workflow/proof.ts +54 -1
- package/src/core/workflow/run-state.ts +13 -1
- package/src/core/workflow/types.ts +39 -1
- package/src/index.ts +2 -0
- package/src/lazy-commands.ts +294 -0
- package/src/lib/browser/client.ts +6 -0
- package/src/lib/browser/index.ts +29 -0
- package/src/lib/browser/qa-run-contracts.ts +380 -0
- package/src/lib/browser/qa-run.ts +784 -0
- package/src/lib/coord-root-id.ts +23 -0
- package/src/lib/docs-lint.ts +58 -77
- package/src/lib/docs-metadata-audit.ts +26 -21
- package/src/lib/docs-metadata-sync.ts +32 -9
- package/src/lib/docs-repository-view.ts +220 -0
- package/src/lib/http/client.ts +44 -8
- package/src/lib/http/index.ts +6 -1
- package/src/lib/indexer-exclusions.ts +173 -0
- package/src/lib/instructions/apply.ts +81 -2
- package/src/lib/instructions/templates.ts +11 -0
- package/src/lib/local-file-url.ts +31 -0
- package/src/lib/web-performance.ts +335 -0
|
@@ -6,23 +6,22 @@ import { promisify } from "node:util";
|
|
|
6
6
|
import type { TSchema } from "@sinclair/typebox";
|
|
7
7
|
import { whichBin } from "../../lib/headless/index.ts";
|
|
8
8
|
import {
|
|
9
|
-
type SemanticConfiguredModel,
|
|
10
9
|
type SemanticHarness,
|
|
11
10
|
SemanticModelReplyV2Schema,
|
|
11
|
+
type SemanticUsageReceiptV1,
|
|
12
12
|
} from "./contract.ts";
|
|
13
|
+
import { SEMANTIC_READER_ROUTES, type SemanticReaderRoute } from "./routes.ts";
|
|
13
14
|
import type { SemanticReaderResolution } from "./storage.ts";
|
|
15
|
+
import {
|
|
16
|
+
estimateVisibleSemanticUsage,
|
|
17
|
+
nativeSemanticUsage,
|
|
18
|
+
unreportedSemanticUsage,
|
|
19
|
+
} from "./usage.ts";
|
|
14
20
|
|
|
15
21
|
const execFileAsync = promisify(execFile);
|
|
16
22
|
const MAX_OUTPUT_BYTES = 512 * 1024;
|
|
17
23
|
const DEFAULT_TIMEOUT_MS = 90_000;
|
|
18
24
|
|
|
19
|
-
export interface SemanticReaderRoute {
|
|
20
|
-
harness: SemanticHarness;
|
|
21
|
-
binary: string;
|
|
22
|
-
configured_model: SemanticConfiguredModel;
|
|
23
|
-
invocation_model_id: string;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
25
|
export interface SemanticAdapterSuccess {
|
|
27
26
|
ok: true;
|
|
28
27
|
text: string;
|
|
@@ -30,6 +29,7 @@ export interface SemanticAdapterSuccess {
|
|
|
30
29
|
model_attestation: "verified" | "requested-only";
|
|
31
30
|
duration_ms: number;
|
|
32
31
|
output_bytes: number;
|
|
32
|
+
usage: SemanticUsageReceiptV1;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
export interface SemanticAdapterFailure {
|
|
@@ -42,6 +42,7 @@ export interface SemanticAdapterFailure {
|
|
|
42
42
|
resolved_model_id?: string;
|
|
43
43
|
model_attestation?: "verified" | "requested-only";
|
|
44
44
|
duration_ms: number;
|
|
45
|
+
usage: SemanticUsageReceiptV1;
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
export type SemanticAdapterResult = SemanticAdapterSuccess | SemanticAdapterFailure;
|
|
@@ -56,26 +57,7 @@ export interface SemanticAdapter {
|
|
|
56
57
|
): Promise<SemanticAdapterResult>;
|
|
57
58
|
}
|
|
58
59
|
|
|
59
|
-
export
|
|
60
|
-
"claude-code": {
|
|
61
|
-
harness: "claude-code",
|
|
62
|
-
binary: "claude",
|
|
63
|
-
configured_model: "haiku-4.5",
|
|
64
|
-
invocation_model_id: "claude-haiku-4-5-20251001",
|
|
65
|
-
},
|
|
66
|
-
codex: {
|
|
67
|
-
harness: "codex",
|
|
68
|
-
binary: "codex",
|
|
69
|
-
configured_model: "gpt-5.6-luna",
|
|
70
|
-
invocation_model_id: "gpt-5.6-luna",
|
|
71
|
-
},
|
|
72
|
-
cursor: {
|
|
73
|
-
harness: "cursor",
|
|
74
|
-
binary: "cursor-agent",
|
|
75
|
-
configured_model: "composer-2.5",
|
|
76
|
-
invocation_model_id: "composer-2.5",
|
|
77
|
-
},
|
|
78
|
-
};
|
|
60
|
+
export { SEMANTIC_READER_ROUTES, type SemanticReaderRoute } from "./routes.ts";
|
|
79
61
|
|
|
80
62
|
export function createSemanticAdapters(): Record<SemanticHarness, SemanticAdapter> {
|
|
81
63
|
return {
|
|
@@ -119,7 +101,12 @@ function createAdapter(route: SemanticReaderRoute): SemanticAdapter {
|
|
|
119
101
|
responseSchema = SemanticModelReplyV2Schema,
|
|
120
102
|
) {
|
|
121
103
|
if (!whichBin(route.binary)) {
|
|
122
|
-
return {
|
|
104
|
+
return {
|
|
105
|
+
ok: false,
|
|
106
|
+
reason_code: "harness_unavailable",
|
|
107
|
+
duration_ms: 0,
|
|
108
|
+
usage: unreportedSemanticUsage(),
|
|
109
|
+
};
|
|
123
110
|
}
|
|
124
111
|
return await invokeRoute(route, prompt, timeoutMs, responseSchema);
|
|
125
112
|
},
|
|
@@ -144,16 +131,22 @@ async function invokeRoute(
|
|
|
144
131
|
});
|
|
145
132
|
pending.child.stdin?.end();
|
|
146
133
|
const { stdout } = await pending;
|
|
147
|
-
const
|
|
148
|
-
|
|
134
|
+
const outputFileText = invocation.outputFile
|
|
135
|
+
? readFileSync(invocation.outputFile, "utf8")
|
|
136
|
+
: undefined;
|
|
137
|
+
const parsed = parseSemanticHarnessOutput(route.harness, stdout, outputFileText);
|
|
149
138
|
if (!parsed.text.trim()) throw new Error("empty semantic response");
|
|
150
|
-
if (
|
|
139
|
+
if (
|
|
140
|
+
parsed.executedModelId &&
|
|
141
|
+
!modelIdsMatch(parsed.executedModelId, route.invocation_model_id)
|
|
142
|
+
) {
|
|
151
143
|
return {
|
|
152
144
|
ok: false,
|
|
153
145
|
reason_code: "model_mismatch",
|
|
154
146
|
resolved_model_id: parsed.executedModelId,
|
|
155
147
|
model_attestation: "verified",
|
|
156
148
|
duration_ms: Date.now() - started,
|
|
149
|
+
usage: parsed.usage ?? unreportedSemanticUsage(),
|
|
157
150
|
};
|
|
158
151
|
}
|
|
159
152
|
return {
|
|
@@ -163,6 +156,7 @@ async function invokeRoute(
|
|
|
163
156
|
model_attestation: parsed.executedModelId ? "verified" : "requested-only",
|
|
164
157
|
duration_ms: Date.now() - started,
|
|
165
158
|
output_bytes: Buffer.byteLength(parsed.text),
|
|
159
|
+
usage: parsed.usage ?? estimateVisibleSemanticUsage(prompt, parsed.text),
|
|
166
160
|
};
|
|
167
161
|
} catch (error) {
|
|
168
162
|
return {
|
|
@@ -171,6 +165,7 @@ async function invokeRoute(
|
|
|
171
165
|
resolved_model_id: route.invocation_model_id,
|
|
172
166
|
model_attestation: "requested-only",
|
|
173
167
|
duration_ms: Date.now() - started,
|
|
168
|
+
usage: unreportedSemanticUsage(),
|
|
174
169
|
};
|
|
175
170
|
} finally {
|
|
176
171
|
rmSync(dir, { recursive: true, force: true });
|
|
@@ -222,6 +217,7 @@ function buildInvocation(
|
|
|
222
217
|
"--ephemeral",
|
|
223
218
|
"--ignore-user-config",
|
|
224
219
|
"--ignore-rules",
|
|
220
|
+
"--json",
|
|
225
221
|
"--output-last-message",
|
|
226
222
|
outputFile,
|
|
227
223
|
"--cd",
|
|
@@ -235,7 +231,7 @@ function buildInvocation(
|
|
|
235
231
|
"-p",
|
|
236
232
|
prompt,
|
|
237
233
|
"--output-format",
|
|
238
|
-
"json",
|
|
234
|
+
"stream-json",
|
|
239
235
|
"--mode",
|
|
240
236
|
"ask",
|
|
241
237
|
"--sandbox",
|
|
@@ -247,28 +243,191 @@ function buildInvocation(
|
|
|
247
243
|
};
|
|
248
244
|
}
|
|
249
245
|
|
|
250
|
-
|
|
246
|
+
export interface ParsedSemanticHarnessOutput {
|
|
247
|
+
text: string;
|
|
248
|
+
executedModelId?: string;
|
|
249
|
+
usage?: SemanticUsageReceiptV1;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export function parseSemanticHarnessOutput(
|
|
251
253
|
harness: SemanticHarness,
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
254
|
+
stdout: string,
|
|
255
|
+
outputFileText?: string,
|
|
256
|
+
): ParsedSemanticHarnessOutput {
|
|
257
|
+
if (harness === "codex") return parseCodexOutput(stdout, outputFileText);
|
|
258
|
+
if (harness === "cursor") return parseCursorOutput(stdout);
|
|
255
259
|
try {
|
|
256
|
-
const envelope = JSON.parse(
|
|
260
|
+
const envelope = JSON.parse(stdout) as {
|
|
257
261
|
is_error?: boolean;
|
|
258
262
|
result?: unknown;
|
|
263
|
+
structured_output?: unknown;
|
|
259
264
|
model?: unknown;
|
|
265
|
+
usage?: unknown;
|
|
266
|
+
modelUsage?: unknown;
|
|
267
|
+
model_usage?: unknown;
|
|
260
268
|
};
|
|
261
269
|
if (envelope.is_error) throw new Error("harness returned an error envelope");
|
|
270
|
+
const structured = envelope.structured_output;
|
|
271
|
+
const modelUsage = objectValue(envelope.modelUsage) ?? objectValue(envelope.model_usage);
|
|
272
|
+
const modelUsageEntries = modelUsage ? Object.entries(modelUsage) : [];
|
|
273
|
+
const executedModelId =
|
|
274
|
+
typeof envelope.model === "string"
|
|
275
|
+
? envelope.model
|
|
276
|
+
: modelUsageEntries.length === 1
|
|
277
|
+
? modelUsageEntries[0]![0]
|
|
278
|
+
: undefined;
|
|
279
|
+
const usage = parseClaudeUsage(envelope.usage) ?? aggregateClaudeModelUsage(modelUsageEntries);
|
|
262
280
|
return {
|
|
263
|
-
text:
|
|
264
|
-
|
|
281
|
+
text:
|
|
282
|
+
structured !== undefined
|
|
283
|
+
? JSON.stringify(structured)
|
|
284
|
+
: typeof envelope.result === "string"
|
|
285
|
+
? envelope.result
|
|
286
|
+
: "",
|
|
287
|
+
...(executedModelId ? { executedModelId } : {}),
|
|
288
|
+
...(usage ? { usage } : {}),
|
|
265
289
|
};
|
|
266
290
|
} catch (error) {
|
|
267
|
-
if (error instanceof SyntaxError) return { text:
|
|
291
|
+
if (error instanceof SyntaxError) return { text: stdout };
|
|
268
292
|
throw error;
|
|
269
293
|
}
|
|
270
294
|
}
|
|
271
295
|
|
|
296
|
+
function parseCodexOutput(stdout: string, outputFileText?: string): ParsedSemanticHarnessOutput {
|
|
297
|
+
const events = parseJsonLines(stdout);
|
|
298
|
+
const completed = [...events]
|
|
299
|
+
.reverse()
|
|
300
|
+
.find((event) => event.type === "turn.completed" && objectValue(event.usage));
|
|
301
|
+
const usage = completed ? parseCodexUsage(completed.usage) : undefined;
|
|
302
|
+
const streamedText = [...events]
|
|
303
|
+
.reverse()
|
|
304
|
+
.map((event) => objectValue(event.item))
|
|
305
|
+
.find((item) => item?.type === "agent_message" && typeof item.text === "string")?.text;
|
|
306
|
+
return {
|
|
307
|
+
text: outputFileText ?? (typeof streamedText === "string" ? streamedText : ""),
|
|
308
|
+
...(usage ? { usage } : {}),
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
function parseCursorOutput(stdout: string): ParsedSemanticHarnessOutput {
|
|
313
|
+
const events = parseJsonLines(stdout);
|
|
314
|
+
const init = events.find(
|
|
315
|
+
(event) =>
|
|
316
|
+
event.type === "system" && event.subtype === "init" && typeof event.model === "string",
|
|
317
|
+
);
|
|
318
|
+
const terminal = [...events]
|
|
319
|
+
.reverse()
|
|
320
|
+
.find((event) => event.type === "result" && typeof event.result === "string");
|
|
321
|
+
if (!terminal) {
|
|
322
|
+
try {
|
|
323
|
+
const envelope = JSON.parse(stdout) as Record<string, unknown>;
|
|
324
|
+
if (envelope.is_error) throw new Error("harness returned an error envelope");
|
|
325
|
+
return {
|
|
326
|
+
text: typeof envelope.result === "string" ? envelope.result : "",
|
|
327
|
+
...(typeof envelope.model === "string" ? { executedModelId: envelope.model } : {}),
|
|
328
|
+
...(parseCursorUsage(envelope.usage) ? { usage: parseCursorUsage(envelope.usage) } : {}),
|
|
329
|
+
};
|
|
330
|
+
} catch (error) {
|
|
331
|
+
if (error instanceof SyntaxError) return { text: stdout };
|
|
332
|
+
throw error;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
if (terminal.is_error) throw new Error("harness returned an error envelope");
|
|
336
|
+
const usage = parseCursorUsage(terminal.usage);
|
|
337
|
+
return {
|
|
338
|
+
text: terminal.result as string,
|
|
339
|
+
...(typeof init?.model === "string" ? { executedModelId: init.model } : {}),
|
|
340
|
+
...(usage ? { usage } : {}),
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
function parseClaudeUsage(value: unknown): SemanticUsageReceiptV1 | undefined {
|
|
345
|
+
const usage = objectValue(value);
|
|
346
|
+
if (!usage) return undefined;
|
|
347
|
+
return nativeSemanticUsage({
|
|
348
|
+
input_tokens: usage.input_tokens,
|
|
349
|
+
cached_input_tokens: usage.cache_read_input_tokens,
|
|
350
|
+
cache_creation_input_tokens: usage.cache_creation_input_tokens,
|
|
351
|
+
output_tokens: usage.output_tokens,
|
|
352
|
+
reasoning_tokens: usage.reasoning_tokens ?? usage.reasoning_output_tokens,
|
|
353
|
+
total_tokens: usage.total_tokens,
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
function aggregateClaudeModelUsage(
|
|
358
|
+
entries: [string, unknown][],
|
|
359
|
+
): SemanticUsageReceiptV1 | undefined {
|
|
360
|
+
const values: Record<string, number> = {};
|
|
361
|
+
for (const [, raw] of entries) {
|
|
362
|
+
const usage = objectValue(raw);
|
|
363
|
+
if (!usage) continue;
|
|
364
|
+
addNumber(values, "input_tokens", usage.inputTokens);
|
|
365
|
+
addNumber(values, "cached_input_tokens", usage.cacheReadInputTokens);
|
|
366
|
+
addNumber(values, "cache_creation_input_tokens", usage.cacheCreationInputTokens);
|
|
367
|
+
addNumber(values, "output_tokens", usage.outputTokens);
|
|
368
|
+
}
|
|
369
|
+
return nativeSemanticUsage(values);
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
function parseCodexUsage(value: unknown): SemanticUsageReceiptV1 | undefined {
|
|
373
|
+
const usage = objectValue(value);
|
|
374
|
+
if (!usage) return undefined;
|
|
375
|
+
return nativeSemanticUsage({
|
|
376
|
+
input_tokens: usage.input_tokens,
|
|
377
|
+
cached_input_tokens: usage.cached_input_tokens,
|
|
378
|
+
cache_creation_input_tokens: usage.cache_write_input_tokens,
|
|
379
|
+
output_tokens: usage.output_tokens,
|
|
380
|
+
reasoning_tokens: usage.reasoning_output_tokens,
|
|
381
|
+
total_tokens: usage.total_tokens,
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
function parseCursorUsage(value: unknown): SemanticUsageReceiptV1 | undefined {
|
|
386
|
+
const usage = objectValue(value);
|
|
387
|
+
if (!usage) return undefined;
|
|
388
|
+
return nativeSemanticUsage({
|
|
389
|
+
input_tokens: usage.inputTokens ?? usage.input_tokens,
|
|
390
|
+
cached_input_tokens:
|
|
391
|
+
usage.cacheReadTokens ?? usage.cachedInputTokens ?? usage.cached_input_tokens,
|
|
392
|
+
cache_creation_input_tokens:
|
|
393
|
+
usage.cacheWriteTokens ?? usage.cacheCreationInputTokens ?? usage.cache_write_input_tokens,
|
|
394
|
+
output_tokens: usage.outputTokens ?? usage.output_tokens,
|
|
395
|
+
reasoning_tokens: usage.reasoningTokens ?? usage.reasoning_output_tokens,
|
|
396
|
+
total_tokens: usage.totalTokens ?? usage.total_tokens,
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
function parseJsonLines(raw: string): Record<string, unknown>[] {
|
|
401
|
+
return raw
|
|
402
|
+
.split(/\r?\n/)
|
|
403
|
+
.filter((line) => line.trim().length > 0)
|
|
404
|
+
.flatMap((line) => {
|
|
405
|
+
try {
|
|
406
|
+
const value = JSON.parse(line) as unknown;
|
|
407
|
+
return objectValue(value) ? [value as Record<string, unknown>] : [];
|
|
408
|
+
} catch {
|
|
409
|
+
return [];
|
|
410
|
+
}
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
function objectValue(value: unknown): Record<string, unknown> | undefined {
|
|
415
|
+
return value !== null && typeof value === "object" && !Array.isArray(value)
|
|
416
|
+
? (value as Record<string, unknown>)
|
|
417
|
+
: undefined;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
function addNumber(target: Record<string, number>, field: string, value: unknown): void {
|
|
421
|
+
if (typeof value === "number" && Number.isSafeInteger(value) && value >= 0) {
|
|
422
|
+
target[field] = (target[field] ?? 0) + value;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
function modelIdsMatch(attested: string, requested: string): boolean {
|
|
427
|
+
const normalize = (value: string) => value.toLowerCase().replace(/[^a-z0-9]+/g, "-");
|
|
428
|
+
return normalize(attested) === normalize(requested);
|
|
429
|
+
}
|
|
430
|
+
|
|
272
431
|
function semanticChildEnv(): NodeJS.ProcessEnv {
|
|
273
432
|
const env = { ...process.env };
|
|
274
433
|
for (const key of Object.keys(env)) {
|
|
@@ -3,7 +3,10 @@ import { type Static, type TProperties, type TSchema, Type } from "@sinclair/typ
|
|
|
3
3
|
export const SEMANTIC_EVIDENCE_SCHEMA_VERSION = 1 as const;
|
|
4
4
|
export const SEMANTIC_READ_MODEL_SCHEMA_VERSION = 2 as const;
|
|
5
5
|
export const SEMANTIC_EVIDENCE_CONTRACT_VERSION = 1 as const;
|
|
6
|
-
export const SEMANTIC_PROMPT_CONTRACT_VERSION =
|
|
6
|
+
export const SEMANTIC_PROMPT_CONTRACT_VERSION = 4 as const;
|
|
7
|
+
export const SEMANTIC_USAGE_SCHEMA_VERSION = 1 as const;
|
|
8
|
+
export const SEMANTIC_VISIBLE_USAGE_ESTIMATOR_ID = "visible-o200k-base" as const;
|
|
9
|
+
export const SEMANTIC_VISIBLE_USAGE_ESTIMATOR_VERSION = 1 as const;
|
|
7
10
|
|
|
8
11
|
const StrictObject = <T extends TProperties>(properties: T) =>
|
|
9
12
|
Type.Object(properties, { additionalProperties: false });
|
|
@@ -74,6 +77,16 @@ export const SEMANTIC_EVIDENCE_KINDS = [
|
|
|
74
77
|
"recovery",
|
|
75
78
|
"claim-conflict",
|
|
76
79
|
] as const;
|
|
80
|
+
export const SEMANTIC_INVALID_REASON_CODES = [
|
|
81
|
+
"schema",
|
|
82
|
+
"identity",
|
|
83
|
+
"citation",
|
|
84
|
+
"basis",
|
|
85
|
+
"confidence",
|
|
86
|
+
"privacy",
|
|
87
|
+
"unsupported_claim",
|
|
88
|
+
"unknown",
|
|
89
|
+
] as const;
|
|
77
90
|
|
|
78
91
|
export type SemanticHarness = (typeof SEMANTIC_HARNESSES)[number];
|
|
79
92
|
export type SemanticConfiguredModel = (typeof SEMANTIC_CONFIGURED_MODELS)[number];
|
|
@@ -81,6 +94,7 @@ export type SemanticPhase = (typeof SEMANTIC_PHASES)[number];
|
|
|
81
94
|
export type SemanticExpressionCue = (typeof SEMANTIC_EXPRESSION_CUES)[number];
|
|
82
95
|
export type SemanticTag = (typeof SEMANTIC_TAGS)[number];
|
|
83
96
|
export type SemanticEvidenceKind = (typeof SEMANTIC_EVIDENCE_KINDS)[number];
|
|
97
|
+
export type SemanticInvalidReasonCode = (typeof SEMANTIC_INVALID_REASON_CODES)[number];
|
|
84
98
|
export type SemanticBasis =
|
|
85
99
|
| "direct-fact"
|
|
86
100
|
| "deterministic-projection"
|
|
@@ -98,12 +112,67 @@ const ExpressionCueSchema = Type.Union(
|
|
|
98
112
|
);
|
|
99
113
|
const TagSchema = Type.Union(SEMANTIC_TAGS.map((value) => Type.Literal(value)));
|
|
100
114
|
const EvidenceKindSchema = Type.Union(SEMANTIC_EVIDENCE_KINDS.map((value) => Type.Literal(value)));
|
|
115
|
+
const InvalidReasonCodeSchema = Type.Union(
|
|
116
|
+
SEMANTIC_INVALID_REASON_CODES.map((value) => Type.Literal(value)),
|
|
117
|
+
);
|
|
101
118
|
const ConfidenceSchema = Type.Union([
|
|
102
119
|
Type.Literal("high"),
|
|
103
120
|
Type.Literal("medium"),
|
|
104
121
|
Type.Literal("low"),
|
|
105
122
|
]);
|
|
106
123
|
|
|
124
|
+
const NativeUsageTokenSchema = StrictObject({
|
|
125
|
+
value: Type.Integer({ minimum: 0 }),
|
|
126
|
+
provenance: Type.Literal("native"),
|
|
127
|
+
});
|
|
128
|
+
const EstimatedUsageTokenSchema = StrictObject({
|
|
129
|
+
value: Type.Integer({ minimum: 0 }),
|
|
130
|
+
provenance: Type.Literal("estimated"),
|
|
131
|
+
});
|
|
132
|
+
const NativeUsageTokensSchema = StrictObject({
|
|
133
|
+
input_tokens: Type.Optional(NativeUsageTokenSchema),
|
|
134
|
+
cached_input_tokens: Type.Optional(NativeUsageTokenSchema),
|
|
135
|
+
cache_creation_input_tokens: Type.Optional(NativeUsageTokenSchema),
|
|
136
|
+
output_tokens: Type.Optional(NativeUsageTokenSchema),
|
|
137
|
+
reasoning_tokens: Type.Optional(NativeUsageTokenSchema),
|
|
138
|
+
total_tokens: Type.Optional(NativeUsageTokenSchema),
|
|
139
|
+
});
|
|
140
|
+
const EstimatedUsageTokensSchema = StrictObject({
|
|
141
|
+
input_tokens: EstimatedUsageTokenSchema,
|
|
142
|
+
output_tokens: EstimatedUsageTokenSchema,
|
|
143
|
+
total_tokens: EstimatedUsageTokenSchema,
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
export const SemanticNativeUsageReceiptV1Schema = StrictObject({
|
|
147
|
+
schema_version: Type.Literal(SEMANTIC_USAGE_SCHEMA_VERSION),
|
|
148
|
+
source: Type.Literal("native"),
|
|
149
|
+
scope: Type.Literal("harness-call"),
|
|
150
|
+
tokens: NativeUsageTokensSchema,
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
export const SemanticEstimatedUsageReceiptV1Schema = StrictObject({
|
|
154
|
+
schema_version: Type.Literal(SEMANTIC_USAGE_SCHEMA_VERSION),
|
|
155
|
+
source: Type.Literal("estimated"),
|
|
156
|
+
scope: Type.Literal("visible-payload"),
|
|
157
|
+
estimator: StrictObject({
|
|
158
|
+
id: Type.Literal(SEMANTIC_VISIBLE_USAGE_ESTIMATOR_ID),
|
|
159
|
+
version: Type.Literal(SEMANTIC_VISIBLE_USAGE_ESTIMATOR_VERSION),
|
|
160
|
+
}),
|
|
161
|
+
tokens: EstimatedUsageTokensSchema,
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
export const SemanticUnreportedUsageReceiptV1Schema = StrictObject({
|
|
165
|
+
schema_version: Type.Literal(SEMANTIC_USAGE_SCHEMA_VERSION),
|
|
166
|
+
source: Type.Literal("unreported"),
|
|
167
|
+
scope: Type.Literal("unreported"),
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
export const SemanticUsageReceiptV1Schema = Type.Union([
|
|
171
|
+
SemanticNativeUsageReceiptV1Schema,
|
|
172
|
+
SemanticEstimatedUsageReceiptV1Schema,
|
|
173
|
+
SemanticUnreportedUsageReceiptV1Schema,
|
|
174
|
+
]);
|
|
175
|
+
|
|
107
176
|
function SemanticFieldSchema<T extends TSchema>(
|
|
108
177
|
value: T,
|
|
109
178
|
options: {
|
|
@@ -207,12 +276,56 @@ export const SemanticModelReplyV2Schema = StrictObject({
|
|
|
207
276
|
export function semanticModelReplyV2SchemaFor(expected: {
|
|
208
277
|
generation_id: string;
|
|
209
278
|
evidence_digest: string;
|
|
279
|
+
evidence_event_ids: string[];
|
|
210
280
|
}) {
|
|
281
|
+
const citationSchema = Type.Union(
|
|
282
|
+
expected.evidence_event_ids.map((value) => Type.Literal(value)),
|
|
283
|
+
);
|
|
284
|
+
const field = <T extends TSchema>(
|
|
285
|
+
value: T,
|
|
286
|
+
options: {
|
|
287
|
+
allowEmptyCitations?: boolean;
|
|
288
|
+
kind?: "synthesis" | "prediction" | "expression";
|
|
289
|
+
} = {},
|
|
290
|
+
) => {
|
|
291
|
+
const kind = options.kind ?? "synthesis";
|
|
292
|
+
return StrictObject({
|
|
293
|
+
value,
|
|
294
|
+
basis: Type.Literal(kind === "prediction" ? "prediction" : "model-synthesis"),
|
|
295
|
+
confidence:
|
|
296
|
+
kind === "prediction"
|
|
297
|
+
? Type.Literal("low")
|
|
298
|
+
: kind === "expression"
|
|
299
|
+
? Type.Union([Type.Literal("medium"), Type.Literal("low")])
|
|
300
|
+
: ConfidenceSchema,
|
|
301
|
+
evidence_event_ids: Type.Array(citationSchema, {
|
|
302
|
+
minItems: options.allowEmptyCitations ? 0 : 1,
|
|
303
|
+
maxItems: 16,
|
|
304
|
+
uniqueItems: true,
|
|
305
|
+
}),
|
|
306
|
+
});
|
|
307
|
+
};
|
|
211
308
|
return StrictObject({
|
|
212
309
|
schema_version: Type.Literal(SEMANTIC_READ_MODEL_SCHEMA_VERSION),
|
|
213
310
|
generation_id: Type.Literal(expected.generation_id),
|
|
214
311
|
evidence_digest: Type.Literal(expected.evidence_digest),
|
|
215
|
-
meaning:
|
|
312
|
+
meaning: StrictObject({
|
|
313
|
+
headline: field(Type.String({ minLength: 1, maxLength: 60 })),
|
|
314
|
+
summary: field(Type.String({ minLength: 1, maxLength: 240 })),
|
|
315
|
+
phase: field(PhaseSchema),
|
|
316
|
+
expression_cue: Type.Optional(field(ExpressionCueSchema, { kind: "expression" })),
|
|
317
|
+
purpose: Type.Optional(field(Type.String({ minLength: 1, maxLength: 180 }))),
|
|
318
|
+
recent_result: Type.Optional(field(Type.String({ minLength: 1, maxLength: 180 }))),
|
|
319
|
+
attention: Type.Optional(field(Type.String({ minLength: 1, maxLength: 180 }))),
|
|
320
|
+
next_step: Type.Optional(
|
|
321
|
+
field(Type.String({ minLength: 1, maxLength: 180 }), { kind: "prediction" }),
|
|
322
|
+
),
|
|
323
|
+
tags: Type.Optional(
|
|
324
|
+
field(Type.Array(TagSchema, { maxItems: 8, uniqueItems: true }), {
|
|
325
|
+
allowEmptyCitations: true,
|
|
326
|
+
}),
|
|
327
|
+
),
|
|
328
|
+
}),
|
|
216
329
|
});
|
|
217
330
|
}
|
|
218
331
|
|
|
@@ -246,6 +359,7 @@ export const SemanticAcceptedReadModelV2Schema = StrictObject({
|
|
|
246
359
|
...ReadModelBase,
|
|
247
360
|
reader_outcome: Type.Literal("accepted"),
|
|
248
361
|
reader: ResolvedReaderSchema,
|
|
362
|
+
receipt: Type.Optional(StrictObject({ usage: SemanticUsageReceiptV1Schema })),
|
|
249
363
|
meaning: SemanticMeaningV2Schema,
|
|
250
364
|
});
|
|
251
365
|
|
|
@@ -260,6 +374,7 @@ export const SemanticUnavailableReadModelV2Schema = StrictObject({
|
|
|
260
374
|
Type.Literal("model_unavailable"),
|
|
261
375
|
Type.Literal("model_mismatch"),
|
|
262
376
|
]),
|
|
377
|
+
usage: Type.Optional(SemanticUsageReceiptV1Schema),
|
|
263
378
|
}),
|
|
264
379
|
});
|
|
265
380
|
|
|
@@ -267,7 +382,15 @@ export const SemanticInvalidReadModelV2Schema = StrictObject({
|
|
|
267
382
|
...ReadModelBase,
|
|
268
383
|
reader_outcome: Type.Literal("invalid"),
|
|
269
384
|
reader: ResolvedReaderSchema,
|
|
270
|
-
receipt: StrictObject({
|
|
385
|
+
receipt: StrictObject({
|
|
386
|
+
reason_code: Type.Literal("invalid_output"),
|
|
387
|
+
validation_issue_codes: Type.Array(InvalidReasonCodeSchema, {
|
|
388
|
+
minItems: 1,
|
|
389
|
+
maxItems: SEMANTIC_INVALID_REASON_CODES.length,
|
|
390
|
+
uniqueItems: true,
|
|
391
|
+
}),
|
|
392
|
+
usage: Type.Optional(SemanticUsageReceiptV1Schema),
|
|
393
|
+
}),
|
|
271
394
|
});
|
|
272
395
|
|
|
273
396
|
export const SemanticDeferredReadModelV2Schema = StrictObject({
|
|
@@ -294,5 +417,14 @@ export type SemanticField<T> = {
|
|
|
294
417
|
};
|
|
295
418
|
export type SemanticMeaningV2 = Static<typeof SemanticMeaningV2Schema>;
|
|
296
419
|
export type SemanticModelReplyV2 = Static<typeof SemanticModelReplyV2Schema>;
|
|
420
|
+
export type SemanticUsageToken =
|
|
421
|
+
| Static<typeof NativeUsageTokenSchema>
|
|
422
|
+
| Static<typeof EstimatedUsageTokenSchema>;
|
|
423
|
+
export type SemanticNativeUsageReceiptV1 = Static<typeof SemanticNativeUsageReceiptV1Schema>;
|
|
424
|
+
export type SemanticEstimatedUsageReceiptV1 = Static<typeof SemanticEstimatedUsageReceiptV1Schema>;
|
|
425
|
+
export type SemanticUnreportedUsageReceiptV1 = Static<
|
|
426
|
+
typeof SemanticUnreportedUsageReceiptV1Schema
|
|
427
|
+
>;
|
|
428
|
+
export type SemanticUsageReceiptV1 = Static<typeof SemanticUsageReceiptV1Schema>;
|
|
297
429
|
export type SemanticAcceptedReadModelV2 = Static<typeof SemanticAcceptedReadModelV2Schema>;
|
|
298
430
|
export type SemanticAgentReadModelV2 = Static<typeof SemanticAgentReadModelV2Schema>;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
export {
|
|
2
2
|
createSemanticAdapters,
|
|
3
3
|
discoverSemanticReaders,
|
|
4
|
-
SEMANTIC_READER_ROUTES,
|
|
5
4
|
type SemanticAdapter,
|
|
6
5
|
type SemanticAdapterFailure,
|
|
7
6
|
type SemanticAdapterResult,
|
|
8
7
|
type SemanticAdapterSuccess,
|
|
9
|
-
type SemanticReaderRoute,
|
|
10
8
|
} from "./adapters.ts";
|
|
11
9
|
export {
|
|
12
10
|
SEMANTIC_CONFIGURED_MODELS,
|
|
@@ -15,10 +13,14 @@ export {
|
|
|
15
13
|
SEMANTIC_EVIDENCE_SCHEMA_VERSION,
|
|
16
14
|
SEMANTIC_EXPRESSION_CUES,
|
|
17
15
|
SEMANTIC_HARNESSES,
|
|
16
|
+
SEMANTIC_INVALID_REASON_CODES,
|
|
18
17
|
SEMANTIC_PHASES,
|
|
19
18
|
SEMANTIC_PROMPT_CONTRACT_VERSION,
|
|
20
19
|
SEMANTIC_READ_MODEL_SCHEMA_VERSION,
|
|
21
20
|
SEMANTIC_TAGS,
|
|
21
|
+
SEMANTIC_USAGE_SCHEMA_VERSION,
|
|
22
|
+
SEMANTIC_VISIBLE_USAGE_ESTIMATOR_ID,
|
|
23
|
+
SEMANTIC_VISIBLE_USAGE_ESTIMATOR_VERSION,
|
|
22
24
|
type SemanticAcceptedReadModelV2,
|
|
23
25
|
SemanticAcceptedReadModelV2Schema,
|
|
24
26
|
type SemanticAgentReadModelV2,
|
|
@@ -27,6 +29,8 @@ export {
|
|
|
27
29
|
type SemanticConfidence,
|
|
28
30
|
type SemanticConfiguredModel,
|
|
29
31
|
SemanticDeferredReadModelV2Schema,
|
|
32
|
+
type SemanticEstimatedUsageReceiptV1,
|
|
33
|
+
SemanticEstimatedUsageReceiptV1Schema,
|
|
30
34
|
type SemanticEvidenceKind,
|
|
31
35
|
type SemanticEvidenceObservationV1,
|
|
32
36
|
SemanticEvidenceObservationV1Schema,
|
|
@@ -36,13 +40,21 @@ export {
|
|
|
36
40
|
type SemanticField,
|
|
37
41
|
type SemanticHarness,
|
|
38
42
|
SemanticInvalidReadModelV2Schema,
|
|
43
|
+
type SemanticInvalidReasonCode,
|
|
39
44
|
type SemanticMeaningV2,
|
|
40
45
|
SemanticMeaningV2Schema,
|
|
41
46
|
type SemanticModelReplyV2,
|
|
42
47
|
SemanticModelReplyV2Schema,
|
|
48
|
+
type SemanticNativeUsageReceiptV1,
|
|
49
|
+
SemanticNativeUsageReceiptV1Schema,
|
|
43
50
|
type SemanticPhase,
|
|
44
51
|
type SemanticTag,
|
|
45
52
|
SemanticUnavailableReadModelV2Schema,
|
|
53
|
+
type SemanticUnreportedUsageReceiptV1,
|
|
54
|
+
SemanticUnreportedUsageReceiptV1Schema,
|
|
55
|
+
type SemanticUsageReceiptV1,
|
|
56
|
+
SemanticUsageReceiptV1Schema,
|
|
57
|
+
type SemanticUsageToken,
|
|
46
58
|
} from "./contract.ts";
|
|
47
59
|
export {
|
|
48
60
|
buildSemanticEvidenceV1,
|
|
@@ -62,15 +74,53 @@ export {
|
|
|
62
74
|
SEMANTIC_MAX_REQUEST_BYTES,
|
|
63
75
|
type SemanticPromptEnvelope,
|
|
64
76
|
} from "./prompt.ts";
|
|
77
|
+
export {
|
|
78
|
+
backfillSemanticReviewCandidates,
|
|
79
|
+
captureSemanticReviewCandidate,
|
|
80
|
+
listSemanticReviewCandidates,
|
|
81
|
+
listSemanticReviewReceipts,
|
|
82
|
+
prepareSemanticReviewStudy,
|
|
83
|
+
pruneSemanticReviewStorage,
|
|
84
|
+
SEMANTIC_REVIEW_CONFIDENCE,
|
|
85
|
+
SEMANTIC_REVIEW_FIELD_VERDICTS,
|
|
86
|
+
SEMANTIC_REVIEW_NO_EXPRESSION,
|
|
87
|
+
SEMANTIC_REVIEW_OVERALL_VERDICTS,
|
|
88
|
+
SEMANTIC_REVIEW_PORTRAIT_VERDICTS,
|
|
89
|
+
SEMANTIC_REVIEW_SCHEMA_VERSION,
|
|
90
|
+
SEMANTIC_REVIEW_TRANSITION_VERDICTS,
|
|
91
|
+
type SemanticReviewCandidateV1,
|
|
92
|
+
type SemanticReviewConfidence,
|
|
93
|
+
type SemanticReviewEvidenceSnapshotV1,
|
|
94
|
+
type SemanticReviewExpression,
|
|
95
|
+
type SemanticReviewFieldVerdict,
|
|
96
|
+
type SemanticReviewObservationV1,
|
|
97
|
+
type SemanticReviewOverallVerdict,
|
|
98
|
+
type SemanticReviewPortraitVerdict,
|
|
99
|
+
type SemanticReviewProposalFieldV1,
|
|
100
|
+
type SemanticReviewProposalV1,
|
|
101
|
+
type SemanticReviewReceiptRowV1,
|
|
102
|
+
type SemanticReviewReceiptV1,
|
|
103
|
+
type SemanticReviewResponseV1,
|
|
104
|
+
type SemanticReviewStudyCandidateV1,
|
|
105
|
+
type SemanticReviewStudyV1,
|
|
106
|
+
type SemanticReviewSubmissionV1,
|
|
107
|
+
type SemanticReviewTransitionVerdict,
|
|
108
|
+
semanticReviewPaths,
|
|
109
|
+
storeSemanticReviewSubmission,
|
|
110
|
+
} from "./review.ts";
|
|
111
|
+
export { SEMANTIC_READER_ROUTES, type SemanticReaderRoute } from "./routes.ts";
|
|
65
112
|
export {
|
|
66
113
|
activeSemanticCallHistory,
|
|
67
114
|
enqueueSemanticPending,
|
|
68
115
|
SEMANTIC_HARD_CALLS_PER_HOUR,
|
|
69
116
|
SEMANTIC_INVALID_RETRY_COOLDOWN_MS,
|
|
117
|
+
SEMANTIC_MIN_AMBIENT_GENERATION_CALL_INTERVAL_MS,
|
|
70
118
|
SEMANTIC_MIN_GENERATION_CALL_INTERVAL_MS,
|
|
119
|
+
SEMANTIC_MIN_PRIORITY_GENERATION_CALL_INTERVAL_MS,
|
|
71
120
|
selectSemanticPending,
|
|
72
121
|
semanticDocumentEligible,
|
|
73
122
|
semanticGenerationCallEligible,
|
|
123
|
+
semanticPendingCallIntervalMs,
|
|
74
124
|
semanticPriorityBand,
|
|
75
125
|
semanticRateCap,
|
|
76
126
|
} from "./scheduler.ts";
|
|
@@ -94,6 +144,15 @@ export {
|
|
|
94
144
|
type SemanticServiceStatusRecord,
|
|
95
145
|
spawnSemanticService,
|
|
96
146
|
} from "./service.ts";
|
|
147
|
+
export {
|
|
148
|
+
readSemanticSoakReport,
|
|
149
|
+
SEMANTIC_SOAK_DEFAULT_MINUTES,
|
|
150
|
+
SEMANTIC_SOAK_REVERSAL_WINDOW_MS,
|
|
151
|
+
SEMANTIC_SOAK_SCHEMA_VERSION,
|
|
152
|
+
type SemanticSoakReadingV1,
|
|
153
|
+
type SemanticSoakReportV1,
|
|
154
|
+
semanticSoakReadings,
|
|
155
|
+
} from "./soak.ts";
|
|
97
156
|
export {
|
|
98
157
|
inspectSemanticDocument,
|
|
99
158
|
invalidateSemanticDerivedState,
|
|
@@ -115,6 +174,21 @@ export {
|
|
|
115
174
|
writeSemanticCache,
|
|
116
175
|
writeSemanticManifest,
|
|
117
176
|
} from "./storage.ts";
|
|
177
|
+
export {
|
|
178
|
+
aggregateSemanticUsage,
|
|
179
|
+
emptySemanticUsageAggregate,
|
|
180
|
+
estimateVisibleSemanticUsage,
|
|
181
|
+
mergeSemanticUsageAggregates,
|
|
182
|
+
nativeSemanticUsage,
|
|
183
|
+
SEMANTIC_USAGE_TOKEN_FIELDS,
|
|
184
|
+
type SemanticUsageAggregate,
|
|
185
|
+
type SemanticUsageBreakdown,
|
|
186
|
+
type SemanticUsageEvent,
|
|
187
|
+
type SemanticUsageOutcome,
|
|
188
|
+
type SemanticUsageTokenField,
|
|
189
|
+
type SemanticUsageTokenTotals,
|
|
190
|
+
unreportedSemanticUsage,
|
|
191
|
+
} from "./usage.ts";
|
|
118
192
|
export {
|
|
119
193
|
isSemanticPrivacySafe,
|
|
120
194
|
type SemanticValidationFailure,
|