gemi 0.58.0 → 0.59.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/Agent.d.ts +33 -0
- package/dist/ai/Agent.d.ts.map +1 -0
- package/dist/ai/AgentController.d.ts +8 -0
- package/dist/ai/AgentController.d.ts.map +1 -0
- package/dist/ai/useChat.d.ts +12 -0
- package/dist/ai/useChat.d.ts.map +1 -0
- package/dist/app/index.js +1 -1
- package/dist/broadcasting/index.js +1 -1
- package/dist/bun/plugin.js +1 -1
- package/dist/bun/preload.js +1 -1
- package/dist/{chunk-szss069z.js → chunk-06j6rsew.js} +2 -2
- package/dist/{chunk-szss069z.js.map → chunk-06j6rsew.js.map} +1 -1
- package/dist/{chunk-yjzs247s.js → chunk-0fm6jh9b.js} +2 -2
- package/dist/{chunk-yjzs247s.js.map → chunk-0fm6jh9b.js.map} +1 -1
- package/dist/chunk-23h0dmx2.js +5 -0
- package/dist/{chunk-87qab82w.js.map → chunk-23h0dmx2.js.map} +3 -3
- package/dist/{chunk-m3xy5xyf.js → chunk-2cwcfwg3.js} +2 -2
- package/dist/{chunk-m3xy5xyf.js.map → chunk-2cwcfwg3.js.map} +1 -1
- package/dist/{chunk-xzk827r3.js → chunk-2khdxyjb.js} +2 -2
- package/dist/{chunk-xzk827r3.js.map → chunk-2khdxyjb.js.map} +1 -1
- package/dist/{chunk-sy7jbdeb.js → chunk-3296fwss.js} +2 -2
- package/dist/{chunk-sy7jbdeb.js.map → chunk-3296fwss.js.map} +1 -1
- package/dist/{chunk-xdv1b8mr.js → chunk-3gvjn3q4.js} +2 -2
- package/dist/{chunk-xdv1b8mr.js.map → chunk-3gvjn3q4.js.map} +1 -1
- package/dist/{chunk-jhkjz9jr.js → chunk-4dan69s4.js} +2 -2
- package/dist/{chunk-3zxwscmf.js.map → chunk-4dan69s4.js.map} +1 -1
- package/dist/{chunk-hxf1re93.js → chunk-4mcyyh1v.js} +2 -2
- package/dist/{chunk-hxf1re93.js.map → chunk-4mcyyh1v.js.map} +1 -1
- package/dist/{chunk-w62m5f0n.js → chunk-5gdv4n4a.js} +3 -3
- package/dist/{chunk-w62m5f0n.js.map → chunk-5gdv4n4a.js.map} +1 -1
- package/dist/{chunk-j0c6ytkj.js → chunk-8kj3zrm9.js} +3 -3
- package/dist/{chunk-j0c6ytkj.js.map → chunk-8kj3zrm9.js.map} +1 -1
- package/dist/{chunk-0a2xgcj3.js → chunk-98a3k7bp.js} +2 -2
- package/dist/{chunk-0a2xgcj3.js.map → chunk-98a3k7bp.js.map} +1 -1
- package/dist/{chunk-5athahgr.js → chunk-9gsdcjt7.js} +2 -2
- package/dist/{chunk-5athahgr.js.map → chunk-9gsdcjt7.js.map} +1 -1
- package/dist/{chunk-pmhd6zfc.js → chunk-b0t4zp6b.js} +2 -2
- package/dist/{chunk-pmhd6zfc.js.map → chunk-b0t4zp6b.js.map} +1 -1
- package/dist/{chunk-3xadx444.js → chunk-bn1v4sfs.js} +2 -2
- package/dist/{chunk-3xadx444.js.map → chunk-bn1v4sfs.js.map} +1 -1
- package/dist/{chunk-9m2tbf3n.js → chunk-c40n5r4v.js} +2 -2
- package/dist/{chunk-9m2tbf3n.js.map → chunk-c40n5r4v.js.map} +1 -1
- package/dist/{chunk-a2sgjpvq.js → chunk-cejf873g.js} +2 -2
- package/dist/{chunk-a2sgjpvq.js.map → chunk-cejf873g.js.map} +1 -1
- package/dist/{chunk-tss5svjr.js → chunk-cw9y6k15.js} +2 -2
- package/dist/{chunk-tss5svjr.js.map → chunk-cw9y6k15.js.map} +1 -1
- package/dist/{chunk-5n2rvfh3.js → chunk-cyrxdj6a.js} +2 -2
- package/dist/{chunk-5n2rvfh3.js.map → chunk-cyrxdj6a.js.map} +1 -1
- package/dist/chunk-dgasxgsm.js +19 -0
- package/dist/{chunk-hwa5sqw5.js.map → chunk-dgasxgsm.js.map} +6 -6
- package/dist/{chunk-3g5bjvdf.js → chunk-f6dd4gd8.js} +2 -2
- package/dist/{chunk-3g5bjvdf.js.map → chunk-f6dd4gd8.js.map} +1 -1
- package/dist/{chunk-qgxr0g36.js → chunk-fb4cy6sq.js} +2 -2
- package/dist/{chunk-qgxr0g36.js.map → chunk-fb4cy6sq.js.map} +1 -1
- package/dist/{chunk-7ef5n8k2.js → chunk-fbvvqf9b.js} +2 -2
- package/dist/{chunk-7ef5n8k2.js.map → chunk-fbvvqf9b.js.map} +1 -1
- package/dist/{chunk-zbxgbr12.js → chunk-fxy42w6n.js} +2 -2
- package/dist/{chunk-zbxgbr12.js.map → chunk-fxy42w6n.js.map} +1 -1
- package/dist/{chunk-xey9cbap.js → chunk-get4mkx8.js} +2 -2
- package/dist/{chunk-xey9cbap.js.map → chunk-get4mkx8.js.map} +1 -1
- package/dist/chunk-gfma8e03.js +55 -0
- package/dist/chunk-gfma8e03.js.map +11 -0
- package/dist/{chunk-3zxwscmf.js → chunk-gwchvzdp.js} +2 -2
- package/dist/{chunk-jhkjz9jr.js.map → chunk-gwchvzdp.js.map} +1 -1
- package/dist/{chunk-k0fvsyeh.js → chunk-hsfjt13m.js} +1 -1
- package/dist/{chunk-yf7vz71n.js → chunk-hwhw98hc.js} +1 -1
- package/dist/{chunk-fjm4y8bn.js → chunk-hxb1eg2z.js} +2 -2
- package/dist/{chunk-fjm4y8bn.js.map → chunk-hxb1eg2z.js.map} +1 -1
- package/dist/{chunk-7b0x860b.js → chunk-j06g4sqc.js} +2 -2
- package/dist/{chunk-7b0x860b.js.map → chunk-j06g4sqc.js.map} +1 -1
- package/dist/{chunk-dgsgjg53.js → chunk-j23cengk.js} +2 -2
- package/dist/{chunk-dgsgjg53.js.map → chunk-j23cengk.js.map} +1 -1
- package/dist/{chunk-8gew8b9a.js → chunk-n412aa9s.js} +3 -3
- package/dist/{chunk-8gew8b9a.js.map → chunk-n412aa9s.js.map} +1 -1
- package/dist/{chunk-437085pe.js → chunk-p3qd0gqa.js} +2 -2
- package/dist/{chunk-437085pe.js.map → chunk-p3qd0gqa.js.map} +1 -1
- package/dist/{chunk-gw6agevz.js → chunk-pkjq9833.js} +3 -3
- package/dist/{chunk-gw6agevz.js.map → chunk-pkjq9833.js.map} +1 -1
- package/dist/{chunk-7j6wbv12.js → chunk-q0y0j3ne.js} +2 -2
- package/dist/{chunk-7j6wbv12.js.map → chunk-q0y0j3ne.js.map} +1 -1
- package/dist/chunk-q6qghsy7.js +5 -0
- package/dist/{chunk-b35e128b.js.map → chunk-q6qghsy7.js.map} +1 -1
- package/dist/{chunk-wbrj0gya.js → chunk-qva4841r.js} +2 -2
- package/dist/{chunk-wbrj0gya.js.map → chunk-qva4841r.js.map} +1 -1
- package/dist/{chunk-86jebsm4.js → chunk-rkbv3df7.js} +3 -3
- package/dist/{chunk-86jebsm4.js.map → chunk-rkbv3df7.js.map} +1 -1
- package/dist/{chunk-keehyx51.js → chunk-rpjsmr41.js} +2 -2
- package/dist/{chunk-keehyx51.js.map → chunk-rpjsmr41.js.map} +1 -1
- package/dist/{chunk-mwpdp09e.js → chunk-spbgpndn.js} +2 -2
- package/dist/{chunk-mwpdp09e.js.map → chunk-spbgpndn.js.map} +1 -1
- package/dist/{chunk-yy0eb9wn.js → chunk-stq96kya.js} +2 -2
- package/dist/{chunk-yy0eb9wn.js.map → chunk-stq96kya.js.map} +1 -1
- package/dist/{chunk-d125j8t0.js → chunk-tds3xq6b.js} +3 -3
- package/dist/{chunk-d125j8t0.js.map → chunk-tds3xq6b.js.map} +1 -1
- package/dist/{chunk-3337e5g0.js → chunk-tey1xayb.js} +2 -2
- package/dist/{chunk-3337e5g0.js.map → chunk-tey1xayb.js.map} +1 -1
- package/dist/{chunk-3aa287k7.js → chunk-txhcx69q.js} +2 -2
- package/dist/{chunk-3aa287k7.js.map → chunk-txhcx69q.js.map} +1 -1
- package/dist/{chunk-w7rf99w6.js → chunk-vj9538yn.js} +2 -2
- package/dist/{chunk-w7rf99w6.js.map → chunk-vj9538yn.js.map} +1 -1
- package/dist/{chunk-yed5whgs.js → chunk-wcv6qtpq.js} +3 -3
- package/dist/{chunk-yed5whgs.js.map → chunk-wcv6qtpq.js.map} +1 -1
- package/dist/{chunk-vr90r27j.js → chunk-wzvs3sym.js} +2 -2
- package/dist/{chunk-vr90r27j.js.map → chunk-wzvs3sym.js.map} +1 -1
- package/dist/{chunk-cyaz97p5.js → chunk-x6y1z4cq.js} +2 -2
- package/dist/{chunk-cyaz97p5.js.map → chunk-x6y1z4cq.js.map} +1 -1
- package/dist/{chunk-6235kb30.js → chunk-xecj8025.js} +3 -3
- package/dist/{chunk-6235kb30.js.map → chunk-xecj8025.js.map} +1 -1
- package/dist/{chunk-eejmhtnc.js → chunk-y64j80v9.js} +2 -2
- package/dist/{chunk-eejmhtnc.js.map → chunk-y64j80v9.js.map} +1 -1
- package/dist/{chunk-zh2egcyb.js → chunk-ygfwtgvm.js} +2 -2
- package/dist/{chunk-zh2egcyb.js.map → chunk-ygfwtgvm.js.map} +1 -1
- package/dist/{chunk-4yt5x8s2.js → chunk-ys904esh.js} +2 -2
- package/dist/{chunk-4yt5x8s2.js.map → chunk-ys904esh.js.map} +1 -1
- package/dist/{chunk-y6a8r2bn.js → chunk-z1e55w67.js} +3 -3
- package/dist/{chunk-y6a8r2bn.js.map → chunk-z1e55w67.js.map} +1 -1
- package/dist/{chunk-qb5mv6pj.js → chunk-z2tcxwyr.js} +3 -3
- package/dist/{chunk-qb5mv6pj.js.map → chunk-z2tcxwyr.js.map} +1 -1
- package/dist/{chunk-hppagzz4.js → chunk-zhbrkpb3.js} +4 -4
- package/dist/{chunk-hppagzz4.js.map → chunk-zhbrkpb3.js.map} +1 -1
- package/dist/{chunk-grdahng8.js → chunk-zqsfanvk.js} +2 -2
- package/dist/{chunk-grdahng8.js.map → chunk-zqsfanvk.js.map} +1 -1
- package/dist/chunks/{ThemeProvider-li1J_igh.js → ThemeProvider-ByU4BQdL.js} +68 -2
- package/dist/chunks/{ThemeProvider-li1J_igh.js.map → ThemeProvider-ByU4BQdL.js.map} +1 -1
- package/dist/client/ComponentContext.d.ts +46 -0
- package/dist/client/ComponentContext.d.ts.map +1 -1
- package/dist/client/index.js +9 -2
- package/dist/client/index.js.map +1 -1
- package/dist/client/init.d.ts.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/Features.d.ts +67 -1
- package/dist/facades/Features.d.ts.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 +2 -2
- 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/Server.d.ts.map +1 -1
- package/dist/server/httpDev.d.ts.map +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/index.js.map +3 -3
- package/dist/services/events/Event.d.ts +6 -0
- package/dist/services/events/Event.d.ts.map +1 -1
- package/dist/services/features/FeatureFlagStore.d.ts +56 -0
- package/dist/services/features/FeatureFlagStore.d.ts.map +1 -1
- package/dist/services/features/FeatureManager.d.ts +35 -1
- package/dist/services/features/FeatureManager.d.ts.map +1 -1
- package/dist/services/features/types.d.ts +62 -0
- package/dist/services/features/types.d.ts.map +1 -1
- package/dist/services/index.d.ts +2 -2
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +8 -8
- package/dist/services/index.js.map +3 -3
- package/dist/services/logging/LogManager.d.ts +10 -1
- package/dist/services/logging/LogManager.d.ts.map +1 -1
- package/dist/services/logging/LogServiceProvider.d.ts +10 -0
- package/dist/services/logging/LogServiceProvider.d.ts.map +1 -1
- package/dist/support/index.js +2 -2
- package/dist/support/index.js.map +1 -1
- package/dist/testing/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-87qab82w.js +0 -5
- package/dist/chunk-b35e128b.js +0 -5
- package/dist/chunk-hwa5sqw5.js +0 -19
- package/dist/chunk-mkfpnymy.js +0 -55
- package/dist/chunk-mkfpnymy.js.map +0 -11
- /package/dist/{chunk-k0fvsyeh.js.map → chunk-hsfjt13m.js.map} +0 -0
- /package/dist/{chunk-yf7vz71n.js.map → chunk-hwhw98hc.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../client/init.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAItD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../client/init.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAItD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAIzD,MAAM,WAAW,WAAW;IAC1B;;;;OAIG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAoBD,wBAAgB,IAAI,CAClB,UAAU,EAAE,aAAa,CAAC,GAAG,CAAC,EAC9B,OAAO,GAAE,WAAgB,QAwB1B;AAoCD,wBAAgB,MAAM,CACpB,UAAU,EAAE,aAAa,CAAC,GAAG,CAAC,EAC9B,EACE,aAAa,EACb,OAAO,EACP,aAAa,EACb,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,cAAc,EACd,aAAa,GACd,EAAE,GAAG,QAiBP"}
|
package/dist/config/index.js
CHANGED
package/dist/console/run.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ra as A,Sa as l}from"../chunk-yf8kxjr2.js";import{Cb as q,Fb as m,Qb as p}from"../chunk-
|
|
2
|
+
import{Ra as A,Sa as l}from"../chunk-yf8kxjr2.js";import{Cb as q,Fb as m,Qb as p}from"../chunk-b0t4zp6b.js";import{nf as u}from"../chunk-3296fwss.js";import"../chunk-tds3xq6b.js";import"../chunk-j23cengk.js";import{Bf as c}from"../chunk-hxb1eg2z.js";import"../chunk-4dan69s4.js";function F(){let z=Promise.resolve(),M=Promise.resolve(),X=(Q,G)=>new Promise(($)=>{Q.write(G,()=>$())});return{stdout:(Q)=>{z=X(process.stdout,Q)},stderr:(Q)=>{M=X(process.stderr,Q)},flush:async()=>{await Promise.all([z,M])}}}function b(z){let M=z.writers??F();return{args:z.args,options:z.options,argv:z.argv,line:(X="")=>M.stdout(`${X}
|
|
3
3
|
`),error:(X)=>M.stderr(`${X}
|
|
4
4
|
`),fail:(X,Q=1)=>{throw new q(X,Q)}}}import w from"path";function V(z){return z.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z])([A-Z][a-z])/g,"$1-$2").toLowerCase()}function t(z){let M=new Map,X=new Map;for(let Q of z){M.set(V(Q.name),Q),M.set(Q.name,Q);let G="alias"in Q?Q.alias:void 0;if(G)X.set(G,Q)}return{byName:M,byAlias:X}}function x(z){if(z==="--")return!0;if(!z.startsWith("-"))return!1;if(z==="-")return!1;if(/^-(\d|\.\d)/.test(z))return!1;return!0}function k(z,M){let{byName:X,byAlias:Q}=t(z.options),G=[],$=[],Z=new Map,S=!X.has("help"),C=!Q.has("h"),P=!1,D=!1,I=(J)=>G.push(`Unknown option ${J} for command "${z.commandName}".`),T=(J,Y)=>{if(Y==="--help"||Y==="-h")D=!0;G.push(Y===void 0?`Option ${J} needs a value.`:`Option ${J} needs a value, but the next token is ${JSON.stringify(Y)}, which is another option. If that really is the value, write ${J}=${Y}.`)},_=0;while(_<M.length){let J=M[_];if(J==="--"){$.push(...M.slice(_+1));break}if(J.startsWith("--")){let Y=J.slice(2),j=Y.indexOf("="),B=j===-1?Y:Y.slice(0,j),K=j===-1?void 0:Y.slice(j+1),H=X.get(B),E=!1;if(!H&&B.startsWith("no-")){let W=X.get(B.slice(3));if(W&&W.type==="boolean")H=W,E=!0}if(!H&&B==="help"&&S){P=!0,_+=1;continue}if(!H){I(`--${B}`),_+=1;continue}if(H.type==="boolean"){if(K!==void 0&&K!=="true"&&K!=="false")G.push(`Option --${V(H.name)} is a flag and takes no value, but got ${JSON.stringify(K)}.`);else{let W=K===void 0?!0:K==="true";Z.set(H.name,E?!W:W)}_+=1;continue}if(K!==void 0){Z.set(H.name,K),_+=1;continue}let U=M[_+1];if(U===void 0||x(U)){T(`--${V(H.name)}`,U),_+=1;continue}Z.set(H.name,U),_+=2;continue}if(J.startsWith("-")&&J.length>1){let Y=J.slice(1),j=!1;for(let B=0;B<Y.length;B+=1){let K=Q.get(Y[B]);if(!K){if(Y[B]==="h"&&C){P=!0;continue}I(`-${Y[B]}`);break}if(K.type==="boolean"){Z.set(K.name,!0);continue}let H=Y.slice(B+1),E=H.startsWith("=")?H.slice(1):H;if(E!==""){Z.set(K.name,E);break}let U=M[_+1];if(U===void 0||x(U)){T(`-${K.alias}`,U);break}Z.set(K.name,U),j=!0;break}_+=j?2:1;continue}$.push(J),_+=1}let L={},O=0;for(let J of z.args){if(J.variadic){let j=$.slice(O);if(O=$.length,L[J.name]=j,J.required&&j.length===0)G.push(`Missing required argument <${J.name}...>. Command "${z.commandName}" needs at least one.`);continue}let Y=$[O];if(O+=1,Y!==void 0){L[J.name]=Y;continue}if(J.default!==void 0){L[J.name]=J.default;continue}if(J.required)G.push(`Missing required argument <${J.name}>.`);L[J.name]=void 0}if(O<$.length){let J=$.slice(O);G.push(`Unexpected argument${J.length===1?"":"s"} ${J.map((Y)=>JSON.stringify(Y)).join(", ")}. Command "${z.commandName}" takes ${z.args.length} argument${z.args.length===1?"":"s"}.`)}let R={};for(let J of z.options){let Y=Z.get(J.name);if(J.type==="boolean"){R[J.name]=Y===void 0?J.default??!1:Boolean(Y);continue}if(Y===void 0){if(J.default!==void 0)R[J.name]=J.default;else if(J.required)G.push(`Missing required option --${V(J.name)}.`),R[J.name]=void 0;else R[J.name]=void 0;continue}let j=String(Y);if(J.type==="number"){let B=Number(j);if(j.trim()===""||!Number.isFinite(B))G.push(`Option --${V(J.name)} expects a number, but got ${JSON.stringify(j)}.`),R[J.name]=void 0;else R[J.name]=B;continue}R[J.name]=j}let N=P&&!D;if(G.length>0)return{ok:!1,help:N,errors:G};return{ok:!0,help:N,args:L,options:R}}function f(z,M=" "){let X=z.reduce((Q,[G])=>Math.max(Q,G.length),0);return z.map(([Q,G])=>G===""?`${M}${Q}`:`${M}${Q.padEnd(X)} ${G}`)}function g(z){let M=z.variadic?`${z.name}...`:z.name;return z.required?`<${M}>`:`[${M}]`}function s(z){let M=(G)=>z.options.some(G),X=M((G)=>G.name==="help"||V(G.name)==="help"),Q=M((G)=>("alias"in G)&&G.alias==="h");if(X&&Q)return[];if(X)return[["-h","Show this message"]];return[[`${Q?"":"-h, "}--help`,"Show this message"]]}function v(z){let M=[],X=z.args.map(g).join(" "),Q=["gemi run",z.commandName,z.options.length>0?"[options]":"",X].filter(Boolean).join(" ");if(M.push(`Usage: ${Q}`),z.description)M.push("",z.description);if(z.args.length>0)M.push("","Arguments:"),M.push(...f(z.args.map((G)=>{let $=[G.description??"",G.default!==void 0?`(default: ${JSON.stringify(G.default)})`:""].filter(Boolean).join(" ");return[g(G),$]})));return M.push("","Options:"),M.push(...f([...z.options.map((G)=>{let $="alias"in G&&G.alias?`-${G.alias}, `:"",Z=G.type==="boolean"?"":` <${G.type}>`,S=[G.description??"",G.default!==void 0?`(default: ${JSON.stringify(G.default)})`:"","required"in G&&G.required?"(required)":""].filter(Boolean).join(" ");return[`${$}--${V(G.name)}${Z}`,S]}),...s(z)])),M.join(`
|
|
5
5
|
`)}function y(z,M){let X=M.declared?`${z.length} command${z.length===1?"":"s"} declared in app/config/command.ts:`:`Commands in ${M.dir}:`;if(z.length===0)return M.declared?`app/config/command.ts declares no commands.
|
|
@@ -13,4 +13,4 @@ A command is registered by existing: write a file there that exports a \`defineC
|
|
|
13
13
|
${Q.message}
|
|
14
14
|
\`gemi run\` boots your application the way the server does, so it needs the Kernel. Run it from the root of a gemi project.`,{cause:Q})}if(typeof X.default!=="function")throw new A(`${M} has no default export. gemi expects the Kernel subclass to be the default export of that file.`);return new X.default}function h(z,M,X,Q="returned"){if(z===void 0||z===null)return 0;if(typeof z==="number"&&Number.isInteger(z)&&z>=0&&z<=255)return z;let G=M?`Command "${M.commandName}"`:"The command";return X(`${G} ${Q} ${JSON.stringify(z)}, which is not an exit `+"code \u2014 an exit code is an integer from 0 to 255. Treating this as a "+"failure."),1}var[a,...o]=process.argv.slice(2),i=F();d({rootDir:process.cwd(),name:a,argv:o,writers:i}).then(async(z)=>{await i.flush(),process.exit(z)});
|
|
15
15
|
|
|
16
|
-
//# debugId=
|
|
16
|
+
//# debugId=0ACD4986A577D38464756E2164756E21
|
package/dist/console/run.js.map
CHANGED
|
@@ -9,6 +9,6 @@
|
|
|
9
9
|
"/**\n * The entry point `gemi run` spawns.\n *\n * Exposed through the exports map as `gemi/console/run` and resolved by the CLI\n * out of the *application's* `node_modules`, the same way `dev` and `start`\n * resolve `gemi/bun/preload`. That indirection is the point: the runner has to\n * be the application's copy of gemi, not the one bundled into `dist/bin/gemi.js`\n * — see the note at the top of `runner.ts`.\n *\n * Nothing but argv handling lives here, so that everything worth testing lives\n * in `runConsole`, which returns an exit code instead of taking one.\n */\nimport { processWriters } from \"./context\";\nimport { runConsole } from \"./runner\";\n\n// The tail is forwarded exactly as commander handed it over, `--` and all.\n// commander passes a `--` through as a literal operand (verified: `gemi run x --\n// --weird` arrives as `[\"--\", \"--weird\"]`), and `parse.ts` already treats a `--`\n// as \"everything after this is positional\". Stripping it here — which an earlier\n// draft did — consumed the escape hatch before the only thing that reads it,\n// leaving `-- --weird` reported as an unknown option and `-- --` the only way to\n// pass a flag-shaped value.\nconst [name, ...argv] = process.argv.slice(2);\n\nconst writers = processWriters();\n\n// `.then` rather than a top-level `await`, so this file typechecks under the\n// package's inherited `module: NodeNext` — the same TS1309 that keeps `bun/` out\n// of tsconfig.json's `include`. Bun runs it as ESM either way; this just avoids\n// buying a nested tsconfig for two lines.\nrunConsole({ rootDir: process.cwd(), name, argv, writers }).then(\n async (code) => {\n // Everything written has to reach the OS before the exit below discards it —\n // see `processWriters` for what that costs when it is skipped.\n await writers.flush();\n\n // Explicit, and not belt-and-braces. `kernel.destroy()` stops the scheduler,\n // but an open database pool, a Redis client or an unref'd timer will happily\n // hold the loop open after the work is done — a command that finishes and then\n // sits there, which is the failure `kernel/exit.test.ts` exists for and the\n // one `orm/context.test.ts` names by example.\n process.exit(code);\n },\n);\n"
|
|
10
10
|
],
|
|
11
11
|
"mappings": ";qTA+FO,IAAS,JAAc,HAAmB,JAG/C,DAAI,HAAwB,QAAQ,QAAQ,EACxC,EAAwB,QAAQ,QAAQ,EAEtC,EAAQ,CAAC,EAA4B,IACzC,IAAI,QAAQ,CAAC,IAAY,CAIvB,EAAO,MAAM,EAAO,IAAM,EAAQ,CAAC,EACpC,EAEH,MAAO,CACL,OAAQ,CAAC,IAAU,CACjB,EAAS,EAAM,QAAQ,OAAQ,CAAK,GAEtC,OAAQ,CAAC,IAAU,CACjB,EAAS,EAAM,QAAQ,OAAQ,CAAK,GAEtC,MAAO,SAAY,CACjB,MAAM,QAAQ,IAAI,CAAC,EAAQ,CAAM,CAAC,EAEtC,EAGK,SAAS,CAAmB,CAAC,EAKX,CACvB,IAAM,EAAU,EAAO,SAAW,EAAe,EAEjD,MAAO,CACL,KAAM,EAAO,KACb,QAAS,EAAO,QAChB,KAAM,EAAO,KACb,KAAM,CAAC,EAAU,KAAO,EAAQ,OAAO,GAAG;AAAA,CAAW,EACrD,MAAO,CAAC,IAAoB,EAAQ,OAAO,GAA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CAAE,QAAS,QAAQ,IAAI,EAAG,OAAM,OAAM,SAAQ,CAAC,EAAE,KAC1D,MAAO,IAAS,CAGd,MAAM,EAAQ,MAAM,EAOpB,QAAQ,KAAK,CAAI,EAErB",
|
|
12
|
-
"debugId": "
|
|
12
|
+
"debugId": "0ACD4986A577D38464756E2164756E21",
|
|
13
13
|
"names": []
|
|
14
14
|
}
|
package/dist/container/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{yf as e,zf as o}from"../chunk-j23cengk.js";import"../chunk-4dan69s4.js";export{o as Container,e as BindingResolutionError};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=2DAEBD6725F8B35364756E2164756E21
|
package/dist/database/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{sa as b}from"../chunk-
|
|
2
|
+
import{sa as b}from"../chunk-3gvjn3q4.js";import"../chunk-ys904esh.js";import{cd as e,dd as o,ed as r,fd as n,gd as a,hd as t,id as i,jd as s,kd as C,ld as f,md as D,nd as c,od as p}from"../chunk-z1e55w67.js";import"../chunk-f6dd4gd8.js";import"../chunk-3296fwss.js";import"../chunk-4dan69s4.js";export{n as isSqlite,a as isMysqlFamily,r as inferDialect,c as defineDatabaseConfig,p as databaseConfigDefaults,e as UnknownDatabaseUrlError,i as UnknownConnectionError,s as ReservedConnectionNameError,o as MissingDatabaseUrlError,b as DatabaseServiceProvider,D as DatabaseManager,t as DEFAULT_CONNECTION,C as CrossConnectionTransactionError,f as Connection};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=3C1C2C0EC07E090564756E2164756E21
|
package/dist/email/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{sf as o}from"../chunk-5gdv4n4a.js";import{tf as p}from"../chunk-x6y1z4cq.js";import{xf as f}from"../chunk-tds3xq6b.js";import"../chunk-j23cengk.js";import"../chunk-4dan69s4.js";import{render as i}from"jsx-email";import I from"process";import{Buffer as a}from"buffer";import d from"path";import{fileURLToPath as kT}from"url";import{promisify as FT}from"util";import r from"child_process";import WT,{constants as IT}from"fs/promises";import u from"process";import c,{constants as JT}from"fs/promises";import b from"process";import GT from"os";import _ from"fs";import RT from"fs";import y from"fs";var j;function ET(){try{return y.statSync("/.dockerenv"),!0}catch{return!1}}function $T(){try{return y.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function L(){if(j===void 0)j=ET()||$T();return j}var O,qT=()=>{try{return RT.statSync("/run/.containerenv"),!0}catch{return!1}};function Y(){if(O===void 0)O=qT()||L();return O}var B=()=>{if(b.platform!=="linux")return!1;if(GT.release().toLowerCase().includes("microsoft")){if(Y())return!1;return!0}try{if(_.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft"))return!Y()}catch{}if(_.existsSync("/proc/sys/fs/binfmt_misc/WSLInterop")||_.existsSync("/run/WSL"))return!Y();return!1},Q=b.env.__IS_WSL_TEST__?B:B();var KT=(()=>{let S;return async function(){if(S)return S;let v="/etc/wsl.conf",$=!1;try{await c.access(v,JT.F_OK),$=!0}catch{}if(!$)return"/mnt/";let E=await c.readFile(v,{encoding:"utf8"}),q=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(E);if(!q)return"/mnt/";return S=q.groups.mountPoint.trim(),S=S.endsWith("/")?S:`${S}/`,S}})(),QT=async()=>{return`${await KT()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`},x=async()=>{if(Q)return QT();return`${u.env.SYSTEMROOT||u.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`};function V(T,S,v){let $=(E)=>Object.defineProperty(T,S,{value:E,enumerable:!0,writable:!0});return Object.defineProperty(T,S,{configurable:!0,enumerable:!0,get(){let E=v();return $(E),E},set(E){$(E)}}),T}import{promisify as _T}from"util";import F from"process";import{execFile as xT}from"child_process";import{promisify as VT}from"util";import YT from"process";import{execFile as ZT}from"child_process";var HT=VT(ZT);async function D(){if(YT.platform!=="darwin")throw Error("macOS only");let{stdout:T}=await HT("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]),v=/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(T)?.groups.id??"com.apple.Safari";if(v==="com.apple.safari")return"com.apple.Safari";return v}import MT from"process";import{promisify as NT}from"util";import{execFile as UT,execFileSync as ES}from"child_process";var XT=NT(UT);async function A(T,{humanReadableOutput:S=!0,signal:v}={}){if(MT.platform!=="darwin")throw Error("macOS only");let $=S?[]:["-ss"],E={};if(v)E.signal=v;let{stdout:q}=await XT("osascript",["-e",T,$],E);return q.trim()}async function z(T){return A(`tell application "Finder" to set app_path to application file id "${T}" as string
|
|
3
3
|
tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}import{promisify as jT}from"util";import{execFile as LT}from"child_process";var OT=jT(LT),N={MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},MSEdgeBHTML:{name:"Edge Beta",id:"com.microsoft.edge.beta"},MSEdgeDHTML:{name:"Edge Dev",id:"com.microsoft.edge.dev"},AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},ChromeBHTML:{name:"Chrome Beta",id:"com.google.chrome.beta"},ChromeDHTML:{name:"Chrome Dev",id:"com.google.chrome.dev"},ChromiumHTM:{name:"Chromium",id:"org.chromium.Chromium"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveDHTML:{name:"Brave Dev",id:"com.brave.Browser.dev"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},OperaStable:{name:"Opera",id:"com.operasoftware.Opera"},VivaldiHTM:{name:"Vivaldi",id:"com.vivaldi.Vivaldi"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"}},KS=new Map(Object.entries(N));class P extends Error{}async function k(T=OT){let{stdout:S}=await T("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),v=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(S);if(!v)throw new P(`Cannot find Windows browser in stdout: ${JSON.stringify(S)}`);let{id:$}=v.groups,E=$.lastIndexOf("."),q=$.lastIndexOf("-"),J=E===-1?void 0:$.slice(0,E),R=q===-1?void 0:$.slice(0,q);return N[$]??N[J]??N[R]??{name:$,id:$}}var DT=_T(xT),zT=(T)=>T.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,(S)=>S.toUpperCase());async function W(){if(F.platform==="darwin"){let T=await D();return{name:await z(T),id:T}}if(F.platform==="linux"){let{stdout:T}=await DT("xdg-mime",["query","default","x-scheme-handler/http"]),S=T.trim();return{name:zT(S.replace(/.desktop$/,"").replace("-"," ")),id:S}}if(F.platform==="win32")return k();throw Error("Only macOS, Linux, and Windows are supported")}var CT=FT(r.execFile),C=d.dirname(kT(import.meta.url)),w=d.join(C,"xdg-open"),{platform:H,arch:m}=I;async function fT(){let T=await x(),S=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,v=a.from(S,"utf16le").toString("base64"),{stdout:$}=await CT(T,["-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand",v],{encoding:"utf8"}),E=$.trim(),q={ChromeHTML:"com.google.chrome",BraveHTML:"com.brave.Browser",MSEdgeHTM:"com.microsoft.edge",FirefoxURL:"org.mozilla.firefox"};return q[E]?{id:q[E]}:{}}var h=async(T,S)=>{let v;for(let $ of T)try{return await S($)}catch(E){v=E}throw v},U=async(T)=>{if(T={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...T},Array.isArray(T.app))return h(T.app,(R)=>U({...T,app:R}));let{name:S,arguments:v=[]}=T.app??{};if(v=[...v],Array.isArray(S))return h(S,(R)=>U({...T,app:{name:R,arguments:v}}));if(S==="browser"||S==="browserPrivate"){let R={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","com.brave.Browser":"brave","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","com.microsoft.edgemac":"edge","microsoft-edge.desktop":"edge"},G={chrome:"--incognito",brave:"--incognito",firefox:"--private-window",edge:"--inPrivate"},K=Q?await fT():await W();if(K.id in R){let M=R[K.id];if(S==="browserPrivate")v.push(G[M]);return U({...T,app:{name:Z[M],arguments:v}})}throw Error(`${K.name} is not supported as a default browser`)}let $,E=[],q={};if(H==="darwin"){if($="open",T.wait)E.push("--wait-apps");if(T.background)E.push("--background");if(T.newInstance)E.push("--new");if(S)E.push("-a",S)}else if(H==="win32"||Q&&!Y()&&!S){if($=await x(),E.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),!Q)q.windowsVerbatimArguments=!0;let R=["Start"];if(T.wait)R.push("-Wait");if(S){if(R.push(`"\`"${S}\`""`),T.target)v.push(T.target)}else if(T.target)R.push(`"${T.target}"`);if(v.length>0)v=v.map((G)=>`"\`"${G}\`""`),R.push("-ArgumentList",v.join(","));T.target=a.from(R.join(" "),"utf16le").toString("base64")}else{if(S)$=S;else{let R=!C||C==="/",G=!1;try{await WT.access(w,IT.X_OK),G=!0}catch{}$=I.versions.electron??(H==="android"||R||!G)?"xdg-open":w}if(v.length>0)E.push(...v);if(!T.wait)q.stdio="ignore",q.detached=!0}if(H==="darwin"&&v.length>0)E.push("--args",...v);if(T.target)E.push(T.target);let J=r.spawn($,E,q);if(T.wait)return new Promise((R,G)=>{J.once("error",G),J.once("close",(K)=>{if(!T.allowNonzeroExitCode&&K>0){G(Error(`Exited with code ${K}`));return}R(J)})});return J.unref(),J},lT=(T,S)=>{if(typeof T!=="string")throw TypeError("Expected a `target`");return U({...S,target:T})};function g(T){if(typeof T==="string"||Array.isArray(T))return T;let{[m]:S}=T;if(!S)throw Error(`${m} is not supported`);return S}function X({[H]:T},{wsl:S}){if(S&&Q)return g(S);if(!T)throw Error(`${H} is not supported`);return g(T)}var Z={};V(Z,"chrome",()=>X({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));V(Z,"brave",()=>X({darwin:"brave browser",win32:"brave",linux:["brave-browser","brave"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",x64:["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe","/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]}}));V(Z,"firefox",()=>X({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));V(Z,"edge",()=>X({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));V(Z,"browser",()=>"browser");V(Z,"browserPrivate",()=>"browserPrivate");var e=lT;import{jsx as n}from"react/jsx-runtime";class s{from="";to=[];subject="No Subject";cc=[];bcc=[];attachments=[];template;headers={};static async send(T){let S=new this,v=f(p).defaultLocale,$=f(o),{to:E=S.to,from:q=S.from,subject:J=typeof S.subject==="string"?S.subject:S.subject[T.locale||v],cc:R=S.cc,bcc:G=S.bcc,attachments:K=S.attachments,data:M,headers:TT={}}=T,ST={...$.headers??{},...S.headers??{},...TT??{}};if(!(await $.filterRecipients(E)).length)return;let[l,vT]=await Promise.all([S.render({...M,locale:T.locale}),S.renderText({...M,locale:T.locale})]);if(process.env.EMAIL_DEBUG==="true"){let t=`${process.env.ROOT_DIR}/.debug/emails/${new Date().toISOString()}${J}.html`;if(await Bun.write(t,l),process.env.CI!=="true")await e(t);return}await $.send({bcc:G,cc:R,from:q,subject:J,to:E,attachments:K,html:l,headers:ST,text:vT,scheduledAt:T.scheduledAt})}static async preview(T){return await new this().render({...T.data,locale:T.locale})}async render(T){let S=this.template;return await i(n(S,{...T}))}async renderText(T){let S=this.template;return await i(n(S,{...T}),{plainText:!0})}}export{s as Email};
|
|
4
4
|
|
|
5
|
-
//# debugId=
|
|
5
|
+
//# debugId=1B4E0D8325CC380B64756E2164756E21
|
package/dist/email/index.js.map
CHANGED
|
@@ -16,6 +16,6 @@
|
|
|
16
16
|
"import {promisify} from 'node:util';\nimport {execFile} from 'node:child_process';\n\nconst execFileAsync = promisify(execFile);\n\n// TODO: Fix the casing of bundle identifiers in the next major version.\n\n// Windows doesn't have browser IDs in the same way macOS/Linux does so we give fake\n// ones that look real and match the macOS/Linux versions for cross-platform apps.\nconst windowsBrowserProgIds = {\n\tMSEdgeHTM: {name: 'Edge', id: 'com.microsoft.edge'}, // The missing `L` is correct.\n\tMSEdgeBHTML: {name: 'Edge Beta', id: 'com.microsoft.edge.beta'},\n\tMSEdgeDHTML: {name: 'Edge Dev', id: 'com.microsoft.edge.dev'},\n\tAppXq0fevzme2pys62n3e0fbqa7peapykr8v: {name: 'Edge', id: 'com.microsoft.edge.old'},\n\tChromeHTML: {name: 'Chrome', id: 'com.google.chrome'},\n\tChromeBHTML: {name: 'Chrome Beta', id: 'com.google.chrome.beta'},\n\tChromeDHTML: {name: 'Chrome Dev', id: 'com.google.chrome.dev'},\n\tChromiumHTM: {name: 'Chromium', id: 'org.chromium.Chromium'},\n\tBraveHTML: {name: 'Brave', id: 'com.brave.Browser'},\n\tBraveBHTML: {name: 'Brave Beta', id: 'com.brave.Browser.beta'},\n\tBraveDHTML: {name: 'Brave Dev', id: 'com.brave.Browser.dev'},\n\tBraveSSHTM: {name: 'Brave Nightly', id: 'com.brave.Browser.nightly'},\n\tFirefoxURL: {name: 'Firefox', id: 'org.mozilla.firefox'},\n\tOperaStable: {name: 'Opera', id: 'com.operasoftware.Opera'},\n\tVivaldiHTM: {name: 'Vivaldi', id: 'com.vivaldi.Vivaldi'},\n\t'IE.HTTP': {name: 'Internet Explorer', id: 'com.microsoft.ie'},\n};\n\nexport const _windowsBrowserProgIdMap = new Map(Object.entries(windowsBrowserProgIds));\n\nexport class UnknownBrowserError extends Error {}\n\nexport default async function defaultBrowser(_execFileAsync = execFileAsync) {\n\tconst {stdout} = await _execFileAsync('reg', [\n\t\t'QUERY',\n\t\t' HKEY_CURRENT_USER\\\\Software\\\\Microsoft\\\\Windows\\\\Shell\\\\Associations\\\\UrlAssociations\\\\http\\\\UserChoice',\n\t\t'/v',\n\t\t'ProgId',\n\t]);\n\n\tconst match = /ProgId\\s*REG_SZ\\s*(?<id>\\S+)/.exec(stdout);\n\tif (!match) {\n\t\tthrow new UnknownBrowserError(`Cannot find Windows browser in stdout: ${JSON.stringify(stdout)}`);\n\t}\n\n\tconst {id} = match.groups;\n\n\t// Windows can append a hash suffix to ProgIds using a dot or hyphen\n\t// (e.g., `ChromeHTML.ABC123`, `FirefoxURL-6F193CCC56814779`).\n\t// Try exact match first, then try without the suffix.\n\tconst dotIndex = id.lastIndexOf('.');\n\tconst hyphenIndex = id.lastIndexOf('-');\n\tconst baseIdByDot = dotIndex === -1 ? undefined : id.slice(0, dotIndex);\n\tconst baseIdByHyphen = hyphenIndex === -1 ? undefined : id.slice(0, hyphenIndex);\n\n\treturn windowsBrowserProgIds[id] ?? windowsBrowserProgIds[baseIdByDot] ?? windowsBrowserProgIds[baseIdByHyphen] ?? {name: id, id};\n}\n"
|
|
17
17
|
],
|
|
18
18
|
"mappings": ";4M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C,KACjB,EAAS,SAAW,CAAC,KACrB,IAAW,CAAC,CAClB,EAIA,GAAI,EAFe,MAAM,EAAK,iBAAiB,CAAE,GAEjC,OACd,OAGF,IAAO,EAAM,IAAQ,MAAM,QAAQ,IAAI,CACrC,EAAS,OAAO,IACV,EACJ,OAAQ,EAAK,MACf,CAAC,EACD,EAAS,WAAW,IACd,EACJ,OAAQ,EAAK,MACf,CAAC,CACH,CAAC,EAED,GAAI,QAAQ,IAAI,cAAgB,OAAQ,CACtC,IAAM,EAAW,GAAG,QAAQ,IAAI,0BAA0B,IAAI,KAAK,EAAE,YAAY,IAAI,SAErF,GADA,MAAM,IAAI,MAAM,EAAU,CAAI,EAC1B,QAAQ,IAAI,KAAO,OACrB,MAAM,EAAK,CAAQ,EAErB,OAGF,MAAM,EAAK,KAAK,CACd,MACA,KACA,OACA,UACA,KACA,cACA,OACA,QAAS,GACT,QACA,YAAa,EAAK,WACpB,CAAC,cAGU,QAAwB,CAEnC,EACA,CAIA,OAAO,MAFU,IAAI,KAAK,EAEJ,OAAO,IACxB,EAAK,KACR,OAAQ,EAAK,MACf,CAAC,OAGa,OAAqC,CAAC,EAAU,CAC9D,IAAM,EAAW,KAAK,SACtB,OAAO,MAAM,EAAO,EAAC,EAAD,IAAc,EAAO,CAAE,OAG7B,WAAyC,CAAC,EAAU,CAClE,IAAM,EAAW,KAAK,SACtB,OAAO,MAAM,EAAO,EAAC,EAAD,IAAc,EAAO,EAAI,CAAE,UAAW,EAAK,CAAC,EAEpE",
|
|
19
|
-
"debugId": "
|
|
19
|
+
"debugId": "1B4E0D8325CC380B64756E2164756E21",
|
|
20
20
|
"names": []
|
|
21
21
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { FeatureKey } from "../client/rpc";
|
|
2
2
|
import type { FeatureSubject } from "../services/features/context";
|
|
3
3
|
import { FeatureManager, type FeatureScope } from "../services/features/FeatureManager";
|
|
4
|
-
import type { FeatureEvaluation } from "../services/features/types";
|
|
4
|
+
import type { FeatureEvaluation, FeatureListing } from "../services/features/types";
|
|
5
5
|
import { Facade } from "./Facade";
|
|
6
6
|
/**
|
|
7
7
|
* Features on the server.
|
|
@@ -51,7 +51,73 @@ export declare class Features extends Facade {
|
|
|
51
51
|
static explain(key: FeatureKey): Promise<FeatureEvaluation>;
|
|
52
52
|
/** Evaluation against an explicit subject rather than the ambient request. */
|
|
53
53
|
static for(subject: FeatureSubject): FeatureScope;
|
|
54
|
+
/**
|
|
55
|
+
* Every feature declared in the code, with its switch — the list an admin
|
|
56
|
+
* screen renders.
|
|
57
|
+
*
|
|
58
|
+
* The declarations are what exists. A feature is here because `app/features`
|
|
59
|
+
* declares it, never because a row was inserted; `active` is `undefined` for a
|
|
60
|
+
* feature that has been deployed but never switched on, which is deliberately
|
|
61
|
+
* distinct from a row that says `false`.
|
|
62
|
+
*
|
|
63
|
+
* Check `unavailable` before rendering `active`. It means no snapshot has ever
|
|
64
|
+
* loaded, so the switches are unknown rather than absent.
|
|
65
|
+
*
|
|
66
|
+
* **Server-side only, and the route must be gated.** The listing includes
|
|
67
|
+
* `serverOnly` features — whose keys are the thing `serverOnly` exists to keep
|
|
68
|
+
* out of the payload — and every descriptor carries `rollout` and `targeted`,
|
|
69
|
+
* which describe who is in an experiment.
|
|
70
|
+
*
|
|
71
|
+
* ```ts
|
|
72
|
+
* // app/http/routes/api.ts
|
|
73
|
+
* "/admin/features": this.get([AdminFeatureController, "index"]).middleware(["admin"]),
|
|
74
|
+
*
|
|
75
|
+
* // app/http/controllers/AdminFeatureController.ts
|
|
76
|
+
* public async index() {
|
|
77
|
+
* return await Features.list();
|
|
78
|
+
* }
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
static list(): Promise<FeatureListing>;
|
|
54
82
|
/** Reloads this process's snapshot now, rather than waiting for the TTL. */
|
|
55
83
|
static refresh(): Promise<void>;
|
|
84
|
+
/**
|
|
85
|
+
* Call this after writing to the `FeatureFlag` table.
|
|
86
|
+
*
|
|
87
|
+
* ```ts
|
|
88
|
+
* public async update(
|
|
89
|
+
* request: HttpRequest<{ active: boolean }, { key: string }>,
|
|
90
|
+
* ) {
|
|
91
|
+
* const input = await request.input();
|
|
92
|
+
*
|
|
93
|
+
* await FeatureFlag.update({
|
|
94
|
+
* where: { key: request.params.key },
|
|
95
|
+
* data: { active: input.get("active") },
|
|
96
|
+
* });
|
|
97
|
+
*
|
|
98
|
+
* await Features.invalidate();
|
|
99
|
+
* return await Features.list();
|
|
100
|
+
* }
|
|
101
|
+
* ```
|
|
102
|
+
*
|
|
103
|
+
* Unlike `refresh()` this never settles on a load that started before it was
|
|
104
|
+
* called, so the `list()` above reflects the write that precedes it. It also
|
|
105
|
+
* clears the request's evaluation memo, so a feature read earlier in the same
|
|
106
|
+
* request is re-evaluated rather than answered from before the write.
|
|
107
|
+
*
|
|
108
|
+
* **Throws `FeatureReloadError` when the reload fails.** The write landed and
|
|
109
|
+
* the cache did not follow, so the switches in memory may still predate it;
|
|
110
|
+
* returning normally would present them as the result of the update. This is
|
|
111
|
+
* the one call in the subsystem that fails loudly — everywhere else an outage
|
|
112
|
+
* means "keep serving what we have", which is right for evaluation and wrong
|
|
113
|
+
* for an operator watching their own change.
|
|
114
|
+
*
|
|
115
|
+
* **Process-local.** The other instances are still serving their own
|
|
116
|
+
* snapshots and converge within `ttl` — there is no cross-instance
|
|
117
|
+
* invalidation. What this fixes is the window that reads as a bug: the admin
|
|
118
|
+
* who flips a switch and is told for the next thirty seconds that nothing
|
|
119
|
+
* happened.
|
|
120
|
+
*/
|
|
121
|
+
static invalidate(): Promise<void>;
|
|
56
122
|
}
|
|
57
123
|
//# sourceMappingURL=Features.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Features.d.ts","sourceRoot":"","sources":["../../facades/Features.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,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AAU,IAAI,OAAO,CAAC,IAAI,CAAC;CAGnC"}
|
package/dist/facades/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Dc as h,Ec as i,Fc as j,Gc as k,Ic as l,Jc as m,Kc as n,Lc as o,Mc as p,Vb as b,Xb as c,Yb as d,Zb as e,dc as f,pc as g}from"../chunk-dgasxgsm.js";import"../chunk-rkbv3df7.js";import"../chunk-z1e55w67.js";import"../chunk-q0y0j3ne.js";import{pe as a}from"../chunk-4mcyyh1v.js";import"../chunk-z2tcxwyr.js";import"../chunk-f6dd4gd8.js";import"../chunk-3296fwss.js";import"../chunk-x6y1z4cq.js";import"../chunk-tds3xq6b.js";import"../chunk-j23cengk.js";import"../chunk-hxb1eg2z.js";import"../chunk-4dan69s4.js";export{i as Url,f as Storage,l as Redis,a as Redirect,m as RateLimiter,h as Query,j as Meta,g 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
|
-
//# debugId=
|
|
4
|
+
//# debugId=D0C1AED083BFAF0A64756E2164756E21
|
package/dist/foundation/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{wf as r,xf as o}from"../chunk-tds3xq6b.js";import"../chunk-j23cengk.js";import"../chunk-4dan69s4.js";export{o as app,r as Application};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=6CE35EB24B79D11A64756E2164756E21
|
package/dist/http/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{$d as
|
|
2
|
+
import{$d as g,Be as A,Ce as B,De as C,Fe as D,Ge as E,He as F,Ie as G,Je as H,Ke as I,Ud as a,Vd as b,Xd as c,Yd as d,Zd as e,_d as f,ae as h,ce as i,de as j,ee as k,fe as l,ge as m,he as n,ie as o,je as p,ke as q,le as r,me as s,ne as t,qe as u,re as v,se as w,te as x,ue as y,ve as z}from"../chunk-4mcyyh1v.js";import"../chunk-z2tcxwyr.js";import"../chunk-f6dd4gd8.js";import"../chunk-3296fwss.js";import"../chunk-tds3xq6b.js";import"../chunk-j23cengk.js";import"../chunk-4dan69s4.js";export{e as toRangeHeaderValue,l as toMiddlewareList,d as resolveRange,c as parseRangeHeader,f as parseContentRange,z as middlewareConfigDefaults,x as getCookies,h as formatUnsatisfiedContentRange,g as formatContentRange,y as defineMiddlewareConfig,m as createUnsatisfiableResponse,n as createStreamResponse,u as createFileResponse,F as clientIp,v as ViewRouter,j as ValidationError,b as ResourceController,i as RequestBreakerError,E as RateLimitMiddleware,D as RateLimitExceededError,q as RangeNotSatisfiableError,H as PoliciesServiceProvider,I as Policies,w as Middleware,p as InsufficientPermissionsError,k as HttpRequest,r as FileNotFoundError,C as CorsMiddleware,a as Controller,B as CacheMiddleware,G as CSRFMiddleware,o as AuthorizationError,A as AuthenticationMiddleware,s as AuthenticationError,t as ApiRouter};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=538B15A935A33CE364756E2164756E21
|
package/dist/http/index.js.map
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{aa as y,ba as p}from"../chunk-
|
|
2
|
+
import{aa as y,ba as p}from"../chunk-2khdxyjb.js";import{ka as c,la as d,na as l}from"../chunk-5ad8era8.js";import{Ld as e,Md as i,Od as t,Pd as r,Qd as o,Rd as n,Sd as a,Td as s}from"../chunk-q0y0j3ne.js";import"../chunk-4dan69s4.js";export{o as setActiveLocale,r as seedDictionaries,t as preloadDictionaries,d as localeStrings,i as loadDictionary,n as getActiveLocale,e as dictionaryRegistrationMark,c as dictionaryLocales,l as dictionaryId,y as defineDictionary,s as createDictionarySink,a as __resetDictionaryRegistry,p as __gemi_dict__};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=CD60719F76296A5B64756E2164756E21
|
package/dist/i18n/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{aa as R}from"../chunk-
|
|
2
|
+
import{aa as R}from"../chunk-2khdxyjb.js";import"../chunk-5ad8era8.js";import{Qa as L}from"../chunk-q6qghsy7.js";import{Sb as E,Tb as V}from"../chunk-p3qd0gqa.js";import"../chunk-ys904esh.js";import{Zb as j}from"../chunk-dgasxgsm.js";import"../chunk-rkbv3df7.js";import"../chunk-z1e55w67.js";import"../chunk-q0y0j3ne.js";import"../chunk-4mcyyh1v.js";import"../chunk-z2tcxwyr.js";import"../chunk-f6dd4gd8.js";import"../chunk-3296fwss.js";import{tf as X}from"../chunk-x6y1z4cq.js";import"../chunk-tds3xq6b.js";import"../chunk-j23cengk.js";import"../chunk-hxb1eg2z.js";import"../chunk-4dan69s4.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
|
-
//# debugId=
|
|
4
|
+
//# debugId=72A47DD61572EC5264756E2164756E21
|
package/dist/i18n/index.js.map
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"// The module, not the `../facades` barrel. A dictionary is the one server-side\n// artifact a *component* test has to import — `<Page dictionaries={[…]}>` takes\n// the app's real `app/i18n/index.ts` — and the barrel drags the whole facade\n// set in behind it, including `Redis` and its `import { RedisClient } from\n// \"bun\"`. Under a browser-targeted runner (vitest/jsdom) that specifier does\n// not resolve, so importing the app's dictionaries failed to collect before it\n// rendered anything. `Lang` itself only needs the translator and the request\n// context.\nimport { Lang } from \"../facades/Lang\";\nimport { parseTranslation } from \"../utils/parseTranslation\";\nimport type {\n ParseTranslationParams,\n ParseTranslationParamsServer,\n Prettify,\n} from \"../utils/type\";\n\ntype Translations = Record<string, Record<string, string>>;\n\nexport class Dictionary<T extends Translations> {\n constructor(\n public name: string,\n public dictionary: T,\n ) {}\n\n reference(key: keyof T) {\n if (typeof window !== \"undefined\") {\n throw new Error(\"Cannot use reference in the browser\");\n }\n if (!this.dictionary?.[key]) {\n throw new Error(`Translation not found for ${String(key)}`);\n }\n return this.dictionary[key];\n }\n\n render<\n K extends keyof T,\n U extends keyof T[K],\n R = Prettify<ParseTranslationParams<T[K][U]>>,\n >(\n key: K,\n ...args: R extends Record<string, never>\n ? [args?: { locale?: U | (string & {}) }]\n : [args: { locale?: U | (string & {}); params: R }]\n ) {\n const { locale = Lang.locale(), params } = {\n params: {},\n ...args[0],\n };\n\n if (typeof window !== \"undefined\") {\n throw new Error(\"Cannot use render in the browser\");\n }\n\n if (!this.dictionary?.[key]?.[locale]) {\n throw new Error(\n `Translation not found for ${String(key)} in ${String(locale)}`,\n );\n }\n return parseTranslation(this.dictionary[key][locale], params ?? {});\n }\n\n /**\n * @deprecated Use `defineDictionary` from `gemi/client`, declared next to the\n * component that reads it. A dictionary made here has to be re-exported from\n * `app/i18n/index.ts` and listed against a route in the `prefetch` config,\n * and every locale of it stays resident whether a page uses it or not. Still\n * supported; see `docs/i18n.md`.\n */\n static create<const T extends Translations>(name: string, translations: T) {\n return new Dictionary<T>(name, translations);\n }\n\n static text<const T extends Record<string, string>, U extends keyof T>(\n content: T,\n ...args: Prettify<ParseTranslationParamsServer<T[U]>> extends Record<\n string,\n never\n >\n ? [args?: { locale?: U | (string & {}) }]\n : [\n args: {\n locale?: U | (string & {});\n params: Prettify<ParseTranslationParamsServer<T[U]>>;\n },\n ]\n ): string {\n const { locale = Lang.locale(), params } = { params: {}, ...args?.[0] };\n\n if (!content?.[locale]) {\n throw new Error(`Translation not found for ${String(locale)}`);\n }\n\n return parseTranslation(content[locale], params ?? {});\n }\n}\n",
|
|
7
7
|
"import { Lang } from \"../facades\";\nimport { parseTranslation } from \"../utils/parseTranslation\";\nimport type { ParseTranslationParamsServer, Prettify } from \"../utils/type\";\nimport type { DictionaryHandle } from \"./defineDictionary\";\nimport type { DictionaryTranslations } from \"./dictionaryShape\";\n\n/**\n * Read one string from a `defineDictionary` dictionary outside React — a\n * controller, a job, an email template.\n *\n * Async because a bundled dictionary loads its locale on demand. Server code\n * does not go through the bundler, so in practice this resolves without ever\n * yielding; the `await` is what makes the same call work either way.\n *\n * Kept out of `defineDictionary.ts` on purpose: that module is imported by\n * components and has to stay free of the server facades this one needs.\n */\nexport async function translate<\n T extends DictionaryTranslations,\n K extends keyof T & string,\n U extends keyof T[K],\n R = Prettify<ParseTranslationParamsServer<T[K][U] & string>>,\n>(\n dictionary: DictionaryHandle<T>,\n key: K,\n ...args: R extends Record<string, never>\n ? [args?: { locale?: U | (string & {}) }]\n : [args: { locale?: U | (string & {}); params: R }]\n): Promise<string> {\n const { locale = Lang.locale(), params } = { params: {}, ...args[0] };\n const strings = await dictionary.load(String(locale));\n const template = strings[key];\n\n if (typeof template !== \"string\") {\n throw new Error(\n `Translation not found for \"${key}\" in \"${String(locale)}\" (dictionary ${dictionary.id})`,\n );\n }\n\n return parseTranslation(template, (params ?? {}) as any) as string;\n}\n"
|
|
8
8
|
],
|
|
9
|
-
"mappings": ";
|
|
10
|
-
"debugId": "
|
|
9
|
+
"mappings": ";wqBAAA,mBAAS,SAAe,eAAU,SAO3B,IAAS,JAAgB,JAAC,HAAkB,HAAwB,JAEzE,DAAM,HAAS,EAAO,EAAO,JAAM,HAAE,AACnC,CAAC,IACC,OAAO,IAAU,YACjB,EAAgB,EAAkC,EAAE,CAAC,CACzD,EAMM,EAAQ,kDAEd,GAAI,CAAC,EAqCH,OAnCe,EAAS,QAAQ,EAAO,CAAC,EAAO,EAAM,EAAM,IAAY,CAErE,IAAM,EAAY,EAAK,SAAS,GAAG,EAAI,EAAK,MAAM,GAAG,EAAE,GAAK,EAEtD,EAAQ,EAAO,GACrB,GAAI,IAAU,OACZ,OAAO,EAGT,GAAI,OAAO,IAAU,WAAY,CAG/B,IAAM,EAAiB,EADD,IAAY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js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{sa as Y}from"../chunk-
|
|
2
|
+
import{sa as Y}from"../chunk-3gvjn3q4.js";import{Pa as M}from"../chunk-2cwcfwg3.js";import{Qa as Z}from"../chunk-q6qghsy7.js";import{$a as $,Ta as J,Ua as X,Va as _,ab as E,cb as T,db as V,eb as y,fb as F,ib as K,jb as L,mb as Q,nb as U,ub as B,xb as D,yb as I}from"../chunk-23h0dmx2.js";import{Bb as R}from"../chunk-b0t4zp6b.js";import"../chunk-p3qd0gqa.js";import"../chunk-ys904esh.js";import{Bc as m,Cc as k,Wb as f}from"../chunk-dgasxgsm.js";import"../chunk-rkbv3df7.js";import"../chunk-z1e55w67.js";import"../chunk-q0y0j3ne.js";import{ze as h}from"../chunk-4mcyyh1v.js";import{Re as b}from"../chunk-z2tcxwyr.js";import"../chunk-f6dd4gd8.js";import"../chunk-3296fwss.js";import"../chunk-5gdv4n4a.js";import"../chunk-x6y1z4cq.js";import{uf as H,wf as x}from"../chunk-tds3xq6b.js";import"../chunk-j23cengk.js";import"../chunk-hxb1eg2z.js";import"../chunk-4dan69s4.js";var G=[F,L,Y,$,I,X,E,K,V,U,T,D,Q,y,Z,B,_];class w{config={};providers=[];services=[];serviceInstances=[];serviceTokens=new Set;servicesBooted=!1;models=[];app=new x;boot(){if(this.models.length>0)M(...this.models);else A();this.app.config.merge(this.config),x.setInstance(this.app),this.app.registerMany([...G,...this.providers]),this.registerServices()}registerServices(){let q=this.serviceTokens;this.serviceInstances=[],this.serviceTokens=new Set,this.servicesBooted=!1;let N=new Map;for(let z of this.services){let C=typeof z==="function"?new z:z,j=C.constructor;if(!j.token)throw Error(`Service [${j.name}] is listed in \`services\` but does not declare a \`static token\`.`);let O=N.get(j.token);if(O)throw Error(`Services [${O}] and [${j.name}] both declare the token "${j.token}". Tokens are the container's keys, so they must be unique.`);N.set(j.token,j.name);let W=j;if(!q.has(j.token)&&this.app.bound(W))throw Error(`Service [${j.name}] declares the token "${j.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(W,C),this.serviceInstances.push(C),this.serviceTokens.add(j.token)}}async waitForBoot(){await this.app.boot(),await this.bootServices()}async bootServices(){if(this.servicesBooted)return;for(let q of this.serviceInstances)await q.boot();this.servicesBooted=!0}run(q){return H.run(this.app,q)}resolve(q){return this.app.make(q)}apiRoutes(){return this.app.make(k)}viewRoutes(){return this.app.make(m)}broadcast(){return this.app.make(f)}queue(){return this.app.make(R)}destroy(){if(this.app.resolved(J))this.app.make(J).stop();if(this.app.flush(),x.getInstance()===this.app)x.setInstance(void 0);H.disable()}}function A(){if(Bun.env.NODE_ENV==="production")return;let q=b();if(q.length===0)return;console.warn(`[gemi] ${q.length} model${q.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:
|
|
@@ -13,4 +13,4 @@ import{sa as Y}from"../chunk-xdv1b8mr.js";import{Pa as M}from"../chunk-m3xy5xyf.
|
|
|
13
13
|
|
|
14
14
|
See docs/orm.md#your-model-class. Development only; this never prints in production.`)}export{G as frameworkProviders,h as UserProvider,w as Kernel};
|
|
15
15
|
|
|
16
|
-
//# debugId=
|
|
16
|
+
//# debugId=ED1A76EB755A565164756E2164756E21
|
package/dist/kernel/index.js.map
CHANGED
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
"import { Application } from \"../foundation/Application\";\nimport type { ServiceProviderConstructor } from \"../foundation/Application\";\nimport type { ServiceToken } from \"../container/Container\";\nimport type { ConfigItems } from \"../support/Repository\";\nimport type { Service, ServiceConstructor } from \"../support/Service\";\nimport { registerModels } from \"../orm/registration\";\nimport { registeredNames } from \"../orm/registry\";\nimport { Scheduler } from \"../services/cron/Scheduler\";\nimport { BroadcastManager } from \"../services/pubsub/BroadcastManager\";\nimport { QueueManager } from \"../services/queue/QueueManager\";\nimport { ApiRouteDispatcher } from \"../services/router/ApiRouteDispatcher\";\nimport { ViewRouteDispatcher } from \"../services/router/ViewRouteDispatcher\";\nimport { kernelContext } from \"./context\";\nimport { frameworkProviders } from \"./providers\";\n\n/**\n * The app's entry point into the framework. A Kernel subclass declares what the\n * app adds — its `config` slices and any extra `providers` — and everything\n * else lives in the Application container it owns.\n */\nexport class Kernel {\n /**\n * App-level config, merged over the framework defaults. Each key is a config\n * slice: `{ mail: { ... }, route: { ... } }`, normally the modules under\n * `app/config`.\n */\n protected config: ConfigItems = {};\n\n /**\n * App-level providers, registered after the framework's own so they can\n * rebind anything the framework bound.\n */\n protected providers: ServiceProviderConstructor[] = [];\n\n /**\n * The app's own singleton services. Each is constructed during the\n * synchronous boot phase and its `boot()` awaited during the asynchronous\n * one, in the order listed — so a service whose `boot()` depends on another\n * goes after it.\n *\n * An entry is either the class itself or a configured instance from\n * `Service.with({ ... })`. Listing is explicit rather than discovered because\n * the order is load-bearing here, and because a service is always imported by\n * whatever injects it — there is no file the import graph would miss.\n */\n protected services: Array<ServiceConstructor | Service> = [];\n\n private serviceInstances: Service[] = [];\n private serviceTokens = new Set<string>();\n private servicesBooted = false;\n\n /**\n * The modules holding the app's model classes — normally\n * `[generated, models]`, the generated namespace and the barrel of subclasses\n * written over it. Every model class they export is registered under the name\n * its schema carries, later modules winning, and the whole set is audited\n * before anything else boots.\n *\n * ### Why this is a Kernel field and not a line in a file somewhere\n *\n * Registration used to be `register(\"User\", User)` next to each subclass, and\n * the failure mode of forgetting it is an authorization hole that nothing\n * reports: a relation read resolves its target by name, so an unregistered\n * policied subclass leaves the generated base owning the name and every\n * nested `include` of that model comes back unscoped. No error at the root\n * either, because `$exec`'s divergence guard begins `registered !== this` and\n * the base it is running on *is* the registered one. A model only ever read\n * through an include — a membership, a pivot, the kind that carries a tenant\n * scope — never trips anything.\n *\n * Listing the modules here says it once, in the same place the app already\n * declares its config slices and providers, and turns the mistake into a\n * failure to boot rather than a quiet cross-tenant read.\n *\n * It sees the modules it is given, so a model class in a file that no barrel\n * re-exports is still invisible. That is the residual, and it is a smaller\n * one: a barrel is a place to notice an omission, and thirteen `register`\n * lines scattered across thirteen files is not.\n */\n protected models: Array<Record<string, unknown>> = [];\n\n readonly app = new Application();\n\n /**\n * Phase one, synchronous: every provider is constructed and its `register()`\n * runs. Only bindings are recorded here — no service is instantiated, so this\n * is safe to call from a synchronous constructor (`new App({ kernel })`).\n * Phase two is `waitForBoot()`.\n */\n boot() {\n // Before the container, deliberately. This throws on a model whose policies\n // would be skipped, and the useful moment for that is the one where nothing\n // has been constructed and no request can be in flight.\n if (this.models.length > 0) registerModels(...this.models);\n else warnIfModelsAreRegisteredButUndeclared();\n\n this.app.config.merge(this.config);\n Application.setInstance(this.app);\n this.app.registerMany([...frameworkProviders, ...this.providers]);\n this.registerServices();\n }\n\n /**\n * Constructs every listed service and binds it into the container. Runs after\n * the providers have registered, so a provider's `boot()` can `inject()` one;\n * a `Service` constructor does no I/O, so doing this synchronously costs\n * nothing beyond the field initializers.\n */\n private registerServices() {\n // What a previous pass bound, so re-running this on the same kernel is not\n // mistaken for a collision with something else.\n const ours = this.serviceTokens;\n\n this.serviceInstances = [];\n this.serviceTokens = new Set();\n this.servicesBooted = false;\n\n const owners = new Map<string, string>();\n\n for (const declaration of this.services) {\n const instance =\n typeof declaration === \"function\" ? new declaration() : declaration;\n const ctor = instance.constructor as ServiceConstructor;\n\n if (!ctor.token) {\n throw new Error(\n `Service [${ctor.name}] is listed in \\`services\\` but does not declare a \\`static token\\`.`,\n );\n }\n\n // Two services under one token is the failure this refuses to have\n // silently: the second would replace the first in the container, and\n // every `inject()` written against either would hand back whichever was\n // listed last.\n const owner = owners.get(ctor.token);\n if (owner) {\n throw new Error(\n `Services [${owner}] and [${ctor.name}] both declare the token \"${ctor.token}\". Tokens are the container's keys, so they must be unique.`,\n );\n }\n owners.set(ctor.token, ctor.name);\n\n // The same failure one level out. `Container.instance()` writes into\n // `instances`, which `make()` consults before `bindings`, so a token that\n // is already spoken for is not shared with its owner — it replaces it, for\n // every `app()` and `inject()` in the process. An app service that named\n // itself \"mail\" would leave `Mail.send()` resolving to an object with no\n // `send`, and the boot that caused it would report nothing. Providers have\n // all registered by now, so anything bound here belongs to somebody else.\n const token = ctor as unknown as ServiceToken<Service>;\n if (!ours.has(ctor.token) && this.app.bound(token)) {\n throw new Error(\n `Service [${ctor.name}] declares the token \"${ctor.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.`,\n );\n }\n\n this.app.instance(token, instance);\n this.serviceInstances.push(instance);\n this.serviceTokens.add(ctor.token);\n }\n }\n\n /**\n * Phase two, asynchronous: every provider's `boot()` runs, in registration\n * order, after all of them have registered. Idempotent.\n */\n async waitForBoot() {\n await this.app.boot();\n await this.bootServices();\n }\n\n /**\n * Phase two for services, after every provider's `boot()` — so a service may\n * use the facades and anything else a provider owns. Idempotent, like the\n * provider phase it follows.\n */\n private async bootServices() {\n if (this.servicesBooted) {\n return;\n }\n for (const service of this.serviceInstances) {\n await service.boot();\n }\n this.servicesBooted = true;\n }\n\n run<T>(cb: () => T) {\n return kernelContext.run(this.app, cb);\n }\n\n /**\n * Resolve a service by token. Callers outside this module should prefer the\n * named accessors below or `app()`; this exists for tooling that holds a\n * Kernel but no ambient context.\n */\n resolve<T>(token: ServiceToken<T>): T {\n return this.app.make(token);\n }\n\n // Named accessors. `app/App.ts` goes through these rather than importing the\n // service classes itself — see the note in that file about the two copies of\n // gemi that coexist at build time.\n apiRoutes(): ApiRouteDispatcher {\n return this.app.make(ApiRouteDispatcher);\n }\n\n viewRoutes(): ViewRouteDispatcher {\n return this.app.make(ViewRouteDispatcher);\n }\n\n broadcast(): BroadcastManager {\n return this.app.make(BroadcastManager);\n }\n\n queue(): QueueManager {\n return this.app.make(QueueManager);\n }\n\n destroy() {\n // Only touch services that were actually resolved — resolving one here\n // would construct it purely to tear it down.\n if (this.app.resolved(Scheduler)) {\n this.app.make(Scheduler).stop();\n }\n\n this.app.flush();\n\n if (Application.getInstance() === this.app) {\n Application.setInstance(undefined);\n }\n\n kernelContext.disable();\n }\n}\n\n/**\n * Says something to an application that has models and has not declared them.\n *\n * Without this the fix for #316 defaults to off. `models` is `[]`, `boot()`\n * no-ops, and an app upgrading from 0.48 is in exactly the state the issue\n * describes until somebody edits their Kernel by hand — while the only place\n * that says to is the **Setup** section of `docs/orm.md`, which an existing app\n * read once and will not read again. #316 was filed by an app mid-migration\n * with a 79-model schema, which is precisely the reader who never sees it.\n *\n * The condition is what makes this worth printing. A populated registry with an\n * empty `models` means the generated `index.ts` was imported and its bases are\n * what every nested read resolves to — so if any policy lives on a subclass, it\n * is being skipped inside includes right now. A Kernel with no ORM at all has\n * an empty registry and hears nothing.\n *\n * Development only, and a warning rather than a throw: an app in this state is\n * running today, and turning a working deploy into a failure to start over an\n * arrangement that *might* be fine is not a patch-level thing to do. The\n * failure it points at is silent, so the fix for it has to be noisy somewhere,\n * and the terminal an author is already looking at is the cheapest somewhere\n * there is.\n */\nfunction warnIfModelsAreRegisteredButUndeclared(): void {\n if (process.env.NODE_ENV === \"production\") return;\n\n const registered = registeredNames();\n if (registered.length === 0) return;\n\n console.warn(\n `[gemi] ${registered.length} model${registered.length === 1 ? \" is\" : \"s are\"} ` +\n `registered, but Kernel.models is empty.\\n` +\n ` Nested relation reads resolve a model by name, so a policy on a ` +\n `subclass that does not own its\\n` +\n ` name is skipped inside every include — scoped at the root, ` +\n `unscoped in an include, with nothing\\n` +\n ` to notice it. Declaring the modules registers each class under ` +\n `its own name and audits the set:\\n\\n` +\n ` import * as generated from \"../models/generated\"\\n` +\n ` import * as models from \"../models\"\\n\\n` +\n ` export default class extends Kernel {\\n` +\n ` models = [generated, models]\\n` +\n ` }\\n\\n` +\n ` See docs/orm.md#your-model-class. Development only; this never ` +\n `prints in production.`,\n );\n}\n"
|
|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