@elizaos/core 1.0.0-alpha.48 → 1.0.0-alpha.49
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 +2 -2
- package/dist/actions/choice.d.ts +0 -13
- package/dist/actions/followRoom.d.ts +0 -20
- package/dist/actions/ignore.d.ts +0 -13
- package/dist/actions/muteRoom.d.ts +0 -22
- package/dist/actions/none.d.ts +0 -9
- package/dist/actions/reply.d.ts +0 -15
- package/dist/actions/roles.d.ts +0 -13
- package/dist/actions/sendMessage.d.ts +0 -14
- package/dist/actions/settings.d.ts +0 -21
- package/dist/actions/unfollowRoom.d.ts +0 -12
- package/dist/actions/unmuteRoom.d.ts +0 -18
- package/dist/actions/updateEntity.d.ts +0 -42
- package/dist/actions.d.ts +0 -28
- package/dist/bootstrap.d.ts +0 -3
- package/dist/database.d.ts +0 -419
- package/dist/entities.d.ts +0 -48
- package/dist/environment.d.ts +0 -403
- package/dist/evaluators/reflection.d.ts +0 -2
- package/dist/import.d.ts +0 -9
- package/dist/index.d.ts +0 -13
- package/dist/logger.d.ts +0 -3
- package/dist/memory.d.ts +0 -114
- package/dist/prompts.d.ts +0 -200
- package/dist/providers/actions.d.ts +0 -14
- package/dist/providers/anxiety.d.ts +0 -9
- package/dist/providers/attachments.d.ts +0 -8
- package/dist/providers/capabilities.d.ts +0 -13
- package/dist/providers/character.d.ts +0 -9
- package/dist/providers/choice.d.ts +0 -10
- package/dist/providers/entities.d.ts +0 -2
- package/dist/providers/evaluators.d.ts +0 -26
- package/dist/providers/facts.d.ts +0 -10
- package/dist/providers/knowledge.d.ts +0 -13
- package/dist/providers/providers.d.ts +0 -6
- package/dist/providers/recentMessages.d.ts +0 -13
- package/dist/providers/relationships.d.ts +0 -14
- package/dist/providers/roles.d.ts +0 -14
- package/dist/providers/settings.d.ts +0 -6
- package/dist/providers/shouldRespond.d.ts +0 -6
- package/dist/providers/time.d.ts +0 -11
- package/dist/roles.d.ts +0 -25
- package/dist/runtime.d.ts +0 -290
- package/dist/services/scenario.d.ts +0 -106
- package/dist/services/task.d.ts +0 -72
- package/dist/settings.d.ts +0 -13
- package/dist/test_resources/constants.d.ts +0 -9
- package/dist/test_resources/testSetup.d.ts +0 -1
- package/dist/test_resources/types.d.ts +0 -22
- package/dist/types.d.ts +0 -1294
- package/dist/uuid.d.ts +0 -18
package/dist/environment.d.ts
DELETED
|
@@ -1,403 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
/**
|
|
3
|
-
* Interface for settings object with key-value pairs.
|
|
4
|
-
*/
|
|
5
|
-
interface Settings {
|
|
6
|
-
[key: string]: string | undefined;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Recursively searches for a .env file starting from the current directory
|
|
10
|
-
* and moving up through parent directories (Node.js only)
|
|
11
|
-
* @param {string} [startDir=process.cwd()] - Starting directory for the search
|
|
12
|
-
* @returns {string|null} Path to the nearest .env file or null if not found
|
|
13
|
-
*/
|
|
14
|
-
export declare function findNearestEnvFile(startDir?: string): string;
|
|
15
|
-
/**
|
|
16
|
-
* Configures environment settings for browser usage
|
|
17
|
-
* @param {Settings} settings - Object containing environment variables
|
|
18
|
-
*/
|
|
19
|
-
export declare function configureSettings(settings: Settings): void;
|
|
20
|
-
/**
|
|
21
|
-
* Loads environment variables from the nearest .env file in Node.js
|
|
22
|
-
* or returns configured settings in browser
|
|
23
|
-
* @returns {Settings} Environment variables object
|
|
24
|
-
* @throws {Error} If no .env file is found in Node.js environment
|
|
25
|
-
*/
|
|
26
|
-
export declare function loadEnvConfig(): Settings;
|
|
27
|
-
/**
|
|
28
|
-
* Gets a specific environment variable
|
|
29
|
-
* @param {string} key - The environment variable key
|
|
30
|
-
* @param {string} [defaultValue] - Optional default value if key doesn't exist
|
|
31
|
-
* @returns {string|undefined} The environment variable value or default value
|
|
32
|
-
*/
|
|
33
|
-
export declare function getEnvVariable(key: string, defaultValue?: string): string | undefined;
|
|
34
|
-
/**
|
|
35
|
-
* Checks if a specific environment variable exists
|
|
36
|
-
* @param {string} key - The environment variable key
|
|
37
|
-
* @returns {boolean} True if the environment variable exists
|
|
38
|
-
*/
|
|
39
|
-
export declare function hasEnvVariable(key: string): boolean;
|
|
40
|
-
export declare const settings: Settings;
|
|
41
|
-
export declare const MessageExampleSchema: z.ZodObject<{
|
|
42
|
-
name: z.ZodString;
|
|
43
|
-
content: z.ZodIntersection<z.ZodObject<{
|
|
44
|
-
text: z.ZodString;
|
|
45
|
-
action: z.ZodOptional<z.ZodString>;
|
|
46
|
-
source: z.ZodOptional<z.ZodString>;
|
|
47
|
-
url: z.ZodOptional<z.ZodString>;
|
|
48
|
-
inReplyTo: z.ZodOptional<z.ZodString>;
|
|
49
|
-
attachments: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
|
50
|
-
}, "strip", z.ZodTypeAny, {
|
|
51
|
-
text?: string;
|
|
52
|
-
source?: string;
|
|
53
|
-
url?: string;
|
|
54
|
-
inReplyTo?: string;
|
|
55
|
-
attachments?: any[];
|
|
56
|
-
action?: string;
|
|
57
|
-
}, {
|
|
58
|
-
text?: string;
|
|
59
|
-
source?: string;
|
|
60
|
-
url?: string;
|
|
61
|
-
inReplyTo?: string;
|
|
62
|
-
attachments?: any[];
|
|
63
|
-
action?: string;
|
|
64
|
-
}>, z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
65
|
-
}, "strip", z.ZodTypeAny, {
|
|
66
|
-
name?: string;
|
|
67
|
-
content?: {
|
|
68
|
-
text?: string;
|
|
69
|
-
source?: string;
|
|
70
|
-
url?: string;
|
|
71
|
-
inReplyTo?: string;
|
|
72
|
-
attachments?: any[];
|
|
73
|
-
action?: string;
|
|
74
|
-
} & Record<string, unknown>;
|
|
75
|
-
}, {
|
|
76
|
-
name?: string;
|
|
77
|
-
content?: {
|
|
78
|
-
text?: string;
|
|
79
|
-
source?: string;
|
|
80
|
-
url?: string;
|
|
81
|
-
inReplyTo?: string;
|
|
82
|
-
attachments?: any[];
|
|
83
|
-
action?: string;
|
|
84
|
-
} & Record<string, unknown>;
|
|
85
|
-
}>;
|
|
86
|
-
export declare const PluginSchema: z.ZodObject<{
|
|
87
|
-
name: z.ZodString;
|
|
88
|
-
description: z.ZodString;
|
|
89
|
-
actions: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
|
90
|
-
providers: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
|
91
|
-
evaluators: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
|
92
|
-
services: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
|
93
|
-
clients: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
|
94
|
-
}, "strip", z.ZodTypeAny, {
|
|
95
|
-
actions?: any[];
|
|
96
|
-
providers?: any[];
|
|
97
|
-
description?: string;
|
|
98
|
-
name?: string;
|
|
99
|
-
evaluators?: any[];
|
|
100
|
-
services?: any[];
|
|
101
|
-
clients?: any[];
|
|
102
|
-
}, {
|
|
103
|
-
actions?: any[];
|
|
104
|
-
providers?: any[];
|
|
105
|
-
description?: string;
|
|
106
|
-
name?: string;
|
|
107
|
-
evaluators?: any[];
|
|
108
|
-
services?: any[];
|
|
109
|
-
clients?: any[];
|
|
110
|
-
}>;
|
|
111
|
-
export declare const CharacterSchema: z.ZodObject<{
|
|
112
|
-
id: z.ZodOptional<z.ZodString>;
|
|
113
|
-
name: z.ZodString;
|
|
114
|
-
system: z.ZodOptional<z.ZodString>;
|
|
115
|
-
templates: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
116
|
-
bio: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
|
|
117
|
-
messageExamples: z.ZodArray<z.ZodArray<z.ZodObject<{
|
|
118
|
-
name: z.ZodString;
|
|
119
|
-
content: z.ZodIntersection<z.ZodObject<{
|
|
120
|
-
text: z.ZodString;
|
|
121
|
-
action: z.ZodOptional<z.ZodString>;
|
|
122
|
-
source: z.ZodOptional<z.ZodString>;
|
|
123
|
-
url: z.ZodOptional<z.ZodString>;
|
|
124
|
-
inReplyTo: z.ZodOptional<z.ZodString>;
|
|
125
|
-
attachments: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
|
126
|
-
}, "strip", z.ZodTypeAny, {
|
|
127
|
-
text?: string;
|
|
128
|
-
source?: string;
|
|
129
|
-
url?: string;
|
|
130
|
-
inReplyTo?: string;
|
|
131
|
-
attachments?: any[];
|
|
132
|
-
action?: string;
|
|
133
|
-
}, {
|
|
134
|
-
text?: string;
|
|
135
|
-
source?: string;
|
|
136
|
-
url?: string;
|
|
137
|
-
inReplyTo?: string;
|
|
138
|
-
attachments?: any[];
|
|
139
|
-
action?: string;
|
|
140
|
-
}>, z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
141
|
-
}, "strip", z.ZodTypeAny, {
|
|
142
|
-
name?: string;
|
|
143
|
-
content?: {
|
|
144
|
-
text?: string;
|
|
145
|
-
source?: string;
|
|
146
|
-
url?: string;
|
|
147
|
-
inReplyTo?: string;
|
|
148
|
-
attachments?: any[];
|
|
149
|
-
action?: string;
|
|
150
|
-
} & Record<string, unknown>;
|
|
151
|
-
}, {
|
|
152
|
-
name?: string;
|
|
153
|
-
content?: {
|
|
154
|
-
text?: string;
|
|
155
|
-
source?: string;
|
|
156
|
-
url?: string;
|
|
157
|
-
inReplyTo?: string;
|
|
158
|
-
attachments?: any[];
|
|
159
|
-
action?: string;
|
|
160
|
-
} & Record<string, unknown>;
|
|
161
|
-
}>, "many">, "many">;
|
|
162
|
-
postExamples: z.ZodArray<z.ZodString, "many">;
|
|
163
|
-
topics: z.ZodArray<z.ZodString, "many">;
|
|
164
|
-
adjectives: z.ZodArray<z.ZodString, "many">;
|
|
165
|
-
knowledge: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
166
|
-
path: z.ZodString;
|
|
167
|
-
shared: z.ZodOptional<z.ZodBoolean>;
|
|
168
|
-
}, "strip", z.ZodTypeAny, {
|
|
169
|
-
shared?: boolean;
|
|
170
|
-
path?: string;
|
|
171
|
-
}, {
|
|
172
|
-
shared?: boolean;
|
|
173
|
-
path?: string;
|
|
174
|
-
}>, z.ZodObject<{
|
|
175
|
-
directory: z.ZodString;
|
|
176
|
-
shared: z.ZodOptional<z.ZodBoolean>;
|
|
177
|
-
}, "strip", z.ZodTypeAny, {
|
|
178
|
-
shared?: boolean;
|
|
179
|
-
directory?: string;
|
|
180
|
-
}, {
|
|
181
|
-
shared?: boolean;
|
|
182
|
-
directory?: string;
|
|
183
|
-
}>]>, "many">>;
|
|
184
|
-
plugins: z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodArray<z.ZodObject<{
|
|
185
|
-
name: z.ZodString;
|
|
186
|
-
description: z.ZodString;
|
|
187
|
-
actions: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
|
188
|
-
providers: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
|
189
|
-
evaluators: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
|
190
|
-
services: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
|
191
|
-
clients: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
|
192
|
-
}, "strip", z.ZodTypeAny, {
|
|
193
|
-
actions?: any[];
|
|
194
|
-
providers?: any[];
|
|
195
|
-
description?: string;
|
|
196
|
-
name?: string;
|
|
197
|
-
evaluators?: any[];
|
|
198
|
-
services?: any[];
|
|
199
|
-
clients?: any[];
|
|
200
|
-
}, {
|
|
201
|
-
actions?: any[];
|
|
202
|
-
providers?: any[];
|
|
203
|
-
description?: string;
|
|
204
|
-
name?: string;
|
|
205
|
-
evaluators?: any[];
|
|
206
|
-
services?: any[];
|
|
207
|
-
clients?: any[];
|
|
208
|
-
}>, "many">]>;
|
|
209
|
-
settings: z.ZodOptional<z.ZodObject<{
|
|
210
|
-
secrets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
211
|
-
voice: z.ZodOptional<z.ZodObject<{
|
|
212
|
-
model: z.ZodOptional<z.ZodString>;
|
|
213
|
-
url: z.ZodOptional<z.ZodString>;
|
|
214
|
-
}, "strip", z.ZodTypeAny, {
|
|
215
|
-
url?: string;
|
|
216
|
-
model?: string;
|
|
217
|
-
}, {
|
|
218
|
-
url?: string;
|
|
219
|
-
model?: string;
|
|
220
|
-
}>>;
|
|
221
|
-
model: z.ZodOptional<z.ZodString>;
|
|
222
|
-
modelConfig: z.ZodOptional<z.ZodObject<{
|
|
223
|
-
maxInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
224
|
-
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
225
|
-
temperature: z.ZodOptional<z.ZodNumber>;
|
|
226
|
-
frequency_penalty: z.ZodOptional<z.ZodNumber>;
|
|
227
|
-
presence_penalty: z.ZodOptional<z.ZodNumber>;
|
|
228
|
-
}, "strip", z.ZodTypeAny, {
|
|
229
|
-
maxInputTokens?: number;
|
|
230
|
-
maxOutputTokens?: number;
|
|
231
|
-
temperature?: number;
|
|
232
|
-
frequency_penalty?: number;
|
|
233
|
-
presence_penalty?: number;
|
|
234
|
-
}, {
|
|
235
|
-
maxInputTokens?: number;
|
|
236
|
-
maxOutputTokens?: number;
|
|
237
|
-
temperature?: number;
|
|
238
|
-
frequency_penalty?: number;
|
|
239
|
-
presence_penalty?: number;
|
|
240
|
-
}>>;
|
|
241
|
-
embeddingModel: z.ZodOptional<z.ZodString>;
|
|
242
|
-
}, "strip", z.ZodTypeAny, {
|
|
243
|
-
secrets?: Record<string, string>;
|
|
244
|
-
model?: string;
|
|
245
|
-
voice?: {
|
|
246
|
-
url?: string;
|
|
247
|
-
model?: string;
|
|
248
|
-
};
|
|
249
|
-
modelConfig?: {
|
|
250
|
-
maxInputTokens?: number;
|
|
251
|
-
maxOutputTokens?: number;
|
|
252
|
-
temperature?: number;
|
|
253
|
-
frequency_penalty?: number;
|
|
254
|
-
presence_penalty?: number;
|
|
255
|
-
};
|
|
256
|
-
embeddingModel?: string;
|
|
257
|
-
}, {
|
|
258
|
-
secrets?: Record<string, string>;
|
|
259
|
-
model?: string;
|
|
260
|
-
voice?: {
|
|
261
|
-
url?: string;
|
|
262
|
-
model?: string;
|
|
263
|
-
};
|
|
264
|
-
modelConfig?: {
|
|
265
|
-
maxInputTokens?: number;
|
|
266
|
-
maxOutputTokens?: number;
|
|
267
|
-
temperature?: number;
|
|
268
|
-
frequency_penalty?: number;
|
|
269
|
-
presence_penalty?: number;
|
|
270
|
-
};
|
|
271
|
-
embeddingModel?: string;
|
|
272
|
-
}>>;
|
|
273
|
-
style: z.ZodObject<{
|
|
274
|
-
all: z.ZodArray<z.ZodString, "many">;
|
|
275
|
-
chat: z.ZodArray<z.ZodString, "many">;
|
|
276
|
-
post: z.ZodArray<z.ZodString, "many">;
|
|
277
|
-
}, "strip", z.ZodTypeAny, {
|
|
278
|
-
all?: string[];
|
|
279
|
-
chat?: string[];
|
|
280
|
-
post?: string[];
|
|
281
|
-
}, {
|
|
282
|
-
all?: string[];
|
|
283
|
-
chat?: string[];
|
|
284
|
-
post?: string[];
|
|
285
|
-
}>;
|
|
286
|
-
}, "strip", z.ZodTypeAny, {
|
|
287
|
-
id?: string;
|
|
288
|
-
name?: string;
|
|
289
|
-
knowledge?: (string | {
|
|
290
|
-
shared?: boolean;
|
|
291
|
-
path?: string;
|
|
292
|
-
} | {
|
|
293
|
-
shared?: boolean;
|
|
294
|
-
directory?: string;
|
|
295
|
-
})[];
|
|
296
|
-
settings?: {
|
|
297
|
-
secrets?: Record<string, string>;
|
|
298
|
-
model?: string;
|
|
299
|
-
voice?: {
|
|
300
|
-
url?: string;
|
|
301
|
-
model?: string;
|
|
302
|
-
};
|
|
303
|
-
modelConfig?: {
|
|
304
|
-
maxInputTokens?: number;
|
|
305
|
-
maxOutputTokens?: number;
|
|
306
|
-
temperature?: number;
|
|
307
|
-
frequency_penalty?: number;
|
|
308
|
-
presence_penalty?: number;
|
|
309
|
-
};
|
|
310
|
-
embeddingModel?: string;
|
|
311
|
-
};
|
|
312
|
-
system?: string;
|
|
313
|
-
templates?: Record<string, string>;
|
|
314
|
-
bio?: string | string[];
|
|
315
|
-
messageExamples?: {
|
|
316
|
-
name?: string;
|
|
317
|
-
content?: {
|
|
318
|
-
text?: string;
|
|
319
|
-
source?: string;
|
|
320
|
-
url?: string;
|
|
321
|
-
inReplyTo?: string;
|
|
322
|
-
attachments?: any[];
|
|
323
|
-
action?: string;
|
|
324
|
-
} & Record<string, unknown>;
|
|
325
|
-
}[][];
|
|
326
|
-
postExamples?: string[];
|
|
327
|
-
topics?: string[];
|
|
328
|
-
adjectives?: string[];
|
|
329
|
-
plugins?: string[] | {
|
|
330
|
-
actions?: any[];
|
|
331
|
-
providers?: any[];
|
|
332
|
-
description?: string;
|
|
333
|
-
name?: string;
|
|
334
|
-
evaluators?: any[];
|
|
335
|
-
services?: any[];
|
|
336
|
-
clients?: any[];
|
|
337
|
-
}[];
|
|
338
|
-
style?: {
|
|
339
|
-
all?: string[];
|
|
340
|
-
chat?: string[];
|
|
341
|
-
post?: string[];
|
|
342
|
-
};
|
|
343
|
-
}, {
|
|
344
|
-
id?: string;
|
|
345
|
-
name?: string;
|
|
346
|
-
knowledge?: (string | {
|
|
347
|
-
shared?: boolean;
|
|
348
|
-
path?: string;
|
|
349
|
-
} | {
|
|
350
|
-
shared?: boolean;
|
|
351
|
-
directory?: string;
|
|
352
|
-
})[];
|
|
353
|
-
settings?: {
|
|
354
|
-
secrets?: Record<string, string>;
|
|
355
|
-
model?: string;
|
|
356
|
-
voice?: {
|
|
357
|
-
url?: string;
|
|
358
|
-
model?: string;
|
|
359
|
-
};
|
|
360
|
-
modelConfig?: {
|
|
361
|
-
maxInputTokens?: number;
|
|
362
|
-
maxOutputTokens?: number;
|
|
363
|
-
temperature?: number;
|
|
364
|
-
frequency_penalty?: number;
|
|
365
|
-
presence_penalty?: number;
|
|
366
|
-
};
|
|
367
|
-
embeddingModel?: string;
|
|
368
|
-
};
|
|
369
|
-
system?: string;
|
|
370
|
-
templates?: Record<string, string>;
|
|
371
|
-
bio?: string | string[];
|
|
372
|
-
messageExamples?: {
|
|
373
|
-
name?: string;
|
|
374
|
-
content?: {
|
|
375
|
-
text?: string;
|
|
376
|
-
source?: string;
|
|
377
|
-
url?: string;
|
|
378
|
-
inReplyTo?: string;
|
|
379
|
-
attachments?: any[];
|
|
380
|
-
action?: string;
|
|
381
|
-
} & Record<string, unknown>;
|
|
382
|
-
}[][];
|
|
383
|
-
postExamples?: string[];
|
|
384
|
-
topics?: string[];
|
|
385
|
-
adjectives?: string[];
|
|
386
|
-
plugins?: string[] | {
|
|
387
|
-
actions?: any[];
|
|
388
|
-
providers?: any[];
|
|
389
|
-
description?: string;
|
|
390
|
-
name?: string;
|
|
391
|
-
evaluators?: any[];
|
|
392
|
-
services?: any[];
|
|
393
|
-
clients?: any[];
|
|
394
|
-
}[];
|
|
395
|
-
style?: {
|
|
396
|
-
all?: string[];
|
|
397
|
-
chat?: string[];
|
|
398
|
-
post?: string[];
|
|
399
|
-
};
|
|
400
|
-
}>;
|
|
401
|
-
export type CharacterConfig = z.infer<typeof CharacterSchema>;
|
|
402
|
-
export declare function validateCharacterConfig(json: unknown): CharacterConfig;
|
|
403
|
-
export {};
|
package/dist/import.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const dynamicImport: (specifier: string) => Promise<any>;
|
|
2
|
-
export declare const registerDynamicImport: (specifier: string, module: any) => void;
|
|
3
|
-
/**
|
|
4
|
-
* Handles importing of plugins asynchronously.
|
|
5
|
-
*
|
|
6
|
-
* @param {string[]} plugins - An array of strings representing the plugins to import.
|
|
7
|
-
* @returns {Promise<Function[]>} - A Promise that resolves to an array of imported plugins functions.
|
|
8
|
-
*/
|
|
9
|
-
export declare function handlePluginImporting(plugins: string[]): Promise<any[]>;
|
package/dist/index.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export * from "./types";
|
|
2
|
-
export * from "./actions";
|
|
3
|
-
export * from "./database";
|
|
4
|
-
export * from "./entities";
|
|
5
|
-
export * from "./environment";
|
|
6
|
-
export * from "./import";
|
|
7
|
-
export * from "./logger";
|
|
8
|
-
export * from "./memory";
|
|
9
|
-
export * from "./prompts";
|
|
10
|
-
export * from "./roles";
|
|
11
|
-
export * from "./runtime";
|
|
12
|
-
export * from "./settings";
|
|
13
|
-
export * from "./uuid";
|
package/dist/logger.d.ts
DELETED
package/dist/memory.d.ts
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { type IAgentRuntime, type IMemoryManager, type Memory, type UUID } from "./types";
|
|
2
|
-
/**
|
|
3
|
-
* Manage memories in the database.
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* The AgentRuntime instance associated with this manager.
|
|
7
|
-
*/
|
|
8
|
-
export declare class MemoryManager implements IMemoryManager {
|
|
9
|
-
/**
|
|
10
|
-
* The AgentRuntime instance associated with this manager.
|
|
11
|
-
*/
|
|
12
|
-
runtime: IAgentRuntime;
|
|
13
|
-
/**
|
|
14
|
-
* The name of the database table this manager operates on.
|
|
15
|
-
*/
|
|
16
|
-
tableName: string;
|
|
17
|
-
/**
|
|
18
|
-
* Constructs a new MemoryManager instance.
|
|
19
|
-
* @param opts Options for the manager.
|
|
20
|
-
* @param opts.tableName The name of the table this manager will operate on.
|
|
21
|
-
* @param opts.runtime The AgentRuntime instance associated with this manager.
|
|
22
|
-
*/
|
|
23
|
-
constructor(opts: {
|
|
24
|
-
tableName: string;
|
|
25
|
-
runtime: IAgentRuntime;
|
|
26
|
-
});
|
|
27
|
-
private validateMetadata;
|
|
28
|
-
/**
|
|
29
|
-
* Adds an embedding vector to a memory object. If the memory already has an embedding, it is returned as is.
|
|
30
|
-
* @param memory The memory object to add an embedding to.
|
|
31
|
-
* @returns A Promise resolving to the memory object, potentially updated with an embedding vector.
|
|
32
|
-
*/
|
|
33
|
-
/**
|
|
34
|
-
* Adds an embedding vector to a memory object if one doesn't already exist.
|
|
35
|
-
* The embedding is generated from the memory's text content using the runtime's
|
|
36
|
-
* embedding model. If the memory has no text content, an error is thrown.
|
|
37
|
-
*
|
|
38
|
-
* @param memory The memory object to add an embedding to
|
|
39
|
-
* @returns The memory object with an embedding vector added
|
|
40
|
-
* @throws Error if the memory content is empty
|
|
41
|
-
*/
|
|
42
|
-
addEmbeddingToMemory(memory: Memory): Promise<Memory>;
|
|
43
|
-
/**
|
|
44
|
-
* Retrieves a list of memories by user IDs, with optional deduplication.
|
|
45
|
-
* @param opts Options including user IDs, count, and uniqueness.
|
|
46
|
-
* @param opts.roomId The room ID to retrieve memories for.
|
|
47
|
-
* @param opts.count The number of memories to retrieve.
|
|
48
|
-
* @param opts.unique Whether to retrieve unique memories only.
|
|
49
|
-
* @returns A Promise resolving to an array of Memory objects.
|
|
50
|
-
*/
|
|
51
|
-
getMemories(opts: {
|
|
52
|
-
roomId: UUID;
|
|
53
|
-
count?: number;
|
|
54
|
-
unique?: boolean;
|
|
55
|
-
start?: number;
|
|
56
|
-
end?: number;
|
|
57
|
-
agentId?: UUID;
|
|
58
|
-
}): Promise<Memory[]>;
|
|
59
|
-
getCachedEmbeddings(content: string): Promise<{
|
|
60
|
-
embedding: number[];
|
|
61
|
-
levenshtein_score: number;
|
|
62
|
-
}[]>;
|
|
63
|
-
/**
|
|
64
|
-
* Searches for memories similar to a given embedding vector.
|
|
65
|
-
* @param opts Options for the memory search
|
|
66
|
-
* @param opts.match_threshold The similarity threshold for matching memories.
|
|
67
|
-
* @param opts.count The maximum number of memories to retrieve.
|
|
68
|
-
* @param opts.roomId The room ID to retrieve memories for.
|
|
69
|
-
* @param opts.agentId The agent ID to retrieve memories for.
|
|
70
|
-
* @param opts.unique Whether to retrieve unique memories only.
|
|
71
|
-
* @returns A Promise resolving to an array of Memory objects that match the embedding.
|
|
72
|
-
*/
|
|
73
|
-
searchMemories(opts: {
|
|
74
|
-
embedding: number[];
|
|
75
|
-
match_threshold?: number;
|
|
76
|
-
count?: number;
|
|
77
|
-
roomId: UUID;
|
|
78
|
-
agentId?: UUID;
|
|
79
|
-
unique?: boolean;
|
|
80
|
-
}): Promise<Memory[]>;
|
|
81
|
-
/**
|
|
82
|
-
* Creates a new memory in the database, with an option to check for similarity before insertion.
|
|
83
|
-
* @param memory The memory object to create.
|
|
84
|
-
* @param unique Whether to check for similarity before insertion.
|
|
85
|
-
* @returns A Promise that resolves when the operation completes.
|
|
86
|
-
*/
|
|
87
|
-
createMemory(memory: Memory, unique?: boolean): Promise<UUID>;
|
|
88
|
-
getMemoriesByRoomIds(params: {
|
|
89
|
-
roomIds: UUID[];
|
|
90
|
-
limit?: number;
|
|
91
|
-
agentId?: UUID;
|
|
92
|
-
}): Promise<Memory[]>;
|
|
93
|
-
getMemoryById(id: UUID): Promise<Memory | null>;
|
|
94
|
-
/**
|
|
95
|
-
* Removes a memory from the database by its ID.
|
|
96
|
-
* @param memoryId The ID of the memory to remove.
|
|
97
|
-
* @returns A Promise that resolves when the operation completes.
|
|
98
|
-
*/
|
|
99
|
-
removeMemory(memoryId: UUID): Promise<void>;
|
|
100
|
-
/**
|
|
101
|
-
* Removes all memories associated with a set of user IDs.
|
|
102
|
-
* @param roomId The room ID to remove memories for.
|
|
103
|
-
* @returns A Promise that resolves when the operation completes.
|
|
104
|
-
*/
|
|
105
|
-
removeAllMemories(roomId: UUID): Promise<void>;
|
|
106
|
-
/**
|
|
107
|
-
* Counts the number of memories associated with a set of user IDs, with an option for uniqueness.
|
|
108
|
-
* @param roomId The room ID to count memories for.
|
|
109
|
-
* @param unique Whether to count unique memories only.
|
|
110
|
-
* @returns A Promise resolving to the count of memories.
|
|
111
|
-
*/
|
|
112
|
-
countMemories(roomId: UUID, unique?: boolean): Promise<number>;
|
|
113
|
-
private validateMetadataRequirements;
|
|
114
|
-
}
|