gemi 0.91.1 → 0.93.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) hide show
  1. package/dist/ai/index.js +2 -2
  2. package/dist/ai/index.js.map +1 -1
  3. package/dist/app/index.js +1 -1
  4. package/dist/bun/plugin.js +1 -1
  5. package/dist/bun/preload.js +1 -1
  6. package/dist/{chunk-7k7dfy74.js → chunk-0n8t329w.js} +2 -2
  7. package/dist/{chunk-7k7dfy74.js.map → chunk-0n8t329w.js.map} +1 -1
  8. package/dist/{chunk-3470jpmr.js → chunk-0rs8a7re.js} +2 -2
  9. package/dist/{chunk-3470jpmr.js.map → chunk-0rs8a7re.js.map} +1 -1
  10. package/dist/{chunk-bj6gsxkv.js → chunk-1wdfjmkx.js} +2 -2
  11. package/dist/{chunk-bj6gsxkv.js.map → chunk-1wdfjmkx.js.map} +1 -1
  12. package/dist/{chunk-f2vjbxh6.js → chunk-1yt4hjqx.js} +2 -2
  13. package/dist/{chunk-f2vjbxh6.js.map → chunk-1yt4hjqx.js.map} +1 -1
  14. package/dist/{chunk-ed346kf4.js → chunk-241aehp3.js} +2 -2
  15. package/dist/{chunk-ed346kf4.js.map → chunk-241aehp3.js.map} +1 -1
  16. package/dist/{chunk-n4mfv24c.js → chunk-3jpetvsj.js} +2 -2
  17. package/dist/{chunk-n4mfv24c.js.map → chunk-3jpetvsj.js.map} +1 -1
  18. package/dist/{chunk-p3n8jjjf.js → chunk-3m10ve1n.js} +3 -3
  19. package/dist/{chunk-p3n8jjjf.js.map → chunk-3m10ve1n.js.map} +1 -1
  20. package/dist/{chunk-4czqjqs7.js → chunk-3prm2e2t.js} +2 -2
  21. package/dist/{chunk-4czqjqs7.js.map → chunk-3prm2e2t.js.map} +1 -1
  22. package/dist/chunk-4bh0maq0.js +5 -0
  23. package/dist/{chunk-ddbbxg9m.js.map → chunk-4bh0maq0.js.map} +1 -1
  24. package/dist/{chunk-x97zectc.js → chunk-4k4mh3gh.js} +2 -2
  25. package/dist/{chunk-x97zectc.js.map → chunk-4k4mh3gh.js.map} +1 -1
  26. package/dist/{chunk-kmebynhc.js → chunk-5v2rx0rk.js} +2 -2
  27. package/dist/{chunk-kmebynhc.js.map → chunk-5v2rx0rk.js.map} +1 -1
  28. package/dist/{chunk-b1wjymn0.js → chunk-5y9jk4h4.js} +2 -2
  29. package/dist/{chunk-b1wjymn0.js.map → chunk-5y9jk4h4.js.map} +1 -1
  30. package/dist/{chunk-ez0c0mpt.js → chunk-6ak8jfhm.js} +2 -2
  31. package/dist/{chunk-ez0c0mpt.js.map → chunk-6ak8jfhm.js.map} +1 -1
  32. package/dist/{chunk-ttckhvew.js → chunk-6qyc4e22.js} +2 -2
  33. package/dist/{chunk-ttckhvew.js.map → chunk-6qyc4e22.js.map} +1 -1
  34. package/dist/{chunk-w9j1kxmc.js → chunk-6xh4e55j.js} +2 -2
  35. package/dist/{chunk-fc28h7g2.js.map → chunk-6xh4e55j.js.map} +1 -1
  36. package/dist/{chunk-kdpc26j2.js → chunk-7jshf4ms.js} +1 -1
  37. package/dist/{chunk-d33qcg5b.js → chunk-7k7a6h9j.js} +2 -2
  38. package/dist/{chunk-d33qcg5b.js.map → chunk-7k7a6h9j.js.map} +1 -1
  39. package/dist/chunk-9pcsm8g3.js +54 -0
  40. package/dist/{chunk-k5j65f2c.js.map → chunk-9pcsm8g3.js.map} +5 -5
  41. package/dist/{chunk-r6jytsz3.js → chunk-a1y7pa5z.js} +2 -2
  42. package/dist/{chunk-r6jytsz3.js.map → chunk-a1y7pa5z.js.map} +1 -1
  43. package/dist/{chunk-fj7yk6a7.js → chunk-aawtyngp.js} +3 -3
  44. package/dist/{chunk-fj7yk6a7.js.map → chunk-aawtyngp.js.map} +1 -1
  45. package/dist/{chunk-dedazpms.js → chunk-aq1hjk00.js} +1 -1
  46. package/dist/{chunk-q7gkfkbz.js → chunk-bb8e7rhf.js} +2 -2
  47. package/dist/{chunk-q7gkfkbz.js.map → chunk-bb8e7rhf.js.map} +1 -1
  48. package/dist/chunk-c37g1gzy.js +17 -0
  49. package/dist/{chunk-087r45fw.js.map → chunk-c37g1gzy.js.map} +4 -4
  50. package/dist/{chunk-sh1cfx9j.js → chunk-cyze295m.js} +3 -3
  51. package/dist/{chunk-sh1cfx9j.js.map → chunk-cyze295m.js.map} +1 -1
  52. package/dist/{chunk-6tt3ynm7.js → chunk-d869bd41.js} +2 -2
  53. package/dist/{chunk-6tt3ynm7.js.map → chunk-d869bd41.js.map} +1 -1
  54. package/dist/{chunk-6ffpdkjw.js → chunk-dmvrx8nm.js} +3 -3
  55. package/dist/{chunk-6ffpdkjw.js.map → chunk-dmvrx8nm.js.map} +1 -1
  56. package/dist/{chunk-9kfnd4bf.js → chunk-dve6ryfd.js} +1 -1
  57. package/dist/{chunk-cv2sargd.js → chunk-dwkhs81y.js} +2 -2
  58. package/dist/{chunk-cv2sargd.js.map → chunk-dwkhs81y.js.map} +1 -1
  59. package/dist/{chunk-3z8fkczm.js → chunk-ej5mkm7t.js} +2 -2
  60. package/dist/{chunk-3z8fkczm.js.map → chunk-ej5mkm7t.js.map} +1 -1
  61. package/dist/{chunk-kk5x6grc.js → chunk-ffpm75zs.js} +2 -2
  62. package/dist/{chunk-kk5x6grc.js.map → chunk-ffpm75zs.js.map} +1 -1
  63. package/dist/{chunk-t6hma13w.js → chunk-fx02sqe2.js} +3 -3
  64. package/dist/{chunk-t6hma13w.js.map → chunk-fx02sqe2.js.map} +1 -1
  65. package/dist/{chunk-49v5xq8q.js → chunk-fz805r97.js} +2 -2
  66. package/dist/{chunk-49v5xq8q.js.map → chunk-fz805r97.js.map} +1 -1
  67. package/dist/{chunk-8acf5bf3.js → chunk-g2xbpr8r.js} +2 -2
  68. package/dist/{chunk-8acf5bf3.js.map → chunk-g2xbpr8r.js.map} +1 -1
  69. package/dist/{chunk-fc28h7g2.js → chunk-g6byqmdq.js} +2 -2
  70. package/dist/{chunk-w9j1kxmc.js.map → chunk-g6byqmdq.js.map} +1 -1
  71. package/dist/{chunk-6mdw41s5.js → chunk-g8tgp3ja.js} +2 -2
  72. package/dist/{chunk-6mdw41s5.js.map → chunk-g8tgp3ja.js.map} +1 -1
  73. package/dist/{chunk-e70ggm2m.js → chunk-jj0ynn5t.js} +2 -2
  74. package/dist/{chunk-e70ggm2m.js.map → chunk-jj0ynn5t.js.map} +1 -1
  75. package/dist/{chunk-a9a3tbyr.js → chunk-khvnm11p.js} +2 -2
  76. package/dist/{chunk-a9a3tbyr.js.map → chunk-khvnm11p.js.map} +1 -1
  77. package/dist/{chunk-6p62z1h3.js → chunk-knw4t9e6.js} +2 -2
  78. package/dist/{chunk-6p62z1h3.js.map → chunk-knw4t9e6.js.map} +1 -1
  79. package/dist/{chunk-2mrgrjy6.js → chunk-mmfstb0z.js} +2 -2
  80. package/dist/{chunk-2mrgrjy6.js.map → chunk-mmfstb0z.js.map} +1 -1
  81. package/dist/{chunk-j0qwgrp6.js → chunk-nvbbgbdk.js} +4 -4
  82. package/dist/{chunk-j0qwgrp6.js.map → chunk-nvbbgbdk.js.map} +1 -1
  83. package/dist/{chunk-5rpeez39.js → chunk-pgn3yh5k.js} +3 -3
  84. package/dist/{chunk-5rpeez39.js.map → chunk-pgn3yh5k.js.map} +1 -1
  85. package/dist/{chunk-17nh5gfm.js → chunk-pwchwgkc.js} +2 -2
  86. package/dist/{chunk-17nh5gfm.js.map → chunk-pwchwgkc.js.map} +1 -1
  87. package/dist/{chunk-5c7nyk5k.js → chunk-qrczhr16.js} +2 -2
  88. package/dist/{chunk-5c7nyk5k.js.map → chunk-qrczhr16.js.map} +1 -1
  89. package/dist/{chunk-hc1mcgs9.js → chunk-qs9drxja.js} +2 -2
  90. package/dist/{chunk-hc1mcgs9.js.map → chunk-qs9drxja.js.map} +1 -1
  91. package/dist/chunk-qv2sdxbq.js +9 -0
  92. package/dist/chunk-qv2sdxbq.js.map +10 -0
  93. package/dist/{chunk-dyq9gcwa.js → chunk-rgcfqq21.js} +2 -2
  94. package/dist/{chunk-dyq9gcwa.js.map → chunk-rgcfqq21.js.map} +1 -1
  95. package/dist/{chunk-w4qek53d.js → chunk-s22afmm9.js} +2 -2
  96. package/dist/{chunk-w4qek53d.js.map → chunk-s22afmm9.js.map} +1 -1
  97. package/dist/{chunk-66g9yytx.js → chunk-sppjqk4n.js} +3 -3
  98. package/dist/{chunk-66g9yytx.js.map → chunk-sppjqk4n.js.map} +1 -1
  99. package/dist/{chunk-7ct4y1zh.js → chunk-sqd77ksy.js} +3 -3
  100. package/dist/{chunk-7ct4y1zh.js.map → chunk-sqd77ksy.js.map} +1 -1
  101. package/dist/{chunk-vqhcztw0.js → chunk-svzdv2rf.js} +2 -2
  102. package/dist/{chunk-vqhcztw0.js.map → chunk-svzdv2rf.js.map} +1 -1
  103. package/dist/{chunk-q18fb0cr.js → chunk-t328955a.js} +2 -2
  104. package/dist/{chunk-q18fb0cr.js.map → chunk-t328955a.js.map} +1 -1
  105. package/dist/{chunk-2dfar4d1.js → chunk-t4x7q9x8.js} +2 -2
  106. package/dist/{chunk-2dfar4d1.js.map → chunk-t4x7q9x8.js.map} +1 -1
  107. package/dist/{chunk-j2402q2z.js → chunk-v51a4g6w.js} +2 -2
  108. package/dist/{chunk-j2402q2z.js.map → chunk-v51a4g6w.js.map} +1 -1
  109. package/dist/{chunk-xqyx8kzr.js → chunk-v6vsjdp7.js} +2 -2
  110. package/dist/{chunk-xqyx8kzr.js.map → chunk-v6vsjdp7.js.map} +1 -1
  111. package/dist/{chunk-gzfat1x1.js → chunk-vbfwvyb8.js} +2 -2
  112. package/dist/{chunk-gzfat1x1.js.map → chunk-vbfwvyb8.js.map} +1 -1
  113. package/dist/{chunk-mn5xnk02.js → chunk-vpcys0ty.js} +2 -2
  114. package/dist/{chunk-mn5xnk02.js.map → chunk-vpcys0ty.js.map} +1 -1
  115. package/dist/{chunk-n2rq7wp8.js → chunk-vryvdzmk.js} +2 -2
  116. package/dist/{chunk-n2rq7wp8.js.map → chunk-vryvdzmk.js.map} +1 -1
  117. package/dist/{chunk-araqww9d.js → chunk-wd9zab3e.js} +2 -2
  118. package/dist/{chunk-araqww9d.js.map → chunk-wd9zab3e.js.map} +1 -1
  119. package/dist/{chunk-ngrr6wvw.js → chunk-xk4r9372.js} +2 -2
  120. package/dist/{chunk-ngrr6wvw.js.map → chunk-xk4r9372.js.map} +1 -1
  121. package/dist/{chunk-hx1jg944.js → chunk-y3hdh6q6.js} +2 -2
  122. package/dist/{chunk-hx1jg944.js.map → chunk-y3hdh6q6.js.map} +1 -1
  123. package/dist/{chunk-01n76z2m.js → chunk-z10c81a9.js} +2 -2
  124. package/dist/{chunk-01n76z2m.js.map → chunk-z10c81a9.js.map} +1 -1
  125. package/dist/{chunk-d476f9f6.js → chunk-z405ks42.js} +2 -2
  126. package/dist/{chunk-d476f9f6.js.map → chunk-z405ks42.js.map} +1 -1
  127. package/dist/{chunk-3nh3h2df.js → chunk-za1ncjh0.js} +2 -2
  128. package/dist/{chunk-3nh3h2df.js.map → chunk-za1ncjh0.js.map} +1 -1
  129. package/dist/client/Mutation.d.ts +12 -3
  130. package/dist/client/Mutation.d.ts.map +1 -1
  131. package/dist/client/MutationError.d.ts +32 -2
  132. package/dist/client/MutationError.d.ts.map +1 -1
  133. package/dist/client/auth/useForgotPassword.d.ts +1 -1
  134. package/dist/client/auth/useResetPassword.d.ts +1 -1
  135. package/dist/client/auth/useSignIn.d.ts +1 -1
  136. package/dist/client/auth/useSignOut.d.ts +1 -1
  137. package/dist/client/auth/useSignUp.d.ts +1 -1
  138. package/dist/client/index.d.ts +2 -2
  139. package/dist/client/index.d.ts.map +1 -1
  140. package/dist/client/index.js +19 -1
  141. package/dist/client/index.js.map +1 -1
  142. package/dist/client/useMutation.d.ts +38 -26
  143. package/dist/client/useMutation.d.ts.map +1 -1
  144. package/dist/config/index.js +1 -1
  145. package/dist/console/run.js +2 -2
  146. package/dist/console/run.js.map +1 -1
  147. package/dist/container/index.js +2 -2
  148. package/dist/container/index.js.map +1 -1
  149. package/dist/database/index.js +2 -2
  150. package/dist/database/index.js.map +1 -1
  151. package/dist/email/index.js +2 -2
  152. package/dist/email/index.js.map +1 -1
  153. package/dist/facades/index.js +2 -2
  154. package/dist/facades/index.js.map +1 -1
  155. package/dist/foundation/index.js +2 -2
  156. package/dist/foundation/index.js.map +1 -1
  157. package/dist/http/ApiRouter.d.ts +10 -4
  158. package/dist/http/ApiRouter.d.ts.map +1 -1
  159. package/dist/http/HttpResponse.d.ts +85 -10
  160. package/dist/http/HttpResponse.d.ts.map +1 -1
  161. package/dist/http/index.d.ts +1 -1
  162. package/dist/http/index.d.ts.map +1 -1
  163. package/dist/http/index.js +2 -2
  164. package/dist/http/index.js.map +1 -1
  165. package/dist/i18n/dictionaryRuntime.js +2 -2
  166. package/dist/i18n/dictionaryRuntime.js.map +1 -1
  167. package/dist/i18n/index.js +2 -2
  168. package/dist/i18n/index.js.map +1 -1
  169. package/dist/kernel/index.js +2 -2
  170. package/dist/kernel/index.js.map +1 -1
  171. package/dist/orm/Model.d.ts +81 -0
  172. package/dist/orm/Model.d.ts.map +1 -1
  173. package/dist/orm/compile/where.d.ts +17 -0
  174. package/dist/orm/compile/where.d.ts.map +1 -1
  175. package/dist/orm/compile/write.d.ts.map +1 -1
  176. package/dist/orm/context.d.ts +27 -0
  177. package/dist/orm/context.d.ts.map +1 -1
  178. package/dist/orm/dialect/index.d.ts +28 -0
  179. package/dist/orm/dialect/index.d.ts.map +1 -1
  180. package/dist/orm/dialect/postgres.d.ts +15 -0
  181. package/dist/orm/dialect/postgres.d.ts.map +1 -1
  182. package/dist/orm/dialect/sqlite.d.ts +17 -0
  183. package/dist/orm/dialect/sqlite.d.ts.map +1 -1
  184. package/dist/orm/index.d.ts +2 -1
  185. package/dist/orm/index.d.ts.map +1 -1
  186. package/dist/orm/index.js +4 -4
  187. package/dist/orm/index.js.map +8 -8
  188. package/dist/orm/plan.d.ts.map +1 -1
  189. package/dist/orm/soft-deletes.d.ts +50 -0
  190. package/dist/orm/soft-deletes.d.ts.map +1 -1
  191. package/dist/orm/types.d.ts +22 -5
  192. package/dist/orm/types.d.ts.map +1 -1
  193. package/dist/server/index.js +2 -2
  194. package/dist/server/index.js.map +1 -1
  195. package/dist/services/index.js +2 -2
  196. package/dist/services/index.js.map +1 -1
  197. package/dist/services/queue/work.js +2 -2
  198. package/dist/services/queue/work.js.map +1 -1
  199. package/dist/support/index.js +2 -2
  200. package/dist/support/index.js.map +1 -1
  201. package/package.json +1 -1
  202. package/skills/gemi-react-best-practices/rules/controller-throw-framework-errors.md +9 -0
  203. package/dist/chunk-087r45fw.js +0 -17
  204. package/dist/chunk-6y62ccam.js +0 -9
  205. package/dist/chunk-6y62ccam.js.map +0 -10
  206. package/dist/chunk-ddbbxg9m.js +0 -5
  207. package/dist/chunk-k5j65f2c.js +0 -54
  208. /package/dist/{chunk-kdpc26j2.js.map → chunk-7jshf4ms.js.map} +0 -0
  209. /package/dist/{chunk-dedazpms.js.map → chunk-aq1hjk00.js.map} +0 -0
  210. /package/dist/{chunk-9kfnd4bf.js.map → chunk-dve6ryfd.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  // @bun
2
- import{va as j}from"./chunk-8z37k28d.js";import{createElement as x}from"react";function h(i,n){let s=Object.keys(n).sort((u,r)=>r.length-u.length).map((u)=>u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),b=new RegExp(s.join("|"),"g");return i.replace(b,(u)=>n[u])}async function J(i,n,s=[]){let b=[...s.map((t)=>`${i}/views/${t}.tsx`),`${i}/views/RootLayout.tsx`],u=new Set;for(let t of b){let e=n.moduleGraph.getModulesByFile(t);if(e)for(let g of e)u.add(g)}let r=[],p=[],l={};for(let t of u)if(t)for(let e of t.importedModules){if(e.file.includes("module.css"))l[e.file]=e.ssrTransformResult.map.sourcesContent.join("");if(e.file.includes(".css"))p.push(e.file)}for(let t of p){let e=await n.transformRequest(t+"?direct"),g=t.includes("module.css"),a="";if(g)a=h(l[t],e.default);r.push({isDev:!0,id:t,content:g?a:e.code})}return r.map((t,e)=>{return x("style",{key:e,type:"text/css","data-vite-dev-id":t.id,dangerouslySetInnerHTML:{__html:t.content}})})}async function L(i=[]){return i.map((n,s)=>{return x("style",{key:s,id:n?.id,type:"text/css",dangerouslySetInnerHTML:{__html:n.content}})})}import{existsSync as v}from"fs";import{basename as f}from"path";import{networkInterfaces as k}from"os";var y={name:"gemi",version:"0.91.1",private:!1,license:"MIT",author:"Enes Tufekci <enes@gemijs.dev>",repository:{type:"git",url:"git+https://github.com/nstfkc/gemi.git",directory:"packages/gemi"},bin:{gemi:"./dist/bin/gemi.js","gemi-orm-generator":"./dist/bin/orm-generator.js"},files:["dist/**/*","ide/typescript-plugin/package.json","skills/**/*"],module:!0,exports:{"./http":"./http/index.ts","./client":"./client/index.ts","./ai":"./ai/index.ts","./ai/client":"./ai/client/index.ts","./testing":"./testing/index.ts","./app":"./app/index.ts","./facades":"./facades/index.ts","./email":"./email/index.ts","./vite":"./dist/vite/index.mjs","./kernel":"./kernel/index.ts","./services":"./services/index.ts","./i18n":"./i18n/index.ts","./dictionary":"./i18n/dictionaryRuntime.ts","./server":"./server/index.ts","./config":"./config/index.ts","./container":"./container/index.ts","./foundation":"./foundation/index.ts","./database":"./database/index.ts","./orm":"./orm/index.ts","./support":"./support/index.ts","./console/run":"./console/run.ts","./queue/work":"./services/queue/work.ts","./ide/typescript-plugin":"./ide/typescript-plugin/index.ts","./bun/preload":"./bun/preload.ts","./bun/plugin":"./bun/plugin.ts"},scripts:{lint:"oxlint",typecheck:"tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.browser.json && tsc --noEmit -p ide/typescript-plugin/tsconfig.json",build:"NODE_ENV=production bun run build:core && bun run build:bin && bun run build:types && bun run build:client && bun run build:plugin && bun run build:ts-plugin && bun run build:client-types && bun run build:augmentation","build:core":"bun ./scripts/build.ts","build:bin":"bun build --outdir=./dist/bin --target=bun --external=vite --external=react-dom --external=react/jsx-runtime --external=bun --external=sharp --external=@azure/storage-blob --external=typescript --sourcemap ./bin/gemi.ts ./bin/orm-generator.ts && bun ./scripts/prepare-bin.ts","build:client":"rm -rf dist/client dist/testing dist/ai/client dist/chunks && vite build -c vite.client.config.mts","build:plugin":"vite build -c vite.plugin.config.mts","build:ts-plugin":"bun ./scripts/build-ts-plugin.ts","build:types":"tsc -p tsconfig.build.json","build:client-types":"tsc -p tsconfig.browser.json",test:"bun --bun vitest","test:types":"vitest run --typecheck.only","test:live":"bun --bun vitest run ai/live","test:packaging":"bun --bun vitest run --config vitest.packaging.config.ts","build:publish":"bun scripts/build-publish.ts",prepublishOnly:"echo 'Do not publish from this directory \u2014 its exports point at TS source. Run: bun run build:publish, then publish from .publish/' && exit 1","build:augmentation":"bun ./scripts/wire-augmentation.ts"},dependencies:{"@aws-sdk/client-s3":"^3.629.0","@aws-sdk/s3-request-presigner":"^3.629.0","ast-types":"^0.14.2",commander:"^12.1.0",history:"^5.3.0","jsx-email":"2.0.0-rc2.1","magic-string":"^0.30.17",open:"^10.1.0","react-error-boundary":"^6.0.0",recast:"^0.23.9",resend:"^6.12.3",satori:"^0.12.2","temporal-polyfill":"^0.2.5","twitter-api-v2":"^1.20.2","urlpattern-polyfill":"^10.0.0",uuid:"^9.0.1"},devDependencies:{"@babel/parser":"^7.25.4","@prisma/generator-helper":"^6.5.0","@repo/typescript-config":"*","@testing-library/react":"^16.3.2","@types/bun":"^1.3.14","@types/eslint":"^8.56.5","@types/node":"^20.11.24","@types/react":"^19.0.2","@types/react-dom":"^19.0.2",eslint:"^8.57.0",jsdom:"^30.0.1",oxlint:"^1.39.0",react:"19.2.3","react-dom":"19.2.3",typescript:"^5.7.3",vitest:"^4.0.0"},peerDependencies:{"@azure/storage-blob":"^12.28.0",react:">=19","react-dom":">=19",sharp:"^0.34.2",typescript:">=5",vite:"^8.0.0"},peerDependenciesMeta:{"@azure/storage-blob":{optional:!0},typescript:{optional:!0}}};var q=[" \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557\u2588\u2588\u2557","\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551","\u2588\u2588\u2551 \u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2554\u2588\u2588\u2588\u2588\u2554\u2588\u2588\u2551\u2588\u2588\u2551","\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u255D \u2588\u2588\u2551\u255A\u2588\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2551","\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u255A\u2550\u255D \u2588\u2588\u2551\u2588\u2588\u2551"," \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D"],z=Boolean(process.stdout.isTTY)&&!process.env.NO_COLOR,c=(i,n)=>z?`\x1B[${i}m${n}\x1B[0m`:n,E=(i)=>c("1",i),d=(i)=>c("2",i),o=(i)=>c("36",i),O=(i)=>c("32",i),T=(i)=>c("35",i);function R(){return y.version??"?"}function _(i){for(let n of Object.values(k()))for(let s of n??[])if((s.family==="IPv4"||s.family===4)&&!s.internal)return`http://${s.address}:${i}`;return null}function G(i){return j(i).filter((n)=>v(n)).map((n)=>f(n))}function A(i){let{port:n,rootDir:s}=i,b=`http://localhost:${n}`,u=_(n),r=G(s),p=(t,e)=>` ${O("\u279C")} ${E(t.padEnd(9))}${e}`,l=["",...q.map((t)=>T(t)),"",` ${d("gemi")} ${o(`v${R()}`)}`,"",p("Local:",o(b)),p("Network:",u?o(u):d("unavailable")),p("Env:",r.length?r.join(", "):d("none")),""];console.log(l.join(`
2
+ import{va as j}from"./chunk-8z37k28d.js";import{createElement as x}from"react";function h(i,n){let s=Object.keys(n).sort((u,r)=>r.length-u.length).map((u)=>u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),b=new RegExp(s.join("|"),"g");return i.replace(b,(u)=>n[u])}async function J(i,n,s=[]){let b=[...s.map((t)=>`${i}/views/${t}.tsx`),`${i}/views/RootLayout.tsx`],u=new Set;for(let t of b){let e=n.moduleGraph.getModulesByFile(t);if(e)for(let g of e)u.add(g)}let r=[],p=[],l={};for(let t of u)if(t)for(let e of t.importedModules){if(e.file.includes("module.css"))l[e.file]=e.ssrTransformResult.map.sourcesContent.join("");if(e.file.includes(".css"))p.push(e.file)}for(let t of p){let e=await n.transformRequest(t+"?direct"),g=t.includes("module.css"),a="";if(g)a=h(l[t],e.default);r.push({isDev:!0,id:t,content:g?a:e.code})}return r.map((t,e)=>{return x("style",{key:e,type:"text/css","data-vite-dev-id":t.id,dangerouslySetInnerHTML:{__html:t.content}})})}async function L(i=[]){return i.map((n,s)=>{return x("style",{key:s,id:n?.id,type:"text/css",dangerouslySetInnerHTML:{__html:n.content}})})}import{existsSync as v}from"fs";import{basename as f}from"path";import{networkInterfaces as k}from"os";var y={name:"gemi",version:"0.93.0",private:!1,license:"MIT",author:"Enes Tufekci <enes@gemijs.dev>",repository:{type:"git",url:"git+https://github.com/nstfkc/gemi.git",directory:"packages/gemi"},bin:{gemi:"./dist/bin/gemi.js","gemi-orm-generator":"./dist/bin/orm-generator.js"},files:["dist/**/*","ide/typescript-plugin/package.json","skills/**/*"],module:!0,exports:{"./http":"./http/index.ts","./client":"./client/index.ts","./ai":"./ai/index.ts","./ai/client":"./ai/client/index.ts","./testing":"./testing/index.ts","./app":"./app/index.ts","./facades":"./facades/index.ts","./email":"./email/index.ts","./vite":"./dist/vite/index.mjs","./kernel":"./kernel/index.ts","./services":"./services/index.ts","./i18n":"./i18n/index.ts","./dictionary":"./i18n/dictionaryRuntime.ts","./server":"./server/index.ts","./config":"./config/index.ts","./container":"./container/index.ts","./foundation":"./foundation/index.ts","./database":"./database/index.ts","./orm":"./orm/index.ts","./support":"./support/index.ts","./console/run":"./console/run.ts","./queue/work":"./services/queue/work.ts","./ide/typescript-plugin":"./ide/typescript-plugin/index.ts","./bun/preload":"./bun/preload.ts","./bun/plugin":"./bun/plugin.ts"},scripts:{lint:"oxlint",typecheck:"tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.browser.json && tsc --noEmit -p ide/typescript-plugin/tsconfig.json",build:"NODE_ENV=production bun run build:core && bun run build:bin && bun run build:types && bun run build:client && bun run build:plugin && bun run build:ts-plugin && bun run build:client-types && bun run build:augmentation","build:core":"bun ./scripts/build.ts","build:bin":"bun build --outdir=./dist/bin --target=bun --external=vite --external=react-dom --external=react/jsx-runtime --external=bun --external=sharp --external=@azure/storage-blob --external=typescript --sourcemap ./bin/gemi.ts ./bin/orm-generator.ts && bun ./scripts/prepare-bin.ts","build:client":"rm -rf dist/client dist/testing dist/ai/client dist/chunks && vite build -c vite.client.config.mts","build:plugin":"vite build -c vite.plugin.config.mts","build:ts-plugin":"bun ./scripts/build-ts-plugin.ts","build:types":"tsc -p tsconfig.build.json","build:client-types":"tsc -p tsconfig.browser.json",test:"bun --bun vitest","test:types":"vitest run --typecheck.only","test:live":"bun --bun vitest run ai/live","test:packaging":"bun --bun vitest run --config vitest.packaging.config.ts","build:publish":"bun scripts/build-publish.ts",prepublishOnly:"echo 'Do not publish from this directory \u2014 its exports point at TS source. Run: bun run build:publish, then publish from .publish/' && exit 1","build:augmentation":"bun ./scripts/wire-augmentation.ts"},dependencies:{"@aws-sdk/client-s3":"^3.629.0","@aws-sdk/s3-request-presigner":"^3.629.0","ast-types":"^0.14.2",commander:"^12.1.0",history:"^5.3.0","jsx-email":"2.0.0-rc2.1","magic-string":"^0.30.17",open:"^10.1.0","react-error-boundary":"^6.0.0",recast:"^0.23.9",resend:"^6.12.3",satori:"^0.12.2","temporal-polyfill":"^0.2.5","twitter-api-v2":"^1.20.2","urlpattern-polyfill":"^10.0.0",uuid:"^9.0.1"},devDependencies:{"@babel/parser":"^7.25.4","@prisma/generator-helper":"^6.5.0","@repo/typescript-config":"*","@testing-library/react":"^16.3.2","@types/bun":"^1.3.14","@types/eslint":"^8.56.5","@types/node":"^20.11.24","@types/react":"^19.0.2","@types/react-dom":"^19.0.2",eslint:"^8.57.0",jsdom:"^30.0.1",oxlint:"^1.39.0",react:"19.2.3","react-dom":"19.2.3",typescript:"^5.7.3",vitest:"^4.0.0"},peerDependencies:{"@azure/storage-blob":"^12.28.0",react:">=19","react-dom":">=19",sharp:"^0.34.2",typescript:">=5",vite:"^8.0.0"},peerDependenciesMeta:{"@azure/storage-blob":{optional:!0},typescript:{optional:!0}}};var q=[" \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557\u2588\u2588\u2557","\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551","\u2588\u2588\u2551 \u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2554\u2588\u2588\u2588\u2588\u2554\u2588\u2588\u2551\u2588\u2588\u2551","\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u255D \u2588\u2588\u2551\u255A\u2588\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2551","\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u255A\u2550\u255D \u2588\u2588\u2551\u2588\u2588\u2551"," \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D"],z=Boolean(process.stdout.isTTY)&&!process.env.NO_COLOR,c=(i,n)=>z?`\x1B[${i}m${n}\x1B[0m`:n,E=(i)=>c("1",i),d=(i)=>c("2",i),o=(i)=>c("36",i),O=(i)=>c("32",i),T=(i)=>c("35",i);function R(){return y.version??"?"}function _(i){for(let n of Object.values(k()))for(let s of n??[])if((s.family==="IPv4"||s.family===4)&&!s.internal)return`http://${s.address}:${i}`;return null}function G(i){return j(i).filter((n)=>v(n)).map((n)=>f(n))}function A(i){let{port:n,rootDir:s}=i,b=`http://localhost:${n}`,u=_(n),r=G(s),p=(t,e)=>` ${O("\u279C")} ${E(t.padEnd(9))}${e}`,l=["",...q.map((t)=>T(t)),"",` ${d("gemi")} ${o(`v${R()}`)}`,"",p("Local:",o(b)),p("Network:",u?o(u):d("unavailable")),p("Env:",r.length?r.join(", "):d("none")),""];console.log(l.join(`
3
3
  `))}
4
4
  export{J as h,L as i,A as j};
5
5
 
6
- //# debugId=930EAFD386F624EF64756E2164756E21
6
+ //# debugId=E0B9669A0D6B6BA064756E2164756E21
@@ -6,6 +6,6 @@
6
6
  "import { existsSync } from \"node:fs\";\nimport { basename } from \"node:path\";\nimport { networkInterfaces } from \"node:os\";\nimport { envFiles } from \"./watchEnv\";\nimport pkg from \"../package.json\";\n\n// \"GEMI\" — ANSI Shadow figlet font.\nconst ART = [\n \" ██████╗ ███████╗███╗ ███╗██╗\",\n \"██╔════╝ ██╔════╝████╗ ████║██║\",\n \"██║ ███╗█████╗ ██╔████╔██║██║\",\n \"██║ ██║██╔══╝ ██║╚██╔╝██║██║\",\n \"╚██████╔╝███████╗██║ ╚═╝ ██║██║\",\n \" ╚═════╝ ╚══════╝╚═╝ ╚═╝╚═╝\",\n];\n\nconst useColor = Boolean(process.stdout.isTTY) && !process.env.NO_COLOR;\nconst paint = (code: string, text: string) =>\n useColor ? `\\x1b[${code}m${text}\\x1b[0m` : text;\nconst bold = (t: string) => paint(\"1\", t);\nconst dim = (t: string) => paint(\"2\", t);\nconst cyan = (t: string) => paint(\"36\", t);\nconst green = (t: string) => paint(\"32\", t);\nconst magenta = (t: string) => paint(\"35\", t);\n\nfunction gemiVersion(): string {\n return (pkg as { version?: string }).version ?? \"?\";\n}\n\nfunction networkUrl(port: number | string): string | null {\n for (const ifaces of Object.values(networkInterfaces())) {\n for (const iface of ifaces ?? []) {\n // Node <18 reported `family` as the number 4; newer Bun/Node use \"IPv4\".\n const isV4 = iface.family === \"IPv4\" || (iface.family as unknown) === 4;\n if (isV4 && !iface.internal) return `http://${iface.address}:${port}`;\n }\n }\n return null;\n}\n\nfunction loadedEnvFiles(rootDir: string): string[] {\n return envFiles(rootDir)\n .filter((file) => existsSync(file))\n .map((file) => basename(file));\n}\n\nexport function printStartupBanner(params: {\n port: number | string;\n rootDir: string;\n}) {\n const { port, rootDir } = params;\n const local = `http://localhost:${port}`;\n const network = networkUrl(port);\n const env = loadedEnvFiles(rootDir);\n\n const row = (label: string, value: string) =>\n ` ${green(\"➜\")} ${bold(label.padEnd(9))}${value}`;\n\n const out = [\n \"\",\n ...ART.map((line) => magenta(line)),\n \"\",\n ` ${dim(\"gemi\")} ${cyan(`v${gemiVersion()}`)}`,\n \"\",\n row(\"Local:\", cyan(local)),\n row(\"Network:\", network ? cyan(network) : dim(\"unavailable\")),\n row(\"Env:\", env.length ? env.join(\", \") : dim(\"none\")),\n \"\",\n ];\n\n console.log(out.join(\"\\n\"));\n}\n"
7
7
  ],
8
8
  "mappings": "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",
9
- "debugId": "930EAFD386F624EF64756E2164756E21",
9
+ "debugId": "E0B9669A0D6B6BA064756E2164756E21",
10
10
  "names": []
11
11
  }
@@ -0,0 +1,54 @@
1
+ // @bun
2
+ class U extends Error{argument;model;operation;constructor(z,G,H,V){super(`gemi ORM does not support '${z}' yet (${G}.${H}). `+V);this.argument=z;this.model=G;this.operation=H;this.name="UnsupportedQueryError"}}class k extends U{constructor(z,G,H,V){super(z,G,H,V);this.name="InvalidArgumentError",this.message=`Invalid '${z}' (${G}.${H}). ${V}`}}class q extends U{constructor(z,G,H,V){super(z,G,H,V);this.name="UnsupportedByDesignError",this.message=`gemi ORM does not implement '${z}' (${G}.${H}), and this is a decision rather than a gap. ${V}`}}class h extends Error{field;model;constructor(z,G,H){super(`'${z}' is not a field on model ${G}. Known fields: ${H.join(", ")}.`);this.field=z;this.model=G;this.name="UnknownFieldError"}}class F extends Error{field;value;constructor(z,G){super(`Could not decode the value ${JSON.stringify(String(G))} from column '${z.column}' as ${z.type}. The column's contents do not match `+"the Prisma schema \u2014 was it written by something other than Prisma or "+"the gemi ORM?");this.field=z;this.value=G;this.name="DecodeError"}}class R extends Error{model;operation;constructor(z,G){super(`No ${z} found (${z}.${G}).`);this.model=z;this.operation=G;this.name="RecordNotFoundError"}}function Hz(z){if(z instanceof R)return!0;return typeof z==="object"&&z!==null&&z.name==="RecordNotFoundError"}class b extends Error{model;operation;fields;constraint;constructor(z,G,H,V,Z){super(`Unique constraint violated on ${z}.${G}`+(H.length>0?` for ${H.join(", ")}`:"")+(V?` (constraint '${V}')`:"")+`. A ${z} with those values already exists.`,Z);this.model=z;this.operation=G;this.fields=H;this.constraint=V;this.name="UniqueConstraintError"}}function Vz(z){if(z instanceof b)return!0;return typeof z==="object"&&z!==null&&z.name==="UniqueConstraintError"}class x extends Error{model;operation;dialect;constructor(z,G,H){super(`${z}.${G} needs RETURNING to report its result, and the '${H}' dialect does not support it. The fallback \u2014 `+"lastInsertRowid plus a re-select \u2014 is not implemented.");this.model=z;this.operation=G;this.dialect=H;this.name="ReturningUnsupportedError"}}class D extends Error{model;operation;reason;constructor(z,G,H="denied"){super(H==="no-user"?`${z}.${G} is governed by a policy and there is no user in scope. If this is a cron tick, a queue worker or a script, say so at the call site: Model.asSystem(() => ...). Policies are never skipped just because a user failed to turn up.`:`${z}.${G} was denied by ${z}'s policy.`);this.model=z;this.operation=G;this.reason=H;this.name="PolicyDeniedError"}}function Wz(z){if(z instanceof D)return!0;return typeof z==="object"&&z!==null&&z.name==="PolicyDeniedError"}class g extends Error{model;operation;fields;constructor(z,G,H){let V=H.map((Z)=>`'${Z}'`).join(", ");super(`${z}.${G} writes ${V}, which ${z}'s policy also `+"scopes on \u2014 so this update can move a row outside the scope that "+`selected it, where the caller can no longer read or repair it.
3
+
4
+ Add an onUpdate to that policy. It may reassert the column (data => ({ ...data, ${H[0]}: ctx.user.${H[0]} })), reject `+"the write, or allow it explicitly with (_ctx, data) => data \u2014 all "+"three are fine, and the point is that the policy says which.");this.model=z;this.operation=G;this.fields=H;this.name="ScopeEscapeError"}}class f extends Error{model;registered;queried;carries;constructor(z,G,H,V="queried"){super(V==="narrowing"?`${H} extends ${G}, which owns the model '${z}', and carries policies of its own on top of it. A class that narrows an existing model is a view, and the registry holds one `+`class per name \u2014 so registering ${H} would apply its narrowing to every nested read of ${z}, and leaving ${G} registered would skip ${H}'s policies entirely. Neither is a thing to choose for you.
5
+
6
+ Keep the view out of the modules you hand to Kernel.models, and query it directly where you want it:
7
+
8
+ ${H}.findMany(\u2026) // narrowed, at the call site
9
+
10
+ `+`If it is not a view but the model itself, move the policies onto ${G} \u2014 the class the model's name resolves to \u2014 and `+`${H} inherits them everywhere.
11
+ `:V==="queried"?`${H} carries policies but the registry resolves '${z}' to ${G}. Nested relation reads go through the registry, so they would run on ${G} and skip every policy on ${H} \u2014 scoped at the root, unscoped inside an include. `+`Register the class that carries the policy:
12
+
13
+ import { register } from "gemi/orm"
14
+ export class ${H} extends ${G} { \u2026 }
15
+ `+` register("${z}", ${H})
16
+ `:`This query goes through ${H}, but the registry resolves '${z}' to ${G}, which carries policies ${H} does not. Nested relation reads would be scoped and this query is `+"not \u2014 the same policy applying to some queries and not others. "+`Query ${G} instead:
17
+
18
+ ${G}.findMany(\u2026)
19
+
20
+ `+"If skipping policies is intended, say so at the call site \u2014 that "+`is what Model.asSystem() is for, and it is the only way to do it that a reader can see.
21
+ `);this.model=z;this.registered=G;this.queried=H;this.carries=V;this.name="UnregisteredPolicyClassError"}}class p extends Error{model;index;reason;found;suggestion;constructor(z,G,H,V,Z,Y,B){let J=`${z}.$policies[${G}]`,K=Z.length>1?`${Z.slice(0,-1).join(", ")} or ${Z[Z.length-1]}`:Z[0]??"";super(H==="not-a-policy"?`${J} is ${V}, which is not a policy. An entry is either a `+"policy object \u2014 { scope, onCreate, \u2026 } \u2014 or a class the ORM "+`constructs with no arguments.
22
+
23
+ A policy that only sometimes applies belongs in the array rather than in the entry:
24
+
25
+ static $policies = [...(multiTenant ? [tenantScope] : [])]
26
+ `:H==="not-constructable"?`${J} is ${V}, and a function entry is instantiated with `+"no arguments \u2014 so an arrow function, a plain function, or a "+`factory that was never called cannot be one.
27
+
28
+ If it is a factory, call it:
29
+
30
+ static $policies = [softDeletes({ field: "deletedAt" })]
31
+ `:H==="constructor-threw"?`${J} is ${V}
32
+
33
+ A class entry is constructed with no arguments. If this one needs some, construct it yourself and put the instance in the array:
34
+
35
+ static $policies = [new TenantPolicy({ field: "orgId" })]
36
+
37
+ If the constructor reaches for something that is not ready yet, note that it runs on the first query through this model, not at boot.
38
+ `:H==="hook-not-callable"?`${J} has a ${V}, and every hook is called \u2014 so this `+`would throw on the first query that reached it rather than doing whatever it was meant to do. Give it a function, or leave the key out.
39
+ `:`${J} has none of ${K}, so it would never run. The model carries a visible $policies array and nothing in it `+"applies to any query \u2014 which for a scope means the model "+`reads unscoped. ${V}`+(Y?` Is '${Y.key}' meant to be \`${Y.hook}\`?`:"")+`
40
+ `,B);this.model=z;this.index=G;this.reason=H;this.found=V;this.suggestion=Y;this.name="InvalidPolicyEntryError"}}class v extends Error{model;candidates;constructor(z,G){let H=G.map((V)=>`'${V}'`).join(", ");super(`Two classes in one module claim the model '${z}' \u2014 ${H} \u2014 and `+`neither extends the other, so there is no way to tell which one nested relation reads should run.
41
+
42
+ Say which, and registerModels will leave it alone:
43
+
44
+ import { register } from "gemi/orm"
45
+ register("${z}", ${G[0]})
46
+
47
+ A class that is only a typed view over the same rows belongs in a module you do not hand to registerModels.`);this.model=z;this.candidates=G;this.name="AmbiguousModelRegistrationError"}}class S extends Error{model;operation;required;limit;dialect;constructor(z,G,H,V,Z,Y){super(`${z}.${G} would bind ${H} parameters, and the '${Z}' driver accepts at most ${V} in one statement. ${Y}`+(G==="createMany"?" A createMany over the ceiling is normally split across statements inside one transaction, so reaching this means splitting cannot help: a single row binds more than the driver accepts.":" Splitting is not something this operation can do for you \u2014 one "+"statement has to carry one answer. Narrow the query."));this.model=z;this.operation=G;this.required=H;this.limit=V;this.dialect=Z;this.name="ParameterLimitError"}}class m extends Error{model;operation;field;constructor(z,G,H){super(`${z}.${G} is missing a value for '${H}', which is required and has no default.`);this.model=z;this.operation=G;this.field=H;this.name="MissingRequiredValueError"}}class c extends Error{relation;model;constructor(z,G,H){super(`'${z}' is not a relation on model ${G}. `+(H.length>0?`Known relations: ${H.join(", ")}.`:`${G} declares no relations.`));this.relation=z;this.model=G;this.name="UnknownRelationError"}}class u extends Error{model;limit;constructor(z,G){super(`The include tree nests more than ${G} relations deep (at model ${z}). Deeply nested includes are legal, so this is a guard against a generated or malformed argument tree rather than a limit on `+"modelling \u2014 every level costs at least one query.");this.model=z;this.limit=G;this.name="RelationDepthExceededError"}}class d extends Error{model;relation;target;constructor(z,G,H,V){super(`${z}.${G} points at model '${H}', which nothing has registered. The generated artifact and the registry disagree: re-run \`prisma generate\`, and check that app/models/generated/index.ts is imported. `+(V.length>0?`Registered models: ${V.join(", ")}.`:"Nothing is registered at all."));this.model=z;this.relation=G;this.target=H;this.name="UnregisteredRelationTargetError"}}class s extends Error{model;relation;constructor(z,G,H){super(`Cannot resolve how ${z}.${G} joins: ${H} This means `+"app/models/generated is stale or hand-edited \u2014 re-run "+"`prisma generate`.");this.model=z;this.relation=G;this.name="MalformedRelationError"}}class i extends Error{constructor(z,G){super(`No model is registered under the name '${z}'. `+(G.length>0?`Registered models: ${G.join(", ")}.`:"Nothing is registered \u2014 is app/models/generated/index.ts imported?"));this.name="ModelNotRegisteredError"}}class n extends Error{constructor(z){super(`${z} has no $schema. Model subclasses must extend a generated base class from app/models/generated/models.ts.`);this.name="MissingModelSchemaError"}}class o extends Error{model;operation;constructor(z,G){super(`${z}.${G} was given 'lock' outside a transaction. A row lock lasts until the transaction that took it ends, so outside one it is released as soon as the row is read and protects nothing. Run the read and the writes it guards inside Model.transaction(async () => { ... }).`);this.model=z;this.operation=G;this.name="LockOutsideTransactionError"}}function $z(){return{now:new Date,resolved:{}}}var r={now:new Date(0),resolved:{}};function Bz(z){return(G,H=r)=>{let V=[];for(let Z=0;Z<z.length;Z++)V.push(z[Z](G,H));return V}}var _="\x00";function W(z){return{text:z,binders:[]}}function X(z,G=""){return{text:_+G,binders:[z]}}function Jz(z){return z.text.split(_)}function Xz(z,G){return{text:z.join(_),binders:G}}function $(...z){return N(z,"")}function N(z,G){let H="",V=[];for(let Z=0;Z<z.length;Z++){if(Z>0)H+=G;H+=z[Z].text;for(let Y of z[Z].binders)V.push(Y)}return{text:H,binders:V}}function Fz(z,G,H){let V=z.text.split(_),Z=V.length-1;if(Z!==z.binders.length)throw Error(`Compiled ${Z} parameter placeholders but collected ${z.binders.length} binders.`);if(Z>G.maxBoundParameters)throw new S(H.model,H.operation,Z,G.maxBoundParameters,G.name,G.bindsListAsOneParameter?"That is one parameter per value in the statement.":`That is one parameter per value, and on ${G.name} each element of an 'in' list counts separately.`);let Y=V[0];for(let B=0;B<Z;B++)Y+=G.placeholder(B)+V[B+1];return{text:Y,binders:z.binders}}class Q{name="postgres";supportsInsensitiveMode=!0;bindsListAsOneParameter=!0;supportsReturning=!0;maxBoundParameters=65535;typesParametersFromStatement=!0;quoteIdent(z){if(z.includes("\x00"))throw Error(`Refusing to quote the identifier ${JSON.stringify(z)}: it contains a NUL byte, which is reserved as the parameter marker.`);return`"${z.replace(/"/g,'""')}"`}placeholder(z){return`$${z+1}`}inList(z,G,H,V){return $(W(`${z} ${G?"<> all":"= any"} (`),X((Y,B)=>j(V(Y,B))),W(")"))}static COMPOSITE_IN_TYPES={Int:"int",BigInt:"bigint",String:"text",Boolean:"boolean"};canBindCompositeIn(z){return z.length>0&&z.every((G)=>Q.COMPOSITE_IN_TYPES[G])}compositeIn(z,G,H){let V=z.map((Z,Y)=>$(X((B,J)=>j(H(B,J).map((K)=>K[Y]))),W(`::${Q.COMPOSITE_IN_TYPES[G[Y]]}[]`)));return $(W(`(${z.join(", ")}) in (select * from unnest(`),...V.flatMap((Z,Y)=>Y===0?[Z]:[W(", "),Z]),W("))"))}listFilters=new Set(["equals","has","hasEvery","hasSome","isEmpty"]);listHas(z,G){return $(G,W(` = any(${z})`))}listHasEvery(z,G){return $(W(`${z} @> `),G)}listHasSome(z,G){return $(W(`${z} && `),G)}listIsEmpty(z,G){return $(W(`${z} ${G?"=":"<>"} `),X(()=>j([])))}listPush(z,G){return $(W(`array_cat(${z}, `),G,W(")"))}jsonPathSyntax="array";jsonFilters=new Set(["equals","not","string_contains","string_starts_with","string_ends_with","array_contains","lt","lte","gt","gte"]);jsonComparesAsText=!0;jsonExtract(z,G,H){return $(W(`${z} ${H?"#>>":"#>"} `),X((V,Z)=>j(G(V,Z))))}jsonValueAt(z,G){return $(W("("),this.jsonExtract(z,G,!1),W(")::jsonb"))}jsonHasKeys(z,G,H,V){let Z=()=>G===void 0?W(`(${z})::jsonb`):$(W("("),this.jsonExtract(z,G,!1),W(")::jsonb")),Y=V==="one"?$(X(H),W("::text")):$(X((J,K)=>j(H(J,K)??[])),W("::text[]")),B=V==="one"?"?":V==="some"?"?|":"?&";return $(W("(jsonb_typeof("),Z(),W(") = 'object' and "),Z(),W(` ${B} `),Y,W(")"))}distinctFrom(z,G,H){let V=H.type==="Json"&&!H.isList;return $(W(V?`(${z})::jsonb is distinct from `:`${z} is distinct from `),G)}jsonArrayContains(z,G,H){return $(W("("),this.jsonExtract(z,G,!1),W(") @> "),X((V,Z)=>{let Y=H(V,Z);if(Y===null||Y===void 0)return null;return typeof Y==="string"||typeof Y==="object"?Y:JSON.stringify(Y)}),W("::jsonb"))}like(z,G,H){return $(W(`${z} ${G?"ilike":"like"} `),X(H))}ignoreConflicts(){return W(" on conflict do nothing")}rowLock(z,G){let H=z.onLocked==="skipLocked"?" skip locked":z.onLocked==="noWait"?" nowait":"";return W(` for ${z.mode==="share"?"share":"update"} of ${this.quoteIdent(G)}${H}`)}paginate(z,G){let H=[];if(z)H.push($(W(" limit "),X(z)));if(G)H.push($(W(" offset "),X(G)));return $(...H)}constraintViolation(z){let G=z;if(!G)return null;if(String(G.errno??G.code??"")!=="23505")return null;let V=typeof G.constraint==="string"&&G.constraint!==""?G.constraint:void 0,Z=typeof G.detail==="string"?G.detail:"",Y=/\((.+?)\)=/.exec(Z);return{kind:"unique",columns:Y?(Y[1].match(/"(?:[^"]|"")*"|[^,]+/g)??[]).map((J)=>J.trim()).filter((J)=>J!=="").map((J)=>/^".*"$/s.test(J)?J.slice(1,-1).replace(/""/g,'"'):J):[],constraint:V}}castParameter(z){if(z.isList)return"";return z.type==="Json"?"::text::jsonb":""}encode(z,G){if(z===null||z===void 0)return null;if(G.isList){if(!Array.isArray(z))throw Error(`gemi ORM bug: a non-array reached the parameter binder for the scalar list '${G.column}' (received ${typeof z}). Every path that binds a list is supposed to have checked its operand.`);return j(G.type==="Json"?z.map((H)=>H===null||H===void 0?null:JSON.stringify(H)):z)}return z}encodeUntyped(z){return z}needsDecode(z){return z.isList===!0||z.type==="BigInt"||z.type==="Bytes"}decode(z,G){if(z===null||z===void 0)return null;if(G.isList)return this.decodeList(z,G);return this.decodeScalar(z,G)}decodeList(z,G){let H=Array.isArray(z)?z:typeof z==="string"?l(z,G):ArrayBuffer.isView(z)?Array.from(z):null;if(H===null)throw new F(G,z);return H.map((V)=>V===null||V===void 0?null:this.decodeScalar(V,G))}decodeScalar(z,G){switch(G.type){case"BigInt":if(typeof z==="bigint")return z;try{return BigInt(z)}catch{throw new F(G,z)}case"Json":return z;case"Bytes":return Buffer.isBuffer(z)?new Uint8Array(z.buffer,z.byteOffset,z.byteLength):z;default:return z}}}function j(z){let G="{";for(let H=0;H<z.length;H++){if(H>0)G+=",";G+=t(z[H])}return G+"}"}function t(z){if(z===null||z===void 0)return"NULL";if(z instanceof Date)return`"${z.toISOString()}"`;if(ArrayBuffer.isView(z)){let H="";for(let V of new Uint8Array(z.buffer,z.byteOffset,z.byteLength))H+=V.toString(16).padStart(2,"0");return`"\\\\x${H}"`}return`"${(typeof z==="string"?z:String(z)).replace(/\\/g,"\\\\").replace(/"/g,"\\\"")}"`}function l(z,G){if(!z.startsWith("{")||!z.endsWith("}"))throw new F(G,z);if(z==="{}")return[];let H=[],V=1,Z=z.length-1;while(V<=Z){let Y="",B=!1;if(z[V]==='"'){B=!0,V++;while(V<Z&&z[V]!=='"')Y+=z[V]==="\\"?z[++V]:z[V],V++;V++}else while(V<Z&&z[V]!==","){if(z[V]==="{")throw new F(G,z);Y+=z[V],V++}if(H.push(!B&&Y.toUpperCase()==="NULL"?null:Y),V<Z&&z[V]!==",")throw new F(G,z);V++}if(G.type!=="Json")return H;return H.map((Y)=>{if(Y===null)return null;try{return JSON.parse(Y)}catch{throw new F(G,Y)}})}var a={"Prisma.DbNull":"db","Prisma.JsonNull":"json","Prisma.AnyNull":"any"};function T(z){return new class{toString(){return z}}}var Qz=T("Prisma.DbNull"),e=T("Prisma.JsonNull"),Iz=T("Prisma.AnyNull"),_z=e;function E(z){if(typeof z!=="object"||z===null)return null;for(let H in z)return null;if(Object.getOwnPropertyNames(z).length>0)return null;let G;try{G=String(z)}catch{return null}return a[G]??null}var zz=/^\d{4}-\d{2}-\d{2}[ T]\d{2}:\d{2}:\d{2}(\.\d+)?$/;function Gz(z,G){if(z instanceof Date)return z;let H;if(typeof z==="number")H=new Date(z);else if(typeof z==="bigint")H=new Date(Number(z));else if(typeof z==="string")H=new Date(zz.test(z)?`${z.replace(" ","T")}Z`:z);else throw new F(G,z);if(Number.isNaN(H.getTime()))throw new F(G,z);return H}class M{name="sqlite";supportsInsensitiveMode=!1;bindsListAsOneParameter=!1;supportsReturning=!0;maxBoundParameters=32766;typesParametersFromStatement=!1;quoteIdent(z){if(z.includes("\x00"))throw Error(`Refusing to quote the identifier ${JSON.stringify(z)}: it contains a NUL byte, which is reserved as the parameter marker.`);return`"${z.replace(/"/g,'""')}"`}placeholder(z){return"?"}inList(z,G,H,V){let Z=G?"not in":"in",Y=[];for(let B=0;B<H;B++)Y.push(X((J,K)=>V(J,K)[B]));return $(W(`${z} ${Z} (`),N(Y,", "),W(")"))}canBindCompositeIn(){return!1}compositeIn(){throw Error("SQLite cannot bind a composite `in`; `canBindCompositeIn` is the guard.")}listFilters=new Set;listHas(){throw Error(I("has"))}listHasEvery(){throw Error(I("hasEvery"))}listHasSome(){throw Error(I("hasSome"))}listIsEmpty(){throw Error(I("isEmpty"))}listPush(){throw Error(I("push"))}jsonPathSyntax="jsonpath";jsonFilters=new Set(["equals","not","string_contains","string_starts_with","string_ends_with"]);jsonComparesAsText=!1;jsonExtract(z,G,H){return $(W(`json_extract(${z}, `),X(G),W(")"))}jsonValueAt(z,G){return $(W(`(${z} -> `),X(G),W(")"))}jsonHasKeys(z,G,H,V,Z){let Y=(C,O)=>G===void 0?"$":G(C,O),B=(C)=>$(W(`json_type(${z}, `),X((O,A)=>{let L=H(O,A),y=C===void 0?L:L[C];return`${Y(O,A)}.${JSON.stringify(String(y))}`}),W(") is not null")),J=V==="one"?[B(void 0)]:Array.from({length:Z},(C,O)=>B(O)),K=J.length===0?W(V==="some"?"0":"1"):N(J,V==="every"?" and ":" or ");return $(W(`(json_type(${z}, `),X(Y),W(") = 'object' and ("),K,W("))"))}distinctFrom(z,G,H){if(H.type==="Json"&&!H.isList)return $(W(`json(${z}) is not json(`),G,W(")"));return $(W(`${z} is not `),G)}jsonArrayContains(){throw Error("SQLite cannot express array_contains; `jsonFilters` is the guard.")}like(z,G,H){return $(W(`${z} like `),X(H))}ignoreConflicts(){return null}rowLock(z,G){return W("")}paginate(z,G){if(!z&&!G)return W("");if(!G)return $(W(" limit "),X(z));return $(W(" limit "),X(z??(()=>-1)),W(" offset "),X(G))}constraintViolation(z){let G=z?.code;if(G!=="SQLITE_CONSTRAINT_UNIQUE"&&G!=="SQLITE_CONSTRAINT_PRIMARYKEY")return null;let H=String(z.message??""),V=/constraint failed:\s*(.+)$/.exec(H);if(!V)return{kind:"unique",columns:[]};return{kind:"unique",columns:V[1].split(",").map((Y)=>Y.trim()).map((Y)=>{let B=Y.indexOf(".");return B===-1?Y:Y.slice(B+1)}).filter((Y)=>Y!=="")}}castParameter(z){return""}encode(z,G){if(z===null||z===void 0)return null;switch(G.type){case"DateTime":return z instanceof Date?z.getTime():z;case"Boolean":return typeof z==="boolean"?z?1:0:z;case"Json":{let H=E(z);if(H==="db")return null;if(H==="json")return"null";if(H==="any")throw Error("gemi ORM bug: Prisma.AnyNull reached the SQLite encoder. It is a filter operand only, and both the filter and write paths are supposed to have handled it before this point.")}return JSON.stringify(z);default:return z}}encodeUntyped(z){if(z instanceof Date)return z.getTime();if(typeof z==="boolean")return z?1:0;return z}needsDecode(z){switch(z.type){case"DateTime":case"Boolean":case"BigInt":case"Json":return!0;default:return!1}}decode(z,G){if(z===null||z===void 0)return null;switch(G.type){case"DateTime":return Gz(z,G);case"Boolean":if(typeof z==="boolean")return z;return Number(z)!==0;case"BigInt":if(typeof z==="bigint")return z;try{return BigInt(z)}catch{throw new F(G,z)}case"Json":try{return typeof z==="string"?JSON.parse(z):z}catch{throw new F(G,z)}default:return z}}}function I(z){return`SQLite has no array type, so it cannot express '${z}' on a scalar list; \`listFilters\` is the guard.`}class w extends Error{constructor(z){super(`The gemi ORM does not support the '${z}' dialect. Only sqlite `+"and postgres are implemented \u2014 see the supported matrix in "+`docs/orm.md.
48
+
49
+ The *connection* is fine: Bun's client speaks ${z}, so raw SQL through DB.query / DB.sql and transactions all work. It is the query compiler that has no ${z} dialect, so every model operation raises this.
50
+
51
+ Point DATABASE_URL at Postgres or SQLite to use the ORM, or keep using Prisma's own client for this database.`);this.name="UnsupportedDialectError"}}function Rz(z){return P[z]!==null}function bz(){return Object.keys(P)}var P={sqlite:new M,postgres:new Q,mysql:null,mariadb:null};function Dz(z){let G=P[z];if(G===null)throw new w(z);return G}
52
+ export{U as Sd,k as Td,q as Ud,h as Vd,F as Wd,R as Xd,Hz as Yd,b as Zd,Vz as _d,x as $d,D as ae,Wz as be,g as ce,f as de,p as ee,v as fe,S as ge,m as he,c as ie,u as je,d as ke,s as le,i as me,n as ne,o as oe,$z as pe,Bz as qe,W as re,X as se,Jz as te,Xz as ue,$ as ve,N as we,Fz as xe,Q as ye,Qz as ze,e as Ae,Iz as Be,_z as Ce,E as De,M as Ee,w as Fe,Rz as Ge,bz as He,Dz as Ie};
53
+
54
+ //# debugId=A79A4AB50179792D64756E2164756E21