stitchkit 0.129.0 → 0.130.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/dist/agent-executor/acp/v1-connect.d.ts +87 -19
- package/dist/agent-executor/acp/v1-connect.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-driver.d.ts +4 -2
- package/dist/agent-executor/acp/v1-driver.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-handlers.d.ts +56 -0
- package/dist/agent-executor/acp/v1-handlers.d.ts.map +1 -0
- package/dist/agent-executor/acp/v1-map.d.ts +13 -2
- package/dist/agent-executor/acp/v1-map.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-permission.d.ts +44 -0
- package/dist/agent-executor/acp/v1-permission.d.ts.map +1 -0
- package/dist/agent-executor/acp/v1-protocol.d.ts +63 -10
- package/dist/agent-executor/acp/v1-protocol.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-session.d.ts +34 -7
- package/dist/agent-executor/acp/v1-session.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-turn.d.ts +51 -13
- package/dist/agent-executor/acp/v1-turn.d.ts.map +1 -1
- package/dist/agent-executor/claude/classify.d.ts +10 -0
- package/dist/agent-executor/claude/classify.d.ts.map +1 -1
- package/dist/agent-executor/claude/cli-driver.d.ts +4 -1
- package/dist/agent-executor/claude/cli-driver.d.ts.map +1 -1
- package/dist/agent-executor/claude/events.d.ts +146 -0
- package/dist/agent-executor/claude/events.d.ts.map +1 -0
- package/dist/agent-executor/claude/limits.d.ts +7 -1
- package/dist/agent-executor/claude/limits.d.ts.map +1 -1
- package/dist/agent-executor/claude/protocol.d.ts +49 -9
- package/dist/agent-executor/claude/protocol.d.ts.map +1 -1
- package/dist/agent-executor/claude/session.d.ts +2 -0
- package/dist/agent-executor/claude/session.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/controls.d.ts +10 -1
- package/dist/agent-executor/claude-sdk/controls.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/driver.d.ts +97 -3
- package/dist/agent-executor/claude-sdk/driver.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/probe.d.ts +29 -0
- package/dist/agent-executor/claude-sdk/probe.d.ts.map +1 -0
- package/dist/agent-executor/claude-sdk/query-loop.d.ts +53 -5
- package/dist/agent-executor/claude-sdk/query-loop.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/query-options.d.ts +2 -0
- package/dist/agent-executor/claude-sdk/query-options.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/session.d.ts +2 -3
- package/dist/agent-executor/claude-sdk/session.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/turn-usage.d.ts +81 -0
- package/dist/agent-executor/claude-sdk/turn-usage.d.ts.map +1 -0
- package/dist/agent-executor/codex/classify.d.ts +4 -0
- package/dist/agent-executor/codex/classify.d.ts.map +1 -1
- package/dist/agent-executor/codex/connect.d.ts +2 -1
- package/dist/agent-executor/codex/connect.d.ts.map +1 -1
- package/dist/agent-executor/codex/control-client.d.ts +168 -0
- package/dist/agent-executor/codex/control-client.d.ts.map +1 -0
- package/dist/agent-executor/codex/driver.d.ts +22 -2
- package/dist/agent-executor/codex/driver.d.ts.map +1 -1
- package/dist/agent-executor/codex/handlers.d.ts +47 -0
- package/dist/agent-executor/codex/handlers.d.ts.map +1 -0
- package/dist/agent-executor/codex/limits.d.ts.map +1 -1
- package/dist/agent-executor/codex/protocol.d.ts +124 -0
- package/dist/agent-executor/codex/protocol.d.ts.map +1 -1
- package/dist/agent-executor/codex/request-answers.d.ts +101 -0
- package/dist/agent-executor/codex/request-answers.d.ts.map +1 -0
- package/dist/agent-executor/codex/session-controls.d.ts +91 -51
- package/dist/agent-executor/codex/session-controls.d.ts.map +1 -1
- package/dist/agent-executor/codex/session.d.ts +34 -12
- package/dist/agent-executor/codex/session.d.ts.map +1 -1
- package/dist/agent-executor/codex/shared-server.d.ts +29 -0
- package/dist/agent-executor/codex/shared-server.d.ts.map +1 -0
- package/dist/agent-executor/codex/shared-thread.d.ts +46 -0
- package/dist/agent-executor/codex/shared-thread.d.ts.map +1 -0
- package/dist/agent-executor/codex/thread-controls.d.ts +128 -0
- package/dist/agent-executor/codex/thread-controls.d.ts.map +1 -0
- package/dist/agent-executor/codex/turn-input.d.ts +30 -0
- package/dist/agent-executor/codex/turn-input.d.ts.map +1 -0
- package/dist/agent-executor/contract.d.ts +77 -0
- package/dist/agent-executor/contract.d.ts.map +1 -1
- package/dist/agent-executor/engine.d.ts +6 -2
- package/dist/agent-executor/engine.d.ts.map +1 -1
- package/dist/agent-executor/executor-contract.d.ts +54 -0
- package/dist/agent-executor/executor-contract.d.ts.map +1 -1
- package/dist/agent-executor/handoff-schemas.d.ts +407 -0
- package/dist/agent-executor/handoff-schemas.d.ts.map +1 -0
- package/dist/agent-executor/handoff.d.ts +12 -0
- package/dist/agent-executor/handoff.d.ts.map +1 -0
- package/dist/agent-executor/hello.d.ts +72 -0
- package/dist/agent-executor/hello.d.ts.map +1 -1
- package/dist/agent-executor/image-input.d.ts +22 -0
- package/dist/agent-executor/image-input.d.ts.map +1 -1
- package/dist/agent-executor/projection.d.ts +2 -2
- package/dist/agent-executor/projection.d.ts.map +1 -1
- package/dist/agent-executor/session-primitives.d.ts +10 -1
- package/dist/agent-executor/session-primitives.d.ts.map +1 -1
- package/dist/agent-executor/testing/conformance.d.ts.map +1 -1
- package/dist/agent-executor/testing/replay-driver.d.ts +41 -0
- package/dist/agent-executor/testing/replay-driver.d.ts.map +1 -0
- package/dist/agent-executor/testing/replay-gate.d.ts +11 -0
- package/dist/agent-executor/testing/replay-gate.d.ts.map +1 -0
- package/dist/agent-executor/testing/replay-runner.d.ts +27 -0
- package/dist/agent-executor/testing/replay-runner.d.ts.map +1 -0
- package/dist/agent-executor/testing/replay-scenarios.d.ts +21 -0
- package/dist/agent-executor/testing/replay-scenarios.d.ts.map +1 -0
- package/dist/agent-executor/testing/replay-transcript.d.ts +296 -0
- package/dist/agent-executor/testing/replay-transcript.d.ts.map +1 -0
- package/dist/agent-executor/vocabulary.d.ts +135 -0
- package/dist/agent-executor/vocabulary.d.ts.map +1 -1
- package/dist/agent-runtime/branch-provider.d.ts +2 -2
- package/dist/agent-runtime/deferred-tool-selection.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/acp.d.ts +4 -1
- package/dist/entrypoints/agent-executor/acp.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/acp.js +847 -214
- package/dist/entrypoints/agent-executor/claude-sdk.d.ts +5 -1
- package/dist/entrypoints/agent-executor/claude-sdk.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/claude-sdk.js +713 -205
- package/dist/entrypoints/agent-executor/claude.js +44 -19
- package/dist/entrypoints/agent-executor/codex.d.ts +9 -2
- package/dist/entrypoints/agent-executor/codex.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/codex.js +1775 -359
- package/dist/entrypoints/agent-executor/testing.d.ts +4 -0
- package/dist/entrypoints/agent-executor/testing.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/testing.js +1002 -2
- package/dist/entrypoints/agent-executor.d.ts +4 -2
- package/dist/entrypoints/agent-executor.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor.js +411 -23
- package/dist/entrypoints/agent-runtime.js +4 -23
- package/dist/entrypoints/tools/mcp.d.ts +1 -0
- package/dist/entrypoints/tools/mcp.d.ts.map +1 -1
- package/dist/entrypoints/tools/mcp.js +1 -1
- package/dist/entrypoints/tools/toolkit.js +1 -1
- package/dist/{index-wv2amqm4.js → index-2s8sy57y.js} +36 -103
- package/dist/{index-afb6z77w.js → index-dbp6xemn.js} +75 -7
- package/dist/{index-bjmj2q1z.js → index-jrn3prgm.js} +1 -1
- package/dist/index-kne9g2c5.js +30 -0
- package/dist/index-p1qmpq0p.js +1300 -0
- package/dist/{index-7jqn3b3g.js → index-v759mzed.js} +152 -2
- package/dist/{index-cbhxhma2.js → index-x5ayy5bn.js} +1 -0
- package/dist/index-y0a4gt1s.js +142 -0
- package/dist/tools/internal/rank-tools.d.ts +10 -0
- package/dist/tools/internal/rank-tools.d.ts.map +1 -0
- package/dist/tools/mcp/handler.d.ts +7 -3
- package/dist/tools/mcp/handler.d.ts.map +1 -1
- package/dist/tools/mcp/lazy-discovery.d.ts +47 -0
- package/dist/tools/mcp/lazy-discovery.d.ts.map +1 -0
- package/dist/tools/mcp/mount.d.ts +7 -0
- package/dist/tools/mcp/mount.d.ts.map +1 -1
- package/dist/tools/mcp/register.d.ts +2 -2
- package/dist/tools/mcp/register.d.ts.map +1 -1
- package/llms/agent-executor-acp.txt +7 -8
- package/llms/agent-executor-claude-sdk.txt +4 -2
- package/llms/agent-executor-codex.txt +8 -4
- package/llms/agent-executor-testing.txt +5 -1
- package/llms/agent-executor.txt +7 -6
- package/llms/stitchkit.txt +74 -74
- package/llms/tools-mcp.txt +3 -2
- package/llms/tools.txt +24 -0
- package/llms/{upgrading-0.128.0-0.129.0.txt → upgrading-0.128.0-0.130.0.txt} +30 -3
- package/llms/upgrading.txt +1 -1
- package/llms-full.txt +159 -97
- package/llms.txt +8 -8
- package/package.json +1 -1
- package/dist/index-y71zn1gw.js +0 -586
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import type { InteractionReply } from '../executor-contract.js';
|
|
2
|
+
import type { JsonRpcPeer, JsonRpcValue } from '../json-rpc-peer.js';
|
|
3
|
+
import type { ExecutorProfileConfig } from '../profile.js';
|
|
4
|
+
import type { ExecutorStartupPhase } from '../vocabulary.js';
|
|
5
|
+
import { type CodexInjectItemsParams, type CodexListLoadedThreadsParams, type CodexListThreadsParams, type CodexRevertThreadParams, type CodexRevertThreadResult, type CodexSetThreadNameParams, type CodexThreadIdParams, type CodexUpdateThreadMetadataParams } from './thread-controls.js';
|
|
6
|
+
/** Parameters for Codex `thread/read`. */
|
|
7
|
+
export interface CodexReadThreadParams {
|
|
8
|
+
/** Thread identifier to inspect. */
|
|
9
|
+
readonly threadId: string;
|
|
10
|
+
/** When `true`, include full rollout turns (deprecated for large threads). */
|
|
11
|
+
readonly includeTurns?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/** Parameters for Codex `thread/turns/list`. */
|
|
14
|
+
export interface CodexListTurnsParams {
|
|
15
|
+
/** Thread identifier whose turns to list. */
|
|
16
|
+
readonly threadId: string;
|
|
17
|
+
/** Opaque continuation cursor returned by a previous page. */
|
|
18
|
+
readonly cursor?: string;
|
|
19
|
+
/** Optional page size (`uint32`). */
|
|
20
|
+
readonly limit?: number;
|
|
21
|
+
/** Level of item detail per turn (`notLoaded`, `summary`, or `full`). */
|
|
22
|
+
readonly itemsView?: 'notLoaded' | 'summary' | 'full';
|
|
23
|
+
/** Pagination direction (`asc` or `desc`). */
|
|
24
|
+
readonly sortDirection?: 'asc' | 'desc';
|
|
25
|
+
}
|
|
26
|
+
/** Starting position for a `thread/items/list` page: opaque string cursor or exclusive item anchor. */
|
|
27
|
+
export type CodexThreadItemsCursor = string | {
|
|
28
|
+
readonly type: 'item';
|
|
29
|
+
readonly itemId: string;
|
|
30
|
+
};
|
|
31
|
+
/** Output deferral preferences accepted by Codex `thread/items/list`. */
|
|
32
|
+
export interface CodexThreadItemsDeferOutput {
|
|
33
|
+
/** Defer nonempty output from successful commands. */
|
|
34
|
+
readonly commandExecution?: boolean;
|
|
35
|
+
/** Defer nonempty plain-text results from successful MCP tool calls. */
|
|
36
|
+
readonly mcpToolCall?: boolean;
|
|
37
|
+
}
|
|
38
|
+
/** Parameters for Codex `thread/items/list`. */
|
|
39
|
+
export interface CodexListItemsParams {
|
|
40
|
+
/** Thread identifier whose items to list. */
|
|
41
|
+
readonly threadId: string;
|
|
42
|
+
/** Optional turn identifier to filter items to one turn. */
|
|
43
|
+
readonly turnId?: string;
|
|
44
|
+
/** Opaque continuation cursor or exclusive item anchor within `turnId`. */
|
|
45
|
+
readonly cursor?: CodexThreadItemsCursor;
|
|
46
|
+
/** Optional page size (`uint32`). */
|
|
47
|
+
readonly limit?: number;
|
|
48
|
+
/** Pagination direction (`asc` or `desc`). */
|
|
49
|
+
readonly sortDirection?: 'asc' | 'desc';
|
|
50
|
+
/** Output deferral flags for single-turn item reads. */
|
|
51
|
+
readonly deferOutput?: CodexThreadItemsDeferOutput;
|
|
52
|
+
}
|
|
53
|
+
/** Read-only and inspection RPCs exposed during thread setup (`prepareThread` / `verifyThread`), on {@link CodexControlConnection}, and on {@link CodexSession}. */
|
|
54
|
+
export interface CodexControlClient {
|
|
55
|
+
/** Read effective Codex configuration (`config/read`). */
|
|
56
|
+
readConfig(params?: {
|
|
57
|
+
readonly cwd?: string;
|
|
58
|
+
readonly includeLayers?: boolean;
|
|
59
|
+
}): Promise<JsonRpcValue>;
|
|
60
|
+
/** Read thread metadata and live status (`thread/read`). */
|
|
61
|
+
readThread(params: CodexReadThreadParams): Promise<JsonRpcValue>;
|
|
62
|
+
/** List collaboration mode presets (`collaborationMode/list`). */
|
|
63
|
+
listCollaborationModes(): Promise<JsonRpcValue>;
|
|
64
|
+
/** List turns in a thread (`thread/turns/list`). */
|
|
65
|
+
listTurns(params: CodexListTurnsParams): Promise<JsonRpcValue>;
|
|
66
|
+
/** List items in a thread or single turn (`thread/items/list`). */
|
|
67
|
+
listItems(params: CodexListItemsParams): Promise<JsonRpcValue>;
|
|
68
|
+
/** List MCP servers and their statuses (`mcpServerStatus/list`). */
|
|
69
|
+
listMcpServerStatus(params?: {
|
|
70
|
+
readonly cursor?: string;
|
|
71
|
+
readonly limit?: number;
|
|
72
|
+
readonly threadId?: string;
|
|
73
|
+
readonly serverName?: string;
|
|
74
|
+
readonly detail?: string;
|
|
75
|
+
}): Promise<JsonRpcValue>;
|
|
76
|
+
/** List discovered Codex skills (`skills/list`). */
|
|
77
|
+
listSkills(params?: {
|
|
78
|
+
readonly cwds?: readonly string[];
|
|
79
|
+
readonly forceReload?: boolean;
|
|
80
|
+
}): Promise<JsonRpcValue>;
|
|
81
|
+
/** List available models (`model/list`). */
|
|
82
|
+
listModels(params?: {
|
|
83
|
+
readonly cursor?: string;
|
|
84
|
+
readonly limit?: number;
|
|
85
|
+
readonly includeHidden?: boolean;
|
|
86
|
+
readonly modelProvider?: string;
|
|
87
|
+
}): Promise<JsonRpcValue>;
|
|
88
|
+
/** Read active account information (`account/read`). */
|
|
89
|
+
readAccount(params?: {
|
|
90
|
+
readonly refreshToken?: boolean;
|
|
91
|
+
}): Promise<JsonRpcValue>;
|
|
92
|
+
/** Read the raw `account/rateLimits/read` response envelope. */
|
|
93
|
+
readRateLimits(): Promise<JsonRpcValue>;
|
|
94
|
+
/** Revert a thread's durable history to before `beforeTurnId` (`thread/revert`). */
|
|
95
|
+
revertThread(params: CodexRevertThreadParams): Promise<CodexRevertThreadResult>;
|
|
96
|
+
/** Append raw Responses API items to a thread's model-visible history (`thread/inject_items`). */
|
|
97
|
+
injectItems(params: CodexInjectItemsParams): Promise<JsonRpcValue>;
|
|
98
|
+
/** Unsubscribe this connection from a thread (`thread/unsubscribe`). */
|
|
99
|
+
unsubscribeThread(params: CodexThreadIdParams): Promise<JsonRpcValue>;
|
|
100
|
+
/** List threads with pagination and bounded filters (`thread/list`). */
|
|
101
|
+
listThreads(params?: CodexListThreadsParams): Promise<JsonRpcValue>;
|
|
102
|
+
/** List thread identifiers currently loaded in memory (`thread/loaded/list`). */
|
|
103
|
+
listLoadedThreads(params?: CodexListLoadedThreadsParams): Promise<JsonRpcValue>;
|
|
104
|
+
/** Archive a thread (`thread/archive`). */
|
|
105
|
+
archiveThread(params: CodexThreadIdParams): Promise<JsonRpcValue>;
|
|
106
|
+
/** Unarchive a thread (`thread/unarchive`). */
|
|
107
|
+
unarchiveThread(params: CodexThreadIdParams): Promise<JsonRpcValue>;
|
|
108
|
+
/** Patch stored metadata (such as Git info) for a thread (`thread/metadata/update`). */
|
|
109
|
+
updateThreadMetadata(params: CodexUpdateThreadMetadataParams): Promise<JsonRpcValue>;
|
|
110
|
+
/** Set a thread's display name (`thread/name/set`). */
|
|
111
|
+
setThreadName(params: CodexSetThreadNameParams): Promise<JsonRpcValue>;
|
|
112
|
+
}
|
|
113
|
+
/** Input to {@link CodexDriver.connectControl} for a threadless app-server connection. */
|
|
114
|
+
export interface CodexControlConnectInput {
|
|
115
|
+
readonly profile: ExecutorProfileConfig;
|
|
116
|
+
readonly cwd: string;
|
|
117
|
+
/** Optional observer invoked with startup phases (`spawning`, `initializing`) during connect. */
|
|
118
|
+
readonly onStartupPhase?: (phase: ExecutorStartupPhase) => void;
|
|
119
|
+
readonly signal?: AbortSignal;
|
|
120
|
+
}
|
|
121
|
+
/** Threadless connection to a Codex app-server for catalog/config reads and external observation. */
|
|
122
|
+
export interface CodexControlConnection extends CodexControlClient {
|
|
123
|
+
/** OS process id of the spawned `codex app-server`, or `undefined` when attached via `unix-connect`. */
|
|
124
|
+
readonly providerPid: number | undefined;
|
|
125
|
+
/** Answer a pending external server request received via `onServerRequest`. */
|
|
126
|
+
respond(interactionId: string, reply: InteractionReply['reply']): Promise<void>;
|
|
127
|
+
/** Close the connection cleanly (does not kill an external server in `unix-connect` mode). */
|
|
128
|
+
close(): Promise<void>;
|
|
129
|
+
}
|
|
130
|
+
/** Create the read/inspection control facade backed by an active Codex JSON-RPC peer. */
|
|
131
|
+
export declare function createCodexControlClient(input: {
|
|
132
|
+
peer: JsonRpcPeer;
|
|
133
|
+
ensureAlive(): void;
|
|
134
|
+
}): CodexControlClient;
|
|
135
|
+
/** Bind all thread-scoped {@link CodexControlClient} methods to default `threadId` to a session's `nativeThreadId`. */
|
|
136
|
+
export declare function bindCodexSessionThreadControls(controlClient: CodexControlClient, threadId: string): {
|
|
137
|
+
readThread(params?: Omit<CodexReadThreadParams, 'threadId'> & {
|
|
138
|
+
readonly threadId?: string;
|
|
139
|
+
}): Promise<import("zod").JSONType>;
|
|
140
|
+
listTurns(params?: Omit<CodexListTurnsParams, 'threadId'> & {
|
|
141
|
+
readonly threadId?: string;
|
|
142
|
+
}): Promise<import("zod").JSONType>;
|
|
143
|
+
listItems(params?: Omit<CodexListItemsParams, 'threadId'> & {
|
|
144
|
+
readonly threadId?: string;
|
|
145
|
+
}): Promise<import("zod").JSONType>;
|
|
146
|
+
revertThread(params: Omit<CodexRevertThreadParams, 'threadId'> & {
|
|
147
|
+
readonly threadId?: string;
|
|
148
|
+
}): Promise<CodexRevertThreadResult>;
|
|
149
|
+
injectItems(params: Omit<CodexInjectItemsParams, 'threadId'> & {
|
|
150
|
+
readonly threadId?: string;
|
|
151
|
+
}): Promise<import("zod").JSONType>;
|
|
152
|
+
unsubscribeThread(params?: {
|
|
153
|
+
readonly threadId?: string;
|
|
154
|
+
}): Promise<import("zod").JSONType>;
|
|
155
|
+
archiveThread(params?: {
|
|
156
|
+
readonly threadId?: string;
|
|
157
|
+
}): Promise<import("zod").JSONType>;
|
|
158
|
+
unarchiveThread(params?: {
|
|
159
|
+
readonly threadId?: string;
|
|
160
|
+
}): Promise<import("zod").JSONType>;
|
|
161
|
+
updateThreadMetadata(params?: Omit<CodexUpdateThreadMetadataParams, 'threadId'> & {
|
|
162
|
+
readonly threadId?: string;
|
|
163
|
+
}): Promise<import("zod").JSONType>;
|
|
164
|
+
setThreadName(params: Omit<CodexSetThreadNameParams, 'threadId'> & {
|
|
165
|
+
readonly threadId?: string;
|
|
166
|
+
}): Promise<import("zod").JSONType>;
|
|
167
|
+
};
|
|
168
|
+
//# sourceMappingURL=control-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-client.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/codex/control-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAExD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAIL,KA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,CAAC,EAAE,MAAM,CAAA;KAAE;IAOnF,SAAS,UACE,IAAI,CAAC,oBAAoB,EAAE,UAAU,CAAC,GAAG;QAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE;IAOlF,SAAS,UACE,IAAI,CAAC,oBAAoB,EAAE,UAAU,CAAC,GAAG;QAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE;IAOlF,YAAY,SACF,IAAI,CAAC,uBAAuB,EAAE,UAAU,CAAC,GAAG;QAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE;IAOpF,WAAW,SACD,IAAI,CAAC,sBAAsB,EAAE,UAAU,CAAC,GAAG;QAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE;IAOnF,iBAAiB,UAAU;QAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE;IAKzD,aAAa,UAAU;QAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE;IAKrD,eAAe,UAAU;QAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE;IAKvD,oBAAoB,UACT,IAAI,CAAC,+BAA+B,EAAE,UAAU,CAAC,GAAG;QAC3D,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;KAC5B;IAOH,aAAa,SACH,IAAI,CAAC,wBAAwB,EAAE,UAAU,CAAC,GAAG;QAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE;EAQxF"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { JsonRpcValue } from '../json-rpc-peer.js';
|
|
2
2
|
import { type CodexTransportConfig } from './connect.js';
|
|
3
|
+
import type { CodexControlClient } from './control-client.js';
|
|
4
|
+
import type { CodexNotificationEvent, CodexServerRequestEvent } from './handlers.js';
|
|
3
5
|
import { type CodexApprovalPolicy, type CodexSandboxMode, type CodexThreadContext } from './protocol.js';
|
|
4
|
-
import { type
|
|
6
|
+
import { type CodexDriver, type CodexOpenForkOptions, type CodexThreadPolicyOverrides } from './session-controls.js';
|
|
5
7
|
/** Configuration for {@link createCodexDriver}. */
|
|
6
8
|
export interface CodexDriverConfig {
|
|
7
9
|
/** The CLI to run. Default `codex`, found on the engine's `PATH`. */
|
|
@@ -39,9 +41,10 @@ export interface CodexDriverConfig {
|
|
|
39
41
|
readonly controls: CodexControlClient;
|
|
40
42
|
readonly cwd: string;
|
|
41
43
|
readonly nativeThreadId?: string;
|
|
44
|
+
readonly forkFrom?: CodexOpenForkOptions;
|
|
42
45
|
}) => Promise<CodexThreadPolicyOverrides | undefined> | CodexThreadPolicyOverrides | undefined;
|
|
43
46
|
/**
|
|
44
|
-
* Optional hook invoked immediately after `thread/start` or `thread/
|
|
47
|
+
* Optional hook invoked immediately after `thread/start`, `thread/resume`, or `thread/fork` succeeds.
|
|
45
48
|
* May inspect the applied `threadContext` or call `listMcpServerStatus`/`listSkills`;
|
|
46
49
|
* throwing fails `open()` and stops the connection cleanly.
|
|
47
50
|
*/
|
|
@@ -50,6 +53,23 @@ export interface CodexDriverConfig {
|
|
|
50
53
|
readonly threadContext: CodexThreadContext;
|
|
51
54
|
readonly controls: CodexControlClient;
|
|
52
55
|
}) => Promise<void> | void;
|
|
56
|
+
/**
|
|
57
|
+
* Optional observer invoked for every Codex app-server notification (both during `startTurn()`
|
|
58
|
+
* and for external/TUI turns or lifecycle updates like `thread/status/changed` and `turn/started`).
|
|
59
|
+
*/
|
|
60
|
+
onNotification?: (event: CodexNotificationEvent) => void;
|
|
61
|
+
/**
|
|
62
|
+
* Optional handler for known server requests (`commandExecution`, `fileChange`, `permissions`
|
|
63
|
+
* approvals, `requestUserInput`, and `mcpServer/elicitation/request`) arriving
|
|
64
|
+
* outside a driver-initiated `startTurn()` (for example from an attached TUI client).
|
|
65
|
+
* When omitted, requests outside `startTurn()` are refused `-32601`.
|
|
66
|
+
*/
|
|
67
|
+
onServerRequest?: (event: CodexServerRequestEvent) => void;
|
|
68
|
+
/**
|
|
69
|
+
* Optional callback invoked immediately when an established session or control connection drops
|
|
70
|
+
* unexpectedly before `close()` or caller signal abort (including idle socket disconnects).
|
|
71
|
+
*/
|
|
72
|
+
onDisconnect?: (error: Error) => void;
|
|
53
73
|
/** Read the bytes behind a `file` part's `reference`; without it a file part is refused. */
|
|
54
74
|
resolveFile?: (reference: string) => Promise<Uint8Array>;
|
|
55
75
|
/** Maximum decoded size of one image attachment in bytes. Default 5 MiB. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/codex/driver.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/codex/driver.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAe,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAIlE,OAAO,EACL,KAAK,oBAAoB,EAG1B,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,KAAK,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAElF,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EAExB,MAAM,YAAY,CAAC;AAMpB,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,EAEhC,MAAM,oBAAoB,CAAC;AAiD5B,mDAAmD;AACnD,MAAM,WAAW,iBAAiB;IAChC,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+FAA+F;IAC/F,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B;;;;OAIG;IACH,SAAS,CAAC,EAAE,oBAAoB,CAAC;IACjC,sIAAsI;IACtI,U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OAGG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACtC,4FAA4F;IAC5F,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IACzD,4EAA4E;IAC5E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;CACxD;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,GAAE,iBAAsB,GAAG,WAAW,CA8K7E"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { InteractionReply } from '../executor-contract.js';
|
|
2
|
+
import type { PlanLimits } from '../hello.js';
|
|
3
|
+
import { type JsonRpcValue } from '../json-rpc-peer.js';
|
|
4
|
+
import type { ExecutorDelta } from '../vocabulary.js';
|
|
5
|
+
import { type CodexServerRequestMethod, type CodexTurnSlot, type PendingExternalCodexRequest } from './request-answers.js';
|
|
6
|
+
/** Notification observed on a Codex app-server connection (both during and outside `startTurn()`). */
|
|
7
|
+
export interface CodexNotificationEvent {
|
|
8
|
+
/** Raw JSON-RPC notification method (e.g. `thread/status/changed`, `turn/started`, `item/plan/delta`). */
|
|
9
|
+
readonly method: string;
|
|
10
|
+
/** Raw JSON-RPC notification params as received from the server. */
|
|
11
|
+
readonly params: JsonRpcValue | undefined;
|
|
12
|
+
/** `true` when a driver-initiated `startTurn()` owned the thread as this notification arrived. */
|
|
13
|
+
readonly duringActiveTurn: boolean;
|
|
14
|
+
/** Normalized executor deltas produced by the classifier, including for external/TUI turns. */
|
|
15
|
+
readonly deltas: readonly ExecutorDelta[];
|
|
16
|
+
}
|
|
17
|
+
/** Server request received from Codex outside a driver-initiated `startTurn()` (for example from an attached TUI). */
|
|
18
|
+
export interface CodexServerRequestEvent {
|
|
19
|
+
/** JSON-RPC request identifier as a string, also carried on `delta.interactionId`. */
|
|
20
|
+
readonly interactionId: string;
|
|
21
|
+
/** Codex server request method (`requestApproval`, `requestUserInput`, or `mcpServer/elicitation/request`). */
|
|
22
|
+
readonly method: CodexServerRequestMethod;
|
|
23
|
+
/** Raw JSON-RPC request params as received from the server. */
|
|
24
|
+
readonly params: JsonRpcValue | undefined;
|
|
25
|
+
/** Normalized executor `request` delta preserving approval, permissions, question, or elicitation metadata. */
|
|
26
|
+
readonly delta: Extract<ExecutorDelta, {
|
|
27
|
+
type: 'request';
|
|
28
|
+
}>;
|
|
29
|
+
/** Answer this external server request once; throws `TypeError` if already resolved or invalid. */
|
|
30
|
+
respond(reply: InteractionReply['reply']): Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
interface CodexHandlersState {
|
|
33
|
+
profileId: string;
|
|
34
|
+
limits: Map<string, PlanLimits>;
|
|
35
|
+
externalPending: Map<string, PendingExternalCodexRequest>;
|
|
36
|
+
getTurn: () => CodexTurnSlot | undefined;
|
|
37
|
+
clearTurn: () => void;
|
|
38
|
+
onNotification?: (event: CodexNotificationEvent) => void;
|
|
39
|
+
onServerRequest?: (event: CodexServerRequestEvent) => void;
|
|
40
|
+
}
|
|
41
|
+
/** Create JSON-RPC notification and server-request handlers for a Codex session or control link. */
|
|
42
|
+
export declare function createCodexHandlers(state: CodexHandlersState): {
|
|
43
|
+
onNotification: (method: string, params: JsonRpcValue | undefined) => void;
|
|
44
|
+
onRequest: (method: string, params: JsonRpcValue | undefined, id: string | number) => Promise<import("zod").JSONType>;
|
|
45
|
+
};
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=handlers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/codex/handlers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM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ACzC,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,sBAAsB,KAAK,IAAI,CAAC;IACzD,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,IAAI,CAAC;CAC5D;AAiOD,oGAAoG;AACpG,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,kBAAkB;IAEzD,cAAc,WAAW,MAAM,UAAU,YAAY,GAAG,SAAS;IAEjE,SAAS,WAAW,MAAM,UAAU,YAAY,GAAG,SAAS,MAAM,MAAM,GAAG,MAAM;EAGpF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/codex/limits.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/codex/limits.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAoB,MAAM,UAAU,CAAC;AA0F7D;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,OAAO,GAAG,UAAU,EAAE,CAgDhE"}
|
|
@@ -97,7 +97,19 @@ export declare const CodexNotificationParams: {
|
|
|
97
97
|
inputTokens: z.ZodInt;
|
|
98
98
|
outputTokens: z.ZodInt;
|
|
99
99
|
cachedInputTokens: z.ZodOptional<z.ZodInt>;
|
|
100
|
+
cacheWriteInputTokens: z.ZodOptional<z.ZodInt>;
|
|
101
|
+
reasoningOutputTokens: z.ZodOptional<z.ZodInt>;
|
|
102
|
+
totalTokens: z.ZodOptional<z.ZodInt>;
|
|
100
103
|
}, z.core.$loose>;
|
|
104
|
+
total: z.ZodOptional<z.ZodObject<{
|
|
105
|
+
inputTokens: z.ZodOptional<z.ZodInt>;
|
|
106
|
+
outputTokens: z.ZodOptional<z.ZodInt>;
|
|
107
|
+
cachedInputTokens: z.ZodOptional<z.ZodInt>;
|
|
108
|
+
cacheWriteInputTokens: z.ZodOptional<z.ZodInt>;
|
|
109
|
+
reasoningOutputTokens: z.ZodOptional<z.ZodInt>;
|
|
110
|
+
totalTokens: z.ZodOptional<z.ZodInt>;
|
|
111
|
+
}, z.core.$loose>>;
|
|
112
|
+
modelContextWindow: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
101
113
|
}, z.core.$loose>;
|
|
102
114
|
}, z.core.$loose>;
|
|
103
115
|
readonly 'serverRequest/resolved': z.ZodObject<{
|
|
@@ -111,7 +123,28 @@ export declare const CodexNotificationParams: {
|
|
|
111
123
|
export declare const CodexApprovalParamsSchema: z.ZodObject<{
|
|
112
124
|
itemId: z.ZodString;
|
|
113
125
|
command: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
126
|
+
cwd: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
114
127
|
reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
128
|
+
grantRoot: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
129
|
+
kind: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
130
|
+
approvalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
131
|
+
commandActions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodJSONSchema>>>;
|
|
132
|
+
availableDecisions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodJSONSchema>>>;
|
|
133
|
+
}, z.core.$loose>;
|
|
134
|
+
export declare const CodexUserInputOptionSchema: z.ZodObject<{
|
|
135
|
+
label: z.ZodString;
|
|
136
|
+
description: z.ZodString;
|
|
137
|
+
}, z.core.$loose>;
|
|
138
|
+
export declare const CodexUserInputQuestionSchema: z.ZodObject<{
|
|
139
|
+
id: z.ZodString;
|
|
140
|
+
question: z.ZodString;
|
|
141
|
+
header: z.ZodString;
|
|
142
|
+
isOther: z.ZodOptional<z.ZodBoolean>;
|
|
143
|
+
isSecret: z.ZodOptional<z.ZodBoolean>;
|
|
144
|
+
options: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
145
|
+
label: z.ZodString;
|
|
146
|
+
description: z.ZodString;
|
|
147
|
+
}, z.core.$loose>>>>;
|
|
115
148
|
}, z.core.$loose>;
|
|
116
149
|
export declare const CodexUserInputParamsSchema: z.ZodObject<{
|
|
117
150
|
itemId: z.ZodString;
|
|
@@ -119,12 +152,93 @@ export declare const CodexUserInputParamsSchema: z.ZodObject<{
|
|
|
119
152
|
id: z.ZodString;
|
|
120
153
|
question: z.ZodString;
|
|
121
154
|
header: z.ZodString;
|
|
155
|
+
isOther: z.ZodOptional<z.ZodBoolean>;
|
|
156
|
+
isSecret: z.ZodOptional<z.ZodBoolean>;
|
|
157
|
+
options: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
158
|
+
label: z.ZodString;
|
|
159
|
+
description: z.ZodString;
|
|
160
|
+
}, z.core.$loose>>>>;
|
|
122
161
|
}, z.core.$loose>>;
|
|
123
162
|
}, z.core.$loose>;
|
|
124
163
|
/** Answers to `item/tool/requestUserInput`: question id → the chosen answers. */
|
|
125
164
|
export declare const CodexUserInputAnswersSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
126
165
|
answers: z.ZodArray<z.ZodString>;
|
|
127
166
|
}, z.core.$strict>>;
|
|
167
|
+
/** Permission profile requested or granted on `item/permissions/requestApproval`. */
|
|
168
|
+
export declare const CodexPermissionProfileSchema: z.ZodObject<{
|
|
169
|
+
fileSystem: z.ZodOptional<z.ZodNullable<z.ZodJSONSchema>>;
|
|
170
|
+
network: z.ZodOptional<z.ZodNullable<z.ZodJSONSchema>>;
|
|
171
|
+
}, z.core.$loose>;
|
|
172
|
+
/** Parameters of Codex `item/permissions/requestApproval` (0.171.0). */
|
|
173
|
+
export declare const CodexPermissionsApprovalParamsSchema: z.ZodObject<{
|
|
174
|
+
threadId: z.ZodString;
|
|
175
|
+
turnId: z.ZodString;
|
|
176
|
+
itemId: z.ZodString;
|
|
177
|
+
cwd: z.ZodString;
|
|
178
|
+
permissions: z.ZodObject<{
|
|
179
|
+
fileSystem: z.ZodOptional<z.ZodNullable<z.ZodJSONSchema>>;
|
|
180
|
+
network: z.ZodOptional<z.ZodNullable<z.ZodJSONSchema>>;
|
|
181
|
+
}, z.core.$loose>;
|
|
182
|
+
startedAtMs: z.ZodNumber;
|
|
183
|
+
reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
184
|
+
environmentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
185
|
+
}, z.core.$loose>;
|
|
186
|
+
/** Parameters of Codex `mcpServer/elicitation/request` across all four `oneOf` modes (0.171.0). */
|
|
187
|
+
export declare const CodexMcpElicitationParamsSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
188
|
+
serverName: z.ZodString;
|
|
189
|
+
threadId: z.ZodString;
|
|
190
|
+
turnId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
191
|
+
environmentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
192
|
+
message: z.ZodString;
|
|
193
|
+
_meta: z.ZodOptional<z.ZodJSONSchema>;
|
|
194
|
+
mode: z.ZodLiteral<"form">;
|
|
195
|
+
requestedSchema: z.ZodObject<{
|
|
196
|
+
type: z.ZodLiteral<"object">;
|
|
197
|
+
properties: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
|
|
198
|
+
required: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
199
|
+
$schema: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
200
|
+
}, z.core.$loose>;
|
|
201
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
202
|
+
serverName: z.ZodString;
|
|
203
|
+
threadId: z.ZodString;
|
|
204
|
+
turnId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
205
|
+
environmentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
206
|
+
message: z.ZodString;
|
|
207
|
+
_meta: z.ZodOptional<z.ZodJSONSchema>;
|
|
208
|
+
mode: z.ZodLiteral<"openai/form">;
|
|
209
|
+
requestedSchema: z.ZodJSONSchema;
|
|
210
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
211
|
+
serverName: z.ZodString;
|
|
212
|
+
threadId: z.ZodString;
|
|
213
|
+
turnId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
214
|
+
environmentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
215
|
+
message: z.ZodString;
|
|
216
|
+
_meta: z.ZodOptional<z.ZodJSONSchema>;
|
|
217
|
+
mode: z.ZodLiteral<"openaiForm">;
|
|
218
|
+
requestedSchema: z.ZodJSONSchema;
|
|
219
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
220
|
+
serverName: z.ZodString;
|
|
221
|
+
threadId: z.ZodString;
|
|
222
|
+
turnId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
223
|
+
environmentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
224
|
+
message: z.ZodString;
|
|
225
|
+
_meta: z.ZodOptional<z.ZodJSONSchema>;
|
|
226
|
+
mode: z.ZodLiteral<"url">;
|
|
227
|
+
elicitationId: z.ZodString;
|
|
228
|
+
url: z.ZodString;
|
|
229
|
+
}, z.core.$loose>], "mode">;
|
|
230
|
+
/** Elicitation request mode discriminated by Codex `mcpServer/elicitation/request`. */
|
|
231
|
+
export type CodexMcpElicitationMode = z.infer<typeof CodexMcpElicitationParamsSchema>['mode'];
|
|
232
|
+
/** Answer payload for `mcpServer/elicitation/request`, matching `McpServerElicitationRequestResponse`. */
|
|
233
|
+
export declare const CodexMcpElicitationAnswerSchema: z.ZodObject<{
|
|
234
|
+
action: z.ZodEnum<{
|
|
235
|
+
accept: "accept";
|
|
236
|
+
cancel: "cancel";
|
|
237
|
+
decline: "decline";
|
|
238
|
+
}>;
|
|
239
|
+
content: z.ZodOptional<z.ZodJSONSchema>;
|
|
240
|
+
_meta: z.ZodOptional<z.ZodJSONSchema>;
|
|
241
|
+
}, z.core.$strict>;
|
|
128
242
|
/** Applied thread policy and runtime context returned by `thread/start`, `thread/resume`, or `thread/fork`. */
|
|
129
243
|
export declare const CodexThreadContextSchema: z.ZodObject<{
|
|
130
244
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -202,19 +316,29 @@ export declare const CodexTurnsPageSchema: z.ZodObject<{
|
|
|
202
316
|
}, z.core.$loose>>;
|
|
203
317
|
nextCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
204
318
|
}, z.core.$loose>;
|
|
319
|
+
export declare const CodexThreadRevertResponseSchema: z.ZodObject<{
|
|
320
|
+
thread: z.ZodObject<{
|
|
321
|
+
id: z.ZodString;
|
|
322
|
+
}, z.core.$loose>;
|
|
323
|
+
turnsBackwardsCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
324
|
+
itemsBackwardsCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
325
|
+
}, z.core.$loose>;
|
|
205
326
|
/** Notifications the driver asks the server not to send: noise for a turn. */
|
|
206
327
|
export declare const CODEX_OPTED_OUT_NOTIFICATIONS: string[];
|
|
207
328
|
/** Notifications a turn sees and that carry nothing for it. */
|
|
208
329
|
export declare const CODEX_QUIET_NOTIFICATIONS: Set<string>;
|
|
209
330
|
/** Server requests the driver answers; every other is refused `-32601`. */
|
|
210
331
|
export declare const CODEX_APPROVAL_REQUESTS: Set<string>;
|
|
332
|
+
export declare const CODEX_PERMISSIONS_APPROVAL_REQUEST = "item/permissions/requestApproval";
|
|
211
333
|
export declare const CODEX_INPUT_REQUEST = "item/tool/requestUserInput";
|
|
334
|
+
export declare const CODEX_ELICITATION_REQUEST = "mcpServer/elicitation/request";
|
|
212
335
|
/**
|
|
213
336
|
* The decisions the driver answers an approval with, the same for a command and a file
|
|
214
337
|
* change: `deny` lets the agent continue the turn, `interrupted` interrupts it at once.
|
|
215
338
|
*/
|
|
216
339
|
export declare const CODEX_APPROVAL_DECISION: {
|
|
217
340
|
readonly approve: 'accept';
|
|
341
|
+
readonly approveForSession: 'acceptForSession';
|
|
218
342
|
readonly deny: 'decline';
|
|
219
343
|
readonly interrupted: 'cancel';
|
|
220
344
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/codex/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD;;;;;;GAMG;AAEH,iHAAiH;AACjH,MAAM,MAAM,mBAAmB,GAC3B,WAAW,GACX,YAAY,GACZ,YAAY,GACZ,OAAO,GACP,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC;AAE3C,gGAAgG;AAChG,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,iBAAiB,GAAG,oBAAoB,CAAC;AAEtF,0DAA0D;AAC1D,eAAO,MAAM,4BAA4B;;;;;;;;;;kBAOvC,CAAC;AACH,kEAAkE;AAClE,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF,eAAO,MAAM,qBAAqB;;;iBAGhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;iBAU1B,CAAC;
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/codex/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD;;;;;;GAMG;AAEH,iHAAiH;AACjH,MAAM,MAAM,mBAAmB,GAC3B,WAAW,GACX,YAAY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AAE,kBAAkB;aACrC,IAAI,EAAE,SAAS;aACf,WAAW,EAAE,QAAQ;CACb,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { type EngineRequestTurn } from '../engine-requests.js';
|
|
2
|
+
import { type InteractionReply } from '../executor-contract.js';
|
|
3
|
+
import type { JsonRpcValue } from '../json-rpc-peer.js';
|
|
4
|
+
import type { CodexTurnState } from './classify.js';
|
|
5
|
+
import { type CodexMcpElicitationMode } from './protocol.js';
|
|
6
|
+
/** Known Codex app-server request methods handled by the driver. */
|
|
7
|
+
export type CodexServerRequestMethod = 'item/commandExecution/requestApproval' | 'item/fileChange/requestApproval' | 'item/permissions/requestApproval' | 'item/tool/requestUserInput' | 'mcpServer/elicitation/request';
|
|
8
|
+
/** Metadata kept with one held Codex approval, permissions, user-input, or MCP elicitation request. */
|
|
9
|
+
export interface CodexRequestDetail {
|
|
10
|
+
readonly method: CodexServerRequestMethod;
|
|
11
|
+
readonly kind?: string;
|
|
12
|
+
readonly availableDecisions?: readonly JsonRpcValue[];
|
|
13
|
+
readonly permissions?: JsonRpcValue;
|
|
14
|
+
readonly elicitationMode?: CodexMcpElicitationMode;
|
|
15
|
+
}
|
|
16
|
+
/** The turn running in a session, and the engine's requests it is still to answer. */
|
|
17
|
+
export interface CodexTurnSlot extends EngineRequestTurn<JsonRpcValue, CodexRequestDetail> {
|
|
18
|
+
readonly state: CodexTurnState;
|
|
19
|
+
codexTurnId?: string;
|
|
20
|
+
}
|
|
21
|
+
/** An external/TUI server request held outside `startTurn()`. */
|
|
22
|
+
export interface PendingExternalCodexRequest {
|
|
23
|
+
readonly detail: CodexRequestDetail;
|
|
24
|
+
readonly turnId: string;
|
|
25
|
+
resolve(answer: JsonRpcValue): void;
|
|
26
|
+
}
|
|
27
|
+
export declare function isKnownCodexRequestMethod(method: string): method is CodexServerRequestMethod;
|
|
28
|
+
/** Extract a non-empty Codex turn identifier from raw notification/request params when present. */
|
|
29
|
+
export declare function externalCodexTurnIdOf(params: unknown): string;
|
|
30
|
+
export declare function parseCodexApprovalRequest(method: CodexServerRequestMethod, params: unknown): {
|
|
31
|
+
detail: CodexRequestDetail;
|
|
32
|
+
deltaFields: {
|
|
33
|
+
callId?: string | undefined;
|
|
34
|
+
prompt?: string | undefined;
|
|
35
|
+
input?: import("zod").JSONType | undefined;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export declare function parseCodexInputRequest(params: unknown): {
|
|
39
|
+
detail: CodexRequestDetail;
|
|
40
|
+
deltaFields: {
|
|
41
|
+
callId?: string | undefined;
|
|
42
|
+
input: import("zod").JSONType;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
export declare function parseCodexPermissionsRequest(params: unknown): {
|
|
46
|
+
detail: CodexRequestDetail;
|
|
47
|
+
deltaFields: {
|
|
48
|
+
callId?: string | undefined;
|
|
49
|
+
prompt?: string | undefined;
|
|
50
|
+
input: import("zod").JSONType;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
export declare function parseCodexElicitationRequest(params: unknown): {
|
|
54
|
+
detail: CodexRequestDetail;
|
|
55
|
+
deltaFields: {
|
|
56
|
+
callId?: string | undefined;
|
|
57
|
+
toolName?: string | undefined;
|
|
58
|
+
prompt: string;
|
|
59
|
+
input: import("zod").JSONType;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
/** Parse any known Codex server request into its normalized delta kind, fields, and held detail. */
|
|
63
|
+
export declare function parseCodexServerRequest(method: CodexServerRequestMethod, params: unknown): {
|
|
64
|
+
detail: CodexRequestDetail;
|
|
65
|
+
deltaFields: {
|
|
66
|
+
callId?: string | undefined;
|
|
67
|
+
prompt?: string | undefined;
|
|
68
|
+
input?: import("zod").JSONType | undefined;
|
|
69
|
+
};
|
|
70
|
+
kind: 'approval';
|
|
71
|
+
} | {
|
|
72
|
+
detail: CodexRequestDetail;
|
|
73
|
+
deltaFields: {
|
|
74
|
+
callId?: string | undefined;
|
|
75
|
+
input: import("zod").JSONType;
|
|
76
|
+
};
|
|
77
|
+
kind: 'input';
|
|
78
|
+
};
|
|
79
|
+
export declare function codexStoppedAnswer(method: string): JsonRpcValue;
|
|
80
|
+
export declare const codexStopped: (waiting: {
|
|
81
|
+
detail: {
|
|
82
|
+
method: string;
|
|
83
|
+
};
|
|
84
|
+
}) => import("zod").JSONType;
|
|
85
|
+
/**
|
|
86
|
+
* Validate and build the Codex JSON-RPC response payload for one held approval, permissions,
|
|
87
|
+
* user-input, or MCP elicitation request. Refuses unsupported `updatedInput`, invalid kinds,
|
|
88
|
+
* `humanCommand` session approvals, or disallowed `availableDecisions` before state is mutated.
|
|
89
|
+
*/
|
|
90
|
+
export declare function buildCodexRequestAnswer(detail: CodexRequestDetail, rawReply: InteractionReply['reply']): JsonRpcValue;
|
|
91
|
+
/** Answer one pending request owned by the active turn (`turn.respond`). */
|
|
92
|
+
export declare function answerActiveCodexTurnRequest(turn: CodexTurnSlot, interactionId: string, rawReply: InteractionReply['reply']): void;
|
|
93
|
+
/** Answer one pending external request (`event.respond` / `session.respond` / `control.respond`). */
|
|
94
|
+
export declare function answerCodexSessionRequest(input: {
|
|
95
|
+
turn: CodexTurnSlot | undefined;
|
|
96
|
+
externalPending: Map<string, PendingExternalCodexRequest>;
|
|
97
|
+
expectedEntry?: PendingExternalCodexRequest;
|
|
98
|
+
interactionId: string;
|
|
99
|
+
reply: InteractionReply['reply'];
|
|
100
|
+
}): void;
|
|
101
|
+
//# sourceMappingURL=request-answers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-answers.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/codex/request-answers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAAE,KAAK,gBAAgB,EAA0B,MAAM,sBAAsB,CAAC;AACrF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,KAA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