better-supabase 0.34.0 → 0.36.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 (525) hide show
  1. package/dist/{adapter-CWzyKepA.js → adapter-ddQ9Hzka.js} +126 -91
  2. package/dist/{agents-DXiOPB3V.d.ts → agents-BwUHtvD6.d.ts} +4 -4
  3. package/dist/{ai-cache-CLiAXCPH.d.ts → ai-cache-CPOP2PYz.d.ts} +4 -4
  4. package/dist/{ai-chat-DlcBdOhJ.d.ts → ai-chat-BZhfCHHr.d.ts} +106 -25
  5. package/dist/{ai-schedules-Drx2KRTn.d.ts → ai-schedules-BZPmySUa.d.ts} +5 -5
  6. package/dist/ai-sdk/agents/index.d.ts +6 -6
  7. package/dist/ai-sdk/batches/index.d.ts +3 -3
  8. package/dist/ai-sdk/cache/index.d.ts +1 -1
  9. package/dist/ai-sdk/chat/index.d.ts +2 -2
  10. package/dist/ai-sdk/chat/index.js +3 -272
  11. package/dist/ai-sdk/embeddings/index.d.ts +2 -2
  12. package/dist/ai-sdk/files/index.d.ts +1 -1
  13. package/dist/ai-sdk/index.d.ts +5 -5
  14. package/dist/ai-sdk/index.js +2 -3
  15. package/dist/ai-sdk/mcp/index.d.ts +3 -3
  16. package/dist/ai-sdk/memory/index.d.ts +3 -3
  17. package/dist/ai-sdk/workflow/index.d.ts +6 -5
  18. package/dist/ai-sdk/workflow/index.js +9 -9
  19. package/dist/{api-myq2e9t5.d.ts → api-XEaCJbgv.d.ts} +5 -5
  20. package/dist/{api-keys-DbIbkGxx.d.ts → api-keys-C82fMru4.d.ts} +4 -4
  21. package/dist/{app-tables-Don-aNOB.d.ts → app-tables-C0XVpQEJ.d.ts} +1 -1
  22. package/dist/{approvals-Da4uAANx.js → approvals-D8gR1R8R.js} +95 -11
  23. package/dist/{approvals-DZoGtNFv.d.ts → approvals-DqCv7f-G.d.ts} +101 -7
  24. package/dist/{assistant-BEbRPjhn.d.ts → assistant-5heV2GeR.d.ts} +7 -3
  25. package/dist/assistant-BHZ6fqBR.js +300 -0
  26. package/dist/astro/index.d.ts +7 -7
  27. package/dist/astro/index.js +5 -5
  28. package/dist/{auth-module-CqXdm8qD.js → auth-module-DkqapRZJ.js} +1 -1
  29. package/dist/{authorization-DpVtxuKM.d.ts → authorization-2Rv1AJQJ.d.ts} +151 -39
  30. package/dist/{authorization-hooks-CxwsRnfV.d.ts → authorization-hooks-C0GfMvFm.d.ts} +8 -2
  31. package/dist/authz-topic-D7fPUY4P.js +13 -0
  32. package/dist/{automations-Bw5cX7oj.js → automations-D4QTP8nI.js} +2 -1
  33. package/dist/{availability-CebEOfMN.d.ts → availability-CZlcrkqD.d.ts} +49 -8
  34. package/dist/{base64-CVyKHBBw.js → base64-CEBz6-Jj.js} +9 -2
  35. package/dist/better-result/index.d.ts +3 -3
  36. package/dist/{bind-BA05aoY9.d.ts → bind-C2XvMlfg.d.ts} +7 -7
  37. package/dist/{block-env-UX42PHLP.d.ts → block-env-BQrtLPyc.d.ts} +4 -4
  38. package/dist/{block-helpers-disoUWCp.d.ts → block-helpers-BNtM1tqy.d.ts} +1 -1
  39. package/dist/{block-hooks-DrA_d1dJ.d.ts → block-hooks-CtMsgLQr.d.ts} +2 -2
  40. package/dist/{block-subjects-Br2MQNFn.d.ts → block-subjects-Bkieh2Xk.d.ts} +1 -1
  41. package/dist/{block-tables-Bre1zjau.d.ts → block-tables-DPOgnT3y.d.ts} +1 -1
  42. package/dist/{block-transport-BEtC_Kis.d.ts → block-transport-CDmOUuLZ.d.ts} +2 -2
  43. package/dist/blocks/access-requests/index.d.ts +5 -5
  44. package/dist/blocks/activities/index.d.ts +9 -9
  45. package/dist/blocks/agents/index.d.ts +4 -4
  46. package/dist/blocks/ai-cache/index.d.ts +3 -3
  47. package/dist/blocks/ai-chat/index.d.ts +8 -8
  48. package/dist/blocks/ai-chat/index.js +80 -20
  49. package/dist/blocks/ai-files/index.d.ts +3 -3
  50. package/dist/blocks/ai-keys/index.d.ts +4 -4
  51. package/dist/blocks/ai-schedules/index.d.ts +3 -3
  52. package/dist/blocks/announcements/index.d.ts +8 -8
  53. package/dist/blocks/api-keys/index.d.ts +3 -3
  54. package/dist/blocks/approvals/index.d.ts +16 -5
  55. package/dist/blocks/approvals/index.js +7 -4
  56. package/dist/blocks/assets/index.d.ts +6 -6
  57. package/dist/blocks/assignment/index.d.ts +7 -7
  58. package/dist/blocks/attachments/index.d.ts +4 -4
  59. package/dist/blocks/audit/index.d.ts +13 -13
  60. package/dist/blocks/audit/index.js +1 -1
  61. package/dist/blocks/automations/index.d.ts +12 -12
  62. package/dist/blocks/billable-time/index.d.ts +6 -6
  63. package/dist/blocks/billing/index.d.ts +9 -9
  64. package/dist/blocks/billing/index.js +1 -1
  65. package/dist/blocks/bookings/index.d.ts +6 -6
  66. package/dist/blocks/bulk/index.d.ts +4 -4
  67. package/dist/blocks/calendar/index.d.ts +46 -8
  68. package/dist/blocks/calendar/index.js +306 -47
  69. package/dist/blocks/catalog/index.d.ts +52 -15
  70. package/dist/blocks/catalog/index.js +53 -18
  71. package/dist/blocks/channels/index.d.ts +7 -7
  72. package/dist/blocks/collections/index.d.ts +6 -6
  73. package/dist/blocks/comments/index.d.ts +10 -10
  74. package/dist/blocks/compliance/index.d.ts +5 -5
  75. package/dist/blocks/connectors/index.d.ts +4 -4
  76. package/dist/blocks/contacts/index.d.ts +6 -6
  77. package/dist/blocks/content/index.d.ts +5 -5
  78. package/dist/blocks/contracts/index.d.ts +6 -6
  79. package/dist/blocks/courses/index.d.ts +5 -5
  80. package/dist/blocks/created-by/index.d.ts +2 -2
  81. package/dist/blocks/custom-fields/index.d.ts +6 -6
  82. package/dist/blocks/data-lifecycle/index.d.ts +8 -8
  83. package/dist/blocks/deals/index.d.ts +6 -6
  84. package/dist/blocks/deals/index.js +1 -1
  85. package/dist/blocks/dispatch/index.d.ts +6 -6
  86. package/dist/blocks/documents/index.d.ts +4 -4
  87. package/dist/blocks/documents/index.js +1 -1
  88. package/dist/blocks/domains/index.d.ts +6 -6
  89. package/dist/blocks/donations/index.d.ts +6 -6
  90. package/dist/blocks/drive/index.d.ts +6 -6
  91. package/dist/blocks/employees/index.d.ts +8 -8
  92. package/dist/blocks/enrichment/index.d.ts +6 -6
  93. package/dist/blocks/enrollments/index.d.ts +74 -9
  94. package/dist/blocks/enrollments/index.js +67 -3
  95. package/dist/blocks/entitlements/index.d.ts +6 -6
  96. package/dist/blocks/expenses/index.d.ts +93 -6
  97. package/dist/blocks/expenses/index.js +95 -4
  98. package/dist/blocks/field-history/index.d.ts +4 -4
  99. package/dist/blocks/flags/index.d.ts +5 -5
  100. package/dist/blocks/forecasts/index.d.ts +6 -6
  101. package/dist/blocks/forms/index.d.ts +6 -6
  102. package/dist/blocks/goals/index.d.ts +4 -4
  103. package/dist/blocks/guests/index.d.ts +6 -6
  104. package/dist/blocks/hiring/index.d.ts +6 -6
  105. package/dist/blocks/identities/index.d.ts +5 -5
  106. package/dist/blocks/imports/index.d.ts +5 -5
  107. package/dist/blocks/inbox/index.d.ts +11 -11
  108. package/dist/blocks/inbox/index.js +56 -1
  109. package/dist/blocks/incidents/index.d.ts +5 -5
  110. package/dist/blocks/index.d.ts +9 -9
  111. package/dist/blocks/inventory/index.d.ts +6 -6
  112. package/dist/blocks/invoices/index.d.ts +30 -10
  113. package/dist/blocks/invoices/index.js +28 -9
  114. package/dist/blocks/knowledge/index.d.ts +4 -4
  115. package/dist/blocks/knowledge/index.js +1 -1
  116. package/dist/blocks/lead-scoring/index.d.ts +7 -7
  117. package/dist/blocks/leases/index.d.ts +6 -6
  118. package/dist/blocks/leave/index.d.ts +88 -15
  119. package/dist/blocks/leave/index.js +65 -14
  120. package/dist/blocks/ledger/index.d.ts +6 -6
  121. package/dist/blocks/mail-sync/index.d.ts +5 -5
  122. package/dist/blocks/memberships/index.d.ts +2 -2
  123. package/dist/blocks/memory/index.d.ts +5 -5
  124. package/dist/blocks/memory/index.js +30 -5
  125. package/dist/blocks/messaging/index.d.ts +11 -11
  126. package/dist/blocks/metrics/index.d.ts +6 -6
  127. package/dist/blocks/mfa/index.d.ts +2 -2
  128. package/dist/blocks/moderation/index.d.ts +6 -6
  129. package/dist/blocks/notifications/index.d.ts +11 -11
  130. package/dist/blocks/notifications/index.js +1 -1
  131. package/dist/blocks/numbering/index.d.ts +4 -4
  132. package/dist/blocks/oauth-server/index.d.ts +5 -5
  133. package/dist/blocks/oauth-server/index.js +1 -1
  134. package/dist/blocks/onboarding/index.d.ts +5 -5
  135. package/dist/blocks/orders/index.d.ts +7 -7
  136. package/dist/blocks/organizations/index.d.ts +8 -8
  137. package/dist/blocks/outbox/index.d.ts +4 -4
  138. package/dist/blocks/outbox/index.js +1 -1
  139. package/dist/blocks/passes/index.d.ts +8 -8
  140. package/dist/blocks/passes/index.js +2 -2
  141. package/dist/blocks/permissions/index.d.ts +7 -7
  142. package/dist/blocks/pipelines/index.d.ts +6 -6
  143. package/dist/blocks/posts/index.d.ts +5 -5
  144. package/dist/blocks/profiles/index.d.ts +4 -4
  145. package/dist/blocks/promotions/index.d.ts +5 -5
  146. package/dist/blocks/push/index.d.ts +7 -7
  147. package/dist/blocks/queue/index.d.ts +6 -6
  148. package/dist/blocks/queue/index.js +2 -2
  149. package/dist/blocks/quotes/index.d.ts +119 -27
  150. package/dist/blocks/quotes/index.js +112 -18
  151. package/dist/blocks/rank/index.d.ts +4 -4
  152. package/dist/blocks/reactions/index.d.ts +9 -9
  153. package/dist/blocks/relations/index.d.ts +7 -7
  154. package/dist/blocks/reminders/index.d.ts +78 -11
  155. package/dist/blocks/reminders/index.js +118 -6
  156. package/dist/blocks/reviews/index.d.ts +5 -5
  157. package/dist/blocks/saved-views/index.d.ts +6 -6
  158. package/dist/blocks/scores/index.d.ts +5 -5
  159. package/dist/blocks/search/index.d.ts +7 -7
  160. package/dist/blocks/security-events/index.d.ts +7 -7
  161. package/dist/blocks/security-events/index.js +1 -1
  162. package/dist/blocks/segments/index.d.ts +7 -7
  163. package/dist/blocks/sequences/index.d.ts +6 -6
  164. package/dist/blocks/service-accounts/index.d.ts +5 -5
  165. package/dist/blocks/sessions/index.d.ts +2 -2
  166. package/dist/blocks/sessions/index.js +1 -1
  167. package/dist/blocks/settings/index.d.ts +6 -6
  168. package/dist/blocks/share-links/index.d.ts +5 -5
  169. package/dist/blocks/shipments/index.d.ts +6 -6
  170. package/dist/blocks/shipments/index.js +1 -1
  171. package/dist/blocks/signatures/index.d.ts +5 -5
  172. package/dist/blocks/signing-keys/index.d.ts +4 -4
  173. package/dist/blocks/signing-keys/index.js +2 -2
  174. package/dist/blocks/sla/index.d.ts +7 -7
  175. package/dist/blocks/sso/index.d.ts +6 -6
  176. package/dist/blocks/state-machine/index.d.ts +27 -7
  177. package/dist/blocks/state-machine/index.js +7 -2
  178. package/dist/blocks/subjects/index.d.ts +6 -6
  179. package/dist/blocks/tags/index.d.ts +6 -6
  180. package/dist/blocks/tasks/index.d.ts +9 -9
  181. package/dist/blocks/teams/index.d.ts +4 -4
  182. package/dist/blocks/templates/index.d.ts +7 -7
  183. package/dist/blocks/time-tracking/index.d.ts +7 -7
  184. package/dist/blocks/time-tracking/index.js +1 -1
  185. package/dist/blocks/timeline/index.d.ts +8 -8
  186. package/dist/blocks/trash/index.d.ts +6 -6
  187. package/dist/blocks/undo/index.d.ts +4 -4
  188. package/dist/blocks/updated-at/index.d.ts +2 -2
  189. package/dist/blocks/usage/index.d.ts +4 -4
  190. package/dist/blocks/vercel-marketplace/index.d.ts +5 -5
  191. package/dist/blocks/vercel-marketplace/index.js +3 -3
  192. package/dist/blocks/versions/index.d.ts +6 -6
  193. package/dist/blocks/waitlist/index.d.ts +5 -5
  194. package/dist/blocks/waitlist/index.js +1 -1
  195. package/dist/blocks/webhooks/index.d.ts +13 -13
  196. package/dist/blocks/webhooks/index.js +5 -5
  197. package/dist/blocks/workflow-editor/index.d.ts +10 -10
  198. package/dist/blocks/workflow-editor/index.js +65 -2
  199. package/dist/blocks/workflows/index.d.ts +7 -7
  200. package/dist/{bookings-Br0VXzaf.d.ts → bookings-Dj5cvXKv.d.ts} +4 -4
  201. package/dist/{bucket-DvG66r5G.d.ts → bucket-CrsJNHzi.d.ts} +1 -1
  202. package/dist/chat-sdk/index.d.ts +6 -6
  203. package/dist/claims/index.d.ts +6 -6
  204. package/dist/claims/index.js +2 -2
  205. package/dist/cli/{add-DoEtJhZG.js → add-D2CH8t_B.js} +2 -2
  206. package/dist/cli/add-De73Ghlh.js +1 -0
  207. package/dist/cli/{add-THXE7juv.js → add-Duf1-19E.js} +16 -14
  208. package/dist/cli/{agent-59XWXsRi.js → agent-Tqq3MAqx.js} +26 -1
  209. package/dist/cli/{app-table-files-BqLd5TuX.js → app-table-files-ha8X0rRE.js} +2 -2
  210. package/dist/cli/app-tables-BIyQcsHH.js +42 -0
  211. package/dist/cli/{backfill-D-2W0fNT.js → backfill-CLgA6-ll.js} +3 -3
  212. package/dist/cli/bin.js +1 -1
  213. package/dist/cli/{blocks-BVU_FoLo.js → blocks-9AeouX4h.js} +2 -2
  214. package/dist/cli/{blocks-XwUHeyUH.js → blocks-BVB1fMMj.js} +1 -1
  215. package/dist/cli/{cache-D4nwCBXc.js → cache-aMk9vF1_.js} +1 -1
  216. package/dist/cli/{codemod-Dh4lf_k4.js → codemod-B5wrcnF2.js} +113 -4
  217. package/dist/cli/{command-BpZ4AuhR.js → command-DM_x_yzZ.js} +6 -0
  218. package/dist/cli/{completion-DHTT6rjI.js → completion-CusuUJNn.js} +1 -1
  219. package/dist/cli/{completion-B08Q0xB3.js → completion-Cx2UYd-y.js} +2 -2
  220. package/dist/cli/{completion-CwL7e93t.js → completion-DbYb3N8e.js} +2 -2
  221. package/dist/cli/{config-D-Upz3jV.js → config-BeuImpav.js} +1 -1
  222. package/dist/cli/{content-mapper-CwFH_PEn.js → content-mapper-CEtdbshU.js} +2 -2
  223. package/dist/cli/{db-Diy1OebO.js → db-CeiQzhPq.js} +2 -2
  224. package/dist/cli/{doctor-CyAMbZ_s.js → doctor-DaOUWfRN.js} +391 -54
  225. package/dist/cli/env-BfWbheiC.js +1 -0
  226. package/dist/cli/{env-BAJn6wCA.js → env-DVV10l_r.js} +1 -1
  227. package/dist/cli/{gen-EAUNnUY7.js → gen-BO-2NF-G.js} +14 -14
  228. package/dist/cli/index.d.ts +1 -1
  229. package/dist/cli/index.js +7 -7
  230. package/dist/cli/{init-BRmmmGHJ.js → init-Xit9Hnbb.js} +9 -9
  231. package/dist/cli/{keys-CxajkV_7.js → keys-DJTN2Avl.js} +1 -1
  232. package/dist/cli/{live-CV9mn-xC.js → live-CuMpyRjF.js} +2 -2
  233. package/dist/cli/{mcp-CnaxcLWa.js → mcp-C7d4j5cq.js} +4 -4
  234. package/dist/cli/{metadata-CFQGBR5E.js → metadata-D2YvkY2D.js} +3 -3
  235. package/dist/cli/{migrate-z5oHDGNs.js → migrate-BCXxyTKt.js} +2 -2
  236. package/dist/cli/{migration-safety-BtAPMEZa.js → migration-safety-DfwTOBQ4.js} +1 -1
  237. package/dist/cli/{migrations-CNa62JSi.js → migrations-nomh4TBo.js} +2 -2
  238. package/dist/cli/{module-migration-CKJ8kRm1.js → module-migration--9T_T-zt.js} +2 -2
  239. package/dist/cli/{moved-BAFPdJz_.js → moved-CT6i1csY.js} +1 -1
  240. package/dist/cli/{parse-BueItuNJ.js → parse-qgJylE_A.js} +1 -1
  241. package/dist/cli/{powersync-BgoAWeRT.js → powersync-DB9WZsIv.js} +4 -4
  242. package/dist/cli/powersync-IBM_v_eJ.js +1 -0
  243. package/dist/cli/{print-CoqKHoy0.js → print-S6IF5rZm.js} +2 -2
  244. package/dist/cli/{providers-CfbFxUOQ.js → providers-BDTcal71.js} +1 -1
  245. package/dist/cli/{prune-workflows-BigCoXLw.js → prune-workflows-Zr2DjByi.js} +3 -3
  246. package/dist/cli/{remove-C9zwn-Kk.js → remove-CPX5Tg5s.js} +6 -6
  247. package/dist/cli/{render-DQCU_kBW.js → render-Bp7a7XQ9.js} +18 -4
  248. package/dist/cli/{run-DOD00FFl.js → run-BclCFEyP.js} +13 -41
  249. package/dist/cli/{run-dY9uOC3W.js → run-BlVaLnt_.js} +2 -2
  250. package/dist/cli/{run-CVaBuT18.js → run-kgG50x_Z.js} +44 -43
  251. package/dist/cli/{seed-BpaqqyO8.js → seed-Cn2R91cd.js} +2 -2
  252. package/dist/cli/seed-DGGjReq4.js +1 -0
  253. package/dist/cli/{shared-COtj7l3r.js → shared-D60W9NS-.js} +1 -1
  254. package/dist/cli/{skills-jZThjL3B.js → skills-DH-yPDny.js} +1 -1
  255. package/dist/cli/{snapshot-BvlEmTB0.js → snapshot-C3_eQUgY.js} +2 -2
  256. package/dist/cli/{source-BhZRCitG.js → source-Bk6XwIAK.js} +1 -1
  257. package/dist/cli/{spec-Bo2wIViH.js → spec-BDTpcBns.js} +1 -1
  258. package/dist/cli/{spec-DsMWuJLv.js → spec-C8ydQwZC.js} +3 -3
  259. package/dist/cli/{sql-layout-CA7xgRjR.js → sql-layout-DVQ20UMi.js} +3 -3
  260. package/dist/cli/{stack-147NqctC.js → stack-CmhSfY5V.js} +3 -2
  261. package/dist/cli/{sync-D9xSGdzO.js → sync-D-WO4Yvl.js} +4 -4
  262. package/dist/cli/{table-D9FbJS8h.js → table-k5OABwy3.js} +1 -1
  263. package/dist/cli/{upgrade-Ykf0LLEB.js → upgrade-DGe5Pv6v.js} +5 -5
  264. package/dist/cli/{upgrade-XK_CQKVJ.js → upgrade-XdhMuHAu.js} +3 -3
  265. package/dist/cli/{version-Dfdz7KSh.js → version-DKfeme2I.js} +1 -1
  266. package/dist/client/index.d.ts +6 -6
  267. package/dist/client/index.js +1 -1
  268. package/dist/client/native/index.d.ts +5 -5
  269. package/dist/client/native/index.js +2 -2
  270. package/dist/{client-Bky2z09B.js → client-DrejIxsu.js} +1 -1
  271. package/dist/{cloud-event-DXWmXrus.d.ts → cloud-event-BEmAUdl1.d.ts} +1 -1
  272. package/dist/commerce/index.js +1 -1
  273. package/dist/{compiler-qlXlokKn.d.ts → compiler-BOW4yPcW.d.ts} +2 -2
  274. package/dist/{composite-CIxjVcL1.d.ts → composite-B-oAH16L.d.ts} +7 -7
  275. package/dist/{composite-D2JnIiHt.js → composite-BidYZWZY.js} +3 -3
  276. package/dist/config/index.d.ts +3 -3
  277. package/dist/config/index.js +4 -4
  278. package/dist/{config-Bu6pwqcO.js → config-BKxjItQ-.js} +3 -3
  279. package/dist/{config-MDRA2sre.js → config-BrRlSxhx.js} +1 -1
  280. package/dist/{connectors-Cf2LeAuZ.d.ts → connectors-CrLRW4Ol.d.ts} +4 -4
  281. package/dist/{context-BGC0J3t9.d.ts → context-yfOlyAqb.d.ts} +3 -3
  282. package/dist/contract/index.d.ts +9 -9
  283. package/dist/{controller-CQrkLoRX.d.ts → controller-CAcLEndc.d.ts} +1 -1
  284. package/dist/{conversion-C9rndpEI.d.ts → conversion-s1NtB6S-.d.ts} +1 -1
  285. package/dist/create/index.d.ts +3 -3
  286. package/dist/create/index.js +3 -3
  287. package/dist/create/lite/index.d.ts +4 -4
  288. package/dist/create/lite/index.js +2 -2
  289. package/dist/credentials/index.d.ts +4 -4
  290. package/dist/credentials/index.js +1 -1
  291. package/dist/{cron-route-DSITg1yC.js → cron-route-uTsC2BD0.js} +1 -1
  292. package/dist/{data-engine-CMENsp3d.d.ts → data-engine-CX1oYDZl.d.ts} +1 -1
  293. package/dist/{define-ITQA71fw.d.ts → define-BvkaC3Oh.d.ts} +5 -5
  294. package/dist/{define-B6D55cO0.js → define-Duh2mMYk.js} +1 -1
  295. package/dist/{define-block-COmMkx2x.d.ts → define-block-Ds3aLZwz.d.ts} +12 -12
  296. package/dist/{documents-DeZw83ue.d.ts → documents-Btk0MhC0.d.ts} +3 -3
  297. package/dist/edge/index.d.ts +9 -9
  298. package/dist/edge/index.js +7 -7
  299. package/dist/elysia/index.d.ts +1 -1
  300. package/dist/elysia/index.js +1 -1
  301. package/dist/{embeddings-rVR2AKVz.d.ts → embeddings-CI6P_mtD.d.ts} +1 -1
  302. package/dist/{ended-NC_ZesY4.d.ts → ended-iq2wp8fc.d.ts} +8 -3
  303. package/dist/{entitlements-BOWTZaRf.d.ts → entitlements-Dhu-4vlH.d.ts} +2 -2
  304. package/dist/env/index.d.ts +1 -1
  305. package/dist/{messages-CRk1g6oe.js → errors-0Qid9fGz.js} +107 -3
  306. package/dist/eve/index.d.ts +9 -9
  307. package/dist/eve/index.js +3 -3
  308. package/dist/{eve-DIKjuPp5.d.ts → eve-DleYrhwj.d.ts} +2 -2
  309. package/dist/{event-calendar-DUtFyRrv.d.ts → event-calendar-DPMcqy7Q.d.ts} +1 -1
  310. package/dist/events/index.d.ts +3 -3
  311. package/dist/{events-DVt3Z9hw.d.ts → events-DCw3c6pj.d.ts} +1 -1
  312. package/dist/{executor-DqNRrFxx.d.ts → executor-B-o7QMPp.d.ts} +16 -2
  313. package/dist/{executor-CFmee_nV.d.ts → executor-DoSNec_H.d.ts} +1 -1
  314. package/dist/{executor-CHnoKOxk.d.ts → executor-H8ZLkeHj.d.ts} +4 -4
  315. package/dist/{executor-BDMqPbVU.js → executor-RYiR4z47.js} +71 -37
  316. package/dist/expo/index.d.ts +4 -4
  317. package/dist/expo/index.js +7 -7
  318. package/dist/{field-errors-DxPZYw2m.d.ts → field-errors-DXZk9Qjt.d.ts} +10 -10
  319. package/dist/{fields-CAVk9dxX.d.ts → fields-CP46SPNE.d.ts} +1 -1
  320. package/dist/{filter-evaluate-Bz3Fzhz2.d.ts → filter-evaluate-Bkbb0nuQ.d.ts} +1 -1
  321. package/dist/{filter-query-DV-x8fio.d.ts → filter-query-Xj40B5KT.d.ts} +1 -1
  322. package/dist/{flags-6emyAXly.d.ts → flags-Cuew4tGx.d.ts} +2 -2
  323. package/dist/flags-sdk/index.d.ts +2 -2
  324. package/dist/{framework-BFlaPuvv.d.ts → framework-Byr_j8G-.d.ts} +8 -8
  325. package/dist/{framework-ChzJYkJW.js → framework-z3KTPRjk.js} +4 -4
  326. package/dist/{gateway-DaekJ_Me.d.ts → gateway-B9k89AC4.d.ts} +3 -3
  327. package/dist/h3/index.d.ts +1 -1
  328. package/dist/h3/index.js +1 -1
  329. package/dist/h3/v1/index.d.ts +1 -1
  330. package/dist/h3/v1/index.js +1 -1
  331. package/dist/hono/index.d.ts +9 -10
  332. package/dist/hono/index.js +8 -8
  333. package/dist/{inbox-DavCzW7b.d.ts → inbox-yGfUVQr2.d.ts} +61 -6
  334. package/dist/{index-Dvpu22CJ.d.ts → index-1uV69AZq.d.ts} +1 -1
  335. package/dist/{index-CJB50jzQ.d.ts → index-6H-8Ib1w.d.ts} +6 -6
  336. package/dist/{index-M1izbwbN.d.ts → index-Ag-T51Jl.d.ts} +1 -1
  337. package/dist/{index-DNAkWDXc.d.ts → index-BUluRi0b.d.ts} +6 -6
  338. package/dist/{index-QTZIopQj.d.ts → index-C78VPlXW.d.ts} +1 -1
  339. package/dist/{index-D18su_r5.d.ts → index-CY612vAg.d.ts} +10 -5
  340. package/dist/{index-BfU0KR0X.d.ts → index-CnzGRpeH.d.ts} +5 -5
  341. package/dist/{index-BIAtapnD.d.ts → index-Dbd1E5Au.d.ts} +5 -5
  342. package/dist/{index-Bhkag9ZE.d.ts → index-Dv6lfL5p.d.ts} +14 -14
  343. package/dist/{index-8w4OB5En.d.ts → index-F6lsRlsr.d.ts} +1 -1
  344. package/dist/{index-CeUwyJ3Z.d.ts → index-kkZwp5M1.d.ts} +6 -6
  345. package/dist/{index-Bz0WLuh_.d.ts → index-lMApFSAd.d.ts} +5 -5
  346. package/dist/index.d.ts +7 -7
  347. package/dist/index.js +1 -1
  348. package/dist/{instances-D31jrmKh.js → instances-xQ2lupVE.js} +246 -12
  349. package/dist/jwks-cache-CBKtICNV.js +114 -0
  350. package/dist/{jws-B8p0ppgh.js → jws-De9qjIPV.js} +1 -1
  351. package/dist/{kit-9pZP5iLU.js → kit-D5rRAKWJ.js} +2 -2
  352. package/dist/{kit-OgFOW9rX.d.ts → kit-DCuO1ZhB.d.ts} +4 -4
  353. package/dist/{knowledge-DdZzUTQ-.js → knowledge-CJnZOaix.js} +67 -7
  354. package/dist/{knowledge-BBC2sfAY.d.ts → knowledge-DWXAxvkN.d.ts} +82 -11
  355. package/dist/lint/index.d.ts +1 -1
  356. package/dist/list/index.d.ts +3 -3
  357. package/dist/{list-query-C7V8kUaD.d.ts → list-query-D1h3Dmnk.d.ts} +3 -3
  358. package/dist/mapper/bin.js +5 -5
  359. package/dist/mcp/index.d.ts +3 -3
  360. package/dist/mcp/index.js +5 -5
  361. package/dist/mcp/sdk/index.d.ts +6 -6
  362. package/dist/mcp/sdk/index.js +2 -2
  363. package/dist/{messaging-D5z2TR37.d.ts → messaging-Bfe4p9Pm.d.ts} +4 -4
  364. package/dist/{model-messages-BcrkjsPE.js → model-messages-CIHqP7Z3.js} +1 -1
  365. package/dist/nestjs/index.d.ts +2 -2
  366. package/dist/nestjs/index.js +1 -1
  367. package/dist/next/client/index.d.ts +1 -1
  368. package/dist/next/index.d.ts +331 -79
  369. package/dist/next/index.js +520 -105
  370. package/dist/node/index.d.ts +2 -2
  371. package/dist/node/index.js +1 -1
  372. package/dist/{operations-BG6prEnh.d.ts → operations-SWpzGC_K.d.ts} +1 -1
  373. package/dist/{options-D4dxMGHF.js → options-Bgnm4pTD.js} +1 -0
  374. package/dist/{options-C13-dVMH.js → options-D-jiqb0l.js} +2 -0
  375. package/dist/{options-DjFbIRgV.js → options-DjdxZgHi.js} +2 -1
  376. package/dist/{options-CgMiQGOF.js → options-DqmTs2nv.js} +4 -1
  377. package/dist/{options-C-NFS6e3.js → options-DxgZ8tVc.js} +2 -1
  378. package/dist/{options-CuPWezcV.js → options-RYbyaVhv.js} +3 -1
  379. package/dist/options-SOjQVgfS.js +37 -0
  380. package/dist/{options-JnPEVbBJ.js → options-ScQ6Hnxo.js} +2 -1
  381. package/dist/{options-Sq4bYbf5.js → options-X61tvckX.js} +4 -1
  382. package/dist/orpc/index.d.ts +8 -8
  383. package/dist/orpc/index.js +6 -6
  384. package/dist/otel/index.d.ts +2 -2
  385. package/dist/otel/index.js +4 -4
  386. package/dist/{outbox-7zgh-7nw.d.ts → outbox-BFZS6Kvz.d.ts} +4 -4
  387. package/dist/{permissions-CoHsUtZS.d.ts → permissions-2UlVQDzY.d.ts} +1 -1
  388. package/dist/{pool-D-4HyhuW.d.ts → pool-yO-LzZAd.d.ts} +3 -3
  389. package/dist/{ports-CmEXVqhg.js → ports-CkygVOeE.js} +2 -2
  390. package/dist/{ports-XvgCe7ey.d.ts → ports-prqYrReN.d.ts} +1 -1
  391. package/dist/postgres/index.d.ts +4 -4
  392. package/dist/{postgrest-DZtM2nIS.d.ts → postgrest-Bjain6nf.d.ts} +1 -1
  393. package/dist/powersync/index.d.ts +6 -6
  394. package/dist/preset/index.d.ts +3 -3
  395. package/dist/preset/index.js +3 -3
  396. package/dist/{preset-om2rbdYw.js → preset-BvHNleCo.js} +2 -2
  397. package/dist/{project-B7nqCzn5.js → project-CBvowdKY.js} +5 -5
  398. package/dist/{provider-BI0KC4u5.d.ts → provider-bIAzxVMB.d.ts} +1 -1
  399. package/dist/{push-token-kcc04ZaS.d.ts → push-token-DtqJeg8w.d.ts} +1 -1
  400. package/dist/query/index.d.ts +1 -1
  401. package/dist/{rate-limit-CRhlLFhP.js → rate-limit-BJ4EMdAy.js} +1 -1
  402. package/dist/react/index.d.ts +9 -9
  403. package/dist/react/index.js +3 -3
  404. package/dist/react/native/index.d.ts +1 -1
  405. package/dist/react/native/index.js +1 -1
  406. package/dist/react/server.d.ts +9 -9
  407. package/dist/react/server.js +2 -2
  408. package/dist/react/session.d.ts +2 -32
  409. package/dist/react/session.js +1 -37
  410. package/dist/{react-COIov1yC.js → react-DZ7AW2yf.js} +2 -2
  411. package/dist/react-router/index.d.ts +6 -6
  412. package/dist/react-router/index.js +5 -5
  413. package/dist/realtime/index.d.ts +6 -6
  414. package/dist/{record-form-DU2EoVsv.d.ts → record-form-BQA-lawE.d.ts} +1 -1
  415. package/dist/{recordings-D69Va7gP.d.ts → recordings-Bw5LoocX.d.ts} +1 -1
  416. package/dist/records/index.d.ts +9 -9
  417. package/dist/{refusal-CGi-0Q18.d.ts → refusal-BX1EvmpJ.d.ts} +3 -3
  418. package/dist/{refusal-5c6UMpUP.js → refusal-rnbr6RZD.js} +2 -2
  419. package/dist/{refresh-B8t_KE3s.js → request-kind-tNDM5Z_o.js} +15 -31
  420. package/dist/{resolve--LfVoOMg.d.ts → resolve-BIpQRhvF.d.ts} +97 -36
  421. package/dist/{resolve-FW8oeXvh.js → resolve-CZV31iCm.js} +402 -392
  422. package/dist/{resolved-names-DYYyh35i.js → resolved-names-b6P2--jK.js} +1 -1
  423. package/dist/{resource-BbWk4hoP.js → resource-COaS9_i8.js} +1 -1
  424. package/dist/{resource-DWllVW8k.d.ts → resource-CaYpB07K.d.ts} +1 -1
  425. package/dist/{resource-execute-DUBYKTYU.d.ts → resource-execute-A1NbR-sd.d.ts} +2 -2
  426. package/dist/{resource-types-RgaljPs0.d.ts → resource-types-CTcc37WL.d.ts} +4 -4
  427. package/dist/{resources-Bki1J4jy.d.ts → resources-13ZFX1G6.d.ts} +2 -2
  428. package/dist/{resources-DYSx9NYM.js → resources-DhiK3yLO.js} +1 -1
  429. package/dist/{respond-DLH4tD2d.js → respond-8A3EOo61.js} +1 -1
  430. package/dist/{respond-BYOV7KZp.d.ts → respond-CAxhkwAi.d.ts} +15 -19
  431. package/dist/{sales-lines-DuNVoKHA.d.ts → sales-lines-wQHuL-pa.d.ts} +1 -1
  432. package/dist/{sandboxes-B2hBoBvJ.d.ts → sandboxes-BF9RxxCU.d.ts} +1 -1
  433. package/dist/{scores-FAORS4qU.d.ts → scores-Ce8MxQX9.d.ts} +5 -5
  434. package/dist/server/index.d.ts +58 -36
  435. package/dist/server/index.js +35 -41
  436. package/dist/{server-types-C2hlvhP4.d.ts → server-types-DEjva0MW.d.ts} +19 -17
  437. package/dist/{session-B4VasaAA.d.ts → session-BA0YDmjt.d.ts} +11 -12
  438. package/dist/session-BjPYE4dT.js +180 -0
  439. package/dist/session-CeYL3EPm.d.ts +77 -0
  440. package/dist/{session-status-D8CBxCqv.d.ts → session-status-Df6tuKY9.d.ts} +4 -3
  441. package/dist/{sign-in-CX1a5i2P.d.ts → sign-in-4u4vLtXG.d.ts} +16 -4
  442. package/dist/{sign-in-CxdoTEp5.js → sign-in-djgvab1X.js} +3 -3
  443. package/dist/{sign-in-BMm1xhKq.js → sign-in-k2lXELeC.js} +2 -2
  444. package/dist/{signatures-CBn7w4VR.js → signatures-DK01D2S7.js} +1 -1
  445. package/dist/{signers-6ih6i9aq.d.ts → signers-Dw9DBZjJ.d.ts} +4 -4
  446. package/dist/{signing-keys-De09WNJ3.d.ts → signing-keys-FglIQ6iL.d.ts} +2 -2
  447. package/dist/{signing-keys-BC5_hJN5.js → signing-keys-sGaXklwD.js} +1 -1
  448. package/dist/{snapshot-CVMSyTHH.js → snapshot-BOA7lkRg.js} +9 -17
  449. package/dist/solid/index.d.ts +10 -10
  450. package/dist/solid/index.js +1 -1
  451. package/dist/solid-start/index.d.ts +6 -6
  452. package/dist/solid-start/index.js +5 -5
  453. package/dist/spec/index.d.ts +2 -2
  454. package/dist/sql/index.d.ts +5 -5
  455. package/dist/sql/index.js +3 -3
  456. package/dist/{sql-DdtukoIm.js → sql-BChN3Hxv.js} +7594 -2269
  457. package/dist/sqlite/index.d.ts +3 -3
  458. package/dist/{sso-CuzAjsc8.d.ts → sso-B7w7h8RJ.d.ts} +3 -3
  459. package/dist/ssr/index.d.ts +5 -6
  460. package/dist/ssr/index.js +3 -3
  461. package/dist/storage/index.d.ts +3 -3
  462. package/dist/storage/index.js +1 -1
  463. package/dist/streams/index.d.ts +1 -1
  464. package/dist/{subject-readers-BlD8tALG.d.ts → subject-readers-YL8H9G8X.d.ts} +2 -2
  465. package/dist/{subjects-Bv2dPflD.d.ts → subjects-CVjAE7nz.d.ts} +3 -3
  466. package/dist/{support-DxYI6sDM.d.ts → support-BwtMgjVg.d.ts} +4 -4
  467. package/dist/{support-view-DSmCett7.d.ts → support-view-GykHOIQ2.d.ts} +1 -1
  468. package/dist/svelte/index.d.ts +9 -9
  469. package/dist/svelte/index.js +1 -1
  470. package/dist/sveltekit/index.d.ts +7 -7
  471. package/dist/sveltekit/index.js +5 -5
  472. package/dist/{tags--k2fbPfO.d.ts → tags-CAfvzA1U.d.ts} +1 -1
  473. package/dist/tanstack-db/index.d.ts +3 -3
  474. package/dist/tanstack-start/index.d.ts +6 -6
  475. package/dist/tanstack-start/index.js +5 -5
  476. package/dist/{tenant-DkKbvK5T.d.ts → tenant-lBgoqg9T.d.ts} +1 -1
  477. package/dist/testing/index.d.ts +27 -28
  478. package/dist/testing/index.js +5 -5
  479. package/dist/{timeline-Bq658xsi.d.ts → timeline-CrO48Qa6.d.ts} +5 -5
  480. package/dist/{topic-B6zuexk7.d.ts → topic-x-mrN_Ff.d.ts} +5 -5
  481. package/dist/{types-C8UyJOPJ.d.ts → types-6PMaLIyw.d.ts} +3 -3
  482. package/dist/{types-Dh2OGEW5.d.ts → types-BdhE7I8Z.d.ts} +5 -5
  483. package/dist/{types-BkYEUWdz.d.ts → types-BzIYSSWK.d.ts} +16 -1
  484. package/dist/{types-DCoqai8o.d.ts → types-C7K8mu9B.d.ts} +45 -15
  485. package/dist/{types-d0JBRTAg.d.ts → types-C9XfFGmA.d.ts} +128 -13
  486. package/dist/{types-BvHw2cCS.d.ts → types-CJqNGQKb.d.ts} +2 -2
  487. package/dist/{types-TH3zlMiM.d.ts → types-D5uf0l4_.d.ts} +1 -1
  488. package/dist/{types-BBqP9H6w.d.ts → types-auvHrNWC.d.ts} +4 -4
  489. package/dist/{undo-22ofP6Zp.d.ts → undo-CdKp5_2X.d.ts} +2 -2
  490. package/dist/{usage-CNCT6_3D.d.ts → usage-DZ8j5Tm_.d.ts} +4 -4
  491. package/dist/{vault-yGQD5Rdl.d.ts → vault-DjbG4XQS.d.ts} +2 -2
  492. package/dist/vercel-connect/index.d.ts +1 -1
  493. package/dist/vercel-sandbox/index.d.ts +2 -2
  494. package/dist/{verify-DY_j4GPZ.js → verify-96j8d5ps.js} +1 -1
  495. package/dist/{verify-BQu3eBNW.d.ts → verify-HOiu3lRR.d.ts} +2 -2
  496. package/dist/{view-BfEqjZJ_.js → view-Ch0Qtr36.js} +1 -1
  497. package/dist/{view-Cy2XxYp1.d.ts → view-DdDY88SC.d.ts} +1 -1
  498. package/dist/vue/index.d.ts +10 -10
  499. package/dist/vue/index.js +1 -1
  500. package/dist/{watch-topic-YYSVJGDY.d.ts → watch-topic-D6bcqOrJ.d.ts} +1 -1
  501. package/dist/workflow-sdk/builder/index.d.ts +29 -5
  502. package/dist/workflow-sdk/builder/index.js +39 -12
  503. package/dist/workflow-sdk/index.d.ts +1 -1
  504. package/dist/workflow-sdk/index.js +2 -2
  505. package/dist/workflow-sdk/world/index.d.ts +1 -1
  506. package/dist/workflow-sdk/world/index.js +1 -1
  507. package/dist/{workflow-sdk-BL3wzkdp.js → workflow-sdk-CBS8L2Ku.js} +5 -0
  508. package/dist/{workflow-sdk-yIkECybp.d.ts → workflow-sdk-D3H10W5h.d.ts} +3 -3
  509. package/dist/{workflows-BljkWRxE.d.ts → workflows-BI4yKqFh.d.ts} +3 -3
  510. package/dist/yjs/index.d.ts +2 -2
  511. package/dist/yjs/index.js +1 -1
  512. package/package.json +1 -1
  513. package/schemas/config-v1.json +162 -0
  514. package/schemas/doctor-report-v1.json +4 -0
  515. package/skills/better-supabase-auth/SKILL.md +45 -11
  516. package/dist/cli/add-C13ZqJ_N.js +0 -1
  517. package/dist/cli/env-UN6PJFX6.js +0 -1
  518. package/dist/cli/powersync-DoCruiOt.js +0 -1
  519. package/dist/cli/seed-ByLneY1H.js +0 -1
  520. package/dist/errors-D3-4c-XF.js +0 -102
  521. package/dist/http-BDC1IvBX.js +0 -27
  522. package/dist/jwks-cache-IZaiICAV.js +0 -48
  523. package/dist/options-Itq7QYoW.js +0 -20
  524. package/dist/refresh-BtbC2rZe.d.ts +0 -52
  525. package/dist/snapshot-BGsJw9xn.d.ts +0 -83
