@celljs/ta-web 4.9.0 → 4.10.0
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 +4 -3
- package/README.md +4 -3
- package/esm/browser/assistant/assistant-chat-list.js +8 -2
- package/esm/browser/assistant/assistant-extension.d.ts +8 -1
- package/esm/browser/assistant/assistant-extension.js +33 -5
- package/esm/browser/assistant/assistant-protocol.d.ts +3 -1
- package/esm/browser/assistant/assistant-task-source.d.ts +2 -0
- package/esm/browser/assistant/assistant-task-source.js +2 -0
- package/esm/browser/assistant/assistant-task-util.d.ts +8 -0
- package/esm/browser/assistant/assistant-task-util.js +13 -3
- package/esm/browser/assistant/assistant-tasks.js +3 -2
- package/esm/browser/assistant/assistant-view.js +81 -56
- package/esm/browser/assistant/assistant.d.ts +30 -1
- package/esm/browser/assistant/assistant.js +89 -6
- package/esm/browser/assistant/task-views.d.ts +40 -6
- package/esm/browser/assistant/task-views.js +73 -21
- package/esm/browser/avatar/dino-avatar.d.ts +3 -4
- package/esm/browser/avatar/dino-avatar.js +4 -178
- package/esm/browser/avatar/dino-face.d.ts +19 -0
- package/esm/browser/avatar/dino-face.js +142 -0
- package/esm/browser/avatar/dino-geometry.d.ts +11 -0
- package/esm/browser/avatar/dino-geometry.js +38 -0
- package/esm/browser/avatar/dino-kinds.d.ts +15 -0
- package/esm/browser/avatar/dino-kinds.js +544 -0
- package/esm/browser/avatar/dino-motion.js +1 -1
- package/esm/browser/avatar/dino-shape.d.ts +80 -0
- package/esm/browser/avatar/dino-shape.js +113 -0
- package/esm/browser/avatar/dino-species.d.ts +1 -61
- package/esm/browser/avatar/dino-species.js +2 -653
- package/esm/browser/chat/chat-packages.d.ts +39 -0
- package/esm/browser/chat/chat-packages.js +70 -0
- package/esm/browser/chat/chat-protocol.d.ts +23 -1
- package/esm/browser/chat/chat-stores.d.ts +59 -0
- package/esm/browser/chat/chat-stores.js +121 -0
- package/esm/browser/chat/chat-util.d.ts +17 -0
- package/esm/browser/chat/chat-util.js +61 -0
- package/esm/browser/chat/chat-view.js +33 -12
- package/esm/browser/chat/chat.d.ts +31 -39
- package/esm/browser/chat/chat.js +226 -175
- package/esm/browser/components/access-view.js +1 -1
- package/esm/browser/components/account-menu.js +1 -1
- package/esm/browser/components/app-nav.d.ts +6 -3
- package/esm/browser/components/app-nav.js +19 -10
- package/esm/browser/components/app-shell-hooks.d.ts +47 -0
- package/esm/browser/components/app-shell-hooks.js +169 -0
- package/esm/browser/components/app-view.js +81 -172
- package/esm/browser/components/auth-view.js +1 -1
- package/esm/browser/components/chat-list.d.ts +20 -2
- package/esm/browser/components/chat-list.js +138 -22
- package/esm/browser/components/composer-box.d.ts +5 -5
- package/esm/browser/components/composer-box.js +111 -4
- package/esm/browser/components/composer.d.ts +7 -0
- package/esm/browser/components/composer.js +22 -14
- package/esm/browser/components/connection-bar.js +50 -17
- package/esm/browser/components/context-menu.d.ts +30 -4
- package/esm/browser/components/context-menu.js +199 -37
- package/esm/browser/components/conversation-scroll.d.ts +129 -6
- package/esm/browser/components/conversation-scroll.js +429 -109
- package/esm/browser/components/dino.js +1 -1
- package/esm/browser/components/earlier-messages.d.ts +2 -1
- package/esm/browser/components/earlier-messages.js +2 -17
- package/esm/browser/components/editor-area.d.ts +3 -1
- package/esm/browser/components/editor-area.js +6 -5
- package/esm/browser/components/empty-pictures.d.ts +0 -2
- package/esm/browser/components/empty-pictures.js +0 -16
- package/esm/browser/components/folder-picker.d.ts +5 -2
- package/esm/browser/components/folder-picker.js +30 -9
- package/esm/browser/components/held-talk.d.ts +28 -0
- package/esm/browser/components/held-talk.js +76 -0
- package/esm/browser/components/host-view.d.ts +1 -1
- package/esm/browser/components/host-view.js +1 -1
- package/esm/browser/components/icon.d.ts +2 -2
- package/esm/browser/components/icon.js +5 -6
- package/esm/browser/components/image-viewer.d.ts +124 -0
- package/esm/browser/components/image-viewer.js +397 -0
- package/esm/browser/components/lightbox.d.ts +11 -0
- package/esm/browser/components/lightbox.js +24 -0
- package/esm/browser/components/markdown.d.ts +6 -2
- package/esm/browser/components/markdown.js +24 -10
- package/esm/browser/components/media.js +1 -10
- package/esm/browser/components/message-footer.d.ts +16 -2
- package/esm/browser/components/message-footer.js +29 -12
- package/esm/browser/components/message-list.d.ts +24 -3
- package/esm/browser/components/message-list.js +149 -20
- package/esm/browser/components/message-menu.d.ts +3 -1
- package/esm/browser/components/message-menu.js +18 -3
- package/esm/browser/components/nav-places.d.ts +16 -1
- package/esm/browser/components/nav-places.js +12 -3
- package/esm/browser/components/phone-shell.d.ts +4 -1
- package/esm/browser/components/phone-shell.js +3 -1
- package/esm/browser/components/run-status.js +3 -3
- package/esm/browser/components/select-bar.d.ts +9 -0
- package/esm/browser/components/select-bar.js +24 -0
- package/esm/browser/components/session-settings.d.ts +6 -0
- package/esm/browser/components/session-settings.js +14 -1
- package/esm/browser/components/session-view.js +8 -4
- package/esm/browser/components/settings-choices.d.ts +35 -0
- package/esm/browser/components/settings-choices.js +117 -0
- package/esm/browser/components/settings-parts.d.ts +21 -0
- package/esm/browser/components/settings-parts.js +323 -0
- package/esm/browser/components/settings-view.d.ts +0 -6
- package/esm/browser/components/settings-view.js +4 -406
- package/esm/browser/components/swipe-row.d.ts +2 -2
- package/esm/browser/components/swipe-row.js +7 -3
- package/esm/browser/components/tool-view.js +14 -12
- package/esm/browser/components/voice-button.d.ts +1 -1
- package/esm/browser/components/voice-button.js +1 -1
- package/esm/browser/components/voice-talk.d.ts +43 -0
- package/esm/browser/components/voice-talk.js +222 -0
- package/esm/browser/components/workbench-view.js +1 -1
- package/esm/browser/device/device.d.ts +3 -0
- package/esm/browser/device/device.js +11 -1
- package/esm/browser/device/hold.d.ts +42 -0
- package/esm/browser/device/hold.js +136 -0
- package/esm/browser/device/launch-screen.d.ts +1 -1
- package/esm/browser/device/launch-screen.js +1 -1
- package/esm/browser/device/long-press.d.ts +2 -0
- package/esm/browser/device/long-press.js +16 -1
- package/esm/browser/device/pull-down.d.ts +4 -2
- package/esm/browser/device/pull-down.js +64 -76
- package/esm/browser/device/row-swipe.d.ts +35 -10
- package/esm/browser/device/row-swipe.js +149 -71
- package/esm/browser/device/shake-undo.d.ts +16 -0
- package/esm/browser/device/shake-undo.js +59 -0
- package/esm/browser/device/sheet-swipe.d.ts +118 -18
- package/esm/browser/device/sheet-swipe.js +406 -107
- package/esm/browser/extension/icons.js +2 -1
- package/esm/browser/extension/web-extension-api.d.ts +135 -2
- package/esm/browser/extension/web-extension-code.d.ts +6 -0
- package/esm/browser/extension/web-extension-code.js +24 -0
- package/esm/browser/extension/web-extension-protocol.d.ts +23 -1
- package/esm/browser/extension/web-extension-protocol.js +8 -0
- package/esm/browser/extension/web-extensions.d.ts +14 -1
- package/esm/browser/extension/web-extensions.js +128 -24
- package/esm/browser/extension/web-tasks.d.ts +9 -1
- package/esm/browser/extension/web-tasks.js +24 -0
- package/esm/browser/files/files-protocol.d.ts +25 -0
- package/esm/browser/files/files-protocol.js +2 -0
- package/esm/browser/files/files.d.ts +35 -0
- package/esm/browser/files/files.js +119 -0
- package/esm/browser/hooks.d.ts +3 -1
- package/esm/browser/hooks.js +8 -0
- package/esm/browser/i18n/locales.d.ts +29 -2
- package/esm/browser/i18n/messages.d.ts +28 -1
- package/esm/browser/i18n/messages.js +58 -4
- package/esm/browser/index.d.ts +6 -0
- package/esm/browser/index.js +6 -0
- package/esm/browser/notices/notices-protocol.d.ts +9 -1
- package/esm/browser/notices/notices.d.ts +2 -0
- package/esm/browser/notices/notices.js +20 -10
- package/esm/browser/offline/device-values.d.ts +55 -0
- package/esm/browser/offline/device-values.js +142 -0
- package/esm/browser/offline/kept-chats-protocol.d.ts +17 -0
- package/esm/browser/offline/kept-chats-protocol.js +2 -0
- package/esm/browser/offline/kept-chats.d.ts +47 -0
- package/esm/browser/offline/kept-chats.js +146 -0
- package/esm/browser/offline/offline-reads.d.ts +44 -0
- package/esm/browser/offline/offline-reads.js +107 -0
- package/esm/browser/settings/settings-protocol.d.ts +2 -0
- package/esm/browser/settings/settings-protocol.js +2 -0
- package/esm/browser/style/conversation.d.ts +1 -1
- package/esm/browser/style/conversation.js +57 -17
- package/esm/browser/style/device.js +43 -4
- package/esm/browser/style/layout.d.ts +1 -1
- package/esm/browser/style/layout.js +67 -15
- package/esm/browser/style/pages.d.ts +1 -1
- package/esm/browser/style/pages.js +2 -1
- package/esm/browser/style/shell.d.ts +1 -1
- package/esm/browser/style/shell.js +47 -3
- package/esm/browser/style/tasks.d.ts +1 -1
- package/esm/browser/style/tasks.js +2 -0
- package/esm/browser/util/frame.d.ts +5 -4
- package/esm/browser/util/frame.js +5 -4
- package/esm/browser/util/markdown.d.ts +18 -1
- package/esm/browser/util/markdown.js +119 -5
- package/esm/browser/util/process.d.ts +21 -0
- package/esm/browser/util/process.js +45 -1
- package/esm/browser/util/voice.d.ts +5 -2
- package/esm/browser/util/voice.js +6 -3
- package/esm/browser/util/zoom.d.ts +46 -0
- package/esm/browser/util/zoom.js +96 -0
- package/esm/browser/workbench-calls.d.ts +59 -0
- package/esm/browser/workbench-calls.js +141 -0
- package/esm/browser/workbench-protocol.d.ts +5 -1
- package/esm/browser/workbench-util.d.ts +68 -0
- package/esm/browser/workbench-util.js +145 -0
- package/esm/browser/workbench.d.ts +15 -42
- package/esm/browser/workbench.js +53 -167
- package/lib/browser/assistant/assistant-chat-list.js +8 -2
- package/lib/browser/assistant/assistant-extension.d.ts +8 -1
- package/lib/browser/assistant/assistant-extension.js +33 -5
- package/lib/browser/assistant/assistant-protocol.d.ts +3 -1
- package/lib/browser/assistant/assistant-task-source.d.ts +2 -0
- package/lib/browser/assistant/assistant-task-source.js +2 -0
- package/lib/browser/assistant/assistant-task-util.d.ts +8 -0
- package/lib/browser/assistant/assistant-task-util.js +13 -3
- package/lib/browser/assistant/assistant-tasks.js +2 -1
- package/lib/browser/assistant/assistant-view.js +78 -53
- package/lib/browser/assistant/assistant.d.ts +30 -1
- package/lib/browser/assistant/assistant.js +89 -6
- package/lib/browser/assistant/task-views.d.ts +40 -6
- package/lib/browser/assistant/task-views.js +74 -21
- package/lib/browser/avatar/dino-avatar.d.ts +3 -4
- package/lib/browser/avatar/dino-avatar.js +27 -202
- package/lib/browser/avatar/dino-face.d.ts +20 -0
- package/lib/browser/avatar/dino-face.js +148 -0
- package/lib/browser/avatar/dino-geometry.d.ts +12 -0
- package/lib/browser/avatar/dino-geometry.js +47 -0
- package/lib/browser/avatar/dino-kinds.d.ts +16 -0
- package/lib/browser/avatar/dino-kinds.js +547 -0
- package/lib/browser/avatar/dino-motion.js +2 -2
- package/lib/browser/avatar/dino-shape.d.ts +81 -0
- package/lib/browser/avatar/dino-shape.js +126 -0
- package/lib/browser/avatar/dino-species.d.ts +1 -61
- package/lib/browser/avatar/dino-species.js +34 -687
- package/lib/browser/chat/chat-packages.d.ts +40 -0
- package/lib/browser/chat/chat-packages.js +74 -0
- package/lib/browser/chat/chat-protocol.d.ts +23 -1
- package/lib/browser/chat/chat-stores.d.ts +60 -0
- package/lib/browser/chat/chat-stores.js +125 -0
- package/lib/browser/chat/chat-util.d.ts +18 -0
- package/lib/browser/chat/chat-util.js +64 -0
- package/lib/browser/chat/chat-view.js +33 -12
- package/lib/browser/chat/chat.d.ts +31 -39
- package/lib/browser/chat/chat.js +227 -176
- package/lib/browser/components/access-view.js +2 -2
- package/lib/browser/components/account-menu.js +2 -2
- package/lib/browser/components/app-nav.d.ts +6 -3
- package/lib/browser/components/app-nav.js +17 -8
- package/lib/browser/components/app-shell-hooks.d.ts +48 -0
- package/lib/browser/components/app-shell-hooks.js +211 -0
- package/lib/browser/components/app-view.js +89 -180
- package/lib/browser/components/auth-view.js +3 -3
- package/lib/browser/components/chat-list.d.ts +20 -2
- package/lib/browser/components/chat-list.js +137 -21
- package/lib/browser/components/composer-box.d.ts +5 -5
- package/lib/browser/components/composer-box.js +111 -4
- package/lib/browser/components/composer.d.ts +7 -0
- package/lib/browser/components/composer.js +22 -14
- package/lib/browser/components/connection-bar.js +48 -15
- package/lib/browser/components/context-menu.d.ts +30 -4
- package/lib/browser/components/context-menu.js +198 -36
- package/lib/browser/components/conversation-scroll.d.ts +129 -6
- package/lib/browser/components/conversation-scroll.js +431 -110
- package/lib/browser/components/dino.js +3 -3
- package/lib/browser/components/earlier-messages.d.ts +2 -1
- package/lib/browser/components/earlier-messages.js +2 -17
- package/lib/browser/components/editor-area.d.ts +3 -1
- package/lib/browser/components/editor-area.js +5 -4
- package/lib/browser/components/empty-pictures.d.ts +0 -2
- package/lib/browser/components/empty-pictures.js +0 -17
- package/lib/browser/components/folder-picker.d.ts +5 -2
- package/lib/browser/components/folder-picker.js +30 -9
- package/lib/browser/components/held-talk.d.ts +29 -0
- package/lib/browser/components/held-talk.js +79 -0
- package/lib/browser/components/host-view.d.ts +1 -1
- package/lib/browser/components/host-view.js +5 -5
- package/lib/browser/components/icon.d.ts +2 -2
- package/lib/browser/components/icon.js +7 -6
- package/lib/browser/components/image-viewer.d.ts +125 -0
- package/lib/browser/components/image-viewer.js +435 -0
- package/lib/browser/components/lightbox.d.ts +12 -0
- package/lib/browser/components/lightbox.js +60 -0
- package/lib/browser/components/markdown.d.ts +6 -2
- package/lib/browser/components/markdown.js +24 -10
- package/lib/browser/components/media.js +2 -11
- package/lib/browser/components/message-footer.d.ts +16 -2
- package/lib/browser/components/message-footer.js +31 -12
- package/lib/browser/components/message-list.d.ts +24 -3
- package/lib/browser/components/message-list.js +146 -16
- package/lib/browser/components/message-menu.d.ts +3 -1
- package/lib/browser/components/message-menu.js +17 -2
- package/lib/browser/components/nav-places.d.ts +16 -1
- package/lib/browser/components/nav-places.js +13 -3
- package/lib/browser/components/phone-shell.d.ts +4 -1
- package/lib/browser/components/phone-shell.js +3 -1
- package/lib/browser/components/run-status.js +3 -3
- package/lib/browser/components/select-bar.d.ts +10 -0
- package/lib/browser/components/select-bar.js +61 -0
- package/lib/browser/components/session-settings.d.ts +6 -0
- package/lib/browser/components/session-settings.js +14 -1
- package/lib/browser/components/session-view.js +7 -3
- package/lib/browser/components/settings-choices.d.ts +36 -0
- package/lib/browser/components/settings-choices.js +156 -0
- package/lib/browser/components/settings-parts.d.ts +22 -0
- package/lib/browser/components/settings-parts.js +359 -0
- package/lib/browser/components/settings-view.d.ts +0 -6
- package/lib/browser/components/settings-view.js +2 -405
- package/lib/browser/components/swipe-row.d.ts +2 -2
- package/lib/browser/components/swipe-row.js +7 -3
- package/lib/browser/components/tool-view.js +14 -12
- package/lib/browser/components/voice-button.d.ts +1 -1
- package/lib/browser/components/voice-button.js +1 -1
- package/lib/browser/components/voice-talk.d.ts +44 -0
- package/lib/browser/components/voice-talk.js +260 -0
- package/lib/browser/components/workbench-view.js +3 -3
- package/lib/browser/device/device.d.ts +3 -0
- package/lib/browser/device/device.js +11 -1
- package/lib/browser/device/hold.d.ts +43 -0
- package/lib/browser/device/hold.js +173 -0
- package/lib/browser/device/launch-screen.d.ts +1 -1
- package/lib/browser/device/launch-screen.js +1 -1
- package/lib/browser/device/long-press.d.ts +2 -0
- package/lib/browser/device/long-press.js +16 -1
- package/lib/browser/device/pull-down.d.ts +4 -2
- package/lib/browser/device/pull-down.js +63 -75
- package/lib/browser/device/row-swipe.d.ts +35 -10
- package/lib/browser/device/row-swipe.js +148 -70
- package/lib/browser/device/shake-undo.d.ts +17 -0
- package/lib/browser/device/shake-undo.js +63 -0
- package/lib/browser/device/sheet-swipe.d.ts +118 -18
- package/lib/browser/device/sheet-swipe.js +410 -108
- package/lib/browser/extension/icons.js +1 -0
- package/lib/browser/extension/web-extension-api.d.ts +135 -2
- package/lib/browser/extension/web-extension-code.d.ts +6 -0
- package/lib/browser/extension/web-extension-code.js +24 -0
- package/lib/browser/extension/web-extension-protocol.d.ts +23 -1
- package/lib/browser/extension/web-extension-protocol.js +9 -1
- package/lib/browser/extension/web-extensions.d.ts +14 -1
- package/lib/browser/extension/web-extensions.js +125 -21
- package/lib/browser/extension/web-tasks.d.ts +9 -1
- package/lib/browser/extension/web-tasks.js +24 -0
- package/lib/browser/files/files-protocol.d.ts +26 -0
- package/lib/browser/files/files-protocol.js +5 -0
- package/lib/browser/files/files.d.ts +36 -0
- package/lib/browser/files/files.js +122 -0
- package/lib/browser/hooks.d.ts +3 -1
- package/lib/browser/hooks.js +9 -0
- package/lib/browser/i18n/locales.d.ts +29 -2
- package/lib/browser/i18n/messages.d.ts +28 -1
- package/lib/browser/i18n/messages.js +58 -4
- package/lib/browser/index.d.ts +6 -0
- package/lib/browser/index.js +6 -0
- package/lib/browser/notices/notices-protocol.d.ts +9 -1
- package/lib/browser/notices/notices.d.ts +2 -0
- package/lib/browser/notices/notices.js +20 -10
- package/lib/browser/offline/device-values.d.ts +56 -0
- package/lib/browser/offline/device-values.js +148 -0
- package/lib/browser/offline/kept-chats-protocol.d.ts +18 -0
- package/lib/browser/offline/kept-chats-protocol.js +5 -0
- package/lib/browser/offline/kept-chats.d.ts +48 -0
- package/lib/browser/offline/kept-chats.js +149 -0
- package/lib/browser/offline/offline-reads.d.ts +45 -0
- package/lib/browser/offline/offline-reads.js +111 -0
- package/lib/browser/settings/settings-protocol.d.ts +2 -0
- package/lib/browser/settings/settings-protocol.js +2 -0
- package/lib/browser/style/conversation.d.ts +1 -1
- package/lib/browser/style/conversation.js +57 -17
- package/lib/browser/style/device.js +43 -4
- package/lib/browser/style/layout.d.ts +1 -1
- package/lib/browser/style/layout.js +67 -15
- package/lib/browser/style/pages.d.ts +1 -1
- package/lib/browser/style/pages.js +2 -1
- package/lib/browser/style/shell.d.ts +1 -1
- package/lib/browser/style/shell.js +47 -3
- package/lib/browser/style/tasks.d.ts +1 -1
- package/lib/browser/style/tasks.js +2 -0
- package/lib/browser/util/frame.d.ts +5 -4
- package/lib/browser/util/frame.js +5 -4
- package/lib/browser/util/markdown.d.ts +18 -1
- package/lib/browser/util/markdown.js +119 -5
- package/lib/browser/util/process.d.ts +21 -0
- package/lib/browser/util/process.js +46 -2
- package/lib/browser/util/voice.d.ts +5 -2
- package/lib/browser/util/voice.js +6 -3
- package/lib/browser/util/zoom.d.ts +47 -0
- package/lib/browser/util/zoom.js +99 -0
- package/lib/browser/workbench-calls.d.ts +60 -0
- package/lib/browser/workbench-calls.js +145 -0
- package/lib/browser/workbench-protocol.d.ts +5 -1
- package/lib/browser/workbench-util.d.ts +69 -0
- package/lib/browser/workbench-util.js +151 -0
- package/lib/browser/workbench.d.ts +15 -42
- package/lib/browser/workbench.js +74 -189
- package/package.json +10 -10
- package/public/launch.svg +46 -42
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
import { useInject } from '@celljs/react';
|
|
1
2
|
import { ArrowDown } from 'lucide-react';
|
|
2
3
|
import * as React from 'react';
|
|
3
4
|
import { useKeyboardDismiss } from '../device/device.js';
|
|
5
|
+
import { TaFiles } from '../files/files-protocol.js';
|
|
4
6
|
import { useNotices, useOpenLink, useSessionState, useSettingsServer } from '../hooks.js';
|
|
5
7
|
import { useT } from '../i18n/use-t.js';
|
|
6
8
|
import { MessageUtil } from '../util/message.js';
|
|
7
9
|
import { TerminalText } from '../util/terminal-text.js';
|
|
8
10
|
import { Composer } from './composer.js';
|
|
9
11
|
import { useComposerAddons } from './composer-addons.js';
|
|
10
|
-
import { useAwayFromBottom, useConversationScroll } from './conversation-scroll.js';
|
|
12
|
+
import { SCROLL_SKIP, useAwayFromBottom, useConversationScroll } from './conversation-scroll.js';
|
|
11
13
|
import { DialogView } from './dialog-view.js';
|
|
12
14
|
import { useAsked, useEarlierMessages } from './earlier-messages.js';
|
|
13
15
|
import { OpenLink } from './link.js';
|
|
@@ -94,7 +96,8 @@ export function SessionView({ store, server, workspace, info, onClosed, onActivi
|
|
|
94
96
|
(_a = composer.current) === null || _a === void 0 ? void 0 : _a.setText(draftText);
|
|
95
97
|
}
|
|
96
98
|
}, [draftText]);
|
|
97
|
-
const
|
|
99
|
+
const files = useInject(TaFiles);
|
|
100
|
+
const fileUrl = React.useCallback(async (path) => files.loadable(await workspace.fileUrl(path, cwd)), [workspace, cwd, files]);
|
|
98
101
|
const openLink = useOpenLink(cwd);
|
|
99
102
|
// biome-ignore lint/correctness/useExhaustiveDependencies: runs when a run starts or settles
|
|
100
103
|
React.useEffect(() => onActivity(), [state.working, onActivity]);
|
|
@@ -110,6 +113,7 @@ export function SessionView({ store, server, workspace, info, onClosed, onActivi
|
|
|
110
113
|
const title = (info === null || info === void 0 ? void 0 : info.sessionName) || (info ? MessageUtil.basename(info.cwd) : t('ta.session.title'));
|
|
111
114
|
const conversation = React.useMemo(() => ({ sessionId: store.sessionId, sessionFile: info === null || info === void 0 ? void 0 : info.sessionFile, cwd: info === null || info === void 0 ? void 0 : info.cwd, kind: 'chat', group: info === null || info === void 0 ? void 0 : info.group, title }), [store.sessionId, info === null || info === void 0 ? void 0 : info.sessionFile, info === null || info === void 0 ? void 0 : info.cwd, info === null || info === void 0 ? void 0 : info.group, title]);
|
|
112
115
|
const addons = useComposerAddons(conversation);
|
|
116
|
+
const outbox = React.useMemo(() => ({ resend: id => void store.resend(id), discard: id => store.discard(id) }), [store]);
|
|
113
117
|
return (React.createElement("section", { className: `ta-session ${compact ? 'ta-session-compact' : ''}` },
|
|
114
118
|
!compact && (React.createElement("header", { className: "ta-session-header" },
|
|
115
119
|
leading,
|
|
@@ -119,14 +123,14 @@ export function SessionView({ store, server, workspace, info, onClosed, onActivi
|
|
|
119
123
|
trailing)),
|
|
120
124
|
React.createElement("div", { className: "ta-scroll ta-conversation", ref: scroller },
|
|
121
125
|
React.createElement("div", { className: "ta-thread" },
|
|
122
|
-
state.start > 0 && (React.createElement("div", { className: "ta-earlier", role: "status", "aria-label": t('ta.session.earlier') },
|
|
126
|
+
state.start > 0 && (React.createElement("div", { className: "ta-earlier", role: "status", "aria-label": t('ta.session.earlier'), ...SCROLL_SKIP },
|
|
123
127
|
React.createElement("span", { className: "ta-spinner" }))),
|
|
124
128
|
state.messages.length === 0 && (empty !== null && empty !== void 0 ? empty : React.createElement("div", { className: "ta-empty" }, t('ta.session.empty', { cwd: (_a = info === null || info === void 0 ? void 0 : info.cwd) !== null && _a !== void 0 ? _a : '.' }))),
|
|
125
129
|
React.createElement(ConversationSession.Provider, { value: info },
|
|
126
130
|
React.createElement(MessageActions.Provider, { value: messageActions },
|
|
127
131
|
React.createElement(FileUrls.Provider, { value: fileUrl },
|
|
128
132
|
React.createElement(OpenLink.Provider, { value: openLink },
|
|
129
|
-
React.createElement(MessageList, { state: state }))))))),
|
|
133
|
+
React.createElement(MessageList, { state: state, outbox: outbox }))))))),
|
|
130
134
|
React.createElement("div", { className: "ta-bottom" },
|
|
131
135
|
away && (React.createElement("button", { type: "button", className: "ta-to-bottom", "aria-label": t('ta.session.toBottom'), title: t('ta.session.toBottom'), onClick: toBottom },
|
|
132
136
|
React.createElement(ArrowDown, { size: 18 }))),
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type TaPackageInfo } from '@celljs/ta-protocol';
|
|
2
|
+
import { type LucideIcon } from 'lucide-react';
|
|
3
|
+
import type { MessageId } from '../i18n/messages.js';
|
|
4
|
+
import type { useT } from '../i18n/use-t.js';
|
|
5
|
+
import type { FontSize, LanguageSetting, ThemeSetting } from '../settings/settings-protocol.js';
|
|
6
|
+
import type { Navigation } from './nav-places.js';
|
|
7
|
+
import { type Choice, type RowEntry } from './settings-controls.js';
|
|
8
|
+
export declare const THEMES: Choice<ThemeSetting>[];
|
|
9
|
+
export declare const FONT_SIZES: Choice<FontSize>[];
|
|
10
|
+
export declare const LANGUAGES: Choice<LanguageSetting>[];
|
|
11
|
+
export declare const GROUP_ICONS: Record<string, LucideIcon>;
|
|
12
|
+
/** The keys of the page and of the message box; `Mod` is ⌘ on a Mac, Ctrl elsewhere. */
|
|
13
|
+
export declare const SHORTCUTS: {
|
|
14
|
+
keys: string;
|
|
15
|
+
label: MessageId;
|
|
16
|
+
}[];
|
|
17
|
+
/**
|
|
18
|
+
* The packages pi loads, as the server lists them, those turned off too: the built-in ones turn off and
|
|
19
|
+
* stay; the others turn off and on, and go.
|
|
20
|
+
*/
|
|
21
|
+
export declare function usePackages(): {
|
|
22
|
+
packages: TaPackageInfo[];
|
|
23
|
+
toggle: (pkg: TaPackageInfo, on: boolean) => Promise<void>;
|
|
24
|
+
remove: (pkg: TaPackageInfo) => Promise<void>;
|
|
25
|
+
read: () => Promise<void>;
|
|
26
|
+
};
|
|
27
|
+
export declare const SLOTS: Choice<string>[];
|
|
28
|
+
/** The rows of the navigation: how many pages it shows, and where each page is. */
|
|
29
|
+
export declare function navigationRows(navigation: Navigation, t: ReturnType<typeof useT>): RowEntry[];
|
|
30
|
+
/** How a package shows in a row: what it calls itself for people, else its name and the description of its package.json. */
|
|
31
|
+
export declare function packageLabel(pkg: TaPackageInfo, language: string): {
|
|
32
|
+
title: string;
|
|
33
|
+
summary: string | undefined;
|
|
34
|
+
icon: import("../index.js").WebIcon;
|
|
35
|
+
};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { TaPackageTextUtil } from '@celljs/ta-protocol';
|
|
2
|
+
import { Globe, Layers, MessagesSquare, Monitor, Moon, Puzzle, RefreshCw, Sparkles, Sun, Wrench } from 'lucide-react';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { WEB_ICONS } from '../extension/icons.js';
|
|
5
|
+
import { WebLabelUtil } from '../extension/web-extension-protocol.js';
|
|
6
|
+
import { useWebExtensions, useWorkbench } from '../hooks.js';
|
|
7
|
+
import { NavigationUtil } from '../settings/navigation.js';
|
|
8
|
+
import { Icon } from './icon.js';
|
|
9
|
+
import { EmptyRow, Row, row, Segmented, Switch } from './settings-controls.js';
|
|
10
|
+
export const THEMES = [
|
|
11
|
+
{ value: 'system', icon: Monitor, label: 'ta.settings.theme.system' },
|
|
12
|
+
{ value: 'light', icon: Sun, label: 'ta.settings.theme.light' },
|
|
13
|
+
{ value: 'dark', icon: Moon, label: 'ta.settings.theme.dark' },
|
|
14
|
+
];
|
|
15
|
+
export const FONT_SIZES = [
|
|
16
|
+
{ value: 'small', label: 'ta.settings.fontSize.small' },
|
|
17
|
+
{ value: 'standard', label: 'ta.settings.fontSize.standard' },
|
|
18
|
+
{ value: 'large', label: 'ta.settings.fontSize.large' },
|
|
19
|
+
{ value: 'xlarge', label: 'ta.settings.fontSize.xlarge' },
|
|
20
|
+
];
|
|
21
|
+
export const LANGUAGES = [
|
|
22
|
+
{ value: 'system', icon: Globe, label: 'ta.settings.language.system' },
|
|
23
|
+
{ value: 'zh-CN', label: '简体中文' },
|
|
24
|
+
{ value: 'en-US', label: 'English' },
|
|
25
|
+
];
|
|
26
|
+
export const GROUP_ICONS = { model: Sparkles, conversation: MessagesSquare, context: Layers, tools: Wrench };
|
|
27
|
+
/** The keys of the page and of the message box; `Mod` is ⌘ on a Mac, Ctrl elsewhere. */
|
|
28
|
+
export const SHORTCUTS = [
|
|
29
|
+
{ keys: 'Mod+,', label: 'ta.shortcut.settings' },
|
|
30
|
+
{ keys: 'Mod+B', label: 'ta.shortcut.sidebar' },
|
|
31
|
+
{ keys: 'Enter', label: 'ta.shortcut.send' },
|
|
32
|
+
{ keys: 'Shift+Enter', label: 'ta.shortcut.newline' },
|
|
33
|
+
{ keys: 'Alt+Enter', label: 'ta.shortcut.followUp' },
|
|
34
|
+
{ keys: 'Esc', label: 'ta.shortcut.stop' },
|
|
35
|
+
{ keys: '/', label: 'ta.shortcut.commands' },
|
|
36
|
+
{ keys: '@', label: 'ta.shortcut.files' },
|
|
37
|
+
{ keys: 'Mod+S', label: 'ta.shortcut.save' },
|
|
38
|
+
];
|
|
39
|
+
/**
|
|
40
|
+
* The packages pi loads, as the server lists them, those turned off too: the built-in ones turn off and
|
|
41
|
+
* stay; the others turn off and on, and go.
|
|
42
|
+
*/
|
|
43
|
+
export function usePackages() {
|
|
44
|
+
const [workbench, bench] = useWorkbench();
|
|
45
|
+
const [, host] = useWebExtensions();
|
|
46
|
+
const [packages, setPackages] = React.useState([]);
|
|
47
|
+
const read = React.useCallback(() => bench.packages.listPackages().then(setPackages), [bench]);
|
|
48
|
+
React.useEffect(() => {
|
|
49
|
+
if (workbench.status === 'online') {
|
|
50
|
+
read().catch(() => undefined);
|
|
51
|
+
}
|
|
52
|
+
}, [workbench.status, read]);
|
|
53
|
+
const changed = async () => {
|
|
54
|
+
await host.reloadPackages();
|
|
55
|
+
await read();
|
|
56
|
+
};
|
|
57
|
+
/** By the name of a built-in package, by the id of another. */
|
|
58
|
+
const toggle = async (pkg, on) => {
|
|
59
|
+
setPackages(current => current.map(other => (other.id === pkg.id ? { ...other, enabled: on } : other)));
|
|
60
|
+
await bench.packages.setPackageEnabled(pkg.origin === 'builtin' ? pkg.name : pkg.id, on);
|
|
61
|
+
await changed();
|
|
62
|
+
};
|
|
63
|
+
const remove = async (pkg) => {
|
|
64
|
+
await bench.packages.removePackage(pkg.id);
|
|
65
|
+
await changed();
|
|
66
|
+
};
|
|
67
|
+
return { packages, toggle, remove, read };
|
|
68
|
+
}
|
|
69
|
+
export const SLOTS = Array.from({ length: NavigationUtil.MAX_SLOTS - NavigationUtil.MIN_SLOTS + 1 }, (_, index) => {
|
|
70
|
+
const value = String(NavigationUtil.MIN_SLOTS + index);
|
|
71
|
+
return { value, label: value };
|
|
72
|
+
});
|
|
73
|
+
/** The rows of the navigation: how many pages it shows, and where each page is. */
|
|
74
|
+
export function navigationRows(navigation, t) {
|
|
75
|
+
const { setting } = navigation;
|
|
76
|
+
const where = (id, byDefault) => {
|
|
77
|
+
if (setting.pinned.includes(id) && navigation.nav.some(page => page.id === id)) {
|
|
78
|
+
return t('ta.settings.navigation.pinned');
|
|
79
|
+
}
|
|
80
|
+
if (navigation.nav.some(page => page.id === id)) {
|
|
81
|
+
return t('ta.settings.navigation.inNav');
|
|
82
|
+
}
|
|
83
|
+
return t(setting.discover.includes(id) || byDefault ? 'ta.settings.navigation.folded' : 'ta.settings.navigation.overflow');
|
|
84
|
+
};
|
|
85
|
+
return [
|
|
86
|
+
row('navigation-slots', [t('ta.settings.navigation.slots'), t('ta.settings.navigation.slotsHint'), t('ta.discover')], React.createElement(Row, { label: t('ta.settings.navigation.slots'), description: t('ta.settings.navigation.slotsHint'), stacked: true },
|
|
87
|
+
React.createElement(Segmented, { label: t('ta.settings.navigation.slots'), value: String(setting.slots), choices: SLOTS, onChange: slots => navigation.update({ ...setting, slots: Number(slots) }) }))),
|
|
88
|
+
...navigation.pages.map(page => {
|
|
89
|
+
const title = WebLabelUtil.text(page.title);
|
|
90
|
+
const shown = navigation.nav.includes(page);
|
|
91
|
+
return row(`navigation:${page.id}`, [title, t('ta.settings.navigation')], React.createElement(Row, { label: title, description: where(page.id, page.discover) },
|
|
92
|
+
React.createElement(Switch, { label: `${t('ta.settings.navigation.show')} · ${title}`, checked: shown, onChange: on => (on ? navigation.pin(page.id) : navigation.fold(page.id)) })));
|
|
93
|
+
}),
|
|
94
|
+
...(navigation.pages.length === 0
|
|
95
|
+
? [row('navigation:none', [t('ta.settings.navigation.none')], React.createElement(EmptyRow, { title: t('ta.settings.navigation.none') }))]
|
|
96
|
+
: []),
|
|
97
|
+
...(NavigationUtil.moved(setting)
|
|
98
|
+
? [
|
|
99
|
+
row('navigation-reset', [t('ta.settings.navigation.reset')], React.createElement(Row, { label: t('ta.settings.navigation.reset'), description: t('ta.settings.navigation.resetHint') },
|
|
100
|
+
React.createElement("button", { type: "button", className: "ta-button", onClick: () => navigation.update(NavigationUtil.reset(setting)) },
|
|
101
|
+
React.createElement(Icon, { icon: RefreshCw, size: 14 }),
|
|
102
|
+
" ",
|
|
103
|
+
t('ta.settings.navigation.resetButton')))),
|
|
104
|
+
]
|
|
105
|
+
: []),
|
|
106
|
+
];
|
|
107
|
+
}
|
|
108
|
+
/** How a package shows in a row: what it calls itself for people, else its name and the description of its package.json. */
|
|
109
|
+
export function packageLabel(pkg, language) {
|
|
110
|
+
var _a, _b;
|
|
111
|
+
return {
|
|
112
|
+
title: (_a = TaPackageTextUtil.pick(pkg.title, language)) !== null && _a !== void 0 ? _a : pkg.name,
|
|
113
|
+
summary: (_b = TaPackageTextUtil.pick(pkg.summary, language)) !== null && _b !== void 0 ? _b : pkg.description,
|
|
114
|
+
icon: (pkg.icon && WEB_ICONS[pkg.icon]) || Puzzle,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=settings-choices.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { TaSettingsScope } from '@celljs/ta-protocol';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { type Glyph } from './icon.js';
|
|
4
|
+
import { type RowEntry } from './settings-controls.js';
|
|
5
|
+
export interface SectionEntry {
|
|
6
|
+
id: string;
|
|
7
|
+
title: string;
|
|
8
|
+
icon: Glyph;
|
|
9
|
+
rows: RowEntry[];
|
|
10
|
+
}
|
|
11
|
+
export interface Part {
|
|
12
|
+
id: string;
|
|
13
|
+
title: string;
|
|
14
|
+
sections: SectionEntry[];
|
|
15
|
+
/** Drawn above its sections, whatever the search, and on a phone above each: the scope of the settings of ta. */
|
|
16
|
+
lead?: React.ReactNode;
|
|
17
|
+
}
|
|
18
|
+
/** What a row of the settings opens over them. */
|
|
19
|
+
export type SettingsDialog = 'accounts' | 'directory' | 'relay';
|
|
20
|
+
/** The sections of the page and of ta, by part, with their rows. */
|
|
21
|
+
export declare function useParts(scope: TaSettingsScope, onScope: (scope: TaSettingsScope) => void, onClose: () => void, onDialog: (dialog: SettingsDialog) => void): Part[];
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
import { Blocks, Bot, Cloud, Compass, FolderOpen, Info, Keyboard, KeyRound, Languages, Link2, LogOut, Palette, Puzzle, RefreshCw, Server, ShieldCheck, Smartphone, Trash2, Volume2, Wrench, } from 'lucide-react';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useDevice } from '../device/device.js';
|
|
4
|
+
import { ExtensionBoundary } from '../extension/extension-view.js';
|
|
5
|
+
import { WebLabelUtil } from '../extension/web-extension-protocol.js';
|
|
6
|
+
import { useNotices, useSettings, useSettingsServer, useWebExtensions, useWorkbench } from '../hooks.js';
|
|
7
|
+
import { useLanguage, useT } from '../i18n/use-t.js';
|
|
8
|
+
import { AGENT_SETTINGS_GROUPS, AgentSettingsUtil } from '../settings/agent-settings.js';
|
|
9
|
+
import { MAX_TASKS_CHOICES } from '../settings/settings-protocol.js';
|
|
10
|
+
import { WorkbenchUtil } from '../workbench-util.js';
|
|
11
|
+
import { AccessSettings, useAccess } from './access-view.js';
|
|
12
|
+
import { AgentControl, ScopeBar, useAgentSettings } from './agent-settings-view.js';
|
|
13
|
+
import { useNavigation } from './app-nav.js';
|
|
14
|
+
import { EnvironmentSettings, useGateway } from './environment-view.js';
|
|
15
|
+
import { Icon, IconButton } from './icon.js';
|
|
16
|
+
import { useLaunchRows } from './launch-settings.js';
|
|
17
|
+
import { SettingsModelPicker } from './model-picker.js';
|
|
18
|
+
import { RemoteHosts } from './remote-hosts.js';
|
|
19
|
+
import { EmptyRow, Keys, Row, row, Segmented, Switch } from './settings-controls.js';
|
|
20
|
+
import { TrustedDomains } from './trusted-domains.js';
|
|
21
|
+
import { FONT_SIZES, GROUP_ICONS, LANGUAGES, navigationRows, packageLabel, SHORTCUTS, THEMES, usePackages } from './settings-choices.js';
|
|
22
|
+
/** The sections of the page and of ta, by part, with their rows. */
|
|
23
|
+
export function useParts(scope, onScope, onClose, onDialog) {
|
|
24
|
+
var _a;
|
|
25
|
+
const t = useT();
|
|
26
|
+
const language = useLanguage();
|
|
27
|
+
const [{ settings }, store] = useSettings();
|
|
28
|
+
const settingsServer = useSettingsServer();
|
|
29
|
+
const [workbench, bench] = useWorkbench();
|
|
30
|
+
const [{ extensions, cwd, views, settingsSections }, host] = useWebExtensions();
|
|
31
|
+
const navigation = useNavigation(views);
|
|
32
|
+
const packageList = usePackages();
|
|
33
|
+
const builtinPackages = packageList.packages.filter(pkg => pkg.origin === 'builtin');
|
|
34
|
+
const agent = useAgentSettings(cwd !== null && cwd !== void 0 ? cwd : (_a = workbench.server) === null || _a === void 0 ? void 0 : _a.cwd);
|
|
35
|
+
const [, notices] = useNotices();
|
|
36
|
+
const access = useAccess();
|
|
37
|
+
const gateway = useGateway();
|
|
38
|
+
// As the menu of the account (useAccountEntries): a finger has no keys to learn; a phone is not the computer
|
|
39
|
+
// that pairs phones, and signs out at the foot of Me.
|
|
40
|
+
const touch = useDevice(device => device.touch);
|
|
41
|
+
const handheld = useDevice(device => device.handheld);
|
|
42
|
+
const [busy, setBusy] = React.useState(false);
|
|
43
|
+
const run = (action, done) => {
|
|
44
|
+
setBusy(true);
|
|
45
|
+
action()
|
|
46
|
+
.then(() => done && notices.notify(done, { level: 'success' }))
|
|
47
|
+
.catch(error => notices.error(error))
|
|
48
|
+
.finally(() => setBusy(false));
|
|
49
|
+
};
|
|
50
|
+
const remove = async (pkg) => {
|
|
51
|
+
const confirmed = await notices.confirm({
|
|
52
|
+
title: t('ta.packages.removeConfirm', { name: pkg.name }),
|
|
53
|
+
message: t('ta.packages.removeDetail'),
|
|
54
|
+
confirmLabel: t('ta.packages.remove'),
|
|
55
|
+
danger: true,
|
|
56
|
+
});
|
|
57
|
+
if (confirmed) {
|
|
58
|
+
run(() => packageList.remove(pkg), t('ta.packages.removed', { name: pkg.name }));
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
const toggleBuiltin = (name, on) => {
|
|
62
|
+
store.update({ builtinsOff: on ? settings.builtinsOff.filter(other => other !== name) : [...settings.builtinsOff, name] });
|
|
63
|
+
run(() => host.refresh());
|
|
64
|
+
};
|
|
65
|
+
const web = [
|
|
66
|
+
{
|
|
67
|
+
id: 'appearance',
|
|
68
|
+
title: t('ta.settings.appearance'),
|
|
69
|
+
icon: Palette,
|
|
70
|
+
rows: [
|
|
71
|
+
row('theme', [t('ta.settings.theme'), 'theme'], React.createElement(Row, { label: t('ta.settings.theme'), stacked: true },
|
|
72
|
+
React.createElement(Segmented, { label: t('ta.settings.theme'), value: settings.theme, choices: THEMES, onChange: theme => store.update({ theme }) }))),
|
|
73
|
+
row('font-size', [t('ta.settings.fontSize'), t('ta.settings.fontSizeHint'), 'font'], React.createElement(Row, { label: t('ta.settings.fontSize'), description: t('ta.settings.fontSizeHint'), stacked: true },
|
|
74
|
+
React.createElement(Segmented, { label: t('ta.settings.fontSize'), value: settings.fontSize, choices: FONT_SIZES, onChange: fontSize => store.update({ fontSize }) }))),
|
|
75
|
+
row('chat-font-size', [t('ta.settings.chatFontSize'), t('ta.settings.chatFontSizeHint'), 'font'], React.createElement(Row, { label: t('ta.settings.chatFontSize'), description: t('ta.settings.chatFontSizeHint'), stacked: true },
|
|
76
|
+
React.createElement(Segmented, { label: t('ta.settings.chatFontSize'), value: settings.chatFontSize, choices: FONT_SIZES, onChange: chatFontSize => store.update({ chatFontSize }) }))),
|
|
77
|
+
row('motion', [t('ta.settings.motion'), t('ta.settings.motionHint')], React.createElement(Row, { label: t('ta.settings.motion'), description: t('ta.settings.motionHint') },
|
|
78
|
+
React.createElement(Switch, { label: t('ta.settings.motion'), checked: settings.reduceMotion, onChange: reduceMotion => store.update({ reduceMotion }) }))),
|
|
79
|
+
],
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
id: 'language',
|
|
83
|
+
title: t('ta.settings.language'),
|
|
84
|
+
icon: Languages,
|
|
85
|
+
rows: [
|
|
86
|
+
row('language', [t('ta.settings.displayLanguage'), 'language'], React.createElement(Row, { label: t('ta.settings.displayLanguage'), stacked: true },
|
|
87
|
+
React.createElement(Segmented, { label: t('ta.settings.displayLanguage'), value: settings.language, choices: LANGUAGES, onChange: language => store.update({ language }) }))),
|
|
88
|
+
],
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
id: 'navigation',
|
|
92
|
+
title: t('ta.settings.navigation'),
|
|
93
|
+
icon: Compass,
|
|
94
|
+
rows: navigationRows(navigation, t),
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
id: 'links',
|
|
98
|
+
title: t('ta.settings.links'),
|
|
99
|
+
icon: Link2,
|
|
100
|
+
rows: [
|
|
101
|
+
row('trusted-domains', [t('ta.settings.trustedDomains'), t('ta.settings.trustedDomainsHint'), ...settings.trustedDomains], React.createElement(TrustedDomains, null)),
|
|
102
|
+
],
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
id: 'assistant',
|
|
106
|
+
title: t('ta.settings.assistant'),
|
|
107
|
+
icon: Bot,
|
|
108
|
+
rows: [
|
|
109
|
+
row('assistant-model', [t('ta.settings.assistantModel'), t('ta.settings.assistantModelHint')], React.createElement(Row, { label: t('ta.settings.assistantModel'), description: t('ta.settings.assistantModelHint'), stacked: true },
|
|
110
|
+
React.createElement(SettingsModelPicker, { settings: settingsServer, label: t('ta.settings.assistantModel'), value: settings.assistantModel, onChange: assistantModel => store.update({ assistantModel }) }))),
|
|
111
|
+
row('task-model', [t('ta.settings.taskModel'), t('ta.settings.taskModelHint')], React.createElement(Row, { label: t('ta.settings.taskModel'), description: t('ta.settings.taskModelHint'), stacked: true },
|
|
112
|
+
React.createElement(SettingsModelPicker, { settings: settingsServer, label: t('ta.settings.taskModel'), value: settings.taskModel, onChange: taskModel => store.update({ taskModel }) }))),
|
|
113
|
+
row('confirm-tasks', [t('ta.settings.confirmTasks'), t('ta.settings.confirmTasksHint')], React.createElement(Row, { label: t('ta.settings.confirmTasks'), description: t('ta.settings.confirmTasksHint') },
|
|
114
|
+
React.createElement(Switch, { label: t('ta.settings.confirmTasks'), checked: settings.confirmTasks, onChange: confirmTasks => store.update({ confirmTasks }) }))),
|
|
115
|
+
row('max-tasks', [t('ta.settings.maxTasks'), t('ta.settings.maxTasksHint')], React.createElement(Row, { label: t('ta.settings.maxTasks'), description: t('ta.settings.maxTasksHint'), stacked: true },
|
|
116
|
+
React.createElement(Segmented, { label: t('ta.settings.maxTasks'), value: String(settings.maxTasks), choices: MAX_TASKS_CHOICES.map(count => ({
|
|
117
|
+
value: String(count),
|
|
118
|
+
label: count === 0 ? t('ta.settings.maxTasksAny') : String(count),
|
|
119
|
+
})), onChange: value => store.update({ maxTasks: Number(value) }) }))),
|
|
120
|
+
],
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
id: 'voice',
|
|
124
|
+
title: t('ta.settings.voice'),
|
|
125
|
+
icon: Volume2,
|
|
126
|
+
rows: [
|
|
127
|
+
row('speak', [t('ta.settings.speak'), t('ta.settings.speakHint')], React.createElement(Row, { label: t('ta.settings.speak'), description: t('ta.settings.speakHint') },
|
|
128
|
+
React.createElement(Switch, { label: t('ta.settings.speak'), checked: settings.speak, onChange: speak => store.update({ speak }) }))),
|
|
129
|
+
row('speakTalk', [t('ta.settings.speakTalk'), t('ta.settings.speakTalkHint')], React.createElement(Row, { label: t('ta.settings.speakTalk'), description: t('ta.settings.speakTalkHint') },
|
|
130
|
+
React.createElement(Switch, { label: t('ta.settings.speakTalk'), checked: settings.speakTalk, onChange: speakTalk => store.update({ speakTalk }) }))),
|
|
131
|
+
],
|
|
132
|
+
},
|
|
133
|
+
];
|
|
134
|
+
const { snapshot } = agent;
|
|
135
|
+
const locked = !!snapshot && scope === 'project' && !snapshot.projectTrusted;
|
|
136
|
+
const lead = (React.createElement(React.Fragment, null,
|
|
137
|
+
React.createElement(ScopeBar, { scope: scope, onScope: onScope, snapshot: snapshot }),
|
|
138
|
+
agent.offline && React.createElement("div", { className: "ta-settings-note" }, t('ta.settings.offline')),
|
|
139
|
+
!agent.offline && !snapshot && !agent.error && React.createElement("div", { className: "ta-settings-note" }, t('ta.settings.loading')),
|
|
140
|
+
locked && React.createElement("div", { className: "ta-settings-note" }, t('ta.settings.untrusted')),
|
|
141
|
+
agent.error && React.createElement("div", { className: "ta-banner ta-banner-error" }, t('ta.settings.failed', { error: agent.error }))));
|
|
142
|
+
const ta = AGENT_SETTINGS_GROUPS.map(group => { var _a; return ({
|
|
143
|
+
id: group.id,
|
|
144
|
+
title: t(group.title),
|
|
145
|
+
icon: (_a = GROUP_ICONS[group.id]) !== null && _a !== void 0 ? _a : Wrench,
|
|
146
|
+
rows: snapshot
|
|
147
|
+
? group.keys.flatMap(key => {
|
|
148
|
+
const spec = AgentSettingsUtil.spec(key);
|
|
149
|
+
if (!spec) {
|
|
150
|
+
return [];
|
|
151
|
+
}
|
|
152
|
+
const label = t(AgentSettingsUtil.label(key));
|
|
153
|
+
const hint = AgentSettingsUtil.hint(key);
|
|
154
|
+
return [
|
|
155
|
+
row(key, [label, hint && t(hint), key], React.createElement(Row, { label: label, description: hint && t(hint), modified: snapshot[scope][key] !== undefined },
|
|
156
|
+
React.createElement(AgentControl, { spec: spec, scope: scope, snapshot: snapshot, disabled: locked, onChange: changes => agent.update(scope, changes) }))),
|
|
157
|
+
];
|
|
158
|
+
})
|
|
159
|
+
: [],
|
|
160
|
+
}); });
|
|
161
|
+
// Those opened without installing are in Quick open, which installs or deletes them (ta-launcher.md).
|
|
162
|
+
const packages = packageList.packages.filter(pkg => pkg.origin !== 'builtin' && pkg.origin !== 'temporary');
|
|
163
|
+
const launchRows = useLaunchRows();
|
|
164
|
+
/** Why the web extension of a package did not load, if it did not. */
|
|
165
|
+
const failure = (pkg) => { var _a; return (_a = extensions.find(extension => { var _a; return ((_a = extension.info) === null || _a === void 0 ? void 0 : _a.source) === pkg.source && extension.error; })) === null || _a === void 0 ? void 0 : _a.error; };
|
|
166
|
+
const reload = async () => {
|
|
167
|
+
await host.refresh();
|
|
168
|
+
await packageList.read();
|
|
169
|
+
};
|
|
170
|
+
const more = [
|
|
171
|
+
{
|
|
172
|
+
id: 'packages',
|
|
173
|
+
title: t('ta.packages'),
|
|
174
|
+
icon: Puzzle,
|
|
175
|
+
rows: [
|
|
176
|
+
row('packages', [t('ta.packages'), t('ta.packages.hint')], React.createElement(Row, { label: t('ta.packages.installed'), description: t('ta.packages.hint') },
|
|
177
|
+
React.createElement("button", { type: "button", className: "ta-button", disabled: busy, onClick: () => run(reload, t('ta.packages.reloaded')) },
|
|
178
|
+
React.createElement(Icon, { icon: RefreshCw, size: 14 }),
|
|
179
|
+
" ",
|
|
180
|
+
t('ta.packages.reload')))),
|
|
181
|
+
...packages.map(pkg => {
|
|
182
|
+
const error = failure(pkg);
|
|
183
|
+
const { title, summary, icon } = packageLabel(pkg, language);
|
|
184
|
+
return row(`package:${pkg.id}`, [title, summary, pkg.name, t('ta.packages')], React.createElement(Row, { icon: icon, label: title, description: error
|
|
185
|
+
? t('ta.packages.failed', { error })
|
|
186
|
+
: [summary, t(pkg.scope === 'project' ? 'ta.packages.scope.project' : 'ta.packages.scope.user')].filter(Boolean).join(' · ') },
|
|
187
|
+
React.createElement(IconButton, { icon: Trash2, label: t('ta.packages.remove'), disabled: busy, onClick: () => void remove(pkg) }),
|
|
188
|
+
React.createElement(Switch, { label: title, checked: pkg.enabled, disabled: busy, onChange: on => run(() => packageList.toggle(pkg, on)) })));
|
|
189
|
+
}),
|
|
190
|
+
...(packages.length === 0
|
|
191
|
+
? [row('packages:none', [t('ta.packages.none')], React.createElement(EmptyRow, { title: t('ta.packages.none'), hint: t('ta.packages.noneHint') }))]
|
|
192
|
+
: []),
|
|
193
|
+
...launchRows,
|
|
194
|
+
],
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
id: 'builtin',
|
|
198
|
+
title: t('ta.packages.builtinTitle'),
|
|
199
|
+
icon: Blocks,
|
|
200
|
+
rows: [
|
|
201
|
+
...host.builtins.map(builtin => { var _a; return row(`web:${builtin.name}`, [t(builtin.title), t(builtin.description), t('ta.packages.builtinTitle')], React.createElement(Row, { icon: (_a = builtin.icon) !== null && _a !== void 0 ? _a : Puzzle, label: t(builtin.title), description: t(builtin.description) },
|
|
202
|
+
React.createElement(Switch, { label: t(builtin.title), checked: !settings.builtinsOff.includes(builtin.name), onChange: on => toggleBuiltin(builtin.name, on) }))); }),
|
|
203
|
+
...builtinPackages.map(info => {
|
|
204
|
+
const { title, summary, icon } = packageLabel(info, language);
|
|
205
|
+
return row(`builtin:${info.name}`, [title, summary, info.name, t('ta.packages.builtinTitle')], React.createElement(Row, { icon: icon, label: title, description: summary },
|
|
206
|
+
React.createElement(Switch, { label: title, checked: info.enabled, onChange: on => run(() => packageList.toggle(info, on)) })));
|
|
207
|
+
}),
|
|
208
|
+
],
|
|
209
|
+
},
|
|
210
|
+
...settingsSections.map(extensionSection),
|
|
211
|
+
// Behind a gateway only: where the Ta of this account runs.
|
|
212
|
+
...(gateway.info
|
|
213
|
+
? [
|
|
214
|
+
{
|
|
215
|
+
id: 'environment',
|
|
216
|
+
title: t('ta.environment.title'),
|
|
217
|
+
icon: Cloud,
|
|
218
|
+
rows: [
|
|
219
|
+
row('environment', [t('ta.environment.title'), t('ta.environment.whereHint'), 'sandbox', 'docker'], React.createElement(EnvironmentSettings, { info: gateway.info, onChange: gateway.read })),
|
|
220
|
+
],
|
|
221
|
+
},
|
|
222
|
+
]
|
|
223
|
+
: []),
|
|
224
|
+
// Only where accounts can sign in, or could: a Ta of this computer has no need of it.
|
|
225
|
+
...(access.info && (access.info.providers.length > 0 || access.info.accounts.length > 0)
|
|
226
|
+
? [
|
|
227
|
+
{
|
|
228
|
+
id: 'access',
|
|
229
|
+
title: t('ta.access.title'),
|
|
230
|
+
icon: ShieldCheck,
|
|
231
|
+
rows: [
|
|
232
|
+
row('access', [t('ta.access.title'), t('ta.access.addHint'), 'github', 'google', 'wechat'], React.createElement(AccessSettings, { info: access.info, onChange: access.read })),
|
|
233
|
+
],
|
|
234
|
+
},
|
|
235
|
+
]
|
|
236
|
+
: []),
|
|
237
|
+
{
|
|
238
|
+
id: 'remote',
|
|
239
|
+
title: t('ta.remote.title'),
|
|
240
|
+
icon: Server,
|
|
241
|
+
rows: [row('remote', [t('ta.remote.title'), t('ta.remote.description'), 'ssh'], React.createElement(RemoteHosts, null))],
|
|
242
|
+
},
|
|
243
|
+
...(touch
|
|
244
|
+
? []
|
|
245
|
+
: [
|
|
246
|
+
{
|
|
247
|
+
id: 'shortcuts',
|
|
248
|
+
title: t('ta.settings.shortcuts'),
|
|
249
|
+
icon: Keyboard,
|
|
250
|
+
rows: SHORTCUTS.map(shortcut => row(`key:${shortcut.keys}`, [t(shortcut.label), shortcut.keys, t('ta.settings.shortcuts')], React.createElement(Row, { label: t(shortcut.label) },
|
|
251
|
+
React.createElement(Keys, { keys: shortcut.keys })))),
|
|
252
|
+
},
|
|
253
|
+
]),
|
|
254
|
+
{
|
|
255
|
+
id: 'about',
|
|
256
|
+
title: t('ta.settings.about'),
|
|
257
|
+
icon: Info,
|
|
258
|
+
rows: workbench.server
|
|
259
|
+
? [
|
|
260
|
+
row('version', [t('ta.settings.version'), 'version'], React.createElement(Row, { label: t('ta.settings.version') },
|
|
261
|
+
React.createElement("span", { className: "ta-path" },
|
|
262
|
+
"v",
|
|
263
|
+
workbench.server.version))),
|
|
264
|
+
row('cwd', [t('ta.settings.cwd'), workbench.server.cwd], React.createElement(Row, { label: t('ta.settings.cwd'), description: t('ta.settings.cwdDescription', { path: workbench.server.cwd }) },
|
|
265
|
+
React.createElement("button", { type: "button", className: "ta-button", onClick: () => onDialog('directory') },
|
|
266
|
+
React.createElement(Icon, { icon: FolderOpen, size: 15 }),
|
|
267
|
+
" ",
|
|
268
|
+
t('ta.settings.cwdChange')))),
|
|
269
|
+
row('accounts', [t('ta.settings.accounts'), t('ta.settings.accountsDescription')], React.createElement(Row, { label: t('ta.settings.accounts'), description: t('ta.settings.accountsDescription') },
|
|
270
|
+
React.createElement("button", { type: "button", className: "ta-button", onClick: () => onDialog('accounts') },
|
|
271
|
+
React.createElement(Icon, { icon: KeyRound, size: 15 }),
|
|
272
|
+
" ",
|
|
273
|
+
t('ta.settings.manageAccounts')))),
|
|
274
|
+
...(WorkbenchUtil.isApp() || handheld
|
|
275
|
+
? []
|
|
276
|
+
: [
|
|
277
|
+
row('relay', [t('ta.settings.relay'), t('ta.settings.relayDescription')], React.createElement(Row, { label: t('ta.settings.relay'), description: t('ta.settings.relayDescription') },
|
|
278
|
+
React.createElement("button", { type: "button", className: "ta-button", onClick: () => onDialog('relay') },
|
|
279
|
+
React.createElement(Icon, { icon: Smartphone, size: 15 }),
|
|
280
|
+
" ",
|
|
281
|
+
t('ta.settings.manageAccounts')))),
|
|
282
|
+
]),
|
|
283
|
+
...(handheld
|
|
284
|
+
? []
|
|
285
|
+
: [
|
|
286
|
+
row('signOut', [t('ta.settings.signOut')], React.createElement(Row, { label: t('ta.settings.signOut') },
|
|
287
|
+
React.createElement("button", { type: "button", className: "ta-button ta-danger", onClick: () => {
|
|
288
|
+
onClose();
|
|
289
|
+
bench.signOut();
|
|
290
|
+
} },
|
|
291
|
+
React.createElement(Icon, { icon: LogOut, size: 15 }),
|
|
292
|
+
" ",
|
|
293
|
+
t('ta.settings.signOut')))),
|
|
294
|
+
]),
|
|
295
|
+
]
|
|
296
|
+
: [],
|
|
297
|
+
},
|
|
298
|
+
];
|
|
299
|
+
return [
|
|
300
|
+
{ id: 'web', title: t('ta.settings.web'), sections: web },
|
|
301
|
+
{ id: 'agent', title: t('ta.settings.agent'), sections: ta, lead },
|
|
302
|
+
{ id: 'more', title: t('ta.settings.more'), sections: more },
|
|
303
|
+
];
|
|
304
|
+
}
|
|
305
|
+
/** A section an extension added (WebExtensionAPI.registerSettings): its rows as Ta's, each control in a boundary of its own. */
|
|
306
|
+
function extensionSection({ id, section }) {
|
|
307
|
+
var _a;
|
|
308
|
+
const title = WebLabelUtil.text(section.title);
|
|
309
|
+
return {
|
|
310
|
+
id: `extension-${id.replace(/[^\w-]+/g, '-')}`,
|
|
311
|
+
title,
|
|
312
|
+
icon: (_a = section.icon) !== null && _a !== void 0 ? _a : Puzzle,
|
|
313
|
+
rows: section.rows.map(item => {
|
|
314
|
+
const label = WebLabelUtil.text(item.label);
|
|
315
|
+
const description = item.description === undefined ? undefined : WebLabelUtil.text(item.description);
|
|
316
|
+
const Control = item.render;
|
|
317
|
+
return row(`${id}/${item.key}`, [label, description, title], React.createElement(Row, { label: label, description: description, stacked: item.stacked },
|
|
318
|
+
React.createElement(ExtensionBoundary, { name: title, resetKey: Control },
|
|
319
|
+
React.createElement(Control, null))));
|
|
320
|
+
}),
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
//# sourceMappingURL=settings-parts.js.map
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { MessageId } from '../i18n/messages.js';
|
|
3
2
|
/** A section of the settings view: `appearance`, `model`, `packages`, ... */
|
|
4
3
|
export type SettingsSection = string;
|
|
5
|
-
/** The keys of the page and of the message box; `Mod` is ⌘ on a Mac, Ctrl elsewhere. */
|
|
6
|
-
export declare const SHORTCUTS: {
|
|
7
|
-
keys: string;
|
|
8
|
-
label: MessageId;
|
|
9
|
-
}[];
|
|
10
4
|
export interface SettingsViewProps {
|
|
11
5
|
/** The section to show first. */
|
|
12
6
|
section?: SettingsSection;
|