@blade-hq/agent-react 2612.0.0-beta.86 → 2612.0.0-beta.87

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 (52) hide show
  1. package/README.md +1 -1
  2. package/dist/SessionPluginConfigForm-2KG4TG4W.js +9 -0
  3. package/dist/chat/AssistantTurnBlock.d.ts +2 -1
  4. package/dist/chat/ChatLoadingIndicator.d.ts +9 -1
  5. package/dist/chat/FileDeliveryCards.d.ts +12 -6
  6. package/dist/chat/ai-elements/shimmer.d.ts +4 -0
  7. package/dist/chat/chat-column-width.d.ts +21 -0
  8. package/dist/chat/index.d.ts +3 -1
  9. package/dist/chat/runtime/actions.d.ts +5 -1
  10. package/dist/chat/runtime/environment.d.ts +2 -0
  11. package/dist/chat/runtime/use-chat-actions.d.ts +1 -1
  12. package/dist/{chat-IHPRU35X.css → chat-WA7YIAHD.css} +18 -0
  13. package/dist/chat.css +18 -0
  14. package/dist/{chunk-LYDXKR3Q.js → chunk-34MHG656.js} +15 -8
  15. package/dist/{chunk-LYDXKR3Q.js.map → chunk-34MHG656.js.map} +1 -1
  16. package/dist/{chunk-KHJEIHMJ.js → chunk-5ZV73E5D.js} +28 -60
  17. package/dist/chunk-5ZV73E5D.js.map +1 -0
  18. package/dist/{chunk-NRYLAO3X.js → chunk-BZHMZBYT.js} +3 -3
  19. package/dist/{chunk-NRYLAO3X.js.map → chunk-BZHMZBYT.js.map} +1 -1
  20. package/dist/{chunk-C3LBNHVM.js → chunk-G6OC5I4W.js} +4 -4
  21. package/dist/{chunk-SK43YNRX.js → chunk-GBZEFIGW.js} +2 -2
  22. package/dist/{chunk-RGL2XUQR.js → chunk-GJZGRIDJ.js} +1577 -1183
  23. package/dist/chunk-GJZGRIDJ.js.map +1 -0
  24. package/dist/{chunk-MWILWSPG.js → chunk-J6YPRDQH.js} +2 -2
  25. package/dist/{chunk-FH5HA3GW.js → chunk-JFGBDNDD.js} +6 -6
  26. package/dist/chunk-JFGBDNDD.js.map +1 -0
  27. package/dist/{chunk-6RQGCCG7.js → chunk-K6N5CQDP.js} +7 -7
  28. package/dist/{chunk-FDB3J5QF.js → chunk-WG2HHYGK.js} +5 -5
  29. package/dist/connectors.js +3 -3
  30. package/dist/index.js +9 -9
  31. package/dist/internal.d.ts +1 -1
  32. package/dist/internal.js +15 -11
  33. package/dist/internal.js.map +1 -1
  34. package/dist/questions.js +4 -4
  35. package/dist/rich-input/ChatInput.d.ts +1 -1
  36. package/dist/rich-input/ModelSelector.d.ts +3 -1
  37. package/dist/rich-input/model/resolve-model.d.ts +1 -1
  38. package/dist/rich-input.js +414 -369
  39. package/dist/rich-input.js.map +1 -1
  40. package/dist/style.full.css +19 -1
  41. package/dist/tool-details.js +5 -5
  42. package/package.json +2 -2
  43. package/dist/SessionPluginConfigForm-7LJ5SUNY.js +0 -9
  44. package/dist/chunk-FH5HA3GW.js.map +0 -1
  45. package/dist/chunk-KHJEIHMJ.js.map +0 -1
  46. package/dist/chunk-RGL2XUQR.js.map +0 -1
  47. /package/dist/{SessionPluginConfigForm-7LJ5SUNY.js.map → SessionPluginConfigForm-2KG4TG4W.js.map} +0 -0
  48. /package/dist/{chunk-C3LBNHVM.js.map → chunk-G6OC5I4W.js.map} +0 -0
  49. /package/dist/{chunk-SK43YNRX.js.map → chunk-GBZEFIGW.js.map} +0 -0
  50. /package/dist/{chunk-MWILWSPG.js.map → chunk-J6YPRDQH.js.map} +0 -0
  51. /package/dist/{chunk-6RQGCCG7.js.map → chunk-K6N5CQDP.js.map} +0 -0
  52. /package/dist/{chunk-FDB3J5QF.js.map → chunk-WG2HHYGK.js.map} +0 -0
