@webskill/chatbot 0.14.0 → 0.16.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/README.md CHANGED
@@ -115,7 +115,7 @@ implementation (OPFS storage, skills, demo/model providers, console embedding).
115
115
  default `FsSessionStore` decides what you see:
116
116
 
117
117
  - Sessions are sorted by `createdAt` **ascending**, and a page is taken from the
118
- **tail** of that list. The first screen therefore holds the *newest* sessions,
118
+ **tail** of that list. The first screen therefore holds the _newest_ sessions,
119
119
  and the oldest session is not on it.
120
120
  - The page size is the store's (`FS_SESSION_PAGE_SIZE`, 50). `<Chatbot>` does
121
121
  not override it — pass your own `sessionStore` if you need another size.
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;
@@ -1536,6 +1539,7 @@ declare const chatbotDictionary: {
1536
1539
  'surface.suggested': string;
1537
1540
  'surface.useSuggestion': string;
1538
1541
  'surface.openDocument': string;
1542
+ 'surface.noOptions': string;
1539
1543
  'surface.control.previousPage': string;
1540
1544
  'surface.control.previous': string;
1541
1545
  'surface.control.nextPage': string;
@@ -1879,6 +1883,8 @@ declare const chatbotDictionary: {
1879
1883
  'interaction.pageAction.select': string;
1880
1884
  'interaction.pageAction.set': string;
1881
1885
  'interaction.pageAction.attach': string;
1886
+ 'interaction.pageAction.scroll.down': string;
1887
+ 'interaction.pageAction.scroll.up': string;
1882
1888
  'interaction.pageAction.back': string;
1883
1889
  'interaction.pageAction.role.click': string;
1884
1890
  'interaction.pageAction.role.fill': string;
@@ -1886,6 +1892,7 @@ declare const chatbotDictionary: {
1886
1892
  'interaction.pageAction.role.select': string;
1887
1893
  'interaction.pageAction.role.set': string;
1888
1894
  'interaction.pageAction.role.attach': string;
1895
+ 'interaction.pageAction.role.scroll': string;
1889
1896
  'interaction.pageAction.role.back': string;
1890
1897
  'interaction.pageAction.remember': string;
1891
1898
  'interaction.pageAction.frame': string;
@@ -1923,6 +1930,7 @@ declare const chatbotDictionary: {
1923
1930
  'surface.suggested': string;
1924
1931
  'surface.useSuggestion': string;
1925
1932
  'surface.openDocument': string;
1933
+ 'surface.noOptions': string;
1926
1934
  'surface.control.previousPage': string;
1927
1935
  'surface.control.previous': string;
1928
1936
  'surface.control.nextPage': string;
@@ -2269,6 +2277,8 @@ declare const useT: () => TranslateFn<{
2269
2277
  'interaction.pageAction.select': string;
2270
2278
  'interaction.pageAction.set': string;
2271
2279
  'interaction.pageAction.attach': string;
2280
+ 'interaction.pageAction.scroll.down': string;
2281
+ 'interaction.pageAction.scroll.up': string;
2272
2282
  'interaction.pageAction.back': string;
2273
2283
  'interaction.pageAction.role.click': string;
2274
2284
  'interaction.pageAction.role.fill': string;
@@ -2276,6 +2286,7 @@ declare const useT: () => TranslateFn<{
2276
2286
  'interaction.pageAction.role.select': string;
2277
2287
  'interaction.pageAction.role.set': string;
2278
2288
  'interaction.pageAction.role.attach': string;
2289
+ 'interaction.pageAction.role.scroll': string;
2279
2290
  'interaction.pageAction.role.back': string;
2280
2291
  'interaction.pageAction.remember': string;
2281
2292
  'interaction.pageAction.frame': string;
@@ -2313,6 +2324,7 @@ declare const useT: () => TranslateFn<{
2313
2324
  'surface.suggested': string;
2314
2325
  'surface.useSuggestion': string;
2315
2326
  'surface.openDocument': string;
2327
+ 'surface.noOptions': string;
2316
2328
  'surface.control.previousPage': string;
2317
2329
  'surface.control.previous': string;
2318
2330
  'surface.control.nextPage': string;
@@ -2656,6 +2668,8 @@ declare const useT: () => TranslateFn<{
2656
2668
  'interaction.pageAction.select': string;
2657
2669
  'interaction.pageAction.set': string;
2658
2670
  'interaction.pageAction.attach': string;
2671
+ 'interaction.pageAction.scroll.down': string;
2672
+ 'interaction.pageAction.scroll.up': string;
2659
2673
  'interaction.pageAction.back': string;
2660
2674
  'interaction.pageAction.role.click': string;
2661
2675
  'interaction.pageAction.role.fill': string;
@@ -2663,6 +2677,7 @@ declare const useT: () => TranslateFn<{
2663
2677
  'interaction.pageAction.role.select': string;
2664
2678
  'interaction.pageAction.role.set': string;
2665
2679
  'interaction.pageAction.role.attach': string;
2680
+ 'interaction.pageAction.role.scroll': string;
2666
2681
  'interaction.pageAction.role.back': string;
2667
2682
  'interaction.pageAction.remember': string;
2668
2683
  'interaction.pageAction.frame': string;
@@ -2700,6 +2715,7 @@ declare const useT: () => TranslateFn<{
2700
2715
  'surface.suggested': string;
2701
2716
  'surface.useSuggestion': string;
2702
2717
  'surface.openDocument': string;
2718
+ 'surface.noOptions': string;
2703
2719
  'surface.control.previousPage': string;
2704
2720
  'surface.control.previous': string;
2705
2721
  'surface.control.nextPage': string;
@@ -3192,6 +3208,6 @@ declare function ErrorCard({ code, message, loopLimits, onOpenSettings, onDismis
3192
3208
  * Version of the published `@webskill/chatbot` package, injected at build time.
3193
3209
  * @stable
3194
3210
  */
3195
- declare const CHATBOT_VERSION = "0.14.0";
3211
+ declare const CHATBOT_VERSION = "0.16.0";
3196
3212
  //#endregion
3197
3213
  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}\".",
@@ -31753,6 +31756,7 @@ const chatbotDictionary = defineDictionary({
31753
31756
  "surface.suggested": "Suggested:",
31754
31757
  "surface.useSuggestion": "Use",
31755
31758
  "surface.openDocument": "Open document",
31759
+ "surface.noOptions": "No options are available for this field.",
31756
31760
  "surface.control.previousPage": "Previous page",
31757
31761
  "surface.control.previous": "Previous",
31758
31762
  "surface.control.nextPage": "Next page",
@@ -32096,6 +32100,8 @@ const chatbotDictionary = defineDictionary({
32096
32100
  "interaction.pageAction.select": "允许助手在「{target}」中选择选项吗?",
32097
32101
  "interaction.pageAction.set": "允许助手切换「{target}」吗?",
32098
32102
  "interaction.pageAction.attach": "允许助手向「{target}」附加文件吗?",
32103
+ "interaction.pageAction.scroll.down": "允许助手在「{target}」所在区域向下滚动吗?",
32104
+ "interaction.pageAction.scroll.up": "允许助手在「{target}」所在区域向上滚动吗?",
32099
32105
  "interaction.pageAction.back": "允许助手在「{target}」上返回上一页吗?",
32100
32106
  "interaction.pageAction.role.click": "这个控件",
32101
32107
  "interaction.pageAction.role.fill": "这个输入框",
@@ -32103,6 +32109,7 @@ const chatbotDictionary = defineDictionary({
32103
32109
  "interaction.pageAction.role.select": "这个选择框",
32104
32110
  "interaction.pageAction.role.set": "这个开关",
32105
32111
  "interaction.pageAction.role.attach": "这个上传控件",
32112
+ "interaction.pageAction.role.scroll": "这一块",
32106
32113
  "interaction.pageAction.role.back": "这个页面",
32107
32114
  "interaction.pageAction.remember": "以后不再询问此类操作",
32108
32115
  "interaction.pageAction.frame": "目标位于嵌入帧「{frame}」中。",
@@ -32140,6 +32147,7 @@ const chatbotDictionary = defineDictionary({
32140
32147
  "surface.suggested": "建议:",
32141
32148
  "surface.useSuggestion": "使用",
32142
32149
  "surface.openDocument": "打开文档",
32150
+ "surface.noOptions": "该字段没有可选项。",
32143
32151
  "surface.control.previousPage": "上一页",
32144
32152
  "surface.control.previous": "上一页",
32145
32153
  "surface.control.nextPage": "下一页",
@@ -33990,7 +33998,8 @@ function ChatbotSurfaceTexts({ children }) {
33990
33998
  readOnlySnapshot: t("surface.readOnlySnapshot"),
33991
33999
  suggested: t("surface.suggested"),
33992
34000
  useSuggestion: t("surface.useSuggestion"),
33993
- openDocument: t("surface.openDocument")
34001
+ openDocument: t("surface.openDocument"),
34002
+ noOptions: t("surface.noOptions")
33994
34003
  }), [t]),
33995
34004
  hostControlTexts: useMemo(() => ({
33996
34005
  previousPage: t("surface.control.previousPage"),
@@ -46154,12 +46163,14 @@ function pageActionDetails(details) {
46154
46163
  const { role, name, frame } = target;
46155
46164
  if (typeof role !== "string") return void 0;
46156
46165
  const value = record["value"];
46166
+ const direction = record["direction"];
46157
46167
  const rememberLabel = record["rememberLabel"];
46158
46168
  return {
46159
46169
  action,
46160
46170
  role,
46161
46171
  ...typeof name === "string" ? { name } : {},
46162
46172
  ...typeof value === "string" ? { value } : {},
46173
+ ...direction === "down" || direction === "up" ? { direction } : {},
46163
46174
  ...typeof frame === "string" ? { frame } : {},
46164
46175
  ...record["elevated"] === true ? { elevated: true } : {},
46165
46176
  ...record["rememberable"] === true ? { rememberable: true } : {},
@@ -46167,6 +46178,18 @@ function pageActionDetails(details) {
46167
46178
  };
46168
46179
  }
46169
46180
  /**
46181
+ * 页面操作确认卡的正文(0.18.0 设计总览 §3)。
46182
+ *
46183
+ * 活卡(`InteractionCard`)与只读回看走**同一个函数**。0.17.0 分册 19 已经写明
46184
+ * 「这份映射只能有一份」,当时只统一了入口没有合并实现;`scroll` 是第一个要
46185
+ * **按参数分岔**的动作(向下/向上),两份实现会立刻分叉成「活卡说向下、回看说滚动」。
46186
+ */
46187
+ function pageActionMessage(details, t) {
46188
+ const target = details.name ?? t(`interaction.pageAction.role.${details.action}`);
46189
+ if (details.action === "scroll") return t(`interaction.pageAction.scroll.${details.direction ?? "down"}`, { target });
46190
+ return t(`interaction.pageAction.${details.action}`, { target });
46191
+ }
46192
+ /**
46170
46193
  * 下载文件确认卡的载荷(0.14.0 分册 20)。与 `pageActionDetails` 同一条规矩:
46171
46194
  * 形状不对就整段不渲染,退回通用授权展示,不猜。
46172
46195
  */
@@ -46266,7 +46289,7 @@ function localizedAuthorizeMessage(request, t) {
46266
46289
  if (request.capability === "pageAction") {
46267
46290
  const details = pageActionDetails(request.details);
46268
46291
  if (details === void 0) return void 0;
46269
- return t(`interaction.pageAction.${details.action}`, { target: details.name ?? t(`interaction.pageAction.role.${details.action}`) });
46292
+ return pageActionMessage(details, t);
46270
46293
  }
46271
46294
  if (request.capability === "readDownloadedFile") {
46272
46295
  const details = downloadedFileDetails(request.details);
@@ -47966,9 +47989,9 @@ function ActiveInteractionCard({ request, bridge }) {
47966
47989
  /* @__PURE__ */ jsx("p", {
47967
47990
  "data-testid": "interaction-page-action",
47968
47991
  className: "text-sm text-ink",
47969
- children: t(`interaction.pageAction.${pageAction.action}`, { target: pageAction.name ?? t(`interaction.pageAction.role.${pageAction.action}`) })
47992
+ children: pageActionMessage(pageAction, t)
47970
47993
  }),
47971
- pageAction.value !== void 0 ? /* @__PURE__ */ jsx("p", {
47994
+ pageAction.value !== void 0 && pageAction.action !== "scroll" ? /* @__PURE__ */ jsx("p", {
47972
47995
  "data-testid": "interaction-page-action-value",
47973
47996
  className: "font-mono text-sm text-ink",
47974
47997
  children: pageAction.value
@@ -49264,7 +49287,7 @@ function VercelPayloadPreview({ bridge }) {
49264
49287
  * Version of the published `@webskill/chatbot` package, injected at build time.
49265
49288
  * @stable
49266
49289
  */
49267
- const CHATBOT_VERSION = "0.14.0";
49290
+ const CHATBOT_VERSION = "0.16.0";
49268
49291
 
49269
49292
  //#endregion
49270
49293
  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.14.0",
3
+ "version": "0.16.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.17.0",
29
+ "@webskill/sdk": "^0.19.0",
30
30
  "react": ">=19.0.0",
31
31
  "react-dom": ">=19.0.0",
32
32
  "zod": "^3.25.0 || ^4.0.0"