neoagent 2.3.1-beta.6 → 2.3.1-beta.60
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/.env.example +45 -0
- package/docs/capabilities.md +2 -2
- package/docs/configuration.md +6 -5
- package/docs/hardware.md +1 -1
- package/docs/integrations.md +2 -3
- package/flutter_app/.metadata +42 -0
- package/flutter_app/README.md +21 -0
- package/flutter_app/analysis_options.yaml +32 -0
- package/flutter_app/android/app/build.gradle.kts +111 -0
- package/flutter_app/android/app/src/debug/AndroidManifest.xml +7 -0
- package/flutter_app/android/app/src/main/AndroidManifest.xml +171 -0
- package/flutter_app/android/app/src/main/kotlin/com/neoagent/flutter_app/MainActivity.kt +804 -0
- package/flutter_app/android/app/src/main/kotlin/com/neoagent/flutter_app/auto/NeoAgentCarAppService.kt +114 -0
- package/flutter_app/android/app/src/main/kotlin/com/neoagent/flutter_app/health/HealthConnectGateway.kt +280 -0
- package/flutter_app/android/app/src/main/kotlin/com/neoagent/flutter_app/health/HealthSyncNotifications.kt +113 -0
- package/flutter_app/android/app/src/main/kotlin/com/neoagent/flutter_app/health/HealthSyncPayload.kt +57 -0
- package/flutter_app/android/app/src/main/kotlin/com/neoagent/flutter_app/health/HealthSyncScheduler.kt +78 -0
- package/flutter_app/android/app/src/main/kotlin/com/neoagent/flutter_app/health/HealthSyncWorker.kt +253 -0
- package/flutter_app/android/app/src/main/kotlin/com/neoagent/flutter_app/health/PermissionsRationaleActivity.kt +46 -0
- package/flutter_app/android/app/src/main/kotlin/com/neoagent/flutter_app/recording/RecordingBootReceiver.kt +21 -0
- package/flutter_app/android/app/src/main/kotlin/com/neoagent/flutter_app/recording/RecordingForegroundService.kt +586 -0
- package/flutter_app/android/app/src/main/kotlin/com/neoagent/flutter_app/recording/RecordingStateStore.kt +78 -0
- package/flutter_app/android/app/src/main/kotlin/com/neoagent/flutter_app/recording/RecordingUploadClient.kt +104 -0
- package/flutter_app/android/app/src/main/kotlin/com/neoagent/flutter_app/telecom/NeoAgentConnection.kt +118 -0
- package/flutter_app/android/app/src/main/kotlin/com/neoagent/flutter_app/telecom/NeoAgentConnectionService.kt +86 -0
- package/flutter_app/android/app/src/main/kotlin/com/neoagent/flutter_app/widgets/AiHomeWidgetProvider.kt +457 -0
- package/flutter_app/android/app/src/main/kotlin/com/neoagent/flutter_app/widgets/AiWidgetStore.kt +194 -0
- package/flutter_app/android/app/src/main/kotlin/com/neoagent/flutter_app/widgets/VoiceLaunchWidgetProvider.kt +67 -0
- package/flutter_app/android/app/src/main/kotlin/com/neoagent/flutter_app/widgets/WidgetConfigActivity.kt +228 -0
- package/flutter_app/android/app/src/main/kotlin/com/neoagent/flutter_app/widgets/WidgetSyncScheduler.kt +72 -0
- package/flutter_app/android/app/src/main/kotlin/com/neoagent/flutter_app/widgets/WidgetSyncWorker.kt +186 -0
- package/flutter_app/android/app/src/main/kotlin/com/neoagent/flutter_app/widgets/WidgetTaskRunWorker.kt +210 -0
- package/flutter_app/android/app/src/main/res/drawable/launch_background.xml +12 -0
- package/flutter_app/android/app/src/main/res/drawable/neoagent_ai_widget_bg.xml +11 -0
- package/flutter_app/android/app/src/main/res/drawable/neoagent_ai_widget_task_bg.xml +8 -0
- package/flutter_app/android/app/src/main/res/drawable-v21/launch_background.xml +12 -0
- package/flutter_app/android/app/src/main/res/layout/neoagent_ai_widget.xml +138 -0
- package/flutter_app/android/app/src/main/res/layout/neoagent_ai_widget_task_row.xml +52 -0
- package/flutter_app/android/app/src/main/res/layout/neoagent_voice_widget.xml +49 -0
- package/flutter_app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/flutter_app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/flutter_app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/flutter_app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/flutter_app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/flutter_app/android/app/src/main/res/values/arrays.xml +8 -0
- package/flutter_app/android/app/src/main/res/values/strings.xml +12 -0
- package/flutter_app/android/app/src/main/res/values/styles.xml +18 -0
- package/flutter_app/android/app/src/main/res/values-night/styles.xml +18 -0
- package/flutter_app/android/app/src/main/res/xml/automotive_app_desc.xml +4 -0
- package/flutter_app/android/app/src/main/res/xml/file_paths.xml +6 -0
- package/flutter_app/android/app/src/main/res/xml/neoagent_ai_widget_info.xml +12 -0
- package/flutter_app/android/app/src/main/res/xml/neoagent_voice_widget_info.xml +12 -0
- package/flutter_app/android/app/src/profile/AndroidManifest.xml +7 -0
- package/flutter_app/android/build.gradle.kts +24 -0
- package/flutter_app/android/ci-release.keystore +0 -0
- package/flutter_app/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/flutter_app/android/gradle.properties +3 -0
- package/flutter_app/android/key.properties +4 -0
- package/flutter_app/android/settings.gradle.kts +26 -0
- package/flutter_app/assets/branding/app_icon_1024.png +0 -0
- package/flutter_app/assets/branding/app_icon_128.png +0 -0
- package/flutter_app/assets/branding/app_icon_192.png +0 -0
- package/flutter_app/assets/branding/app_icon_256.png +0 -0
- package/flutter_app/assets/branding/app_icon_32.png +0 -0
- package/flutter_app/assets/branding/app_icon_512.png +0 -0
- package/flutter_app/assets/branding/app_icon_64.png +0 -0
- package/flutter_app/assets/branding/onboarding_intro.mp4 +0 -0
- package/flutter_app/assets/branding/tray_icon_template.png +0 -0
- package/flutter_app/lib/features/location/location_service.dart +119 -0
- package/flutter_app/lib/features/notifications/notification_interceptor.dart +97 -0
- package/flutter_app/lib/features/onboarding/onboarding_chrome.dart +569 -0
- package/flutter_app/lib/features/onboarding/onboarding_messaging_step.dart +157 -0
- package/flutter_app/lib/features/onboarding/onboarding_model_step.dart +233 -0
- package/flutter_app/lib/features/onboarding/onboarding_shell.dart +57 -0
- package/flutter_app/lib/features/onboarding/onboarding_video_step.dart +218 -0
- package/flutter_app/lib/features/onboarding/onboarding_welcome_step.dart +46 -0
- package/flutter_app/lib/main.dart +103 -0
- package/flutter_app/lib/main_account_settings.dart +1250 -0
- package/flutter_app/lib/main_admin.dart +886 -0
- package/flutter_app/lib/main_app_shell.dart +2134 -0
- package/flutter_app/lib/main_chat.dart +3316 -0
- package/flutter_app/lib/main_controller.dart +6836 -0
- package/flutter_app/lib/main_devices.dart +2396 -0
- package/flutter_app/lib/main_integrations.dart +909 -0
- package/flutter_app/lib/main_launcher.dart +959 -0
- package/flutter_app/lib/main_launcher_entry.dart +5 -0
- package/flutter_app/lib/main_models.dart +3539 -0
- package/flutter_app/lib/main_navigation.dart +188 -0
- package/flutter_app/lib/main_operations.dart +4851 -0
- package/flutter_app/lib/main_recordings.dart +920 -0
- package/flutter_app/lib/main_runtime.dart +838 -0
- package/flutter_app/lib/main_settings.dart +2040 -0
- package/flutter_app/lib/main_shared.dart +3147 -0
- package/flutter_app/lib/main_theme.dart +257 -0
- package/flutter_app/lib/main_voice_assistant.dart +957 -0
- package/flutter_app/lib/src/android_apk_drop_zone.dart +32 -0
- package/flutter_app/lib/src/android_apk_drop_zone_stub.dart +16 -0
- package/flutter_app/lib/src/android_apk_drop_zone_web.dart +348 -0
- package/flutter_app/lib/src/android_app_installer.dart +22 -0
- package/flutter_app/lib/src/android_app_installer_io.dart +122 -0
- package/flutter_app/lib/src/android_app_installer_stub.dart +21 -0
- package/flutter_app/lib/src/android_auto_bridge.dart +59 -0
- package/flutter_app/lib/src/android_launcher_bridge.dart +239 -0
- package/flutter_app/lib/src/app_launch_bridge.dart +29 -0
- package/flutter_app/lib/src/app_release_updater.dart +511 -0
- package/flutter_app/lib/src/backend_client.dart +1837 -0
- package/flutter_app/lib/src/desktop_companion.dart +2 -0
- package/flutter_app/lib/src/desktop_companion_actions.dart +586 -0
- package/flutter_app/lib/src/desktop_companion_io.dart +538 -0
- package/flutter_app/lib/src/desktop_companion_stub.dart +59 -0
- package/flutter_app/lib/src/desktop_native_bridge.dart +91 -0
- package/flutter_app/lib/src/desktop_screen_capture.dart +21 -0
- package/flutter_app/lib/src/desktop_screen_capture_io.dart +142 -0
- package/flutter_app/lib/src/desktop_screen_capture_stub.dart +12 -0
- package/flutter_app/lib/src/diagnostics_logger.dart +119 -0
- package/flutter_app/lib/src/health_bridge.dart +136 -0
- package/flutter_app/lib/src/live_voice_capture.dart +85 -0
- package/flutter_app/lib/src/messaging_access_summary.dart +46 -0
- package/flutter_app/lib/src/network/app_http_client.dart +53 -0
- package/flutter_app/lib/src/network/app_http_client_factory.dart +6 -0
- package/flutter_app/lib/src/network/app_http_client_io.dart +138 -0
- package/flutter_app/lib/src/network/app_http_client_stub.dart +3 -0
- package/flutter_app/lib/src/network/app_http_client_web.dart +94 -0
- package/flutter_app/lib/src/oauth_launcher.dart +33 -0
- package/flutter_app/lib/src/oauth_launcher_io.dart +95 -0
- package/flutter_app/lib/src/oauth_launcher_stub.dart +33 -0
- package/flutter_app/lib/src/oauth_launcher_web.dart +107 -0
- package/flutter_app/lib/src/recording_bridge.dart +232 -0
- package/flutter_app/lib/src/recording_bridge_io.dart +1019 -0
- package/flutter_app/lib/src/recording_bridge_stub.dart +120 -0
- package/flutter_app/lib/src/recording_bridge_web.dart +689 -0
- package/flutter_app/lib/src/recording_payloads.dart +86 -0
- package/flutter_app/lib/src/theme/palette.dart +81 -0
- package/flutter_app/lib/src/web_app_update_monitor.dart +17 -0
- package/flutter_app/lib/src/web_app_update_monitor_stub.dart +24 -0
- package/flutter_app/lib/src/web_app_update_monitor_web.dart +123 -0
- package/flutter_app/lib/src/widget_bridge.dart +49 -0
- package/flutter_app/linux/CMakeLists.txt +128 -0
- package/flutter_app/linux/flutter/CMakeLists.txt +88 -0
- package/flutter_app/linux/flutter/generated_plugin_registrant.cc +47 -0
- package/flutter_app/linux/flutter/generated_plugin_registrant.h +15 -0
- package/flutter_app/linux/flutter/generated_plugins.cmake +32 -0
- package/flutter_app/linux/runner/CMakeLists.txt +26 -0
- package/flutter_app/linux/runner/main.cc +6 -0
- package/flutter_app/linux/runner/my_application.cc +144 -0
- package/flutter_app/linux/runner/my_application.h +18 -0
- package/flutter_app/linux/runner/resources/app_icon.png +0 -0
- package/flutter_app/macos/Flutter/Flutter-Debug.xcconfig +2 -0
- package/flutter_app/macos/Flutter/Flutter-Release.xcconfig +2 -0
- package/flutter_app/macos/Flutter/GeneratedPluginRegistrant.swift +44 -0
- package/flutter_app/macos/Podfile +42 -0
- package/flutter_app/macos/Podfile.lock +87 -0
- package/flutter_app/macos/Runner/AppDelegate.swift +576 -0
- package/flutter_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +68 -0
- package/flutter_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png +0 -0
- package/flutter_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png +0 -0
- package/flutter_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png +0 -0
- package/flutter_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png +0 -0
- package/flutter_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png +0 -0
- package/flutter_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png +0 -0
- package/flutter_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png +0 -0
- package/flutter_app/macos/Runner/Base.lproj/MainMenu.xib +342 -0
- package/flutter_app/macos/Runner/Configs/AppInfo.xcconfig +14 -0
- package/flutter_app/macos/Runner/Configs/Debug.xcconfig +2 -0
- package/flutter_app/macos/Runner/Configs/Release.xcconfig +2 -0
- package/flutter_app/macos/Runner/Configs/Warnings.xcconfig +13 -0
- package/flutter_app/macos/Runner/DebugProfile.entitlements +16 -0
- package/flutter_app/macos/Runner/Info.plist +36 -0
- package/flutter_app/macos/Runner/MainFlutterWindow.swift +19 -0
- package/flutter_app/macos/Runner/Release.entitlements +12 -0
- package/flutter_app/macos/Runner.xcodeproj/project.pbxproj +801 -0
- package/flutter_app/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/flutter_app/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +99 -0
- package/flutter_app/macos/Runner.xcworkspace/contents.xcworkspacedata +10 -0
- package/flutter_app/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/flutter_app/macos/RunnerTests/RunnerTests.swift +12 -0
- package/flutter_app/patch_strings.py +12 -0
- package/flutter_app/pubspec.lock +1224 -0
- package/flutter_app/pubspec.yaml +57 -0
- package/flutter_app/test/messaging_access_summary_test.dart +22 -0
- package/flutter_app/test/recording_payloads_test.dart +53 -0
- package/flutter_app/third_party/desktop_audio_capture/LICENSE +21 -0
- package/flutter_app/third_party/desktop_audio_capture/README.md +262 -0
- package/flutter_app/third_party/desktop_audio_capture/lib/audio_capture.dart +65 -0
- package/flutter_app/third_party/desktop_audio_capture/lib/config/mic_audio_config.dart +153 -0
- package/flutter_app/third_party/desktop_audio_capture/lib/config/system_adudio_config.dart +110 -0
- package/flutter_app/third_party/desktop_audio_capture/lib/mic/mic_audio_capture.dart +461 -0
- package/flutter_app/third_party/desktop_audio_capture/lib/model/audio_status.dart +91 -0
- package/flutter_app/third_party/desktop_audio_capture/lib/model/decibel_data.dart +106 -0
- package/flutter_app/third_party/desktop_audio_capture/lib/model/input_device_type.dart +219 -0
- package/flutter_app/third_party/desktop_audio_capture/lib/system/system_audio_capture.dart +336 -0
- package/flutter_app/third_party/desktop_audio_capture/linux/CMakeLists.txt +101 -0
- package/flutter_app/third_party/desktop_audio_capture/linux/audio_capture_plugin.cc +692 -0
- package/flutter_app/third_party/desktop_audio_capture/linux/include/audio_capture/audio_capture_plugin.h +35 -0
- package/flutter_app/third_party/desktop_audio_capture/linux/include/audio_capture/mic_capture_plugin.h +36 -0
- package/flutter_app/third_party/desktop_audio_capture/linux/include/desktop_audio_capture/audio_capture_plugin.h +32 -0
- package/flutter_app/third_party/desktop_audio_capture/linux/include/desktop_audio_capture/mic_capture_plugin.h +32 -0
- package/flutter_app/third_party/desktop_audio_capture/linux/mic_capture_plugin.cc +878 -0
- package/flutter_app/third_party/desktop_audio_capture/macos/Classes/AudioCapturePlugin.swift +27 -0
- package/flutter_app/third_party/desktop_audio_capture/macos/Classes/MicCapturePlugin.swift +1172 -0
- package/flutter_app/third_party/desktop_audio_capture/macos/Classes/SystemCapturePlugin.swift +655 -0
- package/flutter_app/third_party/desktop_audio_capture/macos/Resources/PrivacyInfo.xcprivacy +12 -0
- package/flutter_app/third_party/desktop_audio_capture/macos/desktop_audio_capture.podspec +30 -0
- package/flutter_app/third_party/desktop_audio_capture/pubspec.yaml +87 -0
- package/flutter_app/third_party/desktop_audio_capture/windows/CMakeLists.txt +105 -0
- package/flutter_app/third_party/desktop_audio_capture/windows/audio_capture_plugin.cpp +80 -0
- package/flutter_app/third_party/desktop_audio_capture/windows/audio_capture_plugin.h +31 -0
- package/flutter_app/third_party/desktop_audio_capture/windows/audio_capture_plugin_c_api.cpp +12 -0
- package/flutter_app/third_party/desktop_audio_capture/windows/include/audio_capture/audio_capture_plugin_c_api.h +23 -0
- package/flutter_app/third_party/desktop_audio_capture/windows/include/desktop_audio_capture/audio_capture_plugin.h +25 -0
- package/flutter_app/third_party/desktop_audio_capture/windows/mic_capture_plugin.cpp +1117 -0
- package/flutter_app/third_party/desktop_audio_capture/windows/mic_capture_plugin.h +115 -0
- package/flutter_app/third_party/desktop_audio_capture/windows/system_audio_capture_plugin.cpp +777 -0
- package/flutter_app/third_party/desktop_audio_capture/windows/system_audio_capture_plugin.h +87 -0
- package/flutter_app/third_party/flutter_secure_storage_linux/linux/CMakeLists.txt +30 -0
- package/flutter_app/third_party/flutter_secure_storage_linux/linux/flutter_secure_storage_linux_plugin.cc +215 -0
- package/flutter_app/third_party/flutter_secure_storage_linux/linux/include/flutter_secure_storage_linux/flutter_secure_storage_linux_plugin.h +27 -0
- package/flutter_app/third_party/flutter_secure_storage_linux/pubspec.yaml +20 -0
- package/flutter_app/tool/generate_desktop_branding.py +219 -0
- package/flutter_app/web/favicon.png +0 -0
- package/flutter_app/web/favicon.svg +12 -0
- package/flutter_app/web/icons/Icon-192.png +0 -0
- package/flutter_app/web/icons/Icon-512.png +0 -0
- package/flutter_app/web/icons/Icon-maskable-192.png +0 -0
- package/flutter_app/web/icons/Icon-maskable-512.png +0 -0
- package/flutter_app/web/index.html +39 -0
- package/flutter_app/web/manifest.json +35 -0
- package/flutter_app/windows/CMakeLists.txt +108 -0
- package/flutter_app/windows/flutter/CMakeLists.txt +109 -0
- package/flutter_app/windows/flutter/generated_plugin_registrant.cc +50 -0
- package/flutter_app/windows/flutter/generated_plugin_registrant.h +15 -0
- package/flutter_app/windows/flutter/generated_plugins.cmake +36 -0
- package/flutter_app/windows/runner/CMakeLists.txt +41 -0
- package/flutter_app/windows/runner/Runner.rc +121 -0
- package/flutter_app/windows/runner/flutter_window.cpp +533 -0
- package/flutter_app/windows/runner/flutter_window.h +37 -0
- package/flutter_app/windows/runner/main.cpp +53 -0
- package/flutter_app/windows/runner/resource.h +16 -0
- package/flutter_app/windows/runner/resources/app_icon.ico +0 -0
- package/flutter_app/windows/runner/runner.exe.manifest +14 -0
- package/flutter_app/windows/runner/utils.cpp +65 -0
- package/flutter_app/windows/runner/utils.h +19 -0
- package/flutter_app/windows/runner/win32_window.cpp +299 -0
- package/flutter_app/windows/runner/win32_window.h +102 -0
- package/lib/install_helpers.js +31 -0
- package/lib/manager.js +201 -6
- package/package.json +5 -3
- package/server/db/database.js +125 -1
- package/server/http/middleware.js +55 -2
- package/server/http/routes.js +1 -0
- package/server/http/static.js +41 -1
- package/server/index.js +3 -0
- package/server/public/.last_build_id +1 -1
- package/server/public/assets/AssetManifest.bin +1 -1
- package/server/public/assets/AssetManifest.bin.json +1 -1
- package/server/public/assets/NOTICES +281 -1
- package/server/public/assets/assets/branding/onboarding_intro.mp4 +0 -0
- package/server/public/assets/fonts/MaterialIcons-Regular.otf +0 -0
- package/server/public/canvaskit/wimp.wasm +0 -0
- package/server/public/flutter_bootstrap.js +2 -2
- package/server/public/main.dart.js +86314 -82363
- package/server/routes/auth.js +26 -5
- package/server/routes/integrations.js +108 -1
- package/server/routes/memory.js +11 -2
- package/server/routes/settings.js +84 -2
- package/server/routes/wearable.js +67 -0
- package/server/services/ai/engine.js +3 -2
- package/server/services/ai/models.js +30 -0
- package/server/services/ai/providers/githubCopilot.js +97 -0
- package/server/services/ai/providers/openai.js +2 -1
- package/server/services/ai/providers/openaiCodex.js +31 -0
- package/server/services/ai/settings.js +20 -0
- package/server/services/ai/toolSelector.js +54 -1
- package/server/services/ai/tools.js +88 -5
- package/server/services/desktop/screenRecorder.js +65 -9
- package/server/services/integrations/env.js +5 -0
- package/server/services/integrations/figma/provider.js +1 -0
- package/server/services/integrations/github/common.js +106 -0
- package/server/services/integrations/github/provider.js +499 -0
- package/server/services/integrations/github/repos.js +1124 -0
- package/server/services/integrations/google/provider.js +1 -0
- package/server/services/integrations/manager.js +88 -12
- package/server/services/integrations/microsoft/provider.js +1 -0
- package/server/services/integrations/oauth_provider.js +25 -8
- package/server/services/integrations/provider_config_store.js +85 -0
- package/server/services/integrations/registry.js +4 -2
- package/server/services/integrations/spotify/provider.js +1 -0
- package/server/services/integrations/trello/provider.js +842 -0
- package/server/services/manager.js +46 -1
- package/server/services/mcp/client.js +120 -23
- package/server/services/memory/manager.js +39 -2
- package/server/services/messaging/access_policy.js +10 -0
- package/server/services/messaging/manager.js +49 -0
- package/server/services/messaging/meshtastic.js +277 -0
- package/server/services/messaging/meshtastic_env.js +40 -0
- package/server/services/messaging/meshtastic_protocol.js +530 -0
- package/server/services/messaging/meshtastic_protocol.test.js +33 -0
- package/server/services/messaging/meshtastic_tcp_transport.js +25 -0
- package/server/services/tasks/runtime.js +1 -1
- package/server/services/voice/openaiClient.js +4 -1
- package/server/services/voice/openaiSpeech.js +6 -1
- package/server/services/voice/providers.js +144 -15
- package/server/services/voice/runtimeManager.js +156 -19
- package/server/services/voice/turnRunner.js +29 -9
- package/server/services/wearable/firmware_manifest.js +353 -0
- package/server/services/wearable/gateway.js +350 -0
- package/server/services/wearable/protocol.js +45 -0
- package/server/services/wearable/service.js +240 -0
- package/server/services/widgets/service.js +3 -0
- package/server/utils/local_secrets.js +56 -0
- package/server/utils/logger.js +37 -9
- package/server/services/integrations/home_assistant/provider.js +0 -350
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
package com.neoagent.flutter_app.recording
|
|
2
|
+
|
|
3
|
+
import org.json.JSONObject
|
|
4
|
+
import java.io.BufferedReader
|
|
5
|
+
import java.io.File
|
|
6
|
+
import java.io.OutputStreamWriter
|
|
7
|
+
import java.net.HttpURLConnection
|
|
8
|
+
import java.net.URL
|
|
9
|
+
import java.nio.charset.StandardCharsets
|
|
10
|
+
|
|
11
|
+
class RecordingUploadClient {
|
|
12
|
+
fun uploadChunk(
|
|
13
|
+
backendUrl: String,
|
|
14
|
+
sessionCookie: String,
|
|
15
|
+
sessionId: String,
|
|
16
|
+
meta: PendingChunkMeta,
|
|
17
|
+
file: File,
|
|
18
|
+
) {
|
|
19
|
+
val url = URL(resolveUrl(backendUrl, "/api/recordings/$sessionId/chunks"))
|
|
20
|
+
val connection = (url.openConnection() as HttpURLConnection).apply {
|
|
21
|
+
requestMethod = "POST"
|
|
22
|
+
doOutput = true
|
|
23
|
+
connectTimeout = 20_000
|
|
24
|
+
readTimeout = 60_000
|
|
25
|
+
setRequestProperty("Cookie", sessionCookie)
|
|
26
|
+
setRequestProperty("Content-Type", meta.mimeType)
|
|
27
|
+
setRequestProperty("X-Recording-Source-Key", SOURCE_KEY)
|
|
28
|
+
setRequestProperty("X-Recording-Sequence", meta.sequence.toString())
|
|
29
|
+
setRequestProperty("X-Recording-Start-Ms", meta.startMs.toString())
|
|
30
|
+
setRequestProperty("X-Recording-End-Ms", meta.endMs.toString())
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
file.inputStream().use { input ->
|
|
34
|
+
connection.outputStream.use { output ->
|
|
35
|
+
input.copyTo(output)
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
val statusCode = connection.responseCode
|
|
40
|
+
if (statusCode !in 200..299) {
|
|
41
|
+
val body = readResponse(connection)
|
|
42
|
+
connection.disconnect()
|
|
43
|
+
throw IllegalStateException("Chunk upload failed ($statusCode): $body")
|
|
44
|
+
}
|
|
45
|
+
connection.disconnect()
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
fun finalizeSession(
|
|
49
|
+
backendUrl: String,
|
|
50
|
+
sessionCookie: String,
|
|
51
|
+
sessionId: String,
|
|
52
|
+
stopReason: String,
|
|
53
|
+
) {
|
|
54
|
+
val url = URL(resolveUrl(backendUrl, "/api/recordings/$sessionId/finalize"))
|
|
55
|
+
val connection = (url.openConnection() as HttpURLConnection).apply {
|
|
56
|
+
requestMethod = "POST"
|
|
57
|
+
doOutput = true
|
|
58
|
+
connectTimeout = 20_000
|
|
59
|
+
readTimeout = 60_000
|
|
60
|
+
setRequestProperty("Cookie", sessionCookie)
|
|
61
|
+
setRequestProperty("Content-Type", "application/json")
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
val payload = JSONObject()
|
|
65
|
+
.put("stopReason", stopReason)
|
|
66
|
+
.toString()
|
|
67
|
+
OutputStreamWriter(connection.outputStream, StandardCharsets.UTF_8).use { writer ->
|
|
68
|
+
writer.write(payload)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
val statusCode = connection.responseCode
|
|
72
|
+
if (statusCode !in 200..299) {
|
|
73
|
+
val body = readResponse(connection)
|
|
74
|
+
connection.disconnect()
|
|
75
|
+
throw IllegalStateException("Finalize failed ($statusCode): $body")
|
|
76
|
+
}
|
|
77
|
+
connection.disconnect()
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
private fun readResponse(connection: HttpURLConnection): String {
|
|
81
|
+
val stream = connection.errorStream ?: connection.inputStream ?: return ""
|
|
82
|
+
return stream.bufferedReader().use(BufferedReader::readText)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
private fun resolveUrl(baseUrl: String, path: String): String {
|
|
86
|
+
val trimmed = baseUrl.trim().removeSuffix("/")
|
|
87
|
+
return if (trimmed.isEmpty()) {
|
|
88
|
+
path
|
|
89
|
+
} else {
|
|
90
|
+
"$trimmed$path"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
companion object {
|
|
95
|
+
const val SOURCE_KEY = "microphone"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
data class PendingChunkMeta(
|
|
100
|
+
val sequence: Int,
|
|
101
|
+
val startMs: Long,
|
|
102
|
+
val endMs: Long,
|
|
103
|
+
val mimeType: String = "audio/wav",
|
|
104
|
+
)
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
package com.neoagent.flutter_app.telecom
|
|
2
|
+
|
|
3
|
+
import android.content.Context
|
|
4
|
+
import android.net.Uri
|
|
5
|
+
import android.os.Handler
|
|
6
|
+
import android.os.Looper
|
|
7
|
+
import android.telecom.Connection
|
|
8
|
+
import android.telecom.DisconnectCause
|
|
9
|
+
import android.telecom.TelecomManager
|
|
10
|
+
import io.flutter.embedding.engine.FlutterEngine
|
|
11
|
+
import io.flutter.embedding.engine.FlutterEngineCache
|
|
12
|
+
import io.flutter.embedding.engine.dart.DartExecutor
|
|
13
|
+
import io.flutter.plugin.common.MethodChannel
|
|
14
|
+
|
|
15
|
+
class NeoAgentConnection(private val context: Context) : Connection() {
|
|
16
|
+
private var flutterEngine: FlutterEngine? = null
|
|
17
|
+
var isFlutterInitiated: Boolean = false
|
|
18
|
+
private var voiceHeadlessStarted: Boolean = false
|
|
19
|
+
|
|
20
|
+
init {
|
|
21
|
+
audioModeIsVoip = true
|
|
22
|
+
setAddress(Uri.parse("tel:NeoAgent"), TelecomManager.PRESENTATION_ALLOWED)
|
|
23
|
+
setCallerDisplayName("NeoAgent", TelecomManager.PRESENTATION_ALLOWED)
|
|
24
|
+
connectionProperties = PROPERTY_SELF_MANAGED
|
|
25
|
+
connectionCapabilities = CAPABILITY_MUTE or CAPABILITY_HOLD
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
override fun onAnswer() {
|
|
29
|
+
setActive()
|
|
30
|
+
startVoiceAssistantHeadless()
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
override fun onAnswer(videoState: Int) {
|
|
34
|
+
onAnswer()
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
override fun onReject() {
|
|
38
|
+
setDisconnected(DisconnectCause(DisconnectCause.REJECTED))
|
|
39
|
+
destroy()
|
|
40
|
+
cleanup()
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
override fun onAbort() {
|
|
44
|
+
setDisconnected(DisconnectCause(DisconnectCause.REJECTED))
|
|
45
|
+
destroy()
|
|
46
|
+
cleanup()
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
override fun onDisconnect() {
|
|
50
|
+
setDisconnected(DisconnectCause(DisconnectCause.LOCAL))
|
|
51
|
+
destroy()
|
|
52
|
+
cleanup()
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
override fun onStateChanged(state: Int) {
|
|
56
|
+
super.onStateChanged(state)
|
|
57
|
+
if (state == STATE_ACTIVE) {
|
|
58
|
+
startVoiceAssistantHeadless()
|
|
59
|
+
} else if (state == STATE_DISCONNECTED) {
|
|
60
|
+
cleanup()
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
private fun startVoiceAssistantHeadless() {
|
|
65
|
+
if (voiceHeadlessStarted) return
|
|
66
|
+
voiceHeadlessStarted = true
|
|
67
|
+
if (flutterEngine != null) return
|
|
68
|
+
|
|
69
|
+
// Wait a slight moment for audio routing to settle before capturing mic
|
|
70
|
+
Handler(Looper.getMainLooper()).postDelayed({
|
|
71
|
+
// Check if there is already an active engine to avoid duplicating connections
|
|
72
|
+
var existingEngine = FlutterEngineCache.getInstance().get("main_engine")
|
|
73
|
+
|
|
74
|
+
if (existingEngine != null) {
|
|
75
|
+
// If engine exists (app is in background), we can just trigger it via method channel
|
|
76
|
+
flutterEngine = existingEngine
|
|
77
|
+
} else {
|
|
78
|
+
// Spawn headless engine
|
|
79
|
+
flutterEngine = FlutterEngine(context.applicationContext)
|
|
80
|
+
flutterEngine?.dartExecutor?.executeDartEntrypoint(
|
|
81
|
+
DartExecutor.DartEntrypoint.createDefault()
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (!isFlutterInitiated) {
|
|
86
|
+
// To ensure the flutter side starts the LiveVoiceCapture session automatically
|
|
87
|
+
// we should ideally notify it through a MethodChannel.
|
|
88
|
+
// But since this is a headless connection, if we just initialize the engine,
|
|
89
|
+
// we need to tell it to start voice mode.
|
|
90
|
+
// We will invoke a method call to Dart.
|
|
91
|
+
MethodChannel(
|
|
92
|
+
flutterEngine!!.dartExecutor.binaryMessenger,
|
|
93
|
+
"neoagent/car_auto"
|
|
94
|
+
).invokeMethod("startVoiceMode", null)
|
|
95
|
+
isFlutterInitiated = true
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
}, 500)
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
private fun cleanup() {
|
|
102
|
+
if (!isFlutterInitiated) {
|
|
103
|
+
val messenger = flutterEngine?.dartExecutor?.binaryMessenger
|
|
104
|
+
if (messenger != null) {
|
|
105
|
+
MethodChannel(
|
|
106
|
+
messenger,
|
|
107
|
+
"neoagent/car_auto"
|
|
108
|
+
).invokeMethod("stopVoiceMode", null)
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
NeoAgentConnectionService.getAndClearCurrentConnection()
|
|
113
|
+
|
|
114
|
+
// We only destroy the engine if we created it headless and we want to clean up.
|
|
115
|
+
// For simplicity and reusing existing state, we can leave it running
|
|
116
|
+
// to handle the end-of-call cleanly on the dart side.
|
|
117
|
+
}
|
|
118
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
package com.neoagent.flutter_app.telecom
|
|
2
|
+
|
|
3
|
+
import android.content.Context
|
|
4
|
+
import android.net.Uri
|
|
5
|
+
import android.os.Bundle
|
|
6
|
+
import android.telecom.Connection
|
|
7
|
+
import android.telecom.ConnectionService
|
|
8
|
+
import android.telecom.ConnectionRequest
|
|
9
|
+
import android.telecom.PhoneAccountHandle
|
|
10
|
+
import android.telecom.TelecomManager
|
|
11
|
+
import android.telecom.DisconnectCause
|
|
12
|
+
|
|
13
|
+
class NeoAgentConnectionService : ConnectionService() {
|
|
14
|
+
override fun onCreateOutgoingConnection(
|
|
15
|
+
connectionManagerPhoneAccount: PhoneAccountHandle?,
|
|
16
|
+
request: ConnectionRequest?
|
|
17
|
+
): Connection {
|
|
18
|
+
return createConnection(request, isIncoming = false)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
override fun onCreateOutgoingConnectionFailed(
|
|
22
|
+
connectionManagerPhoneAccount: PhoneAccountHandle?,
|
|
23
|
+
request: ConnectionRequest?
|
|
24
|
+
) {
|
|
25
|
+
super.onCreateOutgoingConnectionFailed(connectionManagerPhoneAccount, request)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
override fun onCreateIncomingConnection(
|
|
29
|
+
connectionManagerPhoneAccount: PhoneAccountHandle?,
|
|
30
|
+
request: ConnectionRequest?
|
|
31
|
+
): Connection {
|
|
32
|
+
return createConnection(request, isIncoming = true)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
override fun onCreateIncomingConnectionFailed(
|
|
36
|
+
connectionManagerPhoneAccount: PhoneAccountHandle?,
|
|
37
|
+
request: ConnectionRequest?
|
|
38
|
+
) {
|
|
39
|
+
super.onCreateIncomingConnectionFailed(connectionManagerPhoneAccount, request)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
companion object {
|
|
43
|
+
@Volatile
|
|
44
|
+
private var currentConnection: NeoAgentConnection? = null
|
|
45
|
+
|
|
46
|
+
@Synchronized
|
|
47
|
+
fun getAndClearCurrentConnection(): NeoAgentConnection? {
|
|
48
|
+
val conn = currentConnection
|
|
49
|
+
currentConnection = null
|
|
50
|
+
return conn
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@Synchronized
|
|
54
|
+
fun swapConnection(newConnection: NeoAgentConnection) {
|
|
55
|
+
currentConnection?.let {
|
|
56
|
+
try {
|
|
57
|
+
it.setDisconnected(DisconnectCause(DisconnectCause.LOCAL))
|
|
58
|
+
it.destroy()
|
|
59
|
+
} catch (e: Exception) {
|
|
60
|
+
// Ignore
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
currentConnection = newConnection
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
private fun createConnection(request: ConnectionRequest?, isIncoming: Boolean): Connection {
|
|
68
|
+
val connection = NeoAgentConnection(applicationContext)
|
|
69
|
+
swapConnection(connection)
|
|
70
|
+
|
|
71
|
+
// Custom flag from Flutter to know if it started the call
|
|
72
|
+
val isFlutterInitiated = request?.extras?.getBoolean("is_flutter_initiated") ?: false
|
|
73
|
+
connection.isFlutterInitiated = isFlutterInitiated
|
|
74
|
+
|
|
75
|
+
connection.connectionProperties = Connection.PROPERTY_SELF_MANAGED
|
|
76
|
+
connection.setInitializing()
|
|
77
|
+
|
|
78
|
+
if (isIncoming) {
|
|
79
|
+
connection.setRinging()
|
|
80
|
+
} else {
|
|
81
|
+
connection.setDialing()
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return connection
|
|
85
|
+
}
|
|
86
|
+
}
|