@celljs/ta-web 0.0.0-stage → 4.6.1
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.md +83 -2
- package/esm/browser/assistant/assistant-export.d.ts +13 -0
- package/esm/browser/assistant/assistant-export.js +33 -0
- package/esm/browser/assistant/assistant-export.js.map +1 -0
- package/esm/browser/assistant/assistant-extension.d.ts +20 -0
- package/esm/browser/assistant/assistant-extension.js +153 -0
- package/esm/browser/assistant/assistant-extension.js.map +1 -0
- package/esm/browser/assistant/assistant-hooks.d.ts +8 -0
- package/esm/browser/assistant/assistant-hooks.js +55 -0
- package/esm/browser/assistant/assistant-hooks.js.map +1 -0
- package/esm/browser/assistant/assistant-protocol.d.ts +51 -0
- package/esm/browser/assistant/assistant-protocol.js +2 -0
- package/esm/browser/assistant/assistant-protocol.js.map +1 -0
- package/esm/browser/assistant/assistant-tasks.d.ts +48 -0
- package/esm/browser/assistant/assistant-tasks.js +115 -0
- package/esm/browser/assistant/assistant-tasks.js.map +1 -0
- package/esm/browser/assistant/assistant-view.d.ts +21 -0
- package/esm/browser/assistant/assistant-view.js +324 -0
- package/esm/browser/assistant/assistant-view.js.map +1 -0
- package/esm/browser/assistant/assistant.d.ts +51 -0
- package/esm/browser/assistant/assistant.js +302 -0
- package/esm/browser/assistant/assistant.js.map +1 -0
- package/esm/browser/assistant/voice.d.ts +14 -0
- package/esm/browser/assistant/voice.js +72 -0
- package/esm/browser/assistant/voice.js.map +1 -0
- package/esm/browser/avatar/dino-avatar.d.ts +139 -0
- package/esm/browser/avatar/dino-avatar.js +420 -0
- package/esm/browser/avatar/dino-avatar.js.map +1 -0
- package/esm/browser/avatar/dino-motion.d.ts +24 -0
- package/esm/browser/avatar/dino-motion.js +295 -0
- package/esm/browser/avatar/dino-motion.js.map +1 -0
- package/esm/browser/chat/chat-protocol.d.ts +46 -0
- package/esm/browser/chat/chat-protocol.js +2 -0
- package/esm/browser/chat/chat-protocol.js.map +1 -0
- package/esm/browser/chat/chat-view.d.ts +15 -0
- package/esm/browser/chat/chat-view.js +87 -0
- package/esm/browser/chat/chat-view.js.map +1 -0
- package/esm/browser/chat/chat.d.ts +69 -0
- package/esm/browser/chat/chat.js +343 -0
- package/esm/browser/chat/chat.js.map +1 -0
- package/esm/browser/components/account-menu.d.ts +8 -0
- package/esm/browser/components/account-menu.js +82 -0
- package/esm/browser/components/account-menu.js.map +1 -0
- package/esm/browser/components/agent-settings-view.d.ts +23 -0
- package/esm/browser/components/agent-settings-view.js +105 -0
- package/esm/browser/components/agent-settings-view.js.map +1 -0
- package/esm/browser/components/app-view.d.ts +9 -0
- package/esm/browser/components/app-view.js +405 -0
- package/esm/browser/components/app-view.js.map +1 -0
- package/esm/browser/components/auth-pictures.d.ts +6 -0
- package/esm/browser/components/auth-pictures.js +37 -0
- package/esm/browser/components/auth-pictures.js.map +1 -0
- package/esm/browser/components/auth-view.d.ts +54 -0
- package/esm/browser/components/auth-view.js +300 -0
- package/esm/browser/components/auth-view.js.map +1 -0
- package/esm/browser/components/callout.d.ts +18 -0
- package/esm/browser/components/callout.js +17 -0
- package/esm/browser/components/callout.js.map +1 -0
- package/esm/browser/components/chat-list.d.ts +52 -0
- package/esm/browser/components/chat-list.js +189 -0
- package/esm/browser/components/chat-list.js.map +1 -0
- package/esm/browser/components/code-editor.d.ts +7 -0
- package/esm/browser/components/code-editor.js +85 -0
- package/esm/browser/components/code-editor.js.map +1 -0
- package/esm/browser/components/composer-box.d.ts +73 -0
- package/esm/browser/components/composer-box.js +297 -0
- package/esm/browser/components/composer-box.js.map +1 -0
- package/esm/browser/components/composer-menu.d.ts +17 -0
- package/esm/browser/components/composer-menu.js +18 -0
- package/esm/browser/components/composer-menu.js.map +1 -0
- package/esm/browser/components/composer.d.ts +37 -0
- package/esm/browser/components/composer.js +99 -0
- package/esm/browser/components/composer.js.map +1 -0
- package/esm/browser/components/connection-bar.d.ts +6 -0
- package/esm/browser/components/connection-bar.js +73 -0
- package/esm/browser/components/connection-bar.js.map +1 -0
- package/esm/browser/components/context-menu.d.ts +12 -0
- package/esm/browser/components/context-menu.js +68 -0
- package/esm/browser/components/context-menu.js.map +1 -0
- package/esm/browser/components/conversation-scroll.d.ts +13 -0
- package/esm/browser/components/conversation-scroll.js +121 -0
- package/esm/browser/components/conversation-scroll.js.map +1 -0
- package/esm/browser/components/dialog-view.d.ts +9 -0
- package/esm/browser/components/dialog-view.js +41 -0
- package/esm/browser/components/dialog-view.js.map +1 -0
- package/esm/browser/components/diff-editor.d.ts +10 -0
- package/esm/browser/components/diff-editor.js +101 -0
- package/esm/browser/components/diff-editor.js.map +1 -0
- package/esm/browser/components/diff-view.d.ts +4 -0
- package/esm/browser/components/diff-view.js +11 -0
- package/esm/browser/components/diff-view.js.map +1 -0
- package/esm/browser/components/dino.d.ts +8 -0
- package/esm/browser/components/dino.js +14 -0
- package/esm/browser/components/dino.js.map +1 -0
- package/esm/browser/components/editor-area.d.ts +28 -0
- package/esm/browser/components/editor-area.js +134 -0
- package/esm/browser/components/editor-area.js.map +1 -0
- package/esm/browser/components/folder-picker.d.ts +28 -0
- package/esm/browser/components/folder-picker.js +106 -0
- package/esm/browser/components/folder-picker.js.map +1 -0
- package/esm/browser/components/fork-view.d.ts +14 -0
- package/esm/browser/components/fork-view.js +43 -0
- package/esm/browser/components/fork-view.js.map +1 -0
- package/esm/browser/components/hero-cards.d.ts +20 -0
- package/esm/browser/components/hero-cards.js +109 -0
- package/esm/browser/components/hero-cards.js.map +1 -0
- package/esm/browser/components/icon.d.ts +29 -0
- package/esm/browser/components/icon.js +23 -0
- package/esm/browser/components/icon.js.map +1 -0
- package/esm/browser/components/link-dialog.d.ts +3 -0
- package/esm/browser/components/link-dialog.js +45 -0
- package/esm/browser/components/link-dialog.js.map +1 -0
- package/esm/browser/components/link.d.ts +19 -0
- package/esm/browser/components/link.js +56 -0
- package/esm/browser/components/link.js.map +1 -0
- package/esm/browser/components/manage-menu.d.ts +13 -0
- package/esm/browser/components/manage-menu.js +96 -0
- package/esm/browser/components/manage-menu.js.map +1 -0
- package/esm/browser/components/markdown.d.ts +9 -0
- package/esm/browser/components/markdown.js +98 -0
- package/esm/browser/components/markdown.js.map +1 -0
- package/esm/browser/components/math.d.ts +10 -0
- package/esm/browser/components/math.js +21 -0
- package/esm/browser/components/math.js.map +1 -0
- package/esm/browser/components/media.d.ts +11 -0
- package/esm/browser/components/media.js +76 -0
- package/esm/browser/components/media.js.map +1 -0
- package/esm/browser/components/mermaid-view.d.ts +10 -0
- package/esm/browser/components/mermaid-view.js +84 -0
- package/esm/browser/components/mermaid-view.js.map +1 -0
- package/esm/browser/components/message-actions.d.ts +12 -0
- package/esm/browser/components/message-actions.js +78 -0
- package/esm/browser/components/message-actions.js.map +1 -0
- package/esm/browser/components/message-footer.d.ts +29 -0
- package/esm/browser/components/message-footer.js +86 -0
- package/esm/browser/components/message-footer.js.map +1 -0
- package/esm/browser/components/message-list.d.ts +37 -0
- package/esm/browser/components/message-list.js +216 -0
- package/esm/browser/components/message-list.js.map +1 -0
- package/esm/browser/components/notice-center.d.ts +3 -0
- package/esm/browser/components/notice-center.js +114 -0
- package/esm/browser/components/notice-center.js.map +1 -0
- package/esm/browser/components/relay-view.d.ts +5 -0
- package/esm/browser/components/relay-view.js +114 -0
- package/esm/browser/components/relay-view.js.map +1 -0
- package/esm/browser/components/run-status.d.ts +9 -0
- package/esm/browser/components/run-status.js +54 -0
- package/esm/browser/components/run-status.js.map +1 -0
- package/esm/browser/components/session-settings.d.ts +37 -0
- package/esm/browser/components/session-settings.js +84 -0
- package/esm/browser/components/session-settings.js.map +1 -0
- package/esm/browser/components/session-view.d.ts +24 -0
- package/esm/browser/components/session-view.js +84 -0
- package/esm/browser/components/session-view.js.map +1 -0
- package/esm/browser/components/settings-controls.d.ts +40 -0
- package/esm/browser/components/settings-controls.js +28 -0
- package/esm/browser/components/settings-controls.js.map +1 -0
- package/esm/browser/components/settings-view.d.ts +22 -0
- package/esm/browser/components/settings-view.js +357 -0
- package/esm/browser/components/settings-view.js.map +1 -0
- package/esm/browser/components/split-pane.d.ts +24 -0
- package/esm/browser/components/split-pane.js +75 -0
- package/esm/browser/components/split-pane.js.map +1 -0
- package/esm/browser/components/ta-avatar.d.ts +13 -0
- package/esm/browser/components/ta-avatar.js +185 -0
- package/esm/browser/components/ta-avatar.js.map +1 -0
- package/esm/browser/components/tool-view.d.ts +18 -0
- package/esm/browser/components/tool-view.js +110 -0
- package/esm/browser/components/tool-view.js.map +1 -0
- package/esm/browser/components/trusted-domains.d.ts +3 -0
- package/esm/browser/components/trusted-domains.js +39 -0
- package/esm/browser/components/trusted-domains.js.map +1 -0
- package/esm/browser/components/web-composer.d.ts +14 -0
- package/esm/browser/components/web-composer.js +22 -0
- package/esm/browser/components/web-composer.js.map +1 -0
- package/esm/browser/components/web-dialog.d.ts +4 -0
- package/esm/browser/components/web-dialog.js +22 -0
- package/esm/browser/components/web-dialog.js.map +1 -0
- package/esm/browser/components/workbench-toggle.d.ts +12 -0
- package/esm/browser/components/workbench-toggle.js +17 -0
- package/esm/browser/components/workbench-toggle.js.map +1 -0
- package/esm/browser/components/workbench-view.d.ts +8 -0
- package/esm/browser/components/workbench-view.js +62 -0
- package/esm/browser/components/workbench-view.js.map +1 -0
- package/esm/browser/components/working-directory.d.ts +5 -0
- package/esm/browser/components/working-directory.js +25 -0
- package/esm/browser/components/working-directory.js.map +1 -0
- package/esm/browser/editor/monaco-loader.d.ts +60 -0
- package/esm/browser/editor/monaco-loader.js +135 -0
- package/esm/browser/editor/monaco-loader.js.map +1 -0
- package/esm/browser/editor/monaco.d.ts +45 -0
- package/esm/browser/editor/monaco.js +54 -0
- package/esm/browser/editor/monaco.js.map +1 -0
- package/esm/browser/extension/extension-view.d.ts +35 -0
- package/esm/browser/extension/extension-view.js +53 -0
- package/esm/browser/extension/extension-view.js.map +1 -0
- package/esm/browser/extension/icons.d.ts +3 -0
- package/esm/browser/extension/icons.js +82 -0
- package/esm/browser/extension/icons.js.map +1 -0
- package/esm/browser/extension/web-extension-api.d.ts +362 -0
- package/esm/browser/extension/web-extension-api.js +2 -0
- package/esm/browser/extension/web-extension-api.js.map +1 -0
- package/esm/browser/extension/web-extension-protocol.d.ts +132 -0
- package/esm/browser/extension/web-extension-protocol.js +10 -0
- package/esm/browser/extension/web-extension-protocol.js.map +1 -0
- package/esm/browser/extension/web-extensions.d.ts +118 -0
- package/esm/browser/extension/web-extensions.js +654 -0
- package/esm/browser/extension/web-extensions.js.map +1 -0
- package/esm/browser/hooks.d.ts +21 -0
- package/esm/browser/hooks.js +65 -0
- package/esm/browser/hooks.js.map +1 -0
- package/esm/browser/i18n/locales.d.ts +435 -0
- package/esm/browser/i18n/locales.js +35 -0
- package/esm/browser/i18n/locales.js.map +1 -0
- package/esm/browser/i18n/messages.d.ts +427 -0
- package/esm/browser/i18n/messages.js +858 -0
- package/esm/browser/i18n/messages.js.map +1 -0
- package/esm/browser/i18n/use-t.d.ts +7 -0
- package/esm/browser/i18n/use-t.js +18 -0
- package/esm/browser/i18n/use-t.js.map +1 -0
- package/esm/browser/index.d.ts +52 -0
- package/esm/browser/index.js +53 -0
- package/esm/browser/index.js.map +1 -0
- package/esm/browser/links/links-protocol.d.ts +35 -0
- package/esm/browser/links/links-protocol.js +2 -0
- package/esm/browser/links/links-protocol.js.map +1 -0
- package/esm/browser/links/links.d.ts +32 -0
- package/esm/browser/links/links.js +141 -0
- package/esm/browser/links/links.js.map +1 -0
- package/esm/browser/markdown/hooks.d.ts +6 -0
- package/esm/browser/markdown/hooks.js +21 -0
- package/esm/browser/markdown/hooks.js.map +1 -0
- package/esm/browser/markdown/lazy.d.ts +21 -0
- package/esm/browser/markdown/lazy.js +39 -0
- package/esm/browser/markdown/lazy.js.map +1 -0
- package/esm/browser/markdown/math.d.ts +18 -0
- package/esm/browser/markdown/math.js +30 -0
- package/esm/browser/markdown/math.js.map +1 -0
- package/esm/browser/markdown/mermaid.d.ts +20 -0
- package/esm/browser/markdown/mermaid.js +84 -0
- package/esm/browser/markdown/mermaid.js.map +1 -0
- package/esm/browser/module.d.ts +4 -0
- package/esm/browser/module.js +6 -0
- package/esm/browser/module.js.map +1 -0
- package/esm/browser/notices/notices-protocol.d.ts +82 -0
- package/esm/browser/notices/notices-protocol.js +2 -0
- package/esm/browser/notices/notices-protocol.js.map +1 -0
- package/esm/browser/notices/notices.d.ts +47 -0
- package/esm/browser/notices/notices.js +162 -0
- package/esm/browser/notices/notices.js.map +1 -0
- package/esm/browser/pwa/pwa-protocol.d.ts +20 -0
- package/esm/browser/pwa/pwa-protocol.js +2 -0
- package/esm/browser/pwa/pwa-protocol.js.map +1 -0
- package/esm/browser/pwa/pwa.d.ts +39 -0
- package/esm/browser/pwa/pwa.js +120 -0
- package/esm/browser/pwa/pwa.js.map +1 -0
- package/esm/browser/settings/agent-settings.d.ts +33 -0
- package/esm/browser/settings/agent-settings.js +85 -0
- package/esm/browser/settings/agent-settings.js.map +1 -0
- package/esm/browser/settings/settings-protocol.d.ts +44 -0
- package/esm/browser/settings/settings-protocol.js +35 -0
- package/esm/browser/settings/settings-protocol.js.map +1 -0
- package/esm/browser/settings/settings.d.ts +31 -0
- package/esm/browser/settings/settings.js +102 -0
- package/esm/browser/settings/settings.js.map +1 -0
- package/esm/browser/state/state-protocol.d.ts +48 -0
- package/esm/browser/state/state-protocol.js +32 -0
- package/esm/browser/state/state-protocol.js.map +1 -0
- package/esm/browser/state/state.d.ts +39 -0
- package/esm/browser/state/state.js +210 -0
- package/esm/browser/state/state.js.map +1 -0
- package/esm/browser/style/base.d.ts +2 -0
- package/esm/browser/style/base.js +140 -0
- package/esm/browser/style/base.js.map +1 -0
- package/esm/browser/style/conversation.d.ts +2 -0
- package/esm/browser/style/conversation.js +201 -0
- package/esm/browser/style/conversation.js.map +1 -0
- package/esm/browser/style/layout.d.ts +2 -0
- package/esm/browser/style/layout.js +371 -0
- package/esm/browser/style/layout.js.map +1 -0
- package/esm/browser/style/pages.d.ts +2 -0
- package/esm/browser/style/pages.js +75 -0
- package/esm/browser/style/pages.js.map +1 -0
- package/esm/browser/style/shell.d.ts +2 -0
- package/esm/browser/style/shell.js +236 -0
- package/esm/browser/style/shell.js.map +1 -0
- package/esm/browser/style.d.ts +5 -0
- package/esm/browser/style.js +11 -0
- package/esm/browser/style.js.map +1 -0
- package/esm/browser/util/composer.d.ts +85 -0
- package/esm/browser/util/composer.js +121 -0
- package/esm/browser/util/composer.js.map +1 -0
- package/esm/browser/util/diff.d.ts +17 -0
- package/esm/browser/util/diff.js +29 -0
- package/esm/browser/util/diff.js.map +1 -0
- package/esm/browser/util/frame.d.ts +32 -0
- package/esm/browser/util/frame.js +47 -0
- package/esm/browser/util/frame.js.map +1 -0
- package/esm/browser/util/layout.d.ts +26 -0
- package/esm/browser/util/layout.js +54 -0
- package/esm/browser/util/layout.js.map +1 -0
- package/esm/browser/util/link.d.ts +53 -0
- package/esm/browser/util/link.js +229 -0
- package/esm/browser/util/link.js.map +1 -0
- package/esm/browser/util/markdown.d.ts +86 -0
- package/esm/browser/util/markdown.js +330 -0
- package/esm/browser/util/markdown.js.map +1 -0
- package/esm/browser/util/message.d.ts +74 -0
- package/esm/browser/util/message.js +143 -0
- package/esm/browser/util/message.js.map +1 -0
- package/esm/browser/util/process.d.ts +73 -0
- package/esm/browser/util/process.js +135 -0
- package/esm/browser/util/process.js.map +1 -0
- package/esm/browser/util/progress.d.ts +50 -0
- package/esm/browser/util/progress.js +143 -0
- package/esm/browser/util/progress.js.map +1 -0
- package/esm/browser/util/qr-code.d.ts +37 -0
- package/esm/browser/util/qr-code.js +349 -0
- package/esm/browser/util/qr-code.js.map +1 -0
- package/esm/browser/util/tool.d.ts +41 -0
- package/esm/browser/util/tool.js +151 -0
- package/esm/browser/util/tool.js.map +1 -0
- package/esm/browser/view.d.ts +3 -0
- package/esm/browser/view.js +16 -0
- package/esm/browser/view.js.map +1 -0
- package/esm/browser/workbench-protocol.d.ts +50 -0
- package/esm/browser/workbench-protocol.js +2 -0
- package/esm/browser/workbench-protocol.js.map +1 -0
- package/esm/browser/workbench.d.ts +63 -0
- package/esm/browser/workbench.js +278 -0
- package/esm/browser/workbench.js.map +1 -0
- package/esm/package.json +3 -0
- package/lib/browser/assistant/assistant-export.d.ts +14 -0
- package/lib/browser/assistant/assistant-export.d.ts.map +1 -0
- package/lib/browser/assistant/assistant-export.js +36 -0
- package/lib/browser/assistant/assistant-export.js.map +1 -0
- package/lib/browser/assistant/assistant-export.spec.d.ts +2 -0
- package/lib/browser/assistant/assistant-export.spec.d.ts.map +1 -0
- package/lib/browser/assistant/assistant-export.spec.js +27 -0
- package/lib/browser/assistant/assistant-export.spec.js.map +1 -0
- package/lib/browser/assistant/assistant-extension.d.ts +21 -0
- package/lib/browser/assistant/assistant-extension.d.ts.map +1 -0
- package/lib/browser/assistant/assistant-extension.js +189 -0
- package/lib/browser/assistant/assistant-extension.js.map +1 -0
- package/lib/browser/assistant/assistant-extension.spec.d.ts +2 -0
- package/lib/browser/assistant/assistant-extension.spec.d.ts.map +1 -0
- package/lib/browser/assistant/assistant-extension.spec.js +121 -0
- package/lib/browser/assistant/assistant-extension.spec.js.map +1 -0
- package/lib/browser/assistant/assistant-hooks.d.ts +9 -0
- package/lib/browser/assistant/assistant-hooks.d.ts.map +1 -0
- package/lib/browser/assistant/assistant-hooks.js +94 -0
- package/lib/browser/assistant/assistant-hooks.js.map +1 -0
- package/lib/browser/assistant/assistant-protocol.d.ts +52 -0
- package/lib/browser/assistant/assistant-protocol.d.ts.map +1 -0
- package/lib/browser/assistant/assistant-protocol.js +5 -0
- package/lib/browser/assistant/assistant-protocol.js.map +1 -0
- package/lib/browser/assistant/assistant-tasks.d.ts +49 -0
- package/lib/browser/assistant/assistant-tasks.d.ts.map +1 -0
- package/lib/browser/assistant/assistant-tasks.js +158 -0
- package/lib/browser/assistant/assistant-tasks.js.map +1 -0
- package/lib/browser/assistant/assistant-view.d.ts +22 -0
- package/lib/browser/assistant/assistant-view.d.ts.map +1 -0
- package/lib/browser/assistant/assistant-view.js +365 -0
- package/lib/browser/assistant/assistant-view.js.map +1 -0
- package/lib/browser/assistant/assistant.d.ts +52 -0
- package/lib/browser/assistant/assistant.d.ts.map +1 -0
- package/lib/browser/assistant/assistant.js +305 -0
- package/lib/browser/assistant/assistant.js.map +1 -0
- package/lib/browser/assistant/assistant.spec.d.ts +2 -0
- package/lib/browser/assistant/assistant.spec.d.ts.map +1 -0
- package/lib/browser/assistant/assistant.spec.js +80 -0
- package/lib/browser/assistant/assistant.spec.js.map +1 -0
- package/lib/browser/assistant/voice.d.ts +15 -0
- package/lib/browser/assistant/voice.d.ts.map +1 -0
- package/lib/browser/assistant/voice.js +75 -0
- package/lib/browser/assistant/voice.js.map +1 -0
- package/lib/browser/assistant/voice.spec.d.ts +2 -0
- package/lib/browser/assistant/voice.spec.d.ts.map +1 -0
- package/lib/browser/assistant/voice.spec.js +10 -0
- package/lib/browser/assistant/voice.spec.js.map +1 -0
- package/lib/browser/avatar/dino-avatar.d.ts +140 -0
- package/lib/browser/avatar/dino-avatar.d.ts.map +1 -0
- package/lib/browser/avatar/dino-avatar.js +429 -0
- package/lib/browser/avatar/dino-avatar.js.map +1 -0
- package/lib/browser/avatar/dino-avatar.spec.d.ts +2 -0
- package/lib/browser/avatar/dino-avatar.spec.d.ts.map +1 -0
- package/lib/browser/avatar/dino-avatar.spec.js +143 -0
- package/lib/browser/avatar/dino-avatar.spec.js.map +1 -0
- package/lib/browser/avatar/dino-motion.d.ts +25 -0
- package/lib/browser/avatar/dino-motion.d.ts.map +1 -0
- package/lib/browser/avatar/dino-motion.js +298 -0
- package/lib/browser/avatar/dino-motion.js.map +1 -0
- package/lib/browser/chat/chat-protocol.d.ts +47 -0
- package/lib/browser/chat/chat-protocol.d.ts.map +1 -0
- package/lib/browser/chat/chat-protocol.js +5 -0
- package/lib/browser/chat/chat-protocol.js.map +1 -0
- package/lib/browser/chat/chat-view.d.ts +16 -0
- package/lib/browser/chat/chat-view.d.ts.map +1 -0
- package/lib/browser/chat/chat-view.js +125 -0
- package/lib/browser/chat/chat-view.js.map +1 -0
- package/lib/browser/chat/chat.d.ts +70 -0
- package/lib/browser/chat/chat.d.ts.map +1 -0
- package/lib/browser/chat/chat.js +346 -0
- package/lib/browser/chat/chat.js.map +1 -0
- package/lib/browser/chat/chat.spec.d.ts +2 -0
- package/lib/browser/chat/chat.spec.d.ts.map +1 -0
- package/lib/browser/chat/chat.spec.js +185 -0
- package/lib/browser/chat/chat.spec.js.map +1 -0
- package/lib/browser/components/account-menu.d.ts +9 -0
- package/lib/browser/components/account-menu.d.ts.map +1 -0
- package/lib/browser/components/account-menu.js +119 -0
- package/lib/browser/components/account-menu.js.map +1 -0
- package/lib/browser/components/agent-settings-view.d.ts +24 -0
- package/lib/browser/components/agent-settings-view.d.ts.map +1 -0
- package/lib/browser/components/agent-settings-view.js +143 -0
- package/lib/browser/components/agent-settings-view.js.map +1 -0
- package/lib/browser/components/app-view.d.ts +10 -0
- package/lib/browser/components/app-view.d.ts.map +1 -0
- package/lib/browser/components/app-view.js +441 -0
- package/lib/browser/components/app-view.js.map +1 -0
- package/lib/browser/components/auth-pictures.d.ts +7 -0
- package/lib/browser/components/auth-pictures.d.ts.map +1 -0
- package/lib/browser/components/auth-pictures.js +73 -0
- package/lib/browser/components/auth-pictures.js.map +1 -0
- package/lib/browser/components/auth-view.d.ts +55 -0
- package/lib/browser/components/auth-view.d.ts.map +1 -0
- package/lib/browser/components/auth-view.js +340 -0
- package/lib/browser/components/auth-view.js.map +1 -0
- package/lib/browser/components/callout.d.ts +19 -0
- package/lib/browser/components/callout.d.ts.map +1 -0
- package/lib/browser/components/callout.js +54 -0
- package/lib/browser/components/callout.js.map +1 -0
- package/lib/browser/components/chat-list.d.ts +53 -0
- package/lib/browser/components/chat-list.d.ts.map +1 -0
- package/lib/browser/components/chat-list.js +226 -0
- package/lib/browser/components/chat-list.js.map +1 -0
- package/lib/browser/components/chat-list.spec.d.ts +2 -0
- package/lib/browser/components/chat-list.spec.d.ts.map +1 -0
- package/lib/browser/components/chat-list.spec.js +61 -0
- package/lib/browser/components/chat-list.spec.js.map +1 -0
- package/lib/browser/components/code-editor.d.ts +8 -0
- package/lib/browser/components/code-editor.d.ts.map +1 -0
- package/lib/browser/components/code-editor.js +121 -0
- package/lib/browser/components/code-editor.js.map +1 -0
- package/lib/browser/components/composer-box.d.ts +74 -0
- package/lib/browser/components/composer-box.d.ts.map +1 -0
- package/lib/browser/components/composer-box.js +334 -0
- package/lib/browser/components/composer-box.js.map +1 -0
- package/lib/browser/components/composer-menu.d.ts +18 -0
- package/lib/browser/components/composer-menu.d.ts.map +1 -0
- package/lib/browser/components/composer-menu.js +54 -0
- package/lib/browser/components/composer-menu.js.map +1 -0
- package/lib/browser/components/composer.d.ts +38 -0
- package/lib/browser/components/composer.d.ts.map +1 -0
- package/lib/browser/components/composer.js +135 -0
- package/lib/browser/components/composer.js.map +1 -0
- package/lib/browser/components/composer.spec.d.ts +2 -0
- package/lib/browser/components/composer.spec.d.ts.map +1 -0
- package/lib/browser/components/composer.spec.js +129 -0
- package/lib/browser/components/composer.spec.js.map +1 -0
- package/lib/browser/components/connection-bar.d.ts +7 -0
- package/lib/browser/components/connection-bar.d.ts.map +1 -0
- package/lib/browser/components/connection-bar.js +109 -0
- package/lib/browser/components/connection-bar.js.map +1 -0
- package/lib/browser/components/context-menu.d.ts +13 -0
- package/lib/browser/components/context-menu.d.ts.map +1 -0
- package/lib/browser/components/context-menu.js +104 -0
- package/lib/browser/components/context-menu.js.map +1 -0
- package/lib/browser/components/conversation-scroll.d.ts +14 -0
- package/lib/browser/components/conversation-scroll.d.ts.map +1 -0
- package/lib/browser/components/conversation-scroll.js +158 -0
- package/lib/browser/components/conversation-scroll.js.map +1 -0
- package/lib/browser/components/dialog-view.d.ts +10 -0
- package/lib/browser/components/dialog-view.d.ts.map +1 -0
- package/lib/browser/components/dialog-view.js +77 -0
- package/lib/browser/components/dialog-view.js.map +1 -0
- package/lib/browser/components/diff-editor.d.ts +11 -0
- package/lib/browser/components/diff-editor.d.ts.map +1 -0
- package/lib/browser/components/diff-editor.js +137 -0
- package/lib/browser/components/diff-editor.js.map +1 -0
- package/lib/browser/components/diff-view.d.ts +5 -0
- package/lib/browser/components/diff-view.d.ts.map +1 -0
- package/lib/browser/components/diff-view.js +47 -0
- package/lib/browser/components/diff-view.js.map +1 -0
- package/lib/browser/components/dino.d.ts +9 -0
- package/lib/browser/components/dino.d.ts.map +1 -0
- package/lib/browser/components/dino.js +52 -0
- package/lib/browser/components/dino.js.map +1 -0
- package/lib/browser/components/editor-area.d.ts +29 -0
- package/lib/browser/components/editor-area.d.ts.map +1 -0
- package/lib/browser/components/editor-area.js +171 -0
- package/lib/browser/components/editor-area.js.map +1 -0
- package/lib/browser/components/folder-picker.d.ts +29 -0
- package/lib/browser/components/folder-picker.d.ts.map +1 -0
- package/lib/browser/components/folder-picker.js +144 -0
- package/lib/browser/components/folder-picker.js.map +1 -0
- package/lib/browser/components/folder-picker.spec.d.ts +2 -0
- package/lib/browser/components/folder-picker.spec.d.ts.map +1 -0
- package/lib/browser/components/folder-picker.spec.js +28 -0
- package/lib/browser/components/folder-picker.spec.js.map +1 -0
- package/lib/browser/components/fork-view.d.ts +15 -0
- package/lib/browser/components/fork-view.d.ts.map +1 -0
- package/lib/browser/components/fork-view.js +79 -0
- package/lib/browser/components/fork-view.js.map +1 -0
- package/lib/browser/components/hero-cards.d.ts +21 -0
- package/lib/browser/components/hero-cards.d.ts.map +1 -0
- package/lib/browser/components/hero-cards.js +146 -0
- package/lib/browser/components/hero-cards.js.map +1 -0
- package/lib/browser/components/icon.d.ts +30 -0
- package/lib/browser/components/icon.d.ts.map +1 -0
- package/lib/browser/components/icon.js +61 -0
- package/lib/browser/components/icon.js.map +1 -0
- package/lib/browser/components/link-dialog.d.ts +4 -0
- package/lib/browser/components/link-dialog.d.ts.map +1 -0
- package/lib/browser/components/link-dialog.js +81 -0
- package/lib/browser/components/link-dialog.js.map +1 -0
- package/lib/browser/components/link.d.ts +20 -0
- package/lib/browser/components/link.d.ts.map +1 -0
- package/lib/browser/components/link.js +94 -0
- package/lib/browser/components/link.js.map +1 -0
- package/lib/browser/components/manage-menu.d.ts +14 -0
- package/lib/browser/components/manage-menu.d.ts.map +1 -0
- package/lib/browser/components/manage-menu.js +132 -0
- package/lib/browser/components/manage-menu.js.map +1 -0
- package/lib/browser/components/markdown.d.ts +10 -0
- package/lib/browser/components/markdown.d.ts.map +1 -0
- package/lib/browser/components/markdown.js +135 -0
- package/lib/browser/components/markdown.js.map +1 -0
- package/lib/browser/components/markdown.spec.d.ts +2 -0
- package/lib/browser/components/markdown.spec.d.ts.map +1 -0
- package/lib/browser/components/markdown.spec.js +72 -0
- package/lib/browser/components/markdown.spec.js.map +1 -0
- package/lib/browser/components/math.d.ts +11 -0
- package/lib/browser/components/math.d.ts.map +1 -0
- package/lib/browser/components/math.js +57 -0
- package/lib/browser/components/math.js.map +1 -0
- package/lib/browser/components/media.d.ts +12 -0
- package/lib/browser/components/media.d.ts.map +1 -0
- package/lib/browser/components/media.js +113 -0
- package/lib/browser/components/media.js.map +1 -0
- package/lib/browser/components/mermaid-view.d.ts +11 -0
- package/lib/browser/components/mermaid-view.d.ts.map +1 -0
- package/lib/browser/components/mermaid-view.js +120 -0
- package/lib/browser/components/mermaid-view.js.map +1 -0
- package/lib/browser/components/message-actions.d.ts +13 -0
- package/lib/browser/components/message-actions.d.ts.map +1 -0
- package/lib/browser/components/message-actions.js +114 -0
- package/lib/browser/components/message-actions.js.map +1 -0
- package/lib/browser/components/message-footer.d.ts +30 -0
- package/lib/browser/components/message-footer.d.ts.map +1 -0
- package/lib/browser/components/message-footer.js +124 -0
- package/lib/browser/components/message-footer.js.map +1 -0
- package/lib/browser/components/message-list.d.ts +38 -0
- package/lib/browser/components/message-list.d.ts.map +1 -0
- package/lib/browser/components/message-list.js +257 -0
- package/lib/browser/components/message-list.js.map +1 -0
- package/lib/browser/components/message-list.spec.d.ts +2 -0
- package/lib/browser/components/message-list.spec.d.ts.map +1 -0
- package/lib/browser/components/message-list.spec.js +269 -0
- package/lib/browser/components/message-list.spec.js.map +1 -0
- package/lib/browser/components/notice-center.d.ts +4 -0
- package/lib/browser/components/notice-center.d.ts.map +1 -0
- package/lib/browser/components/notice-center.js +150 -0
- package/lib/browser/components/notice-center.js.map +1 -0
- package/lib/browser/components/relay-view.d.ts +6 -0
- package/lib/browser/components/relay-view.d.ts.map +1 -0
- package/lib/browser/components/relay-view.js +150 -0
- package/lib/browser/components/relay-view.js.map +1 -0
- package/lib/browser/components/run-status.d.ts +10 -0
- package/lib/browser/components/run-status.d.ts.map +1 -0
- package/lib/browser/components/run-status.js +90 -0
- package/lib/browser/components/run-status.js.map +1 -0
- package/lib/browser/components/session-settings.d.ts +38 -0
- package/lib/browser/components/session-settings.d.ts.map +1 -0
- package/lib/browser/components/session-settings.js +121 -0
- package/lib/browser/components/session-settings.js.map +1 -0
- package/lib/browser/components/session-settings.spec.d.ts +2 -0
- package/lib/browser/components/session-settings.spec.d.ts.map +1 -0
- package/lib/browser/components/session-settings.spec.js +47 -0
- package/lib/browser/components/session-settings.spec.js.map +1 -0
- package/lib/browser/components/session-view.d.ts +25 -0
- package/lib/browser/components/session-view.d.ts.map +1 -0
- package/lib/browser/components/session-view.js +120 -0
- package/lib/browser/components/session-view.js.map +1 -0
- package/lib/browser/components/settings-controls.d.ts +41 -0
- package/lib/browser/components/settings-controls.d.ts.map +1 -0
- package/lib/browser/components/settings-controls.js +68 -0
- package/lib/browser/components/settings-controls.js.map +1 -0
- package/lib/browser/components/settings-view.d.ts +23 -0
- package/lib/browser/components/settings-view.d.ts.map +1 -0
- package/lib/browser/components/settings-view.js +394 -0
- package/lib/browser/components/settings-view.js.map +1 -0
- package/lib/browser/components/split-pane.d.ts +25 -0
- package/lib/browser/components/split-pane.d.ts.map +1 -0
- package/lib/browser/components/split-pane.js +113 -0
- package/lib/browser/components/split-pane.js.map +1 -0
- package/lib/browser/components/ta-avatar.d.ts +14 -0
- package/lib/browser/components/ta-avatar.d.ts.map +1 -0
- package/lib/browser/components/ta-avatar.js +221 -0
- package/lib/browser/components/ta-avatar.js.map +1 -0
- package/lib/browser/components/ta-avatar.spec.d.ts +2 -0
- package/lib/browser/components/ta-avatar.spec.d.ts.map +1 -0
- package/lib/browser/components/ta-avatar.spec.js +60 -0
- package/lib/browser/components/ta-avatar.spec.js.map +1 -0
- package/lib/browser/components/tool-view.d.ts +19 -0
- package/lib/browser/components/tool-view.d.ts.map +1 -0
- package/lib/browser/components/tool-view.js +146 -0
- package/lib/browser/components/tool-view.js.map +1 -0
- package/lib/browser/components/trusted-domains.d.ts +4 -0
- package/lib/browser/components/trusted-domains.d.ts.map +1 -0
- package/lib/browser/components/trusted-domains.js +75 -0
- package/lib/browser/components/trusted-domains.js.map +1 -0
- package/lib/browser/components/web-composer.d.ts +15 -0
- package/lib/browser/components/web-composer.d.ts.map +1 -0
- package/lib/browser/components/web-composer.js +58 -0
- package/lib/browser/components/web-composer.js.map +1 -0
- package/lib/browser/components/web-dialog.d.ts +5 -0
- package/lib/browser/components/web-dialog.d.ts.map +1 -0
- package/lib/browser/components/web-dialog.js +58 -0
- package/lib/browser/components/web-dialog.js.map +1 -0
- package/lib/browser/components/workbench-toggle.d.ts +13 -0
- package/lib/browser/components/workbench-toggle.d.ts.map +1 -0
- package/lib/browser/components/workbench-toggle.js +54 -0
- package/lib/browser/components/workbench-toggle.js.map +1 -0
- package/lib/browser/components/workbench-toggle.spec.d.ts +2 -0
- package/lib/browser/components/workbench-toggle.spec.d.ts.map +1 -0
- package/lib/browser/components/workbench-toggle.spec.js +64 -0
- package/lib/browser/components/workbench-toggle.spec.js.map +1 -0
- package/lib/browser/components/workbench-view.d.ts +9 -0
- package/lib/browser/components/workbench-view.d.ts.map +1 -0
- package/lib/browser/components/workbench-view.js +99 -0
- package/lib/browser/components/workbench-view.js.map +1 -0
- package/lib/browser/components/working-directory.d.ts +6 -0
- package/lib/browser/components/working-directory.d.ts.map +1 -0
- package/lib/browser/components/working-directory.js +61 -0
- package/lib/browser/components/working-directory.js.map +1 -0
- package/lib/browser/editor/monaco-loader.d.ts +61 -0
- package/lib/browser/editor/monaco-loader.d.ts.map +1 -0
- package/lib/browser/editor/monaco-loader.js +138 -0
- package/lib/browser/editor/monaco-loader.js.map +1 -0
- package/lib/browser/editor/monaco-loader.spec.d.ts +2 -0
- package/lib/browser/editor/monaco-loader.spec.d.ts.map +1 -0
- package/lib/browser/editor/monaco-loader.spec.js +39 -0
- package/lib/browser/editor/monaco-loader.spec.js.map +1 -0
- package/lib/browser/editor/monaco.d.ts +46 -0
- package/lib/browser/editor/monaco.d.ts.map +1 -0
- package/lib/browser/editor/monaco.js +93 -0
- package/lib/browser/editor/monaco.js.map +1 -0
- package/lib/browser/extension/extension-view.d.ts +36 -0
- package/lib/browser/extension/extension-view.d.ts.map +1 -0
- package/lib/browser/extension/extension-view.js +91 -0
- package/lib/browser/extension/extension-view.js.map +1 -0
- package/lib/browser/extension/icons.d.ts +4 -0
- package/lib/browser/extension/icons.d.ts.map +1 -0
- package/lib/browser/extension/icons.js +85 -0
- package/lib/browser/extension/icons.js.map +1 -0
- package/lib/browser/extension/web-extension-api.d.ts +363 -0
- package/lib/browser/extension/web-extension-api.d.ts.map +1 -0
- package/lib/browser/extension/web-extension-api.js +3 -0
- package/lib/browser/extension/web-extension-api.js.map +1 -0
- package/lib/browser/extension/web-extension-protocol.d.ts +133 -0
- package/lib/browser/extension/web-extension-protocol.d.ts.map +1 -0
- package/lib/browser/extension/web-extension-protocol.js +13 -0
- package/lib/browser/extension/web-extension-protocol.js.map +1 -0
- package/lib/browser/extension/web-extensions.d.ts +119 -0
- package/lib/browser/extension/web-extensions.d.ts.map +1 -0
- package/lib/browser/extension/web-extensions.js +690 -0
- package/lib/browser/extension/web-extensions.js.map +1 -0
- package/lib/browser/extension/web-extensions.spec.d.ts +2 -0
- package/lib/browser/extension/web-extensions.spec.d.ts.map +1 -0
- package/lib/browser/extension/web-extensions.spec.js +617 -0
- package/lib/browser/extension/web-extensions.spec.js.map +1 -0
- package/lib/browser/hooks.d.ts +22 -0
- package/lib/browser/hooks.d.ts.map +1 -0
- package/lib/browser/hooks.js +109 -0
- package/lib/browser/hooks.js.map +1 -0
- package/lib/browser/i18n/locales.d.ts +436 -0
- package/lib/browser/i18n/locales.d.ts.map +1 -0
- package/lib/browser/i18n/locales.js +38 -0
- package/lib/browser/i18n/locales.js.map +1 -0
- package/lib/browser/i18n/messages.d.ts +428 -0
- package/lib/browser/i18n/messages.d.ts.map +1 -0
- package/lib/browser/i18n/messages.js +862 -0
- package/lib/browser/i18n/messages.js.map +1 -0
- package/lib/browser/i18n/use-t.d.ts +8 -0
- package/lib/browser/i18n/use-t.d.ts.map +1 -0
- package/lib/browser/i18n/use-t.js +54 -0
- package/lib/browser/i18n/use-t.js.map +1 -0
- package/lib/browser/index.d.ts +53 -0
- package/lib/browser/index.d.ts.map +1 -0
- package/lib/browser/index.js +69 -0
- package/lib/browser/index.js.map +1 -0
- package/lib/browser/links/links-protocol.d.ts +36 -0
- package/lib/browser/links/links-protocol.d.ts.map +1 -0
- package/lib/browser/links/links-protocol.js +5 -0
- package/lib/browser/links/links-protocol.js.map +1 -0
- package/lib/browser/links/links.d.ts +33 -0
- package/lib/browser/links/links.d.ts.map +1 -0
- package/lib/browser/links/links.js +144 -0
- package/lib/browser/links/links.js.map +1 -0
- package/lib/browser/links/links.spec.d.ts +2 -0
- package/lib/browser/links/links.spec.d.ts.map +1 -0
- package/lib/browser/links/links.spec.js +123 -0
- package/lib/browser/links/links.spec.js.map +1 -0
- package/lib/browser/markdown/hooks.d.ts +7 -0
- package/lib/browser/markdown/hooks.d.ts.map +1 -0
- package/lib/browser/markdown/hooks.js +58 -0
- package/lib/browser/markdown/hooks.js.map +1 -0
- package/lib/browser/markdown/lazy.d.ts +22 -0
- package/lib/browser/markdown/lazy.d.ts.map +1 -0
- package/lib/browser/markdown/lazy.js +44 -0
- package/lib/browser/markdown/lazy.js.map +1 -0
- package/lib/browser/markdown/lazy.spec.d.ts +2 -0
- package/lib/browser/markdown/lazy.spec.d.ts.map +1 -0
- package/lib/browser/markdown/lazy.spec.js +35 -0
- package/lib/browser/markdown/lazy.spec.js.map +1 -0
- package/lib/browser/markdown/math.d.ts +19 -0
- package/lib/browser/markdown/math.d.ts.map +1 -0
- package/lib/browser/markdown/math.js +33 -0
- package/lib/browser/markdown/math.js.map +1 -0
- package/lib/browser/markdown/math.spec.d.ts +2 -0
- package/lib/browser/markdown/math.spec.d.ts.map +1 -0
- package/lib/browser/markdown/math.spec.js +24 -0
- package/lib/browser/markdown/math.spec.js.map +1 -0
- package/lib/browser/markdown/mermaid.d.ts +21 -0
- package/lib/browser/markdown/mermaid.d.ts.map +1 -0
- package/lib/browser/markdown/mermaid.js +87 -0
- package/lib/browser/markdown/mermaid.js.map +1 -0
- package/lib/browser/markdown/mermaid.spec.d.ts +2 -0
- package/lib/browser/markdown/mermaid.spec.d.ts.map +1 -0
- package/lib/browser/markdown/mermaid.spec.js +21 -0
- package/lib/browser/markdown/mermaid.spec.js.map +1 -0
- package/lib/browser/module.d.ts +5 -0
- package/lib/browser/module.d.ts.map +1 -0
- package/lib/browser/module.js +8 -0
- package/lib/browser/module.js.map +1 -0
- package/lib/browser/notices/notices-protocol.d.ts +83 -0
- package/lib/browser/notices/notices-protocol.d.ts.map +1 -0
- package/lib/browser/notices/notices-protocol.js +5 -0
- package/lib/browser/notices/notices-protocol.js.map +1 -0
- package/lib/browser/notices/notices.d.ts +48 -0
- package/lib/browser/notices/notices.d.ts.map +1 -0
- package/lib/browser/notices/notices.js +165 -0
- package/lib/browser/notices/notices.js.map +1 -0
- package/lib/browser/notices/notices.spec.d.ts +2 -0
- package/lib/browser/notices/notices.spec.d.ts.map +1 -0
- package/lib/browser/notices/notices.spec.js +96 -0
- package/lib/browser/notices/notices.spec.js.map +1 -0
- package/lib/browser/pwa/pwa-protocol.d.ts +21 -0
- package/lib/browser/pwa/pwa-protocol.d.ts.map +1 -0
- package/lib/browser/pwa/pwa-protocol.js +5 -0
- package/lib/browser/pwa/pwa-protocol.js.map +1 -0
- package/lib/browser/pwa/pwa.d.ts +40 -0
- package/lib/browser/pwa/pwa.d.ts.map +1 -0
- package/lib/browser/pwa/pwa.js +123 -0
- package/lib/browser/pwa/pwa.js.map +1 -0
- package/lib/browser/pwa/pwa.spec.d.ts +2 -0
- package/lib/browser/pwa/pwa.spec.d.ts.map +1 -0
- package/lib/browser/pwa/pwa.spec.js +134 -0
- package/lib/browser/pwa/pwa.spec.js.map +1 -0
- package/lib/browser/settings/agent-settings.d.ts +34 -0
- package/lib/browser/settings/agent-settings.d.ts.map +1 -0
- package/lib/browser/settings/agent-settings.js +88 -0
- package/lib/browser/settings/agent-settings.js.map +1 -0
- package/lib/browser/settings/agent-settings.spec.d.ts +2 -0
- package/lib/browser/settings/agent-settings.spec.d.ts.map +1 -0
- package/lib/browser/settings/agent-settings.spec.js +53 -0
- package/lib/browser/settings/agent-settings.spec.js.map +1 -0
- package/lib/browser/settings/settings-protocol.d.ts +45 -0
- package/lib/browser/settings/settings-protocol.d.ts.map +1 -0
- package/lib/browser/settings/settings-protocol.js +38 -0
- package/lib/browser/settings/settings-protocol.js.map +1 -0
- package/lib/browser/settings/settings.d.ts +32 -0
- package/lib/browser/settings/settings.d.ts.map +1 -0
- package/lib/browser/settings/settings.js +105 -0
- package/lib/browser/settings/settings.js.map +1 -0
- package/lib/browser/settings/settings.spec.d.ts +2 -0
- package/lib/browser/settings/settings.spec.d.ts.map +1 -0
- package/lib/browser/settings/settings.spec.js +32 -0
- package/lib/browser/settings/settings.spec.js.map +1 -0
- package/lib/browser/state/state-protocol.d.ts +49 -0
- package/lib/browser/state/state-protocol.d.ts.map +1 -0
- package/lib/browser/state/state-protocol.js +35 -0
- package/lib/browser/state/state-protocol.js.map +1 -0
- package/lib/browser/state/state.d.ts +40 -0
- package/lib/browser/state/state.d.ts.map +1 -0
- package/lib/browser/state/state.js +213 -0
- package/lib/browser/state/state.js.map +1 -0
- package/lib/browser/state/state.spec.d.ts +2 -0
- package/lib/browser/state/state.spec.d.ts.map +1 -0
- package/lib/browser/state/state.spec.js +201 -0
- package/lib/browser/state/state.spec.js.map +1 -0
- package/lib/browser/style/base.d.ts +3 -0
- package/lib/browser/style/base.d.ts.map +1 -0
- package/lib/browser/style/base.js +143 -0
- package/lib/browser/style/base.js.map +1 -0
- package/lib/browser/style/conversation.d.ts +3 -0
- package/lib/browser/style/conversation.d.ts.map +1 -0
- package/lib/browser/style/conversation.js +204 -0
- package/lib/browser/style/conversation.js.map +1 -0
- package/lib/browser/style/layout.d.ts +3 -0
- package/lib/browser/style/layout.d.ts.map +1 -0
- package/lib/browser/style/layout.js +374 -0
- package/lib/browser/style/layout.js.map +1 -0
- package/lib/browser/style/pages.d.ts +3 -0
- package/lib/browser/style/pages.d.ts.map +1 -0
- package/lib/browser/style/pages.js +78 -0
- package/lib/browser/style/pages.js.map +1 -0
- package/lib/browser/style/shell.d.ts +3 -0
- package/lib/browser/style/shell.d.ts.map +1 -0
- package/lib/browser/style/shell.js +239 -0
- package/lib/browser/style/shell.js.map +1 -0
- package/lib/browser/style.d.ts +6 -0
- package/lib/browser/style.d.ts.map +1 -0
- package/lib/browser/style.js +14 -0
- package/lib/browser/style.js.map +1 -0
- package/lib/browser/util/composer.d.ts +86 -0
- package/lib/browser/util/composer.d.ts.map +1 -0
- package/lib/browser/util/composer.js +124 -0
- package/lib/browser/util/composer.js.map +1 -0
- package/lib/browser/util/composer.spec.d.ts +2 -0
- package/lib/browser/util/composer.spec.d.ts.map +1 -0
- package/lib/browser/util/composer.spec.js +66 -0
- package/lib/browser/util/composer.spec.js.map +1 -0
- package/lib/browser/util/diff.d.ts +18 -0
- package/lib/browser/util/diff.d.ts.map +1 -0
- package/lib/browser/util/diff.js +32 -0
- package/lib/browser/util/diff.js.map +1 -0
- package/lib/browser/util/diff.spec.d.ts +2 -0
- package/lib/browser/util/diff.spec.d.ts.map +1 -0
- package/lib/browser/util/diff.spec.js +21 -0
- package/lib/browser/util/diff.spec.js.map +1 -0
- package/lib/browser/util/frame.d.ts +33 -0
- package/lib/browser/util/frame.d.ts.map +1 -0
- package/lib/browser/util/frame.js +50 -0
- package/lib/browser/util/frame.js.map +1 -0
- package/lib/browser/util/frame.spec.d.ts +2 -0
- package/lib/browser/util/frame.spec.d.ts.map +1 -0
- package/lib/browser/util/frame.spec.js +60 -0
- package/lib/browser/util/frame.spec.js.map +1 -0
- package/lib/browser/util/layout.d.ts +27 -0
- package/lib/browser/util/layout.d.ts.map +1 -0
- package/lib/browser/util/layout.js +57 -0
- package/lib/browser/util/layout.js.map +1 -0
- package/lib/browser/util/layout.spec.d.ts +2 -0
- package/lib/browser/util/layout.spec.d.ts.map +1 -0
- package/lib/browser/util/layout.spec.js +35 -0
- package/lib/browser/util/layout.spec.js.map +1 -0
- package/lib/browser/util/link.d.ts +54 -0
- package/lib/browser/util/link.d.ts.map +1 -0
- package/lib/browser/util/link.js +232 -0
- package/lib/browser/util/link.js.map +1 -0
- package/lib/browser/util/link.spec.d.ts +2 -0
- package/lib/browser/util/link.spec.d.ts.map +1 -0
- package/lib/browser/util/link.spec.js +101 -0
- package/lib/browser/util/link.spec.js.map +1 -0
- package/lib/browser/util/markdown.d.ts +87 -0
- package/lib/browser/util/markdown.d.ts.map +1 -0
- package/lib/browser/util/markdown.js +333 -0
- package/lib/browser/util/markdown.js.map +1 -0
- package/lib/browser/util/markdown.spec.d.ts +2 -0
- package/lib/browser/util/markdown.spec.d.ts.map +1 -0
- package/lib/browser/util/markdown.spec.js +124 -0
- package/lib/browser/util/markdown.spec.js.map +1 -0
- package/lib/browser/util/message.d.ts +75 -0
- package/lib/browser/util/message.d.ts.map +1 -0
- package/lib/browser/util/message.js +146 -0
- package/lib/browser/util/message.js.map +1 -0
- package/lib/browser/util/message.spec.d.ts +2 -0
- package/lib/browser/util/message.spec.d.ts.map +1 -0
- package/lib/browser/util/message.spec.js +59 -0
- package/lib/browser/util/message.spec.js.map +1 -0
- package/lib/browser/util/process.d.ts +74 -0
- package/lib/browser/util/process.d.ts.map +1 -0
- package/lib/browser/util/process.js +138 -0
- package/lib/browser/util/process.js.map +1 -0
- package/lib/browser/util/process.spec.d.ts +2 -0
- package/lib/browser/util/process.spec.d.ts.map +1 -0
- package/lib/browser/util/process.spec.js +106 -0
- package/lib/browser/util/process.spec.js.map +1 -0
- package/lib/browser/util/progress.d.ts +51 -0
- package/lib/browser/util/progress.d.ts.map +1 -0
- package/lib/browser/util/progress.js +146 -0
- package/lib/browser/util/progress.js.map +1 -0
- package/lib/browser/util/progress.spec.d.ts +2 -0
- package/lib/browser/util/progress.spec.d.ts.map +1 -0
- package/lib/browser/util/progress.spec.js +77 -0
- package/lib/browser/util/progress.spec.js.map +1 -0
- package/lib/browser/util/qr-code.d.ts +38 -0
- package/lib/browser/util/qr-code.d.ts.map +1 -0
- package/lib/browser/util/qr-code.js +353 -0
- package/lib/browser/util/qr-code.js.map +1 -0
- package/lib/browser/util/qr-code.spec.d.ts +2 -0
- package/lib/browser/util/qr-code.spec.d.ts.map +1 -0
- package/lib/browser/util/qr-code.spec.js +48 -0
- package/lib/browser/util/qr-code.spec.js.map +1 -0
- package/lib/browser/util/tool.d.ts +42 -0
- package/lib/browser/util/tool.d.ts.map +1 -0
- package/lib/browser/util/tool.js +154 -0
- package/lib/browser/util/tool.js.map +1 -0
- package/lib/browser/util/tool.spec.d.ts +2 -0
- package/lib/browser/util/tool.spec.d.ts.map +1 -0
- package/lib/browser/util/tool.spec.js +73 -0
- package/lib/browser/util/tool.spec.js.map +1 -0
- package/lib/browser/view.d.ts +4 -0
- package/lib/browser/view.d.ts.map +1 -0
- package/lib/browser/view.js +19 -0
- package/lib/browser/view.js.map +1 -0
- package/lib/browser/workbench-protocol.d.ts +51 -0
- package/lib/browser/workbench-protocol.d.ts.map +1 -0
- package/lib/browser/workbench-protocol.js +5 -0
- package/lib/browser/workbench-protocol.js.map +1 -0
- package/lib/browser/workbench.d.ts +64 -0
- package/lib/browser/workbench.d.ts.map +1 -0
- package/lib/browser/workbench.js +281 -0
- package/lib/browser/workbench.js.map +1 -0
- package/lib/browser/workbench.spec.d.ts +2 -0
- package/lib/browser/workbench.spec.d.ts.map +1 -0
- package/lib/browser/workbench.spec.js +34 -0
- package/lib/browser/workbench.spec.js.map +1 -0
- package/package.json +81 -4
- package/src/browser/assistant/assistant-export.spec.ts +30 -0
- package/src/browser/assistant/assistant-export.ts +41 -0
- package/src/browser/assistant/assistant-extension.spec.ts +122 -0
- package/src/browser/assistant/assistant-extension.ts +137 -0
- package/src/browser/assistant/assistant-hooks.ts +63 -0
- package/src/browser/assistant/assistant-protocol.ts +55 -0
- package/src/browser/assistant/assistant-tasks.tsx +194 -0
- package/src/browser/assistant/assistant-view.tsx +453 -0
- package/src/browser/assistant/assistant.spec.ts +80 -0
- package/src/browser/assistant/assistant.ts +315 -0
- package/src/browser/assistant/voice.spec.ts +8 -0
- package/src/browser/assistant/voice.ts +87 -0
- package/src/browser/avatar/dino-avatar.spec.ts +151 -0
- package/src/browser/avatar/dino-avatar.ts +541 -0
- package/src/browser/avatar/dino-motion.ts +313 -0
- package/src/browser/chat/chat-protocol.ts +47 -0
- package/src/browser/chat/chat-view.tsx +155 -0
- package/src/browser/chat/chat.spec.ts +194 -0
- package/src/browser/chat/chat.ts +335 -0
- package/src/browser/components/account-menu.tsx +114 -0
- package/src/browser/components/agent-settings-view.tsx +196 -0
- package/src/browser/components/app-view.tsx +553 -0
- package/src/browser/components/auth-pictures.tsx +55 -0
- package/src/browser/components/auth-view.tsx +421 -0
- package/src/browser/components/callout.tsx +33 -0
- package/src/browser/components/chat-list.spec.ts +66 -0
- package/src/browser/components/chat-list.tsx +276 -0
- package/src/browser/components/code-editor.tsx +114 -0
- package/src/browser/components/composer-box.tsx +475 -0
- package/src/browser/components/composer-menu.tsx +49 -0
- package/src/browser/components/composer.spec.tsx +130 -0
- package/src/browser/components/composer.tsx +170 -0
- package/src/browser/components/connection-bar.tsx +85 -0
- package/src/browser/components/context-menu.tsx +100 -0
- package/src/browser/components/conversation-scroll.ts +126 -0
- package/src/browser/components/dialog-view.tsx +82 -0
- package/src/browser/components/diff-editor.tsx +131 -0
- package/src/browser/components/diff-view.tsx +19 -0
- package/src/browser/components/dino.tsx +19 -0
- package/src/browser/components/editor-area.tsx +234 -0
- package/src/browser/components/folder-picker.spec.ts +30 -0
- package/src/browser/components/folder-picker.tsx +177 -0
- package/src/browser/components/fork-view.tsx +65 -0
- package/src/browser/components/hero-cards.tsx +189 -0
- package/src/browser/components/icon.tsx +62 -0
- package/src/browser/components/link-dialog.tsx +66 -0
- package/src/browser/components/link.tsx +77 -0
- package/src/browser/components/manage-menu.tsx +165 -0
- package/src/browser/components/markdown.spec.tsx +46 -0
- package/src/browser/components/markdown.tsx +155 -0
- package/src/browser/components/math.tsx +21 -0
- package/src/browser/components/media.tsx +91 -0
- package/src/browser/components/mermaid-view.tsx +105 -0
- package/src/browser/components/message-actions.tsx +89 -0
- package/src/browser/components/message-footer.tsx +128 -0
- package/src/browser/components/message-list.spec.tsx +321 -0
- package/src/browser/components/message-list.tsx +328 -0
- package/src/browser/components/notice-center.tsx +187 -0
- package/src/browser/components/relay-view.tsx +146 -0
- package/src/browser/components/run-status.tsx +70 -0
- package/src/browser/components/session-settings.spec.tsx +49 -0
- package/src/browser/components/session-settings.tsx +119 -0
- package/src/browser/components/session-view.tsx +153 -0
- package/src/browser/components/settings-controls.tsx +94 -0
- package/src/browser/components/settings-view.tsx +573 -0
- package/src/browser/components/split-pane.tsx +108 -0
- package/src/browser/components/ta-avatar.spec.tsx +27 -0
- package/src/browser/components/ta-avatar.tsx +251 -0
- package/src/browser/components/tool-view.tsx +186 -0
- package/src/browser/components/trusted-domains.tsx +60 -0
- package/src/browser/components/web-composer.tsx +47 -0
- package/src/browser/components/web-dialog.tsx +29 -0
- package/src/browser/components/workbench-toggle.spec.tsx +35 -0
- package/src/browser/components/workbench-toggle.tsx +24 -0
- package/src/browser/components/workbench-view.tsx +77 -0
- package/src/browser/components/working-directory.tsx +22 -0
- package/src/browser/editor/monaco-loader.spec.ts +39 -0
- package/src/browser/editor/monaco-loader.ts +139 -0
- package/src/browser/editor/monaco.ts +55 -0
- package/src/browser/editor/worker-modules.d.ts +5 -0
- package/src/browser/extension/extension-view.tsx +78 -0
- package/src/browser/extension/icons.ts +161 -0
- package/src/browser/extension/web-extension-api.ts +346 -0
- package/src/browser/extension/web-extension-protocol.ts +154 -0
- package/src/browser/extension/web-extensions.spec.ts +597 -0
- package/src/browser/extension/web-extensions.ts +717 -0
- package/src/browser/hooks.ts +102 -0
- package/src/browser/i18n/locales.ts +20 -0
- package/src/browser/i18n/messages.ts +864 -0
- package/src/browser/i18n/use-t.ts +21 -0
- package/src/browser/index.ts +52 -0
- package/src/browser/links/links-protocol.ts +41 -0
- package/src/browser/links/links.spec.ts +132 -0
- package/src/browser/links/links.ts +127 -0
- package/src/browser/markdown/hooks.ts +32 -0
- package/src/browser/markdown/lazy.spec.ts +34 -0
- package/src/browser/markdown/lazy.ts +46 -0
- package/src/browser/markdown/math.spec.ts +20 -0
- package/src/browser/markdown/math.ts +33 -0
- package/src/browser/markdown/mermaid.spec.ts +21 -0
- package/src/browser/markdown/mermaid.ts +89 -0
- package/src/browser/markdown/style-modules.d.ts +2 -0
- package/src/browser/module.ts +6 -0
- package/src/browser/notices/notices-protocol.ts +92 -0
- package/src/browser/notices/notices.spec.ts +99 -0
- package/src/browser/notices/notices.ts +173 -0
- package/src/browser/public/icons/apple-touch-icon.png +0 -0
- package/src/browser/public/icons/icon-192.png +0 -0
- package/src/browser/public/icons/icon-512.png +0 -0
- package/src/browser/public/icons/icon.svg +1 -0
- package/src/browser/public/icons/maskable-512.png +0 -0
- package/src/browser/public/manifest.webmanifest +40 -0
- package/src/browser/public/sw.js +78 -0
- package/src/browser/pwa/pwa-protocol.ts +22 -0
- package/src/browser/pwa/pwa.spec.ts +143 -0
- package/src/browser/pwa/pwa.ts +123 -0
- package/src/browser/settings/agent-settings.spec.ts +56 -0
- package/src/browser/settings/agent-settings.ts +96 -0
- package/src/browser/settings/settings-protocol.ts +75 -0
- package/src/browser/settings/settings.spec.ts +31 -0
- package/src/browser/settings/settings.ts +89 -0
- package/src/browser/state/state-protocol.ts +71 -0
- package/src/browser/state/state.spec.ts +214 -0
- package/src/browser/state/state.ts +217 -0
- package/src/browser/style/base.ts +139 -0
- package/src/browser/style/conversation.ts +200 -0
- package/src/browser/style/layout.ts +370 -0
- package/src/browser/style/pages.ts +74 -0
- package/src/browser/style/shell.ts +235 -0
- package/src/browser/style.ts +11 -0
- package/src/browser/util/composer.spec.ts +71 -0
- package/src/browser/util/composer.ts +157 -0
- package/src/browser/util/diff.spec.ts +20 -0
- package/src/browser/util/diff.ts +33 -0
- package/src/browser/util/frame.spec.ts +62 -0
- package/src/browser/util/frame.ts +54 -0
- package/src/browser/util/layout.spec.ts +37 -0
- package/src/browser/util/layout.ts +71 -0
- package/src/browser/util/link.spec.ts +104 -0
- package/src/browser/util/link.ts +237 -0
- package/src/browser/util/markdown.spec.ts +133 -0
- package/src/browser/util/markdown.ts +347 -0
- package/src/browser/util/message.spec.ts +63 -0
- package/src/browser/util/message.ts +188 -0
- package/src/browser/util/process.spec.ts +133 -0
- package/src/browser/util/process.ts +166 -0
- package/src/browser/util/progress.spec.ts +86 -0
- package/src/browser/util/progress.ts +170 -0
- package/src/browser/util/qr-code.spec.ts +49 -0
- package/src/browser/util/qr-code.ts +371 -0
- package/src/browser/util/tool.spec.ts +78 -0
- package/src/browser/util/tool.ts +190 -0
- package/src/browser/view.ts +6 -0
- package/src/browser/workbench-protocol.ts +66 -0
- package/src/browser/workbench.spec.ts +37 -0
- package/src/browser/workbench.ts +297 -0
|
@@ -0,0 +1,475 @@
|
|
|
1
|
+
import { ArrowUp, AtSign, Check, ChevronLeft, ChevronRight, ImagePlus, Plus, Slash, Square, X } from 'lucide-react';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useT } from '../i18n/use-t';
|
|
4
|
+
import { type ComposerAttachment, type ComposerImage, ComposerUtil, IMAGE_TYPES } from '../util/composer';
|
|
5
|
+
import { ComposerMenu, type ComposerMenuItem } from './composer-menu';
|
|
6
|
+
import { Icon, IconButton } from './icon';
|
|
7
|
+
|
|
8
|
+
/** An entry of the + menu: an action, or a list to pick one of (a model, a level). */
|
|
9
|
+
export interface ComposerAction {
|
|
10
|
+
key: string;
|
|
11
|
+
label: string;
|
|
12
|
+
/** On the left: an icon of 16 pixels, or an avatar. */
|
|
13
|
+
icon?: React.ReactNode;
|
|
14
|
+
/** After the label, quieter: the value now of a list, or what the entry is. */
|
|
15
|
+
detail?: string;
|
|
16
|
+
checked?: boolean;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
/** A list to pick from, which the menu shows in its place. */
|
|
19
|
+
items?: ComposerAction[];
|
|
20
|
+
/** Text the entry puts where the caret is, as `@name `. */
|
|
21
|
+
insert?: string;
|
|
22
|
+
run?(): void;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** What `@` lists for what was typed after it, or why it lists nothing. */
|
|
26
|
+
export interface ComposerMentions {
|
|
27
|
+
items: ComposerMenuItem[];
|
|
28
|
+
note?: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface ComposerBoxHandle {
|
|
32
|
+
text(): string;
|
|
33
|
+
setText(text: string): void;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface ComposerBoxProps {
|
|
37
|
+
placeholder: string;
|
|
38
|
+
/** Something runs: with nothing typed, the button stops it. */
|
|
39
|
+
working?: boolean;
|
|
40
|
+
onStop?(): void;
|
|
41
|
+
/** Sends; when it fails, what was sent comes back into the box. `followUp`: Alt+Enter. */
|
|
42
|
+
onSend(message: string, images: ComposerImage[], followUp: boolean): Promise<unknown>;
|
|
43
|
+
/** What `/` at the start lists. */
|
|
44
|
+
commands?: { name: string; description?: string }[];
|
|
45
|
+
/** What is typed after an `@`, or `undefined` when there is none: the owner looks for `mentions`. Without it, `@` lists nothing. */
|
|
46
|
+
onMentionQuery?(query: string | undefined): void;
|
|
47
|
+
/** What `@` lists for the query last given. */
|
|
48
|
+
mentions?: ComposerMentions;
|
|
49
|
+
/** The + menu entry that starts an `@`; none without it. */
|
|
50
|
+
mentionLabel?: string;
|
|
51
|
+
/** Images can be pasted, dropped and picked. */
|
|
52
|
+
images?: boolean;
|
|
53
|
+
/** More sections of the + menu, after that of the box, each set apart by a line. */
|
|
54
|
+
actions?: ComposerAction[][];
|
|
55
|
+
/** Above the box: what waits to be sent. */
|
|
56
|
+
above?: React.ReactNode;
|
|
57
|
+
/** Controls beside the +, as the directory of a new conversation. */
|
|
58
|
+
beside?: React.ReactNode;
|
|
59
|
+
/** Controls on the right, before the send button, as the microphone of the double. */
|
|
60
|
+
after?: React.ReactNode;
|
|
61
|
+
autoFocus?: boolean;
|
|
62
|
+
onError(error: unknown): void;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function readImage(file: File): Promise<ComposerImage | undefined> {
|
|
66
|
+
return new Promise(resolve => {
|
|
67
|
+
const reader = new FileReader();
|
|
68
|
+
reader.onload = () => resolve(ComposerUtil.image(String(reader.result)));
|
|
69
|
+
reader.onerror = () => resolve(undefined);
|
|
70
|
+
reader.readAsDataURL(file);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* The images to send, each shown at once from its file while it is read: a placeholder that shimmers until
|
|
76
|
+
* the thumbnail paints, and a spinner until it can be sent.
|
|
77
|
+
*/
|
|
78
|
+
export function Attachments({ attachments, onRemove }: { attachments: ComposerAttachment[]; onRemove(id: string): void }) {
|
|
79
|
+
const t = useT();
|
|
80
|
+
return (
|
|
81
|
+
<div className="ta-attachments">
|
|
82
|
+
{attachments.map(attachment => (
|
|
83
|
+
<div key={attachment.id} className={`ta-attachment ${attachment.image ? '' : 'ta-attachment-loading'}`} aria-busy={!attachment.image}>
|
|
84
|
+
{attachment.preview ? <img className="ta-thumb" src={attachment.preview} alt="" decoding="async" /> : <div className="ta-thumb" />}
|
|
85
|
+
{!attachment.image && (
|
|
86
|
+
<span className="ta-attachment-spinner" role="status" aria-label={t('ta.composer.imageLoading')}>
|
|
87
|
+
<span className="ta-spinner" />
|
|
88
|
+
</span>
|
|
89
|
+
)}
|
|
90
|
+
<button
|
|
91
|
+
type="button"
|
|
92
|
+
className="ta-attachment-remove"
|
|
93
|
+
aria-label={t('ta.composer.removeImage')}
|
|
94
|
+
title={t('ta.composer.removeImage')}
|
|
95
|
+
onClick={() => onRemove(attachment.id)}
|
|
96
|
+
>
|
|
97
|
+
<Icon icon={X} size={12} />
|
|
98
|
+
</button>
|
|
99
|
+
</div>
|
|
100
|
+
))}
|
|
101
|
+
</div>
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/** The + on the left of the box: what is not typing, in one place. A list opens in place of the menu. */
|
|
106
|
+
function PlusMenu({ sections, onClose }: { sections: ComposerAction[][]; onClose(): void }) {
|
|
107
|
+
const [open, setOpen] = React.useState<ComposerAction>();
|
|
108
|
+
const shown = open?.items ? [open.items] : sections;
|
|
109
|
+
const pick = (action: ComposerAction) => {
|
|
110
|
+
if (action.items) {
|
|
111
|
+
setOpen(action);
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
onClose();
|
|
115
|
+
action.run?.();
|
|
116
|
+
};
|
|
117
|
+
return (
|
|
118
|
+
<div className="ta-plus-menu" role="menu" aria-label={open?.label}>
|
|
119
|
+
{open && (
|
|
120
|
+
<button type="button" className="ta-plus-back" onClick={() => setOpen(undefined)}>
|
|
121
|
+
<Icon icon={ChevronLeft} size={15} />
|
|
122
|
+
<span>{open.label}</span>
|
|
123
|
+
</button>
|
|
124
|
+
)}
|
|
125
|
+
<div className="ta-plus-items">
|
|
126
|
+
{shown.map((section, index) => (
|
|
127
|
+
<React.Fragment key={index}>
|
|
128
|
+
{index > 0 && <hr className="ta-plus-line" />}
|
|
129
|
+
{section.map(action => (
|
|
130
|
+
<button
|
|
131
|
+
key={action.key}
|
|
132
|
+
type="button"
|
|
133
|
+
role="menuitem"
|
|
134
|
+
className="ta-plus-item"
|
|
135
|
+
disabled={action.disabled}
|
|
136
|
+
onClick={() => pick(action)}
|
|
137
|
+
>
|
|
138
|
+
<span className="ta-plus-icon">{action.icon ?? (action.checked ? <Icon icon={Check} size={15} /> : null)}</span>
|
|
139
|
+
<span className="ta-plus-label">{action.label}</span>
|
|
140
|
+
{action.detail && <span className="ta-plus-detail">{action.detail}</span>}
|
|
141
|
+
{action.items && <Icon icon={ChevronRight} size={14} className="ta-plus-chevron" />}
|
|
142
|
+
</button>
|
|
143
|
+
))}
|
|
144
|
+
</React.Fragment>
|
|
145
|
+
))}
|
|
146
|
+
</div>
|
|
147
|
+
</div>
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* The message box of every conversation: Enter sends, Shift+Enter is a new line, Alt+Enter a follow-up;
|
|
153
|
+
* `/` lists commands, `@` the `mentions` its owner finds; images are pasted, dropped or picked. The rest (images,
|
|
154
|
+
* mentions, commands, the settings of the conversation) is behind the + on its left.
|
|
155
|
+
*/
|
|
156
|
+
export const ComposerBox = React.forwardRef<ComposerBoxHandle, ComposerBoxProps>(function ComposerBox(props, ref) {
|
|
157
|
+
const {
|
|
158
|
+
placeholder,
|
|
159
|
+
working = false,
|
|
160
|
+
onStop,
|
|
161
|
+
onSend,
|
|
162
|
+
commands = [],
|
|
163
|
+
onMentionQuery,
|
|
164
|
+
mentions,
|
|
165
|
+
mentionLabel,
|
|
166
|
+
images: takesImages,
|
|
167
|
+
actions = [],
|
|
168
|
+
above,
|
|
169
|
+
beside,
|
|
170
|
+
after,
|
|
171
|
+
autoFocus,
|
|
172
|
+
onError,
|
|
173
|
+
} = props;
|
|
174
|
+
const t = useT();
|
|
175
|
+
const [text, setText] = React.useState('');
|
|
176
|
+
const [caret, setCaret] = React.useState(0);
|
|
177
|
+
const [attachments, setAttachments] = React.useState<ComposerAttachment[]>([]);
|
|
178
|
+
const [selected, setSelected] = React.useState(0);
|
|
179
|
+
const [dismissed, setDismissed] = React.useState<string>();
|
|
180
|
+
const [dragging, setDragging] = React.useState(false);
|
|
181
|
+
const [menu, setMenu] = React.useState(false);
|
|
182
|
+
const input = React.useRef<HTMLTextAreaElement>(null);
|
|
183
|
+
const picker = React.useRef<HTMLInputElement>(null);
|
|
184
|
+
const plus = React.useRef<HTMLDivElement>(null);
|
|
185
|
+
const menuId = React.useId();
|
|
186
|
+
|
|
187
|
+
const found = ComposerUtil.trigger(text, caret);
|
|
188
|
+
const trigger = found && `${found.kind}:${found.start}` !== dismissed ? found : undefined;
|
|
189
|
+
const query = trigger?.kind === 'file' ? trigger.query : undefined;
|
|
190
|
+
React.useEffect(() => onMentionQuery?.(query), [onMentionQuery, query]);
|
|
191
|
+
const items: ComposerMenuItem[] =
|
|
192
|
+
trigger?.kind === 'command'
|
|
193
|
+
? ComposerUtil.commands(commands, trigger.query).map(command => ({ key: command.name, label: `/${command.name}`, detail: command.description }))
|
|
194
|
+
: trigger?.kind === 'file'
|
|
195
|
+
? onMentionQuery
|
|
196
|
+
? (mentions?.items ?? [])
|
|
197
|
+
: []
|
|
198
|
+
: [];
|
|
199
|
+
const note = trigger?.kind === 'file' && onMentionQuery && !items.length ? mentions?.note : undefined;
|
|
200
|
+
const sendable = text.trim().length > 0 || attachments.length > 0;
|
|
201
|
+
const action = ComposerUtil.action(working, sendable);
|
|
202
|
+
// An image still being read holds the message back, rather than leaving without it.
|
|
203
|
+
const reading = !ComposerUtil.ready(attachments);
|
|
204
|
+
|
|
205
|
+
// Grows with the text, up to a limit; measured again when the text or the width changes (the first
|
|
206
|
+
// layout of a page can be narrower than the last).
|
|
207
|
+
const fit = React.useCallback(() => {
|
|
208
|
+
const element = input.current;
|
|
209
|
+
if (element) {
|
|
210
|
+
element.style.height = 'auto';
|
|
211
|
+
element.style.height = `${Math.min(element.scrollHeight, 240)}px`;
|
|
212
|
+
}
|
|
213
|
+
}, []);
|
|
214
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: the height is measured again whenever the text changes
|
|
215
|
+
React.useLayoutEffect(fit, [text]);
|
|
216
|
+
React.useEffect(() => {
|
|
217
|
+
const element = input.current;
|
|
218
|
+
if (!element || typeof ResizeObserver === 'undefined') {
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
let width = element.clientWidth;
|
|
222
|
+
const observer = new ResizeObserver(() => {
|
|
223
|
+
if (element.clientWidth !== width) {
|
|
224
|
+
width = element.clientWidth;
|
|
225
|
+
fit();
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
observer.observe(element);
|
|
229
|
+
return () => observer.disconnect();
|
|
230
|
+
}, [fit]);
|
|
231
|
+
React.useEffect(() => {
|
|
232
|
+
if (!menu) {
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
const close = (event: Event) => {
|
|
236
|
+
if (!plus.current?.contains(event.target as Node)) {
|
|
237
|
+
setMenu(false);
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
const onKey = (event: KeyboardEvent) => event.key === 'Escape' && setMenu(false);
|
|
241
|
+
document.addEventListener('pointerdown', close);
|
|
242
|
+
document.addEventListener('keydown', onKey);
|
|
243
|
+
return () => {
|
|
244
|
+
document.removeEventListener('pointerdown', close);
|
|
245
|
+
document.removeEventListener('keydown', onKey);
|
|
246
|
+
};
|
|
247
|
+
}, [menu]);
|
|
248
|
+
|
|
249
|
+
const edit = (next: string, position: number) => {
|
|
250
|
+
setText(next);
|
|
251
|
+
setCaret(position);
|
|
252
|
+
setSelected(0);
|
|
253
|
+
setDismissed(undefined);
|
|
254
|
+
requestAnimationFrame(() => {
|
|
255
|
+
input.current?.focus();
|
|
256
|
+
input.current?.setSelectionRange(position, position);
|
|
257
|
+
});
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
const latest = React.useRef(text);
|
|
261
|
+
latest.current = text;
|
|
262
|
+
React.useImperativeHandle(ref, () => ({ text: () => latest.current, setText: next => edit(next, next.length) }));
|
|
263
|
+
|
|
264
|
+
const pick = (item: ComposerMenuItem) => {
|
|
265
|
+
if (!trigger) {
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
const insertion = trigger.kind === 'command' ? item.label : ComposerUtil.reference(item.key);
|
|
269
|
+
const next = ComposerUtil.replace(text, trigger, insertion);
|
|
270
|
+
edit(next.text, next.caret);
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
/** A command typed out in full: Enter sends it rather than picking it again. */
|
|
274
|
+
const typed = (item: ComposerMenuItem | undefined) => trigger?.kind === 'command' && item?.label === text.trim();
|
|
275
|
+
|
|
276
|
+
const send = (followUp: boolean) => {
|
|
277
|
+
const message = text.trim();
|
|
278
|
+
if ((!message && !attachments.length) || reading) {
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
const attached = attachments;
|
|
282
|
+
setText('');
|
|
283
|
+
setCaret(0);
|
|
284
|
+
setAttachments([]);
|
|
285
|
+
onSend(message, ComposerUtil.images(attached), followUp).then(
|
|
286
|
+
() => ComposerUtil.release(attached),
|
|
287
|
+
error => {
|
|
288
|
+
setText(message);
|
|
289
|
+
setAttachments(attached);
|
|
290
|
+
onError(error);
|
|
291
|
+
},
|
|
292
|
+
);
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
const remove = (id: string) => {
|
|
296
|
+
ComposerUtil.release(attachments.filter(attachment => attachment.id === id));
|
|
297
|
+
setAttachments(previous => previous.filter(attachment => attachment.id !== id));
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
// The previews of a box that goes away go with it.
|
|
301
|
+
const shown = React.useRef(attachments);
|
|
302
|
+
shown.current = attachments;
|
|
303
|
+
React.useEffect(() => () => ComposerUtil.release(shown.current), []);
|
|
304
|
+
|
|
305
|
+
/** Shows each image at once from its file, and reads them all at the same time. */
|
|
306
|
+
const addFiles = (list: FileList | File[]) => {
|
|
307
|
+
const added: { attachment: ComposerAttachment; file: File }[] = [];
|
|
308
|
+
for (const file of Array.from(list)) {
|
|
309
|
+
const reason = ComposerUtil.rejectImage(file, attachments.length + added.length);
|
|
310
|
+
if (reason) {
|
|
311
|
+
onError(new Error(t(`ta.composer.image.${reason}`, { name: file.name })));
|
|
312
|
+
continue;
|
|
313
|
+
}
|
|
314
|
+
added.push({ attachment: { id: crypto.randomUUID(), preview: URL.createObjectURL(file) }, file });
|
|
315
|
+
}
|
|
316
|
+
if (!added.length) {
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
setAttachments(previous => [...previous, ...added.map(({ attachment }) => attachment)]);
|
|
320
|
+
for (const { attachment, file } of added) {
|
|
321
|
+
void readImage(file).then(image => {
|
|
322
|
+
if (!image) {
|
|
323
|
+
ComposerUtil.release([attachment]);
|
|
324
|
+
}
|
|
325
|
+
setAttachments(previous =>
|
|
326
|
+
image
|
|
327
|
+
? previous.map(other => (other.id === attachment.id ? { ...other, image } : other))
|
|
328
|
+
: previous.filter(other => other.id !== attachment.id),
|
|
329
|
+
);
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
const onKeyDown = (event: React.KeyboardEvent<HTMLTextAreaElement>) => {
|
|
335
|
+
const composing = event.nativeEvent.isComposing || event.keyCode === 229;
|
|
336
|
+
if (items.length && !composing && (event.key === 'ArrowDown' || event.key === 'ArrowUp')) {
|
|
337
|
+
event.preventDefault();
|
|
338
|
+
setSelected((selected + (event.key === 'ArrowDown' ? 1 : items.length - 1)) % items.length);
|
|
339
|
+
} else if (items.length && !composing && (event.key === 'Tab' || (event.key === 'Enter' && !event.shiftKey && !typed(items[selected])))) {
|
|
340
|
+
event.preventDefault();
|
|
341
|
+
pick(items[selected] ?? items[0]);
|
|
342
|
+
} else if (trigger && event.key === 'Escape') {
|
|
343
|
+
event.preventDefault();
|
|
344
|
+
setDismissed(`${trigger.kind}:${trigger.start}`);
|
|
345
|
+
} else if (ComposerUtil.isSend({ key: event.key, shiftKey: event.shiftKey, isComposing: event.nativeEvent.isComposing, keyCode: event.keyCode })) {
|
|
346
|
+
event.preventDefault();
|
|
347
|
+
send(event.altKey);
|
|
348
|
+
} else if (event.key === 'Escape' && working && onStop) {
|
|
349
|
+
event.preventDefault();
|
|
350
|
+
onStop();
|
|
351
|
+
}
|
|
352
|
+
};
|
|
353
|
+
|
|
354
|
+
const onPaste = (event: React.ClipboardEvent<HTMLTextAreaElement>) => {
|
|
355
|
+
const pasted = takesImages ? Array.from(event.clipboardData.files).filter(file => file.type.startsWith('image/')) : [];
|
|
356
|
+
if (pasted.length) {
|
|
357
|
+
event.preventDefault();
|
|
358
|
+
addFiles(pasted);
|
|
359
|
+
}
|
|
360
|
+
};
|
|
361
|
+
|
|
362
|
+
const onDrop = (event: React.DragEvent<HTMLDivElement>) => {
|
|
363
|
+
setDragging(false);
|
|
364
|
+
if (takesImages && event.dataTransfer.files.length) {
|
|
365
|
+
event.preventDefault();
|
|
366
|
+
addFiles(event.dataTransfer.files);
|
|
367
|
+
}
|
|
368
|
+
};
|
|
369
|
+
|
|
370
|
+
const own: ComposerAction[] = [];
|
|
371
|
+
if (takesImages) {
|
|
372
|
+
own.push({ key: 'image', label: t('ta.composer.addImage'), icon: <Icon icon={ImagePlus} size={16} />, run: () => picker.current?.click() });
|
|
373
|
+
}
|
|
374
|
+
if (mentionLabel) {
|
|
375
|
+
own.push({ key: 'mention', label: mentionLabel, icon: <Icon icon={AtSign} size={16} />, run: () => edit(...ComposerUtil.insert(text, caret, '@')) });
|
|
376
|
+
}
|
|
377
|
+
if (commands.length) {
|
|
378
|
+
own.push({
|
|
379
|
+
key: 'command',
|
|
380
|
+
label: t('ta.composer.commands'),
|
|
381
|
+
icon: <Icon icon={Slash} size={16} />,
|
|
382
|
+
run: () => edit(`/${text.replace(/^\//, '')}`, 1),
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
const typing = (action: ComposerAction): ComposerAction =>
|
|
386
|
+
action.insert === undefined ? action : { ...action, run: () => edit(...ComposerUtil.insert(text, caret, action.insert as string)) };
|
|
387
|
+
const sections = [own, ...actions.map(section => section.map(typing))].filter(section => section.length > 0);
|
|
388
|
+
|
|
389
|
+
return (
|
|
390
|
+
<div className="ta-console-composer">
|
|
391
|
+
{(items.length > 0 || note) && <ComposerMenu id={menuId} items={items} selected={selected} note={note} onPick={pick} onHover={setSelected} />}
|
|
392
|
+
{above}
|
|
393
|
+
{/* biome-ignore lint/a11y/noStaticElementInteractions: dropping images is a shortcut; the + menu does the same */}
|
|
394
|
+
<div
|
|
395
|
+
className={`ta-console-box ${dragging ? 'ta-dragging' : ''}`}
|
|
396
|
+
onDragOver={event => {
|
|
397
|
+
if (takesImages && event.dataTransfer.types.includes('Files')) {
|
|
398
|
+
event.preventDefault();
|
|
399
|
+
setDragging(true);
|
|
400
|
+
}
|
|
401
|
+
}}
|
|
402
|
+
onDragLeave={() => setDragging(false)}
|
|
403
|
+
onDrop={onDrop}
|
|
404
|
+
>
|
|
405
|
+
{attachments.length > 0 && <Attachments attachments={attachments} onRemove={remove} />}
|
|
406
|
+
<div className="ta-console-row">
|
|
407
|
+
{sections.length > 0 && (
|
|
408
|
+
<div className="ta-plus" ref={plus}>
|
|
409
|
+
<IconButton
|
|
410
|
+
icon={Plus}
|
|
411
|
+
label={t('ta.composer.more')}
|
|
412
|
+
className={`ta-attach ta-plus-button ${menu ? 'ta-on' : ''}`}
|
|
413
|
+
onClick={() => setMenu(!menu)}
|
|
414
|
+
/>
|
|
415
|
+
{menu && <PlusMenu sections={sections} onClose={() => setMenu(false)} />}
|
|
416
|
+
</div>
|
|
417
|
+
)}
|
|
418
|
+
{beside}
|
|
419
|
+
{takesImages && (
|
|
420
|
+
<input
|
|
421
|
+
ref={picker}
|
|
422
|
+
type="file"
|
|
423
|
+
accept={IMAGE_TYPES.join(',')}
|
|
424
|
+
multiple
|
|
425
|
+
hidden
|
|
426
|
+
onChange={event => {
|
|
427
|
+
if (event.target.files) {
|
|
428
|
+
addFiles(event.target.files);
|
|
429
|
+
}
|
|
430
|
+
event.target.value = '';
|
|
431
|
+
}}
|
|
432
|
+
/>
|
|
433
|
+
)}
|
|
434
|
+
<textarea
|
|
435
|
+
ref={input}
|
|
436
|
+
rows={1}
|
|
437
|
+
value={text}
|
|
438
|
+
autoFocus={autoFocus}
|
|
439
|
+
aria-label={t('ta.composer.label')}
|
|
440
|
+
aria-controls={items.length ? menuId : undefined}
|
|
441
|
+
aria-activedescendant={items.length ? `${menuId}-${selected}` : undefined}
|
|
442
|
+
placeholder={placeholder}
|
|
443
|
+
onChange={event => {
|
|
444
|
+
setText(event.target.value);
|
|
445
|
+
setCaret(event.target.selectionStart);
|
|
446
|
+
setSelected(0);
|
|
447
|
+
}}
|
|
448
|
+
onSelect={event => setCaret(event.currentTarget.selectionStart)}
|
|
449
|
+
onKeyDown={onKeyDown}
|
|
450
|
+
onPaste={onPaste}
|
|
451
|
+
/>
|
|
452
|
+
{after}
|
|
453
|
+
<button
|
|
454
|
+
type="button"
|
|
455
|
+
className={`ta-send ${action === 'stop' ? 'ta-send-stop' : ''}`}
|
|
456
|
+
disabled={action === 'send' && (!sendable || reading)}
|
|
457
|
+
title={
|
|
458
|
+
action === 'stop'
|
|
459
|
+
? t('ta.composer.stopTitle')
|
|
460
|
+
: reading
|
|
461
|
+
? t('ta.composer.imageLoading')
|
|
462
|
+
: working
|
|
463
|
+
? t('ta.composer.steerTitle')
|
|
464
|
+
: t('ta.send')
|
|
465
|
+
}
|
|
466
|
+
aria-label={action === 'stop' ? t('ta.stop') : t('ta.send')}
|
|
467
|
+
onClick={() => (action === 'stop' ? onStop?.() : send(false))}
|
|
468
|
+
>
|
|
469
|
+
<Icon icon={action === 'stop' ? Square : ArrowUp} size={action === 'stop' ? 14 : 18} />
|
|
470
|
+
</button>
|
|
471
|
+
</div>
|
|
472
|
+
</div>
|
|
473
|
+
</div>
|
|
474
|
+
);
|
|
475
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
export interface ComposerMenuItem {
|
|
4
|
+
key: string;
|
|
5
|
+
label: string;
|
|
6
|
+
detail?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface ComposerMenuProps {
|
|
10
|
+
id: string;
|
|
11
|
+
items: ComposerMenuItem[];
|
|
12
|
+
selected: number;
|
|
13
|
+
/** Instead of the items: why there are none. */
|
|
14
|
+
note?: string;
|
|
15
|
+
onPick(item: ComposerMenuItem): void;
|
|
16
|
+
onHover(index: number): void;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** The commands or files for what is typed; the keys stay in the message box, which owns the selection. */
|
|
20
|
+
export function ComposerMenu({ id, items, selected, note, onPick, onHover }: ComposerMenuProps) {
|
|
21
|
+
const list = React.useRef<HTMLDivElement>(null);
|
|
22
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: keeps the selected item in view whenever the selection moves
|
|
23
|
+
React.useEffect(() => {
|
|
24
|
+
list.current?.querySelector('.ta-selected')?.scrollIntoView({ block: 'nearest' });
|
|
25
|
+
}, [selected]);
|
|
26
|
+
return (
|
|
27
|
+
<div className={`ta-commands ${items.length ? '' : 'ta-commands-note'}`} id={id} role="listbox" ref={list}>
|
|
28
|
+
{items.map((item, index) => (
|
|
29
|
+
<button
|
|
30
|
+
key={item.key}
|
|
31
|
+
id={`${id}-${index}`}
|
|
32
|
+
type="button"
|
|
33
|
+
role="option"
|
|
34
|
+
aria-selected={index === selected}
|
|
35
|
+
tabIndex={-1}
|
|
36
|
+
className={`ta-command ${index === selected ? 'ta-selected' : ''}`}
|
|
37
|
+
// Keeps the focus in the message box.
|
|
38
|
+
onMouseDown={event => event.preventDefault()}
|
|
39
|
+
onMouseEnter={() => onHover(index)}
|
|
40
|
+
onClick={() => onPick(item)}
|
|
41
|
+
>
|
|
42
|
+
<span className="ta-command-label">{item.label}</span>
|
|
43
|
+
{item.detail && <span className="ta-muted">{item.detail}</span>}
|
|
44
|
+
</button>
|
|
45
|
+
))}
|
|
46
|
+
{!items.length && note && <div className="ta-command-note">{note}</div>}
|
|
47
|
+
</div>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { describe, expect, it } from 'bun:test';
|
|
2
|
+
import type { SessionStore } from '@celljs/ta-client';
|
|
3
|
+
import type { TaServer, TaWorkspaceServer } from '@celljs/ta-protocol';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { renderToStaticMarkup } from 'react-dom/server';
|
|
6
|
+
import { ComposerUtil } from '../util/composer';
|
|
7
|
+
import { Composer } from './composer';
|
|
8
|
+
import { Attachments } from './composer-box';
|
|
9
|
+
|
|
10
|
+
const store = { sessionId: 's1', onEvent: () => () => undefined } as unknown as SessionStore;
|
|
11
|
+
const server = {} as TaServer;
|
|
12
|
+
const workspace = {} as TaWorkspaceServer;
|
|
13
|
+
|
|
14
|
+
/** React warns that the layout effect (the height of the box) does not run on the server; here it need not. */
|
|
15
|
+
function render(element: React.ReactElement): string {
|
|
16
|
+
const error = console.error;
|
|
17
|
+
console.error = () => undefined;
|
|
18
|
+
try {
|
|
19
|
+
return renderToStaticMarkup(element);
|
|
20
|
+
} finally {
|
|
21
|
+
console.error = error;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
describe('Composer', () => {
|
|
26
|
+
it('has one button that sends, and stops while the agent works with nothing to send', () => {
|
|
27
|
+
const idle = render(<Composer store={store} server={server} workspace={workspace} working={false} commands={[]} onError={() => undefined} />);
|
|
28
|
+
expect(idle).toContain('aria-label="Send"');
|
|
29
|
+
expect(idle).toContain('disabled=""');
|
|
30
|
+
expect(idle).toContain('@ for files');
|
|
31
|
+
const working = render(<Composer store={store} server={server} workspace={workspace} working commands={[]} onError={() => undefined} />);
|
|
32
|
+
expect(working).toContain('aria-label="Stop"');
|
|
33
|
+
expect(working).toContain('ta-send-stop');
|
|
34
|
+
expect(working).not.toContain('aria-label="Send"');
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('takes images with a picker that accepts only what pi can send, behind the + on the left', () => {
|
|
38
|
+
const html = render(<Composer store={store} server={server} workspace={workspace} working={false} commands={[]} onError={() => undefined} />);
|
|
39
|
+
expect(html).toContain('accept="image/png,image/jpeg,image/gif,image/webp"');
|
|
40
|
+
expect(html).toContain('aria-label="Add and settings"');
|
|
41
|
+
// The + comes before the text, the send button after it.
|
|
42
|
+
expect(html.indexOf('ta-plus-button')).toBeLessThan(html.indexOf('<textarea'));
|
|
43
|
+
expect(html.indexOf('<textarea')).toBeLessThan(html.indexOf('ta-send'));
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('takes the hint, what goes above the box and what goes on its right from its owner, as the double does', () => {
|
|
47
|
+
const html = render(
|
|
48
|
+
<Composer
|
|
49
|
+
store={store}
|
|
50
|
+
server={server}
|
|
51
|
+
workspace={workspace}
|
|
52
|
+
working={false}
|
|
53
|
+
commands={[]}
|
|
54
|
+
placeholder="Give Ta something to do"
|
|
55
|
+
above={<div className="ta-notice-above">waiting</div>}
|
|
56
|
+
after={<button type="button" className="ta-mic" />}
|
|
57
|
+
onError={() => undefined}
|
|
58
|
+
/>,
|
|
59
|
+
);
|
|
60
|
+
expect(html).toContain('placeholder="Give Ta something to do"');
|
|
61
|
+
expect(html).not.toContain('@ for files');
|
|
62
|
+
expect(html.indexOf('ta-notice-above')).toBeLessThan(html.indexOf('<textarea'));
|
|
63
|
+
// The microphone of the double sits on the right, between the text and the send button.
|
|
64
|
+
expect(html.indexOf('<textarea')).toBeLessThan(html.indexOf('ta-mic'));
|
|
65
|
+
expect(html.indexOf('ta-mic')).toBeLessThan(html.indexOf('ta-send'));
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it('puts what it is given beside the +, in the row of the text, as the directory of a new conversation', () => {
|
|
69
|
+
const html = render(
|
|
70
|
+
<Composer
|
|
71
|
+
server={server}
|
|
72
|
+
workspace={workspace}
|
|
73
|
+
working={false}
|
|
74
|
+
commands={[]}
|
|
75
|
+
onError={() => undefined}
|
|
76
|
+
beside={<button type="button" className="ta-cwd-chip" />}
|
|
77
|
+
/>,
|
|
78
|
+
);
|
|
79
|
+
expect(html.indexOf('ta-plus-button')).toBeLessThan(html.indexOf('ta-cwd-chip'));
|
|
80
|
+
expect(html.indexOf('ta-cwd-chip')).toBeLessThan(html.indexOf('<textarea'));
|
|
81
|
+
expect(html.indexOf('ta-console-row')).toBeLessThan(html.indexOf('ta-cwd-chip'));
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it('shows an image being read at once, with a spinner until it can be sent', () => {
|
|
85
|
+
const image = { type: 'image' as const, data: 'AAAA', mimeType: 'image/png' };
|
|
86
|
+
const html = render(
|
|
87
|
+
<Attachments
|
|
88
|
+
attachments={[
|
|
89
|
+
{ id: 'a', preview: 'blob:a', image },
|
|
90
|
+
{ id: 'b', preview: 'blob:b' },
|
|
91
|
+
]}
|
|
92
|
+
onRemove={() => undefined}
|
|
93
|
+
/>,
|
|
94
|
+
);
|
|
95
|
+
expect(html).toContain('src="blob:a"');
|
|
96
|
+
expect(html).toContain('src="blob:b"');
|
|
97
|
+
expect(html.match(/ta-attachment-loading/g)).toHaveLength(1);
|
|
98
|
+
expect(html.match(/ta-spinner/g)).toHaveLength(1);
|
|
99
|
+
expect(html).toContain('aria-label="Reading the image…"');
|
|
100
|
+
expect(html.indexOf('blob:a')).toBeLessThan(html.indexOf('ta-attachment-loading'));
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
it('sends the images once all are read, in their order', () => {
|
|
104
|
+
const a = { type: 'image' as const, data: 'A', mimeType: 'image/png' };
|
|
105
|
+
const b = { type: 'image' as const, data: 'B', mimeType: 'image/jpeg' };
|
|
106
|
+
expect(ComposerUtil.ready([])).toBe(true);
|
|
107
|
+
expect(ComposerUtil.ready([{ id: '1', image: a }, { id: '2' }])).toBe(false);
|
|
108
|
+
expect(
|
|
109
|
+
ComposerUtil.images([
|
|
110
|
+
{ id: '1', image: a },
|
|
111
|
+
{ id: '2', image: b },
|
|
112
|
+
]),
|
|
113
|
+
).toEqual([a, b]);
|
|
114
|
+
const revoked: string[] = [];
|
|
115
|
+
const revoke = URL.revokeObjectURL;
|
|
116
|
+
URL.revokeObjectURL = url => revoked.push(url);
|
|
117
|
+
try {
|
|
118
|
+
ComposerUtil.release([{ id: '1', preview: 'blob:1' }, { id: '2' }]);
|
|
119
|
+
} finally {
|
|
120
|
+
URL.revokeObjectURL = revoke;
|
|
121
|
+
}
|
|
122
|
+
expect(revoked).toEqual(['blob:1']);
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
it('puts text where the caret is, after a space when it would join a word', () => {
|
|
126
|
+
expect(ComposerUtil.insert('', 0, '@')).toEqual(['@', 1]);
|
|
127
|
+
expect(ComposerUtil.insert('hi', 2, '@')).toEqual(['hi @', 4]);
|
|
128
|
+
expect(ComposerUtil.insert('hi there', 3, '@')).toEqual(['hi @there', 4]);
|
|
129
|
+
});
|
|
130
|
+
});
|