@elizaos/core 0.1.8 → 0.1.9
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/LICENSE +2 -2
- package/dist/_esm-FVHF6KDD.js +3913 -0
- package/dist/_esm-FVHF6KDD.js.map +1 -0
- package/dist/ccip-RMGHL4BL.js +14 -0
- package/dist/ccip-RMGHL4BL.js.map +1 -0
- package/dist/chunk-4L6P6TY5.js +2556 -0
- package/dist/chunk-4L6P6TY5.js.map +1 -0
- package/dist/chunk-BEDRBX3Q.js +4821 -0
- package/dist/chunk-BEDRBX3Q.js.map +1 -0
- package/dist/chunk-PR4QN5HX.js +43 -0
- package/dist/chunk-PR4QN5HX.js.map +1 -0
- package/dist/index.d.ts +205 -78
- package/dist/index.js +7298 -942
- package/dist/index.js.map +1 -1
- package/dist/secp256k1-QUTB2QC2.js +14 -0
- package/dist/secp256k1-QUTB2QC2.js.map +1 -0
- package/package.json +95 -94
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Readable } from 'stream';
|
|
2
2
|
import { GenerateObjectResult, CoreTool, StepResult as StepResult$1 } from 'ai';
|
|
3
3
|
import { ZodSchema, z } from 'zod';
|
|
4
|
+
import * as pino from 'pino';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Represents a UUID string in the format "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
@@ -169,6 +170,7 @@ type Models = {
|
|
|
169
170
|
[ModelProviderName.LLAMACLOUD]: Model;
|
|
170
171
|
[ModelProviderName.TOGETHER]: Model;
|
|
171
172
|
[ModelProviderName.LLAMALOCAL]: Model;
|
|
173
|
+
[ModelProviderName.LMSTUDIO]: Model;
|
|
172
174
|
[ModelProviderName.GOOGLE]: Model;
|
|
173
175
|
[ModelProviderName.MISTRAL]: Model;
|
|
174
176
|
[ModelProviderName.CLAUDE_VERTEX]: Model;
|
|
@@ -184,11 +186,14 @@ type Models = {
|
|
|
184
186
|
[ModelProviderName.NANOGPT]: Model;
|
|
185
187
|
[ModelProviderName.HYPERBOLIC]: Model;
|
|
186
188
|
[ModelProviderName.VENICE]: Model;
|
|
189
|
+
[ModelProviderName.NVIDIA]: Model;
|
|
187
190
|
[ModelProviderName.NINETEEN_AI]: Model;
|
|
188
191
|
[ModelProviderName.AKASH_CHAT_API]: Model;
|
|
189
192
|
[ModelProviderName.LIVEPEER]: Model;
|
|
190
193
|
[ModelProviderName.DEEPSEEK]: Model;
|
|
191
194
|
[ModelProviderName.INFERA]: Model;
|
|
195
|
+
[ModelProviderName.BEDROCK]: Model;
|
|
196
|
+
[ModelProviderName.ATOMA]: Model;
|
|
192
197
|
};
|
|
193
198
|
/**
|
|
194
199
|
* Available model providers
|
|
@@ -202,6 +207,7 @@ declare enum ModelProviderName {
|
|
|
202
207
|
LLAMACLOUD = "llama_cloud",
|
|
203
208
|
TOGETHER = "together",
|
|
204
209
|
LLAMALOCAL = "llama_local",
|
|
210
|
+
LMSTUDIO = "lmstudio",
|
|
205
211
|
GOOGLE = "google",
|
|
206
212
|
MISTRAL = "mistral",
|
|
207
213
|
CLAUDE_VERTEX = "claude_vertex",
|
|
@@ -217,12 +223,15 @@ declare enum ModelProviderName {
|
|
|
217
223
|
NANOGPT = "nanogpt",
|
|
218
224
|
HYPERBOLIC = "hyperbolic",
|
|
219
225
|
VENICE = "venice",
|
|
226
|
+
NVIDIA = "nvidia",
|
|
220
227
|
NINETEEN_AI = "nineteen_ai",
|
|
221
228
|
AKASH_CHAT_API = "akash_chat_api",
|
|
222
229
|
LIVEPEER = "livepeer",
|
|
223
230
|
LETZAI = "letzai",
|
|
224
231
|
DEEPSEEK = "deepseek",
|
|
225
|
-
INFERA = "infera"
|
|
232
|
+
INFERA = "infera",
|
|
233
|
+
BEDROCK = "bedrock",
|
|
234
|
+
ATOMA = "atoma"
|
|
226
235
|
}
|
|
227
236
|
/**
|
|
228
237
|
* Represents the current state/context of a conversation
|
|
@@ -494,15 +503,21 @@ type Plugin = {
|
|
|
494
503
|
* Available client platforms
|
|
495
504
|
*/
|
|
496
505
|
declare enum Clients {
|
|
506
|
+
ALEXA = "alexa",
|
|
497
507
|
DISCORD = "discord",
|
|
498
508
|
DIRECT = "direct",
|
|
499
509
|
TWITTER = "twitter",
|
|
500
510
|
TELEGRAM = "telegram",
|
|
511
|
+
TELEGRAM_ACCOUNT = "telegram-account",
|
|
501
512
|
FARCASTER = "farcaster",
|
|
502
513
|
LENS = "lens",
|
|
503
514
|
AUTO = "auto",
|
|
504
515
|
SLACK = "slack",
|
|
505
|
-
GITHUB = "github"
|
|
516
|
+
GITHUB = "github",
|
|
517
|
+
INSTAGRAM = "instagram",
|
|
518
|
+
SIMSAI = "simsai",
|
|
519
|
+
XMTP = "xmtp",
|
|
520
|
+
DEVA = "deva"
|
|
506
521
|
}
|
|
507
522
|
interface IAgentConfig {
|
|
508
523
|
[key: string]: string;
|
|
@@ -552,6 +567,8 @@ type Character = {
|
|
|
552
567
|
name: string;
|
|
553
568
|
/** Optional username */
|
|
554
569
|
username?: string;
|
|
570
|
+
/** Optional email */
|
|
571
|
+
email?: string;
|
|
555
572
|
/** Optional system prompt */
|
|
556
573
|
system?: string;
|
|
557
574
|
/** Model provider to use */
|
|
@@ -575,6 +592,10 @@ type Character = {
|
|
|
575
592
|
twitterPostTemplate?: TemplateType;
|
|
576
593
|
twitterMessageHandlerTemplate?: TemplateType;
|
|
577
594
|
twitterShouldRespondTemplate?: TemplateType;
|
|
595
|
+
twitterVoiceHandlerTemplate?: TemplateType;
|
|
596
|
+
instagramPostTemplate?: TemplateType;
|
|
597
|
+
instagramMessageHandlerTemplate?: TemplateType;
|
|
598
|
+
instagramShouldRespondTemplate?: TemplateType;
|
|
578
599
|
farcasterPostTemplate?: TemplateType;
|
|
579
600
|
lensPostTemplate?: TemplateType;
|
|
580
601
|
farcasterMessageHandlerTemplate?: TemplateType;
|
|
@@ -583,11 +604,21 @@ type Character = {
|
|
|
583
604
|
lensShouldRespondTemplate?: TemplateType;
|
|
584
605
|
telegramMessageHandlerTemplate?: TemplateType;
|
|
585
606
|
telegramShouldRespondTemplate?: TemplateType;
|
|
607
|
+
telegramAutoPostTemplate?: string;
|
|
608
|
+
telegramPinnedMessageTemplate?: string;
|
|
609
|
+
discordAutoPostTemplate?: string;
|
|
610
|
+
discordAnnouncementHypeTemplate?: string;
|
|
586
611
|
discordVoiceHandlerTemplate?: TemplateType;
|
|
587
612
|
discordShouldRespondTemplate?: TemplateType;
|
|
588
613
|
discordMessageHandlerTemplate?: TemplateType;
|
|
589
614
|
slackMessageHandlerTemplate?: TemplateType;
|
|
590
615
|
slackShouldRespondTemplate?: TemplateType;
|
|
616
|
+
jeeterPostTemplate?: string;
|
|
617
|
+
jeeterSearchTemplate?: string;
|
|
618
|
+
jeeterInteractionTemplate?: string;
|
|
619
|
+
jeeterMessageHandlerTemplate?: string;
|
|
620
|
+
jeeterShouldRespondTemplate?: string;
|
|
621
|
+
devaPostTemplate?: string;
|
|
591
622
|
};
|
|
592
623
|
/** Character biography */
|
|
593
624
|
bio: string | string[];
|
|
@@ -620,6 +651,7 @@ type Character = {
|
|
|
620
651
|
steps?: number;
|
|
621
652
|
width?: number;
|
|
622
653
|
height?: number;
|
|
654
|
+
cfgScale?: number;
|
|
623
655
|
negativePrompt?: string;
|
|
624
656
|
numIterations?: number;
|
|
625
657
|
guidanceScale?: number;
|
|
@@ -629,6 +661,7 @@ type Character = {
|
|
|
629
661
|
count?: number;
|
|
630
662
|
stylePreset?: string;
|
|
631
663
|
hideWatermark?: boolean;
|
|
664
|
+
safeMode?: boolean;
|
|
632
665
|
};
|
|
633
666
|
voice?: {
|
|
634
667
|
model?: string;
|
|
@@ -664,6 +697,15 @@ type Character = {
|
|
|
664
697
|
teamAgentIds?: string[];
|
|
665
698
|
teamLeaderId?: string;
|
|
666
699
|
teamMemberInterestKeywords?: string[];
|
|
700
|
+
allowedChannelIds?: string[];
|
|
701
|
+
autoPost?: {
|
|
702
|
+
enabled?: boolean;
|
|
703
|
+
monitorTime?: number;
|
|
704
|
+
inactivityThreshold?: number;
|
|
705
|
+
mainChannelId?: string;
|
|
706
|
+
announcementChannelIds?: string[];
|
|
707
|
+
minTimeBetweenPosts?: number;
|
|
708
|
+
};
|
|
667
709
|
};
|
|
668
710
|
telegram?: {
|
|
669
711
|
shouldIgnoreBotMessages?: boolean;
|
|
@@ -676,6 +718,14 @@ type Character = {
|
|
|
676
718
|
teamAgentIds?: string[];
|
|
677
719
|
teamLeaderId?: string;
|
|
678
720
|
teamMemberInterestKeywords?: string[];
|
|
721
|
+
autoPost?: {
|
|
722
|
+
enabled?: boolean;
|
|
723
|
+
monitorTime?: number;
|
|
724
|
+
inactivityThreshold?: number;
|
|
725
|
+
mainChannelId?: string;
|
|
726
|
+
pinnedMessagesGroups?: string[];
|
|
727
|
+
minTimeBetweenPosts?: number;
|
|
728
|
+
};
|
|
679
729
|
};
|
|
680
730
|
slack?: {
|
|
681
731
|
shouldIgnoreBotMessages?: boolean;
|
|
@@ -703,13 +753,43 @@ type Character = {
|
|
|
703
753
|
bio: string;
|
|
704
754
|
nicknames?: string[];
|
|
705
755
|
};
|
|
756
|
+
/** Optional Instagram profile */
|
|
757
|
+
instagramProfile?: {
|
|
758
|
+
id: string;
|
|
759
|
+
username: string;
|
|
760
|
+
bio: string;
|
|
761
|
+
nicknames?: string[];
|
|
762
|
+
};
|
|
763
|
+
/** Optional SimsAI profile */
|
|
764
|
+
simsaiProfile?: {
|
|
765
|
+
id: string;
|
|
766
|
+
username: string;
|
|
767
|
+
screenName: string;
|
|
768
|
+
bio: string;
|
|
769
|
+
};
|
|
706
770
|
/** Optional NFT prompt */
|
|
707
771
|
nft?: {
|
|
708
772
|
prompt: string;
|
|
709
773
|
};
|
|
710
774
|
/**Optinal Parent characters to inherit information from */
|
|
711
775
|
extends?: string[];
|
|
776
|
+
twitterSpaces?: TwitterSpaceDecisionOptions;
|
|
712
777
|
};
|
|
778
|
+
interface TwitterSpaceDecisionOptions {
|
|
779
|
+
maxSpeakers?: number;
|
|
780
|
+
topics?: string[];
|
|
781
|
+
typicalDurationMinutes?: number;
|
|
782
|
+
idleKickTimeoutMs?: number;
|
|
783
|
+
minIntervalBetweenSpacesMinutes?: number;
|
|
784
|
+
businessHoursOnly?: boolean;
|
|
785
|
+
randomChance?: number;
|
|
786
|
+
enableIdleMonitor?: boolean;
|
|
787
|
+
enableSttTts?: boolean;
|
|
788
|
+
enableRecording?: boolean;
|
|
789
|
+
voiceId?: string;
|
|
790
|
+
sttLanguage?: string;
|
|
791
|
+
speakerMaxDurationMs?: number;
|
|
792
|
+
}
|
|
713
793
|
/**
|
|
714
794
|
* Interface for database operations
|
|
715
795
|
*/
|
|
@@ -735,6 +815,7 @@ interface IDatabaseAdapter {
|
|
|
735
815
|
end?: number;
|
|
736
816
|
}): Promise<Memory[]>;
|
|
737
817
|
getMemoryById(id: UUID): Promise<Memory | null>;
|
|
818
|
+
getMemoriesByIds(ids: UUID[], tableName?: string): Promise<Memory[]>;
|
|
738
819
|
getMemoriesByRoomIds(params: {
|
|
739
820
|
tableName: string;
|
|
740
821
|
agentId: UUID;
|
|
@@ -912,6 +993,8 @@ interface IRAGKnowledgeManager {
|
|
|
912
993
|
type: "pdf" | "md" | "txt";
|
|
913
994
|
isShared: boolean;
|
|
914
995
|
}): Promise<void>;
|
|
996
|
+
cleanupDeletedKnowledgeFiles(): Promise<void>;
|
|
997
|
+
generateScopedId(path: string, isShared: boolean): UUID;
|
|
915
998
|
}
|
|
916
999
|
type CacheOptions = {
|
|
917
1000
|
expires?: number;
|
|
@@ -1040,12 +1123,12 @@ interface GraphQLTag {
|
|
|
1040
1123
|
name: string;
|
|
1041
1124
|
values: any[];
|
|
1042
1125
|
}
|
|
1043
|
-
declare
|
|
1126
|
+
declare enum IrysMessageType {
|
|
1044
1127
|
REQUEST = "REQUEST",
|
|
1045
1128
|
DATA_STORAGE = "DATA_STORAGE",
|
|
1046
1129
|
REQUEST_RESPONSE = "REQUEST_RESPONSE"
|
|
1047
1130
|
}
|
|
1048
|
-
declare
|
|
1131
|
+
declare enum IrysDataType {
|
|
1049
1132
|
FILE = "FILE",
|
|
1050
1133
|
IMAGE = "IMAGE",
|
|
1051
1134
|
OTHER = "OTHER"
|
|
@@ -1063,25 +1146,6 @@ interface ITeeLogService extends Service {
|
|
|
1063
1146
|
getInstance(): ITeeLogService;
|
|
1064
1147
|
log(agentId: string, roomId: string, userId: string, type: string, content: string): Promise<boolean>;
|
|
1065
1148
|
}
|
|
1066
|
-
type SearchImage = {
|
|
1067
|
-
url: string;
|
|
1068
|
-
description?: string;
|
|
1069
|
-
};
|
|
1070
|
-
type SearchResult = {
|
|
1071
|
-
title: string;
|
|
1072
|
-
url: string;
|
|
1073
|
-
content: string;
|
|
1074
|
-
rawContent?: string;
|
|
1075
|
-
score: number;
|
|
1076
|
-
publishedDate?: string;
|
|
1077
|
-
};
|
|
1078
|
-
type SearchResponse = {
|
|
1079
|
-
answer?: string;
|
|
1080
|
-
query: string;
|
|
1081
|
-
responseTime: number;
|
|
1082
|
-
images: SearchImage[];
|
|
1083
|
-
results: SearchResult[];
|
|
1084
|
-
};
|
|
1085
1149
|
declare enum ServiceType {
|
|
1086
1150
|
IMAGE_DESCRIPTION = "image_description",
|
|
1087
1151
|
TRANSCRIPTION = "transcription",
|
|
@@ -1094,9 +1158,12 @@ declare enum ServiceType {
|
|
|
1094
1158
|
AWS_S3 = "aws_s3",
|
|
1095
1159
|
BUTTPLUG = "buttplug",
|
|
1096
1160
|
SLACK = "slack",
|
|
1161
|
+
VERIFIABLE_LOGGING = "verifiable_logging",
|
|
1097
1162
|
IRYS = "irys",
|
|
1098
1163
|
TEE_LOG = "tee_log",
|
|
1099
|
-
GOPLUS_SECURITY = "goplus_security"
|
|
1164
|
+
GOPLUS_SECURITY = "goplus_security",
|
|
1165
|
+
WEB_SEARCH = "web_search",
|
|
1166
|
+
EMAIL_AUTOMATION = "email_automation"
|
|
1100
1167
|
}
|
|
1101
1168
|
declare enum LoggingLevel {
|
|
1102
1169
|
DEBUG = "debug",
|
|
@@ -1204,6 +1271,20 @@ declare enum ActionTimelineType {
|
|
|
1204
1271
|
ForYou = "foryou",
|
|
1205
1272
|
Following = "following"
|
|
1206
1273
|
}
|
|
1274
|
+
declare enum KnowledgeScope {
|
|
1275
|
+
SHARED = "shared",
|
|
1276
|
+
PRIVATE = "private"
|
|
1277
|
+
}
|
|
1278
|
+
declare enum CacheKeyPrefix {
|
|
1279
|
+
KNOWLEDGE = "knowledge"
|
|
1280
|
+
}
|
|
1281
|
+
interface DirectoryItem {
|
|
1282
|
+
directory: string;
|
|
1283
|
+
shared?: boolean;
|
|
1284
|
+
}
|
|
1285
|
+
interface ChunkRow {
|
|
1286
|
+
id: string;
|
|
1287
|
+
}
|
|
1207
1288
|
|
|
1208
1289
|
/**
|
|
1209
1290
|
* Composes a set of example conversations based on provided actions and a specified count.
|
|
@@ -1399,6 +1480,13 @@ declare abstract class DatabaseAdapter<DB = any> implements IDatabaseAdapter {
|
|
|
1399
1480
|
limit?: number;
|
|
1400
1481
|
}): Promise<Memory[]>;
|
|
1401
1482
|
abstract getMemoryById(id: UUID): Promise<Memory | null>;
|
|
1483
|
+
/**
|
|
1484
|
+
* Retrieves multiple memories by their IDs
|
|
1485
|
+
* @param memoryIds Array of UUIDs of the memories to retrieve
|
|
1486
|
+
* @param tableName Optional table name to filter memories by type
|
|
1487
|
+
* @returns Promise resolving to array of Memory objects
|
|
1488
|
+
*/
|
|
1489
|
+
abstract getMemoriesByIds(memoryIds: UUID[], tableName?: string): Promise<Memory[]>;
|
|
1402
1490
|
/**
|
|
1403
1491
|
* Retrieves cached embeddings based on the specified query parameters.
|
|
1404
1492
|
* @param params An object containing parameters for the embedding retrieval.
|
|
@@ -1630,10 +1718,10 @@ declare abstract class DatabaseAdapter<DB = any> implements IDatabaseAdapter {
|
|
|
1630
1718
|
userId: UUID;
|
|
1631
1719
|
}): Promise<Relationship[]>;
|
|
1632
1720
|
/**
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1721
|
+
* Retrieves knowledge items based on specified parameters.
|
|
1722
|
+
* @param params Object containing search parameters
|
|
1723
|
+
* @returns Promise resolving to array of knowledge items
|
|
1724
|
+
*/
|
|
1637
1725
|
abstract getKnowledge(params: {
|
|
1638
1726
|
id?: UUID;
|
|
1639
1727
|
agentId: UUID;
|
|
@@ -1826,7 +1914,6 @@ declare function splitChunks(content: string, chunkSize?: number, bleed?: number
|
|
|
1826
1914
|
* @param opts.presence_penalty The presence penalty to apply (0.0 to 2.0)
|
|
1827
1915
|
* @param opts.temperature The temperature to control randomness (0.0 to 2.0)
|
|
1828
1916
|
* @param opts.serverUrl The URL of the API server
|
|
1829
|
-
* @param opts.token The API token for authentication
|
|
1830
1917
|
* @param opts.max_context_length Maximum allowed context length in tokens
|
|
1831
1918
|
* @param opts.max_response_length Maximum allowed response length in tokens
|
|
1832
1919
|
* @returns Promise resolving to a boolean value parsed from the model's response
|
|
@@ -1896,6 +1983,8 @@ declare const generateImage: (data: {
|
|
|
1896
1983
|
jobId?: string;
|
|
1897
1984
|
stylePreset?: string;
|
|
1898
1985
|
hideWatermark?: boolean;
|
|
1986
|
+
safeMode?: boolean;
|
|
1987
|
+
cfgScale?: number;
|
|
1899
1988
|
}, runtime: IAgentRuntime) => Promise<{
|
|
1900
1989
|
success: boolean;
|
|
1901
1990
|
data?: string[];
|
|
@@ -1907,7 +1996,6 @@ declare const generateCaption: (data: {
|
|
|
1907
1996
|
title: string;
|
|
1908
1997
|
description: string;
|
|
1909
1998
|
}>;
|
|
1910
|
-
declare const generateWebSearch: (query: string, runtime: IAgentRuntime) => Promise<SearchResponse>;
|
|
1911
1999
|
/**
|
|
1912
2000
|
* Configuration options for generating objects with a model.
|
|
1913
2001
|
*/
|
|
@@ -2169,10 +2257,6 @@ declare function formatRelationships({ runtime, userId, }: {
|
|
|
2169
2257
|
userId: UUID;
|
|
2170
2258
|
}): Promise<`${string}-${string}-${string}-${string}-${string}`[]>;
|
|
2171
2259
|
|
|
2172
|
-
/**
|
|
2173
|
-
* Represents the runtime environment for an agent, handling message processing,
|
|
2174
|
-
* action registration, and interaction with external services like OpenAI and Supabase.
|
|
2175
|
-
*/
|
|
2176
2260
|
declare class AgentRuntime implements IAgentRuntime {
|
|
2177
2261
|
#private;
|
|
2178
2262
|
/**
|
|
@@ -2246,6 +2330,7 @@ declare class AgentRuntime implements IAgentRuntime {
|
|
|
2246
2330
|
*/
|
|
2247
2331
|
knowledgeManager: IMemoryManager;
|
|
2248
2332
|
ragKnowledgeManager: IRAGKnowledgeManager;
|
|
2333
|
+
private readonly knowledgeRoot;
|
|
2249
2334
|
services: Map<ServiceType, Service>;
|
|
2250
2335
|
memoryManagers: Map<string, IMemoryManager>;
|
|
2251
2336
|
cacheManager: ICacheManager;
|
|
@@ -2308,6 +2393,11 @@ declare class AgentRuntime implements IAgentRuntime {
|
|
|
2308
2393
|
* An array of knowledge items or objects containing id, path, and content.
|
|
2309
2394
|
*/
|
|
2310
2395
|
private processCharacterRAGKnowledge;
|
|
2396
|
+
/**
|
|
2397
|
+
* Processes directory-based RAG knowledge by recursively loading and processing files.
|
|
2398
|
+
* @param dirConfig The directory configuration containing path and shared flag
|
|
2399
|
+
*/
|
|
2400
|
+
private processCharacterRAGDirectory;
|
|
2311
2401
|
getSetting(key: string): any;
|
|
2312
2402
|
/**
|
|
2313
2403
|
* Get the number of messages that are kept in the conversation buffer.
|
|
@@ -2417,34 +2507,9 @@ declare function getEnvVariable(key: string, defaultValue?: string): string | un
|
|
|
2417
2507
|
declare function hasEnvVariable(key: string): boolean;
|
|
2418
2508
|
declare const settings: Settings;
|
|
2419
2509
|
|
|
2420
|
-
declare
|
|
2421
|
-
#private;
|
|
2422
|
-
constructor();
|
|
2423
|
-
private isNode;
|
|
2424
|
-
verbose: boolean;
|
|
2425
|
-
closeByNewLine: boolean;
|
|
2426
|
-
useIcons: boolean;
|
|
2427
|
-
logsTitle: string;
|
|
2428
|
-
warningsTitle: string;
|
|
2429
|
-
errorsTitle: string;
|
|
2430
|
-
informationsTitle: string;
|
|
2431
|
-
successesTitle: string;
|
|
2432
|
-
debugsTitle: string;
|
|
2433
|
-
assertsTitle: string;
|
|
2434
|
-
clear(): void;
|
|
2435
|
-
print(foregroundColor?: string, backgroundColor?: string, ...strings: any[]): void;
|
|
2436
|
-
log(...strings: any[]): void;
|
|
2437
|
-
warn(...strings: any[]): void;
|
|
2438
|
-
error(...strings: any[]): void;
|
|
2439
|
-
info(...strings: any[]): void;
|
|
2440
|
-
debug(...strings: any[]): void;
|
|
2441
|
-
success(...strings: any[]): void;
|
|
2442
|
-
assert(...strings: any[]): void;
|
|
2443
|
-
progress(message: string): void;
|
|
2444
|
-
}
|
|
2445
|
-
declare const elizaLogger: ElizaLogger;
|
|
2510
|
+
declare const elizaLogger: pino.Logger<string, boolean>;
|
|
2446
2511
|
|
|
2447
|
-
declare const messageCompletionFooter = "\nResponse format should be formatted in a JSON block like this:\n```json\n{ \"user\": \"{{agentName}}\", \"text\": \"string
|
|
2512
|
+
declare const messageCompletionFooter = "\nResponse format should be formatted in a valid JSON block like this:\n```json\n{ \"user\": \"{{agentName}}\", \"text\": \"<string>\", \"action\": \"<string>\" }\n```\n\nThe \u201Caction\u201D field should be one of the options in [Available Actions] and the \"text\" field should be the response you want to send.\n";
|
|
2448
2513
|
declare const shouldRespondFooter = "The available options are [RESPOND], [IGNORE], or [STOP]. Choose the most appropriate option.\nIf {{agentName}} is talking too much, you can choose [IGNORE]\n\nYour response must include one of the options.";
|
|
2449
2514
|
declare const parseShouldRespondFromText: (text: string) => "RESPOND" | "IGNORE" | "STOP" | null;
|
|
2450
2515
|
declare const booleanFooter = "Respond with only a YES or a NO.";
|
|
@@ -2458,7 +2523,7 @@ declare const booleanFooter = "Respond with only a YES or a NO.";
|
|
|
2458
2523
|
* @returns {boolean|null} - Returns `true` for affirmative inputs, `false` for negative inputs, and `null` for unrecognized inputs or null/undefined.
|
|
2459
2524
|
*/
|
|
2460
2525
|
declare const parseBooleanFromText: (text: string) => boolean;
|
|
2461
|
-
declare const stringArrayFooter = "Respond with a JSON array containing the values in a JSON block formatted for markdown with this structure:\n```json\n[\n 'value',\n 'value'\n]\n```\n\nYour response must include the JSON block.";
|
|
2526
|
+
declare const stringArrayFooter = "Respond with a JSON array containing the values in a valid JSON block formatted for markdown with this structure:\n```json\n[\n 'value',\n 'value'\n]\n```\n\nYour response must include the valid JSON block.";
|
|
2462
2527
|
/**
|
|
2463
2528
|
* Parses a JSON array from a given text. The function looks for a JSON block wrapped in triple backticks
|
|
2464
2529
|
* with `json` language identifier, and if not found, it searches for an array pattern within the text.
|
|
@@ -2480,6 +2545,38 @@ declare function parseJsonArrayFromText(text: string): any[];
|
|
|
2480
2545
|
* @returns An object parsed from the JSON string if successful; otherwise, null or the result of parsing an array.
|
|
2481
2546
|
*/
|
|
2482
2547
|
declare function parseJSONObjectFromText(text: string): Record<string, any> | null;
|
|
2548
|
+
/**
|
|
2549
|
+
* Extracts specific attributes (e.g., user, text, action) from a JSON-like string using regex.
|
|
2550
|
+
* @param response - The cleaned string response to extract attributes from.
|
|
2551
|
+
* @param attributesToExtract - An array of attribute names to extract.
|
|
2552
|
+
* @returns An object containing the extracted attributes.
|
|
2553
|
+
*/
|
|
2554
|
+
declare function extractAttributes(response: string, attributesToExtract?: string[]): {
|
|
2555
|
+
[key: string]: string | undefined;
|
|
2556
|
+
};
|
|
2557
|
+
/**
|
|
2558
|
+
* Normalizes a JSON-like string by correcting formatting issues:
|
|
2559
|
+
* - Removes extra spaces after '{' and before '}'.
|
|
2560
|
+
* - Wraps unquoted values in double quotes.
|
|
2561
|
+
* - Converts single-quoted values to double-quoted.
|
|
2562
|
+
* - Ensures consistency in key-value formatting.
|
|
2563
|
+
* - Normalizes mixed adjacent quote pairs.
|
|
2564
|
+
*
|
|
2565
|
+
* This is useful for cleaning up improperly formatted JSON strings
|
|
2566
|
+
* before parsing them into valid JSON.
|
|
2567
|
+
*
|
|
2568
|
+
* @param str - The JSON-like string to normalize.
|
|
2569
|
+
* @returns A properly formatted JSON string.
|
|
2570
|
+
*/
|
|
2571
|
+
declare const normalizeJsonString: (str: string) => string;
|
|
2572
|
+
/**
|
|
2573
|
+
* Cleans a JSON-like response string by removing unnecessary markers, line breaks, and extra whitespace.
|
|
2574
|
+
* This is useful for handling improperly formatted JSON responses from external sources.
|
|
2575
|
+
*
|
|
2576
|
+
* @param response - The raw JSON-like string response to clean.
|
|
2577
|
+
* @returns The cleaned string, ready for parsing or further processing.
|
|
2578
|
+
*/
|
|
2579
|
+
declare function cleanJsonResponse(response: string): string;
|
|
2483
2580
|
declare const postActionResponseFooter = "Choose any combination of [LIKE], [RETWEET], [QUOTE], and [REPLY] that are appropriate. Each action must be on its own line. Your response must only include the chosen actions.";
|
|
2484
2581
|
declare const parseActionResponseFromText: (text: string) => {
|
|
2485
2582
|
actions: ActionResponse;
|
|
@@ -2554,6 +2651,7 @@ declare const CharacterSchema: z.ZodObject<{
|
|
|
2554
2651
|
attachments?: any[];
|
|
2555
2652
|
}>, z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2556
2653
|
}, "strip", z.ZodTypeAny, {
|
|
2654
|
+
user?: string;
|
|
2557
2655
|
content?: {
|
|
2558
2656
|
text?: string;
|
|
2559
2657
|
action?: string;
|
|
@@ -2562,8 +2660,8 @@ declare const CharacterSchema: z.ZodObject<{
|
|
|
2562
2660
|
inReplyTo?: string;
|
|
2563
2661
|
attachments?: any[];
|
|
2564
2662
|
} & Record<string, unknown>;
|
|
2565
|
-
user?: string;
|
|
2566
2663
|
}, {
|
|
2664
|
+
user?: string;
|
|
2567
2665
|
content?: {
|
|
2568
2666
|
text?: string;
|
|
2569
2667
|
action?: string;
|
|
@@ -2572,7 +2670,6 @@ declare const CharacterSchema: z.ZodObject<{
|
|
|
2572
2670
|
inReplyTo?: string;
|
|
2573
2671
|
attachments?: any[];
|
|
2574
2672
|
} & Record<string, unknown>;
|
|
2575
|
-
user?: string;
|
|
2576
2673
|
}>, "many">, "many">;
|
|
2577
2674
|
postExamples: z.ZodArray<z.ZodString, "many">;
|
|
2578
2675
|
topics: z.ZodArray<z.ZodString, "many">;
|
|
@@ -2581,11 +2678,20 @@ declare const CharacterSchema: z.ZodObject<{
|
|
|
2581
2678
|
path: z.ZodString;
|
|
2582
2679
|
shared: z.ZodOptional<z.ZodBoolean>;
|
|
2583
2680
|
}, "strip", z.ZodTypeAny, {
|
|
2584
|
-
path?: string;
|
|
2585
2681
|
shared?: boolean;
|
|
2682
|
+
path?: string;
|
|
2586
2683
|
}, {
|
|
2684
|
+
shared?: boolean;
|
|
2587
2685
|
path?: string;
|
|
2686
|
+
}>, z.ZodObject<{
|
|
2687
|
+
directory: z.ZodString;
|
|
2688
|
+
shared: z.ZodOptional<z.ZodBoolean>;
|
|
2689
|
+
}, "strip", z.ZodTypeAny, {
|
|
2588
2690
|
shared?: boolean;
|
|
2691
|
+
directory?: string;
|
|
2692
|
+
}, {
|
|
2693
|
+
shared?: boolean;
|
|
2694
|
+
directory?: string;
|
|
2589
2695
|
}>]>, "many">>;
|
|
2590
2696
|
clients: z.ZodArray<z.ZodNativeEnum<typeof Clients>, "many">;
|
|
2591
2697
|
plugins: z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodArray<z.ZodObject<{
|
|
@@ -2599,16 +2705,16 @@ declare const CharacterSchema: z.ZodObject<{
|
|
|
2599
2705
|
}, "strip", z.ZodTypeAny, {
|
|
2600
2706
|
actions?: any[];
|
|
2601
2707
|
providers?: any[];
|
|
2602
|
-
description?: string;
|
|
2603
2708
|
name?: string;
|
|
2709
|
+
description?: string;
|
|
2604
2710
|
evaluators?: any[];
|
|
2605
2711
|
services?: any[];
|
|
2606
2712
|
clients?: any[];
|
|
2607
2713
|
}, {
|
|
2608
2714
|
actions?: any[];
|
|
2609
2715
|
providers?: any[];
|
|
2610
|
-
description?: string;
|
|
2611
2716
|
name?: string;
|
|
2717
|
+
description?: string;
|
|
2612
2718
|
evaluators?: any[];
|
|
2613
2719
|
services?: any[];
|
|
2614
2720
|
clients?: any[];
|
|
@@ -2725,8 +2831,11 @@ declare const CharacterSchema: z.ZodObject<{
|
|
|
2725
2831
|
bio?: string | string[];
|
|
2726
2832
|
lore?: string[];
|
|
2727
2833
|
knowledge?: (string | {
|
|
2834
|
+
shared?: boolean;
|
|
2728
2835
|
path?: string;
|
|
2836
|
+
} | {
|
|
2729
2837
|
shared?: boolean;
|
|
2838
|
+
directory?: string;
|
|
2730
2839
|
})[];
|
|
2731
2840
|
settings?: {
|
|
2732
2841
|
model?: string;
|
|
@@ -2737,15 +2846,16 @@ declare const CharacterSchema: z.ZodObject<{
|
|
|
2737
2846
|
};
|
|
2738
2847
|
embeddingModel?: string;
|
|
2739
2848
|
};
|
|
2740
|
-
|
|
2741
|
-
id?: string;
|
|
2849
|
+
modelProvider?: ModelProviderName;
|
|
2742
2850
|
name?: string;
|
|
2851
|
+
id?: string;
|
|
2852
|
+
system?: string;
|
|
2743
2853
|
topics?: string[];
|
|
2744
2854
|
clients?: Clients[];
|
|
2745
|
-
modelProvider?: ModelProviderName;
|
|
2746
2855
|
modelEndpointOverride?: string;
|
|
2747
2856
|
templates?: Record<string, string>;
|
|
2748
2857
|
messageExamples?: {
|
|
2858
|
+
user?: string;
|
|
2749
2859
|
content?: {
|
|
2750
2860
|
text?: string;
|
|
2751
2861
|
action?: string;
|
|
@@ -2754,15 +2864,14 @@ declare const CharacterSchema: z.ZodObject<{
|
|
|
2754
2864
|
inReplyTo?: string;
|
|
2755
2865
|
attachments?: any[];
|
|
2756
2866
|
} & Record<string, unknown>;
|
|
2757
|
-
user?: string;
|
|
2758
2867
|
}[][];
|
|
2759
2868
|
postExamples?: string[];
|
|
2760
2869
|
adjectives?: string[];
|
|
2761
2870
|
plugins?: string[] | {
|
|
2762
2871
|
actions?: any[];
|
|
2763
2872
|
providers?: any[];
|
|
2764
|
-
description?: string;
|
|
2765
2873
|
name?: string;
|
|
2874
|
+
description?: string;
|
|
2766
2875
|
evaluators?: any[];
|
|
2767
2876
|
services?: any[];
|
|
2768
2877
|
clients?: any[];
|
|
@@ -2796,8 +2905,11 @@ declare const CharacterSchema: z.ZodObject<{
|
|
|
2796
2905
|
bio?: string | string[];
|
|
2797
2906
|
lore?: string[];
|
|
2798
2907
|
knowledge?: (string | {
|
|
2908
|
+
shared?: boolean;
|
|
2799
2909
|
path?: string;
|
|
2910
|
+
} | {
|
|
2800
2911
|
shared?: boolean;
|
|
2912
|
+
directory?: string;
|
|
2801
2913
|
})[];
|
|
2802
2914
|
settings?: {
|
|
2803
2915
|
model?: string;
|
|
@@ -2808,15 +2920,16 @@ declare const CharacterSchema: z.ZodObject<{
|
|
|
2808
2920
|
};
|
|
2809
2921
|
embeddingModel?: string;
|
|
2810
2922
|
};
|
|
2811
|
-
|
|
2812
|
-
id?: string;
|
|
2923
|
+
modelProvider?: ModelProviderName;
|
|
2813
2924
|
name?: string;
|
|
2925
|
+
id?: string;
|
|
2926
|
+
system?: string;
|
|
2814
2927
|
topics?: string[];
|
|
2815
2928
|
clients?: Clients[];
|
|
2816
|
-
modelProvider?: ModelProviderName;
|
|
2817
2929
|
modelEndpointOverride?: string;
|
|
2818
2930
|
templates?: Record<string, string>;
|
|
2819
2931
|
messageExamples?: {
|
|
2932
|
+
user?: string;
|
|
2820
2933
|
content?: {
|
|
2821
2934
|
text?: string;
|
|
2822
2935
|
action?: string;
|
|
@@ -2825,15 +2938,14 @@ declare const CharacterSchema: z.ZodObject<{
|
|
|
2825
2938
|
inReplyTo?: string;
|
|
2826
2939
|
attachments?: any[];
|
|
2827
2940
|
} & Record<string, unknown>;
|
|
2828
|
-
user?: string;
|
|
2829
2941
|
}[][];
|
|
2830
2942
|
postExamples?: string[];
|
|
2831
2943
|
adjectives?: string[];
|
|
2832
2944
|
plugins?: string[] | {
|
|
2833
2945
|
actions?: any[];
|
|
2834
2946
|
providers?: any[];
|
|
2835
|
-
description?: string;
|
|
2836
2947
|
name?: string;
|
|
2948
|
+
description?: string;
|
|
2837
2949
|
evaluators?: any[];
|
|
2838
2950
|
services?: any[];
|
|
2839
2951
|
clients?: any[];
|
|
@@ -2923,6 +3035,10 @@ declare class RAGKnowledgeManager implements IRAGKnowledgeManager {
|
|
|
2923
3035
|
* The name of the database table this manager operates on.
|
|
2924
3036
|
*/
|
|
2925
3037
|
tableName: string;
|
|
3038
|
+
/**
|
|
3039
|
+
* The root directory where RAG knowledge files are located (internal)
|
|
3040
|
+
*/
|
|
3041
|
+
knowledgeRoot: string;
|
|
2926
3042
|
/**
|
|
2927
3043
|
* Constructs a new KnowledgeManager instance.
|
|
2928
3044
|
* @param opts Options for the manager.
|
|
@@ -2932,6 +3048,7 @@ declare class RAGKnowledgeManager implements IRAGKnowledgeManager {
|
|
|
2932
3048
|
constructor(opts: {
|
|
2933
3049
|
tableName: string;
|
|
2934
3050
|
runtime: IAgentRuntime;
|
|
3051
|
+
knowledgeRoot: string;
|
|
2935
3052
|
});
|
|
2936
3053
|
private readonly defaultRAGMatchThreshold;
|
|
2937
3054
|
private readonly defaultRAGMatchCount;
|
|
@@ -2967,6 +3084,16 @@ declare class RAGKnowledgeManager implements IRAGKnowledgeManager {
|
|
|
2967
3084
|
}): Promise<RAGKnowledgeItem[]>;
|
|
2968
3085
|
removeKnowledge(id: UUID): Promise<void>;
|
|
2969
3086
|
clearKnowledge(shared?: boolean): Promise<void>;
|
|
3087
|
+
/**
|
|
3088
|
+
* Lists all knowledge entries for an agent without semantic search or reranking.
|
|
3089
|
+
* Used primarily for administrative tasks like cleanup.
|
|
3090
|
+
*
|
|
3091
|
+
* @param agentId The agent ID to fetch knowledge entries for
|
|
3092
|
+
* @returns Array of RAGKnowledgeItem entries
|
|
3093
|
+
*/
|
|
3094
|
+
listAllKnowledge(agentId: UUID): Promise<RAGKnowledgeItem[]>;
|
|
3095
|
+
cleanupDeletedKnowledgeFiles(): Promise<void>;
|
|
3096
|
+
generateScopedId(path: string, isShared: boolean): UUID;
|
|
2970
3097
|
processFile(file: {
|
|
2971
3098
|
path: string;
|
|
2972
3099
|
content: string;
|
|
@@ -2975,4 +3102,4 @@ declare class RAGKnowledgeManager implements IRAGKnowledgeManager {
|
|
|
2975
3102
|
}): Promise<void>;
|
|
2976
3103
|
}
|
|
2977
3104
|
|
|
2978
|
-
export { type Account, type Action, type ActionExample, type ActionResponse, ActionTimelineType, type Actor, AgentRuntime, CacheManager, type CacheOptions, CacheStore, type Character, type CharacterConfig, CharacterSchema, type Client, Clients, type Content, type ConversationExample, type DataIrysFetchedFromGQL, DatabaseAdapter, DbCacheAdapter, type EmbeddingConfig, type EmbeddingModelSettings, EmbeddingProvider, type EmbeddingProviderType, type EnvConfig, type EvaluationExample, type Evaluator, FsCacheAdapter, type GenerationOptions, type Goal, GoalStatus, type GraphQLTag, type Handler, type HandlerCallback, type IAgentConfig, type IAgentRuntime, type IAwsS3Service, type IBrowserService, type ICacheAdapter, 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 IVerifiableInferenceAdapter, type IVideoService, type ImageModelSettings, IrysDataType, IrysMessageType, type IrysTimestamp, type KnowledgeItem, LoggingLevel, type Media, type Memory, MemoryCacheAdapter, MemoryManager, type MessageExample, type Model, ModelClass, type ModelConfiguration, ModelProviderName, type ModelSettings$1 as ModelSettings, type Models, type Objective, type Participant, type Plugin, type Provider, type RAGKnowledgeItem, RAGKnowledgeManager, type Relationship, type Room,
|
|
3105
|
+
export { type Account, type Action, type ActionExample, type ActionResponse, ActionTimelineType, type Actor, AgentRuntime, CacheKeyPrefix, CacheManager, type CacheOptions, CacheStore, type Character, type CharacterConfig, CharacterSchema, type ChunkRow, type Client, Clients, type Content, type ConversationExample, type DataIrysFetchedFromGQL, DatabaseAdapter, DbCacheAdapter, type DirectoryItem, type EmbeddingConfig, type EmbeddingModelSettings, EmbeddingProvider, type EmbeddingProviderType, type EnvConfig, type EvaluationExample, type Evaluator, FsCacheAdapter, type GenerationOptions, type Goal, GoalStatus, type GraphQLTag, type Handler, type HandlerCallback, type IAgentConfig, type IAgentRuntime, type IAwsS3Service, type IBrowserService, type ICacheAdapter, 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 IVerifiableInferenceAdapter, type IVideoService, type ImageModelSettings, IrysDataType, IrysMessageType, type IrysTimestamp, type KnowledgeItem, KnowledgeScope, LoggingLevel, type Media, type Memory, MemoryCacheAdapter, MemoryManager, type MessageExample, type Model, ModelClass, type ModelConfiguration, ModelProviderName, type ModelSettings$1 as ModelSettings, type Models, type Objective, type Participant, type Plugin, type Provider, type RAGKnowledgeItem, RAGKnowledgeManager, type Relationship, type Room, Service, ServiceType, type State, type TelemetrySettings, type TemplateType, TokenizerType, TranscriptionProvider, type TwitterSpaceDecisionOptions, type UUID, type UploadIrysResult, type Validator, type VerifiableInferenceOptions, VerifiableInferenceProvider, type VerifiableInferenceResult, addHeader, booleanFooter, cleanJsonResponse, composeActionExamples, composeContext, composeRandomUser, configureSettings, createGoal, createRelationship, defaultCharacter, elizaLogger, embed, envSchema, evaluationTemplate, extractAttributes, findNearestEnvFile, formatActionNames, formatActions, formatActors, formatEvaluatorExampleDescriptions, formatEvaluatorExamples, formatEvaluatorNames, formatEvaluators, formatGoalsAsString, formatMessages, formatPosts, formatRelationships, formatTimestamp, generateCaption, generateImage, generateMessageResponse, generateObject, generateObjectArray, generateObjectDeprecated, generateShouldRespond, generateText, generateTextArray, generateTrueOrFalse, generateTweetActions, getActorDetails, getEmbeddingConfig, getEmbeddingModelSettings, getEmbeddingType, getEmbeddingZeroVector, getEndpoint, getEnvVariable, getGoals, getImageModelSettings, getModelSettings, getProviders, getRelationship, getRelationships, handleProvider, hasEnvVariable, _default as knowledge, loadEnvConfig, messageCompletionFooter, models, normalizeJsonString, parseActionResponseFromText, parseBooleanFromText, parseJSONObjectFromText, parseJsonArrayFromText, parseShouldRespondFromText, postActionResponseFooter, settings, shouldRespondFooter, splitChunks, stringArrayFooter, stringToUuid, trimTokens, truncateToCompleteSentence, updateGoal, uuidSchema, validateCharacterConfig, validateEnv, validateUuid };
|