@elizaos/core 1.0.10 → 1.0.12
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-27AU6HW7.js → chunk-LACDKYHQ.js} +15 -85
- package/dist/{index-KbaTHD-K.d.ts → index-C2b71pQw.d.ts} +3 -3
- package/dist/index.d.ts +4 -5
- package/dist/index.js +1 -1
- package/dist/specs/v1/index.js +1 -1
- package/dist/specs/v1/messages.js +1 -1
- package/dist/specs/v1/posts.js +1 -1
- package/dist/specs/v1/runtime.d.ts +7 -7
- package/dist/specs/v1/runtime.js +1 -1
- package/dist/specs/v1/uuid.js +1 -1
- package/dist/specs/v2/index.d.ts +1 -1
- package/dist/specs/v2/index.js +1 -1
- package/package.json +10 -24
|
@@ -1234,7 +1234,7 @@ async function trimTokens(prompt, maxTokens, runtime) {
|
|
|
1234
1234
|
}
|
|
1235
1235
|
function safeReplacer() {
|
|
1236
1236
|
const seen = /* @__PURE__ */ new WeakSet();
|
|
1237
|
-
return function(
|
|
1237
|
+
return function(_key, value) {
|
|
1238
1238
|
if (typeof value === "object" && value !== null) {
|
|
1239
1239
|
if (seen.has(value)) {
|
|
1240
1240
|
return "[Circular]";
|
|
@@ -2837,66 +2837,6 @@ var AgentRuntime = class {
|
|
|
2837
2837
|
}
|
|
2838
2838
|
}
|
|
2839
2839
|
}
|
|
2840
|
-
async resolvePluginDependencies(characterPlugins) {
|
|
2841
|
-
const resolvedPlugins = /* @__PURE__ */ new Map();
|
|
2842
|
-
const visited = /* @__PURE__ */ new Set();
|
|
2843
|
-
const recursionStack = /* @__PURE__ */ new Set();
|
|
2844
|
-
const finalPluginList = [];
|
|
2845
|
-
for (const plugin of characterPlugins) {
|
|
2846
|
-
if (plugin?.name) {
|
|
2847
|
-
resolvedPlugins.set(plugin.name, plugin);
|
|
2848
|
-
}
|
|
2849
|
-
}
|
|
2850
|
-
const resolve = async (pluginName) => {
|
|
2851
|
-
if (recursionStack.has(pluginName)) {
|
|
2852
|
-
this.logger.error(
|
|
2853
|
-
`Circular dependency detected: ${Array.from(recursionStack).join(" -> ")} -> ${pluginName}`
|
|
2854
|
-
);
|
|
2855
|
-
throw new Error(`Circular dependency detected involving plugin: ${pluginName}`);
|
|
2856
|
-
}
|
|
2857
|
-
if (visited.has(pluginName)) {
|
|
2858
|
-
return;
|
|
2859
|
-
}
|
|
2860
|
-
visited.add(pluginName);
|
|
2861
|
-
recursionStack.add(pluginName);
|
|
2862
|
-
let plugin = resolvedPlugins.get(pluginName);
|
|
2863
|
-
if (!plugin) {
|
|
2864
|
-
plugin = this.allAvailablePlugins.get(pluginName);
|
|
2865
|
-
}
|
|
2866
|
-
if (!plugin) {
|
|
2867
|
-
this.logger.warn(
|
|
2868
|
-
`Dependency plugin "${pluginName}" not found in allAvailablePlugins. Skipping.`
|
|
2869
|
-
);
|
|
2870
|
-
recursionStack.delete(pluginName);
|
|
2871
|
-
return;
|
|
2872
|
-
}
|
|
2873
|
-
if (plugin.dependencies) {
|
|
2874
|
-
for (const depName of plugin.dependencies) {
|
|
2875
|
-
await resolve(depName);
|
|
2876
|
-
}
|
|
2877
|
-
}
|
|
2878
|
-
recursionStack.delete(pluginName);
|
|
2879
|
-
if (!finalPluginList.find((p) => p.name === pluginName)) {
|
|
2880
|
-
finalPluginList.push(plugin);
|
|
2881
|
-
if (!resolvedPlugins.has(pluginName)) {
|
|
2882
|
-
resolvedPlugins.set(pluginName, plugin);
|
|
2883
|
-
}
|
|
2884
|
-
}
|
|
2885
|
-
};
|
|
2886
|
-
for (const plugin of characterPlugins) {
|
|
2887
|
-
if (plugin?.name) {
|
|
2888
|
-
await resolve(plugin.name);
|
|
2889
|
-
}
|
|
2890
|
-
}
|
|
2891
|
-
const finalSet = /* @__PURE__ */ new Map();
|
|
2892
|
-
finalPluginList.forEach((p) => finalSet.set(p.name, resolvedPlugins.get(p.name)));
|
|
2893
|
-
characterPlugins.forEach((p) => {
|
|
2894
|
-
if (p?.name && !finalSet.has(p.name)) {
|
|
2895
|
-
finalSet.set(p.name, p);
|
|
2896
|
-
}
|
|
2897
|
-
});
|
|
2898
|
-
return Array.from(finalSet.values());
|
|
2899
|
-
}
|
|
2900
2840
|
getAllServices() {
|
|
2901
2841
|
return this.services;
|
|
2902
2842
|
}
|
|
@@ -2962,7 +2902,7 @@ var AgentRuntime = class {
|
|
|
2962
2902
|
try {
|
|
2963
2903
|
const room = await this.getRoom(this.agentId);
|
|
2964
2904
|
if (!room) {
|
|
2965
|
-
|
|
2905
|
+
await this.createRoom({
|
|
2966
2906
|
id: this.agentId,
|
|
2967
2907
|
name: this.character.name,
|
|
2968
2908
|
source: "elizaos",
|
|
@@ -3143,7 +3083,7 @@ var AgentRuntime = class {
|
|
|
3143
3083
|
actionId,
|
|
3144
3084
|
prompts: []
|
|
3145
3085
|
};
|
|
3146
|
-
|
|
3086
|
+
await action.handler(this, message, state, {}, callback, responses);
|
|
3147
3087
|
this.logger.debug(`Success: Action ${action.name} executed successfully.`);
|
|
3148
3088
|
this.adapter.log({
|
|
3149
3089
|
entityId: message.entityId,
|
|
@@ -3496,7 +3436,6 @@ var AgentRuntime = class {
|
|
|
3496
3436
|
text: ""
|
|
3497
3437
|
};
|
|
3498
3438
|
const cachedState = skipCache ? emptyObj : await this.stateCache.get(message.id) || emptyObj;
|
|
3499
|
-
const existingProviderNames = cachedState.data.providers ? Object.keys(cachedState.data.providers) : [];
|
|
3500
3439
|
const providerNames = /* @__PURE__ */ new Set();
|
|
3501
3440
|
if (filterList && filterList.length > 0) {
|
|
3502
3441
|
filterList.forEach((name) => providerNames.add(name));
|
|
@@ -3509,7 +3448,6 @@ var AgentRuntime = class {
|
|
|
3509
3448
|
const providersToGet = Array.from(
|
|
3510
3449
|
new Set(this.providers.filter((p) => providerNames.has(p.name)))
|
|
3511
3450
|
).sort((a, b) => (a.position || 0) - (b.position || 0));
|
|
3512
|
-
const providerNamesToGet = providersToGet.map((p) => p.name);
|
|
3513
3451
|
const providerData = await Promise.all(
|
|
3514
3452
|
providersToGet.map(async (provider) => {
|
|
3515
3453
|
const start = Date.now();
|
|
@@ -3523,8 +3461,6 @@ var AgentRuntime = class {
|
|
|
3523
3461
|
};
|
|
3524
3462
|
} catch (error) {
|
|
3525
3463
|
console.error("provider error", provider.name, error);
|
|
3526
|
-
const duration = Date.now() - start;
|
|
3527
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
3528
3464
|
return { values: {}, text: "", data: {}, providerName: provider.name };
|
|
3529
3465
|
}
|
|
3530
3466
|
})
|
|
@@ -3568,9 +3504,6 @@ var AgentRuntime = class {
|
|
|
3568
3504
|
text: providersText
|
|
3569
3505
|
};
|
|
3570
3506
|
this.stateCache.set(message.id, newState);
|
|
3571
|
-
const finalProviderCount = Object.keys(currentProviderResults).length;
|
|
3572
|
-
const finalProviderNames = Object.keys(currentProviderResults);
|
|
3573
|
-
const finalValueKeys = Object.keys(newState.values);
|
|
3574
3507
|
return newState;
|
|
3575
3508
|
}
|
|
3576
3509
|
getService(serviceName) {
|
|
@@ -3755,8 +3688,6 @@ var AgentRuntime = class {
|
|
|
3755
3688
|
});
|
|
3756
3689
|
return response;
|
|
3757
3690
|
} catch (error) {
|
|
3758
|
-
const errorTime = performance.now() - startTime;
|
|
3759
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
3760
3691
|
throw error;
|
|
3761
3692
|
}
|
|
3762
3693
|
}
|
|
@@ -4202,7 +4133,6 @@ var AgentRuntime = class {
|
|
|
4202
4133
|
try {
|
|
4203
4134
|
await handler(this, target, content);
|
|
4204
4135
|
} catch (error) {
|
|
4205
|
-
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
4206
4136
|
this.logger.error(`Error executing send handler for source ${target.source}:`, error);
|
|
4207
4137
|
throw error;
|
|
4208
4138
|
}
|
|
@@ -4402,7 +4332,7 @@ function encryptedCharacter(character) {
|
|
|
4402
4332
|
}
|
|
4403
4333
|
return encryptedChar;
|
|
4404
4334
|
}
|
|
4405
|
-
function decryptedCharacter(character,
|
|
4335
|
+
function decryptedCharacter(character, _runtime) {
|
|
4406
4336
|
const decryptedChar = JSON.parse(JSON.stringify(character));
|
|
4407
4337
|
const salt = getSalt();
|
|
4408
4338
|
if (decryptedChar.settings?.secrets) {
|
|
@@ -4650,9 +4580,9 @@ var AgentRuntime3 = class {
|
|
|
4650
4580
|
get clients() {
|
|
4651
4581
|
return this._runtime.clients;
|
|
4652
4582
|
}
|
|
4653
|
-
registerMemoryManager(
|
|
4583
|
+
registerMemoryManager(_manager) {
|
|
4654
4584
|
}
|
|
4655
|
-
getMemoryManager(
|
|
4585
|
+
getMemoryManager(_tableName) {
|
|
4656
4586
|
}
|
|
4657
4587
|
getService(service) {
|
|
4658
4588
|
return this._runtime.getService(service);
|
|
@@ -4722,7 +4652,7 @@ var AgentRuntime3 = class {
|
|
|
4722
4652
|
* Register an adapter for the agent to use.
|
|
4723
4653
|
* @param adapter The adapter to register.
|
|
4724
4654
|
*/
|
|
4725
|
-
registerAdapter(
|
|
4655
|
+
registerAdapter(_adapter) {
|
|
4726
4656
|
}
|
|
4727
4657
|
/**
|
|
4728
4658
|
* Process the actions of a message.
|
|
@@ -4753,7 +4683,7 @@ var AgentRuntime3 = class {
|
|
|
4753
4683
|
* @param userId - The user ID to ensure the existence of.
|
|
4754
4684
|
* @throws An error if the participant cannot be added.
|
|
4755
4685
|
*/
|
|
4756
|
-
async ensureParticipantExists(
|
|
4686
|
+
async ensureParticipantExists(_userId, _roomId) {
|
|
4757
4687
|
}
|
|
4758
4688
|
/**
|
|
4759
4689
|
* Ensure the existence of a user in the database. If the user does not exist, they are added to the database.
|
|
@@ -4761,12 +4691,12 @@ var AgentRuntime3 = class {
|
|
|
4761
4691
|
* @param userName - The user name to ensure the existence of.
|
|
4762
4692
|
* @returns
|
|
4763
4693
|
*/
|
|
4764
|
-
async ensureUserExists(
|
|
4694
|
+
async ensureUserExists(_userId, _userName, _name, _email, _source) {
|
|
4765
4695
|
}
|
|
4766
4696
|
async ensureParticipantInRoom(userId, roomId) {
|
|
4767
4697
|
return this._runtime.ensureParticipantInRoom(userId, roomId);
|
|
4768
4698
|
}
|
|
4769
|
-
async ensureConnection(userId, roomId, userName,
|
|
4699
|
+
async ensureConnection(userId, roomId, userName, _userScreenName, source) {
|
|
4770
4700
|
return this._runtime.ensureConnection({
|
|
4771
4701
|
userId,
|
|
4772
4702
|
roomId,
|
|
@@ -4799,7 +4729,7 @@ var AgentRuntime3 = class {
|
|
|
4799
4729
|
* @param message The message to compose the state from.
|
|
4800
4730
|
* @returns The state of the agent.
|
|
4801
4731
|
*/
|
|
4802
|
-
async composeState(message,
|
|
4732
|
+
async composeState(message, _additionalKeys = {}) {
|
|
4803
4733
|
return this._runtime.composeState(message, []);
|
|
4804
4734
|
}
|
|
4805
4735
|
async updateRecentMessageState(state) {
|
|
@@ -5227,7 +5157,7 @@ var AgentRuntime2 = class {
|
|
|
5227
5157
|
async registerPlugin(plugin) {
|
|
5228
5158
|
const wrappedPlugin = {
|
|
5229
5159
|
...plugin,
|
|
5230
|
-
init: plugin.init ? async (config,
|
|
5160
|
+
init: plugin.init ? async (config, _runtime) => {
|
|
5231
5161
|
return plugin.init(config, this);
|
|
5232
5162
|
} : void 0
|
|
5233
5163
|
};
|
|
@@ -5268,7 +5198,7 @@ var AgentRuntime2 = class {
|
|
|
5268
5198
|
registerProvider(provider) {
|
|
5269
5199
|
const wrappedProvider = {
|
|
5270
5200
|
...provider,
|
|
5271
|
-
get: async (
|
|
5201
|
+
get: async (_runtime, message, state) => {
|
|
5272
5202
|
return provider.get(this, message, state);
|
|
5273
5203
|
}
|
|
5274
5204
|
};
|
|
@@ -5281,7 +5211,7 @@ var AgentRuntime2 = class {
|
|
|
5281
5211
|
registerAction(action) {
|
|
5282
5212
|
const wrappedAction = {
|
|
5283
5213
|
...action,
|
|
5284
|
-
handler: async (
|
|
5214
|
+
handler: async (_runtime, message, state, options2, callback, responses) => {
|
|
5285
5215
|
return action.handler(this, message, state, options2, callback, responses);
|
|
5286
5216
|
}
|
|
5287
5217
|
};
|
|
@@ -5410,7 +5340,7 @@ var AgentRuntime2 = class {
|
|
|
5410
5340
|
return this._runtime.registerService(service);
|
|
5411
5341
|
}
|
|
5412
5342
|
registerModel(modelType, handler, provider = "v2") {
|
|
5413
|
-
const wrappedHandler = async (
|
|
5343
|
+
const wrappedHandler = async (_runtime, params) => {
|
|
5414
5344
|
return handler(this, params);
|
|
5415
5345
|
};
|
|
5416
5346
|
return this._runtime.registerModel(modelType, wrappedHandler, provider);
|
|
@@ -1116,7 +1116,7 @@ type JSONSchema = {
|
|
|
1116
1116
|
* Parameters for object generation models
|
|
1117
1117
|
* @template T - The expected return type, inferred from schema if provided
|
|
1118
1118
|
*/
|
|
1119
|
-
interface ObjectGenerationParams
|
|
1119
|
+
interface ObjectGenerationParams extends BaseModelParams {
|
|
1120
1120
|
/** The prompt describing the object to generate */
|
|
1121
1121
|
prompt: string;
|
|
1122
1122
|
/** Optional JSON schema for validation */
|
|
@@ -1149,8 +1149,8 @@ interface ModelParamsMap {
|
|
|
1149
1149
|
[ModelType.TEXT_TO_SPEECH]: TextToSpeechParams | string;
|
|
1150
1150
|
[ModelType.AUDIO]: AudioProcessingParams;
|
|
1151
1151
|
[ModelType.VIDEO]: VideoProcessingParams;
|
|
1152
|
-
[ModelType.OBJECT_SMALL]: ObjectGenerationParams
|
|
1153
|
-
[ModelType.OBJECT_LARGE]: ObjectGenerationParams
|
|
1152
|
+
[ModelType.OBJECT_SMALL]: ObjectGenerationParams;
|
|
1153
|
+
[ModelType.OBJECT_LARGE]: ObjectGenerationParams;
|
|
1154
1154
|
[key: string]: BaseModelParams | any;
|
|
1155
1155
|
}
|
|
1156
1156
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as Metadata, S as Service, T as TemplateType, a as State, b as Memory, E as Entity, I as IAgentRuntime, U as UUID, C as ContentType, c as Character, A as Action, d as IDatabaseAdapter, e as Component, L as Log, f as MemoryMetadata, W as World, R as Room, P as Participant, g as Relationship, h as Agent, i as Task, j as Role, k as Evaluator, l as Provider, m as Plugin, n as ServiceTypeName, o as ModelHandler, p as Route, q as RuntimeSettings, H as HandlerCallback, r as ChannelType, s as ModelTypeName, t as ModelResultMap, u as ModelParamsMap, v as TaskWorker, w as SendHandlerFunction, x as TargetInfo, y as Content, z as Setting, B as WorldSettings, O as OnboardingConfig, D as v2 } from './index-
|
|
2
|
-
export { b9 as ActionEventPayload, al as ActionExample, ak as AgentStatus, aQ as AudioProcessingParams, Z as BaseMetadata, aI as BaseModelParams, af as CacheKeyPrefix, b6 as ChannelClearedPayload, ah as ChunkRow, bi as ControlMessage, a2 as CustomMetadata, a_ as DbConnection, a1 as DescriptionMetadata, aH as DetokenizeTextParams, ag as DirectoryItem, _ as DocumentMetadata, aU as EmbeddingSearchResult, Q as EnhancedState, b4 as EntityPayload, ao as EvaluationExample, ba as EvaluatorEventPayload, be as EventHandler, b2 as EventPayload, bd as EventPayloadMap, b0 as EventType, $ as FragmentMetadata, aG as GenerateTextParams, am as Handler, aN as ImageDescriptionParams, aM as ImageGenerationParams, b7 as InvokePayload, av as IsValidServiceType, aS as JSONSchema, ad as KnowledgeItem, ae as KnowledgeScope, G as Media, aV as MemoryRetrievalOptions, Y as MemoryScope, aW as MemorySearchOptions, X as MemoryType, V as MemoryTypeAlias, aj as MessageExample, a3 as MessageMemory, a0 as MessageMetadata, b5 as MessagePayload, bc as MessageReceivedHandlerParams, bb as ModelEventPayload, aF as ModelType, aX as MultiRoomMemoryOptions, aT as ObjectGenerationParams, b1 as PlatformPrefix, aq as PluginEvents, as as Project, ar as ProjectAgent, ap as ProviderResult, ai as RoomMetadata, b8 as RunEventPayload, bh as SOCKET_MESSAGE_TYPE, bl as ServiceBuilder, ax as ServiceClassMap, bn as ServiceDefinition, aD as ServiceError, ay as ServiceInstance, az as ServiceRegistry, aA as ServiceType, at as ServiceTypeRegistry, au as ServiceTypeValue, N as StateArray, K as StateObject, J as StateValue, bg as TaskMetadata, bj as TestCase, bk as TestSuite, aK as TextEmbeddingParams, aJ as TextGenerationParams, aP as TextToSpeechParams, aL as TokenizeTextParams, aO as TranscriptionParams, bf as TypedEventHandler, aB as TypedService, aw as TypedServiceClass, aY as UnifiedMemoryOptions, aZ as UnifiedSearchOptions, a$ as VECTOR_DIMS, an as Validator, aR as VideoProcessingParams, b3 as WorldPayload, F as asUUID, a4 as createMessageMemory, bm as createService, aE as createServiceError, bo as defineService, ac as getMemoryText, aC as getTypedService, a9 as isCustomMetadata, a8 as isDescriptionMetadata, aa as isDocumentMemory, a5 as isDocumentMetadata, ab as isFragmentMemory, a6 as isFragmentMetadata, a7 as isMessageMetadata } from './index-
|
|
1
|
+
import { M as Metadata, S as Service, T as TemplateType, a as State, b as Memory, E as Entity, I as IAgentRuntime, U as UUID, C as ContentType, c as Character, A as Action, d as IDatabaseAdapter, e as Component, L as Log, f as MemoryMetadata, W as World, R as Room, P as Participant, g as Relationship, h as Agent, i as Task, j as Role, k as Evaluator, l as Provider, m as Plugin, n as ServiceTypeName, o as ModelHandler, p as Route, q as RuntimeSettings, H as HandlerCallback, r as ChannelType, s as ModelTypeName, t as ModelResultMap, u as ModelParamsMap, v as TaskWorker, w as SendHandlerFunction, x as TargetInfo, y as Content, z as Setting, B as WorldSettings, O as OnboardingConfig, D as v2 } from './index-C2b71pQw.js';
|
|
2
|
+
export { b9 as ActionEventPayload, al as ActionExample, ak as AgentStatus, aQ as AudioProcessingParams, Z as BaseMetadata, aI as BaseModelParams, af as CacheKeyPrefix, b6 as ChannelClearedPayload, ah as ChunkRow, bi as ControlMessage, a2 as CustomMetadata, a_ as DbConnection, a1 as DescriptionMetadata, aH as DetokenizeTextParams, ag as DirectoryItem, _ as DocumentMetadata, aU as EmbeddingSearchResult, Q as EnhancedState, b4 as EntityPayload, ao as EvaluationExample, ba as EvaluatorEventPayload, be as EventHandler, b2 as EventPayload, bd as EventPayloadMap, b0 as EventType, $ as FragmentMetadata, aG as GenerateTextParams, am as Handler, aN as ImageDescriptionParams, aM as ImageGenerationParams, b7 as InvokePayload, av as IsValidServiceType, aS as JSONSchema, ad as KnowledgeItem, ae as KnowledgeScope, G as Media, aV as MemoryRetrievalOptions, Y as MemoryScope, aW as MemorySearchOptions, X as MemoryType, V as MemoryTypeAlias, aj as MessageExample, a3 as MessageMemory, a0 as MessageMetadata, b5 as MessagePayload, bc as MessageReceivedHandlerParams, bb as ModelEventPayload, aF as ModelType, aX as MultiRoomMemoryOptions, aT as ObjectGenerationParams, b1 as PlatformPrefix, aq as PluginEvents, as as Project, ar as ProjectAgent, ap as ProviderResult, ai as RoomMetadata, b8 as RunEventPayload, bh as SOCKET_MESSAGE_TYPE, bl as ServiceBuilder, ax as ServiceClassMap, bn as ServiceDefinition, aD as ServiceError, ay as ServiceInstance, az as ServiceRegistry, aA as ServiceType, at as ServiceTypeRegistry, au as ServiceTypeValue, N as StateArray, K as StateObject, J as StateValue, bg as TaskMetadata, bj as TestCase, bk as TestSuite, aK as TextEmbeddingParams, aJ as TextGenerationParams, aP as TextToSpeechParams, aL as TokenizeTextParams, aO as TranscriptionParams, bf as TypedEventHandler, aB as TypedService, aw as TypedServiceClass, aY as UnifiedMemoryOptions, aZ as UnifiedSearchOptions, a$ as VECTOR_DIMS, an as Validator, aR as VideoProcessingParams, b3 as WorldPayload, F as asUUID, a4 as createMessageMemory, bm as createService, aE as createServiceError, bo as defineService, ac as getMemoryText, aC as getTypedService, a9 as isCustomMetadata, a8 as isDescriptionMetadata, aa as isDocumentMemory, a5 as isDocumentMetadata, ab as isFragmentMemory, a6 as isFragmentMetadata, a7 as isMessageMetadata } from './index-C2b71pQw.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import * as pino from 'pino';
|
|
5
5
|
import * as browser from '@sentry/browser';
|
|
@@ -485,7 +485,7 @@ declare function splitChunks(content: string, chunkSize?: number, bleed?: number
|
|
|
485
485
|
* Trims the provided text prompt to a specified token limit using a tokenizer model and type.
|
|
486
486
|
*/
|
|
487
487
|
declare function trimTokens(prompt: string, maxTokens: number, runtime: IAgentRuntime): Promise<string>;
|
|
488
|
-
declare function safeReplacer(): (
|
|
488
|
+
declare function safeReplacer(): (_key: string, value: any) => any;
|
|
489
489
|
/**
|
|
490
490
|
* Parses a string to determine its boolean equivalent.
|
|
491
491
|
*
|
|
@@ -1402,7 +1402,6 @@ declare class AgentRuntime implements IAgentRuntime {
|
|
|
1402
1402
|
*/
|
|
1403
1403
|
getCurrentRunId(): UUID;
|
|
1404
1404
|
registerPlugin(plugin: Plugin): Promise<void>;
|
|
1405
|
-
private resolvePluginDependencies;
|
|
1406
1405
|
getAllServices(): Map<ServiceTypeName, Service>;
|
|
1407
1406
|
stop(): Promise<void>;
|
|
1408
1407
|
initialize(): Promise<void>;
|
|
@@ -1702,7 +1701,7 @@ declare function encryptedCharacter(character: Character): Character;
|
|
|
1702
1701
|
* @param {IAgentRuntime} runtime - The runtime information needed for salt generation
|
|
1703
1702
|
* @returns {Character} - A copy of the character with decrypted secrets
|
|
1704
1703
|
*/
|
|
1705
|
-
declare function decryptedCharacter(character: Character,
|
|
1704
|
+
declare function decryptedCharacter(character: Character, _runtime: IAgentRuntime): Character;
|
|
1706
1705
|
/**
|
|
1707
1706
|
* Helper function to encrypt all string values in an object
|
|
1708
1707
|
* @param {Record<string, any>} obj - Object with values to encrypt
|
package/dist/index.js
CHANGED
package/dist/specs/v1/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
formatMessages3 as formatMessages,
|
|
4
4
|
formatTimestamp3 as formatTimestamp,
|
|
5
5
|
getActorDetails
|
|
6
|
-
} from "../../chunk-
|
|
6
|
+
} from "../../chunk-LACDKYHQ.js";
|
|
7
7
|
import "../../chunk-2HSL25IJ.js";
|
|
8
8
|
import "../../chunk-WO7Z3GE6.js";
|
|
9
9
|
import "../../chunk-U2ADTLZY.js";
|
package/dist/specs/v1/posts.js
CHANGED
|
@@ -26,8 +26,8 @@ declare class AgentRuntime implements IAgentRuntime {
|
|
|
26
26
|
get loreManager(): any;
|
|
27
27
|
get cacheManager(): any;
|
|
28
28
|
get clients(): any;
|
|
29
|
-
registerMemoryManager(
|
|
30
|
-
getMemoryManager(
|
|
29
|
+
registerMemoryManager(_manager: IMemoryManager): void;
|
|
30
|
+
getMemoryManager(_tableName: string): any;
|
|
31
31
|
getService<T extends Service>(service: ServiceType): T | null;
|
|
32
32
|
registerService(service: Service): Promise<void>;
|
|
33
33
|
/**
|
|
@@ -93,7 +93,7 @@ declare class AgentRuntime implements IAgentRuntime {
|
|
|
93
93
|
* Register an adapter for the agent to use.
|
|
94
94
|
* @param adapter The adapter to register.
|
|
95
95
|
*/
|
|
96
|
-
registerAdapter(
|
|
96
|
+
registerAdapter(_adapter: Adapter): void;
|
|
97
97
|
/**
|
|
98
98
|
* Process the actions of a message.
|
|
99
99
|
* @param message The message to process.
|
|
@@ -114,16 +114,16 @@ declare class AgentRuntime implements IAgentRuntime {
|
|
|
114
114
|
* @param userId - The user ID to ensure the existence of.
|
|
115
115
|
* @throws An error if the participant cannot be added.
|
|
116
116
|
*/
|
|
117
|
-
ensureParticipantExists(
|
|
117
|
+
ensureParticipantExists(_userId: UUID, _roomId: UUID): Promise<void>;
|
|
118
118
|
/**
|
|
119
119
|
* Ensure the existence of a user in the database. If the user does not exist, they are added to the database.
|
|
120
120
|
* @param userId - The user ID to ensure the existence of.
|
|
121
121
|
* @param userName - The user name to ensure the existence of.
|
|
122
122
|
* @returns
|
|
123
123
|
*/
|
|
124
|
-
ensureUserExists(
|
|
124
|
+
ensureUserExists(_userId: UUID, _userName: string | null, _name: string | null, _email?: string | null, _source?: string | null): Promise<void>;
|
|
125
125
|
ensureParticipantInRoom(userId: UUID, roomId: UUID): Promise<any>;
|
|
126
|
-
ensureConnection(userId: UUID, roomId: UUID, userName?: string,
|
|
126
|
+
ensureConnection(userId: UUID, roomId: UUID, userName?: string, _userScreenName?: string, source?: string): Promise<any>;
|
|
127
127
|
/**
|
|
128
128
|
* Ensure the existence of a room between the agent and a user. If no room exists, a new room is created and the user
|
|
129
129
|
* and agent are added as participants. The room ID is returned.
|
|
@@ -137,7 +137,7 @@ declare class AgentRuntime implements IAgentRuntime {
|
|
|
137
137
|
* @param message The message to compose the state from.
|
|
138
138
|
* @returns The state of the agent.
|
|
139
139
|
*/
|
|
140
|
-
composeState(message: Memory,
|
|
140
|
+
composeState(message: Memory, _additionalKeys?: {
|
|
141
141
|
[key: string]: unknown;
|
|
142
142
|
}): Promise<any>;
|
|
143
143
|
updateRecentMessageState(state: State): Promise<State>;
|
package/dist/specs/v1/runtime.js
CHANGED
package/dist/specs/v1/uuid.js
CHANGED
package/dist/specs/v2/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { a as Action, w as ActionEventPayload, A as ActionExample, f as Agent, x as AgentStatus, y as AudioProcessingParams, B as BaseMetadata, z as BaseModelParams, D as CacheKeyPrefix, F as ChannelClearedPayload, G as ChannelType, l as Character, J as ChunkRow, b as Component, K as ComponentData, C as Content, N as ContentType, O as ControlMessage, Q as CustomMetadata, V as DbConnection, X as DeriveKeyAttestationData, Y as DescriptionMetadata, Z as DetokenizeTextParams, _ as DirectoryItem, $ as DocumentMetadata, a0 as EmbeddingSearchResult, a1 as EnhancedState, E as Entity, a2 as EntityPayload, a3 as EvaluationExample, m as Evaluator, a4 as EvaluatorEventPayload, a5 as EventDataObject, a6 as EventHandler, a7 as EventPayload, a8 as EventPayloadMap, a9 as EventType, aa as FragmentMetadata, ab as GenerateTextParams, ac as Handler, H as HandlerCallback, g as IAgentRuntime, I as IDatabaseAdapter, ad as ImageDescriptionParams, ae as ImageGenerationParams, af as InvokePayload, ag as IsValidServiceType, ah as JSONSchema, ai as KnowledgeItem, aj as KnowledgeScope, L as Log, ak as Media, M as Memory, c as MemoryMetadata, al as MemoryRetrievalOptions, am as MemoryScope, an as MemorySearchOptions, ao as MemoryType, ap as MemoryTypeAlias, aq as MessageExample, ar as MessageMemory, as as MessageMetadata, at as MessagePayload, au as MessageReceivedHandlerParams, av as MetadataObject, aw as ModelEventPayload, ax as ModelHandler, r as ModelParamsMap, q as ModelResultMap, ay as ModelType, p as ModelTypeName, az as MultiRoomMemoryOptions, aA as ObjectGenerationParams, aB as OnboardingConfig, d as Participant, aC as PlatformPrefix, n as Plugin, aD as PluginEvents, aE as Project, aF as ProjectAgent, P as Provider, aG as ProviderResult, e as Relationship, aH as RemoteAttestationMessage, aI as RemoteAttestationQuote, h as Role, R as Room, aJ as RoomMetadata, k as Route, aK as RunEventPayload, o as RuntimeSettings, aL as SOCKET_MESSAGE_TYPE, t as SendHandlerFunction, j as Service, aM as ServiceClassMap, aN as ServiceConfig, aO as ServiceError, aP as ServiceInstance, aQ as ServiceRegistry, aR as ServiceType, i as ServiceTypeName, aS as ServiceTypeRegistry, aT as ServiceTypeValue, aU as Setting, S as State, aV as StateArray, aW as StateObject, aX as StateValue, aY as TEEMode, u as TargetInfo, T as Task, aZ as TaskMetadata, s as TaskWorker, a_ as TeeAgent, a$ as TeePluginConfig, b0 as TeeType, b1 as TeeVendorConfig, v as TemplateType, b2 as TestCase, b3 as TestSuite, b4 as TextEmbeddingParams, b5 as TextGenerationParams, b6 as TextToSpeechParams, b7 as TokenizeTextParams, b8 as TranscriptionParams, b9 as TypedEventHandler, ba as TypedService, bb as TypedServiceClass, U as UUID, bc as UnifiedMemoryOptions, bd as UnifiedSearchOptions, be as VECTOR_DIMS, bf as Validator, bg as VideoProcessingParams, W as World, bh as WorldPayload, bi as WorldSettings, bj as asUUID, bk as createMessageMemory, bl as createServiceError, bm as getMemoryText, bn as getTypedService, bo as isCustomMetadata, bp as isDescriptionMetadata, bq as isDocumentMemory, br as isDocumentMetadata, bs as isFragmentMemory, bt as isFragmentMetadata, bu as isMessageMetadata } from '../../types-CpAVqV6l.js';
|
|
2
|
-
export { bI as AgentRuntime, bs as DatabaseAdapter, bH as Semaphore, bE as ServerOwnershipState, ca as ServiceBuilder, cc as ServiceDefinition, b_ as addHeader, bC as booleanFooter, bp as composeActionExamples, bY as composePrompt, bZ as composePromptFromState, cb as createService, bK as createSettingFromConfig, bu as createUniqueUuid, bX as decryptObjectValues, bJ as decryptSecret, bJ as decryptStringValue, bV as decryptedCharacter, cd as defineService, by as elizaLogger, bW as encryptObjectValues, bM as encryptStringValue, bU as encryptedCharacter, bt as findEntityByName, bG as findWorldsForOwner, bq as formatActionNames, br as formatActions, bw as formatEntities, c0 as formatMessages, b$ as formatPosts, c1 as formatTimestamp, bv as getEntityDetails, bL as getSalt, bF as getUserServerRole, bS as getWorldSettings, bD as imageDescriptionTemplate, bT as initializeOnboarding, bx as logger, bA as messageHandlerTemplate, c7 as parseBooleanFromText, c6 as parseJSONObjectFromText, c5 as parseKeyValueXml, bB as postCreationTemplate, c8 as safeReplacer, bN as saltSettingValue, bP as saltWorldSettings, bz as shouldRespondTemplate, c3 as stringToUuid, c9 as trimTokens, c4 as truncateToCompleteSentence, bO as unsaltSettingValue, bQ as unsaltWorldSettings, bR as updateWorldSettings, c2 as validateUuid } from '../../index-
|
|
2
|
+
export { bI as AgentRuntime, bs as DatabaseAdapter, bH as Semaphore, bE as ServerOwnershipState, ca as ServiceBuilder, cc as ServiceDefinition, b_ as addHeader, bC as booleanFooter, bp as composeActionExamples, bY as composePrompt, bZ as composePromptFromState, cb as createService, bK as createSettingFromConfig, bu as createUniqueUuid, bX as decryptObjectValues, bJ as decryptSecret, bJ as decryptStringValue, bV as decryptedCharacter, cd as defineService, by as elizaLogger, bW as encryptObjectValues, bM as encryptStringValue, bU as encryptedCharacter, bt as findEntityByName, bG as findWorldsForOwner, bq as formatActionNames, br as formatActions, bw as formatEntities, c0 as formatMessages, b$ as formatPosts, c1 as formatTimestamp, bv as getEntityDetails, bL as getSalt, bF as getUserServerRole, bS as getWorldSettings, bD as imageDescriptionTemplate, bT as initializeOnboarding, bx as logger, bA as messageHandlerTemplate, c7 as parseBooleanFromText, c6 as parseJSONObjectFromText, c5 as parseKeyValueXml, bB as postCreationTemplate, c8 as safeReplacer, bN as saltSettingValue, bP as saltWorldSettings, bz as shouldRespondTemplate, c3 as stringToUuid, c9 as trimTokens, c4 as truncateToCompleteSentence, bO as unsaltSettingValue, bQ as unsaltWorldSettings, bR as updateWorldSettings, c2 as validateUuid } from '../../index-C2b71pQw.js';
|
package/dist/specs/v2/index.js
CHANGED
|
@@ -78,7 +78,7 @@ import {
|
|
|
78
78
|
unsaltWorldSettings2 as unsaltWorldSettings,
|
|
79
79
|
updateWorldSettings2 as updateWorldSettings,
|
|
80
80
|
validateUuid2 as validateUuid
|
|
81
|
-
} from "../../chunk-
|
|
81
|
+
} from "../../chunk-LACDKYHQ.js";
|
|
82
82
|
import "../../chunk-2HSL25IJ.js";
|
|
83
83
|
import "../../chunk-WO7Z3GE6.js";
|
|
84
84
|
import "../../chunk-U2ADTLZY.js";
|
package/package.json
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elizaos/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
8
8
|
"types": "dist/index.d.ts",
|
|
9
|
+
"bun": "./src/index.ts",
|
|
9
10
|
"exports": {
|
|
10
11
|
"./package.json": "./package.json",
|
|
11
12
|
".": {
|
|
13
|
+
"bun": "./src/index.ts",
|
|
12
14
|
"import": {
|
|
13
15
|
"types": "./dist/index.d.ts",
|
|
14
16
|
"default": "./dist/index.js"
|
|
@@ -43,38 +45,22 @@
|
|
|
43
45
|
"format:check": "prettier --check ./src",
|
|
44
46
|
"lint": "prettier --write ./src"
|
|
45
47
|
},
|
|
46
|
-
"author": "",
|
|
48
|
+
"author": "ElizaOS",
|
|
47
49
|
"license": "MIT",
|
|
48
50
|
"devDependencies": {
|
|
49
|
-
"@
|
|
50
|
-
"@rollup/plugin-commonjs": "25.0.8",
|
|
51
|
-
"@rollup/plugin-json": "6.1.0",
|
|
52
|
-
"@rollup/plugin-replace": "5.0.7",
|
|
53
|
-
"@rollup/plugin-terser": "0.1.0",
|
|
54
|
-
"@rollup/plugin-typescript": "11.1.6",
|
|
55
|
-
"@types/mocha": "10.0.10",
|
|
56
|
-
"@types/node": "^22.15.3",
|
|
51
|
+
"@types/node": "^24.0.3",
|
|
57
52
|
"@types/uuid": "10.0.0",
|
|
58
|
-
"@typescript-eslint/eslint-plugin": "8.26.0",
|
|
59
|
-
"@typescript-eslint/parser": "8.26.0",
|
|
60
|
-
"lint-staged": "15.2.10",
|
|
61
|
-
"nodemon": "3.1.7",
|
|
62
|
-
"pm2": "5.4.3",
|
|
63
53
|
"prettier": "3.5.3",
|
|
64
|
-
"rimraf": "6.0.1",
|
|
65
|
-
"rollup": "2.79.2",
|
|
66
|
-
"ts-node": "10.9.2",
|
|
67
|
-
"tslib": "2.8.1",
|
|
68
54
|
"tsup": "8.5.0",
|
|
69
|
-
"typescript": "5.8.
|
|
55
|
+
"typescript": "5.8.3"
|
|
70
56
|
},
|
|
71
57
|
"dependencies": {
|
|
72
58
|
"@sentry/browser": "^9.22.0",
|
|
73
59
|
"buffer": "^6.0.3",
|
|
74
60
|
"crypto-browserify": "^3.12.1",
|
|
75
|
-
"dotenv": "16.
|
|
61
|
+
"dotenv": "16.5.0",
|
|
76
62
|
"events": "^3.3.0",
|
|
77
|
-
"glob": "11.0.
|
|
63
|
+
"glob": "11.0.3",
|
|
78
64
|
"handlebars": "^4.7.8",
|
|
79
65
|
"js-sha1": "0.7.0",
|
|
80
66
|
"langchain": "^0.3.15",
|
|
@@ -83,11 +69,11 @@
|
|
|
83
69
|
"pino-pretty": "^13.0.0",
|
|
84
70
|
"stream-browserify": "^3.0.0",
|
|
85
71
|
"unique-names-generator": "4.7.1",
|
|
86
|
-
"uuid": "11.0
|
|
72
|
+
"uuid": "11.1.0",
|
|
87
73
|
"zod": "^3.24.4"
|
|
88
74
|
},
|
|
89
75
|
"publishConfig": {
|
|
90
76
|
"access": "public"
|
|
91
77
|
},
|
|
92
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "47425598c211a43748abe7386d4259e1fb7080e7"
|
|
93
79
|
}
|