@blade-hq/agent-react 2610.0.0-beta.50 → 2610.0.0-beta.51

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 CHANGED
@@ -187,6 +187,8 @@ await replay.exitToAutonomous() // 退出回放,之后真的运
187
187
 
188
188
  记忆引用提示可通过 `MemoryRefsHint` 展示,`collectMemoryRefs` 用于从一轮消息中聚合引用,保证宿主自定义消息布局与 SDK 默认界面保持一致。
189
189
 
190
+ MCP App 卡片(`tool_ui` block)在默认消息流里自动渲染,无需配置;自建消息布局时可用 `ToolUiCardView` 渲染单个卡片,并传入 `sessionId` 启用共享 AppBridge。卡片的实例、内容解析与终态(archived 留档不重放)判定来自 agent-client 的共享层(`collectInlineToolUiCards` / `resolveToolUiCardContent` 等)。preview 卡片不进消息流,由 `toolPreview` 事件推给宿主自建面板。
191
+
190
192
  `onFollowupInteraction` 使用 `FollowupInteractionEvent`,覆盖下一步建议展示/采纳、成果展示/打开/下载以及结果评分。SDK 不内置分析服务;宿主回调抛错也不会中断用户点击或下载。
191
193
  文件成果以文件名为文本的标准下载链接展示;Vue / 纯 HTML 使用的 `<blade-chat>` 与 `ChatView` 行为一致。
192
194
 
@@ -393,3 +395,12 @@ blade-chat { --primary: 262 83% 58%; height: 640px; }
393
395
  ### 会话插件
394
396
 
395
397
  默认 `AgentChat` / 智能体模式 `ChatView` 自带会话插件选择器,展开时查询 BH,选择按当前会话保存。准备失败会保留勾选并提供重试。独立嵌入可使用 `<SessionPluginSelector client={client} sessionId={id} />`;`sessionPluginControls` 可覆盖默认控件。组件参数类型为 `SessionPluginSelectorProps`。
398
+
399
+ 列表项用插件声明的业务名称与随包本地图标展示(`sessionPluginLabel(plugin)` 与 `<SessionPluginIcon client={client} sessionId={id} plugin={plugin} />`,两者都可单独复用,参数类型为 `SessionPluginLabelProps` / `SessionPluginIconProps`);没有声明或图标不可用时回退技术 ID 与通用占位。授权、缓存、调用一律仍用 `plugin.name`。
400
+
401
+ 插件的账号、token 等配置由包内 JSON Schema 声明,选择器就地提供填写入口:首次激活缺配置的插件会直接弹出表单(`<SessionPluginConfigDialog client={client} sessionId={id} plugin={plugin} />`),已配置的插件在行内提供「配置」按钮。表单本体是 `<SessionPluginConfigForm>`,参数与提交类型为 `SessionPluginConfigFormProps` / `SessionPluginConfigDraft`,也可单独嵌入;`SessionPluginConfigDialogProps` 是对话框的参数类型。
402
+
403
+ 表单只呈现它确定能呈现的 JSON Schema 构造(字符串/数值/布尔/null、对象与数组、枚举、`properties` 内的 `writeOnly`,以及用同一字段的 `const` 固定的 `oneOf` 分支);遇到无法安全呈现的写法直接说明原因,不降级成手写 JSON、不静默丢字段。`writeOnly` 字段永不回显:留空表示保持不变,输入表示修改,显式「清除」才会删除。
404
+ ### MCP Apps
405
+
406
+ `McpAppCard` 使用官方 AppBridge 渲染归档卡片,内置 Web 消费同一组件。在 `BladeProvider` 下传入会话 ID 与来源 ID,也可直接提供 `BladeClient`。`McpAppMessage` 表示 App 提供的文本;`McpAppMessageContext` 将其交给当前对话的待发送区。用户可在 `ChatView` 查看、移除并确认发送。`update-model-context` 会把 App 提交的当前状态经 `sessions.updateMcpAppContext` 存为会话上下文:只落库、不追加聊天、不启动 agent turn,正在运行的一轮保持启动时版本,下一个新的运行才读取;冲突(409)时重读最新 revision 后重提同一份状态一次。
@@ -0,0 +1,36 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __commonJS = (cb, mod) => function __require() {
8
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9
+ };
10
+ var __export = (target, all) => {
11
+ for (var name in all)
12
+ __defProp(target, name, { get: all[name], enumerable: true });
13
+ };
14
+ var __copyProps = (to, from, except, desc) => {
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from))
17
+ if (!__hasOwnProp.call(to, key) && key !== except)
18
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
+ // If the importer is in node compatibility mode or this is not an ESM
24
+ // file that has been converted to a CommonJS file using a Babel-
25
+ // compatible transform (i.e. "__esModule" has not been set), then set
26
+ // "default" to the CommonJS "module.exports" for node compatibility.
27
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
28
+ mod
29
+ ));
30
+
31
+ export {
32
+ __commonJS,
33
+ __export,
34
+ __toESM
35
+ };
36
+ //# sourceMappingURL=chunk-G3PMV62Z.js.map
@@ -1,32 +1,8 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __commonJS = (cb, mod) => function __require() {
8
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9
- };
10
- var __export = (target, all5) => {
11
- for (var name2 in all5)
12
- __defProp(target, name2, { get: all5[name2], enumerable: true });
13
- };
14
- var __copyProps = (to2, from, except, desc) => {
15
- if (from && typeof from === "object" || typeof from === "function") {
16
- for (let key of __getOwnPropNames(from))
17
- if (!__hasOwnProp.call(to2, key) && key !== except)
18
- __defProp(to2, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19
- }
20
- return to2;
21
- };
22
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
- // If the importer is in node compatibility mode or this is not an ESM
24
- // file that has been converted to a CommonJS file using a Babel-
25
- // compatible transform (i.e. "__esModule" has not been set), then set
26
- // "default" to the CommonJS "module.exports" for node compatibility.
27
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
28
- mod
29
- ));
1
+ import {
2
+ __commonJS,
3
+ __export,
4
+ __toESM
5
+ } from "./chunk-G3PMV62Z.js";
30
6
 
