@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,1866 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Build the DFlash-capable llama-server fork used by local inference.
|
|
4
|
+
*
|
|
5
|
+
* As of v0.2.0-milady, DFlash speculative decoding lives in the unified
|
|
6
|
+
* milady-ai/llama.cpp fork (the same repo as the AOSP cross-compile).
|
|
7
|
+
* Pre-2026-05-09 this script consumed spiritbuun/buun-llama-cpp directly
|
|
8
|
+
* (which itself was 8,988 commits ahead of upstream b8198 with quant
|
|
9
|
+
* type IDs that conflicted with apothic's TBQ slots). Wave-3 agent A
|
|
10
|
+
* surgically ported the DFlash CLI surface (--spec-type dflash,
|
|
11
|
+
* --draft-min-prob, n_drafted_total/n_drafted_accepted_total Prometheus
|
|
12
|
+
* counters) onto the unified fork and retired the dual-fork situation.
|
|
13
|
+
* See docs/porting/unified-fork-strategy.md §H step 8 for the migration
|
|
14
|
+
* story. Override via ELIZA_DFLASH_LLAMA_CPP_REMOTE / _REF if you need
|
|
15
|
+
* to point at the legacy spiritbuun pin during a rollback.
|
|
16
|
+
*
|
|
17
|
+
* The script builds the unified fork into:
|
|
18
|
+
* $ELIZA_STATE_DIR/local-inference/bin/dflash/<platform>-<arch>-<backend>/
|
|
19
|
+
*
|
|
20
|
+
* Multi-target build matrix (see SUPPORTED_TARGETS below):
|
|
21
|
+
* linux-x64-cpu, linux-x64-cuda, linux-x64-rocm, linux-x64-vulkan
|
|
22
|
+
* android-arm64-cpu, android-arm64-vulkan
|
|
23
|
+
* darwin-arm64-metal, darwin-x64-metal
|
|
24
|
+
* windows-x64-cpu, windows-x64-cuda
|
|
25
|
+
*
|
|
26
|
+
* Backend selection (legacy single-target mode, when --target is omitted):
|
|
27
|
+
* macOS -> Metal
|
|
28
|
+
* Linux + nvcc -> CUDA
|
|
29
|
+
* Linux + rocminfo/hipcc -> ROCm/HIP
|
|
30
|
+
* otherwise -> CPU
|
|
31
|
+
*
|
|
32
|
+
* Usage:
|
|
33
|
+
* node build-llama-cpp-dflash.mjs [--target <triple>] [--all] [--dry-run]
|
|
34
|
+
* [--backend ...] [--ref ...] [--out-dir ...]
|
|
35
|
+
* [--jobs N] [--cache-dir ...]
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
import { spawnSync } from "node:child_process";
|
|
39
|
+
import fs from "node:fs";
|
|
40
|
+
import os from "node:os";
|
|
41
|
+
import path from "node:path";
|
|
42
|
+
import process from "node:process";
|
|
43
|
+
|
|
44
|
+
// Source-level omnivoice.cpp fusion (text + TTS sharing one llama.cpp
|
|
45
|
+
// build, one ggml pin, one kernel set). Helpers live alongside this
|
|
46
|
+
// script under omnivoice-fuse/; see omnivoice-fuse/README.md for the
|
|
47
|
+
// GGML pin reconciliation strategy.
|
|
48
|
+
import {
|
|
49
|
+
prepareOmnivoiceFusion,
|
|
50
|
+
OMNIVOICE_REF,
|
|
51
|
+
OMNIVOICE_GGML_REF,
|
|
52
|
+
} from "./omnivoice-fuse/prepare.mjs";
|
|
53
|
+
import {
|
|
54
|
+
appendCmakeGraft,
|
|
55
|
+
fusedExtraCmakeFlags,
|
|
56
|
+
fusedCmakeBuildTargets,
|
|
57
|
+
} from "./omnivoice-fuse/cmake-graft.mjs";
|
|
58
|
+
import { verifyFusedSymbols } from "./omnivoice-fuse/verify-symbols.mjs";
|
|
59
|
+
import { patchMetalKernels as patchMetalKernelsImpl } from "./kernel-patches/metal-kernels.mjs";
|
|
60
|
+
import { patchVulkanKernels as patchVulkanKernelsImpl } from "./kernel-patches/vulkan-kernels.mjs";
|
|
61
|
+
|
|
62
|
+
// milady-ai/llama.cpp @ v0.4.0-milady (commit 08032d57) — the unified fork
|
|
63
|
+
// that composes TBQ + QJL + Q4_POLAR + Metal kernels + DFlash spec-decode
|
|
64
|
+
// + W4-B CUDA QJL/Polar/TBQ3_TCQ kernels onto upstream b8198. Same repo +
|
|
65
|
+
// commit lineage as compile-libllama.mjs (AOSP cross-compile path) so both
|
|
66
|
+
// build paths land on identical kernels.
|
|
67
|
+
const REMOTE =
|
|
68
|
+
process.env.ELIZA_DFLASH_LLAMA_CPP_REMOTE ||
|
|
69
|
+
"https://github.com/milady-ai/llama.cpp.git";
|
|
70
|
+
const REF = process.env.ELIZA_DFLASH_LLAMA_CPP_REF || "v0.4.0-milady";
|
|
71
|
+
// Minimum commit on milady/integration that contains the DFlash CLI
|
|
72
|
+
// surface (--spec-type dflash, --draft-min-prob, Prometheus counters).
|
|
73
|
+
// Also satisfied by the W4-B v0.4.0-milady CUDA kernel additions.
|
|
74
|
+
const MIN_COMMIT = "7c7818aafc7599996268226e2e56099f4f38e972";
|
|
75
|
+
|
|
76
|
+
const SUPPORTED_TARGETS = [
|
|
77
|
+
"linux-x64-cpu",
|
|
78
|
+
"linux-x64-cuda",
|
|
79
|
+
"linux-x64-rocm",
|
|
80
|
+
"linux-x64-vulkan",
|
|
81
|
+
// Linux aarch64. Required for the `server-h200` tier (GH200 = aarch64
|
|
82
|
+
// host + H100/H200 GPU) and for Ampere Altra / AWS Graviton CPU-only
|
|
83
|
+
// deployments. Both targets require a real arm64 Linux host (or a
|
|
84
|
+
// sysroot + cross-toolchain for arm64) — there is no aarch64-cross
|
|
85
|
+
// wiring on x64 hosts in this script.
|
|
86
|
+
"linux-aarch64-cpu",
|
|
87
|
+
"linux-aarch64-cuda",
|
|
88
|
+
"android-arm64-cpu",
|
|
89
|
+
"android-arm64-vulkan",
|
|
90
|
+
"darwin-arm64-metal",
|
|
91
|
+
"darwin-x64-metal",
|
|
92
|
+
// iOS targets (require macOS host with Xcode). Output is a static .a +
|
|
93
|
+
// headers that the LlamaCpp.xcframework patch in
|
|
94
|
+
// packages/app-core/patches/llama-cpp-capacitor@0.1.5.patch consumes.
|
|
95
|
+
"ios-arm64-metal",
|
|
96
|
+
"ios-arm64-simulator-metal",
|
|
97
|
+
"windows-x64-cpu",
|
|
98
|
+
"windows-x64-cuda",
|
|
99
|
+
// windows-x64-vulkan: generic-GPU path on x64 Windows. NVIDIA/AMD/Intel
|
|
100
|
+
// ARC all expose Vulkan 1.3+ here. Cross-builds from a Linux/Darwin host
|
|
101
|
+
// via mingw + Khronos Vulkan-Headers — same shape as windows-x64-cpu but
|
|
102
|
+
// with the existing Vulkan-headers prep step.
|
|
103
|
+
"windows-x64-vulkan",
|
|
104
|
+
// Windows arm64 (Snapdragon X Elite / Copilot+ PC, 2024+). Adreno X1
|
|
105
|
+
// GPU is Vulkan 1.3; the 12-core ARM CPU runs the NEON paths in
|
|
106
|
+
// qjl-cpu/polarquant-cpu. Both targets require an MSVC arm64
|
|
107
|
+
// cross-toolchain (or a native Windows arm64 host); there is no
|
|
108
|
+
// mingw arm64 cross-toolchain wiring here.
|
|
109
|
+
"windows-arm64-cpu",
|
|
110
|
+
"windows-arm64-vulkan",
|
|
111
|
+
// Fused text+TTS targets — source-level fusion of
|
|
112
|
+
// github.com/ServeurpersoCom/omnivoice.cpp into the same llama.cpp
|
|
113
|
+
// build. Produce one shared library (libelizainference) and one
|
|
114
|
+
// fused server binary that exposes both `llama_*` and `omnivoice_*`
|
|
115
|
+
// symbols. See packages/app-core/scripts/omnivoice-fuse/README.md
|
|
116
|
+
// for the GGML pin reconciliation strategy. The non-fused targets
|
|
117
|
+
// above remain unchanged; fused is purely additive.
|
|
118
|
+
"linux-x64-cpu-fused",
|
|
119
|
+
"linux-x64-cuda-fused",
|
|
120
|
+
"linux-x64-vulkan-fused",
|
|
121
|
+
"darwin-arm64-metal-fused",
|
|
122
|
+
"darwin-x64-metal-fused",
|
|
123
|
+
"windows-x64-cuda-fused",
|
|
124
|
+
];
|
|
125
|
+
|
|
126
|
+
// Targets that opt into omnivoice fusion. Membership in this set is
|
|
127
|
+
// the only way the fused-build code path activates — no env var
|
|
128
|
+
// shortcuts, no implicit upgrades from a non-fused target.
|
|
129
|
+
const FUSED_TARGETS = new Set([
|
|
130
|
+
"linux-x64-cpu-fused",
|
|
131
|
+
"linux-x64-cuda-fused",
|
|
132
|
+
"linux-x64-vulkan-fused",
|
|
133
|
+
"darwin-arm64-metal-fused",
|
|
134
|
+
"darwin-x64-metal-fused",
|
|
135
|
+
"windows-x64-cuda-fused",
|
|
136
|
+
]);
|
|
137
|
+
|
|
138
|
+
// Strip the "-fused" suffix when one is present, returning the base
|
|
139
|
+
// triple parseTarget() / cmakeFlagsForTarget() already understand.
|
|
140
|
+
// Calling this on a non-fused triple is a no-op.
|
|
141
|
+
function baseTargetTriple(target) {
|
|
142
|
+
return target.endsWith("-fused")
|
|
143
|
+
? target.slice(0, -"-fused".length)
|
|
144
|
+
: target;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function isFusedTarget(target) {
|
|
148
|
+
return FUSED_TARGETS.has(target);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function stateDir() {
|
|
152
|
+
return (
|
|
153
|
+
process.env.ELIZA_STATE_DIR?.trim() || path.join(os.homedir(), ".eliza")
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function run(cmd, args, opts = {}) {
|
|
158
|
+
const result = spawnSync(cmd, args, {
|
|
159
|
+
stdio: opts.capture ? ["ignore", "pipe", "pipe"] : "inherit",
|
|
160
|
+
cwd: opts.cwd,
|
|
161
|
+
env: { ...process.env, ...opts.env },
|
|
162
|
+
encoding: "utf8",
|
|
163
|
+
});
|
|
164
|
+
if (result.status !== 0) {
|
|
165
|
+
const detail = opts.capture
|
|
166
|
+
? `\nstdout:\n${result.stdout || ""}\nstderr:\n${result.stderr || ""}`
|
|
167
|
+
: "";
|
|
168
|
+
throw new Error(
|
|
169
|
+
`${cmd} ${args.join(" ")} failed with ${result.status}${detail}`,
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
return result.stdout?.trim() ?? "";
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function tryRun(cmd, args, opts = {}) {
|
|
176
|
+
return spawnSync(cmd, args, {
|
|
177
|
+
stdio: opts.capture ? ["ignore", "pipe", "pipe"] : "ignore",
|
|
178
|
+
cwd: opts.cwd,
|
|
179
|
+
env: { ...process.env, ...opts.env },
|
|
180
|
+
encoding: "utf8",
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function has(cmd) {
|
|
185
|
+
const result = spawnSync(cmd, ["--version"], {
|
|
186
|
+
stdio: "ignore",
|
|
187
|
+
env: process.env,
|
|
188
|
+
});
|
|
189
|
+
return result.status === 0;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
function detectBackend() {
|
|
193
|
+
const forced = process.env.ELIZA_DFLASH_BACKEND?.trim().toLowerCase();
|
|
194
|
+
if (forced) return forced;
|
|
195
|
+
if (process.platform === "darwin") return "metal";
|
|
196
|
+
if (process.platform === "linux" && (has("hipcc") || has("rocminfo"))) {
|
|
197
|
+
return "rocm";
|
|
198
|
+
}
|
|
199
|
+
if (process.platform === "linux" && (has("nvcc") || has("nvidia-smi"))) {
|
|
200
|
+
return "cuda";
|
|
201
|
+
}
|
|
202
|
+
return "cpu";
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// Resolve the Android NDK root.
|
|
206
|
+
//
|
|
207
|
+
// Order: $ANDROID_NDK_HOME, $ANDROID_NDK_ROOT, $ANDROID_NDK,
|
|
208
|
+
// $HOME/Android/Sdk/ndk/<sole-or-newest-subdir>.
|
|
209
|
+
function resolveAndroidNdk() {
|
|
210
|
+
const envCandidates = [
|
|
211
|
+
process.env.ANDROID_NDK_HOME,
|
|
212
|
+
process.env.ANDROID_NDK_ROOT,
|
|
213
|
+
process.env.ANDROID_NDK,
|
|
214
|
+
].filter((value) => typeof value === "string" && value.trim().length > 0);
|
|
215
|
+
for (const candidate of envCandidates) {
|
|
216
|
+
if (
|
|
217
|
+
fs.existsSync(
|
|
218
|
+
path.join(candidate, "build", "cmake", "android.toolchain.cmake"),
|
|
219
|
+
)
|
|
220
|
+
) {
|
|
221
|
+
return candidate;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
const ndkDir = path.join(os.homedir(), "Android", "Sdk", "ndk");
|
|
225
|
+
if (fs.existsSync(ndkDir)) {
|
|
226
|
+
const versions = fs
|
|
227
|
+
.readdirSync(ndkDir, { withFileTypes: true })
|
|
228
|
+
.filter((entry) => entry.isDirectory())
|
|
229
|
+
.map((entry) => entry.name)
|
|
230
|
+
.sort();
|
|
231
|
+
if (versions.length > 0) {
|
|
232
|
+
const chosen = path.join(ndkDir, versions[versions.length - 1]);
|
|
233
|
+
if (
|
|
234
|
+
fs.existsSync(
|
|
235
|
+
path.join(chosen, "build", "cmake", "android.toolchain.cmake"),
|
|
236
|
+
)
|
|
237
|
+
) {
|
|
238
|
+
return chosen;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
return null;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
// Find Vulkan headers usable for an Android build. Returns the include dir
|
|
246
|
+
// (i.e. the parent of `vulkan/`) or null.
|
|
247
|
+
//
|
|
248
|
+
// NDK r21+ bundles Vulkan headers under
|
|
249
|
+
// <ndk>/toolchains/llvm/prebuilt/<host>/sysroot/usr/include/vulkan/
|
|
250
|
+
// which is on the Android sysroot include path automatically. We still report
|
|
251
|
+
// the path so CAPABILITIES.json / logs can show where it came from.
|
|
252
|
+
function findAndroidVulkanInclude(ndk) {
|
|
253
|
+
if (!ndk) return null;
|
|
254
|
+
const hostDirs = ["linux-x86_64", "darwin-x86_64", "windows-x86_64"];
|
|
255
|
+
for (const host of hostDirs) {
|
|
256
|
+
const candidate = path.join(
|
|
257
|
+
ndk,
|
|
258
|
+
"toolchains",
|
|
259
|
+
"llvm",
|
|
260
|
+
"prebuilt",
|
|
261
|
+
host,
|
|
262
|
+
"sysroot",
|
|
263
|
+
"usr",
|
|
264
|
+
"include",
|
|
265
|
+
);
|
|
266
|
+
if (fs.existsSync(path.join(candidate, "vulkan", "vulkan_core.h"))) {
|
|
267
|
+
return candidate;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
return null;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
// Locate a glslc usable for the host. The Android NDK ships its own glslc
|
|
274
|
+
// under shader-tools/<host>/glslc.
|
|
275
|
+
function findGlslc(ndk) {
|
|
276
|
+
if (has("glslc")) return "glslc";
|
|
277
|
+
if (ndk) {
|
|
278
|
+
const hostDirs = ["linux-x86_64", "darwin-x86_64", "windows-x86_64"];
|
|
279
|
+
for (const host of hostDirs) {
|
|
280
|
+
const candidate = path.join(ndk, "shader-tools", host, "glslc");
|
|
281
|
+
if (fs.existsSync(candidate)) return candidate;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
return null;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
// Find a usable x86_64-w64-mingw32 cross-toolchain on the host.
|
|
288
|
+
//
|
|
289
|
+
// Search order:
|
|
290
|
+
// 1. $MILADY_MINGW_PREFIX (operator override; expects PATH-style prefix
|
|
291
|
+
// whose `bin/` contains x86_64-w64-mingw32-gcc)
|
|
292
|
+
// 2. PATH (apt-installed mingw-w64 lands here)
|
|
293
|
+
// 3. ~/.local/x86_64-w64-mingw32/usr/bin (user-local extracted .deb,
|
|
294
|
+
// see reports/porting/2026-05-09-w3/windows-cross-build.md for the
|
|
295
|
+
// no-root install recipe)
|
|
296
|
+
//
|
|
297
|
+
// On match: returns { gcc, gxx, windres, ar, ranlib, nm, objdump } so the
|
|
298
|
+
// toolchain file generator can emit absolute compiler paths and the
|
|
299
|
+
// symbol-verifier can run nm/objdump from the same toolset.
|
|
300
|
+
//
|
|
301
|
+
// Returns null when nothing usable was found.
|
|
302
|
+
function findMingwToolchain() {
|
|
303
|
+
// PATH-installed gcc-mingw-w64-x86-64 (apt-get install mingw-w64).
|
|
304
|
+
if (has("x86_64-w64-mingw32-gcc")) {
|
|
305
|
+
return {
|
|
306
|
+
gcc: "x86_64-w64-mingw32-gcc",
|
|
307
|
+
gxx: "x86_64-w64-mingw32-g++",
|
|
308
|
+
windres: "x86_64-w64-mingw32-windres",
|
|
309
|
+
ar: "x86_64-w64-mingw32-ar",
|
|
310
|
+
ranlib: "x86_64-w64-mingw32-ranlib",
|
|
311
|
+
nm: "x86_64-w64-mingw32-nm",
|
|
312
|
+
objdump: "x86_64-w64-mingw32-objdump",
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
// User-local extracted-from-deb install. The Ubuntu mingw-w64 packages
|
|
317
|
+
// pull in update-alternatives wrappers that aren't created when you
|
|
318
|
+
// dpkg-deb -x without root, so we resolve the explicit `*-posix` names
|
|
319
|
+
// and synthesize the canonical aliases at toolchain-write time.
|
|
320
|
+
const candidates = [];
|
|
321
|
+
const envPrefix = process.env.MILADY_MINGW_PREFIX?.trim();
|
|
322
|
+
if (envPrefix) candidates.push(path.join(envPrefix, "bin"));
|
|
323
|
+
candidates.push(
|
|
324
|
+
path.join(os.homedir(), ".local", "x86_64-w64-mingw32", "usr", "bin"),
|
|
325
|
+
);
|
|
326
|
+
|
|
327
|
+
for (const dir of candidates) {
|
|
328
|
+
const gccPosix = path.join(dir, "x86_64-w64-mingw32-gcc-posix");
|
|
329
|
+
const gccCanonical = path.join(dir, "x86_64-w64-mingw32-gcc");
|
|
330
|
+
const gxxPosix = path.join(dir, "x86_64-w64-mingw32-g++-posix");
|
|
331
|
+
const gxxCanonical = path.join(dir, "x86_64-w64-mingw32-g++");
|
|
332
|
+
const windres = path.join(dir, "x86_64-w64-mingw32-windres");
|
|
333
|
+
const gcc = fs.existsSync(gccCanonical)
|
|
334
|
+
? gccCanonical
|
|
335
|
+
: fs.existsSync(gccPosix)
|
|
336
|
+
? gccPosix
|
|
337
|
+
: null;
|
|
338
|
+
const gxx = fs.existsSync(gxxCanonical)
|
|
339
|
+
? gxxCanonical
|
|
340
|
+
: fs.existsSync(gxxPosix)
|
|
341
|
+
? gxxPosix
|
|
342
|
+
: null;
|
|
343
|
+
if (!gcc || !gxx) continue;
|
|
344
|
+
return {
|
|
345
|
+
gcc,
|
|
346
|
+
gxx,
|
|
347
|
+
windres: fs.existsSync(windres) ? windres : "x86_64-w64-mingw32-windres",
|
|
348
|
+
ar: path.join(dir, "x86_64-w64-mingw32-ar"),
|
|
349
|
+
ranlib: path.join(dir, "x86_64-w64-mingw32-ranlib"),
|
|
350
|
+
nm: path.join(dir, "x86_64-w64-mingw32-nm"),
|
|
351
|
+
objdump: path.join(dir, "x86_64-w64-mingw32-objdump"),
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
return null;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
// Resolve a stable, source-tree-independent cache dir for cross-toolchain
|
|
358
|
+
// scaffolding (mingw toolchain file + Win10 SDK shim header). We *can't*
|
|
359
|
+
// drop these next to the llama.cpp checkout — `ensureCheckout()` clones
|
|
360
|
+
// into an empty dir and refuses to clobber our toolchain files.
|
|
361
|
+
function mingwToolchainCacheDir() {
|
|
362
|
+
return path.join(os.homedir(), ".cache", "eliza-dflash", "mingw-toolchain");
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
// Write a CMake toolchain file targeting x86_64-w64-mingw32 plus a tiny
|
|
366
|
+
// "missing Windows 10 SDK shim" header that gets force-included into every
|
|
367
|
+
// translation unit. The shim defines THREAD_POWER_THROTTLING_STATE and
|
|
368
|
+
// related constants that mingw-w64 11.0 (Ubuntu 24.04) doesn't ship even
|
|
369
|
+
// though it advertises _WIN32_WINNT_WIN10.
|
|
370
|
+
//
|
|
371
|
+
// Why we need both:
|
|
372
|
+
// * cpp-httplib in the llama.cpp vendor tree hard-requires
|
|
373
|
+
// `_WIN32_WINNT >= 0x0A00` and uses CreateFile2.
|
|
374
|
+
// * ggml/src/ggml-cpu/ggml-cpu.c uses THREAD_POWER_THROTTLING_STATE
|
|
375
|
+
// (Win8+ API) under `#if _WIN32_WINNT >= 0x0602`. Bumping WINVER to
|
|
376
|
+
// 0x0A00 (required by the first point) triggers that branch, but
|
|
377
|
+
// mingw-w64 11.0's headers don't have the type. The shim provides
|
|
378
|
+
// the typedef with the same shape as the Microsoft SDK; the actual
|
|
379
|
+
// SetThreadInformation API is in kernel32.dll on Win8+ so the binary
|
|
380
|
+
// works at runtime.
|
|
381
|
+
//
|
|
382
|
+
// Returns the absolute path to the generated toolchain file.
|
|
383
|
+
function writeMingwToolchainFile({ mingw }) {
|
|
384
|
+
const toolchainDir = mingwToolchainCacheDir();
|
|
385
|
+
fs.mkdirSync(toolchainDir, { recursive: true });
|
|
386
|
+
const shimPath = path.join(toolchainDir, "milady-mingw-win-shim.h");
|
|
387
|
+
const shimBody = `/*
|
|
388
|
+
* Auto-generated by build-llama-cpp-dflash.mjs. Do not edit.
|
|
389
|
+
*
|
|
390
|
+
* Tiny shim for x86_64-w64-mingw32 cross-builds that lets us target the
|
|
391
|
+
* Windows 10 SDK (cpp-httplib hard-requires _WIN32_WINNT >= 0x0A00) on
|
|
392
|
+
* mingw-w64 11.0 (Ubuntu 24.04) headers, which don't ship the Win8
|
|
393
|
+
* THREAD_POWER_THROTTLING_STATE struct ggml-cpu.c references.
|
|
394
|
+
*/
|
|
395
|
+
#ifndef MILADY_MINGW_WIN_SHIM_H
|
|
396
|
+
#define MILADY_MINGW_WIN_SHIM_H
|
|
397
|
+
|
|
398
|
+
#include <windows.h>
|
|
399
|
+
|
|
400
|
+
#ifndef THREAD_POWER_THROTTLING_CURRENT_VERSION
|
|
401
|
+
#define THREAD_POWER_THROTTLING_CURRENT_VERSION 1
|
|
402
|
+
#define THREAD_POWER_THROTTLING_EXECUTION_SPEED 0x1
|
|
403
|
+
#define THREAD_POWER_THROTTLING_VALID_FLAGS THREAD_POWER_THROTTLING_EXECUTION_SPEED
|
|
404
|
+
|
|
405
|
+
typedef struct _THREAD_POWER_THROTTLING_STATE {
|
|
406
|
+
ULONG Version;
|
|
407
|
+
ULONG ControlMask;
|
|
408
|
+
ULONG StateMask;
|
|
409
|
+
} THREAD_POWER_THROTTLING_STATE, *PTHREAD_POWER_THROTTLING_STATE;
|
|
410
|
+
#endif
|
|
411
|
+
|
|
412
|
+
#endif /* MILADY_MINGW_WIN_SHIM_H */
|
|
413
|
+
`;
|
|
414
|
+
fs.writeFileSync(shimPath, shimBody, "utf8");
|
|
415
|
+
|
|
416
|
+
const toolchainPath = path.join(toolchainDir, "mingw-x86_64.cmake");
|
|
417
|
+
const body = `# Auto-generated by build-llama-cpp-dflash.mjs. Do not edit.
|
|
418
|
+
set(CMAKE_SYSTEM_NAME Windows)
|
|
419
|
+
set(CMAKE_SYSTEM_PROCESSOR x86_64)
|
|
420
|
+
set(CMAKE_C_COMPILER ${mingw.gcc})
|
|
421
|
+
set(CMAKE_CXX_COMPILER ${mingw.gxx})
|
|
422
|
+
set(CMAKE_RC_COMPILER ${mingw.windres})
|
|
423
|
+
set(CMAKE_AR ${mingw.ar})
|
|
424
|
+
set(CMAKE_RANLIB ${mingw.ranlib})
|
|
425
|
+
add_compile_definitions(_WIN32_WINNT=0x0A00 WINVER=0x0A00 NTDDI_VERSION=0x0A000000)
|
|
426
|
+
add_compile_options(-include "${shimPath.replace(/\\/g, "/")}")
|
|
427
|
+
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
|
428
|
+
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
|
429
|
+
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
|
430
|
+
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
|
431
|
+
`;
|
|
432
|
+
fs.writeFileSync(toolchainPath, body, "utf8");
|
|
433
|
+
return toolchainPath;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
// Patch the cached llama.cpp checkout's `ggml/src/CMakeLists.txt` so that
|
|
437
|
+
// `ggml-base` also compiles the QJL kernel sources from `ggml-cpu/qjl/`.
|
|
438
|
+
//
|
|
439
|
+
// Why: the milady-ai/llama.cpp fork places QJL function definitions in
|
|
440
|
+
// `ggml/src/ggml-cpu/qjl/quants-qjl.c` (i.e. the ggml-cpu compilation
|
|
441
|
+
// unit), but `ggml/src/ggml.c` (in ggml-base) references those symbols
|
|
442
|
+
// from the type-traits table. ELF allows unresolved DSO symbols at link
|
|
443
|
+
// time and resolves them via the runtime loader; PE/COFF doesn't, so
|
|
444
|
+
// `ggml-base.dll` fails to link with "undefined reference to
|
|
445
|
+
// quantize_qjl1_256" etc.
|
|
446
|
+
//
|
|
447
|
+
// The transitional fix is to compile the QJL sources into ggml-base on
|
|
448
|
+
// Windows shared-lib builds. Linux/macOS keep the original placement.
|
|
449
|
+
// Idempotent: checks for a sentinel marker in the file before patching.
|
|
450
|
+
//
|
|
451
|
+
// TODO(milady-ai/llama.cpp): land an upstream fix that either (a) moves
|
|
452
|
+
// the QJL function definitions into ggml-base, or (b) wires the
|
|
453
|
+
// type-traits table through a registration callback that ggml-cpu fills
|
|
454
|
+
// in at backend-load time. When that lands, this patch becomes a no-op
|
|
455
|
+
// and can be removed.
|
|
456
|
+
function patchGgmlBaseForWindowsQjl(cacheDir) {
|
|
457
|
+
const cmakeListsPath = path.join(cacheDir, "ggml", "src", "CMakeLists.txt");
|
|
458
|
+
if (!fs.existsSync(cmakeListsPath)) {
|
|
459
|
+
throw new Error(
|
|
460
|
+
`[dflash-build] patchGgmlBaseForWindowsQjl: ${cmakeListsPath} missing — fork layout broken`,
|
|
461
|
+
);
|
|
462
|
+
}
|
|
463
|
+
const original = fs.readFileSync(cmakeListsPath, "utf8");
|
|
464
|
+
const sentinel = "# MILADY-WINDOWS-QJL-IN-GGML-BASE";
|
|
465
|
+
if (original.includes(sentinel)) {
|
|
466
|
+
return; // already patched
|
|
467
|
+
}
|
|
468
|
+
const anchor = " polar_centroids.h\n gguf.cpp)";
|
|
469
|
+
if (!original.includes(anchor)) {
|
|
470
|
+
throw new Error(
|
|
471
|
+
`[dflash-build] patchGgmlBaseForWindowsQjl: anchor not found in ${cmakeListsPath}; ` +
|
|
472
|
+
`the milady-ai/llama.cpp fork layout has changed. Without this patch ` +
|
|
473
|
+
`Windows shared-lib builds will fail to link QJL symbols into ggml-base.dll.`,
|
|
474
|
+
);
|
|
475
|
+
}
|
|
476
|
+
const replacement = ` polar_centroids.h
|
|
477
|
+
gguf.cpp
|
|
478
|
+
${sentinel}
|
|
479
|
+
# PE/COFF requires every imported symbol to be resolved at
|
|
480
|
+
# link time; the QJL definitions in ggml-cpu/qjl/ are referenced
|
|
481
|
+
# from ggml.c (ggml-base), so on Windows shared-lib builds they
|
|
482
|
+
# must also live in ggml-base. Linux/macOS use the original
|
|
483
|
+
# ggml-cpu placement and ignore this duplicate.
|
|
484
|
+
ggml-cpu/qjl/quants-qjl.c
|
|
485
|
+
ggml-cpu/qjl/qjl_dispatch.c
|
|
486
|
+
ggml-cpu/qjl/qjl_projection.c
|
|
487
|
+
ggml-cpu/qjl/qjl_quantize_ref.c
|
|
488
|
+
ggml-cpu/qjl/qjl_quantize_avx2.c
|
|
489
|
+
ggml-cpu/qjl/qjl_quantize_neon.c
|
|
490
|
+
ggml-cpu/qjl/qjl_score_ref.c
|
|
491
|
+
ggml-cpu/qjl/qjl_score_avx2.c
|
|
492
|
+
ggml-cpu/qjl/qjl_score_neon.c)
|
|
493
|
+
target_include_directories(ggml-base PRIVATE ggml-cpu ggml-cpu/qjl ggml-cpu/qjl/include)`;
|
|
494
|
+
fs.writeFileSync(
|
|
495
|
+
cmakeListsPath,
|
|
496
|
+
original.replace(anchor, replacement),
|
|
497
|
+
"utf8",
|
|
498
|
+
);
|
|
499
|
+
console.log(
|
|
500
|
+
"[dflash-build] patched ggml/src/CMakeLists.txt to compile QJL kernels into ggml-base for Windows shared-lib build",
|
|
501
|
+
);
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
// The fork's `ggml-vulkan.cpp` includes <vulkan/vulkan.hpp> (Vulkan-Headers)
|
|
505
|
+
// and <spirv/unified1/spirv.hpp> (SPIRV-Headers). The Android NDK ships only
|
|
506
|
+
// the C-level vulkan.h and no SPIRV headers, so a cross-compile against the
|
|
507
|
+
// NDK alone fails at ~38–47% of the build with these headers missing.
|
|
508
|
+
//
|
|
509
|
+
// Fetch stable tagged checkouts of both Khronos header repos into the cache
|
|
510
|
+
// and return both include paths so callers can add them via -isystem.
|
|
511
|
+
const VULKAN_HEADERS_REPO = "https://github.com/KhronosGroup/Vulkan-Headers.git";
|
|
512
|
+
const VULKAN_HEADERS_REF = process.env.ELIZA_DFLASH_VULKAN_HEADERS_REF || "v1.3.295";
|
|
513
|
+
const SPIRV_HEADERS_REPO = "https://github.com/KhronosGroup/SPIRV-Headers.git";
|
|
514
|
+
const SPIRV_HEADERS_REF = process.env.ELIZA_DFLASH_SPIRV_HEADERS_REF || "vulkan-sdk-1.3.296.0";
|
|
515
|
+
|
|
516
|
+
function fetchHeadersRepo({ name, repo, ref, sentinelRel }) {
|
|
517
|
+
const cacheRoot = path.join(os.homedir(), ".cache", "eliza-dflash", name);
|
|
518
|
+
const includeDir = path.join(cacheRoot, "include");
|
|
519
|
+
if (fs.existsSync(path.join(includeDir, sentinelRel))) return includeDir;
|
|
520
|
+
if (!has("git")) {
|
|
521
|
+
throw new Error(
|
|
522
|
+
`Vulkan target requires ${name}; install git so I can fetch from ${repo} or set ELIZA_DFLASH_${name.toUpperCase().replace(/-/g, "_")}_DIR`,
|
|
523
|
+
);
|
|
524
|
+
}
|
|
525
|
+
fs.mkdirSync(path.dirname(cacheRoot), { recursive: true });
|
|
526
|
+
if (fs.existsSync(path.join(cacheRoot, ".git"))) {
|
|
527
|
+
run("git", ["fetch", "--depth=1", "origin", ref], { cwd: cacheRoot });
|
|
528
|
+
run("git", ["checkout", "FETCH_HEAD"], { cwd: cacheRoot });
|
|
529
|
+
} else {
|
|
530
|
+
run("git", ["clone", "--depth=1", "--branch", ref, repo, cacheRoot]);
|
|
531
|
+
}
|
|
532
|
+
if (!fs.existsSync(path.join(includeDir, sentinelRel))) {
|
|
533
|
+
throw new Error(
|
|
534
|
+
`${name} checkout at ${cacheRoot} is missing include/${sentinelRel}`,
|
|
535
|
+
);
|
|
536
|
+
}
|
|
537
|
+
console.log(`[dflash-build] ${name} ${ref} ready at ${includeDir}`);
|
|
538
|
+
return includeDir;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
function prepareVulkanHeaders() {
|
|
542
|
+
let vulkanInclude;
|
|
543
|
+
const explicitVulkan = process.env.ELIZA_DFLASH_VULKAN_HEADERS_DIR?.trim();
|
|
544
|
+
if (explicitVulkan && fs.existsSync(path.join(explicitVulkan, "vulkan", "vulkan.hpp"))) {
|
|
545
|
+
vulkanInclude = explicitVulkan;
|
|
546
|
+
} else {
|
|
547
|
+
vulkanInclude = fetchHeadersRepo({
|
|
548
|
+
name: "vulkan-headers",
|
|
549
|
+
repo: VULKAN_HEADERS_REPO,
|
|
550
|
+
ref: VULKAN_HEADERS_REF,
|
|
551
|
+
sentinelRel: path.join("vulkan", "vulkan.hpp"),
|
|
552
|
+
});
|
|
553
|
+
}
|
|
554
|
+
let spirvInclude;
|
|
555
|
+
const explicitSpirv = process.env.ELIZA_DFLASH_SPIRV_HEADERS_DIR?.trim();
|
|
556
|
+
if (
|
|
557
|
+
explicitSpirv &&
|
|
558
|
+
fs.existsSync(path.join(explicitSpirv, "spirv", "unified1", "spirv.hpp"))
|
|
559
|
+
) {
|
|
560
|
+
spirvInclude = explicitSpirv;
|
|
561
|
+
} else {
|
|
562
|
+
spirvInclude = fetchHeadersRepo({
|
|
563
|
+
name: "spirv-headers",
|
|
564
|
+
repo: SPIRV_HEADERS_REPO,
|
|
565
|
+
ref: SPIRV_HEADERS_REF,
|
|
566
|
+
sentinelRel: path.join("spirv", "unified1", "spirv.hpp"),
|
|
567
|
+
});
|
|
568
|
+
}
|
|
569
|
+
return { vulkanInclude, spirvInclude };
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
// Resolve the system libvulkan.so.1 on Linux when libvulkan-dev isn't
|
|
573
|
+
// installed. CMake's FindVulkan looks for libvulkan.so by name, but distro
|
|
574
|
+
// runtime packages ship only libvulkan.so.1; passing the resolved versioned
|
|
575
|
+
// path via -DVulkan_LIBRARY satisfies the package check.
|
|
576
|
+
function findLinuxLibVulkan() {
|
|
577
|
+
const candidates = [
|
|
578
|
+
"/usr/lib/x86_64-linux-gnu/libvulkan.so.1",
|
|
579
|
+
"/usr/lib64/libvulkan.so.1",
|
|
580
|
+
"/usr/lib/libvulkan.so.1",
|
|
581
|
+
"/usr/lib/x86_64-linux-gnu/libvulkan.so",
|
|
582
|
+
"/usr/lib64/libvulkan.so",
|
|
583
|
+
];
|
|
584
|
+
for (const candidate of candidates) {
|
|
585
|
+
if (fs.existsSync(candidate)) return candidate;
|
|
586
|
+
}
|
|
587
|
+
return null;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
// Previously swallowed fetch failures into a `null` return that silently
|
|
591
|
+
// dropped `-isystem` flags — Vulkan target then failed at cmake configure
|
|
592
|
+
// with a cryptic missing-header error several seconds later. Per AGENTS.md
|
|
593
|
+
// §3 (build-time exit non-zero), let the original error surface so the
|
|
594
|
+
// operator sees the cause and the failure point are co-located. Calling
|
|
595
|
+
// code now sees a real exception rather than a magic null sentinel.
|
|
596
|
+
function safelyPrepareVulkanHeaders() {
|
|
597
|
+
return prepareVulkanHeaders();
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
// Map a target triple to cmake configure flags.
|
|
601
|
+
//
|
|
602
|
+
// Notes / quirks:
|
|
603
|
+
// * Several targets explicitly disable other GPU backends so that probe
|
|
604
|
+
// code in ggml/src/CMakeLists.txt doesn't pull in an unrelated SDK.
|
|
605
|
+
// * Android cross-compile uses the NDK's bundled cmake toolchain.
|
|
606
|
+
// * GGML_NATIVE is on for host targets and OFF for cross-compiles
|
|
607
|
+
// (you can't sniff -march for a different ABI).
|
|
608
|
+
// Split a target triple into (platform, arch, backend, isSimulator).
|
|
609
|
+
// Handles the special-case 4-part `ios-arm64-simulator-metal` triple.
|
|
610
|
+
// The `-fused` suffix is stripped before parsing — fused triples reuse
|
|
611
|
+
// the underlying base triple's cmake/compat plumbing and only differ
|
|
612
|
+
// at the omnivoice-graft + final-link layer.
|
|
613
|
+
function parseTarget(target) {
|
|
614
|
+
const fused = isFusedTarget(target);
|
|
615
|
+
const parts = baseTargetTriple(target).split("-");
|
|
616
|
+
if (parts[0] === "ios" && parts[2] === "simulator") {
|
|
617
|
+
return {
|
|
618
|
+
platform: parts[0],
|
|
619
|
+
arch: parts[1],
|
|
620
|
+
backend: parts[3],
|
|
621
|
+
isSimulator: true,
|
|
622
|
+
fused,
|
|
623
|
+
};
|
|
624
|
+
}
|
|
625
|
+
return {
|
|
626
|
+
platform: parts[0],
|
|
627
|
+
arch: parts[1],
|
|
628
|
+
backend: parts[2],
|
|
629
|
+
isSimulator: false,
|
|
630
|
+
fused,
|
|
631
|
+
};
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
function cmakeFlagsForTarget(target, ctx) {
|
|
635
|
+
const { platform, arch, backend, isSimulator } = parseTarget(target);
|
|
636
|
+
const flags = ["-DLLAMA_BUILD_TESTS=OFF", "-DLLAMA_BUILD_EXAMPLES=ON"];
|
|
637
|
+
const isCross =
|
|
638
|
+
platform === "android" || platform === "windows" || platform === "ios";
|
|
639
|
+
flags.push(`-DGGML_NATIVE=${isCross ? "OFF" : "ON"}`);
|
|
640
|
+
|
|
641
|
+
// Disable backends we don't want by default; flip the chosen one back on.
|
|
642
|
+
const offByDefault = ["GGML_METAL", "GGML_CUDA", "GGML_HIP", "GGML_VULKAN"];
|
|
643
|
+
for (const name of offByDefault) flags.push(`-D${name}=OFF`);
|
|
644
|
+
|
|
645
|
+
if (backend === "metal") {
|
|
646
|
+
flags[flags.indexOf("-DGGML_METAL=OFF")] = "-DGGML_METAL=ON";
|
|
647
|
+
// EMBED_LIBRARY behavior:
|
|
648
|
+
//
|
|
649
|
+
// * iOS (later in this function) sets it to ON unconditionally —
|
|
650
|
+
// the static-archive build needs compiled metallib bytes baked
|
|
651
|
+
// into the framework via .incbin.
|
|
652
|
+
// * Darwin desktop (this branch) sets it OFF so the metallib is
|
|
653
|
+
// compiled at build time into a sidecar default.metallib that
|
|
654
|
+
// ships next to llama-server. The kernel-patches/metal-kernels
|
|
655
|
+
// CMakeLists patch hooks into the non-EMBED add_custom_command
|
|
656
|
+
// so each standalone shader (turbo3/turbo4/turbo3_tcq/qjl/polar)
|
|
657
|
+
// is compiled into its own .air and merged into default.metallib
|
|
658
|
+
// alongside ggml-metal.air.
|
|
659
|
+
//
|
|
660
|
+
// The EMBED path is patched by kernel-patches/metal-kernels.mjs
|
|
661
|
+
// to embed a compiled default.metallib instead of concatenated
|
|
662
|
+
// source. That keeps the standalone shader TUs separate and
|
|
663
|
+
// avoids duplicate block_* / constant declarations.
|
|
664
|
+
flags.push("-DGGML_METAL_EMBED_LIBRARY=OFF");
|
|
665
|
+
} else if (backend === "cuda") {
|
|
666
|
+
flags[flags.indexOf("-DGGML_CUDA=OFF")] = "-DGGML_CUDA=ON";
|
|
667
|
+
flags.push("-DGGML_CUDA_FA=ON", "-DGGML_CUDA_FA_ALL_QUANTS=ON");
|
|
668
|
+
// Pin a multi-arch fat-binary so a build host without a GPU does not
|
|
669
|
+
// emit a `sm_52`-only artifact (CMake's default = native probe).
|
|
670
|
+
// 90a → H200 / GH200 (sm_90a, the only arch with the new TMA / WGMMA paths)
|
|
671
|
+
// 90 → H100
|
|
672
|
+
// 89 → Ada / RTX 4090 / L4
|
|
673
|
+
// 86 → Ampere consumer / RTX 30xx
|
|
674
|
+
// 80 → A100 / data-center Ampere
|
|
675
|
+
// Operators that target an older card (sm_75 Turing, sm_70 Volta) can
|
|
676
|
+
// override via ELIZA_DFLASH_CMAKE_FLAGS=-DCMAKE_CUDA_ARCHITECTURES=...
|
|
677
|
+
// which appends after this list and wins.
|
|
678
|
+
flags.push('-DCMAKE_CUDA_ARCHITECTURES=90a;90;89;86;80');
|
|
679
|
+
} else if (backend === "rocm") {
|
|
680
|
+
flags[flags.indexOf("-DGGML_HIP=OFF")] = "-DGGML_HIP=ON";
|
|
681
|
+
} else if (backend === "vulkan") {
|
|
682
|
+
flags[flags.indexOf("-DGGML_VULKAN=OFF")] = "-DGGML_VULKAN=ON";
|
|
683
|
+
if (ctx.glslc) flags.push(`-DVulkan_GLSLC_EXECUTABLE=${ctx.glslc}`);
|
|
684
|
+
// The fork includes vulkan.hpp + spirv/unified1/spirv.hpp, neither of
|
|
685
|
+
// which ships in the NDK *or* in Linux libvulkan-runtime-only installs.
|
|
686
|
+
// ctx.vulkanHpp is the result of safelyPrepareVulkanHeaders() —
|
|
687
|
+
// { vulkanInclude, spirvInclude } pointing at fetched Khronos checkouts.
|
|
688
|
+
if (ctx.vulkanHpp) {
|
|
689
|
+
const isystem = [ctx.vulkanHpp.vulkanInclude, ctx.vulkanHpp.spirvInclude]
|
|
690
|
+
.filter(Boolean)
|
|
691
|
+
.map((p) => `-isystem ${p}`)
|
|
692
|
+
.join(" ");
|
|
693
|
+
if (isystem) flags.push(`-DCMAKE_CXX_FLAGS=${isystem}`);
|
|
694
|
+
// CMake's FindVulkan also needs Vulkan_INCLUDE_DIR / Vulkan_LIBRARY
|
|
695
|
+
// for its package check. On Linux without libvulkan-dev installed,
|
|
696
|
+
// we still have:
|
|
697
|
+
// - libvulkan.so.1 from the runtime package (Mesa / NVIDIA driver)
|
|
698
|
+
// - vulkan/vulkan.h in the fetched Khronos headers
|
|
699
|
+
// Wire those manually so the build doesn't need the SDK.
|
|
700
|
+
if (platform === "linux") {
|
|
701
|
+
const libVulkan = findLinuxLibVulkan();
|
|
702
|
+
if (libVulkan) {
|
|
703
|
+
flags.push(`-DVulkan_INCLUDE_DIR=${ctx.vulkanHpp.vulkanInclude}`);
|
|
704
|
+
flags.push(`-DVulkan_LIBRARY=${libVulkan}`);
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
if (platform === "android") {
|
|
711
|
+
if (!ctx.androidNdk) {
|
|
712
|
+
throw new Error(
|
|
713
|
+
"Android target requested but ANDROID_NDK_HOME is not set and no NDK was found under ~/Android/Sdk/ndk",
|
|
714
|
+
);
|
|
715
|
+
}
|
|
716
|
+
flags.push(
|
|
717
|
+
`-DCMAKE_TOOLCHAIN_FILE=${path.join(ctx.androidNdk, "build", "cmake", "android.toolchain.cmake")}`,
|
|
718
|
+
`-DANDROID_NDK=${ctx.androidNdk}`,
|
|
719
|
+
"-DANDROID_ABI=arm64-v8a",
|
|
720
|
+
"-DANDROID_PLATFORM=android-28",
|
|
721
|
+
// CURL is optional for llama-server and not part of the NDK sysroot.
|
|
722
|
+
"-DLLAMA_CURL=OFF",
|
|
723
|
+
);
|
|
724
|
+
if (backend === "vulkan" && ctx.androidVulkanInclude) {
|
|
725
|
+
// Mostly informational - the NDK sysroot already exposes vulkan/ on the
|
|
726
|
+
// include path. Pass it explicitly so CMake's FindVulkan succeeds even
|
|
727
|
+
// if upstream changes its detection.
|
|
728
|
+
flags.push(`-DVulkan_INCLUDE_DIR=${ctx.androidVulkanInclude}`);
|
|
729
|
+
}
|
|
730
|
+
} else if (platform === "windows") {
|
|
731
|
+
// Cross-build Windows DLLs from a Linux host via x86_64-w64-mingw32.
|
|
732
|
+
// ctx.mingwToolchainFile is set by build() when a usable mingw was
|
|
733
|
+
// found on PATH or under ~/.local/x86_64-w64-mingw32/. Operators on
|
|
734
|
+
// Windows itself bypass this and use the native MSVC/MinGW host
|
|
735
|
+
// toolchain — pass MINGW_TOOLCHAIN_FILE to override either path.
|
|
736
|
+
//
|
|
737
|
+
// arm64 Windows (Snapdragon X Elite, Copilot+ PC) requires either an
|
|
738
|
+
// MSVC arm64 cross-toolchain (CMake `-A ARM64` on a Windows host with
|
|
739
|
+
// MSVC build tools), or a clang/LLVM mingw arm64 cross-toolchain on
|
|
740
|
+
// a Linux host. There is no x86_64-w64-mingw32 → arm64 path, so
|
|
741
|
+
// arm64 builds on Linux hosts must pass MINGW_TOOLCHAIN_FILE
|
|
742
|
+
// explicitly pointing at a clang/LLVM arm64 toolchain file.
|
|
743
|
+
if (process.env.MINGW_TOOLCHAIN_FILE) {
|
|
744
|
+
flags.push(`-DCMAKE_TOOLCHAIN_FILE=${process.env.MINGW_TOOLCHAIN_FILE}`);
|
|
745
|
+
} else if (ctx.mingwToolchainFile && arch === "x64") {
|
|
746
|
+
flags.push(`-DCMAKE_TOOLCHAIN_FILE=${ctx.mingwToolchainFile}`);
|
|
747
|
+
}
|
|
748
|
+
if (arch === "arm64" && process.platform === "win32") {
|
|
749
|
+
// Native MSVC arm64 build. CMake's default (Visual Studio generator)
|
|
750
|
+
// honors -A ARM64 to select the arm64 toolset.
|
|
751
|
+
flags.push("-A", "ARM64");
|
|
752
|
+
}
|
|
753
|
+
// CURL isn't part of the cross-toolchain sysroot. cpp-httplib is
|
|
754
|
+
// statically vendored under llama.cpp/vendor/ and provides the HTTP
|
|
755
|
+
// surface llama-server needs.
|
|
756
|
+
flags.push("-DLLAMA_CURL=OFF");
|
|
757
|
+
if (backend === "cpu" && arch === "x64") {
|
|
758
|
+
// Enable AVX/AVX2/FMA/F16C explicitly. -DGGML_NATIVE=OFF is the
|
|
759
|
+
// right default for cross-builds (you can't sniff -march for a
|
|
760
|
+
// different machine), but AVX2 is the de-facto baseline for
|
|
761
|
+
// Windows x86_64 in 2026 and the QJL/Polar kernels have AVX2
|
|
762
|
+
// implementations that drop in here. Operators that target
|
|
763
|
+
// pre-Haswell CPUs can override via ELIZA_DFLASH_CMAKE_FLAGS.
|
|
764
|
+
flags.push(
|
|
765
|
+
"-DGGML_AVX=ON",
|
|
766
|
+
"-DGGML_AVX2=ON",
|
|
767
|
+
"-DGGML_FMA=ON",
|
|
768
|
+
"-DGGML_F16C=ON",
|
|
769
|
+
// OpenMP isn't usable from the mingw cross-toolchain without an
|
|
770
|
+
// extra runtime. ggml-cpu's std::thread fallback is fine.
|
|
771
|
+
"-DGGML_OPENMP=OFF",
|
|
772
|
+
// Build the multi-DLL split (llama.dll + ggml*.dll). Required by
|
|
773
|
+
// the milady distribution shape; the patchGgmlBaseForWindowsQjl
|
|
774
|
+
// pre-build step makes the QJL symbols resolve against ggml-base
|
|
775
|
+
// so the DLL link succeeds (PE/COFF doesn't allow unresolved DSO
|
|
776
|
+
// symbols at link time the way ELF does).
|
|
777
|
+
"-DBUILD_SHARED_LIBS=ON",
|
|
778
|
+
);
|
|
779
|
+
} else if (backend === "cpu" && arch === "arm64") {
|
|
780
|
+
// Snapdragon X Elite ships ARMv8.4-A + dotprod + i8mm + sve2.
|
|
781
|
+
// qjl-cpu/polarquant-cpu's NEON paths cover the dot-product
|
|
782
|
+
// primitive; OpenMP is still off because the mingw/clang arm64
|
|
783
|
+
// cross-toolchain doesn't ship libomp without extra setup.
|
|
784
|
+
flags.push(
|
|
785
|
+
"-DGGML_OPENMP=OFF",
|
|
786
|
+
"-DBUILD_SHARED_LIBS=ON",
|
|
787
|
+
);
|
|
788
|
+
}
|
|
789
|
+
// Statically link backends into llama-server.exe. With the default
|
|
790
|
+
// (BACKEND_DL=ON) MSVC builds, the dynamic loader looks for a generic
|
|
791
|
+
// `ggml_backend_init` export but ggml-cpu.dll only exports
|
|
792
|
+
// `ggml_backend_cpu_init` (per-backend symbol name), so the loader
|
|
793
|
+
// fails and inference can't run. -DGGML_BACKEND_DL=OFF embeds the
|
|
794
|
+
// backend's init directly into the binary.
|
|
795
|
+
flags.push("-DGGML_BACKEND_DL=OFF", "-DBUILD_SHARED_LIBS=OFF");
|
|
796
|
+
} else if (platform === "ios") {
|
|
797
|
+
// iOS cross-compile (host must be macOS with Xcode). The Capacitor
|
|
798
|
+
// plugin's xcframework patch consumes the resulting static archive +
|
|
799
|
+
// headers; we emit a static lib here so the patch can drop it into
|
|
800
|
+
// ios/Frameworks-xcframework/LlamaCpp.xcframework/ios-arm64{-simulator}/
|
|
801
|
+
// LlamaCpp.framework/.
|
|
802
|
+
flags.push(
|
|
803
|
+
"-DCMAKE_SYSTEM_NAME=iOS",
|
|
804
|
+
"-DCMAKE_OSX_ARCHITECTURES=arm64",
|
|
805
|
+
// iOS 14 covers every supported Capacitor target.
|
|
806
|
+
"-DCMAKE_OSX_DEPLOYMENT_TARGET=14.0",
|
|
807
|
+
// Capacitor plugin links the native code statically.
|
|
808
|
+
"-DBUILD_SHARED_LIBS=OFF",
|
|
809
|
+
// CURL isn't part of the iOS SDK and llama-server's HTTP isn't used
|
|
810
|
+
// on-device — disable to keep the static archive minimal.
|
|
811
|
+
"-DLLAMA_CURL=OFF",
|
|
812
|
+
// Don't try to build llama-server / llama-cli on iOS — they install
|
|
813
|
+
// as console executables and CMake's install(TARGETS …) errors with
|
|
814
|
+
// "no BUNDLE DESTINATION for MACOSX_BUNDLE executable" under the
|
|
815
|
+
// CMAKE_SYSTEM_NAME=iOS generator. Disable the entire tools and
|
|
816
|
+
// examples trees; iOS only needs the static llama / ggml libraries.
|
|
817
|
+
"-DLLAMA_BUILD_EXAMPLES=OFF",
|
|
818
|
+
"-DLLAMA_BUILD_TOOLS=OFF",
|
|
819
|
+
"-DLLAMA_BUILD_SERVER=OFF",
|
|
820
|
+
);
|
|
821
|
+
if (isSimulator) {
|
|
822
|
+
flags.push("-DCMAKE_OSX_SYSROOT=iphonesimulator");
|
|
823
|
+
} else {
|
|
824
|
+
flags.push("-DCMAKE_OSX_SYSROOT=iphoneos");
|
|
825
|
+
}
|
|
826
|
+
// iOS static-archive build needs compiled metallib data baked in via
|
|
827
|
+
// .incbin since there is no sidecar default.metallib next to a console
|
|
828
|
+
// binary. The Metal patcher rewrites the EMBED_LIBRARY CMake branch to
|
|
829
|
+
// compile ggml-metal.metal + the milady standalones into one metallib
|
|
830
|
+
// before embedding it.
|
|
831
|
+
const embedIdx = flags.indexOf("-DGGML_METAL_EMBED_LIBRARY=OFF");
|
|
832
|
+
if (embedIdx !== -1) {
|
|
833
|
+
flags[embedIdx] = "-DGGML_METAL_EMBED_LIBRARY=ON";
|
|
834
|
+
} else {
|
|
835
|
+
flags.push("-DGGML_METAL_EMBED_LIBRARY=ON");
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
const extra = process.env.ELIZA_DFLASH_CMAKE_FLAGS?.trim();
|
|
840
|
+
if (extra) flags.push(...extra.split(/\s+/).filter(Boolean));
|
|
841
|
+
return flags;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
// Inspect compatibility from the host point of view. Returns either
|
|
845
|
+
// { ok: true } or { ok: false, reason: string } so --all can skip cleanly.
|
|
846
|
+
function targetCompatibility(target, ctx) {
|
|
847
|
+
const { platform, arch, backend, fused } = parseTarget(target);
|
|
848
|
+
if (fused && (platform === "android" || platform === "ios")) {
|
|
849
|
+
return {
|
|
850
|
+
ok: false,
|
|
851
|
+
reason:
|
|
852
|
+
"fused (omnivoice-grafted) targets are desktop/server only — mobile fusion is not wired yet",
|
|
853
|
+
};
|
|
854
|
+
}
|
|
855
|
+
if (platform === "darwin" && process.platform !== "darwin") {
|
|
856
|
+
return { ok: false, reason: "darwin target requires macOS host" };
|
|
857
|
+
}
|
|
858
|
+
if (platform === "ios" && process.platform !== "darwin") {
|
|
859
|
+
return { ok: false, reason: "ios target requires macOS host with Xcode" };
|
|
860
|
+
}
|
|
861
|
+
if (platform === "linux" && process.platform !== "linux") {
|
|
862
|
+
return { ok: false, reason: "linux target requires linux host" };
|
|
863
|
+
}
|
|
864
|
+
// linux-aarch64-* requires an arm64 Linux host. There is no aarch64 cross
|
|
865
|
+
// toolchain wired in this script, so x64 hosts cannot produce aarch64
|
|
866
|
+
// binaries here. The GH200 / Graviton path is to run this on an arm64
|
|
867
|
+
// build runner.
|
|
868
|
+
if (platform === "linux" && arch === "aarch64" && process.arch !== "arm64") {
|
|
869
|
+
return {
|
|
870
|
+
ok: false,
|
|
871
|
+
reason:
|
|
872
|
+
"linux-aarch64 target requires an arm64 Linux host (no aarch64 cross-toolchain wired here; run on a real arm64 build runner)",
|
|
873
|
+
};
|
|
874
|
+
}
|
|
875
|
+
if (platform === "windows") {
|
|
876
|
+
// arm64 Windows builds need either a native MSVC arm64 host or an
|
|
877
|
+
// operator-supplied MINGW_TOOLCHAIN_FILE pointing at clang/LLVM
|
|
878
|
+
// arm64 cross-tools — the bundled mingw discovery only handles
|
|
879
|
+
// x86_64-w64-mingw32.
|
|
880
|
+
if (arch === "arm64") {
|
|
881
|
+
if (process.platform === "win32") return { ok: true };
|
|
882
|
+
if (process.env.MINGW_TOOLCHAIN_FILE) return { ok: true };
|
|
883
|
+
return {
|
|
884
|
+
ok: false,
|
|
885
|
+
reason:
|
|
886
|
+
"windows-arm64 target requires a native Windows arm64 host (MSVC -A ARM64) or MINGW_TOOLCHAIN_FILE pointing at a clang/LLVM aarch64-w64-mingw32 toolchain file",
|
|
887
|
+
};
|
|
888
|
+
}
|
|
889
|
+
if (process.platform === "win32") return { ok: true };
|
|
890
|
+
if (process.env.MINGW_TOOLCHAIN_FILE) return { ok: true };
|
|
891
|
+
if (ctx.mingwToolchainFile) return { ok: true };
|
|
892
|
+
return {
|
|
893
|
+
ok: false,
|
|
894
|
+
reason:
|
|
895
|
+
"windows target requires Windows host, MINGW_TOOLCHAIN_FILE, or mingw-w64 (apt-get install mingw-w64) / extracted .deb under ~/.local/x86_64-w64-mingw32/",
|
|
896
|
+
};
|
|
897
|
+
}
|
|
898
|
+
if (platform === "android") {
|
|
899
|
+
if (!ctx.androidNdk) {
|
|
900
|
+
return { ok: false, reason: "Android NDK not found" };
|
|
901
|
+
}
|
|
902
|
+
if (backend === "vulkan" && !ctx.androidVulkanInclude) {
|
|
903
|
+
return {
|
|
904
|
+
ok: false,
|
|
905
|
+
reason: "Android Vulkan headers not found in NDK sysroot",
|
|
906
|
+
};
|
|
907
|
+
}
|
|
908
|
+
return { ok: true };
|
|
909
|
+
}
|
|
910
|
+
if (backend === "cuda" && !has("nvcc")) {
|
|
911
|
+
return { ok: false, reason: "no nvcc (CUDA toolkit)" };
|
|
912
|
+
}
|
|
913
|
+
if (backend === "rocm" && !(has("hipcc") || has("rocminfo"))) {
|
|
914
|
+
return { ok: false, reason: "no hipcc / rocminfo" };
|
|
915
|
+
}
|
|
916
|
+
if (backend === "vulkan" && !ctx.glslc) {
|
|
917
|
+
return { ok: false, reason: "no glslc (Vulkan shader compiler)" };
|
|
918
|
+
}
|
|
919
|
+
if (backend === "metal" && process.platform !== "darwin") {
|
|
920
|
+
return { ok: false, reason: "metal requires macOS" };
|
|
921
|
+
}
|
|
922
|
+
return { ok: true };
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
// Map Node's process.arch to the triple's arch token. Linux uses
|
|
926
|
+
// `aarch64` in its triples (linux-aarch64-cuda); every other platform
|
|
927
|
+
// uses `arm64` (darwin-arm64-metal, windows-arm64-vulkan, android-arm64-*).
|
|
928
|
+
function nodeArchToTripleArch(platform) {
|
|
929
|
+
if (process.arch === "x64") return "x64";
|
|
930
|
+
if (process.arch === "arm64") return platform === "linux" ? "aarch64" : "arm64";
|
|
931
|
+
return process.arch;
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
function defaultTarget() {
|
|
935
|
+
const backend = detectBackend();
|
|
936
|
+
const platform =
|
|
937
|
+
process.platform === "win32" ? "windows" : process.platform;
|
|
938
|
+
const arch = nodeArchToTripleArch(platform);
|
|
939
|
+
return `${platform}-${arch}-${backend}`;
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
function parseArgs(argv) {
|
|
943
|
+
const args = {
|
|
944
|
+
// Renamed from buun-llama-cpp to milady-llama-cpp on the unified-fork
|
|
945
|
+
// migration. Old caches stay around harmlessly under the prior name —
|
|
946
|
+
// the new directory busts the cache so a fresh ref pull is forced.
|
|
947
|
+
cacheDir: path.join(
|
|
948
|
+
os.homedir(),
|
|
949
|
+
".cache",
|
|
950
|
+
"eliza-dflash",
|
|
951
|
+
"milady-llama-cpp",
|
|
952
|
+
),
|
|
953
|
+
outDirOverride: null,
|
|
954
|
+
targets: null, // null => single legacy target, otherwise an array
|
|
955
|
+
backend: null, // legacy --backend
|
|
956
|
+
ref: REF,
|
|
957
|
+
jobs: Math.max(1, Math.min(os.cpus().length, 16)),
|
|
958
|
+
dryRun: false,
|
|
959
|
+
all: false,
|
|
960
|
+
};
|
|
961
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
962
|
+
const arg = argv[i];
|
|
963
|
+
const next = () => {
|
|
964
|
+
const value = argv[i + 1];
|
|
965
|
+
if (!value || value.startsWith("--"))
|
|
966
|
+
throw new Error(`${arg} requires a value`);
|
|
967
|
+
i += 1;
|
|
968
|
+
return value;
|
|
969
|
+
};
|
|
970
|
+
if (arg === "--cache-dir") args.cacheDir = path.resolve(next());
|
|
971
|
+
else if (arg === "--out-dir") args.outDirOverride = path.resolve(next());
|
|
972
|
+
else if (arg === "--backend") args.backend = next();
|
|
973
|
+
else if (arg === "--target") {
|
|
974
|
+
const value = next();
|
|
975
|
+
if (!SUPPORTED_TARGETS.includes(value)) {
|
|
976
|
+
throw new Error(
|
|
977
|
+
`Unsupported --target ${value}. Supported: ${SUPPORTED_TARGETS.join(", ")}`,
|
|
978
|
+
);
|
|
979
|
+
}
|
|
980
|
+
args.targets = args.targets || [];
|
|
981
|
+
args.targets.push(value);
|
|
982
|
+
} else if (arg === "--all") args.all = true;
|
|
983
|
+
else if (arg === "--dry-run") args.dryRun = true;
|
|
984
|
+
else if (arg === "--ref") args.ref = next();
|
|
985
|
+
else if (arg === "--jobs" || arg === "-j")
|
|
986
|
+
args.jobs = Number.parseInt(next(), 10);
|
|
987
|
+
else if (arg === "--help" || arg === "-h") {
|
|
988
|
+
console.log(
|
|
989
|
+
[
|
|
990
|
+
"Usage: node build-llama-cpp-dflash.mjs [options]",
|
|
991
|
+
"",
|
|
992
|
+
"Targets (use --target one or more times, or --all):",
|
|
993
|
+
...SUPPORTED_TARGETS.map(
|
|
994
|
+
(t) =>
|
|
995
|
+
` ${t}${FUSED_TARGETS.has(t) ? " (fused: text + omnivoice TTS in one build)" : ""}`,
|
|
996
|
+
),
|
|
997
|
+
"",
|
|
998
|
+
"Fused targets perform source-level fusion of",
|
|
999
|
+
"github.com/ServeurpersoCom/omnivoice.cpp into the milady-ai/llama.cpp",
|
|
1000
|
+
"build, sharing one ggml pin and one kernel set.",
|
|
1001
|
+
`Pinned omnivoice commit: ${OMNIVOICE_REF}`,
|
|
1002
|
+
`Reconciled-out omnivoice ggml submodule: ${OMNIVOICE_GGML_REF}`,
|
|
1003
|
+
"See packages/app-core/scripts/omnivoice-fuse/README.md.",
|
|
1004
|
+
"",
|
|
1005
|
+
"Options:",
|
|
1006
|
+
" --target <triple> Build a specific target (repeatable).",
|
|
1007
|
+
" --all Build every host-compatible target.",
|
|
1008
|
+
" --dry-run Print cmake invocations without running.",
|
|
1009
|
+
" --backend <name> Legacy single-target backend selector.",
|
|
1010
|
+
" --ref <git-ref> Branch/tag/SHA of the fork to build.",
|
|
1011
|
+
" --out-dir <path> Override the output directory (single target).",
|
|
1012
|
+
" --cache-dir <path> Override the source checkout cache.",
|
|
1013
|
+
" --jobs N | -j N Parallel build jobs.",
|
|
1014
|
+
].join("\n"),
|
|
1015
|
+
);
|
|
1016
|
+
process.exit(0);
|
|
1017
|
+
} else {
|
|
1018
|
+
throw new Error(`Unknown argument: ${arg}`);
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
if (args.all && args.targets) {
|
|
1022
|
+
throw new Error("--all and --target are mutually exclusive");
|
|
1023
|
+
}
|
|
1024
|
+
return args;
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
function ensureCheckout(cacheDir, ref) {
|
|
1028
|
+
if (fs.existsSync(path.join(cacheDir, ".git"))) {
|
|
1029
|
+
run("git", ["fetch", "--depth=1", "origin", ref], { cwd: cacheDir });
|
|
1030
|
+
run("git", ["checkout", "FETCH_HEAD"], { cwd: cacheDir });
|
|
1031
|
+
// This checkout is a generated build cache owned by this script. Always
|
|
1032
|
+
// reset tracked and untracked source edits before applying our patch set
|
|
1033
|
+
// so stale kernel-patch artifacts from prior builds cannot leak into a
|
|
1034
|
+
// new artifact.
|
|
1035
|
+
run("git", ["reset", "--hard", "FETCH_HEAD"], { cwd: cacheDir });
|
|
1036
|
+
run("git", ["clean", "-fd"], { cwd: cacheDir });
|
|
1037
|
+
} else {
|
|
1038
|
+
fs.mkdirSync(path.dirname(cacheDir), { recursive: true });
|
|
1039
|
+
run("git", ["clone", "--depth=1", "--branch", ref, REMOTE, cacheDir]);
|
|
1040
|
+
}
|
|
1041
|
+
const head = run("git", ["rev-parse", "HEAD"], {
|
|
1042
|
+
cwd: cacheDir,
|
|
1043
|
+
capture: true,
|
|
1044
|
+
});
|
|
1045
|
+
console.log(`[dflash-build] checkout ${head}`);
|
|
1046
|
+
const ancestor = spawnSync(
|
|
1047
|
+
"git",
|
|
1048
|
+
["merge-base", "--is-ancestor", MIN_COMMIT, "HEAD"],
|
|
1049
|
+
{
|
|
1050
|
+
cwd: cacheDir,
|
|
1051
|
+
stdio: "ignore",
|
|
1052
|
+
},
|
|
1053
|
+
);
|
|
1054
|
+
if (ancestor.status !== 0) {
|
|
1055
|
+
const shallow = run("git", ["rev-parse", "--is-shallow-repository"], {
|
|
1056
|
+
cwd: cacheDir,
|
|
1057
|
+
capture: true,
|
|
1058
|
+
});
|
|
1059
|
+
if (shallow === "true") {
|
|
1060
|
+
console.log(
|
|
1061
|
+
`[dflash-build] shallow checkout; skipping ancestry check for minimum known-good DFlash/SWA commit ${MIN_COMMIT}`,
|
|
1062
|
+
);
|
|
1063
|
+
} else {
|
|
1064
|
+
console.warn(
|
|
1065
|
+
`[dflash-build] warning: HEAD does not contain minimum known-good DFlash/SWA commit ${MIN_COMMIT}`,
|
|
1066
|
+
);
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
return head;
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
// Real patch hooks: the v0.4.0-milady decorative log no-ops have been replaced
|
|
1073
|
+
// with kernel-patches/{metal,vulkan}-kernels.mjs implementations that actually
|
|
1074
|
+
// (a) copy the verified standalone shaders from packages/inference/{metal,vulkan}/
|
|
1075
|
+
// into the fork tree, and (b) for Metal, patch ggml/src/ggml-metal/CMakeLists.txt
|
|
1076
|
+
// to compile each standalone into its own .air and merge them into the
|
|
1077
|
+
// final default.metallib. Both helpers hard-throw on failure per AGENTS.md §3.
|
|
1078
|
+
//
|
|
1079
|
+
// What still doesn't fully ship at v0.4.0-milady (deferred dispatch wiring):
|
|
1080
|
+
//
|
|
1081
|
+
// * ggml-metal-ops.cpp / ggml-metal-device.m have NO dispatch sites for
|
|
1082
|
+
// the milady quant types (TBQ3_0, TBQ4_0, TBQ3_TCQ, QJL1_256, Q4_POLAR).
|
|
1083
|
+
// CUDA has them; Metal does not. After this patch the kernel symbols
|
|
1084
|
+
// (kernel_turbo3_dot, kernel_attn_score_qjl1_256, kernel_mul_mv_q4_polar_f32,
|
|
1085
|
+
// etc.) are present in default.metallib and `nm`/`strings` will see
|
|
1086
|
+
// them, but the runtime cannot yet select them via GGML_TYPE_*. That
|
|
1087
|
+
// wiring is a separate fork-internals patch and is the next agent's
|
|
1088
|
+
// mission.
|
|
1089
|
+
//
|
|
1090
|
+
// * The EMBED_LIBRARY=ON branch (used by iOS targets) is also patched:
|
|
1091
|
+
// it compiles ggml-metal.metal + the milady standalones as separate
|
|
1092
|
+
// .air files, merges them into one default.metallib, and embeds those
|
|
1093
|
+
// compiled bytes. That avoids duplicate source declarations while
|
|
1094
|
+
// shipping the same five kernel symbols as the desktop sidecar.
|
|
1095
|
+
//
|
|
1096
|
+
// * Vulkan: the 8 standalone .comp files are staged into
|
|
1097
|
+
// ggml/src/ggml-vulkan/vulkan-shaders/ (picked up by file(GLOB)),
|
|
1098
|
+
// vulkan-shaders-gen.cpp registers them via 8 string_to_spv() calls,
|
|
1099
|
+
// and ggml-vulkan.cpp now declares + creates 8 milady_* pipelines so the
|
|
1100
|
+
// SPV blobs are linked into libggml-vulkan.so. Symbol audit (`nm
|
|
1101
|
+
// libggml-vulkan.so | grep milady_`) passes; op-level dispatch routing
|
|
1102
|
+
// for GGML_OP_ATTN_SCORE_QJL and the milady GGML_TYPE_* values is the
|
|
1103
|
+
// remaining gap and is the next agent's mission. Incomplete Vulkan
|
|
1104
|
+
// artifacts are now publish-blocking: probeKernels() marks symbol-only
|
|
1105
|
+
// QJL/Polar/Turbo paths false until op-level dispatch is numerically
|
|
1106
|
+
// verified.
|
|
1107
|
+
function applyForkPatches(cacheDir, backend, target, { dryRun = false } = {}) {
|
|
1108
|
+
if (backend === "metal") {
|
|
1109
|
+
patchMetalKernelsImpl(cacheDir, { dryRun });
|
|
1110
|
+
}
|
|
1111
|
+
if (backend === "vulkan") {
|
|
1112
|
+
patchVulkanKernelsImpl(cacheDir, { dryRun, target });
|
|
1113
|
+
}
|
|
1114
|
+
if (target && target.startsWith("windows-")) {
|
|
1115
|
+
patchGgmlBaseForWindowsQjl(cacheDir);
|
|
1116
|
+
}
|
|
1117
|
+
// The same broken cross-library reference that bites Windows shared-lib
|
|
1118
|
+
// builds also bites darwin shared-lib builds: ggml.c (in ggml-base) calls
|
|
1119
|
+
// quantize_qjl1_256 / dequantize_row_qjl1_256 / quantize_row_qjl1_256_ref,
|
|
1120
|
+
// which live in ggml-cpu/qjl/. On darwin the BUILD_SHARED_LIBS_DEFAULT is
|
|
1121
|
+
// ON and ggml-base is linked with `-undefined error`, so the link fails
|
|
1122
|
+
// before a single Metal kernel can run. Folding the QJL TUs into ggml-base
|
|
1123
|
+
// resolves the symbols at link time without breaking the ggml-cpu build
|
|
1124
|
+
// (the duplicate object files in two libraries link cleanly because they
|
|
1125
|
+
// are part of the same .dylib at runtime). The same fix is independently
|
|
1126
|
+
// safe to apply to iOS static-archive builds. Idempotent via the
|
|
1127
|
+
// existing `# MILADY-WINDOWS-QJL-IN-GGML-BASE` sentinel inside
|
|
1128
|
+
// patchGgmlBaseForWindowsQjl().
|
|
1129
|
+
if (
|
|
1130
|
+
target &&
|
|
1131
|
+
(target.startsWith("darwin-") || target.startsWith("ios-"))
|
|
1132
|
+
) {
|
|
1133
|
+
patchGgmlBaseForWindowsQjl(cacheDir);
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
function isRuntimeLibrary(name) {
|
|
1138
|
+
return (
|
|
1139
|
+
/^lib.*\.(dylib|so|dll)$/.test(name) ||
|
|
1140
|
+
/^lib.*\.so\.\d/.test(name) ||
|
|
1141
|
+
/^lib.*\.\d+(\.\d+)*\.dylib$/.test(name) ||
|
|
1142
|
+
// mingw produces `ggml.dll`, `ggml-base.dll`, `ggml-cpu.dll` (no `lib`
|
|
1143
|
+
// prefix) for Windows shared-lib builds. Accept any plain `.dll`.
|
|
1144
|
+
/\.dll$/i.test(name)
|
|
1145
|
+
);
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
function makeDarwinInstallSelfContained(outDir, names, buildBinDir) {
|
|
1149
|
+
if (process.platform !== "darwin") return;
|
|
1150
|
+
for (const name of names) {
|
|
1151
|
+
const file = path.join(outDir, name);
|
|
1152
|
+
tryRun("install_name_tool", ["-delete_rpath", buildBinDir, file]);
|
|
1153
|
+
tryRun("install_name_tool", ["-delete_rpath", path.dirname(file), file]);
|
|
1154
|
+
tryRun("install_name_tool", ["-delete_rpath", outDir, file]);
|
|
1155
|
+
tryRun("install_name_tool", ["-delete_rpath", path.resolve(outDir), file]);
|
|
1156
|
+
const rpath = isRuntimeLibrary(name) ? "@loader_path" : "@executable_path";
|
|
1157
|
+
tryRun("install_name_tool", ["-delete_rpath", rpath, file]);
|
|
1158
|
+
tryRun("install_name_tool", ["-add_rpath", rpath, file]);
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
// Probe a freshly-built llama-server for kernel availability.
|
|
1163
|
+
//
|
|
1164
|
+
// For host targets, run `llama-server --help` and grep for kernel-specific
|
|
1165
|
+
// flags / cache-type names. For cross-compiled targets (e.g. Android) the
|
|
1166
|
+
// binary cannot run on the host; introspect the build directory for compiled
|
|
1167
|
+
// object files instead (e.g. ggml-cuda/turbo3.cu.o,
|
|
1168
|
+
// ggml-metal/turbo3.metal.air, etc.).
|
|
1169
|
+
function probeKernels(target, buildDir, outDir) {
|
|
1170
|
+
const { platform, backend } = parseTarget(target);
|
|
1171
|
+
const canRunOnHost = canRunTargetOnHost(target);
|
|
1172
|
+
const kernels = {
|
|
1173
|
+
dflash: false,
|
|
1174
|
+
turbo3: false,
|
|
1175
|
+
turbo4: false,
|
|
1176
|
+
turbo3_tcq: false,
|
|
1177
|
+
qjl_full: false,
|
|
1178
|
+
polarquant: false,
|
|
1179
|
+
lookahead: true, // upstream
|
|
1180
|
+
ngramDraft: true, // upstream
|
|
1181
|
+
};
|
|
1182
|
+
|
|
1183
|
+
if (canRunOnHost) {
|
|
1184
|
+
// On Windows the binary is named with .exe suffix; on macOS/Linux it has
|
|
1185
|
+
// no extension. Probe both so the kernel detection works on every host.
|
|
1186
|
+
const serverBinCandidates = [
|
|
1187
|
+
path.join(outDir, "llama-server"),
|
|
1188
|
+
path.join(outDir, "llama-server.exe"),
|
|
1189
|
+
];
|
|
1190
|
+
const serverBin =
|
|
1191
|
+
serverBinCandidates.find((p) => fs.existsSync(p)) ??
|
|
1192
|
+
serverBinCandidates[0];
|
|
1193
|
+
if (fs.existsSync(serverBin)) {
|
|
1194
|
+
const result = spawnSync(serverBin, ["--help"], {
|
|
1195
|
+
encoding: "utf8",
|
|
1196
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
1197
|
+
env: process.env,
|
|
1198
|
+
timeout: 30_000,
|
|
1199
|
+
});
|
|
1200
|
+
const help = `${result.stdout || ""}\n${result.stderr || ""}`;
|
|
1201
|
+
const lc = help.toLowerCase();
|
|
1202
|
+
kernels.dflash = /dflash/.test(lc);
|
|
1203
|
+
// The fork's CLI advertises tbq3_0/tbq4_0 as cache-type names (the
|
|
1204
|
+
// user-facing identifier for GGML_TYPE_TBQ3_0/_TBQ4_0). Also accept
|
|
1205
|
+
// the legacy `turbo3`/`turbo4` strings the original probe expected,
|
|
1206
|
+
// in case a future fork rev renames them back.
|
|
1207
|
+
kernels.turbo3 = /turbo3|tbq3_0/.test(lc);
|
|
1208
|
+
kernels.turbo4 = /turbo4|tbq4_0/.test(lc);
|
|
1209
|
+
kernels.turbo3_tcq = /turbo3[_-]?tcq|tcq|tbq3_tcq/.test(lc);
|
|
1210
|
+
kernels.qjl_full = /qjl[_-]?full|qjl|qjl1_256/.test(lc);
|
|
1211
|
+
kernels.polarquant = /polar(?:quant)?|q4[_-]?polar/.test(lc);
|
|
1212
|
+
// For Metal targets, also inspect default.metallib for kernel symbols.
|
|
1213
|
+
// This proves "the kernel is shipped", not that the kernel is reachable
|
|
1214
|
+
// from llama.cpp graph execution. The published `kernels` capability
|
|
1215
|
+
// map below intentionally stays dispatch-ready only; symbol-only
|
|
1216
|
+
// kernels are recorded in logs/README, not allowed to satisfy the
|
|
1217
|
+
// Eliza-1 runtime contract.
|
|
1218
|
+
if (backend === "metal") {
|
|
1219
|
+
const metallibPath = path.join(outDir, "default.metallib");
|
|
1220
|
+
if (fs.existsSync(metallibPath)) {
|
|
1221
|
+
const metallibBytes = fs.readFileSync(metallibPath);
|
|
1222
|
+
// .metallib is a Mach-O archive with embedded function names; a
|
|
1223
|
+
// straight buffer .indexOf works because the function names are
|
|
1224
|
+
// stored as zero-terminated C strings.
|
|
1225
|
+
const has = (sym) => metallibBytes.indexOf(sym) !== -1;
|
|
1226
|
+
if (has("kernel_turbo3_dot")) kernels.turbo3 = true;
|
|
1227
|
+
if (has("kernel_turbo4_dot")) kernels.turbo4 = true;
|
|
1228
|
+
if (has("kernel_turbo3_tcq_dot")) kernels.turbo3_tcq = true;
|
|
1229
|
+
if (
|
|
1230
|
+
has("kernel_attn_score_qjl1_256") ||
|
|
1231
|
+
has("kernel_get_rows_qjl1_256") ||
|
|
1232
|
+
has("kernel_mul_mv_qjl1_256_f32")
|
|
1233
|
+
) {
|
|
1234
|
+
kernels.qjl_full = true;
|
|
1235
|
+
}
|
|
1236
|
+
if (
|
|
1237
|
+
has("kernel_get_rows_q4_polar") ||
|
|
1238
|
+
has("kernel_mul_mv_q4_polar_f32")
|
|
1239
|
+
) {
|
|
1240
|
+
kernels.polarquant = true;
|
|
1241
|
+
}
|
|
1242
|
+
}
|
|
1243
|
+
}
|
|
1244
|
+
}
|
|
1245
|
+
} else {
|
|
1246
|
+
// Fall back to scanning compiled object files in the build directory.
|
|
1247
|
+
// Different backends emit different file extensions:
|
|
1248
|
+
// CUDA: ggml/src/ggml-cuda/<name>.cu.o
|
|
1249
|
+
// Metal: ggml/src/ggml-metal/<name>.metal.air (or .o for setup)
|
|
1250
|
+
// Vulkan: ggml/src/ggml-vulkan/<name>.cpp.o + compiled SPIR-V
|
|
1251
|
+
// CPU: ggml/src/ggml-cpu/<name>.cpp.o
|
|
1252
|
+
const objects = collectFilesUnder(buildDir, /\.(o|obj|air|spv)$/);
|
|
1253
|
+
const names = objects.join("\n").toLowerCase();
|
|
1254
|
+
// Per-backend kernels (CUDA/Metal/Vulkan emit per-kernel object files).
|
|
1255
|
+
kernels.dflash = /dflash|flash[-_]?attn[-_]?ext/.test(names);
|
|
1256
|
+
kernels.turbo3 = /turbo3/.test(names);
|
|
1257
|
+
kernels.turbo4 = /turbo4/.test(names);
|
|
1258
|
+
kernels.turbo3_tcq = /turbo3[-_]?tcq|tcq/.test(names);
|
|
1259
|
+
kernels.qjl_full = /qjl/.test(names);
|
|
1260
|
+
kernels.polarquant = /polar(?:quant)?|q4[-_]?polar/.test(names);
|
|
1261
|
+
// CPU build inlines the turbo quantization paths inside ggml-cpu and
|
|
1262
|
+
// links a single ggml-turbo-quant.c.o into ggml-base. Treat its presence
|
|
1263
|
+
// as evidence both turbo3 and turbo4 paths are compiled in. Likewise,
|
|
1264
|
+
// the fork wires DFlash through ggml-cpu's flash-attn entry, so dflash
|
|
1265
|
+
// is also implicit when ggml-turbo-quant is present on CPU targets.
|
|
1266
|
+
if (backend === "cpu" && /ggml-turbo-quant\.c\.o/.test(names)) {
|
|
1267
|
+
kernels.turbo3 = true;
|
|
1268
|
+
kernels.turbo4 = true;
|
|
1269
|
+
kernels.dflash = true;
|
|
1270
|
+
}
|
|
1271
|
+
// For non-CPU backends, presence of the backend's flash-attn unit is a
|
|
1272
|
+
// strong proxy for dflash (the fork hangs DFlash off the existing FA
|
|
1273
|
+
// kernel registration).
|
|
1274
|
+
if (
|
|
1275
|
+
!kernels.dflash &&
|
|
1276
|
+
(backend === "cuda" || backend === "vulkan" || backend === "metal") &&
|
|
1277
|
+
/(flash[-_]?attn|fattn)/.test(names)
|
|
1278
|
+
) {
|
|
1279
|
+
kernels.dflash = true;
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
// Honesty gate: Metal/Vulkan standalone shaders can compile and be present
|
|
1284
|
+
// as symbols/pipelines while still being unreachable or semantically wrong
|
|
1285
|
+
// through generic llama.cpp ops. Do not let symbol presence satisfy
|
|
1286
|
+
// AGENTS.md §3. Flip these back to true only after dedicated dispatch is
|
|
1287
|
+
// wired. Metal currently has a dedicated GGML_OP_ATTN_SCORE_QJL bridge;
|
|
1288
|
+
// Turbo and Polar remain symbol-only.
|
|
1289
|
+
if (backend === "metal") {
|
|
1290
|
+
const shipped = probeMetalShippedKernelSymbols(buildDir, outDir).symbols;
|
|
1291
|
+
kernels.turbo3 = false;
|
|
1292
|
+
kernels.turbo4 = false;
|
|
1293
|
+
kernels.turbo3_tcq = false;
|
|
1294
|
+
kernels.qjl_full = Boolean(shipped.qjl_full);
|
|
1295
|
+
kernels.polarquant = false;
|
|
1296
|
+
} else if (backend === "vulkan") {
|
|
1297
|
+
kernels.turbo3 = false;
|
|
1298
|
+
kernels.turbo4 = false;
|
|
1299
|
+
kernels.turbo3_tcq = false;
|
|
1300
|
+
kernels.qjl_full = false;
|
|
1301
|
+
kernels.polarquant = false;
|
|
1302
|
+
}
|
|
1303
|
+
return kernels;
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
function canRunTargetOnHost(target) {
|
|
1307
|
+
const { platform, arch } = parseTarget(target);
|
|
1308
|
+
if (platform === "android" || platform === "ios") return false;
|
|
1309
|
+
if (platform === "windows" && process.platform !== "win32") return false;
|
|
1310
|
+
if (platform === "darwin" && process.platform !== "darwin") return false;
|
|
1311
|
+
if (platform === "linux" && process.platform !== "linux") return false;
|
|
1312
|
+
// arm64 (Apple, Windows, Android) and aarch64 (Linux) both map to
|
|
1313
|
+
// process.arch === "arm64" on Node. x64 maps to "x64".
|
|
1314
|
+
if ((arch === "arm64" || arch === "aarch64") && process.arch !== "arm64") {
|
|
1315
|
+
return false;
|
|
1316
|
+
}
|
|
1317
|
+
if (arch === "x64" && process.arch !== "x64") return false;
|
|
1318
|
+
return true;
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
function collectFilesUnder(root, pattern) {
|
|
1322
|
+
const out = [];
|
|
1323
|
+
if (!fs.existsSync(root)) return out;
|
|
1324
|
+
const stack = [root];
|
|
1325
|
+
while (stack.length > 0) {
|
|
1326
|
+
const dir = stack.pop();
|
|
1327
|
+
let entries;
|
|
1328
|
+
try {
|
|
1329
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
1330
|
+
} catch {
|
|
1331
|
+
continue;
|
|
1332
|
+
}
|
|
1333
|
+
for (const entry of entries) {
|
|
1334
|
+
const full = path.join(dir, entry.name);
|
|
1335
|
+
if (entry.isDirectory()) stack.push(full);
|
|
1336
|
+
else if (entry.isFile() && pattern.test(entry.name)) out.push(full);
|
|
1337
|
+
}
|
|
1338
|
+
}
|
|
1339
|
+
return out;
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
// Per AGENTS.md §3, every Eliza-1 bundle MUST run dflash + turbo3 + turbo4 +
|
|
1343
|
+
// qjl + polar. probeKernels() returns the per-target detection map; this gate
|
|
1344
|
+
// translates that into a hard failure when a required kernel is absent.
|
|
1345
|
+
//
|
|
1346
|
+
// Returns the list of missing-but-required kernels. An empty list means the
|
|
1347
|
+
// target satisfies the contract.
|
|
1348
|
+
function requiredKernelsMissing(target, kernels) {
|
|
1349
|
+
// Required for every shipped backend.
|
|
1350
|
+
const required = ["dflash", "turbo3", "turbo4", "qjl_full", "polarquant"];
|
|
1351
|
+
return required.filter((k) => !kernels[k]);
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1354
|
+
function probeMetalShippedKernelSymbols(buildDir, outDir) {
|
|
1355
|
+
const shipped = {
|
|
1356
|
+
turbo3: false,
|
|
1357
|
+
turbo4: false,
|
|
1358
|
+
turbo3_tcq: false,
|
|
1359
|
+
qjl_full: false,
|
|
1360
|
+
polarquant: false,
|
|
1361
|
+
};
|
|
1362
|
+
const metallibs = [
|
|
1363
|
+
...collectFilesUnder(buildDir, /\.metallib$/),
|
|
1364
|
+
...collectFilesUnder(outDir, /\.metallib$/),
|
|
1365
|
+
];
|
|
1366
|
+
for (const metallibPath of metallibs) {
|
|
1367
|
+
const bytes = fs.readFileSync(metallibPath);
|
|
1368
|
+
const has = (sym) => bytes.indexOf(sym) !== -1;
|
|
1369
|
+
if (has("kernel_turbo3_dot")) shipped.turbo3 = true;
|
|
1370
|
+
if (has("kernel_turbo4_dot")) shipped.turbo4 = true;
|
|
1371
|
+
if (has("kernel_turbo3_tcq_dot")) shipped.turbo3_tcq = true;
|
|
1372
|
+
if (
|
|
1373
|
+
has("kernel_attn_score_qjl1_256") ||
|
|
1374
|
+
has("kernel_get_rows_qjl1_256") ||
|
|
1375
|
+
has("kernel_mul_mv_qjl1_256_f32")
|
|
1376
|
+
) {
|
|
1377
|
+
shipped.qjl_full = true;
|
|
1378
|
+
}
|
|
1379
|
+
if (
|
|
1380
|
+
has("kernel_get_rows_q4_polar") ||
|
|
1381
|
+
has("kernel_mul_mv_q4_polar_f32")
|
|
1382
|
+
) {
|
|
1383
|
+
shipped.polarquant = true;
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
return { metallibs, symbols: shipped };
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
function writeCapabilities({
|
|
1390
|
+
outDir,
|
|
1391
|
+
target,
|
|
1392
|
+
buildDir,
|
|
1393
|
+
forkCommit,
|
|
1394
|
+
binaries,
|
|
1395
|
+
omnivoice = null,
|
|
1396
|
+
}) {
|
|
1397
|
+
const { platform, arch, backend, fused } = parseTarget(target);
|
|
1398
|
+
const kernels = probeKernels(target, buildDir, outDir);
|
|
1399
|
+
const missing = requiredKernelsMissing(target, kernels);
|
|
1400
|
+
const shippedKernels =
|
|
1401
|
+
backend === "metal" ? probeMetalShippedKernelSymbols(buildDir, outDir) : null;
|
|
1402
|
+
const capabilities = {
|
|
1403
|
+
target,
|
|
1404
|
+
platform,
|
|
1405
|
+
arch,
|
|
1406
|
+
backend,
|
|
1407
|
+
fused: Boolean(fused),
|
|
1408
|
+
builtAt: new Date().toISOString(),
|
|
1409
|
+
fork: "milady-ai/llama.cpp",
|
|
1410
|
+
forkCommit,
|
|
1411
|
+
kernels,
|
|
1412
|
+
shippedKernels,
|
|
1413
|
+
binaries,
|
|
1414
|
+
omnivoice,
|
|
1415
|
+
};
|
|
1416
|
+
fs.writeFileSync(
|
|
1417
|
+
path.join(outDir, "CAPABILITIES.json"),
|
|
1418
|
+
`${JSON.stringify(capabilities, null, 2)}\n`,
|
|
1419
|
+
);
|
|
1420
|
+
if (missing.length > 0) {
|
|
1421
|
+
throw new Error(
|
|
1422
|
+
`[dflash-build] target=${target} missing required kernels: ${missing.join(", ")}. ` +
|
|
1423
|
+
`AGENTS.md §3 forbids shipping an Eliza-1 binary without the full ` +
|
|
1424
|
+
`dflash + turbo3 + turbo4 + qjl + polar kernel set. CAPABILITIES.json ` +
|
|
1425
|
+
`was written for diagnostic purposes only — the artifact is incomplete ` +
|
|
1426
|
+
`and must not be published. Inspect the build log for the failed ` +
|
|
1427
|
+
`patch hook or absent dispatch site, fix the root cause, and rebuild.`,
|
|
1428
|
+
);
|
|
1429
|
+
}
|
|
1430
|
+
return capabilities;
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
function targetOutDir(target, override) {
|
|
1434
|
+
if (override) return override;
|
|
1435
|
+
return path.join(stateDir(), "local-inference", "bin", "dflash", target);
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
function cmakeBuildTargetsFor(target) {
|
|
1439
|
+
const { platform, backend, fused } = parseTarget(target);
|
|
1440
|
+
const isIos = platform === "ios";
|
|
1441
|
+
const targets = isIos
|
|
1442
|
+
? ["llama", "ggml", "ggml-base", "ggml-cpu", "ggml-metal"]
|
|
1443
|
+
: fused
|
|
1444
|
+
? fusedCmakeBuildTargets()
|
|
1445
|
+
: ["llama-server", "llama-cli", "llama-speculative-simple"];
|
|
1446
|
+
|
|
1447
|
+
// The non-EMBED Metal CMakeLists creates an `add_custom_target(ggml-metal-lib
|
|
1448
|
+
// ALL DEPENDS .../default.metallib)` but `cmake --build --target X Y Z`
|
|
1449
|
+
// builds ONLY the listed targets and skips everything in ALL. Without
|
|
1450
|
+
// ggml-metal-lib in the explicit target list the metallib never gets
|
|
1451
|
+
// assembled and the Wave-5 milady-shipped/*.air merge step never fires.
|
|
1452
|
+
if (backend === "metal" && !isIos) {
|
|
1453
|
+
targets.push("ggml-metal-lib");
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1456
|
+
return targets;
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1459
|
+
// Build a single target. Returns the resulting CAPABILITIES.json object.
|
|
1460
|
+
function buildTarget({ target, args, ctx }) {
|
|
1461
|
+
const { platform, backend, fused } = parseTarget(target);
|
|
1462
|
+
const outDir = targetOutDir(target, args.outDirOverride);
|
|
1463
|
+
const buildDir = path.join(args.cacheDir, "build", target);
|
|
1464
|
+
const flags = cmakeFlagsForTarget(target, ctx);
|
|
1465
|
+
|
|
1466
|
+
// Fused targets graft omnivoice.cpp's `src/` + `tools/` into the
|
|
1467
|
+
// llama.cpp tree, append a CMake snippet that declares the fused
|
|
1468
|
+
// shared library + server, and add `-DMILADY_FUSE_OMNIVOICE=ON`.
|
|
1469
|
+
// The non-fused targets are unchanged.
|
|
1470
|
+
let omnivoiceInfo = null;
|
|
1471
|
+
if (fused) {
|
|
1472
|
+
if (args.dryRun) {
|
|
1473
|
+
console.log(
|
|
1474
|
+
`[dflash-build] (dry-run) target=${target} fused=true`,
|
|
1475
|
+
);
|
|
1476
|
+
console.log(
|
|
1477
|
+
` prepareOmnivoiceFusion ref=${OMNIVOICE_REF} llamaCppRoot=${args.cacheDir}`,
|
|
1478
|
+
);
|
|
1479
|
+
console.log(
|
|
1480
|
+
` appendCmakeGraft -> ${path.join(args.cacheDir, "CMakeLists.txt")}`,
|
|
1481
|
+
);
|
|
1482
|
+
} else {
|
|
1483
|
+
omnivoiceInfo = prepareOmnivoiceFusion({
|
|
1484
|
+
cacheRoot: path.dirname(args.cacheDir),
|
|
1485
|
+
llamaCppRoot: args.cacheDir,
|
|
1486
|
+
});
|
|
1487
|
+
const grafted = appendCmakeGraft({ llamaCppRoot: args.cacheDir });
|
|
1488
|
+
console.log(
|
|
1489
|
+
`[dflash-build] omnivoice-fuse: pin=${omnivoiceInfo.commit} ` +
|
|
1490
|
+
`ggmlSubmodule=${omnivoiceInfo.ggmlSubmoduleCommit} ` +
|
|
1491
|
+
`sources=${omnivoiceInfo.sourceCount} ` +
|
|
1492
|
+
`cmakeGraftAppended=${grafted}`,
|
|
1493
|
+
);
|
|
1494
|
+
}
|
|
1495
|
+
flags.push(...fusedExtraCmakeFlags());
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
if (args.dryRun) {
|
|
1499
|
+
console.log(`[dflash-build] (dry-run) target=${target}`);
|
|
1500
|
+
// Dry-run still describes the kernel patches that WOULD be applied so
|
|
1501
|
+
// an audit can see the real behavior, not just the cmake invocation.
|
|
1502
|
+
// The patch helpers themselves treat dryRun=true as "log only, no fs
|
|
1503
|
+
// writes" so this is safe even when args.cacheDir doesn't yet exist
|
|
1504
|
+
// (we only run this branch when the dir does exist; the helpers throw
|
|
1505
|
+
// otherwise to surface that mismatch).
|
|
1506
|
+
if (fs.existsSync(args.cacheDir)) {
|
|
1507
|
+
applyForkPatches(args.cacheDir, backend, target, { dryRun: true });
|
|
1508
|
+
} else {
|
|
1509
|
+
console.log(
|
|
1510
|
+
` (dry-run) skip patch hooks: ${args.cacheDir} not yet cloned`,
|
|
1511
|
+
);
|
|
1512
|
+
}
|
|
1513
|
+
console.log(
|
|
1514
|
+
` cmake -B ${buildDir} ${flags.join(" ")}`.replace(/ +/g, " "),
|
|
1515
|
+
);
|
|
1516
|
+
const dryTargets = cmakeBuildTargetsFor(target);
|
|
1517
|
+
const isDryRunMultiConfig = platform === "windows" || platform === "ios";
|
|
1518
|
+
console.log(
|
|
1519
|
+
` cmake --build ${buildDir}${isDryRunMultiConfig ? " --config Release" : ""} --target ${dryTargets.join(" ")} -j ${args.jobs}`,
|
|
1520
|
+
);
|
|
1521
|
+
console.log(` install -> ${outDir}`);
|
|
1522
|
+
return null;
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
console.log(`[dflash-build] building target=${target}`);
|
|
1526
|
+
applyForkPatches(args.cacheDir, backend, target);
|
|
1527
|
+
|
|
1528
|
+
fs.mkdirSync(buildDir, { recursive: true });
|
|
1529
|
+
run("cmake", ["-B", buildDir, ...flags], { cwd: args.cacheDir });
|
|
1530
|
+
|
|
1531
|
+
// iOS targets emit a static archive used by the Capacitor xcframework
|
|
1532
|
+
// patch; everything else builds the executables we use directly on host.
|
|
1533
|
+
// Fused targets additionally build omnivoice-core, libelizainference,
|
|
1534
|
+
// and the stub fused server.
|
|
1535
|
+
const isIos = platform === "ios";
|
|
1536
|
+
const cmakeBuildTargets = cmakeBuildTargetsFor(target);
|
|
1537
|
+
|
|
1538
|
+
// MSVC + Xcode are multi-config generators — cmake --build needs an
|
|
1539
|
+
// explicit --config flag, otherwise it defaults to Debug and the install
|
|
1540
|
+
// step below looks in the wrong subdir. Use Release for runtime perf.
|
|
1541
|
+
const isMultiConfig = platform === "windows" || platform === "ios";
|
|
1542
|
+
run(
|
|
1543
|
+
"cmake",
|
|
1544
|
+
[
|
|
1545
|
+
"--build",
|
|
1546
|
+
buildDir,
|
|
1547
|
+
...(isMultiConfig ? ["--config", "Release"] : []),
|
|
1548
|
+
"--target",
|
|
1549
|
+
...cmakeBuildTargets,
|
|
1550
|
+
"-j",
|
|
1551
|
+
String(args.jobs),
|
|
1552
|
+
],
|
|
1553
|
+
{ cwd: args.cacheDir },
|
|
1554
|
+
);
|
|
1555
|
+
|
|
1556
|
+
fs.mkdirSync(outDir, { recursive: true });
|
|
1557
|
+
|
|
1558
|
+
const installedNames = [];
|
|
1559
|
+
const installedBaseNames = [];
|
|
1560
|
+
if (isIos) {
|
|
1561
|
+
// Collect every static archive produced by the iOS build into the output
|
|
1562
|
+
// directory. The Capacitor patch script glues these into a single
|
|
1563
|
+
// LlamaCpp.framework alongside the public headers.
|
|
1564
|
+
const archives = collectFilesUnder(buildDir, /\.a$/);
|
|
1565
|
+
for (const archive of archives) {
|
|
1566
|
+
const name = path.basename(archive);
|
|
1567
|
+
fs.copyFileSync(archive, path.join(outDir, name));
|
|
1568
|
+
installedNames.push(name);
|
|
1569
|
+
installedBaseNames.push(name.replace(/^lib|\.a$/g, ""));
|
|
1570
|
+
}
|
|
1571
|
+
// Stage the headers needed by cap-bridge.cpp / the public llama.cpp API
|
|
1572
|
+
// so the xcframework patch can include them under
|
|
1573
|
+
// LlamaCpp.framework/Headers/. Mirrors what packages/app-core/patches/
|
|
1574
|
+
// llama-cpp-capacitor@0.1.5.patch's `ios/CMakeLists*.txt` PUBLIC_HEADERS
|
|
1575
|
+
// list expects.
|
|
1576
|
+
const headerOut = path.join(outDir, "include");
|
|
1577
|
+
fs.mkdirSync(headerOut, { recursive: true });
|
|
1578
|
+
const headerSources = [
|
|
1579
|
+
path.join(args.cacheDir, "include", "llama.h"),
|
|
1580
|
+
path.join(args.cacheDir, "ggml", "include", "ggml.h"),
|
|
1581
|
+
path.join(args.cacheDir, "ggml", "include", "ggml-alloc.h"),
|
|
1582
|
+
path.join(args.cacheDir, "ggml", "include", "ggml-backend.h"),
|
|
1583
|
+
path.join(args.cacheDir, "ggml", "include", "ggml-cpu.h"),
|
|
1584
|
+
path.join(args.cacheDir, "ggml", "include", "ggml-metal.h"),
|
|
1585
|
+
];
|
|
1586
|
+
for (const src of headerSources) {
|
|
1587
|
+
if (fs.existsSync(src)) {
|
|
1588
|
+
fs.copyFileSync(src, path.join(headerOut, path.basename(src)));
|
|
1589
|
+
}
|
|
1590
|
+
}
|
|
1591
|
+
// Stage the embedded Metal library if the build produced one.
|
|
1592
|
+
for (const candidate of collectFilesUnder(buildDir, /\.metallib$/)) {
|
|
1593
|
+
fs.copyFileSync(candidate, path.join(outDir, path.basename(candidate)));
|
|
1594
|
+
}
|
|
1595
|
+
} else {
|
|
1596
|
+
// MSVC and Xcode are multi-config generators: binaries land in
|
|
1597
|
+
// bin/Release/ (or bin/Debug/ when --config Release is missing). Resolve
|
|
1598
|
+
// the actual directory by preferring Release, then Debug, then the
|
|
1599
|
+
// single-config layout used by Ninja / Unix Makefiles on macOS/Linux.
|
|
1600
|
+
const binDirCandidates = [
|
|
1601
|
+
path.join(buildDir, "bin", "Release"),
|
|
1602
|
+
path.join(buildDir, "bin", "Debug"),
|
|
1603
|
+
path.join(buildDir, "bin"),
|
|
1604
|
+
];
|
|
1605
|
+
const binDir =
|
|
1606
|
+
binDirCandidates.find((p) => fs.existsSync(p)) ?? binDirCandidates[2];
|
|
1607
|
+
const executableNames = [
|
|
1608
|
+
"llama-server",
|
|
1609
|
+
"llama-cli",
|
|
1610
|
+
"llama-speculative-simple",
|
|
1611
|
+
// Stub fused server emitted only when target is in FUSED_TARGETS.
|
|
1612
|
+
// Adding it unconditionally is harmless: the install loop only
|
|
1613
|
+
// copies a binary when it actually exists in binDir.
|
|
1614
|
+
...(fused ? ["llama-omnivoice-server"] : []),
|
|
1615
|
+
];
|
|
1616
|
+
// Cross-compiled binaries can have a host-specific suffix (.exe). Match
|
|
1617
|
+
// by base name so Windows builds still install the right files.
|
|
1618
|
+
if (fs.existsSync(binDir)) {
|
|
1619
|
+
for (const name of fs.readdirSync(binDir)) {
|
|
1620
|
+
const base = name.replace(/\.(exe)$/i, "");
|
|
1621
|
+
if (executableNames.includes(base) || isRuntimeLibrary(name)) {
|
|
1622
|
+
installedNames.push(name);
|
|
1623
|
+
}
|
|
1624
|
+
}
|
|
1625
|
+
}
|
|
1626
|
+
for (const name of installedNames) {
|
|
1627
|
+
const src = path.join(binDir, name);
|
|
1628
|
+
const dst = path.join(outDir, name);
|
|
1629
|
+
fs.copyFileSync(src, dst);
|
|
1630
|
+
if (executableNames.includes(name.replace(/\.(exe)$/i, ""))) {
|
|
1631
|
+
fs.chmodSync(dst, 0o755);
|
|
1632
|
+
}
|
|
1633
|
+
}
|
|
1634
|
+
|
|
1635
|
+
// Darwin Metal builds (non-EMBED, see cmakeFlagsForTarget) emit
|
|
1636
|
+
// default.metallib alongside the runtime libraries in binDir. The
|
|
1637
|
+
// metallib must ship next to llama-server because Metal looks for it
|
|
1638
|
+
// via dlopen-style loader_path resolution (the binary's directory).
|
|
1639
|
+
if (platform === "darwin" && backend === "metal") {
|
|
1640
|
+
const metallibCandidate = path.join(binDir, "default.metallib");
|
|
1641
|
+
if (!fs.existsSync(metallibCandidate)) {
|
|
1642
|
+
throw new Error(
|
|
1643
|
+
`[dflash-build] expected default.metallib at ${metallibCandidate} ` +
|
|
1644
|
+
`for ${target} — the non-EMBED metallib build did not produce it. ` +
|
|
1645
|
+
`Inspect the cmake build log for failures in the milady-shipped/ ` +
|
|
1646
|
+
`xcrun metal compile steps.`,
|
|
1647
|
+
);
|
|
1648
|
+
}
|
|
1649
|
+
const metallibDst = path.join(outDir, "default.metallib");
|
|
1650
|
+
fs.copyFileSync(metallibCandidate, metallibDst);
|
|
1651
|
+
installedNames.push("default.metallib");
|
|
1652
|
+
console.log(
|
|
1653
|
+
`[dflash-build] installed default.metallib (${fs.statSync(metallibDst).size} bytes) -> ${outDir}`,
|
|
1654
|
+
);
|
|
1655
|
+
}
|
|
1656
|
+
|
|
1657
|
+
const ggufPySrc = path.join(args.cacheDir, "gguf-py");
|
|
1658
|
+
const ggufPyDst = path.join(outDir, "gguf-py");
|
|
1659
|
+
if (fs.existsSync(ggufPySrc)) {
|
|
1660
|
+
fs.rmSync(ggufPyDst, { recursive: true, force: true });
|
|
1661
|
+
fs.cpSync(ggufPySrc, ggufPyDst, { recursive: true });
|
|
1662
|
+
}
|
|
1663
|
+
makeDarwinInstallSelfContained(outDir, installedNames, binDir);
|
|
1664
|
+
|
|
1665
|
+
for (const name of installedNames) {
|
|
1666
|
+
const base = name.replace(/\.(exe)$/i, "");
|
|
1667
|
+
if (executableNames.includes(base)) installedBaseNames.push(base);
|
|
1668
|
+
}
|
|
1669
|
+
}
|
|
1670
|
+
|
|
1671
|
+
// For fused targets, prove that BOTH llama_* and omnivoice_* symbol
|
|
1672
|
+
// families landed in the produced shared library. Per
|
|
1673
|
+
// packages/inference/AGENTS.md §3, missing fusion is a hard error
|
|
1674
|
+
// with no fallback.
|
|
1675
|
+
let omnivoiceVerification = null;
|
|
1676
|
+
if (fused) {
|
|
1677
|
+
omnivoiceVerification = verifyFusedSymbols({ outDir, target });
|
|
1678
|
+
console.log(
|
|
1679
|
+
`[dflash-build] omnivoice-fuse symbol-verify: ` +
|
|
1680
|
+
`library=${omnivoiceVerification.library} ` +
|
|
1681
|
+
`llama=${omnivoiceVerification.llamaSymbolCount} ` +
|
|
1682
|
+
`omnivoice=${omnivoiceVerification.omnivoiceSymbolCount}`,
|
|
1683
|
+
);
|
|
1684
|
+
}
|
|
1685
|
+
|
|
1686
|
+
const capabilities = writeCapabilities({
|
|
1687
|
+
outDir,
|
|
1688
|
+
target,
|
|
1689
|
+
buildDir,
|
|
1690
|
+
forkCommit: ctx.forkCommit,
|
|
1691
|
+
binaries: installedBaseNames,
|
|
1692
|
+
omnivoice:
|
|
1693
|
+
fused && omnivoiceInfo
|
|
1694
|
+
? {
|
|
1695
|
+
ref: omnivoiceInfo.ref,
|
|
1696
|
+
commit: omnivoiceInfo.commit,
|
|
1697
|
+
ggmlSubmoduleCommit: omnivoiceInfo.ggmlSubmoduleCommit,
|
|
1698
|
+
ggmlReconciliation: "graft-strip-submodule",
|
|
1699
|
+
sourceCount: omnivoiceInfo.sourceCount,
|
|
1700
|
+
appliedPatches: omnivoiceInfo.appliedPatches,
|
|
1701
|
+
verification: omnivoiceVerification,
|
|
1702
|
+
}
|
|
1703
|
+
: null,
|
|
1704
|
+
});
|
|
1705
|
+
console.log(
|
|
1706
|
+
`[dflash-build] installed ${target} binaries to ${outDir} (kernels: ${Object.entries(
|
|
1707
|
+
capabilities.kernels,
|
|
1708
|
+
)
|
|
1709
|
+
.filter(([, v]) => v)
|
|
1710
|
+
.map(([k]) => k)
|
|
1711
|
+
.join(", ") || "none"})`,
|
|
1712
|
+
);
|
|
1713
|
+
return capabilities;
|
|
1714
|
+
}
|
|
1715
|
+
|
|
1716
|
+
function build(args) {
|
|
1717
|
+
if (!has("git")) throw new Error("git is required");
|
|
1718
|
+
if (!has("cmake")) throw new Error("cmake is required");
|
|
1719
|
+
|
|
1720
|
+
// Build host context once for compatibility checks and toolchain wiring.
|
|
1721
|
+
const androidNdk = resolveAndroidNdk();
|
|
1722
|
+
// Decide whether any Vulkan target is in scope. We only fetch the
|
|
1723
|
+
// Khronos header repos when needed — cheap, but pointless otherwise.
|
|
1724
|
+
const willBuildVulkan =
|
|
1725
|
+
args.all ||
|
|
1726
|
+
(args.targets &&
|
|
1727
|
+
args.targets.some(
|
|
1728
|
+
(t) => t.endsWith("-vulkan") || t.endsWith("-vulkan-fused"),
|
|
1729
|
+
)) ||
|
|
1730
|
+
(!args.targets && (args.backend ?? detectBackend()) === "vulkan");
|
|
1731
|
+
// Same idea for the Windows cross path — only probe + write the
|
|
1732
|
+
// mingw-w64 toolchain file when at least one windows-x64 target is
|
|
1733
|
+
// queued. windows-arm64 targets do NOT trigger mingw probing because
|
|
1734
|
+
// the bundled discovery only handles x86_64-w64-mingw32; arm64 needs
|
|
1735
|
+
// either a native MSVC arm64 host or a user-supplied
|
|
1736
|
+
// MINGW_TOOLCHAIN_FILE pointing at clang/LLVM aarch64-w64-mingw32.
|
|
1737
|
+
const willBuildWindows =
|
|
1738
|
+
args.all ||
|
|
1739
|
+
(args.targets && args.targets.some((t) => t.startsWith("windows-x64-"))) ||
|
|
1740
|
+
(!args.targets &&
|
|
1741
|
+
process.platform !== "win32" &&
|
|
1742
|
+
(args.backend ?? detectBackend()) === "cpu" &&
|
|
1743
|
+
false); /* never auto-trigger for legacy mode on non-windows hosts */
|
|
1744
|
+
const mingw =
|
|
1745
|
+
willBuildWindows && process.platform !== "win32"
|
|
1746
|
+
? findMingwToolchain()
|
|
1747
|
+
: null;
|
|
1748
|
+
const ctx = {
|
|
1749
|
+
androidNdk,
|
|
1750
|
+
androidVulkanInclude: findAndroidVulkanInclude(androidNdk),
|
|
1751
|
+
glslc: findGlslc(androidNdk),
|
|
1752
|
+
vulkanHpp: willBuildVulkan ? safelyPrepareVulkanHeaders() : null,
|
|
1753
|
+
mingw,
|
|
1754
|
+
mingwToolchainFile: mingw ? writeMingwToolchainFile({ mingw }) : null,
|
|
1755
|
+
forkCommit: "",
|
|
1756
|
+
};
|
|
1757
|
+
|
|
1758
|
+
// Decide the target list.
|
|
1759
|
+
let targets;
|
|
1760
|
+
if (args.all) {
|
|
1761
|
+
targets = SUPPORTED_TARGETS.slice();
|
|
1762
|
+
} else if (args.targets && args.targets.length > 0) {
|
|
1763
|
+
targets = args.targets.slice();
|
|
1764
|
+
} else {
|
|
1765
|
+
// Legacy single-target mode.
|
|
1766
|
+
const backend = args.backend || detectBackend();
|
|
1767
|
+
const platform =
|
|
1768
|
+
process.platform === "win32" ? "windows" : process.platform;
|
|
1769
|
+
const arch = nodeArchToTripleArch(platform);
|
|
1770
|
+
const legacyTarget = `${platform}-${arch}-${backend}`;
|
|
1771
|
+
targets = [legacyTarget];
|
|
1772
|
+
if (!SUPPORTED_TARGETS.includes(legacyTarget)) {
|
|
1773
|
+
throw new Error(
|
|
1774
|
+
`[dflash-build] legacy backend produced unsupported target ${legacyTarget}; ` +
|
|
1775
|
+
`pass --target explicitly with one of: ${SUPPORTED_TARGETS.join(", ")}`,
|
|
1776
|
+
);
|
|
1777
|
+
}
|
|
1778
|
+
}
|
|
1779
|
+
|
|
1780
|
+
if (!args.dryRun) {
|
|
1781
|
+
if (args.targets && args.targets.length > 0 && !args.all) {
|
|
1782
|
+
for (const target of targets) {
|
|
1783
|
+
const compat = targetCompatibility(target, ctx);
|
|
1784
|
+
if (!compat.ok) {
|
|
1785
|
+
throw new Error(
|
|
1786
|
+
`target ${target} is not buildable: ${compat.reason}`,
|
|
1787
|
+
);
|
|
1788
|
+
}
|
|
1789
|
+
}
|
|
1790
|
+
}
|
|
1791
|
+
ctx.forkCommit = ensureCheckout(args.cacheDir, args.ref);
|
|
1792
|
+
} else if (fs.existsSync(path.join(args.cacheDir, ".git"))) {
|
|
1793
|
+
ctx.forkCommit = run("git", ["rev-parse", "HEAD"], {
|
|
1794
|
+
cwd: args.cacheDir,
|
|
1795
|
+
capture: true,
|
|
1796
|
+
});
|
|
1797
|
+
}
|
|
1798
|
+
|
|
1799
|
+
const built = [];
|
|
1800
|
+
const skipped = []; // host-incompat — soft skip
|
|
1801
|
+
const failed = []; // real failures — hard fail at end
|
|
1802
|
+
for (const target of targets) {
|
|
1803
|
+
const compat = targetCompatibility(target, ctx);
|
|
1804
|
+
if (!compat.ok) {
|
|
1805
|
+
console.log(
|
|
1806
|
+
`[dflash-build] skip target=${target}: ${compat.reason}`,
|
|
1807
|
+
);
|
|
1808
|
+
skipped.push({ target, reason: compat.reason });
|
|
1809
|
+
if (args.targets && args.targets.length > 0 && !args.all) {
|
|
1810
|
+
// Explicit single --target should fail loudly rather than silently skip.
|
|
1811
|
+
throw new Error(
|
|
1812
|
+
`target ${target} is not buildable on this host: ${compat.reason}`,
|
|
1813
|
+
);
|
|
1814
|
+
}
|
|
1815
|
+
continue;
|
|
1816
|
+
}
|
|
1817
|
+
try {
|
|
1818
|
+
const capabilities = buildTarget({ target, args, ctx });
|
|
1819
|
+
built.push({ target, capabilities });
|
|
1820
|
+
} catch (err) {
|
|
1821
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
1822
|
+
if (args.all) {
|
|
1823
|
+
console.error(`[dflash-build] target=${target} failed: ${message}`);
|
|
1824
|
+
// In --all mode we collect failures rather than tear down the whole
|
|
1825
|
+
// run on the first error, so a partial green can still produce
|
|
1826
|
+
// diagnostic CAPABILITIES.json files. But unlike host-incompat skips
|
|
1827
|
+
// (Linux on macOS, etc.) these are REAL failures — the run as a
|
|
1828
|
+
// whole must exit non-zero. failed[] is checked at the bottom.
|
|
1829
|
+
failed.push({ target, reason: `build failed: ${message}` });
|
|
1830
|
+
} else {
|
|
1831
|
+
throw err;
|
|
1832
|
+
}
|
|
1833
|
+
}
|
|
1834
|
+
}
|
|
1835
|
+
|
|
1836
|
+
if (args.dryRun) {
|
|
1837
|
+
console.log(
|
|
1838
|
+
`[dflash-build] dry-run: ${targets.length - skipped.length - failed.length} targets queued, ${skipped.length} host-incompat-skipped, ${failed.length} would-fail`,
|
|
1839
|
+
);
|
|
1840
|
+
} else {
|
|
1841
|
+
console.log(
|
|
1842
|
+
`[dflash-build] done. built=${built.length} host-incompat-skipped=${skipped.length} failed=${failed.length}`,
|
|
1843
|
+
);
|
|
1844
|
+
console.log(
|
|
1845
|
+
`[dflash-build] set ELIZA_DFLASH_ENABLED=1 to force this backend, or leave it unset for auto-detect from the managed path.`,
|
|
1846
|
+
);
|
|
1847
|
+
}
|
|
1848
|
+
if (failed.length > 0) {
|
|
1849
|
+
// Per AGENTS.md §3 + the build-script audit: --all mode must NOT exit 0
|
|
1850
|
+
// when any target failed for a real reason. host-incompat skips (Linux
|
|
1851
|
+
// on macOS, etc.) remain a soft skip; everything else is fatal.
|
|
1852
|
+
throw new Error(
|
|
1853
|
+
`[dflash-build] ${failed.length} target(s) failed: ` +
|
|
1854
|
+
failed.map((f) => `${f.target} (${f.reason})`).join("; "),
|
|
1855
|
+
);
|
|
1856
|
+
}
|
|
1857
|
+
}
|
|
1858
|
+
|
|
1859
|
+
try {
|
|
1860
|
+
build(parseArgs(process.argv.slice(2)));
|
|
1861
|
+
} catch (err) {
|
|
1862
|
+
console.error(
|
|
1863
|
+
`[dflash-build] ${err instanceof Error ? err.message : String(err)}`,
|
|
1864
|
+
);
|
|
1865
|
+
process.exit(1);
|
|
1866
|
+
}
|