stitchkit 0.130.1 → 0.132.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 (159) hide show
  1. package/CHANGELOG.md +68 -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/transcript.d.ts +1 -1
  21. package/dist/agent-executor/claude/transcript.d.ts.map +1 -1
  22. package/dist/agent-executor/claude-sdk/controls.d.ts +1 -0
  23. package/dist/agent-executor/claude-sdk/controls.d.ts.map +1 -1
  24. package/dist/agent-executor/claude-sdk/driver.d.ts +51 -50
  25. package/dist/agent-executor/claude-sdk/driver.d.ts.map +1 -1
  26. package/dist/agent-executor/claude-sdk/probe.d.ts +3 -3
  27. package/dist/agent-executor/claude-sdk/probe.d.ts.map +1 -1
  28. package/dist/agent-executor/claude-sdk/query-loop.d.ts +2 -1
  29. package/dist/agent-executor/claude-sdk/query-loop.d.ts.map +1 -1
  30. package/dist/agent-executor/claude-sdk/session.d.ts.map +1 -1
  31. package/dist/agent-executor/codex/classify.d.ts.map +1 -1
  32. package/dist/agent-executor/codex/connect.d.ts +7 -7
  33. package/dist/agent-executor/codex/connect.d.ts.map +1 -1
  34. package/dist/agent-executor/codex/control-client.d.ts +86 -99
  35. package/dist/agent-executor/codex/control-client.d.ts.map +1 -1
  36. package/dist/agent-executor/codex/control-read-methods.d.ts +7 -0
  37. package/dist/agent-executor/codex/control-read-methods.d.ts.map +1 -0
  38. package/dist/agent-executor/codex/driver.d.ts +29 -28
  39. package/dist/agent-executor/codex/driver.d.ts.map +1 -1
  40. package/dist/agent-executor/codex/event-routing.d.ts +14 -0
  41. package/dist/agent-executor/codex/event-routing.d.ts.map +1 -0
  42. package/dist/agent-executor/codex/handlers.d.ts +2 -2
  43. package/dist/agent-executor/codex/handlers.d.ts.map +1 -1
  44. package/dist/agent-executor/codex/limits.d.ts +9 -3
  45. package/dist/agent-executor/codex/limits.d.ts.map +1 -1
  46. package/dist/agent-executor/codex/notifications.d.ts +183 -0
  47. package/dist/agent-executor/codex/notifications.d.ts.map +1 -0
  48. package/dist/agent-executor/codex/pagination.d.ts +54 -0
  49. package/dist/agent-executor/codex/pagination.d.ts.map +1 -0
  50. package/dist/agent-executor/codex/protocol.d.ts +586 -148
  51. package/dist/agent-executor/codex/protocol.d.ts.map +1 -1
  52. package/dist/agent-executor/codex/request-answers.d.ts +4 -2
  53. package/dist/agent-executor/codex/request-answers.d.ts.map +1 -1
  54. package/dist/agent-executor/codex/responses.d.ts +855 -0
  55. package/dist/agent-executor/codex/responses.d.ts.map +1 -0
  56. package/dist/agent-executor/codex/session-bind.d.ts +410 -0
  57. package/dist/agent-executor/codex/session-bind.d.ts.map +1 -0
  58. package/dist/agent-executor/codex/session-controls.d.ts +19 -190
  59. package/dist/agent-executor/codex/session-controls.d.ts.map +1 -1
  60. package/dist/agent-executor/codex/session-types.d.ts +190 -0
  61. package/dist/agent-executor/codex/session-types.d.ts.map +1 -0
  62. package/dist/agent-executor/codex/session.d.ts +1 -1
  63. package/dist/agent-executor/codex/session.d.ts.map +1 -1
  64. package/dist/agent-executor/codex/shared-server.d.ts +4 -4
  65. package/dist/agent-executor/codex/shared-server.d.ts.map +1 -1
  66. package/dist/agent-executor/codex/shared-thread.d.ts +5 -5
  67. package/dist/agent-executor/codex/shared-thread.d.ts.map +1 -1
  68. package/dist/agent-executor/codex/thread-controls.d.ts +45 -36
  69. package/dist/agent-executor/codex/thread-controls.d.ts.map +1 -1
  70. package/dist/agent-executor/codex/thread-list-query.d.ts +5 -0
  71. package/dist/agent-executor/codex/thread-list-query.d.ts.map +1 -0
  72. package/dist/agent-executor/codex/thread-open.d.ts +20 -20
  73. package/dist/agent-executor/codex/thread-open.d.ts.map +1 -1
  74. package/dist/agent-executor/codex/turn-input.d.ts +4 -3
  75. package/dist/agent-executor/codex/turn-input.d.ts.map +1 -1
  76. package/dist/agent-executor/codex/unix-socket-target.d.ts +12 -3
  77. package/dist/agent-executor/codex/unix-socket-target.d.ts.map +1 -1
  78. package/dist/agent-executor/codex/ws-frame.d.ts +4 -1
  79. package/dist/agent-executor/codex/ws-frame.d.ts.map +1 -1
  80. package/dist/agent-executor/contract.d.ts +3 -1
  81. package/dist/agent-executor/contract.d.ts.map +1 -1
  82. package/dist/agent-executor/engine-process.d.ts +4 -4
  83. package/dist/agent-executor/engine-process.d.ts.map +1 -1
  84. package/dist/agent-executor/engine.d.ts +3 -3
  85. package/dist/agent-executor/engine.d.ts.map +1 -1
  86. package/dist/agent-executor/handoff.d.ts.map +1 -1
  87. package/dist/agent-executor/hello.d.ts +7 -0
  88. package/dist/agent-executor/hello.d.ts.map +1 -1
  89. package/dist/agent-executor/json-rpc-peer.d.ts +9 -4
  90. package/dist/agent-executor/json-rpc-peer.d.ts.map +1 -1
  91. package/dist/agent-executor/leases.d.ts +1 -1
  92. package/dist/agent-executor/leases.d.ts.map +1 -1
  93. package/dist/agent-executor/plan-limits.d.ts +12 -1
  94. package/dist/agent-executor/plan-limits.d.ts.map +1 -1
  95. package/dist/agent-executor/profile.d.ts +9 -1
  96. package/dist/agent-executor/profile.d.ts.map +1 -1
  97. package/dist/agent-executor/session-primitives.d.ts +8 -0
  98. package/dist/agent-executor/session-primitives.d.ts.map +1 -1
  99. package/dist/agent-executor/testing/consumer-stubs.d.ts +45 -0
  100. package/dist/agent-executor/testing/consumer-stubs.d.ts.map +1 -0
  101. package/dist/agent-executor/testing/fake-claude-sdk-query.d.ts +88 -0
  102. package/dist/agent-executor/testing/fake-claude-sdk-query.d.ts.map +1 -0
  103. package/dist/agent-executor/testing/fake-codex-app-server.d.ts +56 -0
  104. package/dist/agent-executor/testing/fake-codex-app-server.d.ts.map +1 -0
  105. package/dist/agent-executor/testing/fixtures.d.ts +26 -0
  106. package/dist/agent-executor/testing/fixtures.d.ts.map +1 -0
  107. package/dist/agent-executor/testing/replay-driver.d.ts +8 -8
  108. package/dist/agent-executor/testing/replay-driver.d.ts.map +1 -1
  109. package/dist/agent-executor/testing/replay-runner.d.ts +3 -2
  110. package/dist/agent-executor/testing/replay-runner.d.ts.map +1 -1
  111. package/dist/agent-executor/testing/replay-transcript.d.ts +5 -3
  112. package/dist/agent-executor/testing/replay-transcript.d.ts.map +1 -1
  113. package/dist/agent-runtime/branch-observations.d.ts +19 -19
  114. package/dist/agent-runtime/sql-rows.d.ts +10 -10
  115. package/dist/agent-runtime/store-conformance-lifecycle.d.ts +20 -20
  116. package/dist/agent-runtime/store-conformance-support.d.ts +10 -10
  117. package/dist/agent-runtime/terminal-commit.d.ts +10 -10
  118. package/dist/entrypoints/agent-executor/acp.d.ts +2 -1
  119. package/dist/entrypoints/agent-executor/acp.d.ts.map +1 -1
  120. package/dist/entrypoints/agent-executor/acp.js +284 -82
  121. package/dist/entrypoints/agent-executor/claude-sdk.d.ts +4 -0
  122. package/dist/entrypoints/agent-executor/claude-sdk.d.ts.map +1 -1
  123. package/dist/entrypoints/agent-executor/claude-sdk.js +64 -37
  124. package/dist/entrypoints/agent-executor/claude.d.ts +2 -2
  125. package/dist/entrypoints/agent-executor/claude.d.ts.map +1 -1
  126. package/dist/entrypoints/agent-executor/claude.js +29 -23
  127. package/dist/entrypoints/agent-executor/codex.d.ts +9 -5
  128. package/dist/entrypoints/agent-executor/codex.d.ts.map +1 -1
  129. package/dist/entrypoints/agent-executor/codex.js +1860 -1695
  130. package/dist/entrypoints/agent-executor/testing.d.ts +4 -0
  131. package/dist/entrypoints/agent-executor/testing.d.ts.map +1 -1
  132. package/dist/entrypoints/agent-executor/testing.js +880 -18
  133. package/dist/entrypoints/agent-executor.d.ts +3 -3
  134. package/dist/entrypoints/agent-executor.d.ts.map +1 -1
  135. package/dist/entrypoints/agent-executor.js +42 -8
  136. package/dist/entrypoints/process.js +3 -3
  137. package/dist/entrypoints/sync.js +8 -4
  138. package/dist/{index-jrn3prgm.js → index-athc412x.js} +29 -4
  139. package/dist/{index-dbp6xemn.js → index-f9p62ean.js} +219 -7
  140. package/dist/index-j15dhkda.js +749 -0
  141. package/dist/index-jcrj0b8z.js +56 -0
  142. package/dist/{index-1q0n6zek.js → index-kwsr7j5k.js} +84 -44
  143. package/dist/{index-p1qmpq0p.js → index-z114ax5e.js} +93 -57
  144. package/dist/sync/session-machine.d.ts.map +1 -1
  145. package/dist/sync/session.d.ts +3 -3
  146. package/llms/agent-executor-acp.txt +5 -5
  147. package/llms/agent-executor-claude-sdk.txt +3 -1
  148. package/llms/agent-executor-claude.txt +2 -2
  149. package/llms/agent-executor-codex.txt +11 -8
  150. package/llms/agent-executor-testing.txt +5 -1
  151. package/llms/agent-executor.txt +10 -4
  152. package/llms/stitchkit.txt +75 -74
  153. package/llms/sync.txt +1 -1
  154. package/llms/{upgrading-0.128.0-0.130.0.txt → upgrading-0.128.0-0.132.0.txt} +76 -3
  155. package/llms/upgrading.txt +1 -1
  156. package/llms-full.txt +185 -96
  157. package/llms.txt +8 -8
  158. package/package.json +3 -3
  159. package/dist/index-2s8sy57y.js +0 -229
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import type { JsonRpcValue } from '../json-rpc-peer.js';
2
+ import { JsonRpcRecordSchema } from '../json-rpc-peer.js';
3
3
  /**
4
4
  * The slice of Codex's app-server protocol (0.171.0, JSON-RPC over stdio or
5
5
  * WebSocket-over-Unix-socket without the `jsonrpc` header) the driver reads.
@@ -7,10 +7,124 @@ import type { JsonRpcValue } from '../json-rpc-peer.js';
7
7
  * the JSON Schema the pinned CLI generates, so a renamed field fails there and
8
8
  * not in a turn.
9
9
  */
