@zakstam/codex-local-component 0.2.1 → 0.3.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 (181) hide show
  1. package/README.md +23 -4
  2. package/dist/app-server/client.d.ts +40 -1
  3. package/dist/app-server/client.d.ts.map +1 -1
  4. package/dist/app-server/client.js +56 -3
  5. package/dist/app-server/client.js.map +1 -1
  6. package/dist/app-server/index.d.ts +1 -1
  7. package/dist/app-server/index.d.ts.map +1 -1
  8. package/dist/app-server/index.js +1 -1
  9. package/dist/app-server/index.js.map +1 -1
  10. package/dist/client/index.d.ts +4 -2
  11. package/dist/client/index.d.ts.map +1 -1
  12. package/dist/client/index.js +3 -1
  13. package/dist/client/index.js.map +1 -1
  14. package/dist/client/reasoning.d.ts +10 -0
  15. package/dist/client/reasoning.d.ts.map +1 -0
  16. package/dist/client/reasoning.js +4 -0
  17. package/dist/client/reasoning.js.map +1 -0
  18. package/dist/client/serverRequests.d.ts +14 -0
  19. package/dist/client/serverRequests.d.ts.map +1 -0
  20. package/dist/client/serverRequests.js +10 -0
  21. package/dist/client/serverRequests.js.map +1 -0
  22. package/dist/client/threads.d.ts +39 -3
  23. package/dist/client/threads.d.ts.map +1 -1
  24. package/dist/client/threads.js +18 -0
  25. package/dist/client/threads.js.map +1 -1
  26. package/dist/client/types.d.ts +23 -1
  27. package/dist/client/types.d.ts.map +1 -1
  28. package/dist/component/approvals.d.ts +1 -1
  29. package/dist/component/index.d.ts +2 -0
  30. package/dist/component/index.d.ts.map +1 -1
  31. package/dist/component/index.js +2 -0
  32. package/dist/component/index.js.map +1 -1
  33. package/dist/component/ingest/applyApprovals.d.ts +5 -0
  34. package/dist/component/ingest/applyApprovals.d.ts.map +1 -0
  35. package/dist/component/ingest/applyApprovals.js +59 -0
  36. package/dist/component/ingest/applyApprovals.js.map +1 -0
  37. package/dist/component/ingest/applyMessages.d.ts +4 -0
  38. package/dist/component/ingest/applyMessages.d.ts.map +1 -0
  39. package/dist/component/ingest/applyMessages.js +149 -0
  40. package/dist/component/ingest/applyMessages.js.map +1 -0
  41. package/dist/component/ingest/applyStreams.d.ts +7 -0
  42. package/dist/component/ingest/applyStreams.d.ts.map +1 -0
  43. package/dist/component/ingest/applyStreams.js +189 -0
  44. package/dist/component/ingest/applyStreams.js.map +1 -0
  45. package/dist/component/ingest/applyTurns.d.ts +6 -0
  46. package/dist/component/ingest/applyTurns.d.ts.map +1 -0
  47. package/dist/component/ingest/applyTurns.js +94 -0
  48. package/dist/component/ingest/applyTurns.js.map +1 -0
  49. package/dist/component/ingest/checkpoints.d.ts +12 -0
  50. package/dist/component/ingest/checkpoints.d.ts.map +1 -0
  51. package/dist/component/ingest/checkpoints.js +63 -0
  52. package/dist/component/ingest/checkpoints.js.map +1 -0
  53. package/dist/component/ingest/index.d.ts +10 -0
  54. package/dist/component/ingest/index.d.ts.map +1 -0
  55. package/dist/component/ingest/index.js +76 -0
  56. package/dist/component/ingest/index.js.map +1 -0
  57. package/dist/component/ingest/normalize.d.ts +5 -0
  58. package/dist/component/ingest/normalize.d.ts.map +1 -0
  59. package/dist/component/ingest/normalize.js +35 -0
  60. package/dist/component/ingest/normalize.js.map +1 -0
  61. package/dist/component/ingest/postIngest.d.ts +4 -0
  62. package/dist/component/ingest/postIngest.d.ts.map +1 -0
  63. package/dist/component/ingest/postIngest.js +31 -0
  64. package/dist/component/ingest/postIngest.js.map +1 -0
  65. package/dist/component/ingest/sessionGuard.d.ts +9 -0
  66. package/dist/component/ingest/sessionGuard.d.ts.map +1 -0
  67. package/dist/component/ingest/sessionGuard.js +102 -0
  68. package/dist/component/ingest/sessionGuard.js.map +1 -0
  69. package/dist/component/ingest/stateCache.d.ts +19 -0
  70. package/dist/component/ingest/stateCache.d.ts.map +1 -0
  71. package/dist/component/ingest/stateCache.js +121 -0
  72. package/dist/component/ingest/stateCache.js.map +1 -0
  73. package/dist/component/ingest/types.d.ts +129 -0
  74. package/dist/component/ingest/types.d.ts.map +1 -0
  75. package/dist/component/ingest/types.js +2 -0
  76. package/dist/component/ingest/types.js.map +1 -0
  77. package/dist/component/reasoning.d.ts +37 -0
  78. package/dist/component/reasoning.d.ts.map +1 -0
  79. package/dist/component/reasoning.js +48 -0
  80. package/dist/component/reasoning.js.map +1 -0
  81. package/dist/component/schema.d.ts +87 -11
  82. package/dist/component/schema.d.ts.map +1 -1
  83. package/dist/component/schema.js +47 -0
  84. package/dist/component/schema.js.map +1 -1
  85. package/dist/component/serverRequests.d.ts +53 -0
  86. package/dist/component/serverRequests.d.ts.map +1 -0
  87. package/dist/component/serverRequests.js +187 -0
  88. package/dist/component/serverRequests.js.map +1 -0
  89. package/dist/component/streamStats.d.ts +10 -0
  90. package/dist/component/streamStats.d.ts.map +1 -1
  91. package/dist/component/streamStats.js +34 -0
  92. package/dist/component/streamStats.js.map +1 -1
  93. package/dist/component/sync.d.ts +4 -67
  94. package/dist/component/sync.d.ts.map +1 -1
  95. package/dist/component/syncHelpers.d.ts +12 -35
  96. package/dist/component/syncHelpers.d.ts.map +1 -1
  97. package/dist/component/syncHelpers.js +11 -228
  98. package/dist/component/syncHelpers.js.map +1 -1
  99. package/dist/component/syncIngest.d.ts +2 -72
  100. package/dist/component/syncIngest.d.ts.map +1 -1
  101. package/dist/component/syncIngest.js +9 -726
  102. package/dist/component/syncIngest.js.map +1 -1
  103. package/dist/component/syncRuntime.d.ts +7 -1
  104. package/dist/component/syncRuntime.d.ts.map +1 -1
  105. package/dist/component/syncRuntime.js +8 -2
  106. package/dist/component/syncRuntime.js.map +1 -1
  107. package/dist/component/types.d.ts +5 -1
  108. package/dist/component/types.d.ts.map +1 -1
  109. package/dist/component/types.js +2 -0
  110. package/dist/component/types.js.map +1 -1
  111. package/dist/host/convex-entry.d.ts +3 -0
  112. package/dist/host/convex-entry.d.ts.map +1 -0
  113. package/dist/host/convex-entry.js +3 -0
  114. package/dist/host/convex-entry.js.map +1 -0
  115. package/dist/host/convex.d.ts +17 -0
  116. package/dist/host/convex.d.ts.map +1 -1
  117. package/dist/host/convex.js +9 -0
  118. package/dist/host/convex.js.map +1 -1
  119. package/dist/host/convexSlice.d.ts +504 -0
  120. package/dist/host/convexSlice.d.ts.map +1 -0
  121. package/dist/host/convexSlice.js +315 -0
  122. package/dist/host/convexSlice.js.map +1 -0
  123. package/dist/host/index.d.ts +3 -2
  124. package/dist/host/index.d.ts.map +1 -1
  125. package/dist/host/index.js +2 -1
  126. package/dist/host/index.js.map +1 -1
  127. package/dist/host/runtime.d.ts +100 -2
  128. package/dist/host/runtime.d.ts.map +1 -1
  129. package/dist/host/runtime.js +329 -33
  130. package/dist/host/runtime.js.map +1 -1
  131. package/dist/local-adapter/bridge.d.ts +3 -2
  132. package/dist/local-adapter/bridge.d.ts.map +1 -1
  133. package/dist/local-adapter/bridge.js.map +1 -1
  134. package/dist/mapping.d.ts +29 -0
  135. package/dist/mapping.d.ts.map +1 -1
  136. package/dist/mapping.js +136 -46
  137. package/dist/mapping.js.map +1 -1
  138. package/dist/protocol/classifier.d.ts +2 -12
  139. package/dist/protocol/classifier.d.ts.map +1 -1
  140. package/dist/protocol/classifier.js +1 -104
  141. package/dist/protocol/classifier.js.map +1 -1
  142. package/dist/protocol/events.d.ts +72 -0
  143. package/dist/protocol/events.d.ts.map +1 -0
  144. package/dist/protocol/events.js +533 -0
  145. package/dist/protocol/events.js.map +1 -0
  146. package/dist/protocol/generated.d.ts +16 -2
  147. package/dist/protocol/generated.d.ts.map +1 -1
  148. package/dist/protocol/index.d.ts +3 -0
  149. package/dist/protocol/index.d.ts.map +1 -1
  150. package/dist/protocol/index.js +3 -0
  151. package/dist/protocol/index.js.map +1 -1
  152. package/dist/protocol/outbound.d.ts +13 -0
  153. package/dist/protocol/outbound.d.ts.map +1 -0
  154. package/dist/protocol/outbound.js +2 -0
  155. package/dist/protocol/outbound.js.map +1 -0
  156. package/dist/protocol/parser.d.ts +3 -2
  157. package/dist/protocol/parser.d.ts.map +1 -1
  158. package/dist/protocol/parser.js +99 -3
  159. package/dist/protocol/parser.js.map +1 -1
  160. package/dist/protocol/schemas/CommandExecutionRequestApprovalResponse.json +72 -0
  161. package/dist/protocol/schemas/DynamicToolCallResponse.json +66 -0
  162. package/dist/protocol/schemas/FileChangeRequestApprovalResponse.json +47 -0
  163. package/dist/protocol/schemas/ToolRequestUserInputResponse.json +34 -0
  164. package/dist/react/index.d.ts +3 -1
  165. package/dist/react/index.d.ts.map +1 -1
  166. package/dist/react/index.js +2 -0
  167. package/dist/react/index.js.map +1 -1
  168. package/dist/react/types.d.ts +13 -1
  169. package/dist/react/types.d.ts.map +1 -1
  170. package/dist/react/useCodexReasoning.d.ts +7 -0
  171. package/dist/react/useCodexReasoning.d.ts.map +1 -0
  172. package/dist/react/useCodexReasoning.js +16 -0
  173. package/dist/react/useCodexReasoning.js.map +1 -0
  174. package/dist/react/useCodexStreamOverlay.d.ts.map +1 -1
  175. package/dist/react/useCodexStreamOverlay.js +68 -23
  176. package/dist/react/useCodexStreamOverlay.js.map +1 -1
  177. package/dist/react/useCodexStreamingReasoning.d.ts +12 -0
  178. package/dist/react/useCodexStreamingReasoning.d.ts.map +1 -0
  179. package/dist/react/useCodexStreamingReasoning.js +21 -0
  180. package/dist/react/useCodexStreamingReasoning.js.map +1 -0
  181. package/package.json +5 -1
