gemi 0.136.0 → 0.138.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 +48 -5
- package/dist/ai/Agent.d.ts.map +1 -1
- package/dist/ai/AgentController.d.ts +42 -2
- package/dist/ai/AgentController.d.ts.map +1 -1
- package/dist/ai/index.d.ts +3 -1
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js +85 -18
- package/dist/ai/index.js.map +7 -6
- package/dist/ai/memory/AgentMemories.d.ts +226 -0
- package/dist/ai/memory/AgentMemories.d.ts.map +1 -0
- package/dist/ai/memory/AgentMemoryStore.d.ts +182 -0
- package/dist/ai/memory/AgentMemoryStore.d.ts.map +1 -0
- package/dist/ai/memory/DatabaseAgentMemoryStore.d.ts +76 -0
- package/dist/ai/memory/DatabaseAgentMemoryStore.d.ts.map +1 -0
- package/dist/ai/memory/contextBlock.d.ts +32 -0
- package/dist/ai/memory/contextBlock.d.ts.map +1 -0
- package/dist/ai/memory/index.d.ts +6 -0
- package/dist/ai/memory/index.d.ts.map +1 -0
- package/dist/ai/memory/runMemory.d.ts +355 -0
- package/dist/ai/memory/runMemory.d.ts.map +1 -0
- package/dist/ai/memory/safety.d.ts +34 -0
- package/dist/ai/memory/safety.d.ts.map +1 -0
- package/dist/ai/memory/search.d.ts +23 -0
- package/dist/ai/memory/search.d.ts.map +1 -0
- package/dist/ai/providers/errors.d.ts +9 -1
- package/dist/ai/providers/errors.d.ts.map +1 -1
- package/dist/ai/providers/http.d.ts.map +1 -1
- package/dist/ai/providers/images.d.ts +2 -0
- package/dist/ai/providers/images.d.ts.map +1 -1
- package/dist/ai/types.d.ts +10 -1
- package/dist/ai/types.d.ts.map +1 -1
- package/dist/app/index.js +1 -1
- package/dist/bun/plugin.js +1 -1
- package/dist/bun/preload.js +1 -1
- package/dist/{chunk-rnp5k8m3.js → chunk-038xtqpm.js} +2 -2
- package/dist/{chunk-rnp5k8m3.js.map → chunk-038xtqpm.js.map} +1 -1
- package/dist/{chunk-04tkpna8.js → chunk-1y6hxv30.js} +2 -2
- package/dist/{chunk-04tkpna8.js.map → chunk-1y6hxv30.js.map} +1 -1
- package/dist/{chunk-5pdgh9a1.js → chunk-26yghzet.js} +2 -2
- package/dist/{chunk-5pdgh9a1.js.map → chunk-26yghzet.js.map} +1 -1
- package/dist/{chunk-ha15x5ns.js → chunk-27xv8kty.js} +2 -2
- package/dist/{chunk-ha15x5ns.js.map → chunk-27xv8kty.js.map} +1 -1
- package/dist/{chunk-k2xeskp6.js → chunk-3jkem5gq.js} +2 -2
- package/dist/{chunk-k2xeskp6.js.map → chunk-3jkem5gq.js.map} +1 -1
- package/dist/{chunk-q15f5g86.js → chunk-46bwknb5.js} +3 -3
- package/dist/{chunk-q15f5g86.js.map → chunk-46bwknb5.js.map} +1 -1
- package/dist/{chunk-8sde8337.js → chunk-4jc7wbet.js} +2 -2
- package/dist/{chunk-8sde8337.js.map → chunk-4jc7wbet.js.map} +1 -1
- package/dist/chunk-4wyhf6j2.js +10 -0
- package/dist/{chunk-3gx7wcrt.js.map → chunk-4wyhf6j2.js.map} +3 -3
- package/dist/{chunk-feajsgns.js → chunk-5benn2ys.js} +3 -3
- package/dist/{chunk-feajsgns.js.map → chunk-5benn2ys.js.map} +1 -1
- package/dist/{chunk-rzqft8q8.js → chunk-6qzyq0g5.js} +2 -2
- package/dist/{chunk-rzqft8q8.js.map → chunk-6qzyq0g5.js.map} +1 -1
- package/dist/{chunk-6qty7at2.js → chunk-78zfqt54.js} +2 -2
- package/dist/{chunk-6qty7at2.js.map → chunk-78zfqt54.js.map} +1 -1
- package/dist/{chunk-ysc7ykss.js → chunk-7d26eqv1.js} +2 -2
- package/dist/{chunk-ysc7ykss.js.map → chunk-7d26eqv1.js.map} +1 -1
- package/dist/{chunk-6fr6j338.js → chunk-7t7jh8t2.js} +2 -2
- package/dist/{chunk-6fr6j338.js.map → chunk-7t7jh8t2.js.map} +1 -1
- package/dist/{chunk-xvvsc58s.js → chunk-7vxeqxxr.js} +2 -2
- package/dist/{chunk-xvvsc58s.js.map → chunk-7vxeqxxr.js.map} +1 -1
- package/dist/{chunk-zyhmn3hy.js → chunk-80fjsb26.js} +3 -3
- package/dist/{chunk-zyhmn3hy.js.map → chunk-80fjsb26.js.map} +1 -1
- package/dist/{chunk-xymr3asa.js → chunk-85k70cme.js} +3 -3
- package/dist/{chunk-xymr3asa.js.map → chunk-85k70cme.js.map} +1 -1
- package/dist/{chunk-ka991yx4.js → chunk-8dmhbj4m.js} +2 -2
- package/dist/{chunk-ka991yx4.js.map → chunk-8dmhbj4m.js.map} +1 -1
- package/dist/{chunk-8ryrjtn0.js → chunk-8ef5c93d.js} +2 -2
- package/dist/{chunk-8ryrjtn0.js.map → chunk-8ef5c93d.js.map} +1 -1
- package/dist/{chunk-t33yh84d.js → chunk-8p4t8x9c.js} +2 -2
- package/dist/{chunk-t33yh84d.js.map → chunk-8p4t8x9c.js.map} +1 -1
- package/dist/{chunk-7nxnyw7x.js → chunk-965gfa41.js} +2 -2
- package/dist/{chunk-7nxnyw7x.js.map → chunk-965gfa41.js.map} +1 -1
- package/dist/{chunk-swwkdm75.js → chunk-974p7em0.js} +2 -2
- package/dist/{chunk-swwkdm75.js.map → chunk-974p7em0.js.map} +1 -1
- package/dist/{chunk-krk880my.js → chunk-9s203ks3.js} +2 -2
- package/dist/{chunk-krk880my.js.map → chunk-9s203ks3.js.map} +1 -1
- package/dist/{chunk-0eamc2tr.js → chunk-9wc53ywv.js} +2 -2
- package/dist/{chunk-0eamc2tr.js.map → chunk-9wc53ywv.js.map} +1 -1
- package/dist/{chunk-hb9hm8za.js → chunk-a2fhbstt.js} +3 -3
- package/dist/{chunk-hb9hm8za.js.map → chunk-a2fhbstt.js.map} +1 -1
- package/dist/{chunk-cxsvzqd4.js → chunk-aj2sr77y.js} +2 -2
- package/dist/{chunk-cxsvzqd4.js.map → chunk-aj2sr77y.js.map} +1 -1
- package/dist/{chunk-0gg4e94v.js → chunk-an1nja68.js} +2 -2
- package/dist/{chunk-0gg4e94v.js.map → chunk-an1nja68.js.map} +1 -1
- package/dist/{chunk-jy9dkgt0.js → chunk-ant9ck0r.js} +2 -2
- package/dist/{chunk-jy9dkgt0.js.map → chunk-ant9ck0r.js.map} +1 -1
- package/dist/{chunk-sa6cxt3g.js → chunk-bg0e39dk.js} +2 -2
- package/dist/{chunk-sa6cxt3g.js.map → chunk-bg0e39dk.js.map} +1 -1
- package/dist/{chunk-1awxdnb6.js → chunk-c0m8pcbd.js} +1 -1
- package/dist/{chunk-65j32dtn.js → chunk-c6c7p43e.js} +2 -2
- package/dist/{chunk-65j32dtn.js.map → chunk-c6c7p43e.js.map} +1 -1
- package/dist/{chunk-x9bk5s21.js → chunk-c83e4ghx.js} +2 -2
- package/dist/{chunk-x9bk5s21.js.map → chunk-c83e4ghx.js.map} +1 -1
- package/dist/{chunk-jgx8ggbz.js → chunk-cedmppcy.js} +2 -2
- package/dist/{chunk-jgx8ggbz.js.map → chunk-cedmppcy.js.map} +1 -1
- package/dist/{chunk-wrsf2abe.js → chunk-chyt9th4.js} +2 -2
- package/dist/{chunk-wrsf2abe.js.map → chunk-chyt9th4.js.map} +1 -1
- package/dist/{chunk-qfra7gah.js → chunk-d368es1y.js} +2 -2
- package/dist/{chunk-qfra7gah.js.map → chunk-d368es1y.js.map} +1 -1
- package/dist/{chunk-dt95z6et.js → chunk-d492ae5e.js} +2 -2
- package/dist/{chunk-dt95z6et.js.map → chunk-d492ae5e.js.map} +1 -1
- package/dist/{chunk-beb265c9.js → chunk-e440f645.js} +2 -2
- package/dist/{chunk-beb265c9.js.map → chunk-e440f645.js.map} +1 -1
- package/dist/{chunk-njpnstck.js → chunk-eqzxvfvt.js} +2 -2
- package/dist/{chunk-njpnstck.js.map → chunk-eqzxvfvt.js.map} +1 -1
- package/dist/{chunk-t8xs9ptb.js → chunk-es3mah07.js} +2 -2
- package/dist/{chunk-t8xs9ptb.js.map → chunk-es3mah07.js.map} +1 -1
- package/dist/{chunk-99a4e6zf.js → chunk-f9w78tbd.js} +2 -2
- package/dist/{chunk-99a4e6zf.js.map → chunk-f9w78tbd.js.map} +1 -1
- package/dist/chunk-fs4ntgdr.js +5 -0
- package/dist/{chunk-47e7fbsp.js.map → chunk-fs4ntgdr.js.map} +1 -1
- package/dist/{chunk-gng5e7pd.js → chunk-fwmmy0jn.js} +1 -1
- package/dist/{chunk-mw7ft5bs.js → chunk-g22q8j2s.js} +2 -2
- package/dist/{chunk-mw7ft5bs.js.map → chunk-g22q8j2s.js.map} +1 -1
- package/dist/{chunk-z9xxthp1.js → chunk-ghbzre7k.js} +3 -3
- package/dist/{chunk-z9xxthp1.js.map → chunk-ghbzre7k.js.map} +1 -1
- package/dist/{chunk-x5hj0mqp.js → chunk-gq4fr0zn.js} +3 -3
- package/dist/{chunk-x5hj0mqp.js.map → chunk-gq4fr0zn.js.map} +1 -1
- package/dist/{chunk-x51tegk3.js → chunk-gqcmnyc8.js} +2 -2
- package/dist/{chunk-x51tegk3.js.map → chunk-gqcmnyc8.js.map} +1 -1
- package/dist/{chunk-x16ckgq1.js → chunk-h0ydk8cc.js} +2 -2
- package/dist/{chunk-x16ckgq1.js.map → chunk-h0ydk8cc.js.map} +1 -1
- package/dist/{chunk-m9vwg9j1.js → chunk-jys3n8xv.js} +3 -3
- package/dist/{chunk-m9vwg9j1.js.map → chunk-jys3n8xv.js.map} +1 -1
- package/dist/{chunk-3h37f124.js → chunk-kpb8xvrv.js} +2 -2
- package/dist/{chunk-3h37f124.js.map → chunk-kpb8xvrv.js.map} +1 -1
- package/dist/{chunk-mpqvmge4.js → chunk-kzdkpz04.js} +1 -1
- package/dist/{chunk-0rhf4g12.js → chunk-md6wfc1h.js} +3 -3
- package/dist/{chunk-0rhf4g12.js.map → chunk-md6wfc1h.js.map} +1 -1
- package/dist/chunk-n1n7qb34.js +117 -0
- package/dist/{chunk-541s0vkt.js.map → chunk-n1n7qb34.js.map} +6 -5
- package/dist/{chunk-s025aycr.js → chunk-n2czjpz9.js} +2 -2
- package/dist/{chunk-s025aycr.js.map → chunk-n2czjpz9.js.map} +1 -1
- package/dist/{chunk-ff60bzvf.js → chunk-n7576zsr.js} +3 -3
- package/dist/{chunk-ff60bzvf.js.map → chunk-n7576zsr.js.map} +1 -1
- package/dist/{chunk-s782bzeq.js → chunk-nbfksexg.js} +2 -2
- package/dist/{chunk-s782bzeq.js.map → chunk-nbfksexg.js.map} +1 -1
- package/dist/{chunk-p82868xx.js → chunk-p1y58p84.js} +2 -2
- package/dist/{chunk-p82868xx.js.map → chunk-p1y58p84.js.map} +1 -1
- package/dist/{chunk-zv5qyrqg.js → chunk-p2c7z2nr.js} +2 -2
- package/dist/{chunk-zv5qyrqg.js.map → chunk-p2c7z2nr.js.map} +1 -1
- package/dist/{chunk-vnw91fe1.js → chunk-pv2mtg8n.js} +2 -2
- package/dist/{chunk-vnw91fe1.js.map → chunk-pv2mtg8n.js.map} +1 -1
- package/dist/{chunk-jx5zx48j.js → chunk-qfhcec6q.js} +2 -2
- package/dist/{chunk-jx5zx48j.js.map → chunk-qfhcec6q.js.map} +1 -1
- package/dist/{chunk-6hz63ts4.js → chunk-qk6vmvr2.js} +4 -4
- package/dist/{chunk-6hz63ts4.js.map → chunk-qk6vmvr2.js.map} +1 -1
- package/dist/{chunk-w1cksc5z.js → chunk-qvx8473q.js} +3 -3
- package/dist/{chunk-w1cksc5z.js.map → chunk-qvx8473q.js.map} +1 -1
- package/dist/{chunk-4278e429.js → chunk-rqb52m93.js} +2 -2
- package/dist/{chunk-4278e429.js.map → chunk-rqb52m93.js.map} +1 -1
- package/dist/{chunk-py1twqh8.js → chunk-skmdmqv7.js} +2 -2
- package/dist/{chunk-py1twqh8.js.map → chunk-skmdmqv7.js.map} +1 -1
- package/dist/{chunk-53rr32zm.js → chunk-ted0qjps.js} +1 -1
- package/dist/{chunk-hj88dcss.js → chunk-v4dp93qv.js} +3 -3
- package/dist/{chunk-hj88dcss.js.map → chunk-v4dp93qv.js.map} +1 -1
- package/dist/{chunk-33hdxe7v.js → chunk-vmr4d6hc.js} +1 -1
- package/dist/{chunk-3dpmkxp7.js → chunk-vtc1khbm.js} +2 -2
- package/dist/{chunk-3dpmkxp7.js.map → chunk-vtc1khbm.js.map} +1 -1
- package/dist/{chunk-3g5q0cj5.js → chunk-vz5rrcnh.js} +2 -2
- package/dist/{chunk-3g5q0cj5.js.map → chunk-vz5rrcnh.js.map} +1 -1
- package/dist/{chunk-pm8wjatv.js → chunk-w17p2k8g.js} +3 -3
- package/dist/{chunk-pm8wjatv.js.map → chunk-w17p2k8g.js.map} +1 -1
- package/dist/{chunk-j5g7qc5f.js → chunk-wbvb1hcx.js} +2 -2
- package/dist/{chunk-j5g7qc5f.js.map → chunk-wbvb1hcx.js.map} +1 -1
- package/dist/{chunk-jx2mgvvt.js → chunk-xwmy6fby.js} +3 -3
- package/dist/{chunk-jx2mgvvt.js.map → chunk-xwmy6fby.js.map} +1 -1
- package/dist/{chunk-z61dj480.js → chunk-y6gr3stt.js} +3 -3
- package/dist/{chunk-z61dj480.js.map → chunk-y6gr3stt.js.map} +1 -1
- package/dist/{chunk-4t41m5f1.js → chunk-yhp70t40.js} +2 -2
- package/dist/{chunk-4t41m5f1.js.map → chunk-yhp70t40.js.map} +1 -1
- package/dist/{chunk-zypmy8yq.js → chunk-z0jazehw.js} +2 -2
- package/dist/{chunk-zypmy8yq.js.map → chunk-z0jazehw.js.map} +1 -1
- package/dist/chunk-z88axcxg.js +28 -0
- package/dist/chunk-z88axcxg.js.map +27 -0
- package/dist/{chunk-gqgpwb88.js → chunk-z969a4nt.js} +2 -2
- package/dist/{chunk-gqgpwb88.js.map → chunk-z969a4nt.js.map} +1 -1
- package/dist/{chunk-hf492gg2.js → chunk-zj8y4ak5.js} +1 -1
- package/dist/{chunk-qpwb3gnh.js → chunk-zvzvgrrn.js} +2 -2
- package/dist/{chunk-qpwb3gnh.js.map → chunk-zvzvgrrn.js.map} +1 -1
- package/dist/chunks/{RealtimeClient-DsWbFRC7.js → RealtimeClient-B345JtXu.js} +2 -2
- package/dist/chunks/{RealtimeClient-DsWbFRC7.js.map → RealtimeClient-B345JtXu.js.map} +1 -1
- package/dist/chunks/{ThemeProvider-gWqXjGh-.js → ThemeProvider-BwlMubvu.js} +97 -30
- package/dist/chunks/ThemeProvider-BwlMubvu.js.map +1 -0
- package/dist/chunks/{fetchFileRequest-BSrgYnAy.js → fetchFileRequest-DKKdn8Yp.js} +2 -2
- package/dist/chunks/{fetchFileRequest-BSrgYnAy.js.map → fetchFileRequest-DKKdn8Yp.js.map} +1 -1
- package/dist/chunks/{live-CUdMhXHL.js → live-Cq65lqVg.js} +3 -3
- package/dist/chunks/{live-CUdMhXHL.js.map → live-Cq65lqVg.js.map} +1 -1
- package/dist/chunks/{mutationExtras-CtY-X9m7.js → mutationExtras-KMQj-GZD.js} +2 -2
- package/dist/chunks/{mutationExtras-CtY-X9m7.js.map → mutationExtras-KMQj-GZD.js.map} +1 -1
- package/dist/client/ServerDataProvider.d.ts +3 -0
- package/dist/client/ServerDataProvider.d.ts.map +1 -1
- package/dist/client/ThemeProvider.d.ts +23 -8
- package/dist/client/ThemeProvider.d.ts.map +1 -1
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +3 -3
- package/dist/client/theme.d.ts +47 -0
- package/dist/client/theme.d.ts.map +1 -0
- package/dist/config/index.js +1 -1
- package/dist/console/run.js +2 -2
- package/dist/console/run.js.map +1 -1
- package/dist/container/index.js +2 -2
- package/dist/container/index.js.map +1 -1
- package/dist/database/index.js +2 -2
- package/dist/database/index.js.map +1 -1
- package/dist/email/index.js +2 -2
- package/dist/email/index.js.map +1 -1
- package/dist/facades/index.js +2 -2
- package/dist/facades/index.js.map +1 -1
- package/dist/foundation/index.js +2 -2
- package/dist/foundation/index.js.map +1 -1
- package/dist/http/index.js +2 -2
- package/dist/http/index.js.map +1 -1
- package/dist/i18n/dictionaryRuntime.js +2 -2
- package/dist/i18n/dictionaryRuntime.js.map +1 -1
- package/dist/i18n/index.js +2 -2
- package/dist/i18n/index.js.map +1 -1
- package/dist/kernel/index.js +2 -2
- package/dist/kernel/index.js.map +1 -1
- package/dist/orm/index.js +2 -2
- package/dist/orm/index.js.map +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/index.js.map +1 -1
- package/dist/services/index.js +2 -2
- package/dist/services/index.js.map +1 -1
- package/dist/services/mcp/McpRegistry.d.ts.map +1 -1
- package/dist/services/queue/work.js +2 -2
- package/dist/services/queue/work.js.map +1 -1
- package/dist/services/router/ViewRouteDispatcher.d.ts +3 -1
- package/dist/services/router/ViewRouteDispatcher.d.ts.map +1 -1
- package/dist/services/router/config.d.ts +27 -0
- package/dist/services/router/config.d.ts.map +1 -1
- package/dist/stats/route-table.js +1 -1
- package/dist/support/index.js +2 -2
- package/dist/support/index.js.map +1 -1
- package/dist/testing/index.js +2 -2
- package/dist/vitest/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-2cnawkke.js +0 -22
- package/dist/chunk-2cnawkke.js.map +0 -21
- package/dist/chunk-3gx7wcrt.js +0 -10
- package/dist/chunk-47e7fbsp.js +0 -5
- package/dist/chunk-541s0vkt.js +0 -122
- package/dist/chunks/ThemeProvider-gWqXjGh-.js.map +0 -1
- /package/dist/{chunk-1awxdnb6.js.map → chunk-c0m8pcbd.js.map} +0 -0
- /package/dist/{chunk-gng5e7pd.js.map → chunk-fwmmy0jn.js.map} +0 -0
- /package/dist/{chunk-mpqvmge4.js.map → chunk-kzdkpz04.js.map} +0 -0
- /package/dist/{chunk-53rr32zm.js.map → chunk-ted0qjps.js.map} +0 -0
- /package/dist/{chunk-33hdxe7v.js.map → chunk-vmr4d6hc.js.map} +0 -0
- /package/dist/{chunk-hf492gg2.js.map → chunk-zj8y4ak5.js.map} +0 -0
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
import type { Schema } from "../Schema";
|
|
2
|
+
import type { AgentMemoryKind, AgentMemoryRecord, AgentMemoryWriteAction } from "./AgentMemoryStore";
|
|
3
|
+
/** One scope an agent declares: a label the model sees, and what it is for. */
|
|
4
|
+
export type AgentMemoryScopeOptions = {
|
|
5
|
+
/** What the model is told the scope is for. One sentence. */
|
|
6
|
+
description: string;
|
|
7
|
+
/**
|
|
8
|
+
* Whether the model may write here with `remember` and `forget`. Default
|
|
9
|
+
* `true`. `false` makes the scope read-only for the model: it is still in
|
|
10
|
+
* the `<memory>` block and `recall`, and a tool's `ctx.memory` can still
|
|
11
|
+
* write to it.
|
|
12
|
+
*/
|
|
13
|
+
write?: boolean;
|
|
14
|
+
/** The kinds the model may write here. Default `fact`, `preference` and `note`. */
|
|
15
|
+
kinds?: readonly string[];
|
|
16
|
+
/**
|
|
17
|
+
* Whether the model may change or delete a note the app wrote here
|
|
18
|
+
* (`source.by: "app"`, from `AgentMemories.put` or a tool's
|
|
19
|
+
* `ctx.memory.remember`). Default `false`: those notes are the app's, and a
|
|
20
|
+
* `remember` with the same `key` (or `replaces` naming one), or a `forget`
|
|
21
|
+
* of one, is turned down with `action: "app-managed"` and the note is left
|
|
22
|
+
* as it is. `true` lets the model correct them like its own notes.
|
|
23
|
+
*/
|
|
24
|
+
replaceAppNotes?: boolean;
|
|
25
|
+
};
|
|
26
|
+
/** A built-in tool: on, off, or on behind the user's approval. */
|
|
27
|
+
export type AgentMemoryToolOption = boolean | {
|
|
28
|
+
requiresApproval?: boolean;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* `Agent.create({ memory })` (#936): the scopes an agent remembers in, the
|
|
32
|
+
* `<memory>` block, the built-in tools and their limits.
|
|
33
|
+
*
|
|
34
|
+
* memory: {
|
|
35
|
+
* scopes: {
|
|
36
|
+
* project: { description: "This business and its brand: facts, tone, preferences." },
|
|
37
|
+
* user: { description: "The person, across their projects.", write: false },
|
|
38
|
+
* },
|
|
39
|
+
* maxTokens: 1500,
|
|
40
|
+
* }
|
|
41
|
+
*
|
|
42
|
+
* The labels are what the model sees. Which scope keys they stand for is
|
|
43
|
+
* decided per run, on the server: `AgentController.memoryScopes()`, or
|
|
44
|
+
* `memory.scopes` on `Agent.stream`. A label the run does not resolve is off
|
|
45
|
+
* for that run: not in the block, not in the tools.
|
|
46
|
+
*/
|
|
47
|
+
export type AgentMemoryOptions = {
|
|
48
|
+
/**
|
|
49
|
+
* Labels and what each is for. Lowercase letters, digits and `_`. A
|
|
50
|
+
* `thread` label is resolved to the run's thread (`thread:<threadId>`)
|
|
51
|
+
* when the run has one and the caller does not resolve it otherwise.
|
|
52
|
+
*/
|
|
53
|
+
scopes: Readonly<Record<string, AgentMemoryScopeOptions>>;
|
|
54
|
+
/**
|
|
55
|
+
* The `<memory>` block's budget, in tokens (about four characters each).
|
|
56
|
+
* Default 1,500. `0` leaves the block out. A run may set its own
|
|
57
|
+
* (`Agent.stream({ memory: { maxTokens } })`, or the controller's
|
|
58
|
+
* `memoryMaxTokens`).
|
|
59
|
+
*/
|
|
60
|
+
maxTokens?: number;
|
|
61
|
+
/**
|
|
62
|
+
* Which kinds the block lists: all of them by default. `false` leaves the
|
|
63
|
+
* block out; the tools still work, and the model finds memories with
|
|
64
|
+
* `recall`.
|
|
65
|
+
*/
|
|
66
|
+
context?: {
|
|
67
|
+
kinds?: readonly string[];
|
|
68
|
+
} | false;
|
|
69
|
+
/**
|
|
70
|
+
* The built-in `remember`, `forget` and `recall` tools, in the reserved
|
|
71
|
+
* `memory` namespace. All on by default and none needs approval;
|
|
72
|
+
* `{ remember: { requiresApproval: true } }` asks the user first.
|
|
73
|
+
* `false` turns all three off, leaving the block and `ctx.memory`.
|
|
74
|
+
*/
|
|
75
|
+
tools?: boolean | {
|
|
76
|
+
remember?: AgentMemoryToolOption;
|
|
77
|
+
forget?: AgentMemoryToolOption;
|
|
78
|
+
recall?: boolean;
|
|
79
|
+
};
|
|
80
|
+
/** The limits on what one run may write. See `DEFAULT_MEMORY_LIMITS`. */
|
|
81
|
+
limits?: {
|
|
82
|
+
/** The longest content, in characters. Default 500. */
|
|
83
|
+
maxChars?: number;
|
|
84
|
+
/** The most memories a scope may hold before an agent may add another. Default 200. */
|
|
85
|
+
maxPerScope?: number;
|
|
86
|
+
/** The most writes (`remember` and `forget`) one run may make, its sub-runs included. Default 10. */
|
|
87
|
+
maxWritesPerRun?: number;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Labels resolved to scope keys for one run, e.g.
|
|
92
|
+
* `{ project: "project:clx…", user: null }`. `null`, `undefined` or a
|
|
93
|
+
* missing label: that label is off for the run.
|
|
94
|
+
*/
|
|
95
|
+
export type AgentMemoryScopes = Record<string, string | null | undefined>;
|
|
96
|
+
/** `Agent.stream({ memory })`. */
|
|
97
|
+
export type AgentRunMemoryParams = {
|
|
98
|
+
/** The run's scope keys, by label. Decided on the server; never from the client. */
|
|
99
|
+
scopes: AgentMemoryScopes;
|
|
100
|
+
/** The `<memory>` block's budget for this run, overriding the agent's. */
|
|
101
|
+
maxTokens?: number;
|
|
102
|
+
};
|
|
103
|
+
export declare const DEFAULT_MEMORY_LIMITS: {
|
|
104
|
+
readonly maxChars: 500;
|
|
105
|
+
readonly maxPerScope: 200;
|
|
106
|
+
readonly maxWritesPerRun: 10;
|
|
107
|
+
};
|
|
108
|
+
/** The kinds the model may write when a scope does not say. */
|
|
109
|
+
export declare const DEFAULT_MEMORY_TOOL_KINDS: readonly ["fact", "preference", "note"];
|
|
110
|
+
/** Reserved: the built-in memory tools are lowered into a namespace of exactly this name. */
|
|
111
|
+
export declare const MEMORY_NAMESPACE = "memory";
|
|
112
|
+
export declare const MEMORY_NAMESPACE_DESCRIPTION = "Long-term memory: short notes kept across conversations with this user. Save what the user tells you to remember or clearly states as lasting (facts, preferences, corrections), forget what is wrong or outdated, and search the notes that are not shown.";
|
|
113
|
+
/** The built-in tools' names. Global within an agent, like every tool name. */
|
|
114
|
+
export declare const MEMORY_TOOL_NAMES: readonly ["remember", "forget", "recall"];
|
|
115
|
+
/** Throws at `Agent.create` for a declaration that cannot work. */
|
|
116
|
+
export declare function assertMemoryOptions(agent: string, options: AgentMemoryOptions): void;
|
|
117
|
+
/** Which built-in tools a declaration turns on. */
|
|
118
|
+
export declare function memoryToolsEnabled(options: AgentMemoryOptions): {
|
|
119
|
+
remember: {
|
|
120
|
+
requiresApproval: boolean;
|
|
121
|
+
} | null;
|
|
122
|
+
forget: {
|
|
123
|
+
requiresApproval: boolean;
|
|
124
|
+
} | null;
|
|
125
|
+
recall: boolean;
|
|
126
|
+
};
|
|
127
|
+
export type RememberInput = {
|
|
128
|
+
scope: string;
|
|
129
|
+
kind: string;
|
|
130
|
+
content: string;
|
|
131
|
+
key?: string;
|
|
132
|
+
replaces?: string;
|
|
133
|
+
tags?: string[];
|
|
134
|
+
};
|
|
135
|
+
/**
|
|
136
|
+
* What `remember` answers, and what a UI reads off the tool part to show
|
|
137
|
+
* "Saved to memory · Undo": `part.name === "remember"`, then `part.output`.
|
|
138
|
+
* `scope` is the label, never the key. Undo calls the app's own route, which
|
|
139
|
+
* calls `AgentMemories.delete(id)`.
|
|
140
|
+
*/
|
|
141
|
+
export type RememberResult = {
|
|
142
|
+
id: string;
|
|
143
|
+
/** The label, e.g. `project`. */
|
|
144
|
+
scope: string;
|
|
145
|
+
kind: string;
|
|
146
|
+
content: string;
|
|
147
|
+
key: string | null;
|
|
148
|
+
action: AgentMemoryWriteAction;
|
|
149
|
+
} | AppManagedResult;
|
|
150
|
+
/**
|
|
151
|
+
* A `remember` or `forget` that would have changed a note the app wrote,
|
|
152
|
+
* in a scope without `replaceAppNotes`. Nothing was written: the fields
|
|
153
|
+
* describe the app's note as it stands, and `message` tells the model why.
|
|
154
|
+
* A UI shows nothing (there is nothing to undo).
|
|
155
|
+
*/
|
|
156
|
+
export type AppManagedResult = {
|
|
157
|
+
id: string;
|
|
158
|
+
scope: string;
|
|
159
|
+
kind: string;
|
|
160
|
+
content: string;
|
|
161
|
+
key: string | null;
|
|
162
|
+
action: "app-managed";
|
|
163
|
+
message: string;
|
|
164
|
+
};
|
|
165
|
+
export type ForgetInput = {
|
|
166
|
+
id: string;
|
|
167
|
+
reason?: string;
|
|
168
|
+
};
|
|
169
|
+
/** What `forget` answers. */
|
|
170
|
+
export type ForgetResult = {
|
|
171
|
+
id: string;
|
|
172
|
+
scope: string;
|
|
173
|
+
content: string;
|
|
174
|
+
action: "forgotten";
|
|
175
|
+
} | AppManagedResult;
|
|
176
|
+
export type RecallInput = {
|
|
177
|
+
query: string;
|
|
178
|
+
scope?: string;
|
|
179
|
+
kinds?: string[];
|
|
180
|
+
limit?: number;
|
|
181
|
+
};
|
|
182
|
+
/** What `recall` answers. */
|
|
183
|
+
export type RecallResult = {
|
|
184
|
+
memories: {
|
|
185
|
+
id: string;
|
|
186
|
+
scope: string;
|
|
187
|
+
kind: string;
|
|
188
|
+
content: string;
|
|
189
|
+
key: string | null;
|
|
190
|
+
/** ISO 8601, UTC. */
|
|
191
|
+
updatedAt: string;
|
|
192
|
+
}[];
|
|
193
|
+
};
|
|
194
|
+
/**
|
|
195
|
+
* The built-in tools' shapes, added to an agent's tool shapes when it
|
|
196
|
+
* declares `memory`, so the client's tool parts are typed:
|
|
197
|
+
*
|
|
198
|
+
* if (part.type === "tool-result" && part.name === "remember") part.output.content;
|
|
199
|
+
*/
|
|
200
|
+
export type MemoryToolShapes = {
|
|
201
|
+
remember: {
|
|
202
|
+
input: RememberInput;
|
|
203
|
+
output: RememberResult;
|
|
204
|
+
progress: never;
|
|
205
|
+
};
|
|
206
|
+
forget: {
|
|
207
|
+
input: ForgetInput;
|
|
208
|
+
output: ForgetResult;
|
|
209
|
+
progress: never;
|
|
210
|
+
};
|
|
211
|
+
recall: {
|
|
212
|
+
input: RecallInput;
|
|
213
|
+
output: RecallResult;
|
|
214
|
+
progress: never;
|
|
215
|
+
};
|
|
216
|
+
};
|
|
217
|
+
/**
|
|
218
|
+
* The tools' input schemas, built for the labels a run has. The scope is an
|
|
219
|
+
* enum of labels, so the model cannot name a key, and a label the run did
|
|
220
|
+
* not resolve is not a value it can send.
|
|
221
|
+
*/
|
|
222
|
+
export declare function memoryToolSchema(name: (typeof MEMORY_TOOL_NAMES)[number], params: {
|
|
223
|
+
scopes: readonly string[];
|
|
224
|
+
descriptions: string;
|
|
225
|
+
kinds: readonly string[];
|
|
226
|
+
}): Schema<any>;
|
|
227
|
+
export declare const REMEMBER_DESCRIPTION = "Save a short note to long-term memory, so later conversations know it. Use it when the user asks you to remember something, corrects you, or states a lasting fact or preference; not for one-off requests about the current task. Only save what the user said or clearly confirmed, one fact per note, never passwords, keys or card numbers. Update an existing note (same key, or `replaces`) rather than saving a near-duplicate. The user sees each saved note and can undo it.";
|
|
228
|
+
export declare const FORGET_DESCRIPTION = "Delete a note from long-term memory by its id: when the user asks you to forget it, or it turned out wrong or outdated.";
|
|
229
|
+
export declare const RECALL_DESCRIPTION = "Search long-term memory for notes that are not shown in the <memory> block. Keyword search: use the words the note would contain.";
|
|
230
|
+
/**
|
|
231
|
+
* `ctx.memory`: the run's memory, for a tool (#936).
|
|
232
|
+
*
|
|
233
|
+
* Shaped like `ctx.attachments`: always present, and none of its methods
|
|
234
|
+
* takes a scope key. A tool names a scope by its label (`"project"`), the
|
|
235
|
+
* run maps it to the key the server resolved, and a label the run does not
|
|
236
|
+
* have is a `ToolError` ("No project memory in this conversation"). An id
|
|
237
|
+
* from another scope reads as not found, with the same words as an unknown
|
|
238
|
+
* id. So nothing a model puts in a tool's arguments can reach another
|
|
239
|
+
* tenant's memories.
|
|
240
|
+
*
|
|
241
|
+
* Reads are for passing memories on where there is no `<memory>` block: a
|
|
242
|
+
* `ctx.generate` sub-call, a prompt a tool builds.
|
|
243
|
+
*
|
|
244
|
+
* const prefs = await ctx.memory.list("project", { kinds: ["preference"], tags: ["pictures"] });
|
|
245
|
+
*/
|
|
246
|
+
export interface ToolMemory {
|
|
247
|
+
/** The labels this run has, in the order the agent declares them. */
|
|
248
|
+
readonly scopes: readonly string[];
|
|
249
|
+
/** Whether the run has this label. */
|
|
250
|
+
has(scope: string): boolean;
|
|
251
|
+
/** A scope's memories, oldest first. Without a scope, every scope's. */
|
|
252
|
+
list(scope?: string, options?: {
|
|
253
|
+
kinds?: readonly string[];
|
|
254
|
+
tags?: readonly string[];
|
|
255
|
+
limit?: number;
|
|
256
|
+
}): Promise<AgentMemoryRecord[]>;
|
|
257
|
+
/** Keyword search, best first, across the run's scopes or one of them. */
|
|
258
|
+
recall(query: string, options?: {
|
|
259
|
+
scope?: string;
|
|
260
|
+
kinds?: readonly string[];
|
|
261
|
+
tags?: readonly string[];
|
|
262
|
+
limit?: number;
|
|
263
|
+
}): Promise<AgentMemoryRecord[]>;
|
|
264
|
+
/** A memory of the run's scopes, or `null`. */
|
|
265
|
+
get(id: string): Promise<AgentMemoryRecord | null>;
|
|
266
|
+
/**
|
|
267
|
+
* Saves a memory, as the app (`source.by: "app"`), held to the same checks
|
|
268
|
+
* and limits as the model's `remember`: length, secrets, the scope's size
|
|
269
|
+
* and the run's writes. A scope the agent declares read-only for the model
|
|
270
|
+
* (`write: false`) may still be written here.
|
|
271
|
+
*/
|
|
272
|
+
remember(params: {
|
|
273
|
+
scope: string;
|
|
274
|
+
kind: AgentMemoryKind;
|
|
275
|
+
content: string;
|
|
276
|
+
key?: string;
|
|
277
|
+
tags?: string[];
|
|
278
|
+
pinned?: boolean;
|
|
279
|
+
replaces?: string;
|
|
280
|
+
}): Promise<{
|
|
281
|
+
record: AgentMemoryRecord;
|
|
282
|
+
action: AgentMemoryWriteAction;
|
|
283
|
+
}>;
|
|
284
|
+
/** Hard-deletes a memory of the run's scopes. `false` when there was none. */
|
|
285
|
+
forget(id: string): Promise<boolean>;
|
|
286
|
+
}
|
|
287
|
+
/** What only the built-in tools may call, behind a symbol `ctx.memory` does not show. */
|
|
288
|
+
export declare const MEMORY_TOOL_ACCESS: unique symbol;
|
|
289
|
+
type ToolAccess = {
|
|
290
|
+
remember(input: RememberInput): Promise<RememberResult>;
|
|
291
|
+
forget(input: ForgetInput): Promise<ForgetResult>;
|
|
292
|
+
recall(input: RecallInput): Promise<RecallResult>;
|
|
293
|
+
};
|
|
294
|
+
/** The internal half of `ctx.memory`, for the built-in tools. */
|
|
295
|
+
export declare function memoryToolAccess(memory: ToolMemory): ToolAccess;
|
|
296
|
+
/** Writes made by a run and its sub-runs, counted against `maxWritesPerRun`. */
|
|
297
|
+
export type MemoryWriteCounter = {
|
|
298
|
+
count: number;
|
|
299
|
+
};
|
|
300
|
+
/**
|
|
301
|
+
* One run's memory: its labels resolved to keys, its write counter, and the
|
|
302
|
+
* checks every write the run makes goes through.
|
|
303
|
+
*/
|
|
304
|
+
export declare class RunMemory {
|
|
305
|
+
/** Resolved labels, in declared order. */
|
|
306
|
+
readonly labels: string[];
|
|
307
|
+
readonly writes: MemoryWriteCounter;
|
|
308
|
+
private readonly keys;
|
|
309
|
+
private readonly options;
|
|
310
|
+
private readonly limits;
|
|
311
|
+
private readonly origin;
|
|
312
|
+
constructor(params: {
|
|
313
|
+
options: AgentMemoryOptions | undefined;
|
|
314
|
+
scopes: AgentMemoryScopes | undefined;
|
|
315
|
+
agent: string;
|
|
316
|
+
runId: string;
|
|
317
|
+
threadId?: string;
|
|
318
|
+
writes?: MemoryWriteCounter;
|
|
319
|
+
});
|
|
320
|
+
/** Labels the model may write to: resolved and not `write: false`. */
|
|
321
|
+
writableLabels(): string[];
|
|
322
|
+
/** The kinds the model may write into any of its writable labels. */
|
|
323
|
+
toolKinds(): string[];
|
|
324
|
+
/** "project: …; user: …", for the tools' scope field. */
|
|
325
|
+
describeScopes(labels: readonly string[]): string;
|
|
326
|
+
/** The `<memory>` block for the run, or `null` when it has none. */
|
|
327
|
+
block(params: {
|
|
328
|
+
maxTokens: number;
|
|
329
|
+
recall: boolean;
|
|
330
|
+
tools: boolean;
|
|
331
|
+
}): Promise<string | null>;
|
|
332
|
+
/** `ctx.memory` for one tool call. */
|
|
333
|
+
handle(source?: {
|
|
334
|
+
messageId?: string;
|
|
335
|
+
}): ToolMemory;
|
|
336
|
+
private allKeys;
|
|
337
|
+
private keyOf;
|
|
338
|
+
private labelOf;
|
|
339
|
+
/** A note the app wrote, in a scope where the model may not change those. */
|
|
340
|
+
private isAppManaged;
|
|
341
|
+
private appManaged;
|
|
342
|
+
private kindsFor;
|
|
343
|
+
/** A memory in one of `labels`' scopes (all of the run's by default), or `null`. */
|
|
344
|
+
private find;
|
|
345
|
+
private spend;
|
|
346
|
+
/**
|
|
347
|
+
* One write the run makes: checked, counted, then `writeMemory`. Every
|
|
348
|
+
* failure is a `ToolError` written for the model.
|
|
349
|
+
*/
|
|
350
|
+
private write;
|
|
351
|
+
}
|
|
352
|
+
/** `ctx.memory` for a call with no run memory at all (a remote MCP call). */
|
|
353
|
+
export declare function noToolMemory(): ToolMemory;
|
|
354
|
+
export {};
|
|
355
|
+
//# sourceMappingURL=runMemory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runMemory.d.ts","sourceRoot":"","sources":["../../../ai/memory/runMemory.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAOxC,OAAO,KAAK,EACV,eAAe,EACf,iBAAiB,EAEjB,sBAAsB,EACvB,MAAM,oBAAoB,CAAC;AAe5B,+EAA+E;AAC/E,MAAM,MAAM,uBAAuB,GAAG;IACpC,6DAA6D;IAC7D,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,mFAAmF;IACnF,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF,kEAAkE;AAClE,MAAM,MAAM,qBAAqB,GAAG,OAAO,GAAG;IAAE,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAE7E;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,kBA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G,SAAS,CAAC;QACxC,MAAM,EAAE,iBAAiB,GAAG,SAAS,CAAC;QACtC,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,MAAM,CAAC,EAAE,kBAAkB,CAAC;KAC7B;IAsBD,sEAAsE;IACtE,cAAc,IAAI,MAAM,EAAE;IAI1B,qEAAqE;IACrE,SAAS,IAAI,MAAM,EAAE;IAQrB,yDAAyD;IACzD,cAAc,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM;IAMjD,oEAAoE;IAC9D,KAAK,CAAC,MAAM,EAAE;QAClB,SAAS,EAAE,MAAM,CAAC;QAClB,MAAM,EAAE,OAAO,CAAC;QAChB,KAAK,EAAE,OAAO,CAAC;KAChB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAiB1B,sCAAsC;IACtC,MAAM,CAAC,MAAM,GAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,UAAU;IAiGvD,OAAO,CAAC,OAAO;IAIf,OAAO,CAAC,KAAK;IAQb,OAAO,CAAC,OAAO;IAKf,6EAA6E;IAC7E,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,UAAU;IAYlB,OAAO,CAAC,QAAQ;IAIhB,oFAAoF;YACtE,IAAI;IAWlB,OAAO,CAAC,KAAK;IAUb;;;OAGG;YACW,KAAK;CAoHpB;AAQD,6EAA6E;AAC7E,wBAAgB,YAAY,IAAI,UAAU,CAEzC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What an agent's memory write is checked against before it is stored
|
|
3
|
+
* (#936): the text has to be a short note and must not look like a secret.
|
|
4
|
+
*
|
|
5
|
+
* A memory is shown to the model on every later turn and to the user in the
|
|
6
|
+
* app's memory screen, and it outlives the conversation it came from. A
|
|
7
|
+
* password or an API key the user pasted once must not become one. The
|
|
8
|
+
* patterns below are the common shapes; `AgentMemories.use(store, {
|
|
9
|
+
* beforeWrite })` is where an app adds its own.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Why `content` must not be stored, or `null` when it may be: "an API key",
|
|
13
|
+
* "a card number", and so on. Never the matched text itself.
|
|
14
|
+
*/
|
|
15
|
+
export declare function secretIn(content: string): string | null;
|
|
16
|
+
/** One line of text: whitespace and newlines collapsed, trimmed. */
|
|
17
|
+
export declare function oneLine(text: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* Text as it may sit inside the `<memory>` block. A memory is the user's (or
|
|
20
|
+
* a web page's) words, so anything that could close the block or open
|
|
21
|
+
* another one (`</memory>`, `<system>`) is escaped, and it is kept to one line.
|
|
22
|
+
*/
|
|
23
|
+
export declare function blockText(text: string): string;
|
|
24
|
+
/** Two contents that differ only in case, spacing and closing punctuation. */
|
|
25
|
+
export declare function normalizedContent(text: string): string;
|
|
26
|
+
/** `business.hours`, `brand.voice`: letters, digits and `._:-`, at most 100. */
|
|
27
|
+
export declare const MEMORY_KEY_PATTERN: RegExp;
|
|
28
|
+
/** `fact`, `preference`, an app's own: lowercase letters, digits, `_` and `-`, at most 32. */
|
|
29
|
+
export declare const MEMORY_KIND_PATTERN: RegExp;
|
|
30
|
+
/** A tag: like a key, at most 32. */
|
|
31
|
+
export declare const MEMORY_TAG_PATTERN: RegExp;
|
|
32
|
+
/** How many tags a memory may carry. */
|
|
33
|
+
export declare const MAX_MEMORY_TAGS = 10;
|
|
34
|
+
//# sourceMappingURL=safety.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safety.d.ts","sourceRoot":"","sources":["../../../ai/memory/safety.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AA0BH;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAOvD;AAuCD,oEAAoE;AACpE,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE9C;AAED,8EAA8E;AAC9E,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAItD;AAED,gFAAgF;AAChF,eAAO,MAAM,kBAAkB,QAAuC,CAAC;AACvE,8FAA8F;AAC9F,eAAO,MAAM,mBAAmB,QAA4B,CAAC;AAC7D,qCAAqC;AACrC,eAAO,MAAM,kBAAkB,QAAuC,CAAC;AACvE,wCAAwC;AACxC,eAAO,MAAM,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { AgentMemoryRecord } from "./AgentMemoryStore";
|
|
2
|
+
/** How many memories `recall` answers when it is not told. */
|
|
3
|
+
export declare const DEFAULT_RECALL_LIMIT = 8;
|
|
4
|
+
/**
|
|
5
|
+
* Lowercased words with their accents folded, so "Öztürk" finds "ozturk" and
|
|
6
|
+
* "Cafe" finds "café". Letters and digits of any script count as word
|
|
7
|
+
* characters.
|
|
8
|
+
*/
|
|
9
|
+
export declare function tokenize(text: string): string[];
|
|
10
|
+
/**
|
|
11
|
+
* Keyword search over a scope's memories (#936 P1): BM25 over each memory's
|
|
12
|
+
* content, key and tags, with a word that only starts the same way ("photo",
|
|
13
|
+
* "photos") counted at half weight, and a small bonus for the more recently
|
|
14
|
+
* changed memory to break ties.
|
|
15
|
+
*
|
|
16
|
+
* In JavaScript rather than in SQL because a scope is small (a couple of
|
|
17
|
+
* hundred memories at most) and the same code then ranks the same way on
|
|
18
|
+
* every database. A store may answer `search` with something better.
|
|
19
|
+
*
|
|
20
|
+
* Only memories that match at least one word are returned, best first.
|
|
21
|
+
*/
|
|
22
|
+
export declare function rankMemories(records: readonly AgentMemoryRecord[], query: string, limit?: number): AgentMemoryRecord[];
|
|
23
|
+
//# sourceMappingURL=search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../ai/memory/search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,8DAA8D;AAC9D,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAetC;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAM/C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,SAAS,iBAAiB,EAAE,EACrC,KAAK,EAAE,MAAM,EACb,KAAK,GAAE,MAA6B,GACnC,iBAAiB,EAAE,CAoDrB"}
|
|
@@ -12,7 +12,9 @@ export declare class ProviderHttpError extends Error {
|
|
|
12
12
|
readonly status: number;
|
|
13
13
|
readonly body: unknown;
|
|
14
14
|
readonly requestId?: string;
|
|
15
|
-
|
|
15
|
+
/** The response's `Retry-After`, in milliseconds, when it had one. */
|
|
16
|
+
readonly retryAfter?: number;
|
|
17
|
+
constructor(status: number, body: unknown, requestId?: string, retryAfter?: number);
|
|
16
18
|
}
|
|
17
19
|
/**
|
|
18
20
|
* The request ran out of time. Its own class because it must not read as a
|
|
@@ -46,4 +48,10 @@ export declare function httpErrorDetail(error: unknown): {
|
|
|
46
48
|
* again next time.
|
|
47
49
|
*/
|
|
48
50
|
export declare function normalizeProviderError(error: unknown): AgentError;
|
|
51
|
+
/**
|
|
52
|
+
* "Please retry after 30 seconds", as Azure words it in a 429 that may come
|
|
53
|
+
* without a `Retry-After` header. Milliseconds, or undefined when the message
|
|
54
|
+
* does not say.
|
|
55
|
+
*/
|
|
56
|
+
export declare function retryAfterFromMessage(message: string): number | undefined;
|
|
49
57
|
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../ai/providers/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MA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.ts","sourceRoot":"","sources":["../../../ai/providers/http.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,SAAS,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEhF,MAAM,MAAM,cAAc,GAAG;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;iDAE6C;IAC7C,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;eAGW;IACX,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5D,MAAM,CAAC,EAAE,MAAM,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IACnB;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAMF,eAAO,MAAM,YAAY,QAAS,CAAC;AAEnC;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAOjG;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,MAAM,GAAG,MAAM,CAG5E;AA6CD;;;;;;;;GAQG;AACH,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../ai/providers/http.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,SAAS,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEhF,MAAM,MAAM,cAAc,GAAG;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;iDAE6C;IAC7C,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;eAGW;IACX,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5D,MAAM,CAAC,EAAE,MAAM,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IACnB;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAMF,eAAO,MAAM,YAAY,QAAS,CAAC;AAEnC;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAOjG;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,MAAM,GAAG,MAAM,CAG5E;AA6CD;;;;;;;;GAQG;AACH,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,QAAQ,CAAC,CA8GnB"}
|
|
@@ -72,6 +72,8 @@ export declare function imagesEndpoint(target: ProviderTarget): ImagesEndpoint;
|
|
|
72
72
|
export declare class ImageRequestError extends Error {
|
|
73
73
|
readonly code: AgentError["code"];
|
|
74
74
|
readonly retryable: boolean;
|
|
75
|
+
/** For a retryable `rate_limited`: the wait the provider asked for, in ms. */
|
|
76
|
+
readonly retryAfter?: number;
|
|
75
77
|
constructor(error: AgentError, options?: {
|
|
76
78
|
cause?: unknown;
|
|
77
79
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"images.d.ts","sourceRoot":"","sources":["../../../ai/providers/images.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB;mEAC+D;IAC/D,OAAO,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC/C,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,wBAAwB,SAAU,CAAC;AAEhD,wBAAgB,cAAc,CAAC,MAAM,EAAE,cAAc,GAAG,cAAc,CAQrE;AAED;;;;;;;;;;;GAWG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;IAC1C,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"images.d.ts","sourceRoot":"","sources":["../../../ai/providers/images.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAE1D;;;;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I,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAOF;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,GAAG,GAAG,KAAK,CAa5C;AAiCD,KAAK,WAAW,GAAG;IAAE,MAAM,CAAC,EAAE,WAAW,CAAA;CAAE,CAAC;AA6B5C,wBAAsB,aAAa,CACjC,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAE,sBAAsB,EAC5B,OAAO,GAAE,WAAgB,GACxB,OAAO,CAAC,aAAa,CAAC,CAWxB;AAED;;;;;;;GAOG;AACH,wBAAsB,SAAS,CAC7B,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAE,QAAQ,EACd,OAAO,GAAE,WAAgB,GACxB,OAAO,CAAC,aAAa,CAAC,CAOxB"}
|
package/dist/ai/types.d.ts
CHANGED
|
@@ -95,7 +95,12 @@ export type FinishReason = "stop" | "length"
|
|
|
95
95
|
* `cause: "interrupted"`. See `AgentMessage.runId`.
|
|
96
96
|
*/
|
|
97
97
|
| "interrupted";
|
|
98
|
-
export type AgentErrorCode = "provider_error" | "rate_limited" | "context_length_exceeded"
|
|
98
|
+
export type AgentErrorCode = "provider_error" | "rate_limited" | "context_length_exceeded"
|
|
99
|
+
/** The provider's safety system refused the request or its output: Azure's
|
|
100
|
+
* content filter, OpenAI's `content_policy_violation`, or an image model's
|
|
101
|
+
* `moderation_blocked`. Not retryable as is; an app may reword and try
|
|
102
|
+
* again. */
|
|
103
|
+
| "content_filtered" | "tool_error" | "invalid_tool_input"
|
|
99
104
|
/** The model's structured answer did not match the `output` schema, or never
|
|
100
105
|
* finished — from `generate`, or from an agent's final turn. The message
|
|
101
106
|
* says what was wrong, worded to be handed back to the model on a retry. */
|
|
@@ -116,6 +121,10 @@ export type AgentError = {
|
|
|
116
121
|
message: string;
|
|
117
122
|
toolCallId?: string;
|
|
118
123
|
retryable: boolean;
|
|
124
|
+
/** For a retryable `rate_limited`: how long the provider asked to wait, in
|
|
125
|
+
* milliseconds, from its `Retry-After` header or, failing that, a "retry
|
|
126
|
+
* after N seconds" in its message. Absent when the provider did not say. */
|
|
127
|
+
retryAfter?: number;
|
|
119
128
|
};
|
|
120
129
|
export type TextPart = {
|
|
121
130
|
type: "text";
|
package/dist/ai/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../ai/types.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAEhE;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,SAAS,GAAG;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAChF,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAEnD,MAAM,MAAM,KAAK,GAAG;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,kEAAkE;IAClE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;;;;;;;;OAWG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,YAAY,GACpB,MAAM,GACN,QAAQ;AACV;6EAC6E;GAC3E,WAAW;AACb;iEACiE;GAC/D,gBAAg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EAAE,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CAC/B,CAAC"}
|
package/dist/app/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Da as a}from"../chunk-
|
|
2
|
+
import{Da as a}from"../chunk-bg0e39dk.js";import"../chunk-f9w78tbd.js";import"../chunk-038xtqpm.js";export{a as App};
|
|
3
3
|
|
|
4
4
|
//# debugId=F6AD769F4DAEBF5D64756E2164756E21
|
package/dist/bun/plugin.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ea as a}from"../chunk-
|
|
2
|
+
import{ea as a}from"../chunk-vmr4d6hc.js";import"../chunk-a2fhbstt.js";import"../chunk-nbfksexg.js";import"../chunk-3jkem5gq.js";import"../chunk-038xtqpm.js";export{a as gemiPlugin};
|
|
3
3
|
|
|
4
4
|
//# debugId=2B4506B393745EFE64756E2164756E21
|
package/dist/bun/preload.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ea as k}from"../chunk-
|
|
2
|
+
import{ea as k}from"../chunk-vmr4d6hc.js";import"../chunk-a2fhbstt.js";import"../chunk-nbfksexg.js";import"../chunk-3jkem5gq.js";import{ya as j}from"../chunk-r3v2cnrj.js";import"../chunk-038xtqpm.js";var{plugin:q}=globalThis.Bun;q(k());var y=await j(process.cwd());for(let x of y.bun?.plugins??[])q(x);
|
|
3
3
|
|
|
4
4
|
//# debugId=4C9148510A2605D864756E2164756E21
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
var j=Object.create;var{getPrototypeOf:k,defineProperty:f,getOwnPropertyNames:l}=Object;var m=Object.prototype.hasOwnProperty;function n(a){return this[a]}var o,p,s=(a,b,c)=>{var g=a!=null&&typeof a==="object";if(g){var h=b?o??=new WeakMap:p??=new WeakMap,i=h.get(a);if(i)return i}c=a!=null?j(k(a)):{};let d=b||!a||!a.__esModule?f(c,"default",{value:a,enumerable:!0}):c;for(let e of l(a))if(!m.call(d,e))f(d,e,{get:n.bind(a,e),enumerable:!0});if(g)h.set(a,d);return d};var t=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports);var q=(a)=>a;function r(a,b){this[a]=q.bind(null,b)}var u=(a,b)=>{for(var c in b)f(a,c,{get:b[c],enumerable:!0,configurable:!0,set:r.bind(b,c)})};var v=(a,b)=>()=>(a&&(b=a(a=0)),b);var w=import.meta.require;
|
|
3
|
-
export{s as
|
|
3
|
+
export{s as ml,t as nl,u as ol,v as pl,w as ql};
|
|
4
4
|
|
|
5
|
-
//# debugId=
|
|
5
|
+
//# debugId=E7D588CB7D2A60B264756E2164756E21
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{R as S,T as h,U as u}from"./chunk-
|
|
2
|
+
import{R as S,T as h,U as u}from"./chunk-vtc1khbm.js";import{ma as q,na as w}from"./chunk-kzdkpz04.js";import"./chunk-a22h5cby.js";import"./chunk-epvpmakp.js";import"./chunk-r3v2cnrj.js";import"./chunk-rqb52m93.js";import"./chunk-kk18xqgc.js";import"./chunk-bg0e39dk.js";import{Fi as N}from"./chunk-p2c7z2nr.js";import{Xk as y}from"./chunk-c83e4ghx.js";import{kl as C}from"./chunk-f9w78tbd.js";import"./chunk-038xtqpm.js";import{join as $J}from"path";import{createServer as zJ}from"vite";import{join as l}from"path";import{IncomingMessage as d,ServerResponse as p}from"http";import{Socket as i}from"net";function c(J){return J.replace(/\x1b\[[0-9;]*m/g,"").replace(/\[[0-9;]*m/g,"").replace(/\n\s*\n/g,`
|
|
3
3
|
`).split(`
|
|
4
4
|
`).map((W)=>W.trim()).filter((W)=>W.length>0).join(`
|
|
5
5
|
`).trim()}function _(J){return`
|
|
@@ -55,4 +55,4 @@ window.$RefreshSig$ = () => (type) => type;
|
|
|
55
55
|
window.__vite_plugin_react_preamble_installed__ = true;
|
|
56
56
|
`;function t(J){let{pathname:W}=new URL(J.url),Z=($)=>new Response($,{headers:{"Content-Type":"application/javascript"}});if(W===T)return Z(a);if(W.startsWith("/render-error.js"))return Z("window.render_error = true");if(W.startsWith("/refresh.js"))return Z(s);return null}function P(J,W,Z){let $=l(process.cwd(),"app");return async(z)=>{let{pathname:Q}=new URL(z.url),U=(G)=>{if(console.error(G),Z.ssrFixStacktrace?.(G),O(G),C(Q))return new Response(JSON.stringify({error:N("server_error",G?.message??String(G),500)}),{status:500,headers:{"Content-Type":"application/json"}});return globalThis.__gemiErrorPageServed=!0,new Response(_(I(G)),{status:500,headers:{"Content-Type":"text/html"}})},X=async(G)=>{let j=t(G);if(j)return j;try{let L=J.fetch.bind(J),K=await n(Z,G)??await L(G);if(K instanceof Response)return K;let A={},F={},D={},m=(Y,B)=>`"${Y}": () => import("${B}")`,b=[];for(let Y of["404",...J.getFlatComponentTree.call(J)]){if(Bun.env.NODE_ENV==="test")break;let B=`${process.env.APP_DIR}`,x=await V(Z).import(`${B}/views/${Y}.tsx`);A[Y]=x.default,F[Y]=x?.OpenGraph,D[Y]=x,b.push(m(Y,`/app/views/${Y}.tsx`))}let v=`{${b.join(",")}}`;return await K({getStyles:async(Y,B)=>await S($,Z,Y,B?.layout),resolveIsland:(Y)=>({src:`/${Y}${y}`,preload:[]}),buildId:"dev",bootstrapModules:[T],viewImportMap:A,viewModules:D,ogMap:F,loaders:v,cssManifest:{}})}catch(L){return U(L)}};return await W(z,(G)=>J.withGlobalMiddleware(G,X,U))}}function r(J){try{return Bun.listen({hostname:"0.0.0.0",port:J,socket:{data(){}}}).stop(!0),!0}catch(W){return W?.code!=="EADDRINUSE"}}function f(J,W=r){let Z=24678+(J-5173);if(Z>65471)Z=24678;for(let $=Z;$<Z+64;$++)if(W($))return $;throw Error(`Could not find a free port for Vite's HMR websocket: tried ${Z}-${Z+64-1}. Set one explicitly in gemi.config.ts as \`vite: { server: { ws: { port } } }\`.`)}import{createServer as e}from"http";var JJ=new Set(["vite-hmr","vite-ping"]);async function R(J){let W=e((Z,$)=>{$.writeHead(426,{"Content-Type":"text/plain"}),$.end("Upgrade Required")});return await new Promise((Z,$)=>{W.once("error",$),W.listen(J,"127.0.0.1",()=>{W.off("error",$),Z()})}),W}function k(J){if(!J||typeof J!=="object")return null;let Z=J.server?.address?.();if(Z&&typeof Z==="object"&&"port"in Z)return Number(Z.port)||null;return null}function E(J){if(J.headers.get("upgrade")?.toLowerCase()!=="websocket")return!1;return JJ.has(J.headers.get("sec-websocket-protocol")??"")}var WJ=(J)=>typeof J==="string"?J:new Uint8Array(J);async function g(J,W,Z){let $=new URL(J.url),z=J.headers.get("sec-websocket-protocol")??"vite-hmr",Q={host:J.headers.get("host")??$.host},U=J.headers.get("origin");if(U)Q.origin=U;let X=new WebSocket(`ws://127.0.0.1:${Z}${$.pathname}${$.search}`,{protocols:[z],headers:Q});X.binaryType="arraybuffer";let G={upstream:X,early:[]};if(X.onmessage=(K)=>{let A=WJ(K.data);if(G.browser)G.browser.send(A);else G.early.push(A)},X.onclose=(K)=>{G.browser?.close(ZJ(K.code),K.reason)},X.onerror=()=>{},!await new Promise((K)=>{X.addEventListener("open",()=>K(!0),{once:!0}),X.addEventListener("close",()=>K(!1),{once:!0})}))return new Response("Vite refused the HMR websocket",{status:403});if(!W.upgrade(J,{headers:{"Sec-WebSocket-Protocol":z},data:G}))return X.close(),new Response("WebSocket upgrade failed",{status:400});return}function ZJ(J){if(J===1000||J>=1001&&J<=1003||J>=1007&&J<=1014)return J;if(J>=3000&&J<=4999)return J;return 1000}var H={open(J){let W=J.data;for(let Z of W.early)J.send(Z);if(W.early=[],W.browser=J,W.upstream.readyState!==WebSocket.OPEN)J.close(1000)},message(J,W){if(J.data.upstream.readyState===WebSocket.OPEN)J.data.upstream.send(W)},close(J){let{upstream:W}=J.data;if(W.readyState<=WebSocket.OPEN)W.close()}};function GJ(J,W){let Z=W.websocket,$=(z)=>z.data?.gemiSocket===!0;return{...W.socketOptions(),maxPayloadLength:16777216,closeOnBackpressureLimit:!1,open:(z)=>$(z)?Z.open?.(z):J.open?.(z),message:(z,Q)=>$(z)?Z.message(z,Q):J.message(z,Q),close:(z,Q,U)=>$(z)?Z.close?.(z,Q,U):J.close?.(z,Q,U)}}var M=process.cwd(),QJ=$J(M,"app");if(!globalThis.__gemiErrorHooked)globalThis.__gemiErrorHooked=!0,process.on("unhandledRejection",(J)=>{console.error(J),O(J)}),process.on("uncaughtException",(J)=>{console.error(J),O(J)});async function TJ(J,W){let Z=Number(process.env.PORT)||5173,$=u(),z=Boolean(globalThis.__gemiVite),Q=globalThis.__gemiVite??=await zJ({configFile:!1,plugins:[w()],server:{middlewareMode:!0,port:Z,ws:{server:await R(f(Z))},allowedHosts:J.devAllowedHosts.call(J),watch:{ignored:(L)=>{let K=L.split(/[/\\]/).pop()??"";return K===".env"||K.startsWith(".env.")}}},appType:"custom",resolve:{dedupe:["react","react-dom"]},optimizeDeps:{include:["react","react-dom","react-dom/client"]},ssr:{external:[...q]}});process.env.ROOT_DIR=M,process.env.APP_DIR=QJ;let U=P(J,W,Q),X=k(Q.config?.server?.ws),G=J.sockets(),j=Bun.serve({port:Z,idleTimeout:$,fetch:(L,K)=>{if(X!==null&&E(L))return g(L,K,X);if(J.applyTrustedClientIp(L),G?.matches(L))return G.upgrade(L,K);return U(L)},websocket:G?GJ(H,G):H});if(await G?.start(j),z)V(Q).clearCache();if(z)if(globalThis.__gemiErrorActive&&globalThis.__gemiErrorPageServed)globalThis.__gemiErrorActive=!1,globalThis.__gemiErrorPageServed=!1,Q.ws.send({type:"full-reload"});else globalThis.__gemiErrorActive=!1,Q.ws.send({type:"custom",event:"http-reload"});else h({port:j.port,rootDir:M});return j}export{I as viteErrorPayload,TJ as httpDev};
|
|
57
57
|
|
|
58
|
-
//# debugId=
|
|
58
|
+
//# debugId=5F606B750EC4CC1764756E2164756E21
|