@zvada/agent-server 0.3.17 → 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 +1060 -0
- package/README.md +50 -26
- 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 +460 -54
- package/docs/deploy.md +218 -47
- package/docs/durable-sessions.md +195 -0
- package/docs/feedback.md +116 -0
- package/docs/harnesses.md +219 -87
- package/docs/sync-history.md +197 -0
- package/docs/sync-integration.md +119 -0
- package/package.json +53 -23
- 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 +641 -602
- package/src/client/connection.ts +371 -0
- package/src/client/history.ts +65 -0
- 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 +60 -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 +11 -34
- 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 +340 -481
- package/src/core/runtime/event-processor.ts +207 -75
- package/src/core/runtime/event-sink.ts +45 -2
- 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 +57 -57
- 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 +275 -0
- package/src/protocol/ids.ts +4 -17
- package/src/protocol/index.ts +10 -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 +425 -57
- 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 +275 -366
- package/src/server/bin.ts +295 -72
- package/src/server/feedback.ts +204 -14
- package/src/server/history.ts +160 -0
- package/src/server/index.ts +4 -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 +289 -0
- package/src/server/subscriptions.ts +232 -0
- package/src/server/transports.ts +125 -25
- package/src/server/wire-error.ts +38 -0
- package/src/sync/event-log.ts +160 -0
- package/src/sync/fit.ts +140 -0
- package/src/sync/history-reader.ts +57 -0
- package/src/sync/history-sqlite.ts +339 -0
- package/src/sync/history.ts +220 -0
- package/src/sync/index.ts +18 -0
- package/src/sync/journal-sqlite.ts +439 -0
- package/src/sync/journal.ts +132 -0
- package/src/sync/live-tails.ts +107 -0
- package/src/sync/node-sqlite.ts +20 -0
- package/src/sync/projection.ts +35 -0
- package/src/sync/recovery.ts +141 -0
- package/src/sync/retry.ts +49 -0
- package/src/sync/schema.ts +77 -0
- package/src/sync/sql.ts +106 -0
- package/src/sync/sqlite-file.ts +38 -0
- package/src/sync/sqlite.ts +21 -0
- package/src/sync/worker.ts +259 -0
- package/docs/rfds/0001-deterministic-echo-ids.md +0 -44
- package/docs/rfds/0002-native-subagents.md +0 -197
- 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
|
@@ -0,0 +1,1190 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type Part, type UnknownPart } from "./parts.ts";
|
|
3
|
+
/**
|
|
4
|
+
* The normalized event stream every harness is funneled into. Consumers (a WS
|
|
5
|
+
* bridge, an SSE endpoint, a CLI, a test sink) subscribe to these and never see
|
|
6
|
+
* raw SDK payloads. All keys are camelCase; serialize at your transport edge.
|
|
7
|
+
* Every event carries `sessionId`, `timestamp` (epoch ms), and `_meta`.
|
|
8
|
+
*
|
|
9
|
+
* Ordering within a turn:
|
|
10
|
+
* turn.started
|
|
11
|
+
* -> [ USER ECHO: message.started{role:"user", outputIndex:0}
|
|
12
|
+
* -> message.part* -> message.ended ]
|
|
13
|
+
* -> ( message.started{role:"assistant"} -> message.part*
|
|
14
|
+
* / message.part.delta* -> message.ended )*
|
|
15
|
+
* -> turn.ended
|
|
16
|
+
* session.created lands WHEN THE HARNESS FIRST REPORTS its native session id
|
|
17
|
+
* — its first yield — so arriving MID-TURN, after the echo and before the
|
|
18
|
+
* first assistant message, is the normal case rather than an anomaly. It
|
|
19
|
+
* cannot be hoisted: the id does not exist until the harness produces it,
|
|
20
|
+
* and holding the echo back for it would delay the transcript of every turn
|
|
21
|
+
* on a subprocess spawn. It comes when it says something new (the session's
|
|
22
|
+
* first native id, a new one, or a resume that did not continue), not on
|
|
23
|
+
* every turn. Persist it whenever it arrives; never treat it as a turn
|
|
24
|
+
* preamble.
|
|
25
|
+
* session.compaction may appear anywhere within a turn (position = first
|
|
26
|
+
* appearance). permission.*, elicitation.* and raw interleave anywhere
|
|
27
|
+
* within a turn.
|
|
28
|
+
* session.ended may follow at any later point.
|
|
29
|
+
*
|
|
30
|
+
* Exceptions to strict message bracketing:
|
|
31
|
+
* - a `message.part` may arrive after its message (or turn) ended — a tool
|
|
32
|
+
* completing late. The event's `messageId` names the ORIGINAL message and
|
|
33
|
+
* the upsert lands there.
|
|
34
|
+
* - snapshots are authoritative over deltas: a content-bearing `message.part`
|
|
35
|
+
* wipes the delta accumulator for that part; later deltas append to the
|
|
36
|
+
* replacement. A non-terminal snapshot carries the complete content so far,
|
|
37
|
+
* including earlier deltas, rather than a fragment to append.
|
|
38
|
+
*/
|
|
39
|
+
/**
|
|
40
|
+
* Why a turn stopped (ACP StopReason verbatim, plus `error`). Normalized
|
|
41
|
+
* terminal status; the raw provider string travels in `finishReason`.
|
|
42
|
+
*
|
|
43
|
+
* OPEN: `_`-prefixed values are adapter extensions; unknown non-`_` values are
|
|
44
|
+
* reserved for this protocol and MUST be preserved. `refusal` covers provider
|
|
45
|
+
* content-filter/safety stops.
|
|
46
|
+
*/
|
|
47
|
+
export declare const STOP_REASONS: readonly ["end_turn", "max_tokens", "max_turn_requests", "refusal", "cancelled", "error"];
|
|
48
|
+
export type StopReason = (typeof STOP_REASONS)[number] | (string & {});
|
|
49
|
+
export declare const StopReasonSchema: z.ZodType<"error" | (string & {}) | "cancelled" | "end_turn" | "max_tokens" | "max_turn_requests" | "refusal", unknown, z.core.$ZodTypeInternals<"error" | (string & {}) | "cancelled" | "end_turn" | "max_tokens" | "max_turn_requests" | "refusal", unknown>>;
|
|
50
|
+
/** Why a session ended. OPEN. `closed`: `session/close` released it. */
|
|
51
|
+
export declare const SESSION_END_REASONS: readonly ["closed"];
|
|
52
|
+
export type SessionEndReason = (typeof SESSION_END_REASONS)[number] | (string & {});
|
|
53
|
+
export declare const SessionEndReasonSchema: z.ZodType<(string & {}) | "closed", unknown, z.core.$ZodTypeInternals<(string & {}) | "closed", unknown>>;
|
|
54
|
+
/** Compaction entity status. OPEN. */
|
|
55
|
+
export declare const COMPACTION_STATUSES: readonly ["in_progress", "completed", "failed", "cancelled"];
|
|
56
|
+
export type CompactionStatus = (typeof COMPACTION_STATUSES)[number] | (string & {});
|
|
57
|
+
export declare const CompactionStatusSchema: z.ZodType<(string & {}) | "cancelled" | "in_progress" | "completed" | "failed", unknown, z.core.$ZodTypeInternals<(string & {}) | "cancelled" | "in_progress" | "completed" | "failed", unknown>>;
|
|
58
|
+
/** What caused a compaction (Claude: `auto` | `manual`). OPEN. */
|
|
59
|
+
export declare const COMPACTION_TRIGGERS: readonly ["auto", "manual"];
|
|
60
|
+
export type CompactionTrigger = (typeof COMPACTION_TRIGGERS)[number] | (string & {});
|
|
61
|
+
export declare const CompactionTriggerSchema: z.ZodType<(string & {}) | "auto" | "manual", unknown, z.core.$ZodTypeInternals<(string & {}) | "auto" | "manual", unknown>>;
|
|
62
|
+
/** Emitted once the harness-native session id is known — persist it to resume later. */
|
|
63
|
+
export declare const SessionCreatedEventSchema: z.ZodObject<{
|
|
64
|
+
timestamp: z.ZodNumber;
|
|
65
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
66
|
+
type: z.ZodLiteral<"session.created">;
|
|
67
|
+
sessionId: z.ZodString;
|
|
68
|
+
nativeSessionId: z.ZodString;
|
|
69
|
+
harness: z.ZodType<(string & {}) | "claude-code" | "codex-app-server" | "acp", unknown, z.core.$ZodTypeInternals<(string & {}) | "claude-code" | "codex-app-server" | "acp", unknown>>;
|
|
70
|
+
model: z.ZodOptional<z.ZodString>;
|
|
71
|
+
resumed: z.ZodOptional<z.ZodBoolean>;
|
|
72
|
+
}, z.core.$strip>;
|
|
73
|
+
export type SessionCreatedEvent = z.infer<typeof SessionCreatedEventSchema>;
|
|
74
|
+
/** The session is over: nothing more arrives for it, and its id is not reused. */
|
|
75
|
+
export declare const SessionEndedEventSchema: z.ZodObject<{
|
|
76
|
+
timestamp: z.ZodNumber;
|
|
77
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
78
|
+
type: z.ZodLiteral<"session.ended">;
|
|
79
|
+
sessionId: z.ZodString;
|
|
80
|
+
reason: z.ZodType<(string & {}) | "closed", unknown, z.core.$ZodTypeInternals<(string & {}) | "closed", unknown>>;
|
|
81
|
+
}, z.core.$strip>;
|
|
82
|
+
export type SessionEndedEvent = z.infer<typeof SessionEndedEventSchema>;
|
|
83
|
+
/**
|
|
84
|
+
* Context-window gauge, emitted whenever the harness reports fresh numbers
|
|
85
|
+
* (per model message on Claude, per token-count update on Codex, per ACP
|
|
86
|
+
* `usage_update`). Vocabulary tracks ACP's stable `usage_update` shape:
|
|
87
|
+
* `used`/`size`/`cost`. Distinct from `turn.ended.tokens`, which is the
|
|
88
|
+
* turn's billing total — this is "how full is the session right now".
|
|
89
|
+
*/
|
|
90
|
+
export declare const SessionUsageEventSchema: z.ZodObject<{
|
|
91
|
+
timestamp: z.ZodNumber;
|
|
92
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
93
|
+
used: z.ZodNumber;
|
|
94
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
95
|
+
cost: z.ZodOptional<z.ZodNumber>;
|
|
96
|
+
sessionId: z.ZodString;
|
|
97
|
+
turnId: z.ZodString;
|
|
98
|
+
type: z.ZodLiteral<"session.usage">;
|
|
99
|
+
}, z.core.$strip>;
|
|
100
|
+
export type SessionUsageEvent = z.infer<typeof SessionUsageEventSchema>;
|
|
101
|
+
/** OPEN. `limited`: the account has hit a window and turns will fail until it resets. */
|
|
102
|
+
export declare const LIMIT_STATUSES: readonly ["ok", "warning", "limited"];
|
|
103
|
+
export type LimitStatus = (typeof LIMIT_STATUSES)[number] | (string & {});
|
|
104
|
+
export declare const LimitStatusSchema: z.ZodType<(string & {}) | "ok" | "warning" | "limited", unknown, z.core.$ZodTypeInternals<(string & {}) | "ok" | "warning" | "limited", unknown>>;
|
|
105
|
+
/** One usage window of the account's plan, as the provider last reported it. */
|
|
106
|
+
export declare const LimitWindowSchema: z.ZodObject<{
|
|
107
|
+
id: z.ZodString;
|
|
108
|
+
usedPercent: z.ZodOptional<z.ZodNumber>;
|
|
109
|
+
resetsAt: z.ZodOptional<z.ZodNumber>;
|
|
110
|
+
windowMinutes: z.ZodOptional<z.ZodNumber>;
|
|
111
|
+
status: z.ZodOptional<z.ZodType<(string & {}) | "ok" | "warning" | "limited", unknown, z.core.$ZodTypeInternals<(string & {}) | "ok" | "warning" | "limited", unknown>>>;
|
|
112
|
+
}, z.core.$strip>;
|
|
113
|
+
export type LimitWindow = z.infer<typeof LimitWindowSchema>;
|
|
114
|
+
/**
|
|
115
|
+
* The account's plan usage, whenever the harness reports it (Claude's
|
|
116
|
+
* `rate_limit_event`, Codex's `account/rateLimits/updated`): how much of each
|
|
117
|
+
* window is used and when it resets. A report may carry only the windows that
|
|
118
|
+
* changed; consumers merge by `id` (the reducer does).
|
|
119
|
+
*/
|
|
120
|
+
export declare const SessionLimitsEventSchema: z.ZodObject<{
|
|
121
|
+
timestamp: z.ZodNumber;
|
|
122
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
123
|
+
status: z.ZodOptional<z.ZodType<(string & {}) | "ok" | "warning" | "limited", unknown, z.core.$ZodTypeInternals<(string & {}) | "ok" | "warning" | "limited", unknown>>>;
|
|
124
|
+
windows: z.ZodArray<z.ZodObject<{
|
|
125
|
+
id: z.ZodString;
|
|
126
|
+
usedPercent: z.ZodOptional<z.ZodNumber>;
|
|
127
|
+
resetsAt: z.ZodOptional<z.ZodNumber>;
|
|
128
|
+
windowMinutes: z.ZodOptional<z.ZodNumber>;
|
|
129
|
+
status: z.ZodOptional<z.ZodType<(string & {}) | "ok" | "warning" | "limited", unknown, z.core.$ZodTypeInternals<(string & {}) | "ok" | "warning" | "limited", unknown>>>;
|
|
130
|
+
}, z.core.$strip>>;
|
|
131
|
+
planType: z.ZodOptional<z.ZodString>;
|
|
132
|
+
sessionId: z.ZodString;
|
|
133
|
+
turnId: z.ZodString;
|
|
134
|
+
type: z.ZodLiteral<"session.limits">;
|
|
135
|
+
}, z.core.$strip>;
|
|
136
|
+
export type SessionLimitsEvent = z.infer<typeof SessionLimitsEventSchema>;
|
|
137
|
+
/**
|
|
138
|
+
* The agent changed the session's permission mode during the turn: it left
|
|
139
|
+
* plan mode when the user approved its plan, or entered it by itself. Later
|
|
140
|
+
* turns run in the mode they ask for, so a client that follows the agent asks
|
|
141
|
+
* for this one (ACP's `current_mode_update`).
|
|
142
|
+
*/
|
|
143
|
+
export declare const SessionModeEventSchema: z.ZodObject<{
|
|
144
|
+
timestamp: z.ZodNumber;
|
|
145
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
146
|
+
permissionMode: z.ZodType<"default" | (string & {}) | "plan" | "accept_edits" | "dont_ask" | "bypass_permissions", unknown, z.core.$ZodTypeInternals<"default" | (string & {}) | "plan" | "accept_edits" | "dont_ask" | "bypass_permissions", unknown>>;
|
|
147
|
+
sessionId: z.ZodString;
|
|
148
|
+
turnId: z.ZodString;
|
|
149
|
+
type: z.ZodLiteral<"session.mode">;
|
|
150
|
+
}, z.core.$strip>;
|
|
151
|
+
export type SessionModeEvent = z.infer<typeof SessionModeEventSchema>;
|
|
152
|
+
/**
|
|
153
|
+
* The compaction entity: an ID-addressed, POSITIONAL timeline entity — UPSERT
|
|
154
|
+
* by `compactionId`. The first event for an id anchors the entity's position
|
|
155
|
+
* in the ordered stream (the reducer places it there in the timeline); later
|
|
156
|
+
* upserts advance `status` and stream `summary` without moving it. Neither a
|
|
157
|
+
* part nor a bare notification: a replayed transcript needs the divider IN the
|
|
158
|
+
* order (Codex deprecated their session-level notification for exactly this;
|
|
159
|
+
* matches ACP's session-compaction draft so a future binding is a passthrough).
|
|
160
|
+
*/
|
|
161
|
+
export declare const SessionCompactionEventSchema: z.ZodObject<{
|
|
162
|
+
timestamp: z.ZodNumber;
|
|
163
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
164
|
+
compactionId: z.ZodString;
|
|
165
|
+
status: z.ZodType<(string & {}) | "cancelled" | "in_progress" | "completed" | "failed", unknown, z.core.$ZodTypeInternals<(string & {}) | "cancelled" | "in_progress" | "completed" | "failed", unknown>>;
|
|
166
|
+
trigger: z.ZodOptional<z.ZodType<(string & {}) | "auto" | "manual", unknown, z.core.$ZodTypeInternals<(string & {}) | "auto" | "manual", unknown>>>;
|
|
167
|
+
preTokens: z.ZodOptional<z.ZodNumber>;
|
|
168
|
+
postTokens: z.ZodOptional<z.ZodNumber>;
|
|
169
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
170
|
+
abstractsIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
171
|
+
sessionId: z.ZodString;
|
|
172
|
+
turnId: z.ZodString;
|
|
173
|
+
type: z.ZodLiteral<"session.compaction">;
|
|
174
|
+
}, z.core.$strip>;
|
|
175
|
+
export type SessionCompactionEvent = z.infer<typeof SessionCompactionEventSchema>;
|
|
176
|
+
export declare const TurnStartedEventSchema: z.ZodObject<{
|
|
177
|
+
timestamp: z.ZodNumber;
|
|
178
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
179
|
+
execution: z.ZodOptional<z.ZodObject<{
|
|
180
|
+
harness: z.ZodType<(string & {}) | "claude-code" | "codex-app-server" | "acp", unknown, z.core.$ZodTypeInternals<(string & {}) | "claude-code" | "codex-app-server" | "acp", unknown>>;
|
|
181
|
+
model: z.ZodOptional<z.ZodString>;
|
|
182
|
+
thinkingLevel: z.ZodOptional<z.ZodEnum<{
|
|
183
|
+
off: "off";
|
|
184
|
+
low: "low";
|
|
185
|
+
medium: "medium";
|
|
186
|
+
high: "high";
|
|
187
|
+
xhigh: "xhigh";
|
|
188
|
+
max: "max";
|
|
189
|
+
ultra: "ultra";
|
|
190
|
+
}>>;
|
|
191
|
+
permissionMode: z.ZodOptional<z.ZodType<"default" | (string & {}) | "plan" | "accept_edits" | "dont_ask" | "bypass_permissions", unknown, z.core.$ZodTypeInternals<"default" | (string & {}) | "plan" | "accept_edits" | "dont_ask" | "bypass_permissions", unknown>>>;
|
|
192
|
+
appliedThinkingLevel: z.ZodOptional<z.ZodEnum<{
|
|
193
|
+
off: "off";
|
|
194
|
+
low: "low";
|
|
195
|
+
medium: "medium";
|
|
196
|
+
high: "high";
|
|
197
|
+
xhigh: "xhigh";
|
|
198
|
+
max: "max";
|
|
199
|
+
ultra: "ultra";
|
|
200
|
+
}>>;
|
|
201
|
+
reportedModels: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
202
|
+
}, z.core.$strip>>;
|
|
203
|
+
sessionId: z.ZodString;
|
|
204
|
+
turnId: z.ZodString;
|
|
205
|
+
type: z.ZodLiteral<"turn.started">;
|
|
206
|
+
}, z.core.$strip>;
|
|
207
|
+
export type TurnStartedEvent = z.infer<typeof TurnStartedEventSchema>;
|
|
208
|
+
export declare const TurnEndedEventSchema: z.ZodObject<{
|
|
209
|
+
timestamp: z.ZodNumber;
|
|
210
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
211
|
+
execution: z.ZodOptional<z.ZodObject<{
|
|
212
|
+
harness: z.ZodType<(string & {}) | "claude-code" | "codex-app-server" | "acp", unknown, z.core.$ZodTypeInternals<(string & {}) | "claude-code" | "codex-app-server" | "acp", unknown>>;
|
|
213
|
+
model: z.ZodOptional<z.ZodString>;
|
|
214
|
+
thinkingLevel: z.ZodOptional<z.ZodEnum<{
|
|
215
|
+
off: "off";
|
|
216
|
+
low: "low";
|
|
217
|
+
medium: "medium";
|
|
218
|
+
high: "high";
|
|
219
|
+
xhigh: "xhigh";
|
|
220
|
+
max: "max";
|
|
221
|
+
ultra: "ultra";
|
|
222
|
+
}>>;
|
|
223
|
+
permissionMode: z.ZodOptional<z.ZodType<"default" | (string & {}) | "plan" | "accept_edits" | "dont_ask" | "bypass_permissions", unknown, z.core.$ZodTypeInternals<"default" | (string & {}) | "plan" | "accept_edits" | "dont_ask" | "bypass_permissions", unknown>>>;
|
|
224
|
+
appliedThinkingLevel: z.ZodOptional<z.ZodEnum<{
|
|
225
|
+
off: "off";
|
|
226
|
+
low: "low";
|
|
227
|
+
medium: "medium";
|
|
228
|
+
high: "high";
|
|
229
|
+
xhigh: "xhigh";
|
|
230
|
+
max: "max";
|
|
231
|
+
ultra: "ultra";
|
|
232
|
+
}>>;
|
|
233
|
+
reportedModels: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
234
|
+
}, z.core.$strip>>;
|
|
235
|
+
stopReason: z.ZodType<"error" | (string & {}) | "cancelled" | "end_turn" | "max_tokens" | "max_turn_requests" | "refusal", unknown, z.core.$ZodTypeInternals<"error" | (string & {}) | "cancelled" | "end_turn" | "max_tokens" | "max_turn_requests" | "refusal", unknown>>;
|
|
236
|
+
finishReason: z.ZodOptional<z.ZodString>;
|
|
237
|
+
tokens: z.ZodOptional<z.ZodObject<{
|
|
238
|
+
input: z.ZodDefault<z.ZodNumber>;
|
|
239
|
+
output: z.ZodDefault<z.ZodNumber>;
|
|
240
|
+
reasoning: z.ZodOptional<z.ZodNumber>;
|
|
241
|
+
cache: z.ZodOptional<z.ZodObject<{
|
|
242
|
+
read: z.ZodDefault<z.ZodNumber>;
|
|
243
|
+
write: z.ZodDefault<z.ZodNumber>;
|
|
244
|
+
writeEphemeral5m: z.ZodOptional<z.ZodNumber>;
|
|
245
|
+
writeEphemeral1h: z.ZodOptional<z.ZodNumber>;
|
|
246
|
+
}, z.core.$strip>>;
|
|
247
|
+
}, z.core.$strip>>;
|
|
248
|
+
cost: z.ZodOptional<z.ZodNumber>;
|
|
249
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
250
|
+
category: z.ZodType<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal", unknown, z.core.$ZodTypeInternals<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal", unknown>>;
|
|
251
|
+
message: z.ZodString;
|
|
252
|
+
}, z.core.$strip>>;
|
|
253
|
+
undeliveredSteers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
254
|
+
sessionId: z.ZodString;
|
|
255
|
+
turnId: z.ZodString;
|
|
256
|
+
type: z.ZodLiteral<"turn.ended">;
|
|
257
|
+
}, z.core.$strip>;
|
|
258
|
+
export type TurnEndedEvent = z.infer<typeof TurnEndedEventSchema>;
|
|
259
|
+
export declare const MessageStartedEventSchema: z.ZodObject<{
|
|
260
|
+
timestamp: z.ZodNumber;
|
|
261
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
262
|
+
messageId: z.ZodString;
|
|
263
|
+
outputIndex: z.ZodNumber;
|
|
264
|
+
role: z.ZodEnum<{
|
|
265
|
+
user: "user";
|
|
266
|
+
assistant: "assistant";
|
|
267
|
+
}>;
|
|
268
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
269
|
+
model: z.ZodOptional<z.ZodString>;
|
|
270
|
+
sessionId: z.ZodString;
|
|
271
|
+
turnId: z.ZodString;
|
|
272
|
+
type: z.ZodLiteral<"message.started">;
|
|
273
|
+
}, z.core.$strip>;
|
|
274
|
+
export type MessageStartedEvent = z.infer<typeof MessageStartedEventSchema>;
|
|
275
|
+
/**
|
|
276
|
+
* A full part snapshot. UPSERT by `part.id` — authoritative, idempotent,
|
|
277
|
+
* re-delivery-safe. Full-snapshot semantics, never field patches: "clear a
|
|
278
|
+
* field" = omit it from the next snapshot.
|
|
279
|
+
*/
|
|
280
|
+
export declare const MessagePartEventSchema: z.ZodObject<{
|
|
281
|
+
timestamp: z.ZodNumber;
|
|
282
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
283
|
+
messageId: z.ZodString;
|
|
284
|
+
outputIndex: z.ZodNumber;
|
|
285
|
+
partIndex: z.ZodNumber;
|
|
286
|
+
part: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
287
|
+
id: z.ZodString;
|
|
288
|
+
sessionId: z.ZodString;
|
|
289
|
+
messageId: z.ZodString;
|
|
290
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
291
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
292
|
+
type: z.ZodLiteral<"text">;
|
|
293
|
+
text: z.ZodString;
|
|
294
|
+
state: z.ZodOptional<z.ZodEnum<{
|
|
295
|
+
done: "done";
|
|
296
|
+
streaming: "streaming";
|
|
297
|
+
}>>;
|
|
298
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
299
|
+
id: z.ZodString;
|
|
300
|
+
sessionId: z.ZodString;
|
|
301
|
+
messageId: z.ZodString;
|
|
302
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
303
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
304
|
+
type: z.ZodLiteral<"reasoning">;
|
|
305
|
+
text: z.ZodString;
|
|
306
|
+
state: z.ZodOptional<z.ZodEnum<{
|
|
307
|
+
done: "done";
|
|
308
|
+
streaming: "streaming";
|
|
309
|
+
}>>;
|
|
310
|
+
time: z.ZodOptional<z.ZodObject<{
|
|
311
|
+
start: z.ZodNumber;
|
|
312
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
313
|
+
}, z.core.$strip>>;
|
|
314
|
+
providerMetadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
315
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
316
|
+
id: z.ZodString;
|
|
317
|
+
sessionId: z.ZodString;
|
|
318
|
+
messageId: z.ZodString;
|
|
319
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
320
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
321
|
+
type: z.ZodLiteral<"tool">;
|
|
322
|
+
toolCallId: z.ZodString;
|
|
323
|
+
toolName: z.ZodString;
|
|
324
|
+
kind: z.ZodOptional<z.ZodType<(string & {}) | "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "switch_mode" | "task" | "other", unknown, z.core.$ZodTypeInternals<(string & {}) | "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "switch_mode" | "task" | "other", unknown>>>;
|
|
325
|
+
title: z.ZodOptional<z.ZodString>;
|
|
326
|
+
locations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
327
|
+
path: z.ZodString;
|
|
328
|
+
line: z.ZodOptional<z.ZodNumber>;
|
|
329
|
+
}, z.core.$strip>>>;
|
|
330
|
+
subagent: z.ZodOptional<z.ZodObject<{
|
|
331
|
+
type: z.ZodOptional<z.ZodString>;
|
|
332
|
+
description: z.ZodOptional<z.ZodString>;
|
|
333
|
+
model: z.ZodOptional<z.ZodString>;
|
|
334
|
+
agentId: z.ZodOptional<z.ZodString>;
|
|
335
|
+
}, z.core.$strip>>;
|
|
336
|
+
state: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
337
|
+
status: z.ZodLiteral<"pending">;
|
|
338
|
+
partialInput: z.ZodString;
|
|
339
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
340
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
341
|
+
status: z.ZodLiteral<"in_progress">;
|
|
342
|
+
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
343
|
+
title: z.ZodOptional<z.ZodString>;
|
|
344
|
+
time: z.ZodObject<{
|
|
345
|
+
start: z.ZodNumber;
|
|
346
|
+
}, z.core.$strip>;
|
|
347
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
348
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
349
|
+
status: z.ZodLiteral<"completed">;
|
|
350
|
+
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
351
|
+
output: z.ZodString;
|
|
352
|
+
content: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
353
|
+
type: z.ZodLiteral<"text">;
|
|
354
|
+
text: z.ZodString;
|
|
355
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
356
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
357
|
+
type: z.ZodLiteral<"image">;
|
|
358
|
+
data: z.ZodString;
|
|
359
|
+
mimeType: z.ZodString;
|
|
360
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
361
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
362
|
+
type: z.ZodLiteral<"diff">;
|
|
363
|
+
path: z.ZodString;
|
|
364
|
+
oldText: z.ZodOptional<z.ZodString>;
|
|
365
|
+
newText: z.ZodString;
|
|
366
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
367
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
368
|
+
type: z.ZodLiteral<"terminal">;
|
|
369
|
+
terminalId: z.ZodString;
|
|
370
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
371
|
+
}, z.core.$strip>], "type">>>;
|
|
372
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
373
|
+
title: z.ZodOptional<z.ZodString>;
|
|
374
|
+
time: z.ZodObject<{
|
|
375
|
+
start: z.ZodNumber;
|
|
376
|
+
end: z.ZodNumber;
|
|
377
|
+
}, z.core.$strip>;
|
|
378
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
379
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
380
|
+
status: z.ZodLiteral<"failed">;
|
|
381
|
+
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
382
|
+
error: z.ZodString;
|
|
383
|
+
closure: z.ZodOptional<z.ZodType<(string & {}) | "interrupted" | "never_ran" | "outcome_unknown", unknown, z.core.$ZodTypeInternals<(string & {}) | "interrupted" | "never_ran" | "outcome_unknown", unknown>>>;
|
|
384
|
+
time: z.ZodObject<{
|
|
385
|
+
start: z.ZodNumber;
|
|
386
|
+
end: z.ZodNumber;
|
|
387
|
+
}, z.core.$strip>;
|
|
388
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
389
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
390
|
+
status: z.ZodLiteral<"cancelled">;
|
|
391
|
+
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
392
|
+
time: z.ZodObject<{
|
|
393
|
+
start: z.ZodNumber;
|
|
394
|
+
end: z.ZodNumber;
|
|
395
|
+
}, z.core.$strip>;
|
|
396
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
397
|
+
}, z.core.$strip>], "status">;
|
|
398
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
399
|
+
id: z.ZodString;
|
|
400
|
+
sessionId: z.ZodString;
|
|
401
|
+
messageId: z.ZodString;
|
|
402
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
403
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
404
|
+
type: z.ZodLiteral<"subagent">;
|
|
405
|
+
nativeActivityId: z.ZodString;
|
|
406
|
+
nativeThreadId: z.ZodString;
|
|
407
|
+
path: z.ZodOptional<z.ZodString>;
|
|
408
|
+
activity: z.ZodEnum<{
|
|
409
|
+
interrupted: "interrupted";
|
|
410
|
+
completed: "completed";
|
|
411
|
+
started: "started";
|
|
412
|
+
interacted: "interacted";
|
|
413
|
+
}>;
|
|
414
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
415
|
+
id: z.ZodString;
|
|
416
|
+
sessionId: z.ZodString;
|
|
417
|
+
messageId: z.ZodString;
|
|
418
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
419
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
420
|
+
type: z.ZodLiteral<"image">;
|
|
421
|
+
data: z.ZodOptional<z.ZodString>;
|
|
422
|
+
url: z.ZodOptional<z.ZodString>;
|
|
423
|
+
mimeType: z.ZodString;
|
|
424
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
425
|
+
id: z.ZodString;
|
|
426
|
+
sessionId: z.ZodString;
|
|
427
|
+
messageId: z.ZodString;
|
|
428
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
429
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
430
|
+
type: z.ZodLiteral<"file">;
|
|
431
|
+
data: z.ZodOptional<z.ZodString>;
|
|
432
|
+
url: z.ZodOptional<z.ZodString>;
|
|
433
|
+
mimeType: z.ZodString;
|
|
434
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
435
|
+
}, z.core.$strip>], "type">;
|
|
436
|
+
sessionId: z.ZodString;
|
|
437
|
+
turnId: z.ZodString;
|
|
438
|
+
type: z.ZodLiteral<"message.part">;
|
|
439
|
+
}, z.core.$strip>;
|
|
440
|
+
export type MessagePartEvent = z.infer<typeof MessagePartEventSchema>;
|
|
441
|
+
export declare const DeltaSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
442
|
+
type: z.ZodLiteral<"text">;
|
|
443
|
+
text: z.ZodString;
|
|
444
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
445
|
+
type: z.ZodLiteral<"reasoning">;
|
|
446
|
+
text: z.ZodString;
|
|
447
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
448
|
+
type: z.ZodLiteral<"tool_input">;
|
|
449
|
+
toolCallId: z.ZodString;
|
|
450
|
+
toolName: z.ZodString;
|
|
451
|
+
input: z.ZodString;
|
|
452
|
+
}, z.core.$strip>], "type">;
|
|
453
|
+
export type Delta = z.infer<typeof DeltaSchema>;
|
|
454
|
+
/**
|
|
455
|
+
* An additive streaming aid for a streaming part field. Advisory: snapshots
|
|
456
|
+
* are authoritative and wipe accumulated deltas. Deltas are LIVE ONLY: a
|
|
457
|
+
* server never keeps one, so replay, journals and history never return it, and
|
|
458
|
+
* its envelope carries the `seq` of the session's last kept event instead of
|
|
459
|
+
* one of its own. A streaming part is kept at its opening, the changes its
|
|
460
|
+
* harness reports and its end; the engine flushes what streamed into it before
|
|
461
|
+
* the turn ends, and a client that subscribes mid-part receives the part as it
|
|
462
|
+
* stands (a live `message.part`). A journal keeps what streamed since a
|
|
463
|
+
* part's last snapshot, a row per delta, before the delta is delivered, so a
|
|
464
|
+
* server process that dies loses none of what was shown (power loss can); a
|
|
465
|
+
* server without a journal can lose it.
|
|
466
|
+
*/
|
|
467
|
+
export declare const MessagePartDeltaEventSchema: z.ZodObject<{
|
|
468
|
+
timestamp: z.ZodNumber;
|
|
469
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
470
|
+
messageId: z.ZodString;
|
|
471
|
+
outputIndex: z.ZodNumber;
|
|
472
|
+
partIndex: z.ZodNumber;
|
|
473
|
+
partId: z.ZodString;
|
|
474
|
+
delta: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
475
|
+
type: z.ZodLiteral<"text">;
|
|
476
|
+
text: z.ZodString;
|
|
477
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
478
|
+
type: z.ZodLiteral<"reasoning">;
|
|
479
|
+
text: z.ZodString;
|
|
480
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
481
|
+
type: z.ZodLiteral<"tool_input">;
|
|
482
|
+
toolCallId: z.ZodString;
|
|
483
|
+
toolName: z.ZodString;
|
|
484
|
+
input: z.ZodString;
|
|
485
|
+
}, z.core.$strip>], "type">;
|
|
486
|
+
sessionId: z.ZodString;
|
|
487
|
+
turnId: z.ZodString;
|
|
488
|
+
type: z.ZodLiteral<"message.part.delta">;
|
|
489
|
+
}, z.core.$strip>;
|
|
490
|
+
export type MessagePartDeltaEvent = z.infer<typeof MessagePartDeltaEventSchema>;
|
|
491
|
+
/** Bracket marker ONLY — billing lives on turn.ended, never here. */
|
|
492
|
+
export declare const MessageEndedEventSchema: z.ZodObject<{
|
|
493
|
+
timestamp: z.ZodNumber;
|
|
494
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
495
|
+
messageId: z.ZodString;
|
|
496
|
+
sessionId: z.ZodString;
|
|
497
|
+
turnId: z.ZodString;
|
|
498
|
+
type: z.ZodLiteral<"message.ended">;
|
|
499
|
+
}, z.core.$strip>;
|
|
500
|
+
export type MessageEndedEvent = z.infer<typeof MessageEndedEventSchema>;
|
|
501
|
+
/** OPEN — but unknown outcomes/kinds MUST be handled conservatively: never treated as approval. */
|
|
502
|
+
export declare const PERMISSION_OPTION_KINDS: readonly ["allow_once", "allow_always", "reject_once", "reject_always"];
|
|
503
|
+
export type PermissionOptionKind = (typeof PERMISSION_OPTION_KINDS)[number] | (string & {});
|
|
504
|
+
export declare const PermissionOptionKindSchema: z.ZodType<(string & {}) | "allow_once" | "allow_always" | "reject_once" | "reject_always", unknown, z.core.$ZodTypeInternals<(string & {}) | "allow_once" | "allow_always" | "reject_once" | "reject_always", unknown>>;
|
|
505
|
+
export declare const PermissionOptionSchema: z.ZodObject<{
|
|
506
|
+
optionId: z.ZodString;
|
|
507
|
+
name: z.ZodString;
|
|
508
|
+
kind: z.ZodType<(string & {}) | "allow_once" | "allow_always" | "reject_once" | "reject_always", unknown, z.core.$ZodTypeInternals<(string & {}) | "allow_once" | "allow_always" | "reject_once" | "reject_always", unknown>>;
|
|
509
|
+
}, z.core.$strip>;
|
|
510
|
+
export type PermissionOption = z.infer<typeof PermissionOptionSchema>;
|
|
511
|
+
/** The tool call a permission request is about (snapshot, not a live part). */
|
|
512
|
+
export declare const PermissionToolCallSchema: z.ZodObject<{
|
|
513
|
+
toolCallId: z.ZodOptional<z.ZodString>;
|
|
514
|
+
toolName: z.ZodString;
|
|
515
|
+
kind: z.ZodOptional<z.ZodType<(string & {}) | "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "switch_mode" | "task" | "other", unknown, z.core.$ZodTypeInternals<(string & {}) | "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "switch_mode" | "task" | "other", unknown>>>;
|
|
516
|
+
title: z.ZodOptional<z.ZodString>;
|
|
517
|
+
locations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
518
|
+
path: z.ZodString;
|
|
519
|
+
line: z.ZodOptional<z.ZodNumber>;
|
|
520
|
+
}, z.core.$strip>>>;
|
|
521
|
+
rawInput: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
522
|
+
}, z.core.$strip>;
|
|
523
|
+
export type PermissionToolCall = z.infer<typeof PermissionToolCallSchema>;
|
|
524
|
+
export declare const PermissionOutcomeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
525
|
+
outcome: z.ZodLiteral<"selected">;
|
|
526
|
+
optionId: z.ZodString;
|
|
527
|
+
updatedInput: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
528
|
+
message: z.ZodOptional<z.ZodString>;
|
|
529
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
530
|
+
outcome: z.ZodLiteral<"cancelled">;
|
|
531
|
+
}, z.core.$strip>], "outcome">;
|
|
532
|
+
export type PermissionOutcome = z.infer<typeof PermissionOutcomeSchema>;
|
|
533
|
+
/**
|
|
534
|
+
* The harness is blocked waiting for a decision. Answer via
|
|
535
|
+
* `AgentRuntime.respondPermission(sessionId, requestId, outcome)`. Pending
|
|
536
|
+
* requests resolve as `cancelled` when the turn is cancelled or ends.
|
|
537
|
+
* `options` is THE source of buttons — clients render the server's list,
|
|
538
|
+
* never derive affordances from local policy.
|
|
539
|
+
*/
|
|
540
|
+
export declare const PermissionRequestedEventSchema: z.ZodObject<{
|
|
541
|
+
timestamp: z.ZodNumber;
|
|
542
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
543
|
+
requestId: z.ZodString;
|
|
544
|
+
title: z.ZodString;
|
|
545
|
+
toolCall: z.ZodOptional<z.ZodObject<{
|
|
546
|
+
toolCallId: z.ZodOptional<z.ZodString>;
|
|
547
|
+
toolName: z.ZodString;
|
|
548
|
+
kind: z.ZodOptional<z.ZodType<(string & {}) | "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "switch_mode" | "task" | "other", unknown, z.core.$ZodTypeInternals<(string & {}) | "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "switch_mode" | "task" | "other", unknown>>>;
|
|
549
|
+
title: z.ZodOptional<z.ZodString>;
|
|
550
|
+
locations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
551
|
+
path: z.ZodString;
|
|
552
|
+
line: z.ZodOptional<z.ZodNumber>;
|
|
553
|
+
}, z.core.$strip>>>;
|
|
554
|
+
rawInput: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
555
|
+
}, z.core.$strip>>;
|
|
556
|
+
options: z.ZodArray<z.ZodObject<{
|
|
557
|
+
optionId: z.ZodString;
|
|
558
|
+
name: z.ZodString;
|
|
559
|
+
kind: z.ZodType<(string & {}) | "allow_once" | "allow_always" | "reject_once" | "reject_always", unknown, z.core.$ZodTypeInternals<(string & {}) | "allow_once" | "allow_always" | "reject_once" | "reject_always", unknown>>;
|
|
560
|
+
}, z.core.$strip>>;
|
|
561
|
+
sessionId: z.ZodString;
|
|
562
|
+
turnId: z.ZodString;
|
|
563
|
+
type: z.ZodLiteral<"permission.requested">;
|
|
564
|
+
}, z.core.$strip>;
|
|
565
|
+
export type PermissionRequestedEvent = z.infer<typeof PermissionRequestedEventSchema>;
|
|
566
|
+
/** A pending permission request was answered (or cancelled). Resolves exactly once. */
|
|
567
|
+
export declare const PermissionResolvedEventSchema: z.ZodObject<{
|
|
568
|
+
timestamp: z.ZodNumber;
|
|
569
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
570
|
+
requestId: z.ZodString;
|
|
571
|
+
outcome: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
572
|
+
outcome: z.ZodLiteral<"selected">;
|
|
573
|
+
optionId: z.ZodString;
|
|
574
|
+
updatedInput: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
575
|
+
message: z.ZodOptional<z.ZodString>;
|
|
576
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
577
|
+
outcome: z.ZodLiteral<"cancelled">;
|
|
578
|
+
}, z.core.$strip>], "outcome">;
|
|
579
|
+
sessionId: z.ZodString;
|
|
580
|
+
turnId: z.ZodString;
|
|
581
|
+
type: z.ZodLiteral<"permission.resolved">;
|
|
582
|
+
}, z.core.$strip>;
|
|
583
|
+
export type PermissionResolvedEvent = z.infer<typeof PermissionResolvedEventSchema>;
|
|
584
|
+
/**
|
|
585
|
+
* How the agent asks. OPEN: `question` is the agent's own question with
|
|
586
|
+
* choices (Claude's AskUserQuestion, Codex's request_user_input); `form` and
|
|
587
|
+
* `url` are MCP and ACP elicitation modes. A harness declines a mode it does
|
|
588
|
+
* not know.
|
|
589
|
+
*/
|
|
590
|
+
export declare const ELICITATION_MODES: readonly ["question", "form", "url"];
|
|
591
|
+
export type ElicitationMode = (typeof ELICITATION_MODES)[number] | (string & {});
|
|
592
|
+
export declare const ElicitationModeSchema: z.ZodType<(string & {}) | "url" | "question" | "form", unknown, z.core.$ZodTypeInternals<(string & {}) | "url" | "question" | "form", unknown>>;
|
|
593
|
+
/** One question of a `question` elicitation. */
|
|
594
|
+
export declare const ElicitationQuestionSchema: z.ZodObject<{
|
|
595
|
+
id: z.ZodString;
|
|
596
|
+
question: z.ZodString;
|
|
597
|
+
header: z.ZodOptional<z.ZodString>;
|
|
598
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
599
|
+
label: z.ZodString;
|
|
600
|
+
description: z.ZodOptional<z.ZodString>;
|
|
601
|
+
}, z.core.$strip>>>;
|
|
602
|
+
multiSelect: z.ZodOptional<z.ZodBoolean>;
|
|
603
|
+
allowOther: z.ZodOptional<z.ZodBoolean>;
|
|
604
|
+
secret: z.ZodOptional<z.ZodBoolean>;
|
|
605
|
+
}, z.core.$strip>;
|
|
606
|
+
export type ElicitationQuestion = z.infer<typeof ElicitationQuestionSchema>;
|
|
607
|
+
/**
|
|
608
|
+
* The agent, or one of its MCP servers, waits for the user's input. Answer via
|
|
609
|
+
* `AgentRuntime.respondElicitation(sessionId, requestId, outcome)`; pending
|
|
610
|
+
* requests resolve as `cancel` when the turn is cancelled or ends. Raised only
|
|
611
|
+
* in a turn whose `config.elicitation` says its client answers them — otherwise
|
|
612
|
+
* the harness declines on the user's behalf and the agent carries on.
|
|
613
|
+
*/
|
|
614
|
+
export declare const ElicitationRequestedEventSchema: z.ZodObject<{
|
|
615
|
+
timestamp: z.ZodNumber;
|
|
616
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
617
|
+
requestId: z.ZodString;
|
|
618
|
+
mode: z.ZodType<(string & {}) | "url" | "question" | "form", unknown, z.core.$ZodTypeInternals<(string & {}) | "url" | "question" | "form", unknown>>;
|
|
619
|
+
message: z.ZodString;
|
|
620
|
+
serverName: z.ZodOptional<z.ZodString>;
|
|
621
|
+
toolCallId: z.ZodOptional<z.ZodString>;
|
|
622
|
+
questions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
623
|
+
id: z.ZodString;
|
|
624
|
+
question: z.ZodString;
|
|
625
|
+
header: z.ZodOptional<z.ZodString>;
|
|
626
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
627
|
+
label: z.ZodString;
|
|
628
|
+
description: z.ZodOptional<z.ZodString>;
|
|
629
|
+
}, z.core.$strip>>>;
|
|
630
|
+
multiSelect: z.ZodOptional<z.ZodBoolean>;
|
|
631
|
+
allowOther: z.ZodOptional<z.ZodBoolean>;
|
|
632
|
+
secret: z.ZodOptional<z.ZodBoolean>;
|
|
633
|
+
}, z.core.$strip>>>;
|
|
634
|
+
requestedSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
635
|
+
url: z.ZodOptional<z.ZodString>;
|
|
636
|
+
elicitationId: z.ZodOptional<z.ZodString>;
|
|
637
|
+
sessionId: z.ZodString;
|
|
638
|
+
turnId: z.ZodString;
|
|
639
|
+
type: z.ZodLiteral<"elicitation.requested">;
|
|
640
|
+
}, z.core.$strip>;
|
|
641
|
+
export type ElicitationRequestedEvent = z.infer<typeof ElicitationRequestedEventSchema>;
|
|
642
|
+
/**
|
|
643
|
+
* The user's answer, ACP's three actions. `accept` carries `content`: in
|
|
644
|
+
* `question` mode each question id maps to an array of answers (chosen labels
|
|
645
|
+
* or the user's own words), in `form` mode the schema's properties map to
|
|
646
|
+
* their values, and `url` mode has none. `decline` is an explicit no; `cancel`
|
|
647
|
+
* dismisses without one, and is what a turn's end resolves a pending request as.
|
|
648
|
+
*/
|
|
649
|
+
export declare const ElicitationOutcomeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
650
|
+
action: z.ZodLiteral<"accept">;
|
|
651
|
+
content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
652
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
653
|
+
action: z.ZodLiteral<"decline">;
|
|
654
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
655
|
+
action: z.ZodLiteral<"cancel">;
|
|
656
|
+
}, z.core.$strip>], "action">;
|
|
657
|
+
export type ElicitationOutcome = z.infer<typeof ElicitationOutcomeSchema>;
|
|
658
|
+
/** A pending elicitation was answered (or cancelled). Resolves exactly once. */
|
|
659
|
+
export declare const ElicitationResolvedEventSchema: z.ZodObject<{
|
|
660
|
+
timestamp: z.ZodNumber;
|
|
661
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
662
|
+
requestId: z.ZodString;
|
|
663
|
+
outcome: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
664
|
+
action: z.ZodLiteral<"accept">;
|
|
665
|
+
content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
666
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
667
|
+
action: z.ZodLiteral<"decline">;
|
|
668
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
669
|
+
action: z.ZodLiteral<"cancel">;
|
|
670
|
+
}, z.core.$strip>], "action">;
|
|
671
|
+
sessionId: z.ZodString;
|
|
672
|
+
turnId: z.ZodString;
|
|
673
|
+
type: z.ZodLiteral<"elicitation.resolved">;
|
|
674
|
+
}, z.core.$strip>;
|
|
675
|
+
export type ElicitationResolvedEvent = z.infer<typeof ElicitationResolvedEventSchema>;
|
|
676
|
+
export declare const ErrorEventSchema: z.ZodObject<{
|
|
677
|
+
timestamp: z.ZodNumber;
|
|
678
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
679
|
+
type: z.ZodLiteral<"error">;
|
|
680
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
681
|
+
turnId: z.ZodOptional<z.ZodString>;
|
|
682
|
+
category: z.ZodType<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal", unknown, z.core.$ZodTypeInternals<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal", unknown>>;
|
|
683
|
+
message: z.ZodString;
|
|
684
|
+
recoverable: z.ZodBoolean;
|
|
685
|
+
retry: z.ZodOptional<z.ZodObject<{
|
|
686
|
+
attempt: z.ZodOptional<z.ZodNumber>;
|
|
687
|
+
maxAttempts: z.ZodOptional<z.ZodNumber>;
|
|
688
|
+
delayMs: z.ZodOptional<z.ZodNumber>;
|
|
689
|
+
}, z.core.$strip>>;
|
|
690
|
+
stack: z.ZodOptional<z.ZodString>;
|
|
691
|
+
}, z.core.$strip>;
|
|
692
|
+
export type ErrorEvent = z.infer<typeof ErrorEventSchema>;
|
|
693
|
+
/**
|
|
694
|
+
* Opt-in (`RunConfig.includeRaw`) passthrough of the harness's raw event,
|
|
695
|
+
* interleaved with the normalized stream. Escape hatch for debugging and
|
|
696
|
+
* fixture recording — `data` carries NO stability guarantees and is not part
|
|
697
|
+
* of the contract. Building a product pipeline on `raw` is a bug.
|
|
698
|
+
*/
|
|
699
|
+
export declare const RawEventSchema: z.ZodObject<{
|
|
700
|
+
timestamp: z.ZodNumber;
|
|
701
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
702
|
+
harness: z.ZodType<(string & {}) | "claude-code" | "codex-app-server" | "acp", unknown, z.core.$ZodTypeInternals<(string & {}) | "claude-code" | "codex-app-server" | "acp", unknown>>;
|
|
703
|
+
data: z.ZodUnknown;
|
|
704
|
+
sessionId: z.ZodString;
|
|
705
|
+
turnId: z.ZodString;
|
|
706
|
+
type: z.ZodLiteral<"raw">;
|
|
707
|
+
}, z.core.$strip>;
|
|
708
|
+
export type RawEvent = z.infer<typeof RawEventSchema>;
|
|
709
|
+
export declare const LifecycleEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
710
|
+
timestamp: z.ZodNumber;
|
|
711
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
712
|
+
type: z.ZodLiteral<"session.created">;
|
|
713
|
+
sessionId: z.ZodString;
|
|
714
|
+
nativeSessionId: z.ZodString;
|
|
715
|
+
harness: z.ZodType<(string & {}) | "claude-code" | "codex-app-server" | "acp", unknown, z.core.$ZodTypeInternals<(string & {}) | "claude-code" | "codex-app-server" | "acp", unknown>>;
|
|
716
|
+
model: z.ZodOptional<z.ZodString>;
|
|
717
|
+
resumed: z.ZodOptional<z.ZodBoolean>;
|
|
718
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
719
|
+
timestamp: z.ZodNumber;
|
|
720
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
721
|
+
type: z.ZodLiteral<"session.ended">;
|
|
722
|
+
sessionId: z.ZodString;
|
|
723
|
+
reason: z.ZodType<(string & {}) | "closed", unknown, z.core.$ZodTypeInternals<(string & {}) | "closed", unknown>>;
|
|
724
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
725
|
+
timestamp: z.ZodNumber;
|
|
726
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
727
|
+
execution: z.ZodOptional<z.ZodObject<{
|
|
728
|
+
harness: z.ZodType<(string & {}) | "claude-code" | "codex-app-server" | "acp", unknown, z.core.$ZodTypeInternals<(string & {}) | "claude-code" | "codex-app-server" | "acp", unknown>>;
|
|
729
|
+
model: z.ZodOptional<z.ZodString>;
|
|
730
|
+
thinkingLevel: z.ZodOptional<z.ZodEnum<{
|
|
731
|
+
off: "off";
|
|
732
|
+
low: "low";
|
|
733
|
+
medium: "medium";
|
|
734
|
+
high: "high";
|
|
735
|
+
xhigh: "xhigh";
|
|
736
|
+
max: "max";
|
|
737
|
+
ultra: "ultra";
|
|
738
|
+
}>>;
|
|
739
|
+
permissionMode: z.ZodOptional<z.ZodType<"default" | (string & {}) | "plan" | "accept_edits" | "dont_ask" | "bypass_permissions", unknown, z.core.$ZodTypeInternals<"default" | (string & {}) | "plan" | "accept_edits" | "dont_ask" | "bypass_permissions", unknown>>>;
|
|
740
|
+
appliedThinkingLevel: z.ZodOptional<z.ZodEnum<{
|
|
741
|
+
off: "off";
|
|
742
|
+
low: "low";
|
|
743
|
+
medium: "medium";
|
|
744
|
+
high: "high";
|
|
745
|
+
xhigh: "xhigh";
|
|
746
|
+
max: "max";
|
|
747
|
+
ultra: "ultra";
|
|
748
|
+
}>>;
|
|
749
|
+
reportedModels: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
750
|
+
}, z.core.$strip>>;
|
|
751
|
+
sessionId: z.ZodString;
|
|
752
|
+
turnId: z.ZodString;
|
|
753
|
+
type: z.ZodLiteral<"turn.started">;
|
|
754
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
755
|
+
timestamp: z.ZodNumber;
|
|
756
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
757
|
+
messageId: z.ZodString;
|
|
758
|
+
outputIndex: z.ZodNumber;
|
|
759
|
+
role: z.ZodEnum<{
|
|
760
|
+
user: "user";
|
|
761
|
+
assistant: "assistant";
|
|
762
|
+
}>;
|
|
763
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
764
|
+
model: z.ZodOptional<z.ZodString>;
|
|
765
|
+
sessionId: z.ZodString;
|
|
766
|
+
turnId: z.ZodString;
|
|
767
|
+
type: z.ZodLiteral<"message.started">;
|
|
768
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
769
|
+
timestamp: z.ZodNumber;
|
|
770
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
771
|
+
messageId: z.ZodString;
|
|
772
|
+
outputIndex: z.ZodNumber;
|
|
773
|
+
partIndex: z.ZodNumber;
|
|
774
|
+
part: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
775
|
+
id: z.ZodString;
|
|
776
|
+
sessionId: z.ZodString;
|
|
777
|
+
messageId: z.ZodString;
|
|
778
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
779
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
780
|
+
type: z.ZodLiteral<"text">;
|
|
781
|
+
text: z.ZodString;
|
|
782
|
+
state: z.ZodOptional<z.ZodEnum<{
|
|
783
|
+
done: "done";
|
|
784
|
+
streaming: "streaming";
|
|
785
|
+
}>>;
|
|
786
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
787
|
+
id: z.ZodString;
|
|
788
|
+
sessionId: z.ZodString;
|
|
789
|
+
messageId: z.ZodString;
|
|
790
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
791
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
792
|
+
type: z.ZodLiteral<"reasoning">;
|
|
793
|
+
text: z.ZodString;
|
|
794
|
+
state: z.ZodOptional<z.ZodEnum<{
|
|
795
|
+
done: "done";
|
|
796
|
+
streaming: "streaming";
|
|
797
|
+
}>>;
|
|
798
|
+
time: z.ZodOptional<z.ZodObject<{
|
|
799
|
+
start: z.ZodNumber;
|
|
800
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
801
|
+
}, z.core.$strip>>;
|
|
802
|
+
providerMetadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
803
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
804
|
+
id: z.ZodString;
|
|
805
|
+
sessionId: z.ZodString;
|
|
806
|
+
messageId: z.ZodString;
|
|
807
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
808
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
809
|
+
type: z.ZodLiteral<"tool">;
|
|
810
|
+
toolCallId: z.ZodString;
|
|
811
|
+
toolName: z.ZodString;
|
|
812
|
+
kind: z.ZodOptional<z.ZodType<(string & {}) | "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "switch_mode" | "task" | "other", unknown, z.core.$ZodTypeInternals<(string & {}) | "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "switch_mode" | "task" | "other", unknown>>>;
|
|
813
|
+
title: z.ZodOptional<z.ZodString>;
|
|
814
|
+
locations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
815
|
+
path: z.ZodString;
|
|
816
|
+
line: z.ZodOptional<z.ZodNumber>;
|
|
817
|
+
}, z.core.$strip>>>;
|
|
818
|
+
subagent: z.ZodOptional<z.ZodObject<{
|
|
819
|
+
type: z.ZodOptional<z.ZodString>;
|
|
820
|
+
description: z.ZodOptional<z.ZodString>;
|
|
821
|
+
model: z.ZodOptional<z.ZodString>;
|
|
822
|
+
agentId: z.ZodOptional<z.ZodString>;
|
|
823
|
+
}, z.core.$strip>>;
|
|
824
|
+
state: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
825
|
+
status: z.ZodLiteral<"pending">;
|
|
826
|
+
partialInput: z.ZodString;
|
|
827
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
828
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
829
|
+
status: z.ZodLiteral<"in_progress">;
|
|
830
|
+
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
831
|
+
title: z.ZodOptional<z.ZodString>;
|
|
832
|
+
time: z.ZodObject<{
|
|
833
|
+
start: z.ZodNumber;
|
|
834
|
+
}, z.core.$strip>;
|
|
835
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
836
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
837
|
+
status: z.ZodLiteral<"completed">;
|
|
838
|
+
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
839
|
+
output: z.ZodString;
|
|
840
|
+
content: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
841
|
+
type: z.ZodLiteral<"text">;
|
|
842
|
+
text: z.ZodString;
|
|
843
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
844
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
845
|
+
type: z.ZodLiteral<"image">;
|
|
846
|
+
data: z.ZodString;
|
|
847
|
+
mimeType: z.ZodString;
|
|
848
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
849
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
850
|
+
type: z.ZodLiteral<"diff">;
|
|
851
|
+
path: z.ZodString;
|
|
852
|
+
oldText: z.ZodOptional<z.ZodString>;
|
|
853
|
+
newText: z.ZodString;
|
|
854
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
855
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
856
|
+
type: z.ZodLiteral<"terminal">;
|
|
857
|
+
terminalId: z.ZodString;
|
|
858
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
859
|
+
}, z.core.$strip>], "type">>>;
|
|
860
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
861
|
+
title: z.ZodOptional<z.ZodString>;
|
|
862
|
+
time: z.ZodObject<{
|
|
863
|
+
start: z.ZodNumber;
|
|
864
|
+
end: z.ZodNumber;
|
|
865
|
+
}, z.core.$strip>;
|
|
866
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
867
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
868
|
+
status: z.ZodLiteral<"failed">;
|
|
869
|
+
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
870
|
+
error: z.ZodString;
|
|
871
|
+
closure: z.ZodOptional<z.ZodType<(string & {}) | "interrupted" | "never_ran" | "outcome_unknown", unknown, z.core.$ZodTypeInternals<(string & {}) | "interrupted" | "never_ran" | "outcome_unknown", unknown>>>;
|
|
872
|
+
time: z.ZodObject<{
|
|
873
|
+
start: z.ZodNumber;
|
|
874
|
+
end: z.ZodNumber;
|
|
875
|
+
}, z.core.$strip>;
|
|
876
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
877
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
878
|
+
status: z.ZodLiteral<"cancelled">;
|
|
879
|
+
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
880
|
+
time: z.ZodObject<{
|
|
881
|
+
start: z.ZodNumber;
|
|
882
|
+
end: z.ZodNumber;
|
|
883
|
+
}, z.core.$strip>;
|
|
884
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
885
|
+
}, z.core.$strip>], "status">;
|
|
886
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
887
|
+
id: z.ZodString;
|
|
888
|
+
sessionId: z.ZodString;
|
|
889
|
+
messageId: z.ZodString;
|
|
890
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
891
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
892
|
+
type: z.ZodLiteral<"subagent">;
|
|
893
|
+
nativeActivityId: z.ZodString;
|
|
894
|
+
nativeThreadId: z.ZodString;
|
|
895
|
+
path: z.ZodOptional<z.ZodString>;
|
|
896
|
+
activity: z.ZodEnum<{
|
|
897
|
+
interrupted: "interrupted";
|
|
898
|
+
completed: "completed";
|
|
899
|
+
started: "started";
|
|
900
|
+
interacted: "interacted";
|
|
901
|
+
}>;
|
|
902
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
903
|
+
id: z.ZodString;
|
|
904
|
+
sessionId: z.ZodString;
|
|
905
|
+
messageId: z.ZodString;
|
|
906
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
907
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
908
|
+
type: z.ZodLiteral<"image">;
|
|
909
|
+
data: z.ZodOptional<z.ZodString>;
|
|
910
|
+
url: z.ZodOptional<z.ZodString>;
|
|
911
|
+
mimeType: z.ZodString;
|
|
912
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
913
|
+
id: z.ZodString;
|
|
914
|
+
sessionId: z.ZodString;
|
|
915
|
+
messageId: z.ZodString;
|
|
916
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
917
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
918
|
+
type: z.ZodLiteral<"file">;
|
|
919
|
+
data: z.ZodOptional<z.ZodString>;
|
|
920
|
+
url: z.ZodOptional<z.ZodString>;
|
|
921
|
+
mimeType: z.ZodString;
|
|
922
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
923
|
+
}, z.core.$strip>], "type">;
|
|
924
|
+
sessionId: z.ZodString;
|
|
925
|
+
turnId: z.ZodString;
|
|
926
|
+
type: z.ZodLiteral<"message.part">;
|
|
927
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
928
|
+
timestamp: z.ZodNumber;
|
|
929
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
930
|
+
messageId: z.ZodString;
|
|
931
|
+
outputIndex: z.ZodNumber;
|
|
932
|
+
partIndex: z.ZodNumber;
|
|
933
|
+
partId: z.ZodString;
|
|
934
|
+
delta: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
935
|
+
type: z.ZodLiteral<"text">;
|
|
936
|
+
text: z.ZodString;
|
|
937
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
938
|
+
type: z.ZodLiteral<"reasoning">;
|
|
939
|
+
text: z.ZodString;
|
|
940
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
941
|
+
type: z.ZodLiteral<"tool_input">;
|
|
942
|
+
toolCallId: z.ZodString;
|
|
943
|
+
toolName: z.ZodString;
|
|
944
|
+
input: z.ZodString;
|
|
945
|
+
}, z.core.$strip>], "type">;
|
|
946
|
+
sessionId: z.ZodString;
|
|
947
|
+
turnId: z.ZodString;
|
|
948
|
+
type: z.ZodLiteral<"message.part.delta">;
|
|
949
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
950
|
+
timestamp: z.ZodNumber;
|
|
951
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
952
|
+
messageId: z.ZodString;
|
|
953
|
+
sessionId: z.ZodString;
|
|
954
|
+
turnId: z.ZodString;
|
|
955
|
+
type: z.ZodLiteral<"message.ended">;
|
|
956
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
957
|
+
timestamp: z.ZodNumber;
|
|
958
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
959
|
+
execution: z.ZodOptional<z.ZodObject<{
|
|
960
|
+
harness: z.ZodType<(string & {}) | "claude-code" | "codex-app-server" | "acp", unknown, z.core.$ZodTypeInternals<(string & {}) | "claude-code" | "codex-app-server" | "acp", unknown>>;
|
|
961
|
+
model: z.ZodOptional<z.ZodString>;
|
|
962
|
+
thinkingLevel: z.ZodOptional<z.ZodEnum<{
|
|
963
|
+
off: "off";
|
|
964
|
+
low: "low";
|
|
965
|
+
medium: "medium";
|
|
966
|
+
high: "high";
|
|
967
|
+
xhigh: "xhigh";
|
|
968
|
+
max: "max";
|
|
969
|
+
ultra: "ultra";
|
|
970
|
+
}>>;
|
|
971
|
+
permissionMode: z.ZodOptional<z.ZodType<"default" | (string & {}) | "plan" | "accept_edits" | "dont_ask" | "bypass_permissions", unknown, z.core.$ZodTypeInternals<"default" | (string & {}) | "plan" | "accept_edits" | "dont_ask" | "bypass_permissions", unknown>>>;
|
|
972
|
+
appliedThinkingLevel: z.ZodOptional<z.ZodEnum<{
|
|
973
|
+
off: "off";
|
|
974
|
+
low: "low";
|
|
975
|
+
medium: "medium";
|
|
976
|
+
high: "high";
|
|
977
|
+
xhigh: "xhigh";
|
|
978
|
+
max: "max";
|
|
979
|
+
ultra: "ultra";
|
|
980
|
+
}>>;
|
|
981
|
+
reportedModels: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
982
|
+
}, z.core.$strip>>;
|
|
983
|
+
stopReason: z.ZodType<"error" | (string & {}) | "cancelled" | "end_turn" | "max_tokens" | "max_turn_requests" | "refusal", unknown, z.core.$ZodTypeInternals<"error" | (string & {}) | "cancelled" | "end_turn" | "max_tokens" | "max_turn_requests" | "refusal", unknown>>;
|
|
984
|
+
finishReason: z.ZodOptional<z.ZodString>;
|
|
985
|
+
tokens: z.ZodOptional<z.ZodObject<{
|
|
986
|
+
input: z.ZodDefault<z.ZodNumber>;
|
|
987
|
+
output: z.ZodDefault<z.ZodNumber>;
|
|
988
|
+
reasoning: z.ZodOptional<z.ZodNumber>;
|
|
989
|
+
cache: z.ZodOptional<z.ZodObject<{
|
|
990
|
+
read: z.ZodDefault<z.ZodNumber>;
|
|
991
|
+
write: z.ZodDefault<z.ZodNumber>;
|
|
992
|
+
writeEphemeral5m: z.ZodOptional<z.ZodNumber>;
|
|
993
|
+
writeEphemeral1h: z.ZodOptional<z.ZodNumber>;
|
|
994
|
+
}, z.core.$strip>>;
|
|
995
|
+
}, z.core.$strip>>;
|
|
996
|
+
cost: z.ZodOptional<z.ZodNumber>;
|
|
997
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
998
|
+
category: z.ZodType<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal", unknown, z.core.$ZodTypeInternals<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal", unknown>>;
|
|
999
|
+
message: z.ZodString;
|
|
1000
|
+
}, z.core.$strip>>;
|
|
1001
|
+
undeliveredSteers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1002
|
+
sessionId: z.ZodString;
|
|
1003
|
+
turnId: z.ZodString;
|
|
1004
|
+
type: z.ZodLiteral<"turn.ended">;
|
|
1005
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1006
|
+
timestamp: z.ZodNumber;
|
|
1007
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1008
|
+
used: z.ZodNumber;
|
|
1009
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
1010
|
+
cost: z.ZodOptional<z.ZodNumber>;
|
|
1011
|
+
sessionId: z.ZodString;
|
|
1012
|
+
turnId: z.ZodString;
|
|
1013
|
+
type: z.ZodLiteral<"session.usage">;
|
|
1014
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1015
|
+
timestamp: z.ZodNumber;
|
|
1016
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1017
|
+
status: z.ZodOptional<z.ZodType<(string & {}) | "ok" | "warning" | "limited", unknown, z.core.$ZodTypeInternals<(string & {}) | "ok" | "warning" | "limited", unknown>>>;
|
|
1018
|
+
windows: z.ZodArray<z.ZodObject<{
|
|
1019
|
+
id: z.ZodString;
|
|
1020
|
+
usedPercent: z.ZodOptional<z.ZodNumber>;
|
|
1021
|
+
resetsAt: z.ZodOptional<z.ZodNumber>;
|
|
1022
|
+
windowMinutes: z.ZodOptional<z.ZodNumber>;
|
|
1023
|
+
status: z.ZodOptional<z.ZodType<(string & {}) | "ok" | "warning" | "limited", unknown, z.core.$ZodTypeInternals<(string & {}) | "ok" | "warning" | "limited", unknown>>>;
|
|
1024
|
+
}, z.core.$strip>>;
|
|
1025
|
+
planType: z.ZodOptional<z.ZodString>;
|
|
1026
|
+
sessionId: z.ZodString;
|
|
1027
|
+
turnId: z.ZodString;
|
|
1028
|
+
type: z.ZodLiteral<"session.limits">;
|
|
1029
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1030
|
+
timestamp: z.ZodNumber;
|
|
1031
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1032
|
+
permissionMode: z.ZodType<"default" | (string & {}) | "plan" | "accept_edits" | "dont_ask" | "bypass_permissions", unknown, z.core.$ZodTypeInternals<"default" | (string & {}) | "plan" | "accept_edits" | "dont_ask" | "bypass_permissions", unknown>>;
|
|
1033
|
+
sessionId: z.ZodString;
|
|
1034
|
+
turnId: z.ZodString;
|
|
1035
|
+
type: z.ZodLiteral<"session.mode">;
|
|
1036
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1037
|
+
timestamp: z.ZodNumber;
|
|
1038
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1039
|
+
compactionId: z.ZodString;
|
|
1040
|
+
status: z.ZodType<(string & {}) | "cancelled" | "in_progress" | "completed" | "failed", unknown, z.core.$ZodTypeInternals<(string & {}) | "cancelled" | "in_progress" | "completed" | "failed", unknown>>;
|
|
1041
|
+
trigger: z.ZodOptional<z.ZodType<(string & {}) | "auto" | "manual", unknown, z.core.$ZodTypeInternals<(string & {}) | "auto" | "manual", unknown>>>;
|
|
1042
|
+
preTokens: z.ZodOptional<z.ZodNumber>;
|
|
1043
|
+
postTokens: z.ZodOptional<z.ZodNumber>;
|
|
1044
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
1045
|
+
abstractsIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1046
|
+
sessionId: z.ZodString;
|
|
1047
|
+
turnId: z.ZodString;
|
|
1048
|
+
type: z.ZodLiteral<"session.compaction">;
|
|
1049
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1050
|
+
timestamp: z.ZodNumber;
|
|
1051
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1052
|
+
type: z.ZodLiteral<"error">;
|
|
1053
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
1054
|
+
turnId: z.ZodOptional<z.ZodString>;
|
|
1055
|
+
category: z.ZodType<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal", unknown, z.core.$ZodTypeInternals<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal", unknown>>;
|
|
1056
|
+
message: z.ZodString;
|
|
1057
|
+
recoverable: z.ZodBoolean;
|
|
1058
|
+
retry: z.ZodOptional<z.ZodObject<{
|
|
1059
|
+
attempt: z.ZodOptional<z.ZodNumber>;
|
|
1060
|
+
maxAttempts: z.ZodOptional<z.ZodNumber>;
|
|
1061
|
+
delayMs: z.ZodOptional<z.ZodNumber>;
|
|
1062
|
+
}, z.core.$strip>>;
|
|
1063
|
+
stack: z.ZodOptional<z.ZodString>;
|
|
1064
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1065
|
+
timestamp: z.ZodNumber;
|
|
1066
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1067
|
+
requestId: z.ZodString;
|
|
1068
|
+
title: z.ZodString;
|
|
1069
|
+
toolCall: z.ZodOptional<z.ZodObject<{
|
|
1070
|
+
toolCallId: z.ZodOptional<z.ZodString>;
|
|
1071
|
+
toolName: z.ZodString;
|
|
1072
|
+
kind: z.ZodOptional<z.ZodType<(string & {}) | "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "switch_mode" | "task" | "other", unknown, z.core.$ZodTypeInternals<(string & {}) | "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "switch_mode" | "task" | "other", unknown>>>;
|
|
1073
|
+
title: z.ZodOptional<z.ZodString>;
|
|
1074
|
+
locations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1075
|
+
path: z.ZodString;
|
|
1076
|
+
line: z.ZodOptional<z.ZodNumber>;
|
|
1077
|
+
}, z.core.$strip>>>;
|
|
1078
|
+
rawInput: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1079
|
+
}, z.core.$strip>>;
|
|
1080
|
+
options: z.ZodArray<z.ZodObject<{
|
|
1081
|
+
optionId: z.ZodString;
|
|
1082
|
+
name: z.ZodString;
|
|
1083
|
+
kind: z.ZodType<(string & {}) | "allow_once" | "allow_always" | "reject_once" | "reject_always", unknown, z.core.$ZodTypeInternals<(string & {}) | "allow_once" | "allow_always" | "reject_once" | "reject_always", unknown>>;
|
|
1084
|
+
}, z.core.$strip>>;
|
|
1085
|
+
sessionId: z.ZodString;
|
|
1086
|
+
turnId: z.ZodString;
|
|
1087
|
+
type: z.ZodLiteral<"permission.requested">;
|
|
1088
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1089
|
+
timestamp: z.ZodNumber;
|
|
1090
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1091
|
+
requestId: z.ZodString;
|
|
1092
|
+
outcome: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1093
|
+
outcome: z.ZodLiteral<"selected">;
|
|
1094
|
+
optionId: z.ZodString;
|
|
1095
|
+
updatedInput: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1096
|
+
message: z.ZodOptional<z.ZodString>;
|
|
1097
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1098
|
+
outcome: z.ZodLiteral<"cancelled">;
|
|
1099
|
+
}, z.core.$strip>], "outcome">;
|
|
1100
|
+
sessionId: z.ZodString;
|
|
1101
|
+
turnId: z.ZodString;
|
|
1102
|
+
type: z.ZodLiteral<"permission.resolved">;
|
|
1103
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1104
|
+
timestamp: z.ZodNumber;
|
|
1105
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1106
|
+
requestId: z.ZodString;
|
|
1107
|
+
mode: z.ZodType<(string & {}) | "url" | "question" | "form", unknown, z.core.$ZodTypeInternals<(string & {}) | "url" | "question" | "form", unknown>>;
|
|
1108
|
+
message: z.ZodString;
|
|
1109
|
+
serverName: z.ZodOptional<z.ZodString>;
|
|
1110
|
+
toolCallId: z.ZodOptional<z.ZodString>;
|
|
1111
|
+
questions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1112
|
+
id: z.ZodString;
|
|
1113
|
+
question: z.ZodString;
|
|
1114
|
+
header: z.ZodOptional<z.ZodString>;
|
|
1115
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1116
|
+
label: z.ZodString;
|
|
1117
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1118
|
+
}, z.core.$strip>>>;
|
|
1119
|
+
multiSelect: z.ZodOptional<z.ZodBoolean>;
|
|
1120
|
+
allowOther: z.ZodOptional<z.ZodBoolean>;
|
|
1121
|
+
secret: z.ZodOptional<z.ZodBoolean>;
|
|
1122
|
+
}, z.core.$strip>>>;
|
|
1123
|
+
requestedSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1124
|
+
url: z.ZodOptional<z.ZodString>;
|
|
1125
|
+
elicitationId: z.ZodOptional<z.ZodString>;
|
|
1126
|
+
sessionId: z.ZodString;
|
|
1127
|
+
turnId: z.ZodString;
|
|
1128
|
+
type: z.ZodLiteral<"elicitation.requested">;
|
|
1129
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1130
|
+
timestamp: z.ZodNumber;
|
|
1131
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1132
|
+
requestId: z.ZodString;
|
|
1133
|
+
outcome: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1134
|
+
action: z.ZodLiteral<"accept">;
|
|
1135
|
+
content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1136
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1137
|
+
action: z.ZodLiteral<"decline">;
|
|
1138
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1139
|
+
action: z.ZodLiteral<"cancel">;
|
|
1140
|
+
}, z.core.$strip>], "action">;
|
|
1141
|
+
sessionId: z.ZodString;
|
|
1142
|
+
turnId: z.ZodString;
|
|
1143
|
+
type: z.ZodLiteral<"elicitation.resolved">;
|
|
1144
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1145
|
+
timestamp: z.ZodNumber;
|
|
1146
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1147
|
+
harness: z.ZodType<(string & {}) | "claude-code" | "codex-app-server" | "acp", unknown, z.core.$ZodTypeInternals<(string & {}) | "claude-code" | "codex-app-server" | "acp", unknown>>;
|
|
1148
|
+
data: z.ZodUnknown;
|
|
1149
|
+
sessionId: z.ZodString;
|
|
1150
|
+
turnId: z.ZodString;
|
|
1151
|
+
type: z.ZodLiteral<"raw">;
|
|
1152
|
+
}, z.core.$strip>], "type">;
|
|
1153
|
+
export type LifecycleEvent = z.infer<typeof LifecycleEventSchema>;
|
|
1154
|
+
/**
|
|
1155
|
+
* Tolerant of the unknown, strict about the known: an event with an
|
|
1156
|
+
* unknown `type` is preserved (in order, never dropped) as an UnknownEvent;
|
|
1157
|
+
* a KNOWN type with a malformed body is a hard error.
|
|
1158
|
+
*/
|
|
1159
|
+
export interface UnknownEvent {
|
|
1160
|
+
type: string & {};
|
|
1161
|
+
sessionId?: string;
|
|
1162
|
+
raw: Record<string, unknown>;
|
|
1163
|
+
}
|
|
1164
|
+
/** A preserved unknown event as persisted state holds it, everything it carried kept. */
|
|
1165
|
+
export declare const UnknownEventSchema: z.ZodType<UnknownEvent>;
|
|
1166
|
+
/**
|
|
1167
|
+
* A `message.part` whose part may be an `UnknownPart`: the event envelope is
|
|
1168
|
+
* protocol-owned (strict), the part inside it is not.
|
|
1169
|
+
*/
|
|
1170
|
+
export interface DecodedMessagePartEvent extends Omit<MessagePartEvent, "part"> {
|
|
1171
|
+
part: Part | UnknownPart;
|
|
1172
|
+
}
|
|
1173
|
+
/**
|
|
1174
|
+
* What the tolerant decoder (LLP 0002) yields for a KNOWN event type. Identical to
|
|
1175
|
+
* `LifecycleEvent` except that `message.part` may carry an unknown part — so
|
|
1176
|
+
* every `LifecycleEvent` is a `DecodedLifecycleEvent`, and consumers that
|
|
1177
|
+
* accept this type accept both.
|
|
1178
|
+
*/
|
|
1179
|
+
export type DecodedLifecycleEvent = Exclude<LifecycleEvent, MessagePartEvent> | DecodedMessagePartEvent;
|
|
1180
|
+
/**
|
|
1181
|
+
* Decode a wire value into a LifecycleEvent, preserving unknown event types
|
|
1182
|
+
* (and unknown PART types inside `message.part`) instead of dropping them.
|
|
1183
|
+
* Throws on a known type with a malformed body.
|
|
1184
|
+
*
|
|
1185
|
+
* This is the decoder every wire consumer should use — dropping an event a
|
|
1186
|
+
* newer server sent is not a graceful degradation, it is a hole in the
|
|
1187
|
+
* transcript and, for a seq-tracking client, a fabricated gap.
|
|
1188
|
+
*/
|
|
1189
|
+
export declare function decodeLifecycleEvent(value: unknown): DecodedLifecycleEvent | UnknownEvent;
|
|
1190
|
+
//# sourceMappingURL=lifecycle.d.ts.map
|