@webskill/chatbot 0.9.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 +11 -5
- package/dist/index.d.ts +121 -51
- package/dist/index.js +481 -252
- package/package.json +3 -2
package/dist/chatbot.css
CHANGED
|
@@ -1170,6 +1170,9 @@
|
|
|
1170
1170
|
.pb-1 {
|
|
1171
1171
|
padding-bottom: var(--spacing);
|
|
1172
1172
|
}
|
|
1173
|
+
.pb-2 {
|
|
1174
|
+
padding-bottom: calc(var(--spacing) * 2);
|
|
1175
|
+
}
|
|
1173
1176
|
.pb-3 {
|
|
1174
1177
|
padding-bottom: calc(var(--spacing) * 3);
|
|
1175
1178
|
}
|
|
@@ -1718,11 +1721,6 @@
|
|
|
1718
1721
|
.disabled\:opacity-60:disabled {
|
|
1719
1722
|
opacity: 60%;
|
|
1720
1723
|
}
|
|
1721
|
-
@media (hover: hover) {
|
|
1722
|
-
.disabled\:hover\:bg-transparent:disabled:hover {
|
|
1723
|
-
background-color: transparent;
|
|
1724
|
-
}
|
|
1725
|
-
}
|
|
1726
1724
|
.has-disabled\:cursor-not-allowed:has(:disabled) {
|
|
1727
1725
|
cursor: not-allowed;
|
|
1728
1726
|
}
|
|
@@ -2497,9 +2495,17 @@
|
|
|
2497
2495
|
text-align: left;
|
|
2498
2496
|
vertical-align: middle;
|
|
2499
2497
|
}
|
|
2498
|
+
.webskill-surface__table-header th {
|
|
2499
|
+
border-inline-end: 0;
|
|
2500
|
+
border-bottom: 0;
|
|
2501
|
+
box-shadow: inset -1px -1px 0 0 var(--color-border);
|
|
2502
|
+
}
|
|
2500
2503
|
.webskill-surface__table-header th:last-child, .webskill-surface__table-body td:last-child {
|
|
2501
2504
|
border-inline-end: 0;
|
|
2502
2505
|
}
|
|
2506
|
+
.webskill-surface__table-header th:last-child {
|
|
2507
|
+
box-shadow: inset 0 -1px 0 0 var(--color-border);
|
|
2508
|
+
}
|
|
2503
2509
|
.webskill-surface__table-header button {
|
|
2504
2510
|
width: 100%;
|
|
2505
2511
|
border-radius: 0;
|
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
|
}
|
|
@@ -677,23 +739,6 @@ type ChatEvent = {
|
|
|
677
739
|
message: string;
|
|
678
740
|
code?: string;
|
|
679
741
|
};
|
|
680
|
-
/**
|
|
681
|
-
* 快捷指令可选图标名(0.12.0 分册 21)。
|
|
682
|
-
* 用受控枚举而不是让宿主传组件:SDK 的图标集不进公开契约,
|
|
683
|
-
* 换实现(lucide → 别的)时宿主代码不用动。
|
|
684
|
-
* @experimental
|
|
685
|
-
*/
|
|
686
|
-
type QuickPromptIconName = 'chart' | 'document' | 'report' | 'search' | 'list' | 'bug' | 'test' | 'metric' | 'compare' | 'page' | 'run' | 'warn' | 'sparkles' | 'settings';
|
|
687
|
-
/**
|
|
688
|
-
* 带图标的快捷指令(0.12.0 分册 21)。
|
|
689
|
-
* @experimental
|
|
690
|
-
*/
|
|
691
|
-
interface QuickPrompt {
|
|
692
|
-
/** 点击后发出的文本,同时作为按钮可见文案 */
|
|
693
|
-
text: string;
|
|
694
|
-
/** 缺省或取值不在枚举内时按无图标渲染 */
|
|
695
|
-
icon?: QuickPromptIconName;
|
|
696
|
-
}
|
|
697
742
|
/** @stable */
|
|
698
743
|
interface ChatbotConfig {
|
|
699
744
|
/** header 标题,默认 'WebSkill Chat' */
|
|
@@ -711,8 +756,23 @@ interface ChatbotConfig {
|
|
|
711
756
|
* renderResult/sandbox/llm 映射;与 console Configure Tab 共用同一 store(宿主接线)
|
|
712
757
|
*/
|
|
713
758
|
runtimeConfig?: RuntimeConfigStore;
|
|
714
|
-
/**
|
|
759
|
+
/**
|
|
760
|
+
* WelcomeScreen 快捷 prompt 的**一次性种子**(0.13.0 分册 21 FR-21.5);给字符串即无图标、不分语种。
|
|
761
|
+
*
|
|
762
|
+
* 接了 `runtimeConfig` 时,本字段只在该存储**从未种子化过**时被注入一次
|
|
763
|
+
* (之后 `RuntimeConfig.quickPrompts` 是唯一权威,console 的「快捷指令」页改的就是它);
|
|
764
|
+
* 用户在 console 里删光清单后本字段**不会**自行回填,除非用户点「恢复宿主默认」。
|
|
765
|
+
* 未接 `runtimeConfig` 的宿主上,本字段仍是直接的静态清单。
|
|
766
|
+
*/
|
|
715
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)[];
|
|
716
776
|
/**
|
|
717
777
|
* 开启后模型多一个 `render_ui` 工具,可面向 AI Component Catalog 直接生成声明式 UI。
|
|
718
778
|
* 默认关:工具描述 + 入参 schema 约 34 KB,会计入每一次请求。
|
|
@@ -787,6 +847,13 @@ interface ChatbotHostAdapter {
|
|
|
787
847
|
linkedDocuments?: LinkedDocumentReader;
|
|
788
848
|
/** docx → 文本(`extractDocxText`);不注入即 Word 文档明确报「本环境不支持」 */
|
|
789
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;
|
|
790
857
|
/** 文档读取留痕出口(FR-22.6) */
|
|
791
858
|
documentAudit?: {
|
|
792
859
|
append(event: {
|
|
@@ -1123,6 +1190,9 @@ declare const chatbotDictionary: {
|
|
|
1123
1190
|
'app.title': string;
|
|
1124
1191
|
'header.sessions': string;
|
|
1125
1192
|
'header.settings': string;
|
|
1193
|
+
'header.dock': string;
|
|
1194
|
+
'header.undock': string;
|
|
1195
|
+
'header.close': string;
|
|
1126
1196
|
'header.console': string;
|
|
1127
1197
|
'header.theme.light': string;
|
|
1128
1198
|
'header.theme.dark': string;
|
|
@@ -1168,10 +1238,7 @@ declare const chatbotDictionary: {
|
|
|
1168
1238
|
'welcome.capability.transparency.title': string;
|
|
1169
1239
|
'welcome.capability.transparency.description': string;
|
|
1170
1240
|
'welcome.quickPrompts': string;
|
|
1171
|
-
'welcome.
|
|
1172
|
-
'welcome.prompt.2': string;
|
|
1173
|
-
'welcome.prompt.3': string;
|
|
1174
|
-
'welcome.prompt.4': string;
|
|
1241
|
+
'welcome.dynamicPrompts': string;
|
|
1175
1242
|
'message.copy': string;
|
|
1176
1243
|
'message.copied': string;
|
|
1177
1244
|
'message.retry': string;
|
|
@@ -1326,9 +1393,6 @@ declare const chatbotDictionary: {
|
|
|
1326
1393
|
'composer.noModel.description': string;
|
|
1327
1394
|
'composer.noModel.configure': string;
|
|
1328
1395
|
'capability.group': string;
|
|
1329
|
-
'composer.pageCapture': string;
|
|
1330
|
-
'composer.pageCapture.disabled.setting': string;
|
|
1331
|
-
'composer.pageCapture.disabled.model': string;
|
|
1332
1396
|
'composer.addAttachment.imagesOff': string;
|
|
1333
1397
|
'composer.addAttachment.modelNoImages': string;
|
|
1334
1398
|
'attachment.imagesDropped': string;
|
|
@@ -1479,6 +1543,9 @@ declare const chatbotDictionary: {
|
|
|
1479
1543
|
'app.title': string;
|
|
1480
1544
|
'header.sessions': string;
|
|
1481
1545
|
'header.settings': string;
|
|
1546
|
+
'header.dock': string;
|
|
1547
|
+
'header.undock': string;
|
|
1548
|
+
'header.close': string;
|
|
1482
1549
|
'header.console': string;
|
|
1483
1550
|
'header.theme.light': string;
|
|
1484
1551
|
'header.theme.dark': string;
|
|
@@ -1524,10 +1591,7 @@ declare const chatbotDictionary: {
|
|
|
1524
1591
|
'welcome.capability.transparency.title': string;
|
|
1525
1592
|
'welcome.capability.transparency.description': string;
|
|
1526
1593
|
'welcome.quickPrompts': string;
|
|
1527
|
-
'welcome.
|
|
1528
|
-
'welcome.prompt.2': string;
|
|
1529
|
-
'welcome.prompt.3': string;
|
|
1530
|
-
'welcome.prompt.4': string;
|
|
1594
|
+
'welcome.dynamicPrompts': string;
|
|
1531
1595
|
'message.copy': string;
|
|
1532
1596
|
'message.copied': string;
|
|
1533
1597
|
'message.edit': string;
|
|
@@ -1682,9 +1746,6 @@ declare const chatbotDictionary: {
|
|
|
1682
1746
|
'composer.noModel.description': string;
|
|
1683
1747
|
'composer.noModel.configure': string;
|
|
1684
1748
|
'capability.group': string;
|
|
1685
|
-
'composer.pageCapture': string;
|
|
1686
|
-
'composer.pageCapture.disabled.setting': string;
|
|
1687
|
-
'composer.pageCapture.disabled.model': string;
|
|
1688
1749
|
'composer.addAttachment.imagesOff': string;
|
|
1689
1750
|
'composer.addAttachment.modelNoImages': string;
|
|
1690
1751
|
'attachment.imagesDropped': string;
|
|
@@ -1838,6 +1899,9 @@ declare const useT: () => TranslateFn<{
|
|
|
1838
1899
|
'app.title': string;
|
|
1839
1900
|
'header.sessions': string;
|
|
1840
1901
|
'header.settings': string;
|
|
1902
|
+
'header.dock': string;
|
|
1903
|
+
'header.undock': string;
|
|
1904
|
+
'header.close': string;
|
|
1841
1905
|
'header.console': string;
|
|
1842
1906
|
'header.theme.light': string;
|
|
1843
1907
|
'header.theme.dark': string;
|
|
@@ -1883,10 +1947,7 @@ declare const useT: () => TranslateFn<{
|
|
|
1883
1947
|
'welcome.capability.transparency.title': string;
|
|
1884
1948
|
'welcome.capability.transparency.description': string;
|
|
1885
1949
|
'welcome.quickPrompts': string;
|
|
1886
|
-
'welcome.
|
|
1887
|
-
'welcome.prompt.2': string;
|
|
1888
|
-
'welcome.prompt.3': string;
|
|
1889
|
-
'welcome.prompt.4': string;
|
|
1950
|
+
'welcome.dynamicPrompts': string;
|
|
1890
1951
|
'message.copy': string;
|
|
1891
1952
|
'message.copied': string;
|
|
1892
1953
|
'message.retry': string;
|
|
@@ -2041,9 +2102,6 @@ declare const useT: () => TranslateFn<{
|
|
|
2041
2102
|
'composer.noModel.description': string;
|
|
2042
2103
|
'composer.noModel.configure': string;
|
|
2043
2104
|
'capability.group': string;
|
|
2044
|
-
'composer.pageCapture': string;
|
|
2045
|
-
'composer.pageCapture.disabled.setting': string;
|
|
2046
|
-
'composer.pageCapture.disabled.model': string;
|
|
2047
2105
|
'composer.addAttachment.imagesOff': string;
|
|
2048
2106
|
'composer.addAttachment.modelNoImages': string;
|
|
2049
2107
|
'attachment.imagesDropped': string;
|
|
@@ -2194,6 +2252,9 @@ declare const useT: () => TranslateFn<{
|
|
|
2194
2252
|
'app.title': string;
|
|
2195
2253
|
'header.sessions': string;
|
|
2196
2254
|
'header.settings': string;
|
|
2255
|
+
'header.dock': string;
|
|
2256
|
+
'header.undock': string;
|
|
2257
|
+
'header.close': string;
|
|
2197
2258
|
'header.console': string;
|
|
2198
2259
|
'header.theme.light': string;
|
|
2199
2260
|
'header.theme.dark': string;
|
|
@@ -2239,10 +2300,7 @@ declare const useT: () => TranslateFn<{
|
|
|
2239
2300
|
'welcome.capability.transparency.title': string;
|
|
2240
2301
|
'welcome.capability.transparency.description': string;
|
|
2241
2302
|
'welcome.quickPrompts': string;
|
|
2242
|
-
'welcome.
|
|
2243
|
-
'welcome.prompt.2': string;
|
|
2244
|
-
'welcome.prompt.3': string;
|
|
2245
|
-
'welcome.prompt.4': string;
|
|
2303
|
+
'welcome.dynamicPrompts': string;
|
|
2246
2304
|
'message.copy': string;
|
|
2247
2305
|
'message.copied': string;
|
|
2248
2306
|
'message.edit': string;
|
|
@@ -2397,9 +2455,6 @@ declare const useT: () => TranslateFn<{
|
|
|
2397
2455
|
'composer.noModel.description': string;
|
|
2398
2456
|
'composer.noModel.configure': string;
|
|
2399
2457
|
'capability.group': string;
|
|
2400
|
-
'composer.pageCapture': string;
|
|
2401
|
-
'composer.pageCapture.disabled.setting': string;
|
|
2402
|
-
'composer.pageCapture.disabled.model': string;
|
|
2403
2458
|
'composer.addAttachment.imagesOff': string;
|
|
2404
2459
|
'composer.addAttachment.modelNoImages': string;
|
|
2405
2460
|
'attachment.imagesDropped': string;
|
|
@@ -2576,7 +2631,7 @@ interface AppearanceChange {
|
|
|
2576
2631
|
* 不在其中(AC-20.7 按「无未覆盖的配置类 leaf」执行,见偏差 D-15)。
|
|
2577
2632
|
* @experimental
|
|
2578
2633
|
*/
|
|
2579
|
-
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';
|
|
2580
2635
|
//#endregion
|
|
2581
2636
|
//#region src/react/useChatLayout.d.ts
|
|
2582
2637
|
/** 宿主可指定的布局档;auto 按容器尺寸判定 @stable */
|
|
@@ -2613,6 +2668,21 @@ interface ChatbotProps {
|
|
|
2613
2668
|
* `section` 可选(FR-16.5):齿轮不带分区(→ Overview),带诉求的入口(错误卡等)才传分区。
|
|
2614
2669
|
*/
|
|
2615
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;
|
|
2616
2686
|
/**
|
|
2617
2687
|
* 装配完成后把引擎交给宿主,用于接线跨界面动作(例如 console 的快照恢复入口
|
|
2618
2688
|
* 需要调 `engine.resume(runId)`)。每次重新装配都会再调一次。
|
|
@@ -2624,7 +2694,7 @@ interface ChatbotProps {
|
|
|
2624
2694
|
* presentation shell and accessible thread primitives.
|
|
2625
2695
|
* @stable
|
|
2626
2696
|
*/
|
|
2627
|
-
declare function Chatbot({ adapter, config, locale: localeProp, theme: themeProp, renderer: rendererProp, dictationLang: dictationLangProp, surfaceRegistry, layout, sessionList, 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;
|
|
2628
2698
|
//#endregion
|
|
2629
2699
|
//#region src/react/A2uiSurfaceHost.d.ts
|
|
2630
2700
|
/** @experimental */
|
|
@@ -2808,6 +2878,6 @@ declare function ErrorCard({ code, message, loopLimits, onOpenSettings, onDismis
|
|
|
2808
2878
|
* Version of the published `@webskill/chatbot` package, injected at build time.
|
|
2809
2879
|
* @stable
|
|
2810
2880
|
*/
|
|
2811
|
-
declare const CHATBOT_VERSION = "0.
|
|
2881
|
+
declare const CHATBOT_VERSION = "0.10.0";
|
|
2812
2882
|
//#endregion
|
|
2813
|
-
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, 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 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 };
|