@elizaos/app-core 2.0.3-beta.4 → 2.0.3-beta.5
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/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/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/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 +63 -2
- 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
|
@@ -36,10 +36,13 @@
|
|
|
36
36
|
* run-mobile-build.mjs mtpTargetOutDir()
|
|
37
37
|
* ELIZA_MTP_LLAMA_CPP_SRC override fork source tree
|
|
38
38
|
* ELIZA_IOS_DEPLOYMENT_TARGET iOS min version (default 16.0)
|
|
39
|
+
* ELIZA_IOS_METAL_STD Metal language std (default ios-metal2.4);
|
|
40
|
+
* the iOS min-version flag is appended here
|
|
41
|
+
* so embedded metallibs run on older devices
|
|
39
42
|
* ELIZA_MTP_FORCE_REBUILD=1 ignore a cached slice and rebuild
|
|
40
43
|
*/
|
|
41
44
|
|
|
42
|
-
import { spawnSync } from "node:child_process";
|
|
45
|
+
import { execFileSync, spawnSync } from "node:child_process";
|
|
43
46
|
import fs from "node:fs";
|
|
44
47
|
import os from "node:os";
|
|
45
48
|
import path from "node:path";
|
|
@@ -49,6 +52,19 @@ import { fileURLToPath } from "node:url";
|
|
|
49
52
|
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
50
53
|
// packages/app-core/scripts → repo root
|
|
51
54
|
const repoRoot = path.resolve(here, "..", "..", "..");
|
|
55
|
+
const cleanupHelperScript = path.join(
|
|
56
|
+
repoRoot,
|
|
57
|
+
"packages",
|
|
58
|
+
"scripts",
|
|
59
|
+
"rm-path-recursive.mjs",
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
function removePathRecursive(targetPath) {
|
|
63
|
+
execFileSync(process.execPath, [cleanupHelperScript, targetPath], {
|
|
64
|
+
cwd: repoRoot,
|
|
65
|
+
stdio: "inherit",
|
|
66
|
+
});
|
|
67
|
+
}
|
|
52
68
|
|
|
53
69
|
// ── State dir — MUST mirror run-mobile-build.mjs elizaStateDirForBuild() and
|
|
54
70
|
// ios-xcframework/build-xcframework.mjs elizaStateDir() EXACTLY, otherwise
|
|
@@ -58,6 +74,7 @@ const STATE_DIR =
|
|
|
58
74
|
|
|
59
75
|
const DEPLOYMENT_TARGET =
|
|
60
76
|
process.env.ELIZA_IOS_DEPLOYMENT_TARGET?.trim() || "16.0";
|
|
77
|
+
const IOS_METAL_STD = process.env.ELIZA_IOS_METAL_STD?.trim() || "ios-metal2.4";
|
|
61
78
|
|
|
62
79
|
// ── Fork source. The canonical fork is the in-repo submodule; the vendored
|
|
63
80
|
// ios-deps tree is the historical fallback. Both carry the eliza kernels.
|
|
@@ -203,7 +220,7 @@ function requiredKernelsMissing(symbolsText) {
|
|
|
203
220
|
|
|
204
221
|
function copyHeaders(srcDir, outDir) {
|
|
205
222
|
const incOut = path.join(outDir, "include");
|
|
206
|
-
|
|
223
|
+
removePathRecursive(incOut);
|
|
207
224
|
fs.mkdirSync(incOut, { recursive: true });
|
|
208
225
|
for (const incDir of [
|
|
209
226
|
path.join(srcDir, "include"),
|
|
@@ -281,10 +298,16 @@ function buildTarget(target) {
|
|
|
281
298
|
const revision = forkRevision(srcDir);
|
|
282
299
|
log(`target=${target} sdk=${t.sdk} fork=${revision}`);
|
|
283
300
|
log(`source: ${srcDir}`);
|
|
301
|
+
const metalDeploymentFlag = t.isSimulator
|
|
302
|
+
? `-mios-simulator-version-min=${DEPLOYMENT_TARGET}`
|
|
303
|
+
: `-miphoneos-version-min=${DEPLOYMENT_TARGET}`;
|
|
304
|
+
// ggml appends GGML_METAL_STD after -std=; CMake list expansion lets this
|
|
305
|
+
// also pass the iOS deployment target into the embedded metallib compile.
|
|
306
|
+
const metalStdAndDeployment = `${IOS_METAL_STD};${metalDeploymentFlag}`;
|
|
284
307
|
|
|
285
308
|
const buildDir = path.join(STATE_DIR, "local-inference", "mtp-build", target);
|
|
286
309
|
if (process.env.ELIZA_MTP_FORCE_REBUILD === "1") {
|
|
287
|
-
|
|
310
|
+
removePathRecursive(buildDir);
|
|
288
311
|
}
|
|
289
312
|
fs.mkdirSync(buildDir, { recursive: true });
|
|
290
313
|
fs.mkdirSync(outDir, { recursive: true });
|
|
@@ -309,6 +332,7 @@ function buildTarget(target) {
|
|
|
309
332
|
// (ggml-metal/CMakeLists.txt ELIZA-KERNEL-EMBED-PATCH-V1).
|
|
310
333
|
"-DGGML_METAL=ON",
|
|
311
334
|
"-DGGML_METAL_EMBED_LIBRARY=ON",
|
|
335
|
+
`-DGGML_METAL_STD=${metalStdAndDeployment}`,
|
|
312
336
|
"-DGGML_METAL_USE_BF16=ON",
|
|
313
337
|
"-DGGML_ACCELERATE=ON",
|
|
314
338
|
"-DGGML_BLAS=OFF",
|
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
existsSync,
|
|
9
9
|
mkdirSync,
|
|
10
10
|
readFileSync,
|
|
11
|
-
rmSync,
|
|
12
11
|
writeFileSync,
|
|
13
12
|
} from "node:fs";
|
|
14
13
|
import { createRequire } from "node:module";
|
|
@@ -16,6 +15,17 @@ import os from "node:os";
|
|
|
16
15
|
import path from "node:path";
|
|
17
16
|
import { pathToFileURL } from "node:url";
|
|
18
17
|
import { resolveMainAppDir } from "./lib/app-dir.mjs";
|
|
18
|
+
import { resolveRepoRootFromImportMeta } from "./lib/repo-root.mjs";
|
|
19
|
+
|
|
20
|
+
const repoRoot = resolveRepoRootFromImportMeta(import.meta.url, {
|
|
21
|
+
fallbackToCwd: true,
|
|
22
|
+
});
|
|
23
|
+
const cleanupHelperScript = path.join(
|
|
24
|
+
repoRoot,
|
|
25
|
+
"packages",
|
|
26
|
+
"scripts",
|
|
27
|
+
"rm-path-recursive.mjs",
|
|
28
|
+
);
|
|
19
29
|
|
|
20
30
|
function fail(message, code = 1) {
|
|
21
31
|
console.error(`[build-patched-electrobun-cli] ${message}`);
|
|
@@ -47,6 +57,24 @@ function runAllowFailure(command, args, options = {}) {
|
|
|
47
57
|
return result.status ?? 1;
|
|
48
58
|
}
|
|
49
59
|
|
|
60
|
+
function removePathRecursive(targetPath) {
|
|
61
|
+
const result = spawnSync("node", [cleanupHelperScript, targetPath], {
|
|
62
|
+
cwd: repoRoot,
|
|
63
|
+
encoding: "utf8",
|
|
64
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
65
|
+
});
|
|
66
|
+
if (result.error) throw result.error;
|
|
67
|
+
if (result.status !== 0) {
|
|
68
|
+
const output = [result.stdout, result.stderr]
|
|
69
|
+
.filter(Boolean)
|
|
70
|
+
.join("\n")
|
|
71
|
+
.trim();
|
|
72
|
+
fail(
|
|
73
|
+
`cleanup helper failed for ${targetPath}${output ? `:\n${output}` : ""}`,
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
50
78
|
function resolveElectrobunDir() {
|
|
51
79
|
const appDir = resolveMainAppDir(process.cwd(), "app");
|
|
52
80
|
const workspacePackageJson = path.join(appDir, "package.json");
|
|
@@ -394,7 +422,7 @@ function main() {
|
|
|
394
422
|
process.env.RUNNER_TEMP ?? os.tmpdir(),
|
|
395
423
|
`eliza-electrobun-src-${electrobunVersion}`,
|
|
396
424
|
);
|
|
397
|
-
|
|
425
|
+
removePathRecursive(tempRoot);
|
|
398
426
|
|
|
399
427
|
run("git", [
|
|
400
428
|
"clone",
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
"0005-tinycc-disable-on-riscv64.patch": "ee3e9b0c64a5ccdb78397309ce2115381c353a3dfce313aba88dd951264dc7d3",
|
|
128
128
|
"0006-build-add-riscv64-cli-validation.patch": "d621bff9ae125af7674bb4ee44dad62848c1ab6e333e61d4b1f6311eb139764c",
|
|
129
129
|
"0007-deps-per-dep-riscv64-checks.patch": "0d1516c4655601174f5ee91a877ad1a0fcb287ed8df42f7e96297b47b03ea5e4",
|
|
130
|
-
"0008-source-stabilize-riscv64-musl-build.patch": "
|
|
130
|
+
"0008-source-stabilize-riscv64-musl-build.patch": "58abdc9deff750305be9176da68b7190cdcbbd1a484256100b36f7239de63824",
|
|
131
131
|
"0009-disable-wasm-streaming-hooks-for-c-loop.patch": "c8658536cc46505cec35ab65f9d51daeba8cc5abac741f55496c65712c556731",
|
|
132
132
|
"0010-disable-inspector-profiler-for-riscv64-c-loop.patch": "4433d1077b59c325b19194fecefa4e33b5a586099fec0f4f999c82d053826128",
|
|
133
133
|
"0011-process-arch-add-riscv64.patch": "1a3e4ab498e83603a34016aab7f02d78fc21a0c7f61daa18cd282e8287d1ef1e",
|
|
@@ -17,11 +17,13 @@
|
|
|
17
17
|
# - Exit 0 if every patch validates, non-zero otherwise.
|
|
18
18
|
#
|
|
19
19
|
# Disk + network: needs ~1.5 GB free for the two shallow clones into /tmp.
|
|
20
|
-
# Network: needs HTTPS access to github.com. Tear-down:
|
|
20
|
+
# Network: needs HTTPS access to github.com. Tear-down: helper removes /tmp/bun-riscv64-validate*
|
|
21
21
|
|
|
22
22
|
set -euo pipefail
|
|
23
23
|
|
|
24
24
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
25
|
+
REPO_ROOT="$(cd "$SCRIPT_DIR/../../../.." && pwd)"
|
|
26
|
+
RM_PATH_RECURSIVE=(node "$REPO_ROOT/packages/scripts/rm-path-recursive.mjs")
|
|
25
27
|
DIST_DIR="$SCRIPT_DIR/dist"
|
|
26
28
|
REPORT="$DIST_DIR/validate-report.txt"
|
|
27
29
|
mkdir -p "$DIST_DIR"
|
|
@@ -144,10 +146,10 @@ fi
|
|
|
144
146
|
|
|
145
147
|
log ""
|
|
146
148
|
|
|
147
|
-
|
|
149
|
+
RECORDED_PATCH_PATHS=()
|
|
148
150
|
if command -v bun >/dev/null 2>&1; then
|
|
149
151
|
while IFS= read -r path; do
|
|
150
|
-
RECORDED_PATCH_PATHS
|
|
152
|
+
RECORDED_PATCH_PATHS+=("$path")
|
|
151
153
|
done < <(bun -e "
|
|
152
154
|
const v = JSON.parse(require('fs').readFileSync('$VERSION_FILE','utf8'));
|
|
153
155
|
for (const k of Object.keys(v.patch_series.bun_patches)) console.log('bun-patches/'+k);
|
|
@@ -156,7 +158,7 @@ if command -v bun >/dev/null 2>&1; then
|
|
|
156
158
|
")
|
|
157
159
|
else
|
|
158
160
|
while IFS= read -r path; do
|
|
159
|
-
RECORDED_PATCH_PATHS
|
|
161
|
+
RECORDED_PATCH_PATHS+=("$path")
|
|
160
162
|
done < <(python3 -c "
|
|
161
163
|
import json
|
|
162
164
|
v = json.load(open('$VERSION_FILE'))
|
|
@@ -165,10 +167,21 @@ for k in v['patch_series']['webkit_patches']: print('webkit-patches/'+k)
|
|
|
165
167
|
for k in v['patch_series']['webkit_recipes']: print('webkit-patches/'+k)
|
|
166
168
|
")
|
|
167
169
|
fi
|
|
170
|
+
|
|
171
|
+
is_recorded_patch_path() {
|
|
172
|
+
local needle="$1" recorded
|
|
173
|
+
for recorded in "${RECORDED_PATCH_PATHS[@]}"; do
|
|
174
|
+
if [ "$recorded" = "$needle" ]; then
|
|
175
|
+
return 0
|
|
176
|
+
fi
|
|
177
|
+
done
|
|
178
|
+
return 1
|
|
179
|
+
}
|
|
180
|
+
|
|
168
181
|
for actual in "$SCRIPT_DIR"/bun-patches/*.patch "$SCRIPT_DIR"/webkit-patches/*.patch "$SCRIPT_DIR"/webkit-patches/*.recipe; do
|
|
169
182
|
[ -e "$actual" ] || continue
|
|
170
183
|
rel_path="${actual#"$SCRIPT_DIR/"}"
|
|
171
|
-
if
|
|
184
|
+
if ! is_recorded_patch_path "$rel_path"; then
|
|
172
185
|
fail "unrecorded patch/recipe on disk: $rel_path"
|
|
173
186
|
fi
|
|
174
187
|
done
|
|
@@ -185,7 +198,7 @@ fi
|
|
|
185
198
|
CLONE_DIR="${VALIDATE_CLONE_DIR:-/tmp/bun-riscv64-validate-bun}"
|
|
186
199
|
if [ ! -d "$CLONE_DIR/.git" ]; then
|
|
187
200
|
log "Cloning oven-sh/bun @ $BUN_TAG into $CLONE_DIR (shallow)…"
|
|
188
|
-
|
|
201
|
+
"${RM_PATH_RECURSIVE[@]}" "$CLONE_DIR"
|
|
189
202
|
if ! git clone --depth=1 --branch "$BUN_TAG" --no-recurse-submodules \
|
|
190
203
|
https://github.com/oven-sh/bun.git "$CLONE_DIR" >>"$REPORT" 2>&1; then
|
|
191
204
|
fail "git clone of oven-sh/bun @ $BUN_TAG failed — see $REPORT"
|
|
@@ -216,12 +229,12 @@ log "── 4. WebKit patches applicability ────────────
|
|
|
216
229
|
WK_CLONE_DIR="${VALIDATE_WK_CLONE_DIR:-/tmp/bun-riscv64-validate-webkit}"
|
|
217
230
|
if [ -d "$WK_CLONE_DIR/.git" ] && ! git -C "$WK_CLONE_DIR" rev-parse --verify "$WEBKIT_COMMIT^{commit}" >/dev/null 2>&1; then
|
|
218
231
|
log "Discarding incomplete WebKit clone at $WK_CLONE_DIR"
|
|
219
|
-
|
|
232
|
+
"${RM_PATH_RECURSIVE[@]}" "$WK_CLONE_DIR"
|
|
220
233
|
fi
|
|
221
234
|
|
|
222
235
|
if [ ! -d "$WK_CLONE_DIR/.git" ]; then
|
|
223
236
|
log "Cloning oven-sh/WebKit @ $WEBKIT_COMMIT into $WK_CLONE_DIR (shallow)…"
|
|
224
|
-
|
|
237
|
+
"${RM_PATH_RECURSIVE[@]}" "$WK_CLONE_DIR"
|
|
225
238
|
git init --initial-branch=main "$WK_CLONE_DIR" >>"$REPORT" 2>&1
|
|
226
239
|
git -C "$WK_CLONE_DIR" remote add origin https://github.com/oven-sh/WebKit.git
|
|
227
240
|
if ! git -C "$WK_CLONE_DIR" fetch --depth=1 --filter=blob:none origin "$WEBKIT_COMMIT" >>"$REPORT" 2>&1; then
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
import assert from "node:assert/strict";
|
|
26
|
+
import { execFileSync } from "node:child_process";
|
|
26
27
|
import fs from "node:fs";
|
|
27
28
|
import os from "node:os";
|
|
28
29
|
import path from "node:path";
|
|
@@ -44,6 +45,14 @@ import {
|
|
|
44
45
|
import { useIsolatedConfigEnv } from "../test/helpers/isolated-config.ts";
|
|
45
46
|
import { createRealTestRuntime } from "../test/helpers/real-runtime.ts";
|
|
46
47
|
|
|
48
|
+
const REPO_ROOT = path.resolve(import.meta.dirname, "..", "..", "..");
|
|
49
|
+
const CLEANUP_HELPER_SCRIPT = path.join(
|
|
50
|
+
REPO_ROOT,
|
|
51
|
+
"packages",
|
|
52
|
+
"scripts",
|
|
53
|
+
"rm-path-recursive.mjs",
|
|
54
|
+
);
|
|
55
|
+
|
|
47
56
|
async function getJson(url: string): Promise<Record<string, unknown>> {
|
|
48
57
|
const res = await fetch(url);
|
|
49
58
|
assert.equal(res.status, 200, `${url} should return 200, got ${res.status}`);
|
|
@@ -223,7 +232,10 @@ async function main(): Promise<void> {
|
|
|
223
232
|
} finally {
|
|
224
233
|
await configEnv.restore().catch(() => undefined);
|
|
225
234
|
try {
|
|
226
|
-
|
|
235
|
+
execFileSync(process.execPath, [CLEANUP_HELPER_SCRIPT, dataRoot], {
|
|
236
|
+
cwd: REPO_ROOT,
|
|
237
|
+
stdio: "ignore",
|
|
238
|
+
});
|
|
227
239
|
} catch {
|
|
228
240
|
// best-effort temp cleanup
|
|
229
241
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* prints which objective requirements are currently proven versus externally
|
|
7
7
|
* blocked.
|
|
8
8
|
*/
|
|
9
|
-
import { spawnSync } from "node:child_process";
|
|
9
|
+
import { execFileSync, spawnSync } from "node:child_process";
|
|
10
10
|
import fs from "node:fs";
|
|
11
11
|
import path from "node:path";
|
|
12
12
|
import { fileURLToPath } from "node:url";
|
|
@@ -15,6 +15,12 @@ const scriptDir = path.dirname(fileURLToPath(import.meta.url));
|
|
|
15
15
|
const appCoreRoot = path.resolve(scriptDir, "..");
|
|
16
16
|
const repoRoot = path.resolve(scriptDir, "..", "..", "..");
|
|
17
17
|
const packagesRoot = path.join(repoRoot, "packages");
|
|
18
|
+
const cleanupHelperScript = path.join(
|
|
19
|
+
repoRoot,
|
|
20
|
+
"packages",
|
|
21
|
+
"scripts",
|
|
22
|
+
"rm-path-recursive.mjs",
|
|
23
|
+
);
|
|
18
24
|
const defaultEvidencePath = path.join(
|
|
19
25
|
repoRoot,
|
|
20
26
|
".eliza-local",
|
|
@@ -70,10 +76,13 @@ function parseArgs(argv) {
|
|
|
70
76
|
const checks = [
|
|
71
77
|
{
|
|
72
78
|
key: "homepage-bundle",
|
|
73
|
-
label:
|
|
79
|
+
label:
|
|
80
|
+
"published homepage bundle points users at the shared gateway number",
|
|
74
81
|
command: ["node", ["./scripts/check-homepage-public-readiness.mjs"]],
|
|
75
82
|
pass: (result) =>
|
|
76
|
-
/PASS homepage-bundle: .*gateway=yes personal-number=no/.test(
|
|
83
|
+
/PASS homepage-bundle: .*gateway=yes personal-number=no/.test(
|
|
84
|
+
result.output,
|
|
85
|
+
),
|
|
77
86
|
},
|
|
78
87
|
{
|
|
79
88
|
key: "homepage-public-dns",
|
|
@@ -103,7 +112,8 @@ const checks = [
|
|
|
103
112
|
},
|
|
104
113
|
{
|
|
105
114
|
key: "cloud-onboarding",
|
|
106
|
-
label:
|
|
115
|
+
label:
|
|
116
|
+
"production Cloud API routes unknown sender to onboarding through +14159611510/bluebubbles/blooio, gets product/pricing/$5 credit and login link",
|
|
107
117
|
command: ["node", ["./scripts/verify-cloud-api-production-deploy.mjs"]],
|
|
108
118
|
pass: (result) =>
|
|
109
119
|
result.status === 0 &&
|
|
@@ -118,7 +128,8 @@ const checks = [
|
|
|
118
128
|
},
|
|
119
129
|
{
|
|
120
130
|
key: "routing-contracts",
|
|
121
|
-
label:
|
|
131
|
+
label:
|
|
132
|
+
"known-owner priority, friend-contact routing, and contact recording contracts pass",
|
|
122
133
|
command: [
|
|
123
134
|
"bun",
|
|
124
135
|
[
|
|
@@ -162,7 +173,8 @@ const checks = [
|
|
|
162
173
|
/Cannot find module '@elizaos\/core'|Cannot find package '@elizaos\/core'|WriteFailed/.test(
|
|
163
174
|
result.output,
|
|
164
175
|
),
|
|
165
|
-
blockedDetail:
|
|
176
|
+
blockedDetail:
|
|
177
|
+
"linked workspace test runtime is not built or Bun coverage output failed",
|
|
166
178
|
next: [
|
|
167
179
|
"build linked workspaces: bun run --cwd packages/cloud-shared build:linked-workspaces",
|
|
168
180
|
"rerun: bun run --cwd packages/app-core sms-gateway:status",
|
|
@@ -170,7 +182,8 @@ const checks = [
|
|
|
170
182
|
},
|
|
171
183
|
{
|
|
172
184
|
key: "provisioning-handoff",
|
|
173
|
-
label:
|
|
185
|
+
label:
|
|
186
|
+
"post-login provisioning grants starter credit and copies onboarding transcript into agent memory",
|
|
174
187
|
command: [
|
|
175
188
|
"bun",
|
|
176
189
|
[
|
|
@@ -199,29 +212,45 @@ const checks = [
|
|
|
199
212
|
cwd: () => createBunTestCwd("sms-gateway-provisioning-"),
|
|
200
213
|
pass: (result) =>
|
|
201
214
|
result.status === 0 &&
|
|
202
|
-
|
|
215
|
+
/\d+ pass/.test(result.output) &&
|
|
203
216
|
/0 fail/.test(result.output),
|
|
204
217
|
},
|
|
205
218
|
{
|
|
206
219
|
key: "android-apk",
|
|
207
|
-
label:
|
|
208
|
-
|
|
220
|
+
label:
|
|
221
|
+
"Android SMS gateway APK is built and has the required gateway manifest surface",
|
|
222
|
+
command: [
|
|
223
|
+
"node",
|
|
224
|
+
["./scripts/install-android-sms-gateway.mjs", "--doctor"],
|
|
225
|
+
],
|
|
209
226
|
pass: (result) =>
|
|
210
227
|
/PASS apk: .*eliza-android-sms-gateway-debug\.apk/.test(result.output) &&
|
|
211
|
-
/PASS apk-manifest: SMS gateway manifest surface is present/.test(
|
|
228
|
+
/PASS apk-manifest: SMS gateway manifest surface is present/.test(
|
|
229
|
+
result.output,
|
|
230
|
+
),
|
|
212
231
|
},
|
|
213
232
|
{
|
|
214
233
|
key: "android-transport",
|
|
215
234
|
label: "Android physical SMS gateway is installed and physically verified",
|
|
216
235
|
command: [
|
|
217
236
|
"node",
|
|
218
|
-
[
|
|
237
|
+
[
|
|
238
|
+
"./scripts/verify-android-sms-gateway-e2e.mjs",
|
|
239
|
+
"--wait-device",
|
|
240
|
+
"2",
|
|
241
|
+
"--timeout",
|
|
242
|
+
"1",
|
|
243
|
+
],
|
|
219
244
|
],
|
|
220
245
|
pass: (result) =>
|
|
221
246
|
result.status === 0 &&
|
|
222
247
|
/Physical Android SMS gateway verification passed/.test(result.output),
|
|
223
|
-
blocked: (result) =>
|
|
224
|
-
|
|
248
|
+
blocked: (result) =>
|
|
249
|
+
/Timed out waiting .* for an adb device|Missing SMS gateway milestones/.test(
|
|
250
|
+
result.output,
|
|
251
|
+
),
|
|
252
|
+
blockedDetail:
|
|
253
|
+
"Android phone is not paired/connected and physical SMS milestones are not proven",
|
|
225
254
|
next: [
|
|
226
255
|
"open Android Developer Options > Wireless debugging > Pair device with pairing code",
|
|
227
256
|
"leave this running while opening the pairing screen: bun run --cwd packages/app-core sms-gateway:watch:pair",
|
|
@@ -231,24 +260,35 @@ const checks = [
|
|
|
231
260
|
},
|
|
232
261
|
{
|
|
233
262
|
key: "bluebubbles-inbound",
|
|
234
|
-
label:
|
|
263
|
+
label:
|
|
264
|
+
"BlueBubbles fallback bridge can receive and forward inbound events to Cloud as +14159611510",
|
|
235
265
|
command: ["node", ["./scripts/verify-bluebubbles-inbound-readiness.mjs"]],
|
|
236
266
|
pass: (result) =>
|
|
237
267
|
result.status === 0 &&
|
|
238
268
|
/gateway=\+14159611510/.test(result.output) &&
|
|
239
269
|
/inbound=pass/.test(result.output),
|
|
240
270
|
blocked: (result) =>
|
|
241
|
-
/bridge|cloud-secret|bluebubbles-server|inbound-webhook|gateway/.test(
|
|
242
|
-
|
|
243
|
-
|
|
271
|
+
/bridge|cloud-secret|bluebubbles-server|inbound-webhook|gateway/.test(
|
|
272
|
+
result.output,
|
|
273
|
+
),
|
|
274
|
+
blockedDetail:
|
|
275
|
+
"BlueBubbles bridge, server, cloud secret, or inbound webhook is not ready",
|
|
276
|
+
next: [
|
|
277
|
+
"rerun bridge doctor: bun run --cwd packages/app-core sms-gateway:doctor",
|
|
278
|
+
],
|
|
244
279
|
},
|
|
245
280
|
{
|
|
246
281
|
key: "bluebubbles-transport",
|
|
247
282
|
label: "BlueBubbles fallback outbound path is real-send validated",
|
|
248
283
|
command: ["bun", ["run", "sms-gateway:validate:bluebubbles"]],
|
|
249
|
-
pass: (result) =>
|
|
250
|
-
|
|
251
|
-
|
|
284
|
+
pass: (result) =>
|
|
285
|
+
result.status === 0 && /PASS .* validated at/.test(result.output),
|
|
286
|
+
blocked: (result) =>
|
|
287
|
+
/Refusing to send without --confirm-real-send|Shortcut outbound validation missing/.test(
|
|
288
|
+
result.output,
|
|
289
|
+
),
|
|
290
|
+
blockedDetail:
|
|
291
|
+
"real outbound validation send has not been explicitly confirmed",
|
|
252
292
|
next: [
|
|
253
293
|
"after explicit real-send approval, run: bun run --cwd packages/app-core sms-gateway:validate:bluebubbles -- --confirm-real-send",
|
|
254
294
|
"then verify pending egress: bun run --cwd packages/app-core sms-gateway:verify:bluebubbles",
|
|
@@ -267,6 +307,13 @@ function createBunTestCwd(prefix) {
|
|
|
267
307
|
return cwd;
|
|
268
308
|
}
|
|
269
309
|
|
|
310
|
+
function removePathRecursive(targetPath) {
|
|
311
|
+
execFileSync(process.execPath, [cleanupHelperScript, targetPath], {
|
|
312
|
+
cwd: repoRoot,
|
|
313
|
+
stdio: "inherit",
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
|
|
270
317
|
function run(command, args, { cwd = appCoreRoot } = {}) {
|
|
271
318
|
const result = spawnSync(command, args, {
|
|
272
319
|
cwd,
|
|
@@ -304,7 +351,7 @@ function summarizeEvidenceJson(value) {
|
|
|
304
351
|
"sentCount",
|
|
305
352
|
"error",
|
|
306
353
|
]) {
|
|
307
|
-
if (Object.
|
|
354
|
+
if (Object.hasOwn(value, key)) {
|
|
308
355
|
summary[key] = value[key];
|
|
309
356
|
}
|
|
310
357
|
}
|
|
@@ -326,7 +373,7 @@ function summarizeEvidenceJson(value) {
|
|
|
326
373
|
"apexRecords",
|
|
327
374
|
"wwwCnames",
|
|
328
375
|
]) {
|
|
329
|
-
if (Object.
|
|
376
|
+
if (Object.hasOwn(value.details, key)) {
|
|
330
377
|
summary[key] = value.details[key];
|
|
331
378
|
}
|
|
332
379
|
}
|
|
@@ -364,8 +411,12 @@ function writeEvidence({ evidencePath, ok, results }) {
|
|
|
364
411
|
ok,
|
|
365
412
|
checkedAt: new Date().toISOString(),
|
|
366
413
|
gatewayPhoneNumber: "+14159611510",
|
|
367
|
-
proven: results
|
|
368
|
-
|
|
414
|
+
proven: results
|
|
415
|
+
.filter((result) => result.status === "proven")
|
|
416
|
+
.map((result) => result.key),
|
|
417
|
+
blocked: results
|
|
418
|
+
.filter((result) => result.status === "blocked")
|
|
419
|
+
.map((result) => result.key),
|
|
369
420
|
requirements: results,
|
|
370
421
|
};
|
|
371
422
|
fs.writeFileSync(evidencePath, `${JSON.stringify(evidence, null, 2)}\n`);
|
|
@@ -379,7 +430,7 @@ for (const check of checks) {
|
|
|
379
430
|
const [command, args] = check.command;
|
|
380
431
|
const cwd = check.cwd?.();
|
|
381
432
|
const result = run(command, args, { cwd });
|
|
382
|
-
if (cwd)
|
|
433
|
+
if (cwd) removePathRecursive(cwd);
|
|
383
434
|
const passed = check.pass(result);
|
|
384
435
|
const isBlocked = !passed && check.blocked?.(result);
|
|
385
436
|
if (passed) {
|
|
@@ -401,7 +452,9 @@ for (const check of checks) {
|
|
|
401
452
|
const detail = isBlocked
|
|
402
453
|
? check.blockedDetail
|
|
403
454
|
: oneLine(result.output).slice(0, 240) || `exit ${result.status}`;
|
|
404
|
-
console.log(
|
|
455
|
+
console.log(
|
|
456
|
+
`[sms-gateway-audit] BLOCKED ${check.key}: ${check.label}; ${detail}`,
|
|
457
|
+
);
|
|
405
458
|
for (const next of check.next ?? []) {
|
|
406
459
|
console.log(`[sms-gateway-audit] NEXT ${check.key}: ${next}`);
|
|
407
460
|
}
|
|
@@ -419,10 +472,22 @@ for (const check of checks) {
|
|
|
419
472
|
}
|
|
420
473
|
|
|
421
474
|
if (blocked) {
|
|
422
|
-
console.log(
|
|
423
|
-
|
|
475
|
+
console.log(
|
|
476
|
+
"[sms-gateway-audit] status=blocked physical/end-to-end completion is not proven.",
|
|
477
|
+
);
|
|
478
|
+
writeEvidence({
|
|
479
|
+
evidencePath: args.evidencePath,
|
|
480
|
+
ok: false,
|
|
481
|
+
results: evidenceResults,
|
|
482
|
+
});
|
|
424
483
|
process.exitCode = 1;
|
|
425
484
|
} else {
|
|
426
|
-
console.log(
|
|
427
|
-
|
|
485
|
+
console.log(
|
|
486
|
+
"[sms-gateway-audit] status=complete all objective requirements are currently proven.",
|
|
487
|
+
);
|
|
488
|
+
writeEvidence({
|
|
489
|
+
evidencePath: args.evidencePath,
|
|
490
|
+
ok: true,
|
|
491
|
+
results: evidenceResults,
|
|
492
|
+
});
|
|
428
493
|
}
|