@celljs/ta-web 4.10.0 → 4.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +7 -7
- package/README.md +7 -7
- package/esm/browser/assistant/assistant-chat-list.d.ts +11 -0
- package/esm/browser/assistant/assistant-chat-list.js +12 -0
- package/esm/browser/assistant/assistant-extension.js +5 -0
- package/esm/browser/assistant/assistant-protocol.d.ts +2 -1
- package/esm/browser/assistant/assistant-task-book.d.ts +12 -2
- package/esm/browser/assistant/assistant-task-book.js +23 -4
- package/esm/browser/assistant/assistant-task-source.d.ts +1 -1
- package/esm/browser/assistant/assistant-task-source.js +5 -10
- package/esm/browser/assistant/assistant-task-util.d.ts +13 -3
- package/esm/browser/assistant/assistant-task-util.js +59 -12
- package/esm/browser/assistant/assistant-view.js +48 -24
- package/esm/browser/assistant/assistant.d.ts +18 -4
- package/esm/browser/assistant/assistant.js +52 -17
- package/esm/browser/avatar/dino-face.js +1 -2
- package/esm/browser/chat/chat-protocol.d.ts +5 -0
- package/esm/browser/chat/chat-stores.d.ts +8 -5
- package/esm/browser/chat/chat-stores.js +17 -9
- package/esm/browser/chat/chat-view.js +23 -15
- package/esm/browser/chat/chat.d.ts +16 -8
- package/esm/browser/chat/chat.js +86 -51
- package/esm/browser/components/account-menu.d.ts +0 -2
- package/esm/browser/components/account-menu.js +1 -27
- package/esm/browser/components/agent-settings-view.d.ts +3 -2
- package/esm/browser/components/agent-settings-view.js +2 -1
- package/esm/browser/components/app-nav.d.ts +5 -2
- package/esm/browser/components/app-nav.js +22 -9
- package/esm/browser/components/app-shell-hooks.js +5 -3
- package/esm/browser/components/app-view.js +84 -20
- package/esm/browser/components/busy.d.ts +25 -0
- package/esm/browser/components/busy.js +52 -0
- package/esm/browser/components/chat-icon.d.ts +29 -0
- package/esm/browser/components/chat-icon.js +78 -0
- package/esm/browser/components/chat-list.d.ts +73 -6
- package/esm/browser/components/chat-list.js +295 -60
- package/esm/browser/components/chat-seen.d.ts +53 -0
- package/esm/browser/components/chat-seen.js +101 -0
- package/esm/browser/components/composer-box.d.ts +15 -4
- package/esm/browser/components/composer-box.js +139 -77
- package/esm/browser/components/composer.d.ts +9 -6
- package/esm/browser/components/composer.js +32 -4
- package/esm/browser/components/conversation-scroll-hooks.d.ts +16 -0
- package/esm/browser/components/conversation-scroll-hooks.js +98 -0
- package/esm/browser/components/conversation-scroll-util.d.ts +30 -0
- package/esm/browser/components/conversation-scroll-util.js +56 -0
- package/esm/browser/components/conversation-scroll.d.ts +52 -31
- package/esm/browser/components/conversation-scroll.js +170 -129
- package/esm/browser/components/custom-host.d.ts +3 -0
- package/esm/browser/components/custom-host.js +14 -0
- package/esm/browser/components/directory-commands.d.ts +6 -0
- package/esm/browser/components/directory-commands.js +34 -0
- package/esm/browser/components/discover-view.d.ts +11 -4
- package/esm/browser/components/discover-view.js +20 -11
- package/esm/browser/components/dismiss.d.ts +3 -0
- package/esm/browser/components/dismiss.js +29 -0
- package/esm/browser/components/earlier-messages.d.ts +34 -3
- package/esm/browser/components/earlier-messages.js +42 -8
- package/esm/browser/components/editor-area.d.ts +6 -22
- package/esm/browser/components/editor-area.js +10 -97
- package/esm/browser/components/face.d.ts +24 -0
- package/esm/browser/components/face.js +42 -0
- package/esm/browser/components/fold-text.d.ts +20 -0
- package/esm/browser/components/fold-text.js +66 -0
- package/esm/browser/components/folder-picker.d.ts +1 -1
- package/esm/browser/components/folder-picker.js +1 -1
- package/esm/browser/components/full-screen.d.ts +9 -0
- package/esm/browser/components/full-screen.js +26 -0
- package/esm/browser/components/grow-box.d.ts +9 -0
- package/esm/browser/components/grow-box.js +50 -0
- package/esm/browser/components/hold-to-talk.d.ts +22 -0
- package/esm/browser/components/hold-to-talk.js +29 -0
- package/esm/browser/components/host-view.d.ts +1 -1
- package/esm/browser/components/icon.d.ts +3 -1
- package/esm/browser/components/icon.js +4 -3
- package/esm/browser/components/image-viewer.d.ts +10 -2
- package/esm/browser/components/image-viewer.js +48 -11
- package/esm/browser/components/launcher-search-util.d.ts +4 -3
- package/esm/browser/components/launcher-search-util.js +12 -4
- package/esm/browser/components/lightbox.d.ts +5 -2
- package/esm/browser/components/lightbox.js +4 -3
- package/esm/browser/components/list-rows.d.ts +9 -1
- package/esm/browser/components/list-rows.js +17 -3
- package/esm/browser/components/markdown.js +36 -4
- package/esm/browser/components/media.js +73 -7
- package/esm/browser/components/message-actions.js +3 -0
- package/esm/browser/components/message-footer.d.ts +8 -0
- package/esm/browser/components/message-footer.js +20 -3
- package/esm/browser/components/message-list.d.ts +60 -7
- package/esm/browser/components/message-list.js +206 -58
- package/esm/browser/components/message-menu.js +6 -1
- package/esm/browser/components/model-picker.js +1 -0
- package/esm/browser/components/nav-places.d.ts +21 -2
- package/esm/browser/components/nav-places.js +20 -4
- package/esm/browser/components/notice-center.js +34 -0
- package/esm/browser/components/notice-face.d.ts +10 -0
- package/esm/browser/components/notice-face.js +28 -0
- package/esm/browser/components/phone-shell.d.ts +23 -1
- package/esm/browser/components/phone-shell.js +98 -9
- package/esm/browser/components/picture.d.ts +8 -1
- package/esm/browser/components/picture.js +12 -1
- package/esm/browser/components/plus-menu.d.ts +23 -0
- package/esm/browser/components/plus-menu.js +90 -0
- package/esm/browser/components/recent-shot.d.ts +15 -0
- package/esm/browser/components/recent-shot.js +174 -0
- package/esm/browser/components/relay-view.js +10 -3
- package/esm/browser/components/run-status.d.ts +1 -1
- package/esm/browser/components/run-status.js +17 -29
- package/esm/browser/components/said-text.d.ts +6 -0
- package/esm/browser/components/said-text.js +14 -0
- package/esm/browser/components/scan-screen.d.ts +10 -0
- package/esm/browser/components/scan-screen.js +230 -0
- package/esm/browser/components/search-page.js +10 -6
- package/esm/browser/components/session-settings.d.ts +2 -3
- package/esm/browser/components/session-settings.js +1 -0
- package/esm/browser/components/session-view.d.ts +3 -1
- package/esm/browser/components/session-view.js +35 -21
- package/esm/browser/components/settings-choices.d.ts +1 -0
- package/esm/browser/components/settings-choices.js +3 -2
- package/esm/browser/components/settings-controls.d.ts +5 -3
- package/esm/browser/components/settings-controls.js +10 -1
- package/esm/browser/components/settings-parts.js +45 -14
- package/esm/browser/components/stop-times.d.ts +47 -0
- package/esm/browser/components/stop-times.js +81 -0
- package/esm/browser/components/tool-view.js +7 -2
- package/esm/browser/components/unseen-drop.d.ts +39 -0
- package/esm/browser/components/unseen-drop.js +219 -0
- package/esm/browser/components/use-seen-chats.d.ts +8 -0
- package/esm/browser/components/use-seen-chats.js +49 -0
- package/esm/browser/components/use-stop-times.d.ts +3 -0
- package/esm/browser/components/use-stop-times.js +17 -0
- package/esm/browser/components/voice-button.d.ts +7 -1
- package/esm/browser/components/voice-button.js +15 -2
- package/esm/browser/components/voice-picker.d.ts +6 -0
- package/esm/browser/components/voice-picker.js +53 -0
- package/esm/browser/components/voice-talk.d.ts +11 -3
- package/esm/browser/components/voice-talk.js +24 -4
- package/esm/browser/components/web-composer.d.ts +4 -2
- package/esm/browser/components/web-composer.js +8 -4
- package/esm/browser/components/workbench-tabs.d.ts +41 -0
- package/esm/browser/components/workbench-tabs.js +193 -0
- package/esm/browser/components/workbench-toggle.d.ts +0 -13
- package/esm/browser/components/workbench-toggle.js +1 -28
- package/esm/browser/device/code-scan.d.ts +55 -0
- package/esm/browser/device/code-scan.js +137 -0
- package/esm/browser/device/code-vision.d.ts +51 -0
- package/esm/browser/device/code-vision.js +100 -0
- package/esm/browser/device/hold.js +4 -6
- package/esm/browser/device/long-press.d.ts +10 -0
- package/esm/browser/device/long-press.js +28 -12
- package/esm/browser/device/own-gestures.d.ts +25 -0
- package/esm/browser/device/own-gestures.js +39 -0
- package/esm/browser/device/photo-picker.d.ts +14 -0
- package/esm/browser/device/photo-picker.js +48 -0
- package/esm/browser/device/pull-down.js +3 -2
- package/esm/browser/device/recent-shots.d.ts +45 -0
- package/esm/browser/device/recent-shots.js +142 -0
- package/esm/browser/device/row-swipe.d.ts +2 -0
- package/esm/browser/device/row-swipe.js +14 -3
- package/esm/browser/device/sheet-swipe.d.ts +1 -1
- package/esm/browser/device/sheet-swipe.js +25 -4
- package/esm/browser/extension/extension-view.d.ts +10 -0
- package/esm/browser/extension/extension-view.js +6 -0
- package/esm/browser/extension/icons.js +16 -2
- package/esm/browser/extension/web-api-components.d.ts +287 -0
- package/esm/browser/extension/web-api-components.js +2 -0
- package/esm/browser/extension/web-api-contributions.d.ts +394 -0
- package/esm/browser/extension/web-api-contributions.js +2 -0
- package/esm/browser/extension/web-api-desktop.d.ts +55 -0
- package/esm/browser/extension/web-api-desktop.js +2 -0
- package/esm/browser/extension/web-api-terminal.d.ts +71 -0
- package/esm/browser/extension/web-api-terminal.js +2 -0
- package/esm/browser/extension/web-editor-tabs.d.ts +42 -0
- package/esm/browser/extension/web-editor-tabs.js +137 -0
- package/esm/browser/extension/web-extension-api.d.ts +186 -565
- package/esm/browser/extension/web-extension-context.d.ts +78 -0
- package/esm/browser/extension/web-extension-context.js +354 -0
- package/esm/browser/extension/web-extension-protocol.d.ts +57 -7
- package/esm/browser/extension/web-extension-protocol.js +34 -0
- package/esm/browser/extension/web-extension-run.d.ts +54 -0
- package/esm/browser/extension/web-extension-run.js +120 -0
- package/esm/browser/extension/web-extensions.d.ts +29 -69
- package/esm/browser/extension/web-extensions.js +121 -516
- package/esm/browser/extension/web-home.d.ts +19 -0
- package/esm/browser/extension/web-home.js +72 -0
- package/esm/browser/extension/web-pages.d.ts +13 -3
- package/esm/browser/extension/web-pages.js +23 -3
- package/esm/browser/extension/web-session-notices.d.ts +36 -0
- package/esm/browser/extension/web-session-notices.js +174 -0
- package/esm/browser/extension/web-sharing.d.ts +2 -0
- package/esm/browser/extension/web-sharing.js +4 -0
- package/esm/browser/game/game-host.d.ts +27 -0
- package/esm/browser/game/game-host.js +127 -0
- package/esm/browser/game/game-loader.d.ts +10 -0
- package/esm/browser/game/game-loader.js +28 -0
- package/esm/browser/game/game-protocol.d.ts +49 -0
- package/esm/browser/game/game-protocol.js +2 -0
- package/esm/browser/game/game-runner.d.ts +27 -0
- package/esm/browser/game/game-runner.js +60 -0
- package/esm/browser/game/game-util.d.ts +29 -0
- package/esm/browser/game/game-util.js +180 -0
- package/esm/browser/game/game-view.d.ts +12 -0
- package/esm/browser/game/game-view.js +31 -0
- package/esm/browser/game/game3d-protocol.d.ts +51 -0
- package/esm/browser/game/game3d-protocol.js +2 -0
- package/esm/browser/game/game3d-runner.d.ts +27 -0
- package/esm/browser/game/game3d-runner.js +149 -0
- package/esm/browser/hooks.d.ts +5 -1
- package/esm/browser/hooks.js +13 -2
- package/esm/browser/i18n/locales.d.ts +92 -2
- package/esm/browser/i18n/messages.d.ts +91 -1
- package/esm/browser/i18n/messages.js +187 -7
- package/esm/browser/index.d.ts +9 -0
- package/esm/browser/index.js +9 -0
- package/esm/browser/links/links-protocol.d.ts +7 -0
- package/esm/browser/links/links.d.ts +24 -7
- package/esm/browser/links/links.js +64 -11
- package/esm/browser/markdown/code-renderers.d.ts +4 -0
- package/esm/browser/markdown/code-renderers.js +4 -0
- package/esm/browser/notices/notices-protocol.d.ts +17 -0
- package/esm/browser/notices/notices.d.ts +1 -1
- package/esm/browser/notices/notices.js +6 -2
- package/esm/browser/notices/session-notices.d.ts +69 -0
- package/esm/browser/notices/session-notices.js +92 -0
- package/esm/browser/offline/device-values.js +12 -3
- package/esm/browser/offline/offline-reads.js +3 -1
- package/esm/browser/settings/navigation.d.ts +3 -2
- package/esm/browser/settings/navigation.js +4 -3
- package/esm/browser/settings/settings-protocol.d.ts +15 -0
- package/esm/browser/settings/settings-protocol.js +18 -4
- package/esm/browser/state/state-protocol.d.ts +8 -1
- package/esm/browser/state/state.d.ts +2 -0
- package/esm/browser/state/state.js +21 -2
- package/esm/browser/style/base.d.ts +1 -1
- package/esm/browser/style/base.js +27 -1
- package/esm/browser/style/conversation.d.ts +1 -1
- package/esm/browser/style/conversation.js +45 -5
- package/esm/browser/style/device.js +15 -1
- package/esm/browser/style/layout.d.ts +1 -1
- package/esm/browser/style/layout.js +192 -56
- package/esm/browser/style/pages.d.ts +1 -1
- package/esm/browser/style/pages.js +39 -1
- package/esm/browser/style/phone.d.ts +1 -1
- package/esm/browser/style/phone.js +15 -0
- package/esm/browser/style/shell.d.ts +1 -1
- package/esm/browser/style/shell.js +32 -6
- package/esm/browser/style/surfaces.d.ts +1 -1
- package/esm/browser/style/surfaces.js +21 -2
- package/esm/browser/style/tints.d.ts +27 -0
- package/esm/browser/style/tints.js +56 -0
- package/esm/browser/style.js +13 -1
- package/esm/browser/util/composer.d.ts +6 -0
- package/esm/browser/util/composer.js +16 -0
- package/esm/browser/util/desktop.d.ts +19 -1
- package/esm/browser/util/desktop.js +15 -0
- package/esm/browser/util/frame.d.ts +2 -0
- package/esm/browser/util/frame.js +2 -0
- package/esm/browser/util/link.d.ts +18 -0
- package/esm/browser/util/link.js +66 -1
- package/esm/browser/util/markdown.d.ts +4 -1
- package/esm/browser/util/markdown.js +1 -1
- package/esm/browser/util/message.d.ts +5 -0
- package/esm/browser/util/message.js +30 -0
- package/esm/browser/util/process.d.ts +57 -3
- package/esm/browser/util/process.js +123 -11
- package/esm/browser/util/progress.d.ts +19 -1
- package/esm/browser/util/progress.js +57 -4
- package/esm/browser/util/quote.d.ts +19 -0
- package/esm/browser/util/quote.js +58 -0
- package/esm/browser/util/tool.d.ts +19 -2
- package/esm/browser/util/tool.js +70 -2
- package/esm/browser/util/voice.d.ts +47 -7
- package/esm/browser/util/voice.js +269 -27
- package/esm/browser/workbench-calls.d.ts +6 -4
- package/esm/browser/workbench-calls.js +15 -10
- package/esm/browser/workbench-protocol.d.ts +31 -2
- package/esm/browser/workbench-util.d.ts +15 -4
- package/esm/browser/workbench-util.js +28 -5
- package/esm/browser/workbench.d.ts +33 -1
- package/esm/browser/workbench.js +142 -14
- package/lib/browser/assistant/assistant-chat-list.d.ts +11 -0
- package/lib/browser/assistant/assistant-chat-list.js +13 -0
- package/lib/browser/assistant/assistant-extension.js +5 -0
- package/lib/browser/assistant/assistant-protocol.d.ts +2 -1
- package/lib/browser/assistant/assistant-task-book.d.ts +12 -2
- package/lib/browser/assistant/assistant-task-book.js +23 -4
- package/lib/browser/assistant/assistant-task-source.d.ts +1 -1
- package/lib/browser/assistant/assistant-task-source.js +5 -10
- package/lib/browser/assistant/assistant-task-util.d.ts +13 -3
- package/lib/browser/assistant/assistant-task-util.js +59 -12
- package/lib/browser/assistant/assistant-view.js +46 -22
- package/lib/browser/assistant/assistant.d.ts +18 -4
- package/lib/browser/assistant/assistant.js +52 -17
- package/lib/browser/avatar/dino-face.js +1 -2
- package/lib/browser/chat/chat-protocol.d.ts +5 -0
- package/lib/browser/chat/chat-stores.d.ts +8 -5
- package/lib/browser/chat/chat-stores.js +17 -9
- package/lib/browser/chat/chat-view.js +22 -14
- package/lib/browser/chat/chat.d.ts +16 -8
- package/lib/browser/chat/chat.js +86 -51
- package/lib/browser/components/account-menu.d.ts +0 -2
- package/lib/browser/components/account-menu.js +2 -29
- package/lib/browser/components/agent-settings-view.d.ts +3 -2
- package/lib/browser/components/agent-settings-view.js +2 -1
- package/lib/browser/components/app-nav.d.ts +5 -2
- package/lib/browser/components/app-nav.js +18 -5
- package/lib/browser/components/app-shell-hooks.js +5 -3
- package/lib/browser/components/app-view.js +80 -16
- package/lib/browser/components/busy.d.ts +26 -0
- package/lib/browser/components/busy.js +91 -0
- package/lib/browser/components/chat-icon.d.ts +30 -0
- package/lib/browser/components/chat-icon.js +117 -0
- package/lib/browser/components/chat-list.d.ts +73 -6
- package/lib/browser/components/chat-list.js +295 -59
- package/lib/browser/components/chat-seen.d.ts +54 -0
- package/lib/browser/components/chat-seen.js +104 -0
- package/lib/browser/components/composer-box.d.ts +15 -4
- package/lib/browser/components/composer-box.js +136 -74
- package/lib/browser/components/composer.d.ts +9 -6
- package/lib/browser/components/composer.js +31 -3
- package/lib/browser/components/conversation-scroll-hooks.d.ts +17 -0
- package/lib/browser/components/conversation-scroll-hooks.js +135 -0
- package/lib/browser/components/conversation-scroll-util.d.ts +31 -0
- package/lib/browser/components/conversation-scroll-util.js +60 -0
- package/lib/browser/components/conversation-scroll.d.ts +52 -31
- package/lib/browser/components/conversation-scroll.js +171 -164
- package/lib/browser/components/custom-host.d.ts +4 -0
- package/lib/browser/components/custom-host.js +50 -0
- package/lib/browser/components/directory-commands.d.ts +7 -0
- package/lib/browser/components/directory-commands.js +70 -0
- package/lib/browser/components/discover-view.d.ts +11 -4
- package/lib/browser/components/discover-view.js +19 -10
- package/lib/browser/components/dismiss.d.ts +4 -0
- package/lib/browser/components/dismiss.js +65 -0
- package/lib/browser/components/earlier-messages.d.ts +34 -3
- package/lib/browser/components/earlier-messages.js +44 -9
- package/lib/browser/components/editor-area.d.ts +6 -22
- package/lib/browser/components/editor-area.js +11 -98
- package/lib/browser/components/face.d.ts +25 -0
- package/lib/browser/components/face.js +79 -0
- package/lib/browser/components/fold-text.d.ts +21 -0
- package/lib/browser/components/fold-text.js +103 -0
- package/lib/browser/components/folder-picker.d.ts +1 -1
- package/lib/browser/components/folder-picker.js +1 -1
- package/lib/browser/components/full-screen.d.ts +10 -0
- package/lib/browser/components/full-screen.js +62 -0
- package/lib/browser/components/grow-box.d.ts +10 -0
- package/lib/browser/components/grow-box.js +86 -0
- package/lib/browser/components/hold-to-talk.d.ts +23 -0
- package/lib/browser/components/hold-to-talk.js +65 -0
- package/lib/browser/components/host-view.d.ts +1 -1
- package/lib/browser/components/icon.d.ts +3 -1
- package/lib/browser/components/icon.js +4 -3
- package/lib/browser/components/image-viewer.d.ts +10 -2
- package/lib/browser/components/image-viewer.js +47 -10
- package/lib/browser/components/launcher-search-util.d.ts +4 -3
- package/lib/browser/components/launcher-search-util.js +12 -4
- package/lib/browser/components/lightbox.d.ts +5 -2
- package/lib/browser/components/lightbox.js +4 -3
- package/lib/browser/components/list-rows.d.ts +9 -1
- package/lib/browser/components/list-rows.js +18 -3
- package/lib/browser/components/markdown.js +36 -4
- package/lib/browser/components/media.js +73 -7
- package/lib/browser/components/message-actions.js +3 -0
- package/lib/browser/components/message-footer.d.ts +8 -0
- package/lib/browser/components/message-footer.js +20 -2
- package/lib/browser/components/message-list.d.ts +60 -7
- package/lib/browser/components/message-list.js +206 -55
- package/lib/browser/components/message-menu.js +6 -1
- package/lib/browser/components/model-picker.js +1 -0
- package/lib/browser/components/nav-places.d.ts +21 -2
- package/lib/browser/components/nav-places.js +22 -4
- package/lib/browser/components/notice-center.js +34 -0
- package/lib/browser/components/notice-face.d.ts +11 -0
- package/lib/browser/components/notice-face.js +64 -0
- package/lib/browser/components/phone-shell.d.ts +23 -1
- package/lib/browser/components/phone-shell.js +99 -10
- package/lib/browser/components/picture.d.ts +8 -1
- package/lib/browser/components/picture.js +13 -1
- package/lib/browser/components/plus-menu.d.ts +24 -0
- package/lib/browser/components/plus-menu.js +126 -0
- package/lib/browser/components/recent-shot.d.ts +16 -0
- package/lib/browser/components/recent-shot.js +210 -0
- package/lib/browser/components/relay-view.js +10 -3
- package/lib/browser/components/run-status.d.ts +1 -1
- package/lib/browser/components/run-status.js +17 -29
- package/lib/browser/components/said-text.d.ts +7 -0
- package/lib/browser/components/said-text.js +50 -0
- package/lib/browser/components/scan-screen.d.ts +11 -0
- package/lib/browser/components/scan-screen.js +266 -0
- package/lib/browser/components/search-page.js +10 -6
- package/lib/browser/components/session-settings.d.ts +2 -3
- package/lib/browser/components/session-settings.js +1 -0
- package/lib/browser/components/session-view.d.ts +3 -1
- package/lib/browser/components/session-view.js +32 -18
- package/lib/browser/components/settings-choices.d.ts +1 -0
- package/lib/browser/components/settings-choices.js +2 -1
- package/lib/browser/components/settings-controls.d.ts +5 -3
- package/lib/browser/components/settings-controls.js +10 -1
- package/lib/browser/components/settings-parts.js +43 -12
- package/lib/browser/components/stop-times.d.ts +48 -0
- package/lib/browser/components/stop-times.js +85 -0
- package/lib/browser/components/tool-view.js +7 -2
- package/lib/browser/components/unseen-drop.d.ts +40 -0
- package/lib/browser/components/unseen-drop.js +256 -0
- package/lib/browser/components/use-seen-chats.d.ts +9 -0
- package/lib/browser/components/use-seen-chats.js +85 -0
- package/lib/browser/components/use-stop-times.d.ts +4 -0
- package/lib/browser/components/use-stop-times.js +53 -0
- package/lib/browser/components/voice-button.d.ts +7 -1
- package/lib/browser/components/voice-button.js +16 -2
- package/lib/browser/components/voice-picker.d.ts +7 -0
- package/lib/browser/components/voice-picker.js +89 -0
- package/lib/browser/components/voice-talk.d.ts +11 -3
- package/lib/browser/components/voice-talk.js +25 -4
- package/lib/browser/components/web-composer.d.ts +4 -2
- package/lib/browser/components/web-composer.js +7 -3
- package/lib/browser/components/workbench-tabs.d.ts +42 -0
- package/lib/browser/components/workbench-tabs.js +232 -0
- package/lib/browser/components/workbench-toggle.d.ts +0 -13
- package/lib/browser/components/workbench-toggle.js +1 -29
- package/lib/browser/device/code-scan.d.ts +56 -0
- package/lib/browser/device/code-scan.js +141 -0
- package/lib/browser/device/code-vision.d.ts +52 -0
- package/lib/browser/device/code-vision.js +103 -0
- package/lib/browser/device/hold.js +4 -6
- package/lib/browser/device/long-press.d.ts +10 -0
- package/lib/browser/device/long-press.js +28 -12
- package/lib/browser/device/own-gestures.d.ts +26 -0
- package/lib/browser/device/own-gestures.js +42 -0
- package/lib/browser/device/photo-picker.d.ts +15 -0
- package/lib/browser/device/photo-picker.js +51 -0
- package/lib/browser/device/pull-down.js +3 -2
- package/lib/browser/device/recent-shots.d.ts +46 -0
- package/lib/browser/device/recent-shots.js +145 -0
- package/lib/browser/device/row-swipe.d.ts +2 -0
- package/lib/browser/device/row-swipe.js +14 -3
- package/lib/browser/device/sheet-swipe.d.ts +1 -1
- package/lib/browser/device/sheet-swipe.js +25 -4
- package/lib/browser/extension/extension-view.d.ts +10 -0
- package/lib/browser/extension/extension-view.js +7 -1
- package/lib/browser/extension/icons.js +15 -1
- package/lib/browser/extension/web-api-components.d.ts +288 -0
- package/lib/browser/extension/web-api-components.js +3 -0
- package/lib/browser/extension/web-api-contributions.d.ts +395 -0
- package/lib/browser/extension/web-api-contributions.js +3 -0
- package/lib/browser/extension/web-api-desktop.d.ts +56 -0
- package/lib/browser/extension/web-api-desktop.js +3 -0
- package/lib/browser/extension/web-api-terminal.d.ts +72 -0
- package/lib/browser/extension/web-api-terminal.js +3 -0
- package/lib/browser/extension/web-editor-tabs.d.ts +43 -0
- package/lib/browser/extension/web-editor-tabs.js +141 -0
- package/lib/browser/extension/web-extension-api.d.ts +186 -565
- package/lib/browser/extension/web-extension-context.d.ts +79 -0
- package/lib/browser/extension/web-extension-context.js +391 -0
- package/lib/browser/extension/web-extension-protocol.d.ts +57 -7
- package/lib/browser/extension/web-extension-protocol.js +35 -1
- package/lib/browser/extension/web-extension-run.d.ts +55 -0
- package/lib/browser/extension/web-extension-run.js +123 -0
- package/lib/browser/extension/web-extensions.d.ts +29 -69
- package/lib/browser/extension/web-extensions.js +117 -545
- package/lib/browser/extension/web-home.d.ts +20 -0
- package/lib/browser/extension/web-home.js +76 -0
- package/lib/browser/extension/web-pages.d.ts +13 -3
- package/lib/browser/extension/web-pages.js +23 -3
- package/lib/browser/extension/web-session-notices.d.ts +37 -0
- package/lib/browser/extension/web-session-notices.js +177 -0
- package/lib/browser/extension/web-sharing.d.ts +2 -0
- package/lib/browser/extension/web-sharing.js +4 -0
- package/lib/browser/game/game-host.d.ts +28 -0
- package/lib/browser/game/game-host.js +163 -0
- package/lib/browser/game/game-loader.d.ts +11 -0
- package/lib/browser/game/game-loader.js +31 -0
- package/lib/browser/game/game-protocol.d.ts +50 -0
- package/lib/browser/game/game-protocol.js +3 -0
- package/lib/browser/game/game-runner.d.ts +28 -0
- package/lib/browser/game/game-runner.js +64 -0
- package/lib/browser/game/game-util.d.ts +30 -0
- package/lib/browser/game/game-util.js +183 -0
- package/lib/browser/game/game-view.d.ts +13 -0
- package/lib/browser/game/game-view.js +68 -0
- package/lib/browser/game/game3d-protocol.d.ts +52 -0
- package/lib/browser/game/game3d-protocol.js +3 -0
- package/lib/browser/game/game3d-runner.d.ts +28 -0
- package/lib/browser/game/game3d-runner.js +153 -0
- package/lib/browser/hooks.d.ts +5 -1
- package/lib/browser/hooks.js +14 -2
- package/lib/browser/i18n/locales.d.ts +92 -2
- package/lib/browser/i18n/messages.d.ts +91 -1
- package/lib/browser/i18n/messages.js +187 -7
- package/lib/browser/index.d.ts +9 -0
- package/lib/browser/index.js +9 -0
- package/lib/browser/links/links-protocol.d.ts +7 -0
- package/lib/browser/links/links.d.ts +24 -7
- package/lib/browser/links/links.js +64 -11
- package/lib/browser/markdown/code-renderers.d.ts +5 -0
- package/lib/browser/markdown/code-renderers.js +40 -0
- package/lib/browser/notices/notices-protocol.d.ts +17 -0
- package/lib/browser/notices/notices.d.ts +1 -1
- package/lib/browser/notices/notices.js +6 -2
- package/lib/browser/notices/session-notices.d.ts +70 -0
- package/lib/browser/notices/session-notices.js +96 -0
- package/lib/browser/offline/device-values.js +12 -3
- package/lib/browser/offline/offline-reads.js +3 -1
- package/lib/browser/settings/navigation.d.ts +3 -2
- package/lib/browser/settings/navigation.js +4 -3
- package/lib/browser/settings/settings-protocol.d.ts +15 -0
- package/lib/browser/settings/settings-protocol.js +19 -5
- package/lib/browser/state/state-protocol.d.ts +8 -1
- package/lib/browser/state/state.d.ts +2 -0
- package/lib/browser/state/state.js +21 -2
- package/lib/browser/style/base.d.ts +1 -1
- package/lib/browser/style/base.js +27 -1
- package/lib/browser/style/conversation.d.ts +1 -1
- package/lib/browser/style/conversation.js +45 -5
- package/lib/browser/style/device.js +15 -1
- package/lib/browser/style/layout.d.ts +1 -1
- package/lib/browser/style/layout.js +192 -56
- package/lib/browser/style/pages.d.ts +1 -1
- package/lib/browser/style/pages.js +39 -1
- package/lib/browser/style/phone.d.ts +1 -1
- package/lib/browser/style/phone.js +15 -0
- package/lib/browser/style/shell.d.ts +1 -1
- package/lib/browser/style/shell.js +32 -6
- package/lib/browser/style/surfaces.d.ts +1 -1
- package/lib/browser/style/surfaces.js +21 -2
- package/lib/browser/style/tints.d.ts +28 -0
- package/lib/browser/style/tints.js +59 -0
- package/lib/browser/style.js +13 -1
- package/lib/browser/util/composer.d.ts +6 -0
- package/lib/browser/util/composer.js +16 -0
- package/lib/browser/util/desktop.d.ts +19 -1
- package/lib/browser/util/desktop.js +15 -0
- package/lib/browser/util/frame.d.ts +2 -0
- package/lib/browser/util/frame.js +2 -0
- package/lib/browser/util/link.d.ts +18 -0
- package/lib/browser/util/link.js +66 -1
- package/lib/browser/util/markdown.d.ts +4 -1
- package/lib/browser/util/markdown.js +1 -1
- package/lib/browser/util/message.d.ts +5 -0
- package/lib/browser/util/message.js +30 -0
- package/lib/browser/util/process.d.ts +57 -3
- package/lib/browser/util/process.js +125 -12
- package/lib/browser/util/progress.d.ts +19 -1
- package/lib/browser/util/progress.js +57 -4
- package/lib/browser/util/quote.d.ts +20 -0
- package/lib/browser/util/quote.js +61 -0
- package/lib/browser/util/tool.d.ts +19 -2
- package/lib/browser/util/tool.js +70 -2
- package/lib/browser/util/voice.d.ts +47 -7
- package/lib/browser/util/voice.js +269 -27
- package/lib/browser/workbench-calls.d.ts +6 -4
- package/lib/browser/workbench-calls.js +15 -10
- package/lib/browser/workbench-protocol.d.ts +31 -2
- package/lib/browser/workbench-util.d.ts +15 -4
- package/lib/browser/workbench-util.js +28 -5
- package/lib/browser/workbench.d.ts +33 -1
- package/lib/browser/workbench.js +140 -12
- package/package.json +11 -8
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { TaSettingsServer } from '@celljs/ta-protocol';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import type { TaFiles } from '../files/files-protocol';
|
|
4
|
+
import type { GameProps } from '../game/game-protocol';
|
|
5
|
+
import type { Game3DProps } from '../game/game3d-protocol';
|
|
6
|
+
import type { TaLinks } from '../links/links-protocol';
|
|
7
|
+
import type { TaNotices } from '../notices/notices-protocol';
|
|
8
|
+
import type { TaSessionNotices } from '../notices/session-notices';
|
|
9
|
+
import type { TaSettings } from '../settings/settings-protocol';
|
|
10
|
+
import type { TaState } from '../state/state-protocol';
|
|
11
|
+
import type { TaWorkbench } from '../workbench-protocol';
|
|
12
|
+
import type { WebEditorTabs } from './web-editor-tabs';
|
|
13
|
+
import type { CodeEditorProps, DiffEditorProps, WebComposerProps, WebExtensionAPI, WebExtensionUI, WebFolderPickerProps, WebHoldToTalkProps, WebModelPickerProps, WebStorage, WebViewInfo, WebVoice } from './web-extension-api';
|
|
14
|
+
import { type TaWebExtensions, type WebExtensionConversation, type WebSessionSwitcher } from './web-extension-protocol';
|
|
15
|
+
import { type WebExtensionRun } from './web-extension-run';
|
|
16
|
+
/** What the API of an extension asks of the page (TaWebExtensionsImpl), for the extension it is given to. */
|
|
17
|
+
export interface WebExtensionContextHost {
|
|
18
|
+
/** The page's own: its state, its pages and views, its extensions started on open, its packages. */
|
|
19
|
+
readonly extensions: TaWebExtensions;
|
|
20
|
+
readonly workbench: TaWorkbench;
|
|
21
|
+
readonly settings: TaSettings;
|
|
22
|
+
readonly files: TaFiles;
|
|
23
|
+
readonly notices: TaNotices;
|
|
24
|
+
readonly links: TaLinks;
|
|
25
|
+
readonly tabs: WebEditorTabs;
|
|
26
|
+
/** What conversations tell the user, for every extension. */
|
|
27
|
+
readonly sessionNotices: TaSessionNotices;
|
|
28
|
+
/** The state the page keeps (TaState): the pins of the lists. */
|
|
29
|
+
readonly persisted: TaState;
|
|
30
|
+
/** What the extensions registered changed: the page shows it. */
|
|
31
|
+
publish(): void;
|
|
32
|
+
/** Runs what the extension gave, its failure logged rather than thrown. */
|
|
33
|
+
guard(run: WebExtensionRun, action: () => void): void;
|
|
34
|
+
isShown(id: string): boolean;
|
|
35
|
+
subscribePages(listener: () => void): () => void;
|
|
36
|
+
/** The conversation shown, while there is one. */
|
|
37
|
+
conversation(): WebExtensionConversation | undefined;
|
|
38
|
+
switcher(): WebSessionSwitcher | undefined;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The API each web extension gets: what it registers is its own and goes when it stops, and once it stopped
|
|
42
|
+
* (turned off, removed, a timer of it left behind) it neither shows nor does anything more: its dialogs answer
|
|
43
|
+
* no, and what would act for the user (send a message, switch the conversation, open or reload packages) fails.
|
|
44
|
+
*/
|
|
45
|
+
export declare class WebExtensionContext {
|
|
46
|
+
protected readonly host: WebExtensionContextHost;
|
|
47
|
+
constructor(host: WebExtensionContextHost);
|
|
48
|
+
/** Monaco and the games in the theme and language of the settings, the same component for every extension. */
|
|
49
|
+
protected readonly codeEditor: (props: CodeEditorProps) => React.FunctionComponentElement<CodeEditorProps & {
|
|
50
|
+
settings: TaSettings;
|
|
51
|
+
}>;
|
|
52
|
+
protected readonly game: (props: GameProps) => React.FunctionComponentElement<GameProps & {
|
|
53
|
+
settings: TaSettings;
|
|
54
|
+
}>;
|
|
55
|
+
protected readonly game3d: (props: Game3DProps) => React.FunctionComponentElement<Game3DProps & {
|
|
56
|
+
settings: TaSettings;
|
|
57
|
+
}>;
|
|
58
|
+
protected readonly diffEditor: (props: DiffEditorProps) => React.FunctionComponentElement<DiffEditorProps & {
|
|
59
|
+
settings: TaSettings;
|
|
60
|
+
}>;
|
|
61
|
+
protected readonly listDirectory: (directory: string) => Promise<import("@celljs/ta-protocol").TaDirEntry[]>;
|
|
62
|
+
/** The message box, whose button of the directory lists those of the server. */
|
|
63
|
+
protected readonly composer: (props: WebComposerProps) => React.FunctionComponentElement<import("../components/web-composer").WebComposerHostProps>;
|
|
64
|
+
protected readonly holdToTalk: (props: WebHoldToTalkProps) => React.FunctionComponentElement<import("../components/hold-to-talk").HoldToTalkProps & {
|
|
65
|
+
notices: TaNotices;
|
|
66
|
+
}>;
|
|
67
|
+
protected readonly voice: WebVoice;
|
|
68
|
+
protected readonly modelPicker: (props: WebModelPickerProps) => React.FunctionComponentElement<WebModelPickerProps & {
|
|
69
|
+
settings: TaSettingsServer;
|
|
70
|
+
}>;
|
|
71
|
+
protected readonly folderPicker: ({ initial, onPick, onClose }: WebFolderPickerProps) => React.FunctionComponentElement<import("../components/folder-picker").FolderPickerProps>;
|
|
72
|
+
create(run: WebExtensionRun): WebExtensionAPI;
|
|
73
|
+
protected ui(run: WebExtensionRun, register: (change: () => void) => void): WebExtensionUI;
|
|
74
|
+
/** A React hook: the view of that id while one is loaded, and whether it is shown. */
|
|
75
|
+
protected useView(id: string): WebViewInfo | undefined;
|
|
76
|
+
/** The data of the package of an extension on the server; of a directory with `cwd`. */
|
|
77
|
+
protected storage(run: WebExtensionRun, cwd?: string): WebStorage;
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=web-extension-context.d.ts.map
|
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.WebExtensionContext = void 0;
|
|
37
|
+
const React = __importStar(require("react"));
|
|
38
|
+
const busy_1 = require("../components/busy");
|
|
39
|
+
const chat_list_1 = require("../components/chat-list");
|
|
40
|
+
const code_editor_1 = require("../components/code-editor");
|
|
41
|
+
const context_menu_1 = require("../components/context-menu");
|
|
42
|
+
const conversation_scroll_hooks_1 = require("../components/conversation-scroll-hooks");
|
|
43
|
+
const diff_editor_1 = require("../components/diff-editor");
|
|
44
|
+
const empty_state_1 = require("../components/empty-state");
|
|
45
|
+
const face_1 = require("../components/face");
|
|
46
|
+
const folder_picker_1 = require("../components/folder-picker");
|
|
47
|
+
const full_screen_1 = require("../components/full-screen");
|
|
48
|
+
const hold_to_talk_1 = require("../components/hold-to-talk");
|
|
49
|
+
const host_tag_1 = require("../components/host-tag");
|
|
50
|
+
const image_viewer_1 = require("../components/image-viewer");
|
|
51
|
+
const list_skeleton_1 = require("../components/list-skeleton");
|
|
52
|
+
const markdown_1 = require("../components/markdown");
|
|
53
|
+
const model_picker_1 = require("../components/model-picker");
|
|
54
|
+
const phone_shell_1 = require("../components/phone-shell");
|
|
55
|
+
const picture_1 = require("../components/picture");
|
|
56
|
+
const qr_view_1 = require("../components/qr-view");
|
|
57
|
+
const select_bar_1 = require("../components/select-bar");
|
|
58
|
+
const settings_controls_1 = require("../components/settings-controls");
|
|
59
|
+
const swipe_row_1 = require("../components/swipe-row");
|
|
60
|
+
const ta_avatar_1 = require("../components/ta-avatar");
|
|
61
|
+
const web_composer_1 = require("../components/web-composer");
|
|
62
|
+
const web_dialog_1 = require("../components/web-dialog");
|
|
63
|
+
const code_scan_1 = require("../device/code-scan");
|
|
64
|
+
const device_1 = require("../device/device");
|
|
65
|
+
const scanner_1 = require("../device/scanner");
|
|
66
|
+
const game_view_1 = require("../game/game-view");
|
|
67
|
+
const messages_1 = require("../i18n/messages");
|
|
68
|
+
const use_t_1 = require("../i18n/use-t");
|
|
69
|
+
const web_terminal_1 = require("../terminal/web-terminal");
|
|
70
|
+
const desktop_1 = require("../util/desktop");
|
|
71
|
+
const file_drag_1 = require("../util/file-drag");
|
|
72
|
+
const voice_1 = require("../util/voice");
|
|
73
|
+
const icons_1 = require("./icons");
|
|
74
|
+
const web_extension_protocol_1 = require("./web-extension-protocol");
|
|
75
|
+
const web_extension_run_1 = require("./web-extension-run");
|
|
76
|
+
const web_tasks_1 = require("./web-tasks");
|
|
77
|
+
const FILE_DRAG = Object.freeze({ set: file_drag_1.FileDragUtil.set, has: file_drag_1.FileDragUtil.has, get: file_drag_1.FileDragUtil.get, paths: file_drag_1.FileDragUtil.paths });
|
|
78
|
+
/**
|
|
79
|
+
* The API each web extension gets: what it registers is its own and goes when it stops, and once it stopped
|
|
80
|
+
* (turned off, removed, a timer of it left behind) it neither shows nor does anything more: its dialogs answer
|
|
81
|
+
* no, and what would act for the user (send a message, switch the conversation, open or reload packages) fails.
|
|
82
|
+
*/
|
|
83
|
+
class WebExtensionContext {
|
|
84
|
+
constructor(host) {
|
|
85
|
+
this.host = host;
|
|
86
|
+
/** Monaco and the games in the theme and language of the settings, the same component for every extension. */
|
|
87
|
+
this.codeEditor = (props) => React.createElement(code_editor_1.CodeEditor, { ...props, settings: this.host.settings });
|
|
88
|
+
this.game = (props) => React.createElement(game_view_1.GameView, { ...props, settings: this.host.settings });
|
|
89
|
+
this.game3d = (props) => React.createElement(game_view_1.Game3DView, { ...props, settings: this.host.settings });
|
|
90
|
+
this.diffEditor = (props) => React.createElement(diff_editor_1.DiffEditor, { ...props, settings: this.host.settings });
|
|
91
|
+
this.listDirectory = (directory) => this.host.workbench.workspace.listDirectory('.', directory);
|
|
92
|
+
/** The message box, whose button of the directory lists those of the server. */
|
|
93
|
+
this.composer = (props) => { var _a; return React.createElement(web_composer_1.WebComposer, {
|
|
94
|
+
...props,
|
|
95
|
+
notices: this.host.notices,
|
|
96
|
+
server: this.host.workbench.server,
|
|
97
|
+
listDirectory: this.listDirectory,
|
|
98
|
+
serverCwd: (_a = this.host.workbench.state.server) === null || _a === void 0 ? void 0 : _a.cwd,
|
|
99
|
+
remote: this.host.workbench,
|
|
100
|
+
}); };
|
|
101
|
+
this.holdToTalk = (props) => React.createElement(hold_to_talk_1.HoldToTalk, { ...props, notices: this.host.notices });
|
|
102
|
+
this.voice = {
|
|
103
|
+
canListen: () => voice_1.Voice.canListen(),
|
|
104
|
+
canSpeak: () => voice_1.Voice.canSpeak(),
|
|
105
|
+
speak: (text, onEnd) => voice_1.Voice.speak(text, this.host.settings.state.language, onEnd !== null && onEnd !== void 0 ? onEnd : (() => undefined), this.host.settings.state.settings.voice),
|
|
106
|
+
hush: () => voice_1.Voice.hush(),
|
|
107
|
+
};
|
|
108
|
+
this.modelPicker = (props) => React.createElement(model_picker_1.SettingsModelPicker, { ...props, settings: this.host.workbench.settings });
|
|
109
|
+
this.folderPicker = ({ initial, onPick, onClose }) => { var _a; return React.createElement(folder_picker_1.FolderPicker, {
|
|
110
|
+
list: this.listDirectory,
|
|
111
|
+
initial: initial || ((_a = this.host.workbench.state.server) === null || _a === void 0 ? void 0 : _a.cwd) || '.',
|
|
112
|
+
remote: this.host.workbench,
|
|
113
|
+
onPick: async (path) => onPick(path),
|
|
114
|
+
onClose,
|
|
115
|
+
}); };
|
|
116
|
+
}
|
|
117
|
+
create(run) {
|
|
118
|
+
const { host } = this;
|
|
119
|
+
const { workbench, files } = host;
|
|
120
|
+
const register = (change) => {
|
|
121
|
+
if (!run.stopped) {
|
|
122
|
+
change();
|
|
123
|
+
if (run.started) {
|
|
124
|
+
host.publish();
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
/** What acts for the user: refused once the extension stopped. */
|
|
129
|
+
const live = (action) => run.stopped ? Promise.reject(new Error(`The web extension ${run.loaded.name} has stopped.`)) : action();
|
|
130
|
+
return {
|
|
131
|
+
React,
|
|
132
|
+
get server() {
|
|
133
|
+
return workbench.server;
|
|
134
|
+
},
|
|
135
|
+
get workspace() {
|
|
136
|
+
return workbench.workspace;
|
|
137
|
+
},
|
|
138
|
+
get terminals() {
|
|
139
|
+
return workbench.terminals;
|
|
140
|
+
},
|
|
141
|
+
get packages() {
|
|
142
|
+
return workbench.packages;
|
|
143
|
+
},
|
|
144
|
+
get files() {
|
|
145
|
+
return files;
|
|
146
|
+
},
|
|
147
|
+
get remote() {
|
|
148
|
+
return workbench.remote;
|
|
149
|
+
},
|
|
150
|
+
get settings() {
|
|
151
|
+
return workbench.settings;
|
|
152
|
+
},
|
|
153
|
+
get rooms() {
|
|
154
|
+
return workbench.rooms;
|
|
155
|
+
},
|
|
156
|
+
onRoomEvent: (listener, options) => web_extension_run_1.WebExtensionRunUtil.track(run, () => workbench.onRoomEvent(event => host.guard(run, () => listener(event)), options)),
|
|
157
|
+
ui: this.ui(run, register),
|
|
158
|
+
onTerminalData: listener => web_extension_run_1.WebExtensionRunUtil.track(run, () => workbench.onTerminalData((terminalId, data, exitCode) => host.guard(run, () => listener(terminalId, data, exitCode)))),
|
|
159
|
+
storage: { ...this.storage(run), directory: cwd => this.storage(run, cwd) },
|
|
160
|
+
registerView: (name, view) => register(() => run.views.set(name, view)),
|
|
161
|
+
registerMessageRenderer: (customType, renderer) => register(() => run.renderers.set(customType, renderer)),
|
|
162
|
+
registerCodeRenderer: (language, renderer) => register(() => run.codeRenderers.set(language.trim().toLowerCase(), renderer)),
|
|
163
|
+
registerAvatar: avatar => register(() => {
|
|
164
|
+
run.avatar = avatar;
|
|
165
|
+
}),
|
|
166
|
+
registerChatIcon: source => register(() => run.chatIcons.push(source)),
|
|
167
|
+
registerTool: tool => register(() => run.tools.push(tool)),
|
|
168
|
+
registerToolRenderer: resolver => register(() => run.toolRenderers.push(resolver)),
|
|
169
|
+
registerTasks: source => register(() => run.taskSources.push(source)),
|
|
170
|
+
registerHomeItems: source => register(() => run.homeSources.push(source)),
|
|
171
|
+
registerSearch: source => register(() => run.searches.push(source)),
|
|
172
|
+
registerComposerAddon: addon => register(() => run.composerAddons.push(addon)),
|
|
173
|
+
registerSettings: section => register(() => run.settingsSections.push(section)),
|
|
174
|
+
registerSessionMenu: menu => register(() => run.sessionMenus.push(session => {
|
|
175
|
+
try {
|
|
176
|
+
return run.stopped ? [] : menu(session);
|
|
177
|
+
}
|
|
178
|
+
catch (error) {
|
|
179
|
+
console.error(`The web extension ${run.loaded.name} failed:`, error);
|
|
180
|
+
return [];
|
|
181
|
+
}
|
|
182
|
+
})),
|
|
183
|
+
registerOpener: (opener, options) => register(() => ((options === null || options === void 0 ? void 0 : options.specific) ? run.specificOpeners : run.openers).push(async (link) => {
|
|
184
|
+
// An opener that fails, or of an extension that stopped, leaves the link to the next one.
|
|
185
|
+
try {
|
|
186
|
+
return !run.stopped && (await opener(link)) === true;
|
|
187
|
+
}
|
|
188
|
+
catch (error) {
|
|
189
|
+
console.error(`The web extension ${run.loaded.name} failed:`, error);
|
|
190
|
+
return false;
|
|
191
|
+
}
|
|
192
|
+
})),
|
|
193
|
+
on: (type, handler) => register(() => run.handlers.push({ type, handler: handler })),
|
|
194
|
+
sendUserMessage: text => live(async () => {
|
|
195
|
+
var _a;
|
|
196
|
+
const send = (_a = host.conversation()) === null || _a === void 0 ? void 0 : _a.send;
|
|
197
|
+
if (!send) {
|
|
198
|
+
throw new Error('No conversation is shown yet.');
|
|
199
|
+
}
|
|
200
|
+
await send(text);
|
|
201
|
+
}),
|
|
202
|
+
switchSession: (session, opening) => live(async () => {
|
|
203
|
+
const switcher = host.switcher();
|
|
204
|
+
if (!switcher) {
|
|
205
|
+
throw new Error('The page cannot show another conversation yet.');
|
|
206
|
+
}
|
|
207
|
+
const shown = switcher(session, opening);
|
|
208
|
+
host.extensions.showPage('');
|
|
209
|
+
await shown;
|
|
210
|
+
}),
|
|
211
|
+
openChat: sessionFile => live(() => host.links.openConversation(sessionFile)),
|
|
212
|
+
openTemporary: (source, from) => live(() => host.extensions.openTemporary(source, from)),
|
|
213
|
+
callHost: (method, ...params) => live(() => workbench.packages.callPackageHost(run.loaded.name, method, params)),
|
|
214
|
+
reloadExtensions: () => live(() => host.extensions.reloadPackages()),
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
ui(run, register) {
|
|
218
|
+
const { host } = this;
|
|
219
|
+
const { workbench, settings, notices } = host;
|
|
220
|
+
const subscribe = (listener) => host.extensions.subscribe(listener);
|
|
221
|
+
return {
|
|
222
|
+
setWidget: (key, component, options = {}) => register(() => (component ? run.widgets.set(key, { component, options }) : run.widgets.delete(key))),
|
|
223
|
+
notify: (message, type = 'info') => {
|
|
224
|
+
if (!run.stopped) {
|
|
225
|
+
notices.notify(message, { level: type });
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
notifySession: notice => {
|
|
229
|
+
if (!run.stopped) {
|
|
230
|
+
host.sessionNotices.notify(notice);
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
pinChat: (sessionFile, pinned = true) => {
|
|
234
|
+
if (run.stopped || typeof sessionFile !== 'string' || !sessionFile) {
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
const list = host.persisted.get(chat_list_1.PINNED).filter(file => file !== sessionFile);
|
|
238
|
+
host.persisted.set(chat_list_1.PINNED, pinned ? [sessionFile, ...list] : list);
|
|
239
|
+
},
|
|
240
|
+
confirm: (title, message, options) => (run.stopped ? Promise.resolve(false) : notices.confirm({ title, message, ...options })),
|
|
241
|
+
input: (title, placeholder, options) => (run.stopped ? Promise.resolve(undefined) : notices.input({ title, placeholder, value: options === null || options === void 0 ? void 0 : options.value })),
|
|
242
|
+
editor: (title, prefill) => (run.stopped ? Promise.resolve(undefined) : notices.input({ title, value: prefill, multiline: true })),
|
|
243
|
+
get theme() {
|
|
244
|
+
return settings.state.theme;
|
|
245
|
+
},
|
|
246
|
+
get language() {
|
|
247
|
+
return settings.state.language;
|
|
248
|
+
},
|
|
249
|
+
supportsWebview: desktop_1.DesktopUtil.has('webview'),
|
|
250
|
+
desktop: desktop_1.DesktopUtil.fileManager(),
|
|
251
|
+
fileDrag: FILE_DRAG,
|
|
252
|
+
debugWebview: desktop_1.DesktopUtil.debugWebview(),
|
|
253
|
+
// An extension opens, closes and marks only tabs of its own.
|
|
254
|
+
openEditor: (editor, options) => !run.stopped && host.tabs.open({ ...editor, extension: run.loaded.id, preview: (options === null || options === void 0 ? void 0 : options.preview) === true }, (options === null || options === void 0 ? void 0 : options.preserveFocus) === true),
|
|
255
|
+
closeEditor: id => host.tabs.remove(editor => editor.id === id && editor.extension === run.loaded.id),
|
|
256
|
+
pinEditor: id => host.tabs.pin(id, run.loaded.id),
|
|
257
|
+
setEditorDirty: (id, dirty) => host.tabs.setDirty(run.loaded.id, id, dirty),
|
|
258
|
+
useActiveEditor: () => {
|
|
259
|
+
const active = () => host.extensions.state.activeEditor;
|
|
260
|
+
return React.useSyncExternalStore(subscribe, active, active);
|
|
261
|
+
},
|
|
262
|
+
useCwd: () => {
|
|
263
|
+
var _a;
|
|
264
|
+
// The conversation's while it is in front; with a page, the settings or nothing in front, the default directory.
|
|
265
|
+
const shown = () => web_extension_protocol_1.WebCwdUtil.shown(host.extensions.state);
|
|
266
|
+
const cwd = React.useSyncExternalStore(subscribe, shown, shown);
|
|
267
|
+
const server = () => { var _a; return (_a = workbench.state.server) === null || _a === void 0 ? void 0 : _a.cwd; };
|
|
268
|
+
const fallback = React.useSyncExternalStore(listener => workbench.subscribe(listener), server, server);
|
|
269
|
+
return (_a = cwd !== null && cwd !== void 0 ? cwd : fallback) !== null && _a !== void 0 ? _a : '.';
|
|
270
|
+
},
|
|
271
|
+
useSessionId: () => React.useSyncExternalStore(subscribe, () => host.extensions.state.sessionId),
|
|
272
|
+
useSessions: () => {
|
|
273
|
+
const sessions = () => workbench.state.sessions;
|
|
274
|
+
return React.useSyncExternalStore(listener => workbench.subscribe(listener), sessions, sessions);
|
|
275
|
+
},
|
|
276
|
+
useSavedSessions: () => {
|
|
277
|
+
const saved = () => workbench.state.saved;
|
|
278
|
+
return React.useSyncExternalStore(listener => workbench.subscribe(listener), saved, saved);
|
|
279
|
+
},
|
|
280
|
+
useDevice: device_1.useDevice,
|
|
281
|
+
showView: id => (run.stopped ? Promise.resolve(false) : host.extensions.showView(id)),
|
|
282
|
+
usePages: () => {
|
|
283
|
+
// Read again when the device or the navigation changes where a page is.
|
|
284
|
+
(0, device_1.useDevice)(device => device.handheld);
|
|
285
|
+
return React.useSyncExternalStore(host.subscribePages, () => host.extensions.pages());
|
|
286
|
+
},
|
|
287
|
+
useContextMenu: () => {
|
|
288
|
+
const [menu, open] = (0, context_menu_1.useContextMenu)();
|
|
289
|
+
const openSections = React.useCallback((event, sections) => open(event, sections
|
|
290
|
+
.filter(section => section.length > 0)
|
|
291
|
+
.flatMap((section, index) => [...(index > 0 ? ['-'] : []), ...section])), [open]);
|
|
292
|
+
return [menu, openSections];
|
|
293
|
+
},
|
|
294
|
+
attachMenu: context_menu_1.ContextMenuUtil.attach,
|
|
295
|
+
scanCode: scanner_1.Scanner.available() ? instructions => scanner_1.Scanner.scan(instructions, (0, messages_1.message)(settings.state.language, 'ta.cancel')) : undefined,
|
|
296
|
+
scan: code_scan_1.CodeScan.available() ? () => (run.stopped ? Promise.resolve() : new code_scan_1.CodeScan(host).scan()) : undefined,
|
|
297
|
+
stopExtension: name => !run.stopped && host.extensions.stopExtension(name),
|
|
298
|
+
shareExtension: target => !run.stopped && host.extensions.share(target),
|
|
299
|
+
custom: component => web_extension_run_1.WebExtensionRunUtil.track(run, () => host.extensions.showCustom(run.loaded.name, component)),
|
|
300
|
+
openShared: text => (run.stopped ? Promise.resolve(false) : host.extensions.openShared(text)),
|
|
301
|
+
forgetPage: id => !run.stopped && host.extensions.forgetPage(id),
|
|
302
|
+
useTasks: () => React.useSyncExternalStore(host.extensions.tasks.subscribe, host.extensions.tasks.tasks, host.extensions.tasks.tasks),
|
|
303
|
+
useHomeItems: () => React.useSyncExternalStore(host.extensions.home.subscribe, host.extensions.home.items, host.extensions.home.items),
|
|
304
|
+
removeTasks: tasks => (run.stopped ? Promise.resolve(false) : web_tasks_1.WebTaskUtil.remove(tasks, notices, (0, use_t_1.translator)(settings.state.language))),
|
|
305
|
+
useView: id => this.useView(id),
|
|
306
|
+
Avatar: ta_avatar_1.TaAvatar,
|
|
307
|
+
icons: icons_1.WEB_ICONS,
|
|
308
|
+
CodeEditor: this.codeEditor,
|
|
309
|
+
DiffEditor: this.diffEditor,
|
|
310
|
+
// Ends with the extension.
|
|
311
|
+
createTerminal: (options) => {
|
|
312
|
+
const terminal = new web_terminal_1.DefaultWebTerminal(settings, (target, open) => void host.links.open(target, open), options);
|
|
313
|
+
run.unsubscribes.push(() => terminal.dispose());
|
|
314
|
+
return terminal;
|
|
315
|
+
},
|
|
316
|
+
Game: this.game,
|
|
317
|
+
Game3D: this.game3d,
|
|
318
|
+
FullScreen: full_screen_1.FullScreen,
|
|
319
|
+
Stack: phone_shell_1.PhoneStack,
|
|
320
|
+
Face: face_1.Face,
|
|
321
|
+
GroupFace: face_1.GroupFace,
|
|
322
|
+
Composer: this.composer,
|
|
323
|
+
HoldToTalk: this.holdToTalk,
|
|
324
|
+
voice: this.voice,
|
|
325
|
+
Markdown: markdown_1.Markdown,
|
|
326
|
+
useChatScroll: (sent, key) => (0, conversation_scroll_hooks_1.useConversationScroll)(sent, { sentTo: 'bottom', key }),
|
|
327
|
+
Empty: empty_state_1.EmptyState,
|
|
328
|
+
Skeleton: list_skeleton_1.ListSkeleton,
|
|
329
|
+
useBusy: busy_1.useBusy,
|
|
330
|
+
Switch: settings_controls_1.Switch,
|
|
331
|
+
HostTag: host_tag_1.HostTag,
|
|
332
|
+
SwipeRow: swipe_row_1.SwipeRow,
|
|
333
|
+
SelectCheck: select_bar_1.SelectCheck,
|
|
334
|
+
SelectBar: select_bar_1.SelectBar,
|
|
335
|
+
Picture: picture_1.Picture,
|
|
336
|
+
PictureCards: picture_1.PictureCards,
|
|
337
|
+
ImageViewer: image_viewer_1.ImageViewer,
|
|
338
|
+
QrCode: qr_view_1.QrView,
|
|
339
|
+
Dialog: web_dialog_1.WebDialog,
|
|
340
|
+
FolderPicker: this.folderPicker,
|
|
341
|
+
ModelPicker: this.modelPicker,
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
/** A React hook: the view of that id while one is loaded, and whether it is shown. */
|
|
345
|
+
useView(id) {
|
|
346
|
+
const { host } = this;
|
|
347
|
+
const subscribe = (listener) => host.extensions.subscribe(listener);
|
|
348
|
+
const find = () => host.extensions.state.views.find(candidate => candidate.id === id);
|
|
349
|
+
const isShown = () => host.isShown(id);
|
|
350
|
+
const view = React.useSyncExternalStore(subscribe, find, find);
|
|
351
|
+
const shown = React.useSyncExternalStore(subscribe, isShown, isShown);
|
|
352
|
+
// The title is read again in another language: a string, so that the same words stay the same value.
|
|
353
|
+
const title = view ? web_extension_protocol_1.WebLabelUtil.text(view.title) : undefined;
|
|
354
|
+
// The preview as one string, so that the same line stays the same value.
|
|
355
|
+
const watch = React.useCallback((listener) => { var _a; var _b; return (_b = (_a = view === null || view === void 0 ? void 0 : view.subscribePreview) === null || _a === void 0 ? void 0 : _a.call(view, listener)) !== null && _b !== void 0 ? _b : (() => undefined); }, [view]);
|
|
356
|
+
const read = () => {
|
|
357
|
+
var _a;
|
|
358
|
+
const preview = (_a = view === null || view === void 0 ? void 0 : view.preview) === null || _a === void 0 ? void 0 : _a.call(view);
|
|
359
|
+
return preview ? `${preview.at}\n${preview.text}` : '';
|
|
360
|
+
};
|
|
361
|
+
const line = React.useSyncExternalStore(watch, read, read);
|
|
362
|
+
const isBusy = () => { var _a; return !!((_a = view === null || view === void 0 ? void 0 : view.busy) === null || _a === void 0 ? void 0 : _a.call(view)); };
|
|
363
|
+
const busy = React.useSyncExternalStore(watch, isBusy, isBusy);
|
|
364
|
+
return React.useMemo(() => {
|
|
365
|
+
if (!view || title === undefined) {
|
|
366
|
+
return undefined;
|
|
367
|
+
}
|
|
368
|
+
const cut = line.indexOf('\n');
|
|
369
|
+
const preview = line ? { at: Number(line.slice(0, cut)), text: line.slice(cut + 1) } : undefined;
|
|
370
|
+
return { title, location: view.location, shown, menu: view.menu, preview, busy, send: view.send };
|
|
371
|
+
}, [view, title, shown, line, busy]);
|
|
372
|
+
}
|
|
373
|
+
/** The data of the package of an extension on the server; of a directory with `cwd`. */
|
|
374
|
+
storage(run, cwd) {
|
|
375
|
+
const { host } = this;
|
|
376
|
+
const { workbench } = host;
|
|
377
|
+
const { name } = run.loaded;
|
|
378
|
+
return {
|
|
379
|
+
// JSON has no undefined: none comes as null.
|
|
380
|
+
get: async (key) => { var _a; return ((_a = (await workbench.packages.getExtensionData(name, key, cwd))) !== null && _a !== void 0 ? _a : undefined); },
|
|
381
|
+
set: (key, value) => workbench.packages.setExtensionData(name, key, value, cwd),
|
|
382
|
+
onChange: listener => web_extension_run_1.WebExtensionRunUtil.track(run, () => workbench.onExtensionData((changed, keys, directory) => {
|
|
383
|
+
if (changed === name && directory === cwd) {
|
|
384
|
+
host.guard(run, () => listener(keys));
|
|
385
|
+
}
|
|
386
|
+
})),
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
exports.WebExtensionContext = WebExtensionContext;
|
|
391
|
+
//# sourceMappingURL=web-extension-context.js.map
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { TaEvent, TaTemporaryFrom, TaWebExtensionInfo } from '@celljs/ta-protocol';
|
|
2
2
|
import type * as React from 'react';
|
|
3
3
|
import type { MessageId } from '../i18n/messages';
|
|
4
|
-
import type { WebAvatarProps, WebComposerAddon, WebCustomMessage, WebEditor, WebExtensionFactory, WebIcon, WebLabel, WebMenuItem, WebOpener, WebSearchSource, WebSessionOpening, WebSettingsSection, WebShareTarget, WebTool, WebViewPreview, WidgetOptions } from './web-extension-api';
|
|
4
|
+
import type { WebAvatarProps, WebChatIconSource, WebCodeRendererProps, WebComposerAddon, WebCustomMessage, WebEditor, WebExtensionFactory, WebIcon, WebImage, WebLabel, WebMenuItem, WebOpener, WebSearchSource, WebSessionMenu, WebSessionOpening, WebSettingsSection, WebShareTarget, WebTool, WebToolRendererResolver, WebViewLocation, WebViewPreview, WidgetOptions } from './web-extension-api';
|
|
5
|
+
import type { WebHomeBoard } from './web-home';
|
|
5
6
|
import type { PageUsage, WebPageInfo } from './web-pages';
|
|
6
7
|
import type { WebTaskBoard } from './web-tasks';
|
|
7
8
|
export declare const TaWebExtensions: unique symbol;
|
|
@@ -63,11 +64,11 @@ export interface WebViewEntry {
|
|
|
63
64
|
preview?(): WebViewPreview | undefined;
|
|
64
65
|
busy?(): boolean;
|
|
65
66
|
subscribePreview?(listener: () => void): () => void;
|
|
67
|
+
send?(text: string, images?: WebImage[]): Promise<void>;
|
|
66
68
|
/** Kept from before (WebViewUtil.placeholders): its place, until its extension registers it again. */
|
|
67
69
|
pending?: boolean;
|
|
68
70
|
}
|
|
69
|
-
|
|
70
|
-
export type WebViewLocation = 'page' | 'sidebar' | 'panel' | 'launcher' | 'board';
|
|
71
|
+
export type { WebViewLocation } from './web-extension-api';
|
|
71
72
|
/** An extension started on open (`activation: 'open'`), running or not. */
|
|
72
73
|
export interface OnOpenExtension {
|
|
73
74
|
info: TaWebExtensionInfo;
|
|
@@ -90,6 +91,11 @@ export interface WorkbenchTabs {
|
|
|
90
91
|
/** The tab shown: a view's, or one an extension opens again itself (a file). */
|
|
91
92
|
active?: string;
|
|
92
93
|
}
|
|
94
|
+
export interface WebChatIconEntry {
|
|
95
|
+
/** The name of the extension's package: the default tint. */
|
|
96
|
+
extension: string;
|
|
97
|
+
source: WebChatIconSource;
|
|
98
|
+
}
|
|
93
99
|
export interface WebExtensionsState {
|
|
94
100
|
extensions: LoadedWebExtension[];
|
|
95
101
|
views: WebViewEntry[];
|
|
@@ -101,12 +107,22 @@ export interface WebExtensionsState {
|
|
|
101
107
|
renderers: Record<string, React.ComponentType<{
|
|
102
108
|
message: WebCustomMessage;
|
|
103
109
|
}>>;
|
|
110
|
+
/** By language, in lower case: the first registered (WebExtensionAPI.registerCodeRenderer). */
|
|
111
|
+
codeRenderers: Record<string, React.ComponentType<WebCodeRendererProps>>;
|
|
104
112
|
/** By the name of the extension, the group of the sessions it draws (WebExtensionAPI.registerAvatar). */
|
|
105
113
|
avatars: Record<string, React.ComponentType<WebAvatarProps>>;
|
|
114
|
+
/** The icons extensions give conversations of theirs (WebExtensionAPI.registerChatIcon), with the extension of each. */
|
|
115
|
+
chatIcons: WebChatIconEntry[];
|
|
106
116
|
/** The first tool of each name. */
|
|
107
117
|
tools: WebTool[];
|
|
108
|
-
/**
|
|
118
|
+
/** How calls of tools read (WebExtensionAPI.registerToolRenderer), in the order the extensions loaded. */
|
|
119
|
+
toolRenderers: WebToolRendererResolver[];
|
|
120
|
+
/** Those of links (WebExtensionAPI.registerOpener), the specific ones first, each in the order the extensions registered them. */
|
|
109
121
|
openers: WebOpener[];
|
|
122
|
+
/** Those of some links only (WebOpenerOptions.specific): asked also for a link that goes out of Ta. */
|
|
123
|
+
specificOpeners: WebOpener[];
|
|
124
|
+
/** Entries of the menu of a conversation of a list (WebExtensionAPI.registerSessionMenu). */
|
|
125
|
+
sessionMenus: WebSessionMenu[];
|
|
110
126
|
/** The tabs of the editor area (the workbench), in the order they opened. */
|
|
111
127
|
editors: WebEditorEntry[];
|
|
112
128
|
activeEditor?: string;
|
|
@@ -121,6 +137,11 @@ export interface WebExtensionsState {
|
|
|
121
137
|
conversationShown: boolean;
|
|
122
138
|
/** The session of the conversation shown. */
|
|
123
139
|
sessionId?: string;
|
|
140
|
+
/**
|
|
141
|
+
* The list of the computer's extensions was asked for once, answered or not: before, the views of a first
|
|
142
|
+
* start (nothing kept, WebViewUtil.KEPT) are still on their way.
|
|
143
|
+
*/
|
|
144
|
+
loaded: boolean;
|
|
124
145
|
/** The view of the page shown in the main area; `''` for the conversation. */
|
|
125
146
|
page: string;
|
|
126
147
|
/** Counts the pages shown, the same one again too: on a phone a page shown comes to the front. */
|
|
@@ -137,6 +158,20 @@ export interface WebExtensionsState {
|
|
|
137
158
|
searches: WebSearchSource[];
|
|
138
159
|
/** An extension handed on: its dialog shows (WebExtensionUI.shareExtension). */
|
|
139
160
|
sharing?: WebShareTarget;
|
|
161
|
+
/** What extensions show over the page (WebExtensionUI.custom), the last on top. */
|
|
162
|
+
customs: WebCustomEntry[];
|
|
163
|
+
}
|
|
164
|
+
export interface WebCustomEntry {
|
|
165
|
+
id: number;
|
|
166
|
+
/** The name of the extension. */
|
|
167
|
+
extension: string;
|
|
168
|
+
component: React.ComponentType<{
|
|
169
|
+
close(): void;
|
|
170
|
+
}>;
|
|
171
|
+
}
|
|
172
|
+
export declare namespace WebExtensionsStateUtil {
|
|
173
|
+
/** Before any extension ran. */
|
|
174
|
+
function empty(): WebExtensionsState;
|
|
140
175
|
}
|
|
141
176
|
export declare namespace WebCwdUtil {
|
|
142
177
|
/** The directory of the conversation while it is in front; else none, and the workbench is in the default directory. */
|
|
@@ -147,7 +182,14 @@ export declare namespace WebLabelUtil {
|
|
|
147
182
|
}
|
|
148
183
|
/** What `on` and `sendUserMessage` of web extensions reach: the conversation shown. */
|
|
149
184
|
/** Shows a session as the conversation: `switchSession` of web extensions. */
|
|
150
|
-
|
|
185
|
+
/**
|
|
186
|
+
* What the page shows as the conversation: an open session by its id, one still opening by the promise of its id, or the
|
|
187
|
+
* conversation of a session file, opened as the lists open it (at once from what the page or the device has).
|
|
188
|
+
*/
|
|
189
|
+
export type WebSessionTarget = string | Promise<string> | {
|
|
190
|
+
sessionFile: string;
|
|
191
|
+
};
|
|
192
|
+
export type WebSessionSwitcher = (session: WebSessionTarget, opening?: WebSessionOpening) => Promise<void>;
|
|
151
193
|
export interface WebExtensionConversation {
|
|
152
194
|
/** None for a new conversation, which opens with its first message. */
|
|
153
195
|
send?(text: string): Promise<void>;
|
|
@@ -165,14 +207,14 @@ export interface TaWebExtensions {
|
|
|
165
207
|
readonly state: WebExtensionsState;
|
|
166
208
|
/** The tasks of every extension (WebExtensionAPI.registerTasks), the double's too. */
|
|
167
209
|
readonly tasks: WebTaskBoard;
|
|
210
|
+
/** The rows of the double's home of every extension (registerHomeItems). */
|
|
211
|
+
readonly home: WebHomeBoard;
|
|
168
212
|
readonly builtins: readonly BuiltinWebExtension[];
|
|
169
213
|
subscribe(listener: (state: WebExtensionsState) => void): () => void;
|
|
170
214
|
/** Loads what is new, unloads what is gone or off, and loads again what changed. True when anything did. */
|
|
171
215
|
refresh(): Promise<boolean>;
|
|
172
216
|
/** After packages changed: {@link refresh}, then the pi extensions, skills and prompts of the conversation shown. */
|
|
173
217
|
reloadPackages(): Promise<void>;
|
|
174
|
-
/** Removes the package of a web extension from the server. */
|
|
175
|
-
remove(id: string): Promise<void>;
|
|
176
218
|
/** Shows an open tab of the editor area. */
|
|
177
219
|
showEditor(id: string): void;
|
|
178
220
|
/** Opens a `panel` view as a tab of the editor area, or shows its tab. */
|
|
@@ -194,6 +236,12 @@ export interface TaWebExtensions {
|
|
|
194
236
|
forgetPage(id: string): void;
|
|
195
237
|
/** Shows the dialog that hands an extension on; `undefined` closes it. */
|
|
196
238
|
share(target: WebShareTarget | undefined): void;
|
|
239
|
+
/** What `ui.custom` does: shows it over the page; the function returned takes it away. */
|
|
240
|
+
showCustom(extension: string, component: React.ComponentType<{
|
|
241
|
+
close(): void;
|
|
242
|
+
}>): () => void;
|
|
243
|
+
/** Takes away what `ui.custom` shows. */
|
|
244
|
+
closeCustom(id: number): void;
|
|
197
245
|
/** What `ui.openShared` does. */
|
|
198
246
|
openShared(text: string): Promise<boolean>;
|
|
199
247
|
/** Opens a package without installing it, loads the web extensions again and shows its first page (WebExtensionAPI.openTemporary). */
|
|
@@ -217,5 +265,7 @@ export interface TaWebExtensions {
|
|
|
217
265
|
emit(event: TaEvent): void;
|
|
218
266
|
/** What `switchSession` of web extensions does: the page shows that session; `undefined` until it can. */
|
|
219
267
|
setSessionSwitcher(switcher: WebSessionSwitcher | undefined): void;
|
|
268
|
+
/** How the page shows a session as the conversation, once it said (setSessionSwitcher). */
|
|
269
|
+
sessionSwitcher(): WebSessionSwitcher | undefined;
|
|
220
270
|
}
|
|
221
271
|
//# sourceMappingURL=web-extension-protocol.d.ts.map
|
|
@@ -1,8 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WebLabelUtil = exports.WebCwdUtil = exports.BuiltinWebExtension = exports.TaWebExtensions = void 0;
|
|
3
|
+
exports.WebLabelUtil = exports.WebCwdUtil = exports.WebExtensionsStateUtil = exports.BuiltinWebExtension = exports.TaWebExtensions = void 0;
|
|
4
4
|
exports.TaWebExtensions = Symbol('TaWebExtensions');
|
|
5
5
|
exports.BuiltinWebExtension = Symbol('BuiltinWebExtension');
|
|
6
|
+
var WebExtensionsStateUtil;
|
|
7
|
+
(function (WebExtensionsStateUtil) {
|
|
8
|
+
/** Before any extension ran. */
|
|
9
|
+
function empty() {
|
|
10
|
+
return {
|
|
11
|
+
extensions: [],
|
|
12
|
+
views: [],
|
|
13
|
+
widgets: [],
|
|
14
|
+
composerAddons: [],
|
|
15
|
+
settingsSections: [],
|
|
16
|
+
renderers: {},
|
|
17
|
+
codeRenderers: {},
|
|
18
|
+
avatars: {},
|
|
19
|
+
chatIcons: [],
|
|
20
|
+
tools: [],
|
|
21
|
+
toolRenderers: [],
|
|
22
|
+
openers: [],
|
|
23
|
+
specificOpeners: [],
|
|
24
|
+
sessionMenus: [],
|
|
25
|
+
customs: [],
|
|
26
|
+
editors: [],
|
|
27
|
+
focus: 0,
|
|
28
|
+
loaded: false,
|
|
29
|
+
page: '',
|
|
30
|
+
pageShown: 0,
|
|
31
|
+
conversationShown: true,
|
|
32
|
+
onOpen: [],
|
|
33
|
+
kept: [],
|
|
34
|
+
usage: {},
|
|
35
|
+
searches: [],
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
WebExtensionsStateUtil.empty = empty;
|
|
39
|
+
})(WebExtensionsStateUtil || (exports.WebExtensionsStateUtil = WebExtensionsStateUtil = {}));
|
|
6
40
|
var WebCwdUtil;
|
|
7
41
|
(function (WebCwdUtil) {
|
|
8
42
|
/** The directory of the conversation while it is in front; else none, and the workbench is in the default directory. */
|