gemi 0.63.0-rc.1 → 0.63.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (338) hide show
  1. package/dist/ai/index.js +2 -2
  2. package/dist/ai/index.js.map +2 -2
  3. package/dist/app/App.d.ts +6 -0
  4. package/dist/app/App.d.ts.map +1 -1
  5. package/dist/app/index.js +1 -1
  6. package/dist/auth/AuthController.d.ts +4 -0
  7. package/dist/auth/AuthController.d.ts.map +1 -1
  8. package/dist/auth/AuthManager.d.ts +16 -0
  9. package/dist/auth/AuthManager.d.ts.map +1 -1
  10. package/dist/auth/config.d.ts +22 -0
  11. package/dist/auth/config.d.ts.map +1 -1
  12. package/dist/auth/routes.d.ts +4 -0
  13. package/dist/auth/routes.d.ts.map +1 -1
  14. package/dist/auth/signInRedirect.d.ts +18 -0
  15. package/dist/auth/signInRedirect.d.ts.map +1 -0
  16. package/dist/bin/gemi.js +52 -15
  17. package/dist/bin/gemi.js.map +5 -5
  18. package/dist/broadcasting/index.js +1 -1
  19. package/dist/bun/plugin.js +1 -1
  20. package/dist/bun/preload.js +1 -1
  21. package/dist/chunk-0081bz9c.js +5 -0
  22. package/dist/{chunk-pspcnvxp.js.map → chunk-0081bz9c.js.map} +7 -7
  23. package/dist/chunk-0amv13g6.js +5 -0
  24. package/dist/chunk-0amv13g6.js.map +25 -0
  25. package/dist/{chunk-vcwm0fcq.js → chunk-0qchadp1.js} +2 -2
  26. package/dist/{chunk-vcwm0fcq.js.map → chunk-0qchadp1.js.map} +1 -1
  27. package/dist/chunk-1s1cd1e8.js +5 -0
  28. package/dist/chunk-1s1cd1e8.js.map +12 -0
  29. package/dist/{chunk-mdz5ej28.js → chunk-2d92pev2.js} +2 -2
  30. package/dist/{chunk-mdz5ej28.js.map → chunk-2d92pev2.js.map} +1 -1
  31. package/dist/chunk-35fbxgjh.js +4 -0
  32. package/dist/chunk-35fbxgjh.js.map +10 -0
  33. package/dist/chunk-39p7ge47.js +24 -0
  34. package/dist/chunk-39p7ge47.js.map +16 -0
  35. package/dist/{chunk-e4ez431n.js → chunk-43xw9n4f.js} +2 -2
  36. package/dist/{chunk-e4ez431n.js.map → chunk-43xw9n4f.js.map} +1 -1
  37. package/dist/{chunk-cbsfk6zk.js → chunk-454c7vn3.js} +2 -2
  38. package/dist/{chunk-cbsfk6zk.js.map → chunk-454c7vn3.js.map} +1 -1
  39. package/dist/{chunk-6vhdkcy5.js → chunk-48qybp63.js} +2 -2
  40. package/dist/{chunk-6vhdkcy5.js.map → chunk-48qybp63.js.map} +1 -1
  41. package/dist/{chunk-9fnvfjc3.js → chunk-4sv5zpb4.js} +2 -2
  42. package/dist/{chunk-9fnvfjc3.js.map → chunk-4sv5zpb4.js.map} +1 -1
  43. package/dist/{chunk-ekddz8bc.js → chunk-5wzyx4ts.js} +2 -2
  44. package/dist/{chunk-ekddz8bc.js.map → chunk-5wzyx4ts.js.map} +1 -1
  45. package/dist/{chunk-fkedjx42.js → chunk-62xjrz5e.js} +3 -3
  46. package/dist/{chunk-fkedjx42.js.map → chunk-62xjrz5e.js.map} +1 -1
  47. package/dist/chunk-6j129573.js +54 -0
  48. package/dist/{chunk-1y8etsy5.js.map → chunk-6j129573.js.map} +4 -4
  49. package/dist/chunk-71yhw8aw.js +5 -0
  50. package/dist/chunk-71yhw8aw.js.map +10 -0
  51. package/dist/{chunk-f8z4h69j.js → chunk-773qa4av.js} +3 -3
  52. package/dist/{chunk-f8z4h69j.js.map → chunk-773qa4av.js.map} +1 -1
  53. package/dist/chunk-78cvy4je.js +5 -0
  54. package/dist/chunk-78cvy4je.js.map +11 -0
  55. package/dist/chunk-7hbhbht2.js +5 -0
  56. package/dist/{chunk-61v1a1qj.js.map → chunk-7hbhbht2.js.map} +3 -4
  57. package/dist/{chunk-gwcmkj1b.js → chunk-7qfzrkab.js} +2 -2
  58. package/dist/{chunk-gwcmkj1b.js.map → chunk-7qfzrkab.js.map} +1 -1
  59. package/dist/{chunk-t9evs0wf.js → chunk-81yzec62.js} +2 -2
  60. package/dist/{chunk-t9evs0wf.js.map → chunk-81yzec62.js.map} +1 -1
  61. package/dist/{chunk-e91rq603.js → chunk-8wpccvbt.js} +3 -3
  62. package/dist/{chunk-e91rq603.js.map → chunk-8wpccvbt.js.map} +1 -1
  63. package/dist/{chunk-mtr7ckwn.js → chunk-95d8jj11.js} +2 -2
  64. package/dist/{chunk-mtr7ckwn.js.map → chunk-95d8jj11.js.map} +1 -1
  65. package/dist/{chunk-zpzbdnyc.js → chunk-9e5c5e15.js} +2 -2
  66. package/dist/{chunk-zpzbdnyc.js.map → chunk-9e5c5e15.js.map} +1 -1
  67. package/dist/{chunk-6szg6aga.js → chunk-9e5v1t73.js} +2 -2
  68. package/dist/{chunk-6szg6aga.js.map → chunk-9e5v1t73.js.map} +1 -1
  69. package/dist/chunk-9k5daets.js +5 -0
  70. package/dist/chunk-9k5daets.js.map +11 -0
  71. package/dist/chunk-anfs5mwm.js +19 -0
  72. package/dist/chunk-anfs5mwm.js.map +90 -0
  73. package/dist/{chunk-rq6hfhtp.js → chunk-b6948dnh.js} +2 -2
  74. package/dist/{chunk-rq6hfhtp.js.map → chunk-b6948dnh.js.map} +1 -1
  75. package/dist/{chunk-kda1qzkg.js → chunk-bxtx4y4w.js} +2 -2
  76. package/dist/{chunk-kda1qzkg.js.map → chunk-bxtx4y4w.js.map} +1 -1
  77. package/dist/{chunk-5zem454h.js → chunk-cdpeh7tt.js} +2 -2
  78. package/dist/{chunk-5zem454h.js.map → chunk-cdpeh7tt.js.map} +1 -1
  79. package/dist/{chunk-7kedxtbp.js → chunk-dfv5eqma.js} +2 -2
  80. package/dist/{chunk-7kedxtbp.js.map → chunk-dfv5eqma.js.map} +1 -1
  81. package/dist/{chunk-vhwtc2jk.js → chunk-dhe1hsyz.js} +2 -2
  82. package/dist/{chunk-vhwtc2jk.js.map → chunk-dhe1hsyz.js.map} +1 -1
  83. package/dist/chunk-dq2hgzje.js +5 -0
  84. package/dist/{chunk-v0x436vz.js.map → chunk-dq2hgzje.js.map} +1 -1
  85. package/dist/{chunk-ay29dp5h.js → chunk-dqbm9vd0.js} +3 -3
  86. package/dist/{chunk-ay29dp5h.js.map → chunk-dqbm9vd0.js.map} +1 -1
  87. package/dist/{chunk-y2hjapnh.js → chunk-e41vdprh.js} +3 -3
  88. package/dist/{chunk-y2hjapnh.js.map → chunk-e41vdprh.js.map} +1 -1
  89. package/dist/{chunk-awsf2zsg.js → chunk-e785380d.js} +2 -2
  90. package/dist/{chunk-awsf2zsg.js.map → chunk-e785380d.js.map} +1 -1
  91. package/dist/{chunk-x7zp4p7d.js → chunk-exwbtfe9.js} +2 -2
  92. package/dist/{chunk-x7zp4p7d.js.map → chunk-exwbtfe9.js.map} +1 -1
  93. package/dist/{chunk-6x7ghyds.js → chunk-f9ccncar.js} +3 -3
  94. package/dist/{chunk-6x7ghyds.js.map → chunk-f9ccncar.js.map} +5 -4
  95. package/dist/{chunk-n2p97c8j.js → chunk-feyr4851.js} +2 -2
  96. package/dist/{chunk-n2p97c8j.js.map → chunk-feyr4851.js.map} +1 -1
  97. package/dist/{chunk-t45f5k7r.js → chunk-fv223805.js} +3 -3
  98. package/dist/{chunk-t45f5k7r.js.map → chunk-fv223805.js.map} +1 -1
  99. package/dist/{chunk-1mmd77sp.js → chunk-hkhxkeeb.js} +3 -3
  100. package/dist/{chunk-1mmd77sp.js.map → chunk-hkhxkeeb.js.map} +1 -1
  101. package/dist/chunk-jk8mn861.js +5 -0
  102. package/dist/chunk-jk8mn861.js.map +10 -0
  103. package/dist/{chunk-jdj1fdm3.js → chunk-jmbdr550.js} +2 -2
  104. package/dist/{chunk-jdj1fdm3.js.map → chunk-jmbdr550.js.map} +1 -1
  105. package/dist/{chunk-vgcd2c3t.js → chunk-jmse5hec.js} +3 -3
  106. package/dist/{chunk-vgcd2c3t.js.map → chunk-jmse5hec.js.map} +1 -1
  107. package/dist/{chunk-k53g6pnh.js → chunk-jv9k1qfr.js} +3 -3
  108. package/dist/{chunk-k53g6pnh.js.map → chunk-jv9k1qfr.js.map} +1 -1
  109. package/dist/chunk-k1wkvrj0.js +9 -0
  110. package/dist/chunk-k1wkvrj0.js.map +10 -0
  111. package/dist/chunk-kx7vgcjp.js +19 -0
  112. package/dist/chunk-kx7vgcjp.js.map +18 -0
  113. package/dist/chunk-maxd55a0.js +6 -0
  114. package/dist/{chunk-65b9hesw.js.map → chunk-maxd55a0.js.map} +2 -2
  115. package/dist/{chunk-9tmwwtbm.js → chunk-nnc40mf3.js} +2 -2
  116. package/dist/{chunk-9tmwwtbm.js.map → chunk-nnc40mf3.js.map} +1 -1
  117. package/dist/{chunk-x7nkv1xy.js → chunk-p57x55qd.js} +2 -2
  118. package/dist/{chunk-x7nkv1xy.js.map → chunk-p57x55qd.js.map} +1 -1
  119. package/dist/chunk-pbx9p6g0.js +80 -0
  120. package/dist/chunk-pbx9p6g0.js.map +14 -0
  121. package/dist/{chunk-ymh919gr.js → chunk-ptjexzn1.js} +2 -2
  122. package/dist/{chunk-q09y4xkz.js.map → chunk-ptjexzn1.js.map} +1 -1
  123. package/dist/{chunk-q09y4xkz.js → chunk-q4wdg0y3.js} +2 -2
  124. package/dist/{chunk-ymh919gr.js.map → chunk-q4wdg0y3.js.map} +1 -1
  125. package/dist/{chunk-3j1yvdme.js → chunk-q8msf1gf.js} +2 -2
  126. package/dist/{chunk-3j1yvdme.js.map → chunk-q8msf1gf.js.map} +1 -1
  127. package/dist/{chunk-safv6h9x.js → chunk-qcbtr7hm.js} +2 -2
  128. package/dist/{chunk-safv6h9x.js.map → chunk-qcbtr7hm.js.map} +1 -1
  129. package/dist/{chunk-amne2jdr.js → chunk-qrfp7pg2.js} +4 -4
  130. package/dist/{chunk-amne2jdr.js.map → chunk-qrfp7pg2.js.map} +1 -1
  131. package/dist/{chunk-0vnbwdy3.js → chunk-rhr8qavq.js} +2 -2
  132. package/dist/{chunk-0vnbwdy3.js.map → chunk-rhr8qavq.js.map} +1 -1
  133. package/dist/{chunk-apn07kkc.js → chunk-rj3fnc4h.js} +1 -1
  134. package/dist/chunk-ssg20z9s.js +142 -0
  135. package/dist/chunk-ssg20z9s.js.map +13 -0
  136. package/dist/chunk-tq92xqkk.js +55 -0
  137. package/dist/chunk-tq92xqkk.js.map +12 -0
  138. package/dist/{chunk-gyqn6rkq.js → chunk-v6v03hy7.js} +2 -2
  139. package/dist/{chunk-gyqn6rkq.js.map → chunk-v6v03hy7.js.map} +1 -1
  140. package/dist/{chunk-1gvtbywr.js → chunk-wqmzad46.js} +2 -2
  141. package/dist/{chunk-1gvtbywr.js.map → chunk-wqmzad46.js.map} +1 -1
  142. package/dist/{chunk-emj59xa9.js → chunk-xadk41cs.js} +4 -4
  143. package/dist/{chunk-emj59xa9.js.map → chunk-xadk41cs.js.map} +1 -1
  144. package/dist/{chunk-deqxja6d.js → chunk-z2fnf49p.js} +1 -1
  145. package/dist/{chunk-pzmzp7dx.js → chunk-zdj2wmbj.js} +2 -2
  146. package/dist/{chunk-pzmzp7dx.js.map → chunk-zdj2wmbj.js.map} +1 -1
  147. package/dist/chunks/{ThemeProvider-CiBing7u.js → ThemeProvider-Bz-y1g2i.js} +43 -2
  148. package/dist/chunks/ThemeProvider-Bz-y1g2i.js.map +1 -0
  149. package/dist/client/ClientRouter.d.ts.map +1 -1
  150. package/dist/client/Link.d.ts +17 -2
  151. package/dist/client/Link.d.ts.map +1 -1
  152. package/dist/client/Mutation.d.ts.map +1 -1
  153. package/dist/client/ProgressManager.d.ts +1 -1
  154. package/dist/client/ServerDataProvider.d.ts +9 -0
  155. package/dist/client/ServerDataProvider.d.ts.map +1 -1
  156. package/dist/client/auth/useIntendedUrl.d.ts +14 -0
  157. package/dist/client/auth/useIntendedUrl.d.ts.map +1 -0
  158. package/dist/client/index.d.ts +2 -0
  159. package/dist/client/index.d.ts.map +1 -1
  160. package/dist/client/index.js +149 -25
  161. package/dist/client/index.js.map +1 -1
  162. package/dist/client/useDomain.d.ts +17 -0
  163. package/dist/client/useDomain.d.ts.map +1 -0
  164. package/dist/client/useMutation.d.ts.map +1 -1
  165. package/dist/client/useNavigate.d.ts.map +1 -1
  166. package/dist/config/index.js +1 -1
  167. package/dist/console/run.js +2 -2
  168. package/dist/console/run.js.map +2 -2
  169. package/dist/container/index.js +2 -2
  170. package/dist/container/index.js.map +1 -1
  171. package/dist/database/index.d.ts +1 -0
  172. package/dist/database/index.d.ts.map +1 -1
  173. package/dist/database/index.js +2 -2
  174. package/dist/database/index.js.map +1 -1
  175. package/dist/database/introspect/catalog.d.ts +41 -0
  176. package/dist/database/introspect/catalog.d.ts.map +1 -0
  177. package/dist/database/introspect/index.d.ts +5 -0
  178. package/dist/database/introspect/index.d.ts.map +1 -0
  179. package/dist/database/introspect/mysql.d.ts +4 -0
  180. package/dist/database/introspect/mysql.d.ts.map +1 -0
  181. package/dist/database/introspect/postgres.d.ts +4 -0
  182. package/dist/database/introspect/postgres.d.ts.map +1 -0
  183. package/dist/database/introspect/sqlite.d.ts +4 -0
  184. package/dist/database/introspect/sqlite.d.ts.map +1 -0
  185. package/dist/database/introspect/types.d.ts +55 -0
  186. package/dist/database/introspect/types.d.ts.map +1 -0
  187. package/dist/email/index.js +2 -2
  188. package/dist/email/index.js.map +2 -2
  189. package/dist/facades/Auth.d.ts +15 -0
  190. package/dist/facades/Auth.d.ts.map +1 -1
  191. package/dist/facades/Cookie.d.ts +1 -1
  192. package/dist/facades/Cookie.d.ts.map +1 -1
  193. package/dist/facades/DB.d.ts +3 -0
  194. package/dist/facades/DB.d.ts.map +1 -1
  195. package/dist/facades/Redirect.d.ts.map +1 -1
  196. package/dist/facades/Url.d.ts +8 -0
  197. package/dist/facades/Url.d.ts.map +1 -1
  198. package/dist/facades/index.js +2 -2
  199. package/dist/facades/index.js.map +1 -1
  200. package/dist/foundation/index.js +2 -2
  201. package/dist/foundation/index.js.map +1 -1
  202. package/dist/http/AuthenticationMiddlware.d.ts +14 -2
  203. package/dist/http/AuthenticationMiddlware.d.ts.map +1 -1
  204. package/dist/http/Error.d.ts +6 -0
  205. package/dist/http/Error.d.ts.map +1 -1
  206. package/dist/http/HttpRequest.d.ts +10 -1
  207. package/dist/http/HttpRequest.d.ts.map +1 -1
  208. package/dist/http/errors.d.ts +13 -16
  209. package/dist/http/errors.d.ts.map +1 -1
  210. package/dist/http/index.js +2 -2
  211. package/dist/http/index.js.map +1 -1
  212. package/dist/http/requestContext.d.ts +18 -2
  213. package/dist/http/requestContext.d.ts.map +1 -1
  214. package/dist/http/requestDomain.d.ts +5 -0
  215. package/dist/http/requestDomain.d.ts.map +1 -0
  216. package/dist/i18n/Translator.d.ts.map +1 -1
  217. package/dist/i18n/dictionaryRuntime.js +2 -2
  218. package/dist/i18n/dictionaryRuntime.js.map +1 -1
  219. package/dist/i18n/index.js +2 -2
  220. package/dist/i18n/index.js.map +2 -2
  221. package/dist/i18n/resolveLocale.d.ts +12 -0
  222. package/dist/i18n/resolveLocale.d.ts.map +1 -0
  223. package/dist/kernel/Kernel.d.ts +2 -0
  224. package/dist/kernel/Kernel.d.ts.map +1 -1
  225. package/dist/kernel/index.js +3 -3
  226. package/dist/kernel/index.js.map +4 -4
  227. package/dist/orm/context.d.ts +35 -0
  228. package/dist/orm/context.d.ts.map +1 -1
  229. package/dist/orm/index.d.ts +1 -1
  230. package/dist/orm/index.d.ts.map +1 -1
  231. package/dist/orm/index.js +3 -3
  232. package/dist/orm/index.js.map +2 -2
  233. package/dist/server/Server.d.ts.map +1 -1
  234. package/dist/server/devFetch.d.ts +46 -0
  235. package/dist/server/devFetch.d.ts.map +1 -0
  236. package/dist/server/httpDev.d.ts +1 -22
  237. package/dist/server/httpDev.d.ts.map +1 -1
  238. package/dist/server/httpProd.d.ts.map +1 -1
  239. package/dist/server/index.js +2 -2
  240. package/dist/server/index.js.map +3 -3
  241. package/dist/server/shutdown.d.ts +32 -3
  242. package/dist/server/shutdown.d.ts.map +1 -1
  243. package/dist/server/staticAssetMiss.d.ts +7 -0
  244. package/dist/server/staticAssetMiss.d.ts.map +1 -1
  245. package/dist/services/cron/ScheduleServiceProvider.d.ts +18 -0
  246. package/dist/services/cron/ScheduleServiceProvider.d.ts.map +1 -1
  247. package/dist/services/cron/Scheduler.d.ts +54 -0
  248. package/dist/services/cron/Scheduler.d.ts.map +1 -1
  249. package/dist/services/events/Listener.d.ts +8 -0
  250. package/dist/services/events/Listener.d.ts.map +1 -1
  251. package/dist/services/events/listenerJob.d.ts +1 -1
  252. package/dist/services/events/listenerJob.d.ts.map +1 -1
  253. package/dist/services/index.d.ts +1 -1
  254. package/dist/services/index.d.ts.map +1 -1
  255. package/dist/services/index.js +3 -3
  256. package/dist/services/index.js.map +2 -2
  257. package/dist/services/queue/DatabaseQueueDriver.d.ts +124 -8
  258. package/dist/services/queue/DatabaseQueueDriver.d.ts.map +1 -1
  259. package/dist/services/queue/MemoryQueueDriver.d.ts +8 -2
  260. package/dist/services/queue/MemoryQueueDriver.d.ts.map +1 -1
  261. package/dist/services/queue/QueueDriver.d.ts +83 -0
  262. package/dist/services/queue/QueueDriver.d.ts.map +1 -1
  263. package/dist/services/queue/QueueManager.d.ts +93 -12
  264. package/dist/services/queue/QueueManager.d.ts.map +1 -1
  265. package/dist/services/queue/QueueServiceProvider.d.ts +6 -3
  266. package/dist/services/queue/QueueServiceProvider.d.ts.map +1 -1
  267. package/dist/services/queue/WorkerProcess.d.ts +69 -0
  268. package/dist/services/queue/WorkerProcess.d.ts.map +1 -0
  269. package/dist/services/queue/config.d.ts +25 -1
  270. package/dist/services/queue/config.d.ts.map +1 -1
  271. package/dist/services/queue/queueDriverContract.d.ts +22 -1
  272. package/dist/services/queue/queueDriverContract.d.ts.map +1 -1
  273. package/dist/services/queue/work.d.ts +2 -0
  274. package/dist/services/queue/work.d.ts.map +1 -0
  275. package/dist/services/queue/work.js +4 -0
  276. package/dist/services/queue/work.js.map +11 -0
  277. package/dist/services/router/ApiRouteDispatcher.d.ts +2 -1
  278. package/dist/services/router/ApiRouteDispatcher.d.ts.map +1 -1
  279. package/dist/services/router/DomainResolver.d.ts +73 -0
  280. package/dist/services/router/DomainResolver.d.ts.map +1 -0
  281. package/dist/services/router/DomainRouter.d.ts +59 -0
  282. package/dist/services/router/DomainRouter.d.ts.map +1 -0
  283. package/dist/services/router/RouteServiceProvider.d.ts +1 -1
  284. package/dist/services/router/RouteServiceProvider.d.ts.map +1 -1
  285. package/dist/services/router/ViewRouteDispatcher.d.ts +8 -2
  286. package/dist/services/router/ViewRouteDispatcher.d.ts.map +1 -1
  287. package/dist/services/router/config.d.ts +78 -0
  288. package/dist/services/router/config.d.ts.map +1 -1
  289. package/dist/services/router/globalMiddleware.d.ts +16 -3
  290. package/dist/services/router/globalMiddleware.d.ts.map +1 -1
  291. package/dist/services/router/serverQueryFetcher.d.ts.map +1 -1
  292. package/dist/support/index.js +2 -2
  293. package/dist/support/index.js.map +2 -2
  294. package/dist/testing/Page.d.ts +17 -0
  295. package/dist/testing/Page.d.ts.map +1 -1
  296. package/dist/testing/index.js +16 -3
  297. package/dist/testing/index.js.map +1 -1
  298. package/dist/utils/domainUrl.d.ts +25 -0
  299. package/dist/utils/domainUrl.d.ts.map +1 -0
  300. package/dist/utils/intendedUrl.d.ts +43 -0
  301. package/dist/utils/intendedUrl.d.ts.map +1 -0
  302. package/package.json +2 -1
  303. package/dist/chunk-1y8etsy5.js +0 -9
  304. package/dist/chunk-2tdy5gc3.js +0 -4
  305. package/dist/chunk-2tdy5gc3.js.map +0 -34
  306. package/dist/chunk-61v1a1qj.js +0 -5
  307. package/dist/chunk-65b9hesw.js +0 -6
  308. package/dist/chunk-8g7b5q1v.js +0 -141
  309. package/dist/chunk-8g7b5q1v.js.map +0 -22
  310. package/dist/chunk-9y0ta780.js +0 -5
  311. package/dist/chunk-9y0ta780.js.map +0 -10
  312. package/dist/chunk-c96xf434.js +0 -4
  313. package/dist/chunk-c96xf434.js.map +0 -10
  314. package/dist/chunk-eww1fdv8.js +0 -5
  315. package/dist/chunk-eww1fdv8.js.map +0 -10
  316. package/dist/chunk-f7tvbpvy.js +0 -5
  317. package/dist/chunk-f7tvbpvy.js.map +0 -10
  318. package/dist/chunk-fn138g2s.js +0 -24
  319. package/dist/chunk-fn138g2s.js.map +0 -16
  320. package/dist/chunk-gp6h39z2.js +0 -5
  321. package/dist/chunk-gp6h39z2.js.map +0 -16
  322. package/dist/chunk-jcznxakf.js +0 -9
  323. package/dist/chunk-jcznxakf.js.map +0 -12
  324. package/dist/chunk-phea81f3.js +0 -19
  325. package/dist/chunk-phea81f3.js.map +0 -60
  326. package/dist/chunk-pspcnvxp.js +0 -5
  327. package/dist/chunk-sse0wcb1.js +0 -50
  328. package/dist/chunk-sse0wcb1.js.map +0 -10
  329. package/dist/chunk-v0x436vz.js +0 -5
  330. package/dist/chunk-ws7wycyy.js +0 -5
  331. package/dist/chunk-ws7wycyy.js.map +0 -17
  332. package/dist/chunk-yfp9y444.js +0 -5
  333. package/dist/chunk-yfp9y444.js.map +0 -11
  334. package/dist/chunk-yzqy6vt0.js +0 -55
  335. package/dist/chunk-yzqy6vt0.js.map +0 -11
  336. package/dist/chunks/ThemeProvider-CiBing7u.js.map +0 -1
  337. /package/dist/{chunk-apn07kkc.js.map → chunk-rj3fnc4h.js.map} +0 -0
  338. /package/dist/{chunk-deqxja6d.js.map → chunk-z2fnf49p.js.map} +0 -0
