@elizaos/core 2.0.0-alpha.7 → 2.0.0-alpha.71

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.
Files changed (132) hide show
  1. package/README.md +213 -16
  2. package/dist/testing/index.js +22 -0
  3. package/dist/testing/index.js.map +9 -0
  4. package/package.json +46 -27
  5. package/dist/actions.d.ts +0 -22
  6. package/dist/actions.d.ts.map +0 -1
  7. package/dist/browser/index.browser.js +0 -771
  8. package/dist/browser/index.browser.js.map +0 -427
  9. package/dist/browser/index.d.ts +0 -2
  10. package/dist/character.d.ts +0 -39
  11. package/dist/character.d.ts.map +0 -1
  12. package/dist/constants/index.d.ts +0 -7
  13. package/dist/constants/secrets.d.ts +0 -67
  14. package/dist/database.d.ts +0 -494
  15. package/dist/database.d.ts.map +0 -1
  16. package/dist/elizaos.d.ts +0 -194
  17. package/dist/elizaos.d.ts.map +0 -1
  18. package/dist/entities.d.ts +0 -40
  19. package/dist/entities.d.ts.map +0 -1
  20. package/dist/index.browser.d.ts +0 -39
  21. package/dist/index.browser.d.ts.map +0 -1
  22. package/dist/index.d.ts +0 -40
  23. package/dist/index.d.ts.map +0 -1
  24. package/dist/index.js +0 -2
  25. package/dist/index.node.d.ts +0 -37
  26. package/dist/index.node.d.ts.map +0 -1
  27. package/dist/logger.d.ts +0 -72
  28. package/dist/logger.d.ts.map +0 -1
  29. package/dist/memory.d.ts +0 -63
  30. package/dist/memory.d.ts.map +0 -1
  31. package/dist/node/index.d.ts +0 -2
  32. package/dist/node/index.node.js +0 -53403
  33. package/dist/node/index.node.js.map +0 -511
  34. package/dist/onboarding-state.d.ts +0 -209
  35. package/dist/plugin.d.ts +0 -55
  36. package/dist/plugin.d.ts.map +0 -1
  37. package/dist/prompts.d.ts +0 -7
  38. package/dist/prompts.d.ts.map +0 -1
  39. package/dist/request-context.d.ts +0 -142
  40. package/dist/request-context.d.ts.map +0 -1
  41. package/dist/request-context.node.d.ts +0 -36
  42. package/dist/request-context.node.d.ts.map +0 -1
  43. package/dist/roles.d.ts +0 -23
  44. package/dist/roles.d.ts.map +0 -1
  45. package/dist/runtime.d.ts +0 -366
  46. package/dist/runtime.d.ts.map +0 -1
  47. package/dist/schemas/character.d.ts +0 -151
  48. package/dist/schemas/character.d.ts.map +0 -1
  49. package/dist/search.d.ts +0 -316
  50. package/dist/search.d.ts.map +0 -1
  51. package/dist/secrets.d.ts +0 -11
  52. package/dist/secrets.d.ts.map +0 -1
  53. package/dist/services/default-message-service.d.ts +0 -69
  54. package/dist/services/default-message-service.d.ts.map +0 -1
  55. package/dist/services/message-service.d.ts +0 -171
  56. package/dist/services/message-service.d.ts.map +0 -1
  57. package/dist/services.d.ts +0 -56
  58. package/dist/services.d.ts.map +0 -1
  59. package/dist/sessions/index.d.ts +0 -10
  60. package/dist/sessions/paths.d.ts +0 -56
  61. package/dist/sessions/provider.d.ts +0 -73
  62. package/dist/sessions/session-key.d.ts +0 -133
  63. package/dist/sessions/store.d.ts +0 -75
  64. package/dist/sessions/types.d.ts +0 -195
  65. package/dist/settings.d.ts +0 -90
  66. package/dist/settings.d.ts.map +0 -1
  67. package/dist/streaming-context.browser.d.ts +0 -26
  68. package/dist/streaming-context.browser.d.ts.map +0 -1
  69. package/dist/streaming-context.d.ts +0 -95
  70. package/dist/streaming-context.d.ts.map +0 -1
  71. package/dist/streaming-context.node.d.ts +0 -15
  72. package/dist/streaming-context.node.d.ts.map +0 -1
  73. package/dist/types/agent.d.ts +0 -97
  74. package/dist/types/agent.d.ts.map +0 -1
  75. package/dist/types/components.d.ts +0 -155
  76. package/dist/types/components.d.ts.map +0 -1
  77. package/dist/types/database.d.ts +0 -414
  78. package/dist/types/database.d.ts.map +0 -1
  79. package/dist/types/elizaos.d.ts +0 -159
  80. package/dist/types/elizaos.d.ts.map +0 -1
  81. package/dist/types/environment.d.ts +0 -116
  82. package/dist/types/environment.d.ts.map +0 -1
  83. package/dist/types/events.d.ts +0 -203
  84. package/dist/types/events.d.ts.map +0 -1
  85. package/dist/types/index.d.ts +0 -20
  86. package/dist/types/index.d.ts.map +0 -1
  87. package/dist/types/knowledge.d.ts +0 -30
  88. package/dist/types/knowledge.d.ts.map +0 -1
  89. package/dist/types/memory.d.ts +0 -102
  90. package/dist/types/memory.d.ts.map +0 -1
  91. package/dist/types/messaging.d.ts +0 -137
  92. package/dist/types/messaging.d.ts.map +0 -1
  93. package/dist/types/model.d.ts +0 -513
  94. package/dist/types/model.d.ts.map +0 -1
  95. package/dist/types/plugin.d.ts +0 -91
  96. package/dist/types/plugin.d.ts.map +0 -1
  97. package/dist/types/primitives.d.ts +0 -96
  98. package/dist/types/primitives.d.ts.map +0 -1
  99. package/dist/types/runtime.d.ts +0 -140
  100. package/dist/types/runtime.d.ts.map +0 -1
  101. package/dist/types/service.d.ts +0 -150
  102. package/dist/types/service.d.ts.map +0 -1
  103. package/dist/types/settings.d.ts +0 -29
  104. package/dist/types/settings.d.ts.map +0 -1
  105. package/dist/types/state.d.ts +0 -56
  106. package/dist/types/state.d.ts.map +0 -1
  107. package/dist/types/streaming.d.ts +0 -71
  108. package/dist/types/streaming.d.ts.map +0 -1
  109. package/dist/types/task.d.ts +0 -67
  110. package/dist/types/task.d.ts.map +0 -1
  111. package/dist/types/tee.d.ts +0 -96
  112. package/dist/types/tee.d.ts.map +0 -1
  113. package/dist/types/testing.d.ts +0 -28
  114. package/dist/types/testing.d.ts.map +0 -1
  115. package/dist/utils/buffer.d.ts +0 -104
  116. package/dist/utils/buffer.d.ts.map +0 -1
  117. package/dist/utils/crypto-compat.d.ts +0 -183
  118. package/dist/utils/crypto-compat.d.ts.map +0 -1
  119. package/dist/utils/environment.d.ts +0 -50
  120. package/dist/utils/environment.d.ts.map +0 -1
  121. package/dist/utils/node.d.ts +0 -5
  122. package/dist/utils/node.d.ts.map +0 -1
  123. package/dist/utils/paths.d.ts +0 -92
  124. package/dist/utils/paths.d.ts.map +0 -1
  125. package/dist/utils/server-health.d.ts +0 -22
  126. package/dist/utils/server-health.d.ts.map +0 -1
  127. package/dist/utils/streaming.d.ts +0 -179
  128. package/dist/utils/streaming.d.ts.map +0 -1
  129. package/dist/utils/type-guards.d.ts +0 -23
  130. package/dist/utils/type-guards.d.ts.map +0 -1
  131. package/dist/utils.d.ts +0 -182
  132. package/dist/utils.d.ts.map +0 -1
