@jrkropp/codex-js 0.1.2 → 0.1.4
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 +8 -0
- package/README.md +2 -2
- package/dist/ClientNotification-B6-FhXQf.d.ts +5 -0
- package/dist/DynamicToolCallResponse-82DFjES2.d.ts +8 -0
- package/dist/DynamicToolSpec-CfnhqAYK.d.ts +29 -0
- package/dist/PermissionsRequestApprovalResponse-DxzPPDRb.d.ts +55 -0
- package/dist/ProviderStatusBanner-BlP6lzwE.d.ts +441 -0
- package/dist/ServerRequest-B5cKVJjr.d.ts +2181 -0
- package/dist/{session-DPhHN7RZ.d.ts → ThreadResumeResponse-DvmE1juU.d.ts} +3 -306
- package/dist/ToolRequestUserInputQuestion-CeZa5X1J.d.ts +23 -0
- package/dist/ToolRequestUserInputResponse-zcPLwbiK.d.ts +17 -0
- package/dist/TurnSteerResponse-0kBCfplh.d.ts +209 -0
- package/dist/WebSearchToolConfig-D3ep0625.d.ts +18 -0
- package/dist/chat-runtime-9RkXHC_w.d.ts +382 -0
- package/dist/chunk-2DZRMCI2.js +1258 -0
- package/dist/chunk-2DZRMCI2.js.map +1 -0
- package/dist/chunk-4DPLJPB5.js +396 -0
- package/dist/chunk-4DPLJPB5.js.map +1 -0
- package/dist/chunk-5JMJ6OI5.js +3 -0
- package/dist/chunk-5JMJ6OI5.js.map +1 -0
- package/dist/chunk-6ZMJ34KE.js +1153 -0
- package/dist/chunk-6ZMJ34KE.js.map +1 -0
- package/dist/chunk-CGBS37IU.js +128 -0
- package/dist/chunk-CGBS37IU.js.map +1 -0
- package/dist/chunk-DCMKA2A6.js +18 -0
- package/dist/chunk-DCMKA2A6.js.map +1 -0
- package/dist/chunk-DYLHN3HG.js +937 -0
- package/dist/chunk-DYLHN3HG.js.map +1 -0
- package/dist/{chunk-SVK6PLGO.js → chunk-LWQNX4LI.js} +12009 -18768
- package/dist/chunk-LWQNX4LI.js.map +1 -0
- package/dist/{chunk-JLDH4U5L.js → chunk-NCI4MAWZ.js} +317 -1967
- package/dist/chunk-NCI4MAWZ.js.map +1 -0
- package/dist/chunk-O44XP7LH.js +214 -0
- package/dist/chunk-O44XP7LH.js.map +1 -0
- package/dist/chunk-PST3ZWX2.js +555 -0
- package/dist/chunk-PST3ZWX2.js.map +1 -0
- package/dist/chunk-SYPHCDRD.js +1133 -0
- package/dist/chunk-SYPHCDRD.js.map +1 -0
- package/dist/chunk-V4BMZWBM.js +2401 -0
- package/dist/chunk-V4BMZWBM.js.map +1 -0
- package/dist/chunk-W7S6HFCQ.js +1983 -0
- package/dist/chunk-W7S6HFCQ.js.map +1 -0
- package/dist/chunk-YHVCFD2D.js +117 -0
- package/dist/chunk-YHVCFD2D.js.map +1 -0
- package/dist/chunk-Z63UPBS3.js +152 -0
- package/dist/chunk-Z63UPBS3.js.map +1 -0
- package/dist/client/index.d.ts +16 -4
- package/dist/client/index.js +13 -1
- package/dist/codex-rs/app-server/index.d.ts +161 -0
- package/dist/codex-rs/app-server/index.js +13 -0
- package/dist/codex-rs/app-server/index.js.map +1 -0
- package/dist/codex-rs/app-server-protocol/index.d.ts +1722 -0
- package/dist/codex-rs/app-server-protocol/index.js +6 -0
- package/dist/codex-rs/app-server-protocol/index.js.map +1 -0
- package/dist/codex-rs/app-server-protocol/protocol.d.ts +19 -0
- package/dist/codex-rs/app-server-protocol/protocol.js +4 -0
- package/dist/codex-rs/app-server-protocol/protocol.js.map +1 -0
- package/dist/codex-rs/codex-api/index.d.ts +104 -0
- package/dist/codex-rs/codex-api/index.js +11 -0
- package/dist/codex-rs/codex-api/index.js.map +1 -0
- package/dist/codex-rs/config/index.d.ts +88 -0
- package/dist/codex-rs/config/index.js +4 -0
- package/dist/codex-rs/config/index.js.map +1 -0
- package/dist/codex-rs/core/config/index.d.ts +61 -0
- package/dist/codex-rs/core/config/index.js +5 -0
- package/dist/codex-rs/core/config/index.js.map +1 -0
- package/dist/codex-rs/core/index.d.ts +1393 -0
- package/dist/codex-rs/core/index.js +11 -0
- package/dist/codex-rs/core/index.js.map +1 -0
- package/dist/codex-rs/model-provider/index.d.ts +2 -0
- package/dist/codex-rs/model-provider/index.js +4 -0
- package/dist/codex-rs/model-provider/index.js.map +1 -0
- package/dist/codex-rs/models-manager/index.d.ts +2 -0
- package/dist/codex-rs/models-manager/index.js +4 -0
- package/dist/codex-rs/models-manager/index.js.map +1 -0
- package/dist/codex-rs/parity.d.ts +26 -0
- package/dist/codex-rs/parity.js +3 -0
- package/dist/codex-rs/parity.js.map +1 -0
- package/dist/codex-rs/thread-store/index.d.ts +5 -0
- package/dist/codex-rs/thread-store/index.js +4 -0
- package/dist/codex-rs/thread-store/index.js.map +1 -0
- package/dist/codex-rs/unsupported.d.ts +15 -0
- package/dist/codex-rs/unsupported.js +22 -0
- package/dist/codex-rs/unsupported.js.map +1 -0
- package/dist/codex-rs/utils/output-truncation.d.ts +21 -0
- package/dist/codex-rs/utils/output-truncation.js +4 -0
- package/dist/codex-rs/utils/output-truncation.js.map +1 -0
- package/dist/codex-rs/utils/string.d.ts +7 -0
- package/dist/codex-rs/utils/string.js +3 -0
- package/dist/codex-rs/utils/string.js.map +1 -0
- package/dist/common-CTyph5x8.d.ts +40 -0
- package/dist/event-mapping-CbISdQ1D.d.ts +43 -0
- package/dist/history-CfM-4V7b.d.ts +1654 -0
- package/dist/index-77U_Oc-a.d.ts +63 -0
- package/dist/index-CoDZosq0.d.ts +261 -0
- package/dist/index.d.ts +18 -7
- package/dist/index.js +16 -2
- package/dist/lib-nXlaKiS-.d.ts +48 -0
- package/dist/live-thread-BMvlflzM.d.ts +30 -0
- package/dist/merge-B_AWVmnI.d.ts +24 -0
- package/dist/mod-DYVLSWO4.d.ts +91 -0
- package/dist/plan-mode-Cv6KWb_S.d.ts +14 -0
- package/dist/proposed-plan-DpN1ma0Y.d.ts +53 -0
- package/dist/protocol-mpBcYHrm.d.ts +1655 -0
- package/dist/react/index.d.ts +56 -48
- package/dist/react/index.js +16 -2
- package/dist/{remote-_6TDvg-g.d.ts → remote-ClZbq9KN.d.ts} +3 -1
- package/dist/rendered-thread-AOxw3V5b.d.ts +29 -0
- package/dist/responses_websocket-BhxSgCzK.d.ts +183 -0
- package/dist/runtime-Cm6ml53h.d.ts +528 -0
- package/dist/server/index.d.ts +29 -2416
- package/dist/server/index.js +13 -1
- package/dist/session-BRYzi8OT.d.ts +46 -0
- package/dist/shadcn/index.d.ts +1 -1
- package/dist/{sidebar-DT2XoitN.d.ts → sidebar-DMMij22z.d.ts} +1 -1
- package/dist/spec_plan_types-CmsJ-Tfn.d.ts +260 -0
- package/dist/{store-GYldc9EJ.d.ts → store-AGRxhgQ3.d.ts} +2 -1
- package/dist/t3code/apps/web/components/chat.d.ts +508 -0
- package/dist/t3code/apps/web/components/chat.js +12 -0
- package/dist/t3code/apps/web/components/chat.js.map +1 -0
- package/dist/t3code/apps/web/index.d.ts +12 -0
- package/dist/t3code/apps/web/index.js +13 -0
- package/dist/t3code/apps/web/index.js.map +1 -0
- package/dist/testing/index.d.ts +9 -91
- package/dist/testing/index.js +13 -1
- package/dist/thread-history-builder-zW0zeqcS.d.ts +58 -0
- package/dist/thread_event_store-C0zYzukG.d.ts +77 -0
- package/dist/types-BTeabLYr.d.ts +126 -0
- package/package.json +152 -88
- package/dist/chat-runtime-D7wu_KbX.d.ts +0 -747
- package/dist/chunk-JLDH4U5L.js.map +0 -1
- package/dist/chunk-SVK6PLGO.js.map +0 -1
- package/dist/index-CB9la6xE.d.ts +0 -112
- package/dist/thread_event_store-B9CoQUIA.d.ts +0 -3868
|
@@ -0,0 +1,2181 @@
|
|
|
1
|
+
import { R as RequestId, T as ToolRequestUserInputQuestion } from './ToolRequestUserInputQuestion-CeZa5X1J.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A path that is guaranteed to be absolute and normalized (though it is not
|
|
5
|
+
* guaranteed to be canonicalized or exist on the filesystem).
|
|
6
|
+
*
|
|
7
|
+
* IMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set
|
|
8
|
+
* using [AbsolutePathBufGuard::new]. If no base path is set, the
|
|
9
|
+
* deserialization will fail unless the path being deserialized is already
|
|
10
|
+
* absolute.
|
|
11
|
+
*/
|
|
12
|
+
type AbsolutePathBuf = string;
|
|
13
|
+
|
|
14
|
+
type AgentPath = string;
|
|
15
|
+
|
|
16
|
+
type FileChange = {
|
|
17
|
+
"type": "add";
|
|
18
|
+
content: string;
|
|
19
|
+
} | {
|
|
20
|
+
"type": "delete";
|
|
21
|
+
content: string;
|
|
22
|
+
} | {
|
|
23
|
+
"type": "update";
|
|
24
|
+
unified_diff: string;
|
|
25
|
+
move_path: string | null;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
type ThreadId = string;
|
|
29
|
+
|
|
30
|
+
type ApplyPatchApprovalParams = {
|
|
31
|
+
conversationId: ThreadId;
|
|
32
|
+
/**
|
|
33
|
+
* Use to correlate this with [codex_protocol::protocol::PatchApplyBeginEvent]
|
|
34
|
+
* and [codex_protocol::protocol::PatchApplyEndEvent].
|
|
35
|
+
*/
|
|
36
|
+
callId: string;
|
|
37
|
+
fileChanges: {
|
|
38
|
+
[key in string]?: FileChange;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Optional explanatory reason (e.g. request for extra write access).
|
|
42
|
+
*/
|
|
43
|
+
reason: string | null;
|
|
44
|
+
/**
|
|
45
|
+
* When set, the agent is asking the user to allow writes under this root
|
|
46
|
+
* for the remainder of the session (unclear if this is honored today).
|
|
47
|
+
*/
|
|
48
|
+
grantRoot: string | null;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Authentication mode for OpenAI-backed providers.
|
|
53
|
+
*/
|
|
54
|
+
type AuthMode = "apikey" | "chatgpt" | "chatgptAuthTokens" | "agentIdentity";
|
|
55
|
+
|
|
56
|
+
type JsonValue = number | string | boolean | Array<JsonValue> | {
|
|
57
|
+
[key in string]?: JsonValue;
|
|
58
|
+
} | null;
|
|
59
|
+
|
|
60
|
+
type ThreadSource = "user" | "subagent" | "memory_consolidation";
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning
|
|
64
|
+
*/
|
|
65
|
+
type ReasoningEffort = "none" | "minimal" | "low" | "medium" | "high" | "xhigh";
|
|
66
|
+
|
|
67
|
+
type ByteRange = {
|
|
68
|
+
start: number;
|
|
69
|
+
end: number;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
type TextElement = {
|
|
73
|
+
/**
|
|
74
|
+
* Byte range in the parent `text` buffer that this element occupies.
|
|
75
|
+
*/
|
|
76
|
+
byteRange: ByteRange;
|
|
77
|
+
/**
|
|
78
|
+
* Optional human-readable placeholder for the element, displayed in the UI.
|
|
79
|
+
*/
|
|
80
|
+
placeholder: string | null;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
type UserInput = {
|
|
84
|
+
"type": "text";
|
|
85
|
+
text: string;
|
|
86
|
+
/**
|
|
87
|
+
* UI-defined spans within `text` used to render or persist special elements.
|
|
88
|
+
*/
|
|
89
|
+
text_elements: Array<TextElement>;
|
|
90
|
+
} | {
|
|
91
|
+
"type": "image";
|
|
92
|
+
url: string;
|
|
93
|
+
} | {
|
|
94
|
+
"type": "localImage";
|
|
95
|
+
path: string;
|
|
96
|
+
} | {
|
|
97
|
+
"type": "skill";
|
|
98
|
+
name: string;
|
|
99
|
+
path: string;
|
|
100
|
+
} | {
|
|
101
|
+
"type": "mention";
|
|
102
|
+
name: string;
|
|
103
|
+
path: string;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
type WindowsSandboxSetupMode = "elevated" | "unelevated";
|
|
107
|
+
|
|
108
|
+
type ImageDetail = "auto" | "low" | "high" | "original";
|
|
109
|
+
|
|
110
|
+
type ContentItem = {
|
|
111
|
+
"type": "input_text";
|
|
112
|
+
text: string;
|
|
113
|
+
} | {
|
|
114
|
+
"type": "input_image";
|
|
115
|
+
image_url: string;
|
|
116
|
+
detail?: ImageDetail;
|
|
117
|
+
} | {
|
|
118
|
+
"type": "output_text";
|
|
119
|
+
text: string;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
type SubAgentSource = "review" | "compact" | {
|
|
123
|
+
"thread_spawn": {
|
|
124
|
+
parent_thread_id: ThreadId;
|
|
125
|
+
depth: number;
|
|
126
|
+
agent_path: AgentPath | null;
|
|
127
|
+
agent_nickname: string | null;
|
|
128
|
+
agent_role: string | null;
|
|
129
|
+
};
|
|
130
|
+
} | "memory_consolidation" | {
|
|
131
|
+
"other": string;
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
type ParsedCommand = {
|
|
135
|
+
"type": "read";
|
|
136
|
+
cmd: string;
|
|
137
|
+
name: string;
|
|
138
|
+
/**
|
|
139
|
+
* (Best effort) Path to the file being read by the command. When
|
|
140
|
+
* possible, this is an absolute path, though when relative, it should
|
|
141
|
+
* be resolved against the `cwd`` that will be used to run the command
|
|
142
|
+
* to derive the absolute path.
|
|
143
|
+
*/
|
|
144
|
+
path: string;
|
|
145
|
+
} | {
|
|
146
|
+
"type": "list_files";
|
|
147
|
+
cmd: string;
|
|
148
|
+
path: string | null;
|
|
149
|
+
} | {
|
|
150
|
+
"type": "search";
|
|
151
|
+
cmd: string;
|
|
152
|
+
query: string | null;
|
|
153
|
+
path: string | null;
|
|
154
|
+
} | {
|
|
155
|
+
"type": "unknown";
|
|
156
|
+
cmd: string;
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
type ExecCommandApprovalParams = {
|
|
160
|
+
conversationId: ThreadId;
|
|
161
|
+
/**
|
|
162
|
+
* Use to correlate this with [codex_protocol::protocol::ExecCommandBeginEvent]
|
|
163
|
+
* and [codex_protocol::protocol::ExecCommandEndEvent].
|
|
164
|
+
*/
|
|
165
|
+
callId: string;
|
|
166
|
+
/**
|
|
167
|
+
* Identifier for this specific approval callback.
|
|
168
|
+
*/
|
|
169
|
+
approvalId: string | null;
|
|
170
|
+
command: Array<string>;
|
|
171
|
+
cwd: string;
|
|
172
|
+
reason: string | null;
|
|
173
|
+
parsedCmd: Array<ParsedCommand>;
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Responses API compatible content items that can be returned by a tool call.
|
|
178
|
+
* This is a subset of ContentItem with the types we support as function call outputs.
|
|
179
|
+
*/
|
|
180
|
+
type FunctionCallOutputContentItem = {
|
|
181
|
+
"type": "input_text";
|
|
182
|
+
text: string;
|
|
183
|
+
} | {
|
|
184
|
+
"type": "input_image";
|
|
185
|
+
image_url: string;
|
|
186
|
+
detail?: ImageDetail;
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
type FunctionCallOutputBody = string | Array<FunctionCallOutputContentItem>;
|
|
190
|
+
|
|
191
|
+
type FuzzyFileSearchMatchType = "file" | "directory";
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Superset of [`codex_file_search::FileMatch`]
|
|
195
|
+
*/
|
|
196
|
+
type FuzzyFileSearchResult = {
|
|
197
|
+
root: string;
|
|
198
|
+
path: string;
|
|
199
|
+
match_type: FuzzyFileSearchMatchType;
|
|
200
|
+
file_name: string;
|
|
201
|
+
score: number;
|
|
202
|
+
indices: Array<number> | null;
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
type FuzzyFileSearchSessionCompletedNotification = {
|
|
206
|
+
sessionId: string;
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
type FuzzyFileSearchSessionUpdatedNotification = {
|
|
210
|
+
sessionId: string;
|
|
211
|
+
query: string;
|
|
212
|
+
files: Array<FuzzyFileSearchResult>;
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
type LocalShellExecAction = {
|
|
216
|
+
command: Array<string>;
|
|
217
|
+
timeout_ms: bigint | null;
|
|
218
|
+
working_directory: string | null;
|
|
219
|
+
env: {
|
|
220
|
+
[key in string]?: string;
|
|
221
|
+
} | null;
|
|
222
|
+
user: string | null;
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
type LocalShellAction = {
|
|
226
|
+
"type": "exec";
|
|
227
|
+
} & LocalShellExecAction;
|
|
228
|
+
|
|
229
|
+
type LocalShellStatus = "completed" | "in_progress" | "incomplete";
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Classifies an assistant message as interim commentary or final answer text.
|
|
233
|
+
*
|
|
234
|
+
* Providers do not emit this consistently, so callers must treat `None` as
|
|
235
|
+
* "phase unknown" and keep compatibility behavior for legacy models.
|
|
236
|
+
*/
|
|
237
|
+
type MessagePhase = "commentary" | "final_answer";
|
|
238
|
+
|
|
239
|
+
type PlanType = "free" | "go" | "plus" | "pro" | "prolite" | "team" | "self_serve_business_usage_based" | "business" | "enterprise_cbp_usage_based" | "enterprise" | "edu" | "unknown";
|
|
240
|
+
|
|
241
|
+
type RealtimeConversationVersion = "v1" | "v2";
|
|
242
|
+
|
|
243
|
+
type ReasoningItemContent = {
|
|
244
|
+
"type": "reasoning_text";
|
|
245
|
+
text: string;
|
|
246
|
+
} | {
|
|
247
|
+
"type": "text";
|
|
248
|
+
text: string;
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
type ReasoningItemReasoningSummary = {
|
|
252
|
+
"type": "summary_text";
|
|
253
|
+
text: string;
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
type WebSearchAction$1 = {
|
|
257
|
+
"type": "search";
|
|
258
|
+
query?: string;
|
|
259
|
+
queries?: Array<string>;
|
|
260
|
+
} | {
|
|
261
|
+
"type": "open_page";
|
|
262
|
+
url?: string;
|
|
263
|
+
} | {
|
|
264
|
+
"type": "find_in_page";
|
|
265
|
+
url?: string;
|
|
266
|
+
pattern?: string;
|
|
267
|
+
} | {
|
|
268
|
+
"type": "other";
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
type ResponseItem = {
|
|
272
|
+
"type": "message";
|
|
273
|
+
role: string;
|
|
274
|
+
content: Array<ContentItem>;
|
|
275
|
+
phase?: MessagePhase;
|
|
276
|
+
} | {
|
|
277
|
+
"type": "reasoning";
|
|
278
|
+
summary: Array<ReasoningItemReasoningSummary>;
|
|
279
|
+
content?: Array<ReasoningItemContent>;
|
|
280
|
+
encrypted_content: string | null;
|
|
281
|
+
} | {
|
|
282
|
+
"type": "local_shell_call";
|
|
283
|
+
/**
|
|
284
|
+
* Set when using the Responses API.
|
|
285
|
+
*/
|
|
286
|
+
call_id: string | null;
|
|
287
|
+
status: LocalShellStatus;
|
|
288
|
+
action: LocalShellAction;
|
|
289
|
+
} | {
|
|
290
|
+
"type": "function_call";
|
|
291
|
+
name: string;
|
|
292
|
+
namespace?: string;
|
|
293
|
+
arguments: string;
|
|
294
|
+
call_id: string;
|
|
295
|
+
} | {
|
|
296
|
+
"type": "tool_search_call";
|
|
297
|
+
call_id: string | null;
|
|
298
|
+
status?: string;
|
|
299
|
+
execution: string;
|
|
300
|
+
arguments: unknown;
|
|
301
|
+
} | {
|
|
302
|
+
"type": "function_call_output";
|
|
303
|
+
call_id: string;
|
|
304
|
+
output: FunctionCallOutputBody;
|
|
305
|
+
} | {
|
|
306
|
+
"type": "custom_tool_call";
|
|
307
|
+
status?: string;
|
|
308
|
+
call_id: string;
|
|
309
|
+
name: string;
|
|
310
|
+
input: string;
|
|
311
|
+
} | {
|
|
312
|
+
"type": "custom_tool_call_output";
|
|
313
|
+
call_id: string;
|
|
314
|
+
name?: string;
|
|
315
|
+
output: FunctionCallOutputBody;
|
|
316
|
+
} | {
|
|
317
|
+
"type": "tool_search_output";
|
|
318
|
+
call_id: string | null;
|
|
319
|
+
status: string;
|
|
320
|
+
execution: string;
|
|
321
|
+
tools: unknown[];
|
|
322
|
+
} | {
|
|
323
|
+
"type": "web_search_call";
|
|
324
|
+
status?: string;
|
|
325
|
+
action?: WebSearchAction$1;
|
|
326
|
+
} | {
|
|
327
|
+
"type": "image_generation_call";
|
|
328
|
+
id: string;
|
|
329
|
+
status: string;
|
|
330
|
+
revised_prompt?: string;
|
|
331
|
+
result: string;
|
|
332
|
+
} | {
|
|
333
|
+
"type": "compaction";
|
|
334
|
+
encrypted_content: string;
|
|
335
|
+
} | {
|
|
336
|
+
"type": "context_compaction";
|
|
337
|
+
encrypted_content?: string;
|
|
338
|
+
} | {
|
|
339
|
+
"type": "other";
|
|
340
|
+
};
|
|
341
|
+
|
|
342
|
+
type AccountLoginCompletedNotification = {
|
|
343
|
+
loginId: string | null;
|
|
344
|
+
success: boolean;
|
|
345
|
+
error: string | null;
|
|
346
|
+
};
|
|
347
|
+
|
|
348
|
+
type CreditsSnapshot = {
|
|
349
|
+
hasCredits: boolean;
|
|
350
|
+
unlimited: boolean;
|
|
351
|
+
balance: string | null;
|
|
352
|
+
};
|
|
353
|
+
|
|
354
|
+
type RateLimitReachedType = "rate_limit_reached" | "workspace_owner_credits_depleted" | "workspace_member_credits_depleted" | "workspace_owner_usage_limit_reached" | "workspace_member_usage_limit_reached";
|
|
355
|
+
|
|
356
|
+
type RateLimitWindow = {
|
|
357
|
+
usedPercent: number;
|
|
358
|
+
windowDurationMins: number | null;
|
|
359
|
+
resetsAt: number | null;
|
|
360
|
+
};
|
|
361
|
+
|
|
362
|
+
type RateLimitSnapshot = {
|
|
363
|
+
limitId: string | null;
|
|
364
|
+
limitName: string | null;
|
|
365
|
+
primary: RateLimitWindow | null;
|
|
366
|
+
secondary: RateLimitWindow | null;
|
|
367
|
+
credits: CreditsSnapshot | null;
|
|
368
|
+
planType: PlanType | null;
|
|
369
|
+
rateLimitReachedType: RateLimitReachedType | null;
|
|
370
|
+
};
|
|
371
|
+
|
|
372
|
+
type AccountRateLimitsUpdatedNotification = {
|
|
373
|
+
rateLimits: RateLimitSnapshot;
|
|
374
|
+
};
|
|
375
|
+
|
|
376
|
+
type AccountUpdatedNotification = {
|
|
377
|
+
authMode: AuthMode | null;
|
|
378
|
+
planType: PlanType | null;
|
|
379
|
+
};
|
|
380
|
+
|
|
381
|
+
type AgentMessageDeltaNotification = {
|
|
382
|
+
threadId: string;
|
|
383
|
+
turnId: string;
|
|
384
|
+
itemId: string;
|
|
385
|
+
delta: string;
|
|
386
|
+
};
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* EXPERIMENTAL - app metadata returned by app-list APIs.
|
|
390
|
+
*/
|
|
391
|
+
type AppBranding = {
|
|
392
|
+
category: string | null;
|
|
393
|
+
developer: string | null;
|
|
394
|
+
website: string | null;
|
|
395
|
+
privacyPolicy: string | null;
|
|
396
|
+
termsOfService: string | null;
|
|
397
|
+
isDiscoverableApp: boolean;
|
|
398
|
+
};
|
|
399
|
+
|
|
400
|
+
type AppReview = {
|
|
401
|
+
status: string;
|
|
402
|
+
};
|
|
403
|
+
|
|
404
|
+
type AppScreenshot = {
|
|
405
|
+
url: string | null;
|
|
406
|
+
fileId: string | null;
|
|
407
|
+
userPrompt: string;
|
|
408
|
+
};
|
|
409
|
+
|
|
410
|
+
type AppMetadata = {
|
|
411
|
+
review: AppReview | null;
|
|
412
|
+
categories: Array<string> | null;
|
|
413
|
+
subCategories: Array<string> | null;
|
|
414
|
+
seoDescription: string | null;
|
|
415
|
+
screenshots: Array<AppScreenshot> | null;
|
|
416
|
+
developer: string | null;
|
|
417
|
+
version: string | null;
|
|
418
|
+
versionId: string | null;
|
|
419
|
+
versionNotes: string | null;
|
|
420
|
+
firstPartyType: string | null;
|
|
421
|
+
firstPartyRequiresInstall: boolean | null;
|
|
422
|
+
showInComposerWhenUnlinked: boolean | null;
|
|
423
|
+
};
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* EXPERIMENTAL - app metadata returned by app-list APIs.
|
|
427
|
+
*/
|
|
428
|
+
type AppInfo = {
|
|
429
|
+
id: string;
|
|
430
|
+
name: string;
|
|
431
|
+
description: string | null;
|
|
432
|
+
logoUrl: string | null;
|
|
433
|
+
logoUrlDark: string | null;
|
|
434
|
+
distributionChannel: string | null;
|
|
435
|
+
branding: AppBranding | null;
|
|
436
|
+
appMetadata: AppMetadata | null;
|
|
437
|
+
labels: {
|
|
438
|
+
[key in string]?: string;
|
|
439
|
+
} | null;
|
|
440
|
+
installUrl: string | null;
|
|
441
|
+
isAccessible: boolean;
|
|
442
|
+
/**
|
|
443
|
+
* Whether this app is enabled in config.toml.
|
|
444
|
+
* Example:
|
|
445
|
+
* ```toml
|
|
446
|
+
* [apps.bad_app]
|
|
447
|
+
* enabled = false
|
|
448
|
+
* ```
|
|
449
|
+
*/
|
|
450
|
+
isEnabled: boolean;
|
|
451
|
+
pluginDisplayNames: Array<string>;
|
|
452
|
+
};
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* EXPERIMENTAL - notification emitted when the app list changes.
|
|
456
|
+
*/
|
|
457
|
+
type AppListUpdatedNotification = {
|
|
458
|
+
data: Array<AppInfo>;
|
|
459
|
+
};
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* Stream label for `command/exec/outputDelta` notifications.
|
|
463
|
+
*/
|
|
464
|
+
type CommandExecOutputStream = "stdout" | "stderr";
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* Base64-encoded output chunk emitted for a streaming `command/exec` request.
|
|
468
|
+
*
|
|
469
|
+
* These notifications are connection-scoped. If the originating connection
|
|
470
|
+
* closes, the server terminates the process.
|
|
471
|
+
*/
|
|
472
|
+
type CommandExecOutputDeltaNotification = {
|
|
473
|
+
/**
|
|
474
|
+
* Client-supplied, connection-scoped `processId` from the original
|
|
475
|
+
* `command/exec` request.
|
|
476
|
+
*/
|
|
477
|
+
processId: string;
|
|
478
|
+
/**
|
|
479
|
+
* Output stream for this chunk.
|
|
480
|
+
*/
|
|
481
|
+
stream: CommandExecOutputStream;
|
|
482
|
+
/**
|
|
483
|
+
* Base64-encoded output bytes.
|
|
484
|
+
*/
|
|
485
|
+
deltaBase64: string;
|
|
486
|
+
/**
|
|
487
|
+
* `true` on the final streamed chunk for a stream when `outputBytesCap`
|
|
488
|
+
* truncated later output on that stream.
|
|
489
|
+
*/
|
|
490
|
+
capReached: boolean;
|
|
491
|
+
};
|
|
492
|
+
|
|
493
|
+
type CommandExecutionOutputDeltaNotification = {
|
|
494
|
+
threadId: string;
|
|
495
|
+
turnId: string;
|
|
496
|
+
itemId: string;
|
|
497
|
+
delta: string;
|
|
498
|
+
};
|
|
499
|
+
|
|
500
|
+
type TextPosition = {
|
|
501
|
+
/**
|
|
502
|
+
* 1-based line number.
|
|
503
|
+
*/
|
|
504
|
+
line: number;
|
|
505
|
+
/**
|
|
506
|
+
* 1-based column number (in Unicode scalar values).
|
|
507
|
+
*/
|
|
508
|
+
column: number;
|
|
509
|
+
};
|
|
510
|
+
|
|
511
|
+
type TextRange = {
|
|
512
|
+
start: TextPosition;
|
|
513
|
+
end: TextPosition;
|
|
514
|
+
};
|
|
515
|
+
|
|
516
|
+
type ConfigWarningNotification = {
|
|
517
|
+
/**
|
|
518
|
+
* Concise summary of the warning.
|
|
519
|
+
*/
|
|
520
|
+
summary: string;
|
|
521
|
+
/**
|
|
522
|
+
* Optional extra guidance or error details.
|
|
523
|
+
*/
|
|
524
|
+
details: string | null;
|
|
525
|
+
/**
|
|
526
|
+
* Optional path to the config file that triggered the warning.
|
|
527
|
+
*/
|
|
528
|
+
path?: string;
|
|
529
|
+
/**
|
|
530
|
+
* Optional range for the error location inside the config file.
|
|
531
|
+
*/
|
|
532
|
+
range?: TextRange;
|
|
533
|
+
};
|
|
534
|
+
|
|
535
|
+
/**
|
|
536
|
+
* Deprecated: Use `ContextCompaction` item type instead.
|
|
537
|
+
*/
|
|
538
|
+
type ContextCompactedNotification = {
|
|
539
|
+
threadId: string;
|
|
540
|
+
turnId: string;
|
|
541
|
+
};
|
|
542
|
+
|
|
543
|
+
type DeprecationNoticeNotification = {
|
|
544
|
+
/**
|
|
545
|
+
* Concise summary of what is deprecated.
|
|
546
|
+
*/
|
|
547
|
+
summary: string;
|
|
548
|
+
/**
|
|
549
|
+
* Optional extra guidance, such as migration steps or rationale.
|
|
550
|
+
*/
|
|
551
|
+
details: string | null;
|
|
552
|
+
};
|
|
553
|
+
|
|
554
|
+
type NonSteerableTurnKind = "review" | "compact";
|
|
555
|
+
|
|
556
|
+
/**
|
|
557
|
+
* This translation layer make sure that we expose codex error code in camel case.
|
|
558
|
+
*
|
|
559
|
+
* When an upstream HTTP status is available (for example, from the Responses API or a provider),
|
|
560
|
+
* it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.
|
|
561
|
+
*/
|
|
562
|
+
type CodexErrorInfo = "contextWindowExceeded" | "usageLimitExceeded" | "serverOverloaded" | "cyberPolicy" | {
|
|
563
|
+
"httpConnectionFailed": {
|
|
564
|
+
httpStatusCode: number | null;
|
|
565
|
+
};
|
|
566
|
+
} | {
|
|
567
|
+
"responseStreamConnectionFailed": {
|
|
568
|
+
httpStatusCode: number | null;
|
|
569
|
+
};
|
|
570
|
+
} | "internalServerError" | "unauthorized" | "badRequest" | "threadRollbackFailed" | "sandboxError" | {
|
|
571
|
+
"responseStreamDisconnected": {
|
|
572
|
+
httpStatusCode: number | null;
|
|
573
|
+
};
|
|
574
|
+
} | {
|
|
575
|
+
"responseTooManyFailedAttempts": {
|
|
576
|
+
httpStatusCode: number | null;
|
|
577
|
+
};
|
|
578
|
+
} | {
|
|
579
|
+
"activeTurnNotSteerable": {
|
|
580
|
+
turnKind: NonSteerableTurnKind;
|
|
581
|
+
};
|
|
582
|
+
} | "other";
|
|
583
|
+
|
|
584
|
+
type TurnError = {
|
|
585
|
+
message: string;
|
|
586
|
+
codexErrorInfo: CodexErrorInfo | null;
|
|
587
|
+
additionalDetails: string | null;
|
|
588
|
+
};
|
|
589
|
+
|
|
590
|
+
type ErrorNotification = {
|
|
591
|
+
error: TurnError;
|
|
592
|
+
willRetry: boolean;
|
|
593
|
+
threadId: string;
|
|
594
|
+
turnId: string;
|
|
595
|
+
};
|
|
596
|
+
|
|
597
|
+
type ExternalAgentConfigImportCompletedNotification = Record<string, never>;
|
|
598
|
+
|
|
599
|
+
/**
|
|
600
|
+
* Deprecated legacy notification for `apply_patch` textual output.
|
|
601
|
+
*
|
|
602
|
+
* The server no longer emits this notification.
|
|
603
|
+
*/
|
|
604
|
+
type FileChangeOutputDeltaNotification = {
|
|
605
|
+
threadId: string;
|
|
606
|
+
turnId: string;
|
|
607
|
+
itemId: string;
|
|
608
|
+
delta: string;
|
|
609
|
+
};
|
|
610
|
+
|
|
611
|
+
type PatchChangeKind = {
|
|
612
|
+
"type": "add";
|
|
613
|
+
} | {
|
|
614
|
+
"type": "delete";
|
|
615
|
+
} | {
|
|
616
|
+
"type": "update";
|
|
617
|
+
move_path: string | null;
|
|
618
|
+
};
|
|
619
|
+
|
|
620
|
+
type FileUpdateChange = {
|
|
621
|
+
path: string;
|
|
622
|
+
kind: PatchChangeKind;
|
|
623
|
+
diff: string;
|
|
624
|
+
};
|
|
625
|
+
|
|
626
|
+
type FileChangePatchUpdatedNotification = {
|
|
627
|
+
threadId: string;
|
|
628
|
+
turnId: string;
|
|
629
|
+
itemId: string;
|
|
630
|
+
changes: Array<FileUpdateChange>;
|
|
631
|
+
};
|
|
632
|
+
|
|
633
|
+
/**
|
|
634
|
+
* Filesystem watch notification emitted for `fs/watch` subscribers.
|
|
635
|
+
*/
|
|
636
|
+
type FsChangedNotification = {
|
|
637
|
+
/**
|
|
638
|
+
* Watch identifier previously provided to `fs/watch`.
|
|
639
|
+
*/
|
|
640
|
+
watchId: string;
|
|
641
|
+
/**
|
|
642
|
+
* File or directory paths associated with this event.
|
|
643
|
+
*/
|
|
644
|
+
changedPaths: Array<AbsolutePathBuf>;
|
|
645
|
+
};
|
|
646
|
+
|
|
647
|
+
type GuardianWarningNotification = {
|
|
648
|
+
/**
|
|
649
|
+
* Thread target for the guardian warning.
|
|
650
|
+
*/
|
|
651
|
+
threadId: string;
|
|
652
|
+
/**
|
|
653
|
+
* Concise guardian warning message for the user.
|
|
654
|
+
*/
|
|
655
|
+
message: string;
|
|
656
|
+
};
|
|
657
|
+
|
|
658
|
+
type HookEventName = "preToolUse" | "permissionRequest" | "postToolUse" | "preCompact" | "postCompact" | "sessionStart" | "userPromptSubmit" | "stop";
|
|
659
|
+
|
|
660
|
+
type HookExecutionMode = "sync" | "async";
|
|
661
|
+
|
|
662
|
+
type HookHandlerType = "command" | "prompt" | "agent";
|
|
663
|
+
|
|
664
|
+
type HookOutputEntryKind = "warning" | "stop" | "feedback" | "context" | "error";
|
|
665
|
+
|
|
666
|
+
type HookOutputEntry = {
|
|
667
|
+
kind: HookOutputEntryKind;
|
|
668
|
+
text: string;
|
|
669
|
+
};
|
|
670
|
+
|
|
671
|
+
type HookRunStatus = "running" | "completed" | "failed" | "blocked" | "stopped";
|
|
672
|
+
|
|
673
|
+
type HookScope = "thread" | "turn";
|
|
674
|
+
|
|
675
|
+
type HookSource = "system" | "user" | "project" | "mdm" | "sessionFlags" | "plugin" | "cloudRequirements" | "legacyManagedConfigFile" | "legacyManagedConfigMdm" | "unknown";
|
|
676
|
+
|
|
677
|
+
type HookRunSummary = {
|
|
678
|
+
id: string;
|
|
679
|
+
eventName: HookEventName;
|
|
680
|
+
handlerType: HookHandlerType;
|
|
681
|
+
executionMode: HookExecutionMode;
|
|
682
|
+
scope: HookScope;
|
|
683
|
+
sourcePath: AbsolutePathBuf;
|
|
684
|
+
source: HookSource;
|
|
685
|
+
displayOrder: bigint;
|
|
686
|
+
status: HookRunStatus;
|
|
687
|
+
statusMessage: string | null;
|
|
688
|
+
startedAt: bigint;
|
|
689
|
+
completedAt: bigint | null;
|
|
690
|
+
durationMs: bigint | null;
|
|
691
|
+
entries: Array<HookOutputEntry>;
|
|
692
|
+
};
|
|
693
|
+
|
|
694
|
+
type HookCompletedNotification = {
|
|
695
|
+
threadId: string;
|
|
696
|
+
turnId: string | null;
|
|
697
|
+
run: HookRunSummary;
|
|
698
|
+
};
|
|
699
|
+
|
|
700
|
+
type HookStartedNotification = {
|
|
701
|
+
threadId: string;
|
|
702
|
+
turnId: string | null;
|
|
703
|
+
run: HookRunSummary;
|
|
704
|
+
};
|
|
705
|
+
|
|
706
|
+
type CollabAgentStatus = "pendingInit" | "running" | "interrupted" | "completed" | "errored" | "shutdown" | "notFound";
|
|
707
|
+
|
|
708
|
+
type CollabAgentState = {
|
|
709
|
+
status: CollabAgentStatus;
|
|
710
|
+
message: string | null;
|
|
711
|
+
};
|
|
712
|
+
|
|
713
|
+
type CollabAgentTool = "spawnAgent" | "sendInput" | "resumeAgent" | "wait" | "closeAgent";
|
|
714
|
+
|
|
715
|
+
type CollabAgentToolCallStatus = "inProgress" | "completed" | "failed";
|
|
716
|
+
|
|
717
|
+
type CommandAction = {
|
|
718
|
+
"type": "read";
|
|
719
|
+
command: string;
|
|
720
|
+
name: string;
|
|
721
|
+
path: AbsolutePathBuf;
|
|
722
|
+
} | {
|
|
723
|
+
"type": "listFiles";
|
|
724
|
+
command: string;
|
|
725
|
+
path: string | null;
|
|
726
|
+
} | {
|
|
727
|
+
"type": "search";
|
|
728
|
+
command: string;
|
|
729
|
+
query: string | null;
|
|
730
|
+
path: string | null;
|
|
731
|
+
} | {
|
|
732
|
+
"type": "unknown";
|
|
733
|
+
command: string;
|
|
734
|
+
};
|
|
735
|
+
|
|
736
|
+
type CommandExecutionSource = "agent" | "userShell" | "unifiedExecStartup" | "unifiedExecInteraction";
|
|
737
|
+
|
|
738
|
+
type CommandExecutionStatus = "inProgress" | "completed" | "failed" | "declined";
|
|
739
|
+
|
|
740
|
+
type DynamicToolCallOutputContentItem = {
|
|
741
|
+
"type": "inputText";
|
|
742
|
+
text: string;
|
|
743
|
+
} | {
|
|
744
|
+
"type": "inputImage";
|
|
745
|
+
imageUrl: string;
|
|
746
|
+
};
|
|
747
|
+
|
|
748
|
+
type DynamicToolCallStatus = "inProgress" | "completed" | "failed";
|
|
749
|
+
|
|
750
|
+
type HookPromptFragment = {
|
|
751
|
+
text: string;
|
|
752
|
+
hookRunId: string;
|
|
753
|
+
};
|
|
754
|
+
|
|
755
|
+
type McpToolCallError = {
|
|
756
|
+
message: string;
|
|
757
|
+
};
|
|
758
|
+
|
|
759
|
+
type McpToolCallResult = {
|
|
760
|
+
content: Array<JsonValue>;
|
|
761
|
+
structuredContent: JsonValue | null;
|
|
762
|
+
_meta: JsonValue | null;
|
|
763
|
+
};
|
|
764
|
+
|
|
765
|
+
type McpToolCallStatus = "inProgress" | "completed" | "failed";
|
|
766
|
+
|
|
767
|
+
type MemoryCitationEntry = {
|
|
768
|
+
path: string;
|
|
769
|
+
lineStart: number;
|
|
770
|
+
lineEnd: number;
|
|
771
|
+
note: string;
|
|
772
|
+
};
|
|
773
|
+
|
|
774
|
+
type MemoryCitation = {
|
|
775
|
+
entries: Array<MemoryCitationEntry>;
|
|
776
|
+
threadIds: Array<string>;
|
|
777
|
+
};
|
|
778
|
+
|
|
779
|
+
type PatchApplyStatus = "inProgress" | "completed" | "failed" | "declined";
|
|
780
|
+
|
|
781
|
+
type WebSearchAction = {
|
|
782
|
+
"type": "search";
|
|
783
|
+
query: string | null;
|
|
784
|
+
queries: Array<string> | null;
|
|
785
|
+
} | {
|
|
786
|
+
"type": "openPage";
|
|
787
|
+
url: string | null;
|
|
788
|
+
} | {
|
|
789
|
+
"type": "findInPage";
|
|
790
|
+
url: string | null;
|
|
791
|
+
pattern: string | null;
|
|
792
|
+
} | {
|
|
793
|
+
"type": "other";
|
|
794
|
+
};
|
|
795
|
+
|
|
796
|
+
type ThreadItem = {
|
|
797
|
+
"type": "userMessage";
|
|
798
|
+
id: string;
|
|
799
|
+
content: Array<UserInput>;
|
|
800
|
+
} | {
|
|
801
|
+
"type": "hookPrompt";
|
|
802
|
+
id: string;
|
|
803
|
+
fragments: Array<HookPromptFragment>;
|
|
804
|
+
} | {
|
|
805
|
+
"type": "agentMessage";
|
|
806
|
+
id: string;
|
|
807
|
+
text: string;
|
|
808
|
+
phase: MessagePhase | null;
|
|
809
|
+
memoryCitation: MemoryCitation | null;
|
|
810
|
+
} | {
|
|
811
|
+
"type": "plan";
|
|
812
|
+
id: string;
|
|
813
|
+
text: string;
|
|
814
|
+
} | {
|
|
815
|
+
"type": "reasoning";
|
|
816
|
+
id: string;
|
|
817
|
+
summary: Array<string>;
|
|
818
|
+
content: Array<string>;
|
|
819
|
+
} | {
|
|
820
|
+
"type": "commandExecution";
|
|
821
|
+
id: string;
|
|
822
|
+
/**
|
|
823
|
+
* The command to be executed.
|
|
824
|
+
*/
|
|
825
|
+
command: string;
|
|
826
|
+
/**
|
|
827
|
+
* The command's working directory.
|
|
828
|
+
*/
|
|
829
|
+
cwd: AbsolutePathBuf;
|
|
830
|
+
/**
|
|
831
|
+
* Identifier for the underlying PTY process (when available).
|
|
832
|
+
*/
|
|
833
|
+
processId: string | null;
|
|
834
|
+
source: CommandExecutionSource;
|
|
835
|
+
status: CommandExecutionStatus;
|
|
836
|
+
/**
|
|
837
|
+
* A best-effort parsing of the command to understand the action(s) it will perform.
|
|
838
|
+
* This returns a list of CommandAction objects because a single shell command may
|
|
839
|
+
* be composed of many commands piped together.
|
|
840
|
+
*/
|
|
841
|
+
commandActions: Array<CommandAction>;
|
|
842
|
+
/**
|
|
843
|
+
* The command's output, aggregated from stdout and stderr.
|
|
844
|
+
*/
|
|
845
|
+
aggregatedOutput: string | null;
|
|
846
|
+
/**
|
|
847
|
+
* The command's exit code.
|
|
848
|
+
*/
|
|
849
|
+
exitCode: number | null;
|
|
850
|
+
/**
|
|
851
|
+
* The duration of the command execution in milliseconds.
|
|
852
|
+
*/
|
|
853
|
+
durationMs: number | null;
|
|
854
|
+
} | {
|
|
855
|
+
"type": "fileChange";
|
|
856
|
+
id: string;
|
|
857
|
+
changes: Array<FileUpdateChange>;
|
|
858
|
+
status: PatchApplyStatus;
|
|
859
|
+
} | {
|
|
860
|
+
"type": "mcpToolCall";
|
|
861
|
+
id: string;
|
|
862
|
+
server: string;
|
|
863
|
+
tool: string;
|
|
864
|
+
status: McpToolCallStatus;
|
|
865
|
+
arguments: JsonValue;
|
|
866
|
+
mcpAppResourceUri?: string;
|
|
867
|
+
result: McpToolCallResult | null;
|
|
868
|
+
error: McpToolCallError | null;
|
|
869
|
+
/**
|
|
870
|
+
* The duration of the MCP tool call in milliseconds.
|
|
871
|
+
*/
|
|
872
|
+
durationMs: number | null;
|
|
873
|
+
} | {
|
|
874
|
+
"type": "dynamicToolCall";
|
|
875
|
+
id: string;
|
|
876
|
+
namespace: string | null;
|
|
877
|
+
tool: string;
|
|
878
|
+
arguments: JsonValue;
|
|
879
|
+
status: DynamicToolCallStatus;
|
|
880
|
+
contentItems: Array<DynamicToolCallOutputContentItem> | null;
|
|
881
|
+
success: boolean | null;
|
|
882
|
+
/**
|
|
883
|
+
* The duration of the dynamic tool call in milliseconds.
|
|
884
|
+
*/
|
|
885
|
+
durationMs: number | null;
|
|
886
|
+
} | {
|
|
887
|
+
"type": "collabAgentToolCall";
|
|
888
|
+
/**
|
|
889
|
+
* Unique identifier for this collab tool call.
|
|
890
|
+
*/
|
|
891
|
+
id: string;
|
|
892
|
+
/**
|
|
893
|
+
* Name of the collab tool that was invoked.
|
|
894
|
+
*/
|
|
895
|
+
tool: CollabAgentTool;
|
|
896
|
+
/**
|
|
897
|
+
* Current status of the collab tool call.
|
|
898
|
+
*/
|
|
899
|
+
status: CollabAgentToolCallStatus;
|
|
900
|
+
/**
|
|
901
|
+
* Thread ID of the agent issuing the collab request.
|
|
902
|
+
*/
|
|
903
|
+
senderThreadId: string;
|
|
904
|
+
/**
|
|
905
|
+
* Thread ID of the receiving agent, when applicable. In case of spawn operation,
|
|
906
|
+
* this corresponds to the newly spawned agent.
|
|
907
|
+
*/
|
|
908
|
+
receiverThreadIds: Array<string>;
|
|
909
|
+
/**
|
|
910
|
+
* Prompt text sent as part of the collab tool call, when available.
|
|
911
|
+
*/
|
|
912
|
+
prompt: string | null;
|
|
913
|
+
/**
|
|
914
|
+
* Model requested for the spawned agent, when applicable.
|
|
915
|
+
*/
|
|
916
|
+
model: string | null;
|
|
917
|
+
/**
|
|
918
|
+
* Reasoning effort requested for the spawned agent, when applicable.
|
|
919
|
+
*/
|
|
920
|
+
reasoningEffort: ReasoningEffort | null;
|
|
921
|
+
/**
|
|
922
|
+
* Last known status of the target agents, when available.
|
|
923
|
+
*/
|
|
924
|
+
agentsStates: {
|
|
925
|
+
[key in string]?: CollabAgentState;
|
|
926
|
+
};
|
|
927
|
+
} | {
|
|
928
|
+
"type": "webSearch";
|
|
929
|
+
id: string;
|
|
930
|
+
query: string;
|
|
931
|
+
action: WebSearchAction | null;
|
|
932
|
+
} | {
|
|
933
|
+
"type": "imageView";
|
|
934
|
+
id: string;
|
|
935
|
+
path: AbsolutePathBuf;
|
|
936
|
+
} | {
|
|
937
|
+
"type": "imageGeneration";
|
|
938
|
+
id: string;
|
|
939
|
+
status: string;
|
|
940
|
+
revisedPrompt: string | null;
|
|
941
|
+
result: string;
|
|
942
|
+
savedPath?: AbsolutePathBuf;
|
|
943
|
+
} | {
|
|
944
|
+
"type": "enteredReviewMode";
|
|
945
|
+
id: string;
|
|
946
|
+
review: string;
|
|
947
|
+
} | {
|
|
948
|
+
"type": "exitedReviewMode";
|
|
949
|
+
id: string;
|
|
950
|
+
review: string;
|
|
951
|
+
} | {
|
|
952
|
+
"type": "contextCompaction";
|
|
953
|
+
id: string;
|
|
954
|
+
};
|
|
955
|
+
|
|
956
|
+
type ItemCompletedNotification = {
|
|
957
|
+
item: ThreadItem;
|
|
958
|
+
threadId: string;
|
|
959
|
+
turnId: string;
|
|
960
|
+
/**
|
|
961
|
+
* Unix timestamp (in milliseconds) when this item lifecycle completed.
|
|
962
|
+
*/
|
|
963
|
+
completedAtMs: number;
|
|
964
|
+
};
|
|
965
|
+
|
|
966
|
+
/**
|
|
967
|
+
* [UNSTABLE] Source that produced a terminal approval auto-review decision.
|
|
968
|
+
*/
|
|
969
|
+
type AutoReviewDecisionSource = "agent";
|
|
970
|
+
|
|
971
|
+
/**
|
|
972
|
+
* [UNSTABLE] Lifecycle state for an approval auto-review.
|
|
973
|
+
*/
|
|
974
|
+
type GuardianApprovalReviewStatus = "inProgress" | "approved" | "denied" | "timedOut" | "aborted";
|
|
975
|
+
|
|
976
|
+
/**
|
|
977
|
+
* [UNSTABLE] Risk level assigned by approval auto-review.
|
|
978
|
+
*/
|
|
979
|
+
type GuardianRiskLevel = "low" | "medium" | "high" | "critical";
|
|
980
|
+
|
|
981
|
+
/**
|
|
982
|
+
* [UNSTABLE] Authorization level assigned by approval auto-review.
|
|
983
|
+
*/
|
|
984
|
+
type GuardianUserAuthorization = "unknown" | "low" | "medium" | "high";
|
|
985
|
+
|
|
986
|
+
/**
|
|
987
|
+
* [UNSTABLE] Temporary approval auto-review payload used by
|
|
988
|
+
* `item/autoApprovalReview/*` notifications. This shape is expected to change
|
|
989
|
+
* soon.
|
|
990
|
+
*/
|
|
991
|
+
type GuardianApprovalReview = {
|
|
992
|
+
status: GuardianApprovalReviewStatus;
|
|
993
|
+
riskLevel: GuardianRiskLevel | null;
|
|
994
|
+
userAuthorization: GuardianUserAuthorization | null;
|
|
995
|
+
rationale: string | null;
|
|
996
|
+
};
|
|
997
|
+
|
|
998
|
+
type GuardianCommandSource = "shell" | "unifiedExec";
|
|
999
|
+
|
|
1000
|
+
type NetworkApprovalProtocol = "http" | "https" | "socks5Tcp" | "socks5Udp";
|
|
1001
|
+
|
|
1002
|
+
type FileSystemAccessMode = "read" | "write" | "none";
|
|
1003
|
+
|
|
1004
|
+
type FileSystemSpecialPath = {
|
|
1005
|
+
"kind": "root";
|
|
1006
|
+
} | {
|
|
1007
|
+
"kind": "minimal";
|
|
1008
|
+
} | {
|
|
1009
|
+
"kind": "project_roots";
|
|
1010
|
+
subpath: string | null;
|
|
1011
|
+
} | {
|
|
1012
|
+
"kind": "tmpdir";
|
|
1013
|
+
} | {
|
|
1014
|
+
"kind": "slash_tmp";
|
|
1015
|
+
} | {
|
|
1016
|
+
"kind": "unknown";
|
|
1017
|
+
path: string;
|
|
1018
|
+
subpath: string | null;
|
|
1019
|
+
};
|
|
1020
|
+
|
|
1021
|
+
type FileSystemPath = {
|
|
1022
|
+
"type": "path";
|
|
1023
|
+
path: AbsolutePathBuf;
|
|
1024
|
+
} | {
|
|
1025
|
+
"type": "glob_pattern";
|
|
1026
|
+
pattern: string;
|
|
1027
|
+
} | {
|
|
1028
|
+
"type": "special";
|
|
1029
|
+
value: FileSystemSpecialPath;
|
|
1030
|
+
};
|
|
1031
|
+
|
|
1032
|
+
type FileSystemSandboxEntry = {
|
|
1033
|
+
path: FileSystemPath;
|
|
1034
|
+
access: FileSystemAccessMode;
|
|
1035
|
+
};
|
|
1036
|
+
|
|
1037
|
+
type AdditionalFileSystemPermissions = {
|
|
1038
|
+
/**
|
|
1039
|
+
* This will be removed in favor of `entries`.
|
|
1040
|
+
*/
|
|
1041
|
+
read: Array<AbsolutePathBuf> | null;
|
|
1042
|
+
/**
|
|
1043
|
+
* This will be removed in favor of `entries`.
|
|
1044
|
+
*/
|
|
1045
|
+
write: Array<AbsolutePathBuf> | null;
|
|
1046
|
+
globScanMaxDepth?: number;
|
|
1047
|
+
entries?: Array<FileSystemSandboxEntry>;
|
|
1048
|
+
};
|
|
1049
|
+
|
|
1050
|
+
type AdditionalNetworkPermissions = {
|
|
1051
|
+
enabled: boolean | null;
|
|
1052
|
+
};
|
|
1053
|
+
|
|
1054
|
+
type RequestPermissionProfile = {
|
|
1055
|
+
network: AdditionalNetworkPermissions | null;
|
|
1056
|
+
fileSystem: AdditionalFileSystemPermissions | null;
|
|
1057
|
+
};
|
|
1058
|
+
|
|
1059
|
+
type GuardianApprovalReviewAction = {
|
|
1060
|
+
"type": "command";
|
|
1061
|
+
source: GuardianCommandSource;
|
|
1062
|
+
command: string;
|
|
1063
|
+
cwd: AbsolutePathBuf;
|
|
1064
|
+
} | {
|
|
1065
|
+
"type": "execve";
|
|
1066
|
+
source: GuardianCommandSource;
|
|
1067
|
+
program: string;
|
|
1068
|
+
argv: Array<string>;
|
|
1069
|
+
cwd: AbsolutePathBuf;
|
|
1070
|
+
} | {
|
|
1071
|
+
"type": "applyPatch";
|
|
1072
|
+
cwd: AbsolutePathBuf;
|
|
1073
|
+
files: Array<AbsolutePathBuf>;
|
|
1074
|
+
} | {
|
|
1075
|
+
"type": "networkAccess";
|
|
1076
|
+
target: string;
|
|
1077
|
+
host: string;
|
|
1078
|
+
protocol: NetworkApprovalProtocol;
|
|
1079
|
+
port: number;
|
|
1080
|
+
} | {
|
|
1081
|
+
"type": "mcpToolCall";
|
|
1082
|
+
server: string;
|
|
1083
|
+
toolName: string;
|
|
1084
|
+
connectorId: string | null;
|
|
1085
|
+
connectorName: string | null;
|
|
1086
|
+
toolTitle: string | null;
|
|
1087
|
+
} | {
|
|
1088
|
+
"type": "requestPermissions";
|
|
1089
|
+
reason: string | null;
|
|
1090
|
+
permissions: RequestPermissionProfile;
|
|
1091
|
+
};
|
|
1092
|
+
|
|
1093
|
+
/**
|
|
1094
|
+
* [UNSTABLE] Temporary notification payload for approval auto-review. This
|
|
1095
|
+
* shape is expected to change soon.
|
|
1096
|
+
*/
|
|
1097
|
+
type ItemGuardianApprovalReviewCompletedNotification = {
|
|
1098
|
+
threadId: string;
|
|
1099
|
+
turnId: string;
|
|
1100
|
+
/**
|
|
1101
|
+
* Stable identifier for this review.
|
|
1102
|
+
*/
|
|
1103
|
+
reviewId: string;
|
|
1104
|
+
/**
|
|
1105
|
+
* Identifier for the reviewed item or tool call when one exists.
|
|
1106
|
+
*
|
|
1107
|
+
* In most cases, one review maps to one target item. The exceptions are
|
|
1108
|
+
* - execve reviews, where a single command may contain multiple execve
|
|
1109
|
+
* calls to review (only possible when using the shell_zsh_fork feature)
|
|
1110
|
+
* - network policy reviews, where there is no target item
|
|
1111
|
+
*
|
|
1112
|
+
* A network call is triggered by a CommandExecution item, so having a
|
|
1113
|
+
* target_item_id set to the CommandExecution item would be misleading
|
|
1114
|
+
* because the review is about the network call, not the command execution.
|
|
1115
|
+
* Therefore, target_item_id is set to None for network policy reviews.
|
|
1116
|
+
*/
|
|
1117
|
+
targetItemId: string | null;
|
|
1118
|
+
decisionSource: AutoReviewDecisionSource;
|
|
1119
|
+
review: GuardianApprovalReview;
|
|
1120
|
+
action: GuardianApprovalReviewAction;
|
|
1121
|
+
};
|
|
1122
|
+
|
|
1123
|
+
/**
|
|
1124
|
+
* [UNSTABLE] Temporary notification payload for approval auto-review. This
|
|
1125
|
+
* shape is expected to change soon.
|
|
1126
|
+
*/
|
|
1127
|
+
type ItemGuardianApprovalReviewStartedNotification = {
|
|
1128
|
+
threadId: string;
|
|
1129
|
+
turnId: string;
|
|
1130
|
+
/**
|
|
1131
|
+
* Stable identifier for this review.
|
|
1132
|
+
*/
|
|
1133
|
+
reviewId: string;
|
|
1134
|
+
/**
|
|
1135
|
+
* Identifier for the reviewed item or tool call when one exists.
|
|
1136
|
+
*
|
|
1137
|
+
* In most cases, one review maps to one target item. The exceptions are
|
|
1138
|
+
* - execve reviews, where a single command may contain multiple execve
|
|
1139
|
+
* calls to review (only possible when using the shell_zsh_fork feature)
|
|
1140
|
+
* - network policy reviews, where there is no target item
|
|
1141
|
+
*
|
|
1142
|
+
* A network call is triggered by a CommandExecution item, so having a
|
|
1143
|
+
* target_item_id set to the CommandExecution item would be misleading
|
|
1144
|
+
* because the review is about the network call, not the command execution.
|
|
1145
|
+
* Therefore, target_item_id is set to None for network policy reviews.
|
|
1146
|
+
*/
|
|
1147
|
+
targetItemId: string | null;
|
|
1148
|
+
review: GuardianApprovalReview;
|
|
1149
|
+
action: GuardianApprovalReviewAction;
|
|
1150
|
+
};
|
|
1151
|
+
|
|
1152
|
+
type ItemStartedNotification = {
|
|
1153
|
+
item: ThreadItem;
|
|
1154
|
+
threadId: string;
|
|
1155
|
+
turnId: string;
|
|
1156
|
+
/**
|
|
1157
|
+
* Unix timestamp (in milliseconds) when this item lifecycle started.
|
|
1158
|
+
*/
|
|
1159
|
+
startedAtMs: number;
|
|
1160
|
+
};
|
|
1161
|
+
|
|
1162
|
+
type McpServerOauthLoginCompletedNotification = {
|
|
1163
|
+
name: string;
|
|
1164
|
+
success: boolean;
|
|
1165
|
+
error?: string;
|
|
1166
|
+
};
|
|
1167
|
+
|
|
1168
|
+
type McpServerStartupState = "starting" | "ready" | "failed" | "cancelled";
|
|
1169
|
+
|
|
1170
|
+
type McpServerStatusUpdatedNotification = {
|
|
1171
|
+
name: string;
|
|
1172
|
+
status: McpServerStartupState;
|
|
1173
|
+
error: string | null;
|
|
1174
|
+
};
|
|
1175
|
+
|
|
1176
|
+
type McpToolCallProgressNotification = {
|
|
1177
|
+
threadId: string;
|
|
1178
|
+
turnId: string;
|
|
1179
|
+
itemId: string;
|
|
1180
|
+
message: string;
|
|
1181
|
+
};
|
|
1182
|
+
|
|
1183
|
+
type ModelRerouteReason = "highRiskCyberActivity";
|
|
1184
|
+
|
|
1185
|
+
type ModelReroutedNotification = {
|
|
1186
|
+
threadId: string;
|
|
1187
|
+
turnId: string;
|
|
1188
|
+
fromModel: string;
|
|
1189
|
+
toModel: string;
|
|
1190
|
+
reason: ModelRerouteReason;
|
|
1191
|
+
};
|
|
1192
|
+
|
|
1193
|
+
type ModelVerification = "trustedAccessForCyber";
|
|
1194
|
+
|
|
1195
|
+
type ModelVerificationNotification = {
|
|
1196
|
+
threadId: string;
|
|
1197
|
+
turnId: string;
|
|
1198
|
+
verifications: Array<ModelVerification>;
|
|
1199
|
+
};
|
|
1200
|
+
|
|
1201
|
+
/**
|
|
1202
|
+
* EXPERIMENTAL - proposed plan streaming deltas for plan items. Clients should
|
|
1203
|
+
* not assume concatenated deltas match the completed plan item content.
|
|
1204
|
+
*/
|
|
1205
|
+
type PlanDeltaNotification = {
|
|
1206
|
+
threadId: string;
|
|
1207
|
+
turnId: string;
|
|
1208
|
+
itemId: string;
|
|
1209
|
+
delta: string;
|
|
1210
|
+
};
|
|
1211
|
+
|
|
1212
|
+
/**
|
|
1213
|
+
* Final process exit notification for `process/spawn`.
|
|
1214
|
+
*/
|
|
1215
|
+
type ProcessExitedNotification = {
|
|
1216
|
+
/**
|
|
1217
|
+
* Client-supplied, connection-scoped `processHandle` from `process/spawn`.
|
|
1218
|
+
*/
|
|
1219
|
+
processHandle: string;
|
|
1220
|
+
/**
|
|
1221
|
+
* Process exit code.
|
|
1222
|
+
*/
|
|
1223
|
+
exitCode: number;
|
|
1224
|
+
/**
|
|
1225
|
+
* Buffered stdout capture.
|
|
1226
|
+
*
|
|
1227
|
+
* Empty when stdout was streamed via `process/outputDelta`.
|
|
1228
|
+
*/
|
|
1229
|
+
stdout: string;
|
|
1230
|
+
/**
|
|
1231
|
+
* Whether stdout reached `outputBytesCap`.
|
|
1232
|
+
*
|
|
1233
|
+
* In streaming mode, stdout is empty and cap state is also reported on the
|
|
1234
|
+
* final stdout `process/outputDelta` notification.
|
|
1235
|
+
*/
|
|
1236
|
+
stdoutCapReached: boolean;
|
|
1237
|
+
/**
|
|
1238
|
+
* Buffered stderr capture.
|
|
1239
|
+
*
|
|
1240
|
+
* Empty when stderr was streamed via `process/outputDelta`.
|
|
1241
|
+
*/
|
|
1242
|
+
stderr: string;
|
|
1243
|
+
/**
|
|
1244
|
+
* Whether stderr reached `outputBytesCap`.
|
|
1245
|
+
*
|
|
1246
|
+
* In streaming mode, stderr is empty and cap state is also reported on the
|
|
1247
|
+
* final stderr `process/outputDelta` notification.
|
|
1248
|
+
*/
|
|
1249
|
+
stderrCapReached: boolean;
|
|
1250
|
+
};
|
|
1251
|
+
|
|
1252
|
+
/**
|
|
1253
|
+
* Stream label for `process/outputDelta` notifications.
|
|
1254
|
+
*/
|
|
1255
|
+
type ProcessOutputStream = "stdout" | "stderr";
|
|
1256
|
+
|
|
1257
|
+
/**
|
|
1258
|
+
* Base64-encoded output chunk emitted for a streaming `process/spawn` request.
|
|
1259
|
+
*/
|
|
1260
|
+
type ProcessOutputDeltaNotification = {
|
|
1261
|
+
/**
|
|
1262
|
+
* Client-supplied, connection-scoped `processHandle` from `process/spawn`.
|
|
1263
|
+
*/
|
|
1264
|
+
processHandle: string;
|
|
1265
|
+
/**
|
|
1266
|
+
* Output stream this chunk belongs to.
|
|
1267
|
+
*/
|
|
1268
|
+
stream: ProcessOutputStream;
|
|
1269
|
+
/**
|
|
1270
|
+
* Base64-encoded output bytes.
|
|
1271
|
+
*/
|
|
1272
|
+
deltaBase64: string;
|
|
1273
|
+
/**
|
|
1274
|
+
* True on the final streamed chunk for this stream when output was
|
|
1275
|
+
* truncated by `outputBytesCap`.
|
|
1276
|
+
*/
|
|
1277
|
+
capReached: boolean;
|
|
1278
|
+
};
|
|
1279
|
+
|
|
1280
|
+
type RawResponseItemCompletedNotification = {
|
|
1281
|
+
threadId: string;
|
|
1282
|
+
turnId: string;
|
|
1283
|
+
item: ResponseItem;
|
|
1284
|
+
};
|
|
1285
|
+
|
|
1286
|
+
type ReasoningSummaryPartAddedNotification = {
|
|
1287
|
+
threadId: string;
|
|
1288
|
+
turnId: string;
|
|
1289
|
+
itemId: string;
|
|
1290
|
+
summaryIndex: number;
|
|
1291
|
+
};
|
|
1292
|
+
|
|
1293
|
+
type ReasoningSummaryTextDeltaNotification = {
|
|
1294
|
+
threadId: string;
|
|
1295
|
+
turnId: string;
|
|
1296
|
+
itemId: string;
|
|
1297
|
+
delta: string;
|
|
1298
|
+
summaryIndex: number;
|
|
1299
|
+
};
|
|
1300
|
+
|
|
1301
|
+
type ReasoningTextDeltaNotification = {
|
|
1302
|
+
threadId: string;
|
|
1303
|
+
turnId: string;
|
|
1304
|
+
itemId: string;
|
|
1305
|
+
delta: string;
|
|
1306
|
+
contentIndex: number;
|
|
1307
|
+
};
|
|
1308
|
+
|
|
1309
|
+
type RemoteControlConnectionStatus = "disabled" | "connecting" | "connected" | "errored";
|
|
1310
|
+
|
|
1311
|
+
/**
|
|
1312
|
+
* Current remote-control connection status and environment id exposed to clients.
|
|
1313
|
+
*/
|
|
1314
|
+
type RemoteControlStatusChangedNotification = {
|
|
1315
|
+
status: RemoteControlConnectionStatus;
|
|
1316
|
+
environmentId: string | null;
|
|
1317
|
+
};
|
|
1318
|
+
|
|
1319
|
+
type ServerRequestResolvedNotification = {
|
|
1320
|
+
threadId: string;
|
|
1321
|
+
requestId: RequestId;
|
|
1322
|
+
};
|
|
1323
|
+
|
|
1324
|
+
/**
|
|
1325
|
+
* Notification emitted when watched local skill files change.
|
|
1326
|
+
*
|
|
1327
|
+
* Treat this as an invalidation signal and re-run `skills/list` with the
|
|
1328
|
+
* client's current parameters when refreshed skill metadata is needed.
|
|
1329
|
+
*/
|
|
1330
|
+
type SkillsChangedNotification = Record<string, never>;
|
|
1331
|
+
|
|
1332
|
+
type TerminalInteractionNotification = {
|
|
1333
|
+
threadId: string;
|
|
1334
|
+
turnId: string;
|
|
1335
|
+
itemId: string;
|
|
1336
|
+
processId: string;
|
|
1337
|
+
stdin: string;
|
|
1338
|
+
};
|
|
1339
|
+
|
|
1340
|
+
type ThreadArchivedNotification = {
|
|
1341
|
+
threadId: string;
|
|
1342
|
+
};
|
|
1343
|
+
|
|
1344
|
+
type ThreadClosedNotification = {
|
|
1345
|
+
threadId: string;
|
|
1346
|
+
};
|
|
1347
|
+
|
|
1348
|
+
type ThreadGoalClearedNotification = {
|
|
1349
|
+
threadId: string;
|
|
1350
|
+
};
|
|
1351
|
+
|
|
1352
|
+
type ThreadGoalStatus = "active" | "paused" | "budgetLimited" | "complete";
|
|
1353
|
+
|
|
1354
|
+
type ThreadGoal = {
|
|
1355
|
+
threadId: string;
|
|
1356
|
+
objective: string;
|
|
1357
|
+
status: ThreadGoalStatus;
|
|
1358
|
+
tokenBudget: number | null;
|
|
1359
|
+
tokensUsed: number;
|
|
1360
|
+
timeUsedSeconds: number;
|
|
1361
|
+
createdAt: number;
|
|
1362
|
+
updatedAt: number;
|
|
1363
|
+
};
|
|
1364
|
+
|
|
1365
|
+
type ThreadGoalUpdatedNotification = {
|
|
1366
|
+
threadId: string;
|
|
1367
|
+
turnId: string | null;
|
|
1368
|
+
goal: ThreadGoal;
|
|
1369
|
+
};
|
|
1370
|
+
|
|
1371
|
+
type ThreadNameUpdatedNotification = {
|
|
1372
|
+
threadId: string;
|
|
1373
|
+
threadName?: string;
|
|
1374
|
+
};
|
|
1375
|
+
|
|
1376
|
+
/**
|
|
1377
|
+
* EXPERIMENTAL - emitted when thread realtime transport closes.
|
|
1378
|
+
*/
|
|
1379
|
+
type ThreadRealtimeClosedNotification = {
|
|
1380
|
+
threadId: string;
|
|
1381
|
+
reason: string | null;
|
|
1382
|
+
};
|
|
1383
|
+
|
|
1384
|
+
/**
|
|
1385
|
+
* EXPERIMENTAL - emitted when thread realtime encounters an error.
|
|
1386
|
+
*/
|
|
1387
|
+
type ThreadRealtimeErrorNotification = {
|
|
1388
|
+
threadId: string;
|
|
1389
|
+
message: string;
|
|
1390
|
+
};
|
|
1391
|
+
|
|
1392
|
+
/**
|
|
1393
|
+
* EXPERIMENTAL - raw non-audio thread realtime item emitted by the backend.
|
|
1394
|
+
*/
|
|
1395
|
+
type ThreadRealtimeItemAddedNotification = {
|
|
1396
|
+
threadId: string;
|
|
1397
|
+
item: JsonValue;
|
|
1398
|
+
};
|
|
1399
|
+
|
|
1400
|
+
/**
|
|
1401
|
+
* EXPERIMENTAL - thread realtime audio chunk.
|
|
1402
|
+
*/
|
|
1403
|
+
type ThreadRealtimeAudioChunk = {
|
|
1404
|
+
data: string;
|
|
1405
|
+
sampleRate: number;
|
|
1406
|
+
numChannels: number;
|
|
1407
|
+
samplesPerChannel: number | null;
|
|
1408
|
+
itemId: string | null;
|
|
1409
|
+
};
|
|
1410
|
+
|
|
1411
|
+
/**
|
|
1412
|
+
* EXPERIMENTAL - streamed output audio emitted by thread realtime.
|
|
1413
|
+
*/
|
|
1414
|
+
type ThreadRealtimeOutputAudioDeltaNotification = {
|
|
1415
|
+
threadId: string;
|
|
1416
|
+
audio: ThreadRealtimeAudioChunk;
|
|
1417
|
+
};
|
|
1418
|
+
|
|
1419
|
+
/**
|
|
1420
|
+
* EXPERIMENTAL - emitted with the remote SDP for a WebRTC realtime session.
|
|
1421
|
+
*/
|
|
1422
|
+
type ThreadRealtimeSdpNotification = {
|
|
1423
|
+
threadId: string;
|
|
1424
|
+
sdp: string;
|
|
1425
|
+
};
|
|
1426
|
+
|
|
1427
|
+
/**
|
|
1428
|
+
* EXPERIMENTAL - emitted when thread realtime startup is accepted.
|
|
1429
|
+
*/
|
|
1430
|
+
type ThreadRealtimeStartedNotification = {
|
|
1431
|
+
threadId: string;
|
|
1432
|
+
realtimeSessionId: string | null;
|
|
1433
|
+
version: RealtimeConversationVersion;
|
|
1434
|
+
};
|
|
1435
|
+
|
|
1436
|
+
/**
|
|
1437
|
+
* EXPERIMENTAL - flat transcript delta emitted whenever realtime
|
|
1438
|
+
* transcript text changes.
|
|
1439
|
+
*/
|
|
1440
|
+
type ThreadRealtimeTranscriptDeltaNotification = {
|
|
1441
|
+
threadId: string;
|
|
1442
|
+
role: string;
|
|
1443
|
+
/**
|
|
1444
|
+
* Live transcript delta from the realtime event.
|
|
1445
|
+
*/
|
|
1446
|
+
delta: string;
|
|
1447
|
+
};
|
|
1448
|
+
|
|
1449
|
+
/**
|
|
1450
|
+
* EXPERIMENTAL - final transcript text emitted when realtime completes
|
|
1451
|
+
* a transcript part.
|
|
1452
|
+
*/
|
|
1453
|
+
type ThreadRealtimeTranscriptDoneNotification = {
|
|
1454
|
+
threadId: string;
|
|
1455
|
+
role: string;
|
|
1456
|
+
/**
|
|
1457
|
+
* Final complete text for the transcript part.
|
|
1458
|
+
*/
|
|
1459
|
+
text: string;
|
|
1460
|
+
};
|
|
1461
|
+
|
|
1462
|
+
type GitInfo = {
|
|
1463
|
+
sha: string | null;
|
|
1464
|
+
branch: string | null;
|
|
1465
|
+
originUrl: string | null;
|
|
1466
|
+
};
|
|
1467
|
+
|
|
1468
|
+
type SessionSource = "cli" | "vscode" | "exec" | "appServer" | {
|
|
1469
|
+
"custom": string;
|
|
1470
|
+
} | {
|
|
1471
|
+
"subAgent": SubAgentSource;
|
|
1472
|
+
} | "unknown";
|
|
1473
|
+
|
|
1474
|
+
type ThreadActiveFlag = "waitingOnApproval" | "waitingOnUserInput";
|
|
1475
|
+
|
|
1476
|
+
type ThreadStatus = {
|
|
1477
|
+
"type": "notLoaded";
|
|
1478
|
+
} | {
|
|
1479
|
+
"type": "idle";
|
|
1480
|
+
} | {
|
|
1481
|
+
"type": "systemError";
|
|
1482
|
+
} | {
|
|
1483
|
+
"type": "active";
|
|
1484
|
+
activeFlags: Array<ThreadActiveFlag>;
|
|
1485
|
+
};
|
|
1486
|
+
|
|
1487
|
+
type TurnItemsView = "notLoaded" | "summary" | "full";
|
|
1488
|
+
|
|
1489
|
+
type TurnStatus = "completed" | "interrupted" | "failed" | "inProgress";
|
|
1490
|
+
|
|
1491
|
+
type Turn = {
|
|
1492
|
+
id: string;
|
|
1493
|
+
/**
|
|
1494
|
+
* Thread items currently included in this turn payload.
|
|
1495
|
+
*/
|
|
1496
|
+
items: Array<ThreadItem>;
|
|
1497
|
+
/**
|
|
1498
|
+
* Describes how much of `items` has been loaded for this turn.
|
|
1499
|
+
*/
|
|
1500
|
+
itemsView: TurnItemsView;
|
|
1501
|
+
status: TurnStatus;
|
|
1502
|
+
/**
|
|
1503
|
+
* Only populated when the Turn's status is failed.
|
|
1504
|
+
*/
|
|
1505
|
+
error: TurnError | null;
|
|
1506
|
+
/**
|
|
1507
|
+
* Unix timestamp (in seconds) when the turn started.
|
|
1508
|
+
*/
|
|
1509
|
+
startedAt: number | null;
|
|
1510
|
+
/**
|
|
1511
|
+
* Unix timestamp (in seconds) when the turn completed.
|
|
1512
|
+
*/
|
|
1513
|
+
completedAt: number | null;
|
|
1514
|
+
/**
|
|
1515
|
+
* Duration between turn start and completion in milliseconds, if known.
|
|
1516
|
+
*/
|
|
1517
|
+
durationMs: number | null;
|
|
1518
|
+
};
|
|
1519
|
+
|
|
1520
|
+
type Thread = {
|
|
1521
|
+
id: string;
|
|
1522
|
+
/**
|
|
1523
|
+
* Session id shared by threads that belong to the same session tree.
|
|
1524
|
+
*/
|
|
1525
|
+
sessionId: string;
|
|
1526
|
+
/**
|
|
1527
|
+
* Source thread id when this thread was created by forking another thread.
|
|
1528
|
+
*/
|
|
1529
|
+
forkedFromId: string | null;
|
|
1530
|
+
/**
|
|
1531
|
+
* Usually the first user message in the thread, if available.
|
|
1532
|
+
*/
|
|
1533
|
+
preview: string;
|
|
1534
|
+
/**
|
|
1535
|
+
* Whether the thread is ephemeral and should not be materialized on disk.
|
|
1536
|
+
*/
|
|
1537
|
+
ephemeral: boolean;
|
|
1538
|
+
/**
|
|
1539
|
+
* Model provider used for this thread (for example, 'openai').
|
|
1540
|
+
*/
|
|
1541
|
+
modelProvider: string;
|
|
1542
|
+
/**
|
|
1543
|
+
* Unix timestamp (in seconds) when the thread was created.
|
|
1544
|
+
*/
|
|
1545
|
+
createdAt: number;
|
|
1546
|
+
/**
|
|
1547
|
+
* Unix timestamp (in seconds) when the thread was last updated.
|
|
1548
|
+
*/
|
|
1549
|
+
updatedAt: number;
|
|
1550
|
+
/**
|
|
1551
|
+
* Current runtime status for the thread.
|
|
1552
|
+
*/
|
|
1553
|
+
status: ThreadStatus;
|
|
1554
|
+
/**
|
|
1555
|
+
* [UNSTABLE] Path to the thread on disk.
|
|
1556
|
+
*/
|
|
1557
|
+
path: string | null;
|
|
1558
|
+
/**
|
|
1559
|
+
* Working directory captured for the thread.
|
|
1560
|
+
*/
|
|
1561
|
+
cwd: AbsolutePathBuf;
|
|
1562
|
+
/**
|
|
1563
|
+
* Version of the CLI that created the thread.
|
|
1564
|
+
*/
|
|
1565
|
+
cliVersion: string;
|
|
1566
|
+
/**
|
|
1567
|
+
* Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.).
|
|
1568
|
+
*/
|
|
1569
|
+
source: SessionSource;
|
|
1570
|
+
/**
|
|
1571
|
+
* Optional analytics source classification for this thread.
|
|
1572
|
+
*/
|
|
1573
|
+
threadSource: ThreadSource | null;
|
|
1574
|
+
/**
|
|
1575
|
+
* Optional random unique nickname assigned to an AgentControl-spawned sub-agent.
|
|
1576
|
+
*/
|
|
1577
|
+
agentNickname: string | null;
|
|
1578
|
+
/**
|
|
1579
|
+
* Optional role (agent_role) assigned to an AgentControl-spawned sub-agent.
|
|
1580
|
+
*/
|
|
1581
|
+
agentRole: string | null;
|
|
1582
|
+
/**
|
|
1583
|
+
* Optional Git metadata captured when the thread was created.
|
|
1584
|
+
*/
|
|
1585
|
+
gitInfo: GitInfo | null;
|
|
1586
|
+
/**
|
|
1587
|
+
* Optional user-facing thread title.
|
|
1588
|
+
*/
|
|
1589
|
+
name: string | null;
|
|
1590
|
+
/**
|
|
1591
|
+
* Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read`
|
|
1592
|
+
* (when `includeTurns` is true) responses.
|
|
1593
|
+
* For all other responses and notifications returning a Thread,
|
|
1594
|
+
* the turns field will be an empty list.
|
|
1595
|
+
*/
|
|
1596
|
+
turns: Array<Turn>;
|
|
1597
|
+
};
|
|
1598
|
+
|
|
1599
|
+
type ThreadStartedNotification = {
|
|
1600
|
+
thread: Thread;
|
|
1601
|
+
};
|
|
1602
|
+
|
|
1603
|
+
type ThreadStatusChangedNotification = {
|
|
1604
|
+
threadId: string;
|
|
1605
|
+
status: ThreadStatus;
|
|
1606
|
+
};
|
|
1607
|
+
|
|
1608
|
+
type TokenUsageBreakdown = {
|
|
1609
|
+
totalTokens: number;
|
|
1610
|
+
inputTokens: number;
|
|
1611
|
+
cachedInputTokens: number;
|
|
1612
|
+
outputTokens: number;
|
|
1613
|
+
reasoningOutputTokens: number;
|
|
1614
|
+
};
|
|
1615
|
+
|
|
1616
|
+
type ThreadTokenUsage = {
|
|
1617
|
+
total: TokenUsageBreakdown;
|
|
1618
|
+
last: TokenUsageBreakdown;
|
|
1619
|
+
modelContextWindow: number | null;
|
|
1620
|
+
};
|
|
1621
|
+
|
|
1622
|
+
type ThreadTokenUsageUpdatedNotification = {
|
|
1623
|
+
threadId: string;
|
|
1624
|
+
turnId: string;
|
|
1625
|
+
tokenUsage: ThreadTokenUsage;
|
|
1626
|
+
};
|
|
1627
|
+
|
|
1628
|
+
type ThreadUnarchivedNotification = {
|
|
1629
|
+
threadId: string;
|
|
1630
|
+
};
|
|
1631
|
+
|
|
1632
|
+
type TurnCompletedNotification = {
|
|
1633
|
+
threadId: string;
|
|
1634
|
+
turn: Turn;
|
|
1635
|
+
};
|
|
1636
|
+
|
|
1637
|
+
/**
|
|
1638
|
+
* Notification that the turn-level unified diff has changed.
|
|
1639
|
+
* Contains the latest aggregated diff across all file changes in the turn.
|
|
1640
|
+
*/
|
|
1641
|
+
type TurnDiffUpdatedNotification = {
|
|
1642
|
+
threadId: string;
|
|
1643
|
+
turnId: string;
|
|
1644
|
+
diff: string;
|
|
1645
|
+
};
|
|
1646
|
+
|
|
1647
|
+
type TurnPlanStepStatus = "pending" | "inProgress" | "completed";
|
|
1648
|
+
|
|
1649
|
+
type TurnPlanStep = {
|
|
1650
|
+
step: string;
|
|
1651
|
+
status: TurnPlanStepStatus;
|
|
1652
|
+
};
|
|
1653
|
+
|
|
1654
|
+
type TurnPlanUpdatedNotification = {
|
|
1655
|
+
threadId: string;
|
|
1656
|
+
turnId: string;
|
|
1657
|
+
explanation: string | null;
|
|
1658
|
+
plan: Array<TurnPlanStep>;
|
|
1659
|
+
};
|
|
1660
|
+
|
|
1661
|
+
type TurnStartedNotification = {
|
|
1662
|
+
threadId: string;
|
|
1663
|
+
turn: Turn;
|
|
1664
|
+
};
|
|
1665
|
+
|
|
1666
|
+
type WarningNotification = {
|
|
1667
|
+
/**
|
|
1668
|
+
* Optional thread target when the warning applies to a specific thread.
|
|
1669
|
+
*/
|
|
1670
|
+
threadId: string | null;
|
|
1671
|
+
/**
|
|
1672
|
+
* Concise warning message for the user.
|
|
1673
|
+
*/
|
|
1674
|
+
message: string;
|
|
1675
|
+
};
|
|
1676
|
+
|
|
1677
|
+
type WindowsSandboxSetupCompletedNotification = {
|
|
1678
|
+
mode: WindowsSandboxSetupMode;
|
|
1679
|
+
success: boolean;
|
|
1680
|
+
error: string | null;
|
|
1681
|
+
};
|
|
1682
|
+
|
|
1683
|
+
type WindowsWorldWritableWarningNotification = {
|
|
1684
|
+
samplePaths: Array<string>;
|
|
1685
|
+
extraCount: number;
|
|
1686
|
+
failedScan: boolean;
|
|
1687
|
+
};
|
|
1688
|
+
|
|
1689
|
+
/**
|
|
1690
|
+
* Notification sent from the server to the client.
|
|
1691
|
+
*/
|
|
1692
|
+
type ServerNotification = {
|
|
1693
|
+
"method": "error";
|
|
1694
|
+
"params": ErrorNotification;
|
|
1695
|
+
} | {
|
|
1696
|
+
"method": "thread/started";
|
|
1697
|
+
"params": ThreadStartedNotification;
|
|
1698
|
+
} | {
|
|
1699
|
+
"method": "thread/status/changed";
|
|
1700
|
+
"params": ThreadStatusChangedNotification;
|
|
1701
|
+
} | {
|
|
1702
|
+
"method": "thread/archived";
|
|
1703
|
+
"params": ThreadArchivedNotification;
|
|
1704
|
+
} | {
|
|
1705
|
+
"method": "thread/unarchived";
|
|
1706
|
+
"params": ThreadUnarchivedNotification;
|
|
1707
|
+
} | {
|
|
1708
|
+
"method": "thread/closed";
|
|
1709
|
+
"params": ThreadClosedNotification;
|
|
1710
|
+
} | {
|
|
1711
|
+
"method": "skills/changed";
|
|
1712
|
+
"params": SkillsChangedNotification;
|
|
1713
|
+
} | {
|
|
1714
|
+
"method": "thread/name/updated";
|
|
1715
|
+
"params": ThreadNameUpdatedNotification;
|
|
1716
|
+
} | {
|
|
1717
|
+
"method": "thread/goal/updated";
|
|
1718
|
+
"params": ThreadGoalUpdatedNotification;
|
|
1719
|
+
} | {
|
|
1720
|
+
"method": "thread/goal/cleared";
|
|
1721
|
+
"params": ThreadGoalClearedNotification;
|
|
1722
|
+
} | {
|
|
1723
|
+
"method": "thread/tokenUsage/updated";
|
|
1724
|
+
"params": ThreadTokenUsageUpdatedNotification;
|
|
1725
|
+
} | {
|
|
1726
|
+
"method": "turn/started";
|
|
1727
|
+
"params": TurnStartedNotification;
|
|
1728
|
+
} | {
|
|
1729
|
+
"method": "hook/started";
|
|
1730
|
+
"params": HookStartedNotification;
|
|
1731
|
+
} | {
|
|
1732
|
+
"method": "turn/completed";
|
|
1733
|
+
"params": TurnCompletedNotification;
|
|
1734
|
+
} | {
|
|
1735
|
+
"method": "hook/completed";
|
|
1736
|
+
"params": HookCompletedNotification;
|
|
1737
|
+
} | {
|
|
1738
|
+
"method": "turn/diff/updated";
|
|
1739
|
+
"params": TurnDiffUpdatedNotification;
|
|
1740
|
+
} | {
|
|
1741
|
+
"method": "turn/plan/updated";
|
|
1742
|
+
"params": TurnPlanUpdatedNotification;
|
|
1743
|
+
} | {
|
|
1744
|
+
"method": "item/started";
|
|
1745
|
+
"params": ItemStartedNotification;
|
|
1746
|
+
} | {
|
|
1747
|
+
"method": "item/autoApprovalReview/started";
|
|
1748
|
+
"params": ItemGuardianApprovalReviewStartedNotification;
|
|
1749
|
+
} | {
|
|
1750
|
+
"method": "item/autoApprovalReview/completed";
|
|
1751
|
+
"params": ItemGuardianApprovalReviewCompletedNotification;
|
|
1752
|
+
} | {
|
|
1753
|
+
"method": "item/completed";
|
|
1754
|
+
"params": ItemCompletedNotification;
|
|
1755
|
+
} | {
|
|
1756
|
+
"method": "rawResponseItem/completed";
|
|
1757
|
+
"params": RawResponseItemCompletedNotification;
|
|
1758
|
+
} | {
|
|
1759
|
+
"method": "item/agentMessage/delta";
|
|
1760
|
+
"params": AgentMessageDeltaNotification;
|
|
1761
|
+
} | {
|
|
1762
|
+
"method": "item/plan/delta";
|
|
1763
|
+
"params": PlanDeltaNotification;
|
|
1764
|
+
} | {
|
|
1765
|
+
"method": "command/exec/outputDelta";
|
|
1766
|
+
"params": CommandExecOutputDeltaNotification;
|
|
1767
|
+
} | {
|
|
1768
|
+
"method": "process/outputDelta";
|
|
1769
|
+
"params": ProcessOutputDeltaNotification;
|
|
1770
|
+
} | {
|
|
1771
|
+
"method": "process/exited";
|
|
1772
|
+
"params": ProcessExitedNotification;
|
|
1773
|
+
} | {
|
|
1774
|
+
"method": "item/commandExecution/outputDelta";
|
|
1775
|
+
"params": CommandExecutionOutputDeltaNotification;
|
|
1776
|
+
} | {
|
|
1777
|
+
"method": "item/commandExecution/terminalInteraction";
|
|
1778
|
+
"params": TerminalInteractionNotification;
|
|
1779
|
+
} | {
|
|
1780
|
+
"method": "item/fileChange/outputDelta";
|
|
1781
|
+
"params": FileChangeOutputDeltaNotification;
|
|
1782
|
+
} | {
|
|
1783
|
+
"method": "item/fileChange/patchUpdated";
|
|
1784
|
+
"params": FileChangePatchUpdatedNotification;
|
|
1785
|
+
} | {
|
|
1786
|
+
"method": "serverRequest/resolved";
|
|
1787
|
+
"params": ServerRequestResolvedNotification;
|
|
1788
|
+
} | {
|
|
1789
|
+
"method": "item/mcpToolCall/progress";
|
|
1790
|
+
"params": McpToolCallProgressNotification;
|
|
1791
|
+
} | {
|
|
1792
|
+
"method": "mcpServer/oauthLogin/completed";
|
|
1793
|
+
"params": McpServerOauthLoginCompletedNotification;
|
|
1794
|
+
} | {
|
|
1795
|
+
"method": "mcpServer/startupStatus/updated";
|
|
1796
|
+
"params": McpServerStatusUpdatedNotification;
|
|
1797
|
+
} | {
|
|
1798
|
+
"method": "account/updated";
|
|
1799
|
+
"params": AccountUpdatedNotification;
|
|
1800
|
+
} | {
|
|
1801
|
+
"method": "account/rateLimits/updated";
|
|
1802
|
+
"params": AccountRateLimitsUpdatedNotification;
|
|
1803
|
+
} | {
|
|
1804
|
+
"method": "app/list/updated";
|
|
1805
|
+
"params": AppListUpdatedNotification;
|
|
1806
|
+
} | {
|
|
1807
|
+
"method": "remoteControl/status/changed";
|
|
1808
|
+
"params": RemoteControlStatusChangedNotification;
|
|
1809
|
+
} | {
|
|
1810
|
+
"method": "externalAgentConfig/import/completed";
|
|
1811
|
+
"params": ExternalAgentConfigImportCompletedNotification;
|
|
1812
|
+
} | {
|
|
1813
|
+
"method": "fs/changed";
|
|
1814
|
+
"params": FsChangedNotification;
|
|
1815
|
+
} | {
|
|
1816
|
+
"method": "item/reasoning/summaryTextDelta";
|
|
1817
|
+
"params": ReasoningSummaryTextDeltaNotification;
|
|
1818
|
+
} | {
|
|
1819
|
+
"method": "item/reasoning/summaryPartAdded";
|
|
1820
|
+
"params": ReasoningSummaryPartAddedNotification;
|
|
1821
|
+
} | {
|
|
1822
|
+
"method": "item/reasoning/textDelta";
|
|
1823
|
+
"params": ReasoningTextDeltaNotification;
|
|
1824
|
+
} | {
|
|
1825
|
+
"method": "thread/compacted";
|
|
1826
|
+
"params": ContextCompactedNotification;
|
|
1827
|
+
} | {
|
|
1828
|
+
"method": "model/rerouted";
|
|
1829
|
+
"params": ModelReroutedNotification;
|
|
1830
|
+
} | {
|
|
1831
|
+
"method": "model/verification";
|
|
1832
|
+
"params": ModelVerificationNotification;
|
|
1833
|
+
} | {
|
|
1834
|
+
"method": "warning";
|
|
1835
|
+
"params": WarningNotification;
|
|
1836
|
+
} | {
|
|
1837
|
+
"method": "guardianWarning";
|
|
1838
|
+
"params": GuardianWarningNotification;
|
|
1839
|
+
} | {
|
|
1840
|
+
"method": "deprecationNotice";
|
|
1841
|
+
"params": DeprecationNoticeNotification;
|
|
1842
|
+
} | {
|
|
1843
|
+
"method": "configWarning";
|
|
1844
|
+
"params": ConfigWarningNotification;
|
|
1845
|
+
} | {
|
|
1846
|
+
"method": "fuzzyFileSearch/sessionUpdated";
|
|
1847
|
+
"params": FuzzyFileSearchSessionUpdatedNotification;
|
|
1848
|
+
} | {
|
|
1849
|
+
"method": "fuzzyFileSearch/sessionCompleted";
|
|
1850
|
+
"params": FuzzyFileSearchSessionCompletedNotification;
|
|
1851
|
+
} | {
|
|
1852
|
+
"method": "thread/realtime/started";
|
|
1853
|
+
"params": ThreadRealtimeStartedNotification;
|
|
1854
|
+
} | {
|
|
1855
|
+
"method": "thread/realtime/itemAdded";
|
|
1856
|
+
"params": ThreadRealtimeItemAddedNotification;
|
|
1857
|
+
} | {
|
|
1858
|
+
"method": "thread/realtime/transcript/delta";
|
|
1859
|
+
"params": ThreadRealtimeTranscriptDeltaNotification;
|
|
1860
|
+
} | {
|
|
1861
|
+
"method": "thread/realtime/transcript/done";
|
|
1862
|
+
"params": ThreadRealtimeTranscriptDoneNotification;
|
|
1863
|
+
} | {
|
|
1864
|
+
"method": "thread/realtime/outputAudio/delta";
|
|
1865
|
+
"params": ThreadRealtimeOutputAudioDeltaNotification;
|
|
1866
|
+
} | {
|
|
1867
|
+
"method": "thread/realtime/sdp";
|
|
1868
|
+
"params": ThreadRealtimeSdpNotification;
|
|
1869
|
+
} | {
|
|
1870
|
+
"method": "thread/realtime/error";
|
|
1871
|
+
"params": ThreadRealtimeErrorNotification;
|
|
1872
|
+
} | {
|
|
1873
|
+
"method": "thread/realtime/closed";
|
|
1874
|
+
"params": ThreadRealtimeClosedNotification;
|
|
1875
|
+
} | {
|
|
1876
|
+
"method": "windows/worldWritableWarning";
|
|
1877
|
+
"params": WindowsWorldWritableWarningNotification;
|
|
1878
|
+
} | {
|
|
1879
|
+
"method": "windowsSandbox/setupCompleted";
|
|
1880
|
+
"params": WindowsSandboxSetupCompletedNotification;
|
|
1881
|
+
} | {
|
|
1882
|
+
"method": "account/login/completed";
|
|
1883
|
+
"params": AccountLoginCompletedNotification;
|
|
1884
|
+
};
|
|
1885
|
+
|
|
1886
|
+
type ChatgptAuthTokensRefreshReason = "unauthorized";
|
|
1887
|
+
|
|
1888
|
+
type ChatgptAuthTokensRefreshParams = {
|
|
1889
|
+
reason: ChatgptAuthTokensRefreshReason;
|
|
1890
|
+
/**
|
|
1891
|
+
* Workspace/account identifier that Codex was previously using.
|
|
1892
|
+
*
|
|
1893
|
+
* Clients that manage multiple accounts/workspaces can use this as a hint
|
|
1894
|
+
* to refresh the token for the correct workspace.
|
|
1895
|
+
*
|
|
1896
|
+
* This may be `null` when the prior auth state did not include a workspace
|
|
1897
|
+
* identifier (`chatgpt_account_id`).
|
|
1898
|
+
*/
|
|
1899
|
+
previousAccountId?: string | null;
|
|
1900
|
+
};
|
|
1901
|
+
|
|
1902
|
+
type ExecPolicyAmendment = Array<string>;
|
|
1903
|
+
|
|
1904
|
+
type NetworkApprovalContext = {
|
|
1905
|
+
host: string;
|
|
1906
|
+
protocol: NetworkApprovalProtocol;
|
|
1907
|
+
};
|
|
1908
|
+
|
|
1909
|
+
type NetworkPolicyRuleAction = "allow" | "deny";
|
|
1910
|
+
|
|
1911
|
+
type NetworkPolicyAmendment = {
|
|
1912
|
+
host: string;
|
|
1913
|
+
action: NetworkPolicyRuleAction;
|
|
1914
|
+
};
|
|
1915
|
+
|
|
1916
|
+
type CommandExecutionRequestApprovalParams = {
|
|
1917
|
+
threadId: string;
|
|
1918
|
+
turnId: string;
|
|
1919
|
+
itemId: string; /**
|
|
1920
|
+
* Unique identifier for this specific approval callback.
|
|
1921
|
+
*
|
|
1922
|
+
* For regular shell/unified_exec approvals, this is null.
|
|
1923
|
+
*
|
|
1924
|
+
* For zsh-exec-bridge subcommand approvals, multiple callbacks can belong to
|
|
1925
|
+
* one parent `itemId`, so `approvalId` is a distinct opaque callback id
|
|
1926
|
+
* (a UUID) used to disambiguate routing.
|
|
1927
|
+
*/
|
|
1928
|
+
approvalId?: string | null; /**
|
|
1929
|
+
* Optional explanatory reason (e.g. request for network access).
|
|
1930
|
+
*/
|
|
1931
|
+
reason?: string | null; /**
|
|
1932
|
+
* Optional context for a managed-network approval prompt.
|
|
1933
|
+
*/
|
|
1934
|
+
networkApprovalContext?: NetworkApprovalContext | null; /**
|
|
1935
|
+
* The command to be executed.
|
|
1936
|
+
*/
|
|
1937
|
+
command?: string | null; /**
|
|
1938
|
+
* The command's working directory.
|
|
1939
|
+
*/
|
|
1940
|
+
cwd?: AbsolutePathBuf | null; /**
|
|
1941
|
+
* Best-effort parsed command actions for friendly display.
|
|
1942
|
+
*/
|
|
1943
|
+
commandActions?: Array<CommandAction> | null; /**
|
|
1944
|
+
* Optional proposed execpolicy amendment to allow similar commands without prompting.
|
|
1945
|
+
*/
|
|
1946
|
+
proposedExecpolicyAmendment?: ExecPolicyAmendment | null; /**
|
|
1947
|
+
* Optional proposed network policy amendments (allow/deny host) for future requests.
|
|
1948
|
+
*/
|
|
1949
|
+
proposedNetworkPolicyAmendments?: Array<NetworkPolicyAmendment> | null;
|
|
1950
|
+
};
|
|
1951
|
+
|
|
1952
|
+
type DynamicToolCallParams = {
|
|
1953
|
+
threadId: string;
|
|
1954
|
+
turnId: string;
|
|
1955
|
+
callId: string;
|
|
1956
|
+
namespace: string | null;
|
|
1957
|
+
tool: string;
|
|
1958
|
+
arguments: JsonValue;
|
|
1959
|
+
};
|
|
1960
|
+
|
|
1961
|
+
type FileChangeRequestApprovalParams = {
|
|
1962
|
+
threadId: string;
|
|
1963
|
+
turnId: string;
|
|
1964
|
+
itemId: string;
|
|
1965
|
+
/**
|
|
1966
|
+
* Optional explanatory reason (e.g. request for extra write access).
|
|
1967
|
+
*/
|
|
1968
|
+
reason?: string | null;
|
|
1969
|
+
/**
|
|
1970
|
+
* [UNSTABLE] When set, the agent is asking the user to allow writes under this root
|
|
1971
|
+
* for the remainder of the session (unclear if this is honored today).
|
|
1972
|
+
*/
|
|
1973
|
+
grantRoot?: string | null;
|
|
1974
|
+
};
|
|
1975
|
+
|
|
1976
|
+
type McpElicitationObjectType = "object";
|
|
1977
|
+
|
|
1978
|
+
type McpElicitationBooleanType = "boolean";
|
|
1979
|
+
|
|
1980
|
+
type McpElicitationBooleanSchema = {
|
|
1981
|
+
type: McpElicitationBooleanType;
|
|
1982
|
+
title?: string;
|
|
1983
|
+
description?: string;
|
|
1984
|
+
default?: boolean;
|
|
1985
|
+
};
|
|
1986
|
+
|
|
1987
|
+
type McpElicitationStringType = "string";
|
|
1988
|
+
|
|
1989
|
+
type McpElicitationLegacyTitledEnumSchema = {
|
|
1990
|
+
type: McpElicitationStringType;
|
|
1991
|
+
title?: string;
|
|
1992
|
+
description?: string;
|
|
1993
|
+
enum: Array<string>;
|
|
1994
|
+
enumNames?: Array<string>;
|
|
1995
|
+
default?: string;
|
|
1996
|
+
};
|
|
1997
|
+
|
|
1998
|
+
type McpElicitationArrayType = "array";
|
|
1999
|
+
|
|
2000
|
+
type McpElicitationConstOption = {
|
|
2001
|
+
const: string;
|
|
2002
|
+
title: string;
|
|
2003
|
+
};
|
|
2004
|
+
|
|
2005
|
+
type McpElicitationTitledEnumItems = {
|
|
2006
|
+
anyOf: Array<McpElicitationConstOption>;
|
|
2007
|
+
};
|
|
2008
|
+
|
|
2009
|
+
type McpElicitationTitledMultiSelectEnumSchema = {
|
|
2010
|
+
type: McpElicitationArrayType;
|
|
2011
|
+
title?: string;
|
|
2012
|
+
description?: string;
|
|
2013
|
+
minItems?: bigint;
|
|
2014
|
+
maxItems?: bigint;
|
|
2015
|
+
items: McpElicitationTitledEnumItems;
|
|
2016
|
+
default?: Array<string>;
|
|
2017
|
+
};
|
|
2018
|
+
|
|
2019
|
+
type McpElicitationUntitledEnumItems = {
|
|
2020
|
+
type: McpElicitationStringType;
|
|
2021
|
+
enum: Array<string>;
|
|
2022
|
+
};
|
|
2023
|
+
|
|
2024
|
+
type McpElicitationUntitledMultiSelectEnumSchema = {
|
|
2025
|
+
type: McpElicitationArrayType;
|
|
2026
|
+
title?: string;
|
|
2027
|
+
description?: string;
|
|
2028
|
+
minItems?: bigint;
|
|
2029
|
+
maxItems?: bigint;
|
|
2030
|
+
items: McpElicitationUntitledEnumItems;
|
|
2031
|
+
default?: Array<string>;
|
|
2032
|
+
};
|
|
2033
|
+
|
|
2034
|
+
type McpElicitationMultiSelectEnumSchema = McpElicitationUntitledMultiSelectEnumSchema | McpElicitationTitledMultiSelectEnumSchema;
|
|
2035
|
+
|
|
2036
|
+
type McpElicitationTitledSingleSelectEnumSchema = {
|
|
2037
|
+
type: McpElicitationStringType;
|
|
2038
|
+
title?: string;
|
|
2039
|
+
description?: string;
|
|
2040
|
+
oneOf: Array<McpElicitationConstOption>;
|
|
2041
|
+
default?: string;
|
|
2042
|
+
};
|
|
2043
|
+
|
|
2044
|
+
type McpElicitationUntitledSingleSelectEnumSchema = {
|
|
2045
|
+
type: McpElicitationStringType;
|
|
2046
|
+
title?: string;
|
|
2047
|
+
description?: string;
|
|
2048
|
+
enum: Array<string>;
|
|
2049
|
+
default?: string;
|
|
2050
|
+
};
|
|
2051
|
+
|
|
2052
|
+
type McpElicitationSingleSelectEnumSchema = McpElicitationUntitledSingleSelectEnumSchema | McpElicitationTitledSingleSelectEnumSchema;
|
|
2053
|
+
|
|
2054
|
+
type McpElicitationEnumSchema = McpElicitationSingleSelectEnumSchema | McpElicitationMultiSelectEnumSchema | McpElicitationLegacyTitledEnumSchema;
|
|
2055
|
+
|
|
2056
|
+
type McpElicitationNumberType = "number" | "integer";
|
|
2057
|
+
|
|
2058
|
+
type McpElicitationNumberSchema = {
|
|
2059
|
+
type: McpElicitationNumberType;
|
|
2060
|
+
title?: string;
|
|
2061
|
+
description?: string;
|
|
2062
|
+
minimum?: number;
|
|
2063
|
+
maximum?: number;
|
|
2064
|
+
default?: number;
|
|
2065
|
+
};
|
|
2066
|
+
|
|
2067
|
+
type McpElicitationStringFormat = "email" | "uri" | "date" | "date-time";
|
|
2068
|
+
|
|
2069
|
+
type McpElicitationStringSchema = {
|
|
2070
|
+
type: McpElicitationStringType;
|
|
2071
|
+
title?: string;
|
|
2072
|
+
description?: string;
|
|
2073
|
+
minLength?: number;
|
|
2074
|
+
maxLength?: number;
|
|
2075
|
+
format?: McpElicitationStringFormat;
|
|
2076
|
+
default?: string;
|
|
2077
|
+
};
|
|
2078
|
+
|
|
2079
|
+
type McpElicitationPrimitiveSchema = McpElicitationEnumSchema | McpElicitationStringSchema | McpElicitationNumberSchema | McpElicitationBooleanSchema;
|
|
2080
|
+
|
|
2081
|
+
/**
|
|
2082
|
+
* Typed form schema for MCP `elicitation/create` requests.
|
|
2083
|
+
*
|
|
2084
|
+
* This matches the `requestedSchema` shape from the MCP 2025-11-25
|
|
2085
|
+
* `ElicitRequestFormParams` schema.
|
|
2086
|
+
*/
|
|
2087
|
+
type McpElicitationSchema = {
|
|
2088
|
+
$schema?: string;
|
|
2089
|
+
type: McpElicitationObjectType;
|
|
2090
|
+
properties: {
|
|
2091
|
+
[key in string]?: McpElicitationPrimitiveSchema;
|
|
2092
|
+
};
|
|
2093
|
+
required?: Array<string>;
|
|
2094
|
+
};
|
|
2095
|
+
|
|
2096
|
+
type McpServerElicitationRequestParams = {
|
|
2097
|
+
threadId: string;
|
|
2098
|
+
/**
|
|
2099
|
+
* Active Codex turn when this elicitation was observed, if app-server could correlate one.
|
|
2100
|
+
*
|
|
2101
|
+
* This is nullable because MCP models elicitation as a standalone server-to-client request
|
|
2102
|
+
* identified by the MCP server request id. It may be triggered during a turn, but turn
|
|
2103
|
+
* context is app-server correlation rather than part of the protocol identity of the
|
|
2104
|
+
* elicitation itself.
|
|
2105
|
+
*/
|
|
2106
|
+
turnId: string | null;
|
|
2107
|
+
serverName: string;
|
|
2108
|
+
} & ({
|
|
2109
|
+
"mode": "form";
|
|
2110
|
+
_meta: JsonValue | null;
|
|
2111
|
+
message: string;
|
|
2112
|
+
requestedSchema: McpElicitationSchema;
|
|
2113
|
+
} | {
|
|
2114
|
+
"mode": "url";
|
|
2115
|
+
_meta: JsonValue | null;
|
|
2116
|
+
message: string;
|
|
2117
|
+
url: string;
|
|
2118
|
+
elicitationId: string;
|
|
2119
|
+
});
|
|
2120
|
+
|
|
2121
|
+
type PermissionsRequestApprovalParams = {
|
|
2122
|
+
threadId: string;
|
|
2123
|
+
turnId: string;
|
|
2124
|
+
itemId: string;
|
|
2125
|
+
cwd: AbsolutePathBuf;
|
|
2126
|
+
reason: string | null;
|
|
2127
|
+
permissions: RequestPermissionProfile;
|
|
2128
|
+
};
|
|
2129
|
+
|
|
2130
|
+
/**
|
|
2131
|
+
* EXPERIMENTAL. Params sent with a request_user_input event.
|
|
2132
|
+
*/
|
|
2133
|
+
type ToolRequestUserInputParams = {
|
|
2134
|
+
threadId: string;
|
|
2135
|
+
turnId: string;
|
|
2136
|
+
itemId: string;
|
|
2137
|
+
questions: Array<ToolRequestUserInputQuestion>;
|
|
2138
|
+
};
|
|
2139
|
+
|
|
2140
|
+
/**
|
|
2141
|
+
* Request initiated from the server and sent to the client.
|
|
2142
|
+
*/
|
|
2143
|
+
type ServerRequest = {
|
|
2144
|
+
"method": "item/commandExecution/requestApproval";
|
|
2145
|
+
id: RequestId;
|
|
2146
|
+
params: CommandExecutionRequestApprovalParams;
|
|
2147
|
+
} | {
|
|
2148
|
+
"method": "item/fileChange/requestApproval";
|
|
2149
|
+
id: RequestId;
|
|
2150
|
+
params: FileChangeRequestApprovalParams;
|
|
2151
|
+
} | {
|
|
2152
|
+
"method": "item/tool/requestUserInput";
|
|
2153
|
+
id: RequestId;
|
|
2154
|
+
params: ToolRequestUserInputParams;
|
|
2155
|
+
} | {
|
|
2156
|
+
"method": "mcpServer/elicitation/request";
|
|
2157
|
+
id: RequestId;
|
|
2158
|
+
params: McpServerElicitationRequestParams;
|
|
2159
|
+
} | {
|
|
2160
|
+
"method": "item/permissions/requestApproval";
|
|
2161
|
+
id: RequestId;
|
|
2162
|
+
params: PermissionsRequestApprovalParams;
|
|
2163
|
+
} | {
|
|
2164
|
+
"method": "item/tool/call";
|
|
2165
|
+
id: RequestId;
|
|
2166
|
+
params: DynamicToolCallParams;
|
|
2167
|
+
} | {
|
|
2168
|
+
"method": "account/chatgptAuthTokens/refresh";
|
|
2169
|
+
id: RequestId;
|
|
2170
|
+
params: ChatgptAuthTokensRefreshParams;
|
|
2171
|
+
} | {
|
|
2172
|
+
"method": "applyPatchApproval";
|
|
2173
|
+
id: RequestId;
|
|
2174
|
+
params: ApplyPatchApprovalParams;
|
|
2175
|
+
} | {
|
|
2176
|
+
"method": "execCommandApproval";
|
|
2177
|
+
id: RequestId;
|
|
2178
|
+
params: ExecCommandApprovalParams;
|
|
2179
|
+
};
|
|
2180
|
+
|
|
2181
|
+
export type { CommandExecutionStatus as $, AdditionalNetworkPermissions as A, ByteRange as B, ChatgptAuthTokensRefreshParams as C, DynamicToolCallParams as D, ExecPolicyAmendment as E, FuzzyFileSearchResult as F, ChatgptAuthTokensRefreshReason as G, HookEventName as H, CodexErrorInfo as I, JsonValue as J, CollabAgentState as K, CollabAgentStatus as L, CollabAgentTool as M, NetworkPolicyAmendment as N, CollabAgentToolCallStatus as O, PlanType as P, CommandAction as Q, RateLimitSnapshot as R, ServerNotification as S, Thread as T, UserInput as U, CommandExecOutputDeltaNotification as V, WindowsSandboxSetupMode as W, CommandExecOutputStream as X, CommandExecutionOutputDeltaNotification as Y, CommandExecutionRequestApprovalParams as Z, CommandExecutionSource as _, ServerRequest as a, McpToolCallProgressNotification as a$, ConfigWarningNotification as a0, ContextCompactedNotification as a1, CreditsSnapshot as a2, DeprecationNoticeNotification as a3, DynamicToolCallStatus as a4, ErrorNotification as a5, ExternalAgentConfigImportCompletedNotification as a6, FileChangeOutputDeltaNotification as a7, FileChangePatchUpdatedNotification as a8, FileChangeRequestApprovalParams as a9, McpElicitationArrayType as aA, McpElicitationBooleanSchema as aB, McpElicitationBooleanType as aC, McpElicitationConstOption as aD, McpElicitationEnumSchema as aE, McpElicitationLegacyTitledEnumSchema as aF, McpElicitationMultiSelectEnumSchema as aG, McpElicitationNumberSchema as aH, McpElicitationNumberType as aI, McpElicitationObjectType as aJ, McpElicitationPrimitiveSchema as aK, McpElicitationSchema as aL, McpElicitationSingleSelectEnumSchema as aM, McpElicitationStringFormat as aN, McpElicitationStringSchema as aO, McpElicitationStringType as aP, McpElicitationTitledEnumItems as aQ, McpElicitationTitledMultiSelectEnumSchema as aR, McpElicitationTitledSingleSelectEnumSchema as aS, McpElicitationUntitledEnumItems as aT, McpElicitationUntitledMultiSelectEnumSchema as aU, McpElicitationUntitledSingleSelectEnumSchema as aV, McpServerElicitationRequestParams as aW, McpServerOauthLoginCompletedNotification as aX, McpServerStartupState as aY, McpServerStatusUpdatedNotification as aZ, McpToolCallError as a_, FileSystemAccessMode as aa, FileSystemPath as ab, FileSystemSpecialPath as ac, FileUpdateChange as ad, FsChangedNotification as ae, GitInfo as af, GuardianApprovalReview as ag, GuardianApprovalReviewAction as ah, GuardianApprovalReviewStatus as ai, GuardianCommandSource as aj, GuardianRiskLevel as ak, GuardianUserAuthorization as al, GuardianWarningNotification as am, HookCompletedNotification as an, HookExecutionMode as ao, HookOutputEntry as ap, HookOutputEntryKind as aq, HookPromptFragment as ar, HookRunStatus as as, HookRunSummary as at, HookScope as au, HookStartedNotification as av, ItemCompletedNotification as aw, ItemGuardianApprovalReviewCompletedNotification as ax, ItemGuardianApprovalReviewStartedNotification as ay, ItemStartedNotification as az, ThreadItem as b, TurnPlanStep as b$, McpToolCallResult as b0, McpToolCallStatus as b1, MemoryCitation as b2, MemoryCitationEntry as b3, ModelRerouteReason as b4, ModelReroutedNotification as b5, ModelVerification as b6, ModelVerificationNotification as b7, NetworkApprovalContext as b8, NetworkApprovalProtocol as b9, ThreadArchivedNotification as bA, ThreadClosedNotification as bB, ThreadGoal as bC, ThreadGoalClearedNotification as bD, ThreadGoalStatus as bE, ThreadGoalUpdatedNotification as bF, ThreadNameUpdatedNotification as bG, ThreadRealtimeAudioChunk as bH, ThreadRealtimeClosedNotification as bI, ThreadRealtimeErrorNotification as bJ, ThreadRealtimeItemAddedNotification as bK, ThreadRealtimeOutputAudioDeltaNotification as bL, ThreadRealtimeSdpNotification as bM, ThreadRealtimeStartedNotification as bN, ThreadRealtimeTranscriptDeltaNotification as bO, ThreadRealtimeTranscriptDoneNotification as bP, ThreadStartedNotification as bQ, ThreadStatus as bR, ThreadStatusChangedNotification as bS, ThreadTokenUsageUpdatedNotification as bT, ThreadUnarchivedNotification as bU, TokenUsageBreakdown as bV, ToolRequestUserInputParams as bW, TurnCompletedNotification as bX, TurnDiffUpdatedNotification as bY, TurnError as bZ, TurnItemsView as b_, NetworkPolicyRuleAction as ba, NonSteerableTurnKind as bb, PatchApplyStatus as bc, PatchChangeKind as bd, PermissionsRequestApprovalParams as be, PlanDeltaNotification as bf, ProcessExitedNotification as bg, ProcessOutputDeltaNotification as bh, ProcessOutputStream as bi, RateLimitReachedType as bj, RateLimitWindow as bk, RawResponseItemCompletedNotification as bl, ReasoningSummaryPartAddedNotification as bm, ReasoningSummaryTextDeltaNotification as bn, ReasoningTextDeltaNotification as bo, RemoteControlConnectionStatus as bp, RemoteControlStatusChangedNotification as bq, RequestPermissionProfile as br, ServerRequestResolvedNotification as bs, SessionSource as bt, SkillsChangedNotification as bu, TerminalInteractionNotification as bv, TextElement as bw, TextPosition as bx, TextRange as by, ThreadActiveFlag as bz, Turn as c, TurnPlanStepStatus as c0, TurnPlanUpdatedNotification as c1, TurnStartedNotification as c2, TurnStatus as c3, WarningNotification as c4, WebSearchAction as c5, WindowsSandboxSetupCompletedNotification as c6, WindowsWorldWritableWarningNotification as c7, AgentPath as c8, ApplyPatchApprovalParams as c9, ContentItem as ca, ExecCommandApprovalParams as cb, FileChange as cc, FunctionCallOutputBody as cd, FunctionCallOutputContentItem as ce, FuzzyFileSearchMatchType as cf, FuzzyFileSearchSessionCompletedNotification as cg, FuzzyFileSearchSessionUpdatedNotification as ch, ImageDetail as ci, LocalShellAction as cj, LocalShellExecAction as ck, LocalShellStatus as cl, MessagePhase as cm, ParsedCommand as cn, RealtimeConversationVersion as co, ReasoningItemContent as cp, ReasoningItemReasoningSummary as cq, ResponseItem as cr, WebSearchAction$1 as cs, ThreadTokenUsage as d, DynamicToolCallOutputContentItem as e, ReasoningEffort as f, AdditionalFileSystemPermissions as g, AbsolutePathBuf as h, ThreadId as i, ThreadSource as j, SubAgentSource as k, AuthMode as l, AppInfo as m, HookHandlerType as n, HookSource as o, FileSystemSandboxEntry as p, AccountLoginCompletedNotification as q, AccountRateLimitsUpdatedNotification as r, AccountUpdatedNotification as s, AgentMessageDeltaNotification as t, AppBranding as u, AppListUpdatedNotification as v, AppMetadata as w, AppReview as x, AppScreenshot as y, AutoReviewDecisionSource as z };
|