@webskill/sdk 0.14.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/agent.d.ts +3 -3
  2. package/dist/agent.js +2442 -3
  3. package/dist/{dist-Bfga1TmS.js → approval-BnLLCOG0.js} +235 -2932
  4. package/dist/browser.d.ts +106 -5
  5. package/dist/browser.js +364 -10
  6. package/dist/{openUiLibrary-BKXW7Iwx-DjvEnMlJ.js → dist-CTsxblSD.js} +496 -28
  7. package/dist/{echarts-De78wXqV.js → echarts-BE7oV_Dl.js} +1 -1
  8. package/dist/{env-8cY40DXB-CGnEVZby.js → env-Bj1MI2Ww.js} +1 -1
  9. package/dist/errors-BDZNpC13.js +22 -0
  10. package/dist/{eventTypes-FllCrX-Z-DNDeHWoG.js → eventTypes-Y07N8IAC.js} +14 -2
  11. package/dist/external-_ZRQe-V9.js +53 -0
  12. package/dist/governance.d.ts +15 -3
  13. package/dist/governance.js +86 -4
  14. package/dist/{index-DQwGvHAI.d.ts → index-CQYo4tcT.d.ts} +85 -6
  15. package/dist/{index-sd-gVKey.d.ts → index-CU2md8R1.d.ts} +26 -18
  16. package/dist/{index-CWoKOFBP.d.ts → index-Oc3H89TJ.d.ts} +159 -3
  17. package/dist/index.d.ts +4 -4
  18. package/dist/index.js +1001 -5
  19. package/dist/kind-DxgS8LM-.js +77 -0
  20. package/dist/linkedDocument-xNXF-z8n.js +94 -0
  21. package/dist/llm-B7lLH0ZI.js +1767 -0
  22. package/dist/mcp.d.ts +2 -2
  23. package/dist/mcp.js +41 -4
  24. package/dist/memoryArtifactStore-D6dLeY55.js +48 -0
  25. package/dist/miniChart-owdCdaw-.js +533 -0
  26. package/dist/node.d.ts +3 -3
  27. package/dist/node.js +106 -9
  28. package/dist/openUiLibrary-CY_ADoe0.js +30 -0
  29. package/dist/openUiSpecLang-DuOCdw9G.js +1849 -0
  30. package/dist/pathSecurity-B1owvJAF.js +65 -0
  31. package/dist/processSandboxEntry.js +5 -1
  32. package/dist/renderResult-D9Q-Vu2x.js +143 -0
  33. package/dist/{rolldown-runtime-BOF7iYI8.js → rolldown-runtime-BHkdefai.js} +1 -2
  34. package/dist/sandboxWorkerEntry.js +5 -1
  35. package/dist/{dist-D5YhlCdY.js → skill-CAJMsLod.js} +44 -372
  36. package/dist/{skillVersionStore-D-qHk9ZE-C0OFDTQY.d.ts → skillVersionStore-B24Jjjry-C4zomhMZ.d.ts} +14 -2
  37. package/dist/surface-DVGiCmwq.js +145 -0
  38. package/dist/testing.d.ts +1 -1
  39. package/dist/testing.js +64 -3
  40. package/dist/{types-C3V6lAeO-BgeOvc1Y.d.ts → types-C3V6lAeO-BIf7UB2e.d.ts} +17 -1
  41. package/dist/types-TUydnxaj.js +78 -0
  42. package/dist/ui-react.d.ts +12 -5
  43. package/dist/ui-react.js +128548 -4729
  44. package/dist/ui-vue.d.ts +1 -1
  45. package/dist/ui-vue.js +11 -2
  46. package/dist/ui.d.ts +3 -3
  47. package/dist/ui.js +1254 -3
  48. package/dist/urlSafety-CiSuCJvX.js +65 -0
  49. package/dist/webSkillApi-DOOyz2G5.js +106 -0
  50. package/dist/{webskillLitCatalog-D_zCqeQF-swXsWoAe.js → webskillLitCatalog-DSqVFQjK.js} +11 -3
  51. package/package.json +1 -1
  52. package/dist/catalogComponents-BgAJN0p8-Cr55ouOg.js +0 -124384
  53. package/dist/client-BCM6Z3yq-qUQNkKrK.js +0 -7787
  54. package/dist/dist-BnqAkSS6.js +0 -2384
  55. package/dist/dist-CiaDIqkV.js +0 -3509
  56. package/dist/dist-DxyxmXPU-DGC-dpXf.js +0 -5621
  57. package/dist/memoryArtifactStore-52Zn9npI-BxtUkrgV.js +0 -86
  58. package/dist/stdio-CFMoANJJ-BxrTeXh7.js +0 -31
  59. package/dist/testing-Cm8MseLF.js +0 -142
  60. package/dist/types-WovEf4ED-CZSDiiBU.js +0 -6215
