harnery 0.40.0 → 0.42.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/README.md +1 -1
- package/dist/commander.js +4 -0
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +34 -20
- package/dist/commands/artifacts.d.ts.map +1 -1
- package/dist/commands/artifacts.js +113 -12
- package/dist/commands/browse-ai.d.ts.map +1 -1
- package/dist/commands/browse-ai.js +4 -0
- package/dist/commands/browse.d.ts +164 -0
- package/dist/commands/browse.d.ts.map +1 -1
- package/dist/commands/browse.js +388 -45
- package/dist/commands/checkpoint.js +8 -12
- package/dist/commands/claude-desktop.d.ts.map +1 -1
- package/dist/commands/claude-desktop.js +52 -0
- package/dist/commands/deinit.d.ts +1 -1
- package/dist/commands/deinit.d.ts.map +1 -1
- package/dist/commands/deinit.js +8 -4
- package/dist/commands/disk.d.ts +6 -0
- package/dist/commands/disk.d.ts.map +1 -0
- package/dist/commands/disk.js +80 -0
- package/dist/commands/docs.d.ts.map +1 -1
- package/dist/commands/docs.js +2 -0
- package/dist/commands/doctor.d.ts +8 -0
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +58 -3
- package/dist/commands/fetch.d.ts.map +1 -1
- package/dist/commands/fetch.js +10 -0
- package/dist/commands/files.d.ts +16 -0
- package/dist/commands/files.d.ts.map +1 -1
- package/dist/commands/files.js +54 -2
- package/dist/commands/init.d.ts +21 -5
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +271 -109
- package/dist/commands/instructions.js +5 -4
- package/dist/commands/ledger-v3.d.ts.map +1 -1
- package/dist/commands/ledger-v3.js +2 -1
- package/dist/commands/rm.d.ts +4 -0
- package/dist/commands/rm.d.ts.map +1 -0
- package/dist/commands/rm.js +87 -0
- package/dist/commands/servers.d.ts +7 -0
- package/dist/commands/servers.d.ts.map +1 -0
- package/dist/commands/servers.js +394 -0
- package/dist/commands/tunnel.d.ts.map +1 -1
- package/dist/commands/tunnel.js +82 -2
- package/dist/commands/webview.d.ts +4 -0
- package/dist/commands/webview.d.ts.map +1 -0
- package/dist/commands/webview.js +94 -0
- package/dist/core/adapter.d.ts +50 -1
- package/dist/core/adapter.d.ts.map +1 -1
- package/dist/core/adapter.js +59 -1
- package/dist/core/adapters/attestation.d.ts.map +1 -1
- package/dist/core/adapters/attestation.js +3 -2
- package/dist/core/adapters/profiles.d.ts +29 -3
- package/dist/core/adapters/profiles.d.ts.map +1 -1
- package/dist/core/adapters/profiles.js +53 -1
- package/dist/core/adapters/registry.d.ts.map +1 -1
- package/dist/core/adapters/registry.js +33 -0
- package/dist/core/adapters/types.d.ts +9 -0
- package/dist/core/adapters/types.d.ts.map +1 -1
- package/dist/core/agents/canonical-emit.d.ts +1 -1
- package/dist/core/agents/canonical-emit.d.ts.map +1 -1
- package/dist/core/agents/canonical-emit.js +2 -7
- package/dist/core/agents/cli.js +25 -16
- package/dist/core/agents/coord-client.d.ts.map +1 -1
- package/dist/core/agents/coord-client.js +7 -2
- package/dist/core/agents/render/session-context.d.ts.map +1 -1
- package/dist/core/agents/render/session-context.js +2 -0
- package/dist/core/agents/rules/claim-conflict.d.ts.map +1 -1
- package/dist/core/agents/rules/claim-conflict.js +3 -9
- package/dist/core/agents/rules/commit-conflict.d.ts.map +1 -1
- package/dist/core/agents/rules/commit-conflict.js +2 -8
- 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 +1 -1
- package/dist/core/agents/session-events.d.ts +6 -2
- package/dist/core/agents/session-events.d.ts.map +1 -1
- package/dist/core/agents/session-events.js +105 -26
- package/dist/core/agents/session-finalization-state-v3.d.ts.map +1 -1
- package/dist/core/agents/session-finalization-state-v3.js +2 -1
- package/dist/core/agents/session-finalizer-v3.d.ts.map +1 -1
- package/dist/core/agents/session-finalizer-v3.js +5 -4
- package/dist/core/agents/session-name-display.d.ts +28 -0
- package/dist/core/agents/session-name-display.d.ts.map +1 -1
- package/dist/core/agents/session-name-display.js +43 -0
- package/dist/core/agents/state/heartbeat-reader.d.ts +7 -0
- package/dist/core/agents/state/heartbeat-reader.d.ts.map +1 -1
- package/dist/core/agents/state/heartbeat-writer.d.ts +10 -0
- package/dist/core/agents/state/heartbeat-writer.d.ts.map +1 -1
- package/dist/core/agents/state/heartbeat-writer.js +21 -2
- package/dist/core/agents/state/live-coordination-view.d.ts +20 -0
- package/dist/core/agents/state/live-coordination-view.d.ts.map +1 -1
- package/dist/core/agents/state/live-coordination-view.js +61 -0
- package/dist/core/agents/state/live-coordination-writer.js +3 -0
- package/dist/core/agents/state/stale-sweep.d.ts.map +1 -1
- package/dist/core/agents/state/stale-sweep.js +2 -10
- package/dist/core/agents/turn-changes.d.ts +17 -0
- package/dist/core/agents/turn-changes.d.ts.map +1 -0
- package/dist/core/agents/turn-changes.js +76 -0
- package/dist/core/artifacts/delivery-card.d.ts.map +1 -1
- package/dist/core/artifacts/delivery-card.js +11 -3
- package/dist/core/artifacts/index.d.ts +140 -4
- package/dist/core/artifacts/index.d.ts.map +1 -1
- package/dist/core/artifacts/index.js +526 -52
- package/dist/core/config.d.ts +73 -11
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +142 -3
- package/dist/core/context/index.d.ts.map +1 -1
- package/dist/core/context/index.js +2 -1
- package/dist/core/conversations/archive.d.ts.map +1 -1
- package/dist/core/conversations/archive.js +4 -3
- package/dist/core/diagnostics/bundle.d.ts.map +1 -1
- package/dist/core/diagnostics/bundle.js +5 -4
- package/dist/core/events/legacy-storage/canary.d.ts.map +1 -1
- package/dist/core/events/legacy-storage/canary.js +5 -4
- package/dist/core/events/legacy-storage/compression.d.ts.map +1 -1
- package/dist/core/events/legacy-storage/compression.js +2 -1
- package/dist/core/events/v3/adapter-id.d.ts +10 -2
- package/dist/core/events/v3/adapter-id.d.ts.map +1 -1
- package/dist/core/events/v3/adapter-id.js +16 -0
- package/dist/core/events/v3/authority-outbox.d.ts.map +1 -1
- package/dist/core/events/v3/authority-outbox.js +2 -1
- package/dist/core/events/v3/bootstrap.d.ts.map +1 -1
- package/dist/core/events/v3/bootstrap.js +5 -4
- package/dist/core/events/v3/capabilities.d.ts.map +1 -1
- package/dist/core/events/v3/capabilities.js +17 -0
- package/dist/core/events/v3/contract.d.ts +5 -0
- package/dist/core/events/v3/contract.d.ts.map +1 -1
- package/dist/core/events/v3/contract.js +7 -1
- package/dist/core/events/v3/control-witness.d.ts.map +1 -1
- package/dist/core/events/v3/control-witness.js +3 -2
- package/dist/core/events/v3/coordination-transaction-recovery.d.ts.map +1 -1
- package/dist/core/events/v3/coordination-transaction-recovery.js +4 -3
- package/dist/core/events/v3/fingerprint-keys.d.ts.map +1 -1
- package/dist/core/events/v3/fingerprint-keys.js +7 -6
- package/dist/core/events/v3/generated.d.ts +1 -1
- package/dist/core/events/v3/generated.js +1 -1
- package/dist/core/events/v3/live-feed.d.ts.map +1 -1
- package/dist/core/events/v3/live-feed.js +5 -4
- package/dist/core/events/v3/producers/command-recorder.d.ts.map +1 -1
- package/dist/core/events/v3/producers/command-recorder.js +8 -7
- package/dist/core/events/v3/producers/coordination-recorder.d.ts.map +1 -1
- package/dist/core/events/v3/producers/coordination-recorder.js +8 -7
- package/dist/core/events/v3/producers/diagnostic-summaries.d.ts.map +1 -1
- package/dist/core/events/v3/producers/diagnostic-summaries.js +5 -4
- package/dist/core/events/v3/producers/hook-base.d.ts +1 -0
- package/dist/core/events/v3/producers/hook-base.d.ts.map +1 -1
- package/dist/core/events/v3/producers/hook-base.js +10 -4
- package/dist/core/events/v3/producers/hook.d.ts +2 -0
- package/dist/core/events/v3/producers/hook.d.ts.map +1 -1
- package/dist/core/events/v3/producers/hook.js +16 -1
- package/dist/core/events/v3/producers/intake.d.ts.map +1 -1
- package/dist/core/events/v3/producers/intake.js +16 -6
- package/dist/core/events/v3/producers/recorder.d.ts +2 -4
- package/dist/core/events/v3/producers/recorder.d.ts.map +1 -1
- package/dist/core/events/v3/producers/recorder.js +125 -101
- package/dist/core/events/v3/projection.js +9 -1
- package/dist/core/events/v3/recovery.d.ts.map +1 -1
- package/dist/core/events/v3/recovery.js +4 -3
- package/dist/core/events/v3/support-storage/inventory.d.ts.map +1 -1
- package/dist/core/events/v3/support-storage/inventory.js +2 -1
- package/dist/core/events/v3/support-storage/maintenance.d.ts.map +1 -1
- package/dist/core/events/v3/support-storage/maintenance.js +4 -3
- package/dist/core/events/v3/support-storage/pack-reader.d.ts.map +1 -1
- package/dist/core/events/v3/support-storage/pack-reader.js +4 -3
- package/dist/core/events/v3/support-storage/pack-writer.d.ts.map +1 -1
- package/dist/core/events/v3/support-storage/pack-writer.js +6 -5
- package/dist/core/events/v3/tool-line-changes.d.ts +8 -0
- package/dist/core/events/v3/tool-line-changes.d.ts.map +1 -0
- package/dist/core/events/v3/tool-line-changes.js +135 -0
- package/dist/core/events/v3/writer.d.ts.map +1 -1
- package/dist/core/events/v3/writer.js +8 -7
- package/dist/core/governor/planning.d.ts.map +1 -1
- package/dist/core/governor/planning.js +6 -5
- package/dist/core/governor/service.d.ts.map +1 -1
- package/dist/core/governor/service.js +12 -11
- package/dist/core/governor/state.d.ts.map +1 -1
- package/dist/core/governor/state.js +7 -6
- package/dist/core/guard/evaluator.js +1 -0
- package/dist/core/guard/storage.d.ts.map +1 -1
- package/dist/core/guard/storage.js +3 -2
- package/dist/core/hooks/adapter/behaviors/claude-code.d.ts +4 -0
- package/dist/core/hooks/adapter/behaviors/claude-code.d.ts.map +1 -0
- package/dist/core/hooks/adapter/behaviors/claude-code.js +31 -0
- package/dist/core/hooks/adapter/behaviors/codex.d.ts +15 -0
- package/dist/core/hooks/adapter/behaviors/codex.d.ts.map +1 -0
- package/dist/core/hooks/adapter/behaviors/codex.js +82 -0
- package/dist/core/hooks/adapter/behaviors/cursor.d.ts +7 -0
- package/dist/core/hooks/adapter/behaviors/cursor.d.ts.map +1 -0
- package/dist/core/hooks/adapter/behaviors/cursor.js +35 -0
- package/dist/core/hooks/adapter/behaviors/index.d.ts +11 -0
- package/dist/core/hooks/adapter/behaviors/index.d.ts.map +1 -0
- package/dist/core/hooks/adapter/behaviors/index.js +20 -0
- package/dist/core/hooks/adapter/behaviors/openclaw.d.ts +7 -0
- package/dist/core/hooks/adapter/behaviors/openclaw.d.ts.map +1 -0
- package/dist/core/hooks/adapter/behaviors/openclaw.js +34 -0
- package/dist/core/hooks/adapter/behaviors/opencode.d.ts +7 -0
- package/dist/core/hooks/adapter/behaviors/opencode.d.ts.map +1 -0
- package/dist/core/hooks/adapter/behaviors/opencode.js +34 -0
- package/dist/core/hooks/adapter/behaviors/types.d.ts +89 -0
- package/dist/core/hooks/adapter/behaviors/types.d.ts.map +1 -0
- package/dist/core/hooks/adapter/behaviors/types.js +1 -0
- package/dist/core/hooks/adapter/detect.d.ts +1 -1
- package/dist/core/hooks/adapter/detect.d.ts.map +1 -1
- package/dist/core/hooks/adapter/detect.js +2 -3
- package/dist/core/hooks/adapter/events.d.ts +46 -1
- package/dist/core/hooks/adapter/events.d.ts.map +1 -1
- package/dist/core/hooks/adapter/events.js +36 -0
- package/dist/core/hooks/adapter/opencode-plugin.d.ts +60 -0
- package/dist/core/hooks/adapter/opencode-plugin.d.ts.map +1 -0
- package/dist/core/hooks/adapter/opencode-plugin.js +129 -0
- package/dist/core/hooks/adapter/output.d.ts +7 -0
- package/dist/core/hooks/adapter/output.d.ts.map +1 -1
- package/dist/core/hooks/adapter/output.js +8 -1
- package/dist/core/hooks/adapter/runtime-telemetry.js +3 -1
- package/dist/core/hooks/adapter/wiring.d.ts +52 -8
- package/dist/core/hooks/adapter/wiring.d.ts.map +1 -1
- package/dist/core/hooks/adapter/wiring.js +133 -12
- package/dist/core/hooks/cli.js +676 -531
- package/dist/core/hooks/effects/image-capture.d.ts.map +1 -1
- package/dist/core/hooks/effects/image-capture.js +2 -1
- package/dist/core/hooks/prompt-context/contract.d.ts.map +1 -1
- package/dist/core/hooks/prompt-context/contract.js +1 -0
- package/dist/core/hooks/resolve/transcript.d.ts +1 -1
- package/dist/core/hooks/resolve/transcript.d.ts.map +1 -1
- package/dist/core/hooks/resolve/transcript.js +35 -4
- package/dist/core/hooks/run-markers.d.ts +37 -0
- package/dist/core/hooks/run-markers.d.ts.map +1 -0
- package/dist/core/hooks/run-markers.js +109 -0
- package/dist/core/hooks/session-name-presence.d.ts +3 -1
- package/dist/core/hooks/session-name-presence.d.ts.map +1 -1
- package/dist/core/hooks/session-name-presence.js +7 -2
- package/dist/core/hooks/shell-waiter.d.ts +2 -0
- package/dist/core/hooks/shell-waiter.d.ts.map +1 -0
- package/dist/core/hooks/shell-waiter.js +173 -0
- package/dist/core/resources/service.d.ts.map +1 -1
- package/dist/core/resources/service.js +5 -4
- package/dist/core/semantic/review.d.ts.map +1 -1
- package/dist/core/semantic/review.js +5 -4
- package/dist/core/semantic/service.d.ts.map +1 -1
- package/dist/core/semantic/service.js +15 -14
- package/dist/core/semantic/storage.d.ts.map +1 -1
- package/dist/core/semantic/storage.js +5 -4
- package/dist/core/servers/index.d.ts +211 -0
- package/dist/core/servers/index.d.ts.map +1 -0
- package/dist/core/servers/index.js +560 -0
- package/dist/core/servers/net.d.ts +58 -0
- package/dist/core/servers/net.d.ts.map +1 -0
- package/dist/core/servers/net.js +270 -0
- package/dist/core/servers/tunnels.d.ts +14 -0
- package/dist/core/servers/tunnels.d.ts.map +1 -0
- package/dist/core/servers/tunnels.js +33 -0
- package/dist/core/storage/atomic-json.d.ts.map +1 -1
- package/dist/core/storage/atomic-json.js +7 -3
- package/dist/core/storage/builtins.js +1 -0
- package/dist/core/storage/durable-history.d.ts.map +1 -1
- package/dist/core/storage/durable-history.js +6 -5
- package/dist/core/storage/maintenance-providers.d.ts.map +1 -1
- package/dist/core/storage/maintenance-providers.js +2 -1
- package/dist/core/storage/maintenance.d.ts.map +1 -1
- package/dist/core/storage/maintenance.js +7 -6
- package/dist/core/storage/metrics.d.ts.map +1 -1
- package/dist/core/storage/metrics.js +5 -1
- package/dist/core/storage/modes.d.ts +17 -0
- package/dist/core/storage/modes.d.ts.map +1 -0
- package/dist/core/storage/modes.js +47 -0
- package/dist/core/storage/process-log.d.ts.map +1 -1
- package/dist/core/storage/process-log.js +3 -2
- package/dist/core/storage/receipts.d.ts.map +1 -1
- package/dist/core/storage/receipts.js +4 -3
- package/dist/core/storage/segments.d.ts.map +1 -1
- package/dist/core/storage/segments.js +7 -6
- package/dist/core/supervisor/hook-health.d.ts +2 -1
- package/dist/core/supervisor/hook-health.d.ts.map +1 -1
- package/dist/core/supervisor/hook-health.js +4 -3
- package/dist/core/supervisor/service.d.ts.map +1 -1
- package/dist/core/supervisor/service.js +7 -6
- package/dist/core/work/state.d.ts.map +1 -1
- package/dist/core/work/state.js +8 -7
- package/dist/core/workflow/adapters.d.ts +7 -0
- package/dist/core/workflow/adapters.d.ts.map +1 -1
- package/dist/core/workflow/adapters.js +9 -0
- package/dist/core/workflow/approvals.d.ts.map +1 -1
- package/dist/core/workflow/approvals.js +6 -5
- package/dist/core/workflow/billing.d.ts.map +1 -1
- package/dist/core/workflow/billing.js +33 -4
- package/dist/core/workflow/durable-record.d.ts.map +1 -1
- package/dist/core/workflow/durable-record.js +4 -3
- package/dist/core/workflow/engine.d.ts.map +1 -1
- package/dist/core/workflow/engine.js +30 -1
- package/dist/core/workflow/live-session-v3.d.ts.map +1 -1
- package/dist/core/workflow/live-session-v3.js +2 -3
- package/dist/core/workflow/run-state.d.ts.map +1 -1
- package/dist/core/workflow/run-state.js +3 -2
- package/dist/core/workflow/sandbox-projection.d.ts +13 -2
- package/dist/core/workflow/sandbox-projection.d.ts.map +1 -1
- package/dist/core/workflow/sandbox-projection.js +23 -0
- package/dist/core/workflow/spawn-claude.d.ts.map +1 -1
- package/dist/core/workflow/spawn-claude.js +6 -1
- package/dist/core/workflow/spawn-codex.d.ts +2 -0
- package/dist/core/workflow/spawn-codex.d.ts.map +1 -1
- package/dist/core/workflow/spawn-codex.js +20 -1
- package/dist/core/workflow/spawn-cursor.d.ts.map +1 -1
- package/dist/core/workflow/spawn-cursor.js +6 -1
- package/dist/core/workflow/spawn-opencode.d.ts +36 -0
- package/dist/core/workflow/spawn-opencode.d.ts.map +1 -0
- package/dist/core/workflow/spawn-opencode.js +135 -0
- package/dist/core/workflow/transcript.d.ts.map +1 -1
- package/dist/core/workflow/transcript.js +3 -2
- package/dist/core/workflow/types.d.ts +47 -2
- package/dist/core/workflow/types.d.ts.map +1 -1
- package/dist/core/workflow/worker-access.d.ts +92 -0
- package/dist/core/workflow/worker-access.d.ts.map +1 -0
- package/dist/core/workflow/worker-access.js +450 -0
- package/dist/core/workflow/workspaces/leases.d.ts.map +1 -1
- package/dist/core/workflow/workspaces/leases.js +5 -4
- package/dist/core/workflow/workspaces/local-git.d.ts.map +1 -1
- package/dist/core/workflow/workspaces/local-git.js +3 -2
- package/dist/core/workflow/workspaces/paths.d.ts.map +1 -1
- package/dist/core/workflow/workspaces/paths.js +2 -1
- package/dist/core/workflow/workspaces/state.d.ts.map +1 -1
- package/dist/core/workflow/workspaces/state.js +10 -9
- package/dist/lazy-commands.js +8 -1
- package/dist/lib/agent-browser/client.d.ts +9 -0
- package/dist/lib/agent-browser/client.d.ts.map +1 -1
- package/dist/lib/agent-browser/client.js +13 -0
- package/dist/lib/browser/batch-steps.d.ts +18 -0
- package/dist/lib/browser/batch-steps.d.ts.map +1 -0
- package/dist/lib/browser/batch-steps.js +82 -0
- package/dist/lib/browser/client.d.ts +35 -1
- package/dist/lib/browser/client.d.ts.map +1 -1
- package/dist/lib/browser/client.js +117 -8
- package/dist/lib/browser/collect/collector.d.ts +99 -0
- package/dist/lib/browser/collect/collector.d.ts.map +1 -0
- package/dist/lib/browser/collect/collector.js +202 -0
- package/dist/lib/browser/collect/fields.d.ts +31 -0
- package/dist/lib/browser/collect/fields.d.ts.map +1 -0
- package/dist/lib/browser/collect/fields.js +75 -0
- package/dist/lib/browser/collect/index.d.ts +6 -0
- package/dist/lib/browser/collect/index.d.ts.map +1 -0
- package/dist/lib/browser/collect/index.js +5 -0
- package/dist/lib/browser/collect/page-driver.d.ts +14 -0
- package/dist/lib/browser/collect/page-driver.d.ts.map +1 -0
- package/dist/lib/browser/collect/page-driver.js +306 -0
- package/dist/lib/browser/collect/presets.d.ts +52 -0
- package/dist/lib/browser/collect/presets.d.ts.map +1 -0
- package/dist/lib/browser/collect/presets.js +176 -0
- package/dist/lib/browser/collect/scroll-plan.d.ts +85 -0
- package/dist/lib/browser/collect/scroll-plan.d.ts.map +1 -0
- package/dist/lib/browser/collect/scroll-plan.js +118 -0
- package/dist/lib/browser/identity.d.ts +25 -0
- package/dist/lib/browser/identity.d.ts.map +1 -0
- package/dist/lib/browser/identity.js +66 -0
- package/dist/lib/browser/index.d.ts +3 -2
- package/dist/lib/browser/index.d.ts.map +1 -1
- package/dist/lib/browser/index.js +2 -1
- package/dist/lib/browser/launch-args.d.ts +26 -0
- package/dist/lib/browser/launch-args.d.ts.map +1 -1
- package/dist/lib/browser/launch-args.js +41 -1
- package/dist/lib/browser/page-review-judge.d.ts +2 -0
- package/dist/lib/browser/page-review-judge.d.ts.map +1 -1
- package/dist/lib/browser/page-review-judge.js +13 -0
- package/dist/lib/browser/qa-run-contracts.d.ts +10 -0
- package/dist/lib/browser/qa-run-contracts.d.ts.map +1 -1
- package/dist/lib/browser/qa-run.d.ts.map +1 -1
- package/dist/lib/browser/qa-run.js +1 -0
- package/dist/lib/browser/user-agent.d.ts +53 -0
- package/dist/lib/browser/user-agent.d.ts.map +1 -0
- package/dist/lib/browser/user-agent.js +79 -0
- package/dist/lib/browser/windows-chrome.d.ts +59 -0
- package/dist/lib/browser/windows-chrome.d.ts.map +1 -0
- package/dist/lib/browser/windows-chrome.js +179 -0
- package/dist/lib/claude-desktop-share.d.ts +136 -0
- package/dist/lib/claude-desktop-share.d.ts.map +1 -0
- package/dist/lib/claude-desktop-share.js +394 -0
- package/dist/lib/disk-usage.d.ts +50 -0
- package/dist/lib/disk-usage.d.ts.map +1 -0
- package/dist/lib/disk-usage.js +303 -0
- package/dist/lib/docs-lint.d.ts +6 -0
- package/dist/lib/docs-lint.d.ts.map +1 -1
- package/dist/lib/docs-lint.js +8 -3
- package/dist/lib/docs-metadata-managed.d.ts +1 -0
- package/dist/lib/docs-metadata-managed.d.ts.map +1 -1
- package/dist/lib/docs-metadata-managed.js +17 -1
- package/dist/lib/guarded-remove.d.ts +34 -0
- package/dist/lib/guarded-remove.d.ts.map +1 -0
- package/dist/lib/guarded-remove.js +310 -0
- package/dist/lib/identities/assume.d.ts.map +1 -1
- package/dist/lib/identities/assume.js +4 -9
- package/dist/lib/instructions/apply.d.ts.map +1 -1
- package/dist/lib/instructions/apply.js +2 -0
- package/dist/lib/instructions/templates.js +8 -8
- package/dist/lib/pace/index.d.ts +2 -0
- package/dist/lib/pace/index.d.ts.map +1 -0
- package/dist/lib/pace/index.js +1 -0
- package/dist/lib/pace/pace.d.ts +95 -0
- package/dist/lib/pace/pace.d.ts.map +1 -0
- package/dist/lib/pace/pace.js +313 -0
- package/dist/lib/tunnel/error-page.d.ts +1 -1
- package/dist/lib/tunnel/error-page.d.ts.map +1 -1
- package/dist/lib/tunnel/error-page.js +19 -8
- package/dist/lib/tunnel/forward-headers.d.ts +11 -0
- package/dist/lib/tunnel/forward-headers.d.ts.map +1 -0
- package/dist/lib/tunnel/forward-headers.js +17 -0
- package/dist/lib/tunnel/gate.js +34 -10
- package/dist/lib/tunnel/path-scope.d.ts +22 -0
- package/dist/lib/tunnel/path-scope.d.ts.map +1 -0
- package/dist/lib/tunnel/path-scope.js +62 -0
- package/dist/lib/tunnel/state.d.ts +5 -0
- package/dist/lib/tunnel/state.d.ts.map +1 -1
- package/dist/lib/tunnel/state.js +17 -3
- package/dist/lib/webview/index.d.ts +2 -0
- package/dist/lib/webview/index.d.ts.map +1 -0
- package/dist/lib/webview/index.js +1 -0
- package/dist/lib/webview/webview.d.ts +116 -0
- package/dist/lib/webview/webview.d.ts.map +1 -0
- package/dist/lib/webview/webview.js +289 -0
- package/opencode-plugin/package.json +19 -0
- package/opencode-plugin/src/index.ts +791 -0
- package/package.json +16 -4
- package/schemas/config.schema.json +104 -0
- package/schemas/event-v3.schema.json +164 -0
- package/src/commander.ts +26 -0
- package/src/commands/agents.ts +47 -18
- package/src/commands/artifacts.ts +171 -19
- package/src/commands/browse-ai.ts +8 -0
- package/src/commands/browse.ts +570 -48
- package/src/commands/checkpoint.ts +7 -9
- package/src/commands/claude-desktop.ts +61 -0
- package/src/commands/deinit.ts +9 -4
- package/src/commands/disk.ts +114 -0
- package/src/commands/docs.ts +2 -0
- package/src/commands/doctor.ts +63 -3
- package/src/commands/fetch.ts +14 -0
- package/src/commands/files.ts +93 -2
- package/src/commands/init.ts +334 -122
- package/src/commands/instructions.ts +8 -4
- package/src/commands/ledger-v3.ts +2 -1
- package/src/commands/rm.ts +115 -0
- package/src/commands/servers.ts +506 -0
- package/src/commands/tunnel.ts +102 -2
- package/src/commands/webview.ts +159 -0
- package/src/core/adapter.ts +102 -1
- package/src/core/adapters/attestation.ts +3 -2
- package/src/core/adapters/profiles.ts +63 -1
- package/src/core/adapters/registry.ts +37 -0
- package/src/core/adapters/types.ts +10 -0
- package/src/core/agents/canonical-emit.ts +2 -5
- package/src/core/agents/cli.ts +26 -17
- package/src/core/agents/coord-client.ts +9 -3
- package/src/core/agents/render/session-context.ts +1 -0
- package/src/core/agents/rules/claim-conflict.ts +3 -8
- package/src/core/agents/rules/commit-conflict.ts +2 -7
- package/src/core/agents/rules/stop-hook.ts +3 -1
- package/src/core/agents/session-events.ts +120 -26
- package/src/core/agents/session-finalization-state-v3.ts +2 -1
- package/src/core/agents/session-finalizer-v3.ts +5 -4
- package/src/core/agents/session-name-display.ts +48 -0
- package/src/core/agents/state/heartbeat-reader.ts +7 -0
- package/src/core/agents/state/heartbeat-writer.ts +24 -2
- package/src/core/agents/state/live-coordination-view.ts +74 -0
- package/src/core/agents/state/live-coordination-writer.ts +3 -0
- package/src/core/agents/state/stale-sweep.ts +2 -9
- package/src/core/agents/turn-changes.ts +97 -0
- package/src/core/artifacts/delivery-card.ts +12 -3
- package/src/core/artifacts/index.ts +701 -47
- package/src/core/config.ts +206 -4
- package/src/core/context/index.ts +2 -1
- package/src/core/conversations/archive.ts +4 -3
- package/src/core/diagnostics/bundle.ts +5 -3
- package/src/core/events/legacy-storage/canary.ts +5 -4
- package/src/core/events/legacy-storage/compression.ts +2 -1
- package/src/core/events/v3/adapter-id.ts +29 -1
- package/src/core/events/v3/authority-outbox.ts +2 -1
- package/src/core/events/v3/bootstrap.ts +5 -4
- package/src/core/events/v3/capabilities.ts +17 -0
- package/src/core/events/v3/contract.ts +9 -1
- package/src/core/events/v3/control-witness.ts +3 -2
- package/src/core/events/v3/coordination-transaction-recovery.ts +4 -3
- package/src/core/events/v3/fingerprint-keys.ts +7 -6
- package/src/core/events/v3/generated.ts +1 -1
- package/src/core/events/v3/live-feed.ts +5 -4
- package/src/core/events/v3/producers/command-recorder.ts +8 -6
- package/src/core/events/v3/producers/coordination-recorder.ts +8 -7
- package/src/core/events/v3/producers/diagnostic-summaries.ts +5 -4
- package/src/core/events/v3/producers/hook-base.ts +11 -4
- package/src/core/events/v3/producers/hook.ts +19 -1
- package/src/core/events/v3/producers/intake.ts +18 -6
- package/src/core/events/v3/producers/recorder.ts +139 -114
- package/src/core/events/v3/projection.ts +11 -1
- package/src/core/events/v3/recovery.ts +4 -3
- package/src/core/events/v3/support-storage/inventory.ts +2 -1
- package/src/core/events/v3/support-storage/maintenance.ts +8 -3
- package/src/core/events/v3/support-storage/pack-reader.ts +4 -3
- package/src/core/events/v3/support-storage/pack-writer.ts +6 -5
- package/src/core/events/v3/tool-line-changes.ts +139 -0
- package/src/core/events/v3/writer.ts +8 -7
- package/src/core/governor/planning.ts +6 -5
- package/src/core/governor/service.ts +12 -11
- package/src/core/governor/state.ts +7 -6
- package/src/core/guard/evaluator.ts +1 -0
- package/src/core/guard/storage.ts +3 -2
- package/src/core/hooks/adapter/behaviors/claude-code.ts +33 -0
- package/src/core/hooks/adapter/behaviors/codex.ts +96 -0
- package/src/core/hooks/adapter/behaviors/cursor.ts +37 -0
- package/src/core/hooks/adapter/behaviors/index.ts +31 -0
- package/src/core/hooks/adapter/behaviors/openclaw.ts +36 -0
- package/src/core/hooks/adapter/behaviors/opencode.ts +36 -0
- package/src/core/hooks/adapter/behaviors/types.ts +110 -0
- package/src/core/hooks/adapter/detect.ts +2 -3
- package/src/core/hooks/adapter/events.ts +72 -1
- package/src/core/hooks/adapter/opencode-plugin.ts +177 -0
- package/src/core/hooks/adapter/output.ts +8 -1
- package/src/core/hooks/adapter/runtime-telemetry.ts +3 -1
- package/src/core/hooks/adapter/wiring.ts +198 -16
- package/src/core/hooks/cli.ts +776 -539
- package/src/core/hooks/effects/image-capture.ts +2 -1
- package/src/core/hooks/prompt-context/contract.ts +1 -0
- package/src/core/hooks/resolve/transcript.ts +42 -5
- package/src/core/hooks/run-markers.ts +132 -0
- package/src/core/hooks/session-name-presence.ts +10 -3
- package/src/core/hooks/shell-waiter.ts +166 -0
- package/src/core/resources/service.ts +5 -4
- package/src/core/semantic/review.ts +5 -4
- package/src/core/semantic/service.ts +15 -14
- package/src/core/semantic/storage.ts +5 -4
- package/src/core/servers/index.ts +712 -0
- package/src/core/servers/net.ts +283 -0
- package/src/core/servers/tunnels.ts +39 -0
- package/src/core/storage/atomic-json.ts +7 -3
- package/src/core/storage/builtins.ts +1 -0
- package/src/core/storage/durable-history.ts +6 -5
- package/src/core/storage/maintenance-providers.ts +2 -1
- package/src/core/storage/maintenance.ts +7 -6
- package/src/core/storage/metrics.ts +5 -1
- package/src/core/storage/modes.ts +53 -0
- package/src/core/storage/process-log.ts +3 -2
- package/src/core/storage/receipts.ts +4 -3
- package/src/core/storage/segments.ts +7 -6
- package/src/core/supervisor/hook-health.ts +4 -4
- package/src/core/supervisor/service.ts +7 -6
- package/src/core/work/state.ts +8 -7
- package/src/core/workflow/adapters.ts +15 -0
- package/src/core/workflow/approvals.ts +6 -5
- package/src/core/workflow/billing.ts +34 -4
- package/src/core/workflow/durable-record.ts +4 -3
- package/src/core/workflow/engine.ts +38 -1
- package/src/core/workflow/live-session-v3.ts +2 -3
- package/src/core/workflow/run-state.ts +3 -2
- package/src/core/workflow/sandbox-projection.ts +38 -2
- package/src/core/workflow/spawn-claude.ts +5 -1
- package/src/core/workflow/spawn-codex.ts +18 -1
- package/src/core/workflow/spawn-cursor.ts +5 -1
- package/src/core/workflow/spawn-opencode.ts +153 -0
- package/src/core/workflow/transcript.ts +3 -2
- package/src/core/workflow/types.ts +62 -2
- package/src/core/workflow/worker-access.ts +525 -0
- package/src/core/workflow/workspaces/leases.ts +5 -4
- package/src/core/workflow/workspaces/local-git.ts +3 -2
- package/src/core/workflow/workspaces/paths.ts +2 -1
- package/src/core/workflow/workspaces/state.ts +10 -9
- package/src/lazy-commands.ts +11 -1
- package/src/lib/agent-browser/client.ts +18 -0
- package/src/lib/browser/batch-steps.ts +79 -0
- package/src/lib/browser/client.ts +147 -9
- package/src/lib/browser/collect/collector.ts +306 -0
- package/src/lib/browser/collect/fields.ts +87 -0
- package/src/lib/browser/collect/index.ts +47 -0
- package/src/lib/browser/collect/page-driver.ts +327 -0
- package/src/lib/browser/collect/presets.ts +237 -0
- package/src/lib/browser/collect/scroll-plan.ts +179 -0
- package/src/lib/browser/identity.ts +64 -0
- package/src/lib/browser/index.ts +16 -1
- package/src/lib/browser/launch-args.ts +53 -1
- package/src/lib/browser/page-review-judge.ts +16 -0
- package/src/lib/browser/qa-run-contracts.ts +11 -0
- package/src/lib/browser/qa-run.ts +1 -0
- package/src/lib/browser/user-agent.ts +130 -0
- package/src/lib/browser/windows-chrome.ts +227 -0
- package/src/lib/claude-desktop-share.ts +511 -0
- package/src/lib/disk-usage.ts +347 -0
- package/src/lib/docs-lint.ts +8 -3
- package/src/lib/docs-metadata-managed.ts +21 -0
- package/src/lib/guarded-remove.ts +376 -0
- package/src/lib/identities/assume.ts +7 -7
- package/src/lib/instructions/apply.ts +2 -0
- package/src/lib/instructions/templates.ts +8 -8
- package/src/lib/pace/index.ts +14 -0
- package/src/lib/pace/pace.ts +370 -0
- package/src/lib/tunnel/error-page.ts +25 -9
- package/src/lib/tunnel/forward-headers.ts +16 -0
- package/src/lib/tunnel/gate.ts +39 -10
- package/src/lib/tunnel/path-scope.ts +73 -0
- package/src/lib/tunnel/state.ts +20 -3
- package/src/lib/webview/index.ts +13 -0
- package/src/lib/webview/webview.ts +457 -0
|
@@ -9,8 +9,17 @@ export interface SessionNameDisplayState {
|
|
|
9
9
|
suggested_session_name?: string;
|
|
10
10
|
session_name_seen_for?: string;
|
|
11
11
|
session_name_display_requested_for?: string;
|
|
12
|
+
session_name_display_reminders?: number;
|
|
12
13
|
}
|
|
13
14
|
|
|
15
|
+
/**
|
|
16
|
+
* How many times PostToolUse may re-attach the display instruction after the
|
|
17
|
+
* mint-time one, per requested title. Two covers the observed miss (the model
|
|
18
|
+
* narrates, calls a tool, and forgets) without turning an unreadable
|
|
19
|
+
* transcript into a reminder on every tool for the rest of the session.
|
|
20
|
+
*/
|
|
21
|
+
export const SESSION_NAME_DISPLAY_REMINDER_LIMIT = 2;
|
|
22
|
+
|
|
14
23
|
export const SESSION_NAME_DISPLAY_NOTE =
|
|
15
24
|
"Next, before any prose or another tool call, send suggested_session_name verbatim by itself in a fenced code block.";
|
|
16
25
|
|
|
@@ -76,6 +85,45 @@ export function sessionNameDisplayInstruction(name: string): string {
|
|
|
76
85
|
].join("\n");
|
|
77
86
|
}
|
|
78
87
|
|
|
88
|
+
/**
|
|
89
|
+
* Whether an ordinary tool result should carry a bounded reminder.
|
|
90
|
+
*
|
|
91
|
+
* Only after the mint-time instruction has gone out (`requested_for` is set
|
|
92
|
+
* for the pending title), and only while the counter is under the cap. The
|
|
93
|
+
* transcript is deliberately not consulted: PreToolUse already stamped a
|
|
94
|
+
* readable sighting, and an unreadable one is exactly the case the reminder
|
|
95
|
+
* exists for.
|
|
96
|
+
*/
|
|
97
|
+
export function sessionNameDisplayReminderDue(
|
|
98
|
+
row: SessionNameDisplayState | null | undefined,
|
|
99
|
+
): string | null {
|
|
100
|
+
const pending = sessionNameDisplayPending(row);
|
|
101
|
+
if (!pending || row?.session_name_display_requested_for !== pending) return null;
|
|
102
|
+
return (row.session_name_display_reminders ?? 0) < SESSION_NAME_DISPLAY_REMINDER_LIMIT
|
|
103
|
+
? pending
|
|
104
|
+
: null;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* The follow-up nudge for a title still pending after an ordinary tool.
|
|
109
|
+
*
|
|
110
|
+
* Worded so the model can answer it from its own memory: the desktop transcript
|
|
111
|
+
* sometimes drops a text row that the operator did see, so Harnery cannot tell
|
|
112
|
+
* a skipped block from an unrecorded one. A model that already showed the block
|
|
113
|
+
* is told to do nothing, which is what keeps the reminder from producing
|
|
114
|
+
* duplicate blocks in the chat.
|
|
115
|
+
*/
|
|
116
|
+
export function sessionNameDisplayReminder(name: string): string {
|
|
117
|
+
return [
|
|
118
|
+
"Session name still pending.",
|
|
119
|
+
"If you have not already shown it this turn, send this exact fenced block as your next assistant text, before any prose or another tool call:",
|
|
120
|
+
"",
|
|
121
|
+
sessionNameDisplayBlock(name),
|
|
122
|
+
"",
|
|
123
|
+
"If you already showed that block, do nothing; Harnery could not read the transcript row and is asking once more.",
|
|
124
|
+
].join("\n");
|
|
125
|
+
}
|
|
126
|
+
|
|
79
127
|
export function sessionNameDisplayRecoveryInstruction(name: string, binName: string): string {
|
|
80
128
|
return [
|
|
81
129
|
sessionNameDisplayInstruction(name),
|
|
@@ -40,6 +40,13 @@ export interface Heartbeat {
|
|
|
40
40
|
* counts so that drift cannot strand the latch.
|
|
41
41
|
*/
|
|
42
42
|
session_name_display_requested_for?: string;
|
|
43
|
+
/**
|
|
44
|
+
* How many bounded PostToolUse reminders have gone out for
|
|
45
|
+
* `session_name_display_requested_for`. Reset whenever a different title is
|
|
46
|
+
* requested. Caps the nudge so an unreadable transcript never turns into an
|
|
47
|
+
* endless stream of "show the block" context.
|
|
48
|
+
*/
|
|
49
|
+
session_name_display_reminders?: number;
|
|
43
50
|
last_status_at?: string;
|
|
44
51
|
current_turn_id?: string;
|
|
45
52
|
parent_instance_id?: string;
|
|
@@ -194,12 +194,34 @@ export function stampSessionNameRequested(
|
|
|
194
194
|
coordRoot: string,
|
|
195
195
|
instanceId: string,
|
|
196
196
|
name: string,
|
|
197
|
+
): Heartbeat | null {
|
|
198
|
+
if (!name) return null;
|
|
199
|
+
return mutate(coordRoot, instanceId, (hb) => {
|
|
200
|
+
if (hb.session_name_display_requested_for === name) return hb;
|
|
201
|
+
const { session_name_display_reminders: _reset, ...rest } = hb;
|
|
202
|
+
return { ...rest, session_name_display_requested_for: name };
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Count one bounded PostToolUse reminder for the title currently requested.
|
|
208
|
+
*
|
|
209
|
+
* The mint-time instruction is the only thing that used to make the block
|
|
210
|
+
* appear; a model that went straight to another tool was never asked again,
|
|
211
|
+
* because the fail-open gate writes its reason to stderr, which the model
|
|
212
|
+
* cannot read. The counter lets the hook re-attach the instruction a fixed
|
|
213
|
+
* number of times and then stop, whatever the transcript can or cannot prove.
|
|
214
|
+
*/
|
|
215
|
+
export function stampSessionNameReminded(
|
|
216
|
+
coordRoot: string,
|
|
217
|
+
instanceId: string,
|
|
218
|
+
name: string,
|
|
197
219
|
): Heartbeat | null {
|
|
198
220
|
if (!name) return null;
|
|
199
221
|
return mutate(coordRoot, instanceId, (hb) =>
|
|
200
222
|
hb.session_name_display_requested_for === name
|
|
201
|
-
? hb
|
|
202
|
-
:
|
|
223
|
+
? { ...hb, session_name_display_reminders: (hb.session_name_display_reminders ?? 0) + 1 }
|
|
224
|
+
: hb,
|
|
203
225
|
);
|
|
204
226
|
}
|
|
205
227
|
|
|
@@ -198,6 +198,7 @@ export function projectHeartbeatV3(
|
|
|
198
198
|
session_name_seen_at: cache?.session_name_seen_at,
|
|
199
199
|
session_name_seen_for: cache?.session_name_seen_for,
|
|
200
200
|
session_name_display_requested_for: cache?.session_name_display_requested_for,
|
|
201
|
+
session_name_display_reminders: cache?.session_name_display_reminders,
|
|
201
202
|
workflow_run_id: generation.run_id,
|
|
202
203
|
workflow_agent_id: generation.workflow_agent_id,
|
|
203
204
|
parent_instance_id: parent ? nativeInstanceIdV3(parent.instance_id) : undefined,
|
|
@@ -225,3 +226,76 @@ function observedModel(generation: CoordinationGenerationViewV3): string | undef
|
|
|
225
226
|
function isLifecycleState(value: string | undefined): value is "active" | "blocked" | "done" {
|
|
226
227
|
return value === "active" || value === "blocked" || value === "done";
|
|
227
228
|
}
|
|
229
|
+
|
|
230
|
+
/** Why a still-live V3 generation has lost coordination authority. */
|
|
231
|
+
export interface LiveAuthorityBlockV3 {
|
|
232
|
+
generation_id: string;
|
|
233
|
+
scope: "generation" | "ledger";
|
|
234
|
+
diagnostics: { code: string; event_id?: string }[];
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Explain an authority refusal for a generation that is still live. Callers
|
|
239
|
+
* reach this after a lookup came back empty; without it the caller sees only
|
|
240
|
+
* "missing", which reads like an ended session and points at a reopen that
|
|
241
|
+
* cannot apply. Returns null when no live generation exists or nothing blocks.
|
|
242
|
+
*/
|
|
243
|
+
export function liveAuthorityBlockV3(
|
|
244
|
+
coordRoot: string,
|
|
245
|
+
nativeInstanceId: string,
|
|
246
|
+
): LiveAuthorityBlockV3 | null {
|
|
247
|
+
let view: CoordinationViewV3;
|
|
248
|
+
try {
|
|
249
|
+
if (observeLiveEventLedgerRouteV3(coordRoot).state === "blocked") return null;
|
|
250
|
+
view = readCoordinationViewV3(coordRoot);
|
|
251
|
+
} catch {
|
|
252
|
+
return null;
|
|
253
|
+
}
|
|
254
|
+
const generation = view.instances[liveInstanceIdV3(nativeInstanceId)];
|
|
255
|
+
if (generation?.phase !== "live" || generation.authority_eligible) return null;
|
|
256
|
+
const own = (view.diagnostics_by_generation[generation.generation_id] ?? []).filter(
|
|
257
|
+
(diagnostic) => diagnostic.authority_blocking,
|
|
258
|
+
);
|
|
259
|
+
const blocking = own.length
|
|
260
|
+
? own
|
|
261
|
+
: view.global_diagnostics.filter((diagnostic) => diagnostic.authority_blocking);
|
|
262
|
+
if (!blocking.length) return null;
|
|
263
|
+
return {
|
|
264
|
+
generation_id: generation.generation_id,
|
|
265
|
+
scope: own.length ? "generation" : "ledger",
|
|
266
|
+
diagnostics: blocking.map((diagnostic) => ({
|
|
267
|
+
code: diagnostic.source_code
|
|
268
|
+
? `${diagnostic.code}:${diagnostic.source_code}`
|
|
269
|
+
: diagnostic.code,
|
|
270
|
+
...(diagnostic.event_id ? { event_id: diagnostic.event_id } : {}),
|
|
271
|
+
})),
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/** One-line description of a live authority block, naming codes and events. */
|
|
276
|
+
export function describeLiveAuthorityBlockV3(block: LiveAuthorityBlockV3): string {
|
|
277
|
+
const byCode = new Map<string, string[]>();
|
|
278
|
+
for (const { code, event_id } of block.diagnostics) {
|
|
279
|
+
const events = byCode.get(code) ?? [];
|
|
280
|
+
if (event_id) events.push(event_id);
|
|
281
|
+
byCode.set(code, events);
|
|
282
|
+
}
|
|
283
|
+
const parts = [...byCode].map(([code, events]) => {
|
|
284
|
+
const shown = events.slice(0, 2).join(", ");
|
|
285
|
+
const more = events.length > 2 ? `, +${events.length - 2} more` : "";
|
|
286
|
+
return events.length ? `${code} ×${events.length} (${shown}${more})` : code;
|
|
287
|
+
});
|
|
288
|
+
const where =
|
|
289
|
+
block.scope === "generation"
|
|
290
|
+
? `the event ledger holds ${block.diagnostics.length} authority-blocking diagnostic(s) for it`
|
|
291
|
+
: "the event ledger holds authority-blocking diagnostics that block every generation";
|
|
292
|
+
return `generation ${block.generation_id} is still live, but ${where}: ${parts.join("; ")}`;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/** Recovery pointer for a live authority block, in place of the reopen hint. */
|
|
296
|
+
export function liveAuthorityBlockHintV3(binName: string): string {
|
|
297
|
+
return (
|
|
298
|
+
`\`${binName} agents lifecycle active\` cannot help because it only reopens an ended ` +
|
|
299
|
+
`generation; \`${binName} agents health\` lists the diagnostics`
|
|
300
|
+
);
|
|
301
|
+
}
|
|
@@ -112,6 +112,9 @@ function materializeLiveCoordinationHeartbeat(
|
|
|
112
112
|
session_name_display_requested_for: current.session_name_display_requested_for,
|
|
113
113
|
}
|
|
114
114
|
: {}),
|
|
115
|
+
...(typeof current.session_name_display_reminders === "number"
|
|
116
|
+
? { session_name_display_reminders: current.session_name_display_reminders }
|
|
117
|
+
: {}),
|
|
115
118
|
}
|
|
116
119
|
: {};
|
|
117
120
|
const materialized: V3HeartbeatMaterialization = {
|
|
@@ -13,18 +13,11 @@
|
|
|
13
13
|
import { existsSync, readdirSync, readFileSync, statSync, unlinkSync } from "node:fs";
|
|
14
14
|
import { join } from "node:path";
|
|
15
15
|
import { coordFreshnessSeconds } from "../../config.ts";
|
|
16
|
-
import type
|
|
16
|
+
import { type EventAdapterIdV3, eventAdapterIdV3FromPlatform } from "../../events/v3/adapter-id.ts";
|
|
17
17
|
import { writeProducerDiagnosticV3 } from "../../events/v3/producers/intake.ts";
|
|
18
18
|
import { recordLiveSweepObservationV3 } from "../live-lifecycle-v3.ts";
|
|
19
19
|
|
|
20
20
|
/** platform → adapter, for the swept-event envelope (mirrors heartbeat-writer's adapterOf). */
|
|
21
|
-
function adapterFromPlatform(platform: unknown): EventAdapterIdV3 {
|
|
22
|
-
if (platform === "cursor") return "cursor";
|
|
23
|
-
if (platform === "codex") return "codex";
|
|
24
|
-
if (platform === "openclaw") return "openclaw";
|
|
25
|
-
return "claude-code";
|
|
26
|
-
}
|
|
27
|
-
|
|
28
21
|
/**
|
|
29
22
|
* Record the sweep before deleting disposable cache state.
|
|
30
23
|
*
|
|
@@ -150,7 +143,7 @@ export function staleSweep(coordRoot: string): {
|
|
|
150
143
|
}
|
|
151
144
|
|
|
152
145
|
const instanceId = parsed.instance_id ?? idFromFile;
|
|
153
|
-
const adapter =
|
|
146
|
+
const adapter = eventAdapterIdV3FromPlatform(parsed.platform, { context: "stale-sweep" });
|
|
154
147
|
const sessionId = parsed.session_id ?? instanceId;
|
|
155
148
|
const ts = parsed.last_heartbeat
|
|
156
149
|
? Math.floor(Date.parse(parsed.last_heartbeat) / 1000)
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { EventV3 } from "../events/v3/contract.ts";
|
|
2
|
+
import { liveInstanceIdV3 } from "../events/v3/live-routing.ts";
|
|
3
|
+
import { readLedgerV3 } from "../events/v3/reader.ts";
|
|
4
|
+
import type { LineChanges } from "../events/v3/tool-line-changes.ts";
|
|
5
|
+
|
|
6
|
+
export interface TurnChanges extends LineChanges {
|
|
7
|
+
measured_tools: number;
|
|
8
|
+
unmeasured_tools: number;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** Sum edit activity, not a net workspace diff. Commits cannot erase it. */
|
|
12
|
+
export function resolveTurnChanges(
|
|
13
|
+
events: readonly EventV3[],
|
|
14
|
+
instanceId: string,
|
|
15
|
+
now = Date.now(),
|
|
16
|
+
): TurnChanges | null {
|
|
17
|
+
const owner = liveInstanceIdV3(instanceId);
|
|
18
|
+
const own = events.filter(
|
|
19
|
+
(event) => event.scope.instance_id === owner && Date.parse(event.time.observed_at) <= now,
|
|
20
|
+
);
|
|
21
|
+
const starts = own.filter((event) => event.event_type === "turn.started");
|
|
22
|
+
const newest = starts.at(-1);
|
|
23
|
+
if (!newest || !("generation_id" in newest.scope)) return null;
|
|
24
|
+
const generation = newest.scope.generation_id;
|
|
25
|
+
let index = starts.length - 1;
|
|
26
|
+
let restarts = 0;
|
|
27
|
+
while (
|
|
28
|
+
index > 0 &&
|
|
29
|
+
restarts < 8 &&
|
|
30
|
+
starts[index]?.event_type === "turn.started" &&
|
|
31
|
+
starts[index]?.payload.stop_remediation === true
|
|
32
|
+
) {
|
|
33
|
+
const previous = starts[index - 1]!;
|
|
34
|
+
if (!("generation_id" in previous.scope) || previous.scope.generation_id !== generation) break;
|
|
35
|
+
index--;
|
|
36
|
+
restarts++;
|
|
37
|
+
}
|
|
38
|
+
const selected = starts.slice(index);
|
|
39
|
+
const ids = new Set(
|
|
40
|
+
selected.map((event) => ("turn_id" in event.scope ? event.scope.turn_id : undefined)),
|
|
41
|
+
);
|
|
42
|
+
const from = Date.parse(selected[0]!.time.observed_at);
|
|
43
|
+
const tools = own.filter(
|
|
44
|
+
(event) =>
|
|
45
|
+
"generation_id" in event.scope &&
|
|
46
|
+
event.scope.generation_id === generation &&
|
|
47
|
+
"turn_id" in event.scope &&
|
|
48
|
+
ids.has(event.scope.turn_id) &&
|
|
49
|
+
Date.parse(event.time.observed_at) >= from,
|
|
50
|
+
);
|
|
51
|
+
const result: TurnChanges = { added: 0, removed: 0, measured_tools: 0, unmeasured_tools: 0 };
|
|
52
|
+
const completed = new Set<string>();
|
|
53
|
+
for (const event of tools) {
|
|
54
|
+
if (event.event_type !== "tool.completed") continue;
|
|
55
|
+
const span = event.payload.span.span_id;
|
|
56
|
+
if (completed.has(span)) continue;
|
|
57
|
+
completed.add(span);
|
|
58
|
+
const changes = event.payload.line_changes;
|
|
59
|
+
if (event.payload.outcome === "succeeded" && changes?.state === "observed") {
|
|
60
|
+
result.added += changes.value.added;
|
|
61
|
+
result.removed += changes.value.removed;
|
|
62
|
+
result.measured_tools++;
|
|
63
|
+
} else result.unmeasured_tools++;
|
|
64
|
+
}
|
|
65
|
+
for (const event of tools) {
|
|
66
|
+
const span = (event.links as { span_id?: string }).span_id;
|
|
67
|
+
if (event.event_type === "tool.requested" && span && !completed.has(span)) {
|
|
68
|
+
completed.add(span);
|
|
69
|
+
result.unmeasured_tools++;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
// No delivered tool evidence cannot prove no file changes occurred.
|
|
73
|
+
return result.measured_tools + result.unmeasured_tools > 0 ? result : null;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function formatTurnChanges(changes: TurnChanges | null): string {
|
|
77
|
+
if (!changes || changes.measured_tools === 0) return "unavailable (no measured edits)";
|
|
78
|
+
return `+${changes.added} / -${changes.removed} lines${changes.unmeasured_tools > 0 ? " (partial; unmeasured tools)" : " (recorded edits)"}`;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function turnChangesStatusRow(target: { coordRoot: string; instanceId: string }): {
|
|
82
|
+
value: string;
|
|
83
|
+
changes: TurnChanges | null;
|
|
84
|
+
} {
|
|
85
|
+
let changes: TurnChanges | null = null;
|
|
86
|
+
try {
|
|
87
|
+
const ledger = readLedgerV3(target.coordRoot);
|
|
88
|
+
if (ledger.complete)
|
|
89
|
+
changes = resolveTurnChanges(
|
|
90
|
+
ledger.events.map((item) => item.event),
|
|
91
|
+
target.instanceId,
|
|
92
|
+
);
|
|
93
|
+
} catch {
|
|
94
|
+
/* Status remains available when evidence is missing. */
|
|
95
|
+
}
|
|
96
|
+
return { value: formatTurnChanges(changes), changes };
|
|
97
|
+
}
|
|
@@ -12,8 +12,9 @@ import {
|
|
|
12
12
|
} from "node:fs";
|
|
13
13
|
import { isAbsolute, relative, resolve, sep } from "node:path";
|
|
14
14
|
import { encodeLinkSafeComponent } from "../../lib/local-file-url.ts";
|
|
15
|
-
import { findLiveTunnelForOrigin } from "../../lib/tunnel/state.ts";
|
|
15
|
+
import { findLiveTunnelForOrigin, tunnelServesPaths } from "../../lib/tunnel/state.ts";
|
|
16
16
|
import { resolveWebPort } from "../config.ts";
|
|
17
|
+
import { stateFileMode } from "../storage/modes.ts";
|
|
17
18
|
import { ARTIFACT_MANIFEST } from "./constants.ts";
|
|
18
19
|
import { resolveArtifactRef, showArtifact } from "./index.ts";
|
|
19
20
|
|
|
@@ -71,7 +72,7 @@ export function writeArtifactDeliveryManifest(
|
|
|
71
72
|
try {
|
|
72
73
|
writeFileSync(tmp, `${JSON.stringify(manifest, null, 2)}\n`, {
|
|
73
74
|
encoding: "utf8",
|
|
74
|
-
mode:
|
|
75
|
+
mode: stateFileMode(),
|
|
75
76
|
flag: "wx",
|
|
76
77
|
});
|
|
77
78
|
renameSync(tmp, target);
|
|
@@ -325,9 +326,17 @@ function deliveryLinkBase(repoRoot: string, environment: DisplayEnvironment): st
|
|
|
325
326
|
// dashboard's own origin will answer them. A tunnel sharing this upstream
|
|
326
327
|
// port under another Host serves a different site and would 400 on /browse
|
|
327
328
|
// and /files, so fall back to the local URL rather than publish that host.
|
|
329
|
+
// The same holds for a dashboard tunnel whose path scope leaves out either
|
|
330
|
+
// route: its gate would refuse every link on the card.
|
|
331
|
+
const tunnel =
|
|
332
|
+
environment.tunnelUrl === undefined
|
|
333
|
+
? findLiveTunnelForOrigin(webPort, `localhost:${webPort}`, repoRoot)
|
|
334
|
+
: null;
|
|
328
335
|
const tunnelUrl =
|
|
329
336
|
environment.tunnelUrl === undefined
|
|
330
|
-
?
|
|
337
|
+
? tunnel && tunnelServesPaths(tunnel, ["/browse", "/files"])
|
|
338
|
+
? tunnel.url
|
|
339
|
+
: undefined
|
|
331
340
|
: environment.tunnelUrl;
|
|
332
341
|
return (tunnelUrl ?? `http://localhost:${webPort}`).replace(/\/+$/, "");
|
|
333
342
|
}
|