@zvada/agent-server 0.3.18 → 0.3.19
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/AGENTS.md +11 -26
- package/CHANGELOG.md +1005 -1
- package/README.md +35 -39
- package/dist/types/accounts/chatgpt.d.ts +34 -0
- package/dist/types/accounts/chatgpt.d.ts.map +1 -0
- package/dist/types/accounts/check.d.ts +24 -0
- package/dist/types/accounts/check.d.ts.map +1 -0
- package/dist/types/accounts/claude.d.ts +21 -0
- package/dist/types/accounts/claude.d.ts.map +1 -0
- package/dist/types/accounts/endpoint.d.ts +50 -0
- package/dist/types/accounts/endpoint.d.ts.map +1 -0
- package/dist/types/accounts/http.d.ts +38 -0
- package/dist/types/accounts/http.d.ts.map +1 -0
- package/dist/types/accounts/index.d.ts +6 -0
- package/dist/types/accounts/index.d.ts.map +1 -0
- package/dist/types/client/client.d.ts +272 -0
- package/dist/types/client/client.d.ts.map +1 -0
- package/dist/types/client/connection.d.ts +160 -0
- package/dist/types/client/connection.d.ts.map +1 -0
- package/dist/types/client/history.d.ts +8 -0
- package/dist/types/client/history.d.ts.map +1 -0
- package/dist/types/client/index.d.ts +5 -0
- package/dist/types/client/index.d.ts.map +1 -0
- package/dist/types/client/listeners.d.ts +8 -0
- package/dist/types/client/listeners.d.ts.map +1 -0
- package/dist/types/client/logins.d.ts +35 -0
- package/dist/types/client/logins.d.ts.map +1 -0
- package/dist/types/client/rpc.d.ts +46 -0
- package/dist/types/client/rpc.d.ts.map +1 -0
- package/dist/types/client/streams.d.ts +150 -0
- package/dist/types/client/streams.d.ts.map +1 -0
- package/dist/types/client/transports.d.ts +35 -0
- package/dist/types/client/transports.d.ts.map +1 -0
- package/dist/types/client/turns.d.ts +81 -0
- package/dist/types/client/turns.d.ts.map +1 -0
- package/dist/types/core/agents/acp/acp-agent.d.ts +68 -0
- package/dist/types/core/agents/acp/acp-agent.d.ts.map +1 -0
- package/dist/types/core/agents/acp/adapter.d.ts +39 -0
- package/dist/types/core/agents/acp/adapter.d.ts.map +1 -0
- package/dist/types/core/agents/acp/client.d.ts +90 -0
- package/dist/types/core/agents/acp/client.d.ts.map +1 -0
- package/dist/types/core/agents/acp/known-agents.d.ts +35 -0
- package/dist/types/core/agents/acp/known-agents.d.ts.map +1 -0
- package/dist/types/core/agents/acp/mappings.d.ts +46 -0
- package/dist/types/core/agents/acp/mappings.d.ts.map +1 -0
- package/dist/types/core/agents/acp/requests.d.ts +26 -0
- package/dist/types/core/agents/acp/requests.d.ts.map +1 -0
- package/dist/types/core/agents/attachments.d.ts +11 -0
- package/dist/types/core/agents/attachments.d.ts.map +1 -0
- package/dist/types/core/agents/base.d.ts +227 -0
- package/dist/types/core/agents/base.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/adapter.d.ts +58 -0
- package/dist/types/core/agents/claude-code/adapter.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/approvals.d.ts +26 -0
- package/dist/types/core/agents/claude-code/approvals.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/claude-agent.d.ts +70 -0
- package/dist/types/core/agents/claude-code/claude-agent.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/credentials.d.ts +54 -0
- package/dist/types/core/agents/claude-code/credentials.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/events.d.ts +42 -0
- package/dist/types/core/agents/claude-code/events.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/login.d.ts +61 -0
- package/dist/types/core/agents/claude-code/login.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/mcp.d.ts +52 -0
- package/dist/types/core/agents/claude-code/mcp.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/models.d.ts +30 -0
- package/dist/types/core/agents/claude-code/models.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/options.d.ts +183 -0
- package/dist/types/core/agents/claude-code/options.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/outcome.d.ts +50 -0
- package/dist/types/core/agents/claude-code/outcome.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/session-pool.d.ts +36 -0
- package/dist/types/core/agents/claude-code/session-pool.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/session.d.ts +148 -0
- package/dist/types/core/agents/claude-code/session.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/spawn.d.ts +29 -0
- package/dist/types/core/agents/claude-code/spawn.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/spend.d.ts +58 -0
- package/dist/types/core/agents/claude-code/spend.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/tools.d.ts +4 -0
- package/dist/types/core/agents/claude-code/tools.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/turn-usage.d.ts +52 -0
- package/dist/types/core/agents/claude-code/turn-usage.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/turn.d.ts +121 -0
- package/dist/types/core/agents/claude-code/turn.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/adapter.d.ts +59 -0
- package/dist/types/core/agents/codex-app-server/adapter.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/client.d.ts +116 -0
- package/dist/types/core/agents/codex-app-server/client.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/codex-agent.d.ts +113 -0
- package/dist/types/core/agents/codex-app-server/codex-agent.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/commands.d.ts +66 -0
- package/dist/types/core/agents/codex-app-server/commands.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/credentials.d.ts +49 -0
- package/dist/types/core/agents/codex-app-server/credentials.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/effort.d.ts +12 -0
- package/dist/types/core/agents/codex-app-server/effort.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/events.d.ts +45 -0
- package/dist/types/core/agents/codex-app-server/events.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/homes.d.ts +20 -0
- package/dist/types/core/agents/codex-app-server/homes.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/input.d.ts +26 -0
- package/dist/types/core/agents/codex-app-server/input.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/items.d.ts +31 -0
- package/dist/types/core/agents/codex-app-server/items.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/login.d.ts +38 -0
- package/dist/types/core/agents/codex-app-server/login.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/mcp.d.ts +62 -0
- package/dist/types/core/agents/codex-app-server/mcp.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/models.d.ts +67 -0
- package/dist/types/core/agents/codex-app-server/models.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/options.d.ts +40 -0
- package/dist/types/core/agents/codex-app-server/options.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/plan-approval.d.ts +19 -0
- package/dist/types/core/agents/codex-app-server/plan-approval.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/protocol.d.ts +99 -0
- package/dist/types/core/agents/codex-app-server/protocol.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/requests.d.ts +42 -0
- package/dist/types/core/agents/codex-app-server/requests.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/session.d.ts +96 -0
- package/dist/types/core/agents/codex-app-server/session.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/subagents.d.ts +53 -0
- package/dist/types/core/agents/codex-app-server/subagents.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/thread-settings.d.ts +87 -0
- package/dist/types/core/agents/codex-app-server/thread-settings.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/turn-items.d.ts +33 -0
- package/dist/types/core/agents/codex-app-server/turn-items.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/turn.d.ts +163 -0
- package/dist/types/core/agents/codex-app-server/turn.d.ts.map +1 -0
- package/dist/types/core/agents/config-fingerprint.d.ts +5 -0
- package/dist/types/core/agents/config-fingerprint.d.ts.map +1 -0
- package/dist/types/core/agents/credentials.d.ts +28 -0
- package/dist/types/core/agents/credentials.d.ts.map +1 -0
- package/dist/types/core/agents/elicitation.d.ts +37 -0
- package/dist/types/core/agents/elicitation.d.ts.map +1 -0
- package/dist/types/core/agents/inherit-config.d.ts +18 -0
- package/dist/types/core/agents/inherit-config.d.ts.map +1 -0
- package/dist/types/core/agents/login.d.ts +67 -0
- package/dist/types/core/agents/login.d.ts.map +1 -0
- package/dist/types/core/agents/mcp-config.d.ts +57 -0
- package/dist/types/core/agents/mcp-config.d.ts.map +1 -0
- package/dist/types/core/agents/plan.d.ts +16 -0
- package/dist/types/core/agents/plan.d.ts.map +1 -0
- package/dist/types/core/agents/registry.d.ts +30 -0
- package/dist/types/core/agents/registry.d.ts.map +1 -0
- package/dist/types/core/agents/session-agent.d.ts +48 -0
- package/dist/types/core/agents/session-agent.d.ts.map +1 -0
- package/dist/types/core/agents/session-pool.d.ts +41 -0
- package/dist/types/core/agents/session-pool.d.ts.map +1 -0
- package/dist/types/core/agents/stderr-tail.d.ts +28 -0
- package/dist/types/core/agents/stderr-tail.d.ts.map +1 -0
- package/dist/types/core/agents/thinking-levels.d.ts +4 -0
- package/dist/types/core/agents/thinking-levels.d.ts.map +1 -0
- package/dist/types/core/agents/types.d.ts +124 -0
- package/dist/types/core/agents/types.d.ts.map +1 -0
- package/dist/types/core/diagnostics.d.ts +36 -0
- package/dist/types/core/diagnostics.d.ts.map +1 -0
- package/dist/types/core/index.d.ts +29 -0
- package/dist/types/core/index.d.ts.map +1 -0
- package/dist/types/core/presets.d.ts +80 -0
- package/dist/types/core/presets.d.ts.map +1 -0
- package/dist/types/core/processes/identity.d.ts +31 -0
- package/dist/types/core/processes/identity.d.ts.map +1 -0
- package/dist/types/core/processes/lifeline.d.ts +47 -0
- package/dist/types/core/processes/lifeline.d.ts.map +1 -0
- package/dist/types/core/processes/native-processes.d.ts +130 -0
- package/dist/types/core/processes/native-processes.d.ts.map +1 -0
- package/dist/types/core/processes/process-table.d.ts +43 -0
- package/dist/types/core/processes/process-table.d.ts.map +1 -0
- package/dist/types/core/provision/cache-trust.d.ts +13 -0
- package/dist/types/core/provision/cache-trust.d.ts.map +1 -0
- package/dist/types/core/provision/cache-usage.d.ts +14 -0
- package/dist/types/core/provision/cache-usage.d.ts.map +1 -0
- package/dist/types/core/provision/checksums.d.ts +46 -0
- package/dist/types/core/provision/checksums.d.ts.map +1 -0
- package/dist/types/core/provision/extract.d.ts +7 -0
- package/dist/types/core/provision/extract.d.ts.map +1 -0
- package/dist/types/core/provision/index.d.ts +5 -0
- package/dist/types/core/provision/index.d.ts.map +1 -0
- package/dist/types/core/provision/install-build.d.ts +36 -0
- package/dist/types/core/provision/install-build.d.ts.map +1 -0
- package/dist/types/core/provision/npm.d.ts +40 -0
- package/dist/types/core/provision/npm.d.ts.map +1 -0
- package/dist/types/core/provision/pins.d.ts +24 -0
- package/dist/types/core/provision/pins.d.ts.map +1 -0
- package/dist/types/core/provision/platform.d.ts +28 -0
- package/dist/types/core/provision/platform.d.ts.map +1 -0
- package/dist/types/core/provision/provisioner.d.ts +189 -0
- package/dist/types/core/provision/provisioner.d.ts.map +1 -0
- package/dist/types/core/provision/releases.d.ts +8 -0
- package/dist/types/core/provision/releases.d.ts.map +1 -0
- package/dist/types/core/provision/tools.d.ts +81 -0
- package/dist/types/core/provision/tools.d.ts.map +1 -0
- package/dist/types/core/proxy/anthropic-proxy.d.ts +52 -0
- package/dist/types/core/proxy/anthropic-proxy.d.ts.map +1 -0
- package/dist/types/core/proxy/api-key-store.d.ts +37 -0
- package/dist/types/core/proxy/api-key-store.d.ts.map +1 -0
- package/dist/types/core/proxy/index.d.ts +3 -0
- package/dist/types/core/proxy/index.d.ts.map +1 -0
- package/dist/types/core/proxy/loopback.d.ts +14 -0
- package/dist/types/core/proxy/loopback.d.ts.map +1 -0
- package/dist/types/core/runtime/agent-runtime.d.ts +181 -0
- package/dist/types/core/runtime/agent-runtime.d.ts.map +1 -0
- package/dist/types/core/runtime/event-processor.d.ts +87 -0
- package/dist/types/core/runtime/event-processor.d.ts.map +1 -0
- package/dist/types/core/runtime/event-sink.d.ts +44 -0
- package/dist/types/core/runtime/event-sink.d.ts.map +1 -0
- package/dist/types/core/runtime/harness-clis.d.ts +10 -0
- package/dist/types/core/runtime/harness-clis.d.ts.map +1 -0
- package/dist/types/core/runtime/harness-logins.d.ts +68 -0
- package/dist/types/core/runtime/harness-logins.d.ts.map +1 -0
- package/dist/types/core/runtime/login-reads.d.ts +28 -0
- package/dist/types/core/runtime/login-reads.d.ts.map +1 -0
- package/dist/types/core/runtime/model-lists.d.ts +37 -0
- package/dist/types/core/runtime/model-lists.d.ts.map +1 -0
- package/dist/types/core/runtime/permission-policy.d.ts +61 -0
- package/dist/types/core/runtime/permission-policy.d.ts.map +1 -0
- package/dist/types/core/runtime/request-broker.d.ts +49 -0
- package/dist/types/core/runtime/request-broker.d.ts.map +1 -0
- package/dist/types/core/runtime/steering.d.ts +38 -0
- package/dist/types/core/runtime/steering.d.ts.map +1 -0
- package/dist/types/core/runtime/turn-outcome.d.ts +21 -0
- package/dist/types/core/runtime/turn-outcome.d.ts.map +1 -0
- package/dist/types/core/runtime/turn.d.ts +121 -0
- package/dist/types/core/runtime/turn.d.ts.map +1 -0
- package/dist/types/core/utils/bounded.d.ts +6 -0
- package/dist/types/core/utils/bounded.d.ts.map +1 -0
- package/dist/types/core/utils/deadline.d.ts +14 -0
- package/dist/types/core/utils/deadline.d.ts.map +1 -0
- package/dist/types/core/utils/errors.d.ts +104 -0
- package/dist/types/core/utils/errors.d.ts.map +1 -0
- package/dist/types/core/utils/is-record.d.ts +3 -0
- package/dist/types/core/utils/is-record.d.ts.map +1 -0
- package/dist/types/core/utils/loopback.d.ts +6 -0
- package/dist/types/core/utils/loopback.d.ts.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/protocol/account.d.ts +26 -0
- package/dist/types/protocol/account.d.ts.map +1 -0
- package/dist/types/protocol/async-queue.d.ts +21 -0
- package/dist/types/protocol/async-queue.d.ts.map +1 -0
- package/dist/types/protocol/auth.d.ts +228 -0
- package/dist/types/protocol/auth.d.ts.map +1 -0
- package/dist/types/protocol/canonical.d.ts +9 -0
- package/dist/types/protocol/canonical.d.ts.map +1 -0
- package/dist/types/protocol/clis.d.ts +74 -0
- package/dist/types/protocol/clis.d.ts.map +1 -0
- package/dist/types/protocol/config.d.ts +200 -0
- package/dist/types/protocol/config.d.ts.map +1 -0
- package/dist/types/protocol/conversation.d.ts +942 -0
- package/dist/types/protocol/conversation.d.ts.map +1 -0
- package/dist/types/protocol/credentials.d.ts +145 -0
- package/dist/types/protocol/credentials.d.ts.map +1 -0
- package/dist/types/protocol/errors.d.ts +36 -0
- package/dist/types/protocol/errors.d.ts.map +1 -0
- package/dist/types/protocol/execution.d.ts +28 -0
- package/dist/types/protocol/execution.d.ts.map +1 -0
- package/dist/types/protocol/factories.d.ts +94 -0
- package/dist/types/protocol/factories.d.ts.map +1 -0
- package/dist/types/protocol/guards.d.ts +55 -0
- package/dist/types/protocol/guards.d.ts.map +1 -0
- package/dist/types/protocol/harness.d.ts +70 -0
- package/dist/types/protocol/harness.d.ts.map +1 -0
- package/dist/types/protocol/history.d.ts +318 -0
- package/dist/types/protocol/history.d.ts.map +1 -0
- package/dist/types/protocol/ids.d.ts +9 -0
- package/dist/types/protocol/ids.d.ts.map +1 -0
- package/dist/types/protocol/index.d.ts +35 -0
- package/dist/types/protocol/index.d.ts.map +1 -0
- package/dist/types/protocol/lifecycle.d.ts +1190 -0
- package/dist/types/protocol/lifecycle.d.ts.map +1 -0
- package/dist/types/protocol/meta-keys.d.ts +17 -0
- package/dist/types/protocol/meta-keys.d.ts.map +1 -0
- package/dist/types/protocol/meta.d.ts +13 -0
- package/dist/types/protocol/meta.d.ts.map +1 -0
- package/dist/types/protocol/model-catalog.d.ts +11 -0
- package/dist/types/protocol/model-catalog.d.ts.map +1 -0
- package/dist/types/protocol/models.d.ts +107 -0
- package/dist/types/protocol/models.d.ts.map +1 -0
- package/dist/types/protocol/part-input.d.ts +101 -0
- package/dist/types/protocol/part-input.d.ts.map +1 -0
- package/dist/types/protocol/parts.d.ts +357 -0
- package/dist/types/protocol/parts.d.ts.map +1 -0
- package/dist/types/protocol/reduce.d.ts +26 -0
- package/dist/types/protocol/reduce.d.ts.map +1 -0
- package/dist/types/protocol/selectors.d.ts +64 -0
- package/dist/types/protocol/selectors.d.ts.map +1 -0
- package/dist/types/protocol/seq-cursor.d.ts +66 -0
- package/dist/types/protocol/seq-cursor.d.ts.map +1 -0
- package/dist/types/protocol/stop-reasons.d.ts +33 -0
- package/dist/types/protocol/stop-reasons.d.ts.map +1 -0
- package/dist/types/protocol/thinking.d.ts +28 -0
- package/dist/types/protocol/thinking.d.ts.map +1 -0
- package/dist/types/protocol/time.d.ts +21 -0
- package/dist/types/protocol/time.d.ts.map +1 -0
- package/dist/types/protocol/tokens.d.ts +29 -0
- package/dist/types/protocol/tokens.d.ts.map +1 -0
- package/dist/types/protocol/tool-closure.d.ts +25 -0
- package/dist/types/protocol/tool-closure.d.ts.map +1 -0
- package/dist/types/protocol/tool-state.d.ts +209 -0
- package/dist/types/protocol/tool-state.d.ts.map +1 -0
- package/dist/types/protocol/verify.d.ts +52 -0
- package/dist/types/protocol/verify.d.ts.map +1 -0
- package/dist/types/protocol/vocabulary.d.ts +19 -0
- package/dist/types/protocol/vocabulary.d.ts.map +1 -0
- package/dist/types/protocol/wire-api.d.ts +1983 -0
- package/dist/types/protocol/wire-api.d.ts.map +1 -0
- package/dist/types/protocol/wire.d.ts +1758 -0
- package/dist/types/protocol/wire.d.ts.map +1 -0
- package/dist/types/server/acp/binding.d.ts +33 -0
- package/dist/types/server/acp/binding.d.ts.map +1 -0
- package/dist/types/server/acp/session-records.d.ts +17 -0
- package/dist/types/server/acp/session-records.d.ts.map +1 -0
- package/dist/types/server/acp/translate.d.ts +48 -0
- package/dist/types/server/acp/translate.d.ts.map +1 -0
- package/dist/types/server/agent-server.d.ts +121 -0
- package/dist/types/server/agent-server.d.ts.map +1 -0
- package/dist/types/server/feedback.d.ts +37 -0
- package/dist/types/server/feedback.d.ts.map +1 -0
- package/dist/types/server/history.d.ts +15 -0
- package/dist/types/server/history.d.ts.map +1 -0
- package/dist/types/server/index.d.ts +7 -0
- package/dist/types/server/index.d.ts.map +1 -0
- package/dist/types/server/install.d.ts +42 -0
- package/dist/types/server/install.d.ts.map +1 -0
- package/dist/types/server/open-parts.d.ts +27 -0
- package/dist/types/server/open-parts.d.ts.map +1 -0
- package/dist/types/server/routes.d.ts +61 -0
- package/dist/types/server/routes.d.ts.map +1 -0
- package/dist/types/server/secrets.d.ts +11 -0
- package/dist/types/server/secrets.d.ts.map +1 -0
- package/dist/types/server/session-gate.d.ts +32 -0
- package/dist/types/server/session-gate.d.ts.map +1 -0
- package/dist/types/server/session-log.d.ts +39 -0
- package/dist/types/server/session-log.d.ts.map +1 -0
- package/dist/types/server/session-store.d.ts +119 -0
- package/dist/types/server/session-store.d.ts.map +1 -0
- package/dist/types/server/subscriptions.d.ts +74 -0
- package/dist/types/server/subscriptions.d.ts.map +1 -0
- package/dist/types/server/transports.d.ts +74 -0
- package/dist/types/server/transports.d.ts.map +1 -0
- package/dist/types/server/wire-error.d.ts +9 -0
- package/dist/types/server/wire-error.d.ts.map +1 -0
- package/dist/types/sync/event-log.d.ts +45 -0
- package/dist/types/sync/event-log.d.ts.map +1 -0
- package/dist/types/sync/fit.d.ts +40 -0
- package/dist/types/sync/fit.d.ts.map +1 -0
- package/dist/types/sync/history-reader.d.ts +8 -0
- package/dist/types/sync/history-reader.d.ts.map +1 -0
- package/dist/types/sync/history-sqlite.d.ts +37 -0
- package/dist/types/sync/history-sqlite.d.ts.map +1 -0
- package/dist/types/sync/history.d.ts +70 -0
- package/dist/types/sync/history.d.ts.map +1 -0
- package/dist/types/sync/index.d.ts +4 -0
- package/dist/types/sync/index.d.ts.map +1 -0
- package/dist/types/sync/journal-sqlite.d.ts +51 -0
- package/dist/types/sync/journal-sqlite.d.ts.map +1 -0
- package/dist/types/sync/journal.d.ts +107 -0
- package/dist/types/sync/journal.d.ts.map +1 -0
- package/dist/types/sync/live-tails.d.ts +30 -0
- package/dist/types/sync/live-tails.d.ts.map +1 -0
- package/dist/types/sync/node-sqlite.d.ts +7 -0
- package/dist/types/sync/node-sqlite.d.ts.map +1 -0
- package/dist/types/sync/projection.d.ts +10 -0
- package/dist/types/sync/projection.d.ts.map +1 -0
- package/dist/types/sync/recovery.d.ts +25 -0
- package/dist/types/sync/recovery.d.ts.map +1 -0
- package/dist/types/sync/retry.d.ts +25 -0
- package/dist/types/sync/retry.d.ts.map +1 -0
- package/dist/types/sync/schema.d.ts +4 -0
- package/dist/types/sync/schema.d.ts.map +1 -0
- package/dist/types/sync/sql.d.ts +38 -0
- package/dist/types/sync/sql.d.ts.map +1 -0
- package/dist/types/sync/sqlite-file.d.ts +9 -0
- package/dist/types/sync/sqlite-file.d.ts.map +1 -0
- package/dist/types/sync/sqlite.d.ts +6 -0
- package/dist/types/sync/sqlite.d.ts.map +1 -0
- package/dist/types/sync/worker.d.ts +63 -0
- package/dist/types/sync/worker.d.ts.map +1 -0
- package/docs/consuming.md +452 -53
- package/docs/deploy.md +218 -47
- package/docs/{sync-experiment.md → durable-sessions.md} +77 -72
- package/docs/feedback.md +116 -0
- package/docs/harnesses.md +212 -88
- package/docs/sync-history.md +29 -13
- package/docs/sync-integration.md +52 -66
- package/package.json +43 -25
- package/src/accounts/chatgpt.ts +194 -0
- package/src/accounts/check.ts +112 -0
- package/src/accounts/claude.ts +111 -0
- package/src/accounts/endpoint.ts +151 -0
- package/src/accounts/http.ts +97 -0
- package/src/accounts/index.ts +19 -0
- package/src/client/client.ts +604 -670
- package/src/client/connection.ts +371 -0
- package/src/client/history.ts +29 -52
- package/src/client/index.ts +11 -2
- package/src/client/listeners.ts +20 -0
- package/src/client/logins.ts +105 -0
- package/src/client/rpc.ts +144 -0
- package/src/client/streams.ts +488 -0
- package/src/client/transports.ts +62 -8
- package/src/client/turns.ts +171 -0
- package/src/core/agents/acp/acp-agent.ts +94 -118
- package/src/core/agents/acp/adapter.ts +20 -9
- package/src/core/agents/acp/client.ts +125 -47
- package/src/core/agents/acp/known-agents.ts +36 -4
- package/src/core/agents/acp/mappings.ts +64 -18
- package/src/core/agents/acp/requests.ts +125 -0
- package/src/core/agents/attachments.ts +18 -0
- package/src/core/agents/base.ts +120 -42
- package/src/core/agents/claude-code/adapter.ts +177 -238
- package/src/core/agents/claude-code/approvals.ts +270 -0
- package/src/core/agents/claude-code/claude-agent.ts +175 -158
- package/src/core/agents/claude-code/credentials.ts +171 -0
- package/src/core/agents/claude-code/events.ts +55 -0
- package/src/core/agents/claude-code/login.ts +269 -0
- package/src/core/agents/claude-code/mcp.ts +206 -0
- package/src/core/agents/claude-code/models.ts +15 -9
- package/src/core/agents/claude-code/options.ts +326 -39
- package/src/core/agents/claude-code/outcome.ts +209 -0
- package/src/core/agents/claude-code/session-pool.ts +136 -0
- package/src/core/agents/claude-code/session.ts +513 -0
- package/src/core/agents/claude-code/spawn.ts +144 -0
- package/src/core/agents/claude-code/spend.ts +160 -0
- package/src/core/agents/claude-code/tools.ts +47 -0
- package/src/core/agents/claude-code/turn-usage.ts +135 -0
- package/src/core/agents/claude-code/turn.ts +232 -0
- package/src/core/agents/codex-app-server/adapter.ts +314 -117
- package/src/core/agents/codex-app-server/client.ts +186 -84
- package/src/core/agents/codex-app-server/codex-agent.ts +343 -0
- package/src/core/agents/codex-app-server/commands.ts +228 -0
- package/src/core/agents/codex-app-server/credentials.ts +126 -0
- package/src/core/agents/codex-app-server/effort.ts +29 -0
- package/src/core/agents/codex-app-server/events.ts +47 -0
- package/src/core/agents/codex-app-server/homes.ts +64 -0
- package/src/core/agents/codex-app-server/input.ts +60 -0
- package/src/core/agents/codex-app-server/items.ts +149 -0
- package/src/core/agents/codex-app-server/login.ts +180 -0
- package/src/core/agents/codex-app-server/mcp.ts +182 -37
- package/src/core/agents/codex-app-server/models.ts +99 -46
- package/src/core/agents/codex-app-server/options.ts +146 -0
- package/src/core/agents/codex-app-server/plan-approval.ts +135 -0
- package/src/core/agents/codex-app-server/protocol.ts +117 -0
- package/src/core/agents/codex-app-server/requests.ts +332 -0
- package/src/core/agents/codex-app-server/session.ts +285 -0
- package/src/core/agents/codex-app-server/subagents.ts +108 -42
- package/src/core/agents/codex-app-server/thread-settings.ts +279 -0
- package/src/core/agents/codex-app-server/turn-items.ts +88 -0
- package/src/core/agents/codex-app-server/turn.ts +463 -0
- package/src/core/agents/config-fingerprint.ts +7 -14
- package/src/core/agents/credentials.ts +98 -0
- package/src/core/agents/elicitation.ts +75 -0
- package/src/core/agents/inherit-config.ts +21 -0
- package/src/core/agents/login.ts +116 -0
- package/src/core/agents/mcp-config.ts +112 -8
- package/src/core/agents/plan.ts +25 -0
- package/src/core/agents/registry.ts +21 -4
- package/src/core/agents/session-agent.ts +96 -4
- package/src/core/agents/{session-store.ts → session-pool.ts} +11 -5
- package/src/core/agents/stderr-tail.ts +75 -0
- package/src/core/agents/types.ts +40 -5
- package/src/core/index.ts +58 -48
- package/src/core/presets.ts +100 -39
- package/src/core/processes/identity.ts +113 -0
- package/src/core/processes/lifeline.ts +170 -0
- package/src/core/processes/native-processes.ts +379 -0
- package/src/core/processes/process-table.ts +174 -0
- package/src/core/provision/cache-trust.ts +121 -0
- package/src/core/provision/cache-usage.ts +69 -0
- package/src/core/provision/checksums.ts +64 -0
- package/src/core/provision/extract.ts +11 -2
- package/src/core/provision/index.ts +4 -1
- package/src/core/provision/install-build.ts +136 -0
- package/src/core/provision/npm.ts +112 -17
- package/src/core/provision/pins.ts +9 -33
- package/src/core/provision/platform.ts +12 -1
- package/src/core/provision/provisioner.ts +329 -397
- package/src/core/provision/releases.ts +86 -0
- package/src/core/provision/tools.ts +329 -0
- package/src/core/proxy/anthropic-proxy.ts +55 -25
- package/src/core/proxy/api-key-store.ts +2 -12
- package/src/core/proxy/loopback.ts +106 -0
- package/src/core/runtime/agent-runtime.ts +327 -498
- package/src/core/runtime/event-processor.ts +197 -70
- package/src/core/runtime/harness-clis.ts +61 -0
- package/src/core/runtime/harness-logins.ts +328 -0
- package/src/core/runtime/login-reads.ts +78 -0
- package/src/core/runtime/model-lists.ts +33 -48
- package/src/core/runtime/permission-policy.ts +113 -0
- package/src/core/runtime/request-broker.ts +204 -0
- package/src/core/runtime/steering.ts +112 -0
- package/src/core/runtime/turn-outcome.ts +30 -0
- package/src/core/runtime/turn.ts +360 -0
- package/src/core/utils/bounded.ts +12 -0
- package/src/core/utils/deadline.ts +38 -0
- package/src/core/utils/errors.ts +113 -21
- package/src/core/utils/is-record.ts +4 -0
- package/src/core/utils/loopback.ts +10 -0
- package/src/protocol/account.ts +104 -0
- package/src/protocol/auth.ts +199 -0
- package/src/protocol/canonical.ts +16 -0
- package/src/protocol/clis.ts +69 -0
- package/src/protocol/config.ts +60 -6
- package/src/protocol/conversation.ts +272 -0
- package/src/protocol/credentials.ts +145 -0
- package/src/protocol/errors.ts +78 -20
- package/src/protocol/execution.ts +5 -2
- package/src/protocol/factories.ts +55 -7
- package/src/protocol/guards.ts +55 -2
- package/src/protocol/harness.ts +56 -6
- package/src/protocol/history.ts +72 -64
- package/src/protocol/ids.ts +0 -12
- package/src/protocol/index.ts +9 -0
- package/src/protocol/lifecycle.ts +250 -79
- package/src/protocol/meta-keys.ts +17 -0
- package/src/protocol/meta.ts +3 -3
- package/src/protocol/models.ts +2 -43
- package/src/protocol/part-input.ts +2 -1
- package/src/protocol/parts.ts +12 -3
- package/src/protocol/reduce.ts +302 -413
- package/src/protocol/selectors.ts +1 -20
- package/src/protocol/seq-cursor.ts +14 -0
- package/src/protocol/stop-reasons.ts +1 -1
- package/src/protocol/thinking.ts +1 -30
- package/src/protocol/time.ts +2 -2
- package/src/protocol/tool-closure.ts +93 -0
- package/src/protocol/tool-state.ts +19 -4
- package/src/protocol/verify.ts +222 -92
- package/src/protocol/vocabulary.ts +21 -5
- package/src/protocol/wire-api.ts +232 -0
- package/src/protocol/wire.ts +351 -64
- package/src/server/acp/binding.ts +63 -103
- package/src/server/acp/session-records.ts +53 -0
- package/src/server/acp/translate.ts +129 -20
- package/src/server/agent-server.ts +223 -387
- package/src/server/bin.ts +280 -78
- package/src/server/feedback.ts +204 -14
- package/src/server/history.ts +116 -122
- package/src/server/index.ts +3 -8
- package/src/server/install.ts +107 -8
- package/src/server/open-parts.ts +95 -0
- package/src/server/routes.ts +391 -0
- package/src/server/secrets.ts +24 -0
- package/src/server/session-gate.ts +69 -0
- package/src/server/session-log.ts +14 -2
- package/src/server/session-store.ts +136 -72
- package/src/server/subscriptions.ts +232 -0
- package/src/server/transports.ts +125 -25
- package/src/server/wire-error.ts +31 -45
- package/src/sync/event-log.ts +31 -3
- package/src/sync/fit.ts +27 -11
- package/src/sync/history-reader.ts +10 -5
- package/src/sync/history-sqlite.ts +37 -42
- package/src/sync/history.ts +9 -15
- package/src/sync/index.ts +17 -5
- package/src/sync/journal-sqlite.ts +162 -76
- package/src/sync/journal.ts +91 -32
- package/src/sync/live-tails.ts +107 -0
- package/src/sync/projection.ts +35 -0
- package/src/sync/recovery.ts +80 -51
- package/src/sync/schema.ts +27 -6
- package/docs/rfds/0001-deterministic-echo-ids.md +0 -44
- package/docs/rfds/0002-native-subagents.md +0 -197
- package/src/client/request.ts +0 -19
- package/src/core/agents/claude-code/generator-session.ts +0 -572
- package/src/core/agents/claude-code/session-manager.ts +0 -166
- package/src/core/agents/codex-app-server/codex-app-server-agent.ts +0 -962
- package/src/core/agents/codex-items.ts +0 -149
- package/src/core/agents/codex-sdk/adapter.ts +0 -237
- package/src/core/agents/codex-sdk/codex-sdk-agent.ts +0 -330
- package/src/core/agents/tool-meta.ts +0 -68
package/docs/deploy.md
CHANGED
|
@@ -2,32 +2,114 @@
|
|
|
2
2
|
|
|
3
3
|
## CLI provisioning (deterministic agents)
|
|
4
4
|
|
|
5
|
-
The native harnesses spawn real CLIs (`claude` ~220 MB, `codex` ~
|
|
5
|
+
The native harnesses spawn real CLIs (`claude` ~220 MB, `codex` ~320 MB
|
|
6
6
|
unpacked). Instead of trusting whatever version a host happens to have, the
|
|
7
|
-
engine
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
`
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
engine downloads **the builds this release pins** from the npm registry into
|
|
8
|
+
a local cache and installs them atomically, shared across processes. Nothing
|
|
9
|
+
needs to be installed on the machine first: no Node, npm or package manager,
|
|
10
|
+
only the system `tar` (macOS, Linux, Windows 10 and later have one). Three
|
|
11
|
+
modes (`--provision`, `$AGENT_SERVER_PROVISION`, or
|
|
12
|
+
`createAgentRuntime({ provision })`), each after the operator's override and
|
|
13
|
+
the bundle folders (below):
|
|
14
|
+
|
|
15
|
+
- **`auto`** (default): host install → managed cache → download. Zero-config:
|
|
16
|
+
uses what a lockfile installed, self-heals on bare machines.
|
|
17
|
+
- **`pinned`**: managed cache → download. Never trusts host installs —
|
|
15
18
|
every process in a fleet runs the exact tested build.
|
|
16
|
-
- **`system`**:
|
|
19
|
+
- **`system`**: host install only (a `codex` on `PATH` included). Never
|
|
20
|
+
downloads (air-gapped, "my machine, my CLIs").
|
|
17
21
|
|
|
18
|
-
"Host install" means
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
"Host install" means claude's platform package beside the installed Claude SDK
|
|
23
|
+
(the build that SDK would run), and an installed `@openai/codex` package for
|
|
24
|
+
codex (so your lockfile can pin it). A `codex` on `PATH` counts only in
|
|
25
|
+
`system` mode: anywhere else it is no build anyone chose for this engine, and
|
|
26
|
+
may be another app's private copy (Conductor puts its own on `PATH`), of
|
|
27
|
+
another version whose app-server may not run the turn (an older one fails
|
|
28
|
+
on the default model).
|
|
29
|
+
Overrides are operator-level only — `$CLAUDE_CLI_PATH` / `$CODEX_CLI_PATH` (or
|
|
22
30
|
`provision.overrides`), never wire config: a remote client must not choose the
|
|
23
31
|
executable a server spawns. Auth stays host-side either way: managed CLIs read
|
|
24
32
|
the same `~/.claude` / `~/.codex` (or per-turn `config.apiKey` BYOK) as your
|
|
25
33
|
own installs. Every resolution logs one stderr line
|
|
26
|
-
(`claude CLI: … (cache
|
|
34
|
+
(`claude CLI: … (cache <version>)`) so runs are diagnosable.
|
|
35
|
+
|
|
36
|
+
**What a download must match.** `src/core/provision/releases.ts`, generated by
|
|
37
|
+
`bun run releases:refresh` when a pin moves, holds each platform's npm
|
|
38
|
+
integrity for the pinned versions and, for Claude, the binary's sha256 from
|
|
39
|
+
Anthropic's signed release manifest (the script verifies its signature). A
|
|
40
|
+
download is checked against that table, whatever registry serves it, so a
|
|
41
|
+
mirror (`$AGENT_SERVER_NPM_REGISTRY`) works and cannot hand out another
|
|
42
|
+
build: one that states another checksum is refused before anything
|
|
43
|
+
downloads, and a Claude binary that is not the one Anthropic signed is never
|
|
44
|
+
installed. (npm itself never changes a published version's bytes; the table
|
|
45
|
+
is what holds a mirror to them.) A version the table does not pin (an
|
|
46
|
+
operator's `provision.pins`) is checked against the installed Claude SDK's
|
|
47
|
+
manifest when it names that version, else against the registry's checksum
|
|
48
|
+
only, and the log says so once.
|
|
49
|
+
|
|
50
|
+
**A product that bundles the Claude SDK** (an ESM or single-file build of its
|
|
51
|
+
own) sets `provision.pins.claude` to the SDK's version: nothing on disk says
|
|
52
|
+
which SDK runs, so the engine runs the CLI of its own pin and logs that once.
|
|
53
|
+
Within a compiled `agent-server` binary the pin is the SDK it bundles.
|
|
27
54
|
|
|
28
55
|
Pins live in `src/core/provision/pins.ts`: the claude pin tracks the
|
|
29
56
|
lockfile's `@anthropic-ai/claude-agent-sdk` version (test-enforced); the codex
|
|
30
57
|
pin is the version the app-server adapter's protocol was verified against.
|
|
58
|
+
After a bump, `bun run releases:refresh` and `bun run models:refresh` (both
|
|
59
|
+
test-enforced).
|
|
60
|
+
|
|
61
|
+
**The cache.** Version-keyed (`<cache>/claude/<version>-<platform>/…`), so
|
|
62
|
+
image layers and shared volumes dedupe naturally. Processes that cold-start
|
|
63
|
+
together on one cache each download, and the build's atomic rename leaves one
|
|
64
|
+
copy (four at once took 15.8 s instead of 4.9 s): bake the CLIs into the
|
|
65
|
+
image instead. A request that gets no response within 30 s (headers or
|
|
66
|
+
body), a download that receives nothing for 30 s, or a `tar` still running
|
|
67
|
+
after 5 min fails rather than holding a turn. Each use of a build is
|
|
68
|
+
recorded (again hourly while a process keeps resolving it), and after each
|
|
69
|
+
download builds whose recorded use is 14 days old are removed: several
|
|
70
|
+
products may share one cache, each keeping its own pins by using them.
|
|
71
|
+
`agent-server install --prune` also removes builds no use was ever recorded
|
|
72
|
+
for, by when they were installed: agent-server 0.3.18 and earlier record
|
|
73
|
+
none, and may be running them. A desktop app names a cache folder of its own
|
|
74
|
+
(`provision.cacheDir`), so removing the app removes its CLIs. The cache root
|
|
75
|
+
is created `0o700` and must be owned by the running user. On POSIX, its
|
|
76
|
+
ancestors must be owned by that user or root and must not be writable by
|
|
77
|
+
other users; trusted sticky shared parents such as `/tmp` are supported.
|
|
78
|
+
A symlink at the cache root is refused. Trusted ancestor aliases (including
|
|
79
|
+
macOS `/var`) resolve to canonical paths, which remain pinned for that
|
|
80
|
+
provisioner instance. Managed executables and their parent directories are
|
|
81
|
+
checked again on reuse, including memo hits. These uid/mode checks assume
|
|
82
|
+
trusted same-user/root code and do not evaluate filesystem ACLs.
|
|
83
|
+
|
|
84
|
+
Managed Claude processes run with `DISABLE_AUTOUPDATER=1`, whatever the environment says: the build that runs
|
|
85
|
+
is the one the provisioner chose.
|
|
86
|
+
|
|
87
|
+
## Ready before the first turn
|
|
88
|
+
|
|
89
|
+
A turn whose CLI is not installed installs it first, about 100 MB per
|
|
90
|
+
harness: a few seconds on a good connection, during which the turn's own
|
|
91
|
+
stream says nothing. A product installs at setup instead, and shows it:
|
|
92
|
+
|
|
93
|
+
```ts
|
|
94
|
+
// in-process
|
|
95
|
+
runtime.onCliProgress(show); // ({ harness, version, phase, receivedBytes, totalBytes }) => …
|
|
96
|
+
await runtime.prepareClis(["claude-code"]); // [{ harness, state: "ready", version, source }]
|
|
97
|
+
|
|
98
|
+
// over the wire (a server in a sandbox): every connection hears `clis/progress`
|
|
99
|
+
client.onCliProgress(show);
|
|
100
|
+
await client.prepareClis(["claude-code"]);
|
|
101
|
+
await client.listClis(); // ready | missing | installing | failed | unmanaged, installing nothing
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
`prepareClis` joins an install already running and answers once each CLI is
|
|
105
|
+
ready or failed (`error` says why); it never throws for a failed install.
|
|
106
|
+
Over the wire, `clis/prepare` answers at once (`installing`), since an
|
|
107
|
+
install outlasts a request's timeout, and the client waits on `clis/progress`
|
|
108
|
+
and `clis/list`. `missing` without a `version` means the server installs
|
|
109
|
+
nothing (`system`): that harness cannot run there. A download's errors,
|
|
110
|
+
in a turn's error as in `clis/*`, carry URLs without their credentials or
|
|
111
|
+
query. The CLI says a download's start,
|
|
112
|
+
its quarters and its end, and `/info` shows the session harness's CLI.
|
|
31
113
|
|
|
32
114
|
## Single binary & sandbox cold starts
|
|
33
115
|
|
|
@@ -43,61 +125,150 @@ bun build --compile packages/agent-server/src/server/bin.ts --outfile dist/agent
|
|
|
43
125
|
|
|
44
126
|
On macOS 27, binaries compiled by Bun 1.3.x carry an invalid signature and
|
|
45
127
|
are killed at launch (exit 137, no output). Compile with Bun 1.4.2 or newer,
|
|
46
|
-
or re-sign: `codesign --force --sign - dist/agent-server`.
|
|
128
|
+
or re-sign: `codesign --force --sign - dist/agent-server`. On Alpine, Bun's
|
|
129
|
+
musl build needs `apk add libstdc++ libgcc`.
|
|
47
130
|
|
|
48
131
|
Inside a compiled binary the Claude SDK can't reach its platform package, so
|
|
49
132
|
provisioning is what makes the binary *work*: first turn on a bare machine
|
|
50
|
-
downloads the pinned CLIs (~
|
|
133
|
+
downloads the pinned CLIs (~5 s in a datacenter, both in parallel), every
|
|
51
134
|
later boot resolves from cache instantly.
|
|
52
135
|
|
|
53
136
|
For sandboxes (E2B, Modal, Fly, plain Docker), erase even that first-turn cost
|
|
54
|
-
by prefetching **at image build time
|
|
137
|
+
by prefetching **at image build time**, never when a sandbox is created:
|
|
55
138
|
|
|
56
139
|
```dockerfile
|
|
57
140
|
FROM debian:bookworm-slim
|
|
58
|
-
|
|
141
|
+
# the agents' own API calls need the system's CA certificates
|
|
142
|
+
RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*
|
|
59
143
|
COPY dist/agent-server /usr/local/bin/agent-server
|
|
60
144
|
# bake the pinned CLIs into the image → zero downloads at runtime
|
|
61
145
|
RUN agent-server install
|
|
62
146
|
ENV ANTHROPIC_API_KEY="" # or mount ~/.claude / ~/.codex at runtime
|
|
63
|
-
|
|
147
|
+
# every interface of the container, so a token is required (see Trust boundary)
|
|
148
|
+
ENTRYPOINT ["agent-server", "--provision", "pinned", "--listen", "0.0.0.0:4747", \
|
|
149
|
+
"--token-file", "/run/secrets/agent-server-token"]
|
|
64
150
|
```
|
|
65
151
|
|
|
152
|
+
```sh
|
|
153
|
+
# The token from a private file (chmod 600), mounted read-only, and the port
|
|
154
|
+
# published on the host's loopback or a private interface (-p 10.0.0.5:4747:4747),
|
|
155
|
+
# never on all of the host's interfaces.
|
|
156
|
+
docker run -p 127.0.0.1:4747:4747 \
|
|
157
|
+
-v "$PWD/agent-server-token:/run/secrets/agent-server-token:ro" agent-server
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Or drop `--token-file` and pass `-e AGENT_SERVER_TOKEN`: the name alone copies
|
|
161
|
+
the value from your environment without putting it on a command line. Clients
|
|
162
|
+
send the same token: `AgentServerClient.connect(url, { token })`, or the CLI's
|
|
163
|
+
`--connect` with `$AGENT_SERVER_TOKEN` set. A client can ask such a server
|
|
164
|
+
`clis/list` before its first turn; a sandbox without baked CLIs is prepared
|
|
165
|
+
remotely with `clis/prepare`, its progress streaming back.
|
|
166
|
+
|
|
66
167
|
`agent-server install` respects `--harness a,b` (only fetch what you run) and
|
|
67
168
|
`$AGENT_SERVER_CACHE_DIR` (e.g. point it at a persistent volume instead of
|
|
68
|
-
baking).
|
|
69
|
-
(`<cache>/claude/0.3.168-darwin-arm64/…`), so image layers and shared volumes
|
|
70
|
-
dedupe naturally and concurrent cold starts converge on one copy. The cache
|
|
71
|
-
root is created `0o700` and must be owned by the running user. On POSIX, its
|
|
72
|
-
ancestors must be owned by that user or root and must not be writable by
|
|
73
|
-
other users; trusted sticky shared parents such as `/tmp` are supported.
|
|
74
|
-
A symlink at the cache root is refused. Trusted ancestor aliases (including
|
|
75
|
-
macOS `/var`) resolve to canonical paths, which remain pinned for that
|
|
76
|
-
provisioner instance. Managed executables and their parent directories are
|
|
77
|
-
checked again on reuse, including memo hits. These uid/mode checks assume
|
|
78
|
-
trusted same-user/root code and do not evaluate filesystem ACLs.
|
|
169
|
+
baking).
|
|
79
170
|
|
|
80
|
-
Measured
|
|
81
|
-
`install
|
|
82
|
-
|
|
83
|
-
|
|
171
|
+
Measured (2026-10-31, `debian:bookworm-slim` arm64 under Docker, from a home
|
|
172
|
+
connection): `install` of both CLIs 5 s; a cold sandbox prepared over the
|
|
173
|
+
wire, ready in 5.7 s. In a live E2B sandbox (x86_64 Ubuntu, 2026-07): sandbox
|
|
174
|
+
create 0.7 s, `install --harness claude-code` 3.0 s (71 MB, verified), first
|
|
175
|
+
real Claude turn over the wire (BYOK `config.apiKey`) **2.0 s**. With the CLIs
|
|
176
|
+
baked into the template, boot-to-first-token is effectively sandbox-create +
|
|
177
|
+
turn time.
|
|
84
178
|
|
|
85
|
-
|
|
179
|
+
### A sandbox with no login of its own
|
|
180
|
+
|
|
181
|
+
A sandbox image carries no login: start its engine with the product's
|
|
182
|
+
credential endpoint, and each turn asks it for the person's credential
|
|
183
|
+
(LLP 0012; [consuming.md](consuming.md#hold-the-login-yourself-for-sandboxes-and-other-devices)):
|
|
86
184
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
185
|
+
```sh
|
|
186
|
+
AGENT_SERVER_CREDENTIALS_TOKEN=<this sandbox's token> \
|
|
187
|
+
agent-server --listen 0.0.0.0:4747 --token-file /run/agent-server/token \
|
|
188
|
+
--credentials-url https://product.example/agent-credentials
|
|
189
|
+
```
|
|
91
190
|
|
|
92
|
-
|
|
191
|
+
Claude's credential stays in the engine (its proxy on 127.0.0.1), not in the
|
|
192
|
+
CLI's environment its tools can read; Codex keeps ChatGPT tokens in memory.
|
|
93
193
|
|
|
94
|
-
|
|
95
|
-
|
|
194
|
+
## App bundles and images for another machine
|
|
195
|
+
|
|
196
|
+
A desktop app that ships its CLIs (to run offline, or to show no download)
|
|
197
|
+
stages them at build time, for each platform it ships, from any machine:
|
|
96
198
|
|
|
97
199
|
```sh
|
|
98
|
-
|
|
200
|
+
agent-server install --platform darwin-arm64,darwin-x64 --dir build/agent-clis
|
|
99
201
|
```
|
|
100
202
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
203
|
+
`--dir` writes the cache's layout into a new or empty folder (or one it wrote
|
|
204
|
+
before; any other is refused, as staging opens what it writes to every
|
|
205
|
+
user), makes the builds it staged readable by every user, never through a
|
|
206
|
+
symlink, and leaves out the install's records; `--harness` selects
|
|
207
|
+
as usual. Where it runs, the app names the folder: `provision.bundleDirs`
|
|
208
|
+
(or `$AGENT_SERVER_BUNDLE_DIR`, a path list). A bundle folder is used in
|
|
209
|
+
every mode when it holds the version this engine runs, before the host and
|
|
210
|
+
the cache, and reports `source: "bundled"`; one that holds another version
|
|
211
|
+
(an agent-server upgrade the build did not restage) is passed over, so the
|
|
212
|
+
pinned build downloads instead of a stale one running. A bundle folder is
|
|
213
|
+
the operator's, like the overrides: what it holds runs, a regular file (a
|
|
214
|
+
symlink could redirect the spawn) whoever owns it. Its binaries' hashes are
|
|
215
|
+
not checked, since an app that signs them again (macOS notarization) changes
|
|
216
|
+
them, and its own signature is then what protects them. Staging opens the
|
|
217
|
+
builds to every user because an owner-only tree baked into an image and run
|
|
218
|
+
as another user fails with `Permission denied`. `--provision system` with a
|
|
219
|
+
bundle folder never downloads.
|
|
220
|
+
|
|
221
|
+
## Trust boundary
|
|
222
|
+
|
|
223
|
+
A `--listen` server runs agents, and their tools, for whoever connects, so it
|
|
224
|
+
answers only what it can tell is its client (LLP 0001, D16):
|
|
225
|
+
|
|
226
|
+
- **Browsers are refused.** Any page a user visits may open a WebSocket to
|
|
227
|
+
localhost (CORS does not apply to WebSockets), so an upgrade that carries an
|
|
228
|
+
`Origin` header gets 403 unless `--allow-origin <origin>` names that origin
|
|
229
|
+
exactly as the browser sends it (`https://app.example`, `tauri://localhost`;
|
|
230
|
+
no wildcards, never `null`). Native clients send no `Origin`: the bundled
|
|
231
|
+
client, the CLI, Bun's and Node's WebSocket.
|
|
232
|
+
- **Beyond loopback, a token.** With `--token-file <path>` or
|
|
233
|
+
`$AGENT_SERVER_TOKEN`, every upgrade must carry `Authorization: Bearer
|
|
234
|
+
<token>`, or gets 401, which a client reports as `ConnectionRefusedError`
|
|
235
|
+
rather than redialing (the CLI says which token to set). A listener on any host but 127.0.0.0/8, `::1` or
|
|
236
|
+
`localhost` refuses to start without one; on loopback it is optional,
|
|
237
|
+
against the machine's other users. Keep the file private (`chmod 600`; the
|
|
238
|
+
server warns when others can read it), and never put the token on a command
|
|
239
|
+
line: `ps` shows argv to every user, so `--token` is refused. A browser
|
|
240
|
+
cannot send the header, so a renderer that connects directly does so to a
|
|
241
|
+
loopback listener without a token.
|
|
242
|
+
- **TLS is yours.** The server speaks plain `ws://`: put a TLS-terminating
|
|
243
|
+
proxy (`wss://`) in front of a listener other machines reach, or keep it on
|
|
244
|
+
a private network. The token authenticates the connection, not a user.
|
|
245
|
+
|
|
246
|
+
The stdio wire inherits the trust of whoever spawned the process. `--dial`
|
|
247
|
+
connects out, so nothing reaches it. With `$AGENT_SERVER_DIAL_TOKEN` set it
|
|
248
|
+
sends `Authorization: Bearer <token>` on every dial and redial: the
|
|
249
|
+
credential this server presents to the platform it dials, where
|
|
250
|
+
`$AGENT_SERVER_TOKEN` is the one a listener's clients present to it. Never
|
|
251
|
+
put it in the URL, where `?token=` ends up in logs, or on argv, which `ps`
|
|
252
|
+
shows; an embedder's `dial(server, url, { headers })` sends its own the same
|
|
253
|
+
way. Dial a `wss://` URL for a platform beyond this machine: over `ws://`
|
|
254
|
+
the token crosses the network in the clear.
|
|
255
|
+
|
|
256
|
+
## What a turn loads
|
|
257
|
+
|
|
258
|
+
At `--inherit-config all`, the default, a turn loads the server user's own
|
|
259
|
+
Claude and Codex settings, MCP servers and memory as well as the
|
|
260
|
+
repository's configuration. In a cloud sandbox, start the server at
|
|
261
|
+
`--inherit-config project` for repositories you trust and `none` for any
|
|
262
|
+
other (LLP 0001, D17): a repository whose configuration loads runs its hooks
|
|
263
|
+
and `.mcp.json` servers as the server's user, with no trust prompt, and one
|
|
264
|
+
`env` line in it can send the turn's API traffic and its credential
|
|
265
|
+
elsewhere. Keep real provider keys out of the agent's environment: the BYOK
|
|
266
|
+
proxy (`@zvada/agent-server/core/proxy`) hands the agent a placeholder key
|
|
267
|
+
and swaps in the real one. Below `all`, every Codex turn names a
|
|
268
|
+
`CODEX_HOME` of its session's own (`config.env.CODEX_HOME`), whose login the
|
|
269
|
+
host hands over with `credentials` or the turn's `apiKey`.
|
|
270
|
+
See [Choose what a turn inherits](consuming.md#choose-what-a-turn-inherits).
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
274
|
+
Something here wrong, unclear or missing? [Report it to the maintainers](feedback.md).
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
# Durable sessions and shared history
|
|
1
|
+
# Durable sessions and shared history
|
|
2
2
|
|
|
3
3
|
An optional journal makes agent-server sessions survive process restarts: every
|
|
4
4
|
admitted turn and every event is committed before it is acknowledged or
|
|
5
5
|
delivered. The same journal serves each session's history over one portable
|
|
6
6
|
history protocol (`history/*`), so other hosts can copy, follow, cache and fork
|
|
7
|
-
it without running an agent.
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
it without running an agent. [The integration guide](sync-integration.md) shows
|
|
8
|
+
how a host adopts it, and [shared history](sync-history.md) documents the
|
|
9
|
+
history SDK.
|
|
10
10
|
|
|
11
11
|
Agent-server owns admission receipts, event ordering, local persistence, replay
|
|
12
|
-
and the history contract
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
and the history contract, and the native agent processes it starts:
|
|
13
|
+
shared execution infrastructure. The product owns identity, authorization,
|
|
14
|
+
machine registration, cloud storage, routing, retention, its views, the server
|
|
15
|
+
process and anything it starts with its own spawner.
|
|
15
16
|
|
|
16
17
|
```mermaid
|
|
17
18
|
flowchart LR
|
|
@@ -43,7 +44,8 @@ import { AgentServer, listen } from "@zvada/agent-server/server";
|
|
|
43
44
|
import { SqliteSessionJournal } from "@zvada/agent-server/sync/sqlite"; // Node: NodeSqliteSessionJournal from /sync/node-sqlite
|
|
44
45
|
|
|
45
46
|
const journal = new SqliteSessionJournal("./data/sessions.sqlite");
|
|
46
|
-
|
|
47
|
+
// `open` stops what a previous owner left running before it takes the journal.
|
|
48
|
+
const server = await AgentServer.open(createAgentRuntime(), {
|
|
47
49
|
journal,
|
|
48
50
|
history: { store: journal.history, authorize: (transport, ref, op) => acl.allows(transport, ref, op) },
|
|
49
51
|
onJournalError: (error) => console.error("journal failed; restart recovers", error),
|
|
@@ -53,7 +55,9 @@ listen(server, { hostname: "127.0.0.1", port: 4747 });
|
|
|
53
55
|
```
|
|
54
56
|
|
|
55
57
|
The server takes execution ownership of the journal (one owner per journal; a
|
|
56
|
-
second `AgentServer` on it throws) and releases it on shutdown.
|
|
58
|
+
second `AgentServer` on it throws) and releases it on shutdown. Open it with
|
|
59
|
+
`AgentServer.open`, which runs the restart sweep first (step 5); the
|
|
60
|
+
constructor skips it and fences every session a restart cut off. The host opens
|
|
57
61
|
the journal and closes it after shutdown. SQLite runs in WAL with
|
|
58
62
|
`synchronous=FULL` and an exclusive lock, so a second process cannot open the
|
|
59
63
|
file; serve other readers over the wire.
|
|
@@ -68,20 +72,25 @@ file; serve other readers over the wire.
|
|
|
68
72
|
| `turn/get` | A turn's receipt: `admitted`, `completed` or `interrupted`, its input and terminal event. |
|
|
69
73
|
| `session/get` | `headSeq`, `nativeSessionId`, `closed`, `recoveryRequired`. |
|
|
70
74
|
| `session/confirmStopped` | Lifts the fence a restart put on a session, fenced by `expectedHeadSeq`. |
|
|
75
|
+
| `session/release` | Lets an idle session's agent go (its process, a Codex home it holds) and keeps the session open. Its next turn names its native conversation (`resumeRequired` until it does), as after a restart. Nothing is broadcast: another client of the session meets `resumeRequired` on its next turn. `released: false` for no open session by that id; `turnActive` while a turn runs. |
|
|
71
76
|
| `history/*` | Opt-in (`history` option): the [history protocol](sync-history.md). |
|
|
72
77
|
|
|
73
|
-
The
|
|
74
|
-
|
|
78
|
+
The four journal-only methods answer `methodNotFound` on volatile servers,
|
|
79
|
+
where `session/close` is what frees a session.
|
|
80
|
+
Refusals have their own codes; anything else is an `internalError`. What a
|
|
81
|
+
refusal carries in `data` is typed by `WIRE_REFUSAL_DATA`, and
|
|
82
|
+
`refusalData(error, "resumeRequired")` (from `/client`) reads it:
|
|
75
83
|
|
|
76
84
|
| Code | Meaning | `data` |
|
|
77
85
|
| --- | --- | --- |
|
|
78
86
|
| `turnConflict` (-32006) | The turn id was admitted with other input. | `turnId` |
|
|
79
87
|
| `sessionClosed` (-32007) | A closed durable session id is never reused. | |
|
|
80
|
-
| `recoveryRequired` (-32008) | A restart cut off the session's last turn. | `headSeq` |
|
|
88
|
+
| `recoveryRequired` (-32008) | A restart cut off the session's last turn. | `headSeq`, `reason` |
|
|
81
89
|
| `resumeRequired` (-32009) | This process has not run the session: pass its native id as `config.resumeSessionId`. | `nativeSessionId` |
|
|
82
90
|
| `notAuthorized` (-32010) | The host refused a history operation. | |
|
|
83
91
|
| `unknownHistory` (-32011) | No such history, or not at that version. | |
|
|
84
|
-
| `historyConflict` (-32012) | Contradicts committed history: payload, hash, stale expected head or reused commit id. | |
|
|
92
|
+
| `historyConflict` (-32012) | Contradicts committed history: payload, hash, stale expected head or reused commit id. | `headSeq`, for a stale `session/confirmStopped` |
|
|
93
|
+
| `unknownTurn` (-32013) | `turn/get` for a turn the session never admitted (`unknownSession` when the session itself is unknown). | |
|
|
85
94
|
|
|
86
95
|
A request the journal cannot store (an id over 512 characters, input over the
|
|
87
96
|
record limit, `includeRaw`) is `invalidParams`, never a server fault.
|
|
@@ -111,56 +120,59 @@ record limit, `includeRaw`) is `invalidParams`, never a server fault.
|
|
|
111
120
|
did.
|
|
112
121
|
5. **Restart recovery.** Taking ownership ends every turn a previous owner left
|
|
113
122
|
admitted: pending permissions resolve as cancelled, running tools fail with
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
123
|
+
their outcome unknown (`closure: "interrupted"`), streaming parts end with
|
|
124
|
+
what they had streamed, open messages end, and the turn ends `error` with
|
|
125
|
+
the category `server_restart`, so the history still passes
|
|
126
|
+
`verifyStreamContract`. The receipt keeps its input and becomes
|
|
127
|
+
`interrupted`. Nothing is rerun. Before it takes ownership, `AgentServer.open`
|
|
128
|
+
stops what the dead owner left running: every native process is recorded
|
|
129
|
+
(pid, boot, start time, executable) before it gets work, and each record
|
|
130
|
+
that still names its running process is stopped with its tool sessions; a
|
|
131
|
+
pid now naming another process is left alone. The session is fenced
|
|
132
|
+
(`recoveryRequired`) only when its agent could not be confirmed stopped,
|
|
133
|
+
and says why (`recoveryReason`: `not_owned`, a host's own spawner started
|
|
134
|
+
it; `not_verified`; `not_stopped`, it survived SIGKILL); a host checks it
|
|
135
|
+
and confirms (`session/confirmStopped`). Either way the next turn resumes
|
|
136
|
+
the native session explicitly (`resumeRequired` names it). The turn's error
|
|
137
|
+
message says which it was.
|
|
138
|
+
|
|
139
|
+
While the server lives, its lifeline (one `/bin/sh` per process, holding a
|
|
140
|
+
pipe from it) stops every agent and tool it started when the server dies
|
|
141
|
+
in any way, SIGKILL included: within its 3 s grace (LLP 0007). The sweep is
|
|
142
|
+
for when the lifeline was lost too.
|
|
119
143
|
|
|
120
144
|
No exactly-once external tool execution is claimed: a tool may act before its
|
|
121
145
|
next event is recorded.
|
|
122
146
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
`commits` and `checkpoints` serve branches and cached projections.
|
|
130
|
-
`EventLog.append` is the one write path for execution, commits, imports and
|
|
131
|
-
recovery. Nothing has shipped, so there are no migrations; a journal from the
|
|
132
|
-
earlier experiment layout is refused.
|
|
147
|
+
A client sees the server it follows change: `client.onConnection` reports
|
|
148
|
+
each drop, redial and reconnect, and `serverChanged` when the server behind
|
|
149
|
+
the address no longer holds the logs it followed (another journal, none, or a
|
|
150
|
+
volatile restart). A session continued there begins a new history, and its
|
|
151
|
+
native conversation continues only when the turn names it
|
|
152
|
+
(`config.resumeSessionId`); the repository CLI says so and names it.
|
|
133
153
|
|
|
134
|
-
|
|
135
|
-
tables):
|
|
154
|
+
## Storage
|
|
136
155
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
event) with the same WAL. Delta keeps a durable outbox because its history is a
|
|
158
|
-
DAG; a linear log's destination head already is the outbox, so no receipts are
|
|
159
|
-
stored locally.
|
|
160
|
-
|
|
161
|
-
## Outside this experiment
|
|
162
|
-
|
|
163
|
-
- No AGNT/Deus integration, public relay, deployment or credential exchange.
|
|
156
|
+
One schema, `user_version` 6, in `src/sync/schema.ts`; a file of any other
|
|
157
|
+
version is refused, never migrated. It stores no token deltas and no
|
|
158
|
+
snapshots of a part while it streams: a streaming part's history is its
|
|
159
|
+
opening, the changes its harness reports and its end (a 13,891-character
|
|
160
|
+
answer is 2 records, 14.6 KB). What it streamed since its last kept snapshot
|
|
161
|
+
is in `live_tails`, a row per delta, outside every history, written before the
|
|
162
|
+
delta is delivered and deleted with the part's next kept snapshot or its
|
|
163
|
+
turn's end, so recovery closes the part with what was shown (LLP 0003,
|
|
164
|
+
LLP 0008). Every
|
|
165
|
+
history this file holds, executed here or copied in, is a `histories` row
|
|
166
|
+
(descriptor and head) and `events` rows `(source_id, session_id, seq, hash,
|
|
167
|
+
body)`: the canonical event JSON with its hash inline. `sessions` and `turns`
|
|
168
|
+
hold execution state; `native_processes` the agent processes its owners
|
|
169
|
+
started, until each is seen gone; `commits` and `checkpoints` serve branches
|
|
170
|
+
and cached projections. `EventLog.append` is the one write path for execution, commits,
|
|
171
|
+
imports and recovery.
|
|
172
|
+
|
|
173
|
+
## Not covered
|
|
174
|
+
|
|
175
|
+
- No product integration, public relay, deployment or credential exchange.
|
|
164
176
|
- Retention, compaction, blob offload and erasure are not implemented.
|
|
165
177
|
- One writer per session. Copying an active journal into two writable stores is
|
|
166
178
|
unsupported; fork instead.
|
|
@@ -171,20 +183,13 @@ stored locally.
|
|
|
171
183
|
|
|
172
184
|
## Verification
|
|
173
185
|
|
|
174
|
-
From a checkout of this repository:
|
|
175
|
-
|
|
176
|
-
```sh
|
|
177
|
-
bun run test packages/agent-server/test/sync # real Bun and Node SQLite, sockets, SIGKILL
|
|
178
|
-
bun run control-agent-server replay session-sync --live-model
|
|
179
|
-
```
|
|
180
|
-
|
|
181
186
|
The deterministic suite covers admission and refusals, recovery and fencing,
|
|
182
187
|
sink failure, lost acknowledgements, tamper rollback, paged replay, the hash
|
|
183
|
-
format and owner exclusion
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
188
|
+
format and owner exclusion, against real Bun and Node SQLite, sockets and
|
|
189
|
+
SIGKILL. Live drills in the source repository run the real CLI and models
|
|
190
|
+
through restarts, crashes, dropped connections, forks, the managed worker,
|
|
191
|
+
checkpoints and a separate Node viewer.
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
Something here wrong, unclear or missing? [Report it to the maintainers](feedback.md).
|