10
+ /** Typed protocol error raised when a Codex app-server response or notification violates its schema. */
11
+ export declare class CodexProtocolError extends Error {
12
+ readonly method: string;
13
+ readonly cause: z.ZodError;
14
+ constructor(method: string, cause: z.ZodError, message?: string);
15
+ }
16
+ /** Parse a Codex JSON-RPC payload with `schema`, wrapping any `ZodError` in {@link CodexProtocolError}. */
17
+ export declare function parseCodexResponse<T>(method: string, schema: z.ZodType<T>, raw: unknown, kind?: 'response' | 'notification'): T;
18
+ /** Fallback schema for open-variant unions (`{ type: string }`) preserving TS narrowing. */
19
+ export declare function unknownTypedRecordSchema<TDisallowed extends Record<string, never | undefined>>(knownTypes: ReadonlySet<string>): z.ZodCustom<{
20
+ readonly type: string;
21
+ } & TDisallowed, {
22
+ readonly type: string;
23
+ } & TDisallowed>;
24
+ /** Zod schema for approval policies accepted by Codex `thread/start`, `thread/resume`, `thread/fork`, and `turn/start`. */
25
+ export declare const CodexApprovalPolicySchema: z.ZodUnion<readonly [z.ZodEnum<{
26
+ never: "never";
27
+ "on-failure": "on-failure";
28
+ "on-request": "on-request";
29
+ untrusted: "untrusted";
30
+ }>, z.ZodRecord<z.ZodString, z.ZodJSONSchema>]>;
10
31
  /** Approval policy values accepted by Codex `thread/start`, `thread/resume`, `thread/fork`, and `turn/start`. */
