stitchkit 0.129.0 → 0.130.1
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 +32 -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-sdk/controls.d.ts +10 -1
- package/dist/agent-executor/claude-sdk/controls.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/driver.d.ts +97 -3
- 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 +53 -5
- package/dist/agent-executor/claude-sdk/query-loop.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/query-options.d.ts +2 -0
- package/dist/agent-executor/claude-sdk/query-options.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/session.d.ts +2 -3
- 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 +5 -2
- package/dist/agent-executor/codex/connect.d.ts.map +1 -1
- package/dist/agent-executor/codex/control-client.d.ts +206 -0
- package/dist/agent-executor/codex/control-client.d.ts.map +1 -0
- package/dist/agent-executor/codex/driver.d.ts +35 -5
- package/dist/agent-executor/codex/driver.d.ts.map +1 -1
- package/dist/agent-executor/codex/handlers.d.ts +52 -0
- package/dist/agent-executor/codex/handlers.d.ts.map +1 -0
- package/dist/agent-executor/codex/limits.d.ts.map +1 -1
- package/dist/agent-executor/codex/protocol.d.ts +128 -0
- 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 +124 -61
- package/dist/agent-executor/codex/session-controls.d.ts.map +1 -1
- package/dist/agent-executor/codex/session.d.ts +10 -36
- package/dist/agent-executor/codex/session.d.ts.map +1 -1
- package/dist/agent-executor/codex/shared-server.d.ts +31 -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 +144 -0
- package/dist/agent-executor/codex/thread-controls.d.ts.map +1 -0
- package/dist/agent-executor/codex/thread-open.d.ts +66 -0
- package/dist/agent-executor/codex/thread-open.d.ts.map +1 -0
- package/dist/agent-executor/codex/turn-input.d.ts +47 -0
- package/dist/agent-executor/codex/turn-input.d.ts.map +1 -0
- package/dist/agent-executor/contract.d.ts +77 -0
- package/dist/agent-executor/contract.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 +72 -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 +18 -18
- package/dist/agent-runtime/branch-provider.d.ts +2 -2
- 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/store-conformance-lifecycle.d.ts +20 -20
- package/dist/agent-runtime/store-conformance-support.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 +847 -214
- 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 +713 -205
- package/dist/entrypoints/agent-executor/claude.js +44 -19
- package/dist/entrypoints/agent-executor/codex.d.ts +10 -2
- package/dist/entrypoints/agent-executor/codex.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/codex.js +2269 -600
- 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 +411 -23
- package/dist/entrypoints/agent-runtime.js +4 -23
- 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 +1 -1
- package/dist/entrypoints/tools/toolkit.js +1 -1
- package/dist/{index-wv2amqm4.js → index-2s8sy57y.js} +36 -103
- package/dist/{index-afb6z77w.js → index-dbp6xemn.js} +75 -7
- package/dist/{index-bjmj2q1z.js → index-jrn3prgm.js} +1 -1
- package/dist/index-kne9g2c5.js +30 -0
- package/dist/index-p1qmpq0p.js +1300 -0
- package/dist/{index-7jqn3b3g.js → index-v759mzed.js} +152 -2
- package/dist/{index-cbhxhma2.js → index-x5ayy5bn.js} +1 -0
- package/dist/index-y0a4gt1s.js +142 -0
- 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 +4 -2
- package/llms/agent-executor-codex.txt +8 -4
- package/llms/agent-executor-testing.txt +5 -1
- package/llms/agent-executor.txt +7 -6
- 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-0.129.0.txt → upgrading-0.128.0-0.130.0.txt} +30 -3
- package/llms/upgrading.txt +1 -1
- package/llms-full.txt +159 -97
- package/llms.txt +8 -8
- package/package.json +1 -1
- package/dist/index-y71zn1gw.js +0 -586
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import type { InteractionReply } from '../executor-contract.js';
|
|
2
|
+
import type { DriverImageOptions } from '../image-input.js';
|
|
3
|
+
import type { JsonRpcPeer, JsonRpcValue } from '../json-rpc-peer.js';
|
|
4
|
+
import type { ExecutorProfileConfig } from '../profile.js';
|
|
5
|
+
import type { ExecutorStartupPhase } from '../vocabulary.js';
|
|
6
|
+
import { type CodexInjectItemsParams, type CodexInterruptTurnParams, type CodexListLoadedThreadsParams, type CodexListThreadsParams, type CodexRevertThreadParams, type CodexRevertThreadResult, type CodexSetThreadNameParams, type CodexThreadIdParams, type CodexUpdateThreadMetadataParams } from './thread-controls.js';
|
|
7
|
+
import { type CodexResumeThreadParams } from './thread-open.js';
|
|
8
|
+
import { type CodexTurnInputPart } from './turn-input.js';
|
|
9
|
+
/** Parameters for Codex `thread/read`. */
|
|
10
|
+
export interface CodexReadThreadParams {
|
|
11
|
+
/** Thread identifier to inspect. */
|
|
12
|
+
readonly threadId: string;
|
|
13
|
+
/** When `true`, include full rollout turns (deprecated for large threads). */
|
|
14
|
+
readonly includeTurns?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/** Parameters for Codex `thread/turns/list`. */
|
|
17
|
+
export interface CodexListTurnsParams {
|
|
18
|
+
/** Thread identifier whose turns to list. */
|
|
19
|
+
readonly threadId: string;
|
|
20
|
+
/** Opaque continuation cursor returned by a previous page, or `null` for the first page. */
|
|
21
|
+
readonly cursor?: string | null;
|
|
22
|
+
/** Optional page size (`uint32`). */
|
|
23
|
+
readonly limit?: number;
|
|
24
|
+
/** Level of item detail per turn (`notLoaded`, `summary`, or `full`). */
|
|
25
|
+
readonly itemsView?: 'notLoaded' | 'summary' | 'full';
|
|
26
|
+
/** Pagination direction (`asc` or `desc`). */
|
|
27
|
+
readonly sortDirection?: 'asc' | 'desc';
|
|
28
|
+
}
|
|
29
|
+
/** Starting position for a `thread/items/list` page: opaque string cursor or exclusive item anchor. */
|
|
30
|
+
export type CodexThreadItemsCursor = string | {
|
|
31
|
+
readonly type: 'item';
|
|
32
|
+
readonly itemId: string;
|
|
33
|
+
};
|
|
34
|
+
/** Output deferral preferences accepted by Codex `thread/items/list`. */
|
|
35
|
+
export interface CodexThreadItemsDeferOutput {
|
|
36
|
+
/** Defer nonempty output from successful commands. */
|
|
37
|
+
readonly commandExecution?: boolean;
|
|
38
|
+
/** Defer nonempty plain-text results from successful MCP tool calls. */
|
|
39
|
+
readonly mcpToolCall?: boolean;
|
|
40
|
+
}
|
|
41
|
+
/** Parameters for Codex `thread/items/list`. */
|
|
42
|
+
export interface CodexListItemsParams {
|
|
43
|
+
/** Thread identifier whose items to list. */
|
|
44
|
+
readonly threadId: string;
|
|
45
|
+
/** Optional turn identifier to filter items to one turn. */
|
|
46
|
+
readonly turnId?: string;
|
|
47
|
+
/** Opaque continuation cursor, exclusive item anchor within `turnId`, or `null` for the first page. */
|
|
48
|
+
readonly cursor?: CodexThreadItemsCursor | null;
|
|
49
|
+
/** Optional page size (`uint32`). */
|
|
50
|
+
readonly limit?: number;
|
|
51
|
+
/** Pagination direction (`asc` or `desc`). */
|
|
52
|
+
readonly sortDirection?: 'asc' | 'desc';
|
|
53
|
+
/** Output deferral flags for single-turn item reads. */
|
|
54
|
+
readonly deferOutput?: CodexThreadItemsDeferOutput;
|
|
55
|
+
}
|
|
56
|
+
/** Parameters for steering an active Codex turn on any thread via {@link CodexControlClient.steerTurn} (`turn/steer`). */
|
|
57
|
+
export interface CodexControlSteerTurnParams {
|
|
58
|
+
/** Thread identifier owning the active turn to steer. */
|
|
59
|
+
readonly threadId: string;
|
|
60
|
+
/** Required active Codex turn identifier precondition (`expectedTurnId`). */
|
|
61
|
+
readonly expectedTurnId: string;
|
|
62
|
+
/** Ordered turn input parts (text, resolved images, `localImage`, and `skill` items). */
|
|
63
|
+
readonly input: readonly CodexTurnInputPart[];
|
|
64
|
+
/** Optional client-generated idempotency identifier (`clientUserMessageId`). */
|
|
65
|
+
readonly clientId?: string;
|
|
66
|
+
}
|
|
67
|
+
/** Read-only and inspection RPCs exposed during thread setup (`prepareThread` / `verifyThread`), on {@link CodexControlConnection}, and on {@link CodexSession}. */
|
|
68
|
+
export interface CodexControlClient {
|
|
69
|
+
/** Read effective Codex configuration (`config/read`). */
|
|
70
|
+
readConfig(params?: {
|
|
71
|
+
readonly cwd?: string;
|
|
72
|
+
readonly includeLayers?: boolean;
|
|
73
|
+
}): Promise<JsonRpcValue>;
|
|
74
|
+
/** Read thread metadata and live status (`thread/read`). */
|
|
75
|
+
readThread(params: CodexReadThreadParams): Promise<JsonRpcValue>;
|
|
76
|
+
/** List collaboration mode presets (`collaborationMode/list`). */
|
|
77
|
+
listCollaborationModes(): Promise<JsonRpcValue>;
|
|
78
|
+
/** List turns in a thread (`thread/turns/list`). */
|
|
79
|
+
listTurns(params: CodexListTurnsParams): Promise<JsonRpcValue>;
|
|
80
|
+
/** List items in a thread or single turn (`thread/items/list`). */
|
|
81
|
+
listItems(params: CodexListItemsParams): Promise<JsonRpcValue>;
|
|
82
|
+
/** List MCP servers and their statuses (`mcpServerStatus/list`). */
|
|
83
|
+
listMcpServerStatus(params?: {
|
|
84
|
+
readonly cursor?: string;
|
|
85
|
+
readonly limit?: number;
|
|
86
|
+
readonly threadId?: string;
|
|
87
|
+
readonly serverName?: string;
|
|
88
|
+
readonly detail?: string;
|
|
89
|
+
}): Promise<JsonRpcValue>;
|
|
90
|
+
/** List discovered Codex skills (`skills/list`). */
|
|
91
|
+
listSkills(params?: {
|
|
92
|
+
readonly cwds?: readonly string[];
|
|
93
|
+
readonly forceReload?: boolean;
|
|
94
|
+
}): Promise<JsonRpcValue>;
|
|
95
|
+
/** List available models (`model/list`). */
|
|
96
|
+
listModels(params?: {
|
|
97
|
+
readonly cursor?: string;
|
|
98
|
+
readonly limit?: number;
|
|
99
|
+
readonly includeHidden?: boolean;
|
|
100
|
+
readonly modelProvider?: string;
|
|
101
|
+
}): Promise<JsonRpcValue>;
|
|
102
|
+
/** Read active account information (`account/read`). */
|
|
103
|
+
readAccount(params?: {
|
|
104
|
+
readonly refreshToken?: boolean;
|
|
105
|
+
}): Promise<JsonRpcValue>;
|
|
106
|
+
/** Read the raw `account/rateLimits/read` response envelope. */
|
|
107
|
+
readRateLimits(): Promise<JsonRpcValue>;
|
|
108
|
+
/** Revert a thread's durable history to before `beforeTurnId` (`thread/revert`). */
|
|
109
|
+
revertThread(params: CodexRevertThreadParams): Promise<CodexRevertThreadResult>;
|
|
110
|
+
/** Append raw Responses API items to a thread's model-visible history (`thread/inject_items`). */
|
|
111
|
+
injectItems(params: CodexInjectItemsParams): Promise<JsonRpcValue>;
|
|
112
|
+
/** Unsubscribe this connection from a thread (`thread/unsubscribe`). */
|
|
113
|
+
unsubscribeThread(params: CodexThreadIdParams): Promise<JsonRpcValue>;
|
|
114
|
+
/** List threads with pagination and bounded filters (`thread/list`). */
|
|
115
|
+
listThreads(params?: CodexListThreadsParams): Promise<JsonRpcValue>;
|
|
116
|
+
/** List thread identifiers currently loaded in memory (`thread/loaded/list`). */
|
|
117
|
+
listLoadedThreads(params?: CodexListLoadedThreadsParams): Promise<JsonRpcValue>;
|
|
118
|
+
/** Archive a thread (`thread/archive`). */
|
|
119
|
+
archiveThread(params: CodexThreadIdParams): Promise<JsonRpcValue>;
|
|
120
|
+
/** Unarchive a thread (`thread/unarchive`). */
|
|
121
|
+
unarchiveThread(params: CodexThreadIdParams): Promise<JsonRpcValue>;
|
|
122
|
+
/** Patch stored metadata (such as Git info) for a thread (`thread/metadata/update`). */
|
|
123
|
+
updateThreadMetadata(params: CodexUpdateThreadMetadataParams): Promise<JsonRpcValue>;
|
|
124
|
+
/** Set a thread's display name (`thread/name/set`). */
|
|
125
|
+
setThreadName(params: CodexSetThreadNameParams): Promise<JsonRpcValue>;
|
|
126
|
+
/** Resume a thread (`thread/resume`, defaulting `excludeTurns` to `true`); returns the raw response without mutating a session's cached `threadContext`. */
|
|
127
|
+
resumeThread(params: CodexResumeThreadParams): Promise<JsonRpcValue>;
|
|
128
|
+
/** Interrupt a running turn on a thread (`turn/interrupt`), including external/TUI or reconnected turns. */
|
|
129
|
+
interruptTurn(params: CodexInterruptTurnParams): Promise<void>;
|
|
130
|
+
/** Steer an active turn on a thread by explicit `expectedTurnId` (`turn/steer`). */
|
|
131
|
+
steerTurn(params: CodexControlSteerTurnParams): Promise<{
|
|
132
|
+
readonly turnId: string;
|
|
133
|
+
}>;
|
|
134
|
+
/** Request context compaction for a thread (`thread/compact/start`). */
|
|
135
|
+
compactThread(params: CodexThreadIdParams): Promise<void>;
|
|
136
|
+
}
|
|
137
|
+
/** Input to {@link CodexDriver.connectControl} for a threadless app-server connection. */
|
|
138
|
+
export interface CodexControlConnectInput {
|
|
139
|
+
readonly profile: ExecutorProfileConfig;
|
|
140
|
+
readonly cwd: string;
|
|
141
|
+
/** Optional observer invoked with startup phases (`spawning`, `initializing`) during connect. */
|
|
142
|
+
readonly onStartupPhase?: (phase: ExecutorStartupPhase) => void;
|
|
143
|
+
readonly signal?: AbortSignal;
|
|
144
|
+
}
|
|
145
|
+
/** Threadless connection to a Codex app-server for catalog/config reads and external observation. */
|
|
146
|
+
export interface CodexControlConnection extends CodexControlClient {
|
|
147
|
+
/** OS process id of the spawned `codex app-server`, or `undefined` when attached via `unix-connect`. */
|
|
148
|
+
readonly providerPid: number | undefined;
|
|
149
|
+
/** Server-reported `userAgent` from the `initialize` response, or `undefined` when omitted. */
|
|
150
|
+
readonly userAgent: string | undefined;
|
|
151
|
+
/** Answer a pending external server request received via `onServerRequest`. */
|
|
152
|
+
respond(interactionId: string, reply: InteractionReply['reply']): Promise<void>;
|
|
153
|
+
/** Close the connection cleanly (does not kill an external server in `unix-connect` mode). */
|
|
154
|
+
close(): Promise<void>;
|
|
155
|
+
}
|
|
156
|
+
/** Create the read/inspection and turn/thread control facade backed by an active Codex JSON-RPC peer. */
|
|
157
|
+
export declare function createCodexControlClient(input: {
|
|
158
|
+
peer: JsonRpcPeer;
|
|
159
|
+
imageOptions: DriverImageOptions;
|
|
160
|
+
signal: AbortSignal;
|
|
161
|
+
ensureAlive(): void;
|
|
162
|
+
onBeforeInterruptTurn?: (threadId: string, turnId: string) => void;
|
|
163
|
+
}): CodexControlClient;
|
|
164
|
+
/** Bind all thread-scoped {@link CodexControlClient} methods to default `threadId` to a session's `nativeThreadId`. */
|
|
165
|
+
export declare function bindCodexSessionThreadControls(controlClient: CodexControlClient, threadId: string): {
|
|
166
|
+
readThread(params?: Omit<CodexReadThreadParams, 'threadId'> & {
|
|
167
|
+
readonly threadId?: string;
|
|
168
|
+
}): Promise<import("zod").JSONType>;
|
|
169
|
+
listTurns(params?: Omit<CodexListTurnsParams, 'threadId'> & {
|
|
170
|
+
readonly threadId?: string;
|
|
171
|
+
}): Promise<import("zod").JSONType>;
|
|
172
|
+
listItems(params?: Omit<CodexListItemsParams, 'threadId'> & {
|
|
173
|
+
readonly threadId?: string;
|
|
174
|
+
}): Promise<import("zod").JSONType>;
|
|
175
|
+
resumeThread(params?: Omit<CodexResumeThreadParams, 'threadId'> & {
|
|
176
|
+
readonly threadId?: string;
|
|
177
|
+
}): Promise<import("zod").JSONType>;
|
|
178
|
+
revertThread(params: Omit<CodexRevertThreadParams, 'threadId'> & {
|
|
179
|
+
readonly threadId?: string;
|
|
180
|
+
}): Promise<CodexRevertThreadResult>;
|
|
181
|
+
injectItems(params: Omit<CodexInjectItemsParams, 'threadId'> & {
|
|
182
|
+
readonly threadId?: string;
|
|
183
|
+
}): Promise<import("zod").JSONType>;
|
|
184
|
+
unsubscribeThread(params?: {
|
|
185
|
+
readonly threadId?: string;
|
|
186
|
+
}): Promise<import("zod").JSONType>;
|
|
187
|
+
archiveThread(params?: {
|
|
188
|
+
readonly threadId?: string;
|
|
189
|
+
}): Promise<import("zod").JSONType>;
|
|
190
|
+
unarchiveThread(params?: {
|
|
191
|
+
readonly threadId?: string;
|
|
192
|
+
}): Promise<import("zod").JSONType>;
|
|
193
|
+
updateThreadMetadata(params?: Omit<CodexUpdateThreadMetadataParams, 'threadId'> & {
|
|
194
|
+
readonly threadId?: string;
|
|
195
|
+
}): Promise<import("zod").JSONType>;
|
|
196
|
+
setThreadName(params: Omit<CodexSetThreadNameParams, 'threadId'> & {
|
|
197
|
+
readonly threadId?: string;
|
|
198
|
+
}): Promise<import("zod").JSONType>;
|
|
199
|
+
interruptTurn(params: Omit<CodexInterruptTurnParams, 'threadId'> & {
|
|
200
|
+
readonly threadId?: string;
|
|
201
|
+
}): Promise<void>;
|
|
202
|
+
compactThread(params?: {
|
|
203
|
+
readonly threadId?: string;
|
|
204
|
+
}): Promise<void>;
|
|
205
|
+
};
|
|
206
|
+
//# 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"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAExD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAKL,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAC7B,KAAK,4BAA4B,EACjC,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,+BAA+B,EAErC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAgC,KAAK,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAC3F,OAAO,EAAE,KAAK,kBAAkB,EAAwC,MAAM,cAAc,CAAC;AAE7F,0CAA0C;AAC1C,MAAM,WAAW,qBAAqB;IACpC,oCAAoC;IACpC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,8EAA8E;IAC9E,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;CACjC;AAED,gDAAgD;AAChD,MAAM,WAAW,oBAAoB;IACnC,6CAA6C;IAC7C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CA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,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE;IAKrD,eAAe,UAAU;QAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE;IAKvD,oBAAoB,UACT,IAAI,CAAC,+BAA+B,EAAE,UAAU,CAAC,GAAG;QAC3D,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;KAC5B;IAOH,aAAa,SACH,IAAI,CAAC,wBAAwB,EAAE,UAAU,CAAC,GAAG;QAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE;IAOrF,aAAa,SACH,IAAI,CAAC,wBAAwB,EAAE,UAAU,CAAC,GAAG;QAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE;IAOrF,aAAa,UAAU;QAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE;EAMxD"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { JsonRpcValue } from '../json-rpc-peer.js';
|
|
2
2
|
import { type CodexTransportConfig } from './connect.js';
|
|
3
|
+
import type { CodexControlClient } from './control-client.js';
|
|
4
|
+
import type { CodexNotificationEvent, CodexServerRequestEvent } from './handlers.js';
|
|
3
5
|
import { type CodexApprovalPolicy, type CodexSandboxMode, type CodexThreadContext } from './protocol.js';
|
|
4
|
-
import { type
|
|
6
|
+
import { type CodexDriver, type CodexOpenForkOptions, type CodexThreadPolicyOverrides } from './session-controls.js';
|
|
5
7
|
/** Configuration for {@link createCodexDriver}. */
|
|
6
8
|
export interface CodexDriverConfig {
|
|
7
9
|
/** The CLI to run. Default `codex`, found on the engine's `PATH`. */
|
|
@@ -39,9 +41,10 @@ export interface CodexDriverConfig {
|
|
|
39
41
|
readonly controls: CodexControlClient;
|
|
40
42
|
readonly cwd: string;
|
|
41
43
|
readonly nativeThreadId?: string;
|
|
44
|
+
readonly forkFrom?: CodexOpenForkOptions;
|
|
42
45
|
}) => Promise<CodexThreadPolicyOverrides | undefined> | CodexThreadPolicyOverrides | undefined;
|
|
43
46
|
/**
|
|
44
|
-
* Optional hook invoked immediately after `thread/start` or `thread/
|
|
47
|
+
* Optional hook invoked immediately after `thread/start`, `thread/resume`, or `thread/fork` succeeds.
|
|
45
48
|
* May inspect the applied `threadContext` or call `listMcpServerStatus`/`listSkills`;
|
|
46
49
|
* throwing fails `open()` and stops the connection cleanly.
|
|
47
50
|
*/
|
|
@@ -50,6 +53,33 @@ export interface CodexDriverConfig {
|
|
|
50
53
|
readonly threadContext: CodexThreadContext;
|
|
51
54
|
readonly controls: CodexControlClient;
|
|
52
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`). By default invoked only
|
|
64
|
+
* outside `startTurn()` (for example from an attached TUI client); set `serverRequestDelivery: 'all'`
|
|
65
|
+
* to also deliver requests arriving during a driver-initiated `startTurn()`.
|
|
66
|
+
* When omitted, requests outside `startTurn()` are refused `-32601`.
|
|
67
|
+
*/
|
|
68
|
+
onServerRequest?: (event: CodexServerRequestEvent) => void;
|
|
69
|
+
/**
|
|
70
|
+
* Controls which server requests reach `onServerRequest`: `'external-only'` (default, only
|
|
71
|
+
* requests outside `startTurn()`) or `'all'` (also notifies `onServerRequest` during active
|
|
72
|
+
* `startTurn()` runs with `duringActiveTurn: true`, backed by the same single-shot `turn.pending`
|
|
73
|
+
* slot). Setting `'all'` requires `onServerRequest`.
|
|
74
|
+
*/
|
|
75
|
+
serverRequestDelivery?: 'external-only' | 'all';
|
|
76
|
+
/**
|
|
77
|
+
* Optional callback invoked immediately when an established session or control connection drops
|
|
78
|
+
* unexpectedly before `close()` or caller signal abort (including idle socket disconnects).
|
|
79
|
+
*/
|
|
80
|
+
onDisconnect?: (error: Error) => void;
|
|
81
|
+
/** Maximum incoming JSON-RPC frame/line size in bytes (WebSocket default 16 MiB, stdio default 8 MiB). */
|
|
82
|
+
maxFrameBytes?: number;
|
|
53
83
|
/** Read the bytes behind a `file` part's `reference`; without it a file part is refused. */
|
|
54
84
|
resolveFile?: (reference: string) => Promise<Uint8Array>;
|
|
55
85
|
/** Maximum decoded size of one image attachment in bytes. Default 5 MiB. */
|
|
@@ -60,9 +90,9 @@ export interface CodexDriverConfig {
|
|
|
60
90
|
* Codex through its app-server over stdio or WebSocket-over-Unix-socket: a thread
|
|
61
91
|
* per session, policy and delegation overrides, `turn/start` under the executor's
|
|
62
92
|
* `clientUserMessageId`, per-turn overrides, live session controls (`turn/steer`,
|
|
63
|
-
* `thread/fork`, `thread/compact/start`,
|
|
64
|
-
* multi-bucket `account/rateLimits/read`,
|
|
65
|
-
* `thread/turns/list`.
|
|
93
|
+
* `turn/interrupt`, `thread/resume`, `thread/fork`, `thread/compact/start`,
|
|
94
|
+
* config/MCP/skills/models/account reads), multi-bucket `account/rateLimits/read`,
|
|
95
|
+
* and reconcile by client id in `thread/turns/list`.
|
|
66
96
|
*/
|
|
67
97
|
export declare function createCodexDriver(config?: CodexDriverConfig): CodexDriver;
|
|
68
98
|
//# 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":"AAGA,OAAO,KAAK,EAAe,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAIlE,OAAO,EACL,KAAK,oBAAoB,EAG1B,MAAM,WAAW,CAAC;AACnB,OA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,CAAC,QAAQ,CAAC,EAAE,oBAAoB,CAAC;KAC1C,KACG,OAAO,CAAC,0BAA0B,GAAG,SAAS,CAAC,GAC/C,0BAA0B,GAC1B,SAAS,CAAC;IACd;;;;OAIG;IACH,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE;QACvB,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;QAChC,QAAQ,CAAC,aAAa,EAAE,kBAAkB,CAAC;QAC3C,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAC;KACvC,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAC3B;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,sBAAsB,KAAK,IAAI,CAAC;IACzD;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,IAAI,CAAC;IAC3D;;;;;OAKG;IACH,qBAAqB,CAAC,EAAE,eAAe,GAAG,KAAK,CAAC;IAChD;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACtC,0GAA0G;IAC1G,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,4FAA4F;IAC5F,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IACzD,4EAA4E;IAC5E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;CACxD;AA6ED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,GAAE,iBAAsB,GAAG,WAAW,CAiJ7E"}
|
|
@@ -0,0 +1,52 @@
|
|
|
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 `startTurn()`, or also during `startTurn()` when `serverRequestDelivery` is `'all'`). */
|
|
18
|
+
export interface CodexServerRequestEvent {
|
|
19
|
+
/** JSON-RPC request identifier as a string, also carried on `delta.interactionId`. */
|
|
20
|
+
readonly interactionId: string;
|
|
21
|
+
/** Original JSON-RPC request identifier preserving numeric vs string wire type. */
|
|
22
|
+
readonly requestId: string | number;
|
|
23
|
+
/** Codex server request method (`requestApproval`, `requestUserInput`, or `mcpServer/elicitation/request`). */
|
|
24
|
+
readonly method: CodexServerRequestMethod;
|
|
25
|
+
/** Raw JSON-RPC request params as received from the server. */
|
|
26
|
+
readonly params: JsonRpcValue | undefined;
|
|
27
|
+
/** `true` when a driver-initiated `startTurn()` owned the thread as this request arrived. */
|
|
28
|
+
readonly duringActiveTurn: boolean;
|
|
29
|
+
/** Normalized executor `request` delta preserving approval, permissions, question, or elicitation metadata. */
|
|
30
|
+
readonly delta: Extract<ExecutorDelta, {
|
|
31
|
+
type: 'request';
|
|
32
|
+
}>;
|
|
33
|
+
/** Answer this server request once; throws `TypeError` if already resolved or invalid. */
|
|
34
|
+
respond(reply: InteractionReply['reply']): Promise<void>;
|
|
35
|
+
}
|
|
36
|
+
interface CodexHandlersState {
|
|
37
|
+
profileId: string;
|
|
38
|
+
limits: Map<string, PlanLimits>;
|
|
39
|
+
externalPending: Map<string, PendingExternalCodexRequest>;
|
|
40
|
+
getTurn: () => CodexTurnSlot | undefined;
|
|
41
|
+
clearTurn: () => void;
|
|
42
|
+
onNotification?: (event: CodexNotificationEvent) => void;
|
|
43
|
+
onServerRequest?: (event: CodexServerRequestEvent) => void;
|
|
44
|
+
serverRequestDelivery?: 'external-only' | 'all';
|
|
45
|
+
}
|
|
46
|
+
/** Create JSON-RPC notification and server-request handlers for a Codex session or control link. */
|
|
47
|
+
export declare function createCodexHandlers(state: CodexHandlersState): {
|
|
48
|
+
onNotification: (method: string, params: JsonRpcValue | undefined) => void;
|
|
49
|
+
onRequest: (method: string, params: JsonRpcValue | undefined, id: string | number) => Promise<import("zod").JSONType>;
|
|
50
|
+
};
|
|
51
|
+
export {};
|
|
52
|
+
//# 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,EAGL,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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KAAK,CAAC;CACjD;AAyPD,oGAAoG;AACpG,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,kBAAkB;IAEzD,cAAc,WAAW,MAAM,UAAU,YAAY,GAAG,SAAS;IAEjE,SAAS,WAAW,MAAM,UAAU,YAAY,GAAG,SAAS,MAAM,MAAM,GAAG,MAAM;EAGpF"}
|
|
@@ -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"}
|
|
@@ -97,7 +97,19 @@ export declare const CodexNotificationParams: {
|
|
|
97
97
|
inputTokens: z.ZodInt;
|
|
98
98
|
outputTokens: z.ZodInt;
|
|
99
99
|
cachedInputTokens: z.ZodOptional<z.ZodInt>;
|
|
100
|
+
cacheWriteInputTokens: z.ZodOptional<z.ZodInt>;
|
|
101
|
+
reasoningOutputTokens: z.ZodOptional<z.ZodInt>;
|
|
102
|
+
totalTokens: z.ZodOptional<z.ZodInt>;
|
|
100
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>>;
|
|
101
113
|
}, z.core.$loose>;
|
|
102
114
|
}, z.core.$loose>;
|
|
103
115
|
readonly 'serverRequest/resolved': z.ZodObject<{
|
|
@@ -111,7 +123,28 @@ export declare const CodexNotificationParams: {
|
|
|
111
123
|
export declare const CodexApprovalParamsSchema: z.ZodObject<{
|
|
112
124
|
itemId: z.ZodString;
|
|
113
125
|
command: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
126
|
+
cwd: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
114
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>>>>;
|
|
115
148
|
}, z.core.$loose>;
|
|
116
149
|
export declare const CodexUserInputParamsSchema: z.ZodObject<{
|
|
117
150
|
itemId: z.ZodString;
|
|
@@ -119,12 +152,93 @@ export declare const CodexUserInputParamsSchema: z.ZodObject<{
|
|
|
119
152
|
id: z.ZodString;
|
|
120
153
|
question: z.ZodString;
|
|
121
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>>>>;
|
|
122
161
|
}, z.core.$loose>>;
|
|
123
162
|
}, z.core.$loose>;
|
|
124
163
|
/** Answers to `item/tool/requestUserInput`: question id → the chosen answers. */
|
|
125
164
|
export declare const CodexUserInputAnswersSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
126
165
|
answers: z.ZodArray<z.ZodString>;
|
|
127
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>;
|
|
128
242
|
/** Applied thread policy and runtime context returned by `thread/start`, `thread/resume`, or `thread/fork`. */
|
|
129
243
|
export declare const CodexThreadContextSchema: z.ZodObject<{
|
|
130
244
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -134,9 +248,13 @@ export declare const CodexThreadContextSchema: z.ZodObject<{
|
|
|
134
248
|
sandbox: z.ZodOptional<z.ZodJSONSchema>;
|
|
135
249
|
cwd: z.ZodOptional<z.ZodString>;
|
|
136
250
|
runtimeWorkspaceRoots: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
251
|
+
thread: z.ZodOptional<z.ZodJSONSchema>;
|
|
137
252
|
}, z.core.$strip>;
|
|
138
253
|
/** Applied policy and model context reported by Codex when opening, resuming, or forking a thread. */
|
|
139
254
|
export type CodexThreadContext = Readonly<z.infer<typeof CodexThreadContextSchema>>;
|
|
255
|
+
export declare const CodexInitializeResponseSchema: z.ZodObject<{
|
|
256
|
+
userAgent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
257
|
+
}, z.core.$loose>;
|
|
140
258
|
export declare const CodexStartedThreadSchema: z.ZodObject<{
|
|
141
259
|
model: z.ZodOptional<z.ZodString>;
|
|
142
260
|
modelProvider: z.ZodOptional<z.ZodString>;
|
|
@@ -202,19 +320,29 @@ export declare const CodexTurnsPageSchema: z.ZodObject<{
|
|
|
202
320
|
}, z.core.$loose>>;
|
|
203
321
|
nextCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
204
322
|
}, z.core.$loose>;
|
|
323
|
+
export declare const CodexThreadRevertResponseSchema: z.ZodObject<{
|
|
324
|
+
thread: z.ZodObject<{
|
|
325
|
+
id: z.ZodString;
|
|
326
|
+
}, z.core.$loose>;
|
|
327
|
+
turnsBackwardsCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
328
|
+
itemsBackwardsCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
329
|
+
}, z.core.$loose>;
|
|
205
330
|
/** Notifications the driver asks the server not to send: noise for a turn. */
|
|
206
331
|
export declare const CODEX_OPTED_OUT_NOTIFICATIONS: string[];
|
|
207
332
|
/** Notifications a turn sees and that carry nothing for it. */
|
|
208
333
|
export declare const CODEX_QUIET_NOTIFICATIONS: Set<string>;
|
|
209
334
|
/** Server requests the driver answers; every other is refused `-32601`. */
|
|
210
335
|
export declare const CODEX_APPROVAL_REQUESTS: Set<string>;
|
|
336
|
+
export declare const CODEX_PERMISSIONS_APPROVAL_REQUEST = "item/permissions/requestApproval";
|
|
211
337
|
export declare const CODEX_INPUT_REQUEST = "item/tool/requestUserInput";
|
|
338
|
+
export declare const CODEX_ELICITATION_REQUEST = "mcpServer/elicitation/request";
|
|
212
339
|
/**
|
|
213
340
|
* The decisions the driver answers an approval with, the same for a command and a file
|
|
214
341
|
* change: `deny` lets the agent continue the turn, `interrupted` interrupts it at once.
|
|
215
342
|
*/
|
|
216
343
|
export declare const CODEX_APPROVAL_DECISION: {
|
|
217
344
|
readonly approve: 'accept';
|
|
345
|
+
readonly approveForSession: 'acceptForSession';
|
|
218
346
|
readonly deny: 'decline';
|
|
219
347
|
readonly interrupted: 'cancel';
|
|
220
348
|
};
|
|
@@ -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;AACxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,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;AAGrD;;;;;;GAMG;AAEH,iHAAiH;AACjH,MAAM,MAAM,mBAAmB,GAC3B,WAAW,GACX,YAAY,GACZ,YAAY,GACZ,OAAO,GACP,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC;AAE3C,gGAAgG;AAChG,MAAM,MAAM,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