@@ -27,10 +27,6 @@ import {
27
27
EMBEDDINGS_BY_MODEL
28
28
} from '../src/llm.js' ;
29
29
30
- import {
31
- Packets
32
- } from './types.js' ;
33
-
34
30
const STORE_KEY_PREFIX = 'store_' ;
35
31
const MEMORY_KEY_PREFIX = 'memory_' ;
36
32
@@ -76,15 +72,15 @@ type AssociativeMemory = z.infer<typeof associativeMemory>;
76
72
//This profile knows how to load local packets from state.
77
73
export class ProfileBrowser extends Profile {
78
74
79
- _packets : Packets ;
75
+ _packets : Record < string , string > ;
80
76
81
77
//Profile has base _stores and _memories of different types
82
78
_associativeMemories : { [ name : MemoryID ] : AssociativeMemory } ;
83
79
_storeApps : { [ name : StoreID ] : StoreBrowser } ;
84
80
85
- constructor ( packets : Packets ) {
81
+ constructor ( stringifiedPackets : Record < string , string > ) {
86
82
super ( ) ;
87
- this . _packets = packets ;
83
+ this . _packets = stringifiedPackets ;
88
84
//We lazy load this since the garden might be loaded and torn down
89
85
//multiple times in quick succession, so loading and parsing each store
90
86
//at boot would be prohibitively expensive for large profiles.
@@ -221,8 +217,6 @@ export class ProfileBrowser extends Profile {
221
217
override async localFetch ( location : SeedPacketAbsoluteLocalLocation ) : Promise < string > {
222
218
//TODO: also stash local-but-actually-remotes here so they don't have to
223
219
//be refetched if we already have them.
224
- const packet = this . _packets [ location ] ;
225
- if ( ! packet ) return '' ;
226
- return JSON . stringify ( packet , null , '\t' ) ;
220
+ return this . _packets [ location ] || '' ;
227
221
}
228
222
}
0 commit comments