11
- export type CodexApprovalPolicy = 'untrusted' | 'on-failure' | 'on-request' | 'never' | Readonly<Record<string, JsonRpcValue>>;
32
+ export type CodexApprovalPolicy = 'untrusted' | 'on-failure' | 'on-request' | 'never' | Readonly<z.infer<typeof JsonRpcRecordSchema>>;
33
+ /** Zod schema for sandbox modes accepted by Codex `thread/start`, `thread/resume`, and `thread/fork`. */
34
+ export declare const CodexSandboxModeSchema: z.ZodEnum<{
35
+ "danger-full-access": "danger-full-access";
36
+ "read-only": "read-only";
37
+ "workspace-write": "workspace-write";
38
+ }>;
12
39
  /** Sandbox mode values accepted by Codex `thread/start`, `thread/resume`, and `thread/fork`. */
13
- export type CodexSandboxMode = 'read-only' | 'workspace-write' | 'danger-full-access';
40
+ export type CodexSandboxMode = z.infer<typeof CodexSandboxModeSchema>;
41
+ /** Open-variant Zod schema for Codex `SandboxPolicy` (known 0.171.0 variants strictly validated; unknown future `type` passes through). */
42
+ export declare const CodexSandboxPolicySchema: z.ZodUnion<readonly [z.ZodObject<{
43
+ type: z.ZodLiteral<"dangerFullAccess">;
44
+ }, z.core.$loose>, z.ZodObject<{
45
+ type: z.ZodLiteral<"readOnly">;
46
+ networkAccess: z.ZodOptional<z.ZodBoolean>;
47
+ }, z.core.$loose>, z.ZodObject<{
48
+ type: z.ZodLiteral<"externalSandbox">;
49
+ networkAccess: z.ZodOptional<z.ZodString>;
50
+ }, z.core.$loose>, z.ZodObject<{
51
+ type: z.ZodLiteral<"workspaceWrite">;
52
+ writableRoots: z.ZodOptional<z.ZodArray<z.ZodString>>;
53
+ networkAccess: z.ZodOptional<z.ZodBoolean>;
54
+ excludeTmpdirEnvVar: z.ZodOptional<z.ZodBoolean>;
55
+ excludeSlashTmp: z.ZodOptional<z.ZodBoolean>;
56
+ }, z.core.$loose>, z.ZodCustom<{
57
+ readonly type: string;
58
+ } & {
59
+ readonly writableRoots?: never;
60
+ readonly networkAccess?: never;
61
+ readonly excludeTmpdirEnvVar?: never;
62
+ readonly excludeSlashTmp?: never;
63
+ }, {
64
+ readonly type: string;
65
+ } & {
66
+ readonly writableRoots?: never;
67
+ readonly networkAccess?: never;
68
+ readonly excludeTmpdirEnvVar?: never;
69
+ readonly excludeSlashTmp?: never;
70
+ }>]>;
71
+ /** Applied or per-turn Codex sandbox policy inferred from {@link CodexSandboxPolicySchema}. */
72
+ export type CodexSandboxPolicy = z.infer<typeof CodexSandboxPolicySchema>;
73
+ /** Open-variant Zod schema for Codex `ThreadStatus` (`notLoaded`, `idle`, `systemError`, `active`, or future variants). */
74
+ export declare const CodexThreadStatusSchema: z.ZodUnion<readonly [z.ZodObject<{
75
+ type: z.ZodLiteral<"notLoaded">;
76
+ }, z.core.$loose>, z.ZodObject<{
77
+ type: z.ZodLiteral<"idle">;
78
+ }, z.core.$loose>, z.ZodObject<{
79
+ type: z.ZodLiteral<"systemError">;
80
+ }, z.core.$loose>, z.ZodObject<{
81
+ type: z.ZodLiteral<"active">;
82
+ activeFlags: z.ZodArray<z.ZodString>;
83
+ }, z.core.$loose>, z.ZodCustom<{
84
+ readonly type: string;
85
+ } & {
86
+ readonly activeFlags?: never;
87
+ }, {
88
+ readonly type: string;
89
+ } & {
90
+ readonly activeFlags?: never;
91
+ }>]>;
92
+ /** Runtime thread status inferred from {@link CodexThreadStatusSchema}. */
93
+ export type CodexThreadStatus = z.infer<typeof CodexThreadStatusSchema>;
94
+ /** Zod schema for Codex turn lifecycle status (`completed`, `interrupted`, `failed`, `inProgress`). */
95
+ export declare const CodexTurnStatusSchema: z.ZodEnum<{
96
+ completed: "completed";
97
+ failed: "failed";
98
+ inProgress: "inProgress";
99
+ interrupted: "interrupted";
100
+ }>;
101
+ /** Turn lifecycle status inferred from {@link CodexTurnStatusSchema}. */
102
+ export type CodexTurnStatus = z.infer<typeof CodexTurnStatusSchema>;
103
+ /** Open-variant Zod schema for Codex `TurnItemsView` (`notLoaded`, `summary`, `full`, or future views). */
104
+ export declare const CodexTurnItemsViewSchema: z.ZodUnion<readonly [z.ZodEnum<{
105
+ full: "full";
106
+ notLoaded: "notLoaded";
107
+ summary: "summary";
108
+ }>, z.ZodCustom<string & Record<never, never>, string & Record<never, never>>]>;
109
+ /** Turn items hydration level inferred from {@link CodexTurnItemsViewSchema}. */
110
+ export type CodexTurnItemsView = z.infer<typeof CodexTurnItemsViewSchema>;
111
+ /** Known `ThreadSourceKind` filter values accepted by Codex `thread/list` (`0.171.0`). */
112
+ export declare const CODEX_THREAD_SOURCE_KINDS: readonly ['cli', 'vscode', 'exec', 'appServer', 'subAgent', 'subAgentReview', 'subAgentCompact', 'subAgentThreadSpawn', 'subAgentOther', 'unknown'];
113
+ /** Zod schema for Codex `ThreadSourceKind` filter values accepted by `thread/list`. */
114
+ export declare const CodexThreadSourceKindSchema: z.ZodEnum<{
115
+ appServer: "appServer";
116
+ cli: "cli";
117
+ exec: "exec";
118
+ subAgent: "subAgent";
119
+ subAgentCompact: "subAgentCompact";
120
+ subAgentOther: "subAgentOther";
121
+ subAgentReview: "subAgentReview";
122
+ subAgentThreadSpawn: "subAgentThreadSpawn";
123
+ unknown: "unknown";
124
+ vscode: "vscode";
125
+ }>;
126
+ /** Thread source kind filter accepted by Codex `thread/list`. */
127
+ export type CodexThreadSourceKind = z.infer<typeof CodexThreadSourceKindSchema>;
14
128
  /** Collaboration mode settings passed on `turn/start`. */