@@ -1,4 +1,5 @@
1
- import type { ClientOutboundMessage, ServerInboundMessage } from "./generated.js";
1
+ import type { ServerInboundMessage } from "./generated.js";
2
+ import type { ClientOutboundWireMessage } from "./outbound.js";
2
3
  export declare class CodexProtocolParseError extends Error {
3
4
  readonly rawLine: string;
4
5
  constructor(message: string, rawLine: string);
@@ -7,5 +8,5 @@ export declare class CodexProtocolSendError extends Error {
7
8
  constructor(message: string);
8
9
  }
9
10
  export declare function parseWireMessage(line: string): ServerInboundMessage;
10
- export declare function assertValidClientMessage(message: unknown): asserts message is ClientOutboundMessage;
11
+ export declare function assertValidClientMessage(message: unknown): asserts message is ClientOutboundWireMessage;
11
12
  //# sourceMappingURL=parser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/protocol/parser.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,qBAAqB,EAErB,oBAAoB,EACrB,MAAM,gBAAgB,CAAC;AAqCxB,qBAAa,uBAAwB,SAAQ,KAAK;aACH,OAAO,EAAE,MAAM;gBAAhD,OAAO,EAAE,MAAM,EAAkB,OAAO,EAAE,MAAM;CAI7D;AAED,qBAAa,sBAAuB,SAAQ,KAAK;gBACnC,OAAO,EAAE,MAAM;CAI5B;AAiBD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,oBAAoB,CAyBnE;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,qBAAqB,CASnG"}
1
+ {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/protocol/parser.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAEV,oBAAoB,EACrB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAyC/D,qBAAa,uBAAwB,SAAQ,KAAK;aACH,OAAO,EAAE,MAAM;gBAAhD,OAAO,EAAE,MAAM,EAAkB,OAAO,EAAE,MAAM;CAI7D;AAED,qBAAa,sBAAuB,SAAQ,KAAK;gBACnC,OAAO,EAAE,MAAM;CAI5B;AA8CD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,oBAAoB,CAyBnE;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,yBAAyB,CAmBvG"}
@@ -4,8 +4,12 @@ import clientRequestSchema from "./schemas/ClientRequest.json" with { type: "jso
4
4
  import eventMsgSchema from "./schemas/EventMsg.json" with { type: "json" };
5
5
  import jsonRpcMessageSchema from "./schemas/JSONRPCMessage.json" with { type: "json" };
6
6
  import jsonRpcResponseSchema from "./schemas/JSONRPCResponse.json" with { type: "json" };
7
+ import commandExecutionRequestApprovalResponseSchema from "./schemas/CommandExecutionRequestApprovalResponse.json" with { type: "json" };
8
+ import dynamicToolCallResponseSchema from "./schemas/DynamicToolCallResponse.json" with { type: "json" };
9
+ import fileChangeRequestApprovalResponseSchema from "./schemas/FileChangeRequestApprovalResponse.json" with { type: "json" };
7
10
  import serverNotificationSchema from "./schemas/ServerNotification.json" with { type: "json" };
8
11
  import serverRequestSchema from "./schemas/ServerRequest.json" with { type: "json" };
12
+ import toolRequestUserInputResponseSchema from "./schemas/ToolRequestUserInputResponse.json" with { type: "json" };
9
13
  const ajv = new Ajv({ allErrors: true, strict: false });
10
14
  ajv.addFormat("int64", true);
11
15
  ajv.addFormat("int32", true);
@@ -21,6 +25,10 @@ const validateServerRequest = ajv.compile(serverRequestSchema);
21
25
  const validateJsonRpcResponse = ajv.compile(jsonRpcResponseSchema);
22
26
  const validateClientRequest = ajv.compile(clientRequestSchema);
23
27
  const validateClientNotification = ajv.compile(clientNotificationSchema);
28
+ const validateCommandExecutionRequestApprovalResponse = ajv.compile(commandExecutionRequestApprovalResponseSchema);
29
+ const validateDynamicToolCallResponse = ajv.compile(dynamicToolCallResponseSchema);
30
+ const validateFileChangeRequestApprovalResponse = ajv.compile(fileChangeRequestApprovalResponseSchema);
31
+ const validateToolRequestUserInputResponse = ajv.compile(toolRequestUserInputResponseSchema);
24
32
  const validateEventMsg = ajv.compile(eventMsgSchema);
25
33
  function formatAjvErrors(errors) {
26
34
  if (!errors || errors.length === 0) {
@@ -51,10 +59,34 @@ function isServerInboundMessage(value) {
51
59
  return (validateServerNotification(value) ||
52
60
  validateServerRequest(value) ||
53
61
  validateJsonRpcResponse(value) ||
54
- isLegacyEventNotificationValue(value));
62
+ isLegacyEventNotificationValue(value) ||
63
+ isUnknownServerResponse(value) ||
64
+ isUnknownServerNotification(value) ||
65
+ isUnknownServerRequest(value));
66
+ }
67
+ function isClientServerRequestResponse(value) {
68
+ if (!validateJsonRpcResponse(value)) {
69
+ return false;
70
+ }
71
+ if (typeof value !== "object" || value === null) {
72
+ return false;
73
+ }
74
+ const record = value;
75
+ if (typeof record.id !== "number" && typeof record.id !== "string") {
76
+ return false;
77
+ }
78
+ if (!("result" in record)) {
79
+ return false;
80
+ }
81
+ return (validateCommandExecutionRequestApprovalResponse(record.result) ||
82
+ validateDynamicToolCallResponse(record.result) ||
83
+ validateFileChangeRequestApprovalResponse(record.result) ||
84
+ validateToolRequestUserInputResponse(record.result));
55
85
  }
56
86
  function isClientOutboundMessage(value) {
57
- return validateClientRequest(value) || validateClientNotification(value);
87
+ return (validateClientRequest(value) ||
88
+ validateClientNotification(value) ||
89
+ isClientServerRequestResponse(value));
58
90
  }
59
91
  // `unknown` is intentionally used only at the wire boundary.
60
92
  // All outbound values are validated against the generated JSON-RPC schema.
@@ -82,9 +114,73 @@ export function assertValidClientMessage(message) {
82
114
  }
83
115
  const details = formatAjvErrors(validateClientRequest.errors) +
84
116
  "; " +
85
- formatAjvErrors(validateClientNotification.errors);
117
+ formatAjvErrors(validateClientNotification.errors) +
118
+ "; " +
119
+ formatAjvErrors(validateJsonRpcResponse.errors) +
120
+ "; " +
121
+ formatAjvErrors(validateCommandExecutionRequestApprovalResponse.errors) +
122
+ "; " +
123
+ formatAjvErrors(validateDynamicToolCallResponse.errors) +
124
+ "; " +
125
+ formatAjvErrors(validateFileChangeRequestApprovalResponse.errors) +
126
+ "; " +
127
+ formatAjvErrors(validateToolRequestUserInputResponse.errors);
86
128
  throw new CodexProtocolSendError(`Invalid outbound codex client message: ${details}`);
87
129
  }
130
+ function isUnknownServerNotification(value) {
131
+ if (typeof value !== "object" || value === null) {
132
+ return false;
133
+ }
134
+ const record = value;
135
+ if (typeof record.method !== "string") {
136
+ return false;
137
+ }
138
+ if (record.method.startsWith("codex/event/")) {
139
+ return false;
140
+ }
141
+ if ("params" in record && (typeof record.params !== "object" || record.params === null)) {
142
+ return false;
143
+ }
144
+ if ("id" in record) {
145
+ return false;
146
+ }
147
+ return true;
148
+ }
149
+ function isUnknownServerRequest(value) {
150
+ if (typeof value !== "object" || value === null) {
151
+ return false;
152
+ }
153
+ const record = value;
154
+ if (typeof record.method !== "string") {
155
+ return false;
156
+ }
157
+ if (record.method.startsWith("codex/event/")) {
158
+ return false;
159
+ }
160
+ if ("params" in record && (typeof record.params !== "object" || record.params === null)) {
161
+ return false;
162
+ }
163
+ if (typeof record.id !== "string" && typeof record.id !== "number") {
164
+ return false;
165
+ }
166
+ return true;
167
+ }
168
+ function isUnknownServerResponse(value) {
169
+ if (typeof value !== "object" || value === null) {
170
+ return false;
171
+ }
172
+ const record = value;
173
+ if ("method" in record) {
174
+ return false;
175
+ }
176
+ if (typeof record.id !== "string" && typeof record.id !== "number" && record.id !== null) {
177
+ return false;
178
+ }
179
+ if (!("result" in record) && !("error" in record)) {
180
+ return false;
181
+ }
182
+ return true;
183
+ }
88
184
  function isLegacyEventNotificationValue(value) {
89
185
  if (typeof value !== "object" || value === null) {
90
186
  return false;
@@ -1 +1 @@
1
- {"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/protocol/parser.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,wBAAwB,MAAM,mCAAmC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAC/F,OAAO,mBAAmB,MAAM,8BAA8B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACrF,OAAO,cAAc,MAAM,yBAAyB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAC3E,OAAO,oBAAoB,MAAM,+BAA+B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACvF,OAAO,qBAAqB,MAAM,gCAAgC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACzF,OAAO,wBAAwB,MAAM,mCAAmC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAC/F,OAAO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M,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;QAChE,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,CAAC,MAAiC,CAAC;IACxD,IAAI,OAAO,MAAM,CAAC,cAAc,KAAK,QAAQ,EAAE,CAAC;QAC9C,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,gBAAgB,CAAC,MAAM,CAAC,GAAG,CAAY,CAAC;AACjD,CAAC"}
@@ -0,0 +1,72 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "CommandExecutionRequestApprovalResponse",
4
+ "type": "object",
5
+ "required": [
6
+ "decision"
7
+ ],
8
+ "properties": {
9
+ "decision": {
10
+ "$ref": "#/definitions/CommandExecutionApprovalDecision"
11
+ }
12
+ },
13
+ "definitions": {
14
+ "CommandExecutionApprovalDecision": {
15
+ "oneOf": [
16
+ {
17
+ "description": "User approved the command.",
18
+ "type": "string",
19
+ "enum": [
20
+ "accept"
21
+ ]
22
+ },
23
+ {
24
+ "description": "User approved the command and future identical commands should run without prompting.",
25
+ "type": "string",
26
+ "enum": [
27
+ "acceptForSession"
28
+ ]
29
+ },
30
+ {
31
+ "description": "User approved the command, and wants to apply the proposed execpolicy amendment so future matching commands can run without prompting.",
32
+ "type": "object",
33
+ "required": [
34
+ "acceptWithExecpolicyAmendment"
35
+ ],
36
+ "properties": {
37
+ "acceptWithExecpolicyAmendment": {
38
+ "type": "object",
39
+ "required": [
40
+ "execpolicy_amendment"
41
+ ],
42
+ "properties": {
43
+ "execpolicy_amendment": {
44
+ "type": "array",
45
+ "items": {
46
+ "type": "string"
47
+ }
48
+ }
49
+ }
50
+ }
51
+ },
52
+ "additionalProperties": false,
53
+ "title": "AcceptWithExecpolicyAmendmentCommandExecutionApprovalDecision"
54
+ },
55
+ {
56
+ "description": "User denied the command. The agent will continue the turn.",
57
+ "type": "string",
58
+ "enum": [
59
+ "decline"
60
+ ]
61
+ },
62
+ {
63
+ "description": "User denied the command. The turn will also be immediately interrupted.",
64
+ "type": "string",
65
+ "enum": [
66
+ "cancel"
67
+ ]
68
+ }
69
+ ]
70
+ }
71
+ }
72
+ }
@@ -0,0 +1,66 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "DynamicToolCallResponse",
4
+ "type": "object",
5
+ "required": [
6
+ "contentItems",
7
+ "success"
8
+ ],
9
+ "properties": {
10
+ "contentItems": {
11
+ "type": "array",
12
+ "items": {
13
+ "$ref": "#/definitions/DynamicToolCallOutputContentItem"
14
+ }
15
+ },
16
+ "success": {
17
+ "type": "boolean"
18
+ }
19
+ },
20
+ "definitions": {
21
+ "DynamicToolCallOutputContentItem": {
22
+ "oneOf": [
23
+ {
24
+ "type": "object",
25
+ "required": [
26
+ "text",
27
+ "type"
28
+ ],
29
+ "properties": {
30
+ "text": {
31
+ "type": "string"
32
+ },
33
+ "type": {
34
+ "type": "string",
35
+ "enum": [
36
+ "inputText"
37
+ ],
38
+ "title": "InputTextDynamicToolCallOutputContentItemType"
39
+ }
40
+ },
41
+ "title": "InputTextDynamicToolCallOutputContentItem"
42
+ },
43
+ {
44
+ "type": "object",
45
+ "required": [
46
+ "imageUrl",
47
+ "type"
48
+ ],
49
+ "properties": {
50
+ "imageUrl": {
51
+ "type": "string"
52
+ },
53
+ "type": {
54
+ "type": "string",
55
+ "enum": [
56
+ "inputImage"
57
+ ],
58
+ "title": "InputImageDynamicToolCallOutputContentItemType"
59
+ }
60
+ },
61
+ "title": "InputImageDynamicToolCallOutputContentItem"
62
+ }
63
+ ]
64
+ }
65
+ }
66
+ }
@@ -0,0 +1,47 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "FileChangeRequestApprovalResponse",
4
+ "type": "object",
5
+ "required": [
6
+ "decision"
7
+ ],
8
+ "properties": {
9
+ "decision": {
10
+ "$ref": "#/definitions/FileChangeApprovalDecision"
11
+ }
12
+ },
13
+ "definitions": {
14
+ "FileChangeApprovalDecision": {
15
+ "oneOf": [
16
+ {
17
+ "description": "User approved the file changes.",
18
+ "type": "string",
19
+ "enum": [
20
+ "accept"
21
+ ]
22
+ },
23
+ {
24
+ "description": "User approved the file changes and future changes to the same files should run without prompting.",
25
+ "type": "string",
26
+ "enum": [
27
+ "acceptForSession"
28
+ ]
29
+ },
30
+ {
31
+ "description": "User denied the file changes. The agent will continue the turn.",
32
+ "type": "string",
33
+ "enum": [
34
+ "decline"
35
+ ]
36
+ },
37
+ {
38
+ "description": "User denied the file changes. The turn will also be immediately interrupted.",
39
+ "type": "string",
40
+ "enum": [
41
+ "cancel"
42
+ ]
43
+ }
44
+ ]
45
+ }
46
+ }
47
+ }
@@ -0,0 +1,34 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "ToolRequestUserInputResponse",
4
+ "description": "EXPERIMENTAL. Response payload mapping question ids to answers.",
5
+ "type": "object",
6
+ "required": [
7
+ "answers"
8
+ ],
9
+ "properties": {
10
+ "answers": {
11
+ "type": "object",
12
+ "additionalProperties": {
13
+ "$ref": "#/definitions/ToolRequestUserInputAnswer"
14
+ }
15
+ }
16
+ },
17
+ "definitions": {
18
+ "ToolRequestUserInputAnswer": {
19
+ "description": "EXPERIMENTAL. Captures a user's answer to a request_user_input question.",
20
+ "type": "object",
21
+ "required": [
22
+ "answers"
23
+ ],
24
+ "properties": {
25
+ "answers": {
26
+ "type": "array",
27
+ "items": {
28
+ "type": "string"
29
+ }
30
+ }
31
+ }
32
+ }
33
+ }
34
+ }
@@ -1,5 +1,7 @@
1
1
  export { useCodexMessages, } from "./useCodexMessages.js";
2
+ export { useCodexReasoning, } from "./useCodexReasoning.js";
2
3
  export { useCodexStreamingMessages, } from "./useCodexStreamingMessages.js";
4
+ export { useCodexStreamingReasoning, } from "./useCodexStreamingReasoning.js";
3
5
  export { useCodexThreadState, type CodexThreadStateQuery, } from "./useCodexThreadState.js";
4
6
  export { useCodexTurn, type CodexTurnMessagesQuery, type CodexTurnStateQuery, } from "./useCodexTurn.js";
5
7
  export { useCodexApprovals, type CodexApprovalItem, type CodexApprovalRespondArgs, type CodexApprovalRespondMutation, type CodexApprovalsQuery, type CodexApprovalsQueryArgs, } from "./useCodexApprovals.js";
@@ -7,5 +9,5 @@ export { useCodexInterruptTurn, } from "./useCodexInterruptTurn.js";
7
9
  export { useCodexAutoResume, type CodexResumeStreamQuery, type CodexResumeStreamQueryArgs, } from "./useCodexAutoResume.js";
8
10
  export { useCodexComposer, type CodexComposerSendArgs, type CodexStartTurnMutation, } from "./useCodexComposer.js";
9
11
  export { optimisticallySendCodexMessage, } from "./optimisticallySendCodexMessage.js";
10
- export type { CodexMessagesQuery, CodexMessagesQueryArgs, CodexStreamArgs, CodexStreamsResult, } from "./types.js";
12
+ export type { CodexMessagesQuery, CodexMessagesQueryArgs, CodexReasoningQuery, CodexReasoningQueryArgs, CodexStreamArgs, CodexStreamsResult, } from "./types.js";
11
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,gBAAgB,GACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,yBAAyB,GAC1B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,mBAAmB,EACnB,KAAK,qBAAqB,GAC3B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,YAAY,EACZ,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,GACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,iBAAiB,EACjB,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,4BAA4B,EACjC,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,GAC7B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,qBAAqB,GACtB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,kBAAkB,EAClB,KAAK,sBAAsB,EAC3B,KA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EACnB,uBAAuB,EACvB,eAAe,EACf,kBAAkB,GACnB,MAAM,YAAY,CAAC"}
@@ -1,6 +1,8 @@
1
1
  "use client";
2
2
  export { useCodexMessages, } from "./useCodexMessages.js";
3
+ export { useCodexReasoning, } from "./useCodexReasoning.js";
3
4
  export { useCodexStreamingMessages, } from "./useCodexStreamingMessages.js";
5
+ export { useCodexStreamingReasoning, } from "./useCodexStreamingReasoning.js";
4
6
  export { useCodexThreadState, } from "./useCodexThreadState.js";
5
7
  export { useCodexTurn, } from "./useCodexTurn.js";
6
8
  export { useCodexApprovals, } from "./useCodexApprovals.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EACL,gBAAgB,GACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,yBAAyB,GAC1B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,mBAAmB,GAEpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,YAAY,GAGb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,iBAAiB,GAMlB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,qBAAqB,GACtB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,kBAAkB,GAGnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,gBAAgB,GAGjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,8BAA8B,GAC/B,MAAM,qCAAqC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EACL,gBAAgB,GACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,iBAAiB,GAClB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,yBAAyB,GAC1B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,0BAA0B,GAC3B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,mBAAmB,GAEpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,YAAY,GAGb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,iBAAiB,GAMlB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,qBAAqB,GACtB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,kBAAkB,GAGnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,gBAAgB,GAGjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,8BAA8B,GAC/B,MAAM,qCAAqC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import type { FunctionArgs, FunctionReference, PaginationOptions, PaginationResult } from "convex/server";
2
- import type { CodexDurableMessageLike, CodexStreamDeltaLike } from "../mapping.js";
2
+ import type { CodexDurableMessageLike, CodexReasoningSegmentLike, CodexStreamDeltaLike } from "../mapping.js";
3
3
  export type CodexStreamArgs = {
4
4
  kind: "list";
5
5
  startOrder?: number;
@@ -18,6 +18,10 @@ export type CodexStreamsResult = {
18
18
  }>;
19
19
  } | {
20
20
  kind: "deltas";
21
+ streams: Array<{
22
+ streamId: string;
23
+ state: string;
24
+ }>;
21
25
  deltas: CodexStreamDeltaLike[];
22
26
  streamWindows: Array<{
23
27
  streamId: string;
@@ -38,4 +42,12 @@ export type CodexMessagesQuery<Args = Record<string, unknown>> = FunctionReferen
38
42
  streams?: CodexStreamsResult;
39
43
  }>;
40
44
  export type CodexMessagesQueryArgs<Query extends CodexMessagesQuery<unknown>> = Query extends CodexMessagesQuery<unknown> ? Omit<FunctionArgs<Query>, "paginationOpts" | "streamArgs"> : never;
45
+ export type CodexReasoningQuery<Args = Record<string, unknown>> = FunctionReference<"query", "public", {
46
+ threadId: string;
47
+ paginationOpts: PaginationOptions;
48
+ includeRaw?: boolean;
49
+ } & Args, PaginationResult<CodexReasoningSegmentLike> & {
50
+ streams?: CodexStreamsResult;
51
+ }>;
52
+ export type CodexReasoningQueryArgs<Query extends CodexReasoningQuery<unknown>> = Query extends CodexReasoningQuery<unknown> ? Omit<FunctionArgs<Query>, "paginationOpts" | "streamArgs"> : never;
41
53
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/react/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAC1G,OAAO,KAAK,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAEnF,MAAM,MAAM,eAAe,GACvB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,GACrC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,OAAO,EAAE,KAAK,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC;AAE7E,MAAM,MAAM,kBAAkB,GAC1B;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,KAAK,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,GACrE;IACE,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,oBAAoB,EAAE,CAAC;IAC/B,aAAa,EAAE,KAAK,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE,IAAI,GAAG,SAAS,GAAG,OAAO,CAAC;QACnC,iBAAiB,EAAE,MAAM,CAAC;QAC1B,eAAe,EAAE,MAAM,CAAC;KACzB,CAAC,CAAC;IACH,eAAe,EAAE,KAAK,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC9D,CAAC;AAEN,MAAM,MA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B,CAAC;IAClC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,GAAG,IAAI,EACR,gBAAgB,CAAC,yBAAyB,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,kBAAkB,CAAA;CAAE,CAC/E,CAAC;AAEF,MAAM,MAAM,uBAAuB,CAAC,KAAK,SAAS,mBAAmB,CAAC,OAAO,CAAC,IAC5E,KAAK,SAAS,mBAAmB,CAAC,OAAO,CAAC,GACtC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,gBAAgB,GAAG,YAAY,CAAC,GAC1D,KAAK,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { type UsePaginatedQueryResult } from "convex/react";
2
+ import { type CodexReasoningSegmentLike } from "../mapping.js";
3
+ import type { CodexReasoningQuery, CodexReasoningQueryArgs } from "./types.js";
4
+ export declare function useCodexReasoning<Query extends CodexReasoningQuery<any>>(query: Query, args: CodexReasoningQueryArgs<Query> | "skip", options: {
5
+ initialNumItems: number;
6
+ }): UsePaginatedQueryResult<CodexReasoningSegmentLike>;
7
+ //# sourceMappingURL=useCodexReasoning.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCodexReasoning.d.ts","sourceRoot":"","sources":["../../src/react/useCodexReasoning.ts"],"names":[],"mappings":"AAEA,OAAO,EAA8C,KAAK,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAExG,OAAO,EAEL,KAAK,yBAAyB,EAC/B,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAE/E,wBAAgB,iBAAiB,CAAC,KAAK,SAAS,mBAAmB,CAAC,GAAG,CAAC,EACtE,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,uBAAuB,CAAC,KAAK,CAAC,GAAG,MAAM,EAC7C,OAAO,EAAE;IAAE,eAAe,EAAE,MAAM,CAAA;CAAE,GACnC,uBAAuB,CAAC,yBAAyB,CAAC,CAepD"}
@@ -0,0 +1,16 @@
1
+ "use client";
2
+ import { usePaginatedQuery } from "convex/react";
3
+ import { useMemo } from "react";
4
+ import { aggregateCodexReasoningSegments, } from "../mapping.js";
5
+ export function useCodexReasoning(query, args, options) {
6
+ const paginated = usePaginatedQuery(query, args, {
7
+ initialNumItems: options.initialNumItems,
8
+ });
9
+ const includeRaw = args !== "skip" && !!args.includeRaw;
10
+ const mergedResults = useMemo(() => aggregateCodexReasoningSegments(paginated.results, { includeRaw }), [includeRaw, paginated.results]);
11
+ return {
12
+ ...paginated,
13
+ results: mergedResults,
14
+ };
15
+ }
16
+ //# sourceMappingURL=useCodexReasoning.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCodexReasoning.js","sourceRoot":"","sources":["../../src/react/useCodexReasoning.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,iBAAiB,EAAyD,MAAM,cAAc,CAAC;AACxG,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EACL,+BAA+B,GAEhC,MAAM,eAAe,CAAC;AAGvB,MAAM,UAAU,iBAAiB,CAC/B,KAAY,EACZ,IAA6C,EAC7C,OAAoC;IAEpC,MAAM,SAAS,GAAG,iBAAiB,CAAC,KAAK,EAAE,IAA0C,EAAE;QACrF,eAAe,EAAE,OAAO,CAAC,eAAe;KACzC,CAAC,CAAC;IAEH,MAAM,UAAU,GAAG,IAAI,KAAK,MAAM,IAAI,CAAC,CAAE,IAAiC,CAAC,UAAU,CAAC;IACtF,MAAM,aAAa,GAAG,OAAO,CAC3B,GAAG,EAAE,CAAC,+BAA+B,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,CAAC,EACxE,CAAC,UAAU,EAAE,SAAS,CAAC,OAAO,CAAC,CAChC,CAAC;IAEF,OAAO;QACL,GAAG,SAAS;QACZ,OAAO,EAAE,aAAa;KACvB,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useCodexStreamOverlay.d.ts","sourceRoot":"","sources":["../../src/react/useCodexStreamOverlay.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAsB,MAAM,YAAY,CAAC;AAyFjG,wBAAgB,qBAAqB,CAAC,KAAK,SAAS,kBAAkB,CAAC,GAAG,CAAC,EACzE,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,sBAAsB,CAAC,KAAK,CAAC,GAAG,MAAM,EAC5C,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE;IAAE,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,GAChC;IACD,MAAM,EAAE,oBAAoB,EAAE,CAAC;IAC/B,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,CAmEA"}
1
+ {"version":3,"file":"useCodexStreamOverlay.d.ts","sourceRoot":"","sources":["../../src/react/useCodexStreamOverlay.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAsB,MAAM,YAAY,CAAC;AAmKjG,wBAAgB,qBAAqB,CAAC,KAAK,SAAS,kBAAkB,CAAC,GAAG,CAAC,EACzE,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,sBAAsB,CAAC,KAAK,CAAC,GAAG,MAAM,EAC5C,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE;IAAE,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,GAChC;IACD,MAAM,EAAE,oBAAoB,EAAE,CAAC;IAC/B,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM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