@cqfe/sxin-chat-core 1.0.0 → 1.0.2

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.
@@ -1,4 +1,4 @@
1
- import { Ref, ComputedRef, ShallowRef } from 'vue';
1
+ import { Ref, ShallowRef, ComputedRef } from 'vue';
2
2
  import { Message as Message$1, DefaultToolCall, Interrupt, Thread, Run } from '@langchain/langgraph-sdk';
3
3
 
4
4
  interface AgentThreadState extends Record<string, unknown> {
@@ -23,102 +23,6 @@ interface IQuote {
23
23
  actions?: string[];
24
24
  }
25
25
 
26
- /** 子章节(可嵌套,相对章节最多再嵌套 2 层,共 3 个层级) */
27
- interface OutlineSubChapter {
28
- id: string;
29
- title: string;
30
- /** 子章节摘要 */
31
- summary?: string;
32
- /** 子章节内容主题 */
33
- contentTheme?: string;
34
- children: OutlineSubChapter[];
35
- }
36
- interface OutlineChapter {
37
- id: string;
38
- chapterTitle: string;
39
- /** 章节摘要/概述 */
40
- chapterSummary?: string;
41
- /** 子章节列表(第 2 层级) */
42
- children: OutlineSubChapter[];
43
- }
44
-
45
- interface ReportOutlinePayload {
46
- templateId: string;
47
- templateName: string;
48
- outline: OutlineChapter[];
49
- /** 大纲创建时间(ISO):取触发 write_file 的消息事件时间,缺失时不展示 */
50
- createdAt?: string;
51
- sourcePath?: string;
52
- outlineMarkdown?: string;
53
- /**
54
- * 内容引用:state(历史)通道不内嵌正文,仅带路径元信息;
55
- * 消费方经 ChatCore.loadArtifactContent(contentRef.path) 拉取后自行解析(parseMarkdownToOutline)。
56
- * threadId 不冗余在 block 上,由 ChatCore 调用时从 activeSession 补。
57
- */
58
- contentRef?: {
59
- path: string;
60
- };
61
- }
62
- interface ReportBodyPayload {
63
- templateId: string;
64
- templateName: string;
65
- reportTitle: string;
66
- createdAt: string;
67
- sourcePath?: string;
68
- bodyMarkdown?: string;
69
- /** 内容引用:同 ReportOutlinePayload.contentRef */
70
- contentRef?: {
71
- path: string;
72
- };
73
- }
74
- interface IAttachment {
75
- name: string;
76
- url: string;
77
- type: string;
78
- size: number;
79
- uid: string;
80
- id?: string;
81
- }
82
- interface IKwargs {
83
- hide_from_ui?: boolean;
84
- human_input_response?: Record<string, unknown>;
85
- attachments?: IAttachment[];
86
- selection?: Record<string, unknown>;
87
- context?: Record<string, unknown>;
88
- capability?: string[];
89
- workflow?: Record<string, any>;
90
- }
91
- interface GenerateBodyRequest {
92
- templateId: string;
93
- outline: OutlineChapter[];
94
- }
95
- interface GenerateBodyResult {
96
- bodyMarkdown: string;
97
- }
98
- interface ReportSelectedArtifact {
99
- path: string;
100
- kind: 'report_outline';
101
- }
102
- interface ReportGenerateBodyHumanKwargs {
103
- selected_artifact: ReportSelectedArtifact;
104
- report_action: 'generate_body';
105
- }
106
- interface ReportSelectedTemplate {
107
- kind: 'report_template';
108
- source: 'template_library';
109
- template_id: string;
110
- template_name: string;
111
- /** 范文 OSS 地址(列表接口无此字段时可为空) */
112
- oss_url: string;
113
- /** 报告大纲 Markdown(来自 /biz/report/template/list 的 outline 字段) */
114
- outline?: string;
115
- reportStyle?: string;
116
- datasourceId?: string;
117
- datasourceName?: string;
118
- jdbcUrl?: string;
119
- name?: string;
120
- }
121
-
122
26
  /**
123
27
  * HITL(Human-in-the-loop)类型定义。
124
28
  * 从 parser/hitl 下沉至此,使 types/blockBuilder 无需反向依赖 parser 层(打破循环依赖);
@@ -151,10 +55,6 @@ interface HitlInterruptPayload {
151
55
  reviewConfigs: HitlReviewConfig[];
152
56
  }
153
57
 
154
- /**
155
- * Block 类型系统(blockBuilder.ts re-export 保持 import 路径不变)。
156
- */
157
-
158
58
  /** Block 状态:流式中 / 已完成 / 等待中 / 错误 */
159
59
  type BlockStatus = 'streaming' | 'completed' | 'pending' | 'error';
160
60
  /** Block 基础字段 */
@@ -193,11 +93,6 @@ interface ArtifactFile {
193
93
  /** 文件类型后缀 */
194
94
  fileType?: string;
195
95
  }
196
- /** 产物 Block */
197
- interface ArtifactBlock extends BlockBase {
198
- type: 'artifact';
199
- files: ArtifactFile[];
200
- }
201
96
  /** 自定义渲染 Block:对应 <sxin-xxx> 标签 */
202
97
  interface CustomBlock extends BlockBase {
203
98
  type: 'custom';
@@ -206,16 +101,6 @@ interface CustomBlock extends BlockBase {
206
101
  /** 解析后的属性对象 */
207
102
  spec: Record<string, any>;
208
103
  }
209
- /** 报告大纲卡片 Block */
210
- interface ReportOutlineBlock extends BlockBase {
211
- type: 'report-outline';
212
- payload: ReportOutlinePayload;
213
- }
214
- /** 报告正文卡片 Block */
215
- interface ReportBodyBlock extends BlockBase {
216
- type: 'report-body';
217
- payload: ReportBodyPayload;
218
- }
219
104
  /** 通用表单字段类型 */
220
105
  type FormFieldType = 'text' | 'textarea' | 'number' | 'select' | 'multi_select' | 'radio' | 'checkbox' | 'switch' | 'date' | 'date-picker' | 'dateRange' | 'date-range' | 'time' | 'timeRange' | 'tree-select' | 'cascader' | 'upload' | 'table' | 'list' | 'hidden';
221
106
  interface FormFieldItem {
@@ -251,10 +136,10 @@ interface FormFieldItem {
251
136
  /** list 类型候选数据 */
252
137
  items?: any[];
253
138
  }
254
- /** 通用表单 Block:支持澄清表单、确认表单、删除确认 */
139
+ /** 通用表单 Block:澄清/确认/删除确认统一走此块(ask_clarification 与其他 form 来源共用) */
255
140
  interface FormBlock extends BlockBase {
256
141
  type: 'form';
257
- /** 表单模式 */
142
+ /** 表单模式:仅决定提交按钮样式(delete_confirm → danger),不再分支交互逻辑 */
258
143
  variant: 'input' | 'confirm' | 'delete_confirm';
259
144
  /** 表单标题 */
260
145
  title?: string;
@@ -264,23 +149,9 @@ interface FormBlock extends BlockBase {
264
149
  context?: string;
265
150
  /** 表单字段 */
266
151
  fields: FormFieldItem[];
267
- /** 已收集的字段值,confirm 模式下用于预填 */
152
+ /** 已收集的字段值,用于预填 */
268
153
  values?: Record<string, any>;
269
- /** 分步信息 */
270
- stepInfo?: {
271
- title?: string;
272
- current: number;
273
- total: number;
274
- canSkip?: boolean;
275
- };
276
- /** 业务专属动作按钮 */
277
- customActions?: Array<{
278
- key: string;
279
- label: string;
280
- primary?: boolean;
281
- danger?: boolean;
282
- }>;
283
- /** 当前状态 */
154
+ /** 当前状态:澄清类块恒 pending(跨 run 回答态由 isAnswered / 回答缓存判定) */
284
155
  status: BlockStatus;
285
156
  /** 关联的 tool_call_id,用于去重 */
286
157
  toolCallId?: string;
@@ -288,6 +159,8 @@ interface FormBlock extends BlockBase {
288
159
  source?: string;
289
160
  /** thread 级回答状态(跨 run 不回写 block,渲染层据此自行判断是否已回答) */
290
161
  isAnswered?: boolean;
162
+ /** 用户回答内容(由装饰层根据 thread 级回答状态注入,仅已回答时有值) */
163
+ answer?: string;
291
164
  }
292
165
  /** 列表选择项 */
293
166
  interface ListItem {
@@ -331,29 +204,7 @@ interface ListBlock extends BlockBase {
331
204
  /** 关联的 tool_call_id,用于去重 */
332
205
  toolCallId?: string;
333
206
  }
334
- /** 澄清反问 Block(兼容旧版简单澄清) */
335
- interface AskClarificationBlock extends BlockBase {
336
- type: 'ask-clarification';
337
- /** 问题正文(markdown) */
338
- question: string;
339
- /** 问题背景 */
340
- context?: string;
341
- /** 澄清类型 */
342
- clarification_type?: 'mission_info' | 'confirmation' | 'select_option';
343
- /** 可选选项列表;为空时用户自由输入 */
344
- options?: string[];
345
- /** 动态表单字段 */
346
- fields?: Array<FormFieldItem>;
347
- /** 复用 BlockStatus:pending 可交互 / completed 已回答(options 禁用) */
348
- status: BlockStatus;
349
- /** 关联的 tool_call_id,用于去重 */
350
- toolCallId?: string;
351
- /** 用户回答内容(由渲染层根据 thread 级回答状态注入,仅已回答时有值) */
352
- answer?: string;
353
- /** thread 级回答状态(跨 run 不回写 block,渲染层据此自行判断是否已回答) */
354
- isAnswered?: boolean;
355
- }
356
- /** 引用文件项 */
207
+ /** 引用文件项(GroupMessage.citations 元素类型:refId 锚点 + 详情字段,详情由渲染层拉取后写回) */
357
208
  interface CitationItem {
358
209
  /** 引用唯一标识 */
359
210
  refId: string;
@@ -376,16 +227,8 @@ interface CitationItem {
376
227
  /** 搜索关键词列表,用于一次高亮多段命中文本 */
377
228
  searchTexts?: string[];
378
229
  }
379
- /** 引用 Block */
380
- interface CitationBlock extends BlockBase {
381
- type: 'citation';
382
- items: CitationItem[];
383
- }
384
- interface TwinBlock extends BlockBase {
385
- type: 'twin';
386
- toolName: string;
387
- args: Record<string, unknown>;
388
- }
230
+ /** 引用 Block 已下线:citation 走 sxin-item contract="support.kbCitation" 自定义渲染链,
231
+ * 解析层仅产出锚点挂到 GroupMessage.citations(见 types/groupMessage.ts)。 */
389
232
  /** HITL 审核 Block:对应 pending interrupt 的人工审核卡片 */
390
233
  interface InterruptReviewBlock extends BlockBase {
391
234
  type: 'interrupt-review';
@@ -399,7 +242,125 @@ interface InterruptReviewBlock extends BlockBase {
399
242
  isResponded?: boolean;
400
243
  }
401
244
  /** Block 联合类型 */
402
- type Block = TextBlock | ArtifactBlock | CitationBlock | CustomBlock | ReportOutlineBlock | ReportBodyBlock | FormBlock | ListBlock | AskClarificationBlock | TwinBlock | InterruptReviewBlock;
245
+ type Block = TextBlock | CustomBlock | FormBlock | ListBlock | InterruptReviewBlock;
246
+ /** 工具调用快照(ReasoningChainBlock 渲染契约;原 types/groupMessage 迁入——组模型退役后内核仍消费此形状) */
247
+ interface GroupMessageTool {
248
+ /** tool_call_id */
249
+ id: string;
250
+ /** 工具调用定义 */
251
+ call: DefaultToolCall;
252
+ /** 工具调用结果(可能逐步补全) */
253
+ result?: any;
254
+ /** 触发该 tool call 的 ai 消息 */
255
+ aiMessage?: Message$1;
256
+ /** 当前状态 */
257
+ state: 'pending' | 'active' | 'completed' | 'error';
258
+ /** 在工具序列中的顺序 */
259
+ index: number;
260
+ }
261
+ /** Block 构建来源(blockBuilder.ts 退役迁入;渲染层按 source 决定流式/完成态语义) */
262
+ type BlockSource = 'optimistic' | 'sse' | 'history';
263
+ /** Block 构建配置(blockBuilder.ts 退役迁入) */
264
+ interface BlockBuilderOptions {
265
+ /** 数据来源 */
266
+ source: BlockSource;
267
+ }
268
+
269
+ /** 子章节(可嵌套,相对章节最多再嵌套 2 层,共 3 个层级) */
270
+ interface OutlineSubChapter {
271
+ id: string;
272
+ title: string;
273
+ /** 子章节摘要 */
274
+ summary?: string;
275
+ /** 子章节内容主题 */
276
+ contentTheme?: string;
277
+ children: OutlineSubChapter[];
278
+ }
279
+ interface OutlineChapter {
280
+ id: string;
281
+ chapterTitle: string;
282
+ /** 章节摘要/概述 */
283
+ chapterSummary?: string;
284
+ /** 子章节列表(第 2 层级) */
285
+ children: OutlineSubChapter[];
286
+ }
287
+
288
+ interface ReportOutlinePayload {
289
+ templateId: string;
290
+ templateName: string;
291
+ outline: OutlineChapter[];
292
+ /** 大纲创建时间(ISO):取触发 write_file 的消息事件时间,缺失时不展示 */
293
+ createdAt?: string;
294
+ sourcePath?: string;
295
+ outlineMarkdown?: string;
296
+ /**
297
+ * 内容引用:state(历史)通道不内嵌正文,仅带路径元信息;
298
+ * 消费方经 ChatCore.loadArtifactContent(contentRef.path) 拉取后自行解析(parseMarkdownToOutline)。
299
+ * threadId 不冗余在 block 上,由 ChatCore 调用时从 activeSession 补。
300
+ */
301
+ contentRef?: {
302
+ path: string;
303
+ };
304
+ }
305
+ interface ReportBodyPayload {
306
+ templateId: string;
307
+ templateName: string;
308
+ reportTitle: string;
309
+ createdAt: string;
310
+ sourcePath?: string;
311
+ bodyMarkdown?: string;
312
+ /** 内容引用:同 ReportOutlinePayload.contentRef */
313
+ contentRef?: {
314
+ path: string;
315
+ };
316
+ }
317
+ interface IAttachment {
318
+ name: string;
319
+ url: string;
320
+ type: string;
321
+ size: number;
322
+ uid: string;
323
+ id?: string;
324
+ }
325
+ interface IKwargs {
326
+ hide_from_ui?: boolean;
327
+ human_input_response?: Record<string, unknown>;
328
+ attachments?: IAttachment[];
329
+ selection?: Record<string, unknown>;
330
+ context?: Record<string, unknown>;
331
+ capability?: string[];
332
+ workflow?: Record<string, any>;
333
+ }
334
+ interface GenerateBodyRequest {
335
+ templateId: string;
336
+ outline: OutlineChapter[];
337
+ }
338
+ interface GenerateBodyResult {
339
+ bodyMarkdown: string;
340
+ }
341
+ interface ReportSelectedArtifact {
342
+ path: string;
343
+ kind: 'report_outline';
344
+ }
345
+ interface ReportGenerateBodyHumanKwargs {
346
+ selected_artifact: ReportSelectedArtifact;
347
+ report_action: 'generate_body';
348
+ }
349
+ interface ReportSelectedTemplate {
350
+ kind: 'report_template';
351
+ source: 'template_library';
352
+ template_id: string;
353
+ template_name: string;
354
+ /** 范文 OSS 地址(列表接口无此字段时可为空) */
355
+ oss_url: string;
356
+ /** 报告大纲 Markdown(来自 /biz/report/template/list 的 outline 字段) */
357
+ outline?: string;
358
+ reportStyle?: string;
359
+ datasourceId?: string;
360
+ datasourceName?: string;
361
+ jdbcUrl?: string;
362
+ name?: string;
363
+ }
403
364
 
404
365
  /**
405
366
  * 前端 Message 结构类型(blockBuilder.ts re-export 保持 import 路径不变)。
@@ -464,82 +425,10 @@ interface Message {
464
425
  feedback?: unknown;
465
426
  }
466
427
 
467
- /**
468
- * chat 类型定义入口(单一事实来源,所有 Block/Message/Channel 类型均从此处导出)。
469
- * 实现按职责拆分:Block 类型系统见 ./block,Message 结构见 ./message-schema;
470
- * 本文件保留 useChatManager 发送选项与 BlockBuilder 配置,并 re-export 两者保持既有 import 路径不变。
471
- */
472
-
473
- /** sendMessage 可选参数,与旧 chat store 对齐 */
428
+ /** 发送消息选项(blockBuilder.ts 退役迁入) */
474
429
  interface SendMessageOptions {
475
430
  kwargs?: IKwargs;
476
431
  }
477
- /** BlockBuilder 数据来源 */
478
- type BlockSource = MessageSource;
479
- /** BlockBuilder 配置选项 */
480
- interface BlockBuilderOptions {
481
- /** 数据来源 */
482
- source: BlockSource;
483
- }
484
-
485
- /** GroupMessage 数据来源 / 会话来源 */
486
- type GroupMessageSource = 'history' | 'sse' | 'state';
487
- /** GroupMessage 角色 */
488
- type GroupMessageType = 'human' | 'ai';
489
- /** GroupMessage 状态 */
490
- type GroupMessageStatus = 'streaming' | 'completed' | 'pending' | 'error';
491
- /** tool block 状态快照(deriveToolsFromMessages 从消息 tool_calls/tool_call_id 配对派生) */
492
- interface GroupMessageTool {
493
- /** tool_call_id */
494
- id: string;
495
- /** 工具调用定义 */
496
- call: DefaultToolCall;
497
- /** 工具调用结果(可能逐步补全) */
498
- result?: any;
499
- /** 触发该 tool call 的 ai 消息 */
500
- aiMessage?: Message$1;
501
- /** 当前状态 */
502
- state: 'pending' | 'active' | 'completed' | 'error';
503
- /** 在 GroupMessage.tools 中的顺序 */
504
- index: number;
505
- }
506
- /** 前端渲染消息:一个 Bubble */
507
- interface GroupMessage {
508
- /** 消息唯一 id,取组内最后一条原始消息的 id,或本地生成 */
509
- id: string;
510
- /** 消息类型:human / ai */
511
- type: GroupMessageType;
512
- /** 渲染状态 */
513
- status: GroupMessageStatus;
514
- /** 数据来源 / 会话来源 */
515
- source?: GroupMessageSource;
516
- /** 组成这条 GroupMessage 的所有原始消息 id */
517
- originMessageIds: string[];
518
- /** 该组关联的 run id(run 级信息通过 runId 查询 RunInfo) */
519
- runId?: string;
520
- /** 该组所在的 checkpoint id(可选) */
521
- checkpointId?: string;
522
- /** 渲染 block 列表 */
523
- blocks: Block[];
524
- /** 该组内提取到的 tool_call_id 列表(按出现顺序去重) */
525
- toolIds: string[];
526
- /** 与 toolIds 对应的完整 tool 对象 */
527
- tools: GroupMessageTool[];
528
- /** 原始 LangGraph 消息快照 */
529
- rawMessages: Message$1[];
530
- /** human 消息的可见文本:buildHumanGroup 时一次性预计算,消费端(MessageHuman / MessageFooterCopy 等)直接读取,避免对同一 rawMessages 重复解析 */
531
- texts?: string[];
532
- /** human 消息的 additional_kwargs(附件、澄清回答标记等) */
533
- additionalKwargs?: IKwargs;
534
- /** 创建时间戳 */
535
- createdAt: number;
536
- }
537
- /** buildHumanGroup/buildAiGroup 的入参(从 message/group-builder.ts 下沉到 types 层,打破与 group-assembler 的模块环) */
538
- interface BuildAllOptions {
539
- source: GroupMessageSource;
540
- isStreaming: boolean;
541
- runId?: string;
542
- }
543
432
 
544
433
  /** run 内单条消息:run messages 分页拉取的数据结构(区别于流式快照的 LangGraph Message) */
545
434
  interface RunMessage {
@@ -629,8 +518,6 @@ declare function buildHitlDecisions(requests: HitlActionRequest[], currentArgsLi
629
518
  declare function buildRejectDecisions(requests: HitlActionRequest[]): HitlDecision[];
630
519
  /** 由 interrupt 合成审核 Block;负载非法时返回 null(调用方不渲染) */
631
520
  declare function buildInterruptReviewBlock(interrupt: Interrupt, responded: boolean): InterruptReviewBlock | null;
632
- /** 由 interrupt 合成末尾审核 GroupMessage(无 AI 消息可合并时的独立追加回退);负载非法时返回 null */
633
- declare function buildInterruptReviewGroup(interrupt: Interrupt, responded: boolean): GroupMessage | null;
634
521
 
635
522
  /** 分页搜索 thread 的参数 */
636
523
  interface SearchThreadsOptions {
@@ -680,10 +567,20 @@ interface ChatStreamHandle {
680
567
  error: Ref<Error | null>;
681
568
  /** 发起一次流式运行(发送用户消息) */
682
569
  submit(input: StreamSubmitInput, options?: StreamSubmitOptions): void;
683
- /** 加入既有 run 的 SSE 流(断线重连) */
570
+ /** 加入既有 run 的 SSE 流(断线重连)。
571
+ * D9 桥接语义(chat-core-bridge 重构):deer-flow join 端点(GET
572
+ * /threads/{tid}/runs/{rid}/join)v1 协议兼容,全量重放剩余缓冲事件、不消费
573
+ * lastEventId(OpenAPI 实测无游标参数)。桥接模式已于 2026-11-13 提前转正:
574
+ * web streamBridge 旁路打开 join SSE,复用旧泵回调直驱 store(不经 SDK 控制器);
575
+ * 旧管道为 client.runs.joinStream 原生实现。 */
684
576
  joinStream(runId: string, lastEventId?: string): Promise<void>;
685
577
  /** 停止当前流 */
686
578
  stop(): void;
579
+ /**
580
+ * 释放句柄资源(桥接模式的 effectScope / 适配器连接等)。
581
+ * 可选:旧泵句柄无资源可释,不实现;ThreadRuntime.dispose 时会后随 stop() 调用。
582
+ */
583
+ dispose?(): void;
687
584
  /** 向 pending interrupt 发送 HITL 决策以恢复图执行(区别于 joinStream 的 SSE 重连) */
688
585
  resumeInterrupt(decisions: HitlResponse): Promise<void>;
689
586
  }
@@ -697,6 +594,12 @@ interface CreateStreamOptions {
697
594
  onValuesEvent?(data: Record<string, unknown>): void;
698
595
  /** messages/messages-tuple chunk 事件解构后转发(store 消费:accumulator 累积产 upsert/remove/clear) */
699
596
  onMessageTupleEvent?(serialized: Record<string, any>, metadata: Record<string, any>): void;
597
+ /**
598
+ * 桥接模式专用:SDK messages 投影的整段快照(transport 侧 watch 投影后转发)。
599
+ * runtime 以快照 mini diff(protocol/snapshot-diff)转为增量指令——
600
+ * 与 onMessageTupleEvent 二选一(tuple 泵模式不调用本回调)。
601
+ */
602
+ onSnapshotMessages?(messages: Message$1[]): void;
700
603
  /**
701
604
  * 本轮流实际开始时调用(isLoading 置 true 后、首个 SSE 事件前)。
702
605
  * 经泵的串行队列调用,时序保证「旧流收尾(onStreamEnd)先于新流本回调」——
@@ -746,49 +649,6 @@ interface ChatTransport {
746
649
  createStream(options: CreateStreamOptions): ChatStreamHandle;
747
650
  }
748
651
 
749
- /**
750
- * sxin AST 节点类型定义
751
- *
752
- * 独立成文件以打破 sxin-ast ↔ sxin-ast-collect 的模块环:
753
- * tokenizer 与文本提取均只依赖本文件的类型,互不引用。
754
- */
755
- /** 文本节点:原文切片 */
756
- interface TextNode {
757
- type: 'text';
758
- /** 原文内容 */
759
- value: string;
760
- /** 在原文中的起始偏移(含) */
761
- start: number;
762
- /** 在原文中的结束偏移(不含) */
763
- end: number;
764
- }
765
- /** 注释节点:<!-- ... --> */
766
- interface CommentNode {
767
- type: 'comment';
768
- /** 注释内部内容(不含 <!-- 与 -->) */
769
- content: string;
770
- start: number;
771
- end: number;
772
- }
773
- /** 元素节点:<tag attrs>children</tag> 或 <tag attrs/> */
774
- interface ElementNode {
775
- type: 'element';
776
- /** 标签名(统一小写,大小写不敏感) */
777
- tagName: string;
778
- /** 解析后的属性对象(key/value 均经 formatStr 格式化) */
779
- attrs: Record<string, string>;
780
- /** 子节点(已闭合或自闭合标签才有内容;未闭合标签延伸到 EOF) */
781
- children: SxinNode[];
782
- /** 是否自闭合(<tag/>) */
783
- selfClosing: boolean;
784
- /** 是否有配对闭合标签;false 表示流式截断或 LLM 少输出闭合标签 */
785
- closed: boolean;
786
- start: number;
787
- /** closed=false 时等于原文长度 */
788
- end: number;
789
- }
790
- type SxinNode = TextNode | CommentNode | ElementNode;
791
-
792
652
  /** LangGraph run 在前端的投影 */
793
653
  interface RunInfo {
794
654
  /** run 唯一 id */
@@ -810,7 +670,13 @@ interface RunInfo {
810
670
  /** run 创建时间戳 */
811
671
  createdAt?: number;
812
672
  }
813
- /** 从 /threads/{id}/runs 返回的单个 run 对象解析基础 RunInfo */
673
+ /** 从 /threads/{id}/runs 返回的单个 run 对象解析基础 RunInfo。
674
+ * G7 定案字段(2026-11-13 直连 deer-flow 实测):token 三件套(total_input_tokens/
675
+ * total_output_tokens/total_tokens)+ llm_call_count/message_count 等扩展 +
676
+ * stop_reason(实测结束原因字段名,非 finish_reason);
677
+ * 无 latency_ms → latencyMs 走 created_at/updated_at 差值兜底;
678
+ * 无 model_name → modelName 依赖流结束 pickRunMessageMetadata 从 AI 消息回填;
679
+ * 无 feedback → 维持本地盖章语义(§9.1 #5)。 */
814
680
  declare function buildRunInfo(run: any, threadId: string): RunInfo;
815
681
  /**
816
682
  * 解析 run 接口直报的耗时字段 latency_ms(缺失/0/非法时为 undefined)。
@@ -825,50 +691,228 @@ declare function pickRunMessageMetadata(messages: Message$1[]): {
825
691
  finishReason?: string;
826
692
  };
827
693
 
694
+ /** 元素属性:key/value 均字符串(parseAttrs 已格式化) */
695
+ interface XmlAttrs {
696
+ [name: string]: string;
697
+ }
698
+ /** 正文段(§4.3):有序序列元素 */
699
+ type BodySegment = {
700
+ type: 'text';
701
+ content: string;
702
+ } | {
703
+ type: 'list';
704
+ tag: 'sxin-list';
705
+ attrs: XmlAttrs;
706
+ children: ItemSegment[];
707
+ raw: string;
708
+ } | {
709
+ type: 'item';
710
+ tag: 'sxin-item';
711
+ attrs: XmlAttrs;
712
+ content?: string;
713
+ raw: string;
714
+ };
715
+ /** sxin-item 段(list children 元素类型) */
716
+ interface ItemSegment {
717
+ type: 'item';
718
+ tag: 'sxin-item';
719
+ attrs: XmlAttrs;
720
+ content?: string;
721
+ raw: string;
722
+ }
828
723
  /**
829
- * block-builder:content AST + tools → Block[]。
830
- * 闭包工厂:每次调用产生一份独立去重作用域与 parser 注册表。
724
+ * 正文切片为有序段序列。
725
+ * 恒返回非空数组(空 body → 单空 text 段),消费方无需判空。
831
726
  */
727
+ declare function sliceBodySegments(body: string): BodySegment[];
832
728
 
833
- /** 数字孪生工具名前缀(与 web constants/chat.ts 的 TWIN_TOOL_PREFIX 一致) */
834
- declare const DEFAULT_TWIN_TOOL_PREFIX = "city-digital-twin-display_";
835
- interface BlockBuilderLiteOptions {
836
- source: 'history' | 'sse' | 'state';
837
- isStreaming?: boolean;
838
- /** 本轮组级真实时间(毫秒);工具自身缺少 created_at 时作为兜底,避免卡片显示渲染时刻 */
839
- createdAt?: number;
840
- /**
841
- * 数字孪生 block 开关与工具名前缀(平台/租户差异,构造注入)。
842
- * web 端传 `{ enabled: getBsClient() === BS_CLIENT_TYPE.TWIN }`;缺省关闭。
843
- */
844
- twin?: {
845
- enabled: boolean;
846
- toolPrefix?: string;
729
+ /**
730
+ * materializer/types.ts — §4.1 数据模型 + §6.2 TurnEffect 全量类型。
731
+ * 纯类型文件(零运行时),物化器各模块共享。
732
+ */
733
+
734
+ /** 线程视图:物化器输出的唯一结构(turn 有序数组) */
735
+ interface ThreadView {
736
+ /** 有序;一轮 = 用户可见提问 + AI 应答 */
737
+ turns: Turn[];
738
+ }
739
+ /** 一轮对话 */
740
+ interface Turn {
741
+ /** = human 消息 id */
742
+ id: string;
743
+ /** 首个 ai 段的 runId */
744
+ runId: string;
745
+ createdAt: number;
746
+ /** 用户可见提问(乐观占位时 text 可能为空串,吸收后回填) */
747
+ human: {
748
+ id: string;
749
+ text: string;
750
+ kwargs?: Record<string, unknown>;
847
751
  };
752
+ /** 数组:一轮可能多段(resume 续写为新段,D5 规则 3) */
753
+ ai: AiTurn[];
754
+ /** 澄清记录(ask_clarification 工具调用 + 回答回填) */
755
+ clarifications: ClarificationRecord[];
756
+ status: 'streaming' | 'sealed';
757
+ /** 乐观占位标记(规则 4;吸收/丢弃后复位 false) */
758
+ optimistic?: boolean;
759
+ /** 归属本 turn 的原始消息引用(按到达序追加;update 按 id 替换)——仅排查问题用,渲染不消费 */
760
+ rawMessages?: Message$1[];
848
761
  }
849
- /** 闭包工厂产物(原 BlockBuilderLite 类的公开面) */
850
- interface BlockBuilderLite {
851
- /** 便捷入口:content 自行 tokenize 后走 buildFromNodes(未提前解析的调用方使用) */
852
- build(content: string, tools: GroupMessageTool[]): Block[];
762
+ /** AI 应答段(同 turn 多段 = interrupt resume 续写) */
763
+ interface AiTurn {
764
+ /** = 段首 ai 消息 id */
765
+ id: string;
766
+ runId: string;
767
+ /** 单一正文(含 sxin 标签);引用 SDK 消息内容,不复制 */
768
+ body: string;
769
+ /** 仅开放尾段:增量部分(渲染打字机) */
770
+ streamingText?: string;
771
+ /** 定点装饰(feedback 盖章,R9):仅人工写入,流数据不携带 */
772
+ feedback?: {
773
+ rating: number;
774
+ };
775
+ /** 追加序 = 执行序(运行日志,非正文结构) */
776
+ tools: ToolRun[];
777
+ /** report/artifact/twin;固定尾部区,与正文顺序无关 */
778
+ attachments: Attachment[];
779
+ /** 密封时由切片器切分(§4.3);流式期 = 单 text 段 */
780
+ segments: BodySegment[];
781
+ status: 'streaming' | 'sealed';
853
782
  /**
854
- * 核心构建入口:直接消费已 tokenize 的节点树,不再重复解析。
855
- * group-builder 等已持有 AST 的调用方应走此入口(一次 tokenize 直通渲染)。
783
+ * 并入本段的消息 id 列表(段首 + 同 runId 并入的非段首消息;增量登记)。
784
+ * rebuildIndexes 依赖它重建 byMessageId——多步 agent 场景(多条 ai 消息并入一段)
785
+ * 若 finalize 全量重建只登记段首 id,流收尾 /state 回填的 update 会因索引 miss
786
+ * 被静默丢弃(citation 丢失断点,2026-11 实测)。渲染不消费。
856
787
  */
857
- buildFromNodes(nodes: SxinNode[], rawText: string, tools: GroupMessageTool[]): Block[];
788
+ messageIds?: string[];
858
789
  }
859
- /**
860
- * 创建一个 BlockBuilderLite 实例(原 class 构造器的等价物)。
861
- * 文件去重 Set 的生命周期 = 单次工厂调用(buildAiGroup 每 group 调一次工厂),
862
- * 即去重作用域为【单轮次】:本轮 write_file 的产物不再被 present_files 重复展示;跨轮次不去重。
863
- */
864
- declare function createBlockBuilderLite(options: BlockBuilderLiteOptions): BlockBuilderLite;
790
+ /** 工具运行记录 */
791
+ interface ToolRun {
792
+ callId: string;
793
+ name: string;
794
+ input?: unknown;
795
+ status: 'running' | 'finished' | 'error';
796
+ result?: string;
797
+ /** write_file 类工具的 artifact_meta(tool_call 顶层,与 args 平级;报告产物判定用) */
798
+ artifactMeta?: unknown;
799
+ /** tool-finished 时由 extractor 写入(§6.4) */
800
+ extracted?: ExtractedPayload;
801
+ }
802
+ /** 报告附件载荷(write_file 产物;两类来源):
803
+ * - JSON result 路径:body(+可选 outline)内嵌正文,reportKind 固定 report_body;
804
+ * - artifact_meta 路径(result 非 JSON,如 "OK"):仅 sourcePath(内容经 artifact 端点
805
+ * 按需拉取)+ title(路径提取),reportKind 由 resolveReportArtifactKind 判定。 */
806
+ /** 模块内私有:仅 Attachment 联合类型使用,不对外导出 */
807
+ interface ReportAttachment {
808
+ kind: 'report';
809
+ reportKind: 'report_outline' | 'report_body';
810
+ /** 内嵌正文(JSON result 路径) */
811
+ body?: string;
812
+ /** 内嵌大纲 markdown(JSON result 路径) */
813
+ outline?: string;
814
+ /** artifact 文件路径(artifact_meta 路径;点击卡片后经 loadArtifactContent 拉取) */
815
+ sourcePath?: string;
816
+ /** 卡片展示标题(缺省由内容/路径提取) */
817
+ title?: string;
818
+ }
819
+ /** 附件载荷(report/artifact/twin) */
820
+ type Attachment = ReportAttachment | {
821
+ kind: 'artifact';
822
+ files: unknown[];
823
+ } | {
824
+ kind: 'twin';
825
+ payload: unknown;
826
+ };
827
+ /** 澄清记录 */
828
+ interface ClarificationRecord {
829
+ callId: string;
830
+ question: string;
831
+ options?: unknown;
832
+ /** 来自 tool call args.fields 的结构化字段(多题澄清;缺省走单题 textarea/select 兜底) */
833
+ fields?: FormFieldItem[];
834
+ /** 来自 human_input_response 提取(D6) */
835
+ answer?: string;
836
+ answerMessageId?: string;
837
+ }
838
+ /** tool result 提取载荷(§6.4;物化器不感知业务语义) */
839
+ type ExtractedPayload = {
840
+ kind: 'clarification';
841
+ question: string;
842
+ options?: unknown;
843
+ } | {
844
+ kind: 'report';
845
+ reportKind: 'report_outline' | 'report_body';
846
+ body?: string;
847
+ outline?: string;
848
+ sourcePath?: string;
849
+ title?: string;
850
+ } | {
851
+ kind: 'artifact';
852
+ files: unknown[];
853
+ };
854
+ /** 定点装饰 patch(R9/W5;按 byMessageId 定位 ai 段写入,流数据不携带这些字段) */
855
+ interface DecoratePatch {
856
+ feedback?: {
857
+ rating: number;
858
+ };
859
+ /** W5:整组替换附件(API 路径报告卡注入;undefined 不动) */
860
+ attachments?: Attachment[];
861
+ }
862
+ /** TurnEffect:状态机输出,驱动响应式更新(已密封 turn 引用稳定) */
863
+ type TurnEffect = {
864
+ type: 'turn-opened';
865
+ turn: Turn;
866
+ optimistic: boolean;
867
+ } | {
868
+ type: 'turn-sealed';
869
+ turnId: string;
870
+ } | {
871
+ type: 'ai-opened';
872
+ turnId: string;
873
+ ai: AiTurn;
874
+ } | {
875
+ type: 'ai-delta';
876
+ turnId: string;
877
+ aiId: string;
878
+ body: string;
879
+ streamingText: string;
880
+ } | {
881
+ type: 'ai-sealed';
882
+ turnId: string;
883
+ aiId: string;
884
+ segments: BodySegment[];
885
+ } | {
886
+ type: 'tool-updated';
887
+ turnId: string;
888
+ aiId: string;
889
+ tool: ToolRun;
890
+ } | {
891
+ type: 'clarification-answered';
892
+ turnId: string;
893
+ callId: string;
894
+ answer: string;
895
+ } | {
896
+ type: 'message-updated';
897
+ turnId: string;
898
+ aiId: string | null;
899
+ } | {
900
+ type: 'placeholder-absorbed';
901
+ turnId: string;
902
+ } | {
903
+ type: 'placeholder-dropped';
904
+ turnId: string;
905
+ };
865
906
 
866
907
  interface ThreadRuntimeOptions {
867
908
  threadId: string;
868
909
  transport: ChatTransport;
869
910
  assistantId: string;
870
911
  /** 数字孪生 block 配置(缺省关闭) */
871
- twin?: BlockBuilderLiteOptions['twin'];
912
+ twin?: {
913
+ enabled?: boolean;
914
+ toolPrefix?: string;
915
+ };
872
916
  /** SSE 期间同步 thread 标题到侧边栏(ThreadDirectory 转发) */
873
917
  onTitle?(threadId: string, title: string): void;
874
918
  }
@@ -878,13 +922,15 @@ interface ThreadRuntime {
878
922
  lastViewedAt: number;
879
923
  /** 更新最近查看时间 */
880
924
  touch(): void;
881
- readonly groups: ComputedRef<GroupMessage[]>;
925
+ readonly view: ShallowRef<ThreadView>;
926
+ readonly turns: ComputedRef<Turn[]>;
927
+ /** R11 投影:尾 turn 最后一个未答澄清(含乐观答案覆盖) */
928
+ readonly activeClarification: ComputedRef<ClarificationRecord | undefined>;
882
929
  readonly isGenerating: ComputedRef<boolean>;
883
930
  readonly isInitializing: Ref<boolean>;
884
931
  readonly runs: ComputedRef<Map<string, RunInfo>>;
885
932
  readonly interrupt: ComputedRef<Interrupt | undefined>;
886
933
  readonly hasPendingInterrupt: ComputedRef<boolean>;
887
- readonly hasPendingClarification: ComputedRef<boolean>;
888
934
  readonly streamError: ComputedRef<Error | null>;
889
935
  readonly tokenUsage: ShallowRef<ThreadTokenUsage | null>;
890
936
  readonly hasMoreHistory: ComputedRef<boolean>;
@@ -901,13 +947,18 @@ interface ThreadRuntime {
901
947
  resumeInterrupt(decisions: HitlResponse): Promise<void>;
902
948
  /** 加载更早历史页;返回是否还有更多 */
903
949
  loadOlderMessages(): Promise<boolean>;
904
- appendOptimisticGroups(groups: GroupMessage[]): void;
905
- createOptimisticHuman(text: string, options?: SendMessageOptions): GroupMessage;
906
- patchGroup(messageId: string, patch: Partial<GroupMessage> | ((g: GroupMessage) => GroupMessage)): void;
907
950
  applyFeedback(messageId: string, feedback: unknown): void;
951
+ /** R5:API 路径乐观 turn(useReportGenerate) */
952
+ addOptimisticTurn(body: string): void;
953
+ /** R5:更新指定 ai 段正文(API 路径流式写 body) */
954
+ updateAiBody(aiId: string, body: string): void;
955
+ /** W5:定点装饰(attachments 注入等;C2 decorate) */
956
+ decorate(messageId: string, patch: DecoratePatch): void;
957
+ /** W5:密封开放段/turn(API 路径乐观 turn 收尾;流中勿调用) */
958
+ finalizeTurns(): void;
908
959
  setClarificationAnswer(toolCallId: string, answer: string): void;
909
960
  clearClarificationAnswers(): void;
910
- readonly clarificationAnswers: ComputedRef<Map<string, string>>;
961
+ readonly clarificationAnswers: ComputedRef<ReadonlyMap<string, string>>;
911
962
  dispose(): void;
912
963
  }
913
964
  declare function createThreadRuntime(options: ThreadRuntimeOptions): ThreadRuntime;
@@ -924,7 +975,10 @@ interface ThreadDirectoryOptions {
924
975
  maxCachedRuntimes?: number;
925
976
  maxConcurrentStreams?: number;
926
977
  /** 数字孪生 block 配置(透传各 runtime 的 viewmodel) */
927
- twin?: BlockBuilderLiteOptions['twin'];
978
+ twin?: {
979
+ enabled?: boolean;
980
+ toolPrefix?: string;
981
+ };
928
982
  /** 通知回调(ChatNotify 形态上移,core 门面注入) */
929
983
  notify?(type: 'warning' | 'error', text: string): void;
930
984
  /** 新 thread 默认标题(UI 文案由平台层注入,core 不内嵌多语言) */
@@ -936,7 +990,10 @@ declare class ThreadDirectory {
936
990
  assistantId: string;
937
991
  maxCachedRuntimes: number;
938
992
  maxConcurrentStreams: number;
939
- twin?: BlockBuilderLiteOptions['twin'];
993
+ twin?: {
994
+ enabled?: boolean;
995
+ toolPrefix?: string;
996
+ };
940
997
  notify: (type: 'warning' | 'error', text: string) => void;
941
998
  threads: Ref<Thread<AgentThreadState>[]>;
942
999
  threadsPagination: Ref<ThreadsPagination>;
@@ -969,8 +1026,14 @@ declare class ThreadDirectory {
969
1026
  get activeCount(): number;
970
1027
  get generatingCount(): number;
971
1028
  /**
972
- * 恢复 running run 的 SSE:在已加载列表里过滤活跃线程 → listRuns 确认 → init + joinStream。
973
- * interrupted 线程不恢复(打开时经 init 恢复 interrupt 卡片)。并行确认,串行连接(并发上限内)。
1029
+ * 恢复未完成 run 的 SSE:按 thread.status(含 interrupted)筛出候选线程并行 listRuns
1030
+ * 取最新 run → init + joinStream。
1031
+ * ⚠️ DeerFlow 语义:thread.status 与 run.status 的 'interrupted' 都表示「run 未完成」
1032
+ *(_derive_thread_status:tasks 非空 → interrupted;涵盖在跑、停在半路、HITL 挂起),
1033
+ * 不等于 LangGraph 官方的「HITL 挂起」——因此 run.status 不作硬判定,最新 run 一律
1034
+ * join:在跑则继续收流;已断则 join 返回 end 帧走 onFinish 对账(runs/state/citation
1035
+ * 刷新),页面收敛到最终状态。join 为只读幂等端点,误 join 无副作用。
1036
+ * 并行确认,串行连接(并发上限内)。
974
1037
  */
975
1038
  recoverRunningThreads(): Promise<void>;
976
1039
  dispose(): void;
@@ -985,14 +1048,15 @@ interface ChatCoreOptions {
985
1048
  maxCachedSessions?: number;
986
1049
  maxConcurrentStreams?: number;
987
1050
  /** 数字孪生 block 配置(web 端按客户端类型注入;缺省关闭) */
988
- twin?: BlockBuilderLiteOptions['twin'];
1051
+ twin?: ThreadRuntimeOptions['twin'];
989
1052
  /** 新 thread 默认标题(UI 文案注入) */
990
1053
  defaultThreadTitle?: string;
991
1054
  }
992
1055
  /** ChatCore 门面(成员与 web 原 chat store 同名同语义) */
993
1056
  interface ChatCore {
994
- messages: Ref<GroupMessage[]>;
995
- groupMessages: Ref<GroupMessage[]>;
1057
+ /** materializer 视图(turns 上游原始结构) */
1058
+ view: Ref<ThreadView>;
1059
+ turns: Ref<Turn[]>;
996
1060
  isGenerating: Ref<boolean>;
997
1061
  isLoadingThread: Ref<boolean>;
998
1062
  currentThreadId: Ref<string | null>;
@@ -1003,17 +1067,25 @@ interface ChatCore {
1003
1067
  getRunById: (runId?: string | null) => RunInfo | undefined;
1004
1068
  getRunsByThreadId: (threadId?: string | null) => RunInfo[];
1005
1069
  clarificationAnswers: Ref<Map<string, string>>;
1070
+ /** R11 投影:尾 turn 最后一个未答澄清(含乐观答案覆盖;ClarificationCard/ChatBox 数据源) */
1071
+ activeClarification: Ref<ClarificationRecord | undefined>;
1006
1072
  setClarificationAnswer: (toolCallId: string, answer: string) => void;
1007
1073
  clearClarificationAnswers: () => void;
1008
1074
  sendMessage: (text: string, options?: SendMessageOptions) => Promise<void>;
1009
1075
  loadThread: (threadId: string) => Promise<void>;
1010
1076
  stopGeneration: () => void;
1011
1077
  clearMessages: () => void;
1012
- updateGroupMessage: (messageId: string, patch: Partial<GroupMessage> | ((msg: GroupMessage) => GroupMessage)) => void;
1013
- addOptimisticGroupMessages: (messages: GroupMessage[]) => void;
1014
- updateGroupMessageBlocks: (messageId: string, blocks: Block[]) => void;
1015
1078
  applyFeedback: (messageId: string, feedback: unknown) => void;
1016
- regenerate: (assistantMessageId: string) => Promise<void>;
1079
+ /** 按 ai 段 id 重新生成(从 turns 定位 human 文本与 kwargs 重发) */
1080
+ regenerateTurn: (aiSegmentId: string) => Promise<void>;
1081
+ /** R5:API 路径乐观 turn(useReportGenerate) */
1082
+ addOptimisticTurn: (body: string) => void;
1083
+ /** R5:更新指定 ai 段正文 */
1084
+ updateAiBody: (aiId: string, body: string) => void;
1085
+ /** W5:定点装饰(API 路径报告卡 attachments 注入;C2 decorate 门面) */
1086
+ decorate: (messageId: string, patch: DecoratePatch) => void;
1087
+ /** W5:密封开放段/turn(API 路径乐观 turn 收尾;流中勿调用) */
1088
+ finalizeTurns: () => void;
1017
1089
  fetchThreads: (reset?: boolean, keyword?: string) => Promise<void>;
1018
1090
  deleteThread: (threadId: string) => Promise<boolean>;
1019
1091
  updateThreadTitle: (threadId: string, title: string) => void;
@@ -1022,8 +1094,9 @@ interface ChatCore {
1022
1094
  runningNotConnectedThreadIds: Ref<Set<string>>;
1023
1095
  recoverRunningThreads: () => Promise<void>;
1024
1096
  activeInterrupt: Ref<Interrupt | undefined>;
1097
+ /** 当前待响应 interrupt 本体(InterruptBar 审核卡数据源;responded 态由 hasPendingInterrupt 派生) */
1098
+ interrupt: Ref<Interrupt | undefined>;
1025
1099
  hasPendingInterrupt: Ref<boolean>;
1026
- hasPendingClarification: Ref<boolean>;
1027
1100
  inputDisabled: Ref<boolean>;
1028
1101
  /** 当前会话流错误(UI 提示位消费;无活跃会话或无错误时为 null) */
1029
1102
  streamError: Ref<Error | null>;
@@ -1037,4 +1110,4 @@ interface ChatCore {
1037
1110
  }
1038
1111
  declare function createChatCore(options: ChatCoreOptions): ChatCore;
1039
1112
 
1040
- export { type HitlDecision as $, type AcquireResult as A, type BlockBuilderOptions as B, type CreateStreamOptions as C, type ChatCoreOptions as D, type ElementNode as E, type ChatNotify as F, type GroupMessageTool as G, type HitlResponse as H, type IKwargs as I, type CitationBlock as J, type CommentNode as K, type CustomBlock as L, type MessageTokenUsage as M, DEFAULT_TWIN_TOOL_PREFIX as N, type OutlineSubChapter as O, type FetchMessagesPageOptions as P, type FormBlock as Q, type RunInfo as R, type SxinNode as S, type ThreadInitialValues as T, type FormFieldItem as U, type FormFieldType as V, type GenerateBodyRequest as W, type GenerateBodyResult as X, type GroupMessageSource as Y, type GroupMessageStatus as Z, type HitlActionRequest as _, type ChatStreamHandle as a, type HitlDecisionType as a0, type HitlInterruptPayload as a1, type HitlReviewConfig as a2, type IAttachment as a3, type IQuote as a4, type InlineCitation as a5, type InterruptReviewBlock as a6, type ListBlock as a7, type ListItem as a8, type Message as a9, createThreadRuntime as aA, getAllowedDecisions as aB, isSameArgs as aC, normalizeForCompare as aD, parseHitlPayload as aE, pickRunMessageMetadata as aF, type MessageMetadata as aa, type MessageRole as ab, type MessageSource as ac, type MessageStatus as ad, type ReportBodyBlock as ae, type ReportGenerateBodyHumanKwargs as af, type ReportOutlineBlock as ag, type ReportSelectedArtifact as ah, type ReportSelectedTemplate as ai, type SearchThreadsOptions as aj, type TextBlock as ak, type TextNode as al, ThreadDirectory as am, type ThreadDirectoryOptions as an, type ThreadRuntime as ao, type ThreadRuntimeOptions as ap, type ThreadsPagination as aq, type TwinBlock as ar, buildHitlDecisions as as, buildInterruptReviewBlock as at, buildInterruptReviewGroup as au, buildRejectDecisions as av, buildRunDirectLatencyMs as aw, buildRunInfo as ax, createBlockBuilderLite as ay, createChatCore as az, type CitationItem as b, type RunMessage as c, type ReportBodyPayload as d, type ReportOutlinePayload as e, type Block as f, type OutlineChapter as g, type GroupMessageType as h, type BlockBuilderLiteOptions as i, type GroupMessage as j, type SendMessageOptions as k, type ChatTransport as l, type MessagesPage as m, type ThreadTokenUsage as n, type StreamSubmitInput as o, type StreamSubmitOptions as p, type AgentThreadState as q, type ArtifactBlock as r, type ArtifactFile as s, type AskClarificationBlock as t, type BlockBase as u, type BlockBuilderLite as v, type BlockSource as w, type BlockStatus as x, type BuildAllOptions as y, type ChatCore as z };
1113
+ export { type InterruptReviewBlock as $, type AcquireResult as A, type Block as B, type CitationItem as C, type DecoratePatch as D, type ExtractedPayload as E, type FetchMessagesPageOptions as F, type GroupMessageTool as G, type HitlResponse as H, type IKwargs as I, type FormBlock as J, type FormFieldItem as K, type FormFieldType as L, type MessageTokenUsage as M, type GenerateBodyRequest as N, type OutlineSubChapter as O, type GenerateBodyResult as P, type HitlActionRequest as Q, type RunInfo as R, type StreamSubmitInput as S, type ThreadView as T, type HitlDecision as U, type HitlDecisionType as V, type HitlInterruptPayload as W, type HitlReviewConfig as X, type IAttachment as Y, type IQuote as Z, type InlineCitation as _, type RunMessage as a, type ItemSegment as a0, type ListBlock as a1, type ListItem as a2, type Message as a3, type MessageMetadata as a4, type MessageRole as a5, type MessageSource as a6, type MessageStatus as a7, type ReportGenerateBodyHumanKwargs as a8, type ReportSelectedArtifact as a9, type ReportSelectedTemplate as aa, type SearchThreadsOptions as ab, type SendMessageOptions as ac, type TextBlock as ad, ThreadDirectory as ae, type ThreadDirectoryOptions as af, type ThreadRuntime as ag, type ThreadRuntimeOptions as ah, type ThreadsPagination as ai, type ToolRun as aj, type TurnEffect as ak, type XmlAttrs as al, buildHitlDecisions as am, buildInterruptReviewBlock as an, buildRejectDecisions as ao, buildRunDirectLatencyMs as ap, buildRunInfo as aq, createChatCore as ar, createThreadRuntime as as, getAllowedDecisions as at, isSameArgs as au, normalizeForCompare as av, parseHitlPayload as aw, pickRunMessageMetadata as ax, sliceBodySegments as ay, type ReportBodyPayload as b, type ReportOutlinePayload as c, type BlockBuilderOptions as d, type OutlineChapter as e, type Turn as f, type ClarificationRecord as g, type ChatTransport as h, type ThreadInitialValues as i, type MessagesPage as j, type ThreadTokenUsage as k, type StreamSubmitOptions as l, type CreateStreamOptions as m, type AgentThreadState as n, type AiTurn as o, type ArtifactFile as p, type Attachment as q, type BlockBase as r, type BlockSource as s, type BlockStatus as t, type BodySegment as u, type ChatCore as v, type ChatCoreOptions as w, type ChatNotify as x, type ChatStreamHandle as y, type CustomBlock as z };