@blade-hq/agent-react 2612.0.0-beta.98 → 2612.0.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/README.md +14 -2
- package/dist/McpAppCard-NJEKKEEN.js +171 -0
- package/dist/McpAppCard-NJEKKEEN.js.map +1 -0
- package/dist/McpAppFrame-IQK5AOMD.js +9 -0
- package/dist/PlanGraph-WTXKSHID.js +217 -0
- package/dist/PlanGraph-WTXKSHID.js.map +1 -0
- package/dist/{chunk-FTBMG7TK.js → SessionPluginConfigForm-VXONUDM4.js} +2 -3
- package/dist/chat/AskUserQuestionBlock.d.ts +4 -2
- package/dist/chat/AssistantTurnBlock.d.ts +3 -2
- package/dist/chat/AttachmentPreviewDialog.d.ts +1 -6
- package/dist/chat/ChatLoadingIndicator.d.ts +2 -1
- package/dist/chat/ChatPanel.d.ts +5 -3
- package/dist/chat/CurrentPlanPanel.d.ts +2 -1
- package/dist/chat/LightComposer.d.ts +1 -1
- package/dist/chat/MessageList.d.ts +2 -2
- package/dist/chat/RelatedWork.d.ts +24 -0
- package/dist/chat/ToolCallBlock.d.ts +6 -11
- package/dist/chat/chat-run.d.ts +4 -0
- package/dist/chat/customization.d.ts +5 -5
- package/dist/chat/index.d.ts +2 -2
- package/dist/chat/message-list-blocks.d.ts +1 -0
- package/dist/chat/plan/PlanGraph.d.ts +27 -0
- package/dist/chat/plan/PlanSurface.d.ts +9 -0
- package/dist/chat/plan/presentation.d.ts +18 -0
- package/dist/chat/runtime/actions.d.ts +3 -4
- package/dist/chat/runtime/environment.d.ts +8 -3
- package/dist/chat/runtime/session-source.d.ts +2 -0
- package/dist/chat.css +292 -1
- package/dist/{chunk-CJQINCIP.js → chunk-34YJQXTM.js} +56 -72
- package/dist/chunk-34YJQXTM.js.map +1 -0
- package/dist/{chunk-IOKIQSWP.js → chunk-3KJJIH5K.js} +37 -53
- package/dist/chunk-3KJJIH5K.js.map +1 -0
- package/dist/{chunk-RHUJ77ZZ.js → chunk-4WFRH7FG.js} +62 -1572
- package/dist/chunk-4WFRH7FG.js.map +1 -0
- package/dist/{chunk-FXTAY3LE.js → chunk-63G66FWM.js} +21 -17
- package/dist/{chunk-FXTAY3LE.js.map → chunk-63G66FWM.js.map} +1 -1
- package/dist/{chunk-KJDDAZZY.js → chunk-7DG4JFRS.js} +175 -35
- package/dist/chunk-7DG4JFRS.js.map +1 -0
- package/dist/chunk-7WR2KG5O.js +50 -0
- package/dist/chunk-7WR2KG5O.js.map +1 -0
- package/dist/chunk-DNND32V4.js +1404 -0
- package/dist/chunk-DNND32V4.js.map +1 -0
- package/dist/chunk-FR3ON5R4.js +30 -0
- package/dist/chunk-FR3ON5R4.js.map +1 -0
- package/dist/chunk-GRUDJLWG.js +8 -0
- package/dist/chunk-GRUDJLWG.js.map +1 -0
- package/dist/{chunk-Q5NLUZAK.js → chunk-LFC3UTIJ.js} +14 -16
- package/dist/chunk-LFC3UTIJ.js.map +1 -0
- package/dist/{chunk-AGCHJFE7.js → chunk-NPDS3EEK.js} +4 -4
- package/dist/{chunk-AGCHJFE7.js.map → chunk-NPDS3EEK.js.map} +1 -1
- package/dist/{chunk-RULD2XDA.js → chunk-VUUX2BIU.js} +9694 -9467
- package/dist/chunk-VUUX2BIU.js.map +1 -0
- package/dist/{chunk-6Z7T6BOB.js → chunk-XCASYOA6.js} +7 -5
- package/dist/{chunk-6Z7T6BOB.js.map → chunk-XCASYOA6.js.map} +1 -1
- package/dist/components/AgentChat.d.ts +3 -0
- package/dist/components/ChatInput.d.ts +2 -1
- package/dist/components/McpAppCard.d.ts +1 -7
- package/dist/components/McpAppFrame.d.ts +2 -0
- package/dist/components/ReplayBar.d.ts +7 -1
- package/dist/components/lazy-mcp-app-card.d.ts +1 -0
- package/dist/components/lazy-mcp-app-frame.d.ts +1 -0
- package/dist/components/lazy-session-plugin-config-form.d.ts +1 -0
- package/dist/components/mcp-app-context.d.ts +7 -0
- package/dist/components/use-session-plugin-activation.d.ts +3 -1
- package/dist/connectors.js +3 -3
- package/dist/embed/entry.d.ts +9 -0
- package/dist/embed/load-plan-graph.d.ts +2 -0
- package/dist/embed/plan-graph-chunk.d.ts +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +14 -9
- package/dist/internal.d.ts +4 -4
- package/dist/internal.js +211 -28
- package/dist/internal.js.map +1 -1
- package/dist/questions.js +5 -4
- package/dist/questions.js.map +1 -1
- package/dist/rich-input/ChatInput.d.ts +3 -1
- package/dist/rich-input/ComposerControls.d.ts +36 -0
- package/dist/rich-input/index.d.ts +1 -0
- package/dist/rich-input.js +6750 -6437
- package/dist/rich-input.js.map +1 -1
- package/dist/style.full.css +293 -2
- package/dist/tool-details.js +6 -5
- package/dist/tool-details.js.map +1 -1
- package/node_modules/@tiptap/core/dist/index.cjs +7679 -6763
- package/node_modules/@tiptap/core/dist/index.cjs.map +1 -1
- package/node_modules/@tiptap/core/dist/index.d.cts +4468 -3614
- package/node_modules/@tiptap/core/dist/index.d.cts.map +1 -0
- package/node_modules/@tiptap/core/dist/index.d.ts +4467 -3614
- package/node_modules/@tiptap/core/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/core/dist/index.js +7508 -6632
- package/node_modules/@tiptap/core/dist/index.js.map +1 -1
- package/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.cjs +66 -52
- package/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.cjs.map +1 -1
- package/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.d.cts +17 -12
- package/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.d.cts.map +1 -0
- package/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.d.ts +17 -12
- package/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.d.ts.map +1 -0
- package/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js +60 -22
- package/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js.map +1 -1
- package/node_modules/@tiptap/core/dist/rolldown-runtime-D7D4PA-g.js +13 -0
- package/node_modules/@tiptap/core/package.json +27 -24
- package/node_modules/@tiptap/core/src/CommandManager.ts +72 -2
- package/node_modules/@tiptap/core/src/Editor.ts +108 -26
- package/node_modules/@tiptap/core/src/EventEmitter.ts +20 -7
- package/node_modules/@tiptap/core/src/Extendable.ts +52 -7
- package/node_modules/@tiptap/core/src/Extension.ts +7 -3
- package/node_modules/@tiptap/core/src/ExtensionManager.ts +158 -15
- package/node_modules/@tiptap/core/src/InputRule.ts +30 -3
- package/node_modules/@tiptap/core/src/Mark.ts +26 -6
- package/node_modules/@tiptap/core/src/MarkView.ts +13 -3
- package/node_modules/@tiptap/core/src/Node.ts +19 -6
- package/node_modules/@tiptap/core/src/NodePos.ts +17 -4
- package/node_modules/@tiptap/core/src/NodeView.ts +31 -9
- package/node_modules/@tiptap/core/src/PasteRule.ts +17 -4
- package/node_modules/@tiptap/core/src/Tracker.ts +9 -7
- package/node_modules/@tiptap/core/src/__tests__/Editor.spec.ts +73 -0
- package/node_modules/@tiptap/core/src/__tests__/htmlEntities.test.ts +55 -0
- package/node_modules/@tiptap/core/src/__tests__/inputRuleInlineAtoms.test.ts +111 -0
- package/node_modules/@tiptap/core/src/__tests__/isAndroid.test.ts +28 -0
- package/node_modules/@tiptap/core/src/__tests__/rewriteUnknownContent.test.ts +51 -0
- package/node_modules/@tiptap/core/src/__tests__/transformPastedHTML.test.ts +10 -4
- package/node_modules/@tiptap/core/src/commands/deleteSelection.ts +90 -2
- package/node_modules/@tiptap/core/src/commands/extendMarkRange.ts +3 -2
- package/node_modules/@tiptap/core/src/commands/index.ts +2 -0
- package/node_modules/@tiptap/core/src/commands/insertContent.ts +5 -1
- package/node_modules/@tiptap/core/src/commands/insertContentAt.ts +17 -21
- package/node_modules/@tiptap/core/src/commands/insertDefaultBlock.ts +97 -0
- package/node_modules/@tiptap/core/src/commands/resetAttributes.ts +9 -2
- package/node_modules/@tiptap/core/src/commands/setContent.ts +4 -1
- package/node_modules/@tiptap/core/src/commands/setMark.ts +7 -3
- package/node_modules/@tiptap/core/src/commands/setTextSelection.ts +2 -1
- package/node_modules/@tiptap/core/src/commands/splitBlock.ts +16 -4
- package/node_modules/@tiptap/core/src/commands/splitListItem.ts +14 -6
- package/node_modules/@tiptap/core/src/commands/toggleList.ts +106 -7
- package/node_modules/@tiptap/core/src/commands/undoInputRule.ts +1 -1
- package/node_modules/@tiptap/core/src/commands/unsetAllMarks.ts +17 -5
- package/node_modules/@tiptap/core/src/commands/updateDecorations.ts +28 -0
- package/node_modules/@tiptap/core/src/decorations/Decoration.ts +177 -0
- package/node_modules/@tiptap/core/src/decorations/DecorationManager.ts +440 -0
- package/node_modules/@tiptap/core/src/decorations/__tests__/DecorationManager.test.ts +821 -0
- package/node_modules/@tiptap/core/src/decorations/constants.ts +7 -0
- package/node_modules/@tiptap/core/src/decorations/createWidgetDecoration.ts +221 -0
- package/node_modules/@tiptap/core/src/decorations/decorationApplyScope.ts +45 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/__tests__/getRebuildRanges.test.ts +147 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/buildDecorationSet.ts +25 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/decorationsToPMDecorations.ts +36 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/filterOutOfRangeDecorations.ts +52 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/findDuplicateWidgetKeys.ts +37 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/getRebuildRanges.ts +96 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/hasResolvableChangedRange.ts +24 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/isAttrStep.ts +21 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/mapDecorationSet.ts +31 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/mapDecorations.ts +26 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/mergeDecorationSets.ts +16 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/rangeOwnsPosition.ts +38 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/shouldRecomputeDecoration.ts +24 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/unionWidgetKeys.ts +15 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/validateDecorationSpec.ts +49 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/widgetKeyOf.ts +11 -0
- package/node_modules/@tiptap/core/src/decorations/index.ts +28 -0
- package/node_modules/@tiptap/core/src/decorations/types.ts +87 -0
- package/node_modules/@tiptap/core/src/extensions/clipboardTextSerializer.ts +17 -8
- package/node_modules/@tiptap/core/src/extensions/delete.ts +33 -21
- package/node_modules/@tiptap/core/src/extensions/focusEvents.ts +6 -2
- package/node_modules/@tiptap/core/src/extensions/keymap.ts +8 -3
- package/node_modules/@tiptap/core/src/extensions/tabindex.ts +42 -2
- package/node_modules/@tiptap/core/src/extensions/textDirection.ts +3 -1
- package/node_modules/@tiptap/core/src/helpers/MappablePosition.ts +4 -1
- package/node_modules/@tiptap/core/src/helpers/__tests__/getChangedRanges.test.ts +48 -0
- package/node_modules/@tiptap/core/src/helpers/__tests__/isProseMirrorAddMarkStep.test.ts +19 -0
- package/node_modules/@tiptap/core/src/helpers/__tests__/isProseMirrorAddNodeMarkStep.test.ts +19 -0
- package/node_modules/@tiptap/core/src/helpers/__tests__/isProseMirrorAttrStep.test.ts +17 -0
- package/node_modules/@tiptap/core/src/helpers/__tests__/isProseMirrorCellSelection.test.ts +17 -0
- package/node_modules/@tiptap/core/src/helpers/__tests__/isProseMirrorDocAttrStep.test.ts +17 -0
- package/node_modules/@tiptap/core/src/helpers/__tests__/isProseMirrorFragment.test.ts +27 -0
- package/node_modules/@tiptap/core/src/helpers/__tests__/isProseMirrorNodeSelection.test.ts +35 -0
- package/node_modules/@tiptap/core/src/helpers/__tests__/isProseMirrorRemoveMarkStep.test.ts +19 -0
- package/node_modules/@tiptap/core/src/helpers/__tests__/isProseMirrorRemoveNodeMarkStep.test.ts +19 -0
- package/node_modules/@tiptap/core/src/helpers/__tests__/isProseMirrorReplaceAroundStep.test.ts +19 -0
- package/node_modules/@tiptap/core/src/helpers/__tests__/isProseMirrorReplaceStep.test.ts +17 -0
- package/node_modules/@tiptap/core/src/helpers/__tests__/isProseMirrorSlice.test.ts +16 -0
- package/node_modules/@tiptap/core/src/helpers/__tests__/isProseMirrorStep.test.ts +30 -0
- package/node_modules/@tiptap/core/src/helpers/__tests__/isProseMirrorStepResult.test.ts +17 -0
- package/node_modules/@tiptap/core/src/helpers/combineTransactionSteps.ts +4 -1
- package/node_modules/@tiptap/core/src/helpers/createChainableState.ts +4 -1
- package/node_modules/@tiptap/core/src/helpers/createNodeFromContent.ts +15 -6
- package/node_modules/@tiptap/core/src/helpers/findChildrenInRange.ts +5 -1
- package/node_modules/@tiptap/core/src/helpers/flattenExtensions.ts +5 -1
- package/node_modules/@tiptap/core/src/helpers/getAttributes.ts +4 -1
- package/node_modules/@tiptap/core/src/helpers/getAttributesFromExtensions.ts +3 -5
- package/node_modules/@tiptap/core/src/helpers/getMarkAttributes.ts +4 -1
- package/node_modules/@tiptap/core/src/helpers/getMarkRange.ts +20 -5
- package/node_modules/@tiptap/core/src/helpers/getMarkType.ts +3 -1
- package/node_modules/@tiptap/core/src/helpers/getNodeAtPosition.ts +6 -1
- package/node_modules/@tiptap/core/src/helpers/getNodeAttributes.ts +4 -1
- package/node_modules/@tiptap/core/src/helpers/getNodeType.ts +3 -1
- package/node_modules/@tiptap/core/src/helpers/getPreviousBlockSibling.ts +36 -0
- package/node_modules/@tiptap/core/src/helpers/getSchemaByResolvedExtensions.ts +73 -20
- package/node_modules/@tiptap/core/src/helpers/getTextBetween.ts +1 -1
- package/node_modules/@tiptap/core/src/helpers/getTextContentFromNodes.ts +17 -12
- package/node_modules/@tiptap/core/src/helpers/index.ts +16 -0
- package/node_modules/@tiptap/core/src/helpers/isActive.ts +5 -1
- package/node_modules/@tiptap/core/src/helpers/isFragment.ts +14 -0
- package/node_modules/@tiptap/core/src/helpers/isNodeViewSelected.ts +42 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorAddMarkStep.ts +31 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorAddNodeMarkStep.ts +31 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorAttrStep.ts +31 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorCellSelection.ts +18 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorContent.ts +14 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorDocAttrStep.ts +31 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorFragment.ts +34 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorNodeSelection.ts +18 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorRemoveMarkStep.ts +31 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorRemoveNodeMarkStep.ts +31 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorReplaceAroundStep.ts +31 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorReplaceStep.ts +31 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorSlice.ts +43 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorStep.ts +30 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorStepResult.ts +26 -0
- package/node_modules/@tiptap/core/src/helpers/resolveFocusPosition.ts +14 -3
- package/node_modules/@tiptap/core/src/helpers/rewriteUnknownContent.ts +19 -10
- package/node_modules/@tiptap/core/src/helpers/splitExtensions.ts +3 -1
- package/node_modules/@tiptap/core/src/helpers/warnOnDuplicatedProseMirrorModel.ts +40 -0
- package/node_modules/@tiptap/core/src/index.ts +1 -6
- package/node_modules/@tiptap/core/src/inputRules/markInputRule.ts +5 -1
- package/node_modules/@tiptap/core/src/inputRules/nodeInputRule.ts +9 -2
- package/node_modules/@tiptap/core/src/inputRules/textInputRule.ts +5 -1
- package/node_modules/@tiptap/core/src/inputRules/textblockTypeInputRule.ts +8 -2
- package/node_modules/@tiptap/core/src/inputRules/wrappingInputRule.ts +8 -2
- package/node_modules/@tiptap/core/src/jsx-runtime.ts +91 -11
- package/node_modules/@tiptap/core/src/lib/ResizableNodeView.ts +25 -6
- package/node_modules/@tiptap/core/src/pasteRules/markPasteRule.ts +12 -1
- package/node_modules/@tiptap/core/src/types.ts +65 -18
- package/node_modules/@tiptap/core/src/utilities/attrsEqual.ts +27 -0
- package/node_modules/@tiptap/core/src/utilities/callOrReturn.ts +5 -1
- package/node_modules/@tiptap/core/src/utilities/deleteProps.ts +4 -1
- package/node_modules/@tiptap/core/src/utilities/elementFromString.ts +3 -1
- package/node_modules/@tiptap/core/src/utilities/getStyleProperty.ts +52 -0
- package/node_modules/@tiptap/core/src/utilities/htmlEntities.ts +26 -0
- package/node_modules/@tiptap/core/src/utilities/index.ts +4 -0
- package/node_modules/@tiptap/core/src/utilities/isAndroid.ts +1 -1
- package/node_modules/@tiptap/core/src/utilities/isDev.ts +12 -0
- package/node_modules/@tiptap/core/src/utilities/isFunction.ts +1 -1
- package/node_modules/@tiptap/core/src/utilities/isSafari.ts +3 -1
- package/node_modules/@tiptap/core/src/utilities/isiOS.ts +3 -1
- package/node_modules/@tiptap/core/src/utilities/markdown/createAtomBlockMarkdownSpec.ts +2 -4
- package/node_modules/@tiptap/core/src/utilities/markdown/createBlockMarkdownSpec.ts +10 -6
- package/node_modules/@tiptap/core/src/utilities/markdown/createInlineMarkdownSpec.ts +4 -24
- package/node_modules/@tiptap/core/src/utilities/markdown/index.ts +2 -1
- package/node_modules/@tiptap/core/src/utilities/markdown/parseAttributes.ts +48 -0
- package/node_modules/@tiptap/core/src/utilities/markdown/parseShortcodeAttributes.ts +13 -0
- package/node_modules/@tiptap/core/src/utilities/markdown/renderNestedMarkdownContent.ts +2 -1
- package/node_modules/@tiptap/core/src/utilities/markdown/serializeAttributes.ts +42 -0
- package/node_modules/@tiptap/core/src/utilities/markdown/tokenizeAttributes.ts +163 -0
- package/node_modules/@tiptap/core/src/utilities/marksEqual.ts +44 -0
- package/node_modules/@tiptap/core/src/utilities/mergeAttributes.ts +22 -3
- package/node_modules/@tiptap/core/src/utilities/mergeDeep.ts +4 -1
- package/node_modules/@tiptap/extension-bubble-menu/dist/index.cjs +324 -453
- package/node_modules/@tiptap/extension-bubble-menu/dist/index.cjs.map +1 -1
- package/node_modules/@tiptap/extension-bubble-menu/dist/index.d.cts +152 -151
- package/node_modules/@tiptap/extension-bubble-menu/dist/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-bubble-menu/dist/index.d.ts +152 -151
- package/node_modules/@tiptap/extension-bubble-menu/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-bubble-menu/dist/index.js +316 -433
- package/node_modules/@tiptap/extension-bubble-menu/dist/index.js.map +1 -1
- package/node_modules/@tiptap/extension-bubble-menu/package.json +25 -23
- package/node_modules/@tiptap/extension-bubble-menu/src/bubble-menu-plugin.ts +73 -13
- package/node_modules/@tiptap/extension-floating-menu/dist/index.cjs +265 -373
- package/node_modules/@tiptap/extension-floating-menu/dist/index.cjs.map +1 -1
- package/node_modules/@tiptap/extension-floating-menu/dist/index.d.cts +161 -160
- package/node_modules/@tiptap/extension-floating-menu/dist/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-floating-menu/dist/index.d.ts +161 -160
- package/node_modules/@tiptap/extension-floating-menu/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-floating-menu/dist/index.js +258 -354
- package/node_modules/@tiptap/extension-floating-menu/dist/index.js.map +1 -1
- package/node_modules/@tiptap/extension-floating-menu/package.json +23 -21
- package/node_modules/@tiptap/extension-floating-menu/src/floating-menu-plugin.ts +66 -11
- package/node_modules/@tiptap/extension-mention/dist/index.cjs +232 -268
- package/node_modules/@tiptap/extension-mention/dist/index.cjs.map +1 -1
- package/node_modules/@tiptap/extension-mention/dist/index.d.cts +85 -84
- package/node_modules/@tiptap/extension-mention/dist/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-mention/dist/index.d.ts +85 -84
- package/node_modules/@tiptap/extension-mention/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-mention/dist/index.js +226 -240
- package/node_modules/@tiptap/extension-mention/dist/index.js.map +1 -1
- package/node_modules/@tiptap/extension-mention/package.json +24 -22
- package/node_modules/@tiptap/extension-mention/src/mention.ts +23 -13
- package/node_modules/@tiptap/pm/README.md +1 -1
- package/node_modules/{prosemirror-markdown/LICENSE → @tiptap/pm/THIRD_PARTY_LICENSES.md} +28 -0
- package/node_modules/@tiptap/pm/dist/changeset/index.cjs +9 -2
- package/node_modules/@tiptap/pm/dist/changeset/index.d.cts +1 -18
- package/node_modules/@tiptap/pm/dist/changeset/index.d.ts +1 -18
- package/node_modules/@tiptap/pm/dist/changeset/index.js +1 -1
- package/node_modules/@tiptap/pm/dist/commands/index.cjs +9 -2
- package/node_modules/@tiptap/pm/dist/commands/index.d.cts +1 -1
- package/node_modules/@tiptap/pm/dist/commands/index.d.ts +1 -1
- package/node_modules/@tiptap/pm/dist/commands/index.js +1 -1
- package/node_modules/@tiptap/pm/dist/dropcursor/index.cjs +9 -2
- package/node_modules/@tiptap/pm/dist/dropcursor/index.d.cts +1 -1
- package/node_modules/@tiptap/pm/dist/dropcursor/index.d.ts +1 -1
- package/node_modules/@tiptap/pm/dist/dropcursor/index.js +1 -1
- package/node_modules/@tiptap/pm/dist/gapcursor/index.cjs +9 -2
- package/node_modules/@tiptap/pm/dist/gapcursor/index.d.cts +1 -1
- package/node_modules/@tiptap/pm/dist/gapcursor/index.d.ts +1 -1
- package/node_modules/@tiptap/pm/dist/gapcursor/index.js +1 -1
- package/node_modules/@tiptap/pm/dist/history/index.cjs +9 -2
- package/node_modules/@tiptap/pm/dist/history/index.d.cts +1 -1
- package/node_modules/@tiptap/pm/dist/history/index.d.ts +1 -1
- package/node_modules/@tiptap/pm/dist/history/index.js +1 -1
- package/node_modules/@tiptap/pm/dist/inputrules/index.cjs +9 -2
- package/node_modules/@tiptap/pm/dist/inputrules/index.d.cts +1 -1
- package/node_modules/@tiptap/pm/dist/inputrules/index.d.ts +1 -1
- package/node_modules/@tiptap/pm/dist/inputrules/index.js +1 -1
- package/node_modules/@tiptap/pm/dist/keymap/index.cjs +9 -2
- package/node_modules/@tiptap/pm/dist/keymap/index.d.cts +1 -1
- package/node_modules/@tiptap/pm/dist/keymap/index.d.ts +1 -1
- package/node_modules/@tiptap/pm/dist/keymap/index.js +1 -1
- package/node_modules/@tiptap/pm/dist/model/index.cjs +9 -2
- package/node_modules/@tiptap/pm/dist/model/index.d.cts +1 -1
- package/node_modules/@tiptap/pm/dist/model/index.d.ts +1 -1
- package/node_modules/@tiptap/pm/dist/model/index.js +1 -1
- package/node_modules/@tiptap/pm/dist/schema-list/index.cjs +9 -2
- package/node_modules/@tiptap/pm/dist/schema-list/index.d.cts +1 -1
- package/node_modules/@tiptap/pm/dist/schema-list/index.d.ts +1 -1
- package/node_modules/@tiptap/pm/dist/schema-list/index.js +1 -1
- package/node_modules/@tiptap/pm/dist/state/index.cjs +9 -2
- package/node_modules/@tiptap/pm/dist/state/index.d.cts +1 -1
- package/node_modules/@tiptap/pm/dist/state/index.d.ts +1 -1
- package/node_modules/@tiptap/pm/dist/state/index.js +1 -1
- package/node_modules/@tiptap/pm/dist/tables/index.cjs +9 -2
- package/node_modules/@tiptap/pm/dist/tables/index.d.cts +1 -1
- package/node_modules/@tiptap/pm/dist/tables/index.d.ts +1 -1
- package/node_modules/@tiptap/pm/dist/tables/index.js +1 -1
- package/node_modules/@tiptap/pm/dist/transform/index.cjs +9 -2
- package/node_modules/@tiptap/pm/dist/transform/index.d.cts +1 -1
- package/node_modules/@tiptap/pm/dist/transform/index.d.ts +1 -1
- package/node_modules/@tiptap/pm/dist/transform/index.js +1 -1
- package/node_modules/@tiptap/pm/dist/view/index.cjs +9 -2
- package/node_modules/@tiptap/pm/dist/view/index.d.cts +1 -1
- package/node_modules/@tiptap/pm/dist/view/index.d.ts +1 -1
- package/node_modules/@tiptap/pm/dist/view/index.js +1 -1
- package/node_modules/@tiptap/pm/package.json +54 -99
- package/node_modules/@tiptap/react/dist/index.cjs +1243 -1141
- package/node_modules/@tiptap/react/dist/index.cjs.map +1 -1
- package/node_modules/@tiptap/react/dist/index.d.cts +396 -294
- package/node_modules/@tiptap/react/dist/index.d.cts.map +1 -0
- package/node_modules/@tiptap/react/dist/index.d.ts +396 -294
- package/node_modules/@tiptap/react/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/react/dist/index.js +1188 -1081
- package/node_modules/@tiptap/react/dist/index.js.map +1 -1
- package/node_modules/@tiptap/react/dist/menus/index.cjs +420 -450
- package/node_modules/@tiptap/react/dist/menus/index.cjs.map +1 -1
- package/node_modules/@tiptap/react/dist/menus/index.d.cts +13 -11
- package/node_modules/@tiptap/react/dist/menus/index.d.cts.map +1 -0
- package/node_modules/@tiptap/react/dist/menus/index.d.ts +13 -11
- package/node_modules/@tiptap/react/dist/menus/index.d.ts.map +1 -0
- package/node_modules/@tiptap/react/dist/menus/index.js +399 -416
- package/node_modules/@tiptap/react/dist/menus/index.js.map +1 -1
- package/node_modules/@tiptap/react/package.json +29 -27
- package/node_modules/@tiptap/react/src/Context.tsx +3 -1
- package/node_modules/@tiptap/react/src/Editor.ts +4 -1
- package/node_modules/@tiptap/react/src/EditorContent.spec.ts +39 -0
- package/node_modules/@tiptap/react/src/EditorContent.tsx +26 -41
- package/node_modules/@tiptap/react/src/ReactMarkViewRenderer.tsx +18 -10
- package/node_modules/@tiptap/react/src/ReactNodeViewRenderer.spec.ts +415 -0
- package/node_modules/@tiptap/react/src/ReactNodeViewRenderer.tsx +126 -24
- package/node_modules/@tiptap/react/src/ReactRenderer.tsx +30 -8
- package/node_modules/@tiptap/react/src/ReactWidgetRenderer.spec.ts +448 -0
- package/node_modules/@tiptap/react/src/ReactWidgetRenderer.tsx +97 -0
- package/node_modules/@tiptap/react/src/Tiptap.tsx +22 -15
- package/node_modules/@tiptap/react/src/captureDOMSelection.spec.ts +76 -0
- package/node_modules/@tiptap/react/src/captureDOMSelection.ts +35 -0
- package/node_modules/@tiptap/react/src/index.ts +3 -0
- package/node_modules/@tiptap/react/src/menus/BubbleMenu.spec.ts +7 -3
- package/node_modules/@tiptap/react/src/menus/BubbleMenu.tsx +10 -3
- package/node_modules/@tiptap/react/src/menus/FloatingMenu.spec.ts +7 -3
- package/node_modules/@tiptap/react/src/menus/FloatingMenu.tsx +28 -4
- package/node_modules/@tiptap/react/src/menus/index.ts +2 -0
- package/node_modules/@tiptap/react/src/menus/useMenuElementProps.ts +18 -3
- package/node_modules/@tiptap/react/src/use-client.spec.ts +26 -0
- package/node_modules/@tiptap/react/src/useEditor.ts +30 -33
- package/node_modules/@tiptap/react/src/useEditorState.spec.ts +121 -0
- package/node_modules/@tiptap/react/src/useEditorState.ts +17 -3
- package/node_modules/@tiptap/react/src/useReactNodeView.ts +12 -2
- package/node_modules/@tiptap/suggestion/dist/index.cjs +657 -361
- package/node_modules/@tiptap/suggestion/dist/index.cjs.map +1 -1
- package/node_modules/@tiptap/suggestion/dist/index.d.cts +395 -189
- package/node_modules/@tiptap/suggestion/dist/index.d.cts.map +1 -0
- package/node_modules/@tiptap/suggestion/dist/index.d.ts +395 -189
- package/node_modules/@tiptap/suggestion/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/suggestion/dist/index.js +648 -330
- package/node_modules/@tiptap/suggestion/dist/index.js.map +1 -1
- package/node_modules/@tiptap/suggestion/package.json +25 -21
- package/node_modules/@tiptap/suggestion/src/__tests__/suggestion.test.ts +1123 -2
- package/node_modules/@tiptap/suggestion/src/findSuggestionMatch.ts +8 -1
- package/node_modules/@tiptap/suggestion/src/helpers.ts +129 -0
- package/node_modules/@tiptap/suggestion/src/plugin/async.ts +89 -0
- package/node_modules/@tiptap/suggestion/src/plugin/floating-ui.ts +204 -0
- package/node_modules/@tiptap/suggestion/src/plugin/props.ts +94 -0
- package/node_modules/@tiptap/suggestion/src/plugin/state.ts +182 -0
- package/node_modules/@tiptap/suggestion/src/plugin/view.ts +236 -0
- package/node_modules/@tiptap/suggestion/src/suggestion.ts +101 -535
- package/node_modules/@tiptap/suggestion/src/types.ts +439 -0
- package/node_modules/prosemirror-changeset/CHANGELOG.md +36 -0
- package/node_modules/prosemirror-changeset/README.md +1 -1
- package/node_modules/prosemirror-changeset/dist/index.cjs +35 -24
- package/node_modules/prosemirror-changeset/dist/index.d.cts +2 -1
- package/node_modules/prosemirror-changeset/dist/index.d.ts +2 -1
- package/node_modules/prosemirror-changeset/dist/index.js +23 -8
- package/node_modules/prosemirror-changeset/package.json +2 -2
- package/node_modules/prosemirror-changeset/src/README.md +1 -1
- package/node_modules/prosemirror-changeset/src/diff.ts +21 -8
- package/node_modules/prosemirror-changeset/src/simplify.ts +1 -1
- package/node_modules/prosemirror-changeset/test/test-diff.ts +26 -0
- package/node_modules/prosemirror-changeset/test/test-simplify.ts +3 -0
- package/node_modules/prosemirror-commands/CHANGELOG.md +6 -0
- package/node_modules/prosemirror-commands/CONTRIBUTING.md +19 -19
- package/node_modules/prosemirror-commands/README.md +3 -3
- package/node_modules/prosemirror-commands/dist/index.cjs +23 -22
- package/node_modules/prosemirror-commands/dist/index.js +11 -9
- package/node_modules/prosemirror-commands/package.json +2 -2
- package/node_modules/prosemirror-commands/src/commands.ts +11 -8
- package/node_modules/prosemirror-dropcursor/CHANGELOG.md +12 -0
- package/node_modules/prosemirror-dropcursor/CONTRIBUTING.md +22 -18
- package/node_modules/prosemirror-dropcursor/README.md +3 -3
- package/node_modules/prosemirror-dropcursor/dist/index.cjs +25 -10
- package/node_modules/prosemirror-dropcursor/dist/index.js +30 -13
- package/node_modules/prosemirror-dropcursor/package.json +2 -2
- package/node_modules/prosemirror-dropcursor/src/dropcursor.ts +26 -10
- package/node_modules/prosemirror-history/CHANGELOG.md +12 -0
- package/node_modules/prosemirror-history/CONTRIBUTING.md +19 -19
- package/node_modules/prosemirror-history/README.md +3 -3
- package/node_modules/prosemirror-history/dist/index.cjs +32 -11
- package/node_modules/prosemirror-history/dist/index.js +21 -4
- package/node_modules/prosemirror-history/package.json +2 -2
- package/node_modules/prosemirror-history/src/history.ts +24 -5
- package/node_modules/prosemirror-model/CHANGELOG.md +58 -0
- package/node_modules/prosemirror-model/CONTRIBUTING.md +19 -19
- package/node_modules/prosemirror-model/README.md +3 -3
- package/node_modules/prosemirror-model/dist/index.cjs +117 -110
- package/node_modules/prosemirror-model/dist/index.d.cts +36 -30
- package/node_modules/prosemirror-model/dist/index.d.ts +36 -30
- package/node_modules/prosemirror-model/dist/index.js +67 -56
- package/node_modules/prosemirror-model/package.json +2 -2
- package/node_modules/prosemirror-model/src/diff.ts +10 -5
- package/node_modules/prosemirror-model/src/fragment.ts +1 -1
- package/node_modules/prosemirror-model/src/from_dom.ts +5 -2
- package/node_modules/prosemirror-model/src/mark.ts +0 -1
- package/node_modules/prosemirror-model/src/node.ts +30 -10
- package/node_modules/prosemirror-model/src/replace.ts +8 -16
- package/node_modules/prosemirror-model/src/schema.ts +15 -28
- package/node_modules/prosemirror-model/src/to_dom.ts +24 -20
- package/node_modules/prosemirror-transform/CHANGELOG.md +56 -0
- package/node_modules/prosemirror-transform/CONTRIBUTING.md +19 -19
- package/node_modules/prosemirror-transform/README.md +3 -3
- package/node_modules/prosemirror-transform/dist/index.cjs +288 -176
- package/node_modules/prosemirror-transform/dist/index.d.cts +14 -4
- package/node_modules/prosemirror-transform/dist/index.d.ts +14 -4
- package/node_modules/prosemirror-transform/dist/index.js +156 -55
- package/node_modules/prosemirror-transform/package.json +2 -2
- package/node_modules/prosemirror-transform/src/attr_step.ts +1 -1
- package/node_modules/prosemirror-transform/src/map.ts +11 -6
- package/node_modules/prosemirror-transform/src/mark.ts +4 -21
- package/node_modules/prosemirror-transform/src/mark_step.ts +81 -10
- package/node_modules/prosemirror-transform/src/replace.ts +31 -9
- package/node_modules/prosemirror-transform/src/replace_step.ts +11 -2
- package/node_modules/prosemirror-transform/src/structure.ts +15 -9
- package/node_modules/prosemirror-view/CHANGELOG.md +52 -2
- package/node_modules/prosemirror-view/CONTRIBUTING.md +19 -19
- package/node_modules/prosemirror-view/README.md +3 -3
- package/node_modules/prosemirror-view/dist/index.cjs +287 -183
- package/node_modules/prosemirror-view/dist/index.d.cts +10 -2
- package/node_modules/prosemirror-view/dist/index.d.ts +10 -2
- package/node_modules/prosemirror-view/dist/index.js +180 -93
- package/node_modules/prosemirror-view/package.json +3 -3
- package/node_modules/prosemirror-view/src/clipboard.ts +21 -5
- package/node_modules/prosemirror-view/src/domchange.ts +8 -18
- package/node_modules/prosemirror-view/src/domcoords.ts +4 -1
- package/node_modules/prosemirror-view/src/domobserver.ts +4 -1
- package/node_modules/prosemirror-view/src/index.ts +4 -3
- package/node_modules/prosemirror-view/src/input.ts +96 -41
- package/node_modules/prosemirror-view/src/selection.ts +6 -6
- package/node_modules/prosemirror-view/src/viewdesc.ts +48 -23
- package/node_modules/prosemirror-view/style/prosemirror.css +1 -1
- package/package.json +19 -55
- package/public-api.md +64 -2
- package/dist/SessionPluginConfigForm-DWLJEYBY.js +0 -9
- package/dist/chat/LiteMessageList.d.ts +0 -84
- package/dist/chunk-CJQINCIP.js.map +0 -1
- package/dist/chunk-IOKIQSWP.js.map +0 -1
- package/dist/chunk-KJDDAZZY.js.map +0 -1
- package/dist/chunk-Q5NLUZAK.js.map +0 -1
- package/dist/chunk-RHUJ77ZZ.js.map +0 -1
- package/dist/chunk-RULD2XDA.js.map +0 -1
- package/node_modules/@remirror/core-constants/LICENSE +0 -21
- package/node_modules/@remirror/core-constants/dist/_tsup-dts-rollup.d.cts +0 -612
- package/node_modules/@remirror/core-constants/dist/_tsup-dts-rollup.d.ts +0 -612
- package/node_modules/@remirror/core-constants/dist/remirror-core-constants.cjs +0 -314
- package/node_modules/@remirror/core-constants/dist/remirror-core-constants.d.cts +0 -20
- package/node_modules/@remirror/core-constants/dist/remirror-core-constants.d.ts +0 -20
- package/node_modules/@remirror/core-constants/dist/remirror-core-constants.js +0 -269
- package/node_modules/@remirror/core-constants/dist-types/core-constants.d.ts +0 -431
- package/node_modules/@remirror/core-constants/dist-types/error-constants.d.ts +0 -119
- package/node_modules/@remirror/core-constants/dist-types/index.d.ts +0 -2
- package/node_modules/@remirror/core-constants/dist-types/tsconfig.tsbuildinfo +0 -1
- package/node_modules/@remirror/core-constants/package.json +0 -45
- package/node_modules/@remirror/core-constants/readme.md +0 -17
- package/node_modules/@tiptap/core/src/utilities/markdown/attributeUtils.ts +0 -130
- package/node_modules/@tiptap/pm/collab/index.ts +0 -1
- package/node_modules/@tiptap/pm/dist/collab/index.cjs +0 -2
- package/node_modules/@tiptap/pm/dist/collab/index.d.cts +0 -1
- package/node_modules/@tiptap/pm/dist/collab/index.d.ts +0 -1
- package/node_modules/@tiptap/pm/dist/collab/index.js +0 -2
- package/node_modules/@tiptap/pm/dist/markdown/index.cjs +0 -2
- package/node_modules/@tiptap/pm/dist/markdown/index.d.cts +0 -1
- package/node_modules/@tiptap/pm/dist/markdown/index.d.ts +0 -1
- package/node_modules/@tiptap/pm/dist/markdown/index.js +0 -2
- package/node_modules/@tiptap/pm/dist/menu/index.cjs +0 -2
- package/node_modules/@tiptap/pm/dist/menu/index.d.cts +0 -1
- package/node_modules/@tiptap/pm/dist/menu/index.d.ts +0 -1
- package/node_modules/@tiptap/pm/dist/menu/index.js +0 -2
- package/node_modules/@tiptap/pm/dist/schema-basic/index.cjs +0 -2
- package/node_modules/@tiptap/pm/dist/schema-basic/index.d.cts +0 -1
- package/node_modules/@tiptap/pm/dist/schema-basic/index.d.ts +0 -1
- package/node_modules/@tiptap/pm/dist/schema-basic/index.js +0 -2
- package/node_modules/@tiptap/pm/dist/trailing-node/index.cjs +0 -2
- package/node_modules/@tiptap/pm/dist/trailing-node/index.d.cts +0 -1
- package/node_modules/@tiptap/pm/dist/trailing-node/index.d.ts +0 -1
- package/node_modules/@tiptap/pm/dist/trailing-node/index.js +0 -2
- package/node_modules/@tiptap/pm/markdown/index.ts +0 -1
- package/node_modules/@tiptap/pm/menu/index.ts +0 -1
- package/node_modules/@tiptap/pm/schema-basic/index.ts +0 -1
- package/node_modules/@tiptap/pm/trailing-node/index.ts +0 -1
- package/node_modules/@types/linkify-it/LICENSE +0 -21
- package/node_modules/@types/linkify-it/README.md +0 -15
- package/node_modules/@types/linkify-it/build/index.cjs.d.ts +0 -178
- package/node_modules/@types/linkify-it/index.d.mts +0 -174
- package/node_modules/@types/linkify-it/index.d.ts +0 -3
- package/node_modules/@types/linkify-it/package.json +0 -50
- package/node_modules/@types/markdown-it/LICENSE +0 -21
- package/node_modules/@types/markdown-it/README.md +0 -15
- package/node_modules/@types/markdown-it/dist/index.cjs.d.ts +0 -1236
- package/node_modules/@types/markdown-it/dist/markdown-it.d.ts +0 -5
- package/node_modules/@types/markdown-it/dist/markdown-it.min.d.ts +0 -5
- package/node_modules/@types/markdown-it/index.d.mts +0 -1
- package/node_modules/@types/markdown-it/index.d.ts +0 -3
- package/node_modules/@types/markdown-it/lib/common/html_blocks.d.mts +0 -7
- package/node_modules/@types/markdown-it/lib/common/html_re.d.mts +0 -2
- package/node_modules/@types/markdown-it/lib/common/utils.d.mts +0 -62
- package/node_modules/@types/markdown-it/lib/helpers/index.d.mts +0 -5
- package/node_modules/@types/markdown-it/lib/helpers/parse_link_destination.d.mts +0 -7
- package/node_modules/@types/markdown-it/lib/helpers/parse_link_label.d.mts +0 -3
- package/node_modules/@types/markdown-it/lib/helpers/parse_link_title.d.mts +0 -29
- package/node_modules/@types/markdown-it/lib/index.d.mts +0 -404
- package/node_modules/@types/markdown-it/lib/parser_block.d.mts +0 -25
- package/node_modules/@types/markdown-it/lib/parser_core.d.mts +0 -18
- package/node_modules/@types/markdown-it/lib/parser_inline.d.mts +0 -38
- package/node_modules/@types/markdown-it/lib/renderer.d.mts +0 -96
- package/node_modules/@types/markdown-it/lib/ruler.d.mts +0 -158
- package/node_modules/@types/markdown-it/lib/rules_block/state_block.d.mts +0 -124
- package/node_modules/@types/markdown-it/lib/rules_core/state_core.d.mts +0 -18
- package/node_modules/@types/markdown-it/lib/rules_inline/state_inline.d.mts +0 -73
- package/node_modules/@types/markdown-it/lib/token.d.mts +0 -108
- package/node_modules/@types/markdown-it/package.json +0 -54
- package/node_modules/@types/mdurl/LICENSE +0 -21
- package/node_modules/@types/mdurl/README.md +0 -15
- package/node_modules/@types/mdurl/build/index.cjs.d.ts +0 -52
- package/node_modules/@types/mdurl/index.d.mts +0 -6
- package/node_modules/@types/mdurl/index.d.ts +0 -3
- package/node_modules/@types/mdurl/lib/decode.d.mts +0 -10
- package/node_modules/@types/mdurl/lib/encode.d.mts +0 -15
- package/node_modules/@types/mdurl/lib/format.d.mts +0 -3
- package/node_modules/@types/mdurl/lib/parse.d.mts +0 -18
- package/node_modules/@types/mdurl/package.json +0 -36
- package/node_modules/argparse/LICENSE +0 -254
- package/node_modules/argparse/README.md +0 -84
- package/node_modules/argparse/argparse.js +0 -3707
- package/node_modules/argparse/lib/sub.js +0 -67
- package/node_modules/argparse/lib/textwrap.js +0 -440
- package/node_modules/argparse/package.json +0 -31
- package/node_modules/crelt/LICENSE +0 -19
- package/node_modules/crelt/README.md +0 -23
- package/node_modules/crelt/dist/index.cjs +0 -31
- package/node_modules/crelt/dist/index.d.cts +0 -4
- package/node_modules/crelt/index.d.ts +0 -4
- package/node_modules/crelt/index.js +0 -28
- package/node_modules/crelt/package.json +0 -35
- package/node_modules/crelt/rollup.config.js +0 -13
- package/node_modules/entities/LICENSE +0 -11
- package/node_modules/entities/lib/decode.d.ts +0 -211
- package/node_modules/entities/lib/decode.d.ts.map +0 -1
- package/node_modules/entities/lib/decode.js +0 -536
- package/node_modules/entities/lib/decode.js.map +0 -1
- package/node_modules/entities/lib/decode_codepoint.d.ts +0 -19
- package/node_modules/entities/lib/decode_codepoint.d.ts.map +0 -1
- package/node_modules/entities/lib/decode_codepoint.js +0 -76
- package/node_modules/entities/lib/decode_codepoint.js.map +0 -1
- package/node_modules/entities/lib/encode.d.ts +0 -22
- package/node_modules/entities/lib/encode.d.ts.map +0 -1
- package/node_modules/entities/lib/encode.js +0 -77
- package/node_modules/entities/lib/encode.js.map +0 -1
- package/node_modules/entities/lib/escape.d.ts +0 -43
- package/node_modules/entities/lib/escape.d.ts.map +0 -1
- package/node_modules/entities/lib/escape.js +0 -122
- package/node_modules/entities/lib/escape.js.map +0 -1
- package/node_modules/entities/lib/esm/decode.d.ts +0 -211
- package/node_modules/entities/lib/esm/decode.d.ts.map +0 -1
- package/node_modules/entities/lib/esm/decode.js +0 -496
- package/node_modules/entities/lib/esm/decode.js.map +0 -1
- package/node_modules/entities/lib/esm/decode_codepoint.d.ts +0 -19
- package/node_modules/entities/lib/esm/decode_codepoint.d.ts.map +0 -1
- package/node_modules/entities/lib/esm/decode_codepoint.js +0 -71
- package/node_modules/entities/lib/esm/decode_codepoint.js.map +0 -1
- package/node_modules/entities/lib/esm/encode.d.ts +0 -22
- package/node_modules/entities/lib/esm/encode.d.ts.map +0 -1
- package/node_modules/entities/lib/esm/encode.js +0 -69
- package/node_modules/entities/lib/esm/encode.js.map +0 -1
- package/node_modules/entities/lib/esm/escape.d.ts +0 -43
- package/node_modules/entities/lib/esm/escape.d.ts.map +0 -1
- package/node_modules/entities/lib/esm/escape.js +0 -116
- package/node_modules/entities/lib/esm/escape.js.map +0 -1
- package/node_modules/entities/lib/esm/generated/decode-data-html.d.ts +0 -3
- package/node_modules/entities/lib/esm/generated/decode-data-html.d.ts.map +0 -1
- package/node_modules/entities/lib/esm/generated/decode-data-html.js +0 -7
- package/node_modules/entities/lib/esm/generated/decode-data-html.js.map +0 -1
- package/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts +0 -3
- package/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts.map +0 -1
- package/node_modules/entities/lib/esm/generated/decode-data-xml.js +0 -7
- package/node_modules/entities/lib/esm/generated/decode-data-xml.js.map +0 -1
- package/node_modules/entities/lib/esm/generated/encode-html.d.ts +0 -8
- package/node_modules/entities/lib/esm/generated/encode-html.d.ts.map +0 -1
- package/node_modules/entities/lib/esm/generated/encode-html.js +0 -10
- package/node_modules/entities/lib/esm/generated/encode-html.js.map +0 -1
- package/node_modules/entities/lib/esm/index.d.ts +0 -96
- package/node_modules/entities/lib/esm/index.d.ts.map +0 -1
- package/node_modules/entities/lib/esm/index.js +0 -99
- package/node_modules/entities/lib/esm/index.js.map +0 -1
- package/node_modules/entities/lib/esm/package.json +0 -1
- package/node_modules/entities/lib/generated/decode-data-html.d.ts +0 -3
- package/node_modules/entities/lib/generated/decode-data-html.d.ts.map +0 -1
- package/node_modules/entities/lib/generated/decode-data-html.js +0 -9
- package/node_modules/entities/lib/generated/decode-data-html.js.map +0 -1
- package/node_modules/entities/lib/generated/decode-data-xml.d.ts +0 -3
- package/node_modules/entities/lib/generated/decode-data-xml.d.ts.map +0 -1
- package/node_modules/entities/lib/generated/decode-data-xml.js +0 -9
- package/node_modules/entities/lib/generated/decode-data-xml.js.map +0 -1
- package/node_modules/entities/lib/generated/encode-html.d.ts +0 -8
- package/node_modules/entities/lib/generated/encode-html.d.ts.map +0 -1
- package/node_modules/entities/lib/generated/encode-html.js +0 -12
- package/node_modules/entities/lib/generated/encode-html.js.map +0 -1
- package/node_modules/entities/lib/index.d.ts +0 -96
- package/node_modules/entities/lib/index.d.ts.map +0 -1
- package/node_modules/entities/lib/index.js +0 -126
- package/node_modules/entities/lib/index.js.map +0 -1
- package/node_modules/entities/package.json +0 -90
- package/node_modules/entities/readme.md +0 -122
- package/node_modules/escape-string-regexp/index.d.ts +0 -18
- package/node_modules/escape-string-regexp/index.js +0 -13
- package/node_modules/escape-string-regexp/license +0 -9
- package/node_modules/escape-string-regexp/package.json +0 -38
- package/node_modules/escape-string-regexp/readme.md +0 -34
- package/node_modules/linkify-it/LICENSE +0 -22
- package/node_modules/linkify-it/README.md +0 -196
- package/node_modules/linkify-it/build/index.cjs.js +0 -832
- package/node_modules/linkify-it/index.mjs +0 -642
- package/node_modules/linkify-it/lib/re.mjs +0 -189
- package/node_modules/linkify-it/package.json +0 -58
- package/node_modules/markdown-it/LICENSE +0 -22
- package/node_modules/markdown-it/README.md +0 -324
- package/node_modules/markdown-it/bin/markdown-it.mjs +0 -107
- package/node_modules/markdown-it/dist/index.cjs.js +0 -5547
- package/node_modules/markdown-it/dist/markdown-it.js +0 -6969
- package/node_modules/markdown-it/dist/markdown-it.min.js +0 -2
- package/node_modules/markdown-it/index.mjs +0 -1
- package/node_modules/markdown-it/lib/common/html_blocks.mjs +0 -67
- package/node_modules/markdown-it/lib/common/html_re.mjs +0 -25
- package/node_modules/markdown-it/lib/common/utils.mjs +0 -304
- package/node_modules/markdown-it/lib/helpers/index.mjs +0 -11
- package/node_modules/markdown-it/lib/helpers/parse_link_destination.mjs +0 -77
- package/node_modules/markdown-it/lib/helpers/parse_link_label.mjs +0 -49
- package/node_modules/markdown-it/lib/helpers/parse_link_title.mjs +0 -66
- package/node_modules/markdown-it/lib/index.mjs +0 -565
- package/node_modules/markdown-it/lib/parser_block.mjs +0 -134
- package/node_modules/markdown-it/lib/parser_core.mjs +0 -62
- package/node_modules/markdown-it/lib/parser_inline.mjs +0 -197
- package/node_modules/markdown-it/lib/presets/commonmark.mjs +0 -88
- package/node_modules/markdown-it/lib/presets/default.mjs +0 -47
- package/node_modules/markdown-it/lib/presets/zero.mjs +0 -70
- package/node_modules/markdown-it/lib/renderer.mjs +0 -322
- package/node_modules/markdown-it/lib/ruler.mjs +0 -340
- package/node_modules/markdown-it/lib/rules_block/blockquote.mjs +0 -209
- package/node_modules/markdown-it/lib/rules_block/code.mjs +0 -30
- package/node_modules/markdown-it/lib/rules_block/fence.mjs +0 -94
- package/node_modules/markdown-it/lib/rules_block/heading.mjs +0 -51
- package/node_modules/markdown-it/lib/rules_block/hr.mjs +0 -40
- package/node_modules/markdown-it/lib/rules_block/html_block.mjs +0 -69
- package/node_modules/markdown-it/lib/rules_block/lheading.mjs +0 -82
- package/node_modules/markdown-it/lib/rules_block/list.mjs +0 -331
- package/node_modules/markdown-it/lib/rules_block/paragraph.mjs +0 -46
- package/node_modules/markdown-it/lib/rules_block/reference.mjs +0 -212
- package/node_modules/markdown-it/lib/rules_block/state_block.mjs +0 -220
- package/node_modules/markdown-it/lib/rules_block/table.mjs +0 -228
- package/node_modules/markdown-it/lib/rules_core/block.mjs +0 -13
- package/node_modules/markdown-it/lib/rules_core/inline.mjs +0 -11
- package/node_modules/markdown-it/lib/rules_core/linkify.mjs +0 -134
- package/node_modules/markdown-it/lib/rules_core/normalize.mjs +0 -17
- package/node_modules/markdown-it/lib/rules_core/replacements.mjs +0 -101
- package/node_modules/markdown-it/lib/rules_core/smartquotes.mjs +0 -193
- package/node_modules/markdown-it/lib/rules_core/state_core.mjs +0 -17
- package/node_modules/markdown-it/lib/rules_core/text_join.mjs +0 -43
- package/node_modules/markdown-it/lib/rules_inline/autolink.mjs +0 -72
- package/node_modules/markdown-it/lib/rules_inline/backticks.mjs +0 -60
- package/node_modules/markdown-it/lib/rules_inline/balance_pairs.mjs +0 -124
- package/node_modules/markdown-it/lib/rules_inline/emphasis.mjs +0 -123
- package/node_modules/markdown-it/lib/rules_inline/entity.mjs +0 -51
- package/node_modules/markdown-it/lib/rules_inline/escape.mjs +0 -69
- package/node_modules/markdown-it/lib/rules_inline/fragments_join.mjs +0 -38
- package/node_modules/markdown-it/lib/rules_inline/html_inline.mjs +0 -50
- package/node_modules/markdown-it/lib/rules_inline/image.mjs +0 -138
- package/node_modules/markdown-it/lib/rules_inline/link.mjs +0 -139
- package/node_modules/markdown-it/lib/rules_inline/linkify.mjs +0 -63
- package/node_modules/markdown-it/lib/rules_inline/newline.mjs +0 -42
- package/node_modules/markdown-it/lib/rules_inline/state_inline.mjs +0 -123
- package/node_modules/markdown-it/lib/rules_inline/strikethrough.mjs +0 -127
- package/node_modules/markdown-it/lib/rules_inline/text.mjs +0 -86
- package/node_modules/markdown-it/lib/token.mjs +0 -191
- package/node_modules/markdown-it/package.json +0 -92
- package/node_modules/mdurl/LICENSE +0 -45
- package/node_modules/mdurl/README.md +0 -102
- package/node_modules/mdurl/build/index.cjs.js +0 -534
- package/node_modules/mdurl/index.mjs +0 -11
- package/node_modules/mdurl/lib/decode.mjs +0 -112
- package/node_modules/mdurl/lib/encode.mjs +0 -89
- package/node_modules/mdurl/lib/format.mjs +0 -21
- package/node_modules/mdurl/lib/parse.mjs +0 -308
- package/node_modules/mdurl/package.json +0 -37
- package/node_modules/prosemirror-collab/.tern-project +0 -8
- package/node_modules/prosemirror-collab/CHANGELOG.md +0 -77
- package/node_modules/prosemirror-collab/CONTRIBUTING.md +0 -104
- package/node_modules/prosemirror-collab/LICENSE +0 -19
- package/node_modules/prosemirror-collab/README.md +0 -28
- package/node_modules/prosemirror-collab/dist/index.cjs +0 -155
- package/node_modules/prosemirror-collab/dist/index.d.cts +0 -60
- package/node_modules/prosemirror-collab/dist/index.d.ts +0 -60
- package/node_modules/prosemirror-collab/dist/index.js +0 -156
- package/node_modules/prosemirror-collab/package.json +0 -40
- package/node_modules/prosemirror-collab/src/README.md +0 -11
- package/node_modules/prosemirror-collab/src/collab.ts +0 -184
- package/node_modules/prosemirror-markdown/.tern-project +0 -8
- package/node_modules/prosemirror-markdown/CHANGELOG.md +0 -311
- package/node_modules/prosemirror-markdown/CONTRIBUTING.md +0 -100
- package/node_modules/prosemirror-markdown/README.md +0 -276
- package/node_modules/prosemirror-markdown/dist/index.cjs +0 -966
- package/node_modules/prosemirror-markdown/dist/index.d.cts +0 -335
- package/node_modules/prosemirror-markdown/dist/index.d.ts +0 -335
- package/node_modules/prosemirror-markdown/dist/index.js +0 -878
- package/node_modules/prosemirror-markdown/package.json +0 -40
- package/node_modules/prosemirror-markdown/src/README.md +0 -42
- package/node_modules/prosemirror-markdown/src/from_markdown.ts +0 -272
- package/node_modules/prosemirror-markdown/src/index.ts +0 -5
- package/node_modules/prosemirror-markdown/src/schema.ts +0 -156
- package/node_modules/prosemirror-markdown/src/to_markdown.ts +0 -483
- package/node_modules/prosemirror-menu/.tern-project +0 -8
- package/node_modules/prosemirror-menu/CHANGELOG.md +0 -107
- package/node_modules/prosemirror-menu/CONTRIBUTING.md +0 -100
- package/node_modules/prosemirror-menu/LICENSE +0 -19
- package/node_modules/prosemirror-menu/README.md +0 -235
- package/node_modules/prosemirror-menu/dist/index.cjs +0 -798
- package/node_modules/prosemirror-menu/dist/index.d.cts +0 -281
- package/node_modules/prosemirror-menu/dist/index.d.ts +0 -281
- package/node_modules/prosemirror-menu/dist/index.js +0 -795
- package/node_modules/prosemirror-menu/package.json +0 -42
- package/node_modules/prosemirror-menu/src/README.md +0 -60
- package/node_modules/prosemirror-menu/src/icons.ts +0 -53
- package/node_modules/prosemirror-menu/src/index.ts +0 -4
- package/node_modules/prosemirror-menu/src/menu.ts +0 -628
- package/node_modules/prosemirror-menu/src/menubar.ts +0 -210
- package/node_modules/prosemirror-menu/style/menu.css +0 -169
- package/node_modules/prosemirror-schema-basic/.tern-project +0 -8
- package/node_modules/prosemirror-schema-basic/CHANGELOG.md +0 -81
- package/node_modules/prosemirror-schema-basic/CONTRIBUTING.md +0 -100
- package/node_modules/prosemirror-schema-basic/LICENSE +0 -19
- package/node_modules/prosemirror-schema-basic/README.md +0 -28
- package/node_modules/prosemirror-schema-basic/dist/index.cjs +0 -246
- package/node_modules/prosemirror-schema-basic/dist/index.d.cts +0 -87
- package/node_modules/prosemirror-schema-basic/dist/index.d.ts +0 -87
- package/node_modules/prosemirror-schema-basic/dist/index.js +0 -183
- package/node_modules/prosemirror-schema-basic/package.json +0 -37
- package/node_modules/prosemirror-schema-basic/src/README.md +0 -8
- package/node_modules/prosemirror-schema-basic/src/schema-basic.ts +0 -166
- package/node_modules/prosemirror-trailing-node/LICENSE +0 -21
- package/node_modules/prosemirror-trailing-node/dist/_tsup-dts-rollup.d.cts +0 -41
- package/node_modules/prosemirror-trailing-node/dist/_tsup-dts-rollup.d.ts +0 -41
- package/node_modules/prosemirror-trailing-node/dist/prosemirror-trailing-node.cjs +0 -70
- package/node_modules/prosemirror-trailing-node/dist/prosemirror-trailing-node.d.cts +0 -2
- package/node_modules/prosemirror-trailing-node/dist/prosemirror-trailing-node.d.ts +0 -2
- package/node_modules/prosemirror-trailing-node/dist/prosemirror-trailing-node.js +0 -43
- package/node_modules/prosemirror-trailing-node/dist-types/index.d.ts +0 -2
- package/node_modules/prosemirror-trailing-node/dist-types/trailing-node-plugin.d.ts +0 -33
- package/node_modules/prosemirror-trailing-node/dist-types/tsconfig.tsbuildinfo +0 -1
- package/node_modules/prosemirror-trailing-node/package.json +0 -57
- package/node_modules/prosemirror-trailing-node/readme.md +0 -55
- package/node_modules/punycode.js/LICENSE-MIT.txt +0 -20
- package/node_modules/punycode.js/README.md +0 -148
- package/node_modules/punycode.js/package.json +0 -58
- package/node_modules/punycode.js/punycode.es6.js +0 -444
- package/node_modules/punycode.js/punycode.js +0 -443
- package/node_modules/uc.micro/LICENSE.txt +0 -20
- package/node_modules/uc.micro/README.md +0 -14
- package/node_modules/uc.micro/build/index.cjs.js +0 -20
- package/node_modules/uc.micro/categories/Cc/regex.mjs +0 -1
- package/node_modules/uc.micro/categories/Cf/regex.mjs +0 -1
- package/node_modules/uc.micro/categories/P/regex.mjs +0 -1
- package/node_modules/uc.micro/categories/S/regex.mjs +0 -1
- package/node_modules/uc.micro/categories/Z/regex.mjs +0 -1
- package/node_modules/uc.micro/index.mjs +0 -8
- package/node_modules/uc.micro/package.json +0 -37
- package/node_modules/uc.micro/properties/Any/regex.mjs +0 -1
- /package/dist/{SessionPluginConfigForm-DWLJEYBY.js.map → McpAppFrame-IQK5AOMD.js.map} +0 -0
- /package/dist/{chunk-FTBMG7TK.js.map → SessionPluginConfigForm-VXONUDM4.js.map} +0 -0
- /package/node_modules/@tiptap/pm/{LICENSE.md → LICENSE} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/chat/runtime/input-history-storage.ts","../src/chat/runtime/input-cache-reset.ts","../src/rich-input/lib/plugin-suggestions.ts","../src/chat/runtime/actions.ts","../src/chat/chat-theme.tsx","../src/chat/runtime/input-services.tsx","../src/rich-input/lib/client-query.ts","../src/rich-input/lib/session-data.ts","../src/rich-input/model/model-data.ts","../src/rich-input/services.tsx","../src/components/SessionPluginIcon.tsx","../src/components/lazy-session-plugin-config-form.ts","../src/components/SessionPluginConfigDialog.tsx","../src/components/PluginConnectorList.tsx","../src/components/plugin-connector.ts","../src/components/use-session-plugin-activation.ts","../src/chat/RelatedWork.tsx","../src/lib/message-shortcuts.ts","../src/lib/use-effect-event.ts"],"sourcesContent":["let generation = 0\n\nexport function getInputHistoryGeneration(): number {\n return generation\n}\n\nexport function resetInputHistoryStorage(): void {\n generation += 1\n if (typeof window === \"undefined\") return\n try {\n const keys = Object.keys(window.sessionStorage)\n for (const key of keys) {\n if (key.startsWith(\"input-history:\")) window.sessionStorage.removeItem(key)\n }\n } catch {\n }\n}\n","import type { BladeClient } from \"@blade-hq/agent-client\"\nimport { resetInputHistoryStorage } from \"./input-history-storage\"\n\nconst resetters = new WeakMap<BladeClient, Set<() => void>>()\n\nexport function onInputCachesReset(client: BladeClient, reset: () => void): () => void {\n let set = resetters.get(client)\n if (!set) {\n set = new Set()\n resetters.set(client, set)\n }\n set.add(reset)\n return () => { set.delete(reset) }\n}\n\nexport function resetInputCaches(client: BladeClient): void {\n resetInputHistoryStorage()\n for (const reset of resetters.get(client) ?? []) reset()\n}\n","import type { BladeClient, MessageRef } from \"@blade-hq/agent-client\"\nimport { onInputCachesReset } from \"../../chat/runtime/input-cache-reset\"\nimport type { PluginSuggestionItem, PluginSuggestionError } from \"../extensions/plugin-mention\"\n\nconst accountPreparation = new WeakMap<BladeClient, { token: string | null | undefined; ready: Promise<unknown> }>()\nconst registeredClients = new WeakSet<BladeClient>()\n\nexport function pluginRefsForSend(refs: MessageRef[], turns: readonly { role: string; refs?: MessageRef[] | null }[] = []): MessageRef[] | undefined {\n const latest = [...turns].reverse().find((turn) => turn.role === \"user\")\n return refs.length || latest?.refs?.length ? refs : undefined\n}\n\nfunction prepareAccount(client: BladeClient): Promise<unknown> {\n if (!registeredClients.has(client)) {\n registeredClients.add(client)\n onInputCachesReset(client, () => accountPreparation.delete(client))\n }\n const current = accountPreparation.get(client)\n if (current && current.token === client.token) return current.ready\n const ready = client.plugins.catalog().catch((error) => {\n accountPreparation.delete(client)\n throw error\n })\n accountPreparation.set(client, { token: client.token, ready })\n return ready\n}\n\nexport async function getPluginSuggestionItems(client: BladeClient, session: string | null | undefined, query: string, pendingPlugins: readonly string[] = []): Promise<Array<PluginSuggestionItem | PluginSuggestionError>> {\n if (!session && pendingPlugins.length === 0) return []\n const path = session ? `/api/sessions/${encodeURIComponent(session)}/plugin-tools/mentions` : \"/api/plugin-mentions/mentions\"\n try {\n if (!session) await prepareAccount(client)\n const data = await client.json<{ items: Omit<PluginSuggestionItem, \"kind\" | \"name\">[]; errors: string[] }>(\"POST\", path, { arguments: { query, cursor: \"\" }, ...(!session ? { plugin_selection: pendingPlugins } : {}) })\n return [...data.items.map((item) => ({ ...item, kind: \"plugin\" as const, name: item.label })), ...data.errors.map((message) => ({ kind: \"pluginError\" as const, message }))]\n } catch { return [{ kind: \"pluginError\", message: \"插件条目暂时无法加载,请重新输入 @ 重试\" }] }\n}\n","import { captureClientInputTime, type AgentSession, type InputKind, type MessageContent, type SendOptions, type SessionState } from \"@blade-hq/agent-client/internal\"\n\n/** @deprecated 请通过卡片发送显式回答。 */\nexport function buildPendingAskUserAnswer(\n state: SessionState,\n message: MessageContent,\n): Record<string, unknown> | undefined {\n if (state.status !== \"waiting_for_input\") return undefined\n const text = extractMessageText(message)\n if (!text) return undefined\n for (let turnIndex = state.turns.length - 1; turnIndex >= 0; turnIndex -= 1) {\n const turn = state.turns[turnIndex]\n if (turn.role !== \"assistant\") continue\n for (let toolIndex = turn.tool_calls.length - 1; toolIndex >= 0; toolIndex -= 1) {\n const toolCall = turn.tool_calls[toolIndex]\n if (toolCall.status !== \"awaiting_answer\") continue\n if (!toolCall.tool_name.includes(\"AskUserQuestion\")) continue\n return { tool_call_id: toolCall.id, selections: {}, custom: { \"0\": text } }\n }\n }\n return undefined\n}\n\nfunction extractMessageText(message: MessageContent): string {\n if (typeof message === \"string\") return message.trim()\n return message\n .filter((part) => part.type === \"text\")\n .map((part) => part.text.trim())\n .filter(Boolean)\n .join(\"\\n\")\n .trim()\n}\n\n/** 发送附加项(模型、推理档位、知识库等由富输入给出)。 */\nexport interface ChatSendExtras {\n signal?: AbortSignal\n model?: string\n modeOverride?: SendOptions[\"modeOverride\"]\n thinkingOverride?: boolean\n reasoningLevel?: string\n contextAttachments?: SendOptions[\"contextAttachments\"]\n refs?: SendOptions[\"refs\"]\n topicAssetRefs?: SendOptions[\"topicAssetRefs\"]\n whatif?: SendOptions[\"whatif\"]\n replayDecision?: SendOptions[\"replayDecision\"]\n /**\n * 默认发送引导消息;显式为 true 时,等待当前运行结束后处理。\n */\n queueWhenRunning?: boolean\n releaseNativeWait?: boolean\n inputKind?: InputKind\n receivedAt?: string\n timeZone?: string\n}\n\n/** 向会话发送一条消息。返回服务端是否接受(或已改道进等待队列)。 */\nexport function sendToSession(\n session: AgentSession,\n message: MessageContent,\n mode?: string,\n askUserAnswer?: Record<string, unknown>,\n extras: ChatSendExtras = {},\n): Promise<boolean> {\n extras.signal?.throwIfAborted()\n const captured = captureClientInputTime()\n return session.send(message, {\n signal: extras.signal,\n mode,\n modeOverride: extras.modeOverride,\n askUserAnswer,\n model: extras.model,\n thinkingOverride: extras.thinkingOverride,\n reasoningLevel: extras.reasoningLevel,\n refs: extras.refs,\n contextAttachments: extras.contextAttachments,\n topicAssetRefs: extras.topicAssetRefs,\n whatif: extras.whatif,\n replayDecision: extras.replayDecision,\n queueWhenRunning: extras.queueWhenRunning,\n releaseNativeWait: extras.releaseNativeWait ?? (!askUserAnswer && !extras.queueWhenRunning),\n inputKind: extras.inputKind,\n receivedAt: extras.receivedAt ?? captured.receivedAt,\n timeZone: extras.timeZone ?? captured.timeZone,\n }).then(receipt => receipt.status === \"accepted\")\n}\n","/**\n * 聊天区的语义配色。\n *\n * 全站共用一套令牌(见仓库根 DESIGN.md):中性灰负责层级,颜色只表达状态。\n * 所以「进行中」「思考中」这类过程态走中性色,只有成功 / 警告 / 失败三种结果态\n * 才允许带颜色。\n *\n * 不要在组件里直接写调色板类(text-blue-500 这种)——它们不走 CSS 变量,\n * 切主题时不会变。需要新的语义时加到下面的 TONE_CLASSES 里。\n */\n\n/** 颜色表达的是什么,而不是它长什么样。 */\nexport type ChatTone =\n | \"running\"\n | \"reasoning\"\n | \"success\"\n | \"warning\"\n | \"danger\"\n\ninterface ToneStyle {\n text: string\n border: string\n surface: string\n}\n\nconst NEUTRAL: ToneStyle = {\n text: \"text-[hsl(var(--muted-foreground))]\",\n border: \"border-l-[hsl(var(--swf-border-strong))]\",\n surface: \"bg-[hsl(var(--muted))]\",\n}\n\nconst TONE_CLASSES: Record<ChatTone, ToneStyle> = {\n running: NEUTRAL,\n reasoning: NEUTRAL,\n success: {\n text: \"text-[hsl(var(--swf-success))]\",\n border: \"border-l-[hsl(var(--swf-success))]\",\n surface: \"bg-[hsl(var(--swf-success-soft))]\",\n },\n warning: {\n text: \"text-[hsl(var(--swf-warning))]\",\n border: \"border-l-[hsl(var(--swf-warning))]\",\n surface: \"bg-[hsl(var(--swf-warning-soft))]\",\n },\n danger: {\n text: \"text-[hsl(var(--swf-danger))]\",\n border: \"border-l-[hsl(var(--swf-danger))]\",\n surface: \"bg-[hsl(var(--swf-danger-soft))]\",\n },\n}\n\nexport function chatTone(tone: ChatTone): ToneStyle {\n return TONE_CLASSES[tone]\n}\n","/**\n * 富输入(`@blade-hq/agent-react/rich-input`)可替换的数据来源与宿主部件。富输入对每一项都有基于\n * BladeClient 的默认实现(插件侧栏直接用默认);内置 Web 只在要和自己的 React Query 缓存、\n * 全局 store 打通的地方覆盖,或补上只有它有的部件(远程电脑、外部账号)。\n *\n * 这个上下文放在 internal 入口:内置 Web 在应用根部提供它,不必为此引入富输入的依赖。\n * hook 形式的注入点必须是稳定引用(模块常量),输入框无条件调用。\n */\nimport type { BackgroundTask, ConnectionStatus, SessionContextStats } from \"@blade-hq/agent-client/internal\"\nimport { type ComponentType, createContext, type ReactNode, useContext } from \"react\"\n\n/** 模型目录(`GET /api/config/models`)。 */\nexport interface InputModelOption {\n id: string\n label: string\n inputModalities?: string[]\n supportsImage?: boolean\n thinkingAvailable?: boolean\n reasoningLevels?: string[]\n defaultReasoningLevel?: string\n /** A model from the user's own service, not one the platform provides. */\n personal?: boolean\n}\n\nexport interface InputModelCatalog {\n models: InputModelOption[]\n defaultModel: string\n thinkingAvailable: boolean\n unavailableProviderIds: string[]\n unavailableModelIds: string[]\n isLoading: boolean\n isFetching: boolean\n refresh: () => Promise<void>\n}\n\nexport interface InputModelPreferences {\n /** 用户上次选的模型(新建会话时优先用)。 */\n preferredModel: string | null\n setPreferredModel: (modelId: string) => void\n /** 各模型上次选的推理强度(模型 id → 档位)。 */\n reasoningLevels: Record<string, string>\n setReasoningLevel: (modelId: string, level: string) => void\n}\n\n/** 偏好里存的是 JSON 字符串(模型 id → 档位);坏数据当作没有。 */\nexport function parseModelReasoningLevels(value: string | null | undefined): Record<string, string> {\n if (!value) return {}\n try {\n const parsed: unknown = JSON.parse(value)\n if (!parsed || typeof parsed !== \"object\" || Array.isArray(parsed)) return {}\n return Object.fromEntries(\n Object.entries(parsed).filter(\n (entry): entry is [string, string] => Boolean(entry[0]) && typeof entry[1] === \"string\" && Boolean(entry[1]),\n ),\n )\n } catch {\n return {}\n }\n}\n\nexport interface InputSessionSkill {\n skill_id: string\n display_name?: string | null\n description: string\n local: boolean\n builtin?: boolean\n}\n\nexport interface InputSkillStats {\n loaded_skill_count: number\n loaded_skill_names: string[]\n remote_configured: boolean\n remote_connected: boolean\n installed_skill_count: number\n}\n\nexport interface InputConnection {\n status: ConnectionStatus\n /** 正在第几次重连(0 表示没有在重连)。 */\n reconnectAttempt: number\n hasEverConnected: boolean\n}\n\nexport interface InputDataState<T> {\n data: T | undefined\n loading: boolean\n error: unknown\n}\n\nexport interface ConnectorComputerSectionProps {\n sessionId: string | null\n query: string\n excludedSelection?: string[]\n onExcludedSelectionChange?: (ids: string[]) => void\n /** 收起连接器面板(打开设置之类的动作前调用)。 */\n closePanel: () => void\n}\n\nexport interface ConnectorPhoneSectionProps {\n sessionId: string | null\n query: string\n pendingSelection?: string[]\n onPendingSelectionChange?: (ids: string[]) => void\n /** 收起连接器面板(打开设置之类的动作前调用)。 */\n closePanel: () => void\n}\n\nexport interface RichInputServices {\n useModelCatalog?: () => InputModelCatalog\n useModelPreferences?: () => InputModelPreferences\n /** 知识库清单(`@` 菜单打开时才调用)。 */\n /** 语音是否可用(部署可以关掉);默认不可用,不显示麦克风。 */\n voiceEnabled?: boolean\n /** 语音的 AudioWorklet 脚本地址。 */\n voiceWorkletUrl?: string\n /** 连接状态;默认读当前会话的连接状态(没有会话时视为已连接)。 */\n useConnection?: (sessionId: string | null) => InputConnection\n useSessionSkills?: (sessionId: string | null) => InputDataState<InputSessionSkill[]>\n useSkillStats?: (sessionId: string | null) => InputDataState<InputSkillStats>\n useContextStats?: (sessionId: string | null) => InputDataState<SessionContextStats>\n useBackgroundTasks?: (sessionId: string | null) => InputDataState<BackgroundTask[]>\n /** 宿主在这些变化后刷新自己的缓存(文件树、技能状态)。 */\n useSessionDataInvalidation?: () => {\n filesUploaded: (sessionId: string) => void\n pluginsChanged: (sessionId: string) => void\n }\n /** 连接器面板里的「电脑」分区;不提供时不显示。 */\n ConnectorComputerSection?: ComponentType<ConnectorComputerSectionProps>\n /** 连接器面板里的「手机」分区,渲染在「电脑」下面;不提供时不显示。 */\n ConnectorPhoneSection?: ComponentType<ConnectorPhoneSectionProps>\n /** 连接器面板里的「外部账号」分区;不提供时不显示。 */\n ConnectorAccountsSection?: ComponentType<{ query: string; closePanel: () => void }>\n}\n\nconst RichInputServicesContext = createContext<RichInputServices>({})\n\nexport function RichInputServicesProvider({ value, children }: { value: RichInputServices; children: ReactNode }) {\n return <RichInputServicesContext.Provider value={value}>{children}</RichInputServicesContext.Provider>\n}\n\nexport function useRichInputServices(): RichInputServices {\n return useContext(RichInputServicesContext)\n}\n","/**\n * 富输入默认实现用的小型请求缓存(按 BladeClient 隔离):同一个键在有效期内只请求一次,\n * 并发请求合并成一个,多个组件共享结果。内置 Web 在需要和 React Query 缓存打通的地方\n * 用自己的实现覆盖(见 `RichInputServices`),插件等其他宿主直接用这里。\n */\nimport type { BladeClient } from \"@blade-hq/agent-client\"\nimport { useCallback, useEffect, useSyncExternalStore } from \"react\"\nimport { onInputCachesReset } from \"../../chat/runtime/input-cache-reset\"\nimport { useBladeClient } from \"../../context\"\n\nexport interface ClientQueryState<T> {\n data: T | undefined\n error: unknown\n /** 还没有任何结果(首次加载中)。 */\n isLoading: boolean\n /** 正在请求(含已有结果时的刷新)。 */\n isFetching: boolean\n}\n\ninterface Entry<T> {\n snapshot: ClientQueryState<T>\n fetchedAt: number\n request: Promise<T> | null\n listeners: Set<() => void>\n}\n\nconst EMPTY: ClientQueryState<never> = { data: undefined, error: null, isLoading: false, isFetching: false }\nconst caches = new WeakMap<BladeClient, Map<string, Entry<unknown>>>()\n\nfunction entryFor<T>(client: BladeClient, key: string): Entry<T> {\n let cache = caches.get(client)\n if (!cache) {\n const created = new Map<string, Entry<unknown>>()\n cache = created\n caches.set(client, created)\n onInputCachesReset(client, () => {\n for (const [key, entry] of created) {\n entry.request = null\n entry.fetchedAt = 0\n update(entry, EMPTY)\n const load = loadersFor(client).get(key)\n if (load && entry.listeners.size > 0) void fetchClientQuery(client, key, load, { force: true }).catch(() => {})\n }\n })\n }\n let entry = cache.get(key) as Entry<T> | undefined\n if (!entry) {\n entry = { snapshot: EMPTY, fetchedAt: 0, request: null, listeners: new Set() }\n cache.set(key, entry as Entry<unknown>)\n }\n return entry\n}\n\nfunction update<T>(entry: Entry<T>, patch: Partial<ClientQueryState<T>>) {\n entry.snapshot = { ...entry.snapshot, ...patch }\n for (const listener of [...entry.listeners]) listener()\n}\n\n/** 请求(有效期内且已有结果时直接复用);失败不留结果,下次重试。 */\nexport function fetchClientQuery<T>(\n client: BladeClient,\n key: string,\n load: (client: BladeClient) => Promise<T>,\n { staleMs = 30_000, force = false }: { staleMs?: number; force?: boolean } = {},\n): Promise<T> {\n const entry = entryFor<T>(client, key)\n if (entry.request) return entry.request\n if (!force && entry.snapshot.data !== undefined && Date.now() - entry.fetchedAt < staleMs) {\n return Promise.resolve(entry.snapshot.data)\n }\n const request = Promise.resolve().then(() => load(client))\n entry.request = request\n update(entry, { isFetching: true, isLoading: entry.snapshot.data === undefined })\n request.then(\n (data) => {\n if (entry.request !== request) return\n entry.request = null\n entry.fetchedAt = Date.now()\n update(entry, { data, error: null, isFetching: false, isLoading: false })\n },\n (error: unknown) => {\n if (entry.request !== request) return\n entry.request = null\n update(entry, { error, isFetching: false, isLoading: false })\n },\n )\n return request\n}\n\n/** 直接改缓存里的值(乐观更新);还没有结果时不凭空造一份。 */\nexport function setClientQueryData<T>(client: BladeClient, key: string, updater: (current: T) => T): void {\n const entry = entryFor<T>(client, key)\n if (entry.snapshot.data === undefined) return\n update(entry, { data: updater(entry.snapshot.data) })\n}\n\n/**\n * 读一个键的缓存,挂载(或键变化、过期)时自动请求。`key` 为 null 时不请求。\n * `load` 只在真正发请求时调用,不必是稳定引用。\n */\nexport function useClientQuery<T>(\n key: string | null,\n load: (client: BladeClient) => Promise<T>,\n { staleMs = 30_000 }: { staleMs?: number } = {},\n): ClientQueryState<T> & { refetch: () => Promise<T | undefined> } {\n const client = useBladeClient()\n const subscribe = useCallback(\n (listener: () => void) => {\n if (!key) return () => {}\n const entry = entryFor<T>(client, key)\n entry.listeners.add(listener)\n return () => {\n entry.listeners.delete(listener)\n }\n },\n [client, key],\n )\n const snapshot = useSyncExternalStore(\n subscribe,\n () => (key ? entryFor<T>(client, key).snapshot : EMPTY),\n () => (key ? entryFor<T>(client, key).snapshot : EMPTY),\n )\n if (key) loadersFor(client).set(key, load as (client: BladeClient) => Promise<unknown>)\n useEffect(() => {\n if (!key) return\n const registered = loadersFor(client).get(key) as ((client: BladeClient) => Promise<T>) | undefined\n if (registered) void fetchClientQuery(client, key, registered, { staleMs }).catch(() => {})\n }, [client, key, staleMs])\n const refetch = useCallback(async () => {\n if (!key) return undefined\n const registered = loadersFor(client).get(key) as ((client: BladeClient) => Promise<T>) | undefined\n if (!registered) return undefined\n return fetchClientQuery(client, key, registered, { force: true }).catch(() => undefined)\n }, [client, key])\n return { ...snapshot, refetch }\n}\n\nconst loaderRegistry = new WeakMap<BladeClient, Map<string, (client: BladeClient) => Promise<unknown>>>()\nfunction loadersFor(client: BladeClient) {\n let loaders = loaderRegistry.get(client)\n if (!loaders) {\n loaders = new Map()\n loaderRegistry.set(client, loaders)\n }\n return loaders\n}\n\n/** 让缓存过期并用登记的加载函数重新请求(有组件在用时)。 */\nexport function refreshClientQuery(client: BladeClient, key: string): void {\n const entry = caches.get(client)?.get(key)\n if (!entry) return\n entry.fetchedAt = 0\n const load = loadersFor(client).get(key)\n if (load && entry.listeners.size > 0) void fetchClientQuery(client, key, load, { force: true }).catch(() => {})\n}\n","/**\n * 输入框工具条要读的会话数据:本会话已加载的技能、技能统计、上下文用量、后台任务。\n * 默认实现直接用 BladeClient 请求,一轮回复结束(或收到后台任务事件)时刷新;内置 Web 用\n * React Query 覆盖(由它的事件桥统一失效),见 `RichInputServices`。\n */\nimport type { BackgroundTask, SessionContextStats } from \"@blade-hq/agent-client/internal\"\nimport { useEffect, useRef } from \"react\"\nimport { useBladeClient } from \"../../context\"\nimport { useSessionHandle, useSessionState } from \"../../chat/runtime/session-source\"\nimport type { InputDataState, InputSessionSkill, InputSkillStats } from \"../../chat/runtime/input-services\"\nimport { refreshClientQuery, useClientQuery } from \"./client-query\"\n\nexport type {\n InputDataState as SessionDataState,\n InputSessionSkill as SessionSkillSummary,\n InputSkillStats as SkillStats,\n} from \"../../chat/runtime/input-services\"\nexport type { SessionContextStats }\n\nconst sessionPath = (sessionId: string, rest: string) => `/api/sessions/${encodeURIComponent(sessionId)}/${rest}`\n\n/** 回复结束时让这些键过期重拉(有组件在用时)。 */\nexport function useRefreshWhenRunEnds(sessionId: string | null, keys: string[]) {\n const client = useBladeClient()\n const streaming = useSessionState(sessionId, (state) => state.isStreaming)\n const wasStreaming = useRef(streaming)\n useEffect(() => {\n if (wasStreaming.current && !streaming) {\n for (const key of keys) refreshClientQuery(client, key)\n }\n wasStreaming.current = streaming\n })\n}\n\nexport function useClientSessionSkills(sessionId: string | null): InputDataState<InputSessionSkill[]> {\n const key = sessionId ? `session-skills:${sessionId}` : null\n const query = useClientQuery<InputSessionSkill[]>(key, (client) =>\n client.json(\"GET\", sessionPath(sessionId ?? \"\", \"skills\")),\n )\n useRefreshWhenRunEnds(sessionId, key ? [key] : [])\n return { data: query.data, loading: query.isLoading, error: query.error }\n}\n\nexport function useClientSkillStats(sessionId: string | null): InputDataState<InputSkillStats> {\n const key = sessionId ? `skill-stats:${sessionId}` : null\n const query = useClientQuery<InputSkillStats>(key, (client) => client.json(\"GET\", sessionPath(sessionId ?? \"\", \"skill-stats\")), {\n staleMs: 300_000,\n })\n useRefreshWhenRunEnds(sessionId, key ? [key] : [])\n return { data: query.data, loading: query.isLoading, error: query.error }\n}\n\nexport function useClientContextStats(sessionId: string | null): InputDataState<SessionContextStats> {\n const key = sessionId ? `context-stats:${sessionId}` : null\n const query = useClientQuery<SessionContextStats>(key, (client) =>\n client.json(\"GET\", sessionPath(sessionId ?? \"\", \"context-stats\")),\n )\n useRefreshWhenRunEnds(sessionId, key ? [key] : [])\n return { data: query.data, loading: query.isLoading, error: query.error }\n}\n\nexport function useClientBackgroundTasks(sessionId: string | null): InputDataState<BackgroundTask[]> {\n const client = useBladeClient()\n const key = sessionId ? `background-tasks:${sessionId}` : null\n const query = useClientQuery<BackgroundTask[]>(key, (c) => c.sessions.listBackgroundTasks(sessionId ?? \"\"))\n const session = useSessionHandle(sessionId)\n useEffect(() => {\n if (!session || !key) return\n return session.on(\"backgroundTask\", () => refreshClientQuery(client, key))\n }, [client, key, session])\n return { data: query.data, loading: query.isLoading, error: query.error }\n}\n\n/** 会话的技能变了(连接器开关插件等):让默认实现的技能数据重拉。 */\nexport function refreshClientSessionSkills(client: ReturnType<typeof useBladeClient>, sessionId: string): void {\n refreshClientQuery(client, `session-skills:${sessionId}`)\n refreshClientQuery(client, `skill-stats:${sessionId}`)\n}\n\n/** 会话保存的模型(默认实现:请求会话详情,回复结束时刷新)。 */\nexport function useClientSessionModel(sessionId: string | null): string | null {\n const key = sessionId ? `session-detail:${sessionId}` : null\n const query = useClientQuery(key, (client) => client.sessions.getSession(sessionId ?? \"\"))\n useRefreshWhenRunEnds(sessionId, key ? [key] : [])\n return query.data?.model ?? null\n}\n","/**\n * 模型目录与用户的模型偏好(默认模型、各模型的推理强度)。默认实现直接用 BladeClient 请求;\n * 内置 Web 用自己的 React Query 缓存覆盖(与设置页、启动期偏好共用一份),见 `RichInputServices`。\n */\nimport type { BladeClient } from \"@blade-hq/agent-client\"\nimport { useBladeClient } from \"../../context\"\nimport {\n type InputModelCatalog,\n type InputModelOption,\n type InputModelPreferences,\n parseModelReasoningLevels,\n} from \"../../chat/runtime/input-services\"\nimport { fetchClientQuery, setClientQueryData, useClientQuery } from \"../lib/client-query\"\n\nexport type {\n InputModelCatalog as ModelCatalogState,\n InputModelOption as ModelOption,\n InputModelPreferences as ModelPreferencesState,\n} from \"../../chat/runtime/input-services\"\n\ninterface ModelCatalogResponse {\n default: string\n thinkingAvailable?: boolean\n unavailableProviderIds?: string[]\n unavailableModelIds?: string[]\n models: InputModelOption[]\n}\n\nconst EMPTY_MODELS: InputModelOption[] = []\nconst EMPTY_IDS: string[] = []\nconst CATALOG_KEY = \"model-catalog\"\n\nexport function useClientModelCatalog(): InputModelCatalog {\n const { data, isLoading, isFetching, refetch } = useClientQuery<ModelCatalogResponse>(\n CATALOG_KEY,\n (client) => client.json(\"GET\", \"/api/config/models\"),\n { staleMs: 30_000 },\n )\n return {\n models: data?.models ?? EMPTY_MODELS,\n defaultModel: data?.default ?? \"\",\n thinkingAvailable: data?.thinkingAvailable ?? false,\n unavailableProviderIds: data?.unavailableProviderIds ?? EMPTY_IDS,\n unavailableModelIds: data?.unavailableModelIds ?? EMPTY_IDS,\n isLoading,\n isFetching,\n refresh: async () => {\n await refetch()\n },\n }\n}\n\nexport const PREFERRED_MODEL_KEY = \"preferred_model\"\nexport const MODEL_REASONING_LEVELS_KEY = \"llm.model_thinking_preferences\"\nconst PREFERENCES_KEY = \"model-preferences\"\n\ntype PreferenceValues = Record<string, string | null>\n\nfunction loadPreferences(client: BladeClient): Promise<PreferenceValues> {\n const query = new URLSearchParams()\n query.append(\"key\", PREFERRED_MODEL_KEY)\n query.append(\"key\", MODEL_REASONING_LEVELS_KEY)\n return client\n .json<{ values: PreferenceValues }>(\"GET\", `/api/user/preferences?${query.toString()}`)\n .then((response) => response.values ?? {})\n}\n\nasync function writePreference(client: BladeClient, key: string, value: string) {\n const previous = await fetchClientQuery(client, PREFERENCES_KEY, loadPreferences, { staleMs: 60_000 }).catch(\n () => ({}) as PreferenceValues,\n )\n setClientQueryData<PreferenceValues>(client, PREFERENCES_KEY, (current) => ({ ...current, [key]: value }))\n try {\n await client.json(\"PUT\", `/api/user/preferences/${encodeURIComponent(key)}`, { value })\n } catch {\n setClientQueryData<PreferenceValues>(client, PREFERENCES_KEY, (current) => ({ ...current, [key]: previous[key] ?? null }))\n }\n}\n\nconst EMPTY_LEVELS: Record<string, string> = {}\n\nexport function useClientModelPreferences(): InputModelPreferences {\n const client = useBladeClient()\n const { data } = useClientQuery<PreferenceValues>(PREFERENCES_KEY, loadPreferences, { staleMs: 60_000 })\n const rawLevels = data?.[MODEL_REASONING_LEVELS_KEY] ?? null\n const reasoningLevels = rawLevels ? parseModelReasoningLevels(rawLevels) : EMPTY_LEVELS\n return {\n preferredModel: data?.[PREFERRED_MODEL_KEY] ?? null,\n setPreferredModel: (modelId) => void writePreference(client, PREFERRED_MODEL_KEY, modelId),\n reasoningLevels,\n setReasoningLevel: (modelId, level) => {\n if (!modelId) return\n void writePreference(\n client,\n MODEL_REASONING_LEVELS_KEY,\n JSON.stringify({ ...reasoningLevels, [modelId]: level }),\n )\n },\n }\n}\n","/**\n * 富输入的数据来源:宿主覆盖了就用宿主的(内置 Web 的 React Query 缓存、全局 store),\n * 否则用基于 BladeClient 的默认实现。覆盖点见 `RichInputServices`(internal 入口)。\n */\nimport type { BackgroundTask, ConnectionStatus, SessionContextStats } from \"@blade-hq/agent-client/internal\"\nimport { useMemo, useRef } from \"react\"\nimport {\n type InputConnection,\n type InputDataState,\n type InputModelCatalog,\n type InputModelPreferences,\n type InputSessionSkill,\n type InputSkillStats,\n useRichInputServices,\n} from \"../chat/runtime/input-services\"\nimport { useSessionState } from \"../chat/runtime/session-source\"\nimport { useBladeClient } from \"../context\"\nimport {\n refreshClientSessionSkills,\n useClientBackgroundTasks,\n useClientContextStats,\n useClientSessionSkills,\n useClientSkillStats,\n} from \"./lib/session-data\"\nimport { useClientModelCatalog, useClientModelPreferences } from \"./model/model-data\"\n\nexport {\n type ConnectorComputerSectionProps,\n type ConnectorPhoneSectionProps,\n type InputConnection,\n type InputDataState,\n type InputModelCatalog,\n type InputModelOption,\n type InputModelPreferences,\n type InputSessionSkill,\n type InputSkillStats,\n type RichInputServices,\n RichInputServicesProvider,\n useRichInputServices,\n} from \"../chat/runtime/input-services\"\n\nexport function useModelCatalog(): InputModelCatalog {\n const use = useRichInputServices().useModelCatalog ?? useClientModelCatalog\n return use()\n}\n\nexport function useModelPreferences(): InputModelPreferences {\n const use = useRichInputServices().useModelPreferences ?? useClientModelPreferences\n return use()\n}\n\nfunction useSessionConnection(sessionId: string | null): InputConnection {\n const connection = useSessionState(sessionId, (state) => state.connection)\n const status: ConnectionStatus = sessionId ? connection : \"connected\"\n const everConnected = useRef(false)\n if (status === \"connected\") everConnected.current = true\n return { status, reconnectAttempt: 0, hasEverConnected: everConnected.current }\n}\n\n/** 连接情况:宿主给了就用宿主的(内置 Web 看全局连接),否则看当前会话。 */\nexport function useComposerConnectionInfo(sessionId: string | null): InputConnection {\n const use = useRichInputServices().useConnection ?? useSessionConnection\n return use(sessionId)\n}\n\nexport function useComposerConnection(sessionId: string | null): ConnectionStatus {\n return useComposerConnectionInfo(sessionId).status\n}\n\nexport function useSessionSkills(sessionId: string | null): InputDataState<InputSessionSkill[]> {\n const use = useRichInputServices().useSessionSkills ?? useClientSessionSkills\n return use(sessionId)\n}\n\nexport function useSkillStats(sessionId: string | null): InputDataState<InputSkillStats> {\n const use = useRichInputServices().useSkillStats ?? useClientSkillStats\n return use(sessionId)\n}\n\nexport function useContextStats(sessionId: string | null): InputDataState<SessionContextStats> {\n const use = useRichInputServices().useContextStats ?? useClientContextStats\n return use(sessionId)\n}\n\nexport function useBackgroundTaskList(sessionId: string | null): InputDataState<BackgroundTask[]> {\n const use = useRichInputServices().useBackgroundTasks ?? useClientBackgroundTasks\n return use(sessionId)\n}\n\nfunction useClientSessionDataInvalidation() {\n const client = useBladeClient()\n return useMemo(\n () => ({\n filesUploaded: (_sessionId: string) => {},\n pluginsChanged: (sessionId: string) => refreshClientSessionSkills(client, sessionId),\n }),\n [client],\n )\n}\n\n/** 附件上传、插件开关之后让相关数据刷新。 */\nexport function useSessionDataInvalidation() {\n const use = useRichInputServices().useSessionDataInvalidation ?? useClientSessionDataInvalidation\n return use()\n}\n","import type { BladeClient, SessionPlugin } from \"@blade-hq/agent-client/internal\"\nimport { Puzzle } from \"lucide-react\"\nimport { useEffect, useState } from \"react\"\n\nexport interface SessionPluginIconProps {\n client: BladeClient\n /**\n * 会话内已准备的包。传 `null` 时改用账号级目录图标(`/api/plugins/{name}/icon`),\n * 这样首页这种还没有会话的地方也能显示包内图标。\n */\n sessionId: string | null\n /** Also accepts the package data image returned by the connector catalog. */\n plugin: Pick<SessionPlugin, \"name\" | \"icon\">\n /** 边长,默认 20。 */\n size?: number\n /**\n * 外框形状:`rounded`(默认,面板列表里的小方角)或 `circle`(触发器上的头像堆叠)。\n * 默认值不动,避免改到列表与第三方接入方的观感。\n */\n shape?: \"rounded\" | \"circle\"\n className?: string\n}\n\nexport interface SessionPluginLabelProps {\n plugin: Pick<SessionPlugin, \"name\" | \"display_name\">\n}\n\n/**\n * Business name for a plugin, falling back to the technical ID.\n *\n * The ID stays authoritative for paths, authorization, caching and calls; this\n * helper only decides what a user reads. Keep it shared — one place decides.\n */\nexport function sessionPluginLabel(plugin: Pick<SessionPlugin, \"name\" | \"display_name\">): string {\n const display = typeof plugin.display_name === \"string\" ? plugin.display_name.trim() : \"\"\n return display || plugin.name\n}\n\nconst clientCaches = new WeakMap<BladeClient, Map<string, Promise<Blob | null>>>()\nconst BLOB_CACHE_LIMIT = 64\n\nfunction iconBlob(client: BladeClient, sessionId: string | null, name: string, token: string): Promise<Blob | null> {\n let blobCache = clientCaches.get(client)\n if (!blobCache) {\n blobCache = new Map()\n clientCaches.set(client, blobCache)\n }\n const key = sessionId ? `${sessionId}:${name}:${token}` : `account:${name}:${token}`\n const cached = blobCache.get(key)\n if (cached) return cached\n const pending = (sessionId\n ? client.sessions.fetchSessionPluginIcon(sessionId, name)\n : client.plugins.fetchIcon(name)\n ).catch(() => {\n blobCache?.delete(key)\n return null\n })\n if (blobCache.size >= BLOB_CACHE_LIMIT) blobCache.clear()\n blobCache.set(key, pending)\n return pending\n}\n\n/** Package-local plugin icon, with a stable generic placeholder. */\nexport function SessionPluginIcon({ client, sessionId, plugin, size = 20, shape = \"rounded\", className }: SessionPluginIconProps) {\n const [url, setUrl] = useState<string | null>(null)\n const token = plugin.icon\n const inlineIcon = token && /^data:image\\/(?:png|jpeg|gif|webp);base64,/.test(token) ? token : null\n\n useEffect(() => {\n setUrl(null)\n if (!token || inlineIcon) return\n let alive = true\n let objectUrl: string | null = null\n void iconBlob(client, sessionId, plugin.name, token).then((blob) => {\n if (!alive || !blob) return\n objectUrl = URL.createObjectURL(blob)\n setUrl(objectUrl)\n })\n return () => {\n alive = false\n if (objectUrl) URL.revokeObjectURL(objectUrl)\n }\n }, [client, sessionId, plugin.name, token, inlineIcon])\n\n const frame = `flex shrink-0 items-center justify-center overflow-hidden ${shape === \"circle\" ? \"rounded-full\" : \"rounded\"} ${className ?? \"\"}`\n const frameStyle = { width: size, height: size }\n const source = url === \"\" ? null : inlineIcon ?? url\n if (!source) {\n return (\n <span className={`${frame} bg-[hsl(var(--muted))] text-[hsl(var(--muted-foreground))]`} style={frameStyle} data-plugin-icon=\"placeholder\">\n <Puzzle aria-hidden size={Math.round(size * 0.7)} />\n </span>\n )\n }\n return (\n <span className={frame} style={frameStyle} data-plugin-icon=\"image\">\n <img src={source} alt=\"\" aria-hidden className=\"h-full w-full object-cover\" onError={() => setUrl(\"\")} />\n </span>\n )\n}\n","import { lazy } from \"react\"\n\nexport const SessionPluginConfigForm = lazy(async () => ({\n default: (await import(\"./SessionPluginConfigForm\")).SessionPluginConfigForm,\n}))\n","import type {\n BladeClient,\n SessionPlugin,\n SessionPluginConfigError,\n SessionPluginConfigState,\n} from \"@blade-hq/agent-client/internal\"\nimport { Suspense, useEffect, useRef, useState } from \"react\"\nimport type { SessionPluginConfigDraft } from \"./SessionPluginConfigForm\"\nimport { SessionPluginIcon, sessionPluginLabel } from \"./SessionPluginIcon\"\nimport { SessionPluginConfigForm } from \"./lazy-session-plugin-config-form\"\n\n\nexport interface SessionPluginConfigDialogProps {\n client: BladeClient\n sessionId: string\n plugin: Pick<SessionPlugin, \"name\" | \"display_name\" | \"icon\">\n /** Called after every successful save with the freshly published state. */\n onSaved?: (state: SessionPluginConfigState) => void\n onClose: () => void\n}\n\ninterface FailureDetail {\n message?: string\n errors?: SessionPluginConfigError[]\n code?: string\n}\n\nasync function readFailure(error: unknown): Promise<FailureDetail> {\n const response = (error as { response?: Response } | undefined)?.response\n if (!response || typeof response.json !== \"function\") {\n return { message: \"配置未保存,请稍后重试\" }\n }\n try {\n const body = (await response.json()) as { detail?: string | FailureDetail }\n const detail = body?.detail\n if (typeof detail === \"string\") return { message: detail }\n if (detail && typeof detail === \"object\") {\n return {\n message: detail.message ?? \"配置未保存,请检查填写内容\",\n errors: Array.isArray(detail.errors) ? detail.errors : undefined,\n code: detail.code,\n }\n }\n } catch {\n }\n return { message: \"配置未保存,请稍后重试\" }\n}\n\nexport function SessionPluginConfigDialog({\n client,\n sessionId,\n plugin,\n ...props\n}: SessionPluginConfigDialogProps) {\n return (\n <ConfigDialogState\n key={`${sessionId}:${plugin.name}`}\n client={client}\n sessionId={sessionId}\n plugin={plugin}\n {...props}\n />\n )\n}\n\nfunction ConfigDialogState({\n client,\n sessionId,\n plugin,\n onSaved,\n onClose,\n}: SessionPluginConfigDialogProps) {\n const [host, setHost] = useState<{ state: string; digest: string; revision: string; reason: string; restarts: number; recent?: string[] } | null>(null)\n const [restarting, setRestarting] = useState(false)\n const [scope, setScope] = useState<\"personal\" | \"global\">(\"personal\")\n const [config, setConfig] = useState<SessionPluginConfigState | null>(null)\n const pendingRevision = scope === \"global\" && host?.state === \"ready\" && config?.revision != null && host.revision !== config.revision\n const waitingForHost = host?.state === \"starting\" || host?.state === \"updating\" || pendingRevision\n useEffect(() => {\n if (!waitingForHost) return\n const abort = new AbortController()\n let timer: ReturnType<typeof setTimeout>\n const refresh = async () => {\n try {\n const next = await client.sessions.getSessionPluginConfig(sessionId, plugin.name, { signal: abort.signal }, scope)\n if (!abort.signal.aborted) setHost(next.host ?? null)\n } catch {\n }\n if (!abort.signal.aborted) timer = setTimeout(refresh, 2000)\n }\n timer = setTimeout(refresh, 2000)\n return () => { abort.abort(); clearTimeout(timer) }\n }, [client, sessionId, plugin.name, scope, waitingForHost])\n const [canConfigureGlobal, setCanConfigureGlobal] = useState(false)\n const [loading, setLoading] = useState(true)\n const [loadFailure, setLoadFailure] = useState<string | null>(null)\n const [saving, setSaving] = useState(false)\n const [failure, setFailure] = useState<string | null>(null)\n const [fieldErrors, setFieldErrors] = useState<SessionPluginConfigError[]>([])\n const [formVersion, setFormVersion] = useState(0)\n const alive = useRef(true)\n const generation = useRef(0)\n const dialog = useRef<HTMLDialogElement>(null)\n\n useEffect(() => {\n const element = dialog.current\n if (!element || element.open) return\n if (typeof element.showModal === \"function\") element.showModal()\n else element.setAttribute(\"open\", \"\")\n }, [])\n\n const load = async () => {\n const current = ++generation.current\n setLoading(true)\n setLoadFailure(null)\n try {\n const { config: state, can_configure_global,host: hostState } = await client.sessions.getSessionPluginConfig(sessionId, plugin.name, undefined, scope)\n if (!alive.current || generation.current !== current) return\n setCanConfigureGlobal(can_configure_global ?? false)\n setHost(hostState ?? null)\n setConfig(state)\n setFormVersion((value) => value + 1)\n } catch (error) {\n if (!alive.current || generation.current !== current) return\n const detail = await readFailure(error)\n if (!alive.current || generation.current !== current) return\n setLoadFailure(detail.message ?? \"配置暂不可用\")\n } finally {\n if (alive.current && generation.current === current) setLoading(false)\n }\n }\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: 会话或插件变化就是新的读取生命周期。\n useEffect(() => {\n alive.current = true\n setConfig(null)\n setFailure(null)\n setFieldErrors([])\n void load()\n return () => {\n alive.current = false\n generation.current++\n }\n }, [client, sessionId, plugin.name, scope])\n\n const save = async (draft: SessionPluginConfigDraft) => {\n if (!config) return\n const current = generation.current\n setSaving(true)\n setFailure(null)\n setFieldErrors([])\n try {\n const { config: state } = await client.sessions.updateSessionPluginConfig(\n sessionId,\n plugin.name,\n {\n expected_revision: config.revision,\n set: draft.set,\n remove: draft.remove,\n },\n undefined,\n scope,\n )\n if (!alive.current || generation.current !== current) return\n setConfig(state)\n setFormVersion((value) => value + 1)\n if (scope === \"personal\") onSaved?.(state)\n } catch (error) {\n if (!alive.current || generation.current !== current) return\n const detail = await readFailure(error)\n if (!alive.current || generation.current !== current) return\n setFailure(detail.message ?? \"配置未保存,请稍后重试\")\n setFieldErrors(detail.errors ?? [])\n if (detail.code === \"plugin_config_conflict\") await load()\n } finally {\n if (alive.current) setSaving(false)\n }\n }\n\n return (\n <>\n <style>{\".blade-plugin-dialog::backdrop { background: rgb(0 0 0 / 40%); }\"}</style>\n <dialog\n ref={dialog}\n aria-modal=\"true\"\n aria-label={`${sessionPluginLabel(plugin)} 配置`}\n onCancel={(event) => {\n event.preventDefault()\n onClose()\n }}\n onKeyDown={(event) => {\n if (event.key !== \"Escape\") return\n event.preventDefault()\n event.stopPropagation()\n onClose()\n }}\n style={{\n position: \"fixed\",\n inset: 0,\n margin: \"auto\",\n boxSizing: \"border-box\",\n width: \"min(448px, calc(100% - 32px))\",\n }}\n className=\"blade-plugin-dialog max-h-[80vh] overflow-y-auto rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--popover))] p-4 text-[hsl(var(--popover-foreground))] shadow-lg\"\n >\n <div className=\"mb-3 flex items-center gap-2\">\n <SessionPluginIcon client={client} sessionId={sessionId} plugin={plugin} />\n <span\n className=\"min-w-0 flex-1 truncate text-sm font-medium\"\n title={sessionPluginLabel(plugin)}\n >\n {sessionPluginLabel(plugin)}\n </span>\n <button\n type=\"button\"\n aria-label=\"关闭\"\n className=\"shrink-0 text-xs underline\"\n onClick={onClose}\n >\n 关闭\n </button>\n </div>\n {canConfigureGlobal ? (\n <div className=\"mb-3 flex gap-2 text-xs\">\n <button type=\"button\" disabled={saving} aria-pressed={scope === \"personal\"} onClick={() => setScope(\"personal\")}>我的登录</button>\n <button type=\"button\" disabled={saving} aria-pressed={scope === \"global\"} onClick={() => setScope(\"global\")}>组织共享配置</button>\n </div>\n ) : null}\n {host ? <div className=\"mb-3 space-y-1 text-xs\">\n <p>服务:{pendingRevision ? \"正在更新\" : host.reason} · 已恢复 {host.restarts} 次</p>\n {canConfigureGlobal ? <>\n <p className=\"break-all text-[hsl(var(--muted-foreground))]\">包摘要:{host.digest} · 配置:{host.revision}</p>\n <button type=\"button\" disabled={restarting || saving} onClick={() => {\n setRestarting(true)\n void client.sessions.restartSessionPluginHost(sessionId, plugin.name)\n .then(() => load()).catch(() => setFailure(\"服务暂时不可用,请稍后重试\"))\n .finally(() => { if (alive.current) setRestarting(false) })\n }}>{restarting ? \"正在重启…\" : \"重启服务\"}</button>\n {host.recent?.length ? <details><summary>最近活动</summary>{host.recent.map((line, index) => <p key={`${index}-${line}`}>{line}</p>)}</details> : null}\n </> : null}\n </div> : null}\n {scope === \"personal\" && config?.auth_status === \"expired\" ? <p className=\"mb-2 text-xs\">登录已过期,请重新填写</p> : null}\n {scope === \"personal\" && config?.global_ready === false ? <p className=\"mb-2 text-xs\">请联系管理员填写共享配置</p> : null}\n {scope === \"global\" ? <p className=\"mb-2 text-xs\">共享密钥用于插件服务。命令类插件的沙盒代码可以读取它;需保密时请使用托管服务。</p> : null}\n {loading ? (\n <p className=\"text-xs text-[hsl(var(--muted-foreground))]\">正在读取配置…</p>\n ) : null}\n {loadFailure ? (\n <div className=\"space-y-2 text-xs\">\n <p>{loadFailure}</p>\n <button\n type=\"button\"\n className=\"rounded-full border border-[hsl(var(--border))] px-2.5 py-1\"\n onClick={() => void load()}\n >\n 重试\n </button>\n </div>\n ) : null}\n {config && !loading ? (\n <Suspense fallback={<output>正在读取连接表单…</output>}>\n <SessionPluginConfigForm\n key={formVersion}\n config={config}\n submitting={saving}\n errors={fieldErrors}\n failure={failure}\n onSubmit={(draft) => void save(draft)}\n onCancel={onClose}\n />\n </Suspense>\n ) : null}\n </dialog>\n </>\n )\n}\n","import type { BladeClient, SessionPluginConfigState } from \"@blade-hq/agent-client/internal\"\nimport { Loader2 } from \"lucide-react\"\nimport { SessionPluginConfigDialog } from \"./SessionPluginConfigDialog\"\nimport { SessionPluginIcon, sessionPluginLabel } from \"./SessionPluginIcon\"\nimport type { PluginConnectorItem } from \"./plugin-connector\"\n\nexport interface ConfiguringPlugin {\n name: string\n /**\n * 这次打开表单是不是「为了启用它」。\n *\n * 只有用户在开关上表达了启用意图时才为 true:已经跑起来的插件再保存配置\n * 不应该顺手重启 / 重新激活(见 SessionPluginSelector 的历史约定)。\n */\n pendingActivation: boolean\n}\n\nexport interface PluginConnectorListProps {\n client: BladeClient\n /** 会话内插件用会话接口取图标;首页候选(null)用账号级目录。 */\n sessionId: string | null\n items: PluginConnectorItem[]\n /** 正在提交意图的行;开关转圈,但仍然可点(点是取消)。 */\n inFlight: Record<string, true>\n /** 有启用/停用请求在飞,会写服务端的行先锁住次要操作。 */\n busy: boolean\n /** 上一次操作失败,给出重试入口。 */\n mutationError: boolean\n onToggle: (item: PluginConnectorItem, next: boolean) => void\n onRetry: (item: PluginConnectorItem) => void\n onEditConfig: (item: PluginConnectorItem) => void\n configuring: ConfiguringPlugin | null\n onConfigSaved: (state: SessionPluginConfigState) => void\n onConfigClose: () => void\n /** 开关不可用时说明原因,而不是静默禁用。 */\n disabledReason?: string | null\n /**\n * 列表本身不可用(读取失败 / 搜索无结果)时的说明;有值时不再叠加「还没装插件」,\n * 否则会把一次故障或一次没搜到说成「你这个账号没装东西」。\n */\n unavailableText?: string | null\n emptyText: string\n /** 首页待选模式:开关的语义是\"待选\",不是\"已经启用\"。 */\n draft?: boolean\n}\n\nfunction PluginSwitch({\n label,\n checked,\n pending,\n disabled,\n draft = false,\n onToggle,\n}: {\n label: string\n checked: boolean\n pending: boolean\n disabled: boolean\n draft?: boolean\n onToggle: (next: boolean) => void\n}) {\n return (\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={checked}\n aria-label={draft ? `${label} 待选` : `${label} 启用`}\n disabled={disabled}\n onClick={() => onToggle(!checked)}\n className={`relative inline-flex h-[18px] w-8 shrink-0 cursor-pointer items-center rounded-full border transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${\n checked\n ? \"border-transparent bg-[hsl(213_94%_55%)]\"\n : \"border-[hsl(var(--border))] bg-[hsl(var(--muted))]\"\n }`}\n >\n <span\n aria-hidden=\"true\"\n className={`pointer-events-none flex h-3.5 w-3.5 items-center justify-center rounded-full bg-white shadow transition-transform ${\n checked ? \"translate-x-[16px]\" : \"translate-x-[2px]\"\n }`}\n >\n {pending ? <Loader2 size={9} className=\"animate-spin text-[hsl(var(--muted-foreground))]\" /> : null}\n </span>\n </button>\n )\n}\n\n/**\n * 连接器面板里的插件列表。\n *\n * 首页与会话共用同一份渲染:开关是开关,候选是候选,行的存在与状态无关——\n * 没启用、没图标也要显示名称和占位,不隐藏整行。\n */\nexport function PluginConnectorList({\n client,\n sessionId,\n items,\n inFlight,\n busy,\n mutationError,\n onToggle,\n onRetry,\n onEditConfig,\n configuring,\n onConfigSaved,\n onConfigClose,\n disabledReason,\n unavailableText,\n emptyText,\n draft = false,\n}: PluginConnectorListProps) {\n const configuringItem = configuring\n ? items.find((item) => item.name === configuring.name) ?? null\n : null\n\n return (\n <div className=\"py-0.5\">\n {disabledReason ? (\n <div className=\"px-3 py-1.5 text-[11px] text-[hsl(var(--muted-foreground))]\">\n {disabledReason}\n </div>\n ) : null}\n {items.length === 0 ? (\n <div className=\"px-3 py-1.5 text-[11px] text-[hsl(var(--muted-foreground))]\">\n {unavailableText ?? emptyText}\n </div>\n ) : null}\n {items.map((item) => {\n const label = sessionPluginLabel(item)\n const actionable = (!disabledReason && item.installed !== false) || item.active\n const pending = Boolean(inFlight[item.name])\n const checked = item.active\n return (\n <div key={item.name} className=\"group px-3 py-1\">\n <div className=\"flex items-center gap-2\">\n <SessionPluginIcon\n client={client}\n sessionId={item.iconSource === \"account\" ? null : sessionId}\n plugin={item}\n />\n <span className=\"min-w-0 flex-1 truncate text-[11px]\" title={label}>\n {label}\n </span>\n {item.auth_status === \"expired\" || item.auth_status === \"login_required\" || item.auth_status === \"unavailable\" ? (\n <button type=\"button\" disabled={!sessionId || busy} onClick={() => onEditConfig(item)} className=\"shrink-0 text-[10px] underline\">\n {item.auth_status === \"expired\" ? \"登录已过期\" : item.auth_status === \"unavailable\" ? \"暂时不可用\" : \"未登录\"}\n </button>\n ) : null}\n {!draft && item.config === \"configured\" ? (\n <button\n type=\"button\"\n title=\"更新该插件的配置\"\n disabled={busy || !sessionId}\n onClick={() => onEditConfig(item)}\n className=\"shrink-0 text-[10px] text-[hsl(var(--muted-foreground))] underline opacity-0 [@media(hover:none)]:opacity-100 transition-opacity focus-visible:opacity-100 group-hover:opacity-100 disabled:cursor-not-allowed disabled:opacity-50\"\n >\n 更新配置\n </button>\n ) : null}\n {!draft && (item.config === \"required\" || item.config === \"error\") ? (\n <button\n type=\"button\"\n title=\"该插件需要填写配置\"\n disabled={busy || !sessionId}\n onClick={() => onEditConfig(item)}\n className=\"shrink-0 text-[10px] text-[hsl(var(--muted-foreground))] underline disabled:cursor-not-allowed disabled:opacity-50\"\n >\n 填写配置\n </button>\n ) : null}\n <PluginSwitch\n label={label}\n checked={checked}\n pending={pending}\n draft={draft}\n disabled={!actionable}\n onToggle={(next) => onToggle(item, next)}\n />\n </div>\n {!draft && item.active && item.status !== \"valid\" && item.status !== \"required\" ? (\n <div className=\"mt-0.5 flex items-center gap-2 pl-7 text-[10px] text-[hsl(var(--muted-foreground))]\">\n <span>{item.reason || \"插件暂不可用\"}</span>\n <button\n type=\"button\"\n disabled={busy}\n onClick={() => onRetry(item)}\n className=\"underline disabled:cursor-not-allowed disabled:opacity-50\"\n >\n 重试\n </button>\n </div>\n ) : null}\n </div>\n )\n })}\n {mutationError ? (\n <div className=\"px-3 pt-1 text-[10px] text-[hsl(var(--destructive))]\">\n 操作未完成,请重试\n </div>\n ) : null}\n {configuring && configuringItem && sessionId ? (\n <SessionPluginConfigDialog\n client={client}\n sessionId={sessionId}\n plugin={configuringItem}\n onSaved={onConfigSaved}\n onClose={onConfigClose}\n />\n ) : null}\n </div>\n )\n}\n","import type { PluginCatalogEntry, SessionPlugin, SessionPluginConfigSummary } from \"@blade-hq/agent-client/internal\"\n\n/**\n * 连接器面板里的一行插件。\n *\n * 展示字段(名称、图标)和启用状态分开表达:目录接口在没有会话时也能给出名称与\n * 图标,而「这次会话是否启用」只有会话接口知道。首页候选行恒为 `active: false`,\n * 因为它只是待选,不代表已经激活。\n */\nexport interface PluginConnectorItem {\n name: string\n display_name: string | null\n /** 图标 token;null 时显示统一占位,不隐藏整行。 */\n icon: string | null\n /** 图标从哪个接口取:账号级目录,还是会话内已准备的包。 */\n iconSource: \"account\" | \"session\"\n auth_status?: PluginCatalogEntry[\"auth_status\"]\n installed: boolean | null\n connector?: boolean\n /** 会话里已提交的选择;首页候选恒为 false。 */\n active: boolean\n status: string\n reason?: string | null\n config?: SessionPluginConfigSummary\n projected: boolean\n}\n\n/** 首页候选:只有账号级目录,没有会话状态。 */\nexport function catalogToConnectorItems(catalog: PluginCatalogEntry[]): PluginConnectorItem[] {\n return catalog.map((entry) => ({\n name: entry.name,\n display_name: entry.display_name,\n icon: entry.icon,\n iconSource: \"account\",\n installed: entry.installed,\n connector: entry.connector,\n auth_status: entry.auth_status,\n active: false,\n status: \"not_prepared\",\n projected: false,\n }))\n}\n\n/**\n * 会话列表叠加账号目录。\n *\n * 目录可用时展示字段以目录为准(包可能还没准备,会话列表拿不到名称和图标),\n * 目录不可用时退回会话行自己的字段,这样已选插件仍然可以取消。\n */\nexport function mergeConnectorItems(\n sessionPlugins: SessionPlugin[],\n catalog: PluginCatalogEntry[] | null,\n): PluginConnectorItem[] {\n const byName = new Map((catalog ?? []).map((entry) => [entry.name, entry]))\n return sessionPlugins.map((plugin) => {\n const entry = byName.get(plugin.name)\n if (!entry) {\n return {\n name: plugin.name,\n display_name: plugin.display_name ?? null,\n icon: plugin.icon ?? null,\n iconSource: \"session\" as const,\n installed: plugin.installed,\n active: plugin.active,\n status: plugin.status,\n reason: plugin.reason,\n config: plugin.config,\n projected: plugin.projected,\n }\n }\n return {\n name: plugin.name,\n display_name: entry.display_name ?? plugin.display_name ?? null,\n icon: entry.icon,\n iconSource: \"account\" as const,\n installed: entry.installed,\n connector: entry.connector,\n auth_status: entry.auth_status,\n active: plugin.active,\n status: plugin.status,\n reason: plugin.reason,\n config: plugin.config,\n projected: plugin.projected,\n }\n })\n}\n\n/**\n * 一行的配置说明文案;权威状态来自配置接口。\n *\n * `unchecked` 刻意没有文案:列表没有读过用户的 Home,说任何话都是噪音,\n * 入口是开关本身。\n */\n/** 按名称和显示名做本地过滤;空查询返回全部。 */\nexport function filterConnectorItems(\n items: PluginConnectorItem[],\n query: string,\n): PluginConnectorItem[] {\n const needle = query.trim().toLowerCase()\n if (!needle) return items\n return items.filter((item) =>\n `${item.display_name ?? \"\"} ${item.name}`.toLowerCase().includes(needle),\n )\n}\n","import { isLocalConnectorName } from \"@blade-hq/agent-client/internal\"\nimport type {\n BladeClient,\n PluginCatalogEntry,\n SessionPlugin,\n SessionPluginActivation,\n SessionPluginConfigState,\n} from \"@blade-hq/agent-client/internal\"\nimport { useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore } from \"react\"\nimport type { ConfiguringPlugin } from \"./PluginConnectorList\"\nimport {\n mergeConnectorItems,\n type PluginConnectorItem,\n} from \"./plugin-connector\"\n\nexport interface UseSessionPluginActivationResult {\n catalog: PluginCatalogEntry[] | null\n catalogScope: number\n items: PluginConnectorItem[]\n loading: boolean\n /** 插件列表本身读不到(Hub 不可用等),已有选择仍然可取消。 */\n listError: boolean\n /** 某次启用/停用/准备失败了。 */\n mutationError: boolean\n /** 正在为哪些插件提交意图;对应的开关在转圈,但仍然可点(点是取消)。 */\n inFlight: Record<string, true>\n busy: boolean\n configuring: ConfiguringPlugin | null\n reload: () => void\n toggle: (item: PluginConnectorItem, next: boolean) => void\n retry: (item: PluginConnectorItem) => void\n editConfig: (item: PluginConnectorItem) => void\n onConfigSaved: (state: SessionPluginConfigState) => void\n onConfigClose: () => void\n}\n\n/**\n * 会话内插件启用的唯一实现。\n *\n * 顺序是「先准备配置,再提交 activation」:缺配置时开关不落到已启用、立刻弹表单,\n * 保存成功才提交;取消、校验失败、配置读取失败都不提交。绝不先持久化 active=true\n * 再靠补偿关掉——那样用户下次刷新会看到一个从没被成功打开的插件。\n *\n * 停用仍然直接提交:在服务端它只是取消一条数据库选择,不准备包、不连 MCP。但如果\n * 这次「启用」只是还在准备、压根没提交过 activation,取消就只是放弃本地意图。\n *\n * 所有异步响应都按 (lifetime, mutation) 校验:迟到的准备或激活结果不会把已经取消 /\n * 已经切走会话的插件重新打开;反过来,旧响应发现服务端落库顺序与用户最新意图不同时,\n * 会重新提交最新意图。\n */\nexport function useSessionPluginActivation({\n client,\n sessionId,\n onChange,\n}: {\n client: BladeClient\n sessionId: string\n onChange?: (plugin: SessionPluginActivation) => void\n}): UseSessionPluginActivationResult {\n const [plugins, setPlugins] = useState<SessionPlugin[]>([])\n const subscribe = useCallback((listener: () => void) => client.plugins.subscribeCatalog(listener), [client])\n const catalog = useSyncExternalStore(subscribe, () => client.plugins.getCatalogSnapshot()) ?? null\n const catalogScope = useSyncExternalStore(subscribe, () => client.plugins.getCatalogScope())\n const [loading, setLoading] = useState(false)\n const [listError, setListError] = useState(false)\n const [mutationError, setMutationError] = useState(false)\n const [inFlight, setInFlight] = useState<Record<string, true>>({})\n const [configuring, setConfiguring] = useState<ConfiguringPlugin | null>(null)\n const alive = useRef(true)\n const generation = useRef(0)\n const mutationGenerations = useRef(new Map<string, number>())\n const desiredActivations = useRef(new Map<string, boolean>())\n const pendingMutations = useRef(new Map<string, number>())\n const submittedActivations = useRef(new Set<string>())\n const serverActive = useRef(new Set<string>())\n const lifetime = useRef(0)\n const request = useRef<AbortController | null>(null)\n const [desiredVersion, setDesiredVersion] = useState(0)\n\n const setDesired = useCallback((name: string, value: boolean | null) => {\n if (value === null) {\n if (!desiredActivations.current.delete(name)) return\n } else {\n if (desiredActivations.current.get(name) === value) return\n desiredActivations.current.set(name, value)\n }\n setDesiredVersion((version) => version + 1)\n }, [])\n\n const items = useMemo(() => {\n void desiredVersion\n const merged = mergeConnectorItems(plugins, catalog)\n return merged.map((item) => {\n if (configuring?.name === item.name && configuring.pendingActivation) {\n return { ...item, active: false }\n }\n const desired = desiredActivations.current.get(item.name)\n return desired === undefined ? item : { ...item, active: desired }\n })\n }, [catalog, configuring, desiredVersion, plugins])\n\n const markInFlight = useCallback((name: string, on: boolean) => {\n setInFlight((current) => {\n if (on) return current[name] ? current : { ...current, [name]: true }\n if (!current[name]) return current\n const { [name]: removed, ...rest } = current\n void removed\n return rest\n })\n }, [])\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: A different client starts a new ownership scope.\n useEffect(() => {\n alive.current = true\n setPlugins([])\n setLoading(false)\n setListError(false)\n setMutationError(false)\n setInFlight({})\n setConfiguring(null)\n desiredActivations.current.clear()\n mutationGenerations.current.clear()\n pendingMutations.current.clear()\n submittedActivations.current.clear()\n return () => {\n alive.current = false\n lifetime.current++\n generation.current++\n request.current?.abort()\n }\n }, [client, catalogScope])\n\n const load = useCallback(async () => {\n if (!alive.current) return\n request.current?.abort()\n const controller = new AbortController()\n request.current = controller\n const current = ++generation.current\n setLoading(true)\n setListError(false)\n try {\n const result = await client.sessions.listSessionPlugins(sessionId, { signal: controller.signal })\n const withConfig = await Promise.all(\n result.plugins.map(async (item) => {\n if (isLocalConnectorName(item.name) || item.config !== undefined && item.config !== \"unchecked\") return item\n try {\n const { config } = await client.sessions.getSessionPluginConfig(sessionId, item.name, {\n signal: controller.signal,\n })\n return { ...item, config: config.state }\n } catch {\n return item\n }\n }),\n )\n if (alive.current && current === generation.current) {\n serverActive.current = new Set(withConfig.filter((item) => item.active).map((item) => item.name))\n setPlugins(withConfig.map((item) => {\n const desired = desiredActivations.current.get(item.name)\n return desired === undefined ? item : { ...item, active: desired }\n }))\n }\n } catch {\n if (alive.current && current === generation.current && !controller.signal.aborted) setListError(true)\n } finally {\n if (alive.current && current === generation.current) setLoading(false)\n }\n }, [client, sessionId])\n\n const loadCatalog = useCallback(async () => {\n try {\n await client.plugins.catalog()\n } catch {\n }\n }, [client])\n\n const reload = useCallback(() => {\n if (catalogScope !== client.plugins.getCatalogScope()) return\n void load()\n void loadCatalog()\n }, [client, catalogScope, load, loadCatalog])\n\n const abandon = useCallback((name: string) => {\n setDesired(name, null)\n pendingMutations.current.delete(name)\n mutationGenerations.current.set(name, (mutationGenerations.current.get(name) ?? 0) + 1)\n markInFlight(name, false)\n void load()\n }, [load, markInFlight, setDesired])\n\n const finish = useCallback((name: string, mutation: number) => {\n pendingMutations.current.delete(name)\n setDesired(name, null)\n if (mutation === mutationGenerations.current.get(name)) markInFlight(name, false)\n }, [markInFlight, setDesired])\n\n const commitActivation = useCallback(\n async (name: string, active: boolean, mutation: number, startedAt: number) => {\n submittedActivations.current.add(name)\n try {\n const { plugin } = await client.sessions.setSessionPluginActivation(sessionId, name, active)\n if (!alive.current || startedAt !== lifetime.current) return\n if (mutation !== mutationGenerations.current.get(name)) {\n const desired = desiredActivations.current.get(name)\n if (desired !== undefined && desired !== plugin.active) {\n const next = (mutationGenerations.current.get(name) ?? 0) + 1\n mutationGenerations.current.set(name, next)\n pendingMutations.current.set(name, next)\n markInFlight(name, true)\n await commitActivation(name, desired, next, startedAt)\n }\n return\n }\n if (active) serverActive.current.add(name)\n else serverActive.current.delete(name)\n finish(name, mutation)\n setPlugins((current) => current.map((item) => item.name === plugin.name ? { ...item, ...plugin } : item))\n onChange?.(plugin)\n if (plugin.active && plugin.status === \"required\") {\n setConfiguring({ name: plugin.name, pendingActivation: true })\n }\n await load()\n } catch {\n if (alive.current && startedAt === lifetime.current && mutation === mutationGenerations.current.get(name)) {\n pendingMutations.current.delete(name)\n submittedActivations.current.delete(name)\n setDesired(name, null)\n markInFlight(name, false)\n setMutationError(true)\n void load()\n }\n }\n },\n [client, finish, load, markInFlight, onChange, sessionId, setDesired],\n )\n\n const enable = useCallback(async (name: string) => {\n if (!alive.current) return\n const startedAt = lifetime.current\n const mutation = (mutationGenerations.current.get(name) ?? 0) + 1\n mutationGenerations.current.set(name, mutation)\n pendingMutations.current.set(name, mutation)\n setDesired(name, true)\n setMutationError(false)\n markInFlight(name, true)\n request.current?.abort()\n generation.current++\n setLoading(false)\n let state: SessionPluginConfigState\n try {\n const result = await client.sessions.prepareSessionPluginConfig(sessionId, name)\n if (!alive.current || startedAt !== lifetime.current || mutation !== mutationGenerations.current.get(name)) return\n state = result.config\n } catch {\n if (!alive.current || startedAt !== lifetime.current || mutation !== mutationGenerations.current.get(name)) return\n abandon(name)\n setMutationError(true)\n return\n }\n if (state.state === \"required\") {\n pendingMutations.current.delete(name)\n markInFlight(name, false)\n setConfiguring({ name, pendingActivation: true })\n return\n }\n if (state.state !== \"configured\" && state.state !== \"not_required\") {\n abandon(name)\n setMutationError(true)\n return\n }\n setPlugins((current) => current.map((item) => item.name === name ? { ...item, config: state.state } : item))\n await commitActivation(name, true, mutation, startedAt)\n }, [abandon, client, commitActivation, markInFlight, sessionId, setDesired])\n\n const disable = useCallback((name: string) => {\n const startedAt = lifetime.current\n request.current?.abort()\n generation.current++\n setLoading(false)\n if (!submittedActivations.current.has(name) && !serverActive.current.has(name)) {\n abandon(name)\n return\n }\n const mutation = (mutationGenerations.current.get(name) ?? 0) + 1\n mutationGenerations.current.set(name, mutation)\n pendingMutations.current.set(name, mutation)\n setDesired(name, false)\n setMutationError(false)\n markInFlight(name, true)\n void commitActivation(name, false, mutation, startedAt)\n }, [abandon, commitActivation, markInFlight, setDesired])\n\n const toggle = useCallback((item: PluginConnectorItem, next: boolean) => {\n if (next) void enable(item.name)\n else disable(item.name)\n }, [disable, enable])\n\n const retry = useCallback((item: PluginConnectorItem) => {\n void enable(item.name)\n }, [enable])\n\n const editConfig = useCallback((item: PluginConnectorItem) => {\n setConfiguring({ name: item.name, pendingActivation: false })\n }, [])\n\n const onConfigSaved = useCallback((state: SessionPluginConfigState) => {\n const target = configuring\n if (!target) return\n setConfiguring(null)\n void loadCatalog()\n setPlugins((current) => current.map((item) => item.name === target.name ? { ...item, config: state.state } : item))\n if (!target.pendingActivation || state.state !== \"configured\") {\n void load()\n return\n }\n const startedAt = lifetime.current\n const mutation = (mutationGenerations.current.get(target.name) ?? 0) + 1\n mutationGenerations.current.set(target.name, mutation)\n pendingMutations.current.set(target.name, mutation)\n setDesired(target.name, true)\n markInFlight(target.name, true)\n void commitActivation(target.name, true, mutation, startedAt)\n }, [commitActivation, configuring, load, loadCatalog, markInFlight, setDesired])\n\n const onConfigClose = useCallback(() => {\n const target = configuring\n if (!target) return\n setConfiguring(null)\n if (target.pendingActivation) abandon(target.name)\n else void load()\n }, [abandon, configuring, load])\n\n return {\n catalog, catalogScope, items,\n loading,\n listError,\n mutationError,\n inFlight,\n busy: Object.keys(inFlight).length > 0,\n configuring,\n reload,\n toggle,\n retry,\n editConfig,\n onConfigSaved,\n onConfigClose,\n }\n}\n","import {\n completionNotice,\n namedSubagent,\n type CompletionNotice,\n type ToolCallInfo,\n} from \"@blade-hq/agent-client/internal\"\nimport { Dialog, DialogContent, DialogTitle } from \"@blade-hq/ui/composites/dialog\"\nimport { ArrowUpRight, Bot, ClipboardList, Terminal } from \"lucide-react\"\nimport { createContext, type ReactNode, useContext, useEffect, useState } from \"react\"\nimport { useBladeClient } from \"../context\"\nimport { useChatEnvironment } from \"./runtime/environment\"\nimport { useCurrentChatSessionId, useSessionState } from \"./runtime/session-source\"\n\nexport type RelatedWork = { sessionId: string; title: string } |\n { sessionId: string; taskId: string; title: string }\n\nexport const RelatedWorkContext = createContext<(target: RelatedWork) => void>(() => {})\n\n/** The same log reader is used by the completion link and the input toolbar. */\nexport function BackgroundLogDialog({\n sessionId,\n taskId,\n title,\n onClose,\n}: { sessionId: string; taskId: string; title: string; onClose: () => void }) {\n const client = useBladeClient()\n const [output, setOutput] = useState<string | null>(null)\n useEffect(() => {\n let disposed = false\n setOutput(null)\n void client.sessions.getBackgroundTask(sessionId, taskId, 300).then(\n (detail) => { if (!disposed) setOutput(detail.output || \"暂无输出\") },\n () => { if (!disposed) setOutput(\"日志已无法读取,可能已被清理\") },\n )\n return () => { disposed = true }\n }, [client, sessionId, taskId])\n\n return (\n <Dialog open onOpenChange={(open) => { if (!open) onClose() }}>\n <DialogContent aria-describedby={undefined} className=\"flex max-h-[82vh] max-w-3xl flex-col gap-0 overflow-hidden p-0\">\n <DialogTitle className=\"border-b border-[hsl(var(--border))] px-4 py-4 pr-14\">\n {title || \"后台任务日志\"}\n </DialogTitle>\n <pre className=\"min-h-32 overflow-auto whitespace-pre-wrap break-words p-4 text-xs leading-5\">\n {output ?? \"正在加载日志…\"}\n </pre>\n </DialogContent>\n </Dialog>\n )\n}\n\nexport function CompletionNoticeRow({ notice }: { notice: CompletionNotice }) {\n const environment = useChatEnvironment()\n const open = useContext(RelatedWorkContext)\n const currentSession = useCurrentChatSessionId()\n const { source, title } = notice\n const kind = source.source_kind\n const isCommand = kind === \"bg_bash\"\n const isBoard = kind === \"board\"\n const label = isCommand ? \"后台任务已结束\" : isBoard ? \"看板任务已结束\" : \"子智能体已结束\"\n const Icon = isCommand ? Terminal : isBoard ? ClipboardList : Bot\n const boardTarget = isBoard && source.project_id && source.task_id && environment.openBoardTask\n const canOpen = isCommand ? !!(source.task_id && currentSession) : !!(boardTarget || source.source_session_id)\n const display = title.replace(/^((?:子智能体|看板任务) .+?) 已结束([^\\n]*?)(?=\\n|$)/, \"$1\")\n .replace(/^(子智能体 )\\/root\\//, \"$1\")\n const action = isCommand ? \"查看日志\" : boardTarget ? \"查看任务\" : \"查看完整执行过程\"\n const handleOpen = () => {\n if (isCommand && source.task_id && currentSession) {\n open({ sessionId: currentSession, taskId: source.task_id, title: display || label })\n } else if (isBoard && source.project_id && source.task_id && environment.openBoardTask) {\n environment.openBoardTask(source.project_id, source.task_id)\n } else if (source.source_session_id) {\n open({ sessionId: source.source_session_id, title: display.split(\"\\n\")[0] || label })\n }\n }\n return (\n <div className=\"flex items-start gap-2 rounded-lg border border-[hsl(var(--border))] px-3 py-2 text-sm\">\n <Icon size={15} className=\"mt-0.5 shrink-0 text-[hsl(var(--muted-foreground))]\" />\n <div className=\"min-w-0 flex-1\">\n <div className=\"font-medium\">{label}</div>\n {display && <div className=\"mt-1 whitespace-pre-wrap break-words text-xs text-[hsl(var(--muted-foreground))]\">{display}</div>}\n </div>\n {canOpen && <WorkLink onClick={handleOpen}>{action}</WorkLink>}\n </div>\n )\n}\n\nexport function NamedSubagentCard({ tool, sessionId }: { tool: ToolCallInfo; sessionId?: string }) {\n const agent = namedSubagent(tool)\n const open = useContext(RelatedWorkContext)\n const runStatus = useSessionState(sessionId, (state) => {\n if (!agent?.sessionId) return \"运行中\"\n for (const turn of state.turns) {\n const source = completionNotice(turn.blocks)?.source\n if (source?.source_kind === \"subagent\" && source.source_session_id === agent.sessionId &&\n (!agent.requestId || source.source_request_id === agent.requestId)) {\n switch (source.status) {\n case \"completed\": return \"已完成\"\n case \"failed\": return \"执行失败\"\n case \"interrupted\":\n case \"cancelled\": return \"已中断\"\n default: return \"已结束\"\n }\n }\n }\n return \"运行中\"\n })\n if (!agent) return null\n const failed = tool.status === \"error\" || tool.status === \"cancelled\"\n return (\n <div className=\"flex items-center gap-2 rounded-lg border border-[hsl(var(--border))] px-3 py-2 text-sm\">\n <Bot size={16} className=\"shrink-0 text-[hsl(var(--muted-foreground))]\" />\n <span className=\"min-w-0 flex-1 truncate font-medium\">{agent.name}</span>\n {agent.action === \"send\" && (\n <span className=\"shrink-0 text-xs text-[hsl(var(--muted-foreground))]\">补充指令</span>\n )}\n <span className=\"shrink-0 text-xs text-[hsl(var(--muted-foreground))]\">\n {failed ? (agent.action === \"send\" ? \"发送失败\" : \"未能启动\") : runStatus}\n </span>\n {agent.sessionId && (\n <WorkLink onClick={() => { if (agent.sessionId) open({ sessionId: agent.sessionId, title: agent.name }) }}>\n 查看\n </WorkLink>\n )}\n </div>\n )\n}\n\nfunction WorkLink({ children, onClick }: { children: ReactNode; onClick: () => void }) {\n return (\n <button\n type=\"button\"\n onClick={onClick}\n className=\"inline-flex shrink-0 items-center gap-1 rounded px-1.5 py-1 text-xs font-medium text-[hsl(var(--primary))] hover:bg-[hsl(var(--accent))] focus-visible:outline focus-visible:outline-[hsl(var(--ring))]\"\n >\n {children}<ArrowUpRight size={12} aria-hidden=\"true\" />\n </button>\n )\n}\n","function usesCommandKey(): boolean {\n if (typeof navigator === \"undefined\") return false\n return /Mac|iPhone|iPad|iPod/i.test(navigator.platform || navigator.userAgent)\n}\n\nexport function queueShortcutLabel(): string {\n return usesCommandKey() ? \"⌘ Enter\" : \"Ctrl Enter\"\n}\n\nexport function isQueueShortcut(event: { metaKey: boolean; ctrlKey: boolean }): boolean {\n return usesCommandKey() ? event.metaKey : event.ctrlKey\n}\n","import * as React from \"react\"\n\ntype AnyFunction = (...args: never[]) => unknown\n\n/**\n * `useEffectEvent`:React 19.2 起内置;本包还要支持 React 18,缺失时用 ref 实现同样的语义——\n * 返回的函数总是调用最新一次渲染的回调,只能在 effect / 事件回调里调用,不能写进依赖数组。\n */\nfunction useEffectEventShim<T extends AnyFunction>(callback: T): T {\n const ref = React.useRef(callback)\n React.useLayoutEffect(() => {\n ref.current = callback\n })\n return React.useCallback(((...args) => ref.current(...args)) as T, [])\n}\n\nconst builtin = (React as unknown as { useEffectEvent?: <T extends AnyFunction>(callback: T) => T }).useEffectEvent\n\nexport const useEffectEvent: <T extends AnyFunction>(callback: T) => T = builtin ?? useEffectEventShim\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAI,aAAa;AAEV,SAAS,4BAAoC;AAClD,SAAO;AACT;AAEO,SAAS,2BAAiC;AAC/C,gBAAc;AACd,MAAI,OAAO,WAAW,YAAa;AACnC,MAAI;AACF,UAAM,OAAO,OAAO,KAAK,OAAO,cAAc;AAC9C,eAAW,OAAO,MAAM;AACtB,UAAI,IAAI,WAAW,gBAAgB,EAAG,QAAO,eAAe,WAAW,GAAG;AAAA,IAC5E;AAAA,EACF,QAAQ;AAAA,EACR;AACF;;;ACbA,IAAM,YAAY,oBAAI,QAAsC;AAErD,SAAS,mBAAmB,QAAqB,OAA+B;AACrF,MAAI,MAAM,UAAU,IAAI,MAAM;AAC9B,MAAI,CAAC,KAAK;AACR,UAAM,oBAAI,IAAI;AACd,cAAU,IAAI,QAAQ,GAAG;AAAA,EAC3B;AACA,MAAI,IAAI,KAAK;AACb,SAAO,MAAM;AAAE,QAAI,OAAO,KAAK;AAAA,EAAE;AACnC;AAEO,SAAS,iBAAiB,QAA2B;AAC1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AU;AAAA,EAChB,CAAC;AACD,SAAa,mBAAa,IAAI,SAAS,IAAI,QAAQ,GAAG,IAAI,IAAS,CAAC,CAAC;AACvE;AAEA,IAAM,UAA+F;AAE9F,IAAMM,kBAA4D,WAAW;","names":["key","entry","useEffect","useEffect","useRef","useRef","useEffect","jsx","useEffect","useRef","useState","jsx","useState","useEffect","useRef","generation","jsx","jsxs","useCallback","useEffect","useMemo","useRef","useState","useSyncExternalStore","useState","useCallback","useSyncExternalStore","useRef","generation","useMemo","useEffect","createContext","useContext","useEffect","useState","jsx","jsxs","createContext","useState","useEffect","useContext","useEffectEvent"]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// src/chat/plan/presentation.ts
|
|
2
|
+
function hasRealBranching(nodes) {
|
|
3
|
+
const outgoing = /* @__PURE__ */ new Map();
|
|
4
|
+
let roots = 0;
|
|
5
|
+
for (const node of nodes) {
|
|
6
|
+
const dependencies = new Set(node.depends_on);
|
|
7
|
+
if (dependencies.size > 1) return true;
|
|
8
|
+
if (dependencies.size === 0 && ++roots > 1) return true;
|
|
9
|
+
for (const dependency of dependencies) {
|
|
10
|
+
const count = (outgoing.get(dependency) ?? 0) + 1;
|
|
11
|
+
if (count > 1) return true;
|
|
12
|
+
outgoing.set(dependency, count);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
function selectPlanPresentation(plan) {
|
|
18
|
+
if (plan.phase === "draft" || plan.nodes.length > 4 || plan.nodes.some((node) => node.parent_id || node.agent_ref) || hasRealBranching(plan.nodes)) return "graph";
|
|
19
|
+
return "compact-bar";
|
|
20
|
+
}
|
|
21
|
+
function isTerminalPlanStatus(status) {
|
|
22
|
+
return status === "done" || status === "skipped" || status === "failed";
|
|
23
|
+
}
|
|
24
|
+
function deriveParentStatus(children) {
|
|
25
|
+
if (children.some((node) => node.status === "running")) return "running";
|
|
26
|
+
if (children.some((node) => node.status === "failed")) return "failed";
|
|
27
|
+
if (children.every((node) => node.status === "skipped")) return "skipped";
|
|
28
|
+
if (children.every((node) => isTerminalPlanStatus(node.status))) return "done";
|
|
29
|
+
return "pending";
|
|
30
|
+
}
|
|
31
|
+
var planStatusLabels = {
|
|
32
|
+
pending: "\u5F85\u5F00\u59CB",
|
|
33
|
+
running: "\u8FDB\u884C\u4E2D",
|
|
34
|
+
done: "\u5DF2\u5B8C\u6210",
|
|
35
|
+
failed: "\u672A\u6210\u529F",
|
|
36
|
+
skipped: "\u5DF2\u8DF3\u8FC7"
|
|
37
|
+
};
|
|
38
|
+
function matchingPlanExecution(ref, execution) {
|
|
39
|
+
if (!ref.execution_id || !execution?.child_session_id || execution.agent !== ref.agent || execution.execution_id !== ref.execution_id || ref.request_id && execution.request_id !== ref.request_id) return void 0;
|
|
40
|
+
return execution;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export {
|
|
44
|
+
selectPlanPresentation,
|
|
45
|
+
isTerminalPlanStatus,
|
|
46
|
+
deriveParentStatus,
|
|
47
|
+
planStatusLabels,
|
|
48
|
+
matchingPlanExecution
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=chunk-7WR2KG5O.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/chat/plan/presentation.ts"],"sourcesContent":["import type { PlanAgentRef, PlanDocument, PlanLeafStatus, PlanNode } from \"@blade-hq/agent-client\"\n\nexport function hasRealBranching(nodes: PlanNode[]): boolean {\n const outgoing = new Map<string, number>()\n let roots = 0\n for (const node of nodes) {\n const dependencies = new Set(node.depends_on)\n if (dependencies.size > 1) return true\n if (dependencies.size === 0 && ++roots > 1) return true\n for (const dependency of dependencies) {\n const count = (outgoing.get(dependency) ?? 0) + 1\n if (count > 1) return true\n outgoing.set(dependency, count)\n }\n }\n return false\n}\n\nexport function selectPlanPresentation(plan: PlanDocument): \"compact-bar\" | \"graph\" {\n if (plan.phase === \"draft\" || plan.nodes.length > 4 ||\n plan.nodes.some((node) => node.parent_id || node.agent_ref) || hasRealBranching(plan.nodes)) return \"graph\"\n return \"compact-bar\"\n}\n\nexport function isTerminalPlanStatus(status?: PlanLeafStatus): boolean {\n return status === \"done\" || status === \"skipped\" || status === \"failed\"\n}\n\nexport function deriveParentStatus(children: PlanNode[]): PlanLeafStatus {\n if (children.some((node) => node.status === \"running\")) return \"running\"\n if (children.some((node) => node.status === \"failed\")) return \"failed\"\n if (children.every((node) => node.status === \"skipped\")) return \"skipped\"\n if (children.every((node) => isTerminalPlanStatus(node.status))) return \"done\"\n return \"pending\"\n}\n\nexport const planStatusLabels: Record<PlanLeafStatus, string> = {\n pending: \"待开始\",\n running: \"进行中\",\n done: \"已完成\",\n failed: \"未成功\",\n skipped: \"已跳过\",\n}\n\nexport interface PlanAgentExecution {\n child_session_id: string\n agent: string\n execution_id: string\n request_id?: string\n status: string\n}\n\nexport interface PlanAgentActions {\n findExecution?: (ref: PlanAgentRef) => PlanAgentExecution | undefined\n openExecution?: (execution: PlanAgentExecution) => void\n}\n\nexport function matchingPlanExecution(ref: PlanAgentRef, execution?: PlanAgentExecution): PlanAgentExecution | undefined {\n if (!ref.execution_id || !execution?.child_session_id || execution.agent !== ref.agent ||\n execution.execution_id !== ref.execution_id ||\n (ref.request_id && execution.request_id !== ref.request_id)) return undefined\n return execution\n}\n"],"mappings":";AAEO,SAAS,iBAAiB,OAA4B;AAC3D,QAAM,WAAW,oBAAI,IAAoB;AACzC,MAAI,QAAQ;AACZ,aAAW,QAAQ,OAAO;AACxB,UAAM,eAAe,IAAI,IAAI,KAAK,UAAU;AAC5C,QAAI,aAAa,OAAO,EAAG,QAAO;AAClC,QAAI,aAAa,SAAS,KAAK,EAAE,QAAQ,EAAG,QAAO;AACnD,eAAW,cAAc,cAAc;AACrC,YAAM,SAAS,SAAS,IAAI,UAAU,KAAK,KAAK;AAChD,UAAI,QAAQ,EAAG,QAAO;AACtB,eAAS,IAAI,YAAY,KAAK;AAAA,IAChC;AAAA,EACF;AACA,SAAO;AACT;AA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