@celljs/ta-web 4.15.2 → 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 +128 -334
- 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 +11 -148
- package/esm/browser/components/chat-list.js +280 -511
- package/esm/browser/components/chat-seen.d.ts +7 -0
- package/esm/browser/components/chat-seen.js +58 -10
- 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/environment-view.js +50 -1
- package/esm/browser/components/folder-picker.d.ts +7 -0
- package/esm/browser/components/folder-picker.js +90 -20
- package/esm/browser/components/gallery.d.ts +1 -1
- package/esm/browser/components/gallery.js +57 -14
- package/esm/browser/components/host-tag.js +2 -2
- 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 +67 -5
- 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 +25 -4
- 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 +4 -12
- package/esm/browser/gateway/console-parts.js +42 -125
- package/esm/browser/gateway/console-tenant.js +3 -2
- package/esm/browser/gateway/console-trend.d.ts +11 -0
- package/esm/browser/gateway/console-trend.js +115 -0
- package/esm/browser/gateway/console-util.js +2 -2
- package/esm/browser/gateway/console-view.js +49 -3
- package/esm/browser/i18n/locales.d.ts +170 -6
- package/esm/browser/i18n/messages-ja.js +171 -7
- package/esm/browser/i18n/messages-zh-tw.js +171 -7
- package/esm/browser/i18n/messages.d.ts +167 -3
- package/esm/browser/i18n/messages.js +342 -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 +10 -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 +120 -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 +11 -148
- package/lib/browser/components/chat-list.js +297 -530
- package/lib/browser/components/chat-seen.d.ts +7 -0
- package/lib/browser/components/chat-seen.js +58 -10
- 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/environment-view.js +49 -0
- package/lib/browser/components/folder-picker.d.ts +7 -0
- package/lib/browser/components/folder-picker.js +89 -19
- package/lib/browser/components/gallery.d.ts +1 -1
- package/lib/browser/components/gallery.js +56 -13
- package/lib/browser/components/host-tag.js +1 -1
- 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 +67 -4
- 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 +24 -3
- 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 +4 -12
- package/lib/browser/gateway/console-parts.js +42 -126
- package/lib/browser/gateway/console-tenant.js +3 -2
- package/lib/browser/gateway/console-trend.d.ts +12 -0
- package/lib/browser/gateway/console-trend.js +151 -0
- package/lib/browser/gateway/console-util.js +2 -2
- package/lib/browser/gateway/console-view.js +48 -2
- package/lib/browser/i18n/locales.d.ts +170 -6
- package/lib/browser/i18n/messages-ja.js +171 -7
- package/lib/browser/i18n/messages-zh-tw.js +171 -7
- package/lib/browser/i18n/messages.d.ts +167 -3
- package/lib/browser/i18n/messages.js +342 -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 +10 -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,46 @@
|
|
|
1
|
+
import { MessageUtil } from './message.js';
|
|
2
|
+
/**
|
|
3
|
+
* A conversation as Markdown, to paste elsewhere: what the user said and what the agent answered, each under the
|
|
4
|
+
* name of who said it, oldest first. Tool calls and their results are left out; the text the agent said around
|
|
5
|
+
* them is one answer, as a turn shows it.
|
|
6
|
+
*/
|
|
7
|
+
export var TranscriptUtil;
|
|
8
|
+
(function (TranscriptUtil) {
|
|
9
|
+
/** The parts of `messages` from `from` on, each its speaker and its words; `userText` reads what the user typed. */
|
|
10
|
+
function parts(messages, from, userText) {
|
|
11
|
+
const parts = [];
|
|
12
|
+
for (const message of messages.slice(Math.max(0, from))) {
|
|
13
|
+
const role = message.role;
|
|
14
|
+
if (role === 'user') {
|
|
15
|
+
const text = userText(message).trim();
|
|
16
|
+
if (text) {
|
|
17
|
+
parts.push({ role: 'user', text });
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
else if (role === 'assistant') {
|
|
21
|
+
const text = MessageUtil.blocks(message)
|
|
22
|
+
.filter(block => block.type === 'text')
|
|
23
|
+
.map(block => block.text.trim())
|
|
24
|
+
.filter(Boolean)
|
|
25
|
+
.join('\n\n');
|
|
26
|
+
const last = parts[parts.length - 1];
|
|
27
|
+
if (!text) {
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
if ((last === null || last === void 0 ? void 0 : last.role) === 'agent') {
|
|
31
|
+
last.text = `${last.text}\n\n${text}`;
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
parts.push({ role: 'agent', text });
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return parts;
|
|
39
|
+
}
|
|
40
|
+
TranscriptUtil.parts = parts;
|
|
41
|
+
function markdown(parts, labels) {
|
|
42
|
+
return parts.map(part => `**${part.role === 'user' ? labels.user : labels.agent}:**\n\n${part.text}`).join('\n\n---\n\n');
|
|
43
|
+
}
|
|
44
|
+
TranscriptUtil.markdown = markdown;
|
|
45
|
+
})(TranscriptUtil || (TranscriptUtil = {}));
|
|
46
|
+
//# sourceMappingURL=transcript.js.map
|
|
@@ -73,6 +73,10 @@ export declare namespace Voice {
|
|
|
73
73
|
/** The voices of the system; Chrome has them only once it says so (voiceschanged). */
|
|
74
74
|
function voices(): SpeechSynthesisVoice[];
|
|
75
75
|
/** Reads a reply out, a sentence at a time, with `voice` (a `voiceURI`) or the most natural one; `onEnd` once it is all read. */
|
|
76
|
-
|
|
76
|
+
/**
|
|
77
|
+
* Reads markdown out, a sentence at a time. `onPiece`, told as each sentence begins, with them all and its
|
|
78
|
+
* index: what is read, to show as it is said (the captions of a call).
|
|
79
|
+
*/
|
|
80
|
+
function speak(markdown: string, language: string, onEnd: () => void, voice?: string, onPiece?: (pieces: string[], index: number) => void): void;
|
|
77
81
|
function hush(): void;
|
|
78
82
|
}
|
|
@@ -292,7 +292,11 @@ export var Voice;
|
|
|
292
292
|
Voice.voices = voices;
|
|
293
293
|
let reading;
|
|
294
294
|
/** Reads a reply out, a sentence at a time, with `voice` (a `voiceURI`) or the most natural one; `onEnd` once it is all read. */
|
|
295
|
-
|
|
295
|
+
/**
|
|
296
|
+
* Reads markdown out, a sentence at a time. `onPiece`, told as each sentence begins, with them all and its
|
|
297
|
+
* index: what is read, to show as it is said (the captions of a call).
|
|
298
|
+
*/
|
|
299
|
+
function speak(markdown, language, onEnd, voice, onPiece) {
|
|
296
300
|
hush();
|
|
297
301
|
const text = spoken(markdown);
|
|
298
302
|
const lang = languageOf(text, language);
|
|
@@ -311,6 +315,7 @@ export var Voice;
|
|
|
311
315
|
onEnd();
|
|
312
316
|
return;
|
|
313
317
|
}
|
|
318
|
+
onPiece === null || onPiece === void 0 ? void 0 : onPiece(pieces, index);
|
|
314
319
|
const utterance = new SpeechSynthesisUtterance(pieces[index++]);
|
|
315
320
|
utterance.lang = (_a = chosen === null || chosen === void 0 ? void 0 : chosen.lang) !== null && _a !== void 0 ? _a : lang;
|
|
316
321
|
if (chosen) {
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { TaConnection } from '@celljs/ta-client';
|
|
2
|
+
import type { TaServerInfo } from '@celljs/ta-protocol';
|
|
3
|
+
import { type HostList } from './hosts.js';
|
|
4
|
+
import { WorkbenchLists } from './workbench-lists.js';
|
|
5
|
+
import type { Credential } from './workbench-protocol.js';
|
|
6
|
+
/** The computers this device signs in to: which is in use, and what is kept of each. */
|
|
7
|
+
export declare abstract class WorkbenchHosts extends WorkbenchLists {
|
|
8
|
+
protected list: HostList;
|
|
9
|
+
/** The ta serve of the sign-in of now, whose lists are kept as they change. */
|
|
10
|
+
protected listsOf?: string;
|
|
11
|
+
/** What was kept of the computers dropped, being taken off the device. */
|
|
12
|
+
protected forgetting: Promise<unknown>;
|
|
13
|
+
signIn(text: string): Promise<void>;
|
|
14
|
+
switchTo(hostId: string): void;
|
|
15
|
+
forget(hostId: string): void;
|
|
16
|
+
rename(hostId: string, name: string): void;
|
|
17
|
+
/** Whether a computer answers to the credential, and who it is; the connection is closed after. */
|
|
18
|
+
protected probe(credential: Credential): Promise<TaServerInfo>;
|
|
19
|
+
/**
|
|
20
|
+
* Everything the page shows is of one computer, its web extensions too: it loads again for another,
|
|
21
|
+
* after a moment that shows which (`switching`). What it kept of that one shows at once.
|
|
22
|
+
*/
|
|
23
|
+
protected load(hostId: string): void;
|
|
24
|
+
protected reload(): void;
|
|
25
|
+
/** A host off this device, with what the page kept of it. */
|
|
26
|
+
protected drop(hostId: string): void;
|
|
27
|
+
/** Loads the page again once what was kept of the computers dropped is off the device: a load aborts what IndexedDB has not written. */
|
|
28
|
+
protected reloadSoon(): void;
|
|
29
|
+
protected keepHosts(list: HostList): void;
|
|
30
|
+
protected abstract connectWith(credential: Credential): Promise<void>;
|
|
31
|
+
protected abstract open(credential: Credential): {
|
|
32
|
+
connection: TaConnection;
|
|
33
|
+
refused(): Promise<boolean>;
|
|
34
|
+
};
|
|
35
|
+
abstract signOut(): void;
|
|
36
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { DraftsUtil } from './drafts/drafts-protocol.js';
|
|
2
|
+
import { HostUtil } from './hosts.js';
|
|
3
|
+
import { deviceValues, OfflineKeys } from './offline/device-values.js';
|
|
4
|
+
import { StateUtil } from './state/state-protocol.js';
|
|
5
|
+
import { WorkbenchLists } from './workbench-lists.js';
|
|
6
|
+
import { PROBE_MS, pageHost, SWITCH_MS, storage, WorkbenchError, WorkbenchUtil } from './workbench-util.js';
|
|
7
|
+
/** The computers this device signs in to: which is in use, and what is kept of each. */
|
|
8
|
+
export class WorkbenchHosts extends WorkbenchLists {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.list = WorkbenchUtil.readHosts(storage());
|
|
12
|
+
/** What was kept of the computers dropped, being taken off the device. */
|
|
13
|
+
this.forgetting = Promise.resolve();
|
|
14
|
+
}
|
|
15
|
+
async signIn(text) {
|
|
16
|
+
const credential = WorkbenchUtil.credential(text.trim());
|
|
17
|
+
const id = WorkbenchUtil.serverOf(credential, pageHost());
|
|
18
|
+
if (this.current.status === 'signed-out' || id === this.current.host) {
|
|
19
|
+
this.keepHosts(HostUtil.use(this.list, id, credential, Date.now()));
|
|
20
|
+
await this.connectWith(credential);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
// Another computer while one is in use: tried first, so that a wrong or old code leaves the one in use.
|
|
24
|
+
const server = await this.probe(credential);
|
|
25
|
+
this.keepHosts(HostUtil.use(this.list, id, credential, Date.now(), { user: server.user, host: server.host }));
|
|
26
|
+
this.load(id);
|
|
27
|
+
}
|
|
28
|
+
switchTo(hostId) {
|
|
29
|
+
const host = this.list.hosts.find(one => one.id === hostId);
|
|
30
|
+
if (!host || (hostId === this.current.host && this.current.status !== 'signed-out')) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
this.keepHosts(HostUtil.select(this.list, hostId, Date.now()));
|
|
34
|
+
if (this.current.status === 'signed-out') {
|
|
35
|
+
// Nothing of another computer is shown yet: signed in to in place.
|
|
36
|
+
void this.connectWith(host.credential);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
this.load(hostId);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
forget(hostId) {
|
|
43
|
+
const wasCurrent = hostId === this.current.host;
|
|
44
|
+
this.drop(hostId);
|
|
45
|
+
if (!wasCurrent) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const next = HostUtil.latest(this.list);
|
|
49
|
+
if (next) {
|
|
50
|
+
this.keepHosts(HostUtil.select(this.list, next.id, Date.now()));
|
|
51
|
+
this.load(next.id);
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
this.signOut();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
rename(hostId, name) {
|
|
58
|
+
this.keepHosts(HostUtil.rename(this.list, hostId, name));
|
|
59
|
+
}
|
|
60
|
+
/** Whether a computer answers to the credential, and who it is; the connection is closed after. */
|
|
61
|
+
async probe(credential) {
|
|
62
|
+
const { connection, refused } = this.open(credential);
|
|
63
|
+
let timer;
|
|
64
|
+
try {
|
|
65
|
+
const late = new Promise((_, reject) => {
|
|
66
|
+
timer = setTimeout(() => reject(new WorkbenchError('unreachable')), PROBE_MS);
|
|
67
|
+
});
|
|
68
|
+
await Promise.race([connection.connect(), late]);
|
|
69
|
+
return await Promise.race([connection.server.getServerInfo(), late]);
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
throw error instanceof WorkbenchError ? error : new WorkbenchError((await refused()) ? 'refused' : 'unreachable');
|
|
73
|
+
}
|
|
74
|
+
finally {
|
|
75
|
+
clearTimeout(timer);
|
|
76
|
+
connection.close();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Everything the page shows is of one computer, its web extensions too: it loads again for another,
|
|
81
|
+
* after a moment that shows which (`switching`). What it kept of that one shows at once.
|
|
82
|
+
*/
|
|
83
|
+
load(hostId) {
|
|
84
|
+
this.update({ switching: hostId });
|
|
85
|
+
setTimeout(() => this.reloadSoon(), SWITCH_MS);
|
|
86
|
+
}
|
|
87
|
+
reload() {
|
|
88
|
+
location.reload();
|
|
89
|
+
}
|
|
90
|
+
/** A host off this device, with what the page kept of it. */
|
|
91
|
+
drop(hostId) {
|
|
92
|
+
this.keepHosts(HostUtil.remove(this.list, hostId));
|
|
93
|
+
const kept = storage();
|
|
94
|
+
kept === null || kept === void 0 ? void 0 : kept.removeItem(WorkbenchUtil.listsKey(hostId));
|
|
95
|
+
kept === null || kept === void 0 ? void 0 : kept.removeItem(StateUtil.localKey(DraftsUtil.spec(hostId).key, 'device', hostId));
|
|
96
|
+
if (kept) {
|
|
97
|
+
StateUtil.forgetHost(kept, hostId);
|
|
98
|
+
}
|
|
99
|
+
this.forgetting = Promise.all([this.forgetting, OfflineKeys.forget(deviceValues(), hostId)]);
|
|
100
|
+
if (this.listsOf === hostId) {
|
|
101
|
+
this.listsOf = undefined;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
/** Loads the page again once what was kept of the computers dropped is off the device: a load aborts what IndexedDB has not written. */
|
|
105
|
+
reloadSoon() {
|
|
106
|
+
void this.forgetting.finally(() => this.reload());
|
|
107
|
+
}
|
|
108
|
+
keepHosts(list) {
|
|
109
|
+
var _a;
|
|
110
|
+
this.list = list;
|
|
111
|
+
try {
|
|
112
|
+
(_a = storage()) === null || _a === void 0 ? void 0 : _a.setItem(HostUtil.KEY, JSON.stringify(list));
|
|
113
|
+
}
|
|
114
|
+
catch (_b) {
|
|
115
|
+
// Full: kept for this page.
|
|
116
|
+
}
|
|
117
|
+
this.update({ hosts: list.hosts, host: list.current });
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=workbench-hosts.js.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { SessionStore, type SessionStoreOptions, type TaConnection } from '@celljs/ta-client';
|
|
2
|
+
import type { TaSessionInfo } from '@celljs/ta-protocol';
|
|
3
|
+
import type { WorkbenchState } from './workbench-protocol.js';
|
|
4
|
+
import { WorkbenchServices } from './workbench-services.js';
|
|
5
|
+
/** The lists of the sessions of the computer, open, saved and archived, read and kept on the device. */
|
|
6
|
+
export declare abstract class WorkbenchLists extends WorkbenchServices {
|
|
7
|
+
protected abstract current: WorkbenchState;
|
|
8
|
+
protected refreshing?: Promise<void>;
|
|
9
|
+
protected refreshAgain?: Promise<void>;
|
|
10
|
+
/** Settings.chatArchiveDays: the saved conversations older are read only by `readArchived`. */
|
|
11
|
+
protected archiveDays: number;
|
|
12
|
+
/** The read of the archive under way, and from when it was read (WorkbenchUtil.archiveSince). */
|
|
13
|
+
protected archiving?: Promise<void>;
|
|
14
|
+
protected archivedSince?: number;
|
|
15
|
+
/** Counts the lists of open sessions the server told: a read of the lists begun before one does not undo it. */
|
|
16
|
+
protected pushes: number;
|
|
17
|
+
listOpened(info: TaSessionInfo): void;
|
|
18
|
+
/**
|
|
19
|
+
* One read of the lists at a time: asked again meanwhile, one more follows it for all who asked, so that
|
|
20
|
+
* reads on a slow network do not pile up.
|
|
21
|
+
*/
|
|
22
|
+
refresh(): Promise<void>;
|
|
23
|
+
protected readLists(): Promise<void>;
|
|
24
|
+
setArchiveDays(days: number): void;
|
|
25
|
+
readArchived(): Promise<void>;
|
|
26
|
+
createStore(sessionId: string, options?: SessionStoreOptions): SessionStore;
|
|
27
|
+
/** The open sessions from now on as they change, on each connection; a Ta service of before has its lists read again every few seconds. */
|
|
28
|
+
protected watchSessions(connection: TaConnection): Promise<void>;
|
|
29
|
+
/** The open sessions as the server told them; one that closed is among the saved ones now, which are read again. */
|
|
30
|
+
protected takeSessions(sessions: TaSessionInfo[]): void;
|
|
31
|
+
protected keepLists(of: string): void;
|
|
32
|
+
protected abstract update(change: Partial<WorkbenchState>): void;
|
|
33
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { SessionStore, TaRemoteError } from '@celljs/ta-client';
|
|
2
|
+
import { DEFAULT_SETTINGS } from './settings/settings-protocol.js';
|
|
3
|
+
import { WorkbenchServices } from './workbench-services.js';
|
|
4
|
+
import { PAGE_BYTES, storage, WorkbenchUtil } from './workbench-util.js';
|
|
5
|
+
/** The lists of the sessions of the computer, open, saved and archived, read and kept on the device. */
|
|
6
|
+
export class WorkbenchLists extends WorkbenchServices {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
/** Settings.chatArchiveDays: the saved conversations older are read only by `readArchived`. */
|
|
10
|
+
this.archiveDays = DEFAULT_SETTINGS.chatArchiveDays;
|
|
11
|
+
/** Counts the lists of open sessions the server told: a read of the lists begun before one does not undo it. */
|
|
12
|
+
this.pushes = 0;
|
|
13
|
+
}
|
|
14
|
+
listOpened(info) {
|
|
15
|
+
if (this.current.sessions.some(session => session.sessionId === info.sessionId)) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
// Newer than a list read before it, as one the server told.
|
|
19
|
+
this.pushes++;
|
|
20
|
+
this.update({ sessions: WorkbenchUtil.sorted([...this.current.sessions, info]) });
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* One read of the lists at a time: asked again meanwhile, one more follows it for all who asked, so that
|
|
24
|
+
* reads on a slow network do not pile up.
|
|
25
|
+
*/
|
|
26
|
+
refresh() {
|
|
27
|
+
var _a;
|
|
28
|
+
if (!this.refreshing) {
|
|
29
|
+
this.refreshing = this.readLists().finally(() => {
|
|
30
|
+
this.refreshing = undefined;
|
|
31
|
+
});
|
|
32
|
+
return this.refreshing;
|
|
33
|
+
}
|
|
34
|
+
(_a = this.refreshAgain) !== null && _a !== void 0 ? _a : (this.refreshAgain = this.refreshing
|
|
35
|
+
.catch(() => undefined)
|
|
36
|
+
.then(() => {
|
|
37
|
+
this.refreshAgain = undefined;
|
|
38
|
+
return this.refresh();
|
|
39
|
+
}));
|
|
40
|
+
return this.refreshAgain;
|
|
41
|
+
}
|
|
42
|
+
async readLists() {
|
|
43
|
+
const pushes = this.pushes;
|
|
44
|
+
// A ta serve of before has no saved sessions to list: its list stays the open ones. The default
|
|
45
|
+
// directory comes along, as another device may have changed it. The archived are left out: a list
|
|
46
|
+
// read every few seconds stays as small as the conversations of the last days, however many there were.
|
|
47
|
+
const since = WorkbenchUtil.daysAgo(Date.now(), this.archiveDays);
|
|
48
|
+
const [sessions, saved, server] = await Promise.all([
|
|
49
|
+
this.server.listSessions(),
|
|
50
|
+
this.server.listSavedSessions(since === undefined ? undefined : { since }).catch(() => []),
|
|
51
|
+
this.server.getServerInfo().catch(() => this.current.server),
|
|
52
|
+
]);
|
|
53
|
+
// A ta serve of before lists them all.
|
|
54
|
+
const recent = since === undefined ? saved : saved.filter(session => session.updatedAt >= since);
|
|
55
|
+
// Read every few seconds and mostly the same: what shows them is not drawn again for nothing. A list
|
|
56
|
+
// the server told meanwhile is newer than this one, read before it.
|
|
57
|
+
this.update({
|
|
58
|
+
sessions: pushes === this.pushes ? WorkbenchUtil.same(this.current.sessions, WorkbenchUtil.sorted(sessions)) : this.current.sessions,
|
|
59
|
+
saved: WorkbenchUtil.same(this.current.saved, recent),
|
|
60
|
+
server: WorkbenchUtil.same(this.current.server, server),
|
|
61
|
+
});
|
|
62
|
+
// A day later, those that just grew old are in the archive read, not lost between the two lists.
|
|
63
|
+
if (this.current.archived && this.archivedSince !== since) {
|
|
64
|
+
void this.readArchived().catch(() => undefined);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
setArchiveDays(days) {
|
|
68
|
+
if (days === this.archiveDays) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
this.archiveDays = days;
|
|
72
|
+
if (this.current.status === 'online') {
|
|
73
|
+
void this.refresh().catch(() => undefined);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
readArchived() {
|
|
77
|
+
var _a;
|
|
78
|
+
(_a = this.archiving) !== null && _a !== void 0 ? _a : (this.archiving = (async () => {
|
|
79
|
+
const since = WorkbenchUtil.daysAgo(Date.now(), this.archiveDays);
|
|
80
|
+
const archived = since === undefined ? [] : await this.server.listSavedSessions({ before: since });
|
|
81
|
+
this.archivedSince = since;
|
|
82
|
+
const old = since === undefined ? [] : archived.filter(session => session.updatedAt < since);
|
|
83
|
+
this.update({ archived: WorkbenchUtil.same(this.current.archived, old) });
|
|
84
|
+
})().finally(() => {
|
|
85
|
+
this.archiving = undefined;
|
|
86
|
+
}));
|
|
87
|
+
return this.archiving;
|
|
88
|
+
}
|
|
89
|
+
createStore(sessionId, options) {
|
|
90
|
+
return new SessionStore(this.calls.link, sessionId, { pageBytes: PAGE_BYTES, ...options });
|
|
91
|
+
}
|
|
92
|
+
/** The open sessions from now on as they change, on each connection; a Ta service of before has its lists read again every few seconds. */
|
|
93
|
+
async watchSessions(connection) {
|
|
94
|
+
try {
|
|
95
|
+
const sessions = await connection.server.watchSessions();
|
|
96
|
+
if (this.connection === connection) {
|
|
97
|
+
this.takeSessions(sessions);
|
|
98
|
+
this.update({ sessionsPushed: true });
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
if (this.connection === connection && TaRemoteError.isMethodNotFound(error)) {
|
|
103
|
+
this.update({ sessionsPushed: false });
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
/** The open sessions as the server told them; one that closed is among the saved ones now, which are read again. */
|
|
108
|
+
takeSessions(sessions) {
|
|
109
|
+
this.pushes++;
|
|
110
|
+
const closed = this.current.sessions.some(session => !sessions.some(other => other.sessionId === session.sessionId));
|
|
111
|
+
this.update({ sessions: WorkbenchUtil.same(this.current.sessions, WorkbenchUtil.sorted(sessions)) });
|
|
112
|
+
if (closed) {
|
|
113
|
+
void this.refresh().catch(() => undefined);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
keepLists(of) {
|
|
117
|
+
var _a;
|
|
118
|
+
const { server, sessions, saved } = this.current;
|
|
119
|
+
const kept = { of, server, sessions, saved };
|
|
120
|
+
try {
|
|
121
|
+
(_a = storage()) === null || _a === void 0 ? void 0 : _a.setItem(WorkbenchUtil.listsKey(of), JSON.stringify(kept));
|
|
122
|
+
}
|
|
123
|
+
catch (_b) {
|
|
124
|
+
// Full: the next start waits for the server, as it would without.
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
//# sourceMappingURL=workbench-lists.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SessionStore, SessionStoreOptions } from '@celljs/ta-client';
|
|
2
|
-
import type { TaAccessServer, TaAuthEvent, TaAuthServer, TaGatewayServer, TaPackageServer, TaRelayServer, TaRemoteEvent, TaRemoteServer, TaRoomEvent, TaRoomServer, TaSavedSessionInfo, TaServer, TaServerInfo, TaSessionInfo, TaSettingsServer, TaTerminalServer, TaWorkspaceServer } from '@celljs/ta-protocol';
|
|
2
|
+
import type { TaAccessServer, TaAuthEvent, TaAuthServer, TaGatewayServer, TaPackageServer, TaRelayServer, TaRemoteEvent, TaRemoteServer, TaRoomEvent, TaRoomServer, TaSavedSessionInfo, TaServer, TaServerInfo, TaSessionInfo, TaSettingsServer, TaTerminalServer, TaVoiceEvent, TaVoiceServer, TaWorkspaceServer } from '@celljs/ta-protocol';
|
|
3
3
|
import type { RelayPairing } from '@celljs/ta-relay';
|
|
4
4
|
export declare const TaWorkbench: unique symbol;
|
|
5
5
|
/**
|
|
@@ -74,6 +74,14 @@ export interface WorkbenchPresence {
|
|
|
74
74
|
/** What the box of a conversation holds now: typing while it holds something and keys come. */
|
|
75
75
|
type(sessionId: string, typing: boolean): void;
|
|
76
76
|
}
|
|
77
|
+
/** What ta serve may ask this page (TaClient.onPageAsk), and what it is told of it (PageAnswers). */
|
|
78
|
+
export interface WorkbenchPages {
|
|
79
|
+
/** This page is Ta's own screen (ScreenUtil.agent): it answers nothing. */
|
|
80
|
+
readonly agent: boolean;
|
|
81
|
+
/** Answers `kind` (`<package>/<kind>`, `ta/<kind>`) from now on; the function returned stops. */
|
|
82
|
+
answer(kind: string, handler: (payload: unknown) => unknown): () => void;
|
|
83
|
+
setDevice(device: 'phone' | 'tablet' | 'computer'): void;
|
|
84
|
+
}
|
|
77
85
|
export interface TaWorkbench {
|
|
78
86
|
readonly state: WorkbenchState;
|
|
79
87
|
readonly server: TaServer;
|
|
@@ -88,8 +96,11 @@ export interface TaWorkbench {
|
|
|
88
96
|
readonly relay: TaRelayServer;
|
|
89
97
|
readonly remote: TaRemoteServer;
|
|
90
98
|
readonly rooms: TaRoomServer;
|
|
99
|
+
/** The voice services of calls (docs/design/ta-voice.md). */
|
|
100
|
+
readonly voice: TaVoiceServer;
|
|
91
101
|
/** What this page tells the others in the same Ta it is at (TaPresenceServer). */
|
|
92
102
|
readonly presence: WorkbenchPresence;
|
|
103
|
+
readonly pages: WorkbenchPages;
|
|
93
104
|
subscribe(listener: (state: WorkbenchState) => void): () => void;
|
|
94
105
|
/** Signs in with the token of the URL fragment (`ta serve --web`) or the one this page used before. */
|
|
95
106
|
start(): Promise<void>;
|
|
@@ -162,4 +173,6 @@ export interface TaWorkbench {
|
|
|
162
173
|
messages?: boolean;
|
|
163
174
|
state?: string[];
|
|
164
175
|
}): () => void;
|
|
176
|
+
/** What the voices this page opened tell (TaVoiceServer.openVoice). */
|
|
177
|
+
onVoiceEvent(listener: (event: TaVoiceEvent) => void): () => void;
|
|
165
178
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { TaConnection } from '@celljs/ta-client';
|
|
2
|
+
import { type TaAccessServer, type TaAuthEvent, type TaAuthServer, type TaGatewayServer, type TaPackageServer, type TaRelayServer, type TaRemoteEvent, type TaRemoteServer, type TaRoomEvent, type TaRoomServer, type TaRoomWatch, type TaServer, type TaSettingsServer, type TaTerminalServer, type TaVoiceEvent, type TaVoiceServer, type TaWorkspaceServer } from '@celljs/ta-protocol';
|
|
3
|
+
import type { WorkbenchCalls } from './workbench-calls.js';
|
|
4
|
+
import type { ServiceName } from './workbench-util.js';
|
|
5
|
+
/** The services of the workbench, and the listeners of what its connection tells. */
|
|
6
|
+
export declare abstract class WorkbenchServices {
|
|
7
|
+
protected abstract readonly calls: WorkbenchCalls;
|
|
8
|
+
protected connection?: TaConnection;
|
|
9
|
+
protected readonly terminalListeners: Set<(terminalId: string, data: string, exitCode?: number) => void>;
|
|
10
|
+
protected readonly extensionDataListeners: Set<(name: string, keys: string[], cwd?: string) => void>;
|
|
11
|
+
protected readonly authListeners: Set<(loginId: string, event: TaAuthEvent) => void>;
|
|
12
|
+
protected readonly remoteListeners: Set<(event: TaRemoteEvent) => void>;
|
|
13
|
+
protected readonly voiceListeners: Set<(event: TaVoiceEvent) => void>;
|
|
14
|
+
/** Those that listen to the rooms, and what they hear: messages and the state too, or the state of some keys. */
|
|
15
|
+
protected readonly roomListeners: Map<(event: TaRoomEvent) => void, TaRoomWatch>;
|
|
16
|
+
/** How the connection watches the rooms now: undefined not at all. */
|
|
17
|
+
protected roomsWatched?: TaRoomWatch;
|
|
18
|
+
get server(): TaServer;
|
|
19
|
+
get workspace(): TaWorkspaceServer;
|
|
20
|
+
get terminals(): TaTerminalServer;
|
|
21
|
+
get settings(): TaSettingsServer;
|
|
22
|
+
get packages(): TaPackageServer;
|
|
23
|
+
get auth(): TaAuthServer;
|
|
24
|
+
get access(): TaAccessServer;
|
|
25
|
+
get gateway(): TaGatewayServer;
|
|
26
|
+
get relay(): TaRelayServer;
|
|
27
|
+
get remote(): TaRemoteServer;
|
|
28
|
+
get rooms(): TaRoomServer;
|
|
29
|
+
get voice(): TaVoiceServer;
|
|
30
|
+
onVoiceEvent(listener: (event: TaVoiceEvent) => void): () => void;
|
|
31
|
+
protected service<K extends ServiceName>(name: K): TaConnection[K];
|
|
32
|
+
protected signedIn(): TaConnection;
|
|
33
|
+
onTerminalData(listener: (terminalId: string, data: string, exitCode?: number) => void): () => void;
|
|
34
|
+
onExtensionData(listener: (name: string, keys: string[], cwd?: string) => void): () => void;
|
|
35
|
+
onAuthEvent(listener: (loginId: string, event: TaAuthEvent) => void): () => void;
|
|
36
|
+
onRemoteEvent(listener: (event: TaRemoteEvent) => void): () => void;
|
|
37
|
+
onRoomEvent(listener: (event: TaRoomEvent) => void, options?: {
|
|
38
|
+
messages?: boolean;
|
|
39
|
+
state?: string[];
|
|
40
|
+
}): () => void;
|
|
41
|
+
/** The prompts of ssh that wait for an answer, from now and those already there. */
|
|
42
|
+
protected watchRemote(connection: TaConnection): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* Watches the rooms as the listeners want (messages too if one does), or no more once none listens; on a new
|
|
45
|
+
* connection (`opened`) the listeners read them again (`rooms`), for what changed while away.
|
|
46
|
+
*/
|
|
47
|
+
protected watchRooms(connection: TaConnection, opened: boolean): Promise<void>;
|
|
48
|
+
protected emitRemote(event: TaRemoteEvent): void;
|
|
49
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { TaRoomWatchUtil, } from '@celljs/ta-protocol';
|
|
2
|
+
/** The services of the workbench, and the listeners of what its connection tells. */
|
|
3
|
+
export class WorkbenchServices {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.terminalListeners = new Set();
|
|
6
|
+
this.extensionDataListeners = new Set();
|
|
7
|
+
this.authListeners = new Set();
|
|
8
|
+
this.remoteListeners = new Set();
|
|
9
|
+
this.voiceListeners = new Set();
|
|
10
|
+
/** Those that listen to the rooms, and what they hear: messages and the state too, or the state of some keys. */
|
|
11
|
+
this.roomListeners = new Map();
|
|
12
|
+
}
|
|
13
|
+
get server() {
|
|
14
|
+
return this.service('server');
|
|
15
|
+
}
|
|
16
|
+
get workspace() {
|
|
17
|
+
return this.service('workspace');
|
|
18
|
+
}
|
|
19
|
+
get terminals() {
|
|
20
|
+
return this.service('terminals');
|
|
21
|
+
}
|
|
22
|
+
get settings() {
|
|
23
|
+
return this.service('settings');
|
|
24
|
+
}
|
|
25
|
+
get packages() {
|
|
26
|
+
return this.service('packages');
|
|
27
|
+
}
|
|
28
|
+
get auth() {
|
|
29
|
+
return this.service('auth');
|
|
30
|
+
}
|
|
31
|
+
get access() {
|
|
32
|
+
return this.service('access');
|
|
33
|
+
}
|
|
34
|
+
get gateway() {
|
|
35
|
+
return this.service('gateway');
|
|
36
|
+
}
|
|
37
|
+
get relay() {
|
|
38
|
+
return this.service('relay');
|
|
39
|
+
}
|
|
40
|
+
get remote() {
|
|
41
|
+
return this.service('remote');
|
|
42
|
+
}
|
|
43
|
+
get rooms() {
|
|
44
|
+
return this.service('rooms');
|
|
45
|
+
}
|
|
46
|
+
get voice() {
|
|
47
|
+
return this.service('voice');
|
|
48
|
+
}
|
|
49
|
+
onVoiceEvent(listener) {
|
|
50
|
+
this.voiceListeners.add(listener);
|
|
51
|
+
return () => this.voiceListeners.delete(listener);
|
|
52
|
+
}
|
|
53
|
+
service(name) {
|
|
54
|
+
return this.calls.service(name);
|
|
55
|
+
}
|
|
56
|
+
signedIn() {
|
|
57
|
+
if (!this.connection) {
|
|
58
|
+
throw new Error('Not signed in to ta serve.');
|
|
59
|
+
}
|
|
60
|
+
return this.connection;
|
|
61
|
+
}
|
|
62
|
+
onTerminalData(listener) {
|
|
63
|
+
this.terminalListeners.add(listener);
|
|
64
|
+
return () => this.terminalListeners.delete(listener);
|
|
65
|
+
}
|
|
66
|
+
onExtensionData(listener) {
|
|
67
|
+
this.extensionDataListeners.add(listener);
|
|
68
|
+
return () => this.extensionDataListeners.delete(listener);
|
|
69
|
+
}
|
|
70
|
+
onAuthEvent(listener) {
|
|
71
|
+
this.authListeners.add(listener);
|
|
72
|
+
return () => this.authListeners.delete(listener);
|
|
73
|
+
}
|
|
74
|
+
onRemoteEvent(listener) {
|
|
75
|
+
this.remoteListeners.add(listener);
|
|
76
|
+
return () => this.remoteListeners.delete(listener);
|
|
77
|
+
}
|
|
78
|
+
onRoomEvent(listener, options = {}) {
|
|
79
|
+
const wrapped = (event) => listener(event);
|
|
80
|
+
this.roomListeners.set(wrapped, TaRoomWatchUtil.of(options.messages, options.state));
|
|
81
|
+
if (this.connection) {
|
|
82
|
+
void this.watchRooms(this.connection, false);
|
|
83
|
+
}
|
|
84
|
+
return () => {
|
|
85
|
+
if (this.roomListeners.delete(wrapped) && this.connection) {
|
|
86
|
+
void this.watchRooms(this.connection, false);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
/** The prompts of ssh that wait for an answer, from now and those already there. */
|
|
91
|
+
async watchRemote(connection) {
|
|
92
|
+
const prompts = await connection.remote.watch().catch(() => []);
|
|
93
|
+
for (const prompt of prompts) {
|
|
94
|
+
this.emitRemote({ type: 'prompt', prompt });
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Watches the rooms as the listeners want (messages too if one does), or no more once none listens; on a new
|
|
99
|
+
* connection (`opened`) the listeners read them again (`rooms`), for what changed while away.
|
|
100
|
+
*/
|
|
101
|
+
async watchRooms(connection, opened) {
|
|
102
|
+
const wanted = this.roomListeners.size === 0 ? undefined : TaRoomWatchUtil.union(this.roomListeners.values());
|
|
103
|
+
if (!TaRoomWatchUtil.same(wanted, this.roomsWatched)) {
|
|
104
|
+
this.roomsWatched = wanted;
|
|
105
|
+
// A ta serve of before has no rooms; one of before the state of some keys hears it only with messages.
|
|
106
|
+
await (wanted === undefined ? connection.rooms.unwatch() : connection.rooms.watch(wanted.messages, wanted.state)).catch(() => undefined);
|
|
107
|
+
}
|
|
108
|
+
if (opened) {
|
|
109
|
+
for (const listener of this.roomListeners.keys()) {
|
|
110
|
+
listener({ type: 'rooms' });
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
emitRemote(event) {
|
|
115
|
+
for (const listener of this.remoteListeners) {
|
|
116
|
+
listener(event);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=workbench-services.js.map
|
|
@@ -26,7 +26,7 @@ export interface KeptLists {
|
|
|
26
26
|
sessions: TaSessionInfo[];
|
|
27
27
|
saved: TaSavedSessionInfo[];
|
|
28
28
|
}
|
|
29
|
-
export type ServiceName = 'server' | 'workspace' | 'terminals' | 'settings' | 'packages' | 'auth' | 'access' | 'gateway' | 'relay' | 'remote' | 'rooms';
|
|
29
|
+
export type ServiceName = 'server' | 'workspace' | 'terminals' | 'settings' | 'packages' | 'auth' | 'access' | 'gateway' | 'relay' | 'remote' | 'rooms' | 'voice';
|
|
30
30
|
/**
|
|
31
31
|
* A conversation opens with about this much of its latest messages (a screen or two: the images of the user's
|
|
32
32
|
* come apart, TaShownImage), its earlier ones loaded as much at a time when scrolled to.
|