@webskill/sdk 0.18.0 → 0.20.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.
@@ -657,6 +657,27 @@ function sampleBehaviorRecords(records, limits = DEFAULT_USER_PROFILE_LIMITS) {
657
657
  */
658
658
  const PLAIN_CHAT_SYSTEM_PROMPT = "You are a helpful assistant. Answer the user's question directly and concisely. You have no tools available; do not describe or simulate tool calls.";
659
659
 
660
+ //#endregion
661
+ //#region ../runtime/src/routing/currentTimePrompt.ts
662
+ /**
663
+ * 每个 run 注入的「现在几点」。
664
+ *
665
+ * 做成提示词而不是工具是有意的:模型不会为它**自以为知道**的事去调工具——
666
+ * 问「下月 1 日」时它直接拿训练截止日期算,或者反过来开一张表单问用户今天几号。
667
+ * 两种都不是缺一个工具,是缺一个事实。日期是上下文不是动作,每轮都要,代价又是零。
668
+ *
669
+ * 时区取运行环境的(`Intl` 在 Node 与浏览器都在),因为「下月 1 日」是按用户所在时区算的。
670
+ */
671
+ function renderCurrentTimePrompt(nowIso) {
672
+ const now = new Date(nowIso);
673
+ if (Number.isNaN(now.getTime())) return "";
674
+ const { timeZone } = Intl.DateTimeFormat().resolvedOptions();
675
+ return `Current date and time: ${new Intl.DateTimeFormat("en-US", {
676
+ dateStyle: "full",
677
+ timeStyle: "long"
678
+ }).format(now)} (time zone ${timeZone}, ISO ${now.toISOString()}).\nResolve every relative date the user mentions ("tomorrow", "next month", "in three days", "how long until this deadline") against this value, and do so silently. Never ask the user what today's date is.`;
679
+ }
680
+
660
681
  //#endregion
661
682
  //#region ../runtime/src/routing/onDemandToolsHint.ts
662
683
  /**
@@ -1289,11 +1310,11 @@ var AgentLoop = class {
1289
1310
  return false;
1290
1311
  }
1291
1312
  });
1292
- const systemPrompt = this.#config.toolCallingDisabled ? PLAIN_CHAT_SYSTEM_PROMPT : [
1313
+ const systemPrompt = [this.#config.toolCallingDisabled ? PLAIN_CHAT_SYSTEM_PROMPT : [
1293
1314
  route.systemPrompt,
1294
1315
  ...externalSystemPrompts,
1295
1316
  ...hasOnDemand ? [ON_DEMAND_TOOLS_HINT] : []
1296
- ].join("\n\n");
1317
+ ].join("\n\n"), renderCurrentTimePrompt(startedAt)].filter((part) => part !== "").join("\n\n");
1297
1318
  const profileMessage = await this.#userProfileMessage(state);
1298
1319
  state.messages = [
1299
1320
  {
package/dist/browser.d.ts CHANGED
@@ -146,6 +146,32 @@ declare function extractZipWeb(fs: FileSystemProvider, data: Uint8Array, destRoo
146
146
  /** WebCrypto sha256(浏览器/Worker 通用;Node 20+ 全局 crypto 同样可用) */
147
147
  declare function sha256HexWeb(data: Uint8Array | string): Promise<string>;
148
148
  //#endregion
149
+ //#region src/skillManagement/seedSkillsFromHttp.d.ts
150
+ /**
151
+ * 把随应用发布的内置技能(`public/skills/builtin/*`)抓进技能存储(0.19.0 分册 13)。
152
+ *
153
+ * 幂等靠 `stamp`:戳存在即整体跳过,一次请求都不发。每次刷新都重写会覆盖用户
154
+ * 对内置技能的改动;反过来,改了技能内容却不改戳,已经打开过应用的浏览器永远
155
+ * 拿不到新内容——戳的递增是接入方的责任(FR-13.1 / §4)。
156
+ */
157
+ /** 技能目录名 → 该技能的文件清单。HTTP 无法列目录,清单必须显式给出。 */
158
+ type BuiltinSkillManifest = Readonly<Record<string, readonly string[]>>;
159
+ interface SeedSkillsFromHttpOptions {
160
+ manifest: BuiltinSkillManifest;
161
+ /** 幂等戳的完整路径,例如 `/skills/builtin/.seeded-v6` */
162
+ stamp: string;
163
+ /** 应用的部署前缀(vite 的 `import.meta.env.BASE_URL`);缺省 `/` */
164
+ baseUrl?: string;
165
+ /** HTTP 侧的技能根,相对 `baseUrl`;缺省 `skills/builtin` */
166
+ sourceRoot?: string;
167
+ /** 存储侧的技能根;缺省 `/skills/builtin` */
168
+ targetRoot?: string;
169
+ /** 覆盖二进制扩展名名单(不含点号,小写) */
170
+ binaryExtensions?: readonly string[];
171
+ fetch?: typeof globalThis.fetch;
172
+ }
173
+ declare function seedSkillsFromHttp(fs: FileSystemProvider, options: SeedSkillsFromHttpOptions): Promise<void>;
174
+ //#endregion
149
175
  //#region src/executor/workerScriptExecutor.d.ts
150
176
  /** 主线程持有的 Worker 最小接口(vitest 可用 loopback 替身) */
151
177
  interface WorkerLike {
@@ -1596,4 +1622,4 @@ declare function watchBlockedResources(host: ViewerBlockedHost, notice: ViewerBl
1596
1622
  /** 提示文案的单一来源;判据直接引用,不各写一份字面量 */
1597
1623
  declare function blockedMessage(origins: readonly string[]): string;
1598
1624
  //#endregion
1599
- export { type BlockedEventLike, type BridgeCapabilities, type BridgeRequest, type BridgeResponse, type BrowserHostBundle, type BrowserHostOptions, type BrowserHostOverrides, BrowserSkillManager, BrowserWorkerScriptExecutor, type CameraAvailability, type CameraOptions, type CameraSession, type CaptureFailure, type CaptureLevel, type CapturePhotoOptions, type CapturedImage, type ChromeBuiltinAvailability, ChromeBuiltinLlmClient, type CompressResult, type ConfiguredLlmClient, DEFAULT_CAMERA_MAX_DIMENSION, DEFAULT_FRAME_BUDGET, DEFAULT_MAX_VIEWER_PAYLOAD_BYTES, DOCUMENT_SURFACE_AUDIT_EVENT, DOCX_UNEXTRACTED, type DictationAvailability, type DictationOptions, type DictationSession, type DocumentLocationView, type DocumentSurfaceAudit, type DocumentSurfaceOptions, type DomPageActionExecutor, type DomPageActionOptions, type DomPerceptionReader, type DomPerceptionReaderOptions, type FetchLinkedDocumentOptions, type FrameBudget, type FrameDelivery, type FrameDispatcher, type FrameResolveContext, type FrameRouter, type FrameRouterOptions, HOST_PORT_MATRIX, type HandleKind, type HostChatbotAdapterShape, type HostConnectFacadeShape, type HostConsoleBackendShape, type HostKind, type HostSurface, type IframeSandboxOptions, IframeWorkerLike, type InspectHostWiringInput, type LlmClientConfig, type LlmEntryConfig, type MainToWorkerMessage, type OpenDocumentInput, OpfsProvider, type PageAgentHandler, type PageAgentHandlerOptions, type PageAgentReply, type PageAgentRequest, type PageAgentTargetEntry, type PageAgentTransport, type PageDocumentIdentity, type PortApplicability, type PortReport, type PortSpec, type PortStatus, type RemotePageActionExecutorOptions, type RemotePerceptionReaderOptions, type RemoteTargetRegistry, type RemoteTargetRegistryOptions, type RoleHint, SANDBOX_PAGE_SCRIPT_SOURCE, SHARD_SOFT_LIMIT, type SandboxMode, type SerializedError, type TargetResolution, TsTranspiler, type TypeScriptSupportOptions, VIEWER_SANDBOX_TOKENS, type ViewerBlockedHost, type ViewerBlockedNotice, type ViewerBlockedResult, type ViewerCspOptions, type ViewerDocument, type ViewerShellHost, type ViewerShellMount, type ViewerShellResult, WORKER_BOOTSTRAP_SOURCE, type WindowLike, type WorkerEvent, type WorkerFactory, type WorkerLike, type WorkerRequest, WorkerRuntimeClient, type WorkerRuntimeClientDeps, type WorkerRuntimeHostOverrides, type WorkerScopeLike, WorkerUiBridge, XLSX_UNEXTRACTED, blockedMessage, bridgeError, captureElementImage, capturePhoto, checkCameraAvailability, checkDictationAvailability, compressImageToBudget, createBrowserChatbotHost, createDocumentSurfaceHost, createDomPageActionExecutor, createDomPerceptionReader, createEncryptedMemoryStore, createFetchLinkedDocumentReader, createFrameRouter, createIframeWorker, createLlmClient, createPageAgentHandler, createRemotePageActionExecutor, createRemotePerceptionReader, createRemoteTargetRegistry, deleteMemoryEncryptionKey, documentKey, explainResolution, extractDocxText, extractXlsxText, extractZipWeb, generateMemoryEncryptionKey, inspectHostWiring, installWebSkillNavigator, isCapturableElement, isCaptureFailure, isEncryptedMemoryValue, isOpfsAvailable, missingPorts, openCamera, openDocumentSurface, openMemoryEncryptionKey, parseBridgeRequest, parseMainMessage, parseWorkerEvent, probeChromeBuiltinAvailability, sha256HexWeb, startDictation, startViewerShell, startWorkerRuntimeHost, viewerCspHeader, watchBlockedResources };
1625
+ export { type BlockedEventLike, type BridgeCapabilities, type BridgeRequest, type BridgeResponse, type BrowserHostBundle, type BrowserHostOptions, type BrowserHostOverrides, BrowserSkillManager, BrowserWorkerScriptExecutor, type BuiltinSkillManifest, type CameraAvailability, type CameraOptions, type CameraSession, type CaptureFailure, type CaptureLevel, type CapturePhotoOptions, type CapturedImage, type ChromeBuiltinAvailability, ChromeBuiltinLlmClient, type CompressResult, type ConfiguredLlmClient, DEFAULT_CAMERA_MAX_DIMENSION, DEFAULT_FRAME_BUDGET, DEFAULT_MAX_VIEWER_PAYLOAD_BYTES, DOCUMENT_SURFACE_AUDIT_EVENT, DOCX_UNEXTRACTED, type DictationAvailability, type DictationOptions, type DictationSession, type DocumentLocationView, type DocumentSurfaceAudit, type DocumentSurfaceOptions, type DomPageActionExecutor, type DomPageActionOptions, type DomPerceptionReader, type DomPerceptionReaderOptions, type FetchLinkedDocumentOptions, type FrameBudget, type FrameDelivery, type FrameDispatcher, type FrameResolveContext, type FrameRouter, type FrameRouterOptions, HOST_PORT_MATRIX, type HandleKind, type HostChatbotAdapterShape, type HostConnectFacadeShape, type HostConsoleBackendShape, type HostKind, type HostSurface, type IframeSandboxOptions, IframeWorkerLike, type InspectHostWiringInput, type LlmClientConfig, type LlmEntryConfig, type MainToWorkerMessage, type OpenDocumentInput, OpfsProvider, type PageAgentHandler, type PageAgentHandlerOptions, type PageAgentReply, type PageAgentRequest, type PageAgentTargetEntry, type PageAgentTransport, type PageDocumentIdentity, type PortApplicability, type PortReport, type PortSpec, type PortStatus, type RemotePageActionExecutorOptions, type RemotePerceptionReaderOptions, type RemoteTargetRegistry, type RemoteTargetRegistryOptions, type RoleHint, SANDBOX_PAGE_SCRIPT_SOURCE, SHARD_SOFT_LIMIT, type SandboxMode, type SeedSkillsFromHttpOptions, type SerializedError, type TargetResolution, TsTranspiler, type TypeScriptSupportOptions, VIEWER_SANDBOX_TOKENS, type ViewerBlockedHost, type ViewerBlockedNotice, type ViewerBlockedResult, type ViewerCspOptions, type ViewerDocument, type ViewerShellHost, type ViewerShellMount, type ViewerShellResult, WORKER_BOOTSTRAP_SOURCE, type WindowLike, type WorkerEvent, type WorkerFactory, type WorkerLike, type WorkerRequest, WorkerRuntimeClient, type WorkerRuntimeClientDeps, type WorkerRuntimeHostOverrides, type WorkerScopeLike, WorkerUiBridge, XLSX_UNEXTRACTED, blockedMessage, bridgeError, captureElementImage, capturePhoto, checkCameraAvailability, checkDictationAvailability, compressImageToBudget, createBrowserChatbotHost, createDocumentSurfaceHost, createDomPageActionExecutor, createDomPerceptionReader, createEncryptedMemoryStore, createFetchLinkedDocumentReader, createFrameRouter, createIframeWorker, createLlmClient, createPageAgentHandler, createRemotePageActionExecutor, createRemotePerceptionReader, createRemoteTargetRegistry, deleteMemoryEncryptionKey, documentKey, explainResolution, extractDocxText, extractXlsxText, extractZipWeb, generateMemoryEncryptionKey, inspectHostWiring, installWebSkillNavigator, isCapturableElement, isCaptureFailure, isEncryptedMemoryValue, isOpfsAvailable, missingPorts, openCamera, openDocumentSurface, openMemoryEncryptionKey, parseBridgeRequest, parseMainMessage, parseWorkerEvent, probeChromeBuiltinAvailability, seedSkillsFromHttp, sha256HexWeb, startDictation, startViewerShell, startWorkerRuntimeHost, viewerCspHeader, watchBlockedResources };
package/dist/browser.js CHANGED
@@ -2,10 +2,10 @@ import { n as messageOf, t as WebSkillError } from "./errors-BDZNpC13.js";
2
2
  import { A as SKILL_MANIFEST_FILE, D as verifySkillSignature, M as buildManifest, O as MANIFEST_EXCLUDED_FILES, P as verifyManifest, b as parseSkillMarkdown, c as unzipWithLimits, f as SKILL_PACK_FILE, i as buildCatalog, k as SKILLS_LOCKFILE, m as parseSkillPackManifest, n as SkillDiscovery, o as readResponseWithLimit, p as exportSkills, t as validateSkills, u as detectSkillArchiveShapeFromFs, w as readSkillSignature, y as isValidSkillName } from "./skill-CAJMsLod.js";
3
3
  import { a as atomicWriteText, o as isAtomicTempPath, r as resolveInsideRoot } from "./pathSecurity-B1owvJAF.js";
4
4
  import { t as assertRemoteUrlAllowed } from "./urlSafety-CiSuCJvX.js";
5
- import { a as networkPolicyLibSource, c as bridgeError, d as FsMemoryStore, g as FsRunSnapshotStore, l as parseBridgeRequest, nt as ProgressiveRouter, p as AgentLoop, r as normalizeToolError, s as UPLOAD_FILES_UNAVAILABLE, t as CapabilityApproval, u as FsArtifactStore } from "./approval-B7GW86u2.js";
5
+ import { a as networkPolicyLibSource, c as bridgeError, d as FsMemoryStore, g as FsRunSnapshotStore, l as parseBridgeRequest, nt as ProgressiveRouter, p as AgentLoop, r as normalizeToolError, s as UPLOAD_FILES_UNAVAILABLE, t as CapabilityApproval, u as FsArtifactStore } from "./approval-Bbh_Apwg.js";
6
6
  import { a as GoogleGenAiClient, o as AnthropicClient, s as OpenAiCompatibleClient, t as MockLlmClient } from "./llm-eIQNO9tr.js";
7
7
  import { n as normalizeToolContent, t as mergeCatalogEntries } from "./external-_ZRQe-V9.js";
8
- import { t as createWebSkillApi } from "./webSkillApi-DMENIqW0.js";
8
+ import { t as createWebSkillApi } from "./webSkillApi-CsvA69qk.js";
9
9
  import { a as frameLabel, i as toFrameScopes, o as frameSteps, r as toActionFrameScopes } from "./types-DOJI5YC3.js";
10
10
 
11
11
  //#region ../browser/src/fs/featureDetection.ts
@@ -927,6 +927,72 @@ var BrowserSkillManager = class {
927
927
  }
928
928
  };
929
929
 
930
+ //#endregion
931
+ //#region ../browser/src/skillManagement/seedSkillsFromHttp.ts
932
+ /** 按扩展名走 `writeBinary` 的默认名单(FR-13.2) */
933
+ const DEFAULT_BINARY_EXTENSIONS = [
934
+ "png",
935
+ "jpg",
936
+ "jpeg",
937
+ "gif",
938
+ "webp",
939
+ "ico",
940
+ "woff",
941
+ "woff2",
942
+ "ttf",
943
+ "otf",
944
+ "pdf"
945
+ ];
946
+ const trimTrailingSlash = (value) => value.replace(/\/+$/, "");
947
+ const joinUrl = (baseUrl, path) => `${baseUrl.endsWith("/") ? baseUrl : `${baseUrl}/`}${path.replace(/^\/+/, "")}`;
948
+ const extensionOf = (file) => {
949
+ const dot = file.lastIndexOf(".");
950
+ return dot === -1 ? "" : file.slice(dot + 1).toLowerCase();
951
+ };
952
+ /**
953
+ * 清掉上一版留在存储里、这一版清单已不再包含的文件。
954
+ * 只照清单重抓不够:删掉的脚本会以旧内容继续注册成工具,而 SKILL.md 已经不再提它,
955
+ * 模型拿到的是一份自相矛盾的技能。作用域严格限定在本技能目录内(FR-13.4)。
956
+ */
957
+ async function pruneStaleFiles(fs, skillRoot, files) {
958
+ const keep = new Set(files);
959
+ const walk = async (dir, prefix) => {
960
+ for (const entry of await fs.list(dir).catch(() => [])) {
961
+ const name = entry.path.slice(entry.path.lastIndexOf("/") + 1);
962
+ const rel = prefix === "" ? name : `${prefix}/${name}`;
963
+ if (entry.type === "directory") await walk(`${dir}/${name}`, rel);
964
+ else if (!keep.has(rel)) await fs.remove(`${dir}/${name}`).catch(() => void 0);
965
+ }
966
+ };
967
+ await walk(skillRoot, "");
968
+ }
969
+ async function seedSkillsFromHttp(fs, options) {
970
+ if (await fs.exists(options.stamp)) return;
971
+ const baseUrl = options.baseUrl ?? "/";
972
+ const sourceRoot = trimTrailingSlash(options.sourceRoot ?? "skills/builtin");
973
+ const targetRoot = trimTrailingSlash(options.targetRoot ?? "/skills/builtin");
974
+ const binary = new Set(options.binaryExtensions ?? DEFAULT_BINARY_EXTENSIONS);
975
+ const fetchImpl = options.fetch ?? globalThis.fetch;
976
+ for (const [skill, files] of Object.entries(options.manifest)) {
977
+ const skillRoot = `${targetRoot}/${skill}`;
978
+ await fs.mkdir(skillRoot).catch(() => void 0);
979
+ for (const file of files) {
980
+ const url = joinUrl(baseUrl, `${sourceRoot}/${skill}/${file}`);
981
+ const response = await fetchImpl(url);
982
+ if (!response.ok) throw new Error(`Builtin skill asset missing: ${url} (HTTP ${response.status})`);
983
+ if (binary.has(extensionOf(file))) {
984
+ await fs.writeBinary(`${skillRoot}/${file}`, new Uint8Array(await response.arrayBuffer()));
985
+ continue;
986
+ }
987
+ const text = await response.text();
988
+ if (file === "SKILL.md" && !text.startsWith("---")) throw new Error(`Builtin skill asset is not a SKILL.md contract: ${url}`);
989
+ await fs.writeText(`${skillRoot}/${file}`, text);
990
+ }
991
+ await pruneStaleFiles(fs, skillRoot, files);
992
+ }
993
+ await fs.writeText(options.stamp, (/* @__PURE__ */ new Date()).toISOString());
994
+ }
995
+
930
996
  //#endregion
931
997
  //#region ../browser/src/executor/iframeSandbox.ts
932
998
  const ENVELOPE = "__webskill_sandbox__";
@@ -5723,4 +5789,4 @@ function originOf(blockedURI) {
5723
5789
  }
5724
5790
 
5725
5791
  //#endregion
5726
- export { BrowserSkillManager, BrowserWorkerScriptExecutor, ChromeBuiltinLlmClient, DEFAULT_CAMERA_MAX_DIMENSION, DEFAULT_FRAME_BUDGET, DEFAULT_MAX_VIEWER_PAYLOAD_BYTES, DOCUMENT_SURFACE_AUDIT_EVENT, DOCX_UNEXTRACTED, HOST_PORT_MATRIX, IframeWorkerLike, OpfsProvider, SANDBOX_PAGE_SCRIPT_SOURCE, SHARD_SOFT_LIMIT, TsTranspiler, VIEWER_SANDBOX_TOKENS, WORKER_BOOTSTRAP_SOURCE, WorkerRuntimeClient, WorkerUiBridge, XLSX_UNEXTRACTED, blockedMessage, bridgeError, captureElementImage, capturePhoto, checkCameraAvailability, checkDictationAvailability, compressImageToBudget, createBrowserChatbotHost, createDocumentSurfaceHost, createDomPageActionExecutor, createDomPerceptionReader, createEncryptedMemoryStore, createFetchLinkedDocumentReader, createFrameRouter, createIframeWorker, createLlmClient, createPageAgentHandler, createRemotePageActionExecutor, createRemotePerceptionReader, createRemoteTargetRegistry, deleteMemoryEncryptionKey, documentKey, explainResolution, extractDocxText, extractXlsxText, extractZipWeb, generateMemoryEncryptionKey, inspectHostWiring, installWebSkillNavigator, isCapturableElement, isCaptureFailure, isEncryptedMemoryValue, isOpfsAvailable, missingPorts, openCamera, openDocumentSurface, openMemoryEncryptionKey, parseBridgeRequest, parseMainMessage, parseWorkerEvent, probeChromeBuiltinAvailability, sha256HexWeb, startDictation, startViewerShell, startWorkerRuntimeHost, viewerCspHeader, watchBlockedResources };
5792
+ export { BrowserSkillManager, BrowserWorkerScriptExecutor, ChromeBuiltinLlmClient, DEFAULT_CAMERA_MAX_DIMENSION, DEFAULT_FRAME_BUDGET, DEFAULT_MAX_VIEWER_PAYLOAD_BYTES, DOCUMENT_SURFACE_AUDIT_EVENT, DOCX_UNEXTRACTED, HOST_PORT_MATRIX, IframeWorkerLike, OpfsProvider, SANDBOX_PAGE_SCRIPT_SOURCE, SHARD_SOFT_LIMIT, TsTranspiler, VIEWER_SANDBOX_TOKENS, WORKER_BOOTSTRAP_SOURCE, WorkerRuntimeClient, WorkerUiBridge, XLSX_UNEXTRACTED, blockedMessage, bridgeError, captureElementImage, capturePhoto, checkCameraAvailability, checkDictationAvailability, compressImageToBudget, createBrowserChatbotHost, createDocumentSurfaceHost, createDomPageActionExecutor, createDomPerceptionReader, createEncryptedMemoryStore, createFetchLinkedDocumentReader, createFrameRouter, createIframeWorker, createLlmClient, createPageAgentHandler, createRemotePageActionExecutor, createRemotePerceptionReader, createRemoteTargetRegistry, deleteMemoryEncryptionKey, documentKey, explainResolution, extractDocxText, extractXlsxText, extractZipWeb, generateMemoryEncryptionKey, inspectHostWiring, installWebSkillNavigator, isCapturableElement, isCaptureFailure, isEncryptedMemoryValue, isOpfsAvailable, missingPorts, openCamera, openDocumentSurface, openMemoryEncryptionKey, parseBridgeRequest, parseMainMessage, parseWorkerEvent, probeChromeBuiltinAvailability, seedSkillsFromHttp, sha256HexWeb, startDictation, startViewerShell, startWorkerRuntimeHost, viewerCspHeader, watchBlockedResources };
@@ -82,6 +82,8 @@ interface SurfaceFormTexts {
82
82
  useSuggestion: string;
83
83
  /** `OpenDocument` 按钮的缺省文案(0.15.0 分册 13;技能的 `props.label` 优先) */
84
84
  openDocument: string;
85
+ /** select / multi-select 拿到空选项时的说明(代替一个点不动的空下拉) */
86
+ noOptions: string;
85
87
  }
86
88
  /** 可复用的部分取自 DEFAULT_INTERACTION_TEXTS,不另抄一份(AC-G10) */
87
89
  declare const DEFAULT_SURFACE_FORM_TEXTS: SurfaceFormTexts;
@@ -620,6 +622,18 @@ declare function normalizeColumnWidths(raw: readonly number[] | undefined, colum
620
622
  */
621
623
  declare function resolveColumnWidths(weights: readonly number[], available: number, minWidth: number): number[];
622
624
  //#endregion
625
+ //#region src/catalog/fieldOptions.d.ts
626
+ interface FieldOption {
627
+ label: string;
628
+ value: string | number;
629
+ }
630
+ /**
631
+ * 模型给出的选项形状五花八门:裸标量(`['January', 'February']`)、只有 `label`、
632
+ * 只有 `value`。整项丢掉的代价是下拉变空,必填字段再也交不出去,
633
+ * 所以能补的一律补齐;补不出标签的(既无 label 又无 value)才丢。
634
+ */
635
+ declare function normalizeFieldOptions(raw: unknown): FieldOption[];
636
+ //#endregion
623
637
  //#region src/catalog/presets.d.ts
624
638
  /** 场景预设名(FR-6.4) */
625
639
  type UiPresetName = 'charts' | 'cards' | 'dashboards' | 'slides' | 'reports';
@@ -969,4 +983,4 @@ interface LoadedOpenUiPeers {
969
983
  */
970
984
  declare function loadOpenUiPeers(): Promise<LoadedOpenUiPeers>;
971
985
  //#endregion
972
- export { UiActionDef as $, qualifyFieldName as $t, EvaluateFieldConditionOptions as A, buildA2uiCatalogDefinition as At, OpenUiRendererProps as B, evaluateFieldCondition as Bt, DEFAULT_INTERACTION_TEXTS as C, WEBSKILL_STYLES_CSS as Ct, DOCUMENT_COMPONENTS as D, a2uiComponentSchema as Dt, DESCRIBE_UI_PRESET_TOOL as E, ZodRuntime as Et, InteractionTexts as F, collectSpecActions as Ft, SPEC_TABLE_MIN_COLUMN_WIDTH as G, gaugePercent as Gt, PLANNED_INCREMENT as H, fromA2uiSurfaceAction as Ht, JsonRenderSpec as I, collectValues as It, SurfaceHostControlTexts as J, loadOpenUiPeers as Jt, SpecColumnMeta as K, interactionToFormModel as Kt, LoadedOpenUiPeers as L, createUiCatalogToolSource as Lt, FieldConditionResult as M, chartToTable as Mt, FormModel as N, collectFormScopes as Nt, DocumentComponentName as O, a2uiComponentShapes as Ot, InteractionSpecLabels as P, collectScopedValues as Pt, UI_PRESET_NAMES as Q, normalizeColumnWidths as Qt, MAX_CONDITION_DEPTH as R, defineUiCatalog as Rt, DEFAULT_CHART_FONT_SIZES as S, WEBSKILL_A2UI_CATALOG_ID as St, DEFAULT_SURFACE_HOST_CONTROL_TEXTS as T, WebFormBridge as Tt, RENDER_UI_TOOL as U, fromUiSurfaceActionDispatch as Ut, OpenUiRuntime as V, fromA2uiSpecAction as Vt, SPEC_TABLE_MIN_COLUMN_VAR as W, fromVercelToolResult as Wt, UI_CATALOG_PROMPT_BUDGET_BYTES as X, mountEchart as Xt, UI_CATALOG_GROUPS as Y, loadWebSkillLitCatalog as Yt, UI_PRESETS as Z, mountViewerComponents as Zt, CHART_PALETTE as _, uiCatalog as _n, VIEWER_PROPS_ATTR as _t, A2UI_SURFACE_ACTION as a, resolveColumnWidths as an, UiFormScope as at, ColumnWidthsRejection as b, ViewerComponentsHandle as bt, A2uiCatalogDefinition as c, resolveSurfaceHostControlTexts as cn, UiSpecDegradation as ct, A2uiMessage as d, toA2uiSurfaceAction as dn, UiSpecSanitization as dt, renderBlocks as en, UiCatalog as et, A2uiSpecActionEvent as f, toEchartsOption as fn, UiSpecValidation as ft, CATALOG_SCHEMA_MAX as g, toVercelToolInvocation as gn, VIEWER_FALLBACK_ATTR as gt, CATALOG_PROMPT_MAX as h, toUiSurfaceActionDispatch as hn, VIEWER_COMPONENT_ATTR as ht, A2UI_SPEC_FORM_PATH as i, resolveChartFontSizes as in, UiComponentDef as it, FieldCondition as j, chartSpecFromProps as jt, EchartHandle as k, applySuggestion as kt, A2uiCatalogHandle as l, shapeInteractionValue as ln, UiSpecDegradationCode as lt, CATALOG_BUDGET_STAGE as m, toOpenUiSpecLang as mn, VERCEL_INTERACTION_TOOL_NAME as mt, A2UI_COMMON_TYPES as n, renderMiniMarkdown as nn, UiCatalogPromptOptions as nt, A2UI_VERSION as o, resolveInteractionTexts as on, UiPreset as ot, A2uiSpecMessageOptions as p, toJsonRenderSpec as pn, UiSurfaceActionDispatch as pt, SurfaceFormTexts as q, interactionToUiSpec as qt, A2UI_SPEC_ACTION as r, renderRenderResult as rn, UiCatalogToolSourceOptions as rt, A2uiCatalogComponent as s, resolveSurfaceFormTexts as sn, UiPresetName as st, A2UI_BASIC_CATALOG_ID as t, renderMiniChart as tn, UiCatalogInput as tt, A2uiComponentShape as u, toA2uiSpecMessages as un, UiSpecIssue as ut, ChartFontSizes as v, uiPreset as vn, VercelToolInvocation as vt, DEFAULT_SURFACE_FORM_TEXTS as w, WEBSKILL_SURFACE_ACTION as wt, ControlModel as x, ViewerComponentsOptions as xt, CollectedValues as y, VercelUiBridge as yt, NormalizedColumnWidths as z, ensureStyles as zt };
986
+ export { UI_PRESET_NAMES as $, normalizeColumnWidths as $t, EvaluateFieldConditionOptions as A, applySuggestion as At, NormalizedColumnWidths as B, ensureStyles as Bt, DEFAULT_INTERACTION_TEXTS as C, WEBSKILL_A2UI_CATALOG_ID as Ct, DOCUMENT_COMPONENTS as D, ZodRuntime as Dt, DESCRIBE_UI_PRESET_TOOL as E, WebFormBridge as Et, InteractionSpecLabels as F, collectScopedValues as Ft, SPEC_TABLE_MIN_COLUMN_VAR as G, fromVercelToolResult as Gt, OpenUiRuntime as H, fromA2uiSpecAction as Ht, InteractionTexts as I, collectSpecActions as It, SurfaceFormTexts as J, interactionToUiSpec as Jt, SPEC_TABLE_MIN_COLUMN_WIDTH as K, gaugePercent as Kt, JsonRenderSpec as L, collectValues as Lt, FieldConditionResult as M, chartSpecFromProps as Mt, FieldOption as N, chartToTable as Nt, DocumentComponentName as O, a2uiComponentSchema as Ot, FormModel as P, collectFormScopes as Pt, UI_PRESETS as Q, mountViewerComponents as Qt, LoadedOpenUiPeers as R, createUiCatalogToolSource as Rt, DEFAULT_CHART_FONT_SIZES as S, ViewerComponentsOptions as St, DEFAULT_SURFACE_HOST_CONTROL_TEXTS as T, WEBSKILL_SURFACE_ACTION as Tt, PLANNED_INCREMENT as U, fromA2uiSurfaceAction as Ut, OpenUiRendererProps as V, evaluateFieldCondition as Vt, RENDER_UI_TOOL as W, fromUiSurfaceActionDispatch as Wt, UI_CATALOG_GROUPS as X, loadWebSkillLitCatalog as Xt, SurfaceHostControlTexts as Y, loadOpenUiPeers as Yt, UI_CATALOG_PROMPT_BUDGET_BYTES as Z, mountEchart as Zt, CHART_PALETTE as _, toUiSurfaceActionDispatch as _n, VIEWER_FALLBACK_ATTR as _t, A2UI_SURFACE_ACTION as a, renderRenderResult as an, UiComponentDef as at, ColumnWidthsRejection as b, uiPreset as bn, VercelUiBridge as bt, A2uiCatalogDefinition as c, resolveInteractionTexts as cn, UiPresetName as ct, A2uiMessage as d, shapeInteractionValue as dn, UiSpecIssue as dt, normalizeFieldOptions as en, UiActionDef as et, A2uiSpecActionEvent as f, toA2uiSpecMessages as fn, UiSpecSanitization as ft, CATALOG_SCHEMA_MAX as g, toOpenUiSpecLang as gn, VIEWER_COMPONENT_ATTR as gt, CATALOG_PROMPT_MAX as h, toJsonRenderSpec as hn, VERCEL_INTERACTION_TOOL_NAME as ht, A2UI_SPEC_FORM_PATH as i, renderMiniMarkdown as in, UiCatalogToolSourceOptions as it, FieldCondition as j, buildA2uiCatalogDefinition as jt, EchartHandle as k, a2uiComponentShapes as kt, A2uiCatalogHandle as l, resolveSurfaceFormTexts as ln, UiSpecDegradation as lt, CATALOG_BUDGET_STAGE as m, toEchartsOption as mn, UiSurfaceActionDispatch as mt, A2UI_COMMON_TYPES as n, renderBlocks as nn, UiCatalogInput as nt, A2UI_VERSION as o, resolveChartFontSizes as on, UiFormScope as ot, A2uiSpecMessageOptions as p, toA2uiSurfaceAction as pn, UiSpecValidation as pt, SpecColumnMeta as q, interactionToFormModel as qt, A2UI_SPEC_ACTION as r, renderMiniChart as rn, UiCatalogPromptOptions as rt, A2uiCatalogComponent as s, resolveColumnWidths as sn, UiPreset as st, A2UI_BASIC_CATALOG_ID as t, qualifyFieldName as tn, UiCatalog as tt, A2uiComponentShape as u, resolveSurfaceHostControlTexts as un, UiSpecDegradationCode as ut, ChartFontSizes as v, toVercelToolInvocation as vn, VIEWER_PROPS_ATTR as vt, DEFAULT_SURFACE_FORM_TEXTS as w, WEBSKILL_STYLES_CSS as wt, ControlModel as x, ViewerComponentsHandle as xt, CollectedValues as y, uiCatalog as yn, VercelToolInvocation as yt, MAX_CONDITION_DEPTH as z, defineUiCatalog as zt };
package/dist/index.d.ts CHANGED
@@ -6,6 +6,6 @@ import { $ as IntegrityVerdict, $n as diffUserProfile, $t as SessionMeta, A as D
6
6
  * Version of the published `@webskill/sdk` package, injected at build time.
7
7
  * @stable
8
8
  */
9
- declare const SDK_VERSION = "0.18.0";
9
+ declare const SDK_VERSION = "0.20.0";
10
10
  //#endregion
11
11
  export { ALLOWED_TOOLS_EXCLUSION_REASON, ASK_USER_FIELD_TYPES, ASK_USER_INPUT_SCHEMA, ASK_USER_MAX_FIELDS, ASK_USER_TOOL, ASK_USER_TOOL_NAME, ATOMIC_TMP_SUFFIX_PATTERN, ATTACHMENT_TEXT_LIMIT, type ActivateLifecycleData, AgentLoop, type AgentLoopConfig, type AgentLoopDeps, AnthropicClient, type AnthropicClientConfig, type ApprovalDecision, type ApprovalScope, type ArchiveLimits, type Artifact, type ArtifactStore, type AttachmentTextInput, BEHAVIOR_RECORDS_KEY, type BehaviorRecord, type BehaviorRecordKind, type BehaviorScene, type BridgeCapabilities, type BridgeCapability, type BridgeRequest, type BridgeResponse, CapabilityApproval, type CapabilityMode, type CatalogRenderer, type ChartSpec, type ChatAttachmentKind, type CryptoKeyLike, DEFAULT_ARCHIVE_LIMITS, DEFAULT_LOOP_LIMITS, DEFAULT_MAX_DATA_SOURCE_BYTES, DEFAULT_MAX_DOCUMENT_BYTES, DEFAULT_MAX_DOCUMENT_TEXT_BYTES, DEFAULT_MAX_UPLOAD_FILE_BYTES, DEFAULT_USER_PROFILE_LIMITS, DOCX_MIME, type DataSourceInfo, type DiscoveryResult, type DocumentSurfaceHost, type DocumentSurfacePort, type DocxTextExtractor, EMPTY_USER_PROFILE, EventBus, type ExecuteLifecycleData, type ExternalSkillProvider, type ExternalToolSource, FILE_MIME_TYPES, FS_SESSION_PAGE_SIZE, type FileStat, type FileSystemProvider, type FormField, FsArtifactStore, FsMemoryStore, FsRunSnapshotStore, FsRunTraceStore, FsSessionStore, FsToolStepStore, FsTrustedKeyStore, FullDisclosureRouter, GoogleGenAiClient, type GoogleGenAiClientConfig, HookRunner, type HookRunnerOptions, IMAGE_MIME_TYPES, type InstalledSkillManifest, type IntegrityVerdict, type InteractLifecycleData, type InteractionOrigin, type InteractionPolicy, type InteractionRequest, type InteractionResponse, type JsonSchema, type LifecycleEvent, type LifecycleEventInit, type LifecycleHook, type LifecycleHookContext, type LifecycleListener, type LinkedDocumentReader, type LlmClient, type LlmCompleteInput, type LlmContentPart, type LlmMessage, type LlmResponse, type LlmStreamEvent, type LlmTokenUsage, type LlmToolCall, type LlmToolSpec, MANIFEST_EXCLUDED_FILES, MAX_TOOL_STEP_ARG_BYTES, MemoryFS, type MemoryStore, type NetworkPolicy, OpenAiCompatibleClient, type OpenAiCompatibleClientConfig, type Page, type PageQuery, type PdfTextExtractor, ProgressiveRouter, READ_LINKED_DOCUMENT_TOOL, READ_LINKED_DOCUMENT_TOOL_NAME, READ_SKILL_FILE_INPUT_SCHEMA, READ_SKILL_FILE_TOOL, READ_SKILL_FILE_TOOL_NAME, RUN_SNAPSHOT_SCHEMA_VERSION, RUN_TRACE_SCHEMA_VERSION, type RedactedArgs, type RefineUserProfileInput, type RemoteUrlPolicy, type RenderBlock, type RenderResultRequest, type RouteLifecycleData, type RouteResult, type RunLimitErrorDetails, type RunResult, type RunSnapshot, type RunSnapshotListEntry, type RunSnapshotStore, type RunTerminationReason, type RunToolCall, type RunTraceFile, type RunTraceFilter, type RunTraceMetrics, type RunTraceStore, type RunTraceSummary, type RunUploadFiles, type RunUsageSummary, type RuntimePhase, type RuntimeRun, type RuntimeSession, type RuntimeSessionHandle, SDK_VERSION, SENSITIVE_ANNOTATION, SESSION_SCHEMA_VERSION, SIGNATURE_SCHEMA_VERSION, SKILLS_LOCKFILE, SKILL_MANIFEST_FILE, SKILL_NAME_MAX_LENGTH, SKILL_NAME_PATTERN, SKILL_PACK_FILE, SKILL_SIGNATURE_FILE, SUPPORTED_DOCUMENT_MIME, type SchemaInferer, type ScriptExecutionContext, type ScriptExecutor, type SealOptions, type SealRecord, type SealResult, SerializingMemoryStore, type SessionListPage, type SessionMeta, type SessionRecord, type SessionStore, type SignatureAuditSink, type SignatureVerdict, type SkillArchiveDetection, type SkillArchiveShape, type SkillCandidateMarker, type SkillCatalog, type SkillCatalogEntry, SkillDiscovery, type SkillDocument, type SkillFailureReport, type SkillInstallSource, type SkillIntegrityGuard, type SkillIssue, type SkillLocation, type SkillManagerPort, type SkillManifest, type SkillMetadata, type SkillOutcomeReporter, type SkillPackManifest, SkillReader, type SkillRouter, type SkillScriptDescriptor, type SkillScriptSchemaSource, type SkillSignature, type SkillSource, type SkillStateGuard, type SkillSuccessReport, type SkillsLockfile, TEXT_BUDGETED_CONTENT_TYPES, TEXT_EXTENSIONS, type TerminalLifecycleData, type TextualToolContent, type TodoTraceEvent, type ToolCallContext, type ToolContent, type ToolDefinition, type ToolDisclosure, type ToolResolution, type ToolResult, type ToolStepReader, type ToolStepRecord, type ToolStepStore, type ToolStepTrust, type TraceClock, type TraceEvent, type TraceEventType, TraceRecorder, type TrustedKey, type TrustedKeyStore, UNSUPPORTED_DOCUMENT_MESSAGE, UNTRUSTED_LINE_LIMIT, UPLOAD_FILES_UNAVAILABLE, USER_PROFILE_EXPORT_VERSION, USER_PROFILE_KEY, USER_PROFILE_NO_INVENTION_RULE, USER_PROFILE_PROMPT_HEADER, USER_PROFILE_REFINE_PROMPT, type UiBridge, type UiSpecActionCapability, type UiSpecDrafts, type UiSpecEvent, type UiSpecNode, type UiSpecPatch, type UiSpecSnapshot, type UiSurfaceActionRequest, type UiSurfaceActionResponse, type UnsignedPolicy, type UnsupportedRunSnapshot, type UploadFileInfo, type UserProfile, type UserProfileEntry, type UserProfileExport, type UserProfileImportDiff, type UserProfileLimits, type ValidationReport, type VercelToolSpec, type VerifyResult, type WebSkillApi, WebSkillError, type WebSkillErrorCode, WebSkillRuntime, type WebSkillRuntimeDeps, XLSX_MIME, type XlsxTextExtractor, appendBehaviorRecords, applyUserProfileImport, assertRemoteUrlAllowed, assertSafePathSegment, atomicWriteText, bridgeError, buildCatalog, buildManifest, buildRenderResult, checkDependencyCycles, checkSkillRules, classifyAttachment, computeDigest, createScriptContext, createWebSkillApi, detectSkillArchiveShape, detectSkillArchiveShapeFromFs, diffUserProfile, escapeXml, exportSkills, exportUserProfile, extractChartSpec, extractSkillCandidate, extractTodoTraceEvents, extractUiSpecEvents, findUnpairedToolCalls, formatAttachmentText, formatSkillScriptManifest, fromVercelResult, fromVercelStreamPart, interruptedToolResult, isAtomicTempPath, isNetworkAllowed, isUnsupportedRunSnapshot, isValidSkillName, jsonRenderer, keyIdOf, listSkillScripts, mergeCatalogEntries, mergeProfileEntries, messageOf, networkPolicyLibSource, networkUrlHost, normalizeErrorCode, normalizePath, normalizeToolContent, normalizeToolError, parseBridgeRequest, parseSkillMarkdown, parseSkillPackManifest, parseUserProfileExport, partsToText, readBehaviorRecords, readProfileEntries, readResponseWithLimit, readSkillSignature, readUserProfile, redactToolStepArgs, refineUserProfile, renderAvailableSkillsXml, renderCatalogJson, renderUserProfileContext, resolveArchiveLimits, resolveInsideRoot, resolveToolName, sampleBehaviorRecords, sanitizeUntrustedLine, schemaSourceLabel, schemaToForm, scriptToolName, sealToolCallPairs, signSkill, signaturePayloadBytes, stripArchiveRoot, summarizeRunUsage, summarizeToolCalls, textParts, toBase64, toLlmToolSpec, toRecordDigests, toVercelToolSpecs, unzipWithLimits, validateSkills, validateUiSpecEvent, validateUiSpecNode, verifyManifest, verifySkillSignature, xmlRenderer };
package/dist/index.js CHANGED
@@ -3,13 +3,13 @@ import { A as SKILL_MANIFEST_FILE, C as keyIdOf, D as verifySkillSignature, E as
3
3
  import { a as atomicWriteText, i as ATOMIC_TMP_SUFFIX_PATTERN, n as normalizePath, o as isAtomicTempPath, r as resolveInsideRoot, t as assertSafePathSegment } from "./pathSecurity-B1owvJAF.js";
4
4
  import { t as assertRemoteUrlAllowed } from "./urlSafety-CiSuCJvX.js";
5
5
  import { a as TEXT_EXTENSIONS, c as formatAttachmentText, i as IMAGE_MIME_TYPES, l as UNTRUSTED_LINE_LIMIT, n as DOCX_MIME, o as XLSX_MIME, r as FILE_MIME_TYPES, s as classifyAttachment, t as ATTACHMENT_TEXT_LIMIT, u as sanitizeUntrustedLine } from "./kind-DxgS8LM-.js";
6
- import { $ as scriptToolName, A as readUserProfile, B as createScriptContext, C as TraceRecorder, D as mergeProfileEntries, E as appendBehaviorRecords, F as DEFAULT_USER_PROFILE_LIMITS, G as ASK_USER_TOOL_NAME, H as ASK_USER_INPUT_SCHEMA, I as EMPTY_USER_PROFILE, J as READ_SKILL_FILE_TOOL_NAME, K as READ_SKILL_FILE_INPUT_SCHEMA, L as SerializingMemoryStore, M as USER_PROFILE_NO_INVENTION_RULE, N as USER_PROFILE_PROMPT_HEADER, O as readBehaviorRecords, P as renderUserProfileContext, Q as schemaSourceLabel, R as EventBus, S as extractTodoTraceEvents, T as USER_PROFILE_KEY, U as ASK_USER_MAX_FIELDS, V as ASK_USER_FIELD_TYPES, W as ASK_USER_TOOL, X as formatSkillScriptManifest, Y as ALLOWED_TOOLS_EXCLUSION_REASON, Z as listSkillScripts, _ as RUN_SNAPSHOT_SCHEMA_VERSION, a as networkPolicyLibSource, at as xmlRenderer, b as MAX_TOOL_STEP_ARG_BYTES, c as bridgeError, d as FsMemoryStore, et as resolveToolName, f as WebSkillRuntime, g as FsRunSnapshotStore, h as redactToolStepArgs, i as isNetworkAllowed, it as renderAvailableSkillsXml, j as sampleBehaviorRecords, k as readProfileEntries, l as parseBridgeRequest, m as SENSITIVE_ANNOTATION, n as normalizeErrorCode, nt as ProgressiveRouter, o as networkUrlHost, p as AgentLoop, q as READ_SKILL_FILE_TOOL, r as normalizeToolError, rt as escapeXml, s as UPLOAD_FILES_UNAVAILABLE, t as CapabilityApproval, tt as toLlmToolSpec, u as FsArtifactStore, v as isUnsupportedRunSnapshot, w as BEHAVIOR_RECORDS_KEY, x as extractSkillCandidate, y as DEFAULT_LOOP_LIMITS, z as schemaToForm } from "./approval-B7GW86u2.js";
6
+ import { $ as scriptToolName, A as readUserProfile, B as createScriptContext, C as TraceRecorder, D as mergeProfileEntries, E as appendBehaviorRecords, F as DEFAULT_USER_PROFILE_LIMITS, G as ASK_USER_TOOL_NAME, H as ASK_USER_INPUT_SCHEMA, I as EMPTY_USER_PROFILE, J as READ_SKILL_FILE_TOOL_NAME, K as READ_SKILL_FILE_INPUT_SCHEMA, L as SerializingMemoryStore, M as USER_PROFILE_NO_INVENTION_RULE, N as USER_PROFILE_PROMPT_HEADER, O as readBehaviorRecords, P as renderUserProfileContext, Q as schemaSourceLabel, R as EventBus, S as extractTodoTraceEvents, T as USER_PROFILE_KEY, U as ASK_USER_MAX_FIELDS, V as ASK_USER_FIELD_TYPES, W as ASK_USER_TOOL, X as formatSkillScriptManifest, Y as ALLOWED_TOOLS_EXCLUSION_REASON, Z as listSkillScripts, _ as RUN_SNAPSHOT_SCHEMA_VERSION, a as networkPolicyLibSource, at as xmlRenderer, b as MAX_TOOL_STEP_ARG_BYTES, c as bridgeError, d as FsMemoryStore, et as resolveToolName, f as WebSkillRuntime, g as FsRunSnapshotStore, h as redactToolStepArgs, i as isNetworkAllowed, it as renderAvailableSkillsXml, j as sampleBehaviorRecords, k as readProfileEntries, l as parseBridgeRequest, m as SENSITIVE_ANNOTATION, n as normalizeErrorCode, nt as ProgressiveRouter, o as networkUrlHost, p as AgentLoop, q as READ_SKILL_FILE_TOOL, r as normalizeToolError, rt as escapeXml, s as UPLOAD_FILES_UNAVAILABLE, t as CapabilityApproval, tt as toLlmToolSpec, u as FsArtifactStore, v as isUnsupportedRunSnapshot, w as BEHAVIOR_RECORDS_KEY, x as extractSkillCandidate, y as DEFAULT_LOOP_LIMITS, z as schemaToForm } from "./approval-Bbh_Apwg.js";
7
7
  import { a as GoogleGenAiClient, c as findUnpairedToolCalls, d as partsToText, f as promptText, i as toVercelToolSpecs, l as interruptedToolResult, n as fromVercelResult, o as AnthropicClient, p as textParts, r as fromVercelStreamPart, s as OpenAiCompatibleClient, u as sealToolCallPairs } from "./llm-eIQNO9tr.js";
8
8
  import { c as DEFAULT_MAX_DOCUMENT_BYTES, d as TEXT_BUDGETED_CONTENT_TYPES, i as UNSUPPORTED_DOCUMENT_MESSAGE, l as DEFAULT_MAX_DOCUMENT_TEXT_BYTES, n as READ_LINKED_DOCUMENT_TOOL_NAME, o as toBase64, r as SUPPORTED_DOCUMENT_MIME, s as DEFAULT_MAX_DATA_SOURCE_BYTES, t as READ_LINKED_DOCUMENT_TOOL, u as DEFAULT_MAX_UPLOAD_FILE_BYTES } from "./linkedDocument-xNXF-z8n.js";
9
9
  import { n as normalizeToolContent, t as mergeCatalogEntries } from "./external-_ZRQe-V9.js";
10
10
  import { n as extractChartSpec, t as buildRenderResult } from "./renderResult-D9Q-Vu2x.js";
11
11
  import { n as validateUiSpecEvent, r as validateUiSpecNode, t as extractUiSpecEvents } from "./surface-DVGiCmwq.js";
12
- import { t as createWebSkillApi } from "./webSkillApi-DMENIqW0.js";
12
+ import { t as createWebSkillApi } from "./webSkillApi-CsvA69qk.js";
13
13
 
14
14
  //#region ../core/src/fs/memoryFs.ts
15
15
  const ROOT = "/";
@@ -1004,7 +1004,7 @@ var FsToolStepStore = class {
1004
1004
  * Version of the published `@webskill/sdk` package, injected at build time.
1005
1005
  * @stable
1006
1006
  */
1007
- const SDK_VERSION = "0.18.0";
1007
+ const SDK_VERSION = "0.20.0";
1008
1008
 
1009
1009
  //#endregion
1010
1010
  export { ALLOWED_TOOLS_EXCLUSION_REASON, ASK_USER_FIELD_TYPES, ASK_USER_INPUT_SCHEMA, ASK_USER_MAX_FIELDS, ASK_USER_TOOL, ASK_USER_TOOL_NAME, ATOMIC_TMP_SUFFIX_PATTERN, ATTACHMENT_TEXT_LIMIT, AgentLoop, AnthropicClient, BEHAVIOR_RECORDS_KEY, CapabilityApproval, DEFAULT_ARCHIVE_LIMITS, DEFAULT_LOOP_LIMITS, DEFAULT_MAX_DATA_SOURCE_BYTES, DEFAULT_MAX_DOCUMENT_BYTES, DEFAULT_MAX_DOCUMENT_TEXT_BYTES, DEFAULT_MAX_UPLOAD_FILE_BYTES, DEFAULT_USER_PROFILE_LIMITS, DOCX_MIME, EMPTY_USER_PROFILE, EventBus, FILE_MIME_TYPES, FS_SESSION_PAGE_SIZE, FsArtifactStore, FsMemoryStore, FsRunSnapshotStore, FsRunTraceStore, FsSessionStore, FsToolStepStore, FsTrustedKeyStore, FullDisclosureRouter, GoogleGenAiClient, HookRunner, IMAGE_MIME_TYPES, MANIFEST_EXCLUDED_FILES, MAX_TOOL_STEP_ARG_BYTES, MemoryFS, OpenAiCompatibleClient, ProgressiveRouter, READ_LINKED_DOCUMENT_TOOL, READ_LINKED_DOCUMENT_TOOL_NAME, READ_SKILL_FILE_INPUT_SCHEMA, READ_SKILL_FILE_TOOL, READ_SKILL_FILE_TOOL_NAME, RUN_SNAPSHOT_SCHEMA_VERSION, RUN_TRACE_SCHEMA_VERSION, SDK_VERSION, SENSITIVE_ANNOTATION, SESSION_SCHEMA_VERSION, SIGNATURE_SCHEMA_VERSION, SKILLS_LOCKFILE, SKILL_MANIFEST_FILE, SKILL_NAME_MAX_LENGTH, SKILL_NAME_PATTERN, SKILL_PACK_FILE, SKILL_SIGNATURE_FILE, SUPPORTED_DOCUMENT_MIME, SerializingMemoryStore, SkillDiscovery, SkillReader, TEXT_BUDGETED_CONTENT_TYPES, TEXT_EXTENSIONS, TraceRecorder, UNSUPPORTED_DOCUMENT_MESSAGE, UNTRUSTED_LINE_LIMIT, UPLOAD_FILES_UNAVAILABLE, USER_PROFILE_EXPORT_VERSION, USER_PROFILE_KEY, USER_PROFILE_NO_INVENTION_RULE, USER_PROFILE_PROMPT_HEADER, USER_PROFILE_REFINE_PROMPT, WebSkillError, WebSkillRuntime, XLSX_MIME, appendBehaviorRecords, applyUserProfileImport, assertRemoteUrlAllowed, assertSafePathSegment, atomicWriteText, bridgeError, buildCatalog, buildManifest, buildRenderResult, checkDependencyCycles, checkSkillRules, classifyAttachment, computeDigest, createScriptContext, createWebSkillApi, detectSkillArchiveShape, detectSkillArchiveShapeFromFs, diffUserProfile, escapeXml, exportSkills, exportUserProfile, extractChartSpec, extractSkillCandidate, extractTodoTraceEvents, extractUiSpecEvents, findUnpairedToolCalls, formatAttachmentText, formatSkillScriptManifest, fromVercelResult, fromVercelStreamPart, interruptedToolResult, isAtomicTempPath, isNetworkAllowed, isUnsupportedRunSnapshot, isValidSkillName, jsonRenderer, keyIdOf, listSkillScripts, mergeCatalogEntries, mergeProfileEntries, messageOf, networkPolicyLibSource, networkUrlHost, normalizeErrorCode, normalizePath, normalizeToolContent, normalizeToolError, parseBridgeRequest, parseSkillMarkdown, parseSkillPackManifest, parseUserProfileExport, partsToText, readBehaviorRecords, readProfileEntries, readResponseWithLimit, readSkillSignature, readUserProfile, redactToolStepArgs, refineUserProfile, renderAvailableSkillsXml, renderCatalogJson, renderUserProfileContext, resolveArchiveLimits, resolveInsideRoot, resolveToolName, sampleBehaviorRecords, sanitizeUntrustedLine, schemaSourceLabel, schemaToForm, scriptToolName, sealToolCallPairs, signSkill, signaturePayloadBytes, stripArchiveRoot, summarizeRunUsage, summarizeToolCalls, textParts, toBase64, toLlmToolSpec, toRecordDigests, toVercelToolSpecs, unzipWithLimits, validateSkills, validateUiSpecEvent, validateUiSpecNode, verifyManifest, verifySkillSignature, xmlRenderer };
package/dist/mcp.d.ts CHANGED
@@ -568,4 +568,280 @@ interface RemoteEndpointHandle {
568
568
  */
569
569
  declare function connectRemoteEndpoint(registry: EndpointRegistry<McpClientLike>, config: RemoteEndpointConfig): Promise<RemoteEndpointHandle>;
570
570
  //#endregion
571
- export { type BrowserModelContextLike, EndpointRegistry, ExperimentalWebMcpAdapter, type McpClientLike, type McpOAuthClient, type McpOAuthConfig, type McpOAuthHandshake, type McpOAuthHandshakeStore, type McpOAuthProvider, type McpOAuthStage, type McpOAuthTokenStore, type McpOAuthTokens, McpRuntimePlugin, type McpSourceTrust, type McpToolDisclosure, McpToolResolver, type McpToolVisibility, MessageChannelTransport, type MessageChannelTransportOptions, type MessagePortLike, PAGE_HOST_ANCHOR_KEY, type PageHostAnchor, type RemoteEndpointConfig, type RemoteEndpointHandle, type ServedSkill, TemporarySkillProvider, type TransportState, WEB_MCP_SOURCE_ID_MAX, type WebMcpToolDescriptor, type WebMcpToolLike, catalogMerge, connectRemoteEndpoint, createMemoryOAuthStores, createOAuthProvider, declareDataSourcesToPageHost, endpointToolLlmName, notifyPageHost, parseEndpointToolLlmName, parseWebMcpToolLlmName, serveSkillAsMcp, validateJsonRpcMessage, webMcpToolLlmName };
571
+ //#region src/pageHost/mcpVisibilityStore.d.ts
572
+ /**
573
+ * 启停与披露的状态存储(0.19.0 分册 10 · FR-10.3)。
574
+ *
575
+ * 做成注入点,是因为四份宿主的存量键各不相同:默认实现统一键形之后,
576
+ * 不接受「禁用名单不迁移」代价的接入方可以自己实现一份读旧键的。
577
+ *
578
+ * **WebMCP 工具用保留端点名 `'webmcp'`**,不再走 `webmcp:` 前缀混进同一张名单。
579
+ */
580
+ interface McpVisibilityStore {
581
+ isEndpointEnabled(endpoint: string): boolean;
582
+ setEndpointEnabled(endpoint: string, enabled: boolean): void;
583
+ isToolEnabled(endpoint: string, tool: string): boolean;
584
+ setToolEnabled(endpoint: string, tool: string, enabled: boolean): void;
585
+ toolDisclosure(endpoint: string, tool: string): McpToolDisclosure;
586
+ setToolDisclosure(endpoint: string, tool: string, value: McpToolDisclosure): void;
587
+ isWebMcpEnabled(): boolean;
588
+ setWebMcpEnabled(enabled: boolean): void;
589
+ }
590
+ /** WebMCP 在名单里占用的保留端点名 */
591
+ declare const WEB_MCP_ENDPOINT = "webmcp";
592
+ /**
593
+ * localStorage 默认实现。键形:
594
+ * `<ns>.mcp.endpoints-disabled` / `<ns>.mcp.tools-disabled` /
595
+ * `<ns>.mcp.tools-on-demand` / `<ns>.webmcp-enabled`。
596
+ *
597
+ * 名单里的工具**一律带 endpoint**(`<endpoint>/<tool>`)。旧实现存裸工具名,
598
+ * 两个端点注册同名工具时禁用其一会连坐另一个——那个缺陷在这里一次修完。
599
+ *
600
+ * 一律实时读存储、不做进程内缓存:console 改完当轮生效是既有语义。
601
+ */
602
+ declare function createLocalStorageMcpVisibility(namespace: string): McpVisibilityStore;
603
+ //#endregion
604
+ //#region src/pageHost/createPageMcpEndpoint.d.ts
605
+ /**
606
+ * 进程内 MCP 端点装配(0.19.0 分册 10)。
607
+ *
608
+ * 把页面工具与页面临时技能经**真实 MCP 通道**供给对话运行时:治理面(启停、披露)
609
+ * 因此对 chatbot 与 console 同时生效,而不是两张皮。
610
+ *
611
+ * 这段装配有三处必须写对、宿主各自手写时反复写错的地方,全部收在这里:
612
+ * (a) `MessagePort` 一经转移就归对方所有 → 每次挂载新建 `MessageChannel`;
613
+ * (b) 先建后换 → `registry.set`(不是 `register`),且新通道握手成功后才关旧的;
614
+ * (c) 串行化 → `catch` 必须在 `then` **之前**,否则一次失败会让此后每次重挂被静默跳过。
615
+ */
616
+ /** 页面工具的统一形态:裸返回值由 SDK 裹成 MCP 的 content / structuredContent */
617
+ interface PageMcpTool {
618
+ spec: LlmToolSpec;
619
+ run(args: Record<string, unknown>): Promise<unknown> | unknown;
620
+ }
621
+ type Supplier<T> = readonly T[] | (() => readonly T[]);
622
+ interface PageMcpEndpointOptions {
623
+ /** 端点名(进入 LLM 可见的工具名前缀) */
624
+ endpoint: string;
625
+ /**
626
+ * 工具清单。函数形态用于「清单随宿主状态变化」的场景;
627
+ * 每次 `serve()` 重新求值。
628
+ */
629
+ tools: Supplier<PageMcpTool>;
630
+ /** 当前该端点暴露的临时技能;换屏即换一批,用函数形态 */
631
+ skills?: Supplier<ServedSkill>;
632
+ /** 启停与披露状态;缺省用 `createLocalStorageMcpVisibility(endpoint)` */
633
+ visibility?: McpVisibilityStore;
634
+ /**
635
+ * WebMCP 通道。缺省自建一个解析 `document.modelContext ?? navigator.modelContext`
636
+ * 的适配器;`false` 显式关闭(Node 宿主、无 DOM 环境)。
637
+ */
638
+ webMcp?: ExperimentalWebMcpAdapter | readonly ExperimentalWebMcpAdapter[] | false;
639
+ /**
640
+ * 参数留存的信任声明(分册 30 / FR-30.6)。缺省不声明任何来源可信,
641
+ * 于是本端点每个工具的入参都按 `untrusted` 全量脱敏——由此生成的技能参数为空。
642
+ * 宿主自己写的页面工具若已审查过 inputSchema,显式声明 `isEndpointTrusted` 才留存。
643
+ */
644
+ trust?: McpSourceTrust;
645
+ /** 透传给 `ExternalToolSource.systemPrompt`(已有扩展点,本册不改语义) */
646
+ systemPrompt?: () => Promise<string | undefined>;
647
+ serverInfo?: {
648
+ name?: string;
649
+ version?: string;
650
+ };
651
+ clientInfo?: {
652
+ name?: string;
653
+ version?: string;
654
+ };
655
+ onWarning?: (message: string) => void;
656
+ }
657
+ interface PageMcpEndpoint {
658
+ /** 端点名(门面与 console 都要用它区分内置端点与远程端点) */
659
+ readonly endpoint: string;
660
+ readonly registry: EndpointRegistry<McpClientLike>;
661
+ readonly plugin: McpRuntimePlugin;
662
+ readonly pageSkills: TemporarySkillProvider;
663
+ /** 缺省或宿主注入的 WebMCP 适配器;`webMcp: false` 时为 undefined */
664
+ readonly webmcp: ExperimentalWebMcpAdapter | undefined;
665
+ /** 全部 WebMCP 来源(分册 26:主文档与各嵌入页各算一个,**不合并**) */
666
+ readonly webMcpSources: readonly ExperimentalWebMcpAdapter[];
667
+ /** chatbot adapter 的 pageSkillSource:工具源 + 技能提供者的合体对象 */
668
+ readonly toolSource: ExternalToolSource & ExternalSkillProvider;
669
+ readonly visibility: McpVisibilityStore;
670
+ /**
671
+ * 首次挂载完成。**失败也 resolve**:读 registry 的一侧按现状继续,
672
+ * 不能因为一次挂载失败被永久挂起。
673
+ */
674
+ readonly ready: Promise<void>;
675
+ /** 重新挂载当前工具/技能清单;幂等且串行 */
676
+ serve(): Promise<void>;
677
+ /** 关闭当前通道并从 registry 注销 */
678
+ close(): Promise<void>;
679
+ }
680
+ declare function createPageMcpEndpoint(options: PageMcpEndpointOptions): PageMcpEndpoint;
681
+ //#endregion
682
+ //#region src/pageHost/createConnectFacade.d.ts
683
+ /**
684
+ * console 连接页的门面实现(0.19.0 分册 11)。
685
+ *
686
+ * 这里**不 import `@webskill/console` 的类型**,只声明结构等价的形状:
687
+ * 让 `@webskill/mcp` 依赖 console 会倒转依赖边(console 的 peer 里已经有 sdk)。
688
+ * 代价是 console 给 `ConnectFacade` 加必填方法时这里不会红,因此
689
+ * 「宿主侧真实赋值」的守卫测试是本方案成立的前提,不是可选项(同 0.8.0 D-18)。
690
+ */
691
+ /** 结构等价于 `ConnectEndpointConfig` */
692
+ interface ConnectEndpointConfigShape {
693
+ name: string;
694
+ url: string;
695
+ transport?: 'streamable-http' | 'sse';
696
+ headers?: Record<string, string>;
697
+ allowHttp?: boolean;
698
+ allowPrivateHosts?: boolean;
699
+ oauth?: {
700
+ clientId: string;
701
+ redirectUri: string;
702
+ scopes?: string[];
703
+ };
704
+ enabled?: boolean;
705
+ disabledTools?: string[];
706
+ disclosure?: 'always' | 'on-demand';
707
+ }
708
+ /** 结构等价于 `ConnectEndpointView` */
709
+ interface ConnectEndpointViewShape {
710
+ config: ConnectEndpointConfigShape;
711
+ status: 'connected' | 'failed' | 'unavailable' | 'connecting';
712
+ error?: string;
713
+ toolCount?: number;
714
+ }
715
+ /** 结构等价于 `ConnectToolView` */
716
+ interface ConnectToolViewShape {
717
+ endpoint: string;
718
+ name: string;
719
+ description?: string;
720
+ schemaSummary?: string;
721
+ inputSchema?: unknown;
722
+ origin?: string;
723
+ annotations?: {
724
+ untrustedContentHint?: boolean;
725
+ };
726
+ enabled?: boolean;
727
+ disclosure?: 'always' | 'on-demand';
728
+ }
729
+ /** 结构等价于 `ConnectTemporarySkill` */
730
+ interface ConnectTemporarySkillShape {
731
+ name: string;
732
+ description?: string;
733
+ source?: string;
734
+ origin?: string;
735
+ }
736
+ /** 结构等价于 `ConnectTemporarySkillDetail` */
737
+ interface ConnectTemporarySkillDetailShape {
738
+ name: string;
739
+ description?: string;
740
+ source?: string;
741
+ origin?: string;
742
+ body: string;
743
+ metadata?: Record<string, unknown>;
744
+ }
745
+ /** 结构等价于 `ConnectTestResult` */
746
+ interface ConnectTestResultShape {
747
+ ok: boolean;
748
+ latencyMs: number;
749
+ error?: string;
750
+ detail?: string;
751
+ checkedAt?: string;
752
+ }
753
+ /** 结构等价于 `ConnectWebMcpSource` */
754
+ interface ConnectWebMcpSourceShape {
755
+ id?: string;
756
+ label?: string;
757
+ isAvailable(): boolean;
758
+ isEnabled(): boolean;
759
+ setEnabled(on: boolean): void;
760
+ listTools(): Promise<ConnectToolViewShape[]>;
761
+ setToolEnabled?(tool: string, enabled: boolean): void;
762
+ setToolDisclosure?(tool: string, disclosure: 'always' | 'on-demand'): void;
763
+ }
764
+ /** 结构等价于 `ConnectFacade` */
765
+ interface ConnectFacadeShape {
766
+ listEndpoints(): Promise<ConnectEndpointViewShape[]>;
767
+ addEndpoint(config: ConnectEndpointConfigShape): Promise<void>;
768
+ removeEndpoint(name: string): Promise<void>;
769
+ reconnect(name: string): Promise<void>;
770
+ listTools(): Promise<ConnectToolViewShape[]>;
771
+ testEndpoint(name: string): Promise<ConnectTestResultShape>;
772
+ temporarySkills(): Promise<ConnectTemporarySkillShape[]>;
773
+ temporarySkillDetail?(name: string, origin?: string): Promise<ConnectTemporarySkillDetailShape>;
774
+ pagePerception?(): Promise<ConnectPerceptionViewShape>;
775
+ pageActionConsents?(): Promise<readonly ConnectPageActionConsentViewShape[]>;
776
+ forgetPageActionConsent?(id: string): Promise<void>;
777
+ forgetPageActionConsentScope?(scope: string): Promise<void>;
778
+ setEndpointEnabled?(name: string, enabled: boolean): Promise<void>;
779
+ setToolEnabled?(endpoint: string, tool: string, enabled: boolean): Promise<void>;
780
+ setToolDisclosure?(endpoint: string, tool: string, disclosure: 'always' | 'on-demand'): Promise<void>;
781
+ webmcp: ConnectWebMcpSourceShape & {
782
+ sources?: readonly ConnectWebMcpSourceShape[];
783
+ };
784
+ }
785
+ /** 结构等价于 `ConnectPerceptionView` */
786
+ interface ConnectPerceptionViewShape {
787
+ enabled: boolean;
788
+ include: readonly string[];
789
+ exclude?: readonly string[];
790
+ records: readonly {
791
+ at: string;
792
+ include: readonly string[];
793
+ exclude?: readonly string[];
794
+ nodeCount: number;
795
+ imageCount?: number;
796
+ imagesOmitted?: number;
797
+ imageFailures?: number;
798
+ }[];
799
+ actionScope?: {
800
+ include: readonly string[];
801
+ exclude?: readonly string[];
802
+ };
803
+ }
804
+ /** 结构等价于 `ConnectPageActionConsentView` */
805
+ interface ConnectPageActionConsentViewShape {
806
+ id: string;
807
+ scope: string;
808
+ action: string;
809
+ grantedAt?: string;
810
+ }
811
+ /** 远程端点配置的持久化端口 */
812
+ interface RemoteEndpointStore {
813
+ load(): ConnectEndpointConfigShape[];
814
+ save(configs: ConnectEndpointConfigShape[]): void;
815
+ }
816
+ interface PageActionConsentStore {
817
+ list(): Promise<readonly ConnectPageActionConsentViewShape[]>;
818
+ forget(id: string): Promise<void>;
819
+ forgetScope(scope: string): Promise<void>;
820
+ }
821
+ interface ConnectFacadeOptions {
822
+ /** 分册 10 的端点句柄 */
823
+ host: PageMcpEndpoint;
824
+ /** 内置端点在连接页显示的 url 串;缺省 `in-process://<endpoint>` */
825
+ builtinEndpointUrl?: string;
826
+ /**
827
+ * 远程端点存储。`false` = 这个宿主不支持手工加端点(浏览器扩展:端点由页面给),
828
+ * 此时 add/remove 抛说明式的 `TOOL_UNSUPPORTED`,而不是给个能点但必然失败的按钮。
829
+ */
830
+ remoteEndpoints?: RemoteEndpointStore | false;
831
+ /**
832
+ * 已**声明**的临时技能(不是当前服务状态)。技能随屏生灭,
833
+ * 只反映当前活跃端点会让用户切屏后看到空列表、以为技能丢了。
834
+ * 不注入时回落到 `host.pageSkills.listSkills()`——那是服务状态,语义不同。
835
+ */
836
+ temporarySkills?: () => Promise<ConnectTemporarySkillShape[]> | ConnectTemporarySkillShape[];
837
+ temporarySkillDetail?: (name: string, origin?: string) => Promise<ConnectTemporarySkillDetailShape> | ConnectTemporarySkillDetailShape;
838
+ /** 页面只读感知视图;不注入时 `pagePerception` 方法整体缺席 */
839
+ pagePerception?: () => Promise<ConnectPerceptionViewShape> | ConnectPerceptionViewShape;
840
+ /** 页面操作授权存储;不注入时三个 consent 方法整体缺席 */
841
+ pageActionConsent?: PageActionConsentStore;
842
+ }
843
+ /** localStorage 版远程端点存储(键 `<ns>.mcp.remote-endpoints`) */
844
+ declare function createLocalStorageRemoteEndpoints(namespace: string): RemoteEndpointStore;
845
+ declare function createConnectFacade(options: ConnectFacadeOptions): ConnectFacadeShape;
846
+ //#endregion
847
+ export { type BrowserModelContextLike, type ConnectEndpointConfigShape, type ConnectEndpointViewShape, type ConnectFacadeOptions, type ConnectFacadeShape, type ConnectPageActionConsentViewShape, type ConnectPerceptionViewShape, type ConnectTemporarySkillDetailShape, type ConnectTemporarySkillShape, type ConnectTestResultShape, type ConnectToolViewShape, type ConnectWebMcpSourceShape, EndpointRegistry, ExperimentalWebMcpAdapter, type McpClientLike, type McpOAuthClient, type McpOAuthConfig, type McpOAuthHandshake, type McpOAuthHandshakeStore, type McpOAuthProvider, type McpOAuthStage, type McpOAuthTokenStore, type McpOAuthTokens, McpRuntimePlugin, type McpSourceTrust, type McpToolDisclosure, McpToolResolver, type McpToolVisibility, type McpVisibilityStore, MessageChannelTransport, type MessageChannelTransportOptions, type MessagePortLike, PAGE_HOST_ANCHOR_KEY, type PageActionConsentStore, type PageHostAnchor, type PageMcpEndpoint, type PageMcpEndpointOptions, type PageMcpTool, type RemoteEndpointConfig, type RemoteEndpointHandle, type RemoteEndpointStore, type ServedSkill, TemporarySkillProvider, type TransportState, WEB_MCP_ENDPOINT, WEB_MCP_SOURCE_ID_MAX, type WebMcpToolDescriptor, type WebMcpToolLike, catalogMerge, connectRemoteEndpoint, createConnectFacade, createLocalStorageMcpVisibility, createLocalStorageRemoteEndpoints, createMemoryOAuthStores, createOAuthProvider, createPageMcpEndpoint, declareDataSourcesToPageHost, endpointToolLlmName, notifyPageHost, parseEndpointToolLlmName, parseWebMcpToolLlmName, serveSkillAsMcp, validateJsonRpcMessage, webMcpToolLlmName };