package/dist/browser.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { At as VerifyResult, Ct as SkillsLockfile, Et as TrustedKeyStore, H as FileStat, N as ArchiveLimits, Ot as UnsignedPolicy, S as UiBridge, U as FileSystemProvider, _t as SkillManifest, b as RenderResultRequest, c as InteractionResponse, jt as WebSkillError, l as LlmClient, m as LlmStreamEvent, o as InteractionPolicy, p as LlmResponse, pt as SkillInstallSource, s as InteractionRequest, u as LlmCompleteInput, v as MemoryStore } from "./types-C3V6lAeO-BgeOvc1Y.js";
2
- import { F as ExternalSkillProvider, Ht as ScriptExecutionContext, I as ExternalToolSource, Ln as WebSkillApi, S as BridgeResponse, Un as bridgeError, Ut as ScriptExecutor, at as NetworkPolicy, fn as ToolDefinition, hn as ToolResult, m as ApprovalScope, pr as parseBridgeRequest, rt as LinkedDocumentReader, x as BridgeRequest, y as BridgeCapabilities } from "./index-CWoKOFBP.js";
3
- import { $ as PageActionOutcome, Ct as PerceptionScopeInput, Z as PageActionExecutor, at as PageActionScopeInput, ft as PagePerceptionReader, gt as PerceivedNode, ot as PageActionTarget, rt as PageActionRequest, ut as PagePerceptionPolicy, vt as PerceptionCaptureOptions, xt as PerceptionResult } from "./index-DQwGvHAI.js";
1
+ import { Ct as SkillsLockfile, Et as TrustedKeyStore, H as FileStat, Mt as WebSkillError, N as ArchiveLimits, S as UiBridge, U as FileSystemProvider, _t as SkillManifest, b as RenderResultRequest, c as InteractionResponse, jt as VerifyResult, kt as UnsignedPolicy, l as LlmClient, m as LlmStreamEvent, o as InteractionPolicy, p as LlmResponse, pt as SkillInstallSource, s as InteractionRequest, u as LlmCompleteInput, v as MemoryStore } from "./types-C3V6lAeO-BIf7UB2e.js";
2
+ import { Kt as ScriptExecutionContext, M as DocumentSurfaceHost, R as ExternalSkillProvider, S as BridgeResponse, Un as WebSkillApi, Yn as bridgeError, ct as NetworkPolicy, gn as ToolDefinition, m as ApprovalScope, ot as LinkedDocumentReader, qt as ScriptExecutor, x as BridgeRequest, y as BridgeCapabilities, yn as ToolResult, yr as parseBridgeRequest, z as ExternalToolSource } from "./index-Oc3H89TJ.js";
3
+ import { Ct as PerceptionCaptureOptions, Et as PerceptionResult, J as NestedFrameRef, Ot as PerceptionScopeInput, _t as PagePerceptionReader, ct as PageActionRequest, dt as PageActionTarget, ht as PagePerceptionPolicy, it as PageActionOutcome, nt as PageActionExecutor, ut as PageActionScopeInput, xt as PerceivedNode } from "./index-CQYo4tcT.js";
4
4
  //#region ../browser/dist/index.d.ts
5
5
  //#region src/fs/featureDetection.d.ts