package/dist/search.d.ts DELETED
@@ -1,316 +0,0 @@
1
- /**
2
- * Interface for tokenization statistics.
3
- */
4
- interface TokenizationStats {
5
- /** Number of words in the original text before any processing. */
6
- originalWordCount: number;
7
- /** Number of words removed because they were identified as stop words. */
8
- stopWordsRemoved: number;
9
- /** Number of words that were stemmed (only if stemming is enabled). */
10
- stemmedWords: number;
11
- /** Time taken for tokenization in milliseconds. */
12
- processingTimeMs: number;
13
- }
14
- /**
15
- * Interface for the result of tokenization.
16
- */
17
- interface TokenizationResult {
18
- /** Array of processed tokens (words). */
19
- tokens: string[];
20
- /** Optional statistics about the tokenization process. */
21
- stats?: TokenizationStats;
22
- }
23
- /**
24
- * Interface for stemming rules.
25
- */
26
- interface StemmingRule {
27
- /** A RegExp pattern or string to match suffixes. */
28
- pattern: RegExp | string;
29
- /** The replacement string or function. */
30
- replacement: string | ((substring: string, ...args: unknown[]) => string);
31
- /** Optional minimum measure (complexity) of the word stem for the rule to apply. */
32
- minMeasure?: number;
33
- }
34
- /**
35
- * Options for configuring the Tokenizer.
36
- */
37
- interface TokenizerOptions {
38
- /** A set of words to be ignored during tokenization. Defaults to an empty set. */
39
- stopWords?: Set<string>;
40
- /** The minimum length for a token to be kept. Defaults to 2. Numeric tokens are always kept. */
41
- minLength?: number;
42
- /** Whether to apply stemming to tokens. Defaults to false. */
43
- stemming?: boolean;
44
- /** Custom stemming rules to apply before the default Porter2 stemmer. Defaults to an empty array. */
45
- stemmingRules?: StemmingRule[];
46
- }
47
- /**
48
- * Flexible text tokenizer with support for stop words, minimum token length,
49
- * Unicode normalization, and optional Porter2 stemming with custom rules.
50
- */
51
- declare class Tokenizer {
52
- /** Set of stop words to ignore. */
53
- readonly stopWords: Set<string>;
54
- /** Minimum length of tokens to keep. */
55
- readonly minLength: number;
56
- /** Flag indicating if stemming is enabled. */
57
- readonly stemming: boolean;
58
- /** Custom stemming rules. */
59
- readonly stemmingRules: {
60
- pattern: RegExp;
61
- replacement: string | ((substring: string, ...args: unknown[]) => string);
62
- minMeasure?: number;
63
- }[];
64
- /** Default options for the Tokenizer. */
65
- static readonly DEFAULT_OPTIONS: Required<TokenizerOptions>;
66
- /**
67
- * Creates a new tokenizer instance.
68
- * @param options - Tokenization options including stop words, min length, stemming, and custom rules.
69
- */
70
- constructor(options?: TokenizerOptions);
71
- /**
72
- * Tokenizes input text into an array of processed terms.
73
- * Steps:
74
- * 1. Cleans the text (lowercase, normalize, remove punctuation/symbols).
75
- * 2. Splits the text into potential tokens.
76
- * 3. Filters tokens based on `minLength` and `stopWords`.
77
- * 4. Applies stemming if `stemming` is true (custom rules first, then Porter2).
78
- * 5. Optionally calculates statistics.
79
- *
80
- * @param text - The input text string to tokenize.
81
- * @param includeStats - If true, returns tokenization statistics along with tokens. Defaults to false.
82
- * @returns A `TokenizationResult` object containing the array of tokens and optional stats.
83
- * @throws {Error} If the input text is null, undefined, or empty.
84
- */
85
- tokenize(text: string, includeStats?: boolean): TokenizationResult;
86
- /**
87
- * Cleans and normalizes text for tokenization.
88
- * - Converts to lowercase.
89
- * - Normalizes Unicode characters (NFKD).
90
- * - Removes control characters and zero-width spaces.
91
- * - Removes diacritical marks (accents).
92
- * - Removes emojis and pictographs.
93
- * - Removes common symbols (™, ®, ©, ℠, ‼).
94
- * - Replaces Unicode punctuation with spaces.
95
- * - Removes characters not matching basic Latin, CJK, Hangul, or whitespace.
96
- * - Collapses multiple spaces into single spaces.
97
- * - Trims leading/trailing whitespace.
98
- *
99
- * @param text - Input text to clean.
100
- * @returns Cleaned and normalized text, ready for splitting into tokens.
101
- *
102
- * @example
103
- * cleanText("Hello, World™!") // "hello world"
104
- * cleanText("héllo 👋") // "hello"
105
- * cleanText("Hello 世界!") // "hello 世界"
106
- * cleanText("I'm don't") // "i'm don't" (apostrophes kept by replacing punctuation with space)
107
- * cleanText("test©2023") // "test 2023"
108
- */
109
- cleanText(text: string): string;
110
- /**
111
- * Checks if a token is valid (meets `minLength` criteria and is not a stop word).
112
- * Numeric tokens are always considered valid regardless of length.
113
- * @param token - The token string to validate.
114
- * @returns `true` if the token is valid, `false` otherwise.
115
- */
116
- isValidToken(token: string): boolean;
117
- /**
118
- * Applies stemming to a single word.
119
- * First, tries to apply custom stemming rules defined in `stemmingRules`.
120
- * If no custom rule matches, applies the default Porter2 stemming algorithm.
121
- * Words shorter than 3 characters are not stemmed.
122
- * @param word - The word to stem.
123
- * @returns The stemmed word.
124
- */
125
- stemWord(word: string): string;
126
- /**
127
- * Checks if the character at a given index in a word is a consonant.
128
- * Treats 'y' as a consonant if it's the first letter or follows a consonant.
129
- * @param word - The word string.
130
- * @param i - The index of the character to check.
131
- * @returns `true` if the character is a consonant, `false` otherwise.
132
- */
133
- isConsonant(word: string, i: number): boolean;
134
- /**
135
- * Calculates the "measure" of a word stem (approximates syllable count).
136
- * The measure (m) is the number of times a sequence of vowels is followed by a
137
- * sequence of consonants (VC). Used in some stemming rules.
138
- * Example: measure("tree") = 0, measure("trouble") = 1, measure("private") = 2
139
- * @param word - The word (or stem) to measure.
140
- * @returns The measure (m) of the word.
141
- */
142
- measure(word: string): number;
143
- }
144
- /**
145
- * BM25 Options Interface.
146
- * Extends TokenizerOptions and adds BM25 specific parameters.
147
- */
148
- interface BM25Options extends TokenizerOptions {
149
- /**
150
- * Term frequency saturation parameter (k1). Controls how quickly term frequency
151
- * saturates. Higher values mean TF contributes more significantly even for high counts.
152
- * Typical values are between 1.2 and 2.0. Default: 1.2.
153
- */
154
- k1?: number;
155
- /**
156
- * Document length normalization parameter (b). Controls the influence of document
157
- * length. 0 means no length normalization, 1 means full normalization.
158
- * Typical values are around 0.75. Default: 0.75.
159
- */
160
- b?: number;
161
- /**
162
- * A dictionary defining boost factors for specific document fields.
163
- * Terms found in fields with higher boost factors will contribute more to the score.
164
- * Example: `{ title: 2, body: 1 }`. Default: `{}` (no boosts).
165
- */
166
- fieldBoosts?: {
167
- [key: string]: number;
168
- };
169
- }
170
- /**
171
- * Represents a search result item.
172
- */
173
- interface SearchResult {
174
- /** The index of the matching document in the original document array. */
175
- index: number;
176
- /** The BM25 relevance score for the document. Higher scores indicate better relevance. */
177
- score: number;
178
- /** The actual document object (optional, depends on how results are retrieved). */
179
- doc?: Record<string, unknown>;
180
- }
181
- /**
182
- * Implements the Okapi BM25 (Best Matching 25) ranking function for information retrieval.
183
- *
184
- * BM25 ranks documents based on the query terms appearing in each document,
185
- * considering term frequency (TF) and inverse document frequency (IDF).
186
- * It improves upon basic TF-IDF by incorporating:
187
- * - Term Frequency Saturation (k1): Prevents overly frequent terms from dominating the score.
188
- * - Document Length Normalization (b): Penalizes documents that are longer than average,
189
- * assuming longer documents are more likely to contain query terms by chance.
190
- *
191
- * Key Components:
192
- * - Tokenizer: Processes text into terms (words), handles stop words and stemming.
193
- * - Document Indexing: Stores document lengths, term frequencies per document,
194
- * and overall document frequency for each term.
195
- * - IDF Calculation: Measures the informativeness of a term based on how many documents contain it.
196
- * - Scoring: Combines TF, IDF, document length, and parameters k1/b to calculate relevance.
197
- */
198
- export declare class BM25 {
199
- /** Term frequency saturation parameter (k1). */
200
- readonly termFrequencySaturation: number;
201
- /** Document length normalization factor (b). */
202
- readonly lengthNormalizationFactor: number;
203
- /** Tokenizer instance used for processing text. */
204
- readonly tokenizer: Tokenizer;
205
- /** Array storing the length (number of tokens, adjusted by field boosts) of each document. */
206
- documentLengths: Uint32Array;
207
- /** Average length of all documents in the index. */
208
- averageDocLength: number;
209
- /** Map from term (string) to its unique integer index. */
210
- termToIndex: Map<string, number>;
211
- /** Array storing the document frequency (number of docs containing the term) for each term index. */
212
- documentFrequency: Uint32Array;
213
- /** Map from term index to another map storing `docIndex: termFrequencyInDoc`. */
214
- termFrequencies: Map<number, Map<number, number>>;
215
- /** Boost factors for different fields within documents. */
216
- readonly fieldBoosts: {
217
- [key: string]: number;
218
- };
219
- /** Array storing the original documents added to the index. */
220
- documents: Array<Record<string, unknown>>;
221
- /**
222
- * Creates a new BM25 search instance.
223
- * @param docs - Optional array of initial documents (objects with string fields) to index.
224
- * @param options - Configuration options for BM25 parameters (k1, b), tokenizer (stopWords, stemming, minLength), and field boosts.
225
- */
226
- constructor(docs?: Array<Record<string, unknown>>, options?: BM25Options);
227
- /**
228
- * Processes an array of documents to build the initial index structures.
229
- * Calculates document lengths, term frequencies, document frequencies, and average document length.
230
- * @param docs - Array of documents to process.
231
- * @returns An object containing the calculated index data.
232
- * @internal
233
- */
234
- private processDocuments;
235
- /**
236
- * Recalculates the average document length based on the current `documentLengths`.
237
- * @internal
238
- */
239
- private recalculateAverageLength;
240
- /**
241
- * Searches the indexed documents for a given query string using the BM25 ranking formula.
242
- *
243
- * @param query - The search query text.
244
- * @param topK - The maximum number of top-scoring results to return. Defaults to 10.
245
- * @returns An array of `SearchResult` objects, sorted by descending BM25 score.
246
- */
247
- search(query: string, topK?: number): SearchResult[];
248
- /**
249
- * Searches for an exact phrase within the indexed documents.
250
- * Ranks documents containing the exact sequence of tokens higher.
251
- * Note: This is a basic implementation. More sophisticated phrase search might consider proximity.
252
- *
253
- * @param phrase - The exact phrase to search for.
254
- * @param topK - The maximum number of results to return. Defaults to 10.
255
- * @returns An array of `SearchResult` objects, sorted by score, for documents containing the phrase.
256
- */
257
- searchPhrase(phrase: string, topK?: number): SearchResult[];
258
- /**
259
- * Calculates a BM25-like score for a sequence of phrase tokens within a specific document.
260
- * Sums the individual BM25 scores of the terms in the phrase for that document.
261
- * @param phraseTokens - The tokenized phrase.
262
- * @param docIndex - The index of the document to score against.
263
- * @returns The calculated phrase score for the document.
264
- * @internal
265
- */
266
- private calculatePhraseScore;
267
- /**
268
- * Adds a single new document to the index.
269
- * Updates all internal index structures incrementally.
270
- * Note: For adding many documents, `addDocumentsParallel` is generally more efficient.
271
- *
272
- * @param doc - The document object (with string fields) to add.
273
- * @throws {Error} If the document is null or undefined.
274
- */
275
- addDocument(doc: Record<string, unknown>): Promise<void>;
276
- /**
277
- * Calculates the Inverse Document Frequency (IDF) for a given term index.
278
- * Uses the BM25 IDF formula: log(1 + (N - n + 0.5) / (n + 0.5))
279
- * where N is the total number of documents and n is the number of documents
280
- * containing the term. The +1 smooths the logarithm.
281
- *
282
- * @param termIndex - The integer index of the term.
283
- * @returns The IDF score for the term. Returns 0 if the term is not found or has 0 DF.
284
- */
285
- calculateIdf(termIndex: number): number;
286
- /**
287
- * Retrieves the term frequency (TF) for a specific term in a specific document.
288
- * @param termIndex - The integer index of the term.
289
- * @param docIndex - The index of the document.
290
- * @returns The term frequency, or 0 if the term is not in the document or indices are invalid.
291
- */
292
- getTermFrequency(termIndex: number, docIndex: number): number;
293
- /**
294
- * Retrieves the original document object stored at a given index.
295
- * @param index - The index of the document to retrieve.
296
- * @returns The document object.
297
- * @throws {Error} If the index is out of bounds.
298
- */
299
- getDocument(index: number): Record<string, unknown>;
300
- /**
301
- * Clears all indexed documents and resets the BM25 instance to its initial state.
302
- */
303
- clearDocuments(): void;
304
- /**
305
- * Gets the total number of documents currently indexed.
306
- * @returns The document count.
307
- */
308
- getDocumentCount(): number;
309
- /**
310
- * Adds multiple documents sequentially by calling `addDocument` for each.
311
- * This method processes documents sequentially in the main thread.
312
- * @param docs - An array of documents to add.
313
- */
314
- addDocuments(docs: Array<Record<string, unknown>>): Promise<void[]>;
315
- }
316
- export {};
@@ -1 +0,0 @@
1
- {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../src/search.ts"],"names":[],"mappings":"AAwtBA;;GAEG;AACH,UAAU,iBAAiB;IACzB,kEAAkE;IAClE,iBAAiB,EAAE,MAAM,CAAC;IAC1B,0EAA0E;IAC1E,gBAAgB,EAAE,MAAM,CAAC;IACzB,uEAAuE;IACvE,YAAY,EAAE,MAAM,CAAC;IACrB,mDAAmD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C,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM;IAI7D;;;;;OAKG;IACH,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAQnD;;OAEG;IACH,cAAc,IAAI,IAAI;IAStB;;;OAGG;IACH,gBAAgB,IAAI,MAAM;IAI1B;;;;OAIG;IACG,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;CAG1E"}
package/dist/secrets.d.ts DELETED
@@ -1,11 +0,0 @@
1
- import { type Character } from './types';
2
- export declare function setAllowedEnvVars(vars: Set<string> | null): void;
3
- export declare function getAllowedEnvVars(): Set<string> | null;
4
- export declare function hasCharacterSecrets(character: Character): boolean;
5
- /**
6
- * Merges process.env into character.settings.secrets with character values taking precedence.
7
- * Node.js-only - returns false in browser environments.
8
- */
9
- export declare function setDefaultSecretsFromEnv(character: Character, options?: {
10
- skipEnvMerge?: boolean;
11
- }): Promise<boolean>;
@@ -1 +0,0 @@
1
- {"version":3,"file":"secrets.d.ts","sourceRoot":"","sources":["../src/secrets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAKzC,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,GAAG,IAAI,CAEhE;AAED,wBAAgB,iBAAiB,IAAI,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CAEtD;AAED,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CASjE;AAED;;;GAGG;AACH,wBAAsB,wBAAwB,CAC5C,SAAS,EAAE,SAAS,EACpB,OAAO,CAAC,EAAE;IAAE,YAAY,CAAC,EAAE,OAAO,CAAA;CAAE,GACnC,OAAO,CAAC,OAAO,CAAC,CAoClB"}
@@ -1,69 +0,0 @@
1
- import type { IAgentRuntime } from '../types/runtime';
2
- import type { Memory } from '../types/memory';
3
- import type { UUID, Media, MentionContext } from '../types/primitives';
4
- import type { HandlerCallback } from '../types/components';
5
- import type { Room } from '../types/environment';
6
- import { type IMessageService, type MessageProcessingOptions, type MessageProcessingResult, type ResponseDecision } from './message-service';
7
- /**
8
- * Default implementation of the MessageService interface.
9
- * This service handles the complete message processing pipeline including:
10
- * - Message validation and memory creation
11
- * - Smart response decision (shouldRespond)
12
- * - Single-shot or multi-step processing strategies
13
- * - Action execution and evaluation
14
- * - Attachment processing
15
- * - Message deletion and channel clearing
16
- *
17
- * This is the standard message handler used by ElizaOS and can be replaced
18
- * with custom implementations via the IMessageService interface.
19
- */
20
- export declare class DefaultMessageService implements IMessageService {
21
- /**
22
- * Main message handling entry point
23
- */
24
- handleMessage(runtime: IAgentRuntime, message: Memory, callback?: HandlerCallback, options?: MessageProcessingOptions): Promise<MessageProcessingResult>;
25
- /**
26
- * Internal message processing implementation
27
- */
28
- private processMessage;
29
- /**
30
- * Determines whether the agent should respond to a message.
31
- * Uses simple rules for obvious cases (DM, mentions) and defers to LLM for ambiguous cases.
32
- */
33
- shouldRespond(runtime: IAgentRuntime, message: Memory, room?: Room, mentionContext?: MentionContext): ResponseDecision;
34
- /**
35
- * Processes attachments by generating descriptions for supported media types.
36
- */
37
- processAttachments(runtime: IAgentRuntime, attachments: Media[]): Promise<Media[]>;
38
- /**
39
- * Single-shot strategy: one LLM call to generate response
40
- */
41
- private runSingleShotCore;
42
- /**
43
- * Multi-step strategy: iterative action execution with final summary
44
- */
45
- private runMultiStepCore;
46
- /**
47
- * Helper to emit run ended events
48
- */
49
- private emitRunEnded;
50
- /**
51
- * Deletes a message from the agent's memory.
52
- * This method handles the actual deletion logic that was previously in event handlers.
53
- *
54
- * @param runtime - The agent runtime instance
55
- * @param message - The message memory to delete
56
- * @returns Promise resolving when deletion is complete
57
- */
58
- deleteMessage(runtime: IAgentRuntime, message: Memory): Promise<void>;
59
- /**
60
- * Clears all messages from a channel/room.
61
- * This method handles bulk deletion of all message memories in a room.
62
- *
63
- * @param runtime - The agent runtime instance
64
- * @param roomId - The room ID to clear messages from
65
- * @param channelId - The original channel ID (for logging)
66
- * @returns Promise resolving when channel is cleared
67
- */
68
- clearChannel(runtime: IAgentRuntime, roomId: UUID, channelId: string): Promise<void>;
69
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"default-message-service.d.ts","sourceRoot":"","sources":["../../src/services/default-message-service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,EAAW,IAAI,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAEhF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,gBAAgB,EACtB,MAAM,mBAAmB,CAAC;AAyF3B;;;;;;;;;;;;GAYG;AACH,qBAAa,qBAAsB,YAAW,eAAe;IAC3D;;OAEG;IACG,aAAa,CACjB,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,eAAe,EAC1B,OAAO,CAAC,EAAE,wBAAwB,GACjC,OAAO,CAAC,uBAAuB,CAAC;IA+GnC;;OAEG;YACW,cAAc;IAmc5B;;;OAGG;IACH,aAAa,CACX,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,IAAI,EACX,cAAc,CAAC,EAAE,cAAc,GAC9B,gBAAgB;IAyEnB;;OAEG;IACG,kBAAkB,CAAC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IA+IxF;;OAEG;YACW,iBAAiB;IAkR/B;;OAEG;YACW,gBAAgB;IAovB9B;;OAEG;YACW,YAAY;IAqB1B;;;;;;;OAOG;IACG,aAAa,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAiC3E;;;;;;;;OAQG;IACG,YAAY,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAoD3F"}
@@ -1,171 +0,0 @@
1
- import type { IAgentRuntime } from '../types/runtime';
2
- import type { Memory } from '../types/memory';
3
- import type { Content, UUID, Media } from '../types/primitives';
4
- import type { State } from '../types/state';
5
- import type { HandlerCallback } from '../types/components';
6
- import type { Room } from '../types/environment';
7
- import type { MentionContext } from '../types/primitives';
8
- /**
9
- * Configuration options for message processing
10
- */
11
- export interface MessageProcessingOptions {
12
- /**
13
- * Maximum number of retries for LLM calls if required fields are missing
14
- * @default 3
15
- */
16
- maxRetries?: number;
17
- /**
18
- * Timeout for message processing in milliseconds
19
- * @default 3600000 (1 hour)
20
- */
21
- timeoutDuration?: number;
22
- /**
23
- * Whether to use multi-step workflow
24
- * @default false
25
- */
26
- useMultiStep?: boolean;
27
- /**
28
- * Maximum number of iterations for multi-step workflow
29
- * @default 6
30
- */
31
- maxMultiStepIterations?: number;
32
- /**
33
- * Called for each chunk of streaming text as it's generated.
34
- * Streaming is enabled by default for all TEXT_* model types.
35
- * The first chunk indicates streaming has started (useful for typing indicators).
36
- *
37
- * @param chunk - The text chunk being streamed
38
- * @param messageId - ID of the message being generated
39
- */
40
- onStreamChunk?: (chunk: string, messageId?: UUID) => Promise<void>;
41
- }
42
- /**
43
- * Result of message processing
44
- */
45
- export interface MessageProcessingResult {
46
- /**
47
- * Whether the agent decided to respond
48
- */
49
- didRespond: boolean;
50
- /**
51
- * The response content generated by the agent
52
- */
53
- responseContent: Content | null;
54
- /**
55
- * Response messages generated
56
- */
57
- responseMessages: Memory[];
58
- /**
59
- * Final state after processing
60
- */
61
- state: State;
62
- /**
63
- * Processing mode used ('simple', 'actions', or 'none')
64
- */
65
- mode?: 'simple' | 'actions' | 'none';
66
- }
67
- /**
68
- * Response decision from the shouldRespond logic
69
- */
70
- export interface ResponseDecision {
71
- /**
72
- * Whether the agent should respond
73
- */
74
- shouldRespond: boolean;
75
- /**
76
- * Whether LLM evaluation can be skipped (decision made by rules)
77
- */
78
- skipEvaluation: boolean;
79
- /**
80
- * Reason for the decision (for debugging)
81
- */
82
- reason: string;
83
- }
84
- /**
85
- * Core interface for message handling service.
86
- * This service is responsible for processing incoming messages and generating responses.
87
- *
88
- * Implementations of this interface control the entire message processing pipeline,
89
- * including:
90
- * - Message validation and memory creation
91
- * - Response decision logic (shouldRespond)
92
- * - Single-shot or multi-step processing
93
- * - Action execution and evaluation
94
- *
95
- * @example
96
- * ```typescript
97
- * // Custom implementation
98
- * class CustomMessageService implements IMessageService {
99
- * async handleMessage(runtime, message, callback) {
100
- * // Your custom message handling logic
101
- * return {
102
- * didRespond: true,
103
- * responseContent: { text: "Custom response" },
104
- * responseMessages: [],
105
- * state: {},
106
- * mode: 'simple'
107
- * };
108
- * }
109
- *
110
- * shouldRespond(runtime, message, room, mentionContext) {
111
- * // Your custom response decision logic
112
- * return { shouldRespond: true, skipEvaluation: true, reason: "custom" };
113
- * }
114
- * }
115
- *
116
- * // Register in runtime
117
- * await runtime.registerService(CustomMessageService);
118
- * ```
119
- */
120
- export interface IMessageService {
121
- /**
122
- * Main entry point for message processing.
123
- * This method orchestrates the entire message handling flow.
124
- *
125
- * @param runtime - The agent runtime instance
126
- * @param message - The incoming message to process
127
- * @param callback - Callback function to send responses
128
- * @param options - Optional processing options
129
- * @returns Promise resolving to the processing result
130
- */
131
- handleMessage(runtime: IAgentRuntime, message: Memory, callback?: HandlerCallback, options?: MessageProcessingOptions): Promise<MessageProcessingResult>;
132
- /**
133
- * Determines whether the agent should respond to a message.
134
- * Uses simple rules for obvious cases (DM, mentions) and defers to LLM for ambiguous cases.
135
- *
136
- * @param runtime - The agent runtime instance
137
- * @param message - The message to evaluate
138
- * @param room - The room context (optional)
139
- * @param mentionContext - Platform mention/reply context (optional)
140
- * @returns Response decision with reasoning
141
- */
142
- shouldRespond(runtime: IAgentRuntime, message: Memory, room?: Room, mentionContext?: MentionContext): ResponseDecision;
143
- /**
144
- * Processes attachments in a message (images, documents, etc.)
145
- * Generates descriptions for images and extracts text from documents.
146
- *
147
- * @param runtime - The agent runtime instance
148
- * @param attachments - Array of media attachments to process
149
- * @returns Promise resolving to processed attachments with descriptions
150
- */
151
- processAttachments?(runtime: IAgentRuntime, attachments: Media[]): Promise<Media[]>;
152
- /**
153
- * Deletes a message from the agent's memory.
154
- * This method handles the actual deletion logic that was previously in event handlers.
155
- *
156
- * @param runtime - The agent runtime instance
157
- * @param message - The message memory to delete
158
- * @returns Promise resolving when deletion is complete
159
- */
160
- deleteMessage(runtime: IAgentRuntime, message: Memory): Promise<void>;
161
- /**
162
- * Clears all messages from a channel/room.
163
- * This method handles bulk deletion of all message memories in a room.
164
- *
165
- * @param runtime - The agent runtime instance
166
- * @param roomId - The room ID to clear messages from
167
- * @param channelId - The original channel ID (for logging)
168
- * @returns Promise resolving when channel is cleared
169
- */
170
- clearChannel(runtime: IAgentRuntime, roomId: UUID, channelId: string): Promise<void>;
171
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"message-service.d.ts","sourceRoot":"","sources":["../../src/services/message-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,KAAK,EAAE,K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,CAAC,EAAE,eAAe,EAC1B,OAAO,CAAC,EAAE,wBAAwB,GACjC,OAAO,CAAC,uBAAuB,CAAC,CAAC;IAEpC;;;;;;;;;OASG;IACH,aAAa,CACX,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,IAAI,EACX,cAAc,CAAC,EAAE,cAAc,GAC9B,gBAAgB,CAAC;IAEpB;;;;;;;OAOG;IACH,kBAAkB,CAAC,CAAC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;IAEpF;;;;;;;OAOG;IACH,aAAa,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtE;;;;;;;;OAQG;IACH,YAAY,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtF"}
@@ -1,56 +0,0 @@
1
- import { Service } from './types';
2
- import type { IAgentRuntime, ServiceTypeName } from './types';
3
- /**
4
- * Service builder class that provides type-safe service creation
5
- * with automatic type inference
6
- */
7
- export declare class ServiceBuilder<TService extends Service = Service> {
8
- protected serviceType: ServiceTypeName | string;
9
- protected startFn: (runtime: IAgentRuntime) => Promise<TService>;
10
- protected stopFn?: () => Promise<void>;
11
- protected description: string;
12
- constructor(serviceType: ServiceTypeName | string);
13
- /**
14
- * Set the service description
15
- */
16
- withDescription(description: string): this;
17
- /**
18
- * Set the start function for the service
19
- */
20
- withStart(startFn: (runtime: IAgentRuntime) => Promise<TService>): this;
21
- /**
22
- * Set the stop function for the service
23
- */
24
- withStop(stopFn: () => Promise<void>): this;
25
- /**
26
- * Build the service class with all configured properties
27
- */
28
- build(): {
29
- new (runtime?: IAgentRuntime): TService;
30
- serviceType: string;
31
- start(runtime: IAgentRuntime): Promise<TService>;
32
- };
33
- }
34
- /**
35
- * Create a type-safe service builder
36
- * @param serviceType - The service type name
37
- * @returns A new ServiceBuilder instance
38
- */
39
- export declare function createService<TService extends Service = Service>(serviceType: ServiceTypeName | string): ServiceBuilder<TService>;
40
- /**
41
- * Type-safe service definition helper
42
- */
43
- export interface ServiceDefinition<T extends Service = Service> {
44
- serviceType: ServiceTypeName;
45
- description: string;
46
- start: (runtime: IAgentRuntime) => Promise<T>;
47
- stop?: () => Promise<void>;
48
- }
49
- /**
50
- * Define a service with type safety
51
- */
52
- export declare function defineService<T extends Service = Service>(definition: ServiceDefinition<T>): {
53
- new (runtime?: IAgentRuntime): T;
54
- serviceType: ServiceTypeName;
55
- start(runtime: IAgentRuntime): Promise<T>;
56
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../src/services.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE9D;;;GAGG;AACH,qBAAa,cAAc,CAAC,QAAQ,SAAS,OAAO,GAAG,OAAO;IAC5D,SAAS,CAAC,WAAW,EAAE,eAAe,GAAG,MAAM,CAAC;IAChD,SAAS,CAAC,OAAO,EAAG,CAAC,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;IAClE,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,SAAS,CAAC,WAAW,EAAE,MAAM,CAAC;gBAElB,WAAW,EAAE,eAAe,GAAG,MAAM;IAKjD;;OAEG;IACH,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAK1C;;OAEG;IACH,SAAS,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI;IAKvE;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAK3C;;OAEG;IACH,KAAK,IAAI;QACP,KAAK,OAAO,CAAC,EAAE,aAAa,GAAG,QAAQ,CAAC;QACxC,WAAW,EAAE,MAAM,CAAC;QACpB,KAAK,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;KAClD;CAiCF;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,QAAQ,SAAS,OAAO,GAAG,OAAO,EAC9D,WAAW,EAAE,eAAe,GAAG,MAAM,GACpC,cAAc,CAAC,QAAQ,CAAC,CAE1B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO;IAC5D,WAAW,EAAE,eAAe,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAC9C,IAAI,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5B;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,EACvD,UAAU,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAC/B;IACD,KAAK,OAAO,CAAC,EAAE,aAAa,GAAG,CAAC,CAAC;IACjC,WAAW,EAAE,eAAe,CAAC;IAC7B,KAAK,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CAC3C,CAQA"}
@@ -1,10 +0,0 @@
1
- /**
2
- * Session management utilities for ElizaOS.
3
- *
4
- * @module sessions
5
- */
6
- export { buildAcpSessionKey, buildAgentMainSessionKey, buildAgentPeerSessionKey, buildAgentSessionKey, buildGroupHistoryKey, buildSubagentSessionKey, DEFAULT_ACCOUNT_ID, DEFAULT_AGENT_ID, DEFAULT_MAIN_KEY, isAcpSessionKey, isSubagentSessionKey, normalizeAccountId, normalizeAgentId, normalizeMainKey, type ParsedAgentSessionKey, parseAgentSessionKey, resolveAgentIdFromSessionKey, resolveThreadParentSessionKey, resolveThreadSessionKeys, sanitizeAgentId, toAgentRequestSessionKey, toAgentStoreSessionKey, } from './session-key';
7
- export { createSessionEntry, DEFAULT_IDLE_MINUTES, DEFAULT_RESET_TRIGGER, DEFAULT_RESET_TRIGGERS, type GroupKeyResolution, isValidSessionEntry, mergeSessionEntry, type SessionChatType, type SessionDeliveryContext, type SessionEntry, type SessionOrigin, type SessionResolution, type SessionSkillsSnapshot, type SessionStore, } from './types';
8
- export { clearSessionStoreCacheForTest, deleteSessionEntry, getSessionEntry, getSessionEntryById, listSessionKeys, listSessions, loadSessionStore, type LoadSessionStoreOptions, readSessionUpdatedAt, saveSessionStore, updateSessionStore, updateSessionStoreEntry, upsertSessionEntry, } from './store';
9
- export { ensureSafeSessionPath, isWithinStateDir, resolveAgentSessionsDir, resolveDefaultSessionStorePath, resolveSessionFilePath, resolveSessionTranscriptPath, resolveSessionTranscriptsDir, resolveSessionTranscriptsDirForAgent, resolveStateDir, resolveStorePath, } from './paths';
10
- export { createSendPolicyProvider, createSessionProvider, createSessionSkillsProvider, extractSessionContext, getSessionProviders, SessionStateManager, } from './provider';