15
129
  export declare const CodexCollaborationModeSchema: z.ZodObject<{
16
130
  mode: z.ZodEnum<{
@@ -25,11 +139,14 @@ export declare const CodexCollaborationModeSchema: z.ZodObject<{
25
139
  }, z.core.$strict>;
26
140
  /** Collaboration mode override accepted by Codex `turn/start`. */
27
141
  export type CodexCollaborationMode = z.infer<typeof CodexCollaborationModeSchema>;
142
+ /** Loose Zod schema for a Codex `ThreadItem` emitted in notifications and `thread/items/list`. */
28
143
  export declare const CodexThreadItemSchema: z.ZodObject<{
29
144
  type: z.ZodString;
30
145
  id: z.ZodString;
31
146
  }, z.core.$loose>;
147
+ /** Thread item inferred from {@link CodexThreadItemSchema}. */
32
148
  export type CodexThreadItem = z.infer<typeof CodexThreadItemSchema>;
149
+ /** Loose Zod schema for a Codex `Turn` returned by turn lifecycle notifications. */
33
150
  export declare const CodexTurnSchema: z.ZodObject<{
34
151
  id: z.ZodString;
35
152
  status: z.ZodEnum<{
@@ -46,34 +163,237 @@ export declare const CodexTurnSchema: z.ZodObject<{
46
163
  type: z.ZodString;
47
164
  clientId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
48
165
  }, z.core.$loose>>>;
166
+ startedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
167
+ completedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
168
+ durationMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
169
+ rootTurnId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
49
170
  }, z.core.$loose>;
50
- export declare const CodexNotificationParams: {
51
- readonly 'item/agentMessage/delta': z.ZodObject<{
52
- itemId: z.ZodString;
53
- delta: z.ZodString;
54
- }, z.core.$loose>;
55
- readonly 'item/reasoning/textDelta': z.ZodObject<{
56
- itemId: z.ZodString;
57
- delta: z.ZodString;
58
- }, z.core.$loose>;
59
- readonly 'item/reasoning/summaryTextDelta': z.ZodObject<{
60
- itemId: z.ZodString;
61
- delta: z.ZodString;
62
- }, z.core.$loose>;
63
- readonly 'item/started': z.ZodObject<{
64
- item: z.ZodObject<{
171
+ /** Loose Zod schema for one item entry embedded inside a {@link CodexListedTurn}. */
172
+ export declare const CodexListedTurnItemSchema: z.ZodObject<{
173
+ type: z.ZodString;
174
+ clientId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
175
+ }, z.core.$loose>;
176
+ /** Loose Zod schema for a turn returned by `thread/turns/list` or embedded in `Thread.turns`. */
177
+ export declare const CodexListedTurnSchema: z.ZodObject<{
178
+ id: z.ZodString;
179
+ status: z.ZodEnum<{
180
+ completed: "completed";
181
+ failed: "failed";
182
+ inProgress: "inProgress";
183
+ interrupted: "interrupted";
184
+ }>;
185
+ error: z.ZodOptional<z.ZodNullable<z.ZodObject<{
186
+ message: z.ZodString;
187
+ codexErrorInfo: z.ZodOptional<z.ZodNullable<z.ZodJSONSchema>>;
188
+ }, z.core.$loose>>>;
189
+ startedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
190
+ completedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
191
+ durationMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
192
+ rootTurnId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
193
+ items: z.ZodArray<z.ZodObject<{
194
+ type: z.ZodString;
195
+ clientId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
196
+ }, z.core.$loose>>;
197
+ itemsView: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
198
+ full: "full";
199
+ notLoaded: "notLoaded";
200
+ summary: "summary";
201
+ }>, z.ZodCustom<string & Record<never, never>, string & Record<never, never>>]>>;
202
+ }, z.core.$loose>;
203
+ /** Listed turn inferred from {@link CodexListedTurnSchema}. */
204
+ export type CodexListedTurn = z.infer<typeof CodexListedTurnSchema>;
205
+ /** Loose Zod schema for a page returned by Codex `thread/turns/list`. */
206
+ export declare const CodexTurnsPageSchema: z.ZodObject<{
207
+ data: z.ZodArray<z.ZodObject<{
208
+ id: z.ZodString;
209
+ status: z.ZodEnum<{
210
+ completed: "completed";
211
+ failed: "failed";
212
+ inProgress: "inProgress";
213
+ interrupted: "interrupted";
214
+ }>;
215
+ error: z.ZodOptional<z.ZodNullable<z.ZodObject<{
216
+ message: z.ZodString;
217
+ codexErrorInfo: z.ZodOptional<z.ZodNullable<z.ZodJSONSchema>>;
218
+ }, z.core.$loose>>>;
219
+ startedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
220
+ completedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
221
+ durationMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
222
+ rootTurnId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
223
+ items: z.ZodArray<z.ZodObject<{
65
224
  type: z.ZodString;
66
- id: z.ZodString;
67
- }, z.core.$loose>;
68
- }, z.core.$loose>;
69
- readonly 'item/completed': z.ZodObject<{
70
- item: z.ZodObject<{
225
+ clientId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
226
+ }, z.core.$loose>>;
227
+ itemsView: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
228
+ full: "full";
229
+ notLoaded: "notLoaded";
230
+ summary: "summary";
231
+ }>, z.ZodCustom<string & Record<never, never>, string & Record<never, never>>]>>;
232
+ }, z.core.$loose>>;
233
+ nextCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
234
+ backwardsCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
235
+ }, z.core.$loose>;
236
+ /** Paginated turns response inferred from {@link CodexTurnsPageSchema}. */
237
+ export type CodexTurnsPage = z.infer<typeof CodexTurnsPageSchema>;
238
+ /** Loose Zod schema for a Codex `Thread` returned across `thread/*` RPCs. */
239
+ export declare const CodexThreadSchema: z.ZodObject<{
240
+ id: z.ZodString;
241
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
242
+ preview: z.ZodOptional<z.ZodString>;
243
+ cwd: z.ZodOptional<z.ZodString>;
244
+ model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
245
+ modelProvider: z.ZodOptional<z.ZodString>;
246
+ reasoningEffort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
247
+ status: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
248
+ type: z.ZodLiteral<"notLoaded">;
249
+ }, z.core.$loose>, z.ZodObject<{
250
+ type: z.ZodLiteral<"idle">;
251
+ }, z.core.$loose>, z.ZodObject<{
252
+ type: z.ZodLiteral<"systemError">;
253
+ }, z.core.$loose>, z.ZodObject<{
254
+ type: z.ZodLiteral<"active">;
255
+ activeFlags: z.ZodArray<z.ZodString>;
256
+ }, z.core.$loose>, z.ZodCustom<{
257
+ readonly type: string;
258
+ } & {
259
+ readonly activeFlags?: never;
260
+ }, {
261
+ readonly type: string;
262
+ } & {
263
+ readonly activeFlags?: never;
264
+ }>]>>;
265
+ canAcceptDirectInput: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
266
+ cliVersion: z.ZodOptional<z.ZodString>;
267
+ createdAt: z.ZodOptional<z.ZodNumber>;
268
+ updatedAt: z.ZodOptional<z.ZodNumber>;
269
+ recencyAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
270
+ ephemeral: z.ZodOptional<z.ZodBoolean>;
271
+ path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
272
+ source: z.ZodOptional<z.ZodJSONSchema>;
273
+ sessionId: z.ZodOptional<z.ZodString>;
274
+ projectId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
275
+ forkedFromId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
276
+ parentThreadId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
277
+ attachedToThreadId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
278
+ originator: z.ZodOptional<z.ZodNullable<z.ZodString>>;
279
+ agentNickname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
280
+ agentRole: z.ZodOptional<z.ZodNullable<z.ZodString>>;
281
+ gitInfo: z.ZodOptional<z.ZodNullable<z.ZodJSONSchema>>;
282
+ turns: z.ZodOptional<z.ZodArray<z.ZodObject<{
283
+ id: z.ZodString;
284
+ status: z.ZodEnum<{
285
+ completed: "completed";
286
+ failed: "failed";
287
+ inProgress: "inProgress";
288
+ interrupted: "interrupted";
289
+ }>;
290
+ error: z.ZodOptional<z.ZodNullable<z.ZodObject<{
291
+ message: z.ZodString;
292
+ codexErrorInfo: z.ZodOptional<z.ZodNullable<z.ZodJSONSchema>>;
293
+ }, z.core.$loose>>>;
294
+ startedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
295
+ completedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
296
+ durationMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
297
+ rootTurnId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
298
+ items: z.ZodArray<z.ZodObject<{
71
299
  type: z.ZodString;
72
- id: z.ZodString;
73
- }, z.core.$loose>;
74
- }, z.core.$loose>;
75
- readonly 'turn/completed': z.ZodObject<{
76
- turn: z.ZodObject<{
300
+ clientId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
301
+ }, z.core.$loose>>;
302
+ itemsView: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
303
+ full: "full";
304
+ notLoaded: "notLoaded";
305
+ summary: "summary";
306
+ }>, z.ZodCustom<string & Record<never, never>, string & Record<never, never>>]>>;
307
+ }, z.core.$loose>>>;
308
+ }, z.core.$loose>;
309
+ /** Codex thread metadata inferred from {@link CodexThreadSchema}. */
310
+ export type CodexThread = z.infer<typeof CodexThreadSchema>;
311
+ /** Applied thread policy and runtime context returned by `thread/start`, `thread/resume`, or `thread/fork`. */
312
+ export declare const CodexThreadContextSchema: z.ZodObject<{
313
+ model: z.ZodOptional<z.ZodString>;
314
+ modelProvider: z.ZodOptional<z.ZodString>;
315
+ reasoningEffort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
316
+ approvalPolicy: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
317
+ never: "never";
318
+ "on-failure": "on-failure";
319
+ "on-request": "on-request";
320
+ untrusted: "untrusted";
321
+ }>, z.ZodRecord<z.ZodString, z.ZodJSONSchema>]>>;
322
+ sandbox: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
323
+ type: z.ZodLiteral<"dangerFullAccess">;
324
+ }, z.core.$loose>, z.ZodObject<{
325
+ type: z.ZodLiteral<"readOnly">;
326
+ networkAccess: z.ZodOptional<z.ZodBoolean>;
327
+ }, z.core.$loose>, z.ZodObject<{
328
+ type: z.ZodLiteral<"externalSandbox">;
329
+ networkAccess: z.ZodOptional<z.ZodString>;
330
+ }, z.core.$loose>, z.ZodObject<{
331
+ type: z.ZodLiteral<"workspaceWrite">;
332
+ writableRoots: z.ZodOptional<z.ZodArray<z.ZodString>>;
333
+ networkAccess: z.ZodOptional<z.ZodBoolean>;
334
+ excludeTmpdirEnvVar: z.ZodOptional<z.ZodBoolean>;
335
+ excludeSlashTmp: z.ZodOptional<z.ZodBoolean>;
336
+ }, z.core.$loose>, z.ZodCustom<{
337
+ readonly type: string;
338
+ } & {
339
+ readonly writableRoots?: never;
340
+ readonly networkAccess?: never;
341
+ readonly excludeTmpdirEnvVar?: never;
342
+ readonly excludeSlashTmp?: never;
343
+ }, {
344
+ readonly type: string;
345
+ } & {
346
+ readonly writableRoots?: never;
347
+ readonly networkAccess?: never;
348
+ readonly excludeTmpdirEnvVar?: never;
349
+ readonly excludeSlashTmp?: never;
350
+ }>]>>;
351
+ cwd: z.ZodOptional<z.ZodString>;
352
+ runtimeWorkspaceRoots: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
353
+ thread: z.ZodOptional<z.ZodObject<{
354
+ id: z.ZodString;
355
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
356
+ preview: z.ZodOptional<z.ZodString>;
357
+ cwd: z.ZodOptional<z.ZodString>;
358
+ model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
359
+ modelProvider: z.ZodOptional<z.ZodString>;
360
+ reasoningEffort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
361
+ status: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
362
+ type: z.ZodLiteral<"notLoaded">;
363
+ }, z.core.$loose>, z.ZodObject<{
364
+ type: z.ZodLiteral<"idle">;
365
+ }, z.core.$loose>, z.ZodObject<{
366
+ type: z.ZodLiteral<"systemError">;
367
+ }, z.core.$loose>, z.ZodObject<{
368
+ type: z.ZodLiteral<"active">;
369
+ activeFlags: z.ZodArray<z.ZodString>;
370
+ }, z.core.$loose>, z.ZodCustom<{
371
+ readonly type: string;
372
+ } & {
373
+ readonly activeFlags?: never;
374
+ }, {
375
+ readonly type: string;
376
+ } & {
377
+ readonly activeFlags?: never;
378
+ }>]>>;
379
+ canAcceptDirectInput: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
380
+ cliVersion: z.ZodOptional<z.ZodString>;
381
+ createdAt: z.ZodOptional<z.ZodNumber>;
382
+ updatedAt: z.ZodOptional<z.ZodNumber>;
383
+ recencyAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
384
+ ephemeral: z.ZodOptional<z.ZodBoolean>;
385
+ path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
386
+ source: z.ZodOptional<z.ZodJSONSchema>;
387
+ sessionId: z.ZodOptional<z.ZodString>;
388
+ projectId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
389
+ forkedFromId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
390
+ parentThreadId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
391
+ attachedToThreadId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
392
+ originator: z.ZodOptional<z.ZodNullable<z.ZodString>>;
393
+ agentNickname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
394
+ agentRole: z.ZodOptional<z.ZodNullable<z.ZodString>>;
395
+ gitInfo: z.ZodOptional<z.ZodNullable<z.ZodJSONSchema>>;
396
+ turns: z.ZodOptional<z.ZodArray<z.ZodObject<{
77
397
  id: z.ZodString;
78
398
  status: z.ZodEnum<{
79
399
  completed: "completed";
@@ -85,42 +405,246 @@ export declare const CodexNotificationParams: {
85
405
  message: z.ZodString;
86
406
  codexErrorInfo: z.ZodOptional<z.ZodNullable<z.ZodJSONSchema>>;
87
407
  }, z.core.$loose>>>;
88
- items: z.ZodOptional<z.ZodArray<z.ZodObject<{
408
+ startedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
409
+ completedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
410
+ durationMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
411
+ rootTurnId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
412
+ items: z.ZodArray<z.ZodObject<{
89
413
  type: z.ZodString;
90
414
  clientId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
415
+ }, z.core.$loose>>;
416
+ itemsView: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
417
+ full: "full";
418
+ notLoaded: "notLoaded";
419
+ summary: "summary";
420
+ }>, z.ZodCustom<string & Record<never, never>, string & Record<never, never>>]>>;
421
+ }, z.core.$loose>>>;
422
+ }, z.core.$loose>>;
423
+ }, z.core.$strip>;
424
+ /** Applied policy and model context reported by Codex when opening, resuming, or forking a thread. */
425
+ export type CodexThreadContext = Readonly<z.infer<typeof CodexThreadContextSchema>>;
426
+ /** Loose Zod schema for Codex `initialize` response. */
427
+ export declare const CodexInitializeResponseSchema: z.ZodObject<{
428
+ userAgent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
429
+ }, z.core.$loose>;
430
+ /** Loose Zod schema for responses returned by `thread/start`, `thread/resume`, and `thread/fork`. */
431
+ export declare const CodexStartedThreadSchema: z.ZodObject<{
432
+ model: z.ZodOptional<z.ZodString>;
433
+ modelProvider: z.ZodOptional<z.ZodString>;
434
+ reasoningEffort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
435
+ approvalPolicy: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
436
+ never: "never";
437
+ "on-failure": "on-failure";
438
+ "on-request": "on-request";
439
+ untrusted: "untrusted";
440
+ }>, z.ZodRecord<z.ZodString, z.ZodJSONSchema>]>>;
441
+ sandbox: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
442
+ type: z.ZodLiteral<"dangerFullAccess">;
443
+ }, z.core.$loose>, z.ZodObject<{
444
+ type: z.ZodLiteral<"readOnly">;
445
+ networkAccess: z.ZodOptional<z.ZodBoolean>;
446
+ }, z.core.$loose>, z.ZodObject<{
447
+ type: z.ZodLiteral<"externalSandbox">;
448
+ networkAccess: z.ZodOptional<z.ZodString>;
449
+ }, z.core.$loose>, z.ZodObject<{
450
+ type: z.ZodLiteral<"workspaceWrite">;
451
+ writableRoots: z.ZodOptional<z.ZodArray<z.ZodString>>;
452
+ networkAccess: z.ZodOptional<z.ZodBoolean>;
453
+ excludeTmpdirEnvVar: z.ZodOptional<z.ZodBoolean>;
454
+ excludeSlashTmp: z.ZodOptional<z.ZodBoolean>;
455
+ }, z.core.$loose>, z.ZodCustom<{
456
+ readonly type: string;
457
+ } & {
458
+ readonly writableRoots?: never;
459
+ readonly networkAccess?: never;
460
+ readonly excludeTmpdirEnvVar?: never;
461
+ readonly excludeSlashTmp?: never;
462
+ }, {
463
+ readonly type: string;
464
+ } & {
465
+ readonly writableRoots?: never;
466
+ readonly networkAccess?: never;
467
+ readonly excludeTmpdirEnvVar?: never;
468
+ readonly excludeSlashTmp?: never;
469
+ }>]>>;
470
+ cwd: z.ZodOptional<z.ZodString>;
471
+ runtimeWorkspaceRoots: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
472
+ thread: z.ZodObject<{
473
+ id: z.ZodString;
474
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
475
+ preview: z.ZodOptional<z.ZodString>;
476
+ cwd: z.ZodOptional<z.ZodString>;
477
+ model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
478
+ modelProvider: z.ZodOptional<z.ZodString>;
479
+ reasoningEffort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
480
+ status: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
481
+ type: z.ZodLiteral<"notLoaded">;
482
+ }, z.core.$loose>, z.ZodObject<{
483
+ type: z.ZodLiteral<"idle">;
484
+ }, z.core.$loose>, z.ZodObject<{
485
+ type: z.ZodLiteral<"systemError">;
486
+ }, z.core.$loose>, z.ZodObject<{
487
+ type: z.ZodLiteral<"active">;
488
+ activeFlags: z.ZodArray<z.ZodString>;
489
+ }, z.core.$loose>, z.ZodCustom<{
490
+ readonly type: string;
491
+ } & {
492
+ readonly activeFlags?: never;
493
+ }, {
494
+ readonly type: string;
495
+ } & {
496
+ readonly activeFlags?: never;
497
+ }>]>>;
498
+ canAcceptDirectInput: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
499
+ cliVersion: z.ZodOptional<z.ZodString>;
500
+ createdAt: z.ZodOptional<z.ZodNumber>;
501
+ updatedAt: z.ZodOptional<z.ZodNumber>;
502
+ recencyAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
503
+ ephemeral: z.ZodOptional<z.ZodBoolean>;
504
+ path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
505
+ source: z.ZodOptional<z.ZodJSONSchema>;
506
+ sessionId: z.ZodOptional<z.ZodString>;
507
+ projectId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
508
+ forkedFromId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
509
+ parentThreadId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
510
+ attachedToThreadId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
511
+ originator: z.ZodOptional<z.ZodNullable<z.ZodString>>;
512
+ agentNickname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
513
+ agentRole: z.ZodOptional<z.ZodNullable<z.ZodString>>;
514
+ gitInfo: z.ZodOptional<z.ZodNullable<z.ZodJSONSchema>>;
515
+ turns: z.ZodOptional<z.ZodArray<z.ZodObject<{
516
+ id: z.ZodString;
517
+ status: z.ZodEnum<{
518
+ completed: "completed";
519
+ failed: "failed";
520
+ inProgress: "inProgress";
521
+ interrupted: "interrupted";
522
+ }>;
523
+ error: z.ZodOptional<z.ZodNullable<z.ZodObject<{
524
+ message: z.ZodString;
525
+ codexErrorInfo: z.ZodOptional<z.ZodNullable<z.ZodJSONSchema>>;
91
526
  }, z.core.$loose>>>;
92
- }, z.core.$loose>;
93
- }, z.core.$loose>;
94
- readonly 'thread/tokenUsage/updated': z.ZodObject<{
95
- tokenUsage: z.ZodObject<{
96
- last: z.ZodObject<{
97
- inputTokens: z.ZodInt;
98
- outputTokens: z.ZodInt;
99
- cachedInputTokens: z.ZodOptional<z.ZodInt>;
100
- cacheWriteInputTokens: z.ZodOptional<z.ZodInt>;
101
- reasoningOutputTokens: z.ZodOptional<z.ZodInt>;
102
- totalTokens: z.ZodOptional<z.ZodInt>;
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>;
527
+ startedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
528
+ completedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
529
+ durationMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
530
+ rootTurnId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
531
+ items: z.ZodArray<z.ZodObject<{
532
+ type: z.ZodString;
533
+ clientId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
111
534
  }, z.core.$loose>>;
112
- modelContextWindow: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
113
- }, z.core.$loose>;
535
+ itemsView: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
536
+ full: "full";
537
+ notLoaded: "notLoaded";
538
+ summary: "summary";
539
+ }>, z.ZodCustom<string & Record<never, never>, string & Record<never, never>>]>>;
540
+ }, z.core.$loose>>>;
114
541
  }, z.core.$loose>;
