qarpeo 0.4.13 → 0.4.14

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 (299) hide show
  1. package/README.md +12 -6
  2. package/dist/apps/cms.d.ts +1 -1
  3. package/dist/apps/comments.d.ts +1 -1
  4. package/dist/apps/payments.d.ts +1 -1
  5. package/dist/apps/store.d.ts +1 -1
  6. package/dist/chunks/{manifest.get.mjs → tools.mjs} +445 -430
  7. package/dist/cli/index.mjs +756 -746
  8. package/dist/core/aliases.d.ts +1 -1
  9. package/dist/core/context.d.ts +1 -1
  10. package/dist/core/d1-migrate.d.ts +1 -1
  11. package/dist/core/devtools.d.ts +1 -1
  12. package/dist/core/nitro.d.ts +1 -1
  13. package/dist/core/schema.d.ts +1 -1
  14. package/dist/core/server-utils.d.ts +1 -1
  15. package/dist/core/wrangler.d.ts +1 -1
  16. package/dist/fate/index.d.ts +8 -8
  17. package/dist/fate/index.mjs +3 -1
  18. package/dist/features/agents.d.ts +1 -1
  19. package/dist/features/auth.d.ts +1 -1
  20. package/dist/features/bots.d.ts +1 -1
  21. package/dist/features/console.d.ts +1 -1
  22. package/dist/features/fate.d.ts +1 -1
  23. package/dist/features/mail.d.ts +1 -1
  24. package/dist/features/mcp.d.ts +1 -1
  25. package/dist/features/multitenant.d.ts +1 -1
  26. package/dist/features/notifications.d.ts +1 -1
  27. package/dist/features/realtime.d.ts +1 -1
  28. package/dist/features/studio.d.ts +4 -0
  29. package/dist/module.d.ts +1 -1
  30. package/dist/module.mjs +5139 -5067
  31. package/dist/primitives/ai.d.ts +1 -1
  32. package/dist/primitives/analytics.d.ts +1 -1
  33. package/dist/primitives/blob.d.ts +1 -1
  34. package/dist/primitives/browser.d.ts +1 -1
  35. package/dist/primitives/cache.d.ts +1 -1
  36. package/dist/primitives/d1.d.ts +1 -1
  37. package/dist/primitives/do.d.ts +1 -1
  38. package/dist/primitives/email.d.ts +1 -1
  39. package/dist/primitives/hyperdrive.d.ts +1 -1
  40. package/dist/primitives/kv.d.ts +1 -1
  41. package/dist/primitives/queue.d.ts +1 -1
  42. package/dist/primitives/ratelimit.d.ts +1 -1
  43. package/dist/primitives/vectorize.d.ts +1 -1
  44. package/dist/primitives/workflows.d.ts +1 -1
  45. package/dist/runtime/ai.mjs +4 -1
  46. package/dist/runtime/app/components/CMSEditor.vue +439 -0
  47. package/dist/runtime/app/components/CMSEditorImageNode.vue +90 -0
  48. package/dist/runtime/app/components/CMSEditorLinkPopover.vue +120 -0
  49. package/dist/runtime/app/components/QDropZone.vue +327 -0
  50. package/dist/runtime/app/components/QImageCropper.vue +658 -0
  51. package/dist/runtime/app/components/QImageStudio.vue +300 -0
  52. package/dist/runtime/app/components/QImg.vue +7 -4
  53. package/dist/runtime/app/composables/analytics.d.ts +8 -8
  54. package/dist/runtime/app/composables/api-tokens.d.ts +5 -5
  55. package/dist/runtime/app/composables/auth.d.ts +23 -19
  56. package/dist/runtime/app/composables/chat.d.ts +7 -6
  57. package/dist/runtime/app/composables/cms-preview.d.ts +7 -8
  58. package/dist/runtime/app/composables/cms.d.ts +6 -6
  59. package/dist/runtime/app/composables/comments.d.ts +5 -5
  60. package/dist/runtime/app/composables/comments.mjs +7 -4
  61. package/dist/runtime/app/composables/console.d.ts +6 -14
  62. package/dist/runtime/app/composables/docs-version.d.ts +8 -8
  63. package/dist/runtime/app/composables/impersonation.d.ts +5 -5
  64. package/dist/runtime/app/composables/organization.d.ts +5 -5
  65. package/dist/runtime/app/composables/passkey.d.ts +5 -5
  66. package/dist/runtime/app/composables/passwordless.d.ts +5 -5
  67. package/dist/runtime/app/composables/payments.d.ts +5 -5
  68. package/dist/runtime/app/composables/rbac.d.ts +5 -5
  69. package/dist/runtime/app/composables/site.d.ts +2 -2
  70. package/dist/runtime/app/composables/sse.d.ts +20 -33
  71. package/dist/runtime/app/composables/sse.mjs +6 -3
  72. package/dist/runtime/app/composables/storage.d.ts +6 -8
  73. package/dist/runtime/app/composables/store.d.ts +37 -36
  74. package/dist/runtime/app/composables/store.mjs +7 -6
  75. package/dist/runtime/app/composables/studio.d.ts +59 -0
  76. package/dist/runtime/app/composables/studio.mjs +129 -0
  77. package/dist/runtime/app/composables/tenant.d.ts +7 -7
  78. package/dist/runtime/app/composables/turnstile.d.ts +5 -5
  79. package/dist/runtime/app/composables/two-factor.d.ts +5 -5
  80. package/dist/runtime/app/pages/devtools/notifications.vue +1 -6
  81. package/dist/runtime/app/plugins/pwa.mjs +1 -3
  82. package/dist/runtime/app/utils/cms-editor.d.ts +25 -0
  83. package/dist/runtime/app/utils/cms-editor.mjs +43 -0
  84. package/dist/runtime/auth.d.ts +9 -9
  85. package/dist/runtime/blob.d.ts +1 -3
  86. package/dist/runtime/blob.mjs +3 -1
  87. package/dist/runtime/cache.d.ts +8 -6
  88. package/dist/runtime/cache.mjs +8 -11
  89. package/dist/runtime/db.d.ts +4 -3
  90. package/dist/runtime/drizzle.d.ts +2 -1
  91. package/dist/runtime/drizzle.mjs +2 -2
  92. package/dist/runtime/queue.d.ts +1 -0
  93. package/dist/runtime/replica.d.ts +6 -10
  94. package/dist/runtime/replica.mjs +3 -1
  95. package/dist/runtime/schema-mysql.d.ts +16 -32
  96. package/dist/runtime/schema-pg.d.ts +15 -31
  97. package/dist/runtime/schema-shared.d.ts +20 -17
  98. package/dist/runtime/schema.d.ts +21 -33
  99. package/dist/runtime/server/durable-objects/agent.mjs +4 -1
  100. package/dist/runtime/server/durable-objects/room.d.ts +4 -6
  101. package/dist/runtime/server/durable-objects/room.mjs +18 -8
  102. package/dist/runtime/server/plugins/comments.d.ts +2 -3
  103. package/dist/runtime/server/plugins/email-inbound.d.ts +1 -3
  104. package/dist/runtime/server/plugins/store.d.ts +2 -3
  105. package/dist/runtime/server/routes/__qarpeo/cloud/agents/run.post.d.ts +2 -2
  106. package/dist/runtime/server/routes/__qarpeo/cloud/cms/entry.get.mjs +10 -2
  107. package/dist/runtime/server/routes/__qarpeo/cloud/cms/entry.post.d.ts +2 -2
  108. package/dist/runtime/server/routes/__qarpeo/cloud/cms/entry.post.mjs +10 -2
  109. package/dist/runtime/server/routes/__qarpeo/cloud/cms.get.d.ts +2 -2
  110. package/dist/runtime/server/routes/__qarpeo/cloud/cms.get.mjs +7 -1
  111. package/dist/runtime/server/routes/__qarpeo/cloud/comments/moderate.post.d.ts +2 -2
  112. package/dist/runtime/server/routes/__qarpeo/cloud/comments/moderate.post.mjs +5 -1
  113. package/dist/runtime/server/routes/__qarpeo/cloud/comments.get.d.ts +1 -3
  114. package/dist/runtime/server/routes/__qarpeo/cloud/extras.get.d.ts +2 -2
  115. package/dist/runtime/server/routes/__qarpeo/cloud/extras.get.mjs +15 -4
  116. package/dist/runtime/server/routes/__qarpeo/cloud/mail/unsuppress.post.d.ts +2 -2
  117. package/dist/runtime/server/routes/__qarpeo/cloud/migrate/cms.post.mjs +13 -4
  118. package/dist/runtime/server/routes/__qarpeo/cloud/migrate/products.post.mjs +1 -1
  119. package/dist/runtime/server/routes/__qarpeo/cloud/migrate.post.d.ts +3 -3
  120. package/dist/runtime/server/routes/__qarpeo/cloud/migrate.post.mjs +22 -6
  121. package/dist/runtime/server/routes/__qarpeo/cloud/notifications/test.post.d.ts +2 -2
  122. package/dist/runtime/server/routes/__qarpeo/cloud/operations.get.d.ts +6 -5
  123. package/dist/runtime/server/routes/__qarpeo/cloud/store/order-status.post.d.ts +1 -3
  124. package/dist/runtime/server/routes/__qarpeo/cloud/store/order-status.post.mjs +14 -2
  125. package/dist/runtime/server/routes/__qarpeo/cloud/store/orders.get.d.ts +1 -3
  126. package/dist/runtime/server/routes/__qarpeo/cloud/store/orders.get.mjs +7 -1
  127. package/dist/runtime/server/routes/__qarpeo/cloud/store/products.get.d.ts +1 -3
  128. package/dist/runtime/server/routes/__qarpeo/cloud/tasks/run.post.d.ts +2 -2
  129. package/dist/runtime/server/routes/__qarpeo/cloud/users/action.post.d.ts +2 -2
  130. package/dist/runtime/server/routes/__qarpeo/cloud/users/action.post.mjs +5 -1
  131. package/dist/runtime/server/routes/__qarpeo/cloud/users.get.d.ts +6 -5
  132. package/dist/runtime/server/routes/__qarpeo/cloud/users.get.mjs +1 -3
  133. package/dist/runtime/server/routes/__qarpeo/mail/track/click/[id].get.mjs +2 -2
  134. package/dist/runtime/server/routes/__qarpeo/manifest.get.d.ts +2 -2
  135. package/dist/runtime/server/routes/__qarpeo/og.get.d.ts +2 -2
  136. package/dist/runtime/server/routes/__qarpeo/rbac/me.get.d.ts +2 -2
  137. package/dist/runtime/server/routes/__qarpeo/rbac/roles.delete.d.ts +2 -2
  138. package/dist/runtime/server/routes/__qarpeo/rbac/roles.delete.mjs +5 -1
  139. package/dist/runtime/server/routes/__qarpeo/rbac/roles.get.d.ts +2 -2
  140. package/dist/runtime/server/routes/__qarpeo/rbac/roles.get.mjs +1 -5
  141. package/dist/runtime/server/routes/__qarpeo/rbac/roles.post.d.ts +2 -2
  142. package/dist/runtime/server/routes/__qarpeo/rbac/roles.post.mjs +5 -1
  143. package/dist/runtime/server/routes/__qarpeo/rbac/users.post.d.ts +2 -2
  144. package/dist/runtime/server/routes/agents/[agent]/chat.post.mjs +1 -6
  145. package/dist/runtime/server/routes/agents/[agent]/clear.post.mjs +1 -6
  146. package/dist/runtime/server/routes/agents/[agent]/history.get.mjs +1 -6
  147. package/dist/runtime/server/routes/auth/2fa/disable.post.mjs +5 -1
  148. package/dist/runtime/server/routes/auth/2fa/verify.post.mjs +7 -1
  149. package/dist/runtime/server/routes/auth/magic-link/send.post.mjs +1 -1
  150. package/dist/runtime/server/routes/auth/otp/send.post.mjs +1 -1
  151. package/dist/runtime/server/routes/cms/search.get.mjs +2 -6
  152. package/dist/runtime/server/routes/comments/[id]/report.post.mjs +1 -4
  153. package/dist/runtime/server/routes/comments/[id].patch.mjs +1 -4
  154. package/dist/runtime/server/routes/comments/batch.post.mjs +1 -3
  155. package/dist/runtime/server/routes/comments/index.post.mjs +1 -5
  156. package/dist/runtime/server/routes/fate.mjs +1 -1
  157. package/dist/runtime/server/routes/mail/webhooks.post.mjs +1 -1
  158. package/dist/runtime/server/routes/sitemap.xml.get.mjs +2 -1
  159. package/dist/runtime/server/routes/storage/presigned-r2.post.d.ts +5 -6
  160. package/dist/runtime/server/routes/storage/presigned-r2.post.mjs +1 -1
  161. package/dist/runtime/server/routes/store/cart/items/[id].delete.mjs +1 -1
  162. package/dist/runtime/server/routes/store/cart/items/[id].patch.mjs +1 -1
  163. package/dist/runtime/server/routes/store/currencies.get.mjs +1 -4
  164. package/dist/runtime/server/routes/store/orders/[id].get.mjs +1 -1
  165. package/dist/runtime/server/routes/store/orders/download/[token].get.mjs +13 -4
  166. package/dist/runtime/server/routes/store/orders/index.get.mjs +1 -1
  167. package/dist/runtime/server/routes/store/tax/calculate.post.d.ts +2 -1
  168. package/dist/runtime/server/routes/store/tax/calculate.post.mjs +12 -3
  169. package/dist/runtime/server/routes/tenants/[tenant]/domains/[domain]/index.delete.mjs +4 -1
  170. package/dist/runtime/server/routes/tenants/[tenant]/domains/[domain]/verify.post.mjs +4 -1
  171. package/dist/runtime/server/utils/ai.d.ts +38 -35
  172. package/dist/runtime/server/utils/ai.mjs +7 -11
  173. package/dist/runtime/server/utils/analytics-query.d.ts +4 -4
  174. package/dist/runtime/server/utils/auth.d.ts +25 -25
  175. package/dist/runtime/server/utils/auth.mjs +22 -8
  176. package/dist/runtime/server/utils/bots.d.ts +7 -7
  177. package/dist/runtime/server/utils/browser-utils.d.ts +26 -27
  178. package/dist/runtime/server/utils/cache.d.ts +20 -20
  179. package/dist/runtime/server/utils/cms/collections.mjs +1 -6
  180. package/dist/runtime/server/utils/cms/common.mjs +1 -0
  181. package/dist/runtime/server/utils/cms/markdown.d.ts +2 -2
  182. package/dist/runtime/server/utils/cms/markdown.mjs +5 -5
  183. package/dist/runtime/server/utils/cms/mutations.mjs +8 -23
  184. package/dist/runtime/server/utils/cms/navigation.mjs +4 -4
  185. package/dist/runtime/server/utils/cms/path.d.ts +1 -0
  186. package/dist/runtime/server/utils/cms/path.mjs +8 -2
  187. package/dist/runtime/server/utils/cms/references.mjs +1 -7
  188. package/dist/runtime/server/utils/cms/search.d.ts +2 -2
  189. package/dist/runtime/server/utils/cms/sync.mjs +4 -2
  190. package/dist/runtime/server/utils/cms/taxonomy.d.ts +2 -2
  191. package/dist/runtime/server/utils/cms.d.ts +1 -1
  192. package/dist/runtime/server/utils/cms.mjs +1 -5
  193. package/dist/runtime/server/utils/comments-filter.d.ts +9 -7
  194. package/dist/runtime/server/utils/comments.d.ts +68 -55
  195. package/dist/runtime/server/utils/comments.mjs +21 -9
  196. package/dist/runtime/server/utils/config.d.ts +2 -2
  197. package/dist/runtime/server/utils/console.d.ts +3 -5
  198. package/dist/runtime/server/utils/context.d.ts +10 -10
  199. package/dist/runtime/server/utils/crypto.d.ts +20 -20
  200. package/dist/runtime/server/utils/domains.mjs +3 -1
  201. package/dist/runtime/server/utils/drizzle.d.ts +24 -25
  202. package/dist/runtime/server/utils/drizzle.mjs +17 -17
  203. package/dist/runtime/server/utils/durable-object.d.ts +27 -25
  204. package/dist/runtime/server/utils/durable-object.mjs +3 -10
  205. package/dist/runtime/server/utils/email-inbound.d.ts +10 -10
  206. package/dist/runtime/server/utils/impersonation.d.ts +18 -18
  207. package/dist/runtime/server/utils/legacy-hash.d.ts +23 -27
  208. package/dist/runtime/server/utils/lock.d.ts +20 -23
  209. package/dist/runtime/server/utils/mail.d.ts +19 -19
  210. package/dist/runtime/server/utils/mail.mjs +4 -2
  211. package/dist/runtime/server/utils/mcp.d.ts +20 -20
  212. package/dist/runtime/server/utils/mcp.mjs +22 -38
  213. package/dist/runtime/server/utils/notifications.d.ts +49 -38
  214. package/dist/runtime/server/utils/oauth.d.ts +3 -9
  215. package/dist/runtime/server/utils/organization.d.ts +28 -28
  216. package/dist/runtime/server/utils/organization.mjs +15 -5
  217. package/dist/runtime/server/utils/passwordless.d.ts +24 -24
  218. package/dist/runtime/server/utils/payments/checkout.d.ts +12 -12
  219. package/dist/runtime/server/utils/payments/checkout.mjs +1 -3
  220. package/dist/runtime/server/utils/payments/common.d.ts +3 -3
  221. package/dist/runtime/server/utils/payments/paddle.d.ts +4 -1
  222. package/dist/runtime/server/utils/payments/polar.d.ts +4 -1
  223. package/dist/runtime/server/utils/payments/stripe.mjs +5 -7
  224. package/dist/runtime/server/utils/payments/subscriptions.d.ts +14 -14
  225. package/dist/runtime/server/utils/payments/subscriptions.mjs +2 -6
  226. package/dist/runtime/server/utils/payments/usage.mjs +1 -3
  227. package/dist/runtime/server/utils/payments/webhooks.mjs +2 -2
  228. package/dist/runtime/server/utils/queue.d.ts +54 -58
  229. package/dist/runtime/server/utils/queue.mjs +2 -6
  230. package/dist/runtime/server/utils/rag.d.ts +23 -23
  231. package/dist/runtime/server/utils/rag.mjs +10 -5
  232. package/dist/runtime/server/utils/ratelimit.d.ts +21 -18
  233. package/dist/runtime/server/utils/rbac.d.ts +13 -15
  234. package/dist/runtime/server/utils/rbac.mjs +44 -10
  235. package/dist/runtime/server/utils/realtime.d.ts +53 -52
  236. package/dist/runtime/server/utils/role-env.d.ts +5 -4
  237. package/dist/runtime/server/utils/scheduled-task.d.ts +14 -15
  238. package/dist/runtime/server/utils/session.d.ts +40 -40
  239. package/dist/runtime/server/utils/sse.d.ts +23 -33
  240. package/dist/runtime/server/utils/sse.mjs +5 -14
  241. package/dist/runtime/server/utils/sso.mjs +3 -1
  242. package/dist/runtime/server/utils/storage.d.ts +20 -22
  243. package/dist/runtime/server/utils/storage.mjs +2 -2
  244. package/dist/runtime/server/utils/store/cart.d.ts +5 -3
  245. package/dist/runtime/server/utils/store/cart.mjs +14 -10
  246. package/dist/runtime/server/utils/store/checkout.mjs +4 -1
  247. package/dist/runtime/server/utils/store/common.d.ts +1 -1
  248. package/dist/runtime/server/utils/store/common.mjs +36 -12
  249. package/dist/runtime/server/utils/store/inventory.mjs +3 -1
  250. package/dist/runtime/server/utils/store/orders.mjs +32 -24
  251. package/dist/runtime/server/utils/store-localization.d.ts +9 -27
  252. package/dist/runtime/server/utils/store-localization.mjs +3 -3
  253. package/dist/runtime/server/utils/table-names.d.ts +15 -15
  254. package/dist/runtime/server/utils/table-names.mjs +1 -1
  255. package/dist/runtime/server/utils/tenant.d.ts +12 -12
  256. package/dist/runtime/server/utils/tenant.mjs +7 -4
  257. package/dist/runtime/server/utils/totp.d.ts +18 -18
  258. package/dist/runtime/server/utils/tracker.d.ts +5 -5
  259. package/dist/runtime/server/utils/turnstile.d.ts +9 -9
  260. package/dist/runtime/server/utils/urn.d.ts +5 -8
  261. package/dist/runtime/server/utils/workflows.d.ts +30 -31
  262. package/dist/runtime/server/utils/workflows.mjs +2 -4
  263. package/dist/runtime/server.d.ts +2 -2
  264. package/dist/runtime/service.d.ts +10 -10
  265. package/dist/runtime/test-utils.d.ts +10 -10
  266. package/dist/runtime/test-utils.mjs +9 -2
  267. package/dist/runtime/types/ai.d.ts +14 -14
  268. package/dist/runtime/types/d1.d.ts +6 -11
  269. package/dist/runtime/types/durable-object.d.ts +4 -8
  270. package/dist/runtime/types/email.d.ts +3 -9
  271. package/dist/runtime/types/index.d.ts +15 -21
  272. package/dist/runtime/types/r2.d.ts +5 -5
  273. package/dist/runtime/types/workflows.d.ts +5 -6
  274. package/dist/runtime/workflows.d.ts +1 -3
  275. package/dist/types/ai.d.ts +10 -17
  276. package/dist/types/auth.d.ts +5 -3
  277. package/dist/types/cache.d.ts +7 -7
  278. package/dist/types/cms.d.ts +30 -5
  279. package/dist/types/comments.d.ts +23 -21
  280. package/dist/types/console.d.ts +1 -3
  281. package/dist/types/db.d.ts +7 -7
  282. package/dist/types/index.d.ts +1 -0
  283. package/dist/types/options.d.ts +36 -24
  284. package/dist/types/site.d.ts +8 -2
  285. package/dist/types/storage.d.ts +2 -1
  286. package/dist/types/store-options.d.ts +10 -26
  287. package/dist/types/studio.d.ts +79 -0
  288. package/dist/utils/bots.d.ts +7 -3
  289. package/dist/utils/cms-table-names.d.ts +1 -1
  290. package/dist/utils/drizzle.d.ts +13 -14
  291. package/dist/utils/email-inbound.d.ts +4 -4
  292. package/dist/utils/features.d.ts +19 -5
  293. package/dist/utils/mcp.d.ts +1 -0
  294. package/dist/utils/migration-lock.d.ts +15 -29
  295. package/dist/utils/pkg.d.ts +6 -7
  296. package/dist/utils/schema-diff.d.ts +7 -11
  297. package/dist/utils/store-schema.d.ts +4 -6
  298. package/dist/utils/tools.d.ts +3 -3
  299. package/package.json +55 -5
