@elizaos/app-core 2.0.0-alpha.85 → 2.0.0-beta.2
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/account-pool.d.ts +6 -0
- package/account-pool.d.ts.map +1 -0
- package/account-pool.js +5 -0
- package/api/__tests__/sandbox-test-helpers.d.ts +10 -0
- package/api/__tests__/sandbox-test-helpers.d.ts.map +1 -0
- package/api/__tests__/sandbox-test-helpers.js +15 -0
- package/api/auth/audit.d.ts +52 -0
- package/api/auth/audit.d.ts.map +1 -0
- package/api/auth/audit.js +126 -0
- package/api/auth/auth-context.d.ts +40 -0
- package/api/auth/auth-context.d.ts.map +1 -0
- package/api/auth/auth-context.js +68 -0
- package/api/auth/bootstrap-token.d.ts +50 -0
- package/api/auth/bootstrap-token.d.ts.map +1 -0
- package/api/auth/bootstrap-token.js +157 -0
- package/api/auth/index.d.ts +14 -0
- package/api/auth/index.d.ts.map +1 -0
- package/api/auth/index.js +13 -0
- package/api/auth/passwords.d.ts +65 -0
- package/api/auth/passwords.d.ts.map +1 -0
- package/api/auth/passwords.js +87 -0
- package/api/auth/sensitive-rate-limit.d.ts +56 -0
- package/api/auth/sensitive-rate-limit.d.ts.map +1 -0
- package/api/auth/sensitive-rate-limit.js +95 -0
- package/api/auth/sessions.d.ts +152 -0
- package/api/auth/sessions.d.ts.map +1 -0
- package/api/auth/sessions.js +298 -0
- package/api/auth/tokens.d.ts +3 -0
- package/api/auth/tokens.d.ts.map +1 -0
- package/api/auth/tokens.js +13 -0
- package/api/auth-bootstrap-routes.d.ts +32 -0
- package/api/auth-bootstrap-routes.d.ts.map +1 -0
- package/api/auth-bootstrap-routes.js +179 -0
- package/api/auth-pairing-compat-routes.d.ts +17 -0
- package/api/auth-pairing-compat-routes.d.ts.map +1 -0
- package/api/auth-pairing-compat-routes.js +301 -0
- package/api/auth-session-routes.d.ts +31 -0
- package/api/auth-session-routes.d.ts.map +1 -0
- package/api/auth-session-routes.js +560 -0
- package/api/auth.d.ts +153 -0
- package/api/auth.d.ts.map +1 -0
- package/api/auth.js +290 -0
- package/api/automation-node-contributors.d.ts +14 -0
- package/api/automation-node-contributors.d.ts.map +1 -0
- package/api/automation-node-contributors.js +14 -0
- package/api/automations-compat-routes.d.ts +18 -0
- package/api/automations-compat-routes.d.ts.map +1 -0
- package/api/automations-compat-routes.js +274 -0
- package/api/catalog-routes.d.ts +4 -0
- package/api/catalog-routes.d.ts.map +1 -0
- package/api/catalog-routes.js +61 -0
- package/api/compat-route-shared.d.ts +29 -0
- package/api/compat-route-shared.d.ts.map +1 -0
- package/api/compat-route-shared.js +298 -0
- package/api/credential-resolver.d.ts +31 -0
- package/api/credential-resolver.d.ts.map +1 -0
- package/api/credential-resolver.js +199 -0
- package/api/database-rows-compat-routes.d.ts +4 -0
- package/api/database-rows-compat-routes.d.ts.map +1 -0
- package/api/database-rows-compat-routes.js +100 -0
- package/api/dev-compat-routes.d.ts +11 -0
- package/api/dev-compat-routes.d.ts.map +1 -0
- package/api/dev-compat-routes.js +144 -0
- package/api/dev-console-log.d.ts +21 -0
- package/api/dev-console-log.d.ts.map +1 -0
- package/api/dev-console-log.js +65 -0
- package/api/dev-stack.d.ts +49 -0
- package/api/dev-stack.d.ts.map +1 -0
- package/api/dev-stack.js +60 -0
- package/api/local-inference-compat-routes.d.ts +16 -0
- package/api/local-inference-compat-routes.d.ts.map +1 -0
- package/api/local-inference-compat-routes.js +617 -0
- package/api/onboarding-compat-routes.d.ts +4 -0
- package/api/onboarding-compat-routes.d.ts.map +1 -0
- package/api/onboarding-compat-routes.js +207 -0
- package/api/plugins-compat-routes.d.ts +103 -0
- package/api/plugins-compat-routes.d.ts.map +1 -0
- package/api/plugins-compat-routes.js +1181 -0
- package/api/response.d.ts +4 -0
- package/api/response.d.ts.map +1 -0
- package/api/response.js +28 -0
- package/api/runtime-mode-routes.d.ts +13 -0
- package/api/runtime-mode-routes.d.ts.map +1 -0
- package/api/runtime-mode-routes.js +32 -0
- package/api/secrets-inventory-routes.d.ts +39 -0
- package/api/secrets-inventory-routes.d.ts.map +1 -0
- package/api/secrets-inventory-routes.js +487 -0
- package/api/secrets-manager-routes.d.ts +9 -0
- package/api/secrets-manager-routes.d.ts.map +1 -0
- package/api/secrets-manager-routes.js +476 -0
- package/api/sensitive-request-routes.d.ts +20 -0
- package/api/sensitive-request-routes.d.ts.map +1 -0
- package/api/sensitive-request-routes.js +489 -0
- package/api/sensitive-request-store.d.ts +39 -0
- package/api/sensitive-request-store.d.ts.map +1 -0
- package/api/sensitive-request-store.js +204 -0
- package/api/server-config-filter.d.ts +14 -0
- package/api/server-config-filter.d.ts.map +1 -0
- package/api/server-config-filter.js +77 -0
- package/api/server-cors.d.ts +30 -0
- package/api/server-cors.d.ts.map +1 -0
- package/api/server-cors.js +128 -0
- package/api/server-html.d.ts +4 -0
- package/api/server-html.d.ts.map +1 -0
- package/api/server-html.js +5 -0
- package/api/server-onboarding-compat.d.ts +31 -0
- package/api/server-onboarding-compat.d.ts.map +1 -0
- package/api/server-onboarding-compat.js +283 -0
- package/api/server-security.d.ts +11 -0
- package/api/server-security.d.ts.map +1 -0
- package/api/server-security.js +29 -0
- package/api/server-startup.d.ts +5 -0
- package/api/server-startup.d.ts.map +1 -0
- package/api/server-startup.js +74 -0
- package/api/server-wallet-trade.d.ts +10 -0
- package/api/server-wallet-trade.d.ts.map +1 -0
- package/api/server-wallet-trade.js +240 -0
- package/api/server.d.ts +32 -0
- package/api/server.d.ts.map +1 -0
- package/api/server.js +768 -0
- package/api/workbench-compat-routes.d.ts +11 -0
- package/api/workbench-compat-routes.d.ts.map +1 -0
- package/api/workbench-compat-routes.js +325 -0
- package/benchmark/cua-routes.d.ts +10 -0
- package/benchmark/cua-routes.d.ts.map +1 -0
- package/benchmark/cua-routes.js +179 -0
- package/benchmark/lifeops-bench-handler.d.ts +94 -0
- package/benchmark/lifeops-bench-handler.d.ts.map +1 -0
- package/benchmark/lifeops-bench-handler.js +280 -0
- package/benchmark/lifeops-fake-backend.d.ts +227 -0
- package/benchmark/lifeops-fake-backend.d.ts.map +1 -0
- package/benchmark/lifeops-fake-backend.js +499 -0
- package/benchmark/mock-plugin-base.d.ts +9 -0
- package/benchmark/mock-plugin-base.d.ts.map +1 -0
- package/benchmark/mock-plugin-base.js +325 -0
- package/benchmark/mock-plugin.d.ts +3 -0
- package/benchmark/mock-plugin.d.ts.map +1 -0
- package/benchmark/mock-plugin.js +504 -0
- package/benchmark/params.d.ts +2 -0
- package/benchmark/params.d.ts.map +1 -0
- package/benchmark/params.js +18 -0
- package/benchmark/plugin.d.ts +42 -0
- package/benchmark/plugin.d.ts.map +1 -0
- package/benchmark/plugin.js +422 -0
- package/benchmark/replay-capture.d.ts +73 -0
- package/benchmark/replay-capture.d.ts.map +1 -0
- package/benchmark/replay-capture.js +223 -0
- package/benchmark/server-utils.d.ts +100 -0
- package/benchmark/server-utils.d.ts.map +1 -0
- package/benchmark/server-utils.js +289 -0
- package/benchmark/server.d.ts +2 -0
- package/benchmark/server.d.ts.map +1 -0
- package/benchmark/server.js +1176 -0
- package/browser.d.ts +13 -0
- package/browser.d.ts.map +1 -0
- package/browser.js +15 -0
- package/cli/argv.d.ts +17 -0
- package/cli/argv.d.ts.map +1 -0
- package/cli/argv.js +140 -0
- package/cli/banner.d.ts +11 -0
- package/cli/banner.d.ts.map +1 -0
- package/cli/banner.js +36 -0
- package/cli/cli-name.d.ts +5 -0
- package/cli/cli-name.d.ts.map +1 -0
- package/cli/cli-name.js +21 -0
- package/cli/cli-utils.d.ts +5 -0
- package/cli/cli-utils.d.ts.map +1 -0
- package/cli/cli-utils.js +13 -0
- package/cli/command-format.d.ts +2 -0
- package/cli/command-format.d.ts.map +1 -0
- package/cli/command-format.js +20 -0
- package/cli/doctor/checks.d.ts +96 -0
- package/cli/doctor/checks.d.ts.map +1 -0
- package/cli/doctor/checks.js +483 -0
- package/cli/git-commit.d.ts +5 -0
- package/cli/git-commit.d.ts.map +1 -0
- package/cli/git-commit.js +106 -0
- package/cli/parse-duration.d.ts +5 -0
- package/cli/parse-duration.d.ts.map +1 -0
- package/cli/parse-duration.js +27 -0
- package/cli/plugins-cli.d.ts +26 -0
- package/cli/plugins-cli.d.ts.map +1 -0
- package/cli/plugins-cli.js +892 -0
- package/cli/profile-utils.d.ts +3 -0
- package/cli/profile-utils.d.ts.map +1 -0
- package/cli/profile-utils.js +21 -0
- package/cli/profile.d.ts +15 -0
- package/cli/profile.d.ts.map +1 -0
- package/cli/profile.js +93 -0
- package/cli/program/build-program.d.ts +3 -0
- package/cli/program/build-program.d.ts.map +1 -0
- package/cli/program/build-program.js +12 -0
- package/cli/program/command-registry.d.ts +3 -0
- package/cli/program/command-registry.d.ts.map +1 -0
- package/cli/program/command-registry.js +24 -0
- package/cli/program/help.d.ts +3 -0
- package/cli/program/help.d.ts.map +1 -0
- package/cli/program/help.js +57 -0
- package/cli/program/preaction.d.ts +3 -0
- package/cli/program/preaction.d.ts.map +1 -0
- package/cli/program/preaction.js +40 -0
- package/cli/program/register.auth.d.ts +51 -0
- package/cli/program/register.auth.d.ts.map +1 -0
- package/cli/program/register.auth.js +203 -0
- package/cli/program/register.benchmark.d.ts +3 -0
- package/cli/program/register.benchmark.d.ts.map +1 -0
- package/cli/program/register.benchmark.js +12 -0
- package/cli/program/register.config.d.ts +3 -0
- package/cli/program/register.config.d.ts.map +1 -0
- package/cli/program/register.config.js +150 -0
- package/cli/program/register.configure.d.ts +3 -0
- package/cli/program/register.configure.d.ts.map +1 -0
- package/cli/program/register.configure.js +18 -0
- package/cli/program/register.dashboard.d.ts +3 -0
- package/cli/program/register.dashboard.d.ts.map +1 -0
- package/cli/program/register.dashboard.js +124 -0
- package/cli/program/register.db.d.ts +3 -0
- package/cli/program/register.db.d.ts.map +1 -0
- package/cli/program/register.db.js +45 -0
- package/cli/program/register.doctor.d.ts +3 -0
- package/cli/program/register.doctor.d.ts.map +1 -0
- package/cli/program/register.doctor.js +170 -0
- package/cli/program/register.models.d.ts +3 -0
- package/cli/program/register.models.d.ts.map +1 -0
- package/cli/program/register.models.js +32 -0
- package/cli/program/register.setup.d.ts +16 -0
- package/cli/program/register.setup.d.ts.map +1 -0
- package/cli/program/register.setup.js +333 -0
- package/cli/program/register.start.d.ts +3 -0
- package/cli/program/register.start.d.ts.map +1 -0
- package/cli/program/register.start.js +95 -0
- package/cli/program/register.subclis.d.ts +4 -0
- package/cli/program/register.subclis.d.ts.map +1 -0
- package/cli/program/register.subclis.js +87 -0
- package/cli/program/register.update.d.ts +12 -0
- package/cli/program/register.update.d.ts.map +1 -0
- package/cli/program/register.update.js +173 -0
- package/cli/program.d.ts +2 -0
- package/cli/program.d.ts.map +1 -0
- package/cli/program.js +1 -0
- package/cli/run-main.d.ts +2 -0
- package/cli/run-main.d.ts.map +1 -0
- package/cli/run-main.js +71 -0
- package/cli/version.d.ts +2 -0
- package/cli/version.d.ts.map +1 -0
- package/cli/version.js +2 -0
- package/connectors/capacitor-jsc.d.ts +66 -0
- package/connectors/capacitor-jsc.d.ts.map +1 -0
- package/connectors/capacitor-jsc.js +39 -0
- package/connectors/capacitor-quickjs.d.ts +64 -0
- package/connectors/capacitor-quickjs.d.ts.map +1 -0
- package/connectors/capacitor-quickjs.js +50 -0
- package/connectors/capacitor-sqlite.d.ts +41 -0
- package/connectors/capacitor-sqlite.d.ts.map +1 -0
- package/connectors/capacitor-sqlite.js +87 -0
- package/diagnostics/integration-observability.d.ts +40 -0
- package/diagnostics/integration-observability.d.ts.map +1 -0
- package/diagnostics/integration-observability.js +68 -0
- package/entry.d.ts +10 -0
- package/entry.d.ts.map +1 -0
- package/entry.js +66 -0
- package/index.d.ts +34 -4
- package/index.d.ts.map +1 -1
- package/index.js +42 -6
- package/package.json +81 -151
- package/packaging/PUBLISHING_GUIDE.md +707 -0
- package/packaging/debian/changelog +9 -0
- package/packaging/debian/control +26 -0
- package/packaging/debian/copyright +27 -0
- package/packaging/debian/elizaos-app.service +15 -0
- package/packaging/debian/install +4 -0
- package/packaging/debian/postinst +28 -0
- package/packaging/debian/prerm +14 -0
- package/packaging/debian/rules +44 -0
- package/packaging/debian/source/format +1 -0
- package/packaging/flatpak/README.md +150 -0
- package/packaging/flatpak/ai.elizaos.App.desktop +11 -0
- package/packaging/flatpak/ai.elizaos.App.metainfo.xml +81 -0
- package/packaging/flatpak/ai.elizaos.App.store.yml +142 -0
- package/packaging/flatpak/ai.elizaos.App.yml +142 -0
- package/packaging/flatpak/elizaos-app-wrapper.sh +5 -0
- package/packaging/flatpak/elizaos-app-wrapper.store.sh +16 -0
- package/packaging/flatpak/icons/128x128/ai.elizaos.App.png +0 -0
- package/packaging/flatpak/icons/256x256/ai.elizaos.App.png +0 -0
- package/packaging/flatpak/icons/512x512/ai.elizaos.App.png +0 -0
- package/packaging/homebrew/README.md +80 -0
- package/packaging/homebrew/elizaos-app.cask.rb +60 -0
- package/packaging/homebrew/elizaos-app.rb +49 -0
- package/packaging/inno/ElizaOSApp.iss +53 -0
- package/packaging/inno/build-inno.ps1 +231 -0
- package/packaging/msix/AppxManifest.store.xml +79 -0
- package/packaging/msix/AppxManifest.xml +53 -0
- package/packaging/msix/README.md +201 -0
- package/packaging/msix/assets/LargeTile.png +0 -0
- package/packaging/msix/assets/Square150x150Logo.png +0 -0
- package/packaging/msix/assets/Square44x44Logo.png +0 -0
- package/packaging/msix/assets/StoreLogo.png +0 -0
- package/packaging/msix/assets/Wide310x150Logo.png +0 -0
- package/packaging/msix/build-msix.ps1 +206 -0
- package/packaging/msix/generate-placeholder-assets.ps1 +49 -0
- package/packaging/msix/store/description.md +31 -0
- package/packaging/msix/store/listing.json +27 -0
- package/packaging/pypi/README.md +14 -0
- package/packaging/pypi/elizaos_app/__init__.py +7 -0
- package/packaging/pypi/elizaos_app/__main__.py +6 -0
- package/packaging/pypi/elizaos_app/cli.py +21 -0
- package/packaging/pypi/elizaos_app/loader.py +127 -0
- package/packaging/pypi/elizaos_app/py.typed +1 -0
- package/packaging/pypi/pyproject.toml +38 -0
- package/packaging/snap/snapcraft.yaml +560 -0
- package/packaging/test-packaging.sh +309 -0
- package/patches/@noble%2Fcurves@2.0.1.patch +33 -0
- package/patches/@pixiv%2Fthree-vrm@3.5.2.patch +26 -0
- package/patches/coding-agent-adapters@0.16.3.patch +44 -0
- package/patches/electrobun@1.16.0.patch +13 -0
- package/patches/llama-cpp-capacitor@0.1.5.patch +2387 -0
- package/patches/proper-lockfile@4.1.2.patch +14 -0
- package/patches/pty-manager@1.11.0.patch +194 -0
- package/permissions/types.d.ts +8 -0
- package/permissions/types.d.ts.map +1 -0
- package/permissions/types.js +7 -0
- package/platform/agent-browser-stub.d.ts +27 -0
- package/platform/agent-browser-stub.d.ts.map +1 -0
- package/platform/agent-browser-stub.js +16 -0
- package/platform/empty-node-module.d.ts +31 -0
- package/platform/empty-node-module.d.ts.map +1 -0
- package/platform/empty-node-module.js +22 -0
- package/platforms/android/Gemfile +6 -0
- package/platforms/android/README.md +79 -0
- package/platforms/android/app/build.gradle +124 -0
- package/platforms/android/app/capacitor.build.gradle +32 -0
- package/platforms/android/app/proguard-rules.pro +46 -0
- package/platforms/android/app/src/androidTest/java/ai/elizaos/app/ElizaOsInstrumentedTest.java +162 -0
- package/platforms/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java +26 -0
- package/platforms/android/app/src/main/AndroidManifest.xml +83 -0
- package/platforms/android/app/src/main/java/ai/elizaos/app/AgentPlugin.java +232 -0
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaAgentService.java +1514 -0
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaAssistActivity.java +21 -0
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaBootReceiver.java +61 -0
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaBrowserActivity.java +39 -0
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaCalendarActivity.java +75 -0
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaCameraActivity.java +54 -0
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaClockActivity.java +70 -0
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaContactsActivity.java +56 -0
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaDialActivity.java +83 -0
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaInCallService.java +168 -0
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaMmsReceiver.java +70 -0
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaNativeBridge.java +38 -0
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaRespondViaMessageService.java +119 -0
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaSmsComposeActivity.java +50 -0
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaSmsReceiver.java +84 -0
- package/platforms/android/app/src/main/java/ai/elizaos/app/GatewayConnectionService.java +211 -0
- package/platforms/android/app/src/main/java/ai/elizaos/app/MainActivity.java +202 -0
- package/platforms/android/app/src/main/res/drawable/ic_launcher_background.xml +170 -0
- 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/drawable-v24/ic_launcher_foreground.xml +34 -0
- package/platforms/android/app/src/main/res/layout/activity_main.xml +12 -0
- package/platforms/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +5 -0
- package/platforms/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +5 -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_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_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_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_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_round.png +0 -0
- package/platforms/android/app/src/main/res/values/ic_launcher_background.xml +4 -0
- package/platforms/android/app/src/main/res/values/strings.xml +7 -0
- package/platforms/android/app/src/main/res/values/styles.xml +22 -0
- package/platforms/android/app/src/main/res/xml/file_paths.xml +5 -0
- package/platforms/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java +18 -0
- package/platforms/android/build.gradle +63 -0
- package/platforms/android/capacitor-cordova-android-plugins/build.gradle +53 -0
- package/platforms/android/capacitor-cordova-android-plugins/cordova.variables.gradle +3 -0
- package/platforms/android/capacitor-cordova-android-plugins/src/main/AndroidManifest.xml +3 -0
- package/platforms/android/capacitor-cordova-android-plugins/src/main/java/.gitkeep +1 -0
- package/platforms/android/capacitor-cordova-android-plugins/src/main/res/.gitkeep +1 -0
- package/platforms/android/capacitor.settings.gradle +45 -0
- package/platforms/android/fastlane/Appfile +2 -0
- package/platforms/android/fastlane/Fastfile +59 -0
- package/platforms/android/fastlane/metadata/android/en-US/full_description.txt +24 -0
- package/platforms/android/fastlane/metadata/android/en-US/short_description.txt +1 -0
- package/platforms/android/fastlane/metadata/android/en-US/title.txt +1 -0
- package/platforms/android/fastlane/metadata/android/en-US/video.txt +0 -0
- package/platforms/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/platforms/android/gradle/wrapper/gradle-wrapper.properties +7 -0
- package/platforms/android/gradle.properties +27 -0
- package/platforms/android/gradlew +251 -0
- package/platforms/android/gradlew.bat +94 -0
- package/platforms/android/settings.gradle +13 -0
- package/platforms/android/variables.gradle +17 -0
- package/platforms/electrobun/.generated/brand-config.json +8 -0
- package/platforms/electrobun/README.md +44 -0
- package/platforms/electrobun/assets/appIcon.ico +0 -0
- package/platforms/electrobun/assets/appIcon.iconset/icon_128x128.png +0 -0
- package/platforms/electrobun/assets/appIcon.iconset/icon_128x128@2x.png +0 -0
- package/platforms/electrobun/assets/appIcon.iconset/icon_16x16.png +0 -0
- package/platforms/electrobun/assets/appIcon.iconset/icon_16x16@2x.png +0 -0
- package/platforms/electrobun/assets/appIcon.iconset/icon_256x256.png +0 -0
- package/platforms/electrobun/assets/appIcon.iconset/icon_256x256@2x.png +0 -0
- package/platforms/electrobun/assets/appIcon.iconset/icon_32x32.png +0 -0
- package/platforms/electrobun/assets/appIcon.iconset/icon_32x32@2x.png +0 -0
- package/platforms/electrobun/assets/appIcon.iconset/icon_512x512.png +0 -0
- package/platforms/electrobun/assets/appIcon.iconset/icon_512x512@2x.png +0 -0
- package/platforms/electrobun/assets/appIcon.png +0 -0
- package/platforms/electrobun/assets/brand-config.json +8 -0
- package/platforms/electrobun/biome.json +11 -0
- package/platforms/electrobun/electrobun.config.ts +435 -0
- package/platforms/electrobun/entitlements/README.md +54 -0
- package/platforms/electrobun/entitlements/mas-child.entitlements +10 -0
- package/platforms/electrobun/entitlements/mas.entitlements +41 -0
- package/platforms/electrobun/native/macos/window-effects.mm +1030 -0
- package/platforms/electrobun/package.json +42 -0
- package/platforms/electrobun/scripts/bin/zip +2 -0
- package/platforms/electrobun/scripts/build-macos-effects.sh +31 -0
- package/platforms/electrobun/scripts/build-whisper-universal.sh +137 -0
- package/platforms/electrobun/scripts/build-whisper.sh +95 -0
- package/platforms/electrobun/scripts/ensure-whisper-model.sh +93 -0
- package/platforms/electrobun/scripts/hdiutil-wrapper.sh +33 -0
- package/platforms/electrobun/scripts/lib/app-dir.mjs +74 -0
- package/platforms/electrobun/scripts/lib/repo-root.mjs +77 -0
- package/platforms/electrobun/scripts/local-adhoc-sign-macos.ts +214 -0
- package/platforms/electrobun/scripts/macos-direct-launcher.c +84 -0
- package/platforms/electrobun/scripts/postwrap-diagnostics.ts +423 -0
- package/platforms/electrobun/scripts/postwrap-sign-runtime-macos.ts +352 -0
- package/platforms/electrobun/scripts/sign-windows.ps1 +121 -0
- package/platforms/electrobun/scripts/smoke-test-windows.ps1 +907 -0
- package/platforms/electrobun/scripts/smoke-test.sh +1186 -0
- package/platforms/electrobun/scripts/stage-macos-release-artifacts.sh +491 -0
- package/platforms/electrobun/scripts/sync-web-assets.mjs +48 -0
- package/platforms/electrobun/scripts/verify-rpc-handlers.ts +162 -0
- package/platforms/electrobun/scripts/verify-windows-installer-proof.ps1 +203 -0
- package/platforms/electrobun/scripts/xcrun-wrapper.sh +80 -0
- package/platforms/electrobun/scripts/zip-wrapper.sh +6 -0
- package/platforms/electrobun/src/__stubs__/bun-ffi.ts +51 -0
- package/platforms/electrobun/src/__stubs__/electrobun-bun.ts +20 -0
- package/platforms/electrobun/src/agent-ready-state.ts +35 -0
- package/platforms/electrobun/src/agent-reset-from-main.ts +87 -0
- package/platforms/electrobun/src/api-base.ts +169 -0
- package/platforms/electrobun/src/application-menu-action-registry.ts +21 -0
- package/platforms/electrobun/src/application-menu.ts +418 -0
- package/platforms/electrobun/src/background-notice.ts +65 -0
- package/platforms/electrobun/src/brand-config.ts +184 -0
- package/platforms/electrobun/src/bridge/browser-tabs-renderer-registry.ts +60 -0
- package/platforms/electrobun/src/bridge/electrobun-direct-rpc.ts +430 -0
- package/platforms/electrobun/src/bridge/electrobun-preload.ts +1 -0
- package/platforms/electrobun/src/bridge/electrobun-stub.ts +21 -0
- package/platforms/electrobun/src/browser-workspace-bridge-server.ts +284 -0
- package/platforms/electrobun/src/cloud-auth-window.ts +216 -0
- package/platforms/electrobun/src/cloud-disconnect-from-main.ts +118 -0
- package/platforms/electrobun/src/constants.ts +2 -0
- package/platforms/electrobun/src/desktop-http-request.test.ts +85 -0
- package/platforms/electrobun/src/desktop-http-request.ts +103 -0
- package/platforms/electrobun/src/desktop-test-bridge-server.ts +248 -0
- package/platforms/electrobun/src/devtools-layout.ts +63 -0
- package/platforms/electrobun/src/diagnostic-format.ts +65 -0
- package/platforms/electrobun/src/fatal-shutdown.test.ts +30 -0
- package/platforms/electrobun/src/fatal-shutdown.ts +10 -0
- package/platforms/electrobun/src/floating-chat-window.ts +239 -0
- package/platforms/electrobun/src/index.ts +2510 -0
- package/platforms/electrobun/src/libMacWindowEffects.dylib +0 -0
- package/platforms/electrobun/src/lifecycle/api-base-owner.ts +119 -0
- package/platforms/electrobun/src/lifecycle/desktop-session-prime.ts +77 -0
- package/platforms/electrobun/src/logger.ts +23 -0
- package/platforms/electrobun/src/main-window-runtime.ts +117 -0
- package/platforms/electrobun/src/main-window-session.ts +88 -0
- package/platforms/electrobun/src/menu-reset-from-main.ts +211 -0
- package/platforms/electrobun/src/native/agent.ts +1963 -0
- package/platforms/electrobun/src/native/auth-bridge.ts +525 -0
- package/platforms/electrobun/src/native/browser-workspace.ts +574 -0
- package/platforms/electrobun/src/native/camera.ts +68 -0
- package/platforms/electrobun/src/native/canvas.ts +504 -0
- package/platforms/electrobun/src/native/credentials.ts +765 -0
- package/platforms/electrobun/src/native/desktop.ts +2317 -0
- package/platforms/electrobun/src/native/editor-bridge.ts +292 -0
- package/platforms/electrobun/src/native/file-watcher.ts +220 -0
- package/platforms/electrobun/src/native/gateway.ts +218 -0
- package/platforms/electrobun/src/native/gpu-window.ts +301 -0
- package/platforms/electrobun/src/native/index.ts +105 -0
- package/platforms/electrobun/src/native/location.ts +110 -0
- package/platforms/electrobun/src/native/loopback-port.ts +81 -0
- package/platforms/electrobun/src/native/mac-window-effects.ts +178 -0
- package/platforms/electrobun/src/native/music-player.ts +61 -0
- package/platforms/electrobun/src/native/permissions-shared.ts +171 -0
- package/platforms/electrobun/src/native/permissions.ts +242 -0
- package/platforms/electrobun/src/native/power-state.ts +195 -0
- package/platforms/electrobun/src/native/screencapture.ts +654 -0
- package/platforms/electrobun/src/native/steward.ts +343 -0
- package/platforms/electrobun/src/native/swabble.ts +349 -0
- package/platforms/electrobun/src/native/talkmode.ts +441 -0
- package/platforms/electrobun/src/native/webgpu-browser-support.ts +220 -0
- package/platforms/electrobun/src/native/whisper.ts +280 -0
- package/platforms/electrobun/src/preload-validation.ts +65 -0
- package/platforms/electrobun/src/preload.js +1 -0
- package/platforms/electrobun/src/print-electrobun-dev-settings-banner.ts +140 -0
- package/platforms/electrobun/src/renderer-static.ts +77 -0
- package/platforms/electrobun/src/rpc-handlers.ts +1079 -0
- package/platforms/electrobun/src/rpc-schema.ts +1870 -0
- package/platforms/electrobun/src/runtime-layout.ts +150 -0
- package/platforms/electrobun/src/runtime-permissions.ts +131 -0
- package/platforms/electrobun/src/screenshot-dev-server.ts +125 -0
- package/platforms/electrobun/src/startup-trace.ts +351 -0
- package/platforms/electrobun/src/surface-windows.ts +475 -0
- package/platforms/electrobun/src/types/web-speech.d.ts +52 -0
- package/platforms/electrobun/src/types.ts +18 -0
- package/platforms/electrobun/src/windows-cef-profile.ts +124 -0
- package/platforms/electrobun/tsconfig.json +75 -0
- package/platforms/electrobun/vitest.electrobun.config.ts +54 -0
- package/platforms/ios/App/App/App.entitlements +18 -0
- package/platforms/ios/App/App/AppDelegate.swift +93 -0
- package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-ios-marketing-1024.png +0 -0
- package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-ipad-20x20@1x.png +0 -0
- package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-ipad-20x20@2x.png +0 -0
- package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-ipad-29x29@1x.png +0 -0
- package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-ipad-29x29@2x.png +0 -0
- package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-ipad-40x40@1x.png +0 -0
- package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-ipad-40x40@2x.png +0 -0
- package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-ipad-76x76@1x.png +0 -0
- package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-ipad-76x76@2x.png +0 -0
- package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-ipad-83_5x83_5@2x.png +0 -0
- package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-iphone-20x20@2x.png +0 -0
- package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-iphone-20x20@3x.png +0 -0
- package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-iphone-29x29@2x.png +0 -0
- package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-iphone-29x29@3x.png +0 -0
- package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-iphone-40x40@2x.png +0 -0
- package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-iphone-40x40@3x.png +0 -0
- package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-iphone-60x60@2x.png +0 -0
- package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-iphone-60x60@3x.png +0 -0
- package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json +116 -0
- package/platforms/ios/App/App/Assets.xcassets/Contents.json +6 -0
- package/platforms/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json +23 -0
- package/platforms/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png +0 -0
- package/platforms/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png +0 -0
- package/platforms/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png +0 -0
- package/platforms/ios/App/App/Base.lproj/LaunchScreen.storyboard +32 -0
- package/platforms/ios/App/App/Base.lproj/Main.storyboard +19 -0
- package/platforms/ios/App/App/ElizaIntentPlugin.swift +185 -0
- package/platforms/ios/App/App/Info.plist +123 -0
- package/platforms/ios/App/App/PrivacyInfo.xcprivacy +55 -0
- package/platforms/ios/App/App/SceneDelegate.swift +77 -0
- package/platforms/ios/App/App/WebsiteBlockerContentExtension/ActionRequestHandler.swift +142 -0
- package/platforms/ios/App/App/WebsiteBlockerContentExtension/Info.plist +29 -0
- package/platforms/ios/App/App/WebsiteBlockerContentExtension/PrivacyInfo.xcprivacy +23 -0
- package/platforms/ios/App/App/WebsiteBlockerContentExtension/WebsiteBlockerContentExtension.entitlements +10 -0
- package/platforms/ios/App/App.xcodeproj/project.pbxproj +596 -0
- package/platforms/ios/App/App.xcworkspace/contents.xcworkspacedata +10 -0
- package/platforms/ios/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/platforms/ios/App/ExportOptions.plist +18 -0
- package/platforms/ios/App/Podfile +51 -0
- package/platforms/ios/App/Podfile.lock +131 -0
- package/platforms/ios/Gemfile +6 -0
- package/platforms/ios/fastlane/Appfile +4 -0
- package/platforms/ios/fastlane/Fastfile +94 -0
- package/platforms/ios/fastlane/Matchfile +12 -0
- package/platforms/ios/fastlane/metadata/en-US/description.txt +22 -0
- package/platforms/ios/fastlane/metadata/en-US/keywords.txt +1 -0
- package/platforms/ios/fastlane/metadata/en-US/marketing_url.txt +1 -0
- package/platforms/ios/fastlane/metadata/en-US/name.txt +1 -0
- package/platforms/ios/fastlane/metadata/en-US/privacy_url.txt +1 -0
- package/platforms/ios/fastlane/metadata/en-US/promotional_text.txt +1 -0
- package/platforms/ios/fastlane/metadata/en-US/subtitle.txt +1 -0
- package/platforms/ios/fastlane/metadata/en-US/support_url.txt +1 -0
- package/register-runtime-hooks.d.ts +2 -0
- package/register-runtime-hooks.d.ts.map +1 -0
- package/register-runtime-hooks.js +13 -0
- package/registry/generate-apps.d.ts +2 -0
- package/registry/generate-apps.d.ts.map +1 -0
- package/registry/generate-apps.js +338 -0
- package/registry/generate.d.ts +2 -0
- package/registry/generate.d.ts.map +1 -0
- package/registry/generate.js +506 -0
- package/registry/index.d.ts +6 -0
- package/registry/index.d.ts.map +1 -0
- package/registry/index.js +68 -0
- package/registry/loader.d.ts +27 -0
- package/registry/loader.d.ts.map +1 -0
- package/registry/loader.js +111 -0
- package/registry/schema.d.ts +989 -0
- package/registry/schema.d.ts.map +1 -0
- package/registry/schema.js +264 -0
- package/runtime/api-dev-settings-banner.d.ts +7 -0
- package/runtime/api-dev-settings-banner.d.ts.map +1 -0
- package/runtime/api-dev-settings-banner.js +104 -0
- package/runtime/app-route-plugin-registry.d.ts +3 -0
- package/runtime/app-route-plugin-registry.d.ts.map +1 -0
- package/runtime/app-route-plugin-registry.js +1 -0
- package/runtime/build-character-from-config.d.ts +3 -0
- package/runtime/build-character-from-config.d.ts.map +1 -0
- package/runtime/build-character-from-config.js +59 -0
- package/runtime/build-variant.d.ts +8 -0
- package/runtime/build-variant.d.ts.map +1 -0
- package/runtime/build-variant.js +7 -0
- package/runtime/channel-plugin-map.d.ts +6 -0
- package/runtime/channel-plugin-map.d.ts.map +1 -0
- package/runtime/channel-plugin-map.js +38 -0
- package/runtime/dev-server.d.ts +2 -0
- package/runtime/dev-server.d.ts.map +1 -0
- package/runtime/dev-server.js +383 -0
- package/runtime/dev-settings-figlet-heading.d.ts +22 -0
- package/runtime/dev-settings-figlet-heading.d.ts.map +1 -0
- package/runtime/dev-settings-figlet-heading.js +55 -0
- package/runtime/eliza.d.ts +21 -0
- package/runtime/eliza.d.ts.map +1 -0
- package/runtime/eliza.js +863 -0
- package/runtime/embedding-manager-support.d.ts +77 -0
- package/runtime/embedding-manager-support.d.ts.map +1 -0
- package/runtime/embedding-manager-support.js +309 -0
- package/runtime/embedding-presets.d.ts +5 -0
- package/runtime/embedding-presets.d.ts.map +1 -0
- package/runtime/embedding-presets.js +47 -0
- package/runtime/embedding-warmup-policy.d.ts +13 -0
- package/runtime/embedding-warmup-policy.d.ts.map +1 -0
- package/runtime/embedding-warmup-policy.js +33 -0
- package/runtime/ensure-local-inference-handler.d.ts +25 -0
- package/runtime/ensure-local-inference-handler.d.ts.map +1 -0
- package/runtime/ensure-local-inference-handler.js +389 -0
- package/runtime/ensure-text-to-speech-handler.d.ts +18 -0
- package/runtime/ensure-text-to-speech-handler.d.ts.map +1 -0
- package/runtime/ensure-text-to-speech-handler.js +50 -0
- package/runtime/error-handlers.d.ts +12 -0
- package/runtime/error-handlers.d.ts.map +1 -0
- package/runtime/error-handlers.js +49 -0
- package/runtime/mobile-local-inference-gate.d.ts +21 -0
- package/runtime/mobile-local-inference-gate.d.ts.map +1 -0
- package/runtime/mobile-local-inference-gate.js +24 -0
- package/runtime/mobile-safe-runtime.d.ts +123 -0
- package/runtime/mobile-safe-runtime.d.ts.map +1 -0
- package/runtime/mobile-safe-runtime.js +290 -0
- package/runtime/mode/remote-forwarder.d.ts +35 -0
- package/runtime/mode/remote-forwarder.d.ts.map +1 -0
- package/runtime/mode/remote-forwarder.js +119 -0
- package/runtime/mode/route-mode-guard.d.ts +21 -0
- package/runtime/mode/route-mode-guard.d.ts.map +1 -0
- package/runtime/mode/route-mode-guard.js +30 -0
- package/runtime/mode/route-mode-matrix.d.ts +64 -0
- package/runtime/mode/route-mode-matrix.d.ts.map +1 -0
- package/runtime/mode/route-mode-matrix.js +125 -0
- package/runtime/mode/runtime-mode.d.ts +72 -0
- package/runtime/mode/runtime-mode.d.ts.map +1 -0
- package/runtime/mode/runtime-mode.js +167 -0
- package/runtime/runtime-bootstrap-policy.d.ts +17 -0
- package/runtime/runtime-bootstrap-policy.d.ts.map +1 -0
- package/runtime/runtime-bootstrap-policy.js +37 -0
- package/runtime/sandbox-policy.d.ts +8 -0
- package/runtime/sandbox-policy.d.ts.map +1 -0
- package/runtime/sandbox-policy.js +7 -0
- package/runtime/startup-overlay.d.ts +14 -0
- package/runtime/startup-overlay.d.ts.map +1 -0
- package/runtime/startup-overlay.js +55 -0
- package/runtime/telegram-standalone-handler.d.ts +34 -0
- package/runtime/telegram-standalone-handler.d.ts.map +1 -0
- package/runtime/telegram-standalone-handler.js +195 -0
- package/runtime/telegram-standalone-policy.d.ts +2 -0
- package/runtime/telegram-standalone-policy.d.ts.map +1 -0
- package/runtime/telegram-standalone-policy.js +14 -0
- package/scripts/README.md +27 -0
- package/scripts/align-electrobun-version.mjs +37 -0
- package/scripts/aosp/README.md +66 -0
- package/scripts/aosp/avd-test.mjs +403 -0
- package/scripts/aosp/boot-validate.mjs +536 -0
- package/scripts/aosp/build-aosp.mjs +448 -0
- package/scripts/aosp/build-bootanimation.mjs +178 -0
- package/scripts/aosp/capture-screens.mjs +325 -0
- package/scripts/aosp/compile-libllama.mjs +1333 -0
- package/scripts/aosp/compile-shim.mjs +328 -0
- package/scripts/aosp/e2e-validate.mjs +225 -0
- package/scripts/aosp/lib/load-variant-config.mjs +182 -0
- package/scripts/aosp/lint-init-rc.mjs +258 -0
- package/scripts/aosp/llama-cpp-patches/README.md +49 -0
- package/scripts/aosp/llama-cpp-patches/apply-patches.mjs +198 -0
- package/scripts/aosp/llama-cpp-patches/polarquant/0001-Q4_POLAR-register-GGML_TYPE_Q4_POLAR-45-and-block_q4.patch +108 -0
- package/scripts/aosp/llama-cpp-patches/polarquant/0002-Q4_POLAR-vendor-PolarQuant-ref-kernels-into-ggml-bas.patch +460 -0
- package/scripts/aosp/llama-cpp-patches/polarquant/0003-tests-cover-Q4_POLAR-fix-latent-buffer-overflow.patch +102 -0
- package/scripts/aosp/llama-cpp-patches/polarquant/0004-Q4_POLAR-gate-QJL-residual-on-runtime-flag-default-o.patch +97 -0
- package/scripts/aosp/llama-cpp-patches/qjl/0001-ggml-add-GGML_TYPE_QJL1_256-GGML_OP_ATTN_SCORE_QJL-e.patch +120 -0
- package/scripts/aosp/llama-cpp-patches/qjl/0002-ggml-register-QJL1_256-type-traits-ATTN_SCORE_QJL-op.patch +1392 -0
- package/scripts/aosp/llama-cpp-patches/qjl/0003-ggml-set-QJL1_256-blck_size-to-head_dim-128-not-sket.patch +56 -0
- package/scripts/aosp/llama-cpp-patches/qjl/0004-tests-add-test-qjl-cache-verifying-type-traits-score.patch +335 -0
- package/scripts/aosp/llama-cpp-patches/qjl/0005-ggml-flip-block_qjl1_256-to-signs-then-norm.patch +69 -0
- package/scripts/aosp/llama-shim/eliza_llama_shim.c +276 -0
- package/scripts/aosp/seccomp-shim/loader-wrap.c +141 -0
- package/scripts/aosp/seccomp-shim/sigsys-handler.c +338 -0
- package/scripts/aosp/sim.mjs +277 -0
- package/scripts/aosp/smoke-cuttlefish.mjs +673 -0
- package/scripts/aosp/stage-default-models.mjs +340 -0
- package/scripts/aosp/stage-models-dfm.mjs +384 -0
- package/scripts/aosp/sync-to-aosp.mjs +134 -0
- package/scripts/aosp/validate.mjs +1273 -0
- package/scripts/aosp/variant-config-schema.ts +10 -0
- package/scripts/audit-live-test-surface.mjs +590 -0
- package/scripts/audit-server-test-surface.mjs +163 -0
- package/scripts/benchmark-preflight.mjs +170 -0
- package/scripts/bin/.gitkeep +0 -0
- package/scripts/build-bundled-agent-skills-artifact.mjs +58 -0
- package/scripts/build-bundled-orchestrator-artifact.mjs +66 -0
- package/scripts/build-capacitor-app.mjs +122 -0
- package/scripts/build-electrobun-preload.mjs +117 -0
- package/scripts/build-flatpak.mjs +125 -0
- package/scripts/build-image.sh +461 -0
- package/scripts/build-llama-cpp-dflash.mjs +1866 -0
- package/scripts/build-native-plugins.mjs +153 -0
- package/scripts/build-patched-electrobun-cli.mjs +424 -0
- package/scripts/build-win.mjs +82 -0
- package/scripts/bump-elizaos.sh +438 -0
- package/scripts/check-i18n.mjs +328 -0
- package/scripts/check-secret-hygiene.mjs +344 -0
- package/scripts/check-upstream-drift.mjs +102 -0
- package/scripts/clean-repo.mjs +187 -0
- package/scripts/codesign-mas.mjs +297 -0
- package/scripts/container-entrypoint.mjs +101 -0
- package/scripts/coordinator-cross-platform-review.mjs +192 -0
- package/scripts/copy-package-assets.mjs +31 -0
- package/scripts/copy-runtime-node-modules.ts +1782 -0
- package/scripts/coverage-policy.d.mts +16 -0
- package/scripts/coverage-policy.mjs +38 -0
- package/scripts/css-coverage.mjs +241 -0
- package/scripts/deploy-image.sh +318 -0
- package/scripts/desktop-build.mjs +867 -0
- package/scripts/desktop-stack-status.mjs +80 -0
- package/scripts/dev-platform.mjs +975 -0
- package/scripts/dev-ui.mjs +1178 -0
- package/scripts/dev-win.mjs +25 -0
- package/scripts/disable-local-eliza-workspace.mjs +420 -0
- package/scripts/docker-ci-smoke.sh +500 -0
- package/scripts/docker-entrypoint.sh +11 -0
- package/scripts/docker-runtime-review.mjs +230 -0
- package/scripts/docs-list.js +206 -0
- package/scripts/ensure-avatars.mjs +335 -0
- package/scripts/ensure-bundled-workspaces.mjs +143 -0
- package/scripts/ensure-capacitor-platform.mjs +58 -0
- package/scripts/ensure-electrobun-core.mjs +318 -0
- package/scripts/ensure-generated-core-proto-js.mjs +125 -0
- package/scripts/ensure-shared-i18n-data.mjs +67 -0
- package/scripts/ensure-skills.mjs +177 -0
- package/scripts/ensure-type-package-aliases.mjs +246 -0
- package/scripts/ensure-vision-deps.mjs +196 -0
- package/scripts/entry.ts +11 -0
- package/scripts/find-collisions.mjs +765 -0
- package/scripts/find-duplicate-components.mjs +203 -0
- package/scripts/fix-workspace-deps.mjs +328 -0
- package/scripts/generate-onboarding-voicelines.mjs +194 -0
- package/scripts/generate-plugin-index.js +1055 -0
- package/scripts/generate-static-asset-manifest.mjs +15 -0
- package/scripts/generated/static-asset-manifest.json +4 -0
- package/scripts/i18n-dynamic-keys.json +128 -0
- package/scripts/init-submodules.mjs +425 -0
- package/scripts/ios-xcframework/README.md +233 -0
- package/scripts/ios-xcframework/build-xcframework.mjs +487 -0
- package/scripts/kernel-patches/metal-kernels.mjs +656 -0
- package/scripts/kernel-patches/vulkan-dispatch-patches/01-vulkan-shaders-gen.patch +41 -0
- package/scripts/kernel-patches/vulkan-dispatch-patches/02-ggml-vulkan-pipelines.patch +86 -0
- package/scripts/kernel-patches/vulkan-kernels.mjs +281 -0
- package/scripts/lib/allocate-loopback-port.mjs +58 -0
- package/scripts/lib/api-supervisor.mjs +115 -0
- package/scripts/lib/app-dir.mjs +74 -0
- package/scripts/lib/asset-cdn.mjs +118 -0
- package/scripts/lib/bun-version-guard.mjs +44 -0
- package/scripts/lib/capacitor-platform-templates.mjs +306 -0
- package/scripts/lib/capacitor-plugin-build-needed.mjs +79 -0
- package/scripts/lib/capacitor-plugin-names.mjs +35 -0
- package/scripts/lib/desktop-preflight.mjs +122 -0
- package/scripts/lib/desktop-stack-status.mjs +151 -0
- package/scripts/lib/dev-ui-onchain.mjs +22 -0
- package/scripts/lib/dev-ui-vision.mjs +15 -0
- package/scripts/lib/kill-process-tree.mjs +87 -0
- package/scripts/lib/kill-ui-listen-port.mjs +74 -0
- package/scripts/lib/node-path-env.mjs +11 -0
- package/scripts/lib/orchestrator-desktop-dev-banner.mjs +285 -0
- package/scripts/lib/patch-bun-exports.mjs +1446 -0
- package/scripts/lib/read-app-identity.mjs +54 -0
- package/scripts/lib/release-check-pack-dry-run.ts +34 -0
- package/scripts/lib/repo-root.mjs +77 -0
- package/scripts/lib/stage-android-agent.mjs +704 -0
- package/scripts/lib/static-asset-manifest.mjs +151 -0
- package/scripts/lib/sync-eliza-env-aliases.mjs +37 -0
- package/scripts/lib/vite-renderer-dist-stale.mjs +141 -0
- package/scripts/lib/workspace-discovery.mjs +108 -0
- package/scripts/lifeops-prompt-benchmark.ts +206 -0
- package/scripts/link-browser-server.mjs +157 -0
- package/scripts/link-docker-local-app-packages.mjs +345 -0
- package/scripts/link-external-plugins.mjs +195 -0
- package/scripts/mobile-auth-simulator-smoke.mjs +373 -0
- package/scripts/normalize-parallax-capture.ts +97 -0
- package/scripts/omnivoice-fuse/Makefile +44 -0
- package/scripts/omnivoice-fuse/README.md +266 -0
- package/scripts/omnivoice-fuse/cmake-graft.mjs +180 -0
- package/scripts/omnivoice-fuse/ffi-stub.c +222 -0
- package/scripts/omnivoice-fuse/ffi.h +158 -0
- package/scripts/omnivoice-fuse/libelizainference_stub.dylib +0 -0
- package/scripts/omnivoice-fuse/prepare.mjs +263 -0
- package/scripts/omnivoice-fuse/verify-symbols.mjs +138 -0
- package/scripts/pack-upstreams.mjs +392 -0
- package/scripts/patch-deps.mjs +597 -0
- package/scripts/patch-workspace-plugins.mjs +148 -0
- package/scripts/playwright-ui-live-stack.ts +667 -0
- package/scripts/playwright-ui-smoke-api-stub.mjs +1838 -0
- package/scripts/plugin-index-local-additions.json +12 -0
- package/scripts/plugin-metadata-overrides.json +165 -0
- package/scripts/pre-review-local.mjs +599 -0
- package/scripts/prepare-ios-cocoapods.sh +30 -0
- package/scripts/prepare-package-dist.mjs +358 -0
- package/scripts/process-vrms.mjs +203 -0
- package/scripts/prune-cdn-local-assets.mjs +44 -0
- package/scripts/publish-local-plugins-next.mjs +122 -0
- package/scripts/release-check.ts +1402 -0
- package/scripts/relink-workspace-packages-to-dist.mjs +115 -0
- package/scripts/replace-workspace-versions.mjs +128 -0
- package/scripts/report-coverage-surfaces.mjs +121 -0
- package/scripts/restore-workspace-refs.mjs +128 -0
- package/scripts/rt.mjs +29 -0
- package/scripts/rt.sh +4 -0
- package/scripts/run-biome-check.mjs +191 -0
- package/scripts/run-coding-agent-e2e.mjs +46 -0
- package/scripts/run-desktop-playwright.mjs +35 -0
- package/scripts/run-local-plugin-live-smoke.mjs +185 -0
- package/scripts/run-mobile-build.mjs +3308 -0
- package/scripts/run-node-runtime.mjs +75 -0
- package/scripts/run-node-tsx.mjs +62 -0
- package/scripts/run-node.mjs +294 -0
- package/scripts/run-playwright.mjs +66 -0
- package/scripts/run-production-build.mjs +138 -0
- package/scripts/run-release-contract-suite.mjs +57 -0
- package/scripts/run-repo-setup.mjs +230 -0
- package/scripts/run-screenshotter.mjs +140 -0
- package/scripts/run-ui-smoke-playwright-suite.mjs +96 -0
- package/scripts/run-windows-smoke-launcher.ps1 +35 -0
- package/scripts/run-with-env.mjs +60 -0
- package/scripts/runtime-package-manifest.ts +107 -0
- package/scripts/sandbox-setup.sh +7 -0
- package/scripts/sanitize-npm-package-metadata.mjs +165 -0
- package/scripts/set-package-version.mjs +13 -0
- package/scripts/setup-upstreams.mjs +838 -0
- package/scripts/smoke-api-status.mjs +113 -0
- package/scripts/smoke-lifeops.mjs +305 -0
- package/scripts/startup-integration-script-drift.test.ts +94 -0
- package/scripts/sync-desktop-renderer.mjs +308 -0
- package/scripts/sync-dod-gap-issues-lib.mjs +214 -0
- package/scripts/sync-dod-gap-issues.mjs +218 -0
- package/scripts/type-audit.mjs +606 -0
- package/scripts/validate-cdn-assets.mjs +307 -0
- package/scripts/validate-regression-matrix.mjs +360 -0
- package/scripts/workspace-plugin-patches/plugin-anthropic-elizaos-core-api-compat.patch +34 -0
- package/scripts/workspace-prepare.mjs +192 -0
- package/scripts/worktree-env.sh +41 -0
- package/scripts/write-build-info.ts +69 -0
- package/scripts/write-homepage-release-data.mjs +393 -0
- package/security/agent-vault-id.d.ts +16 -0
- package/security/agent-vault-id.d.ts.map +1 -0
- package/security/agent-vault-id.js +32 -0
- package/security/cloud-secret-store.d.ts +34 -0
- package/security/cloud-secret-store.d.ts.map +1 -0
- package/security/cloud-secret-store.js +65 -0
- package/security/export-guard.d.ts +34 -0
- package/security/export-guard.d.ts.map +1 -0
- package/security/export-guard.js +127 -0
- package/security/hydrate-wallet-keys-from-platform-store.d.ts +13 -0
- package/security/hydrate-wallet-keys-from-platform-store.d.ts.map +1 -0
- package/security/hydrate-wallet-keys-from-platform-store.js +116 -0
- package/security/platform-secure-store-node.d.ts +13 -0
- package/security/platform-secure-store-node.d.ts.map +1 -0
- package/security/platform-secure-store-node.js +311 -0
- package/security/platform-secure-store.d.ts +47 -0
- package/security/platform-secure-store.d.ts.map +1 -0
- package/security/platform-secure-store.js +10 -0
- package/security/wallet-os-store-actions.d.ts +45 -0
- package/security/wallet-os-store-actions.d.ts.map +1 -0
- package/security/wallet-os-store-actions.js +125 -0
- package/services/account-pool.d.ts +134 -0
- package/services/account-pool.d.ts.map +1 -0
- package/services/account-pool.js +693 -0
- package/services/account-usage.d.ts +75 -0
- package/services/account-usage.d.ts.map +1 -0
- package/services/account-usage.js +179 -0
- package/services/auth-store.d.ts +179 -0
- package/services/auth-store.d.ts.map +1 -0
- package/services/auth-store.js +404 -0
- package/services/cloud-jwks-store.d.ts +62 -0
- package/services/cloud-jwks-store.d.ts.map +1 -0
- package/services/cloud-jwks-store.js +118 -0
- package/services/connector-target-catalog.d.ts +78 -0
- package/services/connector-target-catalog.d.ts.map +1 -0
- package/services/connector-target-catalog.js +64 -0
- package/services/discord-target-source.d.ts +53 -0
- package/services/discord-target-source.d.ts.map +1 -0
- package/services/discord-target-source.js +116 -0
- package/services/github-credentials.d.ts +95 -0
- package/services/github-credentials.d.ts.map +1 -0
- package/services/github-credentials.js +144 -0
- package/services/local-inference/__stress__/cache-stress-helpers.d.ts +76 -0
- package/services/local-inference/__stress__/cache-stress-helpers.d.ts.map +1 -0
- package/services/local-inference/__stress__/cache-stress-helpers.js +238 -0
- package/services/local-inference/active-model.d.ts +180 -0
- package/services/local-inference/active-model.d.ts.map +1 -0
- package/services/local-inference/active-model.js +362 -0
- package/services/local-inference/assignments.d.ts +58 -0
- package/services/local-inference/assignments.d.ts.map +1 -0
- package/services/local-inference/assignments.js +179 -0
- package/services/local-inference/backend.d.ts +200 -0
- package/services/local-inference/backend.d.ts.map +1 -0
- package/services/local-inference/backend.js +242 -0
- package/services/local-inference/bundled-models.d.ts +34 -0
- package/services/local-inference/bundled-models.d.ts.map +1 -0
- package/services/local-inference/bundled-models.js +104 -0
- package/services/local-inference/cache-bridge.d.ts +184 -0
- package/services/local-inference/cache-bridge.d.ts.map +1 -0
- package/services/local-inference/cache-bridge.js +333 -0
- package/services/local-inference/catalog.d.ts +57 -0
- package/services/local-inference/catalog.d.ts.map +1 -0
- package/services/local-inference/catalog.js +262 -0
- package/services/local-inference/conversation-registry.d.ts +122 -0
- package/services/local-inference/conversation-registry.d.ts.map +1 -0
- package/services/local-inference/conversation-registry.js +182 -0
- package/services/local-inference/device-bridge.d.ts +139 -0
- package/services/local-inference/device-bridge.d.ts.map +1 -0
- package/services/local-inference/device-bridge.js +774 -0
- package/services/local-inference/dflash-doctor.d.ts +27 -0
- package/services/local-inference/dflash-doctor.d.ts.map +1 -0
- package/services/local-inference/dflash-doctor.js +149 -0
- package/services/local-inference/dflash-server.d.ts +248 -0
- package/services/local-inference/dflash-server.d.ts.map +1 -0
- package/services/local-inference/dflash-server.js +1076 -0
- package/services/local-inference/downloader.d.ts +48 -0
- package/services/local-inference/downloader.d.ts.map +1 -0
- package/services/local-inference/downloader.js +688 -0
- package/services/local-inference/engine.d.ts +282 -0
- package/services/local-inference/engine.d.ts.map +1 -0
- package/services/local-inference/engine.js +743 -0
- package/services/local-inference/external-scanner.d.ts +17 -0
- package/services/local-inference/external-scanner.d.ts.map +1 -0
- package/services/local-inference/external-scanner.js +261 -0
- package/services/local-inference/handler-registry.d.ts +72 -0
- package/services/local-inference/handler-registry.d.ts.map +1 -0
- package/services/local-inference/handler-registry.js +159 -0
- package/services/local-inference/hardware.d.ts +26 -0
- package/services/local-inference/hardware.d.ts.map +1 -0
- package/services/local-inference/hardware.js +139 -0
- package/services/local-inference/hf-search.d.ts +19 -0
- package/services/local-inference/hf-search.d.ts.map +1 -0
- package/services/local-inference/hf-search.js +169 -0
- package/services/local-inference/index.d.ts +10 -0
- package/services/local-inference/index.d.ts.map +1 -0
- package/services/local-inference/index.js +7 -0
- package/services/local-inference/llama-server-metrics.d.ts +108 -0
- package/services/local-inference/llama-server-metrics.d.ts.map +1 -0
- package/services/local-inference/llama-server-metrics.js +175 -0
- package/services/local-inference/manifest/index.d.ts +4 -0
- package/services/local-inference/manifest/index.d.ts.map +1 -0
- package/services/local-inference/manifest/index.js +5 -0
- package/services/local-inference/manifest/schema.d.ts +419 -0
- package/services/local-inference/manifest/schema.d.ts.map +1 -0
- package/services/local-inference/manifest/schema.js +227 -0
- package/services/local-inference/manifest/types.d.ts +23 -0
- package/services/local-inference/manifest/types.d.ts.map +1 -0
- package/services/local-inference/manifest/types.js +5 -0
- package/services/local-inference/manifest/validator.d.ts +43 -0
- package/services/local-inference/manifest/validator.d.ts.map +1 -0
- package/services/local-inference/manifest/validator.js +180 -0
- package/services/local-inference/paths.d.ts +8 -0
- package/services/local-inference/paths.d.ts.map +1 -0
- package/services/local-inference/paths.js +7 -0
- package/services/local-inference/providers.d.ts +61 -0
- package/services/local-inference/providers.d.ts.map +1 -0
- package/services/local-inference/providers.js +334 -0
- package/services/local-inference/ram-budget.d.ts +57 -0
- package/services/local-inference/ram-budget.d.ts.map +1 -0
- package/services/local-inference/ram-budget.js +107 -0
- package/services/local-inference/readiness.d.ts +9 -0
- package/services/local-inference/readiness.d.ts.map +1 -0
- package/services/local-inference/readiness.js +153 -0
- package/services/local-inference/recommendation.d.ts +62 -0
- package/services/local-inference/recommendation.d.ts.map +1 -0
- package/services/local-inference/recommendation.js +309 -0
- package/services/local-inference/registry.d.ts +35 -0
- package/services/local-inference/registry.d.ts.map +1 -0
- package/services/local-inference/registry.js +117 -0
- package/services/local-inference/router-handler.d.ts +51 -0
- package/services/local-inference/router-handler.d.ts.map +1 -0
- package/services/local-inference/router-handler.js +165 -0
- package/services/local-inference/routing-policy.d.ts +55 -0
- package/services/local-inference/routing-policy.d.ts.map +1 -0
- package/services/local-inference/routing-policy.js +195 -0
- package/services/local-inference/routing-preferences.d.ts +8 -0
- package/services/local-inference/routing-preferences.d.ts.map +1 -0
- package/services/local-inference/routing-preferences.js +7 -0
- package/services/local-inference/service.d.ts +88 -0
- package/services/local-inference/service.d.ts.map +1 -0
- package/services/local-inference/service.js +210 -0
- package/services/local-inference/session-pool.d.ts +72 -0
- package/services/local-inference/session-pool.d.ts.map +1 -0
- package/services/local-inference/session-pool.js +125 -0
- package/services/local-inference/types.d.ts +309 -0
- package/services/local-inference/types.d.ts.map +1 -0
- package/services/local-inference/types.js +23 -0
- package/services/local-inference/verify.d.ts +8 -0
- package/services/local-inference/verify.d.ts.map +1 -0
- package/services/local-inference/verify.js +7 -0
- package/services/local-inference/voice/barge-in.d.ts +15 -0
- package/services/local-inference/voice/barge-in.d.ts.map +1 -0
- package/services/local-inference/voice/barge-in.js +20 -0
- package/services/local-inference/voice/engine-bridge.d.ts +256 -0
- package/services/local-inference/voice/engine-bridge.d.ts.map +1 -0
- package/services/local-inference/voice/engine-bridge.js +398 -0
- package/services/local-inference/voice/ffi-bindings.d.ts +114 -0
- package/services/local-inference/voice/ffi-bindings.d.ts.map +1 -0
- package/services/local-inference/voice/ffi-bindings.js +281 -0
- package/services/local-inference/voice/index.d.ts +51 -0
- package/services/local-inference/voice/index.d.ts.map +1 -0
- package/services/local-inference/voice/index.js +50 -0
- package/services/local-inference/voice/lifecycle.d.ts +135 -0
- package/services/local-inference/voice/lifecycle.d.ts.map +1 -0
- package/services/local-inference/voice/lifecycle.js +189 -0
- package/services/local-inference/voice/phoneme-tokenizer.d.ts +58 -0
- package/services/local-inference/voice/phoneme-tokenizer.d.ts.map +1 -0
- package/services/local-inference/voice/phoneme-tokenizer.js +53 -0
- package/services/local-inference/voice/phrase-cache.d.ts +24 -0
- package/services/local-inference/voice/phrase-cache.d.ts.map +1 -0
- package/services/local-inference/voice/phrase-cache.js +32 -0
- package/services/local-inference/voice/phrase-chunker.d.ts +20 -0
- package/services/local-inference/voice/phrase-chunker.d.ts.map +1 -0
- package/services/local-inference/voice/phrase-chunker.js +85 -0
- package/services/local-inference/voice/ring-buffer.d.ts +40 -0
- package/services/local-inference/voice/ring-buffer.d.ts.map +1 -0
- package/services/local-inference/voice/ring-buffer.js +85 -0
- package/services/local-inference/voice/rollback-queue.d.ts +24 -0
- package/services/local-inference/voice/rollback-queue.d.ts.map +1 -0
- package/services/local-inference/voice/rollback-queue.js +49 -0
- package/services/local-inference/voice/scheduler.d.ts +47 -0
- package/services/local-inference/voice/scheduler.d.ts.map +1 -0
- package/services/local-inference/voice/scheduler.js +123 -0
- package/services/local-inference/voice/shared-resources.d.ts +119 -0
- package/services/local-inference/voice/shared-resources.d.ts.map +1 -0
- package/services/local-inference/voice/shared-resources.js +83 -0
- package/services/local-inference/voice/speaker-preset-cache.d.ts +28 -0
- package/services/local-inference/voice/speaker-preset-cache.d.ts.map +1 -0
- package/services/local-inference/voice/speaker-preset-cache.js +44 -0
- package/services/local-inference/voice/types.d.ts +80 -0
- package/services/local-inference/voice/types.d.ts.map +1 -0
- package/services/local-inference/voice/voice-preset-format.d.ts +56 -0
- package/services/local-inference/voice/voice-preset-format.d.ts.map +1 -0
- package/services/local-inference/voice/voice-preset-format.js +184 -0
- package/services/persistence.d.ts +48 -0
- package/services/persistence.d.ts.map +1 -0
- package/services/persistence.js +128 -0
- package/services/plugin-installer.d.ts +22 -0
- package/services/plugin-installer.d.ts.map +1 -0
- package/services/plugin-installer.js +41 -0
- package/services/secrets-manager-installer.d.ts +140 -0
- package/services/secrets-manager-installer.d.ts.map +1 -0
- package/services/secrets-manager-installer.js +374 -0
- package/services/steward-credentials.d.ts +37 -0
- package/services/steward-credentials.d.ts.map +1 -0
- package/services/steward-credentials.js +93 -0
- package/services/steward-sidecar/health-check.d.ts +9 -0
- package/services/steward-sidecar/health-check.d.ts.map +1 -0
- package/services/steward-sidecar/health-check.js +34 -0
- package/services/steward-sidecar/helpers.d.ts +21 -0
- package/services/steward-sidecar/helpers.d.ts.map +1 -0
- package/services/steward-sidecar/helpers.js +71 -0
- package/services/steward-sidecar/process-management.d.ts +9 -0
- package/services/steward-sidecar/process-management.d.ts.map +1 -0
- package/services/steward-sidecar/process-management.js +53 -0
- package/services/steward-sidecar/types.d.ts +60 -0
- package/services/steward-sidecar/types.d.ts.map +1 -0
- package/services/steward-sidecar/types.js +17 -0
- package/services/steward-sidecar/wallet-setup.d.ts +9 -0
- package/services/steward-sidecar/wallet-setup.d.ts.map +1 -0
- package/services/steward-sidecar/wallet-setup.js +114 -0
- package/services/steward-sidecar.d.ts +70 -0
- package/services/steward-sidecar.d.ts.map +1 -0
- package/services/steward-sidecar.js +385 -0
- package/services/tool-call-cache/index.d.ts +13 -0
- package/services/tool-call-cache/index.d.ts.map +1 -0
- package/services/tool-call-cache/index.js +11 -0
- package/services/trigger-event-bridge.d.ts +52 -0
- package/services/trigger-event-bridge.d.ts.map +1 -0
- package/services/trigger-event-bridge.js +217 -0
- package/services/update-notifier.d.ts +6 -0
- package/services/update-notifier.d.ts.map +1 -0
- package/services/update-notifier.js +33 -0
- package/services/vault-bootstrap.d.ts +31 -0
- package/services/vault-bootstrap.d.ts.map +1 -0
- package/services/vault-bootstrap.js +209 -0
- package/services/vault-mirror.d.ts +44 -0
- package/services/vault-mirror.d.ts.map +1 -0
- package/services/vault-mirror.js +80 -0
- package/styles/electrobun-mac-window-drag.css +66 -0
- package/test/helpers/__tests__/live-agent-test.smoke.test.ts +105 -0
- package/test/helpers/action-assertions.ts +364 -0
- package/test/helpers/action-spy.ts +354 -0
- package/test/helpers/browser-launch.ts +103 -0
- package/test/helpers/browser-mocks.ts +275 -0
- package/test/helpers/conditional-tests.ts +42 -0
- package/test/helpers/conversation-harness.ts +334 -0
- package/test/helpers/http.ts +150 -0
- package/test/helpers/i18n.ts +5 -0
- package/test/helpers/isolated-config.ts +34 -0
- package/test/helpers/live-agent-test.ts +660 -0
- package/test/helpers/live-child-env.ts +72 -0
- package/test/helpers/live-provider.test.ts +124 -0
- package/test/helpers/live-provider.ts +362 -0
- package/test/helpers/live-runtime-server.ts +88 -0
- package/test/helpers/loopback.ts +33 -0
- package/test/helpers/pglite-runtime.ts +173 -0
- package/test/helpers/react-test.ts +40 -0
- package/test/helpers/real-connector.ts +250 -0
- package/test/helpers/real-runtime.ts +543 -0
- package/test/helpers/skip-without.ts +53 -0
- package/test/helpers/stochastic-test.ts +186 -0
- package/test/helpers/test-utils.ts +94 -0
- package/test/helpers/trajectory-assertions.ts +168 -0
- package/test/helpers/trajectory-harness.test.ts +101 -0
- package/test/helpers/trajectory-harness.ts +988 -0
- package/test/scripts/managed-test-command.mjs +632 -0
- package/test/scripts/task-agent-live-smoke.ts +1335 -0
- package/test/scripts/test-parallel.mjs +237 -0
- package/test/scripts/test-root-unit.mjs +169 -0
- package/test/scripts/test-runner.mjs +78 -0
- package/test/scripts/validate-all-features.sh +541 -0
- package/test-support/test-helpers.d.ts +111 -0
- package/test-support/test-helpers.d.ts.map +1 -0
- package/test-support/test-helpers.js +410 -0
- package/ui-compat.d.ts +3 -0
- package/ui-compat.d.ts.map +1 -0
- package/ui-compat.js +3 -0
- package/utils/eliza-root.d.ts +9 -0
- package/utils/eliza-root.d.ts.map +1 -0
- package/utils/eliza-root.js +101 -0
- package/utils/globals.d.ts +7 -0
- package/utils/globals.d.ts.map +1 -0
- package/utils/globals.js +47 -0
- package/App.d.ts +0 -5
- package/App.d.ts.map +0 -1
- package/App.js +0 -220
- package/LICENSE +0 -21
- package/actions/character.d.ts +0 -39
- package/actions/character.d.ts.map +0 -1
- package/actions/character.js +0 -247
- package/actions/chat-helpers.d.ts +0 -47
- package/actions/chat-helpers.d.ts.map +0 -1
- package/actions/chat-helpers.js +0 -79
- package/actions/cloud.d.ts +0 -17
- package/actions/cloud.d.ts.map +0 -1
- package/actions/cloud.js +0 -43
- package/actions/index.d.ts +0 -12
- package/actions/index.d.ts.map +0 -1
- package/actions/index.js +0 -11
- package/actions/lifecycle.d.ts +0 -43
- package/actions/lifecycle.d.ts.map +0 -1
- package/actions/lifecycle.js +0 -118
- package/actions/onboarding.d.ts +0 -13
- package/actions/onboarding.d.ts.map +0 -1
- package/actions/onboarding.js +0 -26
- package/actions/triggers.d.ts +0 -23
- package/actions/triggers.d.ts.map +0 -1
- package/actions/triggers.js +0 -148
- package/api/client.d.ts +0 -2742
- package/api/client.d.ts.map +0 -1
- package/api/client.js +0 -2520
- package/api/index.d.ts +0 -2
- package/api/index.d.ts.map +0 -1
- package/api/index.js +0 -1
- package/autonomy/index.d.ts +0 -48
- package/autonomy/index.d.ts.map +0 -1
- package/autonomy/index.js +0 -330
- package/bridge/capacitor-bridge.d.ts +0 -153
- package/bridge/capacitor-bridge.d.ts.map +0 -1
- package/bridge/capacitor-bridge.js +0 -193
- package/bridge/electrobun-rpc.d.ts +0 -28
- package/bridge/electrobun-rpc.d.ts.map +0 -1
- package/bridge/electrobun-rpc.js +0 -35
- package/bridge/electrobun-runtime.d.ts +0 -3
- package/bridge/electrobun-runtime.d.ts.map +0 -1
- package/bridge/electrobun-runtime.js +0 -17
- package/bridge/index.d.ts +0 -6
- package/bridge/index.d.ts.map +0 -1
- package/bridge/index.js +0 -5
- package/bridge/native-plugins.d.ts +0 -82
- package/bridge/native-plugins.d.ts.map +0 -1
- package/bridge/native-plugins.js +0 -39
- package/bridge/plugin-bridge.d.ts +0 -116
- package/bridge/plugin-bridge.d.ts.map +0 -1
- package/bridge/plugin-bridge.js +0 -203
- package/bridge/storage-bridge.d.ts +0 -39
- package/bridge/storage-bridge.d.ts.map +0 -1
- package/bridge/storage-bridge.js +0 -135
- package/chat/index.d.ts +0 -57
- package/chat/index.d.ts.map +0 -1
- package/chat/index.js +0 -160
- package/coding/index.d.ts +0 -25
- package/coding/index.d.ts.map +0 -1
- package/coding/index.js +0 -25
- package/components/AdvancedPageView.d.ts +0 -17
- package/components/AdvancedPageView.d.ts.map +0 -1
- package/components/AdvancedPageView.js +0 -146
- package/components/AgentActivityBox.d.ts +0 -7
- package/components/AgentActivityBox.d.ts.map +0 -1
- package/components/AgentActivityBox.js +0 -25
- package/components/ApiKeyConfig.d.ts +0 -26
- package/components/ApiKeyConfig.d.ts.map +0 -1
- package/components/ApiKeyConfig.js +0 -119
- package/components/AppsPageView.d.ts +0 -7
- package/components/AppsPageView.d.ts.map +0 -1
- package/components/AppsPageView.js +0 -31
- package/components/AppsView.d.ts +0 -8
- package/components/AppsView.d.ts.map +0 -1
- package/components/AppsView.js +0 -149
- package/components/AvatarLoader.d.ts +0 -13
- package/components/AvatarLoader.d.ts.map +0 -1
- package/components/AvatarLoader.js +0 -53
- package/components/AvatarSelector.d.ts +0 -23
- package/components/AvatarSelector.d.ts.map +0 -1
- package/components/AvatarSelector.js +0 -105
- package/components/BscTradePanel.d.ts +0 -22
- package/components/BscTradePanel.d.ts.map +0 -1
- package/components/BscTradePanel.js +0 -221
- package/components/BugReportModal.d.ts +0 -2
- package/components/BugReportModal.d.ts.map +0 -1
- package/components/BugReportModal.js +0 -219
- package/components/CharacterRoster.d.ts +0 -31
- package/components/CharacterRoster.d.ts.map +0 -1
- package/components/CharacterRoster.js +0 -41
- package/components/CharacterView.d.ts +0 -8
- package/components/CharacterView.d.ts.map +0 -1
- package/components/CharacterView.js +0 -685
- package/components/ChatAvatar.d.ts +0 -8
- package/components/ChatAvatar.d.ts.map +0 -1
- package/components/ChatAvatar.js +0 -89
- package/components/ChatComposer.d.ts +0 -37
- package/components/ChatComposer.d.ts.map +0 -1
- package/components/ChatComposer.js +0 -136
- package/components/ChatMessage.d.ts +0 -24
- package/components/ChatMessage.d.ts.map +0 -1
- package/components/ChatMessage.js +0 -187
- package/components/ChatModalView.d.ts +0 -10
- package/components/ChatModalView.d.ts.map +0 -1
- package/components/ChatModalView.js +0 -57
- package/components/ChatView.d.ts +0 -14
- package/components/ChatView.d.ts.map +0 -1
- package/components/ChatView.js +0 -526
- package/components/CloudOnboarding.d.ts +0 -7
- package/components/CloudOnboarding.d.ts.map +0 -1
- package/components/CloudOnboarding.js +0 -22
- package/components/CloudSourceControls.d.ts +0 -13
- package/components/CloudSourceControls.d.ts.map +0 -1
- package/components/CloudSourceControls.js +0 -16
- package/components/CodingAgentSettingsSection.d.ts +0 -8
- package/components/CodingAgentSettingsSection.d.ts.map +0 -1
- package/components/CodingAgentSettingsSection.js +0 -292
- package/components/CommandPalette.d.ts +0 -2
- package/components/CommandPalette.d.ts.map +0 -1
- package/components/CommandPalette.js +0 -181
- package/components/CompanionSceneHost.d.ts +0 -14
- package/components/CompanionSceneHost.d.ts.map +0 -1
- package/components/CompanionSceneHost.js +0 -362
- package/components/CompanionShell.d.ts +0 -17
- package/components/CompanionShell.d.ts.map +0 -1
- package/components/CompanionShell.js +0 -15
- package/components/CompanionView.d.ts +0 -2
- package/components/CompanionView.d.ts.map +0 -1
- package/components/CompanionView.js +0 -22
- package/components/ConfigPageView.d.ts +0 -11
- package/components/ConfigPageView.d.ts.map +0 -1
- package/components/ConfigPageView.js +0 -311
- package/components/ConfigSaveFooter.d.ts +0 -8
- package/components/ConfigSaveFooter.d.ts.map +0 -1
- package/components/ConfigSaveFooter.js +0 -10
- package/components/ConfirmModal.d.ts +0 -61
- package/components/ConfirmModal.d.ts.map +0 -1
- package/components/ConfirmModal.js +0 -164
- package/components/ConnectionFailedBanner.d.ts +0 -6
- package/components/ConnectionFailedBanner.d.ts.map +0 -1
- package/components/ConnectionFailedBanner.js +0 -22
- package/components/ConnectorsPageView.d.ts +0 -7
- package/components/ConnectorsPageView.d.ts.map +0 -1
- package/components/ConnectorsPageView.js +0 -8
- package/components/ConversationsSidebar.d.ts +0 -9
- package/components/ConversationsSidebar.d.ts.map +0 -1
- package/components/ConversationsSidebar.js +0 -116
- package/components/CustomActionEditor.d.ts +0 -10
- package/components/CustomActionEditor.d.ts.map +0 -1
- package/components/CustomActionEditor.js +0 -596
- package/components/CustomActionsPanel.d.ts +0 -9
- package/components/CustomActionsPanel.d.ts.map +0 -1
- package/components/CustomActionsPanel.js +0 -107
- package/components/CustomActionsView.d.ts +0 -2
- package/components/CustomActionsView.d.ts.map +0 -1
- package/components/CustomActionsView.js +0 -134
- package/components/DatabasePageView.d.ts +0 -5
- package/components/DatabasePageView.d.ts.map +0 -1
- package/components/DatabasePageView.js +0 -28
- package/components/DatabaseView.d.ts +0 -9
- package/components/DatabaseView.d.ts.map +0 -1
- package/components/DatabaseView.js +0 -311
- package/components/ElizaCloudDashboard.d.ts +0 -2
- package/components/ElizaCloudDashboard.d.ts.map +0 -1
- package/components/ElizaCloudDashboard.js +0 -657
- package/components/EmotePicker.d.ts +0 -2
- package/components/EmotePicker.d.ts.map +0 -1
- package/components/EmotePicker.js +0 -343
- package/components/ErrorBoundary.d.ts +0 -22
- package/components/ErrorBoundary.d.ts.map +0 -1
- package/components/ErrorBoundary.js +0 -31
- package/components/FineTuningView.d.ts +0 -2
- package/components/FineTuningView.d.ts.map +0 -1
- package/components/FineTuningView.js +0 -433
- package/components/FlaminaGuide.d.ts +0 -10
- package/components/FlaminaGuide.d.ts.map +0 -1
- package/components/FlaminaGuide.js +0 -64
- package/components/GameView.d.ts +0 -11
- package/components/GameView.d.ts.map +0 -1
- package/components/GameView.js +0 -294
- package/components/GameViewOverlay.d.ts +0 -8
- package/components/GameViewOverlay.d.ts.map +0 -1
- package/components/GameViewOverlay.js +0 -70
- package/components/GlobalEmoteOverlay.d.ts +0 -2
- package/components/GlobalEmoteOverlay.d.ts.map +0 -1
- package/components/GlobalEmoteOverlay.js +0 -112
- package/components/Header.d.ts +0 -9
- package/components/Header.d.ts.map +0 -1
- package/components/Header.js +0 -123
- package/components/HeartbeatsView.d.ts +0 -2
- package/components/HeartbeatsView.d.ts.map +0 -1
- package/components/HeartbeatsView.js +0 -378
- package/components/InventoryView.d.ts +0 -10
- package/components/InventoryView.d.ts.map +0 -1
- package/components/InventoryView.js +0 -176
- package/components/KnowledgeView.d.ts +0 -20
- package/components/KnowledgeView.d.ts.map +0 -1
- package/components/KnowledgeView.js +0 -483
- package/components/LanguageDropdown.d.ts +0 -30
- package/components/LanguageDropdown.d.ts.map +0 -1
- package/components/LanguageDropdown.js +0 -99
- package/components/LifoMonitorPanel.d.ts +0 -21
- package/components/LifoMonitorPanel.d.ts.map +0 -1
- package/components/LifoMonitorPanel.js +0 -24
- package/components/LifoSandboxView.d.ts +0 -5
- package/components/LifoSandboxView.d.ts.map +0 -1
- package/components/LifoSandboxView.js +0 -333
- package/components/LoadingScreen.d.ts +0 -13
- package/components/LoadingScreen.d.ts.map +0 -1
- package/components/LoadingScreen.js +0 -70
- package/components/LogsPageView.d.ts +0 -2
- package/components/LogsPageView.d.ts.map +0 -1
- package/components/LogsPageView.js +0 -7
- package/components/LogsView.d.ts +0 -5
- package/components/LogsView.d.ts.map +0 -1
- package/components/LogsView.js +0 -71
- package/components/MediaGalleryView.d.ts +0 -9
- package/components/MediaGalleryView.d.ts.map +0 -1
- package/components/MediaGalleryView.js +0 -236
- package/components/MediaSettingsSection.d.ts +0 -11
- package/components/MediaSettingsSection.d.ts.map +0 -1
- package/components/MediaSettingsSection.js +0 -329
- package/components/MessageContent.d.ts +0 -51
- package/components/MessageContent.d.ts.map +0 -1
- package/components/MessageContent.js +0 -553
- package/components/OnboardingWizard.d.ts +0 -2
- package/components/OnboardingWizard.d.ts.map +0 -1
- package/components/OnboardingWizard.js +0 -86
- package/components/PairingView.d.ts +0 -5
- package/components/PairingView.d.ts.map +0 -1
- package/components/PairingView.js +0 -29
- package/components/PermissionsSection.d.ts +0 -20
- package/components/PermissionsSection.d.ts.map +0 -1
- package/components/PermissionsSection.js +0 -573
- package/components/PluginsPageView.d.ts +0 -5
- package/components/PluginsPageView.d.ts.map +0 -1
- package/components/PluginsPageView.js +0 -8
- package/components/PluginsView.d.ts +0 -21
- package/components/PluginsView.d.ts.map +0 -1
- package/components/PluginsView.js +0 -1534
- package/components/ProviderSwitcher.d.ts +0 -42
- package/components/ProviderSwitcher.d.ts.map +0 -1
- package/components/ProviderSwitcher.js +0 -493
- package/components/RestartBanner.d.ts +0 -2
- package/components/RestartBanner.d.ts.map +0 -1
- package/components/RestartBanner.js +0 -36
- package/components/RuntimeView.d.ts +0 -10
- package/components/RuntimeView.d.ts.map +0 -1
- package/components/RuntimeView.js +0 -165
- package/components/SaveCommandModal.d.ts +0 -12
- package/components/SaveCommandModal.d.ts.map +0 -1
- package/components/SaveCommandModal.js +0 -84
- package/components/SecretsView.d.ts +0 -9
- package/components/SecretsView.d.ts.map +0 -1
- package/components/SecretsView.js +0 -249
- package/components/SettingsView.d.ts +0 -9
- package/components/SettingsView.d.ts.map +0 -1
- package/components/SettingsView.js +0 -230
- package/components/ShellOverlays.d.ts +0 -8
- package/components/ShellOverlays.d.ts.map +0 -1
- package/components/ShellOverlays.js +0 -10
- package/components/ShortcutsOverlay.d.ts +0 -2
- package/components/ShortcutsOverlay.d.ts.map +0 -1
- package/components/ShortcutsOverlay.js +0 -79
- package/components/SkillsView.d.ts +0 -11
- package/components/SkillsView.d.ts.map +0 -1
- package/components/SkillsView.js +0 -358
- package/components/StartupFailureView.d.ts +0 -8
- package/components/StartupFailureView.d.ts.map +0 -1
- package/components/StartupFailureView.js +0 -16
- package/components/StreamView.d.ts +0 -16
- package/components/StreamView.d.ts.map +0 -1
- package/components/StreamView.js +0 -300
- package/components/StripeEmbeddedCheckout.d.ts +0 -24
- package/components/StripeEmbeddedCheckout.d.ts.map +0 -1
- package/components/StripeEmbeddedCheckout.js +0 -101
- package/components/SubscriptionStatus.d.ts +0 -23
- package/components/SubscriptionStatus.d.ts.map +0 -1
- package/components/SubscriptionStatus.js +0 -301
- package/components/SystemWarningBanner.d.ts +0 -6
- package/components/SystemWarningBanner.d.ts.map +0 -1
- package/components/SystemWarningBanner.js +0 -46
- package/components/ThemeToggle.d.ts +0 -21
- package/components/ThemeToggle.d.ts.map +0 -1
- package/components/ThemeToggle.js +0 -24
- package/components/TrajectoriesView.d.ts +0 -12
- package/components/TrajectoriesView.d.ts.map +0 -1
- package/components/TrajectoriesView.js +0 -183
- package/components/TrajectoryDetailView.d.ts +0 -13
- package/components/TrajectoryDetailView.d.ts.map +0 -1
- package/components/TrajectoryDetailView.js +0 -112
- package/components/TriggersView.d.ts +0 -2
- package/components/TriggersView.d.ts.map +0 -1
- package/components/TriggersView.js +0 -1
- package/components/VectorBrowserView.d.ts +0 -10
- package/components/VectorBrowserView.d.ts.map +0 -1
- package/components/VectorBrowserView.js +0 -1000
- package/components/VoiceConfigView.d.ts +0 -11
- package/components/VoiceConfigView.d.ts.map +0 -1
- package/components/VoiceConfigView.js +0 -331
- package/components/VrmStage.d.ts +0 -28
- package/components/VrmStage.d.ts.map +0 -1
- package/components/VrmStage.js +0 -178
- package/components/WhatsAppQrOverlay.d.ts +0 -8
- package/components/WhatsAppQrOverlay.d.ts.map +0 -1
- package/components/WhatsAppQrOverlay.js +0 -63
- package/components/apps/AppDetailPane.d.ts +0 -15
- package/components/apps/AppDetailPane.d.ts.map +0 -1
- package/components/apps/AppDetailPane.js +0 -13
- package/components/apps/AppsCatalogGrid.d.ts +0 -20
- package/components/apps/AppsCatalogGrid.d.ts.map +0 -1
- package/components/apps/AppsCatalogGrid.js +0 -18
- package/components/apps/extensions/registry.d.ts +0 -4
- package/components/apps/extensions/registry.d.ts.map +0 -1
- package/components/apps/extensions/registry.js +0 -7
- package/components/apps/extensions/types.d.ts +0 -7
- package/components/apps/extensions/types.d.ts.map +0 -1
- package/components/apps/helpers.d.ts +0 -7
- package/components/apps/helpers.d.ts.map +0 -1
- package/components/apps/helpers.js +0 -44
- package/components/avatar/VrmAnimationLoader.d.ts +0 -30
- package/components/avatar/VrmAnimationLoader.d.ts.map +0 -1
- package/components/avatar/VrmAnimationLoader.js +0 -99
- package/components/avatar/VrmBlinkController.d.ts +0 -37
- package/components/avatar/VrmBlinkController.d.ts.map +0 -1
- package/components/avatar/VrmBlinkController.js +0 -98
- package/components/avatar/VrmCameraManager.d.ts +0 -57
- package/components/avatar/VrmCameraManager.d.ts.map +0 -1
- package/components/avatar/VrmCameraManager.js +0 -277
- package/components/avatar/VrmEngine.d.ts +0 -246
- package/components/avatar/VrmEngine.d.ts.map +0 -1
- package/components/avatar/VrmEngine.js +0 -2087
- package/components/avatar/VrmFootShadow.d.ts +0 -18
- package/components/avatar/VrmFootShadow.d.ts.map +0 -1
- package/components/avatar/VrmFootShadow.js +0 -83
- package/components/avatar/VrmViewer.d.ts +0 -60
- package/components/avatar/VrmViewer.d.ts.map +0 -1
- package/components/avatar/VrmViewer.js +0 -396
- package/components/avatar/mixamoVRMRigMap.d.ts +0 -3
- package/components/avatar/mixamoVRMRigMap.d.ts.map +0 -1
- package/components/avatar/mixamoVRMRigMap.js +0 -56
- package/components/avatar/retargetMixamoFbxToVrm.d.ts +0 -9
- package/components/avatar/retargetMixamoFbxToVrm.d.ts.map +0 -1
- package/components/avatar/retargetMixamoFbxToVrm.js +0 -88
- package/components/avatar/retargetMixamoGltfToVrm.d.ts +0 -11
- package/components/avatar/retargetMixamoGltfToVrm.d.ts.map +0 -1
- package/components/avatar/retargetMixamoGltfToVrm.js +0 -80
- package/components/chainConfig.d.ts +0 -89
- package/components/chainConfig.d.ts.map +0 -1
- package/components/chainConfig.js +0 -287
- package/components/companion/CompanionHeader.d.ts +0 -15
- package/components/companion/CompanionHeader.d.ts.map +0 -1
- package/components/companion/CompanionHeader.js +0 -7
- package/components/companion/CompanionSceneHost.d.ts +0 -2
- package/components/companion/CompanionSceneHost.d.ts.map +0 -1
- package/components/companion/CompanionSceneHost.js +0 -1
- package/components/companion/VrmStage.d.ts +0 -3
- package/components/companion/VrmStage.d.ts.map +0 -1
- package/components/companion/VrmStage.js +0 -1
- package/components/companion/index.d.ts +0 -18
- package/components/companion/index.d.ts.map +0 -1
- package/components/companion/index.js +0 -17
- package/components/companion/walletUtils.d.ts +0 -95
- package/components/companion/walletUtils.d.ts.map +0 -1
- package/components/companion/walletUtils.js +0 -167
- package/components/companion-shell-styles.d.ts +0 -38
- package/components/companion-shell-styles.d.ts.map +0 -1
- package/components/companion-shell-styles.js +0 -248
- package/components/confirm-delete-control.d.ts +0 -16
- package/components/confirm-delete-control.d.ts.map +0 -1
- package/components/confirm-delete-control.js +0 -12
- package/components/conversations/ConversationListItem.d.ts +0 -31
- package/components/conversations/ConversationListItem.d.ts.map +0 -1
- package/components/conversations/ConversationListItem.js +0 -52
- package/components/conversations/conversation-utils.d.ts +0 -9
- package/components/conversations/conversation-utils.d.ts.map +0 -1
- package/components/conversations/conversation-utils.js +0 -138
- package/components/format.d.ts +0 -54
- package/components/format.d.ts.map +0 -1
- package/components/format.js +0 -82
- package/components/index.d.ts +0 -96
- package/components/index.d.ts.map +0 -1
- package/components/index.js +0 -95
- package/components/inventory/CopyableAddress.d.ts +0 -8
- package/components/inventory/CopyableAddress.d.ts.map +0 -1
- package/components/inventory/CopyableAddress.js +0 -18
- package/components/inventory/InventoryToolbar.d.ts +0 -25
- package/components/inventory/InventoryToolbar.d.ts.map +0 -1
- package/components/inventory/InventoryToolbar.js +0 -28
- package/components/inventory/NftGrid.d.ts +0 -13
- package/components/inventory/NftGrid.d.ts.map +0 -1
- package/components/inventory/NftGrid.js +0 -29
- package/components/inventory/TokenLogo.d.ts +0 -12
- package/components/inventory/TokenLogo.d.ts.map +0 -1
- package/components/inventory/TokenLogo.js +0 -33
- package/components/inventory/TokensTable.d.ts +0 -24
- package/components/inventory/TokensTable.d.ts.map +0 -1
- package/components/inventory/TokensTable.js +0 -26
- package/components/inventory/constants.d.ts +0 -52
- package/components/inventory/constants.d.ts.map +0 -1
- package/components/inventory/constants.js +0 -121
- package/components/inventory/index.d.ts +0 -9
- package/components/inventory/index.d.ts.map +0 -1
- package/components/inventory/index.js +0 -8
- package/components/inventory/media-url.d.ts +0 -6
- package/components/inventory/media-url.d.ts.map +0 -1
- package/components/inventory/media-url.js +0 -28
- package/components/inventory/useInventoryData.d.ts +0 -53
- package/components/inventory/useInventoryData.d.ts.map +0 -1
- package/components/inventory/useInventoryData.js +0 -332
- package/components/knowledge-upload-image.d.ts +0 -27
- package/components/knowledge-upload-image.d.ts.map +0 -1
- package/components/knowledge-upload-image.js +0 -146
- package/components/labels.d.ts +0 -6
- package/components/labels.d.ts.map +0 -1
- package/components/labels.js +0 -40
- package/components/onboarding/ActivateStep.d.ts +0 -2
- package/components/onboarding/ActivateStep.d.ts.map +0 -1
- package/components/onboarding/ActivateStep.js +0 -10
- package/components/onboarding/CloudLoginStep.d.ts +0 -2
- package/components/onboarding/CloudLoginStep.d.ts.map +0 -1
- package/components/onboarding/CloudLoginStep.js +0 -20
- package/components/onboarding/ConnectionStep.d.ts +0 -2
- package/components/onboarding/ConnectionStep.d.ts.map +0 -1
- package/components/onboarding/ConnectionStep.js +0 -609
- package/components/onboarding/IdentityStep.d.ts +0 -2
- package/components/onboarding/IdentityStep.d.ts.map +0 -1
- package/components/onboarding/IdentityStep.js +0 -102
- package/components/onboarding/OnboardingPanel.d.ts +0 -9
- package/components/onboarding/OnboardingPanel.d.ts.map +0 -1
- package/components/onboarding/OnboardingPanel.js +0 -24
- package/components/onboarding/OnboardingStepNav.d.ts +0 -2
- package/components/onboarding/OnboardingStepNav.d.ts.map +0 -1
- package/components/onboarding/OnboardingStepNav.js +0 -24
- package/components/onboarding/PermissionsStep.d.ts +0 -2
- package/components/onboarding/PermissionsStep.d.ts.map +0 -1
- package/components/onboarding/PermissionsStep.js +0 -7
- package/components/onboarding/RpcStep.d.ts +0 -2
- package/components/onboarding/RpcStep.d.ts.map +0 -1
- package/components/onboarding/RpcStep.js +0 -125
- package/components/onboarding/SaveKeysStep.d.ts +0 -2
- package/components/onboarding/SaveKeysStep.d.ts.map +0 -1
- package/components/onboarding/SaveKeysStep.js +0 -44
- package/components/onboarding/WelcomeStep.d.ts +0 -2
- package/components/onboarding/WelcomeStep.d.ts.map +0 -1
- package/components/onboarding/WelcomeStep.js +0 -30
- package/components/permissions/PermissionIcon.d.ts +0 -4
- package/components/permissions/PermissionIcon.d.ts.map +0 -1
- package/components/permissions/PermissionIcon.js +0 -12
- package/components/permissions/StreamingPermissions.d.ts +0 -20
- package/components/permissions/StreamingPermissions.d.ts.map +0 -1
- package/components/permissions/StreamingPermissions.js +0 -178
- package/components/plugins/showcase-data.d.ts +0 -7
- package/components/plugins/showcase-data.d.ts.map +0 -1
- package/components/plugins/showcase-data.js +0 -464
- package/components/shared/ShellHeaderControls.d.ts +0 -27
- package/components/shared/ShellHeaderControls.d.ts.map +0 -1
- package/components/shared/ShellHeaderControls.js +0 -55
- package/components/shared-companion-scene-context.d.ts +0 -3
- package/components/shared-companion-scene-context.d.ts.map +0 -1
- package/components/shared-companion-scene-context.js +0 -13
- package/components/skeletons.d.ts +0 -17
- package/components/skeletons.d.ts.map +0 -1
- package/components/skeletons.js +0 -22
- package/components/stream/ActivityFeed.d.ts +0 -5
- package/components/stream/ActivityFeed.d.ts.map +0 -1
- package/components/stream/ActivityFeed.js +0 -57
- package/components/stream/AvatarPip.d.ts +0 -5
- package/components/stream/AvatarPip.d.ts.map +0 -1
- package/components/stream/AvatarPip.js +0 -6
- package/components/stream/ChatContent.d.ts +0 -6
- package/components/stream/ChatContent.d.ts.map +0 -1
- package/components/stream/ChatContent.js +0 -69
- package/components/stream/ChatTicker.d.ts +0 -5
- package/components/stream/ChatTicker.d.ts.map +0 -1
- package/components/stream/ChatTicker.js +0 -34
- package/components/stream/IdleContent.d.ts +0 -5
- package/components/stream/IdleContent.d.ts.map +0 -1
- package/components/stream/IdleContent.js +0 -17
- package/components/stream/StatusBar.d.ts +0 -36
- package/components/stream/StatusBar.d.ts.map +0 -1
- package/components/stream/StatusBar.js +0 -140
- package/components/stream/StreamSettings.d.ts +0 -33
- package/components/stream/StreamSettings.d.ts.map +0 -1
- package/components/stream/StreamSettings.js +0 -99
- package/components/stream/StreamTerminal.d.ts +0 -2
- package/components/stream/StreamTerminal.d.ts.map +0 -1
- package/components/stream/StreamTerminal.js +0 -52
- package/components/stream/StreamVoiceConfig.d.ts +0 -10
- package/components/stream/StreamVoiceConfig.d.ts.map +0 -1
- package/components/stream/StreamVoiceConfig.js +0 -88
- package/components/stream/helpers.d.ts +0 -32
- package/components/stream/helpers.d.ts.map +0 -1
- package/components/stream/helpers.js +0 -110
- package/components/stream/overlays/OverlayLayer.d.ts +0 -20
- package/components/stream/overlays/OverlayLayer.d.ts.map +0 -1
- package/components/stream/overlays/OverlayLayer.js +0 -24
- package/components/stream/overlays/built-in/ActionTickerWidget.d.ts +0 -8
- package/components/stream/overlays/built-in/ActionTickerWidget.d.ts.map +0 -1
- package/components/stream/overlays/built-in/ActionTickerWidget.js +0 -44
- package/components/stream/overlays/built-in/AlertPopupWidget.d.ts +0 -7
- package/components/stream/overlays/built-in/AlertPopupWidget.d.ts.map +0 -1
- package/components/stream/overlays/built-in/AlertPopupWidget.js +0 -62
- package/components/stream/overlays/built-in/BrandingWidget.d.ts +0 -7
- package/components/stream/overlays/built-in/BrandingWidget.d.ts.map +0 -1
- package/components/stream/overlays/built-in/BrandingWidget.js +0 -36
- package/components/stream/overlays/built-in/CustomHtmlWidget.d.ts +0 -26
- package/components/stream/overlays/built-in/CustomHtmlWidget.d.ts.map +0 -1
- package/components/stream/overlays/built-in/CustomHtmlWidget.js +0 -78
- package/components/stream/overlays/built-in/PeonGlassWidget.d.ts +0 -11
- package/components/stream/overlays/built-in/PeonGlassWidget.d.ts.map +0 -1
- package/components/stream/overlays/built-in/PeonGlassWidget.js +0 -188
- package/components/stream/overlays/built-in/PeonHudWidget.d.ts +0 -10
- package/components/stream/overlays/built-in/PeonHudWidget.d.ts.map +0 -1
- package/components/stream/overlays/built-in/PeonHudWidget.js +0 -168
- package/components/stream/overlays/built-in/PeonSakuraWidget.d.ts +0 -11
- package/components/stream/overlays/built-in/PeonSakuraWidget.d.ts.map +0 -1
- package/components/stream/overlays/built-in/PeonSakuraWidget.js +0 -213
- package/components/stream/overlays/built-in/ThoughtBubbleWidget.d.ts +0 -8
- package/components/stream/overlays/built-in/ThoughtBubbleWidget.d.ts.map +0 -1
- package/components/stream/overlays/built-in/ThoughtBubbleWidget.js +0 -59
- package/components/stream/overlays/built-in/ViewerCountWidget.d.ts +0 -7
- package/components/stream/overlays/built-in/ViewerCountWidget.d.ts.map +0 -1
- package/components/stream/overlays/built-in/ViewerCountWidget.js +0 -34
- package/components/stream/overlays/built-in/index.d.ts +0 -13
- package/components/stream/overlays/built-in/index.d.ts.map +0 -1
- package/components/stream/overlays/built-in/index.js +0 -12
- package/components/stream/overlays/registry.d.ts +0 -11
- package/components/stream/overlays/registry.d.ts.map +0 -1
- package/components/stream/overlays/registry.js +0 -16
- package/components/stream/overlays/types.d.ts +0 -67
- package/components/stream/overlays/types.d.ts.map +0 -1
- package/components/stream/overlays/types.js +0 -7
- package/components/stream/overlays/useOverlayLayout.d.ts +0 -27
- package/components/stream/overlays/useOverlayLayout.d.ts.map +0 -1
- package/components/stream/overlays/useOverlayLayout.js +0 -162
- package/components/trajectory-format.d.ts +0 -6
- package/components/trajectory-format.d.ts.map +0 -1
- package/components/trajectory-format.js +0 -43
- package/components/ui-badges.d.ts +0 -23
- package/components/ui-badges.d.ts.map +0 -1
- package/components/ui-badges.js +0 -38
- package/components/ui-switch.d.ts +0 -14
- package/components/ui-switch.d.ts.map +0 -1
- package/components/ui-switch.js +0 -15
- package/components/vector-browser-three.d.ts +0 -4
- package/components/vector-browser-three.d.ts.map +0 -1
- package/components/vector-browser-three.js +0 -21
- package/config/branding.d.ts +0 -49
- package/config/branding.d.ts.map +0 -1
- package/config/branding.js +0 -16
- package/config/config-catalog.d.ts +0 -376
- package/config/config-catalog.d.ts.map +0 -1
- package/config/config-catalog.js +0 -724
- package/config/config-field.d.ts +0 -68
- package/config/config-field.d.ts.map +0 -1
- package/config/config-field.js +0 -840
- package/config/config-renderer.d.ts +0 -176
- package/config/config-renderer.d.ts.map +0 -1
- package/config/config-renderer.js +0 -405
- package/config/index.d.ts +0 -6
- package/config/index.d.ts.map +0 -1
- package/config/index.js +0 -5
- package/config/ui-renderer.d.ts +0 -26
- package/config/ui-renderer.d.ts.map +0 -1
- package/config/ui-renderer.js +0 -815
- package/config/ui-spec.d.ts +0 -164
- package/config/ui-spec.d.ts.map +0 -1
- package/config/ui-spec.js +0 -13
- package/events/index.d.ts +0 -48
- package/events/index.d.ts.map +0 -1
- package/events/index.js +0 -45
- package/hooks/index.d.ts +0 -15
- package/hooks/index.d.ts.map +0 -1
- package/hooks/index.js +0 -14
- package/hooks/useBugReport.d.ts +0 -14
- package/hooks/useBugReport.d.ts.map +0 -1
- package/hooks/useBugReport.js +0 -18
- package/hooks/useCanvasWindow.d.ts +0 -38
- package/hooks/useCanvasWindow.d.ts.map +0 -1
- package/hooks/useCanvasWindow.js +0 -273
- package/hooks/useChatAvatarVoice.d.ts +0 -10
- package/hooks/useChatAvatarVoice.d.ts.map +0 -1
- package/hooks/useChatAvatarVoice.js +0 -71
- package/hooks/useClickOutside.d.ts +0 -6
- package/hooks/useClickOutside.d.ts.map +0 -1
- package/hooks/useClickOutside.js +0 -25
- package/hooks/useContextMenu.d.ts +0 -17
- package/hooks/useContextMenu.d.ts.map +0 -1
- package/hooks/useContextMenu.js +0 -100
- package/hooks/useKeyboardShortcuts.d.ts +0 -17
- package/hooks/useKeyboardShortcuts.d.ts.map +0 -1
- package/hooks/useKeyboardShortcuts.js +0 -67
- package/hooks/useLifoSync.d.ts +0 -18
- package/hooks/useLifoSync.d.ts.map +0 -1
- package/hooks/useLifoSync.js +0 -113
- package/hooks/useMemoryMonitor.d.ts +0 -87
- package/hooks/useMemoryMonitor.d.ts.map +0 -1
- package/hooks/useMemoryMonitor.js +0 -209
- package/hooks/useRenderGuard.d.ts +0 -17
- package/hooks/useRenderGuard.d.ts.map +0 -1
- package/hooks/useRenderGuard.js +0 -36
- package/hooks/useRetakeCapture.d.ts +0 -12
- package/hooks/useRetakeCapture.d.ts.map +0 -1
- package/hooks/useRetakeCapture.js +0 -60
- package/hooks/useStreamPopoutNavigation.d.ts +0 -3
- package/hooks/useStreamPopoutNavigation.d.ts.map +0 -1
- package/hooks/useStreamPopoutNavigation.js +0 -17
- package/hooks/useTimeout.d.ts +0 -11
- package/hooks/useTimeout.d.ts.map +0 -1
- package/hooks/useTimeout.js +0 -32
- package/hooks/useVoiceChat.d.ts +0 -94
- package/hooks/useVoiceChat.d.ts.map +0 -1
- package/hooks/useVoiceChat.js +0 -1077
- package/hooks/useWhatsAppPairing.d.ts +0 -11
- package/hooks/useWhatsAppPairing.d.ts.map +0 -1
- package/hooks/useWhatsAppPairing.js +0 -95
- package/i18n/index.d.ts +0 -7
- package/i18n/index.d.ts.map +0 -1
- package/i18n/index.js +0 -53
- package/i18n/locales/en.json +0 -1268
- package/i18n/locales/es.json +0 -1236
- package/i18n/locales/ko.json +0 -1236
- package/i18n/locales/pt.json +0 -1236
- package/i18n/locales/zh-CN.json +0 -1236
- package/i18n/messages.d.ts +0 -6
- package/i18n/messages.d.ts.map +0 -1
- package/i18n/messages.js +0 -14
- package/navigation/index.d.ts +0 -27
- package/navigation/index.d.ts.map +0 -1
- package/navigation/index.js +0 -232
- package/onboarding-config.d.ts +0 -25
- package/onboarding-config.d.ts.map +0 -1
- package/onboarding-config.js +0 -76
- package/platform/browser-launch.d.ts +0 -2
- package/platform/browser-launch.d.ts.map +0 -1
- package/platform/browser-launch.js +0 -109
- package/platform/index.d.ts +0 -14
- package/platform/index.d.ts.map +0 -1
- package/platform/index.js +0 -24
- package/platform/init.d.ts +0 -40
- package/platform/init.d.ts.map +0 -1
- package/platform/init.js +0 -160
- package/platform/lifo.d.ts +0 -51
- package/platform/lifo.d.ts.map +0 -1
- package/platform/lifo.js +0 -138
- package/providers/index.d.ts +0 -19
- package/providers/index.d.ts.map +0 -1
- package/providers/index.js +0 -80
- package/shell-params.d.ts +0 -12
- package/shell-params.d.ts.map +0 -1
- package/shell-params.js +0 -19
- package/state/AppContext.d.ts +0 -12
- package/state/AppContext.d.ts.map +0 -1
- package/state/AppContext.js +0 -5102
- package/state/index.d.ts +0 -7
- package/state/index.d.ts.map +0 -1
- package/state/index.js +0 -6
- package/state/internal.d.ts +0 -7
- package/state/internal.d.ts.map +0 -1
- package/state/internal.js +0 -6
- package/state/onboarding-resume.d.ts +0 -11
- package/state/onboarding-resume.d.ts.map +0 -1
- package/state/onboarding-resume.js +0 -187
- package/state/parsers.d.ts +0 -26
- package/state/parsers.d.ts.map +0 -1
- package/state/parsers.js +0 -255
- package/state/persistence.d.ts +0 -59
- package/state/persistence.d.ts.map +0 -1
- package/state/persistence.js +0 -328
- package/state/shell-routing.d.ts +0 -12
- package/state/shell-routing.d.ts.map +0 -1
- package/state/shell-routing.js +0 -26
- package/state/types.d.ts +0 -426
- package/state/types.d.ts.map +0 -1
- package/state/types.js +0 -89
- package/state/ui-preferences.d.ts +0 -3
- package/state/ui-preferences.d.ts.map +0 -1
- package/state/ui-preferences.js +0 -1
- package/state/useApp.d.ts +0 -4
- package/state/useApp.d.ts.map +0 -1
- package/state/useApp.js +0 -22
- package/state/vrm.d.ts +0 -30
- package/state/vrm.d.ts.map +0 -1
- package/state/vrm.js +0 -82
- package/styles/anime.css +0 -6364
- package/styles/base.css +0 -255
- package/styles/onboarding-game.css +0 -1095
- package/styles/styles.css +0 -2087
- package/styles/xterm.css +0 -241
- package/types/index.d.ts +0 -657
- package/types/index.d.ts.map +0 -1
- package/types/index.js +0 -1
- package/utils/asset-url.d.ts +0 -26
- package/utils/asset-url.d.ts.map +0 -1
- package/utils/asset-url.js +0 -99
- package/utils/assistant-text.d.ts +0 -2
- package/utils/assistant-text.d.ts.map +0 -1
- package/utils/assistant-text.js +0 -161
- package/utils/clipboard.d.ts +0 -2
- package/utils/clipboard.d.ts.map +0 -1
- package/utils/clipboard.js +0 -38
- package/utils/desktop-dialogs.d.ts +0 -19
- package/utils/desktop-dialogs.d.ts.map +0 -1
- package/utils/desktop-dialogs.js +0 -50
- package/utils/eliza-globals.d.ts +0 -11
- package/utils/eliza-globals.d.ts.map +0 -1
- package/utils/eliza-globals.js +0 -33
- package/utils/index.d.ts +0 -8
- package/utils/index.d.ts.map +0 -1
- package/utils/index.js +0 -7
- package/utils/number-parsing.d.ts +0 -44
- package/utils/number-parsing.d.ts.map +0 -1
- package/utils/number-parsing.js +0 -56
- package/utils/openExternalUrl.d.ts +0 -2
- package/utils/openExternalUrl.d.ts.map +0 -1
- package/utils/openExternalUrl.js +0 -17
- package/utils/spoken-text.d.ts +0 -2
- package/utils/spoken-text.d.ts.map +0 -1
- package/utils/spoken-text.js +0 -56
- package/utils/streaming-text.d.ts +0 -3
- package/utils/streaming-text.d.ts.map +0 -1
- package/utils/streaming-text.js +0 -87
- package/voice/index.d.ts +0 -2
- package/voice/index.d.ts.map +0 -1
- package/voice/index.js +0 -1
- package/voice/types.d.ts +0 -25
- package/voice/types.d.ts.map +0 -1
- package/voice/types.js +0 -166
- package/wallet-rpc.d.ts +0 -8
- package/wallet-rpc.d.ts.map +0 -1
- package/wallet-rpc.js +0 -131
- /package/{components/apps/extensions → services/local-inference/voice}/types.js +0 -0
|
@@ -0,0 +1,1333 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// eliza/packages/app-core/scripts/aosp/compile-libllama.mjs —
|
|
3
|
+
// cross-compile llama.cpp into a musl-linked libllama.so for the
|
|
4
|
+
// AOSP-bound privileged-system-app APK shipped by an elizaOS host or
|
|
5
|
+
// any white-label fork built on it.
|
|
6
|
+
//
|
|
7
|
+
// Why musl, not the regular Android NDK toolchain:
|
|
8
|
+
// AOSP system-app builds ship a self-contained bun-on-Android
|
|
9
|
+
// process (see scripts/spike-android-agent/bootstrap.sh +
|
|
10
|
+
// eliza/packages/app-core/scripts/lib/stage-android-agent.mjs).
|
|
11
|
+
// That process loads bun-linux-{x64,aarch64}-musl from inside the
|
|
12
|
+
// APK, runs through ld-musl-{x86_64,aarch64}.so.1 (the Alpine musl
|
|
13
|
+
// loader), and links libstdc++.so.6 / libgcc_s.so.1 from Alpine
|
|
14
|
+
// v3.21. It is not bionic. NDK clang produces bionic-linked ELFs
|
|
15
|
+
// that depend on libc.so / libdl.so symbols the musl loader doesn't
|
|
16
|
+
// expose, so dlopen() of an NDK-compiled libllama.so inside the bun
|
|
17
|
+
// process fails with "undefined symbol" the moment libllama touches
|
|
18
|
+
// a libc primitive.
|
|
19
|
+
//
|
|
20
|
+
// Requirement: libllama.so MUST be a musl-linked shared object whose
|
|
21
|
+
// external dependencies are limited to ld-musl, libstdc++.so.6, and
|
|
22
|
+
// libgcc_s.so.1 — all three of which the APK already ships per ABI.
|
|
23
|
+
//
|
|
24
|
+
// Toolchain choice:
|
|
25
|
+
// We use `zig cc --target={aarch64,x86_64}-linux-musl` for cross-compilation.
|
|
26
|
+
// Zig bundles a complete musl libc, libc++, and cross-toolchain for both
|
|
27
|
+
// architectures, which avoids the (otherwise multi-step) work of building
|
|
28
|
+
// a musl-cross-make toolchain on the build host. Bun itself uses zig for
|
|
29
|
+
// its musl Android targets, so the resulting ABI matches what bun expects
|
|
30
|
+
// when it dlopen()s libllama.so via bun:ffi at runtime.
|
|
31
|
+
//
|
|
32
|
+
// Minimum tested: zig 0.13.0. Earlier versions ship older libc++ headers
|
|
33
|
+
// that miss <bit> / <span> shims llama.cpp's CMake feature checks rely on.
|
|
34
|
+
//
|
|
35
|
+
// llama.cpp pin (matches plugins/plugin-aosp-local-inference/src/aosp-llama-adapter.ts):
|
|
36
|
+
// fork: https://github.com/milady-ai/llama.cpp
|
|
37
|
+
// tag: v0.4.0-milady (milady/integration HEAD)
|
|
38
|
+
// commit: 08032d57e15574f2a7ca19fc3f29510c8673d590
|
|
39
|
+
//
|
|
40
|
+
// v0.4.0-milady adds W4-B CUDA QJL + PolarQuant Q4 + TBQ3_TCQ kernels
|
|
41
|
+
// on top of v0.3.0-milady. The CUDA paths only matter for the
|
|
42
|
+
// linux-x64-cuda host target (the AOSP arm64 path stays CPU-only),
|
|
43
|
+
// but the pin is shared so both AOSP and host build paths land on
|
|
44
|
+
// identical kernel sources.
|
|
45
|
+
//
|
|
46
|
+
// v0.2.0-milady (subset of this pin) added DFlash speculative decoding
|
|
47
|
+
// CLI surface (--spec-type dflash, --draft-min-prob alias, n_drafted_total
|
|
48
|
+
// / n_drafted_accepted_total Prometheus counters) on top of v0.1.0-milady.
|
|
49
|
+
//
|
|
50
|
+
// Why this fork (not stock ggml-org/llama.cpp b8198):
|
|
51
|
+
// The Milady fork composes four techniques onto upstream b8198:
|
|
52
|
+
//
|
|
53
|
+
// - TBQ3_0 (slot 43) + TBQ4_0 (slot 44) — 3-bit / 4-bit TurboQuant V-cache.
|
|
54
|
+
// Cherry-picked from apothic/llama.cpp-1bit-turboquant @ b2b5273.
|
|
55
|
+
// block_tbq3_0 packs 32 floats into 14 bytes vs 64 bytes for fp16
|
|
56
|
+
// (4–4.6× reduction). KV cache is the dominant memory consumer on
|
|
57
|
+
// long contexts on phones, so this is the difference between
|
|
58
|
+
// "Eliza-1 loads but OOMs after 1k tokens" and "Eliza-1 loads and chats".
|
|
59
|
+
// - QJL1_256 (slot 46) — 1-bit JL-transform K-cache (256 sketch dims,
|
|
60
|
+
// 34 bytes/block). From W1-A's QJL series.
|
|
61
|
+
// - Q4_POLAR (slot 47) — 4-bit PolarQuant weight quantization. From
|
|
62
|
+
// W1-B's Polar series. Bumped from upstream slot 45 to 47 because
|
|
63
|
+
// slot 46 is now QJL.
|
|
64
|
+
// - Metal kernel sources (.metal) for TBQ3_0/TBQ4_0/TBQ3_TCQ/QJL/Polar
|
|
65
|
+
// under ggml/src/ggml-metal/milady-kernels/. Source-only landing —
|
|
66
|
+
// dispatcher wiring is the next agent's job.
|
|
67
|
+
//
|
|
68
|
+
// The CPU implementations of all four techniques (NEON for arm64, AVX2
|
|
69
|
+
// for x86_64, scalar fallback) are baked into the fork at
|
|
70
|
+
// ggml/src/ggml-cpu/qjl/* and ggml/src/ggml-cpu/quants-polar.c. Mobile
|
|
71
|
+
// is CPU-only via the bun:ffi musl path, so these are what makes the
|
|
72
|
+
// fork useful on phones at all.
|
|
73
|
+
//
|
|
74
|
+
// The fork is based on llama.cpp b8198 (much newer than the prior b4500
|
|
75
|
+
// pin), so it inherits the post-2024 sampler-chain API
|
|
76
|
+
// (`llama_sampler_chain_init`, `llama_sampler_init_greedy`, etc.) and the
|
|
77
|
+
// renamed model/vocab API (`llama_model_load_from_file`,
|
|
78
|
+
// `llama_init_from_model`, `llama_model_get_vocab`, `llama_vocab_eos`,
|
|
79
|
+
// `llama_vocab_is_eog`) the adapter binds against. One drift versus
|
|
80
|
+
// b4500: `llama_context_params.flash_attn` (bool) → `flash_attn_type`
|
|
81
|
+
// (enum). The shim no longer exposes a `set_flash_attn` setter (the
|
|
82
|
+
// adapter never called it anyway).
|
|
83
|
+
//
|
|
84
|
+
// Output (per ABI):
|
|
85
|
+
// apps/app/android/app/src/main/assets/agent/{abi}/libllama.so
|
|
86
|
+
// apps/app/android/app/src/main/assets/agent/{abi}/libggml.so
|
|
87
|
+
// apps/app/android/app/src/main/assets/agent/{abi}/libggml-cpu.so
|
|
88
|
+
// apps/app/android/app/src/main/assets/agent/{abi}/libggml-base.so
|
|
89
|
+
// apps/app/android/app/src/main/assets/agent/{abi}/libeliza-llama-shim.so
|
|
90
|
+
// apps/app/android/app/src/main/assets/agent/{abi}/llama-server (DFlash spec-decode HTTP server)
|
|
91
|
+
//
|
|
92
|
+
// libllama.so has NEEDED entries on the entire libggml family (see
|
|
93
|
+
// `readelf -d`); the dynamic linker resolves them from the per-ABI asset
|
|
94
|
+
// dir via the LD_LIBRARY_PATH ElizaAgentService.java sets at process
|
|
95
|
+
// launch. ABIs: arm64-v8a (real phones) and x86_64 (cuttlefish + emulators).
|
|
96
|
+
//
|
|
97
|
+
// libeliza-llama-shim.so is the bun:ffi struct-by-value workaround: a
|
|
98
|
+
// thin C wrapper (llama-shim/eliza_llama_shim.c next to this script)
|
|
99
|
+
// that converts llama.cpp's struct-by-value entry points into
|
|
100
|
+
// pointer-style equivalents bun:ffi can speak. NEEDED-links
|
|
101
|
+
// libllama.so; resolved from the same asset dir at runtime.
|
|
102
|
+
//
|
|
103
|
+
// Approximate build cost on a modern Linux x86_64 builder (16 cores, NVMe):
|
|
104
|
+
// - llama.cpp clone: ~30 s, ~150 MB working tree.
|
|
105
|
+
// - per-ABI configure: ~10 s.
|
|
106
|
+
// - per-ABI compile: ~2-3 minutes.
|
|
107
|
+
// - per-ABI strip: <1 s.
|
|
108
|
+
// - libllama.so size: ~5-10 MB stripped per ABI (varies with zig
|
|
109
|
+
// baseline ISA selection).
|
|
110
|
+
//
|
|
111
|
+
// Idempotent: cached clone + cached build dirs skip rework. Bumping the
|
|
112
|
+
// pinned tag in LLAMA_CPP_TAG / LLAMA_CPP_COMMIT busts the cache.
|
|
113
|
+
//
|
|
114
|
+
// CI portability:
|
|
115
|
+
// The script self-bootstraps everything it needs. On a clean machine with
|
|
116
|
+
// only `zig` and `cmake` on PATH, it:
|
|
117
|
+
// 1. Writes per-ABI `zig-cc` / `zig-cxx` driver scripts to
|
|
118
|
+
// ${cacheDir}/zig-driver/{abi}/. CMake invokes its CMAKE_C_COMPILER as
|
|
119
|
+
// a single binary with whatever args it wants; if we passed `zig` with
|
|
120
|
+
// --target=... in CMAKE_C_FLAGS, zig parses `--target=...` as an
|
|
121
|
+
// unknown top-level subcommand and fails its compiler probe. The
|
|
122
|
+
// driver scripts shim `zig cc --target=<triple>` so cmake sees a
|
|
123
|
+
// regular cc-style compiler.
|
|
124
|
+
// 2. Patches `ggml/src/ggml.c` so `<execinfo.h>` is only included on glibc
|
|
125
|
+
// Linux. Upstream b3490 includes it under a bare `__linux__` guard;
|
|
126
|
+
// musl libc does not provide that header, and the include explodes the
|
|
127
|
+
// compile. The current pin (b4500+) already gates the include on
|
|
128
|
+
// `__GLIBC__`, so the patch detects this and no-ops. On older pins
|
|
129
|
+
// the patch rewrites the include guard.
|
|
130
|
+
// 3. Strips libllama.so / libggml.so out-of-place. zig 0.13's
|
|
131
|
+
// `zig objcopy --strip-all <src> <dst>` truncates dst to 0 before
|
|
132
|
+
// reading src when src == dst; the in-place pattern leaves an empty
|
|
133
|
+
// file. We strip to `<file>.stripped` and rename.
|
|
134
|
+
// 4. Co-copies the entire libggml*.so family alongside libllama.so.
|
|
135
|
+
// On b4500 libllama.so has NEEDED entries for libggml.so,
|
|
136
|
+
// libggml-cpu.so, and libggml-base.so; the dynamic linker resolves
|
|
137
|
+
// all three from the same dir at runtime via the LD_LIBRARY_PATH
|
|
138
|
+
// ElizaAgentService.java sets. Without the co-copy, dlopen fails
|
|
139
|
+
// with "libggml-base.so: cannot open shared object file" (or
|
|
140
|
+
// whichever NEEDED sibling is missing).
|
|
141
|
+
// 5. Configures cmake with `-DCMAKE_SKIP_BUILD_RPATH=TRUE` so the
|
|
142
|
+
// resulting .so files don't bake an absolute RUNPATH to the
|
|
143
|
+
// build-host cache dir. Without this, every shipped APK leaks
|
|
144
|
+
// `/home/<builder>/.cache/...` as a hardcoded RUNPATH and the
|
|
145
|
+
// runtime dynamic linker tries (and fails) to look there before
|
|
146
|
+
// falling back to LD_LIBRARY_PATH.
|
|
147
|
+
//
|
|
148
|
+
// Failure mode:
|
|
149
|
+
// If zig is missing, this script exits with code 1 and prints the exact
|
|
150
|
+
// install command. We never silently skip — an APK that ships without
|
|
151
|
+
// libllama.so but with ELIZA_LOCAL_LLAMA=1 would fail at first inference
|
|
152
|
+
// call (Commandment 8: don't hide broken pipelines behind fallbacks).
|
|
153
|
+
//
|
|
154
|
+
// Repo-root resolution:
|
|
155
|
+
// The script defaults `--assets-dir` to
|
|
156
|
+
// `<repoRoot>/apps/app/android/app/src/main/assets/agent` and
|
|
157
|
+
// `--cache-dir` to `~/.cache/eliza-android-agent/llama-cpp-<tag>`.
|
|
158
|
+
// `<repoRoot>` is derived from this script's location: walk up from
|
|
159
|
+
// `eliza/packages/app-core/scripts/aosp/` to the host repo root by
|
|
160
|
+
// default, but when the parent host repo invokes this via the
|
|
161
|
+
// `eliza/` submodule the same algorithm finds the host repo root
|
|
162
|
+
// (it stops at the first ancestor that has a `package.json`).
|
|
163
|
+
|
|
164
|
+
import { spawnSync } from "node:child_process";
|
|
165
|
+
import fs from "node:fs";
|
|
166
|
+
import os from "node:os";
|
|
167
|
+
import path from "node:path";
|
|
168
|
+
import process from "node:process";
|
|
169
|
+
import { fileURLToPath } from "node:url";
|
|
170
|
+
import { resolveRepoRootFromImportMeta } from "../lib/repo-root.mjs";
|
|
171
|
+
import { main as compileShimMain } from "./compile-shim.mjs";
|
|
172
|
+
|
|
173
|
+
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
174
|
+
// Walk up from `eliza/packages/app-core/scripts/aosp/` until we hit
|
|
175
|
+
// the host repo root (the directory with a top-level `package.json`).
|
|
176
|
+
// On a parent-host invocation that's `<host-root>`; when running
|
|
177
|
+
// inside the elizaOS source checkout it's the elizaOS repo root.
|
|
178
|
+
const repoRoot = resolveRepoRootFromImportMeta(import.meta.url);
|
|
179
|
+
|
|
180
|
+
// milady-ai/llama.cpp @ v0.4.0-milady (milady/integration HEAD).
|
|
181
|
+
// Composes TBQ (apothic) + QJL (W1-A) + Q4_POLAR (W1-B) + Metal sources
|
|
182
|
+
// (W1-D) + DFlash spec-decode (W2) + W3-B fused CPU kernels + W4-B CUDA
|
|
183
|
+
// QJL/Polar/TBQ3_TCQ kernels onto upstream b8198. See
|
|
184
|
+
// docs/porting/unified-fork-strategy.md for the full migration story.
|
|
185
|
+
//
|
|
186
|
+
// Pre-2026-05-09 the AOSP path consumed apothic/llama.cpp-1bit-turboquant
|
|
187
|
+
// directly and applied vendored QJL + PolarQuant patch series via
|
|
188
|
+
// scripts/aosp/llama-cpp-patches/apply-patches.mjs at build time. That
|
|
189
|
+
// flow is now replaced by a single canonical fork — the patches are
|
|
190
|
+
// baked in. apply-patches.mjs is kept around for one release as a
|
|
191
|
+
// rollback path; see scripts/aosp/llama-cpp-patches/README.md.
|
|
192
|
+
export const LLAMA_CPP_TAG = "v0.4.0-milady";
|
|
193
|
+
export const LLAMA_CPP_COMMIT = "08032d57e15574f2a7ca19fc3f29510c8673d590";
|
|
194
|
+
export const LLAMA_CPP_REMOTE =
|
|
195
|
+
"https://github.com/milady-ai/llama.cpp.git";
|
|
196
|
+
export const MIN_ZIG_VERSION = "0.13.0";
|
|
197
|
+
|
|
198
|
+
export const ABI_TARGETS = [
|
|
199
|
+
{
|
|
200
|
+
androidAbi: "arm64-v8a",
|
|
201
|
+
zigTarget: "aarch64-linux-musl",
|
|
202
|
+
cmakeProcessor: "aarch64",
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
androidAbi: "x86_64",
|
|
206
|
+
zigTarget: "x86_64-linux-musl",
|
|
207
|
+
cmakeProcessor: "x86_64",
|
|
208
|
+
},
|
|
209
|
+
];
|
|
210
|
+
|
|
211
|
+
export function parseArgs(argv) {
|
|
212
|
+
const args = {
|
|
213
|
+
androidAssetsDir: path.join(
|
|
214
|
+
repoRoot,
|
|
215
|
+
"apps",
|
|
216
|
+
"app",
|
|
217
|
+
"android",
|
|
218
|
+
"app",
|
|
219
|
+
"src",
|
|
220
|
+
"main",
|
|
221
|
+
"assets",
|
|
222
|
+
"agent",
|
|
223
|
+
),
|
|
224
|
+
cacheDir: path.join(
|
|
225
|
+
os.homedir(),
|
|
226
|
+
".cache",
|
|
227
|
+
"eliza-android-agent",
|
|
228
|
+
`llama-cpp-${LLAMA_CPP_TAG}`,
|
|
229
|
+
),
|
|
230
|
+
abis: ABI_TARGETS.map((t) => t.androidAbi),
|
|
231
|
+
skipIfPresent: false,
|
|
232
|
+
jobs: Math.max(1, Math.min(os.cpus().length, 8)),
|
|
233
|
+
srcDir: null,
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
const readFlagValue = (flag, index) => {
|
|
237
|
+
const value = argv[index + 1];
|
|
238
|
+
if (!value || value.startsWith("--")) {
|
|
239
|
+
throw new Error(`${flag} requires a value`);
|
|
240
|
+
}
|
|
241
|
+
return value;
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
245
|
+
const arg = argv[i];
|
|
246
|
+
if (arg === "--assets-dir") {
|
|
247
|
+
args.androidAssetsDir = path.resolve(readFlagValue(arg, i));
|
|
248
|
+
i += 1;
|
|
249
|
+
} else if (arg === "--cache-dir") {
|
|
250
|
+
args.cacheDir = path.resolve(readFlagValue(arg, i));
|
|
251
|
+
i += 1;
|
|
252
|
+
} else if (arg === "--src-dir") {
|
|
253
|
+
args.srcDir = path.resolve(readFlagValue(arg, i));
|
|
254
|
+
i += 1;
|
|
255
|
+
} else if (arg === "--abi") {
|
|
256
|
+
const value = readFlagValue(arg, i);
|
|
257
|
+
const valid = ABI_TARGETS.map((t) => t.androidAbi);
|
|
258
|
+
if (!valid.includes(value)) {
|
|
259
|
+
throw new Error(
|
|
260
|
+
`--abi must be one of ${valid.join(", ")} (got: ${value})`,
|
|
261
|
+
);
|
|
262
|
+
}
|
|
263
|
+
args.abis = [value];
|
|
264
|
+
i += 1;
|
|
265
|
+
} else if (arg === "--jobs" || arg === "-j") {
|
|
266
|
+
const value = Number.parseInt(readFlagValue(arg, i), 10);
|
|
267
|
+
if (!Number.isFinite(value) || value <= 0) {
|
|
268
|
+
throw new Error("--jobs must be a positive integer");
|
|
269
|
+
}
|
|
270
|
+
args.jobs = value;
|
|
271
|
+
i += 1;
|
|
272
|
+
} else if (arg === "--skip-if-present") {
|
|
273
|
+
args.skipIfPresent = true;
|
|
274
|
+
} else if (arg === "-h" || arg === "--help") {
|
|
275
|
+
console.log(
|
|
276
|
+
"Usage: node eliza/packages/app-core/scripts/aosp/compile-libllama.mjs " +
|
|
277
|
+
"[--assets-dir <PATH>] [--cache-dir <PATH>] [--src-dir <PATH>] " +
|
|
278
|
+
"[--abi <arm64-v8a|x86_64>] [--jobs <N>] [--skip-if-present]\n" +
|
|
279
|
+
" --src-dir <PATH> Use an existing llama.cpp / buun-llama-cpp checkout\n" +
|
|
280
|
+
" instead of cloning. The directory's HEAD is used as-is;\n" +
|
|
281
|
+
" the pinned LLAMA_CPP_TAG/COMMIT in this script is ignored.\n" +
|
|
282
|
+
" Use this to build the spiritbuun/buun-llama-cpp fork\n" +
|
|
283
|
+
" (TurboQuant KV-cache + DFlash kernels).",
|
|
284
|
+
);
|
|
285
|
+
process.exit(0);
|
|
286
|
+
} else {
|
|
287
|
+
throw new Error(`Unknown argument: ${arg}`);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
return args;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Compare two semver-ish version strings (zig follows MAJOR.MINOR.PATCH for
|
|
296
|
+
* stable releases; dev builds add `-dev.NNN+sha` which we strip).
|
|
297
|
+
* Returns negative when `a < b`, positive when `a > b`, zero on equal.
|
|
298
|
+
*/
|
|
299
|
+
export function compareSemver(a, b) {
|
|
300
|
+
const norm = (v) =>
|
|
301
|
+
String(v)
|
|
302
|
+
.replace(/^v/, "")
|
|
303
|
+
.split(/[-+]/)[0]
|
|
304
|
+
.split(".")
|
|
305
|
+
.map((n) => Number.parseInt(n, 10) || 0);
|
|
306
|
+
const aa = norm(a);
|
|
307
|
+
const bb = norm(b);
|
|
308
|
+
for (let i = 0; i < Math.max(aa.length, bb.length); i += 1) {
|
|
309
|
+
const x = aa[i] ?? 0;
|
|
310
|
+
const y = bb[i] ?? 0;
|
|
311
|
+
if (x !== y) return x - y;
|
|
312
|
+
}
|
|
313
|
+
return 0;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Probe the build host for a usable zig toolchain. Returns the absolute path
|
|
318
|
+
* to the zig binary on success, or throws an Error with an install hint
|
|
319
|
+
* tailored to the host OS. We require zig >= MIN_ZIG_VERSION because earlier
|
|
320
|
+
* versions are missing libc++ headers llama.cpp's CMake checks rely on.
|
|
321
|
+
*
|
|
322
|
+
* Exported for unit tests.
|
|
323
|
+
*/
|
|
324
|
+
export function probeZig({
|
|
325
|
+
spawn = spawnSync,
|
|
326
|
+
platform = process.platform,
|
|
327
|
+
} = {}) {
|
|
328
|
+
const probe = spawn("zig", ["version"], {
|
|
329
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
330
|
+
encoding: "utf8",
|
|
331
|
+
});
|
|
332
|
+
if (probe.error || probe.status !== 0) {
|
|
333
|
+
const installHint =
|
|
334
|
+
platform === "darwin"
|
|
335
|
+
? "brew install zig"
|
|
336
|
+
: platform === "linux"
|
|
337
|
+
? "snap install zig --classic --beta\n or download a tarball from https://ziglang.org/download/ and put `zig` on PATH"
|
|
338
|
+
: "see https://ziglang.org/download/";
|
|
339
|
+
throw new Error(
|
|
340
|
+
`[compile-libllama] zig is required to cross-compile libllama.so for the AOSP build, but was not found on PATH.\n` +
|
|
341
|
+
`Install zig >= ${MIN_ZIG_VERSION} and re-run:\n ${installHint}\n` +
|
|
342
|
+
`(zig is what we use to produce musl-linked binaries that match the bun-on-Android runtime ABI; ` +
|
|
343
|
+
`the regular Android NDK clang produces bionic-linked binaries that the musl loader cannot dlopen.)`,
|
|
344
|
+
);
|
|
345
|
+
}
|
|
346
|
+
const version = probe.stdout.trim();
|
|
347
|
+
if (compareSemver(version, MIN_ZIG_VERSION) < 0) {
|
|
348
|
+
throw new Error(
|
|
349
|
+
`[compile-libllama] zig ${version} is too old; need >= ${MIN_ZIG_VERSION}.\n` +
|
|
350
|
+
`Earlier zig releases ship libc++ headers that miss the <bit>/<span> shims llama.cpp ` +
|
|
351
|
+
`feature-checks during configure. Upgrade zig and re-run.`,
|
|
352
|
+
);
|
|
353
|
+
}
|
|
354
|
+
return version;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
function run(command, args, { cwd, env = process.env } = {}) {
|
|
358
|
+
const result = spawnSync(command, args, {
|
|
359
|
+
cwd,
|
|
360
|
+
env,
|
|
361
|
+
stdio: "inherit",
|
|
362
|
+
});
|
|
363
|
+
if (result.error) {
|
|
364
|
+
throw new Error(`${command} failed: ${result.error.message}`);
|
|
365
|
+
}
|
|
366
|
+
if (result.status !== 0) {
|
|
367
|
+
throw new Error(
|
|
368
|
+
`${command} ${args.join(" ")} exited with code ${result.status}`,
|
|
369
|
+
);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* Clone (or reuse) llama.cpp at the pinned tag/commit. Uses a sentinel file
|
|
375
|
+
* to skip the network when the cache already holds the exact commit. The
|
|
376
|
+
* working tree is detached at LLAMA_CPP_COMMIT — we never let a moving tag
|
|
377
|
+
* slip the source out from under a build.
|
|
378
|
+
*
|
|
379
|
+
* Also runs `patchLlamaCppSourceForMusl()` on every checkout so the patch
|
|
380
|
+
* survives cache reuse (the source-patch sentinel sits next to the
|
|
381
|
+
* checkout sentinel and is keyed off LLAMA_CPP_COMMIT), and applies the
|
|
382
|
+
* vendored QJL + PolarQuant patch series via `applyVendoredPatches()` so
|
|
383
|
+
* the cross-compile picks up the GGML quant types and custom ops the
|
|
384
|
+
* AOSP runtime adapter expects (qjl1_256 / q4_polar).
|
|
385
|
+
*/
|
|
386
|
+
export function ensureLlamaCppCheckout({
|
|
387
|
+
cacheDir,
|
|
388
|
+
log = console.log,
|
|
389
|
+
spawn = run,
|
|
390
|
+
}) {
|
|
391
|
+
fs.mkdirSync(cacheDir, { recursive: true });
|
|
392
|
+
const sentinel = path.join(cacheDir, `.checked-out.${LLAMA_CPP_COMMIT}`);
|
|
393
|
+
if (
|
|
394
|
+
fs.existsSync(sentinel) &&
|
|
395
|
+
fs.existsSync(path.join(cacheDir, "CMakeLists.txt"))
|
|
396
|
+
) {
|
|
397
|
+
log(`[compile-libllama] Reusing cached llama.cpp checkout at ${cacheDir}`);
|
|
398
|
+
patchLlamaCppSourceForMusl({ srcDir: cacheDir, log });
|
|
399
|
+
applyVendoredPatches({ srcDir: cacheDir, log });
|
|
400
|
+
return cacheDir;
|
|
401
|
+
}
|
|
402
|
+
if (!fs.existsSync(path.join(cacheDir, ".git"))) {
|
|
403
|
+
log(
|
|
404
|
+
`[compile-libllama] Cloning llama.cpp ${LLAMA_CPP_TAG} into ${cacheDir}`,
|
|
405
|
+
);
|
|
406
|
+
fs.rmSync(cacheDir, { recursive: true, force: true });
|
|
407
|
+
fs.mkdirSync(cacheDir, { recursive: true });
|
|
408
|
+
spawn(
|
|
409
|
+
"git",
|
|
410
|
+
[
|
|
411
|
+
"clone",
|
|
412
|
+
"--depth",
|
|
413
|
+
"1",
|
|
414
|
+
"--branch",
|
|
415
|
+
LLAMA_CPP_TAG,
|
|
416
|
+
LLAMA_CPP_REMOTE,
|
|
417
|
+
cacheDir,
|
|
418
|
+
],
|
|
419
|
+
{},
|
|
420
|
+
);
|
|
421
|
+
} else {
|
|
422
|
+
log(`[compile-libllama] Refreshing llama.cpp checkout in ${cacheDir}`);
|
|
423
|
+
spawn("git", ["fetch", "--depth", "1", "origin", `tag`, LLAMA_CPP_TAG], {
|
|
424
|
+
cwd: cacheDir,
|
|
425
|
+
});
|
|
426
|
+
}
|
|
427
|
+
spawn("git", ["checkout", "--detach", LLAMA_CPP_COMMIT], {
|
|
428
|
+
cwd: cacheDir,
|
|
429
|
+
});
|
|
430
|
+
fs.writeFileSync(sentinel, `${LLAMA_CPP_COMMIT}\n`, "utf8");
|
|
431
|
+
patchLlamaCppSourceForMusl({ srcDir: cacheDir, log });
|
|
432
|
+
applyVendoredPatches({ srcDir: cacheDir, log });
|
|
433
|
+
return cacheDir;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
/**
|
|
437
|
+
* Run the vendored patch applier (`llama-cpp-patches/apply-patches.mjs`)
|
|
438
|
+
* against the cached llama.cpp checkout. The applier is idempotent: it
|
|
439
|
+
* checks each patch with `git apply --check -R` first and skips any that
|
|
440
|
+
* are already on the tree, so cache reuse stays correct across pin bumps
|
|
441
|
+
* and across partial-failure re-runs.
|
|
442
|
+
*
|
|
443
|
+
* Patches under `llama-cpp-patches/qjl/` add `GGML_TYPE_QJL1_256` (=46),
|
|
444
|
+
* the QJL kernel sources vendored from `packages/native-plugins/qjl-cpu/`,
|
|
445
|
+
* the type-traits + op-dispatch wiring, and the `tests/test-qjl-cache.cpp`
|
|
446
|
+
* synthetic-graph test.
|
|
447
|
+
*
|
|
448
|
+
* Series selection is scoped: today only `qjl` is applied here. The
|
|
449
|
+
* `polarquant` series under the same directory exists but conflicts with
|
|
450
|
+
* `qjl` over the GGML_TYPE_COUNT tag (PolarQuant claims id 45, QJL
|
|
451
|
+
* claims 46) and is owned by a separate landing. When that series is
|
|
452
|
+
* unified with QJL, append it here.
|
|
453
|
+
*
|
|
454
|
+
* Order is:
|
|
455
|
+
* 1. checkout -> 2. patchLlamaCppSourceForMusl -> 3. applyVendoredPatches.
|
|
456
|
+
*
|
|
457
|
+
* Failure mode is loud — if a patch fails to apply (e.g. the upstream
|
|
458
|
+
* commit drifted), the script aborts the in-progress `git am` and exits
|
|
459
|
+
* non-zero. A successful run leaves the tree with the QJL commits on top
|
|
460
|
+
* of LLAMA_CPP_COMMIT.
|
|
461
|
+
*/
|
|
462
|
+
export function applyVendoredPatches({
|
|
463
|
+
srcDir,
|
|
464
|
+
log = console.log,
|
|
465
|
+
spawn = run,
|
|
466
|
+
}) {
|
|
467
|
+
const applierPath = path.join(here, "llama-cpp-patches", "apply-patches.mjs");
|
|
468
|
+
if (!fs.existsSync(applierPath)) {
|
|
469
|
+
throw new Error(
|
|
470
|
+
`[compile-libllama] Vendored patch applier missing at ${applierPath}. ` +
|
|
471
|
+
`The llama-cpp-patches/ directory is the canonical location for QJL ` +
|
|
472
|
+
`fork patches; restore it from git history.`,
|
|
473
|
+
);
|
|
474
|
+
}
|
|
475
|
+
log(
|
|
476
|
+
`[compile-libllama] Applying vendored llama.cpp patches (qjl) to ${srcDir}`,
|
|
477
|
+
);
|
|
478
|
+
spawn("node", [applierPath, "--repo", srcDir, "--series", "qjl"], {});
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
/**
|
|
482
|
+
* Ensure `ggml/src/ggml.c` has the `<execinfo.h>` include gated on
|
|
483
|
+
* `__GLIBC__`. musl libc does not ship `execinfo.h`, so a bare `__linux__`
|
|
484
|
+
* guard breaks `zig cc --target=*-linux-musl` with
|
|
485
|
+
* "fatal error: 'execinfo.h' file not found".
|
|
486
|
+
*
|
|
487
|
+
* Upstream llama.cpp added `__GLIBC__` to the guard in commits between
|
|
488
|
+
* b3490 and b4500 (verified against the b4500 source: it uses
|
|
489
|
+
* `#elif defined(__linux__) && defined(__GLIBC__)`). On the current pin
|
|
490
|
+
* this function is therefore a no-op; on b3490 and earlier it rewrites
|
|
491
|
+
* the include guard.
|
|
492
|
+
*
|
|
493
|
+
* Decision matrix:
|
|
494
|
+
* - If the source already has the `__GLIBC__` guard => no-op (write
|
|
495
|
+
* sentinel so cache reuse is fast, log, return).
|
|
496
|
+
* - If it has the legacy `#if defined(__linux__)\n#include <execinfo.h>`
|
|
497
|
+
* block (b3490) => rewrite the guard, sentinel the patch.
|
|
498
|
+
* - Otherwise => fail loudly. The pin may have introduced an entirely
|
|
499
|
+
* new layout we haven't audited; refuse to silently skip
|
|
500
|
+
* (Commandment 8: explicit failure beats silent breakage).
|
|
501
|
+
*
|
|
502
|
+
* Sentinel is keyed off LLAMA_CPP_COMMIT so cache reuse stays correct
|
|
503
|
+
* across pin bumps.
|
|
504
|
+
*
|
|
505
|
+
* Exported for unit testing.
|
|
506
|
+
*/
|
|
507
|
+
export function patchLlamaCppSourceForMusl({ srcDir, log = console.log }) {
|
|
508
|
+
const target = path.join(srcDir, "ggml", "src", "ggml.c");
|
|
509
|
+
if (!fs.existsSync(target)) {
|
|
510
|
+
throw new Error(
|
|
511
|
+
`[compile-libllama] Cannot patch ggml.c: file not found at ${target}. ` +
|
|
512
|
+
`Has the llama.cpp source layout changed in a newer pin?`,
|
|
513
|
+
);
|
|
514
|
+
}
|
|
515
|
+
const sentinel = path.join(
|
|
516
|
+
srcDir,
|
|
517
|
+
`.musl-execinfo-patched.${LLAMA_CPP_COMMIT}`,
|
|
518
|
+
);
|
|
519
|
+
if (fs.existsSync(sentinel)) {
|
|
520
|
+
return;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
const original = fs.readFileSync(target, "utf8");
|
|
524
|
+
|
|
525
|
+
// Already-fixed: pin includes the `__GLIBC__` guard upstream. Just write
|
|
526
|
+
// the sentinel so subsequent cached runs short-circuit.
|
|
527
|
+
if (
|
|
528
|
+
original.includes("defined(__linux__) && defined(__GLIBC__)") &&
|
|
529
|
+
original.includes("#include <execinfo.h>")
|
|
530
|
+
) {
|
|
531
|
+
fs.writeFileSync(sentinel, `${LLAMA_CPP_COMMIT}\n`, "utf8");
|
|
532
|
+
log(
|
|
533
|
+
`[compile-libllama] ggml/src/ggml.c already gates <execinfo.h> on __GLIBC__; no patch needed.`,
|
|
534
|
+
);
|
|
535
|
+
return;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
// Legacy b3490-style block. Exact pre-image match required so we don't
|
|
539
|
+
// silently no-op on partial source drift.
|
|
540
|
+
const preImage =
|
|
541
|
+
"#if defined(__linux__)\n" +
|
|
542
|
+
"#include <execinfo.h>\n" +
|
|
543
|
+
"static void ggml_print_backtrace_symbols(void) {\n" +
|
|
544
|
+
" void * trace[100];\n" +
|
|
545
|
+
" int nptrs = backtrace(trace, sizeof(trace)/sizeof(trace[0]));\n" +
|
|
546
|
+
" backtrace_symbols_fd(trace, nptrs, STDERR_FILENO);\n" +
|
|
547
|
+
"}\n" +
|
|
548
|
+
"#else\n" +
|
|
549
|
+
"static void ggml_print_backtrace_symbols(void) {\n" +
|
|
550
|
+
" // platform not supported\n" +
|
|
551
|
+
"}\n" +
|
|
552
|
+
"#endif\n";
|
|
553
|
+
if (!original.includes(preImage)) {
|
|
554
|
+
throw new Error(
|
|
555
|
+
`[compile-libllama] Could not locate expected execinfo.h block in ggml.c, ` +
|
|
556
|
+
`and the file does not already use the __GLIBC__ guard. The llama.cpp ` +
|
|
557
|
+
`source layout drifted; update patchLlamaCppSourceForMusl() before bumping ` +
|
|
558
|
+
`LLAMA_CPP_COMMIT. Looked at ${target}.`,
|
|
559
|
+
);
|
|
560
|
+
}
|
|
561
|
+
const postImage =
|
|
562
|
+
"#if defined(__linux__) && defined(__GLIBC__)\n" +
|
|
563
|
+
"#include <execinfo.h>\n" +
|
|
564
|
+
"static void ggml_print_backtrace_symbols(void) {\n" +
|
|
565
|
+
" void * trace[100];\n" +
|
|
566
|
+
" int nptrs = backtrace(trace, sizeof(trace)/sizeof(trace[0]));\n" +
|
|
567
|
+
" backtrace_symbols_fd(trace, nptrs, STDERR_FILENO);\n" +
|
|
568
|
+
"}\n" +
|
|
569
|
+
"#else\n" +
|
|
570
|
+
"static void ggml_print_backtrace_symbols(void) {\n" +
|
|
571
|
+
" // platform not supported (musl libc has no execinfo.h)\n" +
|
|
572
|
+
"}\n" +
|
|
573
|
+
"#endif\n";
|
|
574
|
+
fs.writeFileSync(target, original.replace(preImage, postImage), "utf8");
|
|
575
|
+
fs.writeFileSync(sentinel, `${LLAMA_CPP_COMMIT}\n`, "utf8");
|
|
576
|
+
log(
|
|
577
|
+
`[compile-libllama] Patched ggml/src/ggml.c to gate <execinfo.h> on __GLIBC__ (musl compatibility).`,
|
|
578
|
+
);
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
/**
|
|
582
|
+
* Write per-ABI `zig-cc` / `zig-cxx` driver scripts under
|
|
583
|
+
* `${cacheDir}/zig-driver/${abi}/` and return their absolute paths.
|
|
584
|
+
*
|
|
585
|
+
* Why we need a driver instead of `-DCMAKE_C_COMPILER=zig` plus
|
|
586
|
+
* `--target=...` in CMAKE_C_FLAGS:
|
|
587
|
+
* CMake invokes its CMAKE_C_COMPILER as a single binary, e.g.
|
|
588
|
+
* `zig --target=aarch64-linux-musl -c -o test.o test.c`
|
|
589
|
+
* zig parses `--target=aarch64-linux-musl` as an unknown top-level
|
|
590
|
+
* subcommand and bails before it even sees `-c`. The compiler probe
|
|
591
|
+
* fails and configure aborts. The fix is to wrap zig in a tiny driver
|
|
592
|
+
* that always front-prepends the `cc` / `c++` subcommand and the
|
|
593
|
+
* `--target=` flag, so cmake's invocation pattern just works.
|
|
594
|
+
*
|
|
595
|
+
* Driver scripts are written fresh on every run (they're cheap and
|
|
596
|
+
* stateless), so a stale cache from an older script version doesn't
|
|
597
|
+
* leak into a new one.
|
|
598
|
+
*
|
|
599
|
+
* Exported for unit testing.
|
|
600
|
+
*/
|
|
601
|
+
export function ensureZigDrivers({ cacheDir, abi, zigBin = "zig" }) {
|
|
602
|
+
const target = ABI_TARGETS.find((t) => t.androidAbi === abi);
|
|
603
|
+
if (!target) {
|
|
604
|
+
throw new Error(`[compile-libllama] Unknown ABI: ${abi}`);
|
|
605
|
+
}
|
|
606
|
+
const driverDir = path.join(cacheDir, "zig-driver", abi);
|
|
607
|
+
fs.mkdirSync(driverDir, { recursive: true });
|
|
608
|
+
const ccPath = path.join(driverDir, "zig-cc");
|
|
609
|
+
const cxxPath = path.join(driverDir, "zig-cxx");
|
|
610
|
+
// Quote zigBin so a path with spaces still works. The driver runs under
|
|
611
|
+
// /bin/sh which is POSIX-portable across Linux, macOS, Alpine.
|
|
612
|
+
const ccBody =
|
|
613
|
+
"#!/bin/sh\n" +
|
|
614
|
+
"# Auto-generated by eliza/packages/app-core/scripts/aosp/compile-libllama.mjs.\n" +
|
|
615
|
+
"# Do not edit — regenerated on every build.\n" +
|
|
616
|
+
`exec "${zigBin}" cc --target=${target.zigTarget} "$@"\n`;
|
|
617
|
+
const cxxBody =
|
|
618
|
+
"#!/bin/sh\n" +
|
|
619
|
+
"# Auto-generated by eliza/packages/app-core/scripts/aosp/compile-libllama.mjs.\n" +
|
|
620
|
+
"# Do not edit — regenerated on every build.\n" +
|
|
621
|
+
`exec "${zigBin}" c++ --target=${target.zigTarget} "$@"\n`;
|
|
622
|
+
fs.writeFileSync(ccPath, ccBody, "utf8");
|
|
623
|
+
fs.writeFileSync(cxxPath, cxxBody, "utf8");
|
|
624
|
+
fs.chmodSync(ccPath, 0o755);
|
|
625
|
+
fs.chmodSync(cxxPath, 0o755);
|
|
626
|
+
return { ccPath, cxxPath };
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
/**
|
|
630
|
+
* Configure + build libllama.so + libggml.so for one ABI. Produces:
|
|
631
|
+
* <srcDir>/build-<abi>/src/libllama.so
|
|
632
|
+
* <srcDir>/build-<abi>/ggml/src/libggml.so
|
|
633
|
+
* and copies both into <abiAssetDir>/ after stripping.
|
|
634
|
+
*
|
|
635
|
+
* libllama.so has a NEEDED entry for libggml.so (`readelf -d`); the dynamic
|
|
636
|
+
* linker resolves it from the same dir at runtime via the LD_LIBRARY_PATH
|
|
637
|
+
* ElizaAgentService.java sets to the per-ABI asset dir. Without the
|
|
638
|
+
* libggml.so co-copy, dlopen(libllama.so) fails with
|
|
639
|
+
* "libggml.so: cannot open shared object file" the moment bun tries to
|
|
640
|
+
* load it via bun:ffi.
|
|
641
|
+
*
|
|
642
|
+
* Strip strategy: out-of-place via `zig objcopy --strip-all <src> <dst>` then
|
|
643
|
+
* rename. zig 0.13's objcopy truncates dst to 0 BEFORE reading src when
|
|
644
|
+
* src == dst, which destroys the binary on in-place strip. Falls back to
|
|
645
|
+
* system `strip` (which does in-place safely) if zig objcopy isn't available.
|
|
646
|
+
*/
|
|
647
|
+
export function buildLibllamaForAbi({
|
|
648
|
+
srcDir,
|
|
649
|
+
cacheDir,
|
|
650
|
+
abi,
|
|
651
|
+
abiAssetDir,
|
|
652
|
+
jobs,
|
|
653
|
+
zigBin = "zig",
|
|
654
|
+
log = console.log,
|
|
655
|
+
spawn = run,
|
|
656
|
+
}) {
|
|
657
|
+
const target = ABI_TARGETS.find((t) => t.androidAbi === abi);
|
|
658
|
+
if (!target) {
|
|
659
|
+
throw new Error(`[compile-libllama] Unknown ABI: ${abi}`);
|
|
660
|
+
}
|
|
661
|
+
const buildDir = path.join(srcDir, `build-${abi}`);
|
|
662
|
+
fs.mkdirSync(buildDir, { recursive: true });
|
|
663
|
+
|
|
664
|
+
// Per-ABI driver scripts that wrap `zig cc --target=<triple>` so cmake's
|
|
665
|
+
// single-binary compiler probe works. See ensureZigDrivers() for why
|
|
666
|
+
// passing `--target=` via CMAKE_C_FLAGS doesn't work on its own.
|
|
667
|
+
const { ccPath, cxxPath } = ensureZigDrivers({ cacheDir, abi, zigBin });
|
|
668
|
+
|
|
669
|
+
log(
|
|
670
|
+
`[compile-libllama] Configuring llama.cpp for ${abi} (${target.zigTarget}) in ${buildDir}`,
|
|
671
|
+
);
|
|
672
|
+
spawn(
|
|
673
|
+
"cmake",
|
|
674
|
+
[
|
|
675
|
+
"-S",
|
|
676
|
+
srcDir,
|
|
677
|
+
"-B",
|
|
678
|
+
buildDir,
|
|
679
|
+
"-DCMAKE_BUILD_TYPE=Release",
|
|
680
|
+
"-DBUILD_SHARED_LIBS=ON",
|
|
681
|
+
"-DLLAMA_BUILD_EXAMPLES=OFF",
|
|
682
|
+
"-DLLAMA_BUILD_TESTS=OFF",
|
|
683
|
+
// llama-server is required for the AOSP DFlash speculative-decode path
|
|
684
|
+
// (target + drafter share one process; aosp-llama-adapter.ts spawns this
|
|
685
|
+
// binary and routes inference over the OpenAI-compatible HTTP API). The
|
|
686
|
+
// server target also pulls in the JSON/HTTP common-lib pieces, but adds
|
|
687
|
+
// ~1.5 MB stripped per ABI; small price relative to the spec-decode
|
|
688
|
+
// throughput win.
|
|
689
|
+
"-DLLAMA_BUILD_SERVER=ON",
|
|
690
|
+
"-DLLAMA_CURL=OFF",
|
|
691
|
+
`-DCMAKE_C_COMPILER=${ccPath}`,
|
|
692
|
+
`-DCMAKE_CXX_COMPILER=${cxxPath}`,
|
|
693
|
+
// No launcher — the driver scripts do all the wrapping themselves.
|
|
694
|
+
"-DCMAKE_C_COMPILER_LAUNCHER=",
|
|
695
|
+
"-DCMAKE_CXX_COMPILER_LAUNCHER=",
|
|
696
|
+
"-DCMAKE_SYSTEM_NAME=Linux",
|
|
697
|
+
`-DCMAKE_SYSTEM_PROCESSOR=${target.cmakeProcessor}`,
|
|
698
|
+
// Disable host-arch-specific ISA so the resulting .so loads on any
|
|
699
|
+
// device of the target ABI. The default tunes for the build host's
|
|
700
|
+
// native cpu, which is wrong for a cross-build.
|
|
701
|
+
"-DGGML_NATIVE=OFF",
|
|
702
|
+
// Don't bake in an absolute RUNPATH to the build tree. The default
|
|
703
|
+
// CMAKE_BUILD_RPATH points at the per-ABI build dir, which is a
|
|
704
|
+
// path-leak in shipped APKs and adds dead lookup entries at runtime.
|
|
705
|
+
// Android's ElizaAgentService.java sets LD_LIBRARY_PATH to the
|
|
706
|
+
// per-ABI asset dir, so the dynamic linker resolves NEEDED siblings
|
|
707
|
+
// from there.
|
|
708
|
+
"-DCMAKE_SKIP_BUILD_RPATH=TRUE",
|
|
709
|
+
"-DCMAKE_SKIP_INSTALL_RPATH=TRUE",
|
|
710
|
+
"-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE",
|
|
711
|
+
"-DCMAKE_INSTALL_RPATH=",
|
|
712
|
+
],
|
|
713
|
+
{},
|
|
714
|
+
);
|
|
715
|
+
|
|
716
|
+
log(`[compile-libllama] Compiling libllama for ${abi} with -j${jobs}`);
|
|
717
|
+
spawn(
|
|
718
|
+
"cmake",
|
|
719
|
+
["--build", buildDir, "--target", "llama", "-j", String(jobs)],
|
|
720
|
+
{},
|
|
721
|
+
);
|
|
722
|
+
|
|
723
|
+
// llama-server target. Built in a second --target invocation so a future
|
|
724
|
+
// operator can disable it via a flag without touching the libllama target.
|
|
725
|
+
// The target name is `llama-server` on the apothic fork (verified against
|
|
726
|
+
// the upstream b8198 examples/server/CMakeLists.txt: `add_executable(
|
|
727
|
+
// ${TARGET} server.cpp ...)` with `set(TARGET llama-server)`).
|
|
728
|
+
log(`[compile-libllama] Compiling llama-server for ${abi} with -j${jobs}`);
|
|
729
|
+
spawn(
|
|
730
|
+
"cmake",
|
|
731
|
+
["--build", buildDir, "--target", "llama-server", "-j", String(jobs)],
|
|
732
|
+
{},
|
|
733
|
+
);
|
|
734
|
+
|
|
735
|
+
// libllama.so and the ggml shared-library family are all transitive build
|
|
736
|
+
// products of the `llama` target. b4500's NEEDED chain (verified via
|
|
737
|
+
// `readelf -d`):
|
|
738
|
+
// libllama.so -> libggml.so, libggml-cpu.so, libggml-base.so, libc.so
|
|
739
|
+
// libggml.so -> libggml-cpu.so, libggml-base.so, libc.so
|
|
740
|
+
// We co-copy every libggml*.so we find under the build tree alongside
|
|
741
|
+
// libllama.so so the dynamic linker resolves the whole graph from the
|
|
742
|
+
// per-ABI asset dir at runtime (LD_LIBRARY_PATH set by
|
|
743
|
+
// ElizaAgentService.java).
|
|
744
|
+
const builtLlama = locateBuiltLib(buildDir, "libllama.so");
|
|
745
|
+
if (!builtLlama) {
|
|
746
|
+
throw new Error(
|
|
747
|
+
`[compile-libllama] Could not locate built libllama.so anywhere under ${buildDir}.`,
|
|
748
|
+
);
|
|
749
|
+
}
|
|
750
|
+
const builtGgmlLibs = locateBuiltGgmlLibs(buildDir);
|
|
751
|
+
if (builtGgmlLibs.length === 0) {
|
|
752
|
+
throw new Error(
|
|
753
|
+
`[compile-libllama] Could not locate any libggml*.so under ${buildDir}. ` +
|
|
754
|
+
`libllama.so has NEEDED entries for the ggml family; without co-copying ` +
|
|
755
|
+
`them the runtime dlopen will fail. Check that BUILD_SHARED_LIBS=ON took effect.`,
|
|
756
|
+
);
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
fs.mkdirSync(abiAssetDir, { recursive: true });
|
|
760
|
+
const llamaOut = path.join(abiAssetDir, "libllama.so");
|
|
761
|
+
fs.copyFileSync(builtLlama, llamaOut);
|
|
762
|
+
const ggmlOuts = builtGgmlLibs.map((src) => {
|
|
763
|
+
const dst = path.join(abiAssetDir, path.basename(src));
|
|
764
|
+
fs.copyFileSync(src, dst);
|
|
765
|
+
return dst;
|
|
766
|
+
});
|
|
767
|
+
|
|
768
|
+
// The apothic fork builds with SONAME chains: libllama.so has
|
|
769
|
+
// SONAME=libllama.so.0 and NEEDED entries pointing at SONAME (e.g.
|
|
770
|
+
// "libggml.so.0"), not at the unversioned filename. The dynamic linker
|
|
771
|
+
// matches NEEDED against on-disk SONAME, so we must ship a copy at
|
|
772
|
+
// libfoo.so.0 (or the linker fails to resolve and dlopen returns NULL).
|
|
773
|
+
// We do NOT ship the .so.X.Y.Z versioned tail — only the SONAME alias
|
|
774
|
+
// that NEEDED references.
|
|
775
|
+
//
|
|
776
|
+
// Cost: ~5MB per ABI of duplicated content (the .so and .so.0 are
|
|
777
|
+
// identical). APK build dedupes identical files automatically; even
|
|
778
|
+
// without dedup this is well under the per-ABI .so budget.
|
|
779
|
+
const sonameAliases = [];
|
|
780
|
+
for (const out of [llamaOut, ...ggmlOuts]) {
|
|
781
|
+
const soname = readSoname(out);
|
|
782
|
+
if (soname && soname !== path.basename(out)) {
|
|
783
|
+
const aliasPath = path.join(abiAssetDir, soname);
|
|
784
|
+
fs.copyFileSync(out, aliasPath);
|
|
785
|
+
sonameAliases.push(aliasPath);
|
|
786
|
+
log(
|
|
787
|
+
`[compile-libllama] Copied ${path.basename(out)} -> ${soname} ` +
|
|
788
|
+
`(NEEDED-resolution alias for ${abi}).`,
|
|
789
|
+
);
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
// Locate + stage the llama-server binary. cmake puts it under
|
|
794
|
+
// `<build>/bin/llama-server` for upstream b8198 (and the apothic fork
|
|
795
|
+
// inherits the same install layout). Some older pins drop it at
|
|
796
|
+
// `<build>/llama-server`; check both.
|
|
797
|
+
const llamaServerSrcCandidates = [
|
|
798
|
+
path.join(buildDir, "bin", "llama-server"),
|
|
799
|
+
path.join(buildDir, "llama-server"),
|
|
800
|
+
];
|
|
801
|
+
const llamaServerSrc = llamaServerSrcCandidates.find((c) => fs.existsSync(c));
|
|
802
|
+
let llamaServerOut = null;
|
|
803
|
+
if (llamaServerSrc) {
|
|
804
|
+
llamaServerOut = path.join(abiAssetDir, "llama-server");
|
|
805
|
+
fs.copyFileSync(llamaServerSrc, llamaServerOut);
|
|
806
|
+
fs.chmodSync(llamaServerOut, 0o755);
|
|
807
|
+
log(
|
|
808
|
+
`[compile-libllama] Copied llama-server for ${abi} (${(fs.statSync(llamaServerOut).size / (1024 * 1024)).toFixed(2)} MB).`,
|
|
809
|
+
);
|
|
810
|
+
} else {
|
|
811
|
+
log(
|
|
812
|
+
`[compile-libllama] WARN: llama-server binary not found under ${buildDir}/bin/ or ${buildDir}/. ` +
|
|
813
|
+
`DFlash speculative decode on AOSP requires it; rebuild with -DLLAMA_BUILD_SERVER=ON.`,
|
|
814
|
+
);
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
const stripTargets = [...ggmlOuts, llamaOut, ...sonameAliases];
|
|
818
|
+
if (llamaServerOut) stripTargets.push(llamaServerOut);
|
|
819
|
+
for (const out of stripTargets) {
|
|
820
|
+
const sizeBefore = fs.statSync(out).size;
|
|
821
|
+
const stripped = stripBinary({ filePath: out, zigBin, log });
|
|
822
|
+
if (stripped) {
|
|
823
|
+
const sizeAfter = fs.statSync(out).size;
|
|
824
|
+
if (sizeAfter === 0) {
|
|
825
|
+
throw new Error(
|
|
826
|
+
`[compile-libllama] Strip produced an empty file at ${out} ` +
|
|
827
|
+
`(was ${sizeBefore} bytes). This is the zig objcopy in-place ` +
|
|
828
|
+
`truncation bug — the script is supposed to strip out-of-place.`,
|
|
829
|
+
);
|
|
830
|
+
}
|
|
831
|
+
log(
|
|
832
|
+
`[compile-libllama] Stripped ${path.basename(out)} for ${abi} (${sizeBefore} -> ${sizeAfter} bytes).`,
|
|
833
|
+
);
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
// Re-chmod llama-server after strip — system strip may reset perms.
|
|
837
|
+
if (llamaServerOut) fs.chmodSync(llamaServerOut, 0o755);
|
|
838
|
+
return { llama: llamaOut, ggml: ggmlOuts, llamaServer: llamaServerOut };
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
/**
|
|
842
|
+
* Compile `llama-shim/eliza_llama_shim.c` (next to this script) into
|
|
843
|
+
* `<abiAssetDir>/libeliza-llama-shim.so`. The shim provides
|
|
844
|
+
* pointer-style wrappers around llama.cpp's struct-by-value entry
|
|
845
|
+
* points that bun:ffi cannot call directly. See the file's header for
|
|
846
|
+
* the full rationale.
|
|
847
|
+
*
|
|
848
|
+
* Linkage:
|
|
849
|
+
* - Compiled with the same per-ABI zig driver used for llama.cpp
|
|
850
|
+
* (musl-linked, matches the bun-on-Android runtime ABI).
|
|
851
|
+
* - NEEDED-links libllama.so via `-L<abiAssetDir> -lllama`. Runtime
|
|
852
|
+
* resolution comes through the per-ABI LD_LIBRARY_PATH that the
|
|
853
|
+
* privileged AOSP system app's agent service sets — same mechanism
|
|
854
|
+
* libllama.so uses to find libggml*.so.
|
|
855
|
+
* - RUNPATH stripped (`-Wl,--disable-new-dtags` + no -rpath) so we don't
|
|
856
|
+
* bake in a build-host path.
|
|
857
|
+
*
|
|
858
|
+
* Output: `<abiAssetDir>/libeliza-llama-shim.so`, stripped to ~10-30 KB.
|
|
859
|
+
*
|
|
860
|
+
* Exported for tests so we can assert the compile invocation arguments
|
|
861
|
+
* without running zig end-to-end.
|
|
862
|
+
*/
|
|
863
|
+
export function buildShimForAbi({
|
|
864
|
+
cacheDir,
|
|
865
|
+
abi,
|
|
866
|
+
abiAssetDir,
|
|
867
|
+
shimSourcePath = path.join(here, "llama-shim", "eliza_llama_shim.c"),
|
|
868
|
+
llamaIncludeDir,
|
|
869
|
+
zigBin = "zig",
|
|
870
|
+
log = console.log,
|
|
871
|
+
spawn = run,
|
|
872
|
+
}) {
|
|
873
|
+
if (!fs.existsSync(shimSourcePath)) {
|
|
874
|
+
throw new Error(
|
|
875
|
+
`[compile-libllama] Shim source not found at ${shimSourcePath}. ` +
|
|
876
|
+
`Restore eliza/packages/app-core/scripts/aosp/llama-shim/eliza_llama_shim.c.`,
|
|
877
|
+
);
|
|
878
|
+
}
|
|
879
|
+
if (!fs.existsSync(llamaIncludeDir)) {
|
|
880
|
+
throw new Error(
|
|
881
|
+
`[compile-libllama] llama.h include dir missing at ${llamaIncludeDir}. ` +
|
|
882
|
+
`Did the llama.cpp checkout fail?`,
|
|
883
|
+
);
|
|
884
|
+
}
|
|
885
|
+
const llamaSo = path.join(abiAssetDir, "libllama.so");
|
|
886
|
+
if (!fs.existsSync(llamaSo)) {
|
|
887
|
+
throw new Error(
|
|
888
|
+
`[compile-libllama] Cannot link shim: ${llamaSo} is missing. ` +
|
|
889
|
+
`Run buildLibllamaForAbi() before buildShimForAbi().`,
|
|
890
|
+
);
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
const { ccPath } = ensureZigDrivers({ cacheDir, abi, zigBin });
|
|
894
|
+
const shimOut = path.join(abiAssetDir, "libeliza-llama-shim.so");
|
|
895
|
+
|
|
896
|
+
// llama.h transitively includes ggml.h, which lives under ggml/include/
|
|
897
|
+
// in the llama.cpp tree (separate from the llama include dir). We pass
|
|
898
|
+
// both -I flags so the compiler resolves the full header chain.
|
|
899
|
+
const ggmlIncludeDir = path.resolve(llamaIncludeDir, "..", "ggml", "include");
|
|
900
|
+
if (!fs.existsSync(path.join(ggmlIncludeDir, "ggml.h"))) {
|
|
901
|
+
throw new Error(
|
|
902
|
+
`[compile-libllama] ggml.h missing under ${ggmlIncludeDir}. ` +
|
|
903
|
+
`llama.h transitively includes it; the layout of the cached ` +
|
|
904
|
+
`llama.cpp checkout may have changed.`,
|
|
905
|
+
);
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
log(
|
|
909
|
+
`[compile-libllama] Compiling libeliza-llama-shim.so for ${abi} (NEEDED libllama.so)`,
|
|
910
|
+
);
|
|
911
|
+
// -fPIC + -shared: build a position-independent shared object.
|
|
912
|
+
// -O2: matches llama.cpp's release optimization level.
|
|
913
|
+
// -I<include>: pick up llama.h from the cached llama.cpp checkout, and
|
|
914
|
+
// ggml.h from the ggml/include sibling.
|
|
915
|
+
// -L<abiAssetDir> -lllama: resolve libllama.so for the link step. The
|
|
916
|
+
// resulting .so has NEEDED libllama.so; runtime resolution is via
|
|
917
|
+
// LD_LIBRARY_PATH set by ElizaAgentService.java.
|
|
918
|
+
// -Wl,--disable-new-dtags + no -rpath: don't bake a RUNPATH that points
|
|
919
|
+
// at the build-host cache dir.
|
|
920
|
+
spawn(
|
|
921
|
+
ccPath,
|
|
922
|
+
[
|
|
923
|
+
"-shared",
|
|
924
|
+
"-fPIC",
|
|
925
|
+
"-O2",
|
|
926
|
+
`-I${llamaIncludeDir}`,
|
|
927
|
+
`-I${ggmlIncludeDir}`,
|
|
928
|
+
`-L${abiAssetDir}`,
|
|
929
|
+
"-Wl,--disable-new-dtags",
|
|
930
|
+
"-o",
|
|
931
|
+
shimOut,
|
|
932
|
+
shimSourcePath,
|
|
933
|
+
"-lllama",
|
|
934
|
+
],
|
|
935
|
+
{},
|
|
936
|
+
);
|
|
937
|
+
|
|
938
|
+
if (!fs.existsSync(shimOut)) {
|
|
939
|
+
throw new Error(
|
|
940
|
+
`[compile-libllama] Shim compile reported success but ${shimOut} is missing.`,
|
|
941
|
+
);
|
|
942
|
+
}
|
|
943
|
+
const sizeBefore = fs.statSync(shimOut).size;
|
|
944
|
+
const stripped = stripBinary({ filePath: shimOut, zigBin, log });
|
|
945
|
+
if (stripped) {
|
|
946
|
+
const sizeAfter = fs.statSync(shimOut).size;
|
|
947
|
+
if (sizeAfter === 0) {
|
|
948
|
+
throw new Error(
|
|
949
|
+
`[compile-libllama] Strip produced an empty libeliza-llama-shim.so ` +
|
|
950
|
+
`(was ${sizeBefore} bytes). This is the zig objcopy in-place ` +
|
|
951
|
+
`truncation bug — the script is supposed to strip out-of-place.`,
|
|
952
|
+
);
|
|
953
|
+
}
|
|
954
|
+
log(
|
|
955
|
+
`[compile-libllama] Stripped libeliza-llama-shim.so for ${abi} ` +
|
|
956
|
+
`(${sizeBefore} -> ${sizeAfter} bytes).`,
|
|
957
|
+
);
|
|
958
|
+
}
|
|
959
|
+
return shimOut;
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
/**
|
|
963
|
+
* Find every `libggml*.so` under the build tree. b4500 shipped plain .so
|
|
964
|
+
* files; the apothic fork (built off b8198) ships SONAME-versioned files
|
|
965
|
+
* (e.g. `libggml.so.0.9.7`) plus an unversioned symlink chain
|
|
966
|
+
* (`libggml.so` -> `libggml.so.0` -> `libggml.so.0.9.7`).
|
|
967
|
+
*
|
|
968
|
+
* Strategy: collect the unversioned `libggml*.so` symlink (matched by
|
|
969
|
+
* exact `.so` suffix — `.so.0` and `.so.0.9.7` are skipped) and copy via
|
|
970
|
+
* `fs.copyFileSync`, which follows the symlink and writes a real file at
|
|
971
|
+
* the asset destination. The asset dir then carries a regular `.so` file
|
|
972
|
+
* the dynamic linker can resolve directly via NEEDED entries — no need
|
|
973
|
+
* to ship the SONAME chain into the APK.
|
|
974
|
+
*/
|
|
975
|
+
function locateBuiltGgmlLibs(buildDir) {
|
|
976
|
+
const found = new Set();
|
|
977
|
+
const stack = [buildDir];
|
|
978
|
+
while (stack.length > 0) {
|
|
979
|
+
const dir = stack.pop();
|
|
980
|
+
let entries;
|
|
981
|
+
try {
|
|
982
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
983
|
+
} catch {
|
|
984
|
+
continue;
|
|
985
|
+
}
|
|
986
|
+
for (const entry of entries) {
|
|
987
|
+
if (entry.isDirectory()) {
|
|
988
|
+
if (
|
|
989
|
+
entry.name === "_deps" ||
|
|
990
|
+
entry.name === "CMakeFiles" ||
|
|
991
|
+
entry.name.startsWith(".")
|
|
992
|
+
) {
|
|
993
|
+
continue;
|
|
994
|
+
}
|
|
995
|
+
stack.push(path.join(dir, entry.name));
|
|
996
|
+
} else if (
|
|
997
|
+
// Accept both regular files (older pins) and symlinks (b8198+
|
|
998
|
+
// ships SONAME chains). Match `libggml*.so` exactly — the
|
|
999
|
+
// `.so.0` / `.so.X.Y.Z` SONAME copies are skipped because we
|
|
1000
|
+
// want the unversioned entry the dynamic linker resolves at
|
|
1001
|
+
// NEEDED-time.
|
|
1002
|
+
(entry.isFile() || entry.isSymbolicLink()) &&
|
|
1003
|
+
entry.name.startsWith("libggml") &&
|
|
1004
|
+
entry.name.endsWith(".so")
|
|
1005
|
+
) {
|
|
1006
|
+
found.add(path.join(dir, entry.name));
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
return [...found];
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
/**
|
|
1014
|
+
* Parse the DT_SONAME entry from a shared object's `.dynamic` section
|
|
1015
|
+
* without spawning a subprocess. Returns the SONAME string (e.g.
|
|
1016
|
+
* `"libllama.so.0"`) or `null` when absent or unparseable.
|
|
1017
|
+
*
|
|
1018
|
+
* Why parse manually instead of running `readelf -d`:
|
|
1019
|
+
* - `readelf` may not be on PATH on every CI/dev host.
|
|
1020
|
+
* - The script already runs in zig-cc / cmake mode; adding a third
|
|
1021
|
+
* external dependency is friction.
|
|
1022
|
+
* - The encoding is well-defined: ELF64, little-endian (zig builds
|
|
1023
|
+
* always produce LSB), find PT_DYNAMIC via PHDR table, walk
|
|
1024
|
+
* d_tag/d_un pairs looking for DT_SONAME (5), then index into
|
|
1025
|
+
* DT_STRTAB (5)'s string table.
|
|
1026
|
+
*
|
|
1027
|
+
* Falls back to null on any parse error so the caller can decide
|
|
1028
|
+
* whether to fail loud (NEEDED missing) or proceed.
|
|
1029
|
+
*
|
|
1030
|
+
* Exported for unit tests.
|
|
1031
|
+
*/
|
|
1032
|
+
export function readSoname(filePath) {
|
|
1033
|
+
let fd;
|
|
1034
|
+
try {
|
|
1035
|
+
fd = fs.openSync(filePath, "r");
|
|
1036
|
+
const head = Buffer.alloc(64); // ELF64 header is 64 bytes
|
|
1037
|
+
fs.readSync(fd, head, 0, 64, 0);
|
|
1038
|
+
if (
|
|
1039
|
+
head[0] !== 0x7f ||
|
|
1040
|
+
head[1] !== 0x45 ||
|
|
1041
|
+
head[2] !== 0x4c ||
|
|
1042
|
+
head[3] !== 0x46
|
|
1043
|
+
) {
|
|
1044
|
+
return null; // not ELF
|
|
1045
|
+
}
|
|
1046
|
+
const eiClass = head[4]; // 1=ELF32, 2=ELF64
|
|
1047
|
+
if (eiClass !== 2) return null;
|
|
1048
|
+
const eiData = head[5]; // 1=LSB, 2=MSB
|
|
1049
|
+
if (eiData !== 1) return null;
|
|
1050
|
+
const phoff = Number(head.readBigUInt64LE(0x20));
|
|
1051
|
+
const phentsize = head.readUInt16LE(0x36);
|
|
1052
|
+
const phnum = head.readUInt16LE(0x38);
|
|
1053
|
+
|
|
1054
|
+
// Find PT_DYNAMIC (p_type = 2)
|
|
1055
|
+
const phbuf = Buffer.alloc(phentsize * phnum);
|
|
1056
|
+
fs.readSync(fd, phbuf, 0, phbuf.length, phoff);
|
|
1057
|
+
let dynOff = -1;
|
|
1058
|
+
let dynSize = 0;
|
|
1059
|
+
for (let i = 0; i < phnum; i += 1) {
|
|
1060
|
+
const off = i * phentsize;
|
|
1061
|
+
const ptype = phbuf.readUInt32LE(off);
|
|
1062
|
+
if (ptype === 2) {
|
|
1063
|
+
dynOff = Number(phbuf.readBigUInt64LE(off + 0x08));
|
|
1064
|
+
dynSize = Number(phbuf.readBigUInt64LE(off + 0x20));
|
|
1065
|
+
break;
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
if (dynOff < 0) return null;
|
|
1069
|
+
|
|
1070
|
+
const dynBuf = Buffer.alloc(dynSize);
|
|
1071
|
+
fs.readSync(fd, dynBuf, 0, dynSize, dynOff);
|
|
1072
|
+
let sonameStrOff = -1;
|
|
1073
|
+
let strtabAddr = -1;
|
|
1074
|
+
let strtabSize = -1;
|
|
1075
|
+
// Walk DT_NEEDED (1), DT_STRTAB (5), DT_SONAME (14), DT_STRSZ (10)
|
|
1076
|
+
for (let i = 0; i < dynSize; i += 16) {
|
|
1077
|
+
const dTag = Number(dynBuf.readBigInt64LE(i));
|
|
1078
|
+
const dUn = Number(dynBuf.readBigUInt64LE(i + 8));
|
|
1079
|
+
if (dTag === 0) break; // DT_NULL
|
|
1080
|
+
if (dTag === 14) sonameStrOff = dUn; // DT_SONAME
|
|
1081
|
+
if (dTag === 5) strtabAddr = dUn; // DT_STRTAB
|
|
1082
|
+
if (dTag === 10) strtabSize = dUn; // DT_STRSZ
|
|
1083
|
+
}
|
|
1084
|
+
if (sonameStrOff < 0 || strtabAddr < 0 || strtabSize < 0) return null;
|
|
1085
|
+
|
|
1086
|
+
// DT_STRTAB is a virtual address; we need the file offset. Walk PHDRs
|
|
1087
|
+
// again to find the LOAD segment containing strtabAddr.
|
|
1088
|
+
let strtabFileOff = -1;
|
|
1089
|
+
for (let i = 0; i < phnum; i += 1) {
|
|
1090
|
+
const off = i * phentsize;
|
|
1091
|
+
const ptype = phbuf.readUInt32LE(off);
|
|
1092
|
+
if (ptype !== 1) continue; // PT_LOAD
|
|
1093
|
+
const pOffset = Number(phbuf.readBigUInt64LE(off + 0x08));
|
|
1094
|
+
const pVaddr = Number(phbuf.readBigUInt64LE(off + 0x10));
|
|
1095
|
+
const pFilesz = Number(phbuf.readBigUInt64LE(off + 0x20));
|
|
1096
|
+
if (strtabAddr >= pVaddr && strtabAddr < pVaddr + pFilesz) {
|
|
1097
|
+
strtabFileOff = pOffset + (strtabAddr - pVaddr);
|
|
1098
|
+
break;
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
if (strtabFileOff < 0) return null;
|
|
1102
|
+
|
|
1103
|
+
const strBuf = Buffer.alloc(strtabSize);
|
|
1104
|
+
fs.readSync(fd, strBuf, 0, strtabSize, strtabFileOff);
|
|
1105
|
+
if (sonameStrOff >= strtabSize) return null;
|
|
1106
|
+
const end = strBuf.indexOf(0, sonameStrOff);
|
|
1107
|
+
if (end < 0) return null;
|
|
1108
|
+
return strBuf.toString("utf8", sonameStrOff, end);
|
|
1109
|
+
} catch {
|
|
1110
|
+
return null;
|
|
1111
|
+
} finally {
|
|
1112
|
+
if (fd !== undefined) {
|
|
1113
|
+
try {
|
|
1114
|
+
fs.closeSync(fd);
|
|
1115
|
+
} catch {
|
|
1116
|
+
/* ignore */
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
function locateBuiltLib(buildDir, soName) {
|
|
1123
|
+
// Known cmake output dirs for llama.cpp b3490: libllama.so lands under
|
|
1124
|
+
// build/src, libggml.so lands under build/ggml/src. Other layouts are
|
|
1125
|
+
// possible if cmake's RUNTIME_OUTPUT_DIRECTORY changes upstream.
|
|
1126
|
+
const candidates = [
|
|
1127
|
+
path.join(buildDir, "src", soName),
|
|
1128
|
+
path.join(buildDir, "ggml", "src", soName),
|
|
1129
|
+
path.join(buildDir, soName),
|
|
1130
|
+
path.join(buildDir, "bin", soName),
|
|
1131
|
+
];
|
|
1132
|
+
for (const c of candidates) {
|
|
1133
|
+
if (fs.existsSync(c)) return c;
|
|
1134
|
+
}
|
|
1135
|
+
// Fallback: BFS through the build tree (skip CMake internals + _deps).
|
|
1136
|
+
const stack = [buildDir];
|
|
1137
|
+
while (stack.length > 0) {
|
|
1138
|
+
const dir = stack.pop();
|
|
1139
|
+
let entries;
|
|
1140
|
+
try {
|
|
1141
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
1142
|
+
} catch {
|
|
1143
|
+
continue;
|
|
1144
|
+
}
|
|
1145
|
+
for (const entry of entries) {
|
|
1146
|
+
if (entry.isDirectory()) {
|
|
1147
|
+
if (
|
|
1148
|
+
entry.name === "_deps" ||
|
|
1149
|
+
entry.name === "CMakeFiles" ||
|
|
1150
|
+
entry.name.startsWith(".")
|
|
1151
|
+
) {
|
|
1152
|
+
continue;
|
|
1153
|
+
}
|
|
1154
|
+
stack.push(path.join(dir, entry.name));
|
|
1155
|
+
} else if (
|
|
1156
|
+
// Accept files OR symlinks — the apothic fork builds with
|
|
1157
|
+
// SONAME chains where the unversioned `lib*.so` is a symlink.
|
|
1158
|
+
(entry.isFile() || entry.isSymbolicLink()) &&
|
|
1159
|
+
entry.name === soName
|
|
1160
|
+
) {
|
|
1161
|
+
return path.join(dir, entry.name);
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
}
|
|
1165
|
+
return null;
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
/**
|
|
1169
|
+
* Strip a shared object out-of-place, then atomically rename over the
|
|
1170
|
+
* original. zig 0.13's `zig objcopy --strip-all <src> <dst>` truncates dst
|
|
1171
|
+
* to 0 BEFORE it reads src when src == dst — the in-place pattern leaves
|
|
1172
|
+
* an empty file and a non-zero exit. Out-of-place is correct on every
|
|
1173
|
+
* platform (and is also what GNU strip does internally for cross-binaries).
|
|
1174
|
+
*
|
|
1175
|
+
* Falls back to system `strip --strip-all <file>` (in-place safe on
|
|
1176
|
+
* GNU coreutils) if `zig objcopy` is missing or errors.
|
|
1177
|
+
*/
|
|
1178
|
+
function stripBinary({ filePath, zigBin, log }) {
|
|
1179
|
+
const tmpPath = `${filePath}.stripped`;
|
|
1180
|
+
const zigStripResult = spawnSync(
|
|
1181
|
+
zigBin,
|
|
1182
|
+
["objcopy", "--strip-all", filePath, tmpPath],
|
|
1183
|
+
{
|
|
1184
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
1185
|
+
},
|
|
1186
|
+
);
|
|
1187
|
+
if (zigStripResult.status === 0 && fs.existsSync(tmpPath)) {
|
|
1188
|
+
const tmpSize = fs.statSync(tmpPath).size;
|
|
1189
|
+
if (tmpSize > 0) {
|
|
1190
|
+
fs.renameSync(tmpPath, filePath);
|
|
1191
|
+
return true;
|
|
1192
|
+
}
|
|
1193
|
+
// Defensive: zig wrote a zero-byte file. Discard and fall through to
|
|
1194
|
+
// system strip — better to ship with symbols than ship empty.
|
|
1195
|
+
log(
|
|
1196
|
+
`[compile-libllama] DEBUG: zig objcopy produced an empty ${path.basename(tmpPath)}; ` +
|
|
1197
|
+
`falling back to system strip.`,
|
|
1198
|
+
);
|
|
1199
|
+
fs.rmSync(tmpPath, { force: true });
|
|
1200
|
+
} else if (fs.existsSync(tmpPath)) {
|
|
1201
|
+
log(
|
|
1202
|
+
`[compile-libllama] DEBUG: zig objcopy failed (status=${zigStripResult.status}, ` +
|
|
1203
|
+
`error=${zigStripResult.error?.message ?? "none"}); falling back to system strip.`,
|
|
1204
|
+
);
|
|
1205
|
+
fs.rmSync(tmpPath, { force: true });
|
|
1206
|
+
} else if (zigStripResult.status !== 0) {
|
|
1207
|
+
log(
|
|
1208
|
+
`[compile-libllama] DEBUG: zig objcopy unavailable or failed (status=${zigStripResult.status}, ` +
|
|
1209
|
+
`error=${zigStripResult.error?.message ?? "none"}); falling back to system strip.`,
|
|
1210
|
+
);
|
|
1211
|
+
}
|
|
1212
|
+
// Fallback: system strip. GNU coreutils strip is in-place safe.
|
|
1213
|
+
const systemStripResult = spawnSync("strip", ["--strip-all", filePath], {
|
|
1214
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
1215
|
+
});
|
|
1216
|
+
if (systemStripResult.status === 0) return true;
|
|
1217
|
+
log(
|
|
1218
|
+
`[compile-libllama] WARN: could not strip ${filePath}; shipping with debug symbols.`,
|
|
1219
|
+
);
|
|
1220
|
+
return false;
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
export async function main(argv = process.argv.slice(2)) {
|
|
1224
|
+
const args = parseArgs(argv);
|
|
1225
|
+
|
|
1226
|
+
// Probe toolchain first so we fail loudly before doing any work.
|
|
1227
|
+
const zigVersion = probeZig();
|
|
1228
|
+
console.log(`[compile-libllama] Found zig ${zigVersion}`);
|
|
1229
|
+
|
|
1230
|
+
let allPresent = true;
|
|
1231
|
+
for (const abi of args.abis) {
|
|
1232
|
+
const llama = path.join(args.androidAssetsDir, abi, "libllama.so");
|
|
1233
|
+
const ggml = path.join(args.androidAssetsDir, abi, "libggml.so");
|
|
1234
|
+
const shim = path.join(
|
|
1235
|
+
args.androidAssetsDir,
|
|
1236
|
+
abi,
|
|
1237
|
+
"libeliza-llama-shim.so",
|
|
1238
|
+
);
|
|
1239
|
+
const llamaServer = path.join(args.androidAssetsDir, abi, "llama-server");
|
|
1240
|
+
if (
|
|
1241
|
+
!fs.existsSync(llama) ||
|
|
1242
|
+
!fs.existsSync(ggml) ||
|
|
1243
|
+
!fs.existsSync(shim) ||
|
|
1244
|
+
!fs.existsSync(llamaServer)
|
|
1245
|
+
) {
|
|
1246
|
+
allPresent = false;
|
|
1247
|
+
break;
|
|
1248
|
+
}
|
|
1249
|
+
}
|
|
1250
|
+
if (args.skipIfPresent && allPresent) {
|
|
1251
|
+
console.log(
|
|
1252
|
+
"[compile-libllama] All requested libllama.so files already present; --skip-if-present honoured.",
|
|
1253
|
+
);
|
|
1254
|
+
return;
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
let srcDir;
|
|
1258
|
+
let srcDescription;
|
|
1259
|
+
if (args.srcDir) {
|
|
1260
|
+
if (!fs.existsSync(path.join(args.srcDir, "CMakeLists.txt"))) {
|
|
1261
|
+
throw new Error(
|
|
1262
|
+
`[compile-libllama] --src-dir ${args.srcDir} does not contain a CMakeLists.txt; ` +
|
|
1263
|
+
`expected a llama.cpp / buun-llama-cpp checkout.`,
|
|
1264
|
+
);
|
|
1265
|
+
}
|
|
1266
|
+
srcDir = args.srcDir;
|
|
1267
|
+
let headRef = "(unknown)";
|
|
1268
|
+
try {
|
|
1269
|
+
headRef = fs.readFileSync(path.join(srcDir, ".git", "HEAD"), "utf8").trim();
|
|
1270
|
+
} catch {}
|
|
1271
|
+
console.log(
|
|
1272
|
+
`[compile-libllama] Using --src-dir ${srcDir} (HEAD: ${headRef}); ` +
|
|
1273
|
+
`pinned tag ${LLAMA_CPP_TAG} ignored.`,
|
|
1274
|
+
);
|
|
1275
|
+
srcDescription = `external src-dir ${srcDir}`;
|
|
1276
|
+
} else {
|
|
1277
|
+
srcDir = ensureLlamaCppCheckout({
|
|
1278
|
+
cacheDir: args.cacheDir,
|
|
1279
|
+
log: console.log,
|
|
1280
|
+
spawn: run,
|
|
1281
|
+
});
|
|
1282
|
+
srcDescription = `llama.cpp ${LLAMA_CPP_TAG} / ${LLAMA_CPP_COMMIT.slice(0, 12)}`;
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
for (const abi of args.abis) {
|
|
1286
|
+
const abiAssetDir = path.join(args.androidAssetsDir, abi);
|
|
1287
|
+
buildLibllamaForAbi({
|
|
1288
|
+
srcDir,
|
|
1289
|
+
cacheDir: args.cacheDir,
|
|
1290
|
+
abi,
|
|
1291
|
+
abiAssetDir,
|
|
1292
|
+
jobs: args.jobs,
|
|
1293
|
+
log: console.log,
|
|
1294
|
+
spawn: run,
|
|
1295
|
+
});
|
|
1296
|
+
// Compile the bun:ffi struct-by-value shim against the freshly built
|
|
1297
|
+
// libllama.so. Has to come AFTER the llama build because it links
|
|
1298
|
+
// against -lllama from <abiAssetDir>.
|
|
1299
|
+
buildShimForAbi({
|
|
1300
|
+
cacheDir: args.cacheDir,
|
|
1301
|
+
abi,
|
|
1302
|
+
abiAssetDir,
|
|
1303
|
+
llamaIncludeDir: path.join(srcDir, "include"),
|
|
1304
|
+
log: console.log,
|
|
1305
|
+
spawn: run,
|
|
1306
|
+
});
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
// Cross-compile the SIGSYS-handler shim + loader-wrap for x86_64. ARM64
|
|
1310
|
+
// skips this — its kernel ABI omits the legacy non-AT syscalls Android's
|
|
1311
|
+
// x86_64 seccomp filter traps on, so musl's wrappers there never invoke
|
|
1312
|
+
// a form the filter could block. The compile-shim main() short-circuits
|
|
1313
|
+
// when --skip-if-present is honoured.
|
|
1314
|
+
//
|
|
1315
|
+
// Staged into the APK by stage-android-agent.mjs: the wrapper takes the
|
|
1316
|
+
// place of `ld-musl-x86_64.so.1`, and the original Alpine loader is
|
|
1317
|
+
// renamed to `.so.1.real`. See seccomp-shim/sigsys-handler.c header for
|
|
1318
|
+
// the production-landing checklist.
|
|
1319
|
+
await compileShimMain(["--skip-if-present"]);
|
|
1320
|
+
|
|
1321
|
+
console.log(
|
|
1322
|
+
`[compile-libllama] Built libllama.so + libeliza-llama-shim.so + llama-server for ` +
|
|
1323
|
+
`${args.abis.join(", ")} (${srcDescription}).`,
|
|
1324
|
+
);
|
|
1325
|
+
}
|
|
1326
|
+
|
|
1327
|
+
const isMain =
|
|
1328
|
+
process.argv[1] &&
|
|
1329
|
+
path.resolve(process.argv[1]) === fileURLToPath(import.meta.url);
|
|
1330
|
+
|
|
1331
|
+
if (isMain) {
|
|
1332
|
+
await main();
|
|
1333
|
+
}
|