@webskill/chatbot 0.3.0 → 0.5.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,7 +1,7 @@
1
- import { AgentLoopConfig, ApprovalScope, BridgeCapabilities, ExternalSkillProvider, ExternalToolSource, FileSystemProvider, HookRunner, InteractionRequest, InteractionResponse, LifecycleEventInit, LlmClient, NetworkPolicy, Page, PageQuery, RenderBlock, RenderResultRequest, RunSnapshot, RunSnapshotListEntry, RuntimePhase, ScriptExecutor, SessionStore, SkillCatalogEntry, SkillIntegrityGuard, SkillOutcomeReporter, SkillStateGuard, UiBridge, UiSpecDrafts, UiSpecEvent, UiSpecSnapshot, UiSurfaceActionRequest, UiSurfaceActionResponse, UserProfile, UserProfileEntry, UserProfileExport, WebSkillErrorCode, diffUserProfile } from "@webskill/sdk";
1
+ import { AgentLoopConfig, ApprovalScope, BridgeCapabilities, ExternalSkillProvider, ExternalToolSource, FileSystemProvider, HookRunner, InteractionRequest, InteractionResponse, LifecycleEventInit, LlmClient, NetworkPolicy, Page, PageQuery, RenderBlock, RenderResultRequest, RunSnapshot, RunSnapshotListEntry, RuntimePhase, RuntimeRun, ScriptExecutor, SessionStore, SkillCandidateMarker, SkillCatalogEntry, SkillIntegrityGuard, SkillOutcomeReporter, SkillStateGuard, UiBridge, UiSpecDrafts, UiSpecEvent, UiSpecSnapshot, UiSurfaceActionRequest, UiSurfaceActionResponse, UserProfile, UserProfileExport, WebSkillErrorCode, diffUserProfile } from "@webskill/sdk";
2
2
  import { SandboxMode, TypeScriptSupportOptions } from "@webskill/sdk/browser";
3
3
  import { CustomSurfaceActionEvent, ReactBridgeState, SpecInteractionChannel, SurfaceRegistry, UiSurfaceActionEvent } from "@webskill/sdk/ui-react";
4
- import { PagePerceptionPolicy, PerceptionRecord, SkillCandidateSink, TodoItem } from "@webskill/sdk/agent";
4
+ import { PageActionPolicy, PagePerceptionPolicy, PerceptionRecord, SkillCandidateSink, TodoItem } from "@webskill/sdk/agent";
5
5
  import "react";
6
6
  import "react/jsx-runtime";
7
7
  //#region ../ui-kit/src/i18n/types.d.ts
@@ -290,6 +290,18 @@ interface ChatbotGovernancePorts {
290
290
  skillOutcomeReporter?: SkillOutcomeReporter;
291
291
  /** `SkillStatePolicy.catalogFilter()`:非 active 技能不进路由候选集 */
292
292
  catalogFilter?: (entries: SkillCatalogEntry[]) => SkillCatalogEntry[] | Promise<SkillCatalogEntry[]>;
293
+ /**
294
+ * run 未激活任何技能时的钩子(如 `createMissHook`)。
295
+ *
296
+ * 开关存在 `GovernanceFacade.missHook`(属 console),chatbot 读不到也不该依赖它;
297
+ * 所以读开关是**宿主**的责任。宿主应传一个**每次触发时才读开关**的闭包,
298
+ * 而不是装配时把布尔值算好——`#assemble()` 不是每次 run 都跑,
299
+ * 算好了会导致「开着启动 → 中途关闭」不生效(AC-17.11)。
300
+ */
301
+ onSkillMiss?: (input: {
302
+ prompt: string;
303
+ run: RuntimeRun;
304
+ }) => Promise<void>;
293
305
  }
294
306
  /** 分配式交叉:直接写 `信封 & LifecycleEventInit` 会把联合压成一个对象,`phase` 的判别性就没了 */
