@celljs/ta-web 4.49.0 → 4.50.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.en.md +1 -1
- package/README.md +1 -1
- package/esm/browser/account/account-side.js +4 -0
- package/esm/browser/account/device-account.d.ts +6 -0
- package/esm/browser/account/device-account.js +20 -5
- package/esm/browser/assistant/assistant-view.js +2 -0
- package/esm/browser/assistant/call-announcing.d.ts +25 -0
- package/esm/browser/assistant/call-announcing.js +32 -0
- package/esm/browser/assistant/call-answering.d.ts +43 -0
- package/esm/browser/assistant/call-answering.js +63 -0
- package/esm/browser/assistant/call-hearing.d.ts +53 -0
- package/esm/browser/assistant/call-hearing.js +98 -0
- package/esm/browser/assistant/call-pausing.d.ts +40 -0
- package/esm/browser/assistant/call-pausing.js +82 -0
- package/esm/browser/assistant/call-reading.d.ts +32 -0
- package/esm/browser/assistant/call-reading.js +35 -0
- package/esm/browser/assistant/call-revoicing.d.ts +33 -0
- package/esm/browser/assistant/call-revoicing.js +68 -0
- package/esm/browser/assistant/call-turns.d.ts +29 -0
- package/esm/browser/assistant/call-turns.js +33 -0
- package/esm/browser/assistant/spoken-answer.d.ts +21 -0
- package/esm/browser/assistant/spoken-answer.js +69 -0
- package/esm/browser/assistant/spoken-call.d.ts +7 -0
- package/esm/browser/assistant/spoken-call.js +16 -0
- package/esm/browser/assistant/voice-call-protocol.d.ts +5 -0
- package/esm/browser/assistant/voice-call.d.ts +47 -43
- package/esm/browser/assistant/voice-call.js +193 -219
- package/esm/browser/chat/chat-view.js +2 -1
- package/esm/browser/components/account-menu.js +1 -1
- package/esm/browser/components/account-recovery-view.d.ts +11 -0
- package/esm/browser/components/account-recovery-view.js +81 -0
- package/esm/browser/components/account-view.d.ts +1 -2
- package/esm/browser/components/account-view.js +10 -1
- package/esm/browser/components/app-nav.js +19 -8
- package/esm/browser/components/app-shell-hooks.d.ts +5 -0
- package/esm/browser/components/app-shell-hooks.js +45 -0
- package/esm/browser/components/app-shell-state.js +2 -1
- package/esm/browser/components/app-update-view.js +4 -4
- package/esm/browser/components/app-view.js +9 -5
- package/esm/browser/components/chat-emoji.d.ts +35 -0
- package/esm/browser/components/chat-emoji.js +129 -0
- package/esm/browser/components/cloud-sign-in-view.d.ts +1 -1
- package/esm/browser/components/composer-attachments.d.ts +6 -0
- package/esm/browser/components/composer-attachments.js +12 -1
- package/esm/browser/components/composer-box-protocol.d.ts +15 -0
- package/esm/browser/components/composer-box.js +110 -87
- package/esm/browser/components/composer-drop-hooks.d.ts +26 -0
- package/esm/browser/components/composer-drop-hooks.js +36 -0
- package/esm/browser/components/composer-emoji.js +1 -1
- package/esm/browser/components/composer-faces.d.ts +16 -0
- package/esm/browser/components/composer-faces.js +37 -0
- package/esm/browser/components/composer-media.d.ts +10 -0
- package/esm/browser/components/composer-media.js +12 -1
- package/esm/browser/components/composer-target.d.ts +4 -0
- package/esm/browser/components/composer-target.js +18 -7
- package/esm/browser/components/composer-type-focus.d.ts +24 -0
- package/esm/browser/components/composer-type-focus.js +17 -0
- package/esm/browser/components/composer-voice.d.ts +24 -0
- package/esm/browser/components/composer-voice.js +37 -0
- package/esm/browser/components/composer.d.ts +2 -2
- package/esm/browser/components/composer.js +39 -8
- package/esm/browser/components/context-menu.js +2 -1
- package/esm/browser/components/emoji-panel.d.ts +11 -7
- package/esm/browser/components/emoji-panel.js +40 -22
- package/esm/browser/components/extension-settings.js +2 -2
- package/esm/browser/components/folder-new.d.ts +18 -0
- package/esm/browser/components/folder-new.js +53 -0
- package/esm/browser/components/folder-picker.d.ts +5 -2
- package/esm/browser/components/folder-picker.js +18 -6
- package/esm/browser/components/host-view.d.ts +1 -1
- package/esm/browser/components/image-menu.d.ts +8 -3
- package/esm/browser/components/image-menu.js +34 -9
- package/esm/browser/components/markdown.js +9 -2
- package/esm/browser/components/media.js +3 -2
- package/esm/browser/components/message-list.js +2 -2
- package/esm/browser/components/message-steps.js +20 -11
- package/esm/browser/components/message-user.js +2 -2
- package/esm/browser/components/moved-notice.js +2 -1
- package/esm/browser/components/nav-places.d.ts +2 -0
- package/esm/browser/components/nav-places.js +4 -2
- package/esm/browser/components/phone-shell.d.ts +2 -0
- package/esm/browser/components/phone-shell.js +5 -1
- package/esm/browser/components/secret-text.d.ts +1 -1
- package/esm/browser/components/secret-text.js +4 -3
- package/esm/browser/components/session-view.js +3 -0
- package/esm/browser/components/settings-choices.d.ts +2 -1
- package/esm/browser/components/settings-choices.js +13 -5
- package/esm/browser/components/settings-more.js +3 -3
- package/esm/browser/components/settings-parts.js +13 -2
- package/esm/browser/components/share-item-sheet.js +7 -1
- package/esm/browser/components/tab-title.d.ts +27 -0
- package/esm/browser/components/tab-title.js +35 -0
- package/esm/browser/components/use-composer-attachments.d.ts +28 -0
- package/esm/browser/components/use-composer-attachments.js +65 -0
- package/esm/browser/components/use-composer-files.d.ts +25 -0
- package/esm/browser/components/use-composer-files.js +52 -0
- package/esm/browser/components/web-composer.d.ts +3 -1
- package/esm/browser/components/web-composer.js +3 -2
- package/esm/browser/components/workbench-view.js +1 -0
- package/esm/browser/components/working-directory.js +2 -1
- package/esm/browser/device/app-update.d.ts +6 -3
- package/esm/browser/device/app-update.js +11 -5
- package/esm/browser/device/drag-move.d.ts +21 -0
- package/esm/browser/device/drag-move.js +86 -0
- package/esm/browser/extension/icons.js +7 -1
- package/esm/browser/extension/web-api-desktop.d.ts +19 -0
- package/esm/browser/extension/web-api-menus.d.ts +19 -0
- package/esm/browser/extension/web-api-spec.js +2 -0
- package/esm/browser/extension/web-extension-api.d.ts +24 -23
- package/esm/browser/extension/web-extension-context.d.ts +1 -0
- package/esm/browser/extension/web-extension-context.js +12 -5
- package/esm/browser/extension/web-extension-run.js +1 -0
- package/esm/browser/extension/web-share-ui.d.ts +1 -1
- package/esm/browser/extension/web-share-ui.js +2 -0
- package/esm/browser/extension/web-share.d.ts +13 -0
- package/esm/browser/extension/web-share.js +37 -2
- package/esm/browser/i18n/en/account.d.ts +18 -0
- package/esm/browser/i18n/en/account.js +18 -0
- package/esm/browser/i18n/en/call.js +1 -1
- package/esm/browser/i18n/en/chat.d.ts +15 -0
- package/esm/browser/i18n/en/chat.js +16 -1
- package/esm/browser/i18n/en/common.d.ts +2 -0
- package/esm/browser/i18n/en/common.js +2 -0
- package/esm/browser/i18n/en/discover.d.ts +2 -0
- package/esm/browser/i18n/en/discover.js +2 -0
- package/esm/browser/i18n/en/service.d.ts +4 -0
- package/esm/browser/i18n/en/service.js +4 -0
- package/esm/browser/i18n/en/settings.d.ts +17 -0
- package/esm/browser/i18n/en/settings.js +17 -0
- package/esm/browser/i18n/ja/account.js +18 -0
- package/esm/browser/i18n/ja/call.js +1 -1
- package/esm/browser/i18n/ja/chat.js +16 -1
- package/esm/browser/i18n/ja/common.js +2 -0
- package/esm/browser/i18n/ja/discover.js +3 -1
- package/esm/browser/i18n/ja/service.js +4 -0
- package/esm/browser/i18n/ja/settings.js +17 -0
- package/esm/browser/i18n/locales.d.ts +59 -1
- package/esm/browser/i18n/messages.d.ts +58 -0
- package/esm/browser/i18n/zh/account.js +18 -0
- package/esm/browser/i18n/zh/call.js +1 -1
- package/esm/browser/i18n/zh/chat.js +16 -1
- package/esm/browser/i18n/zh/common.js +2 -0
- package/esm/browser/i18n/zh/discover.js +3 -1
- package/esm/browser/i18n/zh/service.js +4 -0
- package/esm/browser/i18n/zh/settings.js +17 -0
- package/esm/browser/i18n/zh-tw/account.js +18 -0
- package/esm/browser/i18n/zh-tw/call.js +1 -1
- package/esm/browser/i18n/zh-tw/chat.js +16 -1
- package/esm/browser/i18n/zh-tw/common.js +2 -0
- package/esm/browser/i18n/zh-tw/discover.js +3 -1
- package/esm/browser/i18n/zh-tw/service.js +4 -0
- package/esm/browser/i18n/zh-tw/settings.js +17 -0
- package/esm/browser/offline/kept-chats.d.ts +3 -1
- package/esm/browser/offline/kept-chats.js +1 -1
- package/esm/browser/partners/group-picker.d.ts +3 -2
- package/esm/browser/partners/group-picker.js +8 -3
- package/esm/browser/sandbox/sandbox-runtime-code.js +1 -1
- package/esm/browser/sandbox/work/work-docs.js +5 -2
- package/esm/browser/sandbox/work/work-frame.d.ts +3 -0
- package/esm/browser/sandbox/work/work-frame.js +9 -3
- package/esm/browser/sandbox/work/work-gates.d.ts +77 -0
- package/esm/browser/sandbox/work/work-gates.js +182 -0
- package/esm/browser/settings/agent-settings.js +1 -1
- package/esm/browser/settings/navigation.d.ts +38 -10
- package/esm/browser/settings/navigation.js +73 -17
- package/esm/browser/settings/settings-protocol.d.ts +16 -1
- package/esm/browser/settings/settings-protocol.js +20 -2
- package/esm/browser/settings/settings.js +4 -1
- package/esm/browser/style/base.d.ts +1 -1
- package/esm/browser/style/base.js +15 -2
- package/esm/browser/style/chat-list.d.ts +1 -1
- package/esm/browser/style/chat-list.js +6 -3
- package/esm/browser/style/conversation-column.d.ts +1 -1
- package/esm/browser/style/conversation-column.js +28 -8
- package/esm/browser/style/conversation.d.ts +1 -1
- package/esm/browser/style/conversation.js +5 -0
- package/esm/browser/style/device.js +5 -0
- package/esm/browser/style/pages.d.ts +1 -1
- package/esm/browser/style/pages.js +3 -3
- package/esm/browser/style/shell.d.ts +1 -1
- package/esm/browser/style/shell.js +13 -6
- package/esm/browser/style/tasks.d.ts +1 -1
- package/esm/browser/style/tasks.js +4 -2
- package/esm/browser/util/chat-emoji.d.ts +44 -0
- package/esm/browser/util/chat-emoji.js +269 -0
- package/esm/browser/util/composer-drop.d.ts +26 -0
- package/esm/browser/util/composer-drop.js +40 -0
- package/esm/browser/util/composer-files.d.ts +48 -0
- package/esm/browser/util/composer-files.js +99 -0
- package/esm/browser/util/composer.d.ts +13 -1
- package/esm/browser/util/composer.js +24 -6
- package/esm/browser/util/markdown.d.ts +5 -0
- package/esm/browser/util/markdown.js +18 -0
- package/esm/browser/util/message.d.ts +6 -1
- package/esm/browser/util/message.js +13 -2
- package/esm/browser/util/process.d.ts +10 -13
- package/esm/browser/util/process.js +31 -83
- package/esm/browser/util/turn-join.d.ts +38 -0
- package/esm/browser/util/turn-join.js +119 -0
- package/esm/browser/workbench-services.js +1 -1
- package/lib/browser/account/account-side.js +4 -0
- package/lib/browser/account/device-account.d.ts +6 -0
- package/lib/browser/account/device-account.js +20 -5
- package/lib/browser/assistant/assistant-view.js +2 -0
- package/lib/browser/assistant/call-announcing.d.ts +26 -0
- package/lib/browser/assistant/call-announcing.js +36 -0
- package/lib/browser/assistant/call-answering.d.ts +44 -0
- package/lib/browser/assistant/call-answering.js +67 -0
- package/lib/browser/assistant/call-hearing.d.ts +54 -0
- package/lib/browser/assistant/call-hearing.js +102 -0
- package/lib/browser/assistant/call-pausing.d.ts +41 -0
- package/lib/browser/assistant/call-pausing.js +86 -0
- package/lib/browser/assistant/call-reading.d.ts +33 -0
- package/lib/browser/assistant/call-reading.js +39 -0
- package/lib/browser/assistant/call-revoicing.d.ts +34 -0
- package/lib/browser/assistant/call-revoicing.js +72 -0
- package/lib/browser/assistant/call-turns.d.ts +30 -0
- package/lib/browser/assistant/call-turns.js +37 -0
- package/lib/browser/assistant/spoken-answer.d.ts +22 -0
- package/lib/browser/assistant/spoken-answer.js +73 -0
- package/lib/browser/assistant/spoken-call.d.ts +8 -0
- package/lib/browser/assistant/spoken-call.js +19 -0
- package/lib/browser/assistant/voice-call-protocol.d.ts +5 -0
- package/lib/browser/assistant/voice-call.d.ts +47 -43
- package/lib/browser/assistant/voice-call.js +192 -218
- package/lib/browser/chat/chat-view.js +2 -1
- package/lib/browser/components/account-menu.js +1 -1
- package/lib/browser/components/account-recovery-view.d.ts +12 -0
- package/lib/browser/components/account-recovery-view.js +117 -0
- package/lib/browser/components/account-view.d.ts +1 -2
- package/lib/browser/components/account-view.js +10 -1
- package/lib/browser/components/app-nav.js +19 -8
- package/lib/browser/components/app-shell-hooks.d.ts +5 -0
- package/lib/browser/components/app-shell-hooks.js +46 -0
- package/lib/browser/components/app-shell-state.js +1 -0
- package/lib/browser/components/app-update-view.js +4 -4
- package/lib/browser/components/app-view.js +8 -4
- package/lib/browser/components/chat-emoji.d.ts +36 -0
- package/lib/browser/components/chat-emoji.js +167 -0
- package/lib/browser/components/cloud-sign-in-view.d.ts +1 -1
- package/lib/browser/components/composer-attachments.d.ts +6 -0
- package/lib/browser/components/composer-attachments.js +12 -0
- package/lib/browser/components/composer-box-protocol.d.ts +15 -0
- package/lib/browser/components/composer-box.js +107 -84
- package/lib/browser/components/composer-drop-hooks.d.ts +27 -0
- package/lib/browser/components/composer-drop-hooks.js +72 -0
- package/lib/browser/components/composer-emoji.js +1 -1
- package/lib/browser/components/composer-faces.d.ts +17 -0
- package/lib/browser/components/composer-faces.js +73 -0
- package/lib/browser/components/composer-media.d.ts +10 -0
- package/lib/browser/components/composer-media.js +13 -0
- package/lib/browser/components/composer-target.d.ts +4 -0
- package/lib/browser/components/composer-target.js +18 -7
- package/lib/browser/components/composer-type-focus.d.ts +25 -0
- package/lib/browser/components/composer-type-focus.js +20 -0
- package/lib/browser/components/composer-voice.d.ts +25 -0
- package/lib/browser/components/composer-voice.js +73 -0
- package/lib/browser/components/composer.d.ts +2 -2
- package/lib/browser/components/composer.js +38 -7
- package/lib/browser/components/context-menu.js +2 -1
- package/lib/browser/components/emoji-panel.d.ts +11 -7
- package/lib/browser/components/emoji-panel.js +40 -22
- package/lib/browser/components/extension-settings.js +1 -1
- package/lib/browser/components/folder-new.d.ts +19 -0
- package/lib/browser/components/folder-new.js +90 -0
- package/lib/browser/components/folder-picker.d.ts +5 -2
- package/lib/browser/components/folder-picker.js +17 -5
- package/lib/browser/components/host-view.d.ts +1 -1
- package/lib/browser/components/image-menu.d.ts +8 -3
- package/lib/browser/components/image-menu.js +34 -9
- package/lib/browser/components/markdown.js +9 -2
- package/lib/browser/components/media.js +3 -2
- package/lib/browser/components/message-list.js +2 -2
- package/lib/browser/components/message-steps.js +20 -11
- package/lib/browser/components/message-user.js +1 -1
- package/lib/browser/components/moved-notice.js +2 -1
- package/lib/browser/components/nav-places.d.ts +2 -0
- package/lib/browser/components/nav-places.js +4 -2
- package/lib/browser/components/phone-shell.d.ts +2 -0
- package/lib/browser/components/phone-shell.js +5 -1
- package/lib/browser/components/secret-text.d.ts +1 -1
- package/lib/browser/components/secret-text.js +4 -3
- package/lib/browser/components/session-view.js +3 -0
- package/lib/browser/components/settings-choices.d.ts +2 -1
- package/lib/browser/components/settings-choices.js +12 -4
- package/lib/browser/components/settings-more.js +2 -2
- package/lib/browser/components/settings-parts.js +11 -0
- package/lib/browser/components/share-item-sheet.js +7 -1
- package/lib/browser/components/tab-title.d.ts +28 -0
- package/lib/browser/components/tab-title.js +38 -0
- package/lib/browser/components/use-composer-attachments.d.ts +29 -0
- package/lib/browser/components/use-composer-attachments.js +101 -0
- package/lib/browser/components/use-composer-files.d.ts +26 -0
- package/lib/browser/components/use-composer-files.js +88 -0
- package/lib/browser/components/web-composer.d.ts +3 -1
- package/lib/browser/components/web-composer.js +3 -2
- package/lib/browser/components/workbench-view.js +1 -0
- package/lib/browser/components/working-directory.js +2 -1
- package/lib/browser/device/app-update.d.ts +6 -3
- package/lib/browser/device/app-update.js +11 -5
- package/lib/browser/device/drag-move.d.ts +22 -0
- package/lib/browser/device/drag-move.js +122 -0
- package/lib/browser/extension/icons.js +6 -0
- package/lib/browser/extension/web-api-desktop.d.ts +19 -0
- package/lib/browser/extension/web-api-menus.d.ts +19 -0
- package/lib/browser/extension/web-api-spec.js +2 -0
- package/lib/browser/extension/web-extension-api.d.ts +24 -23
- package/lib/browser/extension/web-extension-context.d.ts +1 -0
- package/lib/browser/extension/web-extension-context.js +12 -5
- package/lib/browser/extension/web-extension-run.js +1 -0
- package/lib/browser/extension/web-share-ui.d.ts +1 -1
- package/lib/browser/extension/web-share-ui.js +2 -0
- package/lib/browser/extension/web-share.d.ts +13 -0
- package/lib/browser/extension/web-share.js +37 -2
- package/lib/browser/i18n/en/account.d.ts +18 -0
- package/lib/browser/i18n/en/account.js +18 -0
- package/lib/browser/i18n/en/call.js +1 -1
- package/lib/browser/i18n/en/chat.d.ts +15 -0
- package/lib/browser/i18n/en/chat.js +16 -1
- package/lib/browser/i18n/en/common.d.ts +2 -0
- package/lib/browser/i18n/en/common.js +2 -0
- package/lib/browser/i18n/en/discover.d.ts +2 -0
- package/lib/browser/i18n/en/discover.js +2 -0
- package/lib/browser/i18n/en/service.d.ts +4 -0
- package/lib/browser/i18n/en/service.js +4 -0
- package/lib/browser/i18n/en/settings.d.ts +17 -0
- package/lib/browser/i18n/en/settings.js +17 -0
- package/lib/browser/i18n/ja/account.js +18 -0
- package/lib/browser/i18n/ja/call.js +1 -1
- package/lib/browser/i18n/ja/chat.js +16 -1
- package/lib/browser/i18n/ja/common.js +2 -0
- package/lib/browser/i18n/ja/discover.js +3 -1
- package/lib/browser/i18n/ja/service.js +4 -0
- package/lib/browser/i18n/ja/settings.js +17 -0
- package/lib/browser/i18n/locales.d.ts +59 -1
- package/lib/browser/i18n/messages.d.ts +58 -0
- package/lib/browser/i18n/zh/account.js +18 -0
- package/lib/browser/i18n/zh/call.js +1 -1
- package/lib/browser/i18n/zh/chat.js +16 -1
- package/lib/browser/i18n/zh/common.js +2 -0
- package/lib/browser/i18n/zh/discover.js +3 -1
- package/lib/browser/i18n/zh/service.js +4 -0
- package/lib/browser/i18n/zh/settings.js +17 -0
- package/lib/browser/i18n/zh-tw/account.js +18 -0
- package/lib/browser/i18n/zh-tw/call.js +1 -1
- package/lib/browser/i18n/zh-tw/chat.js +16 -1
- package/lib/browser/i18n/zh-tw/common.js +2 -0
- package/lib/browser/i18n/zh-tw/discover.js +3 -1
- package/lib/browser/i18n/zh-tw/service.js +4 -0
- package/lib/browser/i18n/zh-tw/settings.js +17 -0
- package/lib/browser/offline/kept-chats.d.ts +3 -1
- package/lib/browser/offline/kept-chats.js +1 -1
- package/lib/browser/partners/group-picker.d.ts +3 -2
- package/lib/browser/partners/group-picker.js +8 -3
- package/lib/browser/sandbox/sandbox-runtime-code.js +1 -1
- package/lib/browser/sandbox/work/work-docs.js +5 -2
- package/lib/browser/sandbox/work/work-frame.d.ts +3 -0
- package/lib/browser/sandbox/work/work-frame.js +9 -3
- package/lib/browser/sandbox/work/work-gates.d.ts +78 -0
- package/lib/browser/sandbox/work/work-gates.js +185 -0
- package/lib/browser/settings/agent-settings.js +1 -1
- package/lib/browser/settings/navigation.d.ts +38 -10
- package/lib/browser/settings/navigation.js +74 -18
- package/lib/browser/settings/settings-protocol.d.ts +16 -1
- package/lib/browser/settings/settings-protocol.js +21 -3
- package/lib/browser/settings/settings.js +3 -0
- package/lib/browser/style/base.d.ts +1 -1
- package/lib/browser/style/base.js +15 -2
- package/lib/browser/style/chat-list.d.ts +1 -1
- package/lib/browser/style/chat-list.js +6 -3
- package/lib/browser/style/conversation-column.d.ts +1 -1
- package/lib/browser/style/conversation-column.js +28 -8
- package/lib/browser/style/conversation.d.ts +1 -1
- package/lib/browser/style/conversation.js +5 -0
- package/lib/browser/style/device.js +5 -0
- package/lib/browser/style/pages.d.ts +1 -1
- package/lib/browser/style/pages.js +3 -3
- package/lib/browser/style/shell.d.ts +1 -1
- package/lib/browser/style/shell.js +13 -6
- package/lib/browser/style/tasks.d.ts +1 -1
- package/lib/browser/style/tasks.js +4 -2
- package/lib/browser/util/chat-emoji.d.ts +45 -0
- package/lib/browser/util/chat-emoji.js +272 -0
- package/lib/browser/util/composer-drop.d.ts +27 -0
- package/lib/browser/util/composer-drop.js +43 -0
- package/lib/browser/util/composer-files.d.ts +49 -0
- package/lib/browser/util/composer-files.js +102 -0
- package/lib/browser/util/composer.d.ts +13 -1
- package/lib/browser/util/composer.js +24 -6
- package/lib/browser/util/markdown.d.ts +5 -0
- package/lib/browser/util/markdown.js +18 -0
- package/lib/browser/util/message.d.ts +6 -1
- package/lib/browser/util/message.js +13 -2
- package/lib/browser/util/process.d.ts +10 -13
- package/lib/browser/util/process.js +32 -84
- package/lib/browser/util/turn-join.d.ts +39 -0
- package/lib/browser/util/turn-join.js +122 -0
- package/lib/browser/workbench-services.js +1 -1
- package/package.json +7 -7
- package/public/emoji/wechat-v1.webp +0 -0
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { TaLocation } from '@celljs/ta-protocol';
|
|
2
2
|
import { LinkUtil } from './link.js';
|
|
3
|
+
/** The `Continue` of the button under a turn cut short (`ta.message.resumeText`), the four languages Ta speaks. */
|
|
4
|
+
const CONTINUE = new Set(['继续', '繼續', 'continue', '続行']);
|
|
3
5
|
const SCRIPT_HEADER = /^Script (completed|failed)\nWall time [\d.]+ seconds\nOutput:\n/;
|
|
4
6
|
/** What a fetch or a provider says when it was stopped with its abort signal (DOMException AbortError). */
|
|
5
7
|
const ABORTED = /^(this|the) operation was aborted\.?$|^(request )?aborted\.?$/i;
|
|
@@ -26,7 +28,7 @@ export var MessageUtil;
|
|
|
26
28
|
/**
|
|
27
29
|
* The last message of the user while nothing came of it yet: after it only thinking, no words and no tool
|
|
28
30
|
* called. Stopped then, it goes back into the box to change and send again (a rewind to it, as pi's
|
|
29
|
-
* `/tree`)
|
|
31
|
+
* `/tree`), its images with it.
|
|
30
32
|
*/
|
|
31
33
|
function unanswered(messages) {
|
|
32
34
|
let index = messages.length - 1;
|
|
@@ -41,7 +43,7 @@ export var MessageUtil;
|
|
|
41
43
|
}
|
|
42
44
|
}
|
|
43
45
|
const message = messages[index];
|
|
44
|
-
return message &&
|
|
46
|
+
return message && (text(blocks(message)).trim() || blocks(message).some(block => block.type === 'image')) ? message : undefined;
|
|
45
47
|
}
|
|
46
48
|
MessageUtil.unanswered = unanswered;
|
|
47
49
|
function blocks(message) {
|
|
@@ -52,6 +54,15 @@ export var MessageUtil;
|
|
|
52
54
|
return Array.isArray(content) ? content : [];
|
|
53
55
|
}
|
|
54
56
|
MessageUtil.blocks = blocks;
|
|
57
|
+
/**
|
|
58
|
+
* The message is the `Continue` of the button under a turn that stopped short (`ta.message.resumeText`, in every
|
|
59
|
+
* language Ta speaks), which the page sent as words of the user: what the turn goes on, not a request of its own.
|
|
60
|
+
*/
|
|
61
|
+
function continued(message) {
|
|
62
|
+
const words = text(blocks(message)).trim().toLowerCase();
|
|
63
|
+
return CONTINUE.has(words);
|
|
64
|
+
}
|
|
65
|
+
MessageUtil.continued = continued;
|
|
55
66
|
function text(content) {
|
|
56
67
|
if (typeof content === 'string') {
|
|
57
68
|
return content;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { SessionMessage } from '@celljs/ta-client';
|
|
2
2
|
import type { Mood } from '../avatar/dino-avatar.js';
|
|
3
3
|
import { type ContentBlock } from './message.js';
|
|
4
|
+
import { TurnJoin } from './turn-join.js';
|
|
4
5
|
/** One step of the work of ta between two messages of the user. */
|
|
5
6
|
export type ProcessStep = {
|
|
6
7
|
kind: 'thinking';
|
|
@@ -33,11 +34,15 @@ export type ProcessStep = {
|
|
|
33
34
|
key: string;
|
|
34
35
|
text: string;
|
|
35
36
|
}
|
|
36
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* What the user said while it worked, which pi gave it after the results of its tools (steering): it went on
|
|
39
|
+
* with it. `wentOn`: they said it once the turn had stopped short, and it goes on from there.
|
|
40
|
+
*/
|
|
37
41
|
| {
|
|
38
42
|
kind: 'said';
|
|
39
43
|
key: string;
|
|
40
44
|
message: SessionMessage;
|
|
45
|
+
wentOn?: boolean;
|
|
41
46
|
}
|
|
42
47
|
/**
|
|
43
48
|
* Ta restarted in the middle of the work and it went on from there (TA_RESUME_MESSAGE), or a part of Ta told it
|
|
@@ -127,18 +132,10 @@ export declare namespace ProcessUtil {
|
|
|
127
132
|
index: number;
|
|
128
133
|
message: SessionMessage;
|
|
129
134
|
}): ThreadItem[];
|
|
130
|
-
/**
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
*/
|
|
135
|
-
function steered(messages: readonly SessionMessage[], index: number): boolean;
|
|
136
|
-
/**
|
|
137
|
-
* The message at `index` is a notice of a part of Ta (TaMessageSource.notice) that had a turn cut short go on (moved
|
|
138
|
-
* to the cloud as it worked, a grant it waited for): a step of that turn, as a restart of Ta is, not a row of its own.
|
|
139
|
-
* The turn was cut short: its last answer was stopped or failed, or ended on its calls with no answer after them.
|
|
140
|
-
*/
|
|
141
|
-
function carried(messages: readonly SessionMessage[], index: number): boolean;
|
|
135
|
+
/** The message at `index`, of the user, steered a turn: a step of its turn, not an ask (TurnJoin.steered). */
|
|
136
|
+
const steered: typeof TurnJoin.steered;
|
|
137
|
+
/** The message at `index` is a notice of a part of Ta that had a turn cut short go on (TurnJoin.carried). */
|
|
138
|
+
const carried: typeof TurnJoin.carried;
|
|
142
139
|
/**
|
|
143
140
|
* Words on the way with a fenced block a web extension draws (WebExtensionAPI.registerCodeRenderer,
|
|
144
141
|
* `renderers` by language in lower case): a card for the user, as a choice to make, stays in sight when
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TaAgentSummary, TaMessageContext, TaMessageSource, TaPictureNote, TaSaid, TaToolLeak } from '@celljs/ta-protocol';
|
|
2
2
|
import { MessageUtil } from './message.js';
|
|
3
|
+
import { TURN_ROLES, TurnJoin } from './turn-join.js';
|
|
3
4
|
/** While the agent works, only the latest steps show; the earlier ones fold into one row. */
|
|
4
5
|
export const VISIBLE_STEPS = 8;
|
|
5
6
|
/** A time shows between two items of the conversation this long apart, as in WeChat. */
|
|
6
7
|
export const TIME_BREAK_MS = 5 * 60000;
|
|
7
|
-
const TURN_ROLES = new Set(['assistant', 'toolResult']);
|
|
8
8
|
/**
|
|
9
9
|
* How the conversation is laid out (thinking and tool calls folded into steps): pure functions over pi's
|
|
10
10
|
* messages, so that a component only draws what they return.
|
|
@@ -31,7 +31,7 @@ export var ProcessUtil;
|
|
|
31
31
|
let index = 0;
|
|
32
32
|
while (index < messages.length) {
|
|
33
33
|
const role = messages[index].role;
|
|
34
|
-
if (!TURN_ROLES.has(role) && !resumed(messages[index]) && !carried(messages, index)) {
|
|
34
|
+
if (!TURN_ROLES.has(role) && !resumed(messages[index]) && !ProcessUtil.carried(messages, index) && !afterStopped(messages, index)) {
|
|
35
35
|
const item = { kind: 'message', key: `m${offset + index}`, message: messages[index] };
|
|
36
36
|
if (index > 0 && writtenBefore(messages[index], messages[index - 1])) {
|
|
37
37
|
item.queued = true;
|
|
@@ -45,8 +45,9 @@ export var ProcessUtil;
|
|
|
45
45
|
(TURN_ROLES.has(messages[index].role) ||
|
|
46
46
|
resumed(messages[index]) ||
|
|
47
47
|
hidden(messages[index], renderers) ||
|
|
48
|
-
steered(messages, index) ||
|
|
49
|
-
|
|
48
|
+
ProcessUtil.steered(messages, index) ||
|
|
49
|
+
afterStopped(messages, index) ||
|
|
50
|
+
ProcessUtil.carried(messages, index) ||
|
|
50
51
|
beforeCarried(messages, index))) {
|
|
51
52
|
index++;
|
|
52
53
|
}
|
|
@@ -59,31 +60,16 @@ export var ProcessUtil;
|
|
|
59
60
|
return items;
|
|
60
61
|
}
|
|
61
62
|
ProcessUtil.items = items;
|
|
63
|
+
/** The message at `index`, of the user, steered a turn: a step of its turn, not an ask (TurnJoin.steered). */
|
|
64
|
+
ProcessUtil.steered = TurnJoin.steered;
|
|
65
|
+
/** The message at `index` is a notice of a part of Ta that had a turn cut short go on (TurnJoin.carried). */
|
|
66
|
+
ProcessUtil.carried = TurnJoin.carried;
|
|
67
|
+
const { afterStopped, beforeCarried, resumed, resumedOnline, writtenBefore } = TurnJoin;
|
|
62
68
|
/**
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
|
|
67
|
-
function steered(messages, index) {
|
|
68
|
-
var _a;
|
|
69
|
-
if (((_a = messages[index]) === null || _a === void 0 ? void 0 : _a.role) !== 'user') {
|
|
70
|
-
return false;
|
|
71
|
-
}
|
|
72
|
-
for (let before = index - 1; before >= 0; before--) {
|
|
73
|
-
const { role } = messages[before];
|
|
74
|
-
if (role === 'user') {
|
|
75
|
-
return steered(messages, before);
|
|
76
|
-
}
|
|
77
|
-
if (TURN_ROLES.has(role)) {
|
|
78
|
-
return role === 'toolResult' && writtenBefore(messages[index], messages[before]);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
return false;
|
|
82
|
-
}
|
|
83
|
-
ProcessUtil.steered = steered;
|
|
84
|
-
/**
|
|
85
|
-
* A turn followed only by messages of extensions (role custom, a card shown in the middle of the work) and then by
|
|
86
|
-
* another turn: the work went on after them, so the turn was not cut off where it stopped.
|
|
69
|
+
* A turn followed only by what draws nothing and then by another turn: the work went on after them, so the turn was
|
|
70
|
+
* not cut off where it stopped. What draws nothing is a message of extensions (role custom, a card shown in the
|
|
71
|
+
* middle of the work) and `system`, the prompt pi goes on with when the run is resumed (the user's memory, given
|
|
72
|
+
* again as it is told `继续`): it is of that turn, not the start of a new one.
|
|
87
73
|
*/
|
|
88
74
|
function markContinued(items) {
|
|
89
75
|
var _a;
|
|
@@ -93,65 +79,23 @@ export var ProcessUtil;
|
|
|
93
79
|
continue;
|
|
94
80
|
}
|
|
95
81
|
let next = index + 1;
|
|
96
|
-
|
|
82
|
+
const quiet = next;
|
|
83
|
+
while (next < items.length && items[next].kind === 'message' && items[next].message.role !== 'user') {
|
|
97
84
|
next++;
|
|
98
85
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
* The turn was cut short: its last answer was stopped or failed, or ended on its calls with no answer after them.
|
|
108
|
-
*/
|
|
109
|
-
function carried(messages, index) {
|
|
110
|
-
if (!TaSaid.notice(messages[index])) {
|
|
111
|
-
return false;
|
|
112
|
-
}
|
|
113
|
-
for (let before = index - 1; before >= 0; before--) {
|
|
114
|
-
const message = messages[before];
|
|
115
|
-
if (message.role === 'toolResult') {
|
|
116
|
-
return true;
|
|
117
|
-
}
|
|
118
|
-
if (message.role === 'assistant') {
|
|
119
|
-
return message.stopReason === 'aborted' || message.stopReason === 'error' || message.stopReason === 'toolUse';
|
|
120
|
-
}
|
|
121
|
-
if (message.role === 'user') {
|
|
122
|
-
return false;
|
|
86
|
+
// Told to go on where it stopped (the `Continue` of the button under a turn cut short): what it goes on
|
|
87
|
+
// into is the work of this turn, not another turn above it.
|
|
88
|
+
const by = next < items.length && items[next].kind === 'message' && MessageUtil.continued(items[next].message) ? next : undefined;
|
|
89
|
+
if (by !== undefined) {
|
|
90
|
+
next++;
|
|
91
|
+
while (next < items.length && items[next].kind === 'message' && items[next].message.role !== 'user') {
|
|
92
|
+
next++;
|
|
93
|
+
}
|
|
123
94
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}
|
|
127
|
-
ProcessUtil.carried = carried;
|
|
128
|
-
/**
|
|
129
|
-
* A message of a package or of pi between a turn cut short and the notice that had it go on (the note of a move to
|
|
130
|
-
* the cloud, which the notice says, and the system prompt it goes on with): of that turn too, drawing nothing in it.
|
|
131
|
-
*/
|
|
132
|
-
function beforeCarried(messages, index) {
|
|
133
|
-
for (let at = index; at < messages.length; at++) {
|
|
134
|
-
const { role } = messages[at];
|
|
135
|
-
if (role !== 'custom' && role !== 'system') {
|
|
136
|
-
return role === 'user' && carried(messages, at);
|
|
95
|
+
if (next > quiet && ((_a = items[next]) === null || _a === void 0 ? void 0 : _a.kind) === 'turn') {
|
|
96
|
+
item.continued = true;
|
|
137
97
|
}
|
|
138
98
|
}
|
|
139
|
-
return false;
|
|
140
|
-
}
|
|
141
|
-
/** The note that Ta restarted in the middle of a run and went on with it (TaSessionResume). */
|
|
142
|
-
function resumed(message) {
|
|
143
|
-
return message.customType === TA_RESUME_MESSAGE;
|
|
144
|
-
}
|
|
145
|
-
/** The note that the network was back and it went on with the run the network stopped (TaNetworkResume). */
|
|
146
|
-
function resumedOnline(message) {
|
|
147
|
-
var _a;
|
|
148
|
-
return ((_a = message.details) === null || _a === void 0 ? void 0 : _a.reason) === 'network';
|
|
149
|
-
}
|
|
150
|
-
/** `message`, of the user, was written before `previous`, of the agent, came: while the agent worked. */
|
|
151
|
-
function writtenBefore(message, previous) {
|
|
152
|
-
const { role, timestamp } = message;
|
|
153
|
-
const { role: was, timestamp: at } = previous;
|
|
154
|
-
return role === 'user' && !!was && TURN_ROLES.has(was) && typeof timestamp === 'number' && typeof at === 'number' && timestamp < at;
|
|
155
99
|
}
|
|
156
100
|
function turn(messages, start, active) {
|
|
157
101
|
const steps = [];
|
|
@@ -168,6 +112,10 @@ export var ProcessUtil;
|
|
|
168
112
|
if (TaMessageSource.isNotice(text)) {
|
|
169
113
|
steps.push({ kind: 'resumed', key: `${start + offset}.u`, text: TaSaid.line(TaSaid.words('user', text), { chars: 160 }) });
|
|
170
114
|
}
|
|
115
|
+
else if (offset > 0 && afterStopped(messages, offset)) {
|
|
116
|
+
// Said once the turn had stopped short: the work goes on from there, not as an ask of its own.
|
|
117
|
+
steps.push({ kind: 'said', key: `${start + offset}.u`, message, wentOn: true });
|
|
118
|
+
}
|
|
171
119
|
else {
|
|
172
120
|
steps.push({ kind: 'said', key: `${start + offset}.u`, message });
|
|
173
121
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { SessionMessage } from '@celljs/ta-client';
|
|
2
|
+
/** The roles of a turn of the agent: its answer, and the results of the tools it called. */
|
|
3
|
+
export declare const TURN_ROLES: Set<string>;
|
|
4
|
+
/**
|
|
5
|
+
* Which messages of the conversation belong to the same turn (the work between two asks of the user), as opposed to
|
|
6
|
+
* an ask of its own: what was said on the way while the agent worked, and what it goes on with after a turn stopped
|
|
7
|
+
* short. Over pi's messages, without changing them.
|
|
8
|
+
*/
|
|
9
|
+
export declare namespace TurnJoin {
|
|
10
|
+
/**
|
|
11
|
+
* The message at `index`, of the user, steered a turn: it came after the result of a tool and was written before
|
|
12
|
+
* it, while the agent worked; pi gave it to the agent with the results, and the work went on. One after another
|
|
13
|
+
* that did (written at once) did too. A message of the user that steered is a step of its turn, not an ask.
|
|
14
|
+
*/
|
|
15
|
+
function steered(messages: readonly SessionMessage[], index: number): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* The message at `index`, of the user, after a turn they stopped which said nothing more: it goes on in that turn as
|
|
18
|
+
* what was said on the way does, a step of it, rather than as an ask of a turn of its own.
|
|
19
|
+
*/
|
|
20
|
+
function afterStopped(messages: readonly SessionMessage[], index: number): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* The message at `index` is a notice of a part of Ta (TaMessageSource.notice) that had a turn cut short go on (moved
|
|
23
|
+
* to the cloud as it worked, a grant it waited for): a step of that turn, as a restart of Ta is, not a row of its own.
|
|
24
|
+
* The turn was cut short: its last answer was stopped or failed, or ended on its calls with no answer after them.
|
|
25
|
+
*/
|
|
26
|
+
function carried(messages: readonly SessionMessage[], index: number): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* A message of a package or of pi between a turn cut short and the notice that had it go on (the note of a move to
|
|
29
|
+
* the cloud, which the notice says, and the system prompt it goes on with): of that turn too, drawing nothing in it.
|
|
30
|
+
*/
|
|
31
|
+
function beforeCarried(messages: readonly SessionMessage[], index: number): boolean;
|
|
32
|
+
/** The note that Ta restarted in the middle of a run and went on with it (TaSessionResume). */
|
|
33
|
+
function resumed(message: SessionMessage): boolean;
|
|
34
|
+
/** The note that the network was back and it went on with the run the network stopped (TaNetworkResume). */
|
|
35
|
+
function resumedOnline(message: SessionMessage): boolean;
|
|
36
|
+
/** `message`, of the user, was written before `previous`, of the agent, came: while the agent worked. */
|
|
37
|
+
function writtenBefore(message: SessionMessage, previous: SessionMessage): boolean;
|
|
38
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { TA_RESUME_MESSAGE, TaMessageSource, TaSaid } from '@celljs/ta-protocol';
|
|
2
|
+
import { MessageUtil } from './message.js';
|
|
3
|
+
/** The roles of a turn of the agent: its answer, and the results of the tools it called. */
|
|
4
|
+
export const TURN_ROLES = new Set(['assistant', 'toolResult']);
|
|
5
|
+
/**
|
|
6
|
+
* Which messages of the conversation belong to the same turn (the work between two asks of the user), as opposed to
|
|
7
|
+
* an ask of its own: what was said on the way while the agent worked, and what it goes on with after a turn stopped
|
|
8
|
+
* short. Over pi's messages, without changing them.
|
|
9
|
+
*/
|
|
10
|
+
export var TurnJoin;
|
|
11
|
+
(function (TurnJoin) {
|
|
12
|
+
/**
|
|
13
|
+
* The message at `index`, of the user, steered a turn: it came after the result of a tool and was written before
|
|
14
|
+
* it, while the agent worked; pi gave it to the agent with the results, and the work went on. One after another
|
|
15
|
+
* that did (written at once) did too. A message of the user that steered is a step of its turn, not an ask.
|
|
16
|
+
*/
|
|
17
|
+
function steered(messages, index) {
|
|
18
|
+
var _a;
|
|
19
|
+
if (((_a = messages[index]) === null || _a === void 0 ? void 0 : _a.role) !== 'user') {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
for (let before = index - 1; before >= 0; before--) {
|
|
23
|
+
const { role } = messages[before];
|
|
24
|
+
if (role === 'user') {
|
|
25
|
+
return steered(messages, before);
|
|
26
|
+
}
|
|
27
|
+
if (TURN_ROLES.has(role)) {
|
|
28
|
+
return role === 'toolResult' && writtenBefore(messages[index], messages[before]);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
TurnJoin.steered = steered;
|
|
34
|
+
/**
|
|
35
|
+
* The message at `index`, of the user, after a turn they stopped which said nothing more: it goes on in that turn as
|
|
36
|
+
* what was said on the way does, a step of it, rather than as an ask of a turn of its own.
|
|
37
|
+
*/
|
|
38
|
+
function afterStopped(messages, index) {
|
|
39
|
+
const message = messages[index];
|
|
40
|
+
if (message.role !== 'user') {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
// What they typed whole: a command has a line of its own, a message of a part of Ta is a bubble of its own (as it is
|
|
44
|
+
// said on the way), and pictures are not a line of words.
|
|
45
|
+
const blocks = MessageUtil.blocks(messages[index]);
|
|
46
|
+
const text = MessageUtil.text(blocks);
|
|
47
|
+
if (!text.trim() || /^[/!]/.test(text) || TaMessageSource.of(text) || blocks.some(block => block.type !== 'text')) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
for (let before = index - 1; before >= 0; before--) {
|
|
51
|
+
const { role: was } = messages[before];
|
|
52
|
+
if (was === 'user') {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
if (was === 'assistant') {
|
|
56
|
+
return MessageUtil.stopReason(messages[before]) === 'aborted';
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
TurnJoin.afterStopped = afterStopped;
|
|
62
|
+
/**
|
|
63
|
+
* The message at `index` is a notice of a part of Ta (TaMessageSource.notice) that had a turn cut short go on (moved
|
|
64
|
+
* to the cloud as it worked, a grant it waited for): a step of that turn, as a restart of Ta is, not a row of its own.
|
|
65
|
+
* The turn was cut short: its last answer was stopped or failed, or ended on its calls with no answer after them.
|
|
66
|
+
*/
|
|
67
|
+
function carried(messages, index) {
|
|
68
|
+
if (!TaSaid.notice(messages[index])) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
for (let before = index - 1; before >= 0; before--) {
|
|
72
|
+
const message = messages[before];
|
|
73
|
+
if (message.role === 'toolResult') {
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
if (message.role === 'assistant') {
|
|
77
|
+
return message.stopReason === 'aborted' || message.stopReason === 'error' || message.stopReason === 'toolUse';
|
|
78
|
+
}
|
|
79
|
+
if (message.role === 'user') {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
TurnJoin.carried = carried;
|
|
86
|
+
/**
|
|
87
|
+
* A message of a package or of pi between a turn cut short and the notice that had it go on (the note of a move to
|
|
88
|
+
* the cloud, which the notice says, and the system prompt it goes on with): of that turn too, drawing nothing in it.
|
|
89
|
+
*/
|
|
90
|
+
function beforeCarried(messages, index) {
|
|
91
|
+
for (let at = index; at < messages.length; at++) {
|
|
92
|
+
const { role } = messages[at];
|
|
93
|
+
if (role !== 'custom' && role !== 'system') {
|
|
94
|
+
return role === 'user' && carried(messages, at);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
TurnJoin.beforeCarried = beforeCarried;
|
|
100
|
+
/** The note that Ta restarted in the middle of a run and went on with it (TaSessionResume). */
|
|
101
|
+
function resumed(message) {
|
|
102
|
+
return message.customType === TA_RESUME_MESSAGE;
|
|
103
|
+
}
|
|
104
|
+
TurnJoin.resumed = resumed;
|
|
105
|
+
/** The note that the network was back and it went on with the run the network stopped (TaNetworkResume). */
|
|
106
|
+
function resumedOnline(message) {
|
|
107
|
+
var _a;
|
|
108
|
+
return ((_a = message.details) === null || _a === void 0 ? void 0 : _a.reason) === 'network';
|
|
109
|
+
}
|
|
110
|
+
TurnJoin.resumedOnline = resumedOnline;
|
|
111
|
+
/** `message`, of the user, was written before `previous`, of the agent, came: while the agent worked. */
|
|
112
|
+
function writtenBefore(message, previous) {
|
|
113
|
+
const { role, timestamp } = message;
|
|
114
|
+
const { role: was, timestamp: at } = previous;
|
|
115
|
+
return role === 'user' && !!was && TURN_ROLES.has(was) && typeof timestamp === 'number' && typeof at === 'number' && timestamp < at;
|
|
116
|
+
}
|
|
117
|
+
TurnJoin.writtenBefore = writtenBefore;
|
|
118
|
+
})(TurnJoin || (TurnJoin = {}));
|
|
119
|
+
//# sourceMappingURL=turn-join.js.map
|
|
@@ -52,6 +52,10 @@ function serveSide(account) {
|
|
|
52
52
|
approve: id => account.approve(id),
|
|
53
53
|
remove: id => account.remove(id),
|
|
54
54
|
signOut: () => account.signOut(),
|
|
55
|
+
makeRecovery: () => account.makeRecovery(),
|
|
56
|
+
recoverySaved: () => account.recoverySaved(),
|
|
57
|
+
dropRecovery: () => account.dropRecovery(),
|
|
58
|
+
recover: code => account.recover(code),
|
|
55
59
|
};
|
|
56
60
|
}
|
|
57
61
|
/**
|
|
@@ -11,6 +11,11 @@ export interface AccountSide {
|
|
|
11
11
|
signOut(): Promise<TaAccountInfo>;
|
|
12
12
|
/** The device's own (DeviceAccount.joinThrough): signs in as the computer in use is, which lets it in. */
|
|
13
13
|
joinThrough?(): Promise<TaAccountInfo>;
|
|
14
|
+
/** A computer's (docs/design/ta-account.md 10): the recovery code of the account, and coming back with it. */
|
|
15
|
+
makeRecovery?(): Promise<TaAccountInfo>;
|
|
16
|
+
recoverySaved?(): Promise<TaAccountInfo>;
|
|
17
|
+
dropRecovery?(): Promise<TaAccountInfo>;
|
|
18
|
+
recover?(code: string): Promise<TaAccountInfo>;
|
|
14
19
|
/** The device's own: hears when what `read` answers changed. That of a computer is told by its ta serve (TaServeChanges.ACCOUNT). */
|
|
15
20
|
onChange?(listener: () => void): () => void;
|
|
16
21
|
}
|
|
@@ -64,6 +69,7 @@ export declare class DeviceAccount implements AccountSide {
|
|
|
64
69
|
url: string;
|
|
65
70
|
interval: number;
|
|
66
71
|
expiresAt: number;
|
|
72
|
+
waiting?: string;
|
|
67
73
|
};
|
|
68
74
|
protected error?: string;
|
|
69
75
|
protected timer?: ReturnType<typeof setTimeout>;
|
|
@@ -387,7 +387,8 @@ class DeviceAccount {
|
|
|
387
387
|
async pollSignIn() {
|
|
388
388
|
var _a, _b;
|
|
389
389
|
const signing = this.signingIn;
|
|
390
|
-
|
|
390
|
+
// Waiting to be let in, the gateway says when it is too late.
|
|
391
|
+
if (!signing.waiting && Date.now() > signing.expiresAt) {
|
|
391
392
|
this.signingIn = undefined;
|
|
392
393
|
return SYNC_MS;
|
|
393
394
|
}
|
|
@@ -395,6 +396,10 @@ class DeviceAccount {
|
|
|
395
396
|
if (answer.status === 'pending') {
|
|
396
397
|
return signing.interval * 1000;
|
|
397
398
|
}
|
|
399
|
+
if (answer.status === 'waiting') {
|
|
400
|
+
signing.waiting = answer.account;
|
|
401
|
+
return WAITING_SYNC_MS;
|
|
402
|
+
}
|
|
398
403
|
this.signingIn = undefined;
|
|
399
404
|
if (answer.status === 'failed') {
|
|
400
405
|
this.error = answer.error;
|
|
@@ -417,9 +422,9 @@ class DeviceAccount {
|
|
|
417
422
|
}
|
|
418
423
|
/** The pages that show the account hear when it changed: a device asking in, the sign-in done, an error. */
|
|
419
424
|
tell() {
|
|
420
|
-
var _a;
|
|
421
|
-
var
|
|
422
|
-
const now = JSON.stringify([(
|
|
425
|
+
var _a, _b;
|
|
426
|
+
var _c, _d, _e, _f;
|
|
427
|
+
const now = JSON.stringify([(_c = this.view) !== null && _c !== void 0 ? _c : null, (_d = this.error) !== null && _d !== void 0 ? _d : null, (_e = (_a = this.signingIn) === null || _a === void 0 ? void 0 : _a.code) !== null && _e !== void 0 ? _e : null, (_f = (_b = this.signingIn) === null || _b === void 0 ? void 0 : _b.waiting) !== null && _f !== void 0 ? _f : null, !!this.agent]);
|
|
423
428
|
if (now !== this.told) {
|
|
424
429
|
this.told = now;
|
|
425
430
|
for (const listener of this.listeners) {
|
|
@@ -440,7 +445,17 @@ class DeviceAccount {
|
|
|
440
445
|
service,
|
|
441
446
|
providers: await ta_relay_1.AccountService.ways(service, await this.gateways().catch(() => [])).catch(() => []),
|
|
442
447
|
devices: [],
|
|
443
|
-
...(signing
|
|
448
|
+
...(signing
|
|
449
|
+
? {
|
|
450
|
+
signingIn: {
|
|
451
|
+
provider: signing.way.id,
|
|
452
|
+
code: signing.code,
|
|
453
|
+
url: signing.url,
|
|
454
|
+
expiresAt: signing.expiresAt,
|
|
455
|
+
...(signing.waiting ? { waiting: signing.waiting } : {}),
|
|
456
|
+
},
|
|
457
|
+
}
|
|
458
|
+
: {}),
|
|
444
459
|
...error,
|
|
445
460
|
};
|
|
446
461
|
}
|
|
@@ -71,6 +71,7 @@ const assistant_task_util_1 = require("./assistant-task-util");
|
|
|
71
71
|
const assistant_tasks_1 = require("./assistant-tasks");
|
|
72
72
|
const assistant_thread_1 = require("./assistant-thread");
|
|
73
73
|
const call_face_1 = require("./call-face");
|
|
74
|
+
const spoken_call_1 = require("./spoken-call");
|
|
74
75
|
const task_views_1 = require("./task-views");
|
|
75
76
|
const voice_call_bar_1 = require("./voice-call-bar");
|
|
76
77
|
var assistant_tasks_2 = require("./assistant-tasks");
|
|
@@ -158,6 +159,7 @@ function Chat({ store, tasks, taskStates, onTask, onMood, onTasks }) {
|
|
|
158
159
|
language: () => settingsState.language,
|
|
159
160
|
voice: () => voice,
|
|
160
161
|
send: text => say(text),
|
|
162
|
+
answer: said => (0, spoken_call_1.answerSpoken)(state.pendingUi[0], said, response => store.respondUi(response)),
|
|
161
163
|
ended: (reason, detail) => notices.notify((0, voice_call_bar_1.callEndedNotice)(t, reason, detail)),
|
|
162
164
|
}, { sessionId: store.sessionId, double: true }, name || 'Ta');
|
|
163
165
|
const mood = moodOf({
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { CallState, CallVoice } from './voice-call-protocol';
|
|
2
|
+
/** What a call announcing what comes up needs of it. */
|
|
3
|
+
export interface CallAnnouncingHost {
|
|
4
|
+
readonly state: CallState;
|
|
5
|
+
readonly voice: CallVoice;
|
|
6
|
+
/** Its voice service is opening: what waits is said once it is there. */
|
|
7
|
+
readonly opening: boolean;
|
|
8
|
+
listen(): void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* What a call says that the user did not ask for (Ta waits for them, a task ended), in order: at once while Ta listens
|
|
12
|
+
* and the user has said nothing yet, else once what goes on now is over; never over the user, nor over an answer.
|
|
13
|
+
* A voice that thinks is told the news of the work by Ta itself (TaVoiceEngine.tell), and says it in its own words.
|
|
14
|
+
*/
|
|
15
|
+
export declare class CallAnnouncing {
|
|
16
|
+
protected readonly host: CallAnnouncingHost;
|
|
17
|
+
protected readonly waiting: string[];
|
|
18
|
+
constructor(host: CallAnnouncingHost);
|
|
19
|
+
/** Says something the user should hear in a call, or waits for its turn. */
|
|
20
|
+
announce(text: string): void;
|
|
21
|
+
/** What is to be said before Ta listens now, if anything: taken out of what waits. */
|
|
22
|
+
next(announce: boolean): string | undefined;
|
|
23
|
+
/** The call is over: nothing waits to be said. */
|
|
24
|
+
clear(): void;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=call-announcing.d.ts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CallAnnouncing = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* What a call says that the user did not ask for (Ta waits for them, a task ended), in order: at once while Ta listens
|
|
6
|
+
* and the user has said nothing yet, else once what goes on now is over; never over the user, nor over an answer.
|
|
7
|
+
* A voice that thinks is told the news of the work by Ta itself (TaVoiceEngine.tell), and says it in its own words.
|
|
8
|
+
*/
|
|
9
|
+
class CallAnnouncing {
|
|
10
|
+
constructor(host) {
|
|
11
|
+
this.host = host;
|
|
12
|
+
this.waiting = [];
|
|
13
|
+
}
|
|
14
|
+
/** Says something the user should hear in a call, or waits for its turn. */
|
|
15
|
+
announce(text) {
|
|
16
|
+
const { host } = this;
|
|
17
|
+
const said = text.trim();
|
|
18
|
+
if (!host.state.active || !said || host.voice.thinks) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
this.waiting.push(said);
|
|
22
|
+
if (!host.state.paused && !host.opening && host.state.phase === 'listening' && !host.state.heard.trim()) {
|
|
23
|
+
host.listen();
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/** What is to be said before Ta listens now, if anything: taken out of what waits. */
|
|
27
|
+
next(announce) {
|
|
28
|
+
return announce ? this.waiting.shift() : undefined;
|
|
29
|
+
}
|
|
30
|
+
/** The call is over: nothing waits to be said. */
|
|
31
|
+
clear() {
|
|
32
|
+
this.waiting.length = 0;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.CallAnnouncing = CallAnnouncing;
|
|
36
|
+
//# sourceMappingURL=call-announcing.js.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { CallState } from './voice-call-protocol';
|
|
2
|
+
/** How long after the question is answered a work that begins is waited for, before Ta listens again. */
|
|
3
|
+
export declare const ANSWER_IDLE_MS = 4000;
|
|
4
|
+
/** What answering the question of a conversation needs of its call. */
|
|
5
|
+
export interface CallAnsweringHost {
|
|
6
|
+
readonly state: CallState;
|
|
7
|
+
/** The words answer the question the conversation waits on; false for words that do not (CallOptions.answer). */
|
|
8
|
+
answer(said: string): Promise<boolean>;
|
|
9
|
+
/** The listen now: another means the user went on, and the answer's wait is over. */
|
|
10
|
+
round(): number;
|
|
11
|
+
/** A turn the call asked is at work: its reply is to come. */
|
|
12
|
+
waiting(): boolean;
|
|
13
|
+
set(change: Partial<CallState>): void;
|
|
14
|
+
/** What was said is over: Ta listens again. */
|
|
15
|
+
over(): void;
|
|
16
|
+
/** What the user said goes to the conversation. */
|
|
17
|
+
send(said: string): void;
|
|
18
|
+
/** What the user said did not go: Ta listens again, the captions without it. */
|
|
19
|
+
unsent(): void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* What the user says in a call answers the question the conversation waits on (a permission, a choice), rather than
|
|
23
|
+
* going to the model: SpokenAnswer tells whether it does. The question answered, the work goes on with it and its reply
|
|
24
|
+
* is read as any turn; should nothing come of it (a question that ended no work), Ta listens again rather than think
|
|
25
|
+
* for ever, unless the user says more meanwhile, or a turn is at work.
|
|
26
|
+
*/
|
|
27
|
+
export declare class CallAnswering {
|
|
28
|
+
protected readonly host: CallAnsweringHost;
|
|
29
|
+
protected idle?: ReturnType<typeof setTimeout>;
|
|
30
|
+
protected heardIn: number;
|
|
31
|
+
constructor(host: CallAnsweringHost);
|
|
32
|
+
/** Whether the call answers the question with what is said: true once it took it over. */
|
|
33
|
+
take(said: string): boolean;
|
|
34
|
+
/** The words went on to a conversation that does not answer by voice: set the call to think of them. */
|
|
35
|
+
thinking(said: string): void;
|
|
36
|
+
/** Its call ended or went on: nothing waits any more. */
|
|
37
|
+
stop(): void;
|
|
38
|
+
/** The user says more, or the call listens again: what waited is over. */
|
|
39
|
+
moved(): void;
|
|
40
|
+
protected gone(): boolean;
|
|
41
|
+
/** The question answered: the work goes on with it; none begins in a few seconds, Ta listens again. */
|
|
42
|
+
protected waited(): void;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=call-answering.d.ts.map
|