@elizaos/app-core 2.0.0-beta.2 → 2.0.11-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agent-bridge.d.ts +27 -0
- package/agent-bridge.d.ts.map +1 -0
- package/agent-bridge.js +26 -0
- package/api/__tests__/sandbox-test-helpers.js +1 -1
- package/api/auth/audit.js +1 -1
- package/api/auth/auth-context.js +1 -1
- package/api/auth/bootstrap-token.js +2 -2
- package/api/auth/index.d.ts +9 -10
- package/api/auth/index.d.ts.map +1 -1
- package/api/auth/index.js +9 -10
- package/api/auth/passwords.js +2 -2
- package/api/auth/sensitive-rate-limit.d.ts +1 -4
- package/api/auth/sensitive-rate-limit.d.ts.map +1 -1
- package/api/auth/sensitive-rate-limit.js +6 -6
- package/api/auth/sessions.js +2 -2
- package/api/auth-bootstrap-routes.d.ts +6 -13
- package/api/auth-bootstrap-routes.d.ts.map +1 -1
- package/api/auth-bootstrap-routes.js +14 -27
- package/api/auth-pairing-routes.d.ts +17 -0
- package/api/auth-pairing-routes.d.ts.map +1 -0
- package/api/auth-pairing-routes.js +300 -0
- package/api/auth-session-routes.d.ts.map +1 -1
- package/api/auth-session-routes.js +36 -15
- package/api/auth.d.ts +12 -19
- package/api/auth.d.ts.map +1 -1
- package/api/auth.js +32 -27
- package/api/automations-compat-routes.d.ts.map +1 -1
- package/api/automations-compat-routes.js +5 -5
- package/api/background-tasks-routes.d.ts +4 -0
- package/api/background-tasks-routes.d.ts.map +1 -0
- package/api/background-tasks-routes.js +63 -0
- package/api/catalog-routes.js +3 -3
- package/api/cloud-pair-route.d.ts +26 -0
- package/api/cloud-pair-route.d.ts.map +1 -0
- package/api/cloud-pair-route.js +222 -0
- package/api/cloud-voice-routes.d.ts +52 -0
- package/api/cloud-voice-routes.d.ts.map +1 -0
- package/api/cloud-voice-routes.js +50 -0
- package/api/compat-route-shared.d.ts +2 -2
- package/api/compat-route-shared.d.ts.map +1 -1
- package/api/compat-route-shared.js +11 -7
- package/api/credential-resolver.d.ts +2 -2
- package/api/credential-resolver.d.ts.map +1 -1
- package/api/credential-resolver.js +8 -2
- package/api/database-rows-compat-routes.d.ts.map +1 -1
- package/api/database-rows-compat-routes.js +69 -31
- package/api/dev-boot-history.d.ts +26 -0
- package/api/dev-boot-history.d.ts.map +1 -0
- package/api/dev-boot-history.js +69 -0
- package/api/dev-compat-routes.d.ts +5 -0
- package/api/dev-compat-routes.d.ts.map +1 -1
- package/api/dev-compat-routes.js +127 -4
- package/api/dev-console-log.d.ts +2 -2
- package/api/dev-console-log.d.ts.map +1 -1
- package/api/dev-console-log.js +8 -5
- package/api/dev-route-catalog.d.ts +58 -0
- package/api/dev-route-catalog.d.ts.map +1 -0
- package/api/dev-route-catalog.js +447 -0
- package/api/dev-stack.d.ts.map +1 -1
- package/api/dev-stack.js +6 -9
- package/api/first-run-routes.d.ts +4 -0
- package/api/first-run-routes.d.ts.map +1 -0
- package/api/first-run-routes.js +208 -0
- package/api/first-run-tts-route.d.ts +19 -0
- package/api/first-run-tts-route.d.ts.map +1 -0
- package/api/first-run-tts-route.js +59 -0
- package/api/internal-routes.d.ts +23 -0
- package/api/internal-routes.d.ts.map +1 -0
- package/api/internal-routes.js +203 -0
- package/api/ios-local-agent-transport.d.ts +36 -0
- package/api/ios-local-agent-transport.d.ts.map +1 -0
- package/api/ios-local-agent-transport.js +566 -0
- package/api/onboarding-voice-lines.d.ts +23 -0
- package/api/onboarding-voice-lines.d.ts.map +1 -0
- package/api/onboarding-voice-lines.js +8 -0
- package/api/perf-instrument.d.ts +43 -0
- package/api/perf-instrument.d.ts.map +1 -0
- package/api/perf-instrument.js +113 -0
- package/api/response.d.ts.map +1 -1
- package/api/response.js +14 -14
- package/api/runtime-mode-routes.d.ts.map +1 -1
- package/api/runtime-mode-routes.js +2 -2
- package/api/secrets-inventory-routes.js +2 -2
- package/api/secrets-manager-routes.d.ts +1 -1
- package/api/secrets-manager-routes.d.ts.map +1 -1
- package/api/secrets-manager-routes.js +9 -10
- package/api/sensitive-request-routes.d.ts.map +1 -1
- package/api/sensitive-request-routes.js +5 -5
- package/api/sensitive-request-store.d.ts +12 -3
- package/api/sensitive-request-store.d.ts.map +1 -1
- package/api/server-cors.d.ts.map +1 -1
- package/api/server-cors.js +13 -2
- package/api/server-first-run-helpers.d.ts +26 -0
- package/api/server-first-run-helpers.d.ts.map +1 -0
- package/api/server-first-run-helpers.js +271 -0
- package/api/server-security.js +1 -1
- package/api/server-startup.d.ts.map +1 -1
- package/api/server-startup.js +3 -4
- package/api/server-wallet-trade.js +1 -1
- package/api/server.d.ts +4 -4
- package/api/server.d.ts.map +1 -1
- package/api/server.js +222 -88
- package/api/setup-contract.d.ts +63 -0
- package/api/setup-contract.d.ts.map +1 -0
- package/api/setup-contract.js +39 -0
- package/api/training-benchmarks.d.ts +97 -0
- package/api/training-benchmarks.d.ts.map +1 -0
- package/api/training-benchmarks.js +307 -0
- package/api/workbench-compat-routes.js +2 -2
- package/benchmark/cerebras-autowire.d.ts +28 -0
- package/benchmark/cerebras-autowire.d.ts.map +1 -0
- package/benchmark/cerebras-autowire.js +62 -0
- package/benchmark/lifeops-bench-handler.d.ts +36 -0
- package/benchmark/lifeops-bench-handler.d.ts.map +1 -1
- package/benchmark/lifeops-bench-handler.js +63 -1
- package/benchmark/lifeops-fake-backend.d.ts +39 -0
- package/benchmark/lifeops-fake-backend.d.ts.map +1 -1
- package/benchmark/lifeops-fake-backend.js +993 -21
- package/benchmark/mock-plugin.d.ts.map +1 -1
- package/benchmark/mock-plugin.js +0 -24
- package/benchmark/plugin.d.ts +2 -1
- package/benchmark/plugin.d.ts.map +1 -1
- package/benchmark/plugin.js +989 -68
- package/benchmark/replay-capture.d.ts +2 -2
- package/benchmark/replay-capture.d.ts.map +1 -1
- package/benchmark/replay-capture.js +3 -3
- package/benchmark/server-utils.d.ts +162 -9
- package/benchmark/server-utils.d.ts.map +1 -1
- package/benchmark/server-utils.js +625 -62
- package/benchmark/server.d.ts.map +1 -1
- package/benchmark/server.js +1962 -118
- package/boot-profile.d.ts +3 -0
- package/boot-profile.d.ts.map +1 -0
- package/boot-profile.js +30 -0
- package/browser.d.ts +23 -1
- package/browser.d.ts.map +1 -1
- package/browser.js +20 -1
- package/cli/argv.js +1 -1
- package/cli/banner.js +1 -1
- package/cli/command-format.js +2 -2
- package/cli/doctor/checks.d.ts.map +1 -1
- package/cli/doctor/checks.js +6 -6
- package/cli/plugins-cli.d.ts.map +1 -1
- package/cli/plugins-cli.js +77 -32
- package/cli/profile.d.ts.map +1 -1
- package/cli/profile.js +5 -4
- package/cli/program/build-program.js +4 -4
- package/cli/program/command-registry.d.ts.map +1 -1
- package/cli/program/command-registry.js +13 -11
- package/cli/program/help.js +5 -5
- package/cli/program/preaction.js +5 -5
- package/cli/program/register.auth.d.ts.map +1 -1
- package/cli/program/register.auth.js +6 -12
- package/cli/program/register.capability-router.d.ts +29 -0
- package/cli/program/register.capability-router.d.ts.map +1 -0
- package/cli/program/register.capability-router.js +568 -0
- package/cli/program/register.config.js +1 -1
- package/cli/program/register.configure.d.ts.map +1 -1
- package/cli/program/register.configure.js +1 -1
- package/cli/program/register.dashboard.d.ts.map +1 -1
- package/cli/program/register.dashboard.js +6 -7
- package/cli/program/register.db.d.ts.map +1 -1
- package/cli/program/register.db.js +3 -4
- package/cli/program/register.doctor.js +7 -7
- package/cli/program/register.setup.d.ts.map +1 -1
- package/cli/program/register.setup.js +14 -10
- package/cli/program/register.start.d.ts.map +1 -1
- package/cli/program/register.start.js +5 -3
- package/cli/program/register.subclis.js +3 -3
- package/cli/program/register.update.d.ts +6 -0
- package/cli/program/register.update.d.ts.map +1 -1
- package/cli/program/register.update.js +58 -6
- package/cli/program.js +1 -1
- package/cli/run-main.js +4 -4
- package/config/app-config.d.ts +2 -0
- package/config/app-config.d.ts.map +1 -0
- package/config/app-config.js +1 -0
- package/connectors/capacitor-jsc.d.ts.map +1 -1
- package/connectors/capacitor-jsc.js +16 -10
- package/connectors/capacitor-quickjs.d.ts.map +1 -1
- package/connectors/capacitor-quickjs.js +18 -13
- package/connectors/capacitor-sqlite.d.ts.map +1 -1
- package/connectors/capacitor-sqlite.js +27 -12
- package/dispatch/approval-queue.d.ts +37 -0
- package/dispatch/approval-queue.d.ts.map +1 -0
- package/dispatch/approval-queue.js +25 -0
- package/dispatch/channel-registry.d.ts +30 -0
- package/dispatch/channel-registry.d.ts.map +1 -0
- package/dispatch/channel-registry.js +22 -0
- package/dispatch/connector-registry.d.ts +39 -0
- package/dispatch/connector-registry.d.ts.map +1 -0
- package/dispatch/connector-registry.js +24 -0
- package/dispatch/index.d.ts +14 -0
- package/dispatch/index.d.ts.map +1 -0
- package/dispatch/index.js +13 -0
- package/dispatch/send-policy.d.ts +36 -0
- package/dispatch/send-policy.d.ts.map +1 -0
- package/dispatch/send-policy.js +16 -0
- package/entry.js +28 -11
- package/first-run/first-run-config.d.ts +55 -0
- package/first-run/first-run-config.d.ts.map +1 -0
- package/first-run/first-run-config.js +178 -0
- package/first-run/runtime-target.d.ts +4 -0
- package/first-run/runtime-target.d.ts.map +1 -0
- package/first-run/runtime-target.js +13 -0
- package/index.d.ts +16 -3
- package/index.d.ts.map +1 -1
- package/index.js +57 -33
- package/package.json +159 -50
- package/packaging/debian/apt-repo-config/README.md +18 -0
- package/packaging/debian/apt-repo-config/conf/distributions +11 -0
- package/packaging/flatpak/README.md +26 -16
- package/packaging/flatpak/ai.elizaos.App.metainfo.xml +17 -12
- package/packaging/flatpak/ai.elizaos.App.store.yml +5 -5
- package/packaging/flatpak/ai.elizaos.App.yml +10 -24
- package/packaging/flatpak/elizaos-app-wrapper.store.sh +2 -2
- package/packaging/flatpak/generate-sources.sh +74 -0
- package/packaging/flatpak/node-sources.json +7930 -0
- package/packaging/inno/build-inno.ps1 +34 -9
- package/packaging/msix/AppxManifest.store.xml +1 -1
- package/packaging/msix/README.md +39 -19
- package/packaging/msix/build-msix.ps1 +44 -14
- package/packaging/snap/snapcraft.yaml +22 -21
- package/packaging/test-packaging.sh +2 -2
- package/permissions/types.d.ts +1 -1
- package/permissions/types.js +1 -1
- package/platform/elizaos-agent-browser-stub.d.ts +144 -0
- package/platform/elizaos-agent-browser-stub.d.ts.map +1 -0
- package/platform/elizaos-agent-browser-stub.js +158 -0
- package/platform/elizaos-plugin-elizacloud-browser-stub.d.ts +34 -0
- package/platform/elizaos-plugin-elizacloud-browser-stub.d.ts.map +1 -0
- package/platform/elizaos-plugin-elizacloud-browser-stub.js +51 -0
- package/platform/empty-node-module.d.ts +148 -0
- package/platform/empty-node-module.d.ts.map +1 -1
- package/platform/empty-node-module.js +140 -3
- package/platform/ios-runtime-backends.d.ts +83 -0
- package/platform/ios-runtime-backends.d.ts.map +1 -0
- package/platform/ios-runtime-backends.js +133 -0
- package/platform/ios-runtime-bridge.d.ts +15 -0
- package/platform/ios-runtime-bridge.d.ts.map +1 -0
- package/platform/ios-runtime-bridge.js +527 -0
- package/platform/native-library-policy.d.ts +23 -0
- package/platform/native-library-policy.d.ts.map +1 -0
- package/platform/native-library-policy.js +112 -0
- package/platform/native-plugin-entrypoints.d.ts +19 -0
- package/platform/native-plugin-entrypoints.d.ts.map +1 -0
- package/platform/native-plugin-entrypoints.js +29 -0
- package/platforms/android/README.md +68 -10
- package/platforms/android/app/build.gradle +268 -3
- package/platforms/android/app/capacitor.build.gradle +18 -1
- package/platforms/android/app/proguard-rules.pro +17 -2
- package/platforms/android/app/src/androidTest/java/ai/elizaos/app/ElizaOsInstrumentedTest.java +1 -1
- package/platforms/android/app/src/main/AndroidManifest.xml +334 -17
- package/platforms/android/app/src/main/assets/runners/eliza-tasks.js +177 -0
- package/platforms/android/app/src/main/elizavoice-jni/CMakeLists.txt +75 -0
- package/platforms/android/app/src/main/elizavoice-jni/elizavoice-jni.cpp +1045 -0
- package/platforms/android/app/src/main/java/ai/elizaos/app/AgentPlugin.java +111 -171
- package/platforms/android/app/src/main/java/ai/elizaos/app/AndroidVirtualizationBridge.java +284 -0
- package/platforms/android/app/src/main/java/ai/elizaos/app/BatteryOptimizationPlugin.java +95 -0
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaAccessibilityService.java +55 -0
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaAgentService.java +1198 -141
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaAndroidSystemBridge.java +83 -0
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaAssistActivity.java +50 -1
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaBootReceiver.java +90 -8
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaBrowserActivity.java +2 -2
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaCalendarActivity.java +1 -1
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaCameraActivity.java +1 -1
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaClockActivity.java +2 -2
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaContactsActivity.java +1 -1
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaDialActivity.java +1 -1
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaInCallService.java +1 -1
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaMmsReceiver.java +1 -1
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaNativeBridge.java +22 -0
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaNotificationListenerService.java +45 -0
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaQuickActionsWidgetProvider.java +68 -0
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaShareActivity.java +132 -0
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaSmsComposeActivity.java +1 -1
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaSmsGatewayService.java +268 -0
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaSmsReceiver.java +12 -1
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaTasksWorker.java +194 -0
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaVoiceCaptureService.java +198 -0
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaVoiceNative.java +160 -0
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaVoicePlugin.java +450 -0
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaVoiceTileService.java +39 -0
- package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaWorkScheduler.java +60 -0
- package/platforms/android/app/src/main/java/ai/elizaos/app/GatewayConnectionService.java +53 -19
- package/platforms/android/app/src/main/java/ai/elizaos/app/MainActivity.java +160 -33
- package/platforms/android/app/src/main/java/ai/elizaos/app/ResourceProbePlugin.java +169 -0
- package/platforms/android/app/src/main/java/ai/elizaos/app/VoiceCapturePlugin.java +119 -0
- package/platforms/android/app/src/main/res/drawable/eliza_widget_background.xml +10 -0
- package/platforms/android/app/src/main/res/drawable/eliza_widget_button_background.xml +13 -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/layout/eliza_quick_actions_widget.xml +86 -0
- package/platforms/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +2 -1
- package/platforms/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +2 -1
- package/platforms/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/platforms/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png +0 -0
- package/platforms/android/app/src/main/res/mipmap-hdpi/ic_launcher_monochrome.png +0 -0
- package/platforms/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/platforms/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/platforms/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png +0 -0
- package/platforms/android/app/src/main/res/mipmap-mdpi/ic_launcher_monochrome.png +0 -0
- package/platforms/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/platforms/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/platforms/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png +0 -0
- package/platforms/android/app/src/main/res/mipmap-xhdpi/ic_launcher_monochrome.png +0 -0
- package/platforms/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/platforms/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/platforms/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png +0 -0
- package/platforms/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_monochrome.png +0 -0
- package/platforms/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/platforms/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/platforms/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png +0 -0
- package/platforms/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_monochrome.png +0 -0
- package/platforms/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/platforms/android/app/src/main/res/values/android_app_actions.xml +48 -0
- package/platforms/android/app/src/main/res/values/colors.xml +8 -0
- package/platforms/android/app/src/main/res/values/ic_launcher_background.xml +2 -2
- package/platforms/android/app/src/main/res/values/strings.xml +2 -2
- package/platforms/android/app/src/main/res/values/styles.xml +25 -1
- package/platforms/android/app/src/main/res/xml/eliza_accessibility_service.xml +9 -0
- package/platforms/android/app/src/main/res/xml/eliza_quick_actions_widget.xml +13 -0
- package/platforms/android/app/src/main/res/xml/shortcuts.xml +121 -0
- package/platforms/android/build.gradle +2 -2
- package/platforms/android/capacitor-cordova-android-plugins/build.gradle +9 -3
- package/platforms/android/capacitor-cordova-android-plugins/cordova.variables.gradle +6 -2
- package/platforms/android/capacitor-cordova-android-plugins/src/main/AndroidManifest.xml +7 -2
- package/platforms/android/capacitor-cordova-android-plugins/src/main/java/.gitkeep +0 -1
- package/platforms/android/capacitor.settings.gradle +66 -16
- package/platforms/android/gradle.properties +1 -0
- package/platforms/android/update-manifest/generate-manifest.mjs +97 -0
- package/platforms/android/update-manifest/schema.json +26 -0
- package/platforms/apple-store-entitlements.reviewed.json +155 -0
- package/platforms/electrobun/.generated/brand-config.json +3 -2
- package/platforms/electrobun/LICENSE +21 -0
- package/platforms/electrobun/README.md +15 -1
- package/platforms/electrobun/assets/appIcon.icns +0 -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/brand-config.json +6 -6
- package/platforms/electrobun/biome.json +9 -9
- package/platforms/electrobun/docs/capability-collapse-matrix.json +318 -0
- package/platforms/electrobun/docs/capability-collapse-matrix.md +129 -0
- package/platforms/electrobun/docs/capability-routing.md +86 -0
- package/platforms/electrobun/docs/convergence-audit.json +3505 -0
- package/platforms/electrobun/docs/convergence-audit.md +694 -0
- package/platforms/electrobun/docs/database-boot-policy.md +90 -0
- package/platforms/electrobun/docs/riscv64-port.md +175 -0
- package/platforms/electrobun/docs/startup-first-run-cleanup.md +18 -0
- package/platforms/electrobun/docs/trace-first-annotations.md +52 -0
- package/platforms/electrobun/docs/ui-boundary-audit.json +580 -0
- package/platforms/electrobun/docs/ui-boundary-audit.md +257 -0
- package/platforms/electrobun/electrobun.config.ts +592 -364
- package/platforms/electrobun/entitlements/JUSTIFICATIONS.md +141 -0
- package/platforms/electrobun/entitlements/README.md +34 -6
- package/platforms/electrobun/entitlements/mas-bun.entitlements +15 -0
- package/platforms/electrobun/entitlements/mas.entitlements +6 -4
- package/platforms/electrobun/native/macos/window-effects.mm +1522 -0
- package/platforms/electrobun/package.json +18 -12
- package/platforms/electrobun/remotes/fs/README.md +70 -0
- package/platforms/electrobun/remotes/fs/electrobun.config.ts +38 -0
- package/platforms/electrobun/remotes/fs/package.json +12 -0
- package/platforms/electrobun/remotes/fs/plugin.json +25 -0
- package/platforms/electrobun/remotes/fs/src/bun/errors.ts +57 -0
- package/platforms/electrobun/remotes/fs/src/bun/file-limits.ts +50 -0
- package/platforms/electrobun/remotes/fs/src/bun/fs-service.ts +389 -0
- package/platforms/electrobun/remotes/fs/src/bun/path-guard.ts +270 -0
- package/platforms/electrobun/remotes/fs/src/bun/protocol.ts +149 -0
- package/platforms/electrobun/remotes/fs/src/bun/worker.ts +174 -0
- package/platforms/electrobun/remotes/fs/src/dev/phase5-smoke.ts +171 -0
- package/platforms/electrobun/remotes/fs/src/web/index.html +8 -0
- package/platforms/electrobun/remotes/git/README.md +75 -0
- package/platforms/electrobun/remotes/git/electrobun.config.ts +44 -0
- package/platforms/electrobun/remotes/git/package.json +12 -0
- package/platforms/electrobun/remotes/git/plugin.json +31 -0
- package/platforms/electrobun/remotes/git/src/bun/errors.ts +69 -0
- package/platforms/electrobun/remotes/git/src/bun/git-command.ts +156 -0
- package/platforms/electrobun/remotes/git/src/bun/git-service.ts +446 -0
- package/platforms/electrobun/remotes/git/src/bun/operation-history.ts +124 -0
- package/platforms/electrobun/remotes/git/src/bun/protocol.ts +252 -0
- package/platforms/electrobun/remotes/git/src/bun/worker.ts +316 -0
- package/platforms/electrobun/remotes/git/src/dev/phase7-smoke.ts +141 -0
- package/platforms/electrobun/remotes/git/src/web/index.html +8 -0
- package/platforms/electrobun/remotes/local-model/README.md +138 -0
- package/platforms/electrobun/remotes/local-model/electrobun.config.ts +46 -0
- package/platforms/electrobun/remotes/local-model/package.json +12 -0
- package/platforms/electrobun/remotes/local-model/plugin.json +33 -0
- package/platforms/electrobun/remotes/local-model/src/bun/download-state.ts +115 -0
- package/platforms/electrobun/remotes/local-model/src/bun/eliza1-catalog.ts +425 -0
- package/platforms/electrobun/remotes/local-model/src/bun/errors.ts +74 -0
- package/platforms/electrobun/remotes/local-model/src/bun/hf-eliza1-client.ts +169 -0
- package/platforms/electrobun/remotes/local-model/src/bun/local-inference-api-client.ts +245 -0
- package/platforms/electrobun/remotes/local-model/src/bun/model-service.ts +490 -0
- package/platforms/electrobun/remotes/local-model/src/bun/protocol.ts +301 -0
- package/platforms/electrobun/remotes/local-model/src/bun/worker.ts +248 -0
- package/platforms/electrobun/remotes/local-model/src/dev/phase8-smoke.ts +117 -0
- package/platforms/electrobun/remotes/local-model/src/web/index.html +13 -0
- package/platforms/electrobun/remotes/pty/README.md +65 -0
- package/platforms/electrobun/remotes/pty/electrobun.config.ts +47 -0
- package/platforms/electrobun/remotes/pty/package.json +12 -0
- package/platforms/electrobun/remotes/pty/plugin.json +34 -0
- package/platforms/electrobun/remotes/pty/src/bun/errors.ts +57 -0
- package/platforms/electrobun/remotes/pty/src/bun/output-buffer.ts +127 -0
- package/platforms/electrobun/remotes/pty/src/bun/protocol.ts +192 -0
- package/platforms/electrobun/remotes/pty/src/bun/pty-service.ts +562 -0
- package/platforms/electrobun/remotes/pty/src/bun/worker.ts +218 -0
- package/platforms/electrobun/remotes/pty/src/dev/phase6-smoke.ts +127 -0
- package/platforms/electrobun/remotes/pty/src/web/index.html +8 -0
- package/platforms/electrobun/remotes/runtime/README.md +370 -0
- package/platforms/electrobun/remotes/runtime/electrobun.config.ts +48 -0
- package/platforms/electrobun/remotes/runtime/package.json +14 -0
- package/platforms/electrobun/remotes/runtime/plugin.json +30 -0
- package/platforms/electrobun/remotes/runtime/src/bun/api-client.ts +620 -0
- package/platforms/electrobun/remotes/runtime/src/bun/errors.ts +45 -0
- package/platforms/electrobun/remotes/runtime/src/bun/log-buffer.ts +33 -0
- package/platforms/electrobun/remotes/runtime/src/bun/protocol.ts +366 -0
- package/platforms/electrobun/remotes/runtime/src/bun/route-discovery.ts +419 -0
- package/platforms/electrobun/remotes/runtime/src/bun/runtime-manager.ts +423 -0
- package/platforms/electrobun/remotes/runtime/src/bun/sse-parser.ts +99 -0
- package/platforms/electrobun/remotes/runtime/src/bun/stream-manager.ts +887 -0
- package/platforms/electrobun/remotes/runtime/src/bun/worker.ts +1231 -0
- package/platforms/electrobun/remotes/runtime/src/dev/phase1-smoke.ts +34 -0
- package/platforms/electrobun/remotes/runtime/src/dev/phase2-smoke.ts +86 -0
- package/platforms/electrobun/remotes/runtime/src/dev/phase3-smoke.ts +141 -0
- package/platforms/electrobun/remotes/runtime/src/web/index.css +187 -0
- package/platforms/electrobun/remotes/runtime/src/web/index.html +76 -0
- package/platforms/electrobun/remotes/runtime/src/web/index.ts +192 -0
- package/platforms/electrobun/remotes/surface/README.md +201 -0
- package/platforms/electrobun/remotes/surface/electrobun.config.ts +38 -0
- package/platforms/electrobun/remotes/surface/package.json +12 -0
- package/platforms/electrobun/remotes/surface/plugin.json +28 -0
- package/platforms/electrobun/remotes/surface/src/bun/worker.ts +132 -0
- package/platforms/electrobun/remotes/surface/src/dev/phase4-smoke.ts +566 -0
- package/platforms/electrobun/remotes/surface/src/protocol/event-types.ts +84 -0
- package/platforms/electrobun/remotes/surface/src/protocol/runtime-client.ts +673 -0
- package/platforms/electrobun/remotes/surface/src/web/app.ts +595 -0
- package/platforms/electrobun/remotes/surface/src/web/index.css +460 -0
- package/platforms/electrobun/remotes/surface/src/web/index.html +466 -0
- package/platforms/electrobun/remotes/surface/src/web/index.ts +5 -0
- package/platforms/electrobun/remotes/surface/src/web/render.ts +455 -0
- package/platforms/electrobun/remotes/surface/src/web/state.ts +427 -0
- package/platforms/electrobun/scripts/build-macos-effects.sh +4 -0
- package/platforms/electrobun/scripts/ensure-build-folder.ts +28 -0
- package/platforms/electrobun/scripts/ensure-whisper-gguf.sh +55 -0
- package/platforms/electrobun/scripts/ensure-whisper-model.sh +22 -80
- package/platforms/electrobun/scripts/generate-convergence-audit.ts +1203 -0
- package/platforms/electrobun/scripts/local-adhoc-sign-macos.ts +159 -159
- package/platforms/electrobun/scripts/postwrap-diagnostics.ts +424 -339
- package/platforms/electrobun/scripts/postwrap-sign-runtime-macos.ts +302 -271
- package/platforms/electrobun/scripts/smoke-test-windows.ps1 +17 -16
- package/platforms/electrobun/scripts/smoke-test.sh +5 -7
- package/platforms/electrobun/scripts/sync-web-assets.mjs +13 -13
- package/platforms/electrobun/scripts/verify-rpc-handlers.ts +109 -110
- package/platforms/electrobun/scripts/verify-windows-installer-proof.ps1 +3 -8
- package/platforms/electrobun/src/__stubs__/bun-ffi.ts +31 -31
- package/platforms/electrobun/src/__stubs__/electrobun-bun.ts +1 -1
- package/platforms/electrobun/src/agent-ready-state.ts +8 -8
- package/platforms/electrobun/src/agent-reset-from-main.test.ts +162 -0
- package/platforms/electrobun/src/agent-reset-from-main.ts +62 -62
- package/platforms/electrobun/src/agent-status-rpc.test.ts +95 -0
- package/platforms/electrobun/src/agent-status-rpc.ts +156 -0
- package/platforms/electrobun/src/api-base.test.ts +247 -0
- package/platforms/electrobun/src/api-base.ts +202 -93
- package/platforms/electrobun/src/application-menu-action-registry.ts +9 -9
- package/platforms/electrobun/src/application-menu.ts +348 -348
- package/platforms/electrobun/src/background-notice.ts +36 -36
- package/platforms/electrobun/src/boot-progress.test.ts +188 -0
- package/platforms/electrobun/src/boot-progress.ts +111 -0
- package/platforms/electrobun/src/brand-config.test.ts +39 -0
- package/platforms/electrobun/src/brand-config.ts +141 -129
- package/platforms/electrobun/src/bridge/browser-tabs-renderer-registry.ts +28 -28
- package/platforms/electrobun/src/bridge/electrobun-boot-config.ts +42 -0
- package/platforms/electrobun/src/bridge/electrobun-crypto-ready.ts +120 -0
- package/platforms/electrobun/src/bridge/electrobun-direct-rpc.ts +342 -357
- package/platforms/electrobun/src/bridge/electrobun-stub.ts +13 -13
- package/platforms/electrobun/src/browser-workspace-bridge-server.ts +285 -243
- package/platforms/electrobun/src/cloud-auth-window.ts +136 -136
- package/platforms/electrobun/src/cloud-disconnect-from-main.ts +90 -90
- package/platforms/electrobun/src/config-and-auth-rpc.test.ts +256 -0
- package/platforms/electrobun/src/config-and-auth-rpc.ts +302 -0
- package/platforms/electrobun/src/conversations-and-character-rpc.test.ts +185 -0
- package/platforms/electrobun/src/conversations-and-character-rpc.ts +131 -0
- package/platforms/electrobun/src/dashboard-rpc.test.ts +200 -0
- package/platforms/electrobun/src/dashboard-rpc.ts +344 -0
- package/platforms/electrobun/src/database/database-lock.ts +141 -0
- package/platforms/electrobun/src/database/database-mode.ts +149 -0
- package/platforms/electrobun/src/database/database-recovery.ts +72 -0
- package/platforms/electrobun/src/database/database-snapshot.ts +190 -0
- package/platforms/electrobun/src/database/database.test.ts +196 -0
- package/platforms/electrobun/src/database/index.ts +5 -0
- package/platforms/electrobun/src/database/pglite-paths.ts +100 -0
- package/platforms/electrobun/src/desktop-deep-link-events.test.ts +30 -0
- package/platforms/electrobun/src/desktop-deep-link-events.ts +17 -0
- package/platforms/electrobun/src/desktop-http-request.test.ts +73 -73
- package/platforms/electrobun/src/desktop-http-request.ts +85 -85
- package/platforms/electrobun/src/desktop-pill-config.test.ts +27 -0
- package/platforms/electrobun/src/desktop-pill-config.ts +40 -0
- package/platforms/electrobun/src/desktop-test-bridge-server.ts +204 -204
- package/platforms/electrobun/src/desktop-tray-config.test.ts +87 -0
- package/platforms/electrobun/src/desktop-tray-config.ts +84 -0
- package/platforms/electrobun/src/devtools-layout.ts +41 -41
- package/platforms/electrobun/src/diagnostic-format.test.ts +71 -0
- package/platforms/electrobun/src/diagnostic-format.ts +75 -36
- package/platforms/electrobun/src/dynamic-view-rpc-schema.test.ts +37 -0
- package/platforms/electrobun/src/dynamic-views/README.md +44 -0
- package/platforms/electrobun/src/dynamic-views/demo/agent-run-trace.html +135 -0
- package/platforms/electrobun/src/dynamic-views/errors.ts +29 -0
- package/platforms/electrobun/src/dynamic-views/host.test.ts +353 -0
- package/platforms/electrobun/src/dynamic-views/host.ts +332 -0
- package/platforms/electrobun/src/dynamic-views/index.ts +57 -0
- package/platforms/electrobun/src/dynamic-views/kiosk-canvas.ts +89 -0
- package/platforms/electrobun/src/dynamic-views/registry.test.ts +139 -0
- package/platforms/electrobun/src/dynamic-views/registry.ts +196 -0
- package/platforms/electrobun/src/dynamic-views/session-manager.test.ts +355 -0
- package/platforms/electrobun/src/dynamic-views/session-manager.ts +348 -0
- package/platforms/electrobun/src/dynamic-views/types.ts +105 -0
- package/platforms/electrobun/src/electrobun-boot-config.test.ts +50 -0
- package/platforms/electrobun/src/electrobun-config.test.ts +62 -0
- package/platforms/electrobun/src/electrobun-crypto-ready.test.ts +65 -0
- package/platforms/electrobun/src/electrobun-window-options.ts +25 -0
- package/platforms/electrobun/src/extension-rpc.test.ts +88 -0
- package/platforms/electrobun/src/extension-rpc.ts +102 -0
- package/platforms/electrobun/src/fatal-shutdown.test.ts +10 -10
- package/platforms/electrobun/src/fatal-shutdown.ts +1 -1
- package/platforms/electrobun/src/first-party-remotes.test.ts +169 -0
- package/platforms/electrobun/src/first-party-remotes.ts +297 -0
- package/platforms/electrobun/src/first-run-rpc.test.ts +192 -0
- package/platforms/electrobun/src/first-run-rpc.ts +146 -0
- package/platforms/electrobun/src/floating-chat-window.ts +181 -181
- package/platforms/electrobun/src/inbox-rpc.test.ts +123 -0
- package/platforms/electrobun/src/inbox-rpc.ts +158 -0
- package/platforms/electrobun/src/index.ts +2555 -2096
- package/platforms/electrobun/src/kiosk-mode.ts +50 -0
- package/platforms/electrobun/src/launch/index.ts +4 -0
- package/platforms/electrobun/src/launch/launch-dynamic-view.ts +37 -0
- package/platforms/electrobun/src/launch/launch-orchestrator.test.ts +224 -0
- package/platforms/electrobun/src/launch/launch-orchestrator.ts +456 -0
- package/platforms/electrobun/src/launch/launch-store.test.ts +97 -0
- package/platforms/electrobun/src/launch/launch-store.ts +134 -0
- package/platforms/electrobun/src/launch/types.ts +103 -0
- package/platforms/electrobun/src/launch/views/launch-diagnostics.html +205 -0
- package/platforms/electrobun/src/lifecycle/agent-ready-publish.test.ts +50 -0
- package/platforms/electrobun/src/lifecycle/agent-ready-publish.ts +27 -0
- package/platforms/electrobun/src/lifecycle/api-base-owner.ts +42 -31
- package/platforms/electrobun/src/lifecycle/desktop-session-prime.ts +44 -44
- package/platforms/electrobun/src/logger.ts +14 -14
- package/platforms/electrobun/src/main-window-runtime.ts +83 -83
- package/platforms/electrobun/src/main-window-session.test.ts +109 -0
- package/platforms/electrobun/src/main-window-session.ts +87 -51
- package/platforms/electrobun/src/menu-reset-from-main.ts +158 -158
- package/platforms/electrobun/src/native/agent-env.test.ts +52 -0
- package/platforms/electrobun/src/native/agent-runtime-layout.test.ts +42 -0
- package/platforms/electrobun/src/native/agent-state-dir.test.ts +91 -0
- package/platforms/electrobun/src/native/agent.ts +2122 -1682
- package/platforms/electrobun/src/native/auth-bridge.test.ts +67 -0
- package/platforms/electrobun/src/native/auth-bridge.ts +464 -360
- package/platforms/electrobun/src/native/browser-workspace.ts +723 -471
- package/platforms/electrobun/src/native/camera.ts +50 -50
- package/platforms/electrobun/src/native/canvas.ts +444 -445
- package/platforms/electrobun/src/native/credentials.ts +673 -616
- package/platforms/electrobun/src/native/desktop-window.test.ts +300 -0
- package/platforms/electrobun/src/native/desktop.ts +2196 -2156
- package/platforms/electrobun/src/native/editor-bridge.ts +201 -201
- package/platforms/electrobun/src/native/file-watcher.ts +154 -154
- package/platforms/electrobun/src/native/gateway.ts +179 -180
- package/platforms/electrobun/src/native/gpu-window.ts +256 -256
- package/platforms/electrobun/src/native/index.ts +76 -74
- package/platforms/electrobun/src/native/location.test.ts +44 -0
- package/platforms/electrobun/src/native/location.ts +90 -80
- package/platforms/electrobun/src/native/loopback-port.ts +60 -60
- package/platforms/electrobun/src/native/mac-window-effects.ts +166 -104
- package/platforms/electrobun/src/native/music-player.ts +38 -38
- package/platforms/electrobun/src/native/permissions-shared.ts +249 -150
- package/platforms/electrobun/src/native/permissions.ts +301 -208
- package/platforms/electrobun/src/native/power-state.ts +129 -129
- package/platforms/electrobun/src/native/remote-plugin-host.test.ts +1394 -0
- package/platforms/electrobun/src/native/remote-plugin-host.ts +1531 -0
- package/platforms/electrobun/src/native/screencapture.ts +667 -573
- package/platforms/electrobun/src/native/steward.ts +207 -204
- package/platforms/electrobun/src/native/swabble.ts +68 -324
- package/platforms/electrobun/src/native/talkmode.ts +253 -422
- package/platforms/electrobun/src/native/webgpu-browser-support.test.ts +18 -0
- package/platforms/electrobun/src/native/webgpu-browser-support.ts +165 -147
- package/platforms/electrobun/src/native/whisper-env.test.ts +71 -0
- package/platforms/electrobun/src/native/whisper-env.ts +68 -0
- package/platforms/electrobun/src/native-onboarding.ts +270 -0
- package/platforms/electrobun/src/onboarding-overlay-window.ts +141 -0
- package/platforms/electrobun/src/persisted-deployment.ts +91 -0
- package/platforms/electrobun/src/pill-window.test.ts +91 -0
- package/platforms/electrobun/src/pill-window.ts +99 -0
- package/platforms/electrobun/src/preload-validation.ts +44 -44
- package/platforms/electrobun/src/preload.js +1 -1
- package/platforms/electrobun/src/print-electrobun-dev-settings-banner.ts +120 -120
- package/platforms/electrobun/src/renderer-api-proxy.test.ts +73 -0
- package/platforms/electrobun/src/renderer-api-proxy.ts +86 -0
- package/platforms/electrobun/src/renderer-static.test.ts +53 -0
- package/platforms/electrobun/src/renderer-static.ts +144 -57
- package/platforms/electrobun/src/rpc-handler-slices.ts +121 -0
- package/platforms/electrobun/src/rpc-handlers.test.ts +267 -0
- package/platforms/electrobun/src/rpc-handlers.ts +1306 -913
- package/platforms/electrobun/src/rpc-parse-utils.ts +57 -0
- package/platforms/electrobun/src/rpc-port-resolver.test.ts +45 -0
- package/platforms/electrobun/src/rpc-port-resolver.ts +31 -0
- package/platforms/electrobun/src/rpc-schema.ts +2556 -1619
- package/platforms/electrobun/src/runtime-layout.ts +105 -105
- package/platforms/electrobun/src/runtime-permissions.ts +95 -95
- package/platforms/electrobun/src/runtime-rpc.test.ts +126 -0
- package/platforms/electrobun/src/runtime-rpc.ts +237 -0
- package/platforms/electrobun/src/screenshot-dev-server.ts +87 -87
- package/platforms/electrobun/src/settings-mutations-rpc.test.ts +193 -0
- package/platforms/electrobun/src/settings-mutations-rpc.ts +220 -0
- package/platforms/electrobun/src/startup-trace.ts +274 -270
- package/platforms/electrobun/src/subscription-rpc.test.ts +89 -0
- package/platforms/electrobun/src/subscription-rpc.ts +192 -0
- package/platforms/electrobun/src/surface-windows.test.ts +355 -0
- package/platforms/electrobun/src/surface-windows.ts +410 -410
- package/platforms/electrobun/src/trace/README.md +73 -0
- package/platforms/electrobun/src/trace/errors.ts +21 -0
- package/platforms/electrobun/src/trace/index.ts +40 -0
- package/platforms/electrobun/src/trace/trace-dynamic-view.ts +40 -0
- package/platforms/electrobun/src/trace/trace-host-requests.ts +473 -0
- package/platforms/electrobun/src/trace/trace-service.test.ts +186 -0
- package/platforms/electrobun/src/trace/trace-service.ts +324 -0
- package/platforms/electrobun/src/trace/trace-store.test.ts +141 -0
- package/platforms/electrobun/src/trace/trace-store.ts +551 -0
- package/platforms/electrobun/src/trace/types.ts +250 -0
- package/platforms/electrobun/src/trace/views/agent-run-trace.html +311 -0
- package/platforms/electrobun/src/types/web-speech.d.ts +28 -28
- package/platforms/electrobun/src/types.ts +5 -5
- package/platforms/electrobun/src/update-availability.test.ts +72 -0
- package/platforms/electrobun/src/update-availability.ts +90 -0
- package/platforms/electrobun/src/update-rpc.test.ts +83 -0
- package/platforms/electrobun/src/update-rpc.ts +123 -0
- package/platforms/electrobun/src/voice/README.md +184 -0
- package/platforms/electrobun/src/voice/errors.ts +42 -0
- package/platforms/electrobun/src/voice/index.ts +78 -0
- package/platforms/electrobun/src/voice/types.ts +316 -0
- package/platforms/electrobun/src/voice/voice-host-requests.ts +259 -0
- package/platforms/electrobun/src/voice/voice-latency-budget.test.ts +66 -0
- package/platforms/electrobun/src/voice/voice-latency-budget.ts +243 -0
- package/platforms/electrobun/src/voice/voice-live-validation.test.ts +352 -0
- package/platforms/electrobun/src/voice/voice-live-validation.ts +838 -0
- package/platforms/electrobun/src/voice/voice-pipeline.ts +250 -0
- package/platforms/electrobun/src/voice/voice-playback-adapter.ts +31 -0
- package/platforms/electrobun/src/voice/voice-runtime-adapter.test.ts +213 -0
- package/platforms/electrobun/src/voice/voice-runtime-adapter.ts +686 -0
- package/platforms/electrobun/src/voice/voice-service.test.ts +561 -0
- package/platforms/electrobun/src/voice/voice-service.ts +1027 -0
- package/platforms/electrobun/src/voice/voice-stream-coordinator.test.ts +115 -0
- package/platforms/electrobun/src/voice/voice-stream-coordinator.ts +270 -0
- package/platforms/electrobun/src/voice/voice-trace.ts +97 -0
- package/platforms/electrobun/src/voice/voice-tts-chunker.test.ts +91 -0
- package/platforms/electrobun/src/voice/voice-tts-chunker.ts +194 -0
- package/platforms/electrobun/src/windows-cef-profile.ts +88 -88
- package/platforms/electrobun/tsconfig.json +73 -13
- package/platforms/electrobun/update-channels.json +22 -0
- package/platforms/electrobun/vitest.electrobun.config.ts +72 -42
- package/platforms/ios/App/App/App.entitlements +4 -0
- package/platforms/ios/App/App/AppDelegate.swift +80 -18
- 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/Base.lproj/LaunchScreen.storyboard +1 -4
- package/platforms/ios/App/App/ComputerUseBridge.swift +589 -0
- package/platforms/ios/App/App/DeviceActivityMonitorExtension/DeviceActivityMonitorExtension.entitlements +12 -0
- package/platforms/ios/App/App/DeviceActivityMonitorExtension/DeviceActivityMonitorExtension.swift +34 -0
- package/platforms/ios/App/App/DeviceActivityMonitorExtension/Info.plist +29 -0
- package/platforms/ios/App/App/DeviceActivityReportExtension/DeviceActivityReportExtension.entitlements +12 -0
- package/platforms/ios/App/App/DeviceActivityReportExtension/DeviceActivityReportExtension.swift +53 -0
- package/platforms/ios/App/App/DeviceActivityReportExtension/Info.plist +27 -0
- package/platforms/ios/App/App/ElizaAppIntents.swift +183 -0
- package/platforms/ios/App/App/ElizaIntentPlugin.swift +342 -5
- package/platforms/ios/App/App/Info.plist +17 -1
- package/platforms/ios/App/App/runners/eliza-tasks.js +177 -0
- package/platforms/ios/App/App.xcodeproj/project.pbxproj +262 -6
- package/platforms/ios/App/BroadcastExtension/SampleHandler.swift +100 -0
- package/platforms/ios/App/Podfile +5 -0
- package/platforms/ios/App/Podfile.lock +83 -59
- package/register-runtime-hooks.js +11 -5
- package/registry/app-registry.d.ts +14 -0
- package/registry/app-registry.d.ts.map +1 -0
- package/registry/app-registry.js +29 -0
- package/registry/entries/apps/app-polymarket.json +31 -0
- package/registry/entries/apps/clawville.json +27 -0
- package/registry/entries/apps/companion.json +28 -0
- package/registry/entries/apps/database-viewer.json +27 -0
- package/registry/entries/apps/defense-of-the-agents.json +27 -0
- package/registry/entries/apps/documents.json +30 -0
- package/registry/entries/apps/feed.json +27 -0
- package/registry/entries/apps/hyperliquid.json +31 -0
- package/registry/entries/apps/log-viewer.json +27 -0
- package/registry/entries/apps/memory-viewer.json +27 -0
- package/registry/entries/apps/model-tester.json +31 -0
- package/registry/entries/apps/plugin-viewer.json +27 -0
- package/registry/entries/apps/relationship-viewer.json +27 -0
- package/registry/entries/apps/runtime-debugger.json +27 -0
- package/registry/entries/apps/shopify.json +31 -0
- package/registry/entries/apps/skills-viewer.json +27 -0
- package/registry/entries/apps/steward.json +31 -0
- package/registry/entries/apps/training.json +54 -0
- package/registry/entries/apps/trajectory-viewer.json +27 -0
- package/registry/entries/apps/vincent.json +31 -0
- package/registry/entries/connectors/bluebubbles.json +99 -0
- package/registry/entries/connectors/bluesky.json +173 -0
- package/registry/entries/connectors/discord.json +119 -0
- package/registry/entries/connectors/farcaster.json +174 -0
- package/registry/entries/connectors/feishu.json +79 -0
- package/registry/entries/connectors/google-chat.json +120 -0
- package/registry/entries/connectors/google.json +82 -0
- package/registry/entries/connectors/imessage.json +96 -0
- package/registry/entries/connectors/instagram.json +64 -0
- package/registry/entries/connectors/line.json +86 -0
- package/registry/entries/connectors/matrix.json +94 -0
- package/registry/entries/connectors/mattermost.json +110 -0
- package/registry/entries/connectors/msteams.json +104 -0
- package/registry/entries/connectors/nextcloud-talk.json +104 -0
- package/registry/entries/connectors/nostr.json +70 -0
- package/registry/entries/connectors/signal.json +81 -0
- package/registry/entries/connectors/slack.json +102 -0
- package/registry/entries/connectors/telegram.json +71 -0
- package/registry/entries/connectors/tlon.json +94 -0
- package/registry/entries/connectors/twitch.json +110 -0
- package/registry/entries/connectors/whatsapp.json +113 -0
- package/registry/entries/connectors/x.json +231 -0
- package/registry/entries/connectors/zalo.json +112 -0
- package/registry/entries/connectors/zalouser.json +122 -0
- package/registry/entries/plugins/agent-orchestrator.json +33 -0
- package/registry/entries/plugins/agent-skills.json +72 -0
- package/registry/entries/plugins/anthropic.json +73 -0
- package/registry/entries/plugins/app-control.json +23 -0
- package/registry/entries/plugins/auto-trader.json +203 -0
- package/registry/entries/plugins/background-runner.json +26 -0
- package/registry/entries/plugins/blooio.json +102 -0
- package/registry/entries/plugins/browser.json +75 -0
- package/registry/entries/plugins/cli.json +40 -0
- package/registry/entries/plugins/clipboard.json +44 -0
- package/registry/entries/plugins/coding-tools.json +71 -0
- package/registry/entries/plugins/commands.json +63 -0
- package/registry/entries/plugins/computeruse.json +74 -0
- package/registry/entries/plugins/copilot-proxy.json +93 -0
- package/registry/entries/plugins/directives.json +63 -0
- package/registry/entries/plugins/edge-tts.json +97 -0
- package/registry/entries/plugins/elevenlabs.json +169 -0
- package/registry/entries/plugins/elizacloud.json +208 -0
- package/registry/entries/plugins/evm.json +134 -0
- package/registry/entries/plugins/experience.json +34 -0
- package/registry/entries/plugins/facewear.json +131 -0
- package/registry/entries/plugins/form.json +26 -0
- package/registry/entries/plugins/github.json +93 -0
- package/registry/entries/plugins/gmail-watch.json +25 -0
- package/registry/entries/plugins/goals.json +77 -0
- package/registry/entries/plugins/google-genai.json +106 -0
- package/registry/entries/plugins/groq.json +93 -0
- package/registry/entries/plugins/hedera.json +48 -0
- package/registry/entries/plugins/inmemorydb.json +25 -0
- package/registry/entries/plugins/linear.json +51 -0
- package/registry/entries/plugins/local-inference.json +142 -0
- package/registry/entries/plugins/local-storage.json +36 -0
- package/registry/entries/plugins/localdb.json +25 -0
- package/registry/entries/plugins/mcp.json +44 -0
- package/registry/entries/plugins/memory.json +124 -0
- package/registry/entries/plugins/minecraft.json +79 -0
- package/registry/entries/plugins/moltbook.json +83 -0
- package/registry/entries/plugins/music.json +155 -0
- package/registry/entries/plugins/mysticism.json +48 -0
- package/registry/entries/plugins/nearai.json +82 -0
- package/registry/entries/plugins/ngrok.json +69 -0
- package/registry/entries/plugins/ollama.json +96 -0
- package/registry/entries/plugins/openai.json +189 -0
- package/registry/entries/plugins/openrouter.json +188 -0
- package/registry/entries/plugins/pdf.json +26 -0
- package/registry/entries/plugins/plugin-manager.json +23 -0
- package/registry/entries/plugins/prose.json +48 -0
- package/registry/entries/plugins/rlm.json +26 -0
- package/registry/entries/plugins/roblox.json +88 -0
- package/registry/entries/plugins/rss.json +64 -0
- package/registry/entries/plugins/s3-storage.json +91 -0
- package/registry/entries/plugins/scheduling.json +35 -0
- package/registry/entries/plugins/shell.json +94 -0
- package/registry/entries/plugins/social-alpha.json +72 -0
- package/registry/entries/plugins/tailscale.json +81 -0
- package/registry/entries/plugins/tee.json +53 -0
- package/registry/entries/plugins/todos.json +26 -0
- package/registry/entries/plugins/trajectory-logger.json +33 -0
- package/registry/entries/plugins/trust.json +39 -0
- package/registry/entries/plugins/tts.json +71 -0
- package/registry/entries/plugins/tunnel.json +45 -0
- package/registry/entries/plugins/twilio.json +168 -0
- package/registry/entries/plugins/vercel-ai-gateway.json +128 -0
- package/registry/entries/plugins/video.json +23 -0
- package/registry/entries/plugins/vision.json +43 -0
- package/registry/entries/plugins/webhooks.json +23 -0
- package/registry/entries/plugins/workflow.json +25 -0
- package/registry/entries/plugins/xai.json +75 -0
- package/registry/index.d.ts +2 -1
- package/registry/index.d.ts.map +1 -1
- package/registry/index.js +46 -12
- package/registry/loader.d.ts +2 -1
- package/registry/loader.d.ts.map +1 -1
- package/registry/loader.js +49 -2
- package/registry/schema.d.ts +244 -34
- package/registry/schema.d.ts.map +1 -1
- package/registry/schema.js +36 -0
- package/runtime/android-avf-microdroid-bridge.d.ts +29 -0
- package/runtime/android-avf-microdroid-bridge.d.ts.map +1 -0
- package/runtime/android-avf-microdroid-bridge.js +149 -0
- package/runtime/api-dev-settings-banner.d.ts.map +1 -1
- package/runtime/api-dev-settings-banner.js +5 -13
- package/runtime/app-core-runtime-hooks.d.ts +21 -0
- package/runtime/app-core-runtime-hooks.d.ts.map +1 -0
- package/runtime/app-core-runtime-hooks.js +10 -0
- package/runtime/autonomy-policy.d.ts +2 -0
- package/runtime/autonomy-policy.d.ts.map +1 -0
- package/runtime/autonomy-policy.js +4 -0
- package/runtime/desktop/AppWindowRenderer.d.ts +17 -0
- package/runtime/desktop/AppWindowRenderer.d.ts.map +1 -0
- package/runtime/desktop/AppWindowRenderer.js +360 -0
- package/runtime/desktop/DesktopSurfaceNavigationRuntime.d.ts +2 -0
- package/runtime/desktop/DesktopSurfaceNavigationRuntime.d.ts.map +1 -0
- package/runtime/desktop/DesktopSurfaceNavigationRuntime.js +41 -0
- package/runtime/desktop/DesktopTrayRuntime.d.ts +2 -0
- package/runtime/desktop/DesktopTrayRuntime.d.ts.map +1 -0
- package/runtime/desktop/DesktopTrayRuntime.js +174 -0
- package/runtime/desktop/DetachedShellRoot.d.ts +10 -0
- package/runtime/desktop/DetachedShellRoot.d.ts.map +1 -0
- package/runtime/desktop/DetachedShellRoot.js +111 -0
- package/runtime/desktop/index.d.ts +6 -0
- package/runtime/desktop/index.d.ts.map +1 -0
- package/runtime/desktop/index.js +5 -0
- package/runtime/desktop/tray-menu.d.ts +20 -0
- package/runtime/desktop/tray-menu.d.ts.map +1 -0
- package/runtime/desktop/tray-menu.js +143 -0
- package/runtime/dev-server.d.ts +1 -1
- package/runtime/dev-server.d.ts.map +1 -1
- package/runtime/dev-server.js +93 -17
- package/runtime/eliza.d.ts +75 -1
- package/runtime/eliza.d.ts.map +1 -1
- package/runtime/eliza.js +596 -122
- package/runtime/ensure-text-to-speech-handler.d.ts.map +1 -1
- package/runtime/ensure-text-to-speech-handler.js +10 -3
- package/runtime/mobile-safe-runtime.d.ts +181 -2
- package/runtime/mobile-safe-runtime.d.ts.map +1 -1
- package/runtime/mobile-safe-runtime.js +1019 -12
- package/runtime/mode/remote-forwarder.d.ts.map +1 -1
- package/runtime/mode/remote-forwarder.js +2 -2
- package/runtime/mode/route-mode-guard.d.ts +1 -2
- package/runtime/mode/route-mode-guard.d.ts.map +1 -1
- package/runtime/mode/route-mode-guard.js +4 -5
- package/runtime/mode/route-mode-matrix.d.ts.map +1 -1
- package/runtime/mode/route-mode-matrix.js +14 -1
- package/runtime/mode/runtime-mode.d.ts +1 -1
- package/runtime/mode/runtime-mode.d.ts.map +1 -1
- package/runtime/mode/runtime-mode.js +15 -4
- package/runtime/runtime-bootstrap-policy.d.ts.map +1 -1
- package/runtime/runtime-bootstrap-policy.js +14 -2
- package/runtime/telegram-standalone-handler.d.ts.map +1 -1
- package/runtime/telegram-standalone-handler.js +10 -9
- package/runtime/tts-cache-wiring.d.ts +29 -0
- package/runtime/tts-cache-wiring.d.ts.map +1 -0
- package/runtime/tts-cache-wiring.js +114 -0
- package/runtime/voice-warmup.d.ts +81 -0
- package/runtime/voice-warmup.d.ts.map +1 -0
- package/runtime/voice-warmup.js +111 -0
- package/scripts/android-sms-gateway-template.test.mjs +1014 -0
- package/scripts/aosp/README.md +19 -15
- package/scripts/aosp/compile-libllama.mjs +1344 -248
- package/scripts/aosp/compile-shim.mjs +47 -18
- package/scripts/aosp/deploy-pixel.mjs +405 -0
- package/scripts/aosp/lib/load-variant-config.mjs +3 -3
- package/scripts/aosp/llama-cpp-patches/README.md +8 -8
- package/scripts/aosp/llama-cpp-patches/apply-patches.mjs +23 -6
- package/scripts/aosp/llama-cpp-patches/polarquant/README.md +37 -0
- package/scripts/aosp/llama-cpp-patches/qjl/README.md +37 -0
- package/scripts/aosp/seccomp-shim/sigsys-handler-arm64.c +169 -0
- package/scripts/aosp/seccomp-shim/sigsys-handler-riscv64.c +217 -0
- package/scripts/aosp/smoke-cuttlefish.mjs +34 -4
- package/scripts/aosp/stage-default-models.mjs +18 -18
- package/scripts/aosp/variant-config-schema.ts +2 -2
- package/scripts/assert-required-bundled-packages.test.ts +534 -0
- package/scripts/audit-apple-store-sandbox.mjs +146 -0
- package/scripts/audit-live-test-surface.mjs +5 -2
- package/scripts/build-capacitor-app.mjs +21 -0
- package/scripts/build-flatpak.mjs +5 -5
- package/scripts/build-helpers/arm64-simd.mjs +72 -0
- package/scripts/build-helpers/omnivoice-merged.mjs +87 -0
- package/scripts/build-helpers/verify-fused-symbols.mjs +567 -0
- package/scripts/build-image.sh +1 -1
- package/scripts/build-llama-cpp-mtp.mjs +487 -0
- package/scripts/build-native-plugins.mjs +230 -18
- package/scripts/build-patched-electrobun-cli.mjs +68 -10
- package/scripts/build-win.mjs +1 -1
- package/scripts/bun-riscv64/Dockerfile +418 -0
- package/scripts/bun-riscv64/README.md +316 -0
- package/scripts/bun-riscv64/build.sh +469 -0
- package/scripts/bun-riscv64/bun-patches/0001-config-add-riscv64-arch.patch +74 -0
- package/scripts/bun-riscv64/bun-patches/0002-flags-add-riscv64-march-mabi.patch +16 -0
- package/scripts/bun-riscv64/bun-patches/0003-zig-add-riscv64-target-triple-and-cpu.patch +26 -0
- package/scripts/bun-riscv64/bun-patches/0004-webkit-force-local-mode-on-riscv64.patch +33 -0
- package/scripts/bun-riscv64/bun-patches/0005-tinycc-disable-on-riscv64.patch +16 -0
- package/scripts/bun-riscv64/bun-patches/0006-build-add-riscv64-cli-validation.patch +15 -0
- package/scripts/bun-riscv64/bun-patches/0007-deps-per-dep-riscv64-checks.patch +24 -0
- package/scripts/bun-riscv64/bun-patches/0008-source-stabilize-riscv64-musl-build.patch +226 -0
- package/scripts/bun-riscv64/bun-patches/0009-disable-wasm-streaming-hooks-for-c-loop.patch +162 -0
- package/scripts/bun-riscv64/bun-patches/0010-disable-inspector-profiler-for-riscv64-c-loop.patch +80 -0
- package/scripts/bun-riscv64/bun-patches/0011-process-arch-add-riscv64.patch +23 -0
- package/scripts/bun-riscv64/bun-patches/0012-cpu-features-add-riscv64-fallback.patch +13 -0
- package/scripts/bun-riscv64/bun-patches/0013-disable-console-inspector-hooks-for-riscv64-c-loop.patch +43 -0
- package/scripts/bun-riscv64/bun-patches/0014-disable-custom-inspector-dispatchers-on-riscv64.patch +127 -0
- package/scripts/bun-riscv64/bun-patches/0015-disable-jsc-profiler-builtins-on-riscv64.patch +75 -0
- package/scripts/bun-riscv64/bun-patches/0016-node-vm-disable-jit-cached-data-on-riscv64-c-loop.patch +96 -0
- package/scripts/bun-riscv64/bun-patches/0017-disable-performance-domjit-signature-on-riscv64-c-loop.patch +34 -0
- package/scripts/bun-riscv64/bun-patches/0018-fix-serialized-script-identifier-big-endian-path.patch +19 -0
- package/scripts/bun-riscv64/bun-patches/0019-add-wtf-timer-fire-bridge-for-c-loop.patch +24 -0
- package/scripts/bun-riscv64/bun-patches/0020-run-riscv64-smoke-test-under-qemu.patch +13 -0
- package/scripts/bun-riscv64/bun-patches/0021-fix-riscv64-linux-open-flags.patch +25 -0
- package/scripts/bun-riscv64/bun-patches/0022-zlib-riscv64-generic-kernels.patch +25 -0
- package/scripts/bun-riscv64/bun-patches/README.md +127 -0
- package/scripts/bun-riscv64/bun-version.json +202 -0
- package/scripts/bun-riscv64/run-build.sh +162 -0
- package/scripts/bun-riscv64/rust-core/0001-riscv64-rust-core-port.patch +868 -0
- package/scripts/bun-riscv64/rust-core/0002-second-wave-riscv64-source-gaps.patch +130 -0
- package/scripts/bun-riscv64/rust-core/0003-third-wave-riscv64-crash-handler-gaps.patch +78 -0
- package/scripts/bun-riscv64/rust-core/0004-rust-target-cpu-riscv64.patch +39 -0
- package/scripts/bun-riscv64/rust-core/0005-fifth-wave-riscv64-source-gaps.patch +96 -0
- package/scripts/bun-riscv64/rust-core/0006-cpp-wasm-and-inspector-guards-riscv64.patch +91 -0
- package/scripts/bun-riscv64/rust-core/0007-bun-alloc-max-align-t-riscv64.patch +36 -0
- package/scripts/bun-riscv64/rust-core/0008-workspace-lints-warn-not-deny-riscv64.patch +75 -0
- package/scripts/bun-riscv64/rust-core/0009-zigglobalobject-wasm-streaming-guards-riscv64.patch +109 -0
- package/scripts/bun-riscv64/rust-core/0010-tcc-externs-stub-on-riscv64.patch +62 -0
- package/scripts/bun-riscv64/rust-core/0011-clippy-ptr-cast-lints-warn-riscv64.patch +61 -0
- package/scripts/bun-riscv64/rust-core/README.md +80 -0
- package/scripts/bun-riscv64/rust-core/webkit-patches/0003-disable-dfg-ftl-on-riscv64.patch +60 -0
- package/scripts/bun-riscv64/rust-core/webkit-patches/0004-riscv64-do-not-force-wasm-in-c-loop.patch +31 -0
- package/scripts/bun-riscv64/rust-core/webkit-patches/0005-domjit-effect-allow-no-dfg-c-loop.patch +40 -0
- package/scripts/bun-riscv64/rust-core/webkit-patches/0006-disable-usewasm-when-webassembly-compiled-out.patch +33 -0
- package/scripts/bun-riscv64/rust-core/webkit-patches/0007-restore-dropped-includes-and-llint-fwd-decl.patch +31 -0
- package/scripts/bun-riscv64/validate.sh +264 -0
- package/scripts/bun-riscv64/webkit-patches/0001-cherry-pick-llint-riscv64.recipe +155 -0
- package/scripts/bun-riscv64/webkit-patches/0002-cherry-pick-baseline-jit-riscv64.recipe +40 -0
- package/scripts/bun-riscv64/webkit-patches/0003-disable-dfg-ftl-on-riscv64.patch +60 -0
- package/scripts/bun-riscv64/webkit-patches/0004-riscv64-do-not-force-wasm-in-c-loop.patch +31 -0
- package/scripts/bun-riscv64/webkit-patches/0005-domjit-effect-allow-no-dfg-c-loop.patch +40 -0
- package/scripts/bun-riscv64/webkit-patches/0006-disable-usewasm-when-webassembly-compiled-out.patch +33 -0
- package/scripts/bun-riscv64/webkit-patches/0007-restore-dropped-includes-and-llint-fwd-decl.patch +72 -0
- package/scripts/bun-riscv64/webkit-patches/README.md +146 -0
- package/scripts/check-homepage-public-readiness.mjs +353 -0
- package/scripts/check-homepage-release-data.mjs +110 -0
- package/scripts/check-i18n.mjs +2 -1
- package/scripts/check-real-local-chat.ts +147 -0
- package/scripts/check-real-local-provisioning.ts +104 -0
- package/scripts/check-real-local-reset.ts +249 -0
- package/scripts/check-sms-gateway-completion-audit.mjs +428 -0
- package/scripts/check-sms-gateway-readiness.mjs +266 -0
- package/scripts/clean-repo.mjs +5 -5
- package/scripts/codesign-mas.mjs +222 -16
- package/scripts/collect-docker-runtime-deps.mjs +229 -0
- package/scripts/continue-sms-gateway-work.mjs +121 -0
- package/scripts/copy-runtime-node-modules.ts +903 -195
- package/scripts/deploy-cloud-api-production-gateway.mjs +52 -0
- package/scripts/desktop-build.mjs +655 -101
- package/scripts/dev-platform.mjs +346 -102
- package/scripts/dev-startup-smoke.mjs +248 -0
- package/scripts/dev-ui.mjs +418 -176
- package/scripts/disable-local-eliza-workspace.mjs +35 -0
- package/scripts/docker-ci-smoke.sh +298 -96
- package/scripts/docker-entrypoint.sh +62 -1
- package/scripts/docker-entrypoint.test.ts +283 -0
- package/scripts/ensure-avatars.mjs +2 -2
- package/scripts/ensure-electrobun-core.mjs +1 -1
- package/scripts/ensure-generated-core-proto-js.mjs +1 -1
- package/scripts/ensure-type-package-aliases.mjs +62 -5
- package/scripts/ensure-vision-deps.mjs +20 -1
- package/scripts/entry.ts +1 -1
- package/scripts/ffi-stub/Makefile +64 -0
- package/scripts/ffi-stub/README.md +391 -0
- package/scripts/ffi-stub/asr-ffi-smoke.ts +139 -0
- package/scripts/ffi-stub/ffi-stub.c +539 -0
- package/scripts/ffi-stub/ffi.h +538 -0
- package/scripts/ffi-stub/libelizainference_stub.so +0 -0
- package/scripts/ffi-stub/tts-stream-ffi-smoke.ts +349 -0
- package/scripts/generate-first-run-voicelines.mjs +194 -0
- package/scripts/generate-plugin-index.js +4 -3
- package/scripts/generate-static-asset-manifest.mjs +1 -1
- package/scripts/i18n-dynamic-keys.json +5 -5
- package/scripts/init-submodules.mjs +2 -2
- package/scripts/install-android-sms-gateway.md +177 -0
- package/scripts/install-android-sms-gateway.mjs +1088 -0
- package/scripts/ios-xcframework/README.md +74 -72
- package/scripts/ios-xcframework/build-xcframework.mjs +204 -43
- package/scripts/ios-xcframework/run-physical-device-smoke.mjs +1943 -0
- package/scripts/ios-xcframework/runtime-symbol-shim.c +450 -0
- package/scripts/kernel-patches/cpu-polar-kernels.mjs +441 -0
- package/scripts/kernel-patches/cpu-simd-kernels.mjs +253 -0
- package/scripts/kernel-patches/cpu-thread-parallelism.mjs +368 -0
- package/scripts/kernel-patches/cuda-kernels.mjs +117 -0
- package/scripts/kernel-patches/metal-kernels.mjs +1698 -109
- package/scripts/kernel-patches/server-omnivoice-route.mjs +718 -0
- package/scripts/kernel-patches/server-structured-output.mjs +279 -0
- package/scripts/kernel-patches/vulkan-dispatch-log.mjs +166 -0
- package/scripts/kernel-patches/vulkan-dispatch-log.test.mjs +50 -0
- package/scripts/kernel-patches/vulkan-dispatch-patches/01-vulkan-shaders-gen.patch +30 -16
- package/scripts/kernel-patches/vulkan-dispatch-patches/02-ggml-vulkan-pipelines.patch +75 -30
- package/scripts/kernel-patches/vulkan-kernels.mjs +800 -49
- package/scripts/lib/agent-source-watcher.mjs +174 -0
- package/scripts/lib/agent-source-watcher.test.mjs +184 -0
- package/scripts/lib/api-supervisor.mjs +78 -9
- package/scripts/lib/api-supervisor.test.mjs +121 -0
- package/scripts/lib/app-dir.mjs +2 -16
- package/scripts/lib/apple-entitlement-audit.mjs +655 -0
- package/scripts/lib/apple-entitlement-audit.test.mjs +144 -0
- package/scripts/lib/bun-version-guard.mjs +13 -13
- package/scripts/lib/capacitor-plugin-build-needed.mjs +4 -3
- package/scripts/lib/capacitor-plugin-names.mjs +30 -14
- package/scripts/lib/desktop-preflight.mjs +9 -5
- package/scripts/lib/desktop-startup-embedding-warmup-policy.mjs +51 -0
- package/scripts/lib/desktop-startup-embedding-warmup-policy.test.mjs +55 -0
- package/scripts/lib/duet-bridge.d.mts +63 -0
- package/scripts/lib/duet-bridge.mjs +193 -0
- package/scripts/lib/node-path-env.mjs +4 -2
- package/scripts/lib/orchestrator-desktop-dev-banner.mjs +12 -3
- package/scripts/lib/patch-bun-exports.mjs +90 -27
- package/scripts/lib/patch-bun-exports.test.mjs +79 -0
- package/scripts/lib/renderer-build-action.mjs +35 -0
- package/scripts/lib/renderer-build-action.test.mjs +70 -0
- package/scripts/lib/stage-android-agent.mjs +748 -99
- package/scripts/lib/sync-eliza-env-aliases.mjs +3 -25
- package/scripts/lib/ui-smoke-stub-decision.mjs +33 -0
- package/scripts/lib/ui-smoke-stub-decision.test.mjs +46 -0
- package/scripts/lib/vite-renderer-dist-stale.mjs +5 -0
- package/scripts/lib/voice-latency-report.mjs +154 -0
- package/scripts/lifeops-prompt-benchmark.ts +21 -12
- package/scripts/link-docker-local-app-packages.mjs +89 -36
- package/scripts/local-stt-bench.ts +192 -0
- package/scripts/maintain-cloud-api-production-gateway.mjs +54 -0
- package/scripts/mas-smoke.mjs +459 -0
- package/scripts/mas-smoke.test.mjs +220 -0
- package/scripts/mobile-auth-simulator-smoke.mjs +0 -1
- package/scripts/normalize-eliza-capture.ts +97 -0
- package/scripts/omnivoice-fuse/prepare.mjs +2543 -23
- package/scripts/pack-upstreams.mjs +65 -5
- package/scripts/package-electrobun-linux.mjs +303 -0
- package/scripts/patch-deps.mjs +5 -3
- package/scripts/patches/llama-mobile-kokoro-tts.patch +480 -0
- package/scripts/playwright-ui-live-stack.ts +194 -49
- package/scripts/playwright-ui-smoke-api-stub.mjs +3501 -109
- package/scripts/pre-review-local.mjs +2 -2
- package/scripts/prepare-ios-cocoapods.sh +41 -3
- package/scripts/release-check.ts +180 -84
- package/scripts/release-workflow-drift.test.ts +57 -0
- package/scripts/relink-workspace-packages-to-dist.mjs +21 -4
- package/scripts/rt.mjs +16 -1
- package/scripts/run-biome-check.mjs +1 -1
- package/scripts/run-coding-agent-e2e.mjs +3 -3
- package/scripts/run-eliza-app-core-script.mjs +34 -0
- package/scripts/run-local-plugin-live-smoke.mjs +71 -2
- package/scripts/run-mobile-build-android-app-actions.test.mjs +426 -0
- package/scripts/run-mobile-build.mjs +4757 -607
- package/scripts/run-node-runtime.mjs +184 -7
- package/scripts/run-node-runtime.test.mjs +167 -0
- package/scripts/run-node-tsx.mjs +80 -33
- package/scripts/run-node.mjs +41 -1
- package/scripts/run-production-build.mjs +34 -27
- package/scripts/run-release-check.mjs +19 -0
- package/scripts/run-release-contract-suite.mjs +107 -14
- package/scripts/run-ui-smoke-playwright-suite.mjs +0 -2
- package/scripts/runtime-package-manifest.ts +21 -3
- package/scripts/setup-upstreams.mjs +42 -1
- package/scripts/sms-gateway-status.mjs +194 -0
- package/scripts/stage-android-agent.test.mjs +97 -0
- package/scripts/stage-elizavoice-lib.mjs +203 -0
- package/scripts/startup-integration-script-drift.test.ts +82 -4
- package/scripts/streaming-pipeline-bench.ts +543 -0
- package/scripts/sync-homepage-porkbun-dns.mjs +262 -0
- package/scripts/test-sms-gateway-software.mjs +100 -0
- package/scripts/type-audit.mjs +1 -1
- package/scripts/validate-bluebubbles-outbound.mjs +293 -0
- package/scripts/validate-cdn-assets.mjs +15 -7
- package/scripts/validate-regression-matrix.mjs +109 -8
- package/scripts/verify-android-sms-gateway-e2e.mjs +362 -0
- package/scripts/verify-bluebubbles-gateway-e2e.mjs +191 -0
- package/scripts/verify-bluebubbles-inbound-readiness.mjs +88 -0
- package/scripts/verify-cloud-api-production-deploy.mjs +87 -0
- package/scripts/verify-cloud-sms-onboarding-flow.mjs +336 -0
- package/scripts/voice/freeze-voice.mjs +521 -0
- package/scripts/voice-attribution-smoke.ts +538 -0
- package/scripts/voice-create-profile.mjs +379 -0
- package/scripts/voice-duet.mjs +1355 -0
- package/scripts/voice-e2e-hardware.ts +871 -0
- package/scripts/voice-interactive.mjs +1750 -0
- package/scripts/voice-latency-report.mjs +96 -0
- package/scripts/voice-latency-report.test.ts +176 -0
- package/scripts/voice-preset/build-default-voice-preset.mjs +249 -0
- package/scripts/voice-preset/build-onboarding-voice.mjs +281 -0
- package/scripts/watch-sms-gateway-readiness.mjs +303 -0
- package/scripts/write-homepage-release-data.mjs +458 -26
- package/security/agent-vault-id.d.ts +1 -1
- package/security/agent-vault-id.js +1 -1
- package/security/hydrate-wallet-keys-from-platform-store.d.ts.map +1 -1
- package/security/hydrate-wallet-keys-from-platform-store.js +23 -14
- package/security/platform-secure-store-node.d.ts +2 -2
- package/security/platform-secure-store-node.js +3 -3
- package/security/wallet-os-store-actions.d.ts +0 -9
- package/security/wallet-os-store-actions.d.ts.map +1 -1
- package/security/wallet-os-store-actions.js +3 -10
- package/services/account-pool.d.ts +23 -14
- package/services/account-pool.d.ts.map +1 -1
- package/services/account-pool.js +86 -24
- package/services/account-usage.d.ts.map +1 -1
- package/services/account-usage.js +2 -5
- package/services/ambient-audio/consent.d.ts +9 -0
- package/services/ambient-audio/consent.d.ts.map +1 -0
- package/services/ambient-audio/consent.js +28 -0
- package/services/ambient-audio/index.d.ts +7 -0
- package/services/ambient-audio/index.d.ts.map +1 -0
- package/services/ambient-audio/index.js +4 -0
- package/services/ambient-audio/replay-buffer.d.ts +14 -0
- package/services/ambient-audio/replay-buffer.d.ts.map +1 -0
- package/services/ambient-audio/replay-buffer.js +66 -0
- package/services/ambient-audio/response-gate.d.ts +3 -0
- package/services/ambient-audio/response-gate.d.ts.map +1 -0
- package/services/ambient-audio/response-gate.js +33 -0
- package/services/ambient-audio/service.d.ts +22 -0
- package/services/ambient-audio/service.d.ts.map +1 -0
- package/services/ambient-audio/service.js +47 -0
- package/services/ambient-audio/types.d.ts +42 -0
- package/services/ambient-audio/types.d.ts.map +1 -0
- package/services/app-updates/update-policy.d.ts +64 -0
- package/services/app-updates/update-policy.d.ts.map +1 -0
- package/services/app-updates/update-policy.js +228 -0
- package/services/auth-store.d.ts +37 -1
- package/services/auth-store.d.ts.map +1 -1
- package/services/auth-store.js +59 -26
- package/services/cloud-jwks-store.d.ts +3 -3
- package/services/cloud-jwks-store.d.ts.map +1 -1
- package/services/cloud-jwks-store.js +5 -8
- package/services/coding-account-bridge.d.ts +71 -0
- package/services/coding-account-bridge.d.ts.map +1 -0
- package/services/coding-account-bridge.js +267 -0
- package/services/connector-target-catalog.d.ts +10 -3
- package/services/connector-target-catalog.d.ts.map +1 -1
- package/services/connector-target-catalog.js +7 -4
- package/services/credential-tunnel-service.d.ts +66 -0
- package/services/credential-tunnel-service.d.ts.map +1 -0
- package/services/credential-tunnel-service.js +227 -0
- package/services/github-credentials.d.ts +1 -1
- package/services/github-credentials.js +1 -1
- package/services/inference-abort.d.ts +47 -0
- package/services/inference-abort.d.ts.map +1 -0
- package/services/inference-abort.js +76 -0
- package/services/persistence.d.ts +2 -3
- package/services/persistence.d.ts.map +1 -1
- package/services/persistence.js +2 -3
- package/services/phrase-chunked-tts.d.ts +136 -0
- package/services/phrase-chunked-tts.d.ts.map +1 -0
- package/services/phrase-chunked-tts.js +208 -0
- package/services/sandbox-registry.d.ts +78 -0
- package/services/sandbox-registry.d.ts.map +1 -0
- package/services/sandbox-registry.js +323 -0
- package/services/secrets-manager-installer.d.ts +8 -1
- package/services/secrets-manager-installer.d.ts.map +1 -1
- package/services/secrets-manager-installer.js +27 -2
- package/services/sensitive-requests/cloud-link-adapter.d.ts +15 -0
- package/services/sensitive-requests/cloud-link-adapter.d.ts.map +1 -0
- package/services/sensitive-requests/cloud-link-adapter.js +73 -0
- package/services/sensitive-requests/index.d.ts +27 -0
- package/services/sensitive-requests/index.d.ts.map +1 -0
- package/services/sensitive-requests/index.js +51 -0
- package/services/sensitive-requests/instruct-dm-only-adapter.d.ts +14 -0
- package/services/sensitive-requests/instruct-dm-only-adapter.d.ts.map +1 -0
- package/services/sensitive-requests/instruct-dm-only-adapter.js +22 -0
- package/services/sensitive-requests/owner-app-inline-adapter.d.ts +3 -0
- package/services/sensitive-requests/owner-app-inline-adapter.d.ts.map +1 -0
- package/services/sensitive-requests/owner-app-inline-adapter.js +146 -0
- package/services/sensitive-requests/owner-app-oauth-adapter.d.ts +3 -0
- package/services/sensitive-requests/owner-app-oauth-adapter.d.ts.map +1 -0
- package/services/sensitive-requests/owner-app-oauth-adapter.js +156 -0
- package/services/sensitive-requests/public-link-adapter.d.ts +14 -0
- package/services/sensitive-requests/public-link-adapter.d.ts.map +1 -0
- package/services/sensitive-requests/public-link-adapter.js +86 -0
- package/services/sensitive-requests/tunnel-link-adapter.d.ts +17 -0
- package/services/sensitive-requests/tunnel-link-adapter.d.ts.map +1 -0
- package/services/sensitive-requests/tunnel-link-adapter.js +38 -0
- package/services/steward-credentials.d.ts +1 -1
- package/services/steward-credentials.d.ts.map +1 -1
- package/services/steward-credentials.js +10 -6
- package/services/steward-sidecar/health-check.d.ts.map +1 -1
- package/services/steward-sidecar/health-check.js +4 -3
- package/services/steward-sidecar/process-management.d.ts +1 -1
- package/services/steward-sidecar/process-management.d.ts.map +1 -1
- package/services/steward-sidecar/process-management.js +9 -3
- package/services/steward-sidecar/types.d.ts +1 -1
- package/services/steward-sidecar/types.d.ts.map +1 -1
- package/services/steward-sidecar/wallet-setup.d.ts.map +1 -1
- package/services/steward-sidecar/wallet-setup.js +8 -7
- package/services/steward-sidecar.d.ts +2 -2
- package/services/steward-sidecar.d.ts.map +1 -1
- package/services/steward-sidecar.js +27 -19
- package/services/task-host-capabilities.d.ts +60 -0
- package/services/task-host-capabilities.d.ts.map +1 -0
- package/services/task-host-capabilities.js +122 -0
- package/services/tool-call-cache/index.d.ts +2 -2
- package/services/tool-call-cache/index.d.ts.map +1 -1
- package/services/tool-call-cache/index.js +1 -1
- package/services/trigger-event-bridge.js +1 -1
- package/services/tunnel-to-mobile/index.d.ts +2 -0
- package/services/tunnel-to-mobile/index.d.ts.map +1 -0
- package/services/tunnel-to-mobile/index.js +1 -0
- package/services/tunnel-to-mobile/tunnel-to-mobile-client.d.ts +105 -0
- package/services/tunnel-to-mobile/tunnel-to-mobile-client.d.ts.map +1 -0
- package/services/tunnel-to-mobile/tunnel-to-mobile-client.js +190 -0
- package/services/vault-bootstrap.d.ts.map +1 -1
- package/services/vault-bootstrap.js +48 -21
- package/services/vault-mirror.d.ts +1 -1
- package/services/vault-mirror.d.ts.map +1 -1
- package/services/vault-mirror.js +29 -6
- package/services/voice-profiles/diarization-pipeline.d.ts +6 -0
- package/services/voice-profiles/diarization-pipeline.d.ts.map +1 -0
- package/services/voice-profiles/diarization-pipeline.js +20 -0
- package/services/voice-profiles/index.d.ts +12 -0
- package/services/voice-profiles/index.d.ts.map +1 -0
- package/services/voice-profiles/index.js +5 -0
- package/services/voice-profiles/nickname-evaluator.d.ts +14 -0
- package/services/voice-profiles/nickname-evaluator.d.ts.map +1 -0
- package/services/voice-profiles/nickname-evaluator.js +46 -0
- package/services/voice-profiles/owner-confidence.d.ts +10 -0
- package/services/voice-profiles/owner-confidence.d.ts.map +1 -0
- package/services/voice-profiles/owner-confidence.js +38 -0
- package/services/voice-profiles/private-challenge.d.ts +20 -0
- package/services/voice-profiles/private-challenge.d.ts.map +1 -0
- package/services/voice-profiles/private-challenge.js +44 -0
- package/services/voice-profiles/store.d.ts +21 -0
- package/services/voice-profiles/store.d.ts.map +1 -0
- package/services/voice-profiles/store.js +50 -0
- package/services/voice-profiles/types.d.ts +38 -0
- package/services/voice-profiles/types.d.ts.map +1 -0
- package/services/voice-profiles/types.js +1 -0
- package/styles/electrobun-mac-window-drag.css +4 -4
- package/test/helpers/__tests__/live-agent-test.smoke.test.ts +43 -70
- package/test/helpers/browser-mocks.ts +2 -2
- package/test/helpers/conditional-tests.ts +2 -2
- package/test/helpers/i18n.ts +1 -1
- package/test/helpers/live-agent-test.ts +537 -551
- package/test/helpers/live-provider.test.ts +4 -4
- package/test/helpers/live-provider.ts +41 -7
- package/test/helpers/live-runtime-server.ts +4 -4
- package/test/helpers/pglite-runtime.ts +1 -1
- package/test/helpers/real-runtime.ts +54 -15
- package/test/helpers/trajectory-harness.ts +11 -7
- package/test/scripts/start-eliza-live.ts +9 -0
- package/test/scripts/test-parallel.mjs +1 -1
- package/test/scripts/test-root-unit.mjs +6 -7
- package/ui-compat.d.ts +13 -2
- package/ui-compat.d.ts.map +1 -1
- package/ui-compat.js +19 -3
- package/api/auth-pairing-compat-routes.d.ts +0 -17
- package/api/auth-pairing-compat-routes.d.ts.map +0 -1
- package/api/auth-pairing-compat-routes.js +0 -301
- package/api/local-inference-compat-routes.d.ts +0 -16
- package/api/local-inference-compat-routes.d.ts.map +0 -1
- package/api/local-inference-compat-routes.js +0 -617
- package/api/onboarding-compat-routes.d.ts +0 -4
- package/api/onboarding-compat-routes.d.ts.map +0 -1
- package/api/onboarding-compat-routes.js +0 -207
- package/api/plugins-compat-routes.d.ts +0 -103
- package/api/plugins-compat-routes.d.ts.map +0 -1
- package/api/plugins-compat-routes.js +0 -1181
- package/api/server-onboarding-compat.d.ts +0 -31
- package/api/server-onboarding-compat.d.ts.map +0 -1
- package/api/server-onboarding-compat.js +0 -283
- package/benchmark/cua-routes.d.ts +0 -10
- package/benchmark/cua-routes.d.ts.map +0 -1
- package/benchmark/cua-routes.js +0 -179
- package/benchmark/mock-plugin-base.d.ts +0 -9
- package/benchmark/mock-plugin-base.d.ts.map +0 -1
- package/benchmark/mock-plugin-base.js +0 -325
- package/cli/parse-duration.d.ts +0 -5
- package/cli/parse-duration.d.ts.map +0 -1
- package/cli/parse-duration.js +0 -27
- package/patches/llama-cpp-capacitor@0.1.5.patch +0 -2387
- package/platform/agent-browser-stub.d.ts +0 -27
- package/platform/agent-browser-stub.d.ts.map +0 -1
- package/platform/agent-browser-stub.js +0 -16
- package/platforms/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java +0 -26
- package/platforms/android/app/src/main/res/drawable/ic_launcher_background.xml +0 -170
- package/platforms/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml +0 -34
- package/platforms/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java +0 -18
- package/platforms/electrobun/assets/appIcon.iconset/icon_512x512@2x.png +0 -0
- package/platforms/electrobun/assets/appIcon.png +0 -0
- package/platforms/electrobun/scripts/build-whisper-universal.sh +0 -137
- package/platforms/electrobun/scripts/build-whisper.sh +0 -95
- package/platforms/electrobun/src/libMacWindowEffects.dylib +0 -0
- package/platforms/electrobun/src/native/whisper.ts +0 -280
- 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/registry/generate-apps.d.ts +0 -2
- package/registry/generate-apps.d.ts.map +0 -1
- package/registry/generate-apps.js +0 -338
- package/registry/generate.d.ts +0 -2
- package/registry/generate.d.ts.map +0 -1
- package/registry/generate.js +0 -506
- package/runtime/embedding-manager-support.d.ts +0 -77
- package/runtime/embedding-manager-support.d.ts.map +0 -1
- package/runtime/embedding-manager-support.js +0 -309
- package/runtime/embedding-presets.d.ts +0 -5
- package/runtime/embedding-presets.d.ts.map +0 -1
- package/runtime/embedding-presets.js +0 -47
- package/runtime/embedding-warmup-policy.d.ts +0 -13
- package/runtime/embedding-warmup-policy.d.ts.map +0 -1
- package/runtime/embedding-warmup-policy.js +0 -33
- package/runtime/ensure-local-inference-handler.d.ts +0 -25
- package/runtime/ensure-local-inference-handler.d.ts.map +0 -1
- package/runtime/ensure-local-inference-handler.js +0 -389
- package/runtime/mobile-local-inference-gate.d.ts +0 -21
- package/runtime/mobile-local-inference-gate.d.ts.map +0 -1
- package/runtime/mobile-local-inference-gate.js +0 -24
- package/scripts/aosp/avd-test.mjs +0 -403
- package/scripts/aosp/boot-validate.mjs +0 -536
- package/scripts/aosp/build-aosp.mjs +0 -448
- package/scripts/aosp/build-bootanimation.mjs +0 -178
- package/scripts/aosp/capture-screens.mjs +0 -325
- package/scripts/aosp/e2e-validate.mjs +0 -225
- package/scripts/aosp/lint-init-rc.mjs +0 -258
- package/scripts/aosp/llama-shim/eliza_llama_shim.c +0 -276
- package/scripts/aosp/sim.mjs +0 -277
- package/scripts/aosp/sync-to-aosp.mjs +0 -134
- package/scripts/aosp/validate.mjs +0 -1273
- package/scripts/build-llama-cpp-dflash.mjs +0 -1866
- package/scripts/generate-onboarding-voicelines.mjs +0 -194
- package/scripts/generated/static-asset-manifest.json +0 -4
- package/scripts/normalize-parallax-capture.ts +0 -97
- package/scripts/omnivoice-fuse/Makefile +0 -44
- package/scripts/omnivoice-fuse/README.md +0 -266
- package/scripts/omnivoice-fuse/cmake-graft.mjs +0 -180
- package/scripts/omnivoice-fuse/ffi-stub.c +0 -222
- package/scripts/omnivoice-fuse/ffi.h +0 -158
- package/scripts/omnivoice-fuse/libelizainference_stub.dylib +0 -0
- package/scripts/omnivoice-fuse/verify-symbols.mjs +0 -138
- package/security/cloud-secret-store.d.ts +0 -34
- package/security/cloud-secret-store.d.ts.map +0 -1
- package/security/cloud-secret-store.js +0 -65
- package/security/export-guard.d.ts +0 -34
- package/security/export-guard.d.ts.map +0 -1
- package/security/export-guard.js +0 -127
- package/services/local-inference/__stress__/cache-stress-helpers.d.ts +0 -76
- package/services/local-inference/__stress__/cache-stress-helpers.d.ts.map +0 -1
- package/services/local-inference/__stress__/cache-stress-helpers.js +0 -238
- package/services/local-inference/active-model.d.ts +0 -180
- package/services/local-inference/active-model.d.ts.map +0 -1
- package/services/local-inference/active-model.js +0 -362
- package/services/local-inference/assignments.d.ts +0 -58
- package/services/local-inference/assignments.d.ts.map +0 -1
- package/services/local-inference/assignments.js +0 -179
- package/services/local-inference/backend.d.ts +0 -200
- package/services/local-inference/backend.d.ts.map +0 -1
- package/services/local-inference/backend.js +0 -242
- package/services/local-inference/bundled-models.d.ts +0 -34
- package/services/local-inference/bundled-models.d.ts.map +0 -1
- package/services/local-inference/bundled-models.js +0 -104
- package/services/local-inference/cache-bridge.d.ts +0 -184
- package/services/local-inference/cache-bridge.d.ts.map +0 -1
- package/services/local-inference/cache-bridge.js +0 -333
- package/services/local-inference/catalog.d.ts +0 -57
- package/services/local-inference/catalog.d.ts.map +0 -1
- package/services/local-inference/catalog.js +0 -262
- package/services/local-inference/conversation-registry.d.ts +0 -122
- package/services/local-inference/conversation-registry.d.ts.map +0 -1
- package/services/local-inference/conversation-registry.js +0 -182
- package/services/local-inference/device-bridge.d.ts +0 -139
- package/services/local-inference/device-bridge.d.ts.map +0 -1
- package/services/local-inference/device-bridge.js +0 -774
- package/services/local-inference/dflash-doctor.d.ts +0 -27
- package/services/local-inference/dflash-doctor.d.ts.map +0 -1
- package/services/local-inference/dflash-doctor.js +0 -149
- package/services/local-inference/dflash-server.d.ts +0 -248
- package/services/local-inference/dflash-server.d.ts.map +0 -1
- package/services/local-inference/dflash-server.js +0 -1076
- package/services/local-inference/downloader.d.ts +0 -48
- package/services/local-inference/downloader.d.ts.map +0 -1
- package/services/local-inference/downloader.js +0 -688
- package/services/local-inference/engine.d.ts +0 -282
- package/services/local-inference/engine.d.ts.map +0 -1
- package/services/local-inference/engine.js +0 -743
- package/services/local-inference/external-scanner.d.ts +0 -17
- package/services/local-inference/external-scanner.d.ts.map +0 -1
- package/services/local-inference/external-scanner.js +0 -261
- package/services/local-inference/handler-registry.d.ts +0 -72
- package/services/local-inference/handler-registry.d.ts.map +0 -1
- package/services/local-inference/handler-registry.js +0 -159
- package/services/local-inference/hardware.d.ts +0 -26
- package/services/local-inference/hardware.d.ts.map +0 -1
- package/services/local-inference/hardware.js +0 -139
- package/services/local-inference/hf-search.d.ts +0 -19
- package/services/local-inference/hf-search.d.ts.map +0 -1
- package/services/local-inference/hf-search.js +0 -169
- package/services/local-inference/index.d.ts +0 -10
- package/services/local-inference/index.d.ts.map +0 -1
- package/services/local-inference/index.js +0 -7
- package/services/local-inference/llama-server-metrics.d.ts +0 -108
- package/services/local-inference/llama-server-metrics.d.ts.map +0 -1
- package/services/local-inference/llama-server-metrics.js +0 -175
- package/services/local-inference/manifest/index.d.ts +0 -4
- package/services/local-inference/manifest/index.d.ts.map +0 -1
- package/services/local-inference/manifest/index.js +0 -5
- package/services/local-inference/manifest/schema.d.ts +0 -419
- package/services/local-inference/manifest/schema.d.ts.map +0 -1
- package/services/local-inference/manifest/schema.js +0 -227
- package/services/local-inference/manifest/types.d.ts +0 -23
- package/services/local-inference/manifest/types.d.ts.map +0 -1
- package/services/local-inference/manifest/types.js +0 -5
- package/services/local-inference/manifest/validator.d.ts +0 -43
- package/services/local-inference/manifest/validator.d.ts.map +0 -1
- package/services/local-inference/manifest/validator.js +0 -180
- package/services/local-inference/paths.d.ts +0 -8
- package/services/local-inference/paths.d.ts.map +0 -1
- package/services/local-inference/paths.js +0 -7
- package/services/local-inference/providers.d.ts +0 -61
- package/services/local-inference/providers.d.ts.map +0 -1
- package/services/local-inference/providers.js +0 -334
- package/services/local-inference/ram-budget.d.ts +0 -57
- package/services/local-inference/ram-budget.d.ts.map +0 -1
- package/services/local-inference/ram-budget.js +0 -107
- package/services/local-inference/readiness.d.ts +0 -9
- package/services/local-inference/readiness.d.ts.map +0 -1
- package/services/local-inference/readiness.js +0 -153
- package/services/local-inference/recommendation.d.ts +0 -62
- package/services/local-inference/recommendation.d.ts.map +0 -1
- package/services/local-inference/recommendation.js +0 -309
- package/services/local-inference/registry.d.ts +0 -35
- package/services/local-inference/registry.d.ts.map +0 -1
- package/services/local-inference/registry.js +0 -117
- package/services/local-inference/router-handler.d.ts +0 -51
- package/services/local-inference/router-handler.d.ts.map +0 -1
- package/services/local-inference/router-handler.js +0 -165
- package/services/local-inference/routing-policy.d.ts +0 -55
- package/services/local-inference/routing-policy.d.ts.map +0 -1
- package/services/local-inference/routing-policy.js +0 -195
- package/services/local-inference/routing-preferences.d.ts +0 -8
- package/services/local-inference/routing-preferences.d.ts.map +0 -1
- package/services/local-inference/routing-preferences.js +0 -7
- package/services/local-inference/service.d.ts +0 -88
- package/services/local-inference/service.d.ts.map +0 -1
- package/services/local-inference/service.js +0 -210
- package/services/local-inference/session-pool.d.ts +0 -72
- package/services/local-inference/session-pool.d.ts.map +0 -1
- package/services/local-inference/session-pool.js +0 -125
- package/services/local-inference/types.d.ts +0 -309
- package/services/local-inference/types.d.ts.map +0 -1
- package/services/local-inference/types.js +0 -23
- package/services/local-inference/verify.d.ts +0 -8
- package/services/local-inference/verify.d.ts.map +0 -1
- package/services/local-inference/verify.js +0 -7
- package/services/local-inference/voice/barge-in.d.ts +0 -15
- package/services/local-inference/voice/barge-in.d.ts.map +0 -1
- package/services/local-inference/voice/barge-in.js +0 -20
- package/services/local-inference/voice/engine-bridge.d.ts +0 -256
- package/services/local-inference/voice/engine-bridge.d.ts.map +0 -1
- package/services/local-inference/voice/engine-bridge.js +0 -398
- package/services/local-inference/voice/ffi-bindings.d.ts +0 -114
- package/services/local-inference/voice/ffi-bindings.d.ts.map +0 -1
- package/services/local-inference/voice/ffi-bindings.js +0 -281
- package/services/local-inference/voice/index.d.ts +0 -51
- package/services/local-inference/voice/index.d.ts.map +0 -1
- package/services/local-inference/voice/index.js +0 -50
- package/services/local-inference/voice/lifecycle.d.ts +0 -135
- package/services/local-inference/voice/lifecycle.d.ts.map +0 -1
- package/services/local-inference/voice/lifecycle.js +0 -189
- package/services/local-inference/voice/phoneme-tokenizer.d.ts +0 -58
- package/services/local-inference/voice/phoneme-tokenizer.d.ts.map +0 -1
- package/services/local-inference/voice/phoneme-tokenizer.js +0 -53
- package/services/local-inference/voice/phrase-cache.d.ts +0 -24
- package/services/local-inference/voice/phrase-cache.d.ts.map +0 -1
- package/services/local-inference/voice/phrase-cache.js +0 -32
- package/services/local-inference/voice/phrase-chunker.d.ts +0 -20
- package/services/local-inference/voice/phrase-chunker.d.ts.map +0 -1
- package/services/local-inference/voice/phrase-chunker.js +0 -85
- package/services/local-inference/voice/ring-buffer.d.ts +0 -40
- package/services/local-inference/voice/ring-buffer.d.ts.map +0 -1
- package/services/local-inference/voice/ring-buffer.js +0 -85
- package/services/local-inference/voice/rollback-queue.d.ts +0 -24
- package/services/local-inference/voice/rollback-queue.d.ts.map +0 -1
- package/services/local-inference/voice/rollback-queue.js +0 -49
- package/services/local-inference/voice/scheduler.d.ts +0 -47
- package/services/local-inference/voice/scheduler.d.ts.map +0 -1
- package/services/local-inference/voice/scheduler.js +0 -123
- package/services/local-inference/voice/shared-resources.d.ts +0 -119
- package/services/local-inference/voice/shared-resources.d.ts.map +0 -1
- package/services/local-inference/voice/shared-resources.js +0 -83
- package/services/local-inference/voice/speaker-preset-cache.d.ts +0 -28
- package/services/local-inference/voice/speaker-preset-cache.d.ts.map +0 -1
- package/services/local-inference/voice/speaker-preset-cache.js +0 -44
- package/services/local-inference/voice/types.d.ts +0 -80
- package/services/local-inference/voice/types.d.ts.map +0 -1
- package/services/local-inference/voice/voice-preset-format.d.ts +0 -56
- package/services/local-inference/voice/voice-preset-format.d.ts.map +0 -1
- package/services/local-inference/voice/voice-preset-format.js +0 -184
- package/services/plugin-installer.d.ts +0 -22
- package/services/plugin-installer.d.ts.map +0 -1
- package/services/plugin-installer.js +0 -41
- package/test/scripts/task-agent-live-smoke.ts +0 -1335
- /package/services/{local-inference/voice → ambient-audio}/types.js +0 -0
|
@@ -1,10 +1,367 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
1
2
|
import http from "node:http";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { gunzipSync } from "node:zlib";
|
|
2
5
|
import { WebSocketServer } from "ws";
|
|
3
6
|
|
|
4
7
|
const port = Number(process.env.ELIZA_UI_SMOKE_API_PORT || "31337");
|
|
8
|
+
const repoRoot = path.resolve(new URL("../../..", import.meta.url).pathname);
|
|
9
|
+
const SMOKE_GENERATED_AT = "2026-01-01T00:00:00.000Z";
|
|
10
|
+
const DEMO_ORCHESTRATOR = process.env.ELIZA_UI_SMOKE_DEMO_ORCHESTRATOR === "1";
|
|
5
11
|
let browserWorkspaceCounter = 0;
|
|
6
12
|
let browserWorkspaceTabs = [];
|
|
7
13
|
let lifeOpsAppEnabled = true;
|
|
14
|
+
let conversationCounter = 0;
|
|
15
|
+
let messageCounter = 0;
|
|
16
|
+
const stubConversations = [];
|
|
17
|
+
const stubConversationMessages = new Map();
|
|
18
|
+
const unhandledApiRequests = [];
|
|
19
|
+
const ONE_PIXEL_PNG = Buffer.from(
|
|
20
|
+
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+/p9sAAAAASUVORK5CYII=",
|
|
21
|
+
"base64",
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
// A minimal valid 16-bit PCM mono WAV of silence. The onboarding voice path
|
|
25
|
+
// POSTs /api/tts/first-run/speak and plays the returned bytes as audio/wav, so
|
|
26
|
+
// the stub must return decodable audio (not a 501) to avoid a console.error.
|
|
27
|
+
function buildSilentWav() {
|
|
28
|
+
const sampleRate = 8000;
|
|
29
|
+
const dataBytes = 1600; // ~0.1s of silence
|
|
30
|
+
const header = Buffer.alloc(44);
|
|
31
|
+
header.write("RIFF", 0, "ascii");
|
|
32
|
+
header.writeUInt32LE(36 + dataBytes, 4);
|
|
33
|
+
header.write("WAVE", 8, "ascii");
|
|
34
|
+
header.write("fmt ", 12, "ascii");
|
|
35
|
+
header.writeUInt32LE(16, 16); // PCM fmt chunk size
|
|
36
|
+
header.writeUInt16LE(1, 20); // audioFormat = PCM
|
|
37
|
+
header.writeUInt16LE(1, 22); // mono
|
|
38
|
+
header.writeUInt32LE(sampleRate, 24);
|
|
39
|
+
header.writeUInt32LE(sampleRate * 2, 28); // byteRate (mono, 16-bit)
|
|
40
|
+
header.writeUInt16LE(2, 32); // blockAlign
|
|
41
|
+
header.writeUInt16LE(16, 34); // bitsPerSample
|
|
42
|
+
header.write("data", 36, "ascii");
|
|
43
|
+
header.writeUInt32LE(dataBytes, 40);
|
|
44
|
+
return Buffer.concat([header, Buffer.alloc(dataBytes)]);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const SILENT_WAV = buildSilentWav();
|
|
48
|
+
// Deterministic transcript the local-inference ASR stub returns for any audio
|
|
49
|
+
// the /chat overlay captures — keeps the voice e2e turn reproducible.
|
|
50
|
+
const SMOKE_VOICE_TRANSCRIPT = "this is the voice smoke transcript";
|
|
51
|
+
// The spoken reply the stub returns for that transcript — a clean sentence so
|
|
52
|
+
// the overlay's TTS output is non-empty and the assistant bubble is assertable.
|
|
53
|
+
const SMOKE_VOICE_REPLY = "Got it, this is the spoken reply.";
|
|
54
|
+
function readSmokeVrm() {
|
|
55
|
+
const candidates = [
|
|
56
|
+
new URL(
|
|
57
|
+
"../../../plugins/plugin-companion/public/vrms/eliza-1.vrm.gz",
|
|
58
|
+
import.meta.url,
|
|
59
|
+
),
|
|
60
|
+
new URL(
|
|
61
|
+
"../../../plugins/plugin-companion/public_src/vrms/eliza-1.vrm",
|
|
62
|
+
import.meta.url,
|
|
63
|
+
),
|
|
64
|
+
];
|
|
65
|
+
|
|
66
|
+
for (const candidate of candidates) {
|
|
67
|
+
if (!existsSync(candidate)) continue;
|
|
68
|
+
const body = readFileSync(candidate);
|
|
69
|
+
return candidate.pathname.endsWith(".gz") ? gunzipSync(body) : body;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return Buffer.alloc(4);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const SMOKE_VRM = readSmokeVrm();
|
|
76
|
+
|
|
77
|
+
const smokeViewDeclarations = [
|
|
78
|
+
["companion", "Companion", "plugin-companion", "/companion", "CompanionView"],
|
|
79
|
+
[
|
|
80
|
+
"companion",
|
|
81
|
+
"Companion TUI",
|
|
82
|
+
"plugin-companion",
|
|
83
|
+
"/companion/tui",
|
|
84
|
+
"CompanionTuiView",
|
|
85
|
+
"tui",
|
|
86
|
+
],
|
|
87
|
+
["contacts", "Contacts", "plugin-contacts", "/contacts", "ContactsAppView"],
|
|
88
|
+
[
|
|
89
|
+
"contacts",
|
|
90
|
+
"Contacts TUI",
|
|
91
|
+
"plugin-contacts",
|
|
92
|
+
"/contacts/tui",
|
|
93
|
+
"ContactsTuiView",
|
|
94
|
+
"tui",
|
|
95
|
+
],
|
|
96
|
+
[
|
|
97
|
+
"hyperliquid",
|
|
98
|
+
"Hyperliquid",
|
|
99
|
+
"plugin-hyperliquid-app",
|
|
100
|
+
"/hyperliquid",
|
|
101
|
+
"HyperliquidAppView",
|
|
102
|
+
],
|
|
103
|
+
[
|
|
104
|
+
"hyperliquid",
|
|
105
|
+
"Hyperliquid TUI",
|
|
106
|
+
"plugin-hyperliquid-app",
|
|
107
|
+
"/hyperliquid/tui",
|
|
108
|
+
"HyperliquidTuiView",
|
|
109
|
+
"tui",
|
|
110
|
+
],
|
|
111
|
+
// NOTE: the LifeOps overview view was removed (PA no longer registers a
|
|
112
|
+
// `lifeops` view). Its stub entries are deleted so the smoke launcher matches
|
|
113
|
+
// production. The decomposed per-domain views below are the real surfaces.
|
|
114
|
+
// Decomposed personal-assistant domain views — registered so their dynamic
|
|
115
|
+
// bundles load in keyless ui-smoke and the decomposed-interactions spec can
|
|
116
|
+
// drive them (closing INTERACTION_DEBT in view-interaction-coverage.test.ts).
|
|
117
|
+
// NOTE: "documents" is intentionally NOT registered here — its view path
|
|
118
|
+
// `/documents` collides with the built-in "documents" tab (App.tsx findView
|
|
119
|
+
// matches `/${tab}`), which would hijack the `/character/documents` route.
|
|
120
|
+
["calendar", "Calendar", "plugin-calendar", "/calendar", "CalendarView"],
|
|
121
|
+
["finances", "Finances", "plugin-finances", "/finances", "FinancesView"],
|
|
122
|
+
["focus", "Focus", "plugin-blocker", "/focus", "FocusView"],
|
|
123
|
+
["goals", "Goals", "plugin-goals", "/goals", "GoalsView"],
|
|
124
|
+
["health", "Health", "plugin-health", "/health", "HealthView"],
|
|
125
|
+
["inbox", "Inbox", "plugin-inbox", "/inbox", "InboxView"],
|
|
126
|
+
["todos", "Todos", "plugin-todos", "/todos", "TodosView"],
|
|
127
|
+
[
|
|
128
|
+
"relationships",
|
|
129
|
+
"Relationships",
|
|
130
|
+
"plugin-relationships",
|
|
131
|
+
"/relationships",
|
|
132
|
+
"RelationshipsView",
|
|
133
|
+
],
|
|
134
|
+
[
|
|
135
|
+
"messages",
|
|
136
|
+
"Messages",
|
|
137
|
+
"plugin-messages",
|
|
138
|
+
"/messages",
|
|
139
|
+
"MessagesPluginView",
|
|
140
|
+
],
|
|
141
|
+
[
|
|
142
|
+
"messages",
|
|
143
|
+
"Messages TUI",
|
|
144
|
+
"plugin-messages",
|
|
145
|
+
"/messages/tui",
|
|
146
|
+
"MessagesTuiView",
|
|
147
|
+
"tui",
|
|
148
|
+
],
|
|
149
|
+
[
|
|
150
|
+
"model-tester",
|
|
151
|
+
"Model Tester",
|
|
152
|
+
"app-model-tester",
|
|
153
|
+
"/model-tester",
|
|
154
|
+
"ModelTesterAppView",
|
|
155
|
+
],
|
|
156
|
+
[
|
|
157
|
+
"model-tester",
|
|
158
|
+
"Model Tester TUI",
|
|
159
|
+
"app-model-tester",
|
|
160
|
+
"/model-tester/tui",
|
|
161
|
+
"ModelTesterTuiView",
|
|
162
|
+
"tui",
|
|
163
|
+
],
|
|
164
|
+
["phone", "Phone", "plugin-phone", "/phone", "PhonePluginView"],
|
|
165
|
+
["phone", "Phone TUI", "plugin-phone", "/phone/tui", "PhoneTuiView", "tui"],
|
|
166
|
+
[
|
|
167
|
+
"polymarket",
|
|
168
|
+
"Polymarket",
|
|
169
|
+
"plugin-polymarket-app",
|
|
170
|
+
"/polymarket",
|
|
171
|
+
"PolymarketAppView",
|
|
172
|
+
],
|
|
173
|
+
[
|
|
174
|
+
"polymarket",
|
|
175
|
+
"Polymarket TUI",
|
|
176
|
+
"plugin-polymarket-app",
|
|
177
|
+
"/polymarket/tui",
|
|
178
|
+
"PolymarketTuiView",
|
|
179
|
+
"tui",
|
|
180
|
+
],
|
|
181
|
+
["shopify", "Shopify", "plugin-shopify-ui", "/shopify", "ShopifyAppView"],
|
|
182
|
+
[
|
|
183
|
+
"shopify",
|
|
184
|
+
"Shopify TUI",
|
|
185
|
+
"plugin-shopify-ui",
|
|
186
|
+
"/shopify/tui",
|
|
187
|
+
"ShopifyTuiView",
|
|
188
|
+
"tui",
|
|
189
|
+
],
|
|
190
|
+
["steward", "Steward", "plugin-steward-app", "/steward", "StewardView"],
|
|
191
|
+
[
|
|
192
|
+
"steward",
|
|
193
|
+
"Steward TUI",
|
|
194
|
+
"plugin-steward-app",
|
|
195
|
+
"/steward/tui",
|
|
196
|
+
"StewardTuiView",
|
|
197
|
+
"tui",
|
|
198
|
+
],
|
|
199
|
+
["vincent", "Vincent", "plugin-vincent", "/vincent", "VincentAppView"],
|
|
200
|
+
[
|
|
201
|
+
"vincent",
|
|
202
|
+
"Vincent TUI",
|
|
203
|
+
"plugin-vincent",
|
|
204
|
+
"/vincent/tui",
|
|
205
|
+
"VincentTuiView",
|
|
206
|
+
"tui",
|
|
207
|
+
],
|
|
208
|
+
["wallet", "Wallet", "plugin-wallet-ui", "/wallet", "InventoryView"],
|
|
209
|
+
[
|
|
210
|
+
"wallet",
|
|
211
|
+
"Wallet TUI",
|
|
212
|
+
"plugin-wallet-ui",
|
|
213
|
+
"/wallet/tui",
|
|
214
|
+
"InventoryTuiView",
|
|
215
|
+
"tui",
|
|
216
|
+
],
|
|
217
|
+
[
|
|
218
|
+
"vector-browser",
|
|
219
|
+
"Vector Browser",
|
|
220
|
+
"plugin-vector-browser",
|
|
221
|
+
"/vector-browser",
|
|
222
|
+
"VectorBrowserView",
|
|
223
|
+
],
|
|
224
|
+
["feed", "Feed", "plugin-feed", "/feed", "FeedOperatorSurface"],
|
|
225
|
+
["feed", "Feed TUI", "plugin-feed", "/feed/tui", "FeedTuiView", "tui"],
|
|
226
|
+
["views-manager", "Views", "plugin-app-control", "/views", "ViewManagerView"],
|
|
227
|
+
[
|
|
228
|
+
"views-manager",
|
|
229
|
+
"Views TUI",
|
|
230
|
+
"plugin-app-control",
|
|
231
|
+
"/views/tui",
|
|
232
|
+
"ViewManagerTuiView",
|
|
233
|
+
"tui",
|
|
234
|
+
],
|
|
235
|
+
[
|
|
236
|
+
"clawville",
|
|
237
|
+
"Clawville",
|
|
238
|
+
"plugin-clawville",
|
|
239
|
+
"/clawville",
|
|
240
|
+
"ClawvilleOperatorSurface",
|
|
241
|
+
],
|
|
242
|
+
[
|
|
243
|
+
"clawville",
|
|
244
|
+
"Clawville TUI",
|
|
245
|
+
"plugin-clawville",
|
|
246
|
+
"/clawville/tui",
|
|
247
|
+
"ClawvilleTuiView",
|
|
248
|
+
"tui",
|
|
249
|
+
],
|
|
250
|
+
[
|
|
251
|
+
"defense-of-the-agents",
|
|
252
|
+
"Defense of the Agents",
|
|
253
|
+
"plugin-defense-of-the-agents",
|
|
254
|
+
"/defense-of-the-agents",
|
|
255
|
+
"DefenseAgentsOperatorSurface",
|
|
256
|
+
],
|
|
257
|
+
[
|
|
258
|
+
"defense-of-the-agents",
|
|
259
|
+
"Defense of the Agents TUI",
|
|
260
|
+
"plugin-defense-of-the-agents",
|
|
261
|
+
"/defense-of-the-agents/tui",
|
|
262
|
+
"DefenseAgentsTuiView",
|
|
263
|
+
"tui",
|
|
264
|
+
],
|
|
265
|
+
[
|
|
266
|
+
"screenshare",
|
|
267
|
+
"Screenshare",
|
|
268
|
+
"plugin-screenshare",
|
|
269
|
+
"/screenshare",
|
|
270
|
+
"ScreenshareOperatorSurface",
|
|
271
|
+
],
|
|
272
|
+
[
|
|
273
|
+
"screenshare",
|
|
274
|
+
"Screenshare TUI",
|
|
275
|
+
"plugin-screenshare",
|
|
276
|
+
"/screenshare/tui",
|
|
277
|
+
"ScreenshareTuiView",
|
|
278
|
+
"tui",
|
|
279
|
+
],
|
|
280
|
+
[
|
|
281
|
+
"social-alpha",
|
|
282
|
+
"Social Alpha",
|
|
283
|
+
"plugin-social-alpha",
|
|
284
|
+
"/social-alpha",
|
|
285
|
+
"SocialAlphaView",
|
|
286
|
+
],
|
|
287
|
+
[
|
|
288
|
+
"task-coordinator",
|
|
289
|
+
"Task Coordinator",
|
|
290
|
+
"plugin-task-coordinator",
|
|
291
|
+
"/task-coordinator",
|
|
292
|
+
"CodingAgentTasksPanel",
|
|
293
|
+
],
|
|
294
|
+
[
|
|
295
|
+
"task-coordinator",
|
|
296
|
+
"Task Coordinator TUI",
|
|
297
|
+
"plugin-task-coordinator",
|
|
298
|
+
"/task-coordinator/tui",
|
|
299
|
+
"TaskCoordinatorTuiView",
|
|
300
|
+
"tui",
|
|
301
|
+
],
|
|
302
|
+
[
|
|
303
|
+
"trajectory-logger",
|
|
304
|
+
"Trajectory Logger",
|
|
305
|
+
"plugin-trajectory-logger",
|
|
306
|
+
"/trajectory-logger",
|
|
307
|
+
"TrajectoryLoggerView",
|
|
308
|
+
],
|
|
309
|
+
[
|
|
310
|
+
"trajectory-logger",
|
|
311
|
+
"Trajectory Logger TUI",
|
|
312
|
+
"plugin-trajectory-logger",
|
|
313
|
+
"/trajectory-logger/tui",
|
|
314
|
+
"TrajectoryLoggerTuiView",
|
|
315
|
+
"tui",
|
|
316
|
+
],
|
|
317
|
+
["training", "Fine Tuning", "plugin-training", "/training", "FineTuningView"],
|
|
318
|
+
[
|
|
319
|
+
"training",
|
|
320
|
+
"Fine Tuning TUI",
|
|
321
|
+
"plugin-training",
|
|
322
|
+
"/training/tui",
|
|
323
|
+
"FineTuningTuiView",
|
|
324
|
+
"tui",
|
|
325
|
+
],
|
|
326
|
+
];
|
|
327
|
+
|
|
328
|
+
const smokeViews = smokeViewDeclarations.map(
|
|
329
|
+
([id, label, pluginDirName, viewPath, componentExport, viewType = "gui"]) => {
|
|
330
|
+
const encodedId = encodeURIComponent(id);
|
|
331
|
+
const query =
|
|
332
|
+
viewType === "tui" ? "?viewType=tui&v=ui-smoke" : "?v=ui-smoke";
|
|
333
|
+
const bundlePath = path.join(
|
|
334
|
+
repoRoot,
|
|
335
|
+
"plugins",
|
|
336
|
+
pluginDirName,
|
|
337
|
+
"dist",
|
|
338
|
+
"views",
|
|
339
|
+
"bundle.js",
|
|
340
|
+
);
|
|
341
|
+
return {
|
|
342
|
+
id,
|
|
343
|
+
label,
|
|
344
|
+
viewType,
|
|
345
|
+
pluginName: `@elizaos/${pluginDirName}`,
|
|
346
|
+
path: viewPath,
|
|
347
|
+
order: 100,
|
|
348
|
+
bundlePath: "dist/views/bundle.js",
|
|
349
|
+
bundleUrl: `/api/views/${encodedId}/bundle.js${query}`,
|
|
350
|
+
componentExport,
|
|
351
|
+
available: true,
|
|
352
|
+
realBundleAvailable: existsSync(bundlePath),
|
|
353
|
+
visibleInManager: true,
|
|
354
|
+
capabilities: [
|
|
355
|
+
{
|
|
356
|
+
id: "get-state",
|
|
357
|
+
label: "Get state",
|
|
358
|
+
inputSchema: { type: "object" },
|
|
359
|
+
},
|
|
360
|
+
],
|
|
361
|
+
_smokePluginDirName: pluginDirName,
|
|
362
|
+
};
|
|
363
|
+
},
|
|
364
|
+
);
|
|
8
365
|
|
|
9
366
|
const stubPlugins = [
|
|
10
367
|
{
|
|
@@ -89,12 +446,14 @@ function stubCatalogApp({
|
|
|
89
446
|
|
|
90
447
|
const stubCatalogApps = [
|
|
91
448
|
stubCatalogApp({
|
|
92
|
-
name: "@elizaos/
|
|
449
|
+
name: "@elizaos/plugin-personal-assistant",
|
|
93
450
|
displayName: "LifeOps",
|
|
94
451
|
description:
|
|
95
452
|
"Run tasks, reminders, calendar, inbox, and connected workflows.",
|
|
96
453
|
capabilities: ["lifeops", "tasks", "calendar", "gmail"],
|
|
97
|
-
heroImage:
|
|
454
|
+
// No heroImage: the lifeops surface was removed and /app-heroes/lifeops.png
|
|
455
|
+
// does not exist; the catalog renders the hero conditionally, so omitting it
|
|
456
|
+
// avoids the 404 console error (which the visual smoke asserts against).
|
|
98
457
|
}),
|
|
99
458
|
stubCatalogApp({
|
|
100
459
|
name: "@elizaos/app-plugin-viewer",
|
|
@@ -112,7 +471,7 @@ const stubCatalogApps = [
|
|
|
112
471
|
heroImage: "/app-heroes/skills-viewer.png",
|
|
113
472
|
}),
|
|
114
473
|
stubCatalogApp({
|
|
115
|
-
name: "@elizaos/
|
|
474
|
+
name: "@elizaos/plugin-training",
|
|
116
475
|
displayName: "Fine Tuning",
|
|
117
476
|
description:
|
|
118
477
|
"Build datasets, inspect trajectories, and activate tuned models.",
|
|
@@ -162,25 +521,53 @@ const stubCatalogApps = [
|
|
|
162
521
|
heroImage: "/app-heroes/log-viewer.png",
|
|
163
522
|
}),
|
|
164
523
|
stubCatalogApp({
|
|
165
|
-
name: "@elizaos/
|
|
524
|
+
name: "@elizaos/plugin-companion",
|
|
166
525
|
displayName: "Companion",
|
|
167
526
|
description: "The companion overlay shell for ambient agent presence.",
|
|
168
527
|
category: "social",
|
|
169
528
|
}),
|
|
170
529
|
stubCatalogApp({
|
|
171
|
-
name: "@elizaos/app
|
|
530
|
+
name: "@elizaos/plugin-steward-app",
|
|
531
|
+
displayName: "Steward",
|
|
532
|
+
description: "Review wallet approvals and inventory status.",
|
|
533
|
+
capabilities: ["wallet", "approvals", "inventory"],
|
|
534
|
+
}),
|
|
535
|
+
stubCatalogApp({
|
|
536
|
+
name: "@elizaos/plugin-elizamaker",
|
|
537
|
+
displayName: "ElizaMaker",
|
|
538
|
+
description: "Run drop, mint, whitelist, and verification workflows.",
|
|
539
|
+
capabilities: ["drops", "minting", "whitelist"],
|
|
540
|
+
}),
|
|
541
|
+
stubCatalogApp({
|
|
542
|
+
name: "@elizaos/plugin-shopify-ui",
|
|
172
543
|
displayName: "Shopify",
|
|
173
544
|
description: "Manage Shopify store operations from the agent workspace.",
|
|
174
545
|
category: "platform",
|
|
175
546
|
}),
|
|
176
547
|
stubCatalogApp({
|
|
177
|
-
name: "@elizaos/
|
|
548
|
+
name: "@elizaos/plugin-vincent",
|
|
178
549
|
displayName: "Vincent",
|
|
179
550
|
description: "Manage Vincent DeFi account access and trading context.",
|
|
180
551
|
category: "platform",
|
|
181
552
|
}),
|
|
553
|
+
stubCatalogApp({
|
|
554
|
+
name: "@elizaos/plugin-hyperliquid-app",
|
|
555
|
+
displayName: "Hyperliquid",
|
|
556
|
+
description: "Inspect Hyperliquid markets, positions, and order status.",
|
|
557
|
+
category: "platform",
|
|
558
|
+
capabilities: ["hyperliquid", "trading", "wallet"],
|
|
559
|
+
}),
|
|
560
|
+
stubCatalogApp({
|
|
561
|
+
name: "@elizaos/plugin-polymarket-app",
|
|
562
|
+
displayName: "Polymarket",
|
|
563
|
+
description: "Browse prediction markets and native trading readiness.",
|
|
564
|
+
category: "platform",
|
|
565
|
+
capabilities: ["polymarket", "prediction-markets", "wallet"],
|
|
566
|
+
}),
|
|
182
567
|
];
|
|
183
568
|
|
|
569
|
+
let smokeFavoriteApps = [];
|
|
570
|
+
|
|
184
571
|
const stubMemoryStats = {
|
|
185
572
|
total: 0,
|
|
186
573
|
byType: {},
|
|
@@ -390,6 +777,113 @@ const emptyWalletMarketOverview = {
|
|
|
390
777
|
predictions: [],
|
|
391
778
|
};
|
|
392
779
|
|
|
780
|
+
const stubHyperliquidStatus = {
|
|
781
|
+
publicReadReady: true,
|
|
782
|
+
signerReady: false,
|
|
783
|
+
executionReady: false,
|
|
784
|
+
executionBlockedReason:
|
|
785
|
+
"Signed Hyperliquid exchange mutations are disabled in UI smoke.",
|
|
786
|
+
accountAddress: null,
|
|
787
|
+
apiBaseUrl: "https://api.hyperliquid.xyz",
|
|
788
|
+
credentialMode: "none",
|
|
789
|
+
readiness: {
|
|
790
|
+
publicReads: true,
|
|
791
|
+
accountReads: false,
|
|
792
|
+
signer: false,
|
|
793
|
+
execution: false,
|
|
794
|
+
},
|
|
795
|
+
account: {
|
|
796
|
+
address: null,
|
|
797
|
+
source: "none",
|
|
798
|
+
guidance:
|
|
799
|
+
"Connect a managed vault or configure an account address for account reads.",
|
|
800
|
+
},
|
|
801
|
+
vault: {
|
|
802
|
+
configured: false,
|
|
803
|
+
ready: false,
|
|
804
|
+
address: null,
|
|
805
|
+
guidance: "Public market reads do not require a vault.",
|
|
806
|
+
},
|
|
807
|
+
apiWallet: {
|
|
808
|
+
configured: false,
|
|
809
|
+
guidance: "API-wallet delegation is optional.",
|
|
810
|
+
},
|
|
811
|
+
};
|
|
812
|
+
|
|
813
|
+
const stubHyperliquidMarkets = {
|
|
814
|
+
markets: [
|
|
815
|
+
{
|
|
816
|
+
name: "BTC",
|
|
817
|
+
index: 0,
|
|
818
|
+
szDecimals: 5,
|
|
819
|
+
maxLeverage: 50,
|
|
820
|
+
onlyIsolated: false,
|
|
821
|
+
isDelisted: false,
|
|
822
|
+
},
|
|
823
|
+
{
|
|
824
|
+
name: "ETH",
|
|
825
|
+
index: 1,
|
|
826
|
+
szDecimals: 4,
|
|
827
|
+
maxLeverage: 50,
|
|
828
|
+
onlyIsolated: false,
|
|
829
|
+
isDelisted: false,
|
|
830
|
+
},
|
|
831
|
+
],
|
|
832
|
+
source: "hyperliquid-info-meta",
|
|
833
|
+
fetchedAt: "2026-01-01T00:00:00.000Z",
|
|
834
|
+
};
|
|
835
|
+
|
|
836
|
+
const stubPolymarketStatus = {
|
|
837
|
+
publicReads: {
|
|
838
|
+
ready: true,
|
|
839
|
+
reason: null,
|
|
840
|
+
gammaApiBase: "https://gamma-api.polymarket.com",
|
|
841
|
+
dataApiBase: "https://data-api.polymarket.com",
|
|
842
|
+
},
|
|
843
|
+
trading: {
|
|
844
|
+
ready: false,
|
|
845
|
+
credentialsReady: false,
|
|
846
|
+
missing: [
|
|
847
|
+
"POLYMARKET_PRIVATE_KEY",
|
|
848
|
+
"CLOB_API_KEY",
|
|
849
|
+
"CLOB_API_SECRET",
|
|
850
|
+
"CLOB_API_PASSPHRASE",
|
|
851
|
+
],
|
|
852
|
+
reason: "Trading is disabled in UI smoke.",
|
|
853
|
+
clobApiBase: "https://clob.polymarket.com",
|
|
854
|
+
},
|
|
855
|
+
};
|
|
856
|
+
|
|
857
|
+
const stubPolymarketMarket = {
|
|
858
|
+
id: "ui-smoke-market",
|
|
859
|
+
slug: "ui-smoke-market",
|
|
860
|
+
question: "Will the UI smoke suite stay green?",
|
|
861
|
+
description: "Deterministic fixture market for app-window QA.",
|
|
862
|
+
category: "QA",
|
|
863
|
+
active: true,
|
|
864
|
+
closed: false,
|
|
865
|
+
archived: false,
|
|
866
|
+
restricted: false,
|
|
867
|
+
enableOrderBook: true,
|
|
868
|
+
conditionId: "0xsmoke",
|
|
869
|
+
clobTokenIds: ["yes-token", "no-token"],
|
|
870
|
+
outcomes: [
|
|
871
|
+
{ name: "Yes", price: "0.72" },
|
|
872
|
+
{ name: "No", price: "0.28" },
|
|
873
|
+
],
|
|
874
|
+
liquidity: "10000",
|
|
875
|
+
volume: "42000",
|
|
876
|
+
volume24hr: "1200",
|
|
877
|
+
lastTradePrice: "0.72",
|
|
878
|
+
bestBid: "0.71",
|
|
879
|
+
bestAsk: "0.73",
|
|
880
|
+
image: null,
|
|
881
|
+
icon: null,
|
|
882
|
+
endDate: null,
|
|
883
|
+
startDate: "2026-01-01T00:00:00.000Z",
|
|
884
|
+
updatedAt: "2026-01-01T00:00:00.000Z",
|
|
885
|
+
};
|
|
886
|
+
|
|
393
887
|
const smokeGeneratedAt = "2026-01-01T00:00:00.000Z";
|
|
394
888
|
|
|
395
889
|
const emptyLifeOpsOverviewSummary = {
|
|
@@ -662,6 +1156,144 @@ function parsePositiveInt(value, fallback) {
|
|
|
662
1156
|
return Number.isFinite(parsed) && parsed > 0 ? parsed : fallback;
|
|
663
1157
|
}
|
|
664
1158
|
|
|
1159
|
+
function createStubConversation({ title = "New chat", metadata = {} } = {}) {
|
|
1160
|
+
conversationCounter += 1;
|
|
1161
|
+
const createdAt = nowIso();
|
|
1162
|
+
const conversation = {
|
|
1163
|
+
id: `stub-conversation-${conversationCounter}`,
|
|
1164
|
+
title:
|
|
1165
|
+
typeof title === "string" && title.trim().length > 0
|
|
1166
|
+
? title.trim()
|
|
1167
|
+
: "New chat",
|
|
1168
|
+
roomId: `stub-room-${conversationCounter}`,
|
|
1169
|
+
metadata:
|
|
1170
|
+
metadata && typeof metadata === "object" && !Array.isArray(metadata)
|
|
1171
|
+
? metadata
|
|
1172
|
+
: {},
|
|
1173
|
+
createdAt,
|
|
1174
|
+
updatedAt: createdAt,
|
|
1175
|
+
};
|
|
1176
|
+
stubConversations.unshift(conversation);
|
|
1177
|
+
stubConversationMessages.set(conversation.id, []);
|
|
1178
|
+
return conversation;
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
function findStubConversation(id) {
|
|
1182
|
+
return stubConversations.find((conversation) => conversation.id === id);
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
function createStubMessage(role, text) {
|
|
1186
|
+
messageCounter += 1;
|
|
1187
|
+
return {
|
|
1188
|
+
id: `stub-message-${messageCounter}`,
|
|
1189
|
+
role,
|
|
1190
|
+
text: typeof text === "string" ? text : "",
|
|
1191
|
+
timestamp: Date.now(),
|
|
1192
|
+
};
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
function stableTextHash(text) {
|
|
1196
|
+
let hash = 0x811c9dc5;
|
|
1197
|
+
for (let index = 0; index < text.length; index += 1) {
|
|
1198
|
+
hash ^= text.charCodeAt(index);
|
|
1199
|
+
hash = Math.imul(hash, 0x01000193) >>> 0;
|
|
1200
|
+
}
|
|
1201
|
+
return hash.toString(16).padStart(8, "0");
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
function normalizeAssistantInput(value) {
|
|
1205
|
+
return typeof value === "string" ? value.trim().replace(/\s+/g, " ") : "";
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
function classifyAssistantAction(text) {
|
|
1209
|
+
const normalized = text.toLowerCase();
|
|
1210
|
+
if (/\b(wallet|inventory|address|balance)\b/.test(normalized)) {
|
|
1211
|
+
return { type: "navigate", target: "/wallet" };
|
|
1212
|
+
}
|
|
1213
|
+
if (/\b(view|views|app|apps)\b/.test(normalized)) {
|
|
1214
|
+
return { type: "navigate", target: "/views" };
|
|
1215
|
+
}
|
|
1216
|
+
if (/\b(setting|settings|provider|model|voice)\b/.test(normalized)) {
|
|
1217
|
+
return { type: "navigate", target: "/settings" };
|
|
1218
|
+
}
|
|
1219
|
+
if (/\b(chat|conversation|message)\b/.test(normalized)) {
|
|
1220
|
+
return { type: "navigate", target: "/chat" };
|
|
1221
|
+
}
|
|
1222
|
+
return { type: "noop", target: null };
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
function createDeterministicAssistantText({ body, conversationId, transport }) {
|
|
1226
|
+
const inputText = normalizeAssistantInput(body?.text ?? body?.message);
|
|
1227
|
+
if (inputText === SMOKE_VOICE_TRANSCRIPT) {
|
|
1228
|
+
// Voice e2e: reply to the spoken turn with a plain sentence (not the JSON
|
|
1229
|
+
// fixture) so the bidirectional voice output is speakable + assertable.
|
|
1230
|
+
return SMOKE_VOICE_REPLY;
|
|
1231
|
+
}
|
|
1232
|
+
if (/\bbroken[_ -]?llm[_ -]?response\b/i.test(inputText)) {
|
|
1233
|
+
return `BROKEN_MOCK_LLM_RESPONSE:${JSON.stringify({
|
|
1234
|
+
fixture: "ui-smoke-assistant-v1",
|
|
1235
|
+
conversationId,
|
|
1236
|
+
transport,
|
|
1237
|
+
input: { text: inputText },
|
|
1238
|
+
action: classifyAssistantAction(inputText),
|
|
1239
|
+
}).slice(0, -2)}`;
|
|
1240
|
+
}
|
|
1241
|
+
const payload = {
|
|
1242
|
+
fixture: "ui-smoke-assistant-v1",
|
|
1243
|
+
registrySeam: "strict-fixture-registry",
|
|
1244
|
+
conversationId,
|
|
1245
|
+
transport,
|
|
1246
|
+
input: {
|
|
1247
|
+
text: inputText,
|
|
1248
|
+
length: inputText.length,
|
|
1249
|
+
hash: stableTextHash(inputText),
|
|
1250
|
+
},
|
|
1251
|
+
action: classifyAssistantAction(inputText),
|
|
1252
|
+
};
|
|
1253
|
+
return JSON.stringify(payload);
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
function recordUnhandledApiRequest(req, url) {
|
|
1257
|
+
const entry = {
|
|
1258
|
+
method: req.method ?? "GET",
|
|
1259
|
+
path: url.pathname,
|
|
1260
|
+
search: url.search,
|
|
1261
|
+
at: nowIso(),
|
|
1262
|
+
};
|
|
1263
|
+
unhandledApiRequests.push(entry);
|
|
1264
|
+
if (unhandledApiRequests.length > 50) {
|
|
1265
|
+
unhandledApiRequests.shift();
|
|
1266
|
+
}
|
|
1267
|
+
console.error(
|
|
1268
|
+
`[playwright-ui-smoke-api-stub] unhandled API route: ${entry.method} ${entry.path}${entry.search}`,
|
|
1269
|
+
);
|
|
1270
|
+
return entry;
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
function appendStubMessage(conversationId, message) {
|
|
1274
|
+
const messages = stubConversationMessages.get(conversationId) ?? [];
|
|
1275
|
+
messages.push(message);
|
|
1276
|
+
stubConversationMessages.set(conversationId, messages);
|
|
1277
|
+
const conversation = findStubConversation(conversationId);
|
|
1278
|
+
if (conversation) conversation.updatedAt = nowIso();
|
|
1279
|
+
return message;
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
function cleanupEmptyStubConversations({ keepId } = {}) {
|
|
1283
|
+
const deleted = [];
|
|
1284
|
+
for (let index = stubConversations.length - 1; index >= 0; index -= 1) {
|
|
1285
|
+
const conversation = stubConversations[index];
|
|
1286
|
+
if (typeof keepId === "string" && conversation.id === keepId) continue;
|
|
1287
|
+
const messages = stubConversationMessages.get(conversation.id) ?? [];
|
|
1288
|
+
const hasUserMessage = messages.some((message) => message.role === "user");
|
|
1289
|
+
if (hasUserMessage) continue;
|
|
1290
|
+
stubConversations.splice(index, 1);
|
|
1291
|
+
stubConversationMessages.delete(conversation.id);
|
|
1292
|
+
deleted.push(conversation.id);
|
|
1293
|
+
}
|
|
1294
|
+
return deleted;
|
|
1295
|
+
}
|
|
1296
|
+
|
|
665
1297
|
function buildRuntimeSnapshot(url) {
|
|
666
1298
|
const maxDepth = parsePositiveInt(url.searchParams.get("depth"), 10);
|
|
667
1299
|
const maxArrayLength = parsePositiveInt(
|
|
@@ -878,6 +1510,581 @@ function sendEmpty(req, res, status) {
|
|
|
878
1510
|
res.end();
|
|
879
1511
|
}
|
|
880
1512
|
|
|
1513
|
+
function sendBinary(req, res, status, contentType, body) {
|
|
1514
|
+
applyCors(req, res);
|
|
1515
|
+
res.statusCode = status;
|
|
1516
|
+
res.setHeader("Content-Type", contentType);
|
|
1517
|
+
res.end(req.method === "HEAD" ? undefined : body);
|
|
1518
|
+
}
|
|
1519
|
+
|
|
1520
|
+
function contentTypeForSmokeViewAsset(assetPath) {
|
|
1521
|
+
const ext = path.extname(assetPath).toLowerCase();
|
|
1522
|
+
if (ext === ".js" || ext === ".mjs")
|
|
1523
|
+
return "application/javascript; charset=utf-8";
|
|
1524
|
+
if (ext === ".css") return "text/css; charset=utf-8";
|
|
1525
|
+
if (ext === ".map" || ext === ".json")
|
|
1526
|
+
return "application/json; charset=utf-8";
|
|
1527
|
+
if (ext === ".svg") return "image/svg+xml";
|
|
1528
|
+
if (ext === ".png") return "image/png";
|
|
1529
|
+
if (ext === ".jpg" || ext === ".jpeg") return "image/jpeg";
|
|
1530
|
+
if (ext === ".webp") return "image/webp";
|
|
1531
|
+
return "application/octet-stream";
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1534
|
+
function convertNamedImportsToDestructuring(namedImports) {
|
|
1535
|
+
return namedImports
|
|
1536
|
+
.split(",")
|
|
1537
|
+
.map((part) => part.trim())
|
|
1538
|
+
.filter(Boolean)
|
|
1539
|
+
.map((part) => part.replace(/\s+as\s+/u, ": "))
|
|
1540
|
+
.join(", ");
|
|
1541
|
+
}
|
|
1542
|
+
|
|
1543
|
+
function buildHostExternalImportReplacement(importClause, specifier, index) {
|
|
1544
|
+
const moduleVar = `__eliza_dynamic_view_host_external_${index}`;
|
|
1545
|
+
const lines = [
|
|
1546
|
+
`const ${moduleVar} = await globalThis.__ELIZA_DYNAMIC_VIEW_IMPORT__(${JSON.stringify(specifier)});`,
|
|
1547
|
+
];
|
|
1548
|
+
const trimmed = importClause.trim();
|
|
1549
|
+
if (trimmed.startsWith("* as ")) {
|
|
1550
|
+
lines.push(`const ${trimmed.slice("* as ".length).trim()} = ${moduleVar};`);
|
|
1551
|
+
return lines.join("\n");
|
|
1552
|
+
}
|
|
1553
|
+
const namedMatch = trimmed.match(/^\{([\s\S]*)\}$/u);
|
|
1554
|
+
if (namedMatch) {
|
|
1555
|
+
lines.push(
|
|
1556
|
+
`const { ${convertNamedImportsToDestructuring(namedMatch[1])} } = ${moduleVar};`,
|
|
1557
|
+
);
|
|
1558
|
+
return lines.join("\n");
|
|
1559
|
+
}
|
|
1560
|
+
const defaultAndNamedMatch = trimmed.match(/^([^,]+),\s*\{([\s\S]*)\}$/u);
|
|
1561
|
+
if (defaultAndNamedMatch) {
|
|
1562
|
+
lines.push(
|
|
1563
|
+
`const ${defaultAndNamedMatch[1].trim()} = ${moduleVar}.default ?? ${moduleVar};`,
|
|
1564
|
+
);
|
|
1565
|
+
lines.push(
|
|
1566
|
+
`const { ${convertNamedImportsToDestructuring(defaultAndNamedMatch[2])} } = ${moduleVar};`,
|
|
1567
|
+
);
|
|
1568
|
+
return lines.join("\n");
|
|
1569
|
+
}
|
|
1570
|
+
lines.push(`const ${trimmed} = ${moduleVar}.default ?? ${moduleVar};`);
|
|
1571
|
+
return lines.join("\n");
|
|
1572
|
+
}
|
|
1573
|
+
|
|
1574
|
+
function rewriteHostExternalImports(source, specifiers) {
|
|
1575
|
+
if (specifiers.length === 0) return source;
|
|
1576
|
+
const specifierPattern = specifiers
|
|
1577
|
+
.map((item) => item.replace(/[.*+?^${}()|[\]\\]/gu, "\\$&"))
|
|
1578
|
+
.join("|");
|
|
1579
|
+
const fromImportPattern = new RegExp(
|
|
1580
|
+
`import\\s+([^;]*?)\\s+from\\s+["'](${specifierPattern})["'];?`,
|
|
1581
|
+
"gu",
|
|
1582
|
+
);
|
|
1583
|
+
const sideEffectPattern = new RegExp(
|
|
1584
|
+
`import\\s+["'](${specifierPattern})["'];?`,
|
|
1585
|
+
"gu",
|
|
1586
|
+
);
|
|
1587
|
+
let replacementIndex = 0;
|
|
1588
|
+
return source
|
|
1589
|
+
.replace(fromImportPattern, (_match, importClause, specifier) =>
|
|
1590
|
+
buildHostExternalImportReplacement(
|
|
1591
|
+
String(importClause),
|
|
1592
|
+
String(specifier),
|
|
1593
|
+
replacementIndex++,
|
|
1594
|
+
),
|
|
1595
|
+
)
|
|
1596
|
+
.replace(
|
|
1597
|
+
sideEffectPattern,
|
|
1598
|
+
(_match, specifier) =>
|
|
1599
|
+
`await globalThis.__ELIZA_DYNAMIC_VIEW_IMPORT__(${JSON.stringify(String(specifier))});`,
|
|
1600
|
+
);
|
|
1601
|
+
}
|
|
1602
|
+
|
|
1603
|
+
function parseHostExternalSpecifiers(url) {
|
|
1604
|
+
if (url.searchParams.get("hostExternalRuntime") !== "1") return [];
|
|
1605
|
+
return (url.searchParams.get("hostExternalSpecifiers") ?? "")
|
|
1606
|
+
.split(",")
|
|
1607
|
+
.map((item) => item.trim())
|
|
1608
|
+
.filter(Boolean);
|
|
1609
|
+
}
|
|
1610
|
+
|
|
1611
|
+
function smokeViewByRequest(id, viewType) {
|
|
1612
|
+
return smokeViews.find(
|
|
1613
|
+
(view) => view.id === id && view.viewType === (viewType || "gui"),
|
|
1614
|
+
);
|
|
1615
|
+
}
|
|
1616
|
+
|
|
1617
|
+
function safeComponentExportName(value) {
|
|
1618
|
+
return /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(value) ? value : "SmokeView";
|
|
1619
|
+
}
|
|
1620
|
+
|
|
1621
|
+
function smokeTuiViewBundleSource(view, exportName) {
|
|
1622
|
+
const label = JSON.stringify(view.label);
|
|
1623
|
+
const id = JSON.stringify(view.id);
|
|
1624
|
+
const viewType = JSON.stringify(view.viewType);
|
|
1625
|
+
const pluginName = JSON.stringify(view.pluginName);
|
|
1626
|
+
const commands =
|
|
1627
|
+
view.id === "feed"
|
|
1628
|
+
? [
|
|
1629
|
+
"refresh-agent-status",
|
|
1630
|
+
"refresh-feed",
|
|
1631
|
+
"list-agents",
|
|
1632
|
+
"summarize-feed",
|
|
1633
|
+
]
|
|
1634
|
+
: ["status", "refresh", "inspect", "help"];
|
|
1635
|
+
return `import React from "react";
|
|
1636
|
+
|
|
1637
|
+
const viewMeta = {
|
|
1638
|
+
id: ${id},
|
|
1639
|
+
label: ${label},
|
|
1640
|
+
viewType: ${viewType},
|
|
1641
|
+
pluginName: ${pluginName}
|
|
1642
|
+
};
|
|
1643
|
+
const commands = ${JSON.stringify(commands)};
|
|
1644
|
+
|
|
1645
|
+
function SmokeView() {
|
|
1646
|
+
const [outputs, setOutputs] = React.useState([]);
|
|
1647
|
+
const runCommand = async (command) => {
|
|
1648
|
+
window.dispatchEvent(new CustomEvent("eliza:tui-command", {
|
|
1649
|
+
detail: { viewId: viewMeta.id, command }
|
|
1650
|
+
}));
|
|
1651
|
+
let result;
|
|
1652
|
+
try {
|
|
1653
|
+
const response = await fetch("/api/views/" + encodeURIComponent(viewMeta.id) + "/interact?viewType=tui", {
|
|
1654
|
+
method: "POST",
|
|
1655
|
+
headers: { "content-type": "application/json" },
|
|
1656
|
+
body: JSON.stringify({ capability: command, timeoutMs: 5000 })
|
|
1657
|
+
});
|
|
1658
|
+
result = await response.json();
|
|
1659
|
+
} catch (error) {
|
|
1660
|
+
result = { ok: false, error: error instanceof Error ? error.message : String(error) };
|
|
1661
|
+
}
|
|
1662
|
+
setOutputs((current) => [...current, { command, result }]);
|
|
1663
|
+
};
|
|
1664
|
+
const state = JSON.stringify({
|
|
1665
|
+
viewId: viewMeta.id,
|
|
1666
|
+
viewType: "tui",
|
|
1667
|
+
status: "ready",
|
|
1668
|
+
fixture: "ui-smoke",
|
|
1669
|
+
commandCount: commands.length
|
|
1670
|
+
});
|
|
1671
|
+
return React.createElement(
|
|
1672
|
+
"div",
|
|
1673
|
+
{
|
|
1674
|
+
"data-view-state": state,
|
|
1675
|
+
style: {
|
|
1676
|
+
minHeight: "100vh",
|
|
1677
|
+
background: "#020617",
|
|
1678
|
+
color: "#cbd5e1",
|
|
1679
|
+
fontFamily: "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",
|
|
1680
|
+
padding: 20
|
|
1681
|
+
}
|
|
1682
|
+
},
|
|
1683
|
+
React.createElement("div", { style: { color: "#7dd3fc", marginBottom: 4 } }, "elizaos://" + viewMeta.id + " --type=tui"),
|
|
1684
|
+
React.createElement("div", { style: { color: "#94a3b8", marginBottom: 16 } }, viewMeta.label + " smoke terminal"),
|
|
1685
|
+
React.createElement(
|
|
1686
|
+
"div",
|
|
1687
|
+
{ style: { display: "flex", flexWrap: "wrap", gap: 8 } },
|
|
1688
|
+
...commands.map((command) =>
|
|
1689
|
+
React.createElement(
|
|
1690
|
+
"button",
|
|
1691
|
+
{
|
|
1692
|
+
key: command,
|
|
1693
|
+
type: "button",
|
|
1694
|
+
"data-terminal-command": command,
|
|
1695
|
+
onClick: () => void runCommand(command),
|
|
1696
|
+
style: {
|
|
1697
|
+
border: "1px solid #38bdf8",
|
|
1698
|
+
borderRadius: 4,
|
|
1699
|
+
color: "#e0f2fe",
|
|
1700
|
+
background: "transparent",
|
|
1701
|
+
padding: "6px 10px"
|
|
1702
|
+
}
|
|
1703
|
+
},
|
|
1704
|
+
command
|
|
1705
|
+
)
|
|
1706
|
+
)
|
|
1707
|
+
),
|
|
1708
|
+
...outputs.map((entry, index) =>
|
|
1709
|
+
React.createElement(
|
|
1710
|
+
"pre",
|
|
1711
|
+
{
|
|
1712
|
+
key: entry.command + index,
|
|
1713
|
+
"data-terminal-output": entry.result?.ok ? "ok" : "error",
|
|
1714
|
+
style: {
|
|
1715
|
+
marginTop: 8,
|
|
1716
|
+
whiteSpace: "pre-wrap",
|
|
1717
|
+
color: entry.result?.ok ? "#bbf7d0" : "#fecaca"
|
|
1718
|
+
}
|
|
1719
|
+
},
|
|
1720
|
+
"$ " + entry.command + "\\n" + JSON.stringify(entry.result, null, 2)
|
|
1721
|
+
)
|
|
1722
|
+
)
|
|
1723
|
+
);
|
|
1724
|
+
}
|
|
1725
|
+
|
|
1726
|
+
export { SmokeView as ${exportName} };
|
|
1727
|
+
export default SmokeView;
|
|
1728
|
+
export async function interact(capability, params = {}) {
|
|
1729
|
+
return { ok: true, viewId: viewMeta.id, viewType: viewMeta.viewType, capability, params };
|
|
1730
|
+
}
|
|
1731
|
+
`;
|
|
1732
|
+
}
|
|
1733
|
+
|
|
1734
|
+
function smokeScreenshareBundleSource(view, exportName) {
|
|
1735
|
+
const label = JSON.stringify(view.label);
|
|
1736
|
+
const id = JSON.stringify(view.id);
|
|
1737
|
+
const viewType = JSON.stringify(view.viewType);
|
|
1738
|
+
const pluginName = JSON.stringify(view.pluginName);
|
|
1739
|
+
return `import React from "react";
|
|
1740
|
+
|
|
1741
|
+
const viewMeta = {
|
|
1742
|
+
id: ${id},
|
|
1743
|
+
label: ${label},
|
|
1744
|
+
viewType: ${viewType},
|
|
1745
|
+
pluginName: ${pluginName}
|
|
1746
|
+
};
|
|
1747
|
+
|
|
1748
|
+
function maskSession(value) {
|
|
1749
|
+
if (!value) return "";
|
|
1750
|
+
return value.slice(0, 6) + "\\u2026" + value.slice(-4);
|
|
1751
|
+
}
|
|
1752
|
+
|
|
1753
|
+
function maskToken(value) {
|
|
1754
|
+
if (!value) return "";
|
|
1755
|
+
return "\\u2022\\u2022\\u2022\\u2022 " + value.slice(-4);
|
|
1756
|
+
}
|
|
1757
|
+
|
|
1758
|
+
function SmokeView() {
|
|
1759
|
+
const [capabilities, setCapabilities] = React.useState(null);
|
|
1760
|
+
const [host, setHost] = React.useState(null);
|
|
1761
|
+
const [token, setToken] = React.useState("");
|
|
1762
|
+
const [viewerUrl, setViewerUrl] = React.useState("");
|
|
1763
|
+
const [remoteBase, setRemoteBase] = React.useState("");
|
|
1764
|
+
const [remoteSession, setRemoteSession] = React.useState("");
|
|
1765
|
+
const [remoteToken, setRemoteToken] = React.useState("");
|
|
1766
|
+
|
|
1767
|
+
const refreshCapabilities = React.useCallback(async () => {
|
|
1768
|
+
const response = await fetch("/api/apps/screenshare/capabilities");
|
|
1769
|
+
setCapabilities(await response.json());
|
|
1770
|
+
}, []);
|
|
1771
|
+
|
|
1772
|
+
React.useEffect(() => {
|
|
1773
|
+
void refreshCapabilities();
|
|
1774
|
+
}, [refreshCapabilities]);
|
|
1775
|
+
|
|
1776
|
+
const startHost = async () => {
|
|
1777
|
+
const response = await fetch("/api/apps/screenshare/session", {
|
|
1778
|
+
method: "POST",
|
|
1779
|
+
headers: { "content-type": "application/json" },
|
|
1780
|
+
body: JSON.stringify({ label: "This machine" })
|
|
1781
|
+
});
|
|
1782
|
+
const result = await response.json();
|
|
1783
|
+
setHost(result.session);
|
|
1784
|
+
setToken(result.token);
|
|
1785
|
+
setViewerUrl(result.viewerUrl);
|
|
1786
|
+
};
|
|
1787
|
+
|
|
1788
|
+
const copyDetails = async () => {
|
|
1789
|
+
await navigator.clipboard.writeText(JSON.stringify({
|
|
1790
|
+
sessionId: host?.id,
|
|
1791
|
+
token
|
|
1792
|
+
}));
|
|
1793
|
+
};
|
|
1794
|
+
|
|
1795
|
+
const openHostViewer = () => {
|
|
1796
|
+
if (viewerUrl) window.open(viewerUrl);
|
|
1797
|
+
};
|
|
1798
|
+
|
|
1799
|
+
const openRemote = () => {
|
|
1800
|
+
const url = new URL("/api/apps/screenshare/viewer", remoteBase);
|
|
1801
|
+
url.searchParams.set("sessionId", remoteSession);
|
|
1802
|
+
url.searchParams.set("token", remoteToken);
|
|
1803
|
+
url.searchParams.set("remoteBase", remoteBase);
|
|
1804
|
+
window.open(url.toString());
|
|
1805
|
+
};
|
|
1806
|
+
|
|
1807
|
+
const stopHost = async () => {
|
|
1808
|
+
if (!host?.id) return;
|
|
1809
|
+
const response = await fetch("/api/apps/screenshare/session/" + encodeURIComponent(host.id) + "/stop", {
|
|
1810
|
+
method: "POST",
|
|
1811
|
+
headers: {
|
|
1812
|
+
"content-type": "application/json",
|
|
1813
|
+
"x-screenshare-token": token
|
|
1814
|
+
},
|
|
1815
|
+
body: JSON.stringify({ token })
|
|
1816
|
+
});
|
|
1817
|
+
const result = await response.json();
|
|
1818
|
+
setHost(result.session);
|
|
1819
|
+
};
|
|
1820
|
+
|
|
1821
|
+
const capabilityList = capabilities?.capabilities ?? {};
|
|
1822
|
+
return React.createElement(
|
|
1823
|
+
"section",
|
|
1824
|
+
{ "aria-label": viewMeta.label, style: { minHeight: "100vh", padding: 24 } },
|
|
1825
|
+
React.createElement("h1", null, viewMeta.label),
|
|
1826
|
+
React.createElement("p", null, viewMeta.pluginName + " dynamic view smoke surface is ready."),
|
|
1827
|
+
React.createElement("h2", null, "Host"),
|
|
1828
|
+
React.createElement("button", { type: "button", onClick: startHost }, "Start host session"),
|
|
1829
|
+
host && React.createElement("button", { type: "button", onClick: copyDetails }, "Copy host details"),
|
|
1830
|
+
host && React.createElement("button", { type: "button", onClick: openHostViewer }, "Open host viewer"),
|
|
1831
|
+
host && React.createElement("button", { type: "button", onClick: stopHost }, "Stop host session"),
|
|
1832
|
+
host && React.createElement("div", null,
|
|
1833
|
+
React.createElement("input", { placeholder: "Session", readOnly: true, value: maskSession(host.id) }),
|
|
1834
|
+
React.createElement("input", { placeholder: "Token", readOnly: true, value: maskToken(token) }),
|
|
1835
|
+
React.createElement("span", null, String(host.frameCount ?? 0)),
|
|
1836
|
+
React.createElement("span", null, String(host.inputCount ?? 0)),
|
|
1837
|
+
React.createElement("span", null, host.status)
|
|
1838
|
+
),
|
|
1839
|
+
React.createElement("h2", null, "Capabilities"),
|
|
1840
|
+
React.createElement("button", { type: "button", onClick: () => void refreshCapabilities() }, "Refresh capabilities"),
|
|
1841
|
+
React.createElement("div", null,
|
|
1842
|
+
React.createElement("span", null, "Screenshot"),
|
|
1843
|
+
React.createElement("span", null, capabilityList.screenshot?.available ? "Ready" : "Unavailable")
|
|
1844
|
+
),
|
|
1845
|
+
React.createElement("div", null,
|
|
1846
|
+
React.createElement("span", null, "Keyboard"),
|
|
1847
|
+
React.createElement("span", null, capabilityList.keyboard?.available ? "Ready" : "Unavailable")
|
|
1848
|
+
),
|
|
1849
|
+
React.createElement("h2", null, "Remote"),
|
|
1850
|
+
React.createElement("input", { placeholder: "Server URL", value: remoteBase, onChange: (event) => setRemoteBase(event.target.value) }),
|
|
1851
|
+
React.createElement("input", { placeholder: "Session", value: remoteSession, onChange: (event) => setRemoteSession(event.target.value) }),
|
|
1852
|
+
React.createElement("input", { placeholder: "Token", value: remoteToken, onChange: (event) => setRemoteToken(event.target.value) }),
|
|
1853
|
+
React.createElement("button", { type: "button", onClick: openRemote }, "Connect to remote")
|
|
1854
|
+
);
|
|
1855
|
+
}
|
|
1856
|
+
|
|
1857
|
+
export { SmokeView as ${exportName} };
|
|
1858
|
+
export default SmokeView;
|
|
1859
|
+
export async function interact(capability, params = {}) {
|
|
1860
|
+
return { ok: true, viewId: viewMeta.id, viewType: viewMeta.viewType, capability, params };
|
|
1861
|
+
}
|
|
1862
|
+
`;
|
|
1863
|
+
}
|
|
1864
|
+
|
|
1865
|
+
function smokeTaskCoordinatorBundleSource(view, exportName) {
|
|
1866
|
+
const label = JSON.stringify(view.label);
|
|
1867
|
+
const id = JSON.stringify(view.id);
|
|
1868
|
+
const viewType = JSON.stringify(view.viewType);
|
|
1869
|
+
const pluginName = JSON.stringify(view.pluginName);
|
|
1870
|
+
return `import React from "react";
|
|
1871
|
+
|
|
1872
|
+
const viewMeta = {
|
|
1873
|
+
id: ${id},
|
|
1874
|
+
label: ${label},
|
|
1875
|
+
viewType: ${viewType},
|
|
1876
|
+
pluginName: ${pluginName}
|
|
1877
|
+
};
|
|
1878
|
+
|
|
1879
|
+
function statusLabel(thread) {
|
|
1880
|
+
return String(thread?.status ?? "open").replace(/_/g, " ");
|
|
1881
|
+
}
|
|
1882
|
+
|
|
1883
|
+
function SmokeView() {
|
|
1884
|
+
const [tasks, setTasks] = React.useState([]);
|
|
1885
|
+
const [detail, setDetail] = React.useState(null);
|
|
1886
|
+
const [search, setSearch] = React.useState("");
|
|
1887
|
+
|
|
1888
|
+
const loadTasks = React.useCallback(async (nextSearch = search) => {
|
|
1889
|
+
const url = new URL("/api/orchestrator/tasks", window.location.origin);
|
|
1890
|
+
url.searchParams.set("limit", "50");
|
|
1891
|
+
if (nextSearch) url.searchParams.set("search", nextSearch);
|
|
1892
|
+
const response = await fetch(url.pathname + url.search);
|
|
1893
|
+
const result = await response.json();
|
|
1894
|
+
setTasks(result.tasks ?? []);
|
|
1895
|
+
}, [search]);
|
|
1896
|
+
|
|
1897
|
+
React.useEffect(() => {
|
|
1898
|
+
void loadTasks("");
|
|
1899
|
+
}, []);
|
|
1900
|
+
|
|
1901
|
+
const updateSearch = (value) => {
|
|
1902
|
+
setSearch(value);
|
|
1903
|
+
void loadTasks(value);
|
|
1904
|
+
};
|
|
1905
|
+
|
|
1906
|
+
const openTask = async (task) => {
|
|
1907
|
+
const response = await fetch("/api/orchestrator/tasks/" + encodeURIComponent(task.id));
|
|
1908
|
+
setDetail(await response.json());
|
|
1909
|
+
};
|
|
1910
|
+
|
|
1911
|
+
const archiveTask = async () => {
|
|
1912
|
+
if (!detail?.id) return;
|
|
1913
|
+
await fetch("/api/orchestrator/tasks/" + encodeURIComponent(detail.id) + "/archive", { method: "POST" });
|
|
1914
|
+
await loadTasks(search);
|
|
1915
|
+
};
|
|
1916
|
+
|
|
1917
|
+
const reopenTask = async () => {
|
|
1918
|
+
if (!detail?.id) return;
|
|
1919
|
+
await fetch("/api/orchestrator/tasks/" + encodeURIComponent(detail.id) + "/reopen", { method: "POST" });
|
|
1920
|
+
const response = await fetch("/api/orchestrator/tasks/" + encodeURIComponent(detail.id));
|
|
1921
|
+
setDetail(await response.json());
|
|
1922
|
+
await loadTasks(search);
|
|
1923
|
+
};
|
|
1924
|
+
|
|
1925
|
+
return React.createElement(
|
|
1926
|
+
"section",
|
|
1927
|
+
{
|
|
1928
|
+
"aria-label": viewMeta.label,
|
|
1929
|
+
"data-testid": "chat-widget-orchestrator",
|
|
1930
|
+
style: { minHeight: "100vh", padding: 24 }
|
|
1931
|
+
},
|
|
1932
|
+
React.createElement("h1", null, viewMeta.label),
|
|
1933
|
+
React.createElement("p", null, viewMeta.pluginName + " dynamic view smoke surface is ready."),
|
|
1934
|
+
React.createElement("input", {
|
|
1935
|
+
placeholder: "Search tasks",
|
|
1936
|
+
value: search,
|
|
1937
|
+
onChange: (event) => updateSearch(event.target.value)
|
|
1938
|
+
}),
|
|
1939
|
+
React.createElement(
|
|
1940
|
+
"div",
|
|
1941
|
+
null,
|
|
1942
|
+
...tasks.map((task) =>
|
|
1943
|
+
React.createElement(
|
|
1944
|
+
"button",
|
|
1945
|
+
{
|
|
1946
|
+
key: task.id,
|
|
1947
|
+
type: "button",
|
|
1948
|
+
onClick: () => void openTask(task),
|
|
1949
|
+
style: { display: "block", marginTop: 8 }
|
|
1950
|
+
},
|
|
1951
|
+
task.title + " " + statusLabel(task)
|
|
1952
|
+
)
|
|
1953
|
+
)
|
|
1954
|
+
),
|
|
1955
|
+
detail && React.createElement(
|
|
1956
|
+
"article",
|
|
1957
|
+
{ "aria-label": "Task detail", style: { marginTop: 16 } },
|
|
1958
|
+
React.createElement("h2", null, detail.title),
|
|
1959
|
+
React.createElement("p", null, detail.summary ?? detail.originalRequest ?? ""),
|
|
1960
|
+
...(detail.acceptanceCriteria ?? []).map((item) => React.createElement("p", { key: item }, item)),
|
|
1961
|
+
...(detail.sessions ?? []).map((session) =>
|
|
1962
|
+
React.createElement(
|
|
1963
|
+
"div",
|
|
1964
|
+
{ key: session.id },
|
|
1965
|
+
React.createElement("span", null, session.label),
|
|
1966
|
+
React.createElement("span", null, (session.framework ?? "") + " (" + (session.providerSource ?? "") + ")")
|
|
1967
|
+
)
|
|
1968
|
+
),
|
|
1969
|
+
...(detail.artifacts ?? []).map((artifact) => React.createElement("p", { key: artifact.id }, artifact.title)),
|
|
1970
|
+
...(detail.pendingDecisions ?? []).map((decision) => React.createElement("p", { key: decision.sessionId }, decision.promptText)),
|
|
1971
|
+
...(detail.events ?? []).map((event) => React.createElement("p", { key: event.id }, event.summary)),
|
|
1972
|
+
...(detail.transcripts ?? []).map((transcript) => React.createElement("p", { key: transcript.id }, transcript.content)),
|
|
1973
|
+
detail.status === "archived"
|
|
1974
|
+
? React.createElement("button", { type: "button", onClick: () => void reopenTask() }, "Reopen")
|
|
1975
|
+
: React.createElement("button", { type: "button", onClick: () => void archiveTask() }, "Delete")
|
|
1976
|
+
)
|
|
1977
|
+
);
|
|
1978
|
+
}
|
|
1979
|
+
|
|
1980
|
+
export { SmokeView as ${exportName} };
|
|
1981
|
+
export default SmokeView;
|
|
1982
|
+
export async function interact(capability, params = {}) {
|
|
1983
|
+
return { ok: true, viewId: viewMeta.id, viewType: viewMeta.viewType, capability, params };
|
|
1984
|
+
}
|
|
1985
|
+
`;
|
|
1986
|
+
}
|
|
1987
|
+
|
|
1988
|
+
function smokeGenericViewBundleSource(view, exportName) {
|
|
1989
|
+
const label = JSON.stringify(view.label);
|
|
1990
|
+
const id = JSON.stringify(view.id);
|
|
1991
|
+
const viewType = JSON.stringify(view.viewType);
|
|
1992
|
+
const pluginName = JSON.stringify(view.pluginName);
|
|
1993
|
+
return `import React from "react";
|
|
1994
|
+
|
|
1995
|
+
const viewMeta = {
|
|
1996
|
+
id: ${id},
|
|
1997
|
+
label: ${label},
|
|
1998
|
+
viewType: ${viewType},
|
|
1999
|
+
pluginName: ${pluginName}
|
|
2000
|
+
};
|
|
2001
|
+
|
|
2002
|
+
function SmokeView() {
|
|
2003
|
+
return React.createElement(
|
|
2004
|
+
"section",
|
|
2005
|
+
{ "aria-label": viewMeta.label, style: { minHeight: "100vh", padding: 24 } },
|
|
2006
|
+
React.createElement("h1", null, viewMeta.label),
|
|
2007
|
+
React.createElement("p", null, viewMeta.pluginName + " dynamic view smoke surface is ready."),
|
|
2008
|
+
React.createElement("button", { type: "button" }, "Refresh view"),
|
|
2009
|
+
React.createElement("input", { "aria-label": viewMeta.label + " input", defaultValue: viewMeta.id })
|
|
2010
|
+
);
|
|
2011
|
+
}
|
|
2012
|
+
|
|
2013
|
+
export { SmokeView as ${exportName} };
|
|
2014
|
+
export default SmokeView;
|
|
2015
|
+
export async function interact(capability, params = {}) {
|
|
2016
|
+
return { ok: true, viewId: viewMeta.id, viewType: viewMeta.viewType, capability, params };
|
|
2017
|
+
}
|
|
2018
|
+
`;
|
|
2019
|
+
}
|
|
2020
|
+
|
|
2021
|
+
function smokeViewBundleSource(view) {
|
|
2022
|
+
const exportName = safeComponentExportName(view.componentExport);
|
|
2023
|
+
if (view.viewType === "tui") {
|
|
2024
|
+
return smokeTuiViewBundleSource(view, exportName);
|
|
2025
|
+
}
|
|
2026
|
+
if (view.id === "screenshare") {
|
|
2027
|
+
return smokeScreenshareBundleSource(view, exportName);
|
|
2028
|
+
}
|
|
2029
|
+
if (view.id === "task-coordinator") {
|
|
2030
|
+
return smokeTaskCoordinatorBundleSource(view, exportName);
|
|
2031
|
+
}
|
|
2032
|
+
return smokeGenericViewBundleSource(view, exportName);
|
|
2033
|
+
}
|
|
2034
|
+
|
|
2035
|
+
function sendSmokeViewAsset(req, res, url, view, subResource) {
|
|
2036
|
+
const bundleDir = path.join(
|
|
2037
|
+
repoRoot,
|
|
2038
|
+
"plugins",
|
|
2039
|
+
view._smokePluginDirName,
|
|
2040
|
+
"dist",
|
|
2041
|
+
"views",
|
|
2042
|
+
);
|
|
2043
|
+
const assetPath = path.resolve(bundleDir, decodeURIComponent(subResource));
|
|
2044
|
+
const relative = path.relative(bundleDir, assetPath);
|
|
2045
|
+
if (
|
|
2046
|
+
relative.startsWith("..") ||
|
|
2047
|
+
path.isAbsolute(relative) ||
|
|
2048
|
+
relative === ""
|
|
2049
|
+
) {
|
|
2050
|
+
sendJson(req, res, 400, { error: "Malformed view asset path" });
|
|
2051
|
+
return;
|
|
2052
|
+
}
|
|
2053
|
+
const hostExternalSpecifiers = parseHostExternalSpecifiers(url);
|
|
2054
|
+
if (!existsSync(assetPath)) {
|
|
2055
|
+
if (subResource === "bundle.js") {
|
|
2056
|
+
const source = smokeViewBundleSource(view);
|
|
2057
|
+
const body =
|
|
2058
|
+
hostExternalSpecifiers.length > 0
|
|
2059
|
+
? rewriteHostExternalImports(source, hostExternalSpecifiers)
|
|
2060
|
+
: source;
|
|
2061
|
+
sendBinary(
|
|
2062
|
+
req,
|
|
2063
|
+
res,
|
|
2064
|
+
200,
|
|
2065
|
+
"application/javascript; charset=utf-8",
|
|
2066
|
+
Buffer.from(body, "utf8"),
|
|
2067
|
+
);
|
|
2068
|
+
return;
|
|
2069
|
+
}
|
|
2070
|
+
sendJson(req, res, 404, { error: `View asset not found: ${subResource}` });
|
|
2071
|
+
return;
|
|
2072
|
+
}
|
|
2073
|
+
const rawBody = readFileSync(assetPath);
|
|
2074
|
+
const body =
|
|
2075
|
+
hostExternalSpecifiers.length > 0 &&
|
|
2076
|
+
contentTypeForSmokeViewAsset(assetPath).startsWith("application/javascript")
|
|
2077
|
+
? Buffer.from(
|
|
2078
|
+
rewriteHostExternalImports(
|
|
2079
|
+
rawBody.toString("utf8"),
|
|
2080
|
+
hostExternalSpecifiers,
|
|
2081
|
+
),
|
|
2082
|
+
"utf8",
|
|
2083
|
+
)
|
|
2084
|
+
: rawBody;
|
|
2085
|
+
sendBinary(req, res, 200, contentTypeForSmokeViewAsset(assetPath), body);
|
|
2086
|
+
}
|
|
2087
|
+
|
|
881
2088
|
function sendSseHeaders(req, res) {
|
|
882
2089
|
applyCors(req, res);
|
|
883
2090
|
res.writeHead(200, {
|
|
@@ -903,6 +2110,17 @@ async function readJsonBody(req) {
|
|
|
903
2110
|
return JSON.parse(Buffer.concat(chunks).toString("utf8"));
|
|
904
2111
|
}
|
|
905
2112
|
|
|
2113
|
+
// Consume and discard a request body (binary or irrelevant) so the socket
|
|
2114
|
+
// drains cleanly before the response is sent.
|
|
2115
|
+
async function drainRequest(req) {
|
|
2116
|
+
await new Promise((resolve) => {
|
|
2117
|
+
req.on("data", () => {});
|
|
2118
|
+
req.on("end", resolve);
|
|
2119
|
+
req.on("error", resolve);
|
|
2120
|
+
req.resume();
|
|
2121
|
+
});
|
|
2122
|
+
}
|
|
2123
|
+
|
|
906
2124
|
function workbenchOverview() {
|
|
907
2125
|
return {
|
|
908
2126
|
tasks: [],
|
|
@@ -923,140 +2141,1606 @@ function workbenchOverview() {
|
|
|
923
2141
|
};
|
|
924
2142
|
}
|
|
925
2143
|
|
|
926
|
-
|
|
2144
|
+
const emptyOrchestratorUsage = {
|
|
2145
|
+
inputTokens: 0,
|
|
2146
|
+
outputTokens: 0,
|
|
2147
|
+
reasoningTokens: 0,
|
|
2148
|
+
cacheTokens: 0,
|
|
2149
|
+
totalTokens: 0,
|
|
2150
|
+
costUsd: 0,
|
|
2151
|
+
state: "unavailable",
|
|
2152
|
+
byProvider: [],
|
|
2153
|
+
};
|
|
2154
|
+
|
|
2155
|
+
function emptyOrchestratorStatus() {
|
|
927
2156
|
return {
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
2157
|
+
taskCount: 0,
|
|
2158
|
+
activeTaskCount: 0,
|
|
2159
|
+
pausedTaskCount: 0,
|
|
2160
|
+
blockedTaskCount: 0,
|
|
2161
|
+
validatingTaskCount: 0,
|
|
2162
|
+
sessionCount: 0,
|
|
2163
|
+
activeSessionCount: 0,
|
|
2164
|
+
usage: emptyOrchestratorUsage,
|
|
2165
|
+
byStatus: {
|
|
2166
|
+
open: 0,
|
|
2167
|
+
active: 0,
|
|
2168
|
+
waiting_on_user: 0,
|
|
2169
|
+
blocked: 0,
|
|
2170
|
+
validating: 0,
|
|
2171
|
+
done: 0,
|
|
2172
|
+
failed: 0,
|
|
2173
|
+
archived: 0,
|
|
2174
|
+
interrupted: 0,
|
|
933
2175
|
},
|
|
934
2176
|
};
|
|
935
2177
|
}
|
|
936
2178
|
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
2179
|
+
function emptyTrajectoryList(url) {
|
|
2180
|
+
return {
|
|
2181
|
+
trajectories: [],
|
|
2182
|
+
total: 0,
|
|
2183
|
+
offset: Number(url.searchParams.get("offset") ?? 0),
|
|
2184
|
+
limit: Number(url.searchParams.get("limit") ?? 50),
|
|
2185
|
+
};
|
|
2186
|
+
}
|
|
943
2187
|
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
2188
|
+
function orchestratorUsage(overrides = {}) {
|
|
2189
|
+
const createdAt = overrides.createdAt ?? new Date().toISOString();
|
|
2190
|
+
return {
|
|
2191
|
+
inputTokens: 0,
|
|
2192
|
+
outputTokens: 0,
|
|
2193
|
+
reasoningTokens: 0,
|
|
2194
|
+
cacheTokens: 0,
|
|
2195
|
+
totalTokens: 0,
|
|
2196
|
+
costUsd: 0,
|
|
2197
|
+
state: "unavailable",
|
|
2198
|
+
usageState: "unavailable",
|
|
2199
|
+
byProvider: [],
|
|
2200
|
+
metadata: {},
|
|
2201
|
+
createdAt,
|
|
2202
|
+
updatedAt: overrides.updatedAt ?? createdAt,
|
|
2203
|
+
...overrides,
|
|
2204
|
+
};
|
|
2205
|
+
}
|
|
2206
|
+
|
|
2207
|
+
function createDemoOrchestratorState() {
|
|
2208
|
+
const startedAtMs = Date.now();
|
|
2209
|
+
const startedAt = new Date(startedAtMs).toISOString();
|
|
2210
|
+
const richUsage = orchestratorUsage({
|
|
2211
|
+
inputTokens: 8400,
|
|
2212
|
+
outputTokens: 2600,
|
|
2213
|
+
reasoningTokens: 1345,
|
|
2214
|
+
totalTokens: 12_345,
|
|
2215
|
+
costUsd: 0.42,
|
|
2216
|
+
state: "measured",
|
|
2217
|
+
usageState: "measured",
|
|
2218
|
+
byProvider: [
|
|
2219
|
+
{
|
|
2220
|
+
provider: "cerebras",
|
|
2221
|
+
model: "gpt-oss-120b",
|
|
2222
|
+
inputTokens: 8400,
|
|
2223
|
+
outputTokens: 2600,
|
|
2224
|
+
reasoningTokens: 1345,
|
|
2225
|
+
cacheTokens: 0,
|
|
2226
|
+
totalTokens: 12_345,
|
|
2227
|
+
costUsd: 0.42,
|
|
2228
|
+
state: "measured",
|
|
2229
|
+
},
|
|
2230
|
+
{
|
|
2231
|
+
provider: "codex",
|
|
2232
|
+
model: "codex-cli",
|
|
2233
|
+
inputTokens: 1200,
|
|
2234
|
+
outputTokens: 900,
|
|
2235
|
+
reasoningTokens: 0,
|
|
2236
|
+
cacheTokens: 0,
|
|
2237
|
+
totalTokens: 2100,
|
|
2238
|
+
costUsd: 0,
|
|
2239
|
+
state: "estimated",
|
|
2240
|
+
},
|
|
2241
|
+
],
|
|
2242
|
+
createdAt: startedAt,
|
|
2243
|
+
updatedAt: startedAt,
|
|
2244
|
+
});
|
|
2245
|
+
const detail = createDemoTaskDetail({
|
|
2246
|
+
id: "smoke-task-1",
|
|
2247
|
+
title: "Build Kanban planner app",
|
|
2248
|
+
status: "active",
|
|
2249
|
+
priority: "urgent",
|
|
2250
|
+
goal: "Build and verify a tiny Kanban planner app with accessible columns, cards, and persistence.",
|
|
2251
|
+
originalRequest:
|
|
2252
|
+
"Use Codex plus Cerebras gpt-oss-120b to build a planner app.",
|
|
2253
|
+
summary: "Codex has generated files; Cerebras is reviewing UX.",
|
|
2254
|
+
sessionCount: 2,
|
|
2255
|
+
activeSessionCount: 2,
|
|
2256
|
+
latestSessionId: "session-codex",
|
|
2257
|
+
latestSessionLabel: "Codex Builder",
|
|
2258
|
+
latestWorkdir: "/tmp/orchestrator-kanban",
|
|
2259
|
+
latestRepo: "/home/nubs/Git/iqlabs/eliza-labs/eliza",
|
|
2260
|
+
latestActivityAt: startedAtMs,
|
|
2261
|
+
createdAt: startedAt,
|
|
2262
|
+
updatedAt: startedAt,
|
|
2263
|
+
acceptanceCriteria: [
|
|
2264
|
+
"Planner renders three workflow columns",
|
|
2265
|
+
"Cards can be created and moved",
|
|
2266
|
+
"Generated files pass syntax checks",
|
|
2267
|
+
],
|
|
2268
|
+
currentPlan: {
|
|
2269
|
+
summary: "Build, review, and verify the Kanban planner.",
|
|
2270
|
+
steps: [
|
|
2271
|
+
{ title: "Generate app shell", status: "completed" },
|
|
2272
|
+
{ title: "Review visual affordances", status: "in_progress" },
|
|
2273
|
+
{ title: "Run browser smoke checks", status: "pending" },
|
|
2274
|
+
],
|
|
2275
|
+
},
|
|
2276
|
+
planRevisions: [
|
|
2277
|
+
{
|
|
2278
|
+
id: "plan-rev-1",
|
|
2279
|
+
threadId: "smoke-task-1",
|
|
2280
|
+
plan: {
|
|
2281
|
+
summary: "Build, review, and verify the Kanban planner.",
|
|
2282
|
+
steps: [
|
|
2283
|
+
{ title: "Generate app shell", status: "completed" },
|
|
2284
|
+
{ title: "Review visual affordances", status: "in_progress" },
|
|
2285
|
+
{ title: "Run browser smoke checks", status: "pending" },
|
|
2286
|
+
],
|
|
2287
|
+
},
|
|
2288
|
+
basePlanRevisionId: null,
|
|
2289
|
+
editSummary: null,
|
|
2290
|
+
createdBy: "system",
|
|
2291
|
+
metadata: {},
|
|
2292
|
+
timestamp: startedAtMs,
|
|
2293
|
+
createdAt: startedAt,
|
|
2294
|
+
},
|
|
2295
|
+
],
|
|
2296
|
+
providerPolicy: {
|
|
2297
|
+
preferredFramework: "codex",
|
|
2298
|
+
providerSource: "cerebras",
|
|
2299
|
+
model: "gpt-oss-120b",
|
|
2300
|
+
},
|
|
2301
|
+
sessions: [
|
|
2302
|
+
{
|
|
2303
|
+
id: "session-codex-record",
|
|
2304
|
+
threadId: "smoke-task-1",
|
|
2305
|
+
sessionId: "session-codex",
|
|
2306
|
+
label: "Codex Builder",
|
|
2307
|
+
status: "running",
|
|
2308
|
+
framework: "codex",
|
|
2309
|
+
providerSource: "local-auth",
|
|
2310
|
+
model: "codex-cli",
|
|
2311
|
+
originalTask:
|
|
2312
|
+
"Generate the planner shell and persist card movement locally.",
|
|
2313
|
+
workdir: "/tmp/orchestrator-kanban",
|
|
2314
|
+
repo: "/home/nubs/Git/iqlabs/eliza-labs/eliza",
|
|
2315
|
+
activeTool: "write",
|
|
2316
|
+
decisionCount: 0,
|
|
2317
|
+
autoResolvedCount: 0,
|
|
2318
|
+
registeredAt: startedAtMs,
|
|
2319
|
+
lastActivityAt: startedAtMs,
|
|
2320
|
+
idleCheckCount: 0,
|
|
2321
|
+
taskDelivered: true,
|
|
2322
|
+
completionSummary: null,
|
|
2323
|
+
lastSeenDecisionIndex: 0,
|
|
2324
|
+
lastInputSentAt: null,
|
|
2325
|
+
stoppedAt: null,
|
|
2326
|
+
inputTokens: 1200,
|
|
2327
|
+
outputTokens: 900,
|
|
2328
|
+
reasoningTokens: 0,
|
|
2329
|
+
totalTokens: 2100,
|
|
2330
|
+
cacheTokens: 0,
|
|
2331
|
+
costUsd: 0,
|
|
2332
|
+
usageState: "estimated",
|
|
2333
|
+
metadata: {},
|
|
2334
|
+
createdAt: startedAt,
|
|
2335
|
+
updatedAt: startedAt,
|
|
2336
|
+
},
|
|
2337
|
+
{
|
|
2338
|
+
id: "session-cerebras-record",
|
|
2339
|
+
threadId: "smoke-task-1",
|
|
2340
|
+
sessionId: "session-cerebras",
|
|
2341
|
+
label: "Cerebras Reviewer",
|
|
2342
|
+
status: "running",
|
|
2343
|
+
framework: "eliza",
|
|
2344
|
+
providerSource: "cerebras",
|
|
2345
|
+
model: "gpt-oss-120b",
|
|
2346
|
+
originalTask:
|
|
2347
|
+
"Review the planner visual affordances and interaction model.",
|
|
2348
|
+
workdir: "/tmp/orchestrator-kanban",
|
|
2349
|
+
repo: "/home/nubs/Git/iqlabs/eliza-labs/eliza",
|
|
2350
|
+
activeTool: "review",
|
|
2351
|
+
decisionCount: 0,
|
|
2352
|
+
autoResolvedCount: 0,
|
|
2353
|
+
registeredAt: startedAtMs,
|
|
2354
|
+
lastActivityAt: startedAtMs,
|
|
2355
|
+
idleCheckCount: 0,
|
|
2356
|
+
taskDelivered: true,
|
|
2357
|
+
completionSummary: null,
|
|
2358
|
+
lastSeenDecisionIndex: 0,
|
|
2359
|
+
lastInputSentAt: null,
|
|
2360
|
+
stoppedAt: null,
|
|
2361
|
+
inputTokens: 8400,
|
|
2362
|
+
outputTokens: 2600,
|
|
2363
|
+
reasoningTokens: 1345,
|
|
2364
|
+
totalTokens: 12_345,
|
|
2365
|
+
cacheTokens: 0,
|
|
2366
|
+
costUsd: 0.42,
|
|
2367
|
+
usageState: "measured",
|
|
2368
|
+
metadata: {},
|
|
2369
|
+
createdAt: startedAt,
|
|
2370
|
+
updatedAt: startedAt,
|
|
2371
|
+
},
|
|
2372
|
+
],
|
|
2373
|
+
artifacts: [
|
|
2374
|
+
{
|
|
2375
|
+
id: "artifact-index",
|
|
2376
|
+
threadId: "smoke-task-1",
|
|
2377
|
+
sessionId: "session-codex",
|
|
2378
|
+
title: "Kanban planner HTML",
|
|
2379
|
+
artifactType: "file",
|
|
2380
|
+
path: "planner/index.html",
|
|
2381
|
+
uri: null,
|
|
2382
|
+
mimeType: "text/html",
|
|
2383
|
+
verificationStatus: "passed",
|
|
2384
|
+
metadata: {},
|
|
2385
|
+
createdAt: startedAt,
|
|
2386
|
+
},
|
|
2387
|
+
{
|
|
2388
|
+
id: "artifact-test",
|
|
2389
|
+
threadId: "smoke-task-1",
|
|
2390
|
+
sessionId: "session-cerebras",
|
|
2391
|
+
title: "Browser smoke report",
|
|
2392
|
+
artifactType: "verification",
|
|
2393
|
+
path: "reports/kanban-smoke.md",
|
|
2394
|
+
uri: null,
|
|
2395
|
+
mimeType: "text/markdown",
|
|
2396
|
+
verificationStatus: "pending",
|
|
2397
|
+
metadata: {},
|
|
2398
|
+
createdAt: startedAt,
|
|
2399
|
+
},
|
|
2400
|
+
],
|
|
2401
|
+
usage: richUsage,
|
|
2402
|
+
});
|
|
2403
|
+
|
|
2404
|
+
return {
|
|
2405
|
+
tasks: [detail],
|
|
2406
|
+
messages: [
|
|
2407
|
+
{
|
|
2408
|
+
id: "message-user-1",
|
|
2409
|
+
threadId: "smoke-task-1",
|
|
2410
|
+
sessionId: null,
|
|
2411
|
+
senderKind: "user",
|
|
2412
|
+
direction: "stdout",
|
|
2413
|
+
content: "Create a compact Kanban planner app.",
|
|
2414
|
+
timestamp: startedAtMs - 4000,
|
|
2415
|
+
metadata: {},
|
|
2416
|
+
createdAt: new Date(startedAtMs - 4000).toISOString(),
|
|
2417
|
+
},
|
|
2418
|
+
{
|
|
2419
|
+
id: "message-agent-1",
|
|
2420
|
+
threadId: "smoke-task-1",
|
|
2421
|
+
sessionId: "session-codex",
|
|
2422
|
+
senderKind: "sub_agent",
|
|
2423
|
+
direction: "stdout",
|
|
2424
|
+
content: "Generated the planner shell and wired card movement.",
|
|
2425
|
+
timestamp: startedAtMs - 2000,
|
|
2426
|
+
metadata: {},
|
|
2427
|
+
createdAt: new Date(startedAtMs - 2000).toISOString(),
|
|
2428
|
+
},
|
|
2429
|
+
],
|
|
2430
|
+
events: [
|
|
2431
|
+
{
|
|
2432
|
+
id: "event-tool-write",
|
|
2433
|
+
threadId: "smoke-task-1",
|
|
2434
|
+
sessionId: "session-codex",
|
|
2435
|
+
eventType: "tool_running",
|
|
2436
|
+
summary: "write planner files",
|
|
2437
|
+
timestamp: startedAtMs - 1000,
|
|
2438
|
+
data: {
|
|
2439
|
+
toolCall: {
|
|
2440
|
+
id: "tool-write-index",
|
|
2441
|
+
title: "write",
|
|
2442
|
+
kind: "edit",
|
|
2443
|
+
status: "completed",
|
|
2444
|
+
rawInput: {
|
|
2445
|
+
path: "planner/index.html",
|
|
2446
|
+
content: '<main id="board"></main>',
|
|
2447
|
+
},
|
|
2448
|
+
output: "Wrote planner/index.html",
|
|
2449
|
+
},
|
|
2450
|
+
},
|
|
2451
|
+
createdAt: new Date(startedAtMs - 1000).toISOString(),
|
|
2452
|
+
},
|
|
2453
|
+
{
|
|
2454
|
+
id: "event-validation",
|
|
2455
|
+
threadId: "smoke-task-1",
|
|
2456
|
+
sessionId: "session-cerebras",
|
|
2457
|
+
eventType: "task_registered",
|
|
2458
|
+
summary: "Cerebras reviewer joined for UX validation",
|
|
2459
|
+
timestamp: startedAtMs - 500,
|
|
2460
|
+
data: {},
|
|
2461
|
+
createdAt: new Date(startedAtMs - 500).toISOString(),
|
|
2462
|
+
},
|
|
2463
|
+
],
|
|
2464
|
+
nextTaskId: 2,
|
|
2465
|
+
nextMessageId: 2,
|
|
2466
|
+
nextEventId: 2,
|
|
2467
|
+
nextSessionId: 3,
|
|
2468
|
+
};
|
|
2469
|
+
}
|
|
2470
|
+
|
|
2471
|
+
function createDemoTaskDetail(overrides = {}) {
|
|
2472
|
+
const id = overrides.id ?? "smoke-task-1";
|
|
2473
|
+
const createdAt = overrides.createdAt ?? new Date().toISOString();
|
|
2474
|
+
return {
|
|
2475
|
+
id,
|
|
2476
|
+
title: "Audit orchestrator surface",
|
|
2477
|
+
kind: "coding",
|
|
2478
|
+
status: "open",
|
|
2479
|
+
priority: "high",
|
|
2480
|
+
paused: false,
|
|
2481
|
+
originalRequest: "Audit orchestrator surface",
|
|
2482
|
+
summary: "Created by ui-smoke demo mode.",
|
|
2483
|
+
sessionCount: 0,
|
|
2484
|
+
activeSessionCount: 0,
|
|
2485
|
+
latestSessionId: null,
|
|
2486
|
+
latestSessionLabel: null,
|
|
2487
|
+
latestWorkdir: null,
|
|
2488
|
+
latestRepo: null,
|
|
2489
|
+
latestActivityAt: null,
|
|
2490
|
+
decisionCount: 0,
|
|
2491
|
+
usage: orchestratorUsage(),
|
|
2492
|
+
createdAt,
|
|
2493
|
+
updatedAt: overrides.updatedAt ?? createdAt,
|
|
2494
|
+
closedAt: null,
|
|
2495
|
+
archivedAt: null,
|
|
2496
|
+
goal: "Verify controls, routing, and message flow.",
|
|
2497
|
+
roomId: null,
|
|
2498
|
+
taskRoomId: null,
|
|
2499
|
+
worldId: null,
|
|
2500
|
+
ownerUserId: null,
|
|
2501
|
+
parentTaskId: null,
|
|
2502
|
+
acceptanceCriteria: ["Task appears in rail", "Message posts"],
|
|
2503
|
+
currentPlan: null,
|
|
2504
|
+
providerPolicy: null,
|
|
2505
|
+
lastUserTurnAt: null,
|
|
2506
|
+
lastCoordinatorTurnAt: null,
|
|
2507
|
+
metadata: {},
|
|
2508
|
+
sessions: [],
|
|
2509
|
+
decisions: [],
|
|
2510
|
+
events: [],
|
|
2511
|
+
artifacts: [],
|
|
2512
|
+
messages: [],
|
|
2513
|
+
transcripts: [],
|
|
2514
|
+
planRevisions: [],
|
|
2515
|
+
...overrides,
|
|
2516
|
+
};
|
|
2517
|
+
}
|
|
2518
|
+
|
|
2519
|
+
function summarizeDemoTask(detail) {
|
|
2520
|
+
return {
|
|
2521
|
+
id: detail.id,
|
|
2522
|
+
title: detail.title,
|
|
2523
|
+
kind: detail.kind,
|
|
2524
|
+
status: detail.status,
|
|
2525
|
+
priority: detail.priority,
|
|
2526
|
+
paused: detail.paused,
|
|
2527
|
+
originalRequest: detail.originalRequest,
|
|
2528
|
+
summary: detail.summary,
|
|
2529
|
+
sessionCount: detail.sessionCount,
|
|
2530
|
+
activeSessionCount: detail.activeSessionCount,
|
|
2531
|
+
latestSessionId: detail.latestSessionId,
|
|
2532
|
+
latestSessionLabel: detail.latestSessionLabel,
|
|
2533
|
+
latestWorkdir: detail.latestWorkdir,
|
|
2534
|
+
latestRepo: detail.latestRepo,
|
|
2535
|
+
latestActivityAt: detail.latestActivityAt,
|
|
2536
|
+
decisionCount: detail.decisionCount,
|
|
2537
|
+
usage: detail.usage,
|
|
2538
|
+
createdAt: detail.createdAt,
|
|
2539
|
+
updatedAt: detail.updatedAt,
|
|
2540
|
+
closedAt: detail.closedAt,
|
|
2541
|
+
archivedAt: detail.archivedAt,
|
|
2542
|
+
};
|
|
2543
|
+
}
|
|
2544
|
+
|
|
2545
|
+
function demoOrchestratorStatus(state) {
|
|
2546
|
+
const visibleTasks = state.tasks;
|
|
2547
|
+
const byStatus = {
|
|
2548
|
+
open: 0,
|
|
2549
|
+
active: 0,
|
|
2550
|
+
waiting_on_user: 0,
|
|
2551
|
+
blocked: 0,
|
|
2552
|
+
validating: 0,
|
|
2553
|
+
done: 0,
|
|
2554
|
+
failed: 0,
|
|
2555
|
+
archived: 0,
|
|
2556
|
+
interrupted: 0,
|
|
2557
|
+
};
|
|
2558
|
+
let sessionCount = 0;
|
|
2559
|
+
let activeSessionCount = 0;
|
|
2560
|
+
for (const task of visibleTasks) {
|
|
2561
|
+
if (byStatus[task.status] !== undefined) byStatus[task.status] += 1;
|
|
2562
|
+
sessionCount += Number(task.sessionCount ?? 0);
|
|
2563
|
+
activeSessionCount += Number(task.activeSessionCount ?? 0);
|
|
2564
|
+
}
|
|
2565
|
+
return {
|
|
2566
|
+
taskCount: visibleTasks.length,
|
|
2567
|
+
activeTaskCount: byStatus.active,
|
|
2568
|
+
pausedTaskCount: visibleTasks.filter((task) => task.paused === true).length,
|
|
2569
|
+
blockedTaskCount: byStatus.blocked + byStatus.waiting_on_user,
|
|
2570
|
+
validatingTaskCount: byStatus.validating,
|
|
2571
|
+
sessionCount,
|
|
2572
|
+
activeSessionCount,
|
|
2573
|
+
usage: visibleTasks[0]?.usage ?? emptyOrchestratorUsage,
|
|
2574
|
+
byStatus,
|
|
2575
|
+
};
|
|
2576
|
+
}
|
|
2577
|
+
|
|
2578
|
+
function demoTaskList(state, url) {
|
|
2579
|
+
const status = url.searchParams.get("status");
|
|
2580
|
+
const includeArchived = url.searchParams.get("includeArchived") === "true";
|
|
2581
|
+
const search = (url.searchParams.get("search") ?? "").toLowerCase();
|
|
2582
|
+
const limit = Math.max(1, Number(url.searchParams.get("limit") ?? 50));
|
|
2583
|
+
return state.tasks
|
|
2584
|
+
.filter((task) => includeArchived || task.status !== "archived")
|
|
2585
|
+
.filter((task) => !status || task.status === status)
|
|
2586
|
+
.filter((task) => {
|
|
2587
|
+
if (!search) return true;
|
|
2588
|
+
return [task.title, task.goal, task.summary, task.originalRequest]
|
|
2589
|
+
.join(" ")
|
|
2590
|
+
.toLowerCase()
|
|
2591
|
+
.includes(search);
|
|
2592
|
+
})
|
|
2593
|
+
.slice(0, limit)
|
|
2594
|
+
.map(summarizeDemoTask);
|
|
2595
|
+
}
|
|
2596
|
+
|
|
2597
|
+
function demoTimelinePage(state, taskId, url) {
|
|
2598
|
+
const limit =
|
|
2599
|
+
Math.max(1, Number.parseInt(url.searchParams.get("limit") ?? "100", 10)) ||
|
|
2600
|
+
100;
|
|
2601
|
+
const start =
|
|
2602
|
+
Math.max(0, Number.parseInt(url.searchParams.get("cursor") ?? "0", 10)) ||
|
|
2603
|
+
0;
|
|
2604
|
+
const items = [
|
|
2605
|
+
...state.messages
|
|
2606
|
+
.filter((message) => message.threadId === taskId)
|
|
2607
|
+
.map((message) => ({
|
|
2608
|
+
id: `message:${message.id}`,
|
|
2609
|
+
kind: "message",
|
|
2610
|
+
threadId: message.threadId,
|
|
2611
|
+
sessionId: message.sessionId ?? null,
|
|
2612
|
+
timestamp: message.timestamp,
|
|
2613
|
+
createdAt: message.createdAt,
|
|
2614
|
+
message,
|
|
2615
|
+
})),
|
|
2616
|
+
...state.events
|
|
2617
|
+
.filter((event) => event.threadId === taskId)
|
|
2618
|
+
.map((event) => ({
|
|
2619
|
+
id: `event:${event.id}`,
|
|
2620
|
+
kind: "event",
|
|
2621
|
+
threadId: event.threadId,
|
|
2622
|
+
sessionId: event.sessionId ?? null,
|
|
2623
|
+
timestamp: event.timestamp,
|
|
2624
|
+
createdAt: event.createdAt,
|
|
2625
|
+
event,
|
|
2626
|
+
})),
|
|
2627
|
+
].sort((a, b) => Number(b.timestamp) - Number(a.timestamp));
|
|
2628
|
+
const page = items.slice(start, start + limit);
|
|
2629
|
+
const next = start + limit;
|
|
2630
|
+
return {
|
|
2631
|
+
items: page,
|
|
2632
|
+
nextCursor: next < items.length ? String(next) : null,
|
|
2633
|
+
};
|
|
2634
|
+
}
|
|
2635
|
+
|
|
2636
|
+
function pushDemoEvent(state, taskId, summary, data = {}) {
|
|
2637
|
+
const event = {
|
|
2638
|
+
id: `demo-event-${state.nextEventId++}`,
|
|
2639
|
+
threadId: taskId,
|
|
2640
|
+
sessionId: null,
|
|
2641
|
+
eventType: "operator_action",
|
|
2642
|
+
summary,
|
|
2643
|
+
timestamp: Date.now(),
|
|
2644
|
+
data,
|
|
2645
|
+
createdAt: new Date().toISOString(),
|
|
2646
|
+
};
|
|
2647
|
+
state.events.push(event);
|
|
2648
|
+
return event;
|
|
2649
|
+
}
|
|
2650
|
+
|
|
2651
|
+
function pushDemoMessage(state, taskId, senderKind, content, sessionId = null) {
|
|
2652
|
+
const message = {
|
|
2653
|
+
id: `demo-message-${state.nextMessageId++}`,
|
|
2654
|
+
threadId: taskId,
|
|
2655
|
+
sessionId,
|
|
2656
|
+
senderKind,
|
|
2657
|
+
direction: "stdout",
|
|
2658
|
+
content,
|
|
2659
|
+
timestamp: Date.now(),
|
|
2660
|
+
metadata: {},
|
|
2661
|
+
createdAt: new Date().toISOString(),
|
|
2662
|
+
};
|
|
2663
|
+
state.messages.push(message);
|
|
2664
|
+
return message;
|
|
2665
|
+
}
|
|
2666
|
+
|
|
2667
|
+
const demoOrchestratorState = DEMO_ORCHESTRATOR
|
|
2668
|
+
? createDemoOrchestratorState()
|
|
2669
|
+
: null;
|
|
2670
|
+
|
|
2671
|
+
async function handleDemoOrchestratorRoute(req, res, url) {
|
|
2672
|
+
if (!demoOrchestratorState) return false;
|
|
2673
|
+
if (!url.pathname.startsWith("/api/orchestrator")) return false;
|
|
2674
|
+
|
|
2675
|
+
if (req.method === "GET" && url.pathname === "/api/orchestrator/status") {
|
|
2676
|
+
sendJson(req, res, 200, demoOrchestratorStatus(demoOrchestratorState));
|
|
2677
|
+
return true;
|
|
2678
|
+
}
|
|
2679
|
+
|
|
2680
|
+
if (req.method === "GET" && url.pathname === "/api/orchestrator/tasks") {
|
|
2681
|
+
sendJson(req, res, 200, {
|
|
2682
|
+
tasks: demoTaskList(demoOrchestratorState, url),
|
|
2683
|
+
});
|
|
2684
|
+
return true;
|
|
2685
|
+
}
|
|
2686
|
+
|
|
2687
|
+
if (req.method === "POST" && url.pathname === "/api/orchestrator/tasks") {
|
|
2688
|
+
const body = (await readJsonBody(req)) || {};
|
|
2689
|
+
const id = `demo-task-${demoOrchestratorState.nextTaskId++}`;
|
|
2690
|
+
const detail = createDemoTaskDetail({
|
|
2691
|
+
id,
|
|
2692
|
+
title: body.title || "Demo orchestrator task",
|
|
2693
|
+
goal: body.goal || body.originalRequest || body.title || "Demo task",
|
|
2694
|
+
originalRequest:
|
|
2695
|
+
body.originalRequest || body.goal || body.title || "Demo task",
|
|
2696
|
+
priority: body.priority || "normal",
|
|
2697
|
+
acceptanceCriteria: Array.isArray(body.acceptanceCriteria)
|
|
2698
|
+
? body.acceptanceCriteria
|
|
2699
|
+
: ["Created from the visible local UI"],
|
|
2700
|
+
providerPolicy: body.providerPolicy ?? null,
|
|
2701
|
+
status: "open",
|
|
2702
|
+
summary: "Created locally in demo mode.",
|
|
2703
|
+
currentPlan: {
|
|
2704
|
+
summary: "Demo task created from the local UI.",
|
|
2705
|
+
steps: [
|
|
2706
|
+
{ title: "Capture request", status: "completed" },
|
|
2707
|
+
{ title: "Assign sub-agent", status: "pending" },
|
|
2708
|
+
{ title: "Verify result", status: "pending" },
|
|
2709
|
+
],
|
|
2710
|
+
},
|
|
2711
|
+
});
|
|
2712
|
+
demoOrchestratorState.tasks.unshift(detail);
|
|
2713
|
+
pushDemoMessage(
|
|
2714
|
+
demoOrchestratorState,
|
|
2715
|
+
id,
|
|
2716
|
+
"user",
|
|
2717
|
+
detail.originalRequest || detail.goal,
|
|
2718
|
+
);
|
|
2719
|
+
pushDemoEvent(demoOrchestratorState, id, "Task created from local demo UI");
|
|
2720
|
+
sendJson(req, res, 200, detail);
|
|
2721
|
+
return true;
|
|
2722
|
+
}
|
|
2723
|
+
|
|
2724
|
+
if (req.method === "POST" && url.pathname === "/api/orchestrator/pause-all") {
|
|
2725
|
+
for (const task of demoOrchestratorState.tasks) task.paused = true;
|
|
2726
|
+
sendJson(req, res, 200, { paused: demoOrchestratorState.tasks.length });
|
|
2727
|
+
return true;
|
|
2728
|
+
}
|
|
2729
|
+
|
|
2730
|
+
if (
|
|
2731
|
+
req.method === "POST" &&
|
|
2732
|
+
url.pathname === "/api/orchestrator/resume-all"
|
|
2733
|
+
) {
|
|
2734
|
+
for (const task of demoOrchestratorState.tasks) task.paused = false;
|
|
2735
|
+
sendJson(req, res, 200, { resumed: demoOrchestratorState.tasks.length });
|
|
2736
|
+
return true;
|
|
2737
|
+
}
|
|
2738
|
+
|
|
2739
|
+
const taskPath = url.pathname.slice("/api/orchestrator/tasks/".length);
|
|
2740
|
+
if (!taskPath || taskPath === url.pathname) return false;
|
|
2741
|
+
const parts = taskPath.split("/").map((part) => decodeURIComponent(part));
|
|
2742
|
+
const [taskId, action, subId, subAction] = parts;
|
|
2743
|
+
const task = demoOrchestratorState.tasks.find((item) => item.id === taskId);
|
|
2744
|
+
|
|
2745
|
+
if (action === "stream" && req.method === "GET") {
|
|
2746
|
+
sendSseHeaders(req, res);
|
|
2747
|
+
writeSseEvent(res, { type: "ready" });
|
|
2748
|
+
const interval = setInterval(() => {
|
|
2749
|
+
res.write(": heartbeat\n\n");
|
|
2750
|
+
}, 15_000);
|
|
2751
|
+
req.on("close", () => clearInterval(interval));
|
|
2752
|
+
return true;
|
|
2753
|
+
}
|
|
2754
|
+
|
|
2755
|
+
if (!task) {
|
|
2756
|
+
sendJson(req, res, 404, { error: `Task not found: ${taskId}` });
|
|
2757
|
+
return true;
|
|
2758
|
+
}
|
|
2759
|
+
|
|
2760
|
+
if (!action) {
|
|
2761
|
+
if (req.method === "GET") {
|
|
2762
|
+
sendJson(req, res, 200, task);
|
|
2763
|
+
return true;
|
|
2764
|
+
}
|
|
2765
|
+
if (req.method === "PATCH") {
|
|
2766
|
+
const body = (await readJsonBody(req)) || {};
|
|
2767
|
+
Object.assign(task, body, { updatedAt: new Date().toISOString() });
|
|
2768
|
+
sendJson(req, res, 200, task);
|
|
2769
|
+
return true;
|
|
2770
|
+
}
|
|
2771
|
+
if (req.method === "DELETE") {
|
|
2772
|
+
demoOrchestratorState.tasks = demoOrchestratorState.tasks.filter(
|
|
2773
|
+
(item) => item.id !== taskId,
|
|
2774
|
+
);
|
|
2775
|
+
demoOrchestratorState.messages = demoOrchestratorState.messages.filter(
|
|
2776
|
+
(item) => item.threadId !== taskId,
|
|
2777
|
+
);
|
|
2778
|
+
demoOrchestratorState.events = demoOrchestratorState.events.filter(
|
|
2779
|
+
(item) => item.threadId !== taskId,
|
|
2780
|
+
);
|
|
2781
|
+
sendJson(req, res, 200, { deleted: true });
|
|
2782
|
+
return true;
|
|
2783
|
+
}
|
|
2784
|
+
}
|
|
2785
|
+
|
|
2786
|
+
if (action === "messages") {
|
|
2787
|
+
if (req.method === "GET") {
|
|
2788
|
+
sendJson(req, res, 200, {
|
|
2789
|
+
items: demoOrchestratorState.messages.filter(
|
|
2790
|
+
(item) => item.threadId === taskId,
|
|
2791
|
+
),
|
|
2792
|
+
nextCursor: null,
|
|
2793
|
+
});
|
|
2794
|
+
return true;
|
|
2795
|
+
}
|
|
2796
|
+
if (req.method === "POST") {
|
|
2797
|
+
const body = (await readJsonBody(req)) || {};
|
|
2798
|
+
const content = String(body.content ?? "").trim();
|
|
2799
|
+
if (content) {
|
|
2800
|
+
pushDemoMessage(demoOrchestratorState, taskId, "user", content);
|
|
2801
|
+
pushDemoMessage(
|
|
2802
|
+
demoOrchestratorState,
|
|
2803
|
+
taskId,
|
|
2804
|
+
"orchestrator",
|
|
2805
|
+
`Demo orchestrator received: ${content}`,
|
|
2806
|
+
);
|
|
2807
|
+
pushDemoEvent(demoOrchestratorState, taskId, "Message forwarded");
|
|
2808
|
+
task.summary = "New demo message received from the local UI.";
|
|
2809
|
+
task.updatedAt = new Date().toISOString();
|
|
2810
|
+
}
|
|
2811
|
+
sendJson(req, res, 200, { recorded: true, forwardedTo: [] });
|
|
2812
|
+
return true;
|
|
2813
|
+
}
|
|
2814
|
+
}
|
|
2815
|
+
|
|
2816
|
+
if (action === "events" && req.method === "GET") {
|
|
2817
|
+
sendJson(req, res, 200, {
|
|
2818
|
+
items: demoOrchestratorState.events.filter(
|
|
2819
|
+
(item) => item.threadId === taskId,
|
|
2820
|
+
),
|
|
2821
|
+
nextCursor: null,
|
|
2822
|
+
});
|
|
2823
|
+
return true;
|
|
2824
|
+
}
|
|
2825
|
+
|
|
2826
|
+
if (action === "timeline" && req.method === "GET") {
|
|
2827
|
+
sendJson(
|
|
2828
|
+
req,
|
|
2829
|
+
res,
|
|
2830
|
+
200,
|
|
2831
|
+
demoTimelinePage(demoOrchestratorState, taskId, url),
|
|
2832
|
+
);
|
|
2833
|
+
return true;
|
|
2834
|
+
}
|
|
2835
|
+
|
|
2836
|
+
if (action === "usage" && req.method === "GET") {
|
|
2837
|
+
sendJson(req, res, 200, task.usage ?? emptyOrchestratorUsage);
|
|
2838
|
+
return true;
|
|
2839
|
+
}
|
|
2840
|
+
|
|
2841
|
+
if (action === "plan-revisions") {
|
|
2842
|
+
if (req.method === "GET") {
|
|
2843
|
+
sendJson(req, res, 200, {
|
|
2844
|
+
items: task.planRevisions ?? [],
|
|
2845
|
+
nextCursor: null,
|
|
2846
|
+
});
|
|
2847
|
+
return true;
|
|
2848
|
+
}
|
|
2849
|
+
if (req.method === "POST") {
|
|
2850
|
+
const body = (await readJsonBody(req)) || {};
|
|
2851
|
+
const revision = {
|
|
2852
|
+
id: `plan-rev-${(task.planRevisions?.length ?? 0) + 1}`,
|
|
2853
|
+
threadId: taskId,
|
|
2854
|
+
plan: body.plan ?? task.currentPlan ?? {},
|
|
2855
|
+
basePlanRevisionId: body.basePlanRevisionId ?? null,
|
|
2856
|
+
editSummary: body.editSummary ?? "Edited in local demo mode",
|
|
2857
|
+
createdBy: body.createdBy ?? "operator",
|
|
2858
|
+
metadata: body.metadata ?? {},
|
|
2859
|
+
timestamp: Date.now(),
|
|
2860
|
+
createdAt: new Date().toISOString(),
|
|
2861
|
+
};
|
|
2862
|
+
task.planRevisions = [revision, ...(task.planRevisions ?? [])];
|
|
2863
|
+
task.currentPlan = revision.plan;
|
|
2864
|
+
sendJson(req, res, 200, revision);
|
|
2865
|
+
return true;
|
|
2866
|
+
}
|
|
2867
|
+
}
|
|
2868
|
+
|
|
2869
|
+
if (action === "agents" && req.method === "POST" && !subId) {
|
|
2870
|
+
const body = (await readJsonBody(req)) || {};
|
|
2871
|
+
const sessionId = `demo-session-${demoOrchestratorState.nextSessionId++}`;
|
|
2872
|
+
const session = {
|
|
2873
|
+
id: `${sessionId}-record`,
|
|
2874
|
+
threadId: taskId,
|
|
2875
|
+
sessionId,
|
|
2876
|
+
label: body.label || "Demo sub-agent",
|
|
2877
|
+
status: "running",
|
|
2878
|
+
framework: body.framework || "codex",
|
|
2879
|
+
providerSource: body.providerSource || "local-demo",
|
|
2880
|
+
model: body.model || "gpt-5.4",
|
|
2881
|
+
originalTask: body.task || "Assist with the demo task.",
|
|
2882
|
+
workdir: body.workdir || task.latestWorkdir || "/tmp/orchestrator-demo",
|
|
2883
|
+
repo: body.repo || task.latestRepo || null,
|
|
2884
|
+
activeTool: "thinking",
|
|
2885
|
+
decisionCount: 0,
|
|
2886
|
+
autoResolvedCount: 0,
|
|
2887
|
+
registeredAt: Date.now(),
|
|
2888
|
+
lastActivityAt: Date.now(),
|
|
2889
|
+
idleCheckCount: 0,
|
|
2890
|
+
taskDelivered: true,
|
|
2891
|
+
completionSummary: null,
|
|
2892
|
+
lastSeenDecisionIndex: 0,
|
|
2893
|
+
lastInputSentAt: null,
|
|
2894
|
+
stoppedAt: null,
|
|
2895
|
+
inputTokens: 0,
|
|
2896
|
+
outputTokens: 0,
|
|
2897
|
+
reasoningTokens: 0,
|
|
2898
|
+
totalTokens: 0,
|
|
2899
|
+
cacheTokens: 0,
|
|
2900
|
+
costUsd: 0,
|
|
2901
|
+
usageState: "estimated",
|
|
2902
|
+
metadata: {},
|
|
2903
|
+
createdAt: new Date().toISOString(),
|
|
2904
|
+
updatedAt: new Date().toISOString(),
|
|
2905
|
+
};
|
|
2906
|
+
task.sessions = [...(task.sessions ?? []), session];
|
|
2907
|
+
task.sessionCount = task.sessions.length;
|
|
2908
|
+
task.activeSessionCount = task.sessions.filter(
|
|
2909
|
+
(item) => item.status === "running",
|
|
2910
|
+
).length;
|
|
2911
|
+
task.latestSessionId = session.sessionId;
|
|
2912
|
+
task.latestSessionLabel = session.label;
|
|
2913
|
+
task.latestActivityAt = session.lastActivityAt;
|
|
2914
|
+
pushDemoEvent(demoOrchestratorState, taskId, `Added ${session.label}`);
|
|
2915
|
+
sendJson(req, res, 200, task);
|
|
2916
|
+
return true;
|
|
2917
|
+
}
|
|
2918
|
+
|
|
2919
|
+
if (
|
|
2920
|
+
action === "agents" &&
|
|
2921
|
+
subId &&
|
|
2922
|
+
subAction === "stop" &&
|
|
2923
|
+
req.method === "POST"
|
|
2924
|
+
) {
|
|
2925
|
+
task.sessions = (task.sessions ?? []).map((session) =>
|
|
2926
|
+
session.sessionId === subId
|
|
2927
|
+
? {
|
|
2928
|
+
...session,
|
|
2929
|
+
status: "stopped",
|
|
2930
|
+
stoppedAt: Date.now(),
|
|
2931
|
+
activeTool: null,
|
|
2932
|
+
updatedAt: new Date().toISOString(),
|
|
2933
|
+
}
|
|
2934
|
+
: session,
|
|
2935
|
+
);
|
|
2936
|
+
task.activeSessionCount = task.sessions.filter(
|
|
2937
|
+
(item) => item.status === "running",
|
|
2938
|
+
).length;
|
|
2939
|
+
pushDemoEvent(demoOrchestratorState, taskId, `Stopped agent ${subId}`);
|
|
2940
|
+
sendJson(req, res, 200, { stopped: true });
|
|
2941
|
+
return true;
|
|
2942
|
+
}
|
|
2943
|
+
|
|
2944
|
+
if (req.method === "POST") {
|
|
2945
|
+
const body = (await readJsonBody(req)) || {};
|
|
2946
|
+
if (action === "pause") {
|
|
2947
|
+
task.paused = true;
|
|
2948
|
+
pushDemoEvent(demoOrchestratorState, taskId, "Task paused");
|
|
2949
|
+
sendJson(req, res, 200, task);
|
|
2950
|
+
return true;
|
|
2951
|
+
}
|
|
2952
|
+
if (action === "resume") {
|
|
2953
|
+
task.paused = false;
|
|
2954
|
+
pushDemoEvent(demoOrchestratorState, taskId, "Task resumed");
|
|
2955
|
+
sendJson(req, res, 200, task);
|
|
2956
|
+
return true;
|
|
2957
|
+
}
|
|
2958
|
+
if (action === "archive") {
|
|
2959
|
+
task.status = "archived";
|
|
2960
|
+
task.archivedAt = new Date().toISOString();
|
|
2961
|
+
pushDemoEvent(demoOrchestratorState, taskId, "Task archived");
|
|
2962
|
+
sendJson(req, res, 200, { archived: true });
|
|
2963
|
+
return true;
|
|
2964
|
+
}
|
|
2965
|
+
if (action === "reopen") {
|
|
2966
|
+
task.status = "open";
|
|
2967
|
+
task.archivedAt = null;
|
|
2968
|
+
pushDemoEvent(demoOrchestratorState, taskId, "Task reopened");
|
|
2969
|
+
sendJson(req, res, 200, task);
|
|
2970
|
+
return true;
|
|
2971
|
+
}
|
|
2972
|
+
if (action === "fork") {
|
|
2973
|
+
const forked = createDemoTaskDetail({
|
|
2974
|
+
...task,
|
|
2975
|
+
id: `demo-task-${demoOrchestratorState.nextTaskId++}`,
|
|
2976
|
+
title: body.title || `Fork of ${task.title}`,
|
|
2977
|
+
goal: body.goal || task.goal,
|
|
2978
|
+
parentTaskId: task.id,
|
|
2979
|
+
status: "open",
|
|
2980
|
+
archivedAt: null,
|
|
2981
|
+
sessions: [],
|
|
2982
|
+
sessionCount: 0,
|
|
2983
|
+
activeSessionCount: 0,
|
|
2984
|
+
});
|
|
2985
|
+
demoOrchestratorState.tasks.unshift(forked);
|
|
2986
|
+
pushDemoEvent(demoOrchestratorState, forked.id, "Task forked");
|
|
2987
|
+
sendJson(req, res, 200, forked);
|
|
2988
|
+
return true;
|
|
2989
|
+
}
|
|
2990
|
+
if (action === "validate") {
|
|
2991
|
+
task.status = body.passed === true ? "done" : "blocked";
|
|
2992
|
+
task.summary = body.summary || task.summary;
|
|
2993
|
+
pushDemoEvent(
|
|
2994
|
+
demoOrchestratorState,
|
|
2995
|
+
taskId,
|
|
2996
|
+
"Validation submitted",
|
|
2997
|
+
body,
|
|
2998
|
+
);
|
|
2999
|
+
sendJson(req, res, 200, task);
|
|
3000
|
+
return true;
|
|
3001
|
+
}
|
|
3002
|
+
if (action === "retry-turn") {
|
|
3003
|
+
pushDemoEvent(
|
|
3004
|
+
demoOrchestratorState,
|
|
3005
|
+
taskId,
|
|
3006
|
+
"Retry turn requested",
|
|
3007
|
+
body,
|
|
3008
|
+
);
|
|
3009
|
+
sendJson(req, res, 200, task);
|
|
3010
|
+
return true;
|
|
3011
|
+
}
|
|
3012
|
+
if (action === "rerun-from-event") {
|
|
3013
|
+
pushDemoEvent(
|
|
3014
|
+
demoOrchestratorState,
|
|
3015
|
+
taskId,
|
|
3016
|
+
"Rerun from event requested",
|
|
3017
|
+
body,
|
|
3018
|
+
);
|
|
3019
|
+
sendJson(req, res, 200, task);
|
|
3020
|
+
return true;
|
|
3021
|
+
}
|
|
3022
|
+
if (action === "restart") {
|
|
3023
|
+
task.status = "active";
|
|
3024
|
+
pushDemoEvent(
|
|
3025
|
+
demoOrchestratorState,
|
|
3026
|
+
taskId,
|
|
3027
|
+
"Task restart requested",
|
|
3028
|
+
body,
|
|
3029
|
+
);
|
|
3030
|
+
sendJson(req, res, 200, task);
|
|
3031
|
+
return true;
|
|
3032
|
+
}
|
|
3033
|
+
if (action === "restart-with-edited-plan") {
|
|
3034
|
+
task.status = "active";
|
|
3035
|
+
if (body.plan && typeof body.plan === "object")
|
|
3036
|
+
task.currentPlan = body.plan;
|
|
3037
|
+
pushDemoEvent(
|
|
3038
|
+
demoOrchestratorState,
|
|
3039
|
+
taskId,
|
|
3040
|
+
"Restart with edited plan requested",
|
|
3041
|
+
body,
|
|
3042
|
+
);
|
|
3043
|
+
sendJson(req, res, 200, task);
|
|
3044
|
+
return true;
|
|
3045
|
+
}
|
|
3046
|
+
}
|
|
3047
|
+
|
|
3048
|
+
sendJson(req, res, 404, {
|
|
3049
|
+
error: `Unhandled demo orchestrator route ${url.pathname}`,
|
|
3050
|
+
});
|
|
3051
|
+
return true;
|
|
3052
|
+
}
|
|
3053
|
+
|
|
3054
|
+
function streamSettings(payload = {}) {
|
|
3055
|
+
return {
|
|
3056
|
+
ok: true,
|
|
3057
|
+
settings: {
|
|
3058
|
+
theme: "eliza",
|
|
3059
|
+
avatarIndex: 0,
|
|
3060
|
+
...payload,
|
|
3061
|
+
},
|
|
3062
|
+
};
|
|
3063
|
+
}
|
|
3064
|
+
|
|
3065
|
+
const databaseRowsByTable = {
|
|
3066
|
+
messages: [
|
|
3067
|
+
{
|
|
3068
|
+
id: "msg-smoke-1",
|
|
3069
|
+
content:
|
|
3070
|
+
"UI smoke database row with https://example.com/smoke-image.png media",
|
|
3071
|
+
roomId: "room-smoke",
|
|
3072
|
+
entityId: "entity-smoke",
|
|
3073
|
+
createdAt: SMOKE_GENERATED_AT,
|
|
3074
|
+
},
|
|
3075
|
+
{
|
|
3076
|
+
id: "msg-smoke-2",
|
|
3077
|
+
content: "UI smoke vector sample row",
|
|
3078
|
+
roomId: "room-smoke",
|
|
3079
|
+
entityId: "entity-smoke",
|
|
3080
|
+
createdAt: SMOKE_GENERATED_AT,
|
|
3081
|
+
},
|
|
3082
|
+
],
|
|
3083
|
+
memories: [
|
|
3084
|
+
{
|
|
3085
|
+
id: "memory-smoke-1",
|
|
3086
|
+
text: "Deterministic memory fixture for UI smoke.",
|
|
3087
|
+
roomId: "room-smoke",
|
|
3088
|
+
entityId: "entity-smoke",
|
|
3089
|
+
createdAt: SMOKE_GENERATED_AT,
|
|
3090
|
+
dim_0: 0.12,
|
|
3091
|
+
dim_1: 0.34,
|
|
3092
|
+
dim_2: 0.56,
|
|
3093
|
+
},
|
|
3094
|
+
],
|
|
3095
|
+
media: [
|
|
3096
|
+
{
|
|
3097
|
+
id: "media-smoke-1",
|
|
3098
|
+
url: "https://example.com/smoke-image.png",
|
|
3099
|
+
type: "image",
|
|
3100
|
+
filename: "smoke-image.png",
|
|
3101
|
+
createdAt: SMOKE_GENERATED_AT,
|
|
3102
|
+
},
|
|
3103
|
+
],
|
|
3104
|
+
};
|
|
3105
|
+
|
|
3106
|
+
const databaseTables = Object.entries(databaseRowsByTable).map(
|
|
3107
|
+
([name, rows]) => ({
|
|
3108
|
+
name,
|
|
3109
|
+
schema: "public",
|
|
3110
|
+
rowCount: rows.length,
|
|
3111
|
+
columns: Object.keys(rows[0] ?? {}).map((columnName) => ({
|
|
3112
|
+
name: columnName,
|
|
3113
|
+
type: columnName.startsWith("dim_") ? "double precision" : "text",
|
|
3114
|
+
nullable: false,
|
|
3115
|
+
defaultValue: null,
|
|
3116
|
+
isPrimaryKey: columnName === "id",
|
|
3117
|
+
})),
|
|
3118
|
+
}),
|
|
3119
|
+
);
|
|
3120
|
+
|
|
3121
|
+
function databaseRowsResponse(tableName, url) {
|
|
3122
|
+
const rows = databaseRowsByTable[tableName] ?? [];
|
|
3123
|
+
const offset = Number(url.searchParams.get("offset") ?? "0");
|
|
3124
|
+
const limit = Number(url.searchParams.get("limit") ?? "50");
|
|
3125
|
+
const sort = url.searchParams.get("sort");
|
|
3126
|
+
const order = url.searchParams.get("order") === "desc" ? "desc" : "asc";
|
|
3127
|
+
const sortedRows = sort
|
|
3128
|
+
? [...rows].sort((left, right) => {
|
|
3129
|
+
const leftValue = String(left[sort] ?? "");
|
|
3130
|
+
const rightValue = String(right[sort] ?? "");
|
|
3131
|
+
return order === "desc"
|
|
3132
|
+
? rightValue.localeCompare(leftValue)
|
|
3133
|
+
: leftValue.localeCompare(rightValue);
|
|
3134
|
+
})
|
|
3135
|
+
: rows;
|
|
3136
|
+
const pageRows = sortedRows.slice(offset, offset + limit);
|
|
3137
|
+
return {
|
|
3138
|
+
table: tableName,
|
|
3139
|
+
rows: pageRows,
|
|
3140
|
+
columns: Object.keys(rows[0] ?? {}),
|
|
3141
|
+
total: rows.length,
|
|
3142
|
+
offset,
|
|
3143
|
+
limit,
|
|
3144
|
+
};
|
|
3145
|
+
}
|
|
3146
|
+
|
|
3147
|
+
function executeDatabaseQueryResult(sql) {
|
|
3148
|
+
const match = /from\s+"?([a-z0-9_-]+)"?/iu.exec(sql ?? "");
|
|
3149
|
+
const tableName =
|
|
3150
|
+
match?.[1] && databaseRowsByTable[match[1]] ? match[1] : "messages";
|
|
3151
|
+
const rows = databaseRowsByTable[tableName] ?? [];
|
|
3152
|
+
return {
|
|
3153
|
+
columns: Object.keys(rows[0] ?? {}),
|
|
3154
|
+
rows,
|
|
3155
|
+
rowCount: rows.length,
|
|
3156
|
+
durationMs: 1,
|
|
3157
|
+
};
|
|
3158
|
+
}
|
|
3159
|
+
|
|
3160
|
+
const sockets = new Set();
|
|
3161
|
+
const server = http.createServer(async (req, res) => {
|
|
3162
|
+
const url = new URL(
|
|
3163
|
+
req.url ?? "/",
|
|
3164
|
+
`http://${req.headers.host ?? `127.0.0.1:${port}`}`,
|
|
3165
|
+
);
|
|
3166
|
+
|
|
3167
|
+
if (req.method === "OPTIONS") {
|
|
3168
|
+
sendEmpty(req, res, 204);
|
|
3169
|
+
return;
|
|
3170
|
+
}
|
|
3171
|
+
|
|
3172
|
+
if (
|
|
3173
|
+
(req.method === "GET" || req.method === "HEAD") &&
|
|
3174
|
+
url.pathname === "/api/avatar/vrm"
|
|
3175
|
+
) {
|
|
3176
|
+
sendBinary(req, res, 200, "application/octet-stream", SMOKE_VRM);
|
|
3177
|
+
return;
|
|
3178
|
+
}
|
|
3179
|
+
|
|
3180
|
+
if (
|
|
3181
|
+
(req.method === "GET" || req.method === "HEAD") &&
|
|
3182
|
+
url.pathname === "/api/avatar/background"
|
|
3183
|
+
) {
|
|
3184
|
+
sendBinary(req, res, 200, "image/png", ONE_PIXEL_PNG);
|
|
3185
|
+
return;
|
|
3186
|
+
}
|
|
3187
|
+
|
|
3188
|
+
if (
|
|
3189
|
+
(req.method === "GET" || req.method === "HEAD") &&
|
|
3190
|
+
url.pathname.startsWith("/api/apps/hero/")
|
|
3191
|
+
) {
|
|
3192
|
+
sendBinary(req, res, 200, "image/png", ONE_PIXEL_PNG);
|
|
3193
|
+
return;
|
|
3194
|
+
}
|
|
3195
|
+
|
|
3196
|
+
if (req.method === "GET" && url.pathname === "/api/views") {
|
|
3197
|
+
const requestedViewType = url.searchParams.get("viewType");
|
|
3198
|
+
const views =
|
|
3199
|
+
requestedViewType === "gui" || requestedViewType === "tui"
|
|
3200
|
+
? smokeViews.filter((view) => view.viewType === requestedViewType)
|
|
3201
|
+
: smokeViews;
|
|
3202
|
+
sendJson(req, res, 200, { views });
|
|
3203
|
+
return;
|
|
3204
|
+
}
|
|
3205
|
+
|
|
3206
|
+
if (req.method === "GET" && url.pathname === "/api/views/current") {
|
|
3207
|
+
sendJson(req, res, 200, { currentView: null });
|
|
3208
|
+
return;
|
|
3209
|
+
}
|
|
3210
|
+
|
|
3211
|
+
if (
|
|
3212
|
+
(req.method === "GET" || req.method === "HEAD") &&
|
|
3213
|
+
url.pathname.startsWith("/api/views/")
|
|
3214
|
+
) {
|
|
3215
|
+
const afterPrefix = url.pathname.slice("/api/views/".length);
|
|
3216
|
+
const slashIndex = afterPrefix.indexOf("/");
|
|
3217
|
+
const rawId =
|
|
3218
|
+
slashIndex === -1 ? afterPrefix : afterPrefix.slice(0, slashIndex);
|
|
3219
|
+
const subResource =
|
|
3220
|
+
slashIndex === -1 ? "" : afterPrefix.slice(slashIndex + 1);
|
|
3221
|
+
const id = decodeURIComponent(rawId);
|
|
3222
|
+
const view = smokeViewByRequest(id, url.searchParams.get("viewType"));
|
|
3223
|
+
if (!view) {
|
|
3224
|
+
sendJson(req, res, 404, { error: `View not found: ${id}` });
|
|
3225
|
+
return;
|
|
3226
|
+
}
|
|
3227
|
+
if (subResource === "") {
|
|
3228
|
+
sendJson(req, res, 200, view);
|
|
3229
|
+
return;
|
|
3230
|
+
}
|
|
3231
|
+
if (subResource === "hero") {
|
|
3232
|
+
sendBinary(req, res, 200, "image/png", ONE_PIXEL_PNG);
|
|
3233
|
+
return;
|
|
3234
|
+
}
|
|
3235
|
+
if (subResource === "bundle.js") {
|
|
3236
|
+
sendSmokeViewAsset(req, res, url, view, "bundle.js");
|
|
3237
|
+
return;
|
|
3238
|
+
}
|
|
3239
|
+
sendSmokeViewAsset(req, res, url, view, subResource);
|
|
3240
|
+
return;
|
|
3241
|
+
}
|
|
3242
|
+
|
|
3243
|
+
if (req.method === "POST" && url.pathname.startsWith("/api/views/")) {
|
|
3244
|
+
sendJson(req, res, 200, { ok: true });
|
|
3245
|
+
return;
|
|
3246
|
+
}
|
|
3247
|
+
|
|
3248
|
+
if (req.method === "GET" && url.pathname === "/api/health") {
|
|
3249
|
+
sendJson(req, res, 200, { status: "ok" });
|
|
3250
|
+
return;
|
|
3251
|
+
}
|
|
3252
|
+
|
|
3253
|
+
if (req.method === "GET" && url.pathname === "/api/first-run/status") {
|
|
3254
|
+
sendJson(req, res, 200, { complete: true });
|
|
3255
|
+
return;
|
|
3256
|
+
}
|
|
3257
|
+
|
|
3258
|
+
if (req.method === "GET" && url.pathname === "/api/first-run/options") {
|
|
3259
|
+
sendJson(req, res, 200, {
|
|
3260
|
+
names: [],
|
|
3261
|
+
styles: [],
|
|
3262
|
+
providers: [],
|
|
3263
|
+
cloudProviders: [],
|
|
3264
|
+
models: {
|
|
3265
|
+
nano: [],
|
|
3266
|
+
small: [],
|
|
3267
|
+
medium: [],
|
|
3268
|
+
large: [],
|
|
3269
|
+
mega: [],
|
|
3270
|
+
},
|
|
3271
|
+
inventoryProviders: [],
|
|
3272
|
+
sharedStyleRules: "",
|
|
3273
|
+
});
|
|
3274
|
+
return;
|
|
3275
|
+
}
|
|
3276
|
+
|
|
3277
|
+
if (req.method === "GET" && url.pathname === "/api/auth/status") {
|
|
3278
|
+
sendJson(req, res, 200, {
|
|
3279
|
+
required: false,
|
|
3280
|
+
pairingEnabled: false,
|
|
3281
|
+
expiresAt: null,
|
|
3282
|
+
});
|
|
3283
|
+
return;
|
|
3284
|
+
}
|
|
3285
|
+
|
|
3286
|
+
if (req.method === "GET" && url.pathname === "/api/auth/me") {
|
|
3287
|
+
sendJson(req, res, 200, {
|
|
3288
|
+
identity: stubAuthIdentity,
|
|
3289
|
+
session: stubAuthSession,
|
|
3290
|
+
access: stubAuthAccess,
|
|
3291
|
+
});
|
|
3292
|
+
return;
|
|
3293
|
+
}
|
|
3294
|
+
|
|
3295
|
+
if (req.method === "GET" && url.pathname === "/api/auth/sessions") {
|
|
3296
|
+
sendJson(req, res, 200, {
|
|
3297
|
+
sessions: [
|
|
3298
|
+
{
|
|
3299
|
+
id: stubAuthSession.id,
|
|
3300
|
+
kind: stubAuthSession.kind,
|
|
3301
|
+
ip: "127.0.0.1",
|
|
3302
|
+
userAgent: "Playwright smoke",
|
|
3303
|
+
lastSeenAt: Date.now(),
|
|
3304
|
+
expiresAt: null,
|
|
3305
|
+
current: true,
|
|
3306
|
+
},
|
|
3307
|
+
],
|
|
3308
|
+
});
|
|
3309
|
+
return;
|
|
3310
|
+
}
|
|
3311
|
+
|
|
3312
|
+
if (req.method === "GET" && url.pathname === "/api/agent/status") {
|
|
3313
|
+
sendJson(req, res, 200, { firstRunComplete: true, status: "running" });
|
|
3314
|
+
return;
|
|
3315
|
+
}
|
|
3316
|
+
|
|
3317
|
+
if (req.method === "POST" && url.pathname === "/api/emote") {
|
|
3318
|
+
const body = (await readJsonBody(req)) || {};
|
|
3319
|
+
sendJson(req, res, 200, {
|
|
3320
|
+
ok: true,
|
|
3321
|
+
emoteId: typeof body.emoteId === "string" ? body.emoteId : null,
|
|
3322
|
+
});
|
|
3323
|
+
return;
|
|
3324
|
+
}
|
|
3325
|
+
|
|
3326
|
+
if (req.method === "GET" && url.pathname === "/api/status") {
|
|
3327
|
+
sendJson(req, res, 200, {
|
|
3328
|
+
state: "running",
|
|
3329
|
+
agentName: "Playwright Smoke",
|
|
3330
|
+
model: "ui-smoke",
|
|
3331
|
+
startup: { phase: "running", attempt: 0 },
|
|
3332
|
+
pendingRestart: false,
|
|
3333
|
+
pendingRestartReasons: [],
|
|
3334
|
+
});
|
|
3335
|
+
return;
|
|
3336
|
+
}
|
|
3337
|
+
|
|
3338
|
+
if (url.pathname === "/api/config") {
|
|
3339
|
+
const config = {
|
|
3340
|
+
cloud: { enabled: false },
|
|
3341
|
+
media: {},
|
|
3342
|
+
// Select the local-inference voice provider so the /chat overlay's
|
|
3343
|
+
// bidirectional loop drives /api/asr/local-inference (in) and
|
|
3344
|
+
// /api/tts/local-inference (out) — both stubbed below.
|
|
3345
|
+
messages: {
|
|
3346
|
+
tts: { provider: "local-inference" },
|
|
3347
|
+
asr: { provider: "local-inference" },
|
|
3348
|
+
},
|
|
3349
|
+
plugins: { entries: {} },
|
|
3350
|
+
ui: {},
|
|
3351
|
+
wallet: {},
|
|
3352
|
+
};
|
|
3353
|
+
if (req.method === "GET") {
|
|
3354
|
+
sendJson(req, res, 200, config);
|
|
3355
|
+
return;
|
|
3356
|
+
}
|
|
3357
|
+
if (req.method === "PUT" || req.method === "PATCH") {
|
|
3358
|
+
const body = (await readJsonBody(req)) || {};
|
|
3359
|
+
sendJson(req, res, 200, {
|
|
3360
|
+
...config,
|
|
3361
|
+
...(body && typeof body === "object" && !Array.isArray(body)
|
|
3362
|
+
? body
|
|
3363
|
+
: {}),
|
|
3364
|
+
});
|
|
3365
|
+
return;
|
|
3366
|
+
}
|
|
3367
|
+
}
|
|
3368
|
+
|
|
3369
|
+
if (req.method === "GET" && url.pathname === "/api/database/status") {
|
|
3370
|
+
sendJson(req, res, 200, {
|
|
3371
|
+
provider: "pglite",
|
|
3372
|
+
connected: true,
|
|
3373
|
+
serverVersion: "16.0-ui-smoke",
|
|
3374
|
+
tableCount: databaseTables.length,
|
|
3375
|
+
pgliteDataDir: null,
|
|
3376
|
+
postgresHost: null,
|
|
3377
|
+
});
|
|
3378
|
+
return;
|
|
3379
|
+
}
|
|
3380
|
+
|
|
3381
|
+
if (req.method === "GET" && url.pathname === "/api/database/config") {
|
|
3382
|
+
sendJson(req, res, 200, {
|
|
3383
|
+
config: {},
|
|
3384
|
+
activeProvider: "pglite",
|
|
3385
|
+
needsRestart: false,
|
|
3386
|
+
});
|
|
3387
|
+
return;
|
|
3388
|
+
}
|
|
3389
|
+
|
|
3390
|
+
if (req.method === "PUT" && url.pathname === "/api/database/config") {
|
|
3391
|
+
sendJson(req, res, 200, {
|
|
3392
|
+
config: (await readJsonBody(req)) || {},
|
|
3393
|
+
activeProvider: "pglite",
|
|
3394
|
+
needsRestart: false,
|
|
3395
|
+
});
|
|
3396
|
+
return;
|
|
3397
|
+
}
|
|
3398
|
+
|
|
3399
|
+
if (req.method === "POST" && url.pathname === "/api/database/test") {
|
|
3400
|
+
sendJson(req, res, 200, {
|
|
3401
|
+
success: true,
|
|
3402
|
+
serverVersion: "16.0-ui-smoke",
|
|
3403
|
+
error: null,
|
|
3404
|
+
durationMs: 1,
|
|
3405
|
+
});
|
|
3406
|
+
return;
|
|
3407
|
+
}
|
|
3408
|
+
|
|
3409
|
+
if (req.method === "GET" && url.pathname === "/api/database/tables") {
|
|
3410
|
+
sendJson(req, res, 200, { tables: databaseTables });
|
|
3411
|
+
return;
|
|
3412
|
+
}
|
|
3413
|
+
|
|
3414
|
+
const databaseRowsMatch = /^\/api\/database\/tables\/([^/]+)\/rows$/.exec(
|
|
3415
|
+
url.pathname,
|
|
3416
|
+
);
|
|
3417
|
+
if (databaseRowsMatch) {
|
|
3418
|
+
const tableName = decodeURIComponent(databaseRowsMatch[1]);
|
|
3419
|
+
if (req.method === "GET") {
|
|
3420
|
+
sendJson(req, res, 200, databaseRowsResponse(tableName, url));
|
|
3421
|
+
return;
|
|
3422
|
+
}
|
|
3423
|
+
if (["POST", "PUT", "DELETE"].includes(req.method ?? "GET")) {
|
|
3424
|
+
sendJson(req, res, 200, {
|
|
3425
|
+
ok: true,
|
|
3426
|
+
table: tableName,
|
|
3427
|
+
row: databaseRowsByTable[tableName]?.[0] ?? null,
|
|
3428
|
+
});
|
|
3429
|
+
return;
|
|
3430
|
+
}
|
|
3431
|
+
}
|
|
3432
|
+
|
|
3433
|
+
if (req.method === "POST" && url.pathname === "/api/database/query") {
|
|
3434
|
+
const body = (await readJsonBody(req)) || {};
|
|
3435
|
+
sendJson(req, res, 200, executeDatabaseQueryResult(String(body.sql ?? "")));
|
|
3436
|
+
return;
|
|
3437
|
+
}
|
|
3438
|
+
|
|
3439
|
+
if (
|
|
3440
|
+
(req.method === "GET" || req.method === "POST") &&
|
|
3441
|
+
url.pathname === "/api/database/vectors/search"
|
|
3442
|
+
) {
|
|
3443
|
+
const query =
|
|
3444
|
+
req.method === "POST"
|
|
3445
|
+
? (await readJsonBody(req))?.query
|
|
3446
|
+
: url.searchParams.get("query");
|
|
3447
|
+
sendJson(req, res, 200, {
|
|
3448
|
+
query: typeof query === "string" ? query : "",
|
|
3449
|
+
table: "memories",
|
|
3450
|
+
limit: 10,
|
|
3451
|
+
count: 1,
|
|
3452
|
+
results: [
|
|
3453
|
+
{
|
|
3454
|
+
id: "memory-smoke-1",
|
|
3455
|
+
text: "Deterministic memory fixture for UI smoke.",
|
|
3456
|
+
similarity: 0.98,
|
|
3457
|
+
roomId: "room-smoke",
|
|
3458
|
+
entityId: "entity-smoke",
|
|
3459
|
+
createdAt: SMOKE_GENERATED_AT,
|
|
3460
|
+
tableName: "memories",
|
|
3461
|
+
},
|
|
3462
|
+
],
|
|
3463
|
+
});
|
|
3464
|
+
return;
|
|
3465
|
+
}
|
|
3466
|
+
|
|
3467
|
+
if (req.method === "GET" && url.pathname === "/api/vincent/status") {
|
|
3468
|
+
sendJson(req, res, 200, {
|
|
3469
|
+
connected: false,
|
|
3470
|
+
connectedAt: null,
|
|
3471
|
+
tradingVenues: ["hyperliquid", "polymarket"],
|
|
3472
|
+
});
|
|
3473
|
+
return;
|
|
3474
|
+
}
|
|
948
3475
|
|
|
949
|
-
if (req.method === "
|
|
950
|
-
|
|
3476
|
+
if (req.method === "GET" && url.pathname === "/api/vincent/strategy") {
|
|
3477
|
+
sendJson(req, res, 200, { connected: false, strategy: null });
|
|
951
3478
|
return;
|
|
952
3479
|
}
|
|
953
3480
|
|
|
954
|
-
if (req.method === "
|
|
955
|
-
|
|
3481
|
+
if (req.method === "GET" && url.pathname === "/api/vincent/trading-profile") {
|
|
3482
|
+
sendJson(req, res, 200, { connected: false, profile: null });
|
|
956
3483
|
return;
|
|
957
3484
|
}
|
|
958
3485
|
|
|
959
|
-
if (req.method === "GET" && url.pathname === "/api/
|
|
960
|
-
sendJson(req, res, 200, {
|
|
3486
|
+
if (req.method === "GET" && url.pathname === "/api/shopify/status") {
|
|
3487
|
+
sendJson(req, res, 200, { connected: false, shop: null });
|
|
961
3488
|
return;
|
|
962
3489
|
}
|
|
963
3490
|
|
|
964
|
-
if (req.method === "GET" && url.pathname === "/api/
|
|
965
|
-
sendJson(req, res, 200, {
|
|
3491
|
+
if (req.method === "GET" && url.pathname === "/api/shopify/products") {
|
|
3492
|
+
sendJson(req, res, 200, { products: [], total: 0, page: 1, pageSize: 25 });
|
|
3493
|
+
return;
|
|
3494
|
+
}
|
|
3495
|
+
|
|
3496
|
+
if (req.method === "GET" && url.pathname === "/api/shopify/orders") {
|
|
3497
|
+
sendJson(req, res, 200, { orders: [], total: 0 });
|
|
3498
|
+
return;
|
|
3499
|
+
}
|
|
3500
|
+
|
|
3501
|
+
if (req.method === "GET" && url.pathname === "/api/shopify/inventory") {
|
|
3502
|
+
sendJson(req, res, 200, { items: [], locations: [] });
|
|
3503
|
+
return;
|
|
3504
|
+
}
|
|
3505
|
+
|
|
3506
|
+
if (req.method === "GET" && url.pathname === "/api/shopify/customers") {
|
|
3507
|
+
sendJson(req, res, 200, { customers: [], total: 0 });
|
|
3508
|
+
return;
|
|
3509
|
+
}
|
|
3510
|
+
|
|
3511
|
+
if (req.method === "GET" && url.pathname === "/api/hyperliquid/status") {
|
|
3512
|
+
sendJson(req, res, 200, stubHyperliquidStatus);
|
|
966
3513
|
return;
|
|
967
3514
|
}
|
|
968
3515
|
|
|
969
|
-
if (req.method === "GET" && url.pathname === "/api/
|
|
3516
|
+
if (req.method === "GET" && url.pathname === "/api/hyperliquid/markets") {
|
|
3517
|
+
sendJson(req, res, 200, stubHyperliquidMarkets);
|
|
3518
|
+
return;
|
|
3519
|
+
}
|
|
3520
|
+
|
|
3521
|
+
if (req.method === "GET" && url.pathname === "/api/hyperliquid/positions") {
|
|
970
3522
|
sendJson(req, res, 200, {
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
nano: [],
|
|
977
|
-
small: [],
|
|
978
|
-
medium: [],
|
|
979
|
-
large: [],
|
|
980
|
-
mega: [],
|
|
981
|
-
},
|
|
982
|
-
inventoryProviders: [],
|
|
983
|
-
sharedStyleRules: "",
|
|
3523
|
+
accountAddress: null,
|
|
3524
|
+
positions: [],
|
|
3525
|
+
readBlockedReason:
|
|
3526
|
+
"Connect an account address to read Hyperliquid positions.",
|
|
3527
|
+
fetchedAt: null,
|
|
984
3528
|
});
|
|
985
3529
|
return;
|
|
986
3530
|
}
|
|
987
3531
|
|
|
988
|
-
if (req.method === "GET" && url.pathname === "/api/
|
|
3532
|
+
if (req.method === "GET" && url.pathname === "/api/hyperliquid/orders") {
|
|
989
3533
|
sendJson(req, res, 200, {
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
3534
|
+
accountAddress: null,
|
|
3535
|
+
orders: [],
|
|
3536
|
+
readBlockedReason: "Connect an account address to read open orders.",
|
|
3537
|
+
fetchedAt: null,
|
|
993
3538
|
});
|
|
994
3539
|
return;
|
|
995
3540
|
}
|
|
996
3541
|
|
|
997
|
-
if (req.method === "GET" && url.pathname === "/api/
|
|
3542
|
+
if (req.method === "GET" && url.pathname === "/api/polymarket/status") {
|
|
3543
|
+
sendJson(req, res, 200, stubPolymarketStatus);
|
|
3544
|
+
return;
|
|
3545
|
+
}
|
|
3546
|
+
|
|
3547
|
+
if (req.method === "GET" && url.pathname === "/api/polymarket/markets") {
|
|
998
3548
|
sendJson(req, res, 200, {
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
access: stubAuthAccess,
|
|
3549
|
+
markets: [stubPolymarketMarket],
|
|
3550
|
+
source: { api: "gamma", endpoint: "/markets" },
|
|
1002
3551
|
});
|
|
1003
3552
|
return;
|
|
1004
3553
|
}
|
|
1005
3554
|
|
|
1006
|
-
if (req.method === "GET" && url.pathname === "/api/
|
|
3555
|
+
if (req.method === "GET" && url.pathname === "/api/polymarket/market") {
|
|
1007
3556
|
sendJson(req, res, 200, {
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
id: stubAuthSession.id,
|
|
1011
|
-
kind: stubAuthSession.kind,
|
|
1012
|
-
ip: "127.0.0.1",
|
|
1013
|
-
userAgent: "Playwright smoke",
|
|
1014
|
-
lastSeenAt: Date.now(),
|
|
1015
|
-
expiresAt: null,
|
|
1016
|
-
current: true,
|
|
1017
|
-
},
|
|
1018
|
-
],
|
|
3557
|
+
market: stubPolymarketMarket,
|
|
3558
|
+
source: { api: "gamma", endpoint: "/markets" },
|
|
1019
3559
|
});
|
|
1020
3560
|
return;
|
|
1021
3561
|
}
|
|
1022
3562
|
|
|
1023
|
-
if (req.method === "GET" && url.pathname === "/api/
|
|
1024
|
-
sendJson(req, res, 200, {
|
|
3563
|
+
if (req.method === "GET" && url.pathname === "/api/polymarket/orderbook") {
|
|
3564
|
+
sendJson(req, res, 200, {
|
|
3565
|
+
tokenId: url.searchParams.get("token_id") ?? "yes-token",
|
|
3566
|
+
market: stubPolymarketMarket.id,
|
|
3567
|
+
assetId: null,
|
|
3568
|
+
bids: [{ price: "0.71", size: "100" }],
|
|
3569
|
+
asks: [{ price: "0.73", size: "100" }],
|
|
3570
|
+
bestBid: "0.71",
|
|
3571
|
+
bestBidSize: "100",
|
|
3572
|
+
bestAsk: "0.73",
|
|
3573
|
+
bestAskSize: "100",
|
|
3574
|
+
midpoint: "0.72",
|
|
3575
|
+
spread: "0.02",
|
|
3576
|
+
bidLevels: 1,
|
|
3577
|
+
askLevels: 1,
|
|
3578
|
+
lastTradePrice: "0.72",
|
|
3579
|
+
tickSize: "0.01",
|
|
3580
|
+
source: { api: "clob", endpoint: "/book" },
|
|
3581
|
+
});
|
|
1025
3582
|
return;
|
|
1026
3583
|
}
|
|
1027
3584
|
|
|
1028
|
-
if (req.method === "GET" && url.pathname === "/api/
|
|
3585
|
+
if (req.method === "GET" && url.pathname === "/api/polymarket/orders") {
|
|
1029
3586
|
sendJson(req, res, 200, {
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
3587
|
+
enabled: false,
|
|
3588
|
+
reason: "Trading is disabled in UI smoke.",
|
|
3589
|
+
requiredForTrading: [
|
|
3590
|
+
"POLYMARKET_PRIVATE_KEY",
|
|
3591
|
+
"CLOB_API_KEY",
|
|
3592
|
+
"CLOB_API_SECRET",
|
|
3593
|
+
"CLOB_API_PASSPHRASE",
|
|
3594
|
+
],
|
|
1034
3595
|
});
|
|
1035
3596
|
return;
|
|
1036
3597
|
}
|
|
1037
3598
|
|
|
1038
|
-
if (req.method === "GET" && url.pathname === "/api/
|
|
3599
|
+
if (req.method === "GET" && url.pathname === "/api/polymarket/positions") {
|
|
1039
3600
|
sendJson(req, res, 200, {
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
plugins: { entries: {} },
|
|
1043
|
-
ui: {},
|
|
1044
|
-
wallet: {},
|
|
3601
|
+
positions: [],
|
|
3602
|
+
source: { api: "data", endpoint: "/positions" },
|
|
1045
3603
|
});
|
|
1046
3604
|
return;
|
|
1047
3605
|
}
|
|
1048
3606
|
|
|
1049
|
-
if (
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
3607
|
+
if (url.pathname === "/api/conversations") {
|
|
3608
|
+
if (req.method === "GET") {
|
|
3609
|
+
sendJson(req, res, 200, { conversations: stubConversations });
|
|
3610
|
+
return;
|
|
3611
|
+
}
|
|
3612
|
+
if (req.method === "POST") {
|
|
3613
|
+
const body = (await readJsonBody(req)) || {};
|
|
3614
|
+
const conversation = createStubConversation({
|
|
3615
|
+
title: body.title,
|
|
3616
|
+
metadata: body.metadata,
|
|
3617
|
+
});
|
|
3618
|
+
sendJson(req, res, 200, { conversation });
|
|
3619
|
+
return;
|
|
3620
|
+
}
|
|
3621
|
+
}
|
|
3622
|
+
|
|
3623
|
+
if (
|
|
3624
|
+
req.method === "POST" &&
|
|
3625
|
+
url.pathname === "/api/conversations/cleanup-empty"
|
|
3626
|
+
) {
|
|
3627
|
+
const body = (await readJsonBody(req)) || {};
|
|
3628
|
+
const deleted = cleanupEmptyStubConversations({
|
|
3629
|
+
keepId: body.keepId,
|
|
1054
3630
|
});
|
|
3631
|
+
sendJson(req, res, 200, { deleted });
|
|
1055
3632
|
return;
|
|
1056
3633
|
}
|
|
1057
3634
|
|
|
1058
|
-
|
|
1059
|
-
|
|
3635
|
+
const conversationMessagesMatch = url.pathname.match(
|
|
3636
|
+
/^\/api\/conversations\/([^/]+)\/messages(?:\/(stream|truncate))?$/,
|
|
3637
|
+
);
|
|
3638
|
+
if (conversationMessagesMatch) {
|
|
3639
|
+
const conversationId = decodeURIComponent(conversationMessagesMatch[1]);
|
|
3640
|
+
const action = conversationMessagesMatch[2] ?? null;
|
|
3641
|
+
const conversation = findStubConversation(conversationId);
|
|
3642
|
+
if (!conversation) {
|
|
3643
|
+
sendJson(req, res, 404, { error: "Conversation not found" });
|
|
3644
|
+
return;
|
|
3645
|
+
}
|
|
3646
|
+
|
|
3647
|
+
if (req.method === "GET" && action === null) {
|
|
3648
|
+
sendJson(req, res, 200, {
|
|
3649
|
+
messages: stubConversationMessages.get(conversationId) ?? [],
|
|
3650
|
+
});
|
|
3651
|
+
return;
|
|
3652
|
+
}
|
|
3653
|
+
|
|
3654
|
+
if (req.method === "POST" && action === "truncate") {
|
|
3655
|
+
stubConversationMessages.set(conversationId, []);
|
|
3656
|
+
conversation.updatedAt = nowIso();
|
|
3657
|
+
sendJson(req, res, 200, { ok: true, messages: [] });
|
|
3658
|
+
return;
|
|
3659
|
+
}
|
|
3660
|
+
|
|
3661
|
+
if (req.method === "POST" && action === "stream") {
|
|
3662
|
+
const body = (await readJsonBody(req)) || {};
|
|
3663
|
+
appendStubMessage(conversationId, createStubMessage("user", body.text));
|
|
3664
|
+
const text = createDeterministicAssistantText({
|
|
3665
|
+
body,
|
|
3666
|
+
conversationId,
|
|
3667
|
+
transport: "sse",
|
|
3668
|
+
});
|
|
3669
|
+
appendStubMessage(conversationId, createStubMessage("assistant", text));
|
|
3670
|
+
sendSseHeaders(req, res);
|
|
3671
|
+
writeSseEvent(res, { type: "token", text, fullText: text });
|
|
3672
|
+
writeSseEvent(res, { type: "done", fullText: text, agentName: "Eliza" });
|
|
3673
|
+
res.end();
|
|
3674
|
+
return;
|
|
3675
|
+
}
|
|
3676
|
+
|
|
3677
|
+
if (req.method === "POST" && action === null) {
|
|
3678
|
+
const body = (await readJsonBody(req)) || {};
|
|
3679
|
+
appendStubMessage(conversationId, createStubMessage("user", body.text));
|
|
3680
|
+
const text = createDeterministicAssistantText({
|
|
3681
|
+
body,
|
|
3682
|
+
conversationId,
|
|
3683
|
+
transport: "json",
|
|
3684
|
+
});
|
|
3685
|
+
appendStubMessage(conversationId, createStubMessage("assistant", text));
|
|
3686
|
+
sendJson(req, res, 200, { text, agentName: "Eliza" });
|
|
3687
|
+
return;
|
|
3688
|
+
}
|
|
3689
|
+
}
|
|
3690
|
+
|
|
3691
|
+
const conversationMatch = url.pathname.match(
|
|
3692
|
+
/^\/api\/conversations\/([^/]+)$/,
|
|
3693
|
+
);
|
|
3694
|
+
if (conversationMatch) {
|
|
3695
|
+
const conversationId = decodeURIComponent(conversationMatch[1]);
|
|
3696
|
+
const conversation = findStubConversation(conversationId);
|
|
3697
|
+
if (!conversation) {
|
|
3698
|
+
sendJson(req, res, 404, { error: "Conversation not found" });
|
|
3699
|
+
return;
|
|
3700
|
+
}
|
|
3701
|
+
if (req.method === "PATCH") {
|
|
3702
|
+
const body = (await readJsonBody(req)) || {};
|
|
3703
|
+
if (typeof body.title === "string" && body.title.trim().length > 0) {
|
|
3704
|
+
conversation.title = body.title.trim();
|
|
3705
|
+
}
|
|
3706
|
+
if (
|
|
3707
|
+
Object.hasOwn(body, "metadata") &&
|
|
3708
|
+
body.metadata &&
|
|
3709
|
+
typeof body.metadata === "object" &&
|
|
3710
|
+
!Array.isArray(body.metadata)
|
|
3711
|
+
) {
|
|
3712
|
+
conversation.metadata = body.metadata;
|
|
3713
|
+
}
|
|
3714
|
+
conversation.updatedAt = nowIso();
|
|
3715
|
+
sendJson(req, res, 200, { conversation });
|
|
3716
|
+
return;
|
|
3717
|
+
}
|
|
3718
|
+
if (req.method === "DELETE") {
|
|
3719
|
+
const index = stubConversations.findIndex(
|
|
3720
|
+
(item) => item.id === conversationId,
|
|
3721
|
+
);
|
|
3722
|
+
if (index >= 0) stubConversations.splice(index, 1);
|
|
3723
|
+
stubConversationMessages.delete(conversationId);
|
|
3724
|
+
sendJson(req, res, 200, { ok: true });
|
|
3725
|
+
return;
|
|
3726
|
+
}
|
|
3727
|
+
}
|
|
3728
|
+
|
|
3729
|
+
const conversationGreetingMatch = url.pathname.match(
|
|
3730
|
+
/^\/api\/conversations\/([^/]+)\/greeting$/,
|
|
3731
|
+
);
|
|
3732
|
+
if (req.method === "POST" && conversationGreetingMatch) {
|
|
3733
|
+
const conversationId = decodeURIComponent(conversationGreetingMatch[1]);
|
|
3734
|
+
if (!findStubConversation(conversationId)) {
|
|
3735
|
+
sendJson(req, res, 404, { error: "Conversation not found" });
|
|
3736
|
+
return;
|
|
3737
|
+
}
|
|
3738
|
+
sendJson(req, res, 200, {
|
|
3739
|
+
text: "What would you like to check?",
|
|
3740
|
+
agentName: "Eliza",
|
|
3741
|
+
generated: false,
|
|
3742
|
+
persisted: true,
|
|
3743
|
+
});
|
|
1060
3744
|
return;
|
|
1061
3745
|
}
|
|
1062
3746
|
|
|
@@ -1085,6 +3769,16 @@ const server = http.createServer(async (req, res) => {
|
|
|
1085
3769
|
return;
|
|
1086
3770
|
}
|
|
1087
3771
|
|
|
3772
|
+
if (req.method === "GET" && url.pathname === "/api/runtime/mode") {
|
|
3773
|
+
sendJson(req, res, 200, {
|
|
3774
|
+
mode: "local",
|
|
3775
|
+
deploymentRuntime: "local",
|
|
3776
|
+
isRemoteController: false,
|
|
3777
|
+
remoteApiBaseConfigured: false,
|
|
3778
|
+
});
|
|
3779
|
+
return;
|
|
3780
|
+
}
|
|
3781
|
+
|
|
1088
3782
|
if (req.method === "GET" && url.pathname === "/api/memories/stats") {
|
|
1089
3783
|
sendJson(req, res, 200, stubMemoryStats);
|
|
1090
3784
|
return;
|
|
@@ -1224,46 +3918,325 @@ const server = http.createServer(async (req, res) => {
|
|
|
1224
3918
|
}
|
|
1225
3919
|
}
|
|
1226
3920
|
|
|
1227
|
-
if (req.method === "GET" && url.pathname === "/api/character") {
|
|
1228
|
-
sendJson(req, res, 200, { character: stubCharacter, agentName: "Eliza" });
|
|
3921
|
+
if (req.method === "GET" && url.pathname === "/api/character") {
|
|
3922
|
+
sendJson(req, res, 200, { character: stubCharacter, agentName: "Eliza" });
|
|
3923
|
+
return;
|
|
3924
|
+
}
|
|
3925
|
+
|
|
3926
|
+
if (req.method === "GET" && url.pathname === "/api/character/history") {
|
|
3927
|
+
sendJson(req, res, 200, { history: [], total: 0 });
|
|
3928
|
+
return;
|
|
3929
|
+
}
|
|
3930
|
+
|
|
3931
|
+
if (req.method === "GET" && url.pathname === "/api/character/experiences") {
|
|
3932
|
+
sendJson(req, res, 200, {
|
|
3933
|
+
data: stubExperiences,
|
|
3934
|
+
total: stubExperiences.length,
|
|
3935
|
+
});
|
|
3936
|
+
return;
|
|
3937
|
+
}
|
|
3938
|
+
|
|
3939
|
+
if (req.method === "GET" && url.pathname === "/api/relationships/activity") {
|
|
3940
|
+
sendJson(req, res, 200, { activity: [] });
|
|
3941
|
+
return;
|
|
3942
|
+
}
|
|
3943
|
+
|
|
3944
|
+
if (req.method === "GET" && url.pathname === "/api/documents") {
|
|
3945
|
+
sendJson(req, res, 200, {
|
|
3946
|
+
documents: [],
|
|
3947
|
+
total: 0,
|
|
3948
|
+
limit: parsePositiveInt(url.searchParams.get("limit"), 100),
|
|
3949
|
+
offset: parsePositiveInt(url.searchParams.get("offset"), 0),
|
|
3950
|
+
});
|
|
3951
|
+
return;
|
|
3952
|
+
}
|
|
3953
|
+
|
|
3954
|
+
if (req.method === "GET" && url.pathname === "/api/voice/profiles") {
|
|
3955
|
+
sendJson(req, res, 200, { profiles: [] });
|
|
3956
|
+
return;
|
|
3957
|
+
}
|
|
3958
|
+
|
|
3959
|
+
if (req.method === "GET" && url.pathname === "/api/subscription/status") {
|
|
3960
|
+
sendJson(req, res, 200, { providers: [] });
|
|
3961
|
+
return;
|
|
3962
|
+
}
|
|
3963
|
+
|
|
3964
|
+
if (req.method === "GET" && url.pathname === "/api/update/status") {
|
|
3965
|
+
sendJson(req, res, 200, {
|
|
3966
|
+
currentVersion: "0.0.0-ui-smoke",
|
|
3967
|
+
channel: "stable",
|
|
3968
|
+
installMethod: "source",
|
|
3969
|
+
updateAuthority: "manual",
|
|
3970
|
+
nextAction: "manual",
|
|
3971
|
+
canAutoUpdate: false,
|
|
3972
|
+
canExecuteUpdate: false,
|
|
3973
|
+
remoteDisplay: false,
|
|
3974
|
+
updateCommand: null,
|
|
3975
|
+
updateInstructions: null,
|
|
3976
|
+
updateAvailable: false,
|
|
3977
|
+
latestVersion: "0.0.0-ui-smoke",
|
|
3978
|
+
channels: {
|
|
3979
|
+
stable: "0.0.0-ui-smoke",
|
|
3980
|
+
beta: "0.0.0-ui-smoke",
|
|
3981
|
+
nightly: "0.0.0-ui-smoke",
|
|
3982
|
+
},
|
|
3983
|
+
distTags: {},
|
|
3984
|
+
lastCheckAt: null,
|
|
3985
|
+
error: null,
|
|
3986
|
+
});
|
|
3987
|
+
return;
|
|
3988
|
+
}
|
|
3989
|
+
|
|
3990
|
+
if (req.method === "GET" && url.pathname === "/api/permissions") {
|
|
3991
|
+
const permission = {
|
|
3992
|
+
id: "shell",
|
|
3993
|
+
status: "granted",
|
|
3994
|
+
lastChecked: Date.now(),
|
|
3995
|
+
canRequest: false,
|
|
3996
|
+
platform: process.platform,
|
|
3997
|
+
};
|
|
3998
|
+
sendJson(req, res, 200, {
|
|
3999
|
+
shell: permission,
|
|
4000
|
+
notifications: { ...permission, id: "notifications" },
|
|
4001
|
+
microphone: { ...permission, id: "microphone" },
|
|
4002
|
+
camera: { ...permission, id: "camera" },
|
|
4003
|
+
"screen-capture": { ...permission, id: "screen-capture" },
|
|
4004
|
+
accessibility: { ...permission, id: "accessibility" },
|
|
4005
|
+
"website-blocking": {
|
|
4006
|
+
...permission,
|
|
4007
|
+
id: "website-blocking",
|
|
4008
|
+
status: "not-applicable",
|
|
4009
|
+
},
|
|
4010
|
+
_platform: process.platform,
|
|
4011
|
+
_shellEnabled: true,
|
|
4012
|
+
});
|
|
4013
|
+
return;
|
|
4014
|
+
}
|
|
4015
|
+
|
|
4016
|
+
if (req.method === "GET" && url.pathname === "/api/permissions/shell") {
|
|
4017
|
+
sendJson(req, res, 200, {
|
|
4018
|
+
id: "shell",
|
|
4019
|
+
status: "granted",
|
|
4020
|
+
lastChecked: Date.now(),
|
|
4021
|
+
canRequest: false,
|
|
4022
|
+
platform: process.platform,
|
|
4023
|
+
});
|
|
4024
|
+
return;
|
|
4025
|
+
}
|
|
4026
|
+
|
|
4027
|
+
if (
|
|
4028
|
+
(req.method === "GET" || req.method === "PUT") &&
|
|
4029
|
+
url.pathname === "/api/secrets/manager/preferences"
|
|
4030
|
+
) {
|
|
4031
|
+
if (req.method === "PUT") {
|
|
4032
|
+
await readJsonBody(req);
|
|
4033
|
+
}
|
|
4034
|
+
sendJson(req, res, 200, {
|
|
4035
|
+
preferences: { enabled: ["in-house"], routing: {} },
|
|
4036
|
+
});
|
|
4037
|
+
return;
|
|
4038
|
+
}
|
|
4039
|
+
|
|
4040
|
+
if (
|
|
4041
|
+
req.method === "GET" &&
|
|
4042
|
+
url.pathname === "/api/secrets/manager/backends"
|
|
4043
|
+
) {
|
|
4044
|
+
sendJson(req, res, 200, {
|
|
4045
|
+
backends: [
|
|
4046
|
+
{
|
|
4047
|
+
id: "in-house",
|
|
4048
|
+
label: "Local (encrypted)",
|
|
4049
|
+
available: true,
|
|
4050
|
+
signedIn: true,
|
|
4051
|
+
detail: "UI smoke local vault",
|
|
4052
|
+
authMode: null,
|
|
4053
|
+
},
|
|
4054
|
+
],
|
|
4055
|
+
});
|
|
4056
|
+
return;
|
|
4057
|
+
}
|
|
4058
|
+
|
|
4059
|
+
// Secrets-manager modal load endpoints — the modal's load() requires all of
|
|
4060
|
+
// these to be ok or it shows an error banner instead of the tabs/add-secret
|
|
4061
|
+
// form. Minimal valid shapes (vault-tabs/types.ts) so the modal renders.
|
|
4062
|
+
if (
|
|
4063
|
+
req.method === "GET" &&
|
|
4064
|
+
url.pathname === "/api/secrets/manager/backends"
|
|
4065
|
+
) {
|
|
4066
|
+
sendJson(req, res, 200, {
|
|
4067
|
+
backends: [{ id: "in-house", label: "In-House Vault", available: true }],
|
|
4068
|
+
});
|
|
4069
|
+
return;
|
|
4070
|
+
}
|
|
4071
|
+
if (
|
|
4072
|
+
req.method === "GET" &&
|
|
4073
|
+
url.pathname === "/api/secrets/manager/preferences"
|
|
4074
|
+
) {
|
|
4075
|
+
sendJson(req, res, 200, { preferences: { enabled: ["in-house"] } });
|
|
4076
|
+
return;
|
|
4077
|
+
}
|
|
4078
|
+
if (
|
|
4079
|
+
req.method === "GET" &&
|
|
4080
|
+
url.pathname === "/api/secrets/manager/install/methods"
|
|
4081
|
+
) {
|
|
4082
|
+
sendJson(req, res, 200, { methods: {} });
|
|
4083
|
+
return;
|
|
4084
|
+
}
|
|
4085
|
+
if (req.method === "GET" && url.pathname === "/api/secrets/routing") {
|
|
4086
|
+
sendJson(req, res, 200, { config: { rules: [] } });
|
|
4087
|
+
return;
|
|
4088
|
+
}
|
|
4089
|
+
|
|
4090
|
+
if (req.method === "GET" && url.pathname === "/api/secrets/inventory") {
|
|
4091
|
+
const category = url.searchParams.get("category");
|
|
4092
|
+
sendJson(req, res, 200, {
|
|
4093
|
+
entries:
|
|
4094
|
+
category === "wallet"
|
|
4095
|
+
? [
|
|
4096
|
+
{
|
|
4097
|
+
key: "EVM_PRIVATE_KEY",
|
|
4098
|
+
label: "EVM private key",
|
|
4099
|
+
category: "wallet",
|
|
4100
|
+
backend: "in-house",
|
|
4101
|
+
isSet: true,
|
|
4102
|
+
updatedAt: SMOKE_GENERATED_AT,
|
|
4103
|
+
},
|
|
4104
|
+
{
|
|
4105
|
+
key: "SOLANA_PRIVATE_KEY",
|
|
4106
|
+
label: "Solana private key",
|
|
4107
|
+
category: "wallet",
|
|
4108
|
+
backend: "in-house",
|
|
4109
|
+
isSet: true,
|
|
4110
|
+
updatedAt: SMOKE_GENERATED_AT,
|
|
4111
|
+
},
|
|
4112
|
+
]
|
|
4113
|
+
: [],
|
|
4114
|
+
});
|
|
4115
|
+
return;
|
|
4116
|
+
}
|
|
4117
|
+
|
|
4118
|
+
const secretInventoryMatch = /^\/api\/secrets\/inventory\/([^/]+)$/.exec(
|
|
4119
|
+
url.pathname,
|
|
4120
|
+
);
|
|
4121
|
+
if (secretInventoryMatch) {
|
|
4122
|
+
const key = decodeURIComponent(secretInventoryMatch[1]);
|
|
4123
|
+
if (req.method === "GET") {
|
|
4124
|
+
sendJson(req, res, 200, {
|
|
4125
|
+
ok: true,
|
|
4126
|
+
value: key.includes("SOLANA")
|
|
4127
|
+
? "5HueCGU8rMjxEXxiPuD5BDuRa"
|
|
4128
|
+
: "0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
|
|
4129
|
+
source: "bare",
|
|
4130
|
+
});
|
|
4131
|
+
return;
|
|
4132
|
+
}
|
|
4133
|
+
if (req.method === "PUT" || req.method === "DELETE") {
|
|
4134
|
+
if (req.method === "PUT") {
|
|
4135
|
+
await readJsonBody(req);
|
|
4136
|
+
}
|
|
4137
|
+
sendJson(req, res, 200, { ok: true, key });
|
|
4138
|
+
return;
|
|
4139
|
+
}
|
|
4140
|
+
}
|
|
4141
|
+
|
|
4142
|
+
if (req.method === "GET" && url.pathname === "/api/wallet/addresses") {
|
|
4143
|
+
sendJson(req, res, 200, { evmAddress: null, solanaAddress: null });
|
|
4144
|
+
return;
|
|
4145
|
+
}
|
|
4146
|
+
|
|
4147
|
+
if (req.method === "GET" && url.pathname === "/api/wallet/config") {
|
|
4148
|
+
sendJson(req, res, 200, emptyWalletConfig);
|
|
1229
4149
|
return;
|
|
1230
4150
|
}
|
|
1231
4151
|
|
|
1232
|
-
if (req.method === "
|
|
1233
|
-
|
|
4152
|
+
if (req.method === "PUT" && url.pathname === "/api/wallet/config") {
|
|
4153
|
+
const body = (await readJsonBody(req)) || {};
|
|
4154
|
+
sendJson(req, res, 200, {
|
|
4155
|
+
...emptyWalletConfig,
|
|
4156
|
+
selectedRpcProviders:
|
|
4157
|
+
body && typeof body === "object" && "selections" in body
|
|
4158
|
+
? body.selections
|
|
4159
|
+
: emptyWalletConfig.selectedRpcProviders,
|
|
4160
|
+
});
|
|
1234
4161
|
return;
|
|
1235
4162
|
}
|
|
1236
4163
|
|
|
1237
|
-
if (req.method === "GET" && url.pathname === "/api/
|
|
4164
|
+
if (req.method === "GET" && url.pathname === "/api/wallet/keys") {
|
|
1238
4165
|
sendJson(req, res, 200, {
|
|
1239
|
-
|
|
1240
|
-
|
|
4166
|
+
evmPrivateKeySet: true,
|
|
4167
|
+
solanaPrivateKeySet: true,
|
|
4168
|
+
evmAddress: "0x1234567890abcdef1234567890abcdef12345678",
|
|
4169
|
+
solanaAddress: "So11111111111111111111111111111111111111112",
|
|
1241
4170
|
});
|
|
1242
4171
|
return;
|
|
1243
4172
|
}
|
|
1244
4173
|
|
|
1245
|
-
if (req.method === "GET" && url.pathname === "/api/
|
|
1246
|
-
sendJson(req, res, 200, {
|
|
4174
|
+
if (req.method === "GET" && url.pathname === "/api/wallet/os-store") {
|
|
4175
|
+
sendJson(req, res, 200, {
|
|
4176
|
+
available: true,
|
|
4177
|
+
backend: "in-house",
|
|
4178
|
+
evmKeyInOsStore: true,
|
|
4179
|
+
solanaKeyInOsStore: true,
|
|
4180
|
+
envKeysPresent: false,
|
|
4181
|
+
});
|
|
1247
4182
|
return;
|
|
1248
4183
|
}
|
|
1249
4184
|
|
|
1250
|
-
if (req.method === "
|
|
4185
|
+
if (req.method === "POST" && url.pathname === "/api/wallet/os-store") {
|
|
4186
|
+
const body = (await readJsonBody(req)) || {};
|
|
4187
|
+
sendJson(req, res, 200, { ok: true, action: body.action ?? null });
|
|
4188
|
+
return;
|
|
4189
|
+
}
|
|
4190
|
+
|
|
4191
|
+
if (req.method === "POST" && url.pathname === "/api/wallet/refresh-cloud") {
|
|
1251
4192
|
sendJson(req, res, 200, {
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
offset: parsePositiveInt(url.searchParams.get("offset"), 0),
|
|
4193
|
+
ok: true,
|
|
4194
|
+
imported: [],
|
|
4195
|
+
warnings: [],
|
|
1256
4196
|
});
|
|
1257
4197
|
return;
|
|
1258
4198
|
}
|
|
1259
4199
|
|
|
1260
|
-
if (req.method === "
|
|
1261
|
-
|
|
4200
|
+
if (req.method === "POST" && url.pathname === "/api/wallet/primary") {
|
|
4201
|
+
const body = (await readJsonBody(req)) || {};
|
|
4202
|
+
sendJson(req, res, 200, { ok: true, ...body });
|
|
1262
4203
|
return;
|
|
1263
4204
|
}
|
|
1264
4205
|
|
|
1265
|
-
if (req.method === "
|
|
1266
|
-
|
|
4206
|
+
if (req.method === "POST" && url.pathname === "/api/wallet/generate") {
|
|
4207
|
+
const body = (await readJsonBody(req)) || {};
|
|
4208
|
+
sendJson(req, res, 200, {
|
|
4209
|
+
ok: true,
|
|
4210
|
+
chain: body.chain ?? "evm",
|
|
4211
|
+
source: body.source ?? "local",
|
|
4212
|
+
address:
|
|
4213
|
+
body.chain === "solana"
|
|
4214
|
+
? "So11111111111111111111111111111111111111112"
|
|
4215
|
+
: "0x1234567890abcdef1234567890abcdef12345678",
|
|
4216
|
+
});
|
|
4217
|
+
return;
|
|
4218
|
+
}
|
|
4219
|
+
|
|
4220
|
+
if (req.method === "POST" && url.pathname === "/api/wallet/export") {
|
|
4221
|
+
await readJsonBody(req);
|
|
4222
|
+
sendJson(req, res, 200, {
|
|
4223
|
+
evmPrivateKey:
|
|
4224
|
+
"0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
|
|
4225
|
+
solanaPrivateKey: "5HueCGU8rMjxEXxiPuD5BDuRa",
|
|
4226
|
+
});
|
|
4227
|
+
return;
|
|
4228
|
+
}
|
|
4229
|
+
|
|
4230
|
+
if (
|
|
4231
|
+
req.method === "POST" &&
|
|
4232
|
+
url.pathname === "/api/wallet/production-defaults"
|
|
4233
|
+
) {
|
|
4234
|
+
await readJsonBody(req);
|
|
4235
|
+
sendJson(req, res, 200, {
|
|
4236
|
+
ok: true,
|
|
4237
|
+
updated: true,
|
|
4238
|
+
warnings: [],
|
|
4239
|
+
});
|
|
1267
4240
|
return;
|
|
1268
4241
|
}
|
|
1269
4242
|
|
|
@@ -1535,6 +4508,97 @@ const server = http.createServer(async (req, res) => {
|
|
|
1535
4508
|
return;
|
|
1536
4509
|
}
|
|
1537
4510
|
|
|
4511
|
+
if (await handleDemoOrchestratorRoute(req, res, url)) {
|
|
4512
|
+
return;
|
|
4513
|
+
}
|
|
4514
|
+
|
|
4515
|
+
if (req.method === "GET" && url.pathname === "/api/orchestrator/status") {
|
|
4516
|
+
sendJson(req, res, 200, emptyOrchestratorStatus());
|
|
4517
|
+
return;
|
|
4518
|
+
}
|
|
4519
|
+
|
|
4520
|
+
if (req.method === "GET" && url.pathname === "/api/orchestrator/tasks") {
|
|
4521
|
+
sendJson(req, res, 200, { tasks: [] });
|
|
4522
|
+
return;
|
|
4523
|
+
}
|
|
4524
|
+
|
|
4525
|
+
const orchestratorTaskMatch =
|
|
4526
|
+
/^\/api\/orchestrator\/tasks\/([^/]+)(?:\/([^/]+))?$/.exec(url.pathname);
|
|
4527
|
+
if (orchestratorTaskMatch) {
|
|
4528
|
+
const [, taskId, action] = orchestratorTaskMatch;
|
|
4529
|
+
if (req.method === "GET" && action === "messages") {
|
|
4530
|
+
sendJson(req, res, 200, { items: [], nextCursor: null });
|
|
4531
|
+
return;
|
|
4532
|
+
}
|
|
4533
|
+
if (req.method === "GET" && action === "events") {
|
|
4534
|
+
sendJson(req, res, 200, { items: [], nextCursor: null });
|
|
4535
|
+
return;
|
|
4536
|
+
}
|
|
4537
|
+
if (req.method === "GET" && action === "timeline") {
|
|
4538
|
+
sendJson(req, res, 200, { items: [], nextCursor: null });
|
|
4539
|
+
return;
|
|
4540
|
+
}
|
|
4541
|
+
if (req.method === "GET" && action === "usage") {
|
|
4542
|
+
sendJson(req, res, 200, emptyOrchestratorUsage);
|
|
4543
|
+
return;
|
|
4544
|
+
}
|
|
4545
|
+
if (req.method === "GET" && !action) {
|
|
4546
|
+
sendJson(req, res, 404, { error: `Task not found: ${taskId}` });
|
|
4547
|
+
return;
|
|
4548
|
+
}
|
|
4549
|
+
if (req.method === "POST") {
|
|
4550
|
+
sendJson(req, res, 200, { ok: true, id: taskId });
|
|
4551
|
+
return;
|
|
4552
|
+
}
|
|
4553
|
+
}
|
|
4554
|
+
|
|
4555
|
+
if (req.method === "GET" && url.pathname === "/api/trajectories/stats") {
|
|
4556
|
+
sendJson(req, res, 200, {
|
|
4557
|
+
totalTrajectories: 0,
|
|
4558
|
+
totalLlmCalls: 0,
|
|
4559
|
+
totalProviderAccesses: 0,
|
|
4560
|
+
totalPromptTokens: 0,
|
|
4561
|
+
totalCompletionTokens: 0,
|
|
4562
|
+
averageDurationMs: 0,
|
|
4563
|
+
bySource: {},
|
|
4564
|
+
byModel: {},
|
|
4565
|
+
});
|
|
4566
|
+
return;
|
|
4567
|
+
}
|
|
4568
|
+
|
|
4569
|
+
if (req.method === "GET" && url.pathname === "/api/trajectories/config") {
|
|
4570
|
+
sendJson(req, res, 200, { enabled: false });
|
|
4571
|
+
return;
|
|
4572
|
+
}
|
|
4573
|
+
|
|
4574
|
+
if (req.method === "GET" && url.pathname === "/api/trajectories/latest") {
|
|
4575
|
+
sendJson(req, res, 200, { trajectory: null });
|
|
4576
|
+
return;
|
|
4577
|
+
}
|
|
4578
|
+
|
|
4579
|
+
if (req.method === "GET" && url.pathname === "/api/trajectories") {
|
|
4580
|
+
sendJson(req, res, 200, emptyTrajectoryList(url));
|
|
4581
|
+
return;
|
|
4582
|
+
}
|
|
4583
|
+
|
|
4584
|
+
const trajectoryDetailMatch = /^\/api\/trajectories\/([^/]+)$/.exec(
|
|
4585
|
+
url.pathname,
|
|
4586
|
+
);
|
|
4587
|
+
if (req.method === "GET" && trajectoryDetailMatch) {
|
|
4588
|
+
sendJson(req, res, 200, {
|
|
4589
|
+
trajectory: {
|
|
4590
|
+
id: decodeURIComponent(trajectoryDetailMatch[1] ?? "unknown"),
|
|
4591
|
+
status: "completed",
|
|
4592
|
+
llmCallCount: 0,
|
|
4593
|
+
},
|
|
4594
|
+
llmCalls: [],
|
|
4595
|
+
providerAccesses: [],
|
|
4596
|
+
toolEvents: [],
|
|
4597
|
+
evaluationEvents: [],
|
|
4598
|
+
});
|
|
4599
|
+
return;
|
|
4600
|
+
}
|
|
4601
|
+
|
|
1538
4602
|
if (req.method === "GET" && url.pathname === "/api/coding-agents/preflight") {
|
|
1539
4603
|
sendJson(req, res, 200, {
|
|
1540
4604
|
ok: true,
|
|
@@ -1565,6 +4629,43 @@ const server = http.createServer(async (req, res) => {
|
|
|
1565
4629
|
return;
|
|
1566
4630
|
}
|
|
1567
4631
|
|
|
4632
|
+
if (req.method === "GET" && url.pathname === "/api/extension/status") {
|
|
4633
|
+
sendJson(req, res, 200, {
|
|
4634
|
+
installed: false,
|
|
4635
|
+
connected: false,
|
|
4636
|
+
relayReachable: false,
|
|
4637
|
+
relayPort: 0,
|
|
4638
|
+
extensionPath: null,
|
|
4639
|
+
chromeBuildPath: null,
|
|
4640
|
+
chromePackagePath: null,
|
|
4641
|
+
safariWebExtensionPath: null,
|
|
4642
|
+
safariAppPath: null,
|
|
4643
|
+
safariPackagePath: null,
|
|
4644
|
+
releaseManifest: null,
|
|
4645
|
+
});
|
|
4646
|
+
return;
|
|
4647
|
+
}
|
|
4648
|
+
|
|
4649
|
+
if (
|
|
4650
|
+
(req.method === "GET" || req.method === "POST") &&
|
|
4651
|
+
url.pathname === "/api/training/auto/config"
|
|
4652
|
+
) {
|
|
4653
|
+
sendJson(req, res, 200, {
|
|
4654
|
+
config: {
|
|
4655
|
+
autoTrain: false,
|
|
4656
|
+
triggerThreshold: 20,
|
|
4657
|
+
triggerCooldownHours: 24,
|
|
4658
|
+
backends: [],
|
|
4659
|
+
},
|
|
4660
|
+
});
|
|
4661
|
+
return;
|
|
4662
|
+
}
|
|
4663
|
+
|
|
4664
|
+
if (req.method === "GET" && url.pathname === "/api/training/auto/status") {
|
|
4665
|
+
sendJson(req, res, 200, { serviceRegistered: false });
|
|
4666
|
+
return;
|
|
4667
|
+
}
|
|
4668
|
+
|
|
1568
4669
|
if (req.method === "GET" && url.pathname === "/api/lifeops/overview") {
|
|
1569
4670
|
sendJson(req, res, 200, emptyLifeOpsOverview);
|
|
1570
4671
|
return;
|
|
@@ -1585,6 +4686,41 @@ const server = http.createServer(async (req, res) => {
|
|
|
1585
4686
|
return;
|
|
1586
4687
|
}
|
|
1587
4688
|
|
|
4689
|
+
// Decomposed domain-view read routes — return 200-empty so the views render
|
|
4690
|
+
// their EMPTY state (not the catch-all 501 error state) in the visual smoke.
|
|
4691
|
+
if (req.method === "GET" && url.pathname === "/api/lifeops/goals") {
|
|
4692
|
+
sendJson(req, res, 200, { goals: [] });
|
|
4693
|
+
return;
|
|
4694
|
+
}
|
|
4695
|
+
if (req.method === "GET" && url.pathname === "/api/lifeops/relationships") {
|
|
4696
|
+
sendJson(req, res, 200, { relationships: [], entities: [] });
|
|
4697
|
+
return;
|
|
4698
|
+
}
|
|
4699
|
+
if (req.method === "GET" && url.pathname === "/api/lifeops/money/dashboard") {
|
|
4700
|
+
sendJson(req, res, 200, {
|
|
4701
|
+
balanceUsd: 0,
|
|
4702
|
+
sources: [],
|
|
4703
|
+
recentTransactions: [],
|
|
4704
|
+
recurringCharges: [],
|
|
4705
|
+
spendByCategory: [],
|
|
4706
|
+
});
|
|
4707
|
+
return;
|
|
4708
|
+
}
|
|
4709
|
+
if (
|
|
4710
|
+
req.method === "GET" &&
|
|
4711
|
+
(url.pathname === "/api/lifeops/money/sources" ||
|
|
4712
|
+
url.pathname === "/api/lifeops/money/transactions" ||
|
|
4713
|
+
url.pathname === "/api/lifeops/money/recurring")
|
|
4714
|
+
) {
|
|
4715
|
+
const key = url.pathname.endsWith("sources")
|
|
4716
|
+
? "sources"
|
|
4717
|
+
: url.pathname.endsWith("transactions")
|
|
4718
|
+
? "transactions"
|
|
4719
|
+
: "recurringCharges";
|
|
4720
|
+
sendJson(req, res, 200, { [key]: [] });
|
|
4721
|
+
return;
|
|
4722
|
+
}
|
|
4723
|
+
|
|
1588
4724
|
if (
|
|
1589
4725
|
req.method === "GET" &&
|
|
1590
4726
|
url.pathname === "/api/lifeops/screen-time/summary"
|
|
@@ -1667,6 +4803,82 @@ const server = http.createServer(async (req, res) => {
|
|
|
1667
4803
|
return;
|
|
1668
4804
|
}
|
|
1669
4805
|
|
|
4806
|
+
if (req.method === "GET" && url.pathname === "/api/apps/permissions") {
|
|
4807
|
+
sendJson(req, res, 200, []);
|
|
4808
|
+
return;
|
|
4809
|
+
}
|
|
4810
|
+
|
|
4811
|
+
const appPermissionsMatch = /^\/api\/apps\/permissions\/([^/]+)$/.exec(
|
|
4812
|
+
url.pathname,
|
|
4813
|
+
);
|
|
4814
|
+
if (appPermissionsMatch) {
|
|
4815
|
+
const slug = decodeURIComponent(appPermissionsMatch[1]);
|
|
4816
|
+
if (req.method === "GET") {
|
|
4817
|
+
sendJson(req, res, 200, {
|
|
4818
|
+
slug,
|
|
4819
|
+
displayName: slug,
|
|
4820
|
+
requestedNamespaces: [],
|
|
4821
|
+
grantedNamespaces: [],
|
|
4822
|
+
});
|
|
4823
|
+
return;
|
|
4824
|
+
}
|
|
4825
|
+
if (req.method === "PUT") {
|
|
4826
|
+
const body = (await readJsonBody(req)) || {};
|
|
4827
|
+
sendJson(req, res, 200, {
|
|
4828
|
+
slug,
|
|
4829
|
+
displayName: slug,
|
|
4830
|
+
requestedNamespaces: [],
|
|
4831
|
+
grantedNamespaces: Array.isArray(body.namespaces)
|
|
4832
|
+
? body.namespaces
|
|
4833
|
+
: [],
|
|
4834
|
+
});
|
|
4835
|
+
return;
|
|
4836
|
+
}
|
|
4837
|
+
}
|
|
4838
|
+
|
|
4839
|
+
if (url.pathname === "/api/apps/favorites") {
|
|
4840
|
+
if (req.method === "GET") {
|
|
4841
|
+
sendJson(req, res, 200, { favoriteApps: smokeFavoriteApps });
|
|
4842
|
+
return;
|
|
4843
|
+
}
|
|
4844
|
+
|
|
4845
|
+
if (req.method === "PUT") {
|
|
4846
|
+
const body = (await readJsonBody(req)) || {};
|
|
4847
|
+
const appName =
|
|
4848
|
+
typeof body.appName === "string" ? body.appName.trim() : "";
|
|
4849
|
+
if (appName) {
|
|
4850
|
+
const next = new Set(smokeFavoriteApps);
|
|
4851
|
+
if (body.isFavorite === false) {
|
|
4852
|
+
next.delete(appName);
|
|
4853
|
+
} else {
|
|
4854
|
+
next.add(appName);
|
|
4855
|
+
}
|
|
4856
|
+
smokeFavoriteApps = [...next];
|
|
4857
|
+
}
|
|
4858
|
+
sendJson(req, res, 200, { favoriteApps: smokeFavoriteApps });
|
|
4859
|
+
return;
|
|
4860
|
+
}
|
|
4861
|
+
}
|
|
4862
|
+
|
|
4863
|
+
if (req.method === "POST" && url.pathname === "/api/apps/favorites/replace") {
|
|
4864
|
+
const body = (await readJsonBody(req)) || {};
|
|
4865
|
+
smokeFavoriteApps = Array.isArray(body.favoriteAppNames)
|
|
4866
|
+
? body.favoriteAppNames.filter((name) => typeof name === "string")
|
|
4867
|
+
: [];
|
|
4868
|
+
sendJson(req, res, 200, { favoriteApps: smokeFavoriteApps });
|
|
4869
|
+
return;
|
|
4870
|
+
}
|
|
4871
|
+
|
|
4872
|
+
if (req.method === "POST" && url.pathname === "/api/apps/overlay-presence") {
|
|
4873
|
+
const body = (await readJsonBody(req)) || {};
|
|
4874
|
+
sendJson(req, res, 200, {
|
|
4875
|
+
ok: true,
|
|
4876
|
+
app: typeof body.app === "string" ? body.app : null,
|
|
4877
|
+
present: body.present === true,
|
|
4878
|
+
});
|
|
4879
|
+
return;
|
|
4880
|
+
}
|
|
4881
|
+
|
|
1670
4882
|
if (req.method === "GET" && url.pathname === "/api/skills") {
|
|
1671
4883
|
sendJson(req, res, 200, emptySkillsResponse);
|
|
1672
4884
|
return;
|
|
@@ -1677,6 +4889,50 @@ const server = http.createServer(async (req, res) => {
|
|
|
1677
4889
|
return;
|
|
1678
4890
|
}
|
|
1679
4891
|
|
|
4892
|
+
if (req.method === "GET" && url.pathname === "/api/skills/curated") {
|
|
4893
|
+
sendJson(req, res, 200, { skills: [] });
|
|
4894
|
+
return;
|
|
4895
|
+
}
|
|
4896
|
+
|
|
4897
|
+
if (
|
|
4898
|
+
(req.method === "POST" || req.method === "DELETE") &&
|
|
4899
|
+
url.pathname.startsWith("/api/skills/curated/")
|
|
4900
|
+
) {
|
|
4901
|
+
sendJson(req, res, 200, { ok: true });
|
|
4902
|
+
return;
|
|
4903
|
+
}
|
|
4904
|
+
|
|
4905
|
+
if (req.method === "GET" && url.pathname === "/api/skills/catalog") {
|
|
4906
|
+
sendJson(req, res, 200, {
|
|
4907
|
+
total: 0,
|
|
4908
|
+
page: Number(url.searchParams.get("page") ?? 1),
|
|
4909
|
+
perPage: Number(url.searchParams.get("perPage") ?? 50),
|
|
4910
|
+
totalPages: 0,
|
|
4911
|
+
installedCount: 0,
|
|
4912
|
+
skills: [],
|
|
4913
|
+
});
|
|
4914
|
+
return;
|
|
4915
|
+
}
|
|
4916
|
+
|
|
4917
|
+
if (req.method === "GET" && url.pathname === "/api/skills/catalog/search") {
|
|
4918
|
+
sendJson(req, res, 200, {
|
|
4919
|
+
query: url.searchParams.get("q") ?? "",
|
|
4920
|
+
count: 0,
|
|
4921
|
+
results: [],
|
|
4922
|
+
});
|
|
4923
|
+
return;
|
|
4924
|
+
}
|
|
4925
|
+
|
|
4926
|
+
if (req.method === "GET" && url.pathname.startsWith("/api/skills/catalog/")) {
|
|
4927
|
+
sendJson(req, res, 404, { error: "Skill not found" });
|
|
4928
|
+
return;
|
|
4929
|
+
}
|
|
4930
|
+
|
|
4931
|
+
if (req.method === "POST" && url.pathname === "/api/skills/catalog/refresh") {
|
|
4932
|
+
sendJson(req, res, 200, { ok: true, count: 0 });
|
|
4933
|
+
return;
|
|
4934
|
+
}
|
|
4935
|
+
|
|
1680
4936
|
if (
|
|
1681
4937
|
req.method === "GET" &&
|
|
1682
4938
|
url.pathname === "/api/skills/marketplace/search"
|
|
@@ -1704,7 +4960,9 @@ const server = http.createServer(async (req, res) => {
|
|
|
1704
4960
|
if (
|
|
1705
4961
|
req.method === "POST" &&
|
|
1706
4962
|
(url.pathname === "/api/skills/marketplace/install" ||
|
|
1707
|
-
url.pathname === "/api/skills/marketplace/uninstall"
|
|
4963
|
+
url.pathname === "/api/skills/marketplace/uninstall" ||
|
|
4964
|
+
url.pathname === "/api/skills/catalog/install" ||
|
|
4965
|
+
url.pathname === "/api/skills/catalog/uninstall")
|
|
1708
4966
|
) {
|
|
1709
4967
|
sendJson(req, res, 200, { ok: true });
|
|
1710
4968
|
return;
|
|
@@ -1720,11 +4978,67 @@ const server = http.createServer(async (req, res) => {
|
|
|
1720
4978
|
return;
|
|
1721
4979
|
}
|
|
1722
4980
|
|
|
4981
|
+
if (
|
|
4982
|
+
req.method === "GET" &&
|
|
4983
|
+
url.pathname === "/api/apps/screenshare/capabilities"
|
|
4984
|
+
) {
|
|
4985
|
+
sendJson(req, res, 200, {
|
|
4986
|
+
platform: "smoke",
|
|
4987
|
+
capabilities: {
|
|
4988
|
+
screenshot: { available: true, tool: "screencapture" },
|
|
4989
|
+
headfulGui: { available: true, tool: "browser" },
|
|
4990
|
+
keyboard: { available: false, tool: "computer-use" },
|
|
4991
|
+
},
|
|
4992
|
+
});
|
|
4993
|
+
return;
|
|
4994
|
+
}
|
|
4995
|
+
|
|
4996
|
+
if (
|
|
4997
|
+
req.method === "GET" &&
|
|
4998
|
+
url.pathname === "/api/apps/screenshare/sessions"
|
|
4999
|
+
) {
|
|
5000
|
+
sendJson(req, res, 200, {
|
|
5001
|
+
sessions: [
|
|
5002
|
+
{
|
|
5003
|
+
id: "smoke-session",
|
|
5004
|
+
label: "Smoke session",
|
|
5005
|
+
status: "active",
|
|
5006
|
+
createdAt: SMOKE_GENERATED_AT,
|
|
5007
|
+
updatedAt: SMOKE_GENERATED_AT,
|
|
5008
|
+
stoppedAt: null,
|
|
5009
|
+
platform: "smoke",
|
|
5010
|
+
frameCount: 1,
|
|
5011
|
+
inputCount: 0,
|
|
5012
|
+
lastFrameAt: SMOKE_GENERATED_AT,
|
|
5013
|
+
lastInputAt: null,
|
|
5014
|
+
},
|
|
5015
|
+
],
|
|
5016
|
+
});
|
|
5017
|
+
return;
|
|
5018
|
+
}
|
|
5019
|
+
|
|
1723
5020
|
if (req.method === "GET" && url.pathname === "/api/logs") {
|
|
1724
5021
|
sendJson(req, res, 200, stubLogsResponse);
|
|
1725
5022
|
return;
|
|
1726
5023
|
}
|
|
1727
5024
|
|
|
5025
|
+
if (
|
|
5026
|
+
req.method === "GET" &&
|
|
5027
|
+
url.pathname === "/api/__ui-smoke/unhandled-requests"
|
|
5028
|
+
) {
|
|
5029
|
+
sendJson(req, res, 200, { requests: unhandledApiRequests });
|
|
5030
|
+
return;
|
|
5031
|
+
}
|
|
5032
|
+
|
|
5033
|
+
if (
|
|
5034
|
+
req.method === "POST" &&
|
|
5035
|
+
url.pathname === "/api/__ui-smoke/unhandled-requests/reset"
|
|
5036
|
+
) {
|
|
5037
|
+
unhandledApiRequests.length = 0;
|
|
5038
|
+
sendJson(req, res, 200, { ok: true });
|
|
5039
|
+
return;
|
|
5040
|
+
}
|
|
5041
|
+
|
|
1728
5042
|
if (req.method === "GET" && url.pathname.startsWith("/api/apps/info/")) {
|
|
1729
5043
|
sendJson(req, res, 404, { error: "App not found" });
|
|
1730
5044
|
return;
|
|
@@ -1758,16 +5072,87 @@ const server = http.createServer(async (req, res) => {
|
|
|
1758
5072
|
return;
|
|
1759
5073
|
}
|
|
1760
5074
|
|
|
5075
|
+
if (req.method === "GET" && url.pathname === "/api/i18n/locale") {
|
|
5076
|
+
// Mirror the real public language-suggestion route
|
|
5077
|
+
// (packages/app-core/src/api/i18n-locale-routes.ts). The SPA polls this on
|
|
5078
|
+
// first paint; without it the stub's catch-all 501 spams console.error.
|
|
5079
|
+
sendJson(req, res, 200, { language: "en" });
|
|
5080
|
+
return;
|
|
5081
|
+
}
|
|
5082
|
+
|
|
5083
|
+
if (req.method === "POST" && url.pathname === "/api/suggestions") {
|
|
5084
|
+
// Mirror the real prompt-suggestion route
|
|
5085
|
+
// (packages/agent/src/api/suggestions-routes.ts). The continuous-chat
|
|
5086
|
+
// overlay's resting composer strip POSTs here to upgrade its static
|
|
5087
|
+
// suggestions to a model-backed set; with no model the real route returns
|
|
5088
|
+
// an empty set and the overlay keeps its deterministic offline fallback.
|
|
5089
|
+
// Returning the same empty set keeps the strip's static pills and avoids
|
|
5090
|
+
// the catch-all 501 the diagnostics guard would otherwise flag.
|
|
5091
|
+
await drainRequest(req);
|
|
5092
|
+
sendJson(req, res, 200, { suggestions: [] });
|
|
5093
|
+
return;
|
|
5094
|
+
}
|
|
5095
|
+
|
|
5096
|
+
if (
|
|
5097
|
+
req.method === "GET" &&
|
|
5098
|
+
url.pathname === "/api/social-alpha/leaderboard"
|
|
5099
|
+
) {
|
|
5100
|
+
// Mirror the social-alpha leaderboard route's zero-key behavior
|
|
5101
|
+
// (plugins/plugin-social-alpha/src/routes.ts): with no recommendations
|
|
5102
|
+
// recorded the real route returns an empty data array, and the view
|
|
5103
|
+
// renders its wallet-required / empty state. Returning the same shape
|
|
5104
|
+
// keeps the visual smoke deterministic and avoids the catch-all 501.
|
|
5105
|
+
sendJson(req, res, 200, { data: [] });
|
|
5106
|
+
return;
|
|
5107
|
+
}
|
|
5108
|
+
|
|
5109
|
+
if (req.method === "POST" && url.pathname === "/api/tts/first-run/speak") {
|
|
5110
|
+
// Onboarding synthesizes its scripted voice lines here and plays the bytes
|
|
5111
|
+
// as audio/wav. Return decodable silence so the live stack never logs a
|
|
5112
|
+
// 501; the real route (first-run-tts-route.ts) returns neural TTS audio.
|
|
5113
|
+
sendBinary(req, res, 200, "audio/wav", SILENT_WAV);
|
|
5114
|
+
return;
|
|
5115
|
+
}
|
|
5116
|
+
|
|
5117
|
+
// ── Local-inference voice (drives the /chat overlay's bidirectional loop) ──
|
|
5118
|
+
// The client mic capture + VAD end-of-turn are REAL (Chromium fake-audio
|
|
5119
|
+
// file); these endpoints stand in for the on-device ASR/TTS models so the
|
|
5120
|
+
// transcript-in / spoken-reply-out round trip stays deterministic.
|
|
5121
|
+
if (
|
|
5122
|
+
req.method === "GET" &&
|
|
5123
|
+
url.pathname === "/api/asr/local-inference/status"
|
|
5124
|
+
) {
|
|
5125
|
+
sendJson(req, res, 200, { ready: true, provider: "local-inference" });
|
|
5126
|
+
return;
|
|
5127
|
+
}
|
|
5128
|
+
|
|
5129
|
+
if (req.method === "POST" && url.pathname === "/api/asr/local-inference") {
|
|
5130
|
+
// The WAV body is real captured audio; we don't transcribe it, we return a
|
|
5131
|
+
// fixed phrase so the spoken turn resolves to a known message.
|
|
5132
|
+
await drainRequest(req);
|
|
5133
|
+
sendJson(req, res, 200, { text: SMOKE_VOICE_TRANSCRIPT });
|
|
5134
|
+
return;
|
|
5135
|
+
}
|
|
5136
|
+
|
|
5137
|
+
if (req.method === "POST" && url.pathname === "/api/tts/local-inference") {
|
|
5138
|
+
// Assistant reply spoken back. Decodable silence is enough — the request
|
|
5139
|
+
// itself is the bidirectional-output signal the e2e asserts on.
|
|
5140
|
+
await drainRequest(req);
|
|
5141
|
+
sendBinary(req, res, 200, "audio/wav", SILENT_WAV);
|
|
5142
|
+
return;
|
|
5143
|
+
}
|
|
5144
|
+
|
|
1761
5145
|
if (url.pathname.startsWith("/api/")) {
|
|
5146
|
+
const request = recordUnhandledApiRequest(req, url);
|
|
1762
5147
|
if (req.method === "HEAD") {
|
|
1763
|
-
sendEmpty(req, res,
|
|
1764
|
-
return;
|
|
1765
|
-
}
|
|
1766
|
-
if (req.method === "GET") {
|
|
1767
|
-
sendJson(req, res, 200, {});
|
|
5148
|
+
sendEmpty(req, res, 501);
|
|
1768
5149
|
return;
|
|
1769
5150
|
}
|
|
1770
|
-
sendJson(req, res,
|
|
5151
|
+
sendJson(req, res, 501, {
|
|
5152
|
+
error: `Unhandled UI smoke API route: ${request.method} ${request.path}`,
|
|
5153
|
+
fixture: "ui-smoke-api-stub",
|
|
5154
|
+
request,
|
|
5155
|
+
});
|
|
1771
5156
|
return;
|
|
1772
5157
|
}
|
|
1773
5158
|
|
|
@@ -1833,6 +5218,13 @@ async function shutdown() {
|
|
|
1833
5218
|
|
|
1834
5219
|
for (const signal of ["SIGINT", "SIGTERM"]) {
|
|
1835
5220
|
process.on(signal, () => {
|
|
5221
|
+
if (
|
|
5222
|
+
signal === "SIGTERM" &&
|
|
5223
|
+
process.env.ELIZA_UI_SMOKE_STUB_IGNORE_SIGTERM === "1"
|
|
5224
|
+
) {
|
|
5225
|
+
console.warn("[playwright-ui-smoke-api-stub] ignoring SIGTERM");
|
|
5226
|
+
return;
|
|
5227
|
+
}
|
|
1836
5228
|
void shutdown();
|
|
1837
5229
|
});
|
|
1838
5230
|
}
|