@jingyi0605/codingns4dsh 0.2.1-beta.11 → 0.2.1-beta.13
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 +7 -5
- package/README.md +9 -5
- package/data/build/dist/bootstrap/dsh-connection-adapter.d.ts +1 -1
- package/data/build/dist/bootstrap/index.d.ts +1 -1
- package/data/build/dist/client/account-bar.d.ts.map +1 -1
- package/data/build/dist/client/account-bar.js +24 -70
- package/data/build/dist/client/account-bar.js.map +1 -1
- package/data/build/dist/client/adapter-catalog-watch.d.ts +1 -1
- package/data/build/dist/client/adapter-catalog-watch.d.ts.map +1 -1
- package/data/build/dist/client/adapter-catalog-watch.js +2 -2
- package/data/build/dist/client/adapter-catalog-watch.js.map +1 -1
- package/data/build/dist/client/bundle.js +35978 -21117
- package/data/build/dist/client/bundle.js.map +1 -1
- package/data/build/dist/client/cli-management-dialog.d.ts +21 -0
- package/data/build/dist/client/cli-management-dialog.d.ts.map +1 -0
- package/data/build/dist/client/cli-management-dialog.js +215 -0
- package/data/build/dist/client/cli-management-dialog.js.map +1 -0
- package/data/build/dist/client/cli-management-terminal.d.ts +9 -0
- package/data/build/dist/client/cli-management-terminal.d.ts.map +1 -0
- package/data/build/dist/client/cli-management-terminal.js +30 -0
- package/data/build/dist/client/cli-management-terminal.js.map +1 -0
- package/data/build/dist/client/cli-settings-dialog.d.ts +9 -0
- package/data/build/dist/client/cli-settings-dialog.d.ts.map +1 -0
- package/data/build/dist/client/cli-settings-dialog.js +45 -0
- package/data/build/dist/client/cli-settings-dialog.js.map +1 -0
- package/data/build/dist/client/cli-settings-rpc.js +1 -1
- package/data/build/dist/client/cli-settings-rpc.js.map +1 -1
- package/data/build/dist/client/cli-slots.d.ts +7 -2
- package/data/build/dist/client/cli-slots.d.ts.map +1 -1
- package/data/build/dist/client/cli-slots.js +44 -12
- package/data/build/dist/client/cli-slots.js.map +1 -1
- package/data/build/dist/client/client.assistant-configuration-view.js +5 -5
- package/data/build/dist/client/client.assistant-configuration-view.js.map +1 -1
- package/data/build/dist/client/client.editor-engine.js +4 -1
- package/data/build/dist/client/client.editor-engine.js.map +1 -1
- package/data/build/dist/client/client.moss-voice-output.js +0 -166
- package/data/build/dist/client/client.moss-voice-output.js.map +1 -1
- package/data/build/dist/client/client.native-workspace-store.js +4 -4
- package/data/build/dist/client/client.native-workspace-store.js.map +1 -1
- package/data/build/dist/client/client.primitives-adapter.js +53 -0
- package/data/build/dist/client/client.primitives-adapter.js.map +1 -1
- package/data/build/dist/client/client.react-dom.js +166 -0
- package/data/build/dist/client/client.react-dom.js.map +1 -1
- package/data/build/dist/client/client.session-translation.js +25 -1
- package/data/build/dist/client/client.session-translation.js.map +1 -1
- package/data/build/dist/client/client.transport.js +503 -42
- package/data/build/dist/client/client.transport.js.map +1 -1
- package/data/build/dist/client/conversation-translation-settings.d.ts +11 -0
- package/data/build/dist/client/conversation-translation-settings.d.ts.map +1 -0
- package/data/build/dist/client/conversation-translation-settings.js +54 -0
- package/data/build/dist/client/conversation-translation-settings.js.map +1 -0
- package/data/build/dist/client/desktop-assistant.js +967 -479
- package/data/build/dist/client/editor-engine.d.ts +1 -1
- package/data/build/dist/client/editor-engine.d.ts.map +1 -1
- package/data/build/dist/client/editor-engine.js +4 -1
- package/data/build/dist/client/editor-engine.js.map +1 -1
- package/data/build/dist/client/features/cli-adapters.d.ts +3 -1
- package/data/build/dist/client/features/cli-adapters.d.ts.map +1 -1
- package/data/build/dist/client/features/cli-adapters.js +182 -106
- package/data/build/dist/client/features/cli-adapters.js.map +1 -1
- package/data/build/dist/client/features/file-management.d.ts.map +1 -1
- package/data/build/dist/client/features/file-management.js +2 -0
- package/data/build/dist/client/features/file-management.js.map +1 -1
- package/data/build/dist/client/features/index.d.ts.map +1 -1
- package/data/build/dist/client/features/index.js +2 -0
- package/data/build/dist/client/features/index.js.map +1 -1
- package/data/build/dist/client/features/peer-host.d.ts.map +1 -1
- package/data/build/dist/client/features/peer-host.js +3 -0
- package/data/build/dist/client/features/peer-host.js.map +1 -1
- package/data/build/dist/client/features/quick-apps.d.ts +3 -0
- package/data/build/dist/client/features/quick-apps.d.ts.map +1 -0
- package/data/build/dist/client/features/quick-apps.js +14 -0
- package/data/build/dist/client/features/quick-apps.js.map +1 -0
- package/data/build/dist/client/features/session-translation.d.ts.map +1 -1
- package/data/build/dist/client/features/session-translation.js +7 -1
- package/data/build/dist/client/features/session-translation.js.map +1 -1
- package/data/build/dist/client/html-workspace-files.d.ts +4 -0
- package/data/build/dist/client/html-workspace-files.d.ts.map +1 -0
- package/data/build/dist/client/html-workspace-files.js +114 -0
- package/data/build/dist/client/html-workspace-files.js.map +1 -0
- package/data/build/dist/client/locale.d.ts.map +1 -1
- package/data/build/dist/client/locale.js +6 -0
- package/data/build/dist/client/locale.js.map +1 -1
- package/data/build/dist/client/locales/cliManagement.d.ts +3 -0
- package/data/build/dist/client/locales/cliManagement.d.ts.map +1 -0
- package/data/build/dist/client/locales/cliManagement.js +139 -0
- package/data/build/dist/client/locales/cliManagement.js.map +1 -0
- package/data/build/dist/client/locales/fileWorkspace.d.ts.map +1 -1
- package/data/build/dist/client/locales/fileWorkspace.js +4 -0
- package/data/build/dist/client/locales/fileWorkspace.js.map +1 -1
- package/data/build/dist/client/locales/panels.d.ts.map +1 -1
- package/data/build/dist/client/locales/panels.js +46 -0
- package/data/build/dist/client/locales/panels.js.map +1 -1
- package/data/build/dist/client/locales/quickApps.d.ts +130 -0
- package/data/build/dist/client/locales/quickApps.d.ts.map +1 -0
- package/data/build/dist/client/locales/quickApps.js +150 -0
- package/data/build/dist/client/locales/quickApps.js.map +1 -0
- package/data/build/dist/client/native-model-translation-menu.d.ts.map +1 -1
- package/data/build/dist/client/native-model-translation-menu.js +3 -1
- package/data/build/dist/client/native-model-translation-menu.js.map +1 -1
- package/data/build/dist/client/quick-apps/client.d.ts +29 -0
- package/data/build/dist/client/quick-apps/client.d.ts.map +1 -0
- package/data/build/dist/client/quick-apps/client.js +68 -0
- package/data/build/dist/client/quick-apps/client.js.map +1 -0
- package/data/build/dist/client/quick-apps/document.d.ts +26 -0
- package/data/build/dist/client/quick-apps/document.d.ts.map +1 -0
- package/data/build/dist/client/quick-apps/document.js +110 -0
- package/data/build/dist/client/quick-apps/document.js.map +1 -0
- package/data/build/dist/client/quick-apps/file-picker.d.ts +14 -0
- package/data/build/dist/client/quick-apps/file-picker.d.ts.map +1 -0
- package/data/build/dist/client/quick-apps/file-picker.js +51 -0
- package/data/build/dist/client/quick-apps/file-picker.js.map +1 -0
- package/data/build/dist/client/quick-apps/launcher.d.ts +7 -0
- package/data/build/dist/client/quick-apps/launcher.d.ts.map +1 -0
- package/data/build/dist/client/quick-apps/launcher.js +252 -0
- package/data/build/dist/client/quick-apps/launcher.js.map +1 -0
- package/data/build/dist/client/quick-apps/presentation.d.ts +16 -0
- package/data/build/dist/client/quick-apps/presentation.d.ts.map +1 -0
- package/data/build/dist/client/quick-apps/presentation.js +31 -0
- package/data/build/dist/client/quick-apps/presentation.js.map +1 -0
- package/data/build/dist/client/quick-apps/reorder-animation.d.ts +6 -0
- package/data/build/dist/client/quick-apps/reorder-animation.d.ts.map +1 -0
- package/data/build/dist/client/quick-apps/reorder-animation.js +50 -0
- package/data/build/dist/client/quick-apps/reorder-animation.js.map +1 -0
- package/data/build/dist/client/quick-apps/reorder.d.ts +26 -0
- package/data/build/dist/client/quick-apps/reorder.d.ts.map +1 -0
- package/data/build/dist/client/quick-apps/reorder.js +128 -0
- package/data/build/dist/client/quick-apps/reorder.js.map +1 -0
- package/data/build/dist/client/quick-apps/styles.d.ts +3 -0
- package/data/build/dist/client/quick-apps/styles.d.ts.map +1 -0
- package/data/build/dist/client/quick-apps/styles.js +143 -0
- package/data/build/dist/client/quick-apps/styles.js.map +1 -0
- package/data/build/dist/client/quick-apps/ui.d.ts +20 -0
- package/data/build/dist/client/quick-apps/ui.d.ts.map +1 -0
- package/data/build/dist/client/quick-apps/ui.js +21 -0
- package/data/build/dist/client/quick-apps/ui.js.map +1 -0
- package/data/build/dist/client/quick-apps/viewer.d.ts +16 -0
- package/data/build/dist/client/quick-apps/viewer.d.ts.map +1 -0
- package/data/build/dist/client/quick-apps/viewer.js +155 -0
- package/data/build/dist/client/quick-apps/viewer.js.map +1 -0
- package/data/build/dist/client/quick-apps/workspace-picker.d.ts +19 -0
- package/data/build/dist/client/quick-apps/workspace-picker.d.ts.map +1 -0
- package/data/build/dist/client/quick-apps/workspace-picker.js +30 -0
- package/data/build/dist/client/quick-apps/workspace-picker.js.map +1 -0
- package/data/build/dist/client/session-translation-chat.d.ts +10 -4
- package/data/build/dist/client/session-translation-chat.d.ts.map +1 -1
- package/data/build/dist/client/session-translation-chat.js +154 -52
- package/data/build/dist/client/session-translation-chat.js.map +1 -1
- package/data/build/dist/client/session-translation-pending-dom.d.ts +1 -1
- package/data/build/dist/client/session-translation-pending-dom.d.ts.map +1 -1
- package/data/build/dist/client/session-translation-pending-dom.js +4 -4
- package/data/build/dist/client/session-translation-pending-dom.js.map +1 -1
- package/data/build/dist/client/session-translation-retry.d.ts +16 -0
- package/data/build/dist/client/session-translation-retry.d.ts.map +1 -0
- package/data/build/dist/client/session-translation-retry.js +66 -0
- package/data/build/dist/client/session-translation-retry.js.map +1 -0
- package/data/build/dist/client/session-translation-rules.d.ts +13 -0
- package/data/build/dist/client/session-translation-rules.d.ts.map +1 -0
- package/data/build/dist/client/session-translation-rules.js +58 -0
- package/data/build/dist/client/session-translation-rules.js.map +1 -0
- package/data/build/dist/client/sidebar-footer-style.d.ts +13 -0
- package/data/build/dist/client/sidebar-footer-style.d.ts.map +1 -0
- package/data/build/dist/client/sidebar-footer-style.js +54 -0
- package/data/build/dist/client/sidebar-footer-style.js.map +1 -0
- package/data/build/dist/client/style.css +276 -276
- package/data/build/dist/client/terminal/model.d.ts.map +1 -1
- package/data/build/dist/client/terminal/model.js +2 -1
- package/data/build/dist/client/terminal/model.js.map +1 -1
- package/data/build/dist/dsh-capabilities/client/composer-slot-selectors.d.ts +4 -0
- package/data/build/dist/dsh-capabilities/client/composer-slot-selectors.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/composer-slot-selectors.js +8 -0
- package/data/build/dist/dsh-capabilities/client/composer-slot-selectors.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/interaction-presentation-adapter.d.ts.map +1 -1
- package/data/build/dist/dsh-capabilities/client/interaction-presentation-adapter.js +4 -13
- package/data/build/dist/dsh-capabilities/client/interaction-presentation-adapter.js.map +1 -1
- package/data/build/dist/dsh-capabilities/client/interaction-text-dom.js +1 -1
- package/data/build/dist/dsh-capabilities/client/interaction-text-dom.js.map +1 -1
- package/data/build/dist/dsh-capabilities/client/message-presentation-adapter.d.ts +19 -0
- package/data/build/dist/dsh-capabilities/client/message-presentation-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/message-presentation-adapter.js +39 -0
- package/data/build/dist/dsh-capabilities/client/message-presentation-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/primitives-adapter.d.ts +18 -0
- package/data/build/dist/dsh-capabilities/client/primitives-adapter.d.ts.map +1 -1
- package/data/build/dist/dsh-capabilities/client/primitives-adapter.js +21 -0
- package/data/build/dist/dsh-capabilities/client/primitives-adapter.js.map +1 -1
- package/data/build/dist/dsh-capabilities/client/quick-app-footer-adapter.d.ts +18 -0
- package/data/build/dist/dsh-capabilities/client/quick-app-footer-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/quick-app-footer-adapter.js +11 -0
- package/data/build/dist/dsh-capabilities/client/quick-app-footer-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/session-performance-adapter.d.ts +8 -0
- package/data/build/dist/dsh-capabilities/client/session-performance-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/session-performance-adapter.js +100 -0
- package/data/build/dist/dsh-capabilities/client/session-performance-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/sidebar-footer-icon-adapter.d.ts +3 -0
- package/data/build/dist/dsh-capabilities/client/sidebar-footer-icon-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/sidebar-footer-icon-adapter.js +22 -0
- package/data/build/dist/dsh-capabilities/client/sidebar-footer-icon-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/slot-presentation-mirror.d.ts +2 -0
- package/data/build/dist/dsh-capabilities/client/slot-presentation-mirror.d.ts.map +1 -1
- package/data/build/dist/dsh-capabilities/client/slot-presentation-mirror.js +28 -0
- package/data/build/dist/dsh-capabilities/client/slot-presentation-mirror.js.map +1 -1
- package/data/build/dist/dsh-capabilities/host/connection-peer-adapter.d.ts +10 -0
- package/data/build/dist/dsh-capabilities/host/connection-peer-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/connection-peer-adapter.js +34 -0
- package/data/build/dist/dsh-capabilities/host/connection-peer-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/native-dispatch-adapter.d.ts +21 -0
- package/data/build/dist/dsh-capabilities/host/native-dispatch-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/native-dispatch-adapter.js +11 -0
- package/data/build/dist/dsh-capabilities/host/native-dispatch-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-credentials.d.ts +11 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-credentials.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-credentials.js +97 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-credentials.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-https-provider.d.ts +36 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-https-provider.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-https-provider.js +164 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-https-provider.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-lan-ports.d.ts +44 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-lan-ports.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-lan-ports.js +240 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-lan-ports.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-origin-adapter.d.ts +37 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-origin-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-origin-adapter.js +35 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-origin-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-proxy-adapter.d.ts +13 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-proxy-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-proxy-adapter.js +30 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-proxy-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-proxy-provider.d.ts +21 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-proxy-provider.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-proxy-provider.js +132 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-proxy-provider.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-transport.d.ts +10 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-transport.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-transport.js +33 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-transport.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-activation-adapter.d.ts +17 -0
- package/data/build/dist/dsh-capabilities/host/session-activation-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-activation-adapter.js +37 -0
- package/data/build/dist/dsh-capabilities/host/session-activation-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-model-selection-adapter.d.ts +17 -0
- package/data/build/dist/dsh-capabilities/host/session-model-selection-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-model-selection-adapter.js +45 -0
- package/data/build/dist/dsh-capabilities/host/session-model-selection-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-performance-adapter.d.ts +7 -0
- package/data/build/dist/dsh-capabilities/host/session-performance-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-performance-adapter.js +18 -0
- package/data/build/dist/dsh-capabilities/host/session-performance-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-prompt-adapter.d.ts +28 -0
- package/data/build/dist/dsh-capabilities/host/session-prompt-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-prompt-adapter.js +31 -0
- package/data/build/dist/dsh-capabilities/host/session-prompt-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/workspace-directory-adapter.d.ts +13 -0
- package/data/build/dist/dsh-capabilities/host/workspace-directory-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/workspace-directory-adapter.js +24 -0
- package/data/build/dist/dsh-capabilities/host/workspace-directory-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/matrix.d.ts.map +1 -1
- package/data/build/dist/dsh-capabilities/matrix.js +19 -5
- package/data/build/dist/dsh-capabilities/matrix.js.map +1 -1
- package/data/build/dist/dsh-capabilities/routes.d.ts +1 -0
- package/data/build/dist/dsh-capabilities/routes.d.ts.map +1 -1
- package/data/build/dist/dsh-capabilities/routes.js +41 -5
- package/data/build/dist/dsh-capabilities/routes.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/cli-adapters/antigravity-driver.js +1 -1
- package/data/build/dist/host/cli-adapters/antigravity-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/attachment-utils.d.ts +4 -3
- package/data/build/dist/host/cli-adapters/attachment-utils.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/attachment-utils.js +9 -8
- package/data/build/dist/host/cli-adapters/attachment-utils.js.map +1 -1
- package/data/build/dist/host/cli-adapters/binary-detection.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/binary-detection.js +7 -3
- package/data/build/dist/host/cli-adapters/binary-detection.js.map +1 -1
- package/data/build/dist/host/cli-adapters/claude-driver.d.ts +1 -0
- package/data/build/dist/host/cli-adapters/claude-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/claude-driver.js +180 -21
- package/data/build/dist/host/cli-adapters/claude-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/codex-driver.d.ts +18 -0
- package/data/build/dist/host/cli-adapters/codex-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/codex-driver.js +97 -5
- package/data/build/dist/host/cli-adapters/codex-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/codex-performance-projection.d.ts +91 -0
- package/data/build/dist/host/cli-adapters/codex-performance-projection.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/codex-performance-projection.js +8 -0
- package/data/build/dist/host/cli-adapters/codex-performance-projection.js.map +1 -0
- package/data/build/dist/host/cli-adapters/codex-performance.d.ts +16 -0
- package/data/build/dist/host/cli-adapters/codex-performance.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/codex-performance.js +81 -0
- package/data/build/dist/host/cli-adapters/codex-performance.js.map +1 -0
- package/data/build/dist/host/cli-adapters/command-code-driver.js +1 -1
- package/data/build/dist/host/cli-adapters/command-code-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/driver.d.ts +2 -0
- package/data/build/dist/host/cli-adapters/driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/dsh-message-projector.d.ts +2 -0
- 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 -7
- package/data/build/dist/host/cli-adapters/dsh-message-projector.js.map +1 -1
- package/data/build/dist/host/cli-adapters/feature.d.ts +2 -0
- package/data/build/dist/host/cli-adapters/feature.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/feature.js +186 -71
- package/data/build/dist/host/cli-adapters/feature.js.map +1 -1
- package/data/build/dist/host/cli-adapters/gemini-driver.js +1 -1
- package/data/build/dist/host/cli-adapters/gemini-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/grok-driver.d.ts +3 -0
- package/data/build/dist/host/cli-adapters/grok-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/grok-driver.js +277 -53
- package/data/build/dist/host/cli-adapters/grok-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/grok-performance-projection.d.ts +123 -0
- package/data/build/dist/host/cli-adapters/grok-performance-projection.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/grok-performance-projection.js +47 -0
- package/data/build/dist/host/cli-adapters/grok-performance-projection.js.map +1 -0
- package/data/build/dist/host/cli-adapters/grok-usage.d.ts +45 -0
- package/data/build/dist/host/cli-adapters/grok-usage.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/grok-usage.js +197 -0
- package/data/build/dist/host/cli-adapters/grok-usage.js.map +1 -0
- package/data/build/dist/host/cli-adapters/kimi-driver.js +2 -2
- package/data/build/dist/host/cli-adapters/kimi-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/management-installation.d.ts +5 -0
- package/data/build/dist/host/cli-adapters/management-installation.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/management-installation.js +131 -0
- package/data/build/dist/host/cli-adapters/management-installation.js.map +1 -0
- package/data/build/dist/host/cli-adapters/management-methods.d.ts +32 -0
- package/data/build/dist/host/cli-adapters/management-methods.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/management-methods.js +135 -0
- package/data/build/dist/host/cli-adapters/management-methods.js.map +1 -0
- package/data/build/dist/host/cli-adapters/management-process.d.ts +7 -0
- package/data/build/dist/host/cli-adapters/management-process.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/management-process.js +51 -0
- package/data/build/dist/host/cli-adapters/management-process.js.map +1 -0
- package/data/build/dist/host/cli-adapters/management.d.ts +32 -0
- package/data/build/dist/host/cli-adapters/management.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/management.js +172 -0
- package/data/build/dist/host/cli-adapters/management.js.map +1 -0
- package/data/build/dist/host/cli-adapters/mcode-driver.js +1 -1
- package/data/build/dist/host/cli-adapters/mcode-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/model-catalog.d.ts +1 -0
- package/data/build/dist/host/cli-adapters/model-catalog.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/model-catalog.js +62 -0
- package/data/build/dist/host/cli-adapters/model-catalog.js.map +1 -1
- package/data/build/dist/host/cli-adapters/native-team-subagent.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/native-team-subagent.js +2 -1
- package/data/build/dist/host/cli-adapters/native-team-subagent.js.map +1 -1
- package/data/build/dist/host/cli-adapters/opencode-driver.d.ts +22 -0
- package/data/build/dist/host/cli-adapters/opencode-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/opencode-driver.js +105 -17
- package/data/build/dist/host/cli-adapters/opencode-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/pi-driver.js +1 -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 +2 -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 +16 -11
- package/data/build/dist/host/cli-adapters/process-utils.js.map +1 -1
- package/data/build/dist/host/cli-adapters/registry.d.ts +3 -0
- package/data/build/dist/host/cli-adapters/registry.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/registry.js +56 -21
- package/data/build/dist/host/cli-adapters/registry.js.map +1 -1
- package/data/build/dist/host/cli-adapters/session-performance-projection.d.ts +74 -0
- package/data/build/dist/host/cli-adapters/session-performance-projection.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/session-performance-projection.js +83 -0
- package/data/build/dist/host/cli-adapters/session-performance-projection.js.map +1 -0
- package/data/build/dist/host/cli-adapters/stream-normalizer.d.ts +3 -1
- package/data/build/dist/host/cli-adapters/stream-normalizer.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/stream-normalizer.js +2 -0
- package/data/build/dist/host/cli-adapters/stream-normalizer.js.map +1 -1
- package/data/build/dist/host/cli-adapters/update-check.d.ts +34 -0
- package/data/build/dist/host/cli-adapters/update-check.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/update-check.js +263 -0
- package/data/build/dist/host/cli-adapters/update-check.js.map +1 -0
- package/data/build/dist/host/cli-adapters/zcode-driver.js +1 -1
- package/data/build/dist/host/cli-adapters/zcode-driver.js.map +1 -1
- package/data/build/dist/host/features/file-management.d.ts.map +1 -1
- package/data/build/dist/host/features/file-management.js +8 -0
- package/data/build/dist/host/features/file-management.js.map +1 -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 +2 -3
- 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 +2 -0
- package/data/build/dist/host/features/index.js.map +1 -1
- package/data/build/dist/host/features/lan-access-dsh.js +1 -1
- package/data/build/dist/host/features/lan-access-dsh.js.map +1 -1
- package/data/build/dist/host/features/peer-host.d.ts.map +1 -1
- package/data/build/dist/host/features/peer-host.js +13 -6
- package/data/build/dist/host/features/peer-host.js.map +1 -1
- package/data/build/dist/host/features/quick-apps.d.ts +4 -0
- package/data/build/dist/host/features/quick-apps.d.ts.map +1 -0
- package/data/build/dist/host/features/quick-apps.js +158 -0
- package/data/build/dist/host/features/quick-apps.js.map +1 -0
- package/data/build/dist/host/features/session-prompt-translation.d.ts +10 -0
- package/data/build/dist/host/features/session-prompt-translation.d.ts.map +1 -0
- package/data/build/dist/host/features/session-prompt-translation.js +198 -0
- package/data/build/dist/host/features/session-prompt-translation.js.map +1 -0
- package/data/build/dist/host/features/session-translation-protection.d.ts +12 -1
- package/data/build/dist/host/features/session-translation-protection.d.ts.map +1 -1
- package/data/build/dist/host/features/session-translation-protection.js +44 -5
- package/data/build/dist/host/features/session-translation-protection.js.map +1 -1
- package/data/build/dist/host/features/session-translation-recovery.d.ts +21 -0
- package/data/build/dist/host/features/session-translation-recovery.d.ts.map +1 -0
- package/data/build/dist/host/features/session-translation-recovery.js +125 -0
- package/data/build/dist/host/features/session-translation-recovery.js.map +1 -0
- package/data/build/dist/host/features/session-translation-service.d.ts +8 -2
- package/data/build/dist/host/features/session-translation-service.d.ts.map +1 -1
- package/data/build/dist/host/features/session-translation-service.js +69 -19
- package/data/build/dist/host/features/session-translation-service.js.map +1 -1
- package/data/build/dist/host/features/session-translation.d.ts.map +1 -1
- package/data/build/dist/host/features/session-translation.js +4 -1
- package/data/build/dist/host/features/session-translation.js.map +1 -1
- package/data/build/dist/host/features/types.d.ts +10 -0
- package/data/build/dist/host/features/types.d.ts.map +1 -1
- package/data/build/dist/host/html-workspace-files.d.ts +3 -0
- package/data/build/dist/host/html-workspace-files.d.ts.map +1 -0
- package/data/build/dist/host/html-workspace-files.js +135 -0
- package/data/build/dist/host/html-workspace-files.js.map +1 -0
- package/data/build/dist/host/index.d.ts.map +1 -1
- package/data/build/dist/host/index.js +27 -2
- package/data/build/dist/host/index.js.map +1 -1
- package/data/build/dist/host/lan-access-dsh.d.ts +5 -1
- package/data/build/dist/host/lan-access-dsh.d.ts.map +1 -1
- package/data/build/dist/host/lan-access-dsh.js +43 -2
- package/data/build/dist/host/lan-access-dsh.js.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-native-dispatch.d.ts +2 -2
- package/data/build/dist/host/modules/peer-host/peer-host-native-dispatch.d.ts.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-native-dispatch.js +10 -9
- package/data/build/dist/host/modules/peer-host/peer-host-native-dispatch.js.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-native-streams.d.ts +3 -3
- package/data/build/dist/host/modules/peer-host/peer-host-native-streams.d.ts.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-native-streams.js +26 -14
- package/data/build/dist/host/modules/peer-host/peer-host-native-streams.js.map +1 -1
- package/data/build/dist/host/modules/peer-host/quick-app-gateway.d.ts +5 -0
- package/data/build/dist/host/modules/peer-host/quick-app-gateway.d.ts.map +1 -0
- package/data/build/dist/host/modules/peer-host/quick-app-gateway.js +27 -0
- package/data/build/dist/host/modules/peer-host/quick-app-gateway.js.map +1 -0
- package/data/build/dist/host/modules/quick-apps/browse.d.ts +5 -0
- package/data/build/dist/host/modules/quick-apps/browse.d.ts.map +1 -0
- package/data/build/dist/host/modules/quick-apps/browse.js +37 -0
- package/data/build/dist/host/modules/quick-apps/browse.js.map +1 -0
- package/data/build/dist/host/modules/quick-apps/code-revision.d.ts +4 -0
- package/data/build/dist/host/modules/quick-apps/code-revision.d.ts.map +1 -0
- package/data/build/dist/host/modules/quick-apps/code-revision.js +39 -0
- package/data/build/dist/host/modules/quick-apps/code-revision.js.map +1 -0
- package/data/build/dist/host/modules/quick-apps/documents.d.ts +14 -0
- package/data/build/dist/host/modules/quick-apps/documents.d.ts.map +1 -0
- package/data/build/dist/host/modules/quick-apps/documents.js +87 -0
- package/data/build/dist/host/modules/quick-apps/documents.js.map +1 -0
- package/data/build/dist/host/modules/quick-apps/errors.d.ts +8 -0
- package/data/build/dist/host/modules/quick-apps/errors.d.ts.map +1 -0
- package/data/build/dist/host/modules/quick-apps/errors.js +15 -0
- package/data/build/dist/host/modules/quick-apps/errors.js.map +1 -0
- package/data/build/dist/host/modules/quick-apps/file-api.d.ts +30 -0
- package/data/build/dist/host/modules/quick-apps/file-api.d.ts.map +1 -0
- package/data/build/dist/host/modules/quick-apps/file-api.js +149 -0
- package/data/build/dist/host/modules/quick-apps/file-api.js.map +1 -0
- package/data/build/dist/host/modules/quick-apps/launches.d.ts +35 -0
- package/data/build/dist/host/modules/quick-apps/launches.d.ts.map +1 -0
- package/data/build/dist/host/modules/quick-apps/launches.js +80 -0
- package/data/build/dist/host/modules/quick-apps/launches.js.map +1 -0
- package/data/build/dist/host/modules/quick-apps/paths.d.ts +14 -0
- package/data/build/dist/host/modules/quick-apps/paths.d.ts.map +1 -0
- package/data/build/dist/host/modules/quick-apps/paths.js +72 -0
- package/data/build/dist/host/modules/quick-apps/paths.js.map +1 -0
- package/data/build/dist/host/modules/quick-apps/registry.d.ts +30 -0
- package/data/build/dist/host/modules/quick-apps/registry.d.ts.map +1 -0
- package/data/build/dist/host/modules/quick-apps/registry.js +186 -0
- package/data/build/dist/host/modules/quick-apps/registry.js.map +1 -0
- package/data/build/dist/host/modules/quick-apps/remote.d.ts +38 -0
- package/data/build/dist/host/modules/quick-apps/remote.d.ts.map +1 -0
- package/data/build/dist/host/modules/quick-apps/remote.js +237 -0
- package/data/build/dist/host/modules/quick-apps/remote.js.map +1 -0
- package/data/build/dist/host/modules/quick-apps/service.d.ts +27 -0
- package/data/build/dist/host/modules/quick-apps/service.d.ts.map +1 -0
- package/data/build/dist/host/modules/quick-apps/service.js +170 -0
- package/data/build/dist/host/modules/quick-apps/service.js.map +1 -0
- package/data/build/dist/host/modules/quick-apps/static-handler.d.ts +8 -0
- package/data/build/dist/host/modules/quick-apps/static-handler.d.ts.map +1 -0
- package/data/build/dist/host/modules/quick-apps/static-handler.js +181 -0
- package/data/build/dist/host/modules/quick-apps/static-handler.js.map +1 -0
- package/data/build/dist/host/native-session-bridge.d.ts +7 -1
- package/data/build/dist/host/native-session-bridge.d.ts.map +1 -1
- package/data/build/dist/host/native-session-bridge.js +8 -13
- package/data/build/dist/host/native-session-bridge.js.map +1 -1
- package/data/build/dist/host/rpc.d.ts.map +1 -1
- package/data/build/dist/host/rpc.js +21 -10
- package/data/build/dist/host/rpc.js.map +1 -1
- package/data/build/dist/host/settings.d.ts.map +1 -1
- package/data/build/dist/host/settings.js +18 -1
- package/data/build/dist/host/settings.js.map +1 -1
- package/data/build/dist/host/workspace-file-mutations.d.ts +2 -0
- package/data/build/dist/host/workspace-file-mutations.d.ts.map +1 -0
- package/data/build/dist/host/workspace-file-mutations.js +15 -0
- package/data/build/dist/host/workspace-file-mutations.js.map +1 -0
- package/data/build/dist/shared/attachment-prompts.d.ts +11 -0
- package/data/build/dist/shared/attachment-prompts.d.ts.map +1 -0
- package/data/build/dist/shared/attachment-prompts.js +17 -0
- package/data/build/dist/shared/attachment-prompts.js.map +1 -0
- package/data/build/dist/shared/codex-performance.d.ts +3 -0
- package/data/build/dist/shared/codex-performance.d.ts.map +1 -0
- package/data/build/dist/shared/codex-performance.js +2 -0
- package/data/build/dist/shared/codex-performance.js.map +1 -0
- package/data/build/dist/shared/contracts/cli-adapter.d.ts +33 -1
- package/data/build/dist/shared/contracts/cli-adapter.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/cli-management.d.ts +29 -0
- package/data/build/dist/shared/contracts/cli-management.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/cli-management.js +2 -0
- package/data/build/dist/shared/contracts/cli-management.js.map +1 -0
- package/data/build/dist/shared/contracts/config.d.ts +2 -0
- package/data/build/dist/shared/contracts/config.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/config.js.map +1 -1
- package/data/build/dist/shared/contracts/errors.d.ts +2 -2
- package/data/build/dist/shared/contracts/quick-apps.d.ts +68 -0
- package/data/build/dist/shared/contracts/quick-apps.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/quick-apps.js +4 -0
- package/data/build/dist/shared/contracts/quick-apps.js.map +1 -0
- package/data/build/dist/shared/contracts/session-translation.d.ts +20 -2
- package/data/build/dist/shared/contracts/session-translation.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/session-translation.js +24 -0
- package/data/build/dist/shared/contracts/session-translation.js.map +1 -1
- package/data/build/dist/shared/contracts/version.d.ts +4 -4
- package/data/build/dist/shared/contracts/version.js +3 -3
- package/data/build/dist/shared/peer-host-http-routes.d.ts +4 -0
- package/data/build/dist/shared/peer-host-http-routes.d.ts.map +1 -1
- package/data/build/dist/shared/peer-host-http-routes.js +4 -0
- package/data/build/dist/shared/peer-host-http-routes.js.map +1 -1
- package/data/build/dist/shared/quick-app-proxy-path.d.ts +6 -0
- package/data/build/dist/shared/quick-app-proxy-path.d.ts.map +1 -0
- package/data/build/dist/shared/quick-app-proxy-path.js +18 -0
- package/data/build/dist/shared/quick-app-proxy-path.js.map +1 -0
- package/data/build/dist/shared/quick-apps-bootstrap-locale.d.ts +7 -0
- package/data/build/dist/shared/quick-apps-bootstrap-locale.d.ts.map +1 -0
- package/data/build/dist/shared/quick-apps-bootstrap-locale.js +10 -0
- package/data/build/dist/shared/quick-apps-bootstrap-locale.js.map +1 -0
- package/data/build/dist/shared/request-performance.d.ts +15 -0
- package/data/build/dist/shared/request-performance.d.ts.map +1 -0
- package/data/build/dist/shared/request-performance.js +3 -0
- package/data/build/dist/shared/request-performance.js.map +1 -0
- package/package.json +35 -34
- package/profile/README.md +2 -2
- package/profile/package.json +3 -3
- package/profile/version.json +3 -3
- package/version.json +3 -3
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { createElement as h, useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { DshFileTypeIcon, DshPathLabel, DshTooltip, DshModal, DshMenu, classifyDshFileType, resolveAssistantControlIcon, resolveRefreshIcon, resolveTextWrapIcon, resolveViewerIcon, hasNativeMarkdown } from '../../dsh-capabilities/client/primitives-adapter.js';
|
|
3
|
+
import { QuickAppActions, QuickAppButton } from './ui.js';
|
|
4
|
+
import { documentPath, QuickAppEditor, QuickAppMarkdown } from './document.js';
|
|
5
|
+
const defaultMode = (path) => /\.(?:md|markdown)$/iu.test(path) && hasNativeMarkdown() ? 'markdown' : 'source';
|
|
6
|
+
/** Native renderers and editor with Quick Apps ownership, save preconditions and lifetime. */
|
|
7
|
+
export function QuickAppViewer({ app, view, client, busy, error, t, onClose, onReload }) {
|
|
8
|
+
const snapshot = () => view.kind === 'text' ? { path: view.path ?? app.entryPath, content: view.content, version: view.version ?? '', canWrite: view.canWrite ?? false } : undefined;
|
|
9
|
+
const [doc, setDoc] = useState(snapshot);
|
|
10
|
+
const [draft, setDraft] = useState(view.kind === 'text' ? view.content : '');
|
|
11
|
+
const [mode, setMode] = useState(() => defaultMode(app.entryPath));
|
|
12
|
+
const [wrap, setWrap] = useState(true);
|
|
13
|
+
const [maximized, setMaximized] = useState(false);
|
|
14
|
+
const [menu, setMenu] = useState(false);
|
|
15
|
+
const [loading, setLoading] = useState(false);
|
|
16
|
+
const [frameLoading, setFrameLoading] = useState(view.kind === 'html');
|
|
17
|
+
const [message, setMessage] = useState(null);
|
|
18
|
+
const [confirmation, setConfirmation] = useState(null);
|
|
19
|
+
const generation = useRef(0);
|
|
20
|
+
const pending = useRef(false);
|
|
21
|
+
const dirty = doc !== undefined && draft !== doc.content;
|
|
22
|
+
const path = doc?.path ?? app.entryPath;
|
|
23
|
+
const accept = (next) => { setDoc(next); setDraft(next.content); };
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
generation.current++;
|
|
26
|
+
pending.current = false;
|
|
27
|
+
setLoading(false);
|
|
28
|
+
setMessage(null);
|
|
29
|
+
setDoc(snapshot());
|
|
30
|
+
setDraft(view.kind === 'text' ? view.content : '');
|
|
31
|
+
setMode(defaultMode(app.entryPath));
|
|
32
|
+
setFrameLoading(view.kind === 'html');
|
|
33
|
+
return () => { generation.current++; };
|
|
34
|
+
}, [view]);
|
|
35
|
+
useEffect(() => { if (error)
|
|
36
|
+
setFrameLoading(false); }, [error]);
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
if (!dirty || typeof window === 'undefined')
|
|
39
|
+
return;
|
|
40
|
+
const prevent = (event) => { event.preventDefault(); event.returnValue = ''; };
|
|
41
|
+
window.addEventListener('beforeunload', prevent);
|
|
42
|
+
return () => window.removeEventListener('beforeunload', prevent);
|
|
43
|
+
}, [dirty]);
|
|
44
|
+
const run = async (operation, apply) => {
|
|
45
|
+
if (pending.current || busy)
|
|
46
|
+
return;
|
|
47
|
+
const current = generation.current;
|
|
48
|
+
pending.current = true;
|
|
49
|
+
setLoading(true);
|
|
50
|
+
setMessage(null);
|
|
51
|
+
try {
|
|
52
|
+
const value = await operation();
|
|
53
|
+
if (current === generation.current)
|
|
54
|
+
apply(value);
|
|
55
|
+
}
|
|
56
|
+
catch (cause) {
|
|
57
|
+
if (current !== generation.current)
|
|
58
|
+
return;
|
|
59
|
+
const code = cause.code;
|
|
60
|
+
const text = code === 'QUICK_APP_CONFLICT' ? t('quickApps.documentConflict')
|
|
61
|
+
: ['QUICK_APP_REVOKED', 'QUICK_APP_LAUNCH_EXPIRED', 'QUICK_APP_ACCESS_DENIED'].includes(code ?? '') ? t('quickApps.documentAccessExpired')
|
|
62
|
+
: code === 'CODINGNS_RPC_NOT_FOUND' ? t('quickApps.documentHostUpdate') : cause instanceof Error ? cause.message : String(cause);
|
|
63
|
+
setMessage({ error: true, text });
|
|
64
|
+
}
|
|
65
|
+
finally {
|
|
66
|
+
if (current === generation.current) {
|
|
67
|
+
pending.current = false;
|
|
68
|
+
setLoading(false);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
const call = (operation, extra = {}) => client.call('document', { id: view.launchId, path, operation, ...extra });
|
|
73
|
+
const guard = (action) => {
|
|
74
|
+
if (pending.current || busy)
|
|
75
|
+
return;
|
|
76
|
+
if (dirty)
|
|
77
|
+
setConfirmation({ kind: 'discard', action });
|
|
78
|
+
else
|
|
79
|
+
action();
|
|
80
|
+
};
|
|
81
|
+
const save = () => {
|
|
82
|
+
if (!doc?.canWrite || !dirty)
|
|
83
|
+
return;
|
|
84
|
+
const content = draft;
|
|
85
|
+
void run(() => call('save', { content, version: doc.version }), next => {
|
|
86
|
+
// Typing can continue while saving; never overwrite edits made after the submitted snapshot.
|
|
87
|
+
setDoc(next);
|
|
88
|
+
setMessage({ error: false, text: t('quickApps.documentSaved') });
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
const reload = () => guard(() => {
|
|
92
|
+
if (doc && client && view.launchId)
|
|
93
|
+
void run(() => call('read'), next => { accept(next); setMode(defaultMode(next.path)); });
|
|
94
|
+
else {
|
|
95
|
+
setFrameLoading(view.kind === 'html');
|
|
96
|
+
onReload();
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
const navigate = (destination, absolute = false) => guard(() => {
|
|
100
|
+
const target = absolute ? destination : documentPath(app.documentRoot, path, destination);
|
|
101
|
+
if (!target) {
|
|
102
|
+
setMessage({ error: true, text: t('quickApps.documentLinkDenied') });
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
if (!client || !view.launchId) {
|
|
106
|
+
setMessage({ error: true, text: t('quickApps.documentHostUpdate') });
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
void run(() => call('read', { path: target }), next => { accept(next); setMode(defaultMode(next.path)); });
|
|
110
|
+
});
|
|
111
|
+
const edit = () => {
|
|
112
|
+
if (!client || !view.launchId || !doc?.version) {
|
|
113
|
+
setMessage({ error: true, text: t('quickApps.documentHostUpdate') });
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
if (doc.canWrite)
|
|
117
|
+
setMode('edit');
|
|
118
|
+
else
|
|
119
|
+
setConfirmation({ kind: 'edit' });
|
|
120
|
+
};
|
|
121
|
+
const approve = () => {
|
|
122
|
+
setConfirmation(null);
|
|
123
|
+
void run(async () => { await call('allow-edit'); return call('read'); }, next => { accept(next); setMode('edit'); });
|
|
124
|
+
};
|
|
125
|
+
const disabled = busy || loading;
|
|
126
|
+
const tool = (label, icon, action, options = {}) => h(DshTooltip, { label, side: 'bottom', align: 'end', portal: true, delayMs: 500, focusDelayMs: 500, children: h('button', {
|
|
127
|
+
type: 'button', className: 'qa-view-tool', 'aria-label': label, 'aria-pressed': options.pressed,
|
|
128
|
+
disabled: options.disabled, onClick: action,
|
|
129
|
+
}, h(icon, { size: 15 })) });
|
|
130
|
+
// A bootstrap URL is a credential, not an address to copy into another browsing context.
|
|
131
|
+
const address = view.kind === 'html' ? view.isolation === 'sandbox-proxy' ? app.entryPath : `${view.origin}/${app.entryPath.slice(app.documentRoot.length).replace(/^\//u, '').split('/').map(encodeURIComponent).join('/')}` : '';
|
|
132
|
+
const activeMode = mode === 'markdown' ? t('quickApps.markdown') : mode === 'edit' ? t('quickApps.edit') : t('quickApps.source');
|
|
133
|
+
return h(DshModal, { open: true, headless: true, title: app.title, onClose: () => guard(onClose),
|
|
134
|
+
className: `codingns-quick-app-dialog qa-viewer${maximized ? ' qa-maximized' : ''}` }, h('section', { className: `qa-view-surface qa-view-${view.kind}`, 'aria-busy': disabled }, h('header', { className: 'qa-view-titlebar' }, h(DshFileTypeIcon, { kind: classifyDshFileType(path), size: 16 }), h('h2', null, app.title), dirty ? h('span', { className: 'qa-document-dirty', title: t('quickApps.unsaved'), 'aria-label': t('quickApps.unsaved') }, '●') : null, tool(t(maximized ? 'quickApps.restore' : 'quickApps.maximize'), resolveViewerIcon(maximized ? 'restore' : 'fullscreen'), () => setMaximized(!maximized), { pressed: maximized }), tool(t('quickApps.back'), resolveAssistantControlIcon('close'), () => guard(onClose), { disabled })), h('div', { className: 'qa-view-toolbar', role: 'group', 'aria-label': t('quickApps.viewerTools') }, doc ? h(DshPathLabel, { path, className: 'qa-view-path' })
|
|
135
|
+
: h('input', { className: 'qa-view-address', value: address, readOnly: true, 'aria-label': t('quickApps.entryAddress'), title: address }), doc ? h(DshMenu, { open: menu, onClose: () => setMenu(false), align: 'end', portal: true, dense: true,
|
|
136
|
+
anchor: h('button', { type: 'button', className: 'qa-view-mode', disabled, 'aria-label': t('quickApps.viewMode'), onClick: () => setMenu(!menu) }, activeMode),
|
|
137
|
+
selectedId: mode, items: [...(defaultMode(path) === 'markdown' ? [{ id: 'markdown', label: t('quickApps.markdown') }] : []), { id: 'source', label: t('quickApps.source') }, { id: 'edit', label: t('quickApps.edit') }],
|
|
138
|
+
onSelect: value => { setMenu(false); if (value === 'edit')
|
|
139
|
+
edit();
|
|
140
|
+
else
|
|
141
|
+
setMode(value); } }) : null, doc && mode === 'source' ? tool(t('quickApps.wrapText'), resolveTextWrapIcon(wrap), () => setWrap(!wrap), { pressed: wrap }) : null, doc && path !== app.entryPath ? tool(t('quickApps.documentHome'), resolveViewerIcon('back'), () => navigate(app.entryPath, true), { disabled }) : null, doc ? dirty ? tool(t('quickApps.save'), resolveViewerIcon('save'), save, { disabled })
|
|
142
|
+
: tool(t('quickApps.edit'), resolveViewerIcon('edit'), edit, { disabled: disabled || mode === 'edit' }) : null, tool(t('quickApps.reloadView'), resolveRefreshIcon(), reload, { disabled })), disabled || frameLoading ? h('div', { className: 'qa-view-progress', role: 'status', 'aria-label': t('quickApps.loadingDocument') }) : null, error || message ? h('p', { className: message && !message.error && !error ? 'qa-view-status' : 'qa-view-error', role: message && !message.error && !error ? 'status' : 'alert' }, error ?? message?.text) : null, doc && /\.(?:md|markdown)$/iu.test(path) && !hasNativeMarkdown() ? h('p', { className: 'qa-view-status', role: 'status' }, t('quickApps.markdownUnavailable')) : null, view.kind === 'html' && view.isolation === 'sandbox-proxy' ? h('p', { className: 'qa-view-status', role: 'status' }, t('quickApps.sandboxPreview')) : null, doc ? mode === 'edit' ? h(QuickAppEditor, { key: path, content: draft, path, t, onChange: setDraft, onSave: save })
|
|
143
|
+
: mode === 'markdown' ? h(QuickAppMarkdown, { key: path, content: draft, path, root: app.documentRoot, launchId: view.launchId, client, t, onNavigate: navigate })
|
|
144
|
+
: h('div', { className: 'qa-view-text-body', 'data-wrap': wrap, tabIndex: 0, 'aria-label': app.title }, h('pre', null, draft))
|
|
145
|
+
: view.kind === 'html' ? h('iframe', { key: view.launchId, className: 'qa-view-frame', title: app.title, src: view.url, onLoad: () => setFrameLoading(false),
|
|
146
|
+
sandbox: view.isolation === 'sandbox-proxy' ? 'allow-scripts allow-forms allow-downloads' : 'allow-scripts allow-same-origin allow-forms allow-downloads', referrerPolicy: 'no-referrer' }) : null), confirmation ? h(DshModal, { open: true, title: t(confirmation.kind === 'edit' ? 'quickApps.allowEditing' : 'quickApps.discardTitle'), closeLabel: t('quickApps.cancel'),
|
|
147
|
+
onClose: () => setConfirmation(null), className: 'codingns-quick-app-dialog qa-view-confirm',
|
|
148
|
+
footer: h(QuickAppActions, null, h(QuickAppButton, { onClick: () => setConfirmation(null) }, t('quickApps.cancel')), h(QuickAppButton, { danger: confirmation.kind === 'discard', onClick: () => { if (confirmation.kind === 'edit')
|
|
149
|
+
approve();
|
|
150
|
+
else {
|
|
151
|
+
setConfirmation(null);
|
|
152
|
+
confirmation.action();
|
|
153
|
+
} } }, t(confirmation.kind === 'edit' ? 'quickApps.allowEditing' : 'quickApps.discard'))) }, h('p', null, t(confirmation.kind === 'edit' ? 'quickApps.allowEditingHelp' : 'quickApps.discardHelp', { path }))) : null);
|
|
154
|
+
}
|
|
155
|
+
//# sourceMappingURL=viewer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewer.js","sourceRoot":"","sources":["../../../../../src/client/quick-apps/viewer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,IAAI,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAqB,MAAM,OAAO,CAAA;AAG1F,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,qDAAqD,CAAA;AAEnQ,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAG9E,MAAM,WAAW,GAAG,CAAC,IAAY,EAAgB,EAAE,CAAC,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI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ale.js';
|
|
3
|
+
export declare const workspaceChoiceId: (workspace: {
|
|
4
|
+
hostId?: string | undefined;
|
|
5
|
+
workspaceId: string;
|
|
6
|
+
}) => string;
|
|
7
|
+
/** The native menu owns placement, keyboard navigation and focus return. IDs never depend on list order. */
|
|
8
|
+
export declare function QuickAppWorkspacePicker({ workspaces, hostId, workspaceId, disabled, error, t, onSelect }: {
|
|
9
|
+
workspaces: readonly NativeWorkspaceRecord[];
|
|
10
|
+
hostId: string;
|
|
11
|
+
workspaceId: string;
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
error?: string | undefined;
|
|
14
|
+
t: CodingNsTranslator;
|
|
15
|
+
onSelect(workspace: NativeWorkspaceRecord): void;
|
|
16
|
+
}): import("react").DetailedReactHTMLElement<{
|
|
17
|
+
className: string;
|
|
18
|
+
}, HTMLElement>;
|
|
19
|
+
//# sourceMappingURL=workspace-picker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-picker.d.ts","sourceRoot":"","sources":["../../../../../src/client/quick-apps/workspace-picker.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AACzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAGtD,eAAO,MAAM,iBAAiB,GAAI,WAAW;IAAE,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,WAAyE,CAAA;AAE1K,4GAA4G;AAC5G,wBAAgB,uBAAuB,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE;IACzG,UAAU,EAAE,SAAS,qBAAqB,EAAE,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;IACpG,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,CAAC,EAAE,kBAAkB,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,qBAAqB,GAAG,IAAI,CAAA;CACpG;;gBAuBA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { createElement as h, useEffect, useId, useState } from 'react';
|
|
2
|
+
import { DshFolderIcon, DshMenu, resolveChevronDownIcon } from '../../dsh-capabilities/client/primitives-adapter.js';
|
|
3
|
+
export const workspaceChoiceId = (workspace) => JSON.stringify([workspace.hostId ?? 'local', workspace.workspaceId]);
|
|
4
|
+
/** The native menu owns placement, keyboard navigation and focus return. IDs never depend on list order. */
|
|
5
|
+
export function QuickAppWorkspacePicker({ workspaces, hostId, workspaceId, disabled, error, t, onSelect }) {
|
|
6
|
+
const [open, setOpen] = useState(false);
|
|
7
|
+
const id = useId();
|
|
8
|
+
useEffect(() => { if (disabled)
|
|
9
|
+
setOpen(false); }, [disabled]);
|
|
10
|
+
const selectedId = workspaceChoiceId({ hostId, workspaceId });
|
|
11
|
+
const selected = workspaces.find(item => workspaceChoiceId(item) === selectedId);
|
|
12
|
+
const label = (workspace) => h('span', { className: 'qa-workspace-label' }, h('span', { className: 'qa-workspace-name' }, workspace.title), h('small', null, `${workspace.hostLabel ?? workspace.hostId ?? t('quickApps.localHost')}${workspace.workspacePath ?? workspace.path ? ` · ${workspace.workspacePath ?? workspace.path}` : ''}`));
|
|
13
|
+
return h('div', { className: 'qa-field' }, h('label', { htmlFor: id }, t('quickApps.workspace')), h(DshMenu, { open: open && !disabled, portal: true, autoFocus: true, className: 'qa-workspace-picker', listClassName: 'codingns-quick-app-workspaces', selectedId,
|
|
14
|
+
anchor: h('button', { id, type: 'button', className: 'qa-workspace-trigger', disabled, 'aria-label': t('quickApps.workspace'), 'aria-invalid': Boolean(error),
|
|
15
|
+
'aria-haspopup': 'menu', 'aria-expanded': open && !disabled, 'data-modal-autofocus': true,
|
|
16
|
+
onClick: () => setOpen(!open), onKeyDown: (event) => { if (['ArrowDown', 'ArrowUp'].includes(event.key)) {
|
|
17
|
+
event.preventDefault();
|
|
18
|
+
setOpen(true);
|
|
19
|
+
} } }, h(DshFolderIcon, { size: 18 }), selected ? label(selected) : h('span', { className: 'qa-workspace-label' }, t(workspaceId ? 'quickApps.status.missing-workspace' : 'quickApps.chooseWorkspace')), h(resolveChevronDownIcon(), { size: 14 })),
|
|
20
|
+
items: workspaces.length ? workspaces.map(workspace => ({ id: workspaceChoiceId(workspace), label: label(workspace), icon: h(DshFolderIcon, { size: 16 }) }))
|
|
21
|
+
: [{ id: 'empty', label: t('quickApps.noWorkspaces'), disabled: true }],
|
|
22
|
+
onClose: () => setOpen(false), onSelect: (value) => {
|
|
23
|
+
const workspace = workspaces.find(item => workspaceChoiceId(item) === value);
|
|
24
|
+
if (disabled || !workspace)
|
|
25
|
+
return;
|
|
26
|
+
setOpen(false);
|
|
27
|
+
onSelect(workspace);
|
|
28
|
+
} }), error ? h('span', { className: 'qa-field-error', role: 'alert' }, error) : null);
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=workspace-picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-picker.js","sourceRoot":"","sources":["../../../../../src/client/quick-apps/workspace-picker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,IAAI,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAGtE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qDAAqD,CAAA;AAEpH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,SAA+D,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,MAAM,IAAI,OAAO,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC,CAAA;AAE1K,4GAA4G;AAC5G,MAAM,UAAU,uBAAuB,CAAC,EAAE,UAAU,EAAE,MAAM,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AC,CAAC,EAAE,EAAE,EAAE,iBAAiB,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;YAC3J,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,wBAAwB,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QACzE,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC,KAAa,EAAE,EAAE;YACzD,MAAM,SAAS,GAAG,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,CAAA;YAC5E,IAAI,QAAQ,IAAI,CAAC,SAAS;gBAAE,OAAM;YAClC,OAAO,CAAC,KAAK,CAAC,CAAC;YAAC,QAAQ,CAAC,SAAS,CAAC,CAAA;QACrC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,gBAAgB,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;AAC5F,CAAC"}
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import type { ReactElement, ReactNode } from 'react';
|
|
2
2
|
import type { MarkdownLabels } from '@deepseek-ai/dsh-client-ui-primitives';
|
|
3
|
+
import { type DshCapabilityRuntimeFacts } from '../dsh-capabilities/routes.js';
|
|
3
4
|
import type { CodingNsClientServices } from './features/types.js';
|
|
4
5
|
import type { CodingNsTranslator } from './locale.js';
|
|
5
|
-
import type { SessionTranslationRecord } from '../shared/contracts/session-translation.js';
|
|
6
|
+
import type { SessionTranslationOutputKind, SessionTranslationRecord, SessionTranslationPendingInput } from '../shared/contracts/session-translation.js';
|
|
6
7
|
interface TranslationActionProps {
|
|
7
8
|
readonly messageId: string;
|
|
9
|
+
readonly sessionId?: string | undefined;
|
|
10
|
+
readonly outputKind?: SessionTranslationOutputKind | undefined;
|
|
11
|
+
readonly inputFailure?: SessionTranslationPendingInput | undefined;
|
|
12
|
+
readonly onDecision?: (() => void) | undefined;
|
|
8
13
|
readonly messageRole?: 'user' | 'assistant';
|
|
9
14
|
readonly services: CodingNsClientServices;
|
|
10
15
|
readonly translationT: CodingNsTranslator;
|
|
11
16
|
/** Absent only for a pending submission in a translation-enabled session. */
|
|
12
|
-
readonly record?: SessionTranslationRecord;
|
|
17
|
+
readonly record?: SessionTranslationRecord | undefined;
|
|
13
18
|
readonly original?: string;
|
|
14
19
|
readonly popupAlign?: 'start' | 'end';
|
|
15
20
|
readonly inline?: boolean;
|
|
@@ -32,6 +37,7 @@ type TranslationFactorySlot = (name: string, props: Record<string, unknown>, opt
|
|
|
32
37
|
export declare function TranslationAction(props: TranslationActionProps): ReactElement | null;
|
|
33
38
|
interface AssistantReasoningContentProps {
|
|
34
39
|
readonly messageId: string;
|
|
40
|
+
readonly sessionId?: string | undefined;
|
|
35
41
|
readonly services: CodingNsClientServices;
|
|
36
42
|
readonly translationT: CodingNsTranslator;
|
|
37
43
|
readonly text: string;
|
|
@@ -59,8 +65,8 @@ interface AssistantReasoningContentProps {
|
|
|
59
65
|
*/
|
|
60
66
|
export declare function AssistantReasoningContent(props: AssistantReasoningContentProps): ReactElement;
|
|
61
67
|
/**
|
|
62
|
-
*
|
|
68
|
+
* 注册用户消息(含插话)与 AI 正文的翻译渲染器;DSH 的用户气泡内容仍由统一主题令牌控制。
|
|
63
69
|
*/
|
|
64
|
-
export declare function registerSessionTranslationChatUi(services: CodingNsClientServices): () => void;
|
|
70
|
+
export declare function registerSessionTranslationChatUi(services: CodingNsClientServices, facts?: DshCapabilityRuntimeFacts): () => void;
|
|
65
71
|
export {};
|
|
66
72
|
//# sourceMappingURL=session-translation-chat.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-translation-chat.d.ts","sourceRoot":"","sources":["../../../../src/client/session-translation-chat.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"session-translation-chat.d.ts","sourceRoot":"","sources":["../../../../src/client/session-translation-chat.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAgBnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAA;AAE3E,OAAO,EAA+B,KAAK,yBAAyB,EAAE,MAAM,+BAA+B,CAAA;AAW3G,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AACjE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AACrD,OAAO,KAAK,EAAsF,4BAA4B,EAAE,wBAAwB,EAAE,8BAA8B,EAAoC,MAAM,4CAA4C,CAAA;AAgB9Q,UAAU,sBAAsB;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACvC,QAAQ,CAAC,UAAU,CAAC,EAAE,4BAA4B,GAAG,SAAS,CAAA;IAC9D,QAAQ,CAAC,YAAY,CAAC,EAAE,8BAA8B,GAAG,SAAS,CAAA;IAClE,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAA;IAC9C,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,WAAW,CAAA;IAC3C,QAAQ,CAAC,QAAQ,EAAE,sBAAsB,CAAA;IACzC,QAAQ,CAAC,YAAY,EAAE,kBAAkB,CAAA;IACzC,6EAA6E;IAC7E,QAAQ,CAAC,MA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