package/README.md CHANGED
@@ -496,7 +496,7 @@ ChatView 和 `<blade-chat>` 的默认轻量输入支持 @ 搜索插件条目,
496
496
 
497
497
  ### 应用资料展示
498
498
 
499
- 共享聊天视图展示消息级 `context_attachments`:气泡只显示正文,资料标签可展开查看纯文本详情,`data` 中的内部 JSON 与 ID 不显示。`ChatSendOptions.contextAttachments` 可沿共享发送入口传入 SDK;可靠后台发送使用 `AgentSession.prepareSend` / `sendPrepared`。文件读取使用当前 `BladeProvider` 的 `BladeClient` 和资料指定的会话权限,失效或没有来源的文件显示「文件不可用」。内置 Web、扩展和嵌入视图使用相同实现。
499
+ 共享聊天视图展示消息级 `context_attachments`:气泡只显示正文,资料标签可展开查看纯文本详情,`data` 中的内部 JSON 与 ID 不显示。`ChatSendOptions.contextAttachments` 可沿共享发送入口传入 SDK;可靠后台发送先持久保存原业务输入与 requestId,再调用同一 `AgentSession.send`,按 `receipt.status` 判断接收结果。文件读取使用当前 `BladeProvider` 的 `BladeClient` 和资料指定的会话权限,失效或没有来源的文件显示「文件不可用」。内置 Web、扩展和嵌入视图使用相同实现。
500
500
 
501
501
  ### 独立嵌入提问卡片(React 19+)
502
502
 
@@ -0,0 +1,9 @@
1
+ import {
2
+ SessionPluginConfigForm
3
+ } from "./chunk-GBZEFIGW.js";
4
+ import "./chunk-5ZV73E5D.js";
5
+ import "./chunk-PR4QN5HX.js";
6
+ export {
7
+ SessionPluginConfigForm
8
+ };
9
+ //# sourceMappingURL=SessionPluginConfigForm-2KG4TG4W.js.map
@@ -14,6 +14,7 @@ interface Props {
14
14
  sessionStatus?: string;
15
15
  level?: 1 | 2;
16
16
  forceExpanded?: boolean;
17
+ excludeDeliveredPaths?: ReadonlySet<string>;
17
18
  customization?: ChatViewCustomization;
18
19
  }
19
20
  export type TurnDisplayMode = "compact" | "detail";
@@ -32,7 +33,7 @@ export declare function getExecutionDurationMs({ messages, isStreaming, now, }:
32
33
  isStreaming: boolean;
33
34
  now?: number | null;
34
35
  }): number;
35
- declare function AssistantTurnBlockBase({ sessionId, messages: rawMessages, isStreaming, isReasoningRevealing, askAnswers, onAnswer, sessionStatus, level, forceExpanded, customization, }: Props): import("react/jsx-runtime").JSX.Element;
36
+ declare function AssistantTurnBlockBase({ sessionId, messages: rawMessages, isStreaming, isReasoningRevealing, askAnswers, onAnswer, sessionStatus, level, forceExpanded, excludeDeliveredPaths, customization, }: Props): import("react/jsx-runtime").JSX.Element;
36
37
  export declare const AssistantTurnBlock: import("react").MemoExoticComponent<typeof AssistantTurnBlockBase>;
37
38
  /** 一轮消息里引用到的记忆(按 id 去重,保持首次出现的顺序)。 */
38
39
  export declare function collectMemoryRefs(messages: ChatMessage[]): MemoryRefInfo[];
@@ -2,6 +2,14 @@ export declare function isPreparingReply(messages: readonly {
2
2
  role: string;
3
3
  kind?: string;
4
4
  }[]): boolean;
