@celljs/ta-web 4.16.0 → 4.17.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 +1 -1
- package/README.md +1 -1
- package/esm/browser/assistant/assistant-ask-book.d.ts +35 -0
- package/esm/browser/assistant/assistant-ask-book.js +96 -0
- package/esm/browser/assistant/assistant-conversation.d.ts +110 -0
- package/esm/browser/assistant/assistant-conversation.js +351 -0
- package/esm/browser/assistant/assistant-export.js +6 -7
- package/esm/browser/assistant/assistant-extension.d.ts +3 -2
- package/esm/browser/assistant/assistant-extension.js +57 -4
- package/esm/browser/assistant/assistant-protocol.d.ts +17 -2
- package/esm/browser/assistant/assistant-role.d.ts +22 -4
- package/esm/browser/assistant/assistant-role.js +29 -7
- package/esm/browser/assistant/assistant-state.d.ts +5 -1
- package/esm/browser/assistant/assistant-state.js +11 -0
- package/esm/browser/assistant/assistant-task-source.js +7 -1
- package/esm/browser/assistant/assistant-task-util.d.ts +19 -7
- package/esm/browser/assistant/assistant-task-util.js +73 -20
- package/esm/browser/assistant/assistant-tasks.d.ts +0 -7
- package/esm/browser/assistant/assistant-tasks.js +0 -2
- package/esm/browser/assistant/assistant-thread.d.ts +22 -0
- package/esm/browser/assistant/assistant-thread.js +108 -0
- package/esm/browser/assistant/assistant-view.js +77 -126
- package/esm/browser/assistant/assistant.d.ts +33 -105
- package/esm/browser/assistant/assistant.js +103 -356
- package/esm/browser/assistant/chat-task-source.d.ts +58 -0
- package/esm/browser/assistant/chat-task-source.js +107 -0
- package/esm/browser/assistant/read-aloud.d.ts +34 -0
- package/esm/browser/assistant/read-aloud.js +98 -0
- package/esm/browser/assistant/realtime-voice.d.ts +77 -0
- package/esm/browser/assistant/realtime-voice.js +320 -0
- package/esm/browser/assistant/task-views.d.ts +2 -3
- package/esm/browser/assistant/task-views.js +20 -16
- package/esm/browser/assistant/voice-call-bar.d.ts +60 -0
- package/esm/browser/assistant/voice-call-bar.js +260 -0
- package/esm/browser/assistant/voice-call.d.ts +175 -0
- package/esm/browser/assistant/voice-call.js +366 -0
- package/esm/browser/chat/chat-shown.d.ts +78 -0
- package/esm/browser/chat/chat-shown.js +262 -0
- package/esm/browser/chat/chat-view.js +2 -1
- package/esm/browser/chat/chat.d.ts +4 -68
- package/esm/browser/chat/chat.js +5 -253
- package/esm/browser/chat/draft-model.d.ts +1 -1
- package/esm/browser/components/access-view.js +1 -1
- package/esm/browser/components/account-menu.js +1 -1
- package/esm/browser/components/app-nav.d.ts +3 -1
- package/esm/browser/components/app-nav.js +7 -7
- package/esm/browser/components/app-shell-hooks.d.ts +11 -2
- package/esm/browser/components/app-shell-hooks.js +25 -4
- package/esm/browser/components/app-shell-state.d.ts +80 -0
- package/esm/browser/components/app-shell-state.js +466 -0
- package/esm/browser/components/app-view.js +121 -333
- package/esm/browser/components/asks-badge.d.ts +6 -2
- package/esm/browser/components/asks-badge.js +7 -3
- package/esm/browser/components/auth-pictures.d.ts +2 -2
- package/esm/browser/components/auth-pictures.js +13 -1
- package/esm/browser/components/auth-view.d.ts +4 -3
- package/esm/browser/components/auth-view.js +54 -5
- package/esm/browser/components/chat-asks.d.ts +2 -0
- package/esm/browser/components/chat-asks.js +8 -0
- package/esm/browser/components/chat-busy.d.ts +32 -0
- package/esm/browser/components/chat-busy.js +49 -0
- package/esm/browser/components/chat-icon.d.ts +6 -0
- package/esm/browser/components/chat-icon.js +17 -1
- package/esm/browser/components/chat-list-row.d.ts +84 -0
- package/esm/browser/components/chat-list-row.js +198 -0
- package/esm/browser/components/chat-list-util.d.ts +166 -0
- package/esm/browser/components/chat-list-util.js +335 -0
- package/esm/browser/components/chat-list.d.ts +9 -148
- package/esm/browser/components/chat-list.js +277 -513
- package/esm/browser/components/chat-seen.js +1 -0
- package/esm/browser/components/composer-addon-util.d.ts +1 -1
- package/esm/browser/components/composer-addons.d.ts +1 -1
- package/esm/browser/components/composer-attachments.d.ts +11 -0
- package/esm/browser/components/composer-attachments.js +27 -0
- package/esm/browser/components/composer-box-hooks.d.ts +9 -0
- package/esm/browser/components/composer-box-hooks.js +138 -0
- package/esm/browser/components/composer-box-protocol.d.ts +108 -0
- package/esm/browser/components/composer-box-protocol.js +2 -0
- package/esm/browser/components/composer-box.d.ts +1 -95
- package/esm/browser/components/composer-box.js +49 -156
- package/esm/browser/components/composer-target.d.ts +21 -0
- package/esm/browser/components/composer-target.js +43 -0
- package/esm/browser/components/composer.d.ts +7 -1
- package/esm/browser/components/composer.js +13 -9
- package/esm/browser/components/context-menu.js +4 -0
- package/esm/browser/components/conversation-find.d.ts +27 -0
- package/esm/browser/components/conversation-find.js +151 -0
- package/esm/browser/components/conversation-scroll-hooks.js +2 -1
- package/esm/browser/components/conversation-scroll-util.d.ts +73 -0
- package/esm/browser/components/conversation-scroll-util.js +80 -0
- package/esm/browser/components/conversation-scroll.d.ts +1 -35
- package/esm/browser/components/conversation-scroll.js +2 -81
- package/esm/browser/components/conversation-view.d.ts +8 -0
- package/esm/browser/components/conversation-view.js +41 -0
- package/esm/browser/components/discover-view.d.ts +3 -2
- package/esm/browser/components/discover-view.js +31 -26
- package/esm/browser/components/dismiss.js +2 -0
- package/esm/browser/components/earlier-messages.d.ts +2 -0
- package/esm/browser/components/earlier-messages.js +2 -1
- package/esm/browser/components/folder-picker.d.ts +7 -0
- package/esm/browser/components/folder-picker.js +89 -19
- package/esm/browser/components/gallery.d.ts +1 -1
- package/esm/browser/components/gallery.js +57 -14
- package/esm/browser/components/host-view.d.ts +1 -1
- package/esm/browser/components/host-view.js +3 -1
- package/esm/browser/components/image-menu.d.ts +11 -0
- package/esm/browser/components/image-menu.js +29 -0
- package/esm/browser/components/image-viewer.d.ts +3 -2
- package/esm/browser/components/image-viewer.js +29 -4
- package/esm/browser/components/lightbox.js +2 -0
- package/esm/browser/components/link-dialog.js +2 -0
- package/esm/browser/components/list-rows.d.ts +3 -1
- package/esm/browser/components/list-rows.js +2 -1
- package/esm/browser/components/markdown.js +5 -0
- package/esm/browser/components/media.d.ts +2 -0
- package/esm/browser/components/media.js +16 -1
- package/esm/browser/components/message-actions.d.ts +1 -1
- package/esm/browser/components/message-actions.js +9 -0
- package/esm/browser/components/message-footer.d.ts +3 -1
- package/esm/browser/components/message-footer.js +3 -2
- package/esm/browser/components/message-images.d.ts +41 -0
- package/esm/browser/components/message-images.js +120 -0
- package/esm/browser/components/message-list.d.ts +4 -100
- package/esm/browser/components/message-list.js +10 -447
- package/esm/browser/components/message-menu.js +4 -0
- package/esm/browser/components/message-steps.d.ts +21 -0
- package/esm/browser/components/message-steps.js +182 -0
- package/esm/browser/components/message-user.d.ts +54 -0
- package/esm/browser/components/message-user.js +169 -0
- package/esm/browser/components/model-picker.d.ts +1 -1
- package/esm/browser/components/model-picker.js +2 -0
- package/esm/browser/components/moved-notice.d.ts +14 -0
- package/esm/browser/components/moved-notice.js +60 -0
- package/esm/browser/components/nav-places.d.ts +12 -1
- package/esm/browser/components/nav-places.js +10 -2
- package/esm/browser/components/notice-center.js +36 -1
- package/esm/browser/components/notice-face.js +2 -1
- package/esm/browser/components/phone-shell.d.ts +4 -3
- package/esm/browser/components/phone-shell.js +60 -68
- package/esm/browser/components/plus-menu.d.ts +1 -1
- package/esm/browser/components/relay-services.d.ts +6 -1
- package/esm/browser/components/relay-services.js +109 -2
- package/esm/browser/components/relay-view.js +2 -0
- package/esm/browser/components/remote-hosts.d.ts +10 -0
- package/esm/browser/components/remote-hosts.js +7 -6
- package/esm/browser/components/remote-prompts.js +2 -0
- package/esm/browser/components/scan-screen.js +7 -0
- package/esm/browser/components/screen-navigator-util.d.ts +28 -0
- package/esm/browser/components/screen-navigator-util.js +33 -0
- package/esm/browser/components/screen-navigator.d.ts +30 -0
- package/esm/browser/components/screen-navigator.js +47 -0
- package/esm/browser/components/session-settings.d.ts +1 -1
- package/esm/browser/components/session-view.js +157 -7
- package/esm/browser/components/settings-choices.d.ts +6 -0
- package/esm/browser/components/settings-choices.js +8 -0
- package/esm/browser/components/settings-more.d.ts +7 -0
- package/esm/browser/components/settings-more.js +263 -0
- package/esm/browser/components/settings-parts.d.ts +8 -3
- package/esm/browser/components/settings-parts.js +31 -249
- package/esm/browser/components/settings-view.js +43 -15
- package/esm/browser/components/stop-times.js +1 -0
- package/esm/browser/components/surface-flyout.js +2 -0
- package/esm/browser/components/unseen-drop.d.ts +10 -4
- package/esm/browser/components/unseen-drop.js +9 -8
- package/esm/browser/components/use-seen-chats.js +1 -1
- package/esm/browser/components/voice-services.d.ts +6 -0
- package/esm/browser/components/voice-services.js +137 -0
- package/esm/browser/components/voice-talk.d.ts +23 -6
- package/esm/browser/components/voice-talk.js +46 -11
- package/esm/browser/components/web-composer.d.ts +1 -1
- package/esm/browser/components/web-composer.js +2 -2
- package/esm/browser/components/web-dialog.js +2 -0
- package/esm/browser/device/back-stack.d.ts +89 -11
- package/esm/browser/device/back-stack.js +200 -29
- package/esm/browser/device/device-protocol.d.ts +1 -1
- package/esm/browser/device/device-protocol.js +1 -1
- package/esm/browser/device/own-gestures.d.ts +1 -1
- package/esm/browser/device/pull-down.js +3 -1
- package/esm/browser/device/row-swipe.js +3 -1
- package/esm/browser/device/sheet-swipe.d.ts +1 -179
- package/esm/browser/device/sheet-swipe.js +3 -433
- package/esm/browser/device/swipe-finger.d.ts +31 -0
- package/esm/browser/device/swipe-finger.js +83 -0
- package/esm/browser/device/swipe-settle.d.ts +52 -0
- package/esm/browser/device/swipe-settle.js +170 -0
- package/esm/browser/device/swipe-util.d.ts +97 -0
- package/esm/browser/device/swipe-util.js +183 -0
- package/esm/browser/drafts/drafts-protocol.d.ts +58 -0
- package/esm/browser/drafts/drafts-protocol.js +75 -0
- package/esm/browser/drafts/drafts.d.ts +21 -0
- package/esm/browser/drafts/drafts.js +91 -0
- package/esm/browser/drafts/use-composer-draft.d.ts +20 -0
- package/esm/browser/drafts/use-composer-draft.js +108 -0
- package/esm/browser/extension/icons.js +3 -1
- package/esm/browser/extension/web-api-components.d.ts +13 -0
- package/esm/browser/extension/web-api-contributions.d.ts +125 -0
- package/esm/browser/extension/web-extension-api.d.ts +88 -5
- package/esm/browser/extension/web-extension-context.d.ts +5 -0
- package/esm/browser/extension/web-extension-context.js +60 -7
- package/esm/browser/extension/web-extension-protocol.d.ts +19 -1
- package/esm/browser/extension/web-extension-protocol.js +3 -0
- package/esm/browser/extension/web-extension-run.d.ts +5 -2
- package/esm/browser/extension/web-extension-run.js +13 -1
- package/esm/browser/extension/web-extensions-running.d.ts +93 -0
- package/esm/browser/extension/web-extensions-running.js +339 -0
- package/esm/browser/extension/web-extensions.d.ts +6 -82
- package/esm/browser/extension/web-extensions.js +10 -319
- package/esm/browser/extension/web-pages.js +1 -0
- package/esm/browser/extension/web-session-notices.js +6 -1
- package/esm/browser/extension/web-tasks.d.ts +2 -0
- package/esm/browser/extension/web-tasks.js +6 -0
- package/esm/browser/extension/web-view-util.d.ts +2 -1
- package/esm/browser/extension/web-view-util.js +4 -1
- package/esm/browser/gateway/console-parts.d.ts +1 -11
- package/esm/browser/gateway/console-parts.js +38 -128
- package/esm/browser/gateway/console-tenant.js +2 -1
- package/esm/browser/gateway/console-trend.d.ts +11 -0
- package/esm/browser/gateway/console-trend.js +115 -0
- package/esm/browser/gateway/console-view.js +39 -1
- package/esm/browser/i18n/locales.d.ts +143 -6
- package/esm/browser/i18n/messages-ja.js +144 -7
- package/esm/browser/i18n/messages-zh-tw.js +144 -7
- package/esm/browser/i18n/messages.d.ts +140 -3
- package/esm/browser/i18n/messages.js +288 -14
- package/esm/browser/index.d.ts +17 -0
- package/esm/browser/index.js +17 -0
- package/esm/browser/notices/notices-protocol.d.ts +12 -0
- package/esm/browser/notices/notices.js +7 -4
- package/esm/browser/offline/device-values.d.ts +2 -0
- package/esm/browser/offline/device-values.js +6 -1
- package/esm/browser/screen/page-answers.d.ts +42 -0
- package/esm/browser/screen/page-answers.js +89 -0
- package/esm/browser/screen/screen-protocol.d.ts +112 -0
- package/esm/browser/screen/screen-protocol.js +45 -0
- package/esm/browser/screen/screen.d.ts +20 -0
- package/esm/browser/screen/screen.js +122 -0
- package/esm/browser/screen/use-screen-part.d.ts +6 -0
- package/esm/browser/screen/use-screen-part.js +14 -0
- package/esm/browser/settings/settings-protocol.d.ts +5 -1
- package/esm/browser/settings/settings-protocol.js +6 -2
- package/esm/browser/share/shared-extensions.d.ts +29 -0
- package/esm/browser/share/shared-extensions.js +145 -0
- package/esm/browser/share/shared-link.d.ts +11 -0
- package/esm/browser/share/shared-link.js +38 -0
- package/esm/browser/share/shared-page.d.ts +5 -0
- package/esm/browser/share/shared-page.js +137 -0
- package/esm/browser/state/state-protocol.d.ts +14 -0
- package/esm/browser/state/state-protocol.js +18 -0
- package/esm/browser/state/state.d.ts +10 -2
- package/esm/browser/state/state.js +19 -3
- package/esm/browser/style/base.d.ts +1 -1
- package/esm/browser/style/base.js +4 -0
- package/esm/browser/style/chat-list.d.ts +2 -0
- package/esm/browser/style/chat-list.js +153 -0
- package/esm/browser/style/conversation-column.d.ts +2 -0
- package/esm/browser/style/conversation-column.js +250 -0
- package/esm/browser/style/conversation.d.ts +1 -1
- package/esm/browser/style/conversation.js +24 -8
- package/esm/browser/style/dialogs.d.ts +2 -0
- package/esm/browser/style/dialogs.js +163 -0
- package/esm/browser/style/layout.d.ts +2 -2
- package/esm/browser/style/layout.js +1 -525
- package/esm/browser/style/pages.d.ts +1 -1
- package/esm/browser/style/pages.js +9 -3
- package/esm/browser/style/phone.d.ts +1 -1
- package/esm/browser/style/phone.js +6 -2
- package/esm/browser/style/shared.d.ts +2 -0
- package/esm/browser/style/shared.js +23 -0
- package/esm/browser/style/shell.d.ts +1 -1
- package/esm/browser/style/shell.js +47 -0
- package/esm/browser/style/tasks.d.ts +1 -1
- package/esm/browser/style/tasks.js +13 -8
- package/esm/browser/style.js +8 -0
- package/esm/browser/util/gallery.d.ts +24 -2
- package/esm/browser/util/gallery.js +82 -2
- package/esm/browser/util/image-copy.d.ts +16 -0
- package/esm/browser/util/image-copy.js +57 -0
- package/esm/browser/util/message.d.ts +5 -0
- package/esm/browser/util/message.js +14 -0
- package/esm/browser/util/process.d.ts +6 -2
- package/esm/browser/util/process.js +6 -2
- package/esm/browser/util/spoken.d.ts +24 -0
- package/esm/browser/util/spoken.js +83 -0
- package/esm/browser/util/transcript.d.ts +22 -0
- package/esm/browser/util/transcript.js +46 -0
- package/esm/browser/util/voice.d.ts +5 -1
- package/esm/browser/util/voice.js +6 -1
- package/esm/browser/workbench-hosts.d.ts +36 -0
- package/esm/browser/workbench-hosts.js +120 -0
- package/esm/browser/workbench-lists.d.ts +33 -0
- package/esm/browser/workbench-lists.js +128 -0
- package/esm/browser/workbench-protocol.d.ts +14 -1
- package/esm/browser/workbench-services.d.ts +49 -0
- package/esm/browser/workbench-services.js +120 -0
- package/esm/browser/workbench-util.d.ts +1 -1
- package/esm/browser/workbench.d.ts +6 -89
- package/esm/browser/workbench.js +26 -336
- package/lib/browser/assistant/assistant-ask-book.d.ts +36 -0
- package/lib/browser/assistant/assistant-ask-book.js +100 -0
- package/lib/browser/assistant/assistant-conversation.d.ts +111 -0
- package/lib/browser/assistant/assistant-conversation.js +355 -0
- package/lib/browser/assistant/assistant-export.js +6 -7
- package/lib/browser/assistant/assistant-extension.d.ts +3 -2
- package/lib/browser/assistant/assistant-extension.js +55 -2
- package/lib/browser/assistant/assistant-protocol.d.ts +17 -2
- package/lib/browser/assistant/assistant-role.d.ts +22 -4
- package/lib/browser/assistant/assistant-role.js +30 -8
- package/lib/browser/assistant/assistant-state.d.ts +5 -1
- package/lib/browser/assistant/assistant-state.js +11 -0
- package/lib/browser/assistant/assistant-task-source.js +7 -1
- package/lib/browser/assistant/assistant-task-util.d.ts +19 -7
- package/lib/browser/assistant/assistant-task-util.js +73 -20
- package/lib/browser/assistant/assistant-tasks.d.ts +0 -7
- package/lib/browser/assistant/assistant-tasks.js +1 -3
- package/lib/browser/assistant/assistant-thread.d.ts +23 -0
- package/lib/browser/assistant/assistant-thread.js +144 -0
- package/lib/browser/assistant/assistant-view.js +74 -123
- package/lib/browser/assistant/assistant.d.ts +33 -105
- package/lib/browser/assistant/assistant.js +100 -353
- package/lib/browser/assistant/chat-task-source.d.ts +59 -0
- package/lib/browser/assistant/chat-task-source.js +111 -0
- package/lib/browser/assistant/read-aloud.d.ts +35 -0
- package/lib/browser/assistant/read-aloud.js +102 -0
- package/lib/browser/assistant/realtime-voice.d.ts +78 -0
- package/lib/browser/assistant/realtime-voice.js +324 -0
- package/lib/browser/assistant/task-views.d.ts +2 -3
- package/lib/browser/assistant/task-views.js +19 -15
- package/lib/browser/assistant/voice-call-bar.d.ts +61 -0
- package/lib/browser/assistant/voice-call-bar.js +306 -0
- package/lib/browser/assistant/voice-call.d.ts +176 -0
- package/lib/browser/assistant/voice-call.js +370 -0
- package/lib/browser/chat/chat-shown.d.ts +79 -0
- package/lib/browser/chat/chat-shown.js +266 -0
- package/lib/browser/chat/chat-view.js +2 -1
- package/lib/browser/chat/chat.d.ts +4 -68
- package/lib/browser/chat/chat.js +3 -251
- package/lib/browser/chat/draft-model.d.ts +1 -1
- package/lib/browser/components/access-view.js +2 -2
- package/lib/browser/components/account-menu.js +1 -1
- package/lib/browser/components/app-nav.d.ts +3 -1
- package/lib/browser/components/app-nav.js +7 -7
- package/lib/browser/components/app-shell-hooks.d.ts +11 -2
- package/lib/browser/components/app-shell-hooks.js +26 -5
- package/lib/browser/components/app-shell-state.d.ts +81 -0
- package/lib/browser/components/app-shell-state.js +502 -0
- package/lib/browser/components/app-view.js +114 -326
- package/lib/browser/components/asks-badge.d.ts +6 -2
- package/lib/browser/components/asks-badge.js +7 -3
- package/lib/browser/components/auth-pictures.d.ts +2 -2
- package/lib/browser/components/auth-pictures.js +13 -1
- package/lib/browser/components/auth-view.d.ts +4 -3
- package/lib/browser/components/auth-view.js +53 -4
- package/lib/browser/components/chat-asks.d.ts +2 -0
- package/lib/browser/components/chat-asks.js +8 -0
- package/lib/browser/components/chat-busy.d.ts +33 -0
- package/lib/browser/components/chat-busy.js +52 -0
- package/lib/browser/components/chat-icon.d.ts +6 -0
- package/lib/browser/components/chat-icon.js +17 -1
- package/lib/browser/components/chat-list-row.d.ts +85 -0
- package/lib/browser/components/chat-list-row.js +236 -0
- package/lib/browser/components/chat-list-util.d.ts +167 -0
- package/lib/browser/components/chat-list-util.js +338 -0
- package/lib/browser/components/chat-list.d.ts +9 -148
- package/lib/browser/components/chat-list.js +294 -532
- package/lib/browser/components/chat-seen.js +1 -0
- package/lib/browser/components/composer-addon-util.d.ts +1 -1
- package/lib/browser/components/composer-addons.d.ts +1 -1
- package/lib/browser/components/composer-attachments.d.ts +12 -0
- package/lib/browser/components/composer-attachments.js +64 -0
- package/lib/browser/components/composer-box-hooks.d.ts +10 -0
- package/lib/browser/components/composer-box-hooks.js +178 -0
- package/lib/browser/components/composer-box-protocol.d.ts +109 -0
- package/lib/browser/components/composer-box-protocol.js +3 -0
- package/lib/browser/components/composer-box.d.ts +1 -95
- package/lib/browser/components/composer-box.js +51 -159
- package/lib/browser/components/composer-target.d.ts +22 -0
- package/lib/browser/components/composer-target.js +46 -0
- package/lib/browser/components/composer.d.ts +7 -1
- package/lib/browser/components/composer.js +15 -11
- package/lib/browser/components/context-menu.js +4 -0
- package/lib/browser/components/conversation-find.d.ts +28 -0
- package/lib/browser/components/conversation-find.js +188 -0
- package/lib/browser/components/conversation-scroll-hooks.js +3 -2
- package/lib/browser/components/conversation-scroll-util.d.ts +73 -0
- package/lib/browser/components/conversation-scroll-util.js +85 -1
- package/lib/browser/components/conversation-scroll.d.ts +1 -35
- package/lib/browser/components/conversation-scroll.js +20 -100
- package/lib/browser/components/conversation-view.d.ts +9 -0
- package/lib/browser/components/conversation-view.js +77 -0
- package/lib/browser/components/discover-view.d.ts +3 -2
- package/lib/browser/components/discover-view.js +30 -25
- package/lib/browser/components/dismiss.js +2 -0
- package/lib/browser/components/earlier-messages.d.ts +2 -0
- package/lib/browser/components/earlier-messages.js +2 -1
- package/lib/browser/components/folder-picker.d.ts +7 -0
- package/lib/browser/components/folder-picker.js +88 -18
- package/lib/browser/components/gallery.d.ts +1 -1
- package/lib/browser/components/gallery.js +56 -13
- package/lib/browser/components/host-view.d.ts +1 -1
- package/lib/browser/components/host-view.js +4 -2
- package/lib/browser/components/image-menu.d.ts +12 -0
- package/lib/browser/components/image-menu.js +65 -0
- package/lib/browser/components/image-viewer.d.ts +3 -2
- package/lib/browser/components/image-viewer.js +28 -3
- package/lib/browser/components/lightbox.js +2 -0
- package/lib/browser/components/link-dialog.js +2 -0
- package/lib/browser/components/list-rows.d.ts +3 -1
- package/lib/browser/components/list-rows.js +2 -1
- package/lib/browser/components/markdown.js +5 -0
- package/lib/browser/components/media.d.ts +2 -0
- package/lib/browser/components/media.js +17 -1
- package/lib/browser/components/message-actions.d.ts +1 -1
- package/lib/browser/components/message-actions.js +9 -0
- package/lib/browser/components/message-footer.d.ts +3 -1
- package/lib/browser/components/message-footer.js +2 -1
- package/lib/browser/components/message-images.d.ts +42 -0
- package/lib/browser/components/message-images.js +157 -0
- package/lib/browser/components/message-list.d.ts +4 -100
- package/lib/browser/components/message-list.js +11 -455
- package/lib/browser/components/message-menu.js +4 -0
- package/lib/browser/components/message-steps.d.ts +22 -0
- package/lib/browser/components/message-steps.js +218 -0
- package/lib/browser/components/message-user.d.ts +55 -0
- package/lib/browser/components/message-user.js +211 -0
- package/lib/browser/components/model-picker.d.ts +1 -1
- package/lib/browser/components/model-picker.js +2 -0
- package/lib/browser/components/moved-notice.d.ts +15 -0
- package/lib/browser/components/moved-notice.js +96 -0
- package/lib/browser/components/nav-places.d.ts +12 -1
- package/lib/browser/components/nav-places.js +12 -3
- package/lib/browser/components/notice-center.js +35 -0
- package/lib/browser/components/notice-face.js +7 -6
- package/lib/browser/components/phone-shell.d.ts +4 -3
- package/lib/browser/components/phone-shell.js +59 -67
- package/lib/browser/components/plus-menu.d.ts +1 -1
- package/lib/browser/components/relay-services.d.ts +6 -1
- package/lib/browser/components/relay-services.js +107 -0
- package/lib/browser/components/relay-view.js +2 -0
- package/lib/browser/components/remote-hosts.d.ts +10 -0
- package/lib/browser/components/remote-hosts.js +8 -6
- package/lib/browser/components/remote-prompts.js +2 -0
- package/lib/browser/components/scan-screen.js +7 -0
- package/lib/browser/components/screen-navigator-util.d.ts +29 -0
- package/lib/browser/components/screen-navigator-util.js +36 -0
- package/lib/browser/components/screen-navigator.d.ts +31 -0
- package/lib/browser/components/screen-navigator.js +83 -0
- package/lib/browser/components/session-settings.d.ts +1 -1
- package/lib/browser/components/session-view.js +157 -7
- package/lib/browser/components/settings-choices.d.ts +7 -1
- package/lib/browser/components/settings-choices.js +9 -1
- package/lib/browser/components/settings-more.d.ts +8 -0
- package/lib/browser/components/settings-more.js +299 -0
- package/lib/browser/components/settings-parts.d.ts +8 -3
- package/lib/browser/components/settings-parts.js +27 -245
- package/lib/browser/components/settings-view.js +43 -15
- package/lib/browser/components/stop-times.js +1 -0
- package/lib/browser/components/surface-flyout.js +2 -0
- package/lib/browser/components/unseen-drop.d.ts +10 -4
- package/lib/browser/components/unseen-drop.js +9 -8
- package/lib/browser/components/use-seen-chats.js +2 -2
- package/lib/browser/components/voice-services.d.ts +7 -0
- package/lib/browser/components/voice-services.js +173 -0
- package/lib/browser/components/voice-talk.d.ts +23 -6
- package/lib/browser/components/voice-talk.js +45 -10
- package/lib/browser/components/web-composer.d.ts +1 -1
- package/lib/browser/components/web-composer.js +2 -2
- package/lib/browser/components/web-dialog.js +2 -0
- package/lib/browser/device/back-stack.d.ts +89 -11
- package/lib/browser/device/back-stack.js +205 -31
- package/lib/browser/device/device-protocol.d.ts +1 -1
- package/lib/browser/device/device-protocol.js +1 -1
- package/lib/browser/device/own-gestures.d.ts +1 -1
- package/lib/browser/device/pull-down.js +8 -6
- package/lib/browser/device/row-swipe.js +11 -9
- package/lib/browser/device/sheet-swipe.d.ts +1 -179
- package/lib/browser/device/sheet-swipe.js +16 -452
- package/lib/browser/device/swipe-finger.d.ts +32 -0
- package/lib/browser/device/swipe-finger.js +87 -0
- package/lib/browser/device/swipe-settle.d.ts +53 -0
- package/lib/browser/device/swipe-settle.js +176 -0
- package/lib/browser/device/swipe-util.d.ts +98 -0
- package/lib/browser/device/swipe-util.js +187 -0
- package/lib/browser/drafts/drafts-protocol.d.ts +59 -0
- package/lib/browser/drafts/drafts-protocol.js +78 -0
- package/lib/browser/drafts/drafts.d.ts +22 -0
- package/lib/browser/drafts/drafts.js +94 -0
- package/lib/browser/drafts/use-composer-draft.d.ts +21 -0
- package/lib/browser/drafts/use-composer-draft.js +146 -0
- package/lib/browser/extension/icons.js +2 -0
- package/lib/browser/extension/web-api-components.d.ts +13 -0
- package/lib/browser/extension/web-api-contributions.d.ts +125 -0
- package/lib/browser/extension/web-extension-api.d.ts +88 -5
- package/lib/browser/extension/web-extension-context.d.ts +5 -0
- package/lib/browser/extension/web-extension-context.js +62 -9
- package/lib/browser/extension/web-extension-protocol.d.ts +19 -1
- package/lib/browser/extension/web-extension-protocol.js +3 -0
- package/lib/browser/extension/web-extension-run.d.ts +5 -2
- package/lib/browser/extension/web-extension-run.js +13 -1
- package/lib/browser/extension/web-extensions-running.d.ts +94 -0
- package/lib/browser/extension/web-extensions-running.js +343 -0
- package/lib/browser/extension/web-extensions.d.ts +6 -82
- package/lib/browser/extension/web-extensions.js +7 -316
- package/lib/browser/extension/web-pages.js +1 -0
- package/lib/browser/extension/web-session-notices.js +8 -3
- package/lib/browser/extension/web-tasks.d.ts +2 -0
- package/lib/browser/extension/web-tasks.js +6 -0
- package/lib/browser/extension/web-view-util.d.ts +2 -1
- package/lib/browser/extension/web-view-util.js +4 -1
- package/lib/browser/gateway/console-parts.d.ts +1 -11
- package/lib/browser/gateway/console-parts.js +38 -129
- package/lib/browser/gateway/console-tenant.js +2 -1
- package/lib/browser/gateway/console-trend.d.ts +12 -0
- package/lib/browser/gateway/console-trend.js +151 -0
- package/lib/browser/gateway/console-view.js +39 -1
- package/lib/browser/i18n/locales.d.ts +143 -6
- package/lib/browser/i18n/messages-ja.js +144 -7
- package/lib/browser/i18n/messages-zh-tw.js +144 -7
- package/lib/browser/i18n/messages.d.ts +140 -3
- package/lib/browser/i18n/messages.js +288 -14
- package/lib/browser/index.d.ts +17 -0
- package/lib/browser/index.js +17 -0
- package/lib/browser/notices/notices-protocol.d.ts +12 -0
- package/lib/browser/notices/notices.js +7 -4
- package/lib/browser/offline/device-values.d.ts +2 -0
- package/lib/browser/offline/device-values.js +6 -1
- package/lib/browser/screen/page-answers.d.ts +43 -0
- package/lib/browser/screen/page-answers.js +93 -0
- package/lib/browser/screen/screen-protocol.d.ts +113 -0
- package/lib/browser/screen/screen-protocol.js +48 -0
- package/lib/browser/screen/screen.d.ts +21 -0
- package/lib/browser/screen/screen.js +125 -0
- package/lib/browser/screen/use-screen-part.d.ts +7 -0
- package/lib/browser/screen/use-screen-part.js +50 -0
- package/lib/browser/settings/settings-protocol.d.ts +5 -1
- package/lib/browser/settings/settings-protocol.js +5 -1
- package/lib/browser/share/shared-extensions.d.ts +30 -0
- package/lib/browser/share/shared-extensions.js +181 -0
- package/lib/browser/share/shared-link.d.ts +12 -0
- package/lib/browser/share/shared-link.js +41 -0
- package/lib/browser/share/shared-page.d.ts +6 -0
- package/lib/browser/share/shared-page.js +173 -0
- package/lib/browser/state/state-protocol.d.ts +14 -0
- package/lib/browser/state/state-protocol.js +20 -1
- package/lib/browser/state/state.d.ts +10 -2
- package/lib/browser/state/state.js +18 -2
- package/lib/browser/style/base.d.ts +1 -1
- package/lib/browser/style/base.js +4 -0
- package/lib/browser/style/chat-list.d.ts +3 -0
- package/lib/browser/style/chat-list.js +156 -0
- package/lib/browser/style/conversation-column.d.ts +3 -0
- package/lib/browser/style/conversation-column.js +253 -0
- package/lib/browser/style/conversation.d.ts +1 -1
- package/lib/browser/style/conversation.js +24 -8
- package/lib/browser/style/dialogs.d.ts +3 -0
- package/lib/browser/style/dialogs.js +166 -0
- package/lib/browser/style/layout.d.ts +2 -2
- package/lib/browser/style/layout.js +1 -525
- package/lib/browser/style/pages.d.ts +1 -1
- package/lib/browser/style/pages.js +9 -3
- package/lib/browser/style/phone.d.ts +1 -1
- package/lib/browser/style/phone.js +7 -3
- package/lib/browser/style/shared.d.ts +3 -0
- package/lib/browser/style/shared.js +26 -0
- package/lib/browser/style/shell.d.ts +1 -1
- package/lib/browser/style/shell.js +47 -0
- package/lib/browser/style/tasks.d.ts +1 -1
- package/lib/browser/style/tasks.js +13 -8
- package/lib/browser/style.js +8 -0
- package/lib/browser/util/gallery.d.ts +24 -2
- package/lib/browser/util/gallery.js +82 -2
- package/lib/browser/util/image-copy.d.ts +17 -0
- package/lib/browser/util/image-copy.js +60 -0
- package/lib/browser/util/message.d.ts +5 -0
- package/lib/browser/util/message.js +14 -0
- package/lib/browser/util/process.d.ts +6 -2
- package/lib/browser/util/process.js +6 -2
- package/lib/browser/util/spoken.d.ts +25 -0
- package/lib/browser/util/spoken.js +86 -0
- package/lib/browser/util/transcript.d.ts +23 -0
- package/lib/browser/util/transcript.js +49 -0
- package/lib/browser/util/voice.d.ts +5 -1
- package/lib/browser/util/voice.js +6 -1
- package/lib/browser/workbench-hosts.d.ts +37 -0
- package/lib/browser/workbench-hosts.js +124 -0
- package/lib/browser/workbench-lists.d.ts +34 -0
- package/lib/browser/workbench-lists.js +132 -0
- package/lib/browser/workbench-protocol.d.ts +14 -1
- package/lib/browser/workbench-services.d.ts +50 -0
- package/lib/browser/workbench-services.js +124 -0
- package/lib/browser/workbench-util.d.ts +1 -1
- package/lib/browser/workbench.d.ts +6 -89
- package/lib/browser/workbench.js +23 -333
- package/package.json +7 -7
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { Autowired } from '@celljs/core';
|
|
11
|
+
import { TaWebExtensions } from '../extension/web-extension-protocol.js';
|
|
12
|
+
import { TaNotices } from '../notices/notices-protocol.js';
|
|
13
|
+
import { TaKeptChats } from '../offline/kept-chats-protocol.js';
|
|
14
|
+
import { TaState } from '../state/state-protocol.js';
|
|
15
|
+
import { TaWorkbench } from '../workbench-protocol.js';
|
|
16
|
+
import { ChatPackages } from './chat-packages.js';
|
|
17
|
+
import { ChatStores } from './chat-stores.js';
|
|
18
|
+
import { ChatUtil } from './chat-util.js';
|
|
19
|
+
/** The conversation shown: one change of it at a time, its store attached, followed and left. */
|
|
20
|
+
export class ChatShown {
|
|
21
|
+
constructor() {
|
|
22
|
+
this.current = {};
|
|
23
|
+
this.listeners = new Set();
|
|
24
|
+
/** One change of the conversation shown at a time. */
|
|
25
|
+
this.queue = Promise.resolve();
|
|
26
|
+
this.unfollow = [];
|
|
27
|
+
this.watching = false;
|
|
28
|
+
/** Sessions shown while still on their way, counted for their keys. */
|
|
29
|
+
this.coming = 0;
|
|
30
|
+
/** Stop was pressed while the new conversation opened: its run stops once it is there. */
|
|
31
|
+
this.stopping = false;
|
|
32
|
+
}
|
|
33
|
+
/** The packages of the conversation shown, loaded again after a run that changed them. */
|
|
34
|
+
get packages() {
|
|
35
|
+
var _a;
|
|
36
|
+
(_a = this.madePackages) !== null && _a !== void 0 ? _a : (this.madePackages = new ChatPackages(this.extensions, this.workbench, this.stores, {
|
|
37
|
+
shown: () => this.current.store,
|
|
38
|
+
enqueue: change => this.enqueue(change),
|
|
39
|
+
reopen: store => this.reopen(store),
|
|
40
|
+
}));
|
|
41
|
+
return this.madePackages;
|
|
42
|
+
}
|
|
43
|
+
/** The sessions and stores of the conversations, made once the services are in. */
|
|
44
|
+
get stores() {
|
|
45
|
+
var _a;
|
|
46
|
+
(_a = this.madeStores) !== null && _a !== void 0 ? _a : (this.madeStores = new ChatStores(this.workbench, this.kept, this.extensions));
|
|
47
|
+
return this.madeStores;
|
|
48
|
+
}
|
|
49
|
+
get state() {
|
|
50
|
+
return this.current;
|
|
51
|
+
}
|
|
52
|
+
subscribe(listener) {
|
|
53
|
+
this.listeners.add(listener);
|
|
54
|
+
return () => this.listeners.delete(listener);
|
|
55
|
+
}
|
|
56
|
+
enqueue(change) {
|
|
57
|
+
// With a conversation shown, a failure is a notice; with none, the page says it in its place.
|
|
58
|
+
const next = this.queue.then(change).catch(error =>
|
|
59
|
+
// A lost connection is no failure: the row of the connection says it, and what was asked goes on once it is back.
|
|
60
|
+
ChatUtil.lost(error)
|
|
61
|
+
? undefined
|
|
62
|
+
: this.current.store || this.current.draft
|
|
63
|
+
? void this.notices.error(error)
|
|
64
|
+
: this.update({ error: ChatUtil.message(error) }));
|
|
65
|
+
this.queue = next;
|
|
66
|
+
return next;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Follows a session, running the web tools it asks for. One shown lately and still open shows at once
|
|
70
|
+
* as it was, and catches up as it attaches again; so does one this device kept (its file: `sessionFile`,
|
|
71
|
+
* else the list's). Another shows once loaded, the conversation shown staying until then, so that
|
|
72
|
+
* switching does not flash an empty page. `attachment`: what opening it attached already (ChatStores.open),
|
|
73
|
+
* taken by the store in the same turn of the event loop, so that no event after it is missed.
|
|
74
|
+
*/
|
|
75
|
+
async attach({ sessionId, attachment }, send, sessionFile) {
|
|
76
|
+
var _a;
|
|
77
|
+
var _b;
|
|
78
|
+
const tools = this.stores.toolNames();
|
|
79
|
+
const file = sessionFile !== null && sessionFile !== void 0 ? sessionFile : this.stores.fileOf(sessionId);
|
|
80
|
+
const shown = this.current.store;
|
|
81
|
+
// Shown already, from the device before the connection: attached now, as it is.
|
|
82
|
+
const early = (shown === null || shown === void 0 ? void 0 : shown.sessionId) === sessionId && !this.stores.isAttached(shown) && this.stores.toolsOf(shown) === tools ? shown : undefined;
|
|
83
|
+
const kept = early !== null && early !== void 0 ? early : this.stores.recent.take(sessionId, tools);
|
|
84
|
+
if (kept && this.stores.listed(sessionId)) {
|
|
85
|
+
if (!early) {
|
|
86
|
+
this.enter(kept, file);
|
|
87
|
+
}
|
|
88
|
+
try {
|
|
89
|
+
const attaching = kept.attach(attachment);
|
|
90
|
+
const sending = send === null || send === void 0 ? void 0 : send(kept);
|
|
91
|
+
sending === null || sending === void 0 ? void 0 : sending.catch(() => undefined);
|
|
92
|
+
await attaching;
|
|
93
|
+
this.stores.setAttached(kept);
|
|
94
|
+
if (this.current.store === kept) {
|
|
95
|
+
this.listen(kept);
|
|
96
|
+
}
|
|
97
|
+
await sending;
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
catch (_c) {
|
|
101
|
+
// Closed meanwhile: loaded as any other, which fails as it does.
|
|
102
|
+
this.leave(false);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
const before = this.current.store;
|
|
106
|
+
// Shown from the device under another key (a saved one, an agent's on its way): its messages, the same objects, drawn again by nothing.
|
|
107
|
+
const standing = before && this.stores.standsFor(before, file) ? before : undefined;
|
|
108
|
+
// Attached already: what the device kept is not waited for, the conversation is there.
|
|
109
|
+
const initial = (_b = (_a = (early !== null && early !== void 0 ? early : standing)) === null || _a === void 0 ? void 0 : _a.snapshot) !== null && _b !== void 0 ? _b : (attachment ? undefined : await this.stores.read(file));
|
|
110
|
+
const store = this.stores.create(sessionId, initial);
|
|
111
|
+
if (standing) {
|
|
112
|
+
// What failed to go there stays.
|
|
113
|
+
store.carry(standing);
|
|
114
|
+
}
|
|
115
|
+
if (initial) {
|
|
116
|
+
// As this device saw it, at once.
|
|
117
|
+
this.enter(store, file);
|
|
118
|
+
}
|
|
119
|
+
const attaching = store.attach(attachment);
|
|
120
|
+
// Behind the attach on the same connection: the service has the session followed when it runs.
|
|
121
|
+
const sending = send === null || send === void 0 ? void 0 : send(store);
|
|
122
|
+
sending === null || sending === void 0 ? void 0 : sending.catch(() => undefined);
|
|
123
|
+
try {
|
|
124
|
+
await attaching;
|
|
125
|
+
// A session opened since (an agent's) is not listed yet: web extensions get the directory of this one.
|
|
126
|
+
if (!this.stores.listed(sessionId)) {
|
|
127
|
+
await this.workbench.refresh();
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
catch (error) {
|
|
131
|
+
store.detach().catch(() => undefined);
|
|
132
|
+
throw error;
|
|
133
|
+
}
|
|
134
|
+
this.stores.setAttached(store);
|
|
135
|
+
if (!initial) {
|
|
136
|
+
this.enter(store, file);
|
|
137
|
+
}
|
|
138
|
+
this.listen(store);
|
|
139
|
+
await sending;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* The conversation picked, at once and whatever the connection, under `key` (what is pending): one this page
|
|
143
|
+
* showed lately in this very frame, else the one this device kept once read, as a chat app shows a chat before
|
|
144
|
+
* it syncs. Its store attaches after (`attach`), taking only what changed since; only a conversation this
|
|
145
|
+
* device never had waits for the computer, its place saying it opens.
|
|
146
|
+
*/
|
|
147
|
+
async showNow(key, sessionFile) {
|
|
148
|
+
const file = sessionFile !== null && sessionFile !== void 0 ? sessionFile : this.stores.fileOf(key);
|
|
149
|
+
if (this.showing(key, file)) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
const recent = this.stores.recent.take(key, this.stores.toolNames());
|
|
153
|
+
if (recent) {
|
|
154
|
+
this.enter(recent, file);
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
const kept = await this.stores.fromDevice(key, file);
|
|
158
|
+
if (kept && this.wanted === key && !this.showing(key, file)) {
|
|
159
|
+
this.enter(kept, file);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
/** Whether the conversation of `key` (or of its file) is shown already. */
|
|
163
|
+
showing(key, sessionFile) {
|
|
164
|
+
const { store } = this.current;
|
|
165
|
+
return !!store && (store.sessionId === key || (!!sessionFile && this.stores.fileOfStore(store) === sessionFile));
|
|
166
|
+
}
|
|
167
|
+
/** Shows a store in place of the one shown, which is kept for later. */
|
|
168
|
+
enter(store, sessionFile) {
|
|
169
|
+
var _a;
|
|
170
|
+
this.leave();
|
|
171
|
+
this.packages.saw(store, true);
|
|
172
|
+
this.follow(store, (_a = sessionFile !== null && sessionFile !== void 0 ? sessionFile : this.stores.fileOfStore(store)) !== null && _a !== void 0 ? _a : store.sessionId);
|
|
173
|
+
this.remember(this.workbench.state.sessions.find(session => session.sessionId === store.sessionId));
|
|
174
|
+
// How the sessions are now (running, last change), without holding up the conversation.
|
|
175
|
+
this.workbench.refresh().catch(() => undefined);
|
|
176
|
+
}
|
|
177
|
+
follow(store, view) {
|
|
178
|
+
var _a;
|
|
179
|
+
let working = store.state.working;
|
|
180
|
+
this.unfollow = [
|
|
181
|
+
store.subscribe(state => {
|
|
182
|
+
if (state.closed) {
|
|
183
|
+
// Closed by another client.
|
|
184
|
+
void this.enqueue(() => (this.current.store === store ? this.replace() : Promise.resolve()));
|
|
185
|
+
}
|
|
186
|
+
else if (working && !state.working) {
|
|
187
|
+
void this.packages.settled(store);
|
|
188
|
+
}
|
|
189
|
+
working = state.working;
|
|
190
|
+
}),
|
|
191
|
+
// Gone from the service (it restarted, or closed it while idle): opened again from its file.
|
|
192
|
+
store.onGone(() => void this.enqueue(() => (this.current.store === store ? this.recover() : Promise.resolve()))),
|
|
193
|
+
];
|
|
194
|
+
this.extensions.connect({
|
|
195
|
+
send: text => store.prompt(text, { streamingBehavior: 'followUp' }).then(() => undefined),
|
|
196
|
+
cwd: (_a = this.workbench.state.sessions.find(session => session.sessionId === store.sessionId)) === null || _a === void 0 ? void 0 : _a.cwd,
|
|
197
|
+
sessionId: store.sessionId,
|
|
198
|
+
reload: () => this.packages.reload(store),
|
|
199
|
+
});
|
|
200
|
+
this.update({ store, view, draft: undefined, error: undefined });
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* The events of a store go to web extensions once it is attached: not those it catches up on, which
|
|
204
|
+
* happened while another conversation was shown.
|
|
205
|
+
*/
|
|
206
|
+
listen(store) {
|
|
207
|
+
this.packages.saw(store);
|
|
208
|
+
this.unfollow.push(store.onEvent(event => this.onEvent(event)),
|
|
209
|
+
// On the device as it changes, to show again without the computer.
|
|
210
|
+
this.kept.follow(store, () => this.stores.fileOf(store.sessionId)));
|
|
211
|
+
}
|
|
212
|
+
/** Stops following the conversation shown; it is kept to show again unless `keep` is false (it closed, or is gone). */
|
|
213
|
+
leave(keep = true) {
|
|
214
|
+
var _a;
|
|
215
|
+
for (const stop of this.unfollow.splice(0)) {
|
|
216
|
+
stop();
|
|
217
|
+
}
|
|
218
|
+
this.extensions.connect(undefined);
|
|
219
|
+
const { store } = this.current;
|
|
220
|
+
// One not attached (shown from the device) has nothing to detach, and the device keeps it.
|
|
221
|
+
if (store && this.stores.setDetached(store)) {
|
|
222
|
+
store.detach().catch(() => undefined);
|
|
223
|
+
if (keep && !store.state.closed) {
|
|
224
|
+
this.stores.recent.keep(store, (_a = this.stores.toolsOf(store)) !== null && _a !== void 0 ? _a : '');
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
this.update({ store: undefined });
|
|
228
|
+
}
|
|
229
|
+
onEvent(event) {
|
|
230
|
+
if (event.type === 'session_replaced') {
|
|
231
|
+
this.remember(event.info);
|
|
232
|
+
}
|
|
233
|
+
this.extensions.emit(event);
|
|
234
|
+
}
|
|
235
|
+
update(change) {
|
|
236
|
+
this.current = { ...this.current, ...change };
|
|
237
|
+
for (const listener of this.listeners) {
|
|
238
|
+
listener(this.current);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
__decorate([
|
|
243
|
+
Autowired(TaWorkbench),
|
|
244
|
+
__metadata("design:type", Object)
|
|
245
|
+
], ChatShown.prototype, "workbench", void 0);
|
|
246
|
+
__decorate([
|
|
247
|
+
Autowired(TaWebExtensions),
|
|
248
|
+
__metadata("design:type", Object)
|
|
249
|
+
], ChatShown.prototype, "extensions", void 0);
|
|
250
|
+
__decorate([
|
|
251
|
+
Autowired(TaNotices),
|
|
252
|
+
__metadata("design:type", Object)
|
|
253
|
+
], ChatShown.prototype, "notices", void 0);
|
|
254
|
+
__decorate([
|
|
255
|
+
Autowired(TaState),
|
|
256
|
+
__metadata("design:type", Object)
|
|
257
|
+
], ChatShown.prototype, "persisted", void 0);
|
|
258
|
+
__decorate([
|
|
259
|
+
Autowired(TaKeptChats),
|
|
260
|
+
__metadata("design:type", Object)
|
|
261
|
+
], ChatShown.prototype, "kept", void 0);
|
|
262
|
+
//# sourceMappingURL=chat-shown.js.map
|
|
@@ -14,6 +14,7 @@ import { useScreenArriving } from '../components/phone-shell.js';
|
|
|
14
14
|
import { SessionView } from '../components/session-view.js';
|
|
15
15
|
import { TaAvatar } from '../components/ta-avatar.js';
|
|
16
16
|
import { WorkbenchToggle } from '../components/workbench-toggle.js';
|
|
17
|
+
import { DraftPlaces } from '../drafts/drafts-protocol.js';
|
|
17
18
|
import { ExtensionBoundary } from '../extension/extension-view.js';
|
|
18
19
|
import { WebLabelUtil } from '../extension/web-extension-protocol.js';
|
|
19
20
|
import { useNotices, useSettings, useWorkbench } from '../hooks.js';
|
|
@@ -85,7 +86,7 @@ function DraftView({ draft, menu, aboveComposer, belowComposer }) {
|
|
|
85
86
|
React.createElement("div", { className: "ta-thread" }, sent ? React.createElement(MessageList, { state: sent, outbox: outbox }) : React.createElement(Hero, { cwd: draft.cwd, onPick: text => void submit(text).catch(fail) }))),
|
|
86
87
|
React.createElement("div", { className: "ta-bottom" },
|
|
87
88
|
aboveComposer,
|
|
88
|
-
React.createElement(Composer, { server: workbench.server, workspace: workbench.workspace, working: going, onStop: () => chat.stopDraft(), commands: commands, cwd: draft.cwd || undefined, onSubmit: submit, onError: fail, talkPlace: "draft", recentShots: recentShots, actions: model ? [[model]] : undefined, head: going ? undefined : React.createElement(DirectoryButton, { cwd: draft.cwd, list: list, remote: workbench, onPick: cwd => chat.setDraftCwd(cwd) }) }),
|
|
89
|
+
React.createElement(Composer, { server: workbench.server, workspace: workbench.workspace, working: going, onStop: () => chat.stopDraft(), commands: commands, cwd: draft.cwd || undefined, onSubmit: submit, onError: fail, talkPlace: "draft", draft: DraftPlaces.NEW, recentShots: recentShots, actions: model ? [[model]] : undefined, head: going ? undefined : React.createElement(DirectoryButton, { cwd: draft.cwd, list: list, remote: workbench, onPick: cwd => chat.setDraftCwd(cwd) }) }),
|
|
89
90
|
belowComposer)));
|
|
90
91
|
}
|
|
91
92
|
/** A conversation picked that is still loading, laid out as it will be: its head, a spinner, a message box that waits. */
|
|
@@ -1,39 +1,8 @@
|
|
|
1
1
|
import { type SessionStore } from '@celljs/ta-client';
|
|
2
|
-
import { type ImageContent
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
import { TaState } from '../state/state-protocol.js';
|
|
7
|
-
import { TaWorkbench } from '../workbench-protocol.js';
|
|
8
|
-
import { ChatPackages } from './chat-packages.js';
|
|
9
|
-
import { type ChatDraft, type ChatOpening, type ChatState, TaChat } from './chat-protocol.js';
|
|
10
|
-
import { ChatStores } from './chat-stores.js';
|
|
11
|
-
export declare class TaChatImpl implements TaChat {
|
|
12
|
-
protected readonly workbench: TaWorkbench;
|
|
13
|
-
protected readonly extensions: TaWebExtensions;
|
|
14
|
-
protected readonly notices: TaNotices;
|
|
15
|
-
protected readonly persisted: TaState;
|
|
16
|
-
protected readonly kept: TaKeptChats;
|
|
17
|
-
protected current: ChatState;
|
|
18
|
-
protected readonly listeners: Set<(state: ChatState) => void>;
|
|
19
|
-
/** One change of the conversation shown at a time. */
|
|
20
|
-
protected queue: Promise<void>;
|
|
21
|
-
protected unfollow: (() => void)[];
|
|
22
|
-
protected watching: boolean;
|
|
23
|
-
/** The conversation asked for last: of quick switches, only the last is shown. */
|
|
24
|
-
protected wanted?: string;
|
|
25
|
-
/** Sessions shown while still on their way, counted for their keys. */
|
|
26
|
-
protected coming: number;
|
|
27
|
-
/** Stop was pressed while the new conversation opened: its run stops once it is there. */
|
|
28
|
-
protected stopping: boolean;
|
|
29
|
-
protected madeStores?: ChatStores;
|
|
30
|
-
protected madePackages?: ChatPackages;
|
|
31
|
-
/** The packages of the conversation shown, loaded again after a run that changed them. */
|
|
32
|
-
protected get packages(): ChatPackages;
|
|
33
|
-
/** The sessions and stores of the conversations, made once the services are in. */
|
|
34
|
-
protected get stores(): ChatStores;
|
|
35
|
-
get state(): ChatState;
|
|
36
|
-
subscribe(listener: (state: ChatState) => void): () => void;
|
|
2
|
+
import { type ImageContent } from '@celljs/ta-protocol';
|
|
3
|
+
import { type ChatDraft, type ChatOpening, TaChat } from './chat-protocol.js';
|
|
4
|
+
import { ChatShown } from './chat-shown.js';
|
|
5
|
+
export declare class TaChatImpl extends ChatShown implements TaChat {
|
|
37
6
|
start(): Promise<void>;
|
|
38
7
|
draft(): Promise<void>;
|
|
39
8
|
setDraftCwd(cwd: string): Promise<void>;
|
|
@@ -63,29 +32,6 @@ export declare class TaChatImpl implements TaChat {
|
|
|
63
32
|
}): Promise<SessionStore>;
|
|
64
33
|
/** Closes an open session; its file stays. Closing the one shown shows another, or a new one. */
|
|
65
34
|
protected close(sessionId: string): Promise<void>;
|
|
66
|
-
protected enqueue(change: () => Promise<void>): Promise<void>;
|
|
67
|
-
/**
|
|
68
|
-
* Follows a session, running the web tools it asks for. One shown lately and still open shows at once
|
|
69
|
-
* as it was, and catches up as it attaches again; so does one this device kept (its file: `sessionFile`,
|
|
70
|
-
* else the list's). Another shows once loaded, the conversation shown staying until then, so that
|
|
71
|
-
* switching does not flash an empty page. `attachment`: what opening it attached already (ChatStores.open),
|
|
72
|
-
* taken by the store in the same turn of the event loop, so that no event after it is missed.
|
|
73
|
-
*/
|
|
74
|
-
protected attach({ sessionId, attachment }: {
|
|
75
|
-
sessionId: string;
|
|
76
|
-
attachment?: TaAttachResult;
|
|
77
|
-
}, send?: (store: SessionStore) => Promise<unknown>, sessionFile?: string): Promise<void>;
|
|
78
|
-
/**
|
|
79
|
-
* The conversation picked, at once and whatever the connection, under `key` (what is pending): one this page
|
|
80
|
-
* showed lately in this very frame, else the one this device kept once read, as a chat app shows a chat before
|
|
81
|
-
* it syncs. Its store attaches after (`attach`), taking only what changed since; only a conversation this
|
|
82
|
-
* device never had waits for the computer, its place saying it opens.
|
|
83
|
-
*/
|
|
84
|
-
protected showNow(key: string, sessionFile?: string): Promise<void>;
|
|
85
|
-
/** Whether the conversation of `key` (or of its file) is shown already. */
|
|
86
|
-
protected showing(key: string, sessionFile: string | undefined): boolean;
|
|
87
|
-
/** Shows a store in place of the one shown, which is kept for later. */
|
|
88
|
-
protected enter(store: SessionStore, sessionFile?: string): void;
|
|
89
35
|
/**
|
|
90
36
|
* A session of the list that the service closed since the list was read (idle, or a restart): opened
|
|
91
37
|
* again from its file. One of a package's group is left to its package, which opens it with its role.
|
|
@@ -96,20 +42,10 @@ export declare class TaChatImpl implements TaChat {
|
|
|
96
42
|
/** The newest other open session, or a new conversation. */
|
|
97
43
|
protected replace(): Promise<void>;
|
|
98
44
|
protected showDraft(): void;
|
|
99
|
-
protected follow(store: SessionStore, view: string): void;
|
|
100
|
-
/**
|
|
101
|
-
* The events of a store go to web extensions once it is attached: not those it catches up on, which
|
|
102
|
-
* happened while another conversation was shown.
|
|
103
|
-
*/
|
|
104
|
-
protected listen(store: SessionStore): void;
|
|
105
|
-
/** Stops following the conversation shown; it is kept to show again unless `keep` is false (it closed, or is gone). */
|
|
106
|
-
protected leave(keep?: boolean): void;
|
|
107
|
-
protected onEvent(event: TaEvent): void;
|
|
108
45
|
/** The same conversation, from its file, with the tools of now. */
|
|
109
46
|
protected reopen(store: SessionStore): Promise<void>;
|
|
110
47
|
protected remember(info: {
|
|
111
48
|
sessionFile?: string;
|
|
112
49
|
group?: string;
|
|
113
50
|
} | undefined): void;
|
|
114
|
-
protected update(change: Partial<ChatState>): void;
|
|
115
51
|
}
|
package/esm/browser/chat/chat.js
CHANGED
|
@@ -4,62 +4,19 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
|
|
8
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
-
};
|
|
10
|
-
import { Autowired, Component } from '@celljs/core';
|
|
7
|
+
import { Component } from '@celljs/core';
|
|
11
8
|
import { HOLD_MS, TaRemoteError } from '@celljs/ta-client';
|
|
12
9
|
import { TaErrorCode } from '@celljs/ta-protocol';
|
|
13
|
-
import {
|
|
14
|
-
import { TaNotices } from '../notices/notices-protocol.js';
|
|
15
|
-
import { TaKeptChats } from '../offline/kept-chats-protocol.js';
|
|
16
|
-
import { StateUtil, TaState } from '../state/state-protocol.js';
|
|
10
|
+
import { StateUtil } from '../state/state-protocol.js';
|
|
17
11
|
import { FrameUtil } from '../util/frame.js';
|
|
18
|
-
import { TaWorkbench } from '../workbench-protocol.js';
|
|
19
|
-
import { ChatPackages } from './chat-packages.js';
|
|
20
12
|
import { REMOVED_CHATS, TaChat } from './chat-protocol.js';
|
|
21
|
-
import {
|
|
13
|
+
import { ChatShown } from './chat-shown.js';
|
|
22
14
|
import { ChatUtil } from './chat-util.js';
|
|
23
15
|
/** The file of the conversation shown last, in any browser: the page opens it again. */
|
|
24
|
-
const FILE = { key: 'chat.file', tier: 'user', initial: '', parse: StateUtil.string };
|
|
16
|
+
const FILE = { key: 'chat.file', tier: 'user', initial: '', parse: StateUtil.string, passive: true };
|
|
25
17
|
/** That conversation is of a package's group: the page shows it again only while it is open, as its package opens it with a role of its own. */
|
|
26
18
|
const GROUPED = { key: 'chat.grouped', tier: 'user', initial: false, parse: StateUtil.boolean };
|
|
27
|
-
let TaChatImpl = class TaChatImpl {
|
|
28
|
-
constructor() {
|
|
29
|
-
this.current = {};
|
|
30
|
-
this.listeners = new Set();
|
|
31
|
-
/** One change of the conversation shown at a time. */
|
|
32
|
-
this.queue = Promise.resolve();
|
|
33
|
-
this.unfollow = [];
|
|
34
|
-
this.watching = false;
|
|
35
|
-
/** Sessions shown while still on their way, counted for their keys. */
|
|
36
|
-
this.coming = 0;
|
|
37
|
-
/** Stop was pressed while the new conversation opened: its run stops once it is there. */
|
|
38
|
-
this.stopping = false;
|
|
39
|
-
}
|
|
40
|
-
/** The packages of the conversation shown, loaded again after a run that changed them. */
|
|
41
|
-
get packages() {
|
|
42
|
-
var _a;
|
|
43
|
-
(_a = this.madePackages) !== null && _a !== void 0 ? _a : (this.madePackages = new ChatPackages(this.extensions, this.workbench, this.stores, {
|
|
44
|
-
shown: () => this.current.store,
|
|
45
|
-
enqueue: change => this.enqueue(change),
|
|
46
|
-
reopen: store => this.reopen(store),
|
|
47
|
-
}));
|
|
48
|
-
return this.madePackages;
|
|
49
|
-
}
|
|
50
|
-
/** The sessions and stores of the conversations, made once the services are in. */
|
|
51
|
-
get stores() {
|
|
52
|
-
var _a;
|
|
53
|
-
(_a = this.madeStores) !== null && _a !== void 0 ? _a : (this.madeStores = new ChatStores(this.workbench, this.kept, this.extensions));
|
|
54
|
-
return this.madeStores;
|
|
55
|
-
}
|
|
56
|
-
get state() {
|
|
57
|
-
return this.current;
|
|
58
|
-
}
|
|
59
|
-
subscribe(listener) {
|
|
60
|
-
this.listeners.add(listener);
|
|
61
|
-
return () => this.listeners.delete(listener);
|
|
62
|
-
}
|
|
19
|
+
let TaChatImpl = class TaChatImpl extends ChatShown {
|
|
63
20
|
start() {
|
|
64
21
|
return this.enqueue(async () => {
|
|
65
22
|
if (!this.watching) {
|
|
@@ -352,127 +309,6 @@ let TaChatImpl = class TaChatImpl {
|
|
|
352
309
|
}
|
|
353
310
|
});
|
|
354
311
|
}
|
|
355
|
-
enqueue(change) {
|
|
356
|
-
// With a conversation shown, a failure is a notice; with none, the page says it in its place.
|
|
357
|
-
const next = this.queue.then(change).catch(error =>
|
|
358
|
-
// A lost connection is no failure: the row of the connection says it, and what was asked goes on once it is back.
|
|
359
|
-
ChatUtil.lost(error)
|
|
360
|
-
? undefined
|
|
361
|
-
: this.current.store || this.current.draft
|
|
362
|
-
? void this.notices.error(error)
|
|
363
|
-
: this.update({ error: ChatUtil.message(error) }));
|
|
364
|
-
this.queue = next;
|
|
365
|
-
return next;
|
|
366
|
-
}
|
|
367
|
-
/**
|
|
368
|
-
* Follows a session, running the web tools it asks for. One shown lately and still open shows at once
|
|
369
|
-
* as it was, and catches up as it attaches again; so does one this device kept (its file: `sessionFile`,
|
|
370
|
-
* else the list's). Another shows once loaded, the conversation shown staying until then, so that
|
|
371
|
-
* switching does not flash an empty page. `attachment`: what opening it attached already (ChatStores.open),
|
|
372
|
-
* taken by the store in the same turn of the event loop, so that no event after it is missed.
|
|
373
|
-
*/
|
|
374
|
-
async attach({ sessionId, attachment }, send, sessionFile) {
|
|
375
|
-
var _a;
|
|
376
|
-
var _b;
|
|
377
|
-
const tools = this.stores.toolNames();
|
|
378
|
-
const file = sessionFile !== null && sessionFile !== void 0 ? sessionFile : this.stores.fileOf(sessionId);
|
|
379
|
-
const shown = this.current.store;
|
|
380
|
-
// Shown already, from the device before the connection: attached now, as it is.
|
|
381
|
-
const early = (shown === null || shown === void 0 ? void 0 : shown.sessionId) === sessionId && !this.stores.isAttached(shown) && this.stores.toolsOf(shown) === tools ? shown : undefined;
|
|
382
|
-
const kept = early !== null && early !== void 0 ? early : this.stores.recent.take(sessionId, tools);
|
|
383
|
-
if (kept && this.stores.listed(sessionId)) {
|
|
384
|
-
if (!early) {
|
|
385
|
-
this.enter(kept, file);
|
|
386
|
-
}
|
|
387
|
-
try {
|
|
388
|
-
const attaching = kept.attach(attachment);
|
|
389
|
-
const sending = send === null || send === void 0 ? void 0 : send(kept);
|
|
390
|
-
sending === null || sending === void 0 ? void 0 : sending.catch(() => undefined);
|
|
391
|
-
await attaching;
|
|
392
|
-
this.stores.setAttached(kept);
|
|
393
|
-
if (this.current.store === kept) {
|
|
394
|
-
this.listen(kept);
|
|
395
|
-
}
|
|
396
|
-
await sending;
|
|
397
|
-
return;
|
|
398
|
-
}
|
|
399
|
-
catch (_c) {
|
|
400
|
-
// Closed meanwhile: loaded as any other, which fails as it does.
|
|
401
|
-
this.leave(false);
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
const before = this.current.store;
|
|
405
|
-
// Shown from the device under another key (a saved one, an agent's on its way): its messages, the same objects, drawn again by nothing.
|
|
406
|
-
const standing = before && this.stores.standsFor(before, file) ? before : undefined;
|
|
407
|
-
// Attached already: what the device kept is not waited for, the conversation is there.
|
|
408
|
-
const initial = (_b = (_a = (early !== null && early !== void 0 ? early : standing)) === null || _a === void 0 ? void 0 : _a.snapshot) !== null && _b !== void 0 ? _b : (attachment ? undefined : await this.stores.read(file));
|
|
409
|
-
const store = this.stores.create(sessionId, initial);
|
|
410
|
-
if (standing) {
|
|
411
|
-
// What failed to go there stays.
|
|
412
|
-
store.carry(standing);
|
|
413
|
-
}
|
|
414
|
-
if (initial) {
|
|
415
|
-
// As this device saw it, at once.
|
|
416
|
-
this.enter(store, file);
|
|
417
|
-
}
|
|
418
|
-
const attaching = store.attach(attachment);
|
|
419
|
-
// Behind the attach on the same connection: the service has the session followed when it runs.
|
|
420
|
-
const sending = send === null || send === void 0 ? void 0 : send(store);
|
|
421
|
-
sending === null || sending === void 0 ? void 0 : sending.catch(() => undefined);
|
|
422
|
-
try {
|
|
423
|
-
await attaching;
|
|
424
|
-
// A session opened since (an agent's) is not listed yet: web extensions get the directory of this one.
|
|
425
|
-
if (!this.stores.listed(sessionId)) {
|
|
426
|
-
await this.workbench.refresh();
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
catch (error) {
|
|
430
|
-
store.detach().catch(() => undefined);
|
|
431
|
-
throw error;
|
|
432
|
-
}
|
|
433
|
-
this.stores.setAttached(store);
|
|
434
|
-
if (!initial) {
|
|
435
|
-
this.enter(store, file);
|
|
436
|
-
}
|
|
437
|
-
this.listen(store);
|
|
438
|
-
await sending;
|
|
439
|
-
}
|
|
440
|
-
/**
|
|
441
|
-
* The conversation picked, at once and whatever the connection, under `key` (what is pending): one this page
|
|
442
|
-
* showed lately in this very frame, else the one this device kept once read, as a chat app shows a chat before
|
|
443
|
-
* it syncs. Its store attaches after (`attach`), taking only what changed since; only a conversation this
|
|
444
|
-
* device never had waits for the computer, its place saying it opens.
|
|
445
|
-
*/
|
|
446
|
-
async showNow(key, sessionFile) {
|
|
447
|
-
const file = sessionFile !== null && sessionFile !== void 0 ? sessionFile : this.stores.fileOf(key);
|
|
448
|
-
if (this.showing(key, file)) {
|
|
449
|
-
return;
|
|
450
|
-
}
|
|
451
|
-
const recent = this.stores.recent.take(key, this.stores.toolNames());
|
|
452
|
-
if (recent) {
|
|
453
|
-
this.enter(recent, file);
|
|
454
|
-
return;
|
|
455
|
-
}
|
|
456
|
-
const kept = await this.stores.fromDevice(key, file);
|
|
457
|
-
if (kept && this.wanted === key && !this.showing(key, file)) {
|
|
458
|
-
this.enter(kept, file);
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
/** Whether the conversation of `key` (or of its file) is shown already. */
|
|
462
|
-
showing(key, sessionFile) {
|
|
463
|
-
const { store } = this.current;
|
|
464
|
-
return !!store && (store.sessionId === key || (!!sessionFile && this.stores.fileOfStore(store) === sessionFile));
|
|
465
|
-
}
|
|
466
|
-
/** Shows a store in place of the one shown, which is kept for later. */
|
|
467
|
-
enter(store, sessionFile) {
|
|
468
|
-
var _a;
|
|
469
|
-
this.leave();
|
|
470
|
-
this.packages.saw(store, true);
|
|
471
|
-
this.follow(store, (_a = sessionFile !== null && sessionFile !== void 0 ? sessionFile : this.stores.fileOfStore(store)) !== null && _a !== void 0 ? _a : store.sessionId);
|
|
472
|
-
this.remember(this.workbench.state.sessions.find(session => session.sessionId === store.sessionId));
|
|
473
|
-
// How the sessions are now (running, last change), without holding up the conversation.
|
|
474
|
-
this.workbench.refresh().catch(() => undefined);
|
|
475
|
-
}
|
|
476
312
|
/**
|
|
477
313
|
* A session of the list that the service closed since the list was read (idle, or a restart): opened
|
|
478
314
|
* again from its file. One of a package's group is left to its package, which opens it with its role.
|
|
@@ -522,64 +358,6 @@ let TaChatImpl = class TaChatImpl {
|
|
|
522
358
|
this.update({ draft: { cwd }, error: undefined });
|
|
523
359
|
this.extensions.connect(cwd ? { cwd } : undefined);
|
|
524
360
|
}
|
|
525
|
-
follow(store, view) {
|
|
526
|
-
var _a;
|
|
527
|
-
let working = store.state.working;
|
|
528
|
-
this.unfollow = [
|
|
529
|
-
store.subscribe(state => {
|
|
530
|
-
if (state.closed) {
|
|
531
|
-
// Closed by another client.
|
|
532
|
-
void this.enqueue(() => (this.current.store === store ? this.replace() : Promise.resolve()));
|
|
533
|
-
}
|
|
534
|
-
else if (working && !state.working) {
|
|
535
|
-
void this.packages.settled(store);
|
|
536
|
-
}
|
|
537
|
-
working = state.working;
|
|
538
|
-
}),
|
|
539
|
-
// Gone from the service (it restarted, or closed it while idle): opened again from its file.
|
|
540
|
-
store.onGone(() => void this.enqueue(() => (this.current.store === store ? this.recover() : Promise.resolve()))),
|
|
541
|
-
];
|
|
542
|
-
this.extensions.connect({
|
|
543
|
-
send: text => store.prompt(text, { streamingBehavior: 'followUp' }).then(() => undefined),
|
|
544
|
-
cwd: (_a = this.workbench.state.sessions.find(session => session.sessionId === store.sessionId)) === null || _a === void 0 ? void 0 : _a.cwd,
|
|
545
|
-
sessionId: store.sessionId,
|
|
546
|
-
reload: () => this.packages.reload(store),
|
|
547
|
-
});
|
|
548
|
-
this.update({ store, view, draft: undefined, error: undefined });
|
|
549
|
-
}
|
|
550
|
-
/**
|
|
551
|
-
* The events of a store go to web extensions once it is attached: not those it catches up on, which
|
|
552
|
-
* happened while another conversation was shown.
|
|
553
|
-
*/
|
|
554
|
-
listen(store) {
|
|
555
|
-
this.packages.saw(store);
|
|
556
|
-
this.unfollow.push(store.onEvent(event => this.onEvent(event)),
|
|
557
|
-
// On the device as it changes, to show again without the computer.
|
|
558
|
-
this.kept.follow(store, () => this.stores.fileOf(store.sessionId)));
|
|
559
|
-
}
|
|
560
|
-
/** Stops following the conversation shown; it is kept to show again unless `keep` is false (it closed, or is gone). */
|
|
561
|
-
leave(keep = true) {
|
|
562
|
-
var _a;
|
|
563
|
-
for (const stop of this.unfollow.splice(0)) {
|
|
564
|
-
stop();
|
|
565
|
-
}
|
|
566
|
-
this.extensions.connect(undefined);
|
|
567
|
-
const { store } = this.current;
|
|
568
|
-
// One not attached (shown from the device) has nothing to detach, and the device keeps it.
|
|
569
|
-
if (store && this.stores.setDetached(store)) {
|
|
570
|
-
store.detach().catch(() => undefined);
|
|
571
|
-
if (keep && !store.state.closed) {
|
|
572
|
-
this.stores.recent.keep(store, (_a = this.stores.toolsOf(store)) !== null && _a !== void 0 ? _a : '');
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
this.update({ store: undefined });
|
|
576
|
-
}
|
|
577
|
-
onEvent(event) {
|
|
578
|
-
if (event.type === 'session_replaced') {
|
|
579
|
-
this.remember(event.info);
|
|
580
|
-
}
|
|
581
|
-
this.extensions.emit(event);
|
|
582
|
-
}
|
|
583
361
|
/** The same conversation, from its file, with the tools of now. */
|
|
584
362
|
async reopen(store) {
|
|
585
363
|
var _a;
|
|
@@ -596,33 +374,7 @@ let TaChatImpl = class TaChatImpl {
|
|
|
596
374
|
this.persisted.set(GROUPED, !!info.group);
|
|
597
375
|
}
|
|
598
376
|
}
|
|
599
|
-
update(change) {
|
|
600
|
-
this.current = { ...this.current, ...change };
|
|
601
|
-
for (const listener of this.listeners) {
|
|
602
|
-
listener(this.current);
|
|
603
|
-
}
|
|
604
|
-
}
|
|
605
377
|
};
|
|
606
|
-
__decorate([
|
|
607
|
-
Autowired(TaWorkbench),
|
|
608
|
-
__metadata("design:type", Object)
|
|
609
|
-
], TaChatImpl.prototype, "workbench", void 0);
|
|
610
|
-
__decorate([
|
|
611
|
-
Autowired(TaWebExtensions),
|
|
612
|
-
__metadata("design:type", Object)
|
|
613
|
-
], TaChatImpl.prototype, "extensions", void 0);
|
|
614
|
-
__decorate([
|
|
615
|
-
Autowired(TaNotices),
|
|
616
|
-
__metadata("design:type", Object)
|
|
617
|
-
], TaChatImpl.prototype, "notices", void 0);
|
|
618
|
-
__decorate([
|
|
619
|
-
Autowired(TaState),
|
|
620
|
-
__metadata("design:type", Object)
|
|
621
|
-
], TaChatImpl.prototype, "persisted", void 0);
|
|
622
|
-
__decorate([
|
|
623
|
-
Autowired(TaKeptChats),
|
|
624
|
-
__metadata("design:type", Object)
|
|
625
|
-
], TaChatImpl.prototype, "kept", void 0);
|
|
626
378
|
TaChatImpl = __decorate([
|
|
627
379
|
Component(TaChat)
|
|
628
380
|
], TaChatImpl);
|