@celljs/ta-web 4.9.1 → 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 +8 -7
- package/README.md +8 -7
- package/esm/browser/assistant/assistant-chat-list.d.ts +11 -0
- package/esm/browser/assistant/assistant-chat-list.js +20 -2
- package/esm/browser/assistant/assistant-extension.d.ts +8 -1
- package/esm/browser/assistant/assistant-extension.js +25 -0
- package/esm/browser/assistant/assistant-protocol.d.ts +5 -2
- 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 +14 -2
- package/esm/browser/assistant/assistant-task-util.js +62 -13
- package/esm/browser/assistant/assistant-view.js +117 -71
- package/esm/browser/assistant/assistant.d.ts +28 -5
- package/esm/browser/assistant/assistant.js +96 -22
- package/esm/browser/avatar/dino-face.js +1 -2
- package/esm/browser/chat/chat-packages.d.ts +39 -0
- package/esm/browser/chat/chat-packages.js +70 -0
- package/esm/browser/chat/chat-protocol.d.ts +28 -1
- package/esm/browser/chat/chat-stores.d.ts +62 -0
- package/esm/browser/chat/chat-stores.js +129 -0
- package/esm/browser/chat/chat-util.d.ts +17 -0
- package/esm/browser/chat/chat-util.js +61 -0
- package/esm/browser/chat/chat-view.js +45 -17
- package/esm/browser/chat/chat.d.ts +41 -41
- package/esm/browser/chat/chat.js +276 -190
- 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 +11 -5
- package/esm/browser/components/app-nav.js +39 -17
- package/esm/browser/components/app-shell-hooks.d.ts +2 -2
- package/esm/browser/components/app-shell-hooks.js +12 -6
- package/esm/browser/components/app-view.js +150 -36
- 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 +93 -8
- package/esm/browser/components/chat-list.js +411 -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 +18 -8
- package/esm/browser/components/composer-box.js +199 -52
- package/esm/browser/components/composer.d.ts +13 -6
- package/esm/browser/components/composer.js +8 -5
- package/esm/browser/components/connection-bar.js +50 -17
- package/esm/browser/components/context-menu.d.ts +30 -4
- package/esm/browser/components/context-menu.js +199 -37
- package/esm/browser/components/conversation-scroll.d.ts +136 -6
- package/esm/browser/components/conversation-scroll.js +467 -108
- 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 -2
- package/esm/browser/components/earlier-messages.js +42 -23
- package/esm/browser/components/editor-area.d.ts +6 -20
- package/esm/browser/components/editor-area.js +10 -96
- package/esm/browser/components/empty-pictures.d.ts +0 -2
- package/esm/browser/components/empty-pictures.js +0 -16
- 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 +6 -3
- package/esm/browser/components/folder-picker.js +27 -9
- 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/held-talk.d.ts +28 -0
- package/esm/browser/components/held-talk.js +76 -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 +5 -3
- package/esm/browser/components/icon.js +9 -9
- package/esm/browser/components/image-viewer.d.ts +132 -0
- package/esm/browser/components/image-viewer.js +434 -0
- 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 +14 -0
- package/esm/browser/components/lightbox.js +25 -0
- package/esm/browser/components/list-rows.d.ts +9 -1
- package/esm/browser/components/list-rows.js +17 -3
- package/esm/browser/components/markdown.d.ts +6 -2
- package/esm/browser/components/markdown.js +60 -14
- package/esm/browser/components/media.js +20 -12
- package/esm/browser/components/message-actions.js +2 -0
- package/esm/browser/components/message-footer.d.ts +22 -2
- package/esm/browser/components/message-footer.js +47 -13
- package/esm/browser/components/message-list.d.ts +78 -6
- package/esm/browser/components/message-list.js +281 -36
- package/esm/browser/components/message-menu.d.ts +3 -1
- package/esm/browser/components/message-menu.js +24 -4
- package/esm/browser/components/model-picker.js +1 -0
- package/esm/browser/components/nav-places.d.ts +37 -3
- package/esm/browser/components/nav-places.js +32 -7
- 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 +27 -2
- 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 +8 -3
- package/esm/browser/components/session-settings.js +15 -1
- package/esm/browser/components/session-view.js +36 -22
- 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.d.ts +2 -2
- package/esm/browser/components/settings-parts.js +69 -15
- package/esm/browser/components/swipe-row.d.ts +2 -2
- package/esm/browser/components/swipe-row.js +7 -3
- package/esm/browser/components/tool-view.js +21 -14
- 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 +51 -0
- package/esm/browser/components/voice-talk.js +242 -0
- 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/device.d.ts +3 -0
- package/esm/browser/device/device.js +11 -1
- package/esm/browser/device/hold.d.ts +42 -0
- package/esm/browser/device/hold.js +134 -0
- package/esm/browser/device/launch-screen.d.ts +1 -1
- package/esm/browser/device/launch-screen.js +1 -1
- package/esm/browser/device/long-press.d.ts +12 -0
- package/esm/browser/device/long-press.js +44 -13
- 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.d.ts +4 -2
- package/esm/browser/device/pull-down.js +67 -78
- 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 +35 -10
- package/esm/browser/device/row-swipe.js +154 -71
- package/esm/browser/device/shake-undo.d.ts +16 -0
- package/esm/browser/device/shake-undo.js +59 -0
- package/esm/browser/device/sheet-swipe.d.ts +118 -18
- package/esm/browser/device/sheet-swipe.js +414 -108
- 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 +218 -521
- package/esm/browser/extension/web-extension-code.d.ts +6 -0
- package/esm/browser/extension/web-extension-code.js +24 -0
- 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 +66 -6
- package/esm/browser/extension/web-extension-protocol.js +41 -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 +41 -68
- package/esm/browser/extension/web-extensions.js +188 -487
- 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/files/files-protocol.d.ts +25 -0
- package/esm/browser/files/files-protocol.js +2 -0
- package/esm/browser/files/files.d.ts +35 -0
- package/esm/browser/files/files.js +119 -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 +105 -3
- package/esm/browser/i18n/messages.d.ts +104 -2
- package/esm/browser/i18n/messages.js +215 -11
- package/esm/browser/index.d.ts +15 -0
- package/esm/browser/index.js +15 -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 +26 -1
- package/esm/browser/notices/notices.d.ts +3 -1
- package/esm/browser/notices/notices.js +26 -12
- 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.d.ts +55 -0
- package/esm/browser/offline/device-values.js +151 -0
- package/esm/browser/offline/kept-chats-protocol.d.ts +17 -0
- package/esm/browser/offline/kept-chats-protocol.js +2 -0
- package/esm/browser/offline/kept-chats.d.ts +47 -0
- package/esm/browser/offline/kept-chats.js +146 -0
- package/esm/browser/offline/offline-reads.d.ts +44 -0
- package/esm/browser/offline/offline-reads.js +109 -0
- 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 +17 -0
- package/esm/browser/settings/settings-protocol.js +20 -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 +95 -17
- package/esm/browser/style/device.js +42 -5
- package/esm/browser/style/layout.d.ts +1 -1
- package/esm/browser/style/layout.js +252 -67
- package/esm/browser/style/pages.d.ts +1 -1
- package/esm/browser/style/pages.js +38 -2
- 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 +76 -9
- 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/frame.d.ts +5 -4
- package/esm/browser/util/frame.js +5 -4
- package/esm/browser/util/link.d.ts +18 -0
- package/esm/browser/util/link.js +66 -1
- package/esm/browser/util/markdown.d.ts +22 -2
- package/esm/browser/util/markdown.js +120 -6
- package/esm/browser/util/message.d.ts +5 -0
- package/esm/browser/util/message.js +30 -0
- package/esm/browser/util/process.d.ts +35 -2
- package/esm/browser/util/process.js +79 -4
- 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 +49 -6
- package/esm/browser/util/voice.js +271 -26
- package/esm/browser/util/zoom.d.ts +46 -0
- package/esm/browser/util/zoom.js +96 -0
- package/esm/browser/workbench-calls.d.ts +61 -0
- package/esm/browser/workbench-calls.js +146 -0
- package/esm/browser/workbench-protocol.d.ts +36 -3
- package/esm/browser/workbench-util.d.ts +22 -4
- package/esm/browser/workbench-util.js +37 -7
- package/esm/browser/workbench.d.ts +47 -6
- package/esm/browser/workbench.js +191 -43
- package/lib/browser/assistant/assistant-chat-list.d.ts +11 -0
- package/lib/browser/assistant/assistant-chat-list.js +21 -2
- package/lib/browser/assistant/assistant-extension.d.ts +8 -1
- package/lib/browser/assistant/assistant-extension.js +25 -0
- package/lib/browser/assistant/assistant-protocol.d.ts +5 -2
- 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 +14 -2
- package/lib/browser/assistant/assistant-task-util.js +62 -13
- package/lib/browser/assistant/assistant-view.js +113 -67
- package/lib/browser/assistant/assistant.d.ts +28 -5
- package/lib/browser/assistant/assistant.js +96 -22
- package/lib/browser/avatar/dino-face.js +1 -2
- package/lib/browser/chat/chat-packages.d.ts +40 -0
- package/lib/browser/chat/chat-packages.js +74 -0
- package/lib/browser/chat/chat-protocol.d.ts +28 -1
- package/lib/browser/chat/chat-stores.d.ts +63 -0
- package/lib/browser/chat/chat-stores.js +133 -0
- package/lib/browser/chat/chat-util.d.ts +18 -0
- package/lib/browser/chat/chat-util.js +64 -0
- package/lib/browser/chat/chat-view.js +44 -16
- package/lib/browser/chat/chat.d.ts +41 -41
- package/lib/browser/chat/chat.js +277 -191
- 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 +11 -5
- package/lib/browser/components/app-nav.js +35 -13
- package/lib/browser/components/app-shell-hooks.d.ts +2 -2
- package/lib/browser/components/app-shell-hooks.js +12 -6
- package/lib/browser/components/app-view.js +145 -31
- 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 +93 -8
- package/lib/browser/components/chat-list.js +412 -60
- 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 +18 -8
- package/lib/browser/components/composer-box.js +198 -51
- package/lib/browser/components/composer.d.ts +13 -6
- package/lib/browser/components/composer.js +7 -4
- package/lib/browser/components/connection-bar.js +48 -15
- package/lib/browser/components/context-menu.d.ts +30 -4
- package/lib/browser/components/context-menu.js +198 -36
- package/lib/browser/components/conversation-scroll.d.ts +136 -6
- package/lib/browser/components/conversation-scroll.js +469 -109
- 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 -2
- package/lib/browser/components/earlier-messages.js +44 -24
- package/lib/browser/components/editor-area.d.ts +6 -20
- package/lib/browser/components/editor-area.js +11 -97
- package/lib/browser/components/empty-pictures.d.ts +0 -2
- package/lib/browser/components/empty-pictures.js +0 -17
- 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 +6 -3
- package/lib/browser/components/folder-picker.js +27 -9
- 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/held-talk.d.ts +29 -0
- package/lib/browser/components/held-talk.js +79 -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 +5 -3
- package/lib/browser/components/icon.js +11 -9
- package/lib/browser/components/image-viewer.d.ts +133 -0
- package/lib/browser/components/image-viewer.js +472 -0
- 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 +15 -0
- package/lib/browser/components/lightbox.js +61 -0
- package/lib/browser/components/list-rows.d.ts +9 -1
- package/lib/browser/components/list-rows.js +18 -3
- package/lib/browser/components/markdown.d.ts +6 -2
- package/lib/browser/components/markdown.js +60 -14
- package/lib/browser/components/media.js +21 -13
- package/lib/browser/components/message-actions.js +2 -0
- package/lib/browser/components/message-footer.d.ts +22 -2
- package/lib/browser/components/message-footer.js +49 -12
- package/lib/browser/components/message-list.d.ts +78 -6
- package/lib/browser/components/message-list.js +281 -32
- package/lib/browser/components/message-menu.d.ts +3 -1
- package/lib/browser/components/message-menu.js +23 -3
- package/lib/browser/components/model-picker.js +1 -0
- package/lib/browser/components/nav-places.d.ts +37 -3
- package/lib/browser/components/nav-places.js +35 -7
- 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 +27 -2
- 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 +8 -3
- package/lib/browser/components/session-settings.js +15 -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.d.ts +2 -2
- package/lib/browser/components/settings-parts.js +67 -13
- package/lib/browser/components/swipe-row.d.ts +2 -2
- package/lib/browser/components/swipe-row.js +7 -3
- package/lib/browser/components/tool-view.js +21 -14
- 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 +52 -0
- package/lib/browser/components/voice-talk.js +281 -0
- 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/device.d.ts +3 -0
- package/lib/browser/device/device.js +11 -1
- package/lib/browser/device/hold.d.ts +43 -0
- package/lib/browser/device/hold.js +171 -0
- package/lib/browser/device/launch-screen.d.ts +1 -1
- package/lib/browser/device/launch-screen.js +1 -1
- package/lib/browser/device/long-press.d.ts +12 -0
- package/lib/browser/device/long-press.js +44 -13
- 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.d.ts +4 -2
- package/lib/browser/device/pull-down.js +66 -77
- 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 +35 -10
- package/lib/browser/device/row-swipe.js +153 -70
- package/lib/browser/device/shake-undo.d.ts +17 -0
- package/lib/browser/device/shake-undo.js +63 -0
- package/lib/browser/device/sheet-swipe.d.ts +118 -18
- package/lib/browser/device/sheet-swipe.js +418 -109
- 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 +218 -521
- package/lib/browser/extension/web-extension-code.d.ts +6 -0
- package/lib/browser/extension/web-extension-code.js +24 -0
- 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 +66 -6
- package/lib/browser/extension/web-extension-protocol.js +42 -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 +41 -68
- package/lib/browser/extension/web-extensions.js +184 -516
- 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/files/files-protocol.d.ts +26 -0
- package/lib/browser/files/files-protocol.js +5 -0
- package/lib/browser/files/files.d.ts +36 -0
- package/lib/browser/files/files.js +122 -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 +105 -3
- package/lib/browser/i18n/messages.d.ts +104 -2
- package/lib/browser/i18n/messages.js +215 -11
- package/lib/browser/index.d.ts +15 -0
- package/lib/browser/index.js +15 -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 +26 -1
- package/lib/browser/notices/notices.d.ts +3 -1
- package/lib/browser/notices/notices.js +26 -12
- 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.d.ts +56 -0
- package/lib/browser/offline/device-values.js +157 -0
- package/lib/browser/offline/kept-chats-protocol.d.ts +18 -0
- package/lib/browser/offline/kept-chats-protocol.js +5 -0
- package/lib/browser/offline/kept-chats.d.ts +48 -0
- package/lib/browser/offline/kept-chats.js +149 -0
- package/lib/browser/offline/offline-reads.d.ts +45 -0
- package/lib/browser/offline/offline-reads.js +113 -0
- 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 +17 -0
- package/lib/browser/settings/settings-protocol.js +21 -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 +95 -17
- package/lib/browser/style/device.js +42 -5
- package/lib/browser/style/layout.d.ts +1 -1
- package/lib/browser/style/layout.js +252 -67
- package/lib/browser/style/pages.d.ts +1 -1
- package/lib/browser/style/pages.js +38 -2
- 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 +76 -9
- 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/frame.d.ts +5 -4
- package/lib/browser/util/frame.js +5 -4
- package/lib/browser/util/link.d.ts +18 -0
- package/lib/browser/util/link.js +66 -1
- package/lib/browser/util/markdown.d.ts +22 -2
- package/lib/browser/util/markdown.js +120 -6
- package/lib/browser/util/message.d.ts +5 -0
- package/lib/browser/util/message.js +30 -0
- package/lib/browser/util/process.d.ts +35 -2
- package/lib/browser/util/process.js +80 -5
- 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 +49 -6
- package/lib/browser/util/voice.js +271 -26
- package/lib/browser/util/zoom.d.ts +47 -0
- package/lib/browser/util/zoom.js +99 -0
- package/lib/browser/workbench-calls.d.ts +62 -0
- package/lib/browser/workbench-calls.js +150 -0
- package/lib/browser/workbench-protocol.d.ts +36 -3
- package/lib/browser/workbench-util.d.ts +22 -4
- package/lib/browser/workbench-util.js +38 -8
- package/lib/browser/workbench.d.ts +47 -6
- package/lib/browser/workbench.js +189 -41
- package/package.json +14 -11
- package/public/launch.svg +46 -42
|
@@ -1,15 +1,21 @@
|
|
|
1
|
+
import type { TaWebExtensionInfo } from '@celljs/ta-protocol';
|
|
1
2
|
/**
|
|
2
3
|
* The code of the web extensions of packages, kept in this browser by its hash (`TaWebExtensionInfo.hash`,
|
|
3
4
|
* of the code itself): a start reads from ta serve only what changed. A phone over the relay read some 230 KB
|
|
4
5
|
* at every start before its double's list could show.
|
|
5
6
|
* What the last list of a ta serve does not name goes; switching to another computer reads its own again.
|
|
7
|
+
* The list itself is kept for each computer too, for the extensions to start before it answers.
|
|
6
8
|
*/
|
|
7
9
|
export declare class WebExtensionCode {
|
|
8
10
|
protected readonly storage: () => Storage | undefined;
|
|
9
11
|
static readonly PREFIX = "ta.web-extension ";
|
|
12
|
+
static readonly LIST = "web-extensions";
|
|
10
13
|
constructor(storage: () => Storage | undefined);
|
|
11
14
|
get(hash: string): string | undefined;
|
|
12
15
|
set(hash: string, code: string): void;
|
|
16
|
+
/** The list the computer `host` gave last (with the values it keeps for the page, forgotten with them). */
|
|
17
|
+
list(host: string): TaWebExtensionInfo[];
|
|
18
|
+
keepList(host: string, infos: TaWebExtensionInfo[]): void;
|
|
13
19
|
/** Only the code of `hashes`, those of the list of now. */
|
|
14
20
|
keepOnly(hashes: Iterable<string>): void;
|
|
15
21
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { StateUtil } from '../state/state-protocol.js';
|
|
1
2
|
/**
|
|
2
3
|
* The code of the web extensions of packages, kept in this browser by its hash (`TaWebExtensionInfo.hash`,
|
|
3
4
|
* of the code itself): a start reads from ta serve only what changed. A phone over the relay read some 230 KB
|
|
4
5
|
* at every start before its double's list could show.
|
|
5
6
|
* What the last list of a ta serve does not name goes; switching to another computer reads its own again.
|
|
7
|
+
* The list itself is kept for each computer too, for the extensions to start before it answers.
|
|
6
8
|
*/
|
|
7
9
|
export class WebExtensionCode {
|
|
8
10
|
constructor(storage) {
|
|
@@ -27,6 +29,27 @@ export class WebExtensionCode {
|
|
|
27
29
|
// Full, or a browser that keeps nothing: read again next time.
|
|
28
30
|
}
|
|
29
31
|
}
|
|
32
|
+
/** The list the computer `host` gave last (with the values it keeps for the page, forgotten with them). */
|
|
33
|
+
list(host) {
|
|
34
|
+
var _a;
|
|
35
|
+
var _b;
|
|
36
|
+
try {
|
|
37
|
+
const kept = JSON.parse((_b = (_a = this.storage()) === null || _a === void 0 ? void 0 : _a.getItem(StateUtil.localKey(WebExtensionCode.LIST, 'user', host))) !== null && _b !== void 0 ? _b : 'null');
|
|
38
|
+
return Array.isArray(kept) ? kept : [];
|
|
39
|
+
}
|
|
40
|
+
catch (_c) {
|
|
41
|
+
return [];
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
keepList(host, infos) {
|
|
45
|
+
var _a;
|
|
46
|
+
try {
|
|
47
|
+
(_a = this.storage()) === null || _a === void 0 ? void 0 : _a.setItem(StateUtil.localKey(WebExtensionCode.LIST, 'user', host), JSON.stringify(infos));
|
|
48
|
+
}
|
|
49
|
+
catch (_b) {
|
|
50
|
+
// Full: the extensions start once the computer answers.
|
|
51
|
+
}
|
|
52
|
+
}
|
|
30
53
|
/** Only the code of `hashes`, those of the list of now. */
|
|
31
54
|
keepOnly(hashes) {
|
|
32
55
|
const storage = this.storage();
|
|
@@ -52,4 +75,5 @@ export class WebExtensionCode {
|
|
|
52
75
|
}
|
|
53
76
|
}
|
|
54
77
|
WebExtensionCode.PREFIX = 'ta.web-extension ';
|
|
78
|
+
WebExtensionCode.LIST = 'web-extensions';
|
|
55
79
|
//# sourceMappingURL=web-extension-code.js.map
|
|
@@ -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, WebShareTarget, WebTool, 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;
|
|
@@ -38,6 +39,12 @@ export interface WebComposerAddonEntry {
|
|
|
38
39
|
extension: string;
|
|
39
40
|
addon: WebComposerAddon;
|
|
40
41
|
}
|
|
42
|
+
export interface WebSettingsEntry {
|
|
43
|
+
/** `<extension id>/<index>`. */
|
|
44
|
+
id: string;
|
|
45
|
+
extension: string;
|
|
46
|
+
section: WebSettingsSection;
|
|
47
|
+
}
|
|
41
48
|
export interface WebViewEntry {
|
|
42
49
|
/** `<extension name>/<view name>`. */
|
|
43
50
|
id: string;
|
|
@@ -54,11 +61,14 @@ export interface WebViewEntry {
|
|
|
54
61
|
/** Under Discover until the user pins it (WebView.discover). */
|
|
55
62
|
discover?: boolean;
|
|
56
63
|
menu?(): WebMenuItem[][];
|
|
64
|
+
preview?(): WebViewPreview | undefined;
|
|
65
|
+
busy?(): boolean;
|
|
66
|
+
subscribePreview?(listener: () => void): () => void;
|
|
67
|
+
send?(text: string, images?: WebImage[]): Promise<void>;
|
|
57
68
|
/** Kept from before (WebViewUtil.placeholders): its place, until its extension registers it again. */
|
|
58
69
|
pending?: boolean;
|
|
59
70
|
}
|
|
60
|
-
|
|
61
|
-
export type WebViewLocation = 'page' | 'sidebar' | 'panel' | 'launcher' | 'board';
|
|
71
|
+
export type { WebViewLocation } from './web-extension-api.js';
|
|
62
72
|
/** An extension started on open (`activation: 'open'`), running or not. */
|
|
63
73
|
export interface OnOpenExtension {
|
|
64
74
|
info: TaWebExtensionInfo;
|
|
@@ -81,21 +91,38 @@ export interface WorkbenchTabs {
|
|
|
81
91
|
/** The tab shown: a view's, or one an extension opens again itself (a file). */
|
|
82
92
|
active?: string;
|
|
83
93
|
}
|
|
94
|
+
export interface WebChatIconEntry {
|
|
95
|
+
/** The name of the extension's package: the default tint. */
|
|
96
|
+
extension: string;
|
|
97
|
+
source: WebChatIconSource;
|
|
98
|
+
}
|
|
84
99
|
export interface WebExtensionsState {
|
|
85
100
|
extensions: LoadedWebExtension[];
|
|
86
101
|
views: WebViewEntry[];
|
|
87
102
|
widgets: WebWidgetEntry[];
|
|
88
103
|
/** What extensions add to the message box of every conversation (WebExtensionAPI.registerComposerAddon). */
|
|
89
104
|
composerAddons: WebComposerAddonEntry[];
|
|
105
|
+
/** The sections extensions add to the settings (WebExtensionAPI.registerSettings). */
|
|
106
|
+
settingsSections: WebSettingsEntry[];
|
|
90
107
|
renderers: Record<string, React.ComponentType<{
|
|
91
108
|
message: WebCustomMessage;
|
|
92
109
|
}>>;
|
|
110
|
+
/** By language, in lower case: the first registered (WebExtensionAPI.registerCodeRenderer). */
|
|
111
|
+
codeRenderers: Record<string, React.ComponentType<WebCodeRendererProps>>;
|
|
93
112
|
/** By the name of the extension, the group of the sessions it draws (WebExtensionAPI.registerAvatar). */
|
|
94
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[];
|
|
95
116
|
/** The first tool of each name. */
|
|
96
117
|
tools: WebTool[];
|
|
97
|
-
/**
|
|
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. */
|
|
98
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[];
|
|
99
126
|
/** The tabs of the editor area (the workbench), in the order they opened. */
|
|
100
127
|
editors: WebEditorEntry[];
|
|
101
128
|
activeEditor?: string;
|
|
@@ -103,6 +130,11 @@ export interface WebExtensionsState {
|
|
|
103
130
|
focus: number;
|
|
104
131
|
/** The directory of the conversation shown. */
|
|
105
132
|
cwd?: string;
|
|
133
|
+
/**
|
|
134
|
+
* The conversation is in front, not a page, the settings, Discover or the lists of a phone
|
|
135
|
+
* (setConversationShown): `ui.useCwd` gives its directory only then, else the default one.
|
|
136
|
+
*/
|
|
137
|
+
conversationShown: boolean;
|
|
106
138
|
/** The session of the conversation shown. */
|
|
107
139
|
sessionId?: string;
|
|
108
140
|
/** The view of the page shown in the main area; `''` for the conversation. */
|
|
@@ -121,6 +153,24 @@ export interface WebExtensionsState {
|
|
|
121
153
|
searches: WebSearchSource[];
|
|
122
154
|
/** An extension handed on: its dialog shows (WebExtensionUI.shareExtension). */
|
|
123
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;
|
|
170
|
+
}
|
|
171
|
+
export declare namespace WebCwdUtil {
|
|
172
|
+
/** The directory of the conversation while it is in front; else none, and the workbench is in the default directory. */
|
|
173
|
+
function shown(state: Pick<WebExtensionsState, 'cwd' | 'conversationShown'>): string | undefined;
|
|
124
174
|
}
|
|
125
175
|
export declare namespace WebLabelUtil {
|
|
126
176
|
function text(label: WebLabel | undefined): string;
|
|
@@ -145,14 +195,14 @@ export interface TaWebExtensions {
|
|
|
145
195
|
readonly state: WebExtensionsState;
|
|
146
196
|
/** The tasks of every extension (WebExtensionAPI.registerTasks), the double's too. */
|
|
147
197
|
readonly tasks: WebTaskBoard;
|
|
198
|
+
/** The rows of the double's home of every extension (registerHomeItems). */
|
|
199
|
+
readonly home: WebHomeBoard;
|
|
148
200
|
readonly builtins: readonly BuiltinWebExtension[];
|
|
149
201
|
subscribe(listener: (state: WebExtensionsState) => void): () => void;
|
|
150
202
|
/** Loads what is new, unloads what is gone or off, and loads again what changed. True when anything did. */
|
|
151
203
|
refresh(): Promise<boolean>;
|
|
152
204
|
/** After packages changed: {@link refresh}, then the pi extensions, skills and prompts of the conversation shown. */
|
|
153
205
|
reloadPackages(): Promise<void>;
|
|
154
|
-
/** Removes the package of a web extension from the server. */
|
|
155
|
-
remove(id: string): Promise<void>;
|
|
156
206
|
/** Shows an open tab of the editor area. */
|
|
157
207
|
showEditor(id: string): void;
|
|
158
208
|
/** Opens a `panel` view as a tab of the editor area, or shows its tab. */
|
|
@@ -174,6 +224,12 @@ export interface TaWebExtensions {
|
|
|
174
224
|
forgetPage(id: string): void;
|
|
175
225
|
/** Shows the dialog that hands an extension on; `undefined` closes it. */
|
|
176
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;
|
|
177
233
|
/** What `ui.openShared` does. */
|
|
178
234
|
openShared(text: string): Promise<boolean>;
|
|
179
235
|
/** Opens a package without installing it, loads the web extensions again and shows its first page (WebExtensionAPI.openTemporary). */
|
|
@@ -191,8 +247,12 @@ export interface TaWebExtensions {
|
|
|
191
247
|
pinEditor(id: string): void;
|
|
192
248
|
/** The conversation shown, while there is one. */
|
|
193
249
|
connect(conversation: WebExtensionConversation | undefined): void;
|
|
250
|
+
/** Whether the conversation is what the main area shows: the shell says so as it changes. */
|
|
251
|
+
setConversationShown(shown: boolean): void;
|
|
194
252
|
/** An event of the conversation shown, for the handlers of `on`. */
|
|
195
253
|
emit(event: TaEvent): void;
|
|
196
254
|
/** What `switchSession` of web extensions does: the page shows that session; `undefined` until it can. */
|
|
197
255
|
setSessionSwitcher(switcher: WebSessionSwitcher | undefined): void;
|
|
256
|
+
/** How the page shows a session as the conversation, once it said (setSessionSwitcher). */
|
|
257
|
+
sessionSwitcher(): WebSessionSwitcher | undefined;
|
|
198
258
|
}
|