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