@allbluecn/web-app 0.27.41 → 0.28.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/package.json +4 -3
- package/public/pdfjs/cmaps/78-EUC-H.bcmap +0 -0
- package/public/pdfjs/cmaps/78-EUC-V.bcmap +0 -0
- package/public/pdfjs/cmaps/78-H.bcmap +0 -0
- package/public/pdfjs/cmaps/78-RKSJ-H.bcmap +0 -0
- package/public/pdfjs/cmaps/78-RKSJ-V.bcmap +0 -0
- package/public/pdfjs/cmaps/78-V.bcmap +0 -0
- package/public/pdfjs/cmaps/78ms-RKSJ-H.bcmap +0 -0
- package/public/pdfjs/cmaps/78ms-RKSJ-V.bcmap +0 -0
- package/public/pdfjs/cmaps/83pv-RKSJ-H.bcmap +0 -0
- package/public/pdfjs/cmaps/90ms-RKSJ-H.bcmap +0 -0
- package/public/pdfjs/cmaps/90ms-RKSJ-V.bcmap +0 -0
- package/public/pdfjs/cmaps/90msp-RKSJ-H.bcmap +0 -0
- package/public/pdfjs/cmaps/90msp-RKSJ-V.bcmap +0 -0
- package/public/pdfjs/cmaps/90pv-RKSJ-H.bcmap +0 -0
- package/public/pdfjs/cmaps/90pv-RKSJ-V.bcmap +0 -0
- package/public/pdfjs/cmaps/Add-H.bcmap +0 -0
- package/public/pdfjs/cmaps/Add-RKSJ-H.bcmap +0 -0
- package/public/pdfjs/cmaps/Add-RKSJ-V.bcmap +0 -0
- package/public/pdfjs/cmaps/Add-V.bcmap +0 -0
- package/public/pdfjs/cmaps/Adobe-CNS1-0.bcmap +0 -0
- package/public/pdfjs/cmaps/Adobe-CNS1-1.bcmap +0 -0
- package/public/pdfjs/cmaps/Adobe-CNS1-2.bcmap +0 -0
- package/public/pdfjs/cmaps/Adobe-CNS1-3.bcmap +0 -0
- package/public/pdfjs/cmaps/Adobe-CNS1-4.bcmap +0 -0
- package/public/pdfjs/cmaps/Adobe-CNS1-5.bcmap +0 -0
- package/public/pdfjs/cmaps/Adobe-CNS1-6.bcmap +0 -0
- package/public/pdfjs/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
- package/public/pdfjs/cmaps/Adobe-GB1-0.bcmap +0 -0
- package/public/pdfjs/cmaps/Adobe-GB1-1.bcmap +0 -0
- package/public/pdfjs/cmaps/Adobe-GB1-2.bcmap +0 -0
- package/public/pdfjs/cmaps/Adobe-GB1-3.bcmap +0 -0
- package/public/pdfjs/cmaps/Adobe-GB1-4.bcmap +0 -0
- package/public/pdfjs/cmaps/Adobe-GB1-5.bcmap +0 -0
- package/public/pdfjs/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
- package/public/pdfjs/cmaps/Adobe-Japan1-0.bcmap +0 -0
- package/public/pdfjs/cmaps/Adobe-Japan1-1.bcmap +0 -0
- package/public/pdfjs/cmaps/Adobe-Japan1-2.bcmap +0 -0
- package/public/pdfjs/cmaps/Adobe-Japan1-3.bcmap +0 -0
- package/public/pdfjs/cmaps/Adobe-Japan1-4.bcmap +0 -0
- package/public/pdfjs/cmaps/Adobe-Japan1-5.bcmap +0 -0
- package/public/pdfjs/cmaps/Adobe-Japan1-6.bcmap +0 -0
- package/public/pdfjs/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
- package/public/pdfjs/cmaps/Adobe-Korea1-0.bcmap +0 -0
- package/public/pdfjs/cmaps/Adobe-Korea1-1.bcmap +0 -0
- package/public/pdfjs/cmaps/Adobe-Korea1-2.bcmap +0 -0
- package/public/pdfjs/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
- package/public/pdfjs/cmaps/B5-H.bcmap +0 -0
- package/public/pdfjs/cmaps/B5-V.bcmap +0 -0
- package/public/pdfjs/cmaps/B5pc-H.bcmap +0 -0
- package/public/pdfjs/cmaps/B5pc-V.bcmap +0 -0
- package/public/pdfjs/cmaps/CNS-EUC-H.bcmap +0 -0
- package/public/pdfjs/cmaps/CNS-EUC-V.bcmap +0 -0
- package/public/pdfjs/cmaps/CNS1-H.bcmap +0 -0
- package/public/pdfjs/cmaps/CNS1-V.bcmap +0 -0
- package/public/pdfjs/cmaps/CNS2-H.bcmap +0 -0
- package/public/pdfjs/cmaps/CNS2-V.bcmap +3 -0
- package/public/pdfjs/cmaps/ETHK-B5-H.bcmap +0 -0
- package/public/pdfjs/cmaps/ETHK-B5-V.bcmap +0 -0
- package/public/pdfjs/cmaps/ETen-B5-H.bcmap +0 -0
- package/public/pdfjs/cmaps/ETen-B5-V.bcmap +0 -0
- package/public/pdfjs/cmaps/ETenms-B5-H.bcmap +3 -0
- package/public/pdfjs/cmaps/ETenms-B5-V.bcmap +0 -0
- package/public/pdfjs/cmaps/EUC-H.bcmap +0 -0
- package/public/pdfjs/cmaps/EUC-V.bcmap +0 -0
- package/public/pdfjs/cmaps/Ext-H.bcmap +0 -0
- package/public/pdfjs/cmaps/Ext-RKSJ-H.bcmap +0 -0
- package/public/pdfjs/cmaps/Ext-RKSJ-V.bcmap +0 -0
- package/public/pdfjs/cmaps/Ext-V.bcmap +0 -0
- package/public/pdfjs/cmaps/GB-EUC-H.bcmap +0 -0
- package/public/pdfjs/cmaps/GB-EUC-V.bcmap +0 -0
- package/public/pdfjs/cmaps/GB-H.bcmap +4 -0
- package/public/pdfjs/cmaps/GB-V.bcmap +0 -0
- package/public/pdfjs/cmaps/GBK-EUC-H.bcmap +0 -0
- package/public/pdfjs/cmaps/GBK-EUC-V.bcmap +0 -0
- package/public/pdfjs/cmaps/GBK2K-H.bcmap +0 -0
- package/public/pdfjs/cmaps/GBK2K-V.bcmap +0 -0
- package/public/pdfjs/cmaps/GBKp-EUC-H.bcmap +0 -0
- package/public/pdfjs/cmaps/GBKp-EUC-V.bcmap +0 -0
- package/public/pdfjs/cmaps/GBT-EUC-H.bcmap +0 -0
- package/public/pdfjs/cmaps/GBT-EUC-V.bcmap +0 -0
- package/public/pdfjs/cmaps/GBT-H.bcmap +0 -0
- package/public/pdfjs/cmaps/GBT-V.bcmap +0 -0
- package/public/pdfjs/cmaps/GBTpc-EUC-H.bcmap +0 -0
- package/public/pdfjs/cmaps/GBTpc-EUC-V.bcmap +0 -0
- package/public/pdfjs/cmaps/GBpc-EUC-H.bcmap +0 -0
- package/public/pdfjs/cmaps/GBpc-EUC-V.bcmap +0 -0
- package/public/pdfjs/cmaps/H.bcmap +0 -0
- package/public/pdfjs/cmaps/HKdla-B5-H.bcmap +0 -0
- package/public/pdfjs/cmaps/HKdla-B5-V.bcmap +0 -0
- package/public/pdfjs/cmaps/HKdlb-B5-H.bcmap +0 -0
- package/public/pdfjs/cmaps/HKdlb-B5-V.bcmap +0 -0
- package/public/pdfjs/cmaps/HKgccs-B5-H.bcmap +0 -0
- package/public/pdfjs/cmaps/HKgccs-B5-V.bcmap +0 -0
- package/public/pdfjs/cmaps/HKm314-B5-H.bcmap +0 -0
- package/public/pdfjs/cmaps/HKm314-B5-V.bcmap +0 -0
- package/public/pdfjs/cmaps/HKm471-B5-H.bcmap +0 -0
- package/public/pdfjs/cmaps/HKm471-B5-V.bcmap +0 -0
- package/public/pdfjs/cmaps/HKscs-B5-H.bcmap +0 -0
- package/public/pdfjs/cmaps/HKscs-B5-V.bcmap +0 -0
- package/public/pdfjs/cmaps/Hankaku.bcmap +0 -0
- package/public/pdfjs/cmaps/Hiragana.bcmap +0 -0
- package/public/pdfjs/cmaps/KSC-EUC-H.bcmap +0 -0
- package/public/pdfjs/cmaps/KSC-EUC-V.bcmap +0 -0
- package/public/pdfjs/cmaps/KSC-H.bcmap +0 -0
- package/public/pdfjs/cmaps/KSC-Johab-H.bcmap +0 -0
- package/public/pdfjs/cmaps/KSC-Johab-V.bcmap +0 -0
- package/public/pdfjs/cmaps/KSC-V.bcmap +0 -0
- package/public/pdfjs/cmaps/KSCms-UHC-H.bcmap +0 -0
- package/public/pdfjs/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
- package/public/pdfjs/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
- package/public/pdfjs/cmaps/KSCms-UHC-V.bcmap +0 -0
- package/public/pdfjs/cmaps/KSCpc-EUC-H.bcmap +0 -0
- package/public/pdfjs/cmaps/KSCpc-EUC-V.bcmap +0 -0
- package/public/pdfjs/cmaps/Katakana.bcmap +0 -0
- package/public/pdfjs/cmaps/LICENSE +36 -0
- package/public/pdfjs/cmaps/NWP-H.bcmap +0 -0
- package/public/pdfjs/cmaps/NWP-V.bcmap +0 -0
- package/public/pdfjs/cmaps/RKSJ-H.bcmap +0 -0
- package/public/pdfjs/cmaps/RKSJ-V.bcmap +0 -0
- package/public/pdfjs/cmaps/Roman.bcmap +0 -0
- package/public/pdfjs/cmaps/UniCNS-UCS2-H.bcmap +0 -0
- package/public/pdfjs/cmaps/UniCNS-UCS2-V.bcmap +0 -0
- package/public/pdfjs/cmaps/UniCNS-UTF16-H.bcmap +0 -0
- package/public/pdfjs/cmaps/UniCNS-UTF16-V.bcmap +0 -0
- package/public/pdfjs/cmaps/UniCNS-UTF32-H.bcmap +0 -0
- package/public/pdfjs/cmaps/UniCNS-UTF32-V.bcmap +0 -0
- package/public/pdfjs/cmaps/UniCNS-UTF8-H.bcmap +0 -0
- package/public/pdfjs/cmaps/UniCNS-UTF8-V.bcmap +0 -0
- package/public/pdfjs/cmaps/UniGB-UCS2-H.bcmap +0 -0
- package/public/pdfjs/cmaps/UniGB-UCS2-V.bcmap +0 -0
- package/public/pdfjs/cmaps/UniGB-UTF16-H.bcmap +0 -0
- package/public/pdfjs/cmaps/UniGB-UTF16-V.bcmap +0 -0
- package/public/pdfjs/cmaps/UniGB-UTF32-H.bcmap +0 -0
- package/public/pdfjs/cmaps/UniGB-UTF32-V.bcmap +0 -0
- package/public/pdfjs/cmaps/UniGB-UTF8-H.bcmap +0 -0
- package/public/pdfjs/cmaps/UniGB-UTF8-V.bcmap +0 -0
- package/public/pdfjs/cmaps/UniJIS-UCS2-H.bcmap +0 -0
- package/public/pdfjs/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
- package/public/pdfjs/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
- package/public/pdfjs/cmaps/UniJIS-UCS2-V.bcmap +0 -0
- package/public/pdfjs/cmaps/UniJIS-UTF16-H.bcmap +0 -0
- package/public/pdfjs/cmaps/UniJIS-UTF16-V.bcmap +0 -0
- package/public/pdfjs/cmaps/UniJIS-UTF32-H.bcmap +0 -0
- package/public/pdfjs/cmaps/UniJIS-UTF32-V.bcmap +0 -0
- package/public/pdfjs/cmaps/UniJIS-UTF8-H.bcmap +0 -0
- package/public/pdfjs/cmaps/UniJIS-UTF8-V.bcmap +0 -0
- package/public/pdfjs/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
- package/public/pdfjs/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
- package/public/pdfjs/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
- package/public/pdfjs/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
- package/public/pdfjs/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
- package/public/pdfjs/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
- package/public/pdfjs/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
- package/public/pdfjs/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
- package/public/pdfjs/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
- package/public/pdfjs/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
- package/public/pdfjs/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
- package/public/pdfjs/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
- package/public/pdfjs/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
- package/public/pdfjs/cmaps/UniKS-UCS2-H.bcmap +0 -0
- package/public/pdfjs/cmaps/UniKS-UCS2-V.bcmap +0 -0
- package/public/pdfjs/cmaps/UniKS-UTF16-H.bcmap +0 -0
- package/public/pdfjs/cmaps/UniKS-UTF16-V.bcmap +0 -0
- package/public/pdfjs/cmaps/UniKS-UTF32-H.bcmap +0 -0
- package/public/pdfjs/cmaps/UniKS-UTF32-V.bcmap +0 -0
- package/public/pdfjs/cmaps/UniKS-UTF8-H.bcmap +0 -0
- package/public/pdfjs/cmaps/UniKS-UTF8-V.bcmap +0 -0
- package/public/pdfjs/cmaps/V.bcmap +0 -0
- package/public/pdfjs/cmaps/WP-Symbol.bcmap +0 -0
- package/src/components/ai/ai-prompt-input/index.tsx +3 -87
- package/src/components/ai-elements/__tests__/context.test.tsx +167 -0
- package/src/components/ai-elements/context.tsx +182 -94
- package/src/components/ai-elements/prompt-input.tsx +6 -104
- package/src/components/harness/__tests__/composer-attachments.test.tsx +17 -9
- package/src/components/harness/__tests__/composer-click-focus.test.tsx +175 -0
- package/src/components/harness/__tests__/composer-focus.test.tsx +7 -0
- package/src/components/harness/__tests__/composer-keymap.test.ts +57 -0
- package/src/components/harness/__tests__/composer-paste.test.tsx +7 -0
- package/src/components/harness/__tests__/composer-pending-guard.test.tsx +207 -0
- package/src/components/harness/__tests__/composer-placeholder.test.ts +7 -6
- package/src/components/harness/__tests__/composer-plus-menu.test.tsx +202 -0
- package/src/components/harness/__tests__/composer-primary-button.test.tsx +7 -0
- package/src/components/harness/__tests__/composer-send.test.tsx +12 -4
- package/src/components/harness/__tests__/composer-undo.test.tsx +7 -0
- package/src/components/harness/__tests__/dock-registry.test.ts +46 -0
- package/src/components/harness/__tests__/harness-workbench-auth-error.test.tsx +42 -4
- package/src/components/harness/__tests__/mention-kbid.test.ts +69 -0
- package/src/components/harness/__tests__/undo-last-turn.test.ts +134 -0
- package/src/components/harness/__tests__/voice-activity.test.tsx +2 -2
- package/src/components/harness/conversation-panel/composer/__tests__/file-chip-open.test.tsx +195 -0
- package/src/components/harness/conversation-panel/composer/__tests__/menu-view.test.tsx +107 -0
- package/src/components/harness/conversation-panel/composer/command/__tests__/claim-attachments.test.tsx +271 -0
- package/src/components/harness/conversation-panel/composer/command/__tests__/claim-client-submit.test.tsx +291 -0
- package/src/components/harness/conversation-panel/composer/command/__tests__/claim-guard.test.tsx +275 -0
- package/src/components/harness/conversation-panel/composer/command/__tests__/command-permission.test.tsx +286 -0
- package/src/components/harness/conversation-panel/composer/command/__tests__/command-plan.test.tsx +344 -0
- package/src/components/harness/conversation-panel/composer/command/__tests__/command-popup.test.tsx +193 -0
- package/src/components/harness/conversation-panel/composer/command/__tests__/command-server-source.test.tsx +235 -0
- package/src/components/harness/conversation-panel/composer/command/__tests__/command-suggestion-menu.test.tsx +151 -1
- package/src/components/harness/conversation-panel/composer/command/__tests__/command-undo.test.tsx +168 -0
- package/src/components/harness/conversation-panel/composer/command/__tests__/exclude-composer-seat.test.ts +106 -0
- package/src/components/harness/conversation-panel/composer/command/__tests__/menu-view.test.tsx +55 -2
- package/src/components/harness/conversation-panel/composer/command/__tests__/skill-source.test.tsx +336 -0
- package/src/components/harness/conversation-panel/composer/command/claim.ts +7 -1
- package/src/components/harness/conversation-panel/composer/command/command-popup.tsx +140 -0
- package/src/components/harness/conversation-panel/composer/command/command-suggestion-menu.tsx +261 -75
- package/src/components/harness/conversation-panel/composer/command/menu-view.tsx +188 -50
- package/src/components/harness/conversation-panel/composer/command/popup-panel.tsx +106 -0
- package/src/components/harness/conversation-panel/composer/command/skill-source.ts +231 -0
- package/src/components/harness/conversation-panel/composer/composer-editor.tsx +216 -14
- package/src/components/harness/conversation-panel/composer/composer-keymap.ts +26 -0
- package/src/components/harness/conversation-panel/composer/extension/__tests__/command-menu.test.ts +128 -12
- package/src/components/harness/conversation-panel/composer/extension/command-menu.ts +303 -44
- package/src/components/harness/conversation-panel/composer/extension/index.ts +8 -0
- package/src/components/harness/conversation-panel/composer/harness-composer.tsx +551 -83
- package/src/components/harness/conversation-panel/composer/mention/__tests__/file-mention.test.tsx +517 -0
- package/src/components/harness/conversation-panel/composer/mention/__tests__/mention-source-registration.test.tsx +5 -2
- package/src/components/harness/conversation-panel/composer/mention/__tests__/mention-suggestion-menu.test.tsx +120 -0
- package/src/components/harness/conversation-panel/composer/mention/__tests__/mention-trigger-source.test.ts +52 -9
- package/src/components/harness/conversation-panel/composer/mention/__tests__/story-mention.test.tsx +356 -0
- package/src/components/harness/conversation-panel/composer/mention/__tests__/thread-mention.test.tsx +377 -0
- package/src/components/harness/conversation-panel/composer/mention/file-mention.ts +162 -0
- package/src/components/harness/conversation-panel/composer/mention/mention-resolvers.ts +6 -0
- package/src/components/harness/conversation-panel/composer/mention/mention-suggestion-menu.tsx +212 -107
- package/src/components/harness/conversation-panel/composer/mention/mention-trigger-source.ts +71 -8
- package/src/components/harness/conversation-panel/composer/mention/story-mention.ts +131 -0
- package/src/components/harness/conversation-panel/composer/mention/thread-mention.ts +159 -0
- package/src/components/harness/conversation-panel/composer/mention/use-mention-sources.ts +9 -1
- package/src/components/harness/conversation-panel/composer/model-selector/__tests__/model-selector.test.tsx +401 -0
- package/src/components/harness/conversation-panel/composer/model-selector/__tests__/wiring.test.ts +117 -0
- package/src/components/harness/conversation-panel/composer/model-selector/model-selector-panel.tsx +411 -0
- package/src/components/harness/conversation-panel/composer/model-selector/model-selector-trigger.tsx +254 -0
- package/src/components/harness/conversation-panel/composer/model-selector/wiring.ts +112 -0
- package/src/components/harness/conversation-panel/composer/permission/__tests__/permission-select.test.tsx +264 -0
- package/src/components/harness/conversation-panel/composer/permission/permission-policy.ts +76 -0
- package/src/components/harness/conversation-panel/composer/permission/permission-popup.tsx +302 -0
- package/src/components/harness/conversation-panel/composer/permission/permission-select-button.tsx +140 -0
- package/src/components/harness/conversation-panel/composer/workspace/__tests__/workspace-select.test.tsx +390 -0
- package/src/components/harness/conversation-panel/composer/workspace/workspace-select-button.tsx +367 -0
- package/src/components/harness/conversation-panel/messages/harness-chain/__tests__/use-harness-chat-adapter.test.ts +20 -0
- package/src/components/harness/conversation-panel/messages/harness-chain/__tests__/use-harness-session-putmedia.test.tsx +17 -0
- package/src/components/harness/conversation-panel/messages/harness-chain/use-agent-terminals.ts +116 -0
- package/src/components/harness/conversation-panel/messages/harness-chain/use-harness-chat-adapter.ts +43 -11
- package/src/components/harness/conversation-panel/messages/harness-chain/use-harness-session.ts +25 -4
- package/src/components/harness/conversation-panel/messages/tools/__tests__/tool-run.test.ts +26 -1
- package/src/components/harness/conversation-panel/messages/tools/tool-run.ts +11 -0
- package/src/components/harness/extension-panel/dock/__tests__/dock-persist.test.ts +2 -1
- package/src/components/harness/extension-panel/dock/__tests__/guide-page.test.tsx +44 -3
- package/src/components/harness/extension-panel/dock/__tests__/tab-strip.test.tsx +45 -0
- package/src/components/harness/extension-panel/dock/dock-persist.ts +6 -4
- package/src/components/harness/extension-panel/dock/dock-registry.ts +69 -14
- package/src/components/harness/extension-panel/dock/dock-surface.tsx +35 -0
- package/src/components/harness/extension-panel/dock/guide-page.tsx +78 -45
- package/src/components/harness/extension-panel/dock/tab-strip.tsx +9 -1
- package/src/components/harness/extension-panel/panels/plugin/__tests__/install-dialog.test.tsx +260 -0
- package/src/components/harness/extension-panel/panels/plugin/__tests__/plugin-page.test.tsx +912 -0
- package/src/components/harness/extension-panel/panels/plugin/__tests__/plugin-row.test.tsx +215 -0
- package/src/components/harness/extension-panel/panels/plugin/builtin-section.tsx +204 -0
- package/src/components/harness/extension-panel/panels/plugin/install-dialog.tsx +195 -0
- package/src/components/harness/extension-panel/panels/plugin/installed-section.tsx +378 -0
- package/src/components/harness/extension-panel/panels/plugin/kind.tsx +17 -4
- package/src/components/harness/extension-panel/panels/plugin/pending-builds-block.tsx +49 -0
- package/src/components/harness/extension-panel/panels/plugin/plugin-page.tsx +257 -0
- package/src/components/harness/extension-panel/panels/plugin/plugin-row.tsx +206 -0
- package/src/components/harness/extension-panel/panels/plugin/plugin-types.ts +13 -0
- package/src/components/harness/extension-panel/panels/plugin/worker-section.tsx +322 -0
- package/src/components/harness/extension-panel/panels/terminal/__tests__/kind.test.tsx +219 -2
- package/src/components/harness/extension-panel/panels/terminal/__tests__/terminal-instance.test.tsx +322 -19
- package/src/components/harness/extension-panel/panels/terminal/__tests__/use-agent-terminal-roster.test.tsx +393 -0
- package/src/components/harness/extension-panel/panels/terminal/__tests__/ws-transport.test.ts +25 -0
- package/src/components/harness/extension-panel/panels/terminal/kind.tsx +55 -1
- package/src/components/harness/extension-panel/panels/terminal/shell-pref.ts +7 -4
- package/src/components/harness/extension-panel/panels/terminal/sse-transport.ts +26 -6
- package/src/components/harness/extension-panel/panels/terminal/tab-control-state.tsx +114 -0
- package/src/components/harness/extension-panel/panels/terminal/terminal-instance.tsx +190 -96
- package/src/components/harness/extension-panel/panels/terminal/terminal-theme.ts +113 -0
- package/src/components/harness/extension-panel/panels/terminal/transport.ts +28 -6
- package/src/components/harness/extension-panel/panels/terminal/use-agent-terminal-roster.ts +107 -0
- package/src/components/harness/extension-panel/panels/terminal/ws-transport.ts +7 -5
- package/src/components/harness/extension-panel/panels/terminal/xterm-terminal.tsx +5 -67
- package/src/components/harness/workbench/__tests__/provider-model-groups.test.ts +301 -0
- package/src/components/harness/workbench/harness-workbench-page.tsx +164 -2
- package/src/components/harness/workbench/provider-model-groups.ts +140 -0
- package/src/components/harness/workbench/undo-last-turn.ts +79 -0
- package/src/components/harness/workbench/workbench-context.tsx +53 -3
- package/src/components/tiptap/hooks/__tests__/use-floating-element.test.tsx +131 -0
- package/src/components/tiptap/hooks/use-floating-element.ts +15 -2
- package/src/components/tiptap/hooks/use-menu-navigation.ts +5 -0
- package/src/components/tiptap/node/mention-extension.ts +33 -0
- package/src/components/tiptap/ui/suggestion-menu/__tests__/suggestion-menu.test.tsx +366 -0
- package/src/components/tiptap/ui/suggestion-menu/suggestion-menu-types.ts +54 -0
- package/src/components/tiptap/ui/suggestion-menu/suggestion-menu.tsx +176 -45
- package/src/lib/changelog/sdk-versions.ts +2 -2
- package/src/lib/queries/__tests__/harness-plugin-queries.test.ts +49 -0
- package/src/lib/queries/harness-terminal.ts +77 -0
- package/src/lib/queries/harness.ts +50 -0
- package/src/paraglide/messages/_index.js +1622 -311
- package/src/paraglide/messages/en.js +528 -103
- package/src/paraglide/messages/zh.js +529 -104
- package/src/routes/_nav/harness/route.lazy.tsx +13 -0
- package/src/routes/api/harness/$.ts +19 -2
- package/src/routes/api/harness/terminal/$.ts +37 -6
- package/src/routes/api/harness/terminal/__tests__/route.test.ts +120 -0
- package/src/server/ai-gateway/sandbox/policy.ts +6 -6
- package/src/server/harness/__tests__/agent-terminal.server.test.ts +448 -0
- package/src/server/harness/__tests__/builtin-tools-invariant.test.ts +22 -12
- package/src/server/harness/__tests__/compact-plugin.server.test.ts +46 -0
- package/src/server/harness/__tests__/define-expose.test.ts +17 -0
- package/src/server/harness/__tests__/first-contact-fakes.test.ts +103 -3
- package/src/server/harness/__tests__/terminal-manager.server.test.ts +761 -2
- package/src/server/harness/__tests__/thread-reference.server.test.ts +258 -0
- package/src/server/harness/agent-terminal.server.ts +631 -0
- package/src/server/harness/define.server.ts +21 -3
- package/src/server/harness/first-contact-fakes.ts +115 -4
- package/src/server/harness/host.server.ts +28 -1
- package/src/server/harness/persistence/__tests__/session-index-store.server.test.ts +83 -0
- package/src/server/harness/persistence/prisma-persistence.server.ts +12 -3
- package/src/server/harness/persistence/session-index-store.server.ts +26 -0
- package/src/server/harness/plugins/__tests__/assemble-disable.test.ts +25 -17
- package/src/server/harness/plugins/__tests__/tool-risk-audit.test.ts +16 -6
- package/src/server/harness/plugins/assemble-app.ts +12 -0
- package/src/server/harness/plugins/base-patch.ts +9 -2
- package/src/server/harness/plugins/builtin/__tests__/agent-terminal.plugin.test.ts +702 -0
- package/src/server/harness/plugins/builtin/agent-terminal.plugin.ts +518 -0
- package/src/server/harness/terminal-frame-builder.server.ts +5 -3
- package/src/server/harness/terminal-manager.server.ts +772 -35
- package/src/server/harness/terminal-ws-handler.server.ts +8 -2
- package/src/server/harness/thread-reference.server.ts +446 -0
- package/src/server/harness/tool-risk.ts +20 -4
- package/src/server/serverFns/chat/__tests__/conversations-sandbox-default.test.ts +23 -0
- package/src/server/serverFns/chat/conversations.ts +18 -3
- package/src/server/serverFns/harness/search-mention-candidates.ts +14 -1
- package/src/shared/harness/__tests__/thread-reference-format.test.ts +128 -0
- package/src/shared/harness/thread-reference-format.ts +98 -0
- package/LICENSE +0 -661
- package/src/components/agents/slash-skill-menu.tsx +0 -75
- package/src/components/harness/conversation-panel/composer/extension/__tests__/demo-story-reference.test.tsx +0 -177
- package/src/components/harness/conversation-panel/composer/extension/demo-story-reference.tsx +0 -227
- package/src/components/harness/conversation-panel/composer/plugin-mention-menu.tsx +0 -109
- package/src/components/harness/extension-panel/panels/plugin-panel.tsx +0 -1021
- package/src/components/harness/extension-panel/panels/terminal/__tests__/xterm-webgl.test.ts +0 -68
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import { Button } from "@/components/ui/button";
|
|
2
|
-
import {
|
|
3
|
-
HoverCard,
|
|
4
|
-
HoverCardContent,
|
|
5
|
-
HoverCardTrigger,
|
|
6
|
-
} from "@/components/ui/hover-card";
|
|
2
|
+
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
|
|
7
3
|
import { Progress } from "@/components/ui/progress";
|
|
8
4
|
import { cn } from "@/lib/utils";
|
|
9
|
-
import type { LanguageModelUsage } from "ai";
|
|
10
5
|
import type { ComponentProps } from "react";
|
|
11
6
|
import { createContext, useContext, useMemo } from "react";
|
|
12
|
-
import {
|
|
7
|
+
import { m } from "@/paraglide/messages.js";
|
|
13
8
|
|
|
14
9
|
const PERCENT_MAX = 100;
|
|
15
10
|
const ICON_RADIUS = 10;
|
|
@@ -19,11 +14,38 @@ const ICON_STROKE_WIDTH = 2;
|
|
|
19
14
|
|
|
20
15
|
type ModelId = string;
|
|
21
16
|
|
|
17
|
+
/**
|
|
18
|
+
* 会话用量四桶(任务 6):ai-harness `UsageCounts` 的内联同形(calls/cost 放宽为
|
|
19
|
+
* 可选——调用方直传 sessionUsage.total 结构兼容),另加可选 reasoningTokens——
|
|
20
|
+
* UsageCounts 主形不拆推理桶,provider 报告时行才渲染(缺省隐藏)。
|
|
21
|
+
* 成本取 provider 报告的原币种数值(多数 USD),不再经 tokenlens 估价。
|
|
22
|
+
*/
|
|
23
|
+
export interface ContextUsageCounts {
|
|
24
|
+
promptTokens: number;
|
|
25
|
+
completionTokens: number;
|
|
26
|
+
cachedTokens: number;
|
|
27
|
+
cacheWriteTokens: number;
|
|
28
|
+
totalTokens: number;
|
|
29
|
+
calls?: number;
|
|
30
|
+
cost?: number;
|
|
31
|
+
/** provider 报告的推理 tokens(UsageCounts 无此字段,缺省 → 推理行隐藏) */
|
|
32
|
+
reasoningTokens?: number;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** 会话统计段的按模型分解行(ai-harness SessionUsage.byModel 值的结构子集) */
|
|
36
|
+
export interface ContextByModelEntry {
|
|
37
|
+
totalTokens: number;
|
|
38
|
+
calls: number;
|
|
39
|
+
}
|
|
40
|
+
|
|
22
41
|
interface ContextSchema {
|
|
23
42
|
usedTokens: number;
|
|
24
43
|
maxTokens: number;
|
|
25
|
-
usage?: LanguageModelUsage;
|
|
26
44
|
modelId?: ModelId;
|
|
45
|
+
usageCounts?: ContextUsageCounts;
|
|
46
|
+
/** 会话轮次(dock 行由 user 消息数派生) */
|
|
47
|
+
turns?: number;
|
|
48
|
+
byModel?: Record<string, ContextByModelEntry>;
|
|
27
49
|
}
|
|
28
50
|
|
|
29
51
|
const ContextContext = createContext<ContextSchema | null>(null);
|
|
@@ -38,24 +60,29 @@ const useContextValue = () => {
|
|
|
38
60
|
return context;
|
|
39
61
|
};
|
|
40
62
|
|
|
41
|
-
export type ContextProps = ComponentProps<typeof
|
|
63
|
+
export type ContextProps = ComponentProps<typeof Popover> & ContextSchema;
|
|
42
64
|
|
|
43
65
|
export const Context = ({
|
|
44
66
|
usedTokens,
|
|
45
67
|
maxTokens,
|
|
46
|
-
usage,
|
|
47
68
|
modelId,
|
|
69
|
+
usageCounts,
|
|
70
|
+
turns,
|
|
71
|
+
byModel,
|
|
48
72
|
...props
|
|
49
73
|
}: ContextProps) => {
|
|
50
74
|
const contextValue = useMemo(
|
|
51
|
-
() => ({ maxTokens, modelId,
|
|
52
|
-
[maxTokens, modelId,
|
|
75
|
+
() => ({ maxTokens, modelId, usageCounts, turns, byModel, usedTokens }),
|
|
76
|
+
[maxTokens, modelId, usageCounts, turns, byModel, usedTokens]
|
|
53
77
|
);
|
|
78
|
+
// 空态门控(复审 P2-4 组件侧收口):无上下文占用且无会话用量 → 整体不渲染
|
|
79
|
+
// (触发器不出现)。composer dock 行另有整行门控——轮次徽标等行内其余内容
|
|
80
|
+
// 不受组件门控管辖。hooks 恒调用(早退在其后),空↔非空翻转不破 hook 序。
|
|
81
|
+
const hasUsage = usedTokens > 0 || (usageCounts?.totalTokens ?? 0) > 0;
|
|
54
82
|
|
|
55
83
|
return (
|
|
56
84
|
<ContextContext.Provider value={contextValue}>
|
|
57
|
-
{
|
|
58
|
-
<HoverCard {...props} />
|
|
85
|
+
{hasUsage ? <Popover {...props} /> : null}
|
|
59
86
|
</ContextContext.Provider>
|
|
60
87
|
);
|
|
61
88
|
};
|
|
@@ -111,30 +138,59 @@ export const ContextTrigger = ({ children, ...props }: ContextTriggerProps) => {
|
|
|
111
138
|
style: "percent",
|
|
112
139
|
}).format(usedPercent);
|
|
113
140
|
|
|
141
|
+
if (children != null) {
|
|
142
|
+
return <PopoverTrigger>{children}</PopoverTrigger>;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// render 模式:触发行为(click 开合)合并到 Button 本体,避免 button 套 button
|
|
114
146
|
return (
|
|
115
|
-
<
|
|
116
|
-
{
|
|
147
|
+
<PopoverTrigger
|
|
148
|
+
render={
|
|
117
149
|
<Button type="button" variant="ghost" {...props}>
|
|
118
150
|
<span className="font-medium text-muted-foreground">
|
|
119
151
|
{renderedPercent}
|
|
120
152
|
</span>
|
|
121
153
|
<ContextIcon />
|
|
122
154
|
</Button>
|
|
123
|
-
|
|
124
|
-
|
|
155
|
+
}
|
|
156
|
+
/>
|
|
125
157
|
);
|
|
126
158
|
};
|
|
127
159
|
|
|
128
|
-
export type ContextContentProps = ComponentProps<typeof
|
|
160
|
+
export type ContextContentProps = ComponentProps<typeof PopoverContent>;
|
|
129
161
|
|
|
130
162
|
export const ContextContent = ({
|
|
131
163
|
className,
|
|
164
|
+
children,
|
|
132
165
|
...props
|
|
133
166
|
}: ContextContentProps) => (
|
|
134
|
-
<
|
|
167
|
+
<PopoverContent
|
|
168
|
+
align="start"
|
|
135
169
|
className={cn("min-w-60 divide-y overflow-hidden p-0", className)}
|
|
136
170
|
{...props}
|
|
137
|
-
|
|
171
|
+
>
|
|
172
|
+
{children ?? <ContextContentSections />}
|
|
173
|
+
</PopoverContent>
|
|
174
|
+
);
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* 三段面板默认体(复审 P2-2/P2-3):① 上下文头部(百分比+used/window+Progress)
|
|
178
|
+
* ② Token 用量(输入/输出/缓存/缓存写入/推理 行 + 成本行)③ 会话统计
|
|
179
|
+
* (轮次/调用数/按模型分解)。调用方传 children 时整面替换(gallery demo 形态)。
|
|
180
|
+
*/
|
|
181
|
+
const ContextContentSections = () => (
|
|
182
|
+
<>
|
|
183
|
+
<ContextContentHeader />
|
|
184
|
+
<ContextContentBody className="space-y-1.5">
|
|
185
|
+
<ContextInputUsage />
|
|
186
|
+
<ContextOutputUsage />
|
|
187
|
+
<ContextCacheUsage />
|
|
188
|
+
<ContextCacheWriteUsage />
|
|
189
|
+
<ContextReasoningUsage />
|
|
190
|
+
<ContextContentFooter />
|
|
191
|
+
</ContextContentBody>
|
|
192
|
+
<ContextSessionStats />
|
|
193
|
+
</>
|
|
138
194
|
);
|
|
139
195
|
|
|
140
196
|
export type ContextContentHeaderProps = ComponentProps<"div">;
|
|
@@ -188,6 +244,10 @@ export const ContextContentBody = ({
|
|
|
188
244
|
</div>
|
|
189
245
|
);
|
|
190
246
|
|
|
247
|
+
/**
|
|
248
|
+
* 成本行(Token 用量段末行):usageCounts.cost 有值显示货币格式(provider 报告
|
|
249
|
+
* 原币种,多数 USD),无值显示「—」。不再调 tokenlens 估价(复审裁决)。
|
|
250
|
+
*/
|
|
191
251
|
export type ContextContentFooterProps = ComponentProps<"div">;
|
|
192
252
|
|
|
193
253
|
export const ContextContentFooter = ({
|
|
@@ -195,25 +255,20 @@ export const ContextContentFooter = ({
|
|
|
195
255
|
className,
|
|
196
256
|
...props
|
|
197
257
|
}: ContextContentFooterProps) => {
|
|
198
|
-
const {
|
|
199
|
-
const
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
: undefined;
|
|
208
|
-
const totalCost = new Intl.NumberFormat("en-US", {
|
|
209
|
-
currency: "USD",
|
|
210
|
-
style: "currency",
|
|
211
|
-
}).format(costUSD ?? 0);
|
|
258
|
+
const { usageCounts } = useContextValue();
|
|
259
|
+
const cost = usageCounts?.cost;
|
|
260
|
+
const totalCost =
|
|
261
|
+
cost != null
|
|
262
|
+
? new Intl.NumberFormat("en-US", {
|
|
263
|
+
currency: "USD",
|
|
264
|
+
style: "currency",
|
|
265
|
+
}).format(cost)
|
|
266
|
+
: m.harness_meter_costNone();
|
|
212
267
|
|
|
213
268
|
return (
|
|
214
269
|
<div
|
|
215
270
|
className={cn(
|
|
216
|
-
"flex w-full items-center justify-between gap-3
|
|
271
|
+
"flex w-full items-center justify-between gap-3 text-xs",
|
|
217
272
|
className
|
|
218
273
|
)}
|
|
219
274
|
{...props}
|
|
@@ -228,6 +283,55 @@ export const ContextContentFooter = ({
|
|
|
228
283
|
);
|
|
229
284
|
};
|
|
230
285
|
|
|
286
|
+
/**
|
|
287
|
+
* 会话统计段(③):轮次 / 模型调用数一行 + 按模型分解(模型名 + totalTokens +
|
|
288
|
+
* calls)。turns 与 calls 皆缺省且无 byModel 时不渲染整段。
|
|
289
|
+
*/
|
|
290
|
+
const ContextSessionStats = () => {
|
|
291
|
+
const { usageCounts, turns, byModel } = useContextValue();
|
|
292
|
+
const modelEntries = Object.entries(byModel ?? {});
|
|
293
|
+
const calls = usageCounts?.calls ?? 0;
|
|
294
|
+
const showCounts = turns != null || calls > 0;
|
|
295
|
+
|
|
296
|
+
if (!showCounts && modelEntries.length === 0) {
|
|
297
|
+
return null;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
return (
|
|
301
|
+
<ContextContentBody className="space-y-1.5">
|
|
302
|
+
{showCounts && (
|
|
303
|
+
<div className="flex items-center justify-between gap-3 text-xs">
|
|
304
|
+
<span className="text-muted-foreground">
|
|
305
|
+
{turns != null ? m.harness_meter_turns({ count: turns }) : null}
|
|
306
|
+
</span>
|
|
307
|
+
<span>{calls > 0 ? m.harness_meter_calls({ count: calls }) : null}</span>
|
|
308
|
+
</div>
|
|
309
|
+
)}
|
|
310
|
+
{modelEntries.length > 0 && (
|
|
311
|
+
<>
|
|
312
|
+
<p className="pt-1 text-xs text-muted-foreground">
|
|
313
|
+
{m.harness_meter_byModel()}
|
|
314
|
+
</p>
|
|
315
|
+
{modelEntries.map(([name, counts]) => (
|
|
316
|
+
<div
|
|
317
|
+
key={name}
|
|
318
|
+
className="flex items-center justify-between gap-3 text-xs"
|
|
319
|
+
>
|
|
320
|
+
<span className="truncate text-muted-foreground">{name}</span>
|
|
321
|
+
<span className="font-mono">
|
|
322
|
+
<TokensWithCost tokens={counts.totalTokens} />
|
|
323
|
+
<span className="ml-2 text-muted-foreground">
|
|
324
|
+
· {m.harness_meter_calls({ count: counts.calls })}
|
|
325
|
+
</span>
|
|
326
|
+
</span>
|
|
327
|
+
</div>
|
|
328
|
+
))}
|
|
329
|
+
</>
|
|
330
|
+
)}
|
|
331
|
+
</ContextContentBody>
|
|
332
|
+
);
|
|
333
|
+
};
|
|
334
|
+
|
|
231
335
|
const TokensWithCost = ({
|
|
232
336
|
tokens,
|
|
233
337
|
costText,
|
|
@@ -254,8 +358,8 @@ export const ContextInputUsage = ({
|
|
|
254
358
|
children,
|
|
255
359
|
...props
|
|
256
360
|
}: ContextInputUsageProps) => {
|
|
257
|
-
const {
|
|
258
|
-
const inputTokens =
|
|
361
|
+
const { usageCounts } = useContextValue();
|
|
362
|
+
const inputTokens = usageCounts?.promptTokens ?? 0;
|
|
259
363
|
|
|
260
364
|
if (children) {
|
|
261
365
|
return children;
|
|
@@ -265,24 +369,13 @@ export const ContextInputUsage = ({
|
|
|
265
369
|
return null;
|
|
266
370
|
}
|
|
267
371
|
|
|
268
|
-
const inputCost = modelId
|
|
269
|
-
? getUsage({
|
|
270
|
-
modelId,
|
|
271
|
-
usage: { input: inputTokens, output: 0 },
|
|
272
|
-
}).costUSD?.totalUSD
|
|
273
|
-
: undefined;
|
|
274
|
-
const inputCostText = new Intl.NumberFormat("en-US", {
|
|
275
|
-
currency: "USD",
|
|
276
|
-
style: "currency",
|
|
277
|
-
}).format(inputCost ?? 0);
|
|
278
|
-
|
|
279
372
|
return (
|
|
280
373
|
<div
|
|
281
374
|
className={cn("flex items-center justify-between text-xs", className)}
|
|
282
375
|
{...props}
|
|
283
376
|
>
|
|
284
377
|
<span className="text-muted-foreground">输入</span>
|
|
285
|
-
<TokensWithCost
|
|
378
|
+
<TokensWithCost tokens={inputTokens} />
|
|
286
379
|
</div>
|
|
287
380
|
);
|
|
288
381
|
};
|
|
@@ -294,8 +387,8 @@ export const ContextOutputUsage = ({
|
|
|
294
387
|
children,
|
|
295
388
|
...props
|
|
296
389
|
}: ContextOutputUsageProps) => {
|
|
297
|
-
const {
|
|
298
|
-
const outputTokens =
|
|
390
|
+
const { usageCounts } = useContextValue();
|
|
391
|
+
const outputTokens = usageCounts?.completionTokens ?? 0;
|
|
299
392
|
|
|
300
393
|
if (children) {
|
|
301
394
|
return children;
|
|
@@ -305,24 +398,13 @@ export const ContextOutputUsage = ({
|
|
|
305
398
|
return null;
|
|
306
399
|
}
|
|
307
400
|
|
|
308
|
-
const outputCost = modelId
|
|
309
|
-
? getUsage({
|
|
310
|
-
modelId,
|
|
311
|
-
usage: { input: 0, output: outputTokens },
|
|
312
|
-
}).costUSD?.totalUSD
|
|
313
|
-
: undefined;
|
|
314
|
-
const outputCostText = new Intl.NumberFormat("en-US", {
|
|
315
|
-
currency: "USD",
|
|
316
|
-
style: "currency",
|
|
317
|
-
}).format(outputCost ?? 0);
|
|
318
|
-
|
|
319
401
|
return (
|
|
320
402
|
<div
|
|
321
403
|
className={cn("flex items-center justify-between text-xs", className)}
|
|
322
404
|
{...props}
|
|
323
405
|
>
|
|
324
406
|
<span className="text-muted-foreground">输出</span>
|
|
325
|
-
<TokensWithCost
|
|
407
|
+
<TokensWithCost tokens={outputTokens} />
|
|
326
408
|
</div>
|
|
327
409
|
);
|
|
328
410
|
};
|
|
@@ -334,9 +416,9 @@ export const ContextReasoningUsage = ({
|
|
|
334
416
|
children,
|
|
335
417
|
...props
|
|
336
418
|
}: ContextReasoningUsageProps) => {
|
|
337
|
-
const {
|
|
338
|
-
// ai
|
|
339
|
-
const reasoningTokens =
|
|
419
|
+
const { usageCounts } = useContextValue();
|
|
420
|
+
// ai-harness UsageCounts 不拆推理桶;provider 报告 reasoningTokens 时才渲染
|
|
421
|
+
const reasoningTokens = usageCounts?.reasoningTokens ?? 0;
|
|
340
422
|
|
|
341
423
|
if (children) {
|
|
342
424
|
return children;
|
|
@@ -346,24 +428,13 @@ export const ContextReasoningUsage = ({
|
|
|
346
428
|
return null;
|
|
347
429
|
}
|
|
348
430
|
|
|
349
|
-
const reasoningCost = modelId
|
|
350
|
-
? getUsage({
|
|
351
|
-
modelId,
|
|
352
|
-
usage: { reasoningTokens },
|
|
353
|
-
}).costUSD?.totalUSD
|
|
354
|
-
: undefined;
|
|
355
|
-
const reasoningCostText = new Intl.NumberFormat("en-US", {
|
|
356
|
-
currency: "USD",
|
|
357
|
-
style: "currency",
|
|
358
|
-
}).format(reasoningCost ?? 0);
|
|
359
|
-
|
|
360
431
|
return (
|
|
361
432
|
<div
|
|
362
433
|
className={cn("flex items-center justify-between text-xs", className)}
|
|
363
434
|
{...props}
|
|
364
435
|
>
|
|
365
436
|
<span className="text-muted-foreground">推理</span>
|
|
366
|
-
<TokensWithCost
|
|
437
|
+
<TokensWithCost tokens={reasoningTokens} />
|
|
367
438
|
</div>
|
|
368
439
|
);
|
|
369
440
|
};
|
|
@@ -375,9 +446,8 @@ export const ContextCacheUsage = ({
|
|
|
375
446
|
children,
|
|
376
447
|
...props
|
|
377
448
|
}: ContextCacheUsageProps) => {
|
|
378
|
-
const {
|
|
379
|
-
|
|
380
|
-
const cacheTokens = usage?.inputTokenDetails?.cacheReadTokens ?? 0;
|
|
449
|
+
const { usageCounts } = useContextValue();
|
|
450
|
+
const cacheTokens = usageCounts?.cachedTokens ?? 0;
|
|
381
451
|
|
|
382
452
|
if (children) {
|
|
383
453
|
return children;
|
|
@@ -387,24 +457,42 @@ export const ContextCacheUsage = ({
|
|
|
387
457
|
return null;
|
|
388
458
|
}
|
|
389
459
|
|
|
390
|
-
const cacheCost = modelId
|
|
391
|
-
? getUsage({
|
|
392
|
-
modelId,
|
|
393
|
-
usage: { cacheReads: cacheTokens, input: 0, output: 0 },
|
|
394
|
-
}).costUSD?.totalUSD
|
|
395
|
-
: undefined;
|
|
396
|
-
const cacheCostText = new Intl.NumberFormat("en-US", {
|
|
397
|
-
currency: "USD",
|
|
398
|
-
style: "currency",
|
|
399
|
-
}).format(cacheCost ?? 0);
|
|
400
|
-
|
|
401
460
|
return (
|
|
402
461
|
<div
|
|
403
462
|
className={cn("flex items-center justify-between text-xs", className)}
|
|
404
463
|
{...props}
|
|
405
464
|
>
|
|
406
465
|
<span className="text-muted-foreground">缓存</span>
|
|
407
|
-
<TokensWithCost
|
|
466
|
+
<TokensWithCost tokens={cacheTokens} />
|
|
467
|
+
</div>
|
|
468
|
+
);
|
|
469
|
+
};
|
|
470
|
+
|
|
471
|
+
export type ContextCacheWriteUsageProps = ComponentProps<"div">;
|
|
472
|
+
|
|
473
|
+
export const ContextCacheWriteUsage = ({
|
|
474
|
+
className,
|
|
475
|
+
children,
|
|
476
|
+
...props
|
|
477
|
+
}: ContextCacheWriteUsageProps) => {
|
|
478
|
+
const { usageCounts } = useContextValue();
|
|
479
|
+
const cacheWriteTokens = usageCounts?.cacheWriteTokens ?? 0;
|
|
480
|
+
|
|
481
|
+
if (children) {
|
|
482
|
+
return children;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
if (!cacheWriteTokens) {
|
|
486
|
+
return null;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
return (
|
|
490
|
+
<div
|
|
491
|
+
className={cn("flex items-center justify-between text-xs", className)}
|
|
492
|
+
{...props}
|
|
493
|
+
>
|
|
494
|
+
<span className="text-muted-foreground">{m.harness_meter_cacheWrite()}</span>
|
|
495
|
+
<TokensWithCost tokens={cacheWriteTokens} />
|
|
408
496
|
</div>
|
|
409
497
|
);
|
|
410
498
|
};
|
|
@@ -22,18 +22,9 @@
|
|
|
22
22
|
// 组件而非直接组装 InputGroup 原语。
|
|
23
23
|
|
|
24
24
|
import * as React from "react"
|
|
25
|
-
import { ArrowUpIcon,
|
|
25
|
+
import { ArrowUpIcon, Loader2, Square } from "lucide-react"
|
|
26
26
|
|
|
27
27
|
import { cn } from "@/lib/utils"
|
|
28
|
-
import {
|
|
29
|
-
DropdownMenu,
|
|
30
|
-
DropdownMenuContent,
|
|
31
|
-
DropdownMenuGroup,
|
|
32
|
-
DropdownMenuLabel,
|
|
33
|
-
DropdownMenuRadioGroup,
|
|
34
|
-
DropdownMenuRadioItem,
|
|
35
|
-
DropdownMenuTrigger,
|
|
36
|
-
} from "@/components/ui/dropdown-menu"
|
|
37
28
|
import {
|
|
38
29
|
InputGroup,
|
|
39
30
|
InputGroupAddon,
|
|
@@ -135,104 +126,15 @@ function PromptInputSubmit({
|
|
|
135
126
|
)
|
|
136
127
|
}
|
|
137
128
|
|
|
138
|
-
/* ── PromptInputModelSelect
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
onValueChange,
|
|
144
|
-
className,
|
|
145
|
-
...props
|
|
146
|
-
}: React.ComponentProps<"button"> & {
|
|
147
|
-
models: string[]
|
|
148
|
-
value: string
|
|
149
|
-
onValueChange: (model: string) => void
|
|
150
|
-
}) {
|
|
151
|
-
const current = models.find((m) => m === value) ?? models[0]
|
|
152
|
-
|
|
153
|
-
return (
|
|
154
|
-
<DropdownMenu>
|
|
155
|
-
<DropdownMenuTrigger
|
|
156
|
-
render={
|
|
157
|
-
<InputGroupButton
|
|
158
|
-
size="sm"
|
|
159
|
-
variant="outline"
|
|
160
|
-
aria-label={`Model: ${current}`}
|
|
161
|
-
className={cn("rounded-full", className)}
|
|
162
|
-
disabled={models.length === 0}
|
|
163
|
-
{...props}
|
|
164
|
-
/>
|
|
165
|
-
}
|
|
166
|
-
>
|
|
167
|
-
{current}
|
|
168
|
-
<ChevronDown className="size-4 text-muted-foreground" />
|
|
169
|
-
</DropdownMenuTrigger>
|
|
170
|
-
<DropdownMenuContent align="start" className="w-48">
|
|
171
|
-
<DropdownMenuRadioGroup value={value} onValueChange={onValueChange}>
|
|
172
|
-
{models.map((m) => (
|
|
173
|
-
<DropdownMenuRadioItem key={m} value={m} closeOnClick>
|
|
174
|
-
{m}
|
|
175
|
-
</DropdownMenuRadioItem>
|
|
176
|
-
))}
|
|
177
|
-
</DropdownMenuRadioGroup>
|
|
178
|
-
</DropdownMenuContent>
|
|
179
|
-
</DropdownMenu>
|
|
180
|
-
)
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
/* ── PromptInputEffortSelect:力度选择 pill ─────────────────────────── */
|
|
184
|
-
|
|
185
|
-
function PromptInputEffortSelect({
|
|
186
|
-
efforts,
|
|
187
|
-
value,
|
|
188
|
-
onValueChange,
|
|
189
|
-
className,
|
|
190
|
-
...props
|
|
191
|
-
}: React.ComponentProps<"button"> & {
|
|
192
|
-
efforts: Array<{ id: string; name: string }>
|
|
193
|
-
value: string
|
|
194
|
-
onValueChange: (effort: string) => void
|
|
195
|
-
}) {
|
|
196
|
-
const current = efforts.find((e) => e.id === value) ?? efforts[0]
|
|
197
|
-
|
|
198
|
-
return (
|
|
199
|
-
<DropdownMenu>
|
|
200
|
-
<DropdownMenuTrigger
|
|
201
|
-
render={
|
|
202
|
-
<InputGroupButton
|
|
203
|
-
size="sm"
|
|
204
|
-
variant="outline"
|
|
205
|
-
aria-label={`Effort: ${current?.name}`}
|
|
206
|
-
className={cn("rounded-full", className)}
|
|
207
|
-
{...props}
|
|
208
|
-
/>
|
|
209
|
-
}
|
|
210
|
-
>
|
|
211
|
-
<span className="text-muted-foreground">Effort</span>
|
|
212
|
-
{current?.name}
|
|
213
|
-
<ChevronDown className="size-4 text-muted-foreground" />
|
|
214
|
-
</DropdownMenuTrigger>
|
|
215
|
-
<DropdownMenuContent align="start" className="w-36">
|
|
216
|
-
<DropdownMenuGroup>
|
|
217
|
-
<DropdownMenuLabel>Effort</DropdownMenuLabel>
|
|
218
|
-
<DropdownMenuRadioGroup value={value} onValueChange={onValueChange}>
|
|
219
|
-
{efforts.map((e) => (
|
|
220
|
-
<DropdownMenuRadioItem key={e.id} value={e.id} closeOnClick>
|
|
221
|
-
{e.name}
|
|
222
|
-
</DropdownMenuRadioItem>
|
|
223
|
-
))}
|
|
224
|
-
</DropdownMenuRadioGroup>
|
|
225
|
-
</DropdownMenuGroup>
|
|
226
|
-
</DropdownMenuContent>
|
|
227
|
-
</DropdownMenu>
|
|
228
|
-
)
|
|
229
|
-
}
|
|
129
|
+
/* ── PromptInputModelSelect / PromptInputEffortSelect 已删除(P2 任务 3) ──
|
|
130
|
+
* 模型/力度两 pill 由 harness 合并面板 ModelSelector
|
|
131
|
+
* (components/harness/conversation-panel/composer/model-selector/)替代:
|
|
132
|
+
* composer 唯一消费者已改接线,全仓无其他引用(grep 实证)后移除。
|
|
133
|
+
*/
|
|
230
134
|
|
|
231
135
|
export {
|
|
232
136
|
PromptInput,
|
|
233
137
|
PromptInputAddon,
|
|
234
138
|
PromptInputButton,
|
|
235
139
|
PromptInputSubmit,
|
|
236
|
-
PromptInputModelSelect,
|
|
237
|
-
PromptInputEffortSelect,
|
|
238
140
|
}
|
|
@@ -24,8 +24,10 @@
|
|
|
24
24
|
* - uploading 态 → attachment data-state=uploading + 官方标题 shimmer 类;
|
|
25
25
|
* error 态 → 红边(data-state=error)+ 重试钮 + AttachmentDescription 错误文案
|
|
26
26
|
* - 移除钮 → removeAttachment 路径(chip 消失 + previewUrl revoke)
|
|
27
|
-
* - 语音按钮转正挂载:block-end 工具行 DOM 序 =
|
|
28
|
-
*
|
|
27
|
+
* - 语音按钮转正挂载:block-end 工具行 DOM 序 = `+` 命令菜单钮 < 语音钮 < 模型
|
|
28
|
+
* 合并面板触发钮(任务 3 起 ModelSelector 替代 PromptInputModelSelect 旧 pill);
|
|
29
|
+
* 能力探测不可用/探测中 → 按钮不渲染(配置面 fail-closed,按钮自查询)。
|
|
30
|
+
* (`+` 钮 aria-label 已随任务 10 重接命令菜单切到 harness_command_plusMenu)
|
|
29
31
|
* - BuiltinVoiceExtensionRegistrar 转正挂载:activity single 席位注册在位
|
|
30
32
|
*/
|
|
31
33
|
|
|
@@ -233,23 +235,29 @@ describe("composer 附件官方 Attachment 家族(任务 18)", () => {
|
|
|
233
235
|
})
|
|
234
236
|
|
|
235
237
|
describe("composer 语音输入转正挂载(任务 18)", () => {
|
|
236
|
-
it("block-end 工具行 DOM
|
|
238
|
+
it("block-end 工具行 DOM 序:`+` 命令菜单钮 < 语音钮 < 模型合并面板触发钮(任务 3 起 ModelSelector 替代旧模型 pill)", () => {
|
|
237
239
|
setup()
|
|
238
240
|
const addon = getBlockEndAddon()
|
|
239
|
-
const attach = screen.getByLabelText(m.
|
|
241
|
+
const attach = screen.getByLabelText(m.harness_command_plusMenu())
|
|
240
242
|
const voice = screen.getByLabelText(m.harness_composer_voiceStart())
|
|
241
|
-
|
|
243
|
+
// 合并面板触发钮(旧链渲染:无分组目录 → 空占位名 + off 档 aria)
|
|
244
|
+
const modelTrigger = screen.getByLabelText(
|
|
245
|
+
m.harness_model_selectorAria({
|
|
246
|
+
name: m.harness_composer_modelEmpty(),
|
|
247
|
+
effort: m.harness_composer_effort_off(),
|
|
248
|
+
}),
|
|
249
|
+
)
|
|
242
250
|
|
|
243
251
|
// 三个控件都在 block-end 工具行内
|
|
244
252
|
expect(addon.contains(attach)).toBe(true)
|
|
245
253
|
expect(addon.contains(voice)).toBe(true)
|
|
246
|
-
expect(addon.contains(
|
|
247
|
-
// DOM
|
|
254
|
+
expect(addon.contains(modelTrigger)).toBe(true)
|
|
255
|
+
// DOM 序:`+` 钮在语音钮之前,语音钮在模型触发钮之前
|
|
248
256
|
expect(
|
|
249
257
|
attach.compareDocumentPosition(voice) & Node.DOCUMENT_POSITION_FOLLOWING,
|
|
250
258
|
).toBeTruthy()
|
|
251
259
|
expect(
|
|
252
|
-
voice.compareDocumentPosition(
|
|
260
|
+
voice.compareDocumentPosition(modelTrigger) & Node.DOCUMENT_POSITION_FOLLOWING,
|
|
253
261
|
).toBeTruthy()
|
|
254
262
|
})
|
|
255
263
|
|
|
@@ -257,7 +265,7 @@ describe("composer 语音输入转正挂载(任务 18)", () => {
|
|
|
257
265
|
h.capability = { available: false }
|
|
258
266
|
setup()
|
|
259
267
|
expect(screen.queryByLabelText(m.harness_composer_voiceStart())).toBeNull()
|
|
260
|
-
expect(screen.getByLabelText(m.
|
|
268
|
+
expect(screen.getByLabelText(m.harness_command_plusMenu())).not.toBeNull()
|
|
261
269
|
})
|
|
262
270
|
|
|
263
271
|
it("能力探测中 → 语音按钮不渲染(避免闪烁)", () => {
|