295
307
  type WithChatMeta<T> = T extends unknown ? {
@@ -365,7 +377,11 @@ interface ChatInteractionRecord {
365
377
  interface ChatMessage {
366
378
  id: string;
367
379
  role: 'user' | 'assistant';
368
- text: string;
380
+ /**
381
+ * 消息正文。本 run 一个字也没产出时(例如模型开口前就被中止)**缺省**,
382
+ * 与「产出了空串」区分开——写空串会渲染出一个空白气泡(FR-20.4)。
383
+ */
384
+ text?: string;
369
385
  ts: string;
370
386
  /** user 消息携带的附件(旧会话文件无该字段) */
371
387
  attachments?: ChatAttachmentMeta[];
@@ -413,6 +429,12 @@ interface ChatMessage {
413
429
  * @experimental
414
430
  */
415
431
  interactions?: ChatInteractionRecord[];
432
+ /**
433
+ * 该轮提交的技能候选(FR-24.1)。数据来自 `$skillCandidate` 载荷,
434
+ * 不从模型复述的自然语言里解析。
435
+ * @experimental
436
+ */
437
+ candidates?: SkillCandidateMarker[];
416
438
  }
417
439
  /** @stable */
418
440
  interface ChatSessionMeta {
@@ -579,6 +601,8 @@ interface ChatbotHostAdapter {
579
601
  openConsole(): void;
580
602
  /** 跳 console Traces 面板并定位该 run(v1.1;缺省时消息不渲染 View trace 入口) */
581
603
  openConsoleTrace?(runId: string): void;
604
+ /** 打开治理面的审批队列并定位该候选(FR-24.2);宿主未接治理面时不提供,入口随之不渲染 */
605
+ openConsoleCandidate?(candidateId: string): void;
582
606
  };
583
607
  /** 缺省 BrowserWorkerScriptExecutor(@webskill/browser);Node 宿主可注入自己的执行器 */
584
608
  executor?: ScriptExecutor;
@@ -589,6 +613,13 @@ interface ChatbotHostAdapter {
589
613
  * @experimental
590
614
  */
591
615
  pagePerception?: PagePerceptionPolicy;
616
+ /**
617
+ * 页面操作能力(需求 23)。**不注入即完全关闭**,与 `pagePerception` 分开:
618
+ * 可读不等于可操作。同样只能在这里注入——给终端用户一个「打开代操作」的开关
619
+ * 等于把安全边界交给最不了解它的人。
620
+ * @experimental
621
+ */
622
+ pageActions?: PageActionPolicy;
592
623
  }
593
624
  //#endregion
594
625
  //#region src/core/chatEngine.d.ts
@@ -603,6 +634,20 @@ interface SandboxExecutorDeps {
603
634
  /** 缺省时 `.ts` 脚本按 `TOOL_UNSUPPORTED` 拒绝 */
604
635
  typescript?: TypeScriptSupportOptions;
605
636
  }
637
+ /**
638
+ * 装配时(而非执行时)把 `sandbox.typescript` 转成执行器参数,让配置错误早暴露。
639
+ * 只对绝对 URL 走 `RemoteUrlPolicy`:同源相对路径与打包器 specifier 不是出站请求。
640
+ */
641
+ /**
642
+ * 由 `RuntimeConfig` 装出沙箱执行器依赖。
643
+ *
644
+ * 主链路与**评估链路**共用这一处(T-17-H):此前评估侧只传 `fs`,
645
+ * 于是评估里跑的技能不受沙箱、网络策略、能力与授权范围约束——
646
+ * 那比「.ts 跑不了」严重得多(设计 17 §1.1a)。
647
+ *
648
+ * @experimental
649
+ */
650
+ declare function sandboxExecutorDeps(fs: FileSystemProvider, rc?: RuntimeConfig, uiBridge?: SandboxExecutorDeps['uiBridge']): SandboxExecutorDeps;
606
651
  /** @stable */
607
652
  interface ChatEngineOptions {
608
653
  llm?: LlmClient;
@@ -824,6 +869,12 @@ interface CompositeUiBridgeDeps {
824
869
  * @experimental
825
870
  */
826
871
  onResolved?(request: InteractionRequest, response: InteractionResponse): void;
872
+ /**
873
+ * 工具返回值里的技能候选(FR-24.1)。它不经任何渲染层,
874
+ * 直接给引擎收集到本 run 的终态消息上。
875
+ * @experimental
876
+ */
877
+ onSkillCandidate?(runId: string, candidate: SkillCandidateMarker): void;
827
878
  emit(event: ChatEvent): void;
828
879
  }
829
880
  /**
@@ -849,6 +900,7 @@ declare class CompositeUiBridge implements UiBridge {
849
900
  requestSurfaceAction(input: UiSurfaceActionRequest): Promise<UiSurfaceActionResponse>;
850
901
  cancelSurfaceAction(nonce: string): void;
851
902
  onTextDelta(runId: string, delta: string): Promise<void>;
903
+ onSkillCandidate(runId: string, candidate: SkillCandidateMarker): void;
852
904
  }
853
905
  //#endregion
854
906
  //#region src/i18n.d.ts
@@ -869,6 +921,7 @@ declare const chatbotDictionary: {
869
921
  'session.title': string;
870
922
  'session.new': string;
871
923
  'session.searchPlaceholder': string;
924
+ 'session.searchClear': string;
872
925
  'session.empty': string;
873
926
  'session.missingRoot': string;
874
927
  'session.skipped': string;
@@ -907,8 +960,17 @@ declare const chatbotDictionary: {
907
960
  'message.copied': string;
908
961
  'message.retry': string;
909
962
  'message.delete': string;
963
+ 'message.deleted.title': string;
964
+ 'message.deleted.description': string;
910
965
  'message.viewTrace': string;
911
966
  'message.skillsUsed': string;
967
+ 'message.edit': string;
968
+ 'message.editSend': string;
969
+ 'message.editCancel': string;
970
+ 'capability.tools.on': string;
971
+ 'capability.tools.off': string;
972
+ 'capability.images.on': string;
973
+ 'capability.images.off': string;
912
974
  'tool.summary.one': string;
913
975
  'tool.summary.other': string;
914
976
  'tool.status.running': string;
@@ -927,6 +989,13 @@ declare const chatbotDictionary: {
927
989
  'cot.reasoning': string;
928
990
  'cot.working': string;
929
991
  'trace.title': string;
992
+ 'trace.runId': string;
993
+ 'trace.runId.copy': string;
994
+ 'trace.runId.copied': string;
995
+ 'candidate.submitted': string;
996
+ 'candidate.id.copy': string;
997
+ 'candidate.id.copied': string;
998
+ 'candidate.review': string;
930
999
  'trace.skill': string;
931
1000
  'perception.reading': string;
932
1001
  'perception.excluded': string;
@@ -939,6 +1008,14 @@ declare const chatbotDictionary: {
939
1008
  'trace.phase.interact': string;
940
1009
  'trace.phase.complete': string;
941
1010
  'trace.phase.fail': string;
1011
+ 'run.terminated.userCancelled': string;
1012
+ 'run.terminated.maxTurns': string;
1013
+ 'run.terminated.timeout': string;
1014
+ 'run.terminated.llmError': string;
1015
+ 'run.terminated.interactionTimeout': string;
1016
+ 'run.terminated.hookError': string;
1017
+ 'run.terminated.toolResolutionExhausted': string;
1018
+ 'run.terminated.unknown': string;
942
1019
  'todo.title': string;
943
1020
  'todo.progress': string;
944
1021
  'todo.status.pending': string;
@@ -957,6 +1034,12 @@ declare const chatbotDictionary: {
957
1034
  'interaction.authorize.description': string;
958
1035
  'interaction.authorize.capability': string;
959
1036
  'interaction.authorize.details': string;
1037
+ 'interaction.pageAction.click': string;
1038
+ 'interaction.pageAction.fill': string;
1039
+ 'interaction.pageAction.submit': string;
1040
+ 'interaction.pageAction.role.click': string;
1041
+ 'interaction.pageAction.role.fill': string;
1042
+ 'interaction.pageAction.role.submit': string;
960
1043
  'interaction.origin': string;
961
1044
  'interaction.submitted': string;
962
1045
  'interaction.submit': string;
@@ -965,6 +1048,10 @@ declare const chatbotDictionary: {
965
1048
  'interaction.allow': string;
966
1049
  'interaction.deny': string;
967
1050
  'interaction.required': string;
1051
+ 'surface.addItem': string;
1052
+ 'surface.removeItem': string;
1053
+ 'surface.arrayFirstItemOnly': string;
1054
+ 'surface.readOnlySnapshot': string;
968
1055
  'interaction.wait': string;
969
1056
  'interaction.wait.inPanel': string;
970
1057
  'interaction.wait.fallback': string;
@@ -996,8 +1083,7 @@ declare const chatbotDictionary: {
996
1083
  'composer.attachment.compressed': string;
997
1084
  'composer.model': string;
998
1085
  'composer.model.demo': string;
999
- 'composer.plainChatOnly': string;
1000
- 'composer.menu': string;
1086
+ 'capability.group': string;
1001
1087
  'composer.pageCapture': string;
1002
1088
  'composer.pageCapture.disabled.setting': string;
1003
1089
  'composer.pageCapture.disabled.model': string;
@@ -1070,10 +1156,18 @@ declare const chatbotDictionary: {
1070
1156
  'settings.agent.todoNote': string;
1071
1157
  'settings.agent.generativeUi': string;
1072
1158
  'settings.agent.generativeUiNote': string;
1159
+ 'settings.agent.generativeUiUnaffected': string;
1073
1160
  'settings.agent.skillGeneration': string;
1074
1161
  'settings.agent.skillGenerationNote': string;
1075
1162
  'settings.agent.delegation': string;
1076
1163
  'settings.agent.delegationNote': string;
1164
+ 'settings.agent.limits': string;
1165
+ 'settings.agent.limitsNote': string;
1166
+ 'settings.agent.totalTimeout': string;
1167
+ 'settings.agent.maxTurns': string;
1168
+ 'settings.agent.toolTimeout': string;
1169
+ 'settings.agent.limits.invalid': string;
1170
+ 'settings.agent.limits.reset': string;
1077
1171
  'settings.privacy.enabled': string;
1078
1172
  'settings.privacy.enabledRisk': string;
1079
1173
  'settings.privacy.encrypted': string;
@@ -1122,6 +1216,7 @@ declare const chatbotDictionary: {
1122
1216
  'vercel.preview.badge': string;
1123
1217
  'vercel.preview.description': string;
1124
1218
  'surface.legacy.placeholder': string;
1219
+ 'a11y.messageActions': string;
1125
1220
  'error.title': string;
1126
1221
  'error.suggestion': string;
1127
1222
  'error.suggestion.LLM_UNAVAILABLE': string;
@@ -1130,6 +1225,10 @@ declare const chatbotDictionary: {
1130
1225
  'error.suggestion.RUN_INTERACTION_TIMEOUT': string;
1131
1226
  'error.suggestion.RUN_MAX_TURNS_EXCEEDED': string;
1132
1227
  'error.suggestion.TOOL_RESOLUTION_EXHAUSTED': string;
1228
+ 'error.limit.totalTimeoutMs': string;
1229
+ 'error.limit.maxTurns': string;
1230
+ 'error.message.RUN_CANCELLED': string;
1231
+ 'error.openSettings': string;
1133
1232
  'error.dismiss': string;
1134
1233
  };
1135
1234
  zh: {
@@ -1142,6 +1241,7 @@ declare const chatbotDictionary: {
1142
1241
  'session.title': string;
1143
1242
  'session.new': string;
1144
1243
  'session.searchPlaceholder': string;
1244
+ 'session.searchClear': string;
1145
1245
  'session.empty': string;
1146
1246
  'session.missingRoot': string;
1147
1247
  'session.skipped': string;
@@ -1178,10 +1278,19 @@ declare const chatbotDictionary: {
1178
1278
  'welcome.prompt.4': string;
1179
1279
  'message.copy': string;
1180
1280
  'message.copied': string;
1281
+ 'message.edit': string;
1282
+ 'message.editSend': string;
1283
+ 'message.editCancel': string;
1181
1284
  'message.retry': string;
1182
1285
  'message.delete': string;
1286
+ 'message.deleted.title': string;
1287
+ 'message.deleted.description': string;
1183
1288
  'message.viewTrace': string;
1184
1289
  'message.skillsUsed': string;
1290
+ 'capability.tools.on': string;
1291
+ 'capability.tools.off': string;
1292
+ 'capability.images.on': string;
1293
+ 'capability.images.off': string;
1185
1294
  'tool.summary.one': string;
1186
1295
  'tool.summary.other': string;
1187
1296
  'tool.status.running': string;
@@ -1200,6 +1309,13 @@ declare const chatbotDictionary: {
1200
1309
  'cot.reasoning': string;
1201
1310
  'cot.working': string;
1202
1311
  'trace.title': string;
1312
+ 'trace.runId': string;
1313
+ 'trace.runId.copy': string;
1314
+ 'trace.runId.copied': string;
1315
+ 'candidate.submitted': string;
1316
+ 'candidate.id.copy': string;
1317
+ 'candidate.id.copied': string;
1318
+ 'candidate.review': string;
1203
1319
  'trace.skill': string;
1204
1320
  'perception.reading': string;
1205
1321
  'perception.excluded': string;
@@ -1212,6 +1328,14 @@ declare const chatbotDictionary: {
1212
1328
  'trace.phase.interact': string;
1213
1329
  'trace.phase.complete': string;
1214
1330
  'trace.phase.fail': string;
1331
+ 'run.terminated.userCancelled': string;
1332
+ 'run.terminated.maxTurns': string;
1333
+ 'run.terminated.timeout': string;
1334
+ 'run.terminated.llmError': string;
1335
+ 'run.terminated.interactionTimeout': string;
1336
+ 'run.terminated.hookError': string;
1337
+ 'run.terminated.toolResolutionExhausted': string;
1338
+ 'run.terminated.unknown': string;
1215
1339
  'todo.title': string;
1216
1340
  'todo.progress': string;
1217
1341
  'todo.status.pending': string;
@@ -1230,6 +1354,12 @@ declare const chatbotDictionary: {
1230
1354
  'interaction.authorize.description': string;
1231
1355
  'interaction.authorize.capability': string;
1232
1356
  'interaction.authorize.details': string;
1357
+ 'interaction.pageAction.click': string;
1358
+ 'interaction.pageAction.fill': string;
1359
+ 'interaction.pageAction.submit': string;
1360
+ 'interaction.pageAction.role.click': string;
1361
+ 'interaction.pageAction.role.fill': string;
1362
+ 'interaction.pageAction.role.submit': string;
1233
1363
  'interaction.origin': string;
1234
1364
  'interaction.submitted': string;
1235
1365
  'interaction.submit': string;
@@ -1238,6 +1368,10 @@ declare const chatbotDictionary: {
1238
1368
  'interaction.allow': string;
1239
1369
  'interaction.deny': string;
1240
1370
  'interaction.required': string;
1371
+ 'surface.addItem': string;
1372
+ 'surface.removeItem': string;
1373
+ 'surface.arrayFirstItemOnly': string;
1374
+ 'surface.readOnlySnapshot': string;
1241
1375
  'interaction.wait': string;
1242
1376
  'interaction.wait.inPanel': string;
1243
1377
  'interaction.wait.fallback': string;
@@ -1269,8 +1403,7 @@ declare const chatbotDictionary: {
1269
1403
  'composer.attachment.compressed': string;
1270
1404
  'composer.model': string;
1271
1405
  'composer.model.demo': string;
1272
- 'composer.plainChatOnly': string;
1273
- 'composer.menu': string;
1406
+ 'capability.group': string;
1274
1407
  'composer.pageCapture': string;
1275
1408
  'composer.pageCapture.disabled.setting': string;
1276
1409
  'composer.pageCapture.disabled.model': string;
@@ -1343,10 +1476,18 @@ declare const chatbotDictionary: {
1343
1476
  'settings.agent.todoNote': string;
1344
1477
  'settings.agent.generativeUi': string;
1345
1478
  'settings.agent.generativeUiNote': string;
1479
+ 'settings.agent.generativeUiUnaffected': string;
1346
1480
  'settings.agent.skillGeneration': string;
1347
1481
  'settings.agent.skillGenerationNote': string;
1348
1482
  'settings.agent.delegation': string;
1349
1483
  'settings.agent.delegationNote': string;
1484
+ 'settings.agent.limits': string;
1485
+ 'settings.agent.limitsNote': string;
1486
+ 'settings.agent.totalTimeout': string;
1487
+ 'settings.agent.maxTurns': string;
1488
+ 'settings.agent.toolTimeout': string;
1489
+ 'settings.agent.limits.invalid': string;
1490
+ 'settings.agent.limits.reset': string;
1350
1491
  'settings.privacy.enabled': string;
1351
1492
  'settings.privacy.enabledRisk': string;
1352
1493
  'settings.privacy.encrypted': string;
@@ -1395,6 +1536,7 @@ declare const chatbotDictionary: {
1395
1536
  'vercel.preview.badge': string;
1396
1537
  'vercel.preview.description': string;
1397
1538
  'surface.legacy.placeholder': string;
1539
+ 'a11y.messageActions': string;
1398
1540
  'error.title': string;
1399
1541
  'error.suggestion': string;
1400
1542
  'error.suggestion.LLM_UNAVAILABLE': string;
@@ -1403,6 +1545,10 @@ declare const chatbotDictionary: {
1403
1545
  'error.suggestion.RUN_INTERACTION_TIMEOUT': string;
1404
1546
  'error.suggestion.RUN_MAX_TURNS_EXCEEDED': string;
1405
1547
  'error.suggestion.TOOL_RESOLUTION_EXHAUSTED': string;
1548
+ 'error.limit.totalTimeoutMs': string;
1549
+ 'error.limit.maxTurns': string;
1550
+ 'error.message.RUN_CANCELLED': string;
1551
+ 'error.openSettings': string;
1406
1552
  'error.dismiss': string;
1407
1553
  };
1408
1554
  };
@@ -1418,6 +1564,7 @@ declare const useT: () => TranslateFn<{
1418
1564
  'session.title': string;
1419
1565
  'session.new': string;
1420
1566
  'session.searchPlaceholder': string;
1567
+ 'session.searchClear': string;
1421
1568
  'session.empty': string;
1422
1569
  'session.missingRoot': string;
1423
1570
  'session.skipped': string;
@@ -1456,8 +1603,17 @@ declare const useT: () => TranslateFn<{
1456
1603
  'message.copied': string;
1457
1604
  'message.retry': string;
1458
1605
  'message.delete': string;
1606
+ 'message.deleted.title': string;
1607
+ 'message.deleted.description': string;
1459
1608
  'message.viewTrace': string;
1460
1609
  'message.skillsUsed': string;
1610
+ 'message.edit': string;
1611
+ 'message.editSend': string;
1612
+ 'message.editCancel': string;
1613
+ 'capability.tools.on': string;
1614
+ 'capability.tools.off': string;
1615
+ 'capability.images.on': string;
1616
+ 'capability.images.off': string;
1461
1617
  'tool.summary.one': string;
1462
1618
  'tool.summary.other': string;
1463
1619
  'tool.status.running': string;
@@ -1476,6 +1632,13 @@ declare const useT: () => TranslateFn<{
1476
1632
  'cot.reasoning': string;
1477
1633
  'cot.working': string;
1478
1634
  'trace.title': string;
1635
+ 'trace.runId': string;
1636
+ 'trace.runId.copy': string;
1637
+ 'trace.runId.copied': string;
1638
+ 'candidate.submitted': string;
1639
+ 'candidate.id.copy': string;
1640
+ 'candidate.id.copied': string;
1641
+ 'candidate.review': string;
1479
1642
  'trace.skill': string;
1480
1643
  'perception.reading': string;
1481
1644
  'perception.excluded': string;
@@ -1488,6 +1651,14 @@ declare const useT: () => TranslateFn<{
1488
1651
  'trace.phase.interact': string;
1489
1652
  'trace.phase.complete': string;
1490
1653
  'trace.phase.fail': string;
1654
+ 'run.terminated.userCancelled': string;
1655
+ 'run.terminated.maxTurns': string;
1656
+ 'run.terminated.timeout': string;
1657
+ 'run.terminated.llmError': string;
1658
+ 'run.terminated.interactionTimeout': string;
1659
+ 'run.terminated.hookError': string;
1660
+ 'run.terminated.toolResolutionExhausted': string;
1661
+ 'run.terminated.unknown': string;
1491
1662
  'todo.title': string;
1492
1663
  'todo.progress': string;
1493
1664
  'todo.status.pending': string;
@@ -1506,6 +1677,12 @@ declare const useT: () => TranslateFn<{
1506
1677
  'interaction.authorize.description': string;
1507
1678
  'interaction.authorize.capability': string;
1508
1679
  'interaction.authorize.details': string;
1680
+ 'interaction.pageAction.click': string;
1681
+ 'interaction.pageAction.fill': string;
1682
+ 'interaction.pageAction.submit': string;
1683
+ 'interaction.pageAction.role.click': string;
1684
+ 'interaction.pageAction.role.fill': string;
1685
+ 'interaction.pageAction.role.submit': string;
1509
1686
  'interaction.origin': string;
1510
1687
  'interaction.submitted': string;
1511
1688
  'interaction.submit': string;
@@ -1514,6 +1691,10 @@ declare const useT: () => TranslateFn<{
1514
1691
  'interaction.allow': string;
1515
1692
  'interaction.deny': string;
1516
1693
  'interaction.required': string;
1694
+ 'surface.addItem': string;
1695
+ 'surface.removeItem': string;
1696
+ 'surface.arrayFirstItemOnly': string;
1697
+ 'surface.readOnlySnapshot': string;
1517
1698
  'interaction.wait': string;
1518
1699
  'interaction.wait.inPanel': string;
1519
1700
  'interaction.wait.fallback': string;
@@ -1545,8 +1726,7 @@ declare const useT: () => TranslateFn<{
1545
1726
  'composer.attachment.compressed': string;
1546
1727
  'composer.model': string;
1547
1728
  'composer.model.demo': string;
1548
- 'composer.plainChatOnly': string;
1549
- 'composer.menu': string;
1729
+ 'capability.group': string;
1550
1730
  'composer.pageCapture': string;
1551
1731
  'composer.pageCapture.disabled.setting': string;
1552
1732
  'composer.pageCapture.disabled.model': string;
@@ -1619,10 +1799,18 @@ declare const useT: () => TranslateFn<{
1619
1799
  'settings.agent.todoNote': string;
1620
1800
  'settings.agent.generativeUi': string;
1621
1801
  'settings.agent.generativeUiNote': string;
1802
+ 'settings.agent.generativeUiUnaffected': string;
1622
1803
  'settings.agent.skillGeneration': string;
1623
1804
  'settings.agent.skillGenerationNote': string;
1624
1805
  'settings.agent.delegation': string;
1625
1806
  'settings.agent.delegationNote': string;
1807
+ 'settings.agent.limits': string;
1808
+ 'settings.agent.limitsNote': string;
1809
+ 'settings.agent.totalTimeout': string;
1810
+ 'settings.agent.maxTurns': string;
1811
+ 'settings.agent.toolTimeout': string;
1812
+ 'settings.agent.limits.invalid': string;
1813
+ 'settings.agent.limits.reset': string;
1626
1814
  'settings.privacy.enabled': string;
1627
1815
  'settings.privacy.enabledRisk': string;
1628
1816
  'settings.privacy.encrypted': string;
@@ -1671,6 +1859,7 @@ declare const useT: () => TranslateFn<{
1671
1859
  'vercel.preview.badge': string;
1672
1860
  'vercel.preview.description': string;
1673
1861
  'surface.legacy.placeholder': string;
1862
+ 'a11y.messageActions': string;
1674
1863
  'error.title': string;
1675
1864
  'error.suggestion': string;
1676
1865
  'error.suggestion.LLM_UNAVAILABLE': string;
@@ -1679,6 +1868,10 @@ declare const useT: () => TranslateFn<{
1679
1868
  'error.suggestion.RUN_INTERACTION_TIMEOUT': string;
1680
1869
  'error.suggestion.RUN_MAX_TURNS_EXCEEDED': string;
1681
1870
  'error.suggestion.TOOL_RESOLUTION_EXHAUSTED': string;
1871
+ 'error.limit.totalTimeoutMs': string;
1872
+ 'error.limit.maxTurns': string;
1873
+ 'error.message.RUN_CANCELLED': string;
1874
+ 'error.openSettings': string;
1682
1875
  'error.dismiss': string;
1683
1876
  };
1684
1877
  zh: {
@@ -1691,6 +1884,7 @@ declare const useT: () => TranslateFn<{
1691
1884
  'session.title': string;
1692
1885
  'session.new': string;
1693
1886
  'session.searchPlaceholder': string;
1887
+ 'session.searchClear': string;
1694
1888
  'session.empty': string;
1695
1889
  'session.missingRoot': string;
1696
1890
  'session.skipped': string;
@@ -1727,10 +1921,19 @@ declare const useT: () => TranslateFn<{
1727
1921
  'welcome.prompt.4': string;
1728
1922
  'message.copy': string;
1729
1923
  'message.copied': string;
1924
+ 'message.edit': string;
1925
+ 'message.editSend': string;
1926
+ 'message.editCancel': string;
1730
1927
  'message.retry': string;
1731
1928
  'message.delete': string;
1929
+ 'message.deleted.title': string;
1930
+ 'message.deleted.description': string;
1732
1931
  'message.viewTrace': string;
1733
1932
  'message.skillsUsed': string;
1933
+ 'capability.tools.on': string;
1934
+ 'capability.tools.off': string;
1935
+ 'capability.images.on': string;
1936
+ 'capability.images.off': string;
1734
1937
  'tool.summary.one': string;
1735
1938
  'tool.summary.other': string;
1736
1939
  'tool.status.running': string;
@@ -1749,6 +1952,13 @@ declare const useT: () => TranslateFn<{
1749
1952
  'cot.reasoning': string;
1750
1953
  'cot.working': string;
1751
1954
  'trace.title': string;
1955
+ 'trace.runId': string;
1956
+ 'trace.runId.copy': string;
1957
+ 'trace.runId.copied': string;
1958
+ 'candidate.submitted': string;
1959
+ 'candidate.id.copy': string;
1960
+ 'candidate.id.copied': string;
1961
+ 'candidate.review': string;
1752
1962
  'trace.skill': string;
1753
1963
  'perception.reading': string;
1754
1964
  'perception.excluded': string;
@@ -1761,6 +1971,14 @@ declare const useT: () => TranslateFn<{
1761
1971
  'trace.phase.interact': string;
1762
1972
  'trace.phase.complete': string;
1763
1973
  'trace.phase.fail': string;
1974
+ 'run.terminated.userCancelled': string;
1975
+ 'run.terminated.maxTurns': string;
1976
+ 'run.terminated.timeout': string;
1977
+ 'run.terminated.llmError': string;
1978
+ 'run.terminated.interactionTimeout': string;
1979
+ 'run.terminated.hookError': string;
1980
+ 'run.terminated.toolResolutionExhausted': string;
1981
+ 'run.terminated.unknown': string;
1764
1982
  'todo.title': string;
1765
1983
  'todo.progress': string;
1766
1984
  'todo.status.pending': string;
@@ -1779,6 +1997,12 @@ declare const useT: () => TranslateFn<{
1779
1997
  'interaction.authorize.description': string;
1780
1998
  'interaction.authorize.capability': string;
1781
1999
  'interaction.authorize.details': string;
2000
+ 'interaction.pageAction.click': string;
2001
+ 'interaction.pageAction.fill': string;
2002
+ 'interaction.pageAction.submit': string;
2003
+ 'interaction.pageAction.role.click': string;
2004
+ 'interaction.pageAction.role.fill': string;
2005
+ 'interaction.pageAction.role.submit': string;
1782
2006
  'interaction.origin': string;
1783
2007
  'interaction.submitted': string;
1784
2008
  'interaction.submit': string;
@@ -1787,6 +2011,10 @@ declare const useT: () => TranslateFn<{
1787
2011
  'interaction.allow': string;
1788
2012
  'interaction.deny': string;
1789
2013
  'interaction.required': string;
2014
+ 'surface.addItem': string;
2015
+ 'surface.removeItem': string;
2016
+ 'surface.arrayFirstItemOnly': string;
2017
+ 'surface.readOnlySnapshot': string;
1790
2018
  'interaction.wait': string;
1791
2019
  'interaction.wait.inPanel': string;
1792
2020
  'interaction.wait.fallback': string;
@@ -1818,8 +2046,7 @@ declare const useT: () => TranslateFn<{
1818
2046
  'composer.attachment.compressed': string;
1819
2047
  'composer.model': string;
1820
2048
  'composer.model.demo': string;
1821
- 'composer.plainChatOnly': string;
1822
- 'composer.menu': string;
2049
+ 'capability.group': string;
1823
2050
  'composer.pageCapture': string;
1824
2051
  'composer.pageCapture.disabled.setting': string;
1825
2052
  'composer.pageCapture.disabled.model': string;
@@ -1892,10 +2119,18 @@ declare const useT: () => TranslateFn<{
1892
2119
  'settings.agent.todoNote': string;
1893
2120
  'settings.agent.generativeUi': string;
1894
2121
  'settings.agent.generativeUiNote': string;
2122
+ 'settings.agent.generativeUiUnaffected': string;
1895
2123
  'settings.agent.skillGeneration': string;
1896
2124
  'settings.agent.skillGenerationNote': string;
1897
2125
  'settings.agent.delegation': string;
1898
2126
  'settings.agent.delegationNote': string;
2127
+ 'settings.agent.limits': string;
2128
+ 'settings.agent.limitsNote': string;
2129
+ 'settings.agent.totalTimeout': string;
2130
+ 'settings.agent.maxTurns': string;
2131
+ 'settings.agent.toolTimeout': string;
2132
+ 'settings.agent.limits.invalid': string;
2133
+ 'settings.agent.limits.reset': string;
1899
2134
  'settings.privacy.enabled': string;
1900
2135
  'settings.privacy.enabledRisk': string;
1901
2136
  'settings.privacy.encrypted': string;
@@ -1944,6 +2179,7 @@ declare const useT: () => TranslateFn<{
1944
2179
  'vercel.preview.badge': string;
1945
2180
  'vercel.preview.description': string;
1946
2181
  'surface.legacy.placeholder': string;
2182
+ 'a11y.messageActions': string;
1947
2183
  'error.title': string;
1948
2184
  'error.suggestion': string;
1949
2185
  'error.suggestion.LLM_UNAVAILABLE': string;
@@ -1952,6 +2188,10 @@ declare const useT: () => TranslateFn<{
1952
2188
  'error.suggestion.RUN_INTERACTION_TIMEOUT': string;
1953
2189
  'error.suggestion.RUN_MAX_TURNS_EXCEEDED': string;
1954
2190
  'error.suggestion.TOOL_RESOLUTION_EXHAUSTED': string;
2191
+ 'error.limit.totalTimeoutMs': string;
2192
+ 'error.limit.maxTurns': string;
2193
+ 'error.message.RUN_CANCELLED': string;
2194
+ 'error.openSettings': string;
1955
2195
  'error.dismiss': string;
1956
2196
  };
1957
2197
  }>;
@@ -1972,6 +2212,20 @@ interface AppearanceChange {
1972
2212
  dictationLang?: string;
1973
2213
  }
1974
2214
  //#endregion
2215
+ //#region src/react/settingsSection.d.ts
2216
+ /**
2217
+ * chatbot 里各处「打开设置」出口指向的分区(FR-20.3)。
2218
+ *
2219
+ * 取值就是 console 的路由 leaf id,因此不需要维护第二套映射表;
2220
+ * 但这**不构成对 `@webskill/console` 的依赖**——它只是一组字符串字面量。
2221
+ * 宿主不用 console 时,这些字符串就是它自定义路由的键名,语义自定。
2222
+ *
2223
+ * 只覆盖**配置类** leaf:`skills.editor`、`governance.review` 这些与配置无关的页
2224
+ * 不在其中(AC-20.7 按「无未覆盖的配置类 leaf」执行,见偏差 D-15)。
2225
+ * @experimental
2226
+ */
2227
+ type SettingsSectionId = 'settings.runtime' | 'settings.sandbox' | 'settings.genui' | 'settings.trust' | 'settings.privacy' | 'settings.appearance' | 'connections.models' | 'connections.page' | 'connections.mcp';
2228
+ //#endregion
1975
2229
  //#region src/react/useChatLayout.d.ts
1976
2230
  /** 宿主可指定的布局档;auto 按容器尺寸判定 @stable */
1977
2231
  type ChatLayout = 'auto' | 'fullscreen' | 'embedded';
@@ -1999,6 +2253,11 @@ interface ChatbotProps {
1999
2253
  /** 布局档(默认 'auto':按容器尺寸在 fullscreen / embedded / mobile 之间判定) */
2000
2254
  layout?: ChatLayout;
2001
2255
  onAppearanceChange?(next: AppearanceChange): void;
2256
+ /**
2257
+ * 打开配置面(FR-20.4)。配置面本身已迁到 console,chatbot 只负责发出这个请求;
2258
+ * 宿主不接就不渲染任何「打开设置」出口——给一个点了没反应的按钮更糟。
2259
+ */
2260
+ onOpenSettings?(section: SettingsSectionId): void;
2002
2261
  /**
2003
2262
  * 装配完成后把引擎交给宿主,用于接线跨界面动作(例如 console 的快照恢复入口
2004
2263
  * 需要调 `engine.resume(runId)`)。每次重新装配都会再调一次。
@@ -2010,7 +2269,7 @@ interface ChatbotProps {
2010
2269
  * presentation shell and accessible thread primitives.
2011
2270
  * @stable
2012
2271
  */
2013
- declare function Chatbot({ adapter, config, locale: localeProp, theme: themeProp, renderer: rendererProp, dictationLang: dictationLangProp, surfaceRegistry, layout, onAppearanceChange, onEngineReady }: ChatbotProps): import("react").JSX.Element;
2272
+ declare function Chatbot({ adapter, config, locale: localeProp, theme: themeProp, renderer: rendererProp, dictationLang: dictationLangProp, surfaceRegistry, layout, onAppearanceChange, onOpenSettings, onEngineReady }: ChatbotProps): import("react").JSX.Element;
2014
2273
  //#endregion
2015
2274
  //#region src/react/A2uiSurfaceHost.d.ts
2016
2275
  /** @experimental */
@@ -2145,7 +2404,9 @@ interface ResultBlockListProps {
2145
2404
  declare function ResultBlockList({ blocks, runId, onDownload }: ResultBlockListProps): import("react").JSX.Element;
2146
2405
  /**
2147
2406
  * run 完成结果块渐进挂载(AnimatePresence 逐块入场):
2148
- * markdown / json / table / chart / image / file + artifact 下载卡。
2407
+ * markdown / json / table / chart / image / file
2408
+ * 产物只由 blocks 中的 file block 承载——历史消息也只持久化 blocks,
2409
+ * 走同一路渲染,刷新前后的卡片计数才一致。
2149
2410
  * @stable
2150
2411
  */
2151
2412
  declare function ResultBlocksPro({ bridge, activeRunId, onDownload }: ResultBlocksProProps): import("react").JSX.Element | null;
@@ -2164,69 +2425,26 @@ interface InterruptedBannerProps {
2164
2425
  */
2165
2426
  declare function InterruptedBanner({ engine, sessionId }: InterruptedBannerProps): import("react").JSX.Element | null;
2166
2427
  //#endregion
2167
- //#region src/react/SettingsDrawer.d.ts
2168
- /** @stable */
2169
- interface SettingsDrawerProps {
2170
- open: boolean;
2171
- /**
2172
- * 运行环境配置存储:模型列表、流式、temperature、Agent 能力全部读写这里。
2173
- * 缺省时模型区只读展示(宿主没接配置源,谈不上持久化)。
2174
- */
2175
- runtimeConfig?: RuntimeConfigStore;
2176
- /**
2177
- * 语音识别语言(BCP-47);空串即跟随界面语言(FR-7.7)。
2178
- * @experimental
2179
- */
2180
- dictationLang?: string;
2181
- /** 语音语言切换时回调(写回同一份外观配置) */
2182
- onAppearanceChange?(next: AppearanceChange): void;
2183
- /**
2184
- * 当前选中的模型条目 id(FR-14.4):它不支持工具时,Agent 能力开关置灰。
2185
- * @experimental
2186
- */
2187
- selectedModelId?: string;
2188
- /** 保存/清除成功后回调(Chatbot 借此触发 engine.reloadConfig) */
2189
- onSaved(): void;
2190
- /**
2191
- * 用户画像的读写入口(需求 19)。不注入即整段画像 UI 不渲染(R11)——
2192
- * 没有数据源时展示一个空列表比不展示更容易让人以为「记录丢了」。
2193
- * @experimental
2194
- */
2195
- userProfileApi?: UserProfileApi;
2196
- onClose(): void;
2197
- }
2198
- /** 设置面板对画像数据的最小依赖面;实现由 Chatbot 用 ChatEngine 装配 @experimental */
2199
- interface UserProfileApi {
2200
- read(): Promise<UserProfile>;
2201
- refine(): Promise<UserProfile>;
2202
- deleteEntry(id: string): Promise<UserProfile>;
2203
- clearRecords(): Promise<void>;
2204
- clearProfile(): Promise<void>;
2205
- /** 记录与画像一并清除(关闭总开关时的追问) */
2206
- clearAll(): Promise<void>;
2207
- /** `excludeIds` 来自导出前的逐条审阅 */
2208
- export(excludeIds: readonly string[]): Promise<UserProfileExport>;
2209
- diffImport(incoming: UserProfileExport): Promise<UserProfileImportDiff>;
2210
- applyImport(incoming: UserProfileExport): Promise<UserProfile>;
2211
- }
2212
- /** @experimental */
2213
- interface UserProfileImportDiff {
2214
- added: readonly UserProfileEntry[];
2215
- updated: readonly UserProfileEntry[];
2216
- origin: string;
2217
- }
2218
- /** 设置抽屉:模型列表(增删改 / 设默认 / 逐条探测)+ 流式与 temperature + Agent 能力 + 语音语言 @stable */
2219
- declare function SettingsDrawer({ open, runtimeConfig, dictationLang, selectedModelId, onAppearanceChange, onSaved, userProfileApi: profileApi, onClose }: SettingsDrawerProps): import("react").JSX.Element;
2220
- //#endregion
2221
2428
  //#region src/react/ErrorCard.d.ts
2222
2429
  /** @stable */
2223
2430
  interface ErrorCardProps {
2224
2431
  /** 稳定错误码(WebSkillError.code / RUN_FAILED;缺省不渲染徽章) */
2225
2432
  code?: string;
2226
2433
  message: string;
2434
+ /**
2435
+ * 触顶类错误的生效上限值:`totalTimeoutMs` 为毫秒、`maxTurns` 为轮数。
2436
+ * 给了才渲染「哪个上限 / 当前值 / 去哪改」,否则退回英文 message(FR-21.2)。
2437
+ * @experimental
2438
+ */
2439
+ loopLimits?: {
2440
+ totalTimeoutMs: number;
2441
+ maxTurns: number;
2442
+ };
2443
+ /** 提供时,触顶类错误下多一个直达设置的按钮 @experimental */
2444
+ onOpenSettings?(): void;
2227
2445
  onDismiss?(): void;
2228
2446
  }
2229
2447
  /** 结构化错误卡:错误码徽章 + 描述 + 建议(engine error 事件 / 失败 run) @stable */
2230
- declare function ErrorCard({ code, message, onDismiss }: ErrorCardProps): import("react").JSX.Element;
2448
+ declare function ErrorCard({ code, message, loopLimits, onOpenSettings, onDismiss }: ErrorCardProps): import("react").JSX.Element;
2231
2449
  //#endregion
2232
- export { A2uiSurfaceHost, type A2uiSurfaceHostProps, A2uiSurfaceSnapshotHost, type A2uiSurfaceSnapshotHostProps, type AppearanceChange, type ChatAttachmentInput, type ChatAttachmentMeta, ChatEngine, type ChatEngineOptions, type ChatEvent, type ChatInteractionRecord, type ChatLayout, type ChatMessage, type ChatRunPhase, type ChatSessionListResult, type ChatSessionMeta, type ChatTheme, type ChatToolCall, Chatbot, type ChatbotConfig, type ChatbotGovernancePorts, type ChatbotHostAdapter, type ChatbotProps, CompositeUiBridge, type CompositeUiBridgeDeps, DEFAULT_RENDERER_CAPABILITIES, DEFAULT_RUNTIME_CONFIG_STORAGE_KEY, type DownloadableFile, ErrorCard, type ErrorCardProps, InteractionCard, type InteractionCardProps, InterruptedBanner, type InterruptedBannerProps, type Locale, OpenUiSurfaceHost, type OpenUiSurfaceHostProps, OpenUiSurfaceSnapshotHost, type OpenUiSurfaceSnapshotHostProps, type RendererCapability, type RendererKind, type ResolvedChatLayout, ResultBlockList, type ResultBlockListProps, ResultBlocksPro, type ResultBlocksProProps, type RunSnapshot, type RuntimeAppearanceConfig, type RuntimeConfig, type RuntimeConfigStore, type RuntimeRendererId, type SandboxExecutorDeps, SettingsDrawer, type SettingsDrawerProps, SkillBadges, SpecInteraction, type SpecInteractionProps, type UserProfileApi, type UserProfileImportDiff, VercelPayloadPreview, type VercelPayloadPreviewProps, VercelSurfaceHost, type VercelSurfaceHostProps, VercelSurfaceSnapshotHost, type VercelSurfaceSnapshotHostProps, chatbotDictionary, configureA2uiMarkdown, createLocalStorageRuntimeConfigStore, createMemoryRuntimeConfigStore, probeA2uiAvailability, probeOpenUiAvailability, useT };
2450
+ export { A2uiSurfaceHost, type A2uiSurfaceHostProps, A2uiSurfaceSnapshotHost, type A2uiSurfaceSnapshotHostProps, type AppearanceChange, type ChatAttachmentInput, type ChatAttachmentMeta, ChatEngine, type ChatEngineOptions, type ChatEvent, type ChatInteractionRecord, type ChatLayout, type ChatMessage, type ChatRunPhase, type ChatSessionListResult, type ChatSessionMeta, type ChatTheme, type ChatToolCall, Chatbot, type ChatbotConfig, type ChatbotGovernancePorts, type ChatbotHostAdapter, type ChatbotProps, CompositeUiBridge, type CompositeUiBridgeDeps, DEFAULT_RENDERER_CAPABILITIES, DEFAULT_RUNTIME_CONFIG_STORAGE_KEY, type DownloadableFile, ErrorCard, type ErrorCardProps, InteractionCard, type InteractionCardProps, InterruptedBanner, type InterruptedBannerProps, type Locale, OpenUiSurfaceHost, type OpenUiSurfaceHostProps, OpenUiSurfaceSnapshotHost, type OpenUiSurfaceSnapshotHostProps, type RendererCapability, type RendererKind, type ResolvedChatLayout, ResultBlockList, type ResultBlockListProps, ResultBlocksPro, type ResultBlocksProProps, type RunSnapshot, type RuntimeAppearanceConfig, type RuntimeConfig, type RuntimeConfigStore, type RuntimeRendererId, type SandboxExecutorDeps, type SettingsSectionId, SkillBadges, SpecInteraction, type SpecInteractionProps, VercelPayloadPreview, type VercelPayloadPreviewProps, VercelSurfaceHost, type VercelSurfaceHostProps, VercelSurfaceSnapshotHost, type VercelSurfaceSnapshotHostProps, chatbotDictionary, configureA2uiMarkdown, createLocalStorageRuntimeConfigStore, createMemoryRuntimeConfigStore, probeA2uiAvailability, probeOpenUiAvailability, sandboxExecutorDeps, useT };