@opencorelabs/lucidity 0.7.0 → 0.8.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 (219) hide show
  1. package/README.md +9 -2
  2. package/dist/assets/speech/lucidity-speech +0 -0
  3. package/dist/automations/agent.d.ts.map +1 -1
  4. package/dist/automations/agent.js +2 -0
  5. package/dist/automations/designer.d.ts +1 -1
  6. package/dist/chat/server.d.ts +1 -0
  7. package/dist/chat/server.d.ts.map +1 -1
  8. package/dist/chat/server.js +6 -1
  9. package/dist/coding/conduct.d.ts +1 -22
  10. package/dist/coding/conduct.d.ts.map +1 -1
  11. package/dist/coding/conduct.js +9 -94
  12. package/dist/coding/runCodeTurn.d.ts +3 -16
  13. package/dist/coding/runCodeTurn.d.ts.map +1 -1
  14. package/dist/coding/runCodeTurn.js +157 -165
  15. package/dist/coding/workspaceRegistry.d.ts +24 -0
  16. package/dist/coding/workspaceRegistry.d.ts.map +1 -0
  17. package/dist/coding/workspaceRegistry.js +230 -0
  18. package/dist/coding/worktree.d.ts +11 -14
  19. package/dist/coding/worktree.d.ts.map +1 -1
  20. package/dist/coding/worktree.js +41 -21
  21. package/dist/config.d.ts +2 -0
  22. package/dist/config.d.ts.map +1 -1
  23. package/dist/daemonLease.d.ts +12 -0
  24. package/dist/daemonLease.d.ts.map +1 -0
  25. package/dist/daemonLease.js +32 -0
  26. package/dist/goals/assessment.d.ts +115 -0
  27. package/dist/goals/assessment.d.ts.map +1 -0
  28. package/dist/goals/assessment.js +67 -0
  29. package/dist/goals/notes.d.ts +18 -0
  30. package/dist/goals/notes.d.ts.map +1 -0
  31. package/dist/goals/notes.js +72 -0
  32. package/dist/index.js +57 -15
  33. package/dist/jobs/goals.d.ts +15 -0
  34. package/dist/jobs/goals.d.ts.map +1 -0
  35. package/dist/jobs/goals.js +286 -0
  36. package/dist/jobs/weeklyReview.d.ts.map +1 -1
  37. package/dist/jobs/weeklyReview.js +3 -2
  38. package/dist/queue.d.ts +1 -0
  39. package/dist/queue.d.ts.map +1 -1
  40. package/dist/queue.js +4 -0
  41. package/dist/room/client.d.ts +5 -0
  42. package/dist/room/client.d.ts.map +1 -1
  43. package/dist/room/client.js +116 -101
  44. package/dist/room/computer.d.ts.map +1 -1
  45. package/dist/room/computer.js +1 -0
  46. package/dist/room/durablePublish.d.ts +6 -0
  47. package/dist/room/durablePublish.d.ts.map +1 -0
  48. package/dist/room/durablePublish.js +19 -0
  49. package/dist/room/incidents.d.ts +1 -1
  50. package/dist/room/incidents.d.ts.map +1 -1
  51. package/dist/room/incidents.js +14 -7
  52. package/dist/room/turnQueue.d.ts.map +1 -1
  53. package/dist/room/turnQueue.js +27 -24
  54. package/dist/runtimeStore.d.ts +44 -0
  55. package/dist/runtimeStore.d.ts.map +1 -0
  56. package/dist/runtimeStore.js +188 -0
  57. package/dist/setup/server.js +1 -1
  58. package/dist/turnLog.d.ts +10 -40
  59. package/dist/turnLog.d.ts.map +1 -1
  60. package/dist/turnLog.js +33 -56
  61. package/package.json +4 -4
  62. package/src/automations/agent.ts +2 -0
  63. package/src/chat/server.ts +7 -1
  64. package/src/coding/conduct.ts +10 -147
  65. package/src/coding/runCodeTurn.ts +42 -61
  66. package/src/coding/workspaceRegistry.ts +210 -0
  67. package/src/coding/worktree.ts +44 -20
  68. package/src/config.ts +2 -0
  69. package/src/daemonLease.ts +33 -0
  70. package/src/goals/assessment.ts +106 -0
  71. package/src/goals/notes.ts +88 -0
  72. package/src/index.ts +57 -18
  73. package/src/jobs/goals.ts +384 -0
  74. package/src/jobs/weeklyReview.ts +4 -3
  75. package/src/queue.ts +4 -0
  76. package/src/room/client.ts +77 -74
  77. package/src/room/computer.ts +1 -0
  78. package/src/room/durablePublish.ts +25 -0
  79. package/src/room/incidents.ts +16 -8
  80. package/src/room/turnQueue.ts +26 -27
  81. package/src/runtimeStore.ts +190 -0
  82. package/src/setup/server.ts +1 -1
  83. package/src/turnLog.ts +32 -75
  84. package/vendor/mcp-server/dist/index.js +2 -0
  85. package/vendor/mcp-server/dist/tools/goals.d.ts +4 -0
  86. package/vendor/mcp-server/dist/tools/goals.d.ts.map +1 -0
  87. package/vendor/mcp-server/dist/tools/goals.js +38 -0
  88. package/vendor/mcp-server/package.json +1 -1
  89. package/vendor/mcp-server/src/index.ts +2 -0
  90. package/vendor/mcp-server/src/tools/goals.ts +62 -0
  91. package/vendor/runtime/README.md +2 -2
  92. package/vendor/runtime/dist/executor/asyncQueue.d.ts +1 -0
  93. package/vendor/runtime/dist/executor/asyncQueue.d.ts.map +1 -1
  94. package/vendor/runtime/dist/executor/asyncQueue.js +3 -0
  95. package/vendor/runtime/dist/executor/claudeAgent.d.ts +1 -1
  96. package/vendor/runtime/dist/executor/claudeAgent.d.ts.map +1 -1
  97. package/vendor/runtime/dist/executor/claudeAgent.js +20 -9
  98. package/vendor/runtime/dist/executor/codex.d.ts +1 -0
  99. package/vendor/runtime/dist/executor/codex.d.ts.map +1 -1
  100. package/vendor/runtime/dist/executor/codex.js +68 -36
  101. package/vendor/runtime/dist/executor/codexProtocol/FunctionCallOutputContentItem.d.ts +4 -1
  102. package/vendor/runtime/dist/executor/codexProtocol/FunctionCallOutputContentItem.d.ts.map +1 -1
  103. package/vendor/runtime/dist/executor/codexProtocol/Personality.d.ts +3 -0
  104. package/vendor/runtime/dist/executor/codexProtocol/Personality.d.ts.map +1 -1
  105. package/vendor/runtime/dist/executor/codexProtocol/PlanType.d.ts +1 -1
  106. package/vendor/runtime/dist/executor/codexProtocol/PlanType.d.ts.map +1 -1
  107. package/vendor/runtime/dist/executor/codexProtocol/v2/CyberAccessProgram.d.ts +6 -0
  108. package/vendor/runtime/dist/executor/codexProtocol/v2/CyberAccessProgram.d.ts.map +1 -0
  109. package/vendor/runtime/dist/executor/codexProtocol/v2/CyberAccessProgram.js +2 -0
  110. package/vendor/runtime/dist/executor/codexProtocol/v2/GetAccountRateLimitsResponse.d.ts +5 -0
  111. package/vendor/runtime/dist/executor/codexProtocol/v2/GetAccountRateLimitsResponse.d.ts.map +1 -1
  112. package/vendor/runtime/dist/executor/codexProtocol/v2/Model.d.ts +8 -0
  113. package/vendor/runtime/dist/executor/codexProtocol/v2/Model.d.ts.map +1 -1
  114. package/vendor/runtime/dist/executor/codexProtocol/v2/ModelAccessPrograms.d.ts +11 -0
  115. package/vendor/runtime/dist/executor/codexProtocol/v2/ModelAccessPrograms.d.ts.map +1 -0
  116. package/vendor/runtime/dist/executor/codexProtocol/v2/ModelAccessPrograms.js +2 -0
  117. package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitSnapshot.d.ts +4 -0
  118. package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitSnapshot.d.ts.map +1 -1
  119. package/vendor/runtime/dist/executor/codexProtocol/v2/ReviewStartParams.d.ts +2 -0
  120. package/vendor/runtime/dist/executor/codexProtocol/v2/ReviewStartParams.d.ts.map +1 -1
  121. package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadResumeParams.d.ts +4 -1
  122. package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadResumeParams.d.ts.map +1 -1
  123. package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadStartParams.d.ts +3 -1
  124. package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadStartParams.d.ts.map +1 -1
  125. package/vendor/runtime/dist/executor/codexProtocol/v2/TurnStartParams.d.ts +7 -2
  126. package/vendor/runtime/dist/executor/codexProtocol/v2/TurnStartParams.d.ts.map +1 -1
  127. package/vendor/runtime/dist/executor/codexProtocol/v2/UserInput.d.ts +3 -0
  128. package/vendor/runtime/dist/executor/codexProtocol/v2/UserInput.d.ts.map +1 -1
  129. package/vendor/runtime/dist/executor/codexRpc.d.ts +10 -3
  130. package/vendor/runtime/dist/executor/codexRpc.d.ts.map +1 -1
  131. package/vendor/runtime/dist/executor/codexRpc.js +18 -3
  132. package/vendor/runtime/dist/executor/codexSessions.d.ts +30 -0
  133. package/vendor/runtime/dist/executor/codexSessions.d.ts.map +1 -0
  134. package/vendor/runtime/dist/executor/codexSessions.js +88 -0
  135. package/vendor/runtime/dist/executor/health.d.ts +2 -1
  136. package/vendor/runtime/dist/executor/health.d.ts.map +1 -1
  137. package/vendor/runtime/dist/executor/health.js +17 -5
  138. package/vendor/runtime/dist/executor/liveTurns.d.ts +2 -1
  139. package/vendor/runtime/dist/executor/liveTurns.d.ts.map +1 -1
  140. package/vendor/runtime/dist/executor/liveTurns.js +12 -5
  141. package/vendor/runtime/dist/executor/ownership.d.ts +35 -0
  142. package/vendor/runtime/dist/executor/ownership.d.ts.map +1 -0
  143. package/vendor/runtime/dist/executor/ownership.js +99 -0
  144. package/vendor/runtime/dist/executor/providerRouter.d.ts +1 -0
  145. package/vendor/runtime/dist/executor/providerRouter.d.ts.map +1 -1
  146. package/vendor/runtime/dist/executor/providerRouter.js +5 -0
  147. package/vendor/runtime/dist/executor/types.d.ts +2 -0
  148. package/vendor/runtime/dist/executor/types.d.ts.map +1 -1
  149. package/vendor/runtime/dist/index.d.ts +1 -0
  150. package/vendor/runtime/dist/index.d.ts.map +1 -1
  151. package/vendor/runtime/dist/index.js +1 -0
  152. package/vendor/runtime/src/executor/asyncQueue.ts +3 -0
  153. package/vendor/runtime/src/executor/claudeAgent.ts +16 -9
  154. package/vendor/runtime/src/executor/codex.ts +75 -44
  155. package/vendor/runtime/src/executor/codexProtocol/FunctionCallOutputContentItem.ts +1 -1
  156. package/vendor/runtime/src/executor/codexProtocol/Personality.ts +3 -0
  157. package/vendor/runtime/src/executor/codexProtocol/PlanType.ts +1 -1
  158. package/vendor/runtime/src/executor/codexProtocol/README.md +2 -2
  159. package/vendor/runtime/src/executor/codexProtocol/v2/CyberAccessProgram.ts +9 -0
  160. package/vendor/runtime/src/executor/codexProtocol/v2/GetAccountRateLimitsResponse.ts +5 -0
  161. package/vendor/runtime/src/executor/codexProtocol/v2/Model.ts +11 -2
  162. package/vendor/runtime/src/executor/codexProtocol/v2/ModelAccessPrograms.ts +13 -0
  163. package/vendor/runtime/src/executor/codexProtocol/v2/RateLimitSnapshot.ts +5 -1
  164. package/vendor/runtime/src/executor/codexProtocol/v2/ReviewStartParams.ts +2 -0
  165. package/vendor/runtime/src/executor/codexProtocol/v2/ThreadResumeParams.ts +5 -1
  166. package/vendor/runtime/src/executor/codexProtocol/v2/ThreadStartParams.ts +4 -1
  167. package/vendor/runtime/src/executor/codexProtocol/v2/TurnStartParams.ts +7 -2
  168. package/vendor/runtime/src/executor/codexProtocol/v2/UserInput.ts +1 -1
  169. package/vendor/runtime/src/executor/codexRpc.ts +22 -4
  170. package/vendor/runtime/src/executor/codexSessions.ts +108 -0
  171. package/vendor/runtime/src/executor/health.ts +16 -6
  172. package/vendor/runtime/src/executor/liveTurns.ts +12 -5
  173. package/vendor/runtime/src/executor/ownership.ts +76 -0
  174. package/vendor/runtime/src/executor/providerRouter.ts +6 -0
  175. package/vendor/runtime/src/executor/types.ts +2 -0
  176. package/vendor/runtime/src/index.ts +1 -0
  177. package/vendor/shared/dist/agentCommands.d.ts +1 -0
  178. package/vendor/shared/dist/agentCommands.d.ts.map +1 -1
  179. package/vendor/shared/dist/cardStudio.d.ts +41 -0
  180. package/vendor/shared/dist/cardStudio.d.ts.map +1 -1
  181. package/vendor/shared/dist/cardStudio.js +13 -3
  182. package/vendor/shared/dist/computer.d.ts +7 -1
  183. package/vendor/shared/dist/computer.d.ts.map +1 -1
  184. package/vendor/shared/dist/computer.js +12 -2
  185. package/vendor/shared/dist/constants.d.ts +3 -3
  186. package/vendor/shared/dist/constants.d.ts.map +1 -1
  187. package/vendor/shared/dist/constants.js +5 -4
  188. package/vendor/shared/dist/goalNotes.d.ts +4 -0
  189. package/vendor/shared/dist/goalNotes.d.ts.map +1 -0
  190. package/vendor/shared/dist/goalNotes.js +23 -0
  191. package/vendor/shared/dist/goals.d.ts +835 -0
  192. package/vendor/shared/dist/goals.d.ts.map +1 -0
  193. package/vendor/shared/dist/goals.js +198 -0
  194. package/vendor/shared/dist/index.d.ts +3 -0
  195. package/vendor/shared/dist/index.d.ts.map +1 -1
  196. package/vendor/shared/dist/index.js +3 -0
  197. package/vendor/shared/dist/schemas/harness.d.ts +101 -0
  198. package/vendor/shared/dist/schemas/harness.d.ts.map +1 -1
  199. package/vendor/shared/dist/schemas/harness.js +6 -0
  200. package/vendor/shared/dist/workspaces.d.ts +138 -0
  201. package/vendor/shared/dist/workspaces.d.ts.map +1 -0
  202. package/vendor/shared/dist/workspaces.js +40 -0
  203. package/vendor/shared/src/agentCommands.ts +1 -0
  204. package/vendor/shared/src/cardStudio.ts +13 -3
  205. package/vendor/shared/src/computer.ts +16 -2
  206. package/vendor/shared/src/constants.ts +5 -4
  207. package/vendor/shared/src/goalNotes.ts +23 -0
  208. package/vendor/shared/src/goals.ts +237 -0
  209. package/vendor/shared/src/index.ts +4 -0
  210. package/vendor/shared/src/schemas/harness.ts +6 -0
  211. package/vendor/shared/src/workspaces.ts +48 -0
  212. package/dist/coding/fleetIntegrate.d.ts +0 -37
  213. package/dist/coding/fleetIntegrate.d.ts.map +0 -1
  214. package/dist/coding/fleetIntegrate.js +0 -64
  215. package/dist/coding/openFleetPr.d.ts +0 -41
  216. package/dist/coding/openFleetPr.d.ts.map +0 -1
  217. package/dist/coding/openFleetPr.js +0 -121
  218. package/src/coding/fleetIntegrate.ts +0 -95
  219. package/src/coding/openFleetPr.ts +0 -148
