@allbluecn/web-app 0.27.40 → 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/browser/__tests__/webview-frame.test.tsx +5 -2
- 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/routeTree.gen.ts +31 -0
- 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
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
|
+
// AllBlue - 理想之海
|
|
3
|
+
// Copyright (C) 2026 AllBlue Contributors
|
|
4
|
+
|
|
5
|
+
// PluginPage 插件页本体(设计 §3,任务 4 骨架 + 任务 5 Section A 真实化 + 任务 6
|
|
6
|
+
// Section C 真实化):单页纵向分组的插件管理面,替代旧三 Tabs 面板的页面层。三分组
|
|
7
|
+
// 构成(渲染顺序 §7 顺序钉子),各 Section 已拆至同目录同名文件(本文件只留页级装配):
|
|
8
|
+
// PendingBuildsBlock(PRE-3 构建脚本审批,迁旧面板 DshTab 常驻块)→ pending-builds-block.tsx
|
|
9
|
+
// → InstalledSection(Section A:DSH 兼容已装插件)→ installed-section.tsx
|
|
10
|
+
// → BuiltinSection(Section B:内置七域启停 + 组装诊断)→ builtin-section.tsx
|
|
11
|
+
// → WorkerSection(Section C:用户 Worker 插件)→ worker-section.tsx
|
|
12
|
+
// 共享类型 HarnessReport → plugin-types.ts
|
|
13
|
+
// 页头:标题/副标题/ⓘ Tooltip + 刷新(四查询 isFetching OR)/ 添加插件(InstallDialog,
|
|
14
|
+
// blockedBuilds 上抛由页级 PRE-3 批准链接管)/ 关闭。
|
|
15
|
+
//
|
|
16
|
+
// 数据:零 serverFn 定义(只消费);四查询全部走 lib/queries/harness 工厂(T11)。
|
|
17
|
+
// canManage 页面级单一来源 = report DTO(getHarnessPluginReportFn 的云端管理员判定),
|
|
18
|
+
// 与 getDshInstalledFn 的 canManageDsh 同语义(!cloudHost || ADMIN/SUPER_ADMIN,已核对
|
|
19
|
+
// 两处实现一致)——Section B 开关、Section A 行控件禁用态、InstallDialog、PRE-3 批准
|
|
20
|
+
// 入口统一消费它。
|
|
21
|
+
|
|
22
|
+
import { useState } from "react"
|
|
23
|
+
import type { ReactElement } from "react"
|
|
24
|
+
import { Info, Plus, RefreshCw, X } from "lucide-react"
|
|
25
|
+
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"
|
|
26
|
+
import { cn } from "cn"
|
|
27
|
+
import {
|
|
28
|
+
AlertDialog,
|
|
29
|
+
AlertDialogAction,
|
|
30
|
+
AlertDialogCancel,
|
|
31
|
+
AlertDialogContent,
|
|
32
|
+
AlertDialogDescription,
|
|
33
|
+
AlertDialogFooter,
|
|
34
|
+
AlertDialogHeader,
|
|
35
|
+
AlertDialogTitle,
|
|
36
|
+
} from "@/components/ui/alert-dialog"
|
|
37
|
+
import { Button } from "@/components/ui/button"
|
|
38
|
+
import { Skeleton } from "@/components/ui/skeleton"
|
|
39
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip"
|
|
40
|
+
import {
|
|
41
|
+
DSH_INSTALLED_QUERY_KEY,
|
|
42
|
+
DSH_PENDING_BUILDS_QUERY_KEY,
|
|
43
|
+
HARNESS_PLUGIN_REPORT_QUERY_KEY,
|
|
44
|
+
HARNESS_WORKER_PLUGINS_QUERY_KEY,
|
|
45
|
+
dshInstalledQueryOptions,
|
|
46
|
+
dshPendingBuildsQueryOptions,
|
|
47
|
+
harnessPluginReportQueryOptions,
|
|
48
|
+
harnessWorkerPluginsQueryOptions,
|
|
49
|
+
} from "@/lib/queries/harness"
|
|
50
|
+
import { approveDshBuildsFn } from "@/server/serverFns/harness/dsh-plugins"
|
|
51
|
+
import { InstallDialog } from "./install-dialog"
|
|
52
|
+
import { m } from "@/paraglide/messages.js"
|
|
53
|
+
import { PendingBuildsBlock } from "./pending-builds-block"
|
|
54
|
+
import { InstalledSection } from "./installed-section"
|
|
55
|
+
import { BuiltinSection } from "./builtin-section"
|
|
56
|
+
import { WorkerSection } from "./worker-section"
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* 插件页(任务 7 接线后由 kind.tsx 消费,替换旧 PluginPanel)。
|
|
60
|
+
* 页面级容错:四查询任一 isLoading → Section 级 skeleton(页身整段替换);任一 isError
|
|
61
|
+
* → 错误卡 + 其余组照常渲染(组级容错,report 缺数据时 Section B 整组不渲染)。
|
|
62
|
+
*/
|
|
63
|
+
export function PluginPage({ onClose }: { onClose: () => void }): ReactElement {
|
|
64
|
+
const queryClient = useQueryClient()
|
|
65
|
+
const [installOpen, setInstallOpen] = useState(false)
|
|
66
|
+
// 安装/批准返回的非空 blockedBuilds → PRE-3 二次批准 AlertDialog(迁旧面板 state)
|
|
67
|
+
const [pendingApproval, setPendingApproval] = useState<string[] | null>(null)
|
|
68
|
+
|
|
69
|
+
const reportQuery = useQuery(harnessPluginReportQueryOptions())
|
|
70
|
+
const installedQuery = useQuery(dshInstalledQueryOptions())
|
|
71
|
+
const pendingBuildsQuery = useQuery(dshPendingBuildsQueryOptions())
|
|
72
|
+
const workerQuery = useQuery(harnessWorkerPluginsQueryOptions())
|
|
73
|
+
|
|
74
|
+
// 页面级 canManage 单一来源(语义核对见文件头注释)
|
|
75
|
+
const canManage = reportQuery.data?.canManage ?? false
|
|
76
|
+
const pendingBuilds = pendingBuildsQuery.data?.pending
|
|
77
|
+
|
|
78
|
+
const isRefreshing =
|
|
79
|
+
reportQuery.isFetching ||
|
|
80
|
+
installedQuery.isFetching ||
|
|
81
|
+
pendingBuildsQuery.isFetching ||
|
|
82
|
+
workerQuery.isFetching
|
|
83
|
+
const isLoading =
|
|
84
|
+
reportQuery.isLoading ||
|
|
85
|
+
installedQuery.isLoading ||
|
|
86
|
+
pendingBuildsQuery.isLoading ||
|
|
87
|
+
workerQuery.isLoading
|
|
88
|
+
const isError =
|
|
89
|
+
reportQuery.isError ||
|
|
90
|
+
installedQuery.isError ||
|
|
91
|
+
pendingBuildsQuery.isError ||
|
|
92
|
+
workerQuery.isError
|
|
93
|
+
|
|
94
|
+
const refresh = () => {
|
|
95
|
+
queryClient.invalidateQueries({ queryKey: HARNESS_PLUGIN_REPORT_QUERY_KEY })
|
|
96
|
+
queryClient.invalidateQueries({ queryKey: DSH_INSTALLED_QUERY_KEY })
|
|
97
|
+
queryClient.invalidateQueries({ queryKey: DSH_PENDING_BUILDS_QUERY_KEY })
|
|
98
|
+
queryClient.invalidateQueries({ queryKey: HARNESS_WORKER_PLUGINS_QUERY_KEY })
|
|
99
|
+
}
|
|
100
|
+
const retryAll = () => {
|
|
101
|
+
void reportQuery.refetch()
|
|
102
|
+
void installedQuery.refetch()
|
|
103
|
+
void pendingBuildsQuery.refetch()
|
|
104
|
+
void workerQuery.refetch()
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const approveMutation = useMutation({
|
|
108
|
+
mutationFn: (names: string[]) => approveDshBuildsFn({ data: { names } }),
|
|
109
|
+
onSuccess: () => {
|
|
110
|
+
setPendingApproval(null)
|
|
111
|
+
queryClient.invalidateQueries({ queryKey: DSH_PENDING_BUILDS_QUERY_KEY })
|
|
112
|
+
queryClient.invalidateQueries({ queryKey: DSH_INSTALLED_QUERY_KEY })
|
|
113
|
+
queryClient.invalidateQueries({ queryKey: HARNESS_PLUGIN_REPORT_QUERY_KEY })
|
|
114
|
+
},
|
|
115
|
+
})
|
|
116
|
+
|
|
117
|
+
return (
|
|
118
|
+
<div className="flex h-full min-h-0 flex-col">
|
|
119
|
+
{/* 页头(设计 §3.2):左标题区 / 右操作簇 */}
|
|
120
|
+
<header className="flex items-start justify-between gap-2 border-b p-3">
|
|
121
|
+
<div className="flex min-w-0 flex-col gap-1">
|
|
122
|
+
<h2 className="text-lg font-semibold">{m.harness_panel_plugin_title()}</h2>
|
|
123
|
+
<div className="flex items-center gap-1">
|
|
124
|
+
<p className="text-xs text-muted-foreground">
|
|
125
|
+
{m.harness_panel_plugin_subtitle()}
|
|
126
|
+
</p>
|
|
127
|
+
<Tooltip>
|
|
128
|
+
{/* ⓘ 图标钮(无可见文本 → aria-label 即 Tooltip 文案) */}
|
|
129
|
+
<TooltipTrigger
|
|
130
|
+
render={
|
|
131
|
+
<Button
|
|
132
|
+
variant="ghost"
|
|
133
|
+
size="icon"
|
|
134
|
+
className="size-6 text-muted-foreground"
|
|
135
|
+
aria-label={m.harness_panel_plugin_tooltip()}
|
|
136
|
+
/>
|
|
137
|
+
}
|
|
138
|
+
>
|
|
139
|
+
<Info className="size-3.5" />
|
|
140
|
+
</TooltipTrigger>
|
|
141
|
+
<TooltipContent>{m.harness_panel_plugin_tooltip()}</TooltipContent>
|
|
142
|
+
</Tooltip>
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
<div className="flex shrink-0 items-center gap-1.5">
|
|
146
|
+
<Button variant="outline" size="sm" disabled={isRefreshing} onClick={refresh}>
|
|
147
|
+
<RefreshCw className={cn("size-3.5", isRefreshing && "animate-spin")} />
|
|
148
|
+
{m.harness_panel_plugin_refresh()}
|
|
149
|
+
</Button>
|
|
150
|
+
<Button size="sm" onClick={() => setInstallOpen(true)}>
|
|
151
|
+
<Plus className="size-3.5" />
|
|
152
|
+
{m.harness_panel_plugin_add()}
|
|
153
|
+
</Button>
|
|
154
|
+
{/* 关闭钮规格化为 X(旧面板是 ChevronDown,规格 §3 未钉图标) */}
|
|
155
|
+
<Button
|
|
156
|
+
variant="ghost"
|
|
157
|
+
size="icon"
|
|
158
|
+
className="size-7"
|
|
159
|
+
aria-label={m.common_button_close()}
|
|
160
|
+
onClick={onClose}
|
|
161
|
+
>
|
|
162
|
+
<X className="size-4" />
|
|
163
|
+
</Button>
|
|
164
|
+
</div>
|
|
165
|
+
</header>
|
|
166
|
+
|
|
167
|
+
<div className="min-h-0 flex-1 overflow-y-auto p-3">
|
|
168
|
+
{isLoading ? (
|
|
169
|
+
<div className="space-y-3" aria-busy="true">
|
|
170
|
+
<span className="sr-only">{m.harness_panel_plugin_loading()}</span>
|
|
171
|
+
<Skeleton className="h-8 w-full" />
|
|
172
|
+
<Skeleton className="h-20 w-full" />
|
|
173
|
+
<Skeleton className="h-20 w-full" />
|
|
174
|
+
<Skeleton className="h-20 w-full" />
|
|
175
|
+
<Skeleton className="h-20 w-full" />
|
|
176
|
+
</div>
|
|
177
|
+
) : (
|
|
178
|
+
<div className="space-y-4">
|
|
179
|
+
{/* 页面级错误卡(任一查询 error;不阻断其余组渲染) */}
|
|
180
|
+
{isError && (
|
|
181
|
+
<div className="flex items-center justify-between gap-2 rounded-md border border-red-500/40 bg-red-500/5 p-2">
|
|
182
|
+
<p className="text-xs text-red-500">{m.harness_panel_plugin_error()}</p>
|
|
183
|
+
<Button size="sm" variant="outline" className="h-7" onClick={retryAll}>
|
|
184
|
+
{m.common_button_retry()}
|
|
185
|
+
</Button>
|
|
186
|
+
</div>
|
|
187
|
+
)}
|
|
188
|
+
|
|
189
|
+
{/* PRE-3 常驻块:pending 非空才渲染(迁旧面板,逻辑不变) */}
|
|
190
|
+
{pendingBuilds && pendingBuilds.length > 0 && (
|
|
191
|
+
<PendingBuildsBlock
|
|
192
|
+
pending={pendingBuilds}
|
|
193
|
+
canManage={canManage}
|
|
194
|
+
approving={approveMutation.isPending}
|
|
195
|
+
onApprove={() => setPendingApproval(pendingBuilds)}
|
|
196
|
+
/>
|
|
197
|
+
)}
|
|
198
|
+
|
|
199
|
+
<InstalledSection
|
|
200
|
+
installed={installedQuery.data?.installed ?? []}
|
|
201
|
+
report={reportQuery.data?.report}
|
|
202
|
+
canManage={canManage}
|
|
203
|
+
onBlockedBuilds={setPendingApproval}
|
|
204
|
+
/>
|
|
205
|
+
{reportQuery.data && (
|
|
206
|
+
<BuiltinSection report={reportQuery.data.report} canManage={canManage} />
|
|
207
|
+
)}
|
|
208
|
+
<WorkerSection />
|
|
209
|
+
</div>
|
|
210
|
+
)}
|
|
211
|
+
</div>
|
|
212
|
+
|
|
213
|
+
{/* 添加插件对话框(任务 3):blockedBuilds 非空上抛 → 页级 PRE-3 批准链接管 */}
|
|
214
|
+
<InstallDialog
|
|
215
|
+
open={installOpen}
|
|
216
|
+
onOpenChange={setInstallOpen}
|
|
217
|
+
canManage={canManage}
|
|
218
|
+
onBlockedBuilds={setPendingApproval}
|
|
219
|
+
/>
|
|
220
|
+
|
|
221
|
+
{/* PRE-3 构建脚本二次批准(迁旧面板 L729-758,逻辑不变) */}
|
|
222
|
+
<AlertDialog
|
|
223
|
+
open={pendingApproval !== null}
|
|
224
|
+
onOpenChange={(open) => {
|
|
225
|
+
if (!open) setPendingApproval(null)
|
|
226
|
+
}}
|
|
227
|
+
>
|
|
228
|
+
<AlertDialogContent>
|
|
229
|
+
<AlertDialogHeader>
|
|
230
|
+
<AlertDialogTitle>{m.harness_plugin_dshApproveTitle()}</AlertDialogTitle>
|
|
231
|
+
<AlertDialogDescription>
|
|
232
|
+
{m.harness_plugin_dshPendingDescription()}
|
|
233
|
+
</AlertDialogDescription>
|
|
234
|
+
</AlertDialogHeader>
|
|
235
|
+
<ul className="mb-2 max-h-32 space-y-0.5 overflow-y-auto">
|
|
236
|
+
{(pendingApproval ?? []).map((name) => (
|
|
237
|
+
<li key={name} className="font-mono text-xs">
|
|
238
|
+
{name}
|
|
239
|
+
</li>
|
|
240
|
+
))}
|
|
241
|
+
</ul>
|
|
242
|
+
<AlertDialogFooter>
|
|
243
|
+
<AlertDialogCancel onClick={() => setPendingApproval(null)}>
|
|
244
|
+
{m.harness_plugin_dshApproveCancel()}
|
|
245
|
+
</AlertDialogCancel>
|
|
246
|
+
<AlertDialogAction
|
|
247
|
+
disabled={approveMutation.isPending}
|
|
248
|
+
onClick={() => approveMutation.mutate(pendingApproval ?? [])}
|
|
249
|
+
>
|
|
250
|
+
{m.harness_plugin_dshApproveAction()}
|
|
251
|
+
</AlertDialogAction>
|
|
252
|
+
</AlertDialogFooter>
|
|
253
|
+
</AlertDialogContent>
|
|
254
|
+
</AlertDialog>
|
|
255
|
+
</div>
|
|
256
|
+
)
|
|
257
|
+
}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
|
+
// AllBlue - 理想之海
|
|
3
|
+
// Copyright (C) 2026 AllBlue Contributors
|
|
4
|
+
//
|
|
5
|
+
// This program is free software: you can redistribute it and/or modify
|
|
6
|
+
// it under the terms of the GNU Affero General Public License as published by
|
|
7
|
+
// the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
// (at your option) any later version.
|
|
9
|
+
//
|
|
10
|
+
// This program is distributed in the hope that it will be useful,
|
|
11
|
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
// GNU Affero General Public License for more details.
|
|
14
|
+
//
|
|
15
|
+
// You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
|
+
|
|
18
|
+
// PluginRow 统一行组件(设计 §3.1):已安装 / 内置 / Worker 三组共用行 + 五态状态点。
|
|
19
|
+
// 布局契约(类名逐字)与 props 接口来自实现计划任务 2,任务 4/5/6 的三个 Section 消费。
|
|
20
|
+
// 状态点 Tooltip 文案渲染期求值(惰性,防模块级固化语言),不在模块顶层缓存 m.*() 结果。
|
|
21
|
+
|
|
22
|
+
import type { ReactElement, ReactNode } from "react"
|
|
23
|
+
import { ChevronDown } from "lucide-react"
|
|
24
|
+
import { cn } from "cn"
|
|
25
|
+
import { Switch } from "@/components/ui/switch"
|
|
26
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip"
|
|
27
|
+
import { m } from "@/paraglide/messages.js"
|
|
28
|
+
|
|
29
|
+
/** 插件行五态(对齐 plugin-panel.tsx dshActivationStatus 归桶返回值,设计 §3.1)。 */
|
|
30
|
+
export type PluginStatus = "activated" | "failed" | "deactivated" | "disabled" | "unknown"
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* 五态状态点类映射:disabled 空心(border 圆点自定),其余实色;一律语义类,暗黑可用。
|
|
34
|
+
* (激活/失败的徽标底色变体 bg-green-500/20 系由各 Section 的 badges 槽自行组合,非状态点职责。)
|
|
35
|
+
*/
|
|
36
|
+
const STATUS_DOT_CLASS: Record<PluginStatus, string> = {
|
|
37
|
+
activated: "bg-green-500",
|
|
38
|
+
failed: "bg-red-500",
|
|
39
|
+
deactivated: "bg-muted-foreground",
|
|
40
|
+
disabled: "border border-border bg-transparent",
|
|
41
|
+
unknown: "bg-muted-foreground",
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** 五态 Tooltip 状态文案(惰性求值:渲染期调用,不在模块顶层固化语言)。 */
|
|
45
|
+
const STATUS_DOT_LABEL: Record<PluginStatus, () => string> = {
|
|
46
|
+
activated: () => m.harness_plugin_dshStatusActivated(),
|
|
47
|
+
failed: () => m.harness_plugin_dshStatusFailed(),
|
|
48
|
+
deactivated: () => m.harness_plugin_dshStatusDeactivated(),
|
|
49
|
+
disabled: () => m.harness_plugin_dshStatusDisabled(),
|
|
50
|
+
unknown: () => m.harness_plugin_dshStatusUnknown(),
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** 状态点:size-2 rounded-full + Tooltip(五态状态文案;unknown 额外追加组装期不一致说明)。 */
|
|
54
|
+
export function PluginStatusDot({
|
|
55
|
+
status,
|
|
56
|
+
className,
|
|
57
|
+
}: {
|
|
58
|
+
status: PluginStatus
|
|
59
|
+
className?: string
|
|
60
|
+
}): ReactElement {
|
|
61
|
+
const label = STATUS_DOT_LABEL[status]()
|
|
62
|
+
const content =
|
|
63
|
+
status === "unknown" ? `${label}:${m.harness_panel_plugin_unknown_tooltip()}` : label
|
|
64
|
+
return (
|
|
65
|
+
<Tooltip>
|
|
66
|
+
{/* 状态点本体即触发器(span 非交互元素,避免默认 button 嵌套行点击语义);
|
|
67
|
+
aria-label 让屏幕阅读器读到状态文案(否则状态仅存于 hover Tooltip,AT 不可达) */}
|
|
68
|
+
<TooltipTrigger
|
|
69
|
+
render={
|
|
70
|
+
<span
|
|
71
|
+
data-testid="plugin-status-dot"
|
|
72
|
+
aria-label={content}
|
|
73
|
+
className={cn(
|
|
74
|
+
"inline-block size-2 rounded-full",
|
|
75
|
+
STATUS_DOT_CLASS[status],
|
|
76
|
+
className,
|
|
77
|
+
)}
|
|
78
|
+
/>
|
|
79
|
+
}
|
|
80
|
+
/>
|
|
81
|
+
<TooltipContent>{content}</TooltipContent>
|
|
82
|
+
</Tooltip>
|
|
83
|
+
)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface PluginRowProps {
|
|
87
|
+
/** 48px 容器内图标(容器 size-12 rounded-xl bg-muted)。 */
|
|
88
|
+
icon: ReactNode
|
|
89
|
+
title: string
|
|
90
|
+
/** 标题右侧徽标(v{version} / 状态徽标 / 实验性等,Slot 自由组合)。 */
|
|
91
|
+
badges?: ReactNode
|
|
92
|
+
/** 一行 truncate;溢出 Tooltip 显全文(设计 §3.1)。 */
|
|
93
|
+
description?: string
|
|
94
|
+
/** 可选第二行(来源 · 版本 · 状态点)。 */
|
|
95
|
+
meta?: ReactNode
|
|
96
|
+
/** 启停开关(Base UI Switch;onCheckedChange 双参签名在组件内归一为单参 boolean)。 */
|
|
97
|
+
switch?: { checked: boolean; disabled?: boolean; onCheckedChange: (checked: boolean) => void }
|
|
98
|
+
/** ⋯ DropdownMenu 等行尾菜单节点。 */
|
|
99
|
+
menu?: ReactNode
|
|
100
|
+
/** 展开内容;有值时行点击切换展开(chevron 指示,受控)。 */
|
|
101
|
+
detail?: ReactNode
|
|
102
|
+
/** 受控展开态(detail 存在时生效)。 */
|
|
103
|
+
expanded?: boolean
|
|
104
|
+
onExpandedChange?: (v: boolean) => void
|
|
105
|
+
testId?: string
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* 统一行组件:icon + 标题/徽标/描述/meta + 行尾 switch/menu。
|
|
110
|
+
* 行尾控件区整体 stopPropagation——Base UI Switch / DropdownMenu 的点击不冒泡触发行点击展开。
|
|
111
|
+
*/
|
|
112
|
+
export function PluginRow(props: PluginRowProps): ReactElement {
|
|
113
|
+
const {
|
|
114
|
+
icon,
|
|
115
|
+
title,
|
|
116
|
+
badges,
|
|
117
|
+
description,
|
|
118
|
+
meta,
|
|
119
|
+
switch: switchSlot,
|
|
120
|
+
menu,
|
|
121
|
+
detail,
|
|
122
|
+
expanded = false,
|
|
123
|
+
onExpandedChange,
|
|
124
|
+
testId,
|
|
125
|
+
} = props
|
|
126
|
+
const hasDetail = detail != null
|
|
127
|
+
return (
|
|
128
|
+
<div
|
|
129
|
+
data-testid={testId}
|
|
130
|
+
className={cn(
|
|
131
|
+
"group w-full rounded-lg px-3 py-2.5 transition-colors hover:bg-muted/50",
|
|
132
|
+
hasDetail && "cursor-pointer",
|
|
133
|
+
)}
|
|
134
|
+
// 键盘可达(a11y):detail 行以 role=button + tabIndex 参与 таб序,Enter/Space 切换展开,
|
|
135
|
+
// 与鼠标 onClick 同语义。无 detail 的行不参与(本就无交互)。
|
|
136
|
+
role={hasDetail ? "button" : undefined}
|
|
137
|
+
tabIndex={hasDetail ? 0 : undefined}
|
|
138
|
+
onClick={hasDetail ? () => onExpandedChange?.(!expanded) : undefined}
|
|
139
|
+
onKeyDown={
|
|
140
|
+
hasDetail
|
|
141
|
+
? (e) => {
|
|
142
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
143
|
+
e.preventDefault()
|
|
144
|
+
onExpandedChange?.(!expanded)
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
: undefined
|
|
148
|
+
}
|
|
149
|
+
>
|
|
150
|
+
{/* 行主行(icon + 标题/徽标/描述/meta + 行尾控件):任务 2 布局契约的 `flex items-center
|
|
151
|
+
gap-3` 原样落在此内层容器——根容器升为 flex-col 是为承载展开态 detail(任务 6 Worker
|
|
152
|
+
组 tools/lastError),折叠态视觉与原单行完全一致。detail 存在时整行可点切换展开。 */}
|
|
153
|
+
<div className="flex w-full items-center gap-3">
|
|
154
|
+
{hasDetail && (
|
|
155
|
+
<ChevronDown
|
|
156
|
+
className={cn(
|
|
157
|
+
"size-4 shrink-0 text-muted-foreground transition-transform",
|
|
158
|
+
expanded ? "rotate-0" : "-rotate-90",
|
|
159
|
+
)}
|
|
160
|
+
/>
|
|
161
|
+
)}
|
|
162
|
+
<div className="flex size-12 shrink-0 items-center justify-center rounded-xl bg-muted">
|
|
163
|
+
{icon}
|
|
164
|
+
</div>
|
|
165
|
+
<div className="flex min-w-0 flex-1 flex-col gap-0.5">
|
|
166
|
+
<div className="flex min-w-0 items-center gap-2">
|
|
167
|
+
<span className="truncate text-sm font-medium">{title}</span>
|
|
168
|
+
{badges}
|
|
169
|
+
</div>
|
|
170
|
+
{description && (
|
|
171
|
+
<Tooltip>
|
|
172
|
+
{/* 描述 span 本身即触发器(guide-page 卡片同款 render 模式);全文在悬浮层 */}
|
|
173
|
+
<TooltipTrigger
|
|
174
|
+
render={<span className="block truncate text-xs text-muted-foreground" />}
|
|
175
|
+
>
|
|
176
|
+
{description}
|
|
177
|
+
</TooltipTrigger>
|
|
178
|
+
<TooltipContent>{description}</TooltipContent>
|
|
179
|
+
</Tooltip>
|
|
180
|
+
)}
|
|
181
|
+
{meta}
|
|
182
|
+
</div>
|
|
183
|
+
{(switchSlot || menu) && (
|
|
184
|
+
<div
|
|
185
|
+
className="ml-auto flex shrink-0 items-center gap-2"
|
|
186
|
+
onClick={(e) => e.stopPropagation()}
|
|
187
|
+
>
|
|
188
|
+
{switchSlot && (
|
|
189
|
+
<Switch
|
|
190
|
+
checked={switchSlot.checked}
|
|
191
|
+
disabled={switchSlot.disabled}
|
|
192
|
+
onCheckedChange={(checked) => switchSlot.onCheckedChange(checked === true)}
|
|
193
|
+
/>
|
|
194
|
+
)}
|
|
195
|
+
{menu}
|
|
196
|
+
</div>
|
|
197
|
+
)}
|
|
198
|
+
</div>
|
|
199
|
+
{/* 展开态内容:受控 expanded=true 才渲染(调用方持有展开态,组件内零 state,任务 2 契约)。
|
|
200
|
+
Worker 组 detail=tools 清单 + lastError 红字;已装/内置组 detail 同理随各自 Section 落地。 */}
|
|
201
|
+
{expanded && hasDetail && (
|
|
202
|
+
<div className="mt-2 w-full space-y-1 border-t pt-2">{detail}</div>
|
|
203
|
+
)}
|
|
204
|
+
</div>
|
|
205
|
+
)
|
|
206
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
|
+
// AllBlue - 理想之海
|
|
3
|
+
// Copyright (C) 2026 AllBlue Contributors
|
|
4
|
+
|
|
5
|
+
// 插件页共享类型单一来源:HarnessReport(组装诊断报告 DTO 的 report 段),被
|
|
6
|
+
// InstalledSection / BuiltinSection / PluginPage 三处消费。纯数据 JSON DTO,类型自
|
|
7
|
+
// serverFn 返回派生(type-only),禁从 @allbluecn/dsh-compat 运行时导入(客户端 bundle
|
|
8
|
+
// 隔离,同旧面板口径)。
|
|
9
|
+
|
|
10
|
+
import type { HarnessPluginReportDTO } from "@/server/serverFns/harness/plugins"
|
|
11
|
+
|
|
12
|
+
/** 组装诊断报告(纯数据 DTO,类型自 serverFn 返回派生,不从 dsh-compat 运行时导入)。 */
|
|
13
|
+
export type HarnessReport = HarnessPluginReportDTO["report"]
|