31
7
  // ../../node_modules/.pnpm/inline-style-parser@0.2.7/node_modules/inline-style-parser/cjs/index.js
32
8
  var require_cjs = __commonJS({
@@ -27409,7 +27385,7 @@ var Se2 = createContext({ code: "" });
27409
27385
  var de2 = () => useContext(Se2);
27410
27386
  var ot = ({ language: e }) => jsx("div", { className: "flex h-8 items-center text-muted-foreground text-xs", "data-language": e, "data-streamdown": "code-block-header", children: jsx("span", { className: "ml-1 font-mono lowercase", children: e }) });
27411
27387
  var cn2 = /\n+$/;
27412
- var dn2 = lazy(() => import("./highlighted-body-B3W2YXNL-YD7FAP6V.js").then((e) => ({ default: e.HighlightedCodeBlockBody })));
27388
+ var dn2 = lazy(() => import("./highlighted-body-B3W2YXNL-IASCZDV2.js").then((e) => ({ default: e.HighlightedCodeBlockBody })));
27413
27389
  var rt2 = ({ code: e, language: t, className: o, children: n, isIncomplete: s2 = false, ...r2 }) => {
27414
27390
  let i = useMemo(() => e.replace(cn2, ""), [e]), c = useMemo(() => ({ bg: "transparent", fg: "inherit", tokens: i.split(`
27415
27391
  `).map((a2) => [{ content: a2, color: "inherit", bgColor: "transparent", htmlStyle: {}, offset: 0 }]) }), [i]);
@@ -27756,7 +27732,7 @@ var Dt = ({ children: e, className: t, onDownload: o, onError: n }) => {
27756
27732
  }, []), jsxs("div", { className: "relative", ref: i, children: [jsx("button", { className: f2("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50", t), disabled: c, onClick: () => r2(!s2), title: "Download table", type: "button", children: e != null ? e : jsx(Z3, { size: 14 }) }), s2 ? jsxs("div", { className: "absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg", children: [jsx("button", { className: "w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40", onClick: () => a2("csv"), title: "Download table as CSV", type: "button", children: "CSV" }), jsx("button", { className: "w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40", onClick: () => a2("markdown"), title: "Download table as Markdown", type: "button", children: "Markdown" })] }) : null] });
27757
27733
  };
27758
27734
  var Vt = ({ children: e, className: t, showControls: o, ...n }) => jsxs("div", { className: "my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2", "data-streamdown": "table-wrapper", children: [o ? jsxs("div", { className: "flex items-center justify-end gap-1", children: [jsx(Ht, {}), jsx(Dt, {})] }) : null, jsx("div", { className: "border-collapse overflow-x-auto overscroll-y-auto rounded-md border border-border bg-background", children: jsx("table", { className: f2("w-full divide-y divide-border", t), "data-streamdown": "table", ...n, children: e }) })] });
27759
- var Jn = lazy(() => import("./mermaid-3ZIDBTTL-N7YKJ3SM.js").then((e) => ({ default: e.Mermaid })));
27735
+ var Jn = lazy(() => import("./mermaid-3ZIDBTTL-BPVVWTVV.js").then((e) => ({ default: e.Mermaid })));
27760
27736
  var Kn2 = /language-([^\s]+)/;
27761
27737
  function ke2(e, t) {
27762
27738
  if (!(e != null && e.position || t != null && t.position)) return true;
@@ -28252,4 +28228,4 @@ export {
28252
28228
  _r,
28253
28229
  Nt
28254
28230
  };
28255
- //# sourceMappingURL=chunk-ZXXLY4RM.js.map
28231
+ //# sourceMappingURL=chunk-MAAMCOAU.js.map