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
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { once } from "node:events";
|
|
3
|
+
import { constants, createReadStream, createWriteStream } from "node:fs";
|
|
4
|
+
import { chmod, lstat, mkdir, open, realpath, rename, rm } from "node:fs/promises";
|
|
5
|
+
import { basename, isAbsolute, join, relative, resolve } from "node:path";
|
|
6
|
+
import { pipeline } from "node:stream/promises";
|
|
7
|
+
import { createGzip } from "node:zlib";
|
|
8
|
+
import { canonicalJsonV3 } from "../canonical.ts";
|
|
9
|
+
import {
|
|
10
|
+
EVENT_V3_SUPPORT_FAMILIES,
|
|
11
|
+
type EventV3LogicalAuthorityEntry,
|
|
12
|
+
type EventV3SupportFamily,
|
|
13
|
+
type EventV3SupportPackManifest,
|
|
14
|
+
type EventV3SupportVerificationMode,
|
|
15
|
+
logicalEntriesDigestV3,
|
|
16
|
+
normalizeEventV3SupportPath,
|
|
17
|
+
validateEventV3SupportPackManifest,
|
|
18
|
+
} from "./pack-contract.ts";
|
|
19
|
+
|
|
20
|
+
export interface EventV3SupportPackSource {
|
|
21
|
+
relative_path: string;
|
|
22
|
+
family: EventV3SupportFamily;
|
|
23
|
+
recorded_at?: string;
|
|
24
|
+
diagnostic_category?: string;
|
|
25
|
+
diagnostic_reason?: string;
|
|
26
|
+
expected_bytes?: number;
|
|
27
|
+
expected_digest?: `sha256:${string}`;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface WriteEventV3SupportPackInput {
|
|
31
|
+
authority_root: string;
|
|
32
|
+
output_directory: string;
|
|
33
|
+
root_id: string;
|
|
34
|
+
genesis_id: string;
|
|
35
|
+
verification_mode: EventV3SupportVerificationMode;
|
|
36
|
+
source_authority_digest?: `sha256:${string}`;
|
|
37
|
+
sources: EventV3SupportPackSource[];
|
|
38
|
+
minimum_harnery_version: string;
|
|
39
|
+
created_at: string;
|
|
40
|
+
fault?: (boundary: "after_source_identity_before_open", path: string) => void;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface WrittenEventV3SupportPack {
|
|
44
|
+
manifest: EventV3SupportPackManifest;
|
|
45
|
+
manifest_path: string;
|
|
46
|
+
payload_path: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
interface InspectedSource extends EventV3SupportPackSource, EventV3LogicalAuthorityEntry {
|
|
50
|
+
absolute_path: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** Write a deterministic gzip-NDJSON support pack without buffering source files or the pack. */
|
|
54
|
+
export async function writeEventV3SupportPack(
|
|
55
|
+
input: WriteEventV3SupportPackInput,
|
|
56
|
+
): Promise<WrittenEventV3SupportPack> {
|
|
57
|
+
if (input.sources.length === 0) throw new Error("event_v3_support_pack_empty");
|
|
58
|
+
const authorityRoot = resolve(input.authority_root);
|
|
59
|
+
const authorityReal = await realDirectory(authorityRoot, "event_v3_support_authority_invalid");
|
|
60
|
+
const inspected: InspectedSource[] = [];
|
|
61
|
+
for (const source of [...input.sources].sort((left, right) =>
|
|
62
|
+
left.relative_path.localeCompare(right.relative_path),
|
|
63
|
+
)) {
|
|
64
|
+
const relativePath = normalizeEventV3SupportPath(source.relative_path);
|
|
65
|
+
if (inspected.at(-1)?.path === relativePath) throw new Error("event_v3_support_duplicate_path");
|
|
66
|
+
const absolutePath = resolve(authorityRoot, ...relativePath.split("/"));
|
|
67
|
+
const details = await inspectRegularFile(absolutePath, authorityReal, input.fault);
|
|
68
|
+
if (
|
|
69
|
+
(source.expected_bytes !== undefined && source.expected_bytes !== details.bytes) ||
|
|
70
|
+
(source.expected_digest !== undefined && source.expected_digest !== details.digest)
|
|
71
|
+
) {
|
|
72
|
+
throw new Error("event_v3_support_source_planned_mismatch");
|
|
73
|
+
}
|
|
74
|
+
inspected.push({
|
|
75
|
+
...source,
|
|
76
|
+
relative_path: relativePath,
|
|
77
|
+
path: relativePath,
|
|
78
|
+
absolute_path: absolutePath,
|
|
79
|
+
...details,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const logicalEntries = inspected.map(({ path, bytes, digest }) => ({ path, bytes, digest }));
|
|
84
|
+
const logicalDigest = logicalEntriesDigestV3(logicalEntries);
|
|
85
|
+
const packId = `vsp_${createHash("sha256")
|
|
86
|
+
.update(
|
|
87
|
+
canonicalJsonV3({
|
|
88
|
+
root_id: input.root_id,
|
|
89
|
+
genesis_id: input.genesis_id,
|
|
90
|
+
verification_mode: input.verification_mode,
|
|
91
|
+
entries: logicalEntries,
|
|
92
|
+
}),
|
|
93
|
+
)
|
|
94
|
+
.digest("hex")
|
|
95
|
+
.slice(0, 32)}` as const;
|
|
96
|
+
|
|
97
|
+
const outputDirectory = resolve(input.output_directory);
|
|
98
|
+
await mkdir(outputDirectory, { recursive: true, mode: 0o700 });
|
|
99
|
+
await chmod(outputDirectory, 0o700);
|
|
100
|
+
const payloadName = `${packId}.ndjson.gz`;
|
|
101
|
+
const payloadPath = join(outputDirectory, payloadName);
|
|
102
|
+
const manifestPath = join(outputDirectory, `${packId}.manifest.json`);
|
|
103
|
+
const payloadPartial = `${payloadPath}.partial`;
|
|
104
|
+
const manifestPartial = `${manifestPath}.partial`;
|
|
105
|
+
await rejectExisting([payloadPath, manifestPath, payloadPartial, manifestPartial]);
|
|
106
|
+
|
|
107
|
+
try {
|
|
108
|
+
await streamPayload(inspected, payloadPartial, authorityReal);
|
|
109
|
+
await chmod(payloadPartial, 0o600);
|
|
110
|
+
await rename(payloadPartial, payloadPath);
|
|
111
|
+
const payload = await inspectRegularFile(payloadPath);
|
|
112
|
+
const manifest = validateEventV3SupportPackManifest({
|
|
113
|
+
format: "harnery-event-v3-support-pack",
|
|
114
|
+
format_version: 1,
|
|
115
|
+
pack_id: packId,
|
|
116
|
+
authority: {
|
|
117
|
+
root_id: input.root_id,
|
|
118
|
+
genesis_id: input.genesis_id,
|
|
119
|
+
verification_mode: input.verification_mode,
|
|
120
|
+
...(input.source_authority_digest
|
|
121
|
+
? { source_authority_digest: input.source_authority_digest }
|
|
122
|
+
: {}),
|
|
123
|
+
source_files_digest: logicalDigest,
|
|
124
|
+
},
|
|
125
|
+
scope: scopeFor(inspected),
|
|
126
|
+
entries: {
|
|
127
|
+
count: inspected.length,
|
|
128
|
+
uncompressed_bytes: inspected.reduce((sum, entry) => sum + entry.bytes, 0),
|
|
129
|
+
logical_entries_digest: logicalDigest,
|
|
130
|
+
by_family: rollupFamilies(inspected),
|
|
131
|
+
by_diagnostic_category: rollupStrings(inspected, "diagnostic_category"),
|
|
132
|
+
by_diagnostic_reason: rollupStrings(inspected, "diagnostic_reason"),
|
|
133
|
+
},
|
|
134
|
+
payload: {
|
|
135
|
+
algorithm: "gzip",
|
|
136
|
+
path: payloadName,
|
|
137
|
+
bytes: payload.bytes,
|
|
138
|
+
digest: payload.digest,
|
|
139
|
+
},
|
|
140
|
+
minimum_harnery_version: input.minimum_harnery_version,
|
|
141
|
+
created_at: input.created_at,
|
|
142
|
+
});
|
|
143
|
+
const handle = await open(
|
|
144
|
+
manifestPartial,
|
|
145
|
+
constants.O_WRONLY | constants.O_CREAT | constants.O_EXCL,
|
|
146
|
+
0o600,
|
|
147
|
+
);
|
|
148
|
+
try {
|
|
149
|
+
await handle.writeFile(`${canonicalJsonV3(manifest)}\n`, "utf8");
|
|
150
|
+
await handle.sync();
|
|
151
|
+
} finally {
|
|
152
|
+
await handle.close();
|
|
153
|
+
}
|
|
154
|
+
await rename(manifestPartial, manifestPath);
|
|
155
|
+
return { manifest, manifest_path: manifestPath, payload_path: payloadPath };
|
|
156
|
+
} catch (error) {
|
|
157
|
+
await rm(payloadPartial, { force: true });
|
|
158
|
+
await rm(manifestPartial, { force: true });
|
|
159
|
+
await rm(payloadPath, { force: true });
|
|
160
|
+
await rm(manifestPath, { force: true });
|
|
161
|
+
throw error;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
async function streamPayload(
|
|
166
|
+
entries: InspectedSource[],
|
|
167
|
+
destination: string,
|
|
168
|
+
authorityReal: string,
|
|
169
|
+
): Promise<void> {
|
|
170
|
+
const gzip = createGzip({ level: 9 });
|
|
171
|
+
const output = createWriteStream(destination, { flags: "wx", mode: 0o600 });
|
|
172
|
+
const completed = pipeline(gzip, output);
|
|
173
|
+
try {
|
|
174
|
+
for (const entry of entries) {
|
|
175
|
+
await writeChunk(
|
|
176
|
+
gzip,
|
|
177
|
+
`{"path":${JSON.stringify(entry.path)},"bytes":${entry.bytes},"digest":${JSON.stringify(
|
|
178
|
+
entry.digest,
|
|
179
|
+
)},"content_base64":"`,
|
|
180
|
+
);
|
|
181
|
+
const handle = await openStableRegularFile(entry.absolute_path, authorityReal);
|
|
182
|
+
try {
|
|
183
|
+
const hash = createHash("sha256");
|
|
184
|
+
let bytes = 0;
|
|
185
|
+
let carry: Buffer<ArrayBufferLike> = Buffer.alloc(0);
|
|
186
|
+
const stream = createReadStream(entry.absolute_path, {
|
|
187
|
+
fd: handle.fd,
|
|
188
|
+
autoClose: false,
|
|
189
|
+
start: 0,
|
|
190
|
+
highWaterMark: 64 * 1024,
|
|
191
|
+
});
|
|
192
|
+
for await (const current of stream) {
|
|
193
|
+
const chunk = current as Buffer;
|
|
194
|
+
bytes += chunk.length;
|
|
195
|
+
hash.update(chunk);
|
|
196
|
+
const combined = carry.length === 0 ? chunk : Buffer.concat([carry, chunk]);
|
|
197
|
+
const complete = combined.length - (combined.length % 3);
|
|
198
|
+
if (complete > 0)
|
|
199
|
+
await writeChunk(gzip, combined.subarray(0, complete).toString("base64"));
|
|
200
|
+
carry = combined.subarray(complete);
|
|
201
|
+
}
|
|
202
|
+
if (carry.length > 0) await writeChunk(gzip, carry.toString("base64"));
|
|
203
|
+
const digest = `sha256:${hash.digest("hex")}`;
|
|
204
|
+
if (bytes !== entry.bytes || digest !== entry.digest) {
|
|
205
|
+
throw new Error("event_v3_support_source_changed_during_pack");
|
|
206
|
+
}
|
|
207
|
+
} finally {
|
|
208
|
+
await handle.close();
|
|
209
|
+
}
|
|
210
|
+
await writeChunk(gzip, `"}\n`);
|
|
211
|
+
}
|
|
212
|
+
gzip.end();
|
|
213
|
+
await completed;
|
|
214
|
+
} catch (error) {
|
|
215
|
+
gzip.destroy(error as Error);
|
|
216
|
+
await completed.catch(() => undefined);
|
|
217
|
+
throw error;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
async function inspectRegularFile(
|
|
222
|
+
path: string,
|
|
223
|
+
containmentRoot?: string,
|
|
224
|
+
fault?: WriteEventV3SupportPackInput["fault"],
|
|
225
|
+
): Promise<{ bytes: number; digest: `sha256:${string}` }> {
|
|
226
|
+
const handle = await openStableRegularFile(path, containmentRoot, fault);
|
|
227
|
+
try {
|
|
228
|
+
const hash = createHash("sha256");
|
|
229
|
+
let bytes = 0;
|
|
230
|
+
const stream = createReadStream(path, { fd: handle.fd, autoClose: false, start: 0 });
|
|
231
|
+
for await (const current of stream) {
|
|
232
|
+
const chunk = current as Buffer;
|
|
233
|
+
bytes += chunk.length;
|
|
234
|
+
hash.update(chunk);
|
|
235
|
+
}
|
|
236
|
+
return { bytes, digest: `sha256:${hash.digest("hex")}` };
|
|
237
|
+
} finally {
|
|
238
|
+
await handle.close();
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
async function openStableRegularFile(
|
|
243
|
+
path: string,
|
|
244
|
+
containmentRoot?: string,
|
|
245
|
+
fault?: WriteEventV3SupportPackInput["fault"],
|
|
246
|
+
) {
|
|
247
|
+
const before = await lstat(path);
|
|
248
|
+
if (!before.isFile() || before.isSymbolicLink()) {
|
|
249
|
+
throw new Error("event_v3_support_source_not_regular");
|
|
250
|
+
}
|
|
251
|
+
const beforeReal = await realpath(path);
|
|
252
|
+
if (containmentRoot) assertContained(containmentRoot, beforeReal);
|
|
253
|
+
fault?.("after_source_identity_before_open", path);
|
|
254
|
+
const handle = await open(path, constants.O_RDONLY | noFollow());
|
|
255
|
+
try {
|
|
256
|
+
const opened = await handle.stat();
|
|
257
|
+
const after = await lstat(path);
|
|
258
|
+
const afterReal = await realpath(path);
|
|
259
|
+
if (
|
|
260
|
+
!opened.isFile() ||
|
|
261
|
+
!after.isFile() ||
|
|
262
|
+
after.isSymbolicLink() ||
|
|
263
|
+
!sameIdentity(before, opened) ||
|
|
264
|
+
!sameIdentity(opened, after) ||
|
|
265
|
+
beforeReal !== afterReal
|
|
266
|
+
) {
|
|
267
|
+
throw new Error("event_v3_support_source_changed_during_open");
|
|
268
|
+
}
|
|
269
|
+
if (containmentRoot) assertContained(containmentRoot, afterReal);
|
|
270
|
+
return handle;
|
|
271
|
+
} catch (error) {
|
|
272
|
+
await handle.close();
|
|
273
|
+
throw error;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
function sameIdentity(
|
|
278
|
+
left: { dev: number | bigint; ino: number | bigint },
|
|
279
|
+
right: { dev: number | bigint; ino: number | bigint },
|
|
280
|
+
): boolean {
|
|
281
|
+
return left.dev === right.dev && left.ino === right.ino;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
async function realDirectory(path: string, code: string): Promise<string> {
|
|
285
|
+
const stat = await lstat(path);
|
|
286
|
+
if (!stat.isDirectory() || stat.isSymbolicLink()) throw new Error(code);
|
|
287
|
+
return realpath(path);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
function assertContained(root: string, candidate: string): void {
|
|
291
|
+
const path = relative(root, candidate);
|
|
292
|
+
if (
|
|
293
|
+
path === "" ||
|
|
294
|
+
(path !== ".." &&
|
|
295
|
+
!path.startsWith(`..${process.platform === "win32" ? "\\" : "/"}`) &&
|
|
296
|
+
!isAbsolute(path))
|
|
297
|
+
)
|
|
298
|
+
return;
|
|
299
|
+
throw new Error("event_v3_support_source_outside_authority");
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
function noFollow(): number {
|
|
303
|
+
return constants.O_NOFOLLOW ?? 0;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
async function rejectExisting(paths: string[]): Promise<void> {
|
|
307
|
+
for (const path of paths) {
|
|
308
|
+
try {
|
|
309
|
+
await lstat(path);
|
|
310
|
+
throw new Error(`event_v3_support_output_exists:${basename(path)}`);
|
|
311
|
+
} catch (error) {
|
|
312
|
+
if ((error as NodeJS.ErrnoException).code !== "ENOENT") throw error;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
async function writeChunk(stream: NodeJS.WritableStream, value: string): Promise<void> {
|
|
318
|
+
if (!stream.write(value, "utf8")) await once(stream, "drain");
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
function scopeFor(entries: InspectedSource[]): EventV3SupportPackManifest["scope"] {
|
|
322
|
+
const timestamps = entries
|
|
323
|
+
.flatMap((entry) => (entry.recorded_at ? [entry.recorded_at] : []))
|
|
324
|
+
.sort();
|
|
325
|
+
return {
|
|
326
|
+
families: [...new Set(entries.map(({ family }) => family))].sort(),
|
|
327
|
+
minimum_recorded_at: timestamps[0] ?? null,
|
|
328
|
+
maximum_recorded_at: timestamps.at(-1) ?? null,
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
function rollupFamilies(entries: InspectedSource[]): Record<EventV3SupportFamily, number> {
|
|
333
|
+
const result = Object.fromEntries(
|
|
334
|
+
EVENT_V3_SUPPORT_FAMILIES.map((family) => [family, 0]),
|
|
335
|
+
) as Record<EventV3SupportFamily, number>;
|
|
336
|
+
for (const entry of entries) result[entry.family] += 1;
|
|
337
|
+
return result;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
function rollupStrings(
|
|
341
|
+
entries: InspectedSource[],
|
|
342
|
+
key: "diagnostic_category" | "diagnostic_reason",
|
|
343
|
+
): Record<string, number> {
|
|
344
|
+
const result: Record<string, number> = {};
|
|
345
|
+
for (const entry of entries) {
|
|
346
|
+
const value = entry[key];
|
|
347
|
+
if (value) result[value] = (result[value] ?? 0) + 1;
|
|
348
|
+
}
|
|
349
|
+
return Object.fromEntries(
|
|
350
|
+
Object.entries(result).sort(([left], [right]) => left.localeCompare(right)),
|
|
351
|
+
);
|
|
352
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import {
|
|
2
|
+
digestEventV3LogicalAuthority,
|
|
3
|
+
iterateEventV3LogicalAuthority,
|
|
4
|
+
} from "./logical-authority.ts";
|
|
5
|
+
|
|
6
|
+
export interface VerifyEventV3RecoveryBoundArchiveInput {
|
|
7
|
+
authority_root: string;
|
|
8
|
+
expected_authority_digest: `sha256:${string}`;
|
|
9
|
+
expected_archive_directory?: string;
|
|
10
|
+
archive_directory?: string;
|
|
11
|
+
recovery_receipt_id: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** Fail closed unless a recovery receipt still binds one complete logical authority. */
|
|
15
|
+
export async function verifyEventV3RecoveryBoundArchive(
|
|
16
|
+
input: VerifyEventV3RecoveryBoundArchiveInput,
|
|
17
|
+
): Promise<{
|
|
18
|
+
recovery_receipt_id: string;
|
|
19
|
+
authority_digest: `sha256:${string}`;
|
|
20
|
+
logical_files: number;
|
|
21
|
+
packed_entries: number;
|
|
22
|
+
}> {
|
|
23
|
+
if (
|
|
24
|
+
input.expected_archive_directory !== undefined &&
|
|
25
|
+
input.archive_directory !== input.expected_archive_directory
|
|
26
|
+
) {
|
|
27
|
+
throw new Error("event_v3_support_recovery_archive_binding_mismatch");
|
|
28
|
+
}
|
|
29
|
+
const view = await iterateEventV3LogicalAuthority(input.authority_root);
|
|
30
|
+
if (view.quarantined_packs.length > 0) {
|
|
31
|
+
throw new Error("event_v3_support_recovery_pack_quarantined");
|
|
32
|
+
}
|
|
33
|
+
const digest = await digestEventV3LogicalAuthority(input.authority_root);
|
|
34
|
+
if (digest !== input.expected_authority_digest) {
|
|
35
|
+
throw new Error("event_v3_support_recovery_authority_digest_mismatch");
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
recovery_receipt_id: input.recovery_receipt_id,
|
|
39
|
+
authority_digest: digest,
|
|
40
|
+
logical_files: view.entries.length,
|
|
41
|
+
packed_entries: view.packed_entries,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
@@ -7,18 +7,33 @@ import {
|
|
|
7
7
|
import type { TurnHarnessV3, TurnInferenceV3, TurnUsageV3 } from "./contract.ts";
|
|
8
8
|
|
|
9
9
|
export type TelemetryObservationV3<T> =
|
|
10
|
-
| {
|
|
10
|
+
| {
|
|
11
|
+
state: "observed";
|
|
12
|
+
value: T;
|
|
13
|
+
attestation: "native" | "derived" | "inferred";
|
|
14
|
+
confidence: "exact" | "high" | "medium" | "low";
|
|
15
|
+
}
|
|
11
16
|
| { state: "unsupported"; capability: string }
|
|
12
17
|
| { state: "expected_but_missing"; capability: string; reason: string };
|
|
13
18
|
|
|
14
|
-
|
|
15
|
-
used_tokens: number;
|
|
16
|
-
limit_tokens: number;
|
|
17
|
-
remaining_tokens?: number;
|
|
19
|
+
interface ContextMeasurementClockV3 {
|
|
18
20
|
measured_at: string;
|
|
19
21
|
method: string;
|
|
20
22
|
}
|
|
21
23
|
|
|
24
|
+
export type ContextMeasurementV3 = ContextMeasurementClockV3 &
|
|
25
|
+
(
|
|
26
|
+
| {
|
|
27
|
+
used_tokens: number;
|
|
28
|
+
limit_tokens: number;
|
|
29
|
+
remaining_tokens?: number;
|
|
30
|
+
}
|
|
31
|
+
| {
|
|
32
|
+
used_percent: number;
|
|
33
|
+
remaining_percent?: number;
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
|
|
22
37
|
export interface TurnTelemetryV3 {
|
|
23
38
|
usage: TelemetryObservationV3<TurnUsageV3>;
|
|
24
39
|
inference: TelemetryObservationV3<TurnInferenceV3>;
|
|
@@ -31,8 +46,8 @@ export interface ContextTelemetryProvenanceV3 {
|
|
|
31
46
|
source_event: string;
|
|
32
47
|
source_witness?: string;
|
|
33
48
|
runtime_version?: string;
|
|
34
|
-
attestation: "native" | "derived";
|
|
35
|
-
confidence: "exact" | "high";
|
|
49
|
+
attestation: "native" | "derived" | "inferred";
|
|
50
|
+
confidence: "exact" | "high" | "medium" | "low";
|
|
36
51
|
}
|
|
37
52
|
|
|
38
53
|
export type TurnTelemetryCapabilitySupportV3 = Partial<
|
|
@@ -105,9 +120,11 @@ export function extractTurnTelemetryV3(
|
|
|
105
120
|
|
|
106
121
|
const usedTokens =
|
|
107
122
|
number(context?.used_tokens) ??
|
|
123
|
+
number(context?.context_tokens) ??
|
|
108
124
|
number(context?.input_tokens) ??
|
|
109
125
|
number(context?.total_tokens) ??
|
|
110
126
|
number(payload.used_tokens) ??
|
|
127
|
+
number(payload.context_tokens) ??
|
|
111
128
|
number(payload.total_input_tokens) ??
|
|
112
129
|
number(usage?.total_tokens) ??
|
|
113
130
|
number(usage?.prompt_tokens) ??
|
|
@@ -126,10 +143,17 @@ export function extractTurnTelemetryV3(
|
|
|
126
143
|
number(payload.context_window_size) ??
|
|
127
144
|
number(payload.context_window_tokens) ??
|
|
128
145
|
(typeof payload.context_window === "number" ? number(payload.context_window) : undefined);
|
|
146
|
+
const usedPercent =
|
|
147
|
+
finiteNumber(context?.context_usage_percent) ??
|
|
148
|
+
finiteNumber(context?.used_percent) ??
|
|
149
|
+
finiteNumber(context?.used_percentage) ??
|
|
150
|
+
finiteNumber(payload.context_usage_percent) ??
|
|
151
|
+
finiteNumber(payload.used_percent);
|
|
129
152
|
const contextMeasurement = contextObservation(
|
|
130
153
|
adapter,
|
|
131
154
|
usedTokens,
|
|
132
155
|
limitTokens,
|
|
156
|
+
usedPercent,
|
|
133
157
|
observedAt,
|
|
134
158
|
support.context_usage,
|
|
135
159
|
);
|
|
@@ -141,6 +165,7 @@ function contextObservation(
|
|
|
141
165
|
adapter: Adapter,
|
|
142
166
|
usedTokens: number | undefined,
|
|
143
167
|
limitTokens: number | undefined,
|
|
168
|
+
usedPercent: number | undefined,
|
|
144
169
|
observedAt: string,
|
|
145
170
|
override: CapabilitySupportV3 | undefined,
|
|
146
171
|
): TelemetryObservationV3<ContextMeasurementV3> {
|
|
@@ -159,6 +184,28 @@ function contextObservation(
|
|
|
159
184
|
};
|
|
160
185
|
}
|
|
161
186
|
|
|
187
|
+
if (usedPercent !== undefined && usedPercent >= 0 && usedPercent <= 100) {
|
|
188
|
+
return {
|
|
189
|
+
state: "observed",
|
|
190
|
+
value: {
|
|
191
|
+
used_percent: usedPercent,
|
|
192
|
+
remaining_percent: Math.max(0, 100 - usedPercent),
|
|
193
|
+
measured_at: observedAt,
|
|
194
|
+
method: `${adapter.replaceAll("-", "_")}_hook`,
|
|
195
|
+
},
|
|
196
|
+
attestation: "native",
|
|
197
|
+
confidence: "exact",
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
if (usedPercent !== undefined) {
|
|
202
|
+
return {
|
|
203
|
+
state: "expected_but_missing",
|
|
204
|
+
capability: "context_usage",
|
|
205
|
+
reason: "context_usage_percent_invalid",
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
|
|
162
209
|
if (usedTokens !== undefined || limitTokens !== undefined) {
|
|
163
210
|
return {
|
|
164
211
|
state: "expected_but_missing",
|
|
@@ -250,6 +297,10 @@ function number(value: unknown): number | undefined {
|
|
|
250
297
|
return typeof value === "number" ? safeInteger(value) : undefined;
|
|
251
298
|
}
|
|
252
299
|
|
|
300
|
+
function finiteNumber(value: unknown): number | undefined {
|
|
301
|
+
return typeof value === "number" && Number.isFinite(value) ? value : undefined;
|
|
302
|
+
}
|
|
303
|
+
|
|
253
304
|
function safeInteger(value: number): number | undefined {
|
|
254
305
|
return Number.isFinite(value) && value >= 0 ? Math.floor(value) : undefined;
|
|
255
306
|
}
|