@elizaos/core 1.0.4 → 1.0.6
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-2HSL25IJ.js +40 -0
- package/dist/chunk-FEPOSPNK.js +157 -0
- package/dist/chunk-JX2SRFHQ.js +59 -0
- package/dist/chunk-SIAA4J6H.js +21 -0
- package/dist/{chunk-HRFT5KDK.js → chunk-TF6QLZZY.js} +180 -402
- package/dist/chunk-U2ADTLZY.js +50 -0
- package/dist/chunk-YIBXLDIR.js +42 -0
- package/dist/index-BHW44X0A.d.ts +112 -0
- package/dist/{index-DVKkCFlY.d.ts → index-S6eSMHDH.d.ts} +8 -9
- package/dist/index.d.ts +17 -9
- package/dist/index.js +7 -1
- package/dist/specs/v1/actionExample.d.ts +41 -0
- package/dist/specs/v1/actionExample.js +13 -0
- package/dist/specs/v1/index.d.ts +10 -4
- package/dist/specs/v1/index.js +30 -19
- package/dist/specs/v1/messages.d.ts +31 -0
- package/dist/specs/v1/messages.js +18 -0
- package/dist/specs/v1/posts.d.ts +10 -0
- package/dist/specs/v1/posts.js +12 -0
- package/dist/specs/v1/provider.d.ts +21 -0
- package/dist/specs/v1/provider.js +10 -0
- package/dist/specs/v1/runtime.d.ts +146 -0
- package/dist/specs/v1/runtime.js +12 -0
- package/dist/specs/v1/state.d.ts +21 -0
- package/dist/specs/v1/state.js +9 -0
- package/dist/specs/v1/templates.d.ts +42 -0
- package/dist/specs/v1/templates.js +11 -0
- package/dist/{index-Cy9ZgQIe.d.ts → specs/v1/types.d.ts} +137 -555
- package/dist/specs/v1/types.js +33 -0
- package/dist/specs/v1/uuid.d.ts +27 -0
- package/dist/specs/v1/uuid.js +14 -0
- package/dist/specs/v2/index.d.ts +2 -4
- package/dist/specs/v2/index.js +7 -1
- package/dist/{types-DzoA9aTJ.d.ts → types-D9v-eW3g.d.ts} +4 -7
- package/package.json +4 -4
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { Readable } from 'stream';
|
|
2
|
-
import { S as State$2, A as ActionExample$2, C as Content$1, P as Provider$2 } from './types-DzoA9aTJ.js';
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
* Represents a UUID string in the format "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
6
5
|
*/
|
|
7
|
-
type UUID
|
|
6
|
+
type UUID = `${string}-${string}-${string}-${string}-${string}`;
|
|
8
7
|
/**
|
|
9
8
|
* Represents the content of a message or communication
|
|
10
9
|
*/
|
|
@@ -18,7 +17,7 @@ interface Content {
|
|
|
18
17
|
/** URL of the original message/post (e.g. tweet URL, Discord message link) */
|
|
19
18
|
url?: string;
|
|
20
19
|
/** UUID of parent message if this is a reply/thread */
|
|
21
|
-
inReplyTo?: UUID
|
|
20
|
+
inReplyTo?: UUID;
|
|
22
21
|
/** Array of media attachments */
|
|
23
22
|
attachments?: Media[];
|
|
24
23
|
/** Additional dynamic properties */
|
|
@@ -27,7 +26,7 @@ interface Content {
|
|
|
27
26
|
/**
|
|
28
27
|
* Example content with associated user for demonstration purposes
|
|
29
28
|
*/
|
|
30
|
-
interface ActionExample
|
|
29
|
+
interface ActionExample {
|
|
31
30
|
/** User associated with the example */
|
|
32
31
|
user: string;
|
|
33
32
|
/** Content of the example */
|
|
@@ -38,7 +37,7 @@ interface ActionExample$1 {
|
|
|
38
37
|
*/
|
|
39
38
|
interface ConversationExample {
|
|
40
39
|
/** UUID of user in conversation */
|
|
41
|
-
userId: UUID
|
|
40
|
+
userId: UUID;
|
|
42
41
|
/** Content of the conversation */
|
|
43
42
|
content: Content;
|
|
44
43
|
}
|
|
@@ -60,7 +59,7 @@ interface Actor {
|
|
|
60
59
|
quote: string;
|
|
61
60
|
};
|
|
62
61
|
/** Unique identifier */
|
|
63
|
-
id: UUID
|
|
62
|
+
id: UUID;
|
|
64
63
|
}
|
|
65
64
|
/**
|
|
66
65
|
* Represents a single objective within a goal
|
|
@@ -86,11 +85,11 @@ declare enum GoalStatus {
|
|
|
86
85
|
*/
|
|
87
86
|
interface Goal {
|
|
88
87
|
/** Optional unique identifier */
|
|
89
|
-
id?: UUID
|
|
88
|
+
id?: UUID;
|
|
90
89
|
/** Room ID where goal exists */
|
|
91
|
-
roomId: UUID
|
|
90
|
+
roomId: UUID;
|
|
92
91
|
/** User ID of goal owner */
|
|
93
|
-
userId: UUID
|
|
92
|
+
userId: UUID;
|
|
94
93
|
/** Name/title of the goal */
|
|
95
94
|
name: string;
|
|
96
95
|
/** Current status */
|
|
@@ -238,11 +237,11 @@ declare enum ModelProviderName {
|
|
|
238
237
|
/**
|
|
239
238
|
* Represents the current state/context of a conversation
|
|
240
239
|
*/
|
|
241
|
-
interface State
|
|
240
|
+
interface State {
|
|
242
241
|
/** ID of user who sent current message */
|
|
243
|
-
userId?: UUID
|
|
242
|
+
userId?: UUID;
|
|
244
243
|
/** ID of agent in conversation */
|
|
245
|
-
agentId?: UUID
|
|
244
|
+
agentId?: UUID;
|
|
246
245
|
/** Agent's biography */
|
|
247
246
|
bio?: string;
|
|
248
247
|
/** Agent's background lore */
|
|
@@ -252,7 +251,7 @@ interface State$1 {
|
|
|
252
251
|
/** Post handling directions */
|
|
253
252
|
postDirections?: string;
|
|
254
253
|
/** Current room/conversation ID */
|
|
255
|
-
roomId?: UUID
|
|
254
|
+
roomId?: UUID;
|
|
256
255
|
/** Optional agent name */
|
|
257
256
|
agentName?: string;
|
|
258
257
|
/** Optional message sender name */
|
|
@@ -303,11 +302,11 @@ interface State$1 {
|
|
|
303
302
|
*/
|
|
304
303
|
interface Memory {
|
|
305
304
|
/** Optional unique identifier */
|
|
306
|
-
id?: UUID
|
|
305
|
+
id?: UUID;
|
|
307
306
|
/** Associated user ID */
|
|
308
|
-
userId: UUID
|
|
307
|
+
userId: UUID;
|
|
309
308
|
/** Associated agent ID */
|
|
310
|
-
agentId: UUID
|
|
309
|
+
agentId: UUID;
|
|
311
310
|
/** Optional creation timestamp */
|
|
312
311
|
createdAt?: number;
|
|
313
312
|
/** Memory content */
|
|
@@ -315,7 +314,7 @@ interface Memory {
|
|
|
315
314
|
/** Optional embedding vector */
|
|
316
315
|
embedding?: number[];
|
|
317
316
|
/** Associated room ID */
|
|
318
|
-
roomId: UUID
|
|
317
|
+
roomId: UUID;
|
|
319
318
|
/** Whether memory is unique */
|
|
320
319
|
unique?: boolean;
|
|
321
320
|
/** Embedding similarity score */
|
|
@@ -333,7 +332,7 @@ interface MessageExample {
|
|
|
333
332
|
/**
|
|
334
333
|
* Handler function type for processing messages
|
|
335
334
|
*/
|
|
336
|
-
type Handler = (runtime: IAgentRuntime, message: Memory, state?: State
|
|
335
|
+
type Handler = (runtime: IAgentRuntime, message: Memory, state?: State, options?: {
|
|
337
336
|
[key: string]: unknown;
|
|
338
337
|
}, callback?: HandlerCallback) => Promise<unknown>;
|
|
339
338
|
/**
|
|
@@ -343,7 +342,7 @@ type HandlerCallback = (response: Content, files?: any) => Promise<Memory[]>;
|
|
|
343
342
|
/**
|
|
344
343
|
* Validator function type for actions/evaluators
|
|
345
344
|
*/
|
|
346
|
-
type Validator = (runtime: IAgentRuntime, message: Memory, state?: State
|
|
345
|
+
type Validator = (runtime: IAgentRuntime, message: Memory, state?: State) => Promise<boolean>;
|
|
347
346
|
/**
|
|
348
347
|
* Represents an action the agent can perform
|
|
349
348
|
*/
|
|
@@ -353,7 +352,7 @@ interface Action {
|
|
|
353
352
|
/** Detailed description */
|
|
354
353
|
description: string;
|
|
355
354
|
/** Example usages */
|
|
356
|
-
examples: ActionExample
|
|
355
|
+
examples: ActionExample[][];
|
|
357
356
|
/** Handler function */
|
|
358
357
|
handler: Handler;
|
|
359
358
|
/** Action name */
|
|
@@ -370,7 +369,7 @@ interface EvaluationExample {
|
|
|
370
369
|
/** Evaluation context */
|
|
371
370
|
context: string;
|
|
372
371
|
/** Example messages */
|
|
373
|
-
messages: Array<ActionExample
|
|
372
|
+
messages: Array<ActionExample>;
|
|
374
373
|
/** Expected outcome */
|
|
375
374
|
outcome: string;
|
|
376
375
|
}
|
|
@@ -396,7 +395,7 @@ interface Evaluator {
|
|
|
396
395
|
/**
|
|
397
396
|
* Provider for external data/services
|
|
398
397
|
*/
|
|
399
|
-
interface Provider
|
|
398
|
+
interface Provider {
|
|
400
399
|
/** Provider name */
|
|
401
400
|
name?: string;
|
|
402
401
|
/** Description of the provider */
|
|
@@ -408,22 +407,22 @@ interface Provider$1 {
|
|
|
408
407
|
/** Whether the provider is private */
|
|
409
408
|
private?: boolean;
|
|
410
409
|
/** Data retrieval function */
|
|
411
|
-
get: (runtime: IAgentRuntime, message: Memory, state?: State
|
|
410
|
+
get: (runtime: IAgentRuntime, message: Memory, state?: State) => Promise<any>;
|
|
412
411
|
}
|
|
413
412
|
/**
|
|
414
413
|
* Represents a relationship between users
|
|
415
414
|
*/
|
|
416
415
|
interface Relationship {
|
|
417
416
|
/** Unique identifier */
|
|
418
|
-
id: UUID
|
|
417
|
+
id: UUID;
|
|
419
418
|
/** First user ID */
|
|
420
|
-
userA: UUID
|
|
419
|
+
userA: UUID;
|
|
421
420
|
/** Second user ID */
|
|
422
|
-
userB: UUID
|
|
421
|
+
userB: UUID;
|
|
423
422
|
/** Primary user ID */
|
|
424
|
-
userId: UUID
|
|
423
|
+
userId: UUID;
|
|
425
424
|
/** Associated room ID */
|
|
426
|
-
roomId: UUID
|
|
425
|
+
roomId: UUID;
|
|
427
426
|
/** Relationship status */
|
|
428
427
|
status: string;
|
|
429
428
|
/** Optional creation timestamp */
|
|
@@ -434,7 +433,7 @@ interface Relationship {
|
|
|
434
433
|
*/
|
|
435
434
|
interface Account {
|
|
436
435
|
/** Unique identifier */
|
|
437
|
-
id: UUID
|
|
436
|
+
id: UUID;
|
|
438
437
|
/** Display name */
|
|
439
438
|
name: string;
|
|
440
439
|
/** Username */
|
|
@@ -453,7 +452,7 @@ interface Account {
|
|
|
453
452
|
*/
|
|
454
453
|
interface Participant {
|
|
455
454
|
/** Unique identifier */
|
|
456
|
-
id: UUID
|
|
455
|
+
id: UUID;
|
|
457
456
|
/** Associated account */
|
|
458
457
|
account: Account;
|
|
459
458
|
}
|
|
@@ -462,7 +461,7 @@ interface Participant {
|
|
|
462
461
|
*/
|
|
463
462
|
interface Room {
|
|
464
463
|
/** Unique identifier */
|
|
465
|
-
id: UUID
|
|
464
|
+
id: UUID;
|
|
466
465
|
/** Room participants */
|
|
467
466
|
participants: Participant[];
|
|
468
467
|
}
|
|
@@ -530,7 +529,7 @@ type Plugin = {
|
|
|
530
529
|
/** Optional actions */
|
|
531
530
|
actions?: Action[];
|
|
532
531
|
/** Optional providers */
|
|
533
|
-
providers?: Provider
|
|
532
|
+
providers?: Provider[];
|
|
534
533
|
/** Optional evaluators */
|
|
535
534
|
evaluators?: Evaluator[];
|
|
536
535
|
/** Optional services */
|
|
@@ -577,15 +576,15 @@ interface ModelConfiguration {
|
|
|
577
576
|
maxInputTokens?: number;
|
|
578
577
|
experimental_telemetry?: TelemetrySettings;
|
|
579
578
|
}
|
|
580
|
-
type TemplateType
|
|
581
|
-
state: State
|
|
579
|
+
type TemplateType = string | ((options: {
|
|
580
|
+
state: State;
|
|
582
581
|
}) => string);
|
|
583
582
|
/**
|
|
584
583
|
* Configuration for an agent character
|
|
585
584
|
*/
|
|
586
585
|
type Character = {
|
|
587
586
|
/** Optional unique identifier */
|
|
588
|
-
id?: UUID
|
|
587
|
+
id?: UUID;
|
|
589
588
|
/** Character name */
|
|
590
589
|
name: string;
|
|
591
590
|
/** Optional username */
|
|
@@ -604,38 +603,38 @@ type Character = {
|
|
|
604
603
|
modelEndpointOverride?: string;
|
|
605
604
|
/** Optional prompt templates */
|
|
606
605
|
templates?: {
|
|
607
|
-
goalsTemplate?: TemplateType
|
|
608
|
-
factsTemplate?: TemplateType
|
|
609
|
-
messageHandlerTemplate?: TemplateType
|
|
610
|
-
shouldRespondTemplate?: TemplateType
|
|
611
|
-
continueMessageHandlerTemplate?: TemplateType
|
|
612
|
-
evaluationTemplate?: TemplateType
|
|
613
|
-
twitterSearchTemplate?: TemplateType
|
|
614
|
-
twitterActionTemplate?: TemplateType
|
|
615
|
-
twitterPostTemplate?: TemplateType
|
|
616
|
-
twitterMessageHandlerTemplate?: TemplateType
|
|
617
|
-
twitterShouldRespondTemplate?: TemplateType
|
|
618
|
-
twitterVoiceHandlerTemplate?: TemplateType
|
|
619
|
-
instagramPostTemplate?: TemplateType
|
|
620
|
-
instagramMessageHandlerTemplate?: TemplateType
|
|
621
|
-
instagramShouldRespondTemplate?: TemplateType
|
|
622
|
-
farcasterPostTemplate?: TemplateType
|
|
623
|
-
lensPostTemplate?: TemplateType
|
|
624
|
-
farcasterMessageHandlerTemplate?: TemplateType
|
|
625
|
-
lensMessageHandlerTemplate?: TemplateType
|
|
626
|
-
farcasterShouldRespondTemplate?: TemplateType
|
|
627
|
-
lensShouldRespondTemplate?: TemplateType
|
|
628
|
-
telegramMessageHandlerTemplate?: TemplateType
|
|
629
|
-
telegramShouldRespondTemplate?: TemplateType
|
|
606
|
+
goalsTemplate?: TemplateType;
|
|
607
|
+
factsTemplate?: TemplateType;
|
|
608
|
+
messageHandlerTemplate?: TemplateType;
|
|
609
|
+
shouldRespondTemplate?: TemplateType;
|
|
610
|
+
continueMessageHandlerTemplate?: TemplateType;
|
|
611
|
+
evaluationTemplate?: TemplateType;
|
|
612
|
+
twitterSearchTemplate?: TemplateType;
|
|
613
|
+
twitterActionTemplate?: TemplateType;
|
|
614
|
+
twitterPostTemplate?: TemplateType;
|
|
615
|
+
twitterMessageHandlerTemplate?: TemplateType;
|
|
616
|
+
twitterShouldRespondTemplate?: TemplateType;
|
|
617
|
+
twitterVoiceHandlerTemplate?: TemplateType;
|
|
618
|
+
instagramPostTemplate?: TemplateType;
|
|
619
|
+
instagramMessageHandlerTemplate?: TemplateType;
|
|
620
|
+
instagramShouldRespondTemplate?: TemplateType;
|
|
621
|
+
farcasterPostTemplate?: TemplateType;
|
|
622
|
+
lensPostTemplate?: TemplateType;
|
|
623
|
+
farcasterMessageHandlerTemplate?: TemplateType;
|
|
624
|
+
lensMessageHandlerTemplate?: TemplateType;
|
|
625
|
+
farcasterShouldRespondTemplate?: TemplateType;
|
|
626
|
+
lensShouldRespondTemplate?: TemplateType;
|
|
627
|
+
telegramMessageHandlerTemplate?: TemplateType;
|
|
628
|
+
telegramShouldRespondTemplate?: TemplateType;
|
|
630
629
|
telegramAutoPostTemplate?: string;
|
|
631
630
|
telegramPinnedMessageTemplate?: string;
|
|
632
631
|
discordAutoPostTemplate?: string;
|
|
633
632
|
discordAnnouncementHypeTemplate?: string;
|
|
634
|
-
discordVoiceHandlerTemplate?: TemplateType
|
|
635
|
-
discordShouldRespondTemplate?: TemplateType
|
|
636
|
-
discordMessageHandlerTemplate?: TemplateType
|
|
637
|
-
slackMessageHandlerTemplate?: TemplateType
|
|
638
|
-
slackShouldRespondTemplate?: TemplateType
|
|
633
|
+
discordVoiceHandlerTemplate?: TemplateType;
|
|
634
|
+
discordShouldRespondTemplate?: TemplateType;
|
|
635
|
+
discordMessageHandlerTemplate?: TemplateType;
|
|
636
|
+
slackMessageHandlerTemplate?: TemplateType;
|
|
637
|
+
slackShouldRespondTemplate?: TemplateType;
|
|
639
638
|
jeeterPostTemplate?: string;
|
|
640
639
|
jeeterSearchTemplate?: string;
|
|
641
640
|
jeeterInteractionTemplate?: string;
|
|
@@ -827,25 +826,25 @@ interface IDatabaseAdapter {
|
|
|
827
826
|
/** Close database connection */
|
|
828
827
|
close(): Promise<void>;
|
|
829
828
|
/** Get account by ID */
|
|
830
|
-
getAccountById(userId: UUID
|
|
829
|
+
getAccountById(userId: UUID): Promise<Account | null>;
|
|
831
830
|
/** Create new account */
|
|
832
831
|
createAccount(account: Account): Promise<boolean>;
|
|
833
832
|
/** Get memories matching criteria */
|
|
834
833
|
getMemories(params: {
|
|
835
|
-
roomId: UUID
|
|
834
|
+
roomId: UUID;
|
|
836
835
|
count?: number;
|
|
837
836
|
unique?: boolean;
|
|
838
837
|
tableName: string;
|
|
839
|
-
agentId: UUID
|
|
838
|
+
agentId: UUID;
|
|
840
839
|
start?: number;
|
|
841
840
|
end?: number;
|
|
842
841
|
}): Promise<Memory[]>;
|
|
843
|
-
getMemoryById(id: UUID
|
|
844
|
-
getMemoriesByIds(ids: UUID
|
|
842
|
+
getMemoryById(id: UUID): Promise<Memory | null>;
|
|
843
|
+
getMemoriesByIds(ids: UUID[], tableName?: string): Promise<Memory[]>;
|
|
845
844
|
getMemoriesByRoomIds(params: {
|
|
846
845
|
tableName: string;
|
|
847
|
-
agentId: UUID
|
|
848
|
-
roomIds: UUID
|
|
846
|
+
agentId: UUID;
|
|
847
|
+
roomIds: UUID[];
|
|
849
848
|
limit?: number;
|
|
850
849
|
}): Promise<Memory[]>;
|
|
851
850
|
getCachedEmbeddings(params: {
|
|
@@ -863,101 +862,101 @@ interface IDatabaseAdapter {
|
|
|
863
862
|
body: {
|
|
864
863
|
[key: string]: unknown;
|
|
865
864
|
};
|
|
866
|
-
userId: UUID
|
|
867
|
-
roomId: UUID
|
|
865
|
+
userId: UUID;
|
|
866
|
+
roomId: UUID;
|
|
868
867
|
type: string;
|
|
869
868
|
}): Promise<void>;
|
|
870
869
|
getActorDetails(params: {
|
|
871
|
-
roomId: UUID
|
|
870
|
+
roomId: UUID;
|
|
872
871
|
}): Promise<Actor[]>;
|
|
873
872
|
searchMemories(params: {
|
|
874
873
|
tableName: string;
|
|
875
|
-
agentId: UUID
|
|
876
|
-
roomId: UUID
|
|
874
|
+
agentId: UUID;
|
|
875
|
+
roomId: UUID;
|
|
877
876
|
embedding: number[];
|
|
878
877
|
match_threshold: number;
|
|
879
878
|
match_count: number;
|
|
880
879
|
unique: boolean;
|
|
881
880
|
}): Promise<Memory[]>;
|
|
882
881
|
updateGoalStatus(params: {
|
|
883
|
-
goalId: UUID
|
|
882
|
+
goalId: UUID;
|
|
884
883
|
status: GoalStatus;
|
|
885
884
|
}): Promise<void>;
|
|
886
885
|
searchMemoriesByEmbedding(embedding: number[], params: {
|
|
887
886
|
match_threshold?: number;
|
|
888
887
|
count?: number;
|
|
889
|
-
roomId?: UUID
|
|
890
|
-
agentId?: UUID
|
|
888
|
+
roomId?: UUID;
|
|
889
|
+
agentId?: UUID;
|
|
891
890
|
unique?: boolean;
|
|
892
891
|
tableName: string;
|
|
893
892
|
}): Promise<Memory[]>;
|
|
894
893
|
createMemory(memory: Memory, tableName: string, unique?: boolean): Promise<void>;
|
|
895
|
-
removeMemory(memoryId: UUID
|
|
896
|
-
removeAllMemories(roomId: UUID
|
|
897
|
-
countMemories(roomId: UUID
|
|
894
|
+
removeMemory(memoryId: UUID, tableName: string): Promise<void>;
|
|
895
|
+
removeAllMemories(roomId: UUID, tableName: string): Promise<void>;
|
|
896
|
+
countMemories(roomId: UUID, unique?: boolean, tableName?: string): Promise<number>;
|
|
898
897
|
getGoals(params: {
|
|
899
|
-
agentId: UUID
|
|
900
|
-
roomId: UUID
|
|
901
|
-
userId?: UUID
|
|
898
|
+
agentId: UUID;
|
|
899
|
+
roomId: UUID;
|
|
900
|
+
userId?: UUID | null;
|
|
902
901
|
onlyInProgress?: boolean;
|
|
903
902
|
count?: number;
|
|
904
903
|
}): Promise<Goal[]>;
|
|
905
904
|
updateGoal(goal: Goal): Promise<void>;
|
|
906
905
|
createGoal(goal: Goal): Promise<void>;
|
|
907
|
-
removeGoal(goalId: UUID
|
|
908
|
-
removeAllGoals(roomId: UUID
|
|
909
|
-
getRoom(roomId: UUID
|
|
910
|
-
createRoom(roomId?: UUID
|
|
911
|
-
removeRoom(roomId: UUID
|
|
912
|
-
getRoomsForParticipant(userId: UUID
|
|
913
|
-
getRoomsForParticipants(userIds: UUID
|
|
914
|
-
addParticipant(userId: UUID
|
|
915
|
-
removeParticipant(userId: UUID
|
|
916
|
-
getParticipantsForAccount(userId: UUID
|
|
917
|
-
getParticipantsForRoom(roomId: UUID
|
|
918
|
-
getParticipantUserState(roomId: UUID
|
|
919
|
-
setParticipantUserState(roomId: UUID
|
|
906
|
+
removeGoal(goalId: UUID): Promise<void>;
|
|
907
|
+
removeAllGoals(roomId: UUID): Promise<void>;
|
|
908
|
+
getRoom(roomId: UUID): Promise<UUID | null>;
|
|
909
|
+
createRoom(roomId?: UUID): Promise<UUID>;
|
|
910
|
+
removeRoom(roomId: UUID): Promise<void>;
|
|
911
|
+
getRoomsForParticipant(userId: UUID): Promise<UUID[]>;
|
|
912
|
+
getRoomsForParticipants(userIds: UUID[]): Promise<UUID[]>;
|
|
913
|
+
addParticipant(userId: UUID, roomId: UUID): Promise<boolean>;
|
|
914
|
+
removeParticipant(userId: UUID, roomId: UUID): Promise<boolean>;
|
|
915
|
+
getParticipantsForAccount(userId: UUID): Promise<Participant[]>;
|
|
916
|
+
getParticipantsForRoom(roomId: UUID): Promise<UUID[]>;
|
|
917
|
+
getParticipantUserState(roomId: UUID, userId: UUID): Promise<'FOLLOWED' | 'MUTED' | null>;
|
|
918
|
+
setParticipantUserState(roomId: UUID, userId: UUID, state: 'FOLLOWED' | 'MUTED' | null): Promise<void>;
|
|
920
919
|
createRelationship(params: {
|
|
921
|
-
userA: UUID
|
|
922
|
-
userB: UUID
|
|
920
|
+
userA: UUID;
|
|
921
|
+
userB: UUID;
|
|
923
922
|
}): Promise<boolean>;
|
|
924
923
|
getRelationship(params: {
|
|
925
|
-
userA: UUID
|
|
926
|
-
userB: UUID
|
|
924
|
+
userA: UUID;
|
|
925
|
+
userB: UUID;
|
|
927
926
|
}): Promise<Relationship | null>;
|
|
928
927
|
getRelationships(params: {
|
|
929
|
-
userId: UUID
|
|
928
|
+
userId: UUID;
|
|
930
929
|
}): Promise<Relationship[]>;
|
|
931
930
|
getKnowledge(params: {
|
|
932
|
-
id?: UUID
|
|
933
|
-
agentId: UUID
|
|
931
|
+
id?: UUID;
|
|
932
|
+
agentId: UUID;
|
|
934
933
|
limit?: number;
|
|
935
934
|
query?: string;
|
|
936
935
|
conversationContext?: string;
|
|
937
936
|
}): Promise<RAGKnowledgeItem[]>;
|
|
938
937
|
searchKnowledge(params: {
|
|
939
|
-
agentId: UUID
|
|
938
|
+
agentId: UUID;
|
|
940
939
|
embedding: Float32Array;
|
|
941
940
|
match_threshold: number;
|
|
942
941
|
match_count: number;
|
|
943
942
|
searchText?: string;
|
|
944
943
|
}): Promise<RAGKnowledgeItem[]>;
|
|
945
944
|
createKnowledge(knowledge: RAGKnowledgeItem): Promise<void>;
|
|
946
|
-
removeKnowledge(id: UUID
|
|
947
|
-
clearKnowledge(agentId: UUID
|
|
945
|
+
removeKnowledge(id: UUID): Promise<void>;
|
|
946
|
+
clearKnowledge(agentId: UUID, shared?: boolean): Promise<void>;
|
|
948
947
|
}
|
|
949
948
|
interface IDatabaseCacheAdapter {
|
|
950
949
|
getCache(params: {
|
|
951
|
-
agentId: UUID
|
|
950
|
+
agentId: UUID;
|
|
952
951
|
key: string;
|
|
953
952
|
}): Promise<string | undefined>;
|
|
954
953
|
setCache(params: {
|
|
955
|
-
agentId: UUID
|
|
954
|
+
agentId: UUID;
|
|
956
955
|
key: string;
|
|
957
956
|
value: string;
|
|
958
957
|
}): Promise<boolean>;
|
|
959
958
|
deleteCache(params: {
|
|
960
|
-
agentId: UUID
|
|
959
|
+
agentId: UUID;
|
|
961
960
|
key: string;
|
|
962
961
|
}): Promise<boolean>;
|
|
963
962
|
}
|
|
@@ -967,7 +966,7 @@ interface IMemoryManager {
|
|
|
967
966
|
constructor: Function;
|
|
968
967
|
addEmbeddingToMemory(memory: Memory): Promise<Memory>;
|
|
969
968
|
getMemories(opts: {
|
|
970
|
-
roomId: UUID
|
|
969
|
+
roomId: UUID;
|
|
971
970
|
count?: number;
|
|
972
971
|
unique?: boolean;
|
|
973
972
|
start?: number;
|
|
@@ -977,36 +976,36 @@ interface IMemoryManager {
|
|
|
977
976
|
embedding: number[];
|
|
978
977
|
levenshtein_score: number;
|
|
979
978
|
}[]>;
|
|
980
|
-
getMemoryById(id: UUID
|
|
979
|
+
getMemoryById(id: UUID): Promise<Memory | null>;
|
|
981
980
|
getMemoriesByRoomIds(params: {
|
|
982
|
-
roomIds: UUID
|
|
981
|
+
roomIds: UUID[];
|
|
983
982
|
limit?: number;
|
|
984
983
|
}): Promise<Memory[]>;
|
|
985
984
|
searchMemoriesByEmbedding(embedding: number[], opts: {
|
|
986
985
|
match_threshold?: number;
|
|
987
986
|
count?: number;
|
|
988
|
-
roomId: UUID
|
|
987
|
+
roomId: UUID;
|
|
989
988
|
unique?: boolean;
|
|
990
989
|
}): Promise<Memory[]>;
|
|
991
990
|
createMemory(memory: Memory, unique?: boolean): Promise<void>;
|
|
992
|
-
removeMemory(memoryId: UUID
|
|
993
|
-
removeAllMemories(roomId: UUID
|
|
994
|
-
countMemories(roomId: UUID
|
|
991
|
+
removeMemory(memoryId: UUID): Promise<void>;
|
|
992
|
+
removeAllMemories(roomId: UUID): Promise<void>;
|
|
993
|
+
countMemories(roomId: UUID, unique?: boolean): Promise<number>;
|
|
995
994
|
}
|
|
996
995
|
interface IRAGKnowledgeManager {
|
|
997
996
|
runtime: IAgentRuntime;
|
|
998
997
|
tableName: string;
|
|
999
998
|
getKnowledge(params: {
|
|
1000
999
|
query?: string;
|
|
1001
|
-
id?: UUID
|
|
1000
|
+
id?: UUID;
|
|
1002
1001
|
limit?: number;
|
|
1003
1002
|
conversationContext?: string;
|
|
1004
|
-
agentId?: UUID
|
|
1003
|
+
agentId?: UUID;
|
|
1005
1004
|
}): Promise<RAGKnowledgeItem[]>;
|
|
1006
1005
|
createKnowledge(item: RAGKnowledgeItem): Promise<void>;
|
|
1007
|
-
removeKnowledge(id: UUID
|
|
1006
|
+
removeKnowledge(id: UUID): Promise<void>;
|
|
1008
1007
|
searchKnowledge(params: {
|
|
1009
|
-
agentId: UUID
|
|
1008
|
+
agentId: UUID;
|
|
1010
1009
|
embedding: Float32Array | number[];
|
|
1011
1010
|
match_threshold?: number;
|
|
1012
1011
|
match_count?: number;
|
|
@@ -1020,7 +1019,7 @@ interface IRAGKnowledgeManager {
|
|
|
1020
1019
|
isShared: boolean;
|
|
1021
1020
|
}): Promise<void>;
|
|
1022
1021
|
cleanupDeletedKnowledgeFiles(): Promise<void>;
|
|
1023
|
-
generateScopedId(path: string, isShared: boolean): UUID
|
|
1022
|
+
generateScopedId(path: string, isShared: boolean): UUID;
|
|
1024
1023
|
}
|
|
1025
1024
|
type CacheOptions = {
|
|
1026
1025
|
expires?: number;
|
|
@@ -1043,7 +1042,7 @@ declare abstract class Service {
|
|
|
1043
1042
|
abstract initialize(runtime: IAgentRuntime): Promise<void>;
|
|
1044
1043
|
}
|
|
1045
1044
|
interface IAgentRuntime {
|
|
1046
|
-
agentId: UUID
|
|
1045
|
+
agentId: UUID;
|
|
1047
1046
|
serverUrl: string;
|
|
1048
1047
|
databaseAdapter: IDatabaseAdapter;
|
|
1049
1048
|
token: string | null;
|
|
@@ -1051,7 +1050,7 @@ interface IAgentRuntime {
|
|
|
1051
1050
|
imageModelProvider: ModelProviderName;
|
|
1052
1051
|
imageVisionModelProvider: ModelProviderName;
|
|
1053
1052
|
character: Character;
|
|
1054
|
-
providers: Provider
|
|
1053
|
+
providers: Provider[];
|
|
1055
1054
|
actions: Action[];
|
|
1056
1055
|
evaluators: Evaluator[];
|
|
1057
1056
|
plugins: Plugin[];
|
|
@@ -1072,18 +1071,18 @@ interface IAgentRuntime {
|
|
|
1072
1071
|
registerService(service: Service): void;
|
|
1073
1072
|
getSetting(key: string): string | null;
|
|
1074
1073
|
getConversationLength(): number;
|
|
1075
|
-
processActions(message: Memory, responses: Memory[], state?: State
|
|
1076
|
-
evaluate(message: Memory, state?: State
|
|
1077
|
-
ensureParticipantExists(userId: UUID
|
|
1078
|
-
ensureUserExists(userId: UUID
|
|
1074
|
+
processActions(message: Memory, responses: Memory[], state?: State, callback?: HandlerCallback): Promise<void>;
|
|
1075
|
+
evaluate(message: Memory, state?: State, didRespond?: boolean, callback?: HandlerCallback): Promise<string[] | null>;
|
|
1076
|
+
ensureParticipantExists(userId: UUID, roomId: UUID): Promise<void>;
|
|
1077
|
+
ensureUserExists(userId: UUID, userName: string | null, name: string | null, source: string | null): Promise<void>;
|
|
1079
1078
|
registerAction(action: Action): void;
|
|
1080
|
-
ensureConnection(userId: UUID
|
|
1081
|
-
ensureParticipantInRoom(userId: UUID
|
|
1082
|
-
ensureRoomExists(roomId: UUID
|
|
1079
|
+
ensureConnection(userId: UUID, roomId: UUID, userName?: string, userScreenName?: string, source?: string): Promise<void>;
|
|
1080
|
+
ensureParticipantInRoom(userId: UUID, roomId: UUID): Promise<void>;
|
|
1081
|
+
ensureRoomExists(roomId: UUID): Promise<void>;
|
|
1083
1082
|
composeState(message: Memory, additionalKeys?: {
|
|
1084
1083
|
[key: string]: unknown;
|
|
1085
|
-
}): Promise<State
|
|
1086
|
-
updateRecentMessageState(state: State
|
|
1084
|
+
}): Promise<State>;
|
|
1085
|
+
updateRecentMessageState(state: State): Promise<State>;
|
|
1087
1086
|
}
|
|
1088
1087
|
interface IImageDescriptionService extends Service {
|
|
1089
1088
|
describeImage(imageUrl: string): Promise<{
|
|
@@ -1197,18 +1196,18 @@ declare enum LoggingLevel {
|
|
|
1197
1196
|
NONE = "none"
|
|
1198
1197
|
}
|
|
1199
1198
|
type KnowledgeItem = {
|
|
1200
|
-
id: UUID
|
|
1199
|
+
id: UUID;
|
|
1201
1200
|
content: Content;
|
|
1202
1201
|
};
|
|
1203
1202
|
interface RAGKnowledgeItem {
|
|
1204
|
-
id: UUID
|
|
1205
|
-
agentId: UUID
|
|
1203
|
+
id: UUID;
|
|
1204
|
+
agentId: UUID;
|
|
1206
1205
|
content: {
|
|
1207
1206
|
text: string;
|
|
1208
1207
|
metadata?: {
|
|
1209
1208
|
isMain?: boolean;
|
|
1210
1209
|
isChunk?: boolean;
|
|
1211
|
-
originalId?: UUID
|
|
1210
|
+
originalId?: UUID;
|
|
1212
1211
|
chunkIndex?: number;
|
|
1213
1212
|
source?: string;
|
|
1214
1213
|
type?: string;
|
|
@@ -1258,421 +1257,4 @@ interface ChunkRow {
|
|
|
1258
1257
|
id: string;
|
|
1259
1258
|
}
|
|
1260
1259
|
|
|
1261
|
-
|
|
1262
|
-
* Get details for a list of actors.
|
|
1263
|
-
*/
|
|
1264
|
-
declare function getActorDetails({ runtime, roomId, }: {
|
|
1265
|
-
runtime: IAgentRuntime;
|
|
1266
|
-
roomId: UUID$1;
|
|
1267
|
-
}): Promise<void>;
|
|
1268
|
-
/**
|
|
1269
|
-
* Format actors into a string
|
|
1270
|
-
* @param actors - list of actors
|
|
1271
|
-
* @returns string
|
|
1272
|
-
*/
|
|
1273
|
-
declare function formatActors({ actors }: {
|
|
1274
|
-
actors: Actor[];
|
|
1275
|
-
}): string;
|
|
1276
|
-
/**
|
|
1277
|
-
* Format messages into a string
|
|
1278
|
-
* @param messages - list of messages
|
|
1279
|
-
* @param actors - list of actors
|
|
1280
|
-
* @returns string
|
|
1281
|
-
*/
|
|
1282
|
-
declare const formatMessages: ({ messages, actors }: {
|
|
1283
|
-
messages: Memory[];
|
|
1284
|
-
actors: Actor[];
|
|
1285
|
-
}) => string;
|
|
1286
|
-
declare const formatTimestamp: (messageDate: number) => string;
|
|
1287
|
-
|
|
1288
|
-
declare const formatPosts: ({ messages, actors, conversationHeader, }: {
|
|
1289
|
-
messages: Memory[];
|
|
1290
|
-
actors: Actor[];
|
|
1291
|
-
conversationHeader?: boolean;
|
|
1292
|
-
}) => string;
|
|
1293
|
-
|
|
1294
|
-
declare class AgentRuntime implements IAgentRuntime {
|
|
1295
|
-
private _runtime;
|
|
1296
|
-
get agentId(): UUID$1;
|
|
1297
|
-
get serverUrl(): string;
|
|
1298
|
-
get databaseAdapter(): IDatabaseAdapter;
|
|
1299
|
-
get token(): string;
|
|
1300
|
-
get character(): Character;
|
|
1301
|
-
get actions(): Action[];
|
|
1302
|
-
get evaluators(): Evaluator[];
|
|
1303
|
-
get providers(): Provider$1[];
|
|
1304
|
-
get plugins(): Plugin[];
|
|
1305
|
-
get modelProvider(): any;
|
|
1306
|
-
get imageModelProvider(): any;
|
|
1307
|
-
get imageVisionModelProvider(): any;
|
|
1308
|
-
get messageManager(): any;
|
|
1309
|
-
get routes(): any;
|
|
1310
|
-
get services(): any;
|
|
1311
|
-
get events(): any;
|
|
1312
|
-
get descriptionManager(): any;
|
|
1313
|
-
get documentsManager(): any;
|
|
1314
|
-
get knowledgeManager(): any;
|
|
1315
|
-
get ragKnowledgeManager(): any;
|
|
1316
|
-
get loreManager(): any;
|
|
1317
|
-
get cacheManager(): any;
|
|
1318
|
-
get clients(): any;
|
|
1319
|
-
registerMemoryManager(manager: IMemoryManager): void;
|
|
1320
|
-
getMemoryManager(tableName: string): any;
|
|
1321
|
-
getService<T extends Service>(service: ServiceType): T | null;
|
|
1322
|
-
registerService(service: Service): Promise<void>;
|
|
1323
|
-
/**
|
|
1324
|
-
* Creates an instance of AgentRuntime.
|
|
1325
|
-
* @param opts - The options for configuring the AgentRuntime.
|
|
1326
|
-
* @param opts.conversationLength - The number of messages to hold in the recent message cache.
|
|
1327
|
-
* @param opts.token - The JWT token, can be a JWT token if outside worker, or an OpenAI token if inside worker.
|
|
1328
|
-
* @param opts.serverUrl - The URL of the worker.
|
|
1329
|
-
* @param opts.actions - Optional custom actions.
|
|
1330
|
-
* @param opts.evaluators - Optional custom evaluators.
|
|
1331
|
-
* @param opts.services - Optional custom services.
|
|
1332
|
-
* @param opts.memoryManagers - Optional custom memory managers.
|
|
1333
|
-
* @param opts.providers - Optional context providers.
|
|
1334
|
-
* @param opts.model - The model to use for generateText.
|
|
1335
|
-
* @param opts.embeddingModel - The model to use for embedding.
|
|
1336
|
-
* @param opts.agentId - Optional ID of the agent.
|
|
1337
|
-
* @param opts.databaseAdapter - The database adapter used for interacting with the database.
|
|
1338
|
-
* @param opts.fetch - Custom fetch function to use for making requests.
|
|
1339
|
-
*/
|
|
1340
|
-
constructor(opts: {
|
|
1341
|
-
conversationLength?: number;
|
|
1342
|
-
agentId?: UUID$1;
|
|
1343
|
-
character?: Character;
|
|
1344
|
-
token: string;
|
|
1345
|
-
serverUrl?: string;
|
|
1346
|
-
actions?: Action[];
|
|
1347
|
-
evaluators?: Evaluator[];
|
|
1348
|
-
plugins?: Plugin[];
|
|
1349
|
-
providers?: Provider$1[];
|
|
1350
|
-
modelProvider: ModelProviderName;
|
|
1351
|
-
services?: Service[];
|
|
1352
|
-
managers?: IMemoryManager[];
|
|
1353
|
-
databaseAdapter?: IDatabaseAdapter;
|
|
1354
|
-
fetch?: typeof fetch | unknown;
|
|
1355
|
-
speechModelPath?: string;
|
|
1356
|
-
cacheManager?: ICacheManager;
|
|
1357
|
-
logging?: boolean;
|
|
1358
|
-
});
|
|
1359
|
-
initialize(): Promise<any>;
|
|
1360
|
-
stop(): Promise<any>;
|
|
1361
|
-
getSetting(key: string): any;
|
|
1362
|
-
/**
|
|
1363
|
-
* Get the number of messages that are kept in the conversation buffer.
|
|
1364
|
-
* @returns The number of recent messages to be kept in memory.
|
|
1365
|
-
*/
|
|
1366
|
-
getConversationLength(): any;
|
|
1367
|
-
/**
|
|
1368
|
-
* Register an action for the agent to perform.
|
|
1369
|
-
* @param action The action to register.
|
|
1370
|
-
*/
|
|
1371
|
-
registerAction(action: Action): any;
|
|
1372
|
-
/**
|
|
1373
|
-
* Register an evaluator to assess and guide the agent's responses.
|
|
1374
|
-
* @param evaluator The evaluator to register.
|
|
1375
|
-
*/
|
|
1376
|
-
registerEvaluator(evaluator: Evaluator): any;
|
|
1377
|
-
/**
|
|
1378
|
-
* Register a context provider to provide context for message generation.
|
|
1379
|
-
* @param provider The context provider to register.
|
|
1380
|
-
*/
|
|
1381
|
-
registerContextProvider(provider: Provider$1): any;
|
|
1382
|
-
/**
|
|
1383
|
-
* Register an adapter for the agent to use.
|
|
1384
|
-
* @param adapter The adapter to register.
|
|
1385
|
-
*/
|
|
1386
|
-
registerAdapter(adapter: Adapter): void;
|
|
1387
|
-
/**
|
|
1388
|
-
* Process the actions of a message.
|
|
1389
|
-
* @param message The message to process.
|
|
1390
|
-
* @param content The content of the message to process actions from.
|
|
1391
|
-
*/
|
|
1392
|
-
processActions(message: Memory, responses: Memory[], state?: State$1, callback?: HandlerCallback): Promise<void>;
|
|
1393
|
-
/**
|
|
1394
|
-
* Evaluate the message and state using the registered evaluators.
|
|
1395
|
-
* @param message The message to evaluate.
|
|
1396
|
-
* @param state The state of the agent.
|
|
1397
|
-
* @param didRespond Whether the agent responded to the message.~
|
|
1398
|
-
* @param callback The handler callback
|
|
1399
|
-
* @returns The results of the evaluation.
|
|
1400
|
-
*/
|
|
1401
|
-
evaluate(message: Memory, state: State$1, didRespond?: boolean, callback?: HandlerCallback): Promise<any>;
|
|
1402
|
-
/**
|
|
1403
|
-
* Ensure the existence of a participant in the room. If the participant does not exist, they are added to the room.
|
|
1404
|
-
* @param userId - The user ID to ensure the existence of.
|
|
1405
|
-
* @throws An error if the participant cannot be added.
|
|
1406
|
-
*/
|
|
1407
|
-
ensureParticipantExists(userId: UUID$1, roomId: UUID$1): Promise<void>;
|
|
1408
|
-
/**
|
|
1409
|
-
* Ensure the existence of a user in the database. If the user does not exist, they are added to the database.
|
|
1410
|
-
* @param userId - The user ID to ensure the existence of.
|
|
1411
|
-
* @param userName - The user name to ensure the existence of.
|
|
1412
|
-
* @returns
|
|
1413
|
-
*/
|
|
1414
|
-
ensureUserExists(userId: UUID$1, userName: string | null, name: string | null, email?: string | null, source?: string | null): Promise<void>;
|
|
1415
|
-
ensureParticipantInRoom(userId: UUID$1, roomId: UUID$1): Promise<any>;
|
|
1416
|
-
ensureConnection(userId: UUID$1, roomId: UUID$1, userName?: string, userScreenName?: string, source?: string): Promise<any>;
|
|
1417
|
-
/**
|
|
1418
|
-
* Ensure the existence of a room between the agent and a user. If no room exists, a new room is created and the user
|
|
1419
|
-
* and agent are added as participants. The room ID is returned.
|
|
1420
|
-
* @param roomId - The room ID to create a room with.
|
|
1421
|
-
* @returns The room ID of the room between the agent and the user.
|
|
1422
|
-
* @throws An error if the room cannot be created.
|
|
1423
|
-
*/
|
|
1424
|
-
ensureRoomExists(roomId: UUID$1): Promise<any>;
|
|
1425
|
-
/**
|
|
1426
|
-
* Compose the state of the agent into an object that can be passed or used for response generation.
|
|
1427
|
-
* @param message The message to compose the state from.
|
|
1428
|
-
* @returns The state of the agent.
|
|
1429
|
-
*/
|
|
1430
|
-
composeState(message: Memory, additionalKeys?: {
|
|
1431
|
-
[key: string]: unknown;
|
|
1432
|
-
}): Promise<any>;
|
|
1433
|
-
updateRecentMessageState(state: State$1): Promise<State$1>;
|
|
1434
|
-
}
|
|
1435
|
-
|
|
1436
|
-
/**
|
|
1437
|
-
* Represents the state of a conversation or context
|
|
1438
|
-
* This is a v1 compatibility wrapper for v2 State
|
|
1439
|
-
*/
|
|
1440
|
-
type State = State$1;
|
|
1441
|
-
/**
|
|
1442
|
-
* Converts v2 State to v1 compatible State
|
|
1443
|
-
* Uses the V2 State interface from core-plugin-v2
|
|
1444
|
-
*/
|
|
1445
|
-
declare function fromV2State(stateV2: State$2): State;
|
|
1446
|
-
/**
|
|
1447
|
-
* Converts v1 State to v2 State
|
|
1448
|
-
* Creates a state object conforming to V2 State interface
|
|
1449
|
-
*/
|
|
1450
|
-
declare function toV2State(state: State): State$2;
|
|
1451
|
-
|
|
1452
|
-
/**
|
|
1453
|
-
* Represents a UUID string in the format "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
1454
|
-
* This is a v1 compatibility wrapper for v2 UUID
|
|
1455
|
-
*/
|
|
1456
|
-
type UUID = UUID$1;
|
|
1457
|
-
/**
|
|
1458
|
-
* Helper function to safely cast a string to strongly typed UUID
|
|
1459
|
-
* Wraps V2's validateUuid function
|
|
1460
|
-
*
|
|
1461
|
-
* @param id The string UUID to validate and cast
|
|
1462
|
-
* @returns The same UUID with branded type information
|
|
1463
|
-
* @throws Error if the UUID format is invalid
|
|
1464
|
-
*/
|
|
1465
|
-
declare function asUUID(id: string): UUID;
|
|
1466
|
-
/**
|
|
1467
|
-
* Generates a UUID from a string input
|
|
1468
|
-
* Wraps V2's stringToUuid function
|
|
1469
|
-
*
|
|
1470
|
-
* @param input The string to convert to a UUID
|
|
1471
|
-
* @returns A UUID generated from the input string
|
|
1472
|
-
*/
|
|
1473
|
-
declare function generateUuidFromString(input: string): UUID;
|
|
1474
|
-
|
|
1475
|
-
/**
|
|
1476
|
-
* Example content with associated user for demonstration purposes
|
|
1477
|
-
* This is exported from types.ts in v1, but we're recreating it here for the adapter
|
|
1478
|
-
*/
|
|
1479
|
-
type ActionExample = ActionExample$1;
|
|
1480
|
-
/**
|
|
1481
|
-
* Safely converts a V2 content object to a V1 Content type
|
|
1482
|
-
* Maps known properties and preserves additional ones
|
|
1483
|
-
*
|
|
1484
|
-
* @param content V2 content object
|
|
1485
|
-
* @returns Content compatible with V1
|
|
1486
|
-
*/
|
|
1487
|
-
declare function convertContentToV1(content: Content$1): Content;
|
|
1488
|
-
/**
|
|
1489
|
-
* Safely converts a V1 Content object to a V2 compatible content type
|
|
1490
|
-
* Maps known properties and preserves additional ones
|
|
1491
|
-
*
|
|
1492
|
-
* @param content V1 Content object
|
|
1493
|
-
* @returns Content compatible with V2
|
|
1494
|
-
*/
|
|
1495
|
-
declare function convertContentToV2(content: Content): Content$1;
|
|
1496
|
-
/**
|
|
1497
|
-
* Converts v2 ActionExample to v1 compatible ActionExample
|
|
1498
|
-
*
|
|
1499
|
-
* @param exampleV2 The V2 action example to convert
|
|
1500
|
-
* @returns V1 compatible ActionExample
|
|
1501
|
-
*/
|
|
1502
|
-
declare function fromV2ActionExample(exampleV2: ActionExample$2): ActionExample;
|
|
1503
|
-
/**
|
|
1504
|
-
* Converts v1 ActionExample to v2 ActionExample
|
|
1505
|
-
*
|
|
1506
|
-
* @param example The V1 action example to convert
|
|
1507
|
-
* @returns V2 compatible ActionExample
|
|
1508
|
-
*/
|
|
1509
|
-
declare function toV2ActionExample(example: ActionExample): ActionExample$2;
|
|
1510
|
-
|
|
1511
|
-
/**
|
|
1512
|
-
* Provider for external data/services
|
|
1513
|
-
* This is a v1 compatibility wrapper for v2 Provider
|
|
1514
|
-
*/
|
|
1515
|
-
type Provider = Provider$1;
|
|
1516
|
-
/**
|
|
1517
|
-
* Converts v2 Provider to v1 compatible Provider
|
|
1518
|
-
* Uses the V2 Provider interface to ensure proper optional field handling
|
|
1519
|
-
*/
|
|
1520
|
-
declare function fromV2Provider(providerV2: Provider$2): Provider;
|
|
1521
|
-
/**
|
|
1522
|
-
* Converts v1 Provider to v2 Provider
|
|
1523
|
-
* Creates a Provider object conforming to V2 Provider interface
|
|
1524
|
-
*/
|
|
1525
|
-
declare function toV2Provider(provider: Provider): Provider$2;
|
|
1526
|
-
|
|
1527
|
-
/**
|
|
1528
|
-
* Template type definition for v1 compatibility
|
|
1529
|
-
* A template can be either a string or a function that takes state and returns a string
|
|
1530
|
-
* This aligns with V2's TemplateType
|
|
1531
|
-
*/
|
|
1532
|
-
type TemplateType = string | ((options: {
|
|
1533
|
-
state: State;
|
|
1534
|
-
}) => string);
|
|
1535
|
-
/**
|
|
1536
|
-
* Generic template values interface for typed access to state.values
|
|
1537
|
-
* Users can extend this interface for type safety in their templates
|
|
1538
|
-
*/
|
|
1539
|
-
interface TemplateValues {
|
|
1540
|
-
[key: string]: unknown;
|
|
1541
|
-
}
|
|
1542
|
-
/**
|
|
1543
|
-
* Create a template function from a v1 template
|
|
1544
|
-
* @param template The v1 template (string or function)
|
|
1545
|
-
* @returns A function that processes the template with the given state
|
|
1546
|
-
*/
|
|
1547
|
-
declare function createTemplateFunction(template: TemplateType): (state: State) => string;
|
|
1548
|
-
/**
|
|
1549
|
-
* Process a template with the given state
|
|
1550
|
-
* @param template The template to process (string or function)
|
|
1551
|
-
* @param state The state to use for processing
|
|
1552
|
-
* @returns The processed template string
|
|
1553
|
-
*/
|
|
1554
|
-
declare function processTemplate(template: TemplateType, state: State): string;
|
|
1555
|
-
/**
|
|
1556
|
-
* Type-safe accessor for template values
|
|
1557
|
-
* @param state The state containing the values
|
|
1558
|
-
* @param defaultValues Optional default values to use if values are missing
|
|
1559
|
-
* @returns The values object with type information
|
|
1560
|
-
*/
|
|
1561
|
-
declare function getTemplateValues<T extends TemplateValues>(state: State, defaultValues?: Partial<T>): T;
|
|
1562
|
-
|
|
1563
|
-
type index_Account = Account;
|
|
1564
|
-
type index_Action = Action;
|
|
1565
|
-
type index_ActionExample = ActionExample;
|
|
1566
|
-
type index_ActionResponse = ActionResponse;
|
|
1567
|
-
type index_ActionTimelineType = ActionTimelineType;
|
|
1568
|
-
declare const index_ActionTimelineType: typeof ActionTimelineType;
|
|
1569
|
-
type index_Actor = Actor;
|
|
1570
|
-
type index_Adapter = Adapter;
|
|
1571
|
-
type index_AgentRuntime = AgentRuntime;
|
|
1572
|
-
declare const index_AgentRuntime: typeof AgentRuntime;
|
|
1573
|
-
type index_CacheKeyPrefix = CacheKeyPrefix;
|
|
1574
|
-
declare const index_CacheKeyPrefix: typeof CacheKeyPrefix;
|
|
1575
|
-
type index_CacheOptions = CacheOptions;
|
|
1576
|
-
type index_CacheStore = CacheStore;
|
|
1577
|
-
declare const index_CacheStore: typeof CacheStore;
|
|
1578
|
-
type index_Character = Character;
|
|
1579
|
-
type index_ChunkRow = ChunkRow;
|
|
1580
|
-
type index_Client = Client;
|
|
1581
|
-
type index_ClientInstance = ClientInstance;
|
|
1582
|
-
type index_Content = Content;
|
|
1583
|
-
type index_ConversationExample = ConversationExample;
|
|
1584
|
-
type index_DataIrysFetchedFromGQL = DataIrysFetchedFromGQL;
|
|
1585
|
-
type index_DirectoryItem = DirectoryItem;
|
|
1586
|
-
type index_EmbeddingModelSettings = EmbeddingModelSettings;
|
|
1587
|
-
type index_EvaluationExample = EvaluationExample;
|
|
1588
|
-
type index_Evaluator = Evaluator;
|
|
1589
|
-
type index_Goal = Goal;
|
|
1590
|
-
type index_GoalStatus = GoalStatus;
|
|
1591
|
-
declare const index_GoalStatus: typeof GoalStatus;
|
|
1592
|
-
type index_GraphQLTag = GraphQLTag;
|
|
1593
|
-
type index_Handler = Handler;
|
|
1594
|
-
type index_HandlerCallback = HandlerCallback;
|
|
1595
|
-
type index_IAgentConfig = IAgentConfig;
|
|
1596
|
-
type index_IAgentRuntime = IAgentRuntime;
|
|
1597
|
-
type index_IAwsS3Service = IAwsS3Service;
|
|
1598
|
-
type index_IBrowserService = IBrowserService;
|
|
1599
|
-
type index_ICacheManager = ICacheManager;
|
|
1600
|
-
type index_IDatabaseAdapter = IDatabaseAdapter;
|
|
1601
|
-
type index_IDatabaseCacheAdapter = IDatabaseCacheAdapter;
|
|
1602
|
-
type index_IImageDescriptionService = IImageDescriptionService;
|
|
1603
|
-
type index_IIrysService = IIrysService;
|
|
1604
|
-
type index_IMemoryManager = IMemoryManager;
|
|
1605
|
-
type index_IPdfService = IPdfService;
|
|
1606
|
-
type index_IRAGKnowledgeManager = IRAGKnowledgeManager;
|
|
1607
|
-
type index_ISlackService = ISlackService;
|
|
1608
|
-
type index_ISpeechService = ISpeechService;
|
|
1609
|
-
type index_ITeeLogService = ITeeLogService;
|
|
1610
|
-
type index_ITextGenerationService = ITextGenerationService;
|
|
1611
|
-
type index_ITranscriptionService = ITranscriptionService;
|
|
1612
|
-
type index_IVideoService = IVideoService;
|
|
1613
|
-
type index_ImageModelSettings = ImageModelSettings;
|
|
1614
|
-
type index_IrysDataType = IrysDataType;
|
|
1615
|
-
declare const index_IrysDataType: typeof IrysDataType;
|
|
1616
|
-
type index_IrysMessageType = IrysMessageType;
|
|
1617
|
-
declare const index_IrysMessageType: typeof IrysMessageType;
|
|
1618
|
-
type index_IrysTimestamp = IrysTimestamp;
|
|
1619
|
-
type index_KnowledgeItem = KnowledgeItem;
|
|
1620
|
-
type index_KnowledgeScope = KnowledgeScope;
|
|
1621
|
-
declare const index_KnowledgeScope: typeof KnowledgeScope;
|
|
1622
|
-
type index_LoggingLevel = LoggingLevel;
|
|
1623
|
-
declare const index_LoggingLevel: typeof LoggingLevel;
|
|
1624
|
-
type index_Media = Media;
|
|
1625
|
-
type index_Memory = Memory;
|
|
1626
|
-
type index_MessageExample = MessageExample;
|
|
1627
|
-
type index_Model = Model;
|
|
1628
|
-
type index_ModelClass = ModelClass;
|
|
1629
|
-
declare const index_ModelClass: typeof ModelClass;
|
|
1630
|
-
type index_ModelConfiguration = ModelConfiguration;
|
|
1631
|
-
type index_ModelProviderName = ModelProviderName;
|
|
1632
|
-
declare const index_ModelProviderName: typeof ModelProviderName;
|
|
1633
|
-
type index_ModelSettings = ModelSettings;
|
|
1634
|
-
type index_Models = Models;
|
|
1635
|
-
type index_Objective = Objective;
|
|
1636
|
-
type index_Participant = Participant;
|
|
1637
|
-
type index_Plugin = Plugin;
|
|
1638
|
-
type index_Provider = Provider;
|
|
1639
|
-
type index_RAGKnowledgeItem = RAGKnowledgeItem;
|
|
1640
|
-
type index_Relationship = Relationship;
|
|
1641
|
-
type index_Room = Room;
|
|
1642
|
-
type index_Service = Service;
|
|
1643
|
-
declare const index_Service: typeof Service;
|
|
1644
|
-
type index_ServiceType = ServiceType;
|
|
1645
|
-
declare const index_ServiceType: typeof ServiceType;
|
|
1646
|
-
type index_State = State;
|
|
1647
|
-
type index_TelemetrySettings = TelemetrySettings;
|
|
1648
|
-
type index_TemplateType = TemplateType;
|
|
1649
|
-
type index_TokenizerType = TokenizerType;
|
|
1650
|
-
declare const index_TokenizerType: typeof TokenizerType;
|
|
1651
|
-
type index_TranscriptionProvider = TranscriptionProvider;
|
|
1652
|
-
declare const index_TranscriptionProvider: typeof TranscriptionProvider;
|
|
1653
|
-
type index_TwitterSpaceDecisionOptions = TwitterSpaceDecisionOptions;
|
|
1654
|
-
type index_UploadIrysResult = UploadIrysResult;
|
|
1655
|
-
type index_Validator = Validator;
|
|
1656
|
-
declare const index_asUUID: typeof asUUID;
|
|
1657
|
-
declare const index_convertContentToV1: typeof convertContentToV1;
|
|
1658
|
-
declare const index_convertContentToV2: typeof convertContentToV2;
|
|
1659
|
-
declare const index_createTemplateFunction: typeof createTemplateFunction;
|
|
1660
|
-
declare const index_formatActors: typeof formatActors;
|
|
1661
|
-
declare const index_formatMessages: typeof formatMessages;
|
|
1662
|
-
declare const index_formatPosts: typeof formatPosts;
|
|
1663
|
-
declare const index_formatTimestamp: typeof formatTimestamp;
|
|
1664
|
-
declare const index_fromV2ActionExample: typeof fromV2ActionExample;
|
|
1665
|
-
declare const index_fromV2Provider: typeof fromV2Provider;
|
|
1666
|
-
declare const index_fromV2State: typeof fromV2State;
|
|
1667
|
-
declare const index_generateUuidFromString: typeof generateUuidFromString;
|
|
1668
|
-
declare const index_getActorDetails: typeof getActorDetails;
|
|
1669
|
-
declare const index_getTemplateValues: typeof getTemplateValues;
|
|
1670
|
-
declare const index_processTemplate: typeof processTemplate;
|
|
1671
|
-
declare const index_toV2ActionExample: typeof toV2ActionExample;
|
|
1672
|
-
declare const index_toV2Provider: typeof toV2Provider;
|
|
1673
|
-
declare const index_toV2State: typeof toV2State;
|
|
1674
|
-
declare namespace index {
|
|
1675
|
-
export { type index_Account as Account, type index_Action as Action, type index_ActionExample as ActionExample, type index_ActionResponse as ActionResponse, index_ActionTimelineType as ActionTimelineType, type index_Actor as Actor, type index_Adapter as Adapter, index_AgentRuntime as AgentRuntime, index_CacheKeyPrefix as CacheKeyPrefix, type index_CacheOptions as CacheOptions, index_CacheStore as CacheStore, type index_Character as Character, type index_ChunkRow as ChunkRow, type index_Client as Client, type index_ClientInstance as ClientInstance, type index_Content as Content, type index_ConversationExample as ConversationExample, type index_DataIrysFetchedFromGQL as DataIrysFetchedFromGQL, type index_DirectoryItem as DirectoryItem, type index_EmbeddingModelSettings as EmbeddingModelSettings, type index_EvaluationExample as EvaluationExample, type index_Evaluator as Evaluator, type index_Goal as Goal, index_GoalStatus as GoalStatus, type index_GraphQLTag as GraphQLTag, type index_Handler as Handler, type index_HandlerCallback as HandlerCallback, type index_IAgentConfig as IAgentConfig, type index_IAgentRuntime as IAgentRuntime, type index_IAwsS3Service as IAwsS3Service, type index_IBrowserService as IBrowserService, type index_ICacheManager as ICacheManager, type index_IDatabaseAdapter as IDatabaseAdapter, type index_IDatabaseCacheAdapter as IDatabaseCacheAdapter, type index_IImageDescriptionService as IImageDescriptionService, type index_IIrysService as IIrysService, type index_IMemoryManager as IMemoryManager, type index_IPdfService as IPdfService, type index_IRAGKnowledgeManager as IRAGKnowledgeManager, type index_ISlackService as ISlackService, type index_ISpeechService as ISpeechService, type index_ITeeLogService as ITeeLogService, type index_ITextGenerationService as ITextGenerationService, type index_ITranscriptionService as ITranscriptionService, type index_IVideoService as IVideoService, type index_ImageModelSettings as ImageModelSettings, index_IrysDataType as IrysDataType, index_IrysMessageType as IrysMessageType, type index_IrysTimestamp as IrysTimestamp, type index_KnowledgeItem as KnowledgeItem, index_KnowledgeScope as KnowledgeScope, index_LoggingLevel as LoggingLevel, type index_Media as Media, type index_Memory as Memory, type index_MessageExample as MessageExample, type index_Model as Model, index_ModelClass as ModelClass, type index_ModelConfiguration as ModelConfiguration, index_ModelProviderName as ModelProviderName, type index_ModelSettings as ModelSettings, type index_Models as Models, type index_Objective as Objective, type index_Participant as Participant, type index_Plugin as Plugin, type index_Provider as Provider, type index_RAGKnowledgeItem as RAGKnowledgeItem, type index_Relationship as Relationship, type index_Room as Room, index_Service as Service, index_ServiceType as ServiceType, type index_State as State, type index_TelemetrySettings as TelemetrySettings, type index_TemplateType as TemplateType, index_TokenizerType as TokenizerType, index_TranscriptionProvider as TranscriptionProvider, type index_TwitterSpaceDecisionOptions as TwitterSpaceDecisionOptions, type UUID$1 as UUID, type index_UploadIrysResult as UploadIrysResult, type index_Validator as Validator, index_asUUID as asUUID, index_convertContentToV1 as convertContentToV1, index_convertContentToV2 as convertContentToV2, index_createTemplateFunction as createTemplateFunction, index_formatActors as formatActors, index_formatMessages as formatMessages, index_formatPosts as formatPosts, index_formatTimestamp as formatTimestamp, index_fromV2ActionExample as fromV2ActionExample, index_fromV2Provider as fromV2Provider, index_fromV2State as fromV2State, index_generateUuidFromString as generateUuidFromString, index_getActorDetails as getActorDetails, index_getTemplateValues as getTemplateValues, index_processTemplate as processTemplate, index_toV2ActionExample as toV2ActionExample, index_toV2Provider as toV2Provider, index_toV2State as toV2State };
|
|
1676
|
-
}
|
|
1677
|
-
|
|
1678
|
-
export { type Adapter as $, type ActionExample as A, ModelProviderName as B, type Content as C, type Memory as D, type EmbeddingModelSettings as E, type MessageExample as F, GoalStatus as G, type Handler as H, type ImageModelSettings as I, type HandlerCallback as J, type Action as K, type EvaluationExample as L, ModelClass as M, type Evaluator as N, type Objective as O, type Provider as P, type Account as Q, type Relationship as R, type State as S, type TemplateType as T, type UUID$1 as U, type Validator as V, type Participant as W, type Room as X, type Media as Y, type ClientInstance as Z, type Client as _, asUUID as a, type Plugin as a0, type IAgentConfig as a1, type TelemetrySettings as a2, type ModelConfiguration as a3, type Character as a4, type TwitterSpaceDecisionOptions as a5, type IDatabaseAdapter as a6, type IDatabaseCacheAdapter as a7, type IMemoryManager as a8, type IRAGKnowledgeManager as a9, type ISlackService as aA, TokenizerType as aB, TranscriptionProvider as aC, ActionTimelineType as aD, KnowledgeScope as aE, CacheKeyPrefix as aF, type DirectoryItem as aG, type ChunkRow as aH, type CacheOptions as aa, CacheStore as ab, type ICacheManager as ac, Service as ad, type IAgentRuntime as ae, type IImageDescriptionService as af, type ITranscriptionService as ag, type IVideoService as ah, type ITextGenerationService as ai, type IBrowserService as aj, type ISpeechService as ak, type IPdfService as al, type IAwsS3Service as am, type UploadIrysResult as an, type DataIrysFetchedFromGQL as ao, type GraphQLTag as ap, IrysMessageType as aq, IrysDataType as ar, type IrysTimestamp as as, type IIrysService as at, type ITeeLogService as au, ServiceType as av, LoggingLevel as aw, type KnowledgeItem as ax, type RAGKnowledgeItem as ay, type ActionResponse as az, fromV2ActionExample as b, toV2ActionExample as c, convertContentToV1 as d, convertContentToV2 as e, fromV2State as f, generateUuidFromString as g, fromV2Provider as h, index as i, toV2Provider as j, createTemplateFunction as k, getTemplateValues as l, getActorDetails as m, formatActors as n, formatMessages as o, processTemplate as p, formatTimestamp as q, formatPosts as r, AgentRuntime as s, toV2State as t, type ConversationExample as u, type Actor as v, type Goal as w, type ModelSettings as x, type Model as y, type Models as z };
|
|
1260
|
+
export { type Account, type Action, type ActionExample, type ActionResponse, ActionTimelineType, type Actor, type Adapter, CacheKeyPrefix, type CacheOptions, CacheStore, type Character, type ChunkRow, type Client, type ClientInstance, type Content, type ConversationExample, type DataIrysFetchedFromGQL, type DirectoryItem, type EmbeddingModelSettings, type EvaluationExample, type Evaluator, type Goal, GoalStatus, type GraphQLTag, type Handler, type HandlerCallback, type IAgentConfig, type IAgentRuntime, type IAwsS3Service, type IBrowserService, type ICacheManager, type IDatabaseAdapter, type IDatabaseCacheAdapter, type IImageDescriptionService, type IIrysService, type IMemoryManager, type IPdfService, type IRAGKnowledgeManager, type ISlackService, type ISpeechService, type ITeeLogService, type ITextGenerationService, type ITranscriptionService, type IVideoService, type ImageModelSettings, IrysDataType, IrysMessageType, type IrysTimestamp, type KnowledgeItem, KnowledgeScope, LoggingLevel, type Media, type Memory, type MessageExample, type Model, ModelClass, type ModelConfiguration, ModelProviderName, type ModelSettings, type Models, type Objective, type Participant, type Plugin, type Provider, type RAGKnowledgeItem, type Relationship, type Room, Service, ServiceType, type State, type TelemetrySettings, type TemplateType, TokenizerType, TranscriptionProvider, type TwitterSpaceDecisionOptions, type UUID, type UploadIrysResult, type Validator };
|