@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,418 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Blocks, Bot, ChevronLeft, Cloud, Compass, FolderOpen, Globe, Info, Keyboard, KeyRound, Languages, Layers, Link2, LogOut, Menu, MessagesSquare, Monitor, Moon, Palette, Puzzle, RefreshCw, Search, Server, ShieldCheck, Smartphone, Sparkles, Sun, Trash2, Volume2, Wrench, X, } from 'lucide-react';
|
|
1
|
+
import { ChevronLeft, Menu, Search, X } from 'lucide-react';
|
|
3
2
|
import * as React from 'react';
|
|
4
3
|
import { useDevice } from '../device/device.js';
|
|
5
|
-
import {
|
|
6
|
-
import { WebLabelUtil } from '../extension/web-extension-protocol.js';
|
|
7
|
-
import { useNotices, useSettings, useSettingsServer, useWebExtensions, useWorkbench } from '../hooks.js';
|
|
8
|
-
import { useLanguage, useT } from '../i18n/use-t.js';
|
|
9
|
-
import { AGENT_SETTINGS_GROUPS, AgentSettingsUtil } from '../settings/agent-settings.js';
|
|
10
|
-
import { NavigationUtil } from '../settings/navigation.js';
|
|
11
|
-
import { MAX_TASKS_CHOICES } from '../settings/settings-protocol.js';
|
|
12
|
-
import { WorkbenchUtil } from '../workbench.js';
|
|
13
|
-
import { AccessSettings, useAccess } from './access-view.js';
|
|
14
|
-
import { AgentControl, ScopeBar, useAgentSettings } from './agent-settings-view.js';
|
|
15
|
-
import { useNavigation } from './app-nav.js';
|
|
4
|
+
import { useT } from '../i18n/use-t.js';
|
|
16
5
|
import { AuthDialog } from './auth-view.js';
|
|
17
6
|
import { EmptyState } from './empty-state.js';
|
|
18
|
-
import { EnvironmentSettings, useGateway } from './environment-view.js';
|
|
19
7
|
import { Icon, IconButton } from './icon.js';
|
|
20
|
-
import { useLaunchRows } from './launch-settings.js';
|
|
21
8
|
import { ListGroup, ListRow } from './list-rows.js';
|
|
22
|
-
import { SettingsModelPicker } from './model-picker.js';
|
|
23
9
|
import { PhoneStack } from './phone-shell.js';
|
|
24
10
|
import { RelayDialog } from './relay-view.js';
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import { TrustedDomains } from './trusted-domains.js';
|
|
11
|
+
import { SettingsViewUtil } from './settings-controls.js';
|
|
12
|
+
import { useParts } from './settings-parts.js';
|
|
28
13
|
import { WorkingDirectoryPicker } from './working-directory.js';
|
|
29
|
-
const THEMES = [
|
|
30
|
-
{ value: 'system', icon: Monitor, label: 'ta.settings.theme.system' },
|
|
31
|
-
{ value: 'light', icon: Sun, label: 'ta.settings.theme.light' },
|
|
32
|
-
{ value: 'dark', icon: Moon, label: 'ta.settings.theme.dark' },
|
|
33
|
-
];
|
|
34
|
-
const FONT_SIZES = [
|
|
35
|
-
{ value: 'small', label: 'ta.settings.fontSize.small' },
|
|
36
|
-
{ value: 'standard', label: 'ta.settings.fontSize.standard' },
|
|
37
|
-
{ value: 'large', label: 'ta.settings.fontSize.large' },
|
|
38
|
-
{ value: 'xlarge', label: 'ta.settings.fontSize.xlarge' },
|
|
39
|
-
];
|
|
40
|
-
const LANGUAGES = [
|
|
41
|
-
{ value: 'system', icon: Globe, label: 'ta.settings.language.system' },
|
|
42
|
-
{ value: 'zh-CN', label: '简体中文' },
|
|
43
|
-
{ value: 'en-US', label: 'English' },
|
|
44
|
-
];
|
|
45
|
-
const GROUP_ICONS = { model: Sparkles, conversation: MessagesSquare, context: Layers, tools: Wrench };
|
|
46
|
-
/** The keys of the page and of the message box; `Mod` is ⌘ on a Mac, Ctrl elsewhere. */
|
|
47
|
-
export const SHORTCUTS = [
|
|
48
|
-
{ keys: 'Mod+,', label: 'ta.shortcut.settings' },
|
|
49
|
-
{ keys: 'Mod+B', label: 'ta.shortcut.sidebar' },
|
|
50
|
-
{ keys: 'Enter', label: 'ta.shortcut.send' },
|
|
51
|
-
{ keys: 'Shift+Enter', label: 'ta.shortcut.newline' },
|
|
52
|
-
{ keys: 'Alt+Enter', label: 'ta.shortcut.followUp' },
|
|
53
|
-
{ keys: 'Esc', label: 'ta.shortcut.stop' },
|
|
54
|
-
{ keys: '/', label: 'ta.shortcut.commands' },
|
|
55
|
-
{ keys: '@', label: 'ta.shortcut.files' },
|
|
56
|
-
{ keys: 'Mod+S', label: 'ta.shortcut.save' },
|
|
57
|
-
];
|
|
58
|
-
/**
|
|
59
|
-
* The packages pi loads, as the server lists them, those turned off too: the built-in ones turn off and
|
|
60
|
-
* stay; the others turn off and on, and go.
|
|
61
|
-
*/
|
|
62
|
-
function usePackages() {
|
|
63
|
-
const [workbench, bench] = useWorkbench();
|
|
64
|
-
const [, host] = useWebExtensions();
|
|
65
|
-
const [packages, setPackages] = React.useState([]);
|
|
66
|
-
const read = React.useCallback(() => bench.packages.listPackages().then(setPackages), [bench]);
|
|
67
|
-
React.useEffect(() => {
|
|
68
|
-
if (workbench.status === 'online') {
|
|
69
|
-
read().catch(() => undefined);
|
|
70
|
-
}
|
|
71
|
-
}, [workbench.status, read]);
|
|
72
|
-
const changed = async () => {
|
|
73
|
-
await host.reloadPackages();
|
|
74
|
-
await read();
|
|
75
|
-
};
|
|
76
|
-
/** By the name of a built-in package, by the id of another. */
|
|
77
|
-
const toggle = async (pkg, on) => {
|
|
78
|
-
setPackages(current => current.map(other => (other.id === pkg.id ? { ...other, enabled: on } : other)));
|
|
79
|
-
await bench.packages.setPackageEnabled(pkg.origin === 'builtin' ? pkg.name : pkg.id, on);
|
|
80
|
-
await changed();
|
|
81
|
-
};
|
|
82
|
-
const remove = async (pkg) => {
|
|
83
|
-
await bench.packages.removePackage(pkg.id);
|
|
84
|
-
await changed();
|
|
85
|
-
};
|
|
86
|
-
return { packages, toggle, remove, read };
|
|
87
|
-
}
|
|
88
|
-
const SLOTS = Array.from({ length: NavigationUtil.MAX_SLOTS - NavigationUtil.MIN_SLOTS + 1 }, (_, index) => {
|
|
89
|
-
const value = String(NavigationUtil.MIN_SLOTS + index);
|
|
90
|
-
return { value, label: value };
|
|
91
|
-
});
|
|
92
|
-
/** The rows of the navigation: how many pages it shows, and where each page is. */
|
|
93
|
-
function navigationRows(navigation, t) {
|
|
94
|
-
const { setting } = navigation;
|
|
95
|
-
const where = (id, byDefault) => {
|
|
96
|
-
if (setting.pinned.includes(id) && navigation.nav.some(page => page.id === id)) {
|
|
97
|
-
return t('ta.settings.navigation.pinned');
|
|
98
|
-
}
|
|
99
|
-
if (navigation.nav.some(page => page.id === id)) {
|
|
100
|
-
return t('ta.settings.navigation.inNav');
|
|
101
|
-
}
|
|
102
|
-
return t(setting.discover.includes(id) || byDefault ? 'ta.settings.navigation.folded' : 'ta.settings.navigation.overflow');
|
|
103
|
-
};
|
|
104
|
-
return [
|
|
105
|
-
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 },
|
|
106
|
-
React.createElement(Segmented, { label: t('ta.settings.navigation.slots'), value: String(setting.slots), choices: SLOTS, onChange: slots => navigation.update({ ...setting, slots: Number(slots) }) }))),
|
|
107
|
-
...navigation.pages.map(page => {
|
|
108
|
-
const title = WebLabelUtil.text(page.title);
|
|
109
|
-
const shown = navigation.nav.includes(page);
|
|
110
|
-
return row(`navigation:${page.id}`, [title, t('ta.settings.navigation')], React.createElement(Row, { label: title, description: where(page.id, page.discover) },
|
|
111
|
-
React.createElement(Switch, { label: `${t('ta.settings.navigation.show')} · ${title}`, checked: shown, onChange: on => (on ? navigation.pin(page.id) : navigation.fold(page.id)) })));
|
|
112
|
-
}),
|
|
113
|
-
...(navigation.pages.length === 0
|
|
114
|
-
? [row('navigation:none', [t('ta.settings.navigation.none')], React.createElement(EmptyRow, { title: t('ta.settings.navigation.none') }))]
|
|
115
|
-
: []),
|
|
116
|
-
...(NavigationUtil.moved(setting)
|
|
117
|
-
? [
|
|
118
|
-
row('navigation-reset', [t('ta.settings.navigation.reset')], React.createElement(Row, { label: t('ta.settings.navigation.reset'), description: t('ta.settings.navigation.resetHint') },
|
|
119
|
-
React.createElement("button", { type: "button", className: "ta-button", onClick: () => navigation.update(NavigationUtil.reset(setting)) },
|
|
120
|
-
React.createElement(Icon, { icon: RefreshCw, size: 14 }),
|
|
121
|
-
" ",
|
|
122
|
-
t('ta.settings.navigation.resetButton')))),
|
|
123
|
-
]
|
|
124
|
-
: []),
|
|
125
|
-
];
|
|
126
|
-
}
|
|
127
|
-
/** How a package shows in a row: what it calls itself for people, else its name and the description of its package.json. */
|
|
128
|
-
function packageLabel(pkg, language) {
|
|
129
|
-
var _a, _b;
|
|
130
|
-
return {
|
|
131
|
-
title: (_a = TaPackageTextUtil.pick(pkg.title, language)) !== null && _a !== void 0 ? _a : pkg.name,
|
|
132
|
-
summary: (_b = TaPackageTextUtil.pick(pkg.summary, language)) !== null && _b !== void 0 ? _b : pkg.description,
|
|
133
|
-
icon: (pkg.icon && WEB_ICONS[pkg.icon]) || Puzzle,
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
/** The sections of the page and of ta, by part, with their rows. */
|
|
137
|
-
function useParts(scope, onScope, onClose, onDialog) {
|
|
138
|
-
var _a;
|
|
139
|
-
const t = useT();
|
|
140
|
-
const language = useLanguage();
|
|
141
|
-
const [{ settings }, store] = useSettings();
|
|
142
|
-
const settingsServer = useSettingsServer();
|
|
143
|
-
const [workbench, bench] = useWorkbench();
|
|
144
|
-
const [{ extensions, cwd, views }, host] = useWebExtensions();
|
|
145
|
-
const navigation = useNavigation(views);
|
|
146
|
-
const packageList = usePackages();
|
|
147
|
-
const builtinPackages = packageList.packages.filter(pkg => pkg.origin === 'builtin');
|
|
148
|
-
const agent = useAgentSettings(cwd !== null && cwd !== void 0 ? cwd : (_a = workbench.server) === null || _a === void 0 ? void 0 : _a.cwd);
|
|
149
|
-
const [, notices] = useNotices();
|
|
150
|
-
const access = useAccess();
|
|
151
|
-
const gateway = useGateway();
|
|
152
|
-
// As the menu of the account (useAccountEntries): a finger has no keys to learn; a phone is not the computer
|
|
153
|
-
// that pairs phones, and signs out at the foot of Me.
|
|
154
|
-
const touch = useDevice(device => device.touch);
|
|
155
|
-
const handheld = useDevice(device => device.handheld);
|
|
156
|
-
const [busy, setBusy] = React.useState(false);
|
|
157
|
-
const run = (action, done) => {
|
|
158
|
-
setBusy(true);
|
|
159
|
-
action()
|
|
160
|
-
.then(() => done && notices.notify(done, { level: 'success' }))
|
|
161
|
-
.catch(error => notices.error(error))
|
|
162
|
-
.finally(() => setBusy(false));
|
|
163
|
-
};
|
|
164
|
-
const remove = async (pkg) => {
|
|
165
|
-
const confirmed = await notices.confirm({
|
|
166
|
-
title: t('ta.packages.removeConfirm', { name: pkg.name }),
|
|
167
|
-
message: t('ta.packages.removeDetail'),
|
|
168
|
-
confirmLabel: t('ta.packages.remove'),
|
|
169
|
-
danger: true,
|
|
170
|
-
});
|
|
171
|
-
if (confirmed) {
|
|
172
|
-
run(() => packageList.remove(pkg), t('ta.packages.removed', { name: pkg.name }));
|
|
173
|
-
}
|
|
174
|
-
};
|
|
175
|
-
const toggleBuiltin = (name, on) => {
|
|
176
|
-
store.update({ builtinsOff: on ? settings.builtinsOff.filter(other => other !== name) : [...settings.builtinsOff, name] });
|
|
177
|
-
run(() => host.refresh());
|
|
178
|
-
};
|
|
179
|
-
const web = [
|
|
180
|
-
{
|
|
181
|
-
id: 'appearance',
|
|
182
|
-
title: t('ta.settings.appearance'),
|
|
183
|
-
icon: Palette,
|
|
184
|
-
rows: [
|
|
185
|
-
row('theme', [t('ta.settings.theme'), 'theme'], React.createElement(Row, { label: t('ta.settings.theme'), stacked: true },
|
|
186
|
-
React.createElement(Segmented, { label: t('ta.settings.theme'), value: settings.theme, choices: THEMES, onChange: theme => store.update({ theme }) }))),
|
|
187
|
-
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 },
|
|
188
|
-
React.createElement(Segmented, { label: t('ta.settings.fontSize'), value: settings.fontSize, choices: FONT_SIZES, onChange: fontSize => store.update({ fontSize }) }))),
|
|
189
|
-
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 },
|
|
190
|
-
React.createElement(Segmented, { label: t('ta.settings.chatFontSize'), value: settings.chatFontSize, choices: FONT_SIZES, onChange: chatFontSize => store.update({ chatFontSize }) }))),
|
|
191
|
-
row('motion', [t('ta.settings.motion'), t('ta.settings.motionHint')], React.createElement(Row, { label: t('ta.settings.motion'), description: t('ta.settings.motionHint') },
|
|
192
|
-
React.createElement(Switch, { label: t('ta.settings.motion'), checked: settings.reduceMotion, onChange: reduceMotion => store.update({ reduceMotion }) }))),
|
|
193
|
-
],
|
|
194
|
-
},
|
|
195
|
-
{
|
|
196
|
-
id: 'language',
|
|
197
|
-
title: t('ta.settings.language'),
|
|
198
|
-
icon: Languages,
|
|
199
|
-
rows: [
|
|
200
|
-
row('language', [t('ta.settings.displayLanguage'), 'language'], React.createElement(Row, { label: t('ta.settings.displayLanguage'), stacked: true },
|
|
201
|
-
React.createElement(Segmented, { label: t('ta.settings.displayLanguage'), value: settings.language, choices: LANGUAGES, onChange: language => store.update({ language }) }))),
|
|
202
|
-
],
|
|
203
|
-
},
|
|
204
|
-
{
|
|
205
|
-
id: 'navigation',
|
|
206
|
-
title: t('ta.settings.navigation'),
|
|
207
|
-
icon: Compass,
|
|
208
|
-
rows: navigationRows(navigation, t),
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
id: 'links',
|
|
212
|
-
title: t('ta.settings.links'),
|
|
213
|
-
icon: Link2,
|
|
214
|
-
rows: [
|
|
215
|
-
row('trusted-domains', [t('ta.settings.trustedDomains'), t('ta.settings.trustedDomainsHint'), ...settings.trustedDomains], React.createElement(TrustedDomains, null)),
|
|
216
|
-
],
|
|
217
|
-
},
|
|
218
|
-
{
|
|
219
|
-
id: 'assistant',
|
|
220
|
-
title: t('ta.settings.assistant'),
|
|
221
|
-
icon: Bot,
|
|
222
|
-
rows: [
|
|
223
|
-
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 },
|
|
224
|
-
React.createElement(SettingsModelPicker, { settings: settingsServer, label: t('ta.settings.assistantModel'), value: settings.assistantModel, onChange: assistantModel => store.update({ assistantModel }) }))),
|
|
225
|
-
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 },
|
|
226
|
-
React.createElement(SettingsModelPicker, { settings: settingsServer, label: t('ta.settings.taskModel'), value: settings.taskModel, onChange: taskModel => store.update({ taskModel }) }))),
|
|
227
|
-
row('confirm-tasks', [t('ta.settings.confirmTasks'), t('ta.settings.confirmTasksHint')], React.createElement(Row, { label: t('ta.settings.confirmTasks'), description: t('ta.settings.confirmTasksHint') },
|
|
228
|
-
React.createElement(Switch, { label: t('ta.settings.confirmTasks'), checked: settings.confirmTasks, onChange: confirmTasks => store.update({ confirmTasks }) }))),
|
|
229
|
-
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 },
|
|
230
|
-
React.createElement(Segmented, { label: t('ta.settings.maxTasks'), value: String(settings.maxTasks), choices: MAX_TASKS_CHOICES.map(count => ({
|
|
231
|
-
value: String(count),
|
|
232
|
-
label: count === 0 ? t('ta.settings.maxTasksAny') : String(count),
|
|
233
|
-
})), onChange: value => store.update({ maxTasks: Number(value) }) }))),
|
|
234
|
-
],
|
|
235
|
-
},
|
|
236
|
-
{
|
|
237
|
-
id: 'voice',
|
|
238
|
-
title: t('ta.settings.voice'),
|
|
239
|
-
icon: Volume2,
|
|
240
|
-
rows: [
|
|
241
|
-
row('speak', [t('ta.settings.speak'), t('ta.settings.speakHint')], React.createElement(Row, { label: t('ta.settings.speak'), description: t('ta.settings.speakHint') },
|
|
242
|
-
React.createElement(Switch, { label: t('ta.settings.speak'), checked: settings.speak, onChange: speak => store.update({ speak }) }))),
|
|
243
|
-
],
|
|
244
|
-
},
|
|
245
|
-
];
|
|
246
|
-
const { snapshot } = agent;
|
|
247
|
-
const locked = !!snapshot && scope === 'project' && !snapshot.projectTrusted;
|
|
248
|
-
const lead = (React.createElement(React.Fragment, null,
|
|
249
|
-
React.createElement(ScopeBar, { scope: scope, onScope: onScope, snapshot: snapshot }),
|
|
250
|
-
agent.offline && React.createElement("div", { className: "ta-settings-note" }, t('ta.settings.offline')),
|
|
251
|
-
!agent.offline && !snapshot && !agent.error && React.createElement("div", { className: "ta-settings-note" }, t('ta.settings.loading')),
|
|
252
|
-
locked && React.createElement("div", { className: "ta-settings-note" }, t('ta.settings.untrusted')),
|
|
253
|
-
agent.error && React.createElement("div", { className: "ta-banner ta-banner-error" }, t('ta.settings.failed', { error: agent.error }))));
|
|
254
|
-
const ta = AGENT_SETTINGS_GROUPS.map(group => { var _a; return ({
|
|
255
|
-
id: group.id,
|
|
256
|
-
title: t(group.title),
|
|
257
|
-
icon: (_a = GROUP_ICONS[group.id]) !== null && _a !== void 0 ? _a : Wrench,
|
|
258
|
-
rows: snapshot
|
|
259
|
-
? group.keys.flatMap(key => {
|
|
260
|
-
const spec = AgentSettingsUtil.spec(key);
|
|
261
|
-
if (!spec) {
|
|
262
|
-
return [];
|
|
263
|
-
}
|
|
264
|
-
const label = t(AgentSettingsUtil.label(key));
|
|
265
|
-
const hint = AgentSettingsUtil.hint(key);
|
|
266
|
-
return [
|
|
267
|
-
row(key, [label, hint && t(hint), key], React.createElement(Row, { label: label, description: hint && t(hint), modified: snapshot[scope][key] !== undefined },
|
|
268
|
-
React.createElement(AgentControl, { spec: spec, scope: scope, snapshot: snapshot, disabled: locked, onChange: changes => agent.update(scope, changes) }))),
|
|
269
|
-
];
|
|
270
|
-
})
|
|
271
|
-
: [],
|
|
272
|
-
}); });
|
|
273
|
-
// Those opened without installing are in Quick open, which installs or deletes them (ta-launcher.md).
|
|
274
|
-
const packages = packageList.packages.filter(pkg => pkg.origin !== 'builtin' && pkg.origin !== 'temporary');
|
|
275
|
-
const launchRows = useLaunchRows();
|
|
276
|
-
/** Why the web extension of a package did not load, if it did not. */
|
|
277
|
-
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; };
|
|
278
|
-
const reload = async () => {
|
|
279
|
-
await host.refresh();
|
|
280
|
-
await packageList.read();
|
|
281
|
-
};
|
|
282
|
-
const more = [
|
|
283
|
-
{
|
|
284
|
-
id: 'packages',
|
|
285
|
-
title: t('ta.packages'),
|
|
286
|
-
icon: Puzzle,
|
|
287
|
-
rows: [
|
|
288
|
-
row('packages', [t('ta.packages'), t('ta.packages.hint')], React.createElement(Row, { label: t('ta.packages.installed'), description: t('ta.packages.hint') },
|
|
289
|
-
React.createElement("button", { type: "button", className: "ta-button", disabled: busy, onClick: () => run(reload, t('ta.packages.reloaded')) },
|
|
290
|
-
React.createElement(Icon, { icon: RefreshCw, size: 14 }),
|
|
291
|
-
" ",
|
|
292
|
-
t('ta.packages.reload')))),
|
|
293
|
-
...packages.map(pkg => {
|
|
294
|
-
const error = failure(pkg);
|
|
295
|
-
const { title, summary, icon } = packageLabel(pkg, language);
|
|
296
|
-
return row(`package:${pkg.id}`, [title, summary, pkg.name, t('ta.packages')], React.createElement(Row, { icon: icon, label: title, description: error
|
|
297
|
-
? t('ta.packages.failed', { error })
|
|
298
|
-
: [summary, t(pkg.scope === 'project' ? 'ta.packages.scope.project' : 'ta.packages.scope.user')].filter(Boolean).join(' · ') },
|
|
299
|
-
React.createElement(IconButton, { icon: Trash2, label: t('ta.packages.remove'), disabled: busy, onClick: () => void remove(pkg) }),
|
|
300
|
-
React.createElement(Switch, { label: title, checked: pkg.enabled, disabled: busy, onChange: on => run(() => packageList.toggle(pkg, on)) })));
|
|
301
|
-
}),
|
|
302
|
-
...(packages.length === 0
|
|
303
|
-
? [row('packages:none', [t('ta.packages.none')], React.createElement(EmptyRow, { title: t('ta.packages.none'), hint: t('ta.packages.noneHint') }))]
|
|
304
|
-
: []),
|
|
305
|
-
...launchRows,
|
|
306
|
-
],
|
|
307
|
-
},
|
|
308
|
-
{
|
|
309
|
-
id: 'builtin',
|
|
310
|
-
title: t('ta.packages.builtinTitle'),
|
|
311
|
-
icon: Blocks,
|
|
312
|
-
rows: [
|
|
313
|
-
...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) },
|
|
314
|
-
React.createElement(Switch, { label: t(builtin.title), checked: !settings.builtinsOff.includes(builtin.name), onChange: on => toggleBuiltin(builtin.name, on) }))); }),
|
|
315
|
-
...builtinPackages.map(info => {
|
|
316
|
-
const { title, summary, icon } = packageLabel(info, language);
|
|
317
|
-
return row(`builtin:${info.name}`, [title, summary, info.name, t('ta.packages.builtinTitle')], React.createElement(Row, { icon: icon, label: title, description: summary },
|
|
318
|
-
React.createElement(Switch, { label: title, checked: info.enabled, onChange: on => run(() => packageList.toggle(info, on)) })));
|
|
319
|
-
}),
|
|
320
|
-
],
|
|
321
|
-
},
|
|
322
|
-
// Behind a gateway only: where the Ta of this account runs.
|
|
323
|
-
...(gateway.info
|
|
324
|
-
? [
|
|
325
|
-
{
|
|
326
|
-
id: 'environment',
|
|
327
|
-
title: t('ta.environment.title'),
|
|
328
|
-
icon: Cloud,
|
|
329
|
-
rows: [
|
|
330
|
-
row('environment', [t('ta.environment.title'), t('ta.environment.whereHint'), 'sandbox', 'docker'], React.createElement(EnvironmentSettings, { info: gateway.info, onChange: gateway.read })),
|
|
331
|
-
],
|
|
332
|
-
},
|
|
333
|
-
]
|
|
334
|
-
: []),
|
|
335
|
-
// Only where accounts can sign in, or could: a Ta of this computer has no need of it.
|
|
336
|
-
...(access.info && (access.info.providers.length > 0 || access.info.accounts.length > 0)
|
|
337
|
-
? [
|
|
338
|
-
{
|
|
339
|
-
id: 'access',
|
|
340
|
-
title: t('ta.access.title'),
|
|
341
|
-
icon: ShieldCheck,
|
|
342
|
-
rows: [
|
|
343
|
-
row('access', [t('ta.access.title'), t('ta.access.addHint'), 'github', 'google', 'wechat'], React.createElement(AccessSettings, { info: access.info, onChange: access.read })),
|
|
344
|
-
],
|
|
345
|
-
},
|
|
346
|
-
]
|
|
347
|
-
: []),
|
|
348
|
-
{
|
|
349
|
-
id: 'remote',
|
|
350
|
-
title: t('ta.remote.title'),
|
|
351
|
-
icon: Server,
|
|
352
|
-
rows: [row('remote', [t('ta.remote.title'), t('ta.remote.description'), 'ssh'], React.createElement(RemoteHosts, null))],
|
|
353
|
-
},
|
|
354
|
-
...(touch
|
|
355
|
-
? []
|
|
356
|
-
: [
|
|
357
|
-
{
|
|
358
|
-
id: 'shortcuts',
|
|
359
|
-
title: t('ta.settings.shortcuts'),
|
|
360
|
-
icon: Keyboard,
|
|
361
|
-
rows: SHORTCUTS.map(shortcut => row(`key:${shortcut.keys}`, [t(shortcut.label), shortcut.keys, t('ta.settings.shortcuts')], React.createElement(Row, { label: t(shortcut.label) },
|
|
362
|
-
React.createElement(Keys, { keys: shortcut.keys })))),
|
|
363
|
-
},
|
|
364
|
-
]),
|
|
365
|
-
{
|
|
366
|
-
id: 'about',
|
|
367
|
-
title: t('ta.settings.about'),
|
|
368
|
-
icon: Info,
|
|
369
|
-
rows: workbench.server
|
|
370
|
-
? [
|
|
371
|
-
row('version', [t('ta.settings.version'), 'version'], React.createElement(Row, { label: t('ta.settings.version') },
|
|
372
|
-
React.createElement("span", { className: "ta-path" },
|
|
373
|
-
"v",
|
|
374
|
-
workbench.server.version))),
|
|
375
|
-
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 }) },
|
|
376
|
-
React.createElement("button", { type: "button", className: "ta-button", onClick: () => onDialog('directory') },
|
|
377
|
-
React.createElement(Icon, { icon: FolderOpen, size: 15 }),
|
|
378
|
-
" ",
|
|
379
|
-
t('ta.settings.cwdChange')))),
|
|
380
|
-
row('accounts', [t('ta.settings.accounts'), t('ta.settings.accountsDescription')], React.createElement(Row, { label: t('ta.settings.accounts'), description: t('ta.settings.accountsDescription') },
|
|
381
|
-
React.createElement("button", { type: "button", className: "ta-button", onClick: () => onDialog('accounts') },
|
|
382
|
-
React.createElement(Icon, { icon: KeyRound, size: 15 }),
|
|
383
|
-
" ",
|
|
384
|
-
t('ta.settings.manageAccounts')))),
|
|
385
|
-
...(WorkbenchUtil.isApp() || handheld
|
|
386
|
-
? []
|
|
387
|
-
: [
|
|
388
|
-
row('relay', [t('ta.settings.relay'), t('ta.settings.relayDescription')], React.createElement(Row, { label: t('ta.settings.relay'), description: t('ta.settings.relayDescription') },
|
|
389
|
-
React.createElement("button", { type: "button", className: "ta-button", onClick: () => onDialog('relay') },
|
|
390
|
-
React.createElement(Icon, { icon: Smartphone, size: 15 }),
|
|
391
|
-
" ",
|
|
392
|
-
t('ta.settings.manageAccounts')))),
|
|
393
|
-
]),
|
|
394
|
-
...(handheld
|
|
395
|
-
? []
|
|
396
|
-
: [
|
|
397
|
-
row('signOut', [t('ta.settings.signOut')], React.createElement(Row, { label: t('ta.settings.signOut') },
|
|
398
|
-
React.createElement("button", { type: "button", className: "ta-button ta-danger", onClick: () => {
|
|
399
|
-
onClose();
|
|
400
|
-
bench.signOut();
|
|
401
|
-
} },
|
|
402
|
-
React.createElement(Icon, { icon: LogOut, size: 15 }),
|
|
403
|
-
" ",
|
|
404
|
-
t('ta.settings.signOut')))),
|
|
405
|
-
]),
|
|
406
|
-
]
|
|
407
|
-
: [],
|
|
408
|
-
},
|
|
409
|
-
];
|
|
410
|
-
return [
|
|
411
|
-
{ id: 'web', title: t('ta.settings.web'), sections: web },
|
|
412
|
-
{ id: 'agent', title: t('ta.settings.agent'), sections: ta, lead },
|
|
413
|
-
{ id: 'more', title: t('ta.settings.more'), sections: more },
|
|
414
|
-
];
|
|
415
|
-
}
|
|
416
14
|
const sectionId = (id) => `ta-settings-${id}`;
|
|
417
15
|
/**
|
|
418
16
|
* The settings, as a page of the main area: those of this page (kept in the browser) and those of ta
|
|
@@ -11,7 +11,7 @@ export interface SwipeRowProps extends WebSwipeRowProps, Omit<React.HTMLAttribut
|
|
|
11
11
|
* list of the page and of web extensions (`ui.SwipeRow`) takes it, so that they swipe as one. Open, a tap on
|
|
12
12
|
* it closes it rather than opening what it is.
|
|
13
13
|
*/
|
|
14
|
-
export declare function SwipeRow({ as, actions, className, overlay, children, ...rest }: SwipeRowProps): React.DetailedReactHTMLElement<{
|
|
14
|
+
export declare function SwipeRow({ as, actions, className, overlay, children, style, ...rest }: SwipeRowProps): React.DetailedReactHTMLElement<{
|
|
15
15
|
dangerouslySetInnerHTML?: {
|
|
16
16
|
__html: string | TrustedHTML;
|
|
17
17
|
} | undefined;
|
|
@@ -254,7 +254,6 @@ export declare function SwipeRow({ as, actions, className, overlay, children, ..
|
|
|
254
254
|
nonce?: string | undefined;
|
|
255
255
|
slot?: string | undefined;
|
|
256
256
|
spellCheck?: ("false" | "true" | boolean) | undefined;
|
|
257
|
-
style?: React.CSSProperties | undefined;
|
|
258
257
|
tabIndex?: number | undefined;
|
|
259
258
|
title?: string | undefined;
|
|
260
259
|
translate?: "yes" | "no" | undefined;
|
|
@@ -294,4 +293,5 @@ export declare function SwipeRow({ as, actions, className, overlay, children, ..
|
|
|
294
293
|
className: string;
|
|
295
294
|
'data-swipeable': string | undefined;
|
|
296
295
|
'data-swiped': string | undefined;
|
|
296
|
+
style: React.CSSProperties | undefined;
|
|
297
297
|
}, HTMLElement>;
|
|
@@ -8,7 +8,7 @@ const ACTION_PX = 84;
|
|
|
8
8
|
* list of the page and of web extensions (`ui.SwipeRow`) takes it, so that they swipe as one. Open, a tap on
|
|
9
9
|
* it closes it rather than opening what it is.
|
|
10
10
|
*/
|
|
11
|
-
export function SwipeRow({ as = 'div', actions, className, overlay, children, ...rest }) {
|
|
11
|
+
export function SwipeRow({ as = 'div', actions, className, overlay, children, style, ...rest }) {
|
|
12
12
|
var _a;
|
|
13
13
|
const row = React.useRef(null);
|
|
14
14
|
const handheld = useDevice(device => device.handheld);
|
|
@@ -26,9 +26,13 @@ export function SwipeRow({ as = 'div', actions, className, overlay, children, ..
|
|
|
26
26
|
className: className ? `ta-swipe-row ${className}` : 'ta-swipe-row',
|
|
27
27
|
'data-swipeable': enabled ? '' : undefined,
|
|
28
28
|
'data-swiped': open ? '' : undefined,
|
|
29
|
-
|
|
29
|
+
// How far the content slides open, and its actions come out from: theirs together.
|
|
30
|
+
style: enabled ? { ...style, '--ta-swipe-width': `${ACTION_PX * ((_a = actions === null || actions === void 0 ? void 0 : actions.length) !== null && _a !== void 0 ? _a : 0)}px` } : style,
|
|
31
|
+
}, enabled && (React.createElement("div", { className: "ta-swipe-actions", inert: !open }, actions === null || actions === void 0 ? void 0 : actions.map((action, index) => (React.createElement("button", { key: action.key, type: "button", className: `ta-swipe-action${action.danger ? ' ta-danger' : ''}`,
|
|
32
|
+
// Of the way the row is shown, how far it is pushed out while closed (RowSwipeUtil.shift).
|
|
33
|
+
style: { '--ta-swipe-share': 1 - index / actions.length }, onClick: () => {
|
|
30
34
|
unswipe();
|
|
31
35
|
action.run();
|
|
32
|
-
} }, action.label))))), React.createElement("div", { className: "ta-swipe-content",
|
|
36
|
+
} }, action.label))))), React.createElement("div", { className: "ta-swipe-content", onClickCapture: open ? closeInstead : undefined }, children), overlay);
|
|
33
37
|
}
|
|
34
38
|
//# sourceMappingURL=swipe-row.js.map
|
|
@@ -33,10 +33,10 @@ function ToolRow({ name, args, status, trailing, details }) {
|
|
|
33
33
|
React.createElement(StatusDot, { status: status }),
|
|
34
34
|
React.createElement("span", { className: "ta-tool-verb" }, summary.verb ? t(summary.verb) : summary.name),
|
|
35
35
|
summary.target && React.createElement("span", { className: `ta-tool-target ${summary.code ? 'ta-mono' : ''}` }, summary.target),
|
|
36
|
-
|
|
36
|
+
React.createElement(Icon, { icon: ChevronRight, size: 13, className: "ta-tool-chevron" })));
|
|
37
37
|
return (React.createElement("div", { className: `ta-tool ta-tool-${status}` },
|
|
38
38
|
React.createElement("div", { className: "ta-tool-line" },
|
|
39
|
-
|
|
39
|
+
React.createElement("button", { type: "button", className: "ta-tool-title", disabled: !details, "aria-expanded": details ? open : undefined, onClick: () => setOpen(!open) }, line),
|
|
40
40
|
React.createElement("span", { className: "ta-tool-trailing" }, trailing)),
|
|
41
41
|
details && open && React.createElement("div", { className: "ta-tool-body" }, details)));
|
|
42
42
|
}
|
|
@@ -88,23 +88,25 @@ function CodemodeView({ id, args, output, status, runs }) {
|
|
|
88
88
|
const script = (React.createElement(React.Fragment, null,
|
|
89
89
|
React.createElement(CodeBlock, { code: code, language: "js" }),
|
|
90
90
|
result && React.createElement(Output, { text: result })));
|
|
91
|
-
if (!calls.length) {
|
|
92
|
-
return React.createElement(ToolRow, { name: "codemode", args: args, status: status, details: script });
|
|
93
|
-
}
|
|
94
91
|
const label = t(showScript ? 'ta.tool.hideScript' : 'ta.tool.showScript');
|
|
95
|
-
const toggle = (React.createElement("button", { type: "button", className: `ta-tool-script ${showScript ? 'ta-on' : ''}`, title: label, "aria-label": label, "aria-pressed": showScript, onClick: () => setShowScript(!showScript) },
|
|
92
|
+
const toggle = calls.length > 0 && (React.createElement("button", { type: "button", className: `ta-tool-script ${showScript ? 'ta-on' : ''}`, title: label, "aria-label": label, "aria-pressed": showScript, onClick: () => setShowScript(!showScript) },
|
|
96
93
|
React.createElement(Icon, { icon: FileCode2, size: 13 })));
|
|
94
|
+
// Before its first call the script is the one step; its calls then take its place, the first in the same
|
|
95
|
+
// element, so that the line changes rather than comes again. By place: the calls are in order, live or
|
|
96
|
+
// kept, and their ids are not the same in both.
|
|
97
|
+
const rows = calls.length ? calls.map(nestedRow) : [{ name: 'codemode', args, status, details: script }];
|
|
97
98
|
// A script that failed after its calls went well: one more step, the script, whose output says what went wrong.
|
|
98
|
-
|
|
99
|
+
if (calls.length && status === 'error' && !calls.some(call => call.status === 'error')) {
|
|
100
|
+
rows.push({ name: 'codemode', args: { code }, status: 'error', details: result ? React.createElement(Output, { text: result }) : undefined });
|
|
101
|
+
}
|
|
99
102
|
return (React.createElement("div", { className: "ta-tool-group" },
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
showScript && React.createElement("div", { className: "ta-tool-body" }, script)));
|
|
103
|
+
rows.map((row, index) => (React.createElement(ToolRow, { key: index, ...row, trailing: index === 0 ? toggle || undefined : undefined }))),
|
|
104
|
+
showScript && calls.length > 0 && React.createElement("div", { className: "ta-tool-body" }, script)));
|
|
103
105
|
}
|
|
104
|
-
function
|
|
106
|
+
function nestedRow(call) {
|
|
105
107
|
var _a;
|
|
106
108
|
const shown = details(call.name, call.args, (_a = call.run) === null || _a === void 0 ? void 0 : _a.result, call.status);
|
|
107
109
|
const error = call.status === 'error' && call.error ? React.createElement(Output, { text: call.error }) : undefined;
|
|
108
|
-
return
|
|
110
|
+
return { name: call.name, args: call.args, status: call.status, details: shown || error || undefined };
|
|
109
111
|
}
|
|
110
112
|
//# sourceMappingURL=tool-view.js.map
|
|
@@ -7,5 +7,5 @@ export interface VoiceButtonProps {
|
|
|
7
7
|
onListening?(listening: boolean): void;
|
|
8
8
|
onError(error: unknown): void;
|
|
9
9
|
}
|
|
10
|
-
/** The microphone of a message box, where the browser can recognize speech: a click listens, a wave shows it, a click stops it. */
|
|
10
|
+
/** The microphone of a message box, where the browser can recognize speech: a click listens, a wave shows it, a click stops it (a finger held on it talks, which is the box's: voice-talk.ts). */
|
|
11
11
|
export declare function VoiceButton(props: VoiceButtonProps): React.JSX.Element;
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { useLanguage, useT } from '../i18n/use-t.js';
|
|
4
4
|
import { Voice } from '../util/voice.js';
|
|
5
5
|
import { Icon } from './icon.js';
|
|
6
|
-
/** The microphone of a message box, where the browser can recognize speech: a click listens, a wave shows it, a click stops it. */
|
|
6
|
+
/** The microphone of a message box, where the browser can recognize speech: a click listens, a wave shows it, a click stops it (a finger held on it talks, which is the box's: voice-talk.ts). */
|
|
7
7
|
export function VoiceButton(props) {
|
|
8
8
|
const t = useT();
|
|
9
9
|
const language = useLanguage();
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { TalkTarget } from './held-talk.js';
|
|
3
|
+
/** Where the finger is let go: on the bottom, the words go; over 取消 they are dropped; over 编辑 they stay in the box. */
|
|
4
|
+
export type TalkZone = 'send' | 'cancel' | 'edit';
|
|
5
|
+
export declare namespace VoiceTalkUtil {
|
|
6
|
+
/** How long a talk lasts for the words to count: shorter, a finger slipped on the box and nothing is given. */
|
|
7
|
+
const SHORT_MS = 600;
|
|
8
|
+
/** How long the end of a talk waits for recognition to say it ended before it ends anyway. */
|
|
9
|
+
const SETTLE_MS = 1500;
|
|
10
|
+
/** How long "too short" stays before the page comes back. */
|
|
11
|
+
const SHORT_NOTICE_MS = 700;
|
|
12
|
+
/** How long the overlay takes to fade out. */
|
|
13
|
+
const LEAVE_MS = 160;
|
|
14
|
+
/** What a talk gives; none when it was too short to be meant, or when nothing was heard. */
|
|
15
|
+
function given(words: string, heldMs: number): string | undefined;
|
|
16
|
+
/** The zone of the overlay under a point (`data-talk-zone`): the bottom, where the finger starts, sends. */
|
|
17
|
+
function zone(element: Element | null): TalkZone;
|
|
18
|
+
}
|
|
19
|
+
/** Where a talk is: listening, the finger let go and the last words coming, said too short, the page coming back. */
|
|
20
|
+
export type TalkPhase = 'idle' | 'listening' | 'released' | 'short' | 'leaving';
|
|
21
|
+
export interface VoiceTalk extends TalkTarget {
|
|
22
|
+
phase: TalkPhase;
|
|
23
|
+
/** Listening, or the finger let go and the last words still coming. */
|
|
24
|
+
active: boolean;
|
|
25
|
+
/** What has been heard so far. */
|
|
26
|
+
words: string;
|
|
27
|
+
/** Where the finger is. */
|
|
28
|
+
zone: TalkZone;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A conversation by voice as WeChat's: a finger held on the message box (or on an entry of the navigation) dims the
|
|
32
|
+
* page and a green bubble listens, the words coming as they are said. Let go on the bottom, they are sent; slid
|
|
33
|
+
* over 取消 they are dropped, over 编辑 they stay in the box to be read over. A talk too short to be meant, which a
|
|
34
|
+
* wrong touch is, says so and gives nothing, as one where nothing was heard does.
|
|
35
|
+
*/
|
|
36
|
+
export declare function useVoiceTalk(onGive: (text: string, zone: 'send' | 'edit') => void, onError: (error: unknown) => void): VoiceTalk;
|
|
37
|
+
/**
|
|
38
|
+
* What a talk shows, over the whole page (above the keyboard): the page dimmed, a green bubble with the words as
|
|
39
|
+
* they come, 取消 and 编辑 to slide the finger onto, and the bottom it starts on, which says what letting go does.
|
|
40
|
+
*/
|
|
41
|
+
export declare function VoiceTalkOverlay({ talk }: {
|
|
42
|
+
talk: VoiceTalk;
|
|
43
|
+
}): React.ReactPortal | null;
|