@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
|
@@ -21,19 +21,22 @@
|
|
|
21
21
|
* 经 composer props 注入,props 注入纪律:composer 不读 view store);
|
|
22
22
|
* trigger = registry 聚合的 '/' InputTriggerSource(getComposerInputTriggers('/'),
|
|
23
23
|
* 现状零注册 → 空,F5-7 demo 可注册);
|
|
24
|
-
* client = composer 本地命令(内置「清空输入」= draft.clear
|
|
24
|
+
* client = composer 本地命令(内置「清空输入」= draft.clear;/undo = P1 任务 2
|
|
25
|
+
* checkpoint revert 通路,workbench-page 注入)。
|
|
25
26
|
*
|
|
26
27
|
* 合并产物 ComposerCommandItem 由 '/' 菜单(command/command-suggestion-menu.tsx)
|
|
27
28
|
* 渲染;选中执行:server → onRunCommand(workbench-page 从 harness
|
|
28
29
|
* client.runCommand 接线,错误 toast);client → item.run(draft api);
|
|
29
30
|
* trigger → source.onPick。claim 事务(选中后 '/' 词清理/恢复)留 F5-6 批 18。
|
|
30
31
|
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
32
|
+
* 本模块聚合逻辑保持纯同步(分组用稳定 id 'commands'/'client',菜单渲染侧
|
|
33
|
+
* 本地化)——真值表测试不依赖异步时序;i18n 仅两处:内置 client 命令 label 与
|
|
34
|
+
* 已知 server 命令 label 映射(KNOWN_SERVER_COMMAND_LABELS,任务 1)。
|
|
33
35
|
*/
|
|
34
36
|
|
|
35
37
|
import { m } from "@/paraglide/messages.js"
|
|
36
38
|
import type { Editor, Range } from "@tiptap/react"
|
|
39
|
+
import { fuzzyMatch } from "../fuzzy"
|
|
37
40
|
import type { ComposerDraftApi, InputTriggerSource, TriggerCandidate } from "./types"
|
|
38
41
|
|
|
39
42
|
// ---------------------------------------------------------------------------
|
|
@@ -51,8 +54,8 @@ export interface ComposerServerCommand {
|
|
|
51
54
|
/**
|
|
52
55
|
* input 型命令(E2 claim 事务,F5-6 批 18):true = 选中后**不立即执行**——
|
|
53
56
|
* 触发词替换为命令 chip(claim),参数走 ghost hint,Enter 结算 claim.submit(args)。
|
|
54
|
-
* 缺省 false =
|
|
55
|
-
*
|
|
57
|
+
* 缺省 false = 选中即执行(旧语义)。机制面以 mock server 命令锁定(vitest 全
|
|
58
|
+
* 生命周期);真实命令自任务 1(/compact,非 input 型)起接入。
|
|
56
59
|
*/
|
|
57
60
|
input?: boolean
|
|
58
61
|
/** 参数空时的 ghost hint 文案(A16;命令自述参数形态;仅 input 型消费) */
|
|
@@ -79,7 +82,18 @@ export interface ComposerClientCommand {
|
|
|
79
82
|
hint?: string
|
|
80
83
|
/** claim 是否接受附件(E2 结算守卫;缺省 false) */
|
|
81
84
|
acceptsAttachments?: boolean
|
|
82
|
-
/**
|
|
85
|
+
/**
|
|
86
|
+
* 分组头稳定 id(菜单渲染侧本地化内置 id,如 'add'/'commands'/'client';缺省
|
|
87
|
+
* 'client'——内置「清空输入」沿用旧组)。unifyCommandItems 透传到
|
|
88
|
+
* ComposerCommandItem.group,菜单侧 localizeGroup 出展示文案。
|
|
89
|
+
*/
|
|
90
|
+
group?: string
|
|
91
|
+
/**
|
|
92
|
+
* popup 型命令(/model,任务 8):非空 = 选中**不执行** run——由上层弹对应 popup
|
|
93
|
+
* 浮层('model' = 模型目录)。run 仍必填(形状一致)但 popup 型不被调用。
|
|
94
|
+
*/
|
|
95
|
+
popup?: "model" | "permission"
|
|
96
|
+
/** 执行(本地动作;拒绝/失败自行处理,不抛给菜单;popup 型不被调用) */
|
|
83
97
|
run: (ctx: ComposerCommandRunContext) => void | Promise<unknown>
|
|
84
98
|
}
|
|
85
99
|
|
|
@@ -91,6 +105,37 @@ export interface ComposerCommandRunContext {
|
|
|
91
105
|
editor: Editor
|
|
92
106
|
/** 触发文本范围('/xxx',SuggestionMenu 选中时已删除该段文本——见菜单侧注释) */
|
|
93
107
|
range: Range
|
|
108
|
+
/**
|
|
109
|
+
* claim 结算参数(E2,P2 任务 1):仅 claim 路径(input 型命令落 chip 后 Enter 结算)
|
|
110
|
+
* 提供——chip 之后的参数文本。菜单选中即时执行路径(非 input 型)不传(undefined)。
|
|
111
|
+
* client input 命令经 submitClaim 的 client 分支 `cmd.run({ ...ctx, args })` 结算时读取。
|
|
112
|
+
*/
|
|
113
|
+
args?: string
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* 统一命令执行兜底(2026-11-20 任务 B 遗留清理 2):同步异常与 Promise 拒绝在此
|
|
118
|
+
* console.error(不上 toast——server 命令的错误面在 workbench-page 接线层,避免双报),
|
|
119
|
+
* 文案 `[composer-command] 命令执行失败: <name>`(原 '/' 菜单 executeCommandItem 口径)。
|
|
120
|
+
* **两个入口共用**:'/' 菜单选中执行(command-suggestion-menu)与 `+` 菜单执行型命令
|
|
121
|
+
* (harness-composer handlePlusCommandSelect,原先 `void cmd.run(...)` 无 catch)——
|
|
122
|
+
* 错误兜底与文案单点,不再一处有一处无。
|
|
123
|
+
*/
|
|
124
|
+
export function safeRunCommand(
|
|
125
|
+
name: string,
|
|
126
|
+
run: (ctx: ComposerCommandRunContext) => void | Promise<unknown>,
|
|
127
|
+
ctx: ComposerCommandRunContext,
|
|
128
|
+
): void {
|
|
129
|
+
try {
|
|
130
|
+
const result = run(ctx)
|
|
131
|
+
if (result instanceof Promise) {
|
|
132
|
+
result.catch((error: unknown) => {
|
|
133
|
+
console.error(`[composer-command] 命令执行失败: ${name}`, error)
|
|
134
|
+
})
|
|
135
|
+
}
|
|
136
|
+
} catch (error) {
|
|
137
|
+
console.error(`[composer-command] 命令执行失败: ${name}`, error)
|
|
138
|
+
}
|
|
94
139
|
}
|
|
95
140
|
|
|
96
141
|
/** 统一命令候选项(三类源合并产物;'/' 菜单条目的单一数据形状)。 */
|
|
@@ -118,6 +163,8 @@ export interface ComposerCommandItem {
|
|
|
118
163
|
hint?: string
|
|
119
164
|
/** claim 是否接受附件(E2 结算守卫;server/client 透传) */
|
|
120
165
|
acceptsAttachments?: boolean
|
|
166
|
+
/** popup 型命令(/model,任务 8):非空 = 选中弹 popup 而非执行 run。仅 client 透传 */
|
|
167
|
+
popup?: "model" | "permission"
|
|
121
168
|
}
|
|
122
169
|
|
|
123
170
|
/** unifyCommandItems 入参(三源 + 查询词 + 执行通路)。 */
|
|
@@ -143,41 +190,59 @@ export interface UnifyCommandItemsInput {
|
|
|
143
190
|
// 聚合
|
|
144
191
|
// ---------------------------------------------------------------------------
|
|
145
192
|
|
|
146
|
-
/**
|
|
193
|
+
/**
|
|
194
|
+
* 已知 server 命令的 label 本地化映射(任务 1):server 项 label 缺省取
|
|
195
|
+
* description 原文(官方命令的 description 是英文,直接上屏违反中文 UI 约定)
|
|
196
|
+
* ——映射命中 → 本地化 label;未知命令回落 description 原文(新命令先行,
|
|
197
|
+
* 映射随后补)。函数形式(非模块期字符串)延迟 paraglide 求值到菜单组装期
|
|
198
|
+
* ——locale 热切后下次组装即刷新(与 createBuiltinClientCommands 同口径)。
|
|
199
|
+
*/
|
|
200
|
+
const KNOWN_SERVER_COMMAND_LABELS: Record<string, () => string> = {
|
|
201
|
+
compact: () => m.harness_command_compact(),
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/** server 项展示 label(已知命令本地化映射优先,未知回落 description 原文/name)。 */
|
|
205
|
+
function serverCommandLabel(cmd: ComposerServerCommand): string {
|
|
206
|
+
const localized = KNOWN_SERVER_COMMAND_LABELS[cmd.name]
|
|
207
|
+
return localized ? localized() : cmd.description || cmd.name
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/** 查询匹配(fuzzy 子序列 ∪ 子串 includes,大小写不敏感;空词全放行——mention 同口径)。 */
|
|
147
211
|
function matchesQuery(query: string, ...texts: ReadonlyArray<string | undefined>): boolean {
|
|
148
212
|
const q = query.trim().toLowerCase()
|
|
149
213
|
if (!q) return true
|
|
150
|
-
return texts.some(
|
|
214
|
+
return texts.some(
|
|
215
|
+
(t) => typeof t === "string" && (fuzzyMatch(q, t) !== null || t.toLowerCase().includes(q)),
|
|
216
|
+
)
|
|
151
217
|
}
|
|
152
218
|
|
|
153
219
|
/**
|
|
154
|
-
* 三类源类型化合并(
|
|
220
|
+
* 三类源类型化合并(client → trigger → server,批 18 重排——本地命令最前,与 kind
|
|
221
|
+
* 联合声明顺序无涉)。
|
|
155
222
|
*
|
|
156
|
-
* -
|
|
223
|
+
* - client:全量透传(内置命令 label 已本地化,过滤走 name/label);
|
|
157
224
|
* - trigger:候选按 triggerCandidateLists(优先)或同步 candidates(query) 取值,
|
|
158
225
|
* 查询过滤已由源内完成(源契约),菜单侧不再二次过滤(mention 同现状);
|
|
159
|
-
* -
|
|
226
|
+
* - server:onRunCommand 缺省时整体跳过(无执行通路不展示)。
|
|
160
227
|
*/
|
|
161
228
|
export function unifyCommandItems(input: UnifyCommandItemsInput): ComposerCommandItem[] {
|
|
162
229
|
const query = input.query ?? ""
|
|
163
230
|
const items: ComposerCommandItem[] = []
|
|
164
231
|
|
|
165
|
-
//
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
})
|
|
180
|
-
}
|
|
232
|
+
// client:composer 本地命令(内置「清空输入」在列)——批 18 重排至最前(本地动作零依赖、可即时执行)
|
|
233
|
+
for (const cmd of input.clientCommands ?? []) {
|
|
234
|
+
if (!matchesQuery(query, cmd.name, cmd.label)) continue
|
|
235
|
+
items.push({
|
|
236
|
+
kind: "client",
|
|
237
|
+
name: cmd.name,
|
|
238
|
+
label: cmd.label,
|
|
239
|
+
group: cmd.group ?? "client",
|
|
240
|
+
run: (ctx) => cmd.run(ctx),
|
|
241
|
+
...(cmd.input === true ? { input: true } : {}),
|
|
242
|
+
...(cmd.hint ? { hint: cmd.hint } : {}),
|
|
243
|
+
...(cmd.acceptsAttachments === true ? { acceptsAttachments: true } : {}),
|
|
244
|
+
...(cmd.popup ? { popup: cmd.popup } : {}),
|
|
245
|
+
})
|
|
181
246
|
}
|
|
182
247
|
|
|
183
248
|
// trigger:'/' 触发源候选(现状零注册 → 空;F5-7 demo 可注册)。
|
|
@@ -203,19 +268,22 @@ export function unifyCommandItems(input: UnifyCommandItemsInput): ComposerComman
|
|
|
203
268
|
}
|
|
204
269
|
})
|
|
205
270
|
|
|
206
|
-
//
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
271
|
+
// server:expose.commands 白名单子集;无执行通路 → 不展示(防死条目)
|
|
272
|
+
if (input.onRunCommand) {
|
|
273
|
+
for (const cmd of input.serverCommands ?? []) {
|
|
274
|
+
if (!matchesQuery(query, cmd.name, cmd.description)) continue
|
|
275
|
+
const name = cmd.name
|
|
276
|
+
items.push({
|
|
277
|
+
kind: "server",
|
|
278
|
+
name,
|
|
279
|
+
label: serverCommandLabel(cmd),
|
|
280
|
+
group: "commands",
|
|
281
|
+
run: () => input.onRunCommand?.(name),
|
|
282
|
+
...(cmd.input === true ? { input: true } : {}),
|
|
283
|
+
...(cmd.hint ? { hint: cmd.hint } : {}),
|
|
284
|
+
...(cmd.acceptsAttachments === true ? { acceptsAttachments: true } : {}),
|
|
285
|
+
})
|
|
286
|
+
}
|
|
219
287
|
}
|
|
220
288
|
|
|
221
289
|
return items
|
|
@@ -245,18 +313,209 @@ export function resolveCommandTriggerCandidates(
|
|
|
245
313
|
/** 内置「清空输入」命令名(诊断 / 测试断言用稳定 id)。 */
|
|
246
314
|
export const BUILTIN_CLIENT_COMMAND_CLEAR_INPUT = "clear-input"
|
|
247
315
|
|
|
316
|
+
/** 内置「文件」命令名(诊断 / 测试断言用稳定 id;打开系统文件选择器,附件引用管道复用)。 */
|
|
317
|
+
export const BUILTIN_CLIENT_COMMAND_FILE = "file"
|
|
318
|
+
|
|
319
|
+
/** 内置「模型」popup 命令名(诊断 / 测试断言用稳定 id;选中弹模型目录 popup,任务 8)。 */
|
|
320
|
+
export const BUILTIN_CLIENT_COMMAND_MODEL = "model"
|
|
321
|
+
|
|
322
|
+
/** 内置「权限」popup 命令名(诊断 / 测试断言用稳定 id;选中弹沙箱三档 popup,任务 9)。 */
|
|
323
|
+
export const BUILTIN_CLIENT_COMMAND_PERMISSION = "permission"
|
|
324
|
+
|
|
325
|
+
/** 内置「撤销上一回合」命令名(诊断 / 测试断言用稳定 id;client 命令接 checkpoint revert,P1 任务 2)。 */
|
|
326
|
+
export const BUILTIN_CLIENT_COMMAND_UNDO = "undo"
|
|
327
|
+
|
|
328
|
+
/** 内置「计划模式」命令名(诊断 / 测试断言用稳定 id;client input 命令接切档 + 发送,P2 任务 2)。 */
|
|
329
|
+
export const BUILTIN_CLIENT_COMMAND_PLAN = "plan"
|
|
330
|
+
|
|
331
|
+
/** 内置客户端命令的执行环境(菜单组装侧注入;命令本体 i18n-free / 纯同步)。 */
|
|
332
|
+
export interface BuiltinCommandContext {
|
|
333
|
+
/** 打开系统文件选择器(harness-composer 的隐藏 input[type=file].click) */
|
|
334
|
+
openFilePicker: () => void
|
|
335
|
+
/**
|
|
336
|
+
* /undo 执行通路(P1 任务 2,client 命令接 checkpoint revert):workbench-page
|
|
337
|
+
* 解析 revert 目标(最后一条 user 消息的前一条真实消息——revert 语义=保留目标、
|
|
338
|
+
* 隐藏其后,见 workbench/undo-last-turn.ts)并经 harness-composer props 注入
|
|
339
|
+
* (props 注入纪律:composer 不读 view store)。**缺省(undefined)= 命令集不含
|
|
340
|
+
* undo**(legacy 链无通路不出现死条目)。门控不在 ctx——可撤销与否
|
|
341
|
+
* (canRevertLastTurn)由组装侧 filterGatedClientCommands 的 undoEnabled 旗标
|
|
342
|
+
* 承担,ctx.undo 只载执行通路。
|
|
343
|
+
*/
|
|
344
|
+
undo?: {
|
|
345
|
+
/**
|
|
346
|
+
* 撤销执行(workbench-page 的 onRevertLastTurn:revert slot 到最后一条 user
|
|
347
|
+
* 消息的前一条消息 = 隐藏最后一轮 QA,不续跑)。
|
|
348
|
+
*/
|
|
349
|
+
run: () => void
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* /plan 执行通路(P2 任务 2,client input 命令接切档 + 发送):workbench-page 组装
|
|
353
|
+
* `await setSandboxPolicy({ threadId, level: 'readonly' })` 成功 → 发送任务文本的闭包,
|
|
354
|
+
* 经 props(onPlanSubmit)注入(props 注入纪律:composer 不读 view store)。**缺省
|
|
355
|
+
* (undefined)= 命令集不含 plan**(legacy 链无通路不出现死条目)。门控不在 ctx——
|
|
356
|
+
* plan 可用与否由组装侧 filterGatedClientCommands 的 planEnabled 旗标承担,ctx.plan
|
|
357
|
+
* 只载执行通路(与 ctx.undo 单一分界同款)。
|
|
358
|
+
*/
|
|
359
|
+
plan?: {
|
|
360
|
+
/**
|
|
361
|
+
* 计划执行(workbench-page 的 onPlanSubmit:切 readonly/plan 档 → 发送任务文本;
|
|
362
|
+
* 切档失败 rethrow,由 claim 结算层 toast + 保草稿 fail-closed)。
|
|
363
|
+
*/
|
|
364
|
+
run: (args: string) => Promise<void>
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
248
368
|
/**
|
|
249
|
-
* 内置客户端命令(F5-4 机制就位 +
|
|
369
|
+
* 内置客户端命令(F5-4 机制就位 + 真实命令):「文件」= 打开系统文件选择器
|
|
370
|
+
* (ctx.openFilePicker,附件引用管道复用 + 附件托盘 UI);「清空输入」=
|
|
250
371
|
* ctx.draft.clear(编辑器内容 + 挂起防抖保存 + sessionStorage 草稿 + 外层
|
|
251
|
-
* input/chip 状态;不含附件——附件托盘有独立移除 UI
|
|
252
|
-
*
|
|
372
|
+
* input/chip 状态;不含附件——附件托盘有独立移除 UI);「模型」= popup 型命令
|
|
373
|
+
* (popup: "model",任务 8)——选中**不执行 run**,由上层弹模型目录 popup
|
|
374
|
+
* (复用 body.availableModels),取消恢复触发词、选中切当前会话模型;「权限」=
|
|
375
|
+
* popup 型命令(popup: "permission",任务 9)——选中弹沙箱三档 popup(只读/
|
|
376
|
+
* 工作区可写/完全访问,full 档 AlertDialog 二次确认),切当前线程策略档。
|
|
377
|
+
*
|
|
378
|
+
* **门控由组装侧完成**:command-suggestion-menu 在 getItems 里按响应式 prop 过滤——
|
|
379
|
+
* `attachmentsEnabled` 过滤 /file、`models` 非空过滤 /model、`permissionEnabled`
|
|
380
|
+
* 过滤 /permission(命令集本身恒返回全集)——本函数不消费任何门控入参,保持纯
|
|
381
|
+
* 同步、可单测全集形状。顺序即展示顺序:/file、/model、/permission(添加组置顶)、
|
|
382
|
+
* 「清空输入」随后。
|
|
383
|
+
*
|
|
384
|
+
* **undo 条件产出**(P1 任务 2):`ctx.undo` 缺省(undefined,legacy 链无执行通路)
|
|
385
|
+
* → 命令集不含 undo;提供 → 追加第五条(client 组,组头「指令」)。可撤销与否不
|
|
386
|
+
* 在此判定(保持「命令集形状由 ctx 决定、门控由组装侧响应式旗标逐次过滤」的单一
|
|
387
|
+
* 分界)——组装侧 filterGatedClientCommands 按 undoEnabled 旗标过滤。
|
|
253
388
|
*/
|
|
254
|
-
export function createBuiltinClientCommands(): ComposerClientCommand[] {
|
|
389
|
+
export function createBuiltinClientCommands(ctx: BuiltinCommandContext): ComposerClientCommand[] {
|
|
255
390
|
return [
|
|
391
|
+
{
|
|
392
|
+
name: BUILTIN_CLIENT_COMMAND_FILE,
|
|
393
|
+
group: "add",
|
|
394
|
+
label: m.harness_command_file(),
|
|
395
|
+
run: () => ctx.openFilePicker(),
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
name: BUILTIN_CLIENT_COMMAND_MODEL,
|
|
399
|
+
group: "add",
|
|
400
|
+
label: m.harness_command_model(),
|
|
401
|
+
popup: "model",
|
|
402
|
+
run: () => {},
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
name: BUILTIN_CLIENT_COMMAND_PERMISSION,
|
|
406
|
+
group: "add",
|
|
407
|
+
label: m.harness_command_permission(),
|
|
408
|
+
popup: "permission",
|
|
409
|
+
run: () => {},
|
|
410
|
+
},
|
|
256
411
|
{
|
|
257
412
|
name: BUILTIN_CLIENT_COMMAND_CLEAR_INPUT,
|
|
413
|
+
// client 组(组头「指令」):任务 1 起 group id 'commands' 语义收窄为 server
|
|
414
|
+
// 命令组(组头「服务端命令」)——内置 client 命令不再落入,防两源同组误并。
|
|
415
|
+
group: "client",
|
|
258
416
|
label: m.harness_command_clearInput(),
|
|
259
417
|
run: (ctx) => ctx.draft.clear(),
|
|
260
418
|
},
|
|
419
|
+
// /undo(P1 任务 2,条件产出):ctx.undo 缺省不产出(legacy 链不出现死条目)。
|
|
420
|
+
// 执行通路 run 由 workbench-page 注入(revert slot 到最后一条 user 消息的前一条
|
|
421
|
+
// 真实消息 = 隐藏最后一轮 QA,不续跑——与消息流 Retry 的 revert+continue 组合
|
|
422
|
+
// 零重叠)。
|
|
423
|
+
...(ctx.undo
|
|
424
|
+
? [
|
|
425
|
+
{
|
|
426
|
+
name: BUILTIN_CLIENT_COMMAND_UNDO,
|
|
427
|
+
group: "client",
|
|
428
|
+
label: m.harness_command_undo(),
|
|
429
|
+
run: () => ctx.undo?.run(),
|
|
430
|
+
},
|
|
431
|
+
]
|
|
432
|
+
: []),
|
|
433
|
+
// /plan(P2 任务 2,条件产出 + input 型 claim):ctx.plan 缺省不产出(legacy 链
|
|
434
|
+
// 不出现死条目)。input: true = 选中落 chip(claim),Enter 结算 run(args)——
|
|
435
|
+
// 结算 = workbench-page 的 onPlanSubmit(切 readonly/plan 档 + 发送任务文本)。
|
|
436
|
+
// ghost hint 提示用户输入任务描述;无 acceptsAttachments(缺省 false)→ 草稿带
|
|
437
|
+
// 附件时被 claim 信封守卫拦(计划任务不带附件)。门控由组装侧 planEnabled 旗标
|
|
438
|
+
// 承担(见 filterGatedClientCommands)。
|
|
439
|
+
...(ctx.plan
|
|
440
|
+
? [
|
|
441
|
+
{
|
|
442
|
+
name: BUILTIN_CLIENT_COMMAND_PLAN,
|
|
443
|
+
group: "client",
|
|
444
|
+
label: m.harness_command_plan(),
|
|
445
|
+
input: true as const,
|
|
446
|
+
hint: m.harness_command_planHint(),
|
|
447
|
+
run: (runCtx: ComposerCommandRunContext) => ctx.plan?.run(runCtx.args ?? ""),
|
|
448
|
+
},
|
|
449
|
+
]
|
|
450
|
+
: []),
|
|
261
451
|
]
|
|
262
452
|
}
|
|
453
|
+
|
|
454
|
+
/** 门控过滤入参(组装侧响应式旗标;`/` 菜单与 `+` 菜单传同一套判定)。 */
|
|
455
|
+
export interface BuiltinCommandGateFlags {
|
|
456
|
+
/** 附件能力开关(= !localEngine;false 过滤「文件」) */
|
|
457
|
+
attachmentsEnabled: boolean
|
|
458
|
+
/** 模型目录非空(false 过滤「模型」) */
|
|
459
|
+
hasModels: boolean
|
|
460
|
+
/** /permission 门控(harness 链 + threadId + sandboxExecution feature;false 过滤「权限」) */
|
|
461
|
+
permissionEnabled: boolean
|
|
462
|
+
/**
|
|
463
|
+
* /undo 门控(P1 任务 2):canRevertLastTurn === true(harness 链 revert slot 在 +
|
|
464
|
+
* 有 assistant 消息 + !isRunning,workbench-page 计算)。缺省/非 true 一律过滤
|
|
465
|
+
* (fail-closed——legacy 链或运行中撤销不进菜单)。
|
|
466
|
+
*/
|
|
467
|
+
undoEnabled?: boolean
|
|
468
|
+
/**
|
|
469
|
+
* /plan 门控(P2 任务 2):harness 链 + threadId 非空 + !isRunning(workbench-page
|
|
470
|
+
* 计算,与 permissionEnabled 同口径去掉 entitlement——切 readonly 档无需沙箱执行
|
|
471
|
+
* entitlement)。缺省/false 一律过滤(fail-closed——legacy 链 / 空态 thread /
|
|
472
|
+
* 运行中不进菜单)。
|
|
473
|
+
*/
|
|
474
|
+
planEnabled?: boolean
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
/**
|
|
478
|
+
* 内置命令门控过滤(组装侧单点,任务 10):「文件」按 attachmentsEnabled、「模型」
|
|
479
|
+
* 按 hasModels、「权限」按 permissionEnabled、「撤销上一回合」按 undoEnabled、「计划
|
|
480
|
+
* 模式」按 planEnabled 过滤,「清空输入」恒在。命令集本身恒返回全集(纯同步可单测),
|
|
481
|
+
* 门控在组装侧按响应式旗标逐次过滤(本地引擎切换、模型目录变化或 entitlement 变化时
|
|
482
|
+
* 无需重建命令集)。`/` 菜单(command-suggestion-menu getItems)与 `+` 菜单
|
|
483
|
+
* (harness-composer Popover)共用本函数——两处门控零漂移。
|
|
484
|
+
*/
|
|
485
|
+
export function filterGatedClientCommands(
|
|
486
|
+
commands: ReadonlyArray<ComposerClientCommand>,
|
|
487
|
+
flags: BuiltinCommandGateFlags,
|
|
488
|
+
): ComposerClientCommand[] {
|
|
489
|
+
return commands.filter(
|
|
490
|
+
(cmd) =>
|
|
491
|
+
(cmd.name !== BUILTIN_CLIENT_COMMAND_FILE || flags.attachmentsEnabled) &&
|
|
492
|
+
(cmd.name !== BUILTIN_CLIENT_COMMAND_MODEL || flags.hasModels) &&
|
|
493
|
+
(cmd.name !== BUILTIN_CLIENT_COMMAND_PERMISSION || flags.permissionEnabled === true) &&
|
|
494
|
+
// /undo(P1 任务 2):仅 canRevertLastTurn === true 放行(缺省 fail-closed)
|
|
495
|
+
(cmd.name !== BUILTIN_CLIENT_COMMAND_UNDO || flags.undoEnabled === true) &&
|
|
496
|
+
// /plan(P2 任务 2):仅 planEnabled === true 放行(缺省 fail-closed)
|
|
497
|
+
(cmd.name !== BUILTIN_CLIENT_COMMAND_PLAN || flags.planEnabled === true),
|
|
498
|
+
)
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
/**
|
|
502
|
+
* `+` 菜单席位收敛(2026-11-20 harness-composer-controls 任务 7):剔除「模型」
|
|
503
|
+
* 「权限」两项——控制行已有专钮(模型合并面板 + 权限档位按钮),`/model`
|
|
504
|
+
* `/permission` 斜杠命令仍可达,三入口冗余。**只裁席位、不做门控**:门控仍由
|
|
505
|
+
* `filterGatedClientCommands` 单点承担(`hasModels`/`permissionEnabled` 旗标在 `+`
|
|
506
|
+
* 菜单调用点保留原样传入——`/` 菜单与本函数零共享状态,门控参数删不得)。
|
|
507
|
+
*
|
|
508
|
+
* 与 `filterGatedClientCommands` 的分界:后者管「按能力/entitlement 放行」(`/` 菜单
|
|
509
|
+
* 与 `+` 菜单共用,本体不动);本函数管「`+` 菜单不设席位」——仅在 harness-composer
|
|
510
|
+
* 的 `plusMenuCommands`(`+` Popover)外再包一层,`/` 菜单链路
|
|
511
|
+
* (clientCommands → command-suggestion-menu getItems)不经此函数,模型/权限在
|
|
512
|
+
* `/` 菜单照旧可达。undo/plan/file/清空输入不在裁撤范围(控制行无对应专钮)。
|
|
513
|
+
*/
|
|
514
|
+
export function excludeComposerSeatCommands(
|
|
515
|
+
commands: ReadonlyArray<ComposerClientCommand>,
|
|
516
|
+
): ComposerClientCommand[] {
|
|
517
|
+
return commands.filter(
|
|
518
|
+
(cmd) =>
|
|
519
|
+
cmd.name !== BUILTIN_CLIENT_COMMAND_MODEL && cmd.name !== BUILTIN_CLIENT_COMMAND_PERMISSION,
|
|
520
|
+
)
|
|
521
|
+
}
|
|
@@ -27,12 +27,20 @@ export type {
|
|
|
27
27
|
ComposerCommandRunContext,
|
|
28
28
|
ComposerCommandItem,
|
|
29
29
|
UnifyCommandItemsInput,
|
|
30
|
+
BuiltinCommandContext,
|
|
30
31
|
} from "./command-menu"
|
|
31
32
|
export {
|
|
32
33
|
unifyCommandItems,
|
|
33
34
|
resolveCommandTriggerCandidates,
|
|
34
35
|
createBuiltinClientCommands,
|
|
36
|
+
filterGatedClientCommands,
|
|
37
|
+
excludeComposerSeatCommands,
|
|
38
|
+
safeRunCommand,
|
|
35
39
|
BUILTIN_CLIENT_COMMAND_CLEAR_INPUT,
|
|
40
|
+
BUILTIN_CLIENT_COMMAND_FILE,
|
|
41
|
+
BUILTIN_CLIENT_COMMAND_MODEL,
|
|
42
|
+
BUILTIN_CLIENT_COMMAND_PERMISSION,
|
|
43
|
+
BUILTIN_CLIENT_COMMAND_UNDO,
|
|
36
44
|
} from "./command-menu"
|
|
37
45
|
export {
|
|
38
46
|
registerComposerExtension,
|