@frockbot/cloudflare 0.7.296 → 0.7.297
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/package.json +7 -7
- package/src/bot-state.ts +8 -0
- package/src/memory-records.ts +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frockbot/cloudflare",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.297",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
"typecheck": "tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.access.json && tsc --noEmit -p test/tsconfig.json && tsc --noEmit -p e2e/tsconfig.json"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@frockbot/app": "0.7.
|
|
27
|
-
"@frockbot/applets": "0.7.
|
|
28
|
-
"@frockbot/computer": "0.7.
|
|
29
|
-
"@frockbot/core": "0.7.
|
|
30
|
-
"@frockbot/frock-compose": "0.7.
|
|
31
|
-
"@frockbot/providers": "0.7.
|
|
26
|
+
"@frockbot/app": "0.7.297",
|
|
27
|
+
"@frockbot/applets": "0.7.297",
|
|
28
|
+
"@frockbot/computer": "0.7.297",
|
|
29
|
+
"@frockbot/core": "0.7.297",
|
|
30
|
+
"@frockbot/frock-compose": "0.7.297",
|
|
31
|
+
"@frockbot/providers": "0.7.297",
|
|
32
32
|
"@rive-app/flutter-native-wasm": "44.0.0",
|
|
33
33
|
"agents": "0.24.0",
|
|
34
34
|
"ai": "^7.0.107",
|
package/src/bot-state.ts
CHANGED
|
@@ -365,6 +365,8 @@ import { createMemoryEmbedder } from "@frockbot/app/memory/embeddings";
|
|
|
365
365
|
import { MemoryRecordsV1 } from "@frockbot/app/memory/owner";
|
|
366
366
|
import { createVectorMemorySearchV1 } from "@frockbot/app/memory/semantic";
|
|
367
367
|
import { createHostedMemoryExtractorV1 } from "@frockbot/app/memory/extraction-host";
|
|
368
|
+
import { hostedJevClientV1 } from "@frockbot/app/supervision";
|
|
369
|
+
import { judgeMemoryWriteV1 } from "@frockbot/app/supervision/memory-write";
|
|
368
370
|
import {
|
|
369
371
|
createBotMemoryEngineV1,
|
|
370
372
|
createUserMemoryRecordsRemoteV1,
|
|
@@ -1172,12 +1174,18 @@ export class BotState
|
|
|
1172
1174
|
: {}),
|
|
1173
1175
|
...(this.backendEnv.BILLING ? { billing: this.backendEnv.BILLING } : {}),
|
|
1174
1176
|
});
|
|
1177
|
+
const jev = hostedJevClientV1(
|
|
1178
|
+
this.backendEnv as unknown as Record<string, string | undefined>,
|
|
1179
|
+
);
|
|
1175
1180
|
await drainDurableMemoryV1(this.memoryEngine(), {
|
|
1176
1181
|
...(this.env.MEMORY_INDEX
|
|
1177
1182
|
? { vectors: this.env.MEMORY_INDEX as MemoryVectorIndex }
|
|
1178
1183
|
: {}),
|
|
1179
1184
|
...(this.env.AI ? { ai: this.env.AI as MemoryAiBinding } : {}),
|
|
1180
1185
|
...(extract ? { extract } : {}),
|
|
1186
|
+
...(jev
|
|
1187
|
+
? { judgeWrite: (evidence) => judgeMemoryWriteV1(jev, evidence) }
|
|
1188
|
+
: {}),
|
|
1181
1189
|
});
|
|
1182
1190
|
}
|
|
1183
1191
|
|
package/src/memory-records.ts
CHANGED
|
@@ -167,6 +167,8 @@ export interface DurableMemoryIndexBindingsV1 {
|
|
|
167
167
|
ai?: MemoryAiBinding;
|
|
168
168
|
/** What a Turn's words hold worth remembering; absent, extraction waits. */
|
|
169
169
|
extract?: MemoryProcessingAdaptersV1["extract"];
|
|
170
|
+
/** The write judgment each extracted fact goes through. */
|
|
171
|
+
judgeWrite?: MemoryProcessingAdaptersV1["judgeWrite"];
|
|
170
172
|
}
|
|
171
173
|
|
|
172
174
|
export async function drainDurableMemoryV1(
|
|
@@ -177,5 +179,6 @@ export async function drainDurableMemoryV1(
|
|
|
177
179
|
if (bindings.vectors) adapters.vectors = bindings.vectors;
|
|
178
180
|
if (bindings.ai) adapters.embed = createMemoryEmbedder(bindings.ai);
|
|
179
181
|
if (bindings.extract) adapters.extract = bindings.extract;
|
|
182
|
+
if (bindings.judgeWrite) adapters.judgeWrite = bindings.judgeWrite;
|
|
180
183
|
return drainMemoryProcessingV1(engine, adapters);
|
|
181
184
|
}
|