@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
package/src/components/harness/conversation-panel/composer/command/__tests__/command-undo.test.tsx
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
|
+
// AllBlue - 理想之海
|
|
3
|
+
// Copyright (C) 2026 AllBlue Contributors
|
|
4
|
+
//
|
|
5
|
+
// This program is free software: you can redistribute it and/or modify
|
|
6
|
+
// it under the terms of the GNU Affero General Public License as published by
|
|
7
|
+
// the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
// (at your option) any later version.
|
|
9
|
+
//
|
|
10
|
+
// This program is distributed in the hope that it will be useful,
|
|
11
|
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
// GNU Affero General Public License for more details.
|
|
14
|
+
//
|
|
15
|
+
// You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* /undo(P1 任务 2):撤销最后一回合——client 命令接 checkpoint revert。
|
|
20
|
+
*
|
|
21
|
+
* client undo 走内置 client 命令通路:workbench-page 解析 revert 目标(最后一条
|
|
22
|
+
* user 消息的前一条真实消息——revert 语义=保留目标、隐藏其后,ai-harness
|
|
23
|
+
* session/state.js 已核实)并注入执行通路(onRevertLastTurn + canRevertLastTurn
|
|
24
|
+
* props),harness-composer 装进 BuiltinCommandContext.undo →
|
|
25
|
+
* createBuiltinClientCommands 条件产出第五条命令。桌面链挂 snapshots 官方 server
|
|
26
|
+
* 命令 `undo`(文件级恢复更完整)时 workbench-page 门控让位(防双 undo 条目),
|
|
27
|
+
* 本文件不涉该去重(真值表见 harness/__tests__/undo-last-turn.test.ts)。
|
|
28
|
+
*
|
|
29
|
+
* 三用例:
|
|
30
|
+
* 1. canRevertLastTurn=true → '/' 菜单出现「撤销上一回合」(指令组),Enter →
|
|
31
|
+
* onRevertLastTurn 被调(props 注入纪律:composer 不读 view store);
|
|
32
|
+
* 2. canRevertLastTurn=false/undefined → 命令不在菜单(组装侧门控过滤,
|
|
33
|
+
* 清空输入照常——控制组);
|
|
34
|
+
* 3. legacy 链(props 不传)→ 命令不出现(ctx.undo 缺省 → 命令集不含 undo)。
|
|
35
|
+
*
|
|
36
|
+
* 渲染 HarnessComposer(真实 TipTap),handoffPrefillText 预填触发串
|
|
37
|
+
* (command-permission.test 同款手法)。mock 组合照 claim-guard.test.tsx:44-71;
|
|
38
|
+
* bundle 守卫:composer 链禁 sandbox/policy index(T8 立规沿用)。i18n 断言走
|
|
39
|
+
* zh locale(setup.ts overwriteGetLocale('zh'))。
|
|
40
|
+
*/
|
|
41
|
+
import { afterEach, beforeEach, expect, it, vi } from "vitest"
|
|
42
|
+
import { cleanup, fireEvent, render, screen, waitFor } from "@testing-library/react"
|
|
43
|
+
import { HarnessComposer, type HarnessComposerProps } from "../../harness-composer"
|
|
44
|
+
|
|
45
|
+
vi.mock("@/server/serverFns/harness/media", () => ({ generatePrototypeFn: vi.fn(() => Promise.resolve({})) }))
|
|
46
|
+
vi.mock("../../mention/use-mention-sources", () => ({
|
|
47
|
+
useMentionSources: () => ({ all: [], isLoading: false }),
|
|
48
|
+
}))
|
|
49
|
+
vi.mock("@/components/billing/use-feature", () => ({ useFeature: () => ({ enabled: true, loading: false }) }))
|
|
50
|
+
// bundle 守卫(T8 立规,本任务沿用):composer 链路不得加载服务端沙箱 policy index
|
|
51
|
+
// ——permission-policy 是唯一合法通道(本文件顶部已整模块 mock 切断其 import 链)。
|
|
52
|
+
vi.mock("@/server/ai-gateway/sandbox/policy", () => { throw new Error("Server sandbox policy must not be loaded by the composer") })
|
|
53
|
+
vi.mock("../../permission/permission-policy", () => ({
|
|
54
|
+
SANDBOX_POLICY_LEVELS: ["readonly", "workspace-write", "full"],
|
|
55
|
+
getSandboxPolicy: vi.fn(() => Promise.resolve("workspace-write")),
|
|
56
|
+
setSandboxPolicy: vi.fn(() => Promise.resolve("workspace-write")),
|
|
57
|
+
}))
|
|
58
|
+
vi.mock("../../voice-input-button", () => ({ VoiceInputButton: () => null }))
|
|
59
|
+
vi.mock("@/components/harness/conversation-panel/messages/approvals/interrupt-approval", () => ({ InterruptApproval: () => null }))
|
|
60
|
+
|
|
61
|
+
beforeEach(() => {
|
|
62
|
+
sessionStorage.clear()
|
|
63
|
+
// harness 客户端门控开(vitest 默认 '0',config 注释钦定用例级 stubEnv 显式开)
|
|
64
|
+
vi.stubEnv("VITE_HARNESS_DEV", "1")
|
|
65
|
+
})
|
|
66
|
+
afterEach(() => {
|
|
67
|
+
cleanup()
|
|
68
|
+
vi.unstubAllEnvs()
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
/** 取 ProseMirror 编辑面(composer-send.test 同款定位) */
|
|
72
|
+
function getEditorDom(): HTMLElement {
|
|
73
|
+
const el = document.querySelector<HTMLElement>(".tiptap.ProseMirror")
|
|
74
|
+
if (!el) throw new Error("TipTap 编辑器 DOM 未挂载")
|
|
75
|
+
return el
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const baseProps = {
|
|
79
|
+
threadId: "t1",
|
|
80
|
+
isRunning: false,
|
|
81
|
+
hasAiKey: true,
|
|
82
|
+
busyPreference: "queue" as const,
|
|
83
|
+
onSend: vi.fn(),
|
|
84
|
+
onStop: vi.fn(),
|
|
85
|
+
conversationRegionRef: { current: null },
|
|
86
|
+
messages: [],
|
|
87
|
+
models: [],
|
|
88
|
+
} satisfies Parameters<typeof HarnessComposer>[0]
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* 消息 fixture(构造数据与门控真值对齐——目标选择在 workbench-page 的
|
|
92
|
+
* resolveUndoLastTurnTarget,真值表见 harness/__tests__/undo-last-turn.test.ts;
|
|
93
|
+
* 本文件锁定 composer 层 prop→菜单 wiring):
|
|
94
|
+
* - UNDOABLE = [assistant1, user, assistant2]:最后 user 有前驱真实消息 → 可撤销
|
|
95
|
+
* (revert 目标 = assistant1,revert 语义=保留目标、隐藏其后 → 删掉最后一轮 QA);
|
|
96
|
+
* - FIRST_TURN = [user, assistant]:末位 user 即 transcript 首条(start=0 无前驱)
|
|
97
|
+
* → 不可撤销 → canRevertLastTurn=false。
|
|
98
|
+
*/
|
|
99
|
+
const UNDOABLE_MESSAGES = [
|
|
100
|
+
{ id: "assistant1", role: "assistant", parts: [] },
|
|
101
|
+
{ id: "u2", role: "user", parts: [] },
|
|
102
|
+
{ id: "assistant2", role: "assistant", parts: [] },
|
|
103
|
+
] satisfies HarnessComposerProps["messages"]
|
|
104
|
+
const FIRST_TURN_MESSAGES = [
|
|
105
|
+
{ id: "u1", role: "user", parts: [] },
|
|
106
|
+
{ id: "a1", role: "assistant", parts: [] },
|
|
107
|
+
] satisfies HarnessComposerProps["messages"]
|
|
108
|
+
|
|
109
|
+
it("canRevertLastTurn=true:'/' 菜单出现「撤销上一回合」(指令组),Enter 执行 onRevertLastTurn", async () => {
|
|
110
|
+
const onRevertLastTurn = vi.fn()
|
|
111
|
+
render(
|
|
112
|
+
<HarnessComposer
|
|
113
|
+
{...baseProps}
|
|
114
|
+
messages={UNDOABLE_MESSAGES}
|
|
115
|
+
onRevertLastTurn={onRevertLastTurn}
|
|
116
|
+
canRevertLastTurn
|
|
117
|
+
handoffPrefillText="/undo"
|
|
118
|
+
/>,
|
|
119
|
+
)
|
|
120
|
+
// 菜单开(prefill 触发)+ undo 命令在列(query "undo" 精确命中,唯一条目)
|
|
121
|
+
const menu = await screen.findByRole("listbox", {}, { timeout: 3000 })
|
|
122
|
+
await waitFor(() => expect(menu.textContent).toContain("撤销上一回合"))
|
|
123
|
+
// client 组(组头「指令」,任务 1 起与 server 组「服务端命令」分流)
|
|
124
|
+
expect(menu.textContent).toContain("指令")
|
|
125
|
+
// Enter 选中高亮项 → 执行通路被调(不重发 payload,revert 目标解析在 workbench-page 接)
|
|
126
|
+
fireEvent.keyDown(getEditorDom(), { key: "Enter" })
|
|
127
|
+
await waitFor(() => expect(onRevertLastTurn).toHaveBeenCalledTimes(1))
|
|
128
|
+
})
|
|
129
|
+
|
|
130
|
+
it("canRevertLastTurn=false/undefined:命令不在菜单(清空输入照常——控制组)", async () => {
|
|
131
|
+
const onRevertLastTurn = vi.fn()
|
|
132
|
+
// false:执行通路在(onRevertLastTurn 传入)但门控关 → 组装侧过滤。
|
|
133
|
+
// fixture 用 FIRST_TURN(末位 user 即首条、无前驱目标)——workbench-page 对该
|
|
134
|
+
// 形状解析出的 canRevertLastTurn 即 false,构造数据与门控真值一致。
|
|
135
|
+
const view = render(
|
|
136
|
+
<HarnessComposer
|
|
137
|
+
{...baseProps}
|
|
138
|
+
messages={FIRST_TURN_MESSAGES}
|
|
139
|
+
onRevertLastTurn={onRevertLastTurn}
|
|
140
|
+
canRevertLastTurn={false}
|
|
141
|
+
handoffPrefillText="/"
|
|
142
|
+
/>,
|
|
143
|
+
)
|
|
144
|
+
const menu = await screen.findByRole("listbox", {}, { timeout: 3000 })
|
|
145
|
+
await waitFor(() => expect(menu.textContent).toContain("清空输入"))
|
|
146
|
+
expect(menu.textContent).not.toContain("撤销上一回合")
|
|
147
|
+
view.unmount()
|
|
148
|
+
|
|
149
|
+
// undefined:canRevertLastTurn 缺省(门控 fail-closed 同口径)→ 同样不在菜单
|
|
150
|
+
render(
|
|
151
|
+
<HarnessComposer
|
|
152
|
+
{...baseProps}
|
|
153
|
+
messages={FIRST_TURN_MESSAGES}
|
|
154
|
+
onRevertLastTurn={onRevertLastTurn}
|
|
155
|
+
handoffPrefillText="/"
|
|
156
|
+
/>,
|
|
157
|
+
)
|
|
158
|
+
const menu2 = await screen.findByRole("listbox", {}, { timeout: 3000 })
|
|
159
|
+
await waitFor(() => expect(menu2.textContent).toContain("清空输入"))
|
|
160
|
+
expect(menu2.textContent).not.toContain("撤销上一回合")
|
|
161
|
+
})
|
|
162
|
+
|
|
163
|
+
it("legacy 链(props 不传):命令不出现(ctx.undo 缺省 → 命令集不含 undo)", async () => {
|
|
164
|
+
render(<HarnessComposer {...baseProps} messages={FIRST_TURN_MESSAGES} handoffPrefillText="/" />)
|
|
165
|
+
const menu = await screen.findByRole("listbox", {}, { timeout: 3000 })
|
|
166
|
+
await waitFor(() => expect(menu.textContent).toContain("清空输入"))
|
|
167
|
+
expect(menu.textContent).not.toContain("撤销上一回合")
|
|
168
|
+
})
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
|
+
// AllBlue - 理想之海
|
|
3
|
+
// Copyright (C) 2026 AllBlue Contributors
|
|
4
|
+
//
|
|
5
|
+
// This program is free software: you can redistribute it and/or modify
|
|
6
|
+
// it under the terms of the GNU Affero General Public License as published by
|
|
7
|
+
// the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
// (at your option) any later version.
|
|
9
|
+
//
|
|
10
|
+
// This program is distributed in the hope that it will be useful,
|
|
11
|
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
// GNU Affero General Public License for more details.
|
|
14
|
+
//
|
|
15
|
+
// You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* `+` 菜单收敛(2026-11-20 harness-composer-controls 任务 7):excludeComposerSeatCommands
|
|
20
|
+
* 纯函数断言——「模型」「权限」两项从 `+` 菜单剔除(控制行有专钮、`/model`
|
|
21
|
+
* `/permission` 斜杠命令仍可达,三入口冗余);`filterGatedClientCommands` 本体不动
|
|
22
|
+
* (`/` 菜单门控照旧,零回归断言见下方「/ 菜单链路」用例 + command-suggestion-menu.test
|
|
23
|
+
* 的集成断言)。纯 TS,无 React 渲染('/' 菜单 UI 挂真实 composer 的交互面见
|
|
24
|
+
* command/command-suggestion-menu.test.tsx)。
|
|
25
|
+
*/
|
|
26
|
+
import { describe, expect, it, vi } from "vitest"
|
|
27
|
+
import { m } from "@/paraglide/messages.js"
|
|
28
|
+
|
|
29
|
+
import {
|
|
30
|
+
BUILTIN_CLIENT_COMMAND_CLEAR_INPUT,
|
|
31
|
+
BUILTIN_CLIENT_COMMAND_FILE,
|
|
32
|
+
BUILTIN_CLIENT_COMMAND_MODEL,
|
|
33
|
+
BUILTIN_CLIENT_COMMAND_PERMISSION,
|
|
34
|
+
BUILTIN_CLIENT_COMMAND_PLAN,
|
|
35
|
+
BUILTIN_CLIENT_COMMAND_UNDO,
|
|
36
|
+
createBuiltinClientCommands,
|
|
37
|
+
excludeComposerSeatCommands,
|
|
38
|
+
filterGatedClientCommands,
|
|
39
|
+
} from "../../extension/command-menu"
|
|
40
|
+
|
|
41
|
+
/** 门控旗标全 true(附件开 + 模型目录非空 + 权限放行 + 撤销/计划可用) */
|
|
42
|
+
const ALL_ON = {
|
|
43
|
+
attachmentsEnabled: true,
|
|
44
|
+
hasModels: true,
|
|
45
|
+
permissionEnabled: true,
|
|
46
|
+
undoEnabled: true,
|
|
47
|
+
planEnabled: true,
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** 基础命令集(ctx 无 undo/plan 通路):文件 / 模型 / 权限 / 清空输入 */
|
|
51
|
+
function baseCommands() {
|
|
52
|
+
return createBuiltinClientCommands({ openFilePicker: vi.fn() })
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
describe("excludeComposerSeatCommands(+ 菜单收敛)", () => {
|
|
56
|
+
it("+ 菜单仅含 文件/清空输入(model/permission 被排除,即便门控旗标全 true)", () => {
|
|
57
|
+
const gated = filterGatedClientCommands(baseCommands(), ALL_ON)
|
|
58
|
+
// 前置:门控旗标全 true 时模型/权限确在门控产物内(否则排除断言平凡成立)
|
|
59
|
+
expect(gated.map((cmd) => cmd.name)).toEqual([
|
|
60
|
+
BUILTIN_CLIENT_COMMAND_FILE,
|
|
61
|
+
BUILTIN_CLIENT_COMMAND_MODEL,
|
|
62
|
+
BUILTIN_CLIENT_COMMAND_PERMISSION,
|
|
63
|
+
BUILTIN_CLIENT_COMMAND_CLEAR_INPUT,
|
|
64
|
+
])
|
|
65
|
+
const plusMenu = excludeComposerSeatCommands(gated)
|
|
66
|
+
expect(plusMenu.map((cmd) => cmd.name)).toEqual([
|
|
67
|
+
BUILTIN_CLIENT_COMMAND_FILE,
|
|
68
|
+
BUILTIN_CLIENT_COMMAND_CLEAR_INPUT,
|
|
69
|
+
])
|
|
70
|
+
// 收敛后仅剩的两项即「文件」「清空输入」(label 与 paraglide 消息同值,locale 无关)
|
|
71
|
+
expect(plusMenu[0].label).toBe(m.harness_command_file())
|
|
72
|
+
expect(plusMenu[1].label).toBe(m.harness_command_clearInput())
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
it("/ 菜单链路零回归:同一命令源不过排除函数,模型/权限仍在(门控照旧)", () => {
|
|
76
|
+
// '/' 菜单消费的是 filterGatedClientCommands 原产物(command-suggestion-menu
|
|
77
|
+
// getItems 直调,不经 excludeComposerSeatCommands)——本断言钉住该链路的形状
|
|
78
|
+
const slashMenu = filterGatedClientCommands(baseCommands(), ALL_ON)
|
|
79
|
+
expect(slashMenu.map((cmd) => cmd.name)).toContain(BUILTIN_CLIENT_COMMAND_MODEL)
|
|
80
|
+
expect(slashMenu.map((cmd) => cmd.name)).toContain(BUILTIN_CLIENT_COMMAND_PERMISSION)
|
|
81
|
+
expect(slashMenu.map((cmd) => cmd.name)).toContain(BUILTIN_CLIENT_COMMAND_FILE)
|
|
82
|
+
expect(slashMenu.map((cmd) => cmd.name)).toContain(BUILTIN_CLIENT_COMMAND_CLEAR_INPUT)
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
it("undo/plan 非 composer 席位命令——排除函数不误伤(控制行无此二项专钮)", () => {
|
|
86
|
+
const cmds = createBuiltinClientCommands({
|
|
87
|
+
openFilePicker: vi.fn(),
|
|
88
|
+
undo: { run: vi.fn() },
|
|
89
|
+
plan: { run: vi.fn() },
|
|
90
|
+
})
|
|
91
|
+
const plusMenu = excludeComposerSeatCommands(filterGatedClientCommands(cmds, ALL_ON))
|
|
92
|
+
expect(plusMenu.map((cmd) => cmd.name)).toEqual([
|
|
93
|
+
BUILTIN_CLIENT_COMMAND_FILE,
|
|
94
|
+
BUILTIN_CLIENT_COMMAND_CLEAR_INPUT,
|
|
95
|
+
BUILTIN_CLIENT_COMMAND_UNDO,
|
|
96
|
+
BUILTIN_CLIENT_COMMAND_PLAN,
|
|
97
|
+
])
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
it("空集与幂等:排除函数对已收敛集合再跑一次形状不变", () => {
|
|
101
|
+
const once = excludeComposerSeatCommands(filterGatedClientCommands(baseCommands(), ALL_ON))
|
|
102
|
+
const twice = excludeComposerSeatCommands(once)
|
|
103
|
+
expect(twice.map((cmd) => cmd.name)).toEqual(once.map((cmd) => cmd.name))
|
|
104
|
+
expect(excludeComposerSeatCommands([])).toEqual([])
|
|
105
|
+
})
|
|
106
|
+
})
|
package/src/components/harness/conversation-panel/composer/command/__tests__/menu-view.test.tsx
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
*/
|
|
23
23
|
import { describe, expect, it, vi } from "vitest"
|
|
24
24
|
import { render, screen } from "@testing-library/react"
|
|
25
|
-
import { MenuView, MENU_VIEW_MAX_HEIGHT } from "../menu-view"
|
|
25
|
+
import { MenuView, MENU_VIEW_MAX_HEIGHT, MENU_VIEW_HEADER_HEIGHT } from "../menu-view"
|
|
26
26
|
|
|
27
27
|
interface Row {
|
|
28
28
|
id: string
|
|
@@ -82,7 +82,10 @@ describe("MenuView(E4 统一渲染骨架)", () => {
|
|
|
82
82
|
/>,
|
|
83
83
|
)
|
|
84
84
|
const listbox = screen.getByRole("listbox")
|
|
85
|
-
|
|
85
|
+
// 视口防线:min(400px, --suggestion-menu-max-height)(无该 var 回落 400px)
|
|
86
|
+
expect(listbox.style.maxHeight).toBe(
|
|
87
|
+
`min(${MENU_VIEW_MAX_HEIGHT}px, var(--suggestion-menu-max-height, ${MENU_VIEW_MAX_HEIGHT}px))`,
|
|
88
|
+
)
|
|
86
89
|
expect(MENU_VIEW_MAX_HEIGHT).toBe(400)
|
|
87
90
|
})
|
|
88
91
|
|
|
@@ -133,4 +136,54 @@ describe("MenuView(E4 统一渲染骨架)", () => {
|
|
|
133
136
|
screen.getByText("清空输入").closest("div")?.click()
|
|
134
137
|
expect(onSelect).toHaveBeenCalledWith(expect.objectContaining({ id: "b1" }))
|
|
135
138
|
})
|
|
139
|
+
|
|
140
|
+
it("renderMedia 图标槽(每条一个)+ footer 非交互提示行(pointer-events-none)", () => {
|
|
141
|
+
render(
|
|
142
|
+
<MenuView
|
|
143
|
+
entries={entries}
|
|
144
|
+
selectedIndex={0}
|
|
145
|
+
onSelect={() => {}}
|
|
146
|
+
selector="menu"
|
|
147
|
+
renderTitle={(r) => r.label}
|
|
148
|
+
renderMedia={() => <span data-testid="media-icon" />}
|
|
149
|
+
footer="↑↓ 选择 · Enter 确认"
|
|
150
|
+
/>,
|
|
151
|
+
)
|
|
152
|
+
// 图标槽:每条条目一个(含 ItemMedia 包裹)
|
|
153
|
+
expect(screen.getAllByTestId("media-icon")).toHaveLength(3)
|
|
154
|
+
expect(screen.getAllByText("设定目标")[0].closest("[data-slot=item]")).toBeTruthy()
|
|
155
|
+
// footer 渲染在条目后且非交互(pointer-events-none)
|
|
156
|
+
const footerEl = document.querySelector("[data-menu-view-footer]") as HTMLElement
|
|
157
|
+
expect(footerEl.className).toContain("pointer-events-none")
|
|
158
|
+
expect(footerEl.textContent).toContain("↑↓ 选择 · Enter 确认")
|
|
159
|
+
})
|
|
160
|
+
|
|
161
|
+
it("headerCompact 条件化 84px 头部预留位(缺省套 84px / 紧凑不套)", () => {
|
|
162
|
+
const { container, unmount } = render(
|
|
163
|
+
<MenuView
|
|
164
|
+
entries={entries}
|
|
165
|
+
selectedIndex={0}
|
|
166
|
+
onSelect={() => {}}
|
|
167
|
+
selector="menu"
|
|
168
|
+
header="提示"
|
|
169
|
+
renderTitle={(r) => r.label}
|
|
170
|
+
/>,
|
|
171
|
+
)
|
|
172
|
+
const headerEl = container.querySelector("[data-menu-view-header]") as HTMLElement
|
|
173
|
+
expect(headerEl.style.minHeight).toBe(`${MENU_VIEW_HEADER_HEIGHT}px`)
|
|
174
|
+
unmount()
|
|
175
|
+
const compact = render(
|
|
176
|
+
<MenuView
|
|
177
|
+
entries={entries}
|
|
178
|
+
selectedIndex={0}
|
|
179
|
+
onSelect={() => {}}
|
|
180
|
+
selector="menu"
|
|
181
|
+
header="提示"
|
|
182
|
+
headerCompact
|
|
183
|
+
renderTitle={(r) => r.label}
|
|
184
|
+
/>,
|
|
185
|
+
)
|
|
186
|
+
const compactEl = compact.container.querySelector("[data-menu-view-header]") as HTMLElement
|
|
187
|
+
expect(compactEl.style.minHeight).toBe("")
|
|
188
|
+
})
|
|
136
189
|
})
|