@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/command-suggestion-menu.tsx
CHANGED
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
*
|
|
24
24
|
* 候选 = unifyCommandItems 三类源合并(extension/command-menu.ts):
|
|
25
25
|
* server(props.commands + props.onRunCommand)∪ trigger(registry '/' 源)∪
|
|
26
|
-
* client(内置「清空输入」)。
|
|
26
|
+
* client(内置「清空输入」)。trigger 现注册两源:builtin/skills(P1 任务 3,
|
|
27
|
+
* 技能目录纯文本插入,本组件 mount 注册)+ 测试/demo 注册源。
|
|
27
28
|
*
|
|
28
29
|
* **选中执行分两路**(F5-6 批 18 claim 事务):
|
|
29
30
|
* - input 型命令(item.input===true)→ **claim**:触发词替换为命令 chip
|
|
@@ -40,25 +41,40 @@
|
|
|
40
41
|
*/
|
|
41
42
|
|
|
42
43
|
import { useEffect, useRef } from "react"
|
|
44
|
+
import {
|
|
45
|
+
Eraser,
|
|
46
|
+
FoldVertical,
|
|
47
|
+
NotebookPen,
|
|
48
|
+
Paperclip,
|
|
49
|
+
Shield,
|
|
50
|
+
Sparkles,
|
|
51
|
+
Undo2,
|
|
52
|
+
Wand2,
|
|
53
|
+
type LucideIcon,
|
|
54
|
+
} from "lucide-react"
|
|
43
55
|
import type { Editor, Range } from "@tiptap/react"
|
|
44
|
-
import { cn } from "@/components/tiptap/lib/utils"
|
|
45
|
-
import { getElementOverflowPosition } from "@/components/tiptap/lib/collab-utils"
|
|
46
56
|
import { SuggestionMenu } from "@/components/tiptap/ui/suggestion-menu/index"
|
|
47
57
|
import { createFullWidthFindSuggestionMatch } from "@/components/tiptap/ui/suggestion-menu/suggestion-menu-fullwidth"
|
|
48
58
|
import type {
|
|
49
59
|
SuggestionItem,
|
|
60
|
+
SuggestionMenuAttachMode,
|
|
50
61
|
SuggestionMenuRenderProps,
|
|
51
62
|
} from "@/components/tiptap/ui/suggestion-menu/index"
|
|
52
|
-
import { Item, ItemContent, ItemTitle } from "@/components/ui/item"
|
|
53
63
|
import { MenuView } from "./menu-view"
|
|
54
|
-
|
|
64
|
+
// skills 数据面在源内经 getQueryClient seam 自拉(fetchSkillsViaQueryClient 缺省
|
|
65
|
+
// getter——整页直渲测试无 QueryClientProvider 也安全),不再上 props 面
|
|
66
|
+
import { createBuiltinSkillSource, SKILLS_TRIGGER_GROUP } from "./skill-source"
|
|
67
|
+
import { createBuiltinClientCommands, filterGatedClientCommands, getComposerInputTriggers, registerComposerExtension, resolveCommandTriggerCandidates, safeRunCommand, unifyCommandItems } from "../extension"
|
|
55
68
|
import type {
|
|
69
|
+
ComposerClientCommand,
|
|
56
70
|
ComposerCommandItem,
|
|
57
71
|
ComposerDraftApi,
|
|
58
72
|
ComposerServerCommand,
|
|
73
|
+
InputTriggerSource,
|
|
59
74
|
TriggerCandidate,
|
|
60
75
|
} from "../extension"
|
|
61
76
|
import { replaceCommandRange } from "./command-claim-editor"
|
|
77
|
+
import { findClaimChip } from "./claim"
|
|
62
78
|
import { m } from "@/paraglide/messages.js"
|
|
63
79
|
|
|
64
80
|
/**
|
|
@@ -82,37 +98,120 @@ export interface CommandSuggestionMenuProps {
|
|
|
82
98
|
draft?: ComposerDraftApi
|
|
83
99
|
/** 菜单开合回调(composer menuOpen 状态,Esc Esc 序列屏蔽关菜单的 Esc) */
|
|
84
100
|
onOpenChange?: (open: boolean) => void
|
|
101
|
+
/** 打开系统文件选择器(/file 命令执行体;harness-composer 的隐藏 input[type=file]) */
|
|
102
|
+
openFilePicker?: () => void
|
|
103
|
+
/** 附件能力开关(= !localEngine;false 时 /file 门控关闭、不进菜单) */
|
|
104
|
+
attachmentsEnabled?: boolean
|
|
105
|
+
/** 模型目录(/model popup 门控 + 数据源;空 = /model 不进菜单) */
|
|
106
|
+
models?: ReadonlyArray<string>
|
|
107
|
+
/** /permission 门控(任务 9):harness 客户端启用 + threadId 非空 + 沙箱 entitlement
|
|
108
|
+
* 放行(harness-composer 计算)——false 时 /permission 不进菜单(fail-closed 缺省) */
|
|
109
|
+
permissionEnabled?: boolean
|
|
110
|
+
/**
|
|
111
|
+
* /undo 门控(P1 任务 2):canRevertLastTurn(harness-composer 透传 workbench-page
|
|
112
|
+
* 判定:harness 链 revert slot 在 + 有 assistant 消息 + !isRunning)——非 true 一律
|
|
113
|
+
* 不进菜单(fail-closed 缺省,非 harness 消费方零变化)。命令本体存在性由
|
|
114
|
+
* createBuiltinClientCommands 的 ctx.undo 注入决定(legacy 链无通路不产出)。
|
|
115
|
+
*/
|
|
116
|
+
canRevertLastTurn?: boolean
|
|
117
|
+
/**
|
|
118
|
+
* /plan 门控(P2 任务 2):canPlan(harness-composer 透传 workbench-page 判定:
|
|
119
|
+
* harness 链 + threadId 非空 + !isRunning)——非 true 一律不进菜单(fail-closed 缺省,
|
|
120
|
+
* 非 harness 消费方零变化)。命令本体存在性由 createBuiltinClientCommands 的 ctx.plan
|
|
121
|
+
* 注入决定(legacy 链无通路不产出)。
|
|
122
|
+
*/
|
|
123
|
+
canPlan?: boolean
|
|
124
|
+
/** popup 型命令上报(/model、/permission 选中 → 上层弹 popup;带 restoreToken 供取消恢复触发词) */
|
|
125
|
+
onOpenPopup?: (popup: "model" | "permission", restoreToken: string | null) => void
|
|
126
|
+
/**
|
|
127
|
+
* 内置客户端命令(任务 10 提升共享):harness-composer `useMemo` 构造一份
|
|
128
|
+
* `createBuiltinClientCommands(ctx)` 实例传入——`/` 菜单与 `+` 菜单消费**同一份**,
|
|
129
|
+
* label(paraglide)求值时点不再两处构造分叉。缺省回落本地构造(ComposerEditor
|
|
130
|
+
* 非工作台消费方零变化;现状 harness 链恒传入,无回落路径)。
|
|
131
|
+
*/
|
|
132
|
+
clientCommands?: ComposerClientCommand[]
|
|
133
|
+
/**
|
|
134
|
+
* frozen 守卫(任务 11):true = 菜单全禁(SuggestionMenu 合成 allow=false +
|
|
135
|
+
* 立即关闭)。由 ComposerEditor 透传 harness-composer 的
|
|
136
|
+
* `frozen = sending === true || takeover !== null`。缺省 undefined = 恒不禁用,
|
|
137
|
+
* 非工作台消费方零变化。
|
|
138
|
+
*/
|
|
139
|
+
disabled?: boolean
|
|
140
|
+
/**
|
|
141
|
+
* pending 上报(审查 finding 1):插件取数窗口镜像到 composer pendingRef
|
|
142
|
+
* (提交 keymap isPending 判定源)。@ 菜单同接(handlePendingChange 共享)。
|
|
143
|
+
*/
|
|
144
|
+
onPendingChange?: (pending: boolean) => void
|
|
145
|
+
/**
|
|
146
|
+
* pending 期选中短路(SuggestionMenu noOpSelectWhilePending,旧 T2 用例 2 no-op
|
|
147
|
+
* 语义);composer 消费方恒启用。
|
|
148
|
+
*/
|
|
149
|
+
noOpSelectWhilePending?: boolean
|
|
150
|
+
/**
|
|
151
|
+
* 菜单锚定模式(DSH 对标,任务 A):composer 传 "card-top" —— 菜单钉输入框卡片
|
|
152
|
+
* (InputGroup)上沿弹出、与卡片同宽、不随光标移动。缺省 "caret" = 既有定位。
|
|
153
|
+
*/
|
|
154
|
+
attachMode?: SuggestionMenuAttachMode
|
|
155
|
+
/**
|
|
156
|
+
* card-top 锚元素(输入框卡片根,ComposerEditor 从 editor.view.dom.closest 计算);
|
|
157
|
+
* null/undefined 回落 caret 定位。
|
|
158
|
+
*/
|
|
159
|
+
anchorElement?: HTMLElement | null
|
|
85
160
|
}
|
|
86
161
|
|
|
87
162
|
/**
|
|
88
163
|
* 分组头稳定 id → 本地化标签(v1 最小映射;trigger 组名(source.name /
|
|
89
|
-
* candidate.group
|
|
164
|
+
* candidate.group)为数据提供方语义,原样展示)。导出供 `+` 菜单(harness-composer,
|
|
165
|
+
* 任务 10)复用——两菜单同一分组文案,零漂移。
|
|
166
|
+
*
|
|
167
|
+
* 组 id 语义(任务 1,P1 起):'commands' = server 命令组(组头「服务端命令」/
|
|
168
|
+
* en "Server commands"——首条真实命令 /compact 进 server 源,与 client 组的
|
|
169
|
+
* zh 同名「指令」不再合并);'client' = composer 本地命令组(组头「指令」)。
|
|
170
|
+
* 旧 key harness_command_groupCommands 仅余 CommandList 组名缺省兜底消费。
|
|
90
171
|
*/
|
|
91
|
-
function localizeGroup(group: string): string {
|
|
92
|
-
if (group === "
|
|
172
|
+
export function localizeGroup(group: string): string {
|
|
173
|
+
if (group === "add") return m.harness_command_groupAdd()
|
|
174
|
+
if (group === "commands") return m.harness_command_groupServer()
|
|
93
175
|
if (group === "client") return m.harness_command_groupClient()
|
|
176
|
+
// skills 组(P1 任务 3):trigger 源 candidate.group 稳定 id(skill-source.ts 的
|
|
177
|
+
// SKILLS_TRIGGER_GROUP,单一来源)→ 本地化组头「技能」。'/' 菜单渲染侧统一
|
|
178
|
+
// localizeGroup,与 add/commands/client 同机制。
|
|
179
|
+
if (group === SKILLS_TRIGGER_GROUP) return m.harness_command_skillsGroup()
|
|
94
180
|
return group
|
|
95
181
|
}
|
|
96
182
|
|
|
97
183
|
/**
|
|
98
|
-
*
|
|
99
|
-
*
|
|
184
|
+
* 命令图标 + 描述单一来源(用户裁决 2026-11-20:菜单行带图标与描述,对齐 DSH)。
|
|
185
|
+
* 按**命令 name**(稳定 id,BUILTIN_CLIENT_COMMAND_* / KNOWN_SERVER_COMMAND_LABELS
|
|
186
|
+
* 同一口径)键控——渲染面元数据不放命令组装层(extension/command-menu 为非 UI 层,
|
|
187
|
+
* icon 是 React 节点);未知命令回落无图标无描述(零噪音)。
|
|
188
|
+
*/
|
|
189
|
+
const COMMAND_META: Record<string, { icon: LucideIcon; desc: () => string }> = {
|
|
190
|
+
file: { icon: Paperclip, desc: () => m.harness_command_fileDesc() },
|
|
191
|
+
model: { icon: Sparkles, desc: () => m.harness_command_modelDesc() },
|
|
192
|
+
permission: { icon: Shield, desc: () => m.harness_command_permissionDesc() },
|
|
193
|
+
"clear-input": { icon: Eraser, desc: () => m.harness_command_clearInputDesc() },
|
|
194
|
+
undo: { icon: Undo2, desc: () => m.harness_command_undoDesc() },
|
|
195
|
+
plan: { icon: NotebookPen, desc: () => m.harness_command_planDesc() },
|
|
196
|
+
// server 源(现唯一真实命令 /compact):desc 替代此前的裸英文命令名副文本
|
|
197
|
+
compact: { icon: FoldVertical, desc: () => m.harness_command_compactDesc() },
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/** 技能源(trigger 候选)图标:与 kb/book 等 mention 图标同为 4px 尺寸。 */
|
|
201
|
+
const SKILL_TRIGGER_ICON = Wand2
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* 统一命令项执行(选中路径)——薄包装调 safeRunCommand(extension/command-menu,
|
|
205
|
+
* 2026-11-20 任务 B 遗留清理 2):同步异常与 Promise 拒绝兜底 console.error 单点化
|
|
206
|
+
* (不上 toast——server 命令的错误面在 workbench-page 接线层,避免双报),'/' 菜单
|
|
207
|
+
* 与 `+` 菜单(harness-composer handlePlusCommandSelect)共用同一兜底与文案。
|
|
100
208
|
* **F5-4 范围**:直接执行,无 claim 事务(F5-6 批 18)。
|
|
101
209
|
*/
|
|
102
210
|
function executeCommandItem(
|
|
103
211
|
item: ComposerCommandItem,
|
|
104
212
|
ctx: { draft: ComposerDraftApi; editor: Editor; range: Range },
|
|
105
213
|
): void {
|
|
106
|
-
|
|
107
|
-
const result = item.run(ctx)
|
|
108
|
-
if (result instanceof Promise) {
|
|
109
|
-
result.catch((error: unknown) => {
|
|
110
|
-
console.error(`[composer-command] 命令执行失败: ${item.name}`, error)
|
|
111
|
-
})
|
|
112
|
-
}
|
|
113
|
-
} catch (error) {
|
|
114
|
-
console.error(`[composer-command] 命令执行失败: ${item.name}`, error)
|
|
115
|
-
}
|
|
214
|
+
safeRunCommand(item.name, item.run, ctx)
|
|
116
215
|
}
|
|
117
216
|
|
|
118
217
|
export function CommandSuggestionMenu({
|
|
@@ -121,10 +220,80 @@ export function CommandSuggestionMenu({
|
|
|
121
220
|
onRunCommand,
|
|
122
221
|
draft,
|
|
123
222
|
onOpenChange,
|
|
223
|
+
openFilePicker,
|
|
224
|
+
attachmentsEnabled = true,
|
|
225
|
+
models,
|
|
226
|
+
permissionEnabled = false,
|
|
227
|
+
canRevertLastTurn,
|
|
228
|
+
canPlan,
|
|
229
|
+
onOpenPopup,
|
|
230
|
+
clientCommands,
|
|
231
|
+
disabled,
|
|
232
|
+
onPendingChange,
|
|
233
|
+
noOpSelectWhilePending,
|
|
234
|
+
attachMode,
|
|
235
|
+
anchorElement,
|
|
124
236
|
}: CommandSuggestionMenuProps) {
|
|
125
|
-
//
|
|
126
|
-
//
|
|
127
|
-
|
|
237
|
+
// 内置客户端命令(任务 10 起由 harness-composer useMemo 构造共享实例传入——`+` 菜单
|
|
238
|
+
// 与 '/' 菜单同一份,i18n label 求值时点一致);缺省回落本地构造(挂载期求值,
|
|
239
|
+
// paraglide locale 热切后的下次挂载刷新——与 @ 菜单分组文案同口径)。file / model /
|
|
240
|
+
// permission 三命令的门控都不在 createBuiltinClientCommands(恒返回全集)——组装侧
|
|
241
|
+
// getItems 经 filterGatedClientCommands 按响应式 attachmentsEnabled / models /
|
|
242
|
+
// permissionEnabled prop 逐次过滤(本地引擎切换、模型目录变化或 entitlement 变化时
|
|
243
|
+
// 无需重建命令集),`+` 菜单(harness-composer)消费同一过滤函数零漂移。
|
|
244
|
+
const localClientCommandsRef = useRef(
|
|
245
|
+
createBuiltinClientCommands({ openFilePicker: openFilePicker ?? (() => {}) }),
|
|
246
|
+
)
|
|
247
|
+
const resolvedClientCommands = clientCommands ?? localClientCommandsRef.current
|
|
248
|
+
|
|
249
|
+
// **后到 props live-ref 通道(/compact 菜单渲染缺口修复,P2 任务 0)**:
|
|
250
|
+
// SuggestionMenu 的插件注册 effect(suggestion-menu.tsx:220-445,deps 仅
|
|
251
|
+
// [editor, pluginKey, closePopup, disabled, setPending],**不含 items/commands**)在
|
|
252
|
+
// :425 经 `...internalSuggestionPropsRef.current` 把**当时的 `items: getItems` 函数引用**
|
|
253
|
+
// 一次性固化进插件配置——此后插件每次按键调用的都是注册时那份 getItems,组件重渲染
|
|
254
|
+
// 重建的新 getItems 闭包**不会**替换它。getItems 闭包读 `commands`/`onRunCommand`/
|
|
255
|
+
// `resolvedClientCommands` props,而 server commands 来自 view store、**挂载后异步后到**
|
|
256
|
+
// (session open 才投影)→ 注册期捕获的是「空 commands 闭包」,后到 commands 永不进菜单。
|
|
257
|
+
// 治本(照同目录 @ 菜单 mention-suggestion-menu 的 `allRef`/`rawThreadIdRef` live getter
|
|
258
|
+
// 先例):可变量一律经 ref 读取,getItems 闭包只固化 ref 对象本身——后到 commands 重渲染
|
|
259
|
+
// 时下方同步赋值刷新 ref.current,下次按键 getItems 经 ref 取到最新值,无需重注册插件。
|
|
260
|
+
// 同步赋值(非 effect)保证「渲染 → 按键派发」之间 ref 必可见。
|
|
261
|
+
const commandsRef = useRef(commands)
|
|
262
|
+
commandsRef.current = commands
|
|
263
|
+
const onRunCommandRef = useRef(onRunCommand)
|
|
264
|
+
onRunCommandRef.current = onRunCommand
|
|
265
|
+
const resolvedClientCommandsRef = useRef(resolvedClientCommands)
|
|
266
|
+
resolvedClientCommandsRef.current = resolvedClientCommands
|
|
267
|
+
// **门控布尔 / models 同通道扩展(/model /plan 菜单项缺失修复)**:与上述三个 ref 同理
|
|
268
|
+
// ——getItems 闭包读的 `models`/`attachmentsEnabled`/`permissionEnabled`/`canRevertLastTurn`/
|
|
269
|
+
// `canPlan` 也是后到 props(模型目录 query、session 连接后才就绪),注册期固化的旧闭包
|
|
270
|
+
// 拿到的是挂载初值(models=[] / canPlan=undefined),后到值永不生效 → /model /plan 恒隐藏。
|
|
271
|
+
// 一律并入 live-ref 通道,getItems 只读 ref。
|
|
272
|
+
const modelsRef = useRef(models)
|
|
273
|
+
modelsRef.current = models
|
|
274
|
+
const attachmentsEnabledRef = useRef(attachmentsEnabled)
|
|
275
|
+
attachmentsEnabledRef.current = attachmentsEnabled
|
|
276
|
+
const permissionEnabledRef = useRef(permissionEnabled)
|
|
277
|
+
permissionEnabledRef.current = permissionEnabled
|
|
278
|
+
const canRevertLastTurnRef = useRef(canRevertLastTurn)
|
|
279
|
+
canRevertLastTurnRef.current = canRevertLastTurn
|
|
280
|
+
const canPlanRef = useRef(canPlan)
|
|
281
|
+
canPlanRef.current = canPlan
|
|
282
|
+
|
|
283
|
+
// 技能源(P1 任务 3,内置源 mount 注册——'@' 内置源 MentionSuggestionMenu 同范式):
|
|
284
|
+
// 数据面在源内经 getQueryClient seam 自拉(工厂缺省 getter,本组件零数据 props——
|
|
285
|
+
// 曾用 workbench-page useQuery → props 注入,整页直渲测试无 QueryClientProvider 即爆,
|
|
286
|
+
// 回归修复改 seam,见 task-3-report)。源对象稳定无 props 依赖;unmount dispose
|
|
287
|
+
// (ComposerEditor key=aiReady 重挂 → 先卸后注,同 id 防呆不冲突)。
|
|
288
|
+
const skillSourceRef = useRef<InputTriggerSource | null>(null)
|
|
289
|
+
if (!skillSourceRef.current) {
|
|
290
|
+
skillSourceRef.current = createBuiltinSkillSource()
|
|
291
|
+
}
|
|
292
|
+
useEffect(() => {
|
|
293
|
+
const source = skillSourceRef.current
|
|
294
|
+
if (!source) return
|
|
295
|
+
return registerComposerExtension({ id: "builtin/skills", inputTriggers: [source] })
|
|
296
|
+
}, [])
|
|
128
297
|
|
|
129
298
|
const getItems = ({
|
|
130
299
|
query,
|
|
@@ -138,16 +307,34 @@ export function CommandSuggestionMenu({
|
|
|
138
307
|
): SuggestionItem<CommandSuggestionView>[] =>
|
|
139
308
|
unifyCommandItems({
|
|
140
309
|
query,
|
|
141
|
-
serverCommands:
|
|
142
|
-
onRunCommand,
|
|
310
|
+
serverCommands: commandsRef.current,
|
|
311
|
+
onRunCommand: onRunCommandRef.current,
|
|
143
312
|
triggerSources: sources,
|
|
144
313
|
triggerCandidateLists: candidateLists,
|
|
145
|
-
clientCommands:
|
|
314
|
+
clientCommands: filterGatedClientCommands(resolvedClientCommandsRef.current, {
|
|
315
|
+
attachmentsEnabled: attachmentsEnabledRef.current,
|
|
316
|
+
hasModels: (modelsRef.current?.length ?? 0) > 0,
|
|
317
|
+
permissionEnabled: permissionEnabledRef.current,
|
|
318
|
+
// /undo 门控(P1 任务 2):canRevertLastTurn === true 才进菜单
|
|
319
|
+
//(gate 表达式 `cmd.name !== 'undo' || undoEnabled`——filterGatedClientCommands
|
|
320
|
+
// 单点,`+` 菜单同函数零漂移)
|
|
321
|
+
undoEnabled: canRevertLastTurnRef.current === true,
|
|
322
|
+
// /plan 门控(P2 任务 2):canPlan === true 才进菜单(单点 filterGatedClientCommands,
|
|
323
|
+
// `+` 菜单同函数零漂移)
|
|
324
|
+
planEnabled: canPlanRef.current === true,
|
|
325
|
+
}),
|
|
146
326
|
}).map((item) => {
|
|
147
327
|
const groupName = localizeGroup(item.group)
|
|
148
328
|
return {
|
|
149
329
|
title: item.label,
|
|
150
|
-
|
|
330
|
+
// server = 命令名;trigger = 候选副文本(技能源为小写技能名,P1 任务 3);
|
|
331
|
+
// client 无副文本
|
|
332
|
+
subtext:
|
|
333
|
+
item.kind === "server"
|
|
334
|
+
? item.name
|
|
335
|
+
: item.kind === "trigger"
|
|
336
|
+
? item.candidate?.subtext
|
|
337
|
+
: undefined,
|
|
151
338
|
context: { item, groupName },
|
|
152
339
|
group: item.group,
|
|
153
340
|
onSelect: ({ editor: pickEditor, range }) => {
|
|
@@ -164,6 +351,15 @@ export function CommandSuggestionMenu({
|
|
|
164
351
|
})
|
|
165
352
|
return
|
|
166
353
|
}
|
|
354
|
+
// popup 型命令(/model 任务 8、/permission 任务 9):选中**不执行**——上报
|
|
355
|
+
// onOpenPopup 弹 popup 浮层。restoreToken = `/${name} `(规范命令名,非用户敲
|
|
356
|
+
// 的 `/mo`),取消路径(Esc/外点)由上层 insertContent 恢复触发词;选中 settle
|
|
357
|
+
// 不恢复。SuggestionMenu 已 deleteRange 删除 `/xxx` 触发文本,恢复即重新插入
|
|
358
|
+
// 规范词。
|
|
359
|
+
if (item.popup) {
|
|
360
|
+
onOpenPopup?.(item.popup, `/${item.name} `)
|
|
361
|
+
return
|
|
362
|
+
}
|
|
167
363
|
executeCommandItem(item, { draft, editor: pickEditor, range })
|
|
168
364
|
},
|
|
169
365
|
}
|
|
@@ -184,7 +380,22 @@ export function CommandSuggestionMenu({
|
|
|
184
380
|
// 有候选必有高亮(@ 菜单同款):Enter 必选中首项,无「菜单开着、Enter 被吞」死区;
|
|
185
381
|
// 无候选时 useMenuNavigation 对 Enter 放行 → 提交 keymap 照常发送
|
|
186
382
|
autoSelectFirstItem={true}
|
|
383
|
+
// A7/X5(F5-6 批 7):Tab=确认高亮候选、Shift+Tab=关菜单(DSH keymap 语义,原为
|
|
384
|
+
// 移动高亮)。批 18 与 @ 菜单(mention-suggestion-menu)统一——两菜单同一 Tab 语义。
|
|
385
|
+
tabSelects
|
|
187
386
|
maxHeight={384}
|
|
387
|
+
// claimed 守卫(任务 11):行首有命令 chip(claimed 态)时 '/' 不再弹菜单——
|
|
388
|
+
// 判定**复用 findClaimChip**(claim.ts,与 claim 结算同一口径;含前导空白 +
|
|
389
|
+
// chip 的 doc 形状,裸遍历 doc.firstChild?.firstChild 判不出)。注意:传 allow
|
|
390
|
+
// **整体替换** SuggestionMenu 内置的 image-caption 检查(suggestion-menu.tsx
|
|
391
|
+
// builtinAllow)——composer 无 image 扩展,无实害。frozen 全禁走下方 disabled
|
|
392
|
+
// (T2:disabled 合成 allow=()=>false 优先于消费方 allow)。
|
|
393
|
+
allow={({ editor }) => findClaimChip(editor.getJSON()) === null}
|
|
394
|
+
disabled={disabled}
|
|
395
|
+
onPendingChange={onPendingChange}
|
|
396
|
+
noOpSelectWhilePending={noOpSelectWhilePending}
|
|
397
|
+
attachMode={attachMode}
|
|
398
|
+
anchorElement={anchorElement}
|
|
188
399
|
findSuggestionMatch={createFullWidthFindSuggestionMatch("/")}
|
|
189
400
|
>
|
|
190
401
|
{(renderProps) => <CommandList {...renderProps} onOpenChange={onOpenChange} />}
|
|
@@ -192,53 +403,11 @@ export function CommandSuggestionMenu({
|
|
|
192
403
|
)
|
|
193
404
|
}
|
|
194
405
|
|
|
195
|
-
/** 菜单条目(MenuView 渲染面,E4):标题 + 副文案 + 选中滚动入视。 */
|
|
196
|
-
const CommandItem = ({
|
|
197
|
-
view,
|
|
198
|
-
isSelected,
|
|
199
|
-
onSelect,
|
|
200
|
-
}: {
|
|
201
|
-
view: CommandSuggestionView
|
|
202
|
-
isSelected: boolean
|
|
203
|
-
onSelect: () => void
|
|
204
|
-
}) => {
|
|
205
|
-
const itemRef = useRef<HTMLDivElement>(null)
|
|
206
|
-
|
|
207
|
-
useEffect(() => {
|
|
208
|
-
const menuEl = document.querySelector(
|
|
209
|
-
'[data-selector="tiptap-command-suggestion-menu"]',
|
|
210
|
-
) as HTMLElement
|
|
211
|
-
if (!itemRef.current || !isSelected || !menuEl) return
|
|
212
|
-
const overflow = getElementOverflowPosition(itemRef.current, menuEl)
|
|
213
|
-
if (overflow === "top") itemRef.current.scrollIntoView(true)
|
|
214
|
-
else if (overflow === "bottom") itemRef.current.scrollIntoView(false)
|
|
215
|
-
}, [isSelected])
|
|
216
|
-
|
|
217
|
-
const { item } = view
|
|
218
|
-
return (
|
|
219
|
-
<div ref={itemRef}>
|
|
220
|
-
<Item
|
|
221
|
-
size="xs"
|
|
222
|
-
onClick={onSelect}
|
|
223
|
-
className={cn(
|
|
224
|
-
"cursor-pointer hover:bg-accent",
|
|
225
|
-
isSelected && "bg-accent outline -outline-offset-1 outline-ring",
|
|
226
|
-
)}
|
|
227
|
-
>
|
|
228
|
-
<ItemContent>
|
|
229
|
-
<ItemTitle className="text-left">{item.label}</ItemTitle>
|
|
230
|
-
{item.kind === "server" && (
|
|
231
|
-
<span className="text-[10px] text-muted-foreground">{item.name}</span>
|
|
232
|
-
)}
|
|
233
|
-
</ItemContent>
|
|
234
|
-
</Item>
|
|
235
|
-
</div>
|
|
236
|
-
)
|
|
237
|
-
}
|
|
238
|
-
|
|
239
406
|
/**
|
|
240
407
|
* 分组渲染(E4 MenuView 骨架,F5-6 批 18):MenuView 承接 combobox 语义
|
|
241
|
-
* (aria-activedescendant / role=option)/ 组头聚合 /
|
|
408
|
+
* (aria-activedescendant / role=option)/ 组头聚合 / 视口高度上限 / loading 骨架行 /
|
|
409
|
+
* 高亮行 scrollIntoView 收敛进 MenuView 行组件(批 18 从 CommandItem 迁出);mousemove
|
|
410
|
+
* 共享高亮仅 @ 菜单接线(本组件未传 setSelectedIndex,'/' 行 onMouseMove=undefined)。
|
|
242
411
|
* 键盘仲裁仍由 SuggestionMenu / use-menu-navigation 驱动(本组件只消费 selectedIndex
|
|
243
412
|
* 做高亮与 aria)。菜单开合信号:SuggestionMenu 仅在浮层挂载期渲染 children,
|
|
244
413
|
* CommandList 挂载/卸载即开/关(稳定回调)。
|
|
@@ -272,9 +441,26 @@ const CommandList = ({
|
|
|
272
441
|
selector="tiptap-command-suggestion-menu"
|
|
273
442
|
loading={items.length === 0}
|
|
274
443
|
renderTitle={(suggestion) => suggestion.title}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
444
|
+
// 图标 + 描述(用户裁决 2026-11-20):client/server 按 name 查 COMMAND_META
|
|
445
|
+
//(未知命令回落无图标无描述);trigger 候选(技能)图标 Wand2、副文本沿用
|
|
446
|
+
// 源提供的技能名。server 行副文本由裸英文命令名改为本地化描述。
|
|
447
|
+
renderMedia={(suggestion) => {
|
|
448
|
+
const item = suggestion.context?.item
|
|
449
|
+
if (item?.kind === "trigger") {
|
|
450
|
+
const Icon = SKILL_TRIGGER_ICON
|
|
451
|
+
return <Icon className="size-4" />
|
|
452
|
+
}
|
|
453
|
+
const meta = item ? COMMAND_META[item.name] : undefined
|
|
454
|
+
if (!meta) return null
|
|
455
|
+
const Icon = meta.icon
|
|
456
|
+
return <Icon className="size-4" />
|
|
457
|
+
}}
|
|
458
|
+
renderSubtext={(suggestion) => {
|
|
459
|
+
const item = suggestion.context?.item
|
|
460
|
+
if (item?.kind === "trigger") return item.candidate?.subtext
|
|
461
|
+
const meta = item ? COMMAND_META[item.name] : undefined
|
|
462
|
+
return meta ? meta.desc() : undefined
|
|
463
|
+
}}
|
|
278
464
|
/>
|
|
279
465
|
)
|
|
280
466
|
}
|