@celljs/ta-web 4.9.1 → 4.11.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 +8 -7
- package/README.md +8 -7
- package/esm/browser/assistant/assistant-chat-list.d.ts +11 -0
- package/esm/browser/assistant/assistant-chat-list.js +20 -2
- package/esm/browser/assistant/assistant-extension.d.ts +8 -1
- package/esm/browser/assistant/assistant-extension.js +25 -0
- package/esm/browser/assistant/assistant-protocol.d.ts +5 -2
- package/esm/browser/assistant/assistant-task-book.d.ts +12 -2
- package/esm/browser/assistant/assistant-task-book.js +23 -4
- package/esm/browser/assistant/assistant-task-source.d.ts +1 -1
- package/esm/browser/assistant/assistant-task-source.js +5 -10
- package/esm/browser/assistant/assistant-task-util.d.ts +14 -2
- package/esm/browser/assistant/assistant-task-util.js +62 -13
- package/esm/browser/assistant/assistant-view.js +117 -71
- package/esm/browser/assistant/assistant.d.ts +28 -5
- package/esm/browser/assistant/assistant.js +96 -22
- package/esm/browser/avatar/dino-face.js +1 -2
- 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 +28 -1
- package/esm/browser/chat/chat-stores.d.ts +62 -0
- package/esm/browser/chat/chat-stores.js +129 -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 +45 -17
- package/esm/browser/chat/chat.d.ts +41 -41
- package/esm/browser/chat/chat.js +276 -190
- package/esm/browser/components/account-menu.d.ts +0 -2
- package/esm/browser/components/account-menu.js +1 -27
- package/esm/browser/components/agent-settings-view.d.ts +3 -2
- package/esm/browser/components/agent-settings-view.js +2 -1
- package/esm/browser/components/app-nav.d.ts +11 -5
- package/esm/browser/components/app-nav.js +39 -17
- package/esm/browser/components/app-shell-hooks.d.ts +2 -2
- package/esm/browser/components/app-shell-hooks.js +12 -6
- package/esm/browser/components/app-view.js +150 -36
- package/esm/browser/components/busy.d.ts +25 -0
- package/esm/browser/components/busy.js +52 -0
- package/esm/browser/components/chat-icon.d.ts +29 -0
- package/esm/browser/components/chat-icon.js +78 -0
- package/esm/browser/components/chat-list.d.ts +93 -8
- package/esm/browser/components/chat-list.js +411 -60
- package/esm/browser/components/chat-seen.d.ts +53 -0
- package/esm/browser/components/chat-seen.js +101 -0
- package/esm/browser/components/composer-box.d.ts +18 -8
- package/esm/browser/components/composer-box.js +199 -52
- package/esm/browser/components/composer.d.ts +13 -6
- package/esm/browser/components/composer.js +8 -5
- 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 +136 -6
- package/esm/browser/components/conversation-scroll.js +467 -108
- package/esm/browser/components/custom-host.d.ts +3 -0
- package/esm/browser/components/custom-host.js +14 -0
- package/esm/browser/components/directory-commands.d.ts +6 -0
- package/esm/browser/components/directory-commands.js +34 -0
- package/esm/browser/components/discover-view.d.ts +11 -4
- package/esm/browser/components/discover-view.js +20 -11
- package/esm/browser/components/dismiss.d.ts +3 -0
- package/esm/browser/components/dismiss.js +29 -0
- package/esm/browser/components/earlier-messages.d.ts +34 -2
- package/esm/browser/components/earlier-messages.js +42 -23
- package/esm/browser/components/editor-area.d.ts +6 -20
- package/esm/browser/components/editor-area.js +10 -96
- package/esm/browser/components/empty-pictures.d.ts +0 -2
- package/esm/browser/components/empty-pictures.js +0 -16
- package/esm/browser/components/fold-text.d.ts +20 -0
- package/esm/browser/components/fold-text.js +66 -0
- package/esm/browser/components/folder-picker.d.ts +6 -3
- package/esm/browser/components/folder-picker.js +27 -9
- package/esm/browser/components/full-screen.d.ts +9 -0
- package/esm/browser/components/full-screen.js +26 -0
- package/esm/browser/components/grow-box.d.ts +9 -0
- package/esm/browser/components/grow-box.js +50 -0
- package/esm/browser/components/held-talk.d.ts +28 -0
- package/esm/browser/components/held-talk.js +76 -0
- package/esm/browser/components/hold-to-talk.d.ts +22 -0
- package/esm/browser/components/hold-to-talk.js +29 -0
- package/esm/browser/components/host-view.d.ts +1 -1
- package/esm/browser/components/icon.d.ts +5 -3
- package/esm/browser/components/icon.js +9 -9
- package/esm/browser/components/image-viewer.d.ts +132 -0
- package/esm/browser/components/image-viewer.js +434 -0
- package/esm/browser/components/launcher-search-util.d.ts +4 -3
- package/esm/browser/components/launcher-search-util.js +12 -4
- package/esm/browser/components/lightbox.d.ts +14 -0
- package/esm/browser/components/lightbox.js +25 -0
- package/esm/browser/components/list-rows.d.ts +9 -1
- package/esm/browser/components/list-rows.js +17 -3
- package/esm/browser/components/markdown.d.ts +6 -2
- package/esm/browser/components/markdown.js +60 -14
- package/esm/browser/components/media.js +20 -12
- package/esm/browser/components/message-actions.js +2 -0
- package/esm/browser/components/message-footer.d.ts +22 -2
- package/esm/browser/components/message-footer.js +47 -13
- package/esm/browser/components/message-list.d.ts +78 -6
- package/esm/browser/components/message-list.js +281 -36
- package/esm/browser/components/message-menu.d.ts +3 -1
- package/esm/browser/components/message-menu.js +24 -4
- package/esm/browser/components/model-picker.js +1 -0
- package/esm/browser/components/nav-places.d.ts +37 -3
- package/esm/browser/components/nav-places.js +32 -7
- package/esm/browser/components/notice-center.js +34 -0
- package/esm/browser/components/notice-face.d.ts +10 -0
- package/esm/browser/components/notice-face.js +28 -0
- package/esm/browser/components/phone-shell.d.ts +27 -2
- package/esm/browser/components/phone-shell.js +98 -9
- package/esm/browser/components/picture.d.ts +8 -1
- package/esm/browser/components/picture.js +12 -1
- package/esm/browser/components/plus-menu.d.ts +23 -0
- package/esm/browser/components/plus-menu.js +90 -0
- package/esm/browser/components/recent-shot.d.ts +15 -0
- package/esm/browser/components/recent-shot.js +174 -0
- package/esm/browser/components/relay-view.js +10 -3
- package/esm/browser/components/run-status.d.ts +1 -1
- package/esm/browser/components/run-status.js +17 -29
- package/esm/browser/components/said-text.d.ts +6 -0
- package/esm/browser/components/said-text.js +14 -0
- package/esm/browser/components/scan-screen.d.ts +10 -0
- package/esm/browser/components/scan-screen.js +230 -0
- package/esm/browser/components/search-page.js +10 -6
- package/esm/browser/components/session-settings.d.ts +8 -3
- package/esm/browser/components/session-settings.js +15 -1
- package/esm/browser/components/session-view.js +36 -22
- package/esm/browser/components/settings-choices.d.ts +1 -0
- package/esm/browser/components/settings-choices.js +3 -2
- package/esm/browser/components/settings-controls.d.ts +5 -3
- package/esm/browser/components/settings-controls.js +10 -1
- package/esm/browser/components/settings-parts.d.ts +2 -2
- package/esm/browser/components/settings-parts.js +69 -15
- 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 +21 -14
- package/esm/browser/components/unseen-drop.d.ts +39 -0
- package/esm/browser/components/unseen-drop.js +219 -0
- package/esm/browser/components/use-seen-chats.d.ts +8 -0
- package/esm/browser/components/use-seen-chats.js +49 -0
- package/esm/browser/components/voice-button.d.ts +7 -1
- package/esm/browser/components/voice-button.js +15 -2
- package/esm/browser/components/voice-picker.d.ts +6 -0
- package/esm/browser/components/voice-picker.js +53 -0
- package/esm/browser/components/voice-talk.d.ts +51 -0
- package/esm/browser/components/voice-talk.js +242 -0
- package/esm/browser/components/web-composer.d.ts +4 -2
- package/esm/browser/components/web-composer.js +8 -4
- package/esm/browser/components/workbench-tabs.d.ts +41 -0
- package/esm/browser/components/workbench-tabs.js +193 -0
- package/esm/browser/components/workbench-toggle.d.ts +0 -13
- package/esm/browser/components/workbench-toggle.js +1 -28
- package/esm/browser/device/code-scan.d.ts +55 -0
- package/esm/browser/device/code-scan.js +137 -0
- package/esm/browser/device/code-vision.d.ts +51 -0
- package/esm/browser/device/code-vision.js +100 -0
- 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 +134 -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 +12 -0
- package/esm/browser/device/long-press.js +44 -13
- package/esm/browser/device/own-gestures.d.ts +25 -0
- package/esm/browser/device/own-gestures.js +39 -0
- package/esm/browser/device/pull-down.d.ts +4 -2
- package/esm/browser/device/pull-down.js +67 -78
- package/esm/browser/device/recent-shots.d.ts +45 -0
- package/esm/browser/device/recent-shots.js +142 -0
- package/esm/browser/device/row-swipe.d.ts +35 -10
- package/esm/browser/device/row-swipe.js +154 -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 +414 -108
- package/esm/browser/extension/extension-view.d.ts +10 -0
- package/esm/browser/extension/extension-view.js +6 -0
- package/esm/browser/extension/icons.js +15 -2
- package/esm/browser/extension/web-api-components.d.ts +269 -0
- package/esm/browser/extension/web-api-components.js +2 -0
- package/esm/browser/extension/web-api-contributions.d.ts +385 -0
- package/esm/browser/extension/web-api-contributions.js +2 -0
- package/esm/browser/extension/web-api-desktop.d.ts +55 -0
- package/esm/browser/extension/web-api-desktop.js +2 -0
- package/esm/browser/extension/web-api-terminal.d.ts +71 -0
- package/esm/browser/extension/web-api-terminal.js +2 -0
- package/esm/browser/extension/web-editor-tabs.d.ts +42 -0
- package/esm/browser/extension/web-editor-tabs.js +137 -0
- package/esm/browser/extension/web-extension-api.d.ts +218 -521
- 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-context.d.ts +78 -0
- package/esm/browser/extension/web-extension-context.js +346 -0
- package/esm/browser/extension/web-extension-protocol.d.ts +66 -6
- package/esm/browser/extension/web-extension-protocol.js +41 -0
- package/esm/browser/extension/web-extension-run.d.ts +54 -0
- package/esm/browser/extension/web-extension-run.js +120 -0
- package/esm/browser/extension/web-extensions.d.ts +41 -68
- package/esm/browser/extension/web-extensions.js +188 -487
- package/esm/browser/extension/web-home.d.ts +19 -0
- package/esm/browser/extension/web-home.js +72 -0
- package/esm/browser/extension/web-pages.d.ts +13 -3
- package/esm/browser/extension/web-pages.js +23 -3
- package/esm/browser/extension/web-session-notices.d.ts +36 -0
- package/esm/browser/extension/web-session-notices.js +174 -0
- package/esm/browser/extension/web-sharing.d.ts +2 -0
- package/esm/browser/extension/web-sharing.js +4 -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/game/game-host.d.ts +27 -0
- package/esm/browser/game/game-host.js +127 -0
- package/esm/browser/game/game-loader.d.ts +10 -0
- package/esm/browser/game/game-loader.js +28 -0
- package/esm/browser/game/game-protocol.d.ts +49 -0
- package/esm/browser/game/game-protocol.js +2 -0
- package/esm/browser/game/game-runner.d.ts +27 -0
- package/esm/browser/game/game-runner.js +60 -0
- package/esm/browser/game/game-util.d.ts +29 -0
- package/esm/browser/game/game-util.js +180 -0
- package/esm/browser/game/game-view.d.ts +12 -0
- package/esm/browser/game/game-view.js +31 -0
- package/esm/browser/game/game3d-protocol.d.ts +51 -0
- package/esm/browser/game/game3d-protocol.js +2 -0
- package/esm/browser/game/game3d-runner.d.ts +27 -0
- package/esm/browser/game/game3d-runner.js +149 -0
- package/esm/browser/hooks.d.ts +5 -1
- package/esm/browser/hooks.js +13 -2
- package/esm/browser/i18n/locales.d.ts +105 -3
- package/esm/browser/i18n/messages.d.ts +104 -2
- package/esm/browser/i18n/messages.js +215 -11
- package/esm/browser/index.d.ts +15 -0
- package/esm/browser/index.js +15 -0
- package/esm/browser/links/links-protocol.d.ts +5 -0
- package/esm/browser/links/links.d.ts +19 -7
- package/esm/browser/links/links.js +57 -11
- package/esm/browser/markdown/code-renderers.d.ts +4 -0
- package/esm/browser/markdown/code-renderers.js +4 -0
- package/esm/browser/notices/notices-protocol.d.ts +26 -1
- package/esm/browser/notices/notices.d.ts +3 -1
- package/esm/browser/notices/notices.js +26 -12
- package/esm/browser/notices/session-notices.d.ts +69 -0
- package/esm/browser/notices/session-notices.js +92 -0
- package/esm/browser/offline/device-values.d.ts +55 -0
- package/esm/browser/offline/device-values.js +151 -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 +109 -0
- package/esm/browser/settings/navigation.d.ts +3 -2
- package/esm/browser/settings/navigation.js +4 -3
- package/esm/browser/settings/settings-protocol.d.ts +17 -0
- package/esm/browser/settings/settings-protocol.js +20 -4
- package/esm/browser/state/state-protocol.d.ts +8 -1
- package/esm/browser/state/state.d.ts +2 -0
- package/esm/browser/state/state.js +21 -2
- package/esm/browser/style/base.d.ts +1 -1
- package/esm/browser/style/base.js +27 -1
- package/esm/browser/style/conversation.d.ts +1 -1
- package/esm/browser/style/conversation.js +95 -17
- package/esm/browser/style/device.js +42 -5
- package/esm/browser/style/layout.d.ts +1 -1
- package/esm/browser/style/layout.js +252 -67
- package/esm/browser/style/pages.d.ts +1 -1
- package/esm/browser/style/pages.js +38 -2
- package/esm/browser/style/phone.d.ts +1 -1
- package/esm/browser/style/phone.js +15 -0
- package/esm/browser/style/shell.d.ts +1 -1
- package/esm/browser/style/shell.js +76 -9
- package/esm/browser/style/surfaces.d.ts +1 -1
- package/esm/browser/style/surfaces.js +2 -2
- package/esm/browser/style/tints.d.ts +27 -0
- package/esm/browser/style/tints.js +56 -0
- package/esm/browser/style.js +13 -1
- package/esm/browser/util/composer.d.ts +6 -0
- package/esm/browser/util/composer.js +16 -0
- package/esm/browser/util/desktop.d.ts +19 -1
- package/esm/browser/util/desktop.js +15 -0
- package/esm/browser/util/frame.d.ts +5 -4
- package/esm/browser/util/frame.js +5 -4
- package/esm/browser/util/link.d.ts +18 -0
- package/esm/browser/util/link.js +66 -1
- package/esm/browser/util/markdown.d.ts +22 -2
- package/esm/browser/util/markdown.js +120 -6
- package/esm/browser/util/message.d.ts +5 -0
- package/esm/browser/util/message.js +30 -0
- package/esm/browser/util/process.d.ts +35 -2
- package/esm/browser/util/process.js +79 -4
- package/esm/browser/util/progress.d.ts +19 -1
- package/esm/browser/util/progress.js +57 -4
- package/esm/browser/util/quote.d.ts +19 -0
- package/esm/browser/util/quote.js +58 -0
- package/esm/browser/util/tool.d.ts +19 -2
- package/esm/browser/util/tool.js +70 -2
- package/esm/browser/util/voice.d.ts +49 -6
- package/esm/browser/util/voice.js +271 -26
- package/esm/browser/util/zoom.d.ts +46 -0
- package/esm/browser/util/zoom.js +96 -0
- package/esm/browser/workbench-calls.d.ts +61 -0
- package/esm/browser/workbench-calls.js +146 -0
- package/esm/browser/workbench-protocol.d.ts +36 -3
- package/esm/browser/workbench-util.d.ts +22 -4
- package/esm/browser/workbench-util.js +37 -7
- package/esm/browser/workbench.d.ts +47 -6
- package/esm/browser/workbench.js +191 -43
- package/lib/browser/assistant/assistant-chat-list.d.ts +11 -0
- package/lib/browser/assistant/assistant-chat-list.js +21 -2
- package/lib/browser/assistant/assistant-extension.d.ts +8 -1
- package/lib/browser/assistant/assistant-extension.js +25 -0
- package/lib/browser/assistant/assistant-protocol.d.ts +5 -2
- package/lib/browser/assistant/assistant-task-book.d.ts +12 -2
- package/lib/browser/assistant/assistant-task-book.js +23 -4
- package/lib/browser/assistant/assistant-task-source.d.ts +1 -1
- package/lib/browser/assistant/assistant-task-source.js +5 -10
- package/lib/browser/assistant/assistant-task-util.d.ts +14 -2
- package/lib/browser/assistant/assistant-task-util.js +62 -13
- package/lib/browser/assistant/assistant-view.js +113 -67
- package/lib/browser/assistant/assistant.d.ts +28 -5
- package/lib/browser/assistant/assistant.js +96 -22
- package/lib/browser/avatar/dino-face.js +1 -2
- 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 +28 -1
- package/lib/browser/chat/chat-stores.d.ts +63 -0
- package/lib/browser/chat/chat-stores.js +133 -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 +44 -16
- package/lib/browser/chat/chat.d.ts +41 -41
- package/lib/browser/chat/chat.js +277 -191
- package/lib/browser/components/account-menu.d.ts +0 -2
- package/lib/browser/components/account-menu.js +2 -29
- package/lib/browser/components/agent-settings-view.d.ts +3 -2
- package/lib/browser/components/agent-settings-view.js +2 -1
- package/lib/browser/components/app-nav.d.ts +11 -5
- package/lib/browser/components/app-nav.js +35 -13
- package/lib/browser/components/app-shell-hooks.d.ts +2 -2
- package/lib/browser/components/app-shell-hooks.js +12 -6
- package/lib/browser/components/app-view.js +145 -31
- package/lib/browser/components/busy.d.ts +26 -0
- package/lib/browser/components/busy.js +91 -0
- package/lib/browser/components/chat-icon.d.ts +30 -0
- package/lib/browser/components/chat-icon.js +117 -0
- package/lib/browser/components/chat-list.d.ts +93 -8
- package/lib/browser/components/chat-list.js +412 -60
- package/lib/browser/components/chat-seen.d.ts +54 -0
- package/lib/browser/components/chat-seen.js +104 -0
- package/lib/browser/components/composer-box.d.ts +18 -8
- package/lib/browser/components/composer-box.js +198 -51
- package/lib/browser/components/composer.d.ts +13 -6
- package/lib/browser/components/composer.js +7 -4
- 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 +136 -6
- package/lib/browser/components/conversation-scroll.js +469 -109
- package/lib/browser/components/custom-host.d.ts +4 -0
- package/lib/browser/components/custom-host.js +50 -0
- package/lib/browser/components/directory-commands.d.ts +7 -0
- package/lib/browser/components/directory-commands.js +70 -0
- package/lib/browser/components/discover-view.d.ts +11 -4
- package/lib/browser/components/discover-view.js +19 -10
- package/lib/browser/components/dismiss.d.ts +4 -0
- package/lib/browser/components/dismiss.js +65 -0
- package/lib/browser/components/earlier-messages.d.ts +34 -2
- package/lib/browser/components/earlier-messages.js +44 -24
- package/lib/browser/components/editor-area.d.ts +6 -20
- package/lib/browser/components/editor-area.js +11 -97
- package/lib/browser/components/empty-pictures.d.ts +0 -2
- package/lib/browser/components/empty-pictures.js +0 -17
- package/lib/browser/components/fold-text.d.ts +21 -0
- package/lib/browser/components/fold-text.js +103 -0
- package/lib/browser/components/folder-picker.d.ts +6 -3
- package/lib/browser/components/folder-picker.js +27 -9
- package/lib/browser/components/full-screen.d.ts +10 -0
- package/lib/browser/components/full-screen.js +62 -0
- package/lib/browser/components/grow-box.d.ts +10 -0
- package/lib/browser/components/grow-box.js +86 -0
- package/lib/browser/components/held-talk.d.ts +29 -0
- package/lib/browser/components/held-talk.js +79 -0
- package/lib/browser/components/hold-to-talk.d.ts +23 -0
- package/lib/browser/components/hold-to-talk.js +65 -0
- package/lib/browser/components/host-view.d.ts +1 -1
- package/lib/browser/components/icon.d.ts +5 -3
- package/lib/browser/components/icon.js +11 -9
- package/lib/browser/components/image-viewer.d.ts +133 -0
- package/lib/browser/components/image-viewer.js +472 -0
- package/lib/browser/components/launcher-search-util.d.ts +4 -3
- package/lib/browser/components/launcher-search-util.js +12 -4
- package/lib/browser/components/lightbox.d.ts +15 -0
- package/lib/browser/components/lightbox.js +61 -0
- package/lib/browser/components/list-rows.d.ts +9 -1
- package/lib/browser/components/list-rows.js +18 -3
- package/lib/browser/components/markdown.d.ts +6 -2
- package/lib/browser/components/markdown.js +60 -14
- package/lib/browser/components/media.js +21 -13
- package/lib/browser/components/message-actions.js +2 -0
- package/lib/browser/components/message-footer.d.ts +22 -2
- package/lib/browser/components/message-footer.js +49 -12
- package/lib/browser/components/message-list.d.ts +78 -6
- package/lib/browser/components/message-list.js +281 -32
- package/lib/browser/components/message-menu.d.ts +3 -1
- package/lib/browser/components/message-menu.js +23 -3
- package/lib/browser/components/model-picker.js +1 -0
- package/lib/browser/components/nav-places.d.ts +37 -3
- package/lib/browser/components/nav-places.js +35 -7
- package/lib/browser/components/notice-center.js +34 -0
- package/lib/browser/components/notice-face.d.ts +11 -0
- package/lib/browser/components/notice-face.js +64 -0
- package/lib/browser/components/phone-shell.d.ts +27 -2
- package/lib/browser/components/phone-shell.js +99 -10
- package/lib/browser/components/picture.d.ts +8 -1
- package/lib/browser/components/picture.js +13 -1
- package/lib/browser/components/plus-menu.d.ts +24 -0
- package/lib/browser/components/plus-menu.js +126 -0
- package/lib/browser/components/recent-shot.d.ts +16 -0
- package/lib/browser/components/recent-shot.js +210 -0
- package/lib/browser/components/relay-view.js +10 -3
- package/lib/browser/components/run-status.d.ts +1 -1
- package/lib/browser/components/run-status.js +17 -29
- package/lib/browser/components/said-text.d.ts +7 -0
- package/lib/browser/components/said-text.js +50 -0
- package/lib/browser/components/scan-screen.d.ts +11 -0
- package/lib/browser/components/scan-screen.js +266 -0
- package/lib/browser/components/search-page.js +10 -6
- package/lib/browser/components/session-settings.d.ts +8 -3
- package/lib/browser/components/session-settings.js +15 -1
- package/lib/browser/components/session-view.js +32 -18
- package/lib/browser/components/settings-choices.d.ts +1 -0
- package/lib/browser/components/settings-choices.js +2 -1
- package/lib/browser/components/settings-controls.d.ts +5 -3
- package/lib/browser/components/settings-controls.js +10 -1
- package/lib/browser/components/settings-parts.d.ts +2 -2
- package/lib/browser/components/settings-parts.js +67 -13
- 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 +21 -14
- package/lib/browser/components/unseen-drop.d.ts +40 -0
- package/lib/browser/components/unseen-drop.js +256 -0
- package/lib/browser/components/use-seen-chats.d.ts +9 -0
- package/lib/browser/components/use-seen-chats.js +85 -0
- package/lib/browser/components/voice-button.d.ts +7 -1
- package/lib/browser/components/voice-button.js +16 -2
- package/lib/browser/components/voice-picker.d.ts +7 -0
- package/lib/browser/components/voice-picker.js +89 -0
- package/lib/browser/components/voice-talk.d.ts +52 -0
- package/lib/browser/components/voice-talk.js +281 -0
- package/lib/browser/components/web-composer.d.ts +4 -2
- package/lib/browser/components/web-composer.js +7 -3
- package/lib/browser/components/workbench-tabs.d.ts +42 -0
- package/lib/browser/components/workbench-tabs.js +232 -0
- package/lib/browser/components/workbench-toggle.d.ts +0 -13
- package/lib/browser/components/workbench-toggle.js +1 -29
- package/lib/browser/device/code-scan.d.ts +56 -0
- package/lib/browser/device/code-scan.js +141 -0
- package/lib/browser/device/code-vision.d.ts +52 -0
- package/lib/browser/device/code-vision.js +103 -0
- 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 +171 -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 +12 -0
- package/lib/browser/device/long-press.js +44 -13
- package/lib/browser/device/own-gestures.d.ts +26 -0
- package/lib/browser/device/own-gestures.js +42 -0
- package/lib/browser/device/pull-down.d.ts +4 -2
- package/lib/browser/device/pull-down.js +66 -77
- package/lib/browser/device/recent-shots.d.ts +46 -0
- package/lib/browser/device/recent-shots.js +145 -0
- package/lib/browser/device/row-swipe.d.ts +35 -10
- package/lib/browser/device/row-swipe.js +153 -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 +418 -109
- package/lib/browser/extension/extension-view.d.ts +10 -0
- package/lib/browser/extension/extension-view.js +7 -1
- package/lib/browser/extension/icons.js +14 -1
- package/lib/browser/extension/web-api-components.d.ts +270 -0
- package/lib/browser/extension/web-api-components.js +3 -0
- package/lib/browser/extension/web-api-contributions.d.ts +386 -0
- package/lib/browser/extension/web-api-contributions.js +3 -0
- package/lib/browser/extension/web-api-desktop.d.ts +56 -0
- package/lib/browser/extension/web-api-desktop.js +3 -0
- package/lib/browser/extension/web-api-terminal.d.ts +72 -0
- package/lib/browser/extension/web-api-terminal.js +3 -0
- package/lib/browser/extension/web-editor-tabs.d.ts +43 -0
- package/lib/browser/extension/web-editor-tabs.js +141 -0
- package/lib/browser/extension/web-extension-api.d.ts +218 -521
- 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-context.d.ts +79 -0
- package/lib/browser/extension/web-extension-context.js +383 -0
- package/lib/browser/extension/web-extension-protocol.d.ts +66 -6
- package/lib/browser/extension/web-extension-protocol.js +42 -1
- package/lib/browser/extension/web-extension-run.d.ts +55 -0
- package/lib/browser/extension/web-extension-run.js +123 -0
- package/lib/browser/extension/web-extensions.d.ts +41 -68
- package/lib/browser/extension/web-extensions.js +184 -516
- package/lib/browser/extension/web-home.d.ts +20 -0
- package/lib/browser/extension/web-home.js +76 -0
- package/lib/browser/extension/web-pages.d.ts +13 -3
- package/lib/browser/extension/web-pages.js +23 -3
- package/lib/browser/extension/web-session-notices.d.ts +37 -0
- package/lib/browser/extension/web-session-notices.js +177 -0
- package/lib/browser/extension/web-sharing.d.ts +2 -0
- package/lib/browser/extension/web-sharing.js +4 -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/game/game-host.d.ts +28 -0
- package/lib/browser/game/game-host.js +163 -0
- package/lib/browser/game/game-loader.d.ts +11 -0
- package/lib/browser/game/game-loader.js +31 -0
- package/lib/browser/game/game-protocol.d.ts +50 -0
- package/lib/browser/game/game-protocol.js +3 -0
- package/lib/browser/game/game-runner.d.ts +28 -0
- package/lib/browser/game/game-runner.js +64 -0
- package/lib/browser/game/game-util.d.ts +30 -0
- package/lib/browser/game/game-util.js +183 -0
- package/lib/browser/game/game-view.d.ts +13 -0
- package/lib/browser/game/game-view.js +68 -0
- package/lib/browser/game/game3d-protocol.d.ts +52 -0
- package/lib/browser/game/game3d-protocol.js +3 -0
- package/lib/browser/game/game3d-runner.d.ts +28 -0
- package/lib/browser/game/game3d-runner.js +153 -0
- package/lib/browser/hooks.d.ts +5 -1
- package/lib/browser/hooks.js +14 -2
- package/lib/browser/i18n/locales.d.ts +105 -3
- package/lib/browser/i18n/messages.d.ts +104 -2
- package/lib/browser/i18n/messages.js +215 -11
- package/lib/browser/index.d.ts +15 -0
- package/lib/browser/index.js +15 -0
- package/lib/browser/links/links-protocol.d.ts +5 -0
- package/lib/browser/links/links.d.ts +19 -7
- package/lib/browser/links/links.js +57 -11
- package/lib/browser/markdown/code-renderers.d.ts +5 -0
- package/lib/browser/markdown/code-renderers.js +40 -0
- package/lib/browser/notices/notices-protocol.d.ts +26 -1
- package/lib/browser/notices/notices.d.ts +3 -1
- package/lib/browser/notices/notices.js +26 -12
- package/lib/browser/notices/session-notices.d.ts +70 -0
- package/lib/browser/notices/session-notices.js +96 -0
- package/lib/browser/offline/device-values.d.ts +56 -0
- package/lib/browser/offline/device-values.js +157 -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 +113 -0
- package/lib/browser/settings/navigation.d.ts +3 -2
- package/lib/browser/settings/navigation.js +4 -3
- package/lib/browser/settings/settings-protocol.d.ts +17 -0
- package/lib/browser/settings/settings-protocol.js +21 -5
- package/lib/browser/state/state-protocol.d.ts +8 -1
- package/lib/browser/state/state.d.ts +2 -0
- package/lib/browser/state/state.js +21 -2
- package/lib/browser/style/base.d.ts +1 -1
- package/lib/browser/style/base.js +27 -1
- package/lib/browser/style/conversation.d.ts +1 -1
- package/lib/browser/style/conversation.js +95 -17
- package/lib/browser/style/device.js +42 -5
- package/lib/browser/style/layout.d.ts +1 -1
- package/lib/browser/style/layout.js +252 -67
- package/lib/browser/style/pages.d.ts +1 -1
- package/lib/browser/style/pages.js +38 -2
- package/lib/browser/style/phone.d.ts +1 -1
- package/lib/browser/style/phone.js +15 -0
- package/lib/browser/style/shell.d.ts +1 -1
- package/lib/browser/style/shell.js +76 -9
- package/lib/browser/style/surfaces.d.ts +1 -1
- package/lib/browser/style/surfaces.js +2 -2
- package/lib/browser/style/tints.d.ts +28 -0
- package/lib/browser/style/tints.js +59 -0
- package/lib/browser/style.js +13 -1
- package/lib/browser/util/composer.d.ts +6 -0
- package/lib/browser/util/composer.js +16 -0
- package/lib/browser/util/desktop.d.ts +19 -1
- package/lib/browser/util/desktop.js +15 -0
- package/lib/browser/util/frame.d.ts +5 -4
- package/lib/browser/util/frame.js +5 -4
- package/lib/browser/util/link.d.ts +18 -0
- package/lib/browser/util/link.js +66 -1
- package/lib/browser/util/markdown.d.ts +22 -2
- package/lib/browser/util/markdown.js +120 -6
- package/lib/browser/util/message.d.ts +5 -0
- package/lib/browser/util/message.js +30 -0
- package/lib/browser/util/process.d.ts +35 -2
- package/lib/browser/util/process.js +80 -5
- package/lib/browser/util/progress.d.ts +19 -1
- package/lib/browser/util/progress.js +57 -4
- package/lib/browser/util/quote.d.ts +20 -0
- package/lib/browser/util/quote.js +61 -0
- package/lib/browser/util/tool.d.ts +19 -2
- package/lib/browser/util/tool.js +70 -2
- package/lib/browser/util/voice.d.ts +49 -6
- package/lib/browser/util/voice.js +271 -26
- package/lib/browser/util/zoom.d.ts +47 -0
- package/lib/browser/util/zoom.js +99 -0
- package/lib/browser/workbench-calls.d.ts +62 -0
- package/lib/browser/workbench-calls.js +150 -0
- package/lib/browser/workbench-protocol.d.ts +36 -3
- package/lib/browser/workbench-util.d.ts +22 -4
- package/lib/browser/workbench-util.js +38 -8
- package/lib/browser/workbench.d.ts +47 -6
- package/lib/browser/workbench.js +189 -41
- package/package.json +14 -11
- package/public/launch.svg +46 -42
|
@@ -1,22 +1,37 @@
|
|
|
1
|
-
import { TaMessageContext, TaSkillUse } from '@celljs/ta-protocol';
|
|
2
|
-
import { ChevronRight, Sparkles } from 'lucide-react';
|
|
1
|
+
import { TaImageNote, TaImageSize, TaMessageContext, TaSkillUse } from '@celljs/ta-protocol';
|
|
2
|
+
import { ChevronRight, CircleAlert, Sparkles } from 'lucide-react';
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import { CustomMessage, ExtensionBoundary, SessionAvatars } from '../extension/extension-view.js';
|
|
4
|
+
import { CustomMessage, ExtensionBoundary, MessageRenderers, SessionAvatars } from '../extension/extension-view.js';
|
|
5
5
|
import { useT } from '../i18n/use-t.js';
|
|
6
|
+
import { Recent } from '../markdown/lazy.js';
|
|
6
7
|
import { MessageUtil } from '../util/message.js';
|
|
7
8
|
import { ProcessUtil } from '../util/process.js';
|
|
8
9
|
import { ToolUtil } from '../util/tool.js';
|
|
9
10
|
import { Callout } from './callout.js';
|
|
10
11
|
import { ASK_CLASS } from './conversation-scroll.js';
|
|
11
12
|
import { Icon } from './icon.js';
|
|
13
|
+
import { Lightbox } from './lightbox.js';
|
|
12
14
|
import { Markdown } from './markdown.js';
|
|
13
|
-
import { TurnFooter, UserFooter } from './message-footer.js';
|
|
15
|
+
import { ModelBreak, TimeBreak, TurnFooter, UserFooter } from './message-footer.js';
|
|
14
16
|
import { useMessageMenu } from './message-menu.js';
|
|
15
17
|
import { RunStatus } from './run-status.js';
|
|
18
|
+
import { SaidText } from './said-text.js';
|
|
16
19
|
import { TaAvatar } from './ta-avatar.js';
|
|
17
20
|
import { ToolView } from './tool-view.js';
|
|
18
21
|
/** The session of the conversation: who answers in it may be drawn by the extension of its group. */
|
|
19
22
|
export const ConversationSession = React.createContext(undefined);
|
|
23
|
+
/** The messages of the conversation still on their way from here, by message, with what can be done with those that failed. */
|
|
24
|
+
const Outbox = React.createContext({ of: new Map() });
|
|
25
|
+
/** A message that did not go: marked as such, with a way to send it again or take it back, as in a messenger. */
|
|
26
|
+
function SendFailed({ sent, actions }) {
|
|
27
|
+
const t = useT();
|
|
28
|
+
return (React.createElement("div", { className: "ta-send-failed", title: sent.failed },
|
|
29
|
+
React.createElement(Icon, { icon: CircleAlert, size: 14 }),
|
|
30
|
+
React.createElement("span", null, t('ta.message.sendFailed')),
|
|
31
|
+
actions && (React.createElement(React.Fragment, null,
|
|
32
|
+
React.createElement("button", { type: "button", className: "ta-link-button", onClick: () => actions.resend(sent.id) }, t('ta.message.resend')),
|
|
33
|
+
React.createElement("button", { type: "button", className: "ta-link-button", onClick: () => actions.discard(sent.id) }, t('ta.message.discard'))))));
|
|
34
|
+
}
|
|
20
35
|
/** Who answers, at the head of a turn: ta, or the avatar the extension of the session's group draws. */
|
|
21
36
|
export function TurnAvatar({ mood }) {
|
|
22
37
|
var _a;
|
|
@@ -31,6 +46,8 @@ export function TurnAvatar({ mood }) {
|
|
|
31
46
|
React.createElement(Avatar, { session: session, mood: mood, size: 24 })));
|
|
32
47
|
}
|
|
33
48
|
const TASK_UPDATE = /^<task_update id="[^"]+" title="([^"]*)" status="(\w+)">\n?([\s\S]*?)\n?<\/task_update>$/;
|
|
49
|
+
/** AssistantTaskUtil.renamedNote. */
|
|
50
|
+
const TASK_RENAMED = /^<task_renamed id="[^"]+" was="[^"]+"/;
|
|
34
51
|
/** What the double of the web client told ta about a task that ended: a note, not something the user said. */
|
|
35
52
|
function TaskUpdate({ title, status, result }) {
|
|
36
53
|
const t = useT();
|
|
@@ -41,29 +58,153 @@ function TaskUpdate({ title, status, result }) {
|
|
|
41
58
|
t(`ta.task.${status}`)),
|
|
42
59
|
React.createElement(Markdown, { text: result })));
|
|
43
60
|
}
|
|
44
|
-
/**
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
61
|
+
/**
|
|
62
|
+
* Where the images of the messages of the user come from that the conversation gave without their bytes
|
|
63
|
+
* (TaShownImage): by the timestamp of the message and the index of the block. Without it they show as their place.
|
|
64
|
+
*/
|
|
65
|
+
export const MessageImages = React.createContext(undefined);
|
|
66
|
+
/** The images shown lately, by message and block: drawn again at once, in this conversation or another view of it. */
|
|
67
|
+
const shownImages = new Recent(48);
|
|
68
|
+
/** The size of the images with their bytes, read once. */
|
|
69
|
+
const sizes = new WeakMap();
|
|
70
|
+
/** How large one image of a message is drawn, at most. */
|
|
71
|
+
const ONE_IMAGE = { width: 220, height: 280 };
|
|
72
|
+
export var UserImageUtil;
|
|
73
|
+
(function (UserImageUtil) {
|
|
74
|
+
/** The images of a message the page can show, with their index among its blocks: with their bytes, or without (TaShownImage). */
|
|
75
|
+
function images(blocks) {
|
|
76
|
+
return blocks.flatMap((block, index) => { var _a; return block.type === 'image' && ((_a = block.mimeType) === null || _a === void 0 ? void 0 : _a.startsWith('image/')) && typeof block.data === 'string' ? [{ block: block, index }] : []; });
|
|
77
|
+
}
|
|
78
|
+
UserImageUtil.images = images;
|
|
79
|
+
/** Its size in pixels: given (TaShownImage), or read from its bytes. */
|
|
80
|
+
function size(block) {
|
|
81
|
+
if (block.width && block.height) {
|
|
82
|
+
return { width: block.width, height: block.height };
|
|
83
|
+
}
|
|
84
|
+
if (!block.data) {
|
|
85
|
+
return undefined;
|
|
86
|
+
}
|
|
87
|
+
if (!sizes.has(block)) {
|
|
88
|
+
sizes.set(block, TaImageSize.of(block.data));
|
|
89
|
+
}
|
|
90
|
+
return sizes.get(block);
|
|
91
|
+
}
|
|
92
|
+
UserImageUtil.size = size;
|
|
93
|
+
/** The box of one image alone, its shape kept, before it loads: nothing moves when it comes. */
|
|
94
|
+
function box(size) {
|
|
95
|
+
if (!size) {
|
|
96
|
+
return undefined;
|
|
97
|
+
}
|
|
98
|
+
const scale = Math.min(1, ONE_IMAGE.width / size.width, ONE_IMAGE.height / size.height);
|
|
99
|
+
return { width: Math.max(1, Math.round(size.width * scale)), aspectRatio: `${size.width} / ${size.height}` };
|
|
100
|
+
}
|
|
101
|
+
UserImageUtil.box = box;
|
|
102
|
+
})(UserImageUtil || (UserImageUtil = {}));
|
|
103
|
+
/** The URLs of the images of a message: those with their bytes at once, the others as `MessageImages` gives them. */
|
|
104
|
+
function useImageSources(images, timestamp) {
|
|
105
|
+
const load = React.useContext(MessageImages);
|
|
106
|
+
const keyOf = (index) => (timestamp === undefined ? undefined : `${timestamp}:${index}`);
|
|
107
|
+
const own = images.map(({ block, index }) => {
|
|
108
|
+
const key = keyOf(index);
|
|
109
|
+
return block.data ? `data:${block.mimeType};base64,${block.data}` : key ? shownImages.get(key) : undefined;
|
|
110
|
+
});
|
|
111
|
+
const [loaded, setLoaded] = React.useState({});
|
|
112
|
+
const wanted = images.filter((image, at) => !own[at] && !loaded[image.index]).map(image => image.index);
|
|
113
|
+
const missing = wanted.join(',');
|
|
114
|
+
// Asked again only for other images: `missing` says which.
|
|
115
|
+
React.useEffect(() => {
|
|
116
|
+
if (!load || timestamp === undefined || !missing) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
let live = true;
|
|
120
|
+
for (const index of missing.split(',').map(Number)) {
|
|
121
|
+
load(timestamp, index).then(image => {
|
|
122
|
+
if (image === null || image === void 0 ? void 0 : image.data) {
|
|
123
|
+
const url = `data:${image.mimeType};base64,${image.data}`;
|
|
124
|
+
shownImages.set(`${timestamp}:${index}`, url);
|
|
125
|
+
if (live) {
|
|
126
|
+
setLoaded(current => ({ ...current, [index]: url }));
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}, () => undefined);
|
|
130
|
+
}
|
|
131
|
+
return () => {
|
|
132
|
+
live = false;
|
|
133
|
+
};
|
|
134
|
+
}, [load, timestamp, missing]);
|
|
135
|
+
// Those with their bytes are kept too: the same message given again without them (the conversation read again) shows them at once.
|
|
136
|
+
React.useEffect(() => {
|
|
137
|
+
images.forEach(({ block, index }, at) => {
|
|
138
|
+
const key = keyOf(index);
|
|
139
|
+
if (block.data && key && own[at]) {
|
|
140
|
+
shownImages.set(key, own[at]);
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
return images.map(({ index }, at) => { var _a; return (_a = own[at]) !== null && _a !== void 0 ? _a : loaded[index]; });
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* The images of a message of the user: one keeps its own shape at the size of a bubble, a few stand as
|
|
148
|
+
* squares of one size, and a click on any of them opens it full size over the page. Each has its place
|
|
149
|
+
* before it loads (its size is known), so that nothing moves as it comes. `timestamp`: of the message,
|
|
150
|
+
* for those given without their bytes (MessageImages).
|
|
151
|
+
*/
|
|
152
|
+
export function UserImages({ blocks, timestamp }) {
|
|
153
|
+
const t = useT();
|
|
154
|
+
const [open, setOpen] = React.useState();
|
|
155
|
+
const images = UserImageUtil.images(blocks);
|
|
156
|
+
const sources = useImageSources(images, timestamp);
|
|
157
|
+
if (images.length === 0) {
|
|
158
|
+
return null;
|
|
159
|
+
}
|
|
160
|
+
const single = images.length === 1 ? UserImageUtil.box(UserImageUtil.size(images[0].block)) : undefined;
|
|
161
|
+
const shown = open !== undefined ? sources[open] : undefined;
|
|
162
|
+
return (React.createElement("div", { className: "ta-user-images", "data-count": Math.min(images.length, 3) },
|
|
163
|
+
images.map(({ index }, at) => (React.createElement("button", { key: index, type: "button", className: "ta-user-image", title: t('ta.markdown.enlarge'), disabled: !sources[at], onClick: () => setOpen(at) }, sources[at] ? (React.createElement("img", { className: "ta-thumb", src: sources[at], alt: "", style: single })) : (React.createElement("span", { className: "ta-thumb ta-thumb-waiting", style: single }))))),
|
|
164
|
+
open !== undefined && shown && (React.createElement(Lightbox, { src: shown, alt: "", onClose: () => setOpen(undefined), onPrevious: open > 0 && sources[open - 1] ? () => setOpen(open - 1) : undefined, onNext: open < images.length - 1 && sources[open + 1] ? () => setOpen(open + 1) : undefined }))));
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* What the user said, in the bubble of a message of theirs, with the pictures they sent with it in the same
|
|
168
|
+
* bubble: the pictures first, the words under them. A message of pictures alone has no bubble of its own.
|
|
169
|
+
* `bubble` is the class of that bubble, which a conversation and the double have of their own.
|
|
170
|
+
*/
|
|
171
|
+
export function UserSaid({ blocks, text, bubble = 'ta-bubble', timestamp }) {
|
|
172
|
+
if (UserImageUtil.images(blocks).length === 0) {
|
|
173
|
+
return text ? (React.createElement("div", { className: bubble },
|
|
174
|
+
React.createElement(SaidText, { text: text }))) : null;
|
|
175
|
+
}
|
|
176
|
+
return (React.createElement("div", { className: `${bubble} ta-bubble-media${text ? '' : ' ta-bubble-bare'}` },
|
|
177
|
+
React.createElement(UserImages, { blocks: blocks, timestamp: timestamp }),
|
|
178
|
+
text && React.createElement(SaidText, { text: text, className: "ta-bubble-text" })));
|
|
48
179
|
}
|
|
49
180
|
function UserMessage({ message }) {
|
|
50
|
-
var _a;
|
|
51
181
|
const blocks = MessageUtil.blocks(message);
|
|
52
|
-
const
|
|
182
|
+
const said = MessageUtil.text(blocks).trim();
|
|
183
|
+
if (TASK_RENAMED.test(said)) {
|
|
184
|
+
// The double's conversation opened as a conversation: what told it a task's new id is for it only.
|
|
185
|
+
return null;
|
|
186
|
+
}
|
|
187
|
+
const update = TASK_UPDATE.exec(said);
|
|
53
188
|
if (update) {
|
|
54
189
|
return React.createElement(TaskUpdate, { title: update[1], status: update[2], result: update[3] });
|
|
55
190
|
}
|
|
56
|
-
const
|
|
191
|
+
const { text, copied, skill } = userWords(blocks);
|
|
192
|
+
return React.createElement(UserBubble, { message: message, blocks: blocks, text: text, copied: copied, skill: skill });
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* What a message of the user's shows, in a conversation and the double alike: without the context and the notes of
|
|
196
|
+
* pictures sent with it, a skill they ran (`/skill:name`) taken out of the words as the skill; `copied` is what they typed.
|
|
197
|
+
*/
|
|
198
|
+
export function userWords(blocks) {
|
|
199
|
+
var _a;
|
|
200
|
+
const said = TaImageNote.strip(TaMessageContext.strip(MessageUtil.text(blocks))).trim();
|
|
57
201
|
const skill = TaSkillUse.parse(said);
|
|
58
|
-
|
|
59
|
-
return React.createElement(UserBubble, { message: message, blocks: blocks, text: (_a = skill.message) !== null && _a !== void 0 ? _a : '', copied: TaSkillUse.command(skill), skill: skill });
|
|
60
|
-
}
|
|
61
|
-
return React.createElement(UserBubble, { message: message, blocks: blocks, text: said, copied: said });
|
|
202
|
+
return skill ? { text: (_a = skill.message) !== null && _a !== void 0 ? _a : '', copied: TaSkillUse.command(skill), skill } : { text: said, copied: said };
|
|
62
203
|
}
|
|
63
204
|
/** pi's first line of a skill it read, for the model: the path is in the title of the skill's line. */
|
|
64
205
|
const SKILL_BASE = /^References are relative to [^\n]*\n+/;
|
|
65
206
|
/** A skill the user ran: one line with its name, which opens to the skill's file, as a tool call opens. */
|
|
66
|
-
function SkillUse({ skill }) {
|
|
207
|
+
export function SkillUse({ skill }) {
|
|
67
208
|
const t = useT();
|
|
68
209
|
const [open, setOpen] = React.useState(false);
|
|
69
210
|
return (React.createElement("div", { className: "ta-skill-use" },
|
|
@@ -77,10 +218,17 @@ function SkillUse({ skill }) {
|
|
|
77
218
|
}
|
|
78
219
|
function UserBubble({ message, blocks, text, copied, skill, }) {
|
|
79
220
|
const [menu, onContextMenu] = useMessageMenu({ kind: 'user', message, text: copied });
|
|
221
|
+
const outbox = React.useContext(Outbox);
|
|
222
|
+
const sent = outbox.of.get(message);
|
|
223
|
+
if (sent) {
|
|
224
|
+
// Not in the session yet: nothing to branch from or rewind to.
|
|
225
|
+
return (React.createElement("div", { className: `ta-message ta-user ${sent.failed ? 'ta-user-failed' : 'ta-user-sending'}` },
|
|
226
|
+
React.createElement(UserSaid, { blocks: blocks, text: text, timestamp: message.timestamp }),
|
|
227
|
+
sent.failed ? React.createElement(SendFailed, { sent: sent, actions: outbox.actions }) : React.createElement("div", { className: "ta-footer" })));
|
|
228
|
+
}
|
|
80
229
|
return (React.createElement("div", { className: "ta-message ta-user", onContextMenu: onContextMenu },
|
|
81
|
-
React.createElement(UserImages, { blocks: blocks }),
|
|
82
230
|
skill && React.createElement(SkillUse, { skill: skill }),
|
|
83
|
-
|
|
231
|
+
React.createElement(UserSaid, { blocks: blocks, text: text, timestamp: message.timestamp }),
|
|
84
232
|
React.createElement(UserFooter, { message: message, text: copied }),
|
|
85
233
|
menu));
|
|
86
234
|
}
|
|
@@ -95,6 +243,17 @@ const ThinkingStep = React.memo(function ThinkingStep({ text, tagged = true }) {
|
|
|
95
243
|
!open && React.createElement("span", { className: "ta-step-preview" }, ProcessUtil.preview(text))),
|
|
96
244
|
open && React.createElement("div", { className: "ta-thinking-text" }, text)));
|
|
97
245
|
});
|
|
246
|
+
/** The summary an agent compacted its context to: folded into one line, it opens to the whole summary. */
|
|
247
|
+
const SummaryStep = React.memo(function SummaryStep({ text }) {
|
|
248
|
+
const t = useT();
|
|
249
|
+
const [open, setOpen] = React.useState(false);
|
|
250
|
+
return (React.createElement("div", { className: "ta-step-summary" },
|
|
251
|
+
React.createElement("button", { type: "button", className: "ta-step-toggle", "aria-expanded": open, onClick: () => setOpen(!open) },
|
|
252
|
+
React.createElement("span", { className: "ta-status ta-status-thought" }),
|
|
253
|
+
React.createElement("span", { className: "ta-step-tag" }, t('ta.message.compacted')),
|
|
254
|
+
React.createElement(Icon, { icon: ChevronRight, size: 14, className: "ta-step-chevron" })),
|
|
255
|
+
open && React.createElement("div", { className: "ta-thinking-text" }, text)));
|
|
256
|
+
});
|
|
98
257
|
const TextStep = React.memo(function TextStep({ text }) {
|
|
99
258
|
return (React.createElement("div", { className: "ta-step-text" },
|
|
100
259
|
React.createElement("span", { className: "ta-status ta-status-thought" }),
|
|
@@ -107,12 +266,68 @@ function Step({ step, results, tools, tagged }) {
|
|
|
107
266
|
return React.createElement(ThinkingStep, { text: step.text, tagged: tagged });
|
|
108
267
|
case 'text':
|
|
109
268
|
return React.createElement(TextStep, { text: step.text });
|
|
269
|
+
case 'summary':
|
|
270
|
+
return React.createElement(SummaryStep, { text: step.text });
|
|
110
271
|
default: {
|
|
111
272
|
const { id = '', name = '', arguments: args } = step.call;
|
|
112
273
|
return (React.createElement(ToolView, { id: id, name: name, args: (_a = args) !== null && _a !== void 0 ? _a : {}, run: id ? tools[id] : undefined, message: id ? results.get(id) : undefined, runs: tools }));
|
|
113
274
|
}
|
|
114
275
|
}
|
|
115
276
|
}
|
|
277
|
+
/** How long the steps of a turn take to fold or open, and how. */
|
|
278
|
+
const FOLD_MS = 220;
|
|
279
|
+
const FOLD_EASE = 'cubic-bezier(0.2, 0.8, 0.2, 1)';
|
|
280
|
+
/**
|
|
281
|
+
* Whether the steps of `ref` are in the page: they fold and open in a motion, so that what is under them
|
|
282
|
+
* slides to its place rather than jumps there (as when a turn ends and its steps fold under the eyes of
|
|
283
|
+
* the user). While they fold they stay; without motion they come and go at once. `slideOpen`: they open in
|
|
284
|
+
* a motion too (opened by the user); steps that come while ta works come in as steps do, without it.
|
|
285
|
+
*/
|
|
286
|
+
function useFold(open, ref, slideOpen) {
|
|
287
|
+
const [closing, setClosing] = React.useState(false);
|
|
288
|
+
const [was, setWas] = React.useState(open);
|
|
289
|
+
if (was !== open) {
|
|
290
|
+
setWas(open);
|
|
291
|
+
setClosing(!open);
|
|
292
|
+
}
|
|
293
|
+
const opened = React.useRef(open);
|
|
294
|
+
React.useLayoutEffect(() => {
|
|
295
|
+
const opening = open && !opened.current && slideOpen;
|
|
296
|
+
opened.current = open;
|
|
297
|
+
const element = ref.current;
|
|
298
|
+
if (!opening && !closing) {
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
if (!element || typeof element.animate !== 'function' || document.documentElement.hasAttribute('data-reduce-motion')) {
|
|
302
|
+
setClosing(false);
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
const style = getComputedStyle(element);
|
|
306
|
+
const full = {
|
|
307
|
+
height: `${element.offsetHeight}px`,
|
|
308
|
+
paddingTop: style.paddingTop,
|
|
309
|
+
paddingBottom: style.paddingBottom,
|
|
310
|
+
marginTop: style.marginTop,
|
|
311
|
+
marginBottom: style.marginBottom,
|
|
312
|
+
opacity: 1,
|
|
313
|
+
};
|
|
314
|
+
const none = { height: '0px', paddingTop: '0px', paddingBottom: '0px', marginTop: '0px', marginBottom: '0px', opacity: 0 };
|
|
315
|
+
element.style.overflow = 'hidden';
|
|
316
|
+
// Folded, the steps stay at no height until they go: not drawn whole again for the frame before.
|
|
317
|
+
const animation = element.animate(opening ? [none, full] : [full, none], { duration: FOLD_MS, easing: FOLD_EASE, fill: opening ? 'none' : 'forwards' });
|
|
318
|
+
animation.onfinish = () => {
|
|
319
|
+
element.style.overflow = '';
|
|
320
|
+
if (!opening) {
|
|
321
|
+
setClosing(false);
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
return () => {
|
|
325
|
+
animation.cancel();
|
|
326
|
+
element.style.overflow = '';
|
|
327
|
+
};
|
|
328
|
+
}, [open, closing, ref, slideOpen]);
|
|
329
|
+
return open || closing;
|
|
330
|
+
}
|
|
116
331
|
/**
|
|
117
332
|
* The head of a turn and its work: the work in one line, "N steps", open while ta is at it, then folded,
|
|
118
333
|
* so that a long conversation reads as what was asked and what came of it. Before the first step the
|
|
@@ -123,10 +338,14 @@ export function Process({ steps, active, results, tools, leading, status, }) {
|
|
|
123
338
|
const [manual, setManual] = React.useState();
|
|
124
339
|
const [showAll, setShowAll] = React.useState(false);
|
|
125
340
|
const id = React.useId();
|
|
341
|
+
const stepsRef = React.useRef(null);
|
|
126
342
|
const { steps: count, failed } = ToolUtil.count(ProcessUtil.tools(steps), results, tools);
|
|
127
343
|
// Open while it works, then folded; a failed step says so on the head, quietly.
|
|
128
344
|
const open = manual !== null && manual !== void 0 ? manual : active;
|
|
345
|
+
const shown = useFold(open && steps.length > 0, stepsRef, !active);
|
|
129
346
|
const folded = ProcessUtil.fold(steps, active, showAll);
|
|
347
|
+
// The earlier steps count as the head does: the calls among them, not the thoughts.
|
|
348
|
+
const earlier = folded.hidden ? ToolUtil.count(ProcessUtil.tools(steps.slice(0, folded.hidden)), results, tools).steps : 0;
|
|
130
349
|
// Only thoughts: the head already says so, the steps need not say it again.
|
|
131
350
|
const thoughtOnly = steps.every(step => step.kind === 'thinking');
|
|
132
351
|
const title = count ? t(active ? 'ta.process.running' : 'ta.process.done', { count }) : t(active ? 'ta.process.thinking' : 'ta.process.thought');
|
|
@@ -139,15 +358,23 @@ export function Process({ steps, active, results, tools, leading, status, }) {
|
|
|
139
358
|
"\u00B7 ",
|
|
140
359
|
t('ta.process.failed', { count: failed })),
|
|
141
360
|
React.createElement(Icon, { icon: ChevronRight, size: 14, className: "ta-process-chevron" }))) : (status)),
|
|
142
|
-
|
|
143
|
-
folded.hidden > 0 && (React.createElement("button", { type: "button", className: "ta-link ta-more", onClick: () => setShowAll(true) }, t('ta.process.earlier', { count:
|
|
361
|
+
shown && (React.createElement("div", { id: id, ref: stepsRef, className: "ta-process-steps" },
|
|
362
|
+
folded.hidden > 0 && (React.createElement("button", { type: "button", className: "ta-link ta-more", onClick: () => setShowAll(true) }, earlier ? t('ta.process.earlier', { count: earlier }) : t('ta.process.showAll'))),
|
|
144
363
|
folded.steps.map(step => (React.createElement(Step, { key: step.key, step: step, results: results, tools: tools, tagged: !thoughtOnly })))))));
|
|
145
364
|
}
|
|
146
365
|
/** A turn that has shown nothing yet: what ta does goes on its head. */
|
|
147
366
|
export function quiet(item) {
|
|
148
367
|
return (item === null || item === void 0 ? void 0 : item.kind) === 'turn' && item.active && !item.steps.length && !item.reply.some(text => text.trim());
|
|
149
368
|
}
|
|
150
|
-
|
|
369
|
+
/**
|
|
370
|
+
* A turn that ends with its steps, no words after them: the line of what ta does is one more of its steps
|
|
371
|
+
* (.ta-run-steps). Said by the class, not by `:last-child` in `:has()`: WebKit does not style the line
|
|
372
|
+
* again when the words under the steps go into them, and it stayed out of line until something else drew.
|
|
373
|
+
*/
|
|
374
|
+
export function endsInSteps(item) {
|
|
375
|
+
return (item === null || item === void 0 ? void 0 : item.kind) === 'turn' && item.steps.length > 0 && !item.reply.length;
|
|
376
|
+
}
|
|
377
|
+
function Turn({ item, tools, mood, status, latest, }) {
|
|
151
378
|
var _a;
|
|
152
379
|
const t = useT();
|
|
153
380
|
const session = React.useContext(ConversationSession);
|
|
@@ -155,13 +382,19 @@ function Turn({ item, tools, mood, status }) {
|
|
|
155
382
|
const { errorMessage } = ((_a = item.last) !== null && _a !== void 0 ? _a : {});
|
|
156
383
|
const stopReason = MessageUtil.stopReason(item.last);
|
|
157
384
|
const reply = item.reply.join('\n\n').trim();
|
|
158
|
-
const [menu, onContextMenu] = useMessageMenu({
|
|
385
|
+
const [menu, onContextMenu] = useMessageMenu({
|
|
386
|
+
kind: 'turn',
|
|
387
|
+
last: item.active ? undefined : item.last,
|
|
388
|
+
reply: item.active ? '' : reply,
|
|
389
|
+
session,
|
|
390
|
+
messages: item.messages,
|
|
391
|
+
});
|
|
159
392
|
return (React.createElement("div", { className: `ta-message ta-assistant ${item.active ? 'ta-turn-live' : ''}`, onContextMenu: onContextMenu },
|
|
160
393
|
React.createElement(Process, { steps: item.steps, active: item.active, results: results, tools: tools, leading: React.createElement(TurnAvatar, { mood: mood }), status: status }),
|
|
161
|
-
item.reply.map((text, index) => (React.createElement(Markdown, { key: index, text: text }))),
|
|
394
|
+
item.reply.map((text, index) => (React.createElement(Markdown, { key: index, text: text, streaming: item.active && index === item.reply.length - 1 }))),
|
|
162
395
|
!item.active && stopReason === 'error' && errorMessage && React.createElement(Callout, { level: "error" }, errorMessage),
|
|
163
396
|
!item.active && stopReason === 'aborted' && React.createElement("div", { className: "ta-muted ta-small" }, t('ta.message.stopped')),
|
|
164
|
-
!item.active && React.createElement(TurnFooter, { messages: item.messages, last: item.last, reply: reply, session: session }),
|
|
397
|
+
!item.active && React.createElement(TurnFooter, { messages: item.messages, last: item.last, reply: reply, session: session, latest: latest }),
|
|
165
398
|
menu));
|
|
166
399
|
}
|
|
167
400
|
/** `!command` of a user, which pi records as its own kind of message. */
|
|
@@ -204,25 +437,35 @@ function Message({ item }) {
|
|
|
204
437
|
* One item of the conversation. The store replaces only the message that changed, so an item draws
|
|
205
438
|
* again only when one of its messages did, or, while ta is at it, when a tool run did.
|
|
206
439
|
*/
|
|
207
|
-
const ThreadRow = React.memo(function ThreadRow({ item, tools, mood, status }) {
|
|
208
|
-
return item.kind === 'turn' ? React.createElement(Turn, { item: item, tools: tools, mood: mood, status: status }) : React.createElement(Message, { item: item });
|
|
440
|
+
const ThreadRow = React.memo(function ThreadRow({ item, tools, mood, status, latest, }) {
|
|
441
|
+
return item.kind === 'turn' ? React.createElement(Turn, { item: item, tools: tools, mood: mood, status: status, latest: latest }) : React.createElement(Message, { item: item });
|
|
209
442
|
}, (previous, next) => previous.mood === next.mood &&
|
|
210
443
|
previous.status === next.status &&
|
|
444
|
+
previous.latest === next.latest &&
|
|
211
445
|
ProcessUtil.same(previous.item, next.item) &&
|
|
212
446
|
(next.item.kind === 'message' || !next.item.active || previous.tools === next.tools));
|
|
213
447
|
/** The last rows, which change and are in view, are always laid out. */
|
|
214
448
|
const SETTLED_AFTER = 4;
|
|
215
|
-
/** The conversation; tool results show with the calls they answer. */
|
|
216
|
-
export function MessageList({ state }) {
|
|
449
|
+
/** The conversation; tool results show with the calls they answer. `rows`: only its latest rows are drawn, more as asked. */
|
|
450
|
+
export function MessageList({ state, outbox, rows }) {
|
|
217
451
|
var _a;
|
|
218
|
-
const
|
|
452
|
+
const renderers = React.useContext(MessageRenderers);
|
|
453
|
+
const items = React.useMemo(() => ProcessUtil.items(state.messages, state.working, state.start, renderers), [state.messages, state.working, state.start, renderers]);
|
|
454
|
+
const breaks = React.useMemo(() => ProcessUtil.timeBreaks(ProcessUtil.starts(items), index => ProcessUtil.shown(items[index], renderers)), [items, renderers]);
|
|
455
|
+
const models = React.useMemo(() => ProcessUtil.modelBreaks(items), [items]);
|
|
456
|
+
const sent = React.useMemo(() => { var _a; return ({ of: new Map(((_a = state.outbox) !== null && _a !== void 0 ? _a : []).map(message => [message.message, message])), actions: outbox }); }, [state.outbox, outbox]);
|
|
457
|
+
// The rows held back: those before the latest `rows.rows`.
|
|
458
|
+
const from = rows ? Math.max(0, items.length - rows.rows) : 0;
|
|
459
|
+
if (rows) {
|
|
460
|
+
rows.hidden.current = from;
|
|
461
|
+
}
|
|
219
462
|
// Rows of earlier messages put in front are laid out once before they may skip it (content-visibility):
|
|
220
463
|
// their height is then known, and the view does not move as they come near it.
|
|
221
|
-
const firstKey = React.useRef((_a = items[
|
|
222
|
-
const front = Math.max(
|
|
464
|
+
const firstKey = React.useRef((_a = items[from]) === null || _a === void 0 ? void 0 : _a.key);
|
|
465
|
+
const front = Math.max(from, items.findIndex(item => item.key === firstKey.current));
|
|
223
466
|
React.useLayoutEffect(() => {
|
|
224
467
|
var _a;
|
|
225
|
-
firstKey.current = (_a = items[
|
|
468
|
+
firstKey.current = (_a = items[from]) === null || _a === void 0 ? void 0 : _a.key;
|
|
226
469
|
});
|
|
227
470
|
// Rows that come after the list is drawn come in with a motion; those of a conversation opened or loaded again, still.
|
|
228
471
|
const still = React.useRef(items.length);
|
|
@@ -240,8 +483,8 @@ export function MessageList({ state }) {
|
|
|
240
483
|
// What ta does while it works: on the head of a turn that shows nothing yet, else under all it has shown.
|
|
241
484
|
const status = state.working || state.compacting ? React.createElement(RunStatus, { state: state }) : undefined;
|
|
242
485
|
const onHead = status && quiet(last);
|
|
243
|
-
return (React.createElement(
|
|
244
|
-
items.map((item, index) => (React.createElement("div", { key: item.key, className: [
|
|
486
|
+
return (React.createElement(Outbox.Provider, { value: sent },
|
|
487
|
+
items.map((item, index) => index < from ? null : (React.createElement("div", { key: item.key, className: [
|
|
245
488
|
'ta-thread-item',
|
|
246
489
|
index >= front && index < items.length - SETTLED_AFTER && 'ta-settled',
|
|
247
490
|
index === items.length - 1 && 'ta-thread-last',
|
|
@@ -250,7 +493,9 @@ export function MessageList({ state }) {
|
|
|
250
493
|
]
|
|
251
494
|
.filter(Boolean)
|
|
252
495
|
.join(' ') },
|
|
253
|
-
React.createElement(
|
|
254
|
-
|
|
496
|
+
breaks[index] !== undefined && React.createElement(TimeBreak, { timestamp: breaks[index] }),
|
|
497
|
+
models[index] && React.createElement(ModelBreak, { model: models[index] }),
|
|
498
|
+
React.createElement(ThreadRow, { item: item, tools: state.tools, mood: item.kind === 'turn' ? ProcessUtil.mood(item, index === lastTurn, waiting) : 'idle', status: onHead && item === last ? status : undefined, latest: index === lastTurn })))),
|
|
499
|
+
status && !onHead && React.createElement("div", { className: `ta-run-line ${endsInSteps(last) ? 'ta-run-steps' : ''}` }, status)));
|
|
255
500
|
}
|
|
256
501
|
//# sourceMappingURL=message-list.js.map
|
|
@@ -11,10 +11,12 @@ export type MessageMenuSubject = {
|
|
|
11
11
|
last?: SessionMessage;
|
|
12
12
|
reply: string;
|
|
13
13
|
session?: TaSessionInfo;
|
|
14
|
+
messages?: SessionMessage[];
|
|
14
15
|
};
|
|
15
16
|
/**
|
|
16
17
|
* The menu of a message under a held finger, as in WeChat: copy it, select its text (in a sheet of its own, as
|
|
17
|
-
* WeChat shows a message to select from), and what its footer does
|
|
18
|
+
* WeChat shows a message to select from), and what its footer does; above them, what the footer says (when,
|
|
19
|
+
* what the turn took), since a touch screen shows no footer but that of the last turn.
|
|
18
20
|
* On a touch screen only; a right click elsewhere keeps the menu of the browser, which copies a selection.
|
|
19
21
|
*/
|
|
20
22
|
export declare function useMessageMenu(subject: MessageMenuSubject): [React.ReactNode, ((event: React.MouseEvent<HTMLElement>) => void) | undefined];
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useDevice } from '../device/device.js';
|
|
3
3
|
import { useT } from '../i18n/use-t.js';
|
|
4
|
+
import { MessageUtil } from '../util/message.js';
|
|
5
|
+
import { ProgressUtil } from '../util/progress.js';
|
|
4
6
|
import { useContextMenu } from './context-menu.js';
|
|
5
|
-
import { MessageActions, MessageFooterUtil } from './message-footer.js';
|
|
7
|
+
import { MessageActions, MessageFooterUtil, useTimeLabel } from './message-footer.js';
|
|
6
8
|
import { WebDialog } from './web-dialog.js';
|
|
7
9
|
/** Where a held finger is something else's: a link, a button, code, an image, the steps of a turn. */
|
|
8
10
|
const OWN_PRESS = 'a, button, img, video, .ta-code, pre, .ta-process-steps, .ta-footer';
|
|
9
11
|
/**
|
|
10
12
|
* The menu of a message under a held finger, as in WeChat: copy it, select its text (in a sheet of its own, as
|
|
11
|
-
* WeChat shows a message to select from), and what its footer does
|
|
13
|
+
* WeChat shows a message to select from), and what its footer does; above them, what the footer says (when,
|
|
14
|
+
* what the turn took), since a touch screen shows no footer but that of the last turn.
|
|
12
15
|
* On a touch screen only; a right click elsewhere keeps the menu of the browser, which copies a selection.
|
|
13
16
|
*/
|
|
14
17
|
export function useMessageMenu(subject) {
|
|
15
18
|
const t = useT();
|
|
19
|
+
const timeLabel = useTimeLabel();
|
|
16
20
|
const touch = useDevice(device => device.touch);
|
|
17
21
|
const actions = React.useContext(MessageActions);
|
|
18
22
|
const [menu, open] = useContextMenu();
|
|
@@ -33,7 +37,12 @@ export function useMessageMenu(subject) {
|
|
|
33
37
|
const items = [];
|
|
34
38
|
const text = subject.kind === 'user' ? subject.text : subject.reply;
|
|
35
39
|
if (text) {
|
|
36
|
-
items.push({ label: t('ta.copy'), run: () => copy(text) }
|
|
40
|
+
items.push({ label: t('ta.copy'), run: () => copy(text) });
|
|
41
|
+
if (actions === null || actions === void 0 ? void 0 : actions.quote) {
|
|
42
|
+
const quote = actions.quote;
|
|
43
|
+
items.push({ label: t('ta.message.quote'), run: () => quote(text) });
|
|
44
|
+
}
|
|
45
|
+
items.push({ label: t('ta.message.selectText'), run: () => setSelecting(text) });
|
|
37
46
|
}
|
|
38
47
|
if (subject.kind === 'user' && branches) {
|
|
39
48
|
items.push('-', { label: t('ta.message.forkBefore'), run: () => actions.fork(subject.message, 'before') }, { label: t('ta.message.rewind'), run: () => actions.rewind(subject.message) });
|
|
@@ -46,7 +55,18 @@ export function useMessageMenu(subject) {
|
|
|
46
55
|
items.push({ label: t('ta.message.debug'), run: () => copy(MessageFooterUtil.debugInfo(last, subject.session), t('ta.message.debugCopied')) });
|
|
47
56
|
}
|
|
48
57
|
if (items.length) {
|
|
49
|
-
|
|
58
|
+
const said = subject.kind === 'user' ? subject.message : subject.last;
|
|
59
|
+
const at = said === null || said === void 0 ? void 0 : said.timestamp;
|
|
60
|
+
const usage = subject.kind === 'turn' && subject.messages ? MessageUtil.usage(subject.messages) : undefined;
|
|
61
|
+
const caption = [
|
|
62
|
+
at !== undefined && timeLabel(at),
|
|
63
|
+
usage &&
|
|
64
|
+
(usage.input > 0 || usage.output > 0) &&
|
|
65
|
+
`${t('ta.message.used')} ↑${ProgressUtil.format(usage.input)} ↓${ProgressUtil.format(usage.output)}${usage.cost > 0 ? ` ${MessageUtil.cost(usage.cost)}` : ''}`,
|
|
66
|
+
]
|
|
67
|
+
.filter(Boolean)
|
|
68
|
+
.join(' · ');
|
|
69
|
+
open(event, items, caption || undefined);
|
|
50
70
|
}
|
|
51
71
|
};
|
|
52
72
|
return [
|
|
@@ -60,6 +60,7 @@ export var ModelPickerUtil;
|
|
|
60
60
|
key: 'model',
|
|
61
61
|
label: t('ta.session.model'),
|
|
62
62
|
icon: React.createElement(Icon, { icon: Box, size: 16 }),
|
|
63
|
+
setting: true,
|
|
63
64
|
detail: value ? name(source, value) : t('ta.session.noModel'),
|
|
64
65
|
searchLabel: t('ta.model.search'),
|
|
65
66
|
items: options(source, value).map(option => ({ ...option, run: () => pick(option.key) })),
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import type { TaWebExtensionInfo } from '@celljs/ta-protocol';
|
|
2
|
+
import type { Hold } from '../device/hold.js';
|
|
1
3
|
import { type WebViewEntry } from '../extension/web-extension-protocol.js';
|
|
4
|
+
import { type WebPageInfo } from '../extension/web-pages.js';
|
|
2
5
|
import { type NavigationSetting } from '../settings/navigation.js';
|
|
3
6
|
import type { ContextMenuItem } from './context-menu.js';
|
|
4
7
|
import type { PhoneTab } from './phone-shell.js';
|
|
@@ -8,6 +11,17 @@ import { type SideList } from './side-lists.js';
|
|
|
8
11
|
* extensions started on open from the launcher (ta-launcher.md), as they come and go.
|
|
9
12
|
*/
|
|
10
13
|
export declare function railPages(views: WebViewEntry[]): WebViewEntry[];
|
|
14
|
+
/**
|
|
15
|
+
* What an entry of the navigation does while it is held, without a menu: the double opens and listens to what is
|
|
16
|
+
* said to it, the chats open a new conversation that does (HeldTalk). None where the browser cannot recognize
|
|
17
|
+
* speech: the entries are a tap. The chats are the list without an id.
|
|
18
|
+
*/
|
|
19
|
+
export interface EntryHolds {
|
|
20
|
+
double?: Hold;
|
|
21
|
+
chats?: Hold;
|
|
22
|
+
}
|
|
23
|
+
/** The hold of an entry of the navigation: the double's, the chats'; pages keep their menus (their fold and the settings). */
|
|
24
|
+
export declare function entryHold(id: string, double: boolean | undefined, holds: EntryHolds): Hold | undefined;
|
|
11
25
|
/** The id of Discover where the navigation has the ids of pages: a tab of a phone, `current` of the rail. */
|
|
12
26
|
export declare const DISCOVER = "ta/discover";
|
|
13
27
|
/** The last tab of a phone: the account and the settings, as the menu of the account on the rail. */
|
|
@@ -25,22 +39,42 @@ export interface Navigation {
|
|
|
25
39
|
/** Those in the navigation, and those under Discover (NavigationUtil.arrange). */
|
|
26
40
|
nav: WebViewEntry[];
|
|
27
41
|
discover: WebViewEntry[];
|
|
42
|
+
/**
|
|
43
|
+
* The pages of installed extensions started on open (ta-launcher.md): under Discover after `discover`,
|
|
44
|
+
* never in the navigation, their extensions loaded only when opened.
|
|
45
|
+
*/
|
|
46
|
+
onOpen: WebPageInfo[];
|
|
28
47
|
setting: NavigationSetting;
|
|
29
48
|
pin(id: string): void;
|
|
30
49
|
fold(id: string): void;
|
|
31
50
|
update(setting: NavigationSetting): void;
|
|
32
51
|
}
|
|
33
|
-
/**
|
|
34
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Where the pages of the rail go: the double's first when no sidebar view lists it, the rest as the user put them
|
|
54
|
+
* in the room there is. `own`: Discover lists pages of extensions started on open, so it is there in any case.
|
|
55
|
+
*/
|
|
56
|
+
export declare function places(views: WebViewEntry[], setting: NavigationSetting, handheld: boolean, own?: boolean): Pick<Navigation, 'home' | 'pages' | 'nav' | 'discover'>;
|
|
57
|
+
/**
|
|
58
|
+
* Where each page of the extensions is on this device (WebPageInfo.place): in the navigation, under Discover, or
|
|
59
|
+
* in a list; the pages of a kind that a page lists (the Games page) are only there.
|
|
60
|
+
*/
|
|
61
|
+
export declare function arrangeViews(views: readonly WebViewEntry[], onOpen: readonly {
|
|
62
|
+
info: TaWebExtensionInfo;
|
|
63
|
+
}[], setting: NavigationSetting, handheld: boolean, infoOf: (extensionId: string) => TaWebExtensionInfo | undefined, kinds: ReadonlySet<string>): (view: WebViewEntry) => 'navigation' | 'discover' | 'list';
|
|
64
|
+
/** Discover is in the navigation: some pages are under it. */
|
|
65
|
+
export declare function hasDiscover(navigation: Pick<Navigation, 'discover' | 'onOpen'>): boolean;
|
|
35
66
|
export interface PhoneTabLabels {
|
|
36
67
|
discover: string;
|
|
37
68
|
me: string;
|
|
38
69
|
fold: string;
|
|
39
70
|
/** The settings of the navigation, in the menu of a page's tab and of Discover. */
|
|
40
71
|
settings: Exclude<ContextMenuItem, '-'>;
|
|
72
|
+
/** What a held tab of the double or of the chats does. */
|
|
73
|
+
holds: EntryHolds;
|
|
41
74
|
}
|
|
42
75
|
/**
|
|
43
76
|
* The tabs at the bottom of a phone, as a messaging app has them: the lists of the sidebar, the chats, the pages
|
|
44
|
-
* in the navigation, Discover once some are under it, Me. A held tab of a page puts it under Discover
|
|
77
|
+
* in the navigation, Discover once some are under it, Me. A held tab of a page puts it under Discover; that of the
|
|
78
|
+
* double talks to it while it is held, and that of the chats to a new conversation.
|
|
45
79
|
*/
|
|
46
80
|
export declare function phoneTabs(lists: SideList[], navigation: Navigation, labels: PhoneTabLabels): PhoneTab[];
|