codecane 1.0.265 → 1.0.269

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 (386) hide show
  1. package/dist/actions.d.ts +2590 -0
  2. package/dist/actions.d.ts.map +1 -0
  3. package/dist/actions.js +143 -0
  4. package/dist/actions.js.map +1 -0
  5. package/dist/analytics.d.ts +5 -0
  6. package/dist/analytics.d.ts.map +1 -0
  7. package/dist/analytics.js +40 -0
  8. package/dist/analytics.js.map +1 -0
  9. package/dist/api-keys/constants.d.ts +9 -0
  10. package/dist/api-keys/constants.d.ts.map +1 -0
  11. package/dist/api-keys/constants.js +26 -0
  12. package/dist/api-keys/constants.js.map +1 -0
  13. package/dist/api-keys/crypto.d.ts +25 -0
  14. package/dist/api-keys/crypto.d.ts.map +1 -0
  15. package/dist/api-keys/crypto.js +186 -0
  16. package/dist/api-keys/crypto.js.map +1 -0
  17. package/dist/background-process-manager.d.ts +1 -0
  18. package/dist/background-process-manager.d.ts.map +1 -0
  19. package/dist/browser-actions.d.ts +4416 -0
  20. package/dist/browser-actions.d.ts.map +1 -0
  21. package/dist/browser-actions.js +343 -0
  22. package/dist/browser-actions.js.map +1 -0
  23. package/dist/browser-runner.d.ts +1 -0
  24. package/dist/browser-runner.d.ts.map +1 -0
  25. package/dist/chat-storage.d.ts +1 -0
  26. package/dist/chat-storage.d.ts.map +1 -0
  27. package/dist/checkpoints/checkpoint-manager.d.ts +1 -0
  28. package/dist/checkpoints/checkpoint-manager.d.ts.map +1 -0
  29. package/dist/checkpoints/file-manager.d.ts +1 -0
  30. package/dist/checkpoints/file-manager.d.ts.map +1 -0
  31. package/dist/cli-handlers/api-key.d.ts +1 -0
  32. package/dist/cli-handlers/api-key.d.ts.map +1 -0
  33. package/dist/cli-handlers/checkpoint.d.ts +1 -0
  34. package/dist/cli-handlers/checkpoint.d.ts.map +1 -0
  35. package/dist/cli-handlers/diff.d.ts +1 -0
  36. package/dist/cli-handlers/diff.d.ts.map +1 -0
  37. package/dist/cli-handlers/easter-egg.d.ts +1 -0
  38. package/dist/cli-handlers/easter-egg.d.ts.map +1 -0
  39. package/dist/cli-handlers/inititalization-flow.d.ts +1 -0
  40. package/dist/cli-handlers/inititalization-flow.d.ts.map +1 -0
  41. package/dist/cli.d.ts +1 -0
  42. package/dist/cli.d.ts.map +1 -0
  43. package/dist/client.d.ts +1 -0
  44. package/dist/client.d.ts.map +1 -0
  45. package/dist/code-map/tsconfig.tsbuildinfo +1 -1
  46. package/dist/common/actions.d.ts +1 -0
  47. package/dist/common/actions.d.ts.map +1 -0
  48. package/dist/common/analytics.d.ts +1 -0
  49. package/dist/common/analytics.d.ts.map +1 -0
  50. package/dist/common/api-keys/constants.d.ts +1 -0
  51. package/dist/common/api-keys/constants.d.ts.map +1 -0
  52. package/dist/common/api-keys/crypto.d.ts +1 -0
  53. package/dist/common/api-keys/crypto.d.ts.map +1 -0
  54. package/dist/common/browser-actions.d.ts +1 -0
  55. package/dist/common/browser-actions.d.ts.map +1 -0
  56. package/dist/common/constants/analytics-events.d.ts +1 -0
  57. package/dist/common/constants/analytics-events.d.ts.map +1 -0
  58. package/dist/common/constants/grant-priorities.d.ts +1 -0
  59. package/dist/common/constants/grant-priorities.d.ts.map +1 -0
  60. package/dist/common/constants/tools.d.ts +1 -0
  61. package/dist/common/constants/tools.d.ts.map +1 -0
  62. package/dist/common/constants.d.ts +1 -0
  63. package/dist/common/constants.d.ts.map +1 -0
  64. package/dist/common/db/drizzle.config.d.ts +1 -0
  65. package/dist/common/db/drizzle.config.d.ts.map +1 -0
  66. package/dist/common/db/env.d.mts +1 -0
  67. package/dist/common/db/env.d.mts.map +1 -0
  68. package/dist/common/db/index.d.ts +1 -0
  69. package/dist/common/db/index.d.ts.map +1 -0
  70. package/dist/common/db/schema.d.ts +1 -0
  71. package/dist/common/db/schema.d.ts.map +1 -0
  72. package/dist/common/db/transaction.d.ts +1 -0
  73. package/dist/common/db/transaction.d.ts.map +1 -0
  74. package/dist/common/env.d.mts +1 -0
  75. package/dist/common/env.d.mts.map +1 -0
  76. package/dist/common/json-config/__tests__/stringify-schema.test.d.ts +1 -0
  77. package/dist/common/json-config/__tests__/stringify-schema.test.d.ts.map +1 -0
  78. package/dist/common/json-config/constants.d.ts +1 -0
  79. package/dist/common/json-config/constants.d.ts.map +1 -0
  80. package/dist/common/json-config/parser.d.ts +1 -0
  81. package/dist/common/json-config/parser.d.ts.map +1 -0
  82. package/dist/common/json-config/stringify-schema.d.ts +1 -0
  83. package/dist/common/json-config/stringify-schema.d.ts.map +1 -0
  84. package/dist/common/project-file-tree.d.ts +1 -0
  85. package/dist/common/project-file-tree.d.ts.map +1 -0
  86. package/dist/common/types/agent-state.d.ts +1 -0
  87. package/dist/common/types/agent-state.d.ts.map +1 -0
  88. package/dist/common/types/grant.d.ts +1 -0
  89. package/dist/common/types/grant.d.ts.map +1 -0
  90. package/dist/common/types/message.d.ts +1 -0
  91. package/dist/common/types/message.d.ts.map +1 -0
  92. package/dist/common/types/referral.d.ts +1 -0
  93. package/dist/common/types/referral.d.ts.map +1 -0
  94. package/dist/common/types/tools.d.ts +1 -0
  95. package/dist/common/types/tools.d.ts.map +1 -0
  96. package/dist/common/types/usage.d.ts +1 -0
  97. package/dist/common/types/usage.d.ts.map +1 -0
  98. package/dist/common/util/__tests__/messages.test.d.ts +1 -0
  99. package/dist/common/util/__tests__/messages.test.d.ts.map +1 -0
  100. package/dist/common/util/__tests__/saxy.test.d.ts +1 -0
  101. package/dist/common/util/__tests__/saxy.test.d.ts.map +1 -0
  102. package/dist/common/util/__tests__/string.test.d.ts +1 -0
  103. package/dist/common/util/__tests__/string.test.d.ts.map +1 -0
  104. package/dist/common/util/array.d.ts +1 -0
  105. package/dist/common/util/array.d.ts.map +1 -0
  106. package/dist/common/util/changes.d.ts +1 -0
  107. package/dist/common/util/changes.d.ts.map +1 -0
  108. package/dist/common/util/credentials.d.ts +1 -0
  109. package/dist/common/util/credentials.d.ts.map +1 -0
  110. package/dist/common/util/currency.d.ts +1 -0
  111. package/dist/common/util/currency.d.ts.map +1 -0
  112. package/dist/common/util/dates.d.ts +1 -0
  113. package/dist/common/util/dates.d.ts.map +1 -0
  114. package/dist/common/util/file.d.ts +1 -0
  115. package/dist/common/util/file.d.ts.map +1 -0
  116. package/dist/common/util/git.d.ts +1 -0
  117. package/dist/common/util/git.d.ts.map +1 -0
  118. package/dist/common/util/logger.d.ts +1 -0
  119. package/dist/common/util/logger.d.ts.map +1 -0
  120. package/dist/common/util/lru-cache.d.ts +1 -0
  121. package/dist/common/util/lru-cache.d.ts.map +1 -0
  122. package/dist/common/util/messages.d.ts +1 -0
  123. package/dist/common/util/messages.d.ts.map +1 -0
  124. package/dist/common/util/min-heap.d.ts +1 -0
  125. package/dist/common/util/min-heap.d.ts.map +1 -0
  126. package/dist/common/util/object.d.ts +1 -0
  127. package/dist/common/util/object.d.ts.map +1 -0
  128. package/dist/common/util/patch.d.ts +1 -0
  129. package/dist/common/util/patch.d.ts.map +1 -0
  130. package/dist/common/util/promise.d.ts +1 -0
  131. package/dist/common/util/promise.d.ts.map +1 -0
  132. package/dist/common/util/referral.d.ts +1 -0
  133. package/dist/common/util/referral.d.ts.map +1 -0
  134. package/dist/common/util/saxy.d.ts +1 -0
  135. package/dist/common/util/saxy.d.ts.map +1 -0
  136. package/dist/common/util/string.d.ts +1 -0
  137. package/dist/common/util/string.d.ts.map +1 -0
  138. package/dist/common/util/stripe.d.ts +1 -0
  139. package/dist/common/util/stripe.d.ts.map +1 -0
  140. package/dist/common/util/sync-failure.d.ts +1 -0
  141. package/dist/common/util/sync-failure.d.ts.map +1 -0
  142. package/dist/common/websockets/websocket-client.d.ts +1 -0
  143. package/dist/common/websockets/websocket-client.d.ts.map +1 -0
  144. package/dist/common/websockets/websocket-schema.d.ts +1 -0
  145. package/dist/common/websockets/websocket-schema.d.ts.map +1 -0
  146. package/dist/config.d.ts +1 -0
  147. package/dist/config.d.ts.map +1 -0
  148. package/dist/constants/analytics-events.d.ts +20 -0
  149. package/dist/constants/analytics-events.d.ts.map +1 -0
  150. package/dist/constants/analytics-events.js +27 -0
  151. package/dist/constants/analytics-events.js.map +1 -0
  152. package/dist/constants/grant-priorities.d.ts +3 -0
  153. package/dist/constants/grant-priorities.d.ts.map +1 -0
  154. package/dist/constants/grant-priorities.js +10 -0
  155. package/dist/constants/grant-priorities.js.map +1 -0
  156. package/dist/constants/tools.d.ts +17 -0
  157. package/dist/constants/tools.d.ts.map +1 -0
  158. package/dist/constants/tools.js +44 -0
  159. package/dist/constants/tools.js.map +1 -0
  160. package/dist/constants.d.ts +135 -0
  161. package/dist/constants.d.ts.map +1 -0
  162. package/dist/constants.js +180 -0
  163. package/dist/constants.js.map +1 -0
  164. package/dist/create-template-project.d.ts +1 -0
  165. package/dist/create-template-project.d.ts.map +1 -0
  166. package/dist/credentials.d.ts +1 -0
  167. package/dist/credentials.d.ts.map +1 -0
  168. package/dist/db/drizzle.config.d.ts +3 -0
  169. package/dist/db/drizzle.config.d.ts.map +1 -0
  170. package/dist/db/drizzle.config.js +17 -0
  171. package/dist/db/drizzle.config.js.map +1 -0
  172. package/dist/db/env.d.mts +2 -0
  173. package/dist/db/env.d.mts.map +1 -0
  174. package/dist/db/env.mjs +26 -0
  175. package/dist/db/env.mjs.map +1 -0
  176. package/dist/db/index.d.ts +7 -0
  177. package/dist/db/index.d.ts.map +1 -0
  178. package/dist/db/index.js +35 -0
  179. package/dist/db/index.js.map +1 -0
  180. package/dist/db/schema.d.ts +1420 -0
  181. package/dist/db/schema.d.ts.map +1 -0
  182. package/dist/db/schema.js +175 -0
  183. package/dist/db/schema.js.map +1 -0
  184. package/dist/db/transaction.d.ts +13 -0
  185. package/dist/db/transaction.d.ts.map +1 -0
  186. package/dist/db/transaction.js +36 -0
  187. package/dist/db/transaction.js.map +1 -0
  188. package/dist/dev-process-manager.d.ts +1 -0
  189. package/dist/dev-process-manager.d.ts.map +1 -0
  190. package/dist/display.d.ts +1 -0
  191. package/dist/display.d.ts.map +1 -0
  192. package/dist/env.d.mts +2 -0
  193. package/dist/env.d.mts.map +1 -0
  194. package/dist/env.mjs +40 -0
  195. package/dist/env.mjs.map +1 -0
  196. package/dist/fingerprint.d.ts +1 -0
  197. package/dist/fingerprint.d.ts.map +1 -0
  198. package/dist/index.d.ts +1 -0
  199. package/dist/index.d.ts.map +1 -0
  200. package/dist/json-config/__tests__/stringify-schema.test.d.ts +2 -0
  201. package/dist/json-config/__tests__/stringify-schema.test.d.ts.map +1 -0
  202. package/dist/json-config/__tests__/stringify-schema.test.js +66 -0
  203. package/dist/json-config/__tests__/stringify-schema.test.js.map +1 -0
  204. package/dist/json-config/constants.d.ts +83 -0
  205. package/dist/json-config/constants.d.ts.map +1 -0
  206. package/dist/json-config/constants.js +48 -0
  207. package/dist/json-config/constants.js.map +1 -0
  208. package/dist/json-config/parser.d.ts +8 -0
  209. package/dist/json-config/parser.d.ts.map +1 -0
  210. package/dist/json-config/parser.js +51 -0
  211. package/dist/json-config/parser.js.map +1 -0
  212. package/dist/json-config/stringify-schema.d.ts +10 -0
  213. package/dist/json-config/stringify-schema.d.ts.map +1 -0
  214. package/dist/json-config/stringify-schema.js +131 -0
  215. package/dist/json-config/stringify-schema.js.map +1 -0
  216. package/dist/menu.d.ts +1 -0
  217. package/dist/menu.d.ts.map +1 -0
  218. package/dist/project-file-tree.d.ts +12 -0
  219. package/dist/project-file-tree.d.ts.map +1 -0
  220. package/dist/project-file-tree.js +200 -0
  221. package/dist/project-file-tree.js.map +1 -0
  222. package/dist/project-files.d.ts +1 -0
  223. package/dist/project-files.d.ts.map +1 -0
  224. package/dist/project-files.js +1 -1
  225. package/dist/startup-process-handler.d.ts +1 -0
  226. package/dist/startup-process-handler.d.ts.map +1 -0
  227. package/dist/tool-handlers.d.ts +1 -0
  228. package/dist/tool-handlers.d.ts.map +1 -0
  229. package/dist/types/agent-state.d.ts +465 -0
  230. package/dist/types/agent-state.d.ts.map +1 -0
  231. package/dist/types/agent-state.js +32 -0
  232. package/dist/types/agent-state.js.map +1 -0
  233. package/dist/types/grant.d.ts +3 -0
  234. package/dist/types/grant.d.ts.map +1 -0
  235. package/dist/types/grant.js +10 -0
  236. package/dist/types/grant.js.map +1 -0
  237. package/dist/types/message.d.ts +312 -0
  238. package/dist/types/message.d.ts.map +1 -0
  239. package/dist/types/message.js +54 -0
  240. package/dist/types/message.js.map +1 -0
  241. package/dist/types/referral.d.ts +3 -0
  242. package/dist/types/referral.d.ts.map +1 -0
  243. package/dist/types/referral.js +5 -0
  244. package/dist/types/referral.js.map +1 -0
  245. package/dist/types/tools.d.ts +6 -0
  246. package/dist/types/tools.d.ts.map +1 -0
  247. package/dist/types/tools.js +3 -0
  248. package/dist/types/tools.js.map +1 -0
  249. package/dist/types/usage.d.ts +41 -0
  250. package/dist/types/usage.d.ts.map +1 -0
  251. package/dist/types/usage.js +15 -0
  252. package/dist/types/usage.js.map +1 -0
  253. package/dist/types.d.ts +1 -0
  254. package/dist/types.d.ts.map +1 -0
  255. package/dist/update-codebuff.d.ts +1 -0
  256. package/dist/update-codebuff.d.ts.map +1 -0
  257. package/dist/util/__tests__/messages.test.d.ts +2 -0
  258. package/dist/util/__tests__/messages.test.d.ts.map +1 -0
  259. package/dist/util/__tests__/messages.test.js +70 -0
  260. package/dist/util/__tests__/messages.test.js.map +1 -0
  261. package/dist/util/__tests__/saxy.test.d.ts +2 -0
  262. package/dist/util/__tests__/saxy.test.d.ts.map +1 -0
  263. package/dist/util/__tests__/saxy.test.js +262 -0
  264. package/dist/util/__tests__/saxy.test.js.map +1 -0
  265. package/dist/util/__tests__/string.test.d.ts +2 -0
  266. package/dist/util/__tests__/string.test.d.ts.map +1 -0
  267. package/dist/util/__tests__/string.test.js +82 -0
  268. package/dist/util/__tests__/string.test.js.map +1 -0
  269. package/dist/util/array.d.ts +7 -0
  270. package/dist/util/array.d.ts.map +1 -0
  271. package/dist/util/array.js +32 -0
  272. package/dist/util/array.js.map +1 -0
  273. package/dist/util/changes.d.ts +8 -0
  274. package/dist/util/changes.d.ts.map +1 -0
  275. package/dist/util/changes.js +78 -0
  276. package/dist/util/changes.js.map +1 -0
  277. package/dist/util/credentials.d.ts +26 -0
  278. package/dist/util/credentials.d.ts.map +1 -0
  279. package/dist/util/credentials.js +24 -0
  280. package/dist/util/credentials.js.map +1 -0
  281. package/dist/util/currency.d.ts +15 -0
  282. package/dist/util/currency.d.ts.map +1 -0
  283. package/dist/util/currency.js +23 -0
  284. package/dist/util/currency.js.map +1 -0
  285. package/dist/util/dates.d.ts +11 -0
  286. package/dist/util/dates.d.ts.map +1 -0
  287. package/dist/util/dates.js +22 -0
  288. package/dist/util/dates.js.map +1 -0
  289. package/dist/util/file.d.ts +160 -0
  290. package/dist/util/file.d.ts.map +1 -0
  291. package/dist/util/file.js +192 -0
  292. package/dist/util/file.js.map +1 -0
  293. package/dist/util/git.d.ts +7 -0
  294. package/dist/util/git.d.ts.map +1 -0
  295. package/dist/util/git.js +81 -0
  296. package/dist/util/git.js.map +1 -0
  297. package/dist/util/logger.d.ts +9 -0
  298. package/dist/util/logger.d.ts.map +1 -0
  299. package/dist/util/logger.js +52 -0
  300. package/dist/util/logger.js.map +1 -0
  301. package/dist/util/lru-cache.d.ts +31 -0
  302. package/dist/util/lru-cache.d.ts.map +1 -0
  303. package/dist/util/lru-cache.js +68 -0
  304. package/dist/util/lru-cache.js.map +1 -0
  305. package/dist/util/messages.d.ts +10 -0
  306. package/dist/util/messages.d.ts.map +1 -0
  307. package/dist/util/messages.js +69 -0
  308. package/dist/util/messages.js.map +1 -0
  309. package/dist/util/min-heap.d.ts +16 -0
  310. package/dist/util/min-heap.d.ts.map +1 -0
  311. package/dist/util/min-heap.js +73 -0
  312. package/dist/util/min-heap.js.map +1 -0
  313. package/dist/util/object.d.ts +19 -0
  314. package/dist/util/object.d.ts.map +1 -0
  315. package/dist/util/object.js +91 -0
  316. package/dist/util/object.js.map +1 -0
  317. package/dist/util/patch.d.ts +2 -0
  318. package/dist/util/patch.d.ts.map +1 -0
  319. package/dist/util/patch.js +215 -0
  320. package/dist/util/patch.js.map +1 -0
  321. package/dist/util/promise.d.ts +18 -0
  322. package/dist/util/promise.d.ts.map +1 -0
  323. package/dist/util/promise.js +80 -0
  324. package/dist/util/promise.js.map +1 -0
  325. package/dist/util/referral.d.ts +2 -0
  326. package/dist/util/referral.d.ts.map +1 -0
  327. package/dist/util/referral.js +6 -0
  328. package/dist/util/referral.js.map +1 -0
  329. package/dist/util/saxy.d.ts +167 -0
  330. package/dist/util/saxy.d.ts.map +1 -0
  331. package/dist/util/saxy.js +473 -0
  332. package/dist/util/saxy.js.map +1 -0
  333. package/dist/util/string.d.ts +62 -0
  334. package/dist/util/string.d.ts.map +1 -0
  335. package/dist/util/string.js +220 -0
  336. package/dist/util/string.js.map +1 -0
  337. package/dist/util/stripe.d.ts +4 -0
  338. package/dist/util/stripe.d.ts.map +1 -0
  339. package/dist/util/stripe.js +22 -0
  340. package/dist/util/stripe.js.map +1 -0
  341. package/dist/util/sync-failure.d.ts +2 -0
  342. package/dist/util/sync-failure.d.ts.map +1 -0
  343. package/dist/util/sync-failure.js +57 -0
  344. package/dist/util/sync-failure.js.map +1 -0
  345. package/dist/utils/__tests__/background-process-manager.test.d.ts +1 -0
  346. package/dist/utils/__tests__/background-process-manager.test.d.ts.map +1 -0
  347. package/dist/utils/__tests__/tool-renderers.test.d.ts +1 -0
  348. package/dist/utils/__tests__/tool-renderers.test.d.ts.map +1 -0
  349. package/dist/utils/__tests__/xml-stream-parser.test.d.ts +1 -0
  350. package/dist/utils/__tests__/xml-stream-parser.test.d.ts.map +1 -0
  351. package/dist/utils/analytics.d.ts +1 -0
  352. package/dist/utils/analytics.d.ts.map +1 -0
  353. package/dist/utils/detect-shell.d.ts +1 -0
  354. package/dist/utils/detect-shell.d.ts.map +1 -0
  355. package/dist/utils/git.d.ts +1 -0
  356. package/dist/utils/git.d.ts.map +1 -0
  357. package/dist/utils/logger.d.ts +1 -0
  358. package/dist/utils/logger.d.ts.map +1 -0
  359. package/dist/utils/logger.js +1 -1
  360. package/dist/utils/spinner.d.ts +1 -0
  361. package/dist/utils/spinner.d.ts.map +1 -0
  362. package/dist/utils/system-info.d.ts +1 -0
  363. package/dist/utils/system-info.d.ts.map +1 -0
  364. package/dist/utils/terminal.d.ts +1 -0
  365. package/dist/utils/terminal.d.ts.map +1 -0
  366. package/dist/utils/terminal.js +6 -11
  367. package/dist/utils/terminal.js.map +1 -1
  368. package/dist/utils/tool-renderers.d.ts +1 -0
  369. package/dist/utils/tool-renderers.d.ts.map +1 -0
  370. package/dist/utils/xml-stream-parser.d.ts +1 -0
  371. package/dist/utils/xml-stream-parser.d.ts.map +1 -0
  372. package/dist/web-scraper.d.ts +1 -0
  373. package/dist/web-scraper.d.ts.map +1 -0
  374. package/dist/websockets/websocket-client.d.ts +43 -0
  375. package/dist/websockets/websocket-client.d.ts.map +1 -0
  376. package/dist/websockets/websocket-client.js +216 -0
  377. package/dist/websockets/websocket-client.js.map +1 -0
  378. package/dist/websockets/websocket-schema.d.ts +4867 -0
  379. package/dist/websockets/websocket-schema.d.ts.map +1 -0
  380. package/dist/websockets/websocket-schema.js +55 -0
  381. package/dist/websockets/websocket-schema.js.map +1 -0
  382. package/dist/workers/checkpoint-worker.d.ts +1 -0
  383. package/dist/workers/checkpoint-worker.d.ts.map +1 -0
  384. package/dist/workers/project-context.d.ts +1 -0
  385. package/dist/workers/project-context.d.ts.map +1 -0
  386. package/package.json +43 -19
