stitchkit 0.128.0 → 0.130.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +83 -0
- package/dist/agent-executor/acp/v1-connect.d.ts +87 -19
- package/dist/agent-executor/acp/v1-connect.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-driver.d.ts +4 -2
- package/dist/agent-executor/acp/v1-driver.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-handlers.d.ts +56 -0
- package/dist/agent-executor/acp/v1-handlers.d.ts.map +1 -0
- package/dist/agent-executor/acp/v1-map.d.ts +13 -2
- package/dist/agent-executor/acp/v1-map.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-permission.d.ts +44 -0
- package/dist/agent-executor/acp/v1-permission.d.ts.map +1 -0
- package/dist/agent-executor/acp/v1-protocol.d.ts +63 -10
- package/dist/agent-executor/acp/v1-protocol.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-session.d.ts +34 -7
- package/dist/agent-executor/acp/v1-session.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-turn.d.ts +51 -13
- package/dist/agent-executor/acp/v1-turn.d.ts.map +1 -1
- package/dist/agent-executor/claude/classify.d.ts +10 -0
- package/dist/agent-executor/claude/classify.d.ts.map +1 -1
- package/dist/agent-executor/claude/cli-driver.d.ts +4 -1
- package/dist/agent-executor/claude/cli-driver.d.ts.map +1 -1
- package/dist/agent-executor/claude/events.d.ts +146 -0
- package/dist/agent-executor/claude/events.d.ts.map +1 -0
- package/dist/agent-executor/claude/limits.d.ts +7 -1
- package/dist/agent-executor/claude/limits.d.ts.map +1 -1
- package/dist/agent-executor/claude/protocol.d.ts +49 -9
- package/dist/agent-executor/claude/protocol.d.ts.map +1 -1
- package/dist/agent-executor/claude/session.d.ts +2 -0
- package/dist/agent-executor/claude/session.d.ts.map +1 -1
- package/dist/agent-executor/claude/transcript.d.ts +2 -2
- package/dist/agent-executor/claude/transcript.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/controls.d.ts +28 -0
- package/dist/agent-executor/claude-sdk/controls.d.ts.map +1 -0
- package/dist/agent-executor/claude-sdk/driver.d.ts +208 -4
- package/dist/agent-executor/claude-sdk/driver.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/probe.d.ts +29 -0
- package/dist/agent-executor/claude-sdk/probe.d.ts.map +1 -0
- package/dist/agent-executor/claude-sdk/query-loop.d.ts +94 -0
- package/dist/agent-executor/claude-sdk/query-loop.d.ts.map +1 -0
- package/dist/agent-executor/claude-sdk/query-options.d.ts +29 -0
- package/dist/agent-executor/claude-sdk/query-options.d.ts.map +1 -0
- package/dist/agent-executor/claude-sdk/session.d.ts +5 -5
- package/dist/agent-executor/claude-sdk/session.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/turn-usage.d.ts +81 -0
- package/dist/agent-executor/claude-sdk/turn-usage.d.ts.map +1 -0
- package/dist/agent-executor/codex/classify.d.ts +4 -0
- package/dist/agent-executor/codex/classify.d.ts.map +1 -1
- package/dist/agent-executor/codex/connect.d.ts +46 -0
- package/dist/agent-executor/codex/connect.d.ts.map +1 -0
- package/dist/agent-executor/codex/control-client.d.ts +168 -0
- package/dist/agent-executor/codex/control-client.d.ts.map +1 -0
- package/dist/agent-executor/codex/driver.d.ts +71 -10
- package/dist/agent-executor/codex/driver.d.ts.map +1 -1
- package/dist/agent-executor/codex/handlers.d.ts +47 -0
- package/dist/agent-executor/codex/handlers.d.ts.map +1 -0
- package/dist/agent-executor/codex/limits.d.ts +11 -2
- package/dist/agent-executor/codex/limits.d.ts.map +1 -1
- package/dist/agent-executor/codex/protocol.d.ts +173 -4
- package/dist/agent-executor/codex/protocol.d.ts.map +1 -1
- package/dist/agent-executor/codex/request-answers.d.ts +101 -0
- package/dist/agent-executor/codex/request-answers.d.ts.map +1 -0
- package/dist/agent-executor/codex/session-controls.d.ts +195 -0
- package/dist/agent-executor/codex/session-controls.d.ts.map +1 -0
- package/dist/agent-executor/codex/session.d.ts +55 -37
- package/dist/agent-executor/codex/session.d.ts.map +1 -1
- package/dist/agent-executor/codex/shared-server.d.ts +29 -0
- package/dist/agent-executor/codex/shared-server.d.ts.map +1 -0
- package/dist/agent-executor/codex/shared-thread.d.ts +46 -0
- package/dist/agent-executor/codex/shared-thread.d.ts.map +1 -0
- package/dist/agent-executor/codex/thread-controls.d.ts +128 -0
- package/dist/agent-executor/codex/thread-controls.d.ts.map +1 -0
- package/dist/agent-executor/codex/turn-input.d.ts +30 -0
- package/dist/agent-executor/codex/turn-input.d.ts.map +1 -0
- package/dist/agent-executor/codex/unix-socket-target.d.ts +26 -0
- package/dist/agent-executor/codex/unix-socket-target.d.ts.map +1 -0
- package/dist/agent-executor/codex/unix-socket.d.ts +26 -0
- package/dist/agent-executor/codex/unix-socket.d.ts.map +1 -0
- package/dist/agent-executor/codex/ws-frame.d.ts +15 -0
- package/dist/agent-executor/codex/ws-frame.d.ts.map +1 -0
- package/dist/agent-executor/contract.d.ts +79 -0
- package/dist/agent-executor/contract.d.ts.map +1 -1
- package/dist/agent-executor/engine-process.d.ts +9 -0
- package/dist/agent-executor/engine-process.d.ts.map +1 -1
- package/dist/agent-executor/engine.d.ts +6 -2
- package/dist/agent-executor/engine.d.ts.map +1 -1
- package/dist/agent-executor/executor-contract.d.ts +54 -0
- package/dist/agent-executor/executor-contract.d.ts.map +1 -1
- package/dist/agent-executor/handoff-schemas.d.ts +407 -0
- package/dist/agent-executor/handoff-schemas.d.ts.map +1 -0
- package/dist/agent-executor/handoff.d.ts +12 -0
- package/dist/agent-executor/handoff.d.ts.map +1 -0
- package/dist/agent-executor/hello.d.ts +80 -0
- package/dist/agent-executor/hello.d.ts.map +1 -1
- package/dist/agent-executor/image-input.d.ts +22 -0
- package/dist/agent-executor/image-input.d.ts.map +1 -1
- package/dist/agent-executor/projection.d.ts +2 -2
- package/dist/agent-executor/projection.d.ts.map +1 -1
- package/dist/agent-executor/session-primitives.d.ts +10 -1
- package/dist/agent-executor/session-primitives.d.ts.map +1 -1
- package/dist/agent-executor/testing/conformance.d.ts.map +1 -1
- package/dist/agent-executor/testing/replay-driver.d.ts +41 -0
- package/dist/agent-executor/testing/replay-driver.d.ts.map +1 -0
- package/dist/agent-executor/testing/replay-gate.d.ts +11 -0
- package/dist/agent-executor/testing/replay-gate.d.ts.map +1 -0
- package/dist/agent-executor/testing/replay-runner.d.ts +27 -0
- package/dist/agent-executor/testing/replay-runner.d.ts.map +1 -0
- package/dist/agent-executor/testing/replay-scenarios.d.ts +21 -0
- package/dist/agent-executor/testing/replay-scenarios.d.ts.map +1 -0
- package/dist/agent-executor/testing/replay-transcript.d.ts +296 -0
- package/dist/agent-executor/testing/replay-transcript.d.ts.map +1 -0
- package/dist/agent-executor/vocabulary.d.ts +135 -0
- package/dist/agent-executor/vocabulary.d.ts.map +1 -1
- package/dist/agent-runtime/branch-observations.d.ts +5 -5
- package/dist/agent-runtime/deferred-tool-selection.d.ts.map +1 -1
- package/dist/agent-runtime/sql-rows.d.ts +10 -10
- package/dist/agent-runtime/terminal-commit.d.ts +10 -10
- package/dist/entrypoints/agent-executor/acp.d.ts +4 -1
- package/dist/entrypoints/agent-executor/acp.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/acp.js +852 -219
- package/dist/entrypoints/agent-executor/claude-sdk.d.ts +5 -1
- package/dist/entrypoints/agent-executor/claude-sdk.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/claude-sdk.js +1075 -136
- package/dist/entrypoints/agent-executor/claude.js +48 -23
- package/dist/entrypoints/agent-executor/codex.d.ts +11 -0
- package/dist/entrypoints/agent-executor/codex.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/codex.js +3067 -388
- package/dist/entrypoints/agent-executor/testing.d.ts +4 -0
- package/dist/entrypoints/agent-executor/testing.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/testing.js +1002 -2
- package/dist/entrypoints/agent-executor.d.ts +4 -2
- package/dist/entrypoints/agent-executor.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor.js +416 -28
- package/dist/entrypoints/agent-runtime/browser.js +1 -1
- package/dist/entrypoints/agent-runtime/coding-tools.js +3 -3
- package/dist/entrypoints/agent-runtime/harness.js +8 -8
- package/dist/entrypoints/agent-runtime/openrouter.js +2 -2
- package/dist/entrypoints/agent-runtime/postgres.js +6 -6
- package/dist/entrypoints/agent-runtime/realtime.js +4 -4
- package/dist/entrypoints/agent-runtime/sandbox.js +5 -5
- package/dist/entrypoints/agent-runtime/sqlite/bun.js +6 -6
- package/dist/entrypoints/agent-runtime/sqlite/node.js +6 -6
- package/dist/entrypoints/agent-runtime/testing.js +5 -5
- package/dist/entrypoints/agent-runtime.js +21 -40
- package/dist/entrypoints/application/directory-inbox.js +2 -2
- package/dist/entrypoints/application/opentelemetry.js +2 -2
- package/dist/entrypoints/application.js +2 -2
- package/dist/entrypoints/cli/publish.js +3 -3
- package/dist/entrypoints/cli.js +8 -8
- package/dist/entrypoints/contract.js +2 -2
- package/dist/entrypoints/files/packaging.js +2 -2
- package/dist/entrypoints/files.js +7 -7
- package/dist/entrypoints/handler.js +4 -4
- package/dist/entrypoints/http.js +5 -5
- package/dist/entrypoints/index.js +7 -7
- package/dist/entrypoints/node.js +5 -5
- package/dist/entrypoints/observability.js +4 -4
- package/dist/entrypoints/primitives.js +2 -2
- package/dist/entrypoints/process.js +5 -5
- package/dist/entrypoints/react.js +1 -1
- package/dist/entrypoints/remote.js +2 -2
- package/dist/entrypoints/server.js +6 -6
- package/dist/entrypoints/service-host/macos.js +5 -5
- package/dist/entrypoints/service-host.js +7 -7
- package/dist/entrypoints/spend.js +1 -1
- package/dist/entrypoints/sync/postgres.js +1 -1
- package/dist/entrypoints/sync.js +2 -2
- package/dist/entrypoints/telegram.js +2 -2
- package/dist/entrypoints/testing.js +5 -5
- package/dist/entrypoints/tools/agent.js +5 -5
- package/dist/entrypoints/tools/connections.js +2 -2
- package/dist/entrypoints/tools/invoker.js +4 -4
- package/dist/entrypoints/tools/mcp.d.ts +1 -0
- package/dist/entrypoints/tools/mcp.d.ts.map +1 -1
- package/dist/entrypoints/tools/mcp.js +5 -5
- package/dist/entrypoints/tools/toolkit.js +8 -8
- package/dist/entrypoints/tools.js +12 -12
- package/dist/entrypoints/tracking/contract.js +1 -1
- package/dist/entrypoints/xlsx.js +1 -1
- package/dist/{index-prf6ayhf.js → index-13wmzpa6.js} +1 -1
- package/dist/{index-n7f89hjw.js → index-17qgm6xe.js} +3 -3
- package/dist/{index-wv8dqy7q.js → index-205456mf.js} +1 -1
- package/dist/{index-pwskmywy.js → index-21cfxc4z.js} +1 -1
- package/dist/{index-13dnv6d0.js → index-2s8sy57y.js} +37 -104
- package/dist/{index-d4svrknj.js → index-39c2hj6h.js} +2 -2
- package/dist/{index-sfzfd2m2.js → index-39rmc00v.js} +1 -1
- package/dist/{index-ky3ardqn.js → index-3fym4j8n.js} +1 -1
- package/dist/{index-c5gp2gh6.js → index-5tdc0q43.js} +1 -1
- package/dist/{index-3ypvpkwr.js → index-669374qc.js} +1 -1
- package/dist/{index-5jyjb4s0.js → index-80acsm27.js} +1 -1
- package/dist/{index-xmr47znh.js → index-827bgv33.js} +1 -1
- package/dist/{index-v1mxss62.js → index-93n6jwy0.js} +3 -3
- package/dist/{index-d54npte7.js → index-9kpxz49v.js} +2 -2
- package/dist/{index-xv9jb84s.js → index-9sfhje6y.js} +3 -3
- package/dist/{index-9y0afd5f.js → index-apf5g7y9.js} +1 -1
- package/dist/{index-bh4pmtr9.js → index-dbp6xemn.js} +78 -8
- package/dist/{index-g3e57qj6.js → index-dcsxj68j.js} +2 -2
- package/dist/{index-waa6t4zx.js → index-dnzxxf8a.js} +1 -1
- package/dist/{index-gf92hc87.js → index-fgahdc7s.js} +2 -2
- package/dist/{index-kzavdze2.js → index-gr0kxymw.js} +5 -1
- package/dist/{index-e06z0tkb.js → index-gya4hwh3.js} +2 -2
- package/dist/{index-gzny6zsw.js → index-hab790s6.js} +5 -5
- package/dist/{index-bz3gn6cs.js → index-j0ef04jw.js} +2 -2
- package/dist/{index-rhb33thr.js → index-jcge9tx3.js} +1 -1
- package/dist/{index-4qvyhn23.js → index-jrn3prgm.js} +1 -1
- package/dist/index-kne9g2c5.js +30 -0
- package/dist/{index-pn5b11ce.js → index-mkfhpk11.js} +1 -1
- package/dist/{index-1qwrczr1.js → index-mttkdm5a.js} +1 -1
- package/dist/{index-rxnyygke.js → index-n3bm7zqq.js} +1 -1
- package/dist/{index-6wp4dn9d.js → index-p06z7g7w.js} +3 -3
- package/dist/{index-kt6dh1n6.js → index-p16q492v.js} +1 -1
- package/dist/index-p1qmpq0p.js +1300 -0
- package/dist/{index-t7wa7k12.js → index-pp97q86a.js} +1 -1
- package/dist/{index-39n02e0q.js → index-psye60qn.js} +1 -1
- package/dist/{index-5ptwb6ka.js → index-pzhqydxb.js} +1 -1
- package/dist/{index-7kfcb576.js → index-qa2jjb65.js} +1 -1
- package/dist/{index-rzeezh79.js → index-qhjmmsm2.js} +2 -2
- package/dist/{index-7grgs8cx.js → index-qpzyahe3.js} +2 -2
- package/dist/{index-jfecdk1e.js → index-r97ppg0g.js} +2 -2
- package/dist/{index-bmaz3jzy.js → index-rjs94dny.js} +1 -1
- package/dist/{index-5v5vg85s.js → index-rxh3qy4x.js} +32 -5
- package/dist/{index-en8e5zsj.js → index-ryxb427v.js} +1 -1
- package/dist/{index-y065r8g5.js → index-sd4e5x5j.js} +7 -7
- package/dist/{index-g56ht6qf.js → index-t3qcac2a.js} +1 -1
- package/dist/{index-m18xm96h.js → index-v759mzed.js} +156 -6
- package/dist/{index-4j8efqr3.js → index-x2fb37t0.js} +2 -2
- package/dist/{index-cbhxhma2.js → index-x5ayy5bn.js} +1 -0
- package/dist/index-y0a4gt1s.js +142 -0
- package/dist/{index-wavv538x.js → index-ybdq8kk2.js} +3 -3
- package/dist/{index-4gk6k3zc.js → index-ycr4pk0z.js} +1 -1
- package/dist/{index-0tyt97nk.js → index-yrr3n391.js} +1 -1
- package/dist/{index-v37b2cd6.js → index-z20pdxeb.js} +2 -2
- package/dist/{index-8x22nprv.js → index-z9d74jmb.js} +3 -3
- package/dist/{index-3tnwtz38.js → index-zhshhxew.js} +1 -1
- package/dist/{index-hj1zq7mh.js → index-znd1b57f.js} +3 -3
- package/dist/internal/positive-integer.d.ts +2 -0
- package/dist/internal/positive-integer.d.ts.map +1 -1
- package/dist/internal/unix-socket.d.ts +7 -0
- package/dist/internal/unix-socket.d.ts.map +1 -1
- package/dist/tools/internal/rank-tools.d.ts +10 -0
- package/dist/tools/internal/rank-tools.d.ts.map +1 -0
- package/dist/tools/mcp/handler.d.ts +7 -3
- package/dist/tools/mcp/handler.d.ts.map +1 -1
- package/dist/tools/mcp/lazy-discovery.d.ts +47 -0
- package/dist/tools/mcp/lazy-discovery.d.ts.map +1 -0
- package/dist/tools/mcp/mount.d.ts +7 -0
- package/dist/tools/mcp/mount.d.ts.map +1 -1
- package/dist/tools/mcp/register.d.ts +2 -2
- package/dist/tools/mcp/register.d.ts.map +1 -1
- package/llms/agent-executor-acp.txt +7 -8
- package/llms/agent-executor-claude-sdk.txt +15 -10
- package/llms/agent-executor-claude.txt +1 -1
- package/llms/agent-executor-codex.txt +13 -3
- package/llms/agent-executor-testing.txt +5 -1
- package/llms/agent-executor.txt +9 -8
- package/llms/stitchkit.txt +74 -74
- package/llms/tools-mcp.txt +3 -2
- package/llms/tools.txt +24 -0
- package/llms/{upgrading-0.128.0.txt → upgrading-0.128.0-0.130.0.txt} +58 -3
- package/llms/upgrading.txt +1 -1
- package/llms-full.txt +206 -107
- package/llms.txt +10 -10
- package/package.json +1 -1
- package/dist/index-0gqs8ght.js +0 -558
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import type { InteractionReply } from '../executor-contract.js';
|
|
2
|
+
import type { JsonRpcPeer, JsonRpcValue } from '../json-rpc-peer.js';
|
|
3
|
+
import type { ExecutorProfileConfig } from '../profile.js';
|
|
4
|
+
import type { ExecutorStartupPhase } from '../vocabulary.js';
|
|
5
|
+
import { type CodexInjectItemsParams, type CodexListLoadedThreadsParams, type CodexListThreadsParams, type CodexRevertThreadParams, type CodexRevertThreadResult, type CodexSetThreadNameParams, type CodexThreadIdParams, type CodexUpdateThreadMetadataParams } from './thread-controls.js';
|
|
6
|
+
/** Parameters for Codex `thread/read`. */
|
|
7
|
+
export interface CodexReadThreadParams {
|
|
8
|
+
/** Thread identifier to inspect. */
|
|
9
|
+
readonly threadId: string;
|
|
10
|
+
/** When `true`, include full rollout turns (deprecated for large threads). */
|
|
11
|
+
readonly includeTurns?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/** Parameters for Codex `thread/turns/list`. */
|
|
14
|
+
export interface CodexListTurnsParams {
|
|
15
|
+
/** Thread identifier whose turns to list. */
|
|
16
|
+
readonly threadId: string;
|
|
17
|
+
/** Opaque continuation cursor returned by a previous page. */
|
|
18
|
+
readonly cursor?: string;
|
|
19
|
+
/** Optional page size (`uint32`). */
|
|
20
|
+
readonly limit?: number;
|
|
21
|
+
/** Level of item detail per turn (`notLoaded`, `summary`, or `full`). */
|
|
22
|
+
readonly itemsView?: 'notLoaded' | 'summary' | 'full';
|
|
23
|
+
/** Pagination direction (`asc` or `desc`). */
|
|
24
|
+
readonly sortDirection?: 'asc' | 'desc';
|
|
25
|
+
}
|
|
26
|
+
/** Starting position for a `thread/items/list` page: opaque string cursor or exclusive item anchor. */
|
|
27
|
+
export type CodexThreadItemsCursor = string | {
|
|
28
|
+
readonly type: 'item';
|
|
29
|
+
readonly itemId: string;
|
|
30
|
+
};
|
|
31
|
+
/** Output deferral preferences accepted by Codex `thread/items/list`. */
|
|
32
|
+
export interface CodexThreadItemsDeferOutput {
|
|
33
|
+
/** Defer nonempty output from successful commands. */
|
|
34
|
+
readonly commandExecution?: boolean;
|
|
35
|
+
/** Defer nonempty plain-text results from successful MCP tool calls. */
|
|
36
|
+
readonly mcpToolCall?: boolean;
|
|
37
|
+
}
|
|
38
|
+
/** Parameters for Codex `thread/items/list`. */
|
|
39
|
+
export interface CodexListItemsParams {
|
|
40
|
+
/** Thread identifier whose items to list. */
|
|
41
|
+
readonly threadId: string;
|
|
42
|
+
/** Optional turn identifier to filter items to one turn. */
|
|
43
|
+
readonly turnId?: string;
|
|
44
|
+
/** Opaque continuation cursor or exclusive item anchor within `turnId`. */
|
|
45
|
+
readonly cursor?: CodexThreadItemsCursor;
|
|
46
|
+
/** Optional page size (`uint32`). */
|
|
47
|
+
readonly limit?: number;
|
|
48
|
+
/** Pagination direction (`asc` or `desc`). */
|
|
49
|
+
readonly sortDirection?: 'asc' | 'desc';
|
|
50
|
+
/** Output deferral flags for single-turn item reads. */
|
|
51
|
+
readonly deferOutput?: CodexThreadItemsDeferOutput;
|
|
52
|
+
}
|
|
53
|
+
/** Read-only and inspection RPCs exposed during thread setup (`prepareThread` / `verifyThread`), on {@link CodexControlConnection}, and on {@link CodexSession}. */
|
|
54
|
+
export interface CodexControlClient {
|
|
55
|
+
/** Read effective Codex configuration (`config/read`). */
|
|
56
|
+
readConfig(params?: {
|
|
57
|
+
readonly cwd?: string;
|
|
58
|
+
readonly includeLayers?: boolean;
|
|
59
|
+
}): Promise<JsonRpcValue>;
|
|
60
|
+
/** Read thread metadata and live status (`thread/read`). */
|
|
61
|
+
readThread(params: CodexReadThreadParams): Promise<JsonRpcValue>;
|
|
62
|
+
/** List collaboration mode presets (`collaborationMode/list`). */
|
|
63
|
+
listCollaborationModes(): Promise<JsonRpcValue>;
|
|
64
|
+
/** List turns in a thread (`thread/turns/list`). */
|
|
65
|
+
listTurns(params: CodexListTurnsParams): Promise<JsonRpcValue>;
|
|
66
|
+
/** List items in a thread or single turn (`thread/items/list`). */
|
|
67
|
+
listItems(params: CodexListItemsParams): Promise<JsonRpcValue>;
|
|
68
|
+
/** List MCP servers and their statuses (`mcpServerStatus/list`). */
|
|
69
|
+
listMcpServerStatus(params?: {
|
|
70
|
+
readonly cursor?: string;
|
|
71
|
+
readonly limit?: number;
|
|
72
|
+
readonly threadId?: string;
|
|
73
|
+
readonly serverName?: string;
|
|
74
|
+
readonly detail?: string;
|
|
75
|
+
}): Promise<JsonRpcValue>;
|
|
76
|
+
/** List discovered Codex skills (`skills/list`). */
|
|
77
|
+
listSkills(params?: {
|
|
78
|
+
readonly cwds?: readonly string[];
|
|
79
|
+
readonly forceReload?: boolean;
|
|
80
|
+
}): Promise<JsonRpcValue>;
|
|
81
|
+
/** List available models (`model/list`). */
|
|
82
|
+
listModels(params?: {
|
|
83
|
+
readonly cursor?: string;
|
|
84
|
+
readonly limit?: number;
|
|
85
|
+
readonly includeHidden?: boolean;
|
|
86
|
+
readonly modelProvider?: string;
|
|
87
|
+
}): Promise<JsonRpcValue>;
|
|
88
|
+
/** Read active account information (`account/read`). */
|
|
89
|
+
readAccount(params?: {
|
|
90
|
+
readonly refreshToken?: boolean;
|
|
91
|
+
}): Promise<JsonRpcValue>;
|
|
92
|
+
/** Read the raw `account/rateLimits/read` response envelope. */
|
|
93
|
+
readRateLimits(): Promise<JsonRpcValue>;
|
|
94
|
+
/** Revert a thread's durable history to before `beforeTurnId` (`thread/revert`). */
|
|
95
|
+
revertThread(params: CodexRevertThreadParams): Promise<CodexRevertThreadResult>;
|
|
96
|
+
/** Append raw Responses API items to a thread's model-visible history (`thread/inject_items`). */
|
|
97
|
+
injectItems(params: CodexInjectItemsParams): Promise<JsonRpcValue>;
|
|
98
|
+
/** Unsubscribe this connection from a thread (`thread/unsubscribe`). */
|
|
99
|
+
unsubscribeThread(params: CodexThreadIdParams): Promise<JsonRpcValue>;
|
|
100
|
+
/** List threads with pagination and bounded filters (`thread/list`). */
|
|
101
|
+
listThreads(params?: CodexListThreadsParams): Promise<JsonRpcValue>;
|
|
102
|
+
/** List thread identifiers currently loaded in memory (`thread/loaded/list`). */
|
|
103
|
+
listLoadedThreads(params?: CodexListLoadedThreadsParams): Promise<JsonRpcValue>;
|
|
104
|
+
/** Archive a thread (`thread/archive`). */
|
|
105
|
+
archiveThread(params: CodexThreadIdParams): Promise<JsonRpcValue>;
|
|
106
|
+
/** Unarchive a thread (`thread/unarchive`). */
|
|
107
|
+
unarchiveThread(params: CodexThreadIdParams): Promise<JsonRpcValue>;
|
|
108
|
+
/** Patch stored metadata (such as Git info) for a thread (`thread/metadata/update`). */
|
|
109
|
+
updateThreadMetadata(params: CodexUpdateThreadMetadataParams): Promise<JsonRpcValue>;
|
|
110
|
+
/** Set a thread's display name (`thread/name/set`). */
|
|
111
|
+
setThreadName(params: CodexSetThreadNameParams): Promise<JsonRpcValue>;
|
|
112
|
+
}
|
|
113
|
+
/** Input to {@link CodexDriver.connectControl} for a threadless app-server connection. */
|
|
114
|
+
export interface CodexControlConnectInput {
|
|
115
|
+
readonly profile: ExecutorProfileConfig;
|
|
116
|
+
readonly cwd: string;
|
|
117
|
+
/** Optional observer invoked with startup phases (`spawning`, `initializing`) during connect. */
|
|
118
|
+
readonly onStartupPhase?: (phase: ExecutorStartupPhase) => void;
|
|
119
|
+
readonly signal?: AbortSignal;
|
|
120
|
+
}
|
|
121
|
+
/** Threadless connection to a Codex app-server for catalog/config reads and external observation. */
|
|
122
|
+
export interface CodexControlConnection extends CodexControlClient {
|
|
123
|
+
/** OS process id of the spawned `codex app-server`, or `undefined` when attached via `unix-connect`. */
|
|
124
|
+
readonly providerPid: number | undefined;
|
|
125
|
+
/** Answer a pending external server request received via `onServerRequest`. */
|
|
126
|
+
respond(interactionId: string, reply: InteractionReply['reply']): Promise<void>;
|
|
127
|
+
/** Close the connection cleanly (does not kill an external server in `unix-connect` mode). */
|
|
128
|
+
close(): Promise<void>;
|
|
129
|
+
}
|
|
130
|
+
/** Create the read/inspection control facade backed by an active Codex JSON-RPC peer. */
|
|
131
|
+
export declare function createCodexControlClient(input: {
|
|
132
|
+
peer: JsonRpcPeer;
|
|
133
|
+
ensureAlive(): void;
|
|
134
|
+
}): CodexControlClient;
|
|
135
|
+
/** Bind all thread-scoped {@link CodexControlClient} methods to default `threadId` to a session's `nativeThreadId`. */
|
|
136
|
+
export declare function bindCodexSessionThreadControls(controlClient: CodexControlClient, threadId: string): {
|
|
137
|
+
readThread(params?: Omit<CodexReadThreadParams, 'threadId'> & {
|
|
138
|
+
readonly threadId?: string;
|
|
139
|
+
}): Promise<import("zod").JSONType>;
|
|
140
|
+
listTurns(params?: Omit<CodexListTurnsParams, 'threadId'> & {
|
|
141
|
+
readonly threadId?: string;
|
|
142
|
+
}): Promise<import("zod").JSONType>;
|
|
143
|
+
listItems(params?: Omit<CodexListItemsParams, 'threadId'> & {
|
|
144
|
+
readonly threadId?: string;
|
|
145
|
+
}): Promise<import("zod").JSONType>;
|
|
146
|
+
revertThread(params: Omit<CodexRevertThreadParams, 'threadId'> & {
|
|
147
|
+
readonly threadId?: string;
|
|
148
|
+
}): Promise<CodexRevertThreadResult>;
|
|
149
|
+
injectItems(params: Omit<CodexInjectItemsParams, 'threadId'> & {
|
|
150
|
+
readonly threadId?: string;
|
|
151
|
+
}): Promise<import("zod").JSONType>;
|
|
152
|
+
unsubscribeThread(params?: {
|
|
153
|
+
readonly threadId?: string;
|
|
154
|
+
}): Promise<import("zod").JSONType>;
|
|
155
|
+
archiveThread(params?: {
|
|
156
|
+
readonly threadId?: string;
|
|
157
|
+
}): Promise<import("zod").JSONType>;
|
|
158
|
+
unarchiveThread(params?: {
|
|
159
|
+
readonly threadId?: string;
|
|
160
|
+
}): Promise<import("zod").JSONType>;
|
|
161
|
+
updateThreadMetadata(params?: Omit<CodexUpdateThreadMetadataParams, 'threadId'> & {
|
|
162
|
+
readonly threadId?: string;
|
|
163
|
+
}): Promise<import("zod").JSONType>;
|
|
164
|
+
setThreadName(params: Omit<CodexSetThreadNameParams, 'threadId'> & {
|
|
165
|
+
readonly threadId?: string;
|
|
166
|
+
}): Promise<import("zod").JSONType>;
|
|
167
|
+
};
|
|
168
|
+
//# sourceMappingURL=control-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-client.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/codex/control-client.ts"],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EAAE,MAAM,CAAA;KAAE;EAQxF"}
|
|
@@ -1,15 +1,75 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { JsonRpcValue } from '../json-rpc-peer.js';
|
|
2
|
+
import { type CodexTransportConfig } from './connect.js';
|
|
3
|
+
import type { CodexControlClient } from './control-client.js';
|
|
4
|
+
import type { CodexNotificationEvent, CodexServerRequestEvent } from './handlers.js';
|
|
5
|
+
import { type CodexApprovalPolicy, type CodexSandboxMode, type CodexThreadContext } from './protocol.js';
|
|
6
|
+
import { type CodexDriver, type CodexOpenForkOptions, type CodexThreadPolicyOverrides } from './session-controls.js';
|
|
2
7
|
/** Configuration for {@link createCodexDriver}. */
|
|
3
8
|
export interface CodexDriverConfig {
|
|
4
9
|
/** The CLI to run. Default `codex`, found on the engine's `PATH`. */
|
|
5
10
|
executable?: string;
|
|
6
11
|
/** Arguments before the driver's own — a runtime running a script, as a fake engine is run. */
|
|
7
12
|
prefixArgs?: readonly string[];
|
|
13
|
+
/**
|
|
14
|
+
* Transport for `codex app-server`: `'stdio'` (default), `'unix-listen'` (spawns with
|
|
15
|
+
* `--listen unix://<path>` so another client can attach to the same writer), or
|
|
16
|
+
* `'unix-connect'` (attaches to an existing app-server without owning its lifecycle).
|
|
17
|
+
*/
|
|
18
|
+
transport?: CodexTransportConfig;
|
|
19
|
+
/** Additional CLI arguments appended to `codex app-server` (for example `-c` overrides); must not include `--listen` or `--stdio`. */
|
|
20
|
+
serverArgs?: readonly string[];
|
|
21
|
+
/** Default model id passed to `thread/start` and `thread/resume`. */
|
|
8
22
|
model?: string;
|
|
9
|
-
/**
|
|
10
|
-
|
|
11
|
-
/** `
|
|
12
|
-
|
|
23
|
+
/** Default model provider passed to `thread/start` and `thread/resume`. */
|
|
24
|
+
modelProvider?: string;
|
|
25
|
+
/** `approvalPolicy` of a new or resumed thread. Default `on-request`: the engine asks the host. */
|
|
26
|
+
approvalPolicy?: CodexApprovalPolicy;
|
|
27
|
+
/** `sandbox` of a new or resumed thread. Default `workspace-write`. */
|
|
28
|
+
sandbox?: CodexSandboxMode;
|
|
29
|
+
/** Developer instructions passed to `thread/start` and `thread/resume`. */
|
|
30
|
+
developerInstructions?: string;
|
|
31
|
+
/** Additional workspace roots allowed for runtime filesystem access on the thread. */
|
|
32
|
+
runtimeWorkspaceRoots?: readonly string[];
|
|
33
|
+
/** Codex app-server config overrides passed on `thread/start` and `thread/resume` (writable roots, disabled MCP/plugins/features, network policy). */
|
|
34
|
+
config?: Readonly<Record<string, JsonRpcValue>>;
|
|
35
|
+
/**
|
|
36
|
+
* Optional hook invoked after `initialize` and before `thread/start` or `thread/resume`.
|
|
37
|
+
* May inspect server state (`readConfig`, `listModels`, etc.) and return dynamic per-thread policy overrides;
|
|
38
|
+
* throwing stops the connection cleanly before opening the thread.
|
|
39
|
+
*/
|
|
40
|
+
prepareThread?: (context: {
|
|
41
|
+
readonly controls: CodexControlClient;
|
|
42
|
+
readonly cwd: string;
|
|
43
|
+
readonly nativeThreadId?: string;
|
|
44
|
+
readonly forkFrom?: CodexOpenForkOptions;
|
|
45
|
+
}) => Promise<CodexThreadPolicyOverrides | undefined> | CodexThreadPolicyOverrides | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Optional hook invoked immediately after `thread/start`, `thread/resume`, or `thread/fork` succeeds.
|
|
48
|
+
* May inspect the applied `threadContext` or call `listMcpServerStatus`/`listSkills`;
|
|
49
|
+
* throwing fails `open()` and stops the connection cleanly.
|
|
50
|
+
*/
|
|
51
|
+
verifyThread?: (context: {
|
|
52
|
+
readonly nativeThreadId: string;
|
|
53
|
+
readonly threadContext: CodexThreadContext;
|
|
54
|
+
readonly controls: CodexControlClient;
|
|
55
|
+
}) => Promise<void> | void;
|
|
56
|
+
/**
|
|
57
|
+
* Optional observer invoked for every Codex app-server notification (both during `startTurn()`
|
|
58
|
+
* and for external/TUI turns or lifecycle updates like `thread/status/changed` and `turn/started`).
|
|
59
|
+
*/
|
|
60
|
+
onNotification?: (event: CodexNotificationEvent) => void;
|
|
61
|
+
/**
|
|
62
|
+
* Optional handler for known server requests (`commandExecution`, `fileChange`, `permissions`
|
|
63
|
+
* approvals, `requestUserInput`, and `mcpServer/elicitation/request`) arriving
|
|
64
|
+
* outside a driver-initiated `startTurn()` (for example from an attached TUI client).
|
|
65
|
+
* When omitted, requests outside `startTurn()` are refused `-32601`.
|
|
66
|
+
*/
|
|
67
|
+
onServerRequest?: (event: CodexServerRequestEvent) => void;
|
|
68
|
+
/**
|
|
69
|
+
* Optional callback invoked immediately when an established session or control connection drops
|
|
70
|
+
* unexpectedly before `close()` or caller signal abort (including idle socket disconnects).
|
|
71
|
+
*/
|
|
72
|
+
onDisconnect?: (error: Error) => void;
|
|
13
73
|
/** Read the bytes behind a `file` part's `reference`; without it a file part is refused. */
|
|
14
74
|
resolveFile?: (reference: string) => Promise<Uint8Array>;
|
|
15
75
|
/** Maximum decoded size of one image attachment in bytes. Default 5 MiB. */
|
|
@@ -17,11 +77,12 @@ export interface CodexDriverConfig {
|
|
|
17
77
|
ambient?: Readonly<Record<string, string | undefined>>;
|
|
18
78
|
}
|
|
19
79
|
/**
|
|
20
|
-
* Codex through its app-server over stdio: a thread
|
|
21
|
-
* `turn/start` under the executor's
|
|
22
|
-
*
|
|
23
|
-
*
|
|
80
|
+
* Codex through its app-server over stdio or WebSocket-over-Unix-socket: a thread
|
|
81
|
+
* per session, policy and delegation overrides, `turn/start` under the executor's
|
|
82
|
+
* `clientUserMessageId`, per-turn overrides, live session controls (`turn/steer`,
|
|
83
|
+
* `thread/fork`, `thread/compact/start`, config/MCP/skills/models/account reads),
|
|
84
|
+
* multi-bucket `account/rateLimits/read`, and reconcile by client id in
|
|
24
85
|
* `thread/turns/list`.
|
|
25
86
|
*/
|
|
26
|
-
export declare function createCodexDriver(config?: CodexDriverConfig):
|
|
87
|
+
export declare function createCodexDriver(config?: CodexDriverConfig): CodexDriver;
|
|
27
88
|
//# sourceMappingURL=driver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/codex/driver.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/codex/driver.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAe,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAIlE,OAAO,EACL,KAAK,oBAAoB,EAG1B,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,KAAK,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAElF,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EAExB,MAAM,YAAY,CAAC;AAMpB,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,EAEhC,MAAM,oBAAoB,CAAC;AAiD5B,mDAAmD;AACnD,MAAM,WAAW,iBAAiB;IAChC,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+FAA+F;IAC/F,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B;;;;OAIG;IACH,SAAS,CAAC,EAAE,oBAAoB,CAAC;IACjC,sIAAsI;IACtI,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2EAA2E;IAC3E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mGAAmG;IACnG,cAAc,CAAC,EAAE,mBAAmB,CAAC;IACrC,uEAAuE;IACvE,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,2EAA2E;IAC3E,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,sFAAsF;IACtF,qBAAqB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1C,sJAAsJ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BAAsB,GAAG,WAAW,CA8K7E"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { InteractionReply } from '../executor-contract.js';
|
|
2
|
+
import type { PlanLimits } from '../hello.js';
|
|
3
|
+
import { type JsonRpcValue } from '../json-rpc-peer.js';
|
|
4
|
+
import type { ExecutorDelta } from '../vocabulary.js';
|
|
5
|
+
import { type CodexServerRequestMethod, type CodexTurnSlot, type PendingExternalCodexRequest } from './request-answers.js';
|
|
6
|
+
/** Notification observed on a Codex app-server connection (both during and outside `startTurn()`). */
|
|
7
|
+
export interface CodexNotificationEvent {
|
|
8
|
+
/** Raw JSON-RPC notification method (e.g. `thread/status/changed`, `turn/started`, `item/plan/delta`). */
|
|
9
|
+
readonly method: string;
|
|
10
|
+
/** Raw JSON-RPC notification params as received from the server. */
|
|
11
|
+
readonly params: JsonRpcValue | undefined;
|
|
12
|
+
/** `true` when a driver-initiated `startTurn()` owned the thread as this notification arrived. */
|
|
13
|
+
readonly duringActiveTurn: boolean;
|
|
14
|
+
/** Normalized executor deltas produced by the classifier, including for external/TUI turns. */
|
|
15
|
+
readonly deltas: readonly ExecutorDelta[];
|
|
16
|
+
}
|
|
17
|
+
/** Server request received from Codex outside a driver-initiated `startTurn()` (for example from an attached TUI). */
|
|
18
|
+
export interface CodexServerRequestEvent {
|
|
19
|
+
/** JSON-RPC request identifier as a string, also carried on `delta.interactionId`. */
|
|
20
|
+
readonly interactionId: string;
|
|
21
|
+
/** Codex server request method (`requestApproval`, `requestUserInput`, or `mcpServer/elicitation/request`). */
|
|
22
|
+
readonly method: CodexServerRequestMethod;
|
|
23
|
+
/** Raw JSON-RPC request params as received from the server. */
|
|
24
|
+
readonly params: JsonRpcValue | undefined;
|
|
25
|
+
/** Normalized executor `request` delta preserving approval, permissions, question, or elicitation metadata. */
|
|
26
|
+
readonly delta: Extract<ExecutorDelta, {
|
|
27
|
+
type: 'request';
|
|
28
|
+
}>;
|
|
29
|
+
/** Answer this external server request once; throws `TypeError` if already resolved or invalid. */
|
|
30
|
+
respond(reply: InteractionReply['reply']): Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
interface CodexHandlersState {
|
|
33
|
+
profileId: string;
|
|
34
|
+
limits: Map<string, PlanLimits>;
|
|
35
|
+
externalPending: Map<string, PendingExternalCodexRequest>;
|
|
36
|
+
getTurn: () => CodexTurnSlot | undefined;
|
|
37
|
+
clearTurn: () => void;
|
|
38
|
+
onNotification?: (event: CodexNotificationEvent) => void;
|
|
39
|
+
onServerRequest?: (event: CodexServerRequestEvent) => void;
|
|
40
|
+
}
|
|
41
|
+
/** Create JSON-RPC notification and server-request handlers for a Codex session or control link. */
|
|
42
|
+
export declare function createCodexHandlers(state: CodexHandlersState): {
|
|
43
|
+
onNotification: (method: string, params: JsonRpcValue | undefined) => void;
|
|
44
|
+
onRequest: (method: string, params: JsonRpcValue | undefined, id: string | number) => Promise<import("zod").JSONType>;
|
|
45
|
+
};
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=handlers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/codex/handlers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAA2C,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAG9F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAGnD,OAAO,EAEL,KAAK,wBAAwB,EAC7B,KAAK,aAAa,EAKlB,KAAK,2BAA2B,EAEjC,MAAM,mBAAmB,CAAC;AAK3B,sGAAsG;AACtG,MAAM,WAAW,sBAAsB;IACrC,0GAA0G;IAC1G,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,oEAAoE;IACpE,QAAQ,CAAC,MAAM,EAAE,YAAY,GA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-1,4 +1,13 @@
|
|
|
1
1
|
import { type PlanWindow } from '../hello.js';
|
|
2
|
-
/**
|
|
3
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Normalize Codex's `account/rateLimits/read` envelope (including multi-bucket
|
|
4
|
+
* `rateLimitsByLimitId`) or a single `RateLimitSnapshot` into {@link PlanWindow} entries.
|
|
5
|
+
*
|
|
6
|
+
* Each window is keyed as `<limitId|limit>:<windowDurationMins>m` (falling back to
|
|
7
|
+
* `<limitId|limit>:<slot>` when duration is absent, or adding `:<slot>` when both slots
|
|
8
|
+
* share the same duration) so weekly and five-hour windows never overwrite each other across
|
|
9
|
+
* buckets. One malformed bucket never discards healthy buckets, clamped names are deduplicated
|
|
10
|
+
* deterministically, and the list is capped at 32 windows to match {@link PlanWindowSchema}.
|
|
11
|
+
*/
|
|
12
|
+
export declare function codexPlanWindows(reported: unknown): PlanWindow[];
|
|
4
13
|
//# sourceMappingURL=limits.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/codex/limits.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/codex/limits.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAoB,MAAM,UAAU,CAAC;AA0F7D;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,OAAO,GAAG,UAAU,EAAE,CAgDhE"}
|
|
@@ -1,10 +1,30 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import type { JsonRpcValue } from '../json-rpc-peer.js';
|
|
2
3
|
/**
|
|
3
|
-
* The slice of Codex's app-server protocol (0.
|
|
4
|
-
* without the `jsonrpc` header) the driver reads.
|
|
5
|
-
* it does not use through; a test checks each against
|
|
6
|
-
* pinned CLI generates, so a renamed field fails there and
|
|
4
|
+
* The slice of Codex's app-server protocol (0.171.0, JSON-RPC over stdio or
|
|
5
|
+
* WebSocket-over-Unix-socket without the `jsonrpc` header) the driver reads.
|
|
6
|
+
* Every schema lets fields it does not use through; a test checks each against
|
|
7
|
+
* the JSON Schema the pinned CLI generates, so a renamed field fails there and
|
|
8
|
+
* not in a turn.
|
|
7
9
|
*/
|
|
10
|
+
/** Approval policy values accepted by Codex `thread/start`, `thread/resume`, `thread/fork`, and `turn/start`. */
|
|
11
|
+
export type CodexApprovalPolicy = 'untrusted' | 'on-failure' | 'on-request' | 'never' | Readonly<Record<string, JsonRpcValue>>;
|
|
12
|
+
/** Sandbox mode values accepted by Codex `thread/start`, `thread/resume`, and `thread/fork`. */
|
|
13
|
+
export type CodexSandboxMode = 'read-only' | 'workspace-write' | 'danger-full-access';
|
|
14
|
+
/** Collaboration mode settings passed on `turn/start`. */
|
|
15
|
+
export declare const CodexCollaborationModeSchema: z.ZodObject<{
|
|
16
|
+
mode: z.ZodEnum<{
|
|
17
|
+
default: "default";
|
|
18
|
+
plan: "plan";
|
|
19
|
+
}>;
|
|
20
|
+
settings: z.ZodObject<{
|
|
21
|
+
model: z.ZodString;
|
|
22
|
+
reasoning_effort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
23
|
+
developer_instructions: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
24
|
+
}, z.core.$strict>;
|
|
25
|
+
}, z.core.$strict>;
|
|
26
|
+
/** Collaboration mode override accepted by Codex `turn/start`. */
|
|
27
|
+
export type CodexCollaborationMode = z.infer<typeof CodexCollaborationModeSchema>;
|
|
8
28
|
export declare const CodexThreadItemSchema: z.ZodObject<{
|
|
9
29
|
type: z.ZodString;
|
|
10
30
|
id: z.ZodString;
|
|
@@ -77,7 +97,19 @@ export declare const CodexNotificationParams: {
|
|
|
77
97
|
inputTokens: z.ZodInt;
|
|
78
98
|
outputTokens: z.ZodInt;
|
|
79
99
|
cachedInputTokens: z.ZodOptional<z.ZodInt>;
|
|
100
|
+
cacheWriteInputTokens: z.ZodOptional<z.ZodInt>;
|
|
101
|
+
reasoningOutputTokens: z.ZodOptional<z.ZodInt>;
|
|
102
|
+
totalTokens: z.ZodOptional<z.ZodInt>;
|
|
80
103
|
}, z.core.$loose>;
|
|
104
|
+
total: z.ZodOptional<z.ZodObject<{
|
|
105
|
+
inputTokens: z.ZodOptional<z.ZodInt>;
|
|
106
|
+
outputTokens: z.ZodOptional<z.ZodInt>;
|
|
107
|
+
cachedInputTokens: z.ZodOptional<z.ZodInt>;
|
|
108
|
+
cacheWriteInputTokens: z.ZodOptional<z.ZodInt>;
|
|
109
|
+
reasoningOutputTokens: z.ZodOptional<z.ZodInt>;
|
|
110
|
+
totalTokens: z.ZodOptional<z.ZodInt>;
|
|
111
|
+
}, z.core.$loose>>;
|
|
112
|
+
modelContextWindow: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
81
113
|
}, z.core.$loose>;
|
|
82
114
|
}, z.core.$loose>;
|
|
83
115
|
readonly 'serverRequest/resolved': z.ZodObject<{
|
|
@@ -85,12 +117,34 @@ export declare const CodexNotificationParams: {
|
|
|
85
117
|
}, z.core.$loose>;
|
|
86
118
|
readonly 'account/rateLimits/updated': z.ZodObject<{
|
|
87
119
|
rateLimits: z.ZodJSONSchema;
|
|
120
|
+
rateLimitsByLimitId: z.ZodOptional<z.ZodJSONSchema>;
|
|
88
121
|
}, z.core.$loose>;
|
|
89
122
|
};
|
|
90
123
|
export declare const CodexApprovalParamsSchema: z.ZodObject<{
|
|
91
124
|
itemId: z.ZodString;
|
|
92
125
|
command: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
126
|
+
cwd: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
93
127
|
reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
128
|
+
grantRoot: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
129
|
+
kind: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
130
|
+
approvalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
131
|
+
commandActions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodJSONSchema>>>;
|
|
132
|
+
availableDecisions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodJSONSchema>>>;
|
|
133
|
+
}, z.core.$loose>;
|
|
134
|
+
export declare const CodexUserInputOptionSchema: z.ZodObject<{
|
|
135
|
+
label: z.ZodString;
|
|
136
|
+
description: z.ZodString;
|
|
137
|
+
}, z.core.$loose>;
|
|
138
|
+
export declare const CodexUserInputQuestionSchema: z.ZodObject<{
|
|
139
|
+
id: z.ZodString;
|
|
140
|
+
question: z.ZodString;
|
|
141
|
+
header: z.ZodString;
|
|
142
|
+
isOther: z.ZodOptional<z.ZodBoolean>;
|
|
143
|
+
isSecret: z.ZodOptional<z.ZodBoolean>;
|
|
144
|
+
options: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
145
|
+
label: z.ZodString;
|
|
146
|
+
description: z.ZodString;
|
|
147
|
+
}, z.core.$loose>>>>;
|
|
94
148
|
}, z.core.$loose>;
|
|
95
149
|
export declare const CodexUserInputParamsSchema: z.ZodObject<{
|
|
96
150
|
itemId: z.ZodString;
|
|
@@ -98,22 +152,127 @@ export declare const CodexUserInputParamsSchema: z.ZodObject<{
|
|
|
98
152
|
id: z.ZodString;
|
|
99
153
|
question: z.ZodString;
|
|
100
154
|
header: z.ZodString;
|
|
155
|
+
isOther: z.ZodOptional<z.ZodBoolean>;
|
|
156
|
+
isSecret: z.ZodOptional<z.ZodBoolean>;
|
|
157
|
+
options: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
158
|
+
label: z.ZodString;
|
|
159
|
+
description: z.ZodString;
|
|
160
|
+
}, z.core.$loose>>>>;
|
|
101
161
|
}, z.core.$loose>>;
|
|
102
162
|
}, z.core.$loose>;
|
|
103
163
|
/** Answers to `item/tool/requestUserInput`: question id → the chosen answers. */
|
|
104
164
|
export declare const CodexUserInputAnswersSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
105
165
|
answers: z.ZodArray<z.ZodString>;
|
|
106
166
|
}, z.core.$strict>>;
|
|
167
|
+
/** Permission profile requested or granted on `item/permissions/requestApproval`. */
|
|
168
|
+
export declare const CodexPermissionProfileSchema: z.ZodObject<{
|
|
169
|
+
fileSystem: z.ZodOptional<z.ZodNullable<z.ZodJSONSchema>>;
|
|
170
|
+
network: z.ZodOptional<z.ZodNullable<z.ZodJSONSchema>>;
|
|
171
|
+
}, z.core.$loose>;
|
|
172
|
+
/** Parameters of Codex `item/permissions/requestApproval` (0.171.0). */
|
|
173
|
+
export declare const CodexPermissionsApprovalParamsSchema: z.ZodObject<{
|
|
174
|
+
threadId: z.ZodString;
|
|
175
|
+
turnId: z.ZodString;
|
|
176
|
+
itemId: z.ZodString;
|
|
177
|
+
cwd: z.ZodString;
|
|
178
|
+
permissions: z.ZodObject<{
|
|
179
|
+
fileSystem: z.ZodOptional<z.ZodNullable<z.ZodJSONSchema>>;
|
|
180
|
+
network: z.ZodOptional<z.ZodNullable<z.ZodJSONSchema>>;
|
|
181
|
+
}, z.core.$loose>;
|
|
182
|
+
startedAtMs: z.ZodNumber;
|
|
183
|
+
reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
184
|
+
environmentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
185
|
+
}, z.core.$loose>;
|
|
186
|
+
/** Parameters of Codex `mcpServer/elicitation/request` across all four `oneOf` modes (0.171.0). */
|
|
187
|
+
export declare const CodexMcpElicitationParamsSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
188
|
+
serverName: z.ZodString;
|
|
189
|
+
threadId: z.ZodString;
|
|
190
|
+
turnId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
191
|
+
environmentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
192
|
+
message: z.ZodString;
|
|
193
|
+
_meta: z.ZodOptional<z.ZodJSONSchema>;
|
|
194
|
+
mode: z.ZodLiteral<"form">;
|
|
195
|
+
requestedSchema: z.ZodObject<{
|
|
196
|
+
type: z.ZodLiteral<"object">;
|
|
197
|
+
properties: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
|
|
198
|
+
required: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
199
|
+
$schema: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
200
|
+
}, z.core.$loose>;
|
|
201
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
202
|
+
serverName: z.ZodString;
|
|
203
|
+
threadId: z.ZodString;
|
|
204
|
+
turnId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
205
|
+
environmentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
206
|
+
message: z.ZodString;
|
|
207
|
+
_meta: z.ZodOptional<z.ZodJSONSchema>;
|
|
208
|
+
mode: z.ZodLiteral<"openai/form">;
|
|
209
|
+
requestedSchema: z.ZodJSONSchema;
|
|
210
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
211
|
+
serverName: z.ZodString;
|
|
212
|
+
threadId: z.ZodString;
|
|
213
|
+
turnId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
214
|
+
environmentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
215
|
+
message: z.ZodString;
|
|
216
|
+
_meta: z.ZodOptional<z.ZodJSONSchema>;
|
|
217
|
+
mode: z.ZodLiteral<"openaiForm">;
|
|
218
|
+
requestedSchema: z.ZodJSONSchema;
|
|
219
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
220
|
+
serverName: z.ZodString;
|
|
221
|
+
threadId: z.ZodString;
|
|
222
|
+
turnId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
223
|
+
environmentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
224
|
+
message: z.ZodString;
|
|
225
|
+
_meta: z.ZodOptional<z.ZodJSONSchema>;
|
|
226
|
+
mode: z.ZodLiteral<"url">;
|
|
227
|
+
elicitationId: z.ZodString;
|
|
228
|
+
url: z.ZodString;
|
|
229
|
+
}, z.core.$loose>], "mode">;
|
|
230
|
+
/** Elicitation request mode discriminated by Codex `mcpServer/elicitation/request`. */
|
|
231
|
+
export type CodexMcpElicitationMode = z.infer<typeof CodexMcpElicitationParamsSchema>['mode'];
|
|
232
|
+
/** Answer payload for `mcpServer/elicitation/request`, matching `McpServerElicitationRequestResponse`. */
|
|
233
|
+
export declare const CodexMcpElicitationAnswerSchema: z.ZodObject<{
|
|
234
|
+
action: z.ZodEnum<{
|
|
235
|
+
accept: "accept";
|
|
236
|
+
cancel: "cancel";
|
|
237
|
+
decline: "decline";
|
|
238
|
+
}>;
|
|
239
|
+
content: z.ZodOptional<z.ZodJSONSchema>;
|
|
240
|
+
_meta: z.ZodOptional<z.ZodJSONSchema>;
|
|
241
|
+
}, z.core.$strict>;
|
|
242
|
+
/** Applied thread policy and runtime context returned by `thread/start`, `thread/resume`, or `thread/fork`. */
|
|
243
|
+
export declare const CodexThreadContextSchema: z.ZodObject<{
|
|
244
|
+
model: z.ZodOptional<z.ZodString>;
|
|
245
|
+
modelProvider: z.ZodOptional<z.ZodString>;
|
|
246
|
+
reasoningEffort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
247
|
+
approvalPolicy: z.ZodOptional<z.ZodJSONSchema>;
|
|
248
|
+
sandbox: z.ZodOptional<z.ZodJSONSchema>;
|
|
249
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
250
|
+
runtimeWorkspaceRoots: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
251
|
+
}, z.core.$strip>;
|
|
252
|
+
/** Applied policy and model context reported by Codex when opening, resuming, or forking a thread. */
|
|
253
|
+
export type CodexThreadContext = Readonly<z.infer<typeof CodexThreadContextSchema>>;
|
|
107
254
|
export declare const CodexStartedThreadSchema: z.ZodObject<{
|
|
255
|
+
model: z.ZodOptional<z.ZodString>;
|
|
256
|
+
modelProvider: z.ZodOptional<z.ZodString>;
|
|
257
|
+
reasoningEffort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
258
|
+
approvalPolicy: z.ZodOptional<z.ZodJSONSchema>;
|
|
259
|
+
sandbox: z.ZodOptional<z.ZodJSONSchema>;
|
|
260
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
261
|
+
runtimeWorkspaceRoots: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
108
262
|
thread: z.ZodObject<{
|
|
109
263
|
id: z.ZodString;
|
|
110
264
|
}, z.core.$loose>;
|
|
111
265
|
}, z.core.$loose>;
|
|
266
|
+
/** Extract the normalized applied thread context from a parsed `thread/start`, `thread/resume`, or `thread/fork` reply. */
|
|
267
|
+
export declare function extractCodexThreadContext(parsed: z.infer<typeof CodexStartedThreadSchema>): CodexThreadContext;
|
|
112
268
|
export declare const CodexStartedTurnSchema: z.ZodObject<{
|
|
113
269
|
turn: z.ZodObject<{
|
|
114
270
|
id: z.ZodString;
|
|
115
271
|
}, z.core.$loose>;
|
|
116
272
|
}, z.core.$loose>;
|
|
273
|
+
export declare const CodexTurnSteerResponseSchema: z.ZodObject<{
|
|
274
|
+
turnId: z.ZodString;
|
|
275
|
+
}, z.core.$loose>;
|
|
117
276
|
export declare const CodexListedTurnItemSchema: z.ZodObject<{
|
|
118
277
|
type: z.ZodString;
|
|
119
278
|
clientId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -157,19 +316,29 @@ export declare const CodexTurnsPageSchema: z.ZodObject<{
|
|
|
157
316
|
}, z.core.$loose>>;
|
|
158
317
|
nextCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
159
318
|
}, z.core.$loose>;
|
|
319
|
+
export declare const CodexThreadRevertResponseSchema: z.ZodObject<{
|
|
320
|
+
thread: z.ZodObject<{
|
|
321
|
+
id: z.ZodString;
|
|
322
|
+
}, z.core.$loose>;
|
|
323
|
+
turnsBackwardsCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
324
|
+
itemsBackwardsCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
325
|
+
}, z.core.$loose>;
|
|
160
326
|
/** Notifications the driver asks the server not to send: noise for a turn. */
|
|
161
327
|
export declare const CODEX_OPTED_OUT_NOTIFICATIONS: string[];
|
|
162
328
|
/** Notifications a turn sees and that carry nothing for it. */
|
|
163
329
|
export declare const CODEX_QUIET_NOTIFICATIONS: Set<string>;
|
|
164
330
|
/** Server requests the driver answers; every other is refused `-32601`. */
|
|
165
331
|
export declare const CODEX_APPROVAL_REQUESTS: Set<string>;
|
|
332
|
+
export declare const CODEX_PERMISSIONS_APPROVAL_REQUEST = "item/permissions/requestApproval";
|
|
166
333
|
export declare const CODEX_INPUT_REQUEST = "item/tool/requestUserInput";
|
|
334
|
+
export declare const CODEX_ELICITATION_REQUEST = "mcpServer/elicitation/request";
|
|
167
335
|
/**
|
|
168
336
|
* The decisions the driver answers an approval with, the same for a command and a file
|
|
169
337
|
* change: `deny` lets the agent continue the turn, `interrupted` interrupts it at once.
|
|
170
338
|
*/
|
|
171
339
|
export declare const CODEX_APPROVAL_DECISION: {
|
|
172
340
|
readonly approve: 'accept';
|
|
341
|
+
readonly approveForSession: 'acceptForSession';
|
|
173
342
|
readonly deny: 'decline';
|
|
174
343
|
readonly interrupted: 'cancel';
|
|
175
344
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/codex/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/codex/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD;;;;;;GAM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