@elizaos/core 1.5.9-alpha.8 → 1.5.9-beta.0
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/browser/index.browser.js +46 -46
- package/dist/browser/index.browser.js.map +8 -8
- package/dist/index.browser.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.node.d.ts +1 -0
- package/dist/index.node.d.ts.map +1 -1
- package/dist/node/index.node.js +130 -10
- package/dist/node/index.node.js.map +10 -9
- package/dist/runtime.d.ts.map +1 -1
- package/dist/utils/paths.d.ts +93 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../src/index.browser.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,SAAS,CAAC;AAGxB,cAAc,SAAS,CAAC;AAGxB,cAAc,qBAAqB,CAAC;AAGpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAI/B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../src/index.browser.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,SAAS,CAAC;AAGxB,cAAc,SAAS,CAAC;AAGxB,cAAc,qBAAqB,CAAC;AAGpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAI/B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AAGzB,eAAO,MAAM,SAAS,OAAO,CAAC;AAC9B,eAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B;;;GAGG;AACH,eAAO,MAAM,YAAY;;;;;;CAGxB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export * from './utils';
|
|
|
10
10
|
export * from './schemas/character';
|
|
11
11
|
export * from './utils/environment';
|
|
12
12
|
export * from './utils/buffer';
|
|
13
|
+
export * from './utils/paths';
|
|
13
14
|
export * from './actions';
|
|
14
15
|
export * from './database';
|
|
15
16
|
export * from './entities';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,cAAc,SAAS,CAAC;AAGxB,cAAc,SAAS,CAAC;AAGxB,cAAc,qBAAqB,CAAC;AAGpC,cAAc,qBAAqB,CAAC;AAGpC,cAAc,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,cAAc,SAAS,CAAC;AAGxB,cAAc,SAAS,CAAC;AAGxB,cAAc,qBAAqB,CAAC;AAGpC,cAAc,qBAAqB,CAAC;AAGpC,cAAc,gBAAgB,CAAC;AAI/B,cAAc,eAAe,CAAC;AAG9B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AAGzB,eAAO,MAAM,SAAS,SAG+B,CAAC;AACtD,eAAO,MAAM,MAAM,SAG2B,CAAC;AAG/C,cAAc,uBAAuB,CAAC"}
|
package/dist/index.node.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export * from './schemas/character';
|
|
|
10
10
|
export * from './utils/environment';
|
|
11
11
|
export * from './utils/buffer';
|
|
12
12
|
export * from './utils/server-health';
|
|
13
|
+
export * from './utils/paths';
|
|
13
14
|
export * from './actions';
|
|
14
15
|
export * from './database';
|
|
15
16
|
export * from './entities';
|
package/dist/index.node.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.node.d.ts","sourceRoot":"","sources":["../src/index.node.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,SAAS,CAAC;AAGxB,cAAc,SAAS,CAAC;AAGxB,cAAc,qBAAqB,CAAC;AAGpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.node.d.ts","sourceRoot":"","sources":["../src/index.node.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,SAAS,CAAC;AAGxB,cAAc,SAAS,CAAC;AAGxB,cAAc,qBAAqB,CAAC;AAGpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAG9B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AAGzB,eAAO,MAAM,SAAS,QAAQ,CAAC;AAC/B,eAAO,MAAM,MAAM,OAAO,CAAC"}
|
package/dist/node/index.node.js
CHANGED
|
@@ -19680,8 +19680,8 @@ var require_reporter = __commonJS((exports) => {
|
|
|
19680
19680
|
errors: state.errors
|
|
19681
19681
|
};
|
|
19682
19682
|
};
|
|
19683
|
-
function ReporterError(
|
|
19684
|
-
this.path =
|
|
19683
|
+
function ReporterError(path2, msg) {
|
|
19684
|
+
this.path = path2;
|
|
19685
19685
|
this.rethrow(msg);
|
|
19686
19686
|
}
|
|
19687
19687
|
inherits(ReporterError, Error);
|
|
@@ -32021,8 +32021,11 @@ function _mergeDicts(left, right) {
|
|
|
32021
32021
|
} else if (typeof merged[key] === "string") {
|
|
32022
32022
|
if (key === "type") {
|
|
32023
32023
|
continue;
|
|
32024
|
+
} else if (["id", "output_version", "model_provider"].includes(key)) {
|
|
32025
|
+
merged[key] = value;
|
|
32026
|
+
} else {
|
|
32027
|
+
merged[key] += value;
|
|
32024
32028
|
}
|
|
32025
|
-
merged[key] += value;
|
|
32026
32029
|
} else if (typeof merged[key] === "object" && !Array.isArray(merged[key])) {
|
|
32027
32030
|
merged[key] = _mergeDicts(merged[key], value);
|
|
32028
32031
|
} else if (Array.isArray(merged[key])) {
|
|
@@ -32043,14 +32046,14 @@ function _mergeLists(left, right) {
|
|
|
32043
32046
|
} else {
|
|
32044
32047
|
const merged = [...left];
|
|
32045
32048
|
for (const item of right) {
|
|
32046
|
-
if (typeof item === "object" && "index" in item && typeof item.index === "number") {
|
|
32047
|
-
const toMerge = merged.findIndex((leftItem) => leftItem.index === item.index);
|
|
32048
|
-
if (toMerge !== -1) {
|
|
32049
|
+
if (typeof item === "object" && item !== null && "index" in item && typeof item.index === "number") {
|
|
32050
|
+
const toMerge = merged.findIndex((leftItem) => leftItem !== null && typeof leftItem === "object" && ("index" in leftItem) && leftItem.index === item.index && ("id" in leftItem && "id" in item ? leftItem.id === item.id : !("id" in leftItem) && !("id" in item)));
|
|
32051
|
+
if (toMerge !== -1 && typeof merged[toMerge] === "object" && merged[toMerge] !== null) {
|
|
32049
32052
|
merged[toMerge] = _mergeDicts(merged[toMerge], item);
|
|
32050
32053
|
} else {
|
|
32051
32054
|
merged.push(item);
|
|
32052
32055
|
}
|
|
32053
|
-
} else if (typeof item === "object" && "text" in item && item.text === "") {
|
|
32056
|
+
} else if (typeof item === "object" && item !== null && "text" in item && item.text === "") {
|
|
32054
32057
|
continue;
|
|
32055
32058
|
} else {
|
|
32056
32059
|
merged.push(item);
|
|
@@ -34826,7 +34829,14 @@ graph TD;
|
|
|
34826
34829
|
return mermaidGraph;
|
|
34827
34830
|
}
|
|
34828
34831
|
async function drawMermaidPng(mermaidSyntax, config) {
|
|
34829
|
-
|
|
34832
|
+
return drawMermaidImage(mermaidSyntax, {
|
|
34833
|
+
...config,
|
|
34834
|
+
imageType: "png"
|
|
34835
|
+
});
|
|
34836
|
+
}
|
|
34837
|
+
async function drawMermaidImage(mermaidSyntax, config) {
|
|
34838
|
+
let backgroundColor = config?.backgroundColor ?? "white";
|
|
34839
|
+
const imageType = config?.imageType ?? "png";
|
|
34830
34840
|
const mermaidSyntaxEncoded = btoa(mermaidSyntax);
|
|
34831
34841
|
if (backgroundColor !== undefined) {
|
|
34832
34842
|
const hexColorPattern = /^#(?:[0-9a-fA-F]{3}){1,2}$/;
|
|
@@ -34834,7 +34844,7 @@ async function drawMermaidPng(mermaidSyntax, config) {
|
|
|
34834
34844
|
backgroundColor = `!${backgroundColor}`;
|
|
34835
34845
|
}
|
|
34836
34846
|
}
|
|
34837
|
-
const imageUrl = `https://mermaid.ink/img/${mermaidSyntaxEncoded}?bgColor=${backgroundColor}`;
|
|
34847
|
+
const imageUrl = `https://mermaid.ink/img/${mermaidSyntaxEncoded}?bgColor=${backgroundColor}&type=${imageType}`;
|
|
34838
34848
|
const res = await fetch(imageUrl);
|
|
34839
34849
|
if (!res.ok) {
|
|
34840
34850
|
throw new Error([
|
|
@@ -42362,6 +42372,107 @@ async function pingServer(options) {
|
|
|
42362
42372
|
}
|
|
42363
42373
|
}
|
|
42364
42374
|
}
|
|
42375
|
+
// src/utils/paths.ts
|
|
42376
|
+
import path from "node:path";
|
|
42377
|
+
|
|
42378
|
+
class ElizaPaths {
|
|
42379
|
+
cache = new Map;
|
|
42380
|
+
getDataDir() {
|
|
42381
|
+
const cached = this.cache.get("dataDir");
|
|
42382
|
+
if (cached)
|
|
42383
|
+
return cached;
|
|
42384
|
+
const dir = process.env.ELIZA_DATA_DIR || path.join(process.cwd(), ".eliza");
|
|
42385
|
+
this.cache.set("dataDir", dir);
|
|
42386
|
+
return dir;
|
|
42387
|
+
}
|
|
42388
|
+
getDatabaseDir() {
|
|
42389
|
+
const cached = this.cache.get("databaseDir");
|
|
42390
|
+
if (cached)
|
|
42391
|
+
return cached;
|
|
42392
|
+
const dir = process.env.ELIZA_DATABASE_DIR || process.env.PGLITE_DATA_DIR || path.join(this.getDataDir(), ".elizadb");
|
|
42393
|
+
this.cache.set("databaseDir", dir);
|
|
42394
|
+
return dir;
|
|
42395
|
+
}
|
|
42396
|
+
getCharactersDir() {
|
|
42397
|
+
const cached = this.cache.get("charactersDir");
|
|
42398
|
+
if (cached)
|
|
42399
|
+
return cached;
|
|
42400
|
+
const dir = process.env.ELIZA_DATA_DIR_CHARACTERS || path.join(this.getDataDir(), "data", "characters");
|
|
42401
|
+
this.cache.set("charactersDir", dir);
|
|
42402
|
+
return dir;
|
|
42403
|
+
}
|
|
42404
|
+
getGeneratedDir() {
|
|
42405
|
+
const cached = this.cache.get("generatedDir");
|
|
42406
|
+
if (cached)
|
|
42407
|
+
return cached;
|
|
42408
|
+
const dir = process.env.ELIZA_DATA_DIR_GENERATED || path.join(this.getDataDir(), "data", "generated");
|
|
42409
|
+
this.cache.set("generatedDir", dir);
|
|
42410
|
+
return dir;
|
|
42411
|
+
}
|
|
42412
|
+
getUploadsAgentsDir() {
|
|
42413
|
+
const cached = this.cache.get("uploadsAgentsDir");
|
|
42414
|
+
if (cached)
|
|
42415
|
+
return cached;
|
|
42416
|
+
const dir = process.env.ELIZA_DATA_DIR_UPLOADS_AGENTS || path.join(this.getDataDir(), "data", "uploads", "agents");
|
|
42417
|
+
this.cache.set("uploadsAgentsDir", dir);
|
|
42418
|
+
return dir;
|
|
42419
|
+
}
|
|
42420
|
+
getUploadsChannelsDir() {
|
|
42421
|
+
const cached = this.cache.get("uploadsChannelsDir");
|
|
42422
|
+
if (cached)
|
|
42423
|
+
return cached;
|
|
42424
|
+
const dir = process.env.ELIZA_DATA_DIR_UPLOADS_CHANNELS || path.join(this.getDataDir(), "data", "uploads", "channels");
|
|
42425
|
+
this.cache.set("uploadsChannelsDir", dir);
|
|
42426
|
+
return dir;
|
|
42427
|
+
}
|
|
42428
|
+
getAllPaths() {
|
|
42429
|
+
return {
|
|
42430
|
+
dataDir: this.getDataDir(),
|
|
42431
|
+
databaseDir: this.getDatabaseDir(),
|
|
42432
|
+
charactersDir: this.getCharactersDir(),
|
|
42433
|
+
generatedDir: this.getGeneratedDir(),
|
|
42434
|
+
uploadsAgentsDir: this.getUploadsAgentsDir(),
|
|
42435
|
+
uploadsChannelsDir: this.getUploadsChannelsDir()
|
|
42436
|
+
};
|
|
42437
|
+
}
|
|
42438
|
+
clearCache() {
|
|
42439
|
+
this.cache.clear();
|
|
42440
|
+
}
|
|
42441
|
+
}
|
|
42442
|
+
var pathsInstance = null;
|
|
42443
|
+
function getElizaPaths() {
|
|
42444
|
+
if (!pathsInstance) {
|
|
42445
|
+
pathsInstance = new ElizaPaths;
|
|
42446
|
+
}
|
|
42447
|
+
return pathsInstance;
|
|
42448
|
+
}
|
|
42449
|
+
function getDataDir() {
|
|
42450
|
+
return getElizaPaths().getDataDir();
|
|
42451
|
+
}
|
|
42452
|
+
function getDatabaseDir() {
|
|
42453
|
+
return getElizaPaths().getDatabaseDir();
|
|
42454
|
+
}
|
|
42455
|
+
function getCharactersDir() {
|
|
42456
|
+
return getElizaPaths().getCharactersDir();
|
|
42457
|
+
}
|
|
42458
|
+
function getGeneratedDir() {
|
|
42459
|
+
return getElizaPaths().getGeneratedDir();
|
|
42460
|
+
}
|
|
42461
|
+
function getUploadsAgentsDir() {
|
|
42462
|
+
return getElizaPaths().getUploadsAgentsDir();
|
|
42463
|
+
}
|
|
42464
|
+
function getUploadsChannelsDir() {
|
|
42465
|
+
return getElizaPaths().getUploadsChannelsDir();
|
|
42466
|
+
}
|
|
42467
|
+
function getAllElizaPaths() {
|
|
42468
|
+
return getElizaPaths().getAllPaths();
|
|
42469
|
+
}
|
|
42470
|
+
function resetPaths() {
|
|
42471
|
+
if (pathsInstance) {
|
|
42472
|
+
pathsInstance.clearCache();
|
|
42473
|
+
}
|
|
42474
|
+
pathsInstance = null;
|
|
42475
|
+
}
|
|
42365
42476
|
// src/actions.ts
|
|
42366
42477
|
var import_unique_names_generator2 = __toESM(require_dist4(), 1);
|
|
42367
42478
|
var composeActionExamples = (actionsData, count) => {
|
|
@@ -45910,6 +46021,7 @@ export {
|
|
|
45910
46021
|
saltWorldSettings,
|
|
45911
46022
|
saltSettingValue,
|
|
45912
46023
|
safeReplacer,
|
|
46024
|
+
resetPaths,
|
|
45913
46025
|
recentLogs,
|
|
45914
46026
|
randomBytes,
|
|
45915
46027
|
prewarmUuidCache,
|
|
@@ -45941,17 +46053,25 @@ export {
|
|
|
45941
46053
|
hasEnv,
|
|
45942
46054
|
getWorldSettings,
|
|
45943
46055
|
getUserServerRole,
|
|
46056
|
+
getUploadsChannelsDir,
|
|
46057
|
+
getUploadsAgentsDir,
|
|
45944
46058
|
getTypedService,
|
|
45945
46059
|
getSalt,
|
|
45946
46060
|
getNumberEnv,
|
|
45947
46061
|
getModelSpecificSettingKey,
|
|
45948
46062
|
getMemoryText,
|
|
45949
46063
|
getLocalServerUrl,
|
|
46064
|
+
getGeneratedDir,
|
|
45950
46065
|
getEnvironment,
|
|
45951
46066
|
getEnv3 as getEnv,
|
|
45952
46067
|
getEntityDetails,
|
|
46068
|
+
getElizaPaths,
|
|
46069
|
+
getDatabaseDir,
|
|
46070
|
+
getDataDir,
|
|
45953
46071
|
getContentTypeFromMimeType,
|
|
46072
|
+
getCharactersDir,
|
|
45954
46073
|
getBooleanEnv,
|
|
46074
|
+
getAllElizaPaths,
|
|
45955
46075
|
fromString,
|
|
45956
46076
|
fromHex,
|
|
45957
46077
|
fromBytes,
|
|
@@ -46032,5 +46152,5 @@ export {
|
|
|
46032
46152
|
AgentRuntime
|
|
46033
46153
|
};
|
|
46034
46154
|
|
|
46035
|
-
//# debugId=
|
|
46155
|
+
//# debugId=E4CB56E0851C3CD864756E2164756E21
|
|
46036
46156
|
//# sourceMappingURL=index.node.js.map
|