@zvada/agent-server 0.3.18 → 0.3.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +11 -26
- package/CHANGELOG.md +1005 -1
- package/README.md +35 -39
- package/dist/types/accounts/chatgpt.d.ts +34 -0
- package/dist/types/accounts/chatgpt.d.ts.map +1 -0
- package/dist/types/accounts/check.d.ts +24 -0
- package/dist/types/accounts/check.d.ts.map +1 -0
- package/dist/types/accounts/claude.d.ts +21 -0
- package/dist/types/accounts/claude.d.ts.map +1 -0
- package/dist/types/accounts/endpoint.d.ts +50 -0
- package/dist/types/accounts/endpoint.d.ts.map +1 -0
- package/dist/types/accounts/http.d.ts +38 -0
- package/dist/types/accounts/http.d.ts.map +1 -0
- package/dist/types/accounts/index.d.ts +6 -0
- package/dist/types/accounts/index.d.ts.map +1 -0
- package/dist/types/client/client.d.ts +272 -0
- package/dist/types/client/client.d.ts.map +1 -0
- package/dist/types/client/connection.d.ts +160 -0
- package/dist/types/client/connection.d.ts.map +1 -0
- package/dist/types/client/history.d.ts +8 -0
- package/dist/types/client/history.d.ts.map +1 -0
- package/dist/types/client/index.d.ts +5 -0
- package/dist/types/client/index.d.ts.map +1 -0
- package/dist/types/client/listeners.d.ts +8 -0
- package/dist/types/client/listeners.d.ts.map +1 -0
- package/dist/types/client/logins.d.ts +35 -0
- package/dist/types/client/logins.d.ts.map +1 -0
- package/dist/types/client/rpc.d.ts +46 -0
- package/dist/types/client/rpc.d.ts.map +1 -0
- package/dist/types/client/streams.d.ts +150 -0
- package/dist/types/client/streams.d.ts.map +1 -0
- package/dist/types/client/transports.d.ts +35 -0
- package/dist/types/client/transports.d.ts.map +1 -0
- package/dist/types/client/turns.d.ts +81 -0
- package/dist/types/client/turns.d.ts.map +1 -0
- package/dist/types/core/agents/acp/acp-agent.d.ts +68 -0
- package/dist/types/core/agents/acp/acp-agent.d.ts.map +1 -0
- package/dist/types/core/agents/acp/adapter.d.ts +39 -0
- package/dist/types/core/agents/acp/adapter.d.ts.map +1 -0
- package/dist/types/core/agents/acp/client.d.ts +90 -0
- package/dist/types/core/agents/acp/client.d.ts.map +1 -0
- package/dist/types/core/agents/acp/known-agents.d.ts +35 -0
- package/dist/types/core/agents/acp/known-agents.d.ts.map +1 -0
- package/dist/types/core/agents/acp/mappings.d.ts +46 -0
- package/dist/types/core/agents/acp/mappings.d.ts.map +1 -0
- package/dist/types/core/agents/acp/requests.d.ts +26 -0
- package/dist/types/core/agents/acp/requests.d.ts.map +1 -0
- package/dist/types/core/agents/attachments.d.ts +11 -0
- package/dist/types/core/agents/attachments.d.ts.map +1 -0
- package/dist/types/core/agents/base.d.ts +227 -0
- package/dist/types/core/agents/base.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/adapter.d.ts +58 -0
- package/dist/types/core/agents/claude-code/adapter.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/approvals.d.ts +26 -0
- package/dist/types/core/agents/claude-code/approvals.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/claude-agent.d.ts +70 -0
- package/dist/types/core/agents/claude-code/claude-agent.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/credentials.d.ts +54 -0
- package/dist/types/core/agents/claude-code/credentials.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/events.d.ts +42 -0
- package/dist/types/core/agents/claude-code/events.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/login.d.ts +61 -0
- package/dist/types/core/agents/claude-code/login.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/mcp.d.ts +52 -0
- package/dist/types/core/agents/claude-code/mcp.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/models.d.ts +30 -0
- package/dist/types/core/agents/claude-code/models.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/options.d.ts +183 -0
- package/dist/types/core/agents/claude-code/options.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/outcome.d.ts +50 -0
- package/dist/types/core/agents/claude-code/outcome.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/session-pool.d.ts +36 -0
- package/dist/types/core/agents/claude-code/session-pool.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/session.d.ts +148 -0
- package/dist/types/core/agents/claude-code/session.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/spawn.d.ts +29 -0
- package/dist/types/core/agents/claude-code/spawn.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/spend.d.ts +58 -0
- package/dist/types/core/agents/claude-code/spend.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/tools.d.ts +4 -0
- package/dist/types/core/agents/claude-code/tools.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/turn-usage.d.ts +52 -0
- package/dist/types/core/agents/claude-code/turn-usage.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/turn.d.ts +121 -0
- package/dist/types/core/agents/claude-code/turn.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/adapter.d.ts +59 -0
- package/dist/types/core/agents/codex-app-server/adapter.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/client.d.ts +116 -0
- package/dist/types/core/agents/codex-app-server/client.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/codex-agent.d.ts +113 -0
- package/dist/types/core/agents/codex-app-server/codex-agent.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/commands.d.ts +66 -0
- package/dist/types/core/agents/codex-app-server/commands.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/credentials.d.ts +49 -0
- package/dist/types/core/agents/codex-app-server/credentials.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/effort.d.ts +12 -0
- package/dist/types/core/agents/codex-app-server/effort.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/events.d.ts +45 -0
- package/dist/types/core/agents/codex-app-server/events.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/homes.d.ts +20 -0
- package/dist/types/core/agents/codex-app-server/homes.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/input.d.ts +26 -0
- package/dist/types/core/agents/codex-app-server/input.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/items.d.ts +31 -0
- package/dist/types/core/agents/codex-app-server/items.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/login.d.ts +38 -0
- package/dist/types/core/agents/codex-app-server/login.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/mcp.d.ts +62 -0
- package/dist/types/core/agents/codex-app-server/mcp.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/models.d.ts +67 -0
- package/dist/types/core/agents/codex-app-server/models.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/options.d.ts +40 -0
- package/dist/types/core/agents/codex-app-server/options.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/plan-approval.d.ts +19 -0
- package/dist/types/core/agents/codex-app-server/plan-approval.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/protocol.d.ts +99 -0
- package/dist/types/core/agents/codex-app-server/protocol.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/requests.d.ts +42 -0
- package/dist/types/core/agents/codex-app-server/requests.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/session.d.ts +96 -0
- package/dist/types/core/agents/codex-app-server/session.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/subagents.d.ts +53 -0
- package/dist/types/core/agents/codex-app-server/subagents.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/thread-settings.d.ts +87 -0
- package/dist/types/core/agents/codex-app-server/thread-settings.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/turn-items.d.ts +33 -0
- package/dist/types/core/agents/codex-app-server/turn-items.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/turn.d.ts +163 -0
- package/dist/types/core/agents/codex-app-server/turn.d.ts.map +1 -0
- package/dist/types/core/agents/config-fingerprint.d.ts +5 -0
- package/dist/types/core/agents/config-fingerprint.d.ts.map +1 -0
- package/dist/types/core/agents/credentials.d.ts +28 -0
- package/dist/types/core/agents/credentials.d.ts.map +1 -0
- package/dist/types/core/agents/elicitation.d.ts +37 -0
- package/dist/types/core/agents/elicitation.d.ts.map +1 -0
- package/dist/types/core/agents/inherit-config.d.ts +18 -0
- package/dist/types/core/agents/inherit-config.d.ts.map +1 -0
- package/dist/types/core/agents/login.d.ts +67 -0
- package/dist/types/core/agents/login.d.ts.map +1 -0
- package/dist/types/core/agents/mcp-config.d.ts +57 -0
- package/dist/types/core/agents/mcp-config.d.ts.map +1 -0
- package/dist/types/core/agents/plan.d.ts +16 -0
- package/dist/types/core/agents/plan.d.ts.map +1 -0
- package/dist/types/core/agents/registry.d.ts +30 -0
- package/dist/types/core/agents/registry.d.ts.map +1 -0
- package/dist/types/core/agents/session-agent.d.ts +48 -0
- package/dist/types/core/agents/session-agent.d.ts.map +1 -0
- package/dist/types/core/agents/session-pool.d.ts +41 -0
- package/dist/types/core/agents/session-pool.d.ts.map +1 -0
- package/dist/types/core/agents/stderr-tail.d.ts +28 -0
- package/dist/types/core/agents/stderr-tail.d.ts.map +1 -0
- package/dist/types/core/agents/thinking-levels.d.ts +4 -0
- package/dist/types/core/agents/thinking-levels.d.ts.map +1 -0
- package/dist/types/core/agents/types.d.ts +124 -0
- package/dist/types/core/agents/types.d.ts.map +1 -0
- package/dist/types/core/diagnostics.d.ts +36 -0
- package/dist/types/core/diagnostics.d.ts.map +1 -0
- package/dist/types/core/index.d.ts +29 -0
- package/dist/types/core/index.d.ts.map +1 -0
- package/dist/types/core/presets.d.ts +80 -0
- package/dist/types/core/presets.d.ts.map +1 -0
- package/dist/types/core/processes/identity.d.ts +31 -0
- package/dist/types/core/processes/identity.d.ts.map +1 -0
- package/dist/types/core/processes/lifeline.d.ts +47 -0
- package/dist/types/core/processes/lifeline.d.ts.map +1 -0
- package/dist/types/core/processes/native-processes.d.ts +130 -0
- package/dist/types/core/processes/native-processes.d.ts.map +1 -0
- package/dist/types/core/processes/process-table.d.ts +43 -0
- package/dist/types/core/processes/process-table.d.ts.map +1 -0
- package/dist/types/core/provision/cache-trust.d.ts +13 -0
- package/dist/types/core/provision/cache-trust.d.ts.map +1 -0
- package/dist/types/core/provision/cache-usage.d.ts +14 -0
- package/dist/types/core/provision/cache-usage.d.ts.map +1 -0
- package/dist/types/core/provision/checksums.d.ts +46 -0
- package/dist/types/core/provision/checksums.d.ts.map +1 -0
- package/dist/types/core/provision/extract.d.ts +7 -0
- package/dist/types/core/provision/extract.d.ts.map +1 -0
- package/dist/types/core/provision/index.d.ts +5 -0
- package/dist/types/core/provision/index.d.ts.map +1 -0
- package/dist/types/core/provision/install-build.d.ts +36 -0
- package/dist/types/core/provision/install-build.d.ts.map +1 -0
- package/dist/types/core/provision/npm.d.ts +40 -0
- package/dist/types/core/provision/npm.d.ts.map +1 -0
- package/dist/types/core/provision/pins.d.ts +24 -0
- package/dist/types/core/provision/pins.d.ts.map +1 -0
- package/dist/types/core/provision/platform.d.ts +28 -0
- package/dist/types/core/provision/platform.d.ts.map +1 -0
- package/dist/types/core/provision/provisioner.d.ts +189 -0
- package/dist/types/core/provision/provisioner.d.ts.map +1 -0
- package/dist/types/core/provision/releases.d.ts +8 -0
- package/dist/types/core/provision/releases.d.ts.map +1 -0
- package/dist/types/core/provision/tools.d.ts +81 -0
- package/dist/types/core/provision/tools.d.ts.map +1 -0
- package/dist/types/core/proxy/anthropic-proxy.d.ts +52 -0
- package/dist/types/core/proxy/anthropic-proxy.d.ts.map +1 -0
- package/dist/types/core/proxy/api-key-store.d.ts +37 -0
- package/dist/types/core/proxy/api-key-store.d.ts.map +1 -0
- package/dist/types/core/proxy/index.d.ts +3 -0
- package/dist/types/core/proxy/index.d.ts.map +1 -0
- package/dist/types/core/proxy/loopback.d.ts +14 -0
- package/dist/types/core/proxy/loopback.d.ts.map +1 -0
- package/dist/types/core/runtime/agent-runtime.d.ts +181 -0
- package/dist/types/core/runtime/agent-runtime.d.ts.map +1 -0
- package/dist/types/core/runtime/event-processor.d.ts +87 -0
- package/dist/types/core/runtime/event-processor.d.ts.map +1 -0
- package/dist/types/core/runtime/event-sink.d.ts +44 -0
- package/dist/types/core/runtime/event-sink.d.ts.map +1 -0
- package/dist/types/core/runtime/harness-clis.d.ts +10 -0
- package/dist/types/core/runtime/harness-clis.d.ts.map +1 -0
- package/dist/types/core/runtime/harness-logins.d.ts +68 -0
- package/dist/types/core/runtime/harness-logins.d.ts.map +1 -0
- package/dist/types/core/runtime/login-reads.d.ts +28 -0
- package/dist/types/core/runtime/login-reads.d.ts.map +1 -0
- package/dist/types/core/runtime/model-lists.d.ts +37 -0
- package/dist/types/core/runtime/model-lists.d.ts.map +1 -0
- package/dist/types/core/runtime/permission-policy.d.ts +61 -0
- package/dist/types/core/runtime/permission-policy.d.ts.map +1 -0
- package/dist/types/core/runtime/request-broker.d.ts +49 -0
- package/dist/types/core/runtime/request-broker.d.ts.map +1 -0
- package/dist/types/core/runtime/steering.d.ts +38 -0
- package/dist/types/core/runtime/steering.d.ts.map +1 -0
- package/dist/types/core/runtime/turn-outcome.d.ts +21 -0
- package/dist/types/core/runtime/turn-outcome.d.ts.map +1 -0
- package/dist/types/core/runtime/turn.d.ts +121 -0
- package/dist/types/core/runtime/turn.d.ts.map +1 -0
- package/dist/types/core/utils/bounded.d.ts +6 -0
- package/dist/types/core/utils/bounded.d.ts.map +1 -0
- package/dist/types/core/utils/deadline.d.ts +14 -0
- package/dist/types/core/utils/deadline.d.ts.map +1 -0
- package/dist/types/core/utils/errors.d.ts +104 -0
- package/dist/types/core/utils/errors.d.ts.map +1 -0
- package/dist/types/core/utils/is-record.d.ts +3 -0
- package/dist/types/core/utils/is-record.d.ts.map +1 -0
- package/dist/types/core/utils/loopback.d.ts +6 -0
- package/dist/types/core/utils/loopback.d.ts.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/protocol/account.d.ts +26 -0
- package/dist/types/protocol/account.d.ts.map +1 -0
- package/dist/types/protocol/async-queue.d.ts +21 -0
- package/dist/types/protocol/async-queue.d.ts.map +1 -0
- package/dist/types/protocol/auth.d.ts +228 -0
- package/dist/types/protocol/auth.d.ts.map +1 -0
- package/dist/types/protocol/canonical.d.ts +9 -0
- package/dist/types/protocol/canonical.d.ts.map +1 -0
- package/dist/types/protocol/clis.d.ts +74 -0
- package/dist/types/protocol/clis.d.ts.map +1 -0
- package/dist/types/protocol/config.d.ts +200 -0
- package/dist/types/protocol/config.d.ts.map +1 -0
- package/dist/types/protocol/conversation.d.ts +942 -0
- package/dist/types/protocol/conversation.d.ts.map +1 -0
- package/dist/types/protocol/credentials.d.ts +145 -0
- package/dist/types/protocol/credentials.d.ts.map +1 -0
- package/dist/types/protocol/errors.d.ts +36 -0
- package/dist/types/protocol/errors.d.ts.map +1 -0
- package/dist/types/protocol/execution.d.ts +28 -0
- package/dist/types/protocol/execution.d.ts.map +1 -0
- package/dist/types/protocol/factories.d.ts +94 -0
- package/dist/types/protocol/factories.d.ts.map +1 -0
- package/dist/types/protocol/guards.d.ts +55 -0
- package/dist/types/protocol/guards.d.ts.map +1 -0
- package/dist/types/protocol/harness.d.ts +70 -0
- package/dist/types/protocol/harness.d.ts.map +1 -0
- package/dist/types/protocol/history.d.ts +318 -0
- package/dist/types/protocol/history.d.ts.map +1 -0
- package/dist/types/protocol/ids.d.ts +9 -0
- package/dist/types/protocol/ids.d.ts.map +1 -0
- package/dist/types/protocol/index.d.ts +35 -0
- package/dist/types/protocol/index.d.ts.map +1 -0
- package/dist/types/protocol/lifecycle.d.ts +1190 -0
- package/dist/types/protocol/lifecycle.d.ts.map +1 -0
- package/dist/types/protocol/meta-keys.d.ts +17 -0
- package/dist/types/protocol/meta-keys.d.ts.map +1 -0
- package/dist/types/protocol/meta.d.ts +13 -0
- package/dist/types/protocol/meta.d.ts.map +1 -0
- package/dist/types/protocol/model-catalog.d.ts +11 -0
- package/dist/types/protocol/model-catalog.d.ts.map +1 -0
- package/dist/types/protocol/models.d.ts +107 -0
- package/dist/types/protocol/models.d.ts.map +1 -0
- package/dist/types/protocol/part-input.d.ts +101 -0
- package/dist/types/protocol/part-input.d.ts.map +1 -0
- package/dist/types/protocol/parts.d.ts +357 -0
- package/dist/types/protocol/parts.d.ts.map +1 -0
- package/dist/types/protocol/reduce.d.ts +26 -0
- package/dist/types/protocol/reduce.d.ts.map +1 -0
- package/dist/types/protocol/selectors.d.ts +64 -0
- package/dist/types/protocol/selectors.d.ts.map +1 -0
- package/dist/types/protocol/seq-cursor.d.ts +66 -0
- package/dist/types/protocol/seq-cursor.d.ts.map +1 -0
- package/dist/types/protocol/stop-reasons.d.ts +33 -0
- package/dist/types/protocol/stop-reasons.d.ts.map +1 -0
- package/dist/types/protocol/thinking.d.ts +28 -0
- package/dist/types/protocol/thinking.d.ts.map +1 -0
- package/dist/types/protocol/time.d.ts +21 -0
- package/dist/types/protocol/time.d.ts.map +1 -0
- package/dist/types/protocol/tokens.d.ts +29 -0
- package/dist/types/protocol/tokens.d.ts.map +1 -0
- package/dist/types/protocol/tool-closure.d.ts +25 -0
- package/dist/types/protocol/tool-closure.d.ts.map +1 -0
- package/dist/types/protocol/tool-state.d.ts +209 -0
- package/dist/types/protocol/tool-state.d.ts.map +1 -0
- package/dist/types/protocol/verify.d.ts +52 -0
- package/dist/types/protocol/verify.d.ts.map +1 -0
- package/dist/types/protocol/vocabulary.d.ts +19 -0
- package/dist/types/protocol/vocabulary.d.ts.map +1 -0
- package/dist/types/protocol/wire-api.d.ts +1983 -0
- package/dist/types/protocol/wire-api.d.ts.map +1 -0
- package/dist/types/protocol/wire.d.ts +1758 -0
- package/dist/types/protocol/wire.d.ts.map +1 -0
- package/dist/types/server/acp/binding.d.ts +33 -0
- package/dist/types/server/acp/binding.d.ts.map +1 -0
- package/dist/types/server/acp/session-records.d.ts +17 -0
- package/dist/types/server/acp/session-records.d.ts.map +1 -0
- package/dist/types/server/acp/translate.d.ts +48 -0
- package/dist/types/server/acp/translate.d.ts.map +1 -0
- package/dist/types/server/agent-server.d.ts +121 -0
- package/dist/types/server/agent-server.d.ts.map +1 -0
- package/dist/types/server/feedback.d.ts +37 -0
- package/dist/types/server/feedback.d.ts.map +1 -0
- package/dist/types/server/history.d.ts +15 -0
- package/dist/types/server/history.d.ts.map +1 -0
- package/dist/types/server/index.d.ts +7 -0
- package/dist/types/server/index.d.ts.map +1 -0
- package/dist/types/server/install.d.ts +42 -0
- package/dist/types/server/install.d.ts.map +1 -0
- package/dist/types/server/open-parts.d.ts +27 -0
- package/dist/types/server/open-parts.d.ts.map +1 -0
- package/dist/types/server/routes.d.ts +61 -0
- package/dist/types/server/routes.d.ts.map +1 -0
- package/dist/types/server/secrets.d.ts +11 -0
- package/dist/types/server/secrets.d.ts.map +1 -0
- package/dist/types/server/session-gate.d.ts +32 -0
- package/dist/types/server/session-gate.d.ts.map +1 -0
- package/dist/types/server/session-log.d.ts +39 -0
- package/dist/types/server/session-log.d.ts.map +1 -0
- package/dist/types/server/session-store.d.ts +119 -0
- package/dist/types/server/session-store.d.ts.map +1 -0
- package/dist/types/server/subscriptions.d.ts +74 -0
- package/dist/types/server/subscriptions.d.ts.map +1 -0
- package/dist/types/server/transports.d.ts +74 -0
- package/dist/types/server/transports.d.ts.map +1 -0
- package/dist/types/server/wire-error.d.ts +9 -0
- package/dist/types/server/wire-error.d.ts.map +1 -0
- package/dist/types/sync/event-log.d.ts +45 -0
- package/dist/types/sync/event-log.d.ts.map +1 -0
- package/dist/types/sync/fit.d.ts +40 -0
- package/dist/types/sync/fit.d.ts.map +1 -0
- package/dist/types/sync/history-reader.d.ts +8 -0
- package/dist/types/sync/history-reader.d.ts.map +1 -0
- package/dist/types/sync/history-sqlite.d.ts +37 -0
- package/dist/types/sync/history-sqlite.d.ts.map +1 -0
- package/dist/types/sync/history.d.ts +70 -0
- package/dist/types/sync/history.d.ts.map +1 -0
- package/dist/types/sync/index.d.ts +4 -0
- package/dist/types/sync/index.d.ts.map +1 -0
- package/dist/types/sync/journal-sqlite.d.ts +51 -0
- package/dist/types/sync/journal-sqlite.d.ts.map +1 -0
- package/dist/types/sync/journal.d.ts +107 -0
- package/dist/types/sync/journal.d.ts.map +1 -0
- package/dist/types/sync/live-tails.d.ts +30 -0
- package/dist/types/sync/live-tails.d.ts.map +1 -0
- package/dist/types/sync/node-sqlite.d.ts +7 -0
- package/dist/types/sync/node-sqlite.d.ts.map +1 -0
- package/dist/types/sync/projection.d.ts +10 -0
- package/dist/types/sync/projection.d.ts.map +1 -0
- package/dist/types/sync/recovery.d.ts +25 -0
- package/dist/types/sync/recovery.d.ts.map +1 -0
- package/dist/types/sync/retry.d.ts +25 -0
- package/dist/types/sync/retry.d.ts.map +1 -0
- package/dist/types/sync/schema.d.ts +4 -0
- package/dist/types/sync/schema.d.ts.map +1 -0
- package/dist/types/sync/sql.d.ts +38 -0
- package/dist/types/sync/sql.d.ts.map +1 -0
- package/dist/types/sync/sqlite-file.d.ts +9 -0
- package/dist/types/sync/sqlite-file.d.ts.map +1 -0
- package/dist/types/sync/sqlite.d.ts +6 -0
- package/dist/types/sync/sqlite.d.ts.map +1 -0
- package/dist/types/sync/worker.d.ts +63 -0
- package/dist/types/sync/worker.d.ts.map +1 -0
- package/docs/consuming.md +452 -53
- package/docs/deploy.md +218 -47
- package/docs/{sync-experiment.md → durable-sessions.md} +77 -72
- package/docs/feedback.md +116 -0
- package/docs/harnesses.md +212 -88
- package/docs/sync-history.md +29 -13
- package/docs/sync-integration.md +52 -66
- package/package.json +43 -25
- package/src/accounts/chatgpt.ts +194 -0
- package/src/accounts/check.ts +112 -0
- package/src/accounts/claude.ts +111 -0
- package/src/accounts/endpoint.ts +151 -0
- package/src/accounts/http.ts +97 -0
- package/src/accounts/index.ts +19 -0
- package/src/client/client.ts +604 -670
- package/src/client/connection.ts +371 -0
- package/src/client/history.ts +29 -52
- package/src/client/index.ts +11 -2
- package/src/client/listeners.ts +20 -0
- package/src/client/logins.ts +105 -0
- package/src/client/rpc.ts +144 -0
- package/src/client/streams.ts +488 -0
- package/src/client/transports.ts +62 -8
- package/src/client/turns.ts +171 -0
- package/src/core/agents/acp/acp-agent.ts +94 -118
- package/src/core/agents/acp/adapter.ts +20 -9
- package/src/core/agents/acp/client.ts +125 -47
- package/src/core/agents/acp/known-agents.ts +36 -4
- package/src/core/agents/acp/mappings.ts +64 -18
- package/src/core/agents/acp/requests.ts +125 -0
- package/src/core/agents/attachments.ts +18 -0
- package/src/core/agents/base.ts +120 -42
- package/src/core/agents/claude-code/adapter.ts +177 -238
- package/src/core/agents/claude-code/approvals.ts +270 -0
- package/src/core/agents/claude-code/claude-agent.ts +175 -158
- package/src/core/agents/claude-code/credentials.ts +171 -0
- package/src/core/agents/claude-code/events.ts +55 -0
- package/src/core/agents/claude-code/login.ts +269 -0
- package/src/core/agents/claude-code/mcp.ts +206 -0
- package/src/core/agents/claude-code/models.ts +15 -9
- package/src/core/agents/claude-code/options.ts +326 -39
- package/src/core/agents/claude-code/outcome.ts +209 -0
- package/src/core/agents/claude-code/session-pool.ts +136 -0
- package/src/core/agents/claude-code/session.ts +513 -0
- package/src/core/agents/claude-code/spawn.ts +144 -0
- package/src/core/agents/claude-code/spend.ts +160 -0
- package/src/core/agents/claude-code/tools.ts +47 -0
- package/src/core/agents/claude-code/turn-usage.ts +135 -0
- package/src/core/agents/claude-code/turn.ts +232 -0
- package/src/core/agents/codex-app-server/adapter.ts +314 -117
- package/src/core/agents/codex-app-server/client.ts +186 -84
- package/src/core/agents/codex-app-server/codex-agent.ts +343 -0
- package/src/core/agents/codex-app-server/commands.ts +228 -0
- package/src/core/agents/codex-app-server/credentials.ts +126 -0
- package/src/core/agents/codex-app-server/effort.ts +29 -0
- package/src/core/agents/codex-app-server/events.ts +47 -0
- package/src/core/agents/codex-app-server/homes.ts +64 -0
- package/src/core/agents/codex-app-server/input.ts +60 -0
- package/src/core/agents/codex-app-server/items.ts +149 -0
- package/src/core/agents/codex-app-server/login.ts +180 -0
- package/src/core/agents/codex-app-server/mcp.ts +182 -37
- package/src/core/agents/codex-app-server/models.ts +99 -46
- package/src/core/agents/codex-app-server/options.ts +146 -0
- package/src/core/agents/codex-app-server/plan-approval.ts +135 -0
- package/src/core/agents/codex-app-server/protocol.ts +117 -0
- package/src/core/agents/codex-app-server/requests.ts +332 -0
- package/src/core/agents/codex-app-server/session.ts +285 -0
- package/src/core/agents/codex-app-server/subagents.ts +108 -42
- package/src/core/agents/codex-app-server/thread-settings.ts +279 -0
- package/src/core/agents/codex-app-server/turn-items.ts +88 -0
- package/src/core/agents/codex-app-server/turn.ts +463 -0
- package/src/core/agents/config-fingerprint.ts +7 -14
- package/src/core/agents/credentials.ts +98 -0
- package/src/core/agents/elicitation.ts +75 -0
- package/src/core/agents/inherit-config.ts +21 -0
- package/src/core/agents/login.ts +116 -0
- package/src/core/agents/mcp-config.ts +112 -8
- package/src/core/agents/plan.ts +25 -0
- package/src/core/agents/registry.ts +21 -4
- package/src/core/agents/session-agent.ts +96 -4
- package/src/core/agents/{session-store.ts → session-pool.ts} +11 -5
- package/src/core/agents/stderr-tail.ts +75 -0
- package/src/core/agents/types.ts +40 -5
- package/src/core/index.ts +58 -48
- package/src/core/presets.ts +100 -39
- package/src/core/processes/identity.ts +113 -0
- package/src/core/processes/lifeline.ts +170 -0
- package/src/core/processes/native-processes.ts +379 -0
- package/src/core/processes/process-table.ts +174 -0
- package/src/core/provision/cache-trust.ts +121 -0
- package/src/core/provision/cache-usage.ts +69 -0
- package/src/core/provision/checksums.ts +64 -0
- package/src/core/provision/extract.ts +11 -2
- package/src/core/provision/index.ts +4 -1
- package/src/core/provision/install-build.ts +136 -0
- package/src/core/provision/npm.ts +112 -17
- package/src/core/provision/pins.ts +9 -33
- package/src/core/provision/platform.ts +12 -1
- package/src/core/provision/provisioner.ts +329 -397
- package/src/core/provision/releases.ts +86 -0
- package/src/core/provision/tools.ts +329 -0
- package/src/core/proxy/anthropic-proxy.ts +55 -25
- package/src/core/proxy/api-key-store.ts +2 -12
- package/src/core/proxy/loopback.ts +106 -0
- package/src/core/runtime/agent-runtime.ts +327 -498
- package/src/core/runtime/event-processor.ts +197 -70
- package/src/core/runtime/harness-clis.ts +61 -0
- package/src/core/runtime/harness-logins.ts +328 -0
- package/src/core/runtime/login-reads.ts +78 -0
- package/src/core/runtime/model-lists.ts +33 -48
- package/src/core/runtime/permission-policy.ts +113 -0
- package/src/core/runtime/request-broker.ts +204 -0
- package/src/core/runtime/steering.ts +112 -0
- package/src/core/runtime/turn-outcome.ts +30 -0
- package/src/core/runtime/turn.ts +360 -0
- package/src/core/utils/bounded.ts +12 -0
- package/src/core/utils/deadline.ts +38 -0
- package/src/core/utils/errors.ts +113 -21
- package/src/core/utils/is-record.ts +4 -0
- package/src/core/utils/loopback.ts +10 -0
- package/src/protocol/account.ts +104 -0
- package/src/protocol/auth.ts +199 -0
- package/src/protocol/canonical.ts +16 -0
- package/src/protocol/clis.ts +69 -0
- package/src/protocol/config.ts +60 -6
- package/src/protocol/conversation.ts +272 -0
- package/src/protocol/credentials.ts +145 -0
- package/src/protocol/errors.ts +78 -20
- package/src/protocol/execution.ts +5 -2
- package/src/protocol/factories.ts +55 -7
- package/src/protocol/guards.ts +55 -2
- package/src/protocol/harness.ts +56 -6
- package/src/protocol/history.ts +72 -64
- package/src/protocol/ids.ts +0 -12
- package/src/protocol/index.ts +9 -0
- package/src/protocol/lifecycle.ts +250 -79
- package/src/protocol/meta-keys.ts +17 -0
- package/src/protocol/meta.ts +3 -3
- package/src/protocol/models.ts +2 -43
- package/src/protocol/part-input.ts +2 -1
- package/src/protocol/parts.ts +12 -3
- package/src/protocol/reduce.ts +302 -413
- package/src/protocol/selectors.ts +1 -20
- package/src/protocol/seq-cursor.ts +14 -0
- package/src/protocol/stop-reasons.ts +1 -1
- package/src/protocol/thinking.ts +1 -30
- package/src/protocol/time.ts +2 -2
- package/src/protocol/tool-closure.ts +93 -0
- package/src/protocol/tool-state.ts +19 -4
- package/src/protocol/verify.ts +222 -92
- package/src/protocol/vocabulary.ts +21 -5
- package/src/protocol/wire-api.ts +232 -0
- package/src/protocol/wire.ts +351 -64
- package/src/server/acp/binding.ts +63 -103
- package/src/server/acp/session-records.ts +53 -0
- package/src/server/acp/translate.ts +129 -20
- package/src/server/agent-server.ts +223 -387
- package/src/server/bin.ts +280 -78
- package/src/server/feedback.ts +204 -14
- package/src/server/history.ts +116 -122
- package/src/server/index.ts +3 -8
- package/src/server/install.ts +107 -8
- package/src/server/open-parts.ts +95 -0
- package/src/server/routes.ts +391 -0
- package/src/server/secrets.ts +24 -0
- package/src/server/session-gate.ts +69 -0
- package/src/server/session-log.ts +14 -2
- package/src/server/session-store.ts +136 -72
- package/src/server/subscriptions.ts +232 -0
- package/src/server/transports.ts +125 -25
- package/src/server/wire-error.ts +31 -45
- package/src/sync/event-log.ts +31 -3
- package/src/sync/fit.ts +27 -11
- package/src/sync/history-reader.ts +10 -5
- package/src/sync/history-sqlite.ts +37 -42
- package/src/sync/history.ts +9 -15
- package/src/sync/index.ts +17 -5
- package/src/sync/journal-sqlite.ts +162 -76
- package/src/sync/journal.ts +91 -32
- package/src/sync/live-tails.ts +107 -0
- package/src/sync/projection.ts +35 -0
- package/src/sync/recovery.ts +80 -51
- package/src/sync/schema.ts +27 -6
- package/docs/rfds/0001-deterministic-echo-ids.md +0 -44
- package/docs/rfds/0002-native-subagents.md +0 -197
- package/src/client/request.ts +0 -19
- package/src/core/agents/claude-code/generator-session.ts +0 -572
- package/src/core/agents/claude-code/session-manager.ts +0 -166
- package/src/core/agents/codex-app-server/codex-app-server-agent.ts +0 -962
- package/src/core/agents/codex-items.ts +0 -149
- package/src/core/agents/codex-sdk/adapter.ts +0 -237
- package/src/core/agents/codex-sdk/codex-sdk-agent.ts +0 -330
- package/src/core/agents/tool-meta.ts +0 -68
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,SAAS,E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I,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IACtC,qEAAqE;IACrE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,mGAAmG;AACnG,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,EAAE,KAAK,EAAE,UAAU,GAAG,YAAY,CAI1F;AAED;;;;GAIG;AACH,qBAAa,aAAa;IAYxB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,GAAG;IAZrB,qFAAqF;IACrF,OAAO,CAAC,WAAW,CAAC,CAAS;IAC7B;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA6B;IACpD,qEAAqE;IACrE,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA+B;gBAGzC,MAAM,EAAE,eAAe,EACvB,GAAG,EAAE,MAAM;IAG7B,gGAAgG;IAChG,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAUtE,gHAAgH;IAC1G,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAY5E;;;;OAIG;IACG,OAAO,CACZ,QAAQ,EAAE,MAAM,EAChB,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,YAAY,EAC/B,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS,GAC5D,OAAO,CAAC,IAAI,CAAC;CAoBhB"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { AgentHarness, ModelDescriptor, ThinkingLevel } from "../../../protocol/index.ts";
|
|
2
|
+
import { type CodexConnection } from "./client.ts";
|
|
3
|
+
/** One `model/list` entry, as far as agent-server reads it. */
|
|
4
|
+
export type CodexModel = Record<string, unknown>;
|
|
5
|
+
/** A model's thinking levels, and the native effort that `off` means for it. */
|
|
6
|
+
export interface CodexModelThinking {
|
|
7
|
+
levels: readonly ThinkingLevel[];
|
|
8
|
+
off?: "none" | "minimal";
|
|
9
|
+
/** The native effort the model runs when the thread sets none. */
|
|
10
|
+
defaultEffort?: string;
|
|
11
|
+
}
|
|
12
|
+
/** The level a native Codex effort is: `none` and `minimal` are `off`. */
|
|
13
|
+
export declare function codexThinkingLevel(effort: unknown): ThinkingLevel | undefined;
|
|
14
|
+
/** Every page of `model/list`, hidden models included. Throws when the CLI cannot answer. */
|
|
15
|
+
export declare function readCodexModels(client: Pick<CodexConnection, "request">): Promise<CodexModel[]>;
|
|
16
|
+
/**
|
|
17
|
+
* What each model accepts, by its `model` and `id`. Codex's `none` or
|
|
18
|
+
* `minimal` is `off`, remembered so `off` sends the value the model
|
|
19
|
+
* advertised (`none` when it offers both).
|
|
20
|
+
*/
|
|
21
|
+
export declare function codexModelThinking(models: readonly CodexModel[]): Map<string, CodexModelThinking>;
|
|
22
|
+
/**
|
|
23
|
+
* The thinking levels each model the logged-in account can run accepts, from
|
|
24
|
+
* `model/list`. `undefined` when the CLI cannot answer; callers fall back to
|
|
25
|
+
* the catalog.
|
|
26
|
+
*/
|
|
27
|
+
export declare function readCodexModelThinking(client: Pick<CodexConnection, "request">): Promise<ReadonlyMap<string, CodexModelThinking> | undefined>;
|
|
28
|
+
/** What a new thread runs when its turns name no model or effort. */
|
|
29
|
+
export interface CodexThreadDefaults {
|
|
30
|
+
model?: string;
|
|
31
|
+
/** The configured effort; `null` when none is, so each model runs its own default. */
|
|
32
|
+
effort?: string | null;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Codex's defaults for a new thread in `cwd`: the model and effort its
|
|
36
|
+
* configuration selects, else the model `model/list` marks default. Throws
|
|
37
|
+
* when Codex cannot say.
|
|
38
|
+
*/
|
|
39
|
+
export declare function readCodexThreadDefaults(client: Pick<CodexConnection, "request">, cwd: string): Promise<CodexThreadDefaults>;
|
|
40
|
+
/**
|
|
41
|
+
* The models Codex offers in a picker, in the shared shape. Hidden models are
|
|
42
|
+
* left out. `configuredModel` is the default when given; otherwise Codex's
|
|
43
|
+
* own default is.
|
|
44
|
+
*/
|
|
45
|
+
export declare function codexModelDescriptors(models: readonly CodexModel[], harness: Extract<AgentHarness, "codex-app-server">, configuredModel?: string): ModelDescriptor[];
|
|
46
|
+
/** What one `codex app-server` says about its models. */
|
|
47
|
+
export interface CodexModelListing {
|
|
48
|
+
models: CodexModel[];
|
|
49
|
+
/**
|
|
50
|
+
* The model a new thread in the listing's folder runs when the turn names
|
|
51
|
+
* none, when Codex's configuration selects one. Codex's own `isDefault`
|
|
52
|
+
* ignores it.
|
|
53
|
+
*/
|
|
54
|
+
configuredModel?: string;
|
|
55
|
+
}
|
|
56
|
+
/** Read the models and the configured default from a running app-server. */
|
|
57
|
+
export declare function readCodexListing(client: Pick<CodexConnection, "request">, cwd: string): Promise<CodexModelListing>;
|
|
58
|
+
/**
|
|
59
|
+
* Start `codex app-server` only to list its models, for the login its
|
|
60
|
+
* environment selects (or `login` performs). No thread is started, and the
|
|
61
|
+
* process ends with the listing.
|
|
62
|
+
*/
|
|
63
|
+
export declare function listCodexModels(client: CodexConnection, cwd: string, { signal, login, }?: {
|
|
64
|
+
signal?: AbortSignal;
|
|
65
|
+
login?: (client: CodexConnection) => Promise<void>;
|
|
66
|
+
}): Promise<CodexModelListing>;
|
|
67
|
+
//# sourceMappingURL=models.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAI/F,OAAO,EAAE,KAAK,eAAe,EAAS,MAAM,aAAa,CAAC;AAO1D,+DAA+D;AAC/D,MAAM,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AM,GACtB,eAAe,EAAE,CA0BnB;AAED,yDAAyD;AACzD,MAAM,WAAW,iBAAiB;IACjC,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,4EAA4E;AAC5E,wBAAsB,gBAAgB,CACrC,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,EACxC,GAAG,EAAE,MAAM,GACT,OAAO,CAAC,iBAAiB,CAAC,CAO5B;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CACpC,MAAM,EAAE,eAAe,EACvB,GAAG,EAAE,MAAM,EACX,EACC,MAAM,EACN,KAAK,GACL,GAAE;IAAE,MAAM,CAAC,EAAE,WAAW,CAAC;IAAC,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CAAO,GAClF,OAAO,CAAC,iBAAiB,CAAC,CAY5B"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { PermissionMode } from "../../../protocol/index.ts";
|
|
2
|
+
import type { AgentExecuteOptions } from "../base.ts";
|
|
3
|
+
import type { InheritConfig } from "../inherit-config.ts";
|
|
4
|
+
import type { CodexAppServerClientOptions } from "./client.ts";
|
|
5
|
+
import type { CodexAuth } from "./credentials.ts";
|
|
6
|
+
/**
|
|
7
|
+
* Why a turn without tools (`disableTools`) fails on Codex. With every
|
|
8
|
+
* feature that offers one turned off, Codex 0.160 still gives a code-mode
|
|
9
|
+
* model its `exec` and `wait`, `apply_patch` inside `exec`, its sub-agent
|
|
10
|
+
* tools and `request_user_input` (`.context/rehearsal/m3-tools.ts`), so the
|
|
11
|
+
* model would still act: the turn is refused instead of running tools the
|
|
12
|
+
* caller turned off.
|
|
13
|
+
*/
|
|
14
|
+
export declare const CODEX_TOOLS_REQUIRED = "Invalid request: Codex cannot run a turn without tools (disableTools), since it gives the model its tools however it is configured. Turn tools on; permission mode plan or default keeps it from changing anything unasked.";
|
|
15
|
+
export declare function mapSandbox(mode: PermissionMode | undefined): string;
|
|
16
|
+
/** What a Codex process runs with: a turn that asks for anything else runs in another. */
|
|
17
|
+
export interface CodexProcessIdentity {
|
|
18
|
+
cwd: string;
|
|
19
|
+
approvalPolicy: string;
|
|
20
|
+
/** The thread's sandbox: the one it started in, or the one an approved plan switched it to. */
|
|
21
|
+
sandbox: string;
|
|
22
|
+
systemPromptAppend?: string;
|
|
23
|
+
subagentMode?: "turn";
|
|
24
|
+
envFingerprint: string;
|
|
25
|
+
directoriesFingerprint: string;
|
|
26
|
+
}
|
|
27
|
+
/** The process a turn with these options runs in. */
|
|
28
|
+
export declare function processIdentity(options: AgentExecuteOptions): CodexProcessIdentity;
|
|
29
|
+
/** Whether a turn with these options can run in a process of `existing`'s, on its thread. */
|
|
30
|
+
export declare function codexSessionCompatible(existing: CodexProcessIdentity & {
|
|
31
|
+
threadId: string;
|
|
32
|
+
}, options: AgentExecuteOptions): boolean;
|
|
33
|
+
/** How the harness starts `codex app-server` for a folder, its `env` and a login. */
|
|
34
|
+
export declare function clientOptionsFor(codexPath: string, { cwd, env }: {
|
|
35
|
+
cwd: string;
|
|
36
|
+
env?: Record<string, string>;
|
|
37
|
+
}, auth: CodexAuth | undefined, experimentalApi: boolean): Omit<CodexAppServerClientOptions, "processes">;
|
|
38
|
+
/** The params `thread/start` and `thread/resume` take for a turn with these options. */
|
|
39
|
+
export declare function threadParams(options: AgentExecuteOptions, inheritConfig?: InheritConfig): Record<string, unknown>;
|
|
40
|
+
//# sourceMappingURL=options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtD,OAAO,KAAK,EAAE,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AM,CAAC,MAAM,EAAE,OAAO,CAAC,CA4BzB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type CodexRawEvent } from "./events.ts";
|
|
2
|
+
import { type ThreadSettings } from "./thread-settings.ts";
|
|
3
|
+
import type { CodexTurn, NativeTurn } from "./turn.ts";
|
|
4
|
+
/** Codex's turn that carries out the user's answer to its plan. */
|
|
5
|
+
export interface NextTurn {
|
|
6
|
+
params: Record<string, unknown>;
|
|
7
|
+
settings: ThreadSettings;
|
|
8
|
+
/** The thread's sandbox once it runs. */
|
|
9
|
+
sandbox: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Codex ends its Plan-mode turn with the plan and asks nothing; its TUI then
|
|
13
|
+
* asks whether to implement it, as the engine does here. The answer runs as
|
|
14
|
+
* Codex's next turn, within this one, which this returns; nothing when the
|
|
15
|
+
* turn ends here. A turn that does not go on once Codex's ends (a managed
|
|
16
|
+
* one), or has nobody to ask, presents the plan as written.
|
|
17
|
+
*/
|
|
18
|
+
export declare function askPlan(turn: CodexTurn, native: NativeTurn): AsyncGenerator<CodexRawEvent, NextTurn | undefined>;
|
|
19
|
+
//# sourceMappingURL=plan-approval.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan-approval.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/plan-approval.ts"],"names":[],"mappings":"AAIA,OAAO,EAA6C,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAI5F,OAAO,EAAE,KAAK,cAAc,EAAuB,MAAM,sBAAsB,CAAC;AAChF,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAWvD,mEAAmE;AACnE,MAAM,WAAW,QAAQ;IACxB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,QAAQ,EAAE,cAAc,CAAC;IACzB,yCAAyC;IACzC,OAAO,EAAE,MAAM,CAAC;CAChB;AAQD;;;;;;GAMG;AACH,wBAAuB,OAAO,CAC7B,IAAI,EAAE,SAAS,EACf,MAAM,EAAE,UAAU,GAChB,cAAc,CAAC,aAAa,EAAE,QAAQ,GAAG,SAAS,CAAC,CA0FrD"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the harness reads of Codex's app-server protocol (v2), as of the pinned
|
|
3
|
+
* CLI: the decoders below check what it relies on. Codex sends more.
|
|
4
|
+
*/
|
|
5
|
+
/** A JSON-RPC notification Codex sends (server → client, no id). */
|
|
6
|
+
export interface CodexNotification {
|
|
7
|
+
method: string;
|
|
8
|
+
params: Record<string, unknown> & {
|
|
9
|
+
threadId?: string;
|
|
10
|
+
turnId?: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
/** One edit of a file change. Its `kind` is a string before 0.160, `{type, move_path}` from it. */
|
|
14
|
+
export interface CodexFileChange {
|
|
15
|
+
path: string;
|
|
16
|
+
kind?: string | {
|
|
17
|
+
type?: string;
|
|
18
|
+
move_path?: string | null;
|
|
19
|
+
};
|
|
20
|
+
diff?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* One of a thread's items (`ThreadItem`). Every field but `type` and `id`
|
|
24
|
+
* belongs to some item types only.
|
|
25
|
+
*/
|
|
26
|
+
export interface CodexItem {
|
|
27
|
+
type: string;
|
|
28
|
+
id: string;
|
|
29
|
+
/** An `agentMessage`'s, a `reasoning`'s or a `plan`'s text. */
|
|
30
|
+
text?: string;
|
|
31
|
+
/** A `commandExecution`: what it runs, in which of Codex's processes, and how it ended. */
|
|
32
|
+
command?: string | string[];
|
|
33
|
+
processId?: string | null;
|
|
34
|
+
/**
|
|
35
|
+
* Who started it. A poll of, or input to, a process an earlier turn
|
|
36
|
+
* started is `unifiedExecInteraction`; the user's own command `userShell`.
|
|
37
|
+
*/
|
|
38
|
+
source?: string;
|
|
39
|
+
aggregatedOutput?: string | null;
|
|
40
|
+
exitCode?: number | null;
|
|
41
|
+
status?: string;
|
|
42
|
+
/** A `fileChange`'s edits. */
|
|
43
|
+
changes?: CodexFileChange[];
|
|
44
|
+
/** An `mcpToolCall`. */
|
|
45
|
+
server?: string;
|
|
46
|
+
tool?: string;
|
|
47
|
+
arguments?: unknown;
|
|
48
|
+
result?: unknown;
|
|
49
|
+
error?: {
|
|
50
|
+
message?: string;
|
|
51
|
+
} | string;
|
|
52
|
+
/** A `webSearch`. */
|
|
53
|
+
query?: string;
|
|
54
|
+
/** A `collabAgentToolCall`: a sub-agent spawned, messaged or waited on. */
|
|
55
|
+
receiverThreadIds?: string[];
|
|
56
|
+
prompt?: string | null;
|
|
57
|
+
model?: string | null;
|
|
58
|
+
agentsStates?: Record<string, {
|
|
59
|
+
status: string;
|
|
60
|
+
message?: string | null;
|
|
61
|
+
}>;
|
|
62
|
+
/** A `subAgentActivity`: what a sub-agent's thread did. */
|
|
63
|
+
agentThreadId?: string;
|
|
64
|
+
agentPath?: string;
|
|
65
|
+
kind?: "started" | "interacted" | "interrupted" | "completed";
|
|
66
|
+
/** A `userMessage`'s client id: a steer's id (`turn/steer`'s `clientUserMessageId`). */
|
|
67
|
+
clientId?: string | null;
|
|
68
|
+
}
|
|
69
|
+
/** A turn as `turn/started` and `turn/completed` name it (`Turn`). */
|
|
70
|
+
export interface CodexTurnInfo {
|
|
71
|
+
id?: string;
|
|
72
|
+
/** `completed`, `interrupted` (stopped: a cancel, or an approval answered cancel), `failed`. */
|
|
73
|
+
status?: string;
|
|
74
|
+
/** Why it failed: Codex's words, and its typed code (`codexErrorInfo`). */
|
|
75
|
+
error?: {
|
|
76
|
+
message?: string;
|
|
77
|
+
codexErrorInfo?: unknown;
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
/** What `thread/start` and `thread/resume` answer. */
|
|
81
|
+
export interface CodexThreadOpened {
|
|
82
|
+
thread?: {
|
|
83
|
+
id?: string;
|
|
84
|
+
};
|
|
85
|
+
model?: unknown;
|
|
86
|
+
reasoningEffort?: unknown;
|
|
87
|
+
collaborationMode?: {
|
|
88
|
+
mode?: unknown;
|
|
89
|
+
} | null;
|
|
90
|
+
}
|
|
91
|
+
/** The item a notification carries (`item/started`, `item/completed`), when it names its type and id. */
|
|
92
|
+
export declare function codexItem(n: CodexNotification): CodexItem | undefined;
|
|
93
|
+
/** The turn a notification names (`turn/started`, `turn/completed`). */
|
|
94
|
+
export declare function codexTurn(n: CodexNotification): CodexTurnInfo | undefined;
|
|
95
|
+
/** Whether a notification ends Codex's turn: its completion, or an error Codex will not retry. */
|
|
96
|
+
export declare function endsNativeTurn(n: CodexNotification): boolean;
|
|
97
|
+
/** An `error` Codex retries what failed after: the turn goes on, and more is to come. */
|
|
98
|
+
export declare function retrying(n: CodexNotification): boolean;
|
|
99
|
+
//# sourceMappingURL=protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/protocol.ts"],"names":[],"mappings":"AAEA;;;GAGG;AAEH,oEAAoE;AACpE,MAAM,WAAW,iBAAiB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACzE;AAED,mGAAmG;AACnG,MAAM,WAAW,eAAe;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,GAAG;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;IAC7D,IAAI,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,SAAS;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,+DAA+D;IAC/D,I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ACtE,MAAM,WAAW,aAAa;IAC7B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,gGAAgG;IAChG,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2EAA2E;IAC3E,KAAK,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,cAAc,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;CACvD;AAED,sDAAsD;AACtD,MAAM,WAAW,iBAAiB;IACjC,MAAM,CAAC,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACzB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,iBAAiB,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;CAC9C;AAOD,yGAAyG;AACzG,wBAAgB,SAAS,CAAC,CAAC,EAAE,iBAAiB,GAAG,SAAS,GAAG,SAAS,CAGrE;AAED,wEAAwE;AACxE,wBAAgB,SAAS,CAAC,CAAC,EAAE,iBAAiB,GAAG,aAAa,GAAG,SAAS,CAczE;AAED,kGAAkG;AAClG,wBAAgB,cAAc,CAAC,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAE5D;AAED,yFAAyF;AACzF,wBAAgB,QAAQ,CAAC,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAEtD"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type PermissionMode } from "../../../protocol/index.ts";
|
|
2
|
+
import type { ElicitationRequestHandler, PermissionRequestHandler } from "../base.ts";
|
|
3
|
+
import { type CodexAuth } from "./credentials.ts";
|
|
4
|
+
import type { CodexSession } from "./session.ts";
|
|
5
|
+
import type { CodexTurnSubagents } from "./subagents.ts";
|
|
6
|
+
import type { TurnItems } from "./turn-items.ts";
|
|
7
|
+
/**
|
|
8
|
+
* What Codex's requests need of the turn that has the session: set when a
|
|
9
|
+
* turn takes it, cleared when it ends, so no request answers for another.
|
|
10
|
+
*/
|
|
11
|
+
export interface CodexTurnScope {
|
|
12
|
+
/** Credentials belong only to the current turn. */
|
|
13
|
+
auth?: CodexAuth;
|
|
14
|
+
onPermissionRequest?: PermissionRequestHandler;
|
|
15
|
+
/** Present when the turn's client answers questions and MCP input. */
|
|
16
|
+
onElicitationRequest?: ElicitationRequestHandler;
|
|
17
|
+
signal: AbortSignal;
|
|
18
|
+
/** The threads the turn's managed sub-agents run in. */
|
|
19
|
+
subagents?: CodexTurnSubagents;
|
|
20
|
+
items: TurnItems;
|
|
21
|
+
/** The mode the turn runs in now: its own, until the user approves a plan. */
|
|
22
|
+
mode: PermissionMode;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Answer Codex's requests (server → client) for the turn that has the session.
|
|
26
|
+
* A request it cannot answer gets a refusal in its own shape, never a hang.
|
|
27
|
+
*/
|
|
28
|
+
export declare function bindServerRequests(session: CodexSession): void;
|
|
29
|
+
/**
|
|
30
|
+
* What "always" covers for a Codex approval: Codex keeps it itself, for the
|
|
31
|
+
* session (`acceptForSession`). For a plain command that is this exact
|
|
32
|
+
* command ("don't ask again for this command"); for a file change, these
|
|
33
|
+
* files. A network approval's "always" opens a host, and one with extra
|
|
34
|
+
* permissions or a write root grants those, so they offer none. Codex 0.160
|
|
35
|
+
* lists `acceptWithExecpolicyAmendment` for a command instead: a prefix rule
|
|
36
|
+
* it writes to the user's own rules, which an engine must not, so the session
|
|
37
|
+
* approval (which it honors though unlisted) is the one taken.
|
|
38
|
+
*/
|
|
39
|
+
export declare function codexAlways(method: string, params: Record<string, unknown>): {
|
|
40
|
+
rule: string;
|
|
41
|
+
} | null;
|
|
42
|
+
//# sourceMappingURL=requests.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/requests.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,cAAc,EAGnB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAQtF,OAAO,EAAE,KAAK,SAAS,EAAiB,MAAM,kBAAkB,CAAC;AAEjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC9B,mDAAmD;IACnD,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,mBAAmB,CAAC,EAAE,wBAAwB,CAAC;IAC/C,sEAAsE;IACtE,oBAAoB,CAAC,EAAE,yBAAyB,CAAC;IACjD,MAAM,EAAE,WAAW,CAAC;IACpB,wDAAwD;IACxD,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B,KAAK,EAAE,SAAS,CAAC;IACjB,8EAA8E;IAC9E,IAAI,EAAE,cAAc,CAAC;CACrB;AAkDD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI,CAoB9D;AAmMD;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAC1B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAazB"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { AgentExecuteOptions } from "../base.ts";
|
|
2
|
+
import type { InheritConfig } from "../inherit-config.ts";
|
|
3
|
+
import type { CodexConnection } from "./client.ts";
|
|
4
|
+
import { type CodexAuth } from "./credentials.ts";
|
|
5
|
+
import { CodexMcpState, type CodexTurnMcp } from "./mcp.ts";
|
|
6
|
+
import type { CodexModelThinking } from "./models.ts";
|
|
7
|
+
import { type CodexProcessIdentity } from "./options.ts";
|
|
8
|
+
import { type CodexTurnScope } from "./requests.ts";
|
|
9
|
+
import { CodexThread } from "./thread-settings.ts";
|
|
10
|
+
/** One `codex app-server` process, running a logical session's thread. */
|
|
11
|
+
export interface CodexSession extends CodexProcessIdentity {
|
|
12
|
+
client: CodexConnection;
|
|
13
|
+
threadId: string;
|
|
14
|
+
/** Native model connections retain the identity used at their first handshake. */
|
|
15
|
+
authFingerprint?: string;
|
|
16
|
+
mcp: CodexMcpState;
|
|
17
|
+
/** The logical session's thread settings, which outlive this process. */
|
|
18
|
+
thread: CodexThread;
|
|
19
|
+
/** The turn that has the session: Codex's requests answer for it alone. */
|
|
20
|
+
turn?: CodexTurnScope;
|
|
21
|
+
/**
|
|
22
|
+
* Host suspension left its MCP connections stale: the turn running on it
|
|
23
|
+
* finishes, and the next turn replaces the process.
|
|
24
|
+
*/
|
|
25
|
+
stale?: boolean;
|
|
26
|
+
/** The login it started with (`CodexSessions.loginChanged`): an older one's next turn replaces it. */
|
|
27
|
+
login: number;
|
|
28
|
+
/** What each model accepts, from this process's `model/list`; read once. */
|
|
29
|
+
modelThinking?: Promise<ReadonlyMap<string, CodexModelThinking> | undefined>;
|
|
30
|
+
idleTimer?: ReturnType<typeof setTimeout>;
|
|
31
|
+
}
|
|
32
|
+
/** Starts a connection to a new `codex app-server` for a turn's folder, `env` and login. */
|
|
33
|
+
export type CodexConnector = (options: AgentExecuteOptions, auth: CodexAuth | undefined, signal: AbortSignal) => Promise<CodexConnection>;
|
|
34
|
+
/**
|
|
35
|
+
* The Codex harness's sessions: each logical session's process, while it
|
|
36
|
+
* lives, and what outlives it (its thread settings, its home), plus the
|
|
37
|
+
* managed sessions whose native cleanup was not confirmed.
|
|
38
|
+
*/
|
|
39
|
+
export declare class CodexSessions {
|
|
40
|
+
private readonly connect;
|
|
41
|
+
private readonly idleMs;
|
|
42
|
+
/** The operator's: what a thread loads by itself, and whether every turn needs a home. */
|
|
43
|
+
private readonly inheritConfig;
|
|
44
|
+
private readonly pool;
|
|
45
|
+
private readonly threads;
|
|
46
|
+
private readonly homes;
|
|
47
|
+
/** Managed sessions whose process was not confirmed stopped: no successor runs until it is. */
|
|
48
|
+
private readonly unsettled;
|
|
49
|
+
/** Counts the login changes: a process keeps the login it read at its start. */
|
|
50
|
+
private login;
|
|
51
|
+
constructor(connect: CodexConnector, idleMs: number,
|
|
52
|
+
/** The operator's: what a thread loads by itself, and whether every turn needs a home. */
|
|
53
|
+
inheritConfig?: InheritConfig);
|
|
54
|
+
get(sessionId: string): CodexSession | undefined;
|
|
55
|
+
/** The turn's MCP servers, in the `CODEX_HOME` the session claims when the turn names one. */
|
|
56
|
+
mcpFor(options: AgentExecuteOptions): CodexTurnMcp;
|
|
57
|
+
/**
|
|
58
|
+
* The session's process for the turn, which takes it: the running one when
|
|
59
|
+
* the turn can run there as the same account, else a new one, on the same
|
|
60
|
+
* thread. Codex caches an authenticated model WebSocket across turns, so
|
|
61
|
+
* login alone cannot switch its identity: an account or key change
|
|
62
|
+
* restarts the process and resumes the thread. Same-account token renewal
|
|
63
|
+
* keeps it warm.
|
|
64
|
+
*/
|
|
65
|
+
acquire(options: AgentExecuteOptions, turn: CodexTurnScope, mcp: CodexTurnMcp): Promise<CodexSession>;
|
|
66
|
+
/** The turn is done with the session: an open process waits for the next one, at most `idleMs`. */
|
|
67
|
+
leave(sessionId: string, session: CodexSession, turn: CodexTurnScope): void;
|
|
68
|
+
/** Keep a managed session whose process could not be confirmed stopped from another turn. */
|
|
69
|
+
quarantine(sessionId: string, client: CodexConnection): void;
|
|
70
|
+
/** Whether releasing the session needs its native cleanup confirmed first. */
|
|
71
|
+
managed(sessionId: string): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Stop a quarantined session's process: whether its stop is confirmed now.
|
|
74
|
+
* Nothing, at once, when the session left none.
|
|
75
|
+
*/
|
|
76
|
+
stopUnsettled(sessionId: string): Promise<boolean> | undefined;
|
|
77
|
+
/**
|
|
78
|
+
* Unchanged MCP config reloads retain dead remote connections after VM
|
|
79
|
+
* resume: every process goes, but a turn that is running finishes first,
|
|
80
|
+
* and its session is replaced before the next (the strict thread/resume
|
|
81
|
+
* path).
|
|
82
|
+
*/
|
|
83
|
+
invalidate(): void;
|
|
84
|
+
/**
|
|
85
|
+
* The login changed: an app-server keeps the one it read at its start, so
|
|
86
|
+
* each session's next turn starts a new one, resuming its thread. A turn
|
|
87
|
+
* already setting up or running finishes on its own.
|
|
88
|
+
*/
|
|
89
|
+
loginChanged(): void;
|
|
90
|
+
/** Forget the session: its process, its thread settings and its home. */
|
|
91
|
+
release(sessionId: string): void;
|
|
92
|
+
terminateAll(): void;
|
|
93
|
+
private reuse;
|
|
94
|
+
private spawn;
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/session.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,KAAK,SAAS,EAA0B,MAAM,kBAAkB,CAAC;AAE1E,OAAO,EAAE,aAAa,EAAE,KAAK,YAAY,EAAgB,MAAM,UAAU,CAAC;AAC1E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EACN,KAAK,oBAAoB,EAIzB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,KAAK,cAAc,EAAsB,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,0EAA0E;AAC1E,MAAM,WAAW,YAAa,SAAQ,oBAAoB;IACzD,MAAM,EAAE,eAAe,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB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AG,YAAY;IAIlD;;;;;;;OAOG;IACG,OAAO,CACZ,OAAO,EAAE,mBAAmB,EAC5B,IAAI,EAAE,cAAc,EACpB,GAAG,EAAE,YAAY,GACf,OAAO,CAAC,YAAY,CAAC;IAgBxB,mGAAmG;IACnG,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,GAAG,IAAI;IAM3E,6FAA6F;IAC7F,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI;IAI5D,8EAA8E;IAC9E,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAInC;;;OAGG;IACH,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,SAAS;IAU9D;;;;;OAKG;IACH,UAAU,IAAI,IAAI;IASlB;;;;OAIG;IACH,YAAY,IAAI,IAAI;IAIpB,yEAAyE;IACzE,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAMhC,YAAY,IAAI,IAAI;YAMN,KAAK;YAgBL,KAAK;CAkDnB"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { type CodexConnection } from "./client.ts";
|
|
2
|
+
import { type TurnCommands } from "./commands.ts";
|
|
3
|
+
import { type CodexNotification } from "./protocol.ts";
|
|
4
|
+
import type { NativeTurn, TurnStop } from "./turn.ts";
|
|
5
|
+
/** Native ownership and cleanup for ONE execution; scheduling stays in Codex. */
|
|
6
|
+
export declare class CodexTurnSubagents {
|
|
7
|
+
private readonly client;
|
|
8
|
+
private readonly root;
|
|
9
|
+
private readonly timeoutMs;
|
|
10
|
+
private readonly parents;
|
|
11
|
+
private readonly candidates;
|
|
12
|
+
private readonly active;
|
|
13
|
+
private activeAtParentEnd;
|
|
14
|
+
constructor(client: CodexConnection, root: string, timeoutMs: number);
|
|
15
|
+
observe(notification: CodexNotification): void;
|
|
16
|
+
private read;
|
|
17
|
+
owns(id: string): Promise<boolean>;
|
|
18
|
+
private descendants;
|
|
19
|
+
/** Root must have stopped first. Returns whether it left unfinished delegated work. */
|
|
20
|
+
settle(): Promise<boolean>;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* How a managed turn (`subagentMode: "turn"`) stops: once Codex's turn ends,
|
|
24
|
+
* or a cancel comes, every worker it delegated to is stopped and its process
|
|
25
|
+
* ends by its own shutdown, whose confirmation is the cancel's. A managed turn
|
|
26
|
+
* never asks about a plan, never puts the thread's settings back and never
|
|
27
|
+
* holds steers: it ends with its native cleanup (`continues` is false). A
|
|
28
|
+
* cleanup that is not confirmed quarantines the session.
|
|
29
|
+
*/
|
|
30
|
+
export declare class ManagedStop implements TurnStop {
|
|
31
|
+
private readonly subagents;
|
|
32
|
+
private readonly client;
|
|
33
|
+
private readonly threadId;
|
|
34
|
+
private readonly commands;
|
|
35
|
+
private readonly signal;
|
|
36
|
+
/** Every cleanup request's deadline; five of them, the whole cleanup's. */
|
|
37
|
+
private readonly graceMs;
|
|
38
|
+
/** Keep the session from another turn until its process is confirmed stopped. */
|
|
39
|
+
private readonly quarantine;
|
|
40
|
+
readonly continues = false;
|
|
41
|
+
private finishing?;
|
|
42
|
+
constructor(subagents: CodexTurnSubagents, client: CodexConnection, threadId: string, commands: TurnCommands, signal: AbortSignal,
|
|
43
|
+
/** Every cleanup request's deadline; five of them, the whole cleanup's. */
|
|
44
|
+
graceMs: number,
|
|
45
|
+
/** Keep the session from another turn until its process is confirmed stopped. */
|
|
46
|
+
quarantine: () => void);
|
|
47
|
+
nativeEnded(native: NativeTurn, n: CodexNotification): void;
|
|
48
|
+
cancel(native?: NativeTurn): Promise<boolean>;
|
|
49
|
+
outcomeUnknown(): Promise<string[]>;
|
|
50
|
+
dispose(): Promise<void>;
|
|
51
|
+
private finish;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=subagents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sub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AO,CAAC,QAAQ,CAAC,UAAU;IAZ5B,QAAQ,CAAC,SAAS,SAAS;IAC3B,OAAO,CAAC,SAAS,CAAC,CAAmB;gBAGnB,SAAS,EAAE,kBAAkB,EAC7B,MAAM,EAAE,eAAe,EACvB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,YAAY,EACtB,MAAM,EAAE,WAAW;IACpC,2EAA2E;IAC1D,OAAO,EAAE,MAAM;IAChC,iFAAiF;IAChE,UAAU,EAAE,MAAM,IAAI;IAGxC,WAAW,CAAC,MAAM,EAAE,UAAU,EAAE,CAAC,EAAE,iBAAiB,GAAG,IAAI;IAK3D,MAAM,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC;IAIvC,cAAc,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAKnC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAM9B,OAAO,CAAC,MAAM;CA0Cd"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { type PermissionMode } from "../../../protocol/index.ts";
|
|
2
|
+
import type { AgentExecuteOptions, AppliedExecution } from "../base.ts";
|
|
3
|
+
import type { CodexThreadOpened } from "./protocol.ts";
|
|
4
|
+
import type { CodexSession } from "./session.ts";
|
|
5
|
+
/**
|
|
6
|
+
* A thread's settings, as the engine knows them: what Codex reported when the
|
|
7
|
+
* process took the thread, and what turns sent since. Codex keeps a turn's
|
|
8
|
+
* model, effort and collaboration mode on the thread, across turns and
|
|
9
|
+
* resumes. A value: a turn works out the next one and commits it once it is
|
|
10
|
+
* sent, so a turn Codex refuses changes nothing.
|
|
11
|
+
*/
|
|
12
|
+
export interface ThreadSettings {
|
|
13
|
+
/** The thread's model, as Codex resolved it (config.toml included). */
|
|
14
|
+
readonly model?: string;
|
|
15
|
+
/** The model Codex reported for the thread, until a turn selects another. */
|
|
16
|
+
readonly reportedModel?: string;
|
|
17
|
+
/** The thread's reasoning effort: Codex's own, then the last one a turn sent (they persist). */
|
|
18
|
+
readonly effort?: string;
|
|
19
|
+
/** The thread's collaboration mode (`plan` or `default`). */
|
|
20
|
+
readonly collaborationMode?: string;
|
|
21
|
+
/** A turn set the thread's model, which may not be the default. */
|
|
22
|
+
readonly modelSet: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* A turn set the thread's effort. Codex has no setting for "the model's
|
|
25
|
+
* own" back, so from then on every turn that names no level sends the
|
|
26
|
+
* default for its model.
|
|
27
|
+
*/
|
|
28
|
+
readonly effortSet: boolean;
|
|
29
|
+
}
|
|
30
|
+
/** What a turn sends Codex to run as its options ask, and what it leaves the thread on. */
|
|
31
|
+
export interface TurnSettings {
|
|
32
|
+
/** The `turn/start` params that carry them. */
|
|
33
|
+
params: Record<string, unknown>;
|
|
34
|
+
/** The thinking level and reported model the turn runs, as far as the engine knows. */
|
|
35
|
+
applied?: AppliedExecution;
|
|
36
|
+
next: ThreadSettings;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The collaboration mode a turn in `mode` sends: Plan for `plan`, Default
|
|
40
|
+
* otherwise. Codex keeps a thread's mode across turns and resumes, so a turn
|
|
41
|
+
* sends it whenever the thread's differs. Its settings take precedence over
|
|
42
|
+
* the turn's model and effort, so they carry the thread's; no instructions
|
|
43
|
+
* keeps Codex's own for the mode, beside the thread's developer instructions.
|
|
44
|
+
*/
|
|
45
|
+
export declare function inCollaborationMode(settings: ThreadSettings, mode: PermissionMode): {
|
|
46
|
+
params: Record<string, unknown>;
|
|
47
|
+
next: ThreadSettings;
|
|
48
|
+
};
|
|
49
|
+
/** One logical session's thread settings, which outlive its processes. */
|
|
50
|
+
export declare class CodexThread {
|
|
51
|
+
settings: ThreadSettings;
|
|
52
|
+
/** What a turn that names no model or level runs; empty when Codex cannot say. */
|
|
53
|
+
private defaults?;
|
|
54
|
+
/**
|
|
55
|
+
* Take what Codex reported when a process started or resumed the thread:
|
|
56
|
+
* those four fields wholesale, so one Codex leaves out is unset, never
|
|
57
|
+
* carried over from another process. What turns set stays.
|
|
58
|
+
*/
|
|
59
|
+
adopt(opened: CodexThreadOpened, options: AgentExecuteOptions): void;
|
|
60
|
+
/**
|
|
61
|
+
* What a turn with these options sends, worked out without changing
|
|
62
|
+
* anything. A turn runs the model and level it names, and one that names
|
|
63
|
+
* none runs the thread's defaults: Codex keeps a turn's model and effort on
|
|
64
|
+
* the thread, so going back to a default is sent like any switch.
|
|
65
|
+
*/
|
|
66
|
+
forTurn(options: AgentExecuteOptions, session: CodexSession, mode: PermissionMode): Promise<TurnSettings>;
|
|
67
|
+
/**
|
|
68
|
+
* Put a thread back on the model and effort it had before a turn that
|
|
69
|
+
* failed: Codex keeps a turn's model even when it refuses it (0.160's
|
|
70
|
+
* `model_not_found`), so every later turn would fail on it. When Codex
|
|
71
|
+
* cannot, the thread keeps what Codex has, and a later turn that names no
|
|
72
|
+
* model sends the default.
|
|
73
|
+
*/
|
|
74
|
+
restore(session: CodexSession, previous: ThreadSettings, sent: Record<string, unknown>, timeoutMs: number): Promise<void>;
|
|
75
|
+
/**
|
|
76
|
+
* What a turn that names no model or level runs. Read once; empty when
|
|
77
|
+
* Codex cannot say, and read again by a later turn.
|
|
78
|
+
*/
|
|
79
|
+
private defaultsFor;
|
|
80
|
+
/**
|
|
81
|
+
* The effort a turn that names no level runs once another turn set one:
|
|
82
|
+
* the configured effort fitted to the thread's model, else the model's own
|
|
83
|
+
* default. `undefined` when Codex cannot say.
|
|
84
|
+
*/
|
|
85
|
+
private defaultEffort;
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=thread-settings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thread-settings.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/thread-settings.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,cAAc,EAGnB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AASx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AY,EACrB,IAAI,EAAE,cAAc,GAClB,OAAO,CAAC,YAAY,CAAC;IAqDxB;;;;;;OAMG;IACG,OAAO,CACZ,OAAO,EAAE,YAAY,EACrB,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,SAAS,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC;IA2BhB;;;OAGG;IACH,OAAO,CAAC,WAAW;IAcnB;;;;OAIG;YACW,aAAa;CAU3B"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type CodexFileChange, type CodexNotification } from "./protocol.ts";
|
|
2
|
+
/** An MCP tool call Codex started and may ask consent for. */
|
|
3
|
+
export interface CodexMcpCall {
|
|
4
|
+
id: string;
|
|
5
|
+
threadId?: string;
|
|
6
|
+
server: string;
|
|
7
|
+
tool: string;
|
|
8
|
+
arguments: unknown;
|
|
9
|
+
/** A consent was linked to it: the next is for another call. */
|
|
10
|
+
consented?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The turn's unfinished MCP tool calls and file changes, from every thread's
|
|
14
|
+
* notifications. Codex's approvals name a call's server or a change's item,
|
|
15
|
+
* not what they do: these show it.
|
|
16
|
+
*/
|
|
17
|
+
export declare class TurnItems {
|
|
18
|
+
private readonly mcpCalls;
|
|
19
|
+
/** The edits of each unfinished file change, by item id. */
|
|
20
|
+
private readonly fileChanges;
|
|
21
|
+
observe(n: CodexNotification): void;
|
|
22
|
+
/**
|
|
23
|
+
* The started call a consent is for, once: Codex names its server, its
|
|
24
|
+
* thread and its arguments, and the tool in its message. Never a guess
|
|
25
|
+
* between calls: an ambiguous consent names its own tool.
|
|
26
|
+
*/
|
|
27
|
+
consentedCall(server: string, thread: string | undefined, named: string | undefined, args: string): CodexMcpCall | undefined;
|
|
28
|
+
/** A server's first unfinished call: an MCP server's own request names its server, not its call. */
|
|
29
|
+
callOf(server: string | undefined): CodexMcpCall | undefined;
|
|
30
|
+
/** The edits of a file change Codex asks to apply. */
|
|
31
|
+
changesOf(itemId: string): CodexFileChange[];
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=turn-items.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"turn-items.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/turn-items.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,iBAAiB,EAAa,MAAM,eAAe,CAAC;AAExF,8DAA8D;AAC9D,MAAM,WAAW,YAAY;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;IACnB,gEAAgE;IAChE,SAAS,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,qBAAa,SAAS;IACrB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAsB;IAC/C,4DAA4D;IAC5D,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAwC;IAEpE,OAAO,CAAC,CAAC,EAAE,iBAAiB,GAAG,IAAI;IA8BnC;;;;OAIG;IACH,aAAa,CACZ,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,IAAI,EAAE,MAAM,GACV,YAAY,GAAG,SAAS;IAe3B,oGAAoG;IACpG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS;IAI5D,sDAAsD;IACtD,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,eAAe,EAAE;CAG5C"}
|