@elizaos/core 1.0.12 → 1.0.13

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.
@@ -1081,7 +1081,15 @@ var formatMessages = ({
1081
1081
  const messageThought = message.content.thought;
1082
1082
  const formattedName = entities.find((entity) => entity.id === message.entityId)?.names[0] || "Unknown User";
1083
1083
  const attachments = message.content.attachments;
1084
- const attachmentString = attachments && attachments.length > 0 ? ` (Attachments: ${attachments.map((media) => `[${media.id} - ${media.title} (${media.url})]`).join(", ")})` : null;
1084
+ const attachmentString = attachments && attachments.length > 0 ? ` (Attachments: ${attachments.map((media) => {
1085
+ const lines = [`[${media.id} - ${media.title} (${media.url})]`];
1086
+ if (media.text) lines.push(`Text: ${media.text}`);
1087
+ if (media.description) lines.push(`Description: ${media.description}`);
1088
+ return lines.join("\n");
1089
+ }).join(
1090
+ // Use comma separator only if all attachments are single-line (no text/description)
1091
+ attachments.every((media) => !media.text && !media.description) ? ", " : "\n"
1092
+ )})` : null;
1085
1093
  const messageTime = new Date(message.createdAt);
1086
1094
  const hours = messageTime.getHours().toString().padStart(2, "0");
1087
1095
  const minutes = messageTime.getMinutes().toString().padStart(2, "0");
@@ -1303,6 +1311,10 @@ var getContentTypeFromMimeType = (mimeType) => {
1303
1311
  }
1304
1312
  return void 0;
1305
1313
  };
1314
+ function getLocalServerUrl(path) {
1315
+ const port = process.env.SERVER_PORT || "3000";
1316
+ return `http://localhost:${port}${path}`;
1317
+ }
1306
1318
 
1307
1319
  // src/schemas/character.ts
1308
1320
  import { z as z2 } from "zod";
@@ -3038,8 +3050,13 @@ var AgentRuntime = class {
3038
3050
  this.logger.debug(`Success: Calling action: ${responseAction}`);
3039
3051
  const normalizedResponseAction = normalizeAction(responseAction);
3040
3052
  let action = this.actions.find(
3041
- (a) => normalizeAction(a.name).includes(normalizedResponseAction) || normalizedResponseAction.includes(normalizeAction(a.name))
3053
+ (a) => normalizeAction(a.name) === normalizedResponseAction
3042
3054
  );
3055
+ if (!action) {
3056
+ action = this.actions.find(
3057
+ (a) => normalizeAction(a.name).includes(normalizedResponseAction) || normalizedResponseAction.includes(normalizeAction(a.name))
3058
+ );
3059
+ }
3043
3060
  if (action) {
3044
3061
  this.logger.debug(`Success: Found action: ${action?.name}`);
3045
3062
  } else {
@@ -5814,6 +5831,7 @@ export {
5814
5831
  validateUuid,
5815
5832
  stringToUuid,
5816
5833
  getContentTypeFromMimeType,
5834
+ getLocalServerUrl,
5817
5835
  characterSchema,
5818
5836
  validateCharacter,
5819
5837
  parseAndValidateCharacter,
package/dist/index.d.ts CHANGED
@@ -512,6 +512,7 @@ declare function validateUuid(value: unknown): UUID | null;
512
512
  */
513
513
  declare function stringToUuid(target: string | number): UUID;
514
514
  declare const getContentTypeFromMimeType: (mimeType: string) => ContentType | undefined;
515
+ declare function getLocalServerUrl(path: string): string;
515
516
 
516
517
  declare const characterSchema: z.ZodObject<{
517
518
  id: z.ZodOptional<z.ZodString>;
@@ -1719,4 +1720,4 @@ declare function decryptObjectValues(obj: Record<string, any>, salt: string): Re
1719
1720
 
1720
1721
  declare const defaultSpec: typeof v2;
1721
1722
 
1722
- export { Action, Agent, AgentRuntime, ChannelType, Character, type CharacterValidationResult, Component, Content, ContentType, DatabaseAdapter, type DeriveKeyAttestationData, Entity, Evaluator, HandlerCallback, IAgentRuntime, IDatabaseAdapter, ILpService, ITokenDataService, IWalletService, Log, type LpPositionDetails, Memory, MemoryMetadata, Metadata, ModelHandler, ModelParamsMap, ModelResultMap, ModelTypeName, OnboardingConfig, Participant, Plugin, type PoolInfo, Provider, Relationship, type RemoteAttestationMessage, type RemoteAttestationQuote, Role, Room, Route, RuntimeSettings, Semaphore, SendHandlerFunction, type ServerOwnershipState, Service, ServiceTypeName, Setting, State, TEEMode, TargetInfo, Task, TaskWorker, type TeeAgent, type TeePluginConfig, TeeType, TemplateType, type TokenBalance, type TokenData, type TransactionResult, UUID, type WalletAsset, type WalletPortfolio, World, WorldSettings, addHeader, booleanFooter, characterSchema, composeActionExamples, composePrompt, composePromptFromState, createLogger, createSettingFromConfig, createUniqueUuid, decryptObjectValues, decryptStringValue as decryptSecret, decryptStringValue, decryptedCharacter, defaultSpec, elizaLogger, encryptObjectValues, encryptStringValue, encryptedCharacter, findEntityByName, findWorldsForOwner, formatActionNames, formatActions, formatEntities, formatMessages, formatPosts, formatTimestamp, getContentTypeFromMimeType, getEntityDetails, getSalt, getUserServerRole, getWorldSettings, imageDescriptionTemplate, initializeOnboarding, isValidCharacter, logger, messageHandlerTemplate, normalizeJsonString, parseAndValidateCharacter, parseBooleanFromText, parseJSONObjectFromText, parseKeyValueXml, postCreationTemplate, safeReplacer, saltSettingValue, saltWorldSettings, shouldRespondTemplate, splitChunks, stringToUuid, trimTokens, truncateToCompleteSentence, unsaltSettingValue, unsaltWorldSettings, updateWorldSettings, v2, validateCharacter, validateUuid };
1723
+ export { Action, Agent, AgentRuntime, ChannelType, Character, type CharacterValidationResult, Component, Content, ContentType, DatabaseAdapter, type DeriveKeyAttestationData, Entity, Evaluator, HandlerCallback, IAgentRuntime, IDatabaseAdapter, ILpService, ITokenDataService, IWalletService, Log, type LpPositionDetails, Memory, MemoryMetadata, Metadata, ModelHandler, ModelParamsMap, ModelResultMap, ModelTypeName, OnboardingConfig, Participant, Plugin, type PoolInfo, Provider, Relationship, type RemoteAttestationMessage, type RemoteAttestationQuote, Role, Room, Route, RuntimeSettings, Semaphore, SendHandlerFunction, type ServerOwnershipState, Service, ServiceTypeName, Setting, State, TEEMode, TargetInfo, Task, TaskWorker, type TeeAgent, type TeePluginConfig, TeeType, TemplateType, type TokenBalance, type TokenData, type TransactionResult, UUID, type WalletAsset, type WalletPortfolio, World, WorldSettings, addHeader, booleanFooter, characterSchema, composeActionExamples, composePrompt, composePromptFromState, createLogger, createSettingFromConfig, createUniqueUuid, decryptObjectValues, decryptStringValue as decryptSecret, decryptStringValue, decryptedCharacter, defaultSpec, elizaLogger, encryptObjectValues, encryptStringValue, encryptedCharacter, findEntityByName, findWorldsForOwner, formatActionNames, formatActions, formatEntities, formatMessages, formatPosts, formatTimestamp, getContentTypeFromMimeType, getEntityDetails, getLocalServerUrl, getSalt, getUserServerRole, getWorldSettings, imageDescriptionTemplate, initializeOnboarding, isValidCharacter, logger, messageHandlerTemplate, normalizeJsonString, parseAndValidateCharacter, parseBooleanFromText, parseJSONObjectFromText, parseKeyValueXml, postCreationTemplate, safeReplacer, saltSettingValue, saltWorldSettings, shouldRespondTemplate, splitChunks, stringToUuid, trimTokens, truncateToCompleteSentence, unsaltSettingValue, unsaltWorldSettings, updateWorldSettings, v2, validateCharacter, validateUuid };
package/dist/index.js CHANGED
@@ -55,6 +55,7 @@ import {
55
55
  formatTimestamp,
56
56
  getContentTypeFromMimeType,
57
57
  getEntityDetails,
58
+ getLocalServerUrl,
58
59
  getMemoryText,
59
60
  getSalt,
60
61
  getTypedService,
@@ -93,7 +94,7 @@ import {
93
94
  v2_exports,
94
95
  validateCharacter,
95
96
  validateUuid
96
- } from "./chunk-LACDKYHQ.js";
97
+ } from "./chunk-NILFKGGL.js";
97
98
  import "./chunk-2HSL25IJ.js";
98
99
  import "./chunk-WO7Z3GE6.js";
99
100
  import "./chunk-U2ADTLZY.js";
@@ -158,6 +159,7 @@ export {
158
159
  formatTimestamp,
159
160
  getContentTypeFromMimeType,
160
161
  getEntityDetails,
162
+ getLocalServerUrl,
161
163
  getMemoryText,
162
164
  getSalt,
163
165
  getTypedService,
@@ -7,7 +7,7 @@ import {
7
7
  formatTimestamp3 as formatTimestamp,
8
8
  generateUuidFromString,
9
9
  getActorDetails
10
- } from "../../chunk-LACDKYHQ.js";
10
+ } from "../../chunk-NILFKGGL.js";
11
11
  import {
12
12
  createTemplateFunction,
13
13
  getTemplateValues,
@@ -3,7 +3,7 @@ import {
3
3
  formatMessages3 as formatMessages,
4
4
  formatTimestamp3 as formatTimestamp,
5
5
  getActorDetails
6
- } from "../../chunk-LACDKYHQ.js";
6
+ } from "../../chunk-NILFKGGL.js";
7
7
  import "../../chunk-2HSL25IJ.js";
8
8
  import "../../chunk-WO7Z3GE6.js";
9
9
  import "../../chunk-U2ADTLZY.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  formatPosts3 as formatPosts
3
- } from "../../chunk-LACDKYHQ.js";
3
+ } from "../../chunk-NILFKGGL.js";
4
4
  import "../../chunk-2HSL25IJ.js";
5
5
  import "../../chunk-WO7Z3GE6.js";
6
6
  import "../../chunk-U2ADTLZY.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AgentRuntime3 as AgentRuntime
3
- } from "../../chunk-LACDKYHQ.js";
3
+ } from "../../chunk-NILFKGGL.js";
4
4
  import "../../chunk-2HSL25IJ.js";
5
5
  import "../../chunk-WO7Z3GE6.js";
6
6
  import "../../chunk-U2ADTLZY.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  asUUID3 as asUUID,
3
3
  generateUuidFromString
4
- } from "../../chunk-LACDKYHQ.js";
4
+ } from "../../chunk-NILFKGGL.js";
5
5
  import "../../chunk-2HSL25IJ.js";
6
6
  import "../../chunk-WO7Z3GE6.js";
7
7
  import "../../chunk-U2ADTLZY.js";
@@ -78,7 +78,7 @@ import {
78
78
  unsaltWorldSettings2 as unsaltWorldSettings,
79
79
  updateWorldSettings2 as updateWorldSettings,
80
80
  validateUuid2 as validateUuid
81
- } from "../../chunk-LACDKYHQ.js";
81
+ } from "../../chunk-NILFKGGL.js";
82
82
  import "../../chunk-2HSL25IJ.js";
83
83
  import "../../chunk-WO7Z3GE6.js";
84
84
  import "../../chunk-U2ADTLZY.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elizaos/core",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -75,5 +75,5 @@
75
75
  "publishConfig": {
76
76
  "access": "public"
77
77
  },
78
- "gitHead": "47425598c211a43748abe7386d4259e1fb7080e7"
78
+ "gitHead": "7a3c8a32f1088d00a9c9df59383b02aa532be948"
79
79
  }