@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
|
@@ -33,7 +33,8 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.ChatListUtil = exports.FOLDED = exports.BY_DIRECTORY = void 0;
|
|
36
|
+
exports.ChatListUtil = exports.CHAT_PAGE = exports.PINNED = exports.FOLDED = exports.BY_DIRECTORY = void 0;
|
|
37
|
+
exports.ChatAvatar = ChatAvatar;
|
|
37
38
|
exports.ChatList = ChatList;
|
|
38
39
|
const ta_protocol_1 = require("@celljs/ta-protocol");
|
|
39
40
|
const lucide_react_1 = require("lucide-react");
|
|
@@ -43,6 +44,10 @@ const extension_view_1 = require("../extension/extension-view");
|
|
|
43
44
|
const use_t_1 = require("../i18n/use-t");
|
|
44
45
|
const state_protocol_1 = require("../state/state-protocol");
|
|
45
46
|
const message_1 = require("../util/message");
|
|
47
|
+
const workbench_util_1 = require("../workbench-util");
|
|
48
|
+
const busy_1 = require("./busy");
|
|
49
|
+
const chat_icon_1 = require("./chat-icon");
|
|
50
|
+
const chat_seen_1 = require("./chat-seen");
|
|
46
51
|
const context_menu_1 = require("./context-menu");
|
|
47
52
|
const empty_state_1 = require("./empty-state");
|
|
48
53
|
const host_tag_1 = require("./host-tag");
|
|
@@ -59,8 +64,20 @@ exports.FOLDED = {
|
|
|
59
64
|
initial: [],
|
|
60
65
|
parse: value => (Array.isArray(value) ? value.filter((key) => typeof key === 'string') : undefined),
|
|
61
66
|
};
|
|
67
|
+
/** The conversations pinned to the top of the list, in any browser: their files (ChatListUtil.file). */
|
|
68
|
+
exports.PINNED = {
|
|
69
|
+
key: 'chat.pinned',
|
|
70
|
+
tier: 'user',
|
|
71
|
+
initial: [],
|
|
72
|
+
parse: value => (Array.isArray(value) ? value.filter((file) => typeof file === 'string') : undefined),
|
|
73
|
+
};
|
|
62
74
|
const TONES = 6;
|
|
63
75
|
const DAY = 24 * 60 * 60000;
|
|
76
|
+
/**
|
|
77
|
+
* The rows drawn at first, and more each time the end of those comes near: a list of thousands of
|
|
78
|
+
* conversations opens and scrolls as one of a few dozen.
|
|
79
|
+
*/
|
|
80
|
+
exports.CHAT_PAGE = 60;
|
|
64
81
|
var ChatListUtil;
|
|
65
82
|
(function (ChatListUtil) {
|
|
66
83
|
function isOpen(entry) {
|
|
@@ -77,20 +94,82 @@ var ChatListUtil;
|
|
|
77
94
|
return isOpen(entry) ? entry.sessionId : entry.sessionFile;
|
|
78
95
|
}
|
|
79
96
|
ChatListUtil.key = key;
|
|
97
|
+
/** What stays the same as it closes and opens again: its file, else (before it has one) the id of its session. */
|
|
98
|
+
function file(entry) {
|
|
99
|
+
var _a;
|
|
100
|
+
return (_a = entry.sessionFile) !== null && _a !== void 0 ? _a : entry.sessionId;
|
|
101
|
+
}
|
|
102
|
+
ChatListUtil.file = file;
|
|
103
|
+
/** Those pinned, and the rest, each in the order it had. */
|
|
104
|
+
function pinnedApart(sessions, pinned) {
|
|
105
|
+
const files = new Set(pinned);
|
|
106
|
+
return { pinned: sessions.filter(entry => files.has(file(entry))), rest: sessions.filter(entry => !files.has(file(entry))) };
|
|
107
|
+
}
|
|
108
|
+
ChatListUtil.pinnedApart = pinnedApart;
|
|
80
109
|
/**
|
|
81
|
-
* The open sessions and the saved ones, those taken out apart. A saved conversation of a
|
|
82
|
-
* is not listed: its package opens it again, with its role. An open one is always listed
|
|
110
|
+
* The open sessions and the saved ones, those archived and those taken out apart. A saved conversation of a
|
|
111
|
+
* package's group is not listed: its package opens it again, with its role. An open one is always listed,
|
|
112
|
+
* however old, and so is one pinned; a saved one not updated `since` is archived (a ta serve of before lists
|
|
113
|
+
* them with the others), or not updated since what `sooner` says of it (ChatIconUtil.archiveSince).
|
|
83
114
|
*/
|
|
84
|
-
function entries(sessions, saved, removed) {
|
|
115
|
+
function entries(sessions, saved, removed, archived = [], since, pinned = [], sooner) {
|
|
85
116
|
const open = new Set(sessions.map(session => session.sessionFile));
|
|
86
117
|
const out = new Set(removed);
|
|
87
|
-
const
|
|
118
|
+
const seen = new Set();
|
|
119
|
+
const closed = [...saved, ...archived].filter(session => {
|
|
120
|
+
if (session.group || open.has(session.sessionFile) || seen.has(session.sessionFile)) {
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
seen.add(session.sessionFile);
|
|
124
|
+
return true;
|
|
125
|
+
});
|
|
126
|
+
const kept = new Set(pinned);
|
|
127
|
+
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); };
|
|
88
128
|
return {
|
|
89
|
-
listed: [...sessions, ...closed.filter(session => !out.has(session.sessionFile))],
|
|
129
|
+
listed: [...sessions, ...closed.filter(session => recent(session) && !out.has(session.sessionFile))],
|
|
130
|
+
archived: closed.filter(session => !recent(session) && !out.has(session.sessionFile)),
|
|
90
131
|
removed: closed.filter(session => out.has(session.sessionFile)),
|
|
91
132
|
};
|
|
92
133
|
}
|
|
93
134
|
ChatListUtil.entries = entries;
|
|
135
|
+
/** Those updated since `before`, and the older, which the list folds; all are recent without it. */
|
|
136
|
+
function split(sessions, before) {
|
|
137
|
+
if (before === undefined) {
|
|
138
|
+
return [sessions, []];
|
|
139
|
+
}
|
|
140
|
+
const recent = [];
|
|
141
|
+
const older = [];
|
|
142
|
+
for (const session of sessions) {
|
|
143
|
+
(session.updatedAt >= before ? recent : older).push(session);
|
|
144
|
+
}
|
|
145
|
+
return [recent, older];
|
|
146
|
+
}
|
|
147
|
+
ChatListUtil.split = split;
|
|
148
|
+
/**
|
|
149
|
+
* Draws `count` rows of a list, and those it `keeps` however far down they are: the conversation shown, and
|
|
150
|
+
* those unseen, which the tab of the chats scrolls to (PhoneUtil.locate).
|
|
151
|
+
*/
|
|
152
|
+
function budget(count, keeps) {
|
|
153
|
+
let left = count;
|
|
154
|
+
let more = false;
|
|
155
|
+
return {
|
|
156
|
+
take(entries) {
|
|
157
|
+
let end = Math.max(0, Math.min(entries.length, left));
|
|
158
|
+
for (let at = entries.length - 1; keeps && at >= end; at--) {
|
|
159
|
+
if (keeps(entries[at])) {
|
|
160
|
+
end = at + 1;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
left -= end;
|
|
164
|
+
more || (more = end < entries.length);
|
|
165
|
+
return end === entries.length ? entries : entries.slice(0, end);
|
|
166
|
+
},
|
|
167
|
+
get more() {
|
|
168
|
+
return more;
|
|
169
|
+
},
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
ChatListUtil.budget = budget;
|
|
94
173
|
function sourceKey(session) {
|
|
95
174
|
return session.group ? `pkg:${session.group}` : `dir:${session.cwd}`;
|
|
96
175
|
}
|
|
@@ -213,7 +292,8 @@ var ChatListUtil;
|
|
|
213
292
|
a.updatedAt === b.updatedAt &&
|
|
214
293
|
a.cwd === b.cwd &&
|
|
215
294
|
a.group === b.group &&
|
|
216
|
-
(isOpen(a) && a.isStreaming) === (isOpen(b) && b.isStreaming)
|
|
295
|
+
(isOpen(a) && a.isStreaming) === (isOpen(b) && b.isStreaming) &&
|
|
296
|
+
(isOpen(a) && !!a.waiting) === (isOpen(b) && !!b.waiting));
|
|
217
297
|
const x = before.source;
|
|
218
298
|
const y = after.source;
|
|
219
299
|
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);
|
|
@@ -257,10 +337,15 @@ function useMinute() {
|
|
|
257
337
|
function ChatAvatar({ session, source, who, size, mood }) {
|
|
258
338
|
var _a;
|
|
259
339
|
const avatars = React.useContext(extension_view_1.SessionAvatars);
|
|
340
|
+
// A conversation of an extension that is no one to talk to (a brief, a question): the icon it gives.
|
|
341
|
+
const icon = (0, chat_icon_1.useChatIcon)(who ? undefined : session);
|
|
260
342
|
const letter = (React.createElement("span", { className: `ta-chat-avatar ta-tone-${source.tone}`, "aria-hidden": "true" }, source.initial));
|
|
261
343
|
if ((who === null || who === void 0 ? void 0 : who.kind) === 'double') {
|
|
262
344
|
return React.createElement(ta_avatar_1.DinoFace, { className: "ta-chat-face", mood: mood, size: size });
|
|
263
345
|
}
|
|
346
|
+
if (icon) {
|
|
347
|
+
return React.createElement(chat_icon_1.ChatIconTile, { found: icon, size: size });
|
|
348
|
+
}
|
|
264
349
|
const Avatar = who && ChatListUtil.isOpen(session) && session.group ? avatars[session.group] : undefined;
|
|
265
350
|
if (!Avatar || !ChatListUtil.isOpen(session)) {
|
|
266
351
|
return letter;
|
|
@@ -269,9 +354,14 @@ function ChatAvatar({ session, source, who, size, mood }) {
|
|
|
269
354
|
React.createElement(extension_view_1.ExtensionBoundary, { name: (_a = session.group) !== null && _a !== void 0 ? _a : '', resetKey: Avatar, fallback: letter },
|
|
270
355
|
React.createElement(Avatar, { session: session, mood: mood, size: size }))));
|
|
271
356
|
}
|
|
272
|
-
/** What goes on in it, on the line of a row of one line: answering now, or how the double's task ended. */
|
|
273
|
-
function ChatState({ streaming, task }) {
|
|
357
|
+
/** 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. */
|
|
358
|
+
function ChatState({ streaming, waiting, task }) {
|
|
274
359
|
const t = (0, use_t_1.useT)();
|
|
360
|
+
if (waiting) {
|
|
361
|
+
return (React.createElement("span", { className: "ta-chat-state ta-waiting" },
|
|
362
|
+
React.createElement("span", { className: "ta-status ta-status-waiting" }),
|
|
363
|
+
t('ta.task.waiting')));
|
|
364
|
+
}
|
|
275
365
|
if (streaming) {
|
|
276
366
|
return (React.createElement("span", { className: "ta-chat-state" },
|
|
277
367
|
React.createElement("span", { className: "ta-spinner" })));
|
|
@@ -283,12 +373,19 @@ function ChatState({ streaming, task }) {
|
|
|
283
373
|
}
|
|
284
374
|
return null;
|
|
285
375
|
}
|
|
286
|
-
|
|
376
|
+
/** Always there, so that it grows in and goes, the avatar never drawn again; told only while it is on. */
|
|
377
|
+
function UnseenDot({ on }) {
|
|
378
|
+
const t = (0, use_t_1.useT)();
|
|
379
|
+
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" });
|
|
380
|
+
}
|
|
381
|
+
const ChatItem = React.memo(function ChatItem({ session, source, selected, time, compact, actions, restorable, task, doubleName, handable, pinned, unseen, }) {
|
|
287
382
|
const t = (0, use_t_1.useT)();
|
|
288
383
|
const onSelect = () => actions.open(session);
|
|
289
|
-
const
|
|
384
|
+
const [removing, run] = (0, busy_1.useBusy)();
|
|
385
|
+
const onRemove = () => void run(() => actions.remove(session));
|
|
290
386
|
const onRestore = restorable ? () => actions.restore(session) : undefined;
|
|
291
387
|
const onHand = handable ? () => actions.hand(session) : undefined;
|
|
388
|
+
const onPin = onRestore ? undefined : () => actions.pin(session, !pinned);
|
|
292
389
|
const avatars = React.useContext(extension_view_1.SessionAvatars);
|
|
293
390
|
// The double's conversation is named after it; an agent's has its name (the extension named it so).
|
|
294
391
|
const who = doubleName !== undefined ? { kind: 'double', name: doubleName } : session.group && avatars[session.group] ? { kind: 'agent' } : undefined;
|
|
@@ -297,64 +394,90 @@ const ChatItem = React.memo(function ChatItem({ session, source, selected, time,
|
|
|
297
394
|
const [menu, openMenu] = (0, context_menu_1.useContextMenu)();
|
|
298
395
|
const onContextMenu = (event) => openMenu(event, [
|
|
299
396
|
{ label: t('ta.chat.open'), run: onSelect },
|
|
397
|
+
...(onPin ? [{ label: t(pinned ? 'ta.chat.unpin' : 'ta.chat.pin'), run: onPin }] : []),
|
|
300
398
|
...(onHand ? [{ label: t('ta.chat.handToDouble'), run: onHand }] : []),
|
|
399
|
+
// What extensions add (Share…) before taking it out, which stays last.
|
|
400
|
+
...actions.extensionMenu(session, title),
|
|
301
401
|
onRestore ? { label: t('ta.chat.restore'), run: onRestore } : { label: t('ta.chat.remove'), run: () => onRemove === null || onRemove === void 0 ? void 0 : onRemove() },
|
|
302
402
|
]);
|
|
303
403
|
const tag = task && (React.createElement("span", { className: "ta-double-tag", title: t('ta.chat.doubleTagTitle') }, t('ta.chat.doubleTag')));
|
|
304
404
|
// On a phone, as in its messaging apps, a swipe to the left shows what its hover does behind the row.
|
|
305
405
|
const handheld = (0, device_1.useDevice)(device => device.handheld);
|
|
406
|
+
// As WeChat's: Pin, then Remove at the edge.
|
|
306
407
|
const swipe = onRestore
|
|
307
|
-
? { key: 'restore', label: t('ta.chat.restoreShort'), run: onRestore }
|
|
308
|
-
:
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
408
|
+
? [{ key: 'restore', label: t('ta.chat.restoreShort'), run: onRestore }]
|
|
409
|
+
: [
|
|
410
|
+
{ key: 'pin', label: t(pinned ? 'ta.chat.unpin' : 'ta.chat.pin'), run: () => onPin === null || onPin === void 0 ? void 0 : onPin() },
|
|
411
|
+
{ key: 'remove', label: t('ta.chat.removeShort'), danger: true, run: () => onRemove === null || onRemove === void 0 ? void 0 : onRemove() },
|
|
412
|
+
];
|
|
413
|
+
// A dialog of it waits for the user: it needs them, it does not answer meanwhile.
|
|
414
|
+
const waiting = ChatListUtil.isOpen(session) && !!session.waiting;
|
|
415
|
+
const streaming = ChatListUtil.isOpen(session) && session.isStreaming && !waiting;
|
|
416
|
+
const mood = waiting ? 'attention' : streaming ? 'working' : 'idle';
|
|
417
|
+
const state = React.createElement(ChatState, { streaming: streaming, waiting: waiting, task: task });
|
|
312
418
|
// As in a messaging app, the last thing said; its directory before the first, and on hover in place of its time.
|
|
313
419
|
const said = ChatListUtil.preview(session, title);
|
|
314
420
|
const place = who ? message_1.MessageUtil.basename(session.cwd) : source.label;
|
|
315
421
|
const ended = task === 'failed' || task === 'stopped' ? task : undefined;
|
|
316
|
-
return (React.createElement(swipe_row_1.SwipeRow, { as: "li", className: `ta-chat-row${selected ? ' ta-selected' : ''}${who ? ` ta-chat-${who.kind}` : ''}`, actions:
|
|
317
|
-
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" },
|
|
422
|
+
return (React.createElement(swipe_row_1.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 },
|
|
423
|
+
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" },
|
|
318
424
|
React.createElement("span", { className: "ta-chat-line" },
|
|
319
425
|
who && React.createElement(ChatAvatar, { session: session, source: source, who: who, size: 20, mood: mood }),
|
|
320
426
|
tag,
|
|
321
427
|
React.createElement("span", { className: "ta-chat-title" }, title),
|
|
322
428
|
state,
|
|
323
|
-
React.createElement(
|
|
324
|
-
|
|
429
|
+
React.createElement(UnseenDot, { on: !!unseen }),
|
|
430
|
+
React.createElement("span", { className: "ta-chat-time" }, removing && handheld ? React.createElement("span", { className: "ta-spinner ta-later" }) : time)))) : (React.createElement(React.Fragment, null,
|
|
431
|
+
React.createElement("span", { className: "ta-chat-avatar-box" },
|
|
432
|
+
React.createElement(ChatAvatar, { session: session, source: source, who: who, size: 38, mood: mood }),
|
|
433
|
+
React.createElement(UnseenDot, { on: !!unseen })),
|
|
325
434
|
React.createElement("span", { className: "ta-chat-text" },
|
|
326
435
|
React.createElement("span", { className: "ta-chat-line" },
|
|
327
436
|
tag,
|
|
328
437
|
React.createElement("span", { className: "ta-chat-title" }, title),
|
|
329
|
-
React.createElement("span", { className: "ta-chat-time" }, time),
|
|
438
|
+
React.createElement("span", { className: "ta-chat-time" }, removing && handheld ? React.createElement("span", { className: "ta-spinner ta-later" }) : time),
|
|
330
439
|
React.createElement("span", { className: "ta-chat-place" },
|
|
331
440
|
React.createElement(icon_1.Icon, { icon: lucide_react_1.Folder, size: 12 }),
|
|
332
441
|
React.createElement("span", null, place))),
|
|
333
442
|
React.createElement("span", { className: "ta-chat-line" },
|
|
334
|
-
React.createElement("span", { className:
|
|
443
|
+
React.createElement("span", { className: `ta-chat-sub${unseen ? ' ta-unseen' : ''}` },
|
|
335
444
|
React.createElement(host_tag_1.HostTag, { host: source.host }),
|
|
336
|
-
|
|
445
|
+
waiting && React.createElement("span", { className: "ta-chat-flag ta-waiting" },
|
|
446
|
+
"[",
|
|
447
|
+
t('ta.task.waiting'),
|
|
448
|
+
"]"),
|
|
449
|
+
ended && !streaming && !waiting && (React.createElement("span", { className: `ta-chat-flag ta-${ended}` },
|
|
337
450
|
"[",
|
|
338
451
|
t(ended === 'failed' ? 'ta.task.failed' : 'ta.task.stopped'),
|
|
339
452
|
"]")), said !== null && said !== void 0 ? said : (React.createElement("span", { className: "ta-chat-dir" },
|
|
340
453
|
React.createElement(icon_1.Icon, { icon: lucide_react_1.Folder, size: 12 }),
|
|
341
454
|
place))),
|
|
342
455
|
streaming && React.createElement("span", { className: "ta-chat-state ta-spinner" })))))),
|
|
343
|
-
handheld ? null : onRestore ? (React.createElement(icon_1.IconButton, { className: "ta-chat-delete", icon: lucide_react_1.Undo2, label: t('ta.chat.restore'), onClick: onRestore })) : (React.createElement(icon_1.IconButton, { className: "ta-chat-delete", icon: lucide_react_1.Trash2, label: t('ta.sidebar.closeTitle'), onClick: onRemove }))));
|
|
456
|
+
handheld ? null : onRestore ? (React.createElement(icon_1.IconButton, { className: "ta-chat-delete", icon: lucide_react_1.Undo2, label: t('ta.chat.restore'), onClick: onRestore })) : (React.createElement(icon_1.IconButton, { className: "ta-chat-delete", icon: lucide_react_1.Trash2, label: t('ta.sidebar.closeTitle'), busy: removing, onClick: onRemove }))));
|
|
344
457
|
}, ChatListUtil.sameRow);
|
|
345
458
|
/**
|
|
346
459
|
* The conversations of the server, open or saved, the latest first, with a search and `+` for a new one:
|
|
347
|
-
* by directory or package, each group folding and with a `+` of its own, or by day. Those
|
|
348
|
-
* the end,
|
|
460
|
+
* by directory or package, each group folding and with a `+` of its own, or by day. Those not updated for
|
|
461
|
+
* `foldDays` are folded at the end (of each group), those for `archiveDays` archived after them, read when
|
|
462
|
+
* opened or searched, and those taken out last, folded, to put back. However long, it draws the rows of
|
|
463
|
+
* its first screens, and more as it is scrolled to its end.
|
|
349
464
|
*/
|
|
350
|
-
function ChatList({ sessions, saved, removed: removedFiles, selected, chat, byDirectory, onByDirectory, folded, onFolded, onPicked, double, notice, }) {
|
|
465
|
+
function ChatList({ sessions, saved, removed: removedFiles, archived: archivedSaved, onArchive, foldDays, archiveDays, selected, chat, byDirectory, onByDirectory, folded, onFolded, onPicked, double, notice, pinned, onPinned, looking, seen, }) {
|
|
351
466
|
const t = (0, use_t_1.useT)();
|
|
352
467
|
const now = useMinute();
|
|
353
468
|
const [query, setQuery] = React.useState('');
|
|
354
469
|
const [removedOpen, setRemovedOpen] = React.useState(false);
|
|
470
|
+
const [archiveOpen, setArchiveOpen] = React.useState(false);
|
|
471
|
+
// The older of the list by day, and the groups whose older are shown: folded each time the list is drawn anew.
|
|
472
|
+
const [olderOpen, setOlderOpen] = React.useState(false);
|
|
473
|
+
const [groupsOlder, setGroupsOlder] = React.useState([]);
|
|
474
|
+
// How many rows are drawn, for a search: another starts again from the first page.
|
|
475
|
+
const [paged, setPaged] = React.useState({ query, count: exports.CHAT_PAGE });
|
|
476
|
+
const pageCount = typeof IntersectionObserver === 'undefined' ? Number.POSITIVE_INFINITY : paged.query === query ? paged.count : exports.CHAT_PAGE;
|
|
355
477
|
// What the rows do reads the props of now, through one object that stays the same: no row is drawn again for it.
|
|
356
|
-
const
|
|
357
|
-
latest
|
|
478
|
+
const sessionMenus = React.useContext(extension_view_1.SessionMenus);
|
|
479
|
+
const latest = React.useRef({ chat, double, onPicked, t, pinned, onPinned, sessionMenus });
|
|
480
|
+
latest.current = { chat, double, onPicked, t, pinned, onPinned, sessionMenus };
|
|
358
481
|
const actions = React.useMemo(() => {
|
|
359
482
|
const pick = (change) => {
|
|
360
483
|
void change;
|
|
@@ -362,7 +485,7 @@ function ChatList({ sessions, saved, removed: removedFiles, selected, chat, byDi
|
|
|
362
485
|
};
|
|
363
486
|
return {
|
|
364
487
|
open: entry => pick(ChatListUtil.isOpen(entry) ? latest.current.chat.show(entry.sessionId) : latest.current.chat.resume(entry.sessionFile)),
|
|
365
|
-
remove: entry =>
|
|
488
|
+
remove: entry => latest.current.chat.remove(entry),
|
|
366
489
|
restore: entry => void latest.current.chat.restore(ChatListUtil.key(entry)),
|
|
367
490
|
hand: entry => {
|
|
368
491
|
var _a;
|
|
@@ -370,6 +493,23 @@ function ChatList({ sessions, saved, removed: removedFiles, selected, chat, byDi
|
|
|
370
493
|
(_a = latest.current.double) === null || _a === void 0 ? void 0 : _a.hand(entry, ChatListUtil.title(entry, latest.current.t));
|
|
371
494
|
}
|
|
372
495
|
},
|
|
496
|
+
// The last pinned first, as several may be.
|
|
497
|
+
pin: (entry, pin) => {
|
|
498
|
+
const file = ChatListUtil.file(entry);
|
|
499
|
+
const others = latest.current.pinned.filter(other => other !== file);
|
|
500
|
+
latest.current.onPinned(pin ? [file, ...others] : others);
|
|
501
|
+
},
|
|
502
|
+
extensionMenu: (entry, title) => {
|
|
503
|
+
const open = ChatListUtil.isOpen(entry);
|
|
504
|
+
const session = {
|
|
505
|
+
sessionId: open ? entry.sessionId : undefined,
|
|
506
|
+
sessionFile: entry.sessionFile,
|
|
507
|
+
cwd: entry.cwd,
|
|
508
|
+
title,
|
|
509
|
+
group: open ? entry.group : undefined,
|
|
510
|
+
};
|
|
511
|
+
return latest.current.sessionMenus.flatMap(menu => menu(session)).filter(item => !item.disabled);
|
|
512
|
+
},
|
|
373
513
|
};
|
|
374
514
|
}, []);
|
|
375
515
|
// A failure is a notice of the chat.
|
|
@@ -378,18 +518,52 @@ function ChatList({ sessions, saved, removed: removedFiles, selected, chat, byDi
|
|
|
378
518
|
onPicked();
|
|
379
519
|
};
|
|
380
520
|
// Worked out again only when the conversations or the search change, not as the minute or the selection does.
|
|
381
|
-
|
|
521
|
+
// The bounds of the archive and of the fold move once a day.
|
|
522
|
+
const searching = !!query.trim();
|
|
523
|
+
const since = workbench_util_1.WorkbenchUtil.daysAgo(now, archiveDays);
|
|
524
|
+
const foldBefore = searching ? undefined : workbench_util_1.WorkbenchUtil.daysAgo(now, foldDays);
|
|
525
|
+
// Those an extension archives sooner (WebChatIcon.archiveDays), asked again as its icons change.
|
|
526
|
+
const icons = React.useContext(extension_view_1.ChatIcons);
|
|
527
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: its bounds move with the day, as `since` does
|
|
528
|
+
const sooner = React.useMemo(() => chat_icon_1.ChatIconUtil.archiveSince(icons.entries, now), [icons, since]);
|
|
529
|
+
const { listed, archived, removed } = React.useMemo(() => ChatListUtil.entries(sessions, saved, removedFiles, archivedSaved, since, pinned, sooner), [sessions, saved, removedFiles, archivedSaved, since, pinned, sooner]);
|
|
382
530
|
const sources = React.useMemo(() => ChatListUtil.sources(listed), [listed]);
|
|
383
|
-
|
|
531
|
+
// A search finds the archived too.
|
|
532
|
+
const shown = React.useMemo(() => ChatListUtil.filter(searching ? [...listed, ...archived] : listed, query, t), [listed, archived, searching, query, t]);
|
|
384
533
|
const shownRemoved = React.useMemo(() => ChatListUtil.filter(removed, query, t), [removed, query, t]);
|
|
534
|
+
// Those pinned are at the top, whatever their day or directory, as in a messenger.
|
|
535
|
+
const apart = React.useMemo(() => ChatListUtil.pinnedApart(shown, pinned), [shown, pinned]);
|
|
536
|
+
const lookedAt = looking ? sessions.find(session => session.sessionId === looking) : undefined;
|
|
537
|
+
const inFront = lookedAt && ChatListUtil.file(lookedAt);
|
|
385
538
|
// What a search finds is one list by day, wherever it is.
|
|
386
|
-
const grouped = byDirectory && sources.length > 1 && !
|
|
539
|
+
const grouped = byDirectory && sources.length > 1 && !searching;
|
|
540
|
+
const archiveShown = archiveDays > 0 && (archivedSaved ? archived.length > 0 : listed.length > 0);
|
|
541
|
+
const readArchive = () => {
|
|
542
|
+
if (archiveDays > 0) {
|
|
543
|
+
onArchive();
|
|
544
|
+
}
|
|
545
|
+
};
|
|
546
|
+
// One pinned long ago is in the archive, which the list reads for it.
|
|
547
|
+
const pinnedAway = !archivedSaved && pinned.some(file => !listed.some(session => ChatListUtil.file(session) === file) && !removedFiles.includes(file));
|
|
548
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: once as a search starts, or as the list has none (all may be archived) or misses one pinned
|
|
549
|
+
React.useEffect(() => {
|
|
550
|
+
if (searching || listed.length === 0 || pinnedAway) {
|
|
551
|
+
readArchive();
|
|
552
|
+
}
|
|
553
|
+
}, [searching, listed.length === 0, pinnedAway]);
|
|
387
554
|
const draftIn = (cwd) => pick(chat.draft().then(() => chat.setDraftCwd(cwd)));
|
|
388
555
|
const fold = (key) => onFolded(folded.includes(key) ? folded.filter(other => other !== key) : [...folded, key]);
|
|
389
|
-
const byKey = React.useMemo(() => new Map([...sources, ...ChatListUtil.sources(removed)].map(candidate => [candidate.key, candidate])), [sources, removed]);
|
|
390
|
-
const
|
|
556
|
+
const byKey = React.useMemo(() => new Map([...sources, ...ChatListUtil.sources([...archived, ...removed])].map(candidate => [candidate.key, candidate])), [sources, archived, removed]);
|
|
557
|
+
const isSelected = (session) => ChatListUtil.key(session) === selected;
|
|
558
|
+
const isUnseen = (session) => chat_seen_1.ChatSeenUtil.unseen({ ...session, isStreaming: ChatListUtil.isOpen(session) && session.isStreaming }, ChatListUtil.file(session), seen, inFront);
|
|
559
|
+
// What is folded or not drawn yet still has the conversation shown, and those unseen: the dot of the tab finds them.
|
|
560
|
+
const stays = (session) => isSelected(session) || isUnseen(session);
|
|
561
|
+
const budget = ChatListUtil.budget(pageCount, stays);
|
|
562
|
+
const pinnedFiles = React.useMemo(() => new Set(pinned), [pinned]);
|
|
563
|
+
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) }));
|
|
391
564
|
// The conversation shown is found in the list, however it came to be shown: out of a search that hides it, and scrolled to.
|
|
392
565
|
const scroller = React.useRef(null);
|
|
566
|
+
const end = React.useRef(null);
|
|
393
567
|
const reveal = React.useRef(false);
|
|
394
568
|
const hidden = !!selected && listed.some(session => ChatListUtil.key(session) === selected) && !shown.some(session => ChatListUtil.key(session) === selected);
|
|
395
569
|
// biome-ignore lint/correctness/useExhaustiveDependencies: only when another conversation is shown
|
|
@@ -407,6 +581,85 @@ function ChatList({ sessions, saved, removed: removedFiles, selected, chat, byDi
|
|
|
407
581
|
row.scrollIntoView({ block: 'nearest' });
|
|
408
582
|
}
|
|
409
583
|
});
|
|
584
|
+
// A toggle of what folds under a title: the older conversations, the archive, those taken out.
|
|
585
|
+
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 },
|
|
586
|
+
React.createElement(icon_1.Icon, { icon: lucide_react_1.ChevronRight, size: 13 }),
|
|
587
|
+
label));
|
|
588
|
+
// The rows in the order of the list, as far as the budget goes: what is drawn after uses what is left.
|
|
589
|
+
const list = grouped
|
|
590
|
+
? ChatListUtil.groups(apart.rest, sources).map(({ source, sessions }) => {
|
|
591
|
+
const closed = folded.includes(source.key);
|
|
592
|
+
const [recent, older] = ChatListUtil.split(sessions, foldBefore);
|
|
593
|
+
const olderShown = groupsOlder.includes(source.key);
|
|
594
|
+
// Folded, a group still has the conversation shown and those unseen; so do its older ones.
|
|
595
|
+
const candidates = closed ? sessions.filter(stays) : olderShown ? sessions : [...recent, ...older.filter(stays)];
|
|
596
|
+
const rows = budget.take(candidates);
|
|
597
|
+
if (rows.length === 0 && candidates.length > 0) {
|
|
598
|
+
return null;
|
|
599
|
+
}
|
|
600
|
+
return (React.createElement("section", { key: source.key, className: "ta-chat-group" },
|
|
601
|
+
React.createElement("div", { className: "ta-chat-group-head" },
|
|
602
|
+
React.createElement("button", { type: "button", className: "ta-chat-group-toggle", "aria-expanded": !closed, title: source.title, onClick: () => fold(source.key) },
|
|
603
|
+
React.createElement("span", { className: `ta-chat-group-avatar ta-tone-${source.tone}`, "aria-hidden": "true" }, source.initial),
|
|
604
|
+
React.createElement(host_tag_1.HostTag, { host: source.host }),
|
|
605
|
+
React.createElement("span", { className: "ta-chat-group-label" }, source.label),
|
|
606
|
+
React.createElement("span", { className: "ta-chat-group-count" }, sessions.length),
|
|
607
|
+
React.createElement(icon_1.Icon, { icon: lucide_react_1.ChevronRight, size: 13, className: "ta-chat-group-chevron" })),
|
|
608
|
+
source.cwd && (React.createElement(icon_1.IconButton, { className: "ta-chat-group-add", icon: lucide_react_1.Plus, label: t('ta.chat.newIn', { name: source.label }), onClick: () => draftIn(source.cwd) }))),
|
|
609
|
+
rows.length > 0 && React.createElement("ul", { className: "ta-side-list" }, rows.map(session => item(session, true))),
|
|
610
|
+
!closed &&
|
|
611
|
+
older.length > 0 &&
|
|
612
|
+
rows.length === candidates.length &&
|
|
613
|
+
toggle(t('ta.chat.olderCount', { days: foldDays, count: older.length }), olderShown, () => setGroupsOlder(olderShown ? groupsOlder.filter(key => key !== source.key) : [...groupsOlder, source.key]))));
|
|
614
|
+
})
|
|
615
|
+
: (() => {
|
|
616
|
+
const [recent, older] = ChatListUtil.split(apart.rest, foldBefore);
|
|
617
|
+
const sections = ChatListUtil.sections(recent, now).map(section => {
|
|
618
|
+
const rows = budget.take(section.sessions);
|
|
619
|
+
return (rows.length > 0 && (React.createElement("section", { key: section.id, className: "ta-chat-section" },
|
|
620
|
+
React.createElement("div", { className: "ta-chat-section-title" }, t(section.id)),
|
|
621
|
+
React.createElement("ul", { className: "ta-side-list" }, rows.map(session => item(session))))));
|
|
622
|
+
});
|
|
623
|
+
// Folded, the older still have the conversation shown and those unseen, drawn even before the rows above them are.
|
|
624
|
+
const cut = budget.more;
|
|
625
|
+
const olderRows = older.length > 0 ? budget.take(olderOpen ? older : older.filter(stays)) : [];
|
|
626
|
+
return [
|
|
627
|
+
...sections,
|
|
628
|
+
older.length > 0 && (!cut || olderRows.length > 0) && (React.createElement("section", { key: "older", className: "ta-chat-section ta-chat-older" },
|
|
629
|
+
toggle(t('ta.chat.olderCount', { days: foldDays, count: older.length }), olderOpen, () => setOlderOpen(!olderOpen)),
|
|
630
|
+
olderRows.length > 0 && React.createElement("ul", { className: "ta-side-list" }, olderRows.map(session => item(session))))),
|
|
631
|
+
];
|
|
632
|
+
})();
|
|
633
|
+
// The archive, after the list once it is all drawn: read each time it opens, as it is not read with the list.
|
|
634
|
+
const archive = !searching && archiveShown && !budget.more && (React.createElement("section", { className: "ta-chat-section ta-chat-archive" },
|
|
635
|
+
toggle(archivedSaved ? t('ta.chat.archivedCount', { count: archived.length }) : t('ta.chat.archived'), archiveOpen, () => {
|
|
636
|
+
if (!archiveOpen) {
|
|
637
|
+
readArchive();
|
|
638
|
+
}
|
|
639
|
+
setArchiveOpen(!archiveOpen);
|
|
640
|
+
}, t('ta.chat.archivedHint', { count: archiveDays })),
|
|
641
|
+
archiveOpen &&
|
|
642
|
+
(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" },
|
|
643
|
+
React.createElement("span", { className: "ta-spinner" }))))));
|
|
644
|
+
const taken = shownRemoved.length > 0 && !budget.more && (React.createElement("section", { className: "ta-chat-section ta-chat-removed" },
|
|
645
|
+
toggle(t('ta.chat.removed', { count: shownRemoved.length }), removedOpen, () => setRemovedOpen(!removedOpen)),
|
|
646
|
+
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 })))))));
|
|
647
|
+
// Near the end of what is drawn, the next page is: the mark at the end is seen well before it scrolls into view.
|
|
648
|
+
const more = budget.more;
|
|
649
|
+
React.useEffect(() => {
|
|
650
|
+
const mark = end.current;
|
|
651
|
+
if (!more || !mark) {
|
|
652
|
+
return;
|
|
653
|
+
}
|
|
654
|
+
const observer = new IntersectionObserver(entries => {
|
|
655
|
+
// Drawn between the frames of the scroll, not in one of them.
|
|
656
|
+
if (entries.some(entry => entry.isIntersecting)) {
|
|
657
|
+
React.startTransition(() => setPaged({ query, count: pageCount + exports.CHAT_PAGE }));
|
|
658
|
+
}
|
|
659
|
+
}, { root: scroller.current, rootMargin: '0px 0px 800px 0px' });
|
|
660
|
+
observer.observe(mark);
|
|
661
|
+
return () => observer.disconnect();
|
|
662
|
+
}, [more, pageCount, query]);
|
|
410
663
|
return (React.createElement("section", { className: "ta-chats", "aria-label": t('ta.chat') },
|
|
411
664
|
React.createElement("header", { className: "ta-chats-head" },
|
|
412
665
|
React.createElement("label", { className: "ta-chats-search" },
|
|
@@ -416,30 +669,13 @@ function ChatList({ sessions, saved, removed: removedFiles, selected, chat, byDi
|
|
|
416
669
|
React.createElement(icon_1.IconButton, { className: "ta-chats-add", icon: lucide_react_1.Plus, label: t('ta.chat.new'), onClick: () => pick(chat.draft()) })),
|
|
417
670
|
notice,
|
|
418
671
|
React.createElement("div", { className: "ta-side-scroll", ref: scroller },
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
const rows = closed ? sessions.filter(session => ChatListUtil.key(session) === selected) : sessions;
|
|
424
|
-
return (React.createElement("section", { key: source.key, className: "ta-chat-group" },
|
|
425
|
-
React.createElement("div", { className: "ta-chat-group-head" },
|
|
426
|
-
React.createElement("button", { type: "button", className: "ta-chat-group-toggle", "aria-expanded": !closed, title: source.title, onClick: () => fold(source.key) },
|
|
427
|
-
React.createElement("span", { className: `ta-chat-group-avatar ta-tone-${source.tone}`, "aria-hidden": "true" }, source.initial),
|
|
428
|
-
React.createElement(host_tag_1.HostTag, { host: source.host }),
|
|
429
|
-
React.createElement("span", { className: "ta-chat-group-label" }, source.label),
|
|
430
|
-
React.createElement("span", { className: "ta-chat-group-count" }, sessions.length),
|
|
431
|
-
React.createElement(icon_1.Icon, { icon: lucide_react_1.ChevronRight, size: 13, className: "ta-chat-group-chevron" })),
|
|
432
|
-
source.cwd && (React.createElement(icon_1.IconButton, { className: "ta-chat-group-add", icon: lucide_react_1.Plus, label: t('ta.chat.newIn', { name: source.label }), onClick: () => draftIn(source.cwd) }))),
|
|
433
|
-
rows.length > 0 && React.createElement("ul", { className: "ta-side-list" }, rows.map(session => item(session, true)))));
|
|
434
|
-
})
|
|
435
|
-
: ChatListUtil.sections(shown, now).map(section => (React.createElement("section", { key: section.id, className: "ta-chat-section" },
|
|
436
|
-
React.createElement("div", { className: "ta-chat-section-title" }, t(section.id)),
|
|
437
|
-
React.createElement("ul", { className: "ta-side-list" }, section.sessions.map(session => item(session)))))),
|
|
672
|
+
apart.pinned.length > 0 && (React.createElement("section", { className: "ta-chat-section ta-chat-pinned" },
|
|
673
|
+
React.createElement("div", { className: "ta-chat-section-title" }, t('ta.chat.pinned')),
|
|
674
|
+
React.createElement("ul", { className: "ta-side-list" }, apart.pinned.map(session => item(session))))),
|
|
675
|
+
list,
|
|
438
676
|
shown.length === 0 && (React.createElement(empty_state_1.EmptyState, { title: t(listed.length ? 'ta.chat.noMatch' : 'ta.chat.none'), hint: listed.length ? undefined : t('ta.chat.noneHint') })),
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
t('ta.chat.removed', { count: shownRemoved.length })),
|
|
443
|
-
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 }))))))))));
|
|
677
|
+
archive,
|
|
678
|
+
taken,
|
|
679
|
+
more && React.createElement("div", { ref: end, className: "ta-chat-more", "aria-hidden": "true" }))));
|
|
444
680
|
}
|
|
445
681
|
//# sourceMappingURL=chat-list.js.map
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { StateSpec } from '../state/state-protocol';
|
|
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
|
+
}
|
|
54
|
+
//# sourceMappingURL=chat-seen.d.ts.map
|