@elizaos/core 1.0.1 → 1.0.3
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/chunk-HRFT5KDK.js +11757 -0
- package/dist/index-Cy9ZgQIe.d.ts +1678 -0
- package/dist/index-DVKkCFlY.d.ts +3118 -0
- package/dist/index.d.ts +1161 -14
- package/dist/index.js +91 -9918
- package/dist/specs/v1/index.d.ts +5 -0
- package/dist/specs/v1/index.js +70 -0
- package/dist/specs/v2/index.d.ts +4 -0
- package/dist/specs/v2/index.js +163 -0
- package/dist/{types.d.ts → types-DzoA9aTJ.d.ts} +177 -195
- package/package.json +15 -3
- package/dist/actions.d.ts +0 -22
- package/dist/database.d.ts +0 -461
- package/dist/entities.d.ts +0 -48
- package/dist/instrumentation/index.d.ts +0 -2
- package/dist/instrumentation/service.d.ts +0 -21
- package/dist/instrumentation/types.d.ts +0 -16
- package/dist/logger.d.ts +0 -5
- package/dist/prompts.d.ts +0 -5
- package/dist/roles.d.ts +0 -29
- package/dist/runtime.d.ts +0 -283
- package/dist/search.d.ts +0 -316
- package/dist/sentry/instrument.d.ts +0 -2
- package/dist/services.d.ts +0 -48
- package/dist/settings.d.ts +0 -91
- 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/utils.d.ts +0 -192
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Pool } from 'pg';
|
|
2
2
|
import { PGlite } from '@electric-sql/pglite';
|
|
3
|
-
|
|
4
|
-
* Type definition for a Universally Unique Identifier (UUID) using a specific format.
|
|
5
|
-
* @typedef {`${string}-${string}-${string}-${string}-${string}`} UUID
|
|
6
|
-
*/
|
|
3
|
+
|
|
7
4
|
/**
|
|
8
5
|
* Defines a custom type UUID representing a universally unique identifier
|
|
9
6
|
*/
|
|
10
|
-
|
|
7
|
+
type UUID = `${string}-${string}-${string}-${string}-${string}`;
|
|
11
8
|
/**
|
|
12
9
|
* Helper function to safely cast a string to strongly typed UUID
|
|
13
10
|
* @param id The string UUID to validate and cast
|
|
14
11
|
* @returns The same UUID with branded type information
|
|
15
12
|
*/
|
|
16
|
-
|
|
13
|
+
declare function asUUID(id: string): UUID;
|
|
17
14
|
/**
|
|
18
15
|
* Represents the content of a memory, message, or other information
|
|
19
16
|
*/
|
|
20
|
-
|
|
17
|
+
interface Content {
|
|
21
18
|
/** The agent's internal thought process */
|
|
22
19
|
thought?: string;
|
|
23
20
|
/** The main text content visible to users */
|
|
@@ -34,8 +31,6 @@ export interface Content {
|
|
|
34
31
|
inReplyTo?: UUID;
|
|
35
32
|
/** Array of media attachments */
|
|
36
33
|
attachments?: Media[];
|
|
37
|
-
/** room type */
|
|
38
|
-
channelType?: string;
|
|
39
34
|
/**
|
|
40
35
|
* Additional dynamic properties
|
|
41
36
|
* Use specific properties above instead of this when possible
|
|
@@ -45,13 +40,13 @@ export interface Content {
|
|
|
45
40
|
/**
|
|
46
41
|
* Example content with associated user for demonstration purposes
|
|
47
42
|
*/
|
|
48
|
-
|
|
43
|
+
interface ActionExample {
|
|
49
44
|
/** User associated with the example */
|
|
50
45
|
name: string;
|
|
51
46
|
/** Content of the example */
|
|
52
47
|
content: Content;
|
|
53
48
|
}
|
|
54
|
-
|
|
49
|
+
type ModelTypeName = (typeof ModelType)[keyof typeof ModelType] | string;
|
|
55
50
|
/**
|
|
56
51
|
* Defines the recognized types of models that the agent runtime can use.
|
|
57
52
|
* These include models for text generation (small, large, reasoning, completion),
|
|
@@ -62,7 +57,7 @@ export type ModelTypeName = (typeof ModelType)[keyof typeof ModelType] | string;
|
|
|
62
57
|
* type safety and clarity when working with different AI models.
|
|
63
58
|
* String values are used for extensibility with custom model types.
|
|
64
59
|
*/
|
|
65
|
-
|
|
60
|
+
declare const ModelType: {
|
|
66
61
|
readonly SMALL: "TEXT_SMALL";
|
|
67
62
|
readonly MEDIUM: "TEXT_LARGE";
|
|
68
63
|
readonly LARGE: "TEXT_LARGE";
|
|
@@ -96,7 +91,7 @@ export declare const ModelType: {
|
|
|
96
91
|
* }
|
|
97
92
|
* ```
|
|
98
93
|
*/
|
|
99
|
-
|
|
94
|
+
interface ServiceTypeRegistry {
|
|
100
95
|
TRANSCRIPTION: 'transcription';
|
|
101
96
|
VIDEO: 'video';
|
|
102
97
|
BROWSER: 'browser';
|
|
@@ -111,19 +106,19 @@ export interface ServiceTypeRegistry {
|
|
|
111
106
|
/**
|
|
112
107
|
* Type for service names that includes both core services and any plugin-registered services
|
|
113
108
|
*/
|
|
114
|
-
|
|
109
|
+
type ServiceTypeName = ServiceTypeRegistry[keyof ServiceTypeRegistry];
|
|
115
110
|
/**
|
|
116
111
|
* Helper type to extract service type values from the registry
|
|
117
112
|
*/
|
|
118
|
-
|
|
113
|
+
type ServiceTypeValue<K extends keyof ServiceTypeRegistry> = ServiceTypeRegistry[K];
|
|
119
114
|
/**
|
|
120
115
|
* Helper type to check if a service type exists in the registry
|
|
121
116
|
*/
|
|
122
|
-
|
|
117
|
+
type IsValidServiceType<T extends string> = T extends ServiceTypeName ? true : false;
|
|
123
118
|
/**
|
|
124
119
|
* Type-safe service class definition
|
|
125
120
|
*/
|
|
126
|
-
|
|
121
|
+
type TypedServiceClass<T extends ServiceTypeName> = {
|
|
127
122
|
new (runtime?: IAgentRuntime): Service;
|
|
128
123
|
serviceType: T;
|
|
129
124
|
start(runtime: IAgentRuntime): Promise<Service>;
|
|
@@ -131,16 +126,16 @@ export type TypedServiceClass<T extends ServiceTypeName> = {
|
|
|
131
126
|
/**
|
|
132
127
|
* Map of service type names to their implementation classes
|
|
133
128
|
*/
|
|
134
|
-
|
|
129
|
+
interface ServiceClassMap {
|
|
135
130
|
}
|
|
136
131
|
/**
|
|
137
132
|
* Helper to infer service instance type from service type name
|
|
138
133
|
*/
|
|
139
|
-
|
|
134
|
+
type ServiceInstance<T extends ServiceTypeName> = T extends keyof ServiceClassMap ? InstanceType<ServiceClassMap[T]> : Service;
|
|
140
135
|
/**
|
|
141
136
|
* Runtime service registry type
|
|
142
137
|
*/
|
|
143
|
-
|
|
138
|
+
type ServiceRegistry<T extends ServiceTypeName = ServiceTypeName> = Map<T, Service>;
|
|
144
139
|
/**
|
|
145
140
|
* Enumerates the recognized types of services that can be registered and used by the agent runtime.
|
|
146
141
|
* Services provide specialized functionalities like audio transcription, video processing,
|
|
@@ -149,7 +144,7 @@ export type ServiceRegistry<T extends ServiceTypeName = ServiceTypeName> = Map<T
|
|
|
149
144
|
* This constant is used in `AgentRuntime` for service registration and retrieval (e.g., `getService`).
|
|
150
145
|
* Each service typically implements the `Service` abstract class or a more specific interface like `IVideoService`.
|
|
151
146
|
*/
|
|
152
|
-
|
|
147
|
+
declare const ServiceType: {
|
|
153
148
|
readonly TRANSCRIPTION: "transcription";
|
|
154
149
|
readonly VIDEO: "video";
|
|
155
150
|
readonly BROWSER: "browser";
|
|
@@ -171,7 +166,7 @@ export declare const ServiceType: {
|
|
|
171
166
|
* The `[key: string]: any;` allows for dynamic properties, though `EnhancedState` offers better typing.
|
|
172
167
|
* This state object is passed to handlers for actions, evaluators, and providers.
|
|
173
168
|
*/
|
|
174
|
-
|
|
169
|
+
interface State {
|
|
175
170
|
/** Additional dynamic properties */
|
|
176
171
|
[key: string]: any;
|
|
177
172
|
values: {
|
|
@@ -185,7 +180,7 @@ export interface State {
|
|
|
185
180
|
/**
|
|
186
181
|
* Memory type enumeration for built-in memory types
|
|
187
182
|
*/
|
|
188
|
-
|
|
183
|
+
type MemoryTypeAlias = string;
|
|
189
184
|
/**
|
|
190
185
|
* Enumerates the built-in types of memories that can be stored and retrieved.
|
|
191
186
|
* - `DOCUMENT`: Represents a whole document or a large piece of text.
|
|
@@ -195,7 +190,7 @@ export type MemoryTypeAlias = string;
|
|
|
195
190
|
* - `CUSTOM`: For any other type of memory not covered by the built-in types.
|
|
196
191
|
* This enum is used in `MemoryMetadata` to categorize memories and influences how they are processed or queried.
|
|
197
192
|
*/
|
|
198
|
-
|
|
193
|
+
declare enum MemoryType {
|
|
199
194
|
DOCUMENT = "document",
|
|
200
195
|
FRAGMENT = "fragment",
|
|
201
196
|
MESSAGE = "message",
|
|
@@ -209,7 +204,7 @@ export declare enum MemoryType {
|
|
|
209
204
|
* - `room`: The memory is scoped to a specific room or channel.
|
|
210
205
|
* This is used in `MemoryMetadata` to control how memories are stored and retrieved based on context.
|
|
211
206
|
*/
|
|
212
|
-
|
|
207
|
+
type MemoryScope = 'shared' | 'private' | 'room';
|
|
213
208
|
/**
|
|
214
209
|
* Base interface for all memory metadata types.
|
|
215
210
|
* It includes common properties for all memories, such as:
|
|
@@ -221,7 +216,7 @@ export type MemoryScope = 'shared' | 'private' | 'room';
|
|
|
221
216
|
* - `tags`: Optional array of strings for categorizing or filtering memories.
|
|
222
217
|
* Specific metadata types like `DocumentMetadata` or `MessageMetadata` extend this base.
|
|
223
218
|
*/
|
|
224
|
-
|
|
219
|
+
interface BaseMetadata {
|
|
225
220
|
type: MemoryTypeAlias;
|
|
226
221
|
source?: string;
|
|
227
222
|
sourceId?: UUID;
|
|
@@ -229,28 +224,28 @@ export interface BaseMetadata {
|
|
|
229
224
|
timestamp?: number;
|
|
230
225
|
tags?: string[];
|
|
231
226
|
}
|
|
232
|
-
|
|
227
|
+
interface DocumentMetadata extends BaseMetadata {
|
|
233
228
|
type: MemoryType.DOCUMENT;
|
|
234
229
|
}
|
|
235
|
-
|
|
230
|
+
interface FragmentMetadata extends BaseMetadata {
|
|
236
231
|
type: MemoryType.FRAGMENT;
|
|
237
232
|
documentId: UUID;
|
|
238
233
|
position: number;
|
|
239
234
|
}
|
|
240
|
-
|
|
235
|
+
interface MessageMetadata extends BaseMetadata {
|
|
241
236
|
type: MemoryType.MESSAGE;
|
|
242
237
|
}
|
|
243
|
-
|
|
238
|
+
interface DescriptionMetadata extends BaseMetadata {
|
|
244
239
|
type: MemoryType.DESCRIPTION;
|
|
245
240
|
}
|
|
246
|
-
|
|
241
|
+
interface CustomMetadata extends BaseMetadata {
|
|
247
242
|
[key: string]: unknown;
|
|
248
243
|
}
|
|
249
|
-
|
|
244
|
+
type MemoryMetadata = DocumentMetadata | FragmentMetadata | MessageMetadata | DescriptionMetadata | CustomMetadata;
|
|
250
245
|
/**
|
|
251
246
|
* Represents a stored memory/message
|
|
252
247
|
*/
|
|
253
|
-
|
|
248
|
+
interface Memory {
|
|
254
249
|
/** Optional unique identifier */
|
|
255
250
|
id?: UUID;
|
|
256
251
|
/** Associated user ID */
|
|
@@ -277,7 +272,7 @@ export interface Memory {
|
|
|
277
272
|
/**
|
|
278
273
|
* Represents a log entry
|
|
279
274
|
*/
|
|
280
|
-
|
|
275
|
+
interface Log {
|
|
281
276
|
/** Optional unique identifier */
|
|
282
277
|
id?: UUID;
|
|
283
278
|
/** Associated entity ID */
|
|
@@ -296,7 +291,7 @@ export interface Log {
|
|
|
296
291
|
/**
|
|
297
292
|
* Example message for demonstration
|
|
298
293
|
*/
|
|
299
|
-
|
|
294
|
+
interface MessageExample {
|
|
300
295
|
/** Associated user */
|
|
301
296
|
name: string;
|
|
302
297
|
/** Message content */
|
|
@@ -305,21 +300,21 @@ export interface MessageExample {
|
|
|
305
300
|
/**
|
|
306
301
|
* Handler function type for processing messages
|
|
307
302
|
*/
|
|
308
|
-
|
|
303
|
+
type Handler = (runtime: IAgentRuntime, message: Memory, state?: State, options?: {
|
|
309
304
|
[key: string]: unknown;
|
|
310
305
|
}, callback?: HandlerCallback, responses?: Memory[]) => Promise<unknown>;
|
|
311
306
|
/**
|
|
312
307
|
* Callback function type for handlers
|
|
313
308
|
*/
|
|
314
|
-
|
|
309
|
+
type HandlerCallback = (response: Content, files?: any) => Promise<Memory[]>;
|
|
315
310
|
/**
|
|
316
311
|
* Validator function type for actions/evaluators
|
|
317
312
|
*/
|
|
318
|
-
|
|
313
|
+
type Validator = (runtime: IAgentRuntime, message: Memory, state?: State) => Promise<boolean>;
|
|
319
314
|
/**
|
|
320
315
|
* Represents an action the agent can perform
|
|
321
316
|
*/
|
|
322
|
-
|
|
317
|
+
interface Action {
|
|
323
318
|
/** Similar action descriptions */
|
|
324
319
|
similes?: string[];
|
|
325
320
|
/** Detailed description */
|
|
@@ -336,7 +331,7 @@ export interface Action {
|
|
|
336
331
|
/**
|
|
337
332
|
* Example for evaluating agent behavior
|
|
338
333
|
*/
|
|
339
|
-
|
|
334
|
+
interface EvaluationExample {
|
|
340
335
|
/** Evaluation context */
|
|
341
336
|
prompt: string;
|
|
342
337
|
/** Example messages */
|
|
@@ -347,7 +342,7 @@ export interface EvaluationExample {
|
|
|
347
342
|
/**
|
|
348
343
|
* Evaluator for assessing agent responses
|
|
349
344
|
*/
|
|
350
|
-
|
|
345
|
+
interface Evaluator {
|
|
351
346
|
/** Whether to always run */
|
|
352
347
|
alwaysRun?: boolean;
|
|
353
348
|
/** Detailed description */
|
|
@@ -363,7 +358,7 @@ export interface Evaluator {
|
|
|
363
358
|
/** Validation function */
|
|
364
359
|
validate: Validator;
|
|
365
360
|
}
|
|
366
|
-
|
|
361
|
+
interface ProviderResult {
|
|
367
362
|
values?: {
|
|
368
363
|
[key: string]: any;
|
|
369
364
|
};
|
|
@@ -375,7 +370,7 @@ export interface ProviderResult {
|
|
|
375
370
|
/**
|
|
376
371
|
* Provider for external data/services
|
|
377
372
|
*/
|
|
378
|
-
|
|
373
|
+
interface Provider {
|
|
379
374
|
/** Provider name */
|
|
380
375
|
name: string;
|
|
381
376
|
/** Description of the provider */
|
|
@@ -396,7 +391,7 @@ export interface Provider {
|
|
|
396
391
|
/**
|
|
397
392
|
* Represents a relationship between users
|
|
398
393
|
*/
|
|
399
|
-
|
|
394
|
+
interface Relationship {
|
|
400
395
|
/** Unique identifier */
|
|
401
396
|
id: UUID;
|
|
402
397
|
/** First user ID */
|
|
@@ -414,7 +409,7 @@ export interface Relationship {
|
|
|
414
409
|
/** Optional creation timestamp */
|
|
415
410
|
createdAt?: string;
|
|
416
411
|
}
|
|
417
|
-
|
|
412
|
+
interface Component {
|
|
418
413
|
id: UUID;
|
|
419
414
|
entityId: UUID;
|
|
420
415
|
agentId: UUID;
|
|
@@ -430,7 +425,7 @@ export interface Component {
|
|
|
430
425
|
/**
|
|
431
426
|
* Represents a user account
|
|
432
427
|
*/
|
|
433
|
-
|
|
428
|
+
interface Entity {
|
|
434
429
|
/** Unique identifier, optional on creation */
|
|
435
430
|
id?: UUID;
|
|
436
431
|
/** Names of the entity */
|
|
@@ -444,7 +439,7 @@ export interface Entity {
|
|
|
444
439
|
/** Optional array of components */
|
|
445
440
|
components?: Component[];
|
|
446
441
|
}
|
|
447
|
-
|
|
442
|
+
type World = {
|
|
448
443
|
id: UUID;
|
|
449
444
|
name?: string;
|
|
450
445
|
agentId: UUID;
|
|
@@ -459,8 +454,10 @@ export type World = {
|
|
|
459
454
|
[key: string]: unknown;
|
|
460
455
|
};
|
|
461
456
|
};
|
|
462
|
-
|
|
463
|
-
|
|
457
|
+
type RoomMetadata = {
|
|
458
|
+
[key: string]: unknown;
|
|
459
|
+
};
|
|
460
|
+
type Room = {
|
|
464
461
|
id: UUID;
|
|
465
462
|
name?: string;
|
|
466
463
|
agentId?: UUID;
|
|
@@ -474,7 +471,7 @@ export type Room = {
|
|
|
474
471
|
/**
|
|
475
472
|
* Room participant with account details
|
|
476
473
|
*/
|
|
477
|
-
|
|
474
|
+
interface Participant {
|
|
478
475
|
/** Unique identifier */
|
|
479
476
|
id: UUID;
|
|
480
477
|
/** Associated account */
|
|
@@ -483,7 +480,7 @@ export interface Participant {
|
|
|
483
480
|
/**
|
|
484
481
|
* Represents a media attachment
|
|
485
482
|
*/
|
|
486
|
-
|
|
483
|
+
type Media = {
|
|
487
484
|
/** Unique identifier */
|
|
488
485
|
id: string;
|
|
489
486
|
/** Media URL */
|
|
@@ -499,14 +496,14 @@ export type Media = {
|
|
|
499
496
|
/** Content type */
|
|
500
497
|
contentType?: ContentType;
|
|
501
498
|
};
|
|
502
|
-
|
|
499
|
+
declare enum ContentType {
|
|
503
500
|
IMAGE = "image",
|
|
504
501
|
VIDEO = "video",
|
|
505
502
|
AUDIO = "audio",
|
|
506
503
|
DOCUMENT = "document",
|
|
507
504
|
LINK = "link"
|
|
508
505
|
}
|
|
509
|
-
|
|
506
|
+
declare enum ChannelType {
|
|
510
507
|
SELF = "SELF",// Messages to self
|
|
511
508
|
DM = "dm",// Direct messages between two participants
|
|
512
509
|
GROUP = "group",// Group messages with multiple participants
|
|
@@ -518,28 +515,7 @@ export declare enum ChannelType {
|
|
|
518
515
|
FORUM = "FORUM",// Forum discussion
|
|
519
516
|
API = "API"
|
|
520
517
|
}
|
|
521
|
-
|
|
522
|
-
* Client instance
|
|
523
|
-
*/
|
|
524
|
-
export declare abstract class Service {
|
|
525
|
-
/** Runtime instance */
|
|
526
|
-
protected runtime: IAgentRuntime;
|
|
527
|
-
constructor(runtime?: IAgentRuntime);
|
|
528
|
-
abstract stop(): Promise<void>;
|
|
529
|
-
/** Service type */
|
|
530
|
-
static serviceType: string;
|
|
531
|
-
/** Service name */
|
|
532
|
-
abstract capabilityDescription: string;
|
|
533
|
-
/** Service configuration */
|
|
534
|
-
config?: {
|
|
535
|
-
[key: string]: any;
|
|
536
|
-
};
|
|
537
|
-
/** Start service connection */
|
|
538
|
-
static start(_runtime: IAgentRuntime): Promise<Service>;
|
|
539
|
-
/** Stop service connection */
|
|
540
|
-
static stop(_runtime: IAgentRuntime): Promise<unknown>;
|
|
541
|
-
}
|
|
542
|
-
export type Route = {
|
|
518
|
+
type Route = {
|
|
543
519
|
type: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'STATIC';
|
|
544
520
|
path: string;
|
|
545
521
|
filePath?: string;
|
|
@@ -553,12 +529,12 @@ export type Route = {
|
|
|
553
529
|
/**
|
|
554
530
|
* Plugin for extending agent functionality
|
|
555
531
|
*/
|
|
556
|
-
|
|
532
|
+
type PluginEvents = {
|
|
557
533
|
[K in keyof EventPayloadMap]?: EventHandler<K>[];
|
|
558
534
|
} & {
|
|
559
535
|
[key: string]: ((params: EventPayload) => Promise<any>)[];
|
|
560
536
|
};
|
|
561
|
-
|
|
537
|
+
interface Plugin {
|
|
562
538
|
name: string;
|
|
563
539
|
description: string;
|
|
564
540
|
init?: (config: Record<string, string>, runtime: IAgentRuntime) => Promise<void>;
|
|
@@ -584,16 +560,16 @@ export interface Plugin {
|
|
|
584
560
|
dependencies?: string[];
|
|
585
561
|
priority?: number;
|
|
586
562
|
}
|
|
587
|
-
|
|
563
|
+
interface ProjectAgent {
|
|
588
564
|
character: Character;
|
|
589
565
|
init?: (runtime: IAgentRuntime) => Promise<void>;
|
|
590
566
|
plugins?: Plugin[];
|
|
591
567
|
tests?: TestSuite | TestSuite[];
|
|
592
568
|
}
|
|
593
|
-
|
|
569
|
+
interface Project {
|
|
594
570
|
agents: ProjectAgent[];
|
|
595
571
|
}
|
|
596
|
-
|
|
572
|
+
type TemplateType = string | ((options: {
|
|
597
573
|
state: State | {
|
|
598
574
|
[key: string]: string;
|
|
599
575
|
};
|
|
@@ -614,7 +590,7 @@ export type TemplateType = string | ((options: {
|
|
|
614
590
|
* - `settings`, `secrets`: Configuration key-value pairs, with secrets being handled more securely.
|
|
615
591
|
* - `style`: Guidelines for the character's writing style in different contexts (chat, post).
|
|
616
592
|
*/
|
|
617
|
-
|
|
593
|
+
interface Character {
|
|
618
594
|
/** Optional unique identifier */
|
|
619
595
|
id?: UUID;
|
|
620
596
|
/** Character name */
|
|
@@ -662,7 +638,7 @@ export interface Character {
|
|
|
662
638
|
post?: string[];
|
|
663
639
|
};
|
|
664
640
|
}
|
|
665
|
-
|
|
641
|
+
declare enum AgentStatus {
|
|
666
642
|
ACTIVE = "active",
|
|
667
643
|
INACTIVE = "inactive"
|
|
668
644
|
}
|
|
@@ -675,7 +651,7 @@ export declare enum AgentStatus {
|
|
|
675
651
|
* - `createdAt`, `updatedAt`: Timestamps for when the agent record was created and last updated in the database.
|
|
676
652
|
* This interface is primarily used by the `IDatabaseAdapter` for agent management.
|
|
677
653
|
*/
|
|
678
|
-
|
|
654
|
+
interface Agent extends Character {
|
|
679
655
|
enabled?: boolean;
|
|
680
656
|
status?: AgentStatus;
|
|
681
657
|
createdAt: number;
|
|
@@ -684,20 +660,21 @@ export interface Agent extends Character {
|
|
|
684
660
|
/**
|
|
685
661
|
* Interface for database operations
|
|
686
662
|
*/
|
|
687
|
-
|
|
663
|
+
interface IDatabaseAdapter {
|
|
688
664
|
/** Database instance */
|
|
689
665
|
db: any;
|
|
690
666
|
/** Initialize database connection */
|
|
691
667
|
init(): Promise<void>;
|
|
692
668
|
/** Close database connection */
|
|
693
669
|
close(): Promise<void>;
|
|
694
|
-
getConnection(): Promise<PGlite |
|
|
670
|
+
getConnection(): Promise<PGlite | Pool>;
|
|
695
671
|
getAgent(agentId: UUID): Promise<Agent | null>;
|
|
696
672
|
/** Get all agents */
|
|
697
673
|
getAgents(): Promise<Partial<Agent>[]>;
|
|
698
674
|
createAgent(agent: Partial<Agent>): Promise<boolean>;
|
|
699
675
|
updateAgent(agentId: UUID, agent: Partial<Agent>): Promise<boolean>;
|
|
700
676
|
deleteAgent(agentId: UUID): Promise<boolean>;
|
|
677
|
+
ensureAgentExists(agent: Partial<Agent>): Promise<Agent>;
|
|
701
678
|
ensureEmbeddingDimension(dimension: number): Promise<void>;
|
|
702
679
|
/** Get entity by IDs */
|
|
703
680
|
getEntityByIds(entityIds: UUID[]): Promise<Entity[] | null>;
|
|
@@ -861,14 +838,14 @@ export interface IDatabaseAdapter {
|
|
|
861
838
|
/**
|
|
862
839
|
* Result interface for embedding similarity searches
|
|
863
840
|
*/
|
|
864
|
-
|
|
841
|
+
interface EmbeddingSearchResult {
|
|
865
842
|
embedding: number[];
|
|
866
843
|
levenshtein_score: number;
|
|
867
844
|
}
|
|
868
845
|
/**
|
|
869
846
|
* Options for memory retrieval operations
|
|
870
847
|
*/
|
|
871
|
-
|
|
848
|
+
interface MemoryRetrievalOptions {
|
|
872
849
|
roomId: UUID;
|
|
873
850
|
count?: number;
|
|
874
851
|
unique?: boolean;
|
|
@@ -879,7 +856,7 @@ export interface MemoryRetrievalOptions {
|
|
|
879
856
|
/**
|
|
880
857
|
* Options for memory search operations
|
|
881
858
|
*/
|
|
882
|
-
|
|
859
|
+
interface MemorySearchOptions {
|
|
883
860
|
embedding: number[];
|
|
884
861
|
match_threshold?: number;
|
|
885
862
|
count?: number;
|
|
@@ -891,7 +868,7 @@ export interface MemorySearchOptions {
|
|
|
891
868
|
/**
|
|
892
869
|
* Options for multi-room memory retrieval
|
|
893
870
|
*/
|
|
894
|
-
|
|
871
|
+
interface MultiRoomMemoryOptions {
|
|
895
872
|
roomIds: UUID[];
|
|
896
873
|
limit?: number;
|
|
897
874
|
agentId?: UUID;
|
|
@@ -900,7 +877,7 @@ export interface MultiRoomMemoryOptions {
|
|
|
900
877
|
* Unified options pattern for memory operations
|
|
901
878
|
* Provides a simpler, more consistent interface
|
|
902
879
|
*/
|
|
903
|
-
|
|
880
|
+
interface UnifiedMemoryOptions {
|
|
904
881
|
roomId: UUID;
|
|
905
882
|
limit?: number;
|
|
906
883
|
agentId?: UUID;
|
|
@@ -911,14 +888,14 @@ export interface UnifiedMemoryOptions {
|
|
|
911
888
|
/**
|
|
912
889
|
* Specialized memory search options
|
|
913
890
|
*/
|
|
914
|
-
|
|
891
|
+
interface UnifiedSearchOptions extends UnifiedMemoryOptions {
|
|
915
892
|
embedding: number[];
|
|
916
893
|
similarity?: number;
|
|
917
894
|
}
|
|
918
895
|
/**
|
|
919
896
|
* Information describing the target of a message.
|
|
920
897
|
*/
|
|
921
|
-
|
|
898
|
+
interface TargetInfo {
|
|
922
899
|
source: string;
|
|
923
900
|
roomId?: UUID;
|
|
924
901
|
channelId?: string;
|
|
@@ -929,13 +906,13 @@ export interface TargetInfo {
|
|
|
929
906
|
/**
|
|
930
907
|
* Function signature for handlers responsible for sending messages to specific platforms.
|
|
931
908
|
*/
|
|
932
|
-
|
|
909
|
+
type SendHandlerFunction = (runtime: IAgentRuntime, target: TargetInfo, content: Content) => Promise<void>;
|
|
933
910
|
/**
|
|
934
911
|
* Represents the core runtime environment for an agent.
|
|
935
912
|
* Defines methods for database interaction, plugin management, event handling,
|
|
936
913
|
* state composition, model usage, and task management.
|
|
937
914
|
*/
|
|
938
|
-
|
|
915
|
+
interface IAgentRuntime extends IDatabaseAdapter {
|
|
939
916
|
agentId: UUID;
|
|
940
917
|
character: Character;
|
|
941
918
|
providers: Provider[];
|
|
@@ -948,7 +925,7 @@ export interface IAgentRuntime extends IDatabaseAdapter {
|
|
|
948
925
|
routes: Route[];
|
|
949
926
|
registerPlugin(plugin: Plugin): Promise<void>;
|
|
950
927
|
initialize(): Promise<void>;
|
|
951
|
-
getConnection(): Promise<PGlite |
|
|
928
|
+
getConnection(): Promise<PGlite | Pool>;
|
|
952
929
|
getService<T extends Service>(service: ServiceTypeName | string): T | null;
|
|
953
930
|
getAllServices(): Map<ServiceTypeName, Service>;
|
|
954
931
|
registerService(service: typeof Service): Promise<void>;
|
|
@@ -1023,7 +1000,7 @@ export interface IAgentRuntime extends IDatabaseAdapter {
|
|
|
1023
1000
|
/**
|
|
1024
1001
|
* Interface representing settings with string key-value pairs.
|
|
1025
1002
|
*/
|
|
1026
|
-
|
|
1003
|
+
interface RuntimeSettings {
|
|
1027
1004
|
[key: string]: string | undefined;
|
|
1028
1005
|
}
|
|
1029
1006
|
/**
|
|
@@ -1033,7 +1010,7 @@ export interface RuntimeSettings {
|
|
|
1033
1010
|
* and retrieved using `AgentRuntime.getKnowledge`.
|
|
1034
1011
|
* The `id` is a unique identifier for the knowledge item, often derived from its source or content.
|
|
1035
1012
|
*/
|
|
1036
|
-
|
|
1013
|
+
type KnowledgeItem = {
|
|
1037
1014
|
/** A Universally Unique Identifier for this specific knowledge item. */
|
|
1038
1015
|
id: UUID;
|
|
1039
1016
|
/** The actual content of the knowledge item, which must include text and can have other fields. */
|
|
@@ -1047,7 +1024,7 @@ export type KnowledgeItem = {
|
|
|
1047
1024
|
* - `PRIVATE`: Indicates knowledge that is restricted, typically to the specific agent or user context it belongs to.
|
|
1048
1025
|
* This enum is used to manage access and retrieval of knowledge items, often in conjunction with `AgentRuntime.addKnowledge` or `AgentRuntime.getKnowledge` scopes.
|
|
1049
1026
|
*/
|
|
1050
|
-
|
|
1027
|
+
declare enum KnowledgeScope {
|
|
1051
1028
|
SHARED = "shared",
|
|
1052
1029
|
PRIVATE = "private"
|
|
1053
1030
|
}
|
|
@@ -1057,7 +1034,7 @@ export declare enum KnowledgeScope {
|
|
|
1057
1034
|
* This helps in organizing the cache and avoiding key collisions.
|
|
1058
1035
|
* Used internally by caching strategies, potentially within `IDatabaseAdapter` cache methods or runtime caching layers.
|
|
1059
1036
|
*/
|
|
1060
|
-
|
|
1037
|
+
declare enum CacheKeyPrefix {
|
|
1061
1038
|
KNOWLEDGE = "knowledge"
|
|
1062
1039
|
}
|
|
1063
1040
|
/**
|
|
@@ -1067,7 +1044,7 @@ export declare enum CacheKeyPrefix {
|
|
|
1067
1044
|
* - `directory`: The path to the directory containing knowledge files.
|
|
1068
1045
|
* - `shared`: An optional boolean (defaults to false) indicating if the knowledge from this directory is considered shared or private.
|
|
1069
1046
|
*/
|
|
1070
|
-
|
|
1047
|
+
interface DirectoryItem {
|
|
1071
1048
|
/** The path to the directory containing knowledge files. */
|
|
1072
1049
|
directory: string;
|
|
1073
1050
|
/** If true, knowledge from this directory is considered shared; otherwise, it's private. Defaults to false. */
|
|
@@ -1079,7 +1056,7 @@ export interface DirectoryItem {
|
|
|
1079
1056
|
* The `id` would be the unique identifier for the chunk.
|
|
1080
1057
|
* It might be used when splitting large documents into smaller, manageable pieces for embedding or analysis.
|
|
1081
1058
|
*/
|
|
1082
|
-
|
|
1059
|
+
interface ChunkRow {
|
|
1083
1060
|
/** The unique identifier for this chunk of text. */
|
|
1084
1061
|
id: string;
|
|
1085
1062
|
}
|
|
@@ -1090,7 +1067,7 @@ export interface ChunkRow {
|
|
|
1090
1067
|
* `ModelType.TEXT_REASONING_LARGE`, or `ModelType.TEXT_COMPLETION`.
|
|
1091
1068
|
* It includes essential information like the prompt, model type, and various generation controls.
|
|
1092
1069
|
*/
|
|
1093
|
-
|
|
1070
|
+
type GenerateTextParams = {
|
|
1094
1071
|
/** The `AgentRuntime` instance, providing access to models and other services. */
|
|
1095
1072
|
runtime: IAgentRuntime;
|
|
1096
1073
|
/** The input string or prompt that the language model will use to generate text. */
|
|
@@ -1113,7 +1090,7 @@ export type GenerateTextParams = {
|
|
|
1113
1090
|
* This is a common preprocessing step for many language models.
|
|
1114
1091
|
* This structure is used with `AgentRuntime.useModel` when the `modelType` is `ModelType.TEXT_TOKENIZER_ENCODE`.
|
|
1115
1092
|
*/
|
|
1116
|
-
|
|
1093
|
+
interface TokenizeTextParams {
|
|
1117
1094
|
/** The input string to be tokenized. */
|
|
1118
1095
|
prompt: string;
|
|
1119
1096
|
/** The model type to use for tokenization, which determines the tokenizer algorithm and vocabulary. */
|
|
@@ -1124,7 +1101,7 @@ export interface TokenizeTextParams {
|
|
|
1124
1101
|
* This is the reverse operation of tokenization.
|
|
1125
1102
|
* This structure is used with `AgentRuntime.useModel` when the `modelType` is `ModelType.TEXT_TOKENIZER_DECODE`.
|
|
1126
1103
|
*/
|
|
1127
|
-
|
|
1104
|
+
interface DetokenizeTextParams {
|
|
1128
1105
|
/** An array of numerical tokens to be converted back into text. */
|
|
1129
1106
|
tokens: number[];
|
|
1130
1107
|
/** The model type used for detokenization, ensuring consistency with the original tokenization. */
|
|
@@ -1136,7 +1113,7 @@ export interface DetokenizeTextParams {
|
|
|
1136
1113
|
* The test function receives the `IAgentRuntime` instance, allowing it to interact with the agent's capabilities.
|
|
1137
1114
|
* Test cases are typically grouped into `TestSuite`s.
|
|
1138
1115
|
*/
|
|
1139
|
-
|
|
1116
|
+
interface TestCase {
|
|
1140
1117
|
/** A descriptive name for the test case, e.g., "should respond to greetings". */
|
|
1141
1118
|
name: string;
|
|
1142
1119
|
/**
|
|
@@ -1151,7 +1128,7 @@ export interface TestCase {
|
|
|
1151
1128
|
* This helps in organizing tests and running them collectively.
|
|
1152
1129
|
* A `ProjectAgent` can define one or more `TestSuite`s.
|
|
1153
1130
|
*/
|
|
1154
|
-
|
|
1131
|
+
interface TestSuite {
|
|
1155
1132
|
/** A descriptive name for the test suite, e.g., "Core Functionality Tests". */
|
|
1156
1133
|
name: string;
|
|
1157
1134
|
/** An array of `TestCase` objects that belong to this suite. */
|
|
@@ -1163,7 +1140,7 @@ export interface TestSuite {
|
|
|
1163
1140
|
* It allows for multiple registrations of the same `agentId` to support scenarios where an agent might restart,
|
|
1164
1141
|
* generating a new keypair and attestation each time.
|
|
1165
1142
|
*/
|
|
1166
|
-
|
|
1143
|
+
interface TeeAgent {
|
|
1167
1144
|
/** Primary key for the TEE agent registration record (e.g., a UUID or auto-incrementing ID). */
|
|
1168
1145
|
id: string;
|
|
1169
1146
|
/** The core identifier of the agent, which can be duplicated across multiple TEE registrations. */
|
|
@@ -1182,7 +1159,7 @@ export interface TeeAgent {
|
|
|
1182
1159
|
* This enum is used to configure how TEE functionalities are engaged, allowing for
|
|
1183
1160
|
* different setups for local development, Docker-based development, and production.
|
|
1184
1161
|
*/
|
|
1185
|
-
|
|
1162
|
+
declare enum TEEMode {
|
|
1186
1163
|
/** TEE functionality is completely disabled. */
|
|
1187
1164
|
OFF = "OFF",
|
|
1188
1165
|
/** For local development, potentially using a TEE simulator. */
|
|
@@ -1197,7 +1174,7 @@ export declare enum TEEMode {
|
|
|
1197
1174
|
* This quote is a piece of evidence provided by the TEE, cryptographically signed, which can be
|
|
1198
1175
|
* verified by a relying party to ensure the TEE's integrity and authenticity.
|
|
1199
1176
|
*/
|
|
1200
|
-
|
|
1177
|
+
interface RemoteAttestationQuote {
|
|
1201
1178
|
/** The attestation quote data, typically a base64 encoded string or similar format. */
|
|
1202
1179
|
quote: string;
|
|
1203
1180
|
/** Timestamp (e.g., Unix epoch in milliseconds) when the quote was generated or received. */
|
|
@@ -1208,7 +1185,7 @@ export interface RemoteAttestationQuote {
|
|
|
1208
1185
|
* This information helps establish a secure channel or verify the identity of the agent instance
|
|
1209
1186
|
* requesting key derivation.
|
|
1210
1187
|
*/
|
|
1211
|
-
|
|
1188
|
+
interface DeriveKeyAttestationData {
|
|
1212
1189
|
/** The unique identifier of the agent for which the key derivation is being attested. */
|
|
1213
1190
|
agentId: string;
|
|
1214
1191
|
/** The public key of the agent instance involved in the key derivation process. */
|
|
@@ -1221,7 +1198,7 @@ export interface DeriveKeyAttestationData {
|
|
|
1221
1198
|
* This structure binds a message to an agent's identity and a timestamp, all within the
|
|
1222
1199
|
* context of a remote attestation process, ensuring the message originated from a trusted TEE instance.
|
|
1223
1200
|
*/
|
|
1224
|
-
|
|
1201
|
+
interface RemoteAttestationMessage {
|
|
1225
1202
|
/** The unique identifier of the agent sending the attested message. */
|
|
1226
1203
|
agentId: string;
|
|
1227
1204
|
/** Timestamp (e.g., Unix epoch in milliseconds) when the message was attested or sent. */
|
|
@@ -1237,7 +1214,7 @@ export interface RemoteAttestationMessage {
|
|
|
1237
1214
|
* Enumerates different types or vendors of Trusted Execution Environments (TEEs).
|
|
1238
1215
|
* This allows the system to adapt to specific TEE technologies, like Intel TDX on DSTACK.
|
|
1239
1216
|
*/
|
|
1240
|
-
|
|
1217
|
+
declare enum TeeType {
|
|
1241
1218
|
/** Represents Intel Trusted Domain Extensions (TDX) running on DSTACK infrastructure. */
|
|
1242
1219
|
TDX_DSTACK = "tdx_dstack"
|
|
1243
1220
|
}
|
|
@@ -1246,7 +1223,7 @@ export declare enum TeeType {
|
|
|
1246
1223
|
* This allows for vendor-specific settings to be passed to the TEE plugin or service.
|
|
1247
1224
|
* The structure is a generic key-value map, as configurations can vary widely between vendors.
|
|
1248
1225
|
*/
|
|
1249
|
-
|
|
1226
|
+
interface TeeVendorConfig {
|
|
1250
1227
|
[key: string]: unknown;
|
|
1251
1228
|
}
|
|
1252
1229
|
/**
|
|
@@ -1254,7 +1231,7 @@ export interface TeeVendorConfig {
|
|
|
1254
1231
|
* This allows specifying the TEE vendor and any vendor-specific configurations.
|
|
1255
1232
|
* It's used to initialize and configure TEE-related functionalities within the agent system.
|
|
1256
1233
|
*/
|
|
1257
|
-
|
|
1234
|
+
interface TeePluginConfig {
|
|
1258
1235
|
/** Optional. The name or identifier of the TEE vendor (e.g., 'tdx_dstack' from `TeeType`). */
|
|
1259
1236
|
vendor?: string;
|
|
1260
1237
|
/** Optional. Vendor-specific configuration options, conforming to `TeeVendorConfig`. */
|
|
@@ -1265,7 +1242,7 @@ export interface TeePluginConfig {
|
|
|
1265
1242
|
* Task workers are registered with the `AgentRuntime` and are invoked when a `Task` of their designated `name` needs processing.
|
|
1266
1243
|
* This pattern allows for modular and extensible background task processing.
|
|
1267
1244
|
*/
|
|
1268
|
-
|
|
1245
|
+
interface TaskWorker {
|
|
1269
1246
|
/** The unique name of the task type this worker handles. This name links `Task` instances to this worker. */
|
|
1270
1247
|
name: string;
|
|
1271
1248
|
/**
|
|
@@ -1288,7 +1265,7 @@ export interface TaskWorker {
|
|
|
1288
1265
|
* for presenting task options to a user.
|
|
1289
1266
|
* The `[key: string]: unknown;` allows for additional, unspecified metadata fields.
|
|
1290
1267
|
*/
|
|
1291
|
-
|
|
1268
|
+
type TaskMetadata = {
|
|
1292
1269
|
/** Optional. If the task is recurring, this specifies the interval in milliseconds between updates or executions. */
|
|
1293
1270
|
updateInterval?: number;
|
|
1294
1271
|
/** Optional. Describes options or parameters that can be configured for this task, often for UI presentation. */
|
|
@@ -1305,7 +1282,7 @@ export type TaskMetadata = {
|
|
|
1305
1282
|
* They can be associated with a room, world, and tagged for categorization and retrieval.
|
|
1306
1283
|
* The `IDatabaseAdapter` handles persistence of task data.
|
|
1307
1284
|
*/
|
|
1308
|
-
|
|
1285
|
+
interface Task {
|
|
1309
1286
|
/** Optional. A Universally Unique Identifier for the task. Generated if not provided. */
|
|
1310
1287
|
id?: UUID;
|
|
1311
1288
|
/** The name of the task, which should correspond to a registered `TaskWorker.name`. */
|
|
@@ -1330,12 +1307,12 @@ export interface Task {
|
|
|
1330
1307
|
* - `NONE`: Indicates no specific role or default, minimal permissions.
|
|
1331
1308
|
* These roles are often used in `World.metadata.roles` to assign roles to entities.
|
|
1332
1309
|
*/
|
|
1333
|
-
|
|
1310
|
+
declare enum Role {
|
|
1334
1311
|
OWNER = "OWNER",
|
|
1335
1312
|
ADMIN = "ADMIN",
|
|
1336
1313
|
NONE = "NONE"
|
|
1337
1314
|
}
|
|
1338
|
-
|
|
1315
|
+
interface Setting {
|
|
1339
1316
|
name: string;
|
|
1340
1317
|
description: string;
|
|
1341
1318
|
usageDescription: string;
|
|
@@ -1350,10 +1327,10 @@ export interface Setting {
|
|
|
1350
1327
|
[key: string]: Setting;
|
|
1351
1328
|
}) => boolean;
|
|
1352
1329
|
}
|
|
1353
|
-
|
|
1330
|
+
interface WorldSettings {
|
|
1354
1331
|
[key: string]: Setting;
|
|
1355
1332
|
}
|
|
1356
|
-
|
|
1333
|
+
interface OnboardingConfig {
|
|
1357
1334
|
settings: {
|
|
1358
1335
|
[key: string]: Omit<Setting, 'value'>;
|
|
1359
1336
|
};
|
|
@@ -1361,14 +1338,14 @@ export interface OnboardingConfig {
|
|
|
1361
1338
|
/**
|
|
1362
1339
|
* Base parameters common to all model types
|
|
1363
1340
|
*/
|
|
1364
|
-
|
|
1341
|
+
interface BaseModelParams {
|
|
1365
1342
|
/** The agent runtime for accessing services and utilities */
|
|
1366
1343
|
runtime: IAgentRuntime;
|
|
1367
1344
|
}
|
|
1368
1345
|
/**
|
|
1369
1346
|
* Parameters for text generation models
|
|
1370
1347
|
*/
|
|
1371
|
-
|
|
1348
|
+
interface TextGenerationParams extends BaseModelParams {
|
|
1372
1349
|
/** The prompt to generate text from */
|
|
1373
1350
|
prompt: string;
|
|
1374
1351
|
/** Model temperature (0.0 to 1.0, lower is more deterministic) */
|
|
@@ -1385,32 +1362,14 @@ export interface TextGenerationParams extends BaseModelParams {
|
|
|
1385
1362
|
/**
|
|
1386
1363
|
* Parameters for text embedding models
|
|
1387
1364
|
*/
|
|
1388
|
-
|
|
1365
|
+
interface TextEmbeddingParams extends BaseModelParams {
|
|
1389
1366
|
/** The text to create embeddings for */
|
|
1390
1367
|
text: string;
|
|
1391
1368
|
}
|
|
1392
|
-
/**
|
|
1393
|
-
* Parameters for text tokenization models
|
|
1394
|
-
*/
|
|
1395
|
-
export interface TokenizeTextParams extends BaseModelParams {
|
|
1396
|
-
/** The text to tokenize */
|
|
1397
|
-
prompt: string;
|
|
1398
|
-
/** The model type to use for tokenization */
|
|
1399
|
-
modelType: ModelTypeName;
|
|
1400
|
-
}
|
|
1401
|
-
/**
|
|
1402
|
-
* Parameters for text detokenization models
|
|
1403
|
-
*/
|
|
1404
|
-
export interface DetokenizeTextParams extends BaseModelParams {
|
|
1405
|
-
/** The tokens to convert back to text */
|
|
1406
|
-
tokens: number[];
|
|
1407
|
-
/** The model type to use for detokenization */
|
|
1408
|
-
modelType: ModelTypeName;
|
|
1409
|
-
}
|
|
1410
1369
|
/**
|
|
1411
1370
|
* Parameters for image generation models
|
|
1412
1371
|
*/
|
|
1413
|
-
|
|
1372
|
+
interface ImageGenerationParams extends BaseModelParams {
|
|
1414
1373
|
/** The prompt describing the image to generate */
|
|
1415
1374
|
prompt: string;
|
|
1416
1375
|
/** The dimensions of the image to generate */
|
|
@@ -1421,7 +1380,7 @@ export interface ImageGenerationParams extends BaseModelParams {
|
|
|
1421
1380
|
/**
|
|
1422
1381
|
* Parameters for image description models
|
|
1423
1382
|
*/
|
|
1424
|
-
|
|
1383
|
+
interface ImageDescriptionParams extends BaseModelParams {
|
|
1425
1384
|
/** The URL or path of the image to describe */
|
|
1426
1385
|
imageUrl: string;
|
|
1427
1386
|
/** Optional prompt to guide the description */
|
|
@@ -1430,7 +1389,7 @@ export interface ImageDescriptionParams extends BaseModelParams {
|
|
|
1430
1389
|
/**
|
|
1431
1390
|
* Parameters for transcription models
|
|
1432
1391
|
*/
|
|
1433
|
-
|
|
1392
|
+
interface TranscriptionParams extends BaseModelParams {
|
|
1434
1393
|
/** The URL or path of the audio file to transcribe */
|
|
1435
1394
|
audioUrl: string;
|
|
1436
1395
|
/** Optional prompt to guide transcription */
|
|
@@ -1439,7 +1398,7 @@ export interface TranscriptionParams extends BaseModelParams {
|
|
|
1439
1398
|
/**
|
|
1440
1399
|
* Parameters for text-to-speech models
|
|
1441
1400
|
*/
|
|
1442
|
-
|
|
1401
|
+
interface TextToSpeechParams extends BaseModelParams {
|
|
1443
1402
|
/** The text to convert to speech */
|
|
1444
1403
|
text: string;
|
|
1445
1404
|
/** The voice to use */
|
|
@@ -1450,7 +1409,7 @@ export interface TextToSpeechParams extends BaseModelParams {
|
|
|
1450
1409
|
/**
|
|
1451
1410
|
* Parameters for audio processing models
|
|
1452
1411
|
*/
|
|
1453
|
-
|
|
1412
|
+
interface AudioProcessingParams extends BaseModelParams {
|
|
1454
1413
|
/** The URL or path of the audio file to process */
|
|
1455
1414
|
audioUrl: string;
|
|
1456
1415
|
/** The type of audio processing to perform */
|
|
@@ -1459,7 +1418,7 @@ export interface AudioProcessingParams extends BaseModelParams {
|
|
|
1459
1418
|
/**
|
|
1460
1419
|
* Parameters for video processing models
|
|
1461
1420
|
*/
|
|
1462
|
-
|
|
1421
|
+
interface VideoProcessingParams extends BaseModelParams {
|
|
1463
1422
|
/** The URL or path of the video file to process */
|
|
1464
1423
|
videoUrl: string;
|
|
1465
1424
|
/** The type of video processing to perform */
|
|
@@ -1468,7 +1427,7 @@ export interface VideoProcessingParams extends BaseModelParams {
|
|
|
1468
1427
|
/**
|
|
1469
1428
|
* Optional JSON schema for validating generated objects
|
|
1470
1429
|
*/
|
|
1471
|
-
|
|
1430
|
+
type JSONSchema = {
|
|
1472
1431
|
type: string;
|
|
1473
1432
|
properties?: Record<string, any>;
|
|
1474
1433
|
required?: string[];
|
|
@@ -1479,7 +1438,7 @@ export type JSONSchema = {
|
|
|
1479
1438
|
* Parameters for object generation models
|
|
1480
1439
|
* @template T - The expected return type, inferred from schema if provided
|
|
1481
1440
|
*/
|
|
1482
|
-
|
|
1441
|
+
interface ObjectGenerationParams<T = any> extends BaseModelParams {
|
|
1483
1442
|
/** The prompt describing the object to generate */
|
|
1484
1443
|
prompt: string;
|
|
1485
1444
|
/** Optional JSON schema for validation */
|
|
@@ -1498,7 +1457,7 @@ export interface ObjectGenerationParams<T = any> extends BaseModelParams {
|
|
|
1498
1457
|
/**
|
|
1499
1458
|
* Map of model types to their parameter types
|
|
1500
1459
|
*/
|
|
1501
|
-
|
|
1460
|
+
interface ModelParamsMap {
|
|
1502
1461
|
[ModelType.TEXT_SMALL]: TextGenerationParams;
|
|
1503
1462
|
[ModelType.TEXT_LARGE]: TextGenerationParams;
|
|
1504
1463
|
[ModelType.TEXT_EMBEDDING]: TextEmbeddingParams | string | null;
|
|
@@ -1519,7 +1478,7 @@ export interface ModelParamsMap {
|
|
|
1519
1478
|
/**
|
|
1520
1479
|
* Map of model types to their return value types
|
|
1521
1480
|
*/
|
|
1522
|
-
|
|
1481
|
+
interface ModelResultMap {
|
|
1523
1482
|
[ModelType.TEXT_SMALL]: string;
|
|
1524
1483
|
[ModelType.TEXT_LARGE]: string;
|
|
1525
1484
|
[ModelType.TEXT_EMBEDDING]: number[];
|
|
@@ -1545,7 +1504,7 @@ export interface ModelResultMap {
|
|
|
1545
1504
|
/**
|
|
1546
1505
|
* Standard event types across all platforms
|
|
1547
1506
|
*/
|
|
1548
|
-
|
|
1507
|
+
declare enum EventType {
|
|
1549
1508
|
WORLD_JOINED = "WORLD_JOINED",
|
|
1550
1509
|
WORLD_CONNECTED = "WORLD_CONNECTED",
|
|
1551
1510
|
WORLD_LEFT = "WORLD_LEFT",
|
|
@@ -1573,7 +1532,7 @@ export declare enum EventType {
|
|
|
1573
1532
|
/**
|
|
1574
1533
|
* Platform-specific event type prefix
|
|
1575
1534
|
*/
|
|
1576
|
-
|
|
1535
|
+
declare enum PlatformPrefix {
|
|
1577
1536
|
DISCORD = "DISCORD",
|
|
1578
1537
|
TELEGRAM = "TELEGRAM",
|
|
1579
1538
|
TWITTER = "TWITTER"
|
|
@@ -1581,7 +1540,7 @@ export declare enum PlatformPrefix {
|
|
|
1581
1540
|
/**
|
|
1582
1541
|
* Base payload interface for all events
|
|
1583
1542
|
*/
|
|
1584
|
-
|
|
1543
|
+
interface EventPayload {
|
|
1585
1544
|
runtime: IAgentRuntime;
|
|
1586
1545
|
source: string;
|
|
1587
1546
|
onComplete?: () => void;
|
|
@@ -1589,7 +1548,7 @@ export interface EventPayload {
|
|
|
1589
1548
|
/**
|
|
1590
1549
|
* Payload for world-related events
|
|
1591
1550
|
*/
|
|
1592
|
-
|
|
1551
|
+
interface WorldPayload extends EventPayload {
|
|
1593
1552
|
world: World;
|
|
1594
1553
|
rooms: Room[];
|
|
1595
1554
|
entities: Entity[];
|
|
@@ -1597,7 +1556,7 @@ export interface WorldPayload extends EventPayload {
|
|
|
1597
1556
|
/**
|
|
1598
1557
|
* Payload for entity-related events
|
|
1599
1558
|
*/
|
|
1600
|
-
|
|
1559
|
+
interface EntityPayload extends EventPayload {
|
|
1601
1560
|
entityId: UUID;
|
|
1602
1561
|
worldId?: UUID;
|
|
1603
1562
|
roomId?: UUID;
|
|
@@ -1611,7 +1570,7 @@ export interface EntityPayload extends EventPayload {
|
|
|
1611
1570
|
/**
|
|
1612
1571
|
* Payload for reaction-related events
|
|
1613
1572
|
*/
|
|
1614
|
-
|
|
1573
|
+
interface MessagePayload extends EventPayload {
|
|
1615
1574
|
message: Memory;
|
|
1616
1575
|
callback?: HandlerCallback;
|
|
1617
1576
|
onComplete?: () => void;
|
|
@@ -1619,7 +1578,7 @@ export interface MessagePayload extends EventPayload {
|
|
|
1619
1578
|
/**
|
|
1620
1579
|
* Payload for events that are invoked without a message
|
|
1621
1580
|
*/
|
|
1622
|
-
|
|
1581
|
+
interface InvokePayload extends EventPayload {
|
|
1623
1582
|
worldId: UUID;
|
|
1624
1583
|
userId: string;
|
|
1625
1584
|
roomId: UUID;
|
|
@@ -1629,7 +1588,7 @@ export interface InvokePayload extends EventPayload {
|
|
|
1629
1588
|
/**
|
|
1630
1589
|
* Run event payload type
|
|
1631
1590
|
*/
|
|
1632
|
-
|
|
1591
|
+
interface RunEventPayload extends EventPayload {
|
|
1633
1592
|
runId: UUID;
|
|
1634
1593
|
messageId: UUID;
|
|
1635
1594
|
roomId: UUID;
|
|
@@ -1643,7 +1602,7 @@ export interface RunEventPayload extends EventPayload {
|
|
|
1643
1602
|
/**
|
|
1644
1603
|
* Action event payload type
|
|
1645
1604
|
*/
|
|
1646
|
-
|
|
1605
|
+
interface ActionEventPayload extends EventPayload {
|
|
1647
1606
|
actionId: UUID;
|
|
1648
1607
|
actionName: string;
|
|
1649
1608
|
startTime?: number;
|
|
@@ -1653,7 +1612,7 @@ export interface ActionEventPayload extends EventPayload {
|
|
|
1653
1612
|
/**
|
|
1654
1613
|
* Evaluator event payload type
|
|
1655
1614
|
*/
|
|
1656
|
-
|
|
1615
|
+
interface EvaluatorEventPayload extends EventPayload {
|
|
1657
1616
|
evaluatorId: UUID;
|
|
1658
1617
|
evaluatorName: string;
|
|
1659
1618
|
startTime?: number;
|
|
@@ -1663,7 +1622,7 @@ export interface EvaluatorEventPayload extends EventPayload {
|
|
|
1663
1622
|
/**
|
|
1664
1623
|
* Model event payload type
|
|
1665
1624
|
*/
|
|
1666
|
-
|
|
1625
|
+
interface ModelEventPayload extends EventPayload {
|
|
1667
1626
|
provider: string;
|
|
1668
1627
|
type: ModelTypeName;
|
|
1669
1628
|
prompt: string;
|
|
@@ -1680,7 +1639,7 @@ export interface ModelEventPayload extends EventPayload {
|
|
|
1680
1639
|
* @property {Memory} message - The message received.
|
|
1681
1640
|
* @property {HandlerCallback} callback - The callback function to be executed after handling the message.
|
|
1682
1641
|
*/
|
|
1683
|
-
|
|
1642
|
+
type MessageReceivedHandlerParams = {
|
|
1684
1643
|
runtime: IAgentRuntime;
|
|
1685
1644
|
message: Memory;
|
|
1686
1645
|
callback: HandlerCallback;
|
|
@@ -1689,7 +1648,7 @@ export type MessageReceivedHandlerParams = {
|
|
|
1689
1648
|
/**
|
|
1690
1649
|
* Maps event types to their corresponding payload types
|
|
1691
1650
|
*/
|
|
1692
|
-
|
|
1651
|
+
interface EventPayloadMap {
|
|
1693
1652
|
[EventType.WORLD_JOINED]: WorldPayload;
|
|
1694
1653
|
[EventType.WORLD_CONNECTED]: WorldPayload;
|
|
1695
1654
|
[EventType.WORLD_LEFT]: WorldPayload;
|
|
@@ -1713,11 +1672,11 @@ export interface EventPayloadMap {
|
|
|
1713
1672
|
/**
|
|
1714
1673
|
* Event handler function type
|
|
1715
1674
|
*/
|
|
1716
|
-
|
|
1675
|
+
type EventHandler<T extends keyof EventPayloadMap> = (payload: EventPayloadMap[T]) => Promise<void>;
|
|
1717
1676
|
/**
|
|
1718
1677
|
* Update the Plugin interface with typed events
|
|
1719
1678
|
*/
|
|
1720
|
-
|
|
1679
|
+
declare enum SOCKET_MESSAGE_TYPE {
|
|
1721
1680
|
ROOM_JOINING = 1,
|
|
1722
1681
|
SEND_MESSAGE = 2,
|
|
1723
1682
|
MESSAGE = 3,
|
|
@@ -1728,7 +1687,7 @@ export declare enum SOCKET_MESSAGE_TYPE {
|
|
|
1728
1687
|
/**
|
|
1729
1688
|
* Specialized memory type for messages with enhanced type checking
|
|
1730
1689
|
*/
|
|
1731
|
-
|
|
1690
|
+
interface MessageMemory extends Memory {
|
|
1732
1691
|
metadata: MessageMetadata;
|
|
1733
1692
|
content: Content & {
|
|
1734
1693
|
text: string;
|
|
@@ -1737,7 +1696,7 @@ export interface MessageMemory extends Memory {
|
|
|
1737
1696
|
/**
|
|
1738
1697
|
* Factory function to create a new message memory with proper defaults
|
|
1739
1698
|
*/
|
|
1740
|
-
|
|
1699
|
+
declare function createMessageMemory(params: {
|
|
1741
1700
|
id?: UUID;
|
|
1742
1701
|
entityId: UUID;
|
|
1743
1702
|
agentId?: UUID;
|
|
@@ -1752,7 +1711,7 @@ export declare function createMessageMemory(params: {
|
|
|
1752
1711
|
* @template ConfigType The configuration type for this service
|
|
1753
1712
|
* @template ResultType The result type returned by the service operations
|
|
1754
1713
|
*/
|
|
1755
|
-
|
|
1714
|
+
interface TypedService<ConfigType extends {
|
|
1756
1715
|
[key: string]: any;
|
|
1757
1716
|
} = {
|
|
1758
1717
|
[key: string]: any;
|
|
@@ -1774,41 +1733,41 @@ export interface TypedService<ConfigType extends {
|
|
|
1774
1733
|
* @param serviceType The type of service to get
|
|
1775
1734
|
* @returns The service instance or null if not available
|
|
1776
1735
|
*/
|
|
1777
|
-
|
|
1736
|
+
declare function getTypedService<T extends TypedService<any, any>>(runtime: IAgentRuntime, serviceType: ServiceTypeName): T | null;
|
|
1778
1737
|
/**
|
|
1779
1738
|
* Type guard to check if a memory metadata is a DocumentMetadata
|
|
1780
1739
|
* @param metadata The metadata to check
|
|
1781
1740
|
* @returns True if the metadata is a DocumentMetadata
|
|
1782
1741
|
*/
|
|
1783
|
-
|
|
1742
|
+
declare function isDocumentMetadata(metadata: MemoryMetadata): metadata is DocumentMetadata;
|
|
1784
1743
|
/**
|
|
1785
1744
|
* Type guard to check if a memory metadata is a FragmentMetadata
|
|
1786
1745
|
* @param metadata The metadata to check
|
|
1787
1746
|
* @returns True if the metadata is a FragmentMetadata
|
|
1788
1747
|
*/
|
|
1789
|
-
|
|
1748
|
+
declare function isFragmentMetadata(metadata: MemoryMetadata): metadata is FragmentMetadata;
|
|
1790
1749
|
/**
|
|
1791
1750
|
* Type guard to check if a memory metadata is a MessageMetadata
|
|
1792
1751
|
* @param metadata The metadata to check
|
|
1793
1752
|
* @returns True if the metadata is a MessageMetadata
|
|
1794
1753
|
*/
|
|
1795
|
-
|
|
1754
|
+
declare function isMessageMetadata(metadata: MemoryMetadata): metadata is MessageMetadata;
|
|
1796
1755
|
/**
|
|
1797
1756
|
* Type guard to check if a memory metadata is a DescriptionMetadata
|
|
1798
1757
|
* @param metadata The metadata to check
|
|
1799
1758
|
* @returns True if the metadata is a DescriptionMetadata
|
|
1800
1759
|
*/
|
|
1801
|
-
|
|
1760
|
+
declare function isDescriptionMetadata(metadata: MemoryMetadata): metadata is DescriptionMetadata;
|
|
1802
1761
|
/**
|
|
1803
1762
|
* Type guard to check if a memory metadata is a CustomMetadata
|
|
1804
1763
|
* @param metadata The metadata to check
|
|
1805
1764
|
* @returns True if the metadata is a CustomMetadata
|
|
1806
1765
|
*/
|
|
1807
|
-
|
|
1766
|
+
declare function isCustomMetadata(metadata: MemoryMetadata): metadata is CustomMetadata;
|
|
1808
1767
|
/**
|
|
1809
1768
|
* Standardized service error type for consistent error handling
|
|
1810
1769
|
*/
|
|
1811
|
-
|
|
1770
|
+
interface ServiceError {
|
|
1812
1771
|
code: string;
|
|
1813
1772
|
message: string;
|
|
1814
1773
|
details?: unknown;
|
|
@@ -1817,13 +1776,13 @@ export interface ServiceError {
|
|
|
1817
1776
|
/**
|
|
1818
1777
|
* Memory type guard for document memories
|
|
1819
1778
|
*/
|
|
1820
|
-
|
|
1779
|
+
declare function isDocumentMemory(memory: Memory): memory is Memory & {
|
|
1821
1780
|
metadata: DocumentMetadata;
|
|
1822
1781
|
};
|
|
1823
1782
|
/**
|
|
1824
1783
|
* Memory type guard for fragment memories
|
|
1825
1784
|
*/
|
|
1826
|
-
|
|
1785
|
+
declare function isFragmentMemory(memory: Memory): memory is Memory & {
|
|
1827
1786
|
metadata: FragmentMetadata;
|
|
1828
1787
|
};
|
|
1829
1788
|
/**
|
|
@@ -1832,11 +1791,11 @@ export declare function isFragmentMemory(memory: Memory): memory is Memory & {
|
|
|
1832
1791
|
* @param defaultValue Optional default value if no text is found
|
|
1833
1792
|
* @returns The text content or default value
|
|
1834
1793
|
*/
|
|
1835
|
-
|
|
1794
|
+
declare function getMemoryText(memory: Memory, defaultValue?: string): string;
|
|
1836
1795
|
/**
|
|
1837
1796
|
* Safely create a ServiceError from any caught error
|
|
1838
1797
|
*/
|
|
1839
|
-
|
|
1798
|
+
declare function createServiceError(error: unknown, code?: string): ServiceError;
|
|
1840
1799
|
/**
|
|
1841
1800
|
* Replace 'any' types with more specific types
|
|
1842
1801
|
*/
|
|
@@ -1845,13 +1804,13 @@ export declare function createServiceError(error: unknown, code?: string): Servi
|
|
|
1845
1804
|
* This type is used to provide more specific typing for properties within `StateObject` and `StateArray`,
|
|
1846
1805
|
* moving away from a generic 'any' type for better type safety and clarity in state management.
|
|
1847
1806
|
*/
|
|
1848
|
-
|
|
1807
|
+
type StateValue = string | number | boolean | null | StateObject | StateArray;
|
|
1849
1808
|
/**
|
|
1850
1809
|
* Represents a generic object structure within the agent's state, where keys are strings
|
|
1851
1810
|
* and values can be any `StateValue`. This allows for nested objects within the state.
|
|
1852
1811
|
* It's a fundamental part of the `EnhancedState` interface.
|
|
1853
1812
|
*/
|
|
1854
|
-
|
|
1813
|
+
interface StateObject {
|
|
1855
1814
|
[key: string]: StateValue;
|
|
1856
1815
|
}
|
|
1857
1816
|
/**
|
|
@@ -1859,7 +1818,7 @@ export interface StateObject {
|
|
|
1859
1818
|
* This allows for lists of mixed or uniform types to be stored in the state,
|
|
1860
1819
|
* contributing to the structured definition of `EnhancedState`.
|
|
1861
1820
|
*/
|
|
1862
|
-
|
|
1821
|
+
type StateArray = StateValue[];
|
|
1863
1822
|
/**
|
|
1864
1823
|
* Enhanced State interface with more specific types for its core properties.
|
|
1865
1824
|
* This interface provides a more structured representation of an agent's conversational state,
|
|
@@ -1867,7 +1826,7 @@ export type StateArray = StateValue[];
|
|
|
1867
1826
|
* The `text` property typically holds a textual summary or context derived from the state.
|
|
1868
1827
|
* Additional dynamic properties are still allowed via the index signature `[key: string]: StateValue;`.
|
|
1869
1828
|
*/
|
|
1870
|
-
|
|
1829
|
+
interface EnhancedState {
|
|
1871
1830
|
/** Holds directly accessible state values, often used for template rendering or quick lookups. */
|
|
1872
1831
|
values: StateObject;
|
|
1873
1832
|
/** Stores more complex or structured data, potentially namespaced by providers or internal systems. */
|
|
@@ -1883,35 +1842,35 @@ export interface EnhancedState {
|
|
|
1883
1842
|
* to define more specific types for component data where possible to improve type safety
|
|
1884
1843
|
* and code maintainability. This type serves as a base for various component implementations.
|
|
1885
1844
|
*/
|
|
1886
|
-
|
|
1845
|
+
type ComponentData = Record<string, unknown>;
|
|
1887
1846
|
/**
|
|
1888
1847
|
* Represents a generic data object that can be passed as a payload in an event.
|
|
1889
1848
|
* This type is often used in `TypedEventHandler` to provide a flexible yet somewhat
|
|
1890
1849
|
* structured way to handle event data. Specific event handlers might cast this to a
|
|
1891
1850
|
* more concrete type based on the event being processed.
|
|
1892
1851
|
*/
|
|
1893
|
-
|
|
1852
|
+
type EventDataObject = Record<string, unknown>;
|
|
1894
1853
|
/**
|
|
1895
1854
|
* Defines a more specific type for event handlers, expecting an `EventDataObject`.
|
|
1896
1855
|
* This aims to improve upon generic 'any' type handlers, providing a clearer contract
|
|
1897
1856
|
* for functions that respond to events emitted within the agent runtime (see `emitEvent` in `AgentRuntime`).
|
|
1898
1857
|
* Handlers can be synchronous or asynchronous.
|
|
1899
1858
|
*/
|
|
1900
|
-
|
|
1859
|
+
type TypedEventHandler = (data: EventDataObject) => Promise<void> | void;
|
|
1901
1860
|
/**
|
|
1902
1861
|
* Represents a generic database connection object.
|
|
1903
1862
|
* The actual type of this connection will depend on the specific database adapter implementation
|
|
1904
1863
|
* (e.g., a connection pool object for PostgreSQL, a client instance for a NoSQL database).
|
|
1905
1864
|
* This `unknown` type serves as a placeholder in the abstract `IDatabaseAdapter`.
|
|
1906
1865
|
*/
|
|
1907
|
-
|
|
1866
|
+
type DbConnection = unknown;
|
|
1908
1867
|
/**
|
|
1909
1868
|
* A generic type for metadata objects, often used in various parts of the system like
|
|
1910
1869
|
* `Relationship` metadata or other extensible data structures.
|
|
1911
1870
|
* It allows for arbitrary key-value pairs where values are of `unknown` type,
|
|
1912
1871
|
* encouraging consumers to perform type checking or casting.
|
|
1913
1872
|
*/
|
|
1914
|
-
|
|
1873
|
+
type MetadataObject = Record<string, unknown>;
|
|
1915
1874
|
/**
|
|
1916
1875
|
* Defines the structure for a model handler registration within the `AgentRuntime`.
|
|
1917
1876
|
* Each model (e.g., for text generation, embedding) is associated with a handler function,
|
|
@@ -1920,7 +1879,7 @@ export type MetadataObject = Record<string, unknown>;
|
|
|
1920
1879
|
* handlers are registered for the same model type. The `registrationOrder` (not in type, but used in runtime)
|
|
1921
1880
|
* serves as a tie-breaker. See `AgentRuntime.registerModel` and `AgentRuntime.getModel`.
|
|
1922
1881
|
*/
|
|
1923
|
-
|
|
1882
|
+
interface ModelHandler {
|
|
1924
1883
|
/** The function that executes the model, taking runtime and parameters, and returning a Promise. */
|
|
1925
1884
|
handler: (runtime: IAgentRuntime, params: Record<string, unknown>) => Promise<unknown>;
|
|
1926
1885
|
/** The name of the provider (e.g., plugin name) that registered this model handler. */
|
|
@@ -1939,8 +1898,8 @@ export interface ModelHandler {
|
|
|
1939
1898
|
* structures. This type allows for a flexible way to pass configuration objects,
|
|
1940
1899
|
* typically used during service initialization within a plugin or the `AgentRuntime`.
|
|
1941
1900
|
*/
|
|
1942
|
-
|
|
1943
|
-
|
|
1901
|
+
type ServiceConfig = Record<string, unknown>;
|
|
1902
|
+
declare const VECTOR_DIMS: {
|
|
1944
1903
|
readonly SMALL: 384;
|
|
1945
1904
|
readonly MEDIUM: 512;
|
|
1946
1905
|
readonly LARGE: 768;
|
|
@@ -1952,7 +1911,7 @@ export declare const VECTOR_DIMS: {
|
|
|
1952
1911
|
* Interface for control messages sent from the backend to the frontend
|
|
1953
1912
|
* to manage UI state and interaction capabilities
|
|
1954
1913
|
*/
|
|
1955
|
-
|
|
1914
|
+
interface ControlMessage {
|
|
1956
1915
|
/** Message type identifier */
|
|
1957
1916
|
type: 'control';
|
|
1958
1917
|
/** Control message payload */
|
|
@@ -1967,3 +1926,26 @@ export interface ControlMessage {
|
|
|
1967
1926
|
/** Room ID to ensure signal is directed to the correct chat window */
|
|
1968
1927
|
roomId: UUID;
|
|
1969
1928
|
}
|
|
1929
|
+
/**
|
|
1930
|
+
* Client instance
|
|
1931
|
+
*/
|
|
1932
|
+
declare abstract class Service {
|
|
1933
|
+
/** Runtime instance */
|
|
1934
|
+
protected runtime: IAgentRuntime;
|
|
1935
|
+
constructor(runtime?: IAgentRuntime);
|
|
1936
|
+
abstract stop(): Promise<void>;
|
|
1937
|
+
/** Service type */
|
|
1938
|
+
static serviceType: string;
|
|
1939
|
+
/** Service name */
|
|
1940
|
+
abstract capabilityDescription: string;
|
|
1941
|
+
/** Service configuration */
|
|
1942
|
+
config?: {
|
|
1943
|
+
[key: string]: any;
|
|
1944
|
+
};
|
|
1945
|
+
/** Start service connection */
|
|
1946
|
+
static start(_runtime: IAgentRuntime): Promise<Service>;
|
|
1947
|
+
/** Stop service connection */
|
|
1948
|
+
static stop(_runtime: IAgentRuntime): Promise<unknown>;
|
|
1949
|
+
}
|
|
1950
|
+
|
|
1951
|
+
export { type EnhancedState as $, type ActionExample as A, type BaseMetadata as B, type Content as C, ChannelType as D, type Entity as E, type ChunkRow as F, type ComponentData as G, type HandlerCallback as H, type IDatabaseAdapter as I, ContentType as J, type ControlMessage as K, type Log as L, type Memory as M, type CustomMetadata as N, type DbConnection as O, type Provider as P, type DeriveKeyAttestationData as Q, type Room as R, type State as S, type Task as T, type UUID as U, type DescriptionMetadata as V, type World as W, type DetokenizeTextParams as X, type DirectoryItem as Y, type DocumentMetadata as Z, type EmbeddingSearchResult as _, type Action as a, TeeType as a$, type EntityPayload as a0, type EvaluationExample as a1, type EvaluatorEventPayload as a2, type EventDataObject as a3, type EventHandler as a4, type EventPayload as a5, type EventPayloadMap as a6, EventType as a7, type FragmentMetadata as a8, type GenerateTextParams as a9, PlatformPrefix as aA, type PluginEvents as aB, type Project as aC, type ProjectAgent as aD, type ProviderResult as aE, type RemoteAttestationMessage as aF, type RemoteAttestationQuote as aG, type RoomMetadata as aH, type RunEventPayload as aI, SOCKET_MESSAGE_TYPE as aJ, type SendHandlerFunction as aK, type ServiceClassMap as aL, type ServiceConfig as aM, type ServiceError as aN, type ServiceInstance as aO, type ServiceRegistry as aP, ServiceType as aQ, type ServiceTypeRegistry as aR, type ServiceTypeValue as aS, type Setting as aT, type StateArray as aU, type StateObject as aV, type StateValue as aW, TEEMode as aX, type TaskMetadata as aY, type TeeAgent as aZ, type TeePluginConfig as a_, type Handler as aa, type ImageDescriptionParams as ab, type ImageGenerationParams as ac, type InvokePayload as ad, type IsValidServiceType as ae, type JSONSchema as af, type KnowledgeItem as ag, KnowledgeScope as ah, type Media as ai, type MemoryRetrievalOptions as aj, type MemoryScope as ak, type MemorySearchOptions as al, MemoryType as am, type MemoryTypeAlias as an, type MessageExample as ao, type MessageMemory as ap, type MessageMetadata as aq, type MessagePayload as ar, type MessageReceivedHandlerParams as as, type MetadataObject as at, type ModelEventPayload as au, type ModelHandler as av, ModelType as aw, type MultiRoomMemoryOptions as ax, type ObjectGenerationParams as ay, type OnboardingConfig as az, type Component as b, type TeeVendorConfig as b0, type TestCase as b1, type TestSuite as b2, type TextEmbeddingParams as b3, type TextGenerationParams as b4, type TextToSpeechParams as b5, type TokenizeTextParams as b6, type TranscriptionParams as b7, type TypedEventHandler as b8, type TypedService as b9, type TypedServiceClass as ba, type UnifiedMemoryOptions as bb, type UnifiedSearchOptions as bc, VECTOR_DIMS as bd, type Validator as be, type VideoProcessingParams as bf, type WorldPayload as bg, type WorldSettings as bh, asUUID as bi, createMessageMemory as bj, createServiceError as bk, getMemoryText as bl, getTypedService as bm, isCustomMetadata as bn, isDescriptionMetadata as bo, isDocumentMemory as bp, isDocumentMetadata as bq, isFragmentMemory as br, isFragmentMetadata as bs, isMessageMetadata as bt, type MemoryMetadata as c, type Participant as d, type Relationship as e, type Agent as f, type IAgentRuntime as g, Role as h, type ServiceTypeName as i, Service as j, type Route as k, type Character as l, type Evaluator as m, type Plugin as n, type RuntimeSettings as o, type ModelTypeName as p, type ModelResultMap as q, type ModelParamsMap as r, type TaskWorker as s, type TargetInfo as t, type TemplateType as u, type ActionEventPayload as v, AgentStatus as w, type AudioProcessingParams as x, type BaseModelParams as y, CacheKeyPrefix as z };
|