@elizaos/app-core 2.0.3-beta.4 → 2.0.3-beta.6
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/api/i18n-locale-routes.d.ts +7 -0
- package/api/i18n-locale-routes.d.ts.map +1 -0
- package/api/i18n-locale-routes.js +58 -0
- package/api/ios-local-agent-transport.d.ts +3 -0
- package/api/ios-local-agent-transport.d.ts.map +1 -1
- package/api/ios-local-agent-transport.js +22 -1
- package/api/server.d.ts.map +1 -1
- package/api/server.js +5 -0
- package/benchmark/cerebras-autowire.d.ts.map +1 -1
- package/benchmark/cerebras-autowire.js +9 -2
- package/package.json +36 -36
- package/packaging/debian/rules +1 -1
- package/packaging/flatpak/generate-sources.sh +6 -1
- package/packaging/snap/snapcraft.yaml +15 -11
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaAgentService.java +2 -1
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaNativeBridge.java +5 -0
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaStartupTrace.java +28 -0
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaVoicePlugin.java +1 -1
- package/platforms/android/app/src/main/java/ai/elizaos/app/MainActivity.java +1 -0
- package/platforms/electrobun/electrobun.config.ts +31 -1
- package/platforms/electrobun/package.json +10 -10
- package/platforms/electrobun/remotes/local-model/README.md +2 -5
- package/platforms/electrobun/remotes/local-model/src/bun/eliza1-catalog.ts +0 -16
- package/platforms/electrobun/remotes/local-model/src/dev/phase8-smoke.ts +0 -2
- package/platforms/electrobun/scripts/smoke-test.sh +8 -2
- package/platforms/electrobun/scripts/stage-macos-release-artifacts.sh +8 -2
- package/platforms/electrobun/scripts/sync-web-assets.mjs +31 -2
- package/platforms/electrobun/src/bridge/electrobun-boot-config.ts +8 -0
- package/platforms/electrobun/src/bridge/electrobun-crypto-ready.ts +5 -1
- package/platforms/electrobun/src/bridge/electrobun-direct-rpc.ts +5 -11
- package/platforms/electrobun/src/preload.js +1 -1
- package/platforms/ios/App/App/Base.lproj/Main.storyboard +1 -1
- package/platforms/ios/App/App/ElizaBridgeViewController.swift +22 -0
- package/platforms/ios/App/App/ElizaStartupTrace.swift +12 -0
- package/platforms/ios/App/App.xcodeproj/project.pbxproj +8 -0
- package/runtime/eliza.d.ts.map +1 -1
- package/runtime/eliza.js +18 -0
- package/runtime/voice-warmup.d.ts +4 -4
- package/runtime/voice-warmup.d.ts.map +1 -1
- package/runtime/voice-warmup.js +4 -4
- package/scripts/aosp/compile-libllama.mjs +25 -5
- package/scripts/aosp/compile-libllama.test.mjs +17 -1
- package/scripts/assert-required-bundled-packages.test.ts +24 -2
- package/scripts/benchmark-preflight.mjs +31 -2
- package/scripts/build-bundled-agent-skills-artifact.mjs +32 -8
- package/scripts/build-bundled-orchestrator-artifact.mjs +34 -12
- package/scripts/build-llama-cpp-mtp.mjs +27 -3
- package/scripts/build-patched-electrobun-cli.mjs +30 -2
- package/scripts/bun-riscv64/bun-version.json +1 -1
- package/scripts/bun-riscv64/validate.sh +21 -8
- package/scripts/check-real-local-reset.ts +13 -1
- package/scripts/check-sms-gateway-completion-audit.mjs +96 -31
- package/scripts/check-sms-gateway-readiness.mjs +54 -17
- package/scripts/clean-repo.mjs +21 -3
- package/scripts/copy-runtime-node-modules.ts +68 -63
- package/scripts/desktop-build.mjs +46 -5
- package/scripts/dev-platform-no-install.test.mjs +19 -0
- package/scripts/dev-platform.mjs +6 -2
- package/scripts/disable-local-eliza-workspace.mjs +23 -1
- package/scripts/docker-ci-smoke.sh +6 -5
- package/scripts/ensure-avatars.mjs +18 -5
- package/scripts/ensure-bundled-workspaces.mjs +4 -15
- package/scripts/ensure-type-package-aliases.mjs +47 -3
- package/scripts/ffi-stub/Makefile +5 -2
- package/scripts/ios-xcframework/build-xcframework.mjs +22 -11
- package/scripts/ios-xcframework/run-physical-device-smoke.mjs +99 -6
- package/scripts/ios-xcframework/runtime-symbol-shim.c +560 -105
- package/scripts/lib/agent-source-watcher.test.mjs +24 -4
- package/scripts/lib/apple-entitlement-audit.test.mjs +19 -2
- package/scripts/lib/artifact-staleness.test.mts +18 -1
- package/scripts/lib/patch-bun-exports.mjs +20 -2
- package/scripts/lib/patch-bun-exports.test.mjs +108 -4
- package/scripts/lib/renderer-build-manifest.test.mts +18 -1
- package/scripts/lib/stage-android-agent.mjs +16 -3
- package/scripts/lib/verify-ondevice-artifact.test.mts +18 -1
- package/scripts/link-docker-local-app-packages.mjs +26 -1
- package/scripts/mas-smoke.test.mjs +25 -9
- package/scripts/omnivoice-fuse/prepare.mjs +27 -4
- package/scripts/package-electrobun-linux.mjs +22 -7
- package/scripts/patch-deps.mjs +18 -5
- package/scripts/playwright-ui-live-stack.ts +16 -3
- package/scripts/playwright-ui-smoke-api-stub.mjs +167 -2
- package/scripts/prepare-ios-cocoapods.sh +5 -1
- package/scripts/prune-cdn-local-assets.mjs +52 -5
- package/scripts/run-mobile-build-android-app-actions.test.mjs +19 -1
- package/scripts/run-mobile-build-mtp-staleness.test.mts +20 -4
- package/scripts/run-mobile-build.mjs +74 -16
- package/scripts/stage-android-agent.test.mjs +19 -1
- package/scripts/stage-desktop-fused-lib.mjs +26 -1
- package/scripts/sync-desktop-renderer.mjs +53 -12
- package/scripts/test-sms-gateway-software.mjs +20 -4
- package/cli/command-format.d.ts +0 -2
- package/cli/command-format.d.ts.map +0 -1
- package/cli/command-format.js +0 -20
- package/register-runtime-hooks.d.ts +0 -2
- package/register-runtime-hooks.d.ts.map +0 -1
- package/register-runtime-hooks.js +0 -19
|
@@ -52,6 +52,12 @@ const TRACKED_PACKAGE_CACHE = path.join(
|
|
|
52
52
|
os.tmpdir(),
|
|
53
53
|
"eliza-tracked-package-cache",
|
|
54
54
|
);
|
|
55
|
+
const RM_PATH_RECURSIVE_SCRIPT = path.join(
|
|
56
|
+
ROOT,
|
|
57
|
+
"packages",
|
|
58
|
+
"scripts",
|
|
59
|
+
"rm-path-recursive.mjs",
|
|
60
|
+
);
|
|
55
61
|
const PUBLISHED_PACKAGE_FETCH_TIMEOUT_MS = 10_000;
|
|
56
62
|
const ALLOW_REGISTRY_FETCH =
|
|
57
63
|
process.env.ELIZA_RUNTIME_COPY_ALLOW_REGISTRY_FETCH === "1";
|
|
@@ -208,10 +214,6 @@ function readJson<T>(filePath: string): T {
|
|
|
208
214
|
return JSON.parse(fs.readFileSync(filePath, "utf8")) as T;
|
|
209
215
|
}
|
|
210
216
|
|
|
211
|
-
function sleepSync(ms: number): void {
|
|
212
|
-
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms);
|
|
213
|
-
}
|
|
214
|
-
|
|
215
217
|
function isEnoentError(error: unknown): boolean {
|
|
216
218
|
return Boolean(
|
|
217
219
|
error &&
|
|
@@ -220,20 +222,6 @@ function isEnoentError(error: unknown): boolean {
|
|
|
220
222
|
);
|
|
221
223
|
}
|
|
222
224
|
|
|
223
|
-
function isRetryableRemoveError(error: unknown): boolean {
|
|
224
|
-
if (!error || typeof error !== "object") {
|
|
225
|
-
return false;
|
|
226
|
-
}
|
|
227
|
-
const code = (error as { code?: string }).code;
|
|
228
|
-
return (
|
|
229
|
-
code === "EBUSY" ||
|
|
230
|
-
code === "EMFILE" ||
|
|
231
|
-
code === "ENFILE" ||
|
|
232
|
-
code === "ENOTEMPTY" ||
|
|
233
|
-
code === "EPERM"
|
|
234
|
-
);
|
|
235
|
-
}
|
|
236
|
-
|
|
237
225
|
function isProcessAlive(pid: number): boolean {
|
|
238
226
|
try {
|
|
239
227
|
process.kill(pid, 0);
|
|
@@ -259,55 +247,72 @@ function readRuntimeCopyLockOwnerPid(lockDir: string): number | null {
|
|
|
259
247
|
}
|
|
260
248
|
}
|
|
261
249
|
|
|
262
|
-
function
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
}
|
|
250
|
+
function recursiveRemoveErrorDetail(error: unknown): string {
|
|
251
|
+
if (error && typeof error === "object") {
|
|
252
|
+
const output = error as {
|
|
253
|
+
message?: string;
|
|
254
|
+
stderr?: unknown;
|
|
255
|
+
stdout?: unknown;
|
|
256
|
+
};
|
|
257
|
+
const detail = [output.stdout, output.stderr]
|
|
258
|
+
.filter(
|
|
259
|
+
(chunk): chunk is Buffer | string =>
|
|
260
|
+
Buffer.isBuffer(chunk) || typeof chunk === "string",
|
|
261
|
+
)
|
|
262
|
+
.map((chunk) => chunk.toString().trim())
|
|
263
|
+
.filter(Boolean)
|
|
264
|
+
.join("\n");
|
|
265
|
+
if (detail) return detail;
|
|
266
|
+
if (typeof output.message === "string") return output.message;
|
|
280
267
|
}
|
|
268
|
+
return String(error);
|
|
269
|
+
}
|
|
281
270
|
|
|
282
|
-
|
|
283
|
-
|
|
271
|
+
function runSharedRecursiveRemove(pathToRemove: string): void {
|
|
272
|
+
try {
|
|
273
|
+
execFileSync(
|
|
274
|
+
"node",
|
|
275
|
+
[RM_PATH_RECURSIVE_SCRIPT, path.resolve(pathToRemove)],
|
|
276
|
+
{
|
|
277
|
+
encoding: "utf8",
|
|
278
|
+
stdio: "pipe",
|
|
279
|
+
},
|
|
280
|
+
);
|
|
281
|
+
} catch (error) {
|
|
282
|
+
throw new Error(recursiveRemoveErrorDetail(error), { cause: error });
|
|
284
283
|
}
|
|
284
|
+
}
|
|
285
285
|
|
|
286
|
-
|
|
287
|
-
const tombstone = path.join(
|
|
288
|
-
parentDir,
|
|
289
|
-
`.${path.basename(pathToRemove)}.delete-${process.pid}-${Date.now()}`,
|
|
290
|
-
);
|
|
286
|
+
function rmRecursive(pathToRemove: string): void {
|
|
291
287
|
try {
|
|
292
|
-
|
|
288
|
+
runSharedRecursiveRemove(pathToRemove);
|
|
289
|
+
return;
|
|
293
290
|
} catch (error) {
|
|
294
291
|
if (!fs.existsSync(pathToRemove)) {
|
|
295
292
|
return;
|
|
296
293
|
}
|
|
297
|
-
throw error;
|
|
298
|
-
}
|
|
299
294
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
recursive: true,
|
|
305
|
-
retryDelay: 100,
|
|
306
|
-
});
|
|
307
|
-
} catch (error) {
|
|
308
|
-
console.warn(
|
|
309
|
-
`[runtime-copy] warning: moved retry-resistant path aside but could not fully remove ${tombstone}: ${error instanceof Error ? error.message : String(error)}`,
|
|
295
|
+
const parentDir = path.dirname(pathToRemove);
|
|
296
|
+
const tombstone = path.join(
|
|
297
|
+
parentDir,
|
|
298
|
+
`.${path.basename(pathToRemove)}.delete-${process.pid}-${Date.now()}`,
|
|
310
299
|
);
|
|
300
|
+
try {
|
|
301
|
+
fs.renameSync(pathToRemove, tombstone);
|
|
302
|
+
} catch {
|
|
303
|
+
if (!fs.existsSync(pathToRemove)) {
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
throw error;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
try {
|
|
310
|
+
runSharedRecursiveRemove(tombstone);
|
|
311
|
+
} catch (tombstoneError) {
|
|
312
|
+
console.warn(
|
|
313
|
+
`[runtime-copy] warning: moved retry-resistant path aside but could not fully remove ${tombstone}: ${recursiveRemoveErrorDetail(tombstoneError)}`,
|
|
314
|
+
);
|
|
315
|
+
}
|
|
311
316
|
}
|
|
312
317
|
}
|
|
313
318
|
|
|
@@ -331,7 +336,7 @@ function acquireRuntimeCopyLock(targetDist: string): () => void {
|
|
|
331
336
|
)}\n`,
|
|
332
337
|
);
|
|
333
338
|
return () => {
|
|
334
|
-
|
|
339
|
+
rmRecursive(lockDir);
|
|
335
340
|
};
|
|
336
341
|
} catch (error) {
|
|
337
342
|
if (
|
|
@@ -877,7 +882,7 @@ function pruneCopiedPackageDir(name: string, packageDir: string): void {
|
|
|
877
882
|
const relativePath = path.relative(packageDir, entryPath);
|
|
878
883
|
|
|
879
884
|
if (shouldPrunePackageRelativePath(name, relativePath)) {
|
|
880
|
-
|
|
885
|
+
rmRecursive(entryPath);
|
|
881
886
|
continue;
|
|
882
887
|
}
|
|
883
888
|
|
|
@@ -887,7 +892,7 @@ function pruneCopiedPackageDir(name: string, packageDir: string): void {
|
|
|
887
892
|
!isRequiredRuntimeDocDirectory(entryPath) &&
|
|
888
893
|
!shouldPreservePrunedPackageEntry(name, packageDir, entryPath))
|
|
889
894
|
) {
|
|
890
|
-
|
|
895
|
+
rmRecursive(entryPath);
|
|
891
896
|
continue;
|
|
892
897
|
}
|
|
893
898
|
|
|
@@ -908,7 +913,7 @@ function pruneCopiedPackageDir(name: string, packageDir: string): void {
|
|
|
908
913
|
name,
|
|
909
914
|
)
|
|
910
915
|
) {
|
|
911
|
-
|
|
916
|
+
rmRecursive(entryPath);
|
|
912
917
|
continue;
|
|
913
918
|
}
|
|
914
919
|
|
|
@@ -1489,7 +1494,7 @@ function patchCopiedElevenLabsTarSafePaths(
|
|
|
1489
1494
|
function patchCopiedAiSdkProviderRuntimeSurface(packageDir: string): void {
|
|
1490
1495
|
const distIndex = path.join(packageDir, "dist", "index.js");
|
|
1491
1496
|
if (fs.existsSync(distIndex)) {
|
|
1492
|
-
|
|
1497
|
+
rmRecursive(path.join(packageDir, "src"));
|
|
1493
1498
|
}
|
|
1494
1499
|
}
|
|
1495
1500
|
|
|
@@ -1686,7 +1691,7 @@ function fetchPublishedPackage(
|
|
|
1686
1691
|
return resolved;
|
|
1687
1692
|
}
|
|
1688
1693
|
|
|
1689
|
-
|
|
1694
|
+
rmRecursive(cacheDir);
|
|
1690
1695
|
fs.mkdirSync(cacheDir, { recursive: true });
|
|
1691
1696
|
|
|
1692
1697
|
try {
|
|
@@ -1742,7 +1747,7 @@ function materializeTrackedWorkspacePackage(
|
|
|
1742
1747
|
return resolved;
|
|
1743
1748
|
}
|
|
1744
1749
|
|
|
1745
|
-
|
|
1750
|
+
rmRecursive(cacheDir);
|
|
1746
1751
|
fs.mkdirSync(cacheDir, { recursive: true });
|
|
1747
1752
|
|
|
1748
1753
|
try {
|
|
@@ -38,6 +38,12 @@ const COMMAND_PREFIX = (process.env.ELIZA_DESKTOP_COMMAND_PREFIX ?? "")
|
|
|
38
38
|
.split(/\s+/)
|
|
39
39
|
.filter(Boolean);
|
|
40
40
|
const DESKTOP_BUILD_LOCK_DIR = path.join(ROOT, ".turbo", "desktop-build.lock");
|
|
41
|
+
const CLEANUP_HELPER_SCRIPT = path.join(
|
|
42
|
+
ROOT,
|
|
43
|
+
"packages",
|
|
44
|
+
"scripts",
|
|
45
|
+
"rm-path-recursive.mjs",
|
|
46
|
+
);
|
|
41
47
|
const RUNTIME_COPY_SCRIPT = fs.existsSync(
|
|
42
48
|
path.join(ROOT, "scripts", "copy-runtime-node-modules.ts"),
|
|
43
49
|
)
|
|
@@ -88,6 +94,33 @@ function isProcessAlive(pid) {
|
|
|
88
94
|
}
|
|
89
95
|
}
|
|
90
96
|
|
|
97
|
+
function removePathRecursive(targetPath, label = "path cleanup") {
|
|
98
|
+
const result = spawnSync("node", [CLEANUP_HELPER_SCRIPT, targetPath], {
|
|
99
|
+
cwd: ROOT,
|
|
100
|
+
encoding: "utf8",
|
|
101
|
+
stdio: "pipe",
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
if (result.error) {
|
|
105
|
+
throw result.error;
|
|
106
|
+
}
|
|
107
|
+
if (result.status !== 0) {
|
|
108
|
+
const detail = [result.stdout, result.stderr]
|
|
109
|
+
.filter(Boolean)
|
|
110
|
+
.join("\n")
|
|
111
|
+
.trim();
|
|
112
|
+
throw new Error(
|
|
113
|
+
`${label} failed with exit code ${result.status ?? 1}${
|
|
114
|
+
detail ? `: ${detail}` : ""
|
|
115
|
+
}`,
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function removeDesktopBuildLockDir() {
|
|
121
|
+
removePathRecursive(DESKTOP_BUILD_LOCK_DIR, "desktop build lock cleanup");
|
|
122
|
+
}
|
|
123
|
+
|
|
91
124
|
function withDesktopBuildLock(run) {
|
|
92
125
|
const lockParent = path.dirname(DESKTOP_BUILD_LOCK_DIR);
|
|
93
126
|
const staleAfterMs = 30 * 60 * 1000;
|
|
@@ -120,7 +153,7 @@ function withDesktopBuildLock(run) {
|
|
|
120
153
|
(ownerPid !== null && !isProcessAlive(ownerPid)) ||
|
|
121
154
|
Date.now() - stat.mtimeMs > staleAfterMs
|
|
122
155
|
) {
|
|
123
|
-
|
|
156
|
+
removeDesktopBuildLockDir();
|
|
124
157
|
continue;
|
|
125
158
|
}
|
|
126
159
|
|
|
@@ -137,7 +170,7 @@ function withDesktopBuildLock(run) {
|
|
|
137
170
|
try {
|
|
138
171
|
run();
|
|
139
172
|
} finally {
|
|
140
|
-
|
|
173
|
+
removeDesktopBuildLockDir();
|
|
141
174
|
}
|
|
142
175
|
}
|
|
143
176
|
|
|
@@ -1467,7 +1500,7 @@ function mirrorTreePreservingSymlinks(src, dst) {
|
|
|
1467
1500
|
if (dstLstat) {
|
|
1468
1501
|
try {
|
|
1469
1502
|
if (dstLstat.isDirectory() && !dstLstat.isSymbolicLink()) {
|
|
1470
|
-
|
|
1503
|
+
removePathRecursive(dst, "desktop mirror directory cleanup");
|
|
1471
1504
|
} else {
|
|
1472
1505
|
fs.unlinkSync(dst);
|
|
1473
1506
|
}
|
|
@@ -1569,8 +1602,16 @@ function packageDesktopBuild() {
|
|
|
1569
1602
|
: "Packaging Electrobun app",
|
|
1570
1603
|
});
|
|
1571
1604
|
|
|
1572
|
-
|
|
1573
|
-
|
|
1605
|
+
// The legacy compatibility path (APP_DIR/electrobun) is not read by any
|
|
1606
|
+
// production code — only docs and this mirror fn reference it (the inno
|
|
1607
|
+
// installer takes BuildDir as a param; copy-runtime-node-modules reads the
|
|
1608
|
+
// canonical platforms/electrobun path). Mirroring the entire ~2.3 GB /
|
|
1609
|
+
// ~110k-file build tree on every package build is pure waste, so make it
|
|
1610
|
+
// opt-in (default off). Set ELIZA_ELECTROBUN_MIRROR_LEGACY=1 to restore it.
|
|
1611
|
+
if (process.env.ELIZA_ELECTROBUN_MIRROR_LEGACY === "1") {
|
|
1612
|
+
mirrorCanonicalToLegacy("build");
|
|
1613
|
+
mirrorCanonicalToLegacy("artifacts");
|
|
1614
|
+
}
|
|
1574
1615
|
|
|
1575
1616
|
// Electrobun's built-in rcedit call references a CI-local D:\ path that
|
|
1576
1617
|
// doesn't exist on developer machines. Re-embed the icon from a locally
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { describe, expect, it } from "vitest";
|
|
5
|
+
|
|
6
|
+
const scriptPath = path.join(
|
|
7
|
+
path.dirname(fileURLToPath(import.meta.url)),
|
|
8
|
+
"dev-platform.mjs",
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
describe("dev-platform API child command", () => {
|
|
12
|
+
it("disables Bun auto-install for the runtime process", () => {
|
|
13
|
+
const source = readFileSync(scriptPath, "utf8");
|
|
14
|
+
|
|
15
|
+
expect(source).toContain(
|
|
16
|
+
'const apiSourceConditionArgs = ["--no-install", "--conditions=eliza-source"];',
|
|
17
|
+
);
|
|
18
|
+
});
|
|
19
|
+
});
|
package/scripts/dev-platform.mjs
CHANGED
|
@@ -877,9 +877,13 @@ async function launch() {
|
|
|
877
877
|
...apiEmbeddingWarmupPolicy.env,
|
|
878
878
|
};
|
|
879
879
|
const apiWatchEnabled = envFlagEnabled("ELIZA_DESKTOP_API_WATCH");
|
|
880
|
+
// Runtime startup must never mutate dependencies. Optional plugin imports
|
|
881
|
+
// should fail fast when a package is absent instead of letting Bun auto-install
|
|
882
|
+
// transitive native packages inside the desktop app process.
|
|
883
|
+
const apiSourceConditionArgs = ["--no-install", "--conditions=eliza-source"];
|
|
880
884
|
const apiArgs = apiWatchEnabled
|
|
881
|
-
? ["--watch", devServerEntry]
|
|
882
|
-
: [devServerEntry];
|
|
885
|
+
? [...apiSourceConditionArgs, "--watch", devServerEntry]
|
|
886
|
+
: [...apiSourceConditionArgs, devServerEntry];
|
|
883
887
|
if (!apiWatchEnabled) {
|
|
884
888
|
console.log(
|
|
885
889
|
"[eliza] API file watcher disabled (set ELIZA_DESKTOP_API_WATCH=1 to enable).",
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
* untouched.
|
|
44
44
|
*/
|
|
45
45
|
|
|
46
|
+
import { execFileSync } from "node:child_process";
|
|
46
47
|
import fs from "node:fs";
|
|
47
48
|
import path from "node:path";
|
|
48
49
|
import { fileURLToPath } from "node:url";
|
|
@@ -63,6 +64,11 @@ export const CI_LOCKFILES = ["bun.lock", "bun.lockb"];
|
|
|
63
64
|
|
|
64
65
|
const ELIZAOS_CORE_NAME = "@elizaos/core";
|
|
65
66
|
const SCRIPT_PATH = fileURLToPath(import.meta.url);
|
|
67
|
+
const SCRIPT_DIR = path.dirname(SCRIPT_PATH);
|
|
68
|
+
const RECURSIVE_CLEANUP_SCRIPT = path.resolve(
|
|
69
|
+
SCRIPT_DIR,
|
|
70
|
+
"../../scripts/rm-path-recursive.mjs",
|
|
71
|
+
);
|
|
66
72
|
const DEFAULT_REPO_ROOT = process.cwd();
|
|
67
73
|
|
|
68
74
|
function isExactRegistryVersion(specifier) {
|
|
@@ -123,6 +129,22 @@ export function writePackageJson(filePath, originalRaw, pkg) {
|
|
|
123
129
|
return true;
|
|
124
130
|
}
|
|
125
131
|
|
|
132
|
+
function removeDirectoryRecursive(targetPath) {
|
|
133
|
+
try {
|
|
134
|
+
execFileSync("node", [RECURSIVE_CLEANUP_SCRIPT, path.resolve(targetPath)], {
|
|
135
|
+
cwd: DEFAULT_REPO_ROOT,
|
|
136
|
+
encoding: "utf8",
|
|
137
|
+
stdio: "pipe",
|
|
138
|
+
});
|
|
139
|
+
} catch (error) {
|
|
140
|
+
const detail = [error?.stdout, error?.stderr].filter(Boolean).join("\n");
|
|
141
|
+
throw new Error(
|
|
142
|
+
`Failed to remove directory ${targetPath}${detail ? `: ${detail}` : ""}`,
|
|
143
|
+
{ cause: error },
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
126
148
|
export function expandGlob(glob, { rootDir = DEFAULT_REPO_ROOT } = {}) {
|
|
127
149
|
if (!glob.includes("*")) {
|
|
128
150
|
return [glob];
|
|
@@ -244,7 +266,7 @@ export function disableLocalElizaWorkspace(
|
|
|
244
266
|
const removedLockfiles = [];
|
|
245
267
|
|
|
246
268
|
if (fs.existsSync(elizaRoot)) {
|
|
247
|
-
|
|
269
|
+
removeDirectoryRecursive(disabledElizaRoot);
|
|
248
270
|
fs.renameSync(elizaRoot, disabledElizaRoot);
|
|
249
271
|
log(
|
|
250
272
|
`[disable-local-eliza-workspace] Disabled repo-local eliza workspace at ${elizaRoot}`,
|
|
@@ -207,6 +207,7 @@ else
|
|
|
207
207
|
fi
|
|
208
208
|
APP_CORE_SCRIPTS_DIR="$APP_CORE_DIR/scripts"
|
|
209
209
|
AGENT_DIR="$PACKAGES_DIR/agent"
|
|
210
|
+
RM_PATH_RECURSIVE=(node "$PACKAGES_DIR/scripts/rm-path-recursive.mjs")
|
|
210
211
|
# @elizaos/core source lives under packages/core (current) or packages/typescript
|
|
211
212
|
# (legacy). Prefer the current name; fall back to the legacy path so older branches
|
|
212
213
|
# still work.
|
|
@@ -668,7 +669,7 @@ if [[ -f packages/contracts/package.json ]] && jq -e '.scripts.build' packages/c
|
|
|
668
669
|
"$BUN_BIN" run build
|
|
669
670
|
popd >/dev/null
|
|
670
671
|
mkdir -p node_modules/@elizaos
|
|
671
|
-
|
|
672
|
+
"${RM_PATH_RECURSIVE[@]}" node_modules/@elizaos/contracts
|
|
672
673
|
ln -s ../../packages/contracts node_modules/@elizaos/contracts
|
|
673
674
|
fi
|
|
674
675
|
|
|
@@ -682,7 +683,7 @@ if [[ -f packages/logger/package.json ]] && jq -e '.scripts.build' packages/logg
|
|
|
682
683
|
"$BUN_BIN" run build
|
|
683
684
|
popd >/dev/null
|
|
684
685
|
mkdir -p node_modules/@elizaos
|
|
685
|
-
|
|
686
|
+
"${RM_PATH_RECURSIVE[@]}" node_modules/@elizaos/logger
|
|
686
687
|
ln -s ../../packages/logger node_modules/@elizaos/logger
|
|
687
688
|
fi
|
|
688
689
|
|
|
@@ -693,7 +694,7 @@ if [[ -f "$TYPESCRIPT_DIR/package.json" ]]; then
|
|
|
693
694
|
popd >/dev/null
|
|
694
695
|
node packages/scripts/prepare-package-dist.mjs "$TYPESCRIPT_DIR"
|
|
695
696
|
CORE_NODE_MODULE="node_modules/@elizaos/core"
|
|
696
|
-
|
|
697
|
+
"${RM_PATH_RECURSIVE[@]}" "$CORE_NODE_MODULE"
|
|
697
698
|
mkdir -p "$(dirname "$CORE_NODE_MODULE")"
|
|
698
699
|
ln -s "../../$TYPESCRIPT_DIR" "$CORE_NODE_MODULE"
|
|
699
700
|
node packages/scripts/patch-nested-core-dist.mjs || true
|
|
@@ -713,7 +714,7 @@ for package_dir in packages/shared packages/cloud-sdk packages/cloud-routing pac
|
|
|
713
714
|
fi
|
|
714
715
|
done
|
|
715
716
|
mkdir -p node_modules/@elizaos
|
|
716
|
-
|
|
717
|
+
"${RM_PATH_RECURSIVE[@]}" node_modules/@elizaos/shared node_modules/@elizaos/cloud-sdk node_modules/@elizaos/cloud-routing node_modules/@elizaos/skills
|
|
717
718
|
ln -s ../../packages/shared node_modules/@elizaos/shared
|
|
718
719
|
ln -s ../../packages/cloud-sdk node_modules/@elizaos/cloud-sdk
|
|
719
720
|
ln -s ../../packages/cloud-routing node_modules/@elizaos/cloud-routing
|
|
@@ -802,7 +803,7 @@ popd >/dev/null
|
|
|
802
803
|
|
|
803
804
|
if [[ -n "${CORE_NODE_MODULE:-}" && -f "$TYPESCRIPT_DIR/dist/package.json" ]]; then
|
|
804
805
|
log "Relinking @elizaos/core to built dist for Docker runtime"
|
|
805
|
-
|
|
806
|
+
"${RM_PATH_RECURSIVE[@]}" "$CORE_NODE_MODULE"
|
|
806
807
|
mkdir -p "$(dirname "$CORE_NODE_MODULE")"
|
|
807
808
|
ln -s "../../$TYPESCRIPT_DIR/dist" "$CORE_NODE_MODULE"
|
|
808
809
|
fi
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* node scripts/ensure-avatars.mjs
|
|
12
12
|
* node scripts/ensure-avatars.mjs --force # re-download even if present
|
|
13
13
|
*/
|
|
14
|
-
import { execSync } from "node:child_process";
|
|
14
|
+
import { execFileSync, execSync } from "node:child_process";
|
|
15
15
|
import {
|
|
16
16
|
cpSync,
|
|
17
17
|
existsSync,
|
|
@@ -31,6 +31,12 @@ import { resolveRepoRootFromImportMeta } from "./lib/repo-root.mjs";
|
|
|
31
31
|
const __filename = fileURLToPath(import.meta.url);
|
|
32
32
|
const __dirname = dirname(__filename);
|
|
33
33
|
const ROOT = resolveRepoRootFromImportMeta(import.meta.url);
|
|
34
|
+
const cleanupHelperScript = join(
|
|
35
|
+
ROOT,
|
|
36
|
+
"packages",
|
|
37
|
+
"scripts",
|
|
38
|
+
"rm-path-recursive.mjs",
|
|
39
|
+
);
|
|
34
40
|
const PUBLIC = join(ROOT, "eliza", "plugins", "app-companion", "public");
|
|
35
41
|
const VRMS_DIR = join(PUBLIC, "vrms");
|
|
36
42
|
const ANIMATIONS_DIR = join(PUBLIC, "animations");
|
|
@@ -89,6 +95,13 @@ function gitAvailable() {
|
|
|
89
95
|
}
|
|
90
96
|
}
|
|
91
97
|
|
|
98
|
+
function removePathRecursive(targetPath) {
|
|
99
|
+
execFileSync(process.execPath, [cleanupHelperScript, targetPath], {
|
|
100
|
+
cwd: ROOT,
|
|
101
|
+
stdio: "inherit",
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
|
|
92
105
|
/** Count files matching an extension in a directory (non-recursive). */
|
|
93
106
|
function countFiles(dir, ext) {
|
|
94
107
|
if (!existsSync(dir)) return 0;
|
|
@@ -212,7 +225,7 @@ export function runEnsureAvatars({
|
|
|
212
225
|
try {
|
|
213
226
|
// Clean up any previous failed attempt
|
|
214
227
|
if (existsSync(tmpDir)) {
|
|
215
|
-
|
|
228
|
+
removePathRecursive(tmpDir);
|
|
216
229
|
}
|
|
217
230
|
|
|
218
231
|
// Clone and checkout pinned commit for reproducibility.
|
|
@@ -236,7 +249,7 @@ export function runEnsureAvatars({
|
|
|
236
249
|
|
|
237
250
|
const avatarVrms = join(tmpDir, "vrms");
|
|
238
251
|
if (existsSync(avatarVrms) && !useLocalVrms) {
|
|
239
|
-
|
|
252
|
+
removePathRecursive(VRMS_DIR);
|
|
240
253
|
mkdirSync(VRMS_DIR, { recursive: true });
|
|
241
254
|
mkdirSync(join(VRMS_DIR, "previews"), { recursive: true });
|
|
242
255
|
mkdirSync(join(VRMS_DIR, "backgrounds"), { recursive: true });
|
|
@@ -269,7 +282,7 @@ export function runEnsureAvatars({
|
|
|
269
282
|
|
|
270
283
|
const avatarAnims = join(tmpDir, "animations");
|
|
271
284
|
if (existsSync(avatarAnims)) {
|
|
272
|
-
|
|
285
|
+
removePathRecursive(ANIMATIONS_DIR);
|
|
273
286
|
mkdirSync(ANIMATIONS_DIR, { recursive: true });
|
|
274
287
|
copyPathIfExists(
|
|
275
288
|
join(avatarAnims, "idle.glb"),
|
|
@@ -317,7 +330,7 @@ export function runEnsureAvatars({
|
|
|
317
330
|
} finally {
|
|
318
331
|
try {
|
|
319
332
|
if (existsSync(tmpDir)) {
|
|
320
|
-
|
|
333
|
+
removePathRecursive(tmpDir);
|
|
321
334
|
}
|
|
322
335
|
} catch {
|
|
323
336
|
// Ignore cleanup errors
|
|
@@ -13,22 +13,11 @@ const DEFAULT_REPO_ROOT = resolveRepoRootFromImportMeta(import.meta.url);
|
|
|
13
13
|
export const BUNDLED_WORKSPACE_BUILDS = [
|
|
14
14
|
{
|
|
15
15
|
label: "@elizaos/plugin-agent-skills",
|
|
16
|
-
cwd: path.join("plugins", "plugin-agent-skills"
|
|
17
|
-
manifest: path.join(
|
|
18
|
-
|
|
19
|
-
"plugin-agent-skills",
|
|
20
|
-
"typescript",
|
|
21
|
-
"package.json",
|
|
22
|
-
),
|
|
23
|
-
artifact: path.join(
|
|
24
|
-
"plugins",
|
|
25
|
-
"plugin-agent-skills",
|
|
26
|
-
"typescript",
|
|
27
|
-
"dist",
|
|
28
|
-
"index.js",
|
|
29
|
-
),
|
|
16
|
+
cwd: path.join("plugins", "plugin-agent-skills"),
|
|
17
|
+
manifest: path.join("plugins", "plugin-agent-skills", "package.json"),
|
|
18
|
+
artifact: path.join("plugins", "plugin-agent-skills", "dist", "index.js"),
|
|
30
19
|
args: [
|
|
31
|
-
"
|
|
20
|
+
"../../packages/app-core/scripts/build-bundled-agent-skills-artifact.mjs",
|
|
32
21
|
],
|
|
33
22
|
},
|
|
34
23
|
// Only build workspaces that downstream packaging consumes directly. Building
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
+
import { spawnSync } from "node:child_process";
|
|
3
4
|
import {
|
|
4
5
|
cpSync,
|
|
5
6
|
existsSync,
|
|
@@ -8,7 +9,6 @@ import {
|
|
|
8
9
|
readdirSync,
|
|
9
10
|
readFileSync,
|
|
10
11
|
readlinkSync,
|
|
11
|
-
rmSync,
|
|
12
12
|
unlinkSync,
|
|
13
13
|
writeFileSync,
|
|
14
14
|
} from "node:fs";
|
|
@@ -18,6 +18,7 @@ import { resolveRepoRootFromImportMeta } from "./lib/repo-root.mjs";
|
|
|
18
18
|
|
|
19
19
|
const __filename = fileURLToPath(import.meta.url);
|
|
20
20
|
const REPO_ROOT = resolveRepoRootFromImportMeta(import.meta.url);
|
|
21
|
+
const CLEANUP_HELPER_SCRIPT = resolveCleanupHelperScript();
|
|
21
22
|
const ROOT_NODE_MODULES = path.join(REPO_ROOT, "node_modules");
|
|
22
23
|
const ELIZA_NODE_MODULES = path.join(REPO_ROOT, "eliza", "node_modules");
|
|
23
24
|
const GLOBAL_TYPES_CACHE_DIR = path.join(
|
|
@@ -58,6 +59,49 @@ const MATERIALIZED_TYPE_PACKAGES = [
|
|
|
58
59
|
];
|
|
59
60
|
const MATERIALIZED_PACKAGES = ["bun-types", "csstype"];
|
|
60
61
|
|
|
62
|
+
function resolveCleanupHelperScript() {
|
|
63
|
+
const candidates = [
|
|
64
|
+
path.join(REPO_ROOT, "packages", "scripts", "rm-path-recursive.mjs"),
|
|
65
|
+
path.join(
|
|
66
|
+
REPO_ROOT,
|
|
67
|
+
"eliza",
|
|
68
|
+
"packages",
|
|
69
|
+
"scripts",
|
|
70
|
+
"rm-path-recursive.mjs",
|
|
71
|
+
),
|
|
72
|
+
];
|
|
73
|
+
return candidates.find((candidate) => existsSync(candidate)) ?? candidates[0];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function removePathRecursive(targetPath) {
|
|
77
|
+
if (!existsSync(targetPath)) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const result = spawnSync(
|
|
82
|
+
"node",
|
|
83
|
+
[CLEANUP_HELPER_SCRIPT, path.relative(REPO_ROOT, targetPath)],
|
|
84
|
+
{
|
|
85
|
+
cwd: REPO_ROOT,
|
|
86
|
+
encoding: "utf8",
|
|
87
|
+
stdio: "pipe",
|
|
88
|
+
},
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
if (result.error) {
|
|
92
|
+
throw result.error;
|
|
93
|
+
}
|
|
94
|
+
if (result.status !== 0) {
|
|
95
|
+
const output = [result.stdout, result.stderr]
|
|
96
|
+
.filter(Boolean)
|
|
97
|
+
.join("\n")
|
|
98
|
+
.trim();
|
|
99
|
+
throw new Error(
|
|
100
|
+
`cleanup helper failed for ${targetPath}${output ? `:\n${output}` : ""}`,
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
61
105
|
function collectBrokenBundledTypePackages() {
|
|
62
106
|
const packageNames = new Set();
|
|
63
107
|
|
|
@@ -132,7 +176,7 @@ function repairBrokenDirectoryLink(dir) {
|
|
|
132
176
|
}
|
|
133
177
|
|
|
134
178
|
function recreateTypeRoot(targetTypesDir) {
|
|
135
|
-
|
|
179
|
+
removePathRecursive(targetTypesDir);
|
|
136
180
|
mkdirSync(targetTypesDir, { recursive: true });
|
|
137
181
|
}
|
|
138
182
|
|
|
@@ -176,7 +220,7 @@ function removeExistingTypeEntry(targetPath) {
|
|
|
176
220
|
throw error;
|
|
177
221
|
}
|
|
178
222
|
if (stat.isDirectory()) {
|
|
179
|
-
|
|
223
|
+
removePathRecursive(targetPath);
|
|
180
224
|
} else {
|
|
181
225
|
unlinkSync(targetPath);
|
|
182
226
|
}
|
|
@@ -31,6 +31,9 @@ VERIFY_TARGET := linux-x64-cpu-fused
|
|
|
31
31
|
NM := nm -D --defined-only
|
|
32
32
|
endif
|
|
33
33
|
|
|
34
|
+
REPO_ROOT := $(abspath ../../../..)
|
|
35
|
+
RM_PATH_RECURSIVE := node $(REPO_ROOT)/packages/scripts/rm-path-recursive.mjs
|
|
36
|
+
|
|
34
37
|
.PHONY: all clean verify verify-stub-rejected
|
|
35
38
|
all: $(DEFAULT_TARGET)
|
|
36
39
|
|
|
@@ -51,14 +54,14 @@ verify-stub-rejected: $(DEFAULT_TARGET)
|
|
|
51
54
|
if node ../build-helpers/verify-fused-symbols.mjs --out-dir $$tmp --target $(VERIFY_TARGET) --json >$$tmp/stdout 2>$$tmp/stderr; then \
|
|
52
55
|
echo "[verify] FAILED: real verifier accepted the stub as $(REAL_LIB_NAME)"; \
|
|
53
56
|
cat $$tmp/stdout; \
|
|
54
|
-
|
|
57
|
+
$(RM_PATH_RECURSIVE) $$tmp; \
|
|
55
58
|
exit 1; \
|
|
56
59
|
fi; \
|
|
57
60
|
test -s $$tmp/OMNIVOICE_FUSE_VERIFY.json; \
|
|
58
61
|
grep -q '"ok": false' $$tmp/OMNIVOICE_FUSE_VERIFY.json; \
|
|
59
62
|
grep -q 'stub' $$tmp/OMNIVOICE_FUSE_VERIFY.json; \
|
|
60
63
|
echo "[verify] PASS: real verifier rejects stub-only libelizainference"; \
|
|
61
|
-
|
|
64
|
+
$(RM_PATH_RECURSIVE) $$tmp
|
|
62
65
|
|
|
63
66
|
clean:
|
|
64
67
|
rm -f libelizainference_stub.dylib libelizainference_stub.so
|