@jrkropp/codex-js 0.1.1 → 0.1.2
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 +4 -0
- package/dist/{chat-runtime-CMli5dzJ.d.ts → chat-runtime-D7wu_KbX.d.ts} +3 -4
- package/dist/{chunk-FFASNDXU.js → chunk-JLDH4U5L.js} +3 -3
- package/dist/{chunk-FFASNDXU.js.map → chunk-JLDH4U5L.js.map} +1 -1
- package/dist/{chunk-TZBLUZ2X.js → chunk-SVK6PLGO.js} +4300 -2426
- package/dist/chunk-SVK6PLGO.js.map +1 -0
- package/dist/client/index.d.ts +4 -111
- package/dist/client/index.js +1 -1
- package/dist/index-CB9la6xE.d.ts +112 -0
- package/dist/index.d.ts +5 -6
- package/dist/index.js +2 -2
- package/dist/react/index.d.ts +5 -6
- package/dist/react/index.js +2 -2
- package/dist/{remote-DMPfepa9.d.ts → remote-_6TDvg-g.d.ts} +1 -1
- package/dist/server/index.d.ts +449 -32
- package/dist/server/index.js +1 -1
- package/dist/{session-BO6EZNK7.d.ts → session-DPhHN7RZ.d.ts} +18 -2
- package/dist/{store-H2cQxdpe.d.ts → store-GYldc9EJ.d.ts} +1 -1
- package/dist/testing/index.d.ts +3 -3
- package/dist/testing/index.js +1 -1
- package/dist/{thread_event_store-BIS0qzhi.d.ts → thread_event_store-B9CoQUIA.d.ts} +26 -1
- package/package.json +88 -88
- package/dist/DynamicToolCallResponse-D2OVpa4p.d.ts +0 -8
- package/dist/ToolRequestUserInputResponse-Bxjlpgho.d.ts +0 -17
- package/dist/chunk-TZBLUZ2X.js.map +0 -1
package/dist/server/index.d.ts
CHANGED
|
@@ -1,15 +1,33 @@
|
|
|
1
|
-
import { J as JsonValue, M as McpServerRefreshConfig,
|
|
2
|
-
export { aH as ThreadEventPersistenceMode,
|
|
3
|
-
import { c as ClientRequest,
|
|
4
|
-
export {
|
|
5
|
-
export { D as DynamicToolCallResponse } from '../
|
|
6
|
-
import { T as ThreadStore } from '../store-
|
|
1
|
+
import { s as ReasoningEffort, J as JsonValue, M as McpServerRefreshConfig, t as McpRuntimeEnvironment$1, u as McpServerStatusListOptions, v as McpServerStatus, w as McpResourceListParams, x as McpResourceListResponse, y as McpResourceTemplateListResponse, z as McpResourceReadParams, B as McpResourceReadResponse, E as McpServerToolCallParams, F as McpServerToolCallResponse, G as McpToolInfo, H as McpRequestId, I as McpServerElicitationResponse, K as McpResourceInfo, N as McpResourceTemplateInfo, T as ThreadId, C as CreateThreadParams, R as ResumeThreadParams, O as RolloutItem, b as StoredThreadHistory, d as StoredThread, P as ThreadMemoryMode, Q as ThreadMetadataPatch, V as CollaborationModeMask, W as ModeKind$1, o as CollaborationMode$1, j as RequestId$1, a as ServerRequest, S as ServerNotification, X as ServiceTier, Y as ReasoningEffortConfig, Z as ReasoningSummaryConfig, _ as Personality, $ as AskForApproval, a0 as ApprovalsReviewer, a1 as SandboxPolicy, a2 as PermissionProfile, a3 as ActivePermissionProfile, a4 as WindowsSandboxLevel, a5 as BaseInstructions, a6 as SessionSource, a7 as TurnEnvironmentSelection, a8 as DynamicToolSpec$1, a9 as TruncationPolicy, aa as ThreadGoal, ab as ThreadGoalStatus, ac as HookEventName, ad as HookSource, ae as HookRunStatus, af as HookOutputEntry, ag as HookRunSummary, ah as HookCompletedEvent, l as UserInput, ai as TokenUsage, aj as RequestUserInputResponse, ak as DynamicToolResponse, al as RequestPermissionsResponse, am as RequestPermissionProfile, an as EventMsg, ao as Op, ap as Submission, aq as NormalizedRequestUserInputArgs, ar as RequestPermissionsArgs, as as McpServerElicitationRequest, at as CompactedItem, au as ResponseItem, av as RateLimitSnapshot, aw as TokenUsageInfo, ax as TurnContextItem, ay as W3cTraceContext } from '../thread_event_store-B9CoQUIA.js';
|
|
2
|
+
export { A as AppendThreadItemsParams, h as ArchiveThreadParams, az as DynamicToolCallParams, aA as DynamicToolSpecWire, f as ListThreadsParams, L as LoadThreadHistoryParams, e as ReadThreadByRolloutPathParams, c as ReadThreadParams, aB as RealtimeEvent, aC as RenderedThreadConnectionStatus, aD as RenderedThreadState, aE as ServerNotificationThreadTarget, aF as SortDirection, aG as TUI_VISIBLE_COLLABORATION_MODES, aH as Thread, aI as ThreadBufferedEvent, aJ as ThreadEventPersistenceMode, p as ThreadEventSnapshot, aK as ThreadEventStore, aL as ThreadHistoryBuilder, aM as ThreadItem, g as ThreadPage, aN as ThreadPersistenceMetadata, aO as ThreadSortKey, aP as ThreadTokenUsageSnapshot, aQ as Turn, U as UpdateThreadMetadataParams, aR as UserInput, aS as allowsRequestUserInput, aT as applyCollaborationModeMask, aU as applyEventMsgToRenderedThread, aV as asThreadId, aW as collaborationModeForModel, aX as collaborationModeWithUpdates, aY as createRenderedThreadState, aZ as deniedRequestPermissionsResponse, a_ as renderThreadFromHistory, a$ as serverNotificationThreadTarget, b0 as serverRequestThreadId, b1 as setRenderedThreadConnectionStatus, b2 as threadEventSnapshotHasStarted } from '../thread_event_store-B9CoQUIA.js';
|
|
3
|
+
import { M as ModeKind, c as ClientRequest, d as CollaborationModeListParams, e as CollaborationModeListResponse, I as InitializeParams, f as InitializeResponse, g as McpServerRefreshResponse, h as McpResourceReadParams$1, i as McpResourceReadResponse$1, j as McpServerOauthLoginParams, k as McpServerOauthLoginResponse, L as ListMcpServerStatusParams, l as ListMcpServerStatusResponse, m as McpServerToolCallParams$1, n as McpServerToolCallResponse$1, o as ThreadArchiveParams, p as ThreadArchiveResponse, q as ThreadCompactStartParams, r as ThreadCompactStartResponse, s as ThreadListParams, t as ThreadListResponse, u as ThreadMetadataUpdateParams, v as ThreadMetadataUpdateResponse, w as ThreadSetNameParams, x as ThreadSetNameResponse, y as ThreadReadParams, z as ThreadReadResponse, B as ThreadResumeParams, D as ThreadResumeResponse, a as ThreadStartParams, E as ThreadStartResponse, F as ThreadUnarchiveParams, G as ThreadUnarchiveResponse, H as TurnInterruptParams, K as TurnInterruptResponse, b as TurnStartParams, N as TurnStartResponse, O as TurnSteerParams, P as TurnSteerResponse, A as AppServerEvent$1, J as JSONRPCErrorError$1, R as Result$1 } from '../session-DPhHN7RZ.js';
|
|
4
|
+
export { Q as AppServerCollaborationModeMask, S as AppServerMcpServerStatus, U as AppServerRequestHandle, V as AppServerSession, C as CodexAppServer, T as ToolRequestUserInputResponse, W as TypedRequestError, X as requestMethodName, Y as requestTyped, Z as serverNotificationRequiresDelivery } from '../session-DPhHN7RZ.js';
|
|
5
|
+
export { A as AppServerRequestResolution, C as CommandExecutionRequestApprovalResponse, D as DynamicToolCallResponse, F as FileChangeRequestApprovalResponse, M as McpServerElicitationRequestResponse, P as PendingAppServerRequests, a as PermissionsRequestApprovalResponse, R as ResolvedAppServerRequest, U as UnsupportedAppServerRequest } from '../index-CB9la6xE.js';
|
|
6
|
+
import { T as ThreadStore } from '../store-GYldc9EJ.js';
|
|
7
|
+
export { a as CodexAppServerClientConnectionStatus, C as CodexAppServerClientOptions, b as CodexAppServerClientTransportError, c as createCodexAppServerClient, p as parseCodexAppServerEvent } from '../remote-_6TDvg-g.js';
|
|
7
8
|
export { InMemoryThreadStore, InMemoryThreadStoreCalls, LocalThreadStore, LocalThreadStoreConfig } from '../testing/index.js';
|
|
8
9
|
|
|
9
10
|
type ClientNotification = {
|
|
10
11
|
"method": "initialized";
|
|
11
12
|
};
|
|
12
13
|
|
|
14
|
+
/**
|
|
15
|
+
* Settings for a collaboration mode.
|
|
16
|
+
*/
|
|
17
|
+
type Settings = {
|
|
18
|
+
model: string;
|
|
19
|
+
reasoning_effort: ReasoningEffort | null;
|
|
20
|
+
developer_instructions: string | null;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Collaboration mode for a Codex session.
|
|
25
|
+
*/
|
|
26
|
+
type CollaborationMode = {
|
|
27
|
+
mode: ModeKind;
|
|
28
|
+
settings: Settings;
|
|
29
|
+
};
|
|
30
|
+
|
|
13
31
|
type WebSearchContextSize = "low" | "medium" | "high";
|
|
14
32
|
|
|
15
33
|
type WebSearchLocation = {
|
|
@@ -86,8 +104,346 @@ type ToolSpec = LoadableToolSpec | {
|
|
|
86
104
|
type: "custom";
|
|
87
105
|
});
|
|
88
106
|
|
|
107
|
+
type ToolInfo = {
|
|
108
|
+
server_name: string;
|
|
109
|
+
name: string;
|
|
110
|
+
callable_name?: string | null;
|
|
111
|
+
callable_namespace?: string | null;
|
|
112
|
+
namespace_description?: string | null;
|
|
113
|
+
title?: string | null;
|
|
114
|
+
description?: string | null;
|
|
115
|
+
input_schema?: unknown;
|
|
116
|
+
meta?: unknown;
|
|
117
|
+
connector_id?: string | null;
|
|
118
|
+
connector_name?: string | null;
|
|
119
|
+
plugin_display_names?: string[];
|
|
120
|
+
source_label?: string | null;
|
|
121
|
+
mcp_app_resource_uri?: string | null;
|
|
122
|
+
};
|
|
123
|
+
declare class ToolFilter {
|
|
124
|
+
readonly enabled: ReadonlySet<string> | null;
|
|
125
|
+
readonly disabled: ReadonlySet<string>;
|
|
126
|
+
constructor(enabled?: ReadonlySet<string> | null, disabled?: ReadonlySet<string>);
|
|
127
|
+
static from_config(config: {
|
|
128
|
+
enabled_tools?: readonly string[] | null;
|
|
129
|
+
disabled_tools?: readonly string[] | null;
|
|
130
|
+
}): ToolFilter;
|
|
131
|
+
allows(toolName: string): boolean;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
type CodexAppsToolsCacheKey = {
|
|
135
|
+
account_id?: string | null;
|
|
136
|
+
chatgpt_user_id?: string | null;
|
|
137
|
+
is_workspace_account: boolean;
|
|
138
|
+
};
|
|
139
|
+
type CodexAppsToolsCacheStorage = {
|
|
140
|
+
read(path: string): string | Uint8Array | null | undefined;
|
|
141
|
+
write(path: string, bytes: string): void;
|
|
142
|
+
};
|
|
143
|
+
declare class CodexAppsToolsCacheContext {
|
|
144
|
+
readonly codex_home: string;
|
|
145
|
+
readonly user_key: CodexAppsToolsCacheKey;
|
|
146
|
+
readonly storage: CodexAppsToolsCacheStorage | null;
|
|
147
|
+
constructor(codex_home: string, user_key: CodexAppsToolsCacheKey, storage?: CodexAppsToolsCacheStorage | null);
|
|
148
|
+
cache_path(): string;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
type McpServerTransportConfig = {
|
|
152
|
+
type: "streamable_http";
|
|
153
|
+
url: string;
|
|
154
|
+
bearer_token_env_var?: string | null;
|
|
155
|
+
http_headers?: Record<string, string> | null;
|
|
156
|
+
env_http_headers?: Record<string, string> | null;
|
|
157
|
+
oauth_tokens_present?: boolean | null;
|
|
158
|
+
} | {
|
|
159
|
+
type: "stdio";
|
|
160
|
+
command: string;
|
|
161
|
+
args?: readonly string[];
|
|
162
|
+
env?: Record<string, string> | null;
|
|
163
|
+
env_vars?: readonly string[];
|
|
164
|
+
cwd?: string | null;
|
|
165
|
+
};
|
|
166
|
+
type McpServerConfig = {
|
|
167
|
+
transport: McpServerTransportConfig;
|
|
168
|
+
enabled?: boolean;
|
|
169
|
+
required?: boolean;
|
|
170
|
+
startup_timeout_sec?: number | null;
|
|
171
|
+
tool_timeout_sec?: number | null;
|
|
172
|
+
enabled_tools?: readonly string[] | null;
|
|
173
|
+
disabled_tools?: readonly string[] | null;
|
|
174
|
+
experimental_environment?: string | null;
|
|
175
|
+
};
|
|
176
|
+
type McpRuntimeEnvironment = {
|
|
177
|
+
cwd?: string | null;
|
|
178
|
+
environment_id?: string | null;
|
|
179
|
+
remote?: boolean | null;
|
|
180
|
+
};
|
|
181
|
+
type McpClientFactoryOptions = {
|
|
182
|
+
fetch?: typeof fetch;
|
|
183
|
+
environment?: Record<string, string | undefined>;
|
|
184
|
+
stdio_server_launcher?: StdioServerLauncher | null;
|
|
185
|
+
runtime_environment?: McpRuntimeEnvironment | null;
|
|
186
|
+
};
|
|
187
|
+
type StdioServerLauncher = {
|
|
188
|
+
launch(server_name: string, config: Extract<McpServerTransportConfig, {
|
|
189
|
+
type: "stdio";
|
|
190
|
+
}>, runtime_environment?: McpRuntimeEnvironment | null): Promise<RmcpClientLike>;
|
|
191
|
+
};
|
|
192
|
+
type RmcpRawTool = {
|
|
193
|
+
name: string;
|
|
194
|
+
title?: string | null;
|
|
195
|
+
description?: string | null;
|
|
196
|
+
input_schema?: unknown;
|
|
197
|
+
meta?: unknown;
|
|
198
|
+
connector_id?: string | null;
|
|
199
|
+
connector_name?: string | null;
|
|
200
|
+
connector_description?: string | null;
|
|
201
|
+
};
|
|
202
|
+
type RmcpListToolsResult = readonly ToolInfo[] | readonly RmcpRawTool[] | {
|
|
203
|
+
tools: readonly (ToolInfo | RmcpRawTool | ({
|
|
204
|
+
tool: RmcpRawTool;
|
|
205
|
+
} & Record<string, unknown>))[];
|
|
206
|
+
};
|
|
207
|
+
type RmcpClientLike = {
|
|
208
|
+
initialize?: (timeout?: number | null) => Promise<RmcpInitializeResult>;
|
|
209
|
+
list_tools?: (params?: unknown, timeout?: number | null) => Promise<RmcpListToolsResult>;
|
|
210
|
+
call_tool?: (tool: string, arguments_: unknown, meta?: unknown, timeout?: number | null) => Promise<unknown>;
|
|
211
|
+
list_resources?: (params?: unknown, timeout?: number | null) => Promise<unknown>;
|
|
212
|
+
list_resource_templates?: (params?: unknown, timeout?: number | null) => Promise<unknown>;
|
|
213
|
+
read_resource?: (params: unknown, timeout?: number | null) => Promise<unknown>;
|
|
214
|
+
shutdown?: () => Promise<void> | void;
|
|
215
|
+
};
|
|
216
|
+
type RmcpInitializeResult = {
|
|
217
|
+
instructions?: string | null;
|
|
218
|
+
capabilities?: {
|
|
219
|
+
experimental?: Record<string, unknown> | null;
|
|
220
|
+
[key: string]: unknown;
|
|
221
|
+
} | null;
|
|
222
|
+
};
|
|
223
|
+
type ManagedClientInput = {
|
|
224
|
+
client?: RmcpClientLike | null;
|
|
225
|
+
tools?: readonly ToolInfo[];
|
|
226
|
+
tool_filter?: ToolFilter;
|
|
227
|
+
tool_timeout?: number | null;
|
|
228
|
+
server_instructions?: string | null;
|
|
229
|
+
server_supports_sandbox_state_meta_capability?: boolean;
|
|
230
|
+
codex_apps_tools_cache_context?: CodexAppsToolsCacheContext | null;
|
|
231
|
+
};
|
|
232
|
+
declare class ManagedClient {
|
|
233
|
+
readonly client: RmcpClientLike | null;
|
|
234
|
+
readonly tools: readonly ToolInfo[];
|
|
235
|
+
readonly tool_filter: ToolFilter;
|
|
236
|
+
readonly tool_timeout: number | null;
|
|
237
|
+
readonly server_instructions: string | null;
|
|
238
|
+
readonly server_supports_sandbox_state_meta_capability: boolean;
|
|
239
|
+
readonly codex_apps_tools_cache_context: CodexAppsToolsCacheContext | null;
|
|
240
|
+
constructor(input?: ManagedClientInput);
|
|
241
|
+
listed_tools(): ToolInfo[];
|
|
242
|
+
call_tool(tool: string, arguments_: unknown, meta?: unknown): Promise<unknown>;
|
|
243
|
+
list_resources(params?: unknown): Promise<unknown>;
|
|
244
|
+
list_resource_templates(params?: unknown): Promise<unknown>;
|
|
245
|
+
read_resource(params: unknown): Promise<unknown>;
|
|
246
|
+
shutdown(): Promise<void>;
|
|
247
|
+
}
|
|
248
|
+
type AsyncManagedClientInput = {
|
|
249
|
+
client: ManagedClient | Promise<ManagedClient> | (() => ManagedClient | Promise<ManagedClient>);
|
|
250
|
+
startup_snapshot?: readonly ToolInfo[] | null;
|
|
251
|
+
tool_plugin_provenance?: ToolPluginProvenance;
|
|
252
|
+
cancel_token?: CancellationToken;
|
|
253
|
+
};
|
|
254
|
+
type AsyncManagedClientStartupStatus = {
|
|
255
|
+
status: "starting";
|
|
256
|
+
} | {
|
|
257
|
+
status: "ready";
|
|
258
|
+
} | {
|
|
259
|
+
status: "cancelled";
|
|
260
|
+
} | {
|
|
261
|
+
status: "failed";
|
|
262
|
+
error: string;
|
|
263
|
+
};
|
|
264
|
+
declare class AsyncManagedClient {
|
|
265
|
+
private readonly client_promise;
|
|
266
|
+
private readonly startup_snapshot;
|
|
267
|
+
private readonly startup_complete;
|
|
268
|
+
private readonly tool_plugin_provenance;
|
|
269
|
+
private readonly cancel_token;
|
|
270
|
+
private startup_status_value;
|
|
271
|
+
constructor(input: AsyncManagedClientInput);
|
|
272
|
+
static from_managed_client(client: ManagedClient, startup_snapshot?: readonly ToolInfo[] | null): AsyncManagedClient;
|
|
273
|
+
static new(server_name: string, input: {
|
|
274
|
+
client: RmcpClientLike | Promise<RmcpClientLike> | (() => RmcpClientLike | Promise<RmcpClientLike>);
|
|
275
|
+
tool_filter?: ToolFilter;
|
|
276
|
+
tool_timeout?: number | null;
|
|
277
|
+
server_instructions?: string | null;
|
|
278
|
+
codex_apps_tools_cache_context?: CodexAppsToolsCacheContext | null;
|
|
279
|
+
tool_plugin_provenance?: ToolPluginProvenance;
|
|
280
|
+
}): AsyncManagedClient;
|
|
281
|
+
static from_config(server_name: string, config: McpServerConfig, options?: {
|
|
282
|
+
codex_apps_tools_cache_context?: CodexAppsToolsCacheContext | null;
|
|
283
|
+
tool_plugin_provenance?: ToolPluginProvenance;
|
|
284
|
+
client_factory_options?: McpClientFactoryOptions;
|
|
285
|
+
}): AsyncManagedClient;
|
|
286
|
+
client(): Promise<ManagedClient>;
|
|
287
|
+
shutdown(): Promise<void>;
|
|
288
|
+
startup_status(): AsyncManagedClientStartupStatus;
|
|
289
|
+
listed_tools(): Promise<ToolInfo[] | null>;
|
|
290
|
+
private startup_snapshot_while_initializing;
|
|
291
|
+
private listed_tools_from_client;
|
|
292
|
+
private annotate_tools;
|
|
293
|
+
}
|
|
294
|
+
declare class CancellationToken {
|
|
295
|
+
private cancelled;
|
|
296
|
+
cancel(): void;
|
|
297
|
+
is_cancelled(): boolean;
|
|
298
|
+
child_token(): CancellationToken;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
declare class ToolPluginProvenance {
|
|
302
|
+
private readonly plugin_display_names_by_connector_id;
|
|
303
|
+
private readonly plugin_display_names_by_mcp_server_name;
|
|
304
|
+
constructor(input?: {
|
|
305
|
+
plugin_display_names_by_connector_id?: ReadonlyMap<string, readonly string[]> | Record<string, readonly string[]>;
|
|
306
|
+
plugin_display_names_by_mcp_server_name?: ReadonlyMap<string, readonly string[]> | Record<string, readonly string[]>;
|
|
307
|
+
});
|
|
308
|
+
plugin_display_names_for_connector_id(connectorId: string): readonly string[];
|
|
309
|
+
plugin_display_names_for_mcp_server_name(serverName: string): readonly string[];
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
type RequestId = string | number;
|
|
313
|
+
type ElicitationAction = "accept" | "decline" | "cancel";
|
|
314
|
+
type ElicitationResponse = {
|
|
315
|
+
action: ElicitationAction;
|
|
316
|
+
content?: unknown;
|
|
317
|
+
meta?: unknown;
|
|
318
|
+
};
|
|
319
|
+
type CreateElicitationRequestParams = {
|
|
320
|
+
type: "form";
|
|
321
|
+
meta?: unknown;
|
|
322
|
+
message: string;
|
|
323
|
+
requested_schema: {
|
|
324
|
+
properties?: Record<string, unknown>;
|
|
325
|
+
[key: string]: unknown;
|
|
326
|
+
};
|
|
327
|
+
} | {
|
|
328
|
+
type: "url";
|
|
329
|
+
meta?: unknown;
|
|
330
|
+
message: string;
|
|
331
|
+
url: string;
|
|
332
|
+
elicitation_id?: string | null;
|
|
333
|
+
};
|
|
334
|
+
type ElicitationRequestEvent = {
|
|
335
|
+
id: "mcp_elicitation_request";
|
|
336
|
+
msg: {
|
|
337
|
+
type: "elicitation_request";
|
|
338
|
+
turn_id: null;
|
|
339
|
+
server_name: string;
|
|
340
|
+
id: RequestId;
|
|
341
|
+
request: {
|
|
342
|
+
type: "form";
|
|
343
|
+
meta?: unknown;
|
|
344
|
+
message: string;
|
|
345
|
+
requested_schema: unknown;
|
|
346
|
+
} | {
|
|
347
|
+
type: "url";
|
|
348
|
+
meta?: unknown;
|
|
349
|
+
message: string;
|
|
350
|
+
url: string;
|
|
351
|
+
elicitation_id?: string | null;
|
|
352
|
+
};
|
|
353
|
+
};
|
|
354
|
+
};
|
|
355
|
+
type ElicitationReviewRequest = {
|
|
356
|
+
server_name: string;
|
|
357
|
+
request_id: RequestId;
|
|
358
|
+
elicitation: CreateElicitationRequestParams;
|
|
359
|
+
};
|
|
360
|
+
type ElicitationReviewer = {
|
|
361
|
+
review(request: ElicitationReviewRequest): Promise<ElicitationResponse | null | undefined>;
|
|
362
|
+
};
|
|
363
|
+
type ElicitationReviewerHandle = ElicitationReviewer;
|
|
364
|
+
type ElicitationEventSink = ((event: ElicitationRequestEvent) => Promise<void> | void) | {
|
|
365
|
+
send(event: ElicitationRequestEvent): Promise<void> | void;
|
|
366
|
+
};
|
|
367
|
+
type SendElicitation = (id: RequestId, elicitation: CreateElicitationRequestParams) => Promise<ElicitationResponse>;
|
|
368
|
+
declare class ElicitationRequestManager {
|
|
369
|
+
private readonly reviewer;
|
|
370
|
+
private readonly requests;
|
|
371
|
+
private approval_policy;
|
|
372
|
+
private permission_profile;
|
|
373
|
+
private auto_deny_value;
|
|
374
|
+
constructor(approval_policy: unknown, permission_profile: unknown, reviewer?: ElicitationReviewerHandle | null);
|
|
375
|
+
auto_deny(): boolean;
|
|
376
|
+
set_auto_deny(auto_deny: boolean): void;
|
|
377
|
+
set_approval_policy(approval_policy: unknown): void;
|
|
378
|
+
set_permission_profile(permission_profile: unknown): void;
|
|
379
|
+
resolve(server_name: string, id: RequestId, response: ElicitationResponse): Promise<void>;
|
|
380
|
+
make_sender(server_name: string, tx_event: ElicitationEventSink): SendElicitation;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
type McpConnectionManagerInput = {
|
|
384
|
+
clients?: ReadonlyMap<string, AsyncManagedClient> | Record<string, AsyncManagedClient>;
|
|
385
|
+
server_origins?: ReadonlyMap<string, string> | Record<string, string>;
|
|
386
|
+
host_owned_codex_apps_enabled?: boolean;
|
|
387
|
+
elicitation_requests?: ElicitationRequestManager | null;
|
|
388
|
+
};
|
|
389
|
+
type McpStartupFailure = {
|
|
390
|
+
server: string;
|
|
391
|
+
error: string;
|
|
392
|
+
};
|
|
393
|
+
type McpStartupStatus = AsyncManagedClientStartupStatus;
|
|
394
|
+
declare class McpConnectionManager$1 {
|
|
395
|
+
readonly clients: Map<string, AsyncManagedClient>;
|
|
396
|
+
private readonly server_origins;
|
|
397
|
+
private readonly elicitation_requests;
|
|
398
|
+
private host_owned_codex_apps_enabled;
|
|
399
|
+
private startup_cancelled;
|
|
400
|
+
constructor(input?: McpConnectionManagerInput);
|
|
401
|
+
static new_uninitialized(): McpConnectionManager$1;
|
|
402
|
+
static from_managed_clients(clients: ReadonlyMap<string, ManagedClient> | Record<string, ManagedClient>): McpConnectionManager$1;
|
|
403
|
+
static from_rmcp_clients(clients: ReadonlyMap<string, RmcpClientLike> | Record<string, RmcpClientLike>, options?: {
|
|
404
|
+
tool_filter_by_server?: ReadonlyMap<string, ToolFilter> | Record<string, ToolFilter>;
|
|
405
|
+
tool_timeout?: number | null;
|
|
406
|
+
codex_apps_tools_cache_context?: CodexAppsToolsCacheContext | null;
|
|
407
|
+
tool_plugin_provenance?: ToolPluginProvenance;
|
|
408
|
+
}): McpConnectionManager$1;
|
|
409
|
+
static from_config(mcp_servers: ReadonlyMap<string, McpServerConfig> | Record<string, McpServerConfig>, options?: {
|
|
410
|
+
client_factory_options?: McpClientFactoryOptions;
|
|
411
|
+
codex_apps_tools_cache_context?: CodexAppsToolsCacheContext | null;
|
|
412
|
+
host_owned_codex_apps_enabled?: boolean;
|
|
413
|
+
tool_plugin_provenance?: ToolPluginProvenance;
|
|
414
|
+
elicitation_requests?: ElicitationRequestManager | null;
|
|
415
|
+
}): McpConnectionManager$1;
|
|
416
|
+
has_servers(): boolean;
|
|
417
|
+
begin_shutdown(): Promise<void>;
|
|
418
|
+
shutdown(): Promise<void>;
|
|
419
|
+
server_origin(server_name: string): string | null;
|
|
420
|
+
is_host_owned_codex_apps_server(server_name: string): boolean;
|
|
421
|
+
set_approval_policy(approval_policy: unknown): void;
|
|
422
|
+
set_permission_profile(permission_profile: unknown): void;
|
|
423
|
+
elicitations_auto_deny(): boolean;
|
|
424
|
+
set_elicitations_auto_deny(auto_deny: boolean): void;
|
|
425
|
+
resolve_elicitation(server_name: string, id: string | number, response: ElicitationResponse): Promise<void>;
|
|
426
|
+
wait_for_server_ready(server_name: string, timeout_ms?: number): Promise<boolean>;
|
|
427
|
+
required_startup_failures(required_servers: readonly string[]): Promise<McpStartupFailure[]>;
|
|
428
|
+
startup_statuses(): Map<string, McpStartupStatus>;
|
|
429
|
+
list_all_tools(): Promise<Map<string, ToolInfo>>;
|
|
430
|
+
hard_refresh_codex_apps_tools_cache(): Promise<Map<string, ToolInfo>>;
|
|
431
|
+
list_all_resources(): Promise<Map<string, unknown[]>>;
|
|
432
|
+
list_all_resource_templates(): Promise<Map<string, unknown[]>>;
|
|
433
|
+
call_tool(server: string, tool: string, arguments_: unknown, meta?: unknown): Promise<unknown>;
|
|
434
|
+
server_supports_sandbox_state_meta_capability(server: string): Promise<boolean>;
|
|
435
|
+
list_resources(server: string, params?: unknown): Promise<unknown>;
|
|
436
|
+
list_resource_templates(server: string, params?: unknown): Promise<unknown>;
|
|
437
|
+
read_resource(server: string, params: unknown): Promise<unknown>;
|
|
438
|
+
resolve_tool_info(tool_name: string | {
|
|
439
|
+
namespace?: string | null;
|
|
440
|
+
name: string;
|
|
441
|
+
}): Promise<ToolInfo | null>;
|
|
442
|
+
private client_by_name;
|
|
443
|
+
}
|
|
444
|
+
|
|
89
445
|
interface McpConnectionManager {
|
|
90
|
-
refresh_mcp_servers_now(config: McpServerRefreshConfig, environment: McpRuntimeEnvironment): Promise<void>;
|
|
446
|
+
refresh_mcp_servers_now(config: McpServerRefreshConfig, environment: McpRuntimeEnvironment$1): Promise<void>;
|
|
91
447
|
list_server_statuses(options?: McpServerStatusListOptions): Promise<McpServerStatus[]>;
|
|
92
448
|
list_resources(params: McpResourceListParams): Promise<McpResourceListResponse>;
|
|
93
449
|
list_resource_templates(params: McpResourceListParams): Promise<McpResourceTemplateListResponse>;
|
|
@@ -111,6 +467,27 @@ declare class EmptyMcpConnectionManager implements McpConnectionManager {
|
|
|
111
467
|
resolve_elicitation(serverName: string): Promise<void>;
|
|
112
468
|
shutdown(): Promise<void>;
|
|
113
469
|
}
|
|
470
|
+
type CodexMcpConnectionManagerAdapterOptions = {
|
|
471
|
+
client_factory_options?: McpClientFactoryOptions;
|
|
472
|
+
};
|
|
473
|
+
declare class CodexMcpConnectionManagerAdapter implements McpConnectionManager {
|
|
474
|
+
private manager;
|
|
475
|
+
private readonly client_factory_options?;
|
|
476
|
+
private configured_servers;
|
|
477
|
+
private auth_statuses;
|
|
478
|
+
constructor(manager?: McpConnectionManager$1, options?: CodexMcpConnectionManagerAdapterOptions);
|
|
479
|
+
refresh_mcp_servers_now(config: McpServerRefreshConfig, environment: McpRuntimeEnvironment$1): Promise<void>;
|
|
480
|
+
list_server_statuses(options?: McpServerStatusListOptions): Promise<McpServerStatus[]>;
|
|
481
|
+
list_resources(params: McpResourceListParams): Promise<McpResourceListResponse>;
|
|
482
|
+
list_resource_templates(params: McpResourceListParams): Promise<McpResourceTemplateListResponse>;
|
|
483
|
+
read_resource(params: McpResourceReadParams): Promise<McpResourceReadResponse>;
|
|
484
|
+
call_tool(params: McpServerToolCallParams): Promise<McpServerToolCallResponse>;
|
|
485
|
+
resolve_tool_info(serverName: string, toolName: string): Promise<McpToolInfo | null>;
|
|
486
|
+
list_tools(): Promise<McpToolInfo[]>;
|
|
487
|
+
resolve_elicitation(serverName: string, id: McpRequestId, response: McpServerElicitationResponse): Promise<void>;
|
|
488
|
+
shutdown(): Promise<void>;
|
|
489
|
+
required_startup_failures(required_servers: readonly string[]): Promise<McpStartupFailure[]>;
|
|
490
|
+
}
|
|
114
491
|
type StaticMcpConnectionManagerOptions = {
|
|
115
492
|
resources?: Record<string, ReadonlyArray<McpResourceInfo>>;
|
|
116
493
|
resource_templates?: Record<string, ReadonlyArray<McpResourceTemplateInfo>>;
|
|
@@ -152,6 +529,13 @@ declare class LiveThread {
|
|
|
152
529
|
localRolloutPath(): Promise<string | null>;
|
|
153
530
|
}
|
|
154
531
|
|
|
532
|
+
declare const CODEX_CHATGPT_OAUTH_CLIENT_ID = "app_EMoamEEZ73f0CkXaXp7hrann";
|
|
533
|
+
declare const CODEX_CHATGPT_OAUTH_ISSUER = "https://auth.openai.com";
|
|
534
|
+
declare const CODEX_CHATGPT_OAUTH_SCOPE = "openid profile email offline_access api.connectors.read api.connectors.invoke";
|
|
535
|
+
declare const CODEX_CHATGPT_OAUTH_PRIMARY_PORT = 1455;
|
|
536
|
+
declare const CODEX_CHATGPT_OAUTH_FALLBACK_PORT = 1457;
|
|
537
|
+
declare const CODEX_CHATGPT_OAUTH_CALLBACK_PATH = "/auth/callback";
|
|
538
|
+
declare const CODEX_CHATGPT_OAUTH_ORIGINATOR = "codex_cli_rs";
|
|
155
539
|
declare const AuthMode: {
|
|
156
540
|
readonly ApiKey: "apiKey";
|
|
157
541
|
readonly Chatgpt: "chatgpt";
|
|
@@ -192,6 +576,21 @@ type ProviderAccountState = {
|
|
|
192
576
|
account: ProviderAccount | null;
|
|
193
577
|
requires_openai_auth: boolean;
|
|
194
578
|
};
|
|
579
|
+
type ChatgptOAuthTokenExchangeResponse = {
|
|
580
|
+
credential_jwe: string;
|
|
581
|
+
account: ProviderAccountState;
|
|
582
|
+
};
|
|
583
|
+
|
|
584
|
+
declare function builtinCollaborationModePresets(): CollaborationModeMask[];
|
|
585
|
+
declare function collaborationModePresetForMode(mode: ModeKind$1): CollaborationModeMask | null;
|
|
586
|
+
declare function normalizeCollaborationMode(input: {
|
|
587
|
+
collaborationMode?: CollaborationMode$1 | null;
|
|
588
|
+
model: string;
|
|
589
|
+
reasoningEffort?: string | null;
|
|
590
|
+
}): CollaborationMode$1;
|
|
591
|
+
declare function defaultModeInstructions(): string;
|
|
592
|
+
|
|
593
|
+
declare const CODEX_PLAN_MODE_INSTRUCTIONS = "# Plan Mode (Conversational)\n\nYou work in 3 phases, and you should *chat your way* to a great plan before finalizing it. A great plan is very detailed\u2014intent- and implementation-wise\u2014so that it can be handed to another engineer or agent to be implemented right away. It must be **decision complete**, where the implementer does not need to make any decisions.\n\n## Mode rules (strict)\n\nYou are in **Plan Mode** until a developer message explicitly ends it.\n\nPlan Mode is not changed by user intent, tone, or imperative language. If a user asks for execution while still in Plan Mode, treat it as a request to **plan the execution**, not perform it.\n\n## Plan Mode vs update_plan tool\n\nPlan Mode is a collaboration mode that can involve requesting user input and eventually issuing a `<proposed_plan>` block.\n\nSeparately, `update_plan` is a checklist/progress/TODOs tool; it does not enter or exit Plan Mode. Do not confuse it with Plan mode or try to use it while in Plan mode. If you try to use `update_plan` in Plan mode, it will return an error.\n\n## Execution vs. mutation in Plan Mode\n\nYou may explore and execute **non-mutating** actions that improve the plan. You must not perform **mutating** actions.\n\n### Allowed (non-mutating, plan-improving)\n\nActions that gather truth, reduce ambiguity, or validate feasibility without changing repo-tracked state. Examples:\n\n* Reading or searching files, configs, schemas, types, manifests, and docs\n* Static analysis, inspection, and repo exploration\n* Dry-run style commands when they do not edit repo-tracked files\n* Tests, builds, or checks that may write to caches or build artifacts (for example, `target/`, `.cache/`, or snapshots) so long as they do not edit repo-tracked files\n\n### Not allowed (mutating, plan-executing)\n\nActions that implement the plan or change repo-tracked state. Examples:\n\n* Editing or writing files\n* Running formatters or linters that rewrite files\n* Applying patches, migrations, or codegen that updates repo-tracked files\n* Side-effectful commands whose purpose is to carry out the plan rather than refine it\n\nWhen in doubt: if the action would reasonably be described as \"doing the work\" rather than \"planning the work,\" do not do it.\n\n## PHASE 1 \u2014 Ground in the environment (explore first, ask second)\n\nBegin by grounding yourself in the actual environment. Eliminate unknowns in the prompt by discovering facts, not by asking the user. Resolve all questions that can be answered through exploration or inspection. Identify missing or ambiguous details only if they cannot be derived from the environment. Silent exploration between turns is allowed and encouraged.\n\nBefore asking the user any question, perform at least one targeted non-mutating exploration pass (for example: search relevant files, inspect likely entrypoints/configs, confirm current implementation shape), unless no local environment/repo is available.\n\nException: you may ask clarifying questions about the user's prompt before exploring, ONLY if there are obvious ambiguities or contradictions in the prompt itself. However, if ambiguity might be resolved by exploring, always prefer exploring first.\n\nDo not ask questions that can be answered from the repo or system (for example, \"where is this struct?\" or \"which UI component should we use?\" when exploration can make it clear). Only ask once you have exhausted reasonable non-mutating exploration.\n\n## PHASE 2 \u2014 Intent chat (what they actually want)\n\n* Keep asking until you can clearly state: goal + success criteria, audience, in/out of scope, constraints, current state, and the key preferences/tradeoffs.\n* Bias toward questions over guessing: if any high-impact ambiguity remains, do NOT plan yet\u2014ask.\n\n## PHASE 3 \u2014 Implementation chat (what/how we\u2019ll build)\n\n* Once intent is stable, keep asking until the spec is decision complete: approach, interfaces (APIs/schemas/I/O), data flow, edge cases/failure modes, testing + acceptance criteria, rollout/monitoring, and any migrations/compat constraints.\n\n## Asking questions\n\nCritical rules:\n\n* Strongly prefer using the `request_user_input` tool to ask any questions.\n* Offer only meaningful multiple\u2011choice options; don\u2019t include filler choices that are obviously wrong or irrelevant.\n* In rare cases where an unavoidable, important question can\u2019t be expressed with reasonable multiple\u2011choice options (due to extreme ambiguity), you may ask it directly without the tool.\n\nYou SHOULD ask many questions, but each question must:\n\n* materially change the spec/plan, OR\n* confirm/lock an assumption, OR\n* choose between meaningful tradeoffs.\n* not be answerable by non-mutating commands.\n\nUse the `request_user_input` tool only for decisions that materially change the plan, for confirming important assumptions, or for information that cannot be discovered via non-mutating exploration.\n\n## Two kinds of unknowns (treat differently)\n\n1. **Discoverable facts** (repo/system truth): explore first.\n\n * Before asking, run targeted searches and check likely sources of truth (configs/manifests/entrypoints/schemas/types/constants).\n * Ask only if: multiple plausible candidates; nothing found but you need a missing identifier/context; or ambiguity is actually product intent.\n * If asking, present concrete candidates (paths/service names) + recommend one.\n * Never ask questions you can answer from your environment (e.g., \u201Cwhere is this struct\u201D).\n\n2. **Preferences/tradeoffs** (not discoverable): ask early.\n\n * These are intent or implementation preferences that cannot be derived from exploration.\n * Provide 2\u20134 mutually exclusive options + a recommended default.\n * If unanswered, proceed with the recommended option and record it as an assumption in the final plan.\n\n## Finalization rule\n\nOnly output the final plan when it is decision complete and leaves no decisions to the implementer.\n\nWhen you present the official plan, wrap it in a `<proposed_plan>` block so the client can render it specially:\n\n1) The opening tag must be on its own line.\n2) Start the plan content on the next line (no text on the same line as the tag).\n3) The closing tag must be on its own line.\n4) Use Markdown inside the block.\n5) Keep the tags exactly as `<proposed_plan>` and `</proposed_plan>` (do not translate or rename them), even if the plan content is in another language.\n\nExample:\n\n<proposed_plan>\nplan content\n</proposed_plan>\n\nplan content should be human and agent digestible. The final plan must be plan-only, concise by default, and include:\n\n* A clear title\n* A brief summary section\n* Important changes or additions to public APIs/interfaces/types\n* Test cases and scenarios\n* Explicit assumptions and defaults chosen where needed\n\nWhen possible, prefer a compact structure with 3-5 short sections, usually: Summary, Key Changes or Implementation Changes, Test Plan, and Assumptions. Do not include a separate Scope section unless scope boundaries are genuinely important to avoid mistakes.\n\nPrefer grouped implementation bullets by subsystem or behavior over file-by-file inventories. Mention files only when needed to disambiguate a non-obvious change, and avoid naming more than 3 paths unless extra specificity is necessary to prevent mistakes. Prefer behavior-level descriptions over symbol-by-symbol removal lists. For v1 feature-addition plans, do not invent detailed schema, validation, precedence, fallback, or wire-shape policy unless the request establishes it or it is needed to prevent a concrete implementation mistake; prefer the intended capability and minimum interface/behavior changes.\n\nKeep bullets short and avoid explanatory sub-bullets unless they are needed to prevent ambiguity. Prefer the minimum detail needed for implementation safety, not exhaustive coverage. Within each section, compress related changes into a few high-signal bullets and omit branch-by-branch logic, repeated invariants, and long lists of unaffected behavior unless they are necessary to prevent a likely implementation mistake. Avoid repeated repo facts and irrelevant edge-case or rollout detail. For straightforward refactors, keep the plan to a compact summary, key edits, tests, and assumptions. If the user asks for more detail, then expand.\n\nDo not ask \"should I proceed?\" in the final output. The user can easily switch out of Plan mode and request implementation if you have included a `<proposed_plan>` block in your response. Alternatively, they can decide to stay in Plan mode and continue refining the plan.\n\nOnly produce at most one `<proposed_plan>` block per turn, and only when you are presenting a complete spec.\n\nIf the user stays in Plan mode and asks for revisions after a prior `<proposed_plan>`, any new `<proposed_plan>` must be a complete replacement.";
|
|
195
594
|
|
|
196
595
|
type ClientRequestSerializationScope = {
|
|
197
596
|
key: string;
|
|
@@ -218,7 +617,7 @@ type ClientRequestSerializationScope = {
|
|
|
218
617
|
serverName: string;
|
|
219
618
|
type: "mcpOauth";
|
|
220
619
|
};
|
|
221
|
-
declare function clientRequestId(request: ClientRequest): RequestId;
|
|
620
|
+
declare function clientRequestId(request: ClientRequest): RequestId$1;
|
|
222
621
|
declare function clientRequestMethod(request: ClientRequest): string;
|
|
223
622
|
declare function clientRequestExperimentalReason(request: ClientRequest | {
|
|
224
623
|
method: string;
|
|
@@ -237,12 +636,12 @@ type JSONRPCErrorError = {
|
|
|
237
636
|
type Result = unknown;
|
|
238
637
|
type ConnectionId = number;
|
|
239
638
|
type OutgoingResponse = {
|
|
240
|
-
id: RequestId;
|
|
639
|
+
id: RequestId$1;
|
|
241
640
|
result: Result;
|
|
242
641
|
};
|
|
243
642
|
type OutgoingError = {
|
|
244
643
|
error: JSONRPCErrorError;
|
|
245
|
-
id: RequestId;
|
|
644
|
+
id: RequestId$1;
|
|
246
645
|
};
|
|
247
646
|
type OutgoingMessage = ServerRequest | ServerNotification | OutgoingResponse | OutgoingError;
|
|
248
647
|
type QueuedOutgoingMessage = {
|
|
@@ -252,7 +651,7 @@ type QueuedOutgoingMessage = {
|
|
|
252
651
|
|
|
253
652
|
type ConnectionOrigin = "stdio" | "inProcess" | "webSocket" | "remoteControl";
|
|
254
653
|
type JSONRPCRequest = {
|
|
255
|
-
id: RequestId;
|
|
654
|
+
id: RequestId$1;
|
|
256
655
|
method: string;
|
|
257
656
|
params?: unknown;
|
|
258
657
|
};
|
|
@@ -261,14 +660,26 @@ type JSONRPCNotification = {
|
|
|
261
660
|
params?: unknown;
|
|
262
661
|
};
|
|
263
662
|
type JSONRPCResponse = {
|
|
264
|
-
id: RequestId;
|
|
663
|
+
id: RequestId$1;
|
|
265
664
|
result: Result;
|
|
266
665
|
};
|
|
267
666
|
type JSONRPCError = {
|
|
268
667
|
error: JSONRPCErrorError;
|
|
269
|
-
id: RequestId | null;
|
|
668
|
+
id: RequestId$1 | null;
|
|
270
669
|
};
|
|
271
670
|
type JSONRPCMessage = JSONRPCRequest | JSONRPCNotification | JSONRPCResponse | JSONRPCError;
|
|
671
|
+
type TransportEvent = {
|
|
672
|
+
connectionId: ConnectionId;
|
|
673
|
+
origin: ConnectionOrigin;
|
|
674
|
+
type: "connection_opened";
|
|
675
|
+
} | {
|
|
676
|
+
connectionId: ConnectionId;
|
|
677
|
+
type: "connection_closed";
|
|
678
|
+
} | {
|
|
679
|
+
connectionId: ConnectionId;
|
|
680
|
+
message: JSONRPCMessage;
|
|
681
|
+
type: "incoming_message";
|
|
682
|
+
};
|
|
272
683
|
type ParsedServerTransportMessage = {
|
|
273
684
|
request: ClientRequest;
|
|
274
685
|
type: "client_request";
|
|
@@ -300,14 +711,16 @@ type ParsedTransportPayload<T> = {
|
|
|
300
711
|
type: "ok";
|
|
301
712
|
} | {
|
|
302
713
|
error: JSONRPCErrorError;
|
|
303
|
-
id: RequestId | null;
|
|
714
|
+
id: RequestId$1 | null;
|
|
304
715
|
type: "invalid";
|
|
305
716
|
};
|
|
717
|
+
declare function parseJsonRpcTransportPayload(payload: string | ArrayBuffer | ArrayBufferView | unknown): ParsedTransportPayload<JSONRPCMessage>;
|
|
718
|
+
declare function parseJsonRpcMessage(value: unknown): ParsedTransportPayload<JSONRPCMessage>;
|
|
306
719
|
declare function parseServerTransportPayload(payload: string | ArrayBuffer | ArrayBufferView | unknown): ParsedTransportPayload<ParsedServerTransportMessage>;
|
|
307
720
|
declare function parseClientTransportPayload(payload: string | ArrayBuffer | ArrayBufferView | unknown): ParsedTransportPayload<ParsedClientTransportMessage>;
|
|
308
721
|
declare function serializeOutgoingMessage(message: OutgoingMessage): string;
|
|
309
|
-
declare function serializeJsonRpcResponse(id: RequestId, result: Result): string;
|
|
310
|
-
declare function serializeJsonRpcError(id: RequestId | null, error: JSONRPCErrorError): string;
|
|
722
|
+
declare function serializeJsonRpcResponse(id: RequestId$1, result: Result): string;
|
|
723
|
+
declare function serializeJsonRpcError(id: RequestId$1 | null, error: JSONRPCErrorError): string;
|
|
311
724
|
declare function queuedOutgoingMessage(message: OutgoingMessage, writeComplete?: () => void): QueuedOutgoingMessage;
|
|
312
725
|
declare function jsonRpcParseError(message: string): JSONRPCErrorError;
|
|
313
726
|
declare function jsonRpcInvalidRequestError(message: string): JSONRPCErrorError;
|
|
@@ -328,11 +741,11 @@ type AppServerEvent = {
|
|
|
328
741
|
};
|
|
329
742
|
type ConnectionRequestId = {
|
|
330
743
|
connectionId: ConnectionId;
|
|
331
|
-
requestId: RequestId;
|
|
744
|
+
requestId: RequestId$1;
|
|
332
745
|
};
|
|
333
746
|
type RequestContext = {
|
|
334
747
|
connectionId: ConnectionId;
|
|
335
|
-
requestId: RequestId;
|
|
748
|
+
requestId: RequestId$1;
|
|
336
749
|
};
|
|
337
750
|
type OutgoingServerRequestHandle = {
|
|
338
751
|
request: ServerRequest;
|
|
@@ -360,9 +773,9 @@ declare class OutgoingMessageSender {
|
|
|
360
773
|
requestContext(requestId: ConnectionRequestId): RequestContext | null;
|
|
361
774
|
sendResponse(requestId: ConnectionRequestId, result: Result, context?: unknown): Promise<void>;
|
|
362
775
|
sendError(requestId: ConnectionRequestId, error: JSONRPCErrorError, context?: unknown): Promise<void>;
|
|
363
|
-
notifyClientResponse(id: RequestId, result: Result): Promise<void>;
|
|
364
|
-
notifyClientError(id: RequestId, error: JSONRPCErrorError): Promise<void>;
|
|
365
|
-
cancelRequest(id: RequestId): boolean;
|
|
776
|
+
notifyClientResponse(id: RequestId$1, result: Result): Promise<void>;
|
|
777
|
+
notifyClientError(id: RequestId$1, error: JSONRPCErrorError): Promise<void>;
|
|
778
|
+
cancelRequest(id: RequestId$1): boolean;
|
|
366
779
|
connectionClosed(connectionId: ConnectionId): void;
|
|
367
780
|
cancelRequestsForThread(threadId: ThreadId, error?: JSONRPCErrorError): void;
|
|
368
781
|
pendingRequestsForThread(threadId: ThreadId): ServerRequest[];
|
|
@@ -381,6 +794,7 @@ declare class ThreadScopedOutgoingMessageSender {
|
|
|
381
794
|
abortPendingServerRequests(error?: JSONRPCErrorError): void;
|
|
382
795
|
pendingRequests(): ServerRequest[];
|
|
383
796
|
}
|
|
797
|
+
declare function outgoingMessageToAppServerEvent(message: OutgoingMessage): AppServerEvent | null;
|
|
384
798
|
|
|
385
799
|
declare class CodexAppServerRequestError extends Error {
|
|
386
800
|
readonly error: JSONRPCErrorError;
|
|
@@ -405,6 +819,7 @@ declare class RequestSerializationQueues {
|
|
|
405
819
|
private readonly tails;
|
|
406
820
|
enqueue<T>(key: RequestSerializationQueueKey, work: () => Promise<T> | T): Promise<T>;
|
|
407
821
|
}
|
|
822
|
+
declare function requestSerializationQueueKeyFromScope(connectionId: number | string, scope: ClientRequestSerializationScope): RequestSerializationQueueKey;
|
|
408
823
|
|
|
409
824
|
type CodexAppServerRequestContext = {
|
|
410
825
|
connectionId: ConnectionId;
|
|
@@ -470,6 +885,7 @@ type CodexAppServerConnectionRequestOutcome = {
|
|
|
470
885
|
type CodexAppServerDeferredResponse = {
|
|
471
886
|
readonly __codexAppServerDeferredResponse: true;
|
|
472
887
|
};
|
|
888
|
+
declare function codexAppServerDeferredResponse(): CodexAppServerDeferredResponse;
|
|
473
889
|
declare class CodexAppServerMessageProcessor<Context = unknown> {
|
|
474
890
|
readonly connectionId: ConnectionId;
|
|
475
891
|
readonly requestSerializationQueues: RequestSerializationQueues;
|
|
@@ -750,6 +1166,7 @@ type ModelPreset = {
|
|
|
750
1166
|
is_default: boolean;
|
|
751
1167
|
supported_in_api: boolean;
|
|
752
1168
|
};
|
|
1169
|
+
type Model = ModelPreset;
|
|
753
1170
|
type ModelListParams = {
|
|
754
1171
|
cursor?: string | null;
|
|
755
1172
|
limit?: number | null;
|
|
@@ -801,7 +1218,7 @@ type ConfigToml = {
|
|
|
801
1218
|
base_instructions?: BaseInstructions | string | null;
|
|
802
1219
|
developer_instructions?: string | null;
|
|
803
1220
|
user_instructions?: string | null;
|
|
804
|
-
collaboration_mode?: CollaborationMode | null;
|
|
1221
|
+
collaboration_mode?: CollaborationMode$1 | null;
|
|
805
1222
|
session_source?: SessionSource;
|
|
806
1223
|
environments?: TurnEnvironmentSelection[];
|
|
807
1224
|
dynamic_tools?: DynamicToolSpec$1[];
|
|
@@ -836,7 +1253,7 @@ type ResolvedConfig = Required<Pick<ConfigToml, "model" | "model_provider" | "ap
|
|
|
836
1253
|
permission_profile: PermissionProfile;
|
|
837
1254
|
active_permission_profile: ActivePermissionProfile | null;
|
|
838
1255
|
windows_sandbox_level: WindowsSandboxLevel | null;
|
|
839
|
-
collaboration_mode: CollaborationMode;
|
|
1256
|
+
collaboration_mode: CollaborationMode$1;
|
|
840
1257
|
environments: TurnEnvironmentSelection[];
|
|
841
1258
|
dynamic_tools: DynamicToolSpec$1[];
|
|
842
1259
|
final_output_json_schema?: unknown;
|
|
@@ -1139,7 +1556,7 @@ type SessionSettingsUpdate = {
|
|
|
1139
1556
|
effort?: ReasoningEffortConfig | null;
|
|
1140
1557
|
summary?: ReasoningSummaryConfig;
|
|
1141
1558
|
service_tier?: ServiceTier | null;
|
|
1142
|
-
collaboration_mode?: CollaborationMode;
|
|
1559
|
+
collaboration_mode?: CollaborationMode$1;
|
|
1143
1560
|
personality?: Personality | null;
|
|
1144
1561
|
environments?: TurnEnvironmentSelection[];
|
|
1145
1562
|
persist_environments?: boolean;
|
|
@@ -1154,7 +1571,7 @@ type SessionConfiguration = {
|
|
|
1154
1571
|
provider: string;
|
|
1155
1572
|
model: string;
|
|
1156
1573
|
model_info?: ModelInfo | null;
|
|
1157
|
-
collaboration_mode: CollaborationMode;
|
|
1574
|
+
collaboration_mode: CollaborationMode$1;
|
|
1158
1575
|
reasoning_effort?: ReasoningEffortConfig | null;
|
|
1159
1576
|
reasoning_summary: ReasoningSummaryConfig;
|
|
1160
1577
|
service_tier?: ServiceTier | null;
|
|
@@ -1237,7 +1654,7 @@ declare class Session {
|
|
|
1237
1654
|
has_pending_input(): Promise<boolean>;
|
|
1238
1655
|
queue_response_items_for_next_turn(items: UserInput[]): Promise<void>;
|
|
1239
1656
|
take_queued_response_items_for_next_turn(): Promise<UserInput[]>;
|
|
1240
|
-
collaboration_mode(): CollaborationMode;
|
|
1657
|
+
collaboration_mode(): CollaborationMode$1;
|
|
1241
1658
|
granted_session_permissions(): RequestPermissionProfile[];
|
|
1242
1659
|
hooks(): Hooks;
|
|
1243
1660
|
agentControl(): AgentControl;
|
|
@@ -1245,7 +1662,7 @@ declare class Session {
|
|
|
1245
1662
|
strict_auto_review_enabled_for_turn(): boolean;
|
|
1246
1663
|
request_user_input(turnContext: TurnContext, callId: string, args: NormalizedRequestUserInputArgs): Promise<RequestUserInputResponse | null>;
|
|
1247
1664
|
request_permissions(turnContext: TurnContext, callId: string, args: RequestPermissionsArgs): Promise<RequestPermissionsResponse | null>;
|
|
1248
|
-
refresh_mcp_servers_now(turnContext: TurnContext, config: McpServerRefreshConfig, environment?: McpRuntimeEnvironment): Promise<void>;
|
|
1665
|
+
refresh_mcp_servers_now(turnContext: TurnContext, config: McpServerRefreshConfig, environment?: McpRuntimeEnvironment$1): Promise<void>;
|
|
1249
1666
|
refresh_mcp_servers_if_requested(turnContext: TurnContext, config?: McpServerRefreshConfig | null): Promise<void>;
|
|
1250
1667
|
list_mcp_server_statuses(): Promise<McpServerStatus[]>;
|
|
1251
1668
|
list_mcp_tools(): Promise<McpToolInfo[]>;
|
|
@@ -1332,7 +1749,7 @@ type WebSearchConfig = {
|
|
|
1332
1749
|
type ToolsConfig = {
|
|
1333
1750
|
namespace_tools: boolean;
|
|
1334
1751
|
request_permissions_tool_enabled: boolean;
|
|
1335
|
-
request_user_input_available_modes: readonly ModeKind[];
|
|
1752
|
+
request_user_input_available_modes: readonly ModeKind$1[];
|
|
1336
1753
|
search_tool: boolean;
|
|
1337
1754
|
web_search_mode: WebSearchMode | null;
|
|
1338
1755
|
web_search_tool_type: WebSearchToolType;
|
|
@@ -1350,7 +1767,7 @@ type DefaultToolsConfigInput = {
|
|
|
1350
1767
|
image_generation?: boolean;
|
|
1351
1768
|
web_search?: boolean;
|
|
1352
1769
|
request_permissions_tool_enabled?: boolean;
|
|
1353
|
-
request_user_input_available_modes?: readonly ModeKind[];
|
|
1770
|
+
request_user_input_available_modes?: readonly ModeKind$1[];
|
|
1354
1771
|
search_tool?: boolean;
|
|
1355
1772
|
web_search_mode?: WebSearchMode | null;
|
|
1356
1773
|
web_search_tool_type?: WebSearchToolType;
|
|
@@ -1392,7 +1809,7 @@ type TurnContextParams = {
|
|
|
1392
1809
|
model: string;
|
|
1393
1810
|
model_info?: ModelInfo | null;
|
|
1394
1811
|
personality?: Personality | null;
|
|
1395
|
-
collaboration_mode?: CollaborationMode | null;
|
|
1812
|
+
collaboration_mode?: CollaborationMode$1 | null;
|
|
1396
1813
|
effort?: ReasoningEffortConfig | null;
|
|
1397
1814
|
summary: ReasoningSummaryConfig;
|
|
1398
1815
|
service_tier?: ServiceTier | null;
|
|
@@ -1421,7 +1838,7 @@ declare class TurnContext {
|
|
|
1421
1838
|
readonly model: string;
|
|
1422
1839
|
readonly model_info: ModelInfo;
|
|
1423
1840
|
readonly personality?: Personality | null;
|
|
1424
|
-
readonly collaboration_mode?: CollaborationMode | null;
|
|
1841
|
+
readonly collaboration_mode?: CollaborationMode$1 | null;
|
|
1425
1842
|
readonly effort?: ReasoningEffortConfig | null;
|
|
1426
1843
|
readonly summary: ReasoningSummaryConfig;
|
|
1427
1844
|
readonly service_tier?: ServiceTier | null;
|
|
@@ -1996,4 +2413,4 @@ type CodexAppServerRuntime<Context = CodexAppServerRuntimeContext> = {
|
|
|
1996
2413
|
};
|
|
1997
2414
|
declare function createCodexAppServerRuntime<Context = CodexAppServerRuntimeContext>(options: CodexAppServerRuntimeOptions<Context>): CodexAppServerRuntime<Context>;
|
|
1998
2415
|
|
|
1999
|
-
export { type DynamicToolSpec as AppServerDynamicToolSpec, AppServerEvent$1 as AppServerEvent, ClientRequest, CodexAppServerConnectionSessionState, type CodexAppServerEventSink, CodexAppServerMessageProcessor, type CodexAppServerMessageProcessorOptions, type CodexAppServerMethodHandlers, type CodexAppServerOutgoingSink, type CodexAppServerRequestContext, CodexAppServerRequestError, type CodexAppServerRuntime, type CodexAppServerRuntimeContext, type CodexAppServerRuntimeOptions, type ConnectionId, type ConnectionOrigin, ConnectionRpcGate, ConnectionRpcGateClosedError, type CreateModelClientInput, DynamicToolSpec$1 as DynamicToolSpec, EmptyMcpConnectionManager, type Event, EventMsg, type JSONRPCError, JSONRPCErrorError$1 as JSONRPCErrorError, type JSONRPCMessage, LiveThread, McpRequestProcessor, type ModelClient, ModelClientSession, type ModelClientSessionHandle, OutgoingMessageSender, type RequestContext, RequestId, RequestSerializationQueues, type ResponseEvent, type ResponseStream, ResponsesClient, ResponsesWebsocketClient, ResponsesWebsocketConnection, Result$1 as Result, type RuntimeSession, ServerNotification, ServerRequest, StaticMcpConnectionManager, ThreadId, ThreadMemoryMode, ThreadRequestProcessor, ThreadScopedOutgoingMessageSender, ThreadStore, TurnRequestProcessor, TurnStartParams, TurnStartResponse, clientRequestExperimentalReason, clientRequestId, clientRequestMethod, clientRequestSerializationScope, createCodexAppServerRuntime, createModelClient, jsonRpcInternalError, jsonRpcInvalidRequestError, jsonRpcParseError, parseClientTransportPayload, parseServerTransportPayload, queuedOutgoingMessage, serializeJsonRpcError, serializeJsonRpcResponse, serializeOutgoingMessage };
|
|
2416
|
+
export { type CollaborationMode as AppServerCollaborationMode, type DynamicToolSpec as AppServerDynamicToolSpec, AppServerEvent$1 as AppServerEvent, ModeKind as AppServerModeKind, type AuthDotJson, AuthMode, BaseInstructions, CODEX_CHATGPT_OAUTH_CALLBACK_PATH, CODEX_CHATGPT_OAUTH_CLIENT_ID, CODEX_CHATGPT_OAUTH_FALLBACK_PORT, CODEX_CHATGPT_OAUTH_ISSUER, CODEX_CHATGPT_OAUTH_ORIGINATOR, CODEX_CHATGPT_OAUTH_PRIMARY_PORT, CODEX_CHATGPT_OAUTH_SCOPE, CODEX_PLAN_MODE_INSTRUCTIONS, type ChatgptOAuthTokenExchangeResponse, ClientRequest, type ClientRequestSerializationScope, type CodexAppServerConnectionRequestOutcome, CodexAppServerConnectionSessionState, type CodexAppServerDeferredResponse, type CodexAppServerEventSink, CodexAppServerMessageProcessor, type CodexAppServerMessageProcessorOptions, type CodexAppServerMethodHandlers, type CodexAppServerOutgoingSink, type CodexAppServerRequestContext, CodexAppServerRequestError, type CodexAppServerRuntime, type CodexAppServerRuntimeContext, type CodexAppServerRuntimeOptions, type CodexAuth, CodexMcpConnectionManagerAdapter, CollaborationMode$1 as CollaborationMode, CollaborationModeListParams, CollaborationModeListResponse, CollaborationModeMask, type ConnectionId, type ConnectionOrigin, type ConnectionRequestId, ConnectionRpcGate, ConnectionRpcGateClosedError, UserInput as CoreUserInput, type CreateModelClientInput, CreateThreadParams, DynamicToolSpec$1 as DynamicToolSpec, EmptyMcpConnectionManager, type Event, EventMsg, InitializeParams, InitializeResponse, type InitializedConnectionSessionState, type JSONRPCError, JSONRPCErrorError$1 as JSONRPCErrorError, type JSONRPCMessage, type JSONRPCNotification, type JSONRPCRequest, type JSONRPCResponse, ListMcpServerStatusParams, ListMcpServerStatusResponse, LiveThread, type McpConnectionManager, McpRequestProcessor, McpResourceInfo, McpResourceReadParams$1 as McpResourceReadParams, McpResourceReadResponse$1 as McpResourceReadResponse, McpResourceTemplateInfo, McpRuntimeEnvironment$1 as McpRuntimeEnvironment, McpServerOauthLoginParams, McpServerOauthLoginResponse, McpServerRefreshConfig, McpServerRefreshResponse, McpServerStatus, McpServerStatusListOptions, McpServerToolCallParams$1 as McpServerToolCallParams, McpServerToolCallResponse$1 as McpServerToolCallResponse, McpToolInfo, ModeKind$1 as ModeKind, type Model, type ModelClient, ModelClientSession, type ModelClientSessionHandle, type ModelPreset, Op, type OutgoingError, type OutgoingMessage, OutgoingMessageSender, type OutgoingResponse, type ParsedClientTransportMessage, type ParsedServerTransportMessage, type ParsedTransportPayload, type Prompt, type ProviderAccountState, type QueuedOutgoingMessage, type RequestContext, RequestId$1 as RequestId, type RequestSerializationQueueKey, RequestSerializationQueues, type ResponseCreateWsRequest, type ResponseEvent, type ResponseProcessedWsRequest, type ResponseStream, type ResponsesApiRequest, ResponsesClient, type ResponsesClientInput, ResponsesWebsocketClient, ResponsesWebsocketConnection, type ResponsesWsRequest, Result$1 as Result, ResumeThreadParams, RolloutItem, type RuntimeSession, SandboxPolicy, ServerNotification, ServerRequest, StaticMcpConnectionManager, StoredThread, StoredThreadHistory, Submission, ThreadArchiveParams, ThreadArchiveResponse, ThreadCompactStartParams, ThreadCompactStartResponse, ThreadId, ThreadListParams, ThreadListResponse, ThreadMemoryMode, ThreadMetadataPatch, ThreadMetadataUpdateParams, ThreadMetadataUpdateResponse, ThreadReadParams, ThreadReadResponse, ThreadRequestProcessor, ThreadResumeParams, ThreadResumeResponse, ThreadScopedOutgoingMessageSender, ThreadSetNameParams, ThreadSetNameResponse, ThreadStartParams, ThreadStartResponse, ThreadStore, ThreadUnarchiveParams, ThreadUnarchiveResponse, type TransportEvent, TurnInterruptParams, TurnInterruptResponse, TurnRequestProcessor, TurnStartParams, TurnStartResponse, TurnSteerParams, TurnSteerResponse, type WebSearchMode$1 as WebSearchMode, type WebSearchToolConfig, builtinCollaborationModePresets, clientRequestExperimentalReason, clientRequestId, clientRequestMethod, clientRequestSerializationScope, codexAppServerDeferredResponse, builtinCollaborationModePresets as codexBuiltinCollaborationModePresets, collaborationModePresetForMode, createCodexAppServerRuntime, createModelClient, defaultModeInstructions, jsonRpcInternalError, jsonRpcInvalidRequestError, jsonRpcParseError, normalizeCollaborationMode, outgoingMessageToAppServerEvent, parseClientTransportPayload, parseJsonRpcMessage, parseJsonRpcTransportPayload, parseServerTransportPayload, queuedOutgoingMessage, requestSerializationQueueKeyFromScope, serializeJsonRpcError, serializeJsonRpcResponse, serializeOutgoingMessage };
|