harnery 0.34.1 → 0.36.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 +124 -94
- package/dist/commands/agents.d.ts +37 -6
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +466 -371
- 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 +31 -6
- 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/decision.d.ts.map +1 -1
- package/dist/commands/decision.js +2 -2
- package/dist/commands/deinit.d.ts.map +1 -1
- package/dist/commands/deinit.js +5 -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/events.d.ts.map +1 -1
- package/dist/commands/events.js +18 -1
- package/dist/commands/fetch.js +6 -5
- package/dist/commands/files.d.ts +22 -0
- package/dist/commands/files.d.ts.map +1 -0
- package/dist/commands/files.js +113 -0
- package/dist/commands/governor.js +14 -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 +347 -1
- 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/presence.d.ts.map +1 -1
- package/dist/commands/presence.js +2 -2
- 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/semantic.d.ts +4 -0
- package/dist/commands/semantic.d.ts.map +1 -0
- package/dist/commands/semantic.js +199 -0
- 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/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.js +13 -13
- package/dist/core/adapters/profiles.d.ts +1 -1
- package/dist/core/agents/canonical-emit.d.ts +3 -0
- package/dist/core/agents/canonical-emit.d.ts.map +1 -1
- package/dist/core/agents/canonical-emit.js +12 -0
- package/dist/core/agents/claim-path.d.ts +11 -0
- package/dist/core/agents/claim-path.d.ts.map +1 -0
- package/dist/core/agents/claim-path.js +22 -0
- package/dist/core/agents/cli.js +209 -39
- package/dist/core/agents/coord-client.d.ts +29 -3
- package/dist/core/agents/coord-client.d.ts.map +1 -1
- package/dist/core/agents/coord-client.js +88 -9
- 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 +245 -13
- package/dist/core/agents/live-lifecycle-v3.js +9 -4
- package/dist/core/agents/live-observation-v3.d.ts.map +1 -1
- package/dist/core/agents/live-observation-v3.js +8 -3
- package/dist/core/agents/render/prompt-context.d.ts +9 -3
- package/dist/core/agents/render/prompt-context.d.ts.map +1 -1
- package/dist/core/agents/render/prompt-context.js +36 -17
- 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 +115 -22
- 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 +5 -1
- package/dist/core/agents/session-name-display.d.ts +1 -0
- package/dist/core/agents/session-name-display.d.ts.map +1 -1
- package/dist/core/agents/session-name-display.js +8 -1
- 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-reader.d.ts +46 -0
- package/dist/core/agents/state/heartbeat-reader.d.ts.map +1 -0
- package/dist/core/agents/state/heartbeat-reader.js +25 -0
- package/dist/core/agents/state/heartbeat-writer.d.ts +9 -48
- package/dist/core/agents/state/heartbeat-writer.d.ts.map +1 -1
- package/dist/core/agents/state/heartbeat-writer.js +34 -34
- package/dist/core/agents/state/live-coordination-view.d.ts +6 -8
- package/dist/core/agents/state/live-coordination-view.d.ts.map +1 -1
- package/dist/core/agents/state/live-coordination-view.js +16 -67
- 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/agents/state/names.d.ts +9 -1
- package/dist/core/agents/state/names.d.ts.map +1 -1
- package/dist/core/agents/state/names.js +190 -182
- package/dist/core/agents/state/stale-sweep.d.ts.map +1 -1
- package/dist/core/agents/state/stale-sweep.js +23 -5
- package/dist/core/artifacts/constants.d.ts +5 -0
- package/dist/core/artifacts/constants.d.ts.map +1 -0
- package/dist/core/artifacts/constants.js +4 -0
- package/dist/core/artifacts/index.d.ts +24 -3
- package/dist/core/artifacts/index.d.ts.map +1 -1
- package/dist/core/artifacts/index.js +96 -8
- package/dist/core/config.d.ts +62 -4
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +98 -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/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/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 +6 -0
- package/dist/core/events/legacy-storage/index.d.ts.map +1 -0
- package/dist/core/events/legacy-storage/index.js +5 -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/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 +851 -16
- package/dist/core/events/v3/base-contract.d.ts.map +1 -1
- package/dist/core/events/v3/base-contract.js +50 -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 +11 -0
- package/dist/core/events/v3/capabilities.d.ts.map +1 -1
- package/dist/core/events/v3/capabilities.js +26 -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 +8 -5
- package/dist/core/events/v3/index.d.ts.map +1 -1
- package/dist/core/events/v3/index.js +7 -4
- package/dist/core/events/v3/latency.d.ts +31 -1
- package/dist/core/events/v3/latency.d.ts.map +1 -1
- package/dist/core/events/v3/latency.js +127 -3
- 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 +42 -20
- package/dist/core/events/v3/live-routing.d.ts.map +1 -1
- package/dist/core/events/v3/live-routing.js +153 -41
- package/dist/core/events/v3/producers/command-recorder.d.ts.map +1 -1
- package/dist/core/events/v3/producers/command-recorder.js +10 -1
- 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 +90 -13
- 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 +17 -1
- package/dist/core/events/v3/producers/hook-base.d.ts.map +1 -1
- package/dist/core/events/v3/producers/hook-base.js +83 -2
- package/dist/core/events/v3/producers/intake.d.ts +13 -0
- package/dist/core/events/v3/producers/intake.d.ts.map +1 -1
- package/dist/core/events/v3/producers/intake.js +36 -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 +117 -1
- package/dist/core/events/v3/producers/recorder.d.ts.map +1 -1
- package/dist/core/events/v3/producers/recorder.js +992 -27
- 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 +52 -0
- package/dist/core/events/v3/runtime-telemetry-capabilities.d.ts.map +1 -0
- package/dist/core/events/v3/runtime-telemetry-capabilities.js +54 -0
- 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 +21 -6
- 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 +4 -2
- package/dist/core/hooks/adapter/output.d.ts.map +1 -1
- package/dist/core/hooks/adapter/output.js +13 -5
- package/dist/core/hooks/adapter/parse.d.ts +3 -0
- package/dist/core/hooks/adapter/parse.d.ts.map +1 -1
- package/dist/core/hooks/adapter/parse.js +14 -0
- package/dist/core/hooks/adapter/runtime-telemetry.d.ts +142 -0
- package/dist/core/hooks/adapter/runtime-telemetry.d.ts.map +1 -0
- package/dist/core/hooks/adapter/runtime-telemetry.js +869 -0
- package/dist/core/hooks/cli.js +318 -61
- 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/remediation-cap.d.ts +39 -0
- package/dist/core/hooks/remediation-cap.d.ts.map +1 -0
- package/dist/core/hooks/remediation-cap.js +63 -0
- 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 +33 -9
- package/dist/core/hooks/resolve/transcript.d.ts.map +1 -1
- package/dist/core/hooks/resolve/transcript.js +33 -10
- 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/semantic/adapters.d.ts +37 -0
- package/dist/core/semantic/adapters.d.ts.map +1 -0
- package/dist/core/semantic/adapters.js +360 -0
- package/dist/core/semantic/contract.d.ts +1072 -0
- package/dist/core/semantic/contract.d.ts.map +1 -0
- package/dist/core/semantic/contract.js +331 -0
- package/dist/core/semantic/evidence.d.ts +11 -0
- package/dist/core/semantic/evidence.d.ts.map +1 -0
- package/dist/core/semantic/evidence.js +262 -0
- package/dist/core/semantic/index.d.ts +14 -0
- package/dist/core/semantic/index.d.ts.map +1 -0
- package/dist/core/semantic/index.js +13 -0
- package/dist/core/semantic/once.d.ts +38 -0
- package/dist/core/semantic/once.d.ts.map +1 -0
- package/dist/core/semantic/once.js +364 -0
- package/dist/core/semantic/prompt.d.ts +12 -0
- package/dist/core/semantic/prompt.d.ts.map +1 -0
- package/dist/core/semantic/prompt.js +83 -0
- 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 +27 -0
- package/dist/core/semantic/scheduler.d.ts.map +1 -0
- package/dist/core/semantic/scheduler.js +91 -0
- package/dist/core/semantic/service-status.d.ts +51 -0
- package/dist/core/semantic/service-status.d.ts.map +1 -0
- package/dist/core/semantic/service-status.js +140 -0
- package/dist/core/semantic/service.d.ts +52 -0
- package/dist/core/semantic/service.d.ts.map +1 -0
- package/dist/core/semantic/service.js +559 -0
- 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 +81 -0
- package/dist/core/semantic/storage.d.ts.map +1 -0
- package/dist/core/semantic/storage.js +180 -0
- 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 +18 -0
- package/dist/core/semantic/validate.d.ts.map +1 -0
- package/dist/core/semantic/validate.js +207 -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 +683 -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 +82 -0
- package/dist/core/storage/logger.d.ts.map +1 -0
- package/dist/core/storage/logger.js +411 -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 +34 -0
- package/dist/core/storage/query.d.ts.map +1 -0
- package/dist/core/storage/query.js +295 -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/work/state.d.ts.map +1 -1
- package/dist/core/work/state.js +10 -14
- package/dist/core/workflow/live-session-v3.d.ts.map +1 -1
- package/dist/core/workflow/live-session-v3.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 +11 -0
- package/dist/lib/browser/client.d.ts.map +1 -1
- package/dist/lib/browser/client.js +13 -0
- package/dist/lib/browser/index.d.ts +1 -0
- package/dist/lib/browser/index.d.ts.map +1 -1
- package/dist/lib/browser/standalone-html.d.ts +25 -0
- package/dist/lib/browser/standalone-html.d.ts.map +1 -0
- package/dist/lib/browser/standalone-html.js +284 -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.map +1 -1
- package/dist/lib/instructions/apply.js +1 -0
- package/dist/lib/instructions/templates.d.ts +2 -0
- package/dist/lib/instructions/templates.d.ts.map +1 -1
- package/dist/lib/instructions/templates.js +149 -4
- 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 +34 -2
- package/schemas/config.schema.json +58 -0
- package/schemas/event-v3.schema.json +3073 -581
- package/src/commander.ts +462 -93
- package/src/commands/agents.ts +617 -355
- package/src/commands/backup.ts +18 -14
- package/src/commands/browse-session.ts +12 -0
- package/src/commands/browse.ts +31 -9
- package/src/commands/conversations.ts +279 -0
- package/src/commands/decision.ts +8 -2
- package/src/commands/deinit.ts +6 -0
- package/src/commands/docs.ts +25 -6
- package/src/commands/doctor.ts +75 -9
- package/src/commands/events.ts +21 -1
- package/src/commands/fetch.ts +7 -6
- package/src/commands/files.ts +143 -0
- package/src/commands/governor.ts +13 -12
- package/src/commands/inbox.ts +61 -0
- package/src/commands/init.ts +78 -16
- package/src/commands/ledger-v3.ts +421 -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/presence.ts +7 -2
- package/src/commands/read.ts +6 -2
- package/src/commands/semantic.ts +244 -0
- package/src/commands/storage.ts +310 -0
- package/src/commands/tunnel.ts +66 -52
- package/src/commands/web.ts +92 -7
- package/src/commands/work.ts +3 -3
- package/src/commands/workflow.ts +13 -13
- package/src/core/agents/canonical-emit.ts +15 -0
- package/src/core/agents/claim-path.ts +23 -0
- package/src/core/agents/cli.ts +259 -53
- package/src/core/agents/coord-client.ts +92 -8
- package/src/core/agents/live-authority-v3.ts +342 -14
- package/src/core/agents/live-lifecycle-v3.ts +14 -4
- package/src/core/agents/live-observation-v3.ts +13 -3
- package/src/core/agents/render/prompt-context.ts +40 -16
- package/src/core/agents/rules/stop-hook.ts +129 -25
- 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 +4 -1
- package/src/core/agents/session-name-display.ts +9 -1
- package/src/core/agents/state/activity-log.ts +7 -2
- package/src/core/agents/state/heartbeat-reader.ts +69 -0
- package/src/core/agents/state/heartbeat-writer.ts +47 -84
- package/src/core/agents/state/live-coordination-view.ts +17 -81
- package/src/core/agents/state/live-coordination-writer.ts +141 -0
- package/src/core/agents/state/names.ts +190 -182
- package/src/core/agents/state/stale-sweep.ts +25 -5
- package/src/core/artifacts/constants.ts +4 -0
- package/src/core/artifacts/index.ts +113 -8
- package/src/core/config.ts +126 -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/events/legacy-storage/canary.ts +177 -0
- package/src/core/events/legacy-storage/fence.ts +129 -0
- package/src/core/events/legacy-storage/index.ts +5 -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/authority-outbox.ts +22 -1
- package/src/core/events/v3/base-contract.ts +56 -7
- package/src/core/events/v3/bootstrap.ts +195 -2
- package/src/core/events/v3/capabilities.ts +37 -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 +26 -2
- package/src/core/events/v3/latency.ts +213 -2
- package/src/core/events/v3/live-route-observer.ts +80 -0
- package/src/core/events/v3/live-routing.ts +182 -45
- package/src/core/events/v3/producers/command-recorder.ts +10 -1
- package/src/core/events/v3/producers/coordination-recorder.ts +112 -15
- package/src/core/events/v3/producers/diagnostic-summaries.ts +593 -0
- package/src/core/events/v3/producers/hook-base.ts +116 -2
- package/src/core/events/v3/producers/intake.ts +48 -2
- package/src/core/events/v3/producers/producer-state-observer.ts +52 -0
- package/src/core/events/v3/producers/recorder.ts +1403 -30
- 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 +143 -0
- 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 +66 -5
- 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 +12 -5
- package/src/core/hooks/adapter/parse.ts +16 -0
- package/src/core/hooks/adapter/runtime-telemetry.ts +1200 -0
- package/src/core/hooks/cli.ts +342 -64
- package/src/core/hooks/effects/image-capture.ts +4 -1
- package/src/core/hooks/remediation-cap.ts +83 -0
- 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 +55 -11
- 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/semantic/adapters.ts +452 -0
- package/src/core/semantic/contract.ts +430 -0
- package/src/core/semantic/evidence.ts +336 -0
- package/src/core/semantic/index.ts +201 -0
- package/src/core/semantic/once.ts +496 -0
- package/src/core/semantic/prompt.ts +96 -0
- package/src/core/semantic/review.ts +803 -0
- package/src/core/semantic/routes.ts +30 -0
- package/src/core/semantic/scheduler.ts +151 -0
- package/src/core/semantic/service-status.ts +212 -0
- package/src/core/semantic/service.ts +681 -0
- package/src/core/semantic/soak.ts +638 -0
- package/src/core/semantic/storage.ts +300 -0
- package/src/core/semantic/usage.ts +272 -0
- package/src/core/semantic/validate.ts +243 -0
- package/src/core/storage/buffer.ts +124 -0
- package/src/core/storage/builtins.ts +916 -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 +546 -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 +360 -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/work/state.ts +12 -21
- package/src/core/workflow/live-session-v3.ts +2 -4
- package/src/index.ts +2 -0
- package/src/lazy-commands.ts +294 -0
- package/src/lib/browser/client.ts +21 -0
- package/src/lib/browser/index.ts +4 -0
- package/src/lib/browser/standalone-html.ts +312 -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 +1 -0
- package/src/lib/instructions/templates.ts +154 -4
- package/src/lib/local-file-url.ts +31 -0
- package/src/lib/web-performance.ts +335 -0
package/src/commands/backup.ts
CHANGED
|
@@ -108,10 +108,10 @@ export function registerBackupCommand(program: Command, emit: EmitContext): void
|
|
|
108
108
|
backup
|
|
109
109
|
.command("init")
|
|
110
110
|
.description("Create the restic repository + password file (one-time).")
|
|
111
|
-
.option("--repo <path>",
|
|
111
|
+
.option("--repo <path>", "Repository path (default: configured backup.repo)")
|
|
112
112
|
.option(
|
|
113
113
|
"--password-file <path>",
|
|
114
|
-
|
|
114
|
+
"Password file (default: configured backup.password_file; autogenerated)",
|
|
115
115
|
)
|
|
116
116
|
.action((opts: BaseOpts) => {
|
|
117
117
|
if (!checkRestic(emit)) {
|
|
@@ -257,24 +257,27 @@ export function registerBackupCommand(program: Command, emit: EmitContext): void
|
|
|
257
257
|
// -- prune --
|
|
258
258
|
// Prune-policy defaults come from backup.keep_* in config.jsonc (falling back
|
|
259
259
|
// to 7/4/6); an explicit --keep-* flag still overrides per invocation.
|
|
260
|
-
const prunePolicy = backupConfig();
|
|
261
260
|
backup
|
|
262
261
|
.command("prune")
|
|
263
|
-
.description(
|
|
264
|
-
|
|
262
|
+
.description("Forget + prune snapshots (default policy comes from backup.keep_* config).")
|
|
263
|
+
.option("--keep-daily <n>", "Daily snapshots to keep (default: configured backup.keep_daily)")
|
|
264
|
+
.option(
|
|
265
|
+
"--keep-weekly <n>",
|
|
266
|
+
"Weekly snapshots to keep (default: configured backup.keep_weekly)",
|
|
267
|
+
)
|
|
268
|
+
.option(
|
|
269
|
+
"--keep-monthly <n>",
|
|
270
|
+
"Monthly snapshots to keep (default: configured backup.keep_monthly)",
|
|
265
271
|
)
|
|
266
|
-
.option("--keep-daily <n>", "Daily snapshots to keep", String(prunePolicy.keepDaily))
|
|
267
|
-
.option("--keep-weekly <n>", "Weekly snapshots to keep", String(prunePolicy.keepWeekly))
|
|
268
|
-
.option("--keep-monthly <n>", "Monthly snapshots to keep", String(prunePolicy.keepMonthly))
|
|
269
272
|
.option("--dry-run", "Show what would be pruned without actually pruning")
|
|
270
273
|
.option("--repo <path>", "Repository path")
|
|
271
274
|
.option("--password-file <path>", "Password file")
|
|
272
275
|
.action(
|
|
273
276
|
(
|
|
274
277
|
opts: BaseOpts & {
|
|
275
|
-
keepDaily
|
|
276
|
-
keepWeekly
|
|
277
|
-
keepMonthly
|
|
278
|
+
keepDaily?: string;
|
|
279
|
+
keepWeekly?: string;
|
|
280
|
+
keepMonthly?: string;
|
|
278
281
|
dryRun?: boolean;
|
|
279
282
|
},
|
|
280
283
|
) => {
|
|
@@ -282,14 +285,15 @@ export function registerBackupCommand(program: Command, emit: EmitContext): void
|
|
|
282
285
|
emit.setExitCode(1);
|
|
283
286
|
return;
|
|
284
287
|
}
|
|
288
|
+
const prunePolicy = backupConfig();
|
|
285
289
|
const args = [
|
|
286
290
|
"forget",
|
|
287
291
|
"--keep-daily",
|
|
288
|
-
opts.keepDaily,
|
|
292
|
+
opts.keepDaily ?? String(prunePolicy.keepDaily),
|
|
289
293
|
"--keep-weekly",
|
|
290
|
-
opts.keepWeekly,
|
|
294
|
+
opts.keepWeekly ?? String(prunePolicy.keepWeekly),
|
|
291
295
|
"--keep-monthly",
|
|
292
|
-
opts.keepMonthly,
|
|
296
|
+
opts.keepMonthly ?? String(prunePolicy.keepMonthly),
|
|
293
297
|
];
|
|
294
298
|
if (!opts.dryRun) args.push("--prune");
|
|
295
299
|
else args.push("--dry-run");
|
|
@@ -28,6 +28,7 @@ export function registerBrowseSessionCommand(program: Command, emit: EmitContext
|
|
|
28
28
|
|
|
29
29
|
session
|
|
30
30
|
.command("status")
|
|
31
|
+
.description("Report whether the opted-in browser session is reachable")
|
|
31
32
|
.requiredOption("--control-file <path>", "Owner-only session descriptor")
|
|
32
33
|
.action((opts: ControlFileOpts) => runAction(emit, opts.controlFile, "status", {}));
|
|
33
34
|
|
|
@@ -43,6 +44,7 @@ export function registerBrowseSessionCommand(program: Command, emit: EmitContext
|
|
|
43
44
|
|
|
44
45
|
session
|
|
45
46
|
.command("screenshot")
|
|
47
|
+
.description("Capture the active tab to a new PNG file")
|
|
46
48
|
.requiredOption("--control-file <path>", "Owner-only session descriptor")
|
|
47
49
|
.requiredOption("--out <path>", "New PNG path in an existing directory")
|
|
48
50
|
.action((opts: ControlFileOpts & { out: string }) =>
|
|
@@ -51,11 +53,13 @@ export function registerBrowseSessionCommand(program: Command, emit: EmitContext
|
|
|
51
53
|
|
|
52
54
|
session
|
|
53
55
|
.command("tabs")
|
|
56
|
+
.description("List open tabs with stable session-local indexes")
|
|
54
57
|
.requiredOption("--control-file <path>", "Owner-only session descriptor")
|
|
55
58
|
.action((opts: ControlFileOpts) => runAction(emit, opts.controlFile, "tabs", {}));
|
|
56
59
|
|
|
57
60
|
session
|
|
58
61
|
.command("select-tab")
|
|
62
|
+
.description("Select an open tab by its stable session-local index")
|
|
59
63
|
.requiredOption("--control-file <path>", "Owner-only session descriptor")
|
|
60
64
|
.requiredOption("--index <n>", "Stable session-local tab index", parseIndex)
|
|
61
65
|
.action((opts: ControlFileOpts & { index: number }) =>
|
|
@@ -64,6 +68,7 @@ export function registerBrowseSessionCommand(program: Command, emit: EmitContext
|
|
|
64
68
|
|
|
65
69
|
session
|
|
66
70
|
.command("open-tab <url>")
|
|
71
|
+
.description("Open a URL in a new tab and select it")
|
|
67
72
|
.requiredOption("--control-file <path>", "Owner-only session descriptor")
|
|
68
73
|
.action((url: string, opts: ControlFileOpts) =>
|
|
69
74
|
runAction(emit, opts.controlFile, "open_tab", { url }),
|
|
@@ -71,6 +76,7 @@ export function registerBrowseSessionCommand(program: Command, emit: EmitContext
|
|
|
71
76
|
|
|
72
77
|
session
|
|
73
78
|
.command("close-tab")
|
|
79
|
+
.description("Close an open tab by its stable session-local index")
|
|
74
80
|
.requiredOption("--control-file <path>", "Owner-only session descriptor")
|
|
75
81
|
.requiredOption("--index <n>", "Stable session-local tab index", parseIndex)
|
|
76
82
|
.action((opts: ControlFileOpts & { index: number }) =>
|
|
@@ -79,6 +85,7 @@ export function registerBrowseSessionCommand(program: Command, emit: EmitContext
|
|
|
79
85
|
|
|
80
86
|
session
|
|
81
87
|
.command("goto <url>")
|
|
88
|
+
.description("Navigate the active tab to a URL")
|
|
82
89
|
.requiredOption("--control-file <path>", "Owner-only session descriptor")
|
|
83
90
|
.action((url: string, opts: ControlFileOpts) =>
|
|
84
91
|
runAction(emit, opts.controlFile, "goto", { url }),
|
|
@@ -86,12 +93,14 @@ export function registerBrowseSessionCommand(program: Command, emit: EmitContext
|
|
|
86
93
|
|
|
87
94
|
session
|
|
88
95
|
.command("reload")
|
|
96
|
+
.description("Reload the active tab")
|
|
89
97
|
.requiredOption("--control-file <path>", "Owner-only session descriptor")
|
|
90
98
|
.action((opts: ControlFileOpts) => runAction(emit, opts.controlFile, "reload", {}));
|
|
91
99
|
|
|
92
100
|
addLocatorOptions(
|
|
93
101
|
session
|
|
94
102
|
.command("click")
|
|
103
|
+
.description("Click one strict locator in the active tab")
|
|
95
104
|
.requiredOption("--control-file <path>", "Owner-only session descriptor"),
|
|
96
105
|
).action((opts: LocatorOpts) =>
|
|
97
106
|
runAction(emit, opts.controlFile, "click", { locator: parseLocatorOptions(opts, true) }),
|
|
@@ -112,6 +121,7 @@ export function registerBrowseSessionCommand(program: Command, emit: EmitContext
|
|
|
112
121
|
|
|
113
122
|
session
|
|
114
123
|
.command("press <key>")
|
|
124
|
+
.description("Press a keyboard key in the active tab")
|
|
115
125
|
.requiredOption("--control-file <path>", "Owner-only session descriptor")
|
|
116
126
|
.action((key: string, opts: ControlFileOpts) =>
|
|
117
127
|
runAction(emit, opts.controlFile, "press", { key }),
|
|
@@ -120,6 +130,7 @@ export function registerBrowseSessionCommand(program: Command, emit: EmitContext
|
|
|
120
130
|
addLocatorOptions(
|
|
121
131
|
session
|
|
122
132
|
.command("wait")
|
|
133
|
+
.description("Wait for one strict locator in the active tab")
|
|
123
134
|
.requiredOption("--control-file <path>", "Owner-only session descriptor"),
|
|
124
135
|
).action((opts: LocatorOpts) =>
|
|
125
136
|
runAction(emit, opts.controlFile, "wait", { locator: parseLocatorOptions(opts, true) }),
|
|
@@ -127,6 +138,7 @@ export function registerBrowseSessionCommand(program: Command, emit: EmitContext
|
|
|
127
138
|
|
|
128
139
|
session
|
|
129
140
|
.command("close")
|
|
141
|
+
.description("Close the opted-in browser session")
|
|
130
142
|
.requiredOption("--control-file <path>", "Owner-only session descriptor")
|
|
131
143
|
.action((opts: ControlFileOpts) => runAction(emit, opts.controlFile, "close", {}));
|
|
132
144
|
}
|
package/src/commands/browse.ts
CHANGED
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
parseAssertSpec,
|
|
25
25
|
type RuntsResult,
|
|
26
26
|
runCritique,
|
|
27
|
+
type StandaloneHtmlResult,
|
|
27
28
|
type TargetSizeProfile,
|
|
28
29
|
type TargetSizeResult,
|
|
29
30
|
tilesFromFullPage,
|
|
@@ -229,6 +230,7 @@ export function registerBrowseCommand(
|
|
|
229
230
|
program: Command,
|
|
230
231
|
emitParam: EmitContext,
|
|
231
232
|
context?: HarneryProgramContext,
|
|
233
|
+
binName = resolveBinName(),
|
|
232
234
|
): void {
|
|
233
235
|
emit = emitParam;
|
|
234
236
|
program
|
|
@@ -245,7 +247,7 @@ export function registerBrowseCommand(
|
|
|
245
247
|
.option("--snapshot", "Print body innerText to stdout (skips file writes)")
|
|
246
248
|
.option(
|
|
247
249
|
"--html",
|
|
248
|
-
`Print raw outer HTML to stdout (skips file writes; pair with \`${
|
|
250
|
+
`Print raw outer HTML to stdout (skips file writes; pair with \`${binName} read -\`)`,
|
|
249
251
|
)
|
|
250
252
|
.option("--json", "Print full JSON envelope to stdout (skips file writes)")
|
|
251
253
|
.option("--selector <css>", "Scope --html / --snapshot to one element")
|
|
@@ -931,12 +933,10 @@ async function runBrowse(
|
|
|
931
933
|
let critiqueTiles: CritiqueTile[] | undefined;
|
|
932
934
|
let critiqueFullPage: Buffer | undefined;
|
|
933
935
|
if (opts.checkCritique !== undefined) {
|
|
936
|
+
const critiqueProvider =
|
|
937
|
+
context?.critiqueProvider ?? (await context?.critiqueProviderLoader?.());
|
|
934
938
|
const rubric = opts.checkCritiqueRubric ?? DEFAULT_CRITIQUE_RUBRIC;
|
|
935
|
-
const captured = await captureCritiqueTiles(
|
|
936
|
-
browser,
|
|
937
|
-
opts,
|
|
938
|
-
context?.critiqueProvider?.tileBudgetPx,
|
|
939
|
-
);
|
|
939
|
+
const captured = await captureCritiqueTiles(browser, opts, critiqueProvider?.tileBudgetPx);
|
|
940
940
|
critiqueTiles = captured.tiles;
|
|
941
941
|
critiqueFullPage = captured.fullPage;
|
|
942
942
|
let tilesToReview = captured.tiles;
|
|
@@ -983,7 +983,7 @@ async function runBrowse(
|
|
|
983
983
|
url: navResult.url,
|
|
984
984
|
rubric,
|
|
985
985
|
tiles: tilesToReview,
|
|
986
|
-
provider:
|
|
986
|
+
provider: critiqueProvider,
|
|
987
987
|
});
|
|
988
988
|
}
|
|
989
989
|
// Persist the QA baseline AFTER critique so a passing run's verdicts ride
|
|
@@ -1529,9 +1529,22 @@ async function runTrioMode(
|
|
|
1529
1529
|
throw new Error("--capture-evaluate requires a screenshot; remove --no-screenshot.");
|
|
1530
1530
|
}
|
|
1531
1531
|
|
|
1532
|
+
// A trio `.html` is opened in a browser later — from the files origin, from
|
|
1533
|
+
// another machine, from disk — so it has to carry its own CSS and media. A
|
|
1534
|
+
// selector capture is a DOM fragment, not a document, and stays raw.
|
|
1532
1535
|
const htmlPath = `${prefix}.html`;
|
|
1533
|
-
|
|
1534
|
-
|
|
1536
|
+
let snapshot: StandaloneHtmlResult | undefined;
|
|
1537
|
+
if (opts.selector) {
|
|
1538
|
+
writeFileSync(htmlPath, await browser.htmlContent(opts.selector));
|
|
1539
|
+
} else {
|
|
1540
|
+
try {
|
|
1541
|
+
snapshot = await browser.standaloneHtml();
|
|
1542
|
+
writeFileSync(htmlPath, snapshot.html);
|
|
1543
|
+
} catch {
|
|
1544
|
+
// Inlining is best-effort; a raw serialization beats no snapshot at all.
|
|
1545
|
+
writeFileSync(htmlPath, await browser.htmlContent());
|
|
1546
|
+
}
|
|
1547
|
+
}
|
|
1535
1548
|
written.push(htmlPath);
|
|
1536
1549
|
|
|
1537
1550
|
const diag = browser.diagnostics();
|
|
@@ -1548,6 +1561,15 @@ async function runTrioMode(
|
|
|
1548
1561
|
...summarizeDiagnostics(diag),
|
|
1549
1562
|
};
|
|
1550
1563
|
if (pngBytes !== undefined) envelope.screenshotBytes = pngBytes;
|
|
1564
|
+
if (snapshot) {
|
|
1565
|
+
envelope.htmlSnapshot = {
|
|
1566
|
+
stylesheetsInlined: snapshot.stylesheetsInlined,
|
|
1567
|
+
stylesheetsLinked: snapshot.stylesheetsLinked,
|
|
1568
|
+
resourcesInlined: snapshot.resourcesInlined,
|
|
1569
|
+
resourcesLinked: snapshot.resourcesLinked,
|
|
1570
|
+
inlinedBytes: snapshot.inlinedBytes,
|
|
1571
|
+
};
|
|
1572
|
+
}
|
|
1551
1573
|
if (opts.evaluate) envelope.eval = evalResult;
|
|
1552
1574
|
if (opts.captureEvaluate) {
|
|
1553
1575
|
envelope.captureEval = captureEvalResult;
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
import type { EmitContext } from "../commander.ts";
|
|
3
|
+
import type { HarneryConversationCatalog } from "../core/conversations/catalog.ts";
|
|
4
|
+
import { buildConversationContextPack } from "../core/conversations/context-pack.ts";
|
|
5
|
+
import type {
|
|
6
|
+
HarneryConversationQueryRequest,
|
|
7
|
+
HarneryConversationRecordV1,
|
|
8
|
+
HarneryConversationRole,
|
|
9
|
+
} from "../core/conversations/contract.ts";
|
|
10
|
+
import {
|
|
11
|
+
type HarneryConversationPurgePlan,
|
|
12
|
+
planConversationPurge,
|
|
13
|
+
validatePurgeExecutionRequest,
|
|
14
|
+
} from "../core/conversations/lifecycle.ts";
|
|
15
|
+
import { queryConversationCatalog } from "../core/conversations/query.ts";
|
|
16
|
+
|
|
17
|
+
export interface RegisterConversationsOptions {
|
|
18
|
+
project_scope_id: string;
|
|
19
|
+
records?: () => readonly HarneryConversationRecordV1[];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function registerConversationsCommand(
|
|
23
|
+
program: Command,
|
|
24
|
+
emit: EmitContext,
|
|
25
|
+
catalog?: HarneryConversationCatalog,
|
|
26
|
+
dependencies?: RegisterConversationsOptions,
|
|
27
|
+
): void {
|
|
28
|
+
const pendingPlans = new Map<string, HarneryConversationPurgePlan>();
|
|
29
|
+
const conversations = program.command("conversations").description("Query conversation evidence");
|
|
30
|
+
|
|
31
|
+
conversations
|
|
32
|
+
.command("list")
|
|
33
|
+
.option("--provider <id>")
|
|
34
|
+
.option("--project <id>")
|
|
35
|
+
.option("--json")
|
|
36
|
+
.action(async (options: { provider?: string; project?: string; json?: boolean }) => {
|
|
37
|
+
await run(emit, async () => {
|
|
38
|
+
const configured = requireConversations(catalog, dependencies);
|
|
39
|
+
const project = exactProject(configured.dependencies.project_scope_id, options.project);
|
|
40
|
+
const providers = options.provider
|
|
41
|
+
? [configured.catalog.require(options.provider)]
|
|
42
|
+
: configured.catalog.list();
|
|
43
|
+
const rows = (
|
|
44
|
+
await Promise.all(
|
|
45
|
+
providers.map(async (provider) =>
|
|
46
|
+
provider.capabilities.can_list ? provider.list(project) : [],
|
|
47
|
+
),
|
|
48
|
+
)
|
|
49
|
+
).flat();
|
|
50
|
+
if (options.json) {
|
|
51
|
+
emit.config({ format: "json" });
|
|
52
|
+
emit.data({ schema: "harnery.conversation-list/v1", project_scope_id: project, rows });
|
|
53
|
+
} else emit.rows(rows as unknown as Record<string, unknown>[]);
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
addQueryOptions(conversations.command("query"))
|
|
58
|
+
.option("--json")
|
|
59
|
+
.action(async (options: QueryOptions) => {
|
|
60
|
+
await run(emit, async () => {
|
|
61
|
+
const configured = requireConversations(catalog, dependencies);
|
|
62
|
+
const result = await queryConversationCatalog(
|
|
63
|
+
configured.catalog,
|
|
64
|
+
request(configured.dependencies, options),
|
|
65
|
+
);
|
|
66
|
+
if (options.json) {
|
|
67
|
+
emit.config({ format: "json" });
|
|
68
|
+
emit.data(result);
|
|
69
|
+
} else {
|
|
70
|
+
emit.rows(
|
|
71
|
+
result.hits.map(({ record, citation }) => ({
|
|
72
|
+
...citation,
|
|
73
|
+
content: record.content,
|
|
74
|
+
})),
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
addQueryOptions(conversations.command("context"))
|
|
81
|
+
.option("--max-tokens <count>", "Token ceiling", parsePositive, 2_000)
|
|
82
|
+
.option("--max-bytes <count>", "Byte ceiling", parsePositive, 16_000)
|
|
83
|
+
.option("--json")
|
|
84
|
+
.action(
|
|
85
|
+
async (options: QueryOptions & { maxTokens: number; maxBytes: number; json?: boolean }) => {
|
|
86
|
+
await run(emit, async () => {
|
|
87
|
+
const configured = requireConversations(catalog, dependencies);
|
|
88
|
+
const result = await queryConversationCatalog(
|
|
89
|
+
configured.catalog,
|
|
90
|
+
request(configured.dependencies, options),
|
|
91
|
+
);
|
|
92
|
+
const pack = buildConversationContextPack(result, {
|
|
93
|
+
max_tokens: options.maxTokens,
|
|
94
|
+
max_bytes: options.maxBytes,
|
|
95
|
+
});
|
|
96
|
+
if (options.json) emit.config({ format: "json" });
|
|
97
|
+
emit.data(pack);
|
|
98
|
+
});
|
|
99
|
+
},
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
conversations
|
|
103
|
+
.command("archive")
|
|
104
|
+
.requiredOption("--mode <mode>", "off | source | archive")
|
|
105
|
+
.option("--authority <mode>", "shadow | cutover | rollback", "shadow")
|
|
106
|
+
.option("--yes", "Reserved for a future checked capture transaction")
|
|
107
|
+
.action((options: { mode: string; authority: string; yes?: boolean }) => {
|
|
108
|
+
const validMode = ["off", "source", "archive"].includes(options.mode);
|
|
109
|
+
const validAuthority = ["shadow", "cutover", "rollback"].includes(options.authority);
|
|
110
|
+
if (!validMode || !validAuthority) {
|
|
111
|
+
emit.error({ code: "conversation_archive_mode_invalid", message: "invalid archive mode" });
|
|
112
|
+
emit.setExitCode(1);
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
emit.data({
|
|
116
|
+
schema: "harnery.conversation-archive-plan/v1",
|
|
117
|
+
access_mode: options.mode,
|
|
118
|
+
authority_mode: options.authority,
|
|
119
|
+
dry_run: true,
|
|
120
|
+
writes: false,
|
|
121
|
+
execution_enabled: false,
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
conversations
|
|
126
|
+
.command("purge")
|
|
127
|
+
.option("--conversation <id>")
|
|
128
|
+
.option("--before <time>")
|
|
129
|
+
.option("--transaction <id>")
|
|
130
|
+
.option("--yes")
|
|
131
|
+
.option("--json")
|
|
132
|
+
.action(
|
|
133
|
+
(options: {
|
|
134
|
+
conversation?: string;
|
|
135
|
+
before?: string;
|
|
136
|
+
transaction?: string;
|
|
137
|
+
yes?: boolean;
|
|
138
|
+
json?: boolean;
|
|
139
|
+
}) => {
|
|
140
|
+
try {
|
|
141
|
+
const configured = requireConversations(catalog, dependencies);
|
|
142
|
+
if (options.transaction) {
|
|
143
|
+
const plan = pendingPlans.get(options.transaction);
|
|
144
|
+
if (!plan) throw new Error(`unknown purge transaction: ${options.transaction}`);
|
|
145
|
+
const result = validatePurgeExecutionRequest(
|
|
146
|
+
plan,
|
|
147
|
+
options.transaction,
|
|
148
|
+
options.yes ?? false,
|
|
149
|
+
);
|
|
150
|
+
if (options.json) emit.config({ format: "json" });
|
|
151
|
+
emit.data({ schema: "harnery.conversation-purge-result/v1", ...result });
|
|
152
|
+
if (result.reason_code !== "execution_disabled") emit.setExitCode(1);
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
const plan = planConversationPurge({
|
|
156
|
+
records: configured.dependencies.records?.() ?? [],
|
|
157
|
+
project_scope_id: configured.dependencies.project_scope_id,
|
|
158
|
+
...(options.conversation ? { conversation_id: options.conversation } : {}),
|
|
159
|
+
...(options.before ? { before: options.before } : {}),
|
|
160
|
+
});
|
|
161
|
+
pendingPlans.set(plan.transaction_id, plan);
|
|
162
|
+
if (options.json) emit.config({ format: "json" });
|
|
163
|
+
emit.data(plan);
|
|
164
|
+
} catch (error) {
|
|
165
|
+
emit.error({
|
|
166
|
+
code: "conversation_purge_failed",
|
|
167
|
+
message: error instanceof Error ? error.message : String(error),
|
|
168
|
+
});
|
|
169
|
+
emit.setExitCode(1);
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function requireConversations(
|
|
176
|
+
catalog?: HarneryConversationCatalog,
|
|
177
|
+
dependencies?: RegisterConversationsOptions,
|
|
178
|
+
): {
|
|
179
|
+
catalog: HarneryConversationCatalog;
|
|
180
|
+
dependencies: RegisterConversationsOptions;
|
|
181
|
+
} {
|
|
182
|
+
if (!catalog || !dependencies)
|
|
183
|
+
throw new Error("conversation providers are not configured by this host");
|
|
184
|
+
return { catalog, dependencies };
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
interface QueryOptions {
|
|
188
|
+
text?: string;
|
|
189
|
+
regex?: string;
|
|
190
|
+
role?: string;
|
|
191
|
+
since?: string;
|
|
192
|
+
until?: string;
|
|
193
|
+
project?: string;
|
|
194
|
+
provider?: string;
|
|
195
|
+
session?: string;
|
|
196
|
+
conversation?: string;
|
|
197
|
+
record?: string;
|
|
198
|
+
limit: number;
|
|
199
|
+
contextBefore: number;
|
|
200
|
+
contextAfter: number;
|
|
201
|
+
json?: boolean;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function addQueryOptions(command: Command): Command {
|
|
205
|
+
return command
|
|
206
|
+
.option("--text <literal>")
|
|
207
|
+
.option("--regex <pattern>")
|
|
208
|
+
.option("--role <role>")
|
|
209
|
+
.option("--since <time>")
|
|
210
|
+
.option("--until <time>")
|
|
211
|
+
.option("--project <id>")
|
|
212
|
+
.option("--provider <id>")
|
|
213
|
+
.option("--session <id>")
|
|
214
|
+
.option("--conversation <id>")
|
|
215
|
+
.option("--record <id>")
|
|
216
|
+
.option("--limit <count>", "Match ceiling", parsePositive, 20)
|
|
217
|
+
.option("--context-before <count>", "Earlier neighbors", parseNonnegative, 0)
|
|
218
|
+
.option("--context-after <count>", "Later neighbors", parseNonnegative, 0);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
function request(
|
|
222
|
+
dependencies: RegisterConversationsOptions,
|
|
223
|
+
options: QueryOptions,
|
|
224
|
+
): HarneryConversationQueryRequest {
|
|
225
|
+
const role = options.role as HarneryConversationRole | undefined;
|
|
226
|
+
return {
|
|
227
|
+
project_scope_id: exactProject(dependencies.project_scope_id, options.project),
|
|
228
|
+
limit: options.limit,
|
|
229
|
+
context_before: options.contextBefore,
|
|
230
|
+
context_after: options.contextAfter,
|
|
231
|
+
budgets: {
|
|
232
|
+
max_source_records: 10_000,
|
|
233
|
+
max_decoded_bytes: 16 * 1_024 * 1_024,
|
|
234
|
+
max_matches: options.limit,
|
|
235
|
+
max_wall_ms: 5_000,
|
|
236
|
+
max_regex_chars: 256,
|
|
237
|
+
},
|
|
238
|
+
...(options.text ? { text: options.text } : {}),
|
|
239
|
+
...(options.regex ? { regex: options.regex } : {}),
|
|
240
|
+
...(role ? { role } : {}),
|
|
241
|
+
...(options.since ? { since: options.since } : {}),
|
|
242
|
+
...(options.until ? { until: options.until } : {}),
|
|
243
|
+
...(options.provider ? { provider_id: options.provider } : {}),
|
|
244
|
+
...(options.session ? { session_id: options.session } : {}),
|
|
245
|
+
...(options.conversation ? { conversation_id: options.conversation } : {}),
|
|
246
|
+
...(options.record ? { record_id: options.record } : {}),
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
function exactProject(expected: string, requested?: string): string {
|
|
251
|
+
if (requested && requested !== expected)
|
|
252
|
+
throw new Error("cross-project conversation access denied");
|
|
253
|
+
return expected;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
function parsePositive(value: string): number {
|
|
257
|
+
const parsed = Number(value);
|
|
258
|
+
if (!Number.isSafeInteger(parsed) || parsed <= 0) throw new Error("expected a positive integer");
|
|
259
|
+
return parsed;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
function parseNonnegative(value: string): number {
|
|
263
|
+
const parsed = Number(value);
|
|
264
|
+
if (!Number.isSafeInteger(parsed) || parsed < 0)
|
|
265
|
+
throw new Error("expected a nonnegative integer");
|
|
266
|
+
return parsed;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
async function run(emit: EmitContext, action: () => Promise<void>): Promise<void> {
|
|
270
|
+
try {
|
|
271
|
+
await action();
|
|
272
|
+
} catch (error) {
|
|
273
|
+
emit.error({
|
|
274
|
+
code: "conversation_command_failed",
|
|
275
|
+
message: error instanceof Error ? error.message : String(error),
|
|
276
|
+
});
|
|
277
|
+
emit.setExitCode(1);
|
|
278
|
+
}
|
|
279
|
+
}
|
package/src/commands/decision.ts
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from "node:fs";
|
|
2
2
|
import type { Command } from "commander";
|
|
3
3
|
import type { EmitContext } from "../commander.ts";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
emitEventV3,
|
|
6
|
+
monorepoRoot,
|
|
7
|
+
nativeSessionIdentity,
|
|
8
|
+
normalizeAdapter,
|
|
9
|
+
resolveOwner,
|
|
10
|
+
} from "../core/agents/index.ts";
|
|
5
11
|
import { readLiveCoordinationRow } from "../core/agents/state/live-coordination-view.ts";
|
|
6
12
|
import { resolveBinName } from "../core/config.ts";
|
|
7
13
|
import {
|
|
@@ -442,7 +448,7 @@ function emitDecisionEvent(
|
|
|
442
448
|
const hb = root ? readLiveCoordinationRow(root, owner) : null;
|
|
443
449
|
emitEventV3({
|
|
444
450
|
owner,
|
|
445
|
-
session: hb
|
|
451
|
+
session: nativeSessionIdentity(hb, owner),
|
|
446
452
|
adapter: normalizeAdapter(hb?.platform),
|
|
447
453
|
observation: {
|
|
448
454
|
event_type: "decision.state_changed",
|
package/src/commands/deinit.ts
CHANGED
|
@@ -35,6 +35,7 @@ import type { EmitContext } from "../commander.ts";
|
|
|
35
35
|
import { DEFAULT_BIN_NAME } from "../core/config.ts";
|
|
36
36
|
import { ADAPTER_SPECS, type AdapterId } from "../core/hooks/adapter/events.ts";
|
|
37
37
|
import type { SettingsFile } from "../core/hooks/adapter/wiring.ts";
|
|
38
|
+
import { removeIndexerExclusions } from "../lib/indexer-exclusions.ts";
|
|
38
39
|
import { removeInstructions } from "../lib/instructions/apply.ts";
|
|
39
40
|
import { removeGitHooks } from "../lib/instructions/git-hooks.ts";
|
|
40
41
|
import { unwireHooks } from "./init.ts";
|
|
@@ -136,6 +137,11 @@ export function registerDeinitCommand(program: Command, emit: EmitContext, binNa
|
|
|
136
137
|
}
|
|
137
138
|
}
|
|
138
139
|
|
|
140
|
+
// ── 1a′. editor indexer exclusions ─────────────────────────────────────
|
|
141
|
+
// Reverse only what init wrote: the managed .cursorindexingignore entry
|
|
142
|
+
// and the files.watcherExclude key. Consumer-authored entries stay.
|
|
143
|
+
actions.push(...removeIndexerExclusions(projectRoot, dryRun));
|
|
144
|
+
|
|
139
145
|
// ── 1b. agent-facing instructions block + skills ───────────────────────
|
|
140
146
|
const removed = removeInstructions(projectRoot, { adapter, dryRun });
|
|
141
147
|
actions.push(...removed.actions, ...removed.warnings.map((w) => `! ${w}`));
|
package/src/commands/docs.ts
CHANGED
|
@@ -92,10 +92,14 @@ export function registerDocsCommand(
|
|
|
92
92
|
.command("validate")
|
|
93
93
|
.description("Validate every managed Markdown file against harnery-doc/v2")
|
|
94
94
|
.option("--repo <name>", "Limit to one submodule or '.' for parent")
|
|
95
|
-
.
|
|
95
|
+
.option("--cached", "Read paths and contents from the Git index")
|
|
96
|
+
.action(async (opts: { repo?: string; cached?: boolean }) => {
|
|
96
97
|
try {
|
|
97
98
|
ensureContext(context);
|
|
98
|
-
const rows = await runDocsMetadataAudit(
|
|
99
|
+
const rows = await runDocsMetadataAudit({
|
|
100
|
+
repo: opts.repo,
|
|
101
|
+
source: opts.cached ? "index" : "worktree",
|
|
102
|
+
});
|
|
99
103
|
const errors = rows
|
|
100
104
|
.flatMap((row) => row.issues)
|
|
101
105
|
.filter((issue) => issue.severity === "error");
|
|
@@ -128,9 +132,13 @@ export function registerDocsCommand(
|
|
|
128
132
|
.argument("[files...]", "Explicit repository-relative Markdown files; defaults to staged files")
|
|
129
133
|
.option("--repo <name>", "Limit to one submodule or '.' for parent")
|
|
130
134
|
.option("--check", "Report timestamp drift without writing")
|
|
135
|
+
.option("--cached", "Read current contents from the Git index (requires --check)")
|
|
131
136
|
.option("--reviewed", "Record an explicit runbook review and move its due date")
|
|
132
137
|
.action(
|
|
133
|
-
async (
|
|
138
|
+
async (
|
|
139
|
+
files: string[],
|
|
140
|
+
opts: { repo?: string; check?: boolean; cached?: boolean; reviewed?: boolean },
|
|
141
|
+
) => {
|
|
134
142
|
try {
|
|
135
143
|
ensureContext(context);
|
|
136
144
|
const rows = await runDocsMetadataSync({ ...opts, files });
|
|
@@ -194,8 +202,9 @@ export function registerDocsCommand(
|
|
|
194
202
|
)
|
|
195
203
|
.option("--fast", "Skip content-reading checks; filename/structure only (for pre-commit)")
|
|
196
204
|
.option("--repo <name>", "Limit to one submodule or '.' for parent")
|
|
205
|
+
.option("--cached", "Read paths and contents from the Git index")
|
|
197
206
|
.option("--format <type>", "Output format: human, json", "human")
|
|
198
|
-
.action(async (opts: { fast?: boolean; repo?: string; format: string }) => {
|
|
207
|
+
.action(async (opts: { fast?: boolean; repo?: string; cached?: boolean; format: string }) => {
|
|
199
208
|
try {
|
|
200
209
|
ensureContext(context);
|
|
201
210
|
await handleLint(opts);
|
|
@@ -311,8 +320,17 @@ async function handleDocs(opts: {
|
|
|
311
320
|
|
|
312
321
|
// --- `harn docs lint` ---
|
|
313
322
|
|
|
314
|
-
async function handleLint(opts: {
|
|
315
|
-
|
|
323
|
+
async function handleLint(opts: {
|
|
324
|
+
fast?: boolean;
|
|
325
|
+
repo?: string;
|
|
326
|
+
cached?: boolean;
|
|
327
|
+
format: string;
|
|
328
|
+
}): Promise<void> {
|
|
329
|
+
const violations = await runLint({
|
|
330
|
+
fast: opts.fast,
|
|
331
|
+
repo: opts.repo,
|
|
332
|
+
source: opts.cached ? "index" : "worktree",
|
|
333
|
+
});
|
|
316
334
|
const errors = violations.filter((v) => v.severity === "error");
|
|
317
335
|
const warnings = violations.filter((v) => v.severity === "warning");
|
|
318
336
|
const cold = await countColdHandoffs();
|
|
@@ -320,6 +338,7 @@ async function handleLint(opts: { fast?: boolean; repo?: string; format: string
|
|
|
320
338
|
emit.data({
|
|
321
339
|
fast: !!opts.fast,
|
|
322
340
|
repo: opts.repo ?? null,
|
|
341
|
+
source: opts.cached ? "index" : "worktree",
|
|
323
342
|
error_count: errors.length,
|
|
324
343
|
warning_count: warnings.length,
|
|
325
344
|
cold_handoffs: cold,
|