@@ -1,102 +0,0 @@
1
- import { n as dbError, r as dbErrorOf } from "./errors-B7tCfCvX.js";
2
- import { n as isRecord } from "./guards-CsRa6v57.js";
3
- // src/ai-sdk/errors.ts
4
- const INVALID_INPUT = /* @__PURE__ */ new Set([
5
- "AI_InvalidArgumentError",
6
- "AI_InvalidPromptError",
7
- "AI_InvalidDataContentError",
8
- "AI_MessageConversionError",
9
- "AI_TooManyEmbeddingValuesForCallError"
10
- ]);
11
- const PROVIDER_CONFIG = /* @__PURE__ */ new Set(["AI_LoadAPIKeyError", "AI_LoadSettingError"]);
12
- const GENERATION_FAILED = /* @__PURE__ */ new Set([
13
- "AI_NoObjectGeneratedError",
14
- "AI_NoContentGeneratedError",
15
- "AI_NoOutputGeneratedError",
16
- "AI_NoImageGeneratedError",
17
- "AI_NoSpeechGeneratedError",
18
- "AI_NoTranscriptGeneratedError",
19
- "AI_NoVideoGeneratedError",
20
- "AI_NoSuchToolError",
21
- "AI_InvalidToolInputError",
22
- "AI_ToolCallRepairError",
23
- "AI_JSONParseError",
24
- "AI_InvalidResponseDataError",
25
- "AI_EmptyResponseBodyError",
26
- "AI_UIMessageStreamError"
27
- ]);
28
- const numberOf = (value) => typeof value === "number" && Number.isFinite(value) ? value : void 0;
29
- function retryAfterOf(error) {
30
- const headers = error["responseHeaders"];
31
- if (!isRecord(headers)) return;
32
- const value = headers["retry-after"] ?? headers["Retry-After"];
33
- const seconds = typeof value === "string" ? Number(value) : NaN;
34
- return Number.isFinite(seconds) && seconds >= 0 ? Math.ceil(seconds) : void 0;
35
- }
36
- function ofStatus(status, error) {
37
- if (status === 429) {
38
- const retryAfter = retryAfterOf(error);
39
- return dbError("rate_limited", "The model provider is rate limiting.", {
40
- code: "AI_PROVIDER_RATE_LIMITED",
41
- ...retryAfter === void 0 ? {} : { retryAfter }
42
- });
43
- }
44
- if (status === 408 || status === 504) return dbError("timeout", "The model provider timed out.", { code: "AI_PROVIDER_TIMEOUT" });
45
- if (status === 400 || status === 413 || status === 422) return dbError("invalid_request", "The model provider refused the request.", { code: "AI_PROVIDER_BAD_REQUEST" });
46
- if (status === 404) return dbError("not_found", "The model provider has no such resource.", { code: "AI_PROVIDER_NOT_FOUND" });
47
- if (status === 401 || status === 403) return dbError("unexpected", "The model provider refused the credentials.", { code: "AI_PROVIDER_AUTH" });
48
- if (status !== void 0 && status >= 500) return dbError("network", "The model provider is unavailable.", { code: "AI_PROVIDER_UNAVAILABLE" });
49
- return dbError("unexpected", "The model provider call failed.", { code: "AI_PROVIDER_FAILED" });
50
- }
51
- function ofGateway(type, error) {
52
- switch (type) {
53
- case "rate_limit_exceeded": return ofStatus(429, error);
54
- case "timeout": return ofStatus(504, error);
55
- case "invalid_request_error": return ofStatus(400, error);
56
- case "model_not_found": return dbError("not_found", "The AI Gateway has no such model.", { code: "AI_MODEL_NOT_FOUND" });
57
- case "not_found": return ofStatus(404, error);
58
- case "forbidden": return dbError("forbidden", "The AI Gateway refused the request.", { code: "AI_GATEWAY_FORBIDDEN" });
59
- case "authentication_error": return dbError("unexpected", "The AI Gateway refused the credentials.", { code: "AI_GATEWAY_AUTH" });
60
- case "failed_dependency":
61
- case "internal_server_error": return ofStatus(503, error);
62
- default: return ofStatus(numberOf(error["statusCode"]), error);
63
- }
64
- }
65
- /**
66
- * An AI SDK or AI Gateway error as a `DbError`, so a route answers with the
67
- * same Problem Details as the rest of the app. Errors are matched by `name`
68
- * (and `type` for the gateway), so a second copy of `ai` still matches. The
69
- * message is fixed per kind; the provider's own message never reaches it, since
70
- * it can quote the prompt or a key.
71
- */
72
- function aiErrorToDbError(error) {
73
- const known = dbErrorOf(error);
74
- if (known !== void 0) return known;
75
- if (!isRecord(error)) return dbError("unexpected", "The generation failed.", { code: "AI_GENERATION_FAILED" });
76
- const name = typeof error["name"] === "string" ? error["name"] : "";
77
- if (name === "AbortError" || name === "TimeoutError") return name === "AbortError" ? dbError("aborted", "The generation was stopped.", { code: "AI_ABORTED" }) : ofStatus(504, error);
78
- if (name === "AI_RetryError") {
79
- const last = error["lastError"];
80
- return last === void 0 || last === error ? ofStatus(void 0, error) : aiErrorToDbError(last);
81
- }
82
- if (name === "AI_APICallError") return ofStatus(numberOf(error["statusCode"]), error);
83
- if (name.startsWith("Gateway") && typeof error["type"] === "string") return ofGateway(error["type"], error);
84
- if (name === "AI_TypeValidationError") return dbError("validation", "The value did not match its schema.", {
85
- code: "AI_TYPE_VALIDATION",
86
- issues: [{ message: "The value did not match its schema." }]
87
- });
88
- if (name === "AI_NoSuchModelError" || name === "AI_NoSuchProviderError") return dbError("not_found", "The model is not available.", { code: "AI_MODEL_NOT_FOUND" });
89
- if (name === "AI_UnsupportedFunctionalityError") return dbError("unsupported", "The model does not support this.", { code: "AI_UNSUPPORTED" });
90
- if (name === "AI_DownloadError") return dbError("network", "A file could not be downloaded.", { code: "AI_DOWNLOAD_FAILED" });
91
- if (INVALID_INPUT.has(name)) return dbError("invalid_request", "The request to the model is invalid.", { code: "AI_INVALID_REQUEST" });
92
- if (PROVIDER_CONFIG.has(name)) return dbError("unexpected", "The model provider is not configured.", { code: "AI_PROVIDER_CONFIG" });
93
- return dbError("unexpected", "The generation failed.", { code: GENERATION_FAILED.has(name) ? "AI_GENERATION_FAILED" : "AI_UNEXPECTED" });
94
- }
95
- /**
96
- * The message a client sees for a stream error: the fixed message of
97
- * `aiErrorToDbError`. The default `onError` of `createAssistant`.
98
- */
99
- function aiErrorMessage(error) {
100
- return aiErrorToDbError(error).message;
101
- }
102
- export { aiErrorToDbError as n, aiErrorMessage as t };
@@ -1,27 +0,0 @@
1
- import { n as dbError } from "./errors-B7tCfCvX.js";
2
- import { o as problemResponse } from "./problem-C0SVHhd3.js";
3
- import { UI_MESSAGE_STREAM_HEADERS } from "ai";
4
- // src/ai-sdk/http.ts
5
- /** A 400 problem response for a malformed chat request. */
6
- function badRequest(message) {
7
- return problemResponse(dbError("invalid_request", message, { code: "AI_CHAT_BAD_REQUEST" }));
8
- }
9
- /** The JSON body of a request, or `undefined` when it is not JSON. */
10
- async function readJson(request) {
11
- try {
12
- return await request.json();
13
- } catch {
14
- return;
15
- }
16
- }
17
- /**
18
- * A UI message stream as a response, with extra headers such as the workflow
19
- * run id.
20
- */
21
- function sse(stream, headers = {}) {
22
- return new Response(stream.pipeThrough(new TextEncoderStream()), { headers: {
23
- ...UI_MESSAGE_STREAM_HEADERS,
24
- ...headers
25
- } });
26
- }
27
- export { readJson as n, sse as r, badRequest as t };
@@ -1,48 +0,0 @@
1
- import { n as dbError } from "./errors-B7tCfCvX.js";
2
- import { a as ok, r as err } from "./result-8xza7w5W.js";
3
- import { a as jwksOf } from "./jws-B8p0ppgh.js";
4
- // src/core/jwks-cache.ts
5
- /** The most bytes read from a JWKS response. */
6
- const MAX_JWKS_BYTES = 262144;
7
- /**
8
- * A cached key set. A URL is fetched on first use and again after
9
- * `cacheSeconds`; a refresh for an unknown `kid` refetches at most once per
10
- * `refetchSeconds`, so a stream of forged `kid`s can't hammer the issuer.
11
- * Concurrent callers share one fetch.
12
- */
13
- function jwksSource(input, options = {}) {
14
- const parse = (value) => jwksOf(value, options.rsa === void 0 ? {} : { rsa: options.rsa });
15
- if (!(input instanceof URL) && typeof input !== "function") {
16
- const keys = parse(input);
17
- return () => Promise.resolve(ok(keys));
18
- }
19
- const now = options.now ?? Date.now;
20
- const cacheMs = (options.cacheSeconds ?? 300) * 1e3;
21
- const refetchMs = (options.refetchSeconds ?? 30) * 1e3;
22
- let cached;
23
- let pending;
24
- const load = async () => {
25
- if (typeof input === "function") return ok(parse(await input()));
26
- const response = await (options.fetch ?? fetch)(input, { headers: { accept: "application/jwk-set+json, application/json" } });
27
- if (!response.ok) return err(dbError("network", `The JWKS answered ${response.status}`, { code: "JWKS_FETCH_FAILED" }));
28
- const text = await response.text();
29
- if (text.length > MAX_JWKS_BYTES) return err(dbError("network", "The JWKS response is too large", { code: "JWKS_FETCH_FAILED" }));
30
- return ok(parse(JSON.parse(text)));
31
- };
32
- return async (refresh) => {
33
- const age = cached ? now() - cached.at : Number.POSITIVE_INFINITY;
34
- if (cached && age < (refresh ? refetchMs : cacheMs)) return ok(cached.keys);
35
- pending ??= load().catch((cause) => err(dbError("network", `The JWKS could not be loaded: ${cause instanceof Error ? cause.message : String(cause)}`, { code: "JWKS_FETCH_FAILED" }))).then((result) => {
36
- if (result.ok) cached = {
37
- keys: result.data,
38
- at: now()
39
- };
40
- return result;
41
- }).finally(() => {
42
- pending = void 0;
43
- });
44
- const result = await pending;
45
- return !result.ok && cached ? ok(cached.keys) : result;
46
- };
47
- }
48
- export { jwksSource as t };
@@ -1,20 +0,0 @@
1
- import { n as blockOptions, r as option } from "./options-Z-bd_H1E.js";
2
- // src/blocks/ai-chat/options.ts
3
- const aiChatSqlOptions = blockOptions({
4
- topic: option.string({
5
- default: "ai-chat",
6
- client: true
7
- }),
8
- listTopic: option.string({
9
- default: "ai-chats",
10
- client: true
11
- }),
12
- temporaryTtl: option.unknown(),
13
- staleAfter: option.unknown(),
14
- sandboxIdleAfter: option.number({ default: 600 }),
15
- meterUsage: option.boolean({ default: true }),
16
- inputMeter: option.string({ default: "ai.input_tokens" }),
17
- outputMeter: option.string({ default: "ai.output_tokens" }),
18
- extraColumns: option.extraColumns()
19
- });
20
- export { aiChatSqlOptions as t };
@@ -1,52 +0,0 @@
1
- import { v as StoredSession } from "./resolve--LfVoOMg.js";
2
- interface RefreshOptions {
3
- readonly url: string;
4
- readonly publishableKey: string;
5
- /**
6
- * Sends `Sb-Forwarded-For: ip` with the secret key, so Auth rate-limits the
7
- * refresh by the user's IP (when IP forwarding is on for the project).
8
- */
9
- readonly forwardedFor?: {
10
- readonly ip: string;
11
- readonly secretKey: string;
12
- };
13
- readonly fetch?: typeof fetch;
14
- /**
15
- * Milliseconds before a refresh counts as a network failure (the session is
16
- * kept). 5000 by default.
17
- */
18
- readonly timeoutMs?: number;
19
- /** Epoch milliseconds, the unit JWT `exp` and `iat` math needs. */
20
- readonly now?: () => number;
21
- }
22
- type RefreshOutcome = {
23
- readonly ok: true;
24
- readonly session: StoredSession;
25
- /** Served from a concurrent or just-finished refresh of the same token. */
26
- readonly shared?: boolean;
27
- } | {
28
- readonly ok: false;
29
- /**
30
- * `rejected`: the refresh token is dead, sign the user out. `raced`:
31
- * another request already rotated it (`refresh_token_already_used`) and
32
- * its response carries the new cookies, so keep them. `network`: keep the
33
- * session and retry later.
34
- */
35
- readonly reason: "rejected" | "raced" | "network";
36
- /** For `network`: the fetch failed, timed out, or Auth answered 5xx or 429. */
37
- readonly cause?: "fetch" | "timeout" | "status";
38
- readonly status?: number;
39
- /**
40
- * The Auth server's `error_code`, such as `user_banned` or
41
- * `refresh_token_not_found`.
42
- */
43
- readonly code?: string;
44
- readonly message: string;
45
- };
46
- /**
47
- * Exchanges a refresh token for a new session. Concurrent calls with the same
48
- * token share one request, and a successful result is reused for a short window
49
- * so parallel requests carrying the old cookie converge on one session.
50
- */
51
- declare function refreshSession(refreshToken: string, options: RefreshOptions): Promise<RefreshOutcome>;
52
- export { RefreshOutcome as n, refreshSession as r, RefreshOptions as t };
@@ -1,83 +0,0 @@
1
- import { r as AuthState } from "./resolve--LfVoOMg.js";
2
- import { JWTClaims } from "@supabase/server";
3
- /**
4
- * A verified user session, frozen and serializable. Times are epoch seconds,
5
- * like `AuthSession.expiresAt`, because the snapshot crosses `use cache`
6
- * serialization (ADR 0095).
7
- */
8
- interface SessionSnapshot<C = unknown> {
9
- readonly accessToken: string;
10
- readonly claims: Readonly<JWTClaims & C>;
11
- /** The Auth session id (`session_id`), or `null` for tokens without one. */
12
- readonly sessionId: string | null;
13
- readonly userId: string;
14
- /** Seconds since epoch, from `exp`. */
15
- readonly expiresAt: number | null;
16
- /** Seconds since epoch, from `iat`. */
17
- readonly issuedAt: number | null;
18
- /** The `authz_ver` claim, or `null` when the token has none. */
19
- readonly authzVersion: number | null;
20
- }
21
- /** Verified JWT claims, read by name. */
22
- type Claims = Readonly<Record<string, unknown>>;
23
- /** The `iat` claim in epoch seconds, or `null`. */
24
- declare function issuedAtOf(claims: Claims): number | null;
25
- /** The `authz_ver` claim as a number, or `null` when absent or malformed. */
26
- declare function authzVersionOf(claims: Claims): number | null;
27
- /**
28
- * Whether `value` is a snapshot this process built from a verified token. A
29
- * snapshot that crossed serialization, or was built by hand, is not.
30
- */
31
- declare function isSessionSnapshot(value: unknown): value is SessionSnapshot;
32
- /** The snapshot of a verified user, or `null` for any other caller. */
33
- declare function snapshotOf<C, P>(auth: AuthState<C, P>): SessionSnapshot<C> | null;
34
- /**
35
- * A stable cache key for a session: user, Auth session and authorization
36
- * version. It never contains the token, which rotates hourly and would churn
37
- * every key.
38
- */
39
- declare function sessionCacheKey(snapshot: Pick<SessionSnapshot, "userId" | "sessionId" | "authzVersion">): string;
40
- interface SessionMemoOptions {
41
- /** The most sessions kept; the least recently used goes first. Default: 1000. */
42
- readonly max?: number;
43
- /**
44
- * Milliseconds an entry lives at most. It never outlives the token's `exp`.
45
- * Default: 300000 (5 minutes).
46
- */
47
- readonly ttlMs?: number;
48
- /** Epoch milliseconds. */
49
- readonly now?: () => number;
50
- }
51
- interface SessionMemoStats {
52
- /** Lookups answered by a stored or in-flight verification. */
53
- readonly hits: number;
54
- /** Lookups that ran a verification. */
55
- readonly misses: number;
56
- readonly size: number;
57
- }
58
- /**
59
- * Verified sessions by a SHA-256 of the access token. Every `use cache` scope
60
- * of a request resolves the same token; the first one verifies it and the
61
- * others await the same promise.
62
- */
63
- interface SessionMemo<T> {
64
- /**
65
- * The stored value for `token`, else `load()`'s. A `null` result is not
66
- * stored. Read the clock (call this) only after the request's dynamic APIs
67
- * (`cookies()`) have been awaited.
68
- */
69
- get(token: string, load: () => Promise<T | null>): Promise<T | null>;
70
- /** Stores a value verified elsewhere (a refresh, a sign-in). */
71
- seed(token: string, value: T): Promise<void>;
72
- /** Drops every entry `match` returns true for (a user's sessions). */
73
- evict(match: (value: T) => boolean): void;
74
- clear(): void;
75
- stats(): SessionMemoStats;
76
- }
77
- /**
78
- * A bounded LRU of verified sessions. Keys derive only from the token, never
79
- * from a user id or a header, so one instance can serve many users at once
80
- * (Fluid compute). Create it once at module scope; `createServer` owns one.
81
- */
82
- declare function sessionMemo<T>(expiresAt: (value: T) => number | null, options?: SessionMemoOptions): SessionMemo<T>;
83
- export { authzVersionOf as a, sessionCacheKey as c, SessionSnapshot as i, sessionMemo as l, SessionMemoOptions as n, isSessionSnapshot as o, SessionMemoStats as r, issuedAtOf as s, SessionMemo as t, snapshotOf as u };