@@ -12,20 +12,20 @@ export interface TurnstileVerificationResult {
12
12
  * NUXT_TURNSTILE_SECRET_KEY, TURNSTILE_SECRET_KEY, or qarpeo.auth.turnstile.secretKey.
13
13
  *
14
14
  * @example
15
- * ```ts
16
- * const result = await verifyTurnstileToken(event, token)
17
- * if (!result.success) {
18
- * // verification failed
19
- * }
20
- * ```
15
+ * ```ts
16
+ * const result = await verifyTurnstileToken(event, token)
17
+ * if (!result.success) {
18
+ * // verification failed
19
+ * }
20
+ * ```
21
21
  */
22
22
  export declare function verifyTurnstileToken(event: RequestEvent, token?: string, remoteIp?: string): Promise<TurnstileVerificationResult>;
23
23
  /**
24
24
  * Enforces Cloudflare Turnstile verification. Throws 403 Forbidden if invalid.
25
25
  *
26
26
  * @example
27
- * ```ts
28
- * await requireTurnstile(event)
29
- * ```
27
+ * ```ts
28
+ * await requireTurnstile(event)
29
+ * ```
30
30
  */
31
31
  export declare function requireTurnstile(event: RequestEvent, token?: string): Promise<void>;
@@ -1,15 +1,12 @@
1
1
  /**
2
- * Returns true if the given string is a valid, safe targetUrn.
3
- * Does NOT throw — callers decide how to surface the error.
2
+ * Returns true if the given string is a valid, safe targetUrn. Does NOT throw — callers decide how
3
+ * to surface the error.
4
4
  */
5
5
  export declare function isValidTargetUrn(urn: string): boolean;
6
6
  /**
7
- * Validates that a targetUrn is a safe, structured identifier.
8
- * Throws an HTTP 400 createError if invalid.
7
+ * Validates that a targetUrn is a safe, structured identifier. Throws an HTTP 400 createError if
8
+ * invalid.
9
9
  */
10
10
  export declare function validateTargetUrn(urn: string): void;
11
- /**
12
- * Throws a plain Error if the targetUrn is invalid.
13
- * Convenient in test or non-HTTP contexts.
14
- */
11
+ /** Throws a plain Error if the targetUrn is invalid. Convenient in test or non-HTTP contexts. */
15
12
  export declare function assertValidTargetUrn(urn: string): void;
@@ -20,6 +20,7 @@ export declare function setWorkflowFastForward(enabled: boolean): void;
20
20
  * Parses human-readable duration strings into milliseconds.
21
21
  *
22
22
  * Supported formats:
23
+ *
23
24
  * - `"500ms"`
24
25
  * - `"5s"`, `"5 sec"`, `"5 seconds"`
25
26
  * - `"2m"`, `"2 min"`, `"2 minutes"`
@@ -33,32 +34,32 @@ export interface StepEngineOptions {
33
34
  fastForward?: boolean;
34
35
  }
35
36
  /**
36
- * Creates a durable `WorkflowStep` execution engine.
37
- * Records step executions and caches values to support replay semantics.
37
+ * Creates a durable `WorkflowStep` execution engine. Records step executions and caches values to
38
+ * support replay semantics.
38
39
  */
39
40
  export declare function createStepEngine(options: StepEngineOptions): WorkflowStep;
40
41
  /**
41
42
  * Defines a durable Cloudflare Workflow with step replay, sleep, and automatic retries.
42
43
  *
43
44
  * @example
44
- * ```ts [server/workflows/onboarding.ts]
45
- * export default defineWorkflow({
45
+ * ```ts [server/workflows/onboarding.ts]
46
+ * export default defineWorkflow({
46
47
  * name: "onboarding",
47
48
  * async run(event, step) {
48
- * const user = await step.do("create-user", async () => {
49
- * return await createUser(event.payload.email)
50
- * })
49
+ * const user = await step.do("create-user", async () => {
50
+ * return await createUser(event.payload.email)
51
+ * })
51
52
  *
52
- * await step.sleep("wait-for-email", "1 day")
53
+ * await step.sleep("wait-for-email", "1 day")
53
54
  *
54
- * await step.do("send-survey", {
55
- * retries: { limit: 3, delay: "5 seconds", backoff: "exponential" }
56
- * }, async () => {
57
- * await sendSurveyEmail(user.id)
58
- * })
55
+ * await step.do("send-survey", {
56
+ * retries: { limit: 3, delay: "5 seconds", backoff: "exponential" }
57
+ * }, async () => {
58
+ * await sendSurveyEmail(user.id)
59
+ * })
59
60
  * }
60
- * })
61
- * ```
61
+ * })
62
+ * ```
62
63
  */
63
64
  export declare function defineWorkflow<TParams = any, TOutput = any>(defOrRun: WorkflowDefinition<TParams, TOutput> | ((event: WorkflowEvent<TParams>, step: WorkflowStep) => Promise<TOutput> | TOutput)): WorkflowDefinition<TParams, TOutput>;
64
65
  /** Returns the raw Cloudflare Workflow binding from the active environment. */
@@ -66,27 +67,25 @@ export declare function getWorkflowBinding(bindingName: string, event?: CFEvent)
66
67
  /**
67
68
  * Resolves a typed `WorkflowClient` to trigger, query, pause, resume, or restart a workflow.
68
69
  *
69
- * @param name Workflow name or Cloudflare binding name
70
- * @param event Optional CFEvent context
71
- *
72
70
  * @example
73
- * ```ts
74
- * const onboarding = useWorkflow("onboarding")
71
+ * ```ts
72
+ * const onboarding = useWorkflow("onboarding")
73
+ *
74
+ * // Trigger an instance
75
+ * const instance = await onboarding.create({
76
+ * id: "user-123-welcome",
77
+ * params: { email: "user@example.com" },
78
+ * })
75
79
  *
76
- * // Trigger an instance
77
- * const instance = await onboarding.create({
78
- * id: "user-123-welcome",
79
- * params: { email: "user@example.com" }
80
- * })
80
+ * // Check status
81
+ * const status = await onboarding.status(instance.id)
82
+ * ```
81
83
  *
82
- * // Check status
83
- * const status = await onboarding.status(instance.id)
84
- * ```
84
+ * @param name Workflow name or Cloudflare binding name
85
+ * @param event Optional CFEvent context
85
86
  */
86
87
  export declare function useWorkflow<TParams = any, TOutput = any>(name: string, event?: CFEvent): WorkflowClient<TParams, TOutput>;
87
- /**
88
- * Creates a `WorkflowClient` for a workflow name or binding.
89
- */
88
+ /** Creates a `WorkflowClient` for a workflow name or binding. */
90
89
  export declare function createWorkflowClient<TParams = any, TOutput = any>(name: string, event?: CFEvent): WorkflowClient<TParams, TOutput>;
91
90
  /** Clear all stored workflow instances and registry definitions (for test teardown). */
92
91
  export declare function clearWorkflowRegistry(): void;
@@ -83,9 +83,7 @@ export function createStepEngine(options) {
83
83
  new Promise(
84
84
  (_, reject) => setTimeout(
85
85
  () => reject(
86
- new Error(
87
- `[qarpeo:workflows] Step "${name}" timed out after ${timeoutMs}ms`
88
- )
86
+ new Error(`[qarpeo:workflows] Step "${name}" timed out after ${timeoutMs}ms`)
89
87
  ),
90
88
  timeoutMs
91
89
  )
@@ -105,7 +103,7 @@ export function createStepEngine(options) {
105
103
  if (backoff === "linear") {
106
104
  delayMs = initialDelay * attempt;
107
105
  } else if (backoff === "exponential") {
108
- delayMs = initialDelay * Math.pow(2, attempt - 1);
106
+ delayMs = initialDelay * 2 ** (attempt - 1);
109
107
  }
110
108
  if (!isFastForward && delayMs > 0) {
111
109
  await new Promise((resolve) => setTimeout(resolve, delayMs));
@@ -16,8 +16,8 @@
16
16
  * })
17
17
  * ```
18
18
  *
19
- * NOTE: test-utils are intentionally NOT exported here to keep production bundles lean.
20
- * Import from "qarpeo/test-utils" explicitly in test files only.
19
+ * NOTE: test-utils are intentionally NOT exported here to keep production bundles lean. Import from
20
+ * "qarpeo/test-utils" explicitly in test files only.
21
21
  */
22
22
  export * from "./types/index";
23
23
  export * from "./bindings";
@@ -13,19 +13,19 @@ export declare function getServiceBinding(serviceName: string, event?: CFEvent):
13
13
  * HTTP-style fetch/JSON requests and Cloudflare Workers RPC direct method calls.
14
14
  *
15
15
  * @example
16
- * ```ts
17
- * interface AuthService {
18
- * verifyToken(token: string): Promise<{ userId: string }>
19
- * }
16
+ * ```ts
17
+ * interface AuthService {
18
+ * verifyToken(token: string): Promise<{ userId: string }>
19
+ * }
20
20
  *
21
- * const auth = useServiceBinding<AuthService>("AUTH_SERVICE")
21
+ * const auth = useServiceBinding<AuthService>("AUTH_SERVICE")
22
22
  *
23
- * // RPC style (zero HTTP serialization overhead)
24
- * const user = await auth.rpc.verifyToken("jwt-xyz")
23
+ * // RPC style (zero HTTP serialization overhead)
24
+ * const user = await auth.rpc.verifyToken("jwt-xyz")
25
25
  *
26
- * // HTTP style
27
- * const profile = await auth.get("/api/profile", { userId: user.userId })
28
- * ```
26
+ * // HTTP style
27
+ * const profile = await auth.get("/api/profile", { userId: user.userId })
28
+ * ```
29
29
  */
30
30
  export declare function createServiceClient<TRpc = Record<string, any>>(serviceName: string, event?: CFEvent): QarpeoServiceClient<TRpc>;
31
31
  /**
@@ -168,18 +168,18 @@ export declare function createMockQueue<T = any>(queueName?: string): MockQueue<
168
168
  * mock bindings onto `getCloudflareEnv()`.
169
169
  *
170
170
  * @example
171
- * ```ts
172
- * import { createEdgeTestContext } from "qarpeo/test-utils"
171
+ * ```ts
172
+ * import { createEdgeTestContext } from "qarpeo/test-utils"
173
173
  *
174
- * describe("My Edge Route", () => {
175
- * const edge = createEdgeTestContext()
176
- * afterEach(() => edge.cleanup())
174
+ * describe("My Edge Route", () => {
175
+ * const edge = createEdgeTestContext()
176
+ * afterEach(() => edge.cleanup())
177
177
  *
178
- * it("interacts with D1 and KV", async () => {
179
- * await edge.kv.put("user:1", { name: "Alice" })
180
- * expect(await edge.kv.get("user:1", "json")).toEqual({ name: "Alice" })
178
+ * it("interacts with D1 and KV", async () => {
179
+ * await edge.kv.put("user:1", { name: "Alice" })
180
+ * expect(await edge.kv.get("user:1", "json")).toEqual({ name: "Alice" })
181
+ * })
181
182
  * })
182
- * })
183
- * ```
183
+ * ```
184
184
  */
185
185
  export declare function createEdgeTestContext(options?: EdgeTestContextOptions): EdgeTestContext;
@@ -127,7 +127,11 @@ export function createMockD1Database() {
127
127
  async all() {
128
128
  sessionQueries.push(query);
129
129
  queries.push(query);
130
- return { results: [], success: true, meta: { duration: 1, served_by: "d1-replica-session-mock" } };
130
+ return {
131
+ results: [],
132
+ success: true,
133
+ meta: { duration: 1, served_by: "d1-replica-session-mock" }
134
+ };
131
135
  },
132
136
  async run() {
133
137
  sessionQueries.push(query);
@@ -238,7 +242,10 @@ export function createMockR2Bucket() {
238
242
  customMetadata: item.customMetadata || {},
239
243
  uploaded: item.uploaded || /* @__PURE__ */ new Date(),
240
244
  async arrayBuffer() {
241
- return item.data?.buffer ? item.data.buffer.slice(item.data.byteOffset, item.data.byteOffset + item.data.byteLength) : new ArrayBuffer(0);
245
+ return item.data?.buffer ? item.data.buffer.slice(
246
+ item.data.byteOffset,
247
+ item.data.byteOffset + item.data.byteLength
248
+ ) : new ArrayBuffer(0);
242
249
  },
243
250
  async text() {
244
251
  return new TextDecoder().decode(item.data || new Uint8Array(0));
@@ -59,22 +59,22 @@ export interface QarpeoAI {
59
59
  /** Generate complete text from a prompt or chat messages. */
60
60
  generateText(options: StreamTextOptions): Promise<string>;
61
61
  /**
62
- * Generate a structured object from a prompt using Cloudflare Workers AI
63
- * constrained JSON schema decoding and validation.
62
+ * Generate a structured object from a prompt using Cloudflare Workers AI constrained JSON schema
63
+ * decoding and validation.
64
64
  *
65
65
  * @example
66
- * ```ts
67
- * import { z } from "zod"
68
- * const user = await ai.generateObject({
69
- * prompt: "Extract: Jane Doe, 32, likes reading and tennis",
70
- * schema: z.object({
71
- * name: z.string(),
72
- * age: z.number(),
73
- * hobbies: z.array(z.string()),
74
- * }),
75
- * })
76
- * console.log(user.object.name) // "Jane Doe"
77
- * ```
66
+ * ```ts
67
+ * import { z } from "zod"
68
+ * const user = await ai.generateObject({
69
+ * prompt: "Extract: Jane Doe, 32, likes reading and tennis",
70
+ * schema: z.object({
71
+ * name: z.string(),
72
+ * age: z.number(),
73
+ * hobbies: z.array(z.string()),
74
+ * }),
75
+ * })
76
+ * console.log(user.object.name) // "Jane Doe"
77
+ * ```
78
78
  */
79
79
  generateObject<T = any>(options: GenerateObjectOptions<T>): Promise<GenerateObjectResult<T>>;
80
80
  /** Stream text generation as a Server-Sent Events response. */
@@ -45,7 +45,8 @@ export interface D1Database {
45
45
  /**
46
46
  * Creates a session for read replication consistency and routing.
47
47
  *
48
- * @param bookmark Optional bookmark token or routing constraint ("first-unconstrained" | "first-primary")
48
+ * @param bookmark Optional bookmark token or routing constraint ("first-unconstrained" |
49
+ * "first-primary")
49
50
  */
50
51
  withSession?(bookmark?: string): D1DatabaseSession;
51
52
  }
@@ -63,24 +64,18 @@ export interface QarpeoDB extends D1Database {
63
64
  export interface D1ReplicaOptions {
64
65
  /**
65
66
  * Route reads to Cloudflare D1 Read Replicas:
67
+ *
66
68
  * - `true`: routes to nearest replica using "first-unconstrained" session
67
69
  * - `"first-unconstrained"`: reads from nearest replica immediately
68
70
  * - `"first-primary"`: first query routed to primary, subsequent reads routed to replica
69
71
  * - `string`: bookmark token string to guarantee sequential consistency
70
72
  */
71
73
  replica?: boolean | "first-unconstrained" | "first-primary" | string;
72
- /**
73
- * Cloudflare D1 session bookmark token.
74
- */
74
+ /** Cloudflare D1 session bookmark token. */
75
75
  bookmark?: string;
76
- /**
77
- * Automatically fallback to primary database if replica read fails.
78
- * Default: `true`.
79
- */
76
+ /** Automatically fallback to primary database if replica read fails. Default: `true`. */
80
77
  fallbackToPrimary?: boolean;
81
- /**
82
- * Optional Cloudflare event context.
83
- */
78
+ /** Optional Cloudflare event context. */
84
79
  event?: CFEvent;
85
80
  }
86
81
  export interface D1DatabaseOptions extends D1ReplicaOptions {
@@ -43,9 +43,7 @@ export interface SqlStorage {
43
43
  readonly databaseSize: number;
44
44
  }
45
45
  export interface DurableObjectStorage {
46
- /**
47
- * Zero-latency embedded SQLite database interface directly inside this Durable Object isolate.
48
- */
46
+ /** Zero-latency embedded SQLite database interface directly inside this Durable Object isolate. */
49
47
  readonly sql: SqlStorage;
50
48
  get<T = unknown>(key: string): Promise<T | undefined>;
51
49
  get<T = unknown>(keys: string[]): Promise<Map<string, T>>;
@@ -78,9 +76,7 @@ export interface DurableObjectState {
78
76
  getWebSocketAutoResponse?(): unknown;
79
77
  getWebSocketAutoResponseTimestamp?(ws: WebSocket): Date | null;
80
78
  }
81
- /**
82
- * Execution context provided to object-literal Durable Object methods via `this`.
83
- */
79
+ /** Execution context provided to object-literal Durable Object methods via `this`. */
84
80
  export interface DurableObjectContext {
85
81
  readonly state: DurableObjectState;
86
82
  readonly storage: DurableObjectStorage;
@@ -92,8 +88,8 @@ export interface DurableObjectContext {
92
88
  blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
93
89
  }
94
90
  /**
95
- * Modern typed RPC Stub for a Durable Object.
96
- * Any method defined on the Durable Object can be directly called as an asynchronous RPC call.
91
+ * Modern typed RPC Stub for a Durable Object. Any method defined on the Durable Object can be
92
+ * directly called as an asynchronous RPC call.
97
93
  */
98
94
  export type DurableObjectRPCStub<T = any> = DurableObjectStub & {
99
95
  [K in keyof T]: T[K] extends (...args: infer P) => infer R ? (...args: P) => Promise<Awaited<R>> : T[K];
@@ -64,9 +64,7 @@ export interface QarpeoEmail {
64
64
  /** Access the raw underlying Cloudflare `send_email` binding. */
65
65
  raw(bindingName?: string): SendEmailBinding;
66
66
  }
67
- /**
68
- * Inbound email message received by Cloudflare Email Workers.
69
- */
67
+ /** Inbound email message received by Cloudflare Email Workers. */
70
68
  export interface InboundEmailMessage {
71
69
  /** The envelope sender address. */
72
70
  from: string;
@@ -89,9 +87,7 @@ export interface InboundEmailMessage {
89
87
  /** Helper to parse a JSON body if the incoming email contains structured JSON. */
90
88
  json<T = any>(): Promise<T>;
91
89
  }
92
- /**
93
- * Context object passed to defineEmailHandler.
94
- */
90
+ /** Context object passed to defineEmailHandler. */
95
91
  export interface InboundEmailContext {
96
92
  /** The inbound email message. */
97
93
  message: InboundEmailMessage;
@@ -106,7 +102,5 @@ export interface InboundEmailContext {
106
102
  /** Cloudflare worker execution context (e.g. waitUntil). */
107
103
  context?: any;
108
104
  }
109
- /**
110
- * Handler function for incoming Cloudflare emails.
111
- */
105
+ /** Handler function for incoming Cloudflare emails. */
112
106
  export type InboundEmailHandler = (event: InboundEmailContext) => Promise<void> | void;
@@ -147,16 +147,16 @@ export interface QarpeoKV {
147
147
  */
148
148
  clear(prefix?: string): Promise<void>;
149
149
  /**
150
- * Create a scoped, typed KV map for managing collections sharing a common prefix (Void `kv.map` compatibility).
151
- * Automatically prefixes keys on write/read and strips prefixes on listing.
150
+ * Create a scoped, typed KV map for managing collections sharing a common prefix (Void `kv.map`
151
+ * compatibility). Automatically prefixes keys on write/read and strips prefixes on listing.
152
152
  *
153
153
  * @example
154
- * ```ts
155
- * const sessions = kv.map<Session>('sessions')
156
- * await sessions.put('abc', { userId: 1 }, { ttl: 3600 })
157
- * const session = await sessions.get('abc')
158
- * await sessions.delete('abc')
159
- * ```
154
+ * ```ts
155
+ * const sessions = kv.map<Session>("sessions")
156
+ * await sessions.put("abc", { userId: 1 }, { ttl: 3600 })
157
+ * const session = await sessions.get("abc")
158
+ * await sessions.delete("abc")
159
+ * ```
160
160
  */
161
161
  map<T = unknown>(prefix: string): QarpeoKVMap<T>;
162
162
  /** Alias for get (Unstorage / NuxtHub compatibility) */
@@ -184,8 +184,8 @@ export interface QarpeoKV {
184
184
  raw(bindingName?: string): KVNamespace;
185
185
  }
186
186
  /**
187
- * Scoped, typed KV map for managing prefixed collections (Void `kv.map` compatibility).
188
- * Keys are automatically prefixed upon write/read and stripped upon listing.
187
+ * Scoped, typed KV map for managing prefixed collections (Void `kv.map` compatibility). Keys are
188
+ * automatically prefixed upon write/read and stripped upon listing.
189
189
  */
190
190
  export interface QarpeoKVMap<T = unknown> {
191
191
  /** The normalized namespace prefix for this map */
@@ -203,21 +203,15 @@ export interface QarpeoKVMap<T = unknown> {
203
203
  /** Alias for `delete` */
204
204
  del(key: string): Promise<boolean>;
205
205
  /**
206
- * List all keys within this map. Prefix is automatically stripped from returned keys.
207
- * Pass `subPrefix` to filter further within this namespace.
206
+ * List all keys within this map. Prefix is automatically stripped from returned keys. Pass
207
+ * `subPrefix` to filter further within this namespace.
208
208
  */
209
209
  keys(subPrefix?: string): Promise<string[]>;
210
- /**
211
- * Paginated list within this map. Returned key names have the map prefix stripped.
212
- */
210
+ /** Paginated list within this map. Returned key names have the map prefix stripped. */
213
211
  list(options?: KVListOptions): Promise<KVNamespaceListResult<unknown>>;
214
- /**
215
- * Clear all keys in this map namespace (or all keys matching an optional subPrefix).
216
- */
212
+ /** Clear all keys in this map namespace (or all keys matching an optional subPrefix). */
217
213
  clear(subPrefix?: string): Promise<void>;
218
- /**
219
- * Get a value together with its metadata in a single round-trip.
220
- */
214
+ /** Get a value together with its metadata in a single round-trip. */
221
215
  getWithMetadata<M = unknown>(key: string, options?: KVGetOptions): Promise<{
222
216
  value: T | null;
223
217
  metadata: M | null;
@@ -123,8 +123,8 @@ export interface QarpeoBlob {
123
123
  delete(pathname: string | string[]): Promise<void>;
124
124
  list(options?: R2ListOptions): Promise<BlobListResult>;
125
125
  /**
126
- * Duplicates an object in R2 without downloading and re-uploading through the client.
127
- * Preserves existing metadata unless overridden.
126
+ * Duplicates an object in R2 without downloading and re-uploading through the client. Preserves
127
+ * existing metadata unless overridden.
128
128
  */
129
129
  copy(sourceKey: string, destinationKey: string, options?: BlobCopyOptions): Promise<R2Object & {
130
130
  pathname: string;
@@ -145,9 +145,9 @@ export interface QarpeoBlob {
145
145
  createMultipartUpload(pathname: string, options?: R2PutOptions): Promise<R2MultipartUpload>;
146
146
  resumeMultipartUpload(pathname: string, uploadId: string): R2MultipartUpload;
147
147
  /**
148
- * Generates a true R2 presigned URL for direct client-to-R2 uploads.
149
- * The client PUTs directly to R2's CDN endpoint — no data passes through the Worker.
150
- * Supports files up to 5 TB (vs the Worker 100 MB proxy limit).
148
+ * Generates a true R2 presigned URL for direct client-to-R2 uploads. The client PUTs directly to
149
+ * R2's CDN endpoint — no data passes through the Worker. Supports files up to 5 TB (vs the Worker
150
+ * 100 MB proxy limit).
151
151
  *
152
152
  * @param pathname Object key / path in R2
153
153
  * @param options.expiresIn Duration string ("15 minutes", "1h") or seconds (default: 900)
@@ -1,6 +1,4 @@
1
- /**
2
- * TypeScript types for Cloudflare Workflows in Qarpeo.
3
- */
1
+ /** TypeScript types for Cloudflare Workflows in Qarpeo. */
4
2
  export type WorkflowBackoff = "constant" | "linear" | "exponential";
5
3
  export interface WorkflowStepRetryConfig {
6
4
  /** Maximum number of retry attempts (default: 3). */
@@ -18,8 +16,8 @@ export interface WorkflowStepConfig {
18
16
  }
19
17
  export interface WorkflowStep {
20
18
  /**
21
- * Execute a durable step. The step's return value is saved to durable storage.
22
- * If the workflow restarts or replays, the cached result is returned without re-running the callback.
19
+ * Execute a durable step. The step's return value is saved to durable storage. If the workflow
20
+ * restarts or replays, the cached result is returned without re-running the callback.
23
21
  */
24
22
  do<T>(name: string, callback: () => Promise<T> | T): Promise<T>;
25
23
  do<T>(name: string, config: WorkflowStepConfig, callback: () => Promise<T> | T): Promise<T>;
@@ -27,7 +25,8 @@ export interface WorkflowStep {
27
25
  * Puts the workflow to sleep for a specified duration without consuming CPU.
28
26
  *
29
27
  * @param name Name of the sleep step for observability and replay
30
- * @param duration Duration string ("5 seconds", "10 minutes", "2 hours", "3 days") or milliseconds
28
+ * @param duration Duration string ("5 seconds", "10 minutes", "2 hours", "3 days") or
29
+ * milliseconds
31
30
  */
32
31
  sleep(name: string, duration: string | number): Promise<void>;
33
32
  /**
@@ -1,5 +1,3 @@
1
- /**
2
- * `qarpeo/workflows` — Re-exports of Cloudflare Workflows definitions and Step Engine.
3
- */
1
+ /** `qarpeo/workflows` — Re-exports of Cloudflare Workflows definitions and Step Engine. */
4
2
  export * from "./types/workflows";
5
3
  export * from "./server/utils/workflows";
@@ -432,33 +432,24 @@ export interface AutoRagSyncR2Result {
432
432
  }
433
433
  export interface AutoRag {
434
434
  /**
435
- * Ingest and index raw text, a document object, or an R2 file into Vectorize with zero manual pipelines.
435
+ * Ingest and index raw text, a document object, or an R2 file into Vectorize with zero manual
436
+ * pipelines.
436
437
  *
437
438
  * Automatically chunks text, computes embeddings via Workers AI GPU, and upserts into Vectorize.
438
439
  */
439
440
  index(input: AutoRagIndexable, options?: AutoRagIndexOptions): Promise<AutoRagIndexResult>;
440
- /**
441
- * Semantic vector search across indexed knowledge using Workers AI embeddings and Vectorize.
442
- */
441
+ /** Semantic vector search across indexed knowledge using Workers AI embeddings and Vectorize. */
443
442
  search(query: string, options?: AutoRagSearchOptions): Promise<AutoRagSearchResult>;
444
- /**
445
- * Directly answer a question using grounded RAG retrieval + LLM synthesis.
446
- */
443
+ /** Directly answer a question using grounded RAG retrieval + LLM synthesis. */
447
444
  answer(query: string, options?: AutoRagAnswerOptions): Promise<AutoRagAnswerResult>;
448
- /**
449
- * Delete a document and all its chunks from the index.
450
- */
445
+ /** Delete a document and all its chunks from the index. */
451
446
  delete(documentId: string, options?: {
452
447
  maxChunks?: number;
453
448
  event?: any;
454
449
  }): Promise<void>;
455
- /**
456
- * Automatically sync and index text/markdown files stored in an R2 bucket into Vectorize.
457
- */
450
+ /** Automatically sync and index text/markdown files stored in an R2 bucket into Vectorize. */
458
451
  syncR2(options?: AutoRagSyncR2Options): Promise<AutoRagSyncR2Result>;
459
- /**
460
- * Expose AutoRAG as a tool for autonomous agents.
461
- */
452
+ /** Expose AutoRAG as a tool for autonomous agents. */
462
453
  asTool(options?: {
463
454
  name?: string;
464
455
  description?: string;
@@ -502,7 +493,8 @@ export interface GenerateObjectOptions<T = any> {
502
493
  /** Optional system prompt to instruct the model. */
503
494
  system?: string;
504
495
  /**
505
- * Zod schema (e.g. `z.object({...})`) or plain JSON Schema defining the expected output structure.
496
+ * Zod schema (e.g. `z.object({...})`) or plain JSON Schema defining the expected output
497
+ * structure.
506
498
  */
507
499
  schema: any;
508
500
  /** Optional name for the JSON schema (default: "response"). */
@@ -525,6 +517,7 @@ export interface GenerateObjectOptions<T = any> {
525
517
  gateway?: AIGatewayOptions;
526
518
  /**
527
519
  * Extraction mode:
520
+ *
528
521
  * - "auto": Uses native JSON schema constrained decoding if supported, with prompt fallback
529
522
  * - "json_schema": Strict Workers AI `response_format: { type: "json_schema", ... }`
530
523
  * - "json_object": Workers AI `response_format: { type: "json_object" }`
@@ -21,11 +21,13 @@ export interface RateLimitConfig {
21
21
  export interface EmailInboundOptions {
22
22
  /**
23
23
  * Whether Cloudflare Inbound Email handling is enabled.
24
+ *
24
25
  * @default true
25
26
  */
26
27
  enabled?: boolean;
27
28
  /**
28
- * Custom directory or file path for email handlers (defaults to auto-discovering server/email.ts, server/email/*.ts).
29
+ * Custom directory or file path for email handlers (defaults to auto-discovering server/email.ts,
30
+ * server/email/*.ts).
29
31
  */
30
32
  dir?: string;
31
33
  }
@@ -52,8 +54,8 @@ export interface EmailOptions {
52
54
  */
53
55
  binding?: string;
54
56
  /**
55
- * Cloudflare Inbound Email configuration.
56
- * When enabled, routes incoming emails to your server/email handler.
57
+ * Cloudflare Inbound Email configuration. When enabled, routes incoming emails to your
58
+ * server/email handler.
57
59
  */
58
60
  inbound?: boolean | EmailInboundOptions;
59
61
  }
@@ -1,19 +1,19 @@
1
1
  export interface CachedFunctionOptions<Args extends any[] = any[]> {
2
2
  /**
3
- * Unique cache key string or key generator function.
4
- * If omitted, defaults to `name` or the function name.
3
+ * Unique cache key string or key generator function. If omitted, defaults to `name` or the
4
+ * function name.
5
5
  */
6
6
  key?: string | ((...args: Args) => string);
7
- /**
8
- * Key prefix or function name. Matches Nitro defineCachedFunction convention.
9
- */
7
+ /** Key prefix or function name. Matches Nitro defineCachedFunction convention. */
10
8
  name?: string;
11
9
  /**
12
- * Custom key generator function based on arguments. Matches Nitro defineCachedFunction convention.
10
+ * Custom key generator function based on arguments. Matches Nitro defineCachedFunction
11
+ * convention.
13
12
  */
14
13
  getKey?: (...args: Args) => string;
15
14
  /**
16
- * Maximum age / TTL duration (e.g. 300, '5m', '1h', '7d'). Matches Nitro defineCachedFunction convention.
15
+ * Maximum age / TTL duration (e.g. 300, '5m', '1h', '7d'). Matches Nitro defineCachedFunction
16
+ * convention.
17
17
  *
18
18
  * @default 3600
19
19
  */