@webskill/chatbot 0.8.0 → 0.10.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/chatbot.css +52 -50
- package/dist/index.d.ts +239 -39
- package/dist/index.js +22918 -34975
- package/package.json +7 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AgentLoopConfig, ApprovalScope, BridgeCapabilities, DocxTextExtractor, ExternalSkillProvider, ExternalToolSource, FileSystemProvider, HookRunner, InteractionRequest, InteractionResponse, LifecycleEventInit, LinkedDocumentReader, 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";
|
|
1
|
+
import { AgentLoopConfig, ApprovalScope, BridgeCapabilities, DocxTextExtractor, ExternalSkillProvider, ExternalToolSource, FileSystemProvider, HookRunner, InteractionRequest, InteractionResponse, LifecycleEventInit, LinkedDocumentReader, LlmClient, NetworkPolicy, Page, PageQuery, PdfTextExtractor, RenderBlock, RenderResultRequest, RunSnapshot, RunSnapshotListEntry, RuntimePhase, RuntimeRun, ScriptExecutor, SessionStore, SkillCandidateMarker, SkillCatalogEntry, SkillIntegrityGuard, SkillOutcomeReporter, SkillStateGuard, UiBridge, UiSpecDrafts, UiSpecEvent, UiSpecSnapshot, UiSurfaceActionRequest, UiSurfaceActionResponse, UserProfile, UserProfileExport, WebSkillErrorCode, XlsxTextExtractor, 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
4
|
import { PageActionPolicy, PagePerceptionPolicy, PerceptionRecord, SkillCandidateSink, TodoItem } from "@webskill/sdk/agent";
|
|
@@ -7,6 +7,13 @@ import "react/jsx-runtime";
|
|
|
7
7
|
//#region ../ui-kit/src/i18n/types.d.ts
|
|
8
8
|
/** @stable */
|
|
9
9
|
type Locale = 'zh' | 'en';
|
|
10
|
+
/**
|
|
11
|
+
* 宿主 / 用户提供的、随界面语言切换的短文案(0.13.0 分册 21 FR-21.1)。
|
|
12
|
+
* SDK 自己的界面文案走 `createI18n` 字典,不用这个类型。
|
|
13
|
+
* 允许只填部分语种,缺的语种由 `resolveLocalizedText` 借用已填的。
|
|
14
|
+
* @experimental
|
|
15
|
+
*/
|
|
16
|
+
type LocalizedText = Partial<Record<Locale, string>>;
|
|
10
17
|
/** 单语言词条:key → 文案(支持 {name} 占位插值) */
|
|
11
18
|
type LocaleMessages = Record<string, string>;
|
|
12
19
|
/** 双语字典:zh/en 两个 locale 的键集必须一致(见 assertDictionaryComplete) */
|
|
@@ -40,6 +47,43 @@ type NetworkPolicy$1 = 'deny-all' | 'allow-all' | {
|
|
|
40
47
|
allow: string[];
|
|
41
48
|
};
|
|
42
49
|
//#endregion
|
|
50
|
+
//#region ../ui-kit/src/runtime-config/quickPrompts.d.ts
|
|
51
|
+
/**
|
|
52
|
+
* 快捷指令可选图标名(0.12.0 分册 21)。
|
|
53
|
+
* 用受控枚举而不是让宿主传组件:SDK 的图标集不进公开契约,
|
|
54
|
+
* 换实现(lucide → 别的)时宿主代码不用动。
|
|
55
|
+
*
|
|
56
|
+
* 0.13.0 分册 17 FR-17.1:真值源从 `@webskill/chatbot` 迁到这里,
|
|
57
|
+
* 让 console 的配置界面也能用同一份枚举;`@webskill/chatbot` 原样 re-export,
|
|
58
|
+
* 公开面逐字不变。
|
|
59
|
+
* @experimental
|
|
60
|
+
*/
|
|
61
|
+
type QuickPromptIconName = 'chart' | 'document' | 'report' | 'search' | 'list' | 'bug' | 'test' | 'metric' | 'compare' | 'page' | 'run' | 'warn' | 'sparkles' | 'settings';
|
|
62
|
+
/**
|
|
63
|
+
* 带图标的快捷指令(0.12.0 分册 21)。
|
|
64
|
+
* @experimental
|
|
65
|
+
*/
|
|
66
|
+
interface QuickPrompt {
|
|
67
|
+
/**
|
|
68
|
+
* 点击后发出的文本,同时作为按钮可见文案。
|
|
69
|
+
* 0.13.0 分册 21 FR-21.1:改为按语种取值,可只填部分语种。
|
|
70
|
+
*/
|
|
71
|
+
text: LocalizedText;
|
|
72
|
+
/** 缺省或取值不在枚举内时按无图标渲染 */
|
|
73
|
+
icon?: QuickPromptIconName;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* `RuntimeConfig` 里持久化的快捷指令条目(0.13.0 分册 17)。
|
|
77
|
+
* 比 `QuickPrompt` 多一个稳定 `id`:列表增删改需要它做定位,
|
|
78
|
+
* 用 `text` 当 key 在「两条同文案」时会塌陷。`id` 不进任何发给模型的字符串。
|
|
79
|
+
* @experimental
|
|
80
|
+
*/
|
|
81
|
+
interface RuntimeQuickPrompt {
|
|
82
|
+
id: string;
|
|
83
|
+
text: LocalizedText;
|
|
84
|
+
icon?: QuickPromptIconName;
|
|
85
|
+
}
|
|
86
|
+
//#endregion
|
|
43
87
|
//#region ../ui-kit/src/runtime-config/types.d.ts
|
|
44
88
|
/**
|
|
45
89
|
* 运行环境配置模型(P2):console Configure Tab 编辑、chatbot ChatEngine 装配应用,
|
|
@@ -225,6 +269,11 @@ interface RuntimeMultimodalConfig {
|
|
|
225
269
|
maxImageBytes: number;
|
|
226
270
|
/** 附件与取像共用 */
|
|
227
271
|
maxImagesPerMessage: number;
|
|
272
|
+
/**
|
|
273
|
+
* 页面取像时小于该面积(平方像素)的元素视作工具图标,不占名额(0.13.0 FR-20.4)。
|
|
274
|
+
* `0` 是合法值,意为关闭过滤;只作用于页面取像,不管用户上传的附件。
|
|
275
|
+
*/
|
|
276
|
+
minImageArea: number;
|
|
228
277
|
}
|
|
229
278
|
/**
|
|
230
279
|
* 用户画像配置(0.6.0 FR-19.6)。`enabled` 默认**关**(AC-G5):
|
|
@@ -270,6 +319,19 @@ interface RuntimeConfig {
|
|
|
270
319
|
documentSurface: RuntimeDocumentSurfaceConfig;
|
|
271
320
|
userProfile: RuntimeUserProfileConfig;
|
|
272
321
|
skillState: RuntimeSkillStateConfig;
|
|
322
|
+
/**
|
|
323
|
+
* 快捷指令的**唯一权威**(0.13.0 分册 21 FR-21.5)。
|
|
324
|
+
* `ChatbotConfig.quickPrompts` 降级为一次性种子源,不再参与渲染判断。
|
|
325
|
+
*/
|
|
326
|
+
quickPrompts: readonly RuntimeQuickPrompt[];
|
|
327
|
+
/**
|
|
328
|
+
* 宿主种子是否已注入过(FR-21.6)。
|
|
329
|
+
* 不得用 `quickPrompts.length === 0` 推断:「从未配置」与「用户删光了」都是空数组,
|
|
330
|
+
* 靠数组本身分不开——这正是 D-17-3 当年绕不过去的地方。
|
|
331
|
+
*/
|
|
332
|
+
quickPromptsSeeded: boolean;
|
|
333
|
+
/** 空态与动态指令条最多展示多少条;超出的部分截断。取值 1..{@link MAX_QUICK_PROMPT_LIMIT} */
|
|
334
|
+
quickPromptLimit: number;
|
|
273
335
|
/** 被用户删掉的自动模型条目 id(FR-14.3):删一次就不该再自己长回来 */
|
|
274
336
|
dismissedAutoEntries: readonly string[];
|
|
275
337
|
}
|
|
@@ -448,6 +510,23 @@ interface ChatTokenUsage {
|
|
|
448
510
|
/** 本 run 向大模型发送请求的次数(模型调用轮数) */
|
|
449
511
|
llmCalls: number;
|
|
450
512
|
}
|
|
513
|
+
/**
|
|
514
|
+
* 助手消息的有序内容段(分册 17 FR-17.1):文字与 surface / 结果块按生成顺序排列。
|
|
515
|
+
* 冗余记账——删掉本字段消息内容不缺失,只退化成「正文在上、扩展在下」(FR-17.11)。
|
|
516
|
+
* @experimental
|
|
517
|
+
*/
|
|
518
|
+
type ChatContentPart = {
|
|
519
|
+
type: 'text';
|
|
520
|
+
text: string;
|
|
521
|
+
at: number;
|
|
522
|
+
} | {
|
|
523
|
+
type: 'surface';
|
|
524
|
+
surfaceId: string;
|
|
525
|
+
at: number;
|
|
526
|
+
} | {
|
|
527
|
+
type: 'blocks';
|
|
528
|
+
at: number;
|
|
529
|
+
};
|
|
451
530
|
/** @stable */
|
|
452
531
|
interface ChatMessage {
|
|
453
532
|
id: string;
|
|
@@ -522,6 +601,11 @@ interface ChatMessage {
|
|
|
522
601
|
* @experimental
|
|
523
602
|
*/
|
|
524
603
|
candidates?: SkillCandidateMarker[];
|
|
604
|
+
/**
|
|
605
|
+
* 文字与 surface / blocks 的生成顺序(分册 17)。缺省时按 0.11.0 的两段式渲染。
|
|
606
|
+
* @experimental
|
|
607
|
+
*/
|
|
608
|
+
contentParts?: ChatContentPart[];
|
|
525
609
|
}
|
|
526
610
|
/** @stable */
|
|
527
611
|
interface ChatSessionMeta {
|
|
@@ -564,6 +648,21 @@ type ChatEvent = {
|
|
|
564
648
|
} | {
|
|
565
649
|
type: 'message-complete';
|
|
566
650
|
message: ChatMessage;
|
|
651
|
+
} |
|
|
652
|
+
/**
|
|
653
|
+
* surface 上屏(分册 17 FR-17.3):载荷只有引用,spec 本体照旧走 `bridge.surfaceSnapshots`。
|
|
654
|
+
* 事件只承担「顺序」这一件事。
|
|
655
|
+
* @experimental
|
|
656
|
+
*/
|
|
657
|
+
{
|
|
658
|
+
type: 'surface-opened';
|
|
659
|
+
runId: string;
|
|
660
|
+
surfaceId: string;
|
|
661
|
+
} |
|
|
662
|
+
/** 结果块整批上屏(分册 17 FR-17.3) @experimental */
|
|
663
|
+
{
|
|
664
|
+
type: 'blocks-rendered';
|
|
665
|
+
runId: string;
|
|
567
666
|
} | {
|
|
568
667
|
type: 'skill-activated';
|
|
569
668
|
runId: string;
|
|
@@ -657,8 +756,23 @@ interface ChatbotConfig {
|
|
|
657
756
|
* renderResult/sandbox/llm 映射;与 console Configure Tab 共用同一 store(宿主接线)
|
|
658
757
|
*/
|
|
659
758
|
runtimeConfig?: RuntimeConfigStore;
|
|
660
|
-
/**
|
|
661
|
-
|
|
759
|
+
/**
|
|
760
|
+
* WelcomeScreen 快捷 prompt 的**一次性种子**(0.13.0 分册 21 FR-21.5);给字符串即无图标、不分语种。
|
|
761
|
+
*
|
|
762
|
+
* 接了 `runtimeConfig` 时,本字段只在该存储**从未种子化过**时被注入一次
|
|
763
|
+
* (之后 `RuntimeConfig.quickPrompts` 是唯一权威,console 的「快捷指令」页改的就是它);
|
|
764
|
+
* 用户在 console 里删光清单后本字段**不会**自行回填,除非用户点「恢复宿主默认」。
|
|
765
|
+
* 未接 `runtimeConfig` 的宿主上,本字段仍是直接的静态清单。
|
|
766
|
+
*/
|
|
767
|
+
quickPrompts?: readonly (string | QuickPrompt)[];
|
|
768
|
+
/**
|
|
769
|
+
* 按当前上下文动态下发的快捷指令(FR-17.4)。宿主可以随用户所在页面随时换一批。
|
|
770
|
+
*
|
|
771
|
+
* 与静态清单**拼接**而不是覆盖(动态在前,同文案去重)——用户在 console 里配的
|
|
772
|
+
* 不该被宿主惄惄吞掉。不同于静态清单,它在**对话进行中**也会渲染(FR-17.6)。
|
|
773
|
+
* @experimental
|
|
774
|
+
*/
|
|
775
|
+
dynamicQuickPrompts?: readonly (string | QuickPrompt)[];
|
|
662
776
|
/**
|
|
663
777
|
* 开启后模型多一个 `render_ui` 工具,可面向 AI Component Catalog 直接生成声明式 UI。
|
|
664
778
|
* 默认关:工具描述 + 入参 schema 约 34 KB,会计入每一次请求。
|
|
@@ -733,6 +847,13 @@ interface ChatbotHostAdapter {
|
|
|
733
847
|
linkedDocuments?: LinkedDocumentReader;
|
|
734
848
|
/** docx → 文本(`extractDocxText`);不注入即 Word 文档明确报「本环境不支持」 */
|
|
735
849
|
docxExtractor?: DocxTextExtractor;
|
|
850
|
+
/** xlsx → 文本(`extractXlsxText`);不注入即 Excel 工作簿明确报「本环境不支持」 */
|
|
851
|
+
xlsxExtractor?: XlsxTextExtractor;
|
|
852
|
+
/**
|
|
853
|
+
* PDF → 文本;**只用于直传被端点拒后的回退**(0.13.0 FR-22.1)。
|
|
854
|
+
* PDF 仍然默认直传,能读的端点拿到的还是原件;不注入即没有回退能力。
|
|
855
|
+
*/
|
|
856
|
+
pdfExtractor?: PdfTextExtractor;
|
|
736
857
|
/** 文档读取留痕出口(FR-22.6) */
|
|
737
858
|
documentAudit?: {
|
|
738
859
|
append(event: {
|
|
@@ -1023,6 +1144,12 @@ interface CompositeUiBridgeDeps {
|
|
|
1023
1144
|
* @experimental
|
|
1024
1145
|
*/
|
|
1025
1146
|
onSkillCandidate?(runId: string, candidate: SkillCandidateMarker): void;
|
|
1147
|
+
/**
|
|
1148
|
+
* surface 首次上屏(分册 17 FR-17.3)。只传引用,spec 本体照旧走 surfaceStore;
|
|
1149
|
+
* 引擎拿它在账本里记一个顺序位。
|
|
1150
|
+
* @experimental
|
|
1151
|
+
*/
|
|
1152
|
+
onSurfaceOpened?(runId: string, surfaceId: string): void;
|
|
1026
1153
|
emit(event: ChatEvent): void;
|
|
1027
1154
|
}
|
|
1028
1155
|
/**
|
|
@@ -1063,16 +1190,21 @@ declare const chatbotDictionary: {
|
|
|
1063
1190
|
'app.title': string;
|
|
1064
1191
|
'header.sessions': string;
|
|
1065
1192
|
'header.settings': string;
|
|
1193
|
+
'header.dock': string;
|
|
1194
|
+
'header.undock': string;
|
|
1195
|
+
'header.close': string;
|
|
1066
1196
|
'header.console': string;
|
|
1067
1197
|
'header.theme.light': string;
|
|
1068
1198
|
'header.theme.dark': string;
|
|
1069
1199
|
'header.language': string;
|
|
1070
1200
|
'session.title': string;
|
|
1201
|
+
'session.historyTitle': string;
|
|
1202
|
+
'session.collapse': string;
|
|
1203
|
+
'session.expand': string;
|
|
1071
1204
|
'session.new': string;
|
|
1072
1205
|
'session.searchPlaceholder': string;
|
|
1073
1206
|
'session.searchClear': string;
|
|
1074
1207
|
'session.empty': string;
|
|
1075
|
-
'session.missingRoot': string;
|
|
1076
1208
|
'session.skipped': string;
|
|
1077
1209
|
'session.delete': string;
|
|
1078
1210
|
'session.actions': string;
|
|
@@ -1106,10 +1238,7 @@ declare const chatbotDictionary: {
|
|
|
1106
1238
|
'welcome.capability.transparency.title': string;
|
|
1107
1239
|
'welcome.capability.transparency.description': string;
|
|
1108
1240
|
'welcome.quickPrompts': string;
|
|
1109
|
-
'welcome.
|
|
1110
|
-
'welcome.prompt.2': string;
|
|
1111
|
-
'welcome.prompt.3': string;
|
|
1112
|
-
'welcome.prompt.4': string;
|
|
1241
|
+
'welcome.dynamicPrompts': string;
|
|
1113
1242
|
'message.copy': string;
|
|
1114
1243
|
'message.copied': string;
|
|
1115
1244
|
'message.retry': string;
|
|
@@ -1198,6 +1327,15 @@ declare const chatbotDictionary: {
|
|
|
1198
1327
|
'interaction.pageAction.role.click': string;
|
|
1199
1328
|
'interaction.pageAction.role.fill': string;
|
|
1200
1329
|
'interaction.pageAction.role.submit': string;
|
|
1330
|
+
'interaction.pageAction.frame': string;
|
|
1331
|
+
'interaction.pageAction.elevated': string;
|
|
1332
|
+
'interaction.traceEvidence.title': string;
|
|
1333
|
+
'interaction.traceEvidence.columnDraft': string;
|
|
1334
|
+
'interaction.traceEvidence.columnTrace': string;
|
|
1335
|
+
'interaction.traceEvidence.trace': string;
|
|
1336
|
+
'interaction.traceEvidence.model': string;
|
|
1337
|
+
'interaction.traceEvidence.noArgs': string;
|
|
1338
|
+
'interaction.traceEvidence.redacted': string;
|
|
1201
1339
|
'interaction.origin': string;
|
|
1202
1340
|
'interaction.submitted': string;
|
|
1203
1341
|
'interaction.submit': string;
|
|
@@ -1212,6 +1350,11 @@ declare const chatbotDictionary: {
|
|
|
1212
1350
|
'surface.readOnlySnapshot': string;
|
|
1213
1351
|
'surface.suggested': string;
|
|
1214
1352
|
'surface.useSuggestion': string;
|
|
1353
|
+
'surface.control.previousPage': string;
|
|
1354
|
+
'surface.control.previous': string;
|
|
1355
|
+
'surface.control.nextPage': string;
|
|
1356
|
+
'surface.control.next': string;
|
|
1357
|
+
'surface.control.carousel': string;
|
|
1215
1358
|
'interaction.wait': string;
|
|
1216
1359
|
'interaction.wait.inPanel': string;
|
|
1217
1360
|
'interaction.wait.fallback': string;
|
|
@@ -1250,9 +1393,6 @@ declare const chatbotDictionary: {
|
|
|
1250
1393
|
'composer.noModel.description': string;
|
|
1251
1394
|
'composer.noModel.configure': string;
|
|
1252
1395
|
'capability.group': string;
|
|
1253
|
-
'composer.pageCapture': string;
|
|
1254
|
-
'composer.pageCapture.disabled.setting': string;
|
|
1255
|
-
'composer.pageCapture.disabled.model': string;
|
|
1256
1396
|
'composer.addAttachment.imagesOff': string;
|
|
1257
1397
|
'composer.addAttachment.modelNoImages': string;
|
|
1258
1398
|
'attachment.imagesDropped': string;
|
|
@@ -1392,6 +1532,7 @@ declare const chatbotDictionary: {
|
|
|
1392
1532
|
'error.suggestion.RUN_INTERACTION_TIMEOUT': string;
|
|
1393
1533
|
'error.suggestion.RUN_MAX_TURNS_EXCEEDED': string;
|
|
1394
1534
|
'error.suggestion.TOOL_RESOLUTION_EXHAUSTED': string;
|
|
1535
|
+
'error.suggestion.TOOL_SCHEMA_UNAVAILABLE': string;
|
|
1395
1536
|
'error.limit.totalTimeoutMs': string;
|
|
1396
1537
|
'error.limit.maxTurns': string;
|
|
1397
1538
|
'error.message.RUN_CANCELLED': string;
|
|
@@ -1402,16 +1543,21 @@ declare const chatbotDictionary: {
|
|
|
1402
1543
|
'app.title': string;
|
|
1403
1544
|
'header.sessions': string;
|
|
1404
1545
|
'header.settings': string;
|
|
1546
|
+
'header.dock': string;
|
|
1547
|
+
'header.undock': string;
|
|
1548
|
+
'header.close': string;
|
|
1405
1549
|
'header.console': string;
|
|
1406
1550
|
'header.theme.light': string;
|
|
1407
1551
|
'header.theme.dark': string;
|
|
1408
1552
|
'header.language': string;
|
|
1409
1553
|
'session.title': string;
|
|
1554
|
+
'session.historyTitle': string;
|
|
1555
|
+
'session.collapse': string;
|
|
1556
|
+
'session.expand': string;
|
|
1410
1557
|
'session.new': string;
|
|
1411
1558
|
'session.searchPlaceholder': string;
|
|
1412
1559
|
'session.searchClear': string;
|
|
1413
1560
|
'session.empty': string;
|
|
1414
|
-
'session.missingRoot': string;
|
|
1415
1561
|
'session.skipped': string;
|
|
1416
1562
|
'session.delete': string;
|
|
1417
1563
|
'session.actions': string;
|
|
@@ -1445,10 +1591,7 @@ declare const chatbotDictionary: {
|
|
|
1445
1591
|
'welcome.capability.transparency.title': string;
|
|
1446
1592
|
'welcome.capability.transparency.description': string;
|
|
1447
1593
|
'welcome.quickPrompts': string;
|
|
1448
|
-
'welcome.
|
|
1449
|
-
'welcome.prompt.2': string;
|
|
1450
|
-
'welcome.prompt.3': string;
|
|
1451
|
-
'welcome.prompt.4': string;
|
|
1594
|
+
'welcome.dynamicPrompts': string;
|
|
1452
1595
|
'message.copy': string;
|
|
1453
1596
|
'message.copied': string;
|
|
1454
1597
|
'message.edit': string;
|
|
@@ -1537,6 +1680,15 @@ declare const chatbotDictionary: {
|
|
|
1537
1680
|
'interaction.pageAction.role.click': string;
|
|
1538
1681
|
'interaction.pageAction.role.fill': string;
|
|
1539
1682
|
'interaction.pageAction.role.submit': string;
|
|
1683
|
+
'interaction.pageAction.frame': string;
|
|
1684
|
+
'interaction.pageAction.elevated': string;
|
|
1685
|
+
'interaction.traceEvidence.title': string;
|
|
1686
|
+
'interaction.traceEvidence.columnDraft': string;
|
|
1687
|
+
'interaction.traceEvidence.columnTrace': string;
|
|
1688
|
+
'interaction.traceEvidence.trace': string;
|
|
1689
|
+
'interaction.traceEvidence.model': string;
|
|
1690
|
+
'interaction.traceEvidence.noArgs': string;
|
|
1691
|
+
'interaction.traceEvidence.redacted': string;
|
|
1540
1692
|
'interaction.origin': string;
|
|
1541
1693
|
'interaction.submitted': string;
|
|
1542
1694
|
'interaction.submit': string;
|
|
@@ -1551,6 +1703,11 @@ declare const chatbotDictionary: {
|
|
|
1551
1703
|
'surface.readOnlySnapshot': string;
|
|
1552
1704
|
'surface.suggested': string;
|
|
1553
1705
|
'surface.useSuggestion': string;
|
|
1706
|
+
'surface.control.previousPage': string;
|
|
1707
|
+
'surface.control.previous': string;
|
|
1708
|
+
'surface.control.nextPage': string;
|
|
1709
|
+
'surface.control.next': string;
|
|
1710
|
+
'surface.control.carousel': string;
|
|
1554
1711
|
'interaction.wait': string;
|
|
1555
1712
|
'interaction.wait.inPanel': string;
|
|
1556
1713
|
'interaction.wait.fallback': string;
|
|
@@ -1589,9 +1746,6 @@ declare const chatbotDictionary: {
|
|
|
1589
1746
|
'composer.noModel.description': string;
|
|
1590
1747
|
'composer.noModel.configure': string;
|
|
1591
1748
|
'capability.group': string;
|
|
1592
|
-
'composer.pageCapture': string;
|
|
1593
|
-
'composer.pageCapture.disabled.setting': string;
|
|
1594
|
-
'composer.pageCapture.disabled.model': string;
|
|
1595
1749
|
'composer.addAttachment.imagesOff': string;
|
|
1596
1750
|
'composer.addAttachment.modelNoImages': string;
|
|
1597
1751
|
'attachment.imagesDropped': string;
|
|
@@ -1731,6 +1885,7 @@ declare const chatbotDictionary: {
|
|
|
1731
1885
|
'error.suggestion.RUN_INTERACTION_TIMEOUT': string;
|
|
1732
1886
|
'error.suggestion.RUN_MAX_TURNS_EXCEEDED': string;
|
|
1733
1887
|
'error.suggestion.TOOL_RESOLUTION_EXHAUSTED': string;
|
|
1888
|
+
'error.suggestion.TOOL_SCHEMA_UNAVAILABLE': string;
|
|
1734
1889
|
'error.limit.totalTimeoutMs': string;
|
|
1735
1890
|
'error.limit.maxTurns': string;
|
|
1736
1891
|
'error.message.RUN_CANCELLED': string;
|
|
@@ -1744,16 +1899,21 @@ declare const useT: () => TranslateFn<{
|
|
|
1744
1899
|
'app.title': string;
|
|
1745
1900
|
'header.sessions': string;
|
|
1746
1901
|
'header.settings': string;
|
|
1902
|
+
'header.dock': string;
|
|
1903
|
+
'header.undock': string;
|
|
1904
|
+
'header.close': string;
|
|
1747
1905
|
'header.console': string;
|
|
1748
1906
|
'header.theme.light': string;
|
|
1749
1907
|
'header.theme.dark': string;
|
|
1750
1908
|
'header.language': string;
|
|
1751
1909
|
'session.title': string;
|
|
1910
|
+
'session.historyTitle': string;
|
|
1911
|
+
'session.collapse': string;
|
|
1912
|
+
'session.expand': string;
|
|
1752
1913
|
'session.new': string;
|
|
1753
1914
|
'session.searchPlaceholder': string;
|
|
1754
1915
|
'session.searchClear': string;
|
|
1755
1916
|
'session.empty': string;
|
|
1756
|
-
'session.missingRoot': string;
|
|
1757
1917
|
'session.skipped': string;
|
|
1758
1918
|
'session.delete': string;
|
|
1759
1919
|
'session.actions': string;
|
|
@@ -1787,10 +1947,7 @@ declare const useT: () => TranslateFn<{
|
|
|
1787
1947
|
'welcome.capability.transparency.title': string;
|
|
1788
1948
|
'welcome.capability.transparency.description': string;
|
|
1789
1949
|
'welcome.quickPrompts': string;
|
|
1790
|
-
'welcome.
|
|
1791
|
-
'welcome.prompt.2': string;
|
|
1792
|
-
'welcome.prompt.3': string;
|
|
1793
|
-
'welcome.prompt.4': string;
|
|
1950
|
+
'welcome.dynamicPrompts': string;
|
|
1794
1951
|
'message.copy': string;
|
|
1795
1952
|
'message.copied': string;
|
|
1796
1953
|
'message.retry': string;
|
|
@@ -1879,6 +2036,15 @@ declare const useT: () => TranslateFn<{
|
|
|
1879
2036
|
'interaction.pageAction.role.click': string;
|
|
1880
2037
|
'interaction.pageAction.role.fill': string;
|
|
1881
2038
|
'interaction.pageAction.role.submit': string;
|
|
2039
|
+
'interaction.pageAction.frame': string;
|
|
2040
|
+
'interaction.pageAction.elevated': string;
|
|
2041
|
+
'interaction.traceEvidence.title': string;
|
|
2042
|
+
'interaction.traceEvidence.columnDraft': string;
|
|
2043
|
+
'interaction.traceEvidence.columnTrace': string;
|
|
2044
|
+
'interaction.traceEvidence.trace': string;
|
|
2045
|
+
'interaction.traceEvidence.model': string;
|
|
2046
|
+
'interaction.traceEvidence.noArgs': string;
|
|
2047
|
+
'interaction.traceEvidence.redacted': string;
|
|
1882
2048
|
'interaction.origin': string;
|
|
1883
2049
|
'interaction.submitted': string;
|
|
1884
2050
|
'interaction.submit': string;
|
|
@@ -1893,6 +2059,11 @@ declare const useT: () => TranslateFn<{
|
|
|
1893
2059
|
'surface.readOnlySnapshot': string;
|
|
1894
2060
|
'surface.suggested': string;
|
|
1895
2061
|
'surface.useSuggestion': string;
|
|
2062
|
+
'surface.control.previousPage': string;
|
|
2063
|
+
'surface.control.previous': string;
|
|
2064
|
+
'surface.control.nextPage': string;
|
|
2065
|
+
'surface.control.next': string;
|
|
2066
|
+
'surface.control.carousel': string;
|
|
1896
2067
|
'interaction.wait': string;
|
|
1897
2068
|
'interaction.wait.inPanel': string;
|
|
1898
2069
|
'interaction.wait.fallback': string;
|
|
@@ -1931,9 +2102,6 @@ declare const useT: () => TranslateFn<{
|
|
|
1931
2102
|
'composer.noModel.description': string;
|
|
1932
2103
|
'composer.noModel.configure': string;
|
|
1933
2104
|
'capability.group': string;
|
|
1934
|
-
'composer.pageCapture': string;
|
|
1935
|
-
'composer.pageCapture.disabled.setting': string;
|
|
1936
|
-
'composer.pageCapture.disabled.model': string;
|
|
1937
2105
|
'composer.addAttachment.imagesOff': string;
|
|
1938
2106
|
'composer.addAttachment.modelNoImages': string;
|
|
1939
2107
|
'attachment.imagesDropped': string;
|
|
@@ -2073,6 +2241,7 @@ declare const useT: () => TranslateFn<{
|
|
|
2073
2241
|
'error.suggestion.RUN_INTERACTION_TIMEOUT': string;
|
|
2074
2242
|
'error.suggestion.RUN_MAX_TURNS_EXCEEDED': string;
|
|
2075
2243
|
'error.suggestion.TOOL_RESOLUTION_EXHAUSTED': string;
|
|
2244
|
+
'error.suggestion.TOOL_SCHEMA_UNAVAILABLE': string;
|
|
2076
2245
|
'error.limit.totalTimeoutMs': string;
|
|
2077
2246
|
'error.limit.maxTurns': string;
|
|
2078
2247
|
'error.message.RUN_CANCELLED': string;
|
|
@@ -2083,16 +2252,21 @@ declare const useT: () => TranslateFn<{
|
|
|
2083
2252
|
'app.title': string;
|
|
2084
2253
|
'header.sessions': string;
|
|
2085
2254
|
'header.settings': string;
|
|
2255
|
+
'header.dock': string;
|
|
2256
|
+
'header.undock': string;
|
|
2257
|
+
'header.close': string;
|
|
2086
2258
|
'header.console': string;
|
|
2087
2259
|
'header.theme.light': string;
|
|
2088
2260
|
'header.theme.dark': string;
|
|
2089
2261
|
'header.language': string;
|
|
2090
2262
|
'session.title': string;
|
|
2263
|
+
'session.historyTitle': string;
|
|
2264
|
+
'session.collapse': string;
|
|
2265
|
+
'session.expand': string;
|
|
2091
2266
|
'session.new': string;
|
|
2092
2267
|
'session.searchPlaceholder': string;
|
|
2093
2268
|
'session.searchClear': string;
|
|
2094
2269
|
'session.empty': string;
|
|
2095
|
-
'session.missingRoot': string;
|
|
2096
2270
|
'session.skipped': string;
|
|
2097
2271
|
'session.delete': string;
|
|
2098
2272
|
'session.actions': string;
|
|
@@ -2126,10 +2300,7 @@ declare const useT: () => TranslateFn<{
|
|
|
2126
2300
|
'welcome.capability.transparency.title': string;
|
|
2127
2301
|
'welcome.capability.transparency.description': string;
|
|
2128
2302
|
'welcome.quickPrompts': string;
|
|
2129
|
-
'welcome.
|
|
2130
|
-
'welcome.prompt.2': string;
|
|
2131
|
-
'welcome.prompt.3': string;
|
|
2132
|
-
'welcome.prompt.4': string;
|
|
2303
|
+
'welcome.dynamicPrompts': string;
|
|
2133
2304
|
'message.copy': string;
|
|
2134
2305
|
'message.copied': string;
|
|
2135
2306
|
'message.edit': string;
|
|
@@ -2218,6 +2389,15 @@ declare const useT: () => TranslateFn<{
|
|
|
2218
2389
|
'interaction.pageAction.role.click': string;
|
|
2219
2390
|
'interaction.pageAction.role.fill': string;
|
|
2220
2391
|
'interaction.pageAction.role.submit': string;
|
|
2392
|
+
'interaction.pageAction.frame': string;
|
|
2393
|
+
'interaction.pageAction.elevated': string;
|
|
2394
|
+
'interaction.traceEvidence.title': string;
|
|
2395
|
+
'interaction.traceEvidence.columnDraft': string;
|
|
2396
|
+
'interaction.traceEvidence.columnTrace': string;
|
|
2397
|
+
'interaction.traceEvidence.trace': string;
|
|
2398
|
+
'interaction.traceEvidence.model': string;
|
|
2399
|
+
'interaction.traceEvidence.noArgs': string;
|
|
2400
|
+
'interaction.traceEvidence.redacted': string;
|
|
2221
2401
|
'interaction.origin': string;
|
|
2222
2402
|
'interaction.submitted': string;
|
|
2223
2403
|
'interaction.submit': string;
|
|
@@ -2232,6 +2412,11 @@ declare const useT: () => TranslateFn<{
|
|
|
2232
2412
|
'surface.readOnlySnapshot': string;
|
|
2233
2413
|
'surface.suggested': string;
|
|
2234
2414
|
'surface.useSuggestion': string;
|
|
2415
|
+
'surface.control.previousPage': string;
|
|
2416
|
+
'surface.control.previous': string;
|
|
2417
|
+
'surface.control.nextPage': string;
|
|
2418
|
+
'surface.control.next': string;
|
|
2419
|
+
'surface.control.carousel': string;
|
|
2235
2420
|
'interaction.wait': string;
|
|
2236
2421
|
'interaction.wait.inPanel': string;
|
|
2237
2422
|
'interaction.wait.fallback': string;
|
|
@@ -2270,9 +2455,6 @@ declare const useT: () => TranslateFn<{
|
|
|
2270
2455
|
'composer.noModel.description': string;
|
|
2271
2456
|
'composer.noModel.configure': string;
|
|
2272
2457
|
'capability.group': string;
|
|
2273
|
-
'composer.pageCapture': string;
|
|
2274
|
-
'composer.pageCapture.disabled.setting': string;
|
|
2275
|
-
'composer.pageCapture.disabled.model': string;
|
|
2276
2458
|
'composer.addAttachment.imagesOff': string;
|
|
2277
2459
|
'composer.addAttachment.modelNoImages': string;
|
|
2278
2460
|
'attachment.imagesDropped': string;
|
|
@@ -2412,6 +2594,7 @@ declare const useT: () => TranslateFn<{
|
|
|
2412
2594
|
'error.suggestion.RUN_INTERACTION_TIMEOUT': string;
|
|
2413
2595
|
'error.suggestion.RUN_MAX_TURNS_EXCEEDED': string;
|
|
2414
2596
|
'error.suggestion.TOOL_RESOLUTION_EXHAUSTED': string;
|
|
2597
|
+
'error.suggestion.TOOL_SCHEMA_UNAVAILABLE': string;
|
|
2415
2598
|
'error.limit.totalTimeoutMs': string;
|
|
2416
2599
|
'error.limit.maxTurns': string;
|
|
2417
2600
|
'error.message.RUN_CANCELLED': string;
|
|
@@ -2448,7 +2631,7 @@ interface AppearanceChange {
|
|
|
2448
2631
|
* 不在其中(AC-20.7 按「无未覆盖的配置类 leaf」执行,见偏差 D-15)。
|
|
2449
2632
|
* @experimental
|
|
2450
2633
|
*/
|
|
2451
|
-
type SettingsSectionId = 'settings.runtime' | 'settings.sandbox' | 'settings.genui' | 'settings.trust' | 'settings.privacy' | 'settings.appearance' | 'connections.models' | 'connections.webmcp' | 'connections.page' | 'connections.mcp';
|
|
2634
|
+
type SettingsSectionId = 'settings.runtime' | 'settings.sandbox' | 'settings.genui' | 'settings.prompts' | 'settings.trust' | 'settings.privacy' | 'settings.appearance' | 'connections.models' | 'connections.webmcp' | 'connections.page' | 'connections.mcp';
|
|
2452
2635
|
//#endregion
|
|
2453
2636
|
//#region src/react/useChatLayout.d.ts
|
|
2454
2637
|
/** 宿主可指定的布局档;auto 按容器尺寸判定 @stable */
|
|
@@ -2477,12 +2660,29 @@ interface ChatbotProps {
|
|
|
2477
2660
|
surfaceRegistry?: SurfaceRegistry;
|
|
2478
2661
|
/** 布局档(默认 'auto':按容器尺寸在 fullscreen / embedded / mobile 之间判定) */
|
|
2479
2662
|
layout?: ChatLayout;
|
|
2663
|
+
/** 会话列表形态(默认 'auto':按**容器**宽度判定,不看视口) @stable */
|
|
2664
|
+
sessionList?: 'auto' | 'collapsed' | 'inline';
|
|
2480
2665
|
/**
|
|
2481
2666
|
* 打开配置面(FR-20.4)。配置面本身已迁到 console,chatbot 只负责发出这个请求;
|
|
2482
2667
|
* 宿主不接就不渲染任何「打开设置」出口——给一个点了没反应的按钮更糟。
|
|
2483
2668
|
* `section` 可选(FR-16.5):齿轮不带分区(→ Overview),带诉求的入口(错误卡等)才传分区。
|
|
2484
2669
|
*/
|
|
2485
2670
|
onOpenSettings?(section?: SettingsSectionId): void;
|
|
2671
|
+
/**
|
|
2672
|
+
* 当前是否已「固定」到宿主页面(下沉占宽)。**受控**:SDK 只用它决定图标与
|
|
2673
|
+
* `aria-pressed`,自身布局与样式一概不因它改变——悬浮/下沉的容器归宿主外壳(FR-16.2)。
|
|
2674
|
+
*/
|
|
2675
|
+
docked?: boolean;
|
|
2676
|
+
/**
|
|
2677
|
+
* 用户请求切换固定态(FR-16.1)。宿主不接就不渲染这个按钮。
|
|
2678
|
+
* 入参是用户**请求切换到**的目标态;宿主改完布局后把新的 `docked` 传回来。
|
|
2679
|
+
*/
|
|
2680
|
+
onDock?(next: boolean): void;
|
|
2681
|
+
/**
|
|
2682
|
+
* 用户请求关闭对话框(FR-16.3)。宿主不接就不渲染这个按钮。
|
|
2683
|
+
* SDK 只发出意图,不卸载自己、不清理任何状态。
|
|
2684
|
+
*/
|
|
2685
|
+
onClose?(): void;
|
|
2486
2686
|
/**
|
|
2487
2687
|
* 装配完成后把引擎交给宿主,用于接线跨界面动作(例如 console 的快照恢复入口
|
|
2488
2688
|
* 需要调 `engine.resume(runId)`)。每次重新装配都会再调一次。
|
|
@@ -2494,7 +2694,7 @@ interface ChatbotProps {
|
|
|
2494
2694
|
* presentation shell and accessible thread primitives.
|
|
2495
2695
|
* @stable
|
|
2496
2696
|
*/
|
|
2497
|
-
declare function Chatbot({ adapter, config, locale: localeProp, theme: themeProp, renderer: rendererProp, dictationLang: dictationLangProp, surfaceRegistry, layout, onOpenSettings, onEngineReady }: ChatbotProps): import("react").JSX.Element;
|
|
2697
|
+
declare function Chatbot({ adapter, config, locale: localeProp, theme: themeProp, renderer: rendererProp, dictationLang: dictationLangProp, surfaceRegistry, layout, sessionList, onOpenSettings, docked, onDock, onClose, onEngineReady }: ChatbotProps): import("react").JSX.Element;
|
|
2498
2698
|
//#endregion
|
|
2499
2699
|
//#region src/react/A2uiSurfaceHost.d.ts
|
|
2500
2700
|
/** @experimental */
|
|
@@ -2678,6 +2878,6 @@ declare function ErrorCard({ code, message, loopLimits, onOpenSettings, onDismis
|
|
|
2678
2878
|
* Version of the published `@webskill/chatbot` package, injected at build time.
|
|
2679
2879
|
* @stable
|
|
2680
2880
|
*/
|
|
2681
|
-
declare const CHATBOT_VERSION = "0.
|
|
2881
|
+
declare const CHATBOT_VERSION = "0.10.0";
|
|
2682
2882
|
//#endregion
|
|
2683
|
-
export { A2uiSurfaceHost, type A2uiSurfaceHostProps, A2uiSurfaceSnapshotHost, type A2uiSurfaceSnapshotHostProps, type AppearanceChange, CHATBOT_VERSION, type ChatAttachmentInput, type ChatAttachmentMeta, ChatEngine, type ChatEngineOptions, type ChatEvent, type ChatInteractionRecord, type ChatLayout, type ChatMessage, type ChatRunPhase, type ChatSessionListResult, type ChatSessionMeta, type ChatTheme, type ChatThinking, type ChatTokenUsage, 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, isLlmEntryUsable, pickUsableLlmEntry, probeA2uiAvailability, probeOpenUiAvailability, sandboxExecutorDeps, useT };
|
|
2883
|
+
export { A2uiSurfaceHost, type A2uiSurfaceHostProps, A2uiSurfaceSnapshotHost, type A2uiSurfaceSnapshotHostProps, type AppearanceChange, CHATBOT_VERSION, type ChatAttachmentInput, type ChatAttachmentMeta, type ChatContentPart, ChatEngine, type ChatEngineOptions, type ChatEvent, type ChatInteractionRecord, type ChatLayout, type ChatMessage, type ChatRunPhase, type ChatSessionListResult, type ChatSessionMeta, type ChatTheme, type ChatThinking, type ChatTokenUsage, 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, type LocalizedText, OpenUiSurfaceHost, type OpenUiSurfaceHostProps, OpenUiSurfaceSnapshotHost, type OpenUiSurfaceSnapshotHostProps, type QuickPrompt, type QuickPromptIconName, type RendererCapability, type RendererKind, type ResolvedChatLayout, ResultBlockList, type ResultBlockListProps, ResultBlocksPro, type ResultBlocksProProps, type RunSnapshot, type RuntimeAppearanceConfig, type RuntimeConfig, type RuntimeConfigStore, type RuntimeQuickPrompt, type RuntimeRendererId, type SandboxExecutorDeps, type SettingsSectionId, SkillBadges, SpecInteraction, type SpecInteractionProps, VercelPayloadPreview, type VercelPayloadPreviewProps, VercelSurfaceHost, type VercelSurfaceHostProps, VercelSurfaceSnapshotHost, type VercelSurfaceSnapshotHostProps, chatbotDictionary, configureA2uiMarkdown, createLocalStorageRuntimeConfigStore, createMemoryRuntimeConfigStore, isLlmEntryUsable, pickUsableLlmEntry, probeA2uiAvailability, probeOpenUiAvailability, sandboxExecutorDeps, useT };
|