harnery 0.40.0 → 0.41.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 +1 -0
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +25 -19
- package/dist/commands/browse-ai.d.ts.map +1 -1
- package/dist/commands/browse-ai.js +4 -0
- package/dist/commands/browse.d.ts.map +1 -1
- package/dist/commands/browse.js +141 -10
- package/dist/commands/checkpoint.js +8 -12
- 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/docs.d.ts.map +1 -1
- package/dist/commands/docs.js +2 -0
- package/dist/commands/doctor.js +10 -2
- package/dist/commands/fetch.d.ts.map +1 -1
- package/dist/commands/fetch.js +10 -0
- package/dist/commands/init.d.ts +19 -3
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +232 -104
- 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/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 +20 -3
- package/dist/core/adapters/profiles.d.ts.map +1 -1
- package/dist/core/adapters/profiles.js +32 -1
- package/dist/core/adapters/registry.d.ts.map +1 -1
- package/dist/core/adapters/registry.js +33 -0
- 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 +18 -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/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.map +1 -1
- package/dist/core/agents/state/live-coordination-view.js +1 -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 +2 -1
- package/dist/core/artifacts/index.d.ts.map +1 -1
- package/dist/core/artifacts/index.js +4 -3
- package/dist/core/config.d.ts +5 -0
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +14 -0
- 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 +3 -2
- 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 +109 -101
- 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 +29 -1
- package/dist/core/hooks/adapter/events.d.ts.map +1 -1
- package/dist/core/hooks/adapter/events.js +31 -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/wiring.d.ts +15 -1
- package/dist/core/hooks/adapter/wiring.d.ts.map +1 -1
- package/dist/core/hooks/adapter/wiring.js +74 -11
- package/dist/core/hooks/cli.js +635 -529
- 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/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/storage/atomic-json.d.ts.map +1 -1
- package/dist/core/storage/atomic-json.js +7 -3
- 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/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/spawn-opencode.d.ts +36 -0
- package/dist/core/workflow/spawn-opencode.d.ts.map +1 -0
- package/dist/core/workflow/spawn-opencode.js +132 -0
- package/dist/core/workflow/transcript.d.ts.map +1 -1
- package/dist/core/workflow/transcript.js +3 -2
- 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/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/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 +2 -1
- 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/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/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/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/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/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 +15 -10
- 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 +11 -4
- package/schemas/config.schema.json +13 -0
- package/schemas/event-v3.schema.json +164 -0
- package/src/commander.ts +7 -0
- package/src/commands/agents.ts +33 -18
- package/src/commands/browse-ai.ts +8 -0
- package/src/commands/browse.ts +189 -10
- package/src/commands/checkpoint.ts +7 -9
- package/src/commands/deinit.ts +9 -4
- package/src/commands/docs.ts +2 -0
- package/src/commands/doctor.ts +11 -2
- package/src/commands/fetch.ts +14 -0
- package/src/commands/init.ts +281 -119
- package/src/commands/instructions.ts +8 -4
- package/src/commands/ledger-v3.ts +2 -1
- 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 +42 -1
- package/src/core/adapters/registry.ts +37 -0
- package/src/core/agents/canonical-emit.ts +2 -5
- package/src/core/agents/cli.ts +18 -17
- package/src/core/agents/coord-client.ts +9 -3
- 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 +1 -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 +2 -1
- package/src/core/artifacts/index.ts +4 -3
- package/src/core/config.ts +23 -0
- package/src/core/context/index.ts +2 -1
- package/src/core/conversations/archive.ts +4 -3
- package/src/core/diagnostics/bundle.ts +3 -2
- 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 +123 -114
- 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 +53 -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/wiring.ts +85 -11
- package/src/core/hooks/cli.ts +733 -537
- 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/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/storage/atomic-json.ts +7 -3
- 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/live-session-v3.ts +2 -3
- package/src/core/workflow/run-state.ts +3 -2
- package/src/core/workflow/spawn-opencode.ts +150 -0
- package/src/core/workflow/transcript.ts +3 -2
- 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/client.ts +147 -9
- package/src/lib/browser/identity.ts +64 -0
- package/src/lib/browser/index.ts +15 -1
- package/src/lib/browser/launch-args.ts +53 -1
- package/src/lib/browser/user-agent.ts +130 -0
- package/src/lib/docs-metadata-managed.ts +21 -0
- package/src/lib/identities/assume.ts +7 -7
- package/src/lib/instructions/apply.ts +2 -0
- package/src/lib/pace/index.ts +14 -0
- package/src/lib/pace/pace.ts +370 -0
- package/src/lib/tunnel/forward-headers.ts +16 -0
- package/src/lib/tunnel/gate.ts +18 -10
- package/src/lib/webview/index.ts +13 -0
- package/src/lib/webview/webview.ts +457 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "harnery",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.41.0",
|
|
4
4
|
"description": "Multi-agent coordination for AI coding agents - Claude Code, Cursor, and Codex.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Ryan Kelly",
|
|
@@ -187,6 +187,11 @@
|
|
|
187
187
|
"types": "./dist/lib/http/index.d.ts",
|
|
188
188
|
"import": "./dist/lib/http/index.js"
|
|
189
189
|
},
|
|
190
|
+
"./lib/pace": {
|
|
191
|
+
"bun": "./src/lib/pace/index.ts",
|
|
192
|
+
"types": "./dist/lib/pace/index.d.ts",
|
|
193
|
+
"import": "./dist/lib/pace/index.js"
|
|
194
|
+
},
|
|
190
195
|
"./lib/machine": {
|
|
191
196
|
"bun": "./src/lib/machine.ts",
|
|
192
197
|
"types": "./dist/lib/machine.d.ts",
|
|
@@ -219,6 +224,8 @@
|
|
|
219
224
|
"src",
|
|
220
225
|
"dist",
|
|
221
226
|
"schemas",
|
|
227
|
+
"opencode-plugin/package.json",
|
|
228
|
+
"opencode-plugin/src/index.ts",
|
|
222
229
|
"README.md",
|
|
223
230
|
"LICENSE",
|
|
224
231
|
"!src/**/*.test.ts",
|
|
@@ -242,13 +249,13 @@
|
|
|
242
249
|
"clean": "rm -rf dist",
|
|
243
250
|
"prepublishOnly": "npm run build",
|
|
244
251
|
"typecheck": "bun x tsc --noEmit",
|
|
245
|
-
"lint": "bun x @biomejs/biome check src openclaw-plugin",
|
|
252
|
+
"lint": "bun x @biomejs/biome check src openclaw-plugin opencode-plugin",
|
|
246
253
|
"check:portability": "bun run scripts/check-portability.ts",
|
|
247
254
|
"check:public-surface": "bun run scripts/check-public-surface.ts",
|
|
248
255
|
"check:layering": "bun run scripts/check-layering.ts",
|
|
249
256
|
"probe:supervisor-budget": "bun run scripts/probe-supervisor-budget.ts",
|
|
250
|
-
"lint:fix": "bun x @biomejs/biome check --write src openclaw-plugin",
|
|
251
|
-
"format": "bun x @biomejs/biome format --write src openclaw-plugin",
|
|
257
|
+
"lint:fix": "bun x @biomejs/biome check --write src openclaw-plugin opencode-plugin",
|
|
258
|
+
"format": "bun x @biomejs/biome format --write src openclaw-plugin opencode-plugin",
|
|
252
259
|
"test": "bun run scripts/test.mjs",
|
|
253
260
|
"test:list": "bun run scripts/test.mjs --list",
|
|
254
261
|
"test:web": "cd web && bun install && bun test",
|
|
@@ -216,6 +216,19 @@
|
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
218
|
},
|
|
219
|
+
"storage": {
|
|
220
|
+
"type": "object",
|
|
221
|
+
"additionalProperties": false,
|
|
222
|
+
"description": "Who can use this project's .harnery/ state. Read from the project file only.",
|
|
223
|
+
"properties": {
|
|
224
|
+
"sharing": {
|
|
225
|
+
"type": "string",
|
|
226
|
+
"enum": ["private", "group"],
|
|
227
|
+
"default": "private",
|
|
228
|
+
"description": "private: state is 0700/0600, owner-only. group: 2770/0660 for several Unix users sharing the project directory's group (the directory must be setgid). Never opens state to other users. Env override: HARNERY_STORAGE_SHARING."
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
},
|
|
219
232
|
"artifacts": {
|
|
220
233
|
"type": "object",
|
|
221
234
|
"additionalProperties": false,
|
|
@@ -23775,6 +23775,170 @@
|
|
|
23775
23775
|
}
|
|
23776
23776
|
}
|
|
23777
23777
|
},
|
|
23778
|
+
"line_changes": {
|
|
23779
|
+
"anyOf": [
|
|
23780
|
+
{
|
|
23781
|
+
"additionalProperties": false,
|
|
23782
|
+
"type": "object",
|
|
23783
|
+
"required": [
|
|
23784
|
+
"state",
|
|
23785
|
+
"value",
|
|
23786
|
+
"attestation",
|
|
23787
|
+
"confidence"
|
|
23788
|
+
],
|
|
23789
|
+
"properties": {
|
|
23790
|
+
"state": {
|
|
23791
|
+
"const": "observed",
|
|
23792
|
+
"type": "string"
|
|
23793
|
+
},
|
|
23794
|
+
"value": {
|
|
23795
|
+
"additionalProperties": false,
|
|
23796
|
+
"type": "object",
|
|
23797
|
+
"required": [
|
|
23798
|
+
"added",
|
|
23799
|
+
"removed"
|
|
23800
|
+
],
|
|
23801
|
+
"properties": {
|
|
23802
|
+
"added": {
|
|
23803
|
+
"minimum": 0,
|
|
23804
|
+
"type": "integer"
|
|
23805
|
+
},
|
|
23806
|
+
"removed": {
|
|
23807
|
+
"minimum": 0,
|
|
23808
|
+
"type": "integer"
|
|
23809
|
+
}
|
|
23810
|
+
}
|
|
23811
|
+
},
|
|
23812
|
+
"attestation": {
|
|
23813
|
+
"anyOf": [
|
|
23814
|
+
{
|
|
23815
|
+
"const": "native",
|
|
23816
|
+
"type": "string"
|
|
23817
|
+
},
|
|
23818
|
+
{
|
|
23819
|
+
"const": "derived",
|
|
23820
|
+
"type": "string"
|
|
23821
|
+
},
|
|
23822
|
+
{
|
|
23823
|
+
"const": "inferred",
|
|
23824
|
+
"type": "string"
|
|
23825
|
+
}
|
|
23826
|
+
]
|
|
23827
|
+
},
|
|
23828
|
+
"confidence": {
|
|
23829
|
+
"anyOf": [
|
|
23830
|
+
{
|
|
23831
|
+
"const": "exact",
|
|
23832
|
+
"type": "string"
|
|
23833
|
+
},
|
|
23834
|
+
{
|
|
23835
|
+
"const": "high",
|
|
23836
|
+
"type": "string"
|
|
23837
|
+
},
|
|
23838
|
+
{
|
|
23839
|
+
"const": "medium",
|
|
23840
|
+
"type": "string"
|
|
23841
|
+
},
|
|
23842
|
+
{
|
|
23843
|
+
"const": "low",
|
|
23844
|
+
"type": "string"
|
|
23845
|
+
}
|
|
23846
|
+
]
|
|
23847
|
+
}
|
|
23848
|
+
}
|
|
23849
|
+
},
|
|
23850
|
+
{
|
|
23851
|
+
"additionalProperties": false,
|
|
23852
|
+
"type": "object",
|
|
23853
|
+
"required": [
|
|
23854
|
+
"state",
|
|
23855
|
+
"capability"
|
|
23856
|
+
],
|
|
23857
|
+
"properties": {
|
|
23858
|
+
"state": {
|
|
23859
|
+
"const": "unsupported",
|
|
23860
|
+
"type": "string"
|
|
23861
|
+
},
|
|
23862
|
+
"capability": {
|
|
23863
|
+
"pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
|
|
23864
|
+
"type": "string"
|
|
23865
|
+
}
|
|
23866
|
+
}
|
|
23867
|
+
},
|
|
23868
|
+
{
|
|
23869
|
+
"additionalProperties": false,
|
|
23870
|
+
"type": "object",
|
|
23871
|
+
"required": [
|
|
23872
|
+
"state",
|
|
23873
|
+
"capability",
|
|
23874
|
+
"reason"
|
|
23875
|
+
],
|
|
23876
|
+
"properties": {
|
|
23877
|
+
"state": {
|
|
23878
|
+
"const": "expected_but_missing",
|
|
23879
|
+
"type": "string"
|
|
23880
|
+
},
|
|
23881
|
+
"capability": {
|
|
23882
|
+
"pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
|
|
23883
|
+
"type": "string"
|
|
23884
|
+
},
|
|
23885
|
+
"reason": {
|
|
23886
|
+
"pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
|
|
23887
|
+
"type": "string"
|
|
23888
|
+
}
|
|
23889
|
+
}
|
|
23890
|
+
},
|
|
23891
|
+
{
|
|
23892
|
+
"additionalProperties": false,
|
|
23893
|
+
"type": "object",
|
|
23894
|
+
"required": [
|
|
23895
|
+
"state",
|
|
23896
|
+
"reason"
|
|
23897
|
+
],
|
|
23898
|
+
"properties": {
|
|
23899
|
+
"state": {
|
|
23900
|
+
"const": "redacted",
|
|
23901
|
+
"type": "string"
|
|
23902
|
+
},
|
|
23903
|
+
"reason": {
|
|
23904
|
+
"pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
|
|
23905
|
+
"type": "string"
|
|
23906
|
+
}
|
|
23907
|
+
}
|
|
23908
|
+
},
|
|
23909
|
+
{
|
|
23910
|
+
"additionalProperties": false,
|
|
23911
|
+
"type": "object",
|
|
23912
|
+
"required": [
|
|
23913
|
+
"state",
|
|
23914
|
+
"reason"
|
|
23915
|
+
],
|
|
23916
|
+
"properties": {
|
|
23917
|
+
"state": {
|
|
23918
|
+
"const": "unknown",
|
|
23919
|
+
"type": "string"
|
|
23920
|
+
},
|
|
23921
|
+
"reason": {
|
|
23922
|
+
"pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
|
|
23923
|
+
"type": "string"
|
|
23924
|
+
}
|
|
23925
|
+
}
|
|
23926
|
+
},
|
|
23927
|
+
{
|
|
23928
|
+
"additionalProperties": false,
|
|
23929
|
+
"type": "object",
|
|
23930
|
+
"required": [
|
|
23931
|
+
"state"
|
|
23932
|
+
],
|
|
23933
|
+
"properties": {
|
|
23934
|
+
"state": {
|
|
23935
|
+
"const": "not_applicable",
|
|
23936
|
+
"type": "string"
|
|
23937
|
+
}
|
|
23938
|
+
}
|
|
23939
|
+
}
|
|
23940
|
+
]
|
|
23941
|
+
},
|
|
23778
23942
|
"span": {
|
|
23779
23943
|
"additionalProperties": false,
|
|
23780
23944
|
"type": "object",
|
package/src/commander.ts
CHANGED
|
@@ -507,6 +507,13 @@ function harneryCommandBundles({
|
|
|
507
507
|
(await import("./commands/browse-ai.ts")).registerBrowseAiCommand(program, emit, context),
|
|
508
508
|
{ hasOptions: true },
|
|
509
509
|
),
|
|
510
|
+
lazy(
|
|
511
|
+
"webview <url>",
|
|
512
|
+
`Lightweight headless page probe through Bun.WebView (experimental, Bun 1.4+). Fresh ephemeral browser per call; use ${binName} browse for login, cookies, HAR, and QA.`,
|
|
513
|
+
async (program) =>
|
|
514
|
+
(await import("./commands/webview.ts")).registerWebviewCommand(program, emit, binName),
|
|
515
|
+
{ hasOptions: true },
|
|
516
|
+
),
|
|
510
517
|
{
|
|
511
518
|
commands: [
|
|
512
519
|
{
|
package/src/commands/agents.ts
CHANGED
|
@@ -86,13 +86,18 @@ import {
|
|
|
86
86
|
foldSessionState,
|
|
87
87
|
type TaskState,
|
|
88
88
|
} from "../core/agents/state/session-state.ts";
|
|
89
|
+
import { turnChangesStatusRow } from "../core/agents/turn-changes.ts";
|
|
89
90
|
import { turnElapsedStatusRow } from "../core/agents/turn-elapsed.ts";
|
|
90
91
|
import {
|
|
91
92
|
coordFreshnessSeconds,
|
|
92
93
|
resolveBinName,
|
|
93
94
|
sessionFinalizationConfig,
|
|
94
95
|
} from "../core/config.ts";
|
|
95
|
-
import {
|
|
96
|
+
import {
|
|
97
|
+
EVENT_ADAPTER_IDS_V3,
|
|
98
|
+
type EventAdapterIdV3,
|
|
99
|
+
normalizeEventAdapterIdV3,
|
|
100
|
+
} from "../core/events/v3/adapter-id.ts";
|
|
96
101
|
import type { EventTypeV3 } from "../core/events/v3/contract.ts";
|
|
97
102
|
import { readEventV3ControlState } from "../core/events/v3/control.ts";
|
|
98
103
|
import {
|
|
@@ -611,7 +616,7 @@ export function registerAgentsCommand(
|
|
|
611
616
|
.option(
|
|
612
617
|
"--adapter <id>",
|
|
613
618
|
"(--kind cache) adapter used to validate the authoritative V3 generation: " +
|
|
614
|
-
"claude-code | cursor | codex.",
|
|
619
|
+
"claude-code | cursor | codex | opencode.",
|
|
615
620
|
)
|
|
616
621
|
.option(
|
|
617
622
|
"--pid <pid>",
|
|
@@ -1275,7 +1280,7 @@ function runWhoami(opts: { json?: boolean }): void {
|
|
|
1275
1280
|
if (!hb) {
|
|
1276
1281
|
emit.error({
|
|
1277
1282
|
code: "no_live_generation",
|
|
1278
|
-
message: noLiveGenerationMessage(myOwner),
|
|
1283
|
+
message: noLiveGenerationMessage(root, myOwner),
|
|
1279
1284
|
});
|
|
1280
1285
|
process.exit(1);
|
|
1281
1286
|
}
|
|
@@ -1473,9 +1478,19 @@ function normalizeKind(kind: string | undefined | null): string {
|
|
|
1473
1478
|
* This id is actionable: the reader may pass it to cache repair or explicit
|
|
1474
1479
|
* finalization. Abbreviate ids for display elsewhere, never in a diagnostic
|
|
1475
1480
|
* whose purpose is to hand the caller a canonical identity.
|
|
1481
|
+
*
|
|
1482
|
+
* The message also names the recovery. A session whose generation ended while
|
|
1483
|
+
* it sat idle (a stale sweep, or a `done` it has since outlived) still has a
|
|
1484
|
+
* live process, and `agents lifecycle active` is the one command that opens a
|
|
1485
|
+
* fresh generation for it (ADR 0088). Without the pointer every coordination
|
|
1486
|
+
* command refuses in turn and the caller has no way to guess the path back.
|
|
1476
1487
|
*/
|
|
1477
|
-
function noLiveGenerationMessage(owner: string): string {
|
|
1478
|
-
return `resolved owner=${owner} but no authority-safe live V3 generation exists for it`;
|
|
1488
|
+
function noLiveGenerationMessage(root: string, owner: string): string {
|
|
1489
|
+
return `resolved owner=${owner} but no authority-safe live V3 generation exists for it; ${lifecycleReopenHint(root)}`;
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
function lifecycleReopenHint(root: string): string {
|
|
1493
|
+
return `run \`${resolveBinName(root)} agents lifecycle active\` to open a fresh generation for this continuing session`;
|
|
1479
1494
|
}
|
|
1480
1495
|
|
|
1481
1496
|
/**
|
|
@@ -1750,7 +1765,7 @@ function cursorEnvSessionId(): string | null {
|
|
|
1750
1765
|
}
|
|
1751
1766
|
|
|
1752
1767
|
interface CommandSessionBootstrap {
|
|
1753
|
-
adapter:
|
|
1768
|
+
adapter: Adapter;
|
|
1754
1769
|
sessionId: string;
|
|
1755
1770
|
}
|
|
1756
1771
|
|
|
@@ -2009,7 +2024,7 @@ function runLifecycle(rawState: string, opts: { reason?: string; sessionId?: str
|
|
|
2009
2024
|
if (state !== "active") {
|
|
2010
2025
|
emit.error({
|
|
2011
2026
|
code: "no_live_generation",
|
|
2012
|
-
message:
|
|
2027
|
+
message: noLiveGenerationMessage(root, myOwner),
|
|
2013
2028
|
});
|
|
2014
2029
|
process.exitCode = 1;
|
|
2015
2030
|
return;
|
|
@@ -2269,7 +2284,7 @@ function runStatus(opts: {
|
|
|
2269
2284
|
if (!hb) {
|
|
2270
2285
|
emit.error({
|
|
2271
2286
|
code: "no_live_generation",
|
|
2272
|
-
message: noLiveGenerationMessage(myOwner),
|
|
2287
|
+
message: noLiveGenerationMessage(root, myOwner),
|
|
2273
2288
|
});
|
|
2274
2289
|
process.exit(1);
|
|
2275
2290
|
}
|
|
@@ -2421,6 +2436,7 @@ function runStatus(opts: {
|
|
|
2421
2436
|
// one inside the same session. Best-effort by contract — no turn evidence,
|
|
2422
2437
|
// no row.
|
|
2423
2438
|
const turnElapsed = turnElapsedStatusRow({ coordRoot: root, instanceId: hb.instance_id });
|
|
2439
|
+
const turnChanges = turnChangesStatusRow({ coordRoot: root, instanceId: hb.instance_id });
|
|
2424
2440
|
const resources = readResourceStatus(root);
|
|
2425
2441
|
|
|
2426
2442
|
const data = {
|
|
@@ -2430,6 +2446,7 @@ function runStatus(opts: {
|
|
|
2430
2446
|
session_age_secs: ageSecs,
|
|
2431
2447
|
turn_elapsed_secs: turnElapsed ? turnElapsed.elapsed.secs : null,
|
|
2432
2448
|
turn_complete: turnElapsed ? turnElapsed.elapsed.complete : null,
|
|
2449
|
+
turn_changes: turnChanges.changes,
|
|
2433
2450
|
activity: activityOf(hb),
|
|
2434
2451
|
activity_updated_at: hb.activity_updated_at ?? null,
|
|
2435
2452
|
activity_source: hb.activity_source ?? null,
|
|
@@ -2477,6 +2494,7 @@ function runStatus(opts: {
|
|
|
2477
2494
|
const rows: Array<[string, string]> = [
|
|
2478
2495
|
["session", formatAge(ageSecs)],
|
|
2479
2496
|
...(turnElapsed ? ([["turn", turnElapsed.value]] as Array<[string, string]>) : []),
|
|
2497
|
+
["changes", turnChanges.value],
|
|
2480
2498
|
["activity", activityOf(hb)],
|
|
2481
2499
|
["lifecycle", lifecycleLabel(hb)],
|
|
2482
2500
|
["context", ctxStr],
|
|
@@ -2777,11 +2795,7 @@ export function readAgentDiagnosticEventsInWindow(
|
|
|
2777
2795
|
|
|
2778
2796
|
/** Normalize adapter event data into the heartbeat platform value. */
|
|
2779
2797
|
function adapterToPlatform(adapter: string | undefined): string {
|
|
2780
|
-
|
|
2781
|
-
if (adapter === "cursor") return "cursor";
|
|
2782
|
-
if (adapter === "codex") return "codex";
|
|
2783
|
-
if (adapter === "openclaw") return "openclaw";
|
|
2784
|
-
return "unknown";
|
|
2798
|
+
return normalizeEventAdapterIdV3(adapter) ?? "unknown";
|
|
2785
2799
|
}
|
|
2786
2800
|
|
|
2787
2801
|
/** Project a canonical health.* event into the HealEvent shape the aggregators
|
|
@@ -5040,11 +5054,12 @@ function runHeal(opts: {
|
|
|
5040
5054
|
opts.adapter &&
|
|
5041
5055
|
opts.adapter !== "claude-code" &&
|
|
5042
5056
|
opts.adapter !== "cursor" &&
|
|
5043
|
-
opts.adapter !== "codex"
|
|
5057
|
+
opts.adapter !== "codex" &&
|
|
5058
|
+
opts.adapter !== "opencode"
|
|
5044
5059
|
) {
|
|
5045
5060
|
emit.error({
|
|
5046
5061
|
code: "bad_adapter",
|
|
5047
|
-
message: "--adapter must be one of: claude-code, cursor, codex",
|
|
5062
|
+
message: "--adapter must be one of: claude-code, cursor, codex, opencode",
|
|
5048
5063
|
});
|
|
5049
5064
|
process.exit(1);
|
|
5050
5065
|
}
|
|
@@ -5293,7 +5308,7 @@ function cacheHealAuthorityRefusal(
|
|
|
5293
5308
|
root: string,
|
|
5294
5309
|
owner: string,
|
|
5295
5310
|
sessionId: string,
|
|
5296
|
-
adapter:
|
|
5311
|
+
adapter: Adapter,
|
|
5297
5312
|
currentRow: LiveCoordinationRow | null,
|
|
5298
5313
|
): HealAuthorityRefusal | null {
|
|
5299
5314
|
if (currentRow && normalizeAdapter(currentRow.platform) !== adapter) {
|
|
@@ -5314,7 +5329,7 @@ function cacheHealAuthorityRefusal(
|
|
|
5314
5329
|
if (producer?.terminal) {
|
|
5315
5330
|
return {
|
|
5316
5331
|
reason: "terminal_generation",
|
|
5317
|
-
message:
|
|
5332
|
+
message: `the matching generation is terminal and cannot be repaired or reopened by heal; ${lifecycleReopenHint(root)}`,
|
|
5318
5333
|
};
|
|
5319
5334
|
}
|
|
5320
5335
|
if (producer && producer.instance_id !== liveInstanceIdV3(owner)) {
|
|
@@ -5356,7 +5371,7 @@ function healFailureReason(
|
|
|
5356
5371
|
root: string,
|
|
5357
5372
|
owner: string,
|
|
5358
5373
|
sessionId: string,
|
|
5359
|
-
adapter:
|
|
5374
|
+
adapter: Adapter,
|
|
5360
5375
|
): string {
|
|
5361
5376
|
const refusal = cacheHealAuthorityRefusal(
|
|
5362
5377
|
root,
|
|
@@ -4,6 +4,7 @@ import type { Command } from "commander";
|
|
|
4
4
|
import type { EmitContext, HarneryProgramContext } from "../commander.ts";
|
|
5
5
|
import { AgentBrowser, type ExecResult } from "../lib/agent-browser/index.ts";
|
|
6
6
|
import { applyExtraCookies, CookieJar } from "../lib/cookies/index.ts";
|
|
7
|
+
import { commandPaceGate } from "../lib/pace/index.ts";
|
|
7
8
|
|
|
8
9
|
// Module-scoped emit assigned by registerBrowseAiCommand. Same pattern as
|
|
9
10
|
// cookies/read/browse: helper functions close over `emit` so action
|
|
@@ -46,6 +47,7 @@ interface BrowseAiOpts {
|
|
|
46
47
|
networkHar?: string;
|
|
47
48
|
store?: string;
|
|
48
49
|
cookies?: boolean;
|
|
50
|
+
pace?: boolean;
|
|
49
51
|
json?: boolean;
|
|
50
52
|
timeout: string;
|
|
51
53
|
}
|
|
@@ -85,6 +87,11 @@ export function registerBrowseAiCommand(
|
|
|
85
87
|
)
|
|
86
88
|
.option("--network-har <path>", "Record a HAR file from open() through end of run")
|
|
87
89
|
.option("--no-cookies", "Skip cookie-jar attach and persist")
|
|
90
|
+
.option(
|
|
91
|
+
"--no-pace",
|
|
92
|
+
"Skip the human-pace gap (3 to 9 s) between page loads of the same site for this run. " +
|
|
93
|
+
"HARNERY_PACE=off disables it machine-wide; local and private hosts never wait.",
|
|
94
|
+
)
|
|
88
95
|
.option("--store <path>", `Cookie store path (default ${DEFAULT_STORE})`)
|
|
89
96
|
.option("--json", "Emit a JSON envelope (snapshot, screenshot path, step results)")
|
|
90
97
|
.option("--timeout <ms>", "Per-step timeout in ms", "60000")
|
|
@@ -108,6 +115,7 @@ function runBrowseAi(url: string, opts: BrowseAiOpts, context?: HarneryProgramCo
|
|
|
108
115
|
const ab = new AgentBrowser({
|
|
109
116
|
jar,
|
|
110
117
|
timeoutMs: Number.parseInt(opts.timeout, 10),
|
|
118
|
+
pace: commandPaceGate(opts.pace !== false, (message) => emit.log(message, "info")),
|
|
111
119
|
});
|
|
112
120
|
|
|
113
121
|
const stepLog: { step: string; ok: boolean; output: string }[] = [];
|