115
- readonly 'serverRequest/resolved': z.ZodObject<{
116
- requestId: z.ZodUnion<readonly [z.ZodString, z.ZodInt]>;
542
+ approvalsReviewer: z.ZodOptional<z.ZodString>;
543
+ collaborationMode: z.ZodOptional<z.ZodNullable<z.ZodObject<{
544
+ mode: z.ZodString;
545
+ settings: z.ZodOptional<z.ZodObject<{
546
+ model: z.ZodOptional<z.ZodString>;
547
+ reasoning_effort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
548
+ developer_instructions: z.ZodOptional<z.ZodNullable<z.ZodString>>;
549
+ }, z.core.$loose>>;
550
+ }, z.core.$loose>>>;
551
+ turnsBackwardsCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
552
+ itemsBackwardsCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
553
+ serviceTier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
554
+ disabledPluginIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
555
+ instructionSources: z.ZodOptional<z.ZodArray<z.ZodString>>;
556
+ }, z.core.$loose>;
557
+ /** Extract the normalized applied thread context from a parsed `thread/start`, `thread/resume`, or `thread/fork` reply. */
558
+ export declare function extractCodexThreadContext(parsed: z.infer<typeof CodexStartedThreadSchema>): CodexThreadContext;
559
+ /** Loose Zod schema for Codex `turn/start` response. */
560
+ export declare const CodexStartedTurnSchema: z.ZodObject<{
561
+ turn: z.ZodObject<{
562
+ id: z.ZodString;
117
563
  }, z.core.$loose>;
118
- readonly 'account/rateLimits/updated': z.ZodObject<{
119
- rateLimits: z.ZodJSONSchema;
120
- rateLimitsByLimitId: z.ZodOptional<z.ZodJSONSchema>;
564
+ }, z.core.$loose>;
565
+ /** Loose Zod schema for Codex `turn/steer` response. */
566
+ export declare const CodexTurnSteerResponseSchema: z.ZodObject<{
567
+ turnId: z.ZodString;
568
+ }, z.core.$loose>;
569
+ /** Loose Zod schema for Codex `thread/revert` response. */
570
+ export declare const CodexThreadRevertResponseSchema: z.ZodObject<{
571
+ thread: z.ZodObject<{
572
+ id: z.ZodString;
573
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
574
+ preview: z.ZodOptional<z.ZodString>;
575
+ cwd: z.ZodOptional<z.ZodString>;
576
+ model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
577
+ modelProvider: z.ZodOptional<z.ZodString>;
578
+ reasoningEffort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
579
+ status: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
580
+ type: z.ZodLiteral<"notLoaded">;
581
+ }, z.core.$loose>, z.ZodObject<{
582
+ type: z.ZodLiteral<"idle">;
583
+ }, z.core.$loose>, z.ZodObject<{
584
+ type: z.ZodLiteral<"systemError">;
585
+ }, z.core.$loose>, z.ZodObject<{
586
+ type: z.ZodLiteral<"active">;
587
+ activeFlags: z.ZodArray<z.ZodString>;
588
+ }, z.core.$loose>, z.ZodCustom<{
589
+ readonly type: string;
590
+ } & {
591
+ readonly activeFlags?: never;
592
+ }, {
593
+ readonly type: string;
594
+ } & {
595
+ readonly activeFlags?: never;
596
+ }>]>>;
597
+ canAcceptDirectInput: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
598
+ cliVersion: z.ZodOptional<z.ZodString>;
599
+ createdAt: z.ZodOptional<z.ZodNumber>;
600
+ updatedAt: z.ZodOptional<z.ZodNumber>;
601
+ recencyAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
602
+ ephemeral: z.ZodOptional<z.ZodBoolean>;
603
+ path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
604
+ source: z.ZodOptional<z.ZodJSONSchema>;
605
+ sessionId: z.ZodOptional<z.ZodString>;
606
+ projectId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
607
+ forkedFromId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
608
+ parentThreadId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
609
+ attachedToThreadId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
610
+ originator: z.ZodOptional<z.ZodNullable<z.ZodString>>;
611
+ agentNickname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
612
+ agentRole: z.ZodOptional<z.ZodNullable<z.ZodString>>;
613
+ gitInfo: z.ZodOptional<z.ZodNullable<z.ZodJSONSchema>>;
614
+ turns: z.ZodOptional<z.ZodArray<z.ZodObject<{
615
+ id: z.ZodString;
616
+ status: z.ZodEnum<{
617
+ completed: "completed";
618
+ failed: "failed";
619
+ inProgress: "inProgress";
620
+ interrupted: "interrupted";
621
+ }>;
622
+ error: z.ZodOptional<z.ZodNullable<z.ZodObject<{
623
+ message: z.ZodString;
624
+ codexErrorInfo: z.ZodOptional<z.ZodNullable<z.ZodJSONSchema>>;
625
+ }, z.core.$loose>>>;
626
+ startedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
627
+ completedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
628
+ durationMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
629
+ rootTurnId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
630
+ items: z.ZodArray<z.ZodObject<{
631
+ type: z.ZodString;
632
+ clientId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
633
+ }, z.core.$loose>>;
634
+ itemsView: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
635
+ full: "full";
636
+ notLoaded: "notLoaded";
637
+ summary: "summary";
638
+ }>, z.ZodCustom<string & Record<never, never>, string & Record<never, never>>]>>;
639
+ }, z.core.$loose>>>;
121
640
  }, z.core.$loose>;