@@ -0,0 +1,2590 @@
1
+ import { z } from 'zod';
2
+ export declare const FileChangeSchema: z.ZodObject<{
3
+ type: z.ZodEnum<["patch", "file"]>;
4
+ path: z.ZodString;
5
+ content: z.ZodString;
6
+ }, "strip", z.ZodTypeAny, {
7
+ path: string;
8
+ type: "file" | "patch";
9
+ content: string;
10
+ }, {
11
+ path: string;
12
+ type: "file" | "patch";
13
+ content: string;
14
+ }>;
15
+ export type FileChange = z.infer<typeof FileChangeSchema>;
16
+ export declare const CHANGES: z.ZodArray<z.ZodObject<{
17
+ type: z.ZodEnum<["patch", "file"]>;
18
+ path: z.ZodString;
19
+ content: z.ZodString;
20
+ }, "strip", z.ZodTypeAny, {
21
+ path: string;
22
+ type: "file" | "patch";
23
+ content: string;
24
+ }, {
25
+ path: string;
26
+ type: "file" | "patch";
27
+ content: string;
28
+ }>, "many">;
29
+ export type FileChanges = z.infer<typeof CHANGES>;
30
+ export declare const ToolCallSchema: z.ZodObject<{
31
+ name: z.ZodString;
32
+ id: z.ZodString;
33
+ input: z.ZodRecord<z.ZodString, z.ZodAny>;
34
+ }, "strip", z.ZodTypeAny, {
35
+ name: string;
36
+ id: string;
37
+ input: Record<string, any>;
38
+ }, {
39
+ name: string;
40
+ id: string;
41
+ input: Record<string, any>;
42
+ }>;
43
+ export type ToolCall = z.infer<typeof ToolCallSchema>;
44
+ export declare const CLIENT_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
45
+ type: z.ZodLiteral<"prompt">;
46
+ promptId: z.ZodString;
47
+ prompt: z.ZodUnion<[z.ZodString, z.ZodUndefined]>;
48
+ fingerprintId: z.ZodString;
49
+ authToken: z.ZodOptional<z.ZodString>;
50
+ costMode: z.ZodDefault<z.ZodOptional<z.ZodEnum<["lite", "normal", "max", "experimental"]>>>;
51
+ agentState: z.ZodObject<{
52
+ agentContext: z.ZodString;
53
+ fileContext: z.ZodObject<{
54
+ currentWorkingDirectory: z.ZodString;
55
+ fileTree: z.ZodArray<z.ZodType<import("./util/file").FileTreeNode, z.ZodTypeDef, import("./util/file").FileTreeNode>, "many">;
56
+ fileTokenScores: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodNumber>>;
57
+ knowledgeFiles: z.ZodRecord<z.ZodString, z.ZodString>;
58
+ userKnowledgeFiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
59
+ gitChanges: z.ZodObject<{
60
+ status: z.ZodString;
61
+ diff: z.ZodString;
62
+ diffCached: z.ZodString;
63
+ lastCommitMessages: z.ZodString;
64
+ }, "strip", z.ZodTypeAny, {
65
+ status: string;
66
+ diff: string;
67
+ diffCached: string;
68
+ lastCommitMessages: string;
69
+ }, {
70
+ status: string;
71
+ diff: string;
72
+ diffCached: string;
73
+ lastCommitMessages: string;
74
+ }>;
75
+ changesSinceLastChat: z.ZodRecord<z.ZodString, z.ZodString>;
76
+ shellConfigFiles: z.ZodRecord<z.ZodString, z.ZodString>;
77
+ systemInfo: z.ZodObject<{
78
+ platform: z.ZodString;
79
+ shell: z.ZodString;
80
+ nodeVersion: z.ZodString;
81
+ arch: z.ZodString;
82
+ homedir: z.ZodString;
83
+ cpus: z.ZodNumber;
84
+ }, "strip", z.ZodTypeAny, {
85
+ platform: string;
86
+ shell: string;
87
+ nodeVersion: string;
88
+ arch: string;
89
+ homedir: string;
90
+ cpus: number;
91
+ }, {
92
+ platform: string;
93
+ shell: string;
94
+ nodeVersion: string;
95
+ arch: string;
96
+ homedir: string;
97
+ cpus: number;
98
+ }>;
99
+ fileVersions: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodObject<{
100
+ path: z.ZodString;
101
+ content: z.ZodString;
102
+ }, "strip", z.ZodTypeAny, {
103
+ path: string;
104
+ content: string;
105
+ }, {
106
+ path: string;
107
+ content: string;
108
+ }>, "many">, "many">>;
109
+ }, "strip", z.ZodTypeAny, {
110
+ currentWorkingDirectory: string;
111
+ fileTree: import("./util/file").FileTreeNode[];
112
+ fileTokenScores: Record<string, Record<string, number>>;
113
+ knowledgeFiles: Record<string, string>;
114
+ gitChanges: {
115
+ status: string;
116
+ diff: string;
117
+ diffCached: string;
118
+ lastCommitMessages: string;
119
+ };
120
+ changesSinceLastChat: Record<string, string>;
121
+ shellConfigFiles: Record<string, string>;
122
+ systemInfo: {
123
+ platform: string;
124
+ shell: string;
125
+ nodeVersion: string;
126
+ arch: string;
127
+ homedir: string;
128
+ cpus: number;
129
+ };
130
+ userKnowledgeFiles?: Record<string, string> | undefined;
131
+ fileVersions?: {
132
+ path: string;
133
+ content: string;
134
+ }[][] | undefined;
135
+ }, {
136
+ currentWorkingDirectory: string;
137
+ fileTree: import("./util/file").FileTreeNode[];
138
+ fileTokenScores: Record<string, Record<string, number>>;
139
+ knowledgeFiles: Record<string, string>;
140
+ gitChanges: {
141
+ status: string;
142
+ diff: string;
143
+ diffCached: string;
144
+ lastCommitMessages: string;
145
+ };
146
+ changesSinceLastChat: Record<string, string>;
147
+ shellConfigFiles: Record<string, string>;
148
+ systemInfo: {
149
+ platform: string;
150
+ shell: string;
151
+ nodeVersion: string;
152
+ arch: string;
153
+ homedir: string;
154
+ cpus: number;
155
+ };
156
+ userKnowledgeFiles?: Record<string, string> | undefined;
157
+ fileVersions?: {
158
+ path: string;
159
+ content: string;
160
+ }[][] | undefined;
161
+ }>;
162
+ messageHistory: z.ZodArray<z.ZodObject<{
163
+ role: z.ZodUnion<[z.ZodLiteral<"user">, z.ZodLiteral<"assistant">]>;
164
+ content: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodObject<{
165
+ type: z.ZodLiteral<"text">;
166
+ text: z.ZodString;
167
+ cache_control: z.ZodOptional<z.ZodObject<{
168
+ type: z.ZodLiteral<"ephemeral">;
169
+ }, "strip", z.ZodTypeAny, {
170
+ type: "ephemeral";
171
+ }, {
172
+ type: "ephemeral";
173
+ }>>;
174
+ }, "strip", z.ZodTypeAny, {
175
+ type: "text";
176
+ text: string;
177
+ cache_control?: {
178
+ type: "ephemeral";
179
+ } | undefined;
180
+ }, {
181
+ type: "text";
182
+ text: string;
183
+ cache_control?: {
184
+ type: "ephemeral";
185
+ } | undefined;
186
+ }>, z.ZodObject<{
187
+ type: z.ZodLiteral<"tool_use">;
188
+ id: z.ZodString;
189
+ name: z.ZodString;
190
+ input: z.ZodRecord<z.ZodString, z.ZodAny>;
191
+ cache_control: z.ZodOptional<z.ZodObject<{
192
+ type: z.ZodLiteral<"ephemeral">;
193
+ }, "strip", z.ZodTypeAny, {
194
+ type: "ephemeral";
195
+ }, {
196
+ type: "ephemeral";
197
+ }>>;
198
+ }, "strip", z.ZodTypeAny, {
199
+ type: "tool_use";
200
+ name: string;
201
+ id: string;
202
+ input: Record<string, any>;
203
+ cache_control?: {
204
+ type: "ephemeral";
205
+ } | undefined;
206
+ }, {
207
+ type: "tool_use";
208
+ name: string;
209
+ id: string;
210
+ input: Record<string, any>;
211
+ cache_control?: {
212
+ type: "ephemeral";
213
+ } | undefined;
214
+ }>, z.ZodObject<{
215
+ type: z.ZodLiteral<"tool_result">;
216
+ tool_use_id: z.ZodString;
217
+ content: z.ZodString;
218
+ cache_control: z.ZodOptional<z.ZodObject<{
219
+ type: z.ZodLiteral<"ephemeral">;
220
+ }, "strip", z.ZodTypeAny, {
221
+ type: "ephemeral";
222
+ }, {
223
+ type: "ephemeral";
224
+ }>>;
225
+ }, "strip", z.ZodTypeAny, {
226
+ type: "tool_result";
227
+ content: string;
228
+ tool_use_id: string;
229
+ cache_control?: {
230
+ type: "ephemeral";
231
+ } | undefined;
232
+ }, {
233
+ type: "tool_result";
234
+ content: string;
235
+ tool_use_id: string;
236
+ cache_control?: {
237
+ type: "ephemeral";
238
+ } | undefined;
239
+ }>, z.ZodObject<{
240
+ type: z.ZodLiteral<"image">;
241
+ source: z.ZodObject<{
242
+ type: z.ZodLiteral<"base64">;
243
+ media_type: z.ZodLiteral<"image/jpeg">;
244
+ data: z.ZodString;
245
+ }, "strip", z.ZodTypeAny, {
246
+ type: "base64";
247
+ media_type: "image/jpeg";
248
+ data: string;
249
+ }, {
250
+ type: "base64";
251
+ media_type: "image/jpeg";
252
+ data: string;
253
+ }>;
254
+ cache_control: z.ZodOptional<z.ZodObject<{
255
+ type: z.ZodLiteral<"ephemeral">;
256
+ }, "strip", z.ZodTypeAny, {
257
+ type: "ephemeral";
258
+ }, {
259
+ type: "ephemeral";
260
+ }>>;
261
+ }, "strip", z.ZodTypeAny, {
262
+ type: "image";
263
+ source: {
264
+ type: "base64";
265
+ media_type: "image/jpeg";
266
+ data: string;
267
+ };
268
+ cache_control?: {
269
+ type: "ephemeral";
270
+ } | undefined;
271
+ }, {
272
+ type: "image";
273
+ source: {
274
+ type: "base64";
275
+ media_type: "image/jpeg";
276
+ data: string;
277
+ };
278
+ cache_control?: {
279
+ type: "ephemeral";
280
+ } | undefined;
281
+ }>]>, "many">]>;
282
+ }, "strip", z.ZodTypeAny, {
283
+ content: string | ({
284
+ type: "text";
285
+ text: string;
286
+ cache_control?: {
287
+ type: "ephemeral";
288
+ } | undefined;
289
+ } | {
290
+ type: "tool_use";
291
+ name: string;
292
+ id: string;
293
+ input: Record<string, any>;
294
+ cache_control?: {
295
+ type: "ephemeral";
296
+ } | undefined;
297
+ } | {
298
+ type: "tool_result";
299
+ content: string;
300
+ tool_use_id: string;
301
+ cache_control?: {
302
+ type: "ephemeral";
303
+ } | undefined;
304
+ } | {
305
+ type: "image";
306
+ source: {
307
+ type: "base64";
308
+ media_type: "image/jpeg";
309
+ data: string;
310
+ };
311
+ cache_control?: {
312
+ type: "ephemeral";
313
+ } | undefined;
314
+ })[];
315
+ role: "user" | "assistant";
316
+ }, {
317
+ content: string | ({
318
+ type: "text";
319
+ text: string;
320
+ cache_control?: {
321
+ type: "ephemeral";
322
+ } | undefined;
323
+ } | {
324
+ type: "tool_use";
325
+ name: string;
326
+ id: string;
327
+ input: Record<string, any>;
328
+ cache_control?: {
329
+ type: "ephemeral";
330
+ } | undefined;
331
+ } | {
332
+ type: "tool_result";
333
+ content: string;
334
+ tool_use_id: string;
335
+ cache_control?: {
336
+ type: "ephemeral";
337
+ } | undefined;
338
+ } | {
339
+ type: "image";
340
+ source: {
341
+ type: "base64";
342
+ media_type: "image/jpeg";
343
+ data: string;
344
+ };
345
+ cache_control?: {
346
+ type: "ephemeral";
347
+ } | undefined;
348
+ })[];
349
+ role: "user" | "assistant";
350
+ }>, "many">;
351
+ consecutiveAssistantMessages: z.ZodOptional<z.ZodNumber>;
352
+ }, "strip", z.ZodTypeAny, {
353
+ agentContext: string;
354
+ fileContext: {
355
+ currentWorkingDirectory: string;
356
+ fileTree: import("./util/file").FileTreeNode[];
357
+ fileTokenScores: Record<string, Record<string, number>>;
358
+ knowledgeFiles: Record<string, string>;
359
+ gitChanges: {
360
+ status: string;
361
+ diff: string;
362
+ diffCached: string;
363
+ lastCommitMessages: string;
364
+ };
365
+ changesSinceLastChat: Record<string, string>;
366
+ shellConfigFiles: Record<string, string>;
367
+ systemInfo: {
368
+ platform: string;
369
+ shell: string;
370
+ nodeVersion: string;
371
+ arch: string;
372
+ homedir: string;
373
+ cpus: number;
374
+ };
375
+ userKnowledgeFiles?: Record<string, string> | undefined;
376
+ fileVersions?: {
377
+ path: string;
378
+ content: string;
379
+ }[][] | undefined;
380
+ };
381
+ messageHistory: {
382
+ content: string | ({
383
+ type: "text";
384
+ text: string;
385
+ cache_control?: {
386
+ type: "ephemeral";
387
+ } | undefined;
388
+ } | {
389
+ type: "tool_use";
390
+ name: string;
391
+ id: string;
392
+ input: Record<string, any>;
393
+ cache_control?: {
394
+ type: "ephemeral";
395
+ } | undefined;
396
+ } | {
397
+ type: "tool_result";
398
+ content: string;
399
+ tool_use_id: string;
400
+ cache_control?: {
401
+ type: "ephemeral";
402
+ } | undefined;
403
+ } | {
404
+ type: "image";
405
+ source: {
406
+ type: "base64";
407
+ media_type: "image/jpeg";
408
+ data: string;
409
+ };
410
+ cache_control?: {
411
+ type: "ephemeral";
412
+ } | undefined;
413
+ })[];
414
+ role: "user" | "assistant";
415
+ }[];
416
+ consecutiveAssistantMessages?: number | undefined;
417
+ }, {
418
+ agentContext: string;
419
+ fileContext: {
420
+ currentWorkingDirectory: string;
421
+ fileTree: import("./util/file").FileTreeNode[];
422
+ fileTokenScores: Record<string, Record<string, number>>;
423
+ knowledgeFiles: Record<string, string>;
424
+ gitChanges: {
425
+ status: string;
426
+ diff: string;
427
+ diffCached: string;
428
+ lastCommitMessages: string;
429
+ };
430
+ changesSinceLastChat: Record<string, string>;
431
+ shellConfigFiles: Record<string, string>;
432
+ systemInfo: {
433
+ platform: string;
434
+ shell: string;
435
+ nodeVersion: string;
436
+ arch: string;
437
+ homedir: string;
438
+ cpus: number;
439
+ };
440
+ userKnowledgeFiles?: Record<string, string> | undefined;
441
+ fileVersions?: {
442
+ path: string;
443
+ content: string;
444
+ }[][] | undefined;
445
+ };
446
+ messageHistory: {
447
+ content: string | ({
448
+ type: "text";
449
+ text: string;
450
+ cache_control?: {
451
+ type: "ephemeral";
452
+ } | undefined;
453
+ } | {
454
+ type: "tool_use";
455
+ name: string;
456
+ id: string;
457
+ input: Record<string, any>;
458
+ cache_control?: {
459
+ type: "ephemeral";
460
+ } | undefined;
461
+ } | {
462
+ type: "tool_result";
463
+ content: string;
464
+ tool_use_id: string;
465
+ cache_control?: {
466
+ type: "ephemeral";
467
+ } | undefined;
468
+ } | {
469
+ type: "image";
470
+ source: {
471
+ type: "base64";
472
+ media_type: "image/jpeg";
473
+ data: string;
474
+ };
475
+ cache_control?: {
476
+ type: "ephemeral";
477
+ } | undefined;
478
+ })[];
479
+ role: "user" | "assistant";
480
+ }[];
481
+ consecutiveAssistantMessages?: number | undefined;
482
+ }>;
483
+ toolResults: z.ZodArray<z.ZodObject<{
484
+ name: z.ZodString;
485
+ result: z.ZodString;
486
+ id: z.ZodString;
487
+ }, "strip", z.ZodTypeAny, {
488
+ name: string;
489
+ id: string;
490
+ result: string;
491
+ }, {
492
+ name: string;
493
+ id: string;
494
+ result: string;
495
+ }>, "many">;
496
+ model: z.ZodOptional<z.ZodString>;
497
+ }, "strip", z.ZodTypeAny, {
498
+ type: "prompt";
499
+ promptId: string;
500
+ fingerprintId: string;
501
+ costMode: "lite" | "normal" | "max" | "experimental";
502
+ agentState: {
503
+ agentContext: string;
504
+ fileContext: {
505
+ currentWorkingDirectory: string;
506
+ fileTree: import("./util/file").FileTreeNode[];
507
+ fileTokenScores: Record<string, Record<string, number>>;
508
+ knowledgeFiles: Record<string, string>;
509
+ gitChanges: {
510
+ status: string;
511
+ diff: string;
512
+ diffCached: string;
513
+ lastCommitMessages: string;
514
+ };
515
+ changesSinceLastChat: Record<string, string>;
516
+ shellConfigFiles: Record<string, string>;
517
+ systemInfo: {
518
+ platform: string;
519
+ shell: string;
520
+ nodeVersion: string;
521
+ arch: string;
522
+ homedir: string;
523
+ cpus: number;
524
+ };
525
+ userKnowledgeFiles?: Record<string, string> | undefined;
526
+ fileVersions?: {
527
+ path: string;
528
+ content: string;
529
+ }[][] | undefined;
530
+ };
531
+ messageHistory: {
532
+ content: string | ({
533
+ type: "text";
534
+ text: string;
535
+ cache_control?: {
536
+ type: "ephemeral";
537
+ } | undefined;
538
+ } | {
539
+ type: "tool_use";
540
+ name: string;
541
+ id: string;
542
+ input: Record<string, any>;
543
+ cache_control?: {
544
+ type: "ephemeral";
545
+ } | undefined;
546
+ } | {
547
+ type: "tool_result";
548
+ content: string;
549
+ tool_use_id: string;
550
+ cache_control?: {
551
+ type: "ephemeral";
552
+ } | undefined;
553
+ } | {
554
+ type: "image";
555
+ source: {
556
+ type: "base64";
557
+ media_type: "image/jpeg";
558
+ data: string;
559
+ };
560
+ cache_control?: {
561
+ type: "ephemeral";
562
+ } | undefined;
563
+ })[];
564
+ role: "user" | "assistant";
565
+ }[];
566
+ consecutiveAssistantMessages?: number | undefined;
567
+ };
568
+ toolResults: {
569
+ name: string;
570
+ id: string;
571
+ result: string;
572
+ }[];
573
+ prompt?: string | undefined;
574
+ authToken?: string | undefined;
575
+ model?: string | undefined;
576
+ }, {
577
+ type: "prompt";
578
+ promptId: string;
579
+ fingerprintId: string;
580
+ agentState: {
581
+ agentContext: string;
582
+ fileContext: {
583
+ currentWorkingDirectory: string;
584
+ fileTree: import("./util/file").FileTreeNode[];
585
+ fileTokenScores: Record<string, Record<string, number>>;
586
+ knowledgeFiles: Record<string, string>;
587
+ gitChanges: {
588
+ status: string;
589
+ diff: string;
590
+ diffCached: string;
591
+ lastCommitMessages: string;
592
+ };
593
+ changesSinceLastChat: Record<string, string>;
594
+ shellConfigFiles: Record<string, string>;
595
+ systemInfo: {
596
+ platform: string;
597
+ shell: string;
598
+ nodeVersion: string;
599
+ arch: string;
600
+ homedir: string;
601
+ cpus: number;
602
+ };
603
+ userKnowledgeFiles?: Record<string, string> | undefined;
604
+ fileVersions?: {
605
+ path: string;
606
+ content: string;
607
+ }[][] | undefined;
608
+ };
609
+ messageHistory: {
610
+ content: string | ({
611
+ type: "text";
612
+ text: string;
613
+ cache_control?: {
614
+ type: "ephemeral";
615
+ } | undefined;
616
+ } | {
617
+ type: "tool_use";
618
+ name: string;
619
+ id: string;
620
+ input: Record<string, any>;
621
+ cache_control?: {
622
+ type: "ephemeral";
623
+ } | undefined;
624
+ } | {
625
+ type: "tool_result";
626
+ content: string;
627
+ tool_use_id: string;
628
+ cache_control?: {
629
+ type: "ephemeral";
630
+ } | undefined;
631
+ } | {
632
+ type: "image";
633
+ source: {
634
+ type: "base64";
635
+ media_type: "image/jpeg";
636
+ data: string;
637
+ };
638
+ cache_control?: {
639
+ type: "ephemeral";
640
+ } | undefined;
641
+ })[];
642
+ role: "user" | "assistant";
643
+ }[];
644
+ consecutiveAssistantMessages?: number | undefined;
645
+ };
646
+ toolResults: {
647
+ name: string;
648
+ id: string;
649
+ result: string;
650
+ }[];
651
+ prompt?: string | undefined;
652
+ authToken?: string | undefined;
653
+ costMode?: "lite" | "normal" | "max" | "experimental" | undefined;
654
+ model?: string | undefined;
655
+ }>, z.ZodObject<{
656
+ type: z.ZodLiteral<"read-files-response">;
657
+ files: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNull]>>;
658
+ requestId: z.ZodOptional<z.ZodString>;
659
+ }, "strip", z.ZodTypeAny, {
660
+ type: "read-files-response";
661
+ files: Record<string, string | null>;
662
+ requestId?: string | undefined;
663
+ }, {
664
+ type: "read-files-response";
665
+ files: Record<string, string | null>;
666
+ requestId?: string | undefined;
667
+ }>, z.ZodObject<{
668
+ type: z.ZodLiteral<"init">;
669
+ fingerprintId: z.ZodString;
670
+ authToken: z.ZodOptional<z.ZodString>;
671
+ fileContext: z.ZodObject<{
672
+ currentWorkingDirectory: z.ZodString;
673
+ fileTree: z.ZodArray<z.ZodType<import("./util/file").FileTreeNode, z.ZodTypeDef, import("./util/file").FileTreeNode>, "many">;
674
+ fileTokenScores: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodNumber>>;
675
+ knowledgeFiles: z.ZodRecord<z.ZodString, z.ZodString>;
676
+ userKnowledgeFiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
677
+ gitChanges: z.ZodObject<{
678
+ status: z.ZodString;
679
+ diff: z.ZodString;
680
+ diffCached: z.ZodString;
681
+ lastCommitMessages: z.ZodString;
682
+ }, "strip", z.ZodTypeAny, {
683
+ status: string;
684
+ diff: string;
685
+ diffCached: string;
686
+ lastCommitMessages: string;
687
+ }, {
688
+ status: string;
689
+ diff: string;
690
+ diffCached: string;
691
+ lastCommitMessages: string;
692
+ }>;
693
+ changesSinceLastChat: z.ZodRecord<z.ZodString, z.ZodString>;
694
+ shellConfigFiles: z.ZodRecord<z.ZodString, z.ZodString>;
695
+ systemInfo: z.ZodObject<{
696
+ platform: z.ZodString;
697
+ shell: z.ZodString;
698
+ nodeVersion: z.ZodString;
699
+ arch: z.ZodString;
700
+ homedir: z.ZodString;
701
+ cpus: z.ZodNumber;
702
+ }, "strip", z.ZodTypeAny, {
703
+ platform: string;
704
+ shell: string;
705
+ nodeVersion: string;
706
+ arch: string;
707
+ homedir: string;
708
+ cpus: number;
709
+ }, {
710
+ platform: string;
711
+ shell: string;
712
+ nodeVersion: string;
713
+ arch: string;
714
+ homedir: string;
715
+ cpus: number;
716
+ }>;
717
+ fileVersions: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodObject<{
718
+ path: z.ZodString;
719
+ content: z.ZodString;
720
+ }, "strip", z.ZodTypeAny, {
721
+ path: string;
722
+ content: string;
723
+ }, {
724
+ path: string;
725
+ content: string;
726
+ }>, "many">, "many">>;
727
+ }, "strip", z.ZodTypeAny, {
728
+ currentWorkingDirectory: string;
729
+ fileTree: import("./util/file").FileTreeNode[];
730
+ fileTokenScores: Record<string, Record<string, number>>;
731
+ knowledgeFiles: Record<string, string>;
732
+ gitChanges: {
733
+ status: string;
734
+ diff: string;
735
+ diffCached: string;
736
+ lastCommitMessages: string;
737
+ };
738
+ changesSinceLastChat: Record<string, string>;
739
+ shellConfigFiles: Record<string, string>;
740
+ systemInfo: {
741
+ platform: string;
742
+ shell: string;
743
+ nodeVersion: string;
744
+ arch: string;
745
+ homedir: string;
746
+ cpus: number;
747
+ };
748
+ userKnowledgeFiles?: Record<string, string> | undefined;
749
+ fileVersions?: {
750
+ path: string;
751
+ content: string;
752
+ }[][] | undefined;
753
+ }, {
754
+ currentWorkingDirectory: string;
755
+ fileTree: import("./util/file").FileTreeNode[];
756
+ fileTokenScores: Record<string, Record<string, number>>;
757
+ knowledgeFiles: Record<string, string>;
758
+ gitChanges: {
759
+ status: string;
760
+ diff: string;
761
+ diffCached: string;
762
+ lastCommitMessages: string;
763
+ };
764
+ changesSinceLastChat: Record<string, string>;
765
+ shellConfigFiles: Record<string, string>;
766
+ systemInfo: {
767
+ platform: string;
768
+ shell: string;
769
+ nodeVersion: string;
770
+ arch: string;
771
+ homedir: string;
772
+ cpus: number;
773
+ };
774
+ userKnowledgeFiles?: Record<string, string> | undefined;
775
+ fileVersions?: {
776
+ path: string;
777
+ content: string;
778
+ }[][] | undefined;
779
+ }>;
780
+ }, "strip", z.ZodTypeAny, {
781
+ type: "init";
782
+ fileContext: {
783
+ currentWorkingDirectory: string;
784
+ fileTree: import("./util/file").FileTreeNode[];
785
+ fileTokenScores: Record<string, Record<string, number>>;
786
+ knowledgeFiles: Record<string, string>;
787
+ gitChanges: {
788
+ status: string;
789
+ diff: string;
790
+ diffCached: string;
791
+ lastCommitMessages: string;
792
+ };
793
+ changesSinceLastChat: Record<string, string>;
794
+ shellConfigFiles: Record<string, string>;
795
+ systemInfo: {
796
+ platform: string;
797
+ shell: string;
798
+ nodeVersion: string;
799
+ arch: string;
800
+ homedir: string;
801
+ cpus: number;
802
+ };
803
+ userKnowledgeFiles?: Record<string, string> | undefined;
804
+ fileVersions?: {
805
+ path: string;
806
+ content: string;
807
+ }[][] | undefined;
808
+ };
809
+ fingerprintId: string;
810
+ authToken?: string | undefined;
811
+ }, {
812
+ type: "init";
813
+ fileContext: {
814
+ currentWorkingDirectory: string;
815
+ fileTree: import("./util/file").FileTreeNode[];
816
+ fileTokenScores: Record<string, Record<string, number>>;
817
+ knowledgeFiles: Record<string, string>;
818
+ gitChanges: {
819
+ status: string;
820
+ diff: string;
821
+ diffCached: string;
822
+ lastCommitMessages: string;
823
+ };
824
+ changesSinceLastChat: Record<string, string>;
825
+ shellConfigFiles: Record<string, string>;
826
+ systemInfo: {
827
+ platform: string;
828
+ shell: string;
829
+ nodeVersion: string;
830
+ arch: string;
831
+ homedir: string;
832
+ cpus: number;
833
+ };
834
+ userKnowledgeFiles?: Record<string, string> | undefined;
835
+ fileVersions?: {
836
+ path: string;
837
+ content: string;
838
+ }[][] | undefined;
839
+ };
840
+ fingerprintId: string;
841
+ authToken?: string | undefined;
842
+ }>, z.ZodObject<{
843
+ type: z.ZodLiteral<"generate-commit-message">;
844
+ fingerprintId: z.ZodString;
845
+ authToken: z.ZodOptional<z.ZodString>;
846
+ stagedChanges: z.ZodString;
847
+ }, "strip", z.ZodTypeAny, {
848
+ type: "generate-commit-message";
849
+ fingerprintId: string;
850
+ stagedChanges: string;
851
+ authToken?: string | undefined;
852
+ }, {
853
+ type: "generate-commit-message";
854
+ fingerprintId: string;
855
+ stagedChanges: string;
856
+ authToken?: string | undefined;
857
+ }>]>;
858
+ export type ClientAction = z.infer<typeof CLIENT_ACTION_SCHEMA>;
859
+ export declare const UsageReponseSchema: z.ZodObject<{
860
+ type: z.ZodLiteral<"usage-response">;
861
+ usage: z.ZodNumber;
862
+ remainingBalance: z.ZodNumber;
863
+ balanceBreakdown: z.ZodOptional<z.ZodRecord<z.ZodEnum<[import("./types/grant").GrantType, ...import("./types/grant").GrantType[]]>, z.ZodNumber>>;
864
+ next_quota_reset: z.ZodNullable<z.ZodDate>;
865
+ autoTopupAdded: z.ZodOptional<z.ZodNumber>;
866
+ }, "strip", z.ZodTypeAny, {
867
+ type: "usage-response";
868
+ usage: number;
869
+ remainingBalance: number;
870
+ next_quota_reset: Date | null;
871
+ balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
872
+ autoTopupAdded?: number | undefined;
873
+ }, {
874
+ type: "usage-response";
875
+ usage: number;
876
+ remainingBalance: number;
877
+ next_quota_reset: Date | null;
878
+ balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
879
+ autoTopupAdded?: number | undefined;
880
+ }>;
881
+ export type UsageResponse = z.infer<typeof UsageReponseSchema>;
882
+ export declare const InitResponseSchema: z.ZodObject<z.objectUtil.extendShape<{
883
+ type: z.ZodLiteral<"init-response">;
884
+ }, Omit<{
885
+ type: z.ZodLiteral<"usage-response">;
886
+ usage: z.ZodNumber;
887
+ remainingBalance: z.ZodNumber;
888
+ balanceBreakdown: z.ZodOptional<z.ZodRecord<z.ZodEnum<[import("./types/grant").GrantType, ...import("./types/grant").GrantType[]]>, z.ZodNumber>>;
889
+ next_quota_reset: z.ZodNullable<z.ZodDate>;
890
+ autoTopupAdded: z.ZodOptional<z.ZodNumber>;
891
+ }, "type">>, "strip", z.ZodTypeAny, {
892
+ type: "init-response";
893
+ usage: number;
894
+ remainingBalance: number;
895
+ next_quota_reset: Date | null;
896
+ balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
897
+ autoTopupAdded?: number | undefined;
898
+ }, {
899
+ type: "init-response";
900
+ usage: number;
901
+ remainingBalance: number;
902
+ next_quota_reset: Date | null;
903
+ balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
904
+ autoTopupAdded?: number | undefined;
905
+ }>;
906
+ export type InitResponse = z.infer<typeof InitResponseSchema>;
907
+ export declare const ResponseCompleteSchema: z.ZodObject<z.objectUtil.extendShape<{
908
+ type: z.ZodLiteral<"response-complete">;
909
+ userInputId: z.ZodString;
910
+ response: z.ZodString;
911
+ changes: z.ZodArray<z.ZodObject<{
912
+ type: z.ZodEnum<["patch", "file"]>;
913
+ path: z.ZodString;
914
+ content: z.ZodString;
915
+ }, "strip", z.ZodTypeAny, {
916
+ path: string;
917
+ type: "file" | "patch";
918
+ content: string;
919
+ }, {
920
+ path: string;
921
+ type: "file" | "patch";
922
+ content: string;
923
+ }>, "many">;
924
+ changesAlreadyApplied: z.ZodArray<z.ZodObject<{
925
+ type: z.ZodEnum<["patch", "file"]>;
926
+ path: z.ZodString;
927
+ content: z.ZodString;
928
+ }, "strip", z.ZodTypeAny, {
929
+ path: string;
930
+ type: "file" | "patch";
931
+ content: string;
932
+ }, {
933
+ path: string;
934
+ type: "file" | "patch";
935
+ content: string;
936
+ }>, "many">;
937
+ addedFileVersions: z.ZodArray<z.ZodObject<{
938
+ path: z.ZodString;
939
+ content: z.ZodString;
940
+ }, "strip", z.ZodTypeAny, {
941
+ path: string;
942
+ content: string;
943
+ }, {
944
+ path: string;
945
+ content: string;
946
+ }>, "many">;
947
+ resetFileVersions: z.ZodBoolean;
948
+ }, {
949
+ usage: z.ZodOptional<z.ZodNumber>;
950
+ remainingBalance: z.ZodOptional<z.ZodNumber>;
951
+ balanceBreakdown: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodEnum<[import("./types/grant").GrantType, ...import("./types/grant").GrantType[]]>, z.ZodNumber>>>;
952
+ next_quota_reset: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
953
+ autoTopupAdded: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
954
+ }>, "strip", z.ZodTypeAny, {
955
+ type: "response-complete";
956
+ userInputId: string;
957
+ response: string;
958
+ changes: {
959
+ path: string;
960
+ type: "file" | "patch";
961
+ content: string;
962
+ }[];
963
+ changesAlreadyApplied: {
964
+ path: string;
965
+ type: "file" | "patch";
966
+ content: string;
967
+ }[];
968
+ addedFileVersions: {
969
+ path: string;
970
+ content: string;
971
+ }[];
972
+ resetFileVersions: boolean;
973
+ usage?: number | undefined;
974
+ remainingBalance?: number | undefined;
975
+ balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
976
+ next_quota_reset?: Date | null | undefined;
977
+ autoTopupAdded?: number | undefined;
978
+ }, {
979
+ type: "response-complete";
980
+ userInputId: string;
981
+ response: string;
982
+ changes: {
983
+ path: string;
984
+ type: "file" | "patch";
985
+ content: string;
986
+ }[];
987
+ changesAlreadyApplied: {
988
+ path: string;
989
+ type: "file" | "patch";
990
+ content: string;
991
+ }[];
992
+ addedFileVersions: {
993
+ path: string;
994
+ content: string;
995
+ }[];
996
+ resetFileVersions: boolean;
997
+ usage?: number | undefined;
998
+ remainingBalance?: number | undefined;
999
+ balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
1000
+ next_quota_reset?: Date | null | undefined;
1001
+ autoTopupAdded?: number | undefined;
1002
+ }>;
1003
+ export declare const MessageCostResponseSchema: z.ZodObject<{
1004
+ type: z.ZodLiteral<"message-cost-response">;
1005
+ promptId: z.ZodString;
1006
+ credits: z.ZodNumber;
1007
+ }, "strip", z.ZodTypeAny, {
1008
+ type: "message-cost-response";
1009
+ promptId: string;
1010
+ credits: number;
1011
+ }, {
1012
+ type: "message-cost-response";
1013
+ promptId: string;
1014
+ credits: number;
1015
+ }>;
1016
+ export type MessageCostResponse = z.infer<typeof MessageCostResponseSchema>;
1017
+ export declare const PromptResponseSchema: z.ZodObject<{
1018
+ type: z.ZodLiteral<"prompt-response">;
1019
+ promptId: z.ZodString;
1020
+ agentState: z.ZodObject<{
1021
+ agentContext: z.ZodString;
1022
+ fileContext: z.ZodObject<{
1023
+ currentWorkingDirectory: z.ZodString;
1024
+ fileTree: z.ZodArray<z.ZodType<import("./util/file").FileTreeNode, z.ZodTypeDef, import("./util/file").FileTreeNode>, "many">;
1025
+ fileTokenScores: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodNumber>>;
1026
+ knowledgeFiles: z.ZodRecord<z.ZodString, z.ZodString>;
1027
+ userKnowledgeFiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1028
+ gitChanges: z.ZodObject<{
1029
+ status: z.ZodString;
1030
+ diff: z.ZodString;
1031
+ diffCached: z.ZodString;
1032
+ lastCommitMessages: z.ZodString;
1033
+ }, "strip", z.ZodTypeAny, {
1034
+ status: string;
1035
+ diff: string;
1036
+ diffCached: string;
1037
+ lastCommitMessages: string;
1038
+ }, {
1039
+ status: string;
1040
+ diff: string;
1041
+ diffCached: string;
1042
+ lastCommitMessages: string;
1043
+ }>;
1044
+ changesSinceLastChat: z.ZodRecord<z.ZodString, z.ZodString>;
1045
+ shellConfigFiles: z.ZodRecord<z.ZodString, z.ZodString>;
1046
+ systemInfo: z.ZodObject<{
1047
+ platform: z.ZodString;
1048
+ shell: z.ZodString;
1049
+ nodeVersion: z.ZodString;
1050
+ arch: z.ZodString;
1051
+ homedir: z.ZodString;
1052
+ cpus: z.ZodNumber;
1053
+ }, "strip", z.ZodTypeAny, {
1054
+ platform: string;
1055
+ shell: string;
1056
+ nodeVersion: string;
1057
+ arch: string;
1058
+ homedir: string;
1059
+ cpus: number;
1060
+ }, {
1061
+ platform: string;
1062
+ shell: string;
1063
+ nodeVersion: string;
1064
+ arch: string;
1065
+ homedir: string;
1066
+ cpus: number;
1067
+ }>;
1068
+ fileVersions: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodObject<{
1069
+ path: z.ZodString;
1070
+ content: z.ZodString;
1071
+ }, "strip", z.ZodTypeAny, {
1072
+ path: string;
1073
+ content: string;
1074
+ }, {
1075
+ path: string;
1076
+ content: string;
1077
+ }>, "many">, "many">>;
1078
+ }, "strip", z.ZodTypeAny, {
1079
+ currentWorkingDirectory: string;
1080
+ fileTree: import("./util/file").FileTreeNode[];
1081
+ fileTokenScores: Record<string, Record<string, number>>;
1082
+ knowledgeFiles: Record<string, string>;
1083
+ gitChanges: {
1084
+ status: string;
1085
+ diff: string;
1086
+ diffCached: string;
1087
+ lastCommitMessages: string;
1088
+ };
1089
+ changesSinceLastChat: Record<string, string>;
1090
+ shellConfigFiles: Record<string, string>;
1091
+ systemInfo: {
1092
+ platform: string;
1093
+ shell: string;
1094
+ nodeVersion: string;
1095
+ arch: string;
1096
+ homedir: string;
1097
+ cpus: number;
1098
+ };
1099
+ userKnowledgeFiles?: Record<string, string> | undefined;
1100
+ fileVersions?: {
1101
+ path: string;
1102
+ content: string;
1103
+ }[][] | undefined;
1104
+ }, {
1105
+ currentWorkingDirectory: string;
1106
+ fileTree: import("./util/file").FileTreeNode[];
1107
+ fileTokenScores: Record<string, Record<string, number>>;
1108
+ knowledgeFiles: Record<string, string>;
1109
+ gitChanges: {
1110
+ status: string;
1111
+ diff: string;
1112
+ diffCached: string;
1113
+ lastCommitMessages: string;
1114
+ };
1115
+ changesSinceLastChat: Record<string, string>;
1116
+ shellConfigFiles: Record<string, string>;
1117
+ systemInfo: {
1118
+ platform: string;
1119
+ shell: string;
1120
+ nodeVersion: string;
1121
+ arch: string;
1122
+ homedir: string;
1123
+ cpus: number;
1124
+ };
1125
+ userKnowledgeFiles?: Record<string, string> | undefined;
1126
+ fileVersions?: {
1127
+ path: string;
1128
+ content: string;
1129
+ }[][] | undefined;
1130
+ }>;
1131
+ messageHistory: z.ZodArray<z.ZodObject<{
1132
+ role: z.ZodUnion<[z.ZodLiteral<"user">, z.ZodLiteral<"assistant">]>;
1133
+ content: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodObject<{
1134
+ type: z.ZodLiteral<"text">;
1135
+ text: z.ZodString;
1136
+ cache_control: z.ZodOptional<z.ZodObject<{
1137
+ type: z.ZodLiteral<"ephemeral">;
1138
+ }, "strip", z.ZodTypeAny, {
1139
+ type: "ephemeral";
1140
+ }, {
1141
+ type: "ephemeral";
1142
+ }>>;
1143
+ }, "strip", z.ZodTypeAny, {
1144
+ type: "text";
1145
+ text: string;
1146
+ cache_control?: {
1147
+ type: "ephemeral";
1148
+ } | undefined;
1149
+ }, {
1150
+ type: "text";
1151
+ text: string;
1152
+ cache_control?: {
1153
+ type: "ephemeral";
1154
+ } | undefined;
1155
+ }>, z.ZodObject<{
1156
+ type: z.ZodLiteral<"tool_use">;
1157
+ id: z.ZodString;
1158
+ name: z.ZodString;
1159
+ input: z.ZodRecord<z.ZodString, z.ZodAny>;
1160
+ cache_control: z.ZodOptional<z.ZodObject<{
1161
+ type: z.ZodLiteral<"ephemeral">;
1162
+ }, "strip", z.ZodTypeAny, {
1163
+ type: "ephemeral";
1164
+ }, {
1165
+ type: "ephemeral";
1166
+ }>>;
1167
+ }, "strip", z.ZodTypeAny, {
1168
+ type: "tool_use";
1169
+ name: string;
1170
+ id: string;
1171
+ input: Record<string, any>;
1172
+ cache_control?: {
1173
+ type: "ephemeral";
1174
+ } | undefined;
1175
+ }, {
1176
+ type: "tool_use";
1177
+ name: string;
1178
+ id: string;
1179
+ input: Record<string, any>;
1180
+ cache_control?: {
1181
+ type: "ephemeral";
1182
+ } | undefined;
1183
+ }>, z.ZodObject<{
1184
+ type: z.ZodLiteral<"tool_result">;
1185
+ tool_use_id: z.ZodString;
1186
+ content: z.ZodString;
1187
+ cache_control: z.ZodOptional<z.ZodObject<{
1188
+ type: z.ZodLiteral<"ephemeral">;
1189
+ }, "strip", z.ZodTypeAny, {
1190
+ type: "ephemeral";
1191
+ }, {
1192
+ type: "ephemeral";
1193
+ }>>;
1194
+ }, "strip", z.ZodTypeAny, {
1195
+ type: "tool_result";
1196
+ content: string;
1197
+ tool_use_id: string;
1198
+ cache_control?: {
1199
+ type: "ephemeral";
1200
+ } | undefined;
1201
+ }, {
1202
+ type: "tool_result";
1203
+ content: string;
1204
+ tool_use_id: string;
1205
+ cache_control?: {
1206
+ type: "ephemeral";
1207
+ } | undefined;
1208
+ }>, z.ZodObject<{
1209
+ type: z.ZodLiteral<"image">;
1210
+ source: z.ZodObject<{
1211
+ type: z.ZodLiteral<"base64">;
1212
+ media_type: z.ZodLiteral<"image/jpeg">;
1213
+ data: z.ZodString;
1214
+ }, "strip", z.ZodTypeAny, {
1215
+ type: "base64";
1216
+ media_type: "image/jpeg";
1217
+ data: string;
1218
+ }, {
1219
+ type: "base64";
1220
+ media_type: "image/jpeg";
1221
+ data: string;
1222
+ }>;
1223
+ cache_control: z.ZodOptional<z.ZodObject<{
1224
+ type: z.ZodLiteral<"ephemeral">;
1225
+ }, "strip", z.ZodTypeAny, {
1226
+ type: "ephemeral";
1227
+ }, {
1228
+ type: "ephemeral";
1229
+ }>>;
1230
+ }, "strip", z.ZodTypeAny, {
1231
+ type: "image";
1232
+ source: {
1233
+ type: "base64";
1234
+ media_type: "image/jpeg";
1235
+ data: string;
1236
+ };
1237
+ cache_control?: {
1238
+ type: "ephemeral";
1239
+ } | undefined;
1240
+ }, {
1241
+ type: "image";
1242
+ source: {
1243
+ type: "base64";
1244
+ media_type: "image/jpeg";
1245
+ data: string;
1246
+ };
1247
+ cache_control?: {
1248
+ type: "ephemeral";
1249
+ } | undefined;
1250
+ }>]>, "many">]>;
1251
+ }, "strip", z.ZodTypeAny, {
1252
+ content: string | ({
1253
+ type: "text";
1254
+ text: string;
1255
+ cache_control?: {
1256
+ type: "ephemeral";
1257
+ } | undefined;
1258
+ } | {
1259
+ type: "tool_use";
1260
+ name: string;
1261
+ id: string;
1262
+ input: Record<string, any>;
1263
+ cache_control?: {
1264
+ type: "ephemeral";
1265
+ } | undefined;
1266
+ } | {
1267
+ type: "tool_result";
1268
+ content: string;
1269
+ tool_use_id: string;
1270
+ cache_control?: {
1271
+ type: "ephemeral";
1272
+ } | undefined;
1273
+ } | {
1274
+ type: "image";
1275
+ source: {
1276
+ type: "base64";
1277
+ media_type: "image/jpeg";
1278
+ data: string;
1279
+ };
1280
+ cache_control?: {
1281
+ type: "ephemeral";
1282
+ } | undefined;
1283
+ })[];
1284
+ role: "user" | "assistant";
1285
+ }, {
1286
+ content: string | ({
1287
+ type: "text";
1288
+ text: string;
1289
+ cache_control?: {
1290
+ type: "ephemeral";
1291
+ } | undefined;
1292
+ } | {
1293
+ type: "tool_use";
1294
+ name: string;
1295
+ id: string;
1296
+ input: Record<string, any>;
1297
+ cache_control?: {
1298
+ type: "ephemeral";
1299
+ } | undefined;
1300
+ } | {
1301
+ type: "tool_result";
1302
+ content: string;
1303
+ tool_use_id: string;
1304
+ cache_control?: {
1305
+ type: "ephemeral";
1306
+ } | undefined;
1307
+ } | {
1308
+ type: "image";
1309
+ source: {
1310
+ type: "base64";
1311
+ media_type: "image/jpeg";
1312
+ data: string;
1313
+ };
1314
+ cache_control?: {
1315
+ type: "ephemeral";
1316
+ } | undefined;
1317
+ })[];
1318
+ role: "user" | "assistant";
1319
+ }>, "many">;
1320
+ consecutiveAssistantMessages: z.ZodOptional<z.ZodNumber>;
1321
+ }, "strip", z.ZodTypeAny, {
1322
+ agentContext: string;
1323
+ fileContext: {
1324
+ currentWorkingDirectory: string;
1325
+ fileTree: import("./util/file").FileTreeNode[];
1326
+ fileTokenScores: Record<string, Record<string, number>>;
1327
+ knowledgeFiles: Record<string, string>;
1328
+ gitChanges: {
1329
+ status: string;
1330
+ diff: string;
1331
+ diffCached: string;
1332
+ lastCommitMessages: string;
1333
+ };
1334
+ changesSinceLastChat: Record<string, string>;
1335
+ shellConfigFiles: Record<string, string>;
1336
+ systemInfo: {
1337
+ platform: string;
1338
+ shell: string;
1339
+ nodeVersion: string;
1340
+ arch: string;
1341
+ homedir: string;
1342
+ cpus: number;
1343
+ };
1344
+ userKnowledgeFiles?: Record<string, string> | undefined;
1345
+ fileVersions?: {
1346
+ path: string;
1347
+ content: string;
1348
+ }[][] | undefined;
1349
+ };
1350
+ messageHistory: {
1351
+ content: string | ({
1352
+ type: "text";
1353
+ text: string;
1354
+ cache_control?: {
1355
+ type: "ephemeral";
1356
+ } | undefined;
1357
+ } | {
1358
+ type: "tool_use";
1359
+ name: string;
1360
+ id: string;
1361
+ input: Record<string, any>;
1362
+ cache_control?: {
1363
+ type: "ephemeral";
1364
+ } | undefined;
1365
+ } | {
1366
+ type: "tool_result";
1367
+ content: string;
1368
+ tool_use_id: string;
1369
+ cache_control?: {
1370
+ type: "ephemeral";
1371
+ } | undefined;
1372
+ } | {
1373
+ type: "image";
1374
+ source: {
1375
+ type: "base64";
1376
+ media_type: "image/jpeg";
1377
+ data: string;
1378
+ };
1379
+ cache_control?: {
1380
+ type: "ephemeral";
1381
+ } | undefined;
1382
+ })[];
1383
+ role: "user" | "assistant";
1384
+ }[];
1385
+ consecutiveAssistantMessages?: number | undefined;
1386
+ }, {
1387
+ agentContext: string;
1388
+ fileContext: {
1389
+ currentWorkingDirectory: string;
1390
+ fileTree: import("./util/file").FileTreeNode[];
1391
+ fileTokenScores: Record<string, Record<string, number>>;
1392
+ knowledgeFiles: Record<string, string>;
1393
+ gitChanges: {
1394
+ status: string;
1395
+ diff: string;
1396
+ diffCached: string;
1397
+ lastCommitMessages: string;
1398
+ };
1399
+ changesSinceLastChat: Record<string, string>;
1400
+ shellConfigFiles: Record<string, string>;
1401
+ systemInfo: {
1402
+ platform: string;
1403
+ shell: string;
1404
+ nodeVersion: string;
1405
+ arch: string;
1406
+ homedir: string;
1407
+ cpus: number;
1408
+ };
1409
+ userKnowledgeFiles?: Record<string, string> | undefined;
1410
+ fileVersions?: {
1411
+ path: string;
1412
+ content: string;
1413
+ }[][] | undefined;
1414
+ };
1415
+ messageHistory: {
1416
+ content: string | ({
1417
+ type: "text";
1418
+ text: string;
1419
+ cache_control?: {
1420
+ type: "ephemeral";
1421
+ } | undefined;
1422
+ } | {
1423
+ type: "tool_use";
1424
+ name: string;
1425
+ id: string;
1426
+ input: Record<string, any>;
1427
+ cache_control?: {
1428
+ type: "ephemeral";
1429
+ } | undefined;
1430
+ } | {
1431
+ type: "tool_result";
1432
+ content: string;
1433
+ tool_use_id: string;
1434
+ cache_control?: {
1435
+ type: "ephemeral";
1436
+ } | undefined;
1437
+ } | {
1438
+ type: "image";
1439
+ source: {
1440
+ type: "base64";
1441
+ media_type: "image/jpeg";
1442
+ data: string;
1443
+ };
1444
+ cache_control?: {
1445
+ type: "ephemeral";
1446
+ } | undefined;
1447
+ })[];
1448
+ role: "user" | "assistant";
1449
+ }[];
1450
+ consecutiveAssistantMessages?: number | undefined;
1451
+ }>;
1452
+ toolCalls: z.ZodArray<z.ZodObject<{
1453
+ name: z.ZodString;
1454
+ parameters: z.ZodRecord<z.ZodString, z.ZodString>;
1455
+ id: z.ZodString;
1456
+ }, "strip", z.ZodTypeAny, {
1457
+ name: string;
1458
+ id: string;
1459
+ parameters: Record<string, string>;
1460
+ }, {
1461
+ name: string;
1462
+ id: string;
1463
+ parameters: Record<string, string>;
1464
+ }>, "many">;
1465
+ toolResults: z.ZodArray<z.ZodObject<{
1466
+ name: z.ZodString;
1467
+ result: z.ZodString;
1468
+ id: z.ZodString;
1469
+ }, "strip", z.ZodTypeAny, {
1470
+ name: string;
1471
+ id: string;
1472
+ result: string;
1473
+ }, {
1474
+ name: string;
1475
+ id: string;
1476
+ result: string;
1477
+ }>, "many">;
1478
+ }, "strip", z.ZodTypeAny, {
1479
+ type: "prompt-response";
1480
+ promptId: string;
1481
+ agentState: {
1482
+ agentContext: string;
1483
+ fileContext: {
1484
+ currentWorkingDirectory: string;
1485
+ fileTree: import("./util/file").FileTreeNode[];
1486
+ fileTokenScores: Record<string, Record<string, number>>;
1487
+ knowledgeFiles: Record<string, string>;
1488
+ gitChanges: {
1489
+ status: string;
1490
+ diff: string;
1491
+ diffCached: string;
1492
+ lastCommitMessages: string;
1493
+ };
1494
+ changesSinceLastChat: Record<string, string>;
1495
+ shellConfigFiles: Record<string, string>;
1496
+ systemInfo: {
1497
+ platform: string;
1498
+ shell: string;
1499
+ nodeVersion: string;
1500
+ arch: string;
1501
+ homedir: string;
1502
+ cpus: number;
1503
+ };
1504
+ userKnowledgeFiles?: Record<string, string> | undefined;
1505
+ fileVersions?: {
1506
+ path: string;
1507
+ content: string;
1508
+ }[][] | undefined;
1509
+ };
1510
+ messageHistory: {
1511
+ content: string | ({
1512
+ type: "text";
1513
+ text: string;
1514
+ cache_control?: {
1515
+ type: "ephemeral";
1516
+ } | undefined;
1517
+ } | {
1518
+ type: "tool_use";
1519
+ name: string;
1520
+ id: string;
1521
+ input: Record<string, any>;
1522
+ cache_control?: {
1523
+ type: "ephemeral";
1524
+ } | undefined;
1525
+ } | {
1526
+ type: "tool_result";
1527
+ content: string;
1528
+ tool_use_id: string;
1529
+ cache_control?: {
1530
+ type: "ephemeral";
1531
+ } | undefined;
1532
+ } | {
1533
+ type: "image";
1534
+ source: {
1535
+ type: "base64";
1536
+ media_type: "image/jpeg";
1537
+ data: string;
1538
+ };
1539
+ cache_control?: {
1540
+ type: "ephemeral";
1541
+ } | undefined;
1542
+ })[];
1543
+ role: "user" | "assistant";
1544
+ }[];
1545
+ consecutiveAssistantMessages?: number | undefined;
1546
+ };
1547
+ toolResults: {
1548
+ name: string;
1549
+ id: string;
1550
+ result: string;
1551
+ }[];
1552
+ toolCalls: {
1553
+ name: string;
1554
+ id: string;
1555
+ parameters: Record<string, string>;
1556
+ }[];
1557
+ }, {
1558
+ type: "prompt-response";
1559
+ promptId: string;
1560
+ agentState: {
1561
+ agentContext: string;
1562
+ fileContext: {
1563
+ currentWorkingDirectory: string;
1564
+ fileTree: import("./util/file").FileTreeNode[];
1565
+ fileTokenScores: Record<string, Record<string, number>>;
1566
+ knowledgeFiles: Record<string, string>;
1567
+ gitChanges: {
1568
+ status: string;
1569
+ diff: string;
1570
+ diffCached: string;
1571
+ lastCommitMessages: string;
1572
+ };
1573
+ changesSinceLastChat: Record<string, string>;
1574
+ shellConfigFiles: Record<string, string>;
1575
+ systemInfo: {
1576
+ platform: string;
1577
+ shell: string;
1578
+ nodeVersion: string;
1579
+ arch: string;
1580
+ homedir: string;
1581
+ cpus: number;
1582
+ };
1583
+ userKnowledgeFiles?: Record<string, string> | undefined;
1584
+ fileVersions?: {
1585
+ path: string;
1586
+ content: string;
1587
+ }[][] | undefined;
1588
+ };
1589
+ messageHistory: {
1590
+ content: string | ({
1591
+ type: "text";
1592
+ text: string;
1593
+ cache_control?: {
1594
+ type: "ephemeral";
1595
+ } | undefined;
1596
+ } | {
1597
+ type: "tool_use";
1598
+ name: string;
1599
+ id: string;
1600
+ input: Record<string, any>;
1601
+ cache_control?: {
1602
+ type: "ephemeral";
1603
+ } | undefined;
1604
+ } | {
1605
+ type: "tool_result";
1606
+ content: string;
1607
+ tool_use_id: string;
1608
+ cache_control?: {
1609
+ type: "ephemeral";
1610
+ } | undefined;
1611
+ } | {
1612
+ type: "image";
1613
+ source: {
1614
+ type: "base64";
1615
+ media_type: "image/jpeg";
1616
+ data: string;
1617
+ };
1618
+ cache_control?: {
1619
+ type: "ephemeral";
1620
+ } | undefined;
1621
+ })[];
1622
+ role: "user" | "assistant";
1623
+ }[];
1624
+ consecutiveAssistantMessages?: number | undefined;
1625
+ };
1626
+ toolResults: {
1627
+ name: string;
1628
+ id: string;
1629
+ result: string;
1630
+ }[];
1631
+ toolCalls: {
1632
+ name: string;
1633
+ id: string;
1634
+ parameters: Record<string, string>;
1635
+ }[];
1636
+ }>;
1637
+ export type PromptResponse = z.infer<typeof PromptResponseSchema>;
1638
+ export declare const SERVER_ACTION_SCHEMA: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1639
+ type: z.ZodLiteral<"response-chunk">;
1640
+ userInputId: z.ZodString;
1641
+ chunk: z.ZodString;
1642
+ }, "strip", z.ZodTypeAny, {
1643
+ type: "response-chunk";
1644
+ userInputId: string;
1645
+ chunk: string;
1646
+ }, {
1647
+ type: "response-chunk";
1648
+ userInputId: string;
1649
+ chunk: string;
1650
+ }>, z.ZodObject<z.objectUtil.extendShape<{
1651
+ type: z.ZodLiteral<"response-complete">;
1652
+ userInputId: z.ZodString;
1653
+ response: z.ZodString;
1654
+ changes: z.ZodArray<z.ZodObject<{
1655
+ type: z.ZodEnum<["patch", "file"]>;
1656
+ path: z.ZodString;
1657
+ content: z.ZodString;
1658
+ }, "strip", z.ZodTypeAny, {
1659
+ path: string;
1660
+ type: "file" | "patch";
1661
+ content: string;
1662
+ }, {
1663
+ path: string;
1664
+ type: "file" | "patch";
1665
+ content: string;
1666
+ }>, "many">;
1667
+ changesAlreadyApplied: z.ZodArray<z.ZodObject<{
1668
+ type: z.ZodEnum<["patch", "file"]>;
1669
+ path: z.ZodString;
1670
+ content: z.ZodString;
1671
+ }, "strip", z.ZodTypeAny, {
1672
+ path: string;
1673
+ type: "file" | "patch";
1674
+ content: string;
1675
+ }, {
1676
+ path: string;
1677
+ type: "file" | "patch";
1678
+ content: string;
1679
+ }>, "many">;
1680
+ addedFileVersions: z.ZodArray<z.ZodObject<{
1681
+ path: z.ZodString;
1682
+ content: z.ZodString;
1683
+ }, "strip", z.ZodTypeAny, {
1684
+ path: string;
1685
+ content: string;
1686
+ }, {
1687
+ path: string;
1688
+ content: string;
1689
+ }>, "many">;
1690
+ resetFileVersions: z.ZodBoolean;
1691
+ }, {
1692
+ usage: z.ZodOptional<z.ZodNumber>;
1693
+ remainingBalance: z.ZodOptional<z.ZodNumber>;
1694
+ balanceBreakdown: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodEnum<[import("./types/grant").GrantType, ...import("./types/grant").GrantType[]]>, z.ZodNumber>>>;
1695
+ next_quota_reset: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
1696
+ autoTopupAdded: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
1697
+ }>, "strip", z.ZodTypeAny, {
1698
+ type: "response-complete";
1699
+ userInputId: string;
1700
+ response: string;
1701
+ changes: {
1702
+ path: string;
1703
+ type: "file" | "patch";
1704
+ content: string;
1705
+ }[];
1706
+ changesAlreadyApplied: {
1707
+ path: string;
1708
+ type: "file" | "patch";
1709
+ content: string;
1710
+ }[];
1711
+ addedFileVersions: {
1712
+ path: string;
1713
+ content: string;
1714
+ }[];
1715
+ resetFileVersions: boolean;
1716
+ usage?: number | undefined;
1717
+ remainingBalance?: number | undefined;
1718
+ balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
1719
+ next_quota_reset?: Date | null | undefined;
1720
+ autoTopupAdded?: number | undefined;
1721
+ }, {
1722
+ type: "response-complete";
1723
+ userInputId: string;
1724
+ response: string;
1725
+ changes: {
1726
+ path: string;
1727
+ type: "file" | "patch";
1728
+ content: string;
1729
+ }[];
1730
+ changesAlreadyApplied: {
1731
+ path: string;
1732
+ type: "file" | "patch";
1733
+ content: string;
1734
+ }[];
1735
+ addedFileVersions: {
1736
+ path: string;
1737
+ content: string;
1738
+ }[];
1739
+ resetFileVersions: boolean;
1740
+ usage?: number | undefined;
1741
+ remainingBalance?: number | undefined;
1742
+ balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
1743
+ next_quota_reset?: Date | null | undefined;
1744
+ autoTopupAdded?: number | undefined;
1745
+ }>, z.ZodObject<{
1746
+ type: z.ZodLiteral<"prompt-response">;
1747
+ promptId: z.ZodString;
1748
+ agentState: z.ZodObject<{
1749
+ agentContext: z.ZodString;
1750
+ fileContext: z.ZodObject<{
1751
+ currentWorkingDirectory: z.ZodString;
1752
+ fileTree: z.ZodArray<z.ZodType<import("./util/file").FileTreeNode, z.ZodTypeDef, import("./util/file").FileTreeNode>, "many">;
1753
+ fileTokenScores: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodNumber>>;
1754
+ knowledgeFiles: z.ZodRecord<z.ZodString, z.ZodString>;
1755
+ userKnowledgeFiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1756
+ gitChanges: z.ZodObject<{
1757
+ status: z.ZodString;
1758
+ diff: z.ZodString;
1759
+ diffCached: z.ZodString;
1760
+ lastCommitMessages: z.ZodString;
1761
+ }, "strip", z.ZodTypeAny, {
1762
+ status: string;
1763
+ diff: string;
1764
+ diffCached: string;
1765
+ lastCommitMessages: string;
1766
+ }, {
1767
+ status: string;
1768
+ diff: string;
1769
+ diffCached: string;
1770
+ lastCommitMessages: string;
1771
+ }>;
1772
+ changesSinceLastChat: z.ZodRecord<z.ZodString, z.ZodString>;
1773
+ shellConfigFiles: z.ZodRecord<z.ZodString, z.ZodString>;
1774
+ systemInfo: z.ZodObject<{
1775
+ platform: z.ZodString;
1776
+ shell: z.ZodString;
1777
+ nodeVersion: z.ZodString;
1778
+ arch: z.ZodString;
1779
+ homedir: z.ZodString;
1780
+ cpus: z.ZodNumber;
1781
+ }, "strip", z.ZodTypeAny, {
1782
+ platform: string;
1783
+ shell: string;
1784
+ nodeVersion: string;
1785
+ arch: string;
1786
+ homedir: string;
1787
+ cpus: number;
1788
+ }, {
1789
+ platform: string;
1790
+ shell: string;
1791
+ nodeVersion: string;
1792
+ arch: string;
1793
+ homedir: string;
1794
+ cpus: number;
1795
+ }>;
1796
+ fileVersions: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodObject<{
1797
+ path: z.ZodString;
1798
+ content: z.ZodString;
1799
+ }, "strip", z.ZodTypeAny, {
1800
+ path: string;
1801
+ content: string;
1802
+ }, {
1803
+ path: string;
1804
+ content: string;
1805
+ }>, "many">, "many">>;
1806
+ }, "strip", z.ZodTypeAny, {
1807
+ currentWorkingDirectory: string;
1808
+ fileTree: import("./util/file").FileTreeNode[];
1809
+ fileTokenScores: Record<string, Record<string, number>>;
1810
+ knowledgeFiles: Record<string, string>;
1811
+ gitChanges: {
1812
+ status: string;
1813
+ diff: string;
1814
+ diffCached: string;
1815
+ lastCommitMessages: string;
1816
+ };
1817
+ changesSinceLastChat: Record<string, string>;
1818
+ shellConfigFiles: Record<string, string>;
1819
+ systemInfo: {
1820
+ platform: string;
1821
+ shell: string;
1822
+ nodeVersion: string;
1823
+ arch: string;
1824
+ homedir: string;
1825
+ cpus: number;
1826
+ };
1827
+ userKnowledgeFiles?: Record<string, string> | undefined;
1828
+ fileVersions?: {
1829
+ path: string;
1830
+ content: string;
1831
+ }[][] | undefined;
1832
+ }, {
1833
+ currentWorkingDirectory: string;
1834
+ fileTree: import("./util/file").FileTreeNode[];
1835
+ fileTokenScores: Record<string, Record<string, number>>;
1836
+ knowledgeFiles: Record<string, string>;
1837
+ gitChanges: {
1838
+ status: string;
1839
+ diff: string;
1840
+ diffCached: string;
1841
+ lastCommitMessages: string;
1842
+ };
1843
+ changesSinceLastChat: Record<string, string>;
1844
+ shellConfigFiles: Record<string, string>;
1845
+ systemInfo: {
1846
+ platform: string;
1847
+ shell: string;
1848
+ nodeVersion: string;
1849
+ arch: string;
1850
+ homedir: string;
1851
+ cpus: number;
1852
+ };
1853
+ userKnowledgeFiles?: Record<string, string> | undefined;
1854
+ fileVersions?: {
1855
+ path: string;
1856
+ content: string;
1857
+ }[][] | undefined;
1858
+ }>;
1859
+ messageHistory: z.ZodArray<z.ZodObject<{
1860
+ role: z.ZodUnion<[z.ZodLiteral<"user">, z.ZodLiteral<"assistant">]>;
1861
+ content: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodObject<{
1862
+ type: z.ZodLiteral<"text">;
1863
+ text: z.ZodString;
1864
+ cache_control: z.ZodOptional<z.ZodObject<{
1865
+ type: z.ZodLiteral<"ephemeral">;
1866
+ }, "strip", z.ZodTypeAny, {
1867
+ type: "ephemeral";
1868
+ }, {
1869
+ type: "ephemeral";
1870
+ }>>;
1871
+ }, "strip", z.ZodTypeAny, {
1872
+ type: "text";
1873
+ text: string;
1874
+ cache_control?: {
1875
+ type: "ephemeral";
1876
+ } | undefined;
1877
+ }, {
1878
+ type: "text";
1879
+ text: string;
1880
+ cache_control?: {
1881
+ type: "ephemeral";
1882
+ } | undefined;
1883
+ }>, z.ZodObject<{
1884
+ type: z.ZodLiteral<"tool_use">;
1885
+ id: z.ZodString;
1886
+ name: z.ZodString;
1887
+ input: z.ZodRecord<z.ZodString, z.ZodAny>;
1888
+ cache_control: z.ZodOptional<z.ZodObject<{
1889
+ type: z.ZodLiteral<"ephemeral">;
1890
+ }, "strip", z.ZodTypeAny, {
1891
+ type: "ephemeral";
1892
+ }, {
1893
+ type: "ephemeral";
1894
+ }>>;
1895
+ }, "strip", z.ZodTypeAny, {
1896
+ type: "tool_use";
1897
+ name: string;
1898
+ id: string;
1899
+ input: Record<string, any>;
1900
+ cache_control?: {
1901
+ type: "ephemeral";
1902
+ } | undefined;
1903
+ }, {
1904
+ type: "tool_use";
1905
+ name: string;
1906
+ id: string;
1907
+ input: Record<string, any>;
1908
+ cache_control?: {
1909
+ type: "ephemeral";
1910
+ } | undefined;
1911
+ }>, z.ZodObject<{
1912
+ type: z.ZodLiteral<"tool_result">;
1913
+ tool_use_id: z.ZodString;
1914
+ content: z.ZodString;
1915
+ cache_control: z.ZodOptional<z.ZodObject<{
1916
+ type: z.ZodLiteral<"ephemeral">;
1917
+ }, "strip", z.ZodTypeAny, {
1918
+ type: "ephemeral";
1919
+ }, {
1920
+ type: "ephemeral";
1921
+ }>>;
1922
+ }, "strip", z.ZodTypeAny, {
1923
+ type: "tool_result";
1924
+ content: string;
1925
+ tool_use_id: string;
1926
+ cache_control?: {
1927
+ type: "ephemeral";
1928
+ } | undefined;
1929
+ }, {
1930
+ type: "tool_result";
1931
+ content: string;
1932
+ tool_use_id: string;
1933
+ cache_control?: {
1934
+ type: "ephemeral";
1935
+ } | undefined;
1936
+ }>, z.ZodObject<{
1937
+ type: z.ZodLiteral<"image">;
1938
+ source: z.ZodObject<{
1939
+ type: z.ZodLiteral<"base64">;
1940
+ media_type: z.ZodLiteral<"image/jpeg">;
1941
+ data: z.ZodString;
1942
+ }, "strip", z.ZodTypeAny, {
1943
+ type: "base64";
1944
+ media_type: "image/jpeg";
1945
+ data: string;
1946
+ }, {
1947
+ type: "base64";
1948
+ media_type: "image/jpeg";
1949
+ data: string;
1950
+ }>;
1951
+ cache_control: z.ZodOptional<z.ZodObject<{
1952
+ type: z.ZodLiteral<"ephemeral">;
1953
+ }, "strip", z.ZodTypeAny, {
1954
+ type: "ephemeral";
1955
+ }, {
1956
+ type: "ephemeral";
1957
+ }>>;
1958
+ }, "strip", z.ZodTypeAny, {
1959
+ type: "image";
1960
+ source: {
1961
+ type: "base64";
1962
+ media_type: "image/jpeg";
1963
+ data: string;
1964
+ };
1965
+ cache_control?: {
1966
+ type: "ephemeral";
1967
+ } | undefined;
1968
+ }, {
1969
+ type: "image";
1970
+ source: {
1971
+ type: "base64";
1972
+ media_type: "image/jpeg";
1973
+ data: string;
1974
+ };
1975
+ cache_control?: {
1976
+ type: "ephemeral";
1977
+ } | undefined;
1978
+ }>]>, "many">]>;
1979
+ }, "strip", z.ZodTypeAny, {
1980
+ content: string | ({
1981
+ type: "text";
1982
+ text: string;
1983
+ cache_control?: {
1984
+ type: "ephemeral";
1985
+ } | undefined;
1986
+ } | {
1987
+ type: "tool_use";
1988
+ name: string;
1989
+ id: string;
1990
+ input: Record<string, any>;
1991
+ cache_control?: {
1992
+ type: "ephemeral";
1993
+ } | undefined;
1994
+ } | {
1995
+ type: "tool_result";
1996
+ content: string;
1997
+ tool_use_id: string;
1998
+ cache_control?: {
1999
+ type: "ephemeral";
2000
+ } | undefined;
2001
+ } | {
2002
+ type: "image";
2003
+ source: {
2004
+ type: "base64";
2005
+ media_type: "image/jpeg";
2006
+ data: string;
2007
+ };
2008
+ cache_control?: {
2009
+ type: "ephemeral";
2010
+ } | undefined;
2011
+ })[];
2012
+ role: "user" | "assistant";
2013
+ }, {
2014
+ content: string | ({
2015
+ type: "text";
2016
+ text: string;
2017
+ cache_control?: {
2018
+ type: "ephemeral";
2019
+ } | undefined;
2020
+ } | {
2021
+ type: "tool_use";
2022
+ name: string;
2023
+ id: string;
2024
+ input: Record<string, any>;
2025
+ cache_control?: {
2026
+ type: "ephemeral";
2027
+ } | undefined;
2028
+ } | {
2029
+ type: "tool_result";
2030
+ content: string;
2031
+ tool_use_id: string;
2032
+ cache_control?: {
2033
+ type: "ephemeral";
2034
+ } | undefined;
2035
+ } | {
2036
+ type: "image";
2037
+ source: {
2038
+ type: "base64";
2039
+ media_type: "image/jpeg";
2040
+ data: string;
2041
+ };
2042
+ cache_control?: {
2043
+ type: "ephemeral";
2044
+ } | undefined;
2045
+ })[];
2046
+ role: "user" | "assistant";
2047
+ }>, "many">;
2048
+ consecutiveAssistantMessages: z.ZodOptional<z.ZodNumber>;
2049
+ }, "strip", z.ZodTypeAny, {
2050
+ agentContext: string;
2051
+ fileContext: {
2052
+ currentWorkingDirectory: string;
2053
+ fileTree: import("./util/file").FileTreeNode[];
2054
+ fileTokenScores: Record<string, Record<string, number>>;
2055
+ knowledgeFiles: Record<string, string>;
2056
+ gitChanges: {
2057
+ status: string;
2058
+ diff: string;
2059
+ diffCached: string;
2060
+ lastCommitMessages: string;
2061
+ };
2062
+ changesSinceLastChat: Record<string, string>;
2063
+ shellConfigFiles: Record<string, string>;
2064
+ systemInfo: {
2065
+ platform: string;
2066
+ shell: string;
2067
+ nodeVersion: string;
2068
+ arch: string;
2069
+ homedir: string;
2070
+ cpus: number;
2071
+ };
2072
+ userKnowledgeFiles?: Record<string, string> | undefined;
2073
+ fileVersions?: {
2074
+ path: string;
2075
+ content: string;
2076
+ }[][] | undefined;
2077
+ };
2078
+ messageHistory: {
2079
+ content: string | ({
2080
+ type: "text";
2081
+ text: string;
2082
+ cache_control?: {
2083
+ type: "ephemeral";
2084
+ } | undefined;
2085
+ } | {
2086
+ type: "tool_use";
2087
+ name: string;
2088
+ id: string;
2089
+ input: Record<string, any>;
2090
+ cache_control?: {
2091
+ type: "ephemeral";
2092
+ } | undefined;
2093
+ } | {
2094
+ type: "tool_result";
2095
+ content: string;
2096
+ tool_use_id: string;
2097
+ cache_control?: {
2098
+ type: "ephemeral";
2099
+ } | undefined;
2100
+ } | {
2101
+ type: "image";
2102
+ source: {
2103
+ type: "base64";
2104
+ media_type: "image/jpeg";
2105
+ data: string;
2106
+ };
2107
+ cache_control?: {
2108
+ type: "ephemeral";
2109
+ } | undefined;
2110
+ })[];
2111
+ role: "user" | "assistant";
2112
+ }[];
2113
+ consecutiveAssistantMessages?: number | undefined;
2114
+ }, {
2115
+ agentContext: string;
2116
+ fileContext: {
2117
+ currentWorkingDirectory: string;
2118
+ fileTree: import("./util/file").FileTreeNode[];
2119
+ fileTokenScores: Record<string, Record<string, number>>;
2120
+ knowledgeFiles: Record<string, string>;
2121
+ gitChanges: {
2122
+ status: string;
2123
+ diff: string;
2124
+ diffCached: string;
2125
+ lastCommitMessages: string;
2126
+ };
2127
+ changesSinceLastChat: Record<string, string>;
2128
+ shellConfigFiles: Record<string, string>;
2129
+ systemInfo: {
2130
+ platform: string;
2131
+ shell: string;
2132
+ nodeVersion: string;
2133
+ arch: string;
2134
+ homedir: string;
2135
+ cpus: number;
2136
+ };
2137
+ userKnowledgeFiles?: Record<string, string> | undefined;
2138
+ fileVersions?: {
2139
+ path: string;
2140
+ content: string;
2141
+ }[][] | undefined;
2142
+ };
2143
+ messageHistory: {
2144
+ content: string | ({
2145
+ type: "text";
2146
+ text: string;
2147
+ cache_control?: {
2148
+ type: "ephemeral";
2149
+ } | undefined;
2150
+ } | {
2151
+ type: "tool_use";
2152
+ name: string;
2153
+ id: string;
2154
+ input: Record<string, any>;
2155
+ cache_control?: {
2156
+ type: "ephemeral";
2157
+ } | undefined;
2158
+ } | {
2159
+ type: "tool_result";
2160
+ content: string;
2161
+ tool_use_id: string;
2162
+ cache_control?: {
2163
+ type: "ephemeral";
2164
+ } | undefined;
2165
+ } | {
2166
+ type: "image";
2167
+ source: {
2168
+ type: "base64";
2169
+ media_type: "image/jpeg";
2170
+ data: string;
2171
+ };
2172
+ cache_control?: {
2173
+ type: "ephemeral";
2174
+ } | undefined;
2175
+ })[];
2176
+ role: "user" | "assistant";
2177
+ }[];
2178
+ consecutiveAssistantMessages?: number | undefined;
2179
+ }>;
2180
+ toolCalls: z.ZodArray<z.ZodObject<{
2181
+ name: z.ZodString;
2182
+ parameters: z.ZodRecord<z.ZodString, z.ZodString>;
2183
+ id: z.ZodString;
2184
+ }, "strip", z.ZodTypeAny, {
2185
+ name: string;
2186
+ id: string;
2187
+ parameters: Record<string, string>;
2188
+ }, {
2189
+ name: string;
2190
+ id: string;
2191
+ parameters: Record<string, string>;
2192
+ }>, "many">;
2193
+ toolResults: z.ZodArray<z.ZodObject<{
2194
+ name: z.ZodString;
2195
+ result: z.ZodString;
2196
+ id: z.ZodString;
2197
+ }, "strip", z.ZodTypeAny, {
2198
+ name: string;
2199
+ id: string;
2200
+ result: string;
2201
+ }, {
2202
+ name: string;
2203
+ id: string;
2204
+ result: string;
2205
+ }>, "many">;
2206
+ }, "strip", z.ZodTypeAny, {
2207
+ type: "prompt-response";
2208
+ promptId: string;
2209
+ agentState: {
2210
+ agentContext: string;
2211
+ fileContext: {
2212
+ currentWorkingDirectory: string;
2213
+ fileTree: import("./util/file").FileTreeNode[];
2214
+ fileTokenScores: Record<string, Record<string, number>>;
2215
+ knowledgeFiles: Record<string, string>;
2216
+ gitChanges: {
2217
+ status: string;
2218
+ diff: string;
2219
+ diffCached: string;
2220
+ lastCommitMessages: string;
2221
+ };
2222
+ changesSinceLastChat: Record<string, string>;
2223
+ shellConfigFiles: Record<string, string>;
2224
+ systemInfo: {
2225
+ platform: string;
2226
+ shell: string;
2227
+ nodeVersion: string;
2228
+ arch: string;
2229
+ homedir: string;
2230
+ cpus: number;
2231
+ };
2232
+ userKnowledgeFiles?: Record<string, string> | undefined;
2233
+ fileVersions?: {
2234
+ path: string;
2235
+ content: string;
2236
+ }[][] | undefined;
2237
+ };
2238
+ messageHistory: {
2239
+ content: string | ({
2240
+ type: "text";
2241
+ text: string;
2242
+ cache_control?: {
2243
+ type: "ephemeral";
2244
+ } | undefined;
2245
+ } | {
2246
+ type: "tool_use";
2247
+ name: string;
2248
+ id: string;
2249
+ input: Record<string, any>;
2250
+ cache_control?: {
2251
+ type: "ephemeral";
2252
+ } | undefined;
2253
+ } | {
2254
+ type: "tool_result";
2255
+ content: string;
2256
+ tool_use_id: string;
2257
+ cache_control?: {
2258
+ type: "ephemeral";
2259
+ } | undefined;
2260
+ } | {
2261
+ type: "image";
2262
+ source: {
2263
+ type: "base64";
2264
+ media_type: "image/jpeg";
2265
+ data: string;
2266
+ };
2267
+ cache_control?: {
2268
+ type: "ephemeral";
2269
+ } | undefined;
2270
+ })[];
2271
+ role: "user" | "assistant";
2272
+ }[];
2273
+ consecutiveAssistantMessages?: number | undefined;
2274
+ };
2275
+ toolResults: {
2276
+ name: string;
2277
+ id: string;
2278
+ result: string;
2279
+ }[];
2280
+ toolCalls: {
2281
+ name: string;
2282
+ id: string;
2283
+ parameters: Record<string, string>;
2284
+ }[];
2285
+ }, {
2286
+ type: "prompt-response";
2287
+ promptId: string;
2288
+ agentState: {
2289
+ agentContext: string;
2290
+ fileContext: {
2291
+ currentWorkingDirectory: string;
2292
+ fileTree: import("./util/file").FileTreeNode[];
2293
+ fileTokenScores: Record<string, Record<string, number>>;
2294
+ knowledgeFiles: Record<string, string>;
2295
+ gitChanges: {
2296
+ status: string;
2297
+ diff: string;
2298
+ diffCached: string;
2299
+ lastCommitMessages: string;
2300
+ };
2301
+ changesSinceLastChat: Record<string, string>;
2302
+ shellConfigFiles: Record<string, string>;
2303
+ systemInfo: {
2304
+ platform: string;
2305
+ shell: string;
2306
+ nodeVersion: string;
2307
+ arch: string;
2308
+ homedir: string;
2309
+ cpus: number;
2310
+ };
2311
+ userKnowledgeFiles?: Record<string, string> | undefined;
2312
+ fileVersions?: {
2313
+ path: string;
2314
+ content: string;
2315
+ }[][] | undefined;
2316
+ };
2317
+ messageHistory: {
2318
+ content: string | ({
2319
+ type: "text";
2320
+ text: string;
2321
+ cache_control?: {
2322
+ type: "ephemeral";
2323
+ } | undefined;
2324
+ } | {
2325
+ type: "tool_use";
2326
+ name: string;
2327
+ id: string;
2328
+ input: Record<string, any>;
2329
+ cache_control?: {
2330
+ type: "ephemeral";
2331
+ } | undefined;
2332
+ } | {
2333
+ type: "tool_result";
2334
+ content: string;
2335
+ tool_use_id: string;
2336
+ cache_control?: {
2337
+ type: "ephemeral";
2338
+ } | undefined;
2339
+ } | {
2340
+ type: "image";
2341
+ source: {
2342
+ type: "base64";
2343
+ media_type: "image/jpeg";
2344
+ data: string;
2345
+ };
2346
+ cache_control?: {
2347
+ type: "ephemeral";
2348
+ } | undefined;
2349
+ })[];
2350
+ role: "user" | "assistant";
2351
+ }[];
2352
+ consecutiveAssistantMessages?: number | undefined;
2353
+ };
2354
+ toolResults: {
2355
+ name: string;
2356
+ id: string;
2357
+ result: string;
2358
+ }[];
2359
+ toolCalls: {
2360
+ name: string;
2361
+ id: string;
2362
+ parameters: Record<string, string>;
2363
+ }[];
2364
+ }>, z.ZodObject<{
2365
+ type: z.ZodLiteral<"read-files">;
2366
+ filePaths: z.ZodArray<z.ZodString, "many">;
2367
+ requestId: z.ZodString;
2368
+ }, "strip", z.ZodTypeAny, {
2369
+ type: "read-files";
2370
+ requestId: string;
2371
+ filePaths: string[];
2372
+ }, {
2373
+ type: "read-files";
2374
+ requestId: string;
2375
+ filePaths: string[];
2376
+ }>, z.ZodObject<{
2377
+ type: z.ZodLiteral<"tool-call">;
2378
+ userInputId: z.ZodString;
2379
+ response: z.ZodString;
2380
+ data: z.ZodObject<{
2381
+ name: z.ZodString;
2382
+ id: z.ZodString;
2383
+ input: z.ZodRecord<z.ZodString, z.ZodAny>;
2384
+ }, "strip", z.ZodTypeAny, {
2385
+ name: string;
2386
+ id: string;
2387
+ input: Record<string, any>;
2388
+ }, {
2389
+ name: string;
2390
+ id: string;
2391
+ input: Record<string, any>;
2392
+ }>;
2393
+ changes: z.ZodArray<z.ZodObject<{
2394
+ type: z.ZodEnum<["patch", "file"]>;
2395
+ path: z.ZodString;
2396
+ content: z.ZodString;
2397
+ }, "strip", z.ZodTypeAny, {
2398
+ path: string;
2399
+ type: "file" | "patch";
2400
+ content: string;
2401
+ }, {
2402
+ path: string;
2403
+ type: "file" | "patch";
2404
+ content: string;
2405
+ }>, "many">;
2406
+ changesAlreadyApplied: z.ZodArray<z.ZodObject<{
2407
+ type: z.ZodEnum<["patch", "file"]>;
2408
+ path: z.ZodString;
2409
+ content: z.ZodString;
2410
+ }, "strip", z.ZodTypeAny, {
2411
+ path: string;
2412
+ type: "file" | "patch";
2413
+ content: string;
2414
+ }, {
2415
+ path: string;
2416
+ type: "file" | "patch";
2417
+ content: string;
2418
+ }>, "many">;
2419
+ addedFileVersions: z.ZodArray<z.ZodObject<{
2420
+ path: z.ZodString;
2421
+ content: z.ZodString;
2422
+ }, "strip", z.ZodTypeAny, {
2423
+ path: string;
2424
+ content: string;
2425
+ }, {
2426
+ path: string;
2427
+ content: string;
2428
+ }>, "many">;
2429
+ resetFileVersions: z.ZodBoolean;
2430
+ }, "strip", z.ZodTypeAny, {
2431
+ type: "tool-call";
2432
+ data: {
2433
+ name: string;
2434
+ id: string;
2435
+ input: Record<string, any>;
2436
+ };
2437
+ userInputId: string;
2438
+ response: string;
2439
+ changes: {
2440
+ path: string;
2441
+ type: "file" | "patch";
2442
+ content: string;
2443
+ }[];
2444
+ changesAlreadyApplied: {
2445
+ path: string;
2446
+ type: "file" | "patch";
2447
+ content: string;
2448
+ }[];
2449
+ addedFileVersions: {
2450
+ path: string;
2451
+ content: string;
2452
+ }[];
2453
+ resetFileVersions: boolean;
2454
+ }, {
2455
+ type: "tool-call";
2456
+ data: {
2457
+ name: string;
2458
+ id: string;
2459
+ input: Record<string, any>;
2460
+ };
2461
+ userInputId: string;
2462
+ response: string;
2463
+ changes: {
2464
+ path: string;
2465
+ type: "file" | "patch";
2466
+ content: string;
2467
+ }[];
2468
+ changesAlreadyApplied: {
2469
+ path: string;
2470
+ type: "file" | "patch";
2471
+ content: string;
2472
+ }[];
2473
+ addedFileVersions: {
2474
+ path: string;
2475
+ content: string;
2476
+ }[];
2477
+ resetFileVersions: boolean;
2478
+ }>, z.ZodObject<{
2479
+ type: z.ZodLiteral<"terminal-command-result">;
2480
+ userInputId: z.ZodString;
2481
+ result: z.ZodString;
2482
+ }, "strip", z.ZodTypeAny, {
2483
+ type: "terminal-command-result";
2484
+ result: string;
2485
+ userInputId: string;
2486
+ }, {
2487
+ type: "terminal-command-result";
2488
+ result: string;
2489
+ userInputId: string;
2490
+ }>, z.ZodObject<{
2491
+ type: z.ZodLiteral<"npm-version-status">;
2492
+ isUpToDate: z.ZodBoolean;
2493
+ latestVersion: z.ZodString;
2494
+ }, "strip", z.ZodTypeAny, {
2495
+ type: "npm-version-status";
2496
+ isUpToDate: boolean;
2497
+ latestVersion: string;
2498
+ }, {
2499
+ type: "npm-version-status";
2500
+ isUpToDate: boolean;
2501
+ latestVersion: string;
2502
+ }>, z.ZodObject<z.objectUtil.extendShape<{
2503
+ type: z.ZodLiteral<"init-response">;
2504
+ }, Omit<{
2505
+ type: z.ZodLiteral<"usage-response">;
2506
+ usage: z.ZodNumber;
2507
+ remainingBalance: z.ZodNumber;
2508
+ balanceBreakdown: z.ZodOptional<z.ZodRecord<z.ZodEnum<[import("./types/grant").GrantType, ...import("./types/grant").GrantType[]]>, z.ZodNumber>>;
2509
+ next_quota_reset: z.ZodNullable<z.ZodDate>;
2510
+ autoTopupAdded: z.ZodOptional<z.ZodNumber>;
2511
+ }, "type">>, "strip", z.ZodTypeAny, {
2512
+ type: "init-response";
2513
+ usage: number;
2514
+ remainingBalance: number;
2515
+ next_quota_reset: Date | null;
2516
+ balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
2517
+ autoTopupAdded?: number | undefined;
2518
+ }, {
2519
+ type: "init-response";
2520
+ usage: number;
2521
+ remainingBalance: number;
2522
+ next_quota_reset: Date | null;
2523
+ balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
2524
+ autoTopupAdded?: number | undefined;
2525
+ }>, z.ZodObject<{
2526
+ type: z.ZodLiteral<"usage-response">;
2527
+ usage: z.ZodNumber;
2528
+ remainingBalance: z.ZodNumber;
2529
+ balanceBreakdown: z.ZodOptional<z.ZodRecord<z.ZodEnum<[import("./types/grant").GrantType, ...import("./types/grant").GrantType[]]>, z.ZodNumber>>;
2530
+ next_quota_reset: z.ZodNullable<z.ZodDate>;
2531
+ autoTopupAdded: z.ZodOptional<z.ZodNumber>;
2532
+ }, "strip", z.ZodTypeAny, {
2533
+ type: "usage-response";
2534
+ usage: number;
2535
+ remainingBalance: number;
2536
+ next_quota_reset: Date | null;
2537
+ balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
2538
+ autoTopupAdded?: number | undefined;
2539
+ }, {
2540
+ type: "usage-response";
2541
+ usage: number;
2542
+ remainingBalance: number;
2543
+ next_quota_reset: Date | null;
2544
+ balanceBreakdown?: Partial<Record<import("./types/grant").GrantType, number>> | undefined;
2545
+ autoTopupAdded?: number | undefined;
2546
+ }>, z.ZodObject<{
2547
+ type: z.ZodLiteral<"message-cost-response">;
2548
+ promptId: z.ZodString;
2549
+ credits: z.ZodNumber;
2550
+ }, "strip", z.ZodTypeAny, {
2551
+ type: "message-cost-response";
2552
+ promptId: string;
2553
+ credits: number;
2554
+ }, {
2555
+ type: "message-cost-response";
2556
+ promptId: string;
2557
+ credits: number;
2558
+ }>, z.ZodObject<{
2559
+ type: z.ZodLiteral<"action-error">;
2560
+ message: z.ZodString;
2561
+ error: z.ZodOptional<z.ZodString>;
2562
+ remainingBalance: z.ZodOptional<z.ZodNumber>;
2563
+ }, "strip", z.ZodTypeAny, {
2564
+ message: string;
2565
+ type: "action-error";
2566
+ remainingBalance?: number | undefined;
2567
+ error?: string | undefined;
2568
+ }, {
2569
+ message: string;
2570
+ type: "action-error";
2571
+ remainingBalance?: number | undefined;
2572
+ error?: string | undefined;
2573
+ }>, z.ZodObject<{
2574
+ type: z.ZodLiteral<"commit-message-response">;
2575
+ commitMessage: z.ZodString;
2576
+ }, "strip", z.ZodTypeAny, {
2577
+ type: "commit-message-response";
2578
+ commitMessage: string;
2579
+ }, {
2580
+ type: "commit-message-response";
2581
+ commitMessage: string;
2582
+ }>, z.ZodObject<{
2583
+ type: z.ZodLiteral<"request-reconnect">;
2584
+ }, "strip", z.ZodTypeAny, {
2585
+ type: "request-reconnect";
2586
+ }, {
2587
+ type: "request-reconnect";
2588
+ }>]>;
2589
+ export type ServerAction = z.infer<typeof SERVER_ACTION_SCHEMA>;
2590
+ //# sourceMappingURL=actions.d.ts.map