5
- export declare function ChatLoadingIndicator({ preparing }: {
5
+ export declare function formatLoadingElapsed(elapsedMs: number): string;
6
+ export declare function resolveLoadingStageLabel({ preparing, elapsedMs, activeToolLabel, }: {
7
+ preparing: boolean;
8
+ elapsedMs: number;
9
+ activeToolLabel?: string | null;
10
+ }): string;
11
+ export declare function ChatLoadingIndicator({ preparing, startedAtMs, activeToolLabel, }: {
6
12
  preparing?: boolean;
13
+ startedAtMs?: number | null;
14
+ activeToolLabel?: string | null;
7
15
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,22 +1,28 @@
1
1
  import type { ToolCallInfo } from "@blade-hq/agent-client/internal";
2
- /** 从该轮工具调用中提取智能体写入的工作区文件(去重、按出现顺序)。 */
3
- export declare function collectDeliveredFiles(toolCalls: ToolCallInfo[], sessionId: string): Array<{
2
+ export type DeliveredFileChangeKind = "created" | "modified";
3
+ export interface DeliveredFileEntry {
4
4
  relPath: string;
5
5
  name: string;
6
- }>;
7
- export declare function DeliveryCard({ path, name, sessionId, description, displayName, compact, onOpen, onDownloadStarted, onDownloadSucceeded, }: {
6
+ changeKind: DeliveredFileChangeKind;
7
+ }
8
+ export declare function normalizeDeliveredRelPath(rawPath: string, sessionId: string): string | null;
9
+ /** 从该轮工具调用中提取智能体写入或修改的工作区文件(去重、按首次出现顺序)。 */
10
+ export declare function collectDeliveredFiles(toolCalls: ToolCallInfo[], sessionId: string, excludePaths?: ReadonlySet<string>): DeliveredFileEntry[];
11
+ export declare function DeliveryCard({ path, name, sessionId, description, displayName, changeKind, compact, onOpen, onDownloadStarted, onDownloadSucceeded, }: {
8
12
  path: string;
9
13
  name: string;
10
14
  sessionId: string;
11
15
  description?: string;
12
16
  displayName?: string;
17
+ changeKind?: DeliveredFileChangeKind;
13
18
  compact?: boolean;
14
19
  onOpen?: () => void;
15
20
  onDownloadStarted?: () => void;
16
21
  onDownloadSucceeded?: () => void;
17
22
  }): import("react/jsx-runtime").JSX.Element;
18
- /** 文件交付卡片组(需求 10):助手在本轮写入的工作区文件,以卡片形式内联展示。 */
19
- export declare function FileDeliveryCards({ toolCalls, sessionId, }: {
23
+ /** 回合末交付与改动文件卡(参考 DeepSeek ui-deliverables):汇总展示本轮写入或更新的工作区文件。 */
24
+ export declare function FileDeliveryCards({ toolCalls, sessionId, excludePaths, }: {
20
25
  toolCalls: ToolCallInfo[];
21
26
  sessionId: string;
27
+ excludePaths?: ReadonlySet<string>;
22
28
  }): import("react/jsx-runtime").JSX.Element | null;
@@ -6,6 +6,10 @@ export interface TextShimmerProps {
6
6
  duration?: number;
7
7
  spread?: number;
8
8
  }
9
+ /**
10
+ * 参考 DeepSeek Harness TextShimmer:15° 斜切流光扫掠(105deg),
11
+ * 直接使用语义 HSL 变量,确保浅色/深色主题与独立 SDK 宿主均清晰可见。
12
+ */
9
13
  declare const ShimmerComponent: ({ children, as: Component, className, duration, spread, }: TextShimmerProps) => import("react/jsx-runtime").JSX.Element;
10
14
  export declare const Shimmer: import("react").MemoExoticComponent<typeof ShimmerComponent>;
11
15
  export {};
@@ -0,0 +1,21 @@
1
+ import { type RefObject } from "react";
2
+ export declare const CHAT_COLUMN_WIDTH_STORAGE_KEY = "blade-ui:chat-column-width";
3
+ export declare const DEFAULT_CHAT_COLUMN_WIDTH = 780;
4
+ export declare const MIN_CHAT_COLUMN_WIDTH = 640;
5
+ export declare const MAX_CHAT_COLUMN_WIDTH = 1200;
6
+ export declare function clampChatColumnWidth(width: number, containerWidth?: number | null): number;
7
+ export declare function getChatColumnWidth(): number;
8
+ export declare function setChatColumnWidth(nextWidth: number, containerWidth?: number | null): number;
9
+ export declare function resetChatColumnWidth(): number;
10
+ export declare function useChatColumnWidth(): {
11
+ width: number;
12
+ setWidth: (next: number, containerWidth?: number | null) => number;
13
+ resetWidth: () => number;
14
+ };
15
+ export declare function ChatColumnResizeRails({ containerRef, effectiveWidth, onWidthChange, onReset, }: {
16
+ containerRef: RefObject<HTMLElement | null>;
17
+ effectiveWidth: number;
18
+ onWidthChange: (nextWidth: number, containerWidth: number | null) => void;
19
+ onReset: () => void;
20
+ }): import("react/jsx-runtime").JSX.Element;
21
+ export declare function useObservedContainerWidth(ref: RefObject<HTMLElement | null>): number | null;
@@ -9,7 +9,9 @@ export type { ChatPanelProps } from "./ChatPanel";
9
9
  export { CompactionCard } from "./CompactionCard";
10
10
  export { ConnectionBanner } from "./ConnectionBanner";
11
11
  export { CurrentPlanPanelContent, CurrentPlanPanel } from "./CurrentPlanPanel";
12
- export { collectDeliveredFiles, DeliveryCard, FileDeliveryCards } from "./FileDeliveryCards";
12
+ export { collectDeliveredFiles, normalizeDeliveredRelPath, DeliveryCard, FileDeliveryCards } from "./FileDeliveryCards";
13
+ export type { DeliveredFileChangeKind, DeliveredFileEntry } from "./FileDeliveryCards";
14
+ export { CHAT_COLUMN_WIDTH_STORAGE_KEY, DEFAULT_CHAT_COLUMN_WIDTH, MIN_CHAT_COLUMN_WIDTH, MAX_CHAT_COLUMN_WIDTH, clampChatColumnWidth, getChatColumnWidth, setChatColumnWidth, resetChatColumnWidth, useChatColumnWidth, useObservedContainerWidth, ChatColumnResizeRails, } from "./chat-column-width";
13
15
  export { FinalArtifactCards } from "./FinalArtifactCards";
14
16
  export { ImageLightbox } from "./ImageLightbox";
15
17
  export { LightComposer } from "./LightComposer";
@@ -1,4 +1,4 @@
1
- import type { AgentSession, MessageContent, SendOptions, SessionState } from "@blade-hq/agent-client/internal";
1
+ import { type AgentSession, type InputKind, type MessageContent, type SendOptions, type SessionState } from "@blade-hq/agent-client/internal";
2
2
  /**
3
3
  * 等待回答时直接在输入框里打字:把这段文字当作最近一个子回路 AskUserQuestion 的自由作答,
4
4
  * 服务端据此恢复运行,而不是另起一轮。
@@ -18,6 +18,10 @@ export interface ChatSendExtras {
18
18
  * 默认发送引导消息;显式为 true 时,等待当前运行结束后处理。
19
19
  */
20
20
  queueWhenRunning?: boolean;
21
+ releaseNativeWait?: boolean;
22
+ inputKind?: InputKind;
23
+ receivedAt?: string;
24
+ timeZone?: string;
21
25
  }
22
26
  /** 向会话发送一条消息。返回服务端是否接受(或已改道进等待队列)。 */
23
27
  export declare function sendToSession(session: AgentSession, message: MessageContent, mode?: string, askUserAnswer?: Record<string, unknown>, extras?: ChatSendExtras): Promise<boolean>;
@@ -63,6 +63,8 @@ export interface DeveloperMessageListProps {
63
63
  export interface ChatEnvironment {
64
64
  /** 当前渲染模式;不注入时是普通模式。 */
65
65
  renderMode?: ChatRenderMode;
66
+ /** 是否在技能列表与 `/` 搜索中显示系统内置技能(与会话是否切到轨迹视图解耦)。 */
67
+ includeBuiltinSkills?: boolean;
66
68
  /** 开发者视图;不注入时开发者模式按普通模式显示。 */
67
69
  DeveloperMessageList?: ComponentType<DeveloperMessageListProps>;
68
70
  /** 默认输入框(内置 Web 注入富输入);不注入时用轻输入。 */
@@ -1,4 +1,4 @@
1
- import type { MessageContent } from "@blade-hq/agent-client/internal";
1
+ import { type MessageContent } from "@blade-hq/agent-client/internal";
2
2
  import { type ChatSendExtras } from "./actions";
3
3
  export declare function useChatActions(sessionId: string): {
4
4
  isStopping: boolean;
@@ -150,7 +150,25 @@
150
150
  }
151
151
  }
152
152
 
153
+ @keyframes blade-loading-breathe {
154
+ 0%, 100% {
155
+ transform: scale(0.92);
156
+ opacity: 0.78;
157
+ }
158
+ 50% {
159
+ transform: scale(1.08);
160
+ opacity: 1;
161
+ }
162
+ }
163
+
164
+ .blade-loading-pulse {
165
+ animation: blade-loading-breathe 1.6s ease-in-out infinite;
166
+ }
167
+
153
168
  @media (prefers-reduced-motion: reduce) {
169
+ .blade-loading-pulse {
170
+ animation: none;
171
+ }
154
172
  @keyframes blade-shimmer-sweep {
155
173
  from {
156
174
  background-position: 0% center;
package/dist/chat.css CHANGED
@@ -150,7 +150,25 @@
150
150
  }
151
151
  }
152
152
 
153
+ @keyframes blade-loading-breathe {
154
+ 0%, 100% {
155
+ transform: scale(0.92);
156
+ opacity: 0.78;
157
+ }
158
+ 50% {
159
+ transform: scale(1.08);
160
+ opacity: 1;
161
+ }
162
+ }
163
+
164
+ .blade-loading-pulse {
165
+ animation: blade-loading-breathe 1.6s ease-in-out infinite;
166
+ }
167
+
153
168
  @media (prefers-reduced-motion: reduce) {
169
+ .blade-loading-pulse {
170
+ animation: none;
171
+ }
154
172
  @keyframes blade-shimmer-sweep {
155
173
  from {
156
174
  background-position: 0% center;
@@ -2,14 +2,14 @@ import {
2
2
  useBladeClient,
3
3
  useSessionHandle,
4
4
  useSessionState
5
- } from "./chunk-NRYLAO3X.js";
5
+ } from "./chunk-BZHMZBYT.js";
6
6
  import {
7
7
  SessionPluginConfigForm
8
- } from "./chunk-SK43YNRX.js";
8
+ } from "./chunk-GBZEFIGW.js";
9
9
  import {
10
10
  LoaderCircle,
11
11
  Puzzle
12
- } from "./chunk-KHJEIHMJ.js";
12
+ } from "./chunk-5ZV73E5D.js";
13
13
 
14
14
  // src/chat/runtime/input-history-storage.ts
15
15
  var generation = 0;
@@ -1190,13 +1190,14 @@ function isQueueShortcut(event) {
1190
1190
  }
1191
1191
 
1192
1192
  // src/chat/runtime/actions.ts
1193
+ import { captureClientInputTime } from "@blade-hq/agent-client/internal";
1193
1194
  function buildPendingAskUserAnswer(state, message) {
1194
1195
  if (state.status !== "waiting_for_input") return void 0;
1195
1196
  const text = extractMessageText(message);
1196
1197
  if (!text) return void 0;
1197
1198
  for (let turnIndex = state.turns.length - 1; turnIndex >= 0; turnIndex -= 1) {
1198
1199
  const turn = state.turns[turnIndex];
1199
- if (turn.loop_id === "root" || turn.role !== "assistant") continue;
1200
+ if (turn.role !== "assistant") continue;
1200
1201
  for (let toolIndex = turn.tool_calls.length - 1; toolIndex >= 0; toolIndex -= 1) {
1201
1202
  const toolCall = turn.tool_calls[toolIndex];
1202
1203
  if (toolCall.status !== "awaiting_answer") continue;
@@ -1211,9 +1212,11 @@ function extractMessageText(message) {
1211
1212
  return message.filter((part) => part.type === "text").map((part) => part.text.trim()).filter(Boolean).join("\n").trim();
1212
1213
  }
1213
1214
  function sendToSession(session, message, mode, askUserAnswer, extras = {}) {
1215
+ const captured = captureClientInputTime();
1216
+ const answer = askUserAnswer ?? buildPendingAskUserAnswer(session.getState(), message);
1214
1217
  return session.send(message, {
1215
1218
  mode,
1216
- askUserAnswer: askUserAnswer ?? buildPendingAskUserAnswer(session.getState(), message),
1219
+ askUserAnswer: answer,
1217
1220
  model: extras.model,
1218
1221
  thinkingOverride: extras.thinkingOverride,
1219
1222
  reasoningLevel: extras.reasoningLevel,
@@ -1222,8 +1225,12 @@ function sendToSession(session, message, mode, askUserAnswer, extras = {}) {
1222
1225
  topicAssetRefs: extras.topicAssetRefs,
1223
1226
  whatif: extras.whatif,
1224
1227
  replayDecision: extras.replayDecision,
1225
- queueWhenRunning: extras.queueWhenRunning
1226
- });
1228
+ queueWhenRunning: extras.queueWhenRunning,
1229
+ releaseNativeWait: extras.releaseNativeWait ?? (!answer && !extras.queueWhenRunning),
1230
+ inputKind: extras.inputKind,
1231
+ receivedAt: extras.receivedAt ?? captured.receivedAt,
1232
+ timeZone: extras.timeZone ?? captured.timeZone
1233
+ }).then((receipt) => receipt.status === "accepted");
1227
1234
  }
1228
1235
 
1229
1236
  // src/chat/chat-theme.tsx
@@ -1312,4 +1319,4 @@ export {
1312
1319
  filterConnectorItems,
1313
1320
  useSessionPluginActivation
1314
1321
  };
1315
- //# sourceMappingURL=chunk-LYDXKR3Q.js.map
1322
+ //# sourceMappingURL=chunk-34MHG656.js.map