stitchkit 0.130.0 → 0.131.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.
Files changed (148) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/dist/agent-executor/acp/v1-connect.d.ts +40 -26
  3. package/dist/agent-executor/acp/v1-connect.d.ts.map +1 -1
  4. package/dist/agent-executor/acp/v1-driver.d.ts +10 -4
  5. package/dist/agent-executor/acp/v1-driver.d.ts.map +1 -1
  6. package/dist/agent-executor/acp/v1-handlers.d.ts +6 -2
  7. package/dist/agent-executor/acp/v1-handlers.d.ts.map +1 -1
  8. package/dist/agent-executor/acp/v1-probe.d.ts +38 -0
  9. package/dist/agent-executor/acp/v1-probe.d.ts.map +1 -0
  10. package/dist/agent-executor/acp/v1-protocol.d.ts +15 -0
  11. package/dist/agent-executor/acp/v1-protocol.d.ts.map +1 -1
  12. package/dist/agent-executor/acp/v1-session.d.ts +9 -7
  13. package/dist/agent-executor/acp/v1-session.d.ts.map +1 -1
  14. package/dist/agent-executor/claude/cli-driver.d.ts +7 -7
  15. package/dist/agent-executor/claude/cli-driver.d.ts.map +1 -1
  16. package/dist/agent-executor/claude/limits.d.ts +6 -4
  17. package/dist/agent-executor/claude/limits.d.ts.map +1 -1
  18. package/dist/agent-executor/claude/session.d.ts +3 -3
  19. package/dist/agent-executor/claude/session.d.ts.map +1 -1
  20. package/dist/agent-executor/claude-sdk/controls.d.ts +1 -0
  21. package/dist/agent-executor/claude-sdk/controls.d.ts.map +1 -1
  22. package/dist/agent-executor/claude-sdk/driver.d.ts +51 -50
  23. package/dist/agent-executor/claude-sdk/driver.d.ts.map +1 -1
  24. package/dist/agent-executor/claude-sdk/probe.d.ts +3 -3
  25. package/dist/agent-executor/claude-sdk/probe.d.ts.map +1 -1
  26. package/dist/agent-executor/claude-sdk/query-loop.d.ts +2 -1
  27. package/dist/agent-executor/claude-sdk/query-loop.d.ts.map +1 -1
  28. package/dist/agent-executor/codex/classify.d.ts.map +1 -1
  29. package/dist/agent-executor/codex/connect.d.ts +9 -7
  30. package/dist/agent-executor/codex/connect.d.ts.map +1 -1
  31. package/dist/agent-executor/codex/control-client.d.ts +112 -87
  32. package/dist/agent-executor/codex/control-client.d.ts.map +1 -1
  33. package/dist/agent-executor/codex/control-read-methods.d.ts +7 -0
  34. package/dist/agent-executor/codex/control-read-methods.d.ts.map +1 -0
  35. package/dist/agent-executor/codex/driver.d.ts +42 -31
  36. package/dist/agent-executor/codex/driver.d.ts.map +1 -1
  37. package/dist/agent-executor/codex/event-routing.d.ts +14 -0
  38. package/dist/agent-executor/codex/event-routing.d.ts.map +1 -0
  39. package/dist/agent-executor/codex/handlers.d.ts +9 -4
  40. package/dist/agent-executor/codex/handlers.d.ts.map +1 -1
  41. package/dist/agent-executor/codex/limits.d.ts +9 -3
  42. package/dist/agent-executor/codex/limits.d.ts.map +1 -1
  43. package/dist/agent-executor/codex/notifications.d.ts +183 -0
  44. package/dist/agent-executor/codex/notifications.d.ts.map +1 -0
  45. package/dist/agent-executor/codex/pagination.d.ts +54 -0
  46. package/dist/agent-executor/codex/pagination.d.ts.map +1 -0
  47. package/dist/agent-executor/codex/protocol.d.ts +586 -144
  48. package/dist/agent-executor/codex/protocol.d.ts.map +1 -1
  49. package/dist/agent-executor/codex/request-answers.d.ts +4 -2
  50. package/dist/agent-executor/codex/request-answers.d.ts.map +1 -1
  51. package/dist/agent-executor/codex/responses.d.ts +855 -0
  52. package/dist/agent-executor/codex/responses.d.ts.map +1 -0
  53. package/dist/agent-executor/codex/session-bind.d.ts +410 -0
  54. package/dist/agent-executor/codex/session-bind.d.ts.map +1 -0
  55. package/dist/agent-executor/codex/session-controls.d.ts +21 -169
  56. package/dist/agent-executor/codex/session-controls.d.ts.map +1 -1
  57. package/dist/agent-executor/codex/session-types.d.ts +190 -0
  58. package/dist/agent-executor/codex/session-types.d.ts.map +1 -0
  59. package/dist/agent-executor/codex/session.d.ts +5 -53
  60. package/dist/agent-executor/codex/session.d.ts.map +1 -1
  61. package/dist/agent-executor/codex/shared-server.d.ts +7 -5
  62. package/dist/agent-executor/codex/shared-server.d.ts.map +1 -1
  63. package/dist/agent-executor/codex/shared-thread.d.ts +8 -8
  64. package/dist/agent-executor/codex/shared-thread.d.ts.map +1 -1
  65. package/dist/agent-executor/codex/thread-controls.d.ts +61 -36
  66. package/dist/agent-executor/codex/thread-controls.d.ts.map +1 -1
  67. package/dist/agent-executor/codex/thread-list-query.d.ts +5 -0
  68. package/dist/agent-executor/codex/thread-list-query.d.ts.map +1 -0
  69. package/dist/agent-executor/codex/thread-open.d.ts +66 -0
  70. package/dist/agent-executor/codex/thread-open.d.ts.map +1 -0
  71. package/dist/agent-executor/codex/turn-input.d.ts +25 -7
  72. package/dist/agent-executor/codex/turn-input.d.ts.map +1 -1
  73. package/dist/agent-executor/codex/unix-socket-target.d.ts +12 -3
  74. package/dist/agent-executor/codex/unix-socket-target.d.ts.map +1 -1
  75. package/dist/agent-executor/codex/ws-frame.d.ts +4 -1
  76. package/dist/agent-executor/codex/ws-frame.d.ts.map +1 -1
  77. package/dist/agent-executor/contract.d.ts +3 -1
  78. package/dist/agent-executor/contract.d.ts.map +1 -1
  79. package/dist/agent-executor/engine-process.d.ts +4 -4
  80. package/dist/agent-executor/engine-process.d.ts.map +1 -1
  81. package/dist/agent-executor/engine.d.ts +3 -3
  82. package/dist/agent-executor/engine.d.ts.map +1 -1
  83. package/dist/agent-executor/handoff.d.ts.map +1 -1
  84. package/dist/agent-executor/hello.d.ts +7 -0
  85. package/dist/agent-executor/hello.d.ts.map +1 -1
  86. package/dist/agent-executor/json-rpc-peer.d.ts +9 -4
  87. package/dist/agent-executor/json-rpc-peer.d.ts.map +1 -1
  88. package/dist/agent-executor/leases.d.ts +1 -1
  89. package/dist/agent-executor/leases.d.ts.map +1 -1
  90. package/dist/agent-executor/plan-limits.d.ts +12 -1
  91. package/dist/agent-executor/plan-limits.d.ts.map +1 -1
  92. package/dist/agent-executor/profile.d.ts +7 -0
  93. package/dist/agent-executor/profile.d.ts.map +1 -1
  94. package/dist/agent-executor/session-primitives.d.ts +8 -0
  95. package/dist/agent-executor/session-primitives.d.ts.map +1 -1
  96. package/dist/agent-executor/testing/consumer-stubs.d.ts +45 -0
  97. package/dist/agent-executor/testing/consumer-stubs.d.ts.map +1 -0
  98. package/dist/agent-executor/testing/fake-claude-sdk-query.d.ts +88 -0
  99. package/dist/agent-executor/testing/fake-claude-sdk-query.d.ts.map +1 -0
  100. package/dist/agent-executor/testing/fake-codex-app-server.d.ts +56 -0
  101. package/dist/agent-executor/testing/fake-codex-app-server.d.ts.map +1 -0
  102. package/dist/agent-executor/testing/fixtures.d.ts +26 -0
  103. package/dist/agent-executor/testing/fixtures.d.ts.map +1 -0
  104. package/dist/agent-executor/testing/replay-driver.d.ts +8 -8
  105. package/dist/agent-executor/testing/replay-driver.d.ts.map +1 -1
  106. package/dist/agent-executor/testing/replay-runner.d.ts +3 -2
  107. package/dist/agent-executor/testing/replay-runner.d.ts.map +1 -1
  108. package/dist/agent-executor/testing/replay-transcript.d.ts +5 -3
  109. package/dist/agent-executor/testing/replay-transcript.d.ts.map +1 -1
  110. package/dist/agent-runtime/branch-observations.d.ts +5 -5
  111. package/dist/entrypoints/agent-executor/acp.d.ts +2 -1
  112. package/dist/entrypoints/agent-executor/acp.d.ts.map +1 -1
  113. package/dist/entrypoints/agent-executor/acp.js +284 -82
  114. package/dist/entrypoints/agent-executor/claude-sdk.d.ts +4 -0
  115. package/dist/entrypoints/agent-executor/claude-sdk.d.ts.map +1 -1
  116. package/dist/entrypoints/agent-executor/claude-sdk.js +58 -32
  117. package/dist/entrypoints/agent-executor/claude.d.ts +2 -2
  118. package/dist/entrypoints/agent-executor/claude.d.ts.map +1 -1
  119. package/dist/entrypoints/agent-executor/claude.js +25 -20
  120. package/dist/entrypoints/agent-executor/codex.d.ts +11 -6
  121. package/dist/entrypoints/agent-executor/codex.d.ts.map +1 -1
  122. package/dist/entrypoints/agent-executor/codex.js +2223 -1803
  123. package/dist/entrypoints/agent-executor/testing.d.ts +4 -0
  124. package/dist/entrypoints/agent-executor/testing.d.ts.map +1 -1
  125. package/dist/entrypoints/agent-executor/testing.js +880 -18
  126. package/dist/entrypoints/agent-executor.d.ts +3 -3
  127. package/dist/entrypoints/agent-executor.d.ts.map +1 -1
  128. package/dist/entrypoints/agent-executor.js +42 -8
  129. package/dist/entrypoints/process.js +3 -3
  130. package/dist/{index-jrn3prgm.js → index-32vaajec.js} +29 -4
  131. package/dist/{index-p1qmpq0p.js → index-64e9p079.js} +92 -56
  132. package/dist/{index-dbp6xemn.js → index-g2d9kws8.js} +199 -3
  133. package/dist/index-gm9yz82v.js +56 -0
  134. package/dist/index-j15dhkda.js +749 -0
  135. package/dist/{index-1q0n6zek.js → index-kwsr7j5k.js} +84 -44
  136. package/llms/agent-executor-acp.txt +5 -5
  137. package/llms/agent-executor-claude-sdk.txt +3 -1
  138. package/llms/agent-executor-claude.txt +2 -2
  139. package/llms/agent-executor-codex.txt +13 -10
  140. package/llms/agent-executor-testing.txt +5 -1
  141. package/llms/agent-executor.txt +4 -4
  142. package/llms/stitchkit.txt +75 -74
  143. package/llms/{upgrading-0.128.0-0.130.0.txt → upgrading-0.128.0-0.131.0.txt} +56 -3
  144. package/llms/upgrading.txt +1 -1
  145. package/llms-full.txt +160 -97
  146. package/llms.txt +8 -8
  147. package/package.json +3 -3
  148. package/dist/index-2s8sy57y.js +0 -229