package/dist/ai/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Ib as v5}from"../chunk-4728yrmt.js";import{Sd as R2}from"../chunk-gp6h39z2.js";import{Ef as g,pf as S2}from"../chunk-ws7wycyy.js";import"../chunk-yfp9y444.js";import"../chunk-61v1a1qj.js";import"../chunk-1gvtbywr.js";import"../chunk-ymh919gr.js";import{createHmac as k2,randomBytes as wQ,timingSafeEqual as bQ}from"crypto";var VQ="agt1",vQ=86400000;function c(Q){let $=Q??process.env.SECRET;if(!$)throw Error("Signing a pending tool call needs an app secret. Set SECRET in the environment.");return $}function P(Q){if(Q===null||typeof Q!=="object")return JSON.stringify(Q)??"null";if(Array.isArray(Q))return`[${Q.map(P).join(",")}]`;let $=Q;return`{${Object.keys($).filter((G)=>$[G]!==void 0).sort().map((G)=>`${JSON.stringify(G)}:${P($[G])}`).join(",")}}`}function E2(Q){return Q.map(($)=>`${$.length}:${$}`).join("")}function m(Q,$){return k2("sha256",Q).update(E2($)).digest()}function fQ(Q,$,Z){let G=[VQ,Q.runId,Q.toolCallId,Q.name,Q.kind,$,String(Z),P(Q.input)];if(Q.path&&Q.path.length>0)G.push(P(Q.path));return G}var hQ=(Q)=>Buffer.from(Q,"utf8").toString("base64url"),x2=(Q)=>Buffer.from(Q,"base64url").toString("utf8");function yQ(Q,$={}){let Z=c($.secret),J=($.now??Date.now())+($.ttlMs??vQ),Y=wQ(12).toString("base64url"),W=m(Z,fQ(Q,Y,J)).toString("base64url");return[VQ,hQ(Q.runId),Y,J.toString(36),W].join(".")}function p(Q){return XQ(Q,VQ)}function XQ(Q,$){let Z=Q.split(".");if(Z.length!==5||Z[0]!==$)return null;let G=Number.parseInt(Z[3],36);if(!Number.isFinite(G))return null;try{return{runId:x2(Z[1]),nonce:Z[2],expiresAt:G}}catch{return null}}function gQ(Q,$,Z={}){let G=c(Z.secret),J=p(Q);if(!J)return{ok:!1,reason:"malformed"};let Y=Buffer.from(Q.split(".")[4],"base64url"),W=m(G,fQ($,J.nonce,J.expiresAt));if(Y.length!==W.length||!bQ(Y,W))return{ok:!1,reason:"forged"};if((Z.now??Date.now())>J.expiresAt)return{ok:!1,reason:"expired"};return{ok:!0,runId:J.runId,nonce:J.nonce,expiresAt:J.expiresAt}}var i="agn1";function uQ(Q,$,Z){return[i,Q.runId,P(Q.path),Q.nestedRunId,$,String(Z),P([...Q.open].sort()),P(Q.input)]}function cQ(Q,$={}){let Z=c($.secret),J=($.now??Date.now())+($.ttlMs??vQ),Y=wQ(12).toString("base64url"),W=m(Z,uQ(Q,Y,J)).toString("base64url");return[i,hQ(Q.runId),Y,J.toString(36),W].join(".")}function mQ(Q,$,Z={}){let G=c(Z.secret),J=XQ(Q,i);if(!J)return{ok:!1,reason:"malformed"};let Y=Buffer.from(Q.split(".")[4],"base64url"),W=m(G,uQ({...$,runId:J.runId},J.nonce,J.expiresAt));if(Y.length!==W.length||!bQ(Y,W))return{ok:!1,reason:"forged"};if((Z.now??Date.now())>J.expiresAt)return{ok:!1,reason:"expired"};return{ok:!0,runId:J.runId,nonce:J.nonce,expiresAt:J.expiresAt}}var E=new Map,pQ=1024;function A2(Q){for(let[$,Z]of E)if(Z<=Q)E.delete($);pQ=Math.max(1024,E.size*2)}function iQ(Q,$={}){return dQ(p(Q),$)}function lQ(Q,$={}){return dQ(XQ(Q,i),$)}function dQ(Q,$){if(!Q)return!1;let Z=$.now??Date.now();if(E.size>=pQ)A2(Z);let G=E.get(Q.nonce);if(G!==void 0&&G>Z)return!1;return E.set(Q.nonce,Q.expiresAt),!0}class v extends Error{id;code="attachment_not_found";constructor(Q){super(`No attachment ${Q}.`);this.id=Q;this.name="AttachmentNotFoundError"}}class x extends Error{code="invalid_attachment_scope";constructor(Q){super(Q);this.name="InvalidAttachmentScopeError"}}function BQ(Q){if(!Q||typeof Q.key!=="string"||Q.key.length===0)throw new x("An attachment scope needs a non-empty key. Return `null` from `attachmentScope()` for a request that has no subject \u2014 an empty key is a bucket every caller shares.");return Q}var C="gemi_att_";function KQ(){return`${C}${crypto.randomUUID()}`}class f{store;storage;scope;constructor(Q,$,Z){this.store=Q;this.storage=$;this.scope=Z;BQ(Z)}async get(Q){let $=await this.store.find(this.scope,Q);if(!$||$.scopeKey!==this.scope.key)throw new v(Q);return $}async read(Q){return await this.readRecord(Q,await this.get(Q))}async readRecord(Q,$){if(!$.objectName)throw new v(Q);return await this.storage.read({name:$.objectName})}async file(Q){let $=await this.get(Q),G=(await this.readRecord(Q,$)).body,J=G instanceof Blob?G:G?await new Response(G).blob():new Blob([]);return new File([J],$.name,{type:$.mimeType})}async put(Q,$={}){let Z=KQ(),G=$.mimeType??Q.type??"",J=$.name??(Q instanceof File?Q.name:Z),Y=await this.storage.put({name:HQ(Z,J),body:Q,contentType:G||void 0}),W={id:Z,scopeKey:this.scope.key,objectName:Y,name:J,mimeType:G||"application/octet-stream",size:Q.size,createdAt:new Date().toISOString(),destination:$.fileId?"both":"storage",...$.fileId?{fileId:$.fileId}:{}};return await this.store.put(this.scope,W),W}}function HQ(Q,$){let Z=/\.([A-Za-z0-9]{1,8})$/.exec($);return`attachments/${Q}${Z?`.${Z[1].toLowerCase()}`:""}`}class l{rows=new Map;async put(Q,$){BQ(Q),this.rows.set($.id,{...$,scopeKey:Q.key})}async find(Q,$){BQ(Q);let Z=this.rows.get($);if(!Z||Z.scopeKey!==Q.key)return null;return Z}get size(){return this.rows.size}}var d=new l;var zQ=new TextEncoder;function nQ(Q){return`id: ${Q.seq}
2
+ import{Ib as v5}from"../chunk-4728yrmt.js";import{Be as S2,Se as g,df as R2}from"../chunk-0amv13g6.js";import"../chunk-9k5daets.js";import"../chunk-7hbhbht2.js";import"../chunk-jk8mn861.js";import"../chunk-wqmzad46.js";import"../chunk-ptjexzn1.js";import{createHmac as k2,randomBytes as wQ,timingSafeEqual as bQ}from"crypto";var VQ="agt1",vQ=86400000;function c(Q){let $=Q??process.env.SECRET;if(!$)throw Error("Signing a pending tool call needs an app secret. Set SECRET in the environment.");return $}function P(Q){if(Q===null||typeof Q!=="object")return JSON.stringify(Q)??"null";if(Array.isArray(Q))return`[${Q.map(P).join(",")}]`;let $=Q;return`{${Object.keys($).filter((G)=>$[G]!==void 0).sort().map((G)=>`${JSON.stringify(G)}:${P($[G])}`).join(",")}}`}function E2(Q){return Q.map(($)=>`${$.length}:${$}`).join("")}function m(Q,$){return k2("sha256",Q).update(E2($)).digest()}function fQ(Q,$,Z){let G=[VQ,Q.runId,Q.toolCallId,Q.name,Q.kind,$,String(Z),P(Q.input)];if(Q.path&&Q.path.length>0)G.push(P(Q.path));return G}var hQ=(Q)=>Buffer.from(Q,"utf8").toString("base64url"),x2=(Q)=>Buffer.from(Q,"base64url").toString("utf8");function yQ(Q,$={}){let Z=c($.secret),J=($.now??Date.now())+($.ttlMs??vQ),Y=wQ(12).toString("base64url"),W=m(Z,fQ(Q,Y,J)).toString("base64url");return[VQ,hQ(Q.runId),Y,J.toString(36),W].join(".")}function p(Q){return XQ(Q,VQ)}function XQ(Q,$){let Z=Q.split(".");if(Z.length!==5||Z[0]!==$)return null;let G=Number.parseInt(Z[3],36);if(!Number.isFinite(G))return null;try{return{runId:x2(Z[1]),nonce:Z[2],expiresAt:G}}catch{return null}}function gQ(Q,$,Z={}){let G=c(Z.secret),J=p(Q);if(!J)return{ok:!1,reason:"malformed"};let Y=Buffer.from(Q.split(".")[4],"base64url"),W=m(G,fQ($,J.nonce,J.expiresAt));if(Y.length!==W.length||!bQ(Y,W))return{ok:!1,reason:"forged"};if((Z.now??Date.now())>J.expiresAt)return{ok:!1,reason:"expired"};return{ok:!0,runId:J.runId,nonce:J.nonce,expiresAt:J.expiresAt}}var i="agn1";function uQ(Q,$,Z){return[i,Q.runId,P(Q.path),Q.nestedRunId,$,String(Z),P([...Q.open].sort()),P(Q.input)]}function cQ(Q,$={}){let Z=c($.secret),J=($.now??Date.now())+($.ttlMs??vQ),Y=wQ(12).toString("base64url"),W=m(Z,uQ(Q,Y,J)).toString("base64url");return[i,hQ(Q.runId),Y,J.toString(36),W].join(".")}function mQ(Q,$,Z={}){let G=c(Z.secret),J=XQ(Q,i);if(!J)return{ok:!1,reason:"malformed"};let Y=Buffer.from(Q.split(".")[4],"base64url"),W=m(G,uQ({...$,runId:J.runId},J.nonce,J.expiresAt));if(Y.length!==W.length||!bQ(Y,W))return{ok:!1,reason:"forged"};if((Z.now??Date.now())>J.expiresAt)return{ok:!1,reason:"expired"};return{ok:!0,runId:J.runId,nonce:J.nonce,expiresAt:J.expiresAt}}var E=new Map,pQ=1024;function A2(Q){for(let[$,Z]of E)if(Z<=Q)E.delete($);pQ=Math.max(1024,E.size*2)}function iQ(Q,$={}){return dQ(p(Q),$)}function lQ(Q,$={}){return dQ(XQ(Q,i),$)}function dQ(Q,$){if(!Q)return!1;let Z=$.now??Date.now();if(E.size>=pQ)A2(Z);let G=E.get(Q.nonce);if(G!==void 0&&G>Z)return!1;return E.set(Q.nonce,Q.expiresAt),!0}class v extends Error{id;code="attachment_not_found";constructor(Q){super(`No attachment ${Q}.`);this.id=Q;this.name="AttachmentNotFoundError"}}class x extends Error{code="invalid_attachment_scope";constructor(Q){super(Q);this.name="InvalidAttachmentScopeError"}}function BQ(Q){if(!Q||typeof Q.key!=="string"||Q.key.length===0)throw new x("An attachment scope needs a non-empty key. Return `null` from `attachmentScope()` for a request that has no subject \u2014 an empty key is a bucket every caller shares.");return Q}var C="gemi_att_";function KQ(){return`${C}${crypto.randomUUID()}`}class f{store;storage;scope;constructor(Q,$,Z){this.store=Q;this.storage=$;this.scope=Z;BQ(Z)}async get(Q){let $=await this.store.find(this.scope,Q);if(!$||$.scopeKey!==this.scope.key)throw new v(Q);return $}async read(Q){return await this.readRecord(Q,await this.get(Q))}async readRecord(Q,$){if(!$.objectName)throw new v(Q);return await this.storage.read({name:$.objectName})}async file(Q){let $=await this.get(Q),G=(await this.readRecord(Q,$)).body,J=G instanceof Blob?G:G?await new Response(G).blob():new Blob([]);return new File([J],$.name,{type:$.mimeType})}async put(Q,$={}){let Z=KQ(),G=$.mimeType??Q.type??"",J=$.name??(Q instanceof File?Q.name:Z),Y=await this.storage.put({name:HQ(Z,J),body:Q,contentType:G||void 0}),W={id:Z,scopeKey:this.scope.key,objectName:Y,name:J,mimeType:G||"application/octet-stream",size:Q.size,createdAt:new Date().toISOString(),destination:$.fileId?"both":"storage",...$.fileId?{fileId:$.fileId}:{}};return await this.store.put(this.scope,W),W}}function HQ(Q,$){let Z=/\.([A-Za-z0-9]{1,8})$/.exec($);return`attachments/${Q}${Z?`.${Z[1].toLowerCase()}`:""}`}class l{rows=new Map;async put(Q,$){BQ(Q),this.rows.set($.id,{...$,scopeKey:Q.key})}async find(Q,$){BQ(Q);let Z=this.rows.get($);if(!Z||Z.scopeKey!==Q.key)return null;return Z}get size(){return this.rows.size}}var d=new l;var zQ=new TextEncoder;function nQ(Q){return`id: ${Q.seq}
3
3
  data: ${JSON.stringify(Q.event)}
4
4
 
5
5
  `}var I2=5000,w2=`: keepalive
@@ -17,4 +17,4 @@ data: ${JSON.stringify(V.event)}
17
17
  `);while(B!==-1){let K=$.slice(0,B);$=$.slice(B+1);let H=W(K);if(H)yield H;B=$.indexOf(`
18
18
  `)}}if($.length>0){let X=W($);if(X)yield X}let V=Y();if(V)yield V}async function*H2(Q,$={}){let Z=new Map,G=new Set,J=!1;for await(let Y of V5(Q)){if(Y.data==="[DONE]")break;let W;try{W=JSON.parse(Y.data)}catch{continue}switch(typeof W.type==="string"?W.type:Y.event){case"response.output_text.delta":{let X=String(W.delta??"");if(!X)break;yield $.structuredOutput?{type:"output-delta",delta:X}:{type:"text-delta",delta:X};break}case"response.reasoning_summary_text.delta":case"response.reasoning_text.delta":{let X=String(W.delta??"");if(!X)break;yield{type:"reasoning-delta",delta:X,id:W.item_id};break}case"response.output_item.added":{let X=W.item;if(!X)break;if(X.type==="function_call"){let B=String(X.id??W.item_id??X.call_id??"");Z.set(B,{callId:String(X.call_id??B),name:String(X.name??""),namespace:typeof X.namespace==="string"&&X.namespace?X.namespace:void 0,done:!1})}break}case"response.function_call_arguments.delta":{let X=Z.get(String(W.item_id??""));if(!X)break;let B=String(W.delta??"");if(!B)break;yield{type:"tool-call-delta",toolCallId:X.callId,name:X.name,argsDelta:B,...X.namespace?{namespace:X.namespace}:{}};break}case"response.function_call_arguments.done":{let X=String(W.item_id??""),B=Z.get(X);if(!B)break;B.done=!0,yield{type:"tool-call",toolCallId:B.callId,name:B.name,args:String(W.arguments??""),...B.namespace?{namespace:B.namespace}:{}};break}case"response.output_item.done":{let X=W.item;if(!X)break;if(X.type==="function_call"){let B=String(X.id??W.item_id??X.call_id??""),K=Z.get(B);if(K?.done)break;let H=(typeof X.namespace==="string"?X.namespace:"")||K?.namespace;if(yield{type:"tool-call",toolCallId:String(X.call_id??B),name:String(X.name??K?.name??""),args:String(X.arguments??""),...H?{namespace:H}:{}},K)K.done=!0;break}if(X.type==="tool_search_call"||X.type==="tool_search_output"){let B=X5(X);if(B.loaded.length===0&&B.namespaces.length===0)break;let K=String(X.tool_search_call_id??X.id??"");if(G.has(K))break;G.add(K),yield{type:"tool-search",...B}}break}case"response.refusal.done":{yield{type:"error",error:{code:"content_filtered",message:String(W.refusal??"The model refused to answer."),retryable:!1}};break}case"response.completed":{J=!0,yield{type:"finish",reason:"stop",usage:_Q(W.response?.usage)};break}case"response.incomplete":{J=!0;let X=_Q(W.response?.usage),B=W.response?.incomplete_details?.reason;if(B==="content_filter"){yield{type:"error",error:{code:"content_filtered",message:B5(W.response?.content_filters),retryable:!1}},yield{type:"finish",reason:"error",usage:X};break}yield{type:"finish",reason:B==="max_output_tokens"?"length":"stop",usage:X};break}case"response.failed":case"error":{J=!0;let X=W.response?.error??W.error??W;yield{type:"error",error:K5(X)},yield{type:"finish",reason:"error",usage:_Q(W.response?.usage)};break}}if(J)return}if(!J)yield{type:"error",error:{code:"provider_error",message:"The provider stream ended without a terminal event.",retryable:!0}},yield{type:"finish",reason:"error",usage:A()}}function X5(Q){let $=[],Z=[];return z2(Q.results??Q.tools??Q.loaded??Q.output,$,Z,0),{loaded:PQ($),namespaces:PQ(Z)}}function z2(Q,$,Z,G){if(!Array.isArray(Q)||G>4)return;for(let J of Q){if(typeof J==="string"){$.push(J);continue}if(!J||typeof J!=="object")continue;let Y=J,W=typeof Y.name==="string"?Y.name:typeof Y.tool_name==="string"?Y.tool_name:"",V=Y.tools??Y.functions;if(Array.isArray(V)){if(W)Z.push(W);z2(V,$,Z,G+1);continue}if(W)$.push(W)}}function PQ(Q){return Q.filter(($,Z)=>Q.indexOf($)===Z)}function B5(Q){if(!Array.isArray(Q))return"The provider's content filter blocked this request.";let Z=[];for(let G of Q){if(!G||typeof G!=="object")continue;let J=G,Y=J.content_filter_results;if(!Y||typeof Y!=="object")continue;for(let[W,V]of Object.entries(Y))if(V&&typeof V==="object"&&V.filtered===!0)Z.push(`${W} (${String(J.source_type??"unknown")})`)}return Z.length===0?"The provider's content filter blocked this request.":`The provider's content filter blocked this request. Categories: ${PQ(Z).join(", ")}.`}function K5(Q){let $=typeof Q?.message==="string"?Q.message:"The provider stream failed.",Z=String(Q?.code??"").toLowerCase();if(Z==="rate_limit_exceeded")return{code:"rate_limited",message:$,retryable:!0};if(Z==="context_length_exceeded")return{code:"context_length_exceeded",message:$,retryable:!1};if(Z.includes("content_filter"))return{code:"content_filtered",message:$,retryable:!1};return{code:"provider_error",message:$,retryable:!0}}function A(){return{inputTokens:0,outputTokens:0,totalTokens:0}}function _Q(Q){if(!Q)return A();let $=Number(Q.input_tokens??0),Z=Number(Q.output_tokens??0),G={inputTokens:$,outputTokens:Z,totalTokens:Number(Q.total_tokens??$+Z)},J=Q.output_tokens_details?.reasoning_tokens;if(typeof J==="number")G.reasoningTokens=J;let Y=Q.input_tokens_details?.cached_tokens;if(typeof Y==="number")G.cachedInputTokens=Y;return G}async function*U2(Q){if(!Q)return;let $=Q.getReader(),Z=new TextDecoder;try{while(!0){let{done:J,value:Y}=await $.read();if(J)break;if(Y)yield Z.decode(Y,{stream:!0})}let G=Z.decode();if(G)yield G}finally{$.releaseLock()}}async function*MQ(Q,$,Z){let G;try{G=await NQ(Q.responsesUrl,{method:"POST",headers:{...await Q.headers(),"content-type":"application/json"},body:JSON.stringify($)},{maxRetries:Q.maxRetries,timeoutMs:Q.timeoutMs,signal:Z.signal,fetchImpl:Q.fetchImpl})}catch(J){let Y=R(J);if(Y.code!=="aborted")yield{type:"error",error:Y};yield{type:"finish",reason:Y.code==="aborted"?"aborted":"error",usage:A()};return}try{yield*H2(U2(G.body),{structuredOutput:Z.structuredOutput})}catch(J){let Y=R(J);if(Y.code==="aborted"){yield{type:"finish",reason:"aborted",usage:A()};return}yield{type:"error",error:Y},yield{type:"finish",reason:"error",usage:A()}}}async function qQ(Q,$){let Z=new FormData;Z.set("purpose","user_data"),Z.set("file",$);let J=await(await NQ(Q.filesUrl,{method:"POST",headers:await Q.headers(),body:Z},{maxRetries:Q.maxRetries,timeoutMs:Q.timeoutMs,fetchImpl:Q.fetchImpl})).json();if(!J?.id)throw Error("The provider accepted the upload but returned no file id.");return J.id}function SQ(Q){let $=H5(Q);if($.startsWith("gpt-3.5")||$.startsWith("text-")||$.startsWith("davinci"))return{reasoning:!1,structuredOutput:!1,fileInput:!1,parallelToolCalls:!0,toolSearch:!1};let Z=z5($);if(Z?.kind==="o")return{reasoning:!0,structuredOutput:!0,fileInput:!0,parallelToolCalls:Z.major>1,toolSearch:D2(Z)};if(Z?.kind==="gpt")return{reasoning:Z.major>=5,structuredOutput:Z.major>4||$.startsWith("gpt-4o")||$.startsWith("gpt-4.1"),fileInput:Z.major>4||$.startsWith("gpt-4o")||$.startsWith("gpt-4.1"),parallelToolCalls:!0,toolSearch:D2(Z)};return{reasoning:!0,structuredOutput:!0,fileInput:!0,parallelToolCalls:!0,toolSearch:!0}}function D2(Q){if(Q.kind==="o")return Q.major>=5;return Q.major>5||Q.major===5&&Q.minor>=2}function H5(Q){return Q.trim().toLowerCase()}function z5(Q){let $=/^gpt-(\d+)(?:\.(\d+))?/.exec(Q);if($?.[1])return{kind:"gpt",major:Number($[1]),minor:Number($[2]??0)};let Z=/^o(\d+)(?:[-.]|$)/.exec(Q);if(Z?.[1])return{kind:"o",major:Number(Z[1]),minor:0};return null}function RQ(Q,$){let{capabilities:Z}=$,G={model:$.model,input:U5(Q.messages,Z),stream:!0};if(Q.systemPrompt)G.instructions=Q.systemPrompt;let J=P5(Q.tools,Z);if(J.length>0){if(G.tools=J,!Z.parallelToolCalls)G.parallel_tool_calls=!1}if(Q.output)G.text={format:{type:"json_schema",name:Q.output.name,schema:Q.output.schema,strict:!0}};if(Q.reasoning&&Z.reasoning)G.reasoning={effort:Q.reasoning,summary:"auto"};if(typeof Q.temperature==="number")G.temperature=Q.temperature;if(typeof Q.maxOutputTokens==="number")G.max_output_tokens=Q.maxOutputTokens;return G}function U5(Q,$){let Z=[];for(let G of Q){let J=G.role,Y=[],W=()=>{if(Y.length===0)return;Z.push({type:"message",role:J,content:Y}),Y=[]};for(let V of G.content??[])switch(V.type){case"text":{if(!V.text)break;Y.push(e(J,V.text));break}case"output":{if(V.partial)break;Y.push(e(J,JSON.stringify(V.value)));break}case"file":{if(J==="assistant")break;let X=j5(V);if(!$.fileInput){if(X)Y.push(e(J,O2(V,!1)));break}if(V.fileId?.startsWith(C))throw Error(`FilePart.fileId holds a gemi attachment id (${V.fileId}). That field is the *provider's* file id, from \`fileId\` on the upload response; the \`attachmentId\` goes in \`FilePart.attachmentId\`, is shown to the model as text, and is resolved by a tool through \`ctx.attachments\`.`);if(!V.fileId&&!X)throw Error("FilePart.fileId is empty and there is no `attachmentId` either. `fileId` is the *provider's* file id and `attachmentId` is gemi's (`gemi_att_\u2026`), both from the upload response; an upload always answers at least one, so a part with neither was built from something other than that answer.");if(X)Y.push(e(J,O2(V,!!V.fileId)));if(V.fileId)Y.push(L5(V));break}case"reasoning":{W();let X=N5(V);if(X)Z.push(X);break}case"tool-call":{if(V.partial)break;W(),Z.push({type:"function_call",call_id:V.toolCallId,name:String(V.name),arguments:JSON.stringify(V.input??{})});break}case"tool-result":{W(),Z.push({type:"function_call_output",call_id:V.toolCallId,output:_5(V)});break}}W()}return O5(Z)}var D5="No result was recorded for this tool call. Assume it did not complete.";function O5(Q){let $=new Set,Z=new Set,G=[];for(let Y of Q){if(Y.type==="function_call"){let W=String(Y.call_id);if($.has(W))continue;$.add(W)}else if(Y.type==="function_call_output"){let W=String(Y.call_id);if(!$.has(W)||Z.has(W))continue;Z.add(W)}G.push(Y)}if(Z.size===$.size)return G;let J=[];for(let Y of G){if(J.push(Y),Y.type!=="function_call")continue;let W=String(Y.call_id);if(Z.has(W))continue;Z.add(W),J.push({type:"function_call_output",call_id:W,output:D5})}return J}function e(Q,$){return{type:Q==="assistant"?"output_text":"input_text",text:$}}function j5(Q){let $=Q.attachmentId;return typeof $==="string"&&$.startsWith(C)?$:void 0}function O2(Q,$){let Z=[`id=${JSON.stringify(Q.attachmentId)}`];if(Q.name)Z.push(`name=${JSON.stringify(Q.name)}`);if(Q.mimeType)Z.push(`mimeType=${JSON.stringify(Q.mimeType)}`);let G=`attachment ${Z.join(" ")}`;return $?`[${G}]`:`[${G} \u2014 its contents are not shown to you; a tool can read the file by this id]`}function L5(Q){let $=Q.mimeType?.trim().toLowerCase()??"";return{type:($?$.startsWith("image/")&&$!=="image/svg+xml":F5(Q.name))?"input_image":"input_file",file_id:Q.fileId}}function F5(Q){let $=/\.([a-z0-9]+)$/.exec(Q?.trim().toLowerCase()??"");return $?.[1]!==void 0&&C5.has($[1])}var C5=new Set(["jpeg","jpg","png","gif","webp"]);function N5(Q){if(!Q.id)return null;let $={type:"reasoning",id:Q.id};return $.summary=Q.text?[{type:"summary_text",text:Q.text}]:[],$}function _5(Q){if(Q.status==="ok")return typeof Q.output==="string"?Q.output:JSON.stringify(Q.output??null);if(Q.status==="denied"){let $=Q.reason?` Reason given: ${Q.reason}`:"";if(Q.cause==="stopped")return`The run was stopped before this tool call could complete, so it did not run.${$}`;return`The user declined this tool call, so it did not run.${$}`}return`The tool call failed and produced no result. Error (${Q.error?.code??"unknown"}): ${Q.error?.message??"no message"}`}function j2(Q){return Array.isArray(Q.tools)}function P5(Q,$){if(!Q||Q.length===0)return[];if(!$.toolSearch){let J=[];for(let Y of Q)if(j2(Y))for(let W of Y.tools)J.push(QQ(W,!1));else J.push(QQ(Y,!1));return J}let Z=[],G=!1;for(let J of Q)if(j2(J)){let Y=J.tools.map((W)=>{if(W.deferred)G=!0;return QQ(W,!0)});Z.push({type:"namespace",name:J.name,description:J.description,tools:Y})}else{if(J.deferred)G=!0;Z.push(QQ(J,!0))}if(G)Z.push({type:"tool_search"});return Z}function QQ(Q,$){let Z={type:"function",name:Q.name,description:Q.description,parameters:Q.parameters,strict:Q.strict};if($&&Q.deferred)Z.defer_loading=!0;return Z}var F2=120000,C2=2;function T(Q){return typeof process>"u"?void 0:process.env?.[Q]}class $Q{static models(){return[]}normalizeError(Q){return R(Q)}}var N2=["gpt-5.5","gpt-5.4","gpt-5.4-mini","gpt-5.4-nano","gpt-5.2","gpt-5.1","gpt-5","gpt-5-mini","gpt-5-nano","gpt-4.1","gpt-4.1-mini","gpt-4.1-nano","gpt-4o","gpt-4o-mini","o4-mini","o3","o3-mini"];class TQ extends $Q{model;capabilities;config;constructor(Q,$={}){super();this.model=Q,this.capabilities=SQ(Q),this.config=$}static model(Q,$){return new TQ(Q,$)}static models(){return N2}stream(Q){let $=RQ(Q,{model:this.model,capabilities:this.capabilities});return MQ(this.endpoint(),$,{signal:Q.signal,structuredOutput:Boolean(Q.output)})}upload(Q){return qQ(this.endpoint(),Q)}baseURL(){return(this.config.baseURL??T("OPENAI_BASE_URL")??"https://api.openai.com/v1").replace(/\/+$/,"")}endpoint(){let Q=this.baseURL(),$=this.config;return{responsesUrl:`${Q}/responses`,filesUrl:`${Q}/files`,headers:async()=>{let Z=$.apiKey??T("OPENAI_API_KEY");return{...Z?{authorization:`Bearer ${Z}`}:{},...$.headers}},timeoutMs:$.timeoutMs??F2,maxRetries:$.maxRetries??C2}}}var M5="preview";function L2(Q){let $=Q.trim().replace(/\/+$/,"");if(!$)return"";return`${$.replace(/\/openai(?:\/v1)?$/i,"")}/openai`}function q5(Q){return/^\d{4}-\d{2}-\d{2}/.test(Q)?"":"/v1"}class kQ extends $Q{model;capabilities;config;constructor(Q,$={}){super();this.model=Q,this.capabilities=SQ(Q),this.config=$}static model(Q,$){return new kQ(Q,$)}static models(){return N2}stream(Q){let $=RQ(Q,{model:this.deployment(),capabilities:this.capabilities});return MQ(this.endpoint(),$,{signal:Q.signal,structuredOutput:Boolean(Q.output)})}upload(Q){return qQ(this.endpoint(),Q)}deployment(){return this.config.deployment??this.model}base(){let Q=this.config,$=Q.baseURL??Q.endpoint??T("AZURE_OPENAI_ENDPOINT");if($)return L2($);let Z=Q.resourceName??T("AZURE_OPENAI_RESOURCE_NAME")??T("AZURE_RESOURCE_NAME");return Z?L2(`https://${Z.trim()}.cognitiveservices.azure.com`):""}endpoint(){let Q=this.config,$=this.base(),Z=Q.apiVersion??T("AZURE_OPENAI_API_VERSION")??M5,G=q5(Z),J=`?api-version=${encodeURIComponent(Z)}`;return{responsesUrl:`${$}${G}/responses${J}`,filesUrl:`${$}${G}/files${J}`,headers:async()=>{if(Q.getToken)return{authorization:`Bearer ${await Q.getToken()}`,...Q.headers};let Y=Q.apiKey??T("AZURE_OPENAI_API_KEY");return{...Y?{"api-key":Y}:{},...Q.headers}},timeoutMs:Q.timeoutMs??F2,maxRetries:Q.maxRetries??C2}}}class I extends Error{runId;requested;oldest;code="frame_cursor_evicted";constructor(Q,$,Z){super(`Frame ${$} of run ${Q} has been evicted; the oldest frame still buffered is ${Z}. Reload the thread instead of resuming.`);this.runId=Q;this.requested=$;this.oldest=Z}}class y extends Error{runId;code="live_run_not_found";constructor(Q){super(`No live run ${Q} in this process.`);this.runId=Q}}class ZQ{ttlMs;maxFrames;runs=new Map;byThread=new Map;byClientRun=new Map;constructor(Q={}){this.ttlMs=Q.ttlMs??60000,this.maxFrames=Q.maxFrames??4096}register(Q,$={}){let Z={run:Q,threadId:$.threadId,clientRunId:$.clientRunId,frames:[],lastSeq:-1,lostBefore:0,ended:!1,evictAt:null,wake:new Set,version:0};if(this.runs.set(Q.runId,Z),$.threadId)this.byThread.set($.threadId,Q.runId);if($.clientRunId)this.byClientRun.set($.clientRunId,Q.runId);return this.pump(Z,$)}findByClientRunId(Q){let $=this.byClientRun.get(Q);return $&&this.runs.has($)?$:null}async find(Q){let $=this.byThread.get(Q.threadId);if(!$)return null;let Z=this.runs.get($);if(!Z)return null;return{runId:$,seq:Z.lastSeq}}get(Q){return this.runs.get(Q)?.run??null}replay(Q,$){let Z=this.runs.get(Q);if(!Z)throw new y(Q);if($!==void 0&&$<Z.lostBefore)throw new I(Q,$,Z.lostBefore);let G=Z.frames[0]?.seq;return this.drain(Z,Q,$??G??Z.lastSeq+1)}clear(){for(let Q of this.runs.values()){if(Q.evictAt)clearTimeout(Q.evictAt);Q.ended=!0,this.notify(Q)}this.runs.clear(),this.byThread.clear(),this.byClientRun.clear()}get size(){return this.runs.size}async pump(Q,$){let Z=Promise.resolve();try{for await(let G of Q.run.frames()){if(Q.frames.push(G),Q.lastSeq=G.seq,Q.frames.length>this.maxFrames){let Y=Q.frames.shift();if(Y)Q.lostBefore=Y.seq+1}this.notify(Q);let J=$.onEvent;if(J)Z=Z.then(()=>J(G.event)).catch((Y)=>_2($,Y))}}catch(G){_2($,G)}finally{Q.ended=!0,this.notify(Q),this.scheduleEviction(Q),await Z}}async*drain(Q,$,Z){let G=Z;while(!0){let J=Q.version;for(;;){if(G<Q.lostBefore)throw new I($,G,Q.lostBefore);let Y=Q.frames,W=Y[0]?.seq;if(W===void 0)break;let V=Math.max(0,G-W);if(V>=Y.length)break;let X=Y[V];yield X,G=X.seq+1}if(Q.ended&&G>Q.lastSeq)return;await this.wait(Q,J)}}wait(Q,$){if(Q.version!==$)return Promise.resolve();return new Promise((Z)=>Q.wake.add(Z))}notify(Q){Q.version++;let $=Array.from(Q.wake);Q.wake.clear();for(let Z of $)Z()}scheduleEviction(Q){if(Q.evictAt)return;let $=setTimeout(()=>{let Z=Q.run.runId;if(this.runs.delete(Z),Q.threadId&&this.byThread.get(Q.threadId)===Z)this.byThread.delete(Q.threadId);if(Q.clientRunId&&this.byClientRun.get(Q.clientRunId)===Z)this.byClientRun.delete(Q.clientRunId);this.notify(Q)},this.ttlMs);$.unref?.(),Q.evictAt=$}}var EQ=new ZQ;function _2(Q,$){try{Q.onInternalError?.($)}catch{}}class GQ{ttlMs;clientOwnedIds;threads=new Map;lastSweep=0;constructor(Q={}){this.ttlMs=Q.ttlMs??86400000,this.clientOwnedIds=Q.clientOwnedIds??!1}async createThread(Q){let $=crypto.randomUUID();return this.threads.set($,{messages:[],touchedAt:Date.now()}),this.sweep(),{threadId:$}}async loadThread(Q){this.sweep();let $=this.threads.get(Q);if(!$)return this.clientOwnedIds?[]:null;return $.touchedAt=Date.now(),$.messages.slice()}async appendMessages(Q,$){this.sweep();let Z=this.threads.get(Q);if(!Z){if(!this.clientOwnedIds)throw Error(`Thread ${Q} does not exist here, or has expired.`);Z={messages:[],touchedAt:Date.now()},this.threads.set(Q,Z)}for(let G of $){let J=Z.messages.findIndex((Y)=>Y.id===G.id);if(J===-1)Z.messages.push(G);else Z.messages[J]=G}Z.touchedAt=Date.now()}delete(Q){this.threads.delete(Q)}get size(){return this.threads.size}sweep(Q=Date.now()){if(Q-this.lastSweep<60000)return;this.lastSweep=Q;for(let[$,Z]of this.threads)if(Q-Z.touchedAt>this.ttlMs)this.threads.delete($)}}var xQ=new GQ;var S5=S2,JQ=new Map,P2=new WeakMap,YQ=new Map;class T2 extends S5{static kind="agent-controller";store=xQ;liveRuns=EQ;attachments=d;attachmentStorage=R2;hookHoldMs=30000;instructions(Q){}requireThread=!1;authorizeRequest(Q,$){}async stream(Q=new g){let $=await AQ(Q);if($.error)return WQ($);let Z=$.body,G=typeof Z.threadId==="string"?Z.threadId:void 0,J=T5(Z);if(J.error)return WQ({body:{},error:J.error});let Y=J.turn,W=typeof Z.clientRunId==="string"?Z.clientRunId:void 0;if(this.requireThread&&!G)return N(400,{code:"thread_required",message:"This agent takes a turn only on a thread: send a threadId."});let V=W?{cancelled:!1}:null;if(V)YQ.set(W,V);let X=async()=>{let B;if(G){let F=await this.store.loadThread(G);if(!F)return N(404,{code:"thread_not_found",message:`Thread ${G} does not exist here, or has expired.`});B=F}else B=Array.isArray(Z.messages)?Z.messages:[];let K=await this.instructions(Q)||void 0,H=await this.attachmentsFor(Q,G);if(V?.cancelled)return M2();let z=this.agent.stream({messages:B,turn:Y,req:Q,threadId:G,instructions:K,attachments:H}),O={req:Q,runId:z.runId,threadId:G},D=this.liveRuns.register(z,{threadId:G,clientRunId:W,onEvent:(F)=>this.dispatchEvent(F,O),onInternalError:(F)=>this.reportHookFailure(F)}),{stored:U,hooks:j}=this.persistRun(z,O,D);return P2.set(z,U),Q.ctx?.()?.waitUntil(j),z.toResponse()};try{if(await this.authorizeRequest(Q,{route:"stream",threadId:G}),V?.cancelled)return M2();return G?await this.withThread(G,X):await X()}finally{if(V&&YQ.get(W)===V)YQ.delete(W)}}async withThread(Q,$){let Z=JQ.get(Q)??Promise.resolve(),G,J=new Promise((W)=>{G=W}),Y=Z.then(()=>J);JQ.set(Q,Y),await Z;try{let W=await this.liveRuns.find({threadId:Q}),V=W?this.liveRuns.get(W.runId):null;if(V)V.stop({reason:"superseded by a later turn on this thread"}),await P2.get(V);return await $()}finally{if(G(),JQ.get(Q)===Y)JQ.delete(Q)}}async attach(Q=new g){let $=await AQ(Q);if($.error)return WQ($);let Z=$.body,G=typeof Z.threadId==="string"?Z.threadId:x5(Q,"threadId");if(!G)return N(400,{code:"invalid_request",message:"attach needs a threadId: it is the handle that survives a refresh."});await this.authorizeRequest(Q,{route:"attach",threadId:G});let J=await this.liveRuns.find({threadId:G});if(!J)return N(404,{code:"no_live_run",message:`No run in progress for thread ${G} in this process.`});let Y=typeof Z.runId==="string"?Z.runId:void 0,W=Y&&Y!==J.runId?void 0:E5(Q,Z);try{return oQ(this.liveRuns.replay(J.runId,W))}catch(V){if(V instanceof I)return N(410,{code:V.code,message:V.message,oldestSeq:V.oldest});if(V instanceof y)return N(404,{code:V.code,message:V.message});throw V}}async stop(Q=new g){let $=await AQ(Q);if($.error)return WQ($);let Z=$.body;await this.authorizeRequest(Q,{route:"stop",threadId:typeof Z.threadId==="string"?Z.threadId:void 0});let G=typeof Z.runId==="string"?Z.runId:void 0;if(!G&&typeof Z.clientRunId==="string"){if(G=this.liveRuns.findByClientRunId(Z.clientRunId)??void 0,!G){let Y=YQ.get(Z.clientRunId);if(Y)return Y.cancelled=!0,{stopped:!0}}}if(!G&&typeof Z.threadId==="string")G=(await this.liveRuns.find({threadId:Z.threadId}))?.runId;let J=G?this.liveRuns.get(G):null;if(!J)return{stopped:!1};return J.stop({reason:typeof Z.reason==="string"?Z.reason:void 0}),{stopped:!0}}attachmentScope(Q,$){let Z=Q.ctx()?.user,G=Z?.id??Z?.publicId;if(G!==void 0&&G!==null&&String(G)!=="")return{key:`user:${String(G)}`};if($)return{key:`thread:${$}`};return null}attachmentDestination(Q,$){return"both"}async attachmentsFor(Q,$){let Z=await this.attachmentScope(Q,$);if(!Z)return null;return new f(this.attachments,this.attachmentStorage,Z)}async upload(Q=new g){let $=await Q.rawRequest.formData(),Z=$.get("file");if(!(Z instanceof Blob))throw Error("upload expects a multipart body with a `file` field.");let G=Z instanceof File&&Z.name?Z.name:"upload",J=Z.type||"application/octet-stream",Y=$.get("threadId");await this.authorizeRequest(Q,{route:"upload",threadId:typeof Y==="string"&&Y.length>0?Y:void 0});let W=typeof Y==="string"&&Y.length>0&&await this.store.loadThread(Y)!==null?Y:void 0,V=await this.attachmentDestination(Z,Q),X=A5(V,$.get("destination")),B=await this.attachmentScope(Q,W),K=X!=="provider"&&!B;if(K){if(X==="storage")throw Error('This upload was routed to storage, but `attachmentScope()` returned null for the request, so there is no subject to file the attachment under. Guard the route (`this.agent(Chat).middleware({ upload: "auth" })`), send a `threadId` with the upload, or override `attachmentScope()`.');I5()}if(X==="provider"||!B){let j={fileId:await this.agent.provider.upload(Z),name:G,mimeType:J,size:Z.size,destination:"provider"};if(K)j.downgraded="no_scope";return j}let H=KQ(),z=await this.attachmentStorage.put({name:HQ(H,G),body:Z,contentType:J}),O=X==="both"?await this.agent.provider.upload(Z):void 0,D={id:H,scopeKey:B.key,fileId:O,objectName:z,name:G,mimeType:J,size:Z.size,createdAt:new Date().toISOString(),destination:X};return await this.attachments.put(B,D),{fileId:O,attachmentId:H,name:G,mimeType:J,size:Z.size,destination:X}}onMessage(Q,$){}onToolCall(Q,$){}onAwaitingInput(Q,$){}onError(Q,$){}onStreamComplete(Q,$){}reportHookFailure(Q){console.error("[gemi/ai] agent controller hook failed",Q)}async dispatchEvent(Q,$){switch(Q.type){case"tool-call":if(!Q.part.partial&&!Q.resent)await this.onToolCall({toolCallId:Q.part.toolCallId,name:String(Q.part.name),input:Q.part.input},$);return;case"awaiting-input":await this.onAwaitingInput(Q.pending,$);return;case"error":await this.onError(Q.error,$);return;default:return}}persistRun(Q,$,Z){let G=Promise.resolve(),J=(async()=>{let W;try{W=await Q.result()}catch(X){G=this.safely(()=>this.onError({code:"unknown",message:X instanceof Error?X.message:String(X),retryable:!1},$));return}let V=W.messages;if($.threadId&&V.length>0)try{await this.store.appendMessages($.threadId,V)}catch(X){this.reportHookFailure(X)}G=this.notifyRun(W,V,$)})(),Y=J.then(()=>b5(Promise.all([G,Z]).then(()=>{}),this.hookHoldMs));return{stored:J,hooks:Y}}async notifyRun(Q,$,Z){for(let G of $)await this.safely(()=>this.onMessage(G,Z));await this.safely(()=>this.onStreamComplete(Q,Z))}async safely(Q){try{await Q()}catch($){this.reportHookFailure($)}}}async function AQ(Q){let $=Q?.rawRequest;if(!$||$.method==="GET"||$.method==="HEAD"||!$.body)return{body:{}};if(!R5($.headers.get("Content-Type")))return{body:{},status:415,code:"unsupported_media_type",error:"The request body must be sent as application/json."};let Z;try{Z=await $.text()}catch{return{body:{},error:"The request body could not be read."}}if(!Z.trim())return{body:{}};let G;try{G=JSON.parse(Z)}catch{return{body:{},error:"The request body is not valid JSON."}}if(G===null||typeof G!=="object"||Array.isArray(G))return{body:{},error:"The request body must be a JSON object."};return{body:G}}function R5(Q){if(typeof Q!=="string")return!1;let[$]=Q.split(";",1);return $.trim().toLowerCase()==="application/json"}function WQ(Q){return N(Q.status??400,{code:Q.code??"invalid_request",message:Q.error})}function T5(Q){let $=Q.turn&&typeof Q.turn==="object"?Q.turn:Q,Z={};if(typeof $.text==="string")Z.text=$.text;if(Array.isArray($.files)){let G=k5($.files);if(typeof G==="string")return{error:G};Z.files=G}if(Array.isArray($.toolResults))Z.toolResults=$.toolResults;return Object.keys(Z).length>0?{turn:Z}:{}}function k5(Q){let $=[];for(let[Z,G]of Q.entries()){let J=`turn.files[${Z}]`;if(!G||typeof G!=="object"||Array.isArray(G))return`${J} must be an object.`;let Y={};for(let K of["fileId","attachmentId","name","mimeType"]){let H=G[K];if(H===void 0||H===null||H==="")continue;if(typeof H!=="string")return`${J}.${K} must be a string.`;Y[K]=H}let{fileId:W,attachmentId:V,name:X,mimeType:B}=Y;if(W?.startsWith(C))return`${J}.fileId holds a gemi attachment id (${W}). \`fileId\` is the provider's id from the upload response; put this one in \`attachmentId\`.`;if(V!==void 0&&!V.startsWith(C))return`${J}.attachmentId is not a gemi attachment id: it must start with "${C}".`;if(!W&&!V)return`${J} has neither a \`fileId\` nor an \`attachmentId\`. Send the ids the upload response answered.`;$.push({...W?{fileId:W}:{},...V?{attachmentId:V}:{},...X!==void 0?{name:X}:{},...B!==void 0?{mimeType:B}:{}})}return $}function E5(Q,$){if(typeof $.from==="number"&&Number.isFinite($.from))return Math.max(0,Math.floor($.from));if(typeof $.cursor==="number"&&Number.isFinite($.cursor)){let G=Math.floor($.cursor);if(G>=0)return G+1;return}let Z=Q?.rawRequest?.headers?.get("Last-Event-ID");if(Z){let G=Number.parseInt(Z,10);if(Number.isFinite(G))return Math.max(0,G+1)}return}function x5(Q,$){let Z=Q?.search?.get($);return typeof Z==="string"?Z:void 0}function M2(){return N(409,{code:"stopped",message:"The turn was stopped before it started."})}function N(Q,$){return new Response(JSON.stringify({error:$}),{status:Q,headers:{"Content-Type":"application/json"}})}function A5(Q,$){if(typeof $!=="string"||$.length===0)return Q;if($!=="both"&&$!=="provider"&&$!=="storage")throw Error(`Unknown attachment destination "${$}". Expected "both", "provider" or "storage".`);if($===Q||Q==="both"&&$==="storage")return $;if(Q==="both"&&$==="provider")throw Error('This upload asked for the "provider" destination under a "both" policy. A client may ask for "storage", which keeps a file away from the model provider, but it may not ask the server to stop keeping its own copy while the vendor still gets the file \u2014 that is the app\'s retention decision. Change `attachmentDestination()` if this file should not be kept.');throw Error(`This upload asked for the "${$}" destination, but the server's policy for it is "${Q}", and a client hint may only ask for "storage" under a "both" policy. Change \`attachmentDestination()\` if the file really should go there.`)}var q2=!1;function I5(){if(q2)return;q2=!0,console.warn("[gemi/ai] An upload had no attachment scope, so its bytes were sent to the model provider only and no attachment id was minted \u2014 a tool cannot forward this file. Guard the route with auth, send a `threadId` with the upload, or override `attachmentScope()`.")}var w5=2147483647;function b5(Q,$){let Z=Q.then(()=>{},()=>{});if(!($<=w5))return Z;let G,J=new Promise((Y)=>{G=setTimeout(Y,$)});return Promise.race([Z,J]).finally(()=>clearTimeout(G))}export{s2 as toAgentTools,v5 as s,EQ as liveRuns,d as defaultAttachmentStore,xQ as defaultAgentStore,t as ToolNamespace,FQ as Skill,f as ScopedAttachments,h as SKILLS_NAMESPACE,M as PendingEscalation,TQ as OpenAIProvider,ZQ as MemoryLiveRuns,l as MemoryAttachmentStore,GQ as MemoryAgentStore,y as LiveRunNotFoundError,x as InvalidAttachmentScopeError,I as FrameCursorEvictedError,kQ as AzureOpenAIProvider,v as AttachmentNotFoundError,S as AgentTool,$Q as AgentProvider,T2 as AgentController,CQ as Agent};
19
19
 
20
- //# debugId=4D6B5416A19672FE64756E2164756E21
20
+ //# debugId=057203A7B61B126764756E2164756E21