@blade-hq/agent-client 2610.0.0-beta.6 → 2610.0.0-beta.8

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.
@@ -70,6 +70,8 @@ export interface ChatMessage {
70
70
  duration_ms?: number;
71
71
  timestamp?: string;
72
72
  entry_id?: string;
73
+ /** Stable React key retained when an optimistic user message is confirmed. */
74
+ render_id?: string;
73
75
  parent_id?: string | null;
74
76
  loop_name?: string;
75
77
  /** Entry kind from backend -- present for non-message entries like mode changes. */
@@ -59,6 +59,8 @@ export interface TurnProjection {
59
59
  context_window?: number;
60
60
  memory_refs?: MemoryRef[] | null;
61
61
  parent_fork_tool_call_id?: string | null;
62
+ /** Client-only stable identity for reconciling an optimistic user turn. */
63
+ client_render_id?: string | null;
62
64
  compaction_id?: string | null;
63
65
  summary_preview?: string | null;
64
66
  summary_full?: string | null;
@@ -55,6 +55,7 @@ export interface ReplaySnapshot {
55
55
  export declare function toReplaySnapshot(raw: ReplayState | null | undefined): ReplaySnapshot | null;
56
56
  export declare function createInitialSessionState(sessionId: string): SessionState;
57
57
  export declare function extractModeFromBlocks(blocks: ContentBlock[]): "planning" | "executing" | null;
58
+ export declare function reconcileOptimisticUserTurns(currentTurns: TurnProjection[], incomingTurns: TurnProjection[]): TurnProjection[];
58
59
  /**
59
60
  * 用一份新的 turn 列表重建会话状态。
60
61
  * addErrorMessage 注入的 role==="error" 消息不在 turns 里,默认会被物化过程抹掉;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blade-hq/agent-client",
3
- "version": "2610.0.0-beta.6",
3
+ "version": "2610.0.0-beta.8",
4
4
  "description": "Blade Agent 框架无关客户端:会话实时状态机、REST 通道、弹窗登录、页面协作。浏览器与 Node.js 通用。",
5
5
  "repository": {
6
6
  "type": "git",
package/public-api.md CHANGED
@@ -3,7 +3,7 @@
3
3
  > 本文件由 `scripts/public-api-report.mjs` 生成,请勿手改。
4
4
  > 公共面变更时重新生成本报告,并同步更新 README 对应章节——CI 会校验两者。
5
5
 
6
- 共 136 个公开声明。
6
+ 共 137 个公开声明。
7
7
 
8
8
  ## `acceptedPostChatFollowupCompletesLatestRun` (function)
9
9
 
@@ -270,6 +270,7 @@ loop_name: string | undefined
270
270
  memory_refs: MemoryRefInfo[] | undefined
271
271
  parent_id: string | null | undefined
272
272
  reasoning: string | undefined
273
+ render_id: string | undefined
273
274
  role: "error" | "user" | "assistant" | "tool"
274
275
  status: "streaming" | "completed" | "paused" | "failed" | "interrupted" | undefined
275
276
  timestamp: string | undefined
@@ -785,6 +786,12 @@ payload: Record<string, unknown>
785
786
  type: string
786
787
  ```
787
788
 
789
+ ## `reconcileOptimisticUserTurns` (function)
790
+
791
+ ```ts
792
+ reconcileOptimisticUserTurns: (currentTurns: TurnProjection[], incomingTurns: TurnProjection[]) => TurnProjection[]
793
+ ```
794
+
788
795
  ## `ReplayPreview` (interface)
789
796
 
790
797
  ```ts
@@ -1328,6 +1335,7 @@ archived_count: number | null | undefined
1328
1335
  archived_files: ArchivedFileInfo[] | null | undefined
1329
1336
  archived_tool_calls: ArchivedToolCallInfo[] | null | undefined
1330
1337
  blocks: ContentBlock[]
1338
+ client_render_id: string | null | undefined
1331
1339
  compaction_id: string | null | undefined
1332
1340
  context_window: number | undefined
1333
1341
  duration_ms: number | undefined