qarpeo 0.4.13 → 0.4.15

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 (304) hide show
  1. package/README.md +197 -191
  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 +5451 -5249
  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 +52 -36
  74. package/dist/runtime/app/composables/store.mjs +70 -11
  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/products/index.get.mjs +2 -0
  168. package/dist/runtime/server/routes/store/tax/calculate.post.d.ts +2 -1
  169. package/dist/runtime/server/routes/store/tax/calculate.post.mjs +12 -3
  170. package/dist/runtime/server/routes/tenants/[tenant]/domains/[domain]/index.delete.mjs +4 -1
  171. package/dist/runtime/server/routes/tenants/[tenant]/domains/[domain]/verify.post.mjs +4 -1
  172. package/dist/runtime/server/utils/ai.d.ts +38 -35
  173. package/dist/runtime/server/utils/ai.mjs +7 -11
  174. package/dist/runtime/server/utils/analytics-query.d.ts +4 -4
  175. package/dist/runtime/server/utils/auth.d.ts +25 -25
  176. package/dist/runtime/server/utils/auth.mjs +22 -8
  177. package/dist/runtime/server/utils/bots.d.ts +7 -7
  178. package/dist/runtime/server/utils/browser-utils.d.ts +26 -27
  179. package/dist/runtime/server/utils/cache.d.ts +20 -20
  180. package/dist/runtime/server/utils/cms/collections.mjs +1 -6
  181. package/dist/runtime/server/utils/cms/common.mjs +1 -0
  182. package/dist/runtime/server/utils/cms/markdown.d.ts +2 -2
  183. package/dist/runtime/server/utils/cms/markdown.mjs +5 -5
  184. package/dist/runtime/server/utils/cms/mutations.mjs +8 -23
  185. package/dist/runtime/server/utils/cms/navigation.mjs +4 -4
  186. package/dist/runtime/server/utils/cms/path.d.ts +1 -0
  187. package/dist/runtime/server/utils/cms/path.mjs +8 -2
  188. package/dist/runtime/server/utils/cms/references.mjs +1 -7
  189. package/dist/runtime/server/utils/cms/search.d.ts +2 -2
  190. package/dist/runtime/server/utils/cms/sync.mjs +4 -2
  191. package/dist/runtime/server/utils/cms/taxonomy.d.ts +2 -2
  192. package/dist/runtime/server/utils/cms.d.ts +1 -1
  193. package/dist/runtime/server/utils/cms.mjs +1 -5
  194. package/dist/runtime/server/utils/comments-filter.d.ts +9 -7
  195. package/dist/runtime/server/utils/comments.d.ts +68 -55
  196. package/dist/runtime/server/utils/comments.mjs +21 -9
  197. package/dist/runtime/server/utils/config.d.ts +2 -2
  198. package/dist/runtime/server/utils/console.d.ts +3 -5
  199. package/dist/runtime/server/utils/context.d.ts +10 -10
  200. package/dist/runtime/server/utils/crypto.d.ts +20 -20
  201. package/dist/runtime/server/utils/domains.mjs +3 -1
  202. package/dist/runtime/server/utils/drizzle.d.ts +24 -25
  203. package/dist/runtime/server/utils/drizzle.mjs +17 -17
  204. package/dist/runtime/server/utils/durable-object.d.ts +27 -25
  205. package/dist/runtime/server/utils/durable-object.mjs +3 -10
  206. package/dist/runtime/server/utils/email-inbound.d.ts +10 -10
  207. package/dist/runtime/server/utils/impersonation.d.ts +18 -18
  208. package/dist/runtime/server/utils/legacy-hash.d.ts +23 -27
  209. package/dist/runtime/server/utils/lock.d.ts +20 -23
  210. package/dist/runtime/server/utils/mail.d.ts +19 -19
  211. package/dist/runtime/server/utils/mail.mjs +4 -2
  212. package/dist/runtime/server/utils/mcp.d.ts +20 -20
  213. package/dist/runtime/server/utils/mcp.mjs +22 -38
  214. package/dist/runtime/server/utils/notifications.d.ts +49 -38
  215. package/dist/runtime/server/utils/oauth.d.ts +3 -9
  216. package/dist/runtime/server/utils/organization.d.ts +28 -28
  217. package/dist/runtime/server/utils/organization.mjs +15 -5
  218. package/dist/runtime/server/utils/passwordless.d.ts +24 -24
  219. package/dist/runtime/server/utils/payments/checkout.d.ts +12 -12
  220. package/dist/runtime/server/utils/payments/checkout.mjs +1 -3
  221. package/dist/runtime/server/utils/payments/common.d.ts +3 -3
  222. package/dist/runtime/server/utils/payments/paddle.d.ts +4 -1
  223. package/dist/runtime/server/utils/payments/polar.d.ts +4 -1
  224. package/dist/runtime/server/utils/payments/stripe.mjs +5 -7
  225. package/dist/runtime/server/utils/payments/subscriptions.d.ts +14 -14
  226. package/dist/runtime/server/utils/payments/subscriptions.mjs +2 -6
  227. package/dist/runtime/server/utils/payments/usage.mjs +1 -3
  228. package/dist/runtime/server/utils/payments/webhooks.mjs +2 -2
  229. package/dist/runtime/server/utils/queue.d.ts +54 -58
  230. package/dist/runtime/server/utils/queue.mjs +2 -6
  231. package/dist/runtime/server/utils/rag.d.ts +23 -23
  232. package/dist/runtime/server/utils/rag.mjs +10 -5
  233. package/dist/runtime/server/utils/ratelimit.d.ts +21 -18
  234. package/dist/runtime/server/utils/rbac.d.ts +13 -15
  235. package/dist/runtime/server/utils/rbac.mjs +44 -10
  236. package/dist/runtime/server/utils/realtime.d.ts +53 -52
  237. package/dist/runtime/server/utils/role-env.d.ts +5 -4
  238. package/dist/runtime/server/utils/scheduled-task.d.ts +14 -15
  239. package/dist/runtime/server/utils/session.d.ts +40 -40
  240. package/dist/runtime/server/utils/sse.d.ts +23 -33
  241. package/dist/runtime/server/utils/sse.mjs +5 -14
  242. package/dist/runtime/server/utils/sso.mjs +3 -1
  243. package/dist/runtime/server/utils/storage.d.ts +20 -22
  244. package/dist/runtime/server/utils/storage.mjs +2 -2
  245. package/dist/runtime/server/utils/store/cart.d.ts +5 -3
  246. package/dist/runtime/server/utils/store/cart.mjs +14 -10
  247. package/dist/runtime/server/utils/store/checkout.mjs +4 -1
  248. package/dist/runtime/server/utils/store/common.d.ts +1 -1
  249. package/dist/runtime/server/utils/store/common.mjs +36 -12
  250. package/dist/runtime/server/utils/store/inventory.mjs +3 -1
  251. package/dist/runtime/server/utils/store/orders.mjs +32 -24
  252. package/dist/runtime/server/utils/store/vendor.d.ts +11 -1
  253. package/dist/runtime/server/utils/store/vendor.mjs +47 -0
  254. package/dist/runtime/server/utils/store-localization.d.ts +9 -27
  255. package/dist/runtime/server/utils/store-localization.mjs +3 -3
  256. package/dist/runtime/server/utils/table-names.d.ts +15 -15
  257. package/dist/runtime/server/utils/table-names.mjs +1 -1
  258. package/dist/runtime/server/utils/tenant.d.ts +12 -12
  259. package/dist/runtime/server/utils/tenant.mjs +7 -4
  260. package/dist/runtime/server/utils/totp.d.ts +18 -18
  261. package/dist/runtime/server/utils/tracker.d.ts +5 -5
  262. package/dist/runtime/server/utils/turnstile.d.ts +9 -9
  263. package/dist/runtime/server/utils/urn.d.ts +5 -8
  264. package/dist/runtime/server/utils/workflows.d.ts +30 -31
  265. package/dist/runtime/server/utils/workflows.mjs +2 -4
  266. package/dist/runtime/server.d.ts +2 -2
  267. package/dist/runtime/service.d.ts +10 -10
  268. package/dist/runtime/test-utils.d.ts +10 -10
  269. package/dist/runtime/test-utils.mjs +9 -2
  270. package/dist/runtime/types/ai.d.ts +14 -14
  271. package/dist/runtime/types/d1.d.ts +6 -11
  272. package/dist/runtime/types/durable-object.d.ts +4 -8
  273. package/dist/runtime/types/email.d.ts +3 -9
  274. package/dist/runtime/types/index.d.ts +15 -21
  275. package/dist/runtime/types/r2.d.ts +5 -5
  276. package/dist/runtime/types/store.d.ts +7 -0
  277. package/dist/runtime/types/workflows.d.ts +5 -6
  278. package/dist/runtime/workflows.d.ts +1 -3
  279. package/dist/types/ai.d.ts +10 -17
  280. package/dist/types/auth.d.ts +5 -3
  281. package/dist/types/cache.d.ts +7 -7
  282. package/dist/types/cms.d.ts +30 -5
  283. package/dist/types/comments.d.ts +23 -21
  284. package/dist/types/console.d.ts +1 -3
  285. package/dist/types/db.d.ts +7 -7
  286. package/dist/types/index.d.ts +1 -0
  287. package/dist/types/options.d.ts +36 -24
  288. package/dist/types/site.d.ts +8 -2
  289. package/dist/types/storage.d.ts +2 -1
  290. package/dist/types/store-options.d.ts +31 -26
  291. package/dist/types/studio.d.ts +79 -0
  292. package/dist/utils/bots.d.ts +7 -3
  293. package/dist/utils/cms-table-names.d.ts +1 -1
  294. package/dist/utils/drizzle.d.ts +13 -14
  295. package/dist/utils/email-inbound.d.ts +4 -4
  296. package/dist/utils/features.d.ts +19 -5
  297. package/dist/utils/mcp.d.ts +1 -0
  298. package/dist/utils/migration-lock.d.ts +15 -29
  299. package/dist/utils/overridable-routes.d.ts +12 -0
  300. package/dist/utils/pkg.d.ts +6 -7
  301. package/dist/utils/schema-diff.d.ts +7 -11
  302. package/dist/utils/store-schema.d.ts +4 -6
  303. package/dist/utils/tools.d.ts +3 -3
  304. package/package.json +55 -5