@@ -0,0 +1 @@
1
+ {"version":3,"file":"responses.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/codex/responses.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,0HAA0H;AAC1H,eAAO,MAAM,wBAAwB,gCAAoB,CAAC;AAE1D,yDAAyD;AACzD,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAGx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AAC,KAAK,CAClD,OAAO,oCAAoC,CAC5C,CAAC;AAEF,8DAA8D;AAC9D,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAE7C,CAAC;AAEH,qDAAqD;AACrD,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAE9F,oEAAoE;AACpE,eAAO,MAAM,uCAAuC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAElD,CAAC;AAEH,2DAA2D;AAC3D,MAAM,MAAM,iCAAiC,GAAG,CAAC,CAAC,KAAK,CACrD,OAAO,uCAAuC,CAC/C,CAAC"}
@@ -0,0 +1,410 @@
1
+ import type { CodexControlClient, CodexListItemsParams, CodexListTurnsParams, CodexReadThreadParams } from './control-client.js';
2
+ import type { CodexInjectItemsParams, CodexInterruptTurnParams, CodexRevertThreadParams, CodexRpcCallOptions, CodexSetThreadNameParams, CodexUpdateThreadMetadataParams } from './thread-controls.js';
3
+ import type { CodexResumeThreadParams } from './thread-open.js';
4
+ /**
5
+ * Bind all thread-scoped {@link CodexControlClient} methods to default `threadId` to a session's
6
+ * `nativeThreadId`. `startThreadTurn` stays unbound so callers always supply `threadId` explicitly
7
+ * rather than confusing it with slot-managed {@link CodexSession.startTurn}.
8
+ */
9
+ export declare function bindCodexSessionThreadControls(controlClient: CodexControlClient, threadId: string): {
10
+ readThread(params?: Omit<CodexReadThreadParams, 'threadId'> & {
11
+ readonly threadId?: string | undefined;
12
+ }, options?: CodexRpcCallOptions): Promise<{
13
+ [x: string]: unknown;
14
+ thread: {
15
+ [x: string]: unknown;
16
+ id: string;
17
+ name?: string | null | undefined;
18
+ preview?: string | undefined;
19
+ cwd?: string | undefined;
20
+ model?: string | null | undefined;
21
+ modelProvider?: string | undefined;
22
+ reasoningEffort?: string | null | undefined;
23
+ status?: {
24
+ [x: string]: unknown;
25
+ type: "notLoaded";
26
+ } | {
27
+ [x: string]: unknown;
28
+ type: "idle";
29
+ } | {
30
+ [x: string]: unknown;
31
+ type: "systemError";
32
+ } | {
33
+ [x: string]: unknown;
34
+ type: "active";
35
+ activeFlags: string[];
36
+ } | ({
37
+ readonly type: string;
38
+ } & {
39
+ readonly activeFlags?: never;
40
+ }) | undefined;
41
+ canAcceptDirectInput?: boolean | null | undefined;
42
+ cliVersion?: string | undefined;
43
+ createdAt?: number | undefined;
44
+ updatedAt?: number | undefined;
45
+ recencyAt?: number | null | undefined;
46
+ ephemeral?: boolean | undefined;
47
+ path?: string | null | undefined;
48
+ source?: import("zod").JSONType | undefined;
49
+ sessionId?: string | undefined;
50
+ projectId?: string | null | undefined;
51
+ forkedFromId?: string | null | undefined;
52
+ parentThreadId?: string | null | undefined;
53
+ attachedToThreadId?: string | null | undefined;
54
+ originator?: string | null | undefined;
55
+ agentNickname?: string | null | undefined;
56
+ agentRole?: string | null | undefined;
57
+ gitInfo?: import("zod").JSONType | undefined;
58
+ turns?: {
59
+ [x: string]: unknown;
60
+ id: string;
61
+ status: "completed" | "failed" | "inProgress" | "interrupted";
62
+ error?: {
63
+ [x: string]: unknown;
64
+ message: string;
65
+ codexErrorInfo?: import("zod").JSONType | undefined;
66
+ } | null | undefined;
67
+ startedAt?: number | null | undefined;
68
+ completedAt?: number | null | undefined;
69
+ durationMs?: number | null | undefined;
70
+ rootTurnId?: string | null | undefined;
71
+ items: {
72
+ [x: string]: unknown;
73
+ type: string;
74
+ clientId?: string | null | undefined;
75
+ }[];
76
+ itemsView?: "full" | "notLoaded" | "summary" | (string & Record<never, never>) | undefined;
77
+ }[] | undefined;
78
+ };
79
+ readState?: import("zod").JSONType | undefined;
80
+ }>;
81
+ listTurns(params?: Omit<CodexListTurnsParams, 'threadId'> & {
82
+ readonly threadId?: string | undefined;
83
+ }, options?: CodexRpcCallOptions): Promise<{
84
+ [x: string]: unknown;
85
+ data: {
86
+ [x: string]: unknown;
87
+ id: string;
88
+ status: "completed" | "failed" | "inProgress" | "interrupted";
89
+ error?: {
90
+ [x: string]: unknown;
91
+ message: string;
92
+ codexErrorInfo?: import("zod").JSONType | undefined;
93
+ } | null | undefined;
94
+ startedAt?: number | null | undefined;
95
+ completedAt?: number | null | undefined;
96
+ durationMs?: number | null | undefined;
97
+ rootTurnId?: string | null | undefined;
98
+ items: {
99
+ [x: string]: unknown;
100
+ type: string;
101
+ clientId?: string | null | undefined;
102
+ }[];
103
+ itemsView?: "full" | "notLoaded" | "summary" | (string & Record<never, never>) | undefined;
104
+ }[];
105
+ nextCursor?: string | null | undefined;
106
+ backwardsCursor?: string | null | undefined;
107
+ }>;
108
+ listItems(params?: Omit<CodexListItemsParams, 'threadId'> & {
109
+ readonly threadId?: string | undefined;
110
+ }, options?: CodexRpcCallOptions): Promise<{
111
+ [x: string]: unknown;
112
+ data: {
113
+ [x: string]: unknown;
114
+ turnId: string;
115
+ item: {
116
+ [x: string]: unknown;
117
+ type: string;
118
+ id: string;
119
+ };
120
+ outputDeferred?: boolean | undefined;
121
+ startedAtMs?: number | null | undefined;
122
+ completedAtMs?: number | null | undefined;
123
+ }[];
124
+ nextCursor?: string | null | undefined;
125
+ backwardsCursor?: string | null | undefined;
126
+ }>;
127
+ resumeThread(params?: Omit<CodexResumeThreadParams, 'threadId'> & {
128
+ readonly threadId?: string | undefined;
129
+ }, options?: CodexRpcCallOptions): Promise<{
130
+ [x: string]: unknown;
131
+ model?: string | undefined;
132
+ modelProvider?: string | undefined;
133
+ reasoningEffort?: string | null | undefined;
134
+ approvalPolicy?: "never" | "on-failure" | "on-request" | "untrusted" | Record<string, import("zod").JSONType> | undefined;
135
+ sandbox?: {
136
+ [x: string]: unknown;
137
+ type: "dangerFullAccess";
138
+ } | {
139
+ [x: string]: unknown;
140
+ type: "readOnly";
141
+ networkAccess?: boolean | undefined;
142
+ } | {
143
+ [x: string]: unknown;
144
+ type: "externalSandbox";
145
+ networkAccess?: string | undefined;
146
+ } | {
147
+ [x: string]: unknown;
148
+ type: "workspaceWrite";
149
+ writableRoots?: string[] | undefined;
150
+ networkAccess?: boolean | undefined;
151
+ excludeTmpdirEnvVar?: boolean | undefined;
152
+ excludeSlashTmp?: boolean | undefined;
153
+ } | ({
154
+ readonly type: string;
155
+ } & {
156
+ readonly writableRoots?: never;
157
+ readonly networkAccess?: never;
158
+ readonly excludeTmpdirEnvVar?: never;
159
+ readonly excludeSlashTmp?: never;
160
+ }) | undefined;
161
+ cwd?: string | undefined;
162
+ runtimeWorkspaceRoots?: readonly string[] | undefined;
163
+ thread: {
164
+ [x: string]: unknown;
165
+ id: string;
166
+ name?: string | null | undefined;
167
+ preview?: string | undefined;
168
+ cwd?: string | undefined;
169
+ model?: string | null | undefined;
170
+ modelProvider?: string | undefined;
171
+ reasoningEffort?: string | null | undefined;
172
+ status?: {
173
+ [x: string]: unknown;
174
+ type: "notLoaded";
175
+ } | {
176
+ [x: string]: unknown;
177
+ type: "idle";
178
+ } | {
179
+ [x: string]: unknown;
180
+ type: "systemError";
181
+ } | {
182
+ [x: string]: unknown;
183
+ type: "active";
184
+ activeFlags: string[];
185
+ } | ({
186
+ readonly type: string;
187
+ } & {
188
+ readonly activeFlags?: never;
189
+ }) | undefined;
190
+ canAcceptDirectInput?: boolean | null | undefined;
191
+ cliVersion?: string | undefined;
192
+ createdAt?: number | undefined;
193
+ updatedAt?: number | undefined;
194
+ recencyAt?: number | null | undefined;
195
+ ephemeral?: boolean | undefined;
196
+ path?: string | null | undefined;
197
+ source?: import("zod").JSONType | undefined;
198
+ sessionId?: string | undefined;
199
+ projectId?: string | null | undefined;
200
+ forkedFromId?: string | null | undefined;
201
+ parentThreadId?: string | null | undefined;
202
+ attachedToThreadId?: string | null | undefined;
203
+ originator?: string | null | undefined;
204
+ agentNickname?: string | null | undefined;
205
+ agentRole?: string | null | undefined;
206
+ gitInfo?: import("zod").JSONType | undefined;
207
+ turns?: {
208
+ [x: string]: unknown;
209
+ id: string;
210
+ status: "completed" | "failed" | "inProgress" | "interrupted";
211
+ error?: {
212
+ [x: string]: unknown;
213
+ message: string;
214
+ codexErrorInfo?: import("zod").JSONType | undefined;
215
+ } | null | undefined;
216
+ startedAt?: number | null | undefined;
217
+ completedAt?: number | null | undefined;
218
+ durationMs?: number | null | undefined;
219
+ rootTurnId?: string | null | undefined;
220
+ items: {
221
+ [x: string]: unknown;
222
+ type: string;
223
+ clientId?: string | null | undefined;
224
+ }[];
225
+ itemsView?: "full" | "notLoaded" | "summary" | (string & Record<never, never>) | undefined;
226
+ }[] | undefined;
227
+ };
228
+ approvalsReviewer?: string | undefined;
229
+ collaborationMode?: {
230
+ [x: string]: unknown;
231
+ mode: string;
232
+ settings?: {
233
+ [x: string]: unknown;
234
+ model?: string | undefined;
235
+ reasoning_effort?: string | null | undefined;
236
+ developer_instructions?: string | null | undefined;
237
+ } | undefined;
238
+ } | null | undefined;
239
+ turnsBackwardsCursor?: string | null | undefined;
240
+ itemsBackwardsCursor?: string | null | undefined;
241
+ serviceTier?: string | null | undefined;
242
+ disabledPluginIds?: string[] | undefined;
243
+ instructionSources?: string[] | undefined;
244
+ }>;
245
+ revertThread(params: Omit<CodexRevertThreadParams, 'threadId'> & {
246
+ readonly threadId?: string | undefined;
247
+ }, options?: CodexRpcCallOptions): Promise<import("./thread-controls.js").CodexRevertThreadResult>;
248
+ injectItems(params: Omit<CodexInjectItemsParams, 'threadId'> & {
249
+ readonly threadId?: string | undefined;
250
+ }, options?: CodexRpcCallOptions): Promise<void>;
251
+ unsubscribeThread(params?: {
252
+ readonly threadId?: string | undefined;
253
+ }, options?: CodexRpcCallOptions): Promise<{
254
+ [x: string]: unknown;
255
+ status: "notLoaded" | "notSubscribed" | "unsubscribed" | (string & Record<never, never>);
256
+ }>;
257
+ archiveThread(params?: {
258
+ readonly threadId?: string | undefined;
259
+ }, options?: CodexRpcCallOptions): Promise<void>;
260
+ unarchiveThread(params?: {
261
+ readonly threadId?: string | undefined;
262
+ }, options?: CodexRpcCallOptions): Promise<{
263
+ [x: string]: unknown;
264
+ thread: {
265
+ [x: string]: unknown;
266
+ id: string;
267
+ name?: string | null | undefined;
268
+ preview?: string | undefined;
269
+ cwd?: string | undefined;
270
+ model?: string | null | undefined;
271
+ modelProvider?: string | undefined;
272
+ reasoningEffort?: string | null | undefined;
273
+ status?: {
274
+ [x: string]: unknown;
275
+ type: "notLoaded";
276
+ } | {
277
+ [x: string]: unknown;
278
+ type: "idle";
279
+ } | {
280
+ [x: string]: unknown;
281
+ type: "systemError";
282
+ } | {
283
+ [x: string]: unknown;
284
+ type: "active";
285
+ activeFlags: string[];
286
+ } | ({
287
+ readonly type: string;
288
+ } & {
289
+ readonly activeFlags?: never;
290
+ }) | undefined;
291
+ canAcceptDirectInput?: boolean | null | undefined;
292
+ cliVersion?: string | undefined;
293
+ createdAt?: number | undefined;
294
+ updatedAt?: number | undefined;
295
+ recencyAt?: number | null | undefined;
296
+ ephemeral?: boolean | undefined;
297
+ path?: string | null | undefined;
298
+ source?: import("zod").JSONType | undefined;
299
+ sessionId?: string | undefined;
300
+ projectId?: string | null | undefined;
301
+ forkedFromId?: string | null | undefined;
302
+ parentThreadId?: string | null | undefined;
303
+ attachedToThreadId?: string | null | undefined;
304
+ originator?: string | null | undefined;
305
+ agentNickname?: string | null | undefined;
306
+ agentRole?: string | null | undefined;
307
+ gitInfo?: import("zod").JSONType | undefined;
308
+ turns?: {
309
+ [x: string]: unknown;
310
+ id: string;
311
+ status: "completed" | "failed" | "inProgress" | "interrupted";
312
+ error?: {
313
+ [x: string]: unknown;
314
+ message: string;
315
+ codexErrorInfo?: import("zod").JSONType | undefined;
316
+ } | null | undefined;
317
+ startedAt?: number | null | undefined;
318
+ completedAt?: number | null | undefined;
319
+ durationMs?: number | null | undefined;
320
+ rootTurnId?: string | null | undefined;
321
+ items: {
322
+ [x: string]: unknown;
323
+ type: string;
324
+ clientId?: string | null | undefined;
325
+ }[];
326
+ itemsView?: "full" | "notLoaded" | "summary" | (string & Record<never, never>) | undefined;
327
+ }[] | undefined;
328
+ };
329
+ }>;
330
+ updateThreadMetadata(params?: Omit<CodexUpdateThreadMetadataParams, 'threadId'> & {
331
+ readonly threadId?: string | undefined;
332
+ }, options?: CodexRpcCallOptions): Promise<{
333
+ [x: string]: unknown;
334
+ thread: {
335
+ [x: string]: unknown;
336
+ id: string;
337
+ name?: string | null | undefined;
338
+ preview?: string | undefined;
339
+ cwd?: string | undefined;
340
+ model?: string | null | undefined;
341
+ modelProvider?: string | undefined;
342
+ reasoningEffort?: string | null | undefined;
343
+ status?: {
344
+ [x: string]: unknown;
345
+ type: "notLoaded";
346
+ } | {
347
+ [x: string]: unknown;
348
+ type: "idle";
349
+ } | {
350
+ [x: string]: unknown;
351
+ type: "systemError";
352
+ } | {
353
+ [x: string]: unknown;
354
+ type: "active";
355
+ activeFlags: string[];
356
+ } | ({
357
+ readonly type: string;
358
+ } & {
359
+ readonly activeFlags?: never;
360
+ }) | undefined;
361
+ canAcceptDirectInput?: boolean | null | undefined;
362
+ cliVersion?: string | undefined;
363
+ createdAt?: number | undefined;
364
+ updatedAt?: number | undefined;
365
+ recencyAt?: number | null | undefined;
366
+ ephemeral?: boolean | undefined;
367
+ path?: string | null | undefined;
368
+ source?: import("zod").JSONType | undefined;
369
+ sessionId?: string | undefined;
370
+ projectId?: string | null | undefined;
371
+ forkedFromId?: string | null | undefined;
372
+ parentThreadId?: string | null | undefined;
373
+ attachedToThreadId?: string | null | undefined;
374
+ originator?: string | null | undefined;
375
+ agentNickname?: string | null | undefined;
376
+ agentRole?: string | null | undefined;
377
+ gitInfo?: import("zod").JSONType | undefined;
378
+ turns?: {
379
+ [x: string]: unknown;
380
+ id: string;
381
+ status: "completed" | "failed" | "inProgress" | "interrupted";
382
+ error?: {
383
+ [x: string]: unknown;
384
+ message: string;
385
+ codexErrorInfo?: import("zod").JSONType | undefined;
386
+ } | null | undefined;
387
+ startedAt?: number | null | undefined;
388
+ completedAt?: number | null | undefined;
389
+ durationMs?: number | null | undefined;
390
+ rootTurnId?: string | null | undefined;
391
+ items: {
392
+ [x: string]: unknown;
393
+ type: string;
394
+ clientId?: string | null | undefined;
395
+ }[];
396
+ itemsView?: "full" | "notLoaded" | "summary" | (string & Record<never, never>) | undefined;
397
+ }[] | undefined;
398
+ };
399
+ }>;
400
+ setThreadName(params: Omit<CodexSetThreadNameParams, 'threadId'> & {
401
+ readonly threadId?: string | undefined;
402
+ }, options?: CodexRpcCallOptions): Promise<void>;
403
+ interruptTurn(params: Omit<CodexInterruptTurnParams, 'threadId'> & {
404
+ readonly threadId?: string | undefined;
405
+ }, options?: CodexRpcCallOptions): Promise<void>;
406
+ compactThread(params?: {
407
+ readonly threadId?: string | undefined;
408
+ }, options?: CodexRpcCallOptions): Promise<void>;
409
+ };
410
+ //# sourceMappingURL=session-bind.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-bind.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/codex/session-bind.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EACV,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,EACnB,wBAAwB,EACxB,+BAA+B,EAChC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAE7D;;;;GAIG;AACH,wBAAgB,8BAA8B,CAC5C,aAAa,EAAE,kBAAkB,EACjC,QAAQ,EAAE,MAAM;IAGd,UAAU,UACC,IAAI,CAAC,qBAAqB,EAAE,UAAU,CAAC,GAAG;QACjD,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;KACxC,YACS,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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YACzC,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAS/B,oBAAoB,UACT,IAAI,CAAC,+BAA+B,EAAE,UAAU,CAAC,GAAG;QAC3D,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;KACxC,YACS,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAU/B,aAAa,SACH,IAAI,CAAC,wBAAwB,EAAE,UAAU,CAAC,GAAG;QACnD,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;KACxC,YACS,mBAAmB;IAU/B,aAAa,SACH,IAAI,CAAC,wBAAwB,EAAE,UAAU,CAAC,GAAG;QACnD,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;KACxC,YACS,mBAAmB;IAU/B,aAAa,UACF;QAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,YACzC,mBAAmB;EAUlC"}
@@ -1,169 +1,20 @@
1
- import type { AgentEngineDriver, AgentEngineSession, AgentEngineTurn } from '../engine.js';
2
- import type { InteractionReply } from '../executor-contract.js';
3
- import type { ExecutorDriverCapabilities } from '../hello.js';
4
1
  import type { DriverImageOptions } from '../image-input.js';