@@ -3,6 +3,7 @@ import { readFileSync } from 'node:fs';
3
3
  import { randomUUID } from 'node:crypto';
4
4
  import { CodexRpc, initializeCodex, } from './codexRpc.js';
5
5
  import { LiveTurns, abortError } from './liveTurns.js';
6
+ import { CodexSessions, codexBindingFingerprint, } from './codexSessions.js';
6
7
  // App-server does not persist an empty thread until its first turn. Keep a durable
7
8
  // reset marker in Lucidity's provider session envelope until that turn starts.
8
9
  const EMPTY_SESSION_PREFIX = 'lucidity-codex-empty:';
@@ -101,6 +102,7 @@ export class CodexExecutor {
101
102
  name = 'codex-app-server';
102
103
  strictResume = true;
103
104
  turns = new LiveTurns();
105
+ sessions = new CodexSessions();
104
106
  constructor(options = {}) {
105
107
  this.options = options;
106
108
  }
@@ -114,7 +116,7 @@ export class CodexExecutor {
114
116
  return this.turns.interrupt(requestId);
115
117
  }
116
118
  async dispose() {
117
- this.turns.dispose();
119
+ await Promise.all([this.turns.dispose(), this.sessions.dispose()]);
118
120
  }
119
121
  async models() {
120
122
  const rpc = this.connect();
@@ -141,7 +143,7 @@ export class CodexExecutor {
141
143
  return models;
142
144
  }
143
145
  finally {
144
- rpc.close();
146
+ await rpc.close();
145
147
  }
146
148
  }
147
149
  async commands(input = {}) {
@@ -230,40 +232,39 @@ export class CodexExecutor {
230
232
  let threadId = '';
231
233
  let turnId = '';
232
234
  let ended = false;
233
- const rpc = this.connect(input.cwd);
234
- let owner;
235
- try {
236
- owner = this.turns.open(input, async (text) => {
237
- if (command)
238
- throw new Error('Wait for the command to finish before sending a message.');
239
- if (!turnId || ended)
240
- throw new Error('Codex has no active turn to steer.');
241
- const params = {
242
- threadId,
243
- expectedTurnId: turnId,
244
- input: userInput({ userPrompt: text }),
245
- };
246
- await rpc.request('turn/steer', params);
247
- });
248
- }
249
- catch (error) {
250
- rpc.close();
251
- throw error;
252
- }
235
+ let rpc;
236
+ let thread;
237
+ let fingerprint = '';
238
+ let reusable = false;
239
+ const owner = this.turns.open(input, async (text) => {
240
+ if (command)
241
+ throw new Error('Wait for the command to finish before sending a message.');
242
+ if (!rpc || !turnId || ended)
243
+ throw new Error('Codex has no active turn to steer.');
244
+ const params = {
245
+ threadId,
246
+ expectedTurnId: turnId,
247
+ input: userInput({ userPrompt: text }),
248
+ };
249
+ await rpc.request('turn/steer', params);
250
+ });
253
251
  const abort = () => {
252
+ const active = rpc;
253
+ if (!active)
254
+ return;
254
255
  if (turnId && !ended) {
255
- void rpc
256
+ void active
256
257
  .request('turn/interrupt', { threadId, turnId })
257
258
  .catch(() => { })
258
- .finally(() => rpc.close());
259
- const timer = setTimeout(() => rpc.close(), 1000);
259
+ .finally(() => active.close());
260
+ const timer = setTimeout(() => active.close(), 1000);
260
261
  timer.unref();
261
262
  }
262
263
  else
263
- rpc.close();
264
+ active.close();
264
265
  };
265
266
  owner.controller.signal.addEventListener('abort', abort, { once: true });
266
- rpc.onRequest = async (request) => {
267
+ const onRequest = async (request) => {
267
268
  const p = request.params ?? {};
268
269
  if (ended ||
269
270
  owner.controller.signal.aborted ||
@@ -300,7 +301,17 @@ export class CodexExecutor {
300
301
  };
301
302
  try {
302
303
  owner.check();
303
- await initializeCodex(rpc);
304
+ const pooled = await this.sessions.take(input.resume);
305
+ rpc = pooled?.rpc ?? this.connect(input.cwd);
306
+ rpc.onRequest = onRequest;
307
+ owner.check();
308
+ if (!pooled)
309
+ await initializeCodex(rpc);
310
+ else {
311
+ const account = await rpc.request('account/read', { refreshToken: false });
312
+ if (account.account?.type !== 'chatgpt')
313
+ throw new Error('Codex needs ChatGPT subscription login. Run codex login on this computer.');
314
+ }
304
315
  const inherited = await rpc.request('config/read', { includeLayers: false, cwd: input.cwd });
305
316
  const params = {
306
317
  cwd: input.cwd,
@@ -322,12 +333,25 @@ export class CodexExecutor {
322
333
  developerInstructions: input.systemPrompt,
323
334
  config: codexRunConfig(input, inherited.config),
324
335
  };
325
- const thread = input.resume && !isEmptySession(input.resume)
326
- ? await rpc.request('thread/resume', {
327
- ...params,
328
- threadId: input.resume,
329
- })
330
- : await rpc.request('thread/start', params);
336
+ fingerprint = codexBindingFingerprint(params);
337
+ if (pooled && pooled.fingerprint !== fingerprint) {
338
+ // Permissions, MCP tools, model, cwd or instructions changed. A new transport
339
+ // resumes only after the old owner has fully exited.
340
+ await rpc.close();
341
+ owner.check();
342
+ rpc = this.connect(input.cwd);
343
+ rpc.onRequest = onRequest;
344
+ await initializeCodex(rpc);
345
+ }
346
+ thread =
347
+ pooled?.fingerprint === fingerprint
348
+ ? pooled.thread
349
+ : input.resume && !isEmptySession(input.resume)
350
+ ? await rpc.request('thread/resume', {
351
+ ...params,
352
+ threadId: input.resume,
353
+ })
354
+ : await rpc.request('thread/start', params);
331
355
  threadId = thread.thread.id;
332
356
  const sessionId = isEmptySession(input.resume) &&
333
357
  command &&
@@ -473,6 +497,7 @@ export class CodexExecutor {
473
497
  throw abortError();
474
498
  if (completed.status !== 'completed')
475
499
  throw new Error(completed.error?.message ?? `Codex turn ${completed.status}.`);
500
+ reusable = true;
476
501
  if (command)
477
502
  yield {
478
503
  type: 'tool_call',
@@ -500,8 +525,15 @@ export class CodexExecutor {
500
525
  finally {
501
526
  ended = true;
502
527
  owner.controller.signal.removeEventListener('abort', abort);
503
- rpc.close();
504
- owner.close();
528
+ try {
529
+ if (rpc && reusable && thread && !owner.controller.signal.aborted)
530
+ await this.sessions.keep({ rpc, thread, fingerprint });
531
+ else
532
+ await rpc?.close();
533
+ }
534
+ finally {
535
+ owner.close();
536
+ }
505
537
  }
506
538
  }
507
539
  }
@@ -8,9 +8,12 @@ export type FunctionCallOutputContentItem = {
8
8
  text: string;
9
9
  } | {
10
10
  "type": "input_image";
11
- image_url: string;
12
11
  detail?: ImageDetail;
12
+ } & ({
13
+ image_url: string;
13
14
  } | {
15
+ file_id: string;
16
+ }) | {
14
17
  "type": "input_audio";
15
18
  audio_url: string;
16
19
  } | {
@@ -1 +1 @@
1
- {"version":3,"file":"FunctionCallOutputContentItem.d.ts","sourceRoot":"","sources":["../../../src/executor/codexProtocol/FunctionCallOutputContentItem.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD;;;GAGG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAAE,MAAM,EAAE,YAAY,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;CAAE,GAAG;IAAE,MAAM,EAAE,aAAa,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,WAAW,CAAC;CAAE,GAAG;IAAE,MAAM,EAAE,aAAa,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;CAAE,GAAG;IAAE,MAAM,EAAE,mBAAmB,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAC;CAAE,CAAC"}
1
+ {"version":3,"file":"FunctionCallOutputContentItem.d.ts","sourceRoot":"","sources":["../../../src/executor/codexProtocol/FunctionCallOutputContentItem.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD;;;GAGG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAAE,MAAM,EAAE,YAAY,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;CAAE,GAAG;IAAE,MAAM,EAAE,aAAa,CAAC;IAAC,MAAM,CAAC,EAAE,WAAW,CAAC;CAAE,GAAG,CAAC;IAAE,SAAS,EAAE,MAAM,CAAC;CAAE,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;CAAE,CAAC,GAAG;IAAE,MAAM,EAAE,aAAa,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;CAAE,GAAG;IAAE,MAAM,EAAE,mBAAmB,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAC;CAAE,CAAC"}
@@ -1,2 +1,5 @@
1
+ /**
2
+ * Deprecated: `friendly` and `pragmatic` no longer select a style.
3
+ */
1
4
  export type Personality = "none" | "friendly" | "pragmatic";
2
5
  //# sourceMappingURL=Personality.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Personality.d.ts","sourceRoot":"","sources":["../../../src/executor/codexProtocol/Personality.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,UAAU,GAAG,WAAW,CAAC"}
1
+ {"version":3,"file":"Personality.d.ts","sourceRoot":"","sources":["../../../src/executor/codexProtocol/Personality.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,UAAU,GAAG,WAAW,CAAC"}
@@ -1,2 +1,2 @@
1
- export type PlanType = "free" | "go" | "plus" | "pro" | "prolite" | "team" | "self_serve_business_prolite" | "self_serve_business_usage_based" | "business" | "ent26" | "enterprise_cbp_automation" | "enterprise_cbp_usage_based" | "enterprise" | "edu" | "edu_plus" | "edu_pro" | "unknown";
1
+ export type PlanType = "free" | "go" | "plus" | "pro" | "prolite" | "promax" | "team" | "self_serve_business_prolite" | "self_serve_business_usage_based" | "business" | "ent26" | "enterprise_cbp_automation" | "enterprise_cbp_usage_based" | "enterprise" | "edu" | "edu_plus" | "edu_pro" | "unknown";
2
2
  //# sourceMappingURL=PlanType.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PlanType.d.ts","sourceRoot":"","sources":["../../../src/executor/codexProtocol/PlanType.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,KAAK,GAAG,SAAS,GAAG,MAAM,GAAG,6BAA6B,GAAG,iCAAiC,GAAG,UAAU,GAAG,OAAO,GAAG,2BAA2B,GAAG,4BAA4B,GAAG,YAAY,GAAG,KAAK,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC"}
1
+ {"version":3,"file":"PlanType.d.ts","sourceRoot":"","sources":["../../../src/executor/codexProtocol/PlanType.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,KAAK,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,6BAA6B,GAAG,iCAAiC,GAAG,UAAU,GAAG,OAAO,GAAG,2BAA2B,GAAG,4BAA4B,GAAG,YAAY,GAAG,KAAK,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Requested cyber treatment for a ChatGPT-authenticated Codex turn.
3
+ * Authorization and model-tier restrictions remain server-owned.
4
+ */
5
+ export type CyberAccessProgram = "standard" | "daybreakBlue" | "daybreakRed";
6
+ //# sourceMappingURL=CyberAccessProgram.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CyberAccessProgram.d.ts","sourceRoot":"","sources":["../../../../src/executor/codexProtocol/v2/CyberAccessProgram.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,cAAc,GAAG,aAAa,CAAC"}
@@ -0,0 +1,2 @@
1
+ // GENERATED CODE! DO NOT MODIFY BY HAND!
2
+ export {};
@@ -2,6 +2,11 @@ import type { JsonValue } from "../serde_json/JsonValue.js";
2
2
  import type { RateLimitResetCreditsSummary } from "./RateLimitResetCreditsSummary.js";
3
3
  import type { RateLimitSnapshot } from "./RateLimitSnapshot.js";
4
4
  export type GetAccountRateLimitsResponse = {
5
+ /**
6
+ * Backend permission for ordinary included usage, validated against the active account.
7
+ * Null means unavailable; clients must not infer recovery from percentages or reset times.
8
+ */
9
+ ordinaryUsageAllowed: boolean | null;
5
10
  /**
6
11
  * Backward-compatible single-bucket view; mirrors the historical payload.
7
12
  */
@@ -1 +1 @@
1
- {"version":3,"file":"GetAccountRateLimitsResponse.d.ts","sourceRoot":"","sources":["../../../../src/executor/codexProtocol/v2/GetAccountRateLimitsResponse.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACtF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,MAAM,MAAM,4BAA4B,GAAG;IAC3C;;OAEG;IACH,UAAU,EAAE,iBAAiB,CAAC;IAC9B;;OAEG;IACH,mBAAmB,EAAE;SAAG,GAAG,IAAI,MAAM,CAAC,CAAC,EAAE,iBAAiB;KAAE,GAAG,IAAI,CAAC;IAAC,qBAAqB,EAAE,4BAA4B,GAAG,IAAI,CAAC;IAChI;;OAEG;IACH,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB;;;OAGG;IACH,eAAe,EAAE,SAAS,GAAG,IAAI,CAAC;CAAE,CAAC"}
1
+ {"version":3,"file":"GetAccountRateLimitsResponse.d.ts","sourceRoot":"","sources":["../../../../src/executor/codexProtocol/v2/GetAccountRateLimitsResponse.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACtF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,MAAM,MAAM,4BAA4B,GAAG;IAC3C;;;OAGG;IACH,oBAAoB,EAAE,OAAO,GAAG,IAAI,CAAC;IACrC;;OAEG;IACH,UAAU,EAAE,iBAAiB,CAAC;IAC9B;;OAEG;IACH,mBAAmB,EAAE;SAAG,GAAG,IAAI,MAAM,CAAC,CAAC,EAAE,iBAAiB;KAAE,GAAG,IAAI,CAAC;IAAC,qBAAqB,EAAE,4BAA4B,GAAG,IAAI,CAAC;IAChI;;OAEG;IACH,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB;;;OAGG;IACH,eAAe,EAAE,SAAS,GAAG,IAAI,CAAC;CAAE,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import type { InputModality } from "../InputModality.js";
2
2
  import type { ReasoningEffort } from "../ReasoningEffort.js";
3
+ import type { ModelAccessPrograms } from "./ModelAccessPrograms.js";
3
4
  import type { ModelAvailabilityNux } from "./ModelAvailabilityNux.js";
4
5
  import type { ModelServiceTier } from "./ModelServiceTier.js";
5
6
  import type { ModelUpgradeInfo } from "./ModelUpgradeInfo.js";
@@ -18,6 +19,9 @@ export type Model = {
18
19
  supportedReasoningEfforts: Array<ReasoningEffortOption>;
19
20
  defaultReasoningEffort: ReasoningEffort;
20
21
  inputModalities: Array<InputModality>;
22
+ /**
23
+ * @deprecated Always false; models no longer support personality selection.
24
+ */
21
25
  supportsPersonality: boolean;
22
26
  /**
23
27
  * Multi-agent runtime declared by this model, when available.
@@ -32,6 +36,10 @@ export type Model = {
32
36
  * Catalog default service tier id for this model, when one is configured.
33
37
  */
34
38
  defaultServiceTier: string | null;
39
+ /**
40
+ * Null when the catalog does not provide access-program metadata.
41
+ */
42
+ availableAccessPrograms: ModelAccessPrograms | null;
35
43
  isDefault: boolean;
36
44
  };
37
45
  //# sourceMappingURL=Model.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Model.d.ts","sourceRoot":"","sources":["../../../../src/executor/codexProtocol/v2/Model.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAExE,MAAM,MAAM,KAAK,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,WAAW,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAAC,eAAe,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC;IAAC,yBAAyB,EAAE,KAAK,CAAC,qBAAqB,CAAC,CAAC;IAAC,sBAAsB,EAAE,eAAe,CAAC;IAAC,eAAe,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;IAAC,mBAAmB,EAAE,O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qBAAqB,CAAC,CAAC;IAAC,sBAAsB,EAAE,eAAe,CAAC;IAAC,eAAe,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;IAC/X;;OAEG;IACH,mBAAmB,EAAE,OAAO,CAAC;IAC7B;;OAEG;IACH,iBAAiB,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAC5C;;OAEG;IACH,oBAAoB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAAC,YAAY,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAC3E;;OAEG;IACH,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC;;OAEG;IACH,uBAAuB,EAAE,mBAAmB,GAAG,IAAI,CAAC;IAAC,SAAS,EAAE,OAAO,CAAC;CAAE,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { CyberAccessProgram } from "./CyberAccessProgram.js";
2
+ /**
3
+ * Caller-specific explicit access programs advertised by model discovery.
4
+ */
5
+ export type ModelAccessPrograms = {
6
+ /**
7
+ * Accepted explicit selections.
8
+ */
9
+ cyber: Array<CyberAccessProgram>;
10
+ };
11
+ //# sourceMappingURL=ModelAccessPrograms.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModelAccessPrograms.d.ts","sourceRoot":"","sources":["../../../../src/executor/codexProtocol/v2/ModelAccessPrograms.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAClC;;OAEG;IACH,KAAK,EAAE,KAAK,CAAC,kBAAkB,CAAC,CAAC;CAAE,CAAC"}
@@ -0,0 +1,2 @@
1
+ // GENERATED CODE! DO NOT MODIFY BY HAND!
2
+ export {};
@@ -6,6 +6,10 @@ import type { SpendControlLimitSnapshot } from "./SpendControlLimitSnapshot.js";
6
6
  export type RateLimitSnapshot = {
7
7
  limitId: string | null;
8
8
  limitName: string | null;
9
+ /**
10
+ * Normal model whose display name and reasoning options describe this quota alias.
11
+ */
12
+ normalModelSlug: string | null;
9
13
  primary: RateLimitWindow | null;
10
14
  secondary: RateLimitWindow | null;
11
15
  credits: CreditsSnapshot | null;
@@ -1 +1 @@
1
- {"version":3,"file":"RateLimitSnapshot.d.ts","sourceRoot":"","sources":["../../../../src/executor/codexProtocol/v2/RateLimitSnapshot.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAEhF,MAAM,MAAM,iBAAiB,GAAG;IAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,eAAe,GAAG,IAAI,CAAC;IAAC,SAAS,EAAE,eAAe,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,eAAe,GAAG,IAAI,CAAC;IAAC,eAAe,EAAE,yBAAyB,GAAG,IAAI,CAAC;IAC3O;;OAEG;IACH,mBAAmB,EAAE,OAAO,GAAG,IAAI,CAAC;IAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;IAAC,oBAAoB,EAAE,oBAAoB,GAAG,IAAI,CAAC;CAAE,CAAC"}
1
+ {"version":3,"file":"RateLimitSnapshot.d.ts","sourceRoot":"","sources":["../../../../src/executor/codexProtocol/v2/RateLimitSnapshot.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAEhF,MAAM,MAAM,iBAAiB,GAAG;IAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACnF;;OAEG;IACH,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,eAAe,GAAG,IAAI,CAAC;IAAC,SAAS,EAAE,eAAe,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,eAAe,GAAG,IAAI,CAAC;IAAC,eAAe,EAAE,yBAAyB,GAAG,IAAI,CAAC;IACvL;;OAEG;IACH,mBAAmB,EAAE,OAAO,GAAG,IAAI,CAAC;IAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;IAAC,oBAAoB,EAAE,oBAAoB,GAAG,IAAI,CAAC;CAAE,CAAC"}
@@ -6,6 +6,8 @@ export type ReviewStartParams = {
6
6
  /**
7
7
  * Where to run the review: inline (default) on the current thread or
8
8
  * detached on a new thread (returned in `reviewThreadId`).
9
+ * Detached delivery is deprecated and emits `deprecationNotice`.
10
+ * Use `thread/start` followed by an inline review for a separate review thread.
9
11
  */
10
12
  delivery?: ReviewDelivery | null;
11
13
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ReviewStartParams.d.ts","sourceRoot":"","sources":["../../../../src/executor/codexProtocol/v2/ReviewStartParams.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,MAAM,iBAAiB,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,YAAY,CAAC;IACzE;;;OAGG;IACH,QAAQ,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;CAAE,CAAC"}
1
+ {"version":3,"file":"ReviewStartParams.d.ts","sourceRoot":"","sources":["../../../../src/executor/codexProtocol/v2/ReviewStartParams.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,MAAM,iBAAiB,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,YAAY,CAAC;IACzE;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;CAAE,CAAC"}
@@ -37,7 +37,10 @@ export type ThreadResumeParams = {
37
37
  [key in string]?: JsonValue;
38
38
  } | null;
39
39
  baseInstructions?: string | null;
40
- developerInstructions?: string | null;
40
+ developerInstructions?: string | null; /**
41
+ * @deprecated `friendly` and `pragmatic` no longer select a style.
42
+ * Changing this does not rewrite the thread's existing instructions.
43
+ */
41
44
  personality?: Personality | null; /**
42
45
  * When true, return only thread metadata and live-resume state without
43
46
  * populating `thread.turns`. This is useful when the client plans to call
@@ -1 +1 @@
1
- {"version":3,"file":"ThreadResumeParams.d.ts","sourceRoot":"","sources":["../../../../src/executor/codexProtocol/v2/ThreadResumeParams.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAAC,QAAQ,EAAE,MAAM,CAAC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AAI,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,cAAc,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC,CAAC;;;OAGpJ;IACH,iBAAiB,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAAC,OAAO,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAAC,MAAM,CAAC,EAAE;SAAG,GAAG,IAAI,MAAM,CAAC,CAAC,EAAE,SAAS;KAAE,GAAG,IAAI,CAAC;IAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,qBAAqB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;;;OAGnM;IACH,WAAW,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC,CAAC;;;;;;OAM/B;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;CAAC,CAAC"}
@@ -21,7 +21,9 @@ export type ThreadStartParams = {
21
21
  } | null;
22
22
  serviceName?: string | null;
23
23
  baseInstructions?: string | null;
24
- developerInstructions?: string | null;
24
+ developerInstructions?: string | null; /**
25
+ * @deprecated `friendly` and `pragmatic` no longer select a style.
26
+ */
25
27
  personality?: Personality | null;
26
28
  ephemeral?: boolean | null;
27
29
  sessionStartSource?: ThreadStartSource | null; /**
@@ -1 +1 @@
1
- {"version":3,"file":"ThreadStartParams.d.ts","sourceRoot":"","sources":["../../../../src/executor/codexProtocol/v2/ThreadStartParams.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,cAAc,EAA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,7 +8,11 @@ import type { SandboxPolicy } from "./SandboxPolicy.js";
8
8
  import type { TurnToolOutput } from "./TurnToolOutput.js";
9
9
  import type { UserInput } from "./UserInput.js";
10
10
  export type TurnStartParams = {
11
- threadId: string;
11
+ threadId: string; /**
12
+ * Replace this thread's disabled plugin IDs.
13
+ * Omitted/null preserves the list; [] clears it.
14
+ */
15
+ disabledPluginIds?: Array<string> | null;
12
16
  clientUserMessageId?: string | null;
13
17
  input: Array<UserInput>; /**
14
18
  * Optional source classification for the caller that starts this turn.
@@ -46,7 +50,8 @@ export type TurnStartParams = {
46
50
  * Override the reasoning summary for this turn and subsequent turns.
47
51
  */
48
52
  summary?: ReasoningSummary | null; /**
49
- * Override the personality for this turn and subsequent turns.
53
+ * @deprecated `friendly` and `pragmatic` no longer select a style.
54
+ * Changing this does not rewrite the thread's existing instructions.
50
55
  */
51
56
  personality?: Personality | null; /**
52
57
  * Optional JSON Schema used to constrain the final assistant message for
@@ -1 +1 @@
1
- {"version":3,"file":"TurnStartParams.d.ts","sourceRoot":"","sources":["../../../../src/executor/codexProtocol/v2/TurnStartParams.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MA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AAC;;OAE9B;IACH,OAAO,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC,CAAC;;;OAGhC;IACH,WAAW,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC,CAAC;;;OAG/B;IACH,YAAY,CAAC,EAAE,SAAS,GAAG,IAAI,CAAA;CAAC,CAAC"}
@@ -10,8 +10,11 @@ export type UserInput = {
10
10
  } | {
11
11
  "type": "image";
12
12
  detail?: ImageDetail;
13
+ } & ({
13
14
  url: string;
14
15
  } | {
16
+ fileId: string;
17
+ }) | {
15
18
  "type": "localImage";
16
19
  detail?: ImageDetail;
17
20
  path: string;
@@ -1 +1 @@
1
- {"version":3,"file":"UserInput.d.ts","sourceRoot":"","sources":["../../../../src/executor/codexProtocol/v2/UserInput.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,MAAM,MAAM,SAAS,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IACvD;;OAEG;IACH,aAAa,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;CAAE,GAAG;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,WAAW,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;CAAE,GAAG;IAAE,MAAM,EAAE,YAAY,CAAC;IAAC,MAAM,CAAC,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;CAAE,GAAG;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;CAAE,GAAG;IAAE,MAAM,EAAE,YAAY,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;CAAE,GAAG;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;CAAE,GAAG;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;CAAE,CAAC"}
1
+ {"version":3,"file":"UserInput.d.ts","sourceRoot":"","sources":["../../../../src/executor/codexProtocol/v2/UserInput.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,MAAM,MAAM,SAAS,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IACvD;;OAEG;IACH,aAAa,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;CAAE,GAAG;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,WAAW,CAAC;CAAE,GAAG,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;CAAE,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;CAAE,CAAC,GAAG;IAAE,MAAM,EAAE,YAAY,CAAC;IAAC,MAAM,CAAC,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;CAAE,GAAG;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;CAAE,GAAG;IAAE,MAAM,EAAE,YAAY,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;CAAE,GAAG;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;CAAE,GAAG;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;CAAE,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { AsyncQueue } from './asyncQueue.js';
2
- export declare const CODEX_RUNTIME_VERSION = "0.153.4";
2
+ export declare const CODEX_RUNTIME_VERSION = "0.160.0";
3
3
  export interface RpcMessage {
4
4
  id?: number | string;
5
5
  method?: string;
@@ -10,11 +10,14 @@ export interface RpcMessage {
10
10
  };
11
11
  }
12
12
  export interface CodexConnection {
13
+ readonly isConnected?: boolean;
13
14
  events: AsyncIterable<RpcMessage>;
14
15
  request<T>(method: string, params: unknown): Promise<T>;
15
16
  respond(id: number | string, result: unknown): void;
16
17
  onRequest?: (message: RpcMessage) => Promise<unknown>;
17
- close(): void;
18
+ /** Completed turns may retain the transport while discarding idle notifications. */
19
+ setIdle?(idle: boolean): void;
20
+ close(): void | Promise<void>;
18
21
  }
19
22
  export declare function codexSubscriptionEnv(): NodeJS.ProcessEnv;
20
23
  /** Bidirectional stdio JSON-RPC. Pending requests fail on timeout or child exit. */
@@ -22,16 +25,20 @@ export declare class CodexRpc implements CodexConnection {
22
25
  readonly events: AsyncQueue<RpcMessage>;
23
26
  onRequest?: (message: RpcMessage) => Promise<unknown>;
24
27
  private child;
28
+ private readonly exited;
25
29
  private sequence;
26
30
  private closed;
31
+ private idle;
32
+ get isConnected(): boolean;
27
33
  private pending;
28
34
  constructor(command?: string, cwd?: string);
29
35
  private write;
36
+ setIdle(idle: boolean): void;
30
37
  notify(method: string, params?: unknown): void;
31
38
  respond(id: number | string, result: unknown): void;
32
39
  request<T>(method: string, params: unknown): Promise<T>;
33
40
  private finish;
34
- close(): void;
41
+ close(): Promise<void>;
35
42
  }
36
43
  export declare function initializeCodex(rpc: CodexConnection): Promise<void>;
37
44
  //# sourceMappingURL=codexRpc.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"codexRpc.d.ts","sourceRoot":"","sources":["../../src/executor/codexRpc.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAQ7C,eAAO,MAAM,qBAAqB,YAAY,CAAC;AAC/C,MAAM,WAAW,UAAU;IACzB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,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D;AAED,oFAAoF;AACpF,qBAAa,QAAS,YAAW,eAAe;IAC9C,QAAQ,CAAC,MAAM,yBAAgC;IAC/C,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACtD,OAAO,CAAC,KAAK,CAAiC;IAC9C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgB;IACvC,OAAO,CAAC,QAAQ,CAAK;IACrB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,IAAI,CAAS;IACrB,IAAI,WAAW,IAAI,OAAO,CAEzB;IACD,OAAO,CAAC,OAAO,CAOX;gBAEQ,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM;IAqE1C,OAAO,CAAC,KAAK;IAIb,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI;IAI5B,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,IAAI;IAG9C,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI;IAGnD,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;IAsBvD,OAAO,CAAC,MAAM;IAgBR,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAI7B;AAED,wBAAsB,eAAe,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAczE"}
@@ -5,7 +5,7 @@ import { AsyncQueue } from './asyncQueue.js';
5
5
  import { stripUnsafeEnv } from './claudeCode.js';
6
6
  const require = createRequire(import.meta.url);
7
7
  const { version: lucidityVersion } = require('../../package.json');
8
- export const CODEX_RUNTIME_VERSION = '0.153.4';
8
+ export const CODEX_RUNTIME_VERSION = '0.160.0';
9
9
  export function codexSubscriptionEnv() {
10
10
  const env = stripUnsafeEnv(process.env);
11
11
  for (const key of ['OPENAI_API_KEY', 'CODEX_API_KEY', 'OPENAI_BASE_URL'])
@@ -17,8 +17,13 @@ export class CodexRpc {
17
17
  events = new AsyncQueue();
18
18
  onRequest;
19
19
  child;
20
+ exited;
20
21
  sequence = 0;
21
22
  closed = false;
23
+ idle = false;
24
+ get isConnected() {
25
+ return !this.closed;
26
+ }
22
27
  pending = new Map();
23
28
  constructor(command, cwd) {
24
29
  const prefix = command
@@ -38,6 +43,10 @@ export class CodexRpc {
38
43
  env: codexSubscriptionEnv(),
39
44
  stdio: ['pipe', 'pipe', 'pipe'],
40
45
  });
46
+ this.exited = new Promise((resolve) => {
47
+ this.child.once('close', () => resolve());
48
+ this.child.once('error', () => resolve());
49
+ });
41
50
  // Drain stderr without retaining potentially sensitive prompt/config diagnostics.
42
51
  this.child.stderr.on('data', () => { });
43
52
  this.child.stdin.on('error', () => { });
@@ -74,7 +83,7 @@ export class CodexRpc {
74
83
  else
75
84
  pending.resolve(message.result);
76
85
  }
77
- else if (message.method && !this.closed)
86
+ else if (message.method && !this.closed && !this.idle)
78
87
  this.events.push(message);
79
88
  });
80
89
  }
@@ -83,6 +92,11 @@ export class CodexRpc {
83
92
  throw new Error('Codex is disconnected.');
84
93
  this.child.stdin.write(JSON.stringify(value) + '\n');
85
94
  }
95
+ setIdle(idle) {
96
+ this.idle = idle;
97
+ if (idle)
98
+ this.events.discardPending();
99
+ }
86
100
  notify(method, params) {
87
101
  this.write({ method, params });
88
102
  }
@@ -132,8 +146,9 @@ export class CodexRpc {
132
146
  kill.unref();
133
147
  this.child.once('close', () => clearTimeout(kill));
134
148
  }
135
- close() {
149
+ async close() {
136
150
  this.finish(new Error('Codex session closed.'));
151
+ await this.exited;
137
152
  }
138
153
  }
139
154
  export async function initializeCodex(rpc) {
@@ -0,0 +1,30 @@
1
+ import type { CodexConnection } from './codexRpc.js';
2
+ /** Rust maps may arrive in a different order; credentials never become a stored key. */
3
+ export declare function codexBindingFingerprint(value: unknown): string;
4
+ export interface CodexThread {
5
+ thread: {
6
+ id: string;
7
+ };
8
+ model?: string;
9
+ reasoningEffort?: string | null;
10
+ cwd?: string;
11
+ }
12
+ export interface CodexSession {
13
+ rpc: CodexConnection;
14
+ thread: CodexThread;
15
+ fingerprint: string;
16
+ }
17
+ /** Completed threads retain one transport; idle eviction still awaits the native exit. */
18
+ export declare class CodexSessions {
19
+ private readonly limit;
20
+ private readonly idleMs;
21
+ private idle;
22
+ private closing;
23
+ private disposed;
24
+ constructor(limit?: number, idleMs?: number);
25
+ take(id?: string): Promise<CodexSession | undefined>;
26
+ private evict;
27
+ keep(session: CodexSession): Promise<void>;
28
+ dispose(): Promise<void>;
29
+ }
30
+ //# sourceMappingURL=codexSessions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codexSessions.d.ts","sourceRoot":"","sources":["../../src/executor/codexSessions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGrD,wFAAwF;AACxF,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAc9D;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AACD,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,eAAe,CAAC;IACrB,MAAM,EAAE,WAAW,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,0FAA0F;AAC1F,qBAAa,aAAa;IAQtB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,MAAM;IARzB,OAAO,CAAC,IAAI,CAGR;IACJ,OAAO,CAAC,OAAO,CAAoC;IACnD,OAAO,CAAC,QAAQ,CAAS;gBAEN,KAAK,SAAI,EACT,MAAM,SAAa;IAGhC,IAAI,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;IAgB1D,OAAO,CAAC,KAAK;IAcP,IAAI,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IA2B1C,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAK/B"}