@@ -42,7 +42,7 @@ export function useDrizzle(bindingNameOrOptions, eventOrOptions) {
42
42
  let postgresLib;
43
43
  let drizzlePostgres;
44
44
  try {
45
- const req = globalThis.require || (typeof globalThis.process !== "undefined" && typeof require !== "undefined" ? require : void 0);
45
+ const req = globalThis.require || (globalThis.process !== void 0 && typeof require !== "undefined" ? require : void 0);
46
46
  if (req) {
47
47
  const pgMod = req("postgres");
48
48
  postgresLib = pgMod?.default || pgMod;
@@ -90,7 +90,7 @@ Ensure your Hyperdrive binding exposes a connectionString (or set DATABASE_URL).
90
90
  let mysqlLib;
91
91
  let drizzleMysql;
92
92
  try {
93
- const req = globalThis.require || (typeof globalThis.process !== "undefined" && typeof require !== "undefined" ? require : void 0);
93
+ const req = globalThis.require || (globalThis.process !== void 0 && typeof require !== "undefined" ? require : void 0);
94
94
  if (req) {
95
95
  mysqlLib = req("mysql2/promise");
96
96
  drizzleMysql = req("drizzle-orm/mysql2").drizzle;
@@ -152,7 +152,10 @@ Install it with: pnpm add mysql2`
152
152
  let instance = isDefaultSchema ? drizzleCache.get(d1) : void 0;
153
153
  if (!instance) {
154
154
  const relations = defineRelations(activeSchema);
155
- const rawDrizzle = drizzleD1(d1, { relations, schema: activeSchema });
155
+ const rawDrizzle = drizzleD1(d1, {
156
+ relations,
157
+ schema: activeSchema
158
+ });
156
159
  instance = Object.assign(rawDrizzle, {
157
160
  raw: (bName) => getD1Binding(bName || resolvedBinding, event),
158
161
  getBookmark: () => d1.getBookmark?.() ?? null,
@@ -186,21 +189,18 @@ export const db = new Proxy(
186
189
  );
187
190
  export const d1Db = db;
188
191
  export function createDbProxy(name) {
189
- return new Proxy(
190
- {},
191
- {
192
- get(_target, prop) {
193
- if (prop === "raw") {
194
- return (bindingName) => getD1Binding(bindingName || name);
195
- }
196
- const instance = useDrizzle(name);
197
- const val = instance[prop];
198
- if (typeof val === "function") {
199
- return val.bind(instance);
200
- }
201
- return val;
192
+ return new Proxy({}, {
193
+ get(_target, prop) {
194
+ if (prop === "raw") {
195
+ return (bindingName) => getD1Binding(bindingName || name);
196
+ }
197
+ const instance = useDrizzle(name);
198
+ const val = instance[prop];
199
+ if (typeof val === "function") {
200
+ return val.bind(instance);
202
201
  }
202
+ return val;
203
203
  }
204
- );
204
+ });
205
205
  }
206
206
  export const schema = _schema;
@@ -1,5 +1,5 @@
1
- import type { CFEvent } from "../../types/index";
2
1
  import type { DurableObjectId, DurableObjectNamespace, DurableObjectStorage, DurableObjectState, DurableObjectRPCStub, DurableObjectDefinition, DurableObjectClass, SqlStorage, SqlStorageCursor } from "../../types/durable-object";
2
+ import type { CFEvent } from "../../types/index";
3
3
  export type { DurableObjectId, DurableObjectStub, DurableObjectNamespace, DurableObjectStorage, DurableObjectState, DurableObjectContext, DurableObjectRPCStub, DurableObjectDefinition, DurableObjectClass, DurableObjectsOptions, SqlStorage, SqlStorageCursor, } from "../../types/durable-object";
4
4
  export declare class InMemorySqlStorageCursor<T = Record<string, any>> implements SqlStorageCursor<T> {
5
5
  private readonly rows;
@@ -56,35 +56,37 @@ export declare function clearDurableObjectStore(): void;
56
56
  /**
57
57
  * Defines a modern Cloudflare Durable Object with Remote Procedure Call (RPC) support.
58
58
  *
59
- * Supports both object-literal syntax (with `this.storage`, `this.state`, and `this.env`)
60
- * and class syntax.
59
+ * Supports both object-literal syntax (with `this.storage`, `this.state`, and `this.env`) and class
60
+ * syntax.
61
61
  *
62
- * @example Object-literal syntax with RPC methods:
63
- * ```ts
64
- * export default defineDurableObject({
62
+ * @example
63
+ * Object-literal syntax with RPC methods:
64
+ * ```ts
65
+ * export default defineDurableObject({
65
66
  * async increment(by: number = 1) {
66
- * const current = (await this.storage.get<number>("count")) || 0
67
- * const next = current + by
68
- * await this.storage.put("count", next)
69
- * return next
67
+ * const current = (await this.storage.get<number>("count")) || 0
68
+ * const next = current + by
69
+ * await this.storage.put("count", next)
70
+ * return next
70
71
  * },
71
72
  * async getCount() {
72
- * return (await this.storage.get<number>("count")) || 0
73
+ * return (await this.storage.get<number>("count")) || 0
73
74
  * }
74
- * })
75
- * ```
75
+ * })
76
+ * ```
76
77
  *
77
- * @example Class syntax:
78
- * ```ts
79
- * export default defineDurableObject(class CounterDO {
78
+ * @example
79
+ * Class syntax:
80
+ * ```ts
81
+ * export default defineDurableObject(class CounterDO {
80
82
  * constructor(public state: DurableObjectState, public env: Record<string, any>) {}
81
83
  * async increment(by: number = 1) {
82
- * const current = (await this.state.storage.get<number>("count")) || 0
83
- * await this.state.storage.put("count", current + by)
84
- * return current + by
84
+ * const current = (await this.state.storage.get<number>("count")) || 0
85
+ * await this.state.storage.put("count", current + by)
86
+ * return current + by
85
87
  * }
86
- * })
87
- * ```
88
+ * })
89
+ * ```
88
90
  */
89
91
  export declare function defineDurableObject<T extends Record<string, any>>(definitionOrClass: DurableObjectDefinition<T>): DurableObjectClass<T>;
90
92
  /**
@@ -98,9 +100,9 @@ export declare function getDurableObjectNamespace<T = Record<string, any>>(bindi
98
100
  * Access a modern typed Durable Object RPC stub by binding name and ID or name.
99
101
  *
100
102
  * @example
101
- * ```ts
102
- * const counter = useDurableObject<CounterDO>("COUNTER", "user_42", event)
103
- * const count = await counter.increment(5) // Direct RPC call!
104
- * ```
103
+ * ```ts
104
+ * const counter = useDurableObject<CounterDO>("COUNTER", "user_42", event)
105
+ * const count = await counter.increment(5) // Direct RPC call!
106
+ * ```
105
107
  */
106
108
  export declare function useDurableObject<T = Record<string, any>>(bindingName: string | DurableObjectClass<T>, idOrName: string | DurableObjectId, event?: CFEvent): DurableObjectRPCStub<T>;
@@ -147,9 +147,7 @@ export class InMemorySqlStorage {
147
147
  filteredRows = filteredRows.slice(0, limitVal);
148
148
  }
149
149
  if (/COUNT\s*\(\s*\*\s*\)/i.test(selectFields)) {
150
- const countRows = [
151
- { "count(*)": filteredRows.length, count: filteredRows.length }
152
- ];
150
+ const countRows = [{ "count(*)": filteredRows.length, count: filteredRows.length }];
153
151
  return new InMemorySqlStorageCursor(countRows, ["count"], rowsRead, 0);
154
152
  }
155
153
  let resultRows;
@@ -173,9 +171,7 @@ export class InMemorySqlStorage {
173
171
  return new InMemorySqlStorageCursor([], [], 0, 0);
174
172
  }
175
173
  if (upper.startsWith("UPDATE")) {
176
- const match = trimmed.match(
177
- /UPDATE\s+([^\s]+)\s+SET\s+([\s\S]+?)(?:\s+WHERE\s+([\s\S]+))?$/i
178
- );
174
+ const match = trimmed.match(/UPDATE\s+([^\s]+)\s+SET\s+([\s\S]+?)(?:\s+WHERE\s+([\s\S]+))?$/i);
179
175
  if (match) {
180
176
  const tableName = match[1].replace(/["`]/g, "").trim().toLowerCase();
181
177
  const setClause = match[2].trim();
@@ -503,10 +499,7 @@ async function dispatchHttpRpc(instance, request) {
503
499
  const result = await instance[methodName](...args);
504
500
  return Response.json({ success: true, result });
505
501
  } catch (err) {
506
- return Response.json(
507
- { success: false, error: err?.message || String(err) },
508
- { status: 500 }
509
- );
502
+ return Response.json({ success: false, error: err?.message || String(err) }, { status: 500 });
510
503
  }
511
504
  }
512
505
  function createSimulatedNamespace(bindingNameOrClass) {
@@ -3,27 +3,27 @@ import type { InboundEmailContext, InboundEmailHandler } from "../../types/email
3
3
  * Defines an inbound email handler for Cloudflare Email Workers.
4
4
  *
5
5
  * @example
6
- * ```ts [server/email/incoming.ts]
7
- * export default defineEmailHandler(async ({ message, forward, reply }) => {
6
+ * ```ts [server/email/incoming.ts]
7
+ * export default defineEmailHandler(async ({ message, forward, reply }) => {
8
8
  * console.log("From:", message.from)
9
9
  * console.log("Subject:", message.headers.get("subject"))
10
10
  * const text = await message.text()
11
11
  *
12
12
  * if (message.from.endsWith("@spam.com")) {
13
- * message.setReject("Spam not accepted")
14
- * return
13
+ * message.setReject("Spam not accepted")
14
+ * return
15
15
  * }
16
16
  *
17
17
  * await reply({
18
- * subject: "Received your message",
19
- * text: "Thank you for contacting us!",
18
+ * subject: "Received your message",
19
+ * text: "Thank you for contacting us!",
20
20
  * })
21
- * })
22
- * ```
21
+ * })
22
+ * ```
23
23
  */
24
24
  export declare function defineEmailHandler(handler: InboundEmailHandler): InboundEmailHandler;
25
25
  /**
26
- * Wraps raw Cloudflare `ForwardableEmailMessage` (or a mock/simulated message)
27
- * into a typed, convenient InboundEmailContext.
26
+ * Wraps raw Cloudflare `ForwardableEmailMessage` (or a mock/simulated message) into a typed,
27
+ * convenient InboundEmailContext.
28
28
  */
29
29
  export declare function createInboundEmailContext(rawMessage: any, env?: any, ctx?: any): InboundEmailContext;
@@ -5,9 +5,9 @@ import type { QarpeoUser } from "../../types/auth";
5
5
  * The admin's original identity is preserved in `session.impersonator`.
6
6
  *
7
7
  * @example
8
- * ```ts
9
- * const { user } = await startImpersonation(event, targetUserId)
10
- * ```
8
+ * ```ts
9
+ * const { user } = await startImpersonation(event, targetUserId)
10
+ * ```
11
11
  */
12
12
  export declare function startImpersonation(event: RequestEvent, targetUserId: string): Promise<{
13
13
  success: boolean;
@@ -17,9 +17,9 @@ export declare function startImpersonation(event: RequestEvent, targetUserId: st
17
17
  * Stops impersonation and restores the admin's original identity.
18
18
  *
19
19
  * @example
20
- * ```ts
21
- * const { user } = await stopImpersonation(event)
22
- * ```
20
+ * ```ts
21
+ * const { user } = await stopImpersonation(event)
22
+ * ```
23
23
  */
24
24
  export declare function stopImpersonation(event: RequestEvent): Promise<{
25
25
  success: boolean;
@@ -30,12 +30,12 @@ export declare function stopImpersonation(event: RequestEvent): Promise<{
30
30
  * the SHA-256 hash is stored.
31
31
  *
32
32
  * @example
33
- * ```ts
34
- * const { token, id } = await createApiToken(event, {
35
- * name: "CLI Token",
36
- * scopes: ["read", "write"],
37
- * })
38
- * ```
33
+ * ```ts
34
+ * const { token, id } = await createApiToken(event, {
35
+ * name: "CLI Token",
36
+ * scopes: ["read", "write"],
37
+ * })
38
+ * ```
39
39
  */
40
40
  export declare function createApiToken(event: RequestEvent, input: {
41
41
  name: string;
@@ -67,9 +67,9 @@ export declare function revokeApiToken(event: RequestEvent, tokenId: string): Pr
67
67
  * token metadata if valid; throws 401 if invalid/expired.
68
68
  *
69
69
  * @example
70
- * ```ts
71
- * const { user, scopes } = await verifyApiToken(event, rawToken)
72
- * ```
70
+ * ```ts
71
+ * const { user, scopes } = await verifyApiToken(event, rawToken)
72
+ * ```
73
73
  */
74
74
  export declare function verifyApiToken(event: RequestEvent, rawToken: string): Promise<{
75
75
  user: QarpeoUser;
@@ -84,9 +84,9 @@ export declare function hasApiTokenScope(scopes: string[], required: string): bo
84
84
  * no/invalid token. Returns the verified token context.
85
85
  *
86
86
  * @example
87
- * ```ts
88
- * const { user, scopes } = await requireApiToken(event, { scope: "read:files" })
89
- * ```
87
+ * ```ts
88
+ * const { user, scopes } = await requireApiToken(event, { scope: "read:files" })
89
+ * ```
90
90
  */
91
91
  export declare function requireApiToken(event: RequestEvent, options?: {
92
92
  scope?: string;
@@ -1,18 +1,20 @@
1
1
  /**
2
2
  * Legacy password hash verification helpers for migrating users from other auth systems.
3
3
  *
4
- * Better Auth uses `scrypt` (via `@noble/hashes/scrypt`) for all new hashes. This module
5
- * provides pure-Web-Crypto / pure-JS fallbacks to verify passwords stored in older formats so
6
- * that users can log in with their existing password, which is then transparently re-hashed to
7
- * scrypt on successful verification.
4
+ * Better Auth uses `scrypt` (via `@noble/hashes/scrypt`) for all new hashes. This module provides
5
+ * pure-Web-Crypto / pure-JS fallbacks to verify passwords stored in older formats so that users can
6
+ * log in with their existing password, which is then transparently re-hashed to scrypt on
7
+ * successful verification.
8
8
  *
9
9
  * Supported legacy formats:
10
- * - bcrypt — `$2a$`, `$2b$`, `$2x$`, `$2y$` prefix (requires `bcryptjs` dev dep)
11
- * - Django PBKDF2-SHA256 — `pbkdf2_sha256$<iterations>$<salt>$<hash>` format (pure Web Crypto)
12
- * - SHA-1 — 40-char hex (plain SHA-1, common in very old Rails / PHP apps)
13
- * - MD5 — 32-char hex (plain MD5 — not supported, Web Crypto lacks MD5)
10
+ *
11
+ * - Bcrypt — `$2a$`, `$2b$`, `$2x$`, `$2y$` prefix (requires `bcryptjs` dev dep)
12
+ * - Django PBKDF2-SHA256 — `pbkdf2_sha256$<iterations>$<salt>$<hash>` format (pure Web Crypto)
13
+ * - SHA-1 — 40-char hex (plain SHA-1, common in very old Rails / PHP apps)
14
+ * - MD5 — 32-char hex (plain MD5 — not supported, Web Crypto lacks MD5)
14
15
  *
15
16
  * Usage in `defineQarpeoAuth`:
17
+ *
16
18
  * ```ts
17
19
  * emailAndPassword: {
18
20
  * verifyLegacyPassword: async (password, hash) => {
@@ -21,43 +23,37 @@
21
23
  * }
22
24
  * ```
23
25
  */
24
- /**
25
- * Returns true if `hash` looks like a bcrypt hash (`$2a$`, `$2b$`, `$2x$`, `$2y$`).
26
- */
26
+ /** Returns true if `hash` looks like a bcrypt hash (`$2a$`, `$2b$`, `$2x$`, `$2y$`). */
27
27
  export declare function isBcryptHash(hash: string): boolean;
28
28
  /**
29
29
  * Verifies a password against a bcrypt hash using `bcryptjs` (pure JS, works on CF Workers).
30
- * Returns `false` if `bcryptjs` is not installed — install it as a dev dependency and add it
31
- * to `optimizeDeps.include` / `noExternal` if needed.
30
+ * Returns `false` if `bcryptjs` is not installed — install it as a dev dependency and add it to
31
+ * `optimizeDeps.include` / `noExternal` if needed.
32
32
  */
33
33
  export declare function verifyBcrypt(password: string, hash: string): Promise<boolean>;
34
34
  /**
35
- * Returns true if `hash` is a Django-style PBKDF2-SHA256 hash.
36
- * Format: `pbkdf2_sha256$<iterations>$<salt>$<hash_base64>`
35
+ * Returns true if `hash` is a Django-style PBKDF2-SHA256 hash. Format:
36
+ * `pbkdf2_sha256$<iterations>$<salt>$<hash_base64>`
37
37
  */
38
38
  export declare function isDjangoPbkdf2Hash(hash: string): boolean;
39
39
  /**
40
- * Verifies a password against a Django PBKDF2-SHA256 hash using the Web Crypto API.
41
- * This works without any external library on Cloudflare Workers.
40
+ * Verifies a password against a Django PBKDF2-SHA256 hash using the Web Crypto API. This works
41
+ * without any external library on Cloudflare Workers.
42
42
  */
43
43
  export declare function verifyDjangoPbkdf2(password: string, hash: string): Promise<boolean>;
44
- /**
45
- * Returns true if `hash` looks like a plain 40-char hex SHA-1 digest.
46
- */
44
+ /** Returns true if `hash` looks like a plain 40-char hex SHA-1 digest. */
47
45
  export declare function isSha1Hash(hash: string): boolean;
48
46
  /**
49
- * Verifies a password against a plain SHA-1 hex hash using Web Crypto.
50
- * Note: SHA-1 is cryptographically broken — this is provided only for migration.
47
+ * Verifies a password against a plain SHA-1 hex hash using Web Crypto. Note: SHA-1 is
48
+ * cryptographically broken — this is provided only for migration.
51
49
  */
52
50
  export declare function verifySha1(password: string, hash: string): Promise<boolean>;
53
51
  export type LegacyHashType = "bcrypt" | "pbkdf2_sha256" | "sha1" | "unknown";
54
- /**
55
- * Detects the hash type from the hash string.
56
- */
52
+ /** Detects the hash type from the hash string. */
57
53
  export declare function detectHashType(hash: string): LegacyHashType;
58
54
  /**
59
- * Verifies a password against any supported legacy hash format.
60
- * Returns `{ valid: boolean; type: LegacyHashType }`.
55
+ * Verifies a password against any supported legacy hash format. Returns `{ valid: boolean; type:
56
+ * LegacyHashType }`.
61
57
  *
62
58
  * Use this inside `verifyLegacyPassword` callback in `defineQarpeoAuth` options:
63
59
  *
@@ -1,22 +1,19 @@
1
1
  import type { CFEvent } from "../../types/index";
2
2
  export interface LockOptions {
3
3
  /**
4
- * Time-to-live for the lock, e.g. "5 minutes", "30 seconds", or milliseconds.
5
- * Prevents deadlocks if the isolate or worker terminates unexpectedly.
4
+ * Time-to-live for the lock, e.g. "5 minutes", "30 seconds", or milliseconds. Prevents deadlocks
5
+ * if the isolate or worker terminates unexpectedly.
6
6
  *
7
7
  * @default "5 minutes" (300,000ms)
8
8
  */
9
9
  ttl?: string | number;
10
- /**
11
- * Optional event context for resolving Cloudflare bindings.
12
- */
10
+ /** Optional event context for resolving Cloudflare bindings. */
13
11
  event?: CFEvent;
14
- /**
15
- * Custom lock token (identifier of the lock holder). Defaults to random UUID.
16
- */
12
+ /** Custom lock token (identifier of the lock holder). Defaults to random UUID. */
17
13
  token?: string;
18
14
  /**
19
15
  * Behavior when the lock cannot be acquired:
16
+ *
20
17
  * - `"return"` (default): return null / false
21
18
  * - `"throw"`: throw a LockConflictError
22
19
  */
@@ -50,32 +47,32 @@ export declare function acquireLock(key: string, options?: LockOptions): Promise
50
47
  */
51
48
  export declare function releaseLock(key: string, token: string, event?: CFEvent): Promise<boolean>;
52
49
  /**
53
- * Runs an asynchronous callback within a distributed lock.
54
- * Automatically acquires the lock before running and releases it afterwards,
55
- * ensuring proper cleanup even if the callback throws an error.
50
+ * Runs an asynchronous callback within a distributed lock. Automatically acquires the lock before
51
+ * running and releases it afterwards, ensuring proper cleanup even if the callback throws an
52
+ * error.
53
+ *
54
+ * @example
55
+ * ```ts
56
+ * const result = await withLock("sync-inventory", { ttl: "2 minutes" }, async () => {
57
+ * return await syncProductsFromShopify()
58
+ * })
59
+ * ```
56
60
  *
57
61
  * @param key Unique lock resource key
58
62
  * @param optionsOrCallback LockOptions or callback function
59
63
  * @param maybeCallback Callback function when options are provided as second argument
60
64
  * @returns Result of callback, or `null` if the lock could not be acquired
61
- *
62
- * @example
63
- * ```ts
64
- * const result = await withLock("sync-inventory", { ttl: "2 minutes" }, async () => {
65
- * return await syncProductsFromShopify()
66
- * })
67
- * ```
68
65
  */
69
66
  export declare function withLock<T>(key: string, optionsOrCallback: LockOptions | (() => Promise<T> | T), maybeCallback?: () => Promise<T> | T): Promise<T | null>;
70
67
  /**
71
68
  * Convenience helper to run a database migration callback with an exclusive distributed lock.
72
69
  *
73
70
  * @example
74
- * ```ts
75
- * await withMigrationLock("analytics", { ttl: "10m" }, async () => {
76
- * await runDrizzleMigrations()
77
- * })
78
- * ```
71
+ * ```ts
72
+ * await withMigrationLock("analytics", { ttl: "10m" }, async () => {
73
+ * await runDrizzleMigrations()
74
+ * })
75
+ * ```
79
76
  */
80
77
  export declare function withMigrationLock<T>(dbName: string, optionsOrCallback: LockOptions | (() => Promise<T> | T), maybeCallback?: () => Promise<T> | T): Promise<T | null>;
81
78
  /** Clears all in-memory locks (used during test teardown). */
@@ -65,22 +65,22 @@ export declare function deliverMailDirect(options: {
65
65
  * tracking, queue-backed delivery, and dev mailbox capture.
66
66
  *
67
67
  * @example
68
- * ```ts
69
- * // Markdown content:
70
- * await sendMail({
71
- * to: "user@example.com",
72
- * subject: "Welcome to Acme",
73
- * markdown:
74
- * "# Welcome!\nWe are glad you joined us.\n\n[btn: Go to Dashboard](https://myapp.com)",
75
- * })
68
+ * ```ts
69
+ * // Markdown content:
70
+ * await sendMail({
71
+ * to: "user@example.com",
72
+ * subject: "Welcome to Acme",
73
+ * markdown:
74
+ * "# Welcome!\nWe are glad you joined us.\n\n[btn: Go to Dashboard](https://myapp.com)",
75
+ * })
76
76
  *
77
- * // Template:
78
- * await sendMail({
79
- * to: "user@example.com",
80
- * template: "welcome",
81
- * data: { name: "Alice", actionUrl: "https://myapp.com/dashboard" },
82
- * })
83
- * ```
77
+ * // Template:
78
+ * await sendMail({
79
+ * to: "user@example.com",
80
+ * template: "welcome",
81
+ * data: { name: "Alice", actionUrl: "https://myapp.com/dashboard" },
82
+ * })
83
+ * ```
84
84
  */
85
85
  export declare function sendMail(request: SendMailRequest, event?: RequestEvent): Promise<MailResult>;
86
86
  export interface UseMailReturn {
@@ -93,10 +93,10 @@ export interface UseMailReturn {
93
93
  * Access the Qarpeo Transactional Mail client.
94
94
  *
95
95
  * @example
96
- * ```ts
97
- * const mail = useMail(event)
98
- * await mail.send({ to: "user@example.com", subject: "Hello", text: "Welcome" })
99
- * ```
96
+ * ```ts
97
+ * const mail = useMail(event)
98
+ * await mail.send({ to: "user@example.com", subject: "Hello", text: "Welcome" })
99
+ * ```
100
100
  */
101
101
  export declare function useMail(event?: RequestEvent): UseMailReturn;
102
102
  export { suppressEmail, isEmailSuppressed, unsuppressEmail, listSuppressedEmails, recordSoftBounce, generateUnsubscribeToken, verifyUnsubscribeToken, buildListUnsubscribeHeaders, } from "./mail-suppression";
@@ -1,8 +1,8 @@
1
1
  import { resolveRuntimeBinding } from "../../bindings.mjs";
2
2
  import { sendEmail } from "../../email.mjs";
3
3
  import { useQueue } from "../../queue.mjs";
4
- import { renderEmailTemplate, renderMarkdownEmail } from "./email-templates.mjs";
5
4
  import { signHmacSha256 } from "./crypto.mjs";
5
+ import { renderEmailTemplate, renderMarkdownEmail } from "./email-templates.mjs";
6
6
  import { buildListUnsubscribeHeaders, isEmailSuppressed } from "./mail-suppression.mjs";
7
7
  function getSharedMailbox() {
8
8
  return globalThis.__qarpeo_dev_mailbox__ ||= [];
@@ -52,7 +52,9 @@ export async function injectEmailTracking(html, options) {
52
52
  }
53
53
  }
54
54
  for (const match of matches) {
55
- const sig = await signHmacSha256(`${options.messageId}:${match.href}`, options.secret).catch(() => "");
55
+ const sig = await signHmacSha256(`${options.messageId}:${match.href}`, options.secret).catch(
56
+ () => ""
57
+ );
56
58
  const sigParam = sig ? `&sig=${encodeURIComponent(sig)}` : "";
57
59
  const trackUrl = `${base}/__qarpeo/mail/track/click/${encodeURIComponent(options.messageId)}?url=${encodeURIComponent(match.href)}${sigParam}`;
58
60
  result = result.replace(match.full, `<a${match.prefix}href="${trackUrl}"${match.suffix}>`);
@@ -4,7 +4,7 @@ import type { McpServerDefinition, McpTool, McpClient, McpClientOptions } from "
4
4
  * Converts Qarpeo AgentTool array or record to MCP tool descriptors.
5
5
  *
6
6
  * @example
7
- * const mcpTools = agentToolsToMcpTools({ search: defineTool({ ... }) })
7
+ * const mcpTools = agentToolsToMcpTools({ search: defineTool({ ... }) })
8
8
  */
9
9
  export declare function agentToolsToMcpTools(tools: Record<string, AgentTool> | AgentTool[] | undefined): McpTool[];
10
10
  /**
@@ -13,31 +13,31 @@ export declare function agentToolsToMcpTools(tools: Record<string, AgentTool> |
13
13
  * The returned handler can be used directly in a Nuxt server route:
14
14
  *
15
15
  * @example
16
- * ```ts
17
- * // server/routes/mcp.post.ts
18
- * export default defineMcpServer({
19
- * name: "my-mcp",
20
- * version: "1.0.0",
21
- * tools: {
22
- * search: defineTool({
23
- * description: "Search the database",
24
- * parameters: { type: "object", properties: { q: { type: "string" } } },
25
- * execute: async ({ q }) => db.search(q),
26
- * }),
27
- * },
28
- * })
29
- * ```
16
+ * ```ts
17
+ * // server/routes/mcp.post.ts
18
+ * export default defineMcpServer({
19
+ * name: "my-mcp",
20
+ * version: "1.0.0",
21
+ * tools: {
22
+ * search: defineTool({
23
+ * description: "Search the database",
24
+ * parameters: { type: "object", properties: { q: { type: "string" } } },
25
+ * execute: async ({ q }) => db.search(q),
26
+ * }),
27
+ * },
28
+ * })
29
+ * ```
30
30
  */
31
31
  export declare function defineMcpServer(definition: McpServerDefinition): (event: any) => Promise<Response>;
32
32
  /**
33
33
  * Creates a typed MCP client that sends JSON-RPC 2.0 requests to a remote MCP server.
34
34
  *
35
35
  * @example
36
- * ```ts
37
- * const client = createMcpClient("https://mcp.example.com/api/mcp")
38
- * const tools = await client.getTools()
39
- * const result = await client.callTool("search", { q: "hello" })
40
- * ```
36
+ * ```ts
37
+ * const client = createMcpClient("https://mcp.example.com/api/mcp")
38
+ * const tools = await client.getTools()
39
+ * const result = await client.callTool("search", { q: "hello" })
40
+ * ```
41
41
  */
42
42
  export declare function createMcpClient(url: string, options?: McpClientOptions): McpClient;
43
43
  /** Alias for {@link createMcpClient}. */