6
6
  /** 检测当前环境是否可用 OPFS(navigator.storage.getDirectory) */
@@ -39,7 +39,7 @@ declare class OpfsProvider implements FileSystemProvider {
39
39
  *
40
40
  * 协议(宿主 ↔ Worker):
41
41
  * - 宿主 → Worker:{type:'load', id, source, networkPolicy?} 请求加载脚本定义
42
- * - 宿主 → Worker:{type:'execute', id, skillName, runId, source, args, networkPolicy?} 请求执行
42
+ * - 宿主 → Worker:{type:'execute', id, skillName, runId, source, args, networkPolicy?, documentSurface?} 请求执行
43
43
  * - Worker → 宿主:{type:'load-result', id, ok, definition?, error?}
44
44
  * - Worker → 宿主:{type:'execute-result', id, ok, value?, stdout, stderr, error?}
45
45
  * - Worker → 宿主:{type:'bridge', request} 能力桥 RPC(readReference/writeArtifact/confirm)
@@ -649,6 +649,99 @@ interface PageAgentHandler {
649
649
  */
650
650
  declare function createPageAgentHandler(options?: PageAgentHandlerOptions): PageAgentHandler;
651
651
  //#endregion
652
+ //#region src/remote/frameRouter.d.ts
653
+ /**
654
+ * 一次感知能铺开的上限(0.14.0 分册 16 FR-16.4)。
655
+ *
656
+ * 兜底的是**帧数与节点总量**,不是层数。0.13.0 D-18-8 用深度上限兜底,
657
+ * 前提是「路径由宿主写死」;自动发现一进来那个前提就没了:
658
+ * 三层的页面可能只有 5 个节点,两层的门户可能挂着 40 个 iframe。
659
+ * 层数是错的度量,总量才是。
660
+ * @experimental
661
+ */
662
+ interface FrameBudget {
663
+ maxFrames: number;
664
+ maxNodes: number;
665
+ }
666
+ /** @experimental */
667
+ declare const DEFAULT_FRAME_BUDGET: FrameBudget;
668
+ /**
669
+ * 一次投递的回执。
670
+ *
671
+ * `documentUrl` 是应答**实际来自**的文档地址,用于导航漂移判定:
672
+ * 投递地址是上一刻算出来的,那一帧完全可能在往返之间导航走。
673
+ * @experimental
674
+ */
675
+ interface FrameDelivery {
676
+ reply: PageAgentReply;
677
+ documentUrl: string;
678
+ }
679
+ /**
680
+ * 解析嵌套帧时宿主能拿到的上下文。
681
+ *
682
+ * `visited` 由路由器攒、由宿主读:去重需要比较地址,而地址对路由器是不透明的
683
+ * (D-11-1)。让宿主自己在 dispatcher 里存一份则解决不了生命周期——
684
+ * dispatcher 是长期对象,一次编排结束后没人通知它清空。
685
+ * @experimental
686
+ */
687
+ interface FrameResolveContext<A> {
688
+ /** 发现这个嵌套帧的那一帧的地址 */
689
+ readonly parent: A;
690
+ /** 本次感知已投递过的地址,按投递顺序 */
691
+ readonly visited: readonly A[];
692
+ }
693
+ /**
694
+ * 宿主实现的那一半(分册 11 FR-11.1):**寻址**。
695
+ *
696
+ * 地址类型 `A` 对路由器完全不透明:不比较、不序列化、不持久化,
697
+ * 只在同一次编排内原样传递。扩展宿主用帧号,`postMessage` 宿主用 URL,
698
+ * 两者不需要迁就同一个形状。
699
+ * @experimental
700
+ */
701
+ interface FrameDispatcher<A> {
702
+ /** 从哪里开始下钻 */
703
+ mainFrame(): A | Promise<A>;
704
+ /** 把一次请求送到某个地址 */
705
+ send(address: A, request: PageAgentRequest): Promise<FrameDelivery>;
706
+ /**
707
+ * 把某一帧报上来的嵌套帧引用换成可投递的地址。
708
+ *
709
+ * 解析不出(跨源、不可达、不在宿主白名单里、已经读过)时返回 `undefined`,
710
+ * 该帧被跳过并留说明,**不算错误**。这是帧可达性的唯一出口:
711
+ * SDK 不带任何缺省白名单,也不因为「导出了」就替宿主放行一帧(D-11-4)。
712
+ */
713
+ resolveNestedFrame(nested: NestedFrameRef, context: FrameResolveContext<A>): Promise<A | undefined> | A | undefined;
714
+ }
715
+ /** @experimental */
716
+ interface FrameRouterOptions<A> {
717
+ dispatcher: FrameDispatcher<A>;
718
+ budget?: Partial<FrameBudget>;
719
+ /**
720
+ * 主帧的帧名(D-11-3)。不给则主帧节点**不带** `frame`——
721
+ * 主帧就是「这个页面」,给它加一段前缀只会让每个节点都变吵。
722
+ * 主帧本身就是外壳里的一帧时(模型要能区分外壳与业务帧)才给。
723
+ */
724
+ mainFrameLabel?: string;
725
+ }
726
+ /** @experimental */
727
+ interface FrameRouter {
728
+ perceive(request: PageAgentRequest & {
729
+ type: 'perceive';
730
+ }): Promise<PageAgentReply>;
731
+ execute(request: PageAgentRequest & {
732
+ type: 'execute';
733
+ }): Promise<PageAgentReply>;
734
+ }
735
+ /**
736
+ * 逐帧下钻并汇总(分册 16 FR-16.2 / FR-16.3 / FR-16.4,分册 11 FR-11.2)。
737
+ *
738
+ * 编排本身与浏览器 API 无关:它只认 `PageAgentRequest` / `PageAgentReply`,
739
+ * 寻址全压在宿主实现的 `FrameDispatcher` 里。因此这个模块可以在 Service Worker
740
+ * 里实例化,也可以服务不按帧号寻址的宿主。
741
+ * @experimental
742
+ */
743
+ declare function createFrameRouter<A>(options: FrameRouterOptions<A>): FrameRouter;
744
+ //#endregion
652
745
  //#region src/dom/imageCapture.d.ts
653
746
  /**
654
747
  * 取像级别(0.6.0 FR-12.1)。裁决 D-3 已取消 L3 栅格化,只剩两级。
@@ -1204,6 +1297,14 @@ declare const DOCUMENT_SURFACE_AUDIT_EVENT = "document.surface.open";
1204
1297
  * 无 `allow-top-navigation` 改不了它的地址。
1205
1298
  */
1206
1299
  declare function openDocumentSurface(input: OpenDocumentInput, options: DocumentSurfaceOptions): Promise<WindowLike>;
1300
+ /**
1301
+ * 把 `openDocumentSurface` 柯里化成 `DocumentSurfaceHost`(0.15.0 分册 13 FR-13.3)。
1302
+ *
1303
+ * **只绑定选项,不新增任何逻辑**:体积上限、握手超时、`DOCUMENT_SURFACE_DECLINED`
1304
+ * 与审计事件全部沿用上面那一份实现(FR-13.5「逐条不变」的实现基础)。
1305
+ * @experimental
1306
+ */
1307
+ declare function createDocumentSurfaceHost(options: DocumentSurfaceOptions): DocumentSurfaceHost;
1207
1308
  //#endregion
1208
1309
  //#region src/viewer/shell.d.ts
1209
1310
  /**
@@ -1280,4 +1381,4 @@ declare function watchBlockedResources(host: ViewerBlockedHost, notice: ViewerBl
1280
1381
  /** 提示文案的单一来源;判据直接引用,不各写一份字面量 */
1281
1382
  declare function blockedMessage(origins: readonly string[]): string;
1282
1383
  //#endregion
1283
- export { type BlockedEventLike, type BridgeCapabilities, type BridgeRequest, type BridgeResponse, type BrowserHostBundle, type BrowserHostOptions, type BrowserHostOverrides, BrowserSkillManager, BrowserWorkerScriptExecutor, type CaptureFailure, type CaptureLevel, type CapturedImage, type ChromeBuiltinAvailability, ChromeBuiltinLlmClient, type CompressResult, type ConfiguredLlmClient, DEFAULT_MAX_VIEWER_PAYLOAD_BYTES, DOCUMENT_SURFACE_AUDIT_EVENT, DOCX_UNEXTRACTED, type DictationAvailability, type DictationOptions, type DictationSession, type DocumentSurfaceAudit, type DocumentSurfaceOptions, type DomPageActionExecutor, type DomPageActionOptions, type DomPerceptionReader, type DomPerceptionReaderOptions, type FetchLinkedDocumentOptions, HOST_PORT_MATRIX, 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 PortApplicability, type PortReport, type PortSpec, type PortStatus, type RemotePageActionExecutorOptions, type RemotePerceptionReaderOptions, type RemoteTargetRegistry, type RoleHint, SANDBOX_PAGE_SCRIPT_SOURCE, type SandboxMode, type SerializedError, 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, checkDictationAvailability, compressImageToBudget, createBrowserChatbotHost, createDomPageActionExecutor, createDomPerceptionReader, createEncryptedMemoryStore, createFetchLinkedDocumentReader, createIframeWorker, createLlmClient, createPageAgentHandler, createRemotePageActionExecutor, createRemotePerceptionReader, createRemoteTargetRegistry, deleteMemoryEncryptionKey, extractDocxText, extractXlsxText, extractZipWeb, generateMemoryEncryptionKey, inspectHostWiring, installWebSkillNavigator, isCapturableElement, isCaptureFailure, isEncryptedMemoryValue, isOpfsAvailable, missingPorts, openDocumentSurface, openMemoryEncryptionKey, parseBridgeRequest, parseMainMessage, parseWorkerEvent, probeChromeBuiltinAvailability, sha256HexWeb, startDictation, startViewerShell, startWorkerRuntimeHost, viewerCspHeader, watchBlockedResources };
1384
+ export { type BlockedEventLike, type BridgeCapabilities, type BridgeRequest, type BridgeResponse, type BrowserHostBundle, type BrowserHostOptions, type BrowserHostOverrides, BrowserSkillManager, BrowserWorkerScriptExecutor, type CaptureFailure, type CaptureLevel, type CapturedImage, type ChromeBuiltinAvailability, ChromeBuiltinLlmClient, type CompressResult, type ConfiguredLlmClient, DEFAULT_FRAME_BUDGET, DEFAULT_MAX_VIEWER_PAYLOAD_BYTES, DOCUMENT_SURFACE_AUDIT_EVENT, DOCX_UNEXTRACTED, type DictationAvailability, type DictationOptions, type DictationSession, 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 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 PortApplicability, type PortReport, type PortSpec, type PortStatus, type RemotePageActionExecutorOptions, type RemotePerceptionReaderOptions, type RemoteTargetRegistry, type RoleHint, SANDBOX_PAGE_SCRIPT_SOURCE, type SandboxMode, type SerializedError, 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, checkDictationAvailability, compressImageToBudget, createBrowserChatbotHost, createDocumentSurfaceHost, createDomPageActionExecutor, createDomPerceptionReader, createEncryptedMemoryStore, createFetchLinkedDocumentReader, createFrameRouter, createIframeWorker, createLlmClient, createPageAgentHandler, createRemotePageActionExecutor, createRemotePerceptionReader, createRemoteTargetRegistry, deleteMemoryEncryptionKey, extractDocxText, extractXlsxText, extractZipWeb, generateMemoryEncryptionKey, inspectHostWiring, installWebSkillNavigator, isCapturableElement, isCaptureFailure, isEncryptedMemoryValue, isOpfsAvailable, missingPorts, openDocumentSurface, openMemoryEncryptionKey, parseBridgeRequest, parseMainMessage, parseWorkerEvent, probeChromeBuiltinAvailability, sha256HexWeb, startDictation, startViewerShell, startWorkerRuntimeHost, viewerCspHeader, watchBlockedResources };