5
2
  import type { JsonRpcPeer, JsonRpcValue } from '../json-rpc-peer.js';
6
- import type { ExecutorProfileConfig } from '../profile.js';
7
- import type { ExecutorStartupPhase } from '../vocabulary.js';
8
- import type { CodexControlClient, CodexControlConnectInput, CodexControlConnection, CodexListItemsParams, CodexListTurnsParams, CodexReadThreadParams } from './control-client.js';
9
- import { type CodexApprovalPolicy, type CodexCollaborationMode, type CodexSandboxMode, type CodexThreadContext } from './protocol.js';
10
- import type { CodexSharedServer, CodexSharedServerOpenInput } from './shared-server.js';
11
- import type { CodexInjectItemsParams, CodexRevertThreadParams, CodexRevertThreadResult, CodexSetThreadNameParams, CodexUpdateThreadMetadataParams } from './thread-controls.js';
12
- import { type CodexTurnInputPart, type InlinedCodexPart } from './turn-input.js';
13
- /** Policy and configuration fields forwarded to Codex `thread/start`, `thread/resume`, and `thread/fork`. */
14
- export interface CodexThreadPolicyOverrides {
15
- /** Model identifier to use for the thread. */
16
- readonly model?: string;
17
- /** Model provider identifier (for example `openai`). */
18
- readonly modelProvider?: string;
19
- /** Approval policy applied to the thread. */
20
- readonly approvalPolicy?: CodexApprovalPolicy;
21
- /** Sandbox mode applied to the thread. */
22
- readonly sandbox?: CodexSandboxMode;
23
- /** Developer instructions appended to the thread system context. */
24
- readonly developerInstructions?: string;
25
- /** Additional workspace roots allowed for runtime filesystem access. */
26
- readonly runtimeWorkspaceRoots?: readonly string[];
27
- /** Codex app-server config overrides for the thread (sandbox writable roots, disabled MCP/plugins/features, network policy). */
28
- readonly config?: Readonly<Record<string, JsonRpcValue>>;
29
- }
30
- /** Input to {@link CodexSession.startTurn}, extending the portable turn input with Codex per-turn overrides and `skill` items. */
31
- export interface CodexTurnInput {
32
- readonly turnId: string;
3
+ import { type CodexApprovalPolicy, type CodexCollaborationMode, type CodexSandboxPolicy } from './protocol.js';
4
+ import type { CodexForkedThread, CodexForkThreadOptions, CodexSteerTurnInput, CodexThreadPolicyOverrides } from './session-types.js';
5
+ import { type CodexRpcCallOptions } from './thread-controls.js';
6
+ import { type InlinedCodexPart } from './turn-input.js';
7
+ /** Common per-turn start parameters shared by {@link CodexSession.startTurn} and {@link CodexControlClient.startThreadTurn}. */
8
+ export interface CodexTurnStartOverrideFields {
33
9
  readonly clientId: string;
34
- readonly input: readonly CodexTurnInputPart[];
35
- /** Per-turn model override forwarded on `turn/start`. */
36
- readonly model?: string;
37
- /**
38
- * Verified fail-closed against the thread's active `modelProvider`; Codex's `turn/start`
39
- * does not switch providers mid-thread.
40
- */
41
- readonly modelProvider?: string;
42
- /** Per-turn reasoning effort override (forwarded to Codex as `effort`). */
43
- readonly reasoningEffort?: string;
44
- /** Per-turn collaboration mode override (`plan` or `default`). */
45
- readonly collaborationMode?: CodexCollaborationMode;
46
- /** Per-turn approval policy override. */
47
- readonly approvalPolicy?: CodexApprovalPolicy;
48
- /** Per-turn sandbox policy object override (`sandboxPolicy`). */
49
- readonly sandboxPolicy?: JsonRpcValue;
50
- /** Per-turn runtime workspace roots override. */
51
- readonly runtimeWorkspaceRoots?: readonly string[];
52
- }
53
- /** Input to {@link CodexSession.steerTurn} (`turn/steer`). */
54
- export interface CodexSteerTurnInput {
55
- readonly input: readonly CodexTurnInputPart[];
56
- readonly clientId?: string;
57
- /** Optional guard asserting which active Codex turn id is being steered. */
58
- readonly expectedTurnId?: string;
59
- }
60
- /** Options for {@link CodexSession.forkThread} (`thread/fork`). */
61
- export interface CodexForkThreadOptions extends CodexThreadPolicyOverrides {
62
- readonly cwd?: string;
63
- readonly beforeTurnId?: string;
64
- readonly lastTurnId?: string;
65
- readonly excludeTurns?: boolean;
66
- /** Carry the source thread's goal into the fork without starting automatic continuation. */
67
- readonly deferGoalContinuation?: boolean;
68
- }
69
- /** Options to open a new {@link CodexSession} directly via `thread/fork` instead of `thread/start`. */
70
- export interface CodexOpenForkOptions extends CodexThreadPolicyOverrides {
71
- /** Existing thread id to fork from. */
72
- readonly threadId: string;
73
- readonly beforeTurnId?: string;
74
- readonly lastTurnId?: string;
75
- /** Defaults to `true` when omitted so large threads do not inline full history into the fork reply. */
76
- readonly excludeTurns?: boolean;
77
- /** Carry the source thread's goal into the fork without starting automatic continuation. */
78
- readonly deferGoalContinuation?: boolean;
79
- }
80
- /** Input to {@link CodexDriver.open}, extending {@link AgentEngineDriver.open} with `forkFrom`. */
81
- export interface CodexOpenInput {
82
- readonly profile: ExecutorProfileConfig;
83
- readonly cwd: string;
84
- /** Resume this native thread via `thread/resume` (mutually exclusive with `forkFrom`). */
85
- readonly nativeThreadId?: string;
86
- /** Open the session by forking an existing thread via `thread/fork` (mutually exclusive with `nativeThreadId`). */
87
- readonly forkFrom?: CodexOpenForkOptions;
88
- /** Optional observer invoked with startup phases (`spawning`, `initializing`, `verifying`) during open. */
89
- readonly onStartupPhase?: (phase: ExecutorStartupPhase) => void;
90
- readonly signal?: AbortSignal;
91
- }
92
- /** Result returned by {@link CodexSession.forkThread} without mutating the current session. */
93
- export interface CodexForkedThread {
94
- readonly nativeThreadId: string;
95
- readonly threadContext: CodexThreadContext;
96
- }
97
- /** Extended Codex session handle exposing `providerPid`, applied `threadContext`, and live app-server controls. */
98
- export interface CodexSession extends AgentEngineSession, CodexControlClient {
99
- /** OS process id of the spawned `codex app-server`, or `undefined` when attached via `unix-connect`. */
100
- readonly providerPid: number | undefined;
101
- /** Applied thread settings reported by `thread/start`, `thread/resume`, or `thread/fork`. */
102
- readonly threadContext: CodexThreadContext;
103
- /** Start a turn with optional per-turn Codex overrides and `skill` items. */
104
- startTurn(input: CodexTurnInput): Promise<AgentEngineTurn>;
105
- /** Answer a pending request from either the active turn or an external/TUI server request. */
106
- respond(interactionId: string, reply: InteractionReply['reply']): Promise<void>;
107
- /** Read thread metadata (`thread/read`); defaults `threadId` to this session's `nativeThreadId`. */
108
- readThread(params?: Omit<CodexReadThreadParams, 'threadId'> & {
109
- readonly threadId?: string;
110
- }): Promise<JsonRpcValue>;
111
- /** List turns (`thread/turns/list`); defaults `threadId` to this session's `nativeThreadId`. */
112
- listTurns(params?: Omit<CodexListTurnsParams, 'threadId'> & {
113
- readonly threadId?: string;
114
- }): Promise<JsonRpcValue>;
115
- /** List items (`thread/items/list`); defaults `threadId` to this session's `nativeThreadId`. */
116
- listItems(params?: Omit<CodexListItemsParams, 'threadId'> & {
117
- readonly threadId?: string;
118
- }): Promise<JsonRpcValue>;
119
- /** Revert thread durable history before `beforeTurnId` (`thread/revert`); defaults `threadId` to `nativeThreadId`. */
120
- revertThread(params: Omit<CodexRevertThreadParams, 'threadId'> & {
121
- readonly threadId?: string;
122
- }): Promise<CodexRevertThreadResult>;
123
- /** Inject raw Responses API items (`thread/inject_items`); defaults `threadId` to `nativeThreadId`. */
124
- injectItems(params: Omit<CodexInjectItemsParams, 'threadId'> & {
125
- readonly threadId?: string;
126
- }): Promise<JsonRpcValue>;
127
- /** Unsubscribe this connection (`thread/unsubscribe`); defaults `threadId` to `nativeThreadId`. */
128
- unsubscribeThread(params?: {
129
- readonly threadId?: string;
130
- }): Promise<JsonRpcValue>;
131
- /** Archive a thread (`thread/archive`); defaults `threadId` to `nativeThreadId`. */
132
- archiveThread(params?: {
133
- readonly threadId?: string;
134
- }): Promise<JsonRpcValue>;
135
- /** Unarchive a thread (`thread/unarchive`); defaults `threadId` to `nativeThreadId`. */
136
- unarchiveThread(params?: {
137
- readonly threadId?: string;
138
- }): Promise<JsonRpcValue>;
139
- /** Patch thread metadata (`thread/metadata/update`); defaults `threadId` to `nativeThreadId`. */
140
- updateThreadMetadata(params?: Omit<CodexUpdateThreadMetadataParams, 'threadId'> & {
141
- readonly threadId?: string;
142
- }): Promise<JsonRpcValue>;
143
- /** Set thread display name (`thread/name/set`); defaults `threadId` to `nativeThreadId`. */
144
- setThreadName(params: Omit<CodexSetThreadNameParams, 'threadId'> & {
145
- readonly threadId?: string;
146
- }): Promise<JsonRpcValue>;
147
- /** Steer the currently running turn with additional input (`turn/steer`). */
148
- steerTurn(input: CodexSteerTurnInput): Promise<{
149
- readonly turnId: string;
150
- }>;
151
- /** Fork the session's thread into a new thread id without mutating the current session (`thread/fork`). */
152
- forkThread(options?: CodexForkThreadOptions): Promise<CodexForkedThread>;
153
- /** Request context compaction for the current thread (`thread/compact/start`). */
154
- compactThread(): Promise<void>;
155
- }
156
- /** Codex driver returned by {@link createCodexDriver}; `open()` resolves to {@link CodexSession} and `connectControl()` opens a threadless control link. */
157
- export interface CodexDriver extends AgentEngineDriver {
158
- readonly engine: 'codex';
159
- readonly reconcile: 'client-id';
160
- readonly capabilities: ExecutorDriverCapabilities;
161
- findInput: NonNullable<AgentEngineDriver['findInput']>;
162
- open(input: CodexOpenInput): Promise<CodexSession>;
163
- /** Connect to `codex app-server` without starting, resuming, or forking a thread. */
164
- connectControl(input: CodexControlConnectInput): Promise<CodexControlConnection>;
165
- /** Open a shared headless `stdio` `codex app-server` multiplexing multiple threads (ADR 0329). */
166
- openSharedServer(input: CodexSharedServerOpenInput): Promise<CodexSharedServer>;
10
+ readonly cwd?: string | undefined;
11
+ readonly model?: string | undefined;
12
+ readonly modelProvider?: string | undefined;
13
+ readonly reasoningEffort?: string | undefined;
14
+ readonly collaborationMode?: CodexCollaborationMode | undefined;
15
+ readonly approvalPolicy?: CodexApprovalPolicy | undefined;
16
+ readonly sandboxPolicy?: CodexSandboxPolicy | undefined;
17
+ readonly runtimeWorkspaceRoots?: readonly string[] | undefined;
167
18
  }
168
19
  /** Validate `beforeTurnId` and `lastTurnId` mutual exclusion for `thread/fork`. */
169
20
  export declare function validateCodexForkBounds(options: Pick<CodexForkThreadOptions, 'beforeTurnId' | 'lastTurnId'>, caller: string): void;
@@ -172,10 +23,10 @@ export declare function validateCodexPolicyOverrides(overrides: Pick<CodexThread
172
23
  /** Build JSON-RPC params for `thread/start`, `thread/resume`, or `thread/fork` from merged policy fields. */
173
24
  export declare function buildCodexThreadPolicyParams(base: CodexThreadPolicyOverrides, overrides: CodexThreadPolicyOverrides | undefined): Record<string, JsonRpcValue>;
174
25
  /** Validate per-turn overrides eagerly before host image files are read. */
175
- export declare function validateCodexTurnStartOverrides(turnInput: CodexTurnInput, activeModelProvider: string | undefined): void;
26
+ export declare function validateCodexTurnStartOverrides(caller: string, turnInput: CodexTurnStartOverrideFields, activeModelProvider?: string): void;
176
27
  /** Build validated `turn/start` RPC parameters from turn input and inlined parts. */
177
- export declare function buildCodexTurnStartParams(threadId: string, turnInput: CodexTurnInput, parts: readonly InlinedCodexPart[], activeModelProvider: string | undefined): Record<string, JsonRpcValue>;
178
- /** Create thread/turn control methods (`steerTurn`, `forkThread`, `compactThread`) for a live Codex session. */
28
+ export declare function buildCodexTurnStartRpcParams(caller: string, threadId: string, turnInput: CodexTurnStartOverrideFields, parts: readonly InlinedCodexPart[], activeModelProvider?: string): Record<string, JsonRpcValue>;
29
+ /** Create session-bound turn/thread mutators (`steerTurn`, `forkThread`) for a live Codex session. */
179
30
  export declare function createCodexSessionMutators(input: {
180
31
  peer: JsonRpcPeer;
181
32
  threadId: string;
@@ -186,10 +37,11 @@ export declare function createCodexSessionMutators(input: {
186
37
  readonly codexTurnId?: string;
187
38
  } | undefined;
188
39
  }): {
189
- steerTurn(steerInput: CodexSteerTurnInput): Promise<{
40
+ steerTurn(steerInput: CodexSteerTurnInput & {
41
+ readonly threadId?: string | undefined;
42
+ }, rpcOptions?: CodexRpcCallOptions): Promise<{
190
43
  readonly turnId: string;
191
44
  }>;
192
- forkThread(options?: CodexForkThreadOptions): Promise<CodexForkedThread>;
193
- compactThread(): Promise<void>;
45
+ forkThread(options?: CodexForkThreadOptions, rpcOptions?: CodexRpcCallOptions): Promise<CodexForkedThread>;
194
46
  };
195
47
  //# sourceMappingURL=session-controls.d.ts.map