@webskill/chatbot 0.14.0 → 0.15.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 +13 -1
- package/dist/index.js +24 -4
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1492,6 +1492,8 @@ declare const chatbotDictionary: {
|
|
|
1492
1492
|
'interaction.pageAction.select': string;
|
|
1493
1493
|
'interaction.pageAction.set': string;
|
|
1494
1494
|
'interaction.pageAction.attach': string;
|
|
1495
|
+
'interaction.pageAction.scroll.down': string;
|
|
1496
|
+
'interaction.pageAction.scroll.up': string;
|
|
1495
1497
|
'interaction.pageAction.back': string;
|
|
1496
1498
|
'interaction.pageAction.role.click': string;
|
|
1497
1499
|
'interaction.pageAction.role.fill': string;
|
|
@@ -1499,6 +1501,7 @@ declare const chatbotDictionary: {
|
|
|
1499
1501
|
'interaction.pageAction.role.select': string;
|
|
1500
1502
|
'interaction.pageAction.role.set': string;
|
|
1501
1503
|
'interaction.pageAction.role.attach': string;
|
|
1504
|
+
'interaction.pageAction.role.scroll': string;
|
|
1502
1505
|
'interaction.pageAction.role.back': string;
|
|
1503
1506
|
'interaction.pageAction.remember': string;
|
|
1504
1507
|
'interaction.pageAction.frame': string;
|
|
@@ -1879,6 +1882,8 @@ declare const chatbotDictionary: {
|
|
|
1879
1882
|
'interaction.pageAction.select': string;
|
|
1880
1883
|
'interaction.pageAction.set': string;
|
|
1881
1884
|
'interaction.pageAction.attach': string;
|
|
1885
|
+
'interaction.pageAction.scroll.down': string;
|
|
1886
|
+
'interaction.pageAction.scroll.up': string;
|
|
1882
1887
|
'interaction.pageAction.back': string;
|
|
1883
1888
|
'interaction.pageAction.role.click': string;
|
|
1884
1889
|
'interaction.pageAction.role.fill': string;
|
|
@@ -1886,6 +1891,7 @@ declare const chatbotDictionary: {
|
|
|
1886
1891
|
'interaction.pageAction.role.select': string;
|
|
1887
1892
|
'interaction.pageAction.role.set': string;
|
|
1888
1893
|
'interaction.pageAction.role.attach': string;
|
|
1894
|
+
'interaction.pageAction.role.scroll': string;
|
|
1889
1895
|
'interaction.pageAction.role.back': string;
|
|
1890
1896
|
'interaction.pageAction.remember': string;
|
|
1891
1897
|
'interaction.pageAction.frame': string;
|
|
@@ -2269,6 +2275,8 @@ declare const useT: () => TranslateFn<{
|
|
|
2269
2275
|
'interaction.pageAction.select': string;
|
|
2270
2276
|
'interaction.pageAction.set': string;
|
|
2271
2277
|
'interaction.pageAction.attach': string;
|
|
2278
|
+
'interaction.pageAction.scroll.down': string;
|
|
2279
|
+
'interaction.pageAction.scroll.up': string;
|
|
2272
2280
|
'interaction.pageAction.back': string;
|
|
2273
2281
|
'interaction.pageAction.role.click': string;
|
|
2274
2282
|
'interaction.pageAction.role.fill': string;
|
|
@@ -2276,6 +2284,7 @@ declare const useT: () => TranslateFn<{
|
|
|
2276
2284
|
'interaction.pageAction.role.select': string;
|
|
2277
2285
|
'interaction.pageAction.role.set': string;
|
|
2278
2286
|
'interaction.pageAction.role.attach': string;
|
|
2287
|
+
'interaction.pageAction.role.scroll': string;
|
|
2279
2288
|
'interaction.pageAction.role.back': string;
|
|
2280
2289
|
'interaction.pageAction.remember': string;
|
|
2281
2290
|
'interaction.pageAction.frame': string;
|
|
@@ -2656,6 +2665,8 @@ declare const useT: () => TranslateFn<{
|
|
|
2656
2665
|
'interaction.pageAction.select': string;
|
|
2657
2666
|
'interaction.pageAction.set': string;
|
|
2658
2667
|
'interaction.pageAction.attach': string;
|
|
2668
|
+
'interaction.pageAction.scroll.down': string;
|
|
2669
|
+
'interaction.pageAction.scroll.up': string;
|
|
2659
2670
|
'interaction.pageAction.back': string;
|
|
2660
2671
|
'interaction.pageAction.role.click': string;
|
|
2661
2672
|
'interaction.pageAction.role.fill': string;
|
|
@@ -2663,6 +2674,7 @@ declare const useT: () => TranslateFn<{
|
|
|
2663
2674
|
'interaction.pageAction.role.select': string;
|
|
2664
2675
|
'interaction.pageAction.role.set': string;
|
|
2665
2676
|
'interaction.pageAction.role.attach': string;
|
|
2677
|
+
'interaction.pageAction.role.scroll': string;
|
|
2666
2678
|
'interaction.pageAction.role.back': string;
|
|
2667
2679
|
'interaction.pageAction.remember': string;
|
|
2668
2680
|
'interaction.pageAction.frame': string;
|
|
@@ -3192,6 +3204,6 @@ declare function ErrorCard({ code, message, loopLimits, onOpenSettings, onDismis
|
|
|
3192
3204
|
* Version of the published `@webskill/chatbot` package, injected at build time.
|
|
3193
3205
|
* @stable
|
|
3194
3206
|
*/
|
|
3195
|
-
declare const CHATBOT_VERSION = "0.
|
|
3207
|
+
declare const CHATBOT_VERSION = "0.15.0";
|
|
3196
3208
|
//#endregion
|
|
3197
3209
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -31709,6 +31709,8 @@ const chatbotDictionary = defineDictionary({
|
|
|
31709
31709
|
"interaction.pageAction.select": "Allow the assistant to select an option in “{target}”?",
|
|
31710
31710
|
"interaction.pageAction.set": "Allow the assistant to toggle “{target}”?",
|
|
31711
31711
|
"interaction.pageAction.attach": "Allow the assistant to attach a file to “{target}”?",
|
|
31712
|
+
"interaction.pageAction.scroll.down": "Allow the assistant to scroll down the area around “{target}”?",
|
|
31713
|
+
"interaction.pageAction.scroll.up": "Allow the assistant to scroll up the area around “{target}”?",
|
|
31712
31714
|
"interaction.pageAction.back": "Allow the assistant to go back to the previous page on “{target}”?",
|
|
31713
31715
|
"interaction.pageAction.role.click": "this control",
|
|
31714
31716
|
"interaction.pageAction.role.fill": "this field",
|
|
@@ -31716,6 +31718,7 @@ const chatbotDictionary = defineDictionary({
|
|
|
31716
31718
|
"interaction.pageAction.role.select": "this list",
|
|
31717
31719
|
"interaction.pageAction.role.set": "this switch",
|
|
31718
31720
|
"interaction.pageAction.role.attach": "this upload field",
|
|
31721
|
+
"interaction.pageAction.role.scroll": "this area",
|
|
31719
31722
|
"interaction.pageAction.role.back": "this page",
|
|
31720
31723
|
"interaction.pageAction.remember": "Don’t ask again for this kind of action",
|
|
31721
31724
|
"interaction.pageAction.frame": "The target is in the embedded frame \"{frame}\".",
|
|
@@ -32096,6 +32099,8 @@ const chatbotDictionary = defineDictionary({
|
|
|
32096
32099
|
"interaction.pageAction.select": "允许助手在「{target}」中选择选项吗?",
|
|
32097
32100
|
"interaction.pageAction.set": "允许助手切换「{target}」吗?",
|
|
32098
32101
|
"interaction.pageAction.attach": "允许助手向「{target}」附加文件吗?",
|
|
32102
|
+
"interaction.pageAction.scroll.down": "允许助手在「{target}」所在区域向下滚动吗?",
|
|
32103
|
+
"interaction.pageAction.scroll.up": "允许助手在「{target}」所在区域向上滚动吗?",
|
|
32099
32104
|
"interaction.pageAction.back": "允许助手在「{target}」上返回上一页吗?",
|
|
32100
32105
|
"interaction.pageAction.role.click": "这个控件",
|
|
32101
32106
|
"interaction.pageAction.role.fill": "这个输入框",
|
|
@@ -32103,6 +32108,7 @@ const chatbotDictionary = defineDictionary({
|
|
|
32103
32108
|
"interaction.pageAction.role.select": "这个选择框",
|
|
32104
32109
|
"interaction.pageAction.role.set": "这个开关",
|
|
32105
32110
|
"interaction.pageAction.role.attach": "这个上传控件",
|
|
32111
|
+
"interaction.pageAction.role.scroll": "这一块",
|
|
32106
32112
|
"interaction.pageAction.role.back": "这个页面",
|
|
32107
32113
|
"interaction.pageAction.remember": "以后不再询问此类操作",
|
|
32108
32114
|
"interaction.pageAction.frame": "目标位于嵌入帧「{frame}」中。",
|
|
@@ -46154,12 +46160,14 @@ function pageActionDetails(details) {
|
|
|
46154
46160
|
const { role, name, frame } = target;
|
|
46155
46161
|
if (typeof role !== "string") return void 0;
|
|
46156
46162
|
const value = record["value"];
|
|
46163
|
+
const direction = record["direction"];
|
|
46157
46164
|
const rememberLabel = record["rememberLabel"];
|
|
46158
46165
|
return {
|
|
46159
46166
|
action,
|
|
46160
46167
|
role,
|
|
46161
46168
|
...typeof name === "string" ? { name } : {},
|
|
46162
46169
|
...typeof value === "string" ? { value } : {},
|
|
46170
|
+
...direction === "down" || direction === "up" ? { direction } : {},
|
|
46163
46171
|
...typeof frame === "string" ? { frame } : {},
|
|
46164
46172
|
...record["elevated"] === true ? { elevated: true } : {},
|
|
46165
46173
|
...record["rememberable"] === true ? { rememberable: true } : {},
|
|
@@ -46167,6 +46175,18 @@ function pageActionDetails(details) {
|
|
|
46167
46175
|
};
|
|
46168
46176
|
}
|
|
46169
46177
|
/**
|
|
46178
|
+
* 页面操作确认卡的正文(0.18.0 设计总览 §3)。
|
|
46179
|
+
*
|
|
46180
|
+
* 活卡(`InteractionCard`)与只读回看走**同一个函数**。0.17.0 分册 19 已经写明
|
|
46181
|
+
* 「这份映射只能有一份」,当时只统一了入口没有合并实现;`scroll` 是第一个要
|
|
46182
|
+
* **按参数分岔**的动作(向下/向上),两份实现会立刻分叉成「活卡说向下、回看说滚动」。
|
|
46183
|
+
*/
|
|
46184
|
+
function pageActionMessage(details, t) {
|
|
46185
|
+
const target = details.name ?? t(`interaction.pageAction.role.${details.action}`);
|
|
46186
|
+
if (details.action === "scroll") return t(`interaction.pageAction.scroll.${details.direction ?? "down"}`, { target });
|
|
46187
|
+
return t(`interaction.pageAction.${details.action}`, { target });
|
|
46188
|
+
}
|
|
46189
|
+
/**
|
|
46170
46190
|
* 下载文件确认卡的载荷(0.14.0 分册 20)。与 `pageActionDetails` 同一条规矩:
|
|
46171
46191
|
* 形状不对就整段不渲染,退回通用授权展示,不猜。
|
|
46172
46192
|
*/
|
|
@@ -46266,7 +46286,7 @@ function localizedAuthorizeMessage(request, t) {
|
|
|
46266
46286
|
if (request.capability === "pageAction") {
|
|
46267
46287
|
const details = pageActionDetails(request.details);
|
|
46268
46288
|
if (details === void 0) return void 0;
|
|
46269
|
-
return
|
|
46289
|
+
return pageActionMessage(details, t);
|
|
46270
46290
|
}
|
|
46271
46291
|
if (request.capability === "readDownloadedFile") {
|
|
46272
46292
|
const details = downloadedFileDetails(request.details);
|
|
@@ -47966,9 +47986,9 @@ function ActiveInteractionCard({ request, bridge }) {
|
|
|
47966
47986
|
/* @__PURE__ */ jsx("p", {
|
|
47967
47987
|
"data-testid": "interaction-page-action",
|
|
47968
47988
|
className: "text-sm text-ink",
|
|
47969
|
-
children:
|
|
47989
|
+
children: pageActionMessage(pageAction, t)
|
|
47970
47990
|
}),
|
|
47971
|
-
pageAction.value !== void 0 ? /* @__PURE__ */ jsx("p", {
|
|
47991
|
+
pageAction.value !== void 0 && pageAction.action !== "scroll" ? /* @__PURE__ */ jsx("p", {
|
|
47972
47992
|
"data-testid": "interaction-page-action-value",
|
|
47973
47993
|
className: "font-mono text-sm text-ink",
|
|
47974
47994
|
children: pageAction.value
|
|
@@ -49264,7 +49284,7 @@ function VercelPayloadPreview({ bridge }) {
|
|
|
49264
49284
|
* Version of the published `@webskill/chatbot` package, injected at build time.
|
|
49265
49285
|
* @stable
|
|
49266
49286
|
*/
|
|
49267
|
-
const CHATBOT_VERSION = "0.
|
|
49287
|
+
const CHATBOT_VERSION = "0.15.0";
|
|
49268
49288
|
|
|
49269
49289
|
//#endregion
|
|
49270
49290
|
export { A2uiSurfaceHost, A2uiSurfaceSnapshotHost, CHATBOT_VERSION, ChatEngine, Chatbot, CompositeUiBridge, DEFAULT_RENDERER_CAPABILITIES, DEFAULT_RUNTIME_CONFIG_STORAGE_KEY, ErrorCard, InteractionCard, InterruptedBanner, OpenUiSurfaceHost, OpenUiSurfaceSnapshotHost, ResultBlockList, ResultBlocksPro, SkillBadges, SpecInteraction, VercelPayloadPreview, VercelSurfaceHost, VercelSurfaceSnapshotHost, chatbotDictionary, configureA2uiMarkdown, createLocalStorageRuntimeConfigStore, createMemoryRuntimeConfigStore, isLlmEntryUsable, pickUsableLlmEntry, probeA2uiAvailability, probeOpenUiAvailability, sandboxExecutorDeps, useT };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webskill/chatbot",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@a2ui/web_core": "^0.10.5",
|
|
27
27
|
"@lit/context": "^1.1.0",
|
|
28
28
|
"@openuidev/react-lang": "0.2.8",
|
|
29
|
-
"@webskill/sdk": "^0.
|
|
29
|
+
"@webskill/sdk": "^0.18.0",
|
|
30
30
|
"react": ">=19.0.0",
|
|
31
31
|
"react-dom": ">=19.0.0",
|
|
32
32
|
"zod": "^3.25.0 || ^4.0.0"
|