@allbluecn/web-app 0.27.41 → 0.28.0
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 +1 -1
- 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 +3 -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-session-putmedia.test.tsx +17 -0
- package/src/components/harness/conversation-panel/messages/harness-chain/use-harness-chat-adapter.ts +26 -6
- package/src/components/harness/conversation-panel/messages/harness-chain/use-harness-session.ts +21 -3
- 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/dock-persist.ts +6 -4
- package/src/components/harness/extension-panel/dock/dock-registry.ts +35 -14
- package/src/components/harness/extension-panel/dock/dock-surface.tsx +2 -0
- package/src/components/harness/extension-panel/dock/guide-page.tsx +75 -45
- 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/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.ts +50 -0
- package/src/paraglide/messages/_index.js +1574 -311
- package/src/paraglide/messages/en.js +513 -103
- package/src/paraglide/messages/zh.js +514 -104
- package/src/routes/_nav/harness/route.lazy.tsx +13 -0
- package/src/server/ai-gateway/sandbox/policy.ts +6 -6
- 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__/thread-reference.server.test.ts +258 -0
- package/src/server/harness/define.server.ts +21 -3
- package/src/server/harness/thread-reference.server.ts +446 -0
- 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
|
@@ -77,8 +77,23 @@ export type SuggestionMenuRenderProps<T = DefaultContext> = {
|
|
|
77
77
|
* Callback to select an item.
|
|
78
78
|
*/
|
|
79
79
|
onSelect: (item: SuggestionItem<T>) => void
|
|
80
|
+
/**
|
|
81
|
+
* 编程式设置高亮(F5-6 批:共享高亮)。children render props 透传
|
|
82
|
+
* `useMenuNavigation` 的 `setSelectedIndex`——mousemove 等指针交互可直接驱动
|
|
83
|
+
* 高亮,与键盘导航共用同一 selectedIndex(单一高亮源)。纯增量:既有消费方
|
|
84
|
+
* 不读该字段则零影响。
|
|
85
|
+
*/
|
|
86
|
+
setSelectedIndex: (index: number) => void
|
|
80
87
|
}
|
|
81
88
|
|
|
89
|
+
/**
|
|
90
|
+
* 菜单锚定模式(DSH 对标,2026-11-20 任务 A):
|
|
91
|
+
* - `"caret"`(缺省):浮层锚定光标 decoration 节点、随光标移动(既有行为);
|
|
92
|
+
* - `"card-top"`:浮层钉在 anchorElement(输入框卡片根,如 InputGroup)上沿、
|
|
93
|
+
* 与卡片同宽(top-start + offset 4、无 flip/shift 不翻转),不随光标移动。
|
|
94
|
+
*/
|
|
95
|
+
export type SuggestionMenuAttachMode = "caret" | "card-top"
|
|
96
|
+
|
|
82
97
|
export interface SuggestionMenuProps<T = DefaultContext> extends Omit<
|
|
83
98
|
SuggestionOptions<SuggestionItem<T>>,
|
|
84
99
|
"pluginKey" | "editor"
|
|
@@ -91,6 +106,18 @@ export interface SuggestionMenuProps<T = DefaultContext> extends Omit<
|
|
|
91
106
|
* Additional options for the floating UI.
|
|
92
107
|
*/
|
|
93
108
|
floatingOptions?: Partial<UseFloatingOptions>
|
|
109
|
+
/**
|
|
110
|
+
* 菜单锚定模式(详见 SuggestionMenuAttachMode)。card-top 时 floatingOptions
|
|
111
|
+
* 不生效(floating 配置整体替换为钉卡上沿版——DSH 同款,不透传消费方覆盖)。
|
|
112
|
+
* @default "caret"
|
|
113
|
+
*/
|
|
114
|
+
attachMode?: SuggestionMenuAttachMode
|
|
115
|
+
/**
|
|
116
|
+
* card-top 模式的锚元素(输入框卡片根)。null/undefined 时回落 caret 定位
|
|
117
|
+
* (reference=decoration 节点)——锚随 editor 就绪由消费方(composer-editor)
|
|
118
|
+
* 注入,先于任何菜单打开(触发字符必须经 editor 输入)。
|
|
119
|
+
*/
|
|
120
|
+
anchorElement?: HTMLElement | null
|
|
94
121
|
/**
|
|
95
122
|
* CSS selector attribute for targeting the menu.
|
|
96
123
|
* @default 'tiptap-suggestion-menu'
|
|
@@ -119,6 +146,33 @@ export interface SuggestionMenuProps<T = DefaultContext> extends Omit<
|
|
|
119
146
|
* @default false
|
|
120
147
|
*/
|
|
121
148
|
tabSelects?: boolean
|
|
149
|
+
/**
|
|
150
|
+
* 禁用菜单(F5-6 批):true 时菜单立即关闭且不再打开(合成进 suggestion `allow`
|
|
151
|
+
* → `() => !disabled`,插件不再触发)。缺省 undefined = 恒不禁用,既有消费方零变化。
|
|
152
|
+
* 注意:传 `allow` 会**整体替换**组件内置的 image-caption 检查——composer 无 image
|
|
153
|
+
* 扩展无实害;disabled 场景直接用 `() => !disabled` 替换即可。
|
|
154
|
+
* @default undefined
|
|
155
|
+
*/
|
|
156
|
+
disabled?: boolean
|
|
157
|
+
/**
|
|
158
|
+
* pending(取数窗口)变化上报(消费侧守卫配套,整分支审查 finding 1):插件
|
|
159
|
+
* onStart/onUpdate 的 `loading` 态翻转时同步回调(onExit / 插件注销复位 false)。
|
|
160
|
+
* 消费方(composer)把它镜像进 ref 供提交 keymap 在 keydown 时刻同步读取——
|
|
161
|
+
* 回调在插件派发时点同步执行,不经 React 渲染,时效满足「插件派发与 keydown
|
|
162
|
+
* 之间 ref 可见」。缺省不注册 = 零影响(6 个消费方默认不变)。
|
|
163
|
+
* @default undefined
|
|
164
|
+
*/
|
|
165
|
+
onPendingChange?: (pending: boolean) => void
|
|
166
|
+
/**
|
|
167
|
+
* pending 期选中短路(composer 消费方专用,旧 T2 用例 2 no-op 语义):true 且
|
|
168
|
+
* 处于取数窗口时,内部 onSelect 直接短路——不选中、菜单仍开。**必须显式启用**
|
|
169
|
+
* 才生效:四通用消费方(emoji/mention/reference/slash dropdown)items 同步但
|
|
170
|
+
* 插件仍走 asyncRequest.fetch 进入 pending 微任务窗口,凭 pending 一刀切短路会
|
|
171
|
+
* 吞掉它们「有候选 Enter 选中」(F5-6 批 finding 3,suggestion-menu.test.tsx
|
|
172
|
+
* test 2/6 锁定)——故缺省 undefined = 不短路,零变化。
|
|
173
|
+
* @default undefined
|
|
174
|
+
*/
|
|
175
|
+
noOpSelectWhilePending?: boolean
|
|
122
176
|
/**
|
|
123
177
|
* Render function for the menu content.
|
|
124
178
|
*/
|
|
@@ -46,6 +46,35 @@ import type {
|
|
|
46
46
|
/**
|
|
47
47
|
* A component that renders a suggestion menu for Tiptap editors.
|
|
48
48
|
* Displays a floating menu when a trigger character is typed.
|
|
49
|
+
*
|
|
50
|
+
* 机制注记(F5-6 批,已核 @tiptap/suggestion@3.31.3 dist):
|
|
51
|
+
* - **SWR 旧行留屏**:插件 fetch 前派发 `onUpdate({loading:true, items: initialItems ?? []})`,
|
|
52
|
+
* 本组件不传 initialItems → 此时 `props.items` 恒 `[]`。故 fetch 进行中(`props.loading === true`)
|
|
53
|
+
* **不 setInternalItems**(保留旧 items),避免「resolve 旧行 → 改查询闪空」;resolve 后
|
|
54
|
+
* (`loading === false`)才 setItems。
|
|
55
|
+
* - **items 抛错会清 SWR 旧行**:插件 items 回调抛错路径最终派发 `{items: [], loading:false}`
|
|
56
|
+
* (dist index.js:553-556)→ 覆盖旧 items。消费方(如 harness `fileMentionCandidates`)
|
|
57
|
+
* 必须 catch 返回结果数组,勿让 Promise reject。
|
|
58
|
+
* - **pending Enter/Tab 拦截 = 消费侧职责(F5-6 批 finding 1/2/3 修订 + 整分支审查
|
|
59
|
+
* finding 1 兑现)**:曾在组件内实现「pending 期 onSelect 短路 + suggestion onKeyDown 拦
|
|
60
|
+
* Enter/Tab + view.dom 捕获 preventDefault」三重拦截,审查证伪后全部移除:
|
|
61
|
+
* ① 捕获拦截器——真实浏览器 AT_TARGET 阶段按注册顺序触发监听器、capture 标志无效(PM 冒泡
|
|
62
|
+
* 监听先注册先跑),jsdom 伪绿(finding 1);
|
|
63
|
+
* ② onSelect 短路 + onKeyDown 拦截凭 pendingRef 一刀切——四消费方(emoji/reference/mention/
|
|
64
|
+
* slash)items 虽同步,插件仍走 asyncRequest.fetch 进入 pending 微任务窗口,会吞掉它们
|
|
65
|
+
* 「有候选 Enter 选中」(finding 3,首次 Enter 不选中、需按第二次);
|
|
66
|
+
* ③ pendingRef 会在退出路径搁浅为 true(fetch 中 range 失活/state 转 stopped,插件不再派发
|
|
67
|
+
* loading:false 的 onUpdate),持续吞 Enter/Tab(finding 2)。
|
|
68
|
+
* **治本归宿 = 消费侧守卫(本版交付)**:组件只负责把 pending(插件 loading)经
|
|
69
|
+
* `onPendingChange` 回调在派发时点同步上报(ref 写入不经 React 渲染,keydown 读取时必可见)
|
|
70
|
+
* + 可选 `noOpSelectWhilePending`(仅 composer 显式启用:pending 期内部 onSelect 短路,
|
|
71
|
+
* 旧 T2 用例 2 no-op 语义)。composer 的提交 keymap(composer-keymap.ts isPending)在
|
|
72
|
+
* pending 窗口吞掉到达它的 Enter/Tab(空候选穿透层);有旧行时 Enter 由 useMenuNavigation
|
|
73
|
+
* 捕获消费、经 noOpSelectWhilePending 短路(不选中层)——两层合成「pending 期 Enter/Tab
|
|
74
|
+
* 无论 items 空不空都拦截」。四通用消费方缺省不注册不启用,零变化(finding 3 parity 保持)。
|
|
75
|
+
* 退出路径搁浅风险:onExit + 插件注销 cleanup 双路径复位 pending(finding 2 根源不复发)。
|
|
76
|
+
* - **dismiss 更粘语义**:插件用 `dismissedRange` 记住关闭位置(比 DSH 更粘——设计 §5.2
|
|
77
|
+
* 裁决),Escape 关闭后在同 range 内继续输入不会立刻重开。
|
|
49
78
|
*/
|
|
50
79
|
export const SuggestionMenu = ({
|
|
51
80
|
editor: providedEditor,
|
|
@@ -56,12 +85,31 @@ export const SuggestionMenu = ({
|
|
|
56
85
|
pluginKey = SuggestionPluginKey,
|
|
57
86
|
autoSelectFirstItem,
|
|
58
87
|
tabSelects,
|
|
88
|
+
disabled,
|
|
89
|
+
onPendingChange,
|
|
90
|
+
noOpSelectWhilePending,
|
|
91
|
+
attachMode,
|
|
92
|
+
anchorElement,
|
|
59
93
|
...internalSuggestionProps
|
|
60
94
|
}: SuggestionMenuProps) => {
|
|
61
95
|
const { editor } = useTiptapEditor(providedEditor)
|
|
62
96
|
|
|
63
97
|
const [show, setShow] = useState<boolean>(false)
|
|
64
98
|
|
|
99
|
+
// pending(取数窗口)镜像:插件 loading 态 ref + 上报。ref 供本组件内部
|
|
100
|
+
// (noOpSelectWhilePending 短路)同步读取;onPendingChangeRef 供消费方(composer
|
|
101
|
+
// keymap isPending)在插件派发时点同步镜像——回调写 ref 不经 React 渲染,
|
|
102
|
+
// 「插件派发 → keydown」之间必可见(审查 finding 1 的 ref 时效要求)。
|
|
103
|
+
// setPending 去重:仅在翻转时回调(onStart→onUpdate 的 loading:true 连发不重复上报)。
|
|
104
|
+
const pendingRef = useRef(false)
|
|
105
|
+
const onPendingChangeRef = useRef(onPendingChange)
|
|
106
|
+
onPendingChangeRef.current = onPendingChange
|
|
107
|
+
const setPending = useCallback((pending: boolean) => {
|
|
108
|
+
if (pendingRef.current === pending) return
|
|
109
|
+
pendingRef.current = pending
|
|
110
|
+
onPendingChangeRef.current?.(pending)
|
|
111
|
+
}, [])
|
|
112
|
+
|
|
65
113
|
// If later we want the floating stick to the position while browser is scrolling,
|
|
66
114
|
// we can uncomment this part and pass the getBoundingClientRect prop to FloatingElement instead of referenceElement.
|
|
67
115
|
// const [internalClientRect, setInternalClientRect] = useState<DOMRect | null>(
|
|
@@ -76,41 +124,80 @@ export const SuggestionMenu = ({
|
|
|
76
124
|
const [internalQuery, setInternalQuery] = useState<string>("")
|
|
77
125
|
const [, setInternalRange] = useState<Range | null>(null)
|
|
78
126
|
|
|
127
|
+
// 锚定模式(DSH 对标,2026-11-20 任务 A):"card-top" = 菜单钉在 anchorElement
|
|
128
|
+
//(输入框卡片根,如 InputGroup)上沿、与卡片同宽、不随光标移动——floating 配置
|
|
129
|
+
// 整体替换(placement top-start + offset 4 + 无 flip/shift 不翻转 + size 写
|
|
130
|
+
// maxHeight var 与同宽 width),floatingOptions 不生效;缺省 caret = 原配置原样
|
|
131
|
+
//(含 floatingOptions 透传,既有 6 消费方零变化)。锚 null/undefined 时回落
|
|
132
|
+
// caret 的 reference(decoration 节点)——use-floating-element 的 override 通道。
|
|
133
|
+
const cardTop = attachMode === "card-top"
|
|
134
|
+
|
|
79
135
|
const { ref, style, getFloatingProps, isMounted } = useFloatingElement(
|
|
80
136
|
show,
|
|
81
137
|
internalDecorationNode,
|
|
82
138
|
1000,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
139
|
+
cardTop
|
|
140
|
+
? {
|
|
141
|
+
placement: "top-start",
|
|
142
|
+
middleware: [
|
|
143
|
+
offset(4),
|
|
144
|
+
size({
|
|
145
|
+
apply({ availableHeight, rects, elements }) {
|
|
146
|
+
if (elements.floating) {
|
|
147
|
+
const maxHeightValue = maxHeight
|
|
148
|
+
? Math.min(maxHeight, availableHeight)
|
|
149
|
+
: availableHeight
|
|
150
|
+
|
|
151
|
+
elements.floating.style.setProperty(
|
|
152
|
+
"--suggestion-menu-max-height",
|
|
153
|
+
`${maxHeightValue}px`
|
|
154
|
+
)
|
|
155
|
+
// DSH 同宽(bottom: calc(100% + 4px) + left:0; right:0 的等价实现):
|
|
156
|
+
// width = 锚卡片宽,钉卡上沿不翻转不偏移
|
|
157
|
+
elements.floating.style.width = `${rects.reference.width}px`
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
}),
|
|
161
|
+
],
|
|
162
|
+
onOpenChange(open) {
|
|
163
|
+
if (!open) {
|
|
164
|
+
setShow(false)
|
|
103
165
|
}
|
|
104
166
|
},
|
|
105
|
-
}),
|
|
106
|
-
],
|
|
107
|
-
onOpenChange(open) {
|
|
108
|
-
if (!open) {
|
|
109
|
-
setShow(false)
|
|
110
167
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
168
|
+
: {
|
|
169
|
+
placement: "bottom-start",
|
|
170
|
+
middleware: [
|
|
171
|
+
offset(10),
|
|
172
|
+
flip({
|
|
173
|
+
mainAxis: true,
|
|
174
|
+
crossAxis: false,
|
|
175
|
+
}),
|
|
176
|
+
shift(),
|
|
177
|
+
size({
|
|
178
|
+
apply({ availableHeight, elements }) {
|
|
179
|
+
if (elements.floating) {
|
|
180
|
+
const maxHeightValue = maxHeight
|
|
181
|
+
? Math.min(maxHeight, availableHeight)
|
|
182
|
+
: availableHeight
|
|
183
|
+
|
|
184
|
+
elements.floating.style.setProperty(
|
|
185
|
+
"--suggestion-menu-max-height",
|
|
186
|
+
`${maxHeightValue}px`
|
|
187
|
+
)
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
}),
|
|
191
|
+
],
|
|
192
|
+
onOpenChange(open) {
|
|
193
|
+
if (!open) {
|
|
194
|
+
setShow(false)
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
...floatingOptions,
|
|
198
|
+
},
|
|
199
|
+
undefined,
|
|
200
|
+
cardTop ? (anchorElement ?? null) : undefined
|
|
114
201
|
)
|
|
115
202
|
|
|
116
203
|
const internalSuggestionPropsRef = useRef(internalSuggestionProps)
|
|
@@ -123,6 +210,13 @@ export const SuggestionMenu = ({
|
|
|
123
210
|
setShow(false)
|
|
124
211
|
}, [])
|
|
125
212
|
|
|
213
|
+
// disabled:菜单立即关闭(合成 allow=false 阻止后续触发,见 Suggestion() 的 allow 合成)
|
|
214
|
+
useEffect(() => {
|
|
215
|
+
if (disabled) {
|
|
216
|
+
closePopup()
|
|
217
|
+
}
|
|
218
|
+
}, [disabled, closePopup])
|
|
219
|
+
|
|
126
220
|
useEffect(() => {
|
|
127
221
|
if (!editor || editor.isDestroyed) {
|
|
128
222
|
return
|
|
@@ -189,25 +283,27 @@ export const SuggestionMenu = ({
|
|
|
189
283
|
}
|
|
190
284
|
}
|
|
191
285
|
|
|
286
|
+
// 内置 allow:image-caption 内不触发 slash(既有行为)。仅当消费方未传 allow
|
|
287
|
+
// 且未 disabled 时生效——见下方 Suggestion() 的 allow 合成。
|
|
288
|
+
const builtinAllow = (props: { range: { from: number } }): boolean => {
|
|
289
|
+
const $from = editor.state.doc.resolve(props.range.from)
|
|
290
|
+
|
|
291
|
+
// Check if we're inside an image node
|
|
292
|
+
for (let depth = $from.depth; depth > 0; depth--) {
|
|
293
|
+
if ($from.node(depth).type.name === "image") {
|
|
294
|
+
return false // Don't allow slash command inside image (since we support captions)
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
return true
|
|
299
|
+
}
|
|
300
|
+
|
|
192
301
|
const suggestion = Suggestion({
|
|
193
302
|
...mentionSuggestionDefaults,
|
|
194
303
|
pluginKey:
|
|
195
304
|
pluginKey instanceof PluginKey ? pluginKey : new PluginKey(pluginKey),
|
|
196
305
|
editor,
|
|
197
306
|
|
|
198
|
-
allow(props) {
|
|
199
|
-
const $from = editor.state.doc.resolve(props.range.from)
|
|
200
|
-
|
|
201
|
-
// Check if we're inside an image node
|
|
202
|
-
for (let depth = $from.depth; depth > 0; depth--) {
|
|
203
|
-
if ($from.node(depth).type.name === "image") {
|
|
204
|
-
return false // Don't allow slash command inside image (since we support captions)
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
return true
|
|
209
|
-
},
|
|
210
|
-
|
|
211
307
|
command({ editor, range, props }) {
|
|
212
308
|
if (!range) {
|
|
213
309
|
return
|
|
@@ -276,6 +372,9 @@ export const SuggestionMenu = ({
|
|
|
276
372
|
setInternalItems(props.items)
|
|
277
373
|
setInternalQuery(props.query)
|
|
278
374
|
setInternalRange(props.range)
|
|
375
|
+
// pending 上报(消费侧守卫配套):插件激活即 willFetch(@tiptap/suggestion
|
|
376
|
+
// dist:started 态 props.loading = willFetch),取数窗口自此开始
|
|
377
|
+
setPending(props.loading === true)
|
|
279
378
|
// setInternalClientRect(props.clientRect?.() ?? null)
|
|
280
379
|
setShow(true)
|
|
281
380
|
},
|
|
@@ -286,7 +385,16 @@ export const SuggestionMenu = ({
|
|
|
286
385
|
}
|
|
287
386
|
// keep last valid decorationNode to prevent floating position drift
|
|
288
387
|
setInternalCommand(() => props.command)
|
|
289
|
-
|
|
388
|
+
if (props.loading === true) {
|
|
389
|
+
// SWR(F5-6 批):fetch 进行中。此时 props.items 恒为 []
|
|
390
|
+
// (本组件不传 initialItems)→ 直接 set 会闪空。保留旧行留屏,
|
|
391
|
+
// 仅跳过 setItems;resolve 后(loading===false)的 onUpdate 再 setItems。
|
|
392
|
+
} else {
|
|
393
|
+
setInternalItems(props.items)
|
|
394
|
+
}
|
|
395
|
+
// pending 上报:resolve(loading:false)即窗口结束;setPending 去重,
|
|
396
|
+
// onStart→onUpdate 的 loading:true 连发不重复回调
|
|
397
|
+
setPending(props.loading === true)
|
|
290
398
|
setInternalQuery(props.query)
|
|
291
399
|
setInternalRange(props.range)
|
|
292
400
|
// setInternalClientRect(props.clientRect?.() ?? null)
|
|
@@ -306,35 +414,57 @@ export const SuggestionMenu = ({
|
|
|
306
414
|
setInternalItems([])
|
|
307
415
|
setInternalQuery("")
|
|
308
416
|
setInternalRange(null)
|
|
417
|
+
// pending 复位(finding 2 防搁浅):插件退出(Escape/dismiss/range 失活/
|
|
418
|
+
// state stopped)不再派发 loading:false 的 onUpdate,必须在此复位
|
|
419
|
+
setPending(false)
|
|
309
420
|
// setInternalClientRect(null)
|
|
310
421
|
setShow(false)
|
|
311
422
|
},
|
|
312
423
|
}
|
|
313
424
|
},
|
|
314
425
|
...internalSuggestionPropsRef.current,
|
|
426
|
+
// allow 合成(放在 spread 之后,优先级最高):
|
|
427
|
+
// - disabled=true → `() => false`(菜单不再触发;⚠ 整体替换内置 image-caption
|
|
428
|
+
// 检查与消费方 allow——composer 无 image 扩展无实害);
|
|
429
|
+
// - 否则消费方 allow(若传)优先,缺省回落内置 image-caption 检查(既有行为)。
|
|
430
|
+
allow: disabled
|
|
431
|
+
? () => false
|
|
432
|
+
: (internalSuggestionPropsRef.current.allow ?? builtinAllow),
|
|
315
433
|
})
|
|
316
434
|
|
|
317
435
|
editor.registerPlugin(suggestion)
|
|
318
436
|
|
|
319
437
|
return () => {
|
|
438
|
+
// pending 复位(finding 2 防搁浅):组件卸载 / 插件重注册时若仍处取数窗口
|
|
439
|
+
// (fetch 未 settle 即销毁),插件不会再派发 loading:false 或 onExit
|
|
440
|
+
setPending(false)
|
|
320
441
|
if (!editor.isDestroyed) {
|
|
321
442
|
editor.unregisterPlugin(pluginKey)
|
|
322
443
|
}
|
|
323
444
|
}
|
|
324
|
-
}, [editor, pluginKey, closePopup])
|
|
445
|
+
}, [editor, pluginKey, closePopup, disabled, setPending])
|
|
325
446
|
|
|
326
447
|
const onSelect = useCallback(
|
|
327
448
|
(item: SuggestionItem) => {
|
|
449
|
+
// pending no-op(消费侧守卫配套,整分支审查 finding 1 测试 ②):仅当消费方
|
|
450
|
+
// 显式启用 noOpSelectWhilePending(composer @ / '/' 两菜单)且处于取数窗口时
|
|
451
|
+
// 短路——不选中、菜单仍开(旧 T2 用例 2 语义:防选中与当前查询错位的旧行)。
|
|
452
|
+
// 缺省 undefined = 不短路——四通用消费方(emoji/mention/reference/slash)items
|
|
453
|
+
// 同步但仍走 asyncRequest.fetch 进入 pending 微任务窗口,凭 pending 一刀切短路
|
|
454
|
+
// 会吞掉它们「有候选 Enter 选中」(F5-6 批 finding 3,test 2/6 锁定)。
|
|
455
|
+
if (noOpSelectWhilePending && pendingRef.current) {
|
|
456
|
+
return
|
|
457
|
+
}
|
|
328
458
|
closePopup()
|
|
329
459
|
|
|
330
460
|
if (internalCommand) {
|
|
331
461
|
internalCommand(item)
|
|
332
462
|
}
|
|
333
463
|
},
|
|
334
|
-
[closePopup, internalCommand]
|
|
464
|
+
[closePopup, internalCommand, noOpSelectWhilePending]
|
|
335
465
|
)
|
|
336
466
|
|
|
337
|
-
const { selectedIndex } = useMenuNavigation({
|
|
467
|
+
const { selectedIndex, setSelectedIndex } = useMenuNavigation({
|
|
338
468
|
editor: editor,
|
|
339
469
|
query: internalQuery,
|
|
340
470
|
items: internalItems,
|
|
@@ -365,6 +495,7 @@ export const SuggestionMenu = ({
|
|
|
365
495
|
items: internalItems,
|
|
366
496
|
selectedIndex,
|
|
367
497
|
onSelect,
|
|
498
|
+
setSelectedIndex,
|
|
368
499
|
})}
|
|
369
500
|
</div>
|
|
370
501
|
)
|
|
@@ -112,8 +112,8 @@ export const SDK_GROUPS: SdkGroup[] = [
|
|
|
112
112
|
"items": [
|
|
113
113
|
{
|
|
114
114
|
"name": "@allbluecn/web-app",
|
|
115
|
-
"version": "v0.
|
|
116
|
-
"lastUpdate": "Nov
|
|
115
|
+
"version": "v0.28.0",
|
|
116
|
+
"lastUpdate": "Nov 21, 2026",
|
|
117
117
|
"source": "apps/web/package.json",
|
|
118
118
|
"docsUrl": "https://github.com/allbluecn/allblue"
|
|
119
119
|
},
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
|
+
// AllBlue - 理想之海
|
|
3
|
+
// Copyright (C) 2026 AllBlue Contributors
|
|
4
|
+
|
|
5
|
+
// 插件面板 queryOptions 工厂对账测试(T11 键对账):四工厂 queryKey 与旧面板
|
|
6
|
+
// (components/harness/extension-panel/panels/plugin-panel.tsx)内联字面量逐字
|
|
7
|
+
// 一致;queryFn 为函数即占位验证(真实查询行为由消费方任务端到端验证)。
|
|
8
|
+
|
|
9
|
+
import { describe, expect, it, vi } from 'vitest'
|
|
10
|
+
|
|
11
|
+
vi.mock('@/server/serverFns/harness/plugins', () => ({
|
|
12
|
+
getHarnessPluginReportFn: vi.fn().mockResolvedValue({}),
|
|
13
|
+
}))
|
|
14
|
+
vi.mock('@/server/serverFns/harness/dsh-plugins', () => ({
|
|
15
|
+
getDshInstalledFn: vi.fn().mockResolvedValue([]),
|
|
16
|
+
getDshPendingBuildsFn: vi.fn().mockResolvedValue([]),
|
|
17
|
+
}))
|
|
18
|
+
vi.mock('@/server/serverFns/plugins/harness-plugins', () => ({
|
|
19
|
+
listPluginsFn: vi.fn().mockResolvedValue([]),
|
|
20
|
+
}))
|
|
21
|
+
|
|
22
|
+
import {
|
|
23
|
+
DSH_INSTALLED_QUERY_KEY,
|
|
24
|
+
DSH_PENDING_BUILDS_QUERY_KEY,
|
|
25
|
+
HARNESS_PLUGIN_REPORT_QUERY_KEY,
|
|
26
|
+
HARNESS_WORKER_PLUGINS_QUERY_KEY,
|
|
27
|
+
dshInstalledQueryOptions,
|
|
28
|
+
dshPendingBuildsQueryOptions,
|
|
29
|
+
harnessPluginReportQueryOptions,
|
|
30
|
+
harnessWorkerPluginsQueryOptions,
|
|
31
|
+
} from '../harness'
|
|
32
|
+
|
|
33
|
+
describe('harness 插件查询工厂(T11 键对账)', () => {
|
|
34
|
+
it('四工厂 queryKey 与旧面板内联字面量逐字一致', () => {
|
|
35
|
+
expect(harnessPluginReportQueryOptions().queryKey).toEqual(['harness-plugin-report'])
|
|
36
|
+
expect(dshInstalledQueryOptions().queryKey).toEqual(['harness-dsh-installed'])
|
|
37
|
+
expect(dshPendingBuildsQueryOptions().queryKey).toEqual(['harness-dsh-pending-builds'])
|
|
38
|
+
expect(harnessWorkerPluginsQueryOptions().queryKey).toEqual(['harness-plugins'])
|
|
39
|
+
expect(HARNESS_PLUGIN_REPORT_QUERY_KEY).toEqual(['harness-plugin-report'])
|
|
40
|
+
expect(DSH_INSTALLED_QUERY_KEY).toEqual(['harness-dsh-installed'])
|
|
41
|
+
expect(DSH_PENDING_BUILDS_QUERY_KEY).toEqual(['harness-dsh-pending-builds'])
|
|
42
|
+
expect(HARNESS_WORKER_PLUGINS_QUERY_KEY).toEqual(['harness-plugins'])
|
|
43
|
+
})
|
|
44
|
+
it('四工厂 queryFn 均为函数', () => {
|
|
45
|
+
for (const o of [harnessPluginReportQueryOptions(), dshInstalledQueryOptions(), dshPendingBuildsQueryOptions(), harnessWorkerPluginsQueryOptions()]) {
|
|
46
|
+
expect(typeof o.queryFn).toBe('function')
|
|
47
|
+
}
|
|
48
|
+
})
|
|
49
|
+
})
|
|
@@ -10,6 +10,9 @@ import { listHarnessWorkspacesWithThreadsFn } from '@/server/serverFns/harness/w
|
|
|
10
10
|
import { listThreadWorkspaceDirFn } from '@/server/serverFns/harness/thread-workspace-files'
|
|
11
11
|
import { searchThreadWorkspaceFilesFn } from '@/server/serverFns/harness/thread-workspace-search'
|
|
12
12
|
import { getWorkspaceRootStatusFn } from '@/server/serverFns/harness/workspace-threads'
|
|
13
|
+
import { getHarnessPluginReportFn } from '@/server/serverFns/harness/plugins'
|
|
14
|
+
import { getDshInstalledFn, getDshPendingBuildsFn } from '@/server/serverFns/harness/dsh-plugins'
|
|
15
|
+
import { listPluginsFn } from '@/server/serverFns/plugins/harness-plugins'
|
|
13
16
|
|
|
14
17
|
export const HARNESS_WORKSPACES_QUERY_KEY = ['harness-workspaces'] as const
|
|
15
18
|
|
|
@@ -98,3 +101,50 @@ export const threadWorkspaceSearchQueryOptions = (
|
|
|
98
101
|
},
|
|
99
102
|
}),
|
|
100
103
|
})
|
|
104
|
+
|
|
105
|
+
// ── 插件面板查询(原 extension-panel/panels/plugin-panel.tsx 内联键迁移,T11)──
|
|
106
|
+
// 消费方(插件面板页 / InstallDialog / invalidate)一律从本模块取,禁止再写
|
|
107
|
+
// ['harness-plugin-report'] 等内联字面量。键对账测试见 __tests__/harness-plugin-queries.test.ts。
|
|
108
|
+
|
|
109
|
+
/** 内置插件组装诊断报告 query key。 */
|
|
110
|
+
export const HARNESS_PLUGIN_REPORT_QUERY_KEY = ['harness-plugin-report'] as const
|
|
111
|
+
|
|
112
|
+
/** 内置插件组装诊断报告(F2-4 插件面板 tab 数据源)。 */
|
|
113
|
+
export const harnessPluginReportQueryOptions = () =>
|
|
114
|
+
queryOptions({
|
|
115
|
+
queryKey: HARNESS_PLUGIN_REPORT_QUERY_KEY,
|
|
116
|
+
queryFn: () => getHarnessPluginReportFn(),
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
/** DSH 已安装插件列表 query key。 */
|
|
120
|
+
export const DSH_INSTALLED_QUERY_KEY = ['harness-dsh-installed'] as const
|
|
121
|
+
|
|
122
|
+
/** DSH 已安装插件列表。 */
|
|
123
|
+
export const dshInstalledQueryOptions = () =>
|
|
124
|
+
queryOptions({
|
|
125
|
+
queryKey: DSH_INSTALLED_QUERY_KEY,
|
|
126
|
+
queryFn: () => getDshInstalledFn(),
|
|
127
|
+
})
|
|
128
|
+
|
|
129
|
+
/** DSH 待构建列表 query key。 */
|
|
130
|
+
export const DSH_PENDING_BUILDS_QUERY_KEY = ['harness-dsh-pending-builds'] as const
|
|
131
|
+
|
|
132
|
+
/** DSH 待构建列表。 */
|
|
133
|
+
export const dshPendingBuildsQueryOptions = () =>
|
|
134
|
+
queryOptions({
|
|
135
|
+
queryKey: DSH_PENDING_BUILDS_QUERY_KEY,
|
|
136
|
+
queryFn: () => getDshPendingBuildsFn(),
|
|
137
|
+
})
|
|
138
|
+
|
|
139
|
+
/** user-Worker 插件列表 query key。 */
|
|
140
|
+
export const HARNESS_WORKER_PLUGINS_QUERY_KEY = ['harness-plugins'] as const
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* user-Worker 插件列表。queryFn 返回原始列表,旧面板的 toPluginTools 收窄
|
|
144
|
+
* 留给消费方做(不收窄入 queryFn,避免 key/fn 与视图耦合)。
|
|
145
|
+
*/
|
|
146
|
+
export const harnessWorkerPluginsQueryOptions = () =>
|
|
147
|
+
queryOptions({
|
|
148
|
+
queryKey: HARNESS_WORKER_PLUGINS_QUERY_KEY,
|
|
149
|
+
queryFn: () => listPluginsFn(),
|
|
150
|
+
})
|