@webskill/chatbot 0.0.1 → 0.1.0

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/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { AgentLoopConfig, ApprovalScope, BridgeCapabilities, ExternalSkillProvider, ExternalToolSource, FileSystemProvider, InteractionRequest, InteractionResponse, LlmClient, NetworkPolicy, RenderBlock, RenderResultRequest, RunSnapshot, RunSnapshot as RunSnapshot$1, RuntimePhase, RuntimeRun, ScriptExecutor, TraceEvent, UiBridge, UiSurfaceActionRequest, UiSurfaceActionResponse, UiSurfaceDrafts, UiSurfaceEvent, UiSurfaceSnapshot } from "@webskill/sdk";
1
+ import { AgentLoopConfig, ApprovalScope, BridgeCapabilities, ExternalSkillProvider, ExternalToolSource, FileSystemProvider, HookRunner, InteractionRequest, InteractionResponse, LifecycleEventInit, LlmClient, NetworkPolicy, Page, PageQuery, RenderBlock, RenderResultRequest, RunSnapshot, RunSnapshotListEntry, ScriptExecutor, SessionStore, SkillCatalogEntry, SkillIntegrityGuard, SkillOutcomeReporter, SkillStateGuard, UiBridge, UiSpecDrafts, UiSpecEvent, UiSpecSnapshot, UiSurfaceActionRequest, UiSurfaceActionResponse } from "@webskill/sdk";
2
2
  import { SandboxMode } from "@webskill/sdk/browser";
3
- import { ReactBridgeState, SurfaceRegistry, UiSurfaceActionEvent } from "@webskill/sdk/ui-react";
4
- import "@webskill/sdk/ui";
3
+ import { CustomSurfaceActionEvent, ReactBridgeState, SpecInteractionChannel, SurfaceRegistry, UiSurfaceActionEvent } from "@webskill/sdk/ui-react";
5
4
  import "react";
6
5
  import "react/jsx-runtime";
7
6
  //#region ../ui-kit/src/i18n/types.d.ts
7
+ /** @stable */
8
8
  type Locale = 'zh' | 'en';
9
9
  /** 单语言词条:key → 文案(支持 {name} 占位插值) */
10
10
  type LocaleMessages = Record<string, string>;
@@ -60,6 +60,12 @@ interface RuntimeInteractionConfig {
60
60
  approvalScope: ApprovalScope$1;
61
61
  }
62
62
  type RuntimeRouterStrategy = 'progressive' | 'full-disclosure';
63
+ /** 生命周期钩子执行策略(`HookRunnerOptions` 的可配置部分) */
64
+ interface RuntimeHooksConfig {
65
+ timeoutMs: number;
66
+ /** true 时钩子异常终止 run;缺省隔离为 warning */
67
+ failOnHookError: boolean;
68
+ }
63
69
  /** 浏览器宿主执行器档位;Node 宿主的 in-process/worker/process 由宿主侧扩展展示 */
64
70
  type RuntimeSandboxExecutor = 'auto' | 'blob-worker' | 'iframe-sandbox';
65
71
  interface RuntimeSandboxConfig {
@@ -70,6 +76,16 @@ interface RuntimeSandboxConfig {
70
76
  writeArtifact: CapabilityMode;
71
77
  confirm: CapabilityMode;
72
78
  };
79
+ /**
80
+ * 出站 URL 准入策略(`RemoteUrlPolicy` 的可配置部分):技能安装、MCP 端点连接
81
+ * 这类由宿主发起的取数都按它判定。两项都默认关,即 https-only 且拒绝内网/环回。
82
+ */
83
+ remoteUrl: RuntimeRemoteUrlConfig;
84
+ }
85
+ /** 与 `@webskill/core` 的 `RemoteUrlPolicy` 同形,但两个字段都是必填(配置需要确定值) */
86
+ interface RuntimeRemoteUrlConfig {
87
+ allowHttp: boolean;
88
+ allowPrivateHosts: boolean;
73
89
  }
74
90
  type RuntimeLlmProvider = 'openai-compatible' | 'anthropic' | 'google';
