@celljs/ta-web 4.10.0 → 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 +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 +44 -23
- 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 +18 -11
- 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 +76 -16
- 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 +14 -4
- package/esm/browser/components/composer-box.js +104 -64
- package/esm/browser/components/composer.d.ts +6 -6
- package/esm/browser/components/composer.js +5 -3
- package/esm/browser/components/conversation-scroll.d.ts +7 -0
- package/esm/browser/components/conversation-scroll.js +46 -7
- 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/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 +19 -2
- package/esm/browser/components/message-actions.js +2 -0
- package/esm/browser/components/message-footer.d.ts +6 -0
- package/esm/browser/components/message-footer.js +20 -3
- package/esm/browser/components/message-list.d.ts +57 -6
- package/esm/browser/components/message-list.js +152 -36
- 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 +96 -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.js +29 -19
- 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/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/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/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.js +6 -1
- package/esm/browser/device/sheet-swipe.js +8 -1
- 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 +166 -565
- 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 +44 -6
- package/esm/browser/extension/web-extension-protocol.js +33 -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 +118 -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 +82 -2
- package/esm/browser/i18n/messages.d.ts +81 -1
- package/esm/browser/i18n/messages.js +167 -7
- package/esm/browser/index.d.ts +9 -0
- package/esm/browser/index.js +9 -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 +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 +43 -5
- package/esm/browser/style/device.js +15 -1
- package/esm/browser/style/layout.d.ts +1 -1
- package/esm/browser/style/layout.js +189 -56
- package/esm/browser/style/pages.d.ts +1 -1
- package/esm/browser/style/pages.js +36 -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 +30 -6
- 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/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 +14 -2
- package/esm/browser/util/process.js +39 -8
- 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 +42 -21
- 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 +17 -10
- 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 +72 -12
- 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 +14 -4
- package/lib/browser/components/composer-box.js +102 -62
- package/lib/browser/components/composer.d.ts +6 -6
- package/lib/browser/components/composer.js +4 -2
- package/lib/browser/components/conversation-scroll.d.ts +7 -0
- package/lib/browser/components/conversation-scroll.js +46 -7
- 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/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 +19 -2
- package/lib/browser/components/message-actions.js +2 -0
- package/lib/browser/components/message-footer.d.ts +6 -0
- package/lib/browser/components/message-footer.js +20 -2
- package/lib/browser/components/message-list.d.ts +57 -6
- package/lib/browser/components/message-list.js +153 -34
- 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 +97 -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.js +26 -16
- 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/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/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/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.js +6 -1
- package/lib/browser/device/sheet-swipe.js +8 -1
- 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 +166 -565
- 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 +44 -6
- package/lib/browser/extension/web-extension-protocol.js +34 -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 +114 -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 +82 -2
- package/lib/browser/i18n/messages.d.ts +81 -1
- package/lib/browser/i18n/messages.js +167 -7
- package/lib/browser/index.d.ts +9 -0
- package/lib/browser/index.js +9 -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 +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 +43 -5
- package/lib/browser/style/device.js +15 -1
- package/lib/browser/style/layout.d.ts +1 -1
- package/lib/browser/style/layout.js +189 -56
- package/lib/browser/style/pages.d.ts +1 -1
- package/lib/browser/style/pages.js +36 -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 +30 -6
- 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/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 +14 -2
- package/lib/browser/util/process.js +39 -8
- 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
|
@@ -2,10 +2,14 @@ import { TaLocation } from '@celljs/ta-protocol';
|
|
|
2
2
|
import { ChevronRight, Folder, FolderTree, Plus, Search, Trash2, Undo2, X } from 'lucide-react';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { useDevice } from '../device/device.js';
|
|
5
|
-
import { ExtensionBoundary, SessionAvatars } from '../extension/extension-view.js';
|
|
5
|
+
import { ChatIcons, ExtensionBoundary, SessionAvatars, SessionMenus } from '../extension/extension-view.js';
|
|
6
6
|
import { useT } from '../i18n/use-t.js';
|
|
7
7
|
import { StateUtil } from '../state/state-protocol.js';
|
|
8
8
|
import { MessageUtil } from '../util/message.js';
|
|
9
|
+
import { WorkbenchUtil } from '../workbench-util.js';
|
|
10
|
+
import { useBusy } from './busy.js';
|
|
11
|
+
import { ChatIconTile, ChatIconUtil, useChatIcon } from './chat-icon.js';
|
|
12
|
+
import { ChatSeenUtil } from './chat-seen.js';
|
|
9
13
|
import { useContextMenu } from './context-menu.js';
|
|
10
14
|
import { EmptyState } from './empty-state.js';
|
|
11
15
|
import { HostTag } from './host-tag.js';
|
|
@@ -22,8 +26,20 @@ export const FOLDED = {
|
|
|
22
26
|
initial: [],
|
|
23
27
|
parse: value => (Array.isArray(value) ? value.filter((key) => typeof key === 'string') : undefined),
|
|
24
28
|
};
|
|
29
|
+
/** The conversations pinned to the top of the list, in any browser: their files (ChatListUtil.file). */
|
|
30
|
+
export const PINNED = {
|
|
31
|
+
key: 'chat.pinned',
|
|
32
|
+
tier: 'user',
|
|
33
|
+
initial: [],
|
|
34
|
+
parse: value => (Array.isArray(value) ? value.filter((file) => typeof file === 'string') : undefined),
|
|
35
|
+
};
|
|
25
36
|
const TONES = 6;
|
|
26
37
|
const DAY = 24 * 60 * 60000;
|
|
38
|
+
/**
|
|
39
|
+
* The rows drawn at first, and more each time the end of those comes near: a list of thousands of
|
|
40
|
+
* conversations opens and scrolls as one of a few dozen.
|
|
41
|
+
*/
|
|
42
|
+
export const CHAT_PAGE = 60;
|
|
27
43
|
export var ChatListUtil;
|
|
28
44
|
(function (ChatListUtil) {
|
|
29
45
|
function isOpen(entry) {
|
|
@@ -40,20 +56,82 @@ export var ChatListUtil;
|
|
|
40
56
|
return isOpen(entry) ? entry.sessionId : entry.sessionFile;
|
|
41
57
|
}
|
|
42
58
|
ChatListUtil.key = key;
|
|
59
|
+
/** What stays the same as it closes and opens again: its file, else (before it has one) the id of its session. */
|
|
60
|
+
function file(entry) {
|
|
61
|
+
var _a;
|
|
62
|
+
return (_a = entry.sessionFile) !== null && _a !== void 0 ? _a : entry.sessionId;
|
|
63
|
+
}
|
|
64
|
+
ChatListUtil.file = file;
|
|
65
|
+
/** Those pinned, and the rest, each in the order it had. */
|
|
66
|
+
function pinnedApart(sessions, pinned) {
|
|
67
|
+
const files = new Set(pinned);
|
|
68
|
+
return { pinned: sessions.filter(entry => files.has(file(entry))), rest: sessions.filter(entry => !files.has(file(entry))) };
|
|
69
|
+
}
|
|
70
|
+
ChatListUtil.pinnedApart = pinnedApart;
|
|
43
71
|
/**
|
|
44
|
-
* The open sessions and the saved ones, those taken out apart. A saved conversation of a
|
|
45
|
-
* is not listed: its package opens it again, with its role. An open one is always listed
|
|
72
|
+
* The open sessions and the saved ones, those archived and those taken out apart. A saved conversation of a
|
|
73
|
+
* package's group is not listed: its package opens it again, with its role. An open one is always listed,
|
|
74
|
+
* however old, and so is one pinned; a saved one not updated `since` is archived (a ta serve of before lists
|
|
75
|
+
* them with the others), or not updated since what `sooner` says of it (ChatIconUtil.archiveSince).
|
|
46
76
|
*/
|
|
47
|
-
function entries(sessions, saved, removed) {
|
|
77
|
+
function entries(sessions, saved, removed, archived = [], since, pinned = [], sooner) {
|
|
48
78
|
const open = new Set(sessions.map(session => session.sessionFile));
|
|
49
79
|
const out = new Set(removed);
|
|
50
|
-
const
|
|
80
|
+
const seen = new Set();
|
|
81
|
+
const closed = [...saved, ...archived].filter(session => {
|
|
82
|
+
if (session.group || open.has(session.sessionFile) || seen.has(session.sessionFile)) {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
seen.add(session.sessionFile);
|
|
86
|
+
return true;
|
|
87
|
+
});
|
|
88
|
+
const kept = new Set(pinned);
|
|
89
|
+
const recent = (session) => { var _a; return since === undefined || kept.has(session.sessionFile) || session.updatedAt >= Math.max(since, (_a = sooner === null || sooner === void 0 ? void 0 : sooner(session)) !== null && _a !== void 0 ? _a : since); };
|
|
51
90
|
return {
|
|
52
|
-
listed: [...sessions, ...closed.filter(session => !out.has(session.sessionFile))],
|
|
91
|
+
listed: [...sessions, ...closed.filter(session => recent(session) && !out.has(session.sessionFile))],
|
|
92
|
+
archived: closed.filter(session => !recent(session) && !out.has(session.sessionFile)),
|
|
53
93
|
removed: closed.filter(session => out.has(session.sessionFile)),
|
|
54
94
|
};
|
|
55
95
|
}
|
|
56
96
|
ChatListUtil.entries = entries;
|
|
97
|
+
/** Those updated since `before`, and the older, which the list folds; all are recent without it. */
|
|
98
|
+
function split(sessions, before) {
|
|
99
|
+
if (before === undefined) {
|
|
100
|
+
return [sessions, []];
|
|
101
|
+
}
|
|
102
|
+
const recent = [];
|
|
103
|
+
const older = [];
|
|
104
|
+
for (const session of sessions) {
|
|
105
|
+
(session.updatedAt >= before ? recent : older).push(session);
|
|
106
|
+
}
|
|
107
|
+
return [recent, older];
|
|
108
|
+
}
|
|
109
|
+
ChatListUtil.split = split;
|
|
110
|
+
/**
|
|
111
|
+
* Draws `count` rows of a list, and those it `keeps` however far down they are: the conversation shown, and
|
|
112
|
+
* those unseen, which the tab of the chats scrolls to (PhoneUtil.locate).
|
|
113
|
+
*/
|
|
114
|
+
function budget(count, keeps) {
|
|
115
|
+
let left = count;
|
|
116
|
+
let more = false;
|
|
117
|
+
return {
|
|
118
|
+
take(entries) {
|
|
119
|
+
let end = Math.max(0, Math.min(entries.length, left));
|
|
120
|
+
for (let at = entries.length - 1; keeps && at >= end; at--) {
|
|
121
|
+
if (keeps(entries[at])) {
|
|
122
|
+
end = at + 1;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
left -= end;
|
|
126
|
+
more || (more = end < entries.length);
|
|
127
|
+
return end === entries.length ? entries : entries.slice(0, end);
|
|
128
|
+
},
|
|
129
|
+
get more() {
|
|
130
|
+
return more;
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
ChatListUtil.budget = budget;
|
|
57
135
|
function sourceKey(session) {
|
|
58
136
|
return session.group ? `pkg:${session.group}` : `dir:${session.cwd}`;
|
|
59
137
|
}
|
|
@@ -176,7 +254,8 @@ export var ChatListUtil;
|
|
|
176
254
|
a.updatedAt === b.updatedAt &&
|
|
177
255
|
a.cwd === b.cwd &&
|
|
178
256
|
a.group === b.group &&
|
|
179
|
-
(isOpen(a) && a.isStreaming) === (isOpen(b) && b.isStreaming)
|
|
257
|
+
(isOpen(a) && a.isStreaming) === (isOpen(b) && b.isStreaming) &&
|
|
258
|
+
(isOpen(a) && !!a.waiting) === (isOpen(b) && !!b.waiting));
|
|
180
259
|
const x = before.source;
|
|
181
260
|
const y = after.source;
|
|
182
261
|
const sameSource = x === y || (x.key === y.key && x.label === y.label && x.title === y.title && x.host === y.host && x.initial === y.initial && x.tone === y.tone);
|
|
@@ -217,13 +296,18 @@ function useMinute() {
|
|
|
217
296
|
* The avatar of a row: the face of the double for its own conversation, the face an extension draws for its
|
|
218
297
|
* agents (registerAvatar), else the letter of its directory. A face works while the conversation answers.
|
|
219
298
|
*/
|
|
220
|
-
function ChatAvatar({ session, source, who, size, mood }) {
|
|
299
|
+
export function ChatAvatar({ session, source, who, size, mood }) {
|
|
221
300
|
var _a;
|
|
222
301
|
const avatars = React.useContext(SessionAvatars);
|
|
302
|
+
// A conversation of an extension that is no one to talk to (a brief, a question): the icon it gives.
|
|
303
|
+
const icon = useChatIcon(who ? undefined : session);
|
|
223
304
|
const letter = (React.createElement("span", { className: `ta-chat-avatar ta-tone-${source.tone}`, "aria-hidden": "true" }, source.initial));
|
|
224
305
|
if ((who === null || who === void 0 ? void 0 : who.kind) === 'double') {
|
|
225
306
|
return React.createElement(DinoFace, { className: "ta-chat-face", mood: mood, size: size });
|
|
226
307
|
}
|
|
308
|
+
if (icon) {
|
|
309
|
+
return React.createElement(ChatIconTile, { found: icon, size: size });
|
|
310
|
+
}
|
|
227
311
|
const Avatar = who && ChatListUtil.isOpen(session) && session.group ? avatars[session.group] : undefined;
|
|
228
312
|
if (!Avatar || !ChatListUtil.isOpen(session)) {
|
|
229
313
|
return letter;
|
|
@@ -232,9 +316,14 @@ function ChatAvatar({ session, source, who, size, mood }) {
|
|
|
232
316
|
React.createElement(ExtensionBoundary, { name: (_a = session.group) !== null && _a !== void 0 ? _a : '', resetKey: Avatar, fallback: letter },
|
|
233
317
|
React.createElement(Avatar, { session: session, mood: mood, size: size }))));
|
|
234
318
|
}
|
|
235
|
-
/** What goes on in it, on the line of a row of one line: answering now, or how the double's task ended. */
|
|
236
|
-
function ChatState({ streaming, task }) {
|
|
319
|
+
/** What goes on in it, on the line of a row of one line: waiting for the user, answering now, or how the double's task ended. */
|
|
320
|
+
function ChatState({ streaming, waiting, task }) {
|
|
237
321
|
const t = useT();
|
|
322
|
+
if (waiting) {
|
|
323
|
+
return (React.createElement("span", { className: "ta-chat-state ta-waiting" },
|
|
324
|
+
React.createElement("span", { className: "ta-status ta-status-waiting" }),
|
|
325
|
+
t('ta.task.waiting')));
|
|
326
|
+
}
|
|
238
327
|
if (streaming) {
|
|
239
328
|
return (React.createElement("span", { className: "ta-chat-state" },
|
|
240
329
|
React.createElement("span", { className: "ta-spinner" })));
|
|
@@ -246,12 +335,19 @@ function ChatState({ streaming, task }) {
|
|
|
246
335
|
}
|
|
247
336
|
return null;
|
|
248
337
|
}
|
|
249
|
-
|
|
338
|
+
/** Always there, so that it grows in and goes, the avatar never drawn again; told only while it is on. */
|
|
339
|
+
function UnseenDot({ on }) {
|
|
340
|
+
const t = useT();
|
|
341
|
+
return on ? React.createElement("span", { className: "ta-chat-dot ta-on", role: "img", "aria-label": t('ta.chat.unseen') }) : React.createElement("span", { className: "ta-chat-dot" });
|
|
342
|
+
}
|
|
343
|
+
const ChatItem = React.memo(function ChatItem({ session, source, selected, time, compact, actions, restorable, task, doubleName, handable, pinned, unseen, }) {
|
|
250
344
|
const t = useT();
|
|
251
345
|
const onSelect = () => actions.open(session);
|
|
252
|
-
const
|
|
346
|
+
const [removing, run] = useBusy();
|
|
347
|
+
const onRemove = () => void run(() => actions.remove(session));
|
|
253
348
|
const onRestore = restorable ? () => actions.restore(session) : undefined;
|
|
254
349
|
const onHand = handable ? () => actions.hand(session) : undefined;
|
|
350
|
+
const onPin = onRestore ? undefined : () => actions.pin(session, !pinned);
|
|
255
351
|
const avatars = React.useContext(SessionAvatars);
|
|
256
352
|
// The double's conversation is named after it; an agent's has its name (the extension named it so).
|
|
257
353
|
const who = doubleName !== undefined ? { kind: 'double', name: doubleName } : session.group && avatars[session.group] ? { kind: 'agent' } : undefined;
|
|
@@ -260,64 +356,90 @@ const ChatItem = React.memo(function ChatItem({ session, source, selected, time,
|
|
|
260
356
|
const [menu, openMenu] = useContextMenu();
|
|
261
357
|
const onContextMenu = (event) => openMenu(event, [
|
|
262
358
|
{ label: t('ta.chat.open'), run: onSelect },
|
|
359
|
+
...(onPin ? [{ label: t(pinned ? 'ta.chat.unpin' : 'ta.chat.pin'), run: onPin }] : []),
|
|
263
360
|
...(onHand ? [{ label: t('ta.chat.handToDouble'), run: onHand }] : []),
|
|
361
|
+
// What extensions add (Share…) before taking it out, which stays last.
|
|
362
|
+
...actions.extensionMenu(session, title),
|
|
264
363
|
onRestore ? { label: t('ta.chat.restore'), run: onRestore } : { label: t('ta.chat.remove'), run: () => onRemove === null || onRemove === void 0 ? void 0 : onRemove() },
|
|
265
364
|
]);
|
|
266
365
|
const tag = task && (React.createElement("span", { className: "ta-double-tag", title: t('ta.chat.doubleTagTitle') }, t('ta.chat.doubleTag')));
|
|
267
366
|
// On a phone, as in its messaging apps, a swipe to the left shows what its hover does behind the row.
|
|
268
367
|
const handheld = useDevice(device => device.handheld);
|
|
368
|
+
// As WeChat's: Pin, then Remove at the edge.
|
|
269
369
|
const swipe = onRestore
|
|
270
|
-
? { key: 'restore', label: t('ta.chat.restoreShort'), run: onRestore }
|
|
271
|
-
:
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
370
|
+
? [{ key: 'restore', label: t('ta.chat.restoreShort'), run: onRestore }]
|
|
371
|
+
: [
|
|
372
|
+
{ key: 'pin', label: t(pinned ? 'ta.chat.unpin' : 'ta.chat.pin'), run: () => onPin === null || onPin === void 0 ? void 0 : onPin() },
|
|
373
|
+
{ key: 'remove', label: t('ta.chat.removeShort'), danger: true, run: () => onRemove === null || onRemove === void 0 ? void 0 : onRemove() },
|
|
374
|
+
];
|
|
375
|
+
// A dialog of it waits for the user: it needs them, it does not answer meanwhile.
|
|
376
|
+
const waiting = ChatListUtil.isOpen(session) && !!session.waiting;
|
|
377
|
+
const streaming = ChatListUtil.isOpen(session) && session.isStreaming && !waiting;
|
|
378
|
+
const mood = waiting ? 'attention' : streaming ? 'working' : 'idle';
|
|
379
|
+
const state = React.createElement(ChatState, { streaming: streaming, waiting: waiting, task: task });
|
|
275
380
|
// As in a messaging app, the last thing said; its directory before the first, and on hover in place of its time.
|
|
276
381
|
const said = ChatListUtil.preview(session, title);
|
|
277
382
|
const place = who ? MessageUtil.basename(session.cwd) : source.label;
|
|
278
383
|
const ended = task === 'failed' || task === 'stopped' ? task : undefined;
|
|
279
|
-
return (React.createElement(SwipeRow, { as: "li", className: `ta-chat-row${selected ? ' ta-selected' : ''}${who ? ` ta-chat-${who.kind}` : ''}`, actions:
|
|
280
|
-
React.createElement("button", { type: "button", className: `ta-chat-item${compact ? ' ta-compact' : ''}`, title: `${title}\n${source.title}`, "aria-current": selected ? 'true' : undefined, onClick: onSelect }, compact ? (React.createElement("span", { className: "ta-chat-text" },
|
|
384
|
+
return (React.createElement(SwipeRow, { as: "li", className: `ta-chat-row${selected ? ' ta-selected' : ''}${who ? ` ta-chat-${who.kind}` : ''}`, "data-unseen": unseen ? '' : undefined, actions: swipe, overlay: menu, onContextMenu: onContextMenu },
|
|
385
|
+
React.createElement("button", { type: "button", className: `ta-chat-item${compact ? ' ta-compact' : ''}${removing ? ' ta-pending' : ''}`, title: `${title}\n${source.title}`, "aria-current": selected ? 'true' : undefined, onClick: onSelect }, compact ? (React.createElement("span", { className: "ta-chat-text" },
|
|
281
386
|
React.createElement("span", { className: "ta-chat-line" },
|
|
282
387
|
who && React.createElement(ChatAvatar, { session: session, source: source, who: who, size: 20, mood: mood }),
|
|
283
388
|
tag,
|
|
284
389
|
React.createElement("span", { className: "ta-chat-title" }, title),
|
|
285
390
|
state,
|
|
286
|
-
React.createElement(
|
|
287
|
-
|
|
391
|
+
React.createElement(UnseenDot, { on: !!unseen }),
|
|
392
|
+
React.createElement("span", { className: "ta-chat-time" }, removing && handheld ? React.createElement("span", { className: "ta-spinner ta-later" }) : time)))) : (React.createElement(React.Fragment, null,
|
|
393
|
+
React.createElement("span", { className: "ta-chat-avatar-box" },
|
|
394
|
+
React.createElement(ChatAvatar, { session: session, source: source, who: who, size: 38, mood: mood }),
|
|
395
|
+
React.createElement(UnseenDot, { on: !!unseen })),
|
|
288
396
|
React.createElement("span", { className: "ta-chat-text" },
|
|
289
397
|
React.createElement("span", { className: "ta-chat-line" },
|
|
290
398
|
tag,
|
|
291
399
|
React.createElement("span", { className: "ta-chat-title" }, title),
|
|
292
|
-
React.createElement("span", { className: "ta-chat-time" }, time),
|
|
400
|
+
React.createElement("span", { className: "ta-chat-time" }, removing && handheld ? React.createElement("span", { className: "ta-spinner ta-later" }) : time),
|
|
293
401
|
React.createElement("span", { className: "ta-chat-place" },
|
|
294
402
|
React.createElement(Icon, { icon: Folder, size: 12 }),
|
|
295
403
|
React.createElement("span", null, place))),
|
|
296
404
|
React.createElement("span", { className: "ta-chat-line" },
|
|
297
|
-
React.createElement("span", { className:
|
|
405
|
+
React.createElement("span", { className: `ta-chat-sub${unseen ? ' ta-unseen' : ''}` },
|
|
298
406
|
React.createElement(HostTag, { host: source.host }),
|
|
299
|
-
|
|
407
|
+
waiting && React.createElement("span", { className: "ta-chat-flag ta-waiting" },
|
|
408
|
+
"[",
|
|
409
|
+
t('ta.task.waiting'),
|
|
410
|
+
"]"),
|
|
411
|
+
ended && !streaming && !waiting && (React.createElement("span", { className: `ta-chat-flag ta-${ended}` },
|
|
300
412
|
"[",
|
|
301
413
|
t(ended === 'failed' ? 'ta.task.failed' : 'ta.task.stopped'),
|
|
302
414
|
"]")), said !== null && said !== void 0 ? said : (React.createElement("span", { className: "ta-chat-dir" },
|
|
303
415
|
React.createElement(Icon, { icon: Folder, size: 12 }),
|
|
304
416
|
place))),
|
|
305
417
|
streaming && React.createElement("span", { className: "ta-chat-state ta-spinner" })))))),
|
|
306
|
-
handheld ? null : onRestore ? (React.createElement(IconButton, { className: "ta-chat-delete", icon: Undo2, label: t('ta.chat.restore'), onClick: onRestore })) : (React.createElement(IconButton, { className: "ta-chat-delete", icon: Trash2, label: t('ta.sidebar.closeTitle'), onClick: onRemove }))));
|
|
418
|
+
handheld ? null : onRestore ? (React.createElement(IconButton, { className: "ta-chat-delete", icon: Undo2, label: t('ta.chat.restore'), onClick: onRestore })) : (React.createElement(IconButton, { className: "ta-chat-delete", icon: Trash2, label: t('ta.sidebar.closeTitle'), busy: removing, onClick: onRemove }))));
|
|
307
419
|
}, ChatListUtil.sameRow);
|
|
308
420
|
/**
|
|
309
421
|
* The conversations of the server, open or saved, the latest first, with a search and `+` for a new one:
|
|
310
|
-
* by directory or package, each group folding and with a `+` of its own, or by day. Those
|
|
311
|
-
* the end,
|
|
422
|
+
* by directory or package, each group folding and with a `+` of its own, or by day. Those not updated for
|
|
423
|
+
* `foldDays` are folded at the end (of each group), those for `archiveDays` archived after them, read when
|
|
424
|
+
* opened or searched, and those taken out last, folded, to put back. However long, it draws the rows of
|
|
425
|
+
* its first screens, and more as it is scrolled to its end.
|
|
312
426
|
*/
|
|
313
|
-
export function ChatList({ sessions, saved, removed: removedFiles, selected, chat, byDirectory, onByDirectory, folded, onFolded, onPicked, double, notice, }) {
|
|
427
|
+
export function ChatList({ sessions, saved, removed: removedFiles, archived: archivedSaved, onArchive, foldDays, archiveDays, selected, chat, byDirectory, onByDirectory, folded, onFolded, onPicked, double, notice, pinned, onPinned, looking, seen, }) {
|
|
314
428
|
const t = useT();
|
|
315
429
|
const now = useMinute();
|
|
316
430
|
const [query, setQuery] = React.useState('');
|
|
317
431
|
const [removedOpen, setRemovedOpen] = React.useState(false);
|
|
432
|
+
const [archiveOpen, setArchiveOpen] = React.useState(false);
|
|
433
|
+
// The older of the list by day, and the groups whose older are shown: folded each time the list is drawn anew.
|
|
434
|
+
const [olderOpen, setOlderOpen] = React.useState(false);
|
|
435
|
+
const [groupsOlder, setGroupsOlder] = React.useState([]);
|
|
436
|
+
// How many rows are drawn, for a search: another starts again from the first page.
|
|
437
|
+
const [paged, setPaged] = React.useState({ query, count: CHAT_PAGE });
|
|
438
|
+
const pageCount = typeof IntersectionObserver === 'undefined' ? Number.POSITIVE_INFINITY : paged.query === query ? paged.count : CHAT_PAGE;
|
|
318
439
|
// What the rows do reads the props of now, through one object that stays the same: no row is drawn again for it.
|
|
319
|
-
const
|
|
320
|
-
latest
|
|
440
|
+
const sessionMenus = React.useContext(SessionMenus);
|
|
441
|
+
const latest = React.useRef({ chat, double, onPicked, t, pinned, onPinned, sessionMenus });
|
|
442
|
+
latest.current = { chat, double, onPicked, t, pinned, onPinned, sessionMenus };
|
|
321
443
|
const actions = React.useMemo(() => {
|
|
322
444
|
const pick = (change) => {
|
|
323
445
|
void change;
|
|
@@ -325,7 +447,7 @@ export function ChatList({ sessions, saved, removed: removedFiles, selected, cha
|
|
|
325
447
|
};
|
|
326
448
|
return {
|
|
327
449
|
open: entry => pick(ChatListUtil.isOpen(entry) ? latest.current.chat.show(entry.sessionId) : latest.current.chat.resume(entry.sessionFile)),
|
|
328
|
-
remove: entry =>
|
|
450
|
+
remove: entry => latest.current.chat.remove(entry),
|
|
329
451
|
restore: entry => void latest.current.chat.restore(ChatListUtil.key(entry)),
|
|
330
452
|
hand: entry => {
|
|
331
453
|
var _a;
|
|
@@ -333,6 +455,23 @@ export function ChatList({ sessions, saved, removed: removedFiles, selected, cha
|
|
|
333
455
|
(_a = latest.current.double) === null || _a === void 0 ? void 0 : _a.hand(entry, ChatListUtil.title(entry, latest.current.t));
|
|
334
456
|
}
|
|
335
457
|
},
|
|
458
|
+
// The last pinned first, as several may be.
|
|
459
|
+
pin: (entry, pin) => {
|
|
460
|
+
const file = ChatListUtil.file(entry);
|
|
461
|
+
const others = latest.current.pinned.filter(other => other !== file);
|
|
462
|
+
latest.current.onPinned(pin ? [file, ...others] : others);
|
|
463
|
+
},
|
|
464
|
+
extensionMenu: (entry, title) => {
|
|
465
|
+
const open = ChatListUtil.isOpen(entry);
|
|
466
|
+
const session = {
|
|
467
|
+
sessionId: open ? entry.sessionId : undefined,
|
|
468
|
+
sessionFile: entry.sessionFile,
|
|
469
|
+
cwd: entry.cwd,
|
|
470
|
+
title,
|
|
471
|
+
group: open ? entry.group : undefined,
|
|
472
|
+
};
|
|
473
|
+
return latest.current.sessionMenus.flatMap(menu => menu(session)).filter(item => !item.disabled);
|
|
474
|
+
},
|
|
336
475
|
};
|
|
337
476
|
}, []);
|
|
338
477
|
// A failure is a notice of the chat.
|
|
@@ -341,18 +480,52 @@ export function ChatList({ sessions, saved, removed: removedFiles, selected, cha
|
|
|
341
480
|
onPicked();
|
|
342
481
|
};
|
|
343
482
|
// Worked out again only when the conversations or the search change, not as the minute or the selection does.
|
|
344
|
-
|
|
483
|
+
// The bounds of the archive and of the fold move once a day.
|
|
484
|
+
const searching = !!query.trim();
|
|
485
|
+
const since = WorkbenchUtil.daysAgo(now, archiveDays);
|
|
486
|
+
const foldBefore = searching ? undefined : WorkbenchUtil.daysAgo(now, foldDays);
|
|
487
|
+
// Those an extension archives sooner (WebChatIcon.archiveDays), asked again as its icons change.
|
|
488
|
+
const icons = React.useContext(ChatIcons);
|
|
489
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: its bounds move with the day, as `since` does
|
|
490
|
+
const sooner = React.useMemo(() => ChatIconUtil.archiveSince(icons.entries, now), [icons, since]);
|
|
491
|
+
const { listed, archived, removed } = React.useMemo(() => ChatListUtil.entries(sessions, saved, removedFiles, archivedSaved, since, pinned, sooner), [sessions, saved, removedFiles, archivedSaved, since, pinned, sooner]);
|
|
345
492
|
const sources = React.useMemo(() => ChatListUtil.sources(listed), [listed]);
|
|
346
|
-
|
|
493
|
+
// A search finds the archived too.
|
|
494
|
+
const shown = React.useMemo(() => ChatListUtil.filter(searching ? [...listed, ...archived] : listed, query, t), [listed, archived, searching, query, t]);
|
|
347
495
|
const shownRemoved = React.useMemo(() => ChatListUtil.filter(removed, query, t), [removed, query, t]);
|
|
496
|
+
// Those pinned are at the top, whatever their day or directory, as in a messenger.
|
|
497
|
+
const apart = React.useMemo(() => ChatListUtil.pinnedApart(shown, pinned), [shown, pinned]);
|
|
498
|
+
const lookedAt = looking ? sessions.find(session => session.sessionId === looking) : undefined;
|
|
499
|
+
const inFront = lookedAt && ChatListUtil.file(lookedAt);
|
|
348
500
|
// What a search finds is one list by day, wherever it is.
|
|
349
|
-
const grouped = byDirectory && sources.length > 1 && !
|
|
501
|
+
const grouped = byDirectory && sources.length > 1 && !searching;
|
|
502
|
+
const archiveShown = archiveDays > 0 && (archivedSaved ? archived.length > 0 : listed.length > 0);
|
|
503
|
+
const readArchive = () => {
|
|
504
|
+
if (archiveDays > 0) {
|
|
505
|
+
onArchive();
|
|
506
|
+
}
|
|
507
|
+
};
|
|
508
|
+
// One pinned long ago is in the archive, which the list reads for it.
|
|
509
|
+
const pinnedAway = !archivedSaved && pinned.some(file => !listed.some(session => ChatListUtil.file(session) === file) && !removedFiles.includes(file));
|
|
510
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: once as a search starts, or as the list has none (all may be archived) or misses one pinned
|
|
511
|
+
React.useEffect(() => {
|
|
512
|
+
if (searching || listed.length === 0 || pinnedAway) {
|
|
513
|
+
readArchive();
|
|
514
|
+
}
|
|
515
|
+
}, [searching, listed.length === 0, pinnedAway]);
|
|
350
516
|
const draftIn = (cwd) => pick(chat.draft().then(() => chat.setDraftCwd(cwd)));
|
|
351
517
|
const fold = (key) => onFolded(folded.includes(key) ? folded.filter(other => other !== key) : [...folded, key]);
|
|
352
|
-
const byKey = React.useMemo(() => new Map([...sources, ...ChatListUtil.sources(removed)].map(candidate => [candidate.key, candidate])), [sources, removed]);
|
|
353
|
-
const
|
|
518
|
+
const byKey = React.useMemo(() => new Map([...sources, ...ChatListUtil.sources([...archived, ...removed])].map(candidate => [candidate.key, candidate])), [sources, archived, removed]);
|
|
519
|
+
const isSelected = (session) => ChatListUtil.key(session) === selected;
|
|
520
|
+
const isUnseen = (session) => ChatSeenUtil.unseen({ ...session, isStreaming: ChatListUtil.isOpen(session) && session.isStreaming }, ChatListUtil.file(session), seen, inFront);
|
|
521
|
+
// What is folded or not drawn yet still has the conversation shown, and those unseen: the dot of the tab finds them.
|
|
522
|
+
const stays = (session) => isSelected(session) || isUnseen(session);
|
|
523
|
+
const budget = ChatListUtil.budget(pageCount, stays);
|
|
524
|
+
const pinnedFiles = React.useMemo(() => new Set(pinned), [pinned]);
|
|
525
|
+
const item = (session, compact) => (React.createElement(ChatItem, { key: ChatListUtil.key(session), session: session, source: byKey.get(ChatListUtil.sourceKey(session)), selected: ChatListUtil.key(session) === selected, time: ChatListUtil.clock(session.updatedAt, now), compact: compact, actions: actions, task: ChatListUtil.isOpen(session) ? double === null || double === void 0 ? void 0 : double.tasks.get(session.sessionId) : undefined, doubleName: double && ChatListUtil.isDouble(session, double) ? double.name : undefined, handable: !!double && ChatListUtil.isOpen(session) && !session.group && !double.tasks.has(session.sessionId) && !ChatListUtil.isDouble(session, double), pinned: pinnedFiles.has(ChatListUtil.file(session)), unseen: isUnseen(session) }));
|
|
354
526
|
// The conversation shown is found in the list, however it came to be shown: out of a search that hides it, and scrolled to.
|
|
355
527
|
const scroller = React.useRef(null);
|
|
528
|
+
const end = React.useRef(null);
|
|
356
529
|
const reveal = React.useRef(false);
|
|
357
530
|
const hidden = !!selected && listed.some(session => ChatListUtil.key(session) === selected) && !shown.some(session => ChatListUtil.key(session) === selected);
|
|
358
531
|
// biome-ignore lint/correctness/useExhaustiveDependencies: only when another conversation is shown
|
|
@@ -370,6 +543,85 @@ export function ChatList({ sessions, saved, removed: removedFiles, selected, cha
|
|
|
370
543
|
row.scrollIntoView({ block: 'nearest' });
|
|
371
544
|
}
|
|
372
545
|
});
|
|
546
|
+
// A toggle of what folds under a title: the older conversations, the archive, those taken out.
|
|
547
|
+
const toggle = (label, open, onClick, title) => (React.createElement("button", { type: "button", className: "ta-chat-section-title ta-chat-fold", "aria-expanded": open, title: title, onClick: onClick },
|
|
548
|
+
React.createElement(Icon, { icon: ChevronRight, size: 13 }),
|
|
549
|
+
label));
|
|
550
|
+
// The rows in the order of the list, as far as the budget goes: what is drawn after uses what is left.
|
|
551
|
+
const list = grouped
|
|
552
|
+
? ChatListUtil.groups(apart.rest, sources).map(({ source, sessions }) => {
|
|
553
|
+
const closed = folded.includes(source.key);
|
|
554
|
+
const [recent, older] = ChatListUtil.split(sessions, foldBefore);
|
|
555
|
+
const olderShown = groupsOlder.includes(source.key);
|
|
556
|
+
// Folded, a group still has the conversation shown and those unseen; so do its older ones.
|
|
557
|
+
const candidates = closed ? sessions.filter(stays) : olderShown ? sessions : [...recent, ...older.filter(stays)];
|
|
558
|
+
const rows = budget.take(candidates);
|
|
559
|
+
if (rows.length === 0 && candidates.length > 0) {
|
|
560
|
+
return null;
|
|
561
|
+
}
|
|
562
|
+
return (React.createElement("section", { key: source.key, className: "ta-chat-group" },
|
|
563
|
+
React.createElement("div", { className: "ta-chat-group-head" },
|
|
564
|
+
React.createElement("button", { type: "button", className: "ta-chat-group-toggle", "aria-expanded": !closed, title: source.title, onClick: () => fold(source.key) },
|
|
565
|
+
React.createElement("span", { className: `ta-chat-group-avatar ta-tone-${source.tone}`, "aria-hidden": "true" }, source.initial),
|
|
566
|
+
React.createElement(HostTag, { host: source.host }),
|
|
567
|
+
React.createElement("span", { className: "ta-chat-group-label" }, source.label),
|
|
568
|
+
React.createElement("span", { className: "ta-chat-group-count" }, sessions.length),
|
|
569
|
+
React.createElement(Icon, { icon: ChevronRight, size: 13, className: "ta-chat-group-chevron" })),
|
|
570
|
+
source.cwd && (React.createElement(IconButton, { className: "ta-chat-group-add", icon: Plus, label: t('ta.chat.newIn', { name: source.label }), onClick: () => draftIn(source.cwd) }))),
|
|
571
|
+
rows.length > 0 && React.createElement("ul", { className: "ta-side-list" }, rows.map(session => item(session, true))),
|
|
572
|
+
!closed &&
|
|
573
|
+
older.length > 0 &&
|
|
574
|
+
rows.length === candidates.length &&
|
|
575
|
+
toggle(t('ta.chat.olderCount', { days: foldDays, count: older.length }), olderShown, () => setGroupsOlder(olderShown ? groupsOlder.filter(key => key !== source.key) : [...groupsOlder, source.key]))));
|
|
576
|
+
})
|
|
577
|
+
: (() => {
|
|
578
|
+
const [recent, older] = ChatListUtil.split(apart.rest, foldBefore);
|
|
579
|
+
const sections = ChatListUtil.sections(recent, now).map(section => {
|
|
580
|
+
const rows = budget.take(section.sessions);
|
|
581
|
+
return (rows.length > 0 && (React.createElement("section", { key: section.id, className: "ta-chat-section" },
|
|
582
|
+
React.createElement("div", { className: "ta-chat-section-title" }, t(section.id)),
|
|
583
|
+
React.createElement("ul", { className: "ta-side-list" }, rows.map(session => item(session))))));
|
|
584
|
+
});
|
|
585
|
+
// Folded, the older still have the conversation shown and those unseen, drawn even before the rows above them are.
|
|
586
|
+
const cut = budget.more;
|
|
587
|
+
const olderRows = older.length > 0 ? budget.take(olderOpen ? older : older.filter(stays)) : [];
|
|
588
|
+
return [
|
|
589
|
+
...sections,
|
|
590
|
+
older.length > 0 && (!cut || olderRows.length > 0) && (React.createElement("section", { key: "older", className: "ta-chat-section ta-chat-older" },
|
|
591
|
+
toggle(t('ta.chat.olderCount', { days: foldDays, count: older.length }), olderOpen, () => setOlderOpen(!olderOpen)),
|
|
592
|
+
olderRows.length > 0 && React.createElement("ul", { className: "ta-side-list" }, olderRows.map(session => item(session))))),
|
|
593
|
+
];
|
|
594
|
+
})();
|
|
595
|
+
// The archive, after the list once it is all drawn: read each time it opens, as it is not read with the list.
|
|
596
|
+
const archive = !searching && archiveShown && !budget.more && (React.createElement("section", { className: "ta-chat-section ta-chat-archive" },
|
|
597
|
+
toggle(archivedSaved ? t('ta.chat.archivedCount', { count: archived.length }) : t('ta.chat.archived'), archiveOpen, () => {
|
|
598
|
+
if (!archiveOpen) {
|
|
599
|
+
readArchive();
|
|
600
|
+
}
|
|
601
|
+
setArchiveOpen(!archiveOpen);
|
|
602
|
+
}, t('ta.chat.archivedHint', { count: archiveDays })),
|
|
603
|
+
archiveOpen &&
|
|
604
|
+
(archivedSaved ? (React.createElement("ul", { className: "ta-side-list" }, budget.take(ChatListUtil.filter(archived, '', t)).map(session => item(session)))) : (React.createElement("div", { className: "ta-chat-archive-wait" },
|
|
605
|
+
React.createElement("span", { className: "ta-spinner" }))))));
|
|
606
|
+
const taken = shownRemoved.length > 0 && !budget.more && (React.createElement("section", { className: "ta-chat-section ta-chat-removed" },
|
|
607
|
+
toggle(t('ta.chat.removed', { count: shownRemoved.length }), removedOpen, () => setRemovedOpen(!removedOpen)),
|
|
608
|
+
removedOpen && (React.createElement("ul", { className: "ta-side-list" }, budget.take(shownRemoved).map(session => (React.createElement(ChatItem, { key: ChatListUtil.key(session), session: session, source: byKey.get(ChatListUtil.sourceKey(session)), selected: false, time: ChatListUtil.clock(session.updatedAt, now), actions: actions, restorable: true })))))));
|
|
609
|
+
// Near the end of what is drawn, the next page is: the mark at the end is seen well before it scrolls into view.
|
|
610
|
+
const more = budget.more;
|
|
611
|
+
React.useEffect(() => {
|
|
612
|
+
const mark = end.current;
|
|
613
|
+
if (!more || !mark) {
|
|
614
|
+
return;
|
|
615
|
+
}
|
|
616
|
+
const observer = new IntersectionObserver(entries => {
|
|
617
|
+
// Drawn between the frames of the scroll, not in one of them.
|
|
618
|
+
if (entries.some(entry => entry.isIntersecting)) {
|
|
619
|
+
React.startTransition(() => setPaged({ query, count: pageCount + CHAT_PAGE }));
|
|
620
|
+
}
|
|
621
|
+
}, { root: scroller.current, rootMargin: '0px 0px 800px 0px' });
|
|
622
|
+
observer.observe(mark);
|
|
623
|
+
return () => observer.disconnect();
|
|
624
|
+
}, [more, pageCount, query]);
|
|
373
625
|
return (React.createElement("section", { className: "ta-chats", "aria-label": t('ta.chat') },
|
|
374
626
|
React.createElement("header", { className: "ta-chats-head" },
|
|
375
627
|
React.createElement("label", { className: "ta-chats-search" },
|
|
@@ -379,30 +631,13 @@ export function ChatList({ sessions, saved, removed: removedFiles, selected, cha
|
|
|
379
631
|
React.createElement(IconButton, { className: "ta-chats-add", icon: Plus, label: t('ta.chat.new'), onClick: () => pick(chat.draft()) })),
|
|
380
632
|
notice,
|
|
381
633
|
React.createElement("div", { className: "ta-side-scroll", ref: scroller },
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
const rows = closed ? sessions.filter(session => ChatListUtil.key(session) === selected) : sessions;
|
|
387
|
-
return (React.createElement("section", { key: source.key, className: "ta-chat-group" },
|
|
388
|
-
React.createElement("div", { className: "ta-chat-group-head" },
|
|
389
|
-
React.createElement("button", { type: "button", className: "ta-chat-group-toggle", "aria-expanded": !closed, title: source.title, onClick: () => fold(source.key) },
|
|
390
|
-
React.createElement("span", { className: `ta-chat-group-avatar ta-tone-${source.tone}`, "aria-hidden": "true" }, source.initial),
|
|
391
|
-
React.createElement(HostTag, { host: source.host }),
|
|
392
|
-
React.createElement("span", { className: "ta-chat-group-label" }, source.label),
|
|
393
|
-
React.createElement("span", { className: "ta-chat-group-count" }, sessions.length),
|
|
394
|
-
React.createElement(Icon, { icon: ChevronRight, size: 13, className: "ta-chat-group-chevron" })),
|
|
395
|
-
source.cwd && (React.createElement(IconButton, { className: "ta-chat-group-add", icon: Plus, label: t('ta.chat.newIn', { name: source.label }), onClick: () => draftIn(source.cwd) }))),
|
|
396
|
-
rows.length > 0 && React.createElement("ul", { className: "ta-side-list" }, rows.map(session => item(session, true)))));
|
|
397
|
-
})
|
|
398
|
-
: ChatListUtil.sections(shown, now).map(section => (React.createElement("section", { key: section.id, className: "ta-chat-section" },
|
|
399
|
-
React.createElement("div", { className: "ta-chat-section-title" }, t(section.id)),
|
|
400
|
-
React.createElement("ul", { className: "ta-side-list" }, section.sessions.map(session => item(session)))))),
|
|
634
|
+
apart.pinned.length > 0 && (React.createElement("section", { className: "ta-chat-section ta-chat-pinned" },
|
|
635
|
+
React.createElement("div", { className: "ta-chat-section-title" }, t('ta.chat.pinned')),
|
|
636
|
+
React.createElement("ul", { className: "ta-side-list" }, apart.pinned.map(session => item(session))))),
|
|
637
|
+
list,
|
|
401
638
|
shown.length === 0 && (React.createElement(EmptyState, { title: t(listed.length ? 'ta.chat.noMatch' : 'ta.chat.none'), hint: listed.length ? undefined : t('ta.chat.noneHint') })),
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
t('ta.chat.removed', { count: shownRemoved.length })),
|
|
406
|
-
removedOpen && (React.createElement("ul", { className: "ta-side-list" }, shownRemoved.map(session => (React.createElement(ChatItem, { key: ChatListUtil.key(session), session: session, source: byKey.get(ChatListUtil.sourceKey(session)), selected: false, time: ChatListUtil.clock(session.updatedAt, now), actions: actions, restorable: true }))))))))));
|
|
639
|
+
archive,
|
|
640
|
+
taken,
|
|
641
|
+
more && React.createElement("div", { ref: end, className: "ta-chat-more", "aria-hidden": "true" }))));
|
|
407
642
|
}
|
|
408
643
|
//# sourceMappingURL=chat-list.js.map
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { StateSpec } from '../state/state-protocol.js';
|
|
2
|
+
/**
|
|
3
|
+
* When the user last saw each conversation at rest, by its file (ChatListUtil.file), and since when this is
|
|
4
|
+
* kept: a conversation that said something after that, while the user was elsewhere, is unseen.
|
|
5
|
+
*/
|
|
6
|
+
export interface ChatSeen {
|
|
7
|
+
/** 0 until it is first kept: then nothing is unseen. */
|
|
8
|
+
since: number;
|
|
9
|
+
at: Record<string, number>;
|
|
10
|
+
}
|
|
11
|
+
/** The same on every device: one seen on the phone is seen on the computer too. */
|
|
12
|
+
export declare const SEEN_CHATS: StateSpec<ChatSeen>;
|
|
13
|
+
export declare namespace ChatSeenUtil {
|
|
14
|
+
function parse(value: unknown): ChatSeen | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* What two pages saw together: each conversation seen as late as either saw it, kept since the later of
|
|
17
|
+
* the two (what one forgot past KEPT, the other forgets too). `a` itself when `b` adds nothing.
|
|
18
|
+
*/
|
|
19
|
+
function merge(a: ChatSeen, b: ChatSeen): ChatSeen;
|
|
20
|
+
/**
|
|
21
|
+
* Whether it said something the user has not seen: it is not answering now, not the one in front, and its
|
|
22
|
+
* last message came after the user last saw it at rest (or, never seen, after `since`).
|
|
23
|
+
*/
|
|
24
|
+
function unseen(entry: {
|
|
25
|
+
updatedAt: number;
|
|
26
|
+
messageCount: number;
|
|
27
|
+
isStreaming?: boolean;
|
|
28
|
+
}, file: string, seen: ChatSeen, shown?: string): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Whether any of the conversations the list shows (ChatListUtil.entries, those listed) said something unseen:
|
|
31
|
+
* the dot on the tab of the chats. Only those: one the list leaves out (a package's, closed) has no row to find.
|
|
32
|
+
*/
|
|
33
|
+
function anyUnseen(entries: readonly {
|
|
34
|
+
updatedAt: number;
|
|
35
|
+
messageCount: number;
|
|
36
|
+
isStreaming?: boolean;
|
|
37
|
+
sessionFile?: string;
|
|
38
|
+
sessionId?: string;
|
|
39
|
+
}[], seen: ChatSeen, shown?: string): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Everything seen at once, as the user drags the dot of the tab away: kept since the latest of now and of what
|
|
42
|
+
* the conversations said last (the clocks of the page and the computer may differ). One answering goes on, and
|
|
43
|
+
* has a dot again once it said something more.
|
|
44
|
+
*/
|
|
45
|
+
function seeAll(seen: ChatSeen, entries: readonly {
|
|
46
|
+
updatedAt: number;
|
|
47
|
+
}[], now: number): ChatSeen;
|
|
48
|
+
/**
|
|
49
|
+
* Seen now, at rest, its last message at `updatedAt`: the kept value with it, or undefined when nothing
|
|
50
|
+
* changes. The clocks of the page and the computer may differ: it is seen at least as late as its last message.
|
|
51
|
+
*/
|
|
52
|
+
function look(seen: ChatSeen, file: string, updatedAt: number, now: number): ChatSeen | undefined;
|
|
53
|
+
}
|