gemi 0.69.0 → 0.69.1

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.
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{i as k,j as l}from"./chunk-mjdt9c94.js";import{ka as F,oa as L,pa as c}from"./chunk-zq5m4scz.js";import"./chunk-8z37k28d.js";import{gd as I,kd as E,ld as T}from"./chunk-rnpc26wd.js";import"./chunk-t29t96a3.js";import"./chunk-e2ycfg1s.js";import"./chunk-qz8n10v1.js";import"./chunk-kqqj907k.js";import"./chunk-zds05es5.js";import"./chunk-8n8efq3e.js";import"./chunk-heq6gzp4.js";import"./chunk-5hyfe7b3.js";import"./chunk-17grdzh5.js";import"./chunk-1ethvybg.js";import"./chunk-43xykgzb.js";import"./chunk-wdvv88da.js";import{sg as h}from"./chunk-e5vt4nq9.js";import{tg as P}from"./chunk-pzhzjx6h.js";import"./chunk-9x3gr8k7.js";import{join as A,resolve as CJ,sep as IJ}from"path";import{Duplex as JJ}from"stream";import{constants as C,createBrotliCompress as $J,createGzip as XJ}from"zlib";var ZJ=["br","gzip"],zJ=1024,GJ=5,jJ=19,xJ=6;function HJ(J){if(J===void 0)return 1;if(!/^\d+(\.\d{0,3})?$/.test(J.trim()))return 1;let $=Number(J.trim());return Number.isFinite($)?Math.min($,1):1}function QJ(J){if(J===null||J===void 0)return null;let $=new Map;for(let X of J.split(",")){let[z,...x]=X.split(";"),W=z.trim().toLowerCase();if(W==="")continue;let Q=1;for(let H of x){let Y=H.indexOf("=");if(Y===-1)continue;if(H.slice(0,Y).trim().toLowerCase()==="q"){Q=HJ(H.slice(Y+1));break}}$.set(W,Q)}return $}function WJ(J,$=ZJ){let X=QJ(J);if(!X)return null;let z=X.get("*"),x=null,W=0;for(let Q of $){let H=X.get(Q)??z??0;if(H>W)x=Q,W=H}return x}function OJ(J,$){if(!J)return!1;return J.split(",").some((X)=>X.trim().toLowerCase().split("=")[0].trim()===$)}function KJ(J,$){if(J==="HEAD")return!1;if(!$.body)return!1;if($.status<200||$.status===204||$.status===206||$.status===304)return!1;if($.headers.has("Content-Range"))return!1;let X=$.headers.get("Content-Type");if(!X||!/^\s*text\/html\s*(;|$)/i.test(X))return!1;let z=$.headers.get("Content-Encoding");if(z&&z.trim().toLowerCase()!=="identity")return!1;if(OJ($.headers.get("Cache-Control"),"no-transform"))return!1;let x=$.headers.get("Content-Length");if(x!==null&&Number(x)<zJ)return!1;return!0}function UJ(J){let $=J==="br"?$J({params:{[C.BROTLI_PARAM_QUALITY]:GJ,[C.BROTLI_PARAM_LGWIN]:jJ},flush:C.BROTLI_OPERATION_FLUSH}):XJ({level:xJ,flush:C.Z_SYNC_FLUSH});return JJ.toWeb($)}function YJ(J){let $=J.get("Vary");if(!$){J.set("Vary","Accept-Encoding");return}let X=$.split(",").map((z)=>z.trim().toLowerCase());if(X.includes("*")||X.includes("accept-encoding"))return;J.append("Vary","Accept-Encoding")}function q(J,$){if(!KJ(J.method,$))return $;let X=new Headers($.headers);YJ(X);let z=WJ(J.headers.get("Accept-Encoding"));if(!z)return new Response($.body,{status:$.status,statusText:$.statusText,headers:X});let x;try{x=UJ(z)}catch{return new Response($.body,{status:$.status,statusText:$.statusText,headers:X})}return X.set("Content-Encoding",z),X.delete("Content-Length"),new Response($.body.pipeThrough(x),{status:$.status,statusText:$.statusText,headers:X})}function v(J){let $=J.toString(),X=new Bun.CryptoHasher("sha1");return X.update($),X.digest("hex")}if(!globalThis.URLPattern)globalThis.URLPattern=I;import{stat as SJ}from"fs/promises";var S="app/client.tsx";function f(J,$=F){let X=J[S]?.file;if(!X)return;return{module:L(X,$),preload:R(J,S,$)}}function R(J,$,X=F){let z=[],x=new Set,W=(Q)=>{if(x.has(Q))return;x.add(Q);let H=J[Q];if(!H?.file)return;z.push(L(H.file,X));for(let Y of H.imports??[])W(Y)};return W($),z}var bJ=new RegExp(`^${E}/.+\\.m?js$`);function LJ(J){return bJ.test(J)}function u(J){if(LJ(J))return new Response("window.location.reload();export {}",{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store"}});if(T(J))return new Response("Not found",{status:404});return}var VJ=`<!DOCTYPE html>
2
+ import{i as k,j as l}from"./chunk-tthppwcz.js";import{ka as F,oa as L,pa as c}from"./chunk-zq5m4scz.js";import"./chunk-8z37k28d.js";import{gd as I,kd as E,ld as T}from"./chunk-a0m2m20v.js";import"./chunk-t29t96a3.js";import"./chunk-e2ycfg1s.js";import"./chunk-qz8n10v1.js";import"./chunk-kqqj907k.js";import"./chunk-zds05es5.js";import"./chunk-8n8efq3e.js";import"./chunk-heq6gzp4.js";import"./chunk-5hyfe7b3.js";import"./chunk-17grdzh5.js";import"./chunk-1ethvybg.js";import"./chunk-43xykgzb.js";import"./chunk-wdvv88da.js";import{sg as h}from"./chunk-e5vt4nq9.js";import{tg as P}from"./chunk-pzhzjx6h.js";import"./chunk-9x3gr8k7.js";import{join as A,resolve as CJ,sep as IJ}from"path";import{Duplex as JJ}from"stream";import{constants as C,createBrotliCompress as $J,createGzip as XJ}from"zlib";var ZJ=["br","gzip"],zJ=1024,GJ=5,jJ=19,xJ=6;function HJ(J){if(J===void 0)return 1;if(!/^\d+(\.\d{0,3})?$/.test(J.trim()))return 1;let $=Number(J.trim());return Number.isFinite($)?Math.min($,1):1}function QJ(J){if(J===null||J===void 0)return null;let $=new Map;for(let X of J.split(",")){let[z,...x]=X.split(";"),W=z.trim().toLowerCase();if(W==="")continue;let Q=1;for(let H of x){let Y=H.indexOf("=");if(Y===-1)continue;if(H.slice(0,Y).trim().toLowerCase()==="q"){Q=HJ(H.slice(Y+1));break}}$.set(W,Q)}return $}function WJ(J,$=ZJ){let X=QJ(J);if(!X)return null;let z=X.get("*"),x=null,W=0;for(let Q of $){let H=X.get(Q)??z??0;if(H>W)x=Q,W=H}return x}function OJ(J,$){if(!J)return!1;return J.split(",").some((X)=>X.trim().toLowerCase().split("=")[0].trim()===$)}function KJ(J,$){if(J==="HEAD")return!1;if(!$.body)return!1;if($.status<200||$.status===204||$.status===206||$.status===304)return!1;if($.headers.has("Content-Range"))return!1;let X=$.headers.get("Content-Type");if(!X||!/^\s*text\/html\s*(;|$)/i.test(X))return!1;let z=$.headers.get("Content-Encoding");if(z&&z.trim().toLowerCase()!=="identity")return!1;if(OJ($.headers.get("Cache-Control"),"no-transform"))return!1;let x=$.headers.get("Content-Length");if(x!==null&&Number(x)<zJ)return!1;return!0}function UJ(J){let $=J==="br"?$J({params:{[C.BROTLI_PARAM_QUALITY]:GJ,[C.BROTLI_PARAM_LGWIN]:jJ},flush:C.BROTLI_OPERATION_FLUSH}):XJ({level:xJ,flush:C.Z_SYNC_FLUSH});return JJ.toWeb($)}function YJ(J){let $=J.get("Vary");if(!$){J.set("Vary","Accept-Encoding");return}let X=$.split(",").map((z)=>z.trim().toLowerCase());if(X.includes("*")||X.includes("accept-encoding"))return;J.append("Vary","Accept-Encoding")}function q(J,$){if(!KJ(J.method,$))return $;let X=new Headers($.headers);YJ(X);let z=WJ(J.headers.get("Accept-Encoding"));if(!z)return new Response($.body,{status:$.status,statusText:$.statusText,headers:X});let x;try{x=UJ(z)}catch{return new Response($.body,{status:$.status,statusText:$.statusText,headers:X})}return X.set("Content-Encoding",z),X.delete("Content-Length"),new Response($.body.pipeThrough(x),{status:$.status,statusText:$.statusText,headers:X})}function v(J){let $=J.toString(),X=new Bun.CryptoHasher("sha1");return X.update($),X.digest("hex")}if(!globalThis.URLPattern)globalThis.URLPattern=I;import{stat as SJ}from"fs/promises";var S="app/client.tsx";function f(J,$=F){let X=J[S]?.file;if(!X)return;return{module:L(X,$),preload:R(J,S,$)}}function R(J,$,X=F){let z=[],x=new Set,W=(Q)=>{if(x.has(Q))return;x.add(Q);let H=J[Q];if(!H?.file)return;z.push(L(H.file,X));for(let Y of H.imports??[])W(Y)};return W($),z}var bJ=new RegExp(`^${E}/.+\\.m?js$`);function LJ(J){return bJ.test(J)}function u(J){if(LJ(J))return new Response("window.location.reload();export {}",{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store"}});if(T(J))return new Response("Not found",{status:404});return}var VJ=`<!DOCTYPE html>
3
3
  <html lang="en">
4
4
  <head>
5
5
  <meta charset="UTF-8" />
@@ -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 l of e)u.add(l)}let r=[],p=[],g={};for(let t of u)if(t)for(let e of t.importedModules){if(e.file.includes("module.css"))g[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"),l=t.includes("module.css"),o="";if(l)o=h(g[t],e.default);r.push({isDev:!0,id:t,content:l?o: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.69.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","./broadcasting":"./broadcasting/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),a=(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}`,g=["",...q.map((t)=>T(t)),"",` ${d("gemi")} ${a(`v${R()}`)}`,"",p("Local:",a(b)),p("Network:",u?a(u):d("unavailable")),p("Env:",r.length?r.join(", "):d("none")),""];console.log(g.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 l of e)u.add(l)}let r=[],p=[],g={};for(let t of u)if(t)for(let e of t.importedModules){if(e.file.includes("module.css"))g[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"),l=t.includes("module.css"),o="";if(l)o=h(g[t],e.default);r.push({isDev:!0,id:t,content:l?o: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.69.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","./broadcasting":"./broadcasting/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),a=(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}`,g=["",...q.map((t)=>T(t)),"",` ${d("gemi")} ${a(`v${R()}`)}`,"",p("Local:",a(b)),p("Network:",u?a(u):d("unavailable")),p("Env:",r.length?r.join(", "):d("none")),""];console.log(g.join(`
3
3
  `))}
4
4
  export{J as h,L as i,A as j};
5
5
 
6
- //# debugId=186DA2CF0010BF2964756E2164756E21
6
+ //# debugId=D8B65C1FD4318B3564756E2164756E21
@@ -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": ";yCAAA,wBAAS,cAGT,SAAS,CAAc,CAAC,EAAc,EAAwC,CAC5E,IAAM,EAAc,OAAO,KAAK,CAAM,EACnC,KAAK,CAAC,EAAG,IAAM,EAAE,OAAS,EAAE,MAAM,EAClC,IAAI,CAAC,IAAQ,EAAI,QAAQ,sBAAuB,MAAM,CAAC,EAGpD,EAAQ,IAAI,OAAO,EAAY,KAAK,GAAG,EAAG,GAAG,EAEnD,OAAO,EAAK,QAAQ,EAAO,CAAC,IAAU,EAAO,EAAM,EAGrD,eAAsB,CAAe,CACnC,EACA,EACA,EAAyB,CAAC,EAC1B,CACA,IAAM,EAAQ,CACZ,GAAG,EAAa,IAAI,CAAC,IAAS,GAAG,WAAgB,OAAU,EAC3D,GAAG,wBACL,EAEM,EAAU,IAAI,IACpB,QAAW,KAAQ,EAAO,CACxB,IAAM,EAAM,EAAK,YAAY,iBAAiB,CAAI,EAClD,GAAI,EACF,QAAW,KAAK,EAAK,EAAQ,IAAI,CAAC,EAItC,IAAM,EAAS,CAAC,EACV,EAAa,CAAC,EACd,EAA2C,CAAC,EAClD,QAAW,KAAO,EAChB,GAAI,EACF,QAAW,KAAY,EAAI,gBAAiB,CAC1C,GAAI,EAAS,KAAK,SAAS,YAAY,EACrC,EAAiB,EAAS,MAAQ,EAAS,mBAAmB,IAAI,eAAe,KAAK,EAAE,EAE1F,GAAI,EAAS,KAAK,SAAS,MAAM,EAC/B,EAAW,KAAK,EAAS,IAAI,EAMrC,QAAW,KAAiB,EAAY,CACtC,IAAM,EAAY,MAAM,EAAK,iBAAiB,EAAgB,SAAS,EAEjE,EAAc,EAAc,SAAS,YAAY,EAEnD,EAAuB,GAE3B,GAAI,EACF,EAAuB,EACrB,EAAiB,GAGhB,EAA6D,OAChE,EAGF,EAAO,KAAK,CACV,MAAO,GACP,GAAI,EACJ,QAAS,EAAc,EAAuB,EAAU,IAC1D,CAAC,EAGH,OAAO,EAAO,IAAI,CAAC,EAAO,IAAM,CAC9B,OAAO,EAAc,QAAS,CAC5B,IAAK,EACL,KAAM,WACN,mBAAoB,EAAM,GAC1B,wBAAyB,CAAE,OAAQ,EAAM,OAAQ,CACnD,CAAC,EACF,EAGH,eAAsB,CAAY,CAAC,EAAS,CAAC,EAAG,CAC9C,OAAO,EAAO,IAAI,CAAC,EAAO,IAAM,CAC9B,OAAO,EAAc,QAAS,CAC5B,IAAK,EACL,GAAI,GAAO,GACX,KAAM,WACN,wBAAyB,CAAE,OAAQ,EAAM,OAAQ,CACnD,CAAC,EACF,ECzFH,qBAAS,WACT,mBAAS,aACT,4BAAS,2rHAKT,IAAM,EAAM,CACV,oKACA,mLACA,yKACA,oKACA,mLACA,yJACF,EAEM,EAAW,QAAQ,QAAQ,OAAO,KAAK,GAAK,CAAC,QAAQ,IAAI,SACzD,EAAQ,CAAC,EAAc,IAC3B,EAAW,QAAQ,KAAQ,WAAgB,EACvC,EAAO,CAAC,IAAc,EAAM,IAAK,CAAC,EAClC,EAAM,CAAC,IAAc,EAAM,IAAK,CAAC,EACjC,EAAO,CAAC,IAAc,EAAM,KAAM,CAAC,EACnC,EAAQ,CAAC,IAAc,EAAM,KAAM,CAAC,EACpC,EAAU,CAAC,IAAc,EAAM,KAAM,CAAC,EAE5C,SAAS,CAAW,EAAW,CAC7B,OAAQ,EAA6B,SAAW,IAGlD,SAAS,CAAU,CAAC,EAAsC,CACxD,QAAW,KAAU,OAAO,OAAO,EAAkB,CAAC,EACpD,QAAW,KAAS,GAAU,CAAC,EAG7B,IADa,EAAM,SAAW,QAAW,EAAM,SAAuB,IAC1D,CAAC,EAAM,SAAU,MAAO,UAAU,EAAM,WAAW,IAGnE,OAAO,KAGT,SAAS,CAAc,CAAC,EAA2B,CACjD,OAAO,EAAS,CAAO,EACpB,OAAO,CAAC,IAAS,EAAW,CAAI,CAAC,EACjC,IAAI,CAAC,IAAS,EAAS,CAAI,CAAC,EAG1B,SAAS,CAAkB,CAAC,EAGhC,CACD,IAAQ,OAAM,WAAY,EACpB,EAAQ,oBAAoB,IAC5B,EAAU,EAAW,CAAI,EACzB,EAAM,EAAe,CAAO,EAE5B,EAAM,CAAC,EAAe,IAC1B,KAAK,EAAM,QAAE,MAAM,EAAK,EAAM,OAAO,CAAC,CAAC,IAAI,IAEvC,EAAM,CACV,GACA,GAAG,EAAI,IAAI,CAAC,IAAS,EAAQ,CAAI,CAAC,EAClC,GACA,KAAK,EAAI,MAAM,KAAK,EAAK,IAAI,EAAY,GAAG,IAC5C,GACA,EAAI,SAAU,EAAK,CAAK,CAAC,EACzB,EAAI,WAAY,EAAU,EAAK,CAAO,EAAI,EAAI,aAAa,CAAC,EAC5D,EAAI,OAAQ,EAAI,OAAS,EAAI,KAAK,IAAI,EAAI,EAAI,MAAM,CAAC,EACrD,EACF,EAEA,QAAQ,IAAI,EAAI,KAAK;AAAA,CAAI,CAAC",
9
- "debugId": "186DA2CF0010BF2964756E2164756E21",
9
+ "debugId": "D8B65C1FD4318B3564756E2164756E21",
10
10
  "names": []
11
11
  }
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{Ac as c,Bc as d,Cc as e,Dc as g,Ec as h,Gc as i,Hc as j,Ic as k,Kc as l,Mc as m,Wc as n,Xc as o,Yc as p,qc as a}from"../chunk-rnpc26wd.js";import"../chunk-t29t96a3.js";import"../chunk-e2ycfg1s.js";import{$e as b,gf as f}from"../chunk-qz8n10v1.js";import"../chunk-kqqj907k.js";import"../chunk-zds05es5.js";import"../chunk-8n8efq3e.js";import"../chunk-heq6gzp4.js";import"../chunk-5hyfe7b3.js";import"../chunk-17grdzh5.js";import"../chunk-1ethvybg.js";import"../chunk-43xykgzb.js";import"../chunk-wdvv88da.js";import"../chunk-e5vt4nq9.js";import"../chunk-pzhzjx6h.js";import"../chunk-9x3gr8k7.js";export{h as Url,f as Storage,l as Redis,a as Redirect,m as RateLimiter,g as Query,j as Meta,i as Log,e as Lang,n as Features,b as Facade,p as DB,k as Cookie,o as ConnectionQueries,c as Broadcast,d as Auth};
2
+ import{Ac as c,Bc as d,Cc as e,Dc as g,Ec as h,Gc as i,Hc as j,Ic as k,Kc as l,Mc as m,Wc as n,Xc as o,Yc as p,qc as a}from"../chunk-a0m2m20v.js";import"../chunk-t29t96a3.js";import"../chunk-e2ycfg1s.js";import{$e as b,gf as f}from"../chunk-qz8n10v1.js";import"../chunk-kqqj907k.js";import"../chunk-zds05es5.js";import"../chunk-8n8efq3e.js";import"../chunk-heq6gzp4.js";import"../chunk-5hyfe7b3.js";import"../chunk-17grdzh5.js";import"../chunk-1ethvybg.js";import"../chunk-43xykgzb.js";import"../chunk-wdvv88da.js";import"../chunk-e5vt4nq9.js";import"../chunk-pzhzjx6h.js";import"../chunk-9x3gr8k7.js";export{h as Url,f as Storage,l as Redis,a as Redirect,m as RateLimiter,g as Query,j as Meta,i as Log,e as Lang,n as Features,b as Facade,p as DB,k as Cookie,o as ConnectionQueries,c as Broadcast,d as Auth};
3
3
 
4
4
  //# debugId=AE8355088FAF449064756E2164756E21
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{Ad as H,Bd as I,Cd as J,Dd as K,kc as m,lc as n,mc as o,nc as u,oc as v,pc as w,pd as C,qd as D,rc as x,rd as E,sc as y,tc as z,uc as A,vc as B,yd as F,zd as G}from"../chunk-rnpc26wd.js";import"../chunk-t29t96a3.js";import"../chunk-e2ycfg1s.js";import{Ee as a,Fe as b,He as c,Ke as d,Le as e,Me as f,Ne as g,Oe as h,Pe as i,Te as j,Ue as k,Ve as l,We as p,Xe as q,Ye as r,Ze as s,_e as t}from"../chunk-qz8n10v1.js";import"../chunk-kqqj907k.js";import"../chunk-zds05es5.js";import"../chunk-8n8efq3e.js";import"../chunk-heq6gzp4.js";import"../chunk-5hyfe7b3.js";import"../chunk-17grdzh5.js";import"../chunk-1ethvybg.js";import"../chunk-43xykgzb.js";import"../chunk-wdvv88da.js";import"../chunk-e5vt4nq9.js";import"../chunk-pzhzjx6h.js";import"../chunk-9x3gr8k7.js";export{f as toRangeHeaderValue,m as toMiddlewareList,e as resolveRange,d as parseRangeHeader,g as parseContentRange,B as middlewareConfigDefaults,c as getCookies,i as formatUnsatisfiedContentRange,h as formatContentRange,A as defineMiddlewareConfig,n as createUnsatisfiableResponse,o as createStreamResponse,x as createFileResponse,E as clientIp,y as ViewRouter,k as ValidationError,b as ResourceController,j as RequestBreakerError,D as RateLimitMiddleware,C as RateLimitExceededError,r as RangeNotSatisfiableError,J as PoliciesServiceProvider,K as Policies,z as Middleware,w as McpRouter,v as McpRouteDeclaration,q as InsufficientPermissionsError,l as HttpRequest,s as FileNotFoundError,H as CorsMiddleware,a as Controller,G as CacheMiddleware,I as CSRFMiddleware,p as AuthorizationError,F as AuthenticationMiddleware,t as AuthenticationError,u as ApiRouter};
2
+ import{Ad as H,Bd as I,Cd as J,Dd as K,kc as m,lc as n,mc as o,nc as u,oc as v,pc as w,pd as C,qd as D,rc as x,rd as E,sc as y,tc as z,uc as A,vc as B,yd as F,zd as G}from"../chunk-a0m2m20v.js";import"../chunk-t29t96a3.js";import"../chunk-e2ycfg1s.js";import{Ee as a,Fe as b,He as c,Ke as d,Le as e,Me as f,Ne as g,Oe as h,Pe as i,Te as j,Ue as k,Ve as l,We as p,Xe as q,Ye as r,Ze as s,_e as t}from"../chunk-qz8n10v1.js";import"../chunk-kqqj907k.js";import"../chunk-zds05es5.js";import"../chunk-8n8efq3e.js";import"../chunk-heq6gzp4.js";import"../chunk-5hyfe7b3.js";import"../chunk-17grdzh5.js";import"../chunk-1ethvybg.js";import"../chunk-43xykgzb.js";import"../chunk-wdvv88da.js";import"../chunk-e5vt4nq9.js";import"../chunk-pzhzjx6h.js";import"../chunk-9x3gr8k7.js";export{f as toRangeHeaderValue,m as toMiddlewareList,e as resolveRange,d as parseRangeHeader,g as parseContentRange,B as middlewareConfigDefaults,c as getCookies,i as formatUnsatisfiedContentRange,h as formatContentRange,A as defineMiddlewareConfig,n as createUnsatisfiableResponse,o as createStreamResponse,x as createFileResponse,E as clientIp,y as ViewRouter,k as ValidationError,b as ResourceController,j as RequestBreakerError,D as RateLimitMiddleware,C as RateLimitExceededError,r as RangeNotSatisfiableError,J as PoliciesServiceProvider,K as Policies,z as Middleware,w as McpRouter,v as McpRouteDeclaration,q as InsufficientPermissionsError,l as HttpRequest,s as FileNotFoundError,H as CorsMiddleware,a as Controller,G as CacheMiddleware,I as CSRFMiddleware,p as AuthorizationError,F as AuthenticationMiddleware,t as AuthenticationError,u as ApiRouter};
3
3
 
4
4
  //# debugId=CA0FA0B0F5915CFD64756E2164756E21
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{aa as R}from"../chunk-jctjvgat.js";import"../chunk-9a8qz3s7.js";import{Wa as L}from"../chunk-654312qd.js";import{hc as E,ic as V}from"../chunk-p0m3qgs5.js";import"../chunk-z4k18gnp.js";import{Cc as j}from"../chunk-rnpc26wd.js";import"../chunk-t29t96a3.js";import"../chunk-e2ycfg1s.js";import"../chunk-qz8n10v1.js";import"../chunk-kqqj907k.js";import"../chunk-zds05es5.js";import"../chunk-8n8efq3e.js";import"../chunk-heq6gzp4.js";import"../chunk-5hyfe7b3.js";import{cg as X}from"../chunk-17grdzh5.js";import"../chunk-1ethvybg.js";import"../chunk-43xykgzb.js";import"../chunk-wdvv88da.js";import"../chunk-e5vt4nq9.js";import"../chunk-pzhzjx6h.js";import"../chunk-9x3gr8k7.js";import{createElement as J,Fragment as M,isValidElement as U}from"react";function $(q,B){let G=Object.values(B).some((z)=>typeof z==="function"&&U(z(""))),Q=/{{([^{}]+?)(?::([^{}\[\]]+?))?(?:\[(.*?)\])?}}/g;if(!G)return q.replace(Q,(W,O,_,Z)=>{let C=O.includes(":")?O.split(":")[0]:O,H=B[C];if(H===void 0)return W;if(typeof H==="function"){let K=H(Z!==void 0?Z:"");if(U(K))throw Error("JSX returned in string context");return String(K)}if(_)switch(_.toLowerCase()){case"number":return Number(H).toString();case"string":return String(H);case"boolean":return Boolean(H).toString();default:return String(H)}return String(H)});else{let z=[],W=0,O=null;while((O=Q.exec(q))!==null){let[_,Z,C,H]=O,F=O.index,K=Z.includes(":")?Z.split(":")[0]:Z;if(F>W)z.push(q.substring(W,F));let Y=B[K];if(Y===void 0)z.push(_);else if(typeof Y==="function"){let A=Y(H!==void 0?H:"");z.push(A)}else if(C)switch(C.toLowerCase()){case"number":z.push(Number(Y).toString());break;case"string":z.push(String(Y));break;case"boolean":z.push(Boolean(Y).toString());break;default:z.push(String(Y))}else z.push(String(Y));W=F+_.length}if(W<q.length)z.push(q.substring(W));return J(M,{},...z)}}class P{name;dictionary;constructor(q,B){this.name=q;this.dictionary=B}reference(q){if(typeof window<"u")throw Error("Cannot use reference in the browser");if(!this.dictionary?.[q])throw Error(`Translation not found for ${String(q)}`);return this.dictionary[q]}render(q,...B){let{locale:G=j.locale(),params:Q}={params:{},...B[0]};if(typeof window<"u")throw Error("Cannot use render in the browser");if(!this.dictionary?.[q]?.[G])throw Error(`Translation not found for ${String(q)} in ${String(G)}`);return $(this.dictionary[q][G],Q??{})}static create(q,B){return new P(q,B)}static text(q,...B){let{locale:G=j.locale(),params:Q}={params:{},...B?.[0]};if(!q?.[G])throw Error(`Translation not found for ${String(G)}`);return $(q[G],Q??{})}}async function N(q,B,...G){let{locale:Q=j.locale(),params:z}={params:{},...G[0]},O=(await q.load(String(Q)))[B];if(typeof O!=="string")throw Error(`Translation not found for "${B}" in "${String(Q)}" (dictionary ${q.id})`);return $(O,z??{})}export{V as translationConfigDefaults,N as translate,E as defineTranslationConfig,R as defineDictionary,X as Translator,L as TranslationServiceProvider,P as Dictionary};
2
+ import{aa as R}from"../chunk-jctjvgat.js";import"../chunk-9a8qz3s7.js";import{Wa as L}from"../chunk-654312qd.js";import{hc as E,ic as V}from"../chunk-p0m3qgs5.js";import"../chunk-z4k18gnp.js";import{Cc as j}from"../chunk-a0m2m20v.js";import"../chunk-t29t96a3.js";import"../chunk-e2ycfg1s.js";import"../chunk-qz8n10v1.js";import"../chunk-kqqj907k.js";import"../chunk-zds05es5.js";import"../chunk-8n8efq3e.js";import"../chunk-heq6gzp4.js";import"../chunk-5hyfe7b3.js";import{cg as X}from"../chunk-17grdzh5.js";import"../chunk-1ethvybg.js";import"../chunk-43xykgzb.js";import"../chunk-wdvv88da.js";import"../chunk-e5vt4nq9.js";import"../chunk-pzhzjx6h.js";import"../chunk-9x3gr8k7.js";import{createElement as J,Fragment as M,isValidElement as U}from"react";function $(q,B){let G=Object.values(B).some((z)=>typeof z==="function"&&U(z(""))),Q=/{{([^{}]+?)(?::([^{}\[\]]+?))?(?:\[(.*?)\])?}}/g;if(!G)return q.replace(Q,(W,O,_,Z)=>{let C=O.includes(":")?O.split(":")[0]:O,H=B[C];if(H===void 0)return W;if(typeof H==="function"){let K=H(Z!==void 0?Z:"");if(U(K))throw Error("JSX returned in string context");return String(K)}if(_)switch(_.toLowerCase()){case"number":return Number(H).toString();case"string":return String(H);case"boolean":return Boolean(H).toString();default:return String(H)}return String(H)});else{let z=[],W=0,O=null;while((O=Q.exec(q))!==null){let[_,Z,C,H]=O,F=O.index,K=Z.includes(":")?Z.split(":")[0]:Z;if(F>W)z.push(q.substring(W,F));let Y=B[K];if(Y===void 0)z.push(_);else if(typeof Y==="function"){let A=Y(H!==void 0?H:"");z.push(A)}else if(C)switch(C.toLowerCase()){case"number":z.push(Number(Y).toString());break;case"string":z.push(String(Y));break;case"boolean":z.push(Boolean(Y).toString());break;default:z.push(String(Y))}else z.push(String(Y));W=F+_.length}if(W<q.length)z.push(q.substring(W));return J(M,{},...z)}}class P{name;dictionary;constructor(q,B){this.name=q;this.dictionary=B}reference(q){if(typeof window<"u")throw Error("Cannot use reference in the browser");if(!this.dictionary?.[q])throw Error(`Translation not found for ${String(q)}`);return this.dictionary[q]}render(q,...B){let{locale:G=j.locale(),params:Q}={params:{},...B[0]};if(typeof window<"u")throw Error("Cannot use render in the browser");if(!this.dictionary?.[q]?.[G])throw Error(`Translation not found for ${String(q)} in ${String(G)}`);return $(this.dictionary[q][G],Q??{})}static create(q,B){return new P(q,B)}static text(q,...B){let{locale:G=j.locale(),params:Q}={params:{},...B?.[0]};if(!q?.[G])throw Error(`Translation not found for ${String(G)}`);return $(q[G],Q??{})}}async function N(q,B,...G){let{locale:Q=j.locale(),params:z}={params:{},...G[0]},O=(await q.load(String(Q)))[B];if(typeof O!=="string")throw Error(`Translation not found for "${B}" in "${String(Q)}" (dictionary ${q.id})`);return $(O,z??{})}export{V as translationConfigDefaults,N as translate,E as defineTranslationConfig,R as defineDictionary,X as Translator,L as TranslationServiceProvider,P as Dictionary};
3
3
 
4
4
  //# debugId=EA80E1B84BAE21F264756E2164756E21
@@ -1,5 +1,5 @@
1
1
  export { Kernel } from "./Kernel";
2
2
  export { frameworkProviders } from "./providers";
3
3
  export { UserProvider } from "../auth/UserProvider";
4
- export type { Account, AuthModels, CreateAccountArgs, CreateMagicLinkTokenArgs, CreatePasswordResetTokenArgs, CreateSessionArgs, CreateSocialAccountArgs, CreateUserArgs, Invitation, Organization, PasswordResetToken, SessionWithUser, UpdateUserPasswordArgs, User, } from "../auth/types";
4
+ export type { Account, AuthModels, CreateAccountArgs, CreateMagicLinkTokenArgs, CreatePasswordResetTokenArgs, CreateSessionArgs, CreateSocialAccountArgs, CreateUserArgs, FindSessionArgs, Invitation, Organization, PasswordResetToken, SessionWithUser, UpdateUserPasswordArgs, User, } from "../auth/types";
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../kernel/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAMjD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,YAAY,EACV,OAAO,EACP,UAAU,EACV,iBAAiB,EACjB,wBAAwB,EACxB,4BAA4B,EAC5B,iBAAiB,EACjB,uBAAuB,EACvB,cAAc,EACd,UAAU,EACV,YAAY,EACZ,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,IAAI,GACL,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../kernel/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAMjD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,YAAY,EACV,OAAO,EACP,UAAU,EACV,iBAAiB,EACjB,wBAAwB,EACxB,4BAA4B,EAC5B,iBAAiB,EACjB,uBAAuB,EACvB,cAAc,EACd,eAAe,EACf,UAAU,EACV,YAAY,EACZ,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,IAAI,GACL,MAAM,eAAe,CAAC"}
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{ya as y}from"../chunk-8fhzh26j.js";import{Va as e}from"../chunk-9f3d16m8.js";import{Wa as g}from"../chunk-654312qd.js";import{$a as zj,Bb as c,Eb as n,Hb as a,Za as _,_a as D,ab as A,bb as w,hb as P,ib as S,kb as h,lb as R,mb as u,nb as l,qb as v,rb as d,ub as p}from"../chunk-ny5w6a89.js";import"../chunk-hq496pa4.js";import"../chunk-0nbrg1hn.js";import{cc as jj}from"../chunk-9rthn2hy.js";import"../chunk-p0m3qgs5.js";import"../chunk-z4k18gnp.js";import{cd as B,id as I,jd as E,md as K,nd as q,od as o,sd as M,td as m,ud as Q,vd as i,wd as r,yc as Gj,zc as t}from"../chunk-rnpc26wd.js";import{Hd as s}from"../chunk-t29t96a3.js";import{Ud as V,Zd as f}from"../chunk-e2ycfg1s.js";import{Se as F,Ve as b}from"../chunk-qz8n10v1.js";import{jf as L}from"../chunk-kqqj907k.js";import"../chunk-zds05es5.js";import"../chunk-8n8efq3e.js";import"../chunk-heq6gzp4.js";import"../chunk-5hyfe7b3.js";import"../chunk-ws6qmce0.js";import"../chunk-17grdzh5.js";import{eg as N,fg as x}from"../chunk-1ethvybg.js";import{gg as U}from"../chunk-43xykgzb.js";import"../chunk-wdvv88da.js";import"../chunk-ynabq1zf.js";import"../chunk-e5vt4nq9.js";import{tg as C}from"../chunk-pzhzjx6h.js";import"../chunk-9x3gr8k7.js";function Xj(j){let X=j.headers.get("Cache-Control")?.toLowerCase()??"";return/(^|[\s,])(public|s-maxage)\b/.test(X)}var Yj=new Set,Zj={refusal:null,apply:(j)=>j,carried:null};async function k(j){let X=x(B);if(X.config.global.length===0)return Zj;let{pathname:Z}=new URL(j.url),W=C(Z),z=new b(j,{},W?"api":"view","");return await L.run(z,async()=>{let $=L.getStore(),{headers:H,cookies:Wj}=$,Y=(J)=>{if(!Xj(J))return Q(J,H,Wj);let G=new Headers(H);return G.delete("Set-Cookie"),Q(J,G,Yj)};try{return await X.runGlobalMiddleware(),{refusal:null,apply:Y,carried:{user:$.user}}}catch(J){let G=!W&&Z.endsWith(".json");if(J?.kind===F){let O=W?m(J.payload.api):G?q(J.payload.viewData??J.payload.api):K(J.payload.view);return{refusal:Y(O),apply:Y,carried:null}}if(V(J)&&(W||G))return{refusal:Y(M()),apply:Y,carried:null};if(f(J)){console.error(J);let O=W||G?I():K(E());return{refusal:Y(O),apply:Y,carried:null}}throw J}finally{$.destroy()}})}var T=[l,d,y,P,a,A,S,v,R,D,h,n,p,u,g,c,w];class Jj{config={};providers=[];services=[];serviceInstances=[];serviceTokens=new Set;servicesBooted=!1;models=[];app=new N;boot(){if(this.models.length>0)e(...this.models);else $j();this.app.config.merge(this.config),N.setInstance(this.app),this.app.registerMany([...T,...this.providers]),this.registerServices()}registerServices(){let j=this.serviceTokens;this.serviceInstances=[],this.serviceTokens=new Set,this.servicesBooted=!1;let X=new Map;for(let Z of this.services){let W=typeof Z==="function"?new Z:Z,z=W.constructor;if(!z.token)throw Error(`Service [${z.name}] is listed in \`services\` but does not declare a \`static token\`.`);let $=X.get(z.token);if($)throw Error(`Services [${$}] and [${z.name}] both declare the token "${z.token}". Tokens are the container's keys, so they must be unique.`);X.set(z.token,z.name);let H=z;if(!j.has(z.token)&&this.app.bound(H))throw Error(`Service [${z.name}] declares the token "${z.token}", which is already bound in the container by the framework or a provider. Binding it would replace that service everywhere, so pick a token nothing else owns.`);this.app.instance(H,W),this.serviceInstances.push(W),this.serviceTokens.add(z.token)}}async waitForBoot(){await this.app.boot(),await this.bootServices(),zj(this.app)}async bootServices(){if(this.servicesBooted)return;for(let j of this.serviceInstances)await j.boot();this.servicesBooted=!0}shutdown(j){return this.run(()=>this.app.shutdown(j))}run(j){return U.run(this.app,j)}resolve(j){return this.app.make(j)}apiRoutes(){return this.app.make(i)}viewRoutes(){return this.app.make(o)}domains(){return this.app.make(r)}broadcast(){return this.app.make(t)}queue(){return this.app.make(jj)}globalMiddleware(j){return k(j)}destroy(){if(this.app.resolved(_))this.app.make(_).stop();if(this.app.flush(),N.getInstance()===this.app)N.setInstance(void 0);U.disable()}}function $j(){if(Bun.env.NODE_ENV==="production")return;let j=s();if(j.length===0)return;console.warn(`[gemi] ${j.length} model${j.length===1?" is":"s are"} registered, but Kernel.models is empty.
2
+ import{ya as y}from"../chunk-8fhzh26j.js";import{Va as e}from"../chunk-9f3d16m8.js";import{Wa as g}from"../chunk-654312qd.js";import{$a as zj,Bb as c,Eb as n,Hb as a,Za as _,_a as D,ab as A,bb as w,hb as P,ib as S,kb as h,lb as R,mb as u,nb as l,qb as v,rb as d,ub as p}from"../chunk-3havx4jv.js";import"../chunk-hq496pa4.js";import"../chunk-0nbrg1hn.js";import{cc as jj}from"../chunk-9rthn2hy.js";import"../chunk-p0m3qgs5.js";import"../chunk-z4k18gnp.js";import{cd as B,id as I,jd as E,md as K,nd as q,od as o,sd as M,td as m,ud as Q,vd as i,wd as r,yc as Gj,zc as t}from"../chunk-a0m2m20v.js";import{Hd as s}from"../chunk-t29t96a3.js";import{Ud as V,Zd as f}from"../chunk-e2ycfg1s.js";import{Se as F,Ve as b}from"../chunk-qz8n10v1.js";import{jf as L}from"../chunk-kqqj907k.js";import"../chunk-zds05es5.js";import"../chunk-8n8efq3e.js";import"../chunk-heq6gzp4.js";import"../chunk-5hyfe7b3.js";import"../chunk-ws6qmce0.js";import"../chunk-17grdzh5.js";import{eg as N,fg as x}from"../chunk-1ethvybg.js";import{gg as U}from"../chunk-43xykgzb.js";import"../chunk-wdvv88da.js";import"../chunk-ynabq1zf.js";import"../chunk-e5vt4nq9.js";import{tg as C}from"../chunk-pzhzjx6h.js";import"../chunk-9x3gr8k7.js";function Xj(j){let X=j.headers.get("Cache-Control")?.toLowerCase()??"";return/(^|[\s,])(public|s-maxage)\b/.test(X)}var Yj=new Set,Zj={refusal:null,apply:(j)=>j,carried:null};async function k(j){let X=x(B);if(X.config.global.length===0)return Zj;let{pathname:Z}=new URL(j.url),W=C(Z),z=new b(j,{},W?"api":"view","");return await L.run(z,async()=>{let $=L.getStore(),{headers:H,cookies:Wj}=$,Y=(J)=>{if(!Xj(J))return Q(J,H,Wj);let G=new Headers(H);return G.delete("Set-Cookie"),Q(J,G,Yj)};try{return await X.runGlobalMiddleware(),{refusal:null,apply:Y,carried:{user:$.user}}}catch(J){let G=!W&&Z.endsWith(".json");if(J?.kind===F){let O=W?m(J.payload.api):G?q(J.payload.viewData??J.payload.api):K(J.payload.view);return{refusal:Y(O),apply:Y,carried:null}}if(V(J)&&(W||G))return{refusal:Y(M()),apply:Y,carried:null};if(f(J)){console.error(J);let O=W||G?I():K(E());return{refusal:Y(O),apply:Y,carried:null}}throw J}finally{$.destroy()}})}var T=[l,d,y,P,a,A,S,v,R,D,h,n,p,u,g,c,w];class Jj{config={};providers=[];services=[];serviceInstances=[];serviceTokens=new Set;servicesBooted=!1;models=[];app=new N;boot(){if(this.models.length>0)e(...this.models);else $j();this.app.config.merge(this.config),N.setInstance(this.app),this.app.registerMany([...T,...this.providers]),this.registerServices()}registerServices(){let j=this.serviceTokens;this.serviceInstances=[],this.serviceTokens=new Set,this.servicesBooted=!1;let X=new Map;for(let Z of this.services){let W=typeof Z==="function"?new Z:Z,z=W.constructor;if(!z.token)throw Error(`Service [${z.name}] is listed in \`services\` but does not declare a \`static token\`.`);let $=X.get(z.token);if($)throw Error(`Services [${$}] and [${z.name}] both declare the token "${z.token}". Tokens are the container's keys, so they must be unique.`);X.set(z.token,z.name);let H=z;if(!j.has(z.token)&&this.app.bound(H))throw Error(`Service [${z.name}] declares the token "${z.token}", which is already bound in the container by the framework or a provider. Binding it would replace that service everywhere, so pick a token nothing else owns.`);this.app.instance(H,W),this.serviceInstances.push(W),this.serviceTokens.add(z.token)}}async waitForBoot(){await this.app.boot(),await this.bootServices(),zj(this.app)}async bootServices(){if(this.servicesBooted)return;for(let j of this.serviceInstances)await j.boot();this.servicesBooted=!0}shutdown(j){return this.run(()=>this.app.shutdown(j))}run(j){return U.run(this.app,j)}resolve(j){return this.app.make(j)}apiRoutes(){return this.app.make(i)}viewRoutes(){return this.app.make(o)}domains(){return this.app.make(r)}broadcast(){return this.app.make(t)}queue(){return this.app.make(jj)}globalMiddleware(j){return k(j)}destroy(){if(this.app.resolved(_))this.app.make(_).stop();if(this.app.flush(),N.getInstance()===this.app)N.setInstance(void 0);U.disable()}}function $j(){if(Bun.env.NODE_ENV==="production")return;let j=s();if(j.length===0)return;console.warn(`[gemi] ${j.length} model${j.length===1?" is":"s are"} registered, but Kernel.models is empty.
3
3
  Nested relation reads resolve a model by name, so a policy on a subclass that does not own its
4
4
  `+" name is skipped inside every include \u2014 scoped at the root, "+`unscoped in an include, with nothing
5
5
  to notice it. Declaring the modules registers each class under its own name and audits the set:
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{wa as Y}from"../chunk-8z37k28d.js";import{xa as L}from"../chunk-xgcydqxz.js";import{jg as b,lg as C,mg as Q,ng as V,og as X}from"../chunk-ynabq1zf.js";import{sg as K}from"../chunk-e5vt4nq9.js";import"../chunk-pzhzjx6h.js";import{zg as J}from"../chunk-9x3gr8k7.js";class Z{app;instrumentation;handleSignals;server;stopping;settings;constructor(z){this.app=new L({kernel:z.kernel}),this.handleSignals=z.handleSignals??!0,this.instrumentation=V(z.instrumentation??((B,$)=>$(B)))}async start(){process.env.ROOT_DIR=K();let z=Bun.env.NODE_ENV==="production";if(z){if(this.handleSignals)X(()=>this.stop());this.settings=C()}if(await this.app.waitForBoot(),z){let{httpProd:B}=await import("../chunk-8n6saxe6.js");this.server=await B(this.app,this.instrumentation.bind(this))}else{Y();let{httpDev:B}=await import("../chunk-y2jz8gqp.js");this.server=await B(this.app,this.instrumentation.bind(this))}return this.server}stop(z={}){return this.stopping??=Q({server:this.server,shutdownProviders:(B)=>this.app.shutdown(B),settings:{...this.settings??C(),...z}}),this.stopping}}export{b as isShuttingDown,Z as Server};
2
+ import{wa as Y}from"../chunk-8z37k28d.js";import{xa as L}from"../chunk-xgcydqxz.js";import{jg as b,lg as C,mg as Q,ng as V,og as X}from"../chunk-ynabq1zf.js";import{sg as K}from"../chunk-e5vt4nq9.js";import"../chunk-pzhzjx6h.js";import{zg as J}from"../chunk-9x3gr8k7.js";class Z{app;instrumentation;handleSignals;server;stopping;settings;constructor(z){this.app=new L({kernel:z.kernel}),this.handleSignals=z.handleSignals??!0,this.instrumentation=V(z.instrumentation??((B,$)=>$(B)))}async start(){process.env.ROOT_DIR=K();let z=Bun.env.NODE_ENV==="production";if(z){if(this.handleSignals)X(()=>this.stop());this.settings=C()}if(await this.app.waitForBoot(),z){let{httpProd:B}=await import("../chunk-q7y72wr3.js");this.server=await B(this.app,this.instrumentation.bind(this))}else{Y();let{httpDev:B}=await import("../chunk-4f8s3jda.js");this.server=await B(this.app,this.instrumentation.bind(this))}return this.server}stop(z={}){return this.stopping??=Q({server:this.server,shutdownProviders:(B)=>this.app.shutdown(B),settings:{...this.settings??C(),...z}}),this.stopping}}export{b as isShuttingDown,Z as Server};
3
3
 
4
4
  //# debugId=A0A2E8CD3036D2FE64756E2164756E21
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Ya as AW}from"../chunk-zytmxty5.js";import{Ab as vW,Bb as IW,Cb as TW,Db as hW,Eb as qW,Fb as PW,Gb as wW,Hb as yW,Za as A6,_a as GW,ab as $W,bb as XW,cb as m4,db as zW,eb as BW,fb as xW,gb as MW,hb as jW,ib as NW,jb as U,kb as LW,lb as DW,mb as FW,nb as OW,ob as HW,pb as UW,qb as SW,rb as fW,sb as RW,tb as kW,ub as _W,vb as i4,wb as o4,xb as A1,yb as CW,zb as bW}from"../chunk-ny5w6a89.js";import"../chunk-hq496pa4.js";import{Kb as u6,Lb as d6,Mb as p6,Nb as l6,Ob as n6,Pb as i6,Qb as o6,Rb as s6,Sb as a6,Tb as t6,Ub as r6,Vb as e6,Wb as WW,Xb as YW,Yb as JW,Zb as ZW}from"../chunk-0nbrg1hn.js";import{$b as g6,_b as V6,ac as c6,bc as E6,cc as m6}from"../chunk-9rthn2hy.js";import{hc as QW,ic as KW}from"../chunk-p0m3qgs5.js";import"../chunk-z4k18gnp.js";import{$c as U6,Fc as K6,Jc as N1,Lc as X6,Nc as z6,Oc as B6,Pc as x6,Qc as M6,Rc as j6,Sc as N6,Tc as L6,Uc as D6,Vc as F6,Zc as O6,_c as H6,ad as S6,bd as f6,cd as R6,dd as k6,ed as _6,fd as C6,hd as b6,od as v6,qc as C0,uc as r0,vc as e0,vd as I6,wc as W6,xc as Y6,xd as T6,zc as J6}from"../chunk-rnpc26wd.js";import"../chunk-t29t96a3.js";import"../chunk-e2ycfg1s.js";import{Le as y1,Me as P1,Ne as W1,Ye as V,Ze as v,bf as Y1,cf as Z6,df as G6,ef as $6,ff as Q6}from"../chunk-qz8n10v1.js";import"../chunk-kqqj907k.js";import"../chunk-zds05es5.js";import"../chunk-8n8efq3e.js";import"../chunk-heq6gzp4.js";import"../chunk-5hyfe7b3.js";import{$f as w6,Yf as h6,Zf as q6,_f as P6,ag as y6}from"../chunk-ws6qmce0.js";import"../chunk-17grdzh5.js";import{fg as g}from"../chunk-1ethvybg.js";import"../chunk-43xykgzb.js";import"../chunk-wdvv88da.js";import"../chunk-ynabq1zf.js";import"../chunk-e5vt4nq9.js";import"../chunk-pzhzjx6h.js";import{zg as d4}from"../chunk-9x3gr8k7.js";import{Buffer as u4}from"buffer";class p4 extends Y1{client;config;constructor(...W){super();this.config=W}async connect(){let W=await import("../chunk-0fmntznb.js");return this.client??=new W.S3Client(...this.config),{sdk:W,client:this.client}}async put(W,{signal:Y}={}){Y?.throwIfAborted();let J,Z,G,$=process.env.BUCKET_NAME;if(W instanceof Blob)J=W,G=`${Bun.randomUUIDv7()}.${W.type.split("/")[1].split(";")[0]}`,Z=W.type;else J=W.body,G=W.name,$=W.bucket??$,Z=W.contentType||(J instanceof Blob||J instanceof File?J.type:void 0);Z=Z||void 0;let Q=J instanceof u4?J:J instanceof Blob||J instanceof File?u4.from(await J.arrayBuffer()):"",{sdk:K,client:z}=await this.connect();return Y?.throwIfAborted(),await z.send(new K.PutObjectCommand({Bucket:$,Key:G,Body:Q,ContentType:Z}),{abortSignal:Y}),G}async list(W){let{sdk:Y,client:J}=await this.connect();return await J.send(new Y.ListObjectsV2Command({Bucket:process.env.BUCKET_NAME,Prefix:W}))}async fetch(W){let Y=process.env.BUCKET_NAME,J;if(typeof W==="string")J=W;else Y=W.bucket??Y,J=W.name;if(!J)throw Error("Object name has to be specified");let{sdk:Z,client:G}=await this.connect(),$=await G.send(new Z.GetObjectCommand({Bucket:Y,Key:J}));return new Response($.Body.transformToWebStream(),{headers:{"Content-Type":$.ContentType,"Content-Length":$.ContentLength.toString(),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":$.LastModified?.toUTCString()||"",ETag:$.ETag||""}})}async read(W){let Y=typeof W==="string"?{name:W}:W,J=Y.bucket??process.env.BUCKET_NAME,{name:Z,range:G=null}=Y;if(!Z)throw Error("Object name has to be specified");let{sdk:$,client:Q}=await this.connect(),K;try{K=await Q.send(new $.GetObjectCommand({Bucket:J,Key:Z,Range:G?P1(G):void 0}))}catch(M){if(M?.name==="InvalidRange"||M?.$metadata?.httpStatusCode===416)throw new V(await this.size({name:Z,bucket:J}));if(M?.name==="NoSuchKey"||M?.$metadata?.httpStatusCode===404)throw new v(Z);throw M}let z=W1(K.ContentRange),X=Boolean(z)&&K.$metadata?.httpStatusCode===206,x=z?.total??K.ContentLength??0;return{body:K.Body.transformToWebStream(),start:z?.start??0,end:z?.end??x-1,total:x,partial:X,type:K.ContentType??"application/octet-stream",etag:K.ETag||void 0,lastModified:K.LastModified,name:Z}}async size(W){let Y=typeof W==="string"?W:W.name,J=(typeof W==="string"?void 0:W.bucket)??process.env.BUCKET_NAME,{sdk:Z,client:G}=await this.connect();try{return(await G.send(new Z.HeadObjectCommand({Bucket:J,Key:Y}))).ContentLength??0}catch($){if($?.name==="NotFound"||$?.$metadata?.httpStatusCode===404)throw new v(Y);throw $}}}import{Buffer as l4}from"buffer";import{Readable as T0}from"stream";function w1(W){return W?.statusCode===404||W?.details?.errorCode==="BlobNotFound"||W?.code==="BlobNotFound"}function h0(W){return W?.statusCode===416||W?.details?.errorCode==="InvalidRange"||W?.code==="InvalidRange"}class n4 extends Y1{config;serviceClientPromise=null;constructor(W={}){super();this.config=W}async serviceClient(){if(this.config.serviceClient)return this.config.serviceClient;return this.serviceClientPromise??=(async()=>{let W;try{W=await import("@azure/storage-blob")}catch{throw Error("AzureBlobDriver requires the '@azure/storage-blob' package. Install it with `bun add @azure/storage-blob`, or pass a pre-built `serviceClient`.")}let Y=this.config.connectionString??process.env.AZURE_STORAGE_CONNECTION_STRING;if(this.config.url)return new W.BlobServiceClient(this.config.url,this.config.credential);if(Y)return W.BlobServiceClient.fromConnectionString(Y);throw Error("AzureBlobDriver needs a connection string (AZURE_STORAGE_CONNECTION_STRING), a `url`, or a `serviceClient`.")})(),this.serviceClientPromise}async blob(W,Y){if(!W)throw Error("Object name has to be specified");let J=Y??this.config.container??process.env.BUCKET_NAME;if(!J)throw Error("AzureBlobDriver needs a container name, from `bucket`, the `container` config, or BUCKET_NAME.");return(await this.serviceClient()).getContainerClient(J).getBlockBlobClient(W)}async put(W,{signal:Y}={}){Y?.throwIfAborted();let J,Z,G,$;if(W instanceof Blob)J=W,G=`${Bun.randomUUIDv7()}.${W.type.split("/")[1].split(";")[0]}`,Z=W.type;else J=W.body,G=W.name,$=W.bucket,Z=W.contentType??(J instanceof Blob||J instanceof File?J.type:void 0);let Q=J instanceof l4?J:l4.from(await J.arrayBuffer()),K=await this.blob(G,$);return Y?.throwIfAborted(),await K.uploadData(Q,{blobHTTPHeaders:Z?{blobContentType:Z}:void 0,abortSignal:Y}),G}async list(W){let Y=this.config.container??process.env.BUCKET_NAME,Z=(await this.serviceClient()).getContainerClient(Y),G=[];for await(let $ of Z.listBlobsFlat({prefix:W}))G.push($.name);return G}async fetch(W){let Y=await this.read(typeof W==="string"?{name:W}:{name:W.name,bucket:W.bucket});return new Response(Y.body,{headers:{"Content-Type":Y.type,"Content-Length":String(Y.total),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":Y.lastModified?.toUTCString()??"",ETag:Y.etag??""}})}async read(W){let Y=typeof W==="string"?{name:W}:W,{name:J,bucket:Z,range:G=null}=Y,$=await this.blob(J,Z),Q,K,z=G?.kind==="suffix"||G?.kind==="offset"&&G.end===null&&G.start===0;if(G&&z){let k=await this.size({name:J,bucket:Z}),e=y1(G,k);if(!e)throw new V(k);Q=e.start,K=e.length}else if(G?.kind==="offset")Q=G.start,K=G.end===null?void 0:G.end-G.start+1;let X;try{X=await $.download(Q,K)}catch(k){if(h0(k))throw new V(await this.size({name:J,bucket:Z}));if(w1(k))throw new v(J);throw k}let x=W1(X.contentRange),M=Boolean(x),R=x?.total??X.contentLength??0;return{body:await q0(X),start:x?.start??0,end:x?.end??R-1,total:R,partial:M,type:X.contentType??"application/octet-stream",etag:X.etag||void 0,lastModified:X.lastModified,name:J}}async size(W){let Y=typeof W==="string"?W:W.name,J=typeof W==="string"?void 0:W.bucket,Z=await this.blob(Y,J);try{return(await Z.getProperties()).contentLength??0}catch(G){if(w1(G))throw new v(Y);throw G}}async delete(W){let Y=typeof W==="string"?W:W.name,J=typeof W==="string"?void 0:W.bucket,Z=await this.blob(Y,J);try{await Z.delete()}catch(G){if(w1(G))throw new v(Y);throw G}}}async function q0(W){if(W.blobBody)return await W.blobBody;if(W.readableStreamBody)return T0.toWeb(W.readableStreamBody);return null}var P0=`
2
+ import{Ya as AW}from"../chunk-zytmxty5.js";import{Ab as vW,Bb as IW,Cb as TW,Db as hW,Eb as qW,Fb as PW,Gb as wW,Hb as yW,Za as A6,_a as GW,ab as $W,bb as XW,cb as m4,db as zW,eb as BW,fb as xW,gb as MW,hb as jW,ib as NW,jb as U,kb as LW,lb as DW,mb as FW,nb as OW,ob as HW,pb as UW,qb as SW,rb as fW,sb as RW,tb as kW,ub as _W,vb as i4,wb as o4,xb as A1,yb as CW,zb as bW}from"../chunk-3havx4jv.js";import"../chunk-hq496pa4.js";import{Kb as u6,Lb as d6,Mb as p6,Nb as l6,Ob as n6,Pb as i6,Qb as o6,Rb as s6,Sb as a6,Tb as t6,Ub as r6,Vb as e6,Wb as WW,Xb as YW,Yb as JW,Zb as ZW}from"../chunk-0nbrg1hn.js";import{$b as g6,_b as V6,ac as c6,bc as E6,cc as m6}from"../chunk-9rthn2hy.js";import{hc as QW,ic as KW}from"../chunk-p0m3qgs5.js";import"../chunk-z4k18gnp.js";import{$c as U6,Fc as K6,Jc as N1,Lc as X6,Nc as z6,Oc as B6,Pc as x6,Qc as M6,Rc as j6,Sc as N6,Tc as L6,Uc as D6,Vc as F6,Zc as O6,_c as H6,ad as S6,bd as f6,cd as R6,dd as k6,ed as _6,fd as C6,hd as b6,od as v6,qc as C0,uc as r0,vc as e0,vd as I6,wc as W6,xc as Y6,xd as T6,zc as J6}from"../chunk-a0m2m20v.js";import"../chunk-t29t96a3.js";import"../chunk-e2ycfg1s.js";import{Le as y1,Me as P1,Ne as W1,Ye as V,Ze as v,bf as Y1,cf as Z6,df as G6,ef as $6,ff as Q6}from"../chunk-qz8n10v1.js";import"../chunk-kqqj907k.js";import"../chunk-zds05es5.js";import"../chunk-8n8efq3e.js";import"../chunk-heq6gzp4.js";import"../chunk-5hyfe7b3.js";import{$f as w6,Yf as h6,Zf as q6,_f as P6,ag as y6}from"../chunk-ws6qmce0.js";import"../chunk-17grdzh5.js";import{fg as g}from"../chunk-1ethvybg.js";import"../chunk-43xykgzb.js";import"../chunk-wdvv88da.js";import"../chunk-ynabq1zf.js";import"../chunk-e5vt4nq9.js";import"../chunk-pzhzjx6h.js";import{zg as d4}from"../chunk-9x3gr8k7.js";import{Buffer as u4}from"buffer";class p4 extends Y1{client;config;constructor(...W){super();this.config=W}async connect(){let W=await import("../chunk-0fmntznb.js");return this.client??=new W.S3Client(...this.config),{sdk:W,client:this.client}}async put(W,{signal:Y}={}){Y?.throwIfAborted();let J,Z,G,$=process.env.BUCKET_NAME;if(W instanceof Blob)J=W,G=`${Bun.randomUUIDv7()}.${W.type.split("/")[1].split(";")[0]}`,Z=W.type;else J=W.body,G=W.name,$=W.bucket??$,Z=W.contentType||(J instanceof Blob||J instanceof File?J.type:void 0);Z=Z||void 0;let Q=J instanceof u4?J:J instanceof Blob||J instanceof File?u4.from(await J.arrayBuffer()):"",{sdk:K,client:z}=await this.connect();return Y?.throwIfAborted(),await z.send(new K.PutObjectCommand({Bucket:$,Key:G,Body:Q,ContentType:Z}),{abortSignal:Y}),G}async list(W){let{sdk:Y,client:J}=await this.connect();return await J.send(new Y.ListObjectsV2Command({Bucket:process.env.BUCKET_NAME,Prefix:W}))}async fetch(W){let Y=process.env.BUCKET_NAME,J;if(typeof W==="string")J=W;else Y=W.bucket??Y,J=W.name;if(!J)throw Error("Object name has to be specified");let{sdk:Z,client:G}=await this.connect(),$=await G.send(new Z.GetObjectCommand({Bucket:Y,Key:J}));return new Response($.Body.transformToWebStream(),{headers:{"Content-Type":$.ContentType,"Content-Length":$.ContentLength.toString(),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":$.LastModified?.toUTCString()||"",ETag:$.ETag||""}})}async read(W){let Y=typeof W==="string"?{name:W}:W,J=Y.bucket??process.env.BUCKET_NAME,{name:Z,range:G=null}=Y;if(!Z)throw Error("Object name has to be specified");let{sdk:$,client:Q}=await this.connect(),K;try{K=await Q.send(new $.GetObjectCommand({Bucket:J,Key:Z,Range:G?P1(G):void 0}))}catch(M){if(M?.name==="InvalidRange"||M?.$metadata?.httpStatusCode===416)throw new V(await this.size({name:Z,bucket:J}));if(M?.name==="NoSuchKey"||M?.$metadata?.httpStatusCode===404)throw new v(Z);throw M}let z=W1(K.ContentRange),X=Boolean(z)&&K.$metadata?.httpStatusCode===206,x=z?.total??K.ContentLength??0;return{body:K.Body.transformToWebStream(),start:z?.start??0,end:z?.end??x-1,total:x,partial:X,type:K.ContentType??"application/octet-stream",etag:K.ETag||void 0,lastModified:K.LastModified,name:Z}}async size(W){let Y=typeof W==="string"?W:W.name,J=(typeof W==="string"?void 0:W.bucket)??process.env.BUCKET_NAME,{sdk:Z,client:G}=await this.connect();try{return(await G.send(new Z.HeadObjectCommand({Bucket:J,Key:Y}))).ContentLength??0}catch($){if($?.name==="NotFound"||$?.$metadata?.httpStatusCode===404)throw new v(Y);throw $}}}import{Buffer as l4}from"buffer";import{Readable as T0}from"stream";function w1(W){return W?.statusCode===404||W?.details?.errorCode==="BlobNotFound"||W?.code==="BlobNotFound"}function h0(W){return W?.statusCode===416||W?.details?.errorCode==="InvalidRange"||W?.code==="InvalidRange"}class n4 extends Y1{config;serviceClientPromise=null;constructor(W={}){super();this.config=W}async serviceClient(){if(this.config.serviceClient)return this.config.serviceClient;return this.serviceClientPromise??=(async()=>{let W;try{W=await import("@azure/storage-blob")}catch{throw Error("AzureBlobDriver requires the '@azure/storage-blob' package. Install it with `bun add @azure/storage-blob`, or pass a pre-built `serviceClient`.")}let Y=this.config.connectionString??process.env.AZURE_STORAGE_CONNECTION_STRING;if(this.config.url)return new W.BlobServiceClient(this.config.url,this.config.credential);if(Y)return W.BlobServiceClient.fromConnectionString(Y);throw Error("AzureBlobDriver needs a connection string (AZURE_STORAGE_CONNECTION_STRING), a `url`, or a `serviceClient`.")})(),this.serviceClientPromise}async blob(W,Y){if(!W)throw Error("Object name has to be specified");let J=Y??this.config.container??process.env.BUCKET_NAME;if(!J)throw Error("AzureBlobDriver needs a container name, from `bucket`, the `container` config, or BUCKET_NAME.");return(await this.serviceClient()).getContainerClient(J).getBlockBlobClient(W)}async put(W,{signal:Y}={}){Y?.throwIfAborted();let J,Z,G,$;if(W instanceof Blob)J=W,G=`${Bun.randomUUIDv7()}.${W.type.split("/")[1].split(";")[0]}`,Z=W.type;else J=W.body,G=W.name,$=W.bucket,Z=W.contentType??(J instanceof Blob||J instanceof File?J.type:void 0);let Q=J instanceof l4?J:l4.from(await J.arrayBuffer()),K=await this.blob(G,$);return Y?.throwIfAborted(),await K.uploadData(Q,{blobHTTPHeaders:Z?{blobContentType:Z}:void 0,abortSignal:Y}),G}async list(W){let Y=this.config.container??process.env.BUCKET_NAME,Z=(await this.serviceClient()).getContainerClient(Y),G=[];for await(let $ of Z.listBlobsFlat({prefix:W}))G.push($.name);return G}async fetch(W){let Y=await this.read(typeof W==="string"?{name:W}:{name:W.name,bucket:W.bucket});return new Response(Y.body,{headers:{"Content-Type":Y.type,"Content-Length":String(Y.total),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":Y.lastModified?.toUTCString()??"",ETag:Y.etag??""}})}async read(W){let Y=typeof W==="string"?{name:W}:W,{name:J,bucket:Z,range:G=null}=Y,$=await this.blob(J,Z),Q,K,z=G?.kind==="suffix"||G?.kind==="offset"&&G.end===null&&G.start===0;if(G&&z){let k=await this.size({name:J,bucket:Z}),e=y1(G,k);if(!e)throw new V(k);Q=e.start,K=e.length}else if(G?.kind==="offset")Q=G.start,K=G.end===null?void 0:G.end-G.start+1;let X;try{X=await $.download(Q,K)}catch(k){if(h0(k))throw new V(await this.size({name:J,bucket:Z}));if(w1(k))throw new v(J);throw k}let x=W1(X.contentRange),M=Boolean(x),R=x?.total??X.contentLength??0;return{body:await q0(X),start:x?.start??0,end:x?.end??R-1,total:R,partial:M,type:X.contentType??"application/octet-stream",etag:X.etag||void 0,lastModified:X.lastModified,name:J}}async size(W){let Y=typeof W==="string"?W:W.name,J=typeof W==="string"?void 0:W.bucket,Z=await this.blob(Y,J);try{return(await Z.getProperties()).contentLength??0}catch(G){if(w1(G))throw new v(Y);throw G}}async delete(W){let Y=typeof W==="string"?W:W.name,J=typeof W==="string"?void 0:W.bucket,Z=await this.blob(Y,J);try{await Z.delete()}catch(G){if(w1(G))throw new v(Y);throw G}}}async function q0(W){if(W.blobBody)return await W.blobBody;if(W.readableStreamBody)return T0.toWeb(W.readableStreamBody);return null}var P0=`
3
3
  local currentKey = KEYS[1]
4
4
  local previousKey = KEYS[2]
5
5
  local limit = tonumber(ARGV[1])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gemi",
3
- "version": "0.69.0",
3
+ "version": "0.69.1",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "Enes Tufekci <enes@gemijs.dev>",