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
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { EventAdapterIdV3 } from "../../../events/v3/adapter-id.ts";
|
|
2
|
+
import { claudeCodeBehavior } from "./claude-code.ts";
|
|
3
|
+
import { codexBehavior } from "./codex.ts";
|
|
4
|
+
import { cursorBehavior } from "./cursor.ts";
|
|
5
|
+
import { openclawBehavior } from "./openclaw.ts";
|
|
6
|
+
import { opencodeBehavior } from "./opencode.ts";
|
|
7
|
+
import type { AdapterBehavior } from "./types.ts";
|
|
8
|
+
|
|
9
|
+
export type {
|
|
10
|
+
AdapterBehavior,
|
|
11
|
+
CrossShellInput,
|
|
12
|
+
EffortAttestationSource,
|
|
13
|
+
PromptContextNudges,
|
|
14
|
+
} from "./types.ts";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* One behavior per adapter id. The `Record` type makes a new adapter id a
|
|
18
|
+
* compile error here until its module exists.
|
|
19
|
+
*/
|
|
20
|
+
export const ADAPTER_BEHAVIORS: Record<EventAdapterIdV3, AdapterBehavior> = {
|
|
21
|
+
"claude-code": claudeCodeBehavior,
|
|
22
|
+
cursor: cursorBehavior,
|
|
23
|
+
codex: codexBehavior,
|
|
24
|
+
opencode: opencodeBehavior,
|
|
25
|
+
openclaw: openclawBehavior,
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** The single lookup the hook CLI and the V3 producer use instead of branching. */
|
|
29
|
+
export function adapterBehavior(adapter: EventAdapterIdV3): AdapterBehavior {
|
|
30
|
+
return ADAPTER_BEHAVIORS[adapter];
|
|
31
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { AdapterBehavior } from "./types.ts";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* OpenClaw: event-only. Its plugin bundles the V3 producer and never runs the
|
|
5
|
+
* hook CLI, so every hook-process effect is off and telemetry is native only.
|
|
6
|
+
*/
|
|
7
|
+
export const openclawBehavior: AdapterBehavior = {
|
|
8
|
+
id: "openclaw",
|
|
9
|
+
sessionStartPlatformLabel: undefined,
|
|
10
|
+
soundEffects: false,
|
|
11
|
+
journalMaintenance: false,
|
|
12
|
+
sessionTelemetrySync: false,
|
|
13
|
+
promptPresenceDetection: false,
|
|
14
|
+
promptContextNudges: {
|
|
15
|
+
taskNudge: false,
|
|
16
|
+
hostPromptReminder: false,
|
|
17
|
+
statusFooterNudge: false,
|
|
18
|
+
turnRitualNudge: undefined,
|
|
19
|
+
},
|
|
20
|
+
completedResponseEvent: undefined,
|
|
21
|
+
sessionIdentityOnStartOnly: false,
|
|
22
|
+
nativeTurnIdOptional: false,
|
|
23
|
+
tracksExecutionMode: false,
|
|
24
|
+
shellOperationDedup: false,
|
|
25
|
+
promptMayPrecedeSessionStart: false,
|
|
26
|
+
promptContinuesOpenTurn: false,
|
|
27
|
+
turnRecovery: true,
|
|
28
|
+
nativeTelemetryOnly: true,
|
|
29
|
+
runtimeContextTranscriptOptional: false,
|
|
30
|
+
runtimeContextRetry: false,
|
|
31
|
+
effortAttestation: "none",
|
|
32
|
+
transcriptTuningRefresh: false,
|
|
33
|
+
modelProvider: "openclaw",
|
|
34
|
+
runtimeContextAvailable: () => false,
|
|
35
|
+
bridgeFor: () => undefined,
|
|
36
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { AdapterBehavior } from "./types.ts";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* OpenCode: events arrive through the Harnery plugin bridging to agent-hook.
|
|
5
|
+
* No host-side effects, no exit-code enforcement, no effort dial.
|
|
6
|
+
*/
|
|
7
|
+
export const opencodeBehavior: AdapterBehavior = {
|
|
8
|
+
id: "opencode",
|
|
9
|
+
sessionStartPlatformLabel: "OpenCode",
|
|
10
|
+
soundEffects: false,
|
|
11
|
+
journalMaintenance: false,
|
|
12
|
+
sessionTelemetrySync: false,
|
|
13
|
+
promptPresenceDetection: false,
|
|
14
|
+
promptContextNudges: {
|
|
15
|
+
taskNudge: false,
|
|
16
|
+
hostPromptReminder: false,
|
|
17
|
+
statusFooterNudge: false,
|
|
18
|
+
turnRitualNudge: undefined,
|
|
19
|
+
},
|
|
20
|
+
completedResponseEvent: undefined,
|
|
21
|
+
sessionIdentityOnStartOnly: false,
|
|
22
|
+
nativeTurnIdOptional: false,
|
|
23
|
+
tracksExecutionMode: false,
|
|
24
|
+
shellOperationDedup: false,
|
|
25
|
+
promptMayPrecedeSessionStart: false,
|
|
26
|
+
promptContinuesOpenTurn: false,
|
|
27
|
+
turnRecovery: false,
|
|
28
|
+
nativeTelemetryOnly: false,
|
|
29
|
+
runtimeContextTranscriptOptional: false,
|
|
30
|
+
runtimeContextRetry: false,
|
|
31
|
+
effortAttestation: "none",
|
|
32
|
+
transcriptTuningRefresh: false,
|
|
33
|
+
modelProvider: "opencode",
|
|
34
|
+
runtimeContextAvailable: () => true,
|
|
35
|
+
bridgeFor: () => undefined,
|
|
36
|
+
};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import type { Adapter } from "../../../adapter.ts";
|
|
2
|
+
import type { EventAdapterIdV3 } from "../../../events/v3/adapter-id.ts";
|
|
3
|
+
import type { CodexWslFileLinkTelemetry } from "../../codex-wsl-bridge.ts";
|
|
4
|
+
import type { ParsedPayload } from "../parse.ts";
|
|
5
|
+
import type { RuntimeTelemetryOptions } from "../runtime-telemetry.ts";
|
|
6
|
+
|
|
7
|
+
/** Flags passed to the prompt-context renderer on every user prompt. */
|
|
8
|
+
export interface PromptContextNudges {
|
|
9
|
+
taskNudge: boolean;
|
|
10
|
+
hostPromptReminder: boolean;
|
|
11
|
+
statusFooterNudge: boolean;
|
|
12
|
+
turnRitualNudge: Adapter | undefined;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** Inputs for the cross-shell safety inspection on a tool request. */
|
|
16
|
+
export interface CrossShellInput {
|
|
17
|
+
cwd: unknown;
|
|
18
|
+
toolName: string | undefined;
|
|
19
|
+
toolInput: unknown;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Where a producer learns the effective effort/speed dial from. */
|
|
23
|
+
export type EffortAttestationSource = "payload" | "rollout-probe" | "none";
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Everything the hook CLI and the V3 producer decide per adapter. Each
|
|
27
|
+
* adapter owns one module under this directory; `adapterBehavior(id)` is the
|
|
28
|
+
* only lookup, so the middle of the pipeline never branches on an adapter id.
|
|
29
|
+
*
|
|
30
|
+
* Every field is a decision the shared code used to make with an equality
|
|
31
|
+
* check. Booleans are effect gates, strings are labels, and the optional
|
|
32
|
+
* methods are adapter-native helpers that only exist for that adapter.
|
|
33
|
+
*/
|
|
34
|
+
export interface AdapterBehavior {
|
|
35
|
+
readonly id: EventAdapterIdV3;
|
|
36
|
+
|
|
37
|
+
// ── Session-boundary effects ────────────────────────────────────────────
|
|
38
|
+
/** Label shown in the session-start context; `undefined` means the host default. */
|
|
39
|
+
readonly sessionStartPlatformLabel: string | undefined;
|
|
40
|
+
/** The hook process plays notification sounds (kill-switch independent). */
|
|
41
|
+
readonly soundEffects: boolean;
|
|
42
|
+
/** Journal janitor at start, recovery cue in the start context, archive at end. */
|
|
43
|
+
readonly journalMaintenance: boolean;
|
|
44
|
+
/** Session telemetry sync extension at session end and on stop. */
|
|
45
|
+
readonly sessionTelemetrySync: boolean;
|
|
46
|
+
/** Presence (mobile vs office) is inferred from the submitted prompt text. */
|
|
47
|
+
readonly promptPresenceDetection: boolean;
|
|
48
|
+
readonly promptContextNudges: PromptContextNudges;
|
|
49
|
+
|
|
50
|
+
// ── Turn correlation in the V3 producer ─────────────────────────────────
|
|
51
|
+
/** Hook event that carries the completed assistant reply, when stop lacks it. */
|
|
52
|
+
readonly completedResponseEvent: string | undefined;
|
|
53
|
+
/** Native session identity arrives only on the start signal; later hooks join by instance. */
|
|
54
|
+
readonly sessionIdentityOnStartOnly: boolean;
|
|
55
|
+
/** A terminal or telemetry probe may proceed without a native turn id. */
|
|
56
|
+
readonly nativeTurnIdOptional: boolean;
|
|
57
|
+
/** The producer tracks a native execution mode (local/cloud) in its state. */
|
|
58
|
+
readonly tracksExecutionMode: boolean;
|
|
59
|
+
/** Shell hooks may deliver the same command twice; dedupe by a command fingerprint. */
|
|
60
|
+
readonly shellOperationDedup: boolean;
|
|
61
|
+
/** The native prompt signal can arrive before session start and is a trusted boundary. */
|
|
62
|
+
readonly promptMayPrecedeSessionStart: boolean;
|
|
63
|
+
/** A prompt signal inside an open turn continues that turn instead of starting a new one. */
|
|
64
|
+
readonly promptContinuesOpenTurn: boolean;
|
|
65
|
+
/** Missed hook signals may be recovered into derived turns and spans. */
|
|
66
|
+
readonly turnRecovery: boolean;
|
|
67
|
+
|
|
68
|
+
// ── Runtime telemetry ───────────────────────────────────────────────────
|
|
69
|
+
/** Turn telemetry comes only from the native payload; no runtime transcript read. */
|
|
70
|
+
readonly nativeTelemetryOnly: boolean;
|
|
71
|
+
/** Runtime context telemetry does not require a transcript path. */
|
|
72
|
+
readonly runtimeContextTranscriptOptional: boolean;
|
|
73
|
+
/** Late runtime-context samples are retried after stop (rollout flush lag). */
|
|
74
|
+
readonly runtimeContextRetry: boolean;
|
|
75
|
+
readonly effortAttestation: EffortAttestationSource;
|
|
76
|
+
/** After a payload effort change, refresh speed and model from the transcript row. */
|
|
77
|
+
readonly transcriptTuningRefresh: boolean;
|
|
78
|
+
/** Provider label attached to attested model identity. */
|
|
79
|
+
readonly modelProvider: string;
|
|
80
|
+
/** Whether runtime context can be read at all under the given execution mode. */
|
|
81
|
+
runtimeContextAvailable(executionMode: string | undefined): boolean;
|
|
82
|
+
|
|
83
|
+
// ── Deployment bridge ───────────────────────────────────────────────────
|
|
84
|
+
/** Bridge descriptor stamped on events when the payload cwd shows a bridged deployment. */
|
|
85
|
+
bridgeFor(cwd: unknown): "codex-wsl" | undefined;
|
|
86
|
+
|
|
87
|
+
// ── Adapter-native helpers (present only where the adapter needs them) ──
|
|
88
|
+
/** Locate (or verify) the session transcript when hook payloads omit `transcript_path`. */
|
|
89
|
+
discoverTranscript?(
|
|
90
|
+
nativeSessionId: string,
|
|
91
|
+
candidate?: string,
|
|
92
|
+
options?: RuntimeTelemetryOptions,
|
|
93
|
+
): string | undefined;
|
|
94
|
+
/** Privacy-safe environment provenance recorded when a session onboards mid-flight. */
|
|
95
|
+
midFlightDiagnosticContext?(payload: ParsedPayload): Record<string, string | boolean>;
|
|
96
|
+
/** Completed-reply text supplied inline on tool hooks (no transcript needed). */
|
|
97
|
+
inlineAssistantText?(payload: ParsedPayload | null): string | undefined;
|
|
98
|
+
/** Extra turn.completed telemetry about file links under a bridged deployment. */
|
|
99
|
+
fileLinkTelemetry?(
|
|
100
|
+
coordRoot: string,
|
|
101
|
+
cwd: unknown,
|
|
102
|
+
lastAssistantMessage: string,
|
|
103
|
+
): CodexWslFileLinkTelemetry | null;
|
|
104
|
+
/** Context block teaching the agent how file links resolve under a bridge. */
|
|
105
|
+
fileLinkContext?(coordRoot: string, cwd: unknown): string;
|
|
106
|
+
/** Warning appended to the session-start context when the bridge is misconfigured. */
|
|
107
|
+
bridgeWarning?(coordRoot: string, cwd: unknown): string | undefined;
|
|
108
|
+
/** Deny reason for a tool call whose shell shape is unsafe under the bridge. */
|
|
109
|
+
unsafeCrossShellReason?(input: CrossShellInput): string | null;
|
|
110
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { coordEnv } from "../../../lib/env.ts";
|
|
2
|
-
import type
|
|
2
|
+
import { type Adapter, normalizeAdapter } from "../../adapter.ts";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Resolve the adapter firing the hook. The dispatcher binary is always
|
|
@@ -21,8 +21,7 @@ export function detectAdapter(argv: readonly string[]): Adapter | null {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
function validate(v: string | undefined): Adapter | null {
|
|
24
|
-
|
|
25
|
-
return null;
|
|
24
|
+
return normalizeAdapter(v);
|
|
26
25
|
}
|
|
27
26
|
|
|
28
27
|
/**
|
|
@@ -27,13 +27,33 @@ export interface HookEvent {
|
|
|
27
27
|
*/
|
|
28
28
|
export type HookEntryShape = "claude" | "cursor";
|
|
29
29
|
|
|
30
|
+
/**
|
|
31
|
+
* How `harn init` installs this adapter's lifecycle capture:
|
|
32
|
+
* - `settings-hooks` (default): merge `agent-hook <subcommand>` command hooks
|
|
33
|
+
* into a settings file's `hooks` map (Claude Code, Codex, Cursor).
|
|
34
|
+
* - `opencode-plugin`: OpenCode V2 has no command-hook file; interception is an
|
|
35
|
+
* in-process plugin. `init` copies the Harnery plugin into the auto-discovered
|
|
36
|
+
* `.opencode/plugins/harnery/` directory (entry `index.ts` + `harnery.json`),
|
|
37
|
+
* and wiring inspection checks that owned file rather than a `hooks` map. The
|
|
38
|
+
* plugin bridges each lifecycle hook to `agent-hook <subcommand> --adapter
|
|
39
|
+
* opencode`, so `events` still names the subcommands it delivers.
|
|
40
|
+
*/
|
|
41
|
+
export type AdapterInstallMode = "settings-hooks" | "opencode-plugin";
|
|
42
|
+
|
|
30
43
|
export interface AdapterSpec {
|
|
31
|
-
/**
|
|
44
|
+
/**
|
|
45
|
+
* Settings file to wire, relative to the project root. For the
|
|
46
|
+
* `opencode-plugin` install mode this is the installed plugin entry file.
|
|
47
|
+
*/
|
|
32
48
|
settingsFile: string;
|
|
33
49
|
/** Events this adapter fires, mapped to agent-hook subcommands. */
|
|
34
50
|
events: HookEvent[];
|
|
35
51
|
/** Per-entry encoding under the root `hooks` object. */
|
|
36
52
|
entryShape: HookEntryShape;
|
|
53
|
+
/** Install mechanism; absent means the default settings-file command hooks. */
|
|
54
|
+
installMode?: AdapterInstallMode;
|
|
55
|
+
/** For `opencode-plugin`: the plugin id OpenCode reports for the installed plugin. */
|
|
56
|
+
pluginId?: string;
|
|
37
57
|
/** When set, ensure this top-level `version` key in the file (Cursor requires `1`). */
|
|
38
58
|
rootVersion?: number;
|
|
39
59
|
/** Adapter-owned entries from older specs that `init` should remove during migration. */
|
|
@@ -49,6 +69,20 @@ export interface AdapterSpec {
|
|
|
49
69
|
* wandered (the session shell `cd`ing into a subdirectory or off-repo).
|
|
50
70
|
*/
|
|
51
71
|
projectDirEnv?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Per-handler `timeout` (seconds) written on every Harnery hook entry. Without
|
|
74
|
+
* one, an adapter's own default applies (Codex: 600 seconds), so a stalled
|
|
75
|
+
* hook can hold a tool call for ten minutes. `bySubcommand` overrides
|
|
76
|
+
* `default` for one event.
|
|
77
|
+
*/
|
|
78
|
+
hookTimeouts?: { default: number; bySubcommand?: Record<string, number> };
|
|
79
|
+
/**
|
|
80
|
+
* The adapter runs a handler's `commandWindows` instead of `command` on
|
|
81
|
+
* Windows. A project that opts in (`hooks.codexWindowsBridge`) gets one that
|
|
82
|
+
* hands the hook to a resident WSL bridge (ADR 0197); otherwise init leaves
|
|
83
|
+
* the field off.
|
|
84
|
+
*/
|
|
85
|
+
windowsBridgeHooks?: boolean;
|
|
52
86
|
}
|
|
53
87
|
|
|
54
88
|
/** Claude Code: `.claude/settings.json`. */
|
|
@@ -112,6 +146,29 @@ export const LEGACY_CODEX_EVENTS: HookEvent[] = [
|
|
|
112
146
|
{ settingsKey: "StopFailure", subcommand: "stop-failure" },
|
|
113
147
|
];
|
|
114
148
|
|
|
149
|
+
/**
|
|
150
|
+
* OpenCode V2: delivered by the Harnery OpenCode plugin, which registers
|
|
151
|
+
* in-process hooks and bridges each to `agent-hook <subcommand> --adapter
|
|
152
|
+
* opencode`. There is no settings-file `hooks` map; `settingsKey` here is the
|
|
153
|
+
* originating OpenCode plugin hook, kept for documentation. `post-compact` is
|
|
154
|
+
* omitted because OpenCode post-compaction recovery is not yet certified. The
|
|
155
|
+
* plugin source (`opencode-plugin/src/index.ts`) carries the same map.
|
|
156
|
+
*/
|
|
157
|
+
export const OPENCODE_EVENTS: HookEvent[] = [
|
|
158
|
+
{ settingsKey: "event:session.created", subcommand: "session-start" },
|
|
159
|
+
{ settingsKey: "session.hook:prompt", subcommand: "user-prompt-submit" },
|
|
160
|
+
{ settingsKey: "tool.hook:execute.before", subcommand: "pre-tool-use" },
|
|
161
|
+
{ settingsKey: "tool.hook:execute.after", subcommand: "post-tool-use" },
|
|
162
|
+
{ settingsKey: "tool.hook:execute.after:error", subcommand: "post-tool-use-failure" },
|
|
163
|
+
{ settingsKey: "permission.hook:evaluate", subcommand: "permission-request" },
|
|
164
|
+
{ settingsKey: "event:session.created:child", subcommand: "sub-agent-start" },
|
|
165
|
+
{ settingsKey: "event:session.execution.*:child", subcommand: "sub-agent-stop" },
|
|
166
|
+
{ settingsKey: "event:session.execution.succeeded", subcommand: "stop" },
|
|
167
|
+
{ settingsKey: "event:session.execution.failed|interrupted", subcommand: "stop-failure" },
|
|
168
|
+
{ settingsKey: "event:session.deleted", subcommand: "session-end" },
|
|
169
|
+
{ settingsKey: "session.hook:compaction", subcommand: "pre-compact" },
|
|
170
|
+
];
|
|
171
|
+
|
|
115
172
|
/** Every hook key accepted by Codex's current native hook schema. */
|
|
116
173
|
export const CODEX_ALLOWED_EVENT_KEYS = [
|
|
117
174
|
"SessionStart",
|
|
@@ -148,5 +205,19 @@ export const ADAPTER_SPECS: Record<AdapterId, AdapterSpec> = {
|
|
|
148
205
|
legacyEvents: LEGACY_CODEX_EVENTS,
|
|
149
206
|
allowedTopLevelKeys: ["description", "hooks"],
|
|
150
207
|
allowedEventKeys: CODEX_ALLOWED_EVENT_KEYS,
|
|
208
|
+
// A Codex hook that times out fails open: the run is marked failed and
|
|
209
|
+
// the tool proceeds. Codex clamps SessionEnd to 3 seconds and defaults it
|
|
210
|
+
// to 1, which is too short for a cold hook start.
|
|
211
|
+
hookTimeouts: { default: 20, bySubcommand: { "session-end": 3 } },
|
|
212
|
+
windowsBridgeHooks: true,
|
|
213
|
+
},
|
|
214
|
+
opencode: {
|
|
215
|
+
settingsFile: ".opencode/plugins/harnery/index.ts",
|
|
216
|
+
events: OPENCODE_EVENTS,
|
|
217
|
+
// entryShape is unused for the plugin install mode but required by the type;
|
|
218
|
+
// the plugin, not a hooks-map entry, carries the wiring.
|
|
219
|
+
entryShape: "claude",
|
|
220
|
+
installMode: "opencode-plugin",
|
|
221
|
+
pluginId: "harnery",
|
|
151
222
|
},
|
|
152
223
|
};
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Install-side owner of the OpenCode plugin files: what `harn init --adapter
|
|
3
|
+
* opencode` writes, what `--check`/`doctor` compare against, and what `deinit`
|
|
4
|
+
* removes. The plugin itself lives in `opencode-plugin/src/index.ts` and is
|
|
5
|
+
* copied verbatim under a hash-stamped ownership header, the same fully-owned
|
|
6
|
+
* file contract as the shipped skills (`lib/instructions/splice.ts`).
|
|
7
|
+
*
|
|
8
|
+
* Layout under the project root (`ADAPTER_SPECS.opencode.settingsFile` names
|
|
9
|
+
* the entry file):
|
|
10
|
+
*
|
|
11
|
+
* .opencode/plugins/harnery/index.ts # the plugin, header + verbatim source
|
|
12
|
+
* .opencode/plugins/harnery/harnery.json # { schema, agentHook } written by init
|
|
13
|
+
*
|
|
14
|
+
* OpenCode auto-discovers every directory under `.opencode/plugins/`, so no
|
|
15
|
+
* `opencode.json` edit is needed and a configured-plugin entry is never
|
|
16
|
+
* written (OpenCode also refuses a configured local *file*; only directories
|
|
17
|
+
* load that way).
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
21
|
+
import { dirname, resolve } from "node:path";
|
|
22
|
+
import { fileURLToPath } from "node:url";
|
|
23
|
+
import { shortHash } from "../../../lib/instructions/splice.ts";
|
|
24
|
+
import { ADAPTER_SPECS } from "./events.ts";
|
|
25
|
+
|
|
26
|
+
export const OPENCODE_PLUGIN_ENTRY = ADAPTER_SPECS.opencode.settingsFile;
|
|
27
|
+
export const OPENCODE_PLUGIN_DIR = dirname(OPENCODE_PLUGIN_ENTRY);
|
|
28
|
+
export const OPENCODE_PLUGIN_CONFIG = `${OPENCODE_PLUGIN_DIR}/harnery.json`;
|
|
29
|
+
export const OPENCODE_PLUGIN_CONFIG_SCHEMA = "harnery-opencode-plugin/v1";
|
|
30
|
+
|
|
31
|
+
const HEADER_RE = /^\/\/ harnery:generated opencode-plugin v=([0-9a-f]{8});[^\n]*\n/;
|
|
32
|
+
|
|
33
|
+
/** Package-relative path of the shipped plugin source (also listed in `files`). */
|
|
34
|
+
const PLUGIN_SOURCE = resolve(
|
|
35
|
+
dirname(fileURLToPath(import.meta.url)),
|
|
36
|
+
"..",
|
|
37
|
+
"..",
|
|
38
|
+
"..",
|
|
39
|
+
"..",
|
|
40
|
+
"opencode-plugin",
|
|
41
|
+
"src",
|
|
42
|
+
"index.ts",
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
/** The plugin source as shipped, trimmed so header + body hashing is stable. */
|
|
46
|
+
export function openCodePluginSource(): string {
|
|
47
|
+
return readFileSync(PLUGIN_SOURCE, "utf8").trim();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** Render the installed entry file: ownership header, then the verbatim source. */
|
|
51
|
+
export function renderOpenCodePluginEntry(
|
|
52
|
+
binName: string,
|
|
53
|
+
source = openCodePluginSource(),
|
|
54
|
+
): string {
|
|
55
|
+
const body = source.trim();
|
|
56
|
+
const header =
|
|
57
|
+
`// harnery:generated opencode-plugin v=${shortHash(body)}; machine-owned; ` +
|
|
58
|
+
`regenerated by \`${binName} init --adapter opencode\`, removed by \`${binName} deinit --adapter opencode\`. ` +
|
|
59
|
+
"Edit harnery's opencode-plugin/src/index.ts, not this file.";
|
|
60
|
+
return `${header}\n${body}\n`;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** Render the sibling config the plugin reads to find the `agent-hook` launcher. */
|
|
64
|
+
export function renderOpenCodePluginConfig(agentHook: string): string {
|
|
65
|
+
return `${JSON.stringify({ schema: OPENCODE_PLUGIN_CONFIG_SCHEMA, agentHook }, null, 2)}\n`;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** True when the content carries harnery's plugin ownership header. */
|
|
69
|
+
export function isOwnedOpenCodePlugin(content: string): boolean {
|
|
70
|
+
return HEADER_RE.test(content);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export type OpenCodePluginStatus = "missing" | "fresh" | "stale" | "foreign";
|
|
74
|
+
|
|
75
|
+
export interface OpenCodePluginCheck {
|
|
76
|
+
status: OpenCodePluginStatus;
|
|
77
|
+
/** Human-readable drift reasons, one per problem; empty when fresh or missing. */
|
|
78
|
+
issues: string[];
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Compare the installed plugin files with what init would write now. Pure
|
|
83
|
+
* except for reads; never writes. `foreign` means an entry file exists at the
|
|
84
|
+
* harnery path without harnery's header, which init refuses to overwrite.
|
|
85
|
+
*/
|
|
86
|
+
export function checkOpenCodePlugin(
|
|
87
|
+
projectRoot: string,
|
|
88
|
+
expected: { binName: string; agentHook: string; source?: string },
|
|
89
|
+
): OpenCodePluginCheck {
|
|
90
|
+
const entryPath = resolve(projectRoot, OPENCODE_PLUGIN_ENTRY);
|
|
91
|
+
const configPath = resolve(projectRoot, OPENCODE_PLUGIN_CONFIG);
|
|
92
|
+
if (!existsSync(entryPath)) return { status: "missing", issues: [] };
|
|
93
|
+
const content = readFileSync(entryPath, "utf8");
|
|
94
|
+
const match = HEADER_RE.exec(content);
|
|
95
|
+
if (!match) {
|
|
96
|
+
return {
|
|
97
|
+
status: "foreign",
|
|
98
|
+
issues: [`${OPENCODE_PLUGIN_ENTRY}: exists without harnery's ownership header`],
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
const issues: string[] = [];
|
|
102
|
+
const body = content.slice(match[0].length).trim();
|
|
103
|
+
const fresh = (expected.source ?? openCodePluginSource()).trim();
|
|
104
|
+
if (match[1] !== shortHash(fresh) || body !== fresh) {
|
|
105
|
+
issues.push(`${OPENCODE_PLUGIN_ENTRY}: plugin source is stale (re-run init)`);
|
|
106
|
+
}
|
|
107
|
+
if (!existsSync(configPath)) {
|
|
108
|
+
issues.push(`${OPENCODE_PLUGIN_CONFIG}: missing`);
|
|
109
|
+
} else if (readFileSync(configPath, "utf8") !== renderOpenCodePluginConfig(expected.agentHook)) {
|
|
110
|
+
issues.push(`${OPENCODE_PLUGIN_CONFIG}: stale agent-hook launcher (re-run init)`);
|
|
111
|
+
}
|
|
112
|
+
return { status: issues.length === 0 ? "fresh" : "stale", issues };
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export interface OpenCodePluginInstall {
|
|
116
|
+
actions: string[];
|
|
117
|
+
/** Set when init must stop: a foreign file sits at the harnery path. */
|
|
118
|
+
error?: string;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/** Write (or refresh) the plugin directory. Idempotent; a fresh install is a no-op. */
|
|
122
|
+
export function installOpenCodePlugin(
|
|
123
|
+
projectRoot: string,
|
|
124
|
+
opts: { binName: string; agentHook: string; dryRun: boolean },
|
|
125
|
+
): OpenCodePluginInstall {
|
|
126
|
+
const check = checkOpenCodePlugin(projectRoot, opts);
|
|
127
|
+
if (check.status === "foreign") {
|
|
128
|
+
return {
|
|
129
|
+
actions: [],
|
|
130
|
+
error:
|
|
131
|
+
`✗ ${OPENCODE_PLUGIN_ENTRY} exists but is not harnery's plugin; refusing to overwrite. ` +
|
|
132
|
+
"Move it aside and re-run.",
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
if (check.status === "fresh") {
|
|
136
|
+
return { actions: [`· opencode plugin already installed at ${OPENCODE_PLUGIN_DIR}/`] };
|
|
137
|
+
}
|
|
138
|
+
const verb = check.status === "missing" ? "install" : "refresh";
|
|
139
|
+
if (opts.dryRun) {
|
|
140
|
+
return {
|
|
141
|
+
actions: [
|
|
142
|
+
`+ would ${verb} the opencode plugin at ${OPENCODE_PLUGIN_DIR}/ (index.ts + harnery.json)`,
|
|
143
|
+
...check.issues.map((issue) => ` · ${issue}`),
|
|
144
|
+
],
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
const dir = resolve(projectRoot, OPENCODE_PLUGIN_DIR);
|
|
148
|
+
mkdirSync(dir, { recursive: true });
|
|
149
|
+
writeFileSync(
|
|
150
|
+
resolve(projectRoot, OPENCODE_PLUGIN_ENTRY),
|
|
151
|
+
renderOpenCodePluginEntry(opts.binName),
|
|
152
|
+
);
|
|
153
|
+
writeFileSync(
|
|
154
|
+
resolve(projectRoot, OPENCODE_PLUGIN_CONFIG),
|
|
155
|
+
renderOpenCodePluginConfig(opts.agentHook),
|
|
156
|
+
);
|
|
157
|
+
return {
|
|
158
|
+
actions: [
|
|
159
|
+
`+ ${verb === "install" ? "installed" : "refreshed"} the opencode plugin at ${OPENCODE_PLUGIN_DIR}/ (index.ts + harnery.json)`,
|
|
160
|
+
],
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/** Remove the plugin directory when harnery owns it. Leaves a foreign file alone. */
|
|
165
|
+
export function removeOpenCodePlugin(projectRoot: string, dryRun: boolean): string[] {
|
|
166
|
+
const dir = resolve(projectRoot, OPENCODE_PLUGIN_DIR);
|
|
167
|
+
const entryPath = resolve(projectRoot, OPENCODE_PLUGIN_ENTRY);
|
|
168
|
+
if (!existsSync(entryPath)) {
|
|
169
|
+
return [`· ${OPENCODE_PLUGIN_DIR}/ doesn't exist; no plugin to remove`];
|
|
170
|
+
}
|
|
171
|
+
if (!isOwnedOpenCodePlugin(readFileSync(entryPath, "utf8"))) {
|
|
172
|
+
return [`· ${OPENCODE_PLUGIN_ENTRY} is not harnery's plugin; left in place`];
|
|
173
|
+
}
|
|
174
|
+
if (dryRun) return [`+ would remove ${OPENCODE_PLUGIN_DIR}/ (harnery-owned plugin)`];
|
|
175
|
+
rmSync(dir, { recursive: true, force: true });
|
|
176
|
+
return [`+ removed ${OPENCODE_PLUGIN_DIR}/ (harnery-owned plugin)`];
|
|
177
|
+
}
|
|
@@ -14,6 +14,9 @@
|
|
|
14
14
|
* - **Codex**: structurally identical to Claude Code for context and tool
|
|
15
15
|
* denials. Stop blocks are deliberately suppressed because their automatic
|
|
16
16
|
* continuation can replace a completed user-facing answer.
|
|
17
|
+
* - **OpenCode**: the Harnery OpenCode plugin reads the Claude Code envelope
|
|
18
|
+
* (`hookSpecificOutput.additionalContext` / `permissionDecision`) and feeds
|
|
19
|
+
* it back through OpenCode's own channels. Stop blocks are suppressed.
|
|
17
20
|
*
|
|
18
21
|
* Every helper writes to process.stdout + newline-terminates so callers can
|
|
19
22
|
* fire-and-forget. Empty text is a no-op.
|
|
@@ -65,6 +68,10 @@ export function emitDeny(adapter: Adapter, reason: string): void {
|
|
|
65
68
|
* answer in clients that retain only the final continuation response. Return
|
|
66
69
|
* success without output as a defense in depth behind the observe-only
|
|
67
70
|
* verdict in `agents/rules/stop-hook.ts`.
|
|
71
|
+
* - **OpenCode** has no blocking Stop channel at all: the plugin observes
|
|
72
|
+
* `session.execution.succeeded` after the turn has already completed, so a
|
|
73
|
+
* block could only arrive as a new message. Return success without output;
|
|
74
|
+
* the verdict is still recorded in the ledger.
|
|
68
75
|
* - **Cursor** ignores stop-hook exit codes (non-zero = fail-open, the turn
|
|
69
76
|
* proceeds) and re-prompts ONLY via a `followup_message` field in stdout
|
|
70
77
|
* JSON, which it auto-submits as the next user message: the sanctioned
|
|
@@ -88,7 +95,7 @@ export function emitStopOutcome(
|
|
|
88
95
|
options: StopOutputOptions,
|
|
89
96
|
coordRoot?: string,
|
|
90
97
|
): 0 | 2 {
|
|
91
|
-
if (adapter === "codex") return 0;
|
|
98
|
+
if (adapter === "codex" || adapter === "opencode") return 0;
|
|
92
99
|
|
|
93
100
|
const verdict = options.verdict;
|
|
94
101
|
if (!verdict) return 0;
|
|
@@ -671,7 +671,9 @@ function claudeModelContextCapability(model: string): ClaudeModelContextCapabili
|
|
|
671
671
|
const normalized = model.toLowerCase();
|
|
672
672
|
const oneMillionTokenModels = new Set([
|
|
673
673
|
"claude-fable-5",
|
|
674
|
+
"claude-opus-5-5",
|
|
674
675
|
"claude-opus-5",
|
|
676
|
+
"claude-sonnet-5-5",
|
|
675
677
|
"claude-sonnet-5",
|
|
676
678
|
"claude-opus-4-8",
|
|
677
679
|
"claude-opus-4-7",
|
|
@@ -679,7 +681,7 @@ function claudeModelContextCapability(model: string): ClaudeModelContextCapabili
|
|
|
679
681
|
"claude-sonnet-4-6",
|
|
680
682
|
]);
|
|
681
683
|
if (oneMillionTokenModels.has(normalized)) {
|
|
682
|
-
return { limit_tokens: 1_000_000, authority: "
|
|
684
|
+
return { limit_tokens: 1_000_000, authority: "anthropic_model_capabilities_2026_09" };
|
|
683
685
|
}
|
|
684
686
|
if (normalized === "claude-haiku-4-5" || normalized === "claude-haiku-4-5-20251001") {
|
|
685
687
|
return { limit_tokens: 200_000, authority: "anthropic_model_capabilities_2026_08" };
|