@elizaos/app-core 2.0.3-beta.2 → 2.0.3-beta.4
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/agent-bridge.d.ts +5 -5
- package/api/auth/audit.d.ts +1 -1
- package/api/auth/auth-context.d.ts +1 -1
- package/api/auth/bootstrap-token.d.ts +1 -1
- package/api/auth/sessions.d.ts +1 -1
- package/api/auth-bootstrap-routes.d.ts +1 -1
- package/api/auth-pairing-routes.d.ts +1 -1
- package/api/auth-pairing-routes.d.ts.map +1 -1
- package/api/auth-pairing-routes.js +2 -3
- package/api/auth-session-routes.d.ts +2 -2
- package/api/auth.d.ts +1 -1
- package/api/automations-compat-routes.d.ts +1 -1
- package/api/background-tasks-routes.d.ts +1 -1
- package/api/catalog-routes.d.ts +1 -1
- package/api/cloud-voice-routes.d.ts +1 -1
- package/api/compat-route-shared.d.ts +12 -5
- package/api/compat-route-shared.d.ts.map +1 -1
- package/api/compat-route-shared.js +22 -187
- package/api/database-rows-compat-routes.d.ts +1 -1
- package/api/dev-compat-routes.d.ts +1 -1
- package/api/dev-route-catalog.d.ts.map +1 -1
- package/api/dev-route-catalog.js +20 -0
- package/api/drop-status-compat-route.d.ts +3 -0
- package/api/drop-status-compat-route.d.ts.map +1 -0
- package/api/drop-status-compat-route.js +12 -0
- package/api/first-run-routes.d.ts +1 -1
- package/api/internal-routes.d.ts +1 -1
- package/api/runtime-mode-routes.d.ts +1 -1
- package/api/secrets-manager-routes.d.ts.map +1 -1
- package/api/sensitive-request-routes.d.ts +2 -2
- package/api/server-config-filter.d.ts.map +1 -1
- package/api/server-config-filter.js +0 -1
- package/api/server-first-run-helpers.d.ts.map +1 -1
- package/api/server-first-run-helpers.js +0 -3
- package/api/server.d.ts +8 -8
- package/api/server.d.ts.map +1 -1
- package/api/server.js +13 -59
- package/api/training-benchmarks.d.ts +1 -1
- package/api/training-benchmarks.d.ts.map +1 -1
- package/api/training-benchmarks.js +31 -9
- package/api/workbench-compat-routes.d.ts +1 -1
- package/benchmark/server-utils.d.ts +2 -2
- package/browser.d.ts +4 -4
- package/cli/plugins-cli.d.ts.map +1 -1
- package/cli/plugins-cli.js +5 -0
- package/cli/program/register.auth.d.ts +27 -1
- package/cli/program/register.auth.d.ts.map +1 -1
- package/cli/program/register.auth.js +187 -0
- package/cli/program/register.dashboard.d.ts.map +1 -1
- package/cli/program/register.dashboard.js +11 -1
- package/cli/program.d.ts +1 -1
- package/first-run/first-run-config.d.ts +1 -1
- package/index.d.ts +46 -47
- package/index.d.ts.map +1 -1
- package/index.js +3 -7
- package/package.json +42 -36
- package/packaging/PUBLISHING_GUIDE.md +20 -20
- package/platform/elizaos-agent-browser-stub.d.ts +0 -1
- package/platform/elizaos-agent-browser-stub.d.ts.map +1 -1
- package/platform/elizaos-agent-browser-stub.js +0 -1
- package/platform/ios-runtime-bridge.d.ts.map +1 -1
- package/platform/ios-runtime-bridge.js +0 -1
- package/platform/native-plugin-entrypoints.d.ts +2 -2
- package/platforms/android/app/build.gradle +30 -7
- package/platforms/android/app/src/main/elizavoice-jni/elizavoice-jni.cpp +179 -35
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaAgentService.java +60 -32
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaBionicInferenceServer.java +405 -65
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaVoiceNative.java +35 -0
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaVoicePlugin.java +13 -6
- package/platforms/android/app/src/main/res/drawable/splash.png +0 -0
- package/platforms/android/app/src/main/res/drawable-land-hdpi/splash.png +0 -0
- package/platforms/android/app/src/main/res/drawable-land-mdpi/splash.png +0 -0
- package/platforms/android/app/src/main/res/drawable-land-xhdpi/splash.png +0 -0
- package/platforms/android/app/src/main/res/drawable-land-xxhdpi/splash.png +0 -0
- package/platforms/android/app/src/main/res/drawable-land-xxxhdpi/splash.png +0 -0
- package/platforms/android/app/src/main/res/drawable-port-hdpi/splash.png +0 -0
- package/platforms/android/app/src/main/res/drawable-port-mdpi/splash.png +0 -0
- package/platforms/android/app/src/main/res/drawable-port-xhdpi/splash.png +0 -0
- package/platforms/android/app/src/main/res/drawable-port-xxhdpi/splash.png +0 -0
- package/platforms/android/app/src/main/res/drawable-port-xxxhdpi/splash.png +0 -0
- package/platforms/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/platforms/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png +0 -0
- package/platforms/android/app/src/main/res/mipmap-hdpi/ic_launcher_monochrome.png +0 -0
- package/platforms/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/platforms/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/platforms/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png +0 -0
- package/platforms/android/app/src/main/res/mipmap-mdpi/ic_launcher_monochrome.png +0 -0
- package/platforms/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/platforms/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/platforms/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png +0 -0
- package/platforms/android/app/src/main/res/mipmap-xhdpi/ic_launcher_monochrome.png +0 -0
- package/platforms/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/platforms/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/platforms/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png +0 -0
- package/platforms/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_monochrome.png +0 -0
- package/platforms/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/platforms/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/platforms/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png +0 -0
- package/platforms/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_monochrome.png +0 -0
- package/platforms/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/platforms/android/app/src/main/res/values/colors.xml +5 -1
- package/platforms/android/app/src/main/res/values/ic_launcher_background.xml +1 -1
- package/platforms/android/app/src/main/res/values/styles.xml +4 -1
- package/platforms/electrobun/electrobun.config.ts +0 -1
- package/platforms/electrobun/native/macos/window-effects.mm +4 -0
- package/platforms/electrobun/package.json +11 -9
- package/platforms/electrobun/remotes/local-model/src/bun/eliza1-catalog.ts +1 -1
- package/platforms/electrobun/remotes/runtime/src/dev/phase2-smoke.ts +10 -5
- package/platforms/electrobun/remotes/runtime/src/dev/phase3-smoke.ts +11 -15
- package/platforms/electrobun/src/application-menu.ts +0 -7
- package/platforms/electrobun/src/desktop-http-request.test.ts +30 -1
- package/platforms/electrobun/src/desktop-http-request.ts +14 -2
- package/platforms/electrobun/src/desktop-test-bridge-server.ts +28 -0
- package/platforms/electrobun/src/fatal-shutdown.test.ts +3 -7
- package/platforms/electrobun/src/index.ts +64 -13
- package/platforms/electrobun/src/lifecycle/api-base-owner.test.ts +83 -0
- package/platforms/electrobun/src/lifecycle/api-base-owner.ts +37 -16
- package/platforms/electrobun/src/native/agent.ts +28 -17
- package/platforms/electrobun/src/native/credentials.ts +6 -1
- package/platforms/electrobun/src/native/desktop-window.test.ts +142 -26
- package/platforms/electrobun/src/native/desktop.ts +8 -4
- package/platforms/electrobun/src/native/index.ts +6 -0
- package/platforms/electrobun/src/native/remote-plugin-host.ts +18 -8
- package/platforms/electrobun/src/preload.js +1 -1
- package/platforms/electrobun/src/voice/voice-live-validation.test.ts +10 -5
- package/platforms/electrobun/src/voice/voice-runtime-adapter.ts +3 -2
- package/platforms/electrobun/src/voice/voice-service.test.ts +26 -0
- package/platforms/electrobun/src/voice/voice-service.ts +57 -17
- package/platforms/electrobun/tsconfig.json +17 -1
- package/platforms/ios/App/App/Base.lproj/LaunchScreen.storyboard +4 -6
- package/registry/index.d.ts +1 -6
- package/registry/index.d.ts.map +1 -1
- package/registry/index.js +9 -101
- package/runtime/android-avf-microdroid-bridge.d.ts +1 -1
- package/runtime/bundled-fused-lib.d.ts +36 -0
- package/runtime/bundled-fused-lib.d.ts.map +1 -0
- package/runtime/bundled-fused-lib.js +77 -0
- package/runtime/channel-plugin-map.d.ts +1 -5
- package/runtime/channel-plugin-map.d.ts.map +1 -1
- package/runtime/channel-plugin-map.js +11 -31
- package/runtime/desktop/index.d.ts +5 -5
- package/runtime/dev-server.js +11 -2
- package/runtime/eliza.d.ts.map +1 -1
- package/runtime/eliza.js +18 -8
- package/runtime/mode/route-mode-guard.d.ts +1 -1
- package/runtime/mode/route-mode-matrix.d.ts +1 -1
- package/runtime/voice-warmup.d.ts +4 -19
- package/runtime/voice-warmup.d.ts.map +1 -1
- package/runtime/voice-warmup.js +4 -14
- package/scripts/aosp/README.md +10 -1
- package/scripts/aosp/compile-libllama-paths.mjs +110 -0
- package/scripts/aosp/compile-libllama-zig-pin.test.mjs +147 -0
- package/scripts/aosp/compile-libllama.mjs +377 -81
- package/scripts/aosp/compile-libllama.test.mjs +133 -0
- package/scripts/aosp/compile-shim.mjs +21 -1
- package/scripts/aosp/deploy-pixel.mjs +1 -1
- package/scripts/aosp/stage-default-models.mjs +24 -31
- package/scripts/aosp/stage-default-models.test.mjs +23 -0
- package/scripts/assert-required-bundled-packages.test.ts +22 -1
- package/scripts/build-helpers/verify-fused-symbols.mjs +33 -0
- package/scripts/build-helpers/verify-fused-symbols.test.mjs +0 -0
- package/scripts/build-image.sh +1 -3
- package/scripts/build-llama-cpp-mtp.mjs +17 -16
- package/scripts/check-i18n.mjs +0 -1
- package/scripts/copy-runtime-node-modules.ts +147 -0
- package/scripts/desktop-build.mjs +317 -4
- package/scripts/docker-ci-smoke.sh +33 -8
- package/scripts/ensure-type-package-aliases.mjs +1 -1
- package/scripts/ios-xcframework/run-physical-device-smoke.mjs +1 -1
- package/scripts/lib/agent-source-watcher.mjs +0 -1
- package/scripts/lib/artifact-staleness.d.mts +33 -0
- package/scripts/lib/artifact-staleness.mjs +122 -0
- package/scripts/lib/artifact-staleness.test.mts +98 -0
- package/scripts/lib/duet-bridge.mjs +1 -1
- package/scripts/lib/ios-plist-url-scheme.mjs +80 -0
- package/scripts/lib/mobile-build-decisions.mjs +97 -0
- package/scripts/lib/renderer-build-manifest.d.mts +65 -0
- package/scripts/lib/renderer-build-manifest.mjs +257 -0
- package/scripts/lib/renderer-build-manifest.test.mts +277 -0
- package/scripts/lib/stage-android-agent.mjs +13 -4
- package/scripts/lib/verify-ondevice-artifact.d.mts +16 -0
- package/scripts/lib/verify-ondevice-artifact.mjs +61 -0
- package/scripts/lib/verify-ondevice-artifact.test.mts +98 -0
- package/scripts/lib/websocket-pending-queue.ts +92 -0
- package/scripts/link-docker-local-app-packages.mjs +6 -0
- package/scripts/playwright-ui-live-stack.ts +430 -144
- package/scripts/playwright-ui-smoke-api-stub.mjs +160 -168
- package/scripts/run-local-plugin-live-smoke.mjs +1 -6
- package/scripts/run-mobile-build-brand-separation.test.mts +33 -0
- package/scripts/run-mobile-build-ios-engine-gate.test.mjs +85 -0
- package/scripts/run-mobile-build-mtp-staleness.test.mts +198 -0
- package/scripts/run-mobile-build.mjs +408 -86
- package/scripts/serve-real-local-agent.ts +72 -0
- package/scripts/stage-desktop-fused-lib.mjs +43 -14
- package/scripts/verify-ondevice-artifact.mjs +111 -0
- package/scripts/voice-attribution-smoke.ts +144 -38
- package/scripts/voice-duet.mjs +6 -6
- package/scripts/voice-e2e-hardware.ts +22 -16
- package/scripts/voice-interactive.mjs +16 -45
- package/security/agent-vault-id.d.ts +1 -1
- package/security/platform-secure-store-node.d.ts +1 -1
- package/services/ambient-audio/consent.d.ts +1 -1
- package/services/ambient-audio/index.d.ts +6 -6
- package/services/ambient-audio/replay-buffer.d.ts +1 -1
- package/services/ambient-audio/response-gate.d.ts +1 -1
- package/services/ambient-audio/service.d.ts +3 -3
- package/services/connector-target-catalog.d.ts +1 -1
- package/services/sensitive-requests/index.d.ts +6 -6
- package/services/steward-sidecar/wallet-setup.d.ts +1 -1
- package/services/steward-sidecar.d.ts +3 -3
- package/services/tunnel-to-mobile/index.d.ts +1 -1
- package/services/vault-bootstrap.d.ts.map +1 -1
- package/services/vault-bootstrap.js +14 -10
- package/services/voice-profiles/diarization-pipeline.d.ts +1 -1
- package/services/voice-profiles/index.d.ts +11 -11
- package/services/voice-profiles/owner-confidence.d.ts +1 -1
- package/services/voice-profiles/private-challenge.d.ts +1 -1
- package/services/voice-profiles/store.d.ts +1 -1
- package/test/helpers/live-provider.test.ts +91 -1
- package/test/helpers/live-provider.ts +195 -51
- package/test/scripts/websocket-pending-queue.test.ts +119 -0
- package/test-support/test-helpers.d.ts +0 -33
- package/test-support/test-helpers.d.ts.map +1 -1
- package/test-support/test-helpers.js +81 -189
- package/ui-compat.d.ts +1 -0
- package/ui-compat.d.ts.map +1 -1
- package/ui-compat.js +4 -0
- package/platforms/electrobun/docs/convergence-audit.json +0 -3505
- package/platforms/electrobun/docs/convergence-audit.md +0 -694
- package/platforms/electrobun/scripts/ensure-whisper-gguf.sh +0 -55
- package/platforms/electrobun/scripts/ensure-whisper-model.sh +0 -35
- package/platforms/electrobun/scripts/generate-convergence-audit.ts +0 -1203
- package/platforms/electrobun/src/native/whisper-env.test.ts +0 -71
- package/platforms/electrobun/src/native/whisper-env.ts +0 -68
- package/registry/app-registry.d.ts +0 -14
- package/registry/app-registry.d.ts.map +0 -1
- package/registry/app-registry.js +0 -29
- package/registry/entries/apps/app-polymarket.json +0 -31
- package/registry/entries/apps/clawville.json +0 -27
- package/registry/entries/apps/companion.json +0 -28
- package/registry/entries/apps/database-viewer.json +0 -27
- package/registry/entries/apps/defense-of-the-agents.json +0 -27
- package/registry/entries/apps/documents.json +0 -30
- package/registry/entries/apps/feed.json +0 -27
- package/registry/entries/apps/hyperliquid.json +0 -31
- package/registry/entries/apps/log-viewer.json +0 -27
- package/registry/entries/apps/memory-viewer.json +0 -27
- package/registry/entries/apps/model-tester.json +0 -31
- package/registry/entries/apps/plugin-viewer.json +0 -27
- package/registry/entries/apps/relationship-viewer.json +0 -27
- package/registry/entries/apps/runtime-debugger.json +0 -27
- package/registry/entries/apps/shopify.json +0 -31
- package/registry/entries/apps/skills-viewer.json +0 -27
- package/registry/entries/apps/steward.json +0 -31
- package/registry/entries/apps/training.json +0 -54
- package/registry/entries/apps/trajectory-viewer.json +0 -27
- package/registry/entries/apps/vincent.json +0 -31
- package/registry/entries/connectors/bluebubbles.json +0 -99
- package/registry/entries/connectors/bluesky.json +0 -173
- package/registry/entries/connectors/discord.json +0 -119
- package/registry/entries/connectors/farcaster.json +0 -174
- package/registry/entries/connectors/feishu.json +0 -79
- package/registry/entries/connectors/google-chat.json +0 -120
- package/registry/entries/connectors/google.json +0 -82
- package/registry/entries/connectors/imessage.json +0 -96
- package/registry/entries/connectors/instagram.json +0 -64
- package/registry/entries/connectors/line.json +0 -86
- package/registry/entries/connectors/matrix.json +0 -94
- package/registry/entries/connectors/mattermost.json +0 -110
- package/registry/entries/connectors/msteams.json +0 -104
- package/registry/entries/connectors/nextcloud-talk.json +0 -104
- package/registry/entries/connectors/nostr.json +0 -70
- package/registry/entries/connectors/signal.json +0 -81
- package/registry/entries/connectors/slack.json +0 -102
- package/registry/entries/connectors/telegram.json +0 -71
- package/registry/entries/connectors/tlon.json +0 -94
- package/registry/entries/connectors/twitch.json +0 -110
- package/registry/entries/connectors/whatsapp.json +0 -113
- package/registry/entries/connectors/x.json +0 -231
- package/registry/entries/connectors/zalo.json +0 -112
- package/registry/entries/connectors/zalouser.json +0 -122
- package/registry/entries/plugins/agent-orchestrator.json +0 -33
- package/registry/entries/plugins/agent-skills.json +0 -72
- package/registry/entries/plugins/anthropic.json +0 -73
- package/registry/entries/plugins/app-control.json +0 -23
- package/registry/entries/plugins/auto-trader.json +0 -203
- package/registry/entries/plugins/background-runner.json +0 -26
- package/registry/entries/plugins/blooio.json +0 -102
- package/registry/entries/plugins/browser.json +0 -75
- package/registry/entries/plugins/cli.json +0 -40
- package/registry/entries/plugins/clipboard.json +0 -44
- package/registry/entries/plugins/coding-tools.json +0 -71
- package/registry/entries/plugins/commands.json +0 -63
- package/registry/entries/plugins/computeruse.json +0 -74
- package/registry/entries/plugins/copilot-proxy.json +0 -93
- package/registry/entries/plugins/directives.json +0 -63
- package/registry/entries/plugins/edge-tts.json +0 -97
- package/registry/entries/plugins/elevenlabs.json +0 -169
- package/registry/entries/plugins/elizacloud.json +0 -208
- package/registry/entries/plugins/evm.json +0 -134
- package/registry/entries/plugins/experience.json +0 -34
- package/registry/entries/plugins/facewear.json +0 -131
- package/registry/entries/plugins/form.json +0 -26
- package/registry/entries/plugins/github.json +0 -93
- package/registry/entries/plugins/gmail-watch.json +0 -25
- package/registry/entries/plugins/goals.json +0 -77
- package/registry/entries/plugins/google-genai.json +0 -106
- package/registry/entries/plugins/groq.json +0 -93
- package/registry/entries/plugins/hedera.json +0 -48
- package/registry/entries/plugins/inmemorydb.json +0 -25
- package/registry/entries/plugins/linear.json +0 -51
- package/registry/entries/plugins/local-inference.json +0 -137
- package/registry/entries/plugins/local-storage.json +0 -36
- package/registry/entries/plugins/localdb.json +0 -25
- package/registry/entries/plugins/mcp.json +0 -44
- package/registry/entries/plugins/memory.json +0 -124
- package/registry/entries/plugins/minecraft.json +0 -79
- package/registry/entries/plugins/moltbook.json +0 -83
- package/registry/entries/plugins/music.json +0 -155
- package/registry/entries/plugins/mysticism.json +0 -48
- package/registry/entries/plugins/nearai.json +0 -82
- package/registry/entries/plugins/ngrok.json +0 -69
- package/registry/entries/plugins/ollama.json +0 -96
- package/registry/entries/plugins/openai.json +0 -189
- package/registry/entries/plugins/openrouter.json +0 -188
- package/registry/entries/plugins/pdf.json +0 -26
- package/registry/entries/plugins/plugin-manager.json +0 -23
- package/registry/entries/plugins/prose.json +0 -48
- package/registry/entries/plugins/rlm.json +0 -26
- package/registry/entries/plugins/roblox.json +0 -88
- package/registry/entries/plugins/rss.json +0 -64
- package/registry/entries/plugins/s3-storage.json +0 -91
- package/registry/entries/plugins/scheduling.json +0 -35
- package/registry/entries/plugins/shell.json +0 -94
- package/registry/entries/plugins/social-alpha.json +0 -72
- package/registry/entries/plugins/tailscale.json +0 -81
- package/registry/entries/plugins/tee.json +0 -53
- package/registry/entries/plugins/todos.json +0 -26
- package/registry/entries/plugins/trajectory-logger.json +0 -33
- package/registry/entries/plugins/trust.json +0 -39
- package/registry/entries/plugins/tts.json +0 -71
- package/registry/entries/plugins/tunnel.json +0 -45
- package/registry/entries/plugins/twilio.json +0 -168
- package/registry/entries/plugins/vercel-ai-gateway.json +0 -128
- package/registry/entries/plugins/video.json +0 -23
- package/registry/entries/plugins/vision.json +0 -43
- package/registry/entries/plugins/webhooks.json +0 -23
- package/registry/entries/plugins/workflow.json +0 -25
- package/registry/entries/plugins/xai.json +0 -75
- package/registry/loader.d.ts +0 -28
- package/registry/loader.d.ts.map +0 -1
- package/registry/loader.js +0 -158
- package/registry/schema.d.ts +0 -1199
- package/registry/schema.d.ts.map +0 -1
- package/registry/schema.js +0 -300
- package/scripts/patches/llama-mobile-kokoro-tts.patch +0 -480
- package/scripts/release-workflow-drift.test.ts +0 -57
- package/test/helpers/i18n.ts +0 -5
- package/test/helpers/loopback.ts +0 -33
- package/test/helpers/react-test.ts +0 -40
- package/test/helpers/skip-without.ts +0 -53
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Locate + wire the fused `libelizainference` that ships INSIDE a packaged
|
|
3
|
+
* desktop app, so a compiled app serves local inference with no env wiring and
|
|
4
|
+
* no separate download.
|
|
5
|
+
*
|
|
6
|
+
* The desktop packaging (`packages/app-core/scripts/desktop-build.mjs` →
|
|
7
|
+
* `stage-desktop-fused-lib.mjs`) stages the fused set into
|
|
8
|
+
* `<eliza-dist>/local-inference/lib/`, and the Electrobun build copies the
|
|
9
|
+
* whole `dist` tree to `Resources/app/eliza-dist/`. At runtime this module
|
|
10
|
+
* lives at `<eliza-dist>/node_modules/@elizaos/app-core/dist/runtime/…`, so we
|
|
11
|
+
* walk up looking for a `local-inference/lib/<fused>` that actually exists.
|
|
12
|
+
*/
|
|
13
|
+
import { existsSync } from "node:fs";
|
|
14
|
+
import path from "node:path";
|
|
15
|
+
import { fileURLToPath } from "node:url";
|
|
16
|
+
import { logger } from "@elizaos/core";
|
|
17
|
+
/**
|
|
18
|
+
* Candidate filenames for the fused library, per platform. Mirrors
|
|
19
|
+
* `plugin-local-inference`'s `resolveFusedLibraryPath` / the FFI loader so the
|
|
20
|
+
* probe and the runtime agree on what counts as "the fused lib is here".
|
|
21
|
+
*/
|
|
22
|
+
export function fusedLibraryFilenames() {
|
|
23
|
+
if (process.platform === "darwin")
|
|
24
|
+
return ["libelizainference.dylib"];
|
|
25
|
+
if (process.platform === "win32")
|
|
26
|
+
return ["elizainference.dll", "libelizainference.dll"];
|
|
27
|
+
return ["libelizainference.so"];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Walk up from `startUrl`'s directory looking for a `local-inference/lib`
|
|
31
|
+
* directory that already contains a platform fused lib. Self-validating (only
|
|
32
|
+
* matches where the artifact is), so there is no layout ambiguity. Returns null
|
|
33
|
+
* in dev (run from source, nothing staged) and on mobile (native lib ships via
|
|
34
|
+
* jniLibs / xcframework). Best-effort; never throws.
|
|
35
|
+
*/
|
|
36
|
+
export function findBundledFusedLibDir(startUrl = import.meta.url) {
|
|
37
|
+
try {
|
|
38
|
+
const names = fusedLibraryFilenames();
|
|
39
|
+
let dir = path.dirname(fileURLToPath(startUrl));
|
|
40
|
+
for (let depth = 0; depth < 8; depth += 1) {
|
|
41
|
+
const candidate = path.join(dir, "local-inference", "lib");
|
|
42
|
+
if (names.some((name) => existsSync(path.join(candidate, name)))) {
|
|
43
|
+
return candidate;
|
|
44
|
+
}
|
|
45
|
+
const parent = path.dirname(dir);
|
|
46
|
+
if (parent === dir)
|
|
47
|
+
break;
|
|
48
|
+
dir = parent;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
// import.meta / fs probing must never break boot.
|
|
53
|
+
}
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Point the local-inference runtime at the app-bundled fused lib when one is
|
|
58
|
+
* present. Respects an explicit operator override (`ELIZA_INFERENCE_LIBRARY` /
|
|
59
|
+
* `ELIZA_INFERENCE_LIB_DIR`) and is a no-op when nothing is bundled (dev,
|
|
60
|
+
* mobile) — `resolveFusedLibraryPath` then falls back to
|
|
61
|
+
* `<stateDir>/local-inference/lib` as before. Idempotent. Returns the dir it
|
|
62
|
+
* wired (or already-set override), else null.
|
|
63
|
+
*/
|
|
64
|
+
export function ensureBundledFusedLibDir(env = process.env, startUrl = import.meta.url) {
|
|
65
|
+
if (env.ELIZA_INFERENCE_LIBRARY?.trim()) {
|
|
66
|
+
return path.dirname(env.ELIZA_INFERENCE_LIBRARY.trim());
|
|
67
|
+
}
|
|
68
|
+
if (env.ELIZA_INFERENCE_LIB_DIR?.trim()) {
|
|
69
|
+
return env.ELIZA_INFERENCE_LIB_DIR.trim();
|
|
70
|
+
}
|
|
71
|
+
const bundled = findBundledFusedLibDir(startUrl);
|
|
72
|
+
if (!bundled)
|
|
73
|
+
return null;
|
|
74
|
+
env.ELIZA_INFERENCE_LIB_DIR = bundled;
|
|
75
|
+
logger.info(`[eliza] Using app-bundled local-inference lib dir: ${bundled}`);
|
|
76
|
+
return bundled;
|
|
77
|
+
}
|
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
export declare const CHANNEL_PLUGIN_MAP:
|
|
2
|
-
signal: "@elizaos/plugin-signal";
|
|
3
|
-
whatsapp: "@elizaos/plugin-whatsapp";
|
|
4
|
-
wechat: "elizaoswechat";
|
|
5
|
-
};
|
|
1
|
+
export declare const CHANNEL_PLUGIN_MAP: Readonly<Record<string, string>>;
|
|
6
2
|
//# sourceMappingURL=channel-plugin-map.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channel-plugin-map.d.ts","sourceRoot":"","sources":["../../../../../src/runtime/channel-plugin-map.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"channel-plugin-map.d.ts","sourceRoot":"","sources":["../../../../../src/runtime/channel-plugin-map.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAG/D,CAAC"}
|
|
@@ -1,38 +1,18 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
bluebubbles: "@elizaos/plugin-bluebubbles",
|
|
10
|
-
discord: "@elizaos/plugin-discord",
|
|
11
|
-
discordLocal: "@elizaos/plugin-discord-local",
|
|
12
|
-
telegram: "@elizaos/plugin-telegram",
|
|
13
|
-
slack: "@elizaos/plugin-slack",
|
|
14
|
-
x: "@elizaos/plugin-x",
|
|
15
|
-
twitter: "@elizaos/plugin-x",
|
|
16
|
-
whatsapp: "@elizaos/plugin-whatsapp",
|
|
17
|
-
signal: "@elizaos/plugin-signal",
|
|
18
|
-
imessage: "@elizaos/plugin-imessage",
|
|
19
|
-
farcaster: "@elizaos/plugin-farcaster",
|
|
20
|
-
lens: "@elizaos/plugin-lens",
|
|
21
|
-
msteams: "@elizaos/plugin-msteams",
|
|
22
|
-
feishu: "@elizaos/plugin-feishu",
|
|
23
|
-
matrix: "@elizaos/plugin-matrix",
|
|
24
|
-
nostr: "@elizaos/plugin-nostr",
|
|
25
|
-
blooio: "@elizaos/plugin-blooio",
|
|
26
|
-
twitch: "@elizaos/plugin-twitch",
|
|
27
|
-
mattermost: "@elizaos/plugin-mattermost",
|
|
28
|
-
googlechat: "@elizaos/plugin-google-chat",
|
|
1
|
+
// The channel -> plugin-package map is derived at registry build time from each
|
|
2
|
+
// connector entry's `channels` (see packages/registry/src/first-party). This was
|
|
3
|
+
// previously a hand-maintained mirror of `@elizaos/agent`'s CHANNEL_PLUGIN_MAP
|
|
4
|
+
// (kept in sync manually to avoid an `agent ↔ app-core` ESM cycle). Both now
|
|
5
|
+
// statically import the same generated artifact, so the duplication and the
|
|
6
|
+
// cycle are gone — neither package imports the other for this map.
|
|
7
|
+
import channelPluginMap from "@elizaos/registry/first-party/channel-plugin-map.json" with {
|
|
8
|
+
type: "json"
|
|
29
9
|
};
|
|
10
|
+
// App-local channel not in the first-party registry (built from an internal
|
|
11
|
+
// connector, not an npm package).
|
|
30
12
|
const INTERNAL_CHANNEL_PLUGIN_OVERRIDES = {
|
|
31
|
-
signal: "@elizaos/plugin-signal",
|
|
32
|
-
whatsapp: "@elizaos/plugin-whatsapp",
|
|
33
13
|
wechat: "elizaoswechat",
|
|
34
14
|
};
|
|
35
15
|
export const CHANNEL_PLUGIN_MAP = {
|
|
36
|
-
...
|
|
16
|
+
...channelPluginMap,
|
|
37
17
|
...INTERNAL_CHANNEL_PLUGIN_OVERRIDES,
|
|
38
18
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from "./AppWindowRenderer";
|
|
2
|
-
export * from "./DesktopSurfaceNavigationRuntime";
|
|
3
|
-
export * from "./DesktopTrayRuntime";
|
|
4
|
-
export * from "./DetachedShellRoot";
|
|
5
|
-
export * from "./tray-menu";
|
|
1
|
+
export * from "./AppWindowRenderer.js";
|
|
2
|
+
export * from "./DesktopSurfaceNavigationRuntime.js";
|
|
3
|
+
export * from "./DesktopTrayRuntime.js";
|
|
4
|
+
export * from "./DetachedShellRoot.js";
|
|
5
|
+
export * from "./tray-menu.js";
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
package/runtime/dev-server.js
CHANGED
|
@@ -380,6 +380,17 @@ async function main() {
|
|
|
380
380
|
`Kill the process using port ${port} or set ELIZA_API_PORT to a free port.`);
|
|
381
381
|
}
|
|
382
382
|
syncResolvedApiPort(process.env, actualPort);
|
|
383
|
+
// Boot the elizaOS agent runtime without blocking server readiness. Scheduled
|
|
384
|
+
// here — before the CORS dynamic import and the cosmetic banner/pairing block
|
|
385
|
+
// below — because `scheduleRuntimeBootstrap` only queues a macrotask: the lone
|
|
386
|
+
// event-loop yield in the remaining startup tail is the `await import` of
|
|
387
|
+
// server-cors, so queueing the bootstrap first lets `createRuntime()` begin
|
|
388
|
+
// during that import (the measured win under host contention). The runtime
|
|
389
|
+
// needs seconds to become ready, so the synchronous CORS-allowlist
|
|
390
|
+
// invalidation and pairing-code setup that follow still complete long before
|
|
391
|
+
// any cross-origin request can reach the agent. The resolved API port is
|
|
392
|
+
// already synced into env above, so the runtime reads the correct port.
|
|
393
|
+
scheduleRuntimeBootstrap(0, "startup");
|
|
383
394
|
// Invalidate cached CORS port set so the new port is allowed.
|
|
384
395
|
// Dynamic import may be unavailable in non-server build targets (mobile); ignore.
|
|
385
396
|
try {
|
|
@@ -410,8 +421,6 @@ async function main() {
|
|
|
410
421
|
console.log(colorizeDevSettingsStartupBanner(formatApiDevSettingsBannerText(actualPort, {
|
|
411
422
|
hadUserApiTokenInEnv,
|
|
412
423
|
})));
|
|
413
|
-
// 2. Boot the elizaOS agent runtime without blocking server readiness.
|
|
414
|
-
scheduleRuntimeBootstrap(0, "startup");
|
|
415
424
|
console.log(`${getLogPrefix()} Startup init complete in ${Date.now() - startupStart}ms, agent bootstrapping...`);
|
|
416
425
|
}
|
|
417
426
|
// ── Global error handlers (match CLI behavior from run-main.ts) ──
|
package/runtime/eliza.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eliza.d.ts","sourceRoot":"","sources":["../../../../../src/runtime/eliza.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,CAAC;AAOzB,OAAO,EACL,KAAK,uBAAuB,EAC5B,sBAAsB,EAItB,mBAAmB,EAEnB,KAAK,iBAAiB,EACtB,iBAAiB,EACjB,qBAAqB,IAAI,6BAA6B,EACtD,gBAAgB,IAAI,wBAAwB,EAC5C,kBAAkB,IAAI,0BAA0B,EAEhD,eAAe,IAAI,uBAAuB,EAC1C,UAAU,IAAI,kBAAkB,EACjC,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,CAAC;AAE1E,OAAO,EACL,KAAK,YAAY,
|
|
1
|
+
{"version":3,"file":"eliza.d.ts","sourceRoot":"","sources":["../../../../../src/runtime/eliza.ts"],"names":[],"mappings":"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"}
|
package/runtime/eliza.js
CHANGED
|
@@ -16,11 +16,12 @@ import { pathToFileURL } from "node:url";
|
|
|
16
16
|
import { CUSTOM_PLUGINS_DIRNAME, getLastFailedPluginNames, loadElizaConfig, resolveDefaultAgentWorkspaceDir, resolvePackageEntry, resolveUserPath, scanDropInPlugins, applyCloudConfigToEnv as upstreamApplyCloudConfigToEnv, bootElizaRuntime as upstreamBootElizaRuntime, collectPluginNames as upstreamCollectPluginNames, configureLocalEmbeddingPlugin as upstreamConfigureLocalEmbeddingPlugin, shutdownRuntime as upstreamShutdownRuntime, startEliza as upstreamStartEliza, } from "@elizaos/agent";
|
|
17
17
|
export { CHANNEL_PLUGIN_MAP } from "./channel-plugin-map.js";
|
|
18
18
|
export { CUSTOM_PLUGINS_DIRNAME, resolvePackageEntry, scanDropInPlugins };
|
|
19
|
-
import { AutonomyService, ChannelType, logger, ModelType, stringToUuid, } from "@elizaos/core";
|
|
19
|
+
import { AutonomyService, ChannelType, isTruthyEnvValue, logger, ModelType, stringToUuid, } from "@elizaos/core";
|
|
20
20
|
import { ensureRuntimeSqlCompatibility, formatError, formatErrorWithStack, isMobilePlatform, resolveDesktopApiPort, resolveServerOnlyPort, syncAppEnvToEliza, syncElizaEnvAliases, syncResolvedApiPort, } from "@elizaos/shared";
|
|
21
21
|
import { getApps, loadRegistry } from "../registry/index.js";
|
|
22
22
|
import { registerCoreSensitiveRequestAdapters } from "../services/sensitive-requests/index.js";
|
|
23
23
|
import { listAppRoutePluginLoaders, } from "./app-route-plugin-registry.js";
|
|
24
|
+
import { ensureBundledFusedLibDir } from "./bundled-fused-lib.js";
|
|
24
25
|
import { shouldWarmupVoice, warmVoiceModels } from "./voice-warmup.js";
|
|
25
26
|
// plugin-local-inference loaded lazily to avoid static plugin boundary violations.
|
|
26
27
|
let _localInferenceRuntime;
|
|
@@ -457,6 +458,22 @@ async function registerTrainingRuntimeHooks(runtime) {
|
|
|
457
458
|
let latestBootTailRuntime = null;
|
|
458
459
|
async function repairRuntimeAfterBoot(runtime) {
|
|
459
460
|
await ensureRuntimeSqlCompatibility(runtime);
|
|
461
|
+
// Make the app-bundled fused libelizainference (staged into the desktop
|
|
462
|
+
// package) discoverable before any local-inference handler probes
|
|
463
|
+
// `supported()`. No-op in dev / on mobile and when an explicit override is
|
|
464
|
+
// set. Must run before the ensureLocalInferenceHandler calls below.
|
|
465
|
+
ensureBundledFusedLibDir();
|
|
466
|
+
// Invariant guard: the mobile voice backend selector pins phones to the
|
|
467
|
+
// Kokoro-exclusive TTS path via `mobile: isMobilePlatform()`, which keys off
|
|
468
|
+
// ELIZA_PLATFORM. The mobile local-inference gate can fire on the
|
|
469
|
+
// device-bridge / ELIZA_LOCAL_LLAMA / riscv64 triggers without ELIZA_PLATFORM
|
|
470
|
+
// being set, leaving `mobile` false in the selector — risking OmniVoice on a
|
|
471
|
+
// phone. Evaluate both predicates here (outside the mobile branch below) so
|
|
472
|
+
// the warning is actually reachable on the real mismatch.
|
|
473
|
+
(await _localInference()).warnIfMobileGateActiveWithoutPlatform({
|
|
474
|
+
mobilePlatform: isMobilePlatform(),
|
|
475
|
+
warn: logger.warn,
|
|
476
|
+
});
|
|
460
477
|
// Mobile (Android / iOS) shortcut: the runtime is already serving from
|
|
461
478
|
// PGlite + the AI provider plugin. The remaining boot steps either spawn
|
|
462
479
|
// subprocesses (workflow runtime, telegram polling), shell
|
|
@@ -732,13 +749,6 @@ async function ensureTelegramBotPolling(runtime) {
|
|
|
732
749
|
// then opens the now-missing file and throws ENOENT, which surfaces as an
|
|
733
750
|
// uncaughtException and kills the agent.
|
|
734
751
|
let warmupInFlight = null;
|
|
735
|
-
function isTruthyEnvValue(value) {
|
|
736
|
-
const normalized = value?.trim().toLowerCase();
|
|
737
|
-
return (normalized === "1" ||
|
|
738
|
-
normalized === "true" ||
|
|
739
|
-
normalized === "yes" ||
|
|
740
|
-
normalized === "on");
|
|
741
|
-
}
|
|
742
752
|
function isLocalEmbeddingWarmupDeferredByEnv() {
|
|
743
753
|
return isTruthyEnvValue(process.env.ELIZA_DEFER_LOCAL_EMBEDDING_WARMUP);
|
|
744
754
|
}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* Config-load failures propagate to the runtime error handler.
|
|
10
10
|
*/
|
|
11
11
|
import type http from "node:http";
|
|
12
|
-
import { type RuntimeMode } from "./runtime-mode";
|
|
12
|
+
import { type RuntimeMode } from "./runtime-mode.js";
|
|
13
13
|
export interface ModeGateOutcome {
|
|
14
14
|
/** True when the dispatcher should stop — guard wrote a 404. */
|
|
15
15
|
handled: boolean;
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* to the target. Local-inference and cloud are NOT exposed by the
|
|
25
25
|
* controller; the controller proxies to the target instead.
|
|
26
26
|
*/
|
|
27
|
-
import type { RuntimeMode } from "./runtime-mode";
|
|
27
|
+
import type { RuntimeMode } from "./runtime-mode.js";
|
|
28
28
|
export type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "*";
|
|
29
29
|
export interface RouteModeRule {
|
|
30
30
|
/**
|
|
@@ -11,20 +11,10 @@
|
|
|
11
11
|
* instant — the embedding warmup's spirit, via the path voice already uses.
|
|
12
12
|
* Nothing in the voice engine is touched.
|
|
13
13
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* Impact for cloud users: at every desktop boot, two tiny API calls (one
|
|
19
|
-
* silent WAV for STT, one empty-string TTS) will be dispatched through the
|
|
20
|
-
* runtime's model router to whichever cloud voice provider is configured
|
|
21
|
-
* (e.g. ElevenLabs, Eliza Cloud TTS). These calls are billable if the
|
|
22
|
-
* provider charges per-request. They are intentionally small (~100 ms WAV for
|
|
23
|
-
* STT, empty string for TTS) and non-blocking (fire-and-forget). Failures are
|
|
24
|
-
* non-fatal and logged at WARN level.
|
|
25
|
-
*
|
|
26
|
-
* To suppress warmup entirely (both local and cloud) set:
|
|
27
|
-
* ELIZA_SKIP_LOCAL_VOICE_WARMUP=1
|
|
14
|
+
* Warmup fires for both local and cloud setups; for cloud providers this means
|
|
15
|
+
* two tiny billable API calls per desktop boot (a ~100 ms silent WAV for STT
|
|
16
|
+
* and an empty-string TTS), non-blocking and non-fatal. Suppress it entirely
|
|
17
|
+
* with ELIZA_SKIP_LOCAL_VOICE_WARMUP=1.
|
|
28
18
|
*/
|
|
29
19
|
/** Minimal runtime surface we need — avoids importing the heavy AgentRuntime. */
|
|
30
20
|
export interface VoiceWarmupRuntime {
|
|
@@ -44,11 +34,6 @@ export interface VoiceWarmupGate {
|
|
|
44
34
|
* loads on first real use. Cold boot still warms.
|
|
45
35
|
*/
|
|
46
36
|
hotReload?: boolean;
|
|
47
|
-
/**
|
|
48
|
-
* @deprecated No longer used — warmup fires for both local and cloud.
|
|
49
|
-
* Kept for API compatibility; callers may still pass it.
|
|
50
|
-
*/
|
|
51
|
-
localInferenceActive?: boolean;
|
|
52
37
|
}
|
|
53
38
|
/** Pure policy: should we warm voice models in the background? */
|
|
54
39
|
export declare function shouldWarmupVoice(gate: VoiceWarmupGate): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"voice-warmup.d.ts","sourceRoot":"","sources":["../../../../../src/runtime/voice-warmup.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"voice-warmup.d.ts","sourceRoot":"","sources":["../../../../../src/runtime/voice-warmup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,iFAAiF;AACjF,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACjE;AAED,MAAM,WAAW,eAAe;IAC9B,oEAAoE;IACpE,MAAM,EAAE,OAAO,CAAC;IAChB,4CAA4C;IAC5C,OAAO,EAAE,OAAO,CAAC;IACjB;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,kEAAkE;AAClE,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAKhE;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAmB7C;AAED,MAAM,WAAW,qBAAqB;IACpC,+EAA+E;IAC/E,OAAO,EAAE,OAAO,CAAC;IACjB,qCAAqC;IACrC,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAED,KAAK,OAAO,GAAG;IACb,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5B,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7B,CAAC;AA8BF;;;;;;;GAOG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,kBAAkB,EAC3B,KAAK,EAAE,qBAAqB,EAC5B,GAAG,GAAE,OAAiB,GACrB,OAAO,CAAC,IAAI,CAAC,CA+Bf"}
|
package/runtime/voice-warmup.js
CHANGED
|
@@ -11,20 +11,10 @@
|
|
|
11
11
|
* instant — the embedding warmup's spirit, via the path voice already uses.
|
|
12
12
|
* Nothing in the voice engine is touched.
|
|
13
13
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* Impact for cloud users: at every desktop boot, two tiny API calls (one
|
|
19
|
-
* silent WAV for STT, one empty-string TTS) will be dispatched through the
|
|
20
|
-
* runtime's model router to whichever cloud voice provider is configured
|
|
21
|
-
* (e.g. ElevenLabs, Eliza Cloud TTS). These calls are billable if the
|
|
22
|
-
* provider charges per-request. They are intentionally small (~100 ms WAV for
|
|
23
|
-
* STT, empty string for TTS) and non-blocking (fire-and-forget). Failures are
|
|
24
|
-
* non-fatal and logged at WARN level.
|
|
25
|
-
*
|
|
26
|
-
* To suppress warmup entirely (both local and cloud) set:
|
|
27
|
-
* ELIZA_SKIP_LOCAL_VOICE_WARMUP=1
|
|
14
|
+
* Warmup fires for both local and cloud setups; for cloud providers this means
|
|
15
|
+
* two tiny billable API calls per desktop boot (a ~100 ms silent WAV for STT
|
|
16
|
+
* and an empty-string TTS), non-blocking and non-fatal. Suppress it entirely
|
|
17
|
+
* with ELIZA_SKIP_LOCAL_VOICE_WARMUP=1.
|
|
28
18
|
*/
|
|
29
19
|
/** Pure policy: should we warm voice models in the background? */
|
|
30
20
|
export function shouldWarmupVoice(gate) {
|
package/scripts/aosp/README.md
CHANGED
|
@@ -65,6 +65,15 @@ Each script accepts `--app-config <PATH>` to override
|
|
|
65
65
|
## Hardware requirements
|
|
66
66
|
|
|
67
67
|
- AOSP build: Linux x86_64, KVM, ≥30 GB RAM, ≥ 600 GB free disk.
|
|
68
|
-
- libllama compile: zig 0.13
|
|
68
|
+
- libllama compile: zig **0.13.x** on PATH (pinned series), cmake. The
|
|
69
|
+
`aarch64-linux-musl` / `x86_64-linux-musl` cross-link is pinned to the 0.13
|
|
70
|
+
series because zig 0.16's bundled `lld` SIGSEGVs that link and aborts the
|
|
71
|
+
fused/Android build with no actionable diagnostic. `compile-libllama.mjs` and
|
|
72
|
+
`compile-shim.mjs` fail loudly (via `assertZigPinForTargets`) if the detected
|
|
73
|
+
zig is outside 0.13.x; download the 0.13.x tarball from
|
|
74
|
+
<https://ziglang.org/download/> (the package-manager `zig` is frequently
|
|
75
|
+
0.16). Override only after independently verifying your lld links
|
|
76
|
+
aarch64-linux-musl: `ELIZA_ALLOW_UNPINNED_ZIG=1`. (The riscv64 RVV build path
|
|
77
|
+
is exempt — it needs zig 0.14+, gated by `MIN_ZIG_RVV_VERSION`.)
|
|
69
78
|
- Cuttlefish runtime: cuttlefish host package (`cvd`), `/dev/kvm`.
|
|
70
79
|
- Boot validation: `adb` on PATH or under `$ANDROID_HOME/platform-tools/`.
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import os from "node:os";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Compare two semver-ish version strings (zig follows MAJOR.MINOR.PATCH for
|
|
7
|
+
* stable releases; dev builds add `-dev.NNN+sha` which we strip).
|
|
8
|
+
* Returns negative when `a < b`, positive when `a > b`, zero on equal.
|
|
9
|
+
*/
|
|
10
|
+
export function compareSemver(a, b) {
|
|
11
|
+
const norm = (v) =>
|
|
12
|
+
String(v)
|
|
13
|
+
.replace(/^v/, "")
|
|
14
|
+
.split(/[-+]/)[0]
|
|
15
|
+
.split(".")
|
|
16
|
+
.map((n) => Number.parseInt(n, 10) || 0);
|
|
17
|
+
const aa = norm(a);
|
|
18
|
+
const bb = norm(b);
|
|
19
|
+
for (let i = 0; i < Math.max(aa.length, bb.length); i += 1) {
|
|
20
|
+
const x = aa[i] ?? 0;
|
|
21
|
+
const y = bb[i] ?? 0;
|
|
22
|
+
if (x !== y) return x - y;
|
|
23
|
+
}
|
|
24
|
+
return 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function resolveAndroidNdkHostDir(
|
|
28
|
+
prebuiltRoot,
|
|
29
|
+
{ platform = os.platform(), arch = os.arch(), entries } = {},
|
|
30
|
+
) {
|
|
31
|
+
const dirs =
|
|
32
|
+
entries ??
|
|
33
|
+
(fs.existsSync(prebuiltRoot) ? fs.readdirSync(prebuiltRoot) : []);
|
|
34
|
+
const hostDirs = dirs
|
|
35
|
+
.filter((d) => /^(linux|darwin|windows)-(x86_64|aarch64|arm64)$/.test(d))
|
|
36
|
+
.sort();
|
|
37
|
+
const hostPrefix =
|
|
38
|
+
platform === "win32"
|
|
39
|
+
? "windows"
|
|
40
|
+
: platform === "linux" || platform === "darwin"
|
|
41
|
+
? platform
|
|
42
|
+
: null;
|
|
43
|
+
if (!hostPrefix) return null;
|
|
44
|
+
|
|
45
|
+
const preferredArch =
|
|
46
|
+
arch === "x64" ? "x86_64" : arch === "arm64" ? "arm64" : arch;
|
|
47
|
+
const archCandidates =
|
|
48
|
+
preferredArch === "arm64"
|
|
49
|
+
? ["arm64", "aarch64", "x86_64"]
|
|
50
|
+
: [preferredArch, "x86_64"];
|
|
51
|
+
return (
|
|
52
|
+
archCandidates
|
|
53
|
+
.map((candidate) => `${hostPrefix}-${candidate}`)
|
|
54
|
+
.find((candidate) => hostDirs.includes(candidate)) ??
|
|
55
|
+
hostDirs.find((candidate) => candidate.startsWith(`${hostPrefix}-`)) ??
|
|
56
|
+
null
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function resolveHomebrewFormulaIncludeDirs(
|
|
61
|
+
formula,
|
|
62
|
+
prefixes = ["/opt/homebrew", "/usr/local"],
|
|
63
|
+
) {
|
|
64
|
+
const includeDirs = [];
|
|
65
|
+
for (const prefix of prefixes) {
|
|
66
|
+
includeDirs.push(path.join(prefix, "opt", formula, "include"));
|
|
67
|
+
const cellar = path.join(prefix, "Cellar", formula);
|
|
68
|
+
if (!fs.existsSync(cellar)) continue;
|
|
69
|
+
for (const version of fs.readdirSync(cellar).sort(compareSemver)) {
|
|
70
|
+
includeDirs.push(path.join(cellar, version, "include"));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return includeDirs;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function resolveDefaultAndroidAssetsDir({ root = process.cwd() } = {}) {
|
|
77
|
+
const appRelativeCandidates = [
|
|
78
|
+
path.join("packages", "app"),
|
|
79
|
+
path.join("apps", "app"),
|
|
80
|
+
path.join("eliza", "packages", "app"),
|
|
81
|
+
];
|
|
82
|
+
for (const appRelative of appRelativeCandidates) {
|
|
83
|
+
const appRoot = path.join(root, appRelative);
|
|
84
|
+
if (
|
|
85
|
+
fs.existsSync(path.join(appRoot, "android")) ||
|
|
86
|
+
fs.existsSync(path.join(appRoot, "package.json"))
|
|
87
|
+
) {
|
|
88
|
+
return path.join(
|
|
89
|
+
appRoot,
|
|
90
|
+
"android",
|
|
91
|
+
"app",
|
|
92
|
+
"src",
|
|
93
|
+
"main",
|
|
94
|
+
"assets",
|
|
95
|
+
"agent",
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return path.join(
|
|
100
|
+
root,
|
|
101
|
+
"packages",
|
|
102
|
+
"app",
|
|
103
|
+
"android",
|
|
104
|
+
"app",
|
|
105
|
+
"src",
|
|
106
|
+
"main",
|
|
107
|
+
"assets",
|
|
108
|
+
"agent",
|
|
109
|
+
);
|
|
110
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { describe, expect, it } from "bun:test";
|
|
2
|
+
import {
|
|
3
|
+
ABI_TARGETS,
|
|
4
|
+
ALLOW_UNPINNED_ZIG_ENV,
|
|
5
|
+
assertZigPinForTargets,
|
|
6
|
+
PINNED_ZIG_LINK_TRIPLES,
|
|
7
|
+
PINNED_ZIG_SERIES_FOR_MUSL_LINK,
|
|
8
|
+
zigSeries,
|
|
9
|
+
zigTriplesForAbis,
|
|
10
|
+
} from "./compile-libllama.mjs";
|
|
11
|
+
|
|
12
|
+
// Pins zig to the 0.13.x series for the aarch64/x86_64 `*-linux-musl` link.
|
|
13
|
+
// zig 0.16's bundled lld SIGSEGVs that link (a silent host-toolchain break);
|
|
14
|
+
// 0.13.x links it cleanly. The riscv64 RVV path is exempt (it needs 0.14+).
|
|
15
|
+
// See issue #9584.
|
|
16
|
+
describe("compile-libllama zig 0.13 pin", () => {
|
|
17
|
+
describe("zigSeries", () => {
|
|
18
|
+
it("extracts MAJOR.MINOR from stable versions", () => {
|
|
19
|
+
expect(zigSeries("0.13.0")).toBe("0.13");
|
|
20
|
+
expect(zigSeries("0.13.7")).toBe("0.13");
|
|
21
|
+
expect(zigSeries("0.16.0")).toBe("0.16");
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it("strips dev/build suffixes", () => {
|
|
25
|
+
expect(zigSeries("0.13.0-dev.46+abc123")).toBe("0.13");
|
|
26
|
+
expect(zigSeries("v0.13.0")).toBe("0.13");
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it("returns null for unparseable input", () => {
|
|
30
|
+
expect(zigSeries("not-a-version")).toBeNull();
|
|
31
|
+
// @ts-expect-error — exercising the non-string guard at the boundary.
|
|
32
|
+
expect(zigSeries(undefined)).toBeNull();
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
describe("pin constants", () => {
|
|
37
|
+
it("pins the 0.13 series", () => {
|
|
38
|
+
expect(PINNED_ZIG_SERIES_FOR_MUSL_LINK).toBe("0.13");
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it("covers the aarch64/x86_64 musl link triples but not riscv64", () => {
|
|
42
|
+
expect(PINNED_ZIG_LINK_TRIPLES).toContain("aarch64-linux-musl");
|
|
43
|
+
expect(PINNED_ZIG_LINK_TRIPLES).toContain("x86_64-linux-musl");
|
|
44
|
+
expect(PINNED_ZIG_LINK_TRIPLES).not.toContain("riscv64-linux-musl");
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
describe("zigTriplesForAbis", () => {
|
|
49
|
+
it("maps each Android ABI to its zig triple", () => {
|
|
50
|
+
expect(zigTriplesForAbis(["arm64-v8a"])).toEqual(["aarch64-linux-musl"]);
|
|
51
|
+
expect(zigTriplesForAbis(["arm64-v8a", "x86_64", "riscv64"])).toEqual([
|
|
52
|
+
"aarch64-linux-musl",
|
|
53
|
+
"x86_64-linux-musl",
|
|
54
|
+
"riscv64-linux-musl",
|
|
55
|
+
]);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it("dedupes repeated ABIs", () => {
|
|
59
|
+
expect(zigTriplesForAbis(["arm64-v8a", "arm64-v8a"])).toEqual([
|
|
60
|
+
"aarch64-linux-musl",
|
|
61
|
+
]);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it("stays in sync with ABI_TARGETS", () => {
|
|
65
|
+
const abis = ABI_TARGETS.map((t) => t.androidAbi);
|
|
66
|
+
expect(zigTriplesForAbis(abis)).toEqual(ABI_TARGETS.map((t) => t.zigTarget));
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it("throws on an unknown ABI rather than dropping it", () => {
|
|
70
|
+
expect(() => zigTriplesForAbis(["mips"])).toThrow(/unknown Android ABI/);
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
describe("assertZigPinForTargets", () => {
|
|
75
|
+
const arm = ["aarch64-linux-musl"];
|
|
76
|
+
const x86 = ["x86_64-linux-musl"];
|
|
77
|
+
const riscv = ["riscv64-linux-musl"];
|
|
78
|
+
|
|
79
|
+
it("accepts zig 0.13.x for the pinned musl link triples", () => {
|
|
80
|
+
expect(() =>
|
|
81
|
+
assertZigPinForTargets({ version: "0.13.0", zigTriples: arm, env: {} }),
|
|
82
|
+
).not.toThrow();
|
|
83
|
+
expect(() =>
|
|
84
|
+
assertZigPinForTargets({ version: "0.13.7", zigTriples: x86, env: {} }),
|
|
85
|
+
).not.toThrow();
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
it("rejects zig 0.16 (lld SIGSEGV) for the pinned link", () => {
|
|
89
|
+
expect(() =>
|
|
90
|
+
assertZigPinForTargets({ version: "0.16.0", zigTriples: arm, env: {} }),
|
|
91
|
+
).toThrow(/0\.13\.x/);
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
it("rejects zig 0.14 for the pinned link (series must match exactly)", () => {
|
|
95
|
+
expect(() =>
|
|
96
|
+
assertZigPinForTargets({ version: "0.14.0", zigTriples: arm, env: {} }),
|
|
97
|
+
).toThrow();
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
it("exempts a riscv64-only run (RVV path needs 0.14+)", () => {
|
|
101
|
+
expect(() =>
|
|
102
|
+
assertZigPinForTargets({ version: "0.16.0", zigTriples: riscv, env: {} }),
|
|
103
|
+
).not.toThrow();
|
|
104
|
+
expect(() =>
|
|
105
|
+
assertZigPinForTargets({ version: "0.14.0", zigTriples: riscv, env: {} }),
|
|
106
|
+
).not.toThrow();
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
it("still rejects when a pinned triple is mixed with riscv64", () => {
|
|
110
|
+
expect(() =>
|
|
111
|
+
assertZigPinForTargets({
|
|
112
|
+
version: "0.16.0",
|
|
113
|
+
zigTriples: [...arm, ...riscv],
|
|
114
|
+
env: {},
|
|
115
|
+
}),
|
|
116
|
+
).toThrow();
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
it("honors the explicit override env", () => {
|
|
120
|
+
expect(() =>
|
|
121
|
+
assertZigPinForTargets({
|
|
122
|
+
version: "0.16.0",
|
|
123
|
+
zigTriples: arm,
|
|
124
|
+
env: { [ALLOW_UNPINNED_ZIG_ENV]: "1" },
|
|
125
|
+
}),
|
|
126
|
+
).not.toThrow();
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
it("rejects a garbage version for the pinned link", () => {
|
|
130
|
+
expect(() =>
|
|
131
|
+
assertZigPinForTargets({ version: "weird", zigTriples: arm, env: {} }),
|
|
132
|
+
).toThrow();
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
it("error names the version, the lld SIGSEGV cause, and the override", () => {
|
|
136
|
+
let message = "";
|
|
137
|
+
try {
|
|
138
|
+
assertZigPinForTargets({ version: "0.16.0", zigTriples: arm, env: {} });
|
|
139
|
+
} catch (err) {
|
|
140
|
+
message = err instanceof Error ? err.message : String(err);
|
|
141
|
+
}
|
|
142
|
+
expect(message).toMatch(/0\.16\.0/);
|
|
143
|
+
expect(message).toMatch(/lld SIGSEGV/i);
|
|
144
|
+
expect(message).toContain(ALLOW_UNPINNED_ZIG_ENV);
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
});
|