75
91
  interface RuntimeLlmConfig {
@@ -79,17 +95,20 @@ interface RuntimeLlmConfig {
79
95
  model: string;
80
96
  requestTimeoutMs?: number;
81
97
  }
98
+ /** @experimental */
82
99
  interface RuntimeConfig {
83
100
  loop: RuntimeLoopConfig;
84
101
  interaction: RuntimeInteractionConfig;
85
102
  router: {
86
103
  strategy: RuntimeRouterStrategy;
87
104
  };
105
+ hooks: RuntimeHooksConfig;
88
106
  streaming: boolean;
89
107
  renderResult: boolean;
90
108
  sandbox: RuntimeSandboxConfig;
91
109
  llm: RuntimeLlmConfig;
92
110
  }
111
+ /** @experimental */
93
112
  interface RuntimeConfigStore {
94
113
  /**
95
114
  * Loads the runtime configuration. Implementations SHOULD return a complete
@@ -103,19 +122,47 @@ interface RuntimeConfigStore {
103
122
  }
104
123
  //#endregion
105
124
  //#region src/core/types.d.ts
125
+ /**
126
+ * 治理 port 集合(F1):宿主把 `SkillStatePolicy` 的适配器交给 chatbot,
127
+ * 由它接到内部装配的 `WebSkillRuntime` 上。字段名与 `WebSkillRuntimeDeps` 逐个对齐,
128
+ * 不做重命名:中间多一层映射只会让宿主多记一套名字。
129
+ * @experimental
130
+ */
131
+ interface ChatbotGovernancePorts {
132
+ /** `SkillStatePolicy.toSkillStateGuard()`:read/activate/execute 三入口拦截 */
133
+ skillStateGuard?: SkillStateGuard;
134
+ /** `SkillStatePolicy.toSkillIntegrityGuard(verify)`:激活期验签,失败即隔离 */
135
+ skillIntegrityGuard?: SkillIntegrityGuard;
136
+ /** `SkillStatePolicy.toSkillOutcomeReporter()`:执行失败计数,达阈值即隔离 */
137
+ skillOutcomeReporter?: SkillOutcomeReporter;
138
+ /** `SkillStatePolicy.catalogFilter()`:非 active 技能不进路由候选集 */
139
+ catalogFilter?: (entries: SkillCatalogEntry[]) => SkillCatalogEntry[] | Promise<SkillCatalogEntry[]>;
140
+ }
141
+ /** 分配式交叉:直接写 `信封 & LifecycleEventInit` 会把联合压成一个对象,`phase` 的判别性就没了 */
142
+ type WithChatMeta<T> = T extends unknown ? {
143
+ type: 'lifecycle';
144
+ runId: string;
145
+ at: number;
146
+ } & T : never;
147
+ /**
148
+ * 生命周期步进事件:`data` 随 `phase` 判别,与 runtime 的 `LifecycleEvent` 同一套契约。
149
+ * 旧的 `Record<string, unknown>` 等于没有契约:消费方只能硬编码键名。
150
+ */
151
+ type LifecycleChatEvent = WithChatMeta<LifecycleEventInit>;
106
152
  /**
107
153
  * 交互渲染框架档位:native(React InteractionCard)/ a2ui(@a2ui/lit Lit 渲染)/
108
- * openui(@openuidev/react-lang Renderer,ui-kit Library)/ vercel(payload 预览档,
109
- * 展示 Vercel AI SDK 数据契约 JSON,非完整运行时)
154
+ * openui(@openuidev/react-lang Renderer,ui-kit Library)/ vercel(@json-render/react
155
+ * Registry 渲染 catalog 声明树)
156
+ * @experimental
110
157
  */
111
158
  type RendererKind = 'native' | 'a2ui' | 'openui' | 'vercel';
112
- /** OpenAI 兼容端点配置(全部缺省时使用内置演示 LLM) */
159
+ /** OpenAI 兼容端点配置(全部缺省时使用内置演示 LLM) @stable */
113
160
  interface LlmConfig {
114
161
  baseUrl?: string;
115
162
  apiKey?: string;
116
163
  model?: string;
117
164
  }
118
- /** assistant 消息所属 run 的一次工具调用(终态:completed/failed) */
165
+ /** assistant 消息所属 run 的一次工具调用(终态:completed/failed) @stable */
119
166
  interface ChatToolCall {
120
167
  callId: string;
121
168
  name: string;
@@ -125,7 +172,7 @@ interface ChatToolCall {
125
172
  /** 执行耗时(trace completed/failed 回填;live 由 started→终态计时) */
126
173
  durationMs?: number;
127
174
  }
128
- /** 已落盘的待发送附件(composer 附件适配器产出) */
175
+ /** 已落盘的待发送附件(composer 附件适配器产出) @experimental */
129
176
  interface ChatAttachmentInput {
130
177
  id: string;
131
178
  name: string;
@@ -134,11 +181,12 @@ interface ChatAttachmentInput {
134
181
  path: string;
135
182
  size: number;
136
183
  }
137
- /** 随消息持久化的附件元数据 */
184
+ /** 随消息持久化的附件元数据 @experimental */
138
185
  interface ChatAttachmentMeta extends ChatAttachmentInput {
139
186
  /** 注入模型的内容形态;text 以外的类型当前不接收(runtime 只收纯文本 prompt) */
140
187
  kind: 'text';
141
188
  }
189
+ /** @stable */
142
190
  interface ChatMessage {
143
191
  id: string;
144
192
  role: 'user' | 'assistant';
@@ -158,8 +206,9 @@ interface ChatMessage {
158
206
  */
159
207
  blocks?: RenderBlock[];
160
208
  /** The completed generative UI surfaces emitted by this run, retained for history replay. */
161
- surfaces?: UiSurfaceSnapshot[];
209
+ surfaces?: UiSpecSnapshot[];
162
210
  }
211
+ /** @stable */
163
212
  interface ChatSessionMeta {
164
213
  id: string;
165
214
  createdAt: string;
@@ -169,6 +218,7 @@ interface ChatSessionMeta {
169
218
  /** 用户已手动重命名:后续 send 不再用首条消息覆盖标题 */
170
219
  titleLocked?: boolean;
171
220
  }
221
+ /** @stable */
172
222
  type ChatEvent = {
173
223
  type: 'run-started';
174
224
  runId: string;
@@ -216,13 +266,7 @@ type ChatEvent = {
216
266
  id: string;
217
267
  requestType: InteractionRequest['type'];
218
268
  cancelled?: boolean;
219
- } | {
220
- type: 'lifecycle';
221
- runId: string;
222
- phase: RuntimePhase;
223
- at: number;
224
- data?: Record<string, unknown>;
225
- } | {
269
+ } | LifecycleChatEvent | {
226
270
  type: 'session-updated';
227
271
  session: ChatSessionMeta;
228
272
  } | {
@@ -233,6 +277,7 @@ type ChatEvent = {
233
277
  message: string;
234
278
  code?: string;
235
279
  };
280
+ /** @stable */
236
281
  interface ChatbotConfig {
237
282
  /** header 标题,默认 'WebSkill Chat' */
238
283
  title?: string;
@@ -256,12 +301,20 @@ interface ChatbotConfig {
256
301
  * 默认关:工具描述 + 入参 schema 约 14 KB,会计入每一次请求。
257
302
  */
258
303
  generativeUi?: boolean;
304
+ /** 宿主注册好钩子的 `HookRunner`;执行策略(超时/严格模式)按 `RuntimeConfig.hooks` 应用 */
305
+ hooks?: HookRunner;
306
+ /**
307
+ * 治理 port 注入(F1):透传给 `ChatEngineOptions.governance`。
308
+ * 不注入即完全关闭,行为与 0.0.2 一致。
309
+ */
310
+ governance?: ChatbotGovernancePorts;
259
311
  }
260
312
  //#endregion
261
313
  //#region src/core/hostAdapter.d.ts
262
314
  /**
263
315
  * 宿主装配口:chatbot 不感知环境(浏览器/Node),全部能力经此注入。
264
316
  * 页面动态技能来源同时是外部工具来源与外部技能提供者(同一对象两个 port)。
317
+ * @stable
265
318
  */
266
319
  interface ChatbotHostAdapter {
267
320
  storage: FileSystemProvider;
@@ -281,92 +334,8 @@ interface ChatbotHostAdapter {
281
334
  executor?: ScriptExecutor;
282
335
  }
283
336
  //#endregion
284
- //#region src/core/interactionBridge.d.ts
285
- /**
286
- * 探测 A2UI Lit 渲染器是否可用(@a2ui/lit 为 optional peer,未安装时 import 失败)。
287
- * Appearance/设置区据此对 A2UI 档置灰;仅动态 import,不强依赖。
288
- */
289
- declare function probeA2uiAvailability(): Promise<boolean>;
290
- /**
291
- * 为 A2UI 挂载容器配置 Markdown 渲染(@a2ui/markdown-it,optional peer):
292
- * 经 @lit/context 向 surface 子树注入 renderMarkdown(markdown-it + dompurify),
293
- * 消除 "[MarkdownDirective] can't render markdown" 降级。
294
- * 未安装时返回 false(宿主可据此保留产品化限制说明)。
295
- */
296
- declare function configureA2uiMarkdown(mount: HTMLElement): Promise<boolean>;
297
- /**
298
- * 探测 OpenUI 渲染器是否可用(@openuidev/react-lang 为 optional peer)。
299
- * Appearance/设置区据此对 OpenUI 档置灰;仅动态 import,不强依赖。
300
- */
301
- declare function probeOpenUiAvailability(): Promise<boolean>;
302
- /** openui 档一次待决交互(lang 文本由 react 层交给 @openuidev/react-lang Renderer 渲染) */
303
- interface OpenUiSession {
304
- request: InteractionRequest;
305
- lang: string;
306
- }
307
- /**
308
- * OpenUI 交互通道(core 层,不 import react):
309
- * - request() 把 InteractionRequest 转成 openui-lang 文本并挂起,react 层
310
- * (OpenUiInteraction)订阅 current 后动态加载 @openuidev/react-lang 渲染;
311
- * - 动作事件经 handleAction → fromOpenUiAction(含 authorize Allow/Deny 语义)回传;
312
- * - react 层初始化失败调 fail():挂起请求 reject(桥据此粘性降级 native)并记录原因;
313
- * - attach/detach 标记渲染视图是否挂载(未挂载时桥直接降级 native,不悬挂请求)。
314
- */
315
- declare class OpenUiChannel {
316
- #private;
317
- /** React useSyncExternalStore 兼容订阅 */
318
- subscribe: (listener: () => void) => (() => void);
319
- get current(): OpenUiSession | undefined;
320
- get isAttached(): boolean;
321
- /** react 层初始化失败原因(未安装 @openuidev/react-lang 等);记录后粘性生效 */
322
- get failure(): string | undefined;
323
- attach(): void;
324
- detach(): void;
325
- request(input: InteractionRequest): Promise<InteractionResponse>;
326
- /** runtime 交互超时/取消:以 cancelled resolve 挂起的 request(防悬挂 + 残留) */
327
- cancel(id: string): void;
328
- /** react 层 OpenUI 动作回传(fromOpenUiAction:Allow → value:true;Deny/Cancel → cancelled:true) */
329
- handleAction(action: unknown): void;
330
- /** react 层初始化失败:挂起请求 reject 并记录原因(桥读取后降级 native) */
331
- fail(message: string): void;
332
- }
333
- interface CompositeUiBridgeDeps {
334
- /** native 档交互 + streamingText/renderResult 数据源(始终生效;vercel 预览档也走它) */
335
- reactBridge: ReactBridgeState;
336
- getRenderer(): RendererKind;
337
- /** a2ui 档交互容器(Chatbot ref 回调注入;未挂载时 a2ui 请求降级 native) */
338
- getInteractionMount(): HTMLElement | undefined;
339
- /** openui 档交互通道(引擎持有;react 层 OpenUiInteraction attach 后生效) */
340
- getOpenUiChannel(): OpenUiChannel;
341
- emit(event: ChatEvent): void;
342
- }
343
- /**
344
- * 复合 UiBridge(P2/P3 渲染框架档):
345
- * - streamingText / renderResult 始终委托 ReactBridgeState(结果块数据源不变);
346
- * - 交互 request/cancel 按渲染档分发:native → ReactBridgeState(InteractionCard),
347
- * a2ui → LitRendererBridge(@a2ui/lit,容器由 Chatbot 提供),
348
- * openui → OpenUiChannel(@openuidev/react-lang Renderer 由 react 层装配),
349
- * vercel → ReactBridgeState(payload 预览卡消费 bridge.pending,仅可取消);
350
- * - 每次交互开始/结束发 interaction-requested/resolved 事件(UI 据此显隐 a2ui 容器);
351
- * - a2ui/openui 初始化失败(optional peer 未安装等)降级 native + warning 事件,不阻断 run。
352
- */
353
- declare class CompositeUiBridge implements UiBridge {
354
- #private;
355
- constructor(deps: CompositeUiBridgeDeps);
356
- /** 渲染档热切换:丢弃已建的 a2ui 桥与降级状态(新档立即生效,无需重装配 runtime) */
357
- reset(): void;
358
- request(input: InteractionRequest): Promise<InteractionResponse>;
359
- /** runtime 交互超时/取消:按档委托(a2ui/openui 桥 cancel 会以 cancelled resolve 挂起的 request) */
360
- cancel(id: string): void;
361
- renderResult(input: RenderResultRequest): Promise<void>;
362
- renderSurface(event: UiSurfaceEvent): Promise<void>;
363
- requestSurfaceAction(input: UiSurfaceActionRequest): Promise<UiSurfaceActionResponse>;
364
- cancelSurfaceAction(nonce: string): void;
365
- onTextDelta(runId: string, delta: string): Promise<void>;
366
- }
367
- //#endregion
368
337
  //#region src/core/chatEngine.d.ts
369
- /** 默认沙箱执行器的构造参数(adapter.executor 未注入时;executorFactory 替换点可见同一形状) */
338
+ /** 默认沙箱执行器的构造参数(adapter.executor 未注入时;executorFactory 替换点可见同一形状) @stable */
370
339
  interface SandboxExecutorDeps {
371
340
  fs: FileSystemProvider;
372
341
  sandbox?: SandboxMode;
@@ -375,6 +344,7 @@ interface SandboxExecutorDeps {
375
344
  approvalScope?: ApprovalScope;
376
345
  uiBridge?: UiBridge;
377
346
  }
347
+ /** @stable */
378
348
  interface ChatEngineOptions {
379
349
  llm?: LlmClient;
380
350
  loopConfig?: AgentLoopConfig;
@@ -387,10 +357,31 @@ interface ChatEngineOptions {
387
357
  generativeUi?: boolean;
388
358
  /** 沙箱执行器替换点(测试注入 spy 断言构造参数;缺省 BrowserWorkerScriptExecutor) */
389
359
  executorFactory?: (deps: SandboxExecutorDeps) => ScriptExecutor;
360
+ /**
361
+ * 会话落盘替换点(缺省 `FsSessionStore`,落在 `<chatRoot>/sessions`)。
362
+ * 宕主换自己的实现(如 IndexedDB)与测试统计端口读写量都走这里。
363
+ */
364
+ sessionStore?: SessionStore<ChatMessage>;
365
+ /**
366
+ * 宿主已注册好钩子的执行器;装配时把 `RuntimeConfig.hooks` 应用到它再交给 runtime。
367
+ * 不注入即不挂钩子(与 0.0.2 行为一致)。
368
+ */
369
+ hooks?: HookRunner;
370
+ /**
371
+ * 治理 port 注入(F1):把 `SkillStatePolicy` 的三个适配器接到本引擎装配的 runtime 上。
372
+ *
373
+ * 不注入即完全关闭,行为与 0.0.2 一致。装配点必须在宿主:chatbot 不能依赖
374
+ * `@webskill/governance`(它是可选治理层,且要求宿主提供治理根与审计存储)。
375
+ *
376
+ * 三个一起给才形成闭环——只给 `skillOutcomeReporter` 会把技能标成 `quarantined`
377
+ * 却仍旧照常路由和执行,降级形同虚设。
378
+ */
379
+ governance?: ChatbotGovernancePorts;
390
380
  }
391
381
  /**
392
382
  * 对话框引擎:装配 WebSkillRuntime + 会话持久化 + 事件分发。
393
383
  * llmConfig.load() 是异步的,runtime 在首次 send 前懒装配(#ensureReady)。
384
+ * @stable
394
385
  */
395
386
  declare class ChatEngine {
396
387
  #private;
@@ -400,10 +391,8 @@ declare class ChatEngine {
400
391
  get renderer(): RendererKind;
401
392
  /** 渲染框架热切换:复合桥按档分发,无需重装配 runtime(会话句柄保留) */
402
393
  setRenderer(renderer: RendererKind): void;
403
- /** a2ui 档交互容器注入(Chatbot ref 回调;卸载传 null) */
404
- setInteractionMount(el: HTMLElement | null): void;
405
- /** openui 档交互通道(Chatbot 的 OpenUiInteraction 订阅/attach;core 只产出 lang 文本) */
406
- get openUiChannel(): OpenUiChannel;
394
+ /** native 三档共用的交互通道(Chatbot SpecInteraction 订阅/attach;core 只产出 catalog 节点树) */
395
+ get interactionChannel(): SpecInteractionChannel;
407
396
  /** 探测 @a2ui/lit 是否安装(Appearance/设置区 A2UI 档置灰判定) */
408
397
  probeA2uiAvailability(): Promise<boolean>;
409
398
  onEvent(listener: (event: ChatEvent) => void): () => void;
@@ -414,9 +403,21 @@ declare class ChatEngine {
414
403
  reloadConfig(): void;
415
404
  /** 旧名保留(与 reloadConfig 同语义,向后兼容) */
416
405
  reloadLlm(): void;
417
- listSessions(): Promise<ChatSessionMeta[]>;
406
+ /**
407
+ * 会话列表页。归档会话也返回:UI 自己分区展示。
408
+ * `limit` 不给默认值——缺省属于 `SessionStore` 实现,在这里兜底就等于只下推了一半。
409
+ */
410
+ listSessions(options?: PageQuery): Promise<Page<ChatSessionMeta>>;
418
411
  createSession(): Promise<ChatSessionMeta>;
419
- selectSession(id: string): Promise<ChatMessage[]>;
412
+ /**
413
+ * 选中会话并取**最新**一页历史(页内时间升序)。
414
+ * 返回全量 `ChatMessage[]` 的旧签名已移除:长会话下它强迫每个调用方拿全量。
415
+ */
416
+ selectSession(id: string, options?: PageQuery): Promise<Page<ChatMessage>>;
417
+ /** 向历史方向再取一页;`cursor` 只能来自上一页的 `nextCursor` */
418
+ loadMoreMessages(cursor: string, options?: {
419
+ limit?: number;
420
+ }): Promise<Page<ChatMessage>>;
420
421
  deleteSession(id: string): Promise<void>;
421
422
  /** 重命名会话:写入 title 并锁定(后续 send 不再用首条消息覆盖) */
422
423
  renameSession(id: string, title: string): Promise<void>;
@@ -443,8 +444,8 @@ declare class ChatEngine {
443
444
  get attachmentsRoot(): string;
444
445
  /** 取消进行中的 run(Composer Stop 按钮);run 未找到/已结束返回 false */
445
446
  cancel(runId: string): boolean;
446
- /** 列出可恢复的 interrupted run(InterruptedBanner 数据源) */
447
- listInterrupted(): Promise<RunSnapshot$1[]>;
447
+ /** 列出 interrupted run(InterruptedBanner 数据源);版本不受支持的项带 unsupported 标记 */
448
+ listInterrupted(): Promise<RunSnapshotListEntry[]>;
448
449
  /**
449
450
  * 恢复 interrupted run:等待中的交互重新进入 bridge.pending(UI 复用 InteractionForm),
450
451
  * 完成后与 send 同路径(assistant 消息持久化 + run-completed + trace 落盘)。
@@ -452,28 +453,85 @@ declare class ChatEngine {
452
453
  resume(runId: string): Promise<void>;
453
454
  }
454
455
  //#endregion
455
- //#region src/core/traceSink.d.ts
456
+ //#region src/core/interactionBridge.d.ts
457
+ /** 单个渲染档的能力集(复合桥判定该不该回落 native 的唯一数据源) @experimental */
458
+ interface RendererCapability {
459
+ /** 路径 A:runtime 发起的交互请求能否在本档内渲染 */
460
+ interaction: boolean;
461
+ /** 路径 B:模型产出的 surface 能否在本档内渲染 */
462
+ surface: boolean;
463
+ /** 本档依赖的 optional peer 包名(未安装 → 粘性降级 native) */
464
+ requiresPeer?: string;
465
+ }
456
466
  /**
457
- * run trace 落盘格式:与 console 包的共享约定(两包零依赖,console
458
- * createFsTraceSource(fs, chatRoot) 读同一位置),字段名不得擅自变更。
467
+ * 渲染档 能力集。四档在 0.4.0 interaction/surface 全部等价,
468
+ * 差别只剩「是否依赖 optional peer」。作为可注入值传入 CompositeUiBridge,
469
+ * 便于宿主按实际装配情况覆盖(例如已确认某 peer 不可用)。
470
+ * @experimental
459
471
  */
460
- interface RunTraceFile {
461
- runId: string;
462
- sessionId: string;
463
- startedAt: string;
464
- endedAt?: string;
465
- status: 'completed' | 'failed' | 'cancelled';
466
- activeSkills: string[];
467
- events: TraceEvent[];
472
+ declare const DEFAULT_RENDERER_CAPABILITIES: Readonly<Record<RendererKind, RendererCapability>>;
473
+ /**
474
+ * 探测 A2UI Lit 渲染器是否可用(@a2ui/lit 为 optional peer,未安装时 import 失败)。
475
+ * Appearance/设置区据此对 A2UI 档置灰;仅动态 import,不强依赖。
476
+ * @experimental
477
+ */
478
+ declare function probeA2uiAvailability(): Promise<boolean>;
479
+ /**
480
+ * 为 A2UI 挂载容器配置 Markdown 渲染(@a2ui/markdown-it,optional peer):
481
+ * 经 @lit/context 向 surface 子树注入 renderMarkdown(markdown-it + dompurify),
482
+ * 消除 "[MarkdownDirective] can't render markdown" 降级。
483
+ * 未安装时返回 false(宿主可据此保留产品化限制说明)。
484
+ * @experimental
485
+ */
486
+ declare function configureA2uiMarkdown(mount: HTMLElement): Promise<boolean>;
487
+ /**
488
+ * 探测 OpenUI 渲染器是否可用(@openuidev/react-lang 为 optional peer)。
489
+ * Appearance/设置区据此对 OpenUI 档置灰;仅动态 import,不强依赖。
490
+ * @experimental
491
+ */
492
+ declare function probeOpenUiAvailability(): Promise<boolean>;
493
+ /** @stable */
494
+ interface CompositeUiBridgeDeps {
495
+ /** native 档交互 + streamingText/renderResult 数据源(始终生效,也是各档降级后的接管方) */
496
+ reactBridge: ReactBridgeState;
497
+ getRenderer(): RendererKind;
498
+ /** 非 native 三档共用的交互通道(引擎持有;本档交互视图 attach 后生效) */
499
+ getInteractionChannel(): SpecInteractionChannel;
500
+ /** 渲染档能力表(省略用 DEFAULT_RENDERER_CAPABILITIES) */
501
+ capabilities?: Readonly<Record<RendererKind, RendererCapability>>;
502
+ emit(event: ChatEvent): void;
503
+ }
504
+ /**
505
+ * 复合 UiBridge(P2/P3 渲染框架档):
506
+ * - streamingText / renderResult 始终委托 ReactBridgeState(结果块数据源不变);
507
+ * - 交互 request/cancel 按渲染档分发:native → ReactBridgeState(InteractionCard),
508
+ * 其余三档 → SpecInteractionChannel(core 产出 catalog 节点树,react 层交给本档
509
+ * 已有的 spec 渲染路径:A2uiSpecSurface / OpenUiSpecSurface / JsonRenderSpecSurface);
510
+ * - 每次交互开始/结束发 interaction-requested/resolved 事件;
511
+ * - 非 native 档初始化失败(optional peer 未安装等)降级 native + warning 事件,不阻断 run。
512
+ * @stable
513
+ */
514
+ declare class CompositeUiBridge implements UiBridge {
515
+ #private;
516
+ constructor(deps: CompositeUiBridgeDeps);
517
+ /** 渲染档热切换:清降级状态(新档立即生效,无需重装配 runtime) */
518
+ reset(): void;
519
+ request(input: InteractionRequest): Promise<InteractionResponse>;
520
+ /** runtime 交互超时/取消:按档委托(通道 cancel 会以 cancelled resolve 挂起的 request) */
521
+ cancel(id: string): void;
522
+ renderResult(input: RenderResultRequest): Promise<void>;
523
+ renderSurface(event: UiSpecEvent): Promise<void>;
524
+ requestSurfaceAction(input: UiSurfaceActionRequest): Promise<UiSurfaceActionResponse>;
525
+ cancelSurfaceAction(nonce: string): void;
526
+ onTextDelta(runId: string, delta: string): Promise<void>;
468
527
  }
469
- /** 写 `<chatRoot>/traces/<runId>.json`;写失败降级 console.warn,不阻断对话 */
470
- declare function writeRunTrace(fs: FileSystemProvider, chatRoot: string, run: RuntimeRun): Promise<void>;
471
528
  //#endregion
472
529
  //#region src/i18n.d.ts
473
530
  /**
474
531
  * chatbot 双语字典:全部 UI 文案的单一来源(英文为主,zh 条目齐全)。
475
532
  * 特性区块(WelcomeScreen / SettingsDrawer 各节 / authorize 说明等)必须含
476
533
  * title + description 双语条目——"会说话的 UI"的文案底座。
534
+ * @stable
477
535
  */
478
536
  declare const chatbotDictionary: {
479
537
  en: {
@@ -486,6 +544,14 @@ declare const chatbotDictionary: {
486
544
  'session.searchPlaceholder': string;
487
545
  'session.empty': string;
488
546
  'session.delete': string;
547
+ 'session.rename': string;
548
+ 'session.renameInput': string;
549
+ 'session.archive': string;
550
+ 'session.unarchive': string;
551
+ 'session.archived': string;
552
+ 'session.loadEarlier': string;
553
+ 'session.loading': string;
554
+ 'message.loadEarlier': string;
489
555
  'welcome.title': string;
490
556
  'welcome.assistantTitle': string;
491
557
  'welcome.description': string;
@@ -605,6 +671,7 @@ declare const chatbotDictionary: {
605
671
  'vercel.preview.title': string;
606
672
  'vercel.preview.badge': string;
607
673
  'vercel.preview.description': string;
674
+ 'surface.legacy.placeholder': string;
608
675
  'error.title': string;
609
676
  'error.suggestion': string;
610
677
  'error.dismiss': string;
@@ -619,6 +686,14 @@ declare const chatbotDictionary: {
619
686
  'session.searchPlaceholder': string;
620
687
  'session.empty': string;
621
688
  'session.delete': string;
689
+ 'session.rename': string;
690
+ 'session.renameInput': string;
691
+ 'session.archive': string;
692
+ 'session.unarchive': string;
693
+ 'session.archived': string;
694
+ 'session.loadEarlier': string;
695
+ 'session.loading': string;
696
+ 'message.loadEarlier': string;
622
697
  'welcome.title': string;
623
698
  'welcome.assistantTitle': string;
624
699
  'welcome.description': string;
@@ -738,12 +813,13 @@ declare const chatbotDictionary: {
738
813
  'vercel.preview.title': string;
739
814
  'vercel.preview.badge': string;
740
815
  'vercel.preview.description': string;
816
+ 'surface.legacy.placeholder': string;
741
817
  'error.title': string;
742
818
  'error.suggestion': string;
743
819
  'error.dismiss': string;
744
820
  };
745
821
  };
746
- /** chatbot 组件取文案:t('welcome.title') / t('tool.summary.other', { count: 3 }) */
822
+ /** chatbot 组件取文案:t('welcome.title') / t('tool.summary.other', { count: 3 }) @stable */
747
823
  declare const useT: () => TranslateFn<{
748
824
  en: {
749
825
  'app.title': string;
@@ -755,6 +831,14 @@ declare const useT: () => TranslateFn<{
755
831
  'session.searchPlaceholder': string;
756
832
  'session.empty': string;
757
833
  'session.delete': string;
834
+ 'session.rename': string;
835
+ 'session.renameInput': string;
836
+ 'session.archive': string;
837
+ 'session.unarchive': string;
838
+ 'session.archived': string;
839
+ 'session.loadEarlier': string;
840
+ 'session.loading': string;
841
+ 'message.loadEarlier': string;
758
842
  'welcome.title': string;
759
843
  'welcome.assistantTitle': string;
760
844
  'welcome.description': string;
@@ -874,6 +958,7 @@ declare const useT: () => TranslateFn<{
874
958
  'vercel.preview.title': string;
875
959
  'vercel.preview.badge': string;
876
960
  'vercel.preview.description': string;
961
+ 'surface.legacy.placeholder': string;
877
962
  'error.title': string;
878
963
  'error.suggestion': string;
879
964
  'error.dismiss': string;
@@ -888,6 +973,14 @@ declare const useT: () => TranslateFn<{
888
973
  'session.searchPlaceholder': string;
889
974
  'session.empty': string;
890
975
  'session.delete': string;
976
+ 'session.rename': string;
977
+ 'session.renameInput': string;
978
+ 'session.archive': string;
979
+ 'session.unarchive': string;
980
+ 'session.archived': string;
981
+ 'session.loadEarlier': string;
982
+ 'session.loading': string;
983
+ 'message.loadEarlier': string;
891
984
  'welcome.title': string;
892
985
  'welcome.assistantTitle': string;
893
986
  'welcome.description': string;
@@ -1007,6 +1100,7 @@ declare const useT: () => TranslateFn<{
1007
1100
  'vercel.preview.title': string;
1008
1101
  'vercel.preview.badge': string;
1009
1102
  'vercel.preview.description': string;
1103
+ 'surface.legacy.placeholder': string;
1010
1104
  'error.title': string;
1011
1105
  'error.suggestion': string;
1012
1106
  'error.dismiss': string;
@@ -1014,9 +1108,9 @@ declare const useT: () => TranslateFn<{
1014
1108
  }>;
1015
1109
  //#endregion
1016
1110
  //#region src/react/appearance.d.ts
1017
- /** chatbot 主题(根 div 挂 .dark 类生效) */
1111
+ /** chatbot 主题(根 div 挂 .dark 类生效) @stable */
1018
1112
  type ChatTheme = 'light' | 'dark';
1019
- /** SettingsDrawer 内切换外观时回调宿主持久化 */
1113
+ /** SettingsDrawer 内切换外观时回调宿主持久化 @stable */
1020
1114
  interface AppearanceChange {
1021
1115
  theme?: ChatTheme;
1022
1116
  locale?: Locale;
@@ -1025,11 +1119,13 @@ interface AppearanceChange {
1025
1119
  }
1026
1120
  //#endregion
1027
1121
  //#region src/react/useChatLayout.d.ts
1028
- /** 宿主可指定的布局档;auto 按容器尺寸判定 */
1122
+ /** 宿主可指定的布局档;auto 按容器尺寸判定 @stable */
1029
1123
  type ChatLayout = 'auto' | 'fullscreen' | 'embedded';
1124
+ /** @stable */
1030
1125
  type ResolvedChatLayout = 'fullscreen' | 'embedded' | 'mobile';
1031
1126
  //#endregion
1032
1127
  //#region src/react/Chatbot.d.ts
1128
+ /** @stable */
1033
1129
  interface ChatbotProps {
1034
1130
  adapter: ChatbotHostAdapter;
1035
1131
  config?: ChatbotConfig;
@@ -1044,115 +1140,122 @@ interface ChatbotProps {
1044
1140
  /** 布局档(默认 'auto':按容器尺寸在 fullscreen / embedded / mobile 之间判定) */
1045
1141
  layout?: ChatLayout;
1046
1142
  onAppearanceChange?(next: AppearanceChange): void;
1143
+ /**
1144
+ * 装配完成后把引擎交给宿主,用于接线跨界面动作(例如 console 的快照恢复入口
1145
+ * 需要调 `engine.resume(runId)`)。每次重新装配都会再调一次。
1146
+ */
1147
+ onEngineReady?(engine: ChatEngine): void;
1047
1148
  }
1048
1149
  /**
1049
1150
  * ChatEngine owns message/session/runtime state while assistant-ui Base owns the
1050
1151
  * presentation shell and accessible thread primitives.
1152
+ * @stable
1051
1153
  */
1052
- declare function Chatbot({ adapter, config, locale: localeProp, theme: themeProp, renderer: rendererProp, surfaceRegistry, layout, onAppearanceChange }: ChatbotProps): import("react").JSX.Element;
1154
+ declare function Chatbot({ adapter, config, locale: localeProp, theme: themeProp, renderer: rendererProp, surfaceRegistry, layout, onAppearanceChange, onEngineReady }: ChatbotProps): import("react").JSX.Element;
1053
1155
  //#endregion
1054
1156
  //#region src/react/A2uiSurfaceHost.d.ts
1157
+ /** @experimental */
1055
1158
  interface A2uiSurfaceHostProps {
1056
1159
  bridge: ReactBridgeState;
1057
1160
  runId?: string;
1058
1161
  registry?: SurfaceRegistry;
1059
1162
  }
1163
+ /** @experimental */
1060
1164
  interface A2uiSurfaceSnapshotHostProps {
1061
- snapshots: readonly UiSurfaceSnapshot[];
1165
+ snapshots: readonly UiSpecSnapshot[];
1062
1166
  registry?: SurfaceRegistry;
1063
1167
  onAction?(event: UiSurfaceActionEvent): void;
1064
- drafts?: UiSurfaceDrafts;
1168
+ drafts?: UiSpecDrafts;
1065
1169
  onDraftChange?(event: {
1066
1170
  runId: string;
1067
1171
  surfaceId: string;
1068
1172
  value: Record<string, unknown>;
1069
1173
  }): void;
1070
1174
  }
1071
- /** Renders persisted A2UI Basic Catalog surfaces and controlled WebSkill extensions without a live bridge. @experimental */
1175
+ /** Renders persisted WebSkill UI spec snapshots through the A2UI BYOC catalog. @experimental */
1072
1176
  declare function A2uiSurfaceSnapshotHost({ snapshots, registry, onAction, drafts, onDraftChange }: A2uiSurfaceSnapshotHostProps): import("react").JSX.Element | null;
1073
- /** Renders A2UI Basic Catalog surfaces and controlled WebSkill extensions from live bridge snapshots. @experimental */
1177
+ /** Renders WebSkill UI spec snapshots from live bridge state through the A2UI BYOC catalog. @experimental */
1074
1178
  declare function A2uiSurfaceHost({ bridge, runId, registry }: A2uiSurfaceHostProps): import("react").JSX.Element;
1075
1179
  //#endregion
1076
1180
  //#region src/react/SkillBadges.d.ts
1077
- /** 消息底部展示该 run 激活的技能名徽章(无技能不渲染) */
1181
+ /** 消息底部展示该 run 激活的技能名徽章(无技能不渲染) @stable */
1078
1182
  declare function SkillBadges({ skills }: {
1079
1183
  skills: string[];
1080
1184
  }): import("react").JSX.Element | null;
1081
1185
  //#endregion
1082
1186
  //#region src/react/InteractionCard.d.ts
1187
+ /** @stable */
1083
1188
  interface InteractionCardProps {
1084
1189
  bridge: ReactBridgeState;
1085
1190
  }
1086
- /** 订阅 bridge.pending 渲染五类交互卡(ask/confirm/form/select/authorize,native) */
1191
+ /**
1192
+ * 订阅 bridge.pending 渲染五类交互卡(native 档;其它档降级后也由它接管)。
1193
+ * 表单本体走 `NativeSpecSurface`——与 native 档 surface 侧同一个渲染入口。
1194
+ * @stable
1195
+ */
1087
1196
  declare function InteractionCard({ bridge }: InteractionCardProps): import("react").JSX.Element | null;
1088
1197
  //#endregion
1089
- //#region src/react/OpenUiInteraction.d.ts
1090
- interface OpenUiInteractionProps {
1091
- channel: OpenUiChannel;
1198
+ //#region src/react/SpecInteraction.d.ts
1199
+ /** @experimental */
1200
+ interface SpecInteractionProps {
1201
+ channel: SpecInteractionChannel;
1202
+ /** 非 native 三档之一:native 的交互卡由 `InteractionCard` 直接渲染 */
1203
+ renderer: Exclude<RendererKind, 'native'>;
1092
1204
  }
1093
1205
  /**
1094
- * openui 档交互视图:订阅 OpenUiChannel(core 产出 openui-lang 文本),动态加载
1095
- * optional peer @openuidev/react-lang Renderer 渲染;动作事件回传 channel.handleAction。
1096
- * 模块加载失败 → channel.fail(桥粘性降级 native,InteractionCard 接管)。
1206
+ * native 三档的交互视图(路径 A):订阅 SpecInteractionChannel(core 产出 catalog
1207
+ * 节点树),交给本档 surface 侧同一个渲染入口渲染;提交/取消经 handleAction 回传。
1208
+ * 未挂载时桥直接降级 native(不悬挂请求)。
1209
+ * @experimental
1097
1210
  */
1098
- declare function OpenUiInteraction({ channel }: OpenUiInteractionProps): import("react").JSX.Element | null;
1211
+ declare function SpecInteraction({ channel, renderer }: SpecInteractionProps): import("react").JSX.Element | null;
1099
1212
  //#endregion
1100
1213
  //#region src/react/OpenUiSurfaceHost.d.ts
1214
+ /** @experimental */
1101
1215
  interface OpenUiSurfaceHostProps {
1102
1216
  bridge: ReactBridgeState;
1103
1217
  runId?: string;
1104
- registry?: SurfaceRegistry;
1105
1218
  }
1219
+ /** @experimental */
1106
1220
  interface OpenUiSurfaceSnapshotHostProps {
1107
- snapshots: readonly UiSurfaceSnapshot[];
1108
- registry?: SurfaceRegistry;
1109
- onAction?(event: UiSurfaceActionEvent): void;
1110
- drafts?: UiSurfaceDrafts;
1111
- onDraftChange?(event: {
1112
- runId: string;
1113
- surfaceId: string;
1114
- value: Record<string, unknown>;
1115
- }): void;
1221
+ snapshots: readonly UiSpecSnapshot[];
1222
+ onAction?: (event: CustomSurfaceActionEvent) => void;
1116
1223
  }
1117
- /** Renders persisted UiSurface snapshots through the OpenUI extension without a live bridge. @experimental */
1118
- declare function OpenUiSurfaceSnapshotHost({ snapshots, registry, onAction, drafts, onDraftChange }: OpenUiSurfaceSnapshotHostProps): import("react").JSX.Element | null;
1119
- /** Renders serializable UiSurface descriptors through an OpenUI library extension. @experimental */
1120
- declare function OpenUiSurfaceHost({ bridge, runId, registry }: OpenUiSurfaceHostProps): import("react").JSX.Element;
1224
+ /** Renders persisted UI spec snapshots through the OpenUI extension without a live bridge. @experimental */
1225
+ declare function OpenUiSurfaceSnapshotHost({ snapshots, onAction }: OpenUiSurfaceSnapshotHostProps): import("react").JSX.Element | null;
1226
+ /** Renders WebSkill UI spec snapshots through an OpenUI library extension. @experimental */
1227
+ declare function OpenUiSurfaceHost({ bridge, runId }: OpenUiSurfaceHostProps): import("react").JSX.Element;
1121
1228
  //#endregion
1122
1229
  //#region src/react/VercelPayloadPreview.d.ts
1230
+ /** @experimental */
1123
1231
  interface VercelPayloadPreviewProps {
1124
1232
  bridge: ReactBridgeState;
1125
1233
  }
1126
1234
  /**
1127
1235
  * vercel 档(payload 预览):不渲染表单,展示 InteractionRequest 经 toVercelToolInvocation
1128
1236
  * 转换后的 Vercel AI SDK 数据契约 JSON 卡。仅提供 Cancel 结束交互(非完整运行时)。
1237
+ * @experimental
1129
1238
  */
1130
1239
  declare function VercelPayloadPreview({ bridge }: VercelPayloadPreviewProps): import("react").JSX.Element | null;
1131
1240
  //#endregion
1132
1241
  //#region src/react/VercelSurfaceHost.d.ts
1242
+ /** @experimental */
1133
1243
  interface VercelSurfaceHostProps {
1134
1244
  bridge: ReactBridgeState;
1135
1245
  runId?: string;
1136
- registry?: SurfaceRegistry;
1137
1246
  }
1247
+ /** @experimental */
1138
1248
  interface VercelSurfaceSnapshotHostProps {
1139
- snapshots: readonly UiSurfaceSnapshot[];
1140
- registry?: SurfaceRegistry;
1141
- onAction?(event: UiSurfaceActionEvent): void;
1142
- drafts?: UiSurfaceDrafts;
1143
- onDraftChange?(event: {
1144
- runId: string;
1145
- surfaceId: string;
1146
- value: Record<string, unknown>;
1147
- }): void;
1249
+ snapshots: readonly UiSpecSnapshot[];
1250
+ onAction?: (event: CustomSurfaceActionEvent) => void;
1148
1251
  }
1149
- /** Renders persisted Vercel-compatible data parts without subscribing to a live bridge. @experimental */
1150
- declare function VercelSurfaceSnapshotHost({ snapshots, registry, onAction, drafts, onDraftChange }: VercelSurfaceSnapshotHostProps): import("react").JSX.Element | null;
1151
- /** Consumes Vercel-compatible surface data parts with a controlled React surface renderer. @experimental */
1152
- declare function VercelSurfaceHost({ bridge, runId, registry }: VercelSurfaceHostProps): import("react").JSX.Element | null;
1252
+ /** Renders persisted UI spec snapshots through the json-render registry without a live bridge. @experimental */
1253
+ declare function VercelSurfaceSnapshotHost({ snapshots, onAction }: VercelSurfaceSnapshotHostProps): import("react").JSX.Element | null;
1254
+ /** Consumes WebSkill UI spec snapshots with a json-render surface renderer. @experimental */
1255
+ declare function VercelSurfaceHost({ bridge, runId }: VercelSurfaceHostProps): import("react").JSX.Element | null;
1153
1256
  //#endregion
1154
1257
  //#region src/react/ResultBlocksPro.d.ts
1155
- /** 可下载文件描述(file 块与 artifact 统一成该形状) */
1258
+ /** 可下载文件描述(file 块与 artifact 统一成该形状) @stable */
1156
1259
  interface DownloadableFile {
1157
1260
  path: string;
1158
1261
  /** 所属 run(artifact 存储路径 <chatRoot>/artifacts/<runId>/<path> 解析用) */
@@ -1160,6 +1263,7 @@ interface DownloadableFile {
1160
1263
  mimeType?: string;
1161
1264
  size?: number;
1162
1265
  }
1266
+ /** @stable */
1163
1267
  interface ResultBlocksProProps {
1164
1268
  bridge: ReactBridgeState;
1165
1269
  /** 只在所属 run 仍活动时展示;完成结果块由 ChatMessage 历史承接。 */
@@ -1167,7 +1271,7 @@ interface ResultBlocksProProps {
1167
1271
  /** 注入后 file 块 / artifact 渲染下载按钮(宿主负责读存储并触发浏览器下载) */
1168
1272
  onDownload?(file: DownloadableFile): void;
1169
1273
  }
1170
- /** 按 blocks 直接渲染的形态(历史消息结果块;当前 run 走 ResultBlocksPro 的 bridge 路径) */
1274
+ /** 按 blocks 直接渲染的形态(历史消息结果块;当前 run 走 ResultBlocksPro 的 bridge 路径) @stable */
1171
1275
  interface ResultBlockListProps {
1172
1276
  blocks: RenderBlock[];
1173
1277
  /** 所属 run(file 块下载路径解析用) */
@@ -1177,15 +1281,18 @@ interface ResultBlockListProps {
1177
1281
  /**
1178
1282
  * 结果块列表(AnimatePresence 逐块入场):markdown / json / table / chart / image / file。
1179
1283
  * 历史消息(ChatMessage.blocks)与当前 run(ResultBlocksPro)共用的渲染形态。
1284
+ * @stable
1180
1285
  */
1181
1286
  declare function ResultBlockList({ blocks, runId, onDownload }: ResultBlockListProps): import("react").JSX.Element;
1182
1287
  /**
1183
1288
  * run 完成结果块渐进挂载(AnimatePresence 逐块入场):
1184
1289
  * markdown / json / table / chart / image / file + artifact 下载卡。
1290
+ * @stable
1185
1291
  */
1186
1292
  declare function ResultBlocksPro({ bridge, activeRunId, onDownload }: ResultBlocksProProps): import("react").JSX.Element | null;
1187
1293
  //#endregion
1188
1294
  //#region src/react/InterruptedBanner.d.ts
1295
+ /** @stable */
1189
1296
  interface InterruptedBannerProps {
1190
1297
  engine: ChatEngine;
1191
1298
  /** 会话切换时重新检查(值变化即触发重新 listInterrupted) */
@@ -1194,10 +1301,12 @@ interface InterruptedBannerProps {
1194
1301
  /**
1195
1302
  * 未完成对话提示条:挂载/会话切换时检查 interrupted 快照,非空则顶部 banner
1196
1303
  * + Resume(engine.resume 后等待中的表单重新进入 bridge.pending)。
1304
+ * @stable
1197
1305
  */
1198
1306
  declare function InterruptedBanner({ engine, sessionId }: InterruptedBannerProps): import("react").JSX.Element | null;
1199
1307
  //#endregion
1200
1308
  //#region src/react/SettingsDrawer.d.ts
1309
+ /** @stable */
1201
1310
  interface SettingsDrawerProps {
1202
1311
  open: boolean;
1203
1312
  llmConfig: ChatbotHostAdapter['llmConfig'];
@@ -1216,17 +1325,18 @@ interface SettingsDrawerProps {
1216
1325
  onSaved(): void;
1217
1326
  onClose(): void;
1218
1327
  }
1219
- /** 设置抽屉:LLM 配置(三协议供应商 / 能力探测 / Demo model 标识 / 流式与 temperature)+ 外观(主题/语言) */
1328
+ /** 设置抽屉:LLM 配置(三协议供应商 / 能力探测 / Demo model 标识 / 流式与 temperature)+ 外观(主题/语言) @stable */
1220
1329
  declare function SettingsDrawer({ open, llmConfig, runtimeConfig, theme, locale, renderer, onAppearanceChange, onSaved, onClose }: SettingsDrawerProps): import("react").JSX.Element;
1221
1330
  //#endregion
1222
1331
  //#region src/react/ErrorCard.d.ts
1332
+ /** @stable */
1223
1333
  interface ErrorCardProps {
1224
1334
  /** 稳定错误码(WebSkillError.code / RUN_FAILED;缺省不渲染徽章) */
1225
1335
  code?: string;
1226
1336
  message: string;
1227
1337
  onDismiss?(): void;
1228
1338
  }
1229
- /** 结构化错误卡:错误码徽章 + 描述 + 建议(engine error 事件 / 失败 run) */
1339
+ /** 结构化错误卡:错误码徽章 + 描述 + 建议(engine error 事件 / 失败 run) @stable */
1230
1340
  declare function ErrorCard({ code, message, onDismiss }: ErrorCardProps): import("react").JSX.Element;
1231
1341
  //#endregion
1232
- export { A2uiSurfaceHost, type A2uiSurfaceHostProps, A2uiSurfaceSnapshotHost, type A2uiSurfaceSnapshotHostProps, type AppearanceChange, type ChatAttachmentInput, type ChatAttachmentMeta, ChatEngine, type ChatEngineOptions, type ChatEvent, type ChatLayout, type ChatMessage, type ChatSessionMeta, type ChatTheme, type ChatToolCall, Chatbot, type ChatbotConfig, type ChatbotHostAdapter, type ChatbotProps, CompositeUiBridge, type CompositeUiBridgeDeps, type DownloadableFile, ErrorCard, type ErrorCardProps, InteractionCard, type InteractionCardProps, InterruptedBanner, type InterruptedBannerProps, type LlmConfig, type Locale, OpenUiChannel, OpenUiInteraction, type OpenUiInteractionProps, type OpenUiSession, OpenUiSurfaceHost, type OpenUiSurfaceHostProps, OpenUiSurfaceSnapshotHost, type OpenUiSurfaceSnapshotHostProps, type RendererKind, type ResolvedChatLayout, ResultBlockList, type ResultBlockListProps, ResultBlocksPro, type ResultBlocksProProps, type RunSnapshot, type RunTraceFile, type SandboxExecutorDeps, SettingsDrawer, type SettingsDrawerProps, SkillBadges, VercelPayloadPreview, type VercelPayloadPreviewProps, VercelSurfaceHost, type VercelSurfaceHostProps, VercelSurfaceSnapshotHost, type VercelSurfaceSnapshotHostProps, chatbotDictionary, configureA2uiMarkdown, probeA2uiAvailability, probeOpenUiAvailability, useT, writeRunTrace };
1342
+ export { A2uiSurfaceHost, type A2uiSurfaceHostProps, A2uiSurfaceSnapshotHost, type A2uiSurfaceSnapshotHostProps, type AppearanceChange, type ChatAttachmentInput, type ChatAttachmentMeta, ChatEngine, type ChatEngineOptions, type ChatEvent, type ChatLayout, type ChatMessage, type ChatSessionMeta, type ChatTheme, type ChatToolCall, Chatbot, type ChatbotConfig, type ChatbotGovernancePorts, type ChatbotHostAdapter, type ChatbotProps, CompositeUiBridge, type CompositeUiBridgeDeps, DEFAULT_RENDERER_CAPABILITIES, type DownloadableFile, ErrorCard, type ErrorCardProps, InteractionCard, type InteractionCardProps, InterruptedBanner, type InterruptedBannerProps, type LlmConfig, type Locale, OpenUiSurfaceHost, type OpenUiSurfaceHostProps, OpenUiSurfaceSnapshotHost, type OpenUiSurfaceSnapshotHostProps, type RendererCapability, type RendererKind, type ResolvedChatLayout, ResultBlockList, type ResultBlockListProps, ResultBlocksPro, type ResultBlocksProProps, type RunSnapshot, type SandboxExecutorDeps, SettingsDrawer, type SettingsDrawerProps, SkillBadges, SpecInteraction, type SpecInteractionProps, VercelPayloadPreview, type VercelPayloadPreviewProps, VercelSurfaceHost, type VercelSurfaceHostProps, VercelSurfaceSnapshotHost, type VercelSurfaceSnapshotHostProps, chatbotDictionary, configureA2uiMarkdown, probeA2uiAvailability, probeOpenUiAvailability, useT };