@blade-hq/agent-react 2612.0.0-beta.111 → 2612.0.0-beta.113

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.
Files changed (63) hide show
  1. package/README.md +11 -0
  2. package/dist/{McpAppCard-ADVDKC2C.js → McpAppCard-NJEKKEEN.js} +3 -3
  3. package/dist/McpAppFrame-IQK5AOMD.js +9 -0
  4. package/dist/{SessionPluginConfigForm-DWVDFK6A.js → SessionPluginConfigForm-VXONUDM4.js} +2 -2
  5. package/dist/chat/AssistantTurnBlock.d.ts +1 -1
  6. package/dist/chat/AttachmentPreviewDialog.d.ts +1 -6
  7. package/dist/chat/ChatLoadingIndicator.d.ts +2 -1
  8. package/dist/chat/ChatPanel.d.ts +3 -3
  9. package/dist/chat/LightComposer.d.ts +1 -1
  10. package/dist/chat/chat-run.d.ts +4 -0
  11. package/dist/chat/customization.d.ts +1 -2
  12. package/dist/chat/index.d.ts +0 -1
  13. package/dist/chat/message-list-blocks.d.ts +1 -0
  14. package/dist/chat/runtime/actions.d.ts +1 -0
  15. package/dist/chat/runtime/environment.d.ts +1 -1
  16. package/dist/chat.css +1 -1
  17. package/dist/{chunk-MG4RF573.js → chunk-22JUW3EQ.js} +3 -3
  18. package/dist/{chunk-J6BSKVVK.js → chunk-3KJJIH5K.js} +1 -35
  19. package/dist/chunk-3KJJIH5K.js.map +1 -0
  20. package/dist/{chunk-IOIKCFRO.js → chunk-4WFRH7FG.js} +28 -8
  21. package/dist/{chunk-IOIKCFRO.js.map → chunk-4WFRH7FG.js.map} +1 -1
  22. package/dist/{chunk-6XZERPQY.js → chunk-5JDQG2JJ.js} +4 -4
  23. package/dist/{chunk-BEBV7M7V.js → chunk-5XLLPGSU.js} +8798 -9470
  24. package/dist/chunk-5XLLPGSU.js.map +1 -0
  25. package/dist/{chunk-UJ5WH5NK.js → chunk-AZVPNN6K.js} +3 -3
  26. package/dist/{chunk-UJ5WH5NK.js.map → chunk-AZVPNN6K.js.map} +1 -1
  27. package/dist/{chunk-QBQE4TPT.js → chunk-M6SNZHK3.js} +18 -13
  28. package/dist/chunk-M6SNZHK3.js.map +1 -0
  29. package/dist/{chunk-WEOW475M.js → chunk-N2SQZ2HY.js} +5 -5
  30. package/dist/{chunk-PKLEJPUS.js → chunk-VYTLF6JE.js} +12 -13
  31. package/dist/chunk-VYTLF6JE.js.map +1 -0
  32. package/dist/{chunk-PLTQP66W.js → chunk-XLG3BTUA.js} +25 -7
  33. package/dist/chunk-XLG3BTUA.js.map +1 -0
  34. package/dist/components/McpAppFrame.d.ts +2 -0
  35. package/dist/components/use-session-plugin-activation.d.ts +3 -1
  36. package/dist/connectors.js +3 -3
  37. package/dist/embed/entry.d.ts +5 -0
  38. package/dist/index.d.ts +1 -0
  39. package/dist/index.js +8 -8
  40. package/dist/internal.js +192 -21
  41. package/dist/internal.js.map +1 -1
  42. package/dist/questions.js +4 -4
  43. package/dist/rich-input/ChatInput.d.ts +1 -1
  44. package/dist/rich-input/ComposerControls.d.ts +15 -0
  45. package/dist/rich-input.js +91 -72
  46. package/dist/rich-input.js.map +1 -1
  47. package/dist/style.full.css +2 -2
  48. package/dist/tool-details.js +5 -5
  49. package/package.json +2 -2
  50. package/public-api.md +34 -1
  51. package/dist/McpAppFrame-VEOUJL5E.js +0 -9
  52. package/dist/chat/LiteMessageList.d.ts +0 -93
  53. package/dist/chunk-BEBV7M7V.js.map +0 -1
  54. package/dist/chunk-J6BSKVVK.js.map +0 -1
  55. package/dist/chunk-PKLEJPUS.js.map +0 -1
  56. package/dist/chunk-PLTQP66W.js.map +0 -1
  57. package/dist/chunk-QBQE4TPT.js.map +0 -1
  58. /package/dist/{McpAppCard-ADVDKC2C.js.map → McpAppCard-NJEKKEEN.js.map} +0 -0
  59. /package/dist/{McpAppFrame-VEOUJL5E.js.map → McpAppFrame-IQK5AOMD.js.map} +0 -0
  60. /package/dist/{SessionPluginConfigForm-DWVDFK6A.js.map → SessionPluginConfigForm-VXONUDM4.js.map} +0 -0
  61. /package/dist/{chunk-MG4RF573.js.map → chunk-22JUW3EQ.js.map} +0 -0
  62. /package/dist/{chunk-6XZERPQY.js.map → chunk-5JDQG2JJ.js.map} +0 -0
  63. /package/dist/{chunk-WEOW475M.js.map → chunk-N2SQZ2HY.js.map} +0 -0
