@zvada/agent-server 0.3.22 → 0.3.23
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/CHANGELOG.md +261 -0
- package/dist/types/accounts/chatgpt.d.ts +1 -1
- package/dist/types/accounts/chatgpt.d.ts.map +1 -1
- package/dist/types/accounts/http.d.ts +2 -4
- package/dist/types/accounts/http.d.ts.map +1 -1
- package/dist/types/client/client.d.ts +37 -11
- package/dist/types/client/client.d.ts.map +1 -1
- package/dist/types/client/connection.d.ts +64 -13
- package/dist/types/client/connection.d.ts.map +1 -1
- package/dist/types/client/index.d.ts +1 -1
- package/dist/types/client/index.d.ts.map +1 -1
- package/dist/types/client/logins.d.ts +2 -1
- package/dist/types/client/logins.d.ts.map +1 -1
- package/dist/types/client/streams.d.ts +9 -3
- package/dist/types/client/streams.d.ts.map +1 -1
- package/dist/types/client/turns.d.ts +1 -1
- package/dist/types/client/turns.d.ts.map +1 -1
- package/dist/types/core/agents/acp/acp-agent.d.ts +34 -1
- package/dist/types/core/agents/acp/acp-agent.d.ts.map +1 -1
- package/dist/types/core/agents/acp/adapter.d.ts.map +1 -1
- package/dist/types/core/agents/acp/client.d.ts +12 -3
- package/dist/types/core/agents/acp/client.d.ts.map +1 -1
- package/dist/types/core/agents/acp/mappings.d.ts +8 -2
- package/dist/types/core/agents/acp/mappings.d.ts.map +1 -1
- package/dist/types/core/agents/base.d.ts +22 -8
- package/dist/types/core/agents/base.d.ts.map +1 -1
- package/dist/types/core/agents/claude-code/adapter.d.ts +7 -0
- package/dist/types/core/agents/claude-code/adapter.d.ts.map +1 -1
- package/dist/types/core/agents/claude-code/approvals.d.ts +4 -1
- package/dist/types/core/agents/claude-code/approvals.d.ts.map +1 -1
- package/dist/types/core/agents/claude-code/claude-agent.d.ts +16 -5
- package/dist/types/core/agents/claude-code/claude-agent.d.ts.map +1 -1
- package/dist/types/core/agents/claude-code/events.d.ts +9 -1
- package/dist/types/core/agents/claude-code/events.d.ts.map +1 -1
- package/dist/types/core/agents/claude-code/login.d.ts +4 -1
- package/dist/types/core/agents/claude-code/login.d.ts.map +1 -1
- package/dist/types/core/agents/claude-code/mcp.d.ts +21 -7
- package/dist/types/core/agents/claude-code/mcp.d.ts.map +1 -1
- package/dist/types/core/agents/claude-code/models.d.ts +5 -1
- package/dist/types/core/agents/claude-code/models.d.ts.map +1 -1
- package/dist/types/core/agents/claude-code/options.d.ts +10 -4
- package/dist/types/core/agents/claude-code/options.d.ts.map +1 -1
- package/dist/types/core/agents/claude-code/outcome.d.ts +3 -5
- package/dist/types/core/agents/claude-code/outcome.d.ts.map +1 -1
- package/dist/types/core/agents/claude-code/results.d.ts +16 -0
- package/dist/types/core/agents/claude-code/results.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/sdk-pair.d.ts +13 -0
- package/dist/types/core/agents/claude-code/sdk-pair.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/session.d.ts +50 -12
- package/dist/types/core/agents/claude-code/session.d.ts.map +1 -1
- package/dist/types/core/agents/claude-code/spend.d.ts +2 -1
- package/dist/types/core/agents/claude-code/spend.d.ts.map +1 -1
- package/dist/types/core/agents/claude-code/tools.d.ts +26 -3
- package/dist/types/core/agents/claude-code/tools.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/adapter.d.ts +2 -2
- package/dist/types/core/agents/codex-app-server/adapter.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/client.d.ts +12 -2
- package/dist/types/core/agents/codex-app-server/client.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/codex-agent.d.ts +58 -13
- package/dist/types/core/agents/codex-app-server/codex-agent.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/commands.d.ts +2 -2
- package/dist/types/core/agents/codex-app-server/commands.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/credentials.d.ts +5 -1
- package/dist/types/core/agents/codex-app-server/credentials.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/effort.d.ts +2 -1
- package/dist/types/core/agents/codex-app-server/effort.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/homes.d.ts +19 -0
- package/dist/types/core/agents/codex-app-server/homes.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/items.d.ts +27 -2
- package/dist/types/core/agents/codex-app-server/items.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/login.d.ts +4 -1
- package/dist/types/core/agents/codex-app-server/login.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/mcp.d.ts +15 -30
- package/dist/types/core/agents/codex-app-server/mcp.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/models.d.ts +3 -10
- package/dist/types/core/agents/codex-app-server/models.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/options.d.ts +27 -4
- package/dist/types/core/agents/codex-app-server/options.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/plan-approval.d.ts +2 -1
- package/dist/types/core/agents/codex-app-server/plan-approval.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/protocol.d.ts +16 -3
- package/dist/types/core/agents/codex-app-server/protocol.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/requests.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/session.d.ts +68 -40
- package/dist/types/core/agents/codex-app-server/session.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/subagents.d.ts +9 -4
- package/dist/types/core/agents/codex-app-server/subagents.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/thread-settings.d.ts +3 -2
- package/dist/types/core/agents/codex-app-server/thread-settings.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/turn-items.d.ts +2 -1
- package/dist/types/core/agents/codex-app-server/turn-items.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/turn.d.ts +31 -8
- package/dist/types/core/agents/codex-app-server/turn.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/user-login.d.ts +28 -0
- package/dist/types/core/agents/codex-app-server/user-login.d.ts.map +1 -0
- package/dist/types/core/agents/credentials.d.ts +3 -1
- package/dist/types/core/agents/credentials.d.ts.map +1 -1
- package/dist/types/core/agents/diffs.d.ts +9 -0
- package/dist/types/core/agents/diffs.d.ts.map +1 -0
- package/dist/types/core/agents/elicitation.d.ts +3 -2
- package/dist/types/core/agents/elicitation.d.ts.map +1 -1
- package/dist/types/core/agents/login.d.ts +6 -0
- package/dist/types/core/agents/login.d.ts.map +1 -1
- package/dist/types/core/agents/mcp-config.d.ts +0 -4
- package/dist/types/core/agents/mcp-config.d.ts.map +1 -1
- package/dist/types/core/agents/process-pool.d.ts +193 -0
- package/dist/types/core/agents/process-pool.d.ts.map +1 -0
- package/dist/types/core/agents/scripted/adapter.d.ts +68 -0
- package/dist/types/core/agents/scripted/adapter.d.ts.map +1 -0
- package/dist/types/core/agents/scripted/mcp-call.d.ts +56 -0
- package/dist/types/core/agents/scripted/mcp-call.d.ts.map +1 -0
- package/dist/types/core/agents/scripted/scripted-agent.d.ts +73 -0
- package/dist/types/core/agents/scripted/scripted-agent.d.ts.map +1 -0
- package/dist/types/core/agents/scripted/scripts.d.ts +29 -0
- package/dist/types/core/agents/scripted/scripts.d.ts.map +1 -0
- package/dist/types/core/agents/scripted/steps.d.ts +132 -0
- package/dist/types/core/agents/scripted/steps.d.ts.map +1 -0
- package/dist/types/core/agents/session-agent.d.ts +49 -6
- package/dist/types/core/agents/session-agent.d.ts.map +1 -1
- package/dist/types/core/diagnostics.d.ts +4 -1
- package/dist/types/core/diagnostics.d.ts.map +1 -1
- package/dist/types/core/index.d.ts +5 -0
- package/dist/types/core/index.d.ts.map +1 -1
- package/dist/types/core/presets.d.ts +32 -6
- package/dist/types/core/presets.d.ts.map +1 -1
- package/dist/types/core/processes/lifeline.d.ts +0 -20
- package/dist/types/core/processes/lifeline.d.ts.map +1 -1
- package/dist/types/core/provision/index.d.ts +2 -2
- package/dist/types/core/provision/index.d.ts.map +1 -1
- package/dist/types/core/provision/install-build.d.ts +2 -1
- package/dist/types/core/provision/install-build.d.ts.map +1 -1
- package/dist/types/core/provision/npm.d.ts +20 -8
- package/dist/types/core/provision/npm.d.ts.map +1 -1
- package/dist/types/core/provision/provisioner.d.ts +4 -1
- package/dist/types/core/provision/provisioner.d.ts.map +1 -1
- package/dist/types/core/provision/tools.d.ts +2 -1
- package/dist/types/core/provision/tools.d.ts.map +1 -1
- package/dist/types/core/runtime/agent-runtime.d.ts +16 -8
- package/dist/types/core/runtime/agent-runtime.d.ts.map +1 -1
- package/dist/types/core/runtime/event-processor.d.ts +5 -1
- package/dist/types/core/runtime/event-processor.d.ts.map +1 -1
- package/dist/types/core/runtime/harness-clis.d.ts +9 -0
- package/dist/types/core/runtime/harness-clis.d.ts.map +1 -1
- package/dist/types/core/runtime/harness-logins.d.ts +33 -5
- package/dist/types/core/runtime/harness-logins.d.ts.map +1 -1
- package/dist/types/core/runtime/model-lists.d.ts +2 -0
- package/dist/types/core/runtime/model-lists.d.ts.map +1 -1
- package/dist/types/core/runtime/permission-policy.d.ts +5 -3
- package/dist/types/core/runtime/permission-policy.d.ts.map +1 -1
- package/dist/types/core/runtime/request-broker.d.ts +2 -1
- package/dist/types/core/runtime/request-broker.d.ts.map +1 -1
- package/dist/types/core/runtime/turn.d.ts +12 -1
- package/dist/types/core/runtime/turn.d.ts.map +1 -1
- package/dist/types/core/utils/deadline.d.ts +6 -0
- package/dist/types/core/utils/deadline.d.ts.map +1 -1
- package/dist/types/core/utils/errors.d.ts +7 -1
- package/dist/types/core/utils/errors.d.ts.map +1 -1
- package/dist/types/operator/operator.d.ts.map +1 -1
- package/dist/types/operator/render.d.ts +6 -4
- package/dist/types/operator/render.d.ts.map +1 -1
- package/dist/types/protocol/auth.d.ts +54 -24
- package/dist/types/protocol/auth.d.ts.map +1 -1
- package/dist/types/protocol/clis.d.ts +14 -7
- package/dist/types/protocol/clis.d.ts.map +1 -1
- package/dist/types/protocol/config.d.ts +2 -0
- package/dist/types/protocol/config.d.ts.map +1 -1
- package/dist/types/protocol/conversation.d.ts +40 -3
- package/dist/types/protocol/conversation.d.ts.map +1 -1
- package/dist/types/protocol/credentials.d.ts +7 -0
- package/dist/types/protocol/credentials.d.ts.map +1 -1
- package/dist/types/protocol/execution.d.ts +2 -1
- package/dist/types/protocol/execution.d.ts.map +1 -1
- package/dist/types/protocol/factories.d.ts +12 -2
- package/dist/types/protocol/factories.d.ts.map +1 -1
- package/dist/types/protocol/harness.d.ts +6 -2
- package/dist/types/protocol/harness.d.ts.map +1 -1
- package/dist/types/protocol/history.d.ts +19 -0
- package/dist/types/protocol/history.d.ts.map +1 -1
- package/dist/types/protocol/lifecycle.d.ts +47 -8
- package/dist/types/protocol/lifecycle.d.ts.map +1 -1
- package/dist/types/protocol/model-catalog.d.ts.map +1 -1
- package/dist/types/protocol/models.d.ts +3 -0
- package/dist/types/protocol/models.d.ts.map +1 -1
- package/dist/types/protocol/parts.d.ts +14 -0
- package/dist/types/protocol/parts.d.ts.map +1 -1
- package/dist/types/protocol/tool-state.d.ts +12 -0
- package/dist/types/protocol/tool-state.d.ts.map +1 -1
- package/dist/types/protocol/wire-api.d.ts +129 -23
- package/dist/types/protocol/wire-api.d.ts.map +1 -1
- package/dist/types/protocol/wire.d.ts +70 -10
- package/dist/types/protocol/wire.d.ts.map +1 -1
- package/dist/types/server/acp/binding.d.ts +6 -1
- package/dist/types/server/acp/binding.d.ts.map +1 -1
- package/dist/types/server/acp/translate.d.ts +33 -7
- package/dist/types/server/acp/translate.d.ts.map +1 -1
- package/dist/types/server/agent-server.d.ts +6 -0
- package/dist/types/server/agent-server.d.ts.map +1 -1
- package/dist/types/server/feedback.d.ts +2 -1
- package/dist/types/server/feedback.d.ts.map +1 -1
- package/dist/types/server/install.d.ts +11 -0
- package/dist/types/server/install.d.ts.map +1 -1
- package/dist/types/server/session-gate.d.ts +2 -1
- package/dist/types/server/session-gate.d.ts.map +1 -1
- package/dist/types/server/session-store.d.ts +1 -0
- package/dist/types/server/session-store.d.ts.map +1 -1
- package/dist/types/server/subscriptions.d.ts +2 -1
- package/dist/types/server/subscriptions.d.ts.map +1 -1
- package/dist/types/server/transports.d.ts.map +1 -1
- package/dist/types/sync/fit.d.ts +8 -7
- package/dist/types/sync/fit.d.ts.map +1 -1
- package/dist/types/sync/history-sqlite.d.ts.map +1 -1
- package/dist/types/sync/index.d.ts +1 -0
- package/dist/types/sync/index.d.ts.map +1 -1
- package/dist/types/sync/journal-sqlite.d.ts +2 -1
- package/dist/types/sync/journal-sqlite.d.ts.map +1 -1
- package/dist/types/sync/journal.d.ts +11 -3
- package/dist/types/sync/journal.d.ts.map +1 -1
- package/dist/types/sync/projection.d.ts +6 -0
- package/dist/types/sync/projection.d.ts.map +1 -1
- package/dist/types/sync/recovery.d.ts +2 -1
- package/dist/types/sync/recovery.d.ts.map +1 -1
- package/dist/types/sync/schema.d.ts +10 -0
- package/dist/types/sync/schema.d.ts.map +1 -1
- package/dist/types/sync/sql.d.ts +2 -1
- package/dist/types/sync/sql.d.ts.map +1 -1
- package/docs/consuming.md +278 -28
- package/docs/deploy.md +36 -8
- package/docs/durable-sessions.md +35 -5
- package/docs/harnesses.md +385 -24
- package/package.json +6 -1
- package/src/accounts/chatgpt.ts +2 -2
- package/src/accounts/http.ts +2 -16
- package/src/client/client.ts +92 -31
- package/src/client/connection.ts +103 -22
- package/src/client/index.ts +1 -0
- package/src/client/logins.ts +1 -1
- package/src/client/streams.ts +12 -4
- package/src/client/turns.ts +1 -1
- package/src/core/agents/acp/acp-agent.ts +181 -52
- package/src/core/agents/acp/adapter.ts +9 -1
- package/src/core/agents/acp/client.ts +16 -4
- package/src/core/agents/acp/mappings.ts +27 -0
- package/src/core/agents/base.ts +25 -10
- package/src/core/agents/claude-code/adapter.ts +47 -17
- package/src/core/agents/claude-code/approvals.ts +6 -5
- package/src/core/agents/claude-code/claude-agent.ts +60 -30
- package/src/core/agents/claude-code/events.ts +11 -1
- package/src/core/agents/claude-code/login.ts +14 -2
- package/src/core/agents/claude-code/mcp.ts +31 -15
- package/src/core/agents/claude-code/models.ts +7 -2
- package/src/core/agents/claude-code/options.ts +11 -3
- package/src/core/agents/claude-code/outcome.ts +10 -2
- package/src/core/agents/claude-code/results.ts +73 -0
- package/src/core/agents/claude-code/sdk-pair.ts +66 -0
- package/src/core/agents/claude-code/session.ts +166 -37
- package/src/core/agents/claude-code/spend.ts +1 -1
- package/src/core/agents/claude-code/tools.ts +108 -12
- package/src/core/agents/codex-app-server/adapter.ts +37 -12
- package/src/core/agents/codex-app-server/client.ts +37 -8
- package/src/core/agents/codex-app-server/codex-agent.ts +115 -50
- package/src/core/agents/codex-app-server/commands.ts +2 -2
- package/src/core/agents/codex-app-server/credentials.ts +10 -5
- package/src/core/agents/codex-app-server/effort.ts +1 -1
- package/src/core/agents/codex-app-server/homes.ts +43 -1
- package/src/core/agents/codex-app-server/items.ts +219 -31
- package/src/core/agents/codex-app-server/login.ts +14 -2
- package/src/core/agents/codex-app-server/mcp.ts +47 -32
- package/src/core/agents/codex-app-server/models.ts +9 -8
- package/src/core/agents/codex-app-server/options.ts +69 -10
- package/src/core/agents/codex-app-server/plan-approval.ts +1 -1
- package/src/core/agents/codex-app-server/protocol.ts +14 -4
- package/src/core/agents/codex-app-server/requests.ts +14 -6
- package/src/core/agents/codex-app-server/session.ts +151 -113
- package/src/core/agents/codex-app-server/subagents.ts +21 -14
- package/src/core/agents/codex-app-server/thread-settings.ts +18 -8
- package/src/core/agents/codex-app-server/turn-items.ts +1 -1
- package/src/core/agents/codex-app-server/turn.ts +79 -32
- package/src/core/agents/codex-app-server/user-login.ts +107 -0
- package/src/core/agents/credentials.ts +5 -2
- package/src/core/agents/diffs.ts +25 -0
- package/src/core/agents/elicitation.ts +2 -2
- package/src/core/agents/login.ts +6 -0
- package/src/core/agents/mcp-config.ts +2 -2
- package/src/core/agents/process-pool.ts +432 -0
- package/src/core/agents/scripted/adapter.ts +142 -0
- package/src/core/agents/scripted/mcp-call.ts +134 -0
- package/src/core/agents/scripted/scripted-agent.ts +418 -0
- package/src/core/agents/scripted/scripts.ts +171 -0
- package/src/core/agents/scripted/steps.ts +127 -0
- package/src/core/agents/session-agent.ts +105 -8
- package/src/core/diagnostics.ts +9 -1
- package/src/core/index.ts +11 -0
- package/src/core/presets.ts +99 -14
- package/src/core/processes/lifeline.ts +99 -25
- package/src/core/provision/index.ts +1 -2
- package/src/core/provision/install-build.ts +4 -1
- package/src/core/provision/npm.ts +309 -97
- package/src/core/provision/provisioner.ts +22 -8
- package/src/core/provision/tools.ts +44 -19
- package/src/core/runtime/agent-runtime.ts +48 -18
- package/src/core/runtime/event-processor.ts +18 -2
- package/src/core/runtime/harness-clis.ts +36 -1
- package/src/core/runtime/harness-logins.ts +82 -31
- package/src/core/runtime/model-lists.ts +1 -1
- package/src/core/runtime/permission-policy.ts +4 -3
- package/src/core/runtime/request-broker.ts +1 -1
- package/src/core/runtime/turn.ts +51 -3
- package/src/core/utils/deadline.ts +23 -0
- package/src/core/utils/errors.ts +11 -4
- package/src/operator/operator.ts +8 -4
- package/src/operator/render.ts +46 -8
- package/src/protocol/auth.ts +30 -23
- package/src/protocol/clis.ts +12 -4
- package/src/protocol/credentials.ts +19 -0
- package/src/protocol/execution.ts +5 -0
- package/src/protocol/factories.ts +25 -3
- package/src/protocol/harness.ts +11 -1
- package/src/protocol/history.ts +20 -0
- package/src/protocol/lifecycle.ts +10 -1
- package/src/protocol/model-catalog.ts +19 -8
- package/src/protocol/parts.ts +12 -1
- package/src/protocol/tool-state.ts +14 -1
- package/src/protocol/wire.ts +14 -0
- package/src/server/acp/binding.ts +113 -23
- package/src/server/acp/translate.ts +161 -8
- package/src/server/agent-server.ts +10 -1
- package/src/server/bin.ts +83 -9
- package/src/server/feedback.ts +1 -1
- package/src/server/install.ts +82 -4
- package/src/server/session-gate.ts +1 -1
- package/src/server/session-store.ts +5 -1
- package/src/server/subscriptions.ts +1 -1
- package/src/server/transports.ts +14 -0
- package/src/sync/fit.ts +115 -28
- package/src/sync/history-sqlite.ts +6 -2
- package/src/sync/index.ts +1 -0
- package/src/sync/journal-sqlite.ts +20 -2
- package/src/sync/journal.ts +10 -2
- package/src/sync/projection.ts +10 -0
- package/src/sync/recovery.ts +11 -4
- package/src/sync/schema.ts +7 -5
- package/src/sync/sql.ts +1 -1
- package/dist/types/core/agents/claude-code/session-pool.d.ts +0 -36
- package/dist/types/core/agents/claude-code/session-pool.d.ts.map +0 -1
- package/dist/types/core/agents/session-pool.d.ts +0 -41
- package/dist/types/core/agents/session-pool.d.ts.map +0 -1
- package/src/core/agents/claude-code/session-pool.ts +0 -136
- package/src/core/agents/session-pool.ts +0 -111
package/docs/harnesses.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Harness support matrix
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Four harnesses, one event stream. The lifecycle event *structure* is identical
|
|
4
4
|
across harnesses (one generic `EventProcessor` drives it); payloads and config
|
|
5
5
|
support differ only where the backends genuinely do.
|
|
6
6
|
|
|
@@ -9,6 +9,7 @@ support differ only where the backends genuinely do.
|
|
|
9
9
|
| `claude-code` | `@anthropic-ai/claude-agent-sdk` (claude CLI) | token-level | yes (`resume`) | `in_session` (`setModel`) |
|
|
10
10
|
| `codex-app-server` | `codex app-server` (JSON-RPC subprocess) | token-level | yes (`thread/resume`) | `in_session` (per-turn) |
|
|
11
11
|
| `acp` | any ACP v1 agent via `@agentclientprotocol/sdk` | per-agent | yes (`session/resume`, else `session/load`) | when the agent offers a `model` config option (so the capability says `unsupported`) |
|
|
12
|
+
| `scripted` | a script the operator gives, no process ([below](#the-scripted-harness)) | a word at a time (`stream` steps) | any id (nothing to lose) | `unsupported`: it runs no model |
|
|
12
13
|
|
|
13
14
|
The `acp` harness is opt-in (an operator-supplied launch command, never
|
|
14
15
|
wire-sourced): well-known agents run by name (`--harness=pi`,
|
|
@@ -26,6 +27,11 @@ offers it (checked against SDK 1.7.0 with `claude-agent-acp` and `codex-acp`):
|
|
|
26
27
|
`thought_level` config options (`session/set_config_option`). An agent
|
|
27
28
|
without the option keeps its default. A model the agent does not list fails
|
|
28
29
|
the turn as `invalid_request`; an unlisted thinking level is left alone.
|
|
30
|
+
- **Permission mode:** an agent that offers modes is put in the turn's
|
|
31
|
+
(`default` when it names none) with `session/set_mode`, by the agent's own
|
|
32
|
+
id (`acceptEdits`, `bypassPermissions` and the like are read as the
|
|
33
|
+
engine's); one it offers none of is reported not applied. The engine also
|
|
34
|
+
answers the agent's permission requests by the mode.
|
|
29
35
|
- **Extra directories:** `additionalDirectories` is sent to agents that
|
|
30
36
|
advertise the capability and ignored otherwise.
|
|
31
37
|
- **Token usage:** read from the prompt response when the agent sends it. The
|
|
@@ -36,6 +42,9 @@ offers it (checked against SDK 1.7.0 with `claude-agent-acp` and `codex-acp`):
|
|
|
36
42
|
those words never decide the category. A child it left running cannot hold
|
|
37
43
|
the turn open, and an agent that ignores SIGTERM is killed after three
|
|
38
44
|
seconds.
|
|
45
|
+
- **Its own name:** `initialize` names the client `agent-server`, with the
|
|
46
|
+
stock program's release as its version; embedded, `acp.clientName` and
|
|
47
|
+
`acp.clientVersion` say them (else `agent-server` and `0.0.0`).
|
|
39
48
|
- **`pi`** runs a pinned `pi-acp@0.0.34` through `npx`, not whatever version
|
|
40
49
|
npm published last; bump the pin after checking a new release.
|
|
41
50
|
|
|
@@ -55,11 +64,11 @@ warm multi-turn reuse, a unified `ThinkingLevel`, and normalized token usage.
|
|
|
55
64
|
| `additionalDirectories` | ✅ | ✅ (writable roots of the workspace-write sandbox; a change starts a new process) |
|
|
56
65
|
| `maxTurns` | ✅ | ❌ |
|
|
57
66
|
| `mcpServers` | ✅ | ✅ (stdio / Streamable HTTP; in the thread's config, or written to the `CODEX_HOME` the turn names) |
|
|
58
|
-
| `apiKey` / `env` | ✅ | ✅ (the key logs in that session's process, in memory only; a credential the product holds wins) |
|
|
67
|
+
| `apiKey` / `env` | ✅ | ✅ (the key logs in that session's process, in memory only; a credential the product holds wins; under `userLogin` it wins over the user's own login) |
|
|
59
68
|
| `disableTools` | ✅ | ❌ refused as `invalid_request`: Codex gives the model its tools however it is configured (use `plan` or `default`) |
|
|
60
69
|
| permission requests (capability `permissionRequests`) | ✅ (`canUseTool`) | ✅ (`on-request` approvals in `default`, `accept_edits` and `plan`, MCP tool consent included; a plan turn's edits are declined) |
|
|
61
70
|
| the words said with a refusal (capability `rejectionMessages`) | ✅ the denial tells Claude what the user said | ❌ a bare verdict (a plan's answer carries them) |
|
|
62
|
-
| `elicitation` (questions, MCP input) | `AskUserQuestion`; MCP `onElicitation` (form, url) | `request_user_input` (
|
|
71
|
+
| `elicitation` (questions, MCP input) | `AskUserQuestion`; MCP `onElicitation` (form, url) | `request_user_input` in every mode (each thread starts with Codex's `default_mode_request_user_input`; declined in a turn that does not opt in); MCP elicitation (form, url) |
|
|
63
72
|
| steering (`turn/steer`) | ✅ uuid-stamped messages, read where Claude replays them; a late steer runs as one more query in the turn | ✅ `turn/steer`, read where Codex starts its user message |
|
|
64
73
|
| image / file input (capabilities `images`, `files`) | images (data or http(s) URL), PDFs, text files (`files: text, pdf`) | images (data or local path), text files inline (`files: text`), local files as mentions |
|
|
65
74
|
| `includeRaw` | ✅ | ✅ |
|
|
@@ -96,9 +105,11 @@ engine (`permission.requested`) only in `default`, `accept_edits` and
|
|
|
96
105
|
boundary is its sandbox, so a command that writes in the folder
|
|
97
106
|
(`printf > e1.txt`) or in `/tmp` runs unasked too.
|
|
98
107
|
|
|
99
|
-
A Codex approval shows what it approves: a command's
|
|
100
|
-
`command` and `cwd
|
|
101
|
-
|
|
108
|
+
A Codex approval shows what it approves: a command's line is its `command`
|
|
109
|
+
(its `rawInput` is Codex's wrapped `command` and `cwd`), a file change's
|
|
110
|
+
hunks are its `locations` (its `rawInput` the `changes`, each `{path, kind,
|
|
111
|
+
diff}`), and an MCP tool's `rawInput` its arguments, as Claude's are. Why
|
|
112
|
+
Codex asks is `reason` ([below](#what-a-tool-call-says-per-harness)). A command
|
|
102
113
|
or change the user declines fails, saying it was not approved (Codex
|
|
103
114
|
completes it as `declined`).
|
|
104
115
|
|
|
@@ -106,7 +117,8 @@ A cancelled Codex turn stops the commands it started before it ends. Codex
|
|
|
106
117
|
0.160 ends a turn on `turn/interrupt` but keeps a running command alive as a
|
|
107
118
|
background terminal, so the engine terminates the terminals the turn started
|
|
108
119
|
(not those it only polled or wrote to) and checks that they are gone,
|
|
109
|
-
reading Codex's list again for
|
|
120
|
+
reading Codex's list again for `cancelGraceMs` (2 s by default), since a
|
|
121
|
+
terminal can register late.
|
|
110
122
|
When Codex cannot stop one, the engine ends the app-server, whose shutdown
|
|
111
123
|
stops every terminal, an earlier turn's too (the next turn resumes the
|
|
112
124
|
thread). Otherwise terminals an earlier turn left running, such as a server
|
|
@@ -114,13 +126,24 @@ the agent started on purpose, keep running. A command whose stop could not be
|
|
|
114
126
|
confirmed fails with its outcome unknown, and the cancel answers
|
|
115
127
|
`unconfirmed`. A cancel that arrives after Codex's turn ended stops nothing.
|
|
116
128
|
|
|
129
|
+
A Codex MCP tool's image comes as `content` on its tool part (`{type:
|
|
130
|
+
"image", data, mimeType}` beside its text), with `[image <mimeType>]` where it
|
|
131
|
+
was in `output`, as a Claude tool result's does; no block's base64 is ever
|
|
132
|
+
text (`[<type> <mimeType>]` stands for it). A picture Codex makes itself is a
|
|
133
|
+
tool part too, `image_generation` (`kind: "other"`): the prompt Codex wrote as
|
|
134
|
+
`input.prompt` when it gives one, and the file Codex saved it to in
|
|
135
|
+
`metadata.savedPath`, never the picture's bytes. A code-mode `exec` cell is no item of Codex's, so
|
|
136
|
+
only the items it causes reach the stream (LLP 0001, D14).
|
|
137
|
+
|
|
117
138
|
Codex per-turn MCP is supported through the engine and JSON-RPC API, and the
|
|
118
139
|
repository CLI: in the user's own Codex home at `inheritConfig: "all"`, where
|
|
119
140
|
the servers ride the thread's config and nothing is written, or in a home of
|
|
120
141
|
the session's own (`config.env.CODEX_HOME`, the CLI's `--codex-home`), where
|
|
121
142
|
the engine writes them (LLP 0001, D21; see
|
|
122
|
-
[MCP configuration](consuming.md#configure-mcp-between-turns)).
|
|
123
|
-
server binding
|
|
143
|
+
[MCP configuration](consuming.md#configure-mcp-between-turns)). Behind the
|
|
144
|
+
ACP server binding, a client's stdio and HTTP servers take the first path;
|
|
145
|
+
an SSE server or one named `codex_apps` is refused at `session/new` or
|
|
146
|
+
`session/resume`, naming it.
|
|
124
147
|
Below `inheritConfig: "all"` every Codex turn needs a home of its session's
|
|
125
148
|
own, so the bin refuses `--acp --harness codex-app-server` with
|
|
126
149
|
`--inherit-config project` or `none`.
|
|
@@ -128,13 +151,27 @@ own, so the bin refuses `--acp --harness codex-app-server` with
|
|
|
128
151
|
The ACP server binding (`agent-server --acp`) records each session's native
|
|
129
152
|
id under `$AGENT_SERVER_ACP_SESSION_DIR` (default
|
|
130
153
|
`~/.local/state/agent-server/acp-sessions`), so a client's `session/resume`
|
|
131
|
-
works after the agent process restarts.
|
|
132
|
-
|
|
154
|
+
works after the agent process restarts. A prompt's text and images reach
|
|
155
|
+
the turn, and a resource link (an editor's @-mention of a file) as a
|
|
156
|
+
Markdown link in its text; it advertises no audio or embedded context. It reports per-turn usage on the prompt
|
|
157
|
+
response and advertises the MCP transports the harness it fronts attaches
|
|
158
|
+
beside stdio: HTTP and SSE for `claude-code`, HTTP for `codex-app-server`
|
|
159
|
+
and `scripted`, none for `acp` (the agent behind decides). It offers
|
|
133
160
|
session modes (`default`, `accept_edits`, `plan`, and the mode it was started
|
|
134
161
|
in): the client picks one with `session/set_mode`, and when the agent switches
|
|
135
162
|
(an approved plan) the session follows and the client hears
|
|
136
163
|
`current_mode_update`. A client cannot pick a mode above the one the operator
|
|
137
|
-
started it in.
|
|
164
|
+
started it in. Every turn runs on the harness's own default model and
|
|
165
|
+
thinking level (in front of Codex, the user's `~/.codex` default) unless the
|
|
166
|
+
operator names them: `--model <id>` and `--thinking <level>` hold for every
|
|
167
|
+
turn the binding runs, and no ACP client can change them (it is offered no
|
|
168
|
+
config options). A client that advertises form elicitation at `initialize`
|
|
169
|
+
is asked the agent's questions, as one ACP form with a required field per
|
|
170
|
+
question (ACP v1 has no question mode, and no masked field for a `secret`
|
|
171
|
+
one), and an MCP server's forms as they are; one that advertises URL
|
|
172
|
+
elicitation, an MCP server's URLs. A request in a mode the client did not
|
|
173
|
+
advertise is declined; for a client that advertises neither, the turn runs
|
|
174
|
+
without `elicitation`, so the agent is told no one can answer.
|
|
138
175
|
|
|
139
176
|
What a Claude or Codex session loads by itself is the operator's
|
|
140
177
|
`inheritConfig` (LLP 0001, D17; choosing one: [consuming.md](consuming.md#choose-what-a-turn-inherits)).
|
|
@@ -151,9 +188,16 @@ and the connectors stay off whatever either env says, and a `disableTools`
|
|
|
151
188
|
turn runs at `none`. Claude's built-in plugins and skills and the host's
|
|
152
189
|
managed policy load at every level, and `~/.claude.json` is read for the
|
|
153
190
|
account (its MCP servers follow the user and local sources). A Codex session at `project` or `none`
|
|
154
|
-
runs in the `CODEX_HOME` its turn names, of the session's own,
|
|
155
|
-
|
|
156
|
-
|
|
191
|
+
runs in the `CODEX_HOME` its turn names, of the session's own, with Codex's
|
|
192
|
+
apps (the ChatGPT account's connectors) off, its plugins off from the moment
|
|
193
|
+
its process starts (`-c features.plugins=false`: a fresh home otherwise clones
|
|
194
|
+
Codex's plugin catalogue, about 85 MB and 5,500 files, before any thread
|
|
195
|
+
opens), and at `none` without the repository's `AGENTS.md`. A session whose
|
|
196
|
+
home was removed or made again under its warm process starts a new one on its
|
|
197
|
+
next turn, which resumes the thread there or fails `resume_failed` as a cold
|
|
198
|
+
start would; the repository's skills and `~/.agents/skills` load
|
|
199
|
+
at every level. With `codexAppServer.userLogin` such a session runs on the
|
|
200
|
+
user's own Codex login ([below](#the-users-own-codex-login-in-a-sessions-home)).
|
|
157
201
|
|
|
158
202
|
`thinkingLevel` runs from `off` to `ultra`. agent-server fits it to the
|
|
159
203
|
model's levels when it knows them: a level above the model's top becomes that
|
|
@@ -170,11 +214,16 @@ cancelled before the model answered:
|
|
|
170
214
|
- **claude-code** fits the level before starting Claude, because Claude Code
|
|
171
215
|
lowers a level its model lacks without saying so (`xhigh` on Sonnet 4.6 runs
|
|
172
216
|
`high`). With no known levels the level passes through and no applied level
|
|
173
|
-
is reported.
|
|
174
|
-
|
|
175
|
-
|
|
217
|
+
is reported. A model known to have no levels (`thinking.levels: []`, Haiku)
|
|
218
|
+
is started without one, as Claude Code runs it by default (Haiku then still
|
|
219
|
+
thinks), and no applied level is reported. `off` is sent as is, on Haiku
|
|
220
|
+
too, where it stops that default thinking: some models do not let thinking
|
|
221
|
+
be disabled. An operator `sdkOptions` that sets `effort` or `thinking` wins,
|
|
222
|
+
and then no level is reported.
|
|
176
223
|
- **codex-app-server** reads what the thread's model accepts from its own
|
|
177
|
-
`model/list`.
|
|
224
|
+
`model/list`. A model it lists with no efforts at all, or the engine knows
|
|
225
|
+
has no levels, is sent no effort, and no level is reported. With no level
|
|
226
|
+
requested it reports the thread's effort (for
|
|
178
227
|
example from `~/.codex/config.toml`), and the thread's model in
|
|
179
228
|
`reportedModels` when the stream names none. Codex runs the effort it is
|
|
180
229
|
given, so that is the one reported.
|
|
@@ -194,6 +243,115 @@ cancelled before the model answered:
|
|
|
194
243
|
|
|
195
244
|
`clampThinkingLevel` picks the nearest level when a picker switches models.
|
|
196
245
|
|
|
246
|
+
## What each harness does with each turn setting
|
|
247
|
+
|
|
248
|
+
Read from the code. **Applied**: as `RunConfig` documents it. **Another
|
|
249
|
+
meaning**: it has an effect, a different one. **Ignored**: the turn runs
|
|
250
|
+
without it; the harness lists it in `capabilities.ignoredSettings`, and a turn
|
|
251
|
+
that sets it names it in `turn.started.execution.notApplied`. **Refused**: the
|
|
252
|
+
turn fails. **The agent's**: an ACP agent decides, by what it advertises.
|
|
253
|
+
**The engine**: applied by the engine, the same on every harness. A cell that
|
|
254
|
+
ends "(not applied: …)" is a case a harness finds as the turn runs, named in
|
|
255
|
+
`turn.ended.execution.notApplied`.
|
|
256
|
+
|
|
257
|
+
| Setting | claude-code | codex-app-server | acp | scripted |
|
|
258
|
+
| --- | --- | --- | --- | --- |
|
|
259
|
+
| `harness` | the engine | the engine | the engine | the engine |
|
|
260
|
+
| `model` | applied, switched live | applied (`turn/start`) | the agent's: set through its `model` config option; an agent without one keeps its own (not applied: `model`); a value it does not list is refused | ignored: `echo: "config"` says it |
|
|
261
|
+
| `thinkingLevel` | applied, fitted to the model's levels (a model with none: not applied: `thinkingLevel`) | applied as reasoning effort, fitted to the model; `off` is its lowest effort (a model with no reasoning control: not applied: `thinkingLevel`) | the agent's: set through its `thought_level` option when it lists the level (otherwise not applied: `thinkingLevel`) | ignored: `echo: "config"` says it |
|
|
262
|
+
| `cwd` | applied | applied | applied | another meaning: a change needs a resume (as on every harness), and `echo: "config"` says it |
|
|
263
|
+
| `additionalDirectories` | applied | another meaning: writable roots of the `accept_edits` sandbox, nothing in the other modes | the agent's: sent only to an agent that takes them (otherwise not applied: `additionalDirectories`) | ignored: `echo: "config"` says them |
|
|
264
|
+
| `systemPromptAppend` | applied, appended to Claude Code's system prompt | another meaning: a developer message (`developerInstructions`) | ignored: ACP v1 has no system prompt | ignored: `echo: "config"` says it |
|
|
265
|
+
| `maxTurns` | applied (unset is 100) | ignored | ignored | ignored |
|
|
266
|
+
| `subagentMode` | applied | another meaning: Codex's `multi_agent` on, an instruction to collect every sub-agent, a native cleanup at the end | refused | refused |
|
|
267
|
+
| `permissionMode` | applied (SDK modes) | another meaning: a sandbox and an approval policy (the table below) | applied where the agent offers a mode of that meaning (`session/set_mode`, by its own id; `default` when the turn names none), and the engine answers its requests by the mode; one it offers none of is not applied (`permissionMode`), nor `plan` on an agent with no modes | ignored: the script says which calls ask (`ask: true`); `echo: "config"` says it |
|
|
268
|
+
| `elicitation` | applied | applied | applied: the agent's form and URL requests (ACP v1 has no question tool) | applied: an `ask` step asks the person, else the agent is told no one can answer |
|
|
269
|
+
| `requestTimeoutMs` | the engine | the engine | the engine | the engine |
|
|
270
|
+
| `resumeSessionId` | applied | applied (`thread/resume`) | the agent's: `session/resume`, else `session/load`; refused for an agent with neither | applied: reported as the native id, resumed |
|
|
271
|
+
| `resumeSessionAt` | applied with a resume (without one: not applied: `resumeSessionAt`) | ignored | ignored | ignored |
|
|
272
|
+
| `mcpServers` | applied, switched live | applied; SSE and the name `codex_apps` refused | the agent's: every server is sent, whatever it advertises; `required` is not checked | applied: a `call` step calls an `http` one |
|
|
273
|
+
| `env` | applied | applied; `CODEX_HOME` is the session's home (below `all`, required) | applied | another meaning: a change needs a resume, and `echo: "config"` says its keys |
|
|
274
|
+
| `apiKey` | applied (`ANTHROPIC_API_KEY`) | applied (an in-memory login) | ignored: the agent's credentials are its launch command's | ignored: it runs on no credential |
|
|
275
|
+
| `disableTools` | applied (no tools, no MCP servers) | refused (`invalid_request`) | ignored: ACP v1 cannot ask for it | ignored: its tool calls are the script's |
|
|
276
|
+
| `includeRaw` | the engine | the engine | the engine | the engine |
|
|
277
|
+
|
|
278
|
+
`test/core/agents/ignored-settings.test.ts` holds this table's verdicts; a
|
|
279
|
+
new `RunConfig` field fails it until each harness's verdict is written there.
|
|
280
|
+
A setting an operator's own options replace (Claude's `sdkOptions`) is the
|
|
281
|
+
operator's, and not named as not applied.
|
|
282
|
+
|
|
283
|
+
## What each permission mode does, per agent
|
|
284
|
+
|
|
285
|
+
Measured on 2026-11-15 on macOS, on Claude Code 2.1.288 (SDK 0.3.288, model
|
|
286
|
+
Haiku) and Codex 0.160.0, through the engine at `inheritConfig: "none"`. Each
|
|
287
|
+
call ran in a fresh session and folder, with every `permission.requested`
|
|
288
|
+
answered `allow_once`, and each call that asked ran again with the request
|
|
289
|
+
answered `reject_once`. Whether a call ran is read from the file on disk, the
|
|
290
|
+
test's own MCP server or the tool's output, never from the model's reply.
|
|
291
|
+
Codex's calls came from a scripted stand-in model that makes the calls
|
|
292
|
+
`gpt-6-luna` makes, and its web search came from the real model. The
|
|
293
|
+
`permission-modes` harness scenario checks every cell against the expected
|
|
294
|
+
tables in `apps/harness/src/scenarios/permission-modes.ts`, so a pin bump that
|
|
295
|
+
changes what a mode does fails it:
|
|
296
|
+
|
|
297
|
+
```sh
|
|
298
|
+
bun run harness -- --harness=claude-code,codex-app-server --scenario=permission-modes
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
On Claude it costs one small paid turn per cell on this computer's own Claude
|
|
302
|
+
login (64 turns). On Codex it is free; its 5 web-search turns are paid and run
|
|
303
|
+
only with `PERMISSION_MODES_PAID=1`.
|
|
304
|
+
|
|
305
|
+
In each cell, Claude's result comes first, then Codex's. **asks**: a
|
|
306
|
+
`permission.requested` arrives, and the call runs when allowed and does not
|
|
307
|
+
run when rejected. **runs**: nothing is asked and the call runs. **refused**:
|
|
308
|
+
nothing is asked and the call does not run.
|
|
309
|
+
|
|
310
|
+
| Call | `default` | `accept_edits` | `bypass_permissions` | `dont_ask` | `plan` |
|
|
311
|
+
| --- | --- | --- | --- | --- | --- |
|
|
312
|
+
| Read a file in the folder | runs / runs | runs / runs | runs / runs | runs / runs | runs / runs |
|
|
313
|
+
| Read a file in a sibling temp folder | asks / runs | asks / runs | runs / runs | refused / runs | asks / runs |
|
|
314
|
+
| Write a file in the folder (Claude's `Write`, Codex's `apply_patch`) | asks / asks | runs / runs | runs / runs | refused / refused | asks / refused |
|
|
315
|
+
| Write a file in the folder through the shell | asks / asks | runs / runs | runs / runs | refused / refused | asks / asks |
|
|
316
|
+
| `echo hi` | runs / runs | runs / runs | runs / runs | runs / runs | runs / runs |
|
|
317
|
+
| Write a file in a sibling temp folder | asks / asks | asks / runs | runs / runs | refused / refused | asks / refused |
|
|
318
|
+
| Write a file outside the folder and outside temp | not measured / asks | not measured / asks | not measured / runs | not measured / refused | not measured / refused |
|
|
319
|
+
| An MCP tool with no hints | asks / asks | asks / asks | runs / runs | refused / refused | asks / asks |
|
|
320
|
+
| An MCP tool marked `readOnlyHint` | asks / runs | asks / runs | runs / runs | refused / runs | asks / runs |
|
|
321
|
+
| Web (Claude's `WebFetch`\*, Codex's hosted web search) | asks / runs | asks / runs | not asked / runs | not asked / runs | asks / runs |
|
|
322
|
+
|
|
323
|
+
Claude reads with `Read` and runs commands with `Bash`. Codex runs both reads
|
|
324
|
+
and commands as shell commands (`cat`, `echo pm > file`). \*Claude's `WebFetch`
|
|
325
|
+
of a page on loopback switches to https and fails, so for it only whether it
|
|
326
|
+
asks is measured.
|
|
327
|
+
|
|
328
|
+
What differs, and so what a product should not assume of one agent from the
|
|
329
|
+
other:
|
|
330
|
+
|
|
331
|
+
- **`accept_edits` is not the same mode.** Claude runs a write in the folder
|
|
332
|
+
unasked, by `Write` or the shell, and still asks for a read or write outside
|
|
333
|
+
it, a temp folder included, and for every MCP tool. Codex runs unasked
|
|
334
|
+
whatever its workspace sandbox allows, a write to a sibling temp folder
|
|
335
|
+
included, and asks only beyond it and for an MCP tool without `readOnlyHint`.
|
|
336
|
+
- **Codex never asked before a read**, one in a sibling temp folder included,
|
|
337
|
+
in any mode. Claude asks before a read outside the folder in `default`,
|
|
338
|
+
`accept_edits` and `plan`, and refuses it in `dont_ask`.
|
|
339
|
+
- **`readOnlyHint` counts on Codex only.** Codex runs such an MCP tool unasked
|
|
340
|
+
in every mode. Claude asks for it as for any MCP tool, and refuses it in
|
|
341
|
+
`dont_ask`.
|
|
342
|
+
- **`plan` does not stop writes.** On Claude every write the model makes is
|
|
343
|
+
asked and runs when allowed. On Codex `apply_patch` is refused, but a shell
|
|
344
|
+
write the model retries with escalation is asked and runs when allowed.
|
|
345
|
+
- **`dont_ask` refuses different calls.** Claude runs only a read in the
|
|
346
|
+
folder and a command that writes nothing. Codex refuses writes and MCP tools
|
|
347
|
+
without `readOnlyHint`, and runs reads outside the folder, `readOnlyHint`
|
|
348
|
+
tools and web search.
|
|
349
|
+
- **Codex never asks before a web search**, in any mode.
|
|
350
|
+
- A Codex shell write asks only when the model retries it with escalation
|
|
351
|
+
after the sandbox refused it, as the stand-in does. In one paid run in
|
|
352
|
+
`default`, `gpt-6-luna` did not retry: no request came, and no tool part
|
|
353
|
+
reached the stream.
|
|
354
|
+
|
|
197
355
|
## Model lists
|
|
198
356
|
|
|
199
357
|
`runtime.models({ harness, cwd })` (wire `models/list`, `client.listModels()`)
|
|
@@ -205,6 +363,7 @@ a turn with the same `cwd`, `env` and `apiKey` would use:
|
|
|
205
363
|
| `claude-code` | `query().supportedModels()` on an idle CLI (no prompt, MCP servers or hooks), at the operator's `inheritConfig` | The folder's `availableModels` setting narrows the list. `default` is a model id: the account's default. Haiku lists no levels. Operator `sdkOptions` are not applied. |
|
|
206
364
|
| `codex-app-server` | `model/list`, on the session's own process when `sessionId` has one | Lists what the login can run (a ChatGPT login gets no `gpt-5.5`). The default is the model `~/.codex/config.toml` selects, else Codex's own. With host-managed auth, pass the `sessionId` whose account to list. |
|
|
207
365
|
| `acp` | none | The catalog (empty). ACP agents describe models as session config options. |
|
|
366
|
+
| `scripted` | the harness | One model, `scripted`, with no thinking levels. |
|
|
208
367
|
|
|
209
368
|
Each `ModelDescriptor` has `id` (pass as `config.model`), `label`,
|
|
210
369
|
`description`, `resolvedId` (what an alias runs), `isDefault`, `thinking`
|
|
@@ -218,12 +377,23 @@ the harness's lists; pass `refresh: true` after one it cannot see. Listing costs
|
|
|
218
377
|
0.1 s for Codex once warm, a few seconds for the first read after the server
|
|
219
378
|
starts. A CLI that cannot answer within 20 s (logged out, too old) gets the
|
|
220
379
|
catalog with `source: "catalog"` and an `error`, or the last live list with the
|
|
221
|
-
`error` when one was read; a failed read is retried after 30 seconds.
|
|
380
|
+
`error` when one was read; a failed read is retried after 30 seconds. A
|
|
381
|
+
list installs nothing: while the harness's CLI is not installed yet, being
|
|
382
|
+
installed or failed to install, the answer is the catalog with an `error`
|
|
383
|
+
saying so, cached by nothing, so the first list after the install is live
|
|
384
|
+
(LLP 0010).
|
|
222
385
|
|
|
223
386
|
The catalog (`CATALOG_MODELS`) is what
|
|
224
387
|
the pinned CLIs listed when the release was built (`bun run models:refresh`):
|
|
225
388
|
Claude for the maintainer's login, Codex logged in and logged out (which adds
|
|
226
|
-
the API-key models such as `gpt-5.5`).
|
|
389
|
+
the API-key models such as `gpt-5.5`). Claude's rows depend on the route:
|
|
390
|
+
on a login that reaches `api.anthropic.com` the CLI takes them from the list
|
|
391
|
+
Anthropic serves the account ("Opus 5.5"), which the catalog records. Where
|
|
392
|
+
it does not get that list (a product's held credentials, listed on the
|
|
393
|
+
placeholder key; `ANTHROPIC_BASE_URL` elsewhere; a cloud provider), it uses the
|
|
394
|
+
picker built into it ("Opus", "Sonnet", "Haiku", a `claude-fable-5-1[1m]` row, other
|
|
395
|
+
descriptions), so a picker shown from the catalog there renames its rows once
|
|
396
|
+
the CLI answers. Keep the user's thinking choice per
|
|
227
397
|
model in your app; start from `thinking.default`, and use `clampThinkingLevel`
|
|
228
398
|
only for a model the user has not set.
|
|
229
399
|
|
|
@@ -231,8 +401,10 @@ Consult `runtime.capabilities(harness)` before relying on a capability.
|
|
|
231
401
|
|
|
232
402
|
## Logins
|
|
233
403
|
|
|
234
|
-
`auth/status` reads each harness's login from its CLI
|
|
235
|
-
|
|
404
|
+
`auth/status` reads each harness's login from its CLI, and installs none: a
|
|
405
|
+
harness whose CLI is not installed yet is `unknown`, with no methods.
|
|
406
|
+
`auth/login` runs the CLI's own flow, installing it first (LLP 0011; the
|
|
407
|
+
recipe is in
|
|
236
408
|
[consuming.md](consuming.md#show-each-harnesss-login-and-sign-it-in)).
|
|
237
409
|
|
|
238
410
|
| Harness | Status from | Logins (`methods`) | Logout |
|
|
@@ -240,15 +412,39 @@ CLI's own flow (LLP 0011; the recipe is in
|
|
|
240
412
|
| `claude-code` | `claude auth status --json`, with the turn's environment | `claudeai`, `console` (`browser`, with a `codeUrl` for another device; over the SDK's control requests, CLI 2.1.220 and later), `terminal` (`claude auth login`) | `claude auth logout` |
|
|
241
413
|
| `codex-app-server` | `account/read` on an app-server of its own | `chatgpt` (`browser`, callback on `127.0.0.1:1455`, one per machine), `chatgpt_device_code`, `api_key`, `terminal` (`codex login`) | `account/logout` |
|
|
242
414
|
| `acp` | — (`unknown`: the agent signs in on its own) | none | — |
|
|
415
|
+
| `scripted` | — (`signed_in`: it runs on nothing, so there is nothing to sign in to) | none | refused (`invalid_request`) |
|
|
243
416
|
|
|
244
417
|
A login lands in the store a turn with the same `env` uses (`CLAUDE_CONFIG_DIR`,
|
|
245
418
|
`CODEX_HOME`). Claude reports the credential a turn would run with, so a key in
|
|
246
419
|
the environment shows as `source: "environment"` over any login. A login change
|
|
247
420
|
starts each session's next turn on a new CLI. Codex logins below `inheritConfig:
|
|
248
|
-
"all"` land in the `CODEX_HOME` the request's `env` names
|
|
421
|
+
"all"` land in the `CODEX_HOME` the request's `env` names; under
|
|
422
|
+
`codexAppServer.userLogin` the turns in those homes run on the user's own
|
|
423
|
+
login, which a request with no `env` reads and signs in. The engine reads and
|
|
249
424
|
runs the CLI it starts: a host that starts Claude its own way
|
|
250
425
|
(`claudeCode.sdkOptions`, a spawner of its own) signs it in where it runs it.
|
|
251
426
|
|
|
427
|
+
## The user's own Codex login in a session's home
|
|
428
|
+
|
|
429
|
+
`codexAppServer.userLogin: true` (`createAgentRuntime`; operator-level and
|
|
430
|
+
embed-tier only, never from the wire) runs a Codex turn
|
|
431
|
+
that names a `CODEX_HOME` of its session's own on the user's own Codex login,
|
|
432
|
+
the one of the engine's own home (`$CODEX_HOME`, else `~/.codex`) (LLP 0017).
|
|
433
|
+
Before each turn, and each model list for an `env` naming a home, the engine
|
|
434
|
+
starts an app-server there with its own environment and asks
|
|
435
|
+
`getAuthStatus {includeToken: true, refreshToken: false}`: a ChatGPT login
|
|
436
|
+
logs the session's process in with `chatgptAuthTokens` (account and plan from
|
|
437
|
+
the access token's claims), an API key as `apiKey`, both in that process's
|
|
438
|
+
memory; nothing is written to the session's home. A product's `credentials`
|
|
439
|
+
and the turn's `apiKey` come first. No login there, or one that cannot be
|
|
440
|
+
handed over, fails the turn `auth` (`credentialsReconnect`) before the
|
|
441
|
+
session's process starts. When Codex refuses the token, the login is read
|
|
442
|
+
again, and when it still holds the refused token Codex renews it in the
|
|
443
|
+
user's own home; another account is refused. Nothing is cached: a login the
|
|
444
|
+
user changes in a terminal is the next turn's, and another account starts a
|
|
445
|
+
new process that resumes the thread. A turn that names no home runs on its
|
|
446
|
+
home's own login as before.
|
|
447
|
+
|
|
252
448
|
## Host-managed Codex authentication
|
|
253
449
|
|
|
254
450
|
An embedding host hands Codex a login of its own with `credentials`, the same
|
|
@@ -287,6 +483,34 @@ credentials are added to `RunConfig` or the engine's public wire.
|
|
|
287
483
|
The protocol was checked against Codex CLI 0.160.0 and the
|
|
288
484
|
[official app-server authentication documentation](https://learn.chatgpt.com/docs/app-server#3c-log-in-with-externally-managed-chatgpt-tokens-chatgptauthtokens).
|
|
289
485
|
|
|
486
|
+
## What a tool call says, per harness
|
|
487
|
+
|
|
488
|
+
What a product draws a terminal step, a fetch, a diff or a permission card
|
|
489
|
+
from, without reading a harness's own input keys (LLP 0002, A tool call says
|
|
490
|
+
what it acts on). A field a harness does not give is left out.
|
|
491
|
+
|
|
492
|
+
| Field | claude-code | codex-app-server | acp |
|
|
493
|
+
| --- | --- | --- | --- |
|
|
494
|
+
| `command` (part and request) | a `Bash` call's `input.command` | the line apart from the shell Codex wraps it in (`/bin/zsh -lc '…'`), unquoted; any other shape as Codex reports it. `input.command` stays wrapped | none: an agent's `title` is all ACP v1 gives |
|
|
495
|
+
| `url` | a `WebFetch` call's `input.url` | none: its network approval was not observed | none |
|
|
496
|
+
| `locations` | a file tool's path; once an `Edit` or a `Write` over a file is done, each hunk at its start line in the new file | a file change's hunks, each at its start line in the new file; a move's source and destination; an add's or a delete's path | the agent's own |
|
|
497
|
+
| `reason` (request) | the CLI's `decisionReason`, when it sends one ("Path is outside allowed working directories") | the approval's `reason`, the model's own justification. `title` is never it | none: ACP v1's request has no field for it |
|
|
498
|
+
| `diff` content | from the CLI's structured result: an `Edit`'s or an overwriting `Write`'s hunks; a created file's content as `newText`; a `NotebookEdit`'s cell, `old_source` to `new_source`. None on a failed edit | a hunk per entry for an update (at a move's destination, without its `Moved to:` trailer); an add's content as `newText`; a delete's as `oldText`, `newText` `""`. None on a failed or declined change | the agent's `diff` and `terminal` content, as it sent them, the latest update's winning |
|
|
499
|
+
| `metadata.exitCode` | on a failed `Bash` call only, from the `Exit code N` its result begins with: the CLI reports no code for a success, and counts some non-zero exits as one | Codex's `exitCode`, on a completed and a failed command alike | none |
|
|
500
|
+
|
|
501
|
+
Every tool the pinned Claude CLI offers has a decided `kind`. A Claude pin
|
|
502
|
+
bump runs `bun run test:live:free`: its `claude-tool-kinds` check starts the
|
|
503
|
+
pinned CLI for free and names each tool it offers that has none.
|
|
504
|
+
|
|
505
|
+
Behind `agent-server --acp`, a part's `diff` entries reach the client as ACP
|
|
506
|
+
`diff` content, after its output; a `terminal` is the agent's, so it is
|
|
507
|
+
not sent. A permission request carries the call's `name`, `kind`,
|
|
508
|
+
`locations` and `rawInput`; ACP v1's request has no field for its
|
|
509
|
+
`command`, `url`, `reason` or `mcp`.
|
|
510
|
+
|
|
511
|
+
A hunk's `oldText` is its context and removed lines, its `newText` its
|
|
512
|
+
context and added lines; a `` marker is dropped.
|
|
513
|
+
|
|
290
514
|
## Payload notes
|
|
291
515
|
|
|
292
516
|
- A turn ends with a normalized `stopReason`
|
|
@@ -342,6 +566,143 @@ turn totals take precedence over intermediate message usage.
|
|
|
342
566
|
cache accounting. An ACP/custom agent that exposes only this gauge cannot
|
|
343
567
|
provide the cache breakdown without an additional native usage report.
|
|
344
568
|
|
|
569
|
+
## The scripted harness
|
|
570
|
+
|
|
571
|
+
`scripted` plays a script instead of a model, so a product can test its whole
|
|
572
|
+
integration (its turns, its tool server, its permission and question
|
|
573
|
+
handling, resume, close) for nothing, and so the engine has one small,
|
|
574
|
+
complete example of a harness (`core/agents/scripted/`; LLP 0016, The
|
|
575
|
+
scripted harness). It has a name of its own: `initialize`, `session.created`
|
|
576
|
+
and every event say `scripted`, so a stream never passes a script off as a
|
|
577
|
+
real agent. It is registered only when the operator gives it a script, and
|
|
578
|
+
never otherwise: no default set holds it.
|
|
579
|
+
|
|
580
|
+
```ts
|
|
581
|
+
import { createAgentRuntime, scriptedQueue } from "@zvada/agent-server/core";
|
|
582
|
+
|
|
583
|
+
const runtime = createAgentRuntime({
|
|
584
|
+
harnesses: ["scripted"],
|
|
585
|
+
scripted: { turn: scriptedQueue([{ say: "Hello." }, { end: true }]) },
|
|
586
|
+
});
|
|
587
|
+
```
|
|
588
|
+
|
|
589
|
+
**Where a turn's steps come from: one function.**
|
|
590
|
+
`scripted: { turn: (request) => steps }` returns an iterable, or an async
|
|
591
|
+
iterable a test can release a step at a time, of `ScriptStep`s. `request`
|
|
592
|
+
holds the turn's `sessionId`, `turnId`, `input`, `config` (the turn's
|
|
593
|
+
`RunConfig`, as a harness gets it), `turnIndex` (how many turns the session
|
|
594
|
+
ran before, in this engine) and `signal`. A turn plays its steps until they
|
|
595
|
+
end or an `end` step.
|
|
596
|
+
|
|
597
|
+
A step's `yield` evaluates to what the step did (`ScriptStepOutcome`): the
|
|
598
|
+
agent passes it to the next `next()`, so a script written as a generator can
|
|
599
|
+
use an earlier answer, and an array, the helpers and a file ignore it.
|
|
600
|
+
|
|
601
|
+
```ts
|
|
602
|
+
scripted: {
|
|
603
|
+
turn: async function* () {
|
|
604
|
+
const made = yield { call: { server: "notes", tool: "save_note", arguments: { text: "a" } } };
|
|
605
|
+
if (!made || !("output" in made)) throw new Error("the save failed");
|
|
606
|
+
const id = made.metadata?.structuredContent?.id;
|
|
607
|
+
yield { call: { server: "notes", tool: "update_note", arguments: { id } } };
|
|
608
|
+
yield { say: "Done." };
|
|
609
|
+
},
|
|
610
|
+
}
|
|
611
|
+
```
|
|
612
|
+
|
|
613
|
+
A `tool` or `call` step that completed hands back `{ output, content?,
|
|
614
|
+
metadata? }`, what its part completed with (a call's `structuredContent` under
|
|
615
|
+
`metadata`); one that failed `{ error, metadata? }`, with `rejected: true`
|
|
616
|
+
when the person denied it; an `ask` step `{ answer }`, the elicitation outcome, and
|
|
617
|
+
`undefined` when the turn's client answers no questions; every other step
|
|
618
|
+
`undefined`. A permission request answered as a cancel ends the turn, so
|
|
619
|
+
nothing is handed back.
|
|
620
|
+
|
|
621
|
+
Built on it, all from `./core`:
|
|
622
|
+
|
|
623
|
+
| Helper | What it plays |
|
|
624
|
+
| --- | --- |
|
|
625
|
+
| `scriptedQueue(steps)` | One queue for the runtime, turn by turn whatever the session, one turn at a time: `end` closes a turn, and the next plays on from the step after it. A turn that stops before its `end` (a `fail`, a cancel) skips through that `end`. A turn that finds the queue empty fails, saying the script ran out; one that starts while another plays the queue fails, saying sessions that run at once need `scriptedBySession`. |
|
|
626
|
+
| `scriptedFile(path, { position? })` | The same, from a JSONL file, one step per line; a bad line is refused when the file is read, by its number. It plays from its start each time an engine reads it, and writes nothing. With `position`, how far it has played is kept in that file, so an engine restarted mid-script goes on where the last stopped (stopped inside a turn, from the next turn); a changed file plays from its start, and a queue that runs out says where its position is kept. |
|
|
627
|
+
| `scriptedBySession(scripts, otherwise?)` | A queue per session id; any other session plays `otherwise` from its start, or fails without one. |
|
|
628
|
+
|
|
629
|
+
**The steps** are plain JSON (the type `ScriptStep`). Each is strict: a step or a field the schema does not know is
|
|
630
|
+
refused when the script is read, never skipped.
|
|
631
|
+
|
|
632
|
+
| Step | What it does |
|
|
633
|
+
| --- | --- |
|
|
634
|
+
| `{ say: string }` | A complete text part. |
|
|
635
|
+
| `{ stream: string, every?: ms }` | A text part streamed a word at a time, `every` ms apart, then its snapshot. |
|
|
636
|
+
| `{ tool, input?, kind?, mcp?, command?, url?, locations?, reason?, output?, error?, content?, metadata?, ask? }` | A tool call the script answers: the part opens in progress and completes with `output`, or fails with `error`. `command`, `url` and `locations` are on the part and on its request; `reason` on the request only, so it is refused without `ask`. `metadata` (a command's `exitCode`) is kept completed or failed; `content` (a `diff`) only on a completed call, as a failed one shows nothing ([What a tool call says](#what-a-tool-call-says-per-harness)). With `ask: true` the engine's permission broker is asked first, with the same call: a rejection fails the part (`The user rejected this tool call.`, then the user's words) and the turn goes on; an approval that edits the input runs the edit; a request answered as a cancel (or one that expires) ends the turn `cancelled`, the part closed `cancelled`. |
|
|
637
|
+
| `{ call: { server, tool, arguments? }, ask? }` | A real call to the turn's own `mcpServers[server]` (`http` only), with the official MCP SDK (`@modelcontextprotocol/sdk`, an optional peer, loaded at the first call). Its text goes into `output`, an image into `content`, the server's `structuredContent` into `metadata.structuredContent`, and `mcp` names the server and tool. A server the turn lacks, one not over `http`, or a missing SDK fails the turn; a call the server fails fails the part. Each call runs on a connection of its own, so a server that keeps state per MCP session sees a new session each call. `ask` as for `tool`; a cancelled request calls nothing. |
|
|
638
|
+
| `{ ask: Question[] }` | Questions to the person (`elicitation.requested`, the protocol's `ElicitationQuestion`); the outcome is said back as a text part of JSON. A turn whose client answers no questions is told so in the words Claude and Codex are told, and goes on. |
|
|
639
|
+
| `{ echo: "input" }` | Says the turn's input as a model reads it (`inputToText`). |
|
|
640
|
+
| `{ echo: "config" }` | Says the turn's config as JSON: `model`, `thinkingLevel`, `cwd`, `additionalDirectories`, `systemPromptAppend`, `permissionMode`, the names of its MCP servers and the keys of its `env`, never their values. |
|
|
641
|
+
| `{ wait: ms }` | A pause; a cancel ends it. |
|
|
642
|
+
| `{ hang: true, stopTakes?: ms }` | Runs until the turn is cancelled; `stopTakes` ms more before it stops, as a harness slow to stop. The cancel is confirmed at once. |
|
|
643
|
+
| `{ fail: string, category? }` | Ends the turn in an error: of `category` when given, else what the engine's classifier makes of the text. |
|
|
644
|
+
| `{ end: true, stopReason?, usage?, cost? }` | Ends the turn: `end_turn` and zero usage by default. |
|
|
645
|
+
|
|
646
|
+
**The stock program** plays a script too, for a product in any language or
|
|
647
|
+
one that spawns it: `agent-server --script turns.jsonl` registers the
|
|
648
|
+
scripted harness with `scriptedFile`, as its only harness unless `--harness`
|
|
649
|
+
names others beside `scripted`. One queue serves every session, one turn at
|
|
650
|
+
a time, from its start each time the program starts; `--script-position
|
|
651
|
+
<file>` keeps its position in that file across restarts. `--script` with a
|
|
652
|
+
`--harness` that does not name `scripted`, `--harness scripted` without
|
|
653
|
+
`--script`, `--script-position` without `--script`, and a script that cannot
|
|
654
|
+
be read (`--script: <why>`) are refused at start, in one line.
|
|
655
|
+
|
|
656
|
+
**As a harness.** Its native session id is `scripted-<sessionId>`, or the
|
|
657
|
+
turn's `resumeSessionId`, reported as resumed; any id resumes, since a script
|
|
658
|
+
keeps no conversation. It declares multi-turn, resume, MCP servers and
|
|
659
|
+
permission requests, and no steering, sub-agents or thinking levels; the
|
|
660
|
+
settings it never applies are its `ignoredSettings` (the table above).
|
|
661
|
+
`models/list` answers one model, `scripted`; `auth/status` answers
|
|
662
|
+
`signed_in` with no methods, since it runs on nothing; `clis/list` answers
|
|
663
|
+
`unmanaged`. It runs no process and takes no credential, so a durable
|
|
664
|
+
server's restart that cuts one of its turns off fences nothing: the turn ends
|
|
665
|
+
`server_restart` and the next names its conversation (`resumeRequired`), as
|
|
666
|
+
for Claude or Codex once the restart saw them stopped.
|
|
667
|
+
|
|
668
|
+
**Not in it:** Claude's or Codex's tool names and consent rules (a call asks
|
|
669
|
+
only when the script says `ask`, whatever the permission mode), sub-agents,
|
|
670
|
+
steering, pending tools and input deltas, reasoning. The engine's own tests
|
|
671
|
+
keep a richer fixture for those (`test/server/fixtures.ts`).
|
|
672
|
+
|
|
673
|
+
## ACP v1, as each side speaks it
|
|
674
|
+
|
|
675
|
+
The engine speaks ACP v1 (`@agentclientprotocol/sdk` 1.7.0) as a client,
|
|
676
|
+
the `acp` harness, and as an agent, `agent-server --acp`. What each side
|
|
677
|
+
does with each method and capability, and which test holds it. The
|
|
678
|
+
loopback test (`test/server/acp-loopback.test.ts`) runs the harness in
|
|
679
|
+
front of the binding over the scripted harness, so it holds both sides at
|
|
680
|
+
once. Unstable methods (`session/list`, `session/fork`, `session/delete`,
|
|
681
|
+
`providers/*`, `nes/*`, `mcp/message`) are used by neither.
|
|
682
|
+
|
|
683
|
+
| Method or capability | Client (`acp` harness) | Agent (`--acp`) | Held by |
|
|
684
|
+
| --- | --- | --- | --- |
|
|
685
|
+
| `initialize` | protocol 1; `clientInfo` (`agent-server`, the stock program's release); advertises form and URL elicitation, no `fs`, no `terminal` | answers protocol 1; images; MCP transports per harness; `resume` and `close`; no `loadSession`; no auth methods | loopback, `acp-session-config`, `bin.test` |
|
|
686
|
+
| `authenticate`, `authMethods` | never called: an agent signs in on its own, and a turn fails with its words | none offered | — |
|
|
687
|
+
| `session/new` | the turn's folder, MCP servers, extra directories when advertised | a session, its modes | loopback |
|
|
688
|
+
| `session/resume` | when advertised | from memory, else the session record | loopback (a new engine), `acp-session-config` |
|
|
689
|
+
| `session/load` | when no resume (the replay is dropped) | not offered | `acp-session-config` |
|
|
690
|
+
| `session/close` | not sent: the agent's process is ended | ends the session's turn and process | `acp-close-during-turn`, loopback (process table) |
|
|
691
|
+
| `session/prompt`, `session/cancel` | yes; a cancel confirmed when the prompt ends within 2 s | yes | loopback, `acp-cancel` |
|
|
692
|
+
| `session/set_mode` | the turn's permission mode, by the agent's own id | `default`, `accept_edits`, `plan` and the operator's own | loopback, `acp-session-config`, `acp-binding-modes` |
|
|
693
|
+
| `session/set_config_option` | `model` and `thought_level` | none offered: the operator's `--model`, `--thinking` | `acp-session-config`, `bin.test` |
|
|
694
|
+
| `session/request_permission` | to the engine's broker (an option id back; edited input denies) | from the broker: `name`, `kind`, `locations`, `rawInput`; no `content` | loopback |
|
|
695
|
+
| `elicitation/create` | to the broker, form and URL | questions as one form; MCP forms and URLs as they are | loopback, `acp-elicitation` |
|
|
696
|
+
| `elicitation/complete` | ignored | not sent | — |
|
|
697
|
+
| `fs/*`, `terminal/*` | not advertised, not served | never asked: each harness's agent uses its own | — |
|
|
698
|
+
| Updates: message and thought chunks, `tool_call`, `tool_call_update`, `usage_update`, `current_mode_update` | to parts and events | from them (sub-agent parts dropped) | loopback, `acp-agent`, `acp-binding` |
|
|
699
|
+
| Updates: `plan`, `available_commands_update`, `session_info_update`, `user_message_chunk` | dropped (`includeRaw` keeps them) | not sent | — |
|
|
700
|
+
| Content: text, image | sent; image when advertised | taken | loopback |
|
|
701
|
+
| Content: `resource_link` | for a file by URL | as a Markdown link in the text | loopback |
|
|
702
|
+
| Content: `resource` (embedded) | a file's data, when advertised | not advertised; dropped | `acp-agent` |
|
|
703
|
+
| Content: audio | never sent | not advertised; dropped | — |
|
|
704
|
+
| Tool content: `diff`, `terminal` | kept on the part | `diff` sent; `terminal` not | loopback, `acp-drawable` |
|
|
705
|
+
|
|
345
706
|
## Known limitations (roadmap)
|
|
346
707
|
|
|
347
708
|
- **Work after a turn:** a turn is the unit the stream shows, so the agent
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zvada/agent-server",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.23",
|
|
4
4
|
"description": "Harness-agnostic agent execution engine: run Claude Code, Codex (app-server), and any ACP agent behind one interface with a normalized event stream, multi-turn sessions, and resume. Root export is the wire contract; /core, /server, /client are the seats.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -121,6 +121,7 @@
|
|
|
121
121
|
"peerDependencies": {
|
|
122
122
|
"@agentclientprotocol/sdk": ">=1.3.0",
|
|
123
123
|
"@anthropic-ai/claude-agent-sdk": ">=0.3.277",
|
|
124
|
+
"@modelcontextprotocol/sdk": ">=1.31.0",
|
|
124
125
|
"zod": "^4.0.0"
|
|
125
126
|
},
|
|
126
127
|
"peerDependenciesMeta": {
|
|
@@ -129,11 +130,15 @@
|
|
|
129
130
|
},
|
|
130
131
|
"@anthropic-ai/claude-agent-sdk": {
|
|
131
132
|
"optional": true
|
|
133
|
+
},
|
|
134
|
+
"@modelcontextprotocol/sdk": {
|
|
135
|
+
"optional": true
|
|
132
136
|
}
|
|
133
137
|
},
|
|
134
138
|
"devDependencies": {
|
|
135
139
|
"@agentclientprotocol/sdk": "^1.7.0",
|
|
136
140
|
"@anthropic-ai/claude-agent-sdk": "0.3.288",
|
|
141
|
+
"@modelcontextprotocol/sdk": "1.32.1",
|
|
137
142
|
"@openai/codex": "0.160.0",
|
|
138
143
|
"@types/bun": "^1.2.0",
|
|
139
144
|
"zod": "^4.6.7"
|
package/src/accounts/chatgpt.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { AccountError, type ProviderOptions, call,
|
|
1
|
+
import { type CredentialGrant, claimsOf } from "../protocol/credentials.ts";
|
|
2
|
+
import { AccountError, type ProviderOptions, call, isRecord, text } from "./http.ts";
|
|
3
3
|
|
|
4
4
|
// The Codex CLI's own OAuth client, as the `codex` binary carries it, and its
|
|
5
5
|
// device sign-in (codex-rs `login/`). A public client: no secret, the same for
|
package/src/accounts/http.ts
CHANGED
|
@@ -22,7 +22,7 @@ export interface ProviderOptions {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
/** A provider's answer: JSON when it sent some, `undefined` when it did not. */
|
|
25
|
-
|
|
25
|
+
interface Answer {
|
|
26
26
|
ok: boolean;
|
|
27
27
|
status: number;
|
|
28
28
|
body: unknown;
|
|
@@ -70,7 +70,7 @@ export function randomToken(bytes = 32): string {
|
|
|
70
70
|
return base64Url(crypto.getRandomValues(new Uint8Array(bytes)));
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
function base64Url(bytes: Uint8Array): string {
|
|
74
74
|
let binary = "";
|
|
75
75
|
for (const byte of bytes) binary += String.fromCharCode(byte);
|
|
76
76
|
return btoa(binary).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
@@ -81,17 +81,3 @@ export async function challengeOf(verifier: string): Promise<string> {
|
|
|
81
81
|
const digest = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(verifier));
|
|
82
82
|
return base64Url(new Uint8Array(digest));
|
|
83
83
|
}
|
|
84
|
-
|
|
85
|
-
/** A JWT's claims, read, not verified: only ever of a token its issuer just answered over TLS. */
|
|
86
|
-
export function claimsOf(jwt: string): Record<string, unknown> {
|
|
87
|
-
try {
|
|
88
|
-
const payload = (jwt.split(".")[1] ?? "").replace(/-/g, "+").replace(/_/g, "/");
|
|
89
|
-
const binary = atob(payload.padEnd(Math.ceil(payload.length / 4) * 4, "="));
|
|
90
|
-
// UTF-8, so an email in another script reads as it was written.
|
|
91
|
-
const text = new TextDecoder().decode(Uint8Array.from(binary, (char) => char.charCodeAt(0)));
|
|
92
|
-
const parsed: unknown = JSON.parse(text);
|
|
93
|
-
return isRecord(parsed) ? parsed : {};
|
|
94
|
-
} catch {
|
|
95
|
-
return {};
|
|
96
|
-
}
|
|
97
|
-
}
|