@webskill/chatbot 0.12.0 → 0.13.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
1
  import { AgentLoopConfig, ApprovalScope, BridgeCapabilities, DataSourceInfo, DocumentSurfaceHost, 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
- import { DownloadedFileConsent, DownloadedFileReader, PageActionPolicy, PagePerceptionPolicy, PerceptionPagingBudget, PerceptionRecord, SkillCandidateSink, TodoItem } from "@webskill/sdk/agent";
4
+ import { DownloadedFileConsent, DownloadedFileReader, PageActionPolicy, PagePerceptionPolicy, PerceptionPagingBudget, PerceptionRecord, SkillCandidateSink, TabWorksetPolicy, 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
@@ -506,6 +506,15 @@ interface ChatbotHostAdapter {
506
506
  * @experimental
507
507
  */
508
508
  pageActions?: PageActionPolicy;
509
+ /**
510
+ * 模型侧标签页控制(0.16.0 分册 12)。**不注入即三个工具不存在**。
511
+ *
512
+ * 与 `pageActions` 分开给,是因为它们的实现依赖不同:前者只需一条页面通道,
513
+ * 后者需要宿主真的能枚举与关闭标签页。但它们的**开关**是同一个:
514
+ * 策略自己以 `pageActions.enabled` 为前提,不能操作页面的会话里切页没有意义。
515
+ * @experimental
516
+ */
517
+ pageTabs?: TabWorksetPolicy;
509
518
  /**
510
519
  * 读页面链接指向的文档(分册 22)。实现住在 `@webskill/browser`,
511
520
  * 而 chatbot 不依赖它 —— 与 `pagePerception` 同一条装配规矩:宿主注入。
@@ -1483,15 +1492,19 @@ declare const chatbotDictionary: {
1483
1492
  'interaction.pageAction.select': string;
1484
1493
  'interaction.pageAction.set': string;
1485
1494
  'interaction.pageAction.attach': string;
1495
+ 'interaction.pageAction.back': string;
1486
1496
  'interaction.pageAction.role.click': string;
1487
1497
  'interaction.pageAction.role.fill': string;
1488
1498
  'interaction.pageAction.role.submit': string;
1489
1499
  'interaction.pageAction.role.select': string;
1490
1500
  'interaction.pageAction.role.set': string;
1491
1501
  'interaction.pageAction.role.attach': string;
1502
+ 'interaction.pageAction.role.back': string;
1492
1503
  'interaction.pageAction.remember': string;
1493
1504
  'interaction.pageAction.frame': string;
1494
1505
  'interaction.pageAction.elevated': string;
1506
+ 'interaction.downloadedFile.list': string;
1507
+ 'interaction.downloadedFile.read': string;
1495
1508
  'interaction.downloadedFile.file': string;
1496
1509
  'interaction.downloadedFile.remember': string;
1497
1510
  'interaction.traceEvidence.title': string;
@@ -1845,15 +1858,19 @@ declare const chatbotDictionary: {
1845
1858
  'interaction.pageAction.select': string;
1846
1859
  'interaction.pageAction.set': string;
1847
1860
  'interaction.pageAction.attach': string;
1861
+ 'interaction.pageAction.back': string;
1848
1862
  'interaction.pageAction.role.click': string;
1849
1863
  'interaction.pageAction.role.fill': string;
1850
1864
  'interaction.pageAction.role.submit': string;
1851
1865
  'interaction.pageAction.role.select': string;
1852
1866
  'interaction.pageAction.role.set': string;
1853
1867
  'interaction.pageAction.role.attach': string;
1868
+ 'interaction.pageAction.role.back': string;
1854
1869
  'interaction.pageAction.remember': string;
1855
1870
  'interaction.pageAction.frame': string;
1856
1871
  'interaction.pageAction.elevated': string;
1872
+ 'interaction.downloadedFile.list': string;
1873
+ 'interaction.downloadedFile.read': string;
1857
1874
  'interaction.downloadedFile.file': string;
1858
1875
  'interaction.downloadedFile.remember': string;
1859
1876
  'interaction.traceEvidence.title': string;
@@ -2210,15 +2227,19 @@ declare const useT: () => TranslateFn<{
2210
2227
  'interaction.pageAction.select': string;
2211
2228
  'interaction.pageAction.set': string;
2212
2229
  'interaction.pageAction.attach': string;
2230
+ 'interaction.pageAction.back': string;
2213
2231
  'interaction.pageAction.role.click': string;
2214
2232
  'interaction.pageAction.role.fill': string;
2215
2233
  'interaction.pageAction.role.submit': string;
2216
2234
  'interaction.pageAction.role.select': string;
2217
2235
  'interaction.pageAction.role.set': string;
2218
2236
  'interaction.pageAction.role.attach': string;
2237
+ 'interaction.pageAction.role.back': string;
2219
2238
  'interaction.pageAction.remember': string;
2220
2239
  'interaction.pageAction.frame': string;
2221
2240
  'interaction.pageAction.elevated': string;
2241
+ 'interaction.downloadedFile.list': string;
2242
+ 'interaction.downloadedFile.read': string;
2222
2243
  'interaction.downloadedFile.file': string;
2223
2244
  'interaction.downloadedFile.remember': string;
2224
2245
  'interaction.traceEvidence.title': string;
@@ -2572,15 +2593,19 @@ declare const useT: () => TranslateFn<{
2572
2593
  'interaction.pageAction.select': string;
2573
2594
  'interaction.pageAction.set': string;
2574
2595
  'interaction.pageAction.attach': string;
2596
+ 'interaction.pageAction.back': string;
2575
2597
  'interaction.pageAction.role.click': string;
2576
2598
  'interaction.pageAction.role.fill': string;
2577
2599
  'interaction.pageAction.role.submit': string;
2578
2600
  'interaction.pageAction.role.select': string;
2579
2601
  'interaction.pageAction.role.set': string;
2580
2602
  'interaction.pageAction.role.attach': string;
2603
+ 'interaction.pageAction.role.back': string;
2581
2604
  'interaction.pageAction.remember': string;
2582
2605
  'interaction.pageAction.frame': string;
2583
2606
  'interaction.pageAction.elevated': string;
2607
+ 'interaction.downloadedFile.list': string;
2608
+ 'interaction.downloadedFile.read': string;
2584
2609
  'interaction.downloadedFile.file': string;
2585
2610
  'interaction.downloadedFile.remember': string;
2586
2611
  'interaction.traceEvidence.title': string;
@@ -3071,6 +3096,6 @@ declare function ErrorCard({ code, message, loopLimits, onOpenSettings, onDismis
3071
3096
  * Version of the published `@webskill/chatbot` package, injected at build time.
3072
3097
  * @stable
3073
3098
  */
3074
- declare const CHATBOT_VERSION = "0.12.0";
3099
+ declare const CHATBOT_VERSION = "0.13.0";
3075
3100
  //#endregion
3076
3101
  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
@@ -10,7 +10,7 @@ import { BEHAVIOR_RECORDS_KEY, DEFAULT_LOOP_LIMITS, DEFAULT_USER_PROFILE_LIMITS,
10
10
  import { BrowserWorkerScriptExecutor, checkDictationAvailability, compressImageToBudget, createEncryptedMemoryStore, createLlmClient, deleteMemoryEncryptionKey, openMemoryEncryptionKey, probeChromeBuiltinAvailability, startDictation } from "@webskill/sdk/browser";
11
11
  import { JsonRenderSpecSurface, NativeSpecSurface, OpenUiSpecSurface, ReactBridgeState, SpecInteractionChannel, SurfaceFormTextsProvider, UiSurfaceSnapshotList, probeJsonRenderAvailability } from "@webskill/sdk/ui-react";
12
12
  import { A2UI_SPEC_FORM_PATH, collectFormScopes, createUiCatalogToolSource, fromA2uiSpecAction, fromA2uiSurfaceAction, interactionToFormModel, interactionToUiSpec, loadOpenUiPeers, loadWebSkillLitCatalog, renderMiniChart, shapeInteractionValue, toA2uiSpecMessages, toA2uiSurfaceAction, toVercelToolInvocation, uiCatalog } from "@webskill/sdk/ui";
13
- import { DownloadedFilePolicy, PAGE_ACTION_KINDS, TodoStore, createDelegationToolSource, createDownloadedFileToolSource, createPageActionToolSource, createPagePerceptionToolSource, createSkillGenerationToolSource, createTodoToolSource, withDelegationOrigin } from "@webskill/sdk/agent";
13
+ import { DownloadedFilePolicy, PAGE_ACTION_KINDS, TodoStore, createDelegationToolSource, createDownloadedFileToolSource, createPageActionToolSource, createPagePerceptionToolSource, createSkillGenerationToolSource, createTabWorksetToolSource, createTodoToolSource, withDelegationOrigin } from "@webskill/sdk/agent";
14
14
  import * as React$1 from "react";
15
15
  import React, { Children, Component, Fragment, createContext, createElement, forwardRef, isValidElement, memo, useCallback, useContext, useDeferredValue, useEffect, useEffectEvent, useId, useInsertionEffect, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
16
16
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -31683,15 +31683,19 @@ const chatbotDictionary = defineDictionary({
31683
31683
  "interaction.pageAction.select": "Allow the assistant to select an option in “{target}”?",
31684
31684
  "interaction.pageAction.set": "Allow the assistant to toggle “{target}”?",
31685
31685
  "interaction.pageAction.attach": "Allow the assistant to attach a file to “{target}”?",
31686
+ "interaction.pageAction.back": "Allow the assistant to go back to the previous page on “{target}”?",
31686
31687
  "interaction.pageAction.role.click": "this control",
31687
31688
  "interaction.pageAction.role.fill": "this field",
31688
31689
  "interaction.pageAction.role.submit": "this form",
31689
31690
  "interaction.pageAction.role.select": "this list",
31690
31691
  "interaction.pageAction.role.set": "this switch",
31691
31692
  "interaction.pageAction.role.attach": "this upload field",
31693
+ "interaction.pageAction.role.back": "this page",
31692
31694
  "interaction.pageAction.remember": "Don’t ask again for this kind of action",
31693
31695
  "interaction.pageAction.frame": "The target is in the embedded frame \"{frame}\".",
31694
31696
  "interaction.pageAction.elevated": "This dialog is outside the usual allowlist; it was opened by this task.",
31697
+ "interaction.downloadedFile.list": "Allow the assistant to see the list of files you recently downloaded?",
31698
+ "interaction.downloadedFile.read": "Allow the assistant to read this file from your downloads?",
31695
31699
  "interaction.downloadedFile.file": "{name} · {size}",
31696
31700
  "interaction.downloadedFile.remember": "Don’t ask again for this kind of access",
31697
31701
  "interaction.traceEvidence.title": "Steps this skill claims",
@@ -32045,15 +32049,19 @@ const chatbotDictionary = defineDictionary({
32045
32049
  "interaction.pageAction.select": "允许助手在「{target}」中选择选项吗?",
32046
32050
  "interaction.pageAction.set": "允许助手切换「{target}」吗?",
32047
32051
  "interaction.pageAction.attach": "允许助手向「{target}」附加文件吗?",
32052
+ "interaction.pageAction.back": "允许助手在「{target}」上返回上一页吗?",
32048
32053
  "interaction.pageAction.role.click": "这个控件",
32049
32054
  "interaction.pageAction.role.fill": "这个输入框",
32050
32055
  "interaction.pageAction.role.submit": "这个表单",
32051
32056
  "interaction.pageAction.role.select": "这个选择框",
32052
32057
  "interaction.pageAction.role.set": "这个开关",
32053
32058
  "interaction.pageAction.role.attach": "这个上传控件",
32059
+ "interaction.pageAction.role.back": "这个页面",
32054
32060
  "interaction.pageAction.remember": "以后不再询问此类操作",
32055
32061
  "interaction.pageAction.frame": "目标位于嵌入帧「{frame}」中。",
32056
32062
  "interaction.pageAction.elevated": "该对话框不在常规允许清单内,是本次任务打开的。",
32063
+ "interaction.downloadedFile.list": "允许助手查看你最近下载的文件列表吗?",
32064
+ "interaction.downloadedFile.read": "允许助手读取你下载目录里的这份文件吗?",
32057
32065
  "interaction.downloadedFile.file": "{name} · {size}",
32058
32066
  "interaction.downloadedFile.remember": "以后不再询问此类访问",
32059
32067
  "interaction.traceEvidence.title": "该技能声称的步骤",
@@ -33102,9 +33110,21 @@ var ChatEngine = class {
33102
33110
  await this.#finishRun(sessionId, result);
33103
33111
  } catch (e) {
33104
33112
  this.#emitError(e);
33113
+ } finally {
33114
+ this.#releaseTabWorkset();
33105
33115
  }
33106
33116
  }
33107
33117
  /**
33118
+ * run 结束就丢掉标签页工作集(0.16.0 FR-11.4 / FR-12.7)。
33119
+ *
33120
+ * 放在 `finally` 而不是 `#finishRun` 里:完成、失败、中断、取消四条路径必须清得一样干净,
33121
+ * 而异常路径根本不经过 `#finishRun`——漏一条就是让上一轮的句柄活到下一轮,
33122
+ * 那正是 SC-2 要堵的口子。它**不关闭任何标签页**:模型开出来的页归用户处置。
33123
+ */
33124
+ #releaseTabWorkset() {
33125
+ Promise.resolve(this.#adapter.pageTabs?.reset()).catch(() => void 0);
33126
+ }
33127
+ /**
33108
33128
  * 本轮触发消息里的附件,包成只对这一次 run 生效的读取端口(0.15.0 分册 17)。
33109
33129
  * 开关关着就返回 undefined → 脚本上下文里那两个成员整个不存在,
33110
33130
  * 与「本轮没传附件」(空数组)分得开。
@@ -33233,6 +33253,8 @@ var ChatEngine = class {
33233
33253
  await this.#finishRun(sessionId, result);
33234
33254
  } catch (e) {
33235
33255
  this.#emitError(e);
33256
+ } finally {
33257
+ this.#releaseTabWorkset();
33236
33258
  }
33237
33259
  }
33238
33260
  async #persistSurfaceDraft(runId, surfaceId, value) {
@@ -33541,6 +33563,7 @@ var ChatEngine = class {
33541
33563
  }
33542
33564
  })] : [],
33543
33565
  ...this.#adapter.pageActions ? [createPageActionToolSource({ policy: this.#adapter.pageActions })] : [],
33566
+ ...this.#adapter.pageTabs ? [createTabWorksetToolSource({ policy: this.#adapter.pageTabs })] : [],
33544
33567
  ...this.#adapter.downloads ? [createDownloadedFileToolSource({ policy: new DownloadedFilePolicy({
33545
33568
  reader: this.#adapter.downloads.reader,
33546
33569
  ui: this.#uiBridge,
@@ -45860,6 +45883,14 @@ function InlineBlocks() {
45860
45883
 
45861
45884
  //#endregion
45862
45885
  //#region src/react/interactionLabels.ts
45886
+ /**
45887
+ * 这两类的次要按钮是「不同意」而非「中止这次运行」(UI-UX8 D14):
45888
+ * 报成 cancelled 会让运行整个结束,工具拿不到否决结果,也就不会留下否决的审计。
45889
+ * native 卡与 spec 三档共用本判定,不得各写一份(分册 15 缺陷 C 就是两份逐渐走歧)。
45890
+ */
45891
+ function declinesOnCancel(request) {
45892
+ return request.type === "confirm" || request.type === "authorize";
45893
+ }
45863
45894
  /** 交互类型 → 标题字典键。徽章与声明树共用,避免两处各写一份映射。 */
45864
45895
  function interactionTitleKey(request) {
45865
45896
  return request.type === "file-pick" ? "interaction.filePick.title" : `interaction.${request.type}.title`;
@@ -47490,7 +47521,8 @@ function ActiveInteractionCard({ request, bridge }) {
47490
47521
  const pageAction = isAuthorize && request.capability === "pageAction" ? pageActionDetails(request.details) : void 0;
47491
47522
  const downloadedFile = isAuthorize && request.capability === "readDownloadedFile" ? downloadedFileDetails(request.details) : void 0;
47492
47523
  const traceEvidence = isAuthorize ? traceEvidenceDetails(request.details) : void 0;
47493
- const spec = interactionToUiSpec(request.type === "authorize" && pageAction !== void 0 ? {
47524
+ const localized = pageAction !== void 0 || downloadedFile !== void 0;
47525
+ const spec = interactionToUiSpec(request.type === "authorize" && localized ? {
47494
47526
  ...request,
47495
47527
  message: ""
47496
47528
  } : request, {
@@ -47500,7 +47532,7 @@ function ActiveInteractionCard({ request, bridge }) {
47500
47532
  const preview = isAuthorize && typeof request.details === "object" && request.details !== null ? request.details["preview"] : void 0;
47501
47533
  const handleAction = (event) => {
47502
47534
  if (event.intent !== "submit") {
47503
- if (request.type === "confirm" || request.type === "authorize") {
47535
+ if (declinesOnCancel(request)) {
47504
47536
  bridge.resolve({
47505
47537
  id: request.id,
47506
47538
  value: false
@@ -47604,22 +47636,30 @@ function ActiveInteractionCard({ request, bridge }) {
47604
47636
  }), pageAction.rememberLabel ?? t("interaction.pageAction.remember")]
47605
47637
  }) : null
47606
47638
  ] }) : null,
47607
- downloadedFile ? /* @__PURE__ */ jsxs(Fragment$1, { children: [downloadedFile.file ? /* @__PURE__ */ jsx("p", {
47608
- "data-testid": "interaction-downloaded-file",
47609
- className: "text-sm text-ink",
47610
- children: t("interaction.downloadedFile.file", {
47611
- name: downloadedFile.file.name,
47612
- size: formatBytes(downloadedFile.file.size)
47613
- })
47614
- }) : null, downloadedFile.rememberable === true ? /* @__PURE__ */ jsxs("label", {
47615
- className: "flex items-center gap-2 text-sm text-ink",
47616
- children: [/* @__PURE__ */ jsx("input", {
47617
- type: "checkbox",
47618
- "data-testid": "interaction-downloaded-file-remember",
47619
- checked: remember,
47620
- onChange: (event) => setRemember(event.currentTarget.checked)
47621
- }), downloadedFile.rememberLabel ?? t("interaction.downloadedFile.remember")]
47622
- }) : null] }) : null,
47639
+ downloadedFile ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
47640
+ /* @__PURE__ */ jsx("p", {
47641
+ "data-testid": "interaction-downloaded-file-action",
47642
+ className: "text-sm text-ink",
47643
+ children: t(`interaction.downloadedFile.${downloadedFile.action}`)
47644
+ }),
47645
+ downloadedFile.file ? /* @__PURE__ */ jsx("p", {
47646
+ "data-testid": "interaction-downloaded-file",
47647
+ className: "text-sm text-ink",
47648
+ children: t("interaction.downloadedFile.file", {
47649
+ name: downloadedFile.file.name,
47650
+ size: formatBytes(downloadedFile.file.size)
47651
+ })
47652
+ }) : null,
47653
+ downloadedFile.rememberable === true ? /* @__PURE__ */ jsxs("label", {
47654
+ className: "flex items-center gap-2 text-sm text-ink",
47655
+ children: [/* @__PURE__ */ jsx("input", {
47656
+ type: "checkbox",
47657
+ "data-testid": "interaction-downloaded-file-remember",
47658
+ checked: remember,
47659
+ onChange: (event) => setRemember(event.currentTarget.checked)
47660
+ }), downloadedFile.rememberLabel ?? t("interaction.downloadedFile.remember")]
47661
+ }) : null
47662
+ ] }) : null,
47623
47663
  traceEvidence ? /* @__PURE__ */ jsxs("div", {
47624
47664
  "data-testid": "interaction-trace-evidence",
47625
47665
  children: [/* @__PURE__ */ jsx("div", {
@@ -47667,7 +47707,7 @@ function ActiveInteractionCard({ request, bridge }) {
47667
47707
  }, `${step.tool}-${index}`))
47668
47708
  })]
47669
47709
  }) : null,
47670
- request.details !== void 0 && pageAction === void 0 ? /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("div", {
47710
+ request.details !== void 0 && !localized ? /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("div", {
47671
47711
  className: "mb-1 text-xs font-medium text-muted",
47672
47712
  children: t("interaction.authorize.details")
47673
47713
  }), /* @__PURE__ */ jsx("pre", {
@@ -47948,11 +47988,15 @@ function SpecInteraction({ channel, renderer }) {
47948
47988
  }, [channel, renderer]);
47949
47989
  if (!session) return null;
47950
47990
  const Surface = SURFACES[renderer];
47991
+ const { request } = session;
47951
47992
  return /* @__PURE__ */ jsx(Surface, {
47952
- surfaceId: session.request.id,
47993
+ surfaceId: request.id,
47953
47994
  spec: session.spec,
47954
47995
  actions: INTERACTION_ACTIONS,
47955
- onAction: (event) => channel.handleAction(event)
47996
+ onAction: (event) => {
47997
+ if (event.intent !== "submit" && declinesOnCancel(request)) channel.decline(request.id);
47998
+ else channel.handleAction(event);
47999
+ }
47956
48000
  });
47957
48001
  }
47958
48002
 
@@ -48861,7 +48905,7 @@ function VercelPayloadPreview({ bridge }) {
48861
48905
  * Version of the published `@webskill/chatbot` package, injected at build time.
48862
48906
  * @stable
48863
48907
  */
48864
- const CHATBOT_VERSION = "0.12.0";
48908
+ const CHATBOT_VERSION = "0.13.0";
48865
48909
 
48866
48910
  //#endregion
48867
48911
  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.12.0",
3
+ "version": "0.13.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.15.0",
29
+ "@webskill/sdk": "^0.16.0",
30
30
  "react": ">=19.0.0",
31
31
  "react-dom": ">=19.0.0",
32
32
  "zod": "^3.25.0 || ^4.0.0"