gemi 0.87.0 → 0.88.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/index.js +2 -2
- package/dist/ai/index.js.map +1 -1
- package/dist/app/index.js +1 -1
- package/dist/auth/AuthController.d.ts +45 -3
- package/dist/auth/AuthController.d.ts.map +1 -1
- package/dist/auth/AuthManager.d.ts +42 -1
- package/dist/auth/AuthManager.d.ts.map +1 -1
- package/dist/auth/UserProvider.d.ts +18 -1
- package/dist/auth/UserProvider.d.ts.map +1 -1
- package/dist/auth/config.d.ts +109 -0
- package/dist/auth/config.d.ts.map +1 -1
- package/dist/auth/oneTimeCode.d.ts +99 -0
- package/dist/auth/oneTimeCode.d.ts.map +1 -0
- package/dist/auth/routes.d.ts +13 -0
- package/dist/auth/routes.d.ts.map +1 -1
- package/dist/auth/types.d.ts +8 -0
- package/dist/auth/types.d.ts.map +1 -1
- package/dist/bin/gemi.js +198 -39
- package/dist/bin/gemi.js.map +5 -4
- package/dist/bun/plugin.js +1 -1
- package/dist/bun/preload.js +1 -1
- package/dist/{chunk-3epp751c.js → chunk-0808z3mq.js} +2 -2
- package/dist/{chunk-3epp751c.js.map → chunk-0808z3mq.js.map} +1 -1
- package/dist/{chunk-q9g7g995.js → chunk-0efykzjy.js} +3 -3
- package/dist/{chunk-q9g7g995.js.map → chunk-0efykzjy.js.map} +1 -1
- package/dist/{chunk-tkhrvd30.js → chunk-16mnpn6c.js} +2 -2
- package/dist/{chunk-tkhrvd30.js.map → chunk-16mnpn6c.js.map} +1 -1
- package/dist/{chunk-r8ak7k9b.js → chunk-17nh5gfm.js} +2 -2
- package/dist/{chunk-r8ak7k9b.js.map → chunk-17nh5gfm.js.map} +1 -1
- package/dist/{chunk-m4fg0k5f.js → chunk-3ph0aj0x.js} +2 -2
- package/dist/{chunk-m4fg0k5f.js.map → chunk-3ph0aj0x.js.map} +1 -1
- package/dist/{chunk-h5mz3zdr.js → chunk-3rb5ht8v.js} +3 -3
- package/dist/{chunk-h5mz3zdr.js.map → chunk-3rb5ht8v.js.map} +1 -1
- package/dist/chunk-3w65ra1s.js +5 -0
- package/dist/{chunk-vme0xdf4.js.map → chunk-3w65ra1s.js.map} +1 -1
- package/dist/{chunk-70ha7xye.js → chunk-443dm19c.js} +2 -2
- package/dist/{chunk-70ha7xye.js.map → chunk-443dm19c.js.map} +1 -1
- package/dist/{chunk-41mz2fs2.js → chunk-49v5xq8q.js} +2 -2
- package/dist/{chunk-41mz2fs2.js.map → chunk-49v5xq8q.js.map} +1 -1
- package/dist/{chunk-hj93em1r.js → chunk-4v4v5wkh.js} +2 -2
- package/dist/{chunk-hj93em1r.js.map → chunk-4v4v5wkh.js.map} +1 -1
- package/dist/{chunk-9yd5d1ff.js → chunk-523t3bcz.js} +4 -4
- package/dist/{chunk-9yd5d1ff.js.map → chunk-523t3bcz.js.map} +1 -1
- package/dist/{chunk-xcqw162y.js → chunk-56p9a7nx.js} +3 -3
- package/dist/{chunk-xcqw162y.js.map → chunk-56p9a7nx.js.map} +1 -1
- package/dist/{chunk-4f48z676.js → chunk-61rs7kxf.js} +2 -2
- package/dist/{chunk-4f48z676.js.map → chunk-61rs7kxf.js.map} +1 -1
- package/dist/{chunk-zgy7jtcq.js → chunk-64z2zt41.js} +2 -2
- package/dist/{chunk-zgy7jtcq.js.map → chunk-64z2zt41.js.map} +1 -1
- package/dist/{chunk-2zsfntsf.js → chunk-6dyt8w27.js} +4 -4
- package/dist/{chunk-2zsfntsf.js.map → chunk-6dyt8w27.js.map} +1 -1
- package/dist/{chunk-f32t2eny.js → chunk-6rc6yec4.js} +3 -3
- package/dist/{chunk-f32t2eny.js.map → chunk-6rc6yec4.js.map} +1 -1
- package/dist/{chunk-bjd9wr4t.js → chunk-6s6fj97j.js} +2 -2
- package/dist/{chunk-bjd9wr4t.js.map → chunk-6s6fj97j.js.map} +1 -1
- package/dist/{chunk-ngqgm026.js → chunk-6tt3ynm7.js} +2 -2
- package/dist/{chunk-ngqgm026.js.map → chunk-6tt3ynm7.js.map} +1 -1
- package/dist/{chunk-brd6tb1s.js → chunk-6y62ccam.js} +3 -3
- package/dist/{chunk-brd6tb1s.js.map → chunk-6y62ccam.js.map} +1 -1
- package/dist/{chunk-f6qhsdsn.js → chunk-713fezaz.js} +2 -2
- package/dist/{chunk-f6qhsdsn.js.map → chunk-713fezaz.js.map} +1 -1
- package/dist/{chunk-27k2zsq8.js → chunk-78gs7xvn.js} +2 -2
- package/dist/{chunk-27k2zsq8.js.map → chunk-78gs7xvn.js.map} +1 -1
- package/dist/{chunk-4mynkrv4.js → chunk-7r78cdyd.js} +2 -2
- package/dist/{chunk-4mynkrv4.js.map → chunk-7r78cdyd.js.map} +1 -1
- package/dist/chunk-86p57tjw.js +5 -0
- package/dist/{chunk-p4125aj9.js.map → chunk-86p57tjw.js.map} +3 -6
- package/dist/{chunk-fsad7g9c.js → chunk-8dpnghvk.js} +2 -2
- package/dist/{chunk-fsad7g9c.js.map → chunk-8dpnghvk.js.map} +1 -1
- package/dist/{chunk-mxmw42c1.js → chunk-8pesk2wm.js} +2 -2
- package/dist/{chunk-mxmw42c1.js.map → chunk-8pesk2wm.js.map} +1 -1
- package/dist/{chunk-tx51rqct.js → chunk-8r7xhy1g.js} +2 -2
- package/dist/{chunk-tx51rqct.js.map → chunk-8r7xhy1g.js.map} +1 -1
- package/dist/{chunk-c8bjqw07.js → chunk-8y08amzz.js} +2 -2
- package/dist/{chunk-c8bjqw07.js.map → chunk-8y08amzz.js.map} +1 -1
- package/dist/{chunk-ryj4wqcp.js → chunk-9c1zx81w.js} +2 -2
- package/dist/{chunk-ryj4wqcp.js.map → chunk-9c1zx81w.js.map} +1 -1
- package/dist/{chunk-3k2ykvez.js → chunk-ak3yy4za.js} +2 -2
- package/dist/{chunk-3k2ykvez.js.map → chunk-ak3yy4za.js.map} +1 -1
- package/dist/{chunk-es6gxzyf.js → chunk-aqtf14yz.js} +2 -2
- package/dist/{chunk-es6gxzyf.js.map → chunk-aqtf14yz.js.map} +1 -1
- package/dist/{chunk-vemwqxx2.js → chunk-bsbn7qtd.js} +2 -2
- package/dist/{chunk-vemwqxx2.js.map → chunk-bsbn7qtd.js.map} +1 -1
- package/dist/{chunk-grtmy031.js → chunk-d1r618e8.js} +1 -1
- package/dist/{chunk-mjrxyvwr.js → chunk-d5h5v4rj.js} +2 -2
- package/dist/{chunk-mjrxyvwr.js.map → chunk-d5h5v4rj.js.map} +1 -1
- package/dist/{chunk-ma2zdn5s.js → chunk-e3fnjj0h.js} +2 -2
- package/dist/{chunk-ma2zdn5s.js.map → chunk-e3fnjj0h.js.map} +1 -1
- package/dist/chunk-efzvxta5.js +24 -0
- package/dist/{chunk-smtcmc20.js.map → chunk-efzvxta5.js.map} +6 -5
- package/dist/{chunk-yr51wvkr.js → chunk-fkt43zw1.js} +2 -2
- package/dist/{chunk-yr51wvkr.js.map → chunk-fkt43zw1.js.map} +1 -1
- package/dist/{chunk-x74r8j5k.js → chunk-g2bsmw1m.js} +2 -2
- package/dist/{chunk-3bjj31n9.js.map → chunk-g2bsmw1m.js.map} +1 -1
- package/dist/{chunk-v36ey99b.js → chunk-gzfat1x1.js} +2 -2
- package/dist/{chunk-v36ey99b.js.map → chunk-gzfat1x1.js.map} +1 -1
- package/dist/{chunk-97bt619e.js → chunk-hnbj9jx2.js} +3 -3
- package/dist/{chunk-97bt619e.js.map → chunk-hnbj9jx2.js.map} +1 -1
- package/dist/{chunk-y3trr7xh.js → chunk-j0fgc58k.js} +2 -2
- package/dist/{chunk-y3trr7xh.js.map → chunk-j0fgc58k.js.map} +1 -1
- package/dist/{chunk-08qvtx8v.js → chunk-j3y6pdqp.js} +2 -2
- package/dist/{chunk-08qvtx8v.js.map → chunk-j3y6pdqp.js.map} +1 -1
- package/dist/{chunk-fev2yjmb.js → chunk-jfgjscq6.js} +2 -2
- package/dist/{chunk-fev2yjmb.js.map → chunk-jfgjscq6.js.map} +1 -1
- package/dist/{chunk-165mrqab.js → chunk-ngq4n2b3.js} +2 -2
- package/dist/{chunk-165mrqab.js.map → chunk-ngq4n2b3.js.map} +1 -1
- package/dist/{chunk-t70a927z.js → chunk-pqydkns8.js} +2 -2
- package/dist/{chunk-t70a927z.js.map → chunk-pqydkns8.js.map} +1 -1
- package/dist/{chunk-yd04n99w.js → chunk-pw95y0fx.js} +2 -2
- package/dist/{chunk-yd04n99w.js.map → chunk-pw95y0fx.js.map} +1 -1
- package/dist/{chunk-04ebkq8a.js → chunk-pwaftx6n.js} +3 -3
- package/dist/{chunk-04ebkq8a.js.map → chunk-pwaftx6n.js.map} +1 -1
- package/dist/{chunk-x02whwn3.js → chunk-q6ydpt33.js} +2 -2
- package/dist/{chunk-x02whwn3.js.map → chunk-q6ydpt33.js.map} +1 -1
- package/dist/{chunk-76ar9z69.js → chunk-r1sj312m.js} +2 -2
- package/dist/{chunk-76ar9z69.js.map → chunk-r1sj312m.js.map} +1 -1
- package/dist/{chunk-0w95nc15.js → chunk-r78aqvne.js} +2 -2
- package/dist/{chunk-0w95nc15.js.map → chunk-r78aqvne.js.map} +1 -1
- package/dist/{chunk-mdpm06cg.js → chunk-r9qzgvpx.js} +2 -2
- package/dist/{chunk-mdpm06cg.js.map → chunk-r9qzgvpx.js.map} +1 -1
- package/dist/{chunk-hp96c8hp.js → chunk-rhe7s1fm.js} +3 -3
- package/dist/{chunk-hp96c8hp.js.map → chunk-rhe7s1fm.js.map} +1 -1
- package/dist/{chunk-n9n3sqx5.js → chunk-rp0reqjn.js} +2 -2
- package/dist/{chunk-n9n3sqx5.js.map → chunk-rp0reqjn.js.map} +1 -1
- package/dist/{chunk-7g90me53.js → chunk-rw0t90pf.js} +2 -2
- package/dist/{chunk-7g90me53.js.map → chunk-rw0t90pf.js.map} +1 -1
- package/dist/{chunk-9zkgvggh.js → chunk-s72y1w84.js} +2 -2
- package/dist/{chunk-9zkgvggh.js.map → chunk-s72y1w84.js.map} +1 -1
- package/dist/{chunk-3bjj31n9.js → chunk-t93t317r.js} +2 -2
- package/dist/{chunk-x74r8j5k.js.map → chunk-t93t317r.js.map} +1 -1
- package/dist/{chunk-m0kbpywd.js → chunk-ttckhvew.js} +2 -2
- package/dist/{chunk-m0kbpywd.js.map → chunk-ttckhvew.js.map} +1 -1
- package/dist/{chunk-gsv1syg3.js → chunk-whjhrz97.js} +2 -2
- package/dist/{chunk-gsv1syg3.js.map → chunk-whjhrz97.js.map} +1 -1
- package/dist/{chunk-ebbft1yj.js → chunk-x85x83pa.js} +1 -1
- package/dist/{chunk-tqzddk5e.js → chunk-xc90ycw2.js} +2 -2
- package/dist/{chunk-tqzddk5e.js.map → chunk-xc90ycw2.js.map} +1 -1
- package/dist/{chunk-w8cf1kqd.js → chunk-xqyx8kzr.js} +2 -2
- package/dist/{chunk-w8cf1kqd.js.map → chunk-xqyx8kzr.js.map} +2 -2
- package/dist/{chunk-x2ds4xaj.js → chunk-yafxbmy3.js} +1 -1
- package/dist/{chunk-71vjxehx.js → chunk-yc3n6zhr.js} +3 -3
- package/dist/{chunk-71vjxehx.js.map → chunk-yc3n6zhr.js.map} +1 -1
- package/dist/chunk-ymgehegb.js +17 -0
- package/dist/{chunk-z61sdvb0.js.map → chunk-ymgehegb.js.map} +12 -8
- package/dist/{chunk-rj81ysxm.js → chunk-zf8bgrnj.js} +2 -2
- package/dist/{chunk-rj81ysxm.js.map → chunk-zf8bgrnj.js.map} +1 -1
- package/dist/{chunk-0ms02b96.js → chunk-zn5bqe6m.js} +3 -3
- package/dist/{chunk-0ms02b96.js.map → chunk-zn5bqe6m.js.map} +1 -1
- package/dist/{chunk-7bynhyt1.js → chunk-ztzd90gp.js} +2 -2
- package/dist/{chunk-7bynhyt1.js.map → chunk-ztzd90gp.js.map} +1 -1
- package/dist/chunks/{ThemeProvider-D1kDfCwY.js → ThemeProvider-z_MW40tl.js} +126 -6
- package/dist/chunks/ThemeProvider-z_MW40tl.js.map +1 -0
- package/dist/client/ClientRouter.d.ts.map +1 -1
- package/dist/client/ClientRouterContext.d.ts.map +1 -1
- package/dist/client/ComponentContext.d.ts +8 -1
- package/dist/client/ComponentContext.d.ts.map +1 -1
- package/dist/client/MutationError.d.ts +4 -4
- package/dist/client/auth/useEmailCode.d.ts +36 -0
- package/dist/client/auth/useEmailCode.d.ts.map +1 -0
- package/dist/client/chunkLoadRecovery.d.ts +96 -0
- package/dist/client/chunkLoadRecovery.d.ts.map +1 -0
- package/dist/client/index.d.ts +4 -0
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +53 -4
- package/dist/client/index.js.map +1 -1
- package/dist/client/init.d.ts +9 -0
- package/dist/client/init.d.ts.map +1 -1
- package/dist/config/index.d.ts +12 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +1 -1
- package/dist/config/index.js.map +2 -2
- 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/Error.d.ts +2 -2
- 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.d.ts +2 -0
- package/dist/kernel/index.d.ts.map +1 -1
- package/dist/kernel/index.js +3 -3
- package/dist/kernel/index.js.map +2 -2
- package/dist/orm/index.js +3 -3
- package/dist/orm/index.js.map +1 -1
- package/dist/server/forwardedFor.d.ts +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/index.js.map +1 -1
- package/dist/server/staticAssetMiss.d.ts +7 -0
- package/dist/server/staticAssetMiss.d.ts.map +1 -1
- package/dist/services/index.d.ts +1 -1
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +3 -3
- package/dist/services/index.js.map +1 -1
- package/dist/services/queue/work.js +2 -2
- package/dist/services/queue/work.js.map +1 -1
- package/dist/services/rate-limiter/drivers/InMemoryRateLimiterDriver.d.ts +10 -1
- package/dist/services/rate-limiter/drivers/InMemoryRateLimiterDriver.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-p4125aj9.js +0 -5
- package/dist/chunk-smtcmc20.js +0 -24
- package/dist/chunk-vme0xdf4.js +0 -5
- package/dist/chunk-z61sdvb0.js +0 -17
- package/dist/chunks/ThemeProvider-D1kDfCwY.js.map +0 -1
- /package/dist/{chunk-grtmy031.js.map → chunk-d1r618e8.js.map} +0 -0
- /package/dist/{chunk-ebbft1yj.js.map → chunk-x85x83pa.js.map} +0 -0
- /package/dist/{chunk-x2ds4xaj.js.map → chunk-yafxbmy3.js.map} +0 -0
package/dist/bin/gemi.js
CHANGED
|
@@ -36002,10 +36002,10 @@ function extractAgent(ts, reference, { cwd = process.cwd(), name } = {}) {
|
|
|
36002
36002
|
].join(`
|
|
36003
36003
|
`);
|
|
36004
36004
|
const host = ts.createCompilerHost(options);
|
|
36005
|
-
const { getSourceFile, fileExists, readFile } = host;
|
|
36005
|
+
const { getSourceFile, fileExists, readFile: readFile2 } = host;
|
|
36006
36006
|
host.getSourceFile = (fileName, languageVersion, ...rest) => fileName === probe ? ts.createSourceFile(fileName, source, languageVersion) : getSourceFile.call(host, fileName, languageVersion, ...rest);
|
|
36007
36007
|
host.fileExists = (fileName) => fileName === probe || fileExists.call(host, fileName);
|
|
36008
|
-
host.readFile = (fileName) => fileName === probe ? source :
|
|
36008
|
+
host.readFile = (fileName) => fileName === probe ? source : readFile2.call(host, fileName);
|
|
36009
36009
|
const second = ts.createProgram({ rootNames: [file, probe], options, host, oldProgram: first });
|
|
36010
36010
|
const probeFile = second.getSourceFile(probe);
|
|
36011
36011
|
const alias = (aliasName) => {
|
|
@@ -36067,8 +36067,8 @@ function exportedType(ts, checker, sourceFile, reference) {
|
|
|
36067
36067
|
return { type: checker.getTypeOfSymbolAtLocation(symbol, sourceFile), name: symbol.getName() };
|
|
36068
36068
|
}
|
|
36069
36069
|
function specifier(from, to) {
|
|
36070
|
-
const
|
|
36071
|
-
return
|
|
36070
|
+
const relative4 = path7.relative(path7.dirname(from), to).split(path7.sep).join("/").replace(/(\.d)?\.(ts|tsx|mts|cts)$/, "");
|
|
36071
|
+
return relative4.startsWith(".") ? relative4 : `./${relative4}`;
|
|
36072
36072
|
}
|
|
36073
36073
|
function isFrameworkJsonValue(type) {
|
|
36074
36074
|
const alias = type.aliasSymbol;
|
|
@@ -36282,8 +36282,8 @@ function renderKotlin(agent, packageName) {
|
|
|
36282
36282
|
emit(` AgentSchema<${agent.name}.ToolCall, ${agent.name}.ToolResult, ${agent.name}.Pending, ${kotlinType(agent.output, outside)}> {`);
|
|
36283
36283
|
const hidden = new Set(classes);
|
|
36284
36284
|
const owner = hidden.has(agent.name) ? `${packageName}.${agent.name}` : agent.name;
|
|
36285
|
-
const
|
|
36286
|
-
const chat = (name) =>
|
|
36285
|
+
const inside2 = (name, namespace = owner) => hidden.has(name) ? `${namespace}.${name}` : name;
|
|
36286
|
+
const chat = (name) => inside2(name, "dev.gemijs.chat");
|
|
36287
36287
|
emit(` override val outputSerializer: KSerializer<${output}>? = ${agent.output.kind === "never" ? "null" : `serializer<${output}>()`}`);
|
|
36288
36288
|
const serializer = (type) => type.kind === "never" ? "null" : `serializer<${kotlinType(type)}>()`;
|
|
36289
36289
|
const answer = (type) => type.kind === "never" ? { kind: "json" } : type;
|
|
@@ -36293,7 +36293,7 @@ function renderKotlin(agent, packageName) {
|
|
|
36293
36293
|
raw: "ContentPart.ToolCall",
|
|
36294
36294
|
rawInside: `${chat("ContentPart")}.ToolCall`,
|
|
36295
36295
|
argument: "part",
|
|
36296
|
-
typed: (tool) => `${chat("TypedToolCall")}<${kotlinType(tool.input,
|
|
36296
|
+
typed: (tool) => `${chat("TypedToolCall")}<${kotlinType(tool.input, inside2)}, ${kotlinType(tool.progress, inside2)}>`,
|
|
36297
36297
|
build: (tool) => `ToolCall.${tool.class}(TypedToolCall(part, ${serializer(tool.input)}, ${serializer(tool.progress)}))`
|
|
36298
36298
|
},
|
|
36299
36299
|
{
|
|
@@ -36301,7 +36301,7 @@ function renderKotlin(agent, packageName) {
|
|
|
36301
36301
|
raw: "ContentPart.ToolResult",
|
|
36302
36302
|
rawInside: `${chat("ContentPart")}.ToolResult`,
|
|
36303
36303
|
argument: "part",
|
|
36304
|
-
typed: (tool) => `${chat("TypedToolResult")}<${kotlinType(answer(tool.output),
|
|
36304
|
+
typed: (tool) => `${chat("TypedToolResult")}<${kotlinType(answer(tool.output), inside2)}>`,
|
|
36305
36305
|
build: (tool) => `TypedToolResult.of(part, ${serializer(answer(tool.output))})?.let(ToolResult::${tool.class}) ?: ToolResult.Unknown(part)`
|
|
36306
36306
|
},
|
|
36307
36307
|
{
|
|
@@ -36309,7 +36309,7 @@ function renderKotlin(agent, packageName) {
|
|
|
36309
36309
|
raw: "PendingToolCall",
|
|
36310
36310
|
rawInside: chat("PendingToolCall"),
|
|
36311
36311
|
argument: "call",
|
|
36312
|
-
typed: (tool) => `${chat("TypedPendingCall")}<${kotlinType(tool.input,
|
|
36312
|
+
typed: (tool) => `${chat("TypedPendingCall")}<${kotlinType(tool.input, inside2)}, ${kotlinType(answer(tool.output), inside2)}>`,
|
|
36313
36313
|
build: (tool) => `Pending.${tool.class}(TypedPendingCall(call, ${serializer(tool.input)}, ${serializer(answer(tool.output))}))`
|
|
36314
36314
|
}
|
|
36315
36315
|
];
|
|
@@ -36317,12 +36317,12 @@ function renderKotlin(agent, packageName) {
|
|
|
36317
36317
|
emit();
|
|
36318
36318
|
emit(` public sealed interface ${view.name} {`);
|
|
36319
36319
|
for (const tool of tools) {
|
|
36320
|
-
emit(` public data class ${tool.class}(val value: ${view.typed(tool)}) : ${
|
|
36320
|
+
emit(` public data class ${tool.class}(val value: ${view.typed(tool)}) : ${inside2(view.name)}`);
|
|
36321
36321
|
}
|
|
36322
36322
|
emit("");
|
|
36323
36323
|
emit(" /** A tool this file does not know \u2014 added since it was generated, or a");
|
|
36324
36324
|
emit(" * skill \u2014 or a payload that no longer decodes. */");
|
|
36325
|
-
emit(` public data class Unknown(val value: ${view.rawInside}) : ${
|
|
36325
|
+
emit(` public data class Unknown(val value: ${view.rawInside}) : ${inside2(view.name)}`);
|
|
36326
36326
|
emit(" }");
|
|
36327
36327
|
}
|
|
36328
36328
|
for (const view of views) {
|
|
@@ -36728,6 +36728,8 @@ var init_generate = __esm(() => {
|
|
|
36728
36728
|
// bin/gemi.ts
|
|
36729
36729
|
import path9 from "path";
|
|
36730
36730
|
import { existsSync as existsSync8 } from "fs";
|
|
36731
|
+
import { mkdtemp, rm } from "fs/promises";
|
|
36732
|
+
import { tmpdir } from "os";
|
|
36731
36733
|
|
|
36732
36734
|
// bin/createRollupInput.ts
|
|
36733
36735
|
var {Glob } = globalThis.Bun;
|
|
@@ -40136,6 +40138,150 @@ var gemi = async () => {
|
|
|
40136
40138
|
};
|
|
40137
40139
|
var vite_default = gemi;
|
|
40138
40140
|
|
|
40141
|
+
// vite/previousAssets.ts
|
|
40142
|
+
import { copyFile, lstat, mkdir as mkdir2, readdir, readFile, stat, writeFile as writeFile2 } from "fs/promises";
|
|
40143
|
+
import { dirname as dirname2, isAbsolute, join as join4, relative, resolve, sep } from "path";
|
|
40144
|
+
var PREVIOUS_ASSETS_RECORD = ".vite/previous-assets.json";
|
|
40145
|
+
var DEFAULT_RETAINED_RELEASES = 2;
|
|
40146
|
+
var DEFAULT_RETAINED_MAX_AGE_SECONDS = 7 * 24 * 60 * 60;
|
|
40147
|
+
var ASSETS_DIR = "assets";
|
|
40148
|
+
function resolvePreviousAssets(configured, rootDir, env = process.env.GEMI_PREVIOUS_ASSETS) {
|
|
40149
|
+
const fromEnv = env?.trim();
|
|
40150
|
+
if (!fromEnv && !configured) {
|
|
40151
|
+
return;
|
|
40152
|
+
}
|
|
40153
|
+
const config = typeof configured === "object" ? configured : {};
|
|
40154
|
+
const from = fromEnv || config.from || join4("dist", "client");
|
|
40155
|
+
const releases = config.releases ?? DEFAULT_RETAINED_RELEASES;
|
|
40156
|
+
const maxAge = config.maxAge ?? DEFAULT_RETAINED_MAX_AGE_SECONDS;
|
|
40157
|
+
if (!Number.isInteger(releases) || releases < 0) {
|
|
40158
|
+
throw new Error(`previousAssets.releases must be a whole number \u2265 0, got ${releases}`);
|
|
40159
|
+
}
|
|
40160
|
+
if (!(maxAge >= 0)) {
|
|
40161
|
+
throw new Error(`previousAssets.maxAge must be a number of seconds \u2265 0, got ${maxAge}`);
|
|
40162
|
+
}
|
|
40163
|
+
return {
|
|
40164
|
+
from: isAbsolute(from) ? from : resolve(rootDir, from),
|
|
40165
|
+
releases,
|
|
40166
|
+
maxAgeMs: maxAge * 1000
|
|
40167
|
+
};
|
|
40168
|
+
}
|
|
40169
|
+
async function stagePreviousAssets(options, stagingDir, now = new Date) {
|
|
40170
|
+
const { from } = options;
|
|
40171
|
+
if (!await isDirectory(join4(from, ASSETS_DIR))) {
|
|
40172
|
+
console.log(`No previous assets at ${join4(from, ASSETS_DIR)}; nothing to carry over.`);
|
|
40173
|
+
return [];
|
|
40174
|
+
}
|
|
40175
|
+
const carried = await readRecord(from);
|
|
40176
|
+
const carriedFiles = new Set(carried.flatMap((release) => release.files));
|
|
40177
|
+
const own = (await listFiles(from, ASSETS_DIR)).filter((file) => isCarriable(file) && !carriedFiles.has(file));
|
|
40178
|
+
const releases = [
|
|
40179
|
+
{ retiredAt: now.toISOString(), files: own },
|
|
40180
|
+
...carried.filter((release) => now.getTime() - Date.parse(release.retiredAt) < options.maxAgeMs)
|
|
40181
|
+
].filter((release) => release.files.length > 0).slice(0, options.releases);
|
|
40182
|
+
const kept = [];
|
|
40183
|
+
for (const release of releases) {
|
|
40184
|
+
const files = [];
|
|
40185
|
+
for (const file of release.files) {
|
|
40186
|
+
const source = isCarriable(file) ? inside(from, file) : null;
|
|
40187
|
+
if (!source || !await isFile(source)) {
|
|
40188
|
+
continue;
|
|
40189
|
+
}
|
|
40190
|
+
const target = join4(stagingDir, file);
|
|
40191
|
+
await mkdir2(dirname2(target), { recursive: true });
|
|
40192
|
+
await copyFile(source, target);
|
|
40193
|
+
files.push(file);
|
|
40194
|
+
}
|
|
40195
|
+
if (files.length > 0) {
|
|
40196
|
+
kept.push({ retiredAt: release.retiredAt, files });
|
|
40197
|
+
}
|
|
40198
|
+
}
|
|
40199
|
+
return kept;
|
|
40200
|
+
}
|
|
40201
|
+
async function restorePreviousAssets(stagingDir, clientDir, releases) {
|
|
40202
|
+
const record = [];
|
|
40203
|
+
let count = 0;
|
|
40204
|
+
for (const release of releases) {
|
|
40205
|
+
const files = [];
|
|
40206
|
+
for (const file of release.files) {
|
|
40207
|
+
const target = inside(clientDir, file);
|
|
40208
|
+
if (!target || await exists(target)) {
|
|
40209
|
+
continue;
|
|
40210
|
+
}
|
|
40211
|
+
await mkdir2(dirname2(target), { recursive: true });
|
|
40212
|
+
await copyFile(join4(stagingDir, file), target);
|
|
40213
|
+
files.push(file);
|
|
40214
|
+
}
|
|
40215
|
+
if (files.length > 0) {
|
|
40216
|
+
record.push({ retiredAt: release.retiredAt, files });
|
|
40217
|
+
count += files.length;
|
|
40218
|
+
}
|
|
40219
|
+
}
|
|
40220
|
+
const recordPath = join4(clientDir, PREVIOUS_ASSETS_RECORD);
|
|
40221
|
+
await mkdir2(dirname2(recordPath), { recursive: true });
|
|
40222
|
+
await writeFile2(recordPath, `${JSON.stringify({ releases: record }, null, 2)}
|
|
40223
|
+
`);
|
|
40224
|
+
return { files: count, releases: record.length };
|
|
40225
|
+
}
|
|
40226
|
+
async function readRecord(clientDir) {
|
|
40227
|
+
let raw;
|
|
40228
|
+
try {
|
|
40229
|
+
raw = await readFile(join4(clientDir, PREVIOUS_ASSETS_RECORD), "utf8");
|
|
40230
|
+
} catch (error) {
|
|
40231
|
+
if (error?.code === "ENOENT") {
|
|
40232
|
+
return [];
|
|
40233
|
+
}
|
|
40234
|
+
throw error;
|
|
40235
|
+
}
|
|
40236
|
+
const releases = JSON.parse(raw)?.releases;
|
|
40237
|
+
if (!Array.isArray(releases)) {
|
|
40238
|
+
return [];
|
|
40239
|
+
}
|
|
40240
|
+
return releases.filter((release) => typeof release?.retiredAt === "string" && !Number.isNaN(Date.parse(release.retiredAt)) && Array.isArray(release.files) && release.files.every((file) => typeof file === "string"));
|
|
40241
|
+
}
|
|
40242
|
+
async function listFiles(root, dir) {
|
|
40243
|
+
const files = [];
|
|
40244
|
+
for (const entry of await readdir(join4(root, dir), { withFileTypes: true })) {
|
|
40245
|
+
const path3 = `${dir}/${entry.name}`;
|
|
40246
|
+
if (entry.isDirectory()) {
|
|
40247
|
+
files.push(...await listFiles(root, path3));
|
|
40248
|
+
} else if (entry.isFile()) {
|
|
40249
|
+
files.push(path3);
|
|
40250
|
+
}
|
|
40251
|
+
}
|
|
40252
|
+
return files;
|
|
40253
|
+
}
|
|
40254
|
+
function isCarriable(file) {
|
|
40255
|
+
return !file.endsWith(".map") && !file.split("/").some((part) => part.startsWith("."));
|
|
40256
|
+
}
|
|
40257
|
+
function inside(root, file) {
|
|
40258
|
+
const path3 = resolve(root, file);
|
|
40259
|
+
const rel2 = relative(root, path3);
|
|
40260
|
+
return rel2 && !rel2.startsWith("..") && !isAbsolute(rel2) && rel2.split(sep)[0] === ASSETS_DIR ? path3 : null;
|
|
40261
|
+
}
|
|
40262
|
+
async function isDirectory(path3) {
|
|
40263
|
+
try {
|
|
40264
|
+
return (await stat(path3)).isDirectory();
|
|
40265
|
+
} catch {
|
|
40266
|
+
return false;
|
|
40267
|
+
}
|
|
40268
|
+
}
|
|
40269
|
+
async function isFile(path3) {
|
|
40270
|
+
try {
|
|
40271
|
+
return (await lstat(path3)).isFile();
|
|
40272
|
+
} catch {
|
|
40273
|
+
return false;
|
|
40274
|
+
}
|
|
40275
|
+
}
|
|
40276
|
+
async function exists(path3) {
|
|
40277
|
+
try {
|
|
40278
|
+
await stat(path3);
|
|
40279
|
+
return true;
|
|
40280
|
+
} catch {
|
|
40281
|
+
return false;
|
|
40282
|
+
}
|
|
40283
|
+
}
|
|
40284
|
+
|
|
40139
40285
|
// ../../node_modules/.bun/commander@12.1.0/node_modules/commander/esm.mjs
|
|
40140
40286
|
var import__ = __toESM(require_commander(), 1);
|
|
40141
40287
|
var {
|
|
@@ -40154,26 +40300,26 @@ var {
|
|
|
40154
40300
|
|
|
40155
40301
|
// bin/check-models.ts
|
|
40156
40302
|
import { statSync as statSync2 } from "fs";
|
|
40157
|
-
import { relative as
|
|
40303
|
+
import { relative as relative3, resolve as resolve2 } from "path";
|
|
40158
40304
|
|
|
40159
40305
|
// support/discover.ts
|
|
40160
40306
|
import { existsSync as existsSync3, readdirSync as readdirSync2 } from "fs";
|
|
40161
|
-
import { join as
|
|
40307
|
+
import { join as join5, relative as relative2 } from "path";
|
|
40162
40308
|
function sourceFiles(dir, ignore = []) {
|
|
40163
40309
|
const out = [];
|
|
40164
40310
|
const ignored = (path3) => {
|
|
40165
|
-
const rel2 =
|
|
40311
|
+
const rel2 = relative2(dir, path3).split("\\").join("/");
|
|
40166
40312
|
return ignore.some((pattern) => rel2 === pattern || rel2.startsWith(`${pattern}/`));
|
|
40167
40313
|
};
|
|
40168
40314
|
const walk3 = (current) => {
|
|
40169
40315
|
for (const entry of readdirSync2(current, { withFileTypes: true }).sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0)) {
|
|
40170
|
-
const path3 =
|
|
40316
|
+
const path3 = join5(current, entry.name);
|
|
40171
40317
|
if (ignored(path3))
|
|
40172
40318
|
continue;
|
|
40173
40319
|
if (entry.isDirectory()) {
|
|
40174
40320
|
if (entry.name.startsWith(".") || entry.name === "node_modules")
|
|
40175
40321
|
continue;
|
|
40176
|
-
if (existsSync3(
|
|
40322
|
+
if (existsSync3(join5(path3, "package.json")))
|
|
40177
40323
|
continue;
|
|
40178
40324
|
walk3(path3);
|
|
40179
40325
|
continue;
|
|
@@ -40250,7 +40396,7 @@ class CheckModelsError extends Error {
|
|
|
40250
40396
|
async function namedModules(rootDir, paths) {
|
|
40251
40397
|
const modules = [];
|
|
40252
40398
|
for (const path3 of paths) {
|
|
40253
|
-
const resolved =
|
|
40399
|
+
const resolved = resolve2(rootDir, path3);
|
|
40254
40400
|
try {
|
|
40255
40401
|
modules.push(await import(resolved));
|
|
40256
40402
|
} catch (error) {
|
|
@@ -40261,19 +40407,19 @@ async function namedModules(rootDir, paths) {
|
|
|
40261
40407
|
return modules;
|
|
40262
40408
|
}
|
|
40263
40409
|
async function declaredModules(rootDir) {
|
|
40264
|
-
const path3 =
|
|
40410
|
+
const path3 = resolve2(rootDir, "app/kernel/Kernel.ts");
|
|
40265
40411
|
let Kernel;
|
|
40266
40412
|
try {
|
|
40267
40413
|
({ default: Kernel } = await import(path3));
|
|
40268
40414
|
} catch (error) {
|
|
40269
|
-
throw new CheckModelsError(`Could not load ${
|
|
40415
|
+
throw new CheckModelsError(`Could not load ${relative3(rootDir, path3)}:
|
|
40270
40416
|
${error.message}`);
|
|
40271
40417
|
}
|
|
40272
40418
|
return new Kernel().models ?? [];
|
|
40273
40419
|
}
|
|
40274
40420
|
async function checkModels(options) {
|
|
40275
|
-
const rootDir =
|
|
40276
|
-
const modelsDir =
|
|
40421
|
+
const rootDir = resolve2(options.rootDir);
|
|
40422
|
+
const modelsDir = resolve2(rootDir, options.modelsDir ?? "app/models");
|
|
40277
40423
|
const ignore = options.ignore ?? [];
|
|
40278
40424
|
let orm;
|
|
40279
40425
|
try {
|
|
@@ -40319,8 +40465,8 @@ ${error.message}`);
|
|
|
40319
40465
|
const paths = modelFiles(modelsDir, ignore);
|
|
40320
40466
|
const files = [];
|
|
40321
40467
|
for (const path3 of paths) {
|
|
40322
|
-
const label =
|
|
40323
|
-
const specifier = `./${
|
|
40468
|
+
const label = relative3(rootDir, path3);
|
|
40469
|
+
const specifier = `./${relative3(modelsDir, path3).split("\\").join("/").replace(/\.tsx?$/, "")}`;
|
|
40324
40470
|
try {
|
|
40325
40471
|
files.push({
|
|
40326
40472
|
label,
|
|
@@ -40369,7 +40515,7 @@ function indent(message) {
|
|
|
40369
40515
|
|
|
40370
40516
|
// bin/ide/generateApiManifest.ts
|
|
40371
40517
|
var import_recast2 = __toESM(require_main2(), 1);
|
|
40372
|
-
import { join as
|
|
40518
|
+
import { join as join6 } from "path";
|
|
40373
40519
|
import { existsSync as existsSync4 } from "fs";
|
|
40374
40520
|
|
|
40375
40521
|
// utils/toCamelCase.ts
|
|
@@ -40421,7 +40567,7 @@ class ApiManifestGenerator {
|
|
|
40421
40567
|
rootRouterBody;
|
|
40422
40568
|
routerBodyCache = new Map;
|
|
40423
40569
|
controllerCache = new Map;
|
|
40424
|
-
manifestCacheDir =
|
|
40570
|
+
manifestCacheDir = join6(ROOT, ".gemi/cache/api-routes-manifest");
|
|
40425
40571
|
async writeManifest(cacheFilePath) {
|
|
40426
40572
|
const manifest = {};
|
|
40427
40573
|
for (const [routeName, method] of this.routes.entries()) {
|
|
@@ -40453,7 +40599,7 @@ class ApiManifestGenerator {
|
|
|
40453
40599
|
if (path4.startsWith("@/app")) {
|
|
40454
40600
|
return path4.replace("@", "") + ".ts";
|
|
40455
40601
|
}
|
|
40456
|
-
return
|
|
40602
|
+
return join6(parentPath, path4) + ".ts";
|
|
40457
40603
|
}
|
|
40458
40604
|
isFileShouldBeParsed(path4) {
|
|
40459
40605
|
return path4.includes("app/http/router") || path4.includes("app/http/controllers");
|
|
@@ -40501,7 +40647,7 @@ class ApiManifestGenerator {
|
|
|
40501
40647
|
if (normalizedPath.startsWith("/app/http/controllers")) {
|
|
40502
40648
|
for (const specifier of node.specifiers) {
|
|
40503
40649
|
const name = specifier.type === "ImportDefaultSpecifier" ? specifier.local.name : specifier.imported.name;
|
|
40504
|
-
await this.parseControllerFile(await this.parseFile(
|
|
40650
|
+
await this.parseControllerFile(await this.parseFile(join6(ROOT, normalizedPath)), name, normalizedPath);
|
|
40505
40651
|
}
|
|
40506
40652
|
}
|
|
40507
40653
|
if (normalizedPath.startsWith("/app/http/routes")) {
|
|
@@ -40605,7 +40751,7 @@ class ApiManifestGenerator {
|
|
|
40605
40751
|
}
|
|
40606
40752
|
async parse(cacheFilePath, filePath, isRoot = true, name = "") {
|
|
40607
40753
|
console.log({ ROOT, filePath });
|
|
40608
|
-
const file = await this.parseFile(
|
|
40754
|
+
const file = await this.parseFile(join6(ROOT, filePath));
|
|
40609
40755
|
for (const body of file.program.body) {
|
|
40610
40756
|
if (!this.isNodeShouldBeParsed(body))
|
|
40611
40757
|
continue;
|
|
@@ -40641,7 +40787,7 @@ class ApiManifestGenerator {
|
|
|
40641
40787
|
}
|
|
40642
40788
|
async run(filePath) {
|
|
40643
40789
|
const cacheId = generateGitDiffId();
|
|
40644
|
-
const cacheFilePath =
|
|
40790
|
+
const cacheFilePath = join6(this.manifestCacheDir, `${cacheId}.json`);
|
|
40645
40791
|
if (existsSync4(cacheFilePath)) {
|
|
40646
40792
|
console.log(await Bun.file(cacheFilePath).text());
|
|
40647
40793
|
} else {
|
|
@@ -40853,11 +40999,11 @@ function hashDirectory(dir) {
|
|
|
40853
40999
|
const entries = readdirSync3(current, { withFileTypes: true }).sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0);
|
|
40854
41000
|
for (const entry of entries) {
|
|
40855
41001
|
const full = path5.join(current, entry.name);
|
|
40856
|
-
const
|
|
41002
|
+
const relative4 = prefix ? `${prefix}/${entry.name}` : entry.name;
|
|
40857
41003
|
if (entry.isDirectory()) {
|
|
40858
|
-
walk3(full,
|
|
41004
|
+
walk3(full, relative4);
|
|
40859
41005
|
} else if (entry.isFile()) {
|
|
40860
|
-
hash.update(
|
|
41006
|
+
hash.update(relative4);
|
|
40861
41007
|
hash.update("\x00");
|
|
40862
41008
|
hash.update(readFileSync3(full));
|
|
40863
41009
|
hash.update("\x00");
|
|
@@ -41195,12 +41341,25 @@ program.command("build").action(async () => {
|
|
|
41195
41341
|
const config = await loadGemiConfig(rootDir);
|
|
41196
41342
|
const input = await createRollupInput_default(appDir);
|
|
41197
41343
|
process.env.GEMI_INPUT = JSON.stringify(input);
|
|
41198
|
-
|
|
41199
|
-
await
|
|
41200
|
-
|
|
41201
|
-
|
|
41202
|
-
|
|
41203
|
-
|
|
41344
|
+
const previousAssets = resolvePreviousAssets(config.previousAssets, rootDir);
|
|
41345
|
+
const stagingDir = previousAssets ? await mkdtemp(path9.join(tmpdir(), "gemi-previous-assets-")) : undefined;
|
|
41346
|
+
try {
|
|
41347
|
+
const retained = previousAssets && stagingDir ? await stagePreviousAssets(previousAssets, stagingDir) : [];
|
|
41348
|
+
console.log("Building client...");
|
|
41349
|
+
await build({
|
|
41350
|
+
configFile: false,
|
|
41351
|
+
plugins: [vite_default()],
|
|
41352
|
+
build: { outDir: "dist/client" }
|
|
41353
|
+
});
|
|
41354
|
+
if (stagingDir) {
|
|
41355
|
+
const carried = await restorePreviousAssets(stagingDir, path9.join(rootDir, "dist", "client"), retained);
|
|
41356
|
+
console.log(`Kept ${carried.files} asset file(s) from ${carried.releases} earlier release(s).`);
|
|
41357
|
+
}
|
|
41358
|
+
} finally {
|
|
41359
|
+
if (stagingDir) {
|
|
41360
|
+
await rm(stagingDir, { recursive: true, force: true });
|
|
41361
|
+
}
|
|
41362
|
+
}
|
|
41204
41363
|
console.log("Building server...");
|
|
41205
41364
|
await build({
|
|
41206
41365
|
configFile: false,
|
|
@@ -41356,5 +41515,5 @@ program.command("app:route-manifest").action(async () => {
|
|
|
41356
41515
|
});
|
|
41357
41516
|
program.parse();
|
|
41358
41517
|
|
|
41359
|
-
//# debugId=
|
|
41518
|
+
//# debugId=5AAC40F8231D70BD64756E2164756E21
|
|
41360
41519
|
//# sourceMappingURL=gemi.js.map
|