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
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * GET /__qarpeo/rbac/me
3
3
  *
4
- * Returns the current authenticated user's resolved roles, effective role
5
- * permissions, and per-user `allow` / `deny` overrides for client UI checks (`useCan`).
4
+ * Returns the current authenticated user's resolved roles, effective role permissions, and per-user
5
+ * `allow` / `deny` overrides for client UI checks (`useCan`).
6
6
  */
7
7
  declare const _default: import("nuxt/server").EventHandler<Promise<{
8
8
  authenticated: boolean;
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * DELETE /__qarpeo/rbac/roles?id=<roleId>
3
3
  *
4
- * Deletes a custom role or resets an overridden built-in role back to code defaults.
5
- * Requires `roles:manage` (or `super`).
4
+ * Deletes a custom role or resets an overridden built-in role back to code defaults. Requires
5
+ * `roles:manage` (or `super`).
6
6
  */
7
7
  declare const _default: import("nuxt/server").EventHandler<Promise<{
8
8
  reset: boolean;
@@ -5,7 +5,11 @@ export default defineEventHandler(async (event) => {
5
5
  const body = await readBody(event).catch(() => ({}));
6
6
  const roleId = typeof qs?.id === "string" && qs.id.trim() || typeof body?.id === "string" && body.id.trim() || "";
7
7
  if (!roleId) {
8
- throw createError({ statusCode: 400, statusMessage: "Bad Request", message: "role id is required." });
8
+ throw createError({
9
+ statusCode: 400,
10
+ statusMessage: "Bad Request",
11
+ message: "role id is required."
12
+ });
9
13
  }
10
14
  const result = await deleteRole(event, roleId);
11
15
  return { ok: true, id: roleId, ...result };
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * GET /__qarpeo/rbac/roles
3
3
  *
4
- * Lists all built-in + D1-overridden + custom roles and the standard permission catalog.
5
- * Requires `roles:manage` (or `super`).
4
+ * Lists all built-in + D1-overridden + custom roles and the standard permission catalog. Requires
5
+ * `roles:manage` (or `super`).
6
6
  */
7
7
  declare const _default: import("nuxt/server").EventHandler<Promise<{
8
8
  ok: boolean;
@@ -1,9 +1,5 @@
1
1
  import { defineEventHandler } from "nuxt/server";
2
- import {
3
- listRoles,
4
- PERMISSION_CATALOG,
5
- requirePermission
6
- } from "../../../utils/rbac.mjs";
2
+ import { listRoles, PERMISSION_CATALOG, requirePermission } from "../../../utils/rbac.mjs";
7
3
  export default defineEventHandler(async (event) => {
8
4
  await requirePermission(event, "roles:manage");
9
5
  const roles = await listRoles(event);
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * POST /__qarpeo/rbac/roles
3
3
  *
4
- * Creates or updates a role's permissions in D1.
5
- * Requires `roles:manage` (or `super`). `super` itself is immutable.
4
+ * Creates or updates a role's permissions in D1. Requires `roles:manage` (or `super`). `super`
5
+ * itself is immutable.
6
6
  */
7
7
  declare const _default: import("nuxt/server").EventHandler<Promise<{
8
8
  ok: boolean;
@@ -4,7 +4,11 @@ export default defineEventHandler(async (event) => {
4
4
  const body = await readBody(event).catch(() => ({}));
5
5
  const id = typeof body?.id === "string" ? body.id.trim() : "";
6
6
  if (!id) {
7
- throw createError({ statusCode: 400, statusMessage: "Bad Request", message: "role id is required." });
7
+ throw createError({
8
+ statusCode: 400,
9
+ statusMessage: "Bad Request",
10
+ message: "role id is required."
11
+ });
8
12
  }
9
13
  const role = await upsertRole(event, {
10
14
  id,
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * POST /__qarpeo/rbac/users
3
3
  *
4
- * Updates per-user `extraRoles`, `allow`, and `deny` permission overrides in D1.
5
- * Requires `roles:manage` (or `super`).
4
+ * Updates per-user `extraRoles`, `allow`, and `deny` permission overrides in D1. Requires
5
+ * `roles:manage` (or `super`).
6
6
  */
7
7
  declare const _default: import("nuxt/server").EventHandler<Promise<{
8
8
  userId: string;
@@ -1,9 +1,4 @@
1
- import {
2
- defineEventHandler,
3
- getRouterParam,
4
- readBody,
5
- createError
6
- } from "nuxt/server";
1
+ import { defineEventHandler, getRouterParam, readBody, createError } from "nuxt/server";
7
2
  import { useAgent, resolveAgentInstanceId } from "../../../utils/ai.mjs";
8
3
  import { getQarpeoConfig } from "../../../utils/config.mjs";
9
4
  import { getAuthSession } from "../../../utils/session.mjs";
@@ -1,9 +1,4 @@
1
- import {
2
- defineEventHandler,
3
- getRouterParam,
4
- readBody,
5
- createError
6
- } from "nuxt/server";
1
+ import { defineEventHandler, getRouterParam, readBody, createError } from "nuxt/server";
7
2
  import { useAgent, resolveAgentInstanceId } from "../../../utils/ai.mjs";
8
3
  import { getQarpeoConfig } from "../../../utils/config.mjs";
9
4
  import { getAuthSession } from "../../../utils/session.mjs";
@@ -1,9 +1,4 @@
1
- import {
2
- defineEventHandler,
3
- getRouterParam,
4
- getQuery,
5
- createError
6
- } from "nuxt/server";
1
+ import { defineEventHandler, getRouterParam, getQuery, createError } from "nuxt/server";
7
2
  import { useAgent, resolveAgentInstanceId } from "../../../utils/ai.mjs";
8
3
  import { getQarpeoConfig } from "../../../utils/config.mjs";
9
4
  import { getAuthSession } from "../../../utils/session.mjs";
@@ -1,7 +1,11 @@
1
1
  import { defineEventHandler, readBody, createError } from "nuxt/server";
2
2
  import { getD1Binding } from "../../../../db.mjs";
3
3
  import { decryptToken } from "../../../utils/crypto.mjs";
4
- import { requireAuthSession, revokeOtherDeviceSessions, setAuthSession } from "../../../utils/session.mjs";
4
+ import {
5
+ requireAuthSession,
6
+ revokeOtherDeviceSessions,
7
+ setAuthSession
8
+ } from "../../../utils/session.mjs";
5
9
  import { resolveTableName } from "../../../utils/table-names.mjs";
6
10
  import { verifyTOTPCode } from "../../../utils/totp.mjs";
7
11
  export default defineEventHandler(async (event) => {
@@ -87,7 +87,13 @@ export default defineEventHandler(async (event) => {
87
87
  INSERT INTO ${twoFactorTbl} (id, user_id, secret, backup_codes, enabled, created_at)
88
88
  VALUES (?, ?, ?, ?, 1, ?)
89
89
  ON CONFLICT(user_id) DO UPDATE SET secret = excluded.secret, backup_codes = excluded.backup_codes, enabled = 1
90
- `).bind(id, user.id, await encryptToken(secret, event), JSON.stringify(hashedBackupCodes), now).run();
90
+ `).bind(
91
+ id,
92
+ user.id,
93
+ await encryptToken(secret, event),
94
+ JSON.stringify(hashedBackupCodes),
95
+ now
96
+ ).run();
91
97
  try {
92
98
  const kv = getKVBinding("KV", event);
93
99
  await kv.delete(`2fa:setup:${user.id}`);
@@ -1,8 +1,8 @@
1
1
  import { defineEventHandler, readBody, createError } from "nuxt/server";
2
2
  import { getQarpeoConfig } from "../../../utils/config.mjs";
3
3
  import { sendMagicLink } from "../../../utils/passwordless.mjs";
4
- import { requireTurnstile } from "../../../utils/turnstile.mjs";
5
4
  import { assertRateLimit, getClientIp } from "../../../utils/ratelimit.mjs";
5
+ import { requireTurnstile } from "../../../utils/turnstile.mjs";
6
6
  export default defineEventHandler(async (event) => {
7
7
  const body = await readBody(event);
8
8
  const email = body?.email;
@@ -1,8 +1,8 @@
1
1
  import { defineEventHandler, readBody, createError } from "nuxt/server";
2
2
  import { getQarpeoConfig } from "../../../utils/config.mjs";
3
3
  import { sendOTPCode } from "../../../utils/passwordless.mjs";
4
- import { requireTurnstile } from "../../../utils/turnstile.mjs";
5
4
  import { assertRateLimit, getClientIp } from "../../../utils/ratelimit.mjs";
5
+ import { requireTurnstile } from "../../../utils/turnstile.mjs";
6
6
  export default defineEventHandler(async (event) => {
7
7
  const body = await readBody(event);
8
8
  const email = body?.email;
@@ -64,18 +64,14 @@ export default defineEventHandler(async (event) => {
64
64
  try {
65
65
  const ftsQuery = buildFtsQuery(q, "AND");
66
66
  if (ftsQuery) {
67
- const ftsRes = await db.prepare(
68
- `SELECT id FROM ${ftsTbl} WHERE ${ftsTbl} MATCH ? ORDER BY rank LIMIT 100`
69
- ).bind(ftsQuery).all();
67
+ const ftsRes = await db.prepare(`SELECT id FROM ${ftsTbl} WHERE ${ftsTbl} MATCH ? ORDER BY rank LIMIT 100`).bind(ftsQuery).all();
70
68
  const ids = (ftsRes.results || []).map((r) => r.id).filter(Boolean);
71
69
  if (ids.length > 0) {
72
70
  ftsMatchedIds = ids;
73
71
  } else {
74
72
  const ftsOrQuery = buildFtsQuery(q, "OR");
75
73
  if (ftsOrQuery && ftsOrQuery !== ftsQuery) {
76
- const orRes = await db.prepare(
77
- `SELECT id FROM ${ftsTbl} WHERE ${ftsTbl} MATCH ? ORDER BY rank LIMIT 100`
78
- ).bind(ftsOrQuery).all();
74
+ const orRes = await db.prepare(`SELECT id FROM ${ftsTbl} WHERE ${ftsTbl} MATCH ? ORDER BY rank LIMIT 100`).bind(ftsOrQuery).all();
79
75
  const orIds = (orRes.results || []).map((r) => r.id).filter(Boolean);
80
76
  if (orIds.length > 0) {
81
77
  ftsMatchedIds = orIds;
@@ -1,8 +1,5 @@
1
1
  import { createError, defineEventHandler, getRouterParam, readBody } from "nuxt/server";
2
- import {
3
- getComment,
4
- reportComment
5
- } from "../../../utils/comments.mjs";
2
+ import { getComment, reportComment } from "../../../utils/comments.mjs";
6
3
  import { getAuthContext } from "../../../utils/context.mjs";
7
4
  import { assertRateLimit } from "../../../utils/ratelimit.mjs";
8
5
  const ALLOWED_REASONS = [
@@ -1,8 +1,5 @@
1
1
  import { createError, defineEventHandler, getRouterParam, readBody } from "nuxt/server";
2
- import {
3
- getComment,
4
- updateCommentStatus
5
- } from "../../utils/comments.mjs";
2
+ import { getComment, updateCommentStatus } from "../../utils/comments.mjs";
6
3
  import { getAuthContext } from "../../utils/context.mjs";
7
4
  import { getTenant } from "../../utils/tenant.mjs";
8
5
  export default defineEventHandler(async (event) => {
@@ -1,7 +1,5 @@
1
1
  import { createError, defineEventHandler, readBody } from "nuxt/server";
2
- import {
3
- batchModerateComments
4
- } from "../../utils/comments.mjs";
2
+ import { batchModerateComments } from "../../utils/comments.mjs";
5
3
  import { getAuthContext } from "../../utils/context.mjs";
6
4
  const ALLOWED_ACTIONS = ["approve", "spam", "delete"];
7
5
  export default defineEventHandler(async (event) => {
@@ -1,9 +1,5 @@
1
1
  import { createError, defineEventHandler, readBody } from "nuxt/server";
2
- import {
3
- createComment,
4
- validateTargetUrn,
5
- getCommentsConfig
6
- } from "../../utils/comments.mjs";
2
+ import { createComment, validateTargetUrn, getCommentsConfig } from "../../utils/comments.mjs";
7
3
  import { getAuthContext } from "../../utils/context.mjs";
8
4
  import { getTenant } from "../../utils/tenant.mjs";
9
5
  export default defineEventHandler(async (event) => {
@@ -5,8 +5,8 @@ import {
5
5
  createError,
6
6
  useRuntimeConfig
7
7
  } from "nuxt/server";
8
- import { getAuthSession } from "../utils/session.mjs";
9
8
  import { fateViews } from "#qarpeo/fate/views";
9
+ import { getAuthSession } from "../utils/session.mjs";
10
10
  let _fateHandler;
11
11
  async function getFateHandler() {
12
12
  if (_fateHandler) return _fateHandler;
@@ -1,7 +1,6 @@
1
1
  import { createError, defineEventHandler, getQuery, getRequestHeader, readBody } from "nuxt/server";
2
2
  import { getQarpeoConfig } from "../../utils/config.mjs";
3
3
  import { timingSafeEqualString } from "../../utils/crypto.mjs";
4
- import { sanitizeUrl } from "../../utils/string.mjs";
5
4
  import {
6
5
  recordEmailBounce,
7
6
  recordEmailClick,
@@ -9,6 +8,7 @@ import {
9
8
  recordSoftBounce,
10
9
  suppressEmail
11
10
  } from "../../utils/mail.mjs";
11
+ import { sanitizeUrl } from "../../utils/string.mjs";
12
12
  export default defineEventHandler(async (event) => {
13
13
  const mailConfig = getQarpeoConfig(event).mail || {};
14
14
  const webhookSecret = mailConfig.webhookSecret || globalThis.process?.env?.QARPEO_MAIL_WEBHOOK_SECRET;
@@ -105,7 +105,8 @@ export default defineEventHandler(async (event) => {
105
105
  `;
106
106
  if (img.title) entry += ` <image:title>${escapeXml(img.title)}</image:title>
107
107
  `;
108
- if (img.caption) entry += ` <image:caption>${escapeXml(img.caption)}</image:caption>
108
+ if (img.caption)
109
+ entry += ` <image:caption>${escapeXml(img.caption)}</image:caption>
109
110
  `;
110
111
  entry += ` </image:image>
111
112
  `;
@@ -1,13 +1,12 @@
1
1
  /**
2
2
  * POST /api/storage/presigned-r2
3
3
  *
4
- * Generates a **true R2 presigned URL** so the client can PUT a file directly to
5
- * Cloudflare R2 without routing the bytes through the Worker. The endpoint
6
- * mirrors the security model of `presigned.post.ts` (HMAC-ticket) but returns a
7
- * native R2 presigned URL instead.
4
+ * Generates a **true R2 presigned URL** so the client can PUT a file directly to Cloudflare R2
5
+ * without routing the bytes through the Worker. The endpoint mirrors the security model of
6
+ * `presigned.post.ts` (HMAC-ticket) but returns a native R2 presigned URL instead.
8
7
  *
9
- * Body: { pathname: string, contentType?: string, expiresIn?: string | number }
10
- * Response: { url: string, key: string, expiresAt: number }
8
+ * Body: { pathname: string, contentType?: string, expiresIn?: string | number } Response: { url:
9
+ * string, key: string, expiresAt: number }
11
10
  */
12
11
  declare const _default: import("nuxt/server").EventHandler<Promise<{
13
12
  url: string;
@@ -1,7 +1,7 @@
1
1
  import { defineEventHandler, readBody, createError } from "nuxt/server";
2
+ import { createBlob } from "../../../blob.mjs";
2
3
  import { getAuthContext } from "../../utils/context.mjs";
3
4
  import { getStorageConfig } from "../../utils/storage.mjs";
4
- import { createBlob } from "../../../blob.mjs";
5
5
  export default defineEventHandler(async (event) => {
6
6
  const config = getStorageConfig(event);
7
7
  const body = await readBody(event) || {};
@@ -1,4 +1,5 @@
1
1
  import { defineEventHandler, getRouterParam, createError } from "nuxt/server";
2
+ import { getCloudflareEnv } from "../../../../../bindings.mjs";
2
3
  import {
3
4
  resolveStoreCart,
4
5
  removeStoreCartItem,
@@ -6,7 +7,6 @@ import {
6
7
  getStoreCart,
7
8
  storeCartItemTbl
8
9
  } from "../../../../utils/store/index.mjs";
9
- import { getCloudflareEnv } from "../../../../../bindings.mjs";
10
10
  export default defineEventHandler(async (event) => {
11
11
  const itemId = getRouterParam(event, "id");
12
12
  if (!itemId) {
@@ -1,4 +1,5 @@
1
1
  import { defineEventHandler, readBody, getRouterParam, createError } from "nuxt/server";
2
+ import { getCloudflareEnv } from "../../../../../bindings.mjs";
2
3
  import {
3
4
  resolveStoreCart,
4
5
  updateStoreCartItem,
@@ -6,7 +7,6 @@ import {
6
7
  getStoreCart,
7
8
  storeCartItemTbl
8
9
  } from "../../../../utils/store/index.mjs";
9
- import { getCloudflareEnv } from "../../../../../bindings.mjs";
10
10
  export default defineEventHandler(async (event) => {
11
11
  const itemId = getRouterParam(event, "id");
12
12
  if (!itemId) {
@@ -1,8 +1,5 @@
1
1
  import { defineEventHandler } from "nuxt/server";
2
- import {
3
- SUPPORTED_STORE_CURRENCIES,
4
- DEFAULT_STORE_RATES
5
- } from "../../utils/store-localization.mjs";
2
+ import { SUPPORTED_STORE_CURRENCIES, DEFAULT_STORE_RATES } from "../../utils/store-localization.mjs";
6
3
  export default defineEventHandler((_event) => {
7
4
  return {
8
5
  currencies: Object.values(SUPPORTED_STORE_CURRENCIES).map((c) => ({
@@ -1,6 +1,6 @@
1
1
  import { defineEventHandler, getRouterParam, createError } from "nuxt/server";
2
- import { getStoreOrder } from "../../../utils/store/index.mjs";
3
2
  import { getAuthContext } from "../../../utils/context.mjs";
3
+ import { getStoreOrder } from "../../../utils/store/index.mjs";
4
4
  import { getTenant } from "../../../utils/tenant.mjs";
5
5
  export default defineEventHandler(async (event) => {
6
6
  const id = getRouterParam(event, "id");
@@ -1,7 +1,13 @@
1
- import { defineEventHandler, getRouterParam, getQuery, createError, sendRedirect } from "nuxt/server";
2
- import { storeOrderItemTbl, storeOrderTbl } from "../../../../utils/store/index.mjs";
3
- import { verifyHmacSha256 } from "../../../../utils/crypto.mjs";
1
+ import {
2
+ defineEventHandler,
3
+ getRouterParam,
4
+ getQuery,
5
+ createError,
6
+ sendRedirect
7
+ } from "nuxt/server";
4
8
  import { getCloudflareEnv } from "../../../../../bindings.mjs";
9
+ import { verifyHmacSha256 } from "../../../../utils/crypto.mjs";
10
+ import { storeOrderItemTbl, storeOrderTbl } from "../../../../utils/store/index.mjs";
5
11
  export default defineEventHandler(async (event) => {
6
12
  const token = getRouterParam(event, "token");
7
13
  if (!token) {
@@ -11,7 +17,10 @@ export default defineEventHandler(async (event) => {
11
17
  const expires = Number(query.expires);
12
18
  const sig = typeof query.sig === "string" ? query.sig : "";
13
19
  if (!expires || Number.isNaN(expires) || !sig) {
14
- throw createError({ statusCode: 400, statusMessage: "Signed expiration and signature are required." });
20
+ throw createError({
21
+ statusCode: 400,
22
+ statusMessage: "Signed expiration and signature are required."
23
+ });
15
24
  }
16
25
  if (Date.now() > expires) {
17
26
  throw createError({ statusCode: 410, statusMessage: "Download link has expired." });
@@ -1,6 +1,6 @@
1
1
  import { defineEventHandler, getQuery, createError } from "nuxt/server";
2
- import { queryStoreOrders } from "../../../utils/store/index.mjs";
3
2
  import { getAuthContext } from "../../../utils/context.mjs";
3
+ import { queryStoreOrders } from "../../../utils/store/index.mjs";
4
4
  import { getTenant } from "../../../utils/tenant.mjs";
5
5
  export default defineEventHandler(async (event) => {
6
6
  const auth = await getAuthContext(event).catch(() => null);
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * POST /api/store/tax/calculate
3
3
  *
4
- * Body: { subtotal: number, country: string, state?: string, vatNumber?: string, isDigital?: boolean, shippingTotal?: number }
4
+ * Body: { subtotal: number, country: string, state?: string, vatNumber?: string, isDigital?:
5
+ * boolean, shippingTotal?: number }
5
6
  *
6
7
  * Returns StoreTaxResult with breakdown.
7
8
  */
@@ -3,13 +3,22 @@ import { calculateStoreTax } from "../../../utils/store-localization.mjs";
3
3
  export default defineEventHandler(async (event) => {
4
4
  const body = await readBody(event).catch(() => null);
5
5
  if (typeof body?.subtotal !== "number" || typeof body?.country !== "string") {
6
- throw createError({ statusCode: 400, statusMessage: "subtotal (number) and country (string) are required" });
6
+ throw createError({
7
+ statusCode: 400,
8
+ statusMessage: "subtotal (number) and country (string) are required"
9
+ });
7
10
  }
8
11
  if (body.subtotal < 0 || !Number.isFinite(body.subtotal)) {
9
- throw createError({ statusCode: 400, statusMessage: "subtotal must be a positive finite number" });
12
+ throw createError({
13
+ statusCode: 400,
14
+ statusMessage: "subtotal must be a positive finite number"
15
+ });
10
16
  }
11
17
  if (body.shippingTotal !== void 0 && (body.shippingTotal < 0 || !Number.isFinite(body.shippingTotal))) {
12
- throw createError({ statusCode: 400, statusMessage: "shippingTotal must be a positive finite number" });
18
+ throw createError({
19
+ statusCode: 400,
20
+ statusMessage: "shippingTotal must be a positive finite number"
21
+ });
13
22
  }
14
23
  const cleanCountry = body.country.trim().toUpperCase();
15
24
  if (!cleanCountry || !/^[A-Z]{2,3}$/.test(cleanCountry)) {
@@ -23,7 +23,10 @@ export default defineEventHandler(async (event) => {
23
23
  }
24
24
  const tenant = await getTenantById(domainRecord.tenantId, event) || await getTenantBySlug(domainRecord.tenantId, event);
25
25
  if (!tenant || tenant.id !== tenantParam && tenant.slug !== tenantParam) {
26
- throw createError({ statusCode: 403, message: "Tenant mismatch: domain does not belong to this tenant." });
26
+ throw createError({
27
+ statusCode: 403,
28
+ message: "Tenant mismatch: domain does not belong to this tenant."
29
+ });
27
30
  }
28
31
  if (tenant.organizationId) {
29
32
  try {
@@ -23,7 +23,10 @@ export default defineEventHandler(async (event) => {
23
23
  }
24
24
  const tenant = await getTenantById(domainRecord.tenantId, event) || await getTenantBySlug(domainRecord.tenantId, event);
25
25
  if (!tenant || tenant.id !== tenantParam && tenant.slug !== tenantParam) {
26
- throw createError({ statusCode: 403, message: "Tenant mismatch: domain does not belong to this tenant." });
26
+ throw createError({
27
+ statusCode: 403,
28
+ message: "Tenant mismatch: domain does not belong to this tenant."
29
+ });
27
30
  }
28
31
  if (tenant.organizationId) {
29
32
  try {
@@ -2,7 +2,7 @@ import "#qarpeo/agents-registry";
2
2
  import "#qarpeo/tools-registry";
3
3
  import type { RequestEvent } from "nuxt/server";
4
4
  import type { AgentDefinition, AgentMessage, AgentTool, StreamTextOptions, GenerateObjectOptions, GenerateObjectResult, DurableObjectStub, GenerateImageOptions, GenerateImageResult, GenerateSpeechOptions, GenerateSpeechResult, TranscribeAudioInput, TranscribeAudioOptions, TranscribeAudioResult } from "../../../types";
5
- export type { GenerateObjectOptions, GenerateObjectResult, } from "../../../types";
5
+ export type { GenerateObjectOptions, GenerateObjectResult } from "../../../types";
6
6
  /** Registers an agent definition in the shared server runtime registry. */
7
7
  export declare function registerAgentDefinition(definition: AgentDefinition): void;
8
8
  /** Retrieves a registered agent definition by its unique name. */
@@ -10,9 +10,8 @@ export declare function getAgentDefinition(name: string): AgentDefinition | unde
10
10
  /** Retrieves all currently registered agent definitions. */
11
11
  export declare function getAllAgentDefinitions(): AgentDefinition[];
12
12
  /**
13
- * Registers a named tool into the shared server-side global tool registry.
14
- * Called automatically by the generated `#qarpeo/tools-registry` module for
15
- * every export found in `server/tools/`.
13
+ * Registers a named tool into the shared server-side global tool registry. Called automatically by
14
+ * the generated `#qarpeo/tools-registry` module for every export found in `server/tools/`.
16
15
  */
17
16
  export declare function registerGlobalTool(name: string, tool: AgentTool): void;
18
17
  /**
@@ -23,8 +22,8 @@ export declare function registerGlobalTool(name: string, tool: AgentTool): void;
23
22
  */
24
23
  export declare function getGlobalTool(name: string): AgentTool | undefined;
25
24
  /**
26
- * Retrieves all tools registered in the global tool registry (from `server/tools/`).
27
- * Useful for passing all shared tools to an agent definition.
25
+ * Retrieves all tools registered in the global tool registry (from `server/tools/`). Useful for
26
+ * passing all shared tools to an agent definition.
28
27
  *
29
28
  * @example
30
29
  * export default defineAgent({
@@ -81,6 +80,7 @@ export interface ExtractedToolCall {
81
80
  export declare function normalizeTools(toolsInput?: Record<string, AgentTool> | AgentTool[]): Map<string, AgentTool>;
82
81
  /**
83
82
  * Robustly parses tool calls from Workers AI responses, JSON schemas, or tool payloads. Supports:
83
+ *
84
84
  * 1. Workers AI / OpenAI native tool_calls array
85
85
  * 2. Llama 3.1/3.3 <tool_call> tags
86
86
  * 3. Markdown ```json code blocks
@@ -134,19 +134,19 @@ export declare function resolveAiGateway(optsGateway?: {
134
134
  cacheTtl?: number;
135
135
  } | undefined;
136
136
  /**
137
- * Safely resolves the namespaced Durable Object instance ID for an agent session.
138
- * Enforces strict user isolation: authenticated users are locked to their own `usr_<userId>__`
139
- * namespace, preventing cross-user session enumeration or hijacking.
137
+ * Safely resolves the namespaced Durable Object instance ID for an agent session. Enforces strict
138
+ * user isolation: authenticated users are locked to their own `usr_<userId>__` namespace,
139
+ * preventing cross-user session enumeration or hijacking.
140
140
  */
141
141
  export declare function resolveAgentInstanceId(userId?: string | null, rawId?: unknown): string;
142
142
  /**
143
143
  * Accesses an Edge AI Agent backed by Cloudflare Durable Objects.
144
144
  *
145
145
  * @example
146
- * ```ts
147
- * const agent = useAgent("support", "user_123")
148
- * const res = await agent.chat("How do I reset my password?")
149
- * ```
146
+ * ```ts
147
+ * const agent = useAgent("support", "user_123")
148
+ * const res = await agent.chat("How do I reset my password?")
149
+ * ```
150
150
  */
151
151
  export declare function useAgent(agentName: string, id?: string, event?: RequestEvent): UseAgentReturn;
152
152
  /**
@@ -174,43 +174,46 @@ export declare function similaritySearch(indexName: string, query: string, optio
174
174
  /** Detects whether an input schema is a Zod schema. */
175
175
  export declare function isZodSchema(schema: any): boolean;
176
176
  /**
177
- * Converts a Zod schema or plain JSON schema into a valid JSON Schema object
178
- * suitable for Cloudflare Workers AI constrained decoding (response_format).
177
+ * Converts a Zod schema or plain JSON schema into a valid JSON Schema object suitable for
178
+ * Cloudflare Workers AI constrained decoding (response_format).
179
179
  */
180
180
  export declare function schemaToJsonSchema(schema: any): Record<string, any>;
181
181
  /**
182
- * Robustly extracts and parses a JSON object or array from a model response string.
183
- * Strips markdown code fences (```json ... ```) and handles leading/trailing prose.
182
+ * Robustly extracts and parses a JSON object or array from a model response string. Strips markdown
183
+ * code fences (`json ... `) and handles leading/trailing prose.
184
184
  */
185
185
  export declare function extractJsonObject(input: any): any;
186
186
  /**
187
- * Synthesizes a valid default mock object conforming to a JSON Schema.
188
- * Used during local development and testing when no Cloudflare AI token is present.
187
+ * Synthesizes a valid default mock object conforming to a JSON Schema. Used during local
188
+ * development and testing when no Cloudflare AI token is present.
189
189
  */
190
190
  export declare function synthesizeMockFromSchema(jsonSchema: Record<string, any>): any;
191
- /** Generate a complete text response using Cloudflare Workers AI with optional autonomous tool calling. */
191
+ /**
192
+ * Generate a complete text response using Cloudflare Workers AI with optional autonomous tool
193
+ * calling.
194
+ */
192
195
  export declare function generateText(options: StreamTextOptions): Promise<string>;
193
196
  /**
194
- * Generates a structured, strongly-typed JSON object using Cloudflare Workers AI
195
- * constrained decoding (JSON schema) and schema validation.
197
+ * Generates a structured, strongly-typed JSON object using Cloudflare Workers AI constrained
198
+ * decoding (JSON schema) and schema validation.
196
199
  *
197
200
  * Supports Zod schemas (`z.object({...})`) or plain JSON schemas.
198
201
  *
199
202
  * @example
200
- * ```ts
201
- * import { z } from "zod"
202
- * import { ai } from "qarpeo/server"
203
+ * ```ts
204
+ * import { z } from "zod"
205
+ * import { ai } from "qarpeo/server"
203
206
  *
204
- * const profile = await ai.generateObject({
205
- * prompt: "Extract user info: Alice Smith, 29 years old, loves hiking and photography",
206
- * schema: z.object({
207
- * name: z.string(),
208
- * age: z.number(),
209
- * interests: z.array(z.string()),
210
- * }),
211
- * })
212
- * console.log(profile.object.name) // "Alice Smith"
213
- * ```
207
+ * const profile = await ai.generateObject({
208
+ * prompt: "Extract user info: Alice Smith, 29 years old, loves hiking and photography",
209
+ * schema: z.object({
210
+ * name: z.string(),
211
+ * age: z.number(),
212
+ * interests: z.array(z.string()),
213
+ * }),
214
+ * })
215
+ * console.log(profile.object.name) // "Alice Smith"
216
+ * ```
214
217
  */
215
218
  export declare function generateObject<T = any>(options: GenerateObjectOptions<T>): Promise<GenerateObjectResult<T>>;
216
219
  /** Stream text directly via Server-Sent Events using Cloudflare Workers AI. */