@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
|
@@ -33,31 +33,50 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.ConversationSession = void 0;
|
|
36
|
+
exports.UserImageUtil = exports.MessageImages = exports.ConversationSession = void 0;
|
|
37
37
|
exports.TurnAvatar = TurnAvatar;
|
|
38
38
|
exports.UserImages = UserImages;
|
|
39
|
+
exports.UserSaid = UserSaid;
|
|
40
|
+
exports.userWords = userWords;
|
|
41
|
+
exports.SkillUse = SkillUse;
|
|
39
42
|
exports.Process = Process;
|
|
40
43
|
exports.quiet = quiet;
|
|
44
|
+
exports.endsInSteps = endsInSteps;
|
|
41
45
|
exports.MessageList = MessageList;
|
|
42
46
|
const ta_protocol_1 = require("@celljs/ta-protocol");
|
|
43
47
|
const lucide_react_1 = require("lucide-react");
|
|
44
48
|
const React = __importStar(require("react"));
|
|
45
49
|
const extension_view_1 = require("../extension/extension-view");
|
|
46
50
|
const use_t_1 = require("../i18n/use-t");
|
|
51
|
+
const lazy_1 = require("../markdown/lazy");
|
|
47
52
|
const message_1 = require("../util/message");
|
|
48
53
|
const process_1 = require("../util/process");
|
|
49
54
|
const tool_1 = require("../util/tool");
|
|
50
55
|
const callout_1 = require("./callout");
|
|
51
56
|
const conversation_scroll_1 = require("./conversation-scroll");
|
|
52
57
|
const icon_1 = require("./icon");
|
|
58
|
+
const lightbox_1 = require("./lightbox");
|
|
53
59
|
const markdown_1 = require("./markdown");
|
|
54
60
|
const message_footer_1 = require("./message-footer");
|
|
55
61
|
const message_menu_1 = require("./message-menu");
|
|
56
62
|
const run_status_1 = require("./run-status");
|
|
63
|
+
const said_text_1 = require("./said-text");
|
|
57
64
|
const ta_avatar_1 = require("./ta-avatar");
|
|
58
65
|
const tool_view_1 = require("./tool-view");
|
|
59
66
|
/** The session of the conversation: who answers in it may be drawn by the extension of its group. */
|
|
60
67
|
exports.ConversationSession = React.createContext(undefined);
|
|
68
|
+
/** The messages of the conversation still on their way from here, by message, with what can be done with those that failed. */
|
|
69
|
+
const Outbox = React.createContext({ of: new Map() });
|
|
70
|
+
/** A message that did not go: marked as such, with a way to send it again or take it back, as in a messenger. */
|
|
71
|
+
function SendFailed({ sent, actions }) {
|
|
72
|
+
const t = (0, use_t_1.useT)();
|
|
73
|
+
return (React.createElement("div", { className: "ta-send-failed", title: sent.failed },
|
|
74
|
+
React.createElement(icon_1.Icon, { icon: lucide_react_1.CircleAlert, size: 14 }),
|
|
75
|
+
React.createElement("span", null, t('ta.message.sendFailed')),
|
|
76
|
+
actions && (React.createElement(React.Fragment, null,
|
|
77
|
+
React.createElement("button", { type: "button", className: "ta-link-button", onClick: () => actions.resend(sent.id) }, t('ta.message.resend')),
|
|
78
|
+
React.createElement("button", { type: "button", className: "ta-link-button", onClick: () => actions.discard(sent.id) }, t('ta.message.discard'))))));
|
|
79
|
+
}
|
|
61
80
|
/** Who answers, at the head of a turn: ta, or the avatar the extension of the session's group draws. */
|
|
62
81
|
function TurnAvatar({ mood }) {
|
|
63
82
|
var _a;
|
|
@@ -72,6 +91,8 @@ function TurnAvatar({ mood }) {
|
|
|
72
91
|
React.createElement(Avatar, { session: session, mood: mood, size: 24 })));
|
|
73
92
|
}
|
|
74
93
|
const TASK_UPDATE = /^<task_update id="[^"]+" title="([^"]*)" status="(\w+)">\n?([\s\S]*?)\n?<\/task_update>$/;
|
|
94
|
+
/** AssistantTaskUtil.renamedNote. */
|
|
95
|
+
const TASK_RENAMED = /^<task_renamed id="[^"]+" was="[^"]+"/;
|
|
75
96
|
/** What the double of the web client told ta about a task that ended: a note, not something the user said. */
|
|
76
97
|
function TaskUpdate({ title, status, result }) {
|
|
77
98
|
const t = (0, use_t_1.useT)();
|
|
@@ -82,24 +103,148 @@ function TaskUpdate({ title, status, result }) {
|
|
|
82
103
|
t(`ta.task.${status}`)),
|
|
83
104
|
React.createElement(markdown_1.Markdown, { text: result })));
|
|
84
105
|
}
|
|
85
|
-
/**
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
106
|
+
/**
|
|
107
|
+
* Where the images of the messages of the user come from that the conversation gave without their bytes
|
|
108
|
+
* (TaShownImage): by the timestamp of the message and the index of the block. Without it they show as their place.
|
|
109
|
+
*/
|
|
110
|
+
exports.MessageImages = React.createContext(undefined);
|
|
111
|
+
/** The images shown lately, by message and block: drawn again at once, in this conversation or another view of it. */
|
|
112
|
+
const shownImages = new lazy_1.Recent(48);
|
|
113
|
+
/** The size of the images with their bytes, read once. */
|
|
114
|
+
const sizes = new WeakMap();
|
|
115
|
+
/** How large one image of a message is drawn, at most. */
|
|
116
|
+
const ONE_IMAGE = { width: 220, height: 280 };
|
|
117
|
+
var UserImageUtil;
|
|
118
|
+
(function (UserImageUtil) {
|
|
119
|
+
/** The images of a message the page can show, with their index among its blocks: with their bytes, or without (TaShownImage). */
|
|
120
|
+
function images(blocks) {
|
|
121
|
+
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 }] : []; });
|
|
122
|
+
}
|
|
123
|
+
UserImageUtil.images = images;
|
|
124
|
+
/** Its size in pixels: given (TaShownImage), or read from its bytes. */
|
|
125
|
+
function size(block) {
|
|
126
|
+
if (block.width && block.height) {
|
|
127
|
+
return { width: block.width, height: block.height };
|
|
128
|
+
}
|
|
129
|
+
if (!block.data) {
|
|
130
|
+
return undefined;
|
|
131
|
+
}
|
|
132
|
+
if (!sizes.has(block)) {
|
|
133
|
+
sizes.set(block, ta_protocol_1.TaImageSize.of(block.data));
|
|
134
|
+
}
|
|
135
|
+
return sizes.get(block);
|
|
136
|
+
}
|
|
137
|
+
UserImageUtil.size = size;
|
|
138
|
+
/** The box of one image alone, its shape kept, before it loads: nothing moves when it comes. */
|
|
139
|
+
function box(size) {
|
|
140
|
+
if (!size) {
|
|
141
|
+
return undefined;
|
|
142
|
+
}
|
|
143
|
+
const scale = Math.min(1, ONE_IMAGE.width / size.width, ONE_IMAGE.height / size.height);
|
|
144
|
+
return { width: Math.max(1, Math.round(size.width * scale)), aspectRatio: `${size.width} / ${size.height}` };
|
|
145
|
+
}
|
|
146
|
+
UserImageUtil.box = box;
|
|
147
|
+
})(UserImageUtil || (exports.UserImageUtil = UserImageUtil = {}));
|
|
148
|
+
/** The URLs of the images of a message: those with their bytes at once, the others as `MessageImages` gives them. */
|
|
149
|
+
function useImageSources(images, timestamp) {
|
|
150
|
+
const load = React.useContext(exports.MessageImages);
|
|
151
|
+
const keyOf = (index) => (timestamp === undefined ? undefined : `${timestamp}:${index}`);
|
|
152
|
+
const own = images.map(({ block, index }) => {
|
|
153
|
+
const key = keyOf(index);
|
|
154
|
+
return block.data ? `data:${block.mimeType};base64,${block.data}` : key ? shownImages.get(key) : undefined;
|
|
155
|
+
});
|
|
156
|
+
const [loaded, setLoaded] = React.useState({});
|
|
157
|
+
const wanted = images.filter((image, at) => !own[at] && !loaded[image.index]).map(image => image.index);
|
|
158
|
+
const missing = wanted.join(',');
|
|
159
|
+
// Asked again only for other images: `missing` says which.
|
|
160
|
+
React.useEffect(() => {
|
|
161
|
+
if (!load || timestamp === undefined || !missing) {
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
let live = true;
|
|
165
|
+
for (const index of missing.split(',').map(Number)) {
|
|
166
|
+
load(timestamp, index).then(image => {
|
|
167
|
+
if (image === null || image === void 0 ? void 0 : image.data) {
|
|
168
|
+
const url = `data:${image.mimeType};base64,${image.data}`;
|
|
169
|
+
shownImages.set(`${timestamp}:${index}`, url);
|
|
170
|
+
if (live) {
|
|
171
|
+
setLoaded(current => ({ ...current, [index]: url }));
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}, () => undefined);
|
|
175
|
+
}
|
|
176
|
+
return () => {
|
|
177
|
+
live = false;
|
|
178
|
+
};
|
|
179
|
+
}, [load, timestamp, missing]);
|
|
180
|
+
// Those with their bytes are kept too: the same message given again without them (the conversation read again) shows them at once.
|
|
181
|
+
React.useEffect(() => {
|
|
182
|
+
images.forEach(({ block, index }, at) => {
|
|
183
|
+
const key = keyOf(index);
|
|
184
|
+
if (block.data && key && own[at]) {
|
|
185
|
+
shownImages.set(key, own[at]);
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
});
|
|
189
|
+
return images.map(({ index }, at) => { var _a; return (_a = own[at]) !== null && _a !== void 0 ? _a : loaded[index]; });
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* The images of a message of the user: one keeps its own shape at the size of a bubble, a few stand as
|
|
193
|
+
* squares of one size, and a click on any of them opens it full size over the page. Each has its place
|
|
194
|
+
* before it loads (its size is known), so that nothing moves as it comes. `timestamp`: of the message,
|
|
195
|
+
* for those given without their bytes (MessageImages).
|
|
196
|
+
*/
|
|
197
|
+
function UserImages({ blocks, timestamp }) {
|
|
198
|
+
const t = (0, use_t_1.useT)();
|
|
199
|
+
const [open, setOpen] = React.useState();
|
|
200
|
+
const images = UserImageUtil.images(blocks);
|
|
201
|
+
const sources = useImageSources(images, timestamp);
|
|
202
|
+
if (images.length === 0) {
|
|
203
|
+
return null;
|
|
204
|
+
}
|
|
205
|
+
const single = images.length === 1 ? UserImageUtil.box(UserImageUtil.size(images[0].block)) : undefined;
|
|
206
|
+
const shown = open !== undefined ? sources[open] : undefined;
|
|
207
|
+
return (React.createElement("div", { className: "ta-user-images", "data-count": Math.min(images.length, 3) },
|
|
208
|
+
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 }))))),
|
|
209
|
+
open !== undefined && shown && (React.createElement(lightbox_1.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 }))));
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* What the user said, in the bubble of a message of theirs, with the pictures they sent with it in the same
|
|
213
|
+
* bubble: the pictures first, the words under them. A message of pictures alone has no bubble of its own.
|
|
214
|
+
* `bubble` is the class of that bubble, which a conversation and the double have of their own.
|
|
215
|
+
*/
|
|
216
|
+
function UserSaid({ blocks, text, bubble = 'ta-bubble', timestamp }) {
|
|
217
|
+
if (UserImageUtil.images(blocks).length === 0) {
|
|
218
|
+
return text ? (React.createElement("div", { className: bubble },
|
|
219
|
+
React.createElement(said_text_1.SaidText, { text: text }))) : null;
|
|
220
|
+
}
|
|
221
|
+
return (React.createElement("div", { className: `${bubble} ta-bubble-media${text ? '' : ' ta-bubble-bare'}` },
|
|
222
|
+
React.createElement(UserImages, { blocks: blocks, timestamp: timestamp }),
|
|
223
|
+
text && React.createElement(said_text_1.SaidText, { text: text, className: "ta-bubble-text" })));
|
|
89
224
|
}
|
|
90
225
|
function UserMessage({ message }) {
|
|
91
|
-
var _a;
|
|
92
226
|
const blocks = message_1.MessageUtil.blocks(message);
|
|
93
|
-
const
|
|
227
|
+
const said = message_1.MessageUtil.text(blocks).trim();
|
|
228
|
+
if (TASK_RENAMED.test(said)) {
|
|
229
|
+
// The double's conversation opened as a conversation: what told it a task's new id is for it only.
|
|
230
|
+
return null;
|
|
231
|
+
}
|
|
232
|
+
const update = TASK_UPDATE.exec(said);
|
|
94
233
|
if (update) {
|
|
95
234
|
return React.createElement(TaskUpdate, { title: update[1], status: update[2], result: update[3] });
|
|
96
235
|
}
|
|
97
|
-
const
|
|
236
|
+
const { text, copied, skill } = userWords(blocks);
|
|
237
|
+
return React.createElement(UserBubble, { message: message, blocks: blocks, text: text, copied: copied, skill: skill });
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* What a message of the user's shows, in a conversation and the double alike: without the context and the notes of
|
|
241
|
+
* pictures sent with it, a skill they ran (`/skill:name`) taken out of the words as the skill; `copied` is what they typed.
|
|
242
|
+
*/
|
|
243
|
+
function userWords(blocks) {
|
|
244
|
+
var _a;
|
|
245
|
+
const said = ta_protocol_1.TaImageNote.strip(ta_protocol_1.TaMessageContext.strip(message_1.MessageUtil.text(blocks))).trim();
|
|
98
246
|
const skill = ta_protocol_1.TaSkillUse.parse(said);
|
|
99
|
-
|
|
100
|
-
return React.createElement(UserBubble, { message: message, blocks: blocks, text: (_a = skill.message) !== null && _a !== void 0 ? _a : '', copied: ta_protocol_1.TaSkillUse.command(skill), skill: skill });
|
|
101
|
-
}
|
|
102
|
-
return React.createElement(UserBubble, { message: message, blocks: blocks, text: said, copied: said });
|
|
247
|
+
return skill ? { text: (_a = skill.message) !== null && _a !== void 0 ? _a : '', copied: ta_protocol_1.TaSkillUse.command(skill), skill } : { text: said, copied: said };
|
|
103
248
|
}
|
|
104
249
|
/** pi's first line of a skill it read, for the model: the path is in the title of the skill's line. */
|
|
105
250
|
const SKILL_BASE = /^References are relative to [^\n]*\n+/;
|
|
@@ -118,10 +263,17 @@ function SkillUse({ skill }) {
|
|
|
118
263
|
}
|
|
119
264
|
function UserBubble({ message, blocks, text, copied, skill, }) {
|
|
120
265
|
const [menu, onContextMenu] = (0, message_menu_1.useMessageMenu)({ kind: 'user', message, text: copied });
|
|
266
|
+
const outbox = React.useContext(Outbox);
|
|
267
|
+
const sent = outbox.of.get(message);
|
|
268
|
+
if (sent) {
|
|
269
|
+
// Not in the session yet: nothing to branch from or rewind to.
|
|
270
|
+
return (React.createElement("div", { className: `ta-message ta-user ${sent.failed ? 'ta-user-failed' : 'ta-user-sending'}` },
|
|
271
|
+
React.createElement(UserSaid, { blocks: blocks, text: text, timestamp: message.timestamp }),
|
|
272
|
+
sent.failed ? React.createElement(SendFailed, { sent: sent, actions: outbox.actions }) : React.createElement("div", { className: "ta-footer" })));
|
|
273
|
+
}
|
|
121
274
|
return (React.createElement("div", { className: "ta-message ta-user", onContextMenu: onContextMenu },
|
|
122
|
-
React.createElement(UserImages, { blocks: blocks }),
|
|
123
275
|
skill && React.createElement(SkillUse, { skill: skill }),
|
|
124
|
-
|
|
276
|
+
React.createElement(UserSaid, { blocks: blocks, text: text, timestamp: message.timestamp }),
|
|
125
277
|
React.createElement(message_footer_1.UserFooter, { message: message, text: copied }),
|
|
126
278
|
menu));
|
|
127
279
|
}
|
|
@@ -136,6 +288,17 @@ const ThinkingStep = React.memo(function ThinkingStep({ text, tagged = true }) {
|
|
|
136
288
|
!open && React.createElement("span", { className: "ta-step-preview" }, process_1.ProcessUtil.preview(text))),
|
|
137
289
|
open && React.createElement("div", { className: "ta-thinking-text" }, text)));
|
|
138
290
|
});
|
|
291
|
+
/** The summary an agent compacted its context to: folded into one line, it opens to the whole summary. */
|
|
292
|
+
const SummaryStep = React.memo(function SummaryStep({ text }) {
|
|
293
|
+
const t = (0, use_t_1.useT)();
|
|
294
|
+
const [open, setOpen] = React.useState(false);
|
|
295
|
+
return (React.createElement("div", { className: "ta-step-summary" },
|
|
296
|
+
React.createElement("button", { type: "button", className: "ta-step-toggle", "aria-expanded": open, onClick: () => setOpen(!open) },
|
|
297
|
+
React.createElement("span", { className: "ta-status ta-status-thought" }),
|
|
298
|
+
React.createElement("span", { className: "ta-step-tag" }, t('ta.message.compacted')),
|
|
299
|
+
React.createElement(icon_1.Icon, { icon: lucide_react_1.ChevronRight, size: 14, className: "ta-step-chevron" })),
|
|
300
|
+
open && React.createElement("div", { className: "ta-thinking-text" }, text)));
|
|
301
|
+
});
|
|
139
302
|
const TextStep = React.memo(function TextStep({ text }) {
|
|
140
303
|
return (React.createElement("div", { className: "ta-step-text" },
|
|
141
304
|
React.createElement("span", { className: "ta-status ta-status-thought" }),
|
|
@@ -148,12 +311,68 @@ function Step({ step, results, tools, tagged }) {
|
|
|
148
311
|
return React.createElement(ThinkingStep, { text: step.text, tagged: tagged });
|
|
149
312
|
case 'text':
|
|
150
313
|
return React.createElement(TextStep, { text: step.text });
|
|
314
|
+
case 'summary':
|
|
315
|
+
return React.createElement(SummaryStep, { text: step.text });
|
|
151
316
|
default: {
|
|
152
317
|
const { id = '', name = '', arguments: args } = step.call;
|
|
153
318
|
return (React.createElement(tool_view_1.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 }));
|
|
154
319
|
}
|
|
155
320
|
}
|
|
156
321
|
}
|
|
322
|
+
/** How long the steps of a turn take to fold or open, and how. */
|
|
323
|
+
const FOLD_MS = 220;
|
|
324
|
+
const FOLD_EASE = 'cubic-bezier(0.2, 0.8, 0.2, 1)';
|
|
325
|
+
/**
|
|
326
|
+
* Whether the steps of `ref` are in the page: they fold and open in a motion, so that what is under them
|
|
327
|
+
* slides to its place rather than jumps there (as when a turn ends and its steps fold under the eyes of
|
|
328
|
+
* the user). While they fold they stay; without motion they come and go at once. `slideOpen`: they open in
|
|
329
|
+
* a motion too (opened by the user); steps that come while ta works come in as steps do, without it.
|
|
330
|
+
*/
|
|
331
|
+
function useFold(open, ref, slideOpen) {
|
|
332
|
+
const [closing, setClosing] = React.useState(false);
|
|
333
|
+
const [was, setWas] = React.useState(open);
|
|
334
|
+
if (was !== open) {
|
|
335
|
+
setWas(open);
|
|
336
|
+
setClosing(!open);
|
|
337
|
+
}
|
|
338
|
+
const opened = React.useRef(open);
|
|
339
|
+
React.useLayoutEffect(() => {
|
|
340
|
+
const opening = open && !opened.current && slideOpen;
|
|
341
|
+
opened.current = open;
|
|
342
|
+
const element = ref.current;
|
|
343
|
+
if (!opening && !closing) {
|
|
344
|
+
return;
|
|
345
|
+
}
|
|
346
|
+
if (!element || typeof element.animate !== 'function' || document.documentElement.hasAttribute('data-reduce-motion')) {
|
|
347
|
+
setClosing(false);
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
350
|
+
const style = getComputedStyle(element);
|
|
351
|
+
const full = {
|
|
352
|
+
height: `${element.offsetHeight}px`,
|
|
353
|
+
paddingTop: style.paddingTop,
|
|
354
|
+
paddingBottom: style.paddingBottom,
|
|
355
|
+
marginTop: style.marginTop,
|
|
356
|
+
marginBottom: style.marginBottom,
|
|
357
|
+
opacity: 1,
|
|
358
|
+
};
|
|
359
|
+
const none = { height: '0px', paddingTop: '0px', paddingBottom: '0px', marginTop: '0px', marginBottom: '0px', opacity: 0 };
|
|
360
|
+
element.style.overflow = 'hidden';
|
|
361
|
+
// Folded, the steps stay at no height until they go: not drawn whole again for the frame before.
|
|
362
|
+
const animation = element.animate(opening ? [none, full] : [full, none], { duration: FOLD_MS, easing: FOLD_EASE, fill: opening ? 'none' : 'forwards' });
|
|
363
|
+
animation.onfinish = () => {
|
|
364
|
+
element.style.overflow = '';
|
|
365
|
+
if (!opening) {
|
|
366
|
+
setClosing(false);
|
|
367
|
+
}
|
|
368
|
+
};
|
|
369
|
+
return () => {
|
|
370
|
+
animation.cancel();
|
|
371
|
+
element.style.overflow = '';
|
|
372
|
+
};
|
|
373
|
+
}, [open, closing, ref, slideOpen]);
|
|
374
|
+
return open || closing;
|
|
375
|
+
}
|
|
157
376
|
/**
|
|
158
377
|
* The head of a turn and its work: the work in one line, "N steps", open while ta is at it, then folded,
|
|
159
378
|
* so that a long conversation reads as what was asked and what came of it. Before the first step the
|
|
@@ -164,10 +383,14 @@ function Process({ steps, active, results, tools, leading, status, }) {
|
|
|
164
383
|
const [manual, setManual] = React.useState();
|
|
165
384
|
const [showAll, setShowAll] = React.useState(false);
|
|
166
385
|
const id = React.useId();
|
|
386
|
+
const stepsRef = React.useRef(null);
|
|
167
387
|
const { steps: count, failed } = tool_1.ToolUtil.count(process_1.ProcessUtil.tools(steps), results, tools);
|
|
168
388
|
// Open while it works, then folded; a failed step says so on the head, quietly.
|
|
169
389
|
const open = manual !== null && manual !== void 0 ? manual : active;
|
|
390
|
+
const shown = useFold(open && steps.length > 0, stepsRef, !active);
|
|
170
391
|
const folded = process_1.ProcessUtil.fold(steps, active, showAll);
|
|
392
|
+
// The earlier steps count as the head does: the calls among them, not the thoughts.
|
|
393
|
+
const earlier = folded.hidden ? tool_1.ToolUtil.count(process_1.ProcessUtil.tools(steps.slice(0, folded.hidden)), results, tools).steps : 0;
|
|
171
394
|
// Only thoughts: the head already says so, the steps need not say it again.
|
|
172
395
|
const thoughtOnly = steps.every(step => step.kind === 'thinking');
|
|
173
396
|
const title = count ? t(active ? 'ta.process.running' : 'ta.process.done', { count }) : t(active ? 'ta.process.thinking' : 'ta.process.thought');
|
|
@@ -180,15 +403,23 @@ function Process({ steps, active, results, tools, leading, status, }) {
|
|
|
180
403
|
"\u00B7 ",
|
|
181
404
|
t('ta.process.failed', { count: failed })),
|
|
182
405
|
React.createElement(icon_1.Icon, { icon: lucide_react_1.ChevronRight, size: 14, className: "ta-process-chevron" }))) : (status)),
|
|
183
|
-
|
|
184
|
-
folded.hidden > 0 && (React.createElement("button", { type: "button", className: "ta-link ta-more", onClick: () => setShowAll(true) }, t('ta.process.earlier', { count:
|
|
406
|
+
shown && (React.createElement("div", { id: id, ref: stepsRef, className: "ta-process-steps" },
|
|
407
|
+
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'))),
|
|
185
408
|
folded.steps.map(step => (React.createElement(Step, { key: step.key, step: step, results: results, tools: tools, tagged: !thoughtOnly })))))));
|
|
186
409
|
}
|
|
187
410
|
/** A turn that has shown nothing yet: what ta does goes on its head. */
|
|
188
411
|
function quiet(item) {
|
|
189
412
|
return (item === null || item === void 0 ? void 0 : item.kind) === 'turn' && item.active && !item.steps.length && !item.reply.some(text => text.trim());
|
|
190
413
|
}
|
|
191
|
-
|
|
414
|
+
/**
|
|
415
|
+
* A turn that ends with its steps, no words after them: the line of what ta does is one more of its steps
|
|
416
|
+
* (.ta-run-steps). Said by the class, not by `:last-child` in `:has()`: WebKit does not style the line
|
|
417
|
+
* again when the words under the steps go into them, and it stayed out of line until something else drew.
|
|
418
|
+
*/
|
|
419
|
+
function endsInSteps(item) {
|
|
420
|
+
return (item === null || item === void 0 ? void 0 : item.kind) === 'turn' && item.steps.length > 0 && !item.reply.length;
|
|
421
|
+
}
|
|
422
|
+
function Turn({ item, tools, mood, status, latest, }) {
|
|
192
423
|
var _a;
|
|
193
424
|
const t = (0, use_t_1.useT)();
|
|
194
425
|
const session = React.useContext(exports.ConversationSession);
|
|
@@ -196,13 +427,19 @@ function Turn({ item, tools, mood, status }) {
|
|
|
196
427
|
const { errorMessage } = ((_a = item.last) !== null && _a !== void 0 ? _a : {});
|
|
197
428
|
const stopReason = message_1.MessageUtil.stopReason(item.last);
|
|
198
429
|
const reply = item.reply.join('\n\n').trim();
|
|
199
|
-
const [menu, onContextMenu] = (0, message_menu_1.useMessageMenu)({
|
|
430
|
+
const [menu, onContextMenu] = (0, message_menu_1.useMessageMenu)({
|
|
431
|
+
kind: 'turn',
|
|
432
|
+
last: item.active ? undefined : item.last,
|
|
433
|
+
reply: item.active ? '' : reply,
|
|
434
|
+
session,
|
|
435
|
+
messages: item.messages,
|
|
436
|
+
});
|
|
200
437
|
return (React.createElement("div", { className: `ta-message ta-assistant ${item.active ? 'ta-turn-live' : ''}`, onContextMenu: onContextMenu },
|
|
201
438
|
React.createElement(Process, { steps: item.steps, active: item.active, results: results, tools: tools, leading: React.createElement(TurnAvatar, { mood: mood }), status: status }),
|
|
202
|
-
item.reply.map((text, index) => (React.createElement(markdown_1.Markdown, { key: index, text: text }))),
|
|
439
|
+
item.reply.map((text, index) => (React.createElement(markdown_1.Markdown, { key: index, text: text, streaming: item.active && index === item.reply.length - 1 }))),
|
|
203
440
|
!item.active && stopReason === 'error' && errorMessage && React.createElement(callout_1.Callout, { level: "error" }, errorMessage),
|
|
204
441
|
!item.active && stopReason === 'aborted' && React.createElement("div", { className: "ta-muted ta-small" }, t('ta.message.stopped')),
|
|
205
|
-
!item.active && React.createElement(message_footer_1.TurnFooter, { messages: item.messages, last: item.last, reply: reply, session: session }),
|
|
442
|
+
!item.active && React.createElement(message_footer_1.TurnFooter, { messages: item.messages, last: item.last, reply: reply, session: session, latest: latest }),
|
|
206
443
|
menu));
|
|
207
444
|
}
|
|
208
445
|
/** `!command` of a user, which pi records as its own kind of message. */
|
|
@@ -245,25 +482,35 @@ function Message({ item }) {
|
|
|
245
482
|
* One item of the conversation. The store replaces only the message that changed, so an item draws
|
|
246
483
|
* again only when one of its messages did, or, while ta is at it, when a tool run did.
|
|
247
484
|
*/
|
|
248
|
-
const ThreadRow = React.memo(function ThreadRow({ item, tools, mood, status }) {
|
|
249
|
-
return item.kind === 'turn' ? React.createElement(Turn, { item: item, tools: tools, mood: mood, status: status }) : React.createElement(Message, { item: item });
|
|
485
|
+
const ThreadRow = React.memo(function ThreadRow({ item, tools, mood, status, latest, }) {
|
|
486
|
+
return item.kind === 'turn' ? React.createElement(Turn, { item: item, tools: tools, mood: mood, status: status, latest: latest }) : React.createElement(Message, { item: item });
|
|
250
487
|
}, (previous, next) => previous.mood === next.mood &&
|
|
251
488
|
previous.status === next.status &&
|
|
489
|
+
previous.latest === next.latest &&
|
|
252
490
|
process_1.ProcessUtil.same(previous.item, next.item) &&
|
|
253
491
|
(next.item.kind === 'message' || !next.item.active || previous.tools === next.tools));
|
|
254
492
|
/** The last rows, which change and are in view, are always laid out. */
|
|
255
493
|
const SETTLED_AFTER = 4;
|
|
256
|
-
/** The conversation; tool results show with the calls they answer. */
|
|
257
|
-
function MessageList({ state }) {
|
|
494
|
+
/** The conversation; tool results show with the calls they answer. `rows`: only its latest rows are drawn, more as asked. */
|
|
495
|
+
function MessageList({ state, outbox, rows }) {
|
|
258
496
|
var _a;
|
|
259
|
-
const
|
|
497
|
+
const renderers = React.useContext(extension_view_1.MessageRenderers);
|
|
498
|
+
const items = React.useMemo(() => process_1.ProcessUtil.items(state.messages, state.working, state.start, renderers), [state.messages, state.working, state.start, renderers]);
|
|
499
|
+
const breaks = React.useMemo(() => process_1.ProcessUtil.timeBreaks(process_1.ProcessUtil.starts(items), index => process_1.ProcessUtil.shown(items[index], renderers)), [items, renderers]);
|
|
500
|
+
const models = React.useMemo(() => process_1.ProcessUtil.modelBreaks(items), [items]);
|
|
501
|
+
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]);
|
|
502
|
+
// The rows held back: those before the latest `rows.rows`.
|
|
503
|
+
const from = rows ? Math.max(0, items.length - rows.rows) : 0;
|
|
504
|
+
if (rows) {
|
|
505
|
+
rows.hidden.current = from;
|
|
506
|
+
}
|
|
260
507
|
// Rows of earlier messages put in front are laid out once before they may skip it (content-visibility):
|
|
261
508
|
// their height is then known, and the view does not move as they come near it.
|
|
262
|
-
const firstKey = React.useRef((_a = items[
|
|
263
|
-
const front = Math.max(
|
|
509
|
+
const firstKey = React.useRef((_a = items[from]) === null || _a === void 0 ? void 0 : _a.key);
|
|
510
|
+
const front = Math.max(from, items.findIndex(item => item.key === firstKey.current));
|
|
264
511
|
React.useLayoutEffect(() => {
|
|
265
512
|
var _a;
|
|
266
|
-
firstKey.current = (_a = items[
|
|
513
|
+
firstKey.current = (_a = items[from]) === null || _a === void 0 ? void 0 : _a.key;
|
|
267
514
|
});
|
|
268
515
|
// Rows that come after the list is drawn come in with a motion; those of a conversation opened or loaded again, still.
|
|
269
516
|
const still = React.useRef(items.length);
|
|
@@ -281,8 +528,8 @@ function MessageList({ state }) {
|
|
|
281
528
|
// What ta does while it works: on the head of a turn that shows nothing yet, else under all it has shown.
|
|
282
529
|
const status = state.working || state.compacting ? React.createElement(run_status_1.RunStatus, { state: state }) : undefined;
|
|
283
530
|
const onHead = status && quiet(last);
|
|
284
|
-
return (React.createElement(
|
|
285
|
-
items.map((item, index) => (React.createElement("div", { key: item.key, className: [
|
|
531
|
+
return (React.createElement(Outbox.Provider, { value: sent },
|
|
532
|
+
items.map((item, index) => index < from ? null : (React.createElement("div", { key: item.key, className: [
|
|
286
533
|
'ta-thread-item',
|
|
287
534
|
index >= front && index < items.length - SETTLED_AFTER && 'ta-settled',
|
|
288
535
|
index === items.length - 1 && 'ta-thread-last',
|
|
@@ -291,7 +538,9 @@ function MessageList({ state }) {
|
|
|
291
538
|
]
|
|
292
539
|
.filter(Boolean)
|
|
293
540
|
.join(' ') },
|
|
294
|
-
React.createElement(
|
|
295
|
-
|
|
541
|
+
breaks[index] !== undefined && React.createElement(message_footer_1.TimeBreak, { timestamp: breaks[index] }),
|
|
542
|
+
models[index] && React.createElement(message_footer_1.ModelBreak, { model: models[index] }),
|
|
543
|
+
React.createElement(ThreadRow, { item: item, tools: state.tools, mood: item.kind === 'turn' ? process_1.ProcessUtil.mood(item, index === lastTurn, waiting) : 'idle', status: onHead && item === last ? status : undefined, latest: index === lastTurn })))),
|
|
544
|
+
status && !onHead && React.createElement("div", { className: `ta-run-line ${endsInSteps(last) ? 'ta-run-steps' : ''}` }, status)));
|
|
296
545
|
}
|
|
297
546
|
//# 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];
|
|
@@ -37,6 +37,8 @@ exports.useMessageMenu = useMessageMenu;
|
|
|
37
37
|
const React = __importStar(require("react"));
|
|
38
38
|
const device_1 = require("../device/device");
|
|
39
39
|
const use_t_1 = require("../i18n/use-t");
|
|
40
|
+
const message_1 = require("../util/message");
|
|
41
|
+
const progress_1 = require("../util/progress");
|
|
40
42
|
const context_menu_1 = require("./context-menu");
|
|
41
43
|
const message_footer_1 = require("./message-footer");
|
|
42
44
|
const web_dialog_1 = require("./web-dialog");
|
|
@@ -44,11 +46,13 @@ const web_dialog_1 = require("./web-dialog");
|
|
|
44
46
|
const OWN_PRESS = 'a, button, img, video, .ta-code, pre, .ta-process-steps, .ta-footer';
|
|
45
47
|
/**
|
|
46
48
|
* The menu of a message under a held finger, as in WeChat: copy it, select its text (in a sheet of its own, as
|
|
47
|
-
* WeChat shows a message to select from), and what its footer does
|
|
49
|
+
* WeChat shows a message to select from), and what its footer does; above them, what the footer says (when,
|
|
50
|
+
* what the turn took), since a touch screen shows no footer but that of the last turn.
|
|
48
51
|
* On a touch screen only; a right click elsewhere keeps the menu of the browser, which copies a selection.
|
|
49
52
|
*/
|
|
50
53
|
function useMessageMenu(subject) {
|
|
51
54
|
const t = (0, use_t_1.useT)();
|
|
55
|
+
const timeLabel = (0, message_footer_1.useTimeLabel)();
|
|
52
56
|
const touch = (0, device_1.useDevice)(device => device.touch);
|
|
53
57
|
const actions = React.useContext(message_footer_1.MessageActions);
|
|
54
58
|
const [menu, open] = (0, context_menu_1.useContextMenu)();
|
|
@@ -69,7 +73,12 @@ function useMessageMenu(subject) {
|
|
|
69
73
|
const items = [];
|
|
70
74
|
const text = subject.kind === 'user' ? subject.text : subject.reply;
|
|
71
75
|
if (text) {
|
|
72
|
-
items.push({ label: t('ta.copy'), run: () => copy(text) }
|
|
76
|
+
items.push({ label: t('ta.copy'), run: () => copy(text) });
|
|
77
|
+
if (actions === null || actions === void 0 ? void 0 : actions.quote) {
|
|
78
|
+
const quote = actions.quote;
|
|
79
|
+
items.push({ label: t('ta.message.quote'), run: () => quote(text) });
|
|
80
|
+
}
|
|
81
|
+
items.push({ label: t('ta.message.selectText'), run: () => setSelecting(text) });
|
|
73
82
|
}
|
|
74
83
|
if (subject.kind === 'user' && branches) {
|
|
75
84
|
items.push('-', { label: t('ta.message.forkBefore'), run: () => actions.fork(subject.message, 'before') }, { label: t('ta.message.rewind'), run: () => actions.rewind(subject.message) });
|
|
@@ -82,7 +91,18 @@ function useMessageMenu(subject) {
|
|
|
82
91
|
items.push({ label: t('ta.message.debug'), run: () => copy(message_footer_1.MessageFooterUtil.debugInfo(last, subject.session), t('ta.message.debugCopied')) });
|
|
83
92
|
}
|
|
84
93
|
if (items.length) {
|
|
85
|
-
|
|
94
|
+
const said = subject.kind === 'user' ? subject.message : subject.last;
|
|
95
|
+
const at = said === null || said === void 0 ? void 0 : said.timestamp;
|
|
96
|
+
const usage = subject.kind === 'turn' && subject.messages ? message_1.MessageUtil.usage(subject.messages) : undefined;
|
|
97
|
+
const caption = [
|
|
98
|
+
at !== undefined && timeLabel(at),
|
|
99
|
+
usage &&
|
|
100
|
+
(usage.input > 0 || usage.output > 0) &&
|
|
101
|
+
`${t('ta.message.used')} ↑${progress_1.ProgressUtil.format(usage.input)} ↓${progress_1.ProgressUtil.format(usage.output)}${usage.cost > 0 ? ` ${message_1.MessageUtil.cost(usage.cost)}` : ''}`,
|
|
102
|
+
]
|
|
103
|
+
.filter(Boolean)
|
|
104
|
+
.join(' · ');
|
|
105
|
+
open(event, items, caption || undefined);
|
|
86
106
|
}
|
|
87
107
|
};
|
|
88
108
|
return [
|
|
@@ -99,6 +99,7 @@ var ModelPickerUtil;
|
|
|
99
99
|
key: 'model',
|
|
100
100
|
label: t('ta.session.model'),
|
|
101
101
|
icon: React.createElement(icon_1.Icon, { icon: lucide_react_1.Box, size: 16 }),
|
|
102
|
+
setting: true,
|
|
102
103
|
detail: value ? name(source, value) : t('ta.session.noModel'),
|
|
103
104
|
searchLabel: t('ta.model.search'),
|
|
104
105
|
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';
|
|
1
3
|
import { type WebViewEntry } from '../extension/web-extension-protocol';
|
|
4
|
+
import { type WebPageInfo } from '../extension/web-pages';
|
|
2
5
|
import { type NavigationSetting } from '../settings/navigation';
|
|
3
6
|
import type { ContextMenuItem } from './context-menu';
|
|
4
7
|
import type { PhoneTab } from './phone-shell';
|
|
@@ -8,6 +11,17 @@ import { type SideList } from './side-lists';
|
|
|
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,23 +39,43 @@ 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[];
|
|
47
81
|
//# sourceMappingURL=nav-places.d.ts.map
|