@celljs/ta-web 4.10.0 → 4.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +7 -7
- package/README.md +7 -7
- package/esm/browser/assistant/assistant-chat-list.d.ts +11 -0
- package/esm/browser/assistant/assistant-chat-list.js +12 -0
- package/esm/browser/assistant/assistant-extension.js +5 -0
- package/esm/browser/assistant/assistant-protocol.d.ts +2 -1
- package/esm/browser/assistant/assistant-task-book.d.ts +12 -2
- package/esm/browser/assistant/assistant-task-book.js +23 -4
- package/esm/browser/assistant/assistant-task-source.d.ts +1 -1
- package/esm/browser/assistant/assistant-task-source.js +5 -10
- package/esm/browser/assistant/assistant-task-util.d.ts +13 -3
- package/esm/browser/assistant/assistant-task-util.js +59 -12
- package/esm/browser/assistant/assistant-view.js +48 -24
- package/esm/browser/assistant/assistant.d.ts +18 -4
- package/esm/browser/assistant/assistant.js +52 -17
- package/esm/browser/avatar/dino-face.js +1 -2
- package/esm/browser/chat/chat-protocol.d.ts +5 -0
- package/esm/browser/chat/chat-stores.d.ts +8 -5
- package/esm/browser/chat/chat-stores.js +17 -9
- package/esm/browser/chat/chat-view.js +23 -15
- package/esm/browser/chat/chat.d.ts +16 -8
- package/esm/browser/chat/chat.js +86 -51
- package/esm/browser/components/account-menu.d.ts +0 -2
- package/esm/browser/components/account-menu.js +1 -27
- package/esm/browser/components/agent-settings-view.d.ts +3 -2
- package/esm/browser/components/agent-settings-view.js +2 -1
- package/esm/browser/components/app-nav.d.ts +5 -2
- package/esm/browser/components/app-nav.js +22 -9
- package/esm/browser/components/app-shell-hooks.js +5 -3
- package/esm/browser/components/app-view.js +84 -20
- package/esm/browser/components/busy.d.ts +25 -0
- package/esm/browser/components/busy.js +52 -0
- package/esm/browser/components/chat-icon.d.ts +29 -0
- package/esm/browser/components/chat-icon.js +78 -0
- package/esm/browser/components/chat-list.d.ts +73 -6
- package/esm/browser/components/chat-list.js +295 -60
- package/esm/browser/components/chat-seen.d.ts +53 -0
- package/esm/browser/components/chat-seen.js +101 -0
- package/esm/browser/components/composer-box.d.ts +15 -4
- package/esm/browser/components/composer-box.js +139 -77
- package/esm/browser/components/composer.d.ts +9 -6
- package/esm/browser/components/composer.js +32 -4
- package/esm/browser/components/conversation-scroll-hooks.d.ts +16 -0
- package/esm/browser/components/conversation-scroll-hooks.js +98 -0
- package/esm/browser/components/conversation-scroll-util.d.ts +30 -0
- package/esm/browser/components/conversation-scroll-util.js +56 -0
- package/esm/browser/components/conversation-scroll.d.ts +52 -31
- package/esm/browser/components/conversation-scroll.js +170 -129
- package/esm/browser/components/custom-host.d.ts +3 -0
- package/esm/browser/components/custom-host.js +14 -0
- package/esm/browser/components/directory-commands.d.ts +6 -0
- package/esm/browser/components/directory-commands.js +34 -0
- package/esm/browser/components/discover-view.d.ts +11 -4
- package/esm/browser/components/discover-view.js +20 -11
- package/esm/browser/components/dismiss.d.ts +3 -0
- package/esm/browser/components/dismiss.js +29 -0
- package/esm/browser/components/earlier-messages.d.ts +34 -3
- package/esm/browser/components/earlier-messages.js +42 -8
- package/esm/browser/components/editor-area.d.ts +6 -22
- package/esm/browser/components/editor-area.js +10 -97
- package/esm/browser/components/face.d.ts +24 -0
- package/esm/browser/components/face.js +42 -0
- package/esm/browser/components/fold-text.d.ts +20 -0
- package/esm/browser/components/fold-text.js +66 -0
- package/esm/browser/components/folder-picker.d.ts +1 -1
- package/esm/browser/components/folder-picker.js +1 -1
- package/esm/browser/components/full-screen.d.ts +9 -0
- package/esm/browser/components/full-screen.js +26 -0
- package/esm/browser/components/grow-box.d.ts +9 -0
- package/esm/browser/components/grow-box.js +50 -0
- package/esm/browser/components/hold-to-talk.d.ts +22 -0
- package/esm/browser/components/hold-to-talk.js +29 -0
- package/esm/browser/components/host-view.d.ts +1 -1
- package/esm/browser/components/icon.d.ts +3 -1
- package/esm/browser/components/icon.js +4 -3
- package/esm/browser/components/image-viewer.d.ts +10 -2
- package/esm/browser/components/image-viewer.js +48 -11
- package/esm/browser/components/launcher-search-util.d.ts +4 -3
- package/esm/browser/components/launcher-search-util.js +12 -4
- package/esm/browser/components/lightbox.d.ts +5 -2
- package/esm/browser/components/lightbox.js +4 -3
- package/esm/browser/components/list-rows.d.ts +9 -1
- package/esm/browser/components/list-rows.js +17 -3
- package/esm/browser/components/markdown.js +36 -4
- package/esm/browser/components/media.js +73 -7
- package/esm/browser/components/message-actions.js +3 -0
- package/esm/browser/components/message-footer.d.ts +8 -0
- package/esm/browser/components/message-footer.js +20 -3
- package/esm/browser/components/message-list.d.ts +60 -7
- package/esm/browser/components/message-list.js +206 -58
- package/esm/browser/components/message-menu.js +6 -1
- package/esm/browser/components/model-picker.js +1 -0
- package/esm/browser/components/nav-places.d.ts +21 -2
- package/esm/browser/components/nav-places.js +20 -4
- package/esm/browser/components/notice-center.js +34 -0
- package/esm/browser/components/notice-face.d.ts +10 -0
- package/esm/browser/components/notice-face.js +28 -0
- package/esm/browser/components/phone-shell.d.ts +23 -1
- package/esm/browser/components/phone-shell.js +98 -9
- package/esm/browser/components/picture.d.ts +8 -1
- package/esm/browser/components/picture.js +12 -1
- package/esm/browser/components/plus-menu.d.ts +23 -0
- package/esm/browser/components/plus-menu.js +90 -0
- package/esm/browser/components/recent-shot.d.ts +15 -0
- package/esm/browser/components/recent-shot.js +174 -0
- package/esm/browser/components/relay-view.js +10 -3
- package/esm/browser/components/run-status.d.ts +1 -1
- package/esm/browser/components/run-status.js +17 -29
- package/esm/browser/components/said-text.d.ts +6 -0
- package/esm/browser/components/said-text.js +14 -0
- package/esm/browser/components/scan-screen.d.ts +10 -0
- package/esm/browser/components/scan-screen.js +230 -0
- package/esm/browser/components/search-page.js +10 -6
- package/esm/browser/components/session-settings.d.ts +2 -3
- package/esm/browser/components/session-settings.js +1 -0
- package/esm/browser/components/session-view.d.ts +3 -1
- package/esm/browser/components/session-view.js +35 -21
- package/esm/browser/components/settings-choices.d.ts +1 -0
- package/esm/browser/components/settings-choices.js +3 -2
- package/esm/browser/components/settings-controls.d.ts +5 -3
- package/esm/browser/components/settings-controls.js +10 -1
- package/esm/browser/components/settings-parts.js +45 -14
- package/esm/browser/components/stop-times.d.ts +47 -0
- package/esm/browser/components/stop-times.js +81 -0
- package/esm/browser/components/tool-view.js +7 -2
- package/esm/browser/components/unseen-drop.d.ts +39 -0
- package/esm/browser/components/unseen-drop.js +219 -0
- package/esm/browser/components/use-seen-chats.d.ts +8 -0
- package/esm/browser/components/use-seen-chats.js +49 -0
- package/esm/browser/components/use-stop-times.d.ts +3 -0
- package/esm/browser/components/use-stop-times.js +17 -0
- package/esm/browser/components/voice-button.d.ts +7 -1
- package/esm/browser/components/voice-button.js +15 -2
- package/esm/browser/components/voice-picker.d.ts +6 -0
- package/esm/browser/components/voice-picker.js +53 -0
- package/esm/browser/components/voice-talk.d.ts +11 -3
- package/esm/browser/components/voice-talk.js +24 -4
- package/esm/browser/components/web-composer.d.ts +4 -2
- package/esm/browser/components/web-composer.js +8 -4
- package/esm/browser/components/workbench-tabs.d.ts +41 -0
- package/esm/browser/components/workbench-tabs.js +193 -0
- package/esm/browser/components/workbench-toggle.d.ts +0 -13
- package/esm/browser/components/workbench-toggle.js +1 -28
- package/esm/browser/device/code-scan.d.ts +55 -0
- package/esm/browser/device/code-scan.js +137 -0
- package/esm/browser/device/code-vision.d.ts +51 -0
- package/esm/browser/device/code-vision.js +100 -0
- package/esm/browser/device/hold.js +4 -6
- package/esm/browser/device/long-press.d.ts +10 -0
- package/esm/browser/device/long-press.js +28 -12
- package/esm/browser/device/own-gestures.d.ts +25 -0
- package/esm/browser/device/own-gestures.js +39 -0
- package/esm/browser/device/photo-picker.d.ts +14 -0
- package/esm/browser/device/photo-picker.js +48 -0
- package/esm/browser/device/pull-down.js +3 -2
- package/esm/browser/device/recent-shots.d.ts +45 -0
- package/esm/browser/device/recent-shots.js +142 -0
- package/esm/browser/device/row-swipe.d.ts +2 -0
- package/esm/browser/device/row-swipe.js +14 -3
- package/esm/browser/device/sheet-swipe.d.ts +1 -1
- package/esm/browser/device/sheet-swipe.js +25 -4
- package/esm/browser/extension/extension-view.d.ts +10 -0
- package/esm/browser/extension/extension-view.js +6 -0
- package/esm/browser/extension/icons.js +16 -2
- package/esm/browser/extension/web-api-components.d.ts +287 -0
- package/esm/browser/extension/web-api-components.js +2 -0
- package/esm/browser/extension/web-api-contributions.d.ts +394 -0
- package/esm/browser/extension/web-api-contributions.js +2 -0
- package/esm/browser/extension/web-api-desktop.d.ts +55 -0
- package/esm/browser/extension/web-api-desktop.js +2 -0
- package/esm/browser/extension/web-api-terminal.d.ts +71 -0
- package/esm/browser/extension/web-api-terminal.js +2 -0
- package/esm/browser/extension/web-editor-tabs.d.ts +42 -0
- package/esm/browser/extension/web-editor-tabs.js +137 -0
- package/esm/browser/extension/web-extension-api.d.ts +186 -565
- package/esm/browser/extension/web-extension-context.d.ts +78 -0
- package/esm/browser/extension/web-extension-context.js +354 -0
- package/esm/browser/extension/web-extension-protocol.d.ts +57 -7
- package/esm/browser/extension/web-extension-protocol.js +34 -0
- package/esm/browser/extension/web-extension-run.d.ts +54 -0
- package/esm/browser/extension/web-extension-run.js +120 -0
- package/esm/browser/extension/web-extensions.d.ts +29 -69
- package/esm/browser/extension/web-extensions.js +121 -516
- package/esm/browser/extension/web-home.d.ts +19 -0
- package/esm/browser/extension/web-home.js +72 -0
- package/esm/browser/extension/web-pages.d.ts +13 -3
- package/esm/browser/extension/web-pages.js +23 -3
- package/esm/browser/extension/web-session-notices.d.ts +36 -0
- package/esm/browser/extension/web-session-notices.js +174 -0
- package/esm/browser/extension/web-sharing.d.ts +2 -0
- package/esm/browser/extension/web-sharing.js +4 -0
- package/esm/browser/game/game-host.d.ts +27 -0
- package/esm/browser/game/game-host.js +127 -0
- package/esm/browser/game/game-loader.d.ts +10 -0
- package/esm/browser/game/game-loader.js +28 -0
- package/esm/browser/game/game-protocol.d.ts +49 -0
- package/esm/browser/game/game-protocol.js +2 -0
- package/esm/browser/game/game-runner.d.ts +27 -0
- package/esm/browser/game/game-runner.js +60 -0
- package/esm/browser/game/game-util.d.ts +29 -0
- package/esm/browser/game/game-util.js +180 -0
- package/esm/browser/game/game-view.d.ts +12 -0
- package/esm/browser/game/game-view.js +31 -0
- package/esm/browser/game/game3d-protocol.d.ts +51 -0
- package/esm/browser/game/game3d-protocol.js +2 -0
- package/esm/browser/game/game3d-runner.d.ts +27 -0
- package/esm/browser/game/game3d-runner.js +149 -0
- package/esm/browser/hooks.d.ts +5 -1
- package/esm/browser/hooks.js +13 -2
- package/esm/browser/i18n/locales.d.ts +92 -2
- package/esm/browser/i18n/messages.d.ts +91 -1
- package/esm/browser/i18n/messages.js +187 -7
- package/esm/browser/index.d.ts +9 -0
- package/esm/browser/index.js +9 -0
- package/esm/browser/links/links-protocol.d.ts +7 -0
- package/esm/browser/links/links.d.ts +24 -7
- package/esm/browser/links/links.js +64 -11
- package/esm/browser/markdown/code-renderers.d.ts +4 -0
- package/esm/browser/markdown/code-renderers.js +4 -0
- package/esm/browser/notices/notices-protocol.d.ts +17 -0
- package/esm/browser/notices/notices.d.ts +1 -1
- package/esm/browser/notices/notices.js +6 -2
- package/esm/browser/notices/session-notices.d.ts +69 -0
- package/esm/browser/notices/session-notices.js +92 -0
- package/esm/browser/offline/device-values.js +12 -3
- package/esm/browser/offline/offline-reads.js +3 -1
- package/esm/browser/settings/navigation.d.ts +3 -2
- package/esm/browser/settings/navigation.js +4 -3
- package/esm/browser/settings/settings-protocol.d.ts +15 -0
- package/esm/browser/settings/settings-protocol.js +18 -4
- package/esm/browser/state/state-protocol.d.ts +8 -1
- package/esm/browser/state/state.d.ts +2 -0
- package/esm/browser/state/state.js +21 -2
- package/esm/browser/style/base.d.ts +1 -1
- package/esm/browser/style/base.js +27 -1
- package/esm/browser/style/conversation.d.ts +1 -1
- package/esm/browser/style/conversation.js +45 -5
- package/esm/browser/style/device.js +15 -1
- package/esm/browser/style/layout.d.ts +1 -1
- package/esm/browser/style/layout.js +192 -56
- package/esm/browser/style/pages.d.ts +1 -1
- package/esm/browser/style/pages.js +39 -1
- package/esm/browser/style/phone.d.ts +1 -1
- package/esm/browser/style/phone.js +15 -0
- package/esm/browser/style/shell.d.ts +1 -1
- package/esm/browser/style/shell.js +32 -6
- package/esm/browser/style/surfaces.d.ts +1 -1
- package/esm/browser/style/surfaces.js +21 -2
- package/esm/browser/style/tints.d.ts +27 -0
- package/esm/browser/style/tints.js +56 -0
- package/esm/browser/style.js +13 -1
- package/esm/browser/util/composer.d.ts +6 -0
- package/esm/browser/util/composer.js +16 -0
- package/esm/browser/util/desktop.d.ts +19 -1
- package/esm/browser/util/desktop.js +15 -0
- package/esm/browser/util/frame.d.ts +2 -0
- package/esm/browser/util/frame.js +2 -0
- package/esm/browser/util/link.d.ts +18 -0
- package/esm/browser/util/link.js +66 -1
- package/esm/browser/util/markdown.d.ts +4 -1
- package/esm/browser/util/markdown.js +1 -1
- package/esm/browser/util/message.d.ts +5 -0
- package/esm/browser/util/message.js +30 -0
- package/esm/browser/util/process.d.ts +57 -3
- package/esm/browser/util/process.js +123 -11
- package/esm/browser/util/progress.d.ts +19 -1
- package/esm/browser/util/progress.js +57 -4
- package/esm/browser/util/quote.d.ts +19 -0
- package/esm/browser/util/quote.js +58 -0
- package/esm/browser/util/tool.d.ts +19 -2
- package/esm/browser/util/tool.js +70 -2
- package/esm/browser/util/voice.d.ts +47 -7
- package/esm/browser/util/voice.js +269 -27
- package/esm/browser/workbench-calls.d.ts +6 -4
- package/esm/browser/workbench-calls.js +15 -10
- package/esm/browser/workbench-protocol.d.ts +31 -2
- package/esm/browser/workbench-util.d.ts +15 -4
- package/esm/browser/workbench-util.js +28 -5
- package/esm/browser/workbench.d.ts +33 -1
- package/esm/browser/workbench.js +142 -14
- package/lib/browser/assistant/assistant-chat-list.d.ts +11 -0
- package/lib/browser/assistant/assistant-chat-list.js +13 -0
- package/lib/browser/assistant/assistant-extension.js +5 -0
- package/lib/browser/assistant/assistant-protocol.d.ts +2 -1
- package/lib/browser/assistant/assistant-task-book.d.ts +12 -2
- package/lib/browser/assistant/assistant-task-book.js +23 -4
- package/lib/browser/assistant/assistant-task-source.d.ts +1 -1
- package/lib/browser/assistant/assistant-task-source.js +5 -10
- package/lib/browser/assistant/assistant-task-util.d.ts +13 -3
- package/lib/browser/assistant/assistant-task-util.js +59 -12
- package/lib/browser/assistant/assistant-view.js +46 -22
- package/lib/browser/assistant/assistant.d.ts +18 -4
- package/lib/browser/assistant/assistant.js +52 -17
- package/lib/browser/avatar/dino-face.js +1 -2
- package/lib/browser/chat/chat-protocol.d.ts +5 -0
- package/lib/browser/chat/chat-stores.d.ts +8 -5
- package/lib/browser/chat/chat-stores.js +17 -9
- package/lib/browser/chat/chat-view.js +22 -14
- package/lib/browser/chat/chat.d.ts +16 -8
- package/lib/browser/chat/chat.js +86 -51
- package/lib/browser/components/account-menu.d.ts +0 -2
- package/lib/browser/components/account-menu.js +2 -29
- package/lib/browser/components/agent-settings-view.d.ts +3 -2
- package/lib/browser/components/agent-settings-view.js +2 -1
- package/lib/browser/components/app-nav.d.ts +5 -2
- package/lib/browser/components/app-nav.js +18 -5
- package/lib/browser/components/app-shell-hooks.js +5 -3
- package/lib/browser/components/app-view.js +80 -16
- package/lib/browser/components/busy.d.ts +26 -0
- package/lib/browser/components/busy.js +91 -0
- package/lib/browser/components/chat-icon.d.ts +30 -0
- package/lib/browser/components/chat-icon.js +117 -0
- package/lib/browser/components/chat-list.d.ts +73 -6
- package/lib/browser/components/chat-list.js +295 -59
- package/lib/browser/components/chat-seen.d.ts +54 -0
- package/lib/browser/components/chat-seen.js +104 -0
- package/lib/browser/components/composer-box.d.ts +15 -4
- package/lib/browser/components/composer-box.js +136 -74
- package/lib/browser/components/composer.d.ts +9 -6
- package/lib/browser/components/composer.js +31 -3
- package/lib/browser/components/conversation-scroll-hooks.d.ts +17 -0
- package/lib/browser/components/conversation-scroll-hooks.js +135 -0
- package/lib/browser/components/conversation-scroll-util.d.ts +31 -0
- package/lib/browser/components/conversation-scroll-util.js +60 -0
- package/lib/browser/components/conversation-scroll.d.ts +52 -31
- package/lib/browser/components/conversation-scroll.js +171 -164
- package/lib/browser/components/custom-host.d.ts +4 -0
- package/lib/browser/components/custom-host.js +50 -0
- package/lib/browser/components/directory-commands.d.ts +7 -0
- package/lib/browser/components/directory-commands.js +70 -0
- package/lib/browser/components/discover-view.d.ts +11 -4
- package/lib/browser/components/discover-view.js +19 -10
- package/lib/browser/components/dismiss.d.ts +4 -0
- package/lib/browser/components/dismiss.js +65 -0
- package/lib/browser/components/earlier-messages.d.ts +34 -3
- package/lib/browser/components/earlier-messages.js +44 -9
- package/lib/browser/components/editor-area.d.ts +6 -22
- package/lib/browser/components/editor-area.js +11 -98
- package/lib/browser/components/face.d.ts +25 -0
- package/lib/browser/components/face.js +79 -0
- package/lib/browser/components/fold-text.d.ts +21 -0
- package/lib/browser/components/fold-text.js +103 -0
- package/lib/browser/components/folder-picker.d.ts +1 -1
- package/lib/browser/components/folder-picker.js +1 -1
- package/lib/browser/components/full-screen.d.ts +10 -0
- package/lib/browser/components/full-screen.js +62 -0
- package/lib/browser/components/grow-box.d.ts +10 -0
- package/lib/browser/components/grow-box.js +86 -0
- package/lib/browser/components/hold-to-talk.d.ts +23 -0
- package/lib/browser/components/hold-to-talk.js +65 -0
- package/lib/browser/components/host-view.d.ts +1 -1
- package/lib/browser/components/icon.d.ts +3 -1
- package/lib/browser/components/icon.js +4 -3
- package/lib/browser/components/image-viewer.d.ts +10 -2
- package/lib/browser/components/image-viewer.js +47 -10
- package/lib/browser/components/launcher-search-util.d.ts +4 -3
- package/lib/browser/components/launcher-search-util.js +12 -4
- package/lib/browser/components/lightbox.d.ts +5 -2
- package/lib/browser/components/lightbox.js +4 -3
- package/lib/browser/components/list-rows.d.ts +9 -1
- package/lib/browser/components/list-rows.js +18 -3
- package/lib/browser/components/markdown.js +36 -4
- package/lib/browser/components/media.js +73 -7
- package/lib/browser/components/message-actions.js +3 -0
- package/lib/browser/components/message-footer.d.ts +8 -0
- package/lib/browser/components/message-footer.js +20 -2
- package/lib/browser/components/message-list.d.ts +60 -7
- package/lib/browser/components/message-list.js +206 -55
- package/lib/browser/components/message-menu.js +6 -1
- package/lib/browser/components/model-picker.js +1 -0
- package/lib/browser/components/nav-places.d.ts +21 -2
- package/lib/browser/components/nav-places.js +22 -4
- package/lib/browser/components/notice-center.js +34 -0
- package/lib/browser/components/notice-face.d.ts +11 -0
- package/lib/browser/components/notice-face.js +64 -0
- package/lib/browser/components/phone-shell.d.ts +23 -1
- package/lib/browser/components/phone-shell.js +99 -10
- package/lib/browser/components/picture.d.ts +8 -1
- package/lib/browser/components/picture.js +13 -1
- package/lib/browser/components/plus-menu.d.ts +24 -0
- package/lib/browser/components/plus-menu.js +126 -0
- package/lib/browser/components/recent-shot.d.ts +16 -0
- package/lib/browser/components/recent-shot.js +210 -0
- package/lib/browser/components/relay-view.js +10 -3
- package/lib/browser/components/run-status.d.ts +1 -1
- package/lib/browser/components/run-status.js +17 -29
- package/lib/browser/components/said-text.d.ts +7 -0
- package/lib/browser/components/said-text.js +50 -0
- package/lib/browser/components/scan-screen.d.ts +11 -0
- package/lib/browser/components/scan-screen.js +266 -0
- package/lib/browser/components/search-page.js +10 -6
- package/lib/browser/components/session-settings.d.ts +2 -3
- package/lib/browser/components/session-settings.js +1 -0
- package/lib/browser/components/session-view.d.ts +3 -1
- package/lib/browser/components/session-view.js +32 -18
- package/lib/browser/components/settings-choices.d.ts +1 -0
- package/lib/browser/components/settings-choices.js +2 -1
- package/lib/browser/components/settings-controls.d.ts +5 -3
- package/lib/browser/components/settings-controls.js +10 -1
- package/lib/browser/components/settings-parts.js +43 -12
- package/lib/browser/components/stop-times.d.ts +48 -0
- package/lib/browser/components/stop-times.js +85 -0
- package/lib/browser/components/tool-view.js +7 -2
- package/lib/browser/components/unseen-drop.d.ts +40 -0
- package/lib/browser/components/unseen-drop.js +256 -0
- package/lib/browser/components/use-seen-chats.d.ts +9 -0
- package/lib/browser/components/use-seen-chats.js +85 -0
- package/lib/browser/components/use-stop-times.d.ts +4 -0
- package/lib/browser/components/use-stop-times.js +53 -0
- package/lib/browser/components/voice-button.d.ts +7 -1
- package/lib/browser/components/voice-button.js +16 -2
- package/lib/browser/components/voice-picker.d.ts +7 -0
- package/lib/browser/components/voice-picker.js +89 -0
- package/lib/browser/components/voice-talk.d.ts +11 -3
- package/lib/browser/components/voice-talk.js +25 -4
- package/lib/browser/components/web-composer.d.ts +4 -2
- package/lib/browser/components/web-composer.js +7 -3
- package/lib/browser/components/workbench-tabs.d.ts +42 -0
- package/lib/browser/components/workbench-tabs.js +232 -0
- package/lib/browser/components/workbench-toggle.d.ts +0 -13
- package/lib/browser/components/workbench-toggle.js +1 -29
- package/lib/browser/device/code-scan.d.ts +56 -0
- package/lib/browser/device/code-scan.js +141 -0
- package/lib/browser/device/code-vision.d.ts +52 -0
- package/lib/browser/device/code-vision.js +103 -0
- package/lib/browser/device/hold.js +4 -6
- package/lib/browser/device/long-press.d.ts +10 -0
- package/lib/browser/device/long-press.js +28 -12
- package/lib/browser/device/own-gestures.d.ts +26 -0
- package/lib/browser/device/own-gestures.js +42 -0
- package/lib/browser/device/photo-picker.d.ts +15 -0
- package/lib/browser/device/photo-picker.js +51 -0
- package/lib/browser/device/pull-down.js +3 -2
- package/lib/browser/device/recent-shots.d.ts +46 -0
- package/lib/browser/device/recent-shots.js +145 -0
- package/lib/browser/device/row-swipe.d.ts +2 -0
- package/lib/browser/device/row-swipe.js +14 -3
- package/lib/browser/device/sheet-swipe.d.ts +1 -1
- package/lib/browser/device/sheet-swipe.js +25 -4
- package/lib/browser/extension/extension-view.d.ts +10 -0
- package/lib/browser/extension/extension-view.js +7 -1
- package/lib/browser/extension/icons.js +15 -1
- package/lib/browser/extension/web-api-components.d.ts +288 -0
- package/lib/browser/extension/web-api-components.js +3 -0
- package/lib/browser/extension/web-api-contributions.d.ts +395 -0
- package/lib/browser/extension/web-api-contributions.js +3 -0
- package/lib/browser/extension/web-api-desktop.d.ts +56 -0
- package/lib/browser/extension/web-api-desktop.js +3 -0
- package/lib/browser/extension/web-api-terminal.d.ts +72 -0
- package/lib/browser/extension/web-api-terminal.js +3 -0
- package/lib/browser/extension/web-editor-tabs.d.ts +43 -0
- package/lib/browser/extension/web-editor-tabs.js +141 -0
- package/lib/browser/extension/web-extension-api.d.ts +186 -565
- package/lib/browser/extension/web-extension-context.d.ts +79 -0
- package/lib/browser/extension/web-extension-context.js +391 -0
- package/lib/browser/extension/web-extension-protocol.d.ts +57 -7
- package/lib/browser/extension/web-extension-protocol.js +35 -1
- package/lib/browser/extension/web-extension-run.d.ts +55 -0
- package/lib/browser/extension/web-extension-run.js +123 -0
- package/lib/browser/extension/web-extensions.d.ts +29 -69
- package/lib/browser/extension/web-extensions.js +117 -545
- package/lib/browser/extension/web-home.d.ts +20 -0
- package/lib/browser/extension/web-home.js +76 -0
- package/lib/browser/extension/web-pages.d.ts +13 -3
- package/lib/browser/extension/web-pages.js +23 -3
- package/lib/browser/extension/web-session-notices.d.ts +37 -0
- package/lib/browser/extension/web-session-notices.js +177 -0
- package/lib/browser/extension/web-sharing.d.ts +2 -0
- package/lib/browser/extension/web-sharing.js +4 -0
- package/lib/browser/game/game-host.d.ts +28 -0
- package/lib/browser/game/game-host.js +163 -0
- package/lib/browser/game/game-loader.d.ts +11 -0
- package/lib/browser/game/game-loader.js +31 -0
- package/lib/browser/game/game-protocol.d.ts +50 -0
- package/lib/browser/game/game-protocol.js +3 -0
- package/lib/browser/game/game-runner.d.ts +28 -0
- package/lib/browser/game/game-runner.js +64 -0
- package/lib/browser/game/game-util.d.ts +30 -0
- package/lib/browser/game/game-util.js +183 -0
- package/lib/browser/game/game-view.d.ts +13 -0
- package/lib/browser/game/game-view.js +68 -0
- package/lib/browser/game/game3d-protocol.d.ts +52 -0
- package/lib/browser/game/game3d-protocol.js +3 -0
- package/lib/browser/game/game3d-runner.d.ts +28 -0
- package/lib/browser/game/game3d-runner.js +153 -0
- package/lib/browser/hooks.d.ts +5 -1
- package/lib/browser/hooks.js +14 -2
- package/lib/browser/i18n/locales.d.ts +92 -2
- package/lib/browser/i18n/messages.d.ts +91 -1
- package/lib/browser/i18n/messages.js +187 -7
- package/lib/browser/index.d.ts +9 -0
- package/lib/browser/index.js +9 -0
- package/lib/browser/links/links-protocol.d.ts +7 -0
- package/lib/browser/links/links.d.ts +24 -7
- package/lib/browser/links/links.js +64 -11
- package/lib/browser/markdown/code-renderers.d.ts +5 -0
- package/lib/browser/markdown/code-renderers.js +40 -0
- package/lib/browser/notices/notices-protocol.d.ts +17 -0
- package/lib/browser/notices/notices.d.ts +1 -1
- package/lib/browser/notices/notices.js +6 -2
- package/lib/browser/notices/session-notices.d.ts +70 -0
- package/lib/browser/notices/session-notices.js +96 -0
- package/lib/browser/offline/device-values.js +12 -3
- package/lib/browser/offline/offline-reads.js +3 -1
- package/lib/browser/settings/navigation.d.ts +3 -2
- package/lib/browser/settings/navigation.js +4 -3
- package/lib/browser/settings/settings-protocol.d.ts +15 -0
- package/lib/browser/settings/settings-protocol.js +19 -5
- package/lib/browser/state/state-protocol.d.ts +8 -1
- package/lib/browser/state/state.d.ts +2 -0
- package/lib/browser/state/state.js +21 -2
- package/lib/browser/style/base.d.ts +1 -1
- package/lib/browser/style/base.js +27 -1
- package/lib/browser/style/conversation.d.ts +1 -1
- package/lib/browser/style/conversation.js +45 -5
- package/lib/browser/style/device.js +15 -1
- package/lib/browser/style/layout.d.ts +1 -1
- package/lib/browser/style/layout.js +192 -56
- package/lib/browser/style/pages.d.ts +1 -1
- package/lib/browser/style/pages.js +39 -1
- package/lib/browser/style/phone.d.ts +1 -1
- package/lib/browser/style/phone.js +15 -0
- package/lib/browser/style/shell.d.ts +1 -1
- package/lib/browser/style/shell.js +32 -6
- package/lib/browser/style/surfaces.d.ts +1 -1
- package/lib/browser/style/surfaces.js +21 -2
- package/lib/browser/style/tints.d.ts +28 -0
- package/lib/browser/style/tints.js +59 -0
- package/lib/browser/style.js +13 -1
- package/lib/browser/util/composer.d.ts +6 -0
- package/lib/browser/util/composer.js +16 -0
- package/lib/browser/util/desktop.d.ts +19 -1
- package/lib/browser/util/desktop.js +15 -0
- package/lib/browser/util/frame.d.ts +2 -0
- package/lib/browser/util/frame.js +2 -0
- package/lib/browser/util/link.d.ts +18 -0
- package/lib/browser/util/link.js +66 -1
- package/lib/browser/util/markdown.d.ts +4 -1
- package/lib/browser/util/markdown.js +1 -1
- package/lib/browser/util/message.d.ts +5 -0
- package/lib/browser/util/message.js +30 -0
- package/lib/browser/util/process.d.ts +57 -3
- package/lib/browser/util/process.js +125 -12
- package/lib/browser/util/progress.d.ts +19 -1
- package/lib/browser/util/progress.js +57 -4
- package/lib/browser/util/quote.d.ts +20 -0
- package/lib/browser/util/quote.js +61 -0
- package/lib/browser/util/tool.d.ts +19 -2
- package/lib/browser/util/tool.js +70 -2
- package/lib/browser/util/voice.d.ts +47 -7
- package/lib/browser/util/voice.js +269 -27
- package/lib/browser/workbench-calls.d.ts +6 -4
- package/lib/browser/workbench-calls.js +15 -10
- package/lib/browser/workbench-protocol.d.ts +31 -2
- package/lib/browser/workbench-util.d.ts +15 -4
- package/lib/browser/workbench-util.js +28 -5
- package/lib/browser/workbench.d.ts +33 -1
- package/lib/browser/workbench.js +140 -12
- package/package.json +11 -8
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import { TaSlashCommandUtil } from '@celljs/ta-protocol';
|
|
2
|
+
/** The commands that come with Ta outside any package, which Ta describes itself: pi's `mcp`, Ta's `bug`. */
|
|
3
|
+
const OWN_COMMANDS = new Map([
|
|
4
|
+
['mcp', 'ta.command.mcp'],
|
|
5
|
+
['bug', 'ta.command.bug'],
|
|
6
|
+
]);
|
|
1
7
|
/** What the models of pi read. */
|
|
2
8
|
export const IMAGE_TYPES = ['image/png', 'image/jpeg', 'image/gif', 'image/webp'];
|
|
3
9
|
export const MAX_IMAGE_BYTES = 5 * 1024 * 1024;
|
|
@@ -7,6 +13,16 @@ const COMMAND_TOKEN = /^\/(\S*)$/;
|
|
|
7
13
|
/** The logic of the message box, apart from React: what a key does, what the caret is on, what is sent. */
|
|
8
14
|
export var ComposerUtil;
|
|
9
15
|
(function (ComposerUtil) {
|
|
16
|
+
/**
|
|
17
|
+
* What the `/` menu says of a command, in the language of the page: what its package says in it
|
|
18
|
+
* (TaSlashCommand.descriptions), Ta's own words for those that come with it outside a package, else pi's.
|
|
19
|
+
*/
|
|
20
|
+
function commandDescription(command, language, t) {
|
|
21
|
+
const { source } = command.sourceInfo;
|
|
22
|
+
const own = source === 'builtin' || source === 'inline' ? OWN_COMMANDS.get(command.name) : undefined;
|
|
23
|
+
return own ? t(own) : TaSlashCommandUtil.description(command, language);
|
|
24
|
+
}
|
|
25
|
+
ComposerUtil.commandDescription = commandDescription;
|
|
10
26
|
function trigger(text, caret) {
|
|
11
27
|
const before = text.slice(0, caret);
|
|
12
28
|
const command = COMMAND_TOKEN.exec(before);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** What Ta Desktop can do for the page beyond a tab of a browser. */
|
|
2
|
-
export type DesktopFeature = 'webview' | 'debugWebview' | 'showItemInFolder' | 'browserData';
|
|
2
|
+
export type DesktopFeature = 'webview' | 'debugWebview' | 'showItemInFolder' | 'browserData' | 'recentShots';
|
|
3
3
|
/** The file manager of the system, from Ta Desktop: {@link WebDesktop} of the extension API. */
|
|
4
4
|
export interface DesktopFileManager {
|
|
5
5
|
/** Node's `process.platform` of the machine: what the file manager is called there. */
|
|
@@ -26,6 +26,22 @@ export interface DesktopBrowserData {
|
|
|
26
26
|
import(profileId: string): Promise<DesktopBrowserImport | undefined>;
|
|
27
27
|
clear(): Promise<void>;
|
|
28
28
|
}
|
|
29
|
+
/** The latest screenshot of this computer, as Ta Desktop finds it (recent-shots.ts of apps/ta-desktop). */
|
|
30
|
+
export interface DesktopShot {
|
|
31
|
+
id: string;
|
|
32
|
+
/** When it was taken, in milliseconds since the epoch. */
|
|
33
|
+
takenAt: number;
|
|
34
|
+
/** A small picture of it, a data URL. */
|
|
35
|
+
thumbnail: string;
|
|
36
|
+
}
|
|
37
|
+
/** The screenshots of this computer: {@link RecentShots} of device/recent-shots.ts. */
|
|
38
|
+
export interface DesktopShots {
|
|
39
|
+
latest(): Promise<DesktopShot | undefined>;
|
|
40
|
+
/** The picture of a screenshot `latest` gave, a data URL; `undefined` once it is gone. */
|
|
41
|
+
read(id: string): Promise<string | undefined>;
|
|
42
|
+
/** Called when a screenshot may have been taken; returns what stops it. */
|
|
43
|
+
onChange(listener: () => void): () => void;
|
|
44
|
+
}
|
|
29
45
|
/** A command of the DevTools protocol to the page of a `<webview>` of this page, by its getWebContentsId(). */
|
|
30
46
|
export type DebugWebview = (webContentsId: number, method: string, params?: Record<string, unknown>) => Promise<unknown>;
|
|
31
47
|
/**
|
|
@@ -40,4 +56,6 @@ export declare namespace DesktopUtil {
|
|
|
40
56
|
function browserData(scope?: object): DesktopBrowserData | undefined;
|
|
41
57
|
/** `debugWebview` of Ta Desktop; `undefined` elsewhere. */
|
|
42
58
|
function debugWebview(scope?: object): DebugWebview | undefined;
|
|
59
|
+
/** The screenshots of this computer, where Ta Desktop finds them. */
|
|
60
|
+
function recentShots(scope?: object): DesktopShots | undefined;
|
|
43
61
|
}
|
|
@@ -51,5 +51,20 @@ export var DesktopUtil;
|
|
|
51
51
|
return has('debugWebview', scope) && typeof debug === 'function' ? (webContentsId, method, params) => debug(webContentsId, method, params) : undefined;
|
|
52
52
|
}
|
|
53
53
|
DesktopUtil.debugWebview = debugWebview;
|
|
54
|
+
/** The screenshots of this computer, where Ta Desktop finds them. */
|
|
55
|
+
function recentShots(scope = globalThis) {
|
|
56
|
+
var _a;
|
|
57
|
+
const shots = (_a = scope.taDesktop) === null || _a === void 0 ? void 0 : _a.recentShots;
|
|
58
|
+
const { latest, read, onChange } = shots !== null && shots !== void 0 ? shots : {};
|
|
59
|
+
if (!has('recentShots', scope) || typeof latest !== 'function' || typeof read !== 'function' || typeof onChange !== 'function') {
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
return Object.freeze({
|
|
63
|
+
latest: async () => { var _a; return (_a = (await latest())) !== null && _a !== void 0 ? _a : undefined; },
|
|
64
|
+
read: async (id) => { var _a; return (_a = (await read(id))) !== null && _a !== void 0 ? _a : undefined; },
|
|
65
|
+
onChange: (listener) => onChange(listener),
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
DesktopUtil.recentShots = recentShots;
|
|
54
69
|
})(DesktopUtil || (DesktopUtil = {}));
|
|
55
70
|
//# sourceMappingURL=desktop.js.map
|
|
@@ -4,6 +4,8 @@ export interface FrameScheduler {
|
|
|
4
4
|
cancel(handle: number): void;
|
|
5
5
|
}
|
|
6
6
|
export declare namespace FrameUtil {
|
|
7
|
+
/** requestAnimationFrame, or a timer of one frame where there is none. */
|
|
8
|
+
const animation: FrameScheduler;
|
|
7
9
|
/**
|
|
8
10
|
* The listener, called at most once a frame however often the returned function is: a store that
|
|
9
11
|
* changes many times between two frames costs one render. `cancel` drops a call not made yet.
|
|
@@ -4,6 +4,8 @@ const ANIMATION_FRAME = typeof requestAnimationFrame === 'function'
|
|
|
4
4
|
: { request: callback => setTimeout(callback, 16), cancel: handle => clearTimeout(handle) };
|
|
5
5
|
export var FrameUtil;
|
|
6
6
|
(function (FrameUtil) {
|
|
7
|
+
/** requestAnimationFrame, or a timer of one frame where there is none. */
|
|
8
|
+
FrameUtil.animation = ANIMATION_FRAME;
|
|
7
9
|
/**
|
|
8
10
|
* The listener, called at most once a frame however often the returned function is: a store that
|
|
9
11
|
* changes many times between two frames costs one render. `cancel` drops a call not made yet.
|
|
@@ -24,6 +24,10 @@ export type LinkTarget = {
|
|
|
24
24
|
export declare namespace LinkUtil {
|
|
25
25
|
/** The target of `[text](target)` or of a URL in the text; undefined for what is no link. */
|
|
26
26
|
function parse(target: string): LinkTarget | undefined;
|
|
27
|
+
/** `~/…` of a path in the home directory `home` of the machine of ta serve; any other path, or no home, as it is. */
|
|
28
|
+
function expandHome(path: string, home: string | undefined): string;
|
|
29
|
+
/** A session file of pi, `…/sessions/<directory>/<file>.jsonl`: a link to it is a link to its conversation. */
|
|
30
|
+
function isSessionFile(path: string): boolean;
|
|
27
31
|
/**
|
|
28
32
|
* A code span that names a file or a directory, as models write them: `src/app.ts:12`, `package.json`,
|
|
29
33
|
* `docs/`. Not `console.log`, `text/html` or `@celljs/core`: a name needs an extension, and alone one
|
|
@@ -37,6 +41,20 @@ export declare namespace LinkUtil {
|
|
|
37
41
|
cwd: string;
|
|
38
42
|
path: string;
|
|
39
43
|
};
|
|
44
|
+
/** The absolute paths written in `text`, first to last, without the dots that end a sentence. */
|
|
45
|
+
function absolutePaths(text: string): string[];
|
|
46
|
+
/**
|
|
47
|
+
* Where else a relative `path` of a reply may be than in `cwd`, the directory of its conversation, when
|
|
48
|
+
* the agent worked elsewhere (a git worktree of the repository, a folder beside it): from `paths`, the
|
|
49
|
+
* absolute paths its tools named, latest first. `named`: the directories in which one of them is that
|
|
50
|
+
* path, or is in it (`/wt` for `docs/a.md` once `/wt/docs/a.md` was edited), before `cwd`; `nearby`:
|
|
51
|
+
* the others and their directories, then those above them, after it. None for an absolute path or one
|
|
52
|
+
* that goes up (`../`).
|
|
53
|
+
*/
|
|
54
|
+
function places(path: string, cwd: string, paths: readonly string[]): {
|
|
55
|
+
named: string[];
|
|
56
|
+
nearby: string[];
|
|
57
|
+
};
|
|
40
58
|
/** `a/./b/../c/` as `a/c`; an absolute path stays absolute. */
|
|
41
59
|
function normalize(path: string): string;
|
|
42
60
|
function join(dir: string, path: string): string;
|
package/esm/browser/util/link.js
CHANGED
|
@@ -12,8 +12,12 @@ const BARE_URL = /^https?:\/\/[!#-&(-;=?-[\]_a-z~]+/i;
|
|
|
12
12
|
* Not `env` or `c`: `process.env` and `a.b.c` are code.
|
|
13
13
|
*/
|
|
14
14
|
const COMMON_EXTENSIONS = new Set('ts tsx mts cts js jsx mjs cjs json jsonc md mdx yml yaml toml ini lock py rb go rs java kt kts swift cc cpp hpp cs php sh bash zsh css scss less html htm vue svelte sql xml gradle txt csv svg'.split(' '));
|
|
15
|
-
const CODE_PATH = /^(
|
|
15
|
+
const CODE_PATH = /^(?:~\/|\.{1,2}\/|\/)?(?:[\w@+-][\w@.+-]*\/)*[\w@+-][\w@.+-]*\/?$/;
|
|
16
16
|
const LOOPBACK = /^(localhost|.+\.localhost|127(\.\d{1,3}){3}|\[::1\]|0\.0\.0\.0)$/;
|
|
17
|
+
/** An absolute path of two names or more in running text (a command, an argument of a tool); not the `//` of a URL. */
|
|
18
|
+
const ABSOLUTE_PATH = /(?:^|[\s'"`=(,[])(\/[\p{L}\p{N}_@.+%~-]+(?:\/[\p{L}\p{N}_@.+%~-]+)+)/gu;
|
|
19
|
+
/** Directories to look in that the conversation only worked near: one reading each, at once. */
|
|
20
|
+
const NEARBY_LIMIT = 24;
|
|
17
21
|
/**
|
|
18
22
|
* Links of replies, read as VS Code reads them in its chat: http(s) URLs, and paths of files and
|
|
19
23
|
* directories with the lines they point to. Every other scheme (`javascript:`, `data:`, `command:`…)
|
|
@@ -69,6 +73,19 @@ export var LinkUtil;
|
|
|
69
73
|
return { type: 'path', path: directory ? path.replace(/\/+$/, '') : path, ...(selection && { selection }), ...(directory && { directory }) };
|
|
70
74
|
}
|
|
71
75
|
LinkUtil.parse = parse;
|
|
76
|
+
/** `~/…` of a path in the home directory `home` of the machine of ta serve; any other path, or no home, as it is. */
|
|
77
|
+
function expandHome(path, home) {
|
|
78
|
+
if (!home || !(path === '~' || path.startsWith('~/'))) {
|
|
79
|
+
return path;
|
|
80
|
+
}
|
|
81
|
+
return `${home.replace(/\/+$/, '')}${path.slice(1)}`;
|
|
82
|
+
}
|
|
83
|
+
LinkUtil.expandHome = expandHome;
|
|
84
|
+
/** A session file of pi, `…/sessions/<directory>/<file>.jsonl`: a link to it is a link to its conversation. */
|
|
85
|
+
function isSessionFile(path) {
|
|
86
|
+
return path.startsWith('/') && /\/sessions\/[^/]+\/[^/]+\.jsonl$/.test(path);
|
|
87
|
+
}
|
|
88
|
+
LinkUtil.isSessionFile = isSessionFile;
|
|
72
89
|
/**
|
|
73
90
|
* A code span that names a file or a directory, as models write them: `src/app.ts:12`, `package.json`,
|
|
74
91
|
* `docs/`. Not `console.log`, `text/html` or `@celljs/core`: a name needs an extension, and alone one
|
|
@@ -131,6 +148,54 @@ export var LinkUtil;
|
|
|
131
148
|
return { cwd: absolute.slice(0, slash) || '/', path: absolute.slice(slash + 1) };
|
|
132
149
|
}
|
|
133
150
|
LinkUtil.resolve = resolve;
|
|
151
|
+
/** The absolute paths written in `text`, first to last, without the dots that end a sentence. */
|
|
152
|
+
function absolutePaths(text) {
|
|
153
|
+
return [...text.matchAll(ABSOLUTE_PATH)].map(match => normalize(match[1].replace(/\.+$/, ''))).filter(path => path.includes('/', 1));
|
|
154
|
+
}
|
|
155
|
+
LinkUtil.absolutePaths = absolutePaths;
|
|
156
|
+
/**
|
|
157
|
+
* Where else a relative `path` of a reply may be than in `cwd`, the directory of its conversation, when
|
|
158
|
+
* the agent worked elsewhere (a git worktree of the repository, a folder beside it): from `paths`, the
|
|
159
|
+
* absolute paths its tools named, latest first. `named`: the directories in which one of them is that
|
|
160
|
+
* path, or is in it (`/wt` for `docs/a.md` once `/wt/docs/a.md` was edited), before `cwd`; `nearby`:
|
|
161
|
+
* the others and their directories, then those above them, after it. None for an absolute path or one
|
|
162
|
+
* that goes up (`../`).
|
|
163
|
+
*/
|
|
164
|
+
function places(path, cwd, paths) {
|
|
165
|
+
const relative = normalize(path);
|
|
166
|
+
if (!relative || path.startsWith('/') || path.startsWith('../') || cwd.includes('\\') || path.includes('\\')) {
|
|
167
|
+
return { named: [], nearby: [] };
|
|
168
|
+
}
|
|
169
|
+
const seen = new Set([normalize(cwd)]);
|
|
170
|
+
const add = (list, dir, limit = Number.POSITIVE_INFINITY) => {
|
|
171
|
+
if (list.length < limit && dir !== '/' && !seen.has(dir)) {
|
|
172
|
+
seen.add(dir);
|
|
173
|
+
list.push(dir);
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
const named = [];
|
|
177
|
+
for (const full of paths) {
|
|
178
|
+
for (let at = full.indexOf(`/${relative}`); at >= 0; at = full.indexOf(`/${relative}`, at + 1)) {
|
|
179
|
+
const end = full[at + relative.length + 1];
|
|
180
|
+
if (end === undefined || end === '/') {
|
|
181
|
+
add(named, full.slice(0, at) || '/');
|
|
182
|
+
break;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
const nearby = [];
|
|
187
|
+
for (const full of paths) {
|
|
188
|
+
add(nearby, full, NEARBY_LIMIT);
|
|
189
|
+
add(nearby, dirname(full), NEARBY_LIMIT);
|
|
190
|
+
}
|
|
191
|
+
for (const full of paths) {
|
|
192
|
+
for (let dir = dirname(dirname(full)); dir; dir = dirname(dir)) {
|
|
193
|
+
add(nearby, dir, NEARBY_LIMIT);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
return { named, nearby };
|
|
197
|
+
}
|
|
198
|
+
LinkUtil.places = places;
|
|
134
199
|
/** `a/./b/../c/` as `a/c`; an absolute path stays absolute. */
|
|
135
200
|
function normalize(path) {
|
|
136
201
|
const parts = [];
|
|
@@ -6,10 +6,13 @@ export type MarkdownBlock = {
|
|
|
6
6
|
type: 'heading';
|
|
7
7
|
level: number;
|
|
8
8
|
text: string;
|
|
9
|
-
}
|
|
9
|
+
}
|
|
10
|
+
/** Not `closed` while a reply streams it. */
|
|
11
|
+
| {
|
|
10
12
|
type: 'code';
|
|
11
13
|
language: string;
|
|
12
14
|
code: string;
|
|
15
|
+
closed: boolean;
|
|
13
16
|
} | {
|
|
14
17
|
type: 'quote';
|
|
15
18
|
text: string;
|
|
@@ -85,7 +85,7 @@ export var MarkdownUtil;
|
|
|
85
85
|
blocks.push({ type: 'math', tex: code.join('\n'), closed: i < lines.length });
|
|
86
86
|
}
|
|
87
87
|
else {
|
|
88
|
-
blocks.push({ type: 'code', language: fence[2], code: code.join('\n') });
|
|
88
|
+
blocks.push({ type: 'code', language: fence[2], code: code.join('\n'), closed: i < lines.length });
|
|
89
89
|
}
|
|
90
90
|
continue;
|
|
91
91
|
}
|
|
@@ -48,6 +48,11 @@ export declare namespace MessageUtil {
|
|
|
48
48
|
function stopReason(message: unknown): string | undefined;
|
|
49
49
|
function blocks(message: SessionMessage): ContentBlock[];
|
|
50
50
|
function text(content: ContentBlock[] | string | undefined): string;
|
|
51
|
+
/**
|
|
52
|
+
* The absolute paths the tool calls of `messages` named (in their arguments: a file, a command's `cd`),
|
|
53
|
+
* latest first, at most `limit`: where the agent worked, for the links of its replies (LinkUtil.places).
|
|
54
|
+
*/
|
|
55
|
+
function namedPaths(messages: readonly SessionMessage[], limit?: number): string[];
|
|
51
56
|
/** The tool result messages of a conversation by tool call id: shown with their calls. */
|
|
52
57
|
function results(messages: SessionMessage[]): Map<string, ToolOutput>;
|
|
53
58
|
/** The live run wins over the message: it has the partial results and the diffs of nested calls. */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TaLocation } from '@celljs/ta-protocol';
|
|
2
|
+
import { LinkUtil } from './link.js';
|
|
2
3
|
const SCRIPT_HEADER = /^Script (completed|failed)\nWall time [\d.]+ seconds\nOutput:\n/;
|
|
3
4
|
/** What a fetch or a provider says when it was stopped with its abort signal (DOMException AbortError). */
|
|
4
5
|
const ABORTED = /^(this|the) operation was aborted\.?$|^(request )?aborted\.?$/i;
|
|
@@ -40,6 +41,35 @@ export var MessageUtil;
|
|
|
40
41
|
.join('\n');
|
|
41
42
|
}
|
|
42
43
|
MessageUtil.text = text;
|
|
44
|
+
/**
|
|
45
|
+
* The absolute paths the tool calls of `messages` named (in their arguments: a file, a command's `cd`),
|
|
46
|
+
* latest first, at most `limit`: where the agent worked, for the links of its replies (LinkUtil.places).
|
|
47
|
+
*/
|
|
48
|
+
function namedPaths(messages, limit = 200) {
|
|
49
|
+
const paths = new Set();
|
|
50
|
+
for (let index = messages.length - 1; index >= 0 && paths.size < limit; index--) {
|
|
51
|
+
if (messages[index].role !== 'assistant') {
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
const calls = blocks(messages[index]).filter(block => block.type === 'toolCall');
|
|
55
|
+
for (let call = calls.length - 1; call >= 0; call--) {
|
|
56
|
+
for (const path of strings(calls[call].arguments).flatMap(LinkUtil.absolutePaths).reverse()) {
|
|
57
|
+
paths.add(path);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return [...paths].slice(0, limit);
|
|
62
|
+
}
|
|
63
|
+
MessageUtil.namedPaths = namedPaths;
|
|
64
|
+
function strings(value) {
|
|
65
|
+
if (typeof value === 'string') {
|
|
66
|
+
return [value];
|
|
67
|
+
}
|
|
68
|
+
if (value && typeof value === 'object') {
|
|
69
|
+
return Object.values(value).flatMap(strings);
|
|
70
|
+
}
|
|
71
|
+
return [];
|
|
72
|
+
}
|
|
43
73
|
/** The tool result messages of a conversation by tool call id: shown with their calls. */
|
|
44
74
|
function results(messages) {
|
|
45
75
|
const results = new Map();
|
|
@@ -20,7 +20,18 @@ export type ProcessStep = {
|
|
|
20
20
|
kind: 'tool';
|
|
21
21
|
key: string;
|
|
22
22
|
call: ContentBlock;
|
|
23
|
+
}
|
|
24
|
+
/** A request that failed on the way, which the work went on after (pi retried it, or the user said to go on). */
|
|
25
|
+
| {
|
|
26
|
+
kind: 'error';
|
|
27
|
+
key: string;
|
|
28
|
+
text: string;
|
|
23
29
|
};
|
|
30
|
+
/**
|
|
31
|
+
* How a turn that is over ended, when not with a reply: an error, stopped by the user, cut off in the middle of
|
|
32
|
+
* its work (the service stopped, the agent ended its turn with calls not done), or without a word after its work.
|
|
33
|
+
*/
|
|
34
|
+
export type TurnEnding = 'error' | 'aborted' | 'interrupted' | 'silent';
|
|
24
35
|
/** A message shown as it is: from the user, a `!command`, a message of an extension, a summary. */
|
|
25
36
|
export interface MessageItem {
|
|
26
37
|
kind: 'message';
|
|
@@ -37,7 +48,7 @@ export interface TurnItem {
|
|
|
37
48
|
/** The messages it is made of; the same objects while they do not change. */
|
|
38
49
|
messages: SessionMessage[];
|
|
39
50
|
steps: ProcessStep[];
|
|
40
|
-
/** The text at the end, after the last tool call. */
|
|
51
|
+
/** The text at the end, after the last tool call; while active and after steps, it is still among them. */
|
|
41
52
|
reply: string[];
|
|
42
53
|
/** The last assistant message: its stop reason and error. */
|
|
43
54
|
last?: SessionMessage;
|
|
@@ -58,9 +69,21 @@ export declare namespace ProcessUtil {
|
|
|
58
69
|
* The items of the conversation. While the agent works and has not answered yet, its turn is there
|
|
59
70
|
* already, empty, with the key the turn will have: the head drawn while it waits is the one its answer
|
|
60
71
|
* fills, not another put in its place. `offset`: where `messages` start in the conversation, so that
|
|
61
|
-
* the keys stay as earlier messages come in front.
|
|
72
|
+
* the keys stay as earlier messages come in front. A message not shown (see `hidden`) in the middle of
|
|
73
|
+
* the work stays in its turn: an external agent that goes on on its own, with the files it changed
|
|
74
|
+
* noted between, reads as one turn, not as a turn for each time it went on.
|
|
62
75
|
*/
|
|
63
|
-
function items(messages: SessionMessage[], working: boolean, offset?: number): ThreadItem[];
|
|
76
|
+
function items(messages: SessionMessage[], working: boolean, offset?: number, renderers?: Readonly<Record<string, unknown>>): ThreadItem[];
|
|
77
|
+
/**
|
|
78
|
+
* Words on the way with a fenced block a web extension draws (WebExtensionAPI.registerCodeRenderer,
|
|
79
|
+
* `renderers` by language in lower case): a card for the user, as a choice to make, stays in sight when
|
|
80
|
+
* the steps fold.
|
|
81
|
+
*/
|
|
82
|
+
function pinned(step: ProcessStep, renderers: Readonly<Record<string, unknown>>): step is Extract<ProcessStep, {
|
|
83
|
+
kind: 'text';
|
|
84
|
+
}>;
|
|
85
|
+
/** How `item` ended, when it is over and did not end with a reply. */
|
|
86
|
+
function ending(item: TurnItem): TurnEnding | undefined;
|
|
64
87
|
/** The tool calls: what "N steps" counts. */
|
|
65
88
|
function tools(steps: ProcessStep[]): ContentBlock[];
|
|
66
89
|
/** The steps shown: all of them, or while it works the latest few when more than two would fold. */
|
|
@@ -84,12 +107,43 @@ export declare namespace ProcessUtil {
|
|
|
84
107
|
* false), unless a web extension registered a renderer for its type (`renderers`).
|
|
85
108
|
*/
|
|
86
109
|
function shown(item: ThreadItem, renderers: Readonly<Record<string, unknown>>): boolean;
|
|
110
|
+
/** A custom message the page draws nothing for: `display` false and no renderer of a web extension for its type. */
|
|
111
|
+
function hidden(message: SessionMessage, renderers: Readonly<Record<string, unknown>>): boolean;
|
|
87
112
|
/**
|
|
88
113
|
* The time to show above each item, as WeChat does between messages: above the first item with a time,
|
|
89
114
|
* and above one that began `TIME_BREAK_MS` or more after the one shown before it; else undefined. An
|
|
90
115
|
* item not `shown` has none and is not the one before: two times would else stand one on the other.
|
|
91
116
|
*/
|
|
92
117
|
function timeBreaks(starts: number[], shown?: (index: number) => boolean): (number | undefined)[];
|
|
118
|
+
/** The model that wrote an assistant message, as `provider/id`. */
|
|
119
|
+
function modelOf(message: SessionMessage | undefined): string | undefined;
|
|
120
|
+
/**
|
|
121
|
+
* Where the conversation goes on with another model, as Amp marks it: above each turn whose model is not
|
|
122
|
+
* the one of the turn with a model before it, that model; else undefined. The first turn shown has none,
|
|
123
|
+
* whatever came before it.
|
|
124
|
+
*/
|
|
125
|
+
function modelBreaks(items: ThreadItem[]): (string | undefined)[];
|
|
93
126
|
/** The two items show the same: their messages are the same objects, and so is whether it works. */
|
|
94
127
|
function same(a: ThreadItem, b: ThreadItem): boolean;
|
|
95
128
|
}
|
|
129
|
+
/**
|
|
130
|
+
* Which rows of a conversation came in after it was drawn (they come in with a motion): those after the row that was
|
|
131
|
+
* last when it was drawn, by key. Rows put in front (earlier messages, more of the row window) move the indexes of all
|
|
132
|
+
* rows, not which are new; more than MAX at the end at once, or the row they count from gone (a rewind), start again
|
|
133
|
+
* from the end.
|
|
134
|
+
*/
|
|
135
|
+
export declare class FreshRows {
|
|
136
|
+
/** More rows than this at the end at once: the conversation loaded again, not messages that came in. */
|
|
137
|
+
static readonly MAX = 2;
|
|
138
|
+
private still;
|
|
139
|
+
private last;
|
|
140
|
+
constructor(items: readonly {
|
|
141
|
+
key: string;
|
|
142
|
+
}[]);
|
|
143
|
+
/** From which index `items` (as drawn now) came in after the list was drawn. */
|
|
144
|
+
from(items: readonly {
|
|
145
|
+
key: string;
|
|
146
|
+
}[]): number;
|
|
147
|
+
/** Searched from the end, where new rows are. */
|
|
148
|
+
private static lastIndexOf;
|
|
149
|
+
}
|
|
@@ -15,9 +15,11 @@ export var ProcessUtil;
|
|
|
15
15
|
* The items of the conversation. While the agent works and has not answered yet, its turn is there
|
|
16
16
|
* already, empty, with the key the turn will have: the head drawn while it waits is the one its answer
|
|
17
17
|
* fills, not another put in its place. `offset`: where `messages` start in the conversation, so that
|
|
18
|
-
* the keys stay as earlier messages come in front.
|
|
18
|
+
* the keys stay as earlier messages come in front. A message not shown (see `hidden`) in the middle of
|
|
19
|
+
* the work stays in its turn: an external agent that goes on on its own, with the files it changed
|
|
20
|
+
* noted between, reads as one turn, not as a turn for each time it went on.
|
|
19
21
|
*/
|
|
20
|
-
function items(messages, working, offset = 0) {
|
|
22
|
+
function items(messages, working, offset = 0, renderers = {}) {
|
|
21
23
|
var _a;
|
|
22
24
|
const items = [];
|
|
23
25
|
let index = 0;
|
|
@@ -29,7 +31,7 @@ export var ProcessUtil;
|
|
|
29
31
|
continue;
|
|
30
32
|
}
|
|
31
33
|
const start = index;
|
|
32
|
-
while (index < messages.length && TURN_ROLES.has(messages[index].role)) {
|
|
34
|
+
while (index < messages.length && (TURN_ROLES.has(messages[index].role) || hidden(messages[index], renderers))) {
|
|
33
35
|
index++;
|
|
34
36
|
}
|
|
35
37
|
items.push(turn(messages.slice(start, index), offset + start, working && index === messages.length));
|
|
@@ -43,11 +45,20 @@ export var ProcessUtil;
|
|
|
43
45
|
function turn(messages, start, active) {
|
|
44
46
|
const steps = [];
|
|
45
47
|
let last;
|
|
48
|
+
let final = messages.length - 1;
|
|
49
|
+
while (final >= 0 && messages[final].role !== 'assistant') {
|
|
50
|
+
final--;
|
|
51
|
+
}
|
|
46
52
|
messages.forEach((message, offset) => {
|
|
53
|
+
var _a;
|
|
47
54
|
if (message.role !== 'assistant') {
|
|
48
55
|
return;
|
|
49
56
|
}
|
|
50
57
|
last = message;
|
|
58
|
+
const { errorMessage } = message;
|
|
59
|
+
if (offset !== final && MessageUtil.stopReason(message) === 'error') {
|
|
60
|
+
steps.push({ kind: 'error', key: `${start + offset}.e`, text: (_a = errorMessage === null || errorMessage === void 0 ? void 0 : errorMessage.trim()) !== null && _a !== void 0 ? _a : '' });
|
|
61
|
+
}
|
|
51
62
|
MessageUtil.blocks(message).forEach((block, position) => {
|
|
52
63
|
var _a, _b;
|
|
53
64
|
const key = `${start + offset}.${position}`;
|
|
@@ -67,9 +78,46 @@ export var ProcessUtil;
|
|
|
67
78
|
while (end > 0 && steps[end - 1].kind === 'text') {
|
|
68
79
|
end--;
|
|
69
80
|
}
|
|
81
|
+
// While ta works after steps, what it says is one more step: a tool may follow it. The reply is what it ends with.
|
|
82
|
+
if (active && end > 0) {
|
|
83
|
+
end = steps.length;
|
|
84
|
+
}
|
|
70
85
|
const reply = steps.slice(end).map(step => (step.kind === 'text' ? step.text : ''));
|
|
71
86
|
return { kind: 'turn', key: `t${start}`, messages, steps: steps.slice(0, end), reply, last, active };
|
|
72
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* Words on the way with a fenced block a web extension draws (WebExtensionAPI.registerCodeRenderer,
|
|
90
|
+
* `renderers` by language in lower case): a card for the user, as a choice to make, stays in sight when
|
|
91
|
+
* the steps fold.
|
|
92
|
+
*/
|
|
93
|
+
function pinned(step, renderers) {
|
|
94
|
+
if (step.kind !== 'text') {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
for (const [, language] of step.text.matchAll(/^ {0,3}(?:`{3,}|~{3,})[ \t]*([^\s`{]+)/gm)) {
|
|
98
|
+
if (renderers[language.toLowerCase()] !== undefined) {
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
ProcessUtil.pinned = pinned;
|
|
105
|
+
/** How `item` ended, when it is over and did not end with a reply. */
|
|
106
|
+
function ending(item) {
|
|
107
|
+
if (item.active) {
|
|
108
|
+
return undefined;
|
|
109
|
+
}
|
|
110
|
+
const stopReason = MessageUtil.stopReason(item.last);
|
|
111
|
+
if (stopReason === 'error' || stopReason === 'aborted') {
|
|
112
|
+
return stopReason;
|
|
113
|
+
}
|
|
114
|
+
const roles = item.messages.map(message => message.role).filter(role => TURN_ROLES.has(role));
|
|
115
|
+
if (roles[roles.length - 1] === 'toolResult' || stopReason === 'toolUse') {
|
|
116
|
+
return 'interrupted';
|
|
117
|
+
}
|
|
118
|
+
return item.last && !item.reply.some(text => text.trim()) ? 'silent' : undefined;
|
|
119
|
+
}
|
|
120
|
+
ProcessUtil.ending = ending;
|
|
73
121
|
/** The tool calls: what "N steps" counts. */
|
|
74
122
|
function tools(steps) {
|
|
75
123
|
return steps.flatMap(step => (step.kind === 'tool' ? [step.call] : []));
|
|
@@ -120,11 +168,11 @@ export var ProcessUtil;
|
|
|
120
168
|
const phase = ProcessUtil.phase(item.messages);
|
|
121
169
|
return phase === 'thinking' ? 'thinking' : phase === 'writing' ? 'speaking' : 'working';
|
|
122
170
|
}
|
|
123
|
-
const
|
|
124
|
-
if (
|
|
171
|
+
const ended = ending(item);
|
|
172
|
+
if (ended === 'error' || ended === 'interrupted' || ended === 'silent') {
|
|
125
173
|
return 'attention';
|
|
126
174
|
}
|
|
127
|
-
return last &&
|
|
175
|
+
return last && ended !== 'aborted' ? 'done' : 'idle';
|
|
128
176
|
}
|
|
129
177
|
ProcessUtil.mood = mood;
|
|
130
178
|
/** When each item began: its first message; one still empty (a turn about to come), when the one before did. */
|
|
@@ -143,13 +191,15 @@ export var ProcessUtil;
|
|
|
143
191
|
* false), unless a web extension registered a renderer for its type (`renderers`).
|
|
144
192
|
*/
|
|
145
193
|
function shown(item, renderers) {
|
|
146
|
-
|
|
147
|
-
return true;
|
|
148
|
-
}
|
|
149
|
-
const { display, customType } = item.message;
|
|
150
|
-
return !!display || (customType !== undefined && renderers[customType] !== undefined);
|
|
194
|
+
return item.kind === 'turn' || !hidden(item.message, renderers);
|
|
151
195
|
}
|
|
152
196
|
ProcessUtil.shown = shown;
|
|
197
|
+
/** A custom message the page draws nothing for: `display` false and no renderer of a web extension for its type. */
|
|
198
|
+
function hidden(message, renderers) {
|
|
199
|
+
const { role, display, customType } = message;
|
|
200
|
+
return role === 'custom' && !display && (customType === undefined || renderers[customType] === undefined);
|
|
201
|
+
}
|
|
202
|
+
ProcessUtil.hidden = hidden;
|
|
153
203
|
/**
|
|
154
204
|
* The time to show above each item, as WeChat does between messages: above the first item with a time,
|
|
155
205
|
* and above one that began `TIME_BREAK_MS` or more after the one shown before it; else undefined. An
|
|
@@ -167,6 +217,33 @@ export var ProcessUtil;
|
|
|
167
217
|
});
|
|
168
218
|
}
|
|
169
219
|
ProcessUtil.timeBreaks = timeBreaks;
|
|
220
|
+
/** The model that wrote an assistant message, as `provider/id`. */
|
|
221
|
+
function modelOf(message) {
|
|
222
|
+
const { role, provider, model } = (message !== null && message !== void 0 ? message : {});
|
|
223
|
+
if (role !== 'assistant' || !model) {
|
|
224
|
+
return undefined;
|
|
225
|
+
}
|
|
226
|
+
return provider ? `${provider}/${model}` : model;
|
|
227
|
+
}
|
|
228
|
+
ProcessUtil.modelOf = modelOf;
|
|
229
|
+
/**
|
|
230
|
+
* Where the conversation goes on with another model, as Amp marks it: above each turn whose model is not
|
|
231
|
+
* the one of the turn with a model before it, that model; else undefined. The first turn shown has none,
|
|
232
|
+
* whatever came before it.
|
|
233
|
+
*/
|
|
234
|
+
function modelBreaks(items) {
|
|
235
|
+
let before;
|
|
236
|
+
return items.map(item => {
|
|
237
|
+
if (item.kind !== 'turn') {
|
|
238
|
+
return undefined;
|
|
239
|
+
}
|
|
240
|
+
const model = item.messages.map(modelOf).find(Boolean);
|
|
241
|
+
const switched = model && before && model !== before ? model : undefined;
|
|
242
|
+
before = model !== null && model !== void 0 ? model : before;
|
|
243
|
+
return switched;
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
ProcessUtil.modelBreaks = modelBreaks;
|
|
170
247
|
/** The two items show the same: their messages are the same objects, and so is whether it works. */
|
|
171
248
|
function same(a, b) {
|
|
172
249
|
if (a.kind === 'message' || b.kind === 'message') {
|
|
@@ -176,4 +253,39 @@ export var ProcessUtil;
|
|
|
176
253
|
}
|
|
177
254
|
ProcessUtil.same = same;
|
|
178
255
|
})(ProcessUtil || (ProcessUtil = {}));
|
|
256
|
+
/**
|
|
257
|
+
* Which rows of a conversation came in after it was drawn (they come in with a motion): those after the row that was
|
|
258
|
+
* last when it was drawn, by key. Rows put in front (earlier messages, more of the row window) move the indexes of all
|
|
259
|
+
* rows, not which are new; more than MAX at the end at once, or the row they count from gone (a rewind), start again
|
|
260
|
+
* from the end.
|
|
261
|
+
*/
|
|
262
|
+
export class FreshRows {
|
|
263
|
+
constructor(items) {
|
|
264
|
+
var _a;
|
|
265
|
+
this.still = this.last = (_a = items.at(-1)) === null || _a === void 0 ? void 0 : _a.key;
|
|
266
|
+
}
|
|
267
|
+
/** From which index `items` (as drawn now) came in after the list was drawn. */
|
|
268
|
+
from(items) {
|
|
269
|
+
var _a;
|
|
270
|
+
const previous = FreshRows.lastIndexOf(items, this.last);
|
|
271
|
+
this.last = (_a = items.at(-1)) === null || _a === void 0 ? void 0 : _a.key;
|
|
272
|
+
let from = FreshRows.lastIndexOf(items, this.still);
|
|
273
|
+
if (previous < 0 || from < 0 || items.length - 1 - previous > FreshRows.MAX) {
|
|
274
|
+
this.still = this.last;
|
|
275
|
+
from = items.length - 1;
|
|
276
|
+
}
|
|
277
|
+
return from + 1;
|
|
278
|
+
}
|
|
279
|
+
/** Searched from the end, where new rows are. */
|
|
280
|
+
static lastIndexOf(items, key) {
|
|
281
|
+
for (let index = items.length - 1; index >= 0; index--) {
|
|
282
|
+
if (items[index].key === key) {
|
|
283
|
+
return index;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
return -1;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
/** More rows than this at the end at once: the conversation loaded again, not messages that came in. */
|
|
290
|
+
FreshRows.MAX = 2;
|
|
179
291
|
//# sourceMappingURL=process.js.map
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { SessionState } from '@celljs/ta-client';
|
|
2
|
+
import type { WebToolRendererResolver } from '../extension/web-extension-api.js';
|
|
3
|
+
import type { Translate } from '../i18n/use-t.js';
|
|
2
4
|
import { type ToolSummary } from './tool.js';
|
|
3
5
|
/** What ta does now, in a word or a line: what the loading line says. */
|
|
4
6
|
export type Phase = {
|
|
@@ -27,15 +29,31 @@ export type Phase = {
|
|
|
27
29
|
attempt: number;
|
|
28
30
|
maxAttempts: number;
|
|
29
31
|
seconds: number;
|
|
32
|
+
reason: RetryReason;
|
|
30
33
|
};
|
|
34
|
+
/** Why pi retries, read from the error of the provider: what the loading line says before its countdown. */
|
|
35
|
+
export type RetryReason = 'rateLimit' | 'overloaded' | 'network' | 'error';
|
|
31
36
|
/** Tokens of the run of now: sent to the model (each request counts its whole context) and received from it. */
|
|
32
37
|
export interface RunTokens {
|
|
33
38
|
input: number;
|
|
34
39
|
output: number;
|
|
35
40
|
}
|
|
36
41
|
export declare namespace ProgressUtil {
|
|
42
|
+
/**
|
|
43
|
+
* What a phase says, in one line: the loading line of a conversation and the line of a task that runs say the
|
|
44
|
+
* same. `working`: what an extension says it does (setWorkingMessage); `secondsLeft`: of a retry, counted down.
|
|
45
|
+
*/
|
|
46
|
+
function text(phase: Phase, t: Translate, options?: {
|
|
47
|
+
working?: string;
|
|
48
|
+
secondsLeft?: number;
|
|
49
|
+
renderers?: readonly WebToolRendererResolver[];
|
|
50
|
+
}): string;
|
|
37
51
|
/** What ta does now, the most pressing first: a question for the user, then pi's own work, then the model's. */
|
|
38
|
-
function phase(state: SessionState): Phase;
|
|
52
|
+
function phase(state: SessionState, renderers?: readonly WebToolRendererResolver[]): Phase;
|
|
53
|
+
/** Why a request failed, as the provider said it: a rate limit, a model too busy, the network, or another error. */
|
|
54
|
+
function retryReason(errorMessage: string | undefined): RetryReason;
|
|
55
|
+
/** The seconds left of a wait of `delayMs` that began at `since`, rounded up: 0 once it is over. */
|
|
56
|
+
function secondsLeft(delayMs: number, since: number, now: number): number;
|
|
39
57
|
/** Where the run of now starts: as the store saw it start, else after the last message of the user. */
|
|
40
58
|
function runStart(state: SessionState): number;
|
|
41
59
|
/**
|