@withbuddi/buddi 0.1.0-pre.20 → 0.1.0-pre.21

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 (400) hide show
  1. package/node_modules/@buddi/cli/dist/.tsbuildinfo +1 -1
  2. package/node_modules/@buddi/cli/dist/args.d.ts +6 -0
  3. package/node_modules/@buddi/cli/dist/args.d.ts.map +1 -1
  4. package/node_modules/@buddi/cli/dist/args.js +15 -0
  5. package/node_modules/@buddi/cli/dist/args.js.map +1 -1
  6. package/node_modules/@buddi/cli/dist/commands.d.ts.map +1 -1
  7. package/node_modules/@buddi/cli/dist/commands.js +17 -0
  8. package/node_modules/@buddi/cli/dist/commands.js.map +1 -1
  9. package/node_modules/@buddi/cli/dist/main.d.ts.map +1 -1
  10. package/node_modules/@buddi/cli/dist/main.js +7 -0
  11. package/node_modules/@buddi/cli/dist/main.js.map +1 -1
  12. package/node_modules/@buddi/core/dist/.tsbuildinfo +1 -1
  13. package/node_modules/@buddi/core/dist/host/build.d.ts.map +1 -1
  14. package/node_modules/@buddi/core/dist/host/build.js +33 -16
  15. package/node_modules/@buddi/core/dist/host/build.js.map +1 -1
  16. package/node_modules/@buddi/core/dist/host/types.d.ts +17 -0
  17. package/node_modules/@buddi/core/dist/host/types.d.ts.map +1 -1
  18. package/node_modules/@buddi/core/dist/pages/__fixtures__/demo.d.ts.map +1 -1
  19. package/node_modules/@buddi/core/dist/pages/__fixtures__/demo.js +1 -0
  20. package/node_modules/@buddi/core/dist/pages/__fixtures__/demo.js.map +1 -1
  21. package/node_modules/@buddi/core/dist/pages.d.ts +74 -0
  22. package/node_modules/@buddi/core/dist/pages.d.ts.map +1 -1
  23. package/node_modules/@buddi/core/dist/pages.js +27 -1
  24. package/node_modules/@buddi/core/dist/pages.js.map +1 -1
  25. package/node_modules/@buddi/core/dist/plugin/index.d.ts +2 -2
  26. package/node_modules/@buddi/core/dist/plugin/index.d.ts.map +1 -1
  27. package/node_modules/@buddi/core/dist/plugin/version.d.ts +1 -1
  28. package/node_modules/@buddi/core/dist/plugin/version.js +1 -1
  29. package/node_modules/@buddi/core/dist/provider-accounts.d.ts +8 -0
  30. package/node_modules/@buddi/core/dist/provider-accounts.d.ts.map +1 -1
  31. package/node_modules/@buddi/core/dist/provider-accounts.js +8 -0
  32. package/node_modules/@buddi/core/dist/provider-accounts.js.map +1 -1
  33. package/node_modules/@buddi/core/dist/surfaces.d.ts +11 -0
  34. package/node_modules/@buddi/core/dist/surfaces.d.ts.map +1 -1
  35. package/node_modules/@buddi/core/dist/surfaces.js +4 -0
  36. package/node_modules/@buddi/core/dist/surfaces.js.map +1 -1
  37. package/node_modules/@buddi/core/migrations/048_surface_chat_voice.sql +13 -0
  38. package/node_modules/@buddi/core/migrations/049_surface_chat_voice_form.sql +8 -0
  39. package/node_modules/@buddi/gateway/dist/.tsbuildinfo +1 -1
  40. package/node_modules/@buddi/gateway/dist/agents-cli.d.ts +2 -0
  41. package/node_modules/@buddi/gateway/dist/agents-cli.d.ts.map +1 -1
  42. package/node_modules/@buddi/gateway/dist/agents-cli.js +5 -3
  43. package/node_modules/@buddi/gateway/dist/agents-cli.js.map +1 -1
  44. package/node_modules/@buddi/gateway/dist/chat/session.d.ts.map +1 -1
  45. package/node_modules/@buddi/gateway/dist/chat/session.js +2 -2
  46. package/node_modules/@buddi/gateway/dist/chat/session.js.map +1 -1
  47. package/node_modules/@buddi/gateway/dist/chat/usage.d.ts +16 -0
  48. package/node_modules/@buddi/gateway/dist/chat/usage.d.ts.map +1 -1
  49. package/node_modules/@buddi/gateway/dist/chat/usage.js +53 -11
  50. package/node_modules/@buddi/gateway/dist/chat/usage.js.map +1 -1
  51. package/node_modules/@buddi/gateway/dist/index.d.ts +1 -0
  52. package/node_modules/@buddi/gateway/dist/index.d.ts.map +1 -1
  53. package/node_modules/@buddi/gateway/dist/index.js +1 -0
  54. package/node_modules/@buddi/gateway/dist/index.js.map +1 -1
  55. package/node_modules/@buddi/gateway/dist/provider-accounts.d.ts +4 -0
  56. package/node_modules/@buddi/gateway/dist/provider-accounts.d.ts.map +1 -1
  57. package/node_modules/@buddi/gateway/dist/provider-accounts.js +3 -1
  58. package/node_modules/@buddi/gateway/dist/provider-accounts.js.map +1 -1
  59. package/node_modules/@buddi/gateway/dist/speech-cli.d.ts +43 -0
  60. package/node_modules/@buddi/gateway/dist/speech-cli.d.ts.map +1 -0
  61. package/node_modules/@buddi/gateway/dist/speech-cli.js +105 -0
  62. package/node_modules/@buddi/gateway/dist/speech-cli.js.map +1 -0
  63. package/node_modules/@buddi/gateway/dist/telegram/api.d.ts +10 -0
  64. package/node_modules/@buddi/gateway/dist/telegram/api.d.ts.map +1 -1
  65. package/node_modules/@buddi/gateway/dist/telegram/api.js +12 -0
  66. package/node_modules/@buddi/gateway/dist/telegram/api.js.map +1 -1
  67. package/node_modules/@buddi/gateway/dist/telegram/browser-view.d.ts +2 -1
  68. package/node_modules/@buddi/gateway/dist/telegram/browser-view.d.ts.map +1 -1
  69. package/node_modules/@buddi/gateway/dist/telegram/browser-view.js +4 -2
  70. package/node_modules/@buddi/gateway/dist/telegram/browser-view.js.map +1 -1
  71. package/node_modules/@buddi/gateway/dist/telegram/main.d.ts.map +1 -1
  72. package/node_modules/@buddi/gateway/dist/telegram/main.js +10 -2
  73. package/node_modules/@buddi/gateway/dist/telegram/main.js.map +1 -1
  74. package/node_modules/@buddi/gateway/dist/telegram/surface.d.ts +25 -0
  75. package/node_modules/@buddi/gateway/dist/telegram/surface.d.ts.map +1 -1
  76. package/node_modules/@buddi/gateway/dist/telegram/surface.js +212 -10
  77. package/node_modules/@buddi/gateway/dist/telegram/surface.js.map +1 -1
  78. package/node_modules/@buddi/gateway/dist/telegram/voice.d.ts +112 -0
  79. package/node_modules/@buddi/gateway/dist/telegram/voice.d.ts.map +1 -0
  80. package/node_modules/@buddi/gateway/dist/telegram/voice.js +220 -0
  81. package/node_modules/@buddi/gateway/dist/telegram/voice.js.map +1 -0
  82. package/node_modules/@buddi/gateway/dist/web/chat.d.ts +31 -8
  83. package/node_modules/@buddi/gateway/dist/web/chat.d.ts.map +1 -1
  84. package/node_modules/@buddi/gateway/dist/web/chat.js +3 -2
  85. package/node_modules/@buddi/gateway/dist/web/chat.js.map +1 -1
  86. package/node_modules/@buddi/gateway/dist/web/onboarding.d.ts +13 -2
  87. package/node_modules/@buddi/gateway/dist/web/onboarding.d.ts.map +1 -1
  88. package/node_modules/@buddi/gateway/dist/web/onboarding.js +24 -3
  89. package/node_modules/@buddi/gateway/dist/web/onboarding.js.map +1 -1
  90. package/node_modules/@buddi/gateway/dist/web/read.d.ts +15 -12
  91. package/node_modules/@buddi/gateway/dist/web/read.d.ts.map +1 -1
  92. package/node_modules/@buddi/gateway/dist/web/read.js +9 -10
  93. package/node_modules/@buddi/gateway/dist/web/read.js.map +1 -1
  94. package/node_modules/@buddi/gateway/dist/web/server.d.ts.map +1 -1
  95. package/node_modules/@buddi/gateway/dist/web/server.js +13 -0
  96. package/node_modules/@buddi/gateway/dist/web/server.js.map +1 -1
  97. package/node_modules/@buddi/gateway/dist/web/speech.d.ts +47 -0
  98. package/node_modules/@buddi/gateway/dist/web/speech.d.ts.map +1 -0
  99. package/node_modules/@buddi/gateway/dist/web/speech.js +83 -0
  100. package/node_modules/@buddi/gateway/dist/web/speech.js.map +1 -0
  101. package/node_modules/@buddi/gateway/dist/web/stream.d.ts +0 -24
  102. package/node_modules/@buddi/gateway/dist/web/stream.d.ts.map +1 -1
  103. package/node_modules/@buddi/gateway/dist/web/stream.js +26 -2
  104. package/node_modules/@buddi/gateway/dist/web/stream.js.map +1 -1
  105. package/node_modules/@buddi/gateway/dist/web/usage-view.d.ts +15 -0
  106. package/node_modules/@buddi/gateway/dist/web/usage-view.d.ts.map +1 -0
  107. package/node_modules/@buddi/gateway/dist/web/usage-view.js +20 -0
  108. package/node_modules/@buddi/gateway/dist/web/usage-view.js.map +1 -0
  109. package/node_modules/@buddi/install/dist/.tsbuildinfo +1 -1
  110. package/node_modules/@buddi/runtime/dist/.tsbuildinfo +1 -1
  111. package/node_modules/@buddi/runtime/dist/anthropic.d.ts +18 -0
  112. package/node_modules/@buddi/runtime/dist/anthropic.d.ts.map +1 -1
  113. package/node_modules/@buddi/runtime/dist/anthropic.js +65 -13
  114. package/node_modules/@buddi/runtime/dist/anthropic.js.map +1 -1
  115. package/node_modules/@buddi/runtime/dist/codex-direct.d.ts.map +1 -1
  116. package/node_modules/@buddi/runtime/dist/codex-direct.js +11 -3
  117. package/node_modules/@buddi/runtime/dist/codex-direct.js.map +1 -1
  118. package/node_modules/@buddi/runtime/dist/context-window.d.ts.map +1 -1
  119. package/node_modules/@buddi/runtime/dist/context-window.js +13 -4
  120. package/node_modules/@buddi/runtime/dist/context-window.js.map +1 -1
  121. package/node_modules/@buddi/runtime/dist/loop.d.ts.map +1 -1
  122. package/node_modules/@buddi/runtime/dist/loop.js +6 -0
  123. package/node_modules/@buddi/runtime/dist/loop.js.map +1 -1
  124. package/node_modules/@buddi/runtime/dist/openai.d.ts +16 -4
  125. package/node_modules/@buddi/runtime/dist/openai.d.ts.map +1 -1
  126. package/node_modules/@buddi/runtime/dist/openai.js +23 -4
  127. package/node_modules/@buddi/runtime/dist/openai.js.map +1 -1
  128. package/node_modules/@buddi/runtime/dist/provider-models.d.ts.map +1 -1
  129. package/node_modules/@buddi/runtime/dist/provider-models.js +5 -1
  130. package/node_modules/@buddi/runtime/dist/provider-models.js.map +1 -1
  131. package/node_modules/@buddi/tool-artifacts/dist/.tsbuildinfo +1 -1
  132. package/node_modules/@buddi/tool-browser/dist/.tsbuildinfo +1 -1
  133. package/node_modules/@buddi/tool-browser/dist/computer.d.ts +53 -1
  134. package/node_modules/@buddi/tool-browser/dist/computer.d.ts.map +1 -1
  135. package/node_modules/@buddi/tool-browser/dist/computer.js +154 -5
  136. package/node_modules/@buddi/tool-browser/dist/computer.js.map +1 -1
  137. package/node_modules/@buddi/tool-browser/dist/controller.d.ts +20 -3
  138. package/node_modules/@buddi/tool-browser/dist/controller.d.ts.map +1 -1
  139. package/node_modules/@buddi/tool-browser/dist/controller.js +170 -5
  140. package/node_modules/@buddi/tool-browser/dist/controller.js.map +1 -1
  141. package/node_modules/@buddi/tool-browser/dist/index.d.ts.map +1 -1
  142. package/node_modules/@buddi/tool-browser/dist/index.js +9 -1
  143. package/node_modules/@buddi/tool-browser/dist/index.js.map +1 -1
  144. package/node_modules/@buddi/tool-browser/dist/service.d.ts +14 -1
  145. package/node_modules/@buddi/tool-browser/dist/service.d.ts.map +1 -1
  146. package/node_modules/@buddi/tool-browser/dist/service.js +28 -5
  147. package/node_modules/@buddi/tool-browser/dist/service.js.map +1 -1
  148. package/node_modules/@buddi/tool-browser/dist/types.d.ts +11 -0
  149. package/node_modules/@buddi/tool-browser/dist/types.d.ts.map +1 -1
  150. package/node_modules/@buddi/tool-browser/dist/types.js +16 -3
  151. package/node_modules/@buddi/tool-browser/dist/types.js.map +1 -1
  152. package/node_modules/@buddi/tool-browser/package.json +1 -1
  153. package/node_modules/@buddi/tool-email/dist/.tsbuildinfo +1 -1
  154. package/node_modules/@buddi/tool-host/dist/.tsbuildinfo +1 -1
  155. package/node_modules/@buddi/tool-memory/dist/.tsbuildinfo +1 -1
  156. package/node_modules/@buddi/tool-web/dist/.tsbuildinfo +1 -1
  157. package/node_modules/imapflow/CHANGELOG.md +29 -0
  158. package/node_modules/imapflow/dist/cjs/commands/append.js +12 -12
  159. package/node_modules/imapflow/dist/cjs/commands/authenticate.d.ts +3 -8
  160. package/node_modules/imapflow/dist/cjs/commands/close.js +2 -1
  161. package/node_modules/imapflow/dist/cjs/commands/copy.js +4 -4
  162. package/node_modules/imapflow/dist/cjs/commands/create.js +2 -3
  163. package/node_modules/imapflow/dist/cjs/commands/delete.js +4 -4
  164. package/node_modules/imapflow/dist/cjs/commands/expunge.js +8 -5
  165. package/node_modules/imapflow/dist/cjs/commands/fetch.js +12 -10
  166. package/node_modules/imapflow/dist/cjs/commands/idle.js +6 -2
  167. package/node_modules/imapflow/dist/cjs/commands/list.js +22 -18
  168. package/node_modules/imapflow/dist/cjs/commands/move.js +11 -6
  169. package/node_modules/imapflow/dist/cjs/commands/namespace.js +1 -1
  170. package/node_modules/imapflow/dist/cjs/commands/quota.js +10 -9
  171. package/node_modules/imapflow/dist/cjs/commands/rename.js +4 -4
  172. package/node_modules/imapflow/dist/cjs/commands/search.js +7 -8
  173. package/node_modules/imapflow/dist/cjs/commands/select.js +12 -9
  174. package/node_modules/imapflow/dist/cjs/commands/status.js +11 -11
  175. package/node_modules/imapflow/dist/cjs/commands/store.js +5 -5
  176. package/node_modules/imapflow/dist/cjs/commands/subscribe.js +2 -17
  177. package/node_modules/imapflow/dist/cjs/commands/subscription.d.ts +10 -0
  178. package/node_modules/imapflow/dist/cjs/commands/subscription.js +29 -0
  179. package/node_modules/imapflow/dist/cjs/commands/unsubscribe.js +2 -17
  180. package/node_modules/imapflow/dist/cjs/download.d.ts +22 -0
  181. package/node_modules/imapflow/dist/cjs/download.js +588 -0
  182. package/node_modules/imapflow/dist/cjs/errors.d.ts +50 -1
  183. package/node_modules/imapflow/dist/cjs/errors.js +53 -1
  184. package/node_modules/imapflow/dist/cjs/handler/imap-compiler.js +1 -1
  185. package/node_modules/imapflow/dist/cjs/handler/imap-stream.d.ts +13 -2
  186. package/node_modules/imapflow/dist/cjs/handler/imap-stream.js +51 -30
  187. package/node_modules/imapflow/dist/cjs/handler/parser-instance.js +2 -2
  188. package/node_modules/imapflow/dist/cjs/handler/token-parser.js +15 -9
  189. package/node_modules/imapflow/dist/cjs/imap-flow.d.ts +30 -84
  190. package/node_modules/imapflow/dist/cjs/imap-flow.js +282 -734
  191. package/node_modules/imapflow/dist/cjs/jp-decoder.js +1 -1
  192. package/node_modules/imapflow/dist/cjs/package-info.d.ts +1 -1
  193. package/node_modules/imapflow/dist/cjs/package-info.js +3 -3
  194. package/node_modules/imapflow/dist/cjs/search-compiler.js +5 -12
  195. package/node_modules/imapflow/dist/cjs/tools.d.ts +52 -11
  196. package/node_modules/imapflow/dist/cjs/tools.js +86 -23
  197. package/node_modules/imapflow/dist/cjs/types.d.ts +30 -16
  198. package/node_modules/imapflow/dist/esm/commands/append.js +13 -13
  199. package/node_modules/imapflow/dist/esm/commands/authenticate.d.ts +3 -8
  200. package/node_modules/imapflow/dist/esm/commands/close.js +2 -1
  201. package/node_modules/imapflow/dist/esm/commands/copy.js +5 -5
  202. package/node_modules/imapflow/dist/esm/commands/create.js +3 -4
  203. package/node_modules/imapflow/dist/esm/commands/delete.js +5 -5
  204. package/node_modules/imapflow/dist/esm/commands/expunge.js +9 -6
  205. package/node_modules/imapflow/dist/esm/commands/fetch.js +13 -11
  206. package/node_modules/imapflow/dist/esm/commands/idle.js +7 -3
  207. package/node_modules/imapflow/dist/esm/commands/list.js +22 -18
  208. package/node_modules/imapflow/dist/esm/commands/move.js +12 -7
  209. package/node_modules/imapflow/dist/esm/commands/namespace.js +2 -2
  210. package/node_modules/imapflow/dist/esm/commands/quota.js +11 -10
  211. package/node_modules/imapflow/dist/esm/commands/rename.js +5 -5
  212. package/node_modules/imapflow/dist/esm/commands/search.js +8 -9
  213. package/node_modules/imapflow/dist/esm/commands/select.js +13 -10
  214. package/node_modules/imapflow/dist/esm/commands/status.js +12 -12
  215. package/node_modules/imapflow/dist/esm/commands/store.js +6 -6
  216. package/node_modules/imapflow/dist/esm/commands/subscribe.js +2 -17
  217. package/node_modules/imapflow/dist/esm/commands/subscription.d.ts +10 -0
  218. package/node_modules/imapflow/dist/esm/commands/subscription.js +26 -0
  219. package/node_modules/imapflow/dist/esm/commands/unsubscribe.js +2 -17
  220. package/node_modules/imapflow/dist/esm/download.d.ts +22 -0
  221. package/node_modules/imapflow/dist/esm/download.js +581 -0
  222. package/node_modules/imapflow/dist/esm/errors.d.ts +50 -1
  223. package/node_modules/imapflow/dist/esm/errors.js +52 -0
  224. package/node_modules/imapflow/dist/esm/handler/imap-compiler.js +1 -1
  225. package/node_modules/imapflow/dist/esm/handler/imap-stream.d.ts +13 -2
  226. package/node_modules/imapflow/dist/esm/handler/imap-stream.js +51 -30
  227. package/node_modules/imapflow/dist/esm/handler/parser-instance.js +2 -2
  228. package/node_modules/imapflow/dist/esm/handler/token-parser.js +15 -9
  229. package/node_modules/imapflow/dist/esm/imap-flow.d.ts +30 -84
  230. package/node_modules/imapflow/dist/esm/imap-flow.js +282 -735
  231. package/node_modules/imapflow/dist/esm/jp-decoder.js +1 -1
  232. package/node_modules/imapflow/dist/esm/package-info.d.ts +1 -1
  233. package/node_modules/imapflow/dist/esm/package-info.js +3 -3
  234. package/node_modules/imapflow/dist/esm/search-compiler.js +5 -12
  235. package/node_modules/imapflow/dist/esm/tools.d.ts +52 -11
  236. package/node_modules/imapflow/dist/esm/tools.js +79 -21
  237. package/node_modules/imapflow/dist/esm/types.d.ts +30 -16
  238. package/node_modules/imapflow/package.json +4 -4
  239. package/package.json +2 -2
  240. package/packages/cli/dist/.tsbuildinfo +1 -1
  241. package/packages/cli/dist/args.d.ts +6 -0
  242. package/packages/cli/dist/args.d.ts.map +1 -1
  243. package/packages/cli/dist/args.js +15 -0
  244. package/packages/cli/dist/args.js.map +1 -1
  245. package/packages/cli/dist/commands.d.ts.map +1 -1
  246. package/packages/cli/dist/commands.js +17 -0
  247. package/packages/cli/dist/commands.js.map +1 -1
  248. package/packages/cli/dist/main.d.ts.map +1 -1
  249. package/packages/cli/dist/main.js +7 -0
  250. package/packages/cli/dist/main.js.map +1 -1
  251. package/packages/core/dist/.tsbuildinfo +1 -1
  252. package/packages/core/dist/host/build.d.ts.map +1 -1
  253. package/packages/core/dist/host/build.js +33 -16
  254. package/packages/core/dist/host/build.js.map +1 -1
  255. package/packages/core/dist/host/types.d.ts +17 -0
  256. package/packages/core/dist/host/types.d.ts.map +1 -1
  257. package/packages/core/dist/pages/__fixtures__/demo.d.ts.map +1 -1
  258. package/packages/core/dist/pages/__fixtures__/demo.js +1 -0
  259. package/packages/core/dist/pages/__fixtures__/demo.js.map +1 -1
  260. package/packages/core/dist/pages.d.ts +74 -0
  261. package/packages/core/dist/pages.d.ts.map +1 -1
  262. package/packages/core/dist/pages.js +27 -1
  263. package/packages/core/dist/pages.js.map +1 -1
  264. package/packages/core/dist/plugin/index.d.ts +2 -2
  265. package/packages/core/dist/plugin/index.d.ts.map +1 -1
  266. package/packages/core/dist/plugin/version.d.ts +1 -1
  267. package/packages/core/dist/plugin/version.js +1 -1
  268. package/packages/core/dist/provider-accounts.d.ts +8 -0
  269. package/packages/core/dist/provider-accounts.d.ts.map +1 -1
  270. package/packages/core/dist/provider-accounts.js +8 -0
  271. package/packages/core/dist/provider-accounts.js.map +1 -1
  272. package/packages/core/dist/surfaces.d.ts +11 -0
  273. package/packages/core/dist/surfaces.d.ts.map +1 -1
  274. package/packages/core/dist/surfaces.js +4 -0
  275. package/packages/core/dist/surfaces.js.map +1 -1
  276. package/packages/core/migrations/048_surface_chat_voice.sql +13 -0
  277. package/packages/core/migrations/049_surface_chat_voice_form.sql +8 -0
  278. package/packages/gateway/dist/.tsbuildinfo +1 -1
  279. package/packages/gateway/dist/agents-cli.d.ts +2 -0
  280. package/packages/gateway/dist/agents-cli.d.ts.map +1 -1
  281. package/packages/gateway/dist/agents-cli.js +5 -3
  282. package/packages/gateway/dist/agents-cli.js.map +1 -1
  283. package/packages/gateway/dist/chat/session.d.ts.map +1 -1
  284. package/packages/gateway/dist/chat/session.js +2 -2
  285. package/packages/gateway/dist/chat/session.js.map +1 -1
  286. package/packages/gateway/dist/chat/usage.d.ts +16 -0
  287. package/packages/gateway/dist/chat/usage.d.ts.map +1 -1
  288. package/packages/gateway/dist/chat/usage.js +53 -11
  289. package/packages/gateway/dist/chat/usage.js.map +1 -1
  290. package/packages/gateway/dist/index.d.ts +1 -0
  291. package/packages/gateway/dist/index.d.ts.map +1 -1
  292. package/packages/gateway/dist/index.js +1 -0
  293. package/packages/gateway/dist/index.js.map +1 -1
  294. package/packages/gateway/dist/provider-accounts.d.ts +4 -0
  295. package/packages/gateway/dist/provider-accounts.d.ts.map +1 -1
  296. package/packages/gateway/dist/provider-accounts.js +3 -1
  297. package/packages/gateway/dist/provider-accounts.js.map +1 -1
  298. package/packages/gateway/dist/speech-cli.d.ts +43 -0
  299. package/packages/gateway/dist/speech-cli.d.ts.map +1 -0
  300. package/packages/gateway/dist/speech-cli.js +105 -0
  301. package/packages/gateway/dist/speech-cli.js.map +1 -0
  302. package/packages/gateway/dist/telegram/api.d.ts +10 -0
  303. package/packages/gateway/dist/telegram/api.d.ts.map +1 -1
  304. package/packages/gateway/dist/telegram/api.js +12 -0
  305. package/packages/gateway/dist/telegram/api.js.map +1 -1
  306. package/packages/gateway/dist/telegram/browser-view.d.ts +2 -1
  307. package/packages/gateway/dist/telegram/browser-view.d.ts.map +1 -1
  308. package/packages/gateway/dist/telegram/browser-view.js +4 -2
  309. package/packages/gateway/dist/telegram/browser-view.js.map +1 -1
  310. package/packages/gateway/dist/telegram/main.d.ts.map +1 -1
  311. package/packages/gateway/dist/telegram/main.js +10 -2
  312. package/packages/gateway/dist/telegram/main.js.map +1 -1
  313. package/packages/gateway/dist/telegram/surface.d.ts +25 -0
  314. package/packages/gateway/dist/telegram/surface.d.ts.map +1 -1
  315. package/packages/gateway/dist/telegram/surface.js +212 -10
  316. package/packages/gateway/dist/telegram/surface.js.map +1 -1
  317. package/packages/gateway/dist/telegram/voice.d.ts +112 -0
  318. package/packages/gateway/dist/telegram/voice.d.ts.map +1 -0
  319. package/packages/gateway/dist/telegram/voice.js +220 -0
  320. package/packages/gateway/dist/telegram/voice.js.map +1 -0
  321. package/packages/gateway/dist/web/chat.d.ts +31 -8
  322. package/packages/gateway/dist/web/chat.d.ts.map +1 -1
  323. package/packages/gateway/dist/web/chat.js +3 -2
  324. package/packages/gateway/dist/web/chat.js.map +1 -1
  325. package/packages/gateway/dist/web/onboarding.d.ts +13 -2
  326. package/packages/gateway/dist/web/onboarding.d.ts.map +1 -1
  327. package/packages/gateway/dist/web/onboarding.js +24 -3
  328. package/packages/gateway/dist/web/onboarding.js.map +1 -1
  329. package/packages/gateway/dist/web/read.d.ts +15 -12
  330. package/packages/gateway/dist/web/read.d.ts.map +1 -1
  331. package/packages/gateway/dist/web/read.js +9 -10
  332. package/packages/gateway/dist/web/read.js.map +1 -1
  333. package/packages/gateway/dist/web/server.d.ts.map +1 -1
  334. package/packages/gateway/dist/web/server.js +13 -0
  335. package/packages/gateway/dist/web/server.js.map +1 -1
  336. package/packages/gateway/dist/web/speech.d.ts +47 -0
  337. package/packages/gateway/dist/web/speech.d.ts.map +1 -0
  338. package/packages/gateway/dist/web/speech.js +83 -0
  339. package/packages/gateway/dist/web/speech.js.map +1 -0
  340. package/packages/gateway/dist/web/stream.d.ts +0 -24
  341. package/packages/gateway/dist/web/stream.d.ts.map +1 -1
  342. package/packages/gateway/dist/web/stream.js +26 -2
  343. package/packages/gateway/dist/web/stream.js.map +1 -1
  344. package/packages/gateway/dist/web/usage-view.d.ts +15 -0
  345. package/packages/gateway/dist/web/usage-view.d.ts.map +1 -0
  346. package/packages/gateway/dist/web/usage-view.js +20 -0
  347. package/packages/gateway/dist/web/usage-view.js.map +1 -0
  348. package/packages/install/dist/.tsbuildinfo +1 -1
  349. package/packages/runtime/dist/.tsbuildinfo +1 -1
  350. package/packages/runtime/dist/anthropic.d.ts +18 -0
  351. package/packages/runtime/dist/anthropic.d.ts.map +1 -1
  352. package/packages/runtime/dist/anthropic.js +65 -13
  353. package/packages/runtime/dist/anthropic.js.map +1 -1
  354. package/packages/runtime/dist/codex-direct.d.ts.map +1 -1
  355. package/packages/runtime/dist/codex-direct.js +11 -3
  356. package/packages/runtime/dist/codex-direct.js.map +1 -1
  357. package/packages/runtime/dist/context-window.d.ts.map +1 -1
  358. package/packages/runtime/dist/context-window.js +13 -4
  359. package/packages/runtime/dist/context-window.js.map +1 -1
  360. package/packages/runtime/dist/loop.d.ts.map +1 -1
  361. package/packages/runtime/dist/loop.js +6 -0
  362. package/packages/runtime/dist/loop.js.map +1 -1
  363. package/packages/runtime/dist/openai.d.ts +16 -4
  364. package/packages/runtime/dist/openai.d.ts.map +1 -1
  365. package/packages/runtime/dist/openai.js +23 -4
  366. package/packages/runtime/dist/openai.js.map +1 -1
  367. package/packages/runtime/dist/provider-models.d.ts.map +1 -1
  368. package/packages/runtime/dist/provider-models.js +5 -1
  369. package/packages/runtime/dist/provider-models.js.map +1 -1
  370. package/packages/tools/artifacts/dist/.tsbuildinfo +1 -1
  371. package/packages/tools/browser/dist/.tsbuildinfo +1 -1
  372. package/packages/tools/browser/dist/computer.d.ts +53 -1
  373. package/packages/tools/browser/dist/computer.d.ts.map +1 -1
  374. package/packages/tools/browser/dist/computer.js +154 -5
  375. package/packages/tools/browser/dist/computer.js.map +1 -1
  376. package/packages/tools/browser/dist/controller.d.ts +20 -3
  377. package/packages/tools/browser/dist/controller.d.ts.map +1 -1
  378. package/packages/tools/browser/dist/controller.js +170 -5
  379. package/packages/tools/browser/dist/controller.js.map +1 -1
  380. package/packages/tools/browser/dist/index.d.ts.map +1 -1
  381. package/packages/tools/browser/dist/index.js +9 -1
  382. package/packages/tools/browser/dist/index.js.map +1 -1
  383. package/packages/tools/browser/dist/service.d.ts +14 -1
  384. package/packages/tools/browser/dist/service.d.ts.map +1 -1
  385. package/packages/tools/browser/dist/service.js +28 -5
  386. package/packages/tools/browser/dist/service.js.map +1 -1
  387. package/packages/tools/browser/dist/types.d.ts +11 -0
  388. package/packages/tools/browser/dist/types.d.ts.map +1 -1
  389. package/packages/tools/browser/dist/types.js +16 -3
  390. package/packages/tools/browser/dist/types.js.map +1 -1
  391. package/packages/tools/browser/package.json +1 -1
  392. package/packages/tools/email/dist/.tsbuildinfo +1 -1
  393. package/packages/tools/host/dist/.tsbuildinfo +1 -1
  394. package/packages/tools/memory/dist/.tsbuildinfo +1 -1
  395. package/packages/tools/web/dist/.tsbuildinfo +1 -1
  396. package/packages/web/dist/assets/index-D5cRFcgm.css +1 -0
  397. package/packages/web/dist/assets/index-GCFB1vBV.js +125 -0
  398. package/packages/web/dist/index.html +2 -2
  399. package/packages/web/dist/assets/index-BRc5auXm.js +0 -123
  400. package/packages/web/dist/assets/index-DwUpotTR.css +0 -1