122
- };
641
+ turnsBackwardsCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
642
+ itemsBackwardsCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
643
+ }, z.core.$loose>;
644
+ /** Loose Zod schema for `item/commandExecution/requestApproval` and `item/fileChange/requestApproval` params. */
123
645
  export declare const CodexApprovalParamsSchema: z.ZodObject<{
646
+ threadId: z.ZodOptional<z.ZodString>;
647
+ turnId: z.ZodOptional<z.ZodString>;
124
648
  itemId: z.ZodString;
125
649
  command: z.ZodOptional<z.ZodNullable<z.ZodString>>;
126
650
  cwd: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -128,13 +652,16 @@ export declare const CodexApprovalParamsSchema: z.ZodObject<{
128
652
  grantRoot: z.ZodOptional<z.ZodNullable<z.ZodString>>;
129
653
  kind: z.ZodOptional<z.ZodNullable<z.ZodString>>;
130
654
  approvalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
655
+ startedAtMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
131
656
  commandActions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodJSONSchema>>>;
132
657
  availableDecisions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodJSONSchema>>>;
133
658
  }, z.core.$loose>;
659
+ /** Loose Zod schema for one option inside a `item/tool/requestUserInput` question. */
134
660
  export declare const CodexUserInputOptionSchema: z.ZodObject<{
135
661
  label: z.ZodString;
136
662
  description: z.ZodString;
137
663
  }, z.core.$loose>;
664
+ /** Loose Zod schema for one question inside `item/tool/requestUserInput`. */
138
665
  export declare const CodexUserInputQuestionSchema: z.ZodObject<{
139
666
  id: z.ZodString;
140
667
  question: z.ZodString;
@@ -146,7 +673,10 @@ export declare const CodexUserInputQuestionSchema: z.ZodObject<{
146
673
  description: z.ZodString;
147
674
  }, z.core.$loose>>>>;
148
675
  }, z.core.$loose>;
676
+ /** Loose Zod schema for `item/tool/requestUserInput` server request params. */
149
677
  export declare const CodexUserInputParamsSchema: z.ZodObject<{
678
+ threadId: z.ZodOptional<z.ZodString>;
679
+ turnId: z.ZodOptional<z.ZodString>;
150
680
  itemId: z.ZodString;
151
681
  questions: z.ZodArray<z.ZodObject<{
152
682
  id: z.ZodString;
@@ -239,98 +769,6 @@ export declare const CodexMcpElicitationAnswerSchema: z.ZodObject<{
239
769
  content: z.ZodOptional<z.ZodJSONSchema>;
240
770
  _meta: z.ZodOptional<z.ZodJSONSchema>;
241
771
  }, z.core.$strict>;
242
- /** Applied thread policy and runtime context returned by `thread/start`, `thread/resume`, or `thread/fork`. */
243
- export declare const CodexThreadContextSchema: z.ZodObject<{
244
- model: z.ZodOptional<z.ZodString>;
245
- modelProvider: z.ZodOptional<z.ZodString>;
246
- reasoningEffort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
247
- approvalPolicy: z.ZodOptional<z.ZodJSONSchema>;
248
- sandbox: z.ZodOptional<z.ZodJSONSchema>;
249
- cwd: z.ZodOptional<z.ZodString>;
250
- runtimeWorkspaceRoots: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
251
- thread: z.ZodOptional<z.ZodJSONSchema>;
252
- }, z.core.$strip>;
253
- /** Applied policy and model context reported by Codex when opening, resuming, or forking a thread. */
254
- export type CodexThreadContext = Readonly<z.infer<typeof CodexThreadContextSchema>>;
255
- export declare const CodexInitializeResponseSchema: z.ZodObject<{
256
- userAgent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
257
- }, z.core.$loose>;
258
- export declare const CodexStartedThreadSchema: z.ZodObject<{
259
- model: z.ZodOptional<z.ZodString>;
260
- modelProvider: z.ZodOptional<z.ZodString>;
261
- reasoningEffort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
262
- approvalPolicy: z.ZodOptional<z.ZodJSONSchema>;
263
- sandbox: z.ZodOptional<z.ZodJSONSchema>;
264
- cwd: z.ZodOptional<z.ZodString>;
265
- runtimeWorkspaceRoots: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
266
- thread: z.ZodObject<{
267
- id: z.ZodString;
268
- }, z.core.$loose>;
269
- }, z.core.$loose>;
270
- /** Extract the normalized applied thread context from a parsed `thread/start`, `thread/resume`, or `thread/fork` reply. */
271
- export declare function extractCodexThreadContext(parsed: z.infer<typeof CodexStartedThreadSchema>): CodexThreadContext;
272
- export declare const CodexStartedTurnSchema: z.ZodObject<{
273
- turn: z.ZodObject<{
274
- id: z.ZodString;
275
- }, z.core.$loose>;
276
- }, z.core.$loose>;
277
- export declare const CodexTurnSteerResponseSchema: z.ZodObject<{
278
- turnId: z.ZodString;
279
- }, z.core.$loose>;
280
- export declare const CodexListedTurnItemSchema: z.ZodObject<{
281
- type: z.ZodString;
282
- clientId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
283
- }, z.core.$loose>;
284
- export declare const CodexListedTurnSchema: z.ZodObject<{
285
- id: z.ZodString;
286
- status: z.ZodEnum<{
287
- completed: "completed";
288
- failed: "failed";
289
- inProgress: "inProgress";
290
- interrupted: "interrupted";
291
- }>;
292
- error: z.ZodOptional<z.ZodNullable<z.ZodObject<{
293
- message: z.ZodString;
294
- codexErrorInfo: z.ZodOptional<z.ZodNullable<z.ZodJSONSchema>>;
295
- }, z.core.$loose>>>;
296
- items: z.ZodArray<z.ZodObject<{
297
- type: z.ZodString;
298
- clientId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
299
- }, z.core.$loose>>;
300
- itemsView: z.ZodOptional<z.ZodLiteral<"full">>;
301
- }, z.core.$loose>;
302
- export declare const CodexTurnsPageSchema: z.ZodObject<{
303
- data: z.ZodArray<z.ZodObject<{
304
- id: z.ZodString;
305
- status: z.ZodEnum<{
306
- completed: "completed";
307
- failed: "failed";
308
- inProgress: "inProgress";
309
- interrupted: "interrupted";
310
- }>;
311
- error: z.ZodOptional<z.ZodNullable<z.ZodObject<{
312
- message: z.ZodString;
313
- codexErrorInfo: z.ZodOptional<z.ZodNullable<z.ZodJSONSchema>>;
314
- }, z.core.$loose>>>;
315
- items: z.ZodArray<z.ZodObject<{
316
- type: z.ZodString;
317
- clientId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
318
- }, z.core.$loose>>;
319
- itemsView: z.ZodOptional<z.ZodLiteral<"full">>;
320
- }, z.core.$loose>>;
321
- nextCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
322
- }, z.core.$loose>;
323
- export declare const CodexThreadRevertResponseSchema: z.ZodObject<{
324
- thread: z.ZodObject<{
325
- id: z.ZodString;
326
- }, z.core.$loose>;
327
- turnsBackwardsCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
328
- itemsBackwardsCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
329
- }, z.core.$loose>;
330
- /** Notifications the driver asks the server not to send: noise for a turn. */
331
- export declare const CODEX_OPTED_OUT_NOTIFICATIONS: string[];
332
- /** Notifications a turn sees and that carry nothing for it. */
333
- export declare const CODEX_QUIET_NOTIFICATIONS: Set<string>;
334
772
  /** Server requests the driver answers; every other is refused `-32601`. */
335
773
  export declare const CODEX_APPROVAL_REQUESTS: Set<string>;
336
774
  export declare const CODEX_PERMISSIONS_APPROVAL_REQUEST = "item/permissions/requestApproval";