@elizaos/app-core 2.0.3-beta.2 → 2.0.3-beta.3
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-zig-pin.test.mjs +147 -0
- package/scripts/aosp/compile-libllama.mjs +446 -59
- 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
|
@@ -226,6 +226,7 @@ struct PipelineSession {
|
|
|
226
226
|
// read them without re-parsing big JSON.
|
|
227
227
|
std::vector<std::vector<float>> turnEmbeddings;
|
|
228
228
|
std::vector<std::vector<int8_t>> turnLabels;
|
|
229
|
+
std::vector<std::vector<float>> turnPcms;
|
|
229
230
|
};
|
|
230
231
|
|
|
231
232
|
// Append `n` samples to a bounded pre-roll ring, dropping oldest beyond cap.
|
|
@@ -321,6 +322,7 @@ bool finalize_turn(PipelineSession* s, char** outError) {
|
|
|
321
322
|
: std::vector<float>{});
|
|
322
323
|
s->turnLabels.push_back(haveLabels ? std::move(labels)
|
|
323
324
|
: std::vector<int8_t>{});
|
|
325
|
+
s->turnPcms.push_back(std::move(s->turnPcm));
|
|
324
326
|
s->turnPcm.clear();
|
|
325
327
|
return true;
|
|
326
328
|
}
|
|
@@ -405,49 +407,60 @@ bool bionic_bool_env_or_default(const char* name, bool fallback) {
|
|
|
405
407
|
return fallback;
|
|
406
408
|
}
|
|
407
409
|
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
410
|
+
int bionic_int_env_or_default(const char* name, int fallback) {
|
|
411
|
+
const char* v = std::getenv(name);
|
|
412
|
+
if (!v || v[0] == '\0') return fallback;
|
|
413
|
+
int parsed = std::atoi(v);
|
|
414
|
+
return parsed > 0 ? parsed : fallback;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
// Arm the eliza-1 text-model bionic config for runtime optimizations that are
|
|
418
|
+
// correct for the shipped model.
|
|
411
419
|
//
|
|
412
|
-
// KV-quant
|
|
413
|
-
//
|
|
414
|
-
//
|
|
415
|
-
//
|
|
416
|
-
//
|
|
417
|
-
//
|
|
420
|
+
// KV-quant stays OFF by default. The shipped Eliza-1 tiers are Gemma 4, whose
|
|
421
|
+
// KV is already minimal by construction (MQA + windowed-SWA + shared-KV, dual
|
|
422
|
+
// head dims 512 global / 256 SWA) and runs on stock f16/q8_0 KV. The legacy
|
|
423
|
+
// QJL1_256 / fused QJL-TBQ kernels are head_dim=128 and dimensionally
|
|
424
|
+
// inapplicable to Gemma, so cache_type_k=qjl1_256/cache_type_v=tbq3_0 is not a
|
|
425
|
+
// shipping path; F16 KV is correct. ELIZA_BIONIC_KV_QUANT=1 is left as an
|
|
426
|
+
// explicit lab override for head_dim=128 test bundles only.
|
|
418
427
|
//
|
|
419
|
-
// MTP
|
|
420
|
-
//
|
|
421
|
-
//
|
|
422
|
-
//
|
|
423
|
-
// so the FFI's same-file MTP path falls back to the plain decode loop there —
|
|
424
|
-
// tier gating is the bootstrap's job (ELIZA_1_LOAD_METADATA); this is the
|
|
425
|
-
// native override seam.
|
|
428
|
+
// MTP is enabled only when the caller supplies a Gemma separate-drafter GGUF.
|
|
429
|
+
// Omitting cfg.mtp_drafter_path would select the retired same-file NextN path,
|
|
430
|
+
// so shipped Gemma bundles without a staged drafter run plain decode even if
|
|
431
|
+
// ELIZA_BIONIC_MTP is set in the app process.
|
|
426
432
|
//
|
|
427
433
|
// The two static names below outlive the cfg they're attached to (cfg is a
|
|
428
434
|
// stack struct consumed synchronously by eliza_inference_llm_stream_open).
|
|
429
|
-
void arm_bionic_text_cfg(eliza_llm_stream_config_t& cfg
|
|
435
|
+
void arm_bionic_text_cfg(eliza_llm_stream_config_t& cfg,
|
|
436
|
+
const char* bundle_dir = nullptr) {
|
|
430
437
|
static const char* kKvTypeK = "qjl1_256";
|
|
431
438
|
static const char* kKvTypeV = "tbq3_0";
|
|
432
|
-
if (bionic_bool_env_or_default("ELIZA_BIONIC_KV_QUANT",
|
|
439
|
+
if (bionic_bool_env_or_default("ELIZA_BIONIC_KV_QUANT", false)) {
|
|
433
440
|
cfg.cache_type_k = kKvTypeK;
|
|
434
441
|
cfg.cache_type_v = kKvTypeV;
|
|
435
|
-
LOGI("bionic text cfg: KV-quant ON (k=%s v=%s)",
|
|
442
|
+
LOGI("bionic text cfg: KV-quant ON by explicit override (k=%s v=%s)",
|
|
443
|
+
kKvTypeK, kKvTypeV);
|
|
436
444
|
} else {
|
|
437
|
-
LOGI("bionic text cfg: KV-quant OFF (f16
|
|
445
|
+
LOGI("bionic text cfg: KV-quant OFF (stock f16/q8_0 KV; Gemma 4 KV is "
|
|
446
|
+
"already minimal)");
|
|
438
447
|
}
|
|
439
448
|
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
int
|
|
449
|
+
(void)bundle_dir;
|
|
450
|
+
const bool has_drafter =
|
|
451
|
+
cfg.mtp_drafter_path && cfg.mtp_drafter_path[0] != '\0';
|
|
452
|
+
if (has_drafter && bionic_bool_env_or_default("ELIZA_BIONIC_MTP", true)) {
|
|
453
|
+
int draft_min = bionic_int_env_or_default("ELIZA_BIONIC_MTP_DRAFT_MIN", 1);
|
|
454
|
+
int draft_max = bionic_int_env_or_default("ELIZA_BIONIC_MTP_DRAFT_MAX", 1);
|
|
445
455
|
if (draft_min < 1) draft_min = 1;
|
|
446
456
|
if (draft_max < draft_min) draft_max = draft_min;
|
|
447
457
|
cfg.draft_min = draft_min;
|
|
448
458
|
cfg.draft_max = draft_max;
|
|
449
|
-
LOGI("bionic text cfg: MTP ON (draft_min=%d draft_max=%d,
|
|
450
|
-
draft_min, draft_max);
|
|
459
|
+
LOGI("bionic text cfg: MTP ON (draft_min=%d draft_max=%d, drafter=%s)",
|
|
460
|
+
draft_min, draft_max, cfg.mtp_drafter_path);
|
|
461
|
+
} else {
|
|
462
|
+
LOGI("bionic text cfg: MTP OFF (%s)",
|
|
463
|
+
has_drafter ? "disabled by ELIZA_BIONIC_MTP" : "no drafter");
|
|
451
464
|
}
|
|
452
465
|
}
|
|
453
466
|
|
|
@@ -797,6 +810,7 @@ Java_ai_elizaos_app_ElizaVoiceNative_nativePipelineProcess(JNIEnv* env, jclass,
|
|
|
797
810
|
s->turns.clear();
|
|
798
811
|
s->turnEmbeddings.clear();
|
|
799
812
|
s->turnLabels.clear();
|
|
813
|
+
s->turnPcms.clear();
|
|
800
814
|
|
|
801
815
|
const std::vector<float> pcm = read_float_array(env, jPcm);
|
|
802
816
|
s->pending.insert(s->pending.end(), pcm.begin(), pcm.end());
|
|
@@ -825,6 +839,7 @@ Java_ai_elizaos_app_ElizaVoiceNative_nativePipelineFlush(JNIEnv* env, jclass,
|
|
|
825
839
|
s->turns.clear();
|
|
826
840
|
s->turnEmbeddings.clear();
|
|
827
841
|
s->turnLabels.clear();
|
|
842
|
+
s->turnPcms.clear();
|
|
828
843
|
if (s->seg.forceEnd()) {
|
|
829
844
|
s->capturing = false;
|
|
830
845
|
char* outError = nullptr;
|
|
@@ -880,6 +895,26 @@ Java_ai_elizaos_app_ElizaVoiceNative_nativePipelineTurnLabels(JNIEnv* env,
|
|
|
880
895
|
return out;
|
|
881
896
|
}
|
|
882
897
|
|
|
898
|
+
// Read the segmented turn PCM for the i-th turn. Empty array when unavailable.
|
|
899
|
+
JNIEXPORT jfloatArray JNICALL
|
|
900
|
+
Java_ai_elizaos_app_ElizaVoiceNative_nativePipelineTurnPcm(JNIEnv* env,
|
|
901
|
+
jclass,
|
|
902
|
+
jlong handle,
|
|
903
|
+
jint index) {
|
|
904
|
+
auto* s = reinterpret_cast<PipelineSession*>(handle);
|
|
905
|
+
if (!s || index < 0 ||
|
|
906
|
+
static_cast<size_t>(index) >= s->turnPcms.size()) {
|
|
907
|
+
return env->NewFloatArray(0);
|
|
908
|
+
}
|
|
909
|
+
const auto& pcm = s->turnPcms[static_cast<size_t>(index)];
|
|
910
|
+
jfloatArray out = env->NewFloatArray(static_cast<jsize>(pcm.size()));
|
|
911
|
+
if (out && !pcm.empty()) {
|
|
912
|
+
env->SetFloatArrayRegion(out, 0, static_cast<jsize>(pcm.size()),
|
|
913
|
+
pcm.data());
|
|
914
|
+
}
|
|
915
|
+
return out;
|
|
916
|
+
}
|
|
917
|
+
|
|
883
918
|
JNIEXPORT void JNICALL
|
|
884
919
|
Java_ai_elizaos_app_ElizaVoiceNative_nativePipelineReset(JNIEnv*, jclass,
|
|
885
920
|
jlong handle) {
|
|
@@ -888,6 +923,7 @@ Java_ai_elizaos_app_ElizaVoiceNative_nativePipelineReset(JNIEnv*, jclass,
|
|
|
888
923
|
s->seg.reset();
|
|
889
924
|
s->pending.clear();
|
|
890
925
|
s->turnPcm.clear();
|
|
926
|
+
s->turnPcms.clear();
|
|
891
927
|
s->preRoll.clear();
|
|
892
928
|
s->capturing = false;
|
|
893
929
|
char* outError = nullptr;
|
|
@@ -1222,16 +1258,14 @@ Java_ai_elizaos_app_ElizaVoiceNative_nativeLlmStreamOpen(
|
|
|
1222
1258
|
cfg.repeat_penalty = 1.0f;
|
|
1223
1259
|
cfg.n_gpu_layers = nGpuLayers;
|
|
1224
1260
|
cfg.mtp_drafter_path = drafter.empty() ? nullptr : drafter.c_str();
|
|
1225
|
-
// Arm
|
|
1226
|
-
//
|
|
1227
|
-
// draft window — only arm the same-file MTP env override when no drafter
|
|
1228
|
-
// was passed.
|
|
1261
|
+
// Arm safe runtime optimizations: stock f16/q8_0 KV for the shipped Gemma 4
|
|
1262
|
+
// tiers, and separate-drafter MTP only when the caller passes a drafter.
|
|
1229
1263
|
arm_bionic_text_cfg(cfg);
|
|
1230
1264
|
if (!drafter.empty() && cfg.draft_min <= 0) {
|
|
1231
1265
|
// Separate drafter supplied but env left the window 0; give it the
|
|
1232
1266
|
// single-head default so the drafter actually drives speculation.
|
|
1233
1267
|
cfg.draft_min = 1;
|
|
1234
|
-
cfg.draft_max =
|
|
1268
|
+
cfg.draft_max = 1;
|
|
1235
1269
|
}
|
|
1236
1270
|
char* outError = nullptr;
|
|
1237
1271
|
EliLlmStream* s = eliza_inference_llm_stream_open(ctx, &cfg, &outError);
|
|
@@ -1321,6 +1355,18 @@ Java_ai_elizaos_app_ElizaVoiceNative_nativeLlmStreamReset(JNIEnv*, jclass,
|
|
|
1321
1355
|
return static_cast<jint>(rc == ELIZA_OK ? 1 : 0);
|
|
1322
1356
|
}
|
|
1323
1357
|
|
|
1358
|
+
// Prefix-preserving reset: keep the first nKeep tokens of KV resident, drop the
|
|
1359
|
+
// rest. Returns the n_keep actually applied (>= 0), or a negative ELIZA_* on a
|
|
1360
|
+
// NULL / MTP / unopened stream (caller falls back to a full reset + prefill).
|
|
1361
|
+
JNIEXPORT jint JNICALL
|
|
1362
|
+
Java_ai_elizaos_app_ElizaVoiceNative_nativeLlmStreamResetKeep(JNIEnv*, jclass,
|
|
1363
|
+
jlong streamHandle,
|
|
1364
|
+
jint nKeep) {
|
|
1365
|
+
const int rc = eliza_inference_llm_stream_reset_keep(
|
|
1366
|
+
reinterpret_cast<EliLlmStream*>(streamHandle), static_cast<int32_t>(nKeep));
|
|
1367
|
+
return static_cast<jint>(rc);
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1324
1370
|
// ── LLM self-test (one native call: ctx→tokenize→stream→generate) ─────────
|
|
1325
1371
|
//
|
|
1326
1372
|
// THE KEYSTONE PROOF: runs a whole greedy text generation in ONE native call,
|
|
@@ -1358,9 +1404,9 @@ Java_ai_elizaos_app_ElizaVoiceNative_nativeLlmSelfTest(JNIEnv* env, jclass,
|
|
|
1358
1404
|
cfg.top_p = 1.0f;
|
|
1359
1405
|
cfg.repeat_penalty = 1.0f;
|
|
1360
1406
|
cfg.n_gpu_layers = -1; // all-GPU when the vulkan lib is staged
|
|
1361
|
-
// Arm
|
|
1362
|
-
//
|
|
1363
|
-
arm_bionic_text_cfg(cfg);
|
|
1407
|
+
// Arm safe runtime optimizations (stock f16/q8_0 KV for shipped Gemma 4
|
|
1408
|
+
// tiers; no MTP here because nativeLlmSelfTest has no drafter argument).
|
|
1409
|
+
arm_bionic_text_cfg(cfg, bundleDir.c_str());
|
|
1364
1410
|
EliLlmStream* s = eliza_inference_llm_stream_open(ctx, &cfg, &outError);
|
|
1365
1411
|
if (!s) {
|
|
1366
1412
|
if (tok) eliza_inference_free_tokens(tok);
|
|
@@ -1482,4 +1528,102 @@ Java_ai_elizaos_app_ElizaVoiceNative_nativeKokoroSynthesize(JNIEnv* env, jclass,
|
|
|
1482
1528
|
return out;
|
|
1483
1529
|
}
|
|
1484
1530
|
|
|
1531
|
+
// ── Batch ASR (synchronous, VAD-free) ────────────────────────────────────
|
|
1532
|
+
//
|
|
1533
|
+
// The streaming pipeline (nativePipelineProcess) is VAD-gated and needs the
|
|
1534
|
+
// VAD/diariz/speaker GGUFs staged; this is the DIRECT audio-in/text-out
|
|
1535
|
+
// transcribe the fused lib exposes (eliza_inference_asr_transcribe), which
|
|
1536
|
+
// only mmap-acquires the `asr/` weights on the resident context. The bionic
|
|
1537
|
+
// host's op="asr" calls this so the agent's TRANSCRIPTION delegate gets a
|
|
1538
|
+
// real on-device transcript without the full attribution pipeline.
|
|
1539
|
+
JNIEXPORT jstring JNICALL
|
|
1540
|
+
Java_ai_elizaos_app_ElizaVoiceNative_nativeAsrTranscribe(JNIEnv* env, jclass,
|
|
1541
|
+
jlong ctxHandle,
|
|
1542
|
+
jfloatArray jPcm,
|
|
1543
|
+
jint sampleRate) {
|
|
1544
|
+
auto* ctx = reinterpret_cast<EliInferenceContext*>(ctxHandle);
|
|
1545
|
+
if (!ctx) {
|
|
1546
|
+
throw_runtime(env, "asrTranscribe: null context", nullptr);
|
|
1547
|
+
return nullptr;
|
|
1548
|
+
}
|
|
1549
|
+
const jsize n = env->GetArrayLength(jPcm);
|
|
1550
|
+
jfloat* pcm = env->GetFloatArrayElements(jPcm, nullptr);
|
|
1551
|
+
if (!pcm) {
|
|
1552
|
+
throw_runtime(env, "asrTranscribe: null PCM", nullptr);
|
|
1553
|
+
return nullptr;
|
|
1554
|
+
}
|
|
1555
|
+
// The ASR weights are a voice-only mmap region that must be armed before
|
|
1556
|
+
// transcribe (VoiceLifecycle normally does this on voice-on). The agent's
|
|
1557
|
+
// one-shot transcribe path has no lifecycle, so arm it here (idempotent if
|
|
1558
|
+
// already acquired).
|
|
1559
|
+
char* acqErr = nullptr;
|
|
1560
|
+
if (eliza_inference_mmap_acquire(ctx, "asr", &acqErr) != 0) {
|
|
1561
|
+
env->ReleaseFloatArrayElements(jPcm, pcm, JNI_ABORT);
|
|
1562
|
+
throw_runtime(env, "asr mmap_acquire", acqErr);
|
|
1563
|
+
return nullptr;
|
|
1564
|
+
}
|
|
1565
|
+
// 64 KiB transcript cap — far longer than any single utterance.
|
|
1566
|
+
std::vector<char> out(65536, 0);
|
|
1567
|
+
char* err = nullptr;
|
|
1568
|
+
const int rc = eliza_inference_asr_transcribe(
|
|
1569
|
+
ctx, reinterpret_cast<const float*>(pcm), static_cast<size_t>(n),
|
|
1570
|
+
sampleRate > 0 ? sampleRate : kSampleRate, out.data(), out.size(),
|
|
1571
|
+
&err);
|
|
1572
|
+
env->ReleaseFloatArrayElements(jPcm, pcm, JNI_ABORT);
|
|
1573
|
+
if (rc < 0) {
|
|
1574
|
+
throw_runtime(env, "asr_transcribe", err);
|
|
1575
|
+
return nullptr;
|
|
1576
|
+
}
|
|
1577
|
+
LOGI("nativeAsrTranscribe: %d samples @ %d Hz -> %d transcript bytes",
|
|
1578
|
+
(int)n, (int)sampleRate, rc);
|
|
1579
|
+
return to_jstring(env, std::string(out.data()));
|
|
1580
|
+
}
|
|
1581
|
+
|
|
1582
|
+
// ── mmproj vision (ABI v9) ───────────────────────────────────────────────
|
|
1583
|
+
JNIEXPORT jint JNICALL
|
|
1584
|
+
Java_ai_elizaos_app_ElizaVoiceNative_nativeVisionSupported(JNIEnv*, jclass) {
|
|
1585
|
+
return static_cast<jint>(eliza_inference_vision_supported());
|
|
1586
|
+
}
|
|
1587
|
+
|
|
1588
|
+
// Describe a raw PNG/JPEG/WebP image with the resident TEXT model + an mmproj
|
|
1589
|
+
// projector (eliza_inference_describe_image). The bionic host's op="image"
|
|
1590
|
+
// calls this so the agent's IMAGE_DESCRIPTION delegate runs screen/vision
|
|
1591
|
+
// recognition fully on-device.
|
|
1592
|
+
JNIEXPORT jstring JNICALL
|
|
1593
|
+
Java_ai_elizaos_app_ElizaVoiceNative_nativeDescribeImage(JNIEnv* env, jclass,
|
|
1594
|
+
jlong ctxHandle,
|
|
1595
|
+
jbyteArray jImage,
|
|
1596
|
+
jstring jMmproj,
|
|
1597
|
+
jstring jPrompt) {
|
|
1598
|
+
auto* ctx = reinterpret_cast<EliInferenceContext*>(ctxHandle);
|
|
1599
|
+
if (!ctx) {
|
|
1600
|
+
throw_runtime(env, "describeImage: null context", nullptr);
|
|
1601
|
+
return nullptr;
|
|
1602
|
+
}
|
|
1603
|
+
const std::string mmproj = from_jstring(env, jMmproj);
|
|
1604
|
+
const std::string prompt = from_jstring(env, jPrompt);
|
|
1605
|
+
const jsize n = env->GetArrayLength(jImage);
|
|
1606
|
+
jbyte* img = env->GetByteArrayElements(jImage, nullptr);
|
|
1607
|
+
if (!img) {
|
|
1608
|
+
throw_runtime(env, "describeImage: null image bytes", nullptr);
|
|
1609
|
+
return nullptr;
|
|
1610
|
+
}
|
|
1611
|
+
std::vector<char> out(16384, 0);
|
|
1612
|
+
char* err = nullptr;
|
|
1613
|
+
const int rc = eliza_inference_describe_image(
|
|
1614
|
+
ctx, reinterpret_cast<const unsigned char*>(img),
|
|
1615
|
+
static_cast<size_t>(n),
|
|
1616
|
+
mmproj.empty() ? nullptr : mmproj.c_str(),
|
|
1617
|
+
prompt.empty() ? nullptr : prompt.c_str(), out.data(), out.size(),
|
|
1618
|
+
&err);
|
|
1619
|
+
env->ReleaseByteArrayElements(jImage, img, JNI_ABORT);
|
|
1620
|
+
if (rc < 0) {
|
|
1621
|
+
throw_runtime(env, "describe_image", err);
|
|
1622
|
+
return nullptr;
|
|
1623
|
+
}
|
|
1624
|
+
LOGI("nativeDescribeImage: %d image bytes -> %d description bytes", (int)n,
|
|
1625
|
+
rc);
|
|
1626
|
+
return to_jstring(env, std::string(out.data()));
|
|
1627
|
+
}
|
|
1628
|
+
|
|
1485
1629
|
} // extern "C"
|
|
@@ -1115,7 +1115,56 @@ public class ElizaAgentService extends Service {
|
|
|
1115
1115
|
|
|
1116
1116
|
// ── Process lifecycle ────────────────────────────────────────────────
|
|
1117
1117
|
|
|
1118
|
+
/**
|
|
1119
|
+
* Start the in-process bionic inference host whenever the fused native lib
|
|
1120
|
+
* AND a local voice bundle (kokoro) are present — independent of the LLM
|
|
1121
|
+
* runtime mode and of whether the agent process spawns fresh or adopts a
|
|
1122
|
+
* surviving one.
|
|
1123
|
+
*
|
|
1124
|
+
* <p>Previously the host was started ONLY inside {@link #startAgentProcess()}'s
|
|
1125
|
+
* fresh-spawn {@code delegateToBionicHost} block, so after a process restart
|
|
1126
|
+
* that adopts a surviving agent (or when the agent runs cloud-routed) the
|
|
1127
|
+
* host never bound its abstract UDS, and {@code TalkMode}'s local Kokoro TTS
|
|
1128
|
+
* silently fell back to the system (Google) TTS. The voice host serves Kokoro
|
|
1129
|
+
* from {@code libelizainference} + the staged bundle and needs no LLM, so its
|
|
1130
|
+
* lifecycle is decoupled from agent inference here.
|
|
1131
|
+
*
|
|
1132
|
+
* <p>{@link ElizaBionicInferenceServer#start()} is idempotent and never throws
|
|
1133
|
+
* (it logs + returns on lib-load / socket-bind failure), so this is purely
|
|
1134
|
+
* additive: worst case the host stays down and TalkMode falls back to system
|
|
1135
|
+
* TTS exactly as before — it cannot affect agent startup.
|
|
1136
|
+
*/
|
|
1137
|
+
private synchronized void ensureBionicVoiceHost() {
|
|
1138
|
+
if (bionicInferenceServer != null) {
|
|
1139
|
+
return;
|
|
1140
|
+
}
|
|
1141
|
+
File fusedLib = new File(nativeLibraryDir(), "libelizainference.so");
|
|
1142
|
+
if (!fusedLib.isFile()) {
|
|
1143
|
+
return;
|
|
1144
|
+
}
|
|
1145
|
+
File kokoroVoice = new File(getFilesDir(), "eliza-1/bundle/tts/kokoro");
|
|
1146
|
+
if (!kokoroVoice.isDirectory()) {
|
|
1147
|
+
return;
|
|
1148
|
+
}
|
|
1149
|
+
try {
|
|
1150
|
+
String defaultBundleDir =
|
|
1151
|
+
new File(getFilesDir(), "eliza-1/bundle").getAbsolutePath();
|
|
1152
|
+
ElizaBionicInferenceServer host =
|
|
1153
|
+
new ElizaBionicInferenceServer(BIONIC_INFERENCE_SOCKET_NAME, defaultBundleDir);
|
|
1154
|
+
host.start();
|
|
1155
|
+
bionicInferenceServer = host;
|
|
1156
|
+
Log.i(TAG, "ensureBionicVoiceHost: local voice host started"
|
|
1157
|
+
+ " (kokoro bundle present, independent of LLM mode)");
|
|
1158
|
+
} catch (Throwable t) {
|
|
1159
|
+
Log.w(TAG, "ensureBionicVoiceHost: could not start local voice host", t);
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1118
1163
|
private void requestAgentStart(boolean restartFirst) {
|
|
1164
|
+
// Bring up the local-voice (Kokoro TTS) bionic host on every service
|
|
1165
|
+
// start, before the agent-already-running guards below — so it binds
|
|
1166
|
+
// even when the agent is adopted rather than freshly spawned.
|
|
1167
|
+
ensureBionicVoiceHost();
|
|
1119
1168
|
synchronized (processLock) {
|
|
1120
1169
|
if (!restartFirst && agentProcess != null && agentProcess.isAlive()) {
|
|
1121
1170
|
return;
|
|
@@ -1393,10 +1442,11 @@ public class ElizaAgentService extends Service {
|
|
|
1393
1442
|
// (tryBuildAospFusedTextLoader) and aosp-llama-paths.ts
|
|
1394
1443
|
// (isAospEnabled reads ELIZA_LOCAL_LLAMA).
|
|
1395
1444
|
// This is required, not optional: the eliza-1 model tiers are
|
|
1396
|
-
//
|
|
1397
|
-
//
|
|
1398
|
-
//
|
|
1399
|
-
//
|
|
1445
|
+
// Gemma-4-arch GGUFs (TurboQuant-quantized; stock f16/q8_0 KV — the
|
|
1446
|
+
// legacy QJL/PolarQuant/TBQ KV kernels are retired post-#9033), and
|
|
1447
|
+
// the stock llama-cpp-capacitor JNI lib cannot load those GGUFs at
|
|
1448
|
+
// all (`context->loadModel() returned false`). The fused
|
|
1449
|
+
// libelizainference.so carries the kernels + Gemma arch and is
|
|
1400
1450
|
// the SOLE text/voice native library the bun agent loads.
|
|
1401
1451
|
//
|
|
1402
1452
|
// This was previously gated on `BuildConfig.AOSP_BUILD &&
|
|
@@ -1417,7 +1467,6 @@ public class ElizaAgentService extends Service {
|
|
|
1417
1467
|
File abiFusedInference = new File(abiDir, "libelizainference.so");
|
|
1418
1468
|
File abiLibllama = new File(abiDir, "libllama.so");
|
|
1419
1469
|
File abiLlamaShim = new File(abiDir, "libeliza-llama-shim.so");
|
|
1420
|
-
File abiSpeculativeShim = new File(abiDir, "libeliza-llama-speculative-shim.so");
|
|
1421
1470
|
File abiGgmlVulkan = new File(abiDir, "libggml-vulkan.so");
|
|
1422
1471
|
boolean fusedInferenceBundled = abiFusedInference.isFile();
|
|
1423
1472
|
boolean legacyLibllamaBundled = abiLibllama.isFile() && abiLlamaShim.isFile();
|
|
@@ -1501,33 +1550,12 @@ public class ElizaAgentService extends Service {
|
|
|
1501
1550
|
// cache priming.
|
|
1502
1551
|
agentEnv.put("ELIZA_KOKORO_PREWARM_DELAY_MS", "60000");
|
|
1503
1552
|
}
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
// drafter GGUFs, and the adapter falls back to MTP when
|
|
1511
|
-
// the target model lacks NextN/MTP tensors.
|
|
1512
|
-
agentEnv.put("ELIZA_SPEC_TYPE", "mtp");
|
|
1513
|
-
Log.i(TAG, "agent/" + abiDir.getName()
|
|
1514
|
-
+ "/libeliza-llama-speculative-shim.so present; preferring MTP speculative decode with MTP fallback");
|
|
1515
|
-
}
|
|
1516
|
-
if (abiSpeculativeShim.isFile() && brandedAospBuild && !env.containsKey("ELIZA_MTP")) {
|
|
1517
|
-
agentEnv.put("ELIZA_MTP", "1");
|
|
1518
|
-
Log.i(TAG, "agent/" + abiDir.getName()
|
|
1519
|
-
+ "/libeliza-llama-speculative-shim.so present on branded AOSP build; enabling in-process MTP (ELIZA_MTP=1)");
|
|
1520
|
-
} else if (abiSpeculativeShim.isFile() && !brandedAospBuild) {
|
|
1521
|
-
// Ship the speculative shim in stock APKs so explicit
|
|
1522
|
-
// ELIZA_MTP diagnostics still work, but do not make
|
|
1523
|
-
// MTP the default merely because the .so is present.
|
|
1524
|
-
// Pixel APK validation showed the current 2B drafter path
|
|
1525
|
-
// is functional but slower than target-only decode for
|
|
1526
|
-
// short chat turns, so stock Android stays target-only
|
|
1527
|
-
// until benchmark gating or a faster drafter path lands.
|
|
1528
|
-
Log.i(TAG, "agent/" + abiDir.getName()
|
|
1529
|
-
+ "/libeliza-llama-speculative-shim.so present; leaving MTP opt-in for stock APK");
|
|
1530
|
-
}
|
|
1553
|
+
// MTP (multi-token / speculative decode) is compiled into the
|
|
1554
|
+
// single fused libelizainference.so (the eliza_mtp::Engine over
|
|
1555
|
+
// common/speculative.cpp, exported as eliza_inference_llm_mtp_supported).
|
|
1556
|
+
// It is controlled in-process by ELIZA_BIONIC_MTP and the FFI
|
|
1557
|
+
// capability probe — NOT by a separate speculative-shim .so (that
|
|
1558
|
+
// shim is retired and never staged). No env wiring needed here.
|
|
1531
1559
|
if (BuildConfig.DEBUG && !env.containsKey("ELIZA_AOSP_LLAMA_DEBUG_LOG")) {
|
|
1532
1560
|
File debugLog = new File(agentStateDir(), "aosp-llama-debug.log");
|
|
1533
1561
|
agentEnv.put("ELIZA_AOSP_LLAMA_DEBUG_LOG", debugLog.getAbsolutePath());
|