codebuff 1.0.334 → 1.0.336

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 (379) hide show
  1. package/index.js +339 -0
  2. package/package.json +23 -72
  3. package/dist/__tests__/display.test.d.ts +0 -1
  4. package/dist/__tests__/display.test.js +0 -174
  5. package/dist/__tests__/display.test.js.map +0 -1
  6. package/dist/__tests__/rage-detectors.test.d.ts +0 -1
  7. package/dist/__tests__/rage-detectors.test.js +0 -127
  8. package/dist/__tests__/rage-detectors.test.js.map +0 -1
  9. package/dist/background-process-manager.d.ts +0 -50
  10. package/dist/background-process-manager.js +0 -364
  11. package/dist/background-process-manager.js.map +0 -1
  12. package/dist/browser-runner.d.ts +0 -35
  13. package/dist/browser-runner.js +0 -689
  14. package/dist/browser-runner.js.map +0 -1
  15. package/dist/chat-storage.d.ts +0 -2
  16. package/dist/chat-storage.js +0 -98
  17. package/dist/chat-storage.js.map +0 -1
  18. package/dist/checkpoints/checkpoint-manager.d.ts +0 -94
  19. package/dist/checkpoints/checkpoint-manager.js +0 -291
  20. package/dist/checkpoints/checkpoint-manager.js.map +0 -1
  21. package/dist/checkpoints/file-manager.d.ts +0 -72
  22. package/dist/checkpoints/file-manager.js +0 -498
  23. package/dist/checkpoints/file-manager.js.map +0 -1
  24. package/dist/cli-definitions.d.ts +0 -9
  25. package/dist/cli-definitions.js +0 -60
  26. package/dist/cli-definitions.js.map +0 -1
  27. package/dist/cli-handlers/api-key.d.ts +0 -25
  28. package/dist/cli-handlers/api-key.js +0 -66
  29. package/dist/cli-handlers/api-key.js.map +0 -1
  30. package/dist/cli-handlers/checkpoint.d.ts +0 -19
  31. package/dist/cli-handlers/checkpoint.js +0 -221
  32. package/dist/cli-handlers/checkpoint.js.map +0 -1
  33. package/dist/cli-handlers/diff.d.ts +0 -2
  34. package/dist/cli-handlers/diff.js +0 -31
  35. package/dist/cli-handlers/diff.js.map +0 -1
  36. package/dist/cli-handlers/easter-egg.d.ts +0 -1
  37. package/dist/cli-handlers/easter-egg.js +0 -126
  38. package/dist/cli-handlers/easter-egg.js.map +0 -1
  39. package/dist/cli-handlers/inititalization-flow.d.ts +0 -1
  40. package/dist/cli-handlers/inititalization-flow.js +0 -25
  41. package/dist/cli-handlers/inititalization-flow.js.map +0 -1
  42. package/dist/cli.d.ts +0 -67
  43. package/dist/cli.js +0 -812
  44. package/dist/cli.js.map +0 -1
  45. package/dist/client.d.ts +0 -91
  46. package/dist/client.js +0 -1112
  47. package/dist/client.js.map +0 -1
  48. package/dist/code-map/languages.d.ts +0 -12
  49. package/dist/code-map/languages.d.ts.map +0 -1
  50. package/dist/code-map/languages.js +0 -130
  51. package/dist/code-map/languages.js.map +0 -1
  52. package/dist/code-map/parse.d.ts +0 -22
  53. package/dist/code-map/parse.d.ts.map +0 -1
  54. package/dist/code-map/parse.js +0 -180
  55. package/dist/code-map/parse.js.map +0 -1
  56. package/dist/code-map/tree-sitter-queries/readme.md +0 -23
  57. package/dist/code-map/tree-sitter-queries/tree-sitter-c-tags.scm +0 -16
  58. package/dist/code-map/tree-sitter-queries/tree-sitter-c_sharp-tags.scm +0 -23
  59. package/dist/code-map/tree-sitter-queries/tree-sitter-cpp-tags.scm +0 -29
  60. package/dist/code-map/tree-sitter-queries/tree-sitter-go-tags.scm +0 -26
  61. package/dist/code-map/tree-sitter-queries/tree-sitter-java-tags.scm +0 -19
  62. package/dist/code-map/tree-sitter-queries/tree-sitter-javascript-tags.scm +0 -16
  63. package/dist/code-map/tree-sitter-queries/tree-sitter-php-tags.scm +0 -23
  64. package/dist/code-map/tree-sitter-queries/tree-sitter-python-tags.scm +0 -12
  65. package/dist/code-map/tree-sitter-queries/tree-sitter-ruby-tags.scm +0 -58
  66. package/dist/code-map/tree-sitter-queries/tree-sitter-rust-tags.scm +0 -26
  67. package/dist/code-map/tree-sitter-queries/tree-sitter-typescript-tags.scm +0 -22
  68. package/dist/code-map/tsconfig.tsbuildinfo +0 -1
  69. package/dist/common/actions.d.ts +0 -1809
  70. package/dist/common/actions.d.ts.map +0 -1
  71. package/dist/common/actions.js +0 -140
  72. package/dist/common/actions.js.map +0 -1
  73. package/dist/common/analytics.d.ts +0 -6
  74. package/dist/common/analytics.d.ts.map +0 -1
  75. package/dist/common/analytics.js +0 -60
  76. package/dist/common/analytics.js.map +0 -1
  77. package/dist/common/api-keys/constants.d.ts +0 -9
  78. package/dist/common/api-keys/constants.d.ts.map +0 -1
  79. package/dist/common/api-keys/constants.js +0 -26
  80. package/dist/common/api-keys/constants.js.map +0 -1
  81. package/dist/common/api-keys/crypto.d.ts +0 -25
  82. package/dist/common/api-keys/crypto.d.ts.map +0 -1
  83. package/dist/common/api-keys/crypto.js +0 -186
  84. package/dist/common/api-keys/crypto.js.map +0 -1
  85. package/dist/common/browser-actions.d.ts +0 -4416
  86. package/dist/common/browser-actions.d.ts.map +0 -1
  87. package/dist/common/browser-actions.js +0 -343
  88. package/dist/common/browser-actions.js.map +0 -1
  89. package/dist/common/constants/analytics-events.d.ts +0 -31
  90. package/dist/common/constants/analytics-events.d.ts.map +0 -1
  91. package/dist/common/constants/analytics-events.js +0 -39
  92. package/dist/common/constants/analytics-events.js.map +0 -1
  93. package/dist/common/constants/grant-priorities.d.ts +0 -3
  94. package/dist/common/constants/grant-priorities.d.ts.map +0 -1
  95. package/dist/common/constants/grant-priorities.js +0 -11
  96. package/dist/common/constants/grant-priorities.js.map +0 -1
  97. package/dist/common/constants/tools.d.ts +0 -19
  98. package/dist/common/constants/tools.d.ts.map +0 -1
  99. package/dist/common/constants/tools.js +0 -45
  100. package/dist/common/constants/tools.js.map +0 -1
  101. package/dist/common/constants.d.ts +0 -149
  102. package/dist/common/constants.d.ts.map +0 -1
  103. package/dist/common/constants.js +0 -234
  104. package/dist/common/constants.js.map +0 -1
  105. package/dist/common/db/drizzle.config.d.ts +0 -3
  106. package/dist/common/db/drizzle.config.d.ts.map +0 -1
  107. package/dist/common/db/drizzle.config.js +0 -17
  108. package/dist/common/db/drizzle.config.js.map +0 -1
  109. package/dist/common/db/index.d.ts +0 -7
  110. package/dist/common/db/index.d.ts.map +0 -1
  111. package/dist/common/db/index.js +0 -35
  112. package/dist/common/db/index.js.map +0 -1
  113. package/dist/common/db/schema.d.ts +0 -2449
  114. package/dist/common/db/schema.d.ts.map +0 -1
  115. package/dist/common/db/schema.js +0 -310
  116. package/dist/common/db/schema.js.map +0 -1
  117. package/dist/common/db/transaction.d.ts +0 -13
  118. package/dist/common/db/transaction.d.ts.map +0 -1
  119. package/dist/common/db/transaction.js +0 -36
  120. package/dist/common/db/transaction.js.map +0 -1
  121. package/dist/common/json-config/__tests__/__snapshots__/stringify-schema.test.js.snap +0 -144
  122. package/dist/common/json-config/__tests__/constants.test.d.ts +0 -2
  123. package/dist/common/json-config/__tests__/constants.test.d.ts.map +0 -1
  124. package/dist/common/json-config/__tests__/constants.test.js +0 -273
  125. package/dist/common/json-config/__tests__/constants.test.js.map +0 -1
  126. package/dist/common/json-config/__tests__/stringify-schema.test.d.ts +0 -2
  127. package/dist/common/json-config/__tests__/stringify-schema.test.d.ts.map +0 -1
  128. package/dist/common/json-config/__tests__/stringify-schema.test.js +0 -66
  129. package/dist/common/json-config/__tests__/stringify-schema.test.js.map +0 -1
  130. package/dist/common/json-config/constants.d.ts +0 -138
  131. package/dist/common/json-config/constants.d.ts.map +0 -1
  132. package/dist/common/json-config/constants.js +0 -78
  133. package/dist/common/json-config/constants.js.map +0 -1
  134. package/dist/common/json-config/default.d.ts +0 -3
  135. package/dist/common/json-config/default.d.ts.map +0 -1
  136. package/dist/common/json-config/default.js +0 -12
  137. package/dist/common/json-config/default.js.map +0 -1
  138. package/dist/common/json-config/stringify-schema.d.ts +0 -10
  139. package/dist/common/json-config/stringify-schema.d.ts.map +0 -1
  140. package/dist/common/json-config/stringify-schema.js +0 -131
  141. package/dist/common/json-config/stringify-schema.js.map +0 -1
  142. package/dist/common/project-file-tree.d.ts +0 -12
  143. package/dist/common/project-file-tree.d.ts.map +0 -1
  144. package/dist/common/project-file-tree.js +0 -212
  145. package/dist/common/project-file-tree.js.map +0 -1
  146. package/dist/common/types/agent-state.d.ts +0 -265
  147. package/dist/common/types/agent-state.d.ts.map +0 -1
  148. package/dist/common/types/agent-state.js +0 -48
  149. package/dist/common/types/agent-state.js.map +0 -1
  150. package/dist/common/types/grant.d.ts +0 -3
  151. package/dist/common/types/grant.d.ts.map +0 -1
  152. package/dist/common/types/grant.js +0 -11
  153. package/dist/common/types/grant.js.map +0 -1
  154. package/dist/common/types/message.d.ts +0 -320
  155. package/dist/common/types/message.d.ts.map +0 -1
  156. package/dist/common/types/message.js +0 -60
  157. package/dist/common/types/message.js.map +0 -1
  158. package/dist/common/types/organization.d.ts +0 -106
  159. package/dist/common/types/organization.d.ts.map +0 -1
  160. package/dist/common/types/organization.js +0 -3
  161. package/dist/common/types/organization.js.map +0 -1
  162. package/dist/common/types/referral.d.ts +0 -3
  163. package/dist/common/types/referral.d.ts.map +0 -1
  164. package/dist/common/types/referral.js +0 -5
  165. package/dist/common/types/referral.js.map +0 -1
  166. package/dist/common/types/tools.d.ts +0 -6
  167. package/dist/common/types/tools.d.ts.map +0 -1
  168. package/dist/common/types/tools.js +0 -3
  169. package/dist/common/types/tools.js.map +0 -1
  170. package/dist/common/types/usage.d.ts +0 -41
  171. package/dist/common/types/usage.d.ts.map +0 -1
  172. package/dist/common/types/usage.js +0 -16
  173. package/dist/common/types/usage.js.map +0 -1
  174. package/dist/common/util/__tests__/messages.test.d.ts +0 -2
  175. package/dist/common/util/__tests__/messages.test.d.ts.map +0 -1
  176. package/dist/common/util/__tests__/messages.test.js +0 -70
  177. package/dist/common/util/__tests__/messages.test.js.map +0 -1
  178. package/dist/common/util/__tests__/saxy.test.d.ts +0 -2
  179. package/dist/common/util/__tests__/saxy.test.d.ts.map +0 -1
  180. package/dist/common/util/__tests__/saxy.test.js +0 -906
  181. package/dist/common/util/__tests__/saxy.test.js.map +0 -1
  182. package/dist/common/util/__tests__/string.test.d.ts +0 -2
  183. package/dist/common/util/__tests__/string.test.d.ts.map +0 -1
  184. package/dist/common/util/__tests__/string.test.js +0 -82
  185. package/dist/common/util/__tests__/string.test.js.map +0 -1
  186. package/dist/common/util/array.d.ts +0 -7
  187. package/dist/common/util/array.d.ts.map +0 -1
  188. package/dist/common/util/array.js +0 -32
  189. package/dist/common/util/array.js.map +0 -1
  190. package/dist/common/util/changes.d.ts +0 -9
  191. package/dist/common/util/changes.d.ts.map +0 -1
  192. package/dist/common/util/changes.js +0 -87
  193. package/dist/common/util/changes.js.map +0 -1
  194. package/dist/common/util/credentials.d.ts +0 -26
  195. package/dist/common/util/credentials.d.ts.map +0 -1
  196. package/dist/common/util/credentials.js +0 -24
  197. package/dist/common/util/credentials.js.map +0 -1
  198. package/dist/common/util/currency.d.ts +0 -15
  199. package/dist/common/util/currency.d.ts.map +0 -1
  200. package/dist/common/util/currency.js +0 -23
  201. package/dist/common/util/currency.js.map +0 -1
  202. package/dist/common/util/dates.d.ts +0 -11
  203. package/dist/common/util/dates.d.ts.map +0 -1
  204. package/dist/common/util/dates.js +0 -22
  205. package/dist/common/util/dates.js.map +0 -1
  206. package/dist/common/util/file.d.ts +0 -171
  207. package/dist/common/util/file.d.ts.map +0 -1
  208. package/dist/common/util/file.js +0 -216
  209. package/dist/common/util/file.js.map +0 -1
  210. package/dist/common/util/git.d.ts +0 -7
  211. package/dist/common/util/git.d.ts.map +0 -1
  212. package/dist/common/util/git.js +0 -81
  213. package/dist/common/util/git.js.map +0 -1
  214. package/dist/common/util/logger.d.ts +0 -9
  215. package/dist/common/util/logger.d.ts.map +0 -1
  216. package/dist/common/util/logger.js +0 -52
  217. package/dist/common/util/logger.js.map +0 -1
  218. package/dist/common/util/lru-cache.d.ts +0 -31
  219. package/dist/common/util/lru-cache.d.ts.map +0 -1
  220. package/dist/common/util/lru-cache.js +0 -68
  221. package/dist/common/util/lru-cache.js.map +0 -1
  222. package/dist/common/util/messages.d.ts +0 -12
  223. package/dist/common/util/messages.d.ts.map +0 -1
  224. package/dist/common/util/messages.js +0 -81
  225. package/dist/common/util/messages.js.map +0 -1
  226. package/dist/common/util/min-heap.d.ts +0 -16
  227. package/dist/common/util/min-heap.d.ts.map +0 -1
  228. package/dist/common/util/min-heap.js +0 -73
  229. package/dist/common/util/min-heap.js.map +0 -1
  230. package/dist/common/util/object.d.ts +0 -19
  231. package/dist/common/util/object.d.ts.map +0 -1
  232. package/dist/common/util/object.js +0 -91
  233. package/dist/common/util/object.js.map +0 -1
  234. package/dist/common/util/patch.d.ts +0 -2
  235. package/dist/common/util/patch.d.ts.map +0 -1
  236. package/dist/common/util/patch.js +0 -215
  237. package/dist/common/util/patch.js.map +0 -1
  238. package/dist/common/util/promise.d.ts +0 -17
  239. package/dist/common/util/promise.d.ts.map +0 -1
  240. package/dist/common/util/promise.js +0 -51
  241. package/dist/common/util/promise.js.map +0 -1
  242. package/dist/common/util/random.d.ts +0 -2
  243. package/dist/common/util/random.d.ts.map +0 -1
  244. package/dist/common/util/random.js +0 -17
  245. package/dist/common/util/random.js.map +0 -1
  246. package/dist/common/util/referral.d.ts +0 -2
  247. package/dist/common/util/referral.d.ts.map +0 -1
  248. package/dist/common/util/referral.js +0 -6
  249. package/dist/common/util/referral.js.map +0 -1
  250. package/dist/common/util/saxy.d.ts +0 -179
  251. package/dist/common/util/saxy.d.ts.map +0 -1
  252. package/dist/common/util/saxy.js +0 -548
  253. package/dist/common/util/saxy.js.map +0 -1
  254. package/dist/common/util/string.d.ts +0 -80
  255. package/dist/common/util/string.d.ts.map +0 -1
  256. package/dist/common/util/string.js +0 -275
  257. package/dist/common/util/string.js.map +0 -1
  258. package/dist/common/util/stripe.d.ts +0 -4
  259. package/dist/common/util/stripe.d.ts.map +0 -1
  260. package/dist/common/util/stripe.js +0 -22
  261. package/dist/common/util/stripe.js.map +0 -1
  262. package/dist/common/util/sync-failure.d.ts +0 -2
  263. package/dist/common/util/sync-failure.d.ts.map +0 -1
  264. package/dist/common/util/sync-failure.js +0 -57
  265. package/dist/common/util/sync-failure.js.map +0 -1
  266. package/dist/common/websockets/websocket-client.d.ts +0 -43
  267. package/dist/common/websockets/websocket-client.d.ts.map +0 -1
  268. package/dist/common/websockets/websocket-client.js +0 -216
  269. package/dist/common/websockets/websocket-client.js.map +0 -1
  270. package/dist/common/websockets/websocket-schema.d.ts +0 -3679
  271. package/dist/common/websockets/websocket-schema.d.ts.map +0 -1
  272. package/dist/common/websockets/websocket-schema.js +0 -55
  273. package/dist/common/websockets/websocket-schema.js.map +0 -1
  274. package/dist/config.d.ts +0 -4
  275. package/dist/config.js +0 -12
  276. package/dist/config.js.map +0 -1
  277. package/dist/create-template-project.d.ts +0 -1
  278. package/dist/create-template-project.js +0 -131
  279. package/dist/create-template-project.js.map +0 -1
  280. package/dist/credentials.d.ts +0 -4
  281. package/dist/credentials.js +0 -44
  282. package/dist/credentials.js.map +0 -1
  283. package/dist/dev-process-manager.d.ts +0 -10
  284. package/dist/dev-process-manager.js +0 -56
  285. package/dist/dev-process-manager.js.map +0 -1
  286. package/dist/display.d.ts +0 -9
  287. package/dist/display.js +0 -137
  288. package/dist/display.js.map +0 -1
  289. package/dist/fingerprint.d.ts +0 -1
  290. package/dist/fingerprint.js +0 -48
  291. package/dist/fingerprint.js.map +0 -1
  292. package/dist/index.d.ts +0 -2
  293. package/dist/index.js +0 -128
  294. package/dist/index.js.map +0 -1
  295. package/dist/json-config/hooks.d.ts +0 -9
  296. package/dist/json-config/hooks.js +0 -60
  297. package/dist/json-config/hooks.js.map +0 -1
  298. package/dist/json-config/parser.d.ts +0 -7
  299. package/dist/json-config/parser.js +0 -54
  300. package/dist/json-config/parser.js.map +0 -1
  301. package/dist/menu.d.ts +0 -14
  302. package/dist/menu.js +0 -344
  303. package/dist/menu.js.map +0 -1
  304. package/dist/project-files.d.ts +0 -104
  305. package/dist/project-files.js +0 -621
  306. package/dist/project-files.js.map +0 -1
  307. package/dist/rage-detectors.d.ts +0 -15
  308. package/dist/rage-detectors.js +0 -55
  309. package/dist/rage-detectors.js.map +0 -1
  310. package/dist/startup-process-handler.d.ts +0 -1
  311. package/dist/startup-process-handler.js +0 -25
  312. package/dist/startup-process-handler.js.map +0 -1
  313. package/dist/terminal/background.d.ts +0 -12
  314. package/dist/terminal/background.js +0 -148
  315. package/dist/terminal/background.js.map +0 -1
  316. package/dist/terminal/base.d.ts +0 -41
  317. package/dist/terminal/base.js +0 -553
  318. package/dist/terminal/base.js.map +0 -1
  319. package/dist/tool-handlers.d.ts +0 -31
  320. package/dist/tool-handlers.js +0 -275
  321. package/dist/tool-handlers.js.map +0 -1
  322. package/dist/types.d.ts +0 -15
  323. package/dist/types.js +0 -3
  324. package/dist/types.js.map +0 -1
  325. package/dist/update-codebuff.d.ts +0 -1
  326. package/dist/update-codebuff.js +0 -169
  327. package/dist/update-codebuff.js.map +0 -1
  328. package/dist/utils/__tests__/background-process-manager.test.d.ts +0 -1
  329. package/dist/utils/__tests__/background-process-manager.test.js +0 -326
  330. package/dist/utils/__tests__/background-process-manager.test.js.map +0 -1
  331. package/dist/utils/__tests__/rage-detector.test.d.ts +0 -1
  332. package/dist/utils/__tests__/rage-detector.test.js +0 -450
  333. package/dist/utils/__tests__/rage-detector.test.js.map +0 -1
  334. package/dist/utils/__tests__/response-example-4-files.txt +0 -621
  335. package/dist/utils/__tests__/tool-renderers.test.d.ts +0 -1
  336. package/dist/utils/__tests__/tool-renderers.test.js +0 -83
  337. package/dist/utils/__tests__/tool-renderers.test.js.map +0 -1
  338. package/dist/utils/__tests__/xml-stream-parser.test.d.ts +0 -1
  339. package/dist/utils/__tests__/xml-stream-parser.test.js +0 -255
  340. package/dist/utils/__tests__/xml-stream-parser.test.js.map +0 -1
  341. package/dist/utils/analytics.d.ts +0 -7
  342. package/dist/utils/analytics.js +0 -132
  343. package/dist/utils/analytics.js.map +0 -1
  344. package/dist/utils/detect-shell.d.ts +0 -1
  345. package/dist/utils/detect-shell.js +0 -65
  346. package/dist/utils/detect-shell.js.map +0 -1
  347. package/dist/utils/git.d.ts +0 -13
  348. package/dist/utils/git.js +0 -143
  349. package/dist/utils/git.js.map +0 -1
  350. package/dist/utils/logger.d.ts +0 -21
  351. package/dist/utils/logger.js +0 -109
  352. package/dist/utils/logger.js.map +0 -1
  353. package/dist/utils/rage-detector.d.ts +0 -32
  354. package/dist/utils/rage-detector.js +0 -143
  355. package/dist/utils/rage-detector.js.map +0 -1
  356. package/dist/utils/spinner.d.ts +0 -13
  357. package/dist/utils/spinner.js +0 -94
  358. package/dist/utils/spinner.js.map +0 -1
  359. package/dist/utils/system-info.d.ts +0 -8
  360. package/dist/utils/system-info.js +0 -22
  361. package/dist/utils/system-info.js.map +0 -1
  362. package/dist/utils/tool-renderers.d.ts +0 -16
  363. package/dist/utils/tool-renderers.js +0 -216
  364. package/dist/utils/tool-renderers.js.map +0 -1
  365. package/dist/utils/with-hang-detection.d.ts +0 -1
  366. package/dist/utils/with-hang-detection.js +0 -18
  367. package/dist/utils/with-hang-detection.js.map +0 -1
  368. package/dist/utils/xml-stream-parser.d.ts +0 -9
  369. package/dist/utils/xml-stream-parser.js +0 -143
  370. package/dist/utils/xml-stream-parser.js.map +0 -1
  371. package/dist/web-scraper.d.ts +0 -3
  372. package/dist/web-scraper.js +0 -59
  373. package/dist/web-scraper.js.map +0 -1
  374. package/dist/workers/checkpoint-worker.d.ts +0 -1
  375. package/dist/workers/checkpoint-worker.js +0 -51
  376. package/dist/workers/checkpoint-worker.js.map +0 -1
  377. package/dist/workers/project-context.d.ts +0 -1
  378. package/dist/workers/project-context.js +0 -27
  379. package/dist/workers/project-context.js.map +0 -1
