@jingyi0605/codingns4dsh 0.2.1-beta.2 → 0.2.1-beta.4
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/README.en.md +8 -8
- package/README.md +103 -14
- package/THIRD_PARTY_NOTICES +141 -0
- package/assets/assistant-basics/female-v1.png +0 -0
- package/assets/assistant-basics/male-v1.png +0 -0
- package/assets/desktop-assistant/20261008-WebView2/345/210/206/345/217/221/350/257/264/346/230/216.md +14 -0
- package/assets/desktop-assistant/webview2/LICENSE.txt +27 -0
- package/assets/desktop-assistant/webview2/Microsoft.Web.WebView2.Core.dll +0 -0
- package/assets/desktop-assistant/webview2/Microsoft.Web.WebView2.Wpf.dll +0 -0
- package/assets/desktop-assistant/webview2/NOTICE.txt +85 -0
- package/assets/desktop-assistant/webview2/arm64/WebView2Loader.dll +0 -0
- package/assets/desktop-assistant/webview2/x64/WebView2Loader.dll +0 -0
- package/assets/desktop-assistant/webview2/x86/WebView2Loader.dll +0 -0
- package/assets/moss/LICENSE +201 -0
- package/assets/moss/ort_cpu_runtime.py +839 -0
- package/assets/moss/worker.py +278 -0
- package/assets/voice/bilingual-zh-en-bpe.vocab +500 -0
- package/avatar-packages/catalog.json +259 -0
- package/avatar-packages/manifests/bubu-codebrew-bear.avatar.json +13 -0
- package/avatar-packages/manifests/ds-whale-live2d.avatar.json +27 -0
- package/avatar-packages/manifests/ds-whale-sprite.avatar.json +13 -0
- package/avatar-packages/manifests/live2d-haru.avatar.json +13 -0
- package/avatar-packages/manifests/live2d-hiyori.avatar.json +13 -0
- package/avatar-packages/manifests/live2d-mao.avatar.json +13 -0
- package/avatar-packages/manifests/live2d-mark.avatar.json +13 -0
- package/avatar-packages/manifests/live2d-rice.avatar.json +13 -0
- package/avatar-packages/manifests/live2d-wanko.avatar.json +13 -0
- package/avatar-packages/manifests/nastya.avatar.json +13 -0
- package/avatar-packages/manifests/scout-corgi.avatar.json +13 -0
- package/avatar-packages/manifests/xiaoman.avatar.json +13 -0
- package/data/build/dist/client/assistant-settings-styles.d.ts +7 -0
- package/data/build/dist/client/assistant-settings-styles.d.ts.map +1 -0
- package/data/build/dist/client/assistant-settings-styles.js +6 -0
- package/data/build/dist/client/assistant-settings-styles.js.map +1 -0
- package/data/build/dist/client/avatar/builtin.d.ts +5 -0
- package/data/build/dist/client/avatar/builtin.d.ts.map +1 -0
- package/data/build/dist/client/avatar/builtin.js +9 -0
- package/data/build/dist/client/avatar/builtin.js.map +1 -0
- package/data/build/dist/client/avatar/cache-status.d.ts +4 -0
- package/data/build/dist/client/avatar/cache-status.d.ts.map +1 -0
- package/data/build/dist/client/avatar/cache-status.js +40 -0
- package/data/build/dist/client/avatar/cache-status.js.map +1 -0
- package/data/build/dist/client/avatar/catalog-panel.d.ts +49 -0
- package/data/build/dist/client/avatar/catalog-panel.d.ts.map +1 -0
- package/data/build/dist/client/avatar/catalog-panel.js +245 -0
- package/data/build/dist/client/avatar/catalog-panel.js.map +1 -0
- package/data/build/dist/client/avatar/catalog-picker.d.ts +38 -0
- package/data/build/dist/client/avatar/catalog-picker.d.ts.map +1 -0
- package/data/build/dist/client/avatar/catalog-picker.js +65 -0
- package/data/build/dist/client/avatar/catalog-picker.js.map +1 -0
- package/data/build/dist/client/avatar/desktop-bridge.d.ts +21 -0
- package/data/build/dist/client/avatar/desktop-bridge.d.ts.map +1 -0
- package/data/build/dist/client/avatar/desktop-bridge.js +109 -0
- package/data/build/dist/client/avatar/desktop-bridge.js.map +1 -0
- package/data/build/dist/client/avatar/desktop-entry.d.ts +2 -0
- package/data/build/dist/client/avatar/desktop-entry.d.ts.map +1 -0
- package/data/build/dist/client/avatar/desktop-entry.js +34 -0
- package/data/build/dist/client/avatar/desktop-entry.js.map +1 -0
- package/data/build/dist/client/avatar/desktop-view.d.ts +23 -0
- package/data/build/dist/client/avatar/desktop-view.d.ts.map +1 -0
- package/data/build/dist/client/avatar/desktop-view.js +72 -0
- package/data/build/dist/client/avatar/desktop-view.js.map +1 -0
- package/data/build/dist/client/avatar/engine.d.ts +45 -0
- package/data/build/dist/client/avatar/engine.d.ts.map +1 -0
- package/data/build/dist/client/avatar/engine.js +165 -0
- package/data/build/dist/client/avatar/engine.js.map +1 -0
- package/data/build/dist/client/avatar/floating.d.ts +20 -0
- package/data/build/dist/client/avatar/floating.d.ts.map +1 -0
- package/data/build/dist/client/avatar/floating.js +99 -0
- package/data/build/dist/client/avatar/floating.js.map +1 -0
- package/data/build/dist/client/avatar/image.d.ts +5 -0
- package/data/build/dist/client/avatar/image.d.ts.map +1 -0
- package/data/build/dist/client/avatar/image.js +22 -0
- package/data/build/dist/client/avatar/image.js.map +1 -0
- package/data/build/dist/client/avatar/live2d.d.ts +65 -0
- package/data/build/dist/client/avatar/live2d.d.ts.map +1 -0
- package/data/build/dist/client/avatar/live2d.js +278 -0
- package/data/build/dist/client/avatar/live2d.js.map +1 -0
- package/data/build/dist/client/avatar/loading.d.ts +27 -0
- package/data/build/dist/client/avatar/loading.d.ts.map +1 -0
- package/data/build/dist/client/avatar/loading.js +74 -0
- package/data/build/dist/client/avatar/loading.js.map +1 -0
- package/data/build/dist/client/avatar/manager.d.ts +71 -0
- package/data/build/dist/client/avatar/manager.d.ts.map +1 -0
- package/data/build/dist/client/avatar/manager.js +321 -0
- package/data/build/dist/client/avatar/manager.js.map +1 -0
- package/data/build/dist/client/avatar/portrait-capture.d.ts +30 -0
- package/data/build/dist/client/avatar/portrait-capture.d.ts.map +1 -0
- package/data/build/dist/client/avatar/portrait-capture.js +233 -0
- package/data/build/dist/client/avatar/portrait-capture.js.map +1 -0
- package/data/build/dist/client/avatar/portrait-editor.d.ts +14 -0
- package/data/build/dist/client/avatar/portrait-editor.d.ts.map +1 -0
- package/data/build/dist/client/avatar/portrait-editor.js +105 -0
- package/data/build/dist/client/avatar/portrait-editor.js.map +1 -0
- package/data/build/dist/client/avatar/portrait-service.d.ts +51 -0
- package/data/build/dist/client/avatar/portrait-service.d.ts.map +1 -0
- package/data/build/dist/client/avatar/portrait-service.js +244 -0
- package/data/build/dist/client/avatar/portrait-service.js.map +1 -0
- package/data/build/dist/client/avatar/portrait.d.ts +28 -0
- package/data/build/dist/client/avatar/portrait.d.ts.map +1 -0
- package/data/build/dist/client/avatar/portrait.js +56 -0
- package/data/build/dist/client/avatar/portrait.js.map +1 -0
- package/data/build/dist/client/avatar/preview-capture.d.ts +4 -0
- package/data/build/dist/client/avatar/preview-capture.d.ts.map +1 -0
- package/data/build/dist/client/avatar/preview-capture.js +100 -0
- package/data/build/dist/client/avatar/preview-capture.js.map +1 -0
- package/data/build/dist/client/avatar/preview-store.d.ts +41 -0
- package/data/build/dist/client/avatar/preview-store.d.ts.map +1 -0
- package/data/build/dist/client/avatar/preview-store.js +171 -0
- package/data/build/dist/client/avatar/preview-store.js.map +1 -0
- package/data/build/dist/client/avatar/preview.d.ts +14 -0
- package/data/build/dist/client/avatar/preview.d.ts.map +1 -0
- package/data/build/dist/client/avatar/preview.js +56 -0
- package/data/build/dist/client/avatar/preview.js.map +1 -0
- package/data/build/dist/client/avatar/registration.d.ts +2 -0
- package/data/build/dist/client/avatar/registration.d.ts.map +1 -0
- package/data/build/dist/client/avatar/registration.js +2 -0
- package/data/build/dist/client/avatar/registration.js.map +1 -0
- package/data/build/dist/client/avatar/registry.d.ts +45 -0
- package/data/build/dist/client/avatar/registry.d.ts.map +1 -0
- package/data/build/dist/client/avatar/registry.js +34 -0
- package/data/build/dist/client/avatar/registry.js.map +1 -0
- package/data/build/dist/client/avatar/settings-panel.d.ts +21 -0
- package/data/build/dist/client/avatar/settings-panel.d.ts.map +1 -0
- package/data/build/dist/client/avatar/settings-panel.js +169 -0
- package/data/build/dist/client/avatar/settings-panel.js.map +1 -0
- package/data/build/dist/client/avatar/slot.d.ts +17 -0
- package/data/build/dist/client/avatar/slot.d.ts.map +1 -0
- package/data/build/dist/client/avatar/slot.js +70 -0
- package/data/build/dist/client/avatar/slot.js.map +1 -0
- package/data/build/dist/client/avatar/spritesheet.d.ts +19 -0
- package/data/build/dist/client/avatar/spritesheet.d.ts.map +1 -0
- package/data/build/dist/client/avatar/spritesheet.js +91 -0
- package/data/build/dist/client/avatar/spritesheet.js.map +1 -0
- package/data/build/dist/client/avatar/temporary-preview.d.ts +25 -0
- package/data/build/dist/client/avatar/temporary-preview.d.ts.map +1 -0
- package/data/build/dist/client/avatar/temporary-preview.js +61 -0
- package/data/build/dist/client/avatar/temporary-preview.js.map +1 -0
- package/data/build/dist/client/bundle.js +25066 -2837
- package/data/build/dist/client/bundle.js.map +1 -1
- package/data/build/dist/client/cli-slots.d.ts.map +1 -1
- package/data/build/dist/client/cli-slots.js +9 -9
- package/data/build/dist/client/cli-slots.js.map +1 -1
- package/data/build/dist/client/desktop-assistant.js +8585 -0
- package/data/build/dist/client/features/assistant-composer-input.d.ts +10 -0
- package/data/build/dist/client/features/assistant-composer-input.d.ts.map +1 -0
- package/data/build/dist/client/features/assistant-composer-input.js +40 -0
- package/data/build/dist/client/features/assistant-composer-input.js.map +1 -0
- package/data/build/dist/client/features/assistant-configuration-session.d.ts +45 -0
- package/data/build/dist/client/features/assistant-configuration-session.d.ts.map +1 -0
- package/data/build/dist/client/features/assistant-configuration-session.js +252 -0
- package/data/build/dist/client/features/assistant-configuration-session.js.map +1 -0
- package/data/build/dist/client/features/assistant-configuration-tabs.d.ts +34 -0
- package/data/build/dist/client/features/assistant-configuration-tabs.d.ts.map +1 -0
- package/data/build/dist/client/features/assistant-configuration-tabs.js +48 -0
- package/data/build/dist/client/features/assistant-configuration-tabs.js.map +1 -0
- package/data/build/dist/client/features/assistant-conversation-message.d.ts +27 -0
- package/data/build/dist/client/features/assistant-conversation-message.d.ts.map +1 -0
- package/data/build/dist/client/features/assistant-conversation-message.js +55 -0
- package/data/build/dist/client/features/assistant-conversation-message.js.map +1 -0
- package/data/build/dist/client/features/assistant-debug-dialog.d.ts +3 -0
- package/data/build/dist/client/features/assistant-debug-dialog.d.ts.map +1 -0
- package/data/build/dist/client/features/assistant-debug-dialog.js +3 -0
- package/data/build/dist/client/features/assistant-debug-dialog.js.map +1 -0
- package/data/build/dist/client/features/assistant-debug-workbench.d.ts +48 -0
- package/data/build/dist/client/features/assistant-debug-workbench.d.ts.map +1 -0
- package/data/build/dist/client/features/assistant-debug-workbench.js +376 -0
- package/data/build/dist/client/features/assistant-debug-workbench.js.map +1 -0
- package/data/build/dist/client/features/assistant-floating-call.d.ts +33 -0
- package/data/build/dist/client/features/assistant-floating-call.d.ts.map +1 -0
- package/data/build/dist/client/features/assistant-floating-call.js +67 -0
- package/data/build/dist/client/features/assistant-floating-call.js.map +1 -0
- package/data/build/dist/client/features/assistant-panel.d.ts +2 -2
- package/data/build/dist/client/features/assistant-panel.d.ts.map +1 -1
- package/data/build/dist/client/features/assistant-panel.js +10 -123
- package/data/build/dist/client/features/assistant-panel.js.map +1 -1
- package/data/build/dist/client/features/assistant-realtime-call.d.ts +57 -0
- package/data/build/dist/client/features/assistant-realtime-call.d.ts.map +1 -0
- package/data/build/dist/client/features/assistant-realtime-call.js +131 -0
- package/data/build/dist/client/features/assistant-realtime-call.js.map +1 -0
- package/data/build/dist/client/features/assistant-record-style.d.ts +5 -0
- package/data/build/dist/client/features/assistant-record-style.d.ts.map +1 -0
- package/data/build/dist/client/features/assistant-record-style.js +25 -0
- package/data/build/dist/client/features/assistant-record-style.js.map +1 -0
- package/data/build/dist/client/features/assistant-voice-initialization.d.ts +26 -0
- package/data/build/dist/client/features/assistant-voice-initialization.d.ts.map +1 -0
- package/data/build/dist/client/features/assistant-voice-initialization.js +138 -0
- package/data/build/dist/client/features/assistant-voice-initialization.js.map +1 -0
- package/data/build/dist/client/features/assistant-voice-settings-group.d.ts +19 -0
- package/data/build/dist/client/features/assistant-voice-settings-group.d.ts.map +1 -0
- package/data/build/dist/client/features/assistant-voice-settings-group.js +34 -0
- package/data/build/dist/client/features/assistant-voice-settings-group.js.map +1 -0
- package/data/build/dist/client/features/assistant-voice-settings.d.ts +13 -0
- package/data/build/dist/client/features/assistant-voice-settings.d.ts.map +1 -0
- package/data/build/dist/client/features/assistant-voice-settings.js +184 -0
- package/data/build/dist/client/features/assistant-voice-settings.js.map +1 -0
- package/data/build/dist/client/features/assistant-workbench-controls.d.ts +72 -0
- package/data/build/dist/client/features/assistant-workbench-controls.d.ts.map +1 -0
- package/data/build/dist/client/features/assistant-workbench-controls.js +145 -0
- package/data/build/dist/client/features/assistant-workbench-controls.js.map +1 -0
- package/data/build/dist/client/features/assistant-workbench-entry.d.ts +4 -0
- package/data/build/dist/client/features/assistant-workbench-entry.d.ts.map +1 -0
- package/data/build/dist/client/features/assistant-workbench-entry.js +7 -0
- package/data/build/dist/client/features/assistant-workbench-entry.js.map +1 -0
- package/data/build/dist/client/features/assistant-workbench.d.ts +109 -0
- package/data/build/dist/client/features/assistant-workbench.d.ts.map +1 -0
- package/data/build/dist/client/features/assistant-workbench.js +568 -0
- package/data/build/dist/client/features/assistant-workbench.js.map +1 -0
- package/data/build/dist/client/features/global-voice-assistant.d.ts.map +1 -1
- package/data/build/dist/client/features/global-voice-assistant.js +88 -32
- package/data/build/dist/client/features/global-voice-assistant.js.map +1 -1
- package/data/build/dist/client/features/lan-access.js +2 -2
- package/data/build/dist/client/features/lan-access.js.map +1 -1
- package/data/build/dist/client/features/mobile-access.d.ts.map +1 -1
- package/data/build/dist/client/features/mobile-access.js +9 -0
- package/data/build/dist/client/features/mobile-access.js.map +1 -1
- package/data/build/dist/client/features/peer-host.d.ts +2 -0
- package/data/build/dist/client/features/peer-host.d.ts.map +1 -1
- package/data/build/dist/client/features/peer-host.js +66 -73
- package/data/build/dist/client/features/peer-host.js.map +1 -1
- package/data/build/dist/client/features/types.d.ts +4 -0
- package/data/build/dist/client/features/types.d.ts.map +1 -1
- package/data/build/dist/client/features/voice-conversation-dialog.d.ts +9 -2
- package/data/build/dist/client/features/voice-conversation-dialog.d.ts.map +1 -1
- package/data/build/dist/client/features/voice-conversation-dialog.js +29 -7
- package/data/build/dist/client/features/voice-conversation-dialog.js.map +1 -1
- package/data/build/dist/client/features/voice-initialization-dialog.d.ts +42 -2
- package/data/build/dist/client/features/voice-initialization-dialog.d.ts.map +1 -1
- package/data/build/dist/client/features/voice-initialization-dialog.js +181 -67
- package/data/build/dist/client/features/voice-initialization-dialog.js.map +1 -1
- package/data/build/dist/client/global-voice-runtime-registry.d.ts +4 -0
- package/data/build/dist/client/global-voice-runtime-registry.d.ts.map +1 -1
- package/data/build/dist/client/global-voice-runtime-registry.js.map +1 -1
- package/data/build/dist/client/index.d.ts +11 -0
- package/data/build/dist/client/index.d.ts.map +1 -1
- package/data/build/dist/client/index.js +10 -0
- package/data/build/dist/client/index.js.map +1 -1
- package/data/build/dist/client/locale.d.ts.map +1 -1
- package/data/build/dist/client/locale.js +51 -14
- package/data/build/dist/client/locale.js.map +1 -1
- package/data/build/dist/client/locales/assistantAvatar.d.ts +138 -0
- package/data/build/dist/client/locales/assistantAvatar.d.ts.map +1 -0
- package/data/build/dist/client/locales/assistantAvatar.js +273 -0
- package/data/build/dist/client/locales/assistantAvatar.js.map +1 -0
- package/data/build/dist/client/locales/assistantDebug.d.ts +4 -0
- package/data/build/dist/client/locales/assistantDebug.d.ts.map +1 -0
- package/data/build/dist/client/locales/assistantDebug.js +362 -0
- package/data/build/dist/client/locales/assistantDebug.js.map +1 -0
- package/data/build/dist/client/locales/assistantTts.d.ts +80 -0
- package/data/build/dist/client/locales/assistantTts.d.ts.map +1 -0
- package/data/build/dist/client/locales/assistantTts.js +76 -0
- package/data/build/dist/client/locales/assistantTts.js.map +1 -0
- package/data/build/dist/client/locales/assistantWorkbench.d.ts +126 -0
- package/data/build/dist/client/locales/assistantWorkbench.d.ts.map +1 -0
- package/data/build/dist/client/locales/assistantWorkbench.js +96 -0
- package/data/build/dist/client/locales/assistantWorkbench.js.map +1 -0
- package/data/build/dist/client/locales/peerHostWorkspace.d.ts.map +1 -1
- package/data/build/dist/client/locales/peerHostWorkspace.js +16 -2
- package/data/build/dist/client/locales/peerHostWorkspace.js.map +1 -1
- package/data/build/dist/client/locales/terminalAuth.d.ts.map +1 -1
- package/data/build/dist/client/locales/terminalAuth.js +80 -0
- package/data/build/dist/client/locales/terminalAuth.js.map +1 -1
- package/data/build/dist/client/locales/voiceModels.d.ts +45 -0
- package/data/build/dist/client/locales/voiceModels.d.ts.map +1 -0
- package/data/build/dist/client/locales/voiceModels.js +85 -0
- package/data/build/dist/client/locales/voiceModels.js.map +1 -0
- package/data/build/dist/client/mobile-rightbar-tabs-dom.d.ts +29 -0
- package/data/build/dist/client/mobile-rightbar-tabs-dom.d.ts.map +1 -0
- package/data/build/dist/client/mobile-rightbar-tabs-dom.js +93 -0
- package/data/build/dist/client/mobile-rightbar-tabs-dom.js.map +1 -0
- package/data/build/dist/client/mobile-rightbar-visibility.d.ts +32 -0
- package/data/build/dist/client/mobile-rightbar-visibility.d.ts.map +1 -0
- package/data/build/dist/client/mobile-rightbar-visibility.js +188 -0
- package/data/build/dist/client/mobile-rightbar-visibility.js.map +1 -0
- package/data/build/dist/client/mobile-session-interaction.d.ts +9 -19
- package/data/build/dist/client/mobile-session-interaction.d.ts.map +1 -1
- package/data/build/dist/client/mobile-session-interaction.js +25 -169
- package/data/build/dist/client/mobile-session-interaction.js.map +1 -1
- package/data/build/dist/client/mobile-sidebar-gestures.d.ts +4 -0
- package/data/build/dist/client/mobile-sidebar-gestures.d.ts.map +1 -1
- package/data/build/dist/client/mobile-sidebar-gestures.js +17 -9
- package/data/build/dist/client/mobile-sidebar-gestures.js.map +1 -1
- package/data/build/dist/client/model-catalog-cache.d.ts +4 -4
- package/data/build/dist/client/model-catalog-cache.d.ts.map +1 -1
- package/data/build/dist/client/model-catalog-cache.js +57 -32
- package/data/build/dist/client/model-catalog-cache.js.map +1 -1
- package/data/build/dist/client/moss-voice-output.d.ts +39 -0
- package/data/build/dist/client/moss-voice-output.d.ts.map +1 -0
- package/data/build/dist/client/moss-voice-output.js +241 -0
- package/data/build/dist/client/moss-voice-output.js.map +1 -0
- package/data/build/dist/client/peer-host-native-projection.d.ts +4 -3
- package/data/build/dist/client/peer-host-native-projection.d.ts.map +1 -1
- package/data/build/dist/client/peer-host-native-projection.js +7 -6
- package/data/build/dist/client/peer-host-native-projection.js.map +1 -1
- package/data/build/dist/client/peer-host-native-store-projection.js +9 -21
- package/data/build/dist/client/peer-host-native-store-projection.js.map +1 -1
- package/data/build/dist/client/peer-host-workspace-tab.d.ts.map +1 -1
- package/data/build/dist/client/peer-host-workspace-tab.js +139 -10
- package/data/build/dist/client/peer-host-workspace-tab.js.map +1 -1
- package/data/build/dist/client/settings-bridge.d.ts +1 -0
- package/data/build/dist/client/settings-bridge.d.ts.map +1 -1
- package/data/build/dist/client/settings-bridge.js +9 -1
- package/data/build/dist/client/settings-bridge.js.map +1 -1
- package/data/build/dist/client/sherpa-voice-adapter.d.ts +23 -2
- package/data/build/dist/client/sherpa-voice-adapter.d.ts.map +1 -1
- package/data/build/dist/client/sherpa-voice-adapter.js +384 -91
- package/data/build/dist/client/sherpa-voice-adapter.js.map +1 -1
- package/data/build/dist/client/skill-command.d.ts +1 -1
- package/data/build/dist/client/skill-command.d.ts.map +1 -1
- package/data/build/dist/client/skill-command.js +25 -2
- package/data/build/dist/client/skill-command.js.map +1 -1
- package/data/build/dist/client/skill-reference-dom.js +1 -1
- package/data/build/dist/client/skill-reference-dom.js.map +1 -1
- package/data/build/dist/client/streaming-sentence-queue.d.ts +20 -0
- package/data/build/dist/client/streaming-sentence-queue.d.ts.map +1 -0
- package/data/build/dist/client/streaming-sentence-queue.js +130 -0
- package/data/build/dist/client/streaming-sentence-queue.js.map +1 -0
- package/data/build/dist/client/terminal/log-preview.d.ts +14 -0
- package/data/build/dist/client/terminal/log-preview.d.ts.map +1 -0
- package/data/build/dist/client/terminal/log-preview.js +23 -0
- package/data/build/dist/client/terminal/log-preview.js.map +1 -0
- package/data/build/dist/client/terminal/model.d.ts +38 -7
- package/data/build/dist/client/terminal/model.d.ts.map +1 -1
- package/data/build/dist/client/terminal/model.js +188 -32
- package/data/build/dist/client/terminal/model.js.map +1 -1
- package/data/build/dist/client/terminal/recovery.d.ts +7 -3
- package/data/build/dist/client/terminal/recovery.d.ts.map +1 -1
- package/data/build/dist/client/terminal/recovery.js +45 -41
- package/data/build/dist/client/terminal/recovery.js.map +1 -1
- package/data/build/dist/client/terminal/selection-actions.d.ts +63 -0
- package/data/build/dist/client/terminal/selection-actions.d.ts.map +1 -0
- package/data/build/dist/client/terminal/selection-actions.js +132 -0
- package/data/build/dist/client/terminal/selection-actions.js.map +1 -0
- package/data/build/dist/client/terminal/share-menu.d.ts +17 -0
- package/data/build/dist/client/terminal/share-menu.d.ts.map +1 -0
- package/data/build/dist/client/terminal/share-menu.js +131 -0
- package/data/build/dist/client/terminal/share-menu.js.map +1 -0
- package/data/build/dist/client/terminal/sharing.d.ts +42 -0
- package/data/build/dist/client/terminal/sharing.d.ts.map +1 -0
- package/data/build/dist/client/terminal/sharing.js +144 -0
- package/data/build/dist/client/terminal/sharing.js.map +1 -0
- package/data/build/dist/client/terminal/snapshot.d.ts +32 -0
- package/data/build/dist/client/terminal/snapshot.d.ts.map +1 -0
- package/data/build/dist/client/terminal/snapshot.js +108 -0
- package/data/build/dist/client/terminal/snapshot.js.map +1 -0
- package/data/build/dist/client/terminal/styles.d.ts +14 -0
- package/data/build/dist/client/terminal/styles.d.ts.map +1 -1
- package/data/build/dist/client/terminal/styles.js +41 -3
- package/data/build/dist/client/terminal/styles.js.map +1 -1
- package/data/build/dist/client/terminal/surface-cache.d.ts +10 -0
- package/data/build/dist/client/terminal/surface-cache.d.ts.map +1 -0
- package/data/build/dist/client/terminal/surface-cache.js +19 -0
- package/data/build/dist/client/terminal/surface-cache.js.map +1 -0
- package/data/build/dist/client/terminal/ui.d.ts.map +1 -1
- package/data/build/dist/client/terminal/ui.js +78 -21
- package/data/build/dist/client/terminal/ui.js.map +1 -1
- package/data/build/dist/client/terminal/xterm-view.d.ts +5 -2
- package/data/build/dist/client/terminal/xterm-view.d.ts.map +1 -1
- package/data/build/dist/client/terminal/xterm-view.js +429 -397
- package/data/build/dist/client/terminal/xterm-view.js.map +1 -1
- package/data/build/dist/client/touch-input-focus.d.ts +30 -0
- package/data/build/dist/client/touch-input-focus.d.ts.map +1 -0
- package/data/build/dist/client/touch-input-focus.js +190 -0
- package/data/build/dist/client/touch-input-focus.js.map +1 -0
- package/data/build/dist/client/voice-capture.d.ts +9 -0
- package/data/build/dist/client/voice-capture.d.ts.map +1 -1
- package/data/build/dist/client/voice-capture.js +35 -1
- package/data/build/dist/client/voice-capture.js.map +1 -1
- package/data/build/dist/client/voice-chat-updates.d.ts +12 -0
- package/data/build/dist/client/voice-chat-updates.d.ts.map +1 -0
- package/data/build/dist/client/voice-chat-updates.js +39 -0
- package/data/build/dist/client/voice-chat-updates.js.map +1 -0
- package/data/build/dist/client/voice-diagnostics.d.ts +19 -0
- package/data/build/dist/client/voice-diagnostics.d.ts.map +1 -0
- package/data/build/dist/client/voice-diagnostics.js +73 -0
- package/data/build/dist/client/voice-diagnostics.js.map +1 -0
- package/data/build/dist/client/voice-model-setup-progress.d.ts +8 -0
- package/data/build/dist/client/voice-model-setup-progress.d.ts.map +1 -0
- package/data/build/dist/client/voice-model-setup-progress.js +27 -0
- package/data/build/dist/client/voice-model-setup-progress.js.map +1 -0
- package/data/build/dist/client/voice-stream-uploader.d.ts +41 -0
- package/data/build/dist/client/voice-stream-uploader.d.ts.map +1 -0
- package/data/build/dist/client/voice-stream-uploader.js +154 -0
- package/data/build/dist/client/voice-stream-uploader.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/config-forms-adapter.d.ts +4 -0
- package/data/build/dist/dsh-capabilities/client/config-forms-adapter.d.ts.map +1 -1
- package/data/build/dist/dsh-capabilities/client/config-forms-adapter.js +9 -0
- package/data/build/dist/dsh-capabilities/client/config-forms-adapter.js.map +1 -1
- package/data/build/dist/dsh-capabilities/client/primitives-adapter.d.ts +5 -1
- package/data/build/dist/dsh-capabilities/client/primitives-adapter.d.ts.map +1 -1
- package/data/build/dist/dsh-capabilities/client/primitives-adapter.js +25 -0
- package/data/build/dist/dsh-capabilities/client/primitives-adapter.js.map +1 -1
- package/data/build/dist/dsh-capabilities/client/terminal-sharing-adapter.d.ts +33 -0
- package/data/build/dist/dsh-capabilities/client/terminal-sharing-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/terminal-sharing-adapter.js +187 -0
- package/data/build/dist/dsh-capabilities/client/terminal-sharing-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/assistant-agent-adapter.d.ts +55 -0
- package/data/build/dist/dsh-capabilities/host/assistant-agent-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/assistant-agent-adapter.js +264 -0
- package/data/build/dist/dsh-capabilities/host/assistant-agent-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/assistant-attachment-adapter.d.ts +16 -0
- package/data/build/dist/dsh-capabilities/host/assistant-attachment-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/assistant-attachment-adapter.js +69 -0
- package/data/build/dist/dsh-capabilities/host/assistant-attachment-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/assistant-llm-adapter.d.ts +36 -0
- package/data/build/dist/dsh-capabilities/host/assistant-llm-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/assistant-llm-adapter.js +112 -0
- package/data/build/dist/dsh-capabilities/host/assistant-llm-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/assistant-web-search-adapter.d.ts +4 -0
- package/data/build/dist/dsh-capabilities/host/assistant-web-search-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/assistant-web-search-adapter.js +41 -0
- package/data/build/dist/dsh-capabilities/host/assistant-web-search-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/sidebar-session-compat.d.ts +28 -0
- package/data/build/dist/dsh-capabilities/host/sidebar-session-compat.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/sidebar-session-compat.js +109 -0
- package/data/build/dist/dsh-capabilities/host/sidebar-session-compat.js.map +1 -0
- package/data/build/dist/dsh-capabilities/matrix.d.ts.map +1 -1
- package/data/build/dist/dsh-capabilities/matrix.js +3 -0
- package/data/build/dist/dsh-capabilities/matrix.js.map +1 -1
- package/data/build/dist/dsh-capabilities/routes.d.ts.map +1 -1
- package/data/build/dist/dsh-capabilities/routes.js +18 -0
- package/data/build/dist/dsh-capabilities/routes.js.map +1 -1
- package/data/build/dist/dsh-capabilities/settings-store.d.ts +2 -0
- package/data/build/dist/dsh-capabilities/settings-store.d.ts.map +1 -1
- package/data/build/dist/dsh-capabilities/settings-store.js.map +1 -1
- package/data/build/dist/dsh-capabilities/types.d.ts +1 -1
- package/data/build/dist/dsh-capabilities/types.d.ts.map +1 -1
- package/data/build/dist/dsh-capabilities/types.js.map +1 -1
- package/data/build/dist/host/avatar/catalog.d.ts +21 -0
- package/data/build/dist/host/avatar/catalog.d.ts.map +1 -0
- package/data/build/dist/host/avatar/catalog.js +123 -0
- package/data/build/dist/host/avatar/catalog.js.map +1 -0
- package/data/build/dist/host/avatar/engine.d.ts +42 -0
- package/data/build/dist/host/avatar/engine.d.ts.map +1 -0
- package/data/build/dist/host/avatar/engine.js +167 -0
- package/data/build/dist/host/avatar/engine.js.map +1 -0
- package/data/build/dist/host/avatar/materials.d.ts +28 -0
- package/data/build/dist/host/avatar/materials.d.ts.map +1 -0
- package/data/build/dist/host/avatar/materials.js +183 -0
- package/data/build/dist/host/avatar/materials.js.map +1 -0
- package/data/build/dist/host/avatar/packages.d.ts +34 -0
- package/data/build/dist/host/avatar/packages.d.ts.map +1 -0
- package/data/build/dist/host/avatar/packages.js +200 -0
- package/data/build/dist/host/avatar/packages.js.map +1 -0
- package/data/build/dist/host/avatar/registry.d.ts +12 -0
- package/data/build/dist/host/avatar/registry.d.ts.map +1 -0
- package/data/build/dist/host/avatar/registry.js +22 -0
- package/data/build/dist/host/avatar/registry.js.map +1 -0
- package/data/build/dist/host/avatar/remote.d.ts +18 -0
- package/data/build/dist/host/avatar/remote.d.ts.map +1 -0
- package/data/build/dist/host/avatar/remote.js +103 -0
- package/data/build/dist/host/avatar/remote.js.map +1 -0
- package/data/build/dist/host/avatar/sources.d.ts +11 -0
- package/data/build/dist/host/avatar/sources.d.ts.map +1 -0
- package/data/build/dist/host/avatar/sources.js +78 -0
- package/data/build/dist/host/avatar/sources.js.map +1 -0
- package/data/build/dist/host/avatar/temporary-previews.d.ts +26 -0
- package/data/build/dist/host/avatar/temporary-previews.d.ts.map +1 -0
- package/data/build/dist/host/avatar/temporary-previews.js +139 -0
- package/data/build/dist/host/avatar/temporary-previews.js.map +1 -0
- package/data/build/dist/host/cli-adapters/acp-cli-driver.d.ts +18 -1
- package/data/build/dist/host/cli-adapters/acp-cli-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/acp-cli-driver.js +26 -8
- package/data/build/dist/host/cli-adapters/acp-cli-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/attachment-utils.d.ts +16 -5
- package/data/build/dist/host/cli-adapters/attachment-utils.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/attachment-utils.js +152 -42
- package/data/build/dist/host/cli-adapters/attachment-utils.js.map +1 -1
- package/data/build/dist/host/cli-adapters/claude-driver.d.ts +14 -8
- package/data/build/dist/host/cli-adapters/claude-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/claude-driver.js +101 -76
- package/data/build/dist/host/cli-adapters/claude-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/codex-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/codex-driver.js +84 -9
- package/data/build/dist/host/cli-adapters/codex-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/command-code-acp-loader.d.ts +23 -0
- package/data/build/dist/host/cli-adapters/command-code-acp-loader.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/command-code-acp-loader.js +39 -0
- package/data/build/dist/host/cli-adapters/command-code-acp-loader.js.map +1 -0
- package/data/build/dist/host/cli-adapters/command-code-driver.d.ts +17 -6
- package/data/build/dist/host/cli-adapters/command-code-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/command-code-driver.js +430 -20
- package/data/build/dist/host/cli-adapters/command-code-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/command-code-subscription.d.ts +1 -1
- package/data/build/dist/host/cli-adapters/command-code-subscription.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/command-code-subscription.js +7 -4
- package/data/build/dist/host/cli-adapters/command-code-subscription.js.map +1 -1
- package/data/build/dist/host/cli-adapters/dsh-message-projector.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/dsh-message-projector.js +28 -0
- package/data/build/dist/host/cli-adapters/dsh-message-projector.js.map +1 -1
- package/data/build/dist/host/cli-adapters/dsh-tool-history.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/dsh-tool-history.js +23 -1
- package/data/build/dist/host/cli-adapters/dsh-tool-history.js.map +1 -1
- package/data/build/dist/host/cli-adapters/feature.js +1 -1
- package/data/build/dist/host/cli-adapters/feature.js.map +1 -1
- package/data/build/dist/host/cli-adapters/grok-driver.d.ts +4 -2
- package/data/build/dist/host/cli-adapters/grok-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/grok-driver.js +208 -9
- package/data/build/dist/host/cli-adapters/grok-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/json-rpc-process.d.ts +2 -0
- package/data/build/dist/host/cli-adapters/json-rpc-process.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/json-rpc-process.js +8 -3
- package/data/build/dist/host/cli-adapters/json-rpc-process.js.map +1 -1
- package/data/build/dist/host/cli-adapters/kimi-driver.d.ts +4 -0
- package/data/build/dist/host/cli-adapters/kimi-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/kimi-driver.js +11 -4
- package/data/build/dist/host/cli-adapters/kimi-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/mcode-driver.js +2 -2
- package/data/build/dist/host/cli-adapters/mcode-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/new-api-subscription.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/new-api-subscription.js +11 -58
- package/data/build/dist/host/cli-adapters/new-api-subscription.js.map +1 -1
- package/data/build/dist/host/cli-adapters/opencode-driver.d.ts +5 -2
- package/data/build/dist/host/cli-adapters/opencode-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/opencode-driver.js +136 -18
- package/data/build/dist/host/cli-adapters/opencode-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/pi-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/pi-driver.js +2 -1
- package/data/build/dist/host/cli-adapters/pi-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/process-utils.d.ts +10 -0
- package/data/build/dist/host/cli-adapters/process-utils.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/process-utils.js +20 -0
- package/data/build/dist/host/cli-adapters/process-utils.js.map +1 -1
- package/data/build/dist/host/cli-adapters/provider-subscription.d.ts +3 -0
- package/data/build/dist/host/cli-adapters/provider-subscription.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/provider-subscription.js +42 -8
- package/data/build/dist/host/cli-adapters/provider-subscription.js.map +1 -1
- package/data/build/dist/host/cli-adapters/registry.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/registry.js +5 -3
- package/data/build/dist/host/cli-adapters/registry.js.map +1 -1
- package/data/build/dist/host/cli-adapters/rpc-driver-utils.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/rpc-driver-utils.js +2 -9
- package/data/build/dist/host/cli-adapters/rpc-driver-utils.js.map +1 -1
- package/data/build/dist/host/cli-adapters/skill-filesystem.d.ts +25 -0
- package/data/build/dist/host/cli-adapters/skill-filesystem.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/skill-filesystem.js +161 -0
- package/data/build/dist/host/cli-adapters/skill-filesystem.js.map +1 -0
- package/data/build/dist/host/cli-adapters/standard-stream-driver.d.ts +1 -0
- package/data/build/dist/host/cli-adapters/standard-stream-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/standard-stream-driver.js +4 -0
- package/data/build/dist/host/cli-adapters/standard-stream-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/zcode-driver.d.ts +8 -2
- package/data/build/dist/host/cli-adapters/zcode-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/zcode-driver.js +166 -55
- package/data/build/dist/host/cli-adapters/zcode-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/zcode-interactions.d.ts +18 -0
- package/data/build/dist/host/cli-adapters/zcode-interactions.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/zcode-interactions.js +90 -0
- package/data/build/dist/host/cli-adapters/zcode-interactions.js.map +1 -0
- package/data/build/dist/host/cli-adapters/zcode-provider-config.d.ts +26 -0
- package/data/build/dist/host/cli-adapters/zcode-provider-config.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/zcode-provider-config.js +102 -0
- package/data/build/dist/host/cli-adapters/zcode-provider-config.js.map +1 -0
- package/data/build/dist/host/cli-adapters/zcode-subscription.d.ts +2 -7
- package/data/build/dist/host/cli-adapters/zcode-subscription.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/zcode-subscription.js.map +1 -1
- package/data/build/dist/host/cli-adapters/zcode-telemetry.d.ts +17 -0
- package/data/build/dist/host/cli-adapters/zcode-telemetry.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/zcode-telemetry.js +124 -0
- package/data/build/dist/host/cli-adapters/zcode-telemetry.js.map +1 -0
- package/data/build/dist/host/cli-bridge/injections.d.ts +2 -9
- package/data/build/dist/host/cli-bridge/injections.d.ts.map +1 -1
- package/data/build/dist/host/cli-bridge/injections.js +7 -17
- package/data/build/dist/host/cli-bridge/injections.js.map +1 -1
- package/data/build/dist/host/desktop-assistant/controller.d.ts +44 -0
- package/data/build/dist/host/desktop-assistant/controller.d.ts.map +1 -0
- package/data/build/dist/host/desktop-assistant/controller.js +150 -0
- package/data/build/dist/host/desktop-assistant/controller.js.map +1 -0
- package/data/build/dist/host/desktop-assistant/feature.d.ts +9 -0
- package/data/build/dist/host/desktop-assistant/feature.d.ts.map +1 -0
- package/data/build/dist/host/desktop-assistant/feature.js +102 -0
- package/data/build/dist/host/desktop-assistant/feature.js.map +1 -0
- package/data/build/dist/host/desktop-assistant/launcher.d.ts +5 -0
- package/data/build/dist/host/desktop-assistant/launcher.d.ts.map +1 -0
- package/data/build/dist/host/desktop-assistant/launcher.js +84 -0
- package/data/build/dist/host/desktop-assistant/launcher.js.map +1 -0
- package/data/build/dist/host/desktop-assistant/mac-agent.d.ts +5 -0
- package/data/build/dist/host/desktop-assistant/mac-agent.d.ts.map +1 -0
- package/data/build/dist/host/desktop-assistant/mac-agent.js +122 -0
- package/data/build/dist/host/desktop-assistant/mac-agent.js.map +1 -0
- package/data/build/dist/host/desktop-assistant/process.d.ts +4 -0
- package/data/build/dist/host/desktop-assistant/process.d.ts.map +1 -0
- package/data/build/dist/host/desktop-assistant/process.js +25 -0
- package/data/build/dist/host/desktop-assistant/process.js.map +1 -0
- package/data/build/dist/host/desktop-assistant/server.d.ts +12 -0
- package/data/build/dist/host/desktop-assistant/server.d.ts.map +1 -0
- package/data/build/dist/host/desktop-assistant/server.js +74 -0
- package/data/build/dist/host/desktop-assistant/server.js.map +1 -0
- package/data/build/dist/host/desktop-assistant/win-agent.d.ts +2 -0
- package/data/build/dist/host/desktop-assistant/win-agent.d.ts.map +1 -0
- package/data/build/dist/host/desktop-assistant/win-agent.js +197 -0
- package/data/build/dist/host/desktop-assistant/win-agent.js.map +1 -0
- package/data/build/dist/host/features/assistant-avatar-assets.d.ts +3 -0
- package/data/build/dist/host/features/assistant-avatar-assets.d.ts.map +1 -0
- package/data/build/dist/host/features/assistant-avatar-assets.js +3 -0
- package/data/build/dist/host/features/assistant-avatar-assets.js.map +1 -0
- package/data/build/dist/host/features/assistant-avatar-basics.d.ts +3 -0
- package/data/build/dist/host/features/assistant-avatar-basics.d.ts.map +1 -0
- package/data/build/dist/host/features/assistant-avatar-basics.js +34 -0
- package/data/build/dist/host/features/assistant-avatar-basics.js.map +1 -0
- package/data/build/dist/host/features/assistant-avatar-legacy-assets.d.ts +6 -0
- package/data/build/dist/host/features/assistant-avatar-legacy-assets.d.ts.map +1 -0
- package/data/build/dist/host/features/assistant-avatar-legacy-assets.js +146 -0
- package/data/build/dist/host/features/assistant-avatar-legacy-assets.js.map +1 -0
- package/data/build/dist/host/features/assistant-avatar-runtime.d.ts +20 -0
- package/data/build/dist/host/features/assistant-avatar-runtime.d.ts.map +1 -0
- package/data/build/dist/host/features/assistant-avatar-runtime.js +235 -0
- package/data/build/dist/host/features/assistant-avatar-runtime.js.map +1 -0
- package/data/build/dist/host/features/assistant-conversation-storage.d.ts +8 -0
- package/data/build/dist/host/features/assistant-conversation-storage.d.ts.map +1 -0
- package/data/build/dist/host/features/assistant-conversation-storage.js +38 -0
- package/data/build/dist/host/features/assistant-conversation-storage.js.map +1 -0
- package/data/build/dist/host/features/assistant-conversation.d.ts +57 -0
- package/data/build/dist/host/features/assistant-conversation.d.ts.map +1 -0
- package/data/build/dist/host/features/assistant-conversation.js +364 -0
- package/data/build/dist/host/features/assistant-conversation.js.map +1 -0
- package/data/build/dist/host/features/assistant-dispatch.d.ts +2 -2
- package/data/build/dist/host/features/assistant-dispatch.d.ts.map +1 -1
- package/data/build/dist/host/features/assistant-dispatch.js +4 -3
- package/data/build/dist/host/features/assistant-dispatch.js.map +1 -1
- package/data/build/dist/host/features/assistant-index-analysis.d.ts +49 -0
- package/data/build/dist/host/features/assistant-index-analysis.d.ts.map +1 -0
- package/data/build/dist/host/features/assistant-index-analysis.js +255 -0
- package/data/build/dist/host/features/assistant-index-analysis.js.map +1 -0
- package/data/build/dist/host/features/assistant-index-journal.d.ts +20 -0
- package/data/build/dist/host/features/assistant-index-journal.d.ts.map +1 -0
- package/data/build/dist/host/features/assistant-index-journal.js +40 -0
- package/data/build/dist/host/features/assistant-index-journal.js.map +1 -0
- package/data/build/dist/host/features/assistant-index-retry.d.ts +12 -0
- package/data/build/dist/host/features/assistant-index-retry.d.ts.map +1 -0
- package/data/build/dist/host/features/assistant-index-retry.js +54 -0
- package/data/build/dist/host/features/assistant-index-retry.js.map +1 -0
- package/data/build/dist/host/features/assistant-index-updates.d.ts +40 -0
- package/data/build/dist/host/features/assistant-index-updates.d.ts.map +1 -0
- package/data/build/dist/host/features/assistant-index-updates.js +183 -0
- package/data/build/dist/host/features/assistant-index-updates.js.map +1 -0
- package/data/build/dist/host/features/assistant-lifecycle-settings.d.ts +5 -0
- package/data/build/dist/host/features/assistant-lifecycle-settings.d.ts.map +1 -0
- package/data/build/dist/host/features/assistant-lifecycle-settings.js +72 -0
- package/data/build/dist/host/features/assistant-lifecycle-settings.js.map +1 -0
- package/data/build/dist/host/features/assistant-management-tools.d.ts +34 -0
- package/data/build/dist/host/features/assistant-management-tools.d.ts.map +1 -0
- package/data/build/dist/host/features/assistant-management-tools.js +69 -0
- package/data/build/dist/host/features/assistant-management-tools.js.map +1 -0
- package/data/build/dist/host/features/assistant-prompts.d.ts +6 -0
- package/data/build/dist/host/features/assistant-prompts.d.ts.map +1 -0
- package/data/build/dist/host/features/assistant-prompts.js +62 -0
- package/data/build/dist/host/features/assistant-prompts.js.map +1 -0
- package/data/build/dist/host/features/assistant-session-index.d.ts +6 -1
- package/data/build/dist/host/features/assistant-session-index.d.ts.map +1 -1
- package/data/build/dist/host/features/assistant-session-index.js +11 -12
- package/data/build/dist/host/features/assistant-session-index.js.map +1 -1
- package/data/build/dist/host/features/assistant-structured-index.d.ts +21 -0
- package/data/build/dist/host/features/assistant-structured-index.d.ts.map +1 -0
- package/data/build/dist/host/features/assistant-structured-index.js +138 -0
- package/data/build/dist/host/features/assistant-structured-index.js.map +1 -0
- package/data/build/dist/host/features/assistant-summary.d.ts.map +1 -1
- package/data/build/dist/host/features/assistant-summary.js +7 -1
- package/data/build/dist/host/features/assistant-summary.js.map +1 -1
- package/data/build/dist/host/features/assistant-text-chat.d.ts +29 -0
- package/data/build/dist/host/features/assistant-text-chat.d.ts.map +1 -0
- package/data/build/dist/host/features/assistant-text-chat.js +195 -0
- package/data/build/dist/host/features/assistant-text-chat.js.map +1 -0
- package/data/build/dist/host/features/assistant-tts-service.d.ts +47 -0
- package/data/build/dist/host/features/assistant-tts-service.d.ts.map +1 -0
- package/data/build/dist/host/features/assistant-tts-service.js +507 -0
- package/data/build/dist/host/features/assistant-tts-service.js.map +1 -0
- package/data/build/dist/host/features/assistant-voice-chat.d.ts +35 -0
- package/data/build/dist/host/features/assistant-voice-chat.d.ts.map +1 -0
- package/data/build/dist/host/features/assistant-voice-chat.js +133 -0
- package/data/build/dist/host/features/assistant-voice-chat.js.map +1 -0
- package/data/build/dist/host/features/assistant-voice-hotwords.d.ts +33 -0
- package/data/build/dist/host/features/assistant-voice-hotwords.d.ts.map +1 -0
- package/data/build/dist/host/features/assistant-voice-hotwords.js +114 -0
- package/data/build/dist/host/features/assistant-voice-hotwords.js.map +1 -0
- package/data/build/dist/host/features/assistant-voice-initialization.d.ts +26 -0
- package/data/build/dist/host/features/assistant-voice-initialization.d.ts.map +1 -0
- package/data/build/dist/host/features/assistant-voice-initialization.js +68 -0
- package/data/build/dist/host/features/assistant-voice-initialization.js.map +1 -0
- package/data/build/dist/host/features/assistant-voice-sources.d.ts +13 -0
- package/data/build/dist/host/features/assistant-voice-sources.d.ts.map +1 -0
- package/data/build/dist/host/features/assistant-voice-sources.js +72 -0
- package/data/build/dist/host/features/assistant-voice-sources.js.map +1 -0
- package/data/build/dist/host/features/assistant-voice-stream.d.ts +10 -0
- package/data/build/dist/host/features/assistant-voice-stream.d.ts.map +1 -1
- package/data/build/dist/host/features/assistant-voice-stream.js +208 -5
- package/data/build/dist/host/features/assistant-voice-stream.js.map +1 -1
- package/data/build/dist/host/features/global-voice-rpc.d.ts +8 -1
- package/data/build/dist/host/features/global-voice-rpc.d.ts.map +1 -1
- package/data/build/dist/host/features/global-voice-rpc.js +1055 -153
- package/data/build/dist/host/features/global-voice-rpc.js.map +1 -1
- package/data/build/dist/host/features/index.d.ts.map +1 -1
- package/data/build/dist/host/features/index.js +4 -0
- package/data/build/dist/host/features/index.js.map +1 -1
- package/data/build/dist/host/features/moss-tts-worker.d.ts +32 -0
- package/data/build/dist/host/features/moss-tts-worker.d.ts.map +1 -0
- package/data/build/dist/host/features/moss-tts-worker.js +216 -0
- package/data/build/dist/host/features/moss-tts-worker.js.map +1 -0
- package/data/build/dist/host/features/peer-host.d.ts.map +1 -1
- package/data/build/dist/host/features/peer-host.js +38 -7
- package/data/build/dist/host/features/peer-host.js.map +1 -1
- package/data/build/dist/host/features/sherpa-voice-runtime.d.ts +11 -0
- package/data/build/dist/host/features/sherpa-voice-runtime.d.ts.map +1 -1
- package/data/build/dist/host/features/sherpa-voice-runtime.js +72 -17
- package/data/build/dist/host/features/sherpa-voice-runtime.js.map +1 -1
- package/data/build/dist/host/features/types.d.ts +9 -1
- package/data/build/dist/host/features/types.d.ts.map +1 -1
- package/data/build/dist/host/features/voice-model-management.d.ts +22 -0
- package/data/build/dist/host/features/voice-model-management.d.ts.map +1 -0
- package/data/build/dist/host/features/voice-model-management.js +178 -0
- package/data/build/dist/host/features/voice-model-management.js.map +1 -0
- package/data/build/dist/host/features/voice-model-probe.d.ts +8 -0
- package/data/build/dist/host/features/voice-model-probe.d.ts.map +1 -0
- package/data/build/dist/host/features/voice-model-probe.js +76 -0
- package/data/build/dist/host/features/voice-model-probe.js.map +1 -0
- package/data/build/dist/host/features/voice-model-setup.d.ts +5 -2
- package/data/build/dist/host/features/voice-model-setup.d.ts.map +1 -1
- package/data/build/dist/host/features/voice-model-setup.js +40 -13
- package/data/build/dist/host/features/voice-model-setup.js.map +1 -1
- package/data/build/dist/host/features/voice-process-environment.d.ts +3 -0
- package/data/build/dist/host/features/voice-process-environment.d.ts.map +1 -0
- package/data/build/dist/host/features/voice-process-environment.js +16 -0
- package/data/build/dist/host/features/voice-process-environment.js.map +1 -0
- package/data/build/dist/host/features/voice-python-runtime.d.ts +21 -0
- package/data/build/dist/host/features/voice-python-runtime.d.ts.map +1 -0
- package/data/build/dist/host/features/voice-python-runtime.js +189 -0
- package/data/build/dist/host/features/voice-python-runtime.js.map +1 -0
- package/data/build/dist/host/index-injection.d.ts.map +1 -1
- package/data/build/dist/host/index-injection.js +5 -1
- package/data/build/dist/host/index-injection.js.map +1 -1
- package/data/build/dist/host/index.d.ts +5 -0
- package/data/build/dist/host/index.d.ts.map +1 -1
- package/data/build/dist/host/index.js +33 -12
- package/data/build/dist/host/index.js.map +1 -1
- package/data/build/dist/host/lan-access-dsh.d.ts.map +1 -1
- package/data/build/dist/host/lan-access-dsh.js +2 -1
- package/data/build/dist/host/lan-access-dsh.js.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-aggregate-service.d.ts +1 -0
- package/data/build/dist/host/modules/peer-host/peer-host-aggregate-service.d.ts.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-aggregate-service.js +1 -0
- package/data/build/dist/host/modules/peer-host/peer-host-aggregate-service.js.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-native-protocol.d.ts +2 -0
- package/data/build/dist/host/modules/peer-host/peer-host-native-protocol.d.ts.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-native-protocol.js +5 -0
- package/data/build/dist/host/modules/peer-host/peer-host-native-protocol.js.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-remote-summary-source.d.ts.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-remote-summary-source.js +15 -1
- package/data/build/dist/host/modules/peer-host/peer-host-remote-summary-source.js.map +1 -1
- package/data/build/dist/host/rpc.d.ts.map +1 -1
- package/data/build/dist/host/rpc.js +50 -4
- package/data/build/dist/host/rpc.js.map +1 -1
- package/data/build/dist/host/settings.d.ts +2 -1
- package/data/build/dist/host/settings.d.ts.map +1 -1
- package/data/build/dist/host/settings.js +77 -13
- package/data/build/dist/host/settings.js.map +1 -1
- package/data/build/dist/host/stage0-dev-hmr.d.ts +6 -0
- package/data/build/dist/host/stage0-dev-hmr.d.ts.map +1 -0
- package/data/build/dist/host/stage0-dev-hmr.js +20 -0
- package/data/build/dist/host/stage0-dev-hmr.js.map +1 -0
- package/data/build/dist/host/tar-archive.d.ts +8 -0
- package/data/build/dist/host/tar-archive.d.ts.map +1 -0
- package/data/build/dist/host/tar-archive.js +17 -0
- package/data/build/dist/host/tar-archive.js.map +1 -0
- package/data/build/dist/host/voice-diagnostics.d.ts +34 -0
- package/data/build/dist/host/voice-diagnostics.d.ts.map +1 -0
- package/data/build/dist/host/voice-diagnostics.js +124 -0
- package/data/build/dist/host/voice-diagnostics.js.map +1 -0
- package/data/build/dist/shared/assistant-attachments.d.ts +27 -0
- package/data/build/dist/shared/assistant-attachments.d.ts.map +1 -0
- package/data/build/dist/shared/assistant-attachments.js +45 -0
- package/data/build/dist/shared/assistant-attachments.js.map +1 -0
- package/data/build/dist/shared/assistant-avatar-adapters.d.ts +18 -0
- package/data/build/dist/shared/assistant-avatar-adapters.d.ts.map +1 -0
- package/data/build/dist/shared/assistant-avatar-adapters.js +119 -0
- package/data/build/dist/shared/assistant-avatar-adapters.js.map +1 -0
- package/data/build/dist/shared/assistant-avatar-catalog.d.ts +37 -0
- package/data/build/dist/shared/assistant-avatar-catalog.d.ts.map +1 -0
- package/data/build/dist/shared/assistant-avatar-catalog.js +21 -0
- package/data/build/dist/shared/assistant-avatar-catalog.js.map +1 -0
- package/data/build/dist/shared/assistant-avatar-engine.d.ts +31 -0
- package/data/build/dist/shared/assistant-avatar-engine.d.ts.map +1 -0
- package/data/build/dist/shared/assistant-avatar-engine.js +28 -0
- package/data/build/dist/shared/assistant-avatar-engine.js.map +1 -0
- package/data/build/dist/shared/assistant-avatar-installation.d.ts +17 -0
- package/data/build/dist/shared/assistant-avatar-installation.d.ts.map +1 -0
- package/data/build/dist/shared/assistant-avatar-installation.js +7 -0
- package/data/build/dist/shared/assistant-avatar-installation.js.map +1 -0
- package/data/build/dist/shared/assistant-avatar-legacy-resources.d.ts +6 -0
- package/data/build/dist/shared/assistant-avatar-legacy-resources.d.ts.map +1 -0
- package/data/build/dist/shared/assistant-avatar-legacy-resources.js +20 -0
- package/data/build/dist/shared/assistant-avatar-legacy-resources.js.map +1 -0
- package/data/build/dist/shared/assistant-avatar-legacy.d.ts +15 -0
- package/data/build/dist/shared/assistant-avatar-legacy.d.ts.map +1 -0
- package/data/build/dist/shared/assistant-avatar-legacy.js +34 -0
- package/data/build/dist/shared/assistant-avatar-legacy.js.map +1 -0
- package/data/build/dist/shared/assistant-avatar-presets.d.ts +3 -0
- package/data/build/dist/shared/assistant-avatar-presets.d.ts.map +1 -0
- package/data/build/dist/shared/assistant-avatar-presets.js +3 -0
- package/data/build/dist/shared/assistant-avatar-presets.js.map +1 -0
- package/data/build/dist/shared/assistant-avatar-registration.d.ts +16 -0
- package/data/build/dist/shared/assistant-avatar-registration.d.ts.map +1 -0
- package/data/build/dist/shared/assistant-avatar-registration.js +33 -0
- package/data/build/dist/shared/assistant-avatar-registration.js.map +1 -0
- package/data/build/dist/shared/assistant-avatar-resources.d.ts +26 -0
- package/data/build/dist/shared/assistant-avatar-resources.d.ts.map +1 -0
- package/data/build/dist/shared/assistant-avatar-resources.js +4 -0
- package/data/build/dist/shared/assistant-avatar-resources.js.map +1 -0
- package/data/build/dist/shared/assistant-avatar.d.ts +103 -0
- package/data/build/dist/shared/assistant-avatar.d.ts.map +1 -0
- package/data/build/dist/shared/assistant-avatar.js +240 -0
- package/data/build/dist/shared/assistant-avatar.js.map +1 -0
- package/data/build/dist/shared/assistant-commands.d.ts +3 -0
- package/data/build/dist/shared/assistant-commands.d.ts.map +1 -0
- package/data/build/dist/shared/assistant-commands.js +3 -0
- package/data/build/dist/shared/assistant-commands.js.map +1 -0
- package/data/build/dist/shared/assistant-lifecycle.d.ts +17 -0
- package/data/build/dist/shared/assistant-lifecycle.d.ts.map +1 -0
- package/data/build/dist/shared/assistant-lifecycle.js +45 -0
- package/data/build/dist/shared/assistant-lifecycle.js.map +1 -0
- package/data/build/dist/shared/assistant-message-timeline.d.ts +13 -0
- package/data/build/dist/shared/assistant-message-timeline.d.ts.map +1 -0
- package/data/build/dist/shared/assistant-message-timeline.js +22 -0
- package/data/build/dist/shared/assistant-message-timeline.js.map +1 -0
- package/data/build/dist/shared/assistant-prompts.d.ts +12 -0
- package/data/build/dist/shared/assistant-prompts.d.ts.map +1 -0
- package/data/build/dist/shared/assistant-prompts.js +32 -0
- package/data/build/dist/shared/assistant-prompts.js.map +1 -0
- package/data/build/dist/shared/assistant-tts.d.ts +93 -0
- package/data/build/dist/shared/assistant-tts.d.ts.map +1 -0
- package/data/build/dist/shared/assistant-tts.js +80 -0
- package/data/build/dist/shared/assistant-tts.js.map +1 -0
- package/data/build/dist/shared/assistant-voice-sessions.d.ts +13 -0
- package/data/build/dist/shared/assistant-voice-sessions.d.ts.map +1 -0
- package/data/build/dist/shared/assistant-voice-sessions.js +16 -0
- package/data/build/dist/shared/assistant-voice-sessions.js.map +1 -0
- package/data/build/dist/shared/contracts/assistant.d.ts +206 -0
- package/data/build/dist/shared/contracts/assistant.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/cli-adapter.d.ts +4 -0
- package/data/build/dist/shared/contracts/cli-adapter.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/config.d.ts +23 -0
- package/data/build/dist/shared/contracts/config.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/config.js +2 -0
- package/data/build/dist/shared/contracts/config.js.map +1 -1
- package/data/build/dist/shared/contracts/peer-host.d.ts +2 -0
- package/data/build/dist/shared/contracts/peer-host.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/peer-host.js.map +1 -1
- package/data/build/dist/shared/contracts/terminal-share.d.ts +27 -0
- package/data/build/dist/shared/contracts/terminal-share.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/terminal-share.js +2 -0
- package/data/build/dist/shared/contracts/terminal-share.js.map +1 -0
- package/data/build/dist/shared/contracts/version.d.ts +1 -1
- package/data/build/dist/shared/contracts/version.js +1 -1
- package/data/build/dist/shared/contracts/voice-runtime.d.ts +15 -1
- package/data/build/dist/shared/contracts/voice-runtime.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/voice-runtime.js.map +1 -1
- package/data/build/dist/shared/desktop-assistant.d.ts +35 -0
- package/data/build/dist/shared/desktop-assistant.d.ts.map +1 -0
- package/data/build/dist/shared/desktop-assistant.js +27 -0
- package/data/build/dist/shared/desktop-assistant.js.map +1 -0
- package/data/build/dist/shared/index.d.ts +16 -2
- package/data/build/dist/shared/index.d.ts.map +1 -1
- package/data/build/dist/shared/index.js +10 -0
- package/data/build/dist/shared/index.js.map +1 -1
- package/data/build/dist/shared/runtime-environment.d.ts +5 -0
- package/data/build/dist/shared/runtime-environment.d.ts.map +1 -0
- package/data/build/dist/shared/runtime-environment.js +7 -0
- package/data/build/dist/shared/runtime-environment.js.map +1 -0
- package/data/build/dist/shared/voice-diagnostics.d.ts +18 -0
- package/data/build/dist/shared/voice-diagnostics.d.ts.map +1 -0
- package/data/build/dist/shared/voice-diagnostics.js +57 -0
- package/data/build/dist/shared/voice-diagnostics.js.map +1 -0
- package/data/build/dist/shared/voice-initialization.d.ts +22 -0
- package/data/build/dist/shared/voice-initialization.d.ts.map +1 -0
- package/data/build/dist/shared/voice-initialization.js +4 -0
- package/data/build/dist/shared/voice-initialization.js.map +1 -0
- package/data/build/dist/shared/voice-models.d.ts +43 -0
- package/data/build/dist/shared/voice-models.d.ts.map +1 -1
- package/data/build/dist/shared/voice-models.js +23 -8
- package/data/build/dist/shared/voice-models.js.map +1 -1
- package/data/build/dist/shared/voice-stream.d.ts +12 -1
- package/data/build/dist/shared/voice-stream.d.ts.map +1 -1
- package/data/build/dist/shared/voice-stream.js +8 -1
- package/data/build/dist/shared/voice-stream.js.map +1 -1
- package/package.json +21 -3
- package/profile/README.md +2 -2
- package/profile/package.json +2 -2
- package/profile/version.json +1 -1
- package/version.json +1 -1
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import { mkdir, mkdtemp, readFile, rm, writeFile, rename } from 'node:fs/promises';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
import { resolveDshHome } from '@deepseek-ai/dsh-home-paths';
|
|
6
|
+
import { buildMacAssistantScript } from './mac-agent.js';
|
|
7
|
+
import { buildWinAssistantScript } from './win-agent.js';
|
|
8
|
+
import { observeDesktopAssistantProcess } from './process.js';
|
|
9
|
+
/** 所有运行数据落在插件自有目录,不触碰 Desktop 壳或其包目录。 */
|
|
10
|
+
export function desktopAssistantDirectory() { return join(resolveDshHome(), 'codingns4dsh', 'desktop-assistant'); }
|
|
11
|
+
export async function launchDesktopAssistant(onEvent, onExit) {
|
|
12
|
+
const directory = desktopAssistantDirectory();
|
|
13
|
+
await mkdir(directory, { recursive: true });
|
|
14
|
+
const temporary = await mkdtemp(join(directory, 'run-'));
|
|
15
|
+
const windows = process.platform === 'win32';
|
|
16
|
+
const sdkRoot = fileURLToPath(new URL('../../../../../assets/desktop-assistant/webview2/', import.meta.url));
|
|
17
|
+
const script = join(temporary, windows ? 'assistant.ps1' : 'assistant.js');
|
|
18
|
+
let bounds;
|
|
19
|
+
try {
|
|
20
|
+
bounds = JSON.parse(await readFile(join(directory, 'position.json'), 'utf8'));
|
|
21
|
+
}
|
|
22
|
+
catch { /* 首次运行或损坏记录使用系统默认位置。 */ }
|
|
23
|
+
// PowerShell 5.1 无 BOM 时按系统 ANSI 读取,用户目录含中文会导致 SDK 路径损坏。
|
|
24
|
+
try {
|
|
25
|
+
await writeFile(script, windows ? '\uFEFF' + buildWinAssistantScript(sdkRoot) : buildMacAssistantScript(), 'utf8');
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
await rm(temporary, { recursive: true, force: true });
|
|
29
|
+
throw error;
|
|
30
|
+
}
|
|
31
|
+
const command = windows ? join(process.env.SystemRoot ?? 'C:\\Windows', 'System32', 'WindowsPowerShell', 'v1.0', 'powershell.exe') : '/usr/bin/osascript';
|
|
32
|
+
const args = windows ? ['-NoProfile', '-NonInteractive', '-Sta', '-ExecutionPolicy', 'Bypass', '-File', script] : ['-l', 'JavaScript', script];
|
|
33
|
+
const child = spawn(command, args, { stdio: ['pipe', 'pipe', 'pipe'], windowsHide: true });
|
|
34
|
+
let buffer = '', stopped = false, saving = Promise.resolve();
|
|
35
|
+
const failure = (message) => onEvent({ ev: 'error', message });
|
|
36
|
+
const exit = observeDesktopAssistantProcess(child, failure, onExit, () => stopped);
|
|
37
|
+
child.stdout.setEncoding('utf8');
|
|
38
|
+
child.stdout.on('data', (chunk) => {
|
|
39
|
+
buffer += chunk;
|
|
40
|
+
if (buffer.length > 65536) {
|
|
41
|
+
buffer = '';
|
|
42
|
+
failure('原生悬浮输出超出限制');
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
let newline;
|
|
46
|
+
while ((newline = buffer.indexOf('\n')) >= 0) {
|
|
47
|
+
const line = buffer.slice(0, newline);
|
|
48
|
+
buffer = buffer.slice(newline + 1);
|
|
49
|
+
try {
|
|
50
|
+
const event = JSON.parse(line);
|
|
51
|
+
if (event.ev === 'moved' && ['x', 'y', 'width', 'height'].every((key) => typeof event[key] === 'number' && Number.isFinite(event[key]))) {
|
|
52
|
+
const value = JSON.stringify({ x: event.x, y: event.y, width: event.width, height: event.height });
|
|
53
|
+
// 只保存完成拖动的位置;串行原子替换,退出等待最后一笔。
|
|
54
|
+
saving = saving.then(async () => { await writeFile(join(temporary, 'position.json'), value); await rename(join(temporary, 'position.json'), join(directory, 'position.json')); }).catch(() => undefined);
|
|
55
|
+
}
|
|
56
|
+
onEvent(event);
|
|
57
|
+
}
|
|
58
|
+
catch { /* 非协议行不解释为命令。 */ }
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
return {
|
|
62
|
+
send(command) {
|
|
63
|
+
if (stopped || child.stdin.destroyed)
|
|
64
|
+
return;
|
|
65
|
+
const extra = command.cmd === 'load' ? { parentPid: process.ppid, userData: join(directory, 'webview2'), bounds } : {};
|
|
66
|
+
child.stdin.write(JSON.stringify({ ...command, ...extra }) + '\n');
|
|
67
|
+
},
|
|
68
|
+
async stop() {
|
|
69
|
+
if (stopped) {
|
|
70
|
+
await exit;
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
stopped = true;
|
|
74
|
+
if (!child.stdin.destroyed)
|
|
75
|
+
child.stdin.end(JSON.stringify({ cmd: 'quit' }) + '\n');
|
|
76
|
+
const timer = setTimeout(() => child.kill(), 2000);
|
|
77
|
+
await exit;
|
|
78
|
+
clearTimeout(timer);
|
|
79
|
+
await saving;
|
|
80
|
+
await rm(temporary, { recursive: true, force: true });
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=launcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"launcher.js","sourceRoot":"","sources":["../../../../../src/host/desktop-assistant/launcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAClF,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAA;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAA;AACxD,OAAO,EAAE,8BAA8B,E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CAAC,CAAA;QACvD,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** 交给 Desktop 的 open-url 入口恢复主窗口;单纯激活进程不会取消窗口最小化。 */
|
|
2
|
+
export declare function buildMacDesktopFocusScript(): string;
|
|
3
|
+
/** Cocoa/WKWebView 伴随进程;stdout 只传 JSON Lines,原生异常转为明确失败事件。 */
|
|
4
|
+
export declare function buildMacAssistantScript(): string;
|
|
5
|
+
//# sourceMappingURL=mac-agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mac-agent.d.ts","sourceRoot":"","sources":["../../../../../src/host/desktop-assistant/mac-agent.ts"],"names":[],"mappings":"AAEA,qDAAqD;AACrD,wBAAgB,0BAA0B,IAAI,MAAM,CAuBnD;AAED,8DAA8D;AAC9D,wBAAgB,uBAAuB,IAAI,MAAM,CA6FhD"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { clampDesktopAssistantBounds } from '../../shared/desktop-assistant.js';
|
|
2
|
+
/** 交给 Desktop 的 open-url 入口恢复主窗口;单纯激活进程不会取消窗口最小化。 */
|
|
3
|
+
export function buildMacDesktopFocusScript() {
|
|
4
|
+
return String.raw `
|
|
5
|
+
var focusingDesktop=false
|
|
6
|
+
function focusDesktop(){
|
|
7
|
+
if(focusingDesktop)return
|
|
8
|
+
var desktop=$.NSRunningApplication.runningApplicationWithProcessIdentifier(parentPid)
|
|
9
|
+
if(parentPid<=0||desktop.isNil()||desktop.terminated||desktop.bundleURL.isNil())throw new Error('Desktop application is unavailable')
|
|
10
|
+
var configuration=$.NSWorkspaceOpenConfiguration.configuration
|
|
11
|
+
configuration.setActivates(true);configuration.setCreatesNewApplicationInstance(false)
|
|
12
|
+
configuration.setAllowsRunningApplicationSubstitution(false)
|
|
13
|
+
configuration.setPromptsUserIfNeeded(false)
|
|
14
|
+
focusingDesktop=true
|
|
15
|
+
try{
|
|
16
|
+
// 明确指定当前父进程的应用包,避免系统协议默认值指向另一份 Desktop。
|
|
17
|
+
$.NSWorkspace.sharedWorkspace.openURLsWithApplicationAtURLConfigurationCompletionHandler(
|
|
18
|
+
$([$.NSURL.URLWithString('dsh://open')]),desktop.bundleURL,configuration,safe(function(application,error){
|
|
19
|
+
focusingDesktop=false
|
|
20
|
+
if(!error.isNil()){emit({ev:'error',message:'Desktop restore: '+ObjC.unwrap(error.localizedDescription)});return}
|
|
21
|
+
emit({ev:'open'})
|
|
22
|
+
}))
|
|
23
|
+
}catch(error){focusingDesktop=false;throw error}
|
|
24
|
+
}
|
|
25
|
+
`.trim();
|
|
26
|
+
}
|
|
27
|
+
/** Cocoa/WKWebView 伴随进程;stdout 只传 JSON Lines,原生异常转为明确失败事件。 */
|
|
28
|
+
export function buildMacAssistantScript() {
|
|
29
|
+
return String.raw `
|
|
30
|
+
ObjC.import('Cocoa')
|
|
31
|
+
ObjC.import('WebKit')
|
|
32
|
+
var out=$.NSFileHandle.fileHandleWithStandardOutput,NL=String.fromCharCode(10)
|
|
33
|
+
function emit(m){out.writeData($(JSON.stringify(m)+NL).dataUsingEncoding($.NSUTF8StringEncoding))}
|
|
34
|
+
function safe(fn){return function(){try{return fn.apply(null,arguments)}catch(e){emit({ev:'error',message:String(e)})}}}
|
|
35
|
+
var app=$.NSApplication.sharedApplication
|
|
36
|
+
app.setActivationPolicy(1)
|
|
37
|
+
var win=$.NSPanel.alloc.initWithContentRectStyleMaskBackingDefer($.NSMakeRect(0,0,144,156),128,2,false)
|
|
38
|
+
win.setOpaque(false);win.setBackgroundColor($.NSColor.clearColor);win.setHasShadow(false)
|
|
39
|
+
win.setLevel(3);win.setCollectionBehavior(1|16|256);win.setHidesOnDeactivate(false)
|
|
40
|
+
var visible=false,drag=false,lastMouse=null,parentPid=0,origin='',positioned=false
|
|
41
|
+
${buildMacDesktopFocusScript()}
|
|
42
|
+
var clampBounds=${clampDesktopAssistantBounds.toString()}
|
|
43
|
+
function moved(){var f=win.frame;emit({ev:'moved',x:f.origin.x,y:f.origin.y,width:f.size.width,height:f.size.height})}
|
|
44
|
+
function clamp(){
|
|
45
|
+
var f=win.frame,screens=$.NSScreen.screens,areas=[]
|
|
46
|
+
for(var i=0;i<screens.count;i++){var a=screens.objectAtIndex(i).visibleFrame;areas.push({x:a.origin.x,y:a.origin.y,width:a.size.width,height:a.size.height})}
|
|
47
|
+
var next=clampBounds({x:f.origin.x,y:f.origin.y,width:f.size.width,height:f.size.height},areas)
|
|
48
|
+
win.setFrameDisplay($.NSMakeRect(next.x,next.y,next.width,next.height),true)
|
|
49
|
+
}
|
|
50
|
+
function bounds(m){
|
|
51
|
+
var f=win.frame,w=Math.max(72,Math.min(320,Number(m.width)||144)),h=Math.max(78,Math.min(480,Number(m.height)||156))
|
|
52
|
+
var area=$.NSScreen.mainScreen.visibleFrame
|
|
53
|
+
var x=positioned?f.origin.x:area.origin.x+area.size.width-w-24,y=positioned?f.origin.y:area.origin.y+24
|
|
54
|
+
if(m.bounds&&Number.isFinite(m.bounds.x)&&Number.isFinite(m.bounds.y)){x=m.bounds.x;y=m.bounds.y}
|
|
55
|
+
win.setFrameDisplay($.NSMakeRect(x,y,w,h),true);positioned=true;clamp()
|
|
56
|
+
}
|
|
57
|
+
function endDrag(){if(!drag)return;drag=false;clamp();moved()}
|
|
58
|
+
var config=$.WKWebViewConfiguration.alloc.init,controller=$.WKUserContentController.alloc.init
|
|
59
|
+
// JXA 注册类不返回类对象;WebKit 协议元数据也并非所有系统都可见。
|
|
60
|
+
// 显式声明代理方法签名,注册后通过 $ 查找类,由 WebKit 按选择器调用。
|
|
61
|
+
ObjC.registerSubclass({name:'CodingNsAssistantBridge',methods:{'userContentController:didReceiveScriptMessage:':{types:['void',['id','id']],implementation:safe(function(c,m){
|
|
62
|
+
if(!m.frameInfo.isMainFrame)return
|
|
63
|
+
var msg=JSON.parse(ObjC.unwrap(m.body))
|
|
64
|
+
if(msg.type==='ready')emit({ev:'loaded'})
|
|
65
|
+
else if(msg.type==='error')emit({ev:'error',message:String(msg.message).slice(0,500)})
|
|
66
|
+
else if(msg.type==='drag-start'){drag=true;lastMouse=$.NSEvent.mouseLocation}
|
|
67
|
+
else if(msg.type==='drag-end')endDrag()
|
|
68
|
+
else if(msg.type==='open')focusDesktop()
|
|
69
|
+
})}}})
|
|
70
|
+
var bridgeHandler=$.CodingNsAssistantBridge.alloc.init
|
|
71
|
+
controller.addScriptMessageHandlerName(bridgeHandler,$('assistant'));config.setUserContentController(controller)
|
|
72
|
+
config.setWebsiteDataStore($.WKWebsiteDataStore.nonPersistentDataStore)
|
|
73
|
+
var web=$.WKWebView.alloc.initWithFrameConfiguration($.NSMakeRect(0,0,144,156),config)
|
|
74
|
+
web.setValueForKey($.NSNumber.numberWithBool(false),'drawsBackground');win.setContentView(web)
|
|
75
|
+
ObjC.registerSubclass({name:'CodingNsAssistantNavigation',methods:{
|
|
76
|
+
'webView:decidePolicyForNavigationAction:decisionHandler:':{types:['void',['id','id','id']],implementation:safe(function(w,a,done){
|
|
77
|
+
var policy=0
|
|
78
|
+
try{var url=ObjC.unwrap(a.request.URL.absoluteString);policy=url.indexOf(origin+'/')===0?1:0}
|
|
79
|
+
finally{
|
|
80
|
+
// block 的隐含参数只有自身,没有 Objective-C 方法的 selector。
|
|
81
|
+
// 用 NSInvocation 按 void (^)(NSInteger) 签名调用,不能把它当 JS 函数。
|
|
82
|
+
var invocation=$.NSInvocation.invocationWithMethodSignature($.NSMethodSignature.signatureWithObjCTypes('v@?q')),argument=Ref('long')
|
|
83
|
+
argument[0]=policy;invocation.setTarget(done);invocation.setArgumentAtIndex(argument,1);invocation.invoke
|
|
84
|
+
}
|
|
85
|
+
})},
|
|
86
|
+
'webView:didFailProvisionalNavigation:withError:':{types:['void',['id','id','id']],implementation:safe(function(w,n,e){emit({ev:'error',message:'navigation: '+e.code+' '+ObjC.unwrap(e.localizedDescription)})})},
|
|
87
|
+
'webView:didFailNavigation:withError:':{types:['void',['id','id','id']],implementation:safe(function(w,n,e){emit({ev:'error',message:'navigation: '+e.code+' '+ObjC.unwrap(e.localizedDescription)})})},
|
|
88
|
+
'webViewWebContentProcessDidTerminate:':{types:['void',['id']],implementation:safe(function(w){emit({ev:'error',message:'webview process terminated'})})}
|
|
89
|
+
}})
|
|
90
|
+
var navigation=$.CodingNsAssistantNavigation.alloc.init;web.setNavigationDelegate(navigation)
|
|
91
|
+
$.NSTimer.scheduledTimerWithTimeIntervalRepeatsBlock(1/60,true,safe(function(){
|
|
92
|
+
if(!drag)return;if(($.NSEvent.pressedMouseButtons&1)===0||!visible){endDrag();return}
|
|
93
|
+
var p=$.NSEvent.mouseLocation,f=win.frame;win.setFrameOrigin($.NSMakePoint(f.origin.x+p.x-lastMouse.x,f.origin.y+p.y-lastMouse.y));lastMouse=p
|
|
94
|
+
}))
|
|
95
|
+
$.NSNotificationCenter.defaultCenter.addObserverForNameObjectQueueUsingBlock($.NSApplicationDidChangeScreenParametersNotification,$(),$.NSOperationQueue.mainQueue,safe(function(){clamp();moved()}))
|
|
96
|
+
function handle(m){
|
|
97
|
+
if(m.cmd==='quit'){app.terminate($());return}
|
|
98
|
+
if(m.cmd==='hide'){endDrag();win.orderOut($());visible=false;return}
|
|
99
|
+
if(m.cmd==='load'){
|
|
100
|
+
parentPid=Number(m.parentPid)||0;bounds(m)
|
|
101
|
+
var url=$.NSURL.URLWithString($(String(m.url)));origin=String(m.url).split('/').slice(0,3).join('/')
|
|
102
|
+
web.loadRequest($.NSURLRequest.requestWithURL(url));return
|
|
103
|
+
}
|
|
104
|
+
if(m.cmd==='show'){if(!drag)bounds(m);if(!visible){win.orderFrontRegardless;visible=true}emit({ev:'shown'});return}
|
|
105
|
+
}
|
|
106
|
+
var stdin=$.NSFileHandle.fileHandleWithStandardInput,buf='',pending=$.NSMutableData.data
|
|
107
|
+
$.NSNotificationCenter.defaultCenter.addObserverForNameObjectQueueUsingBlock($.NSFileHandleDataAvailableNotification,stdin,$.NSOperationQueue.mainQueue,safe(function(){
|
|
108
|
+
var data=stdin.availableData;if(data.length===0){app.terminate($());return}
|
|
109
|
+
// 管道可能在中文字节中间分块,完整 UTF-8 到达前保留原始数据。
|
|
110
|
+
pending.appendData(data);if(pending.length+buf.length>65536)throw new Error('command too large')
|
|
111
|
+
var decoded=$.NSString.alloc.initWithDataEncoding(pending,$.NSUTF8StringEncoding)
|
|
112
|
+
if(decoded.isNil()){stdin.waitForDataInBackgroundAndNotify;return}
|
|
113
|
+
buf+=decoded.js;pending.setLength(0)
|
|
114
|
+
var i;while((i=buf.indexOf(NL))>=0){var line=buf.slice(0,i);buf=buf.slice(i+1);handle(JSON.parse(line))}
|
|
115
|
+
stdin.waitForDataInBackgroundAndNotify
|
|
116
|
+
}))
|
|
117
|
+
stdin.waitForDataInBackgroundAndNotify
|
|
118
|
+
emit({ev:'ready'})
|
|
119
|
+
app.run
|
|
120
|
+
`.trim();
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=mac-agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mac-agent.js","sourceRoot":"","sources":["../../../../../src/host/desktop-assistant/mac-agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAA;AAE/E,qDAAqD;AACrD,MAAM,UAAU,0BAA0B;IACxC,OAAO,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;CAqBlB,CAAC,IAAI,EAAE,CAAA;AACR,CAAC;AAED,8DAA8D;AAC9D,MAAM,UAAU,uBAAuB;IACrC,OAAO,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;EAYjB,0BAA0B,EAAE;kBACZ,2BAA2B,CAAC,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8EvD,CAAC,IAAI,EAAE,CAAA;AACR,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ChildProcessWithoutNullStreams } from 'node:child_process';
|
|
2
|
+
/** 保留有上限的原生启动诊断;正常回收不产生降级提示。 */
|
|
3
|
+
export declare function observeDesktopAssistantProcess(child: ChildProcessWithoutNullStreams, onError: (message: string) => void, onExit: () => void, isStopping: () => boolean): Promise<void>;
|
|
4
|
+
//# sourceMappingURL=process.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process.d.ts","sourceRoot":"","sources":["../../../../../src/host/desktop-assistant/process.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,oBAAoB,CAAA;AAExE,gCAAgC;AAChC,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,8BAA8B,EAClF,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,EAAE,MAAM,EAAE,MAAM,IAAI,EAAE,UAAU,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAoBlG"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** 保留有上限的原生启动诊断;正常回收不产生降级提示。 */
|
|
2
|
+
export function observeDesktopAssistantProcess(child, onError, onExit, isStopping) {
|
|
3
|
+
let stderr = '', reported = false;
|
|
4
|
+
const failure = (message) => {
|
|
5
|
+
if (reported || isStopping())
|
|
6
|
+
return;
|
|
7
|
+
reported = true;
|
|
8
|
+
// 导航错误可能包含一次性启动 URL,不把实例令牌放进界面。
|
|
9
|
+
onError(message.replace(/([?&]token=)[^\s&"'<>]+/gu, '$1[redacted]').slice(0, 500));
|
|
10
|
+
};
|
|
11
|
+
child.stderr.setEncoding('utf8');
|
|
12
|
+
child.stderr.on('data', (chunk) => { stderr = (stderr + chunk).slice(0, 4096); });
|
|
13
|
+
child.once('error', (error) => failure(`原生悬浮启动失败:${error.message}`));
|
|
14
|
+
// EPIPE 常常先于 close 到达;等待退出诊断,避免它掩盖真正的脚本异常。
|
|
15
|
+
child.stdin.on('error', () => { });
|
|
16
|
+
return new Promise((resolve) => {
|
|
17
|
+
child.once('close', (code, signal) => {
|
|
18
|
+
const reason = stderr.trim() || `code=${String(code)}, signal=${signal ?? 'none'}`;
|
|
19
|
+
failure(`原生悬浮进程已退出:${reason}`);
|
|
20
|
+
onExit();
|
|
21
|
+
resolve();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=process.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process.js","sourceRoot":"","sources":["../../../../../src/host/desktop-assistant/process.ts"],"names":[],"mappings":"AAEA,gCAAgC;AAChC,MAAM,UAAU,8BAA8B,CAAC,KAAqC,EAClF,OAAkC,EAAE,MAAkB,EAAE,UAAyB;IACjF,IAAI,MAAM,GAAG,EAAE,EAAE,QAAQ,GAAG,KAAK,CAAA;IACjC,MAAM,OAAO,GAAG,CAAC,OAAe,EAAQ,EAAE;QACxC,IAAI,QAAQ,IAAI,UAAU,EAAE;YAAE,OAAM;QACpC,QAAQ,GAAG,IAAI,CAAA;QACf,gCAAgC;QAChC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,2BAA2B,EAAE,cAAc,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAA;IACrF,CAAC,CAAA;IACD,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;IAChC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAa,EAAE,EAAE,GAAG,MAAM,GAAG,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA,CAAC,CAAC,CAAC,CAAA;IACxF,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,YAAY,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAA;IACpE,2CAA2C;IAC3C,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC,CAAC,CAAA;IACjC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE;YACnC,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,EAAE,IAAI,QAAQ,MAAM,CAAC,IAAI,CAAC,YAAY,MAAM,IAAI,MAAM,EAAE,CAAA;YAClF,OAAO,CAAC,aAAa,MAAM,EAAE,CAAC,CAAA;YAC9B,MAAM,EAAE,CAAC;YAAC,OAAO,EAAE,CAAA;QACrB,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DesktopAssistantFrame } from '../../shared/desktop-assistant.js';
|
|
2
|
+
export interface DesktopAssistantPage {
|
|
3
|
+
readonly url: string;
|
|
4
|
+
close(): Promise<void>;
|
|
5
|
+
}
|
|
6
|
+
/** 独立回环服务只提供形象,不把完整 DSH 页面或认证会话交给伴随窗口。 */
|
|
7
|
+
export declare function openDesktopAssistantPage(options: {
|
|
8
|
+
readonly frame: () => DesktopAssistantFrame | undefined;
|
|
9
|
+
readonly assets: (request: Request) => Promise<Response>;
|
|
10
|
+
readonly readBundle?: () => Promise<string>;
|
|
11
|
+
}): Promise<DesktopAssistantPage>;
|
|
12
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../../../src/host/desktop-assistant/server.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAA;AAE9E,MAAM,WAAW,oBAAoB;IAAG,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE;AACtF,0CAA0C;AAC1C,wBAAsB,wBAAwB,CAAC,OAAO,EAAE;IACtD,QAAQ,CAAC,KAAK,EAAE,MAAM,qBAAqB,GAAG,SAAS,CAAA;IACvD,QAAQ,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAA;IACxD,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAA;CAC5C,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAyChC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { randomBytes } from 'node:crypto';
|
|
2
|
+
import { createServer } from 'node:http';
|
|
3
|
+
import { readFile } from 'node:fs/promises';
|
|
4
|
+
/** 独立回环服务只提供形象,不把完整 DSH 页面或认证会话交给伴随窗口。 */
|
|
5
|
+
export async function openDesktopAssistantPage(options) {
|
|
6
|
+
const token = randomBytes(32).toString('hex');
|
|
7
|
+
const cookie = `codingns_companion_${randomBytes(8).toString('hex')}=${token}`;
|
|
8
|
+
let origin = '';
|
|
9
|
+
const readBundle = options.readBundle ?? (() => readFile(new URL('../../client/desktop-assistant.js', import.meta.url), 'utf8'));
|
|
10
|
+
// 启动前核对分发文件,缺失时不留下空白原生窗口。
|
|
11
|
+
const bundle = await readBundle();
|
|
12
|
+
const server = createServer((request, response) => {
|
|
13
|
+
void (async () => {
|
|
14
|
+
if (request.headers.host !== new URL(origin).host || request.method !== 'GET') {
|
|
15
|
+
response.writeHead(403).end();
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const url = new URL(request.url ?? '/', origin);
|
|
19
|
+
if (request.headers.origin && request.headers.origin !== origin) {
|
|
20
|
+
response.writeHead(403).end();
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
response.setHeader('Cache-Control', 'no-store');
|
|
24
|
+
response.setHeader('X-Content-Type-Options', 'nosniff');
|
|
25
|
+
response.setHeader('Referrer-Policy', 'no-referrer');
|
|
26
|
+
if (url.pathname === '/' && url.searchParams.get('token') === token) {
|
|
27
|
+
response.writeHead(302, { 'Set-Cookie': `${cookie}; HttpOnly; SameSite=Strict; Path=/`, Location: '/' }).end();
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (!request.headers.cookie?.split(';').some((part) => part.trim() === cookie)) {
|
|
31
|
+
response.writeHead(403).end();
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
if (url.pathname === '/') {
|
|
35
|
+
response.setHeader('Content-Type', 'text/html; charset=utf-8');
|
|
36
|
+
// l2d 2.1.1 用内联 script 安装其固定 Cubism 运行时;不开放外部脚本或 eval。
|
|
37
|
+
response.setHeader('Content-Security-Policy', "default-src 'none'; script-src 'self' 'unsafe-inline' 'wasm-unsafe-eval'; style-src 'unsafe-inline'; img-src 'self' https: http: data: blob:; connect-src 'self' https: http:; font-src 'none'; frame-src 'none'; base-uri 'none'; form-action 'none'");
|
|
38
|
+
response.end('<!doctype html><html lang="zh-CN"><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>助理</title><style>html,body,#root{margin:0;background:transparent;overflow:hidden;width:100%;height:100%;font-family:system-ui}button{font:inherit}</style><div id="root"></div><script src="/renderer.js"></script></html>');
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
if (url.pathname === '/renderer.js') {
|
|
42
|
+
response.setHeader('Content-Type', 'text/javascript; charset=utf-8');
|
|
43
|
+
response.end(bundle);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (url.pathname === '/state') {
|
|
47
|
+
response.setHeader('Content-Type', 'application/json');
|
|
48
|
+
response.end(JSON.stringify(options.frame() ?? null));
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const asset = await options.assets(new Request(url));
|
|
52
|
+
response.statusCode = asset.status;
|
|
53
|
+
for (const [name, value] of asset.headers)
|
|
54
|
+
response.setHeader(name, value);
|
|
55
|
+
response.end(Buffer.from(await asset.arrayBuffer()));
|
|
56
|
+
})().catch(() => { if (!response.headersSent)
|
|
57
|
+
response.writeHead(500); response.end(); });
|
|
58
|
+
});
|
|
59
|
+
await new Promise((resolve, reject) => {
|
|
60
|
+
server.once('error', reject);
|
|
61
|
+
server.listen(0, '127.0.0.1', () => { server.off('error', reject); resolve(); });
|
|
62
|
+
});
|
|
63
|
+
const address = server.address();
|
|
64
|
+
if (!address || typeof address === 'string') {
|
|
65
|
+
await close(server);
|
|
66
|
+
throw new Error('悬浮页面监听失败');
|
|
67
|
+
}
|
|
68
|
+
origin = `http://127.0.0.1:${address.port}`;
|
|
69
|
+
return { url: `${origin}/?token=${token}`, close: () => close(server) };
|
|
70
|
+
}
|
|
71
|
+
function close(server) {
|
|
72
|
+
return new Promise((resolve) => { server.close(() => resolve()); server.closeAllConnections(); });
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../../../src/host/desktop-assistant/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAE,YAAY,EAAe,MAAM,WAAW,CAAA;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAI3C,0CAA0C;AAC1C,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,OAI9C;IACC,MAAM,KAAK,GAAG,WAAW,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;IAC7C,MAAM,MAAM,GAAG,sBAAsB,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,EAAE,CAAA;IAC9E,IAAI,MAAM,GAAG,EAAE,CAAA;IACf,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAC,mCAAmC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AC,OAAO,EAAE,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,mBAAmB,EAAE,CAAA,CAAC,CAAC,CAAC,CAAA;AAClG,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"win-agent.d.ts","sourceRoot":"","sources":["../../../../../src/host/desktop-assistant/win-agent.ts"],"names":[],"mappings":"AAoLA,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAgB/D"}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 基于 MIT 上游窗口实现改造;C# 保持 ASCII,兼容 PowerShell 5.1 的编译器与编码。
|
|
3
|
+
* 点击时以当前 Desktop 可执行文件触发单实例入口,让壳负责恢复、显示和聚焦主窗口,
|
|
4
|
+
* 避免依赖标题栏样式或误选辅助窗口。只授权父进程取得前台,并清除继承的 Node 模式。
|
|
5
|
+
*/
|
|
6
|
+
const CS = String.raw `
|
|
7
|
+
using System;
|
|
8
|
+
using System.IO;
|
|
9
|
+
using System.Windows;
|
|
10
|
+
using System.Windows.Interop;
|
|
11
|
+
using System.Windows.Media;
|
|
12
|
+
using System.Windows.Threading;
|
|
13
|
+
using System.Web.Script.Serialization;
|
|
14
|
+
using System.Collections.Generic;
|
|
15
|
+
using System.Runtime.InteropServices;
|
|
16
|
+
using System.Threading;
|
|
17
|
+
using System.Diagnostics;
|
|
18
|
+
using Microsoft.Web.WebView2.Core;
|
|
19
|
+
using Microsoft.Web.WebView2.Wpf;
|
|
20
|
+
|
|
21
|
+
public static class PetAgent {
|
|
22
|
+
static Window win;
|
|
23
|
+
static WebView2CompositionControl web;
|
|
24
|
+
static JavaScriptSerializer json = new JavaScriptSerializer();
|
|
25
|
+
static string origin = "", userData = "";
|
|
26
|
+
static int parentPid;
|
|
27
|
+
static bool positioned;
|
|
28
|
+
static bool loaded = false;
|
|
29
|
+
static bool active = false;
|
|
30
|
+
static bool dragging = false;
|
|
31
|
+
static DispatcherTimer dragTimer;
|
|
32
|
+
static POINT lastCursor;
|
|
33
|
+
static DateTime lastBoundsEvent = DateTime.MinValue;
|
|
34
|
+
static DateTime lastFocusRequest = DateTime.MinValue;
|
|
35
|
+
static object sync = new object();
|
|
36
|
+
[StructLayout(LayoutKind.Sequential)] struct POINT { public int X; public int Y; }
|
|
37
|
+
[DllImport("user32.dll")] static extern bool GetCursorPos(out POINT point);
|
|
38
|
+
[DllImport("user32.dll")] static extern short GetAsyncKeyState(int key);
|
|
39
|
+
[DllImport("user32.dll")] static extern int GetWindowLong(IntPtr hwnd, int index);
|
|
40
|
+
[DllImport("user32.dll")] static extern int SetWindowLong(IntPtr hwnd, int index, int value);
|
|
41
|
+
static void Emit(object value) { lock(sync) Console.Out.WriteLine(json.Serialize(value)); }
|
|
42
|
+
static void Error(string message) { Emit(new { ev = "error", message = message }); }
|
|
43
|
+
static string S(Dictionary<string, object> m, string key) { return m.ContainsKey(key) && m[key] != null ? Convert.ToString(m[key]) : ""; }
|
|
44
|
+
static double N(Dictionary<string, object> m, string key, double fallback) { double n; return double.TryParse(S(m,key), out n) ? n : fallback; }
|
|
45
|
+
static Dictionary<string, object> D(Dictionary<string, object> m, string key) { return m.ContainsKey(key) && m[key] is Dictionary<string,object> ? (Dictionary<string,object>)m[key] : new Dictionary<string,object>(); }
|
|
46
|
+
[DllImport("user32.dll")] static extern bool AllowSetForegroundWindow(uint pid);
|
|
47
|
+
[DllImport("user32.dll")] static extern IntPtr MonitorFromWindow(IntPtr hwnd, int flags);
|
|
48
|
+
[DllImport("user32.dll")] static extern bool GetMonitorInfo(IntPtr monitor, ref MONITORINFO info);
|
|
49
|
+
[DllImport("user32.dll")] static extern bool SetWindowPos(IntPtr hwnd, IntPtr after, int x, int y, int w, int h, uint flags);
|
|
50
|
+
[StructLayout(LayoutKind.Sequential)] struct RECT { public int Left, Top, Right, Bottom; }
|
|
51
|
+
[StructLayout(LayoutKind.Sequential)] struct MONITORINFO { public int Size; public RECT Monitor, Work; public int Flags; }
|
|
52
|
+
[DllImport("user32.dll")] static extern bool GetWindowRect(IntPtr hwnd, out RECT rect);
|
|
53
|
+
static void Clamp() {
|
|
54
|
+
IntPtr handle = new WindowInteropHelper(win).Handle;
|
|
55
|
+
MONITORINFO info = new MONITORINFO(); info.Size = Marshal.SizeOf(info);
|
|
56
|
+
RECT rect;
|
|
57
|
+
if (!GetMonitorInfo(MonitorFromWindow(handle, 2), ref info) || !GetWindowRect(handle, out rect)) return;
|
|
58
|
+
int x = Math.Max(info.Work.Left, Math.Min(rect.Left, info.Work.Right - (rect.Right - rect.Left)));
|
|
59
|
+
int y = Math.Max(info.Work.Top, Math.Min(rect.Top, info.Work.Bottom - (rect.Bottom - rect.Top)));
|
|
60
|
+
SetWindowPos(handle, IntPtr.Zero, x, y, 0, 0, 0x0015);
|
|
61
|
+
}
|
|
62
|
+
static bool FocusDesktop() {
|
|
63
|
+
if ((DateTime.UtcNow-lastFocusRequest).TotalMilliseconds < 1000) return false;
|
|
64
|
+
if (parentPid <= 0) throw new InvalidOperationException("Desktop process is unavailable");
|
|
65
|
+
using (Process desktop = Process.GetProcessById(parentPid)) {
|
|
66
|
+
if (desktop.HasExited) throw new InvalidOperationException("Desktop process has exited");
|
|
67
|
+
var start = new ProcessStartInfo(desktop.MainModule.FileName, "dsh://open");
|
|
68
|
+
start.UseShellExecute = false;
|
|
69
|
+
start.EnvironmentVariables.Remove("ELECTRON_RUN_AS_NODE");
|
|
70
|
+
start.EnvironmentVariables.Remove("NODE_OPTIONS");
|
|
71
|
+
AllowSetForegroundWindow((uint)parentPid);
|
|
72
|
+
using (Process request = Process.Start(start)) {
|
|
73
|
+
if (request == null) throw new InvalidOperationException("Desktop restore request failed");
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
lastFocusRequest = DateTime.UtcNow;
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
static void Moved() {
|
|
80
|
+
if (!active || !win.IsVisible) return;
|
|
81
|
+
if (dragging && (DateTime.UtcNow-lastBoundsEvent).TotalMilliseconds < 250) return;
|
|
82
|
+
lastBoundsEvent=DateTime.UtcNow;
|
|
83
|
+
Emit(new { ev = "moved", x = (int)win.Left, y = (int)win.Top, width = (int)win.Width, height = (int)win.Height });
|
|
84
|
+
}
|
|
85
|
+
static void EndDrag() { if (!dragging) return; dragging = false; dragTimer.Stop(); Clamp(); Moved(); }
|
|
86
|
+
static void DragTick(object sender, EventArgs e) {
|
|
87
|
+
if ((GetAsyncKeyState(1) & 0x8000) == 0 || !active) { EndDrag(); return; }
|
|
88
|
+
POINT cursor; if (!GetCursorPos(out cursor)) return;
|
|
89
|
+
var source = PresentationSource.FromVisual(win);
|
|
90
|
+
if (source == null || source.CompositionTarget == null) return;
|
|
91
|
+
Matrix matrix = source.CompositionTarget.TransformFromDevice;
|
|
92
|
+
win.Left += (cursor.X - lastCursor.X) * matrix.M11;
|
|
93
|
+
win.Top += (cursor.Y - lastCursor.Y) * matrix.M22;
|
|
94
|
+
lastCursor = cursor;
|
|
95
|
+
}
|
|
96
|
+
static void Bounds(Dictionary<string, object> m) {
|
|
97
|
+
double w = Math.Max(72, Math.Min(320, N(m,"width",144)));
|
|
98
|
+
win.Width = w; win.Height = Math.Max(78, Math.Min(480, N(m,"height",156)));
|
|
99
|
+
var saved = D(m,"bounds");
|
|
100
|
+
if (!positioned) {
|
|
101
|
+
win.Left = saved.ContainsKey("x") ? N(saved,"x",0) : SystemParameters.WorkArea.Right - w - 24;
|
|
102
|
+
win.Top = saved.ContainsKey("y") ? N(saved,"y",0) : SystemParameters.WorkArea.Bottom - win.Height - 24;
|
|
103
|
+
positioned = true;
|
|
104
|
+
}
|
|
105
|
+
Clamp();
|
|
106
|
+
}
|
|
107
|
+
static async void Show(Dictionary<string, object> m) {
|
|
108
|
+
try {
|
|
109
|
+
origin = new Uri(S(m,"url")).GetLeftPart(UriPartial.Authority); userData = S(m,"userData"); parentPid = (int)N(m,"parentPid",0);
|
|
110
|
+
Bounds(m);
|
|
111
|
+
if (!loaded) {
|
|
112
|
+
string folder = userData;
|
|
113
|
+
Directory.CreateDirectory(folder);
|
|
114
|
+
await web.EnsureCoreWebView2Async(await CoreWebView2Environment.CreateAsync(null, folder));
|
|
115
|
+
web.CoreWebView2.Settings.AreDevToolsEnabled = false;
|
|
116
|
+
web.CoreWebView2.Settings.AreDefaultContextMenusEnabled = false;
|
|
117
|
+
web.CoreWebView2.NavigationCompleted += delegate(object sender, CoreWebView2NavigationCompletedEventArgs e) {
|
|
118
|
+
if (!e.IsSuccess) Error("navigation: " + e.WebErrorStatus);
|
|
119
|
+
};
|
|
120
|
+
web.CoreWebView2.WebMessageReceived += delegate(object sender, CoreWebView2WebMessageReceivedEventArgs e) {
|
|
121
|
+
try { if (e.Source.StartsWith(origin + "/", StringComparison.Ordinal)) Bridge(json.Deserialize<Dictionary<string,object>>(e.WebMessageAsJson)); } catch (Exception ex) { Error("bridge: " + ex.Message); }
|
|
122
|
+
};
|
|
123
|
+
web.CoreWebView2.NavigationStarting += delegate(object sender, CoreWebView2NavigationStartingEventArgs e) {
|
|
124
|
+
if (!e.Uri.StartsWith(origin + "/", StringComparison.Ordinal)) e.Cancel = true;
|
|
125
|
+
};
|
|
126
|
+
web.CoreWebView2.NewWindowRequested += delegate(object sender, CoreWebView2NewWindowRequestedEventArgs e) { e.Handled = true; };
|
|
127
|
+
web.CoreWebView2.ProcessFailed += delegate { Error("webview process failed"); };
|
|
128
|
+
web.CoreWebView2.Settings.AreBrowserAcceleratorKeysEnabled = false;
|
|
129
|
+
loaded = true;
|
|
130
|
+
}
|
|
131
|
+
web.DefaultBackgroundColor = System.Drawing.Color.Transparent;
|
|
132
|
+
web.Source = new Uri(S(m,"url"));
|
|
133
|
+
active = false;
|
|
134
|
+
} catch (Exception ex) { Error("show: " + ex); }
|
|
135
|
+
}
|
|
136
|
+
static void Bridge(Dictionary<string, object> m) {
|
|
137
|
+
string type = S(m,"type");
|
|
138
|
+
if (type == "ready") { Emit(new { ev = "loaded" }); }
|
|
139
|
+
else if (type == "error") { Error(S(m,"message")); }
|
|
140
|
+
else if (type == "open") { if (FocusDesktop()) Emit(new { ev = "open" }); }
|
|
141
|
+
else if (type == "drag-start") { if (GetCursorPos(out lastCursor)) { dragging = true; dragTimer.Start(); } }
|
|
142
|
+
else if (type == "drag-end") { EndDrag(); }
|
|
143
|
+
}
|
|
144
|
+
static void Handle(string line) {
|
|
145
|
+
Dictionary<string,object> m=json.Deserialize<Dictionary<string,object>>(line);
|
|
146
|
+
string cmd=S(m,"cmd");
|
|
147
|
+
if (cmd == "quit") { Application.Current.Shutdown(); return; }
|
|
148
|
+
if (cmd == "hide") { EndDrag(); active = false; win.Hide(); return; }
|
|
149
|
+
if (cmd == "load") { Show(m); return; }
|
|
150
|
+
if (cmd == "show") { if (!dragging) Bounds(m); active = true; if (!win.IsVisible) win.Show(); Emit(new { ev = "shown" }); return; }
|
|
151
|
+
Error("unknown command " + cmd);
|
|
152
|
+
}
|
|
153
|
+
static void ReadStdin() {
|
|
154
|
+
try { string line; while ((line=Console.ReadLine()) != null) { if (line.Length > 65536) break; string next=line; win.Dispatcher.BeginInvoke(new Action(delegate { try { Handle(next); } catch(Exception e) { Error("command: " + e.Message); } })); } }
|
|
155
|
+
catch (Exception e) { Error("stdin: " + e.Message); }
|
|
156
|
+
win.Dispatcher.BeginInvoke(new Action(delegate { Application.Current.Shutdown(); }));
|
|
157
|
+
}
|
|
158
|
+
[STAThread] public static void Run() {
|
|
159
|
+
Application app=new Application(); app.ShutdownMode=ShutdownMode.OnExplicitShutdown;
|
|
160
|
+
win=new Window(); win.WindowStyle=WindowStyle.None; win.ResizeMode=ResizeMode.NoResize;
|
|
161
|
+
win.AllowsTransparency=true; win.Background=Brushes.Transparent; win.ShowInTaskbar=false;
|
|
162
|
+
win.Topmost=true; win.ShowActivated=false; win.Width=144; win.Height=156; win.Opacity=1;
|
|
163
|
+
web=new WebView2CompositionControl(); web.DefaultBackgroundColor=System.Drawing.Color.Transparent;
|
|
164
|
+
dragTimer=new DispatcherTimer(); dragTimer.Interval=TimeSpan.FromMilliseconds(16); dragTimer.Tick += DragTick;
|
|
165
|
+
win.Content=web;
|
|
166
|
+
win.SourceInitialized += delegate {
|
|
167
|
+
IntPtr hwnd=new WindowInteropHelper(win).Handle;
|
|
168
|
+
SetWindowLong(hwnd,-20,GetWindowLong(hwnd,-20) | 0x80);
|
|
169
|
+
};
|
|
170
|
+
Microsoft.Win32.SystemEvents.DisplaySettingsChanged += delegate { win.Dispatcher.BeginInvoke(new Action(Clamp)); };
|
|
171
|
+
win.Show(); win.Hide();
|
|
172
|
+
Thread t=new Thread(ReadStdin); t.IsBackground=true; t.Start();
|
|
173
|
+
|
|
174
|
+
app.Run();
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
`.trim();
|
|
178
|
+
/** 路径作为 PowerShell 字面量引用,不拼成可执行命令。 */
|
|
179
|
+
function psQuote(value) { return "'" + value.replace(/'/g, "''") + "'"; }
|
|
180
|
+
export function buildWinAssistantScript(sdkRoot) {
|
|
181
|
+
return [
|
|
182
|
+
'$ErrorActionPreference = "Stop"',
|
|
183
|
+
'[Console]::InputEncoding = New-Object System.Text.UTF8Encoding($false)',
|
|
184
|
+
'[Console]::OutputEncoding = New-Object System.Text.UTF8Encoding($false)',
|
|
185
|
+
'$root = ' + psQuote(sdkRoot),
|
|
186
|
+
'$arch = if ([Environment]::Is64BitProcess) { if ($env:PROCESSOR_ARCHITECTURE -eq "ARM64") { "arm64" } else { "x64" } } else { "x86" }',
|
|
187
|
+
'$env:PATH = (Join-Path $root $arch) + ";" + $env:PATH',
|
|
188
|
+
'$core = Join-Path $root "Microsoft.Web.WebView2.Core.dll"',
|
|
189
|
+
'$wpf = Join-Path $root "Microsoft.Web.WebView2.Wpf.dll"',
|
|
190
|
+
'Add-Type -AssemblyName PresentationFramework,PresentationCore,WindowsBase,System.Xaml,System.Web.Extensions,System.Drawing',
|
|
191
|
+
'Add-Type -Path $core,$wpf',
|
|
192
|
+
"$cs = @'", CS, "'@",
|
|
193
|
+
'Add-Type -TypeDefinition $cs -ReferencedAssemblies PresentationFramework,PresentationCore,WindowsBase,System.Xaml,System.Web.Extensions,System.Drawing,$core,$wpf',
|
|
194
|
+
'[PetAgent]::Run()',
|
|
195
|
+
].join('\r\n');
|
|
196
|
+
}
|
|
197
|
+
//# sourceMappingURL=win-agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"win-agent.js","sourceRoot":"","sources":["../../../../../src/host/desktop-assistant/win-agent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,EAAE,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2KpB,CAAC,IAAI,EAAE,CAAA;AAER,sCAAsC;AACtC,SAAS,OAAO,CAAC,KAAa,IAAY,OAAO,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,GAAG,CAAA,CAAC,CAAC;AACxF,MAAM,UAAU,uBAAuB,CAAC,OAAe;IACrD,OAAO;QACL,iCAAiC;QACjC,wEAAwE;QACxE,yEAAyE;QACzE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC;QAC7B,uIAAuI;QACvI,uDAAuD;QACvD,2DAA2D;QAC3D,yDAAyD;QACzD,4HAA4H;QAC5H,2BAA2B;QAC3B,UAAU,EAAE,EAAE,EAAE,IAAI;QACpB,mKAAmK;QACnK,mBAAmB;KACpB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;AAChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assistant-avatar-assets.d.ts","sourceRoot":"","sources":["../../../../../src/host/features/assistant-avatar-assets.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,OAAO,EAAE,uBAAuB,EAAE,+BAA+B,EAAE,MAAM,uBAAuB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assistant-avatar-assets.js","sourceRoot":"","sources":["../../../../../src/host/features/assistant-avatar-assets.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,OAAO,EAAE,uBAAuB,EAAE,+BAA+B,EAAE,MAAM,uBAAuB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assistant-avatar-basics.d.ts","sourceRoot":"","sources":["../../../../../src/host/features/assistant-avatar-basics.ts"],"names":[],"mappings":"AAKA,sCAAsC;AACtC,wBAAgB,iCAAiC,CAAC,SAAS,GAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAkB,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CAgB7K"}
|