@celljs/ta-web 4.10.0 → 4.12.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 +7 -7
- package/README.md +7 -7
- package/esm/browser/assistant/assistant-chat-list.d.ts +11 -0
- package/esm/browser/assistant/assistant-chat-list.js +12 -0
- package/esm/browser/assistant/assistant-extension.js +5 -0
- package/esm/browser/assistant/assistant-protocol.d.ts +2 -1
- 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 +13 -3
- package/esm/browser/assistant/assistant-task-util.js +59 -12
- package/esm/browser/assistant/assistant-view.js +48 -24
- package/esm/browser/assistant/assistant.d.ts +18 -4
- package/esm/browser/assistant/assistant.js +52 -17
- package/esm/browser/avatar/dino-face.js +1 -2
- package/esm/browser/chat/chat-protocol.d.ts +5 -0
- package/esm/browser/chat/chat-stores.d.ts +8 -5
- package/esm/browser/chat/chat-stores.js +17 -9
- package/esm/browser/chat/chat-view.js +23 -15
- package/esm/browser/chat/chat.d.ts +16 -8
- package/esm/browser/chat/chat.js +86 -51
- 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 +5 -2
- package/esm/browser/components/app-nav.js +22 -9
- package/esm/browser/components/app-shell-hooks.js +5 -3
- package/esm/browser/components/app-view.js +84 -20
- 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 +73 -6
- package/esm/browser/components/chat-list.js +295 -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 +15 -4
- package/esm/browser/components/composer-box.js +139 -77
- package/esm/browser/components/composer.d.ts +9 -6
- package/esm/browser/components/composer.js +32 -4
- package/esm/browser/components/conversation-scroll-hooks.d.ts +16 -0
- package/esm/browser/components/conversation-scroll-hooks.js +98 -0
- package/esm/browser/components/conversation-scroll-util.d.ts +30 -0
- package/esm/browser/components/conversation-scroll-util.js +56 -0
- package/esm/browser/components/conversation-scroll.d.ts +52 -31
- package/esm/browser/components/conversation-scroll.js +170 -129
- 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 -3
- package/esm/browser/components/earlier-messages.js +42 -8
- package/esm/browser/components/editor-area.d.ts +6 -22
- package/esm/browser/components/editor-area.js +10 -97
- package/esm/browser/components/face.d.ts +24 -0
- package/esm/browser/components/face.js +42 -0
- 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 +1 -1
- package/esm/browser/components/folder-picker.js +1 -1
- 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/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 +3 -1
- package/esm/browser/components/icon.js +4 -3
- package/esm/browser/components/image-viewer.d.ts +10 -2
- package/esm/browser/components/image-viewer.js +48 -11
- 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 +5 -2
- package/esm/browser/components/lightbox.js +4 -3
- package/esm/browser/components/list-rows.d.ts +9 -1
- package/esm/browser/components/list-rows.js +17 -3
- package/esm/browser/components/markdown.js +36 -4
- package/esm/browser/components/media.js +73 -7
- package/esm/browser/components/message-actions.js +3 -0
- package/esm/browser/components/message-footer.d.ts +8 -0
- package/esm/browser/components/message-footer.js +20 -3
- package/esm/browser/components/message-list.d.ts +60 -7
- package/esm/browser/components/message-list.js +206 -58
- package/esm/browser/components/message-menu.js +6 -1
- package/esm/browser/components/model-picker.js +1 -0
- package/esm/browser/components/nav-places.d.ts +21 -2
- package/esm/browser/components/nav-places.js +20 -4
- 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 +23 -1
- 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 +2 -3
- package/esm/browser/components/session-settings.js +1 -0
- package/esm/browser/components/session-view.d.ts +3 -1
- package/esm/browser/components/session-view.js +35 -21
- 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.js +45 -14
- package/esm/browser/components/stop-times.d.ts +47 -0
- package/esm/browser/components/stop-times.js +81 -0
- package/esm/browser/components/tool-view.js +7 -2
- 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/use-stop-times.d.ts +3 -0
- package/esm/browser/components/use-stop-times.js +17 -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 +11 -3
- package/esm/browser/components/voice-talk.js +24 -4
- 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/hold.js +4 -6
- package/esm/browser/device/long-press.d.ts +10 -0
- package/esm/browser/device/long-press.js +28 -12
- package/esm/browser/device/own-gestures.d.ts +25 -0
- package/esm/browser/device/own-gestures.js +39 -0
- package/esm/browser/device/photo-picker.d.ts +14 -0
- package/esm/browser/device/photo-picker.js +48 -0
- package/esm/browser/device/pull-down.js +3 -2
- 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 +2 -0
- package/esm/browser/device/row-swipe.js +14 -3
- package/esm/browser/device/sheet-swipe.d.ts +1 -1
- package/esm/browser/device/sheet-swipe.js +25 -4
- 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 +16 -2
- package/esm/browser/extension/web-api-components.d.ts +287 -0
- package/esm/browser/extension/web-api-components.js +2 -0
- package/esm/browser/extension/web-api-contributions.d.ts +394 -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 +186 -565
- package/esm/browser/extension/web-extension-context.d.ts +78 -0
- package/esm/browser/extension/web-extension-context.js +354 -0
- package/esm/browser/extension/web-extension-protocol.d.ts +57 -7
- package/esm/browser/extension/web-extension-protocol.js +34 -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 +29 -69
- package/esm/browser/extension/web-extensions.js +121 -516
- 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/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 +92 -2
- package/esm/browser/i18n/messages.d.ts +91 -1
- package/esm/browser/i18n/messages.js +187 -7
- package/esm/browser/index.d.ts +9 -0
- package/esm/browser/index.js +9 -0
- package/esm/browser/links/links-protocol.d.ts +7 -0
- package/esm/browser/links/links.d.ts +24 -7
- package/esm/browser/links/links.js +64 -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 +17 -0
- package/esm/browser/notices/notices.d.ts +1 -1
- package/esm/browser/notices/notices.js +6 -2
- 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.js +12 -3
- package/esm/browser/offline/offline-reads.js +3 -1
- 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 +15 -0
- package/esm/browser/settings/settings-protocol.js +18 -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 +45 -5
- package/esm/browser/style/device.js +15 -1
- package/esm/browser/style/layout.d.ts +1 -1
- package/esm/browser/style/layout.js +192 -56
- package/esm/browser/style/pages.d.ts +1 -1
- package/esm/browser/style/pages.js +39 -1
- 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 +32 -6
- package/esm/browser/style/surfaces.d.ts +1 -1
- package/esm/browser/style/surfaces.js +21 -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 +2 -0
- package/esm/browser/util/frame.js +2 -0
- package/esm/browser/util/link.d.ts +18 -0
- package/esm/browser/util/link.js +66 -1
- package/esm/browser/util/markdown.d.ts +4 -1
- package/esm/browser/util/markdown.js +1 -1
- package/esm/browser/util/message.d.ts +5 -0
- package/esm/browser/util/message.js +30 -0
- package/esm/browser/util/process.d.ts +57 -3
- package/esm/browser/util/process.js +123 -11
- 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 +47 -7
- package/esm/browser/util/voice.js +269 -27
- package/esm/browser/workbench-calls.d.ts +6 -4
- package/esm/browser/workbench-calls.js +15 -10
- package/esm/browser/workbench-protocol.d.ts +31 -2
- package/esm/browser/workbench-util.d.ts +15 -4
- package/esm/browser/workbench-util.js +28 -5
- package/esm/browser/workbench.d.ts +33 -1
- package/esm/browser/workbench.js +142 -14
- package/lib/browser/assistant/assistant-chat-list.d.ts +11 -0
- package/lib/browser/assistant/assistant-chat-list.js +13 -0
- package/lib/browser/assistant/assistant-extension.js +5 -0
- package/lib/browser/assistant/assistant-protocol.d.ts +2 -1
- 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 +13 -3
- package/lib/browser/assistant/assistant-task-util.js +59 -12
- package/lib/browser/assistant/assistant-view.js +46 -22
- package/lib/browser/assistant/assistant.d.ts +18 -4
- package/lib/browser/assistant/assistant.js +52 -17
- package/lib/browser/avatar/dino-face.js +1 -2
- package/lib/browser/chat/chat-protocol.d.ts +5 -0
- package/lib/browser/chat/chat-stores.d.ts +8 -5
- package/lib/browser/chat/chat-stores.js +17 -9
- package/lib/browser/chat/chat-view.js +22 -14
- package/lib/browser/chat/chat.d.ts +16 -8
- package/lib/browser/chat/chat.js +86 -51
- 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 +5 -2
- package/lib/browser/components/app-nav.js +18 -5
- package/lib/browser/components/app-shell-hooks.js +5 -3
- package/lib/browser/components/app-view.js +80 -16
- 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 +73 -6
- package/lib/browser/components/chat-list.js +295 -59
- 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 +15 -4
- package/lib/browser/components/composer-box.js +136 -74
- package/lib/browser/components/composer.d.ts +9 -6
- package/lib/browser/components/composer.js +31 -3
- package/lib/browser/components/conversation-scroll-hooks.d.ts +17 -0
- package/lib/browser/components/conversation-scroll-hooks.js +135 -0
- package/lib/browser/components/conversation-scroll-util.d.ts +31 -0
- package/lib/browser/components/conversation-scroll-util.js +60 -0
- package/lib/browser/components/conversation-scroll.d.ts +52 -31
- package/lib/browser/components/conversation-scroll.js +171 -164
- 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 -3
- package/lib/browser/components/earlier-messages.js +44 -9
- package/lib/browser/components/editor-area.d.ts +6 -22
- package/lib/browser/components/editor-area.js +11 -98
- package/lib/browser/components/face.d.ts +25 -0
- package/lib/browser/components/face.js +79 -0
- 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 +1 -1
- package/lib/browser/components/folder-picker.js +1 -1
- 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/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 +3 -1
- package/lib/browser/components/icon.js +4 -3
- package/lib/browser/components/image-viewer.d.ts +10 -2
- package/lib/browser/components/image-viewer.js +47 -10
- 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 +5 -2
- package/lib/browser/components/lightbox.js +4 -3
- package/lib/browser/components/list-rows.d.ts +9 -1
- package/lib/browser/components/list-rows.js +18 -3
- package/lib/browser/components/markdown.js +36 -4
- package/lib/browser/components/media.js +73 -7
- package/lib/browser/components/message-actions.js +3 -0
- package/lib/browser/components/message-footer.d.ts +8 -0
- package/lib/browser/components/message-footer.js +20 -2
- package/lib/browser/components/message-list.d.ts +60 -7
- package/lib/browser/components/message-list.js +206 -55
- package/lib/browser/components/message-menu.js +6 -1
- package/lib/browser/components/model-picker.js +1 -0
- package/lib/browser/components/nav-places.d.ts +21 -2
- package/lib/browser/components/nav-places.js +22 -4
- 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 +23 -1
- 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 +2 -3
- package/lib/browser/components/session-settings.js +1 -0
- package/lib/browser/components/session-view.d.ts +3 -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.js +43 -12
- package/lib/browser/components/stop-times.d.ts +48 -0
- package/lib/browser/components/stop-times.js +85 -0
- package/lib/browser/components/tool-view.js +7 -2
- 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/use-stop-times.d.ts +4 -0
- package/lib/browser/components/use-stop-times.js +53 -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 +11 -3
- package/lib/browser/components/voice-talk.js +25 -4
- 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/hold.js +4 -6
- package/lib/browser/device/long-press.d.ts +10 -0
- package/lib/browser/device/long-press.js +28 -12
- package/lib/browser/device/own-gestures.d.ts +26 -0
- package/lib/browser/device/own-gestures.js +42 -0
- package/lib/browser/device/photo-picker.d.ts +15 -0
- package/lib/browser/device/photo-picker.js +51 -0
- package/lib/browser/device/pull-down.js +3 -2
- 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 +2 -0
- package/lib/browser/device/row-swipe.js +14 -3
- package/lib/browser/device/sheet-swipe.d.ts +1 -1
- package/lib/browser/device/sheet-swipe.js +25 -4
- 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 +15 -1
- package/lib/browser/extension/web-api-components.d.ts +288 -0
- package/lib/browser/extension/web-api-components.js +3 -0
- package/lib/browser/extension/web-api-contributions.d.ts +395 -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 +186 -565
- package/lib/browser/extension/web-extension-context.d.ts +79 -0
- package/lib/browser/extension/web-extension-context.js +391 -0
- package/lib/browser/extension/web-extension-protocol.d.ts +57 -7
- package/lib/browser/extension/web-extension-protocol.js +35 -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 +29 -69
- package/lib/browser/extension/web-extensions.js +117 -545
- 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/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 +92 -2
- package/lib/browser/i18n/messages.d.ts +91 -1
- package/lib/browser/i18n/messages.js +187 -7
- package/lib/browser/index.d.ts +9 -0
- package/lib/browser/index.js +9 -0
- package/lib/browser/links/links-protocol.d.ts +7 -0
- package/lib/browser/links/links.d.ts +24 -7
- package/lib/browser/links/links.js +64 -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 +17 -0
- package/lib/browser/notices/notices.d.ts +1 -1
- package/lib/browser/notices/notices.js +6 -2
- 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.js +12 -3
- package/lib/browser/offline/offline-reads.js +3 -1
- 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 +15 -0
- package/lib/browser/settings/settings-protocol.js +19 -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 +45 -5
- package/lib/browser/style/device.js +15 -1
- package/lib/browser/style/layout.d.ts +1 -1
- package/lib/browser/style/layout.js +192 -56
- package/lib/browser/style/pages.d.ts +1 -1
- package/lib/browser/style/pages.js +39 -1
- 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 +32 -6
- package/lib/browser/style/surfaces.d.ts +1 -1
- package/lib/browser/style/surfaces.js +21 -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 +2 -0
- package/lib/browser/util/frame.js +2 -0
- package/lib/browser/util/link.d.ts +18 -0
- package/lib/browser/util/link.js +66 -1
- package/lib/browser/util/markdown.d.ts +4 -1
- package/lib/browser/util/markdown.js +1 -1
- package/lib/browser/util/message.d.ts +5 -0
- package/lib/browser/util/message.js +30 -0
- package/lib/browser/util/process.d.ts +57 -3
- package/lib/browser/util/process.js +125 -12
- 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 +47 -7
- package/lib/browser/util/voice.js +269 -27
- package/lib/browser/workbench-calls.d.ts +6 -4
- package/lib/browser/workbench-calls.js +15 -10
- package/lib/browser/workbench-protocol.d.ts +31 -2
- package/lib/browser/workbench-util.d.ts +15 -4
- package/lib/browser/workbench-util.js +28 -5
- package/lib/browser/workbench.d.ts +33 -1
- package/lib/browser/workbench.js +140 -12
- package/package.json +11 -8
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
import { TaImageNote, TaMessageContext, TaSkillUse } from '@celljs/ta-protocol';
|
|
1
|
+
import { TaImageNote, TaImageSize, TaMessageContext, TaSkillUse } from '@celljs/ta-protocol';
|
|
2
2
|
import { ChevronRight, CircleAlert, Sparkles } from 'lucide-react';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { CustomMessage, ExtensionBoundary, MessageRenderers, SessionAvatars } from '../extension/extension-view.js';
|
|
5
5
|
import { useT } from '../i18n/use-t.js';
|
|
6
|
+
import { CodeRenderers } from '../markdown/code-renderers.js';
|
|
7
|
+
import { Recent } from '../markdown/lazy.js';
|
|
6
8
|
import { MessageUtil } from '../util/message.js';
|
|
7
|
-
import { ProcessUtil } from '../util/process.js';
|
|
9
|
+
import { FreshRows, ProcessUtil } from '../util/process.js';
|
|
8
10
|
import { ToolUtil } from '../util/tool.js';
|
|
9
11
|
import { Callout } from './callout.js';
|
|
10
12
|
import { ASK_CLASS } from './conversation-scroll.js';
|
|
11
13
|
import { Icon } from './icon.js';
|
|
12
14
|
import { Lightbox } from './lightbox.js';
|
|
13
15
|
import { Markdown } from './markdown.js';
|
|
14
|
-
import { TimeBreak, TurnFooter, UserFooter } from './message-footer.js';
|
|
16
|
+
import { MessageActions, ModelBreak, TimeBreak, TurnFooter, UserFooter } from './message-footer.js';
|
|
15
17
|
import { useMessageMenu } from './message-menu.js';
|
|
16
18
|
import { RunStatus } from './run-status.js';
|
|
19
|
+
import { SaidText } from './said-text.js';
|
|
17
20
|
import { TaAvatar } from './ta-avatar.js';
|
|
18
21
|
import { ToolView } from './tool-view.js';
|
|
19
22
|
/** The session of the conversation: who answers in it may be drawn by the extension of its group. */
|
|
@@ -44,6 +47,8 @@ export function TurnAvatar({ mood }) {
|
|
|
44
47
|
React.createElement(Avatar, { session: session, mood: mood, size: 24 })));
|
|
45
48
|
}
|
|
46
49
|
const TASK_UPDATE = /^<task_update id="[^"]+" title="([^"]*)" status="(\w+)">\n?([\s\S]*?)\n?<\/task_update>$/;
|
|
50
|
+
/** AssistantTaskUtil.renamedNote. */
|
|
51
|
+
const TASK_RENAMED = /^<task_renamed id="[^"]+" was="[^"]+"/;
|
|
47
52
|
/** What the double of the web client told ta about a task that ended: a note, not something the user said. */
|
|
48
53
|
function TaskUpdate({ title, status, result }) {
|
|
49
54
|
const t = useT();
|
|
@@ -54,58 +59,153 @@ function TaskUpdate({ title, status, result }) {
|
|
|
54
59
|
t(`ta.task.${status}`)),
|
|
55
60
|
React.createElement(Markdown, { text: result })));
|
|
56
61
|
}
|
|
57
|
-
/**
|
|
58
|
-
|
|
59
|
-
|
|
62
|
+
/**
|
|
63
|
+
* Where the images of the messages of the user come from that the conversation gave without their bytes
|
|
64
|
+
* (TaShownImage): by the timestamp of the message and the index of the block. Without it they show as their place.
|
|
65
|
+
*/
|
|
66
|
+
export const MessageImages = React.createContext(undefined);
|
|
67
|
+
/** The images shown lately, by message and block: drawn again at once, in this conversation or another view of it. */
|
|
68
|
+
const shownImages = new Recent(48);
|
|
69
|
+
/** The size of the images with their bytes, read once. */
|
|
70
|
+
const sizes = new WeakMap();
|
|
71
|
+
/** How large one image of a message is drawn, at most. */
|
|
72
|
+
const ONE_IMAGE = { width: 220, height: 280 };
|
|
73
|
+
export var UserImageUtil;
|
|
74
|
+
(function (UserImageUtil) {
|
|
75
|
+
/** The images of a message the page can show, with their index among its blocks: with their bytes, or without (TaShownImage). */
|
|
76
|
+
function images(blocks) {
|
|
77
|
+
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 }] : []; });
|
|
78
|
+
}
|
|
79
|
+
UserImageUtil.images = images;
|
|
80
|
+
/** Its size in pixels: given (TaShownImage), or read from its bytes. */
|
|
81
|
+
function size(block) {
|
|
82
|
+
if (block.width && block.height) {
|
|
83
|
+
return { width: block.width, height: block.height };
|
|
84
|
+
}
|
|
85
|
+
if (!block.data) {
|
|
86
|
+
return undefined;
|
|
87
|
+
}
|
|
88
|
+
if (!sizes.has(block)) {
|
|
89
|
+
sizes.set(block, TaImageSize.of(block.data));
|
|
90
|
+
}
|
|
91
|
+
return sizes.get(block);
|
|
92
|
+
}
|
|
93
|
+
UserImageUtil.size = size;
|
|
94
|
+
/** The box of one image alone, its shape kept, before it loads: nothing moves when it comes. */
|
|
95
|
+
function box(size) {
|
|
96
|
+
if (!size) {
|
|
97
|
+
return undefined;
|
|
98
|
+
}
|
|
99
|
+
const scale = Math.min(1, ONE_IMAGE.width / size.width, ONE_IMAGE.height / size.height);
|
|
100
|
+
return { width: Math.max(1, Math.round(size.width * scale)), aspectRatio: `${size.width} / ${size.height}` };
|
|
101
|
+
}
|
|
102
|
+
UserImageUtil.box = box;
|
|
103
|
+
})(UserImageUtil || (UserImageUtil = {}));
|
|
104
|
+
/** The URLs of the images of a message: those with their bytes at once, the others as `MessageImages` gives them. */
|
|
105
|
+
function useImageSources(images, timestamp) {
|
|
106
|
+
const load = React.useContext(MessageImages);
|
|
107
|
+
const keyOf = (index) => (timestamp === undefined ? undefined : `${timestamp}:${index}`);
|
|
108
|
+
const own = images.map(({ block, index }) => {
|
|
109
|
+
const key = keyOf(index);
|
|
110
|
+
return block.data ? `data:${block.mimeType};base64,${block.data}` : key ? shownImages.get(key) : undefined;
|
|
111
|
+
});
|
|
112
|
+
const [loaded, setLoaded] = React.useState({});
|
|
113
|
+
const wanted = images.filter((image, at) => !own[at] && !loaded[image.index]).map(image => image.index);
|
|
114
|
+
const missing = wanted.join(',');
|
|
115
|
+
// Asked again only for other images: `missing` says which.
|
|
116
|
+
React.useEffect(() => {
|
|
117
|
+
if (!load || timestamp === undefined || !missing) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
let live = true;
|
|
121
|
+
for (const index of missing.split(',').map(Number)) {
|
|
122
|
+
load(timestamp, index).then(image => {
|
|
123
|
+
if (image === null || image === void 0 ? void 0 : image.data) {
|
|
124
|
+
const url = `data:${image.mimeType};base64,${image.data}`;
|
|
125
|
+
shownImages.set(`${timestamp}:${index}`, url);
|
|
126
|
+
if (live) {
|
|
127
|
+
setLoaded(current => ({ ...current, [index]: url }));
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}, () => undefined);
|
|
131
|
+
}
|
|
132
|
+
return () => {
|
|
133
|
+
live = false;
|
|
134
|
+
};
|
|
135
|
+
}, [load, timestamp, missing]);
|
|
136
|
+
// Those with their bytes are kept too: the same message given again without them (the conversation read again) shows them at once.
|
|
137
|
+
React.useEffect(() => {
|
|
138
|
+
images.forEach(({ block, index }, at) => {
|
|
139
|
+
const key = keyOf(index);
|
|
140
|
+
if (block.data && key && own[at]) {
|
|
141
|
+
shownImages.set(key, own[at]);
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
return images.map(({ index }, at) => { var _a; return (_a = own[at]) !== null && _a !== void 0 ? _a : loaded[index]; });
|
|
60
146
|
}
|
|
61
147
|
/**
|
|
62
148
|
* The images of a message of the user: one keeps its own shape at the size of a bubble, a few stand as
|
|
63
|
-
* squares of one size, and a click on any of them opens it full size over the page.
|
|
149
|
+
* squares of one size, and a click on any of them opens it full size over the page. Each has its place
|
|
150
|
+
* before it loads (its size is known), so that nothing moves as it comes. `timestamp`: of the message,
|
|
151
|
+
* for those given without their bytes (MessageImages).
|
|
64
152
|
*/
|
|
65
|
-
export function UserImages({ blocks }) {
|
|
153
|
+
export function UserImages({ blocks, timestamp }) {
|
|
66
154
|
const t = useT();
|
|
67
155
|
const [open, setOpen] = React.useState();
|
|
68
|
-
const images =
|
|
156
|
+
const images = UserImageUtil.images(blocks);
|
|
157
|
+
const sources = useImageSources(images, timestamp);
|
|
69
158
|
if (images.length === 0) {
|
|
70
159
|
return null;
|
|
71
160
|
}
|
|
72
|
-
const
|
|
161
|
+
const single = images.length === 1 ? UserImageUtil.box(UserImageUtil.size(images[0].block)) : undefined;
|
|
162
|
+
const shown = open !== undefined ? sources[open] : undefined;
|
|
73
163
|
return (React.createElement("div", { className: "ta-user-images", "data-count": Math.min(images.length, 3) },
|
|
74
|
-
images.map((
|
|
75
|
-
|
|
76
|
-
open !== undefined && images[open] && React.createElement(Lightbox, { src: src(images[open]), alt: "", onClose: () => setOpen(undefined) })));
|
|
164
|
+
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 }))))),
|
|
165
|
+
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 }))));
|
|
77
166
|
}
|
|
78
167
|
/**
|
|
79
168
|
* What the user said, in the bubble of a message of theirs, with the pictures they sent with it in the same
|
|
80
169
|
* bubble: the pictures first, the words under them. A message of pictures alone has no bubble of its own.
|
|
81
170
|
* `bubble` is the class of that bubble, which a conversation and the double have of their own.
|
|
82
171
|
*/
|
|
83
|
-
export function UserSaid({ blocks, text, bubble = 'ta-bubble' }) {
|
|
84
|
-
if (
|
|
85
|
-
return text ? React.createElement("div", { className: bubble },
|
|
172
|
+
export function UserSaid({ blocks, text, bubble = 'ta-bubble', timestamp }) {
|
|
173
|
+
if (UserImageUtil.images(blocks).length === 0) {
|
|
174
|
+
return text ? (React.createElement("div", { className: bubble },
|
|
175
|
+
React.createElement(SaidText, { text: text }))) : null;
|
|
86
176
|
}
|
|
87
177
|
return (React.createElement("div", { className: `${bubble} ta-bubble-media${text ? '' : ' ta-bubble-bare'}` },
|
|
88
|
-
React.createElement(UserImages, { blocks: blocks }),
|
|
89
|
-
text && React.createElement(
|
|
178
|
+
React.createElement(UserImages, { blocks: blocks, timestamp: timestamp }),
|
|
179
|
+
text && React.createElement(SaidText, { text: text, className: "ta-bubble-text" })));
|
|
90
180
|
}
|
|
91
181
|
function UserMessage({ message }) {
|
|
92
|
-
var _a;
|
|
93
182
|
const blocks = MessageUtil.blocks(message);
|
|
94
|
-
const
|
|
183
|
+
const said = MessageUtil.text(blocks).trim();
|
|
184
|
+
if (TASK_RENAMED.test(said)) {
|
|
185
|
+
// The double's conversation opened as a conversation: what told it a task's new id is for it only.
|
|
186
|
+
return null;
|
|
187
|
+
}
|
|
188
|
+
const update = TASK_UPDATE.exec(said);
|
|
95
189
|
if (update) {
|
|
96
190
|
return React.createElement(TaskUpdate, { title: update[1], status: update[2], result: update[3] });
|
|
97
191
|
}
|
|
98
|
-
const
|
|
192
|
+
const { text, copied, skill } = userWords(blocks);
|
|
193
|
+
return React.createElement(UserBubble, { message: message, blocks: blocks, text: text, copied: copied, skill: skill });
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* What a message of the user's shows, in a conversation and the double alike: without the context and the notes of
|
|
197
|
+
* pictures sent with it, a skill they ran (`/skill:name`) taken out of the words as the skill; `copied` is what they typed.
|
|
198
|
+
*/
|
|
199
|
+
export function userWords(blocks) {
|
|
200
|
+
var _a;
|
|
201
|
+
const said = TaImageNote.strip(TaMessageContext.strip(MessageUtil.text(blocks))).trim();
|
|
99
202
|
const skill = TaSkillUse.parse(said);
|
|
100
|
-
|
|
101
|
-
return React.createElement(UserBubble, { message: message, blocks: blocks, text: (_a = skill.message) !== null && _a !== void 0 ? _a : '', copied: TaSkillUse.command(skill), skill: skill });
|
|
102
|
-
}
|
|
103
|
-
return React.createElement(UserBubble, { message: message, blocks: blocks, text: said, copied: said });
|
|
203
|
+
return skill ? { text: (_a = skill.message) !== null && _a !== void 0 ? _a : '', copied: TaSkillUse.command(skill), skill } : { text: said, copied: said };
|
|
104
204
|
}
|
|
105
205
|
/** pi's first line of a skill it read, for the model: the path is in the title of the skill's line. */
|
|
106
206
|
const SKILL_BASE = /^References are relative to [^\n]*\n+/;
|
|
107
207
|
/** A skill the user ran: one line with its name, which opens to the skill's file, as a tool call opens. */
|
|
108
|
-
function SkillUse({ skill }) {
|
|
208
|
+
export function SkillUse({ skill }) {
|
|
109
209
|
const t = useT();
|
|
110
210
|
const [open, setOpen] = React.useState(false);
|
|
111
211
|
return (React.createElement("div", { className: "ta-skill-use" },
|
|
@@ -124,12 +224,12 @@ function UserBubble({ message, blocks, text, copied, skill, }) {
|
|
|
124
224
|
if (sent) {
|
|
125
225
|
// Not in the session yet: nothing to branch from or rewind to.
|
|
126
226
|
return (React.createElement("div", { className: `ta-message ta-user ${sent.failed ? 'ta-user-failed' : 'ta-user-sending'}` },
|
|
127
|
-
React.createElement(UserSaid, { blocks: blocks, text: text }),
|
|
227
|
+
React.createElement(UserSaid, { blocks: blocks, text: text, timestamp: message.timestamp }),
|
|
128
228
|
sent.failed ? React.createElement(SendFailed, { sent: sent, actions: outbox.actions }) : React.createElement("div", { className: "ta-footer" })));
|
|
129
229
|
}
|
|
130
230
|
return (React.createElement("div", { className: "ta-message ta-user", onContextMenu: onContextMenu },
|
|
131
231
|
skill && React.createElement(SkillUse, { skill: skill }),
|
|
132
|
-
React.createElement(UserSaid, { blocks: blocks, text: text }),
|
|
232
|
+
React.createElement(UserSaid, { blocks: blocks, text: text, timestamp: message.timestamp }),
|
|
133
233
|
React.createElement(UserFooter, { message: message, text: copied }),
|
|
134
234
|
menu));
|
|
135
235
|
}
|
|
@@ -155,20 +255,33 @@ const SummaryStep = React.memo(function SummaryStep({ text }) {
|
|
|
155
255
|
React.createElement(Icon, { icon: ChevronRight, size: 14, className: "ta-step-chevron" })),
|
|
156
256
|
open && React.createElement("div", { className: "ta-thinking-text" }, text)));
|
|
157
257
|
});
|
|
158
|
-
|
|
258
|
+
/** A request that failed on the way, the work going on after it: one quiet line, which opens to the error. */
|
|
259
|
+
const ErrorStep = React.memo(function ErrorStep({ text }) {
|
|
260
|
+
const t = useT();
|
|
261
|
+
const [open, setOpen] = React.useState(false);
|
|
262
|
+
return (React.createElement("div", { className: "ta-step-thinking ta-step-error" },
|
|
263
|
+
React.createElement("button", { type: "button", className: "ta-step-toggle", "aria-expanded": open, onClick: () => setOpen(!open) },
|
|
264
|
+
React.createElement("span", { className: "ta-status ta-status-error" }),
|
|
265
|
+
React.createElement("span", { className: "ta-step-tag" }, t('ta.process.retried')),
|
|
266
|
+
!open && text && React.createElement("span", { className: "ta-step-preview" }, ProcessUtil.preview(text))),
|
|
267
|
+
open && text && React.createElement("div", { className: "ta-thinking-text" }, text)));
|
|
268
|
+
});
|
|
269
|
+
const TextStep = React.memo(function TextStep({ text, streaming }) {
|
|
159
270
|
return (React.createElement("div", { className: "ta-step-text" },
|
|
160
271
|
React.createElement("span", { className: "ta-status ta-status-thought" }),
|
|
161
|
-
React.createElement(Markdown, { text: text })));
|
|
272
|
+
React.createElement(Markdown, { text: text, streaming: streaming })));
|
|
162
273
|
});
|
|
163
|
-
function Step({ step, results, tools, tagged }) {
|
|
274
|
+
function Step({ step, results, tools, tagged, streaming, }) {
|
|
164
275
|
var _a;
|
|
165
276
|
switch (step.kind) {
|
|
166
277
|
case 'thinking':
|
|
167
278
|
return React.createElement(ThinkingStep, { text: step.text, tagged: tagged });
|
|
168
279
|
case 'text':
|
|
169
|
-
return React.createElement(TextStep, { text: step.text });
|
|
280
|
+
return React.createElement(TextStep, { text: step.text, streaming: streaming });
|
|
170
281
|
case 'summary':
|
|
171
282
|
return React.createElement(SummaryStep, { text: step.text });
|
|
283
|
+
case 'error':
|
|
284
|
+
return React.createElement(ErrorStep, { text: step.text });
|
|
172
285
|
default: {
|
|
173
286
|
const { id = '', name = '', arguments: args } = step.call;
|
|
174
287
|
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 }));
|
|
@@ -234,17 +347,24 @@ function useFold(open, ref, slideOpen) {
|
|
|
234
347
|
* so that a long conversation reads as what was asked and what came of it. Before the first step the
|
|
235
348
|
* line says what ta does. The avatar stays the same element from the turn's first frame to its last.
|
|
236
349
|
*/
|
|
237
|
-
export function Process({ steps, active, results, tools, leading, status, }) {
|
|
350
|
+
export function Process({ steps, active, results, tools, leading, status, stopped, }) {
|
|
238
351
|
const t = useT();
|
|
239
352
|
const [manual, setManual] = React.useState();
|
|
240
353
|
const [showAll, setShowAll] = React.useState(false);
|
|
241
354
|
const id = React.useId();
|
|
242
355
|
const stepsRef = React.useRef(null);
|
|
243
356
|
const { steps: count, failed } = ToolUtil.count(ProcessUtil.tools(steps), results, tools);
|
|
244
|
-
// Open while it works, then folded; a failed step says so on the head, quietly.
|
|
245
|
-
|
|
357
|
+
// Open while it works, then folded; a failed step says so on the head, quietly. A turn that stopped short keeps
|
|
358
|
+
// its work open: there is no reply, and its last steps say where it stopped.
|
|
359
|
+
const open = manual !== null && manual !== void 0 ? manual : (active || !!stopped);
|
|
246
360
|
const shown = useFold(open && steps.length > 0, stepsRef, !active);
|
|
247
|
-
const folded = ProcessUtil.fold(steps, active, showAll);
|
|
361
|
+
const folded = ProcessUtil.fold(steps, active || !!stopped, showAll);
|
|
362
|
+
// Folded, the cards on the way stay under the head: a choice asked in the middle is not hidden with the work.
|
|
363
|
+
const renderers = React.useContext(CodeRenderers);
|
|
364
|
+
const pinned = open ? [] : steps.filter(step => ProcessUtil.pinned(step, renderers));
|
|
365
|
+
const inline = pinned.length ? folded.steps.filter(step => !ProcessUtil.pinned(step, renderers)) : folded.steps;
|
|
366
|
+
// The earlier steps count as the head does: the calls among them, not the thoughts.
|
|
367
|
+
const earlier = folded.hidden ? ToolUtil.count(ProcessUtil.tools(steps.slice(0, folded.hidden)), results, tools).steps : 0;
|
|
248
368
|
// Only thoughts: the head already says so, the steps need not say it again.
|
|
249
369
|
const thoughtOnly = steps.every(step => step.kind === 'thinking');
|
|
250
370
|
const title = count ? t(active ? 'ta.process.running' : 'ta.process.done', { count }) : t(active ? 'ta.process.thinking' : 'ta.process.thought');
|
|
@@ -258,21 +378,31 @@ export function Process({ steps, active, results, tools, leading, status, }) {
|
|
|
258
378
|
t('ta.process.failed', { count: failed })),
|
|
259
379
|
React.createElement(Icon, { icon: ChevronRight, size: 14, className: "ta-process-chevron" }))) : (status)),
|
|
260
380
|
shown && (React.createElement("div", { id: id, ref: stepsRef, className: "ta-process-steps" },
|
|
261
|
-
folded.hidden > 0 && (React.createElement("button", { type: "button", className: "ta-link ta-more", onClick: () => setShowAll(true) }, t('ta.process.earlier', { count:
|
|
262
|
-
|
|
381
|
+
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'))),
|
|
382
|
+
inline.map((step, index) => (React.createElement(Step, { key: step.key, step: step, results: results, tools: tools, tagged: !thoughtOnly, streaming: active && index === inline.length - 1 }))))),
|
|
383
|
+
pinned.map(step => (React.createElement(Markdown, { key: step.key, text: step.text })))));
|
|
263
384
|
}
|
|
264
385
|
/** A turn that has shown nothing yet: what ta does goes on its head. */
|
|
265
386
|
export function quiet(item) {
|
|
266
387
|
return (item === null || item === void 0 ? void 0 : item.kind) === 'turn' && item.active && !item.steps.length && !item.reply.some(text => text.trim());
|
|
267
388
|
}
|
|
389
|
+
/**
|
|
390
|
+
* A turn that ends with its steps, no words after them: the line of what ta does is one more of its steps
|
|
391
|
+
* (.ta-run-steps). Said by the class, not by `:last-child` in `:has()`: WebKit does not style the line
|
|
392
|
+
* again when the words under the steps go into them, and it stayed out of line until something else drew.
|
|
393
|
+
*/
|
|
394
|
+
export function endsInSteps(item) {
|
|
395
|
+
return (item === null || item === void 0 ? void 0 : item.kind) === 'turn' && item.steps.length > 0 && !item.reply.length;
|
|
396
|
+
}
|
|
268
397
|
function Turn({ item, tools, mood, status, latest, }) {
|
|
269
398
|
var _a;
|
|
270
399
|
const t = useT();
|
|
271
400
|
const session = React.useContext(ConversationSession);
|
|
272
401
|
const results = MessageUtil.results(item.messages);
|
|
273
402
|
const { errorMessage } = ((_a = item.last) !== null && _a !== void 0 ? _a : {});
|
|
274
|
-
const
|
|
403
|
+
const ending = ProcessUtil.ending(item);
|
|
275
404
|
const reply = item.reply.join('\n\n').trim();
|
|
405
|
+
const actions = React.useContext(MessageActions);
|
|
276
406
|
const [menu, onContextMenu] = useMessageMenu({
|
|
277
407
|
kind: 'turn',
|
|
278
408
|
last: item.active ? undefined : item.last,
|
|
@@ -281,13 +411,25 @@ function Turn({ item, tools, mood, status, latest, }) {
|
|
|
281
411
|
messages: item.messages,
|
|
282
412
|
});
|
|
283
413
|
return (React.createElement("div", { className: `ta-message ta-assistant ${item.active ? 'ta-turn-live' : ''}`, onContextMenu: onContextMenu },
|
|
284
|
-
React.createElement(Process, { steps: item.steps, active: item.active, results: results, tools: tools, leading: React.createElement(TurnAvatar, { mood: mood }), status: status }),
|
|
414
|
+
React.createElement(Process, { steps: item.steps, active: item.active, stopped: ending !== undefined && ending !== 'aborted', results: results, tools: tools, leading: React.createElement(TurnAvatar, { mood: mood }), status: status }),
|
|
285
415
|
item.reply.map((text, index) => (React.createElement(Markdown, { key: index, text: text, streaming: item.active && index === item.reply.length - 1 }))),
|
|
286
|
-
|
|
287
|
-
|
|
416
|
+
ending && ending !== 'aborted' && (React.createElement(TurnEnd, { ending: ending, error: errorMessage, retries: item.steps.filter(step => step.kind === 'error').length, resume: latest && !(actions === null || actions === void 0 ? void 0 : actions.working) ? actions === null || actions === void 0 ? void 0 : actions.resume : undefined })),
|
|
417
|
+
ending === 'aborted' && React.createElement("div", { className: "ta-muted ta-small" }, t('ta.message.stopped')),
|
|
288
418
|
!item.active && React.createElement(TurnFooter, { messages: item.messages, last: item.last, reply: reply, session: session, latest: latest }),
|
|
289
419
|
menu));
|
|
290
420
|
}
|
|
421
|
+
/**
|
|
422
|
+
* Why a turn stopped short, under it: the error (and that pi retried it, how many times), or that it was cut off,
|
|
423
|
+
* or ended without a word; the last turn has a button to go on, which says so to the agent.
|
|
424
|
+
*/
|
|
425
|
+
function TurnEnd({ ending, error, retries, resume }) {
|
|
426
|
+
const t = useT();
|
|
427
|
+
const action = resume && (React.createElement("button", { type: "button", className: "ta-button", onClick: resume }, t('ta.message.resume')));
|
|
428
|
+
if (ending === 'error') {
|
|
429
|
+
return (React.createElement(Callout, { level: "error", detail: retries ? t('ta.message.retriedFailed', { count: retries }) : undefined, action: action }, (error === null || error === void 0 ? void 0 : error.trim()) || t('ta.message.failedUnknown')));
|
|
430
|
+
}
|
|
431
|
+
return (React.createElement(Callout, { level: "warning", action: action }, t(ending === 'interrupted' ? 'ta.message.interrupted' : 'ta.message.silent')));
|
|
432
|
+
}
|
|
291
433
|
/** `!command` of a user, which pi records as its own kind of message. */
|
|
292
434
|
function BashMessage({ message }) {
|
|
293
435
|
const { command, output, exitCode } = message;
|
|
@@ -337,28 +479,33 @@ const ThreadRow = React.memo(function ThreadRow({ item, tools, mood, status, lat
|
|
|
337
479
|
(next.item.kind === 'message' || !next.item.active || previous.tools === next.tools));
|
|
338
480
|
/** The last rows, which change and are in view, are always laid out. */
|
|
339
481
|
const SETTLED_AFTER = 4;
|
|
340
|
-
/** The conversation; tool results show with the calls they answer. */
|
|
341
|
-
export function MessageList({ state, outbox }) {
|
|
482
|
+
/** The conversation; tool results show with the calls they answer. `rows`: only its latest rows are drawn, more as asked. */
|
|
483
|
+
export function MessageList({ state, outbox, rows }) {
|
|
342
484
|
var _a;
|
|
343
|
-
|
|
485
|
+
var _b;
|
|
344
486
|
const renderers = React.useContext(MessageRenderers);
|
|
487
|
+
const items = React.useMemo(() => ProcessUtil.items(state.messages, state.working, state.start, renderers), [state.messages, state.working, state.start, renderers]);
|
|
345
488
|
const breaks = React.useMemo(() => ProcessUtil.timeBreaks(ProcessUtil.starts(items), index => ProcessUtil.shown(items[index], renderers)), [items, renderers]);
|
|
489
|
+
const models = React.useMemo(() => ProcessUtil.modelBreaks(items), [items]);
|
|
346
490
|
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]);
|
|
491
|
+
// The rows held back: those before the latest `rows.rows`.
|
|
492
|
+
const from = rows ? Math.max(0, items.length - rows.rows) : 0;
|
|
493
|
+
if (rows) {
|
|
494
|
+
rows.hidden.current = from;
|
|
495
|
+
}
|
|
347
496
|
// Rows of earlier messages put in front are laid out once before they may skip it (content-visibility):
|
|
348
497
|
// their height is then known, and the view does not move as they come near it.
|
|
349
|
-
const firstKey = React.useRef((_a = items[
|
|
350
|
-
const front = Math.max(
|
|
498
|
+
const firstKey = React.useRef((_a = items[from]) === null || _a === void 0 ? void 0 : _a.key);
|
|
499
|
+
const front = Math.max(from, items.findIndex(item => item.key === firstKey.current));
|
|
351
500
|
React.useLayoutEffect(() => {
|
|
352
501
|
var _a;
|
|
353
|
-
firstKey.current = (_a = items[
|
|
502
|
+
firstKey.current = (_a = items[from]) === null || _a === void 0 ? void 0 : _a.key;
|
|
354
503
|
});
|
|
355
|
-
// Rows that come after the list is drawn come in with a motion; those of a conversation opened or loaded again,
|
|
356
|
-
|
|
357
|
-
const
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
}
|
|
361
|
-
count.current = items.length;
|
|
504
|
+
// Rows that come after the list is drawn come in with a motion; those of a conversation opened or loaded again,
|
|
505
|
+
// and those already there when earlier messages come in front of them, still: by key, not by index.
|
|
506
|
+
const freshRows = React.useRef(undefined);
|
|
507
|
+
(_b = freshRows.current) !== null && _b !== void 0 ? _b : (freshRows.current = new FreshRows(items));
|
|
508
|
+
const fresh = freshRows.current.from(items);
|
|
362
509
|
let lastTurn = items.length - 1;
|
|
363
510
|
while (lastTurn >= 0 && items[lastTurn].kind !== 'turn') {
|
|
364
511
|
lastTurn--;
|
|
@@ -369,17 +516,18 @@ export function MessageList({ state, outbox }) {
|
|
|
369
516
|
const status = state.working || state.compacting ? React.createElement(RunStatus, { state: state }) : undefined;
|
|
370
517
|
const onHead = status && quiet(last);
|
|
371
518
|
return (React.createElement(Outbox.Provider, { value: sent },
|
|
372
|
-
items.map((item, index) => (React.createElement("div", { key: item.key, className: [
|
|
519
|
+
items.map((item, index) => index < from ? null : (React.createElement("div", { key: item.key, className: [
|
|
373
520
|
'ta-thread-item',
|
|
374
521
|
index >= front && index < items.length - SETTLED_AFTER && 'ta-settled',
|
|
375
522
|
index === items.length - 1 && 'ta-thread-last',
|
|
376
|
-
index >=
|
|
523
|
+
index >= fresh && 'ta-thread-new',
|
|
377
524
|
item.kind === 'message' && item.message.role === 'user' && ASK_CLASS,
|
|
378
525
|
]
|
|
379
526
|
.filter(Boolean)
|
|
380
527
|
.join(' ') },
|
|
381
528
|
breaks[index] !== undefined && React.createElement(TimeBreak, { timestamp: breaks[index] }),
|
|
529
|
+
models[index] && React.createElement(ModelBreak, { model: models[index] }),
|
|
382
530
|
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 })))),
|
|
383
|
-
status && !onHead && React.createElement("div", { className:
|
|
531
|
+
status && !onHead && React.createElement("div", { className: `ta-run-line ${endsInSteps(last) ? 'ta-run-steps' : ''}` }, status)));
|
|
384
532
|
}
|
|
385
533
|
//# sourceMappingURL=message-list.js.map
|
|
@@ -37,7 +37,12 @@ export function useMessageMenu(subject) {
|
|
|
37
37
|
const items = [];
|
|
38
38
|
const text = subject.kind === 'user' ? subject.text : subject.reply;
|
|
39
39
|
if (text) {
|
|
40
|
-
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) });
|
|
41
46
|
}
|
|
42
47
|
if (subject.kind === 'user' && branches) {
|
|
43
48
|
items.push('-', { label: t('ta.message.forkBefore'), run: () => actions.fork(subject.message, 'before') }, { label: t('ta.message.rewind'), run: () => actions.rewind(subject.message) });
|
|
@@ -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,5 +1,7 @@
|
|
|
1
|
+
import type { TaWebExtensionInfo } from '@celljs/ta-protocol';
|
|
1
2
|
import type { Hold } from '../device/hold.js';
|
|
2
3
|
import { type WebViewEntry } from '../extension/web-extension-protocol.js';
|
|
4
|
+
import { type WebPageInfo } from '../extension/web-pages.js';
|
|
3
5
|
import { type NavigationSetting } from '../settings/navigation.js';
|
|
4
6
|
import type { ContextMenuItem } from './context-menu.js';
|
|
5
7
|
import type { PhoneTab } from './phone-shell.js';
|
|
@@ -37,13 +39,30 @@ export interface Navigation {
|
|
|
37
39
|
/** Those in the navigation, and those under Discover (NavigationUtil.arrange). */
|
|
38
40
|
nav: WebViewEntry[];
|
|
39
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[];
|
|
40
47
|
setting: NavigationSetting;
|
|
41
48
|
pin(id: string): void;
|
|
42
49
|
fold(id: string): void;
|
|
43
50
|
update(setting: NavigationSetting): void;
|
|
44
51
|
}
|
|
45
|
-
/**
|
|
46
|
-
|
|
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;
|
|
47
66
|
export interface PhoneTabLabels {
|
|
48
67
|
discover: string;
|
|
49
68
|
me: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Compass, PanelTop, User } from 'lucide-react';
|
|
2
2
|
import { WebLabelUtil } from '../extension/web-extension-protocol.js';
|
|
3
|
+
import { WebPagesUtil } from '../extension/web-pages.js';
|
|
3
4
|
import { NavigationUtil } from '../settings/navigation.js';
|
|
4
5
|
import { DOUBLE_PAGE } from './side-lists.js';
|
|
5
6
|
/* The places of the navigation, the same on the rail and in the tabs of a phone: which pages, in what order. */
|
|
@@ -26,13 +27,28 @@ export const ME_TAB = 'ta/me';
|
|
|
26
27
|
export function fixedTabs(views) {
|
|
27
28
|
return views.filter(view => view.location === 'sidebar').length + 2;
|
|
28
29
|
}
|
|
29
|
-
/**
|
|
30
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Where the pages of the rail go: the double's first when no sidebar view lists it, the rest as the user put them
|
|
32
|
+
* in the room there is. `own`: Discover lists pages of extensions started on open, so it is there in any case.
|
|
33
|
+
*/
|
|
34
|
+
export function places(views, setting, handheld, own = false) {
|
|
31
35
|
const all = railPages(views);
|
|
32
36
|
const home = all.find(view => view.id === DOUBLE_PAGE);
|
|
33
37
|
const pages = home ? all.filter(view => view !== home) : all;
|
|
34
38
|
const room = handheld ? Math.max(1, NavigationUtil.PHONE_TABS - fixedTabs(views) - (home ? 1 : 0)) : undefined;
|
|
35
|
-
return { home, pages, ...NavigationUtil.arrange(pages, setting, room) };
|
|
39
|
+
return { home, pages, ...NavigationUtil.arrange(pages, setting, room, own) };
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Where each page of the extensions is on this device (WebPageInfo.place): in the navigation, under Discover, or
|
|
43
|
+
* in a list; the pages of a kind that a page lists (the Games page) are only there.
|
|
44
|
+
*/
|
|
45
|
+
export function arrangeViews(views, onOpen, setting, handheld, infoOf, kinds) {
|
|
46
|
+
const arranged = places(views.filter(view => !WebPagesUtil.listed(infoOf(view.extension), kinds)), setting, handheld, onOpen.some(entry => !entry.info.temporary && !WebPagesUtil.listed(entry.info, kinds)));
|
|
47
|
+
return view => (view === arranged.home || arranged.nav.includes(view) ? 'navigation' : arranged.discover.includes(view) ? 'discover' : 'list');
|
|
48
|
+
}
|
|
49
|
+
/** Discover is in the navigation: some pages are under it. */
|
|
50
|
+
export function hasDiscover(navigation) {
|
|
51
|
+
return navigation.discover.length > 0 || navigation.onOpen.length > 0;
|
|
36
52
|
}
|
|
37
53
|
/**
|
|
38
54
|
* The tabs at the bottom of a phone, as a messaging app has them: the lists of the sidebar, the chats, the pages
|
|
@@ -51,7 +67,7 @@ export function phoneTabs(lists, navigation, labels) {
|
|
|
51
67
|
...(navigation.home ? [{ ...tab(navigation.home), double: true, hold: labels.holds.double }] : []),
|
|
52
68
|
...lists.map(list),
|
|
53
69
|
...navigation.nav.map(view => tab(view, [{ label: labels.fold, run: () => navigation.fold(view.id) }, '-', labels.settings])),
|
|
54
|
-
...(navigation
|
|
70
|
+
...(hasDiscover(navigation) ? [{ id: DISCOVER, label: labels.discover, icon: Compass, menu: [labels.settings] }] : []),
|
|
55
71
|
{ id: ME_TAB, label: labels.me, icon: User },
|
|
56
72
|
];
|
|
57
73
|
}
|
|
@@ -6,6 +6,7 @@ import { useT } from '../i18n/use-t.js';
|
|
|
6
6
|
import { NoticesUtil } from '../notices/notices.js';
|
|
7
7
|
import { LEVEL_ICONS } from './callout.js';
|
|
8
8
|
import { Icon, IconButton } from './icon.js';
|
|
9
|
+
import { NoticeFace } from './notice-face.js';
|
|
9
10
|
import { TerminalArt } from './terminal-art.js';
|
|
10
11
|
/** How long a notice takes to go, in style.ts. */
|
|
11
12
|
const LEAVE_MS = 160;
|
|
@@ -42,6 +43,36 @@ function useLifetime(notice, leave) {
|
|
|
42
43
|
onBlur: () => setHeld(false),
|
|
43
44
|
};
|
|
44
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* What a conversation said, as a messenger's banner: its face and name, what it asks beside it, the message in two
|
|
48
|
+
* lines; a tap opens it, its answers are buttons under it.
|
|
49
|
+
*/
|
|
50
|
+
function SessionToast({ notice, leaving, leave, hold, }) {
|
|
51
|
+
var _a;
|
|
52
|
+
const t = useT();
|
|
53
|
+
const { from } = notice;
|
|
54
|
+
const actions = [...((_a = notice.actions) !== null && _a !== void 0 ? _a : []), ...(notice.action ? [notice.action] : [])];
|
|
55
|
+
const open = () => {
|
|
56
|
+
from.open();
|
|
57
|
+
leave();
|
|
58
|
+
};
|
|
59
|
+
return (React.createElement("div", { className: `ta-toast ta-toast-session${leaving ? ' ta-leaving' : ''}`, role: from.status ? 'alert' : 'status', ...hold },
|
|
60
|
+
React.createElement("button", { type: "button", className: "ta-toast-open", onClick: open },
|
|
61
|
+
React.createElement("span", { className: "ta-toast-face" },
|
|
62
|
+
React.createElement(NoticeFace, { from: from, size: 38 })),
|
|
63
|
+
React.createElement("span", { className: "ta-toast-text" },
|
|
64
|
+
React.createElement("span", { className: "ta-toast-head" },
|
|
65
|
+
React.createElement("span", { className: "ta-toast-title" }, from.title),
|
|
66
|
+
from.status && (React.createElement("span", { className: `ta-chat-state ${from.status === 'ask' ? 'ta-waiting' : 'ta-failed'}` },
|
|
67
|
+
React.createElement("span", { className: `ta-status ${from.status === 'ask' ? 'ta-status-waiting' : 'ta-status-error'}` }),
|
|
68
|
+
t(from.status === 'ask' ? 'ta.task.waiting' : 'ta.task.failed')))),
|
|
69
|
+
React.createElement("span", { className: "ta-toast-message" }, notice.message))),
|
|
70
|
+
actions.length > 0 && (React.createElement("div", { className: "ta-toast-actions" }, actions.map(action => (React.createElement("button", { key: action.label, type: "button", className: "ta-toast-action", onClick: () => {
|
|
71
|
+
action.run();
|
|
72
|
+
leave();
|
|
73
|
+
} }, action.label))))),
|
|
74
|
+
React.createElement(IconButton, { icon: X, label: t('ta.dismiss'), className: "ta-toast-close", onClick: leave })));
|
|
75
|
+
}
|
|
45
76
|
function Toast({ notice, notices }) {
|
|
46
77
|
const t = useT();
|
|
47
78
|
const [leaving, setLeaving] = React.useState(false);
|
|
@@ -50,6 +81,9 @@ function Toast({ notice, notices }) {
|
|
|
50
81
|
setTimeout(() => notices.dismiss(notice.id), LEAVE_MS);
|
|
51
82
|
}, [notices, notice.id]);
|
|
52
83
|
const hold = useLifetime(notice, leave);
|
|
84
|
+
if (notice.from) {
|
|
85
|
+
return React.createElement(SessionToast, { notice: notice, leaving: leaving, leave: leave, hold: hold });
|
|
86
|
+
}
|
|
53
87
|
return (React.createElement("div", { className: `ta-toast ta-level-${notice.level}${notice.art ? ' ta-toast-with-art' : ''}${leaving ? ' ta-leaving' : ''}`, role: notice.level === 'error' ? 'alert' : 'status', ...hold },
|
|
54
88
|
React.createElement(Icon, { icon: LEVEL_ICONS[notice.level], size: 16, className: "ta-level-icon" }),
|
|
55
89
|
React.createElement("div", { className: "ta-toast-text" },
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { NoticeFrom } from '../notices/notices-protocol.js';
|
|
3
|
+
/**
|
|
4
|
+
* The face a conversation has in the lists, for a notice it gave (NoticeFrom): the double's, an agent's, else the
|
|
5
|
+
* letter of its directory in its color. Nothing while the lists do not have it.
|
|
6
|
+
*/
|
|
7
|
+
export declare function NoticeFace({ from, size }: {
|
|
8
|
+
from: NoticeFrom;
|
|
9
|
+
size: number;
|
|
10
|
+
}): React.JSX.Element | null;
|