package/README.md CHANGED
@@ -543,3 +543,14 @@ PA 等只需要授权界面的宿主可从 `@blade-hq/agent-react/connectors`
543
543
  ### 平台能力展示
544
544
 
545
545
  `useCapabilities(client)` 消费共享 SDK 的能力快照,在有效期届满时刷新,失败不保留过期的 allow。返回 `null` 或 `status: "unknown"` 时表示暂时无法确认,known 且缺少对应 key 才表示未开通。内置 Web 的平台浏览器入口使用同一 hook;外部宿主可据此提供自己的入口,实际调用仍由资源服务鉴权。
546
+
547
+ `ComposerPlacement` arranges each built-in `ComposerControl`.
548
+ Pass `controlPlacement.extra` to add host-defined buttons to the composer.
549
+ Each `ComposerAction` supplies an `id`, `title`, optional `icon`, an
550
+ `onSelect` callback, and a `region` of `direct` or `more`. An optional
551
+ zero-based `index` positions the action among other controls in that region.
552
+
553
+ `ComposerPlacement.presentation` accepts optional `ComposerControlPresentation`
554
+ labels and icons for built-in composer controls, keyed by control ID.
555
+
556
+ 聊天宿主可用 `planningPlaceholder` 设置规划模式的输入提示,默认提示保持原样。自定义 `ComposerProps` 和直接使用富输入的宿主可读取或传入 `planningPlaceholderText`。
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  McpAppFrame
3
- } from "./chunk-IOIKCFRO.js";
3
+ } from "./chunk-4WFRH7FG.js";
4
4
  import {
5
5
  McpAppMessageContext
6
6
  } from "./chunk-GRUDJLWG.js";
7
7
  import {
8
8
  useOptionalBladeClient
9
9
  } from "./chunk-FR3ON5R4.js";
10
- import "./chunk-J6BSKVVK.js";
10
+ import "./chunk-3KJJIH5K.js";
11
11
  import "./chunk-PR4QN5HX.js";
12
12
 
13
13
  // src/components/McpAppCard.tsx
@@ -168,4 +168,4 @@ function McpAppCard({ sessionId, sourceId, client: suppliedClient, onMessage: su
168
168
  export {
169
169
  McpAppCard
170
170
  };
171
- //# sourceMappingURL=McpAppCard-ADVDKC2C.js.map
171
+ //# sourceMappingURL=McpAppCard-NJEKKEEN.js.map
@@ -0,0 +1,9 @@
1
+ import {
2
+ McpAppFrame
3
+ } from "./chunk-4WFRH7FG.js";
4
+ import "./chunk-3KJJIH5K.js";
5
+ import "./chunk-PR4QN5HX.js";
6
+ export {
7
+ McpAppFrame
8
+ };
9
+ //# sourceMappingURL=McpAppFrame-IQK5AOMD.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Plus,
3
3
  Trash2
4
- } from "./chunk-J6BSKVVK.js";
4
+ } from "./chunk-3KJJIH5K.js";
5
5
  import {
6
6
  __commonJS,
7
7
  __toESM
@@ -14517,4 +14517,4 @@ react-is/cjs/react-is.development.js:
14517
14517
  * LICENSE file in the root directory of this source tree.
14518
14518
  *)
