@celljs/ta-web 0.0.0-stage → 4.6.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.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,330 @@
|
|
|
1
|
+
import { LinkUtil } from './link.js';
|
|
2
|
+
const FENCE = /^\s*(`{3,}|~{3,})\s*([\w+-]*)/;
|
|
3
|
+
const HEADING = /^(#{1,6})\s+(.*)$/;
|
|
4
|
+
const RULE = /^\s*([-*_])(\s*\1){2,}\s*$/;
|
|
5
|
+
const BULLET = /^\s*[-*+]\s+(.*)$/;
|
|
6
|
+
const NUMBERED = /^\s*\d+[.)]\s+(.*)$/;
|
|
7
|
+
const TABLE_SEPARATOR = /^\s*\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)*\|?\s*$/;
|
|
8
|
+
const SCHEME = /^[a-z][a-z\d+.-]*:/i;
|
|
9
|
+
/** Data URLs of media, which show without a request; scripts in an SVG image do not run. */
|
|
10
|
+
const DATA_MEDIA = /^data:(image|video|audio)\/[\w.+-]+[;,]/i;
|
|
11
|
+
const EXTENSIONS = {
|
|
12
|
+
png: 'image',
|
|
13
|
+
jpg: 'image',
|
|
14
|
+
jpeg: 'image',
|
|
15
|
+
gif: 'image',
|
|
16
|
+
webp: 'image',
|
|
17
|
+
avif: 'image',
|
|
18
|
+
svg: 'image',
|
|
19
|
+
bmp: 'image',
|
|
20
|
+
ico: 'image',
|
|
21
|
+
mp4: 'video',
|
|
22
|
+
m4v: 'video',
|
|
23
|
+
webm: 'video',
|
|
24
|
+
mov: 'video',
|
|
25
|
+
ogv: 'video',
|
|
26
|
+
mp3: 'audio',
|
|
27
|
+
m4a: 'audio',
|
|
28
|
+
wav: 'audio',
|
|
29
|
+
ogg: 'audio',
|
|
30
|
+
oga: 'audio',
|
|
31
|
+
flac: 'audio',
|
|
32
|
+
aac: 'audio',
|
|
33
|
+
};
|
|
34
|
+
const IMAGE = /^!\[([^\]]*)\]\(\s*(?:<([^>]+)>|([^)\s]+))(?:\s+"[^"]*")?\s*\)/;
|
|
35
|
+
/** A target may hold parentheses in pairs, as `https://en.wikipedia.org/wiki/A_(b)`. */
|
|
36
|
+
const LINK = /^\[([^\]]+)\]\(\s*(?:<([^>]+)>|((?:[^()\s]|\([^()\s]*\))+))(?:\s+"[^"]*")?\s*\)/;
|
|
37
|
+
const AUTOLINK = /^<(https?:\/\/[^>\s]+)>/i;
|
|
38
|
+
/** What may come right before a bare URL: not a letter, a digit or a part of a path. */
|
|
39
|
+
const BEFORE_URL = /[\w/.@:-]/;
|
|
40
|
+
/** `$x$`: no space inside the dollars, no digit after the closing one, so that `$5 and $10` stays text. */
|
|
41
|
+
const INLINE_MATH = /^\$(?=[^\s$])([^$]*?[^\s$\\])\$(?!\d)/;
|
|
42
|
+
const PUNCTUATION = /[!-/:-@[-`{-~]/;
|
|
43
|
+
/**
|
|
44
|
+
* The markdown models write: fenced code, headings, lists, quotes, tables, emphasis, code spans, links,
|
|
45
|
+
* images and videos, and TeX between `$`, `$$`, `\\(\\)` or `\\[\\]`. Its output is data for React to
|
|
46
|
+
* render, never HTML, so text from the model cannot inject markup; links keep only http(s) and mailto
|
|
47
|
+
* URLs and paths of files (LinkUtil.parse), and URLs in the text are links too. An unclosed fence or
|
|
48
|
+
* formula, as while a reply streams, runs to the end.
|
|
49
|
+
*/
|
|
50
|
+
export var MarkdownUtil;
|
|
51
|
+
(function (MarkdownUtil) {
|
|
52
|
+
function blocks(source) {
|
|
53
|
+
var _a, _b;
|
|
54
|
+
const lines = source.replace(/\r\n?/g, '\n').split('\n');
|
|
55
|
+
const blocks = [];
|
|
56
|
+
let paragraph = [];
|
|
57
|
+
const flush = () => {
|
|
58
|
+
if (paragraph.length) {
|
|
59
|
+
blocks.push({ type: 'paragraph', text: paragraph.join('\n') });
|
|
60
|
+
paragraph = [];
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
for (let i = 0; i < lines.length; i++) {
|
|
64
|
+
const line = lines[i];
|
|
65
|
+
const fence = FENCE.exec(line);
|
|
66
|
+
if (fence) {
|
|
67
|
+
flush();
|
|
68
|
+
const code = [];
|
|
69
|
+
const close = new RegExp(`^\\s*${fence[1][0]}{${fence[1].length},}\\s*$`);
|
|
70
|
+
for (i++; i < lines.length && !close.test(lines[i]); i++) {
|
|
71
|
+
code.push(lines[i]);
|
|
72
|
+
}
|
|
73
|
+
if (fence[2].toLowerCase() === 'math') {
|
|
74
|
+
blocks.push({ type: 'math', tex: code.join('\n'), closed: i < lines.length });
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
blocks.push({ type: 'code', language: fence[2], code: code.join('\n') });
|
|
78
|
+
}
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
const math = mathBlock(lines, i);
|
|
82
|
+
if (math) {
|
|
83
|
+
flush();
|
|
84
|
+
blocks.push(math.block);
|
|
85
|
+
i = math.end;
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
if (!line.trim()) {
|
|
89
|
+
flush();
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
const heading = HEADING.exec(line);
|
|
93
|
+
if (heading) {
|
|
94
|
+
flush();
|
|
95
|
+
blocks.push({ type: 'heading', level: heading[1].length, text: heading[2].replace(/\s+#+\s*$/, '') });
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
if (RULE.test(line) && !paragraph.length) {
|
|
99
|
+
blocks.push({ type: 'rule' });
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
if (line.trimStart().startsWith('>')) {
|
|
103
|
+
flush();
|
|
104
|
+
const quote = [];
|
|
105
|
+
for (; i < lines.length && lines[i].trimStart().startsWith('>'); i++) {
|
|
106
|
+
quote.push(lines[i].trimStart().replace(/^>\s?/, ''));
|
|
107
|
+
}
|
|
108
|
+
i--;
|
|
109
|
+
blocks.push({ type: 'quote', text: quote.join('\n') });
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
const item = (_a = BULLET.exec(line)) !== null && _a !== void 0 ? _a : NUMBERED.exec(line);
|
|
113
|
+
if (item) {
|
|
114
|
+
flush();
|
|
115
|
+
const ordered = !BULLET.test(line);
|
|
116
|
+
const pattern = ordered ? NUMBERED : BULLET;
|
|
117
|
+
const items = [];
|
|
118
|
+
for (; i < lines.length; i++) {
|
|
119
|
+
const next = pattern.exec(lines[i]);
|
|
120
|
+
if (next) {
|
|
121
|
+
items.push(next[1]);
|
|
122
|
+
}
|
|
123
|
+
else if (items.length && lines[i].trim() && /^\s{2,}/.test(lines[i])) {
|
|
124
|
+
items[items.length - 1] += `\n${lines[i].trim()}`;
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
i--;
|
|
131
|
+
blocks.push({ type: 'list', ordered, items });
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
if (line.includes('|') && TABLE_SEPARATOR.test((_b = lines[i + 1]) !== null && _b !== void 0 ? _b : '') && !paragraph.length) {
|
|
135
|
+
const header = cells(line);
|
|
136
|
+
const rows = [];
|
|
137
|
+
for (i += 2; i < lines.length && lines[i].includes('|') && lines[i].trim(); i++) {
|
|
138
|
+
rows.push(cells(lines[i]));
|
|
139
|
+
}
|
|
140
|
+
i--;
|
|
141
|
+
blocks.push({ type: 'table', header, rows });
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
paragraph.push(line);
|
|
145
|
+
}
|
|
146
|
+
flush();
|
|
147
|
+
return blocks;
|
|
148
|
+
}
|
|
149
|
+
MarkdownUtil.blocks = blocks;
|
|
150
|
+
function inline(text) {
|
|
151
|
+
var _a, _b, _c, _d, _e;
|
|
152
|
+
const out = [];
|
|
153
|
+
let plain = '';
|
|
154
|
+
const push = (node) => {
|
|
155
|
+
if (plain) {
|
|
156
|
+
out.push({ type: 'text', text: plain });
|
|
157
|
+
plain = '';
|
|
158
|
+
}
|
|
159
|
+
out.push(node);
|
|
160
|
+
};
|
|
161
|
+
for (let i = 0; i < text.length;) {
|
|
162
|
+
const rest = text.slice(i);
|
|
163
|
+
if (text[i] === '\\') {
|
|
164
|
+
const close = rest[1] === '(' ? '\\)' : rest[1] === '[' ? '\\]' : undefined;
|
|
165
|
+
const end = close ? rest.indexOf(close, 2) : -1;
|
|
166
|
+
if (close && end > 2) {
|
|
167
|
+
push({ type: 'math', tex: rest.slice(2, end).trim(), display: close === '\\]' });
|
|
168
|
+
i += end + 2;
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
if (PUNCTUATION.test((_a = rest[1]) !== null && _a !== void 0 ? _a : '')) {
|
|
172
|
+
plain += rest[1];
|
|
173
|
+
i += 2;
|
|
174
|
+
continue;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
if (text[i] === '$') {
|
|
178
|
+
const display = /^\$\$([\s\S]+?)\$\$/.exec(rest);
|
|
179
|
+
const math = display !== null && display !== void 0 ? display : INLINE_MATH.exec(rest);
|
|
180
|
+
if (math === null || math === void 0 ? void 0 : math[1].trim()) {
|
|
181
|
+
push({ type: 'math', tex: math[1].trim(), display: !!display });
|
|
182
|
+
i += math[0].length;
|
|
183
|
+
continue;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
const image = text[i] === '!' ? IMAGE.exec(rest) : null;
|
|
187
|
+
if (image) {
|
|
188
|
+
const src = (_b = image[2]) !== null && _b !== void 0 ? _b : image[3];
|
|
189
|
+
if (media(src)) {
|
|
190
|
+
push({ type: 'media', src, alt: image[1] });
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
plain += image[1];
|
|
194
|
+
}
|
|
195
|
+
i += image[0].length;
|
|
196
|
+
continue;
|
|
197
|
+
}
|
|
198
|
+
const code = /^(`+)([\s\S]*?[^`])\1(?!`)/.exec(rest);
|
|
199
|
+
if (code) {
|
|
200
|
+
push({ type: 'code', text: code[2].trim() || code[2] });
|
|
201
|
+
i += code[0].length;
|
|
202
|
+
continue;
|
|
203
|
+
}
|
|
204
|
+
const strong = /^(\*\*|__)(?=\S)([\s\S]*?\S)\1/.exec(rest);
|
|
205
|
+
if (strong) {
|
|
206
|
+
push({ type: 'strong', children: inline(strong[2]) });
|
|
207
|
+
i += strong[0].length;
|
|
208
|
+
continue;
|
|
209
|
+
}
|
|
210
|
+
const em = /^([*_])(?=\S)([\s\S]*?\S)\1(?![*_\w])/.exec(rest);
|
|
211
|
+
if (em && (em[1] === '*' || !/\w/.test((_c = text[i - 1]) !== null && _c !== void 0 ? _c : ''))) {
|
|
212
|
+
push({ type: 'em', children: inline(em[2]) });
|
|
213
|
+
i += em[0].length;
|
|
214
|
+
continue;
|
|
215
|
+
}
|
|
216
|
+
const link = text[i] === '[' ? LINK.exec(rest) : null;
|
|
217
|
+
if (link) {
|
|
218
|
+
const href = (_d = link[2]) !== null && _d !== void 0 ? _d : link[3];
|
|
219
|
+
const target = LinkUtil.parse(href);
|
|
220
|
+
if ((target === null || target === void 0 ? void 0 : target.type) === 'path' && !target.selection && localPath(href) !== undefined && media(href, false)) {
|
|
221
|
+
// A link to a picture or a video of the workspace shows it.
|
|
222
|
+
push({ type: 'media', src: href, alt: link[1] });
|
|
223
|
+
}
|
|
224
|
+
else if (target) {
|
|
225
|
+
push({ type: 'link', href, children: inline(link[1]) });
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
plain += link[1];
|
|
229
|
+
}
|
|
230
|
+
i += link[0].length;
|
|
231
|
+
continue;
|
|
232
|
+
}
|
|
233
|
+
const autolink = text[i] === '<' ? AUTOLINK.exec(rest) : null;
|
|
234
|
+
if (autolink) {
|
|
235
|
+
push({ type: 'link', href: autolink[1], children: [{ type: 'text', text: autolink[1] }] });
|
|
236
|
+
i += autolink[0].length;
|
|
237
|
+
continue;
|
|
238
|
+
}
|
|
239
|
+
const url = (text[i] === 'h' || text[i] === 'H') && !BEFORE_URL.test((_e = text[i - 1]) !== null && _e !== void 0 ? _e : '') ? LinkUtil.bareUrl(rest) : undefined;
|
|
240
|
+
if (url) {
|
|
241
|
+
push({ type: 'link', href: url, children: [{ type: 'text', text: url }] });
|
|
242
|
+
i += url.length;
|
|
243
|
+
continue;
|
|
244
|
+
}
|
|
245
|
+
plain += text[i++];
|
|
246
|
+
}
|
|
247
|
+
if (plain) {
|
|
248
|
+
out.push({ type: 'text', text: plain });
|
|
249
|
+
}
|
|
250
|
+
return out;
|
|
251
|
+
}
|
|
252
|
+
MarkdownUtil.inline = inline;
|
|
253
|
+
/**
|
|
254
|
+
* What a target of an image shows: by the type of a data URL, else by the extension of its path; an
|
|
255
|
+
* http(s) URL or a path without a known extension is taken for an image. Undefined for targets that
|
|
256
|
+
* show nothing, as `javascript:`; without `guess`, also for a target whose extension is not known.
|
|
257
|
+
*/
|
|
258
|
+
function media(src, guess = true) {
|
|
259
|
+
var _a;
|
|
260
|
+
const data = DATA_MEDIA.exec(src);
|
|
261
|
+
if (data) {
|
|
262
|
+
return data[1].toLowerCase();
|
|
263
|
+
}
|
|
264
|
+
if (!/^https?:/i.test(src) && localPath(src) === undefined) {
|
|
265
|
+
return undefined;
|
|
266
|
+
}
|
|
267
|
+
const extension = (_a = /\.(\w+)$/.exec(src.split(/[?#]/)[0])) === null || _a === void 0 ? void 0 : _a[1].toLowerCase();
|
|
268
|
+
return (extension && EXTENSIONS[extension]) || (guess ? 'image' : undefined);
|
|
269
|
+
}
|
|
270
|
+
MarkdownUtil.media = media;
|
|
271
|
+
/**
|
|
272
|
+
* The path of a file a target names: a relative or absolute path, or a `file:` URL of this machine;
|
|
273
|
+
* undefined for URLs, which the page loads as they are.
|
|
274
|
+
*/
|
|
275
|
+
function localPath(src) {
|
|
276
|
+
let path = src;
|
|
277
|
+
if (/^file:/i.test(src)) {
|
|
278
|
+
const url = /^file:\/\/(?:localhost)?(\/[^?#]*)/i.exec(src);
|
|
279
|
+
if (!url) {
|
|
280
|
+
return undefined;
|
|
281
|
+
}
|
|
282
|
+
path = url[1];
|
|
283
|
+
}
|
|
284
|
+
else if (SCHEME.test(src) || src.startsWith('//')) {
|
|
285
|
+
return undefined;
|
|
286
|
+
}
|
|
287
|
+
path = path.split(/[?#]/)[0];
|
|
288
|
+
try {
|
|
289
|
+
path = decodeURI(path);
|
|
290
|
+
}
|
|
291
|
+
catch (_a) {
|
|
292
|
+
// Kept as written.
|
|
293
|
+
}
|
|
294
|
+
return path || undefined;
|
|
295
|
+
}
|
|
296
|
+
MarkdownUtil.localPath = localPath;
|
|
297
|
+
/** `$$` or `\\[` starting at line `start`: its block and the line it ends on. */
|
|
298
|
+
function mathBlock(lines, start) {
|
|
299
|
+
const first = lines[start].trim();
|
|
300
|
+
const [open, close] = first.startsWith('$$') ? ['$$', '$$'] : first.startsWith('\\[') ? ['\\[', '\\]'] : [];
|
|
301
|
+
if (!open || !close) {
|
|
302
|
+
return undefined;
|
|
303
|
+
}
|
|
304
|
+
const head = first.slice(open.length);
|
|
305
|
+
// On one line, $$ x $$; text after it makes it inline math of a paragraph.
|
|
306
|
+
if (head.includes(close)) {
|
|
307
|
+
const at = head.indexOf(close);
|
|
308
|
+
return head.slice(at + close.length).trim() ? undefined : { block: { type: 'math', tex: head.slice(0, at).trim(), closed: true }, end: start };
|
|
309
|
+
}
|
|
310
|
+
const tex = head.trim() ? [head] : [];
|
|
311
|
+
for (let i = start + 1; i < lines.length; i++) {
|
|
312
|
+
const line = lines[i].trimEnd();
|
|
313
|
+
if (line.endsWith(close)) {
|
|
314
|
+
tex.push(line.slice(0, -close.length));
|
|
315
|
+
return { block: { type: 'math', tex: tex.join('\n').trim(), closed: true }, end: i };
|
|
316
|
+
}
|
|
317
|
+
tex.push(lines[i]);
|
|
318
|
+
}
|
|
319
|
+
return { block: { type: 'math', tex: tex.join('\n').trim(), closed: false }, end: lines.length - 1 };
|
|
320
|
+
}
|
|
321
|
+
function cells(row) {
|
|
322
|
+
return row
|
|
323
|
+
.trim()
|
|
324
|
+
.replace(/^\|/, '')
|
|
325
|
+
.replace(/\|$/, '')
|
|
326
|
+
.split('|')
|
|
327
|
+
.map(cell => cell.trim());
|
|
328
|
+
}
|
|
329
|
+
})(MarkdownUtil || (MarkdownUtil = {}));
|
|
330
|
+
//# sourceMappingURL=markdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.js","sourceRoot":"","sources":["../../../src/browser/util/markdown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,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E,CAAC;aAClB,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;aAClB,KAAK,CAAC,GAAG,CAAC;aACV,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;IAClC,CAAC;AACL,CAAC,EA5QgB,YAAY,KAAZ,YAAY,QA4Q5B"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { SessionMessage, ToolRun } from '@celljs/ta-client';
|
|
2
|
+
export interface ContentBlock {
|
|
3
|
+
type: string;
|
|
4
|
+
text?: string;
|
|
5
|
+
thinking?: string;
|
|
6
|
+
id?: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
arguments?: unknown;
|
|
9
|
+
data?: string;
|
|
10
|
+
mimeType?: string;
|
|
11
|
+
}
|
|
12
|
+
/** What a tool returned: pi's `AgentToolResult`, live or from the tool result message. */
|
|
13
|
+
export interface ToolOutput {
|
|
14
|
+
content?: ContentBlock[];
|
|
15
|
+
details?: Record<string, unknown>;
|
|
16
|
+
isError?: boolean;
|
|
17
|
+
/** Milliseconds the call took, on the result message. */
|
|
18
|
+
durationMs?: number;
|
|
19
|
+
}
|
|
20
|
+
/** What the models of a turn took: the context of each request summed, as the run status counts it. */
|
|
21
|
+
export interface TurnUsage {
|
|
22
|
+
input: number;
|
|
23
|
+
output: number;
|
|
24
|
+
/** In dollars; 0 when the price of the model is not known. */
|
|
25
|
+
cost: number;
|
|
26
|
+
}
|
|
27
|
+
/** When a message came: `date` is set for a day before the day before yesterday. */
|
|
28
|
+
export interface MessageTime {
|
|
29
|
+
day: 'today' | 'yesterday' | 'dayBefore' | 'date';
|
|
30
|
+
time: string;
|
|
31
|
+
date?: string;
|
|
32
|
+
}
|
|
33
|
+
interface Entry {
|
|
34
|
+
id: string;
|
|
35
|
+
type: string;
|
|
36
|
+
message?: {
|
|
37
|
+
role?: string;
|
|
38
|
+
timestamp?: number;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export declare namespace MessageUtil {
|
|
42
|
+
function blocks(message: SessionMessage): ContentBlock[];
|
|
43
|
+
function text(content: ContentBlock[] | string | undefined): string;
|
|
44
|
+
/** The tool result messages of a conversation by tool call id: shown with their calls. */
|
|
45
|
+
function results(messages: SessionMessage[]): Map<string, ToolOutput>;
|
|
46
|
+
/** The live run wins over the message: it has the partial results and the diffs of nested calls. */
|
|
47
|
+
function output(run: ToolRun | undefined, message: ToolOutput | undefined): ToolOutput | undefined;
|
|
48
|
+
function status(run: ToolRun | undefined, output: ToolOutput | undefined): 'running' | 'done' | 'error';
|
|
49
|
+
/**
|
|
50
|
+
* The id of the entry of the session that holds a message: pi's messages carry no id, but each the
|
|
51
|
+
* time it was made, and entries of other branches have other times.
|
|
52
|
+
*/
|
|
53
|
+
function entryId(entries: readonly Entry[], message: SessionMessage): string | undefined;
|
|
54
|
+
function usage(messages: readonly SessionMessage[]): TurnUsage;
|
|
55
|
+
/** $0.0042 below a cent, else $1.23: enough to tell turns apart. */
|
|
56
|
+
function cost(dollars: number): string;
|
|
57
|
+
/**
|
|
58
|
+
* When a message came, as short as it can be said: the time today, yesterday and the day before with
|
|
59
|
+
* their word, else the date (with the year only when it is not this one).
|
|
60
|
+
*/
|
|
61
|
+
function when(timestamp: number, now?: number): MessageTime;
|
|
62
|
+
/** The output of a codemode script without the header the model needs and a person does not. */
|
|
63
|
+
function scriptOutput(output: string): string;
|
|
64
|
+
function duration(ms: number | undefined): string;
|
|
65
|
+
/** The last `count` lines, and how many were left out. */
|
|
66
|
+
function tail(text: string, count: number): {
|
|
67
|
+
text: string;
|
|
68
|
+
hidden: number;
|
|
69
|
+
};
|
|
70
|
+
/** The last two parts of a path: enough to recognize a project. */
|
|
71
|
+
function shortPath(path: string): string;
|
|
72
|
+
function basename(path: string): string;
|
|
73
|
+
}
|
|
74
|
+
export {};
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
const SCRIPT_HEADER = /^Script (completed|failed)\nWall time [\d.]+ seconds\nOutput:\n/;
|
|
2
|
+
export var MessageUtil;
|
|
3
|
+
(function (MessageUtil) {
|
|
4
|
+
function blocks(message) {
|
|
5
|
+
const content = message.content;
|
|
6
|
+
if (typeof content === 'string') {
|
|
7
|
+
return [{ type: 'text', text: content }];
|
|
8
|
+
}
|
|
9
|
+
return Array.isArray(content) ? content : [];
|
|
10
|
+
}
|
|
11
|
+
MessageUtil.blocks = blocks;
|
|
12
|
+
function text(content) {
|
|
13
|
+
if (typeof content === 'string') {
|
|
14
|
+
return content;
|
|
15
|
+
}
|
|
16
|
+
return (content !== null && content !== void 0 ? content : [])
|
|
17
|
+
.filter(block => block.type === 'text')
|
|
18
|
+
.map(block => { var _a; return (_a = block.text) !== null && _a !== void 0 ? _a : ''; })
|
|
19
|
+
.join('\n');
|
|
20
|
+
}
|
|
21
|
+
MessageUtil.text = text;
|
|
22
|
+
/** The tool result messages of a conversation by tool call id: shown with their calls. */
|
|
23
|
+
function results(messages) {
|
|
24
|
+
const results = new Map();
|
|
25
|
+
for (const message of messages) {
|
|
26
|
+
const { role, toolCallId } = message;
|
|
27
|
+
if (role === 'toolResult' && toolCallId) {
|
|
28
|
+
results.set(toolCallId, message);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return results;
|
|
32
|
+
}
|
|
33
|
+
MessageUtil.results = results;
|
|
34
|
+
/** The live run wins over the message: it has the partial results and the diffs of nested calls. */
|
|
35
|
+
function output(run, message) {
|
|
36
|
+
const live = run === null || run === void 0 ? void 0 : run.result;
|
|
37
|
+
if (live && (live.content || live.details)) {
|
|
38
|
+
return { ...live, isError: (run === null || run === void 0 ? void 0 : run.status) === 'error' };
|
|
39
|
+
}
|
|
40
|
+
return message;
|
|
41
|
+
}
|
|
42
|
+
MessageUtil.output = output;
|
|
43
|
+
function status(run, output) {
|
|
44
|
+
if (run) {
|
|
45
|
+
return run.status;
|
|
46
|
+
}
|
|
47
|
+
if (!output) {
|
|
48
|
+
return 'running';
|
|
49
|
+
}
|
|
50
|
+
return output.isError ? 'error' : 'done';
|
|
51
|
+
}
|
|
52
|
+
MessageUtil.status = status;
|
|
53
|
+
/**
|
|
54
|
+
* The id of the entry of the session that holds a message: pi's messages carry no id, but each the
|
|
55
|
+
* time it was made, and entries of other branches have other times.
|
|
56
|
+
*/
|
|
57
|
+
function entryId(entries, message) {
|
|
58
|
+
var _a, _b;
|
|
59
|
+
const { role, timestamp } = message;
|
|
60
|
+
if (timestamp === undefined) {
|
|
61
|
+
return undefined;
|
|
62
|
+
}
|
|
63
|
+
for (let index = entries.length - 1; index >= 0; index--) {
|
|
64
|
+
const entry = entries[index];
|
|
65
|
+
if (entry.type === 'message' && ((_a = entry.message) === null || _a === void 0 ? void 0 : _a.role) === role && ((_b = entry.message) === null || _b === void 0 ? void 0 : _b.timestamp) === timestamp) {
|
|
66
|
+
return entry.id;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
MessageUtil.entryId = entryId;
|
|
72
|
+
function usage(messages) {
|
|
73
|
+
var _a;
|
|
74
|
+
var _b, _c, _d, _e, _f;
|
|
75
|
+
const total = { input: 0, output: 0, cost: 0 };
|
|
76
|
+
for (const message of messages) {
|
|
77
|
+
const usage = message.role === 'assistant' ? message.usage : undefined;
|
|
78
|
+
if (usage) {
|
|
79
|
+
total.input += ((_b = usage.input) !== null && _b !== void 0 ? _b : 0) + ((_c = usage.cacheRead) !== null && _c !== void 0 ? _c : 0) + ((_d = usage.cacheWrite) !== null && _d !== void 0 ? _d : 0);
|
|
80
|
+
total.output += (_e = usage.output) !== null && _e !== void 0 ? _e : 0;
|
|
81
|
+
total.cost += (_f = (_a = usage.cost) === null || _a === void 0 ? void 0 : _a.total) !== null && _f !== void 0 ? _f : 0;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return total;
|
|
85
|
+
}
|
|
86
|
+
MessageUtil.usage = usage;
|
|
87
|
+
/** $0.0042 below a cent, else $1.23: enough to tell turns apart. */
|
|
88
|
+
function cost(dollars) {
|
|
89
|
+
return `$${dollars < 0.01 ? dollars.toFixed(4) : dollars.toFixed(2)}`;
|
|
90
|
+
}
|
|
91
|
+
MessageUtil.cost = cost;
|
|
92
|
+
/**
|
|
93
|
+
* When a message came, as short as it can be said: the time today, yesterday and the day before with
|
|
94
|
+
* their word, else the date (with the year only when it is not this one).
|
|
95
|
+
*/
|
|
96
|
+
function when(timestamp, now = Date.now()) {
|
|
97
|
+
const date = new Date(timestamp);
|
|
98
|
+
const pad = (value) => String(value).padStart(2, '0');
|
|
99
|
+
const time = `${pad(date.getHours())}:${pad(date.getMinutes())}`;
|
|
100
|
+
const midnight = (value) => new Date(value.getFullYear(), value.getMonth(), value.getDate()).getTime();
|
|
101
|
+
const days = Math.round((midnight(new Date(now)) - midnight(date)) / 86400000);
|
|
102
|
+
if (days === 0) {
|
|
103
|
+
return { day: 'today', time };
|
|
104
|
+
}
|
|
105
|
+
if (days === 1 || days === 2) {
|
|
106
|
+
return { day: days === 1 ? 'yesterday' : 'dayBefore', time };
|
|
107
|
+
}
|
|
108
|
+
const day = `${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;
|
|
109
|
+
return { day: 'date', date: date.getFullYear() === new Date(now).getFullYear() ? day : `${date.getFullYear()}-${day}`, time };
|
|
110
|
+
}
|
|
111
|
+
MessageUtil.when = when;
|
|
112
|
+
/** The output of a codemode script without the header the model needs and a person does not. */
|
|
113
|
+
function scriptOutput(output) {
|
|
114
|
+
return output.replace(SCRIPT_HEADER, '');
|
|
115
|
+
}
|
|
116
|
+
MessageUtil.scriptOutput = scriptOutput;
|
|
117
|
+
function duration(ms) {
|
|
118
|
+
if (ms === undefined) {
|
|
119
|
+
return '';
|
|
120
|
+
}
|
|
121
|
+
return ms < 1000 ? `${Math.round(ms)}ms` : `${(ms / 1000).toFixed(1)}s`;
|
|
122
|
+
}
|
|
123
|
+
MessageUtil.duration = duration;
|
|
124
|
+
/** The last `count` lines, and how many were left out. */
|
|
125
|
+
function tail(text, count) {
|
|
126
|
+
const lines = text.split('\n');
|
|
127
|
+
return lines.length <= count ? { text, hidden: 0 } : { text: lines.slice(-count).join('\n'), hidden: lines.length - count };
|
|
128
|
+
}
|
|
129
|
+
MessageUtil.tail = tail;
|
|
130
|
+
/** The last two parts of a path: enough to recognize a project. */
|
|
131
|
+
function shortPath(path) {
|
|
132
|
+
const parts = path.split(/[\\/]/).filter(Boolean);
|
|
133
|
+
return parts.length > 2 ? `…/${parts.slice(-2).join('/')}` : path;
|
|
134
|
+
}
|
|
135
|
+
MessageUtil.shortPath = shortPath;
|
|
136
|
+
function basename(path) {
|
|
137
|
+
var _a;
|
|
138
|
+
const parts = path.split(/[\\/]/).filter(Boolean);
|
|
139
|
+
return (_a = parts[parts.length - 1]) !== null && _a !== void 0 ? _a : path;
|
|
140
|
+
}
|
|
141
|
+
MessageUtil.basename = basename;
|
|
142
|
+
})(MessageUtil || (MessageUtil = {}));
|
|
143
|
+
//# sourceMappingURL=message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message.js","sourceRoot":"","sources":["../../../src/browser/util/message.ts"],"names":[],"mappings":"AAmDA,MAAM,aAAa,GAAG,iEAAiE,CAAC;AAExF,MAAM,KAAW,WAAW,CAsI3B;AAtID,WAAiB,WAAW;IACxB,SAAgB,MAAM,CAAC,OAAuB;QAC1C,MAAM,OAAO,GAAI,OAAiC,CAAC,OAAO,CAAC;QAC3D,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;YAC9B,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;QAC7C,CAAC;QACD,OAAO,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAE,OAA0B,CAAC,CAAC,CAAC,EAAE,CAAC;IACrE,CAAC;IANe,YAAA,MAAM,SAMrB,CAAA;IAED,SAAgB,IAAI,CAAC,OAA4C;QAC7D,IAAI,OAAO,OAA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AClD,aAAO,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,mCAAI,IAAI,CAAC;IAC3C,CAAC;IAHe,YAAA,QAAQ,WAGvB,CAAA;AACL,CAAC,EAtIgB,WAAW,KAAX,WAAW,QAsI3B"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { SessionMessage } from '@celljs/ta-client';
|
|
2
|
+
import type { Mood } from '../avatar/dino-avatar.js';
|
|
3
|
+
import { type ContentBlock } from './message.js';
|
|
4
|
+
/** One step of the work of ta between two messages of the user. */
|
|
5
|
+
export type ProcessStep = {
|
|
6
|
+
kind: 'thinking';
|
|
7
|
+
key: string;
|
|
8
|
+
text: string;
|
|
9
|
+
} | {
|
|
10
|
+
kind: 'text';
|
|
11
|
+
key: string;
|
|
12
|
+
text: string;
|
|
13
|
+
} | {
|
|
14
|
+
kind: 'tool';
|
|
15
|
+
key: string;
|
|
16
|
+
call: ContentBlock;
|
|
17
|
+
};
|
|
18
|
+
/** A message shown as it is: from the user, a `!command`, a message of an extension, a summary. */
|
|
19
|
+
export interface MessageItem {
|
|
20
|
+
kind: 'message';
|
|
21
|
+
key: string;
|
|
22
|
+
message: SessionMessage;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The assistant and tool result messages in a row: the work (thinking, tool calls, what ta said on
|
|
26
|
+
* the way) folds into one line, and the text ta ends with is the reply.
|
|
27
|
+
*/
|
|
28
|
+
export interface TurnItem {
|
|
29
|
+
kind: 'turn';
|
|
30
|
+
key: string;
|
|
31
|
+
/** The messages it is made of; the same objects while they do not change. */
|
|
32
|
+
messages: SessionMessage[];
|
|
33
|
+
steps: ProcessStep[];
|
|
34
|
+
/** The text at the end, after the last tool call. */
|
|
35
|
+
reply: string[];
|
|
36
|
+
/** The last assistant message: its stop reason and error. */
|
|
37
|
+
last?: SessionMessage;
|
|
38
|
+
/** The agent is still at it. */
|
|
39
|
+
active: boolean;
|
|
40
|
+
}
|
|
41
|
+
export type ThreadItem = MessageItem | TurnItem;
|
|
42
|
+
/** While the agent works, only the latest steps show; the earlier ones fold into one row. */
|
|
43
|
+
export declare const VISIBLE_STEPS = 8;
|
|
44
|
+
/**
|
|
45
|
+
* How the conversation is laid out (thinking and tool calls folded into steps): pure functions over pi's
|
|
46
|
+
* messages, so that a component only draws what they return.
|
|
47
|
+
*/
|
|
48
|
+
export declare namespace ProcessUtil {
|
|
49
|
+
/**
|
|
50
|
+
* The items of the conversation. While the agent works and has not answered yet, its turn is there
|
|
51
|
+
* already, empty, with the key the turn will have: the head drawn while it waits is the one its answer
|
|
52
|
+
* fills, not another put in its place.
|
|
53
|
+
*/
|
|
54
|
+
function items(messages: SessionMessage[], working: boolean): ThreadItem[];
|
|
55
|
+
/** The tool calls: what "N steps" counts. */
|
|
56
|
+
function tools(steps: ProcessStep[]): ContentBlock[];
|
|
57
|
+
/** The steps shown: all of them, or while it works the latest few when more than two would fold. */
|
|
58
|
+
function fold(steps: ProcessStep[], active: boolean, showAll: boolean, visible?: number): {
|
|
59
|
+
hidden: number;
|
|
60
|
+
steps: ProcessStep[];
|
|
61
|
+
};
|
|
62
|
+
/** One line of thinking, without markdown: what a folded thought shows. */
|
|
63
|
+
function preview(text: string, length?: number): string;
|
|
64
|
+
/** What ta does now, by the last block of the conversation: for its face and the working line. */
|
|
65
|
+
function phase(messages: SessionMessage[]): 'thinking' | 'working' | 'writing';
|
|
66
|
+
/**
|
|
67
|
+
* The face of ta at the head of a turn: what it does while it works (it needs you while a dialog
|
|
68
|
+
* waits), then done for the last turn, needing you after an error, and calm for the rest.
|
|
69
|
+
*/
|
|
70
|
+
function mood(item: TurnItem, last: boolean, waiting: boolean): Mood;
|
|
71
|
+
/** The two items show the same: their messages are the same objects, and so is whether it works. */
|
|
72
|
+
function same(a: ThreadItem, b: ThreadItem): boolean;
|
|
73
|
+
}
|