@@ -1,3679 +0,0 @@
1
- import { z } from 'zod';
2
- export declare const CLIENT_MESSAGE_SCHEMAS: {
3
- readonly identify: z.ZodObject<{
4
- type: z.ZodLiteral<"identify">;
5
- txid: z.ZodNumber;
6
- clientSessionId: z.ZodString;
7
- }, "strip", z.ZodTypeAny, {
8
- type: "identify";
9
- txid: number;
10
- clientSessionId: string;
11
- }, {
12
- type: "identify";
13
- txid: number;
14
- clientSessionId: string;
15
- }>;
16
- readonly subscribe: z.ZodObject<{
17
- type: z.ZodLiteral<"subscribe">;
18
- txid: z.ZodNumber;
19
- topics: z.ZodArray<z.ZodString, "many">;
20
- }, "strip", z.ZodTypeAny, {
21
- type: "subscribe";
22
- txid: number;
23
- topics: string[];
24
- }, {
25
- type: "subscribe";
26
- txid: number;
27
- topics: string[];
28
- }>;
29
- readonly unsubscribe: z.ZodObject<{
30
- type: z.ZodLiteral<"unsubscribe">;
31
- txid: z.ZodNumber;
32
- topics: z.ZodArray<z.ZodString, "many">;
33
- }, "strip", z.ZodTypeAny, {
34
- type: "unsubscribe";
35
- txid: number;
36
- topics: string[];
37
- }, {
38
- type: "unsubscribe";
39
- txid: number;
40
- topics: string[];
41
- }>;
42
- readonly ping: z.ZodObject<{
43
- type: z.ZodLiteral<"ping">;
44
- txid: z.ZodNumber;
45
- }, "strip", z.ZodTypeAny, {
46
- type: "ping";
47
- txid: number;
48
- }, {
49
- type: "ping";
50
- txid: number;
51
- }>;
52
- readonly action: z.ZodObject<{
53
- type: z.ZodLiteral<"action">;
54
- txid: z.ZodNumber;
55
- data: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
56
- type: z.ZodLiteral<"prompt">;
57
- promptId: z.ZodString;
58
- prompt: z.ZodUnion<[z.ZodString, z.ZodUndefined]>;
59
- fingerprintId: z.ZodString;
60
- authToken: z.ZodOptional<z.ZodString>;
61
- costMode: z.ZodDefault<z.ZodOptional<z.ZodEnum<["lite", "normal", "max", "experimental", "ask"]>>>;
62
- agentState: z.ZodObject<{
63
- agentContext: z.ZodString;
64
- fileContext: z.ZodObject<{
65
- projectRoot: z.ZodString;
66
- cwd: z.ZodString;
67
- fileTree: z.ZodArray<z.ZodType<import("../util/file").FileTreeNode, z.ZodTypeDef, import("../util/file").FileTreeNode>, "many">;
68
- fileTokenScores: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodNumber>>;
69
- tokenCallers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>>;
70
- knowledgeFiles: z.ZodRecord<z.ZodString, z.ZodString>;
71
- userKnowledgeFiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
72
- gitChanges: z.ZodObject<{
73
- status: z.ZodString;
74
- diff: z.ZodString;
75
- diffCached: z.ZodString;
76
- lastCommitMessages: z.ZodString;
77
- }, "strip", z.ZodTypeAny, {
78
- status: string;
79
- diff: string;
80
- diffCached: string;
81
- lastCommitMessages: string;
82
- }, {
83
- status: string;
84
- diff: string;
85
- diffCached: string;
86
- lastCommitMessages: string;
87
- }>;
88
- changesSinceLastChat: z.ZodRecord<z.ZodString, z.ZodString>;
89
- shellConfigFiles: z.ZodRecord<z.ZodString, z.ZodString>;
90
- systemInfo: z.ZodObject<{
91
- platform: z.ZodString;
92
- shell: z.ZodString;
93
- nodeVersion: z.ZodString;
94
- arch: z.ZodString;
95
- homedir: z.ZodString;
96
- cpus: z.ZodNumber;
97
- }, "strip", z.ZodTypeAny, {
98
- platform: string;
99
- shell: string;
100
- nodeVersion: string;
101
- arch: string;
102
- homedir: string;
103
- cpus: number;
104
- }, {
105
- platform: string;
106
- shell: string;
107
- nodeVersion: string;
108
- arch: string;
109
- homedir: string;
110
- cpus: number;
111
- }>;
112
- fileVersions: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodObject<{
113
- path: z.ZodString;
114
- content: z.ZodString;
115
- }, "strip", z.ZodTypeAny, {
116
- path: string;
117
- content: string;
118
- }, {
119
- path: string;
120
- content: string;
121
- }>, "many">, "many">>;
122
- }, "strip", z.ZodTypeAny, {
123
- projectRoot: string;
124
- cwd: string;
125
- fileTree: import("../util/file").FileTreeNode[];
126
- fileTokenScores: Record<string, Record<string, number>>;
127
- knowledgeFiles: Record<string, string>;
128
- gitChanges: {
129
- status: string;
130
- diff: string;
131
- diffCached: string;
132
- lastCommitMessages: string;
133
- };
134
- changesSinceLastChat: Record<string, string>;
135
- shellConfigFiles: Record<string, string>;
136
- systemInfo: {
137
- platform: string;
138
- shell: string;
139
- nodeVersion: string;
140
- arch: string;
141
- homedir: string;
142
- cpus: number;
143
- };
144
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
145
- userKnowledgeFiles?: Record<string, string> | undefined;
146
- fileVersions?: {
147
- path: string;
148
- content: string;
149
- }[][] | undefined;
150
- }, {
151
- projectRoot: string;
152
- cwd: string;
153
- fileTree: import("../util/file").FileTreeNode[];
154
- fileTokenScores: Record<string, Record<string, number>>;
155
- knowledgeFiles: Record<string, string>;
156
- gitChanges: {
157
- status: string;
158
- diff: string;
159
- diffCached: string;
160
- lastCommitMessages: string;
161
- };
162
- changesSinceLastChat: Record<string, string>;
163
- shellConfigFiles: Record<string, string>;
164
- systemInfo: {
165
- platform: string;
166
- shell: string;
167
- nodeVersion: string;
168
- arch: string;
169
- homedir: string;
170
- cpus: number;
171
- };
172
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
173
- userKnowledgeFiles?: Record<string, string> | undefined;
174
- fileVersions?: {
175
- path: string;
176
- content: string;
177
- }[][] | undefined;
178
- }>;
179
- messageHistory: z.ZodArray<z.ZodIntersection<z.ZodType<import("ai").CoreMessage, z.ZodTypeDef, import("ai").CoreMessage>, z.ZodObject<{
180
- timeToLive: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"agentStep">, z.ZodLiteral<"userPrompt">]>>;
181
- }, "strip", z.ZodTypeAny, {
182
- timeToLive?: "agentStep" | "userPrompt" | undefined;
183
- }, {
184
- timeToLive?: "agentStep" | "userPrompt" | undefined;
185
- }>>, "many">;
186
- agents: z.ZodDefault<z.ZodArray<z.ZodType<{
187
- agentId: string;
188
- agentName: import("../types/agent-state").AgentTemplateName;
189
- agents: import("../types/agent-state").SubagentState[];
190
- messageHistory: import("../types/message").CodebuffMessage[];
191
- }, z.ZodTypeDef, {
192
- agentId: string;
193
- agentName: import("../types/agent-state").AgentTemplateName;
194
- agents: import("../types/agent-state").SubagentState[];
195
- messageHistory: import("../types/message").CodebuffMessage[];
196
- }>, "many">>;
197
- agentStepsRemaining: z.ZodNumber;
198
- }, "strip", z.ZodTypeAny, {
199
- agentContext: string;
200
- fileContext: {
201
- projectRoot: string;
202
- cwd: string;
203
- fileTree: import("../util/file").FileTreeNode[];
204
- fileTokenScores: Record<string, Record<string, number>>;
205
- knowledgeFiles: Record<string, string>;
206
- gitChanges: {
207
- status: string;
208
- diff: string;
209
- diffCached: string;
210
- lastCommitMessages: string;
211
- };
212
- changesSinceLastChat: Record<string, string>;
213
- shellConfigFiles: Record<string, string>;
214
- systemInfo: {
215
- platform: string;
216
- shell: string;
217
- nodeVersion: string;
218
- arch: string;
219
- homedir: string;
220
- cpus: number;
221
- };
222
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
223
- userKnowledgeFiles?: Record<string, string> | undefined;
224
- fileVersions?: {
225
- path: string;
226
- content: string;
227
- }[][] | undefined;
228
- };
229
- messageHistory: (import("ai").CoreMessage & {
230
- timeToLive?: "agentStep" | "userPrompt" | undefined;
231
- })[];
232
- agents: {
233
- agentId: string;
234
- agentName: import("../types/agent-state").AgentTemplateName;
235
- agents: import("../types/agent-state").SubagentState[];
236
- messageHistory: import("../types/message").CodebuffMessage[];
237
- }[];
238
- agentStepsRemaining: number;
239
- }, {
240
- agentContext: string;
241
- fileContext: {
242
- projectRoot: string;
243
- cwd: string;
244
- fileTree: import("../util/file").FileTreeNode[];
245
- fileTokenScores: Record<string, Record<string, number>>;
246
- knowledgeFiles: Record<string, string>;
247
- gitChanges: {
248
- status: string;
249
- diff: string;
250
- diffCached: string;
251
- lastCommitMessages: string;
252
- };
253
- changesSinceLastChat: Record<string, string>;
254
- shellConfigFiles: Record<string, string>;
255
- systemInfo: {
256
- platform: string;
257
- shell: string;
258
- nodeVersion: string;
259
- arch: string;
260
- homedir: string;
261
- cpus: number;
262
- };
263
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
264
- userKnowledgeFiles?: Record<string, string> | undefined;
265
- fileVersions?: {
266
- path: string;
267
- content: string;
268
- }[][] | undefined;
269
- };
270
- messageHistory: (import("ai").CoreMessage & {
271
- timeToLive?: "agentStep" | "userPrompt" | undefined;
272
- })[];
273
- agentStepsRemaining: number;
274
- agents?: {
275
- agentId: string;
276
- agentName: import("../types/agent-state").AgentTemplateName;
277
- agents: import("../types/agent-state").SubagentState[];
278
- messageHistory: import("../types/message").CodebuffMessage[];
279
- }[] | undefined;
280
- }>;
281
- toolResults: z.ZodArray<z.ZodObject<{
282
- toolName: z.ZodString;
283
- toolCallId: z.ZodString;
284
- result: z.ZodString;
285
- }, "strip", z.ZodTypeAny, {
286
- toolName: string;
287
- toolCallId: string;
288
- result: string;
289
- }, {
290
- toolName: string;
291
- toolCallId: string;
292
- result: string;
293
- }>, "many">;
294
- model: z.ZodOptional<z.ZodString>;
295
- repoUrl: z.ZodOptional<z.ZodString>;
296
- }, "strip", z.ZodTypeAny, {
297
- type: "prompt";
298
- promptId: string;
299
- fingerprintId: string;
300
- costMode: "max" | "lite" | "normal" | "experimental" | "ask";
301
- agentState: {
302
- agentContext: string;
303
- fileContext: {
304
- projectRoot: string;
305
- cwd: string;
306
- fileTree: import("../util/file").FileTreeNode[];
307
- fileTokenScores: Record<string, Record<string, number>>;
308
- knowledgeFiles: Record<string, string>;
309
- gitChanges: {
310
- status: string;
311
- diff: string;
312
- diffCached: string;
313
- lastCommitMessages: string;
314
- };
315
- changesSinceLastChat: Record<string, string>;
316
- shellConfigFiles: Record<string, string>;
317
- systemInfo: {
318
- platform: string;
319
- shell: string;
320
- nodeVersion: string;
321
- arch: string;
322
- homedir: string;
323
- cpus: number;
324
- };
325
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
326
- userKnowledgeFiles?: Record<string, string> | undefined;
327
- fileVersions?: {
328
- path: string;
329
- content: string;
330
- }[][] | undefined;
331
- };
332
- messageHistory: (import("ai").CoreMessage & {
333
- timeToLive?: "agentStep" | "userPrompt" | undefined;
334
- })[];
335
- agents: {
336
- agentId: string;
337
- agentName: import("../types/agent-state").AgentTemplateName;
338
- agents: import("../types/agent-state").SubagentState[];
339
- messageHistory: import("../types/message").CodebuffMessage[];
340
- }[];
341
- agentStepsRemaining: number;
342
- };
343
- toolResults: {
344
- toolName: string;
345
- toolCallId: string;
346
- result: string;
347
- }[];
348
- prompt?: string | undefined;
349
- authToken?: string | undefined;
350
- model?: string | undefined;
351
- repoUrl?: string | undefined;
352
- }, {
353
- type: "prompt";
354
- promptId: string;
355
- fingerprintId: string;
356
- agentState: {
357
- agentContext: string;
358
- fileContext: {
359
- projectRoot: string;
360
- cwd: string;
361
- fileTree: import("../util/file").FileTreeNode[];
362
- fileTokenScores: Record<string, Record<string, number>>;
363
- knowledgeFiles: Record<string, string>;
364
- gitChanges: {
365
- status: string;
366
- diff: string;
367
- diffCached: string;
368
- lastCommitMessages: string;
369
- };
370
- changesSinceLastChat: Record<string, string>;
371
- shellConfigFiles: Record<string, string>;
372
- systemInfo: {
373
- platform: string;
374
- shell: string;
375
- nodeVersion: string;
376
- arch: string;
377
- homedir: string;
378
- cpus: number;
379
- };
380
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
381
- userKnowledgeFiles?: Record<string, string> | undefined;
382
- fileVersions?: {
383
- path: string;
384
- content: string;
385
- }[][] | undefined;
386
- };
387
- messageHistory: (import("ai").CoreMessage & {
388
- timeToLive?: "agentStep" | "userPrompt" | undefined;
389
- })[];
390
- agentStepsRemaining: number;
391
- agents?: {
392
- agentId: string;
393
- agentName: import("../types/agent-state").AgentTemplateName;
394
- agents: import("../types/agent-state").SubagentState[];
395
- messageHistory: import("../types/message").CodebuffMessage[];
396
- }[] | undefined;
397
- };
398
- toolResults: {
399
- toolName: string;
400
- toolCallId: string;
401
- result: string;
402
- }[];
403
- prompt?: string | undefined;
404
- authToken?: string | undefined;
405
- costMode?: "max" | "lite" | "normal" | "experimental" | "ask" | undefined;
406
- model?: string | undefined;
407
- repoUrl?: string | undefined;
408
- }>, z.ZodObject<{
409
- type: z.ZodLiteral<"read-files-response">;
410
- files: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNull]>>;
411
- requestId: z.ZodOptional<z.ZodString>;
412
- }, "strip", z.ZodTypeAny, {
413
- type: "read-files-response";
414
- files: Record<string, string | null>;
415
- requestId?: string | undefined;
416
- }, {
417
- type: "read-files-response";
418
- files: Record<string, string | null>;
419
- requestId?: string | undefined;
420
- }>, z.ZodObject<{
421
- type: z.ZodLiteral<"init">;
422
- fingerprintId: z.ZodString;
423
- authToken: z.ZodOptional<z.ZodString>;
424
- fileContext: z.ZodObject<{
425
- projectRoot: z.ZodString;
426
- cwd: z.ZodString;
427
- fileTree: z.ZodArray<z.ZodType<import("../util/file").FileTreeNode, z.ZodTypeDef, import("../util/file").FileTreeNode>, "many">;
428
- fileTokenScores: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodNumber>>;
429
- tokenCallers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>>;
430
- knowledgeFiles: z.ZodRecord<z.ZodString, z.ZodString>;
431
- userKnowledgeFiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
432
- gitChanges: z.ZodObject<{
433
- status: z.ZodString;
434
- diff: z.ZodString;
435
- diffCached: z.ZodString;
436
- lastCommitMessages: z.ZodString;
437
- }, "strip", z.ZodTypeAny, {
438
- status: string;
439
- diff: string;
440
- diffCached: string;
441
- lastCommitMessages: string;
442
- }, {
443
- status: string;
444
- diff: string;
445
- diffCached: string;
446
- lastCommitMessages: string;
447
- }>;
448
- changesSinceLastChat: z.ZodRecord<z.ZodString, z.ZodString>;
449
- shellConfigFiles: z.ZodRecord<z.ZodString, z.ZodString>;
450
- systemInfo: z.ZodObject<{
451
- platform: z.ZodString;
452
- shell: z.ZodString;
453
- nodeVersion: z.ZodString;
454
- arch: z.ZodString;
455
- homedir: z.ZodString;
456
- cpus: z.ZodNumber;
457
- }, "strip", z.ZodTypeAny, {
458
- platform: string;
459
- shell: string;
460
- nodeVersion: string;
461
- arch: string;
462
- homedir: string;
463
- cpus: number;
464
- }, {
465
- platform: string;
466
- shell: string;
467
- nodeVersion: string;
468
- arch: string;
469
- homedir: string;
470
- cpus: number;
471
- }>;
472
- fileVersions: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodObject<{
473
- path: z.ZodString;
474
- content: z.ZodString;
475
- }, "strip", z.ZodTypeAny, {
476
- path: string;
477
- content: string;
478
- }, {
479
- path: string;
480
- content: string;
481
- }>, "many">, "many">>;
482
- }, "strip", z.ZodTypeAny, {
483
- projectRoot: string;
484
- cwd: string;
485
- fileTree: import("../util/file").FileTreeNode[];
486
- fileTokenScores: Record<string, Record<string, number>>;
487
- knowledgeFiles: Record<string, string>;
488
- gitChanges: {
489
- status: string;
490
- diff: string;
491
- diffCached: string;
492
- lastCommitMessages: string;
493
- };
494
- changesSinceLastChat: Record<string, string>;
495
- shellConfigFiles: Record<string, string>;
496
- systemInfo: {
497
- platform: string;
498
- shell: string;
499
- nodeVersion: string;
500
- arch: string;
501
- homedir: string;
502
- cpus: number;
503
- };
504
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
505
- userKnowledgeFiles?: Record<string, string> | undefined;
506
- fileVersions?: {
507
- path: string;
508
- content: string;
509
- }[][] | undefined;
510
- }, {
511
- projectRoot: string;
512
- cwd: string;
513
- fileTree: import("../util/file").FileTreeNode[];
514
- fileTokenScores: Record<string, Record<string, number>>;
515
- knowledgeFiles: Record<string, string>;
516
- gitChanges: {
517
- status: string;
518
- diff: string;
519
- diffCached: string;
520
- lastCommitMessages: string;
521
- };
522
- changesSinceLastChat: Record<string, string>;
523
- shellConfigFiles: Record<string, string>;
524
- systemInfo: {
525
- platform: string;
526
- shell: string;
527
- nodeVersion: string;
528
- arch: string;
529
- homedir: string;
530
- cpus: number;
531
- };
532
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
533
- userKnowledgeFiles?: Record<string, string> | undefined;
534
- fileVersions?: {
535
- path: string;
536
- content: string;
537
- }[][] | undefined;
538
- }>;
539
- repoUrl: z.ZodOptional<z.ZodString>;
540
- }, "strip", z.ZodTypeAny, {
541
- type: "init";
542
- fileContext: {
543
- projectRoot: string;
544
- cwd: string;
545
- fileTree: import("../util/file").FileTreeNode[];
546
- fileTokenScores: Record<string, Record<string, number>>;
547
- knowledgeFiles: Record<string, string>;
548
- gitChanges: {
549
- status: string;
550
- diff: string;
551
- diffCached: string;
552
- lastCommitMessages: string;
553
- };
554
- changesSinceLastChat: Record<string, string>;
555
- shellConfigFiles: Record<string, string>;
556
- systemInfo: {
557
- platform: string;
558
- shell: string;
559
- nodeVersion: string;
560
- arch: string;
561
- homedir: string;
562
- cpus: number;
563
- };
564
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
565
- userKnowledgeFiles?: Record<string, string> | undefined;
566
- fileVersions?: {
567
- path: string;
568
- content: string;
569
- }[][] | undefined;
570
- };
571
- fingerprintId: string;
572
- authToken?: string | undefined;
573
- repoUrl?: string | undefined;
574
- }, {
575
- type: "init";
576
- fileContext: {
577
- projectRoot: string;
578
- cwd: string;
579
- fileTree: import("../util/file").FileTreeNode[];
580
- fileTokenScores: Record<string, Record<string, number>>;
581
- knowledgeFiles: Record<string, string>;
582
- gitChanges: {
583
- status: string;
584
- diff: string;
585
- diffCached: string;
586
- lastCommitMessages: string;
587
- };
588
- changesSinceLastChat: Record<string, string>;
589
- shellConfigFiles: Record<string, string>;
590
- systemInfo: {
591
- platform: string;
592
- shell: string;
593
- nodeVersion: string;
594
- arch: string;
595
- homedir: string;
596
- cpus: number;
597
- };
598
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
599
- userKnowledgeFiles?: Record<string, string> | undefined;
600
- fileVersions?: {
601
- path: string;
602
- content: string;
603
- }[][] | undefined;
604
- };
605
- fingerprintId: string;
606
- authToken?: string | undefined;
607
- repoUrl?: string | undefined;
608
- }>, z.ZodObject<{
609
- type: z.ZodLiteral<"generate-commit-message">;
610
- fingerprintId: z.ZodString;
611
- authToken: z.ZodOptional<z.ZodString>;
612
- stagedChanges: z.ZodString;
613
- }, "strip", z.ZodTypeAny, {
614
- type: "generate-commit-message";
615
- fingerprintId: string;
616
- stagedChanges: string;
617
- authToken?: string | undefined;
618
- }, {
619
- type: "generate-commit-message";
620
- fingerprintId: string;
621
- stagedChanges: string;
622
- authToken?: string | undefined;
623
- }>]>;
624
- }, "strip", z.ZodTypeAny, {
625
- type: "action";
626
- data: {
627
- type: "prompt";
628
- promptId: string;
629
- fingerprintId: string;
630
- costMode: "max" | "lite" | "normal" | "experimental" | "ask";
631
- agentState: {
632
- agentContext: string;
633
- fileContext: {
634
- projectRoot: string;
635
- cwd: string;
636
- fileTree: import("../util/file").FileTreeNode[];
637
- fileTokenScores: Record<string, Record<string, number>>;
638
- knowledgeFiles: Record<string, string>;
639
- gitChanges: {
640
- status: string;
641
- diff: string;
642
- diffCached: string;
643
- lastCommitMessages: string;
644
- };
645
- changesSinceLastChat: Record<string, string>;
646
- shellConfigFiles: Record<string, string>;
647
- systemInfo: {
648
- platform: string;
649
- shell: string;
650
- nodeVersion: string;
651
- arch: string;
652
- homedir: string;
653
- cpus: number;
654
- };
655
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
656
- userKnowledgeFiles?: Record<string, string> | undefined;
657
- fileVersions?: {
658
- path: string;
659
- content: string;
660
- }[][] | undefined;
661
- };
662
- messageHistory: (import("ai").CoreMessage & {
663
- timeToLive?: "agentStep" | "userPrompt" | undefined;
664
- })[];
665
- agents: {
666
- agentId: string;
667
- agentName: import("../types/agent-state").AgentTemplateName;
668
- agents: import("../types/agent-state").SubagentState[];
669
- messageHistory: import("../types/message").CodebuffMessage[];
670
- }[];
671
- agentStepsRemaining: number;
672
- };
673
- toolResults: {
674
- toolName: string;
675
- toolCallId: string;
676
- result: string;
677
- }[];
678
- prompt?: string | undefined;
679
- authToken?: string | undefined;
680
- model?: string | undefined;
681
- repoUrl?: string | undefined;
682
- } | {
683
- type: "read-files-response";
684
- files: Record<string, string | null>;
685
- requestId?: string | undefined;
686
- } | {
687
- type: "init";
688
- fileContext: {
689
- projectRoot: string;
690
- cwd: string;
691
- fileTree: import("../util/file").FileTreeNode[];
692
- fileTokenScores: Record<string, Record<string, number>>;
693
- knowledgeFiles: Record<string, string>;
694
- gitChanges: {
695
- status: string;
696
- diff: string;
697
- diffCached: string;
698
- lastCommitMessages: string;
699
- };
700
- changesSinceLastChat: Record<string, string>;
701
- shellConfigFiles: Record<string, string>;
702
- systemInfo: {
703
- platform: string;
704
- shell: string;
705
- nodeVersion: string;
706
- arch: string;
707
- homedir: string;
708
- cpus: number;
709
- };
710
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
711
- userKnowledgeFiles?: Record<string, string> | undefined;
712
- fileVersions?: {
713
- path: string;
714
- content: string;
715
- }[][] | undefined;
716
- };
717
- fingerprintId: string;
718
- authToken?: string | undefined;
719
- repoUrl?: string | undefined;
720
- } | {
721
- type: "generate-commit-message";
722
- fingerprintId: string;
723
- stagedChanges: string;
724
- authToken?: string | undefined;
725
- };
726
- txid: number;
727
- }, {
728
- type: "action";
729
- data: {
730
- type: "prompt";
731
- promptId: string;
732
- fingerprintId: string;
733
- agentState: {
734
- agentContext: string;
735
- fileContext: {
736
- projectRoot: string;
737
- cwd: string;
738
- fileTree: import("../util/file").FileTreeNode[];
739
- fileTokenScores: Record<string, Record<string, number>>;
740
- knowledgeFiles: Record<string, string>;
741
- gitChanges: {
742
- status: string;
743
- diff: string;
744
- diffCached: string;
745
- lastCommitMessages: string;
746
- };
747
- changesSinceLastChat: Record<string, string>;
748
- shellConfigFiles: Record<string, string>;
749
- systemInfo: {
750
- platform: string;
751
- shell: string;
752
- nodeVersion: string;
753
- arch: string;
754
- homedir: string;
755
- cpus: number;
756
- };
757
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
758
- userKnowledgeFiles?: Record<string, string> | undefined;
759
- fileVersions?: {
760
- path: string;
761
- content: string;
762
- }[][] | undefined;
763
- };
764
- messageHistory: (import("ai").CoreMessage & {
765
- timeToLive?: "agentStep" | "userPrompt" | undefined;
766
- })[];
767
- agentStepsRemaining: number;
768
- agents?: {
769
- agentId: string;
770
- agentName: import("../types/agent-state").AgentTemplateName;
771
- agents: import("../types/agent-state").SubagentState[];
772
- messageHistory: import("../types/message").CodebuffMessage[];
773
- }[] | undefined;
774
- };
775
- toolResults: {
776
- toolName: string;
777
- toolCallId: string;
778
- result: string;
779
- }[];
780
- prompt?: string | undefined;
781
- authToken?: string | undefined;
782
- costMode?: "max" | "lite" | "normal" | "experimental" | "ask" | undefined;
783
- model?: string | undefined;
784
- repoUrl?: string | undefined;
785
- } | {
786
- type: "read-files-response";
787
- files: Record<string, string | null>;
788
- requestId?: string | undefined;
789
- } | {
790
- type: "init";
791
- fileContext: {
792
- projectRoot: string;
793
- cwd: string;
794
- fileTree: import("../util/file").FileTreeNode[];
795
- fileTokenScores: Record<string, Record<string, number>>;
796
- knowledgeFiles: Record<string, string>;
797
- gitChanges: {
798
- status: string;
799
- diff: string;
800
- diffCached: string;
801
- lastCommitMessages: string;
802
- };
803
- changesSinceLastChat: Record<string, string>;
804
- shellConfigFiles: Record<string, string>;
805
- systemInfo: {
806
- platform: string;
807
- shell: string;
808
- nodeVersion: string;
809
- arch: string;
810
- homedir: string;
811
- cpus: number;
812
- };
813
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
814
- userKnowledgeFiles?: Record<string, string> | undefined;
815
- fileVersions?: {
816
- path: string;
817
- content: string;
818
- }[][] | undefined;
819
- };
820
- fingerprintId: string;
821
- authToken?: string | undefined;
822
- repoUrl?: string | undefined;
823
- } | {
824
- type: "generate-commit-message";
825
- fingerprintId: string;
826
- stagedChanges: string;
827
- authToken?: string | undefined;
828
- };
829
- txid: number;
830
- }>;
831
- };
832
- export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
833
- type: z.ZodLiteral<"identify">;
834
- txid: z.ZodNumber;
835
- clientSessionId: z.ZodString;
836
- }, "strip", z.ZodTypeAny, {
837
- type: "identify";
838
- txid: number;
839
- clientSessionId: string;
840
- }, {
841
- type: "identify";
842
- txid: number;
843
- clientSessionId: string;
844
- }>, z.ZodObject<{
845
- type: z.ZodLiteral<"subscribe">;
846
- txid: z.ZodNumber;
847
- topics: z.ZodArray<z.ZodString, "many">;
848
- }, "strip", z.ZodTypeAny, {
849
- type: "subscribe";
850
- txid: number;
851
- topics: string[];
852
- }, {
853
- type: "subscribe";
854
- txid: number;
855
- topics: string[];
856
- }>, z.ZodObject<{
857
- type: z.ZodLiteral<"unsubscribe">;
858
- txid: z.ZodNumber;
859
- topics: z.ZodArray<z.ZodString, "many">;
860
- }, "strip", z.ZodTypeAny, {
861
- type: "unsubscribe";
862
- txid: number;
863
- topics: string[];
864
- }, {
865
- type: "unsubscribe";
866
- txid: number;
867
- topics: string[];
868
- }>, z.ZodObject<{
869
- type: z.ZodLiteral<"ping">;
870
- txid: z.ZodNumber;
871
- }, "strip", z.ZodTypeAny, {
872
- type: "ping";
873
- txid: number;
874
- }, {
875
- type: "ping";
876
- txid: number;
877
- }>, z.ZodObject<{
878
- type: z.ZodLiteral<"action">;
879
- txid: z.ZodNumber;
880
- data: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
881
- type: z.ZodLiteral<"prompt">;
882
- promptId: z.ZodString;
883
- prompt: z.ZodUnion<[z.ZodString, z.ZodUndefined]>;
884
- fingerprintId: z.ZodString;
885
- authToken: z.ZodOptional<z.ZodString>;
886
- costMode: z.ZodDefault<z.ZodOptional<z.ZodEnum<["lite", "normal", "max", "experimental", "ask"]>>>;
887
- agentState: z.ZodObject<{
888
- agentContext: z.ZodString;
889
- fileContext: z.ZodObject<{
890
- projectRoot: z.ZodString;
891
- cwd: z.ZodString;
892
- fileTree: z.ZodArray<z.ZodType<import("../util/file").FileTreeNode, z.ZodTypeDef, import("../util/file").FileTreeNode>, "many">;
893
- fileTokenScores: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodNumber>>;
894
- tokenCallers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>>;
895
- knowledgeFiles: z.ZodRecord<z.ZodString, z.ZodString>;
896
- userKnowledgeFiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
897
- gitChanges: z.ZodObject<{
898
- status: z.ZodString;
899
- diff: z.ZodString;
900
- diffCached: z.ZodString;
901
- lastCommitMessages: z.ZodString;
902
- }, "strip", z.ZodTypeAny, {
903
- status: string;
904
- diff: string;
905
- diffCached: string;
906
- lastCommitMessages: string;
907
- }, {
908
- status: string;
909
- diff: string;
910
- diffCached: string;
911
- lastCommitMessages: string;
912
- }>;
913
- changesSinceLastChat: z.ZodRecord<z.ZodString, z.ZodString>;
914
- shellConfigFiles: z.ZodRecord<z.ZodString, z.ZodString>;
915
- systemInfo: z.ZodObject<{
916
- platform: z.ZodString;
917
- shell: z.ZodString;
918
- nodeVersion: z.ZodString;
919
- arch: z.ZodString;
920
- homedir: z.ZodString;
921
- cpus: z.ZodNumber;
922
- }, "strip", z.ZodTypeAny, {
923
- platform: string;
924
- shell: string;
925
- nodeVersion: string;
926
- arch: string;
927
- homedir: string;
928
- cpus: number;
929
- }, {
930
- platform: string;
931
- shell: string;
932
- nodeVersion: string;
933
- arch: string;
934
- homedir: string;
935
- cpus: number;
936
- }>;
937
- fileVersions: z.ZodOptional<z.ZodArray<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">, "many">>;
947
- }, "strip", z.ZodTypeAny, {
948
- projectRoot: string;
949
- cwd: string;
950
- fileTree: import("../util/file").FileTreeNode[];
951
- fileTokenScores: Record<string, Record<string, number>>;
952
- knowledgeFiles: Record<string, string>;
953
- gitChanges: {
954
- status: string;
955
- diff: string;
956
- diffCached: string;
957
- lastCommitMessages: string;
958
- };
959
- changesSinceLastChat: Record<string, string>;
960
- shellConfigFiles: Record<string, string>;
961
- systemInfo: {
962
- platform: string;
963
- shell: string;
964
- nodeVersion: string;
965
- arch: string;
966
- homedir: string;
967
- cpus: number;
968
- };
969
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
970
- userKnowledgeFiles?: Record<string, string> | undefined;
971
- fileVersions?: {
972
- path: string;
973
- content: string;
974
- }[][] | undefined;
975
- }, {
976
- projectRoot: string;
977
- cwd: string;
978
- fileTree: import("../util/file").FileTreeNode[];
979
- fileTokenScores: Record<string, Record<string, number>>;
980
- knowledgeFiles: Record<string, string>;
981
- gitChanges: {
982
- status: string;
983
- diff: string;
984
- diffCached: string;
985
- lastCommitMessages: string;
986
- };
987
- changesSinceLastChat: Record<string, string>;
988
- shellConfigFiles: Record<string, string>;
989
- systemInfo: {
990
- platform: string;
991
- shell: string;
992
- nodeVersion: string;
993
- arch: string;
994
- homedir: string;
995
- cpus: number;
996
- };
997
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
998
- userKnowledgeFiles?: Record<string, string> | undefined;
999
- fileVersions?: {
1000
- path: string;
1001
- content: string;
1002
- }[][] | undefined;
1003
- }>;
1004
- messageHistory: z.ZodArray<z.ZodIntersection<z.ZodType<import("ai").CoreMessage, z.ZodTypeDef, import("ai").CoreMessage>, z.ZodObject<{
1005
- timeToLive: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"agentStep">, z.ZodLiteral<"userPrompt">]>>;
1006
- }, "strip", z.ZodTypeAny, {
1007
- timeToLive?: "agentStep" | "userPrompt" | undefined;
1008
- }, {
1009
- timeToLive?: "agentStep" | "userPrompt" | undefined;
1010
- }>>, "many">;
1011
- agents: z.ZodDefault<z.ZodArray<z.ZodType<{
1012
- agentId: string;
1013
- agentName: import("../types/agent-state").AgentTemplateName;
1014
- agents: import("../types/agent-state").SubagentState[];
1015
- messageHistory: import("../types/message").CodebuffMessage[];
1016
- }, z.ZodTypeDef, {
1017
- agentId: string;
1018
- agentName: import("../types/agent-state").AgentTemplateName;
1019
- agents: import("../types/agent-state").SubagentState[];
1020
- messageHistory: import("../types/message").CodebuffMessage[];
1021
- }>, "many">>;
1022
- agentStepsRemaining: z.ZodNumber;
1023
- }, "strip", z.ZodTypeAny, {
1024
- agentContext: string;
1025
- fileContext: {
1026
- projectRoot: string;
1027
- cwd: string;
1028
- fileTree: import("../util/file").FileTreeNode[];
1029
- fileTokenScores: Record<string, Record<string, number>>;
1030
- knowledgeFiles: Record<string, string>;
1031
- gitChanges: {
1032
- status: string;
1033
- diff: string;
1034
- diffCached: string;
1035
- lastCommitMessages: string;
1036
- };
1037
- changesSinceLastChat: Record<string, string>;
1038
- shellConfigFiles: Record<string, string>;
1039
- systemInfo: {
1040
- platform: string;
1041
- shell: string;
1042
- nodeVersion: string;
1043
- arch: string;
1044
- homedir: string;
1045
- cpus: number;
1046
- };
1047
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
1048
- userKnowledgeFiles?: Record<string, string> | undefined;
1049
- fileVersions?: {
1050
- path: string;
1051
- content: string;
1052
- }[][] | undefined;
1053
- };
1054
- messageHistory: (import("ai").CoreMessage & {
1055
- timeToLive?: "agentStep" | "userPrompt" | undefined;
1056
- })[];
1057
- agents: {
1058
- agentId: string;
1059
- agentName: import("../types/agent-state").AgentTemplateName;
1060
- agents: import("../types/agent-state").SubagentState[];
1061
- messageHistory: import("../types/message").CodebuffMessage[];
1062
- }[];
1063
- agentStepsRemaining: number;
1064
- }, {
1065
- agentContext: string;
1066
- fileContext: {
1067
- projectRoot: string;
1068
- cwd: string;
1069
- fileTree: import("../util/file").FileTreeNode[];
1070
- fileTokenScores: Record<string, Record<string, number>>;
1071
- knowledgeFiles: Record<string, string>;
1072
- gitChanges: {
1073
- status: string;
1074
- diff: string;
1075
- diffCached: string;
1076
- lastCommitMessages: string;
1077
- };
1078
- changesSinceLastChat: Record<string, string>;
1079
- shellConfigFiles: Record<string, string>;
1080
- systemInfo: {
1081
- platform: string;
1082
- shell: string;
1083
- nodeVersion: string;
1084
- arch: string;
1085
- homedir: string;
1086
- cpus: number;
1087
- };
1088
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
1089
- userKnowledgeFiles?: Record<string, string> | undefined;
1090
- fileVersions?: {
1091
- path: string;
1092
- content: string;
1093
- }[][] | undefined;
1094
- };
1095
- messageHistory: (import("ai").CoreMessage & {
1096
- timeToLive?: "agentStep" | "userPrompt" | undefined;
1097
- })[];
1098
- agentStepsRemaining: number;
1099
- agents?: {
1100
- agentId: string;
1101
- agentName: import("../types/agent-state").AgentTemplateName;
1102
- agents: import("../types/agent-state").SubagentState[];
1103
- messageHistory: import("../types/message").CodebuffMessage[];
1104
- }[] | undefined;
1105
- }>;
1106
- toolResults: z.ZodArray<z.ZodObject<{
1107
- toolName: z.ZodString;
1108
- toolCallId: z.ZodString;
1109
- result: z.ZodString;
1110
- }, "strip", z.ZodTypeAny, {
1111
- toolName: string;
1112
- toolCallId: string;
1113
- result: string;
1114
- }, {
1115
- toolName: string;
1116
- toolCallId: string;
1117
- result: string;
1118
- }>, "many">;
1119
- model: z.ZodOptional<z.ZodString>;
1120
- repoUrl: z.ZodOptional<z.ZodString>;
1121
- }, "strip", z.ZodTypeAny, {
1122
- type: "prompt";
1123
- promptId: string;
1124
- fingerprintId: string;
1125
- costMode: "max" | "lite" | "normal" | "experimental" | "ask";
1126
- agentState: {
1127
- agentContext: string;
1128
- fileContext: {
1129
- projectRoot: string;
1130
- cwd: string;
1131
- fileTree: import("../util/file").FileTreeNode[];
1132
- fileTokenScores: Record<string, Record<string, number>>;
1133
- knowledgeFiles: Record<string, string>;
1134
- gitChanges: {
1135
- status: string;
1136
- diff: string;
1137
- diffCached: string;
1138
- lastCommitMessages: string;
1139
- };
1140
- changesSinceLastChat: Record<string, string>;
1141
- shellConfigFiles: Record<string, string>;
1142
- systemInfo: {
1143
- platform: string;
1144
- shell: string;
1145
- nodeVersion: string;
1146
- arch: string;
1147
- homedir: string;
1148
- cpus: number;
1149
- };
1150
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
1151
- userKnowledgeFiles?: Record<string, string> | undefined;
1152
- fileVersions?: {
1153
- path: string;
1154
- content: string;
1155
- }[][] | undefined;
1156
- };
1157
- messageHistory: (import("ai").CoreMessage & {
1158
- timeToLive?: "agentStep" | "userPrompt" | undefined;
1159
- })[];
1160
- agents: {
1161
- agentId: string;
1162
- agentName: import("../types/agent-state").AgentTemplateName;
1163
- agents: import("../types/agent-state").SubagentState[];
1164
- messageHistory: import("../types/message").CodebuffMessage[];
1165
- }[];
1166
- agentStepsRemaining: number;
1167
- };
1168
- toolResults: {
1169
- toolName: string;
1170
- toolCallId: string;
1171
- result: string;
1172
- }[];
1173
- prompt?: string | undefined;
1174
- authToken?: string | undefined;
1175
- model?: string | undefined;
1176
- repoUrl?: string | undefined;
1177
- }, {
1178
- type: "prompt";
1179
- promptId: string;
1180
- fingerprintId: string;
1181
- agentState: {
1182
- agentContext: string;
1183
- fileContext: {
1184
- projectRoot: string;
1185
- cwd: string;
1186
- fileTree: import("../util/file").FileTreeNode[];
1187
- fileTokenScores: Record<string, Record<string, number>>;
1188
- knowledgeFiles: Record<string, string>;
1189
- gitChanges: {
1190
- status: string;
1191
- diff: string;
1192
- diffCached: string;
1193
- lastCommitMessages: string;
1194
- };
1195
- changesSinceLastChat: Record<string, string>;
1196
- shellConfigFiles: Record<string, string>;
1197
- systemInfo: {
1198
- platform: string;
1199
- shell: string;
1200
- nodeVersion: string;
1201
- arch: string;
1202
- homedir: string;
1203
- cpus: number;
1204
- };
1205
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
1206
- userKnowledgeFiles?: Record<string, string> | undefined;
1207
- fileVersions?: {
1208
- path: string;
1209
- content: string;
1210
- }[][] | undefined;
1211
- };
1212
- messageHistory: (import("ai").CoreMessage & {
1213
- timeToLive?: "agentStep" | "userPrompt" | undefined;
1214
- })[];
1215
- agentStepsRemaining: number;
1216
- agents?: {
1217
- agentId: string;
1218
- agentName: import("../types/agent-state").AgentTemplateName;
1219
- agents: import("../types/agent-state").SubagentState[];
1220
- messageHistory: import("../types/message").CodebuffMessage[];
1221
- }[] | undefined;
1222
- };
1223
- toolResults: {
1224
- toolName: string;
1225
- toolCallId: string;
1226
- result: string;
1227
- }[];
1228
- prompt?: string | undefined;
1229
- authToken?: string | undefined;
1230
- costMode?: "max" | "lite" | "normal" | "experimental" | "ask" | undefined;
1231
- model?: string | undefined;
1232
- repoUrl?: string | undefined;
1233
- }>, z.ZodObject<{
1234
- type: z.ZodLiteral<"read-files-response">;
1235
- files: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNull]>>;
1236
- requestId: z.ZodOptional<z.ZodString>;
1237
- }, "strip", z.ZodTypeAny, {
1238
- type: "read-files-response";
1239
- files: Record<string, string | null>;
1240
- requestId?: string | undefined;
1241
- }, {
1242
- type: "read-files-response";
1243
- files: Record<string, string | null>;
1244
- requestId?: string | undefined;
1245
- }>, z.ZodObject<{
1246
- type: z.ZodLiteral<"init">;
1247
- fingerprintId: z.ZodString;
1248
- authToken: z.ZodOptional<z.ZodString>;
1249
- fileContext: z.ZodObject<{
1250
- projectRoot: z.ZodString;
1251
- cwd: z.ZodString;
1252
- fileTree: z.ZodArray<z.ZodType<import("../util/file").FileTreeNode, z.ZodTypeDef, import("../util/file").FileTreeNode>, "many">;
1253
- fileTokenScores: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodNumber>>;
1254
- tokenCallers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>>;
1255
- knowledgeFiles: z.ZodRecord<z.ZodString, z.ZodString>;
1256
- userKnowledgeFiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1257
- gitChanges: z.ZodObject<{
1258
- status: z.ZodString;
1259
- diff: z.ZodString;
1260
- diffCached: z.ZodString;
1261
- lastCommitMessages: z.ZodString;
1262
- }, "strip", z.ZodTypeAny, {
1263
- status: string;
1264
- diff: string;
1265
- diffCached: string;
1266
- lastCommitMessages: string;
1267
- }, {
1268
- status: string;
1269
- diff: string;
1270
- diffCached: string;
1271
- lastCommitMessages: string;
1272
- }>;
1273
- changesSinceLastChat: z.ZodRecord<z.ZodString, z.ZodString>;
1274
- shellConfigFiles: z.ZodRecord<z.ZodString, z.ZodString>;
1275
- systemInfo: z.ZodObject<{
1276
- platform: z.ZodString;
1277
- shell: z.ZodString;
1278
- nodeVersion: z.ZodString;
1279
- arch: z.ZodString;
1280
- homedir: z.ZodString;
1281
- cpus: z.ZodNumber;
1282
- }, "strip", z.ZodTypeAny, {
1283
- platform: string;
1284
- shell: string;
1285
- nodeVersion: string;
1286
- arch: string;
1287
- homedir: string;
1288
- cpus: number;
1289
- }, {
1290
- platform: string;
1291
- shell: string;
1292
- nodeVersion: string;
1293
- arch: string;
1294
- homedir: string;
1295
- cpus: number;
1296
- }>;
1297
- fileVersions: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodObject<{
1298
- path: z.ZodString;
1299
- content: z.ZodString;
1300
- }, "strip", z.ZodTypeAny, {
1301
- path: string;
1302
- content: string;
1303
- }, {
1304
- path: string;
1305
- content: string;
1306
- }>, "many">, "many">>;
1307
- }, "strip", z.ZodTypeAny, {
1308
- projectRoot: string;
1309
- cwd: string;
1310
- fileTree: import("../util/file").FileTreeNode[];
1311
- fileTokenScores: Record<string, Record<string, number>>;
1312
- knowledgeFiles: Record<string, string>;
1313
- gitChanges: {
1314
- status: string;
1315
- diff: string;
1316
- diffCached: string;
1317
- lastCommitMessages: string;
1318
- };
1319
- changesSinceLastChat: Record<string, string>;
1320
- shellConfigFiles: Record<string, string>;
1321
- systemInfo: {
1322
- platform: string;
1323
- shell: string;
1324
- nodeVersion: string;
1325
- arch: string;
1326
- homedir: string;
1327
- cpus: number;
1328
- };
1329
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
1330
- userKnowledgeFiles?: Record<string, string> | undefined;
1331
- fileVersions?: {
1332
- path: string;
1333
- content: string;
1334
- }[][] | undefined;
1335
- }, {
1336
- projectRoot: string;
1337
- cwd: string;
1338
- fileTree: import("../util/file").FileTreeNode[];
1339
- fileTokenScores: Record<string, Record<string, number>>;
1340
- knowledgeFiles: Record<string, string>;
1341
- gitChanges: {
1342
- status: string;
1343
- diff: string;
1344
- diffCached: string;
1345
- lastCommitMessages: string;
1346
- };
1347
- changesSinceLastChat: Record<string, string>;
1348
- shellConfigFiles: Record<string, string>;
1349
- systemInfo: {
1350
- platform: string;
1351
- shell: string;
1352
- nodeVersion: string;
1353
- arch: string;
1354
- homedir: string;
1355
- cpus: number;
1356
- };
1357
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
1358
- userKnowledgeFiles?: Record<string, string> | undefined;
1359
- fileVersions?: {
1360
- path: string;
1361
- content: string;
1362
- }[][] | undefined;
1363
- }>;
1364
- repoUrl: z.ZodOptional<z.ZodString>;
1365
- }, "strip", z.ZodTypeAny, {
1366
- type: "init";
1367
- fileContext: {
1368
- projectRoot: string;
1369
- cwd: string;
1370
- fileTree: import("../util/file").FileTreeNode[];
1371
- fileTokenScores: Record<string, Record<string, number>>;
1372
- knowledgeFiles: Record<string, string>;
1373
- gitChanges: {
1374
- status: string;
1375
- diff: string;
1376
- diffCached: string;
1377
- lastCommitMessages: string;
1378
- };
1379
- changesSinceLastChat: Record<string, string>;
1380
- shellConfigFiles: Record<string, string>;
1381
- systemInfo: {
1382
- platform: string;
1383
- shell: string;
1384
- nodeVersion: string;
1385
- arch: string;
1386
- homedir: string;
1387
- cpus: number;
1388
- };
1389
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
1390
- userKnowledgeFiles?: Record<string, string> | undefined;
1391
- fileVersions?: {
1392
- path: string;
1393
- content: string;
1394
- }[][] | undefined;
1395
- };
1396
- fingerprintId: string;
1397
- authToken?: string | undefined;
1398
- repoUrl?: string | undefined;
1399
- }, {
1400
- type: "init";
1401
- fileContext: {
1402
- projectRoot: string;
1403
- cwd: string;
1404
- fileTree: import("../util/file").FileTreeNode[];
1405
- fileTokenScores: Record<string, Record<string, number>>;
1406
- knowledgeFiles: Record<string, string>;
1407
- gitChanges: {
1408
- status: string;
1409
- diff: string;
1410
- diffCached: string;
1411
- lastCommitMessages: string;
1412
- };
1413
- changesSinceLastChat: Record<string, string>;
1414
- shellConfigFiles: Record<string, string>;
1415
- systemInfo: {
1416
- platform: string;
1417
- shell: string;
1418
- nodeVersion: string;
1419
- arch: string;
1420
- homedir: string;
1421
- cpus: number;
1422
- };
1423
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
1424
- userKnowledgeFiles?: Record<string, string> | undefined;
1425
- fileVersions?: {
1426
- path: string;
1427
- content: string;
1428
- }[][] | undefined;
1429
- };
1430
- fingerprintId: string;
1431
- authToken?: string | undefined;
1432
- repoUrl?: string | undefined;
1433
- }>, z.ZodObject<{
1434
- type: z.ZodLiteral<"generate-commit-message">;
1435
- fingerprintId: z.ZodString;
1436
- authToken: z.ZodOptional<z.ZodString>;
1437
- stagedChanges: z.ZodString;
1438
- }, "strip", z.ZodTypeAny, {
1439
- type: "generate-commit-message";
1440
- fingerprintId: string;
1441
- stagedChanges: string;
1442
- authToken?: string | undefined;
1443
- }, {
1444
- type: "generate-commit-message";
1445
- fingerprintId: string;
1446
- stagedChanges: string;
1447
- authToken?: string | undefined;
1448
- }>]>;
1449
- }, "strip", z.ZodTypeAny, {
1450
- type: "action";
1451
- data: {
1452
- type: "prompt";
1453
- promptId: string;
1454
- fingerprintId: string;
1455
- costMode: "max" | "lite" | "normal" | "experimental" | "ask";
1456
- agentState: {
1457
- agentContext: string;
1458
- fileContext: {
1459
- projectRoot: string;
1460
- cwd: string;
1461
- fileTree: import("../util/file").FileTreeNode[];
1462
- fileTokenScores: Record<string, Record<string, number>>;
1463
- knowledgeFiles: Record<string, string>;
1464
- gitChanges: {
1465
- status: string;
1466
- diff: string;
1467
- diffCached: string;
1468
- lastCommitMessages: string;
1469
- };
1470
- changesSinceLastChat: Record<string, string>;
1471
- shellConfigFiles: Record<string, string>;
1472
- systemInfo: {
1473
- platform: string;
1474
- shell: string;
1475
- nodeVersion: string;
1476
- arch: string;
1477
- homedir: string;
1478
- cpus: number;
1479
- };
1480
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
1481
- userKnowledgeFiles?: Record<string, string> | undefined;
1482
- fileVersions?: {
1483
- path: string;
1484
- content: string;
1485
- }[][] | undefined;
1486
- };
1487
- messageHistory: (import("ai").CoreMessage & {
1488
- timeToLive?: "agentStep" | "userPrompt" | undefined;
1489
- })[];
1490
- agents: {
1491
- agentId: string;
1492
- agentName: import("../types/agent-state").AgentTemplateName;
1493
- agents: import("../types/agent-state").SubagentState[];
1494
- messageHistory: import("../types/message").CodebuffMessage[];
1495
- }[];
1496
- agentStepsRemaining: number;
1497
- };
1498
- toolResults: {
1499
- toolName: string;
1500
- toolCallId: string;
1501
- result: string;
1502
- }[];
1503
- prompt?: string | undefined;
1504
- authToken?: string | undefined;
1505
- model?: string | undefined;
1506
- repoUrl?: string | undefined;
1507
- } | {
1508
- type: "read-files-response";
1509
- files: Record<string, string | null>;
1510
- requestId?: string | undefined;
1511
- } | {
1512
- type: "init";
1513
- fileContext: {
1514
- projectRoot: string;
1515
- cwd: string;
1516
- fileTree: import("../util/file").FileTreeNode[];
1517
- fileTokenScores: Record<string, Record<string, number>>;
1518
- knowledgeFiles: Record<string, string>;
1519
- gitChanges: {
1520
- status: string;
1521
- diff: string;
1522
- diffCached: string;
1523
- lastCommitMessages: string;
1524
- };
1525
- changesSinceLastChat: Record<string, string>;
1526
- shellConfigFiles: Record<string, string>;
1527
- systemInfo: {
1528
- platform: string;
1529
- shell: string;
1530
- nodeVersion: string;
1531
- arch: string;
1532
- homedir: string;
1533
- cpus: number;
1534
- };
1535
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
1536
- userKnowledgeFiles?: Record<string, string> | undefined;
1537
- fileVersions?: {
1538
- path: string;
1539
- content: string;
1540
- }[][] | undefined;
1541
- };
1542
- fingerprintId: string;
1543
- authToken?: string | undefined;
1544
- repoUrl?: string | undefined;
1545
- } | {
1546
- type: "generate-commit-message";
1547
- fingerprintId: string;
1548
- stagedChanges: string;
1549
- authToken?: string | undefined;
1550
- };
1551
- txid: number;
1552
- }, {
1553
- type: "action";
1554
- data: {
1555
- type: "prompt";
1556
- promptId: string;
1557
- fingerprintId: string;
1558
- agentState: {
1559
- agentContext: string;
1560
- fileContext: {
1561
- projectRoot: string;
1562
- cwd: string;
1563
- fileTree: import("../util/file").FileTreeNode[];
1564
- fileTokenScores: Record<string, Record<string, number>>;
1565
- knowledgeFiles: Record<string, string>;
1566
- gitChanges: {
1567
- status: string;
1568
- diff: string;
1569
- diffCached: string;
1570
- lastCommitMessages: string;
1571
- };
1572
- changesSinceLastChat: Record<string, string>;
1573
- shellConfigFiles: Record<string, string>;
1574
- systemInfo: {
1575
- platform: string;
1576
- shell: string;
1577
- nodeVersion: string;
1578
- arch: string;
1579
- homedir: string;
1580
- cpus: number;
1581
- };
1582
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
1583
- userKnowledgeFiles?: Record<string, string> | undefined;
1584
- fileVersions?: {
1585
- path: string;
1586
- content: string;
1587
- }[][] | undefined;
1588
- };
1589
- messageHistory: (import("ai").CoreMessage & {
1590
- timeToLive?: "agentStep" | "userPrompt" | undefined;
1591
- })[];
1592
- agentStepsRemaining: number;
1593
- agents?: {
1594
- agentId: string;
1595
- agentName: import("../types/agent-state").AgentTemplateName;
1596
- agents: import("../types/agent-state").SubagentState[];
1597
- messageHistory: import("../types/message").CodebuffMessage[];
1598
- }[] | undefined;
1599
- };
1600
- toolResults: {
1601
- toolName: string;
1602
- toolCallId: string;
1603
- result: string;
1604
- }[];
1605
- prompt?: string | undefined;
1606
- authToken?: string | undefined;
1607
- costMode?: "max" | "lite" | "normal" | "experimental" | "ask" | undefined;
1608
- model?: string | undefined;
1609
- repoUrl?: string | undefined;
1610
- } | {
1611
- type: "read-files-response";
1612
- files: Record<string, string | null>;
1613
- requestId?: string | undefined;
1614
- } | {
1615
- type: "init";
1616
- fileContext: {
1617
- projectRoot: string;
1618
- cwd: string;
1619
- fileTree: import("../util/file").FileTreeNode[];
1620
- fileTokenScores: Record<string, Record<string, number>>;
1621
- knowledgeFiles: Record<string, string>;
1622
- gitChanges: {
1623
- status: string;
1624
- diff: string;
1625
- diffCached: string;
1626
- lastCommitMessages: string;
1627
- };
1628
- changesSinceLastChat: Record<string, string>;
1629
- shellConfigFiles: Record<string, string>;
1630
- systemInfo: {
1631
- platform: string;
1632
- shell: string;
1633
- nodeVersion: string;
1634
- arch: string;
1635
- homedir: string;
1636
- cpus: number;
1637
- };
1638
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
1639
- userKnowledgeFiles?: Record<string, string> | undefined;
1640
- fileVersions?: {
1641
- path: string;
1642
- content: string;
1643
- }[][] | undefined;
1644
- };
1645
- fingerprintId: string;
1646
- authToken?: string | undefined;
1647
- repoUrl?: string | undefined;
1648
- } | {
1649
- type: "generate-commit-message";
1650
- fingerprintId: string;
1651
- stagedChanges: string;
1652
- authToken?: string | undefined;
1653
- };
1654
- txid: number;
1655
- }>]>;
1656
- export type ClientMessageType = keyof typeof CLIENT_MESSAGE_SCHEMAS;
1657
- export type ClientMessage<T extends ClientMessageType = ClientMessageType> = z.infer<(typeof CLIENT_MESSAGE_SCHEMAS)[T]>;
1658
- export declare const SERVER_MESSAGE_SCHEMAS: {
1659
- ack: z.ZodObject<{
1660
- type: z.ZodLiteral<"ack">;
1661
- txid: z.ZodOptional<z.ZodNumber>;
1662
- success: z.ZodBoolean;
1663
- error: z.ZodOptional<z.ZodString>;
1664
- }, "strip", z.ZodTypeAny, {
1665
- type: "ack";
1666
- success: boolean;
1667
- error?: string | undefined;
1668
- txid?: number | undefined;
1669
- }, {
1670
- type: "ack";
1671
- success: boolean;
1672
- error?: string | undefined;
1673
- txid?: number | undefined;
1674
- }>;
1675
- action: z.ZodObject<{
1676
- type: z.ZodLiteral<"action">;
1677
- data: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1678
- type: z.ZodLiteral<"response-chunk">;
1679
- userInputId: z.ZodString;
1680
- chunk: z.ZodString;
1681
- }, "strip", z.ZodTypeAny, {
1682
- type: "response-chunk";
1683
- userInputId: string;
1684
- chunk: string;
1685
- }, {
1686
- type: "response-chunk";
1687
- userInputId: string;
1688
- chunk: string;
1689
- }>, z.ZodObject<z.objectUtil.extendShape<{
1690
- type: z.ZodLiteral<"response-complete">;
1691
- userInputId: z.ZodString;
1692
- response: z.ZodString;
1693
- changes: z.ZodArray<z.ZodObject<{
1694
- type: z.ZodEnum<["patch", "file"]>;
1695
- path: z.ZodString;
1696
- content: z.ZodString;
1697
- }, "strip", z.ZodTypeAny, {
1698
- path: string;
1699
- type: "patch" | "file";
1700
- content: string;
1701
- }, {
1702
- path: string;
1703
- type: "patch" | "file";
1704
- content: string;
1705
- }>, "many">;
1706
- changesAlreadyApplied: z.ZodArray<z.ZodObject<{
1707
- type: z.ZodEnum<["patch", "file"]>;
1708
- path: z.ZodString;
1709
- content: z.ZodString;
1710
- }, "strip", z.ZodTypeAny, {
1711
- path: string;
1712
- type: "patch" | "file";
1713
- content: string;
1714
- }, {
1715
- path: string;
1716
- type: "patch" | "file";
1717
- content: string;
1718
- }>, "many">;
1719
- addedFileVersions: z.ZodArray<z.ZodObject<{
1720
- path: z.ZodString;
1721
- content: z.ZodString;
1722
- }, "strip", z.ZodTypeAny, {
1723
- path: string;
1724
- content: string;
1725
- }, {
1726
- path: string;
1727
- content: string;
1728
- }>, "many">;
1729
- resetFileVersions: z.ZodBoolean;
1730
- }, {
1731
- usage: z.ZodOptional<z.ZodNumber>;
1732
- remainingBalance: z.ZodOptional<z.ZodNumber>;
1733
- balanceBreakdown: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodEnum<["free", ...("free" | "referral" | "purchase" | "admin" | "organization")[]]>, z.ZodNumber>>>;
1734
- next_quota_reset: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
1735
- autoTopupAdded: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
1736
- }>, "strip", z.ZodTypeAny, {
1737
- type: "response-complete";
1738
- userInputId: string;
1739
- response: string;
1740
- changes: {
1741
- path: string;
1742
- type: "patch" | "file";
1743
- content: string;
1744
- }[];
1745
- changesAlreadyApplied: {
1746
- path: string;
1747
- type: "patch" | "file";
1748
- content: string;
1749
- }[];
1750
- addedFileVersions: {
1751
- path: string;
1752
- content: string;
1753
- }[];
1754
- resetFileVersions: boolean;
1755
- usage?: number | undefined;
1756
- remainingBalance?: number | undefined;
1757
- balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
1758
- next_quota_reset?: Date | null | undefined;
1759
- autoTopupAdded?: number | undefined;
1760
- }, {
1761
- type: "response-complete";
1762
- userInputId: string;
1763
- response: string;
1764
- changes: {
1765
- path: string;
1766
- type: "patch" | "file";
1767
- content: string;
1768
- }[];
1769
- changesAlreadyApplied: {
1770
- path: string;
1771
- type: "patch" | "file";
1772
- content: string;
1773
- }[];
1774
- addedFileVersions: {
1775
- path: string;
1776
- content: string;
1777
- }[];
1778
- resetFileVersions: boolean;
1779
- usage?: number | undefined;
1780
- remainingBalance?: number | undefined;
1781
- balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
1782
- next_quota_reset?: Date | null | undefined;
1783
- autoTopupAdded?: number | undefined;
1784
- }>, z.ZodObject<{
1785
- type: z.ZodLiteral<"prompt-response">;
1786
- promptId: z.ZodString;
1787
- agentState: z.ZodObject<{
1788
- agentContext: z.ZodString;
1789
- fileContext: z.ZodObject<{
1790
- projectRoot: z.ZodString;
1791
- cwd: z.ZodString;
1792
- fileTree: z.ZodArray<z.ZodType<import("../util/file").FileTreeNode, z.ZodTypeDef, import("../util/file").FileTreeNode>, "many">;
1793
- fileTokenScores: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodNumber>>;
1794
- tokenCallers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>>;
1795
- knowledgeFiles: z.ZodRecord<z.ZodString, z.ZodString>;
1796
- userKnowledgeFiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1797
- gitChanges: z.ZodObject<{
1798
- status: z.ZodString;
1799
- diff: z.ZodString;
1800
- diffCached: z.ZodString;
1801
- lastCommitMessages: z.ZodString;
1802
- }, "strip", z.ZodTypeAny, {
1803
- status: string;
1804
- diff: string;
1805
- diffCached: string;
1806
- lastCommitMessages: string;
1807
- }, {
1808
- status: string;
1809
- diff: string;
1810
- diffCached: string;
1811
- lastCommitMessages: string;
1812
- }>;
1813
- changesSinceLastChat: z.ZodRecord<z.ZodString, z.ZodString>;
1814
- shellConfigFiles: z.ZodRecord<z.ZodString, z.ZodString>;
1815
- systemInfo: z.ZodObject<{
1816
- platform: z.ZodString;
1817
- shell: z.ZodString;
1818
- nodeVersion: z.ZodString;
1819
- arch: z.ZodString;
1820
- homedir: z.ZodString;
1821
- cpus: z.ZodNumber;
1822
- }, "strip", z.ZodTypeAny, {
1823
- platform: string;
1824
- shell: string;
1825
- nodeVersion: string;
1826
- arch: string;
1827
- homedir: string;
1828
- cpus: number;
1829
- }, {
1830
- platform: string;
1831
- shell: string;
1832
- nodeVersion: string;
1833
- arch: string;
1834
- homedir: string;
1835
- cpus: number;
1836
- }>;
1837
- fileVersions: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodObject<{
1838
- path: z.ZodString;
1839
- content: z.ZodString;
1840
- }, "strip", z.ZodTypeAny, {
1841
- path: string;
1842
- content: string;
1843
- }, {
1844
- path: string;
1845
- content: string;
1846
- }>, "many">, "many">>;
1847
- }, "strip", z.ZodTypeAny, {
1848
- projectRoot: string;
1849
- cwd: string;
1850
- fileTree: import("../util/file").FileTreeNode[];
1851
- fileTokenScores: Record<string, Record<string, number>>;
1852
- knowledgeFiles: Record<string, string>;
1853
- gitChanges: {
1854
- status: string;
1855
- diff: string;
1856
- diffCached: string;
1857
- lastCommitMessages: string;
1858
- };
1859
- changesSinceLastChat: Record<string, string>;
1860
- shellConfigFiles: Record<string, string>;
1861
- systemInfo: {
1862
- platform: string;
1863
- shell: string;
1864
- nodeVersion: string;
1865
- arch: string;
1866
- homedir: string;
1867
- cpus: number;
1868
- };
1869
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
1870
- userKnowledgeFiles?: Record<string, string> | undefined;
1871
- fileVersions?: {
1872
- path: string;
1873
- content: string;
1874
- }[][] | undefined;
1875
- }, {
1876
- projectRoot: string;
1877
- cwd: string;
1878
- fileTree: import("../util/file").FileTreeNode[];
1879
- fileTokenScores: Record<string, Record<string, number>>;
1880
- knowledgeFiles: Record<string, string>;
1881
- gitChanges: {
1882
- status: string;
1883
- diff: string;
1884
- diffCached: string;
1885
- lastCommitMessages: string;
1886
- };
1887
- changesSinceLastChat: Record<string, string>;
1888
- shellConfigFiles: Record<string, string>;
1889
- systemInfo: {
1890
- platform: string;
1891
- shell: string;
1892
- nodeVersion: string;
1893
- arch: string;
1894
- homedir: string;
1895
- cpus: number;
1896
- };
1897
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
1898
- userKnowledgeFiles?: Record<string, string> | undefined;
1899
- fileVersions?: {
1900
- path: string;
1901
- content: string;
1902
- }[][] | undefined;
1903
- }>;
1904
- messageHistory: z.ZodArray<z.ZodIntersection<z.ZodType<import("ai").CoreMessage, z.ZodTypeDef, import("ai").CoreMessage>, z.ZodObject<{
1905
- timeToLive: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"agentStep">, z.ZodLiteral<"userPrompt">]>>;
1906
- }, "strip", z.ZodTypeAny, {
1907
- timeToLive?: "agentStep" | "userPrompt" | undefined;
1908
- }, {
1909
- timeToLive?: "agentStep" | "userPrompt" | undefined;
1910
- }>>, "many">;
1911
- agents: z.ZodDefault<z.ZodArray<z.ZodType<{
1912
- agentId: string;
1913
- agentName: import("../types/agent-state").AgentTemplateName;
1914
- agents: import("../types/agent-state").SubagentState[];
1915
- messageHistory: import("../types/message").CodebuffMessage[];
1916
- }, z.ZodTypeDef, {
1917
- agentId: string;
1918
- agentName: import("../types/agent-state").AgentTemplateName;
1919
- agents: import("../types/agent-state").SubagentState[];
1920
- messageHistory: import("../types/message").CodebuffMessage[];
1921
- }>, "many">>;
1922
- agentStepsRemaining: z.ZodNumber;
1923
- }, "strip", z.ZodTypeAny, {
1924
- agentContext: string;
1925
- fileContext: {
1926
- projectRoot: string;
1927
- cwd: string;
1928
- fileTree: import("../util/file").FileTreeNode[];
1929
- fileTokenScores: Record<string, Record<string, number>>;
1930
- knowledgeFiles: Record<string, string>;
1931
- gitChanges: {
1932
- status: string;
1933
- diff: string;
1934
- diffCached: string;
1935
- lastCommitMessages: string;
1936
- };
1937
- changesSinceLastChat: Record<string, string>;
1938
- shellConfigFiles: Record<string, string>;
1939
- systemInfo: {
1940
- platform: string;
1941
- shell: string;
1942
- nodeVersion: string;
1943
- arch: string;
1944
- homedir: string;
1945
- cpus: number;
1946
- };
1947
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
1948
- userKnowledgeFiles?: Record<string, string> | undefined;
1949
- fileVersions?: {
1950
- path: string;
1951
- content: string;
1952
- }[][] | undefined;
1953
- };
1954
- messageHistory: (import("ai").CoreMessage & {
1955
- timeToLive?: "agentStep" | "userPrompt" | undefined;
1956
- })[];
1957
- agents: {
1958
- agentId: string;
1959
- agentName: import("../types/agent-state").AgentTemplateName;
1960
- agents: import("../types/agent-state").SubagentState[];
1961
- messageHistory: import("../types/message").CodebuffMessage[];
1962
- }[];
1963
- agentStepsRemaining: number;
1964
- }, {
1965
- agentContext: string;
1966
- fileContext: {
1967
- projectRoot: string;
1968
- cwd: string;
1969
- fileTree: import("../util/file").FileTreeNode[];
1970
- fileTokenScores: Record<string, Record<string, number>>;
1971
- knowledgeFiles: Record<string, string>;
1972
- gitChanges: {
1973
- status: string;
1974
- diff: string;
1975
- diffCached: string;
1976
- lastCommitMessages: string;
1977
- };
1978
- changesSinceLastChat: Record<string, string>;
1979
- shellConfigFiles: Record<string, string>;
1980
- systemInfo: {
1981
- platform: string;
1982
- shell: string;
1983
- nodeVersion: string;
1984
- arch: string;
1985
- homedir: string;
1986
- cpus: number;
1987
- };
1988
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
1989
- userKnowledgeFiles?: Record<string, string> | undefined;
1990
- fileVersions?: {
1991
- path: string;
1992
- content: string;
1993
- }[][] | undefined;
1994
- };
1995
- messageHistory: (import("ai").CoreMessage & {
1996
- timeToLive?: "agentStep" | "userPrompt" | undefined;
1997
- })[];
1998
- agentStepsRemaining: number;
1999
- agents?: {
2000
- agentId: string;
2001
- agentName: import("../types/agent-state").AgentTemplateName;
2002
- agents: import("../types/agent-state").SubagentState[];
2003
- messageHistory: import("../types/message").CodebuffMessage[];
2004
- }[] | undefined;
2005
- }>;
2006
- toolCalls: z.ZodArray<z.ZodObject<{
2007
- toolName: z.ZodString;
2008
- args: z.ZodRecord<z.ZodString, z.ZodString>;
2009
- toolCallId: z.ZodString;
2010
- }, "strip", z.ZodTypeAny, {
2011
- toolName: string;
2012
- args: Record<string, string>;
2013
- toolCallId: string;
2014
- }, {
2015
- toolName: string;
2016
- args: Record<string, string>;
2017
- toolCallId: string;
2018
- }>, "many">;
2019
- toolResults: z.ZodArray<z.ZodObject<{
2020
- toolName: z.ZodString;
2021
- toolCallId: z.ZodString;
2022
- result: z.ZodString;
2023
- }, "strip", z.ZodTypeAny, {
2024
- toolName: string;
2025
- toolCallId: string;
2026
- result: string;
2027
- }, {
2028
- toolName: string;
2029
- toolCallId: string;
2030
- result: string;
2031
- }>, "many">;
2032
- }, "strip", z.ZodTypeAny, {
2033
- type: "prompt-response";
2034
- promptId: string;
2035
- agentState: {
2036
- agentContext: string;
2037
- fileContext: {
2038
- projectRoot: string;
2039
- cwd: string;
2040
- fileTree: import("../util/file").FileTreeNode[];
2041
- fileTokenScores: Record<string, Record<string, number>>;
2042
- knowledgeFiles: Record<string, string>;
2043
- gitChanges: {
2044
- status: string;
2045
- diff: string;
2046
- diffCached: string;
2047
- lastCommitMessages: string;
2048
- };
2049
- changesSinceLastChat: Record<string, string>;
2050
- shellConfigFiles: Record<string, string>;
2051
- systemInfo: {
2052
- platform: string;
2053
- shell: string;
2054
- nodeVersion: string;
2055
- arch: string;
2056
- homedir: string;
2057
- cpus: number;
2058
- };
2059
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
2060
- userKnowledgeFiles?: Record<string, string> | undefined;
2061
- fileVersions?: {
2062
- path: string;
2063
- content: string;
2064
- }[][] | undefined;
2065
- };
2066
- messageHistory: (import("ai").CoreMessage & {
2067
- timeToLive?: "agentStep" | "userPrompt" | undefined;
2068
- })[];
2069
- agents: {
2070
- agentId: string;
2071
- agentName: import("../types/agent-state").AgentTemplateName;
2072
- agents: import("../types/agent-state").SubagentState[];
2073
- messageHistory: import("../types/message").CodebuffMessage[];
2074
- }[];
2075
- agentStepsRemaining: number;
2076
- };
2077
- toolResults: {
2078
- toolName: string;
2079
- toolCallId: string;
2080
- result: string;
2081
- }[];
2082
- toolCalls: {
2083
- toolName: string;
2084
- args: Record<string, string>;
2085
- toolCallId: string;
2086
- }[];
2087
- }, {
2088
- type: "prompt-response";
2089
- promptId: string;
2090
- agentState: {
2091
- agentContext: string;
2092
- fileContext: {
2093
- projectRoot: string;
2094
- cwd: string;
2095
- fileTree: import("../util/file").FileTreeNode[];
2096
- fileTokenScores: Record<string, Record<string, number>>;
2097
- knowledgeFiles: Record<string, string>;
2098
- gitChanges: {
2099
- status: string;
2100
- diff: string;
2101
- diffCached: string;
2102
- lastCommitMessages: string;
2103
- };
2104
- changesSinceLastChat: Record<string, string>;
2105
- shellConfigFiles: Record<string, string>;
2106
- systemInfo: {
2107
- platform: string;
2108
- shell: string;
2109
- nodeVersion: string;
2110
- arch: string;
2111
- homedir: string;
2112
- cpus: number;
2113
- };
2114
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
2115
- userKnowledgeFiles?: Record<string, string> | undefined;
2116
- fileVersions?: {
2117
- path: string;
2118
- content: string;
2119
- }[][] | undefined;
2120
- };
2121
- messageHistory: (import("ai").CoreMessage & {
2122
- timeToLive?: "agentStep" | "userPrompt" | undefined;
2123
- })[];
2124
- agentStepsRemaining: number;
2125
- agents?: {
2126
- agentId: string;
2127
- agentName: import("../types/agent-state").AgentTemplateName;
2128
- agents: import("../types/agent-state").SubagentState[];
2129
- messageHistory: import("../types/message").CodebuffMessage[];
2130
- }[] | undefined;
2131
- };
2132
- toolResults: {
2133
- toolName: string;
2134
- toolCallId: string;
2135
- result: string;
2136
- }[];
2137
- toolCalls: {
2138
- toolName: string;
2139
- args: Record<string, string>;
2140
- toolCallId: string;
2141
- }[];
2142
- }>, z.ZodObject<{
2143
- type: z.ZodLiteral<"read-files">;
2144
- filePaths: z.ZodArray<z.ZodString, "many">;
2145
- requestId: z.ZodString;
2146
- }, "strip", z.ZodTypeAny, {
2147
- type: "read-files";
2148
- requestId: string;
2149
- filePaths: string[];
2150
- }, {
2151
- type: "read-files";
2152
- requestId: string;
2153
- filePaths: string[];
2154
- }>, z.ZodObject<{
2155
- type: z.ZodLiteral<"tool-call">;
2156
- userInputId: z.ZodString;
2157
- response: z.ZodString;
2158
- data: z.ZodObject<{
2159
- toolName: z.ZodString;
2160
- args: z.ZodRecord<z.ZodString, z.ZodString>;
2161
- toolCallId: z.ZodString;
2162
- }, "strip", z.ZodTypeAny, {
2163
- toolName: string;
2164
- args: Record<string, string>;
2165
- toolCallId: string;
2166
- }, {
2167
- toolName: string;
2168
- args: Record<string, string>;
2169
- toolCallId: string;
2170
- }>;
2171
- changes: z.ZodArray<z.ZodObject<{
2172
- type: z.ZodEnum<["patch", "file"]>;
2173
- path: z.ZodString;
2174
- content: z.ZodString;
2175
- }, "strip", z.ZodTypeAny, {
2176
- path: string;
2177
- type: "patch" | "file";
2178
- content: string;
2179
- }, {
2180
- path: string;
2181
- type: "patch" | "file";
2182
- content: string;
2183
- }>, "many">;
2184
- changesAlreadyApplied: z.ZodArray<z.ZodObject<{
2185
- type: z.ZodEnum<["patch", "file"]>;
2186
- path: z.ZodString;
2187
- content: z.ZodString;
2188
- }, "strip", z.ZodTypeAny, {
2189
- path: string;
2190
- type: "patch" | "file";
2191
- content: string;
2192
- }, {
2193
- path: string;
2194
- type: "patch" | "file";
2195
- content: string;
2196
- }>, "many">;
2197
- addedFileVersions: z.ZodArray<z.ZodObject<{
2198
- path: z.ZodString;
2199
- content: z.ZodString;
2200
- }, "strip", z.ZodTypeAny, {
2201
- path: string;
2202
- content: string;
2203
- }, {
2204
- path: string;
2205
- content: string;
2206
- }>, "many">;
2207
- resetFileVersions: z.ZodBoolean;
2208
- }, "strip", z.ZodTypeAny, {
2209
- type: "tool-call";
2210
- userInputId: string;
2211
- response: string;
2212
- changes: {
2213
- path: string;
2214
- type: "patch" | "file";
2215
- content: string;
2216
- }[];
2217
- changesAlreadyApplied: {
2218
- path: string;
2219
- type: "patch" | "file";
2220
- content: string;
2221
- }[];
2222
- addedFileVersions: {
2223
- path: string;
2224
- content: string;
2225
- }[];
2226
- resetFileVersions: boolean;
2227
- data: {
2228
- toolName: string;
2229
- args: Record<string, string>;
2230
- toolCallId: string;
2231
- };
2232
- }, {
2233
- type: "tool-call";
2234
- userInputId: string;
2235
- response: string;
2236
- changes: {
2237
- path: string;
2238
- type: "patch" | "file";
2239
- content: string;
2240
- }[];
2241
- changesAlreadyApplied: {
2242
- path: string;
2243
- type: "patch" | "file";
2244
- content: string;
2245
- }[];
2246
- addedFileVersions: {
2247
- path: string;
2248
- content: string;
2249
- }[];
2250
- resetFileVersions: boolean;
2251
- data: {
2252
- toolName: string;
2253
- args: Record<string, string>;
2254
- toolCallId: string;
2255
- };
2256
- }>, z.ZodObject<{
2257
- type: z.ZodLiteral<"terminal-command-result">;
2258
- userInputId: z.ZodString;
2259
- result: z.ZodString;
2260
- }, "strip", z.ZodTypeAny, {
2261
- type: "terminal-command-result";
2262
- result: string;
2263
- userInputId: string;
2264
- }, {
2265
- type: "terminal-command-result";
2266
- result: string;
2267
- userInputId: string;
2268
- }>, z.ZodObject<{
2269
- type: z.ZodLiteral<"npm-version-status">;
2270
- isUpToDate: z.ZodBoolean;
2271
- latestVersion: z.ZodString;
2272
- }, "strip", z.ZodTypeAny, {
2273
- type: "npm-version-status";
2274
- isUpToDate: boolean;
2275
- latestVersion: string;
2276
- }, {
2277
- type: "npm-version-status";
2278
- isUpToDate: boolean;
2279
- latestVersion: string;
2280
- }>, z.ZodObject<z.objectUtil.extendShape<{
2281
- type: z.ZodLiteral<"init-response">;
2282
- }, Omit<{
2283
- type: z.ZodLiteral<"usage-response">;
2284
- usage: z.ZodNumber;
2285
- remainingBalance: z.ZodNumber;
2286
- balanceBreakdown: z.ZodOptional<z.ZodRecord<z.ZodEnum<["free", ...("free" | "referral" | "purchase" | "admin" | "organization")[]]>, z.ZodNumber>>;
2287
- next_quota_reset: z.ZodNullable<z.ZodDate>;
2288
- autoTopupAdded: z.ZodOptional<z.ZodNumber>;
2289
- }, "type">>, "strip", z.ZodTypeAny, {
2290
- type: "init-response";
2291
- usage: number;
2292
- remainingBalance: number;
2293
- next_quota_reset: Date | null;
2294
- balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
2295
- autoTopupAdded?: number | undefined;
2296
- }, {
2297
- type: "init-response";
2298
- usage: number;
2299
- remainingBalance: number;
2300
- next_quota_reset: Date | null;
2301
- balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
2302
- autoTopupAdded?: number | undefined;
2303
- }>, z.ZodObject<{
2304
- type: z.ZodLiteral<"usage-response">;
2305
- usage: z.ZodNumber;
2306
- remainingBalance: z.ZodNumber;
2307
- balanceBreakdown: z.ZodOptional<z.ZodRecord<z.ZodEnum<["free", ...("free" | "referral" | "purchase" | "admin" | "organization")[]]>, z.ZodNumber>>;
2308
- next_quota_reset: z.ZodNullable<z.ZodDate>;
2309
- autoTopupAdded: z.ZodOptional<z.ZodNumber>;
2310
- }, "strip", z.ZodTypeAny, {
2311
- type: "usage-response";
2312
- usage: number;
2313
- remainingBalance: number;
2314
- next_quota_reset: Date | null;
2315
- balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
2316
- autoTopupAdded?: number | undefined;
2317
- }, {
2318
- type: "usage-response";
2319
- usage: number;
2320
- remainingBalance: number;
2321
- next_quota_reset: Date | null;
2322
- balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
2323
- autoTopupAdded?: number | undefined;
2324
- }>, z.ZodObject<{
2325
- type: z.ZodLiteral<"message-cost-response">;
2326
- promptId: z.ZodString;
2327
- credits: z.ZodNumber;
2328
- }, "strip", z.ZodTypeAny, {
2329
- type: "message-cost-response";
2330
- promptId: string;
2331
- credits: number;
2332
- }, {
2333
- type: "message-cost-response";
2334
- promptId: string;
2335
- credits: number;
2336
- }>, z.ZodObject<{
2337
- type: z.ZodLiteral<"action-error">;
2338
- message: z.ZodString;
2339
- error: z.ZodOptional<z.ZodString>;
2340
- remainingBalance: z.ZodOptional<z.ZodNumber>;
2341
- }, "strip", z.ZodTypeAny, {
2342
- message: string;
2343
- type: "action-error";
2344
- remainingBalance?: number | undefined;
2345
- error?: string | undefined;
2346
- }, {
2347
- message: string;
2348
- type: "action-error";
2349
- remainingBalance?: number | undefined;
2350
- error?: string | undefined;
2351
- }>, z.ZodObject<{
2352
- type: z.ZodLiteral<"commit-message-response">;
2353
- commitMessage: z.ZodString;
2354
- }, "strip", z.ZodTypeAny, {
2355
- type: "commit-message-response";
2356
- commitMessage: string;
2357
- }, {
2358
- type: "commit-message-response";
2359
- commitMessage: string;
2360
- }>, z.ZodObject<{
2361
- type: z.ZodLiteral<"request-reconnect">;
2362
- }, "strip", z.ZodTypeAny, {
2363
- type: "request-reconnect";
2364
- }, {
2365
- type: "request-reconnect";
2366
- }>]>;
2367
- }, "strip", z.ZodTypeAny, {
2368
- type: "action";
2369
- data: {
2370
- type: "usage-response";
2371
- usage: number;
2372
- remainingBalance: number;
2373
- next_quota_reset: Date | null;
2374
- balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
2375
- autoTopupAdded?: number | undefined;
2376
- } | {
2377
- type: "init-response";
2378
- usage: number;
2379
- remainingBalance: number;
2380
- next_quota_reset: Date | null;
2381
- balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
2382
- autoTopupAdded?: number | undefined;
2383
- } | {
2384
- type: "response-complete";
2385
- userInputId: string;
2386
- response: string;
2387
- changes: {
2388
- path: string;
2389
- type: "patch" | "file";
2390
- content: string;
2391
- }[];
2392
- changesAlreadyApplied: {
2393
- path: string;
2394
- type: "patch" | "file";
2395
- content: string;
2396
- }[];
2397
- addedFileVersions: {
2398
- path: string;
2399
- content: string;
2400
- }[];
2401
- resetFileVersions: boolean;
2402
- usage?: number | undefined;
2403
- remainingBalance?: number | undefined;
2404
- balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
2405
- next_quota_reset?: Date | null | undefined;
2406
- autoTopupAdded?: number | undefined;
2407
- } | {
2408
- type: "message-cost-response";
2409
- promptId: string;
2410
- credits: number;
2411
- } | {
2412
- type: "prompt-response";
2413
- promptId: string;
2414
- agentState: {
2415
- agentContext: string;
2416
- fileContext: {
2417
- projectRoot: string;
2418
- cwd: string;
2419
- fileTree: import("../util/file").FileTreeNode[];
2420
- fileTokenScores: Record<string, Record<string, number>>;
2421
- knowledgeFiles: Record<string, string>;
2422
- gitChanges: {
2423
- status: string;
2424
- diff: string;
2425
- diffCached: string;
2426
- lastCommitMessages: string;
2427
- };
2428
- changesSinceLastChat: Record<string, string>;
2429
- shellConfigFiles: Record<string, string>;
2430
- systemInfo: {
2431
- platform: string;
2432
- shell: string;
2433
- nodeVersion: string;
2434
- arch: string;
2435
- homedir: string;
2436
- cpus: number;
2437
- };
2438
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
2439
- userKnowledgeFiles?: Record<string, string> | undefined;
2440
- fileVersions?: {
2441
- path: string;
2442
- content: string;
2443
- }[][] | undefined;
2444
- };
2445
- messageHistory: (import("ai").CoreMessage & {
2446
- timeToLive?: "agentStep" | "userPrompt" | undefined;
2447
- })[];
2448
- agents: {
2449
- agentId: string;
2450
- agentName: import("../types/agent-state").AgentTemplateName;
2451
- agents: import("../types/agent-state").SubagentState[];
2452
- messageHistory: import("../types/message").CodebuffMessage[];
2453
- }[];
2454
- agentStepsRemaining: number;
2455
- };
2456
- toolResults: {
2457
- toolName: string;
2458
- toolCallId: string;
2459
- result: string;
2460
- }[];
2461
- toolCalls: {
2462
- toolName: string;
2463
- args: Record<string, string>;
2464
- toolCallId: string;
2465
- }[];
2466
- } | {
2467
- type: "response-chunk";
2468
- userInputId: string;
2469
- chunk: string;
2470
- } | {
2471
- type: "read-files";
2472
- requestId: string;
2473
- filePaths: string[];
2474
- } | {
2475
- type: "tool-call";
2476
- userInputId: string;
2477
- response: string;
2478
- changes: {
2479
- path: string;
2480
- type: "patch" | "file";
2481
- content: string;
2482
- }[];
2483
- changesAlreadyApplied: {
2484
- path: string;
2485
- type: "patch" | "file";
2486
- content: string;
2487
- }[];
2488
- addedFileVersions: {
2489
- path: string;
2490
- content: string;
2491
- }[];
2492
- resetFileVersions: boolean;
2493
- data: {
2494
- toolName: string;
2495
- args: Record<string, string>;
2496
- toolCallId: string;
2497
- };
2498
- } | {
2499
- type: "terminal-command-result";
2500
- result: string;
2501
- userInputId: string;
2502
- } | {
2503
- type: "npm-version-status";
2504
- isUpToDate: boolean;
2505
- latestVersion: string;
2506
- } | {
2507
- message: string;
2508
- type: "action-error";
2509
- remainingBalance?: number | undefined;
2510
- error?: string | undefined;
2511
- } | {
2512
- type: "commit-message-response";
2513
- commitMessage: string;
2514
- } | {
2515
- type: "request-reconnect";
2516
- };
2517
- }, {
2518
- type: "action";
2519
- data: {
2520
- type: "usage-response";
2521
- usage: number;
2522
- remainingBalance: number;
2523
- next_quota_reset: Date | null;
2524
- balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
2525
- autoTopupAdded?: number | undefined;
2526
- } | {
2527
- type: "init-response";
2528
- usage: number;
2529
- remainingBalance: number;
2530
- next_quota_reset: Date | null;
2531
- balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
2532
- autoTopupAdded?: number | undefined;
2533
- } | {
2534
- type: "response-complete";
2535
- userInputId: string;
2536
- response: string;
2537
- changes: {
2538
- path: string;
2539
- type: "patch" | "file";
2540
- content: string;
2541
- }[];
2542
- changesAlreadyApplied: {
2543
- path: string;
2544
- type: "patch" | "file";
2545
- content: string;
2546
- }[];
2547
- addedFileVersions: {
2548
- path: string;
2549
- content: string;
2550
- }[];
2551
- resetFileVersions: boolean;
2552
- usage?: number | undefined;
2553
- remainingBalance?: number | undefined;
2554
- balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
2555
- next_quota_reset?: Date | null | undefined;
2556
- autoTopupAdded?: number | undefined;
2557
- } | {
2558
- type: "message-cost-response";
2559
- promptId: string;
2560
- credits: number;
2561
- } | {
2562
- type: "prompt-response";
2563
- promptId: string;
2564
- agentState: {
2565
- agentContext: string;
2566
- fileContext: {
2567
- projectRoot: string;
2568
- cwd: string;
2569
- fileTree: import("../util/file").FileTreeNode[];
2570
- fileTokenScores: Record<string, Record<string, number>>;
2571
- knowledgeFiles: Record<string, string>;
2572
- gitChanges: {
2573
- status: string;
2574
- diff: string;
2575
- diffCached: string;
2576
- lastCommitMessages: string;
2577
- };
2578
- changesSinceLastChat: Record<string, string>;
2579
- shellConfigFiles: Record<string, string>;
2580
- systemInfo: {
2581
- platform: string;
2582
- shell: string;
2583
- nodeVersion: string;
2584
- arch: string;
2585
- homedir: string;
2586
- cpus: number;
2587
- };
2588
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
2589
- userKnowledgeFiles?: Record<string, string> | undefined;
2590
- fileVersions?: {
2591
- path: string;
2592
- content: string;
2593
- }[][] | undefined;
2594
- };
2595
- messageHistory: (import("ai").CoreMessage & {
2596
- timeToLive?: "agentStep" | "userPrompt" | undefined;
2597
- })[];
2598
- agentStepsRemaining: number;
2599
- agents?: {
2600
- agentId: string;
2601
- agentName: import("../types/agent-state").AgentTemplateName;
2602
- agents: import("../types/agent-state").SubagentState[];
2603
- messageHistory: import("../types/message").CodebuffMessage[];
2604
- }[] | undefined;
2605
- };
2606
- toolResults: {
2607
- toolName: string;
2608
- toolCallId: string;
2609
- result: string;
2610
- }[];
2611
- toolCalls: {
2612
- toolName: string;
2613
- args: Record<string, string>;
2614
- toolCallId: string;
2615
- }[];
2616
- } | {
2617
- type: "response-chunk";
2618
- userInputId: string;
2619
- chunk: string;
2620
- } | {
2621
- type: "read-files";
2622
- requestId: string;
2623
- filePaths: string[];
2624
- } | {
2625
- type: "tool-call";
2626
- userInputId: string;
2627
- response: string;
2628
- changes: {
2629
- path: string;
2630
- type: "patch" | "file";
2631
- content: string;
2632
- }[];
2633
- changesAlreadyApplied: {
2634
- path: string;
2635
- type: "patch" | "file";
2636
- content: string;
2637
- }[];
2638
- addedFileVersions: {
2639
- path: string;
2640
- content: string;
2641
- }[];
2642
- resetFileVersions: boolean;
2643
- data: {
2644
- toolName: string;
2645
- args: Record<string, string>;
2646
- toolCallId: string;
2647
- };
2648
- } | {
2649
- type: "terminal-command-result";
2650
- result: string;
2651
- userInputId: string;
2652
- } | {
2653
- type: "npm-version-status";
2654
- isUpToDate: boolean;
2655
- latestVersion: string;
2656
- } | {
2657
- message: string;
2658
- type: "action-error";
2659
- remainingBalance?: number | undefined;
2660
- error?: string | undefined;
2661
- } | {
2662
- type: "commit-message-response";
2663
- commitMessage: string;
2664
- } | {
2665
- type: "request-reconnect";
2666
- };
2667
- }>;
2668
- };
2669
- export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
2670
- type: z.ZodLiteral<"ack">;
2671
- txid: z.ZodOptional<z.ZodNumber>;
2672
- success: z.ZodBoolean;
2673
- error: z.ZodOptional<z.ZodString>;
2674
- }, "strip", z.ZodTypeAny, {
2675
- type: "ack";
2676
- success: boolean;
2677
- error?: string | undefined;
2678
- txid?: number | undefined;
2679
- }, {
2680
- type: "ack";
2681
- success: boolean;
2682
- error?: string | undefined;
2683
- txid?: number | undefined;
2684
- }>, z.ZodObject<{
2685
- type: z.ZodLiteral<"action">;
2686
- data: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2687
- type: z.ZodLiteral<"response-chunk">;
2688
- userInputId: z.ZodString;
2689
- chunk: z.ZodString;
2690
- }, "strip", z.ZodTypeAny, {
2691
- type: "response-chunk";
2692
- userInputId: string;
2693
- chunk: string;
2694
- }, {
2695
- type: "response-chunk";
2696
- userInputId: string;
2697
- chunk: string;
2698
- }>, z.ZodObject<z.objectUtil.extendShape<{
2699
- type: z.ZodLiteral<"response-complete">;
2700
- userInputId: z.ZodString;
2701
- response: z.ZodString;
2702
- changes: z.ZodArray<z.ZodObject<{
2703
- type: z.ZodEnum<["patch", "file"]>;
2704
- path: z.ZodString;
2705
- content: z.ZodString;
2706
- }, "strip", z.ZodTypeAny, {
2707
- path: string;
2708
- type: "patch" | "file";
2709
- content: string;
2710
- }, {
2711
- path: string;
2712
- type: "patch" | "file";
2713
- content: string;
2714
- }>, "many">;
2715
- changesAlreadyApplied: z.ZodArray<z.ZodObject<{
2716
- type: z.ZodEnum<["patch", "file"]>;
2717
- path: z.ZodString;
2718
- content: z.ZodString;
2719
- }, "strip", z.ZodTypeAny, {
2720
- path: string;
2721
- type: "patch" | "file";
2722
- content: string;
2723
- }, {
2724
- path: string;
2725
- type: "patch" | "file";
2726
- content: string;
2727
- }>, "many">;
2728
- addedFileVersions: z.ZodArray<z.ZodObject<{
2729
- path: z.ZodString;
2730
- content: z.ZodString;
2731
- }, "strip", z.ZodTypeAny, {
2732
- path: string;
2733
- content: string;
2734
- }, {
2735
- path: string;
2736
- content: string;
2737
- }>, "many">;
2738
- resetFileVersions: z.ZodBoolean;
2739
- }, {
2740
- usage: z.ZodOptional<z.ZodNumber>;
2741
- remainingBalance: z.ZodOptional<z.ZodNumber>;
2742
- balanceBreakdown: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodEnum<["free", ...("free" | "referral" | "purchase" | "admin" | "organization")[]]>, z.ZodNumber>>>;
2743
- next_quota_reset: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
2744
- autoTopupAdded: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
2745
- }>, "strip", z.ZodTypeAny, {
2746
- type: "response-complete";
2747
- userInputId: string;
2748
- response: string;
2749
- changes: {
2750
- path: string;
2751
- type: "patch" | "file";
2752
- content: string;
2753
- }[];
2754
- changesAlreadyApplied: {
2755
- path: string;
2756
- type: "patch" | "file";
2757
- content: string;
2758
- }[];
2759
- addedFileVersions: {
2760
- path: string;
2761
- content: string;
2762
- }[];
2763
- resetFileVersions: boolean;
2764
- usage?: number | undefined;
2765
- remainingBalance?: number | undefined;
2766
- balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
2767
- next_quota_reset?: Date | null | undefined;
2768
- autoTopupAdded?: number | undefined;
2769
- }, {
2770
- type: "response-complete";
2771
- userInputId: string;
2772
- response: string;
2773
- changes: {
2774
- path: string;
2775
- type: "patch" | "file";
2776
- content: string;
2777
- }[];
2778
- changesAlreadyApplied: {
2779
- path: string;
2780
- type: "patch" | "file";
2781
- content: string;
2782
- }[];
2783
- addedFileVersions: {
2784
- path: string;
2785
- content: string;
2786
- }[];
2787
- resetFileVersions: boolean;
2788
- usage?: number | undefined;
2789
- remainingBalance?: number | undefined;
2790
- balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
2791
- next_quota_reset?: Date | null | undefined;
2792
- autoTopupAdded?: number | undefined;
2793
- }>, z.ZodObject<{
2794
- type: z.ZodLiteral<"prompt-response">;
2795
- promptId: z.ZodString;
2796
- agentState: z.ZodObject<{
2797
- agentContext: z.ZodString;
2798
- fileContext: z.ZodObject<{
2799
- projectRoot: z.ZodString;
2800
- cwd: z.ZodString;
2801
- fileTree: z.ZodArray<z.ZodType<import("../util/file").FileTreeNode, z.ZodTypeDef, import("../util/file").FileTreeNode>, "many">;
2802
- fileTokenScores: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodNumber>>;
2803
- tokenCallers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>>;
2804
- knowledgeFiles: z.ZodRecord<z.ZodString, z.ZodString>;
2805
- userKnowledgeFiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2806
- gitChanges: z.ZodObject<{
2807
- status: z.ZodString;
2808
- diff: z.ZodString;
2809
- diffCached: z.ZodString;
2810
- lastCommitMessages: z.ZodString;
2811
- }, "strip", z.ZodTypeAny, {
2812
- status: string;
2813
- diff: string;
2814
- diffCached: string;
2815
- lastCommitMessages: string;
2816
- }, {
2817
- status: string;
2818
- diff: string;
2819
- diffCached: string;
2820
- lastCommitMessages: string;
2821
- }>;
2822
- changesSinceLastChat: z.ZodRecord<z.ZodString, z.ZodString>;
2823
- shellConfigFiles: z.ZodRecord<z.ZodString, z.ZodString>;
2824
- systemInfo: z.ZodObject<{
2825
- platform: z.ZodString;
2826
- shell: z.ZodString;
2827
- nodeVersion: z.ZodString;
2828
- arch: z.ZodString;
2829
- homedir: z.ZodString;
2830
- cpus: z.ZodNumber;
2831
- }, "strip", z.ZodTypeAny, {
2832
- platform: string;
2833
- shell: string;
2834
- nodeVersion: string;
2835
- arch: string;
2836
- homedir: string;
2837
- cpus: number;
2838
- }, {
2839
- platform: string;
2840
- shell: string;
2841
- nodeVersion: string;
2842
- arch: string;
2843
- homedir: string;
2844
- cpus: number;
2845
- }>;
2846
- fileVersions: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodObject<{
2847
- path: z.ZodString;
2848
- content: z.ZodString;
2849
- }, "strip", z.ZodTypeAny, {
2850
- path: string;
2851
- content: string;
2852
- }, {
2853
- path: string;
2854
- content: string;
2855
- }>, "many">, "many">>;
2856
- }, "strip", z.ZodTypeAny, {
2857
- projectRoot: string;
2858
- cwd: string;
2859
- fileTree: import("../util/file").FileTreeNode[];
2860
- fileTokenScores: Record<string, Record<string, number>>;
2861
- knowledgeFiles: Record<string, string>;
2862
- gitChanges: {
2863
- status: string;
2864
- diff: string;
2865
- diffCached: string;
2866
- lastCommitMessages: string;
2867
- };
2868
- changesSinceLastChat: Record<string, string>;
2869
- shellConfigFiles: Record<string, string>;
2870
- systemInfo: {
2871
- platform: string;
2872
- shell: string;
2873
- nodeVersion: string;
2874
- arch: string;
2875
- homedir: string;
2876
- cpus: number;
2877
- };
2878
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
2879
- userKnowledgeFiles?: Record<string, string> | undefined;
2880
- fileVersions?: {
2881
- path: string;
2882
- content: string;
2883
- }[][] | undefined;
2884
- }, {
2885
- projectRoot: string;
2886
- cwd: string;
2887
- fileTree: import("../util/file").FileTreeNode[];
2888
- fileTokenScores: Record<string, Record<string, number>>;
2889
- knowledgeFiles: Record<string, string>;
2890
- gitChanges: {
2891
- status: string;
2892
- diff: string;
2893
- diffCached: string;
2894
- lastCommitMessages: string;
2895
- };
2896
- changesSinceLastChat: Record<string, string>;
2897
- shellConfigFiles: Record<string, string>;
2898
- systemInfo: {
2899
- platform: string;
2900
- shell: string;
2901
- nodeVersion: string;
2902
- arch: string;
2903
- homedir: string;
2904
- cpus: number;
2905
- };
2906
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
2907
- userKnowledgeFiles?: Record<string, string> | undefined;
2908
- fileVersions?: {
2909
- path: string;
2910
- content: string;
2911
- }[][] | undefined;
2912
- }>;
2913
- messageHistory: z.ZodArray<z.ZodIntersection<z.ZodType<import("ai").CoreMessage, z.ZodTypeDef, import("ai").CoreMessage>, z.ZodObject<{
2914
- timeToLive: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"agentStep">, z.ZodLiteral<"userPrompt">]>>;
2915
- }, "strip", z.ZodTypeAny, {
2916
- timeToLive?: "agentStep" | "userPrompt" | undefined;
2917
- }, {
2918
- timeToLive?: "agentStep" | "userPrompt" | undefined;
2919
- }>>, "many">;
2920
- agents: z.ZodDefault<z.ZodArray<z.ZodType<{
2921
- agentId: string;
2922
- agentName: import("../types/agent-state").AgentTemplateName;
2923
- agents: import("../types/agent-state").SubagentState[];
2924
- messageHistory: import("../types/message").CodebuffMessage[];
2925
- }, z.ZodTypeDef, {
2926
- agentId: string;
2927
- agentName: import("../types/agent-state").AgentTemplateName;
2928
- agents: import("../types/agent-state").SubagentState[];
2929
- messageHistory: import("../types/message").CodebuffMessage[];
2930
- }>, "many">>;
2931
- agentStepsRemaining: z.ZodNumber;
2932
- }, "strip", z.ZodTypeAny, {
2933
- agentContext: string;
2934
- fileContext: {
2935
- projectRoot: string;
2936
- cwd: string;
2937
- fileTree: import("../util/file").FileTreeNode[];
2938
- fileTokenScores: Record<string, Record<string, number>>;
2939
- knowledgeFiles: Record<string, string>;
2940
- gitChanges: {
2941
- status: string;
2942
- diff: string;
2943
- diffCached: string;
2944
- lastCommitMessages: string;
2945
- };
2946
- changesSinceLastChat: Record<string, string>;
2947
- shellConfigFiles: Record<string, string>;
2948
- systemInfo: {
2949
- platform: string;
2950
- shell: string;
2951
- nodeVersion: string;
2952
- arch: string;
2953
- homedir: string;
2954
- cpus: number;
2955
- };
2956
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
2957
- userKnowledgeFiles?: Record<string, string> | undefined;
2958
- fileVersions?: {
2959
- path: string;
2960
- content: string;
2961
- }[][] | undefined;
2962
- };
2963
- messageHistory: (import("ai").CoreMessage & {
2964
- timeToLive?: "agentStep" | "userPrompt" | undefined;
2965
- })[];
2966
- agents: {
2967
- agentId: string;
2968
- agentName: import("../types/agent-state").AgentTemplateName;
2969
- agents: import("../types/agent-state").SubagentState[];
2970
- messageHistory: import("../types/message").CodebuffMessage[];
2971
- }[];
2972
- agentStepsRemaining: number;
2973
- }, {
2974
- agentContext: string;
2975
- fileContext: {
2976
- projectRoot: string;
2977
- cwd: string;
2978
- fileTree: import("../util/file").FileTreeNode[];
2979
- fileTokenScores: Record<string, Record<string, number>>;
2980
- knowledgeFiles: Record<string, string>;
2981
- gitChanges: {
2982
- status: string;
2983
- diff: string;
2984
- diffCached: string;
2985
- lastCommitMessages: string;
2986
- };
2987
- changesSinceLastChat: Record<string, string>;
2988
- shellConfigFiles: Record<string, string>;
2989
- systemInfo: {
2990
- platform: string;
2991
- shell: string;
2992
- nodeVersion: string;
2993
- arch: string;
2994
- homedir: string;
2995
- cpus: number;
2996
- };
2997
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
2998
- userKnowledgeFiles?: Record<string, string> | undefined;
2999
- fileVersions?: {
3000
- path: string;
3001
- content: string;
3002
- }[][] | undefined;
3003
- };
3004
- messageHistory: (import("ai").CoreMessage & {
3005
- timeToLive?: "agentStep" | "userPrompt" | undefined;
3006
- })[];
3007
- agentStepsRemaining: number;
3008
- agents?: {
3009
- agentId: string;
3010
- agentName: import("../types/agent-state").AgentTemplateName;
3011
- agents: import("../types/agent-state").SubagentState[];
3012
- messageHistory: import("../types/message").CodebuffMessage[];
3013
- }[] | undefined;
3014
- }>;
3015
- toolCalls: z.ZodArray<z.ZodObject<{
3016
- toolName: z.ZodString;
3017
- args: z.ZodRecord<z.ZodString, z.ZodString>;
3018
- toolCallId: z.ZodString;
3019
- }, "strip", z.ZodTypeAny, {
3020
- toolName: string;
3021
- args: Record<string, string>;
3022
- toolCallId: string;
3023
- }, {
3024
- toolName: string;
3025
- args: Record<string, string>;
3026
- toolCallId: string;
3027
- }>, "many">;
3028
- toolResults: z.ZodArray<z.ZodObject<{
3029
- toolName: z.ZodString;
3030
- toolCallId: z.ZodString;
3031
- result: z.ZodString;
3032
- }, "strip", z.ZodTypeAny, {
3033
- toolName: string;
3034
- toolCallId: string;
3035
- result: string;
3036
- }, {
3037
- toolName: string;
3038
- toolCallId: string;
3039
- result: string;
3040
- }>, "many">;
3041
- }, "strip", z.ZodTypeAny, {
3042
- type: "prompt-response";
3043
- promptId: string;
3044
- agentState: {
3045
- agentContext: string;
3046
- fileContext: {
3047
- projectRoot: string;
3048
- cwd: string;
3049
- fileTree: import("../util/file").FileTreeNode[];
3050
- fileTokenScores: Record<string, Record<string, number>>;
3051
- knowledgeFiles: Record<string, string>;
3052
- gitChanges: {
3053
- status: string;
3054
- diff: string;
3055
- diffCached: string;
3056
- lastCommitMessages: string;
3057
- };
3058
- changesSinceLastChat: Record<string, string>;
3059
- shellConfigFiles: Record<string, string>;
3060
- systemInfo: {
3061
- platform: string;
3062
- shell: string;
3063
- nodeVersion: string;
3064
- arch: string;
3065
- homedir: string;
3066
- cpus: number;
3067
- };
3068
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
3069
- userKnowledgeFiles?: Record<string, string> | undefined;
3070
- fileVersions?: {
3071
- path: string;
3072
- content: string;
3073
- }[][] | undefined;
3074
- };
3075
- messageHistory: (import("ai").CoreMessage & {
3076
- timeToLive?: "agentStep" | "userPrompt" | undefined;
3077
- })[];
3078
- agents: {
3079
- agentId: string;
3080
- agentName: import("../types/agent-state").AgentTemplateName;
3081
- agents: import("../types/agent-state").SubagentState[];
3082
- messageHistory: import("../types/message").CodebuffMessage[];
3083
- }[];
3084
- agentStepsRemaining: number;
3085
- };
3086
- toolResults: {
3087
- toolName: string;
3088
- toolCallId: string;
3089
- result: string;
3090
- }[];
3091
- toolCalls: {
3092
- toolName: string;
3093
- args: Record<string, string>;
3094
- toolCallId: string;
3095
- }[];
3096
- }, {
3097
- type: "prompt-response";
3098
- promptId: string;
3099
- agentState: {
3100
- agentContext: string;
3101
- fileContext: {
3102
- projectRoot: string;
3103
- cwd: string;
3104
- fileTree: import("../util/file").FileTreeNode[];
3105
- fileTokenScores: Record<string, Record<string, number>>;
3106
- knowledgeFiles: Record<string, string>;
3107
- gitChanges: {
3108
- status: string;
3109
- diff: string;
3110
- diffCached: string;
3111
- lastCommitMessages: string;
3112
- };
3113
- changesSinceLastChat: Record<string, string>;
3114
- shellConfigFiles: Record<string, string>;
3115
- systemInfo: {
3116
- platform: string;
3117
- shell: string;
3118
- nodeVersion: string;
3119
- arch: string;
3120
- homedir: string;
3121
- cpus: number;
3122
- };
3123
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
3124
- userKnowledgeFiles?: Record<string, string> | undefined;
3125
- fileVersions?: {
3126
- path: string;
3127
- content: string;
3128
- }[][] | undefined;
3129
- };
3130
- messageHistory: (import("ai").CoreMessage & {
3131
- timeToLive?: "agentStep" | "userPrompt" | undefined;
3132
- })[];
3133
- agentStepsRemaining: number;
3134
- agents?: {
3135
- agentId: string;
3136
- agentName: import("../types/agent-state").AgentTemplateName;
3137
- agents: import("../types/agent-state").SubagentState[];
3138
- messageHistory: import("../types/message").CodebuffMessage[];
3139
- }[] | undefined;
3140
- };
3141
- toolResults: {
3142
- toolName: string;
3143
- toolCallId: string;
3144
- result: string;
3145
- }[];
3146
- toolCalls: {
3147
- toolName: string;
3148
- args: Record<string, string>;
3149
- toolCallId: string;
3150
- }[];
3151
- }>, z.ZodObject<{
3152
- type: z.ZodLiteral<"read-files">;
3153
- filePaths: z.ZodArray<z.ZodString, "many">;
3154
- requestId: z.ZodString;
3155
- }, "strip", z.ZodTypeAny, {
3156
- type: "read-files";
3157
- requestId: string;
3158
- filePaths: string[];
3159
- }, {
3160
- type: "read-files";
3161
- requestId: string;
3162
- filePaths: string[];
3163
- }>, z.ZodObject<{
3164
- type: z.ZodLiteral<"tool-call">;
3165
- userInputId: z.ZodString;
3166
- response: z.ZodString;
3167
- data: z.ZodObject<{
3168
- toolName: z.ZodString;
3169
- args: z.ZodRecord<z.ZodString, z.ZodString>;
3170
- toolCallId: z.ZodString;
3171
- }, "strip", z.ZodTypeAny, {
3172
- toolName: string;
3173
- args: Record<string, string>;
3174
- toolCallId: string;
3175
- }, {
3176
- toolName: string;
3177
- args: Record<string, string>;
3178
- toolCallId: string;
3179
- }>;
3180
- changes: z.ZodArray<z.ZodObject<{
3181
- type: z.ZodEnum<["patch", "file"]>;
3182
- path: z.ZodString;
3183
- content: z.ZodString;
3184
- }, "strip", z.ZodTypeAny, {
3185
- path: string;
3186
- type: "patch" | "file";
3187
- content: string;
3188
- }, {
3189
- path: string;
3190
- type: "patch" | "file";
3191
- content: string;
3192
- }>, "many">;
3193
- changesAlreadyApplied: z.ZodArray<z.ZodObject<{
3194
- type: z.ZodEnum<["patch", "file"]>;
3195
- path: z.ZodString;
3196
- content: z.ZodString;
3197
- }, "strip", z.ZodTypeAny, {
3198
- path: string;
3199
- type: "patch" | "file";
3200
- content: string;
3201
- }, {
3202
- path: string;
3203
- type: "patch" | "file";
3204
- content: string;
3205
- }>, "many">;
3206
- addedFileVersions: z.ZodArray<z.ZodObject<{
3207
- path: z.ZodString;
3208
- content: z.ZodString;
3209
- }, "strip", z.ZodTypeAny, {
3210
- path: string;
3211
- content: string;
3212
- }, {
3213
- path: string;
3214
- content: string;
3215
- }>, "many">;
3216
- resetFileVersions: z.ZodBoolean;
3217
- }, "strip", z.ZodTypeAny, {
3218
- type: "tool-call";
3219
- userInputId: string;
3220
- response: string;
3221
- changes: {
3222
- path: string;
3223
- type: "patch" | "file";
3224
- content: string;
3225
- }[];
3226
- changesAlreadyApplied: {
3227
- path: string;
3228
- type: "patch" | "file";
3229
- content: string;
3230
- }[];
3231
- addedFileVersions: {
3232
- path: string;
3233
- content: string;
3234
- }[];
3235
- resetFileVersions: boolean;
3236
- data: {
3237
- toolName: string;
3238
- args: Record<string, string>;
3239
- toolCallId: string;
3240
- };
3241
- }, {
3242
- type: "tool-call";
3243
- userInputId: string;
3244
- response: string;
3245
- changes: {
3246
- path: string;
3247
- type: "patch" | "file";
3248
- content: string;
3249
- }[];
3250
- changesAlreadyApplied: {
3251
- path: string;
3252
- type: "patch" | "file";
3253
- content: string;
3254
- }[];
3255
- addedFileVersions: {
3256
- path: string;
3257
- content: string;
3258
- }[];
3259
- resetFileVersions: boolean;
3260
- data: {
3261
- toolName: string;
3262
- args: Record<string, string>;
3263
- toolCallId: string;
3264
- };
3265
- }>, z.ZodObject<{
3266
- type: z.ZodLiteral<"terminal-command-result">;
3267
- userInputId: z.ZodString;
3268
- result: z.ZodString;
3269
- }, "strip", z.ZodTypeAny, {
3270
- type: "terminal-command-result";
3271
- result: string;
3272
- userInputId: string;
3273
- }, {
3274
- type: "terminal-command-result";
3275
- result: string;
3276
- userInputId: string;
3277
- }>, z.ZodObject<{
3278
- type: z.ZodLiteral<"npm-version-status">;
3279
- isUpToDate: z.ZodBoolean;
3280
- latestVersion: z.ZodString;
3281
- }, "strip", z.ZodTypeAny, {
3282
- type: "npm-version-status";
3283
- isUpToDate: boolean;
3284
- latestVersion: string;
3285
- }, {
3286
- type: "npm-version-status";
3287
- isUpToDate: boolean;
3288
- latestVersion: string;
3289
- }>, z.ZodObject<z.objectUtil.extendShape<{
3290
- type: z.ZodLiteral<"init-response">;
3291
- }, Omit<{
3292
- type: z.ZodLiteral<"usage-response">;
3293
- usage: z.ZodNumber;
3294
- remainingBalance: z.ZodNumber;
3295
- balanceBreakdown: z.ZodOptional<z.ZodRecord<z.ZodEnum<["free", ...("free" | "referral" | "purchase" | "admin" | "organization")[]]>, z.ZodNumber>>;
3296
- next_quota_reset: z.ZodNullable<z.ZodDate>;
3297
- autoTopupAdded: z.ZodOptional<z.ZodNumber>;
3298
- }, "type">>, "strip", z.ZodTypeAny, {
3299
- type: "init-response";
3300
- usage: number;
3301
- remainingBalance: number;
3302
- next_quota_reset: Date | null;
3303
- balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
3304
- autoTopupAdded?: number | undefined;
3305
- }, {
3306
- type: "init-response";
3307
- usage: number;
3308
- remainingBalance: number;
3309
- next_quota_reset: Date | null;
3310
- balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
3311
- autoTopupAdded?: number | undefined;
3312
- }>, z.ZodObject<{
3313
- type: z.ZodLiteral<"usage-response">;
3314
- usage: z.ZodNumber;
3315
- remainingBalance: z.ZodNumber;
3316
- balanceBreakdown: z.ZodOptional<z.ZodRecord<z.ZodEnum<["free", ...("free" | "referral" | "purchase" | "admin" | "organization")[]]>, z.ZodNumber>>;
3317
- next_quota_reset: z.ZodNullable<z.ZodDate>;
3318
- autoTopupAdded: z.ZodOptional<z.ZodNumber>;
3319
- }, "strip", z.ZodTypeAny, {
3320
- type: "usage-response";
3321
- usage: number;
3322
- remainingBalance: number;
3323
- next_quota_reset: Date | null;
3324
- balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
3325
- autoTopupAdded?: number | undefined;
3326
- }, {
3327
- type: "usage-response";
3328
- usage: number;
3329
- remainingBalance: number;
3330
- next_quota_reset: Date | null;
3331
- balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
3332
- autoTopupAdded?: number | undefined;
3333
- }>, z.ZodObject<{
3334
- type: z.ZodLiteral<"message-cost-response">;
3335
- promptId: z.ZodString;
3336
- credits: z.ZodNumber;
3337
- }, "strip", z.ZodTypeAny, {
3338
- type: "message-cost-response";
3339
- promptId: string;
3340
- credits: number;
3341
- }, {
3342
- type: "message-cost-response";
3343
- promptId: string;
3344
- credits: number;
3345
- }>, z.ZodObject<{
3346
- type: z.ZodLiteral<"action-error">;
3347
- message: z.ZodString;
3348
- error: z.ZodOptional<z.ZodString>;
3349
- remainingBalance: z.ZodOptional<z.ZodNumber>;
3350
- }, "strip", z.ZodTypeAny, {
3351
- message: string;
3352
- type: "action-error";
3353
- remainingBalance?: number | undefined;
3354
- error?: string | undefined;
3355
- }, {
3356
- message: string;
3357
- type: "action-error";
3358
- remainingBalance?: number | undefined;
3359
- error?: string | undefined;
3360
- }>, z.ZodObject<{
3361
- type: z.ZodLiteral<"commit-message-response">;
3362
- commitMessage: z.ZodString;
3363
- }, "strip", z.ZodTypeAny, {
3364
- type: "commit-message-response";
3365
- commitMessage: string;
3366
- }, {
3367
- type: "commit-message-response";
3368
- commitMessage: string;
3369
- }>, z.ZodObject<{
3370
- type: z.ZodLiteral<"request-reconnect">;
3371
- }, "strip", z.ZodTypeAny, {
3372
- type: "request-reconnect";
3373
- }, {
3374
- type: "request-reconnect";
3375
- }>]>;
3376
- }, "strip", z.ZodTypeAny, {
3377
- type: "action";
3378
- data: {
3379
- type: "usage-response";
3380
- usage: number;
3381
- remainingBalance: number;
3382
- next_quota_reset: Date | null;
3383
- balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
3384
- autoTopupAdded?: number | undefined;
3385
- } | {
3386
- type: "init-response";
3387
- usage: number;
3388
- remainingBalance: number;
3389
- next_quota_reset: Date | null;
3390
- balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
3391
- autoTopupAdded?: number | undefined;
3392
- } | {
3393
- type: "response-complete";
3394
- userInputId: string;
3395
- response: string;
3396
- changes: {
3397
- path: string;
3398
- type: "patch" | "file";
3399
- content: string;
3400
- }[];
3401
- changesAlreadyApplied: {
3402
- path: string;
3403
- type: "patch" | "file";
3404
- content: string;
3405
- }[];
3406
- addedFileVersions: {
3407
- path: string;
3408
- content: string;
3409
- }[];
3410
- resetFileVersions: boolean;
3411
- usage?: number | undefined;
3412
- remainingBalance?: number | undefined;
3413
- balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
3414
- next_quota_reset?: Date | null | undefined;
3415
- autoTopupAdded?: number | undefined;
3416
- } | {
3417
- type: "message-cost-response";
3418
- promptId: string;
3419
- credits: number;
3420
- } | {
3421
- type: "prompt-response";
3422
- promptId: string;
3423
- agentState: {
3424
- agentContext: string;
3425
- fileContext: {
3426
- projectRoot: string;
3427
- cwd: string;
3428
- fileTree: import("../util/file").FileTreeNode[];
3429
- fileTokenScores: Record<string, Record<string, number>>;
3430
- knowledgeFiles: Record<string, string>;
3431
- gitChanges: {
3432
- status: string;
3433
- diff: string;
3434
- diffCached: string;
3435
- lastCommitMessages: string;
3436
- };
3437
- changesSinceLastChat: Record<string, string>;
3438
- shellConfigFiles: Record<string, string>;
3439
- systemInfo: {
3440
- platform: string;
3441
- shell: string;
3442
- nodeVersion: string;
3443
- arch: string;
3444
- homedir: string;
3445
- cpus: number;
3446
- };
3447
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
3448
- userKnowledgeFiles?: Record<string, string> | undefined;
3449
- fileVersions?: {
3450
- path: string;
3451
- content: string;
3452
- }[][] | undefined;
3453
- };
3454
- messageHistory: (import("ai").CoreMessage & {
3455
- timeToLive?: "agentStep" | "userPrompt" | undefined;
3456
- })[];
3457
- agents: {
3458
- agentId: string;
3459
- agentName: import("../types/agent-state").AgentTemplateName;
3460
- agents: import("../types/agent-state").SubagentState[];
3461
- messageHistory: import("../types/message").CodebuffMessage[];
3462
- }[];
3463
- agentStepsRemaining: number;
3464
- };
3465
- toolResults: {
3466
- toolName: string;
3467
- toolCallId: string;
3468
- result: string;
3469
- }[];
3470
- toolCalls: {
3471
- toolName: string;
3472
- args: Record<string, string>;
3473
- toolCallId: string;
3474
- }[];
3475
- } | {
3476
- type: "response-chunk";
3477
- userInputId: string;
3478
- chunk: string;
3479
- } | {
3480
- type: "read-files";
3481
- requestId: string;
3482
- filePaths: string[];
3483
- } | {
3484
- type: "tool-call";
3485
- userInputId: string;
3486
- response: string;
3487
- changes: {
3488
- path: string;
3489
- type: "patch" | "file";
3490
- content: string;
3491
- }[];
3492
- changesAlreadyApplied: {
3493
- path: string;
3494
- type: "patch" | "file";
3495
- content: string;
3496
- }[];
3497
- addedFileVersions: {
3498
- path: string;
3499
- content: string;
3500
- }[];
3501
- resetFileVersions: boolean;
3502
- data: {
3503
- toolName: string;
3504
- args: Record<string, string>;
3505
- toolCallId: string;
3506
- };
3507
- } | {
3508
- type: "terminal-command-result";
3509
- result: string;
3510
- userInputId: string;
3511
- } | {
3512
- type: "npm-version-status";
3513
- isUpToDate: boolean;
3514
- latestVersion: string;
3515
- } | {
3516
- message: string;
3517
- type: "action-error";
3518
- remainingBalance?: number | undefined;
3519
- error?: string | undefined;
3520
- } | {
3521
- type: "commit-message-response";
3522
- commitMessage: string;
3523
- } | {
3524
- type: "request-reconnect";
3525
- };
3526
- }, {
3527
- type: "action";
3528
- data: {
3529
- type: "usage-response";
3530
- usage: number;
3531
- remainingBalance: number;
3532
- next_quota_reset: Date | null;
3533
- balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
3534
- autoTopupAdded?: number | undefined;
3535
- } | {
3536
- type: "init-response";
3537
- usage: number;
3538
- remainingBalance: number;
3539
- next_quota_reset: Date | null;
3540
- balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
3541
- autoTopupAdded?: number | undefined;
3542
- } | {
3543
- type: "response-complete";
3544
- userInputId: string;
3545
- response: string;
3546
- changes: {
3547
- path: string;
3548
- type: "patch" | "file";
3549
- content: string;
3550
- }[];
3551
- changesAlreadyApplied: {
3552
- path: string;
3553
- type: "patch" | "file";
3554
- content: string;
3555
- }[];
3556
- addedFileVersions: {
3557
- path: string;
3558
- content: string;
3559
- }[];
3560
- resetFileVersions: boolean;
3561
- usage?: number | undefined;
3562
- remainingBalance?: number | undefined;
3563
- balanceBreakdown?: Partial<Record<"free" | "referral" | "purchase" | "admin" | "organization", number>> | undefined;
3564
- next_quota_reset?: Date | null | undefined;
3565
- autoTopupAdded?: number | undefined;
3566
- } | {
3567
- type: "message-cost-response";
3568
- promptId: string;
3569
- credits: number;
3570
- } | {
3571
- type: "prompt-response";
3572
- promptId: string;
3573
- agentState: {
3574
- agentContext: string;
3575
- fileContext: {
3576
- projectRoot: string;
3577
- cwd: string;
3578
- fileTree: import("../util/file").FileTreeNode[];
3579
- fileTokenScores: Record<string, Record<string, number>>;
3580
- knowledgeFiles: Record<string, string>;
3581
- gitChanges: {
3582
- status: string;
3583
- diff: string;
3584
- diffCached: string;
3585
- lastCommitMessages: string;
3586
- };
3587
- changesSinceLastChat: Record<string, string>;
3588
- shellConfigFiles: Record<string, string>;
3589
- systemInfo: {
3590
- platform: string;
3591
- shell: string;
3592
- nodeVersion: string;
3593
- arch: string;
3594
- homedir: string;
3595
- cpus: number;
3596
- };
3597
- tokenCallers?: Record<string, Record<string, string[]>> | undefined;
3598
- userKnowledgeFiles?: Record<string, string> | undefined;
3599
- fileVersions?: {
3600
- path: string;
3601
- content: string;
3602
- }[][] | undefined;
3603
- };
3604
- messageHistory: (import("ai").CoreMessage & {
3605
- timeToLive?: "agentStep" | "userPrompt" | undefined;
3606
- })[];
3607
- agentStepsRemaining: number;
3608
- agents?: {
3609
- agentId: string;
3610
- agentName: import("../types/agent-state").AgentTemplateName;
3611
- agents: import("../types/agent-state").SubagentState[];
3612
- messageHistory: import("../types/message").CodebuffMessage[];
3613
- }[] | undefined;
3614
- };
3615
- toolResults: {
3616
- toolName: string;
3617
- toolCallId: string;
3618
- result: string;
3619
- }[];
3620
- toolCalls: {
3621
- toolName: string;
3622
- args: Record<string, string>;
3623
- toolCallId: string;
3624
- }[];
3625
- } | {
3626
- type: "response-chunk";
3627
- userInputId: string;
3628
- chunk: string;
3629
- } | {
3630
- type: "read-files";
3631
- requestId: string;
3632
- filePaths: string[];
3633
- } | {
3634
- type: "tool-call";
3635
- userInputId: string;
3636
- response: string;
3637
- changes: {
3638
- path: string;
3639
- type: "patch" | "file";
3640
- content: string;
3641
- }[];
3642
- changesAlreadyApplied: {
3643
- path: string;
3644
- type: "patch" | "file";
3645
- content: string;
3646
- }[];
3647
- addedFileVersions: {
3648
- path: string;
3649
- content: string;
3650
- }[];
3651
- resetFileVersions: boolean;
3652
- data: {
3653
- toolName: string;
3654
- args: Record<string, string>;
3655
- toolCallId: string;
3656
- };
3657
- } | {
3658
- type: "terminal-command-result";
3659
- result: string;
3660
- userInputId: string;
3661
- } | {
3662
- type: "npm-version-status";
3663
- isUpToDate: boolean;
3664
- latestVersion: string;
3665
- } | {
3666
- message: string;
3667
- type: "action-error";
3668
- remainingBalance?: number | undefined;
3669
- error?: string | undefined;
3670
- } | {
3671
- type: "commit-message-response";
3672
- commitMessage: string;
3673
- } | {
3674
- type: "request-reconnect";
3675
- };
3676
- }>]>;
3677
- export type ServerMessageType = keyof typeof SERVER_MESSAGE_SCHEMAS;
3678
- export type ServerMessage<T extends ServerMessageType = ServerMessageType> = z.infer<(typeof SERVER_MESSAGE_SCHEMAS)[T]>;
3679
- //# sourceMappingURL=websocket-schema.d.ts.map