@@ -31,7 +31,7 @@ export class JPDecoder extends Transform {
31
31
  chunk = Buffer.from(chunk, encoding);
32
32
  }
33
33
  if (this.chunklen + chunk.length > this.maxBytes) {
34
- chunk = chunk.slice(0, Math.max(0, this.maxBytes - this.chunklen));
34
+ chunk = chunk.subarray(0, Math.max(0, this.maxBytes - this.chunklen));
35
35
  }
36
36
  if (chunk.length) {
37
37
  this.chunks.push(chunk);
@@ -1,3 +1,3 @@
1
1
  export declare const name = "imapflow";
2
- export declare const version = "2.0.7";
2
+ export declare const version = "2.1.0";
3
3
  export declare const homepage = "https://imapflow.com/";
@@ -1,4 +1,4 @@
1
1
  // Generated by scripts/build.js from package.json. Do not edit by hand.
2
- export const name = 'imapflow';
3
- export const version = '2.0.7';
4
- export const homepage = 'https://imapflow.com/';
2
+ export const name = "imapflow";
3
+ export const version = "2.1.0";
4
+ export const homepage = "https://imapflow.com/";
@@ -403,21 +403,14 @@ export const searchCompiler = (connection, query) => {
403
403
  * @returns Binary tree structure
404
404
  */
405
405
  let genOrTree = (list) => {
406
- let group = false;
407
406
  let groups = [];
408
407
  // Group items in pairs
409
- list.forEach((entry, i) => {
410
- if (i % 2 === 0) {
411
- group = [entry];
412
- }
413
- else {
414
- group.push(entry);
415
- groups.push(group);
416
- group = false;
417
- }
418
- });
408
+ for (let i = 0; i + 1 < list.length; i += 2) {
409
+ groups.push([list[i], list[i + 1]]);
410
+ }
419
411
  // Handle odd number of items
420
- if (group && group.length) {
412
+ if (list.length % 2) {
413
+ let group = [list[list.length - 1]];
421
414
  while (group.length === 1 && Array.isArray(group[0])) {
422
415
  group = group[0];
423
416
  }
@@ -1,8 +1,8 @@
1
1
  import type { Transform } from 'node:stream';
2
2
  import type { ImapFlow } from './imap-flow.js';
3
- import type { ConnectionErrorSite, ImapFlowError } from './errors.js';
3
+ import { type ConnectionErrorSite, type ImapFlowError } from './errors.js';
4
4
  import type { ImapAttributeList, ImapAttributeNode, ImapResponse } from './handler/types.js';
5
- import type { FetchMessageObject, ListResponse, ListTreeResponse, MailboxObject, MessageEnvelopeObject, MessageStructureObject, StatusQuery } from './types.js';
5
+ import type { FetchMessageObject, ListResponse, ListTreeResponse, MailboxObject, MessageEnvelopeObject, MessageStructureObject, ImapFlowEvents, StatusQuery } from './types.js';
6
6
  export { AuthenticationFailure } from './errors.js';
7
7
  export declare const EXPANDED_RANGE_LIMIT = 16777216;
8
8
  export declare const MAX_UINT32_DIGITS = 10;
@@ -80,6 +80,13 @@ export declare function guardedPromise<T>(executor: (resolve: (value: T | Promis
80
80
  * @returns Rejected promise, with its rejection already observed
81
81
  */
82
82
  export declare function guardedReject(error: Error): Promise<never>;
83
+ /**
84
+ * Clears a timer that may already have been dropped. `clearTimeout()` accepts undefined but not
85
+ * null, and the connection nulls its timer fields once cleared, so every site clears through here.
86
+ *
87
+ * @param timer - Timer handle returned by setTimeout, or null/undefined when none is armed
88
+ */
89
+ export declare function clearTimer(timer: NodeJS.Timeout | null | undefined): void;
83
90
  /**
84
91
  * Detaches a background timer from the event loop, so it cannot keep the process alive on its
85
92
  * own. Applied to every background timer (auto-IDLE, IDLE restart, fallback polling, throttle
@@ -89,13 +96,6 @@ export declare function guardedReject(error: Error): Promise<never>;
89
96
  * @param timer - Timer handle returned by setTimeout
90
97
  * @returns The same timer handle
91
98
  */
92
- /**
93
- * Clears a timer that may already have been dropped. `clearTimeout()` accepts undefined but not
94
- * null, and the connection nulls its timer fields once cleared, so every site clears through here.
95
- *
96
- * @param timer - Timer handle returned by setTimeout, or null/undefined when none is armed
97
- */
98
- export declare function clearTimer(timer: NodeJS.Timeout | null | undefined): void;
99
99
  export declare function unrefTimer<T extends NodeJS.Timeout | null | undefined>(timer: T): T;
100
100
  /**
101
101
  * Logs a failure from background connection work at the level its cause deserves.
@@ -200,6 +200,25 @@ export declare function updateCapabilities(list: ImapAttributeList | null | unde
200
200
  * @returns Uppercase status code string, or false if not found
201
201
  */
202
202
  export declare function getStatusCode(response: ImapResponse | string | false | undefined): string | false;
203
+ /**
204
+ * Emits a state-change event from inside the command pipeline. A listener that throws must not
205
+ * abort the code that emitted it: select() emits before it releases the response, so the throw
206
+ * would leave the reader loop waiting forever, and close() would never get to emit 'close'. The
207
+ * error is logged instead, the same contract untagged handlers and the 'response' event get.
208
+ *
209
+ * @param connection - IMAP connection instance
210
+ * @param event - Event name
211
+ * @param args - Event arguments
212
+ */
213
+ export declare function emitSafe<K extends keyof ImapFlowEvents>(connection: ImapFlow, event: K, ...args: ImapFlowEvents[K]): void;
214
+ /**
215
+ * Collects the values of the TEXT tokens of a parsed response (the human-readable
216
+ * part of a status response, a greeting or a BYE).
217
+ *
218
+ * @param attributes - Attributes of a parsed IMAP response
219
+ * @returns Values of the TEXT tokens, in order
220
+ */
221
+ export declare function getTextValues(attributes: ImapAttributeList | undefined): string[];
203
222
  /**
204
223
  * Compiles an IMAP response object back into a human-readable string.
205
224
  *
@@ -214,6 +233,28 @@ export declare function getErrorText(response: ImapResponse | string | false | u
214
233
  * @returns The enhanced error with `serverResponseCode` and string `response`
215
234
  */
216
235
  export declare function enhanceCommandError(err: ImapFlowError): Promise<ImapFlowError>;
236
+ /**
237
+ * Enhances a failed command's error (see enhanceCommandError()) and logs it, the shared first
238
+ * step of every command's failure path. The caller decides whether to throw or return.
239
+ *
240
+ * @param connection - IMAP connection instance
241
+ * @param err - The command error
242
+ */
243
+ export declare function reportCommandError(connection: ImapFlow, err: ImapFlowError): Promise<void>;
244
+ /**
245
+ * Whether the session is authenticated, that is in the AUTHENTICATED or SELECTED state, which
246
+ * every mailbox-level command requires.
247
+ *
248
+ * @param connection - IMAP connection instance
249
+ */
250
+ export declare function isAuthenticatedState(connection: ImapFlow): boolean;
251
+ /**
252
+ * Returns the selected mailbox, or false when the connection is not in the SELECTED state.
253
+ * Message-level commands use it as their precondition, which also narrows the mailbox type.
254
+ *
255
+ * @param connection - IMAP connection instance
256
+ */
257
+ export declare function getSelectedMailbox(connection: ImapFlow): MailboxObject | false;
217
258
  /**
218
259
  * Converts a flat list of mailbox folders into a tree structure.
219
260
  *
@@ -305,14 +346,14 @@ export declare function toValidDate(value: unknown): Date | null;
305
346
  * @param value - Date to format
306
347
  * @returns Formatted date string, or undefined if invalid
307
348
  */
308
- export declare function formatDate(value: Date | string | null | undefined): string | undefined;
349
+ export declare function formatDate(value: unknown): string | undefined;
309
350
  /**
310
351
  * Formats a date value into IMAP date-time format (DD-Mon-YYYY HH:MM:SS +0000).
311
352
  *
312
353
  * @param value - Date to format
313
354
  * @returns Formatted date-time string, or undefined if invalid
314
355
  */
315
- export declare function formatDateTime(value: Date | string | null | undefined): string | undefined;
356
+ export declare function formatDateTime(value: unknown): string | undefined;
316
357
  /**
317
358
  * Normalizes a flag string. Returns false for non-settable flags (e.g. \Recent),
318
359
  * and capitalizes system flags properly.
@@ -5,10 +5,11 @@ import { compiler } from './handler/imap-handler.js';
5
5
  import { createHash } from 'node:crypto';
6
6
  import { JPDecoder } from './jp-decoder.js';
7
7
  import iconv from 'iconv-lite';
8
+ import { ImapFlowErrorCode } from './errors.js';
8
9
  export { AuthenticationFailure } from './errors.js';
9
10
  const FLAG_COLORS = ['red', 'orange', 'yellow', 'green', 'blue', 'purple', 'grey'];
10
11
  // Error codes that only mean the connection is no longer usable. See logConnectionError().
11
- const CONNECTION_GONE_CODES = new Set(['NoConnection', 'EConnectionClosed', 'StateLogout']);
12
+ const CONNECTION_GONE_CODES = new Set([ImapFlowErrorCode.NoConnection, ImapFlowErrorCode.EConnectionClosed, ImapFlowErrorCode.StateLogout]);
12
13
  // Upper bound for expanding server-supplied sequence ranges (see expandRange). 2^24
13
14
  // entries in total is far beyond any legitimate mailbox while keeping the worst-case
14
15
  // expansion of a hostile range set bounded.
@@ -158,15 +159,6 @@ export function guardedReject(error) {
158
159
  promise.catch(noop);
159
160
  return promise;
160
161
  }
161
- /**
162
- * Detaches a background timer from the event loop, so it cannot keep the process alive on its
163
- * own. Applied to every background timer (auto-IDLE, IDLE restart, fallback polling, throttle
164
- * back-off, held-lock diagnostics); connection and greeting deadlines are deliberately left
165
- * attached, because a caller is waiting for connect() to settle.
166
- *
167
- * @param timer - Timer handle returned by setTimeout
168
- * @returns The same timer handle
169
- */
170
162
  /**
171
163
  * Clears a timer that may already have been dropped. `clearTimeout()` accepts undefined but not
172
164
  * null, and the connection nulls its timer fields once cleared, so every site clears through here.
@@ -178,6 +170,15 @@ export function clearTimer(timer) {
178
170
  clearTimeout(timer);
179
171
  }
180
172
  }
173
+ /**
174
+ * Detaches a background timer from the event loop, so it cannot keep the process alive on its
175
+ * own. Applied to every background timer (auto-IDLE, IDLE restart, fallback polling, throttle
176
+ * back-off, held-lock diagnostics); connection and greeting deadlines are deliberately left
177
+ * attached, because a caller is waiting for connect() to settle.
178
+ *
179
+ * @param timer - Timer handle returned by setTimeout
180
+ * @returns The same timer handle
181
+ */
181
182
  export function unrefTimer(timer) {
182
183
  /* c8 ignore next 3 */ // node timers always expose unref(); the guard covers replaced globals in tests
183
184
  if (timer && typeof timer.unref === 'function') {
@@ -393,7 +394,7 @@ export function updateCapabilities(list) {
393
394
  }
394
395
  if (capability.startsWith('APPENDLIMIT=')) {
395
396
  let splitPos = capability.indexOf('=');
396
- map.set('APPENDLIMIT', parseUintValue(capability.substr(splitPos + 1)) || 0);
397
+ map.set('APPENDLIMIT', parseUintValue(capability.slice(splitPos + 1)) || 0);
397
398
  return;
398
399
  }
399
400
  map.set(capability, true);
@@ -419,6 +420,34 @@ export function getStatusCode(response) {
419
420
  ? response.attributes[0].section[0].value.toUpperCase().trim()
420
421
  : false;
421
422
  }
423
+ /**
424
+ * Emits a state-change event from inside the command pipeline. A listener that throws must not
425
+ * abort the code that emitted it: select() emits before it releases the response, so the throw
426
+ * would leave the reader loop waiting forever, and close() would never get to emit 'close'. The
427
+ * error is logged instead, the same contract untagged handlers and the 'response' event get.
428
+ *
429
+ * @param connection - IMAP connection instance
430
+ * @param event - Event name
431
+ * @param args - Event arguments
432
+ */
433
+ export function emitSafe(connection, event, ...args) {
434
+ try {
435
+ connection.emit(event, ...args);
436
+ }
437
+ catch (err) {
438
+ connection.log.warn({ msg: 'Event listener failed', event, err, cid: connection.id });
439
+ }
440
+ }
441
+ /**
442
+ * Collects the values of the TEXT tokens of a parsed response (the human-readable
443
+ * part of a status response, a greeting or a BYE).
444
+ *
445
+ * @param attributes - Attributes of a parsed IMAP response
446
+ * @returns Values of the TEXT tokens, in order
447
+ */
448
+ export function getTextValues(attributes) {
449
+ return (attributes || []).filter(attr => attr?.type === 'TEXT').map(attr => String(attr?.value ?? ''));
450
+ }
422
451
  /**
423
452
  * Compiles an IMAP response object back into a human-readable string.
424
453
  *
@@ -456,6 +485,35 @@ export async function enhanceCommandError(err) {
456
485
  err.response = await getErrorText(err.response);
457
486
  return err;
458
487
  }
488
+ /**
489
+ * Enhances a failed command's error (see enhanceCommandError()) and logs it, the shared first
490
+ * step of every command's failure path. The caller decides whether to throw or return.
491
+ *
492
+ * @param connection - IMAP connection instance
493
+ * @param err - The command error
494
+ */
495
+ export async function reportCommandError(connection, err) {
496
+ await enhanceCommandError(err);
497
+ connection.log.warn({ err, cid: connection.id });
498
+ }
499
+ /**
500
+ * Whether the session is authenticated, that is in the AUTHENTICATED or SELECTED state, which
501
+ * every mailbox-level command requires.
502
+ *
503
+ * @param connection - IMAP connection instance
504
+ */
505
+ export function isAuthenticatedState(connection) {
506
+ return connection.state === connection.states.AUTHENTICATED || connection.state === connection.states.SELECTED;
507
+ }
508
+ /**
509
+ * Returns the selected mailbox, or false when the connection is not in the SELECTED state.
510
+ * Message-level commands use it as their precondition, which also narrows the mailbox type.
511
+ *
512
+ * @param connection - IMAP connection instance
513
+ */
514
+ export function getSelectedMailbox(connection) {
515
+ return connection.state === connection.states.SELECTED && connection.mailbox ? connection.mailbox : false;
516
+ }
459
517
  /**
460
518
  * Converts a flat list of mailbox folders into a tree structure.
461
519
  *
@@ -943,7 +1001,7 @@ export function getStructuredParams(arr) {
943
1001
  // nothing to do here, does not seem like a continuation param
944
1002
  return;
945
1003
  }
946
- actualKey = key.substr(0, match.index).toLowerCase();
1004
+ actualKey = key.substring(0, match.index).toLowerCase();
947
1005
  nr = Number(match[2]) || 0;
948
1006
  if (isUnsafeKey(actualKey)) {
949
1007
  // A continuation key like "__proto__*0*" would group under "__proto__":
@@ -1035,7 +1093,7 @@ export function parseBodystructure(entry) {
1035
1093
  curNode.type = 'multipart/' + ((node[i++] || {}).value || '').toString().toLowerCase();
1036
1094
  // extension data (not available for BODY requests)
1037
1095
  // body parameter parenthesized list
1038
- if (i < node.length - 1) {
1096
+ if (i < node.length) {
1039
1097
  if (node[i]) {
1040
1098
  curNode.parameters = getStructuredParams(node[i]);
1041
1099
  }
@@ -1117,7 +1175,7 @@ export function parseBodystructure(entry) {
1117
1175
  }
1118
1176
  // extension data (not available for BODY requests)
1119
1177
  // md5
1120
- if (i < node.length - 1) {
1178
+ if (i < node.length) {
1121
1179
  if (node[i]) {
1122
1180
  curNode.md5 = (node[i].value || '').toString().toLowerCase();
1123
1181
  }
@@ -1127,7 +1185,7 @@ export function parseBodystructure(entry) {
1127
1185
  // the following are shared extension values (for both multipart and non-multipart parts)
1128
1186
  // not available for BODY requests
1129
1187
  // body disposition
1130
- if (i < node.length - 1) {
1188
+ if (i < node.length) {
1131
1189
  let disposition = node[i];
1132
1190
  if (Array.isArray(disposition) && disposition.length) {
1133
1191
  curNode.disposition = ((disposition[0] && disposition[0].value) || '').toString().toLowerCase();
@@ -1138,7 +1196,7 @@ export function parseBodystructure(entry) {
1138
1196
  i++;
1139
1197
  }
1140
1198
  // body language
1141
- if (i < node.length - 1) {
1199
+ if (i < node.length) {
1142
1200
  if (node[i]) {
1143
1201
  /* c8 ignore next */ // node[i] is truthy inside this guard, so the [] fallback is unreachable
1144
1202
  curNode.language = [].concat(node[i] || []).map(val => ((val && val.value) || '').toString().toLowerCase());
@@ -1148,7 +1206,7 @@ export function parseBodystructure(entry) {
1148
1206
  // body location
1149
1207
  // NB! defined as a "string list" in RFC3501 but replaced in errata document with "string"
1150
1208
  // Errata: http://www.rfc-editor.org/errata_search.php?rfc=3501
1151
- if (i < node.length - 1) {
1209
+ if (i < node.length) {
1152
1210
  if (node[i]) {
1153
1211
  curNode.location = (node[i].value || '').toString();
1154
1212
  }
@@ -1195,7 +1253,7 @@ export function formatDate(value) {
1195
1253
  if (!date) {
1196
1254
  return;
1197
1255
  }
1198
- let dateParts = date.toISOString().substr(0, 10).split('-');
1256
+ let dateParts = date.toISOString().substring(0, 10).split('-');
1199
1257
  dateParts.reverse();
1200
1258
  let months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
1201
1259
  dateParts[1] = months[Number(dateParts[1]) - 1];
@@ -1213,7 +1271,7 @@ export function formatDateTime(value) {
1213
1271
  return;
1214
1272
  }
1215
1273
  let dateStr = formatDate(date).replace(/^0/, ' '); //starts with date-day-fixed with leading 0 replaced by SP
1216
- let timeStr = date.toISOString().substr(11, 8);
1274
+ let timeStr = date.toISOString().substring(11, 19);
1217
1275
  return `${dateStr} ${timeStr} +0000`;
1218
1276
  }
1219
1277
  /**
@@ -1367,8 +1425,8 @@ export function expandRange(range) {
1367
1425
  }
1368
1426
  continue;
1369
1427
  }
1370
- let first = Number(entry.substr(0, colon));
1371
- let second = Number(entry.substr(colon + 1));
1428
+ let first = Number(entry.substring(0, colon));
1429
+ let second = Number(entry.slice(colon + 1));
1372
1430
  if (!isValidSequenceValue(first) || !isValidSequenceValue(second)) {
1373
1431
  continue;
1374
1432
  }
@@ -207,26 +207,32 @@ export interface IdInfoObject {
207
207
  'support-url'?: string | false | undefined;
208
208
  /** Date program was released */
209
209
  date?: Date | string | false | undefined;
210
- [key: string]: any;
210
+ /** Any other field, sent as its string form */
211
+ [key: string]: unknown;
212
+ }
213
+ /**
214
+ * Usage and limit of one quota resource. The `storage` values are bytes (the wire format is
215
+ * kilobytes), the other resources are counts
216
+ */
217
+ export interface QuotaResource {
218
+ /** Current usage, missing when the server did not send a usable number */
219
+ usage?: number | undefined;
220
+ /** The limit, missing when the server did not send a usable number */
221
+ limit?: number | undefined;
222
+ /** Usage as a percentage of the limit, e.g. "50%", set once a limit above zero is known */
223
+ status?: string | undefined;
211
224
  }
212
225
  export interface QuotaResponse {
213
226
  /** Mailbox path this quota applies to */
214
227
  path: string;
215
- /** Storage quota if provided by server */
216
- storage?: {
217
- /** Used storage in bytes */
218
- used: number;
219
- /** Total storage available */
220
- limit: number;
221
- } | undefined;
222
- /** Message count quota if provided by server */
223
- messages?: {
224
- /** Stored messages */
225
- used: number;
226
- /** Maximum messages allowed */
227
- limit: number;
228
- } | undefined;
229
- [resource: string]: any;
228
+ /** The quota root the server reported for the mailbox, if any */
229
+ quotaRoot?: string | undefined;
230
+ /** The STORAGE resource, if the server reports one */
231
+ storage?: QuotaResource | undefined;
232
+ /** The MESSAGE resource, if the server reports one */
233
+ message?: QuotaResource | undefined;
234
+ /** Any other resource the server reports, under its lowercased name (e.g. "mailbox") */
235
+ [resource: string]: QuotaResource | string | undefined;
230
236
  }
231
237
  /**
232
238
  * Status data items to request with `status()` or the `statusQuery` listing option
@@ -616,6 +622,14 @@ export interface DownloadObject {
616
622
  /** Streamed content */
617
623
  content: Readable;
618
624
  }
625
+ /**
626
+ * What `download()` resolves with when there is nothing to download: no mailbox is selected, or
627
+ * the message or part was not found. Check `content` before using the result.
628
+ */
629
+ export interface DownloadNotFound {
630
+ meta?: undefined;
631
+ content?: undefined;
632
+ }
619
633
  export interface DownloadOptions {
620
634
  /** If true then uses UID number instead of sequence number for `range` */
621
635
  uid?: boolean | undefined;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imapflow",
3
- "version": "2.0.7",
3
+ "version": "2.1.0",
4
4
  "description": "IMAP Client for Node",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/imap-flow.js",
@@ -47,7 +47,7 @@
47
47
  "test:rev2": "bash test/integration/run-rev2-tests.sh",
48
48
  "format": "prettier --write \"**/*.{js,cjs,ts,json,md,yml,yaml}\"",
49
49
  "format:check": "prettier --check \"**/*.{js,cjs,ts,json,md,yml,yaml}\"",
50
- "lint": "eslint . && npm run typecheck",
50
+ "lint": "npm run typecheck && eslint .",
51
51
  "lint:fix": "eslint . --fix",
52
52
  "prepare": "npm run build",
53
53
  "update": "rm -rf node_modules package-lock.json && ncu -u && npm install"
@@ -73,12 +73,12 @@
73
73
  "eslint": "10.11.0",
74
74
  "eslint-config-prettier": "10.1.8",
75
75
  "globals": "17.12.0",
76
- "prettier": "3.9.8",
76
+ "prettier": "3.9.9",
77
77
  "tsx": "4.23.15",
78
78
  "types-node-legacy": "npm:@types/node@20.0.0",
79
79
  "typescript": "6.0.3",
80
80
  "typescript-eslint": "8.70.1",
81
- "wrangler": "4.136.3"
81
+ "wrangler": "4.142.0"
82
82
  },
83
83
  "dependencies": {
84
84
  "@zone-eu/mailsplit": "5.4.17",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@withbuddi/buddi",
3
- "version": "0.1.0-pre.20",
3
+ "version": "0.1.0-pre.21",
4
4
  "type": "module",
5
5
  "description": "Your personal agents, on your computer",
6
6
  "repository": {
@@ -17,7 +17,7 @@
17
17
  "buddi": "packages/install/dist/launcher.js"
18
18
  },
19
19
  "buddi": {
20
- "notes": "### Changed\n\n- The thinking switch appears only where it is honoured, on Anthropic and OpenAI accounts. On an OpenAI-compatible host, Ollama Cloud and local Ollama included, the Brain page says thinking is up to the model, and the composer shows no switch.\n- On the first-run page buddi speaks with the Blob as its face instead of a letter tile. A locally packed build (the Docker trial) calls itself `0.1.0-dev.<commit>` so it is never mistaken for a release.\n- A ChatGPT subscription account no longer needs the `codex` command: buddi signs in with the same device code and talks to OpenAI's Codex backend itself. Accounts already connected keep working. Model turns can now run tools in parallel and report token usage.\n\n### Added\n\n- First run offers **ChatGPT — I pay for ChatGPT** right after Claude: buddi shows a code, you enter it on openai.com, and buddi picks a model from your plan. The same code flow is on the account page in Settings.\n- The first-run page shows the running buddi version under its title.\n- An Ollama Cloud account can connect with a device key instead of a pasted key, the way `ollama login` does: buddi makes a key pair in the vault, you press Connect on ollama.com, and each request is signed with the key. `buddi status` and the account say \"connected as <your ollama.com name>, device buddi on <this computer>\". Disconnecting asks ollama.com to forget the device, as `ollama signout` does, and removes the key from buddi either way.\n- First run offers \"Ollama Cloud, one tap\" (free to start, no key) right after Ollama on this computer: tap it, press Connect on the ollama.com page that opens, and buddi says which model your assistant will think with, with the list to pick another. The address-and-key card is now \"Another service, or Ollama Cloud with a key\". In Settings → Model accounts, a new Ollama Cloud account connects the same way, with \"Use a key instead\" for a key.\n\n### Removed\n\n- The `codex-cli 0.155.0` version pin and the App Server runner.\n\n### Fixed\n\n- A ChatGPT subscription account's context window now comes from OpenAI's own model list instead of a guess from the model name, on the account page and in the conversation budget. The label says whether the number is the provider's or assumed.\n- A picture or file a colleague makes through a delegation now reaches the conversation that asked for it. It shows under the asking agent's message and on the Delegation card, the Files page lists it under both conversations, and the asking agent is told it is attached (and sees an image when its model takes images) instead of telling you to ask the colleague.\n- Asking an agent for a colleague that is not on its delegate list now gets a clear answer: the refusal names who it may ask and says the colleague can be added on its Access page, and the agent is told to say that rather than improvise or try another colleague to find out. An allowed colleague's handle, like `@art`, now works where its id was needed."
20
+ "notes": "### Changed\n\n- Recording in the composer is now a clear Listening state with a live waveform, a ✓ to transcribe and a × to discard, with Enter and Escape doing the same.\n- The dot on Settings, which means a newer buddi is ready, now shows on the System entry too, so it leads to the Version panel instead of pointing at nothing.\n\n- Asking an agent to open an app you have not allowed for computer control now asks you with a card, Once or Always, instead of sending you to Settings. Always adds the app to the list.\n- Plugin pages can show a progress bar; the Speech page uses it for the model downloads.\n- Settings → Speech asks which languages you speak instead of one language hint, so a French note and an English one are both heard right on this computer, and it lists the models your account offers instead of asking you to type one.\n- Plugin pages can offer a select that takes several choices (`multiple: true`).\n- Settings → Speech: a play button beside the voice speaks a short sample in the browser with the chosen service and voice; nothing is saved. The old Test that wrote a file to Files is gone.\n- Plugin pages can play a sound a tool returns (`play: { mime, data }`), and a select can carry a small button of its own (`action`) that runs a tool with the form's unsaved values.\n- Choosing several things on a plugin page, the languages you speak for example, is done with chips and an Add list instead of a scrolling box.\n- A voice note on Telegram tells the agent which language you spoke in, so it answers in it.\n- Settings → Speech: with Kokoro, you choose a voice for each language you speak, English and French each with their own, and a reply picks the voice of its language.\n- Plugin page forms can lay fields out three to a row; Settings → Speech uses it for the speaking voices.\n- Voice on Telegram: a voice note is no longer echoed back as text; `/voice` chooses when to speak (spoken, always, off) and what to send (the voice note alone, or with the text), also on Settings → Speech. What is spoken is rewritten for the ear first: handles read as names, dates and amounts as words, links as their site, no markdown.\n\n### Added\n\n- First run and Add account offer Gemini: paste a Google AI key and buddi connects through Google's OpenAI-compatible endpoint, lists the models and picks the newest Pro. Gemini's context window and prices are known to the usage view.\n- Kokoro on this computer now speaks French, Spanish, Italian, Portuguese and Hindi with its own voices for those languages (espeak-ng, fetched with the model, does the pronunciation); a reply in one of them picks the matching voice. Japanese and Chinese still need a cloud speaker.\n- Home has a composer: write to your front desk straight from the first page, by keyboard or voice, and the conversation opens with the answer. `/` focuses the composer anywhere.\n- On the dashboard, a microphone in the composer turns what you say into text (Shift to send at once), and a speaker toggle reads each reply aloud, through the listening and speaking you chose in Settings → Speech.\n- Prompt caching: buddi marks the tool list, the instructions and the earlier conversation for Anthropic's cache and keys OpenAI's automatic cache by conversation, so a long conversation's repeated prompt is billed at the cached rate. Usage shows cached tokens separately and the cost estimate prices them.\n- Voice on Telegram: a voice note is transcribed and answered, spoken back as a voice note when you spoke (`/voice` chooses spoken, always or off). Listening and speaking can run on this computer: Settings → Speech installs Whisper and Kokoro (about 250 MB and 90 MB) with one button or `buddi speech install`; nothing leaves the machine then.\n- A speech plugin: agents can listen to an audio file (`speech.transcribe`) and answer with a voice (`speech.say`) through an OpenAI or OpenAI-compatible account chosen on Settings → Speech, with daily caps.\n- Under each reply, Copy and Read aloud. buddi's front desk can now make an audio file on request (`speech.say`), and an audio file in a conversation shows as a small player with a download link.\n\n### Fixed\n\n- Local Whisper and Kokoro now run in their own thread. A long reply read aloud used to freeze the whole of buddi, dashboard and Telegram included, until it finished.\n- Computer control: an app name with a typo now gets the close matches back (\"Did you mean Vocito?\"), and when your own window pushed the agent's app behind, the agent brings it forward again itself instead of asking you to."
21
21
  },
22
22
  "files": [
23
23
  "packages",