gemi 0.144.0 → 0.145.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.
- package/dist/ai/AgentController.d.ts +2 -2
- package/dist/ai/AgentController.d.ts.map +1 -1
- package/dist/ai/index.d.ts +2 -2
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js +11 -11
- package/dist/ai/index.js.map +3 -3
- package/dist/ai/store/Nonces.d.ts +68 -0
- package/dist/ai/store/Nonces.d.ts.map +1 -1
- package/dist/ai/store/index.d.ts +1 -1
- package/dist/ai/store/index.d.ts.map +1 -1
- package/dist/app/index.js +1 -1
- package/dist/bun/plugin.js +1 -1
- package/dist/bun/preload.js +1 -1
- package/dist/{chunk-fg2k18d2.js → chunk-0k8fk96c.js} +2 -2
- package/dist/{chunk-fg2k18d2.js.map → chunk-0k8fk96c.js.map} +1 -1
- package/dist/{chunk-y5yac6n1.js → chunk-0mt7kqwx.js} +2 -2
- package/dist/{chunk-y5yac6n1.js.map → chunk-0mt7kqwx.js.map} +1 -1
- package/dist/{chunk-1ed75a7b.js → chunk-1fyn63ka.js} +3 -3
- package/dist/{chunk-1ed75a7b.js.map → chunk-1fyn63ka.js.map} +1 -1
- package/dist/{chunk-tkvamktq.js → chunk-1ttd4rn9.js} +2 -2
- package/dist/{chunk-tkvamktq.js.map → chunk-1ttd4rn9.js.map} +1 -1
- package/dist/{chunk-m70hn4eg.js → chunk-1wz6kwjc.js} +2 -2
- package/dist/{chunk-m70hn4eg.js.map → chunk-1wz6kwjc.js.map} +1 -1
- package/dist/{chunk-fsem81ec.js → chunk-29jmaj16.js} +1 -1
- package/dist/{chunk-fpz9e3xx.js → chunk-2b3hh9xw.js} +3 -3
- package/dist/{chunk-fpz9e3xx.js.map → chunk-2b3hh9xw.js.map} +1 -1
- package/dist/{chunk-n9zycjm1.js → chunk-2djjs8f1.js} +3 -3
- package/dist/{chunk-n9zycjm1.js.map → chunk-2djjs8f1.js.map} +1 -1
- package/dist/{chunk-p81qeav5.js → chunk-2ery6a75.js} +3 -3
- package/dist/{chunk-p81qeav5.js.map → chunk-2ery6a75.js.map} +1 -1
- package/dist/{chunk-hyhbk12v.js → chunk-2k3935ke.js} +2 -2
- package/dist/{chunk-hyhbk12v.js.map → chunk-2k3935ke.js.map} +1 -1
- package/dist/{chunk-qt6x2r6a.js → chunk-2x6cv37t.js} +2 -2
- package/dist/{chunk-qt6x2r6a.js.map → chunk-2x6cv37t.js.map} +1 -1
- package/dist/{chunk-68f0jpje.js → chunk-313593t3.js} +2 -2
- package/dist/{chunk-68f0jpje.js.map → chunk-313593t3.js.map} +1 -1
- package/dist/{chunk-5qfzvnyp.js → chunk-3csz8pfk.js} +3 -3
- package/dist/{chunk-5qfzvnyp.js.map → chunk-3csz8pfk.js.map} +1 -1
- package/dist/{chunk-rezmtdyt.js → chunk-3x8zrsby.js} +2 -2
- package/dist/{chunk-rezmtdyt.js.map → chunk-3x8zrsby.js.map} +1 -1
- package/dist/{chunk-6d3m2w2p.js → chunk-43ws58db.js} +2 -2
- package/dist/{chunk-6d3m2w2p.js.map → chunk-43ws58db.js.map} +1 -1
- package/dist/chunk-49s8wwp2.js +5 -0
- package/dist/{chunk-b6mgrrk6.js.map → chunk-49s8wwp2.js.map} +1 -1
- package/dist/{chunk-ncb1qtae.js → chunk-4d4td4k9.js} +2 -2
- package/dist/{chunk-ncb1qtae.js.map → chunk-4d4td4k9.js.map} +1 -1
- package/dist/{chunk-v57ndv0h.js → chunk-4jd25v6d.js} +2 -2
- package/dist/{chunk-v57ndv0h.js.map → chunk-4jd25v6d.js.map} +1 -1
- package/dist/{chunk-78bfmwp0.js → chunk-4m0eqq80.js} +2 -2
- package/dist/{chunk-78bfmwp0.js.map → chunk-4m0eqq80.js.map} +1 -1
- package/dist/{chunk-ktrm6y5j.js → chunk-563ksar3.js} +3 -3
- package/dist/{chunk-ktrm6y5j.js.map → chunk-563ksar3.js.map} +1 -1
- package/dist/{chunk-z80v4z8y.js → chunk-5q2pmve9.js} +2 -2
- package/dist/{chunk-z80v4z8y.js.map → chunk-5q2pmve9.js.map} +1 -1
- package/dist/{chunk-20d0n391.js → chunk-5yz684rw.js} +2 -2
- package/dist/{chunk-20d0n391.js.map → chunk-5yz684rw.js.map} +1 -1
- package/dist/{chunk-236be97q.js → chunk-63xwah5k.js} +1 -1
- package/dist/{chunk-b4jx4fzq.js → chunk-65wy1r1a.js} +1 -1
- package/dist/{chunk-9tgcmx4h.js → chunk-70yz9e7f.js} +2 -2
- package/dist/{chunk-9tgcmx4h.js.map → chunk-70yz9e7f.js.map} +1 -1
- package/dist/{chunk-t03nda3s.js → chunk-73rzf7ys.js} +2 -2
- package/dist/{chunk-t03nda3s.js.map → chunk-73rzf7ys.js.map} +1 -1
- package/dist/{chunk-1cn7ets3.js → chunk-7txqv2qq.js} +3 -3
- package/dist/{chunk-1cn7ets3.js.map → chunk-7txqv2qq.js.map} +1 -1
- package/dist/{chunk-1skdsmjx.js → chunk-86zhngpg.js} +2 -2
- package/dist/{chunk-1skdsmjx.js.map → chunk-86zhngpg.js.map} +1 -1
- package/dist/{chunk-ce9wm3r9.js → chunk-877yc341.js} +3 -3
- package/dist/{chunk-ce9wm3r9.js.map → chunk-877yc341.js.map} +1 -1
- package/dist/{chunk-wffc5k3m.js → chunk-87y2nrjy.js} +2 -2
- package/dist/{chunk-wffc5k3m.js.map → chunk-87y2nrjy.js.map} +1 -1
- package/dist/{chunk-9zd7c4wq.js → chunk-8k346pjw.js} +14 -14
- package/dist/{chunk-9zd7c4wq.js.map → chunk-8k346pjw.js.map} +3 -3
- package/dist/{chunk-27xsjq8a.js → chunk-8km4drvv.js} +3 -3
- package/dist/{chunk-27xsjq8a.js.map → chunk-8km4drvv.js.map} +1 -1
- package/dist/{chunk-sa6a0wy1.js → chunk-94hcjdbe.js} +2 -2
- package/dist/{chunk-sa6a0wy1.js.map → chunk-94hcjdbe.js.map} +1 -1
- package/dist/{chunk-kaphqnpp.js → chunk-9z8zq4rx.js} +3 -3
- package/dist/{chunk-kaphqnpp.js.map → chunk-9z8zq4rx.js.map} +1 -1
- package/dist/{chunk-8ex0y47w.js → chunk-apga49vp.js} +2 -2
- package/dist/{chunk-8ex0y47w.js.map → chunk-apga49vp.js.map} +1 -1
- package/dist/{chunk-yjszzjyj.js → chunk-attr793y.js} +2 -2
- package/dist/{chunk-yjszzjyj.js.map → chunk-attr793y.js.map} +1 -1
- package/dist/{chunk-1x9ghjpt.js → chunk-bsa6b82q.js} +1 -1
- package/dist/{chunk-ceb4jcrm.js → chunk-bstn00nx.js} +2 -2
- package/dist/{chunk-ceb4jcrm.js.map → chunk-bstn00nx.js.map} +1 -1
- package/dist/{chunk-azd6da5h.js → chunk-bykkqvd8.js} +2 -2
- package/dist/{chunk-azd6da5h.js.map → chunk-bykkqvd8.js.map} +1 -1
- package/dist/{chunk-9k46m1vf.js → chunk-cee5gq7t.js} +2 -2
- package/dist/{chunk-9k46m1vf.js.map → chunk-cee5gq7t.js.map} +1 -1
- package/dist/{chunk-9dkpv8ev.js → chunk-dxh8njb4.js} +2 -2
- package/dist/{chunk-9dkpv8ev.js.map → chunk-dxh8njb4.js.map} +1 -1
- package/dist/{chunk-maqkrbsb.js → chunk-e06t0625.js} +2 -2
- package/dist/{chunk-maqkrbsb.js.map → chunk-e06t0625.js.map} +1 -1
- package/dist/{chunk-0839f72f.js → chunk-e9z8p2fy.js} +2 -2
- package/dist/{chunk-0839f72f.js.map → chunk-e9z8p2fy.js.map} +1 -1
- package/dist/{chunk-6hs102jh.js → chunk-eqv7yxk7.js} +2 -2
- package/dist/{chunk-6hs102jh.js.map → chunk-eqv7yxk7.js.map} +1 -1
- package/dist/{chunk-m6t5a0me.js → chunk-fqqbnp0z.js} +2 -2
- package/dist/{chunk-m6t5a0me.js.map → chunk-fqqbnp0z.js.map} +1 -1
- package/dist/{chunk-1w5dnkd1.js → chunk-g22kph4n.js} +2 -2
- package/dist/{chunk-1w5dnkd1.js.map → chunk-g22kph4n.js.map} +1 -1
- package/dist/{chunk-rvm5mkwm.js → chunk-g8sh9btf.js} +2 -2
- package/dist/{chunk-rvm5mkwm.js.map → chunk-g8sh9btf.js.map} +1 -1
- package/dist/{chunk-a78b9v7h.js → chunk-gvdg52ew.js} +4 -4
- package/dist/{chunk-a78b9v7h.js.map → chunk-gvdg52ew.js.map} +1 -1
- package/dist/{chunk-8ky8cmde.js → chunk-h8eawyhx.js} +2 -2
- package/dist/{chunk-8ky8cmde.js.map → chunk-h8eawyhx.js.map} +1 -1
- package/dist/{chunk-r567t83k.js → chunk-hcw671mg.js} +4 -4
- package/dist/{chunk-r567t83k.js.map → chunk-hcw671mg.js.map} +1 -1
- package/dist/{chunk-ej4kf7m5.js → chunk-hh5bs656.js} +3 -3
- package/dist/{chunk-ej4kf7m5.js.map → chunk-hh5bs656.js.map} +1 -1
- package/dist/{chunk-3q7sc68p.js → chunk-j6ygdvj8.js} +2 -2
- package/dist/{chunk-3q7sc68p.js.map → chunk-j6ygdvj8.js.map} +1 -1
- package/dist/{chunk-t2nsn0r2.js → chunk-jzpbwvbt.js} +2 -2
- package/dist/{chunk-t2nsn0r2.js.map → chunk-jzpbwvbt.js.map} +1 -1
- package/dist/{chunk-en33hg1c.js → chunk-k79ajvtc.js} +2 -2
- package/dist/{chunk-en33hg1c.js.map → chunk-k79ajvtc.js.map} +1 -1
- package/dist/{chunk-t0wfj6hy.js → chunk-k8pn2qvf.js} +2 -2
- package/dist/{chunk-t0wfj6hy.js.map → chunk-k8pn2qvf.js.map} +1 -1
- package/dist/{chunk-83cvkhzn.js → chunk-kmh402m4.js} +2 -2
- package/dist/{chunk-83cvkhzn.js.map → chunk-kmh402m4.js.map} +1 -1
- package/dist/{chunk-b4mg6v4g.js → chunk-m9am5fqq.js} +5 -5
- package/dist/{chunk-b4mg6v4g.js.map → chunk-m9am5fqq.js.map} +3 -3
- package/dist/{chunk-m8yd59gg.js → chunk-mr3szvr3.js} +2 -2
- package/dist/{chunk-m8yd59gg.js.map → chunk-mr3szvr3.js.map} +1 -1
- package/dist/{chunk-mkw35cz7.js → chunk-mtamgvf4.js} +2 -2
- package/dist/{chunk-mkw35cz7.js.map → chunk-mtamgvf4.js.map} +1 -1
- package/dist/{chunk-5xfpqda5.js → chunk-mv1rs9he.js} +1 -1
- package/dist/{chunk-s29tgy4y.js → chunk-mzkzgp2j.js} +2 -2
- package/dist/{chunk-s29tgy4y.js.map → chunk-mzkzgp2j.js.map} +1 -1
- package/dist/{chunk-9xzg05xg.js → chunk-n9n4qt20.js} +3 -3
- package/dist/{chunk-9xzg05xg.js.map → chunk-n9n4qt20.js.map} +1 -1
- package/dist/{chunk-2ra5skyk.js → chunk-p27y4xrw.js} +2 -2
- package/dist/{chunk-2ra5skyk.js.map → chunk-p27y4xrw.js.map} +1 -1
- package/dist/{chunk-sgwgj2q0.js → chunk-pq657qcp.js} +1 -1
- package/dist/{chunk-63q7ycwt.js → chunk-pwbm3x1y.js} +2 -2
- package/dist/{chunk-63q7ycwt.js.map → chunk-pwbm3x1y.js.map} +1 -1
- package/dist/{chunk-w4ma7978.js → chunk-q4qw629n.js} +2 -2
- package/dist/{chunk-w4ma7978.js.map → chunk-q4qw629n.js.map} +1 -1
- package/dist/{chunk-f2e7n064.js → chunk-q9na1syb.js} +2 -2
- package/dist/{chunk-f2e7n064.js.map → chunk-q9na1syb.js.map} +1 -1
- package/dist/{chunk-x0t3t7g3.js → chunk-rkbwb3v5.js} +2 -2
- package/dist/{chunk-x0t3t7g3.js.map → chunk-rkbwb3v5.js.map} +1 -1
- package/dist/{chunk-0t2ym9ap.js → chunk-rma7afjd.js} +3 -3
- package/dist/{chunk-0t2ym9ap.js.map → chunk-rma7afjd.js.map} +1 -1
- package/dist/{chunk-f5qdyw45.js → chunk-tr9ynv3w.js} +2 -2
- package/dist/{chunk-f5qdyw45.js.map → chunk-tr9ynv3w.js.map} +1 -1
- package/dist/{chunk-kzc6bn8n.js → chunk-twrf6d08.js} +2 -2
- package/dist/{chunk-kzc6bn8n.js.map → chunk-twrf6d08.js.map} +1 -1
- package/dist/{chunk-6jd0e1dz.js → chunk-v9z4x5j2.js} +2 -2
- package/dist/{chunk-6jd0e1dz.js.map → chunk-v9z4x5j2.js.map} +1 -1
- package/dist/{chunk-jmhrpfqn.js → chunk-vm5t0j24.js} +2 -2
- package/dist/{chunk-jmhrpfqn.js.map → chunk-vm5t0j24.js.map} +1 -1
- package/dist/{chunk-a37shxb1.js → chunk-xv58jnpb.js} +2 -2
- package/dist/{chunk-a37shxb1.js.map → chunk-xv58jnpb.js.map} +1 -1
- package/dist/{chunk-p57nt0pm.js → chunk-ydkv9e8w.js} +3 -3
- package/dist/{chunk-p57nt0pm.js.map → chunk-ydkv9e8w.js.map} +1 -1
- package/dist/{chunk-aw8gj99f.js → chunk-ymdpt00k.js} +2 -2
- package/dist/{chunk-aw8gj99f.js.map → chunk-ymdpt00k.js.map} +1 -1
- package/dist/{chunk-5g7m7g4a.js → chunk-z7tsh9qr.js} +3 -3
- package/dist/{chunk-5g7m7g4a.js.map → chunk-z7tsh9qr.js.map} +1 -1
- package/dist/config/index.js +1 -1
- package/dist/console/run.js +2 -2
- package/dist/console/run.js.map +1 -1
- package/dist/container/index.js +2 -2
- package/dist/container/index.js.map +1 -1
- package/dist/database/index.js +2 -2
- package/dist/database/index.js.map +1 -1
- package/dist/email/index.js +2 -2
- package/dist/email/index.js.map +1 -1
- package/dist/facades/index.js +2 -2
- package/dist/facades/index.js.map +1 -1
- package/dist/foundation/index.js +2 -2
- package/dist/foundation/index.js.map +1 -1
- package/dist/http/index.js +2 -2
- package/dist/http/index.js.map +1 -1
- package/dist/i18n/dictionaryRuntime.js +2 -2
- package/dist/i18n/dictionaryRuntime.js.map +1 -1
- package/dist/i18n/index.js +2 -2
- package/dist/i18n/index.js.map +1 -1
- package/dist/kernel/index.js +2 -2
- package/dist/kernel/index.js.map +1 -1
- package/dist/orm/index.js +2 -2
- package/dist/orm/index.js.map +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/index.js.map +1 -1
- package/dist/services/index.d.ts +2 -1
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +9 -9
- package/dist/services/index.js.map +4 -3
- package/dist/services/mcp/http/McpHttpServer.d.ts +81 -1
- package/dist/services/mcp/http/McpHttpServer.d.ts.map +1 -1
- package/dist/services/mcp/http/oauth/prismaStore.d.ts +112 -0
- package/dist/services/mcp/http/oauth/prismaStore.d.ts.map +1 -0
- package/dist/services/queue/work.js +2 -2
- package/dist/services/queue/work.js.map +1 -1
- package/dist/stats/route-table.js +1 -1
- package/dist/support/index.js +2 -2
- package/dist/support/index.js.map +1 -1
- package/dist/vitest/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-b6mgrrk6.js +0 -5
- /package/dist/{chunk-fsem81ec.js.map → chunk-29jmaj16.js.map} +0 -0
- /package/dist/{chunk-236be97q.js.map → chunk-63xwah5k.js.map} +0 -0
- /package/dist/{chunk-b4jx4fzq.js.map → chunk-65wy1r1a.js.map} +0 -0
- /package/dist/{chunk-1x9ghjpt.js.map → chunk-bsa6b82q.js.map} +0 -0
- /package/dist/{chunk-5xfpqda5.js.map → chunk-mv1rs9he.js.map} +0 -0
- /package/dist/{chunk-sgwgj2q0.js.map → chunk-pq657qcp.js.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{R as S,T as h,U as u}from"./chunk-
|
|
2
|
+
import{R as S,T as h,U as u}from"./chunk-k8pn2qvf.js";import{ma as q,na as w}from"./chunk-mv1rs9he.js";import"./chunk-a22h5cby.js";import"./chunk-epvpmakp.js";import"./chunk-r3v2cnrj.js";import"./chunk-twrf6d08.js";import"./chunk-kk18xqgc.js";import"./chunk-ymdpt00k.js";import{Li as N}from"./chunk-cee5gq7t.js";import{bl as y}from"./chunk-g8sh9btf.js";import{ql as C}from"./chunk-fqqbnp0z.js";import"./chunk-jzpbwvbt.js";import{join as $J}from"path";import{createServer as zJ}from"vite";import{join as l}from"path";import{IncomingMessage as d,ServerResponse as p}from"http";import{Socket as i}from"net";function c(J){return J.replace(/\x1b\[[0-9;]*m/g,"").replace(/\[[0-9;]*m/g,"").replace(/\n\s*\n/g,`
|
|
3
3
|
`).split(`
|
|
4
4
|
`).map((W)=>W.trim()).filter((W)=>W.length>0).join(`
|
|
5
5
|
`).trim()}function _(J){return`
|
|
@@ -55,4 +55,4 @@ window.$RefreshSig$ = () => (type) => type;
|
|
|
55
55
|
window.__vite_plugin_react_preamble_installed__ = true;
|
|
56
56
|
`;function t(J){let{pathname:W}=new URL(J.url),Z=($)=>new Response($,{headers:{"Content-Type":"application/javascript"}});if(W===T)return Z(a);if(W.startsWith("/render-error.js"))return Z("window.render_error = true");if(W.startsWith("/refresh.js"))return Z(s);return null}function P(J,W,Z){let $=l(process.cwd(),"app");return async(z)=>{let{pathname:Q}=new URL(z.url),U=(G)=>{if(console.error(G),Z.ssrFixStacktrace?.(G),O(G),C(Q))return new Response(JSON.stringify({error:N("server_error",G?.message??String(G),500)}),{status:500,headers:{"Content-Type":"application/json"}});return globalThis.__gemiErrorPageServed=!0,new Response(_(I(G)),{status:500,headers:{"Content-Type":"text/html"}})},X=async(G)=>{let j=t(G);if(j)return j;try{let L=J.fetch.bind(J),K=await n(Z,G)??await L(G);if(K instanceof Response)return K;let A={},F={},D={},m=(Y,B)=>`"${Y}": () => import("${B}")`,b=[];for(let Y of["404",...J.getFlatComponentTree.call(J)]){if(Bun.env.NODE_ENV==="test")break;let B=`${process.env.APP_DIR}`,x=await V(Z).import(`${B}/views/${Y}.tsx`);A[Y]=x.default,F[Y]=x?.OpenGraph,D[Y]=x,b.push(m(Y,`/app/views/${Y}.tsx`))}let v=`{${b.join(",")}}`;return await K({getStyles:async(Y,B)=>await S($,Z,Y,B?.layout),resolveIsland:(Y)=>({src:`/${Y}${y}`,preload:[]}),buildId:"dev",bootstrapModules:[T],viewImportMap:A,viewModules:D,ogMap:F,loaders:v,cssManifest:{}})}catch(L){return U(L)}};return await W(z,(G)=>J.withGlobalMiddleware(G,X,U))}}function r(J){try{return Bun.listen({hostname:"0.0.0.0",port:J,socket:{data(){}}}).stop(!0),!0}catch(W){return W?.code!=="EADDRINUSE"}}function f(J,W=r){let Z=24678+(J-5173);if(Z>65471)Z=24678;for(let $=Z;$<Z+64;$++)if(W($))return $;throw Error(`Could not find a free port for Vite's HMR websocket: tried ${Z}-${Z+64-1}. Set one explicitly in gemi.config.ts as \`vite: { server: { ws: { port } } }\`.`)}import{createServer as e}from"http";var JJ=new Set(["vite-hmr","vite-ping"]);async function R(J){let W=e((Z,$)=>{$.writeHead(426,{"Content-Type":"text/plain"}),$.end("Upgrade Required")});return await new Promise((Z,$)=>{W.once("error",$),W.listen(J,"127.0.0.1",()=>{W.off("error",$),Z()})}),W}function k(J){if(!J||typeof J!=="object")return null;let Z=J.server?.address?.();if(Z&&typeof Z==="object"&&"port"in Z)return Number(Z.port)||null;return null}function E(J){if(J.headers.get("upgrade")?.toLowerCase()!=="websocket")return!1;return JJ.has(J.headers.get("sec-websocket-protocol")??"")}var WJ=(J)=>typeof J==="string"?J:new Uint8Array(J);async function g(J,W,Z){let $=new URL(J.url),z=J.headers.get("sec-websocket-protocol")??"vite-hmr",Q={host:J.headers.get("host")??$.host},U=J.headers.get("origin");if(U)Q.origin=U;let X=new WebSocket(`ws://127.0.0.1:${Z}${$.pathname}${$.search}`,{protocols:[z],headers:Q});X.binaryType="arraybuffer";let G={upstream:X,early:[]};if(X.onmessage=(K)=>{let A=WJ(K.data);if(G.browser)G.browser.send(A);else G.early.push(A)},X.onclose=(K)=>{G.browser?.close(ZJ(K.code),K.reason)},X.onerror=()=>{},!await new Promise((K)=>{X.addEventListener("open",()=>K(!0),{once:!0}),X.addEventListener("close",()=>K(!1),{once:!0})}))return new Response("Vite refused the HMR websocket",{status:403});if(!W.upgrade(J,{headers:{"Sec-WebSocket-Protocol":z},data:G}))return X.close(),new Response("WebSocket upgrade failed",{status:400});return}function ZJ(J){if(J===1000||J>=1001&&J<=1003||J>=1007&&J<=1014)return J;if(J>=3000&&J<=4999)return J;return 1000}var H={open(J){let W=J.data;for(let Z of W.early)J.send(Z);if(W.early=[],W.browser=J,W.upstream.readyState!==WebSocket.OPEN)J.close(1000)},message(J,W){if(J.data.upstream.readyState===WebSocket.OPEN)J.data.upstream.send(W)},close(J){let{upstream:W}=J.data;if(W.readyState<=WebSocket.OPEN)W.close()}};function GJ(J,W){let Z=W.websocket,$=(z)=>z.data?.gemiSocket===!0;return{...W.socketOptions(),maxPayloadLength:16777216,closeOnBackpressureLimit:!1,open:(z)=>$(z)?Z.open?.(z):J.open?.(z),message:(z,Q)=>$(z)?Z.message(z,Q):J.message(z,Q),close:(z,Q,U)=>$(z)?Z.close?.(z,Q,U):J.close?.(z,Q,U)}}var M=process.cwd(),QJ=$J(M,"app");if(!globalThis.__gemiErrorHooked)globalThis.__gemiErrorHooked=!0,process.on("unhandledRejection",(J)=>{console.error(J),O(J)}),process.on("uncaughtException",(J)=>{console.error(J),O(J)});async function TJ(J,W){let Z=Number(process.env.PORT)||5173,$=u(),z=Boolean(globalThis.__gemiVite),Q=globalThis.__gemiVite??=await zJ({configFile:!1,plugins:[w()],server:{middlewareMode:!0,port:Z,ws:{server:await R(f(Z))},allowedHosts:J.devAllowedHosts.call(J),watch:{ignored:(L)=>{let K=L.split(/[/\\]/).pop()??"";return K===".env"||K.startsWith(".env.")}}},appType:"custom",resolve:{dedupe:["react","react-dom"]},optimizeDeps:{include:["react","react-dom","react-dom/client"]},ssr:{external:[...q]}});process.env.ROOT_DIR=M,process.env.APP_DIR=QJ;let U=P(J,W,Q),X=k(Q.config?.server?.ws),G=J.sockets(),j=Bun.serve({port:Z,idleTimeout:$,fetch:(L,K)=>{if(X!==null&&E(L))return g(L,K,X);if(J.applyTrustedClientIp(L),G?.matches(L))return G.upgrade(L,K);return U(L)},websocket:G?GJ(H,G):H});if(await G?.start(j),z)V(Q).clearCache();if(z)if(globalThis.__gemiErrorActive&&globalThis.__gemiErrorPageServed)globalThis.__gemiErrorActive=!1,globalThis.__gemiErrorPageServed=!1,Q.ws.send({type:"full-reload"});else globalThis.__gemiErrorActive=!1,Q.ws.send({type:"custom",event:"http-reload"});else h({port:j.port,rootDir:M});return j}export{I as viteErrorPayload,TJ as httpDev};
|
|
57
57
|
|
|
58
|
-
//# debugId=
|
|
58
|
+
//# debugId=D47D1E31F0BBC9E564756E2164756E21
|
|
@@ -9,6 +9,6 @@
|
|
|
9
9
|
"import { createServer, type Server as NodeServer } from \"node:http\";\n\nimport type { Server, ServerWebSocket, WebSocketHandler } from \"bun\";\n\n// Vite's HMR websocket, carried on the dev server's own port.\n//\n// In middleware mode Vite has no HTTP server of its own, so by default it\n// stands up a second one for the websocket, on a second port (see\n// `hmrPort.ts`), and tells the browser to connect to `<page host>:<that port>`.\n// A reverse proxy or tunnel (ngrok, a container port mapping, a phone on the\n// LAN through https) only carries the port the page came from, so HMR could\n// not connect there, and the client logged connection failures forever.\n//\n// Vite can attach its websocket to a server it is handed (`server.ws.server`)\n// instead, and then tells the browser to connect to the page's own origin. That\n// server has to be a Node `http.Server`; the dev server is `Bun.serve`. So:\n//\n// - the Node server Vite is handed listens on loopback only, on the port\n// `resolveHmrPort` picked, and answers nothing but websocket upgrades;\n// - `Bun.serve` accepts the browser's upgrade on the page's origin and relays\n// frames both ways to that loopback server.\n//\n// The relay forwards the browser's `Host` and `Origin` and the request's query\n// (the `token`), so Vite still runs its own host and token checks against what\n// the browser actually sent.\n\n/** The subprotocols Vite's client opens its sockets with. */\nconst VITE_PROTOCOLS = new Set([\"vite-hmr\", \"vite-ping\"]);\n\n/**\n * Start the loopback Node server Vite attaches its HMR websocket to.\n * Everything but an upgrade gets `426 Upgrade Required`, as Vite's own\n * websocket server answers.\n */\nexport async function listenHmrServer(port: number): Promise<NodeServer> {\n const server = createServer((_req, res) => {\n res.writeHead(426, { \"Content-Type\": \"text/plain\" });\n res.end(\"Upgrade Required\");\n });\n await new Promise<void>((resolve, reject) => {\n server.once(\"error\", reject);\n server.listen(port, \"127.0.0.1\", () => {\n server.off(\"error\", reject);\n resolve();\n });\n });\n return server;\n}\n\n/**\n * The loopback port to relay to, read from the config Vite actually resolved,\n * so an app that set its own `server.ws` in `gemi.config.ts` is relayed to\n * where Vite really is, or not relayed at all. `null` when Vite was not given\n * a server (its websocket is then on a port of its own, and the client goes\n * there directly) or when HMR is off.\n */\nexport function hmrRelayPort(wsConfig: unknown): number | null {\n if (!wsConfig || typeof wsConfig !== \"object\") return null;\n const server = (wsConfig as { server?: { address?: () => unknown } }).server;\n const address = server?.address?.();\n if (address && typeof address === \"object\" && \"port\" in address) {\n return Number((address as { port: number }).port) || null;\n }\n return null;\n}\n\n/** Whether a request is the Vite client opening its HMR (or ping) socket. */\nexport function isHmrUpgrade(req: Request): boolean {\n if (req.headers.get(\"upgrade\")?.toLowerCase() !== \"websocket\") return false;\n return VITE_PROTOCOLS.has(req.headers.get(\"sec-websocket-protocol\") ?? \"\");\n}\n\nexport type HmrRelayData = {\n /** The socket to Vite, already open when the browser's is accepted. */\n upstream: WebSocket;\n /** Frames Vite sent before the browser's socket opened (its `connected`). */\n early: (string | Uint8Array)[];\n browser?: ServerWebSocket<HmrRelayData>;\n};\n\ntype Frame = string | Uint8Array;\n\nconst frameOf = (data: unknown): Frame =>\n typeof data === \"string\" ? data : new Uint8Array(data as ArrayBuffer);\n\n/**\n * Open the socket to Vite first, and accept the browser's upgrade only once\n * Vite has accepted it. Returns `undefined` once Bun has taken the request\n * over, or a refusal.\n *\n * The order matters. Vite refuses a socket whose host is not in\n * `allowedHosts`, or a cross-origin one without its token. Had the browser's\n * socket been accepted first and closed when Vite refused, the client would\n * read that as \"server connection lost\", ping (which Vite always answers),\n * and reload the page, forever. Refused before it opens, the client logs one\n * \"failed to connect to websocket\" and the page keeps working.\n */\nexport async function upgradeHmr(\n req: Request,\n server: Server<HmrRelayData>,\n port: number,\n): Promise<Response | undefined> {\n const url = new URL(req.url);\n const protocol = req.headers.get(\"sec-websocket-protocol\") ?? \"vite-hmr\";\n // `Host` is what Vite's `allowedHosts` check reads; the URL's host is the\n // same value `Bun.serve` derived it from.\n const headers: Record<string, string> = {\n host: req.headers.get(\"host\") ?? url.host,\n };\n const origin = req.headers.get(\"origin\");\n if (origin) headers.origin = origin;\n\n const upstream = new WebSocket(\n `ws://127.0.0.1:${port}${url.pathname}${url.search}`,\n {\n protocols: [protocol],\n headers,\n } as any,\n );\n upstream.binaryType = \"arraybuffer\";\n const data: HmrRelayData = { upstream, early: [] };\n\n upstream.onmessage = (event) => {\n const frame = frameOf(event.data);\n if (data.browser) data.browser.send(frame);\n else data.early.push(frame);\n };\n upstream.onclose = (event) => {\n data.browser?.close(sendableCloseCode(event.code), event.reason);\n };\n upstream.onerror = () => {\n // A `close` follows; it ends the browser's socket if there is one.\n };\n\n const opened = await new Promise<boolean>((resolve) => {\n upstream.addEventListener(\"open\", () => resolve(true), { once: true });\n upstream.addEventListener(\"close\", () => resolve(false), { once: true });\n });\n if (!opened) {\n return new Response(\"Vite refused the HMR websocket\", { status: 403 });\n }\n\n const upgraded = server.upgrade(req, {\n // The browser fails a connection whose response does not echo the\n // subprotocol it asked for.\n headers: { \"Sec-WebSocket-Protocol\": protocol },\n data,\n });\n if (!upgraded) {\n upstream.close();\n return new Response(\"WebSocket upgrade failed\", { status: 400 });\n }\n return undefined;\n}\n\n// A close code that may be sent in a close frame. 1005, 1006 and 1015 are\n// reported locally and never sent.\nfunction sendableCloseCode(code: number): number {\n if (\n code === 1000 ||\n (code >= 1001 && code <= 1003) ||\n (code >= 1007 && code <= 1014)\n ) {\n return code;\n }\n if (code >= 3000 && code <= 4999) return code;\n return 1000;\n}\n\n/** `Bun.serve`'s `websocket` option: relays frames to and from Vite. */\nexport const hmrRelayHandler: WebSocketHandler<HmrRelayData> = {\n open(ws: ServerWebSocket<HmrRelayData>) {\n const data = ws.data;\n for (const frame of data.early) ws.send(frame);\n data.early = [];\n data.browser = ws;\n // Vite may have hung up while the upgrade was in flight.\n if (data.upstream.readyState !== WebSocket.OPEN) ws.close(1000);\n },\n message(ws: ServerWebSocket<HmrRelayData>, message) {\n if (ws.data.upstream.readyState === WebSocket.OPEN) {\n ws.data.upstream.send(message);\n }\n },\n close(ws: ServerWebSocket<HmrRelayData>) {\n const { upstream } = ws.data;\n if (upstream.readyState <= WebSocket.OPEN) upstream.close();\n },\n};\n"
|
|
10
10
|
],
|
|
11
11
|
"mappings": ";weAAA,SAAS,QAET,iBAAS,QCDT,SAAS,OACT,oBAAS,cAAiB,OAC1B,WAAS,MCHT,SAAS,CAAmB,CAAC,EAAM,CACjC,OACE,EAEG,QAAQ,kBAAmB,EAAE,EAE7B,QAAQ,cAAe,EAAE,EAEzB,QAAQ,WAAY;AAAA,CAAI,EAExB,MAAM;AAAA,CAAI,EACV,IAAI,CAAC,IAAS,EAAK,KAAK,CAAC,EACzB,OAAO,CAAC,IAAS,EAAK,OAAS,CAAC,EAChC,KAAK;AAAA,CAAI,EACT,KAAK,EAIL,SAAS,CAAe,CAAC,EAAU,CACxC,MAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QA0BD,EAAoB,SAAS;AAAA,oBACjB,KAAK,UAAU,EAAK,OAAO,oBAAoB,CAAG,EAAG,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ED5B1E,SAAS,CAAc,CAAC,EAAqB,EAA4C,CACvF,IAAM,EAAM,IAAI,IAAI,EAAQ,GAAG,EAEzB,EAAM,IAAI,EAAgB,IAAI,CAAQ,EAC5C,EAAI,IAAM,EAAI,SAAW,EAAI,OAC7B,EAAI,OAAS,EAAQ,OACrB,EAAI,QAAU,OAAO,YAAY,EAAQ,OAAO,EAEhD,IAAM,EAAM,IAAI,EAAe,CAAG,EAC5B,EAA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EACtB,EAAS,IAAI,MAAW,CAC5B,KAAM,EACN,cACA,MAAO,CAAC,EAAK,IAAW,CACtB,GAAI,IAAc,MAAQ,EAAa,CAAG,EACxC,OAAO,EAAW,EAAK,EAAQ,CAAS,EAK1C,GADA,EAAI,qBAAqB,CAAG,EACxB,GAAS,QAAQ,CAAG,EACtB,OAAO,EAAQ,QAAQ,EAAK,CAAM,EAEpC,OAAO,EAAS,CAAG,GAErB,UAAW,EAAU,GAAqB,EAAiB,CAAO,EAAI,CACxE,CAAC,EAgCD,GA/BA,MAAM,GAAS,MAAM,CAAM,EA+BvB,EACF,EAAU,CAAI,EAAE,WAAW,EAQ7B,GAAI,EAMF,GAAI,WAAW,mBAAqB,WAAW,sBAC7C,WAAW,kBAAoB,GAC/B,WAAW,sBAAwB,GACnC,EAAK,GAAG,KAAK,CAAE,KAAM,aAAc,CAAC,EAEpC,gBAAW,kBAAoB,GAC/B,EAAK,GAAG,KAAK,CAAE,KAAM,SAAU,MAAO,aAAc,CAAC,EAIvD,OAAmB,CAAE,KAAM,EAAO,KAAM,SAAQ,CAAC,EAGnD,OAAO",
|
|
12
|
-
"debugId": "
|
|
12
|
+
"debugId": "D47D1E31F0BBC9E564756E2164756E21",
|
|
13
13
|
"names": []
|
|
14
14
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{_d as o}from"./chunk-ydkv9e8w.js";import{$d as i}from"./chunk-eqv7yxk7.js";import{Uj as t}from"./chunk-attr793y.js";import{Uk as r}from"./chunk-mr3szvr3.js";class n extends i{register(){this.app.singleton(r,()=>new r(t(o(),this.app.config.get("translation",{}))))}}
|
|
3
|
+
export{n as ab};
|
|
4
|
+
|
|
5
|
+
//# debugId=F798B100C6F4F72064756E2164756E21
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"import { ServiceProvider } from \"../support/ServiceProvider\";\nimport { withDefaults } from \"../support/withDefaults\";\nimport { Translator } from \"./Translator\";\nimport { translationConfigDefaults, type TranslationConfig } from \"./config\";\n\nexport class TranslationServiceProvider extends ServiceProvider {\n register() {\n this.app.singleton(\n Translator,\n () =>\n new Translator(\n withDefaults(\n translationConfigDefaults(),\n this.app.config.get<TranslationConfig>(\"translation\", {}),\n ),\n ),\n );\n }\n}\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": ";sLAKO,AAAM,IAAmC,LAAgB,CAC9D,QAAQ,EAAG,CACT,KAAK,IAAI,UACP,EACA,IACE,IAAI,EACF,EACE,EAA0B,EAC1B,KAAK,IAAI,OAAO,IAAuB,cAAe,CAAC,CAAC,CAC1D,CACF,CACJ,EAEJ",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "F798B100C6F4F72064756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ua as B,va as C,xa as E}from"./chunk-epvpmakp.js";import{
|
|
2
|
+
import{ua as B,va as C,xa as E}from"./chunk-epvpmakp.js";import{Bk as z,Ck as A,zk as x}from"./chunk-2x6cv37t.js";function M(b,f={}){let j=B(b,f.sourceLocale);return G(E(b),j,(q)=>C(b,q,j))}function N(b,f){let j=Object.keys(f);return G(b,j,(q)=>{let v=f[q]??f[j[0]];if(!v)return{};return v().then((k)=>k.default)})}function G(b,f,j){let q={id:b,locales:f,load:j};x(q);let v=()=>x(q);return{id:b,locales:f,load:(k)=>{return v(),z(b,k)},loadForRender:(k)=>{return v(),A(b,k)},get:(k)=>{v();let w=z(b,k);if(w instanceof Promise){w.catch(()=>{});return}return w}}}
|
|
3
3
|
export{M as ca,N as da};
|
|
4
4
|
|
|
5
|
-
//# debugId=
|
|
5
|
+
//# debugId=3DB2AA37566E41EF64756E2164756E21
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"import {\n dictionaryId,\n dictionaryLocales,\n localeStrings,\n type DictionaryTranslations,\n type LocaleStrings,\n} from \"./dictionaryShape\";\nimport {\n loadDictionary,\n loadDictionaryForRender,\n registerDictionary,\n type RenderThenable,\n} from \"./dictionaryRegistry\";\n\ndeclare const brand: unique symbol;\n\nexport interface DictionaryHandle<\n T extends DictionaryTranslations = DictionaryTranslations,\n> {\n readonly id: string;\n /** Locales this dictionary declares, source language first. */\n readonly locales: readonly string[];\n /**\n * Strings for `locale`. Synchronous when they are already in memory —\n * always, for an unbundled dictionary; after a preload or the SSR seed, for a\n * bundled one.\n */\n load(locale: string): LocaleStrings | Promise<LocaleStrings>;\n /**\n * `load`, but as the exact thing React's `use()` wants: never rejecting, so\n * a failed locale chunk degrades the component to rendering keys instead of\n * unmounting it into an error boundary; and always a thenable, even when the\n * strings are already in memory. The caller skips `use()` only for a\n * thenable built from strings already in hand, which carries them as\n * `inHand`; every thenable a render could have suspended on still goes\n * through it. `loadDictionaryForRender` has the whole reasoning.\n */\n loadForRender(locale: string): RenderThenable;\n get(locale: string): LocaleStrings | undefined;\n /** Type-only: carries the literal's shape through to `useDictionary`. */\n readonly [brand]?: T;\n}\n\n/**\n * Declare the strings a component needs, next to the component.\n *\n * ```ts\n * export const homeDict = defineDictionary({\n * title: { \"en-US\": \"Welcome {{name}}\", \"tr-TR\": \"Hoş geldin {{name}}\" },\n * });\n * ```\n *\n * As written this holds every locale. Under gemi's Vite plugin the call is\n * rewritten so each locale becomes its own chunk and a page downloads only the\n * one it renders in — but the plugin is strictly an optimization, and the\n * behaviour is identical without it (in `bun test`, and in server code that\n * does not go through the bundler).\n *\n * The first locale in the literal is the source language: a key missing from\n * another locale falls back to it rather than rendering as its own key.\n */\nexport interface DefineDictionaryOptions {\n /**\n * The locale this dictionary is authored in. Keys missing from another locale\n * fall back to it, and it is what renders when the app has no locale\n * configured.\n *\n * Optional, but worth setting on any dictionary that is not uniformly\n * translated: without it the source language is whichever locale appears\n * first in the literal, so adding a key at the top can re-point every\n * fallback in the dictionary.\n */\n sourceLocale?: string;\n}\n\nexport function defineDictionary<const T extends DictionaryTranslations>(\n translations: T,\n options: DefineDictionaryOptions = {},\n): DictionaryHandle<T> {\n const locales = dictionaryLocales(translations, options.sourceLocale);\n return createHandle(dictionaryId(translations), locales, (locale) =>\n localeStrings(translations, locale, locales),\n );\n}\n\n/**\n * The rewritten form of a `defineDictionary` call — emitted by\n * `packages/gemi/vite/dictionaryPlugin.ts`, never written by hand. `loaders`\n * holds one dynamic import per locale so the bundler emits one chunk per\n * locale and the untaken ones never reach the browser.\n */\nexport function __gemi_dict__<\n const T extends DictionaryTranslations = DictionaryTranslations,\n>(\n id: string,\n loaders: Record<string, () => Promise<{ default: LocaleStrings }>>,\n): DictionaryHandle<T> {\n const locales = Object.keys(loaders);\n return createHandle(id, locales, (locale) => {\n // An unknown locale falls back to the source language, matching what\n // `localeStrings` does per key on the unbundled path.\n const load = loaders[locale] ?? loaders[locales[0]];\n if (!load) {\n return {};\n }\n return load().then((mod) => mod.default);\n });\n}\n\nfunction createHandle<T extends DictionaryTranslations>(\n id: string,\n locales: string[],\n load: (locale: string) => LocaleStrings | Promise<LocaleStrings>,\n): DictionaryHandle<T> {\n const entry = { id, locales, load };\n registerDictionary(entry);\n\n // Re-asserted on every read rather than only at construction. A handle is\n // created once, at module scope, but the registry it delegates to can be\n // emptied under it — a test's `afterEach` reset, an HMR boundary — and the\n // handle would then be permanently orphaned, throwing \"Unknown dictionary\"\n // for a dictionary the caller is holding. `registerDictionary` is a no-op\n // when the id is already there, so this costs one Map lookup.\n const ensure = () => registerDictionary(entry);\n\n return {\n id,\n locales,\n // Routed through the registry rather than calling `load` directly so\n // concurrent readers share one in-flight import and results are cached.\n load: (locale: string) => {\n ensure();\n return loadDictionary(id, locale);\n },\n loadForRender: (locale: string) => {\n ensure();\n return loadDictionaryForRender(id, locale);\n },\n get: (locale: string) => {\n ensure();\n const strings = loadDictionary(id, locale);\n if (strings instanceof Promise) {\n // Nothing downstream awaits this one — `get` is the synchronous peek,\n // and the caller is about to discard it. An unattached rejection (a\n // locale chunk that 404s mid-deploy) would surface as an\n // `unhandledRejection`, which under Node's default handler takes the\n // process down over one missing translation file. The load itself is\n // still cached and still retried through `loadDictionary`.\n strings.catch(() => {});\n return undefined;\n }\n return strings;\n },\n };\n}\n\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": ";wHA2EO,GAAS,CAAwD,CACtE,EACA,EAAmC,CAAC,EACf,CACrB,IAAM,EAAU,EAAkB,EAAc,EAAQ,YAAY,EACpE,OAAO,EAAa,EAAa,CAAY,EAAG,EAAS,CAAC,IACxD,EAAc,EAAc,EAAQ,CAAO,CAC7C,EASK,SAAS,CAEf,CACC,EACA,EACqB,CACrB,IAAM,EAAU,OAAO,KAAK,CAAO,EACnC,OAAO,EAAa,EAAI,EAAS,CAAC,IAAW,CAG3C,IAAM,EAAO,EAAQ,IAAW,EAAQ,EAAQ,IAChD,GAAI,CAAC,EACH,MAAO,CAAC,EAEV,OAAO,EAAK,EAAE,KAAK,CAAC,IAAQ,EAAI,OAAO,EACxC,EAGH,SAAS,CAA8C,CACrD,EACA,EACA,EACqB,CACrB,IAAM,EAAQ,CAAE,KAAI,UAAS,MAAK,EAClC,EAAmB,CAAK,EAQxB,IAAM,EAAS,IAAM,EAAmB,CAAK,EAE7C,MAAO,CACL,KACA,UAGA,KAAM,CAAC,IAAmB,CAExB,OADA,EAAO,EACA,EAAe,EAAI,CAAM,GAElC,cAAe,CAAC,IAAmB,CAEjC,OADA,EAAO,EACA,EAAwB,EAAI,CAAM,GAE3C,IAAK,CAAC,IAAmB,CACvB,EAAO,EACP,IAAM,EAAU,EAAe,EAAI,CAAM,EACzC,GAAI,aAAmB,QAAS,CAO9B,EAAQ,MAAM,IAAM,EAAE,EACtB,OAEF,OAAO,EAEX",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "3DB2AA37566E41EF64756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|