14519
14519
  */
14520
- //# sourceMappingURL=SessionPluginConfigForm-DWVDFK6A.js.map
14520
+ //# sourceMappingURL=SessionPluginConfigForm-VXONUDM4.js.map
@@ -27,7 +27,7 @@ export declare function resolveTurnDisplayMode({ isStreaming: _isStreaming, disp
27
27
  isStreaming: boolean;
28
28
  displayMode: TurnDisplayMode;
29
29
  }): TurnDisplayMode;
30
- export declare function formatExecutionDuration(durationMs: number): string;
30
+ export { formatExecutionDuration } from "./chat-run";
31
31
  export declare function getExecutionDurationMs({ messages, isStreaming, now, }: {
32
32
  messages: ChatMessage[];
33
33
  isStreaming: boolean;
@@ -12,12 +12,7 @@ interface Props {
12
12
  open: boolean;
13
13
  onOpenChange: (open: boolean) => void;
14
14
  filename: string;
15
- /**
16
- * 由调用方用 `getAuthedUrl()` 构造的完整 URL(baseUrl + 路径 + ?token=…)。
17
- * 内部 fetch 直接用原串,**不**再走 `apiFetchText` —— 否则会二次拼 baseUrl,
18
- * 在独立前后端部署时会得到形如 `http://api.xxxhttp://api.xxx/…` 的非法 URL。
19
- * token 靠 query 字符串携带,因此也不需要再挂 Authorization header。
20
- */
15
+ /** 完整附件地址,已下载的上下文资料使用本地 blob URL。 */
21
16
  url: string | null;
22
17
  mode: "markdown" | "text" | "default";
23
18
  }
@@ -8,7 +8,8 @@ export declare function resolveLoadingStageLabel({ preparing, elapsedMs, activeT
8
8
  elapsedMs: number;
9
9
  activeToolLabel?: string | null;
10
10
  }): string;
11
- export declare function ChatLoadingIndicator({ preparing, startedAtMs, activeToolLabel, }: {
11
+ export declare function ChatLoadingIndicator({ preparing, startedAtMs, activeToolLabel, useRunClock, }: {
12
+ useRunClock?: boolean;
12
13
  preparing?: boolean;
13
14
  startedAtMs?: number | null;
14
15
  activeToolLabel?: string | null;
@@ -33,6 +33,7 @@ export interface ChatPanelProps extends ChatViewCustomization {
33
33
  /** 额外的出错说明(例如 SDK 外壳的连接失败),显示在出错条里。 */
34
34
  errorMessage?: string | null;
35
35
  placeholder?: string;
36
+ planningPlaceholder?: string;
36
37
  onFollowupInteraction?: (event: FollowupInteractionEvent) => void;
37
38
  renderAttachments?: () => ReactNode;
38
39
  onBeforeSend?: (content: MessageContent) => MessageContent | Promise<MessageContent>;
@@ -54,8 +55,7 @@ export interface ChatPanelProps extends ChatViewCustomization {
54
55
  /** 是否允许在全宽桌面容器中拖拽对话栏左右导轨调宽(侧栏/浮窗/外部嵌入默认关闭)。 */
55
56
  resizableColumns?: boolean;
56
57
  /**
57
- * 开发者视图专用的输入框底部统计插槽。宿主(内置 Web 页面)注入;普通与精简视图不会调用它,
58
- * 因此也不会发出统计请求。
58
+ * 输入框底部的用量统计插槽,由宿主按显示偏好注入。
59
59
  */
60
60
  renderComposerStats?: (sessionId: string) => ReactNode;
61
61
  }
@@ -63,4 +63,4 @@ export interface ChatPanelProps extends ChatViewCustomization {
63
63
  * 聊天面板:消息流 + 队列 + 输入框。数据只来自 SessionSourceProvider 提供的会话实例与 props;
64
64
  * 内置 Web、浏览器插件与 SDK 的 ChatView / `<blade-chat>` 渲染的都是它。
65
65
  */
66
- export declare function ChatPanel({ sessionId, readOnly, theme, mode: providedMode, onToggleMode, banner, header, footer, emptyState, errorMessage: externalError, onExitReplay, placeholder, onFollowupInteraction, renderAttachments, onBeforeSend, onCommand, canCreateBoardTask, canShareSession, onOpenSkills, inputLabel, onDoubleEscape, composerHint, composerBanner, scrollToStartKey, scrollToEntryKey, initialDraft, initialDraftKey, renderMode: requestedRenderMode, resizableColumns, renderComposerStats, classNames, components, renderers, }: ChatPanelProps): import("react/jsx-runtime").JSX.Element;
66
+ export declare function ChatPanel({ sessionId, readOnly, theme, mode: providedMode, onToggleMode, banner, header, footer, emptyState, errorMessage: externalError, onExitReplay, placeholder, planningPlaceholder, onFollowupInteraction, renderAttachments, onBeforeSend, onCommand, canCreateBoardTask, canShareSession, onOpenSkills, inputLabel, onDoubleEscape, composerHint, composerBanner, scrollToStartKey, scrollToEntryKey, initialDraft, initialDraftKey, renderMode: requestedRenderMode, resizableColumns, renderComposerStats, classNames, components, renderers, }: ChatPanelProps): import("react/jsx-runtime").JSX.Element;
@@ -4,4 +4,4 @@ import type { ComposerProps } from "./customization";
4
4
  * 语音与模型选择。`AgentSession.attach()` / `insertText()`(页面协作、跟进建议、MCP 应用消息)
5
5
  * 都落进这里的文本。
6
6
  */
7
- export declare function LightComposer({ sessionId, onSend, onStop, isStreaming, isStopping, queueWhileRunning, mode, onToggleMode, mergesWithPanelAbove, planPanel, placeholderText, className, innerClassName, maxWidthClassName, initialDraft, initialDraftKey, }: ComposerProps): import("react/jsx-runtime").JSX.Element;
7
+ export declare function LightComposer({ sessionId, onSend, onStop, isStreaming, isStopping, queueWhileRunning, mode, onToggleMode, mergesWithPanelAbove, planPanel, placeholderText, planningPlaceholderText, className, innerClassName, maxWidthClassName, initialDraft, initialDraftKey, }: ComposerProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import type { ChatMessage, RunTiming } from "@blade-hq/agent-client/internal";
2
+ export declare function lastChatRun(messages: ChatMessage[]): RunTiming | undefined;
3
+ export declare function formatExecutionDuration(durationMs: number): string;
4
+ export declare function terminalChatLabel(run: RunTiming | undefined): string | null;
@@ -72,14 +72,13 @@ export interface ComposerProps {
72
72
  onOpenSkills?: () => void;
73
73
  inputLabel?: string;
74
74
  placeholderText?: string;
75
+ planningPlaceholderText?: string;
75
76
  onDoubleEscape?: (anchorRect: DOMRect | null) => void;
76
77
  composerHint?: ReactNode;
77
78
  statusBarAddon?: ReactNode;
78
79
  slotBelowActions?: ReactNode;
79
80
  initialDraft?: string;
80
81
  initialDraftKey?: string;
81
- /** 精简附加控件(精简渲染模式)。 */
82
- lite?: boolean;
83
82
  }
84
83
  export interface ChatViewComponents {
85
84
  EmptyState?: ComponentType;
@@ -15,7 +15,6 @@ export { CHAT_COLUMN_WIDTH_STORAGE_KEY, DEFAULT_CHAT_COLUMN_WIDTH, MIN_CHAT_COLU
15
15
  export { FinalArtifactCards } from "./FinalArtifactCards";
16
16
  export { ImageLightbox } from "./ImageLightbox";
17
17
  export { LightComposer } from "./LightComposer";
18
- export { buildLiteRows, LiteMessageList } from "./LiteMessageList";
19
18
  export { MessageActions } from "./MessageActions";
20
19
  export { MessageContextPills } from "./MessageContextPills";
21
20
  export { MessageFileAttachmentList } from "./MessageFileAttachmentList";
@@ -20,6 +20,7 @@ export type AssistantTurnRenderBlock = RenderBlockBase & {
20
20
  export type RenderBlock = (RenderBlockBase & {
21
21
  type: "message";
22
22
  message: ChatMessage;
23
+ unansweredLabel?: string;
23
24
  anchorId: string | null;
24
25
  }) | AssistantTurnRenderBlock | (RenderBlockBase & {
25
26
  type: "context_group";
@@ -6,6 +6,7 @@ import { type AgentSession, type InputKind, type MessageContent, type SendOption
6
6
  export declare function buildPendingAskUserAnswer(state: SessionState, message: MessageContent): Record<string, unknown> | undefined;
7
7
  /** 发送附加项(模型、推理档位、知识库等由富输入给出)。 */
8
8
  export interface ChatSendExtras {
9
+ signal?: AbortSignal;
9
10
  model?: string;
10
11
  modeOverride?: SendOptions["modeOverride"];
11
12
  thinkingOverride?: boolean;
@@ -11,7 +11,7 @@ import type { AskUserAnswerData } from "../AskUserQuestionBlock";
11
11
  import type { ComposerProps } from "../customization";
12
12
  import { type ComponentPropsWithoutRef, type ComponentType, type ReactNode } from "react";
13
13
  import type { CodeBlockOverrides } from "../../components/markdown";
14
- export type ChatRenderMode = "normal" | "lite" | "developer";
14
+ export type ChatRenderMode = "normal" | "developer";
15
15
  /** `@tanstack/react-virtual` 的 `useVirtualizer` 里消息列表用到的那一部分。 */
16
16
  export interface ChatVirtualItem {
17
17
  key: string | number | bigint;
package/dist/chat.css CHANGED
@@ -87,7 +87,7 @@
87
87
  * `.blade-chat-table-wrapper` 这个 class,但那只是引擎自己 SDK 包
88
88
  * (`@blade-hq/agent-react`)样式表里的 scoped 规则,挂在
89
89
  * `.blade-chat-markdown` 之下——内置 Web 这边套的是 `.chat-prose`/
90
- * `.prose`/`.lite-chat-markdown` 这几套外壳,从来没有 `.blade-chat-markdown`,
90
+ * `.prose` 这几套外壳,从来没有 `.blade-chat-markdown`,
91
91
  * 那条规则永远匹配不上,得在这里再补一条不依赖外壳类名的全局规则。 */
92
92
  .blade-chat-table-wrapper {
93
93
  max-width: 100%;
@@ -19,10 +19,10 @@ import {
19
19
  dist_exports3 as dist_exports2,
20
20
  dist_exports5 as dist_exports3,
21
21
  dist_exports6 as dist_exports4
22
- } from "./chunk-WEOW475M.js";
22
+ } from "./chunk-N2SQZ2HY.js";
23
23
  import {
24
24
  LoaderCircle
25
- } from "./chunk-J6BSKVVK.js";
25
+ } from "./chunk-3KJJIH5K.js";
26
26
 
27
27
  // src/components/DeviceConnection.tsx
28
28
  import { useEffect, useRef, useState } from "react";
@@ -2448,4 +2448,4 @@ qrcode.react/lib/esm/index.js:
2448
2448
  * SPDX-License-Identifier: ISC
2449
2449
  *)
2450
2450
  */
2451
- //# sourceMappingURL=chunk-MG4RF573.js.map
2451
+ //# sourceMappingURL=chunk-22JUW3EQ.js.map
@@ -365,25 +365,6 @@ var FileCode2 = createLucideIcon("FileCode2", [
365
365
  ["path", { d: "m9 18 3-3-3-3", key: "112psh" }]
366
366
  ]);
367
367
 
368
- // ../../node_modules/.pnpm/lucide-react@0.468.0_react@19.2.4/node_modules/lucide-react/dist/esm/icons/file-pen-line.js
369
- var FilePenLine = createLucideIcon("FilePenLine", [
370
- [
371
- "path",
372
- {
373
- d: "m18 5-2.414-2.414A2 2 0 0 0 14.172 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2",
374
- key: "142zxg"
375
- }
376
- ],
377
- [
378
- "path",
379
- {
380
- d: "M21.378 12.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",
381
- key: "2t3380"
382
- }
383
- ],
384
- ["path", { d: "M8 18h1", key: "13wk12" }]
385
- ]);
386
-
387
368
  // ../../node_modules/.pnpm/lucide-react@0.468.0_react@19.2.4/node_modules/lucide-react/dist/esm/icons/file-spreadsheet.js
388
369
  var FileSpreadsheet = createLucideIcon("FileSpreadsheet", [
389
370
  ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
@@ -764,17 +745,6 @@ var TriangleAlert = createLucideIcon("TriangleAlert", [
764
745
  ["path", { d: "M12 17h.01", key: "p32p05" }]
765
746
  ]);
766
747
 
767
- // ../../node_modules/.pnpm/lucide-react@0.468.0_react@19.2.4/node_modules/lucide-react/dist/esm/icons/wrench.js
768
- var Wrench = createLucideIcon("Wrench", [
769
- [
770
- "path",
771
- {
772
- d: "M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",
773
- key: "cbrjhi"
774
- }
775
- ]
776
- ]);
777
-
778
748
  // ../../node_modules/.pnpm/lucide-react@0.468.0_react@19.2.4/node_modules/lucide-react/dist/esm/icons/x.js
779
749
  var X = createLucideIcon("X", [
780
750
  ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
@@ -825,7 +795,6 @@ export {
825
795
  EyeOff,
826
796
  Eye,
827
797
  FileCode2,
828
- FilePenLine,
829
798
  FileSpreadsheet,
830
799
  FileText,
831
800
  File,
@@ -871,7 +840,6 @@ export {
871
840
  Terminal,
872
841
  Trash2,
873
842
  TriangleAlert,
874
- Wrench,
875
843
  X,
876
844
  Zap
877
845
  };
@@ -917,7 +885,6 @@ lucide-react/dist/esm/icons/external-link.js:
917
885
  lucide-react/dist/esm/icons/eye-off.js:
918
886
  lucide-react/dist/esm/icons/eye.js:
919
887
  lucide-react/dist/esm/icons/file-code-2.js:
920
- lucide-react/dist/esm/icons/file-pen-line.js:
921
888
  lucide-react/dist/esm/icons/file-spreadsheet.js:
922
889
  lucide-react/dist/esm/icons/file-text.js:
923
890
  lucide-react/dist/esm/icons/file.js:
@@ -959,7 +926,6 @@ lucide-react/dist/esm/icons/sparkles.js:
959
926
  lucide-react/dist/esm/icons/square.js:
960
927
  lucide-react/dist/esm/icons/terminal.js:
961
928
  lucide-react/dist/esm/icons/triangle-alert.js:
962
- lucide-react/dist/esm/icons/wrench.js:
963
929
  lucide-react/dist/esm/icons/x.js:
964
930
  lucide-react/dist/esm/icons/zap.js:
965
931
  lucide-react/dist/esm/lucide-react.js:
@@ -970,4 +936,4 @@ lucide-react/dist/esm/lucide-react.js:
970
936
  * See the LICENSE file in the root directory of this source tree.
971
937
  *)
972
938
  */
973
- //# sourceMappingURL=chunk-J6BSKVVK.js.map
939
+ //# sourceMappingURL=chunk-3KJJIH5K.js.map