@webskill/sdk 0.20.0 → 0.22.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 (139) hide show
  1. package/dist/abnfDiagram-O67JEVCF-DtYFjfqO.js +109 -0
  2. package/dist/agent.d.ts +3 -3
  3. package/dist/agent.js +1171 -73
  4. package/dist/{approval-Bbh_Apwg.js → approval-DWQlDPbY.js} +527 -29
  5. package/dist/arc-8U_6NQWm.js +130 -0
  6. package/dist/architecture-7GRP2DOG-RTw1wpAq.js +4 -0
  7. package/dist/architectureDiagram-NJMV4G6O-XmmXrJAK.js +7473 -0
  8. package/dist/array-DQfpQNY8.js +8 -0
  9. package/dist/blockDiagram-BEXU5L5S-D4yjnCD1.js +2582 -0
  10. package/dist/browser.d.ts +1129 -48
  11. package/dist/browser.js +3562 -278
  12. package/dist/c4Diagram-YGBWAQC7-BLmA_JSd.js +3668 -0
  13. package/dist/channel-CZxxLrG7.js +9 -0
  14. package/dist/chunk-2Q5K7J3B-Ck03gkFR.js +21 -0
  15. package/dist/chunk-3FUC2YCW-tr6jmbQf.js +530 -0
  16. package/dist/chunk-5DYCD2WN-Bt97YGTd.js +58 -0
  17. package/dist/chunk-5VM5RSS4-BBxa48HL.js +21 -0
  18. package/dist/chunk-6AEJRKK7-JXK89I-O.js +14 -0
  19. package/dist/chunk-742MDFTN-CPmgCGwC.js +466 -0
  20. package/dist/chunk-7INBJB4K-C9jq9o66.js +6552 -0
  21. package/dist/chunk-7M6MHVWA-BrKCWcR1.js +4894 -0
  22. package/dist/chunk-7PRAP22T-BHED6GVs.js +95 -0
  23. package/dist/chunk-DUW6YSOI-DoZj78PO.js +19 -0
  24. package/dist/chunk-FOHPRMQF-Dkbp819z.js +27189 -0
  25. package/dist/chunk-GNY47TPC-Bpvq1T49.js +87 -0
  26. package/dist/chunk-GTNCS2PH-CLmh4I2c.js +686 -0
  27. package/dist/chunk-GWA4HPMP-B6vN3fkL.js +95 -0
  28. package/dist/chunk-J5ZVWO5B-Bi_Pcobw.js +26 -0
  29. package/dist/chunk-JWPE2WC7-D1rC79GS.js +12 -0
  30. package/dist/chunk-LNGE3PJU-D5OIoe3Z.js +2582 -0
  31. package/dist/chunk-MBY4JIJT-C34L7a4f.js +2276 -0
  32. package/dist/chunk-NETBCI7D-Cg84k8N8.js +321 -0
  33. package/dist/chunk-O7XYJQB3-B6K0KOSL.js +8846 -0
  34. package/dist/chunk-UA2S7LBM-DxHM29_K.js +612 -0
  35. package/dist/chunk-WEXAMYUT-Ba6jFWhB.js +33 -0
  36. package/dist/chunk-XXDRQBXY-DPbSy4kg.js +12 -0
  37. package/dist/chunk-Y2CYZVJY-U3QOMqrW.js +15 -0
  38. package/dist/chunk-Z7XXMR3K-oLg1h8F3.js +1038 -0
  39. package/dist/chunk-ZIGJFQKS-DqEFBuHR.js +2215 -0
  40. package/dist/classDiagram-v2-NBCMYWYE-BqnOWIUt.js +3845 -0
  41. package/dist/cose-bilkent-JH36ORCC-C0dTAHVK.js +4270 -0
  42. package/dist/cynefin-OW5HDTMX-B2QvgEQj.js +4 -0
  43. package/dist/cynefinDiagram-VND7K2PF-yAWc6Z3W.js +479 -0
  44. package/dist/cytoscape.esm-C64mRh9B.js +28325 -0
  45. package/dist/dagre-6A5THRUB-D0w2W27v.js +4816 -0
  46. package/dist/defaultLocale-B_EoOkSF.js +249 -0
  47. package/dist/diagram-22UHCM2B-DvgzhUzP.js +6115 -0
  48. package/dist/diagram-3UASUU5V-DWgUB-ef.js +795 -0
  49. package/dist/diagram-ATOU4E4O-P1olqwIs.js +553 -0
  50. package/dist/diagram-CDSNMT55-BUlZuLUe.js +402 -0
  51. package/dist/diagram-MLGK6HIB-6w5qmkGt.js +186 -0
  52. package/dist/diagram-MPIPVDR6-DEFiSo8o.js +289 -0
  53. package/dist/dist-UajCDt3n.js +92 -0
  54. package/dist/ebnfDiagram-ZINNZB2B-CI8liCfR.js +123 -0
  55. package/dist/elk-276RUBZZ-3SvW6OAK.js +90034 -0
  56. package/dist/erDiagram-OPXOYQCR-CPTbKhwP.js +2301 -0
  57. package/dist/{eventTypes-CwciaqCU.js → eventTypes-DcTQXSV1.js} +7 -1
  58. package/dist/eventmodeling-NTZA5JFV-BlyuqGp0.js +4 -0
  59. package/dist/flowDiagram-KWPJA3E3-CcUJ6HbV.js +18 -0
  60. package/dist/ganttDiagram-FUAMR5RP-31UjY0KK.js +3939 -0
  61. package/dist/geometry-wx5ZTYzi.js +715 -0
  62. package/dist/gitGraph-4MIJSDKK-ChdVlrk7.js +4 -0
  63. package/dist/gitGraphDiagram-X574FWY7-DKuxJymB.js +1153 -0
  64. package/dist/governance.d.ts +9 -3
  65. package/dist/governance.js +1 -1
  66. package/dist/graphlib-tk9gQYuN.js +4194 -0
  67. package/dist/{index-ad11wflI.d.ts → index-BiO9_XRk.d.ts} +2 -2
  68. package/dist/{index-DQ3-6GFu.d.ts → index-CjwdZQOS.d.ts} +945 -8
  69. package/dist/{index-BDyXe-a5.d.ts → index-YPd8ZSEa.d.ts} +413 -7
  70. package/dist/index.d.ts +4 -4
  71. package/dist/index.js +47 -41
  72. package/dist/info-A6RAGUB7-CxRAt9S9.js +4 -0
  73. package/dist/infoDiagram-VRGFBTTK-pRspGfjZ.js +25 -0
  74. package/dist/init-CMOIWdg-.js +16 -0
  75. package/dist/ishikawaDiagram-OU5B5YK6-DKerAPAg.js +975 -0
  76. package/dist/journeyDiagram-ZHPQQLJL-C4MK-YO5.js +1227 -0
  77. package/dist/kanban-definition-PNTS6WVX-BqsZpMXx.js +1244 -0
  78. package/dist/katex-BcRRvyh_.js +26465 -0
  79. package/dist/kind-Dc8x0HWz.js +110 -0
  80. package/dist/line-LgV8iVMV.js +48 -0
  81. package/dist/linear-BWKR0Tqd.js +393 -0
  82. package/dist/linkedDocument-CIuh_Yp0.js +416 -0
  83. package/dist/mcp.d.ts +2 -2
  84. package/dist/{memoryArtifactStore-D6dLeY55.js → memoryArtifactStore-Bs7glPqm.js} +14 -0
  85. package/dist/mermaid-parser.core-pYR5siSx.js +754 -0
  86. package/dist/mermaid.core-DMtwGCHy.js +1756 -0
  87. package/dist/mindmap-definition-NLK3R4M7-CXbD-myG.js +1312 -0
  88. package/dist/node.d.ts +8 -3
  89. package/dist/node.js +79 -4
  90. package/dist/{openUiLibrary-b0i7F_oZ.js → openUiLibrary-B7j3rLrm.js} +1 -1
  91. package/dist/{openUiSpecLang-CLXJEeRU.js → openUiSpecLang-BSYYnjay.js} +1 -1
  92. package/dist/ordinal-CxA6GHQS.js +84 -0
  93. package/dist/packet-AYTQ26CC-BOm08cxl.js +4 -0
  94. package/dist/path-C27Z2Bjv.js +106 -0
  95. package/dist/pegDiagram-GJSIUBJH-BLGJOewQ.js +115 -0
  96. package/dist/pie-WAS4IAKB-Dvg7glpk.js +4 -0
  97. package/dist/pieDiagram-5QR66LMP-laoaV_PB.js +298 -0
  98. package/dist/processSandboxEntry.js +5 -0
  99. package/dist/quadrantDiagram-O4NWA36T-Db_wFBkT.js +2236 -0
  100. package/dist/radar-RG4KPBEZ-BZDaTu06.js +4 -0
  101. package/dist/railroad-74A4TZTK-C-UhjkOy.js +4 -0
  102. package/dist/railroad-abnf-HS5TGJTU-dUKVA4OS.js +4 -0
  103. package/dist/railroad-ebnf-LZEXJU2U-DzQumk18.js +4 -0
  104. package/dist/railroad-peg-WCYAUIDC-B3vvTWed.js +4 -0
  105. package/dist/railroadDiagram-XR7U4H2S-BY0sTM4X.js +89 -0
  106. package/dist/requirementDiagram-PLB6GJNP-3rkQfEhs.js +2474 -0
  107. package/dist/rough.cjs-AmDd_NQk.js +1395 -0
  108. package/dist/sandboxWorkerEntry.js +5 -0
  109. package/dist/sankeyDiagram-IPEJSGJF-CGAJhyG2.js +3578 -0
  110. package/dist/sequenceDiagram-PO4LG4MO-9FJjFX06.js +5522 -0
  111. package/dist/sizeCapture-INFHLROL-D8PWxdOn.js +56 -0
  112. package/dist/{skillVersionStore-B24Jjjry-v2CCU0Xo.d.ts → skillVersionStore-B24Jjjry-BY1H7Krp.d.ts} +1 -1
  113. package/dist/src-NkhI3UMl.js +2653 -0
  114. package/dist/stateDiagram-v2-GCMORJYK-B0O3wc1-.js +2715 -0
  115. package/dist/swimlanes-2SLR337P-D4EOnrpu.js +6637 -0
  116. package/dist/swimlanesDiagram-TC7HE7FX-BUx29EJ9.js +30 -0
  117. package/dist/testing.d.ts +2 -1
  118. package/dist/testing.js +1 -1
  119. package/dist/timeline-definition-EJHVYXUP-CrgiiB4C.js +1513 -0
  120. package/dist/treeView-Q6P3EWNA-C1by-Gzc.js +4 -0
  121. package/dist/treemap-WGGIJYW6-mC2NZ6ad.js +4 -0
  122. package/dist/{types-Btpdd1y--BcxQ10Fa.d.ts → types-CpDRZ0rA-BM5FI9oN.d.ts} +111 -9
  123. package/dist/ui-react.d.ts +3 -3
  124. package/dist/ui-react.js +3718 -77
  125. package/dist/ui-vue.d.ts +1 -1
  126. package/dist/ui.d.ts +3 -3
  127. package/dist/ui.js +2 -2
  128. package/dist/untrustedText-BIaRvPZK.js +16 -0
  129. package/dist/usecaseDiagram-POWQR4AR-BUt_TQOY.js +14397 -0
  130. package/dist/vennDiagram-UO4OBE2U-CwXr0wjA.js +2808 -0
  131. package/dist/wardley-WFR3VGLG-CVSYjq_S.js +4 -0
  132. package/dist/wardleyDiagram-VNRHLVJA-Cpfd47dQ.js +874 -0
  133. package/dist/{webSkillApi-CsvA69qk.js → webSkillApi-Dy-Zjv0y.js} +1 -1
  134. package/dist/{webskillLitCatalog-W06npwej.js → webskillLitCatalog-D5BCiMCU.js} +1 -1
  135. package/dist/xychartDiagram-PMCCYNJV-e1TeVoc6.js +2704 -0
  136. package/package.json +6 -5
  137. package/dist/kind-DxgS8LM-.js +0 -77
  138. package/dist/linkedDocument-xNXF-z8n.js +0 -94
  139. package/dist/types-DOJI5YC3.js +0 -90
package/dist/browser.d.ts CHANGED
@@ -1,6 +1,6 @@
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-Btpdd1y--BcxQ10Fa.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-BDyXe-a5.js";
3
- import { $ as NestedFrameRef, Ct as PagePerceptionPolicy, It as PerceptionScopeInput, Pt as PerceptionResult, Tt as PagePerceptionReader, Xt as SubtreeRejection, ft as PageActionOutcome, gt as PageActionRequest, jt as PerceptionCaptureOptions, kt as PerceivedNode, ut as PageActionExecutor, vt as PageActionScopeInput, yt as PageActionTarget } from "./index-DQ3-6GFu.js";
1
+ import { G as FileStat, It as VerifyResult, K as FileSystemProvider, Lt as WebSkillError, N as ArchiveLimits, Ot as SkillsLockfile, Pt as UnsignedPolicy, S as UiBridge, St as SkillManifest, b as RenderResultRequest, c as InteractionResponse, jt as TrustedKeyStore, l as LlmClient, m as LlmStreamEvent, o as InteractionPolicy, p as LlmResponse, q as FileWriteStream, s as InteractionRequest, u as LlmCompleteInput, v as MemoryStore, vt as SkillInstallSource } from "./types-CpDRZ0rA-BM5FI9oN.js";
2
+ import { $ as ImageOmission, B as ExternalToolSource, C as BridgeResponse, N as DocumentSurfaceHost, Pn as ToolResult, S as BridgeRequest, Sr as bridgeError, Yr as parseBridgeRequest, b as BridgeCapabilities, ct as LinkedDocumentReader, en as ScriptExecutionContext, jn as ToolDefinition, m as ApprovalScope, mr as WebSkillApi, sr as ViewerImageFact, tn as ScriptExecutor, ut as NetworkPolicy, z as ExternalSkillProvider } from "./index-YPd8ZSEa.js";
3
+ import { In as PerceptionScopeInput, K as DocxDocumentContent, Ln as PptxDocumentContent, Lr as XlsxDocumentContent, Pn as PerceptionResult, Rn as PptxDocumentReader, Rr as XlsxDocumentReader, Tn as PdfDocumentReader, Ut as NestedFrameRef, cn as PageActionRequest, dn as PageActionTarget, in as PageActionOutcome, jn as PerceptionCaptureOptions, kn as PerceivedNode, mn as PageAuditSink, nn as PageActionExecutor, q as DocxDocumentReader, sr as SubtreeRejection, u as ConsentUi, un as PageActionScopeInput, xn as PagePerceptionReader, yn as PagePerceptionPolicy } from "./index-CjwdZQOS.js";
4
4
  //#region ../browser/dist/index.d.ts
5
5
  //#region src/fs/featureDetection.d.ts
6
6
  /** 检测当前环境是否可用 OPFS(navigator.storage.getDirectory) */
@@ -19,6 +19,12 @@ declare class OpfsProvider implements FileSystemProvider {
19
19
  appendText(p: string, content: string): Promise<void>;
20
20
  readBinary(p: string): Promise<Uint8Array>;
21
21
  writeBinary(p: string, content: Uint8Array): Promise<void>;
22
+ /**
23
+ * 分块写入(FR-18.2c)。`createWritable()` 本身就是写 swap 文件、`close()` 才提交,
24
+ * 所以未完成的内容不会被读到;但 `getFileHandle(create:true)` 会先落下一个空文件,
25
+ * 因此 abort 时要把“本次新建”的那个空壳删掉,不给后续读取留残件(FR-18.2e)。
26
+ */
27
+ createWriteStream(p: string): Promise<FileWriteStream>;
22
28
  exists(p: string): Promise<boolean>;
23
29
  stat(p: string): Promise<FileStat>;
24
30
  list(p: string): Promise<FileStat[]>;
@@ -500,6 +506,160 @@ interface CompressResult {
500
506
  */
501
507
  declare function compressImageToBudget(file: Blob, maxBytes: number): Promise<CompressResult>;
502
508
  //#endregion
509
+ //#region src/dom/imageCapture.d.ts
510
+ /**
511
+ * 取像级别(0.6.0 FR-12.1)。裁决 D-3 已取消 L3 栅格化,只剩两级。
512
+ * @experimental
513
+ */
514
+ type CaptureLevel = 'src' | 'canvas';
515
+ /** @experimental */
516
+ interface CapturedImage {
517
+ id: string;
518
+ mimeType: string;
519
+ /** base64,不含 `data:` 前缀 */
520
+ data: string;
521
+ level: CaptureLevel;
522
+ originalBytes: number;
523
+ /** 压缩后字节数;未压缩时与 `originalBytes` 相同 */
524
+ bytes: number;
525
+ }
526
+ /** @experimental */
527
+ interface CaptureFailure {
528
+ id: string;
529
+ /** 必须说明是哪一级、为什么;只写 "image unavailable" 不足以让用户判断该怎么办 */
530
+ reason: string;
531
+ triedLevels: readonly CaptureLevel[];
532
+ }
533
+ /** @experimental */
534
+ declare function isCaptureFailure<T extends object>(result: T | CaptureFailure): result is CaptureFailure;
535
+ /** 只有这三种标签能取像;其余元素连取像入口都不进(FR-12.1,由 T-02-15 守门) @experimental */
536
+ declare function isCapturableElement(element: Element): boolean;
537
+ /**
538
+ * 投放与导出通道的目标集:`docx` 与 `pptxgenjs` 都不吃 WebP,
539
+ * 而 WebP 在现代网页上遍地都是。归一化放在写进 `src` 之前,
540
+ * 下游三处永远只见得到 PNG 与 JPEG(设计 12 §4.2)。
541
+ *
542
+ * 导出编码器判断「这张图嵌不嵌得进去」必须读同一份清单(0.22.0 FR-14.3):
543
+ * 各写一遍就会出现「投放时归一成了 A,导出却认为 A 不受支持」。
544
+ * @experimental
545
+ */
546
+ declare const DOCUMENT_IMAGE_MIME_TYPES: ReadonlySet<string>;
547
+ /**
548
+ * 一张已归一化、可直接写进投放文档的图片(0.22.0 FR-11.6)。
549
+ * @experimental
550
+ */
551
+ interface DocumentImage {
552
+ /** base64,不含 `data:` 前缀 */
553
+ data: string;
554
+ /** 一定是 `image/png` 或 `image/jpeg`——两个导出编码器的交集 */
555
+ mimeType: string;
556
+ width: number;
557
+ height: number;
558
+ bytes: number;
559
+ }
560
+ /**
561
+ * 把任意来源的图片字节归一成投放文档能显示、两个导出编码器都收得下的形态(0.22.0 FR-11.6)。
562
+ *
563
+ * 上传图、页面图、外链图在这里走的是**同一个函数**——AC-G1 要的不是三条分支行为一致,
564
+ * 而是根本只有一条分支,所以这个签名里没有「来源」这个参数。
565
+ *
566
+ * 宽高一律实测:像素数是投放载荷预算的硬兜底维度(FR-10.7),采信声明等于让被限制方自报限额。
567
+ * 失败抛错并带可执行的原因,由调用方转成丢图归因(FR-11.8)。
568
+ * @experimental
569
+ */
570
+ declare function toDocumentImage(bytes: Uint8Array, options: {
571
+ maxBytes: number;
572
+ declaredMimeType?: string;
573
+ }): Promise<DocumentImage>;
574
+ /**
575
+ * 取一个元素的图像(0.6.0 FR-12.1)。
576
+ *
577
+ * 按元素类型分派,不做无意义的尝试:`<img>` 只走 L1,`<canvas>` / `<svg>` 只走 L2,
578
+ * 两者互不兜底。失败返回 `CaptureFailure` 而不是抛错——一张图抓不到不该让整次感知失败。
579
+ * @experimental
580
+ */ declare function captureElementImage(element: Element, options: {
581
+ id: string;
582
+ maxBytes: number;
583
+ }): Promise<CapturedImage | CaptureFailure>;
584
+ /**
585
+ * 取一张宿主页面上的图,并归一成投放 / 导出通道吃得下的形态(0.22.0 FR-12.1)。
586
+ *
587
+ * 取像本身**原样复用** `captureElementImage`:两级策略与「互不兜底」的裁决 D-3 一字未改。
588
+ * 这里只把归一化的目标集换成 `png` / `jpeg`——产物一旦落盘就该是下游直接能用的格式,
589
+ * 否则「投放看得见、导出才消失」会以另一种形态回来。
590
+ * @experimental
591
+ */
592
+ declare function captureDocumentImage(element: Element, options: {
593
+ id: string;
594
+ maxBytes: number;
595
+ }): Promise<DocumentImage | CaptureFailure>;
596
+ //#endregion
597
+ //#region src/net/fetchImage.d.ts
598
+ /**
599
+ * 抓取失败的分类(0.22.0 分册 13 FR-13.4)。
600
+ *
601
+ * 分类存在的理由只有一个:`failed to fetch` 让模型无从判断该换一个 URL、该重试、
602
+ * 还是该放弃。每一档对应一个**不同的下一步**。
603
+ * @experimental
604
+ */
605
+ type RemoteFetchFailure = 'blocked' | 'unreachable' | 'refused' | 'not-an-image' | 'too-large' | 'timeout';
606
+ /** 单次抓取超时(设计 14 §5.1)。一个不响应的 URL 不得把整个 run 拖死 @experimental */
607
+ declare const REMOTE_IMAGE_TIMEOUT_MS = 15000;
608
+ /** 单张外链图的原始字节上界(设计 14 §5.1)。超限先压,压不下去才丢 @experimental */
609
+ declare const MAX_REMOTE_IMAGE_BYTES: number;
610
+ /** @experimental */
611
+ interface RemoteImageFailure {
612
+ kind: RemoteFetchFailure;
613
+ /** 英文、可执行:说清是哪一类失败、以及下一步能做什么 */
614
+ reason: string;
615
+ }
616
+ /** @experimental */
617
+ interface FetchRemoteImageOptions {
618
+ /** 归一化后的字节上界,与页面图共用同一个预算 */
619
+ maxBytes: number;
620
+ /** 原始响应体的上界;缺省 `MAX_REMOTE_IMAGE_BYTES` */
621
+ maxSourceBytes?: number;
622
+ timeoutMs?: number;
623
+ /** 仅供测试注入;缺省用全局 `fetch` */
624
+ fetch?: typeof globalThis.fetch;
625
+ }
626
+ /**
627
+ * 把一次抓取失败归档(AC-13.4)。
628
+ *
629
+ * 纯函数:实测表明扩展上 `http` 全通(设计 14 §1),「被浏览器阻断」在 e2e 里
630
+ * 根本构造不出来,所以这一档的正确性只能由单测按真实错误形态喂进来验。
631
+ * @experimental
632
+ */
633
+ declare function classifyFetchFailure(error: unknown, response?: Response): RemoteFetchFailure;
634
+ /**
635
+ * 抓一张外链图并归一成可直接写进文档的形态(分册 13 FR-13.1 ~ FR-13.5)。
636
+ *
637
+ * **授权不在这里**:调用方必须在调用之前拿到用户同意(AC-13.5 要求断言网络层零请求,
638
+ * 所以判定必须发生在 `fetch` 之前,不能靠拿到响应再丢弃)。
639
+ *
640
+ * SSRF 由 `assertRemoteUrlAllowed` 原样兜住,不另写一份(FR-13.5)。已知口子:
641
+ * 它校验的是**初始 URL**,跟随重定向落到私有网段它管不着(见 docs/deferred-items.md)。
642
+ * @experimental
643
+ */
644
+ declare function fetchRemoteImage(url: string, options: FetchRemoteImageOptions): Promise<DocumentImage | RemoteImageFailure>;
645
+ /** @experimental */
646
+ declare function isRemoteImageFailure(result: DocumentImage | RemoteImageFailure): result is RemoteImageFailure;
647
+ /**
648
+ * 宿主侧的外链抓取出口(与 `PageImageHost` 对称)。
649
+ *
650
+ * 注入与否就是「这个宿主抓不抓得到跨域字节」这个事实本身:
651
+ * 扩展的侧栏页能抓(实测,设计 14 §1),普通网页受同源策略抓不到,
652
+ * 于是在后者上工具压根不注册,而不是注册了每次都失败。
653
+ * @experimental
654
+ */
655
+ interface RemoteImageHost {
656
+ fetch(url: string, maxBytes: number): Promise<DocumentImage | RemoteImageFailure>;
657
+ }
658
+ /** @experimental */
659
+ declare function createRemoteImageHost(options?: {
660
+ fetch?: typeof globalThis.fetch;
661
+ }): RemoteImageHost;
662
+ //#endregion
503
663
  //#region src/dom/promotion.d.ts
504
664
  /**
505
665
  * 非标可交互元素的识别与角色提升(0.14.0 分册 15)。
@@ -519,9 +679,10 @@ interface RoleHint {
519
679
  /**
520
680
  * 句柄的用途(分册 14 §6.1)。`anchor` 只能做 `perceive_page` 的子树根,
521
681
  * 拿去 `act_on_page` 一律被拒——否则放宽读的范围会顺带放宽写的范围。
682
+ * `image`(0.22.0 FR-12.1)同理:它只能交给 `capture_page_image`。
522
683
  * @experimental
523
684
  */
524
- type HandleKind = 'action' | 'anchor';
685
+ type HandleKind = 'action' | 'anchor' | 'image';
525
686
  interface DomPerceptionReaderOptions {
526
687
  /** 选择器求值的根;缺省 `globalThis.document` */
527
688
  document?: Document;
@@ -647,6 +808,17 @@ type PageAgentRequest = {
647
808
  } | {
648
809
  type: 'execute';
649
810
  request: PageActionRequest;
811
+ } |
812
+ /**
813
+ * 取一张页面上的图(0.22.0 分册 12)。与 `execute` 同样按 ref 投回原帧。
814
+ *
815
+ * 与 `perceive` 的 `capture` 是**两条流**:那条取了图是为了让模型看懂(会走视觉委派),
816
+ * 这条取了图是为了落产物、进文档。两者不得互相触发(需求总览 §4 第 2 条)。
817
+ */
818
+ {
819
+ type: 'capture-image';
820
+ ref: string;
821
+ maxBytes: number;
650
822
  };
651
823
  /**
652
824
  * 应答。失败走 `error` 变体而**不是**让 `send()` reject:
@@ -666,6 +838,15 @@ type PageAgentReply = {
666
838
  } | {
667
839
  type: 'execute-result';
668
840
  outcome: PageActionOutcome;
841
+ } |
842
+ /**
843
+ * 取像结果。失败走 `result` 里的 `CaptureFailure` 而不是 `error` 变体:
844
+ * 「这张图取不到」是页面的事实,不是协议故障,而且 `triedLevels` 得原样带回去(FR-12.4)。
845
+ * 图片字节走 base64 字符串,**不是** `number[]`(AC-11.10)。
846
+ */
847
+ {
848
+ type: 'capture-image-result';
849
+ result: DocumentImage | CaptureFailure;
669
850
  } | {
670
851
  type: 'error';
671
852
  code: string;
@@ -853,6 +1034,33 @@ interface RemotePageActionExecutorOptions {
853
1034
  */
854
1035
  declare function createRemotePageActionExecutor(options: RemotePageActionExecutorOptions): PageActionExecutor;
855
1036
  //#endregion
1037
+ //#region src/remote/pageImage.d.ts
1038
+ /**
1039
+ * 宿主页面取像端口(0.22.0 分册 12 FR-12.1)。
1040
+ *
1041
+ * 只有一个方法,且**不含授权**:授权卡、会话记忆、产物落盘都在引擎那一侧。
1042
+ * 宿主交出来的就是「把这个句柄指的那张图变成字节」这一件事。
1043
+ * @experimental
1044
+ */
1045
+ interface PageImageHost {
1046
+ capture(ref: string, maxBytes: number): Promise<DocumentImage | CaptureFailure>;
1047
+ }
1048
+ /** @experimental */
1049
+ interface RemotePageImageHostOptions {
1050
+ transport: PageAgentTransport;
1051
+ /** 单次取像超时毫秒;缺省 10000 */
1052
+ timeoutMs?: number;
1053
+ }
1054
+ /**
1055
+ * 跨上下文的取像端口(分册 12 §2)。
1056
+ *
1057
+ * 与 `createRemotePageActionExecutor` 同一条装配规矩:句柄表在页面那一侧,
1058
+ * 这边只负责把一次请求送过去。**不与感知期的取像共用任何状态**——
1059
+ * 那条流是为了让模型看懂,这条流是为了落产物,两者不得互相触发。
1060
+ * @experimental
1061
+ */
1062
+ declare function createRemotePageImageHost(options: RemotePageImageHostOptions): PageImageHost;
1063
+ //#endregion
856
1064
  //#region src/remote/handler.d.ts
857
1065
  /** @experimental */
858
1066
  interface PageAgentHandlerOptions {
@@ -972,6 +1180,10 @@ interface FrameRouter {
972
1180
  execute(request: PageAgentRequest & {
973
1181
  type: 'execute';
974
1182
  }): Promise<PageAgentReply>;
1183
+ /** 取像(0.22.0 分册 12):与 `execute` 同一条寻址规矩,句柄发自哪一帧就投回哪一帧 */
1184
+ captureImage(request: PageAgentRequest & {
1185
+ type: 'capture-image';
1186
+ }): Promise<PageAgentReply>;
975
1187
  }
976
1188
  /**
977
1189
  * 逐帧下钻并汇总(分册 16 FR-16.2 / FR-16.3 / FR-16.4,分册 11 FR-11.2)。
@@ -983,45 +1195,6 @@ interface FrameRouter {
983
1195
  */
984
1196
  declare function createFrameRouter<A>(options: FrameRouterOptions<A>): FrameRouter;
985
1197
  //#endregion
986
- //#region src/dom/imageCapture.d.ts
987
- /**
988
- * 取像级别(0.6.0 FR-12.1)。裁决 D-3 已取消 L3 栅格化,只剩两级。
989
- * @experimental
990
- */
991
- type CaptureLevel = 'src' | 'canvas';
992
- /** @experimental */
993
- interface CapturedImage {
994
- id: string;
995
- mimeType: string;
996
- /** base64,不含 `data:` 前缀 */
997
- data: string;
998
- level: CaptureLevel;
999
- originalBytes: number;
1000
- /** 压缩后字节数;未压缩时与 `originalBytes` 相同 */
1001
- bytes: number;
1002
- }
1003
- /** @experimental */
1004
- interface CaptureFailure {
1005
- id: string;
1006
- /** 必须说明是哪一级、为什么;只写 "image unavailable" 不足以让用户判断该怎么办 */
1007
- reason: string;
1008
- triedLevels: readonly CaptureLevel[];
1009
- }
1010
- /** @experimental */
1011
- declare function isCaptureFailure(result: CapturedImage | CaptureFailure): result is CaptureFailure;
1012
- /** 只有这三种标签能取像;其余元素连取像入口都不进(FR-12.1,由 T-02-15 守门) @experimental */
1013
- declare function isCapturableElement(element: Element): boolean;
1014
- /**
1015
- * 取一个元素的图像(0.6.0 FR-12.1)。
1016
- *
1017
- * 按元素类型分派,不做无意义的尝试:`<img>` 只走 L1,`<canvas>` / `<svg>` 只走 L2,
1018
- * 两者互不兜底。失败返回 `CaptureFailure` 而不是抛错——一张图抓不到不该让整次感知失败。
1019
- * @experimental
1020
- */ declare function captureElementImage(element: Element, options: {
1021
- id: string;
1022
- maxBytes: number;
1023
- }): Promise<CapturedImage | CaptureFailure>;
1024
- //#endregion
1025
1198
  //#region src/host/protocol.d.ts
1026
1199
  /** 主线程 → Worker 的 LLM 配置;mockResponses 供 E2E/测试注入确定性 Mock */
1027
1200
  interface LlmClientConfig {
@@ -1435,7 +1608,207 @@ declare const XLSX_UNEXTRACTED: readonly ["styles", "conditional formatting", "m
1435
1608
  */
1436
1609
  declare function extractXlsxText(bytes: Uint8Array): Promise<string>;
1437
1610
  //#endregion
1611
+ //#region src/document/docxBlocks.d.ts
1612
+ /** 图宽占正文宽度的门槛:低于它的是签名章、页眉 logo、装饰线(FR-22.9) @experimental */
1613
+ declare const DOCX_IMAGE_WIDTH_RATIO = 0.3;
1614
+ /** @experimental */
1615
+ declare function createDocxBlockReader(): DocxDocumentReader;
1616
+ /**
1617
+ * @throws WebSkillError 归档损坏、缺 `word/document.xml`、XML 解析失败
1618
+ * @experimental
1619
+ */
1620
+ declare function readDocxBlocks(bytes: Uint8Array): Promise<DocxDocumentContent>;
1621
+ //#endregion
1622
+ //#region src/document/xlsxBlocks.d.ts
1623
+ /**
1624
+ * xlsx → 行流 + 图(0.21.0 分册 22 · FR-22.10/22.11)。
1625
+ *
1626
+ * 图不是浮在表外的附件,它压着某几行几列——按锚点插回行流里,
1627
+ * 模型才知道「这张图说的是上面那几行」。
1628
+ */
1629
+ /** 值得单独烧一次多模态的图:至少跨 2 列、3 行(FR-22.11) @experimental */
1630
+ declare const XLSX_IMAGE_MIN_COLUMNS = 2;
1631
+ /** @experimental */
1632
+ declare const XLSX_IMAGE_MIN_ROWS = 3;
1633
+ /** @experimental */
1634
+ declare function createXlsxBlockReader(): XlsxDocumentReader;
1635
+ /**
1636
+ * @throws WebSkillError 归档损坏、旧版 `.xls`、缺 `xl/workbook.xml`、工作表关系解不开、XML 解析失败
1637
+ * @experimental
1638
+ */
1639
+ declare function readXlsxBlocks(bytes: Uint8Array): Promise<XlsxDocumentContent>;
1640
+ //#endregion
1641
+ //#region src/document/pptxBlocks.d.ts
1642
+ /** @experimental */
1643
+ declare function createPptxBlockReader(): PptxDocumentReader;
1644
+ /**
1645
+ * @throws WebSkillError 归档损坏、缺 `ppt/presentation.xml`、XML 解析失败
1646
+ * @experimental
1647
+ */
1648
+ declare function readPptxBlocks(bytes: Uint8Array): Promise<PptxDocumentContent>;
1649
+ //#endregion
1650
+ //#region src/document/pptx.d.ts
1651
+ /**
1652
+ * pptx 正文抽取(0.22.0 分册 18)。
1653
+ *
1654
+ * 与 `readPptxBlocks` 同源:文本形态只是把逐页的文本块按放映顺序拼起来,
1655
+ * 两条路给出的文字因此**永远一致**——同一份文稿不会因为走哪条路而多出或少掉一段。
1656
+ *
1657
+ * ⚠️ 与 docx/xlsx 一样依赖 `DOMParser`,所以只在 `@webskill/browser`。
1658
+ */
1659
+ /**
1660
+ * **不抽取**的内容,逐条写明而不是笼统说「尽力而为」:
1661
+ * 版式、动画、切换效果、母版与版式上的模板文字、图表的底层数据。
1662
+ *
1663
+ * 插图不在此列但也不在文本里:图要按页取,走 `read_document`。
1664
+ */
1665
+ declare const PPTX_UNEXTRACTED: readonly ["layout and positioning", "animations and transitions", "master and layout placeholders", "chart source data", "pictures"];
1666
+ /** 抽不出任何文字时的占位,与 docx/xlsx 同款口径 @experimental */
1667
+ declare const PPTX_UNEXTRACTED_NOTICE: string;
1668
+ /**
1669
+ * @throws WebSkillError 归档损坏、缺 `ppt/presentation.xml`、XML 解析失败
1670
+ * @experimental
1671
+ */
1672
+ declare function extractPptxText(bytes: Uint8Array): Promise<string>;
1673
+ //#endregion
1674
+ //#region src/document/xlsxTemplate.d.ts
1675
+ interface XlsxTemplateSheet {
1676
+ readonly name: string;
1677
+ /** dimension,如 `A1:H19` */
1678
+ readonly range: string;
1679
+ /** `formula` 在时这格由模板算出,不得填(FR-42.28);共享公式已按本格行号展开 */
1680
+ readonly cells: ReadonlyArray<{
1681
+ readonly address: string;
1682
+ readonly text: string;
1683
+ readonly formula?: string;
1684
+ }>;
1685
+ readonly merges: readonly string[];
1686
+ readonly columnWidths: readonly number[];
1687
+ }
1688
+ interface XlsxTemplateSkeleton {
1689
+ readonly sheets: readonly XlsxTemplateSheet[];
1690
+ }
1691
+ interface XlsxCellFill {
1692
+ readonly sheet?: string;
1693
+ readonly address: string;
1694
+ readonly value: string;
1695
+ }
1696
+ interface XlsxRowInsert {
1697
+ readonly sheet?: string;
1698
+ /** 1 基:新行从这一行开始插 */
1699
+ readonly at: number;
1700
+ readonly count: number;
1701
+ /** 1 基:照抄哪一行的样式与行高。默认用 `at - 1` */
1702
+ readonly copyStyleFrom?: number;
1703
+ }
1704
+ interface XlsxImagePlacement {
1705
+ readonly sheet?: string;
1706
+ /** 落点单元格;若它是某个合并区的左上角,图按整个合并区缩放 */
1707
+ readonly address: string;
1708
+ readonly bytes: Uint8Array;
1709
+ /** `png` / `jpeg` */
1710
+ readonly extension: string;
1711
+ readonly contentType: string;
1712
+ }
1713
+ interface XlsxTemplateSpec {
1714
+ readonly rows?: readonly XlsxRowInsert[];
1715
+ readonly cells?: readonly XlsxCellFill[];
1716
+ readonly images?: readonly XlsxImagePlacement[];
1717
+ }
1718
+ /** 读带坐标的骨架(FR-42.1)。模型据此决定往哪儿写。 */
1719
+ declare function readXlsxTemplate(bytes: Uint8Array): Promise<XlsxTemplateSkeleton>;
1720
+ /**
1721
+ * 照模板出新文件。
1722
+ *
1723
+ * 顺序是**先插行、后填值**:填值用的地址是插行之后的坐标,反过来会逼模型心算偏移。
1724
+ *
1725
+ * @throws WebSkillError 模板不是 xlsx、地址不合法、目标不存在、插行越界
1726
+ */
1727
+ declare function fillXlsxTemplate(bytes: Uint8Array, spec: XlsxTemplateSpec): Promise<Uint8Array>;
1728
+ //#endregion
1729
+ //#region src/document/docxTemplate.d.ts
1730
+ interface DocxTemplateParagraph {
1731
+ /** 0 基,正文段落序号(表格内的段落不计入) */
1732
+ readonly index: number;
1733
+ readonly text: string;
1734
+ }
1735
+ interface DocxTemplateCell {
1736
+ readonly table: number;
1737
+ readonly row: number;
1738
+ readonly column: number;
1739
+ readonly text: string;
1740
+ readonly gridSpan?: number;
1741
+ readonly vMerge?: string;
1742
+ }
1743
+ interface DocxTemplateSkeleton {
1744
+ readonly paragraphs: readonly DocxTemplateParagraph[];
1745
+ readonly cells: readonly DocxTemplateCell[];
1746
+ }
1747
+ interface DocxTextFill {
1748
+ readonly paragraph?: number;
1749
+ readonly table?: number;
1750
+ readonly row?: number;
1751
+ readonly column?: number;
1752
+ readonly value: string;
1753
+ }
1754
+ interface DocxImagePlacement {
1755
+ readonly paragraph?: number;
1756
+ readonly table?: number;
1757
+ readonly row?: number;
1758
+ readonly column?: number;
1759
+ readonly bytes: Uint8Array;
1760
+ readonly extension: string;
1761
+ readonly contentType: string;
1762
+ }
1763
+ interface DocxTemplateSpec {
1764
+ readonly texts?: readonly DocxTextFill[];
1765
+ readonly images?: readonly DocxImagePlacement[];
1766
+ }
1767
+ /** 读带坐标的骨架(FR-42.1) */
1768
+ declare function readDocxTemplate(bytes: Uint8Array): Promise<DocxTemplateSkeleton>;
1769
+ /**
1770
+ * 照模板出新文件。
1771
+ *
1772
+ * @throws WebSkillError 模板不是 docx、坐标指到不存在的表 / 行 / 列 / 段落、图片认不出来
1773
+ */
1774
+ declare function fillDocxTemplate(bytes: Uint8Array, spec: DocxTemplateSpec): Promise<Uint8Array>;
1775
+ //#endregion
1776
+ //#region src/document/ooxmlPart.d.ts
1777
+ /** 解开后的包:部件名 → 字节。顺序即写回顺序。 */
1778
+ type OoxmlPackage = Map<string, Uint8Array>;
1779
+ /** @throws WebSkillError 归档损坏,或不是 OOXML(缺 `[Content_Types].xml`) */
1780
+ declare function readOoxmlPackage(bytes: Uint8Array): Promise<OoxmlPackage>;
1781
+ declare function writeOoxmlPackage(pkg: OoxmlPackage): Uint8Array;
1782
+ /**
1783
+ * 结构自检(AC-42.27)。
1784
+ *
1785
+ * 「打开不提示修复」没法进 CI(本仓没有可脚本化的 Office 实现,见设计 10 §6.2),
1786
+ * 但迄今实测出的坏文件成因都是结构性的:悬空关系、没登记的扩展名、解析不了的部件。
1787
+ * 这三条能当场查出来,所以每次重封之前都查一遍。
1788
+ *
1789
+ * @returns 英文问题描述,空数组表示干净
1790
+ */
1791
+ declare function auditOoxmlPackage(pkg: OoxmlPackage): string[];
1792
+ //#endregion
1438
1793
  //#region src/viewer/viewerCsp.d.ts
1794
+ /**
1795
+ * 投放面图片来源的单一事实源(0.22.0 分册 13 FR-13.9)。
1796
+ *
1797
+ * **不含宿主自身**:两套宿主写法不同——站点写自己的 origin(opaque origin 下 `'self'` 匹配不上),
1798
+ * 扩展的 sandbox 页写 `'self'`。能收敛的是**除宿主之外**放行了哪些来源,
1799
+ * 而那恰恰是会漂走的部分(扩展的 sandbox CSP 此前整条 `img-src` 都不存在,等于全放)。
1800
+ * @experimental
1801
+ */
1802
+ declare const VIEWER_IMG_SRC_BASE: readonly string[];
1803
+ /**
1804
+ * 降级形态(外链图,FR-13.6)额外需要的来源。
1805
+ *
1806
+ * ⚠️ 加它进来的代价见 `ViewerCspOptions.imgSrc`:投放面因此多了一条外发信道。
1807
+ * `http:` 也在其中,因为需求裁决了「`http` 尽力而为」(分册 13 §2.2)——
1808
+ * 抓得到就嵌字节,抓不到才落到这条外链上,此时拦掉它只会让图变成一个破图标。
1809
+ * @experimental
1810
+ */
1811
+ declare const VIEWER_IMG_SRC_REMOTE: readonly string[];
1439
1812
  /** 宿主可配置的白名单方向;技能声明不了这些(FR-18.3 第 3 条) */
1440
1813
  interface ViewerCspOptions {
1441
1814
  /**
@@ -1450,7 +1823,15 @@ interface ViewerCspOptions {
1450
1823
  hostOrigin: string;
1451
1824
  /** 文档可外发的目标;缺省 `'none'` —— 数据经 postMessage 下发,不需要外连 */
1452
1825
  connectSrc?: readonly string[];
1453
- /** 图片来源;缺省宿主自身 + `data:`(内联图不走网络) */
1826
+ /**
1827
+ * 图片来源;缺省宿主自身 + `data:`(内联图不走网络)。
1828
+ *
1829
+ * ⚠️ **放行外链图等于给投放面开了一条外发信道**:图片 URL 的路径与 query
1830
+ * 能携带文档内容,`connect-src` 至今守着的那条线(0.11.0 AC-18.5)会因此被绕开一半。
1831
+ * 因此它不是 SDK 的默认值,只能由宿主显式给出(0.22.0 FR-13.10 / FR-13.11)。
1832
+ * 需要它的场景只有一个:宁主拓不到字节时,图以外链形态进文档(FR-13.6)。
1833
+ * 放宽时用 `VIEWER_IMG_SRC_REMOTE`,不要自己拼一份。
1834
+ */
1454
1835
  imgSrc?: readonly string[];
1455
1836
  /** 字体来源;缺省只有宿主自身,外链公文字体需宿主显式放行(FR-20.5) */
1456
1837
  fontSrc?: readonly string[];
@@ -1464,6 +1845,20 @@ interface ViewerCspOptions {
1464
1845
  declare function viewerCspHeader(options: ViewerCspOptions): string;
1465
1846
  /** 本版固定的 sandbox token(供判据与装配文档引用,避免第二份清单) */
1466
1847
  declare const VIEWER_SANDBOX_TOKENS: readonly string[];
1848
+ /** `diffSandboxTokens` 的结果;两个方向分开报,守卫才说得出是哪一侧漂了 */
1849
+ interface SandboxTokenDiff {
1850
+ /** SDK 要求、宿主没给的 token;非空即投放面拿不到它该有的能力 */
1851
+ missingInHost: string[];
1852
+ /** 宿主多给的 token;不是错,但必须有署名 */
1853
+ extraInHost: string[];
1854
+ }
1855
+ /**
1856
+ * 比对 SDK 的固定清单与宿主实际下发的清单(分册 15 AC-15.2)。
1857
+ *
1858
+ * 宿主可以是超集——扩展的 `view.html` 与站点的 viewer 不是同一个宿主,
1859
+ * 但多出来的每一个 token 都得有人认领,否则清单就在悳悳中漂走。
1860
+ */
1861
+ declare function diffSandboxTokens(sdk: readonly string[], host: readonly string[]): SandboxTokenDiff;
1467
1862
  //#endregion
1468
1863
  //#region src/viewer/documentSurface.d.ts
1469
1864
  /**
@@ -1503,7 +1898,32 @@ interface OpenDocumentInput {
1503
1898
  /** 数据来源描述,进告知与审计 */
1504
1899
  dataSource: string;
1505
1900
  document: ViewerDocument;
1506
- }
1901
+ /**
1902
+ * 已填进 `document.html` 的图片事实(0.22.0 FR-10.7)。
1903
+ *
1904
+ * 像素维度只能靠它:`document` 里图片是 base64 的压缩字节,
1905
+ * 从载荷本身看不出解码后会占多少位图内存。
1906
+ */
1907
+ images?: readonly ViewerImageFact[];
1908
+ /**
1909
+ * 解析阶段丢掉的图片(0.22.0 FR-11.8)。
1910
+ *
1911
+ * 进审计而**不**参与预算核算:它们一个字节也没进载荷。留痕的意义在于
1912
+ * 事后能回答「这份文档为什么缺了一张图」——那是本版要消灭的静默失败。
1913
+ */
1914
+ omissions?: readonly ImageOmission[];
1915
+ }
1916
+ /** 超软阈值时随确认一并交给宿主的事实;措辞由宿主写(FR-10.4) */
1917
+ interface PayloadSizeNotice {
1918
+ /** 载荷的 UTF-16 code unit 数 */
1919
+ units: number;
1920
+ /** 图片解码后的总像素数 */
1921
+ pixels: number;
1922
+ /** 是哪一维进了软区间 */
1923
+ trigger: PayloadDimension;
1924
+ }
1925
+ /** 载荷预算的两个维度(0.22.0 FR-10.7) */
1926
+ type PayloadDimension = 'bytes' | 'pixels' | 'both';
1507
1927
  interface DocumentSurfaceOptions {
1508
1928
  /** 宿主的 viewer 路由地址(必须能下发 CSP 响应头,见 viewerCsp.ts) */
1509
1929
  viewerUrl: string;
@@ -1511,10 +1931,23 @@ interface DocumentSurfaceOptions {
1511
1931
  confirm(input: {
1512
1932
  skillName: string;
1513
1933
  dataSource: string;
1934
+ sizeNotice?: PayloadSizeNotice;
1514
1935
  }): Promise<boolean>;
1515
1936
  audit?: DocumentSurfaceAudit;
1516
- /** 投递载荷上限;超限拒绝而不是静默截断(AC-18.11) */
1937
+ /**
1938
+ * 载荷硬兜底;超限拒绝而不是静默截断(AC-18.11)。
1939
+ *
1940
+ * 名字里的 `Bytes` 是历史口径:实际比较的是 UTF-16 code unit 数(`PayloadCost.units`)。
1941
+ * 逼近阈值的载荷必然是图片主导的,而 base64 是纯 ASCII,两者 1:1;
1942
+ * CJK 文本会被低估约 3 倍,但要达到硬兜底得有上亿个汉字。
1943
+ */
1517
1944
  maxPayloadBytes?: number;
1945
+ /** 载荷软阈值;超过它照常打开,只是给 `confirm` 带一条 `sizeNotice`(FR-10.4/10.5) */
1946
+ softPayloadBytes?: number;
1947
+ /** 图片总像素硬兜底(FR-10.7) */
1948
+ maxPayloadPixels?: number;
1949
+ /** 图片总像素软阈值(FR-10.7) */
1950
+ softPayloadPixels?: number;
1518
1951
  /** 握手超时;viewer 起不来时不能无限等 */
1519
1952
  handshakeTimeoutMs?: number;
1520
1953
  /** 仅供测试注入;缺省用 `window.open` */
@@ -1526,7 +1959,20 @@ interface WindowLike {
1526
1959
  close(): void;
1527
1960
  postMessage(message: unknown, targetOrigin: string): void;
1528
1961
  }
1529
- declare const DEFAULT_MAX_VIEWER_PAYLOAD_BYTES = 2000000;
1962
+ /**
1963
+ * 载荷硬兜底(0.22.0 FR-10.1)。
1964
+ *
1965
+ * 从 0.11.0 的 2 MB 提到这里,是因为那个值从未被论证过,而实测表明它离任何真实边界都很远:
1966
+ * 128 MB 的结构化克隆只要 23 ms,V8 的字符串上限在 512 MB 左右才会抛 `RangeError`。
1967
+ * 留 4 倍余量是给同一个标签页里的 React、图表库与对话历史用的。
1968
+ */
1969
+ declare const DEFAULT_MAX_VIEWER_PAYLOAD_BYTES = 128000000;
1970
+ /** 载荷软阈值:到这里不是「慢」,而是「这份文档异常大」,值得先告诉用户一声 */
1971
+ declare const DEFAULT_SOFT_VIEWER_PAYLOAD_BYTES = 32000000;
1972
+ /** 像素硬兜底,约合 1 GB 位图;实测 60 张 4000×3000 达 2.7 GB,那是崩标签页的量级 */
1973
+ declare const DEFAULT_MAX_VIEWER_PAYLOAD_PIXELS = 256000000;
1974
+ /** 像素软阈值,约合 256 MB 位图;实测 60 M 像素仍然流畅 */
1975
+ declare const DEFAULT_SOFT_VIEWER_PAYLOAD_PIXELS = 64000000;
1530
1976
  /** 审计事件类型(与既有事件同一条链) */
1531
1977
  declare const DOCUMENT_SURFACE_AUDIT_EVENT = "document.surface.open";
1532
1978
  /**
@@ -1622,4 +2068,639 @@ declare function watchBlockedResources(host: ViewerBlockedHost, notice: ViewerBl
1622
2068
  /** 提示文案的单一来源;判据直接引用,不各写一份字面量 */
1623
2069
  declare function blockedMessage(origins: readonly string[]): string;
1624
2070
  //#endregion
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 };
2071
+ //#region src/weboffice/types.d.ts
2072
+ /**
2073
+ * WPS WebOffice 接入的环境无关契约(0.21.0 分册 11 FR-11.5 / 分册 12 FR-12.1)。
2074
+ *
2075
+ * 这里只有类型与常量,没有任何 `chrome.*` 与 DOM——扩展是消费方,不是唯一可能的消费方。
2076
+ * 劫持本身(依赖 MV3 的 `world:"MAIN"`)留在扩展里。
2077
+ */
2078
+ /**
2079
+ * SDK v2.0.5 的 `OfficeType` 枚举。
2080
+ *
2081
+ * 值取自真实发行包 `web-office-sdk-solution-v2.0.5.umd.js` 里 `WebOfficeSDK.OfficeType`
2082
+ * 的运行时快照——注意 `Dbt`/`KSheet` 是**长值**,与包内另一处 URL 拼装用的单字母枚举
2083
+ * 不是同一个对象。早先按单字母登记,导致真实站点上指纹恒不匹配、挂钩静默退场(DV-16)。
2084
+ *
2085
+ * **这份常量是唯一事实源**:MAIN world 注入包不许 import 本模块(会把 SDK 代码
2086
+ * 带进页面世界),只能抄一份,两处由 `test/webOfficeMirrors.test.ts` 比对。
2087
+ * @experimental
2088
+ */
2089
+ declare const WEB_OFFICE_OFFICE_TYPES: {
2090
+ readonly Spreadsheet: "s";
2091
+ readonly Writer: "w";
2092
+ readonly Presentation: "p";
2093
+ readonly Pdf: "f";
2094
+ readonly Otl: "o";
2095
+ readonly Dbt: "dbt";
2096
+ readonly KSheet: "ksheet";
2097
+ };
2098
+ /** 本版支持抽取的四种。其余三种按 FR-12.1a 归因失败,不猜 @experimental */
2099
+ declare const WEB_OFFICE_SUPPORTED_TYPES: readonly ["w", "s", "p", "f"];
2100
+ type WebOfficeSupportedType = (typeof WEB_OFFICE_SUPPORTED_TYPES)[number];
2101
+ /** 登记表里一条实例。`handle` 之外的字段都来自 MAIN world,**只能进文案** @experimental */
2102
+ interface WebOfficeInstanceRecord {
2103
+ /** ISOLATED 侧生成的不可预测 id;不复用 WPS 的 instanceId(FR-11.3a) */
2104
+ handle: string;
2105
+ /** 原样取自 init 参数,不做校验——它决定读法,不参与授权(分册 14 §3.1) */
2106
+ officeType: string;
2107
+ /** 仅用于展示与去重,不做信任判定(FR-11.3 / §4.2) */
2108
+ fileId?: string;
2109
+ /** 承载它的 iframe id;`init` 返回时往往还没建出来 */
2110
+ iframeId?: string;
2111
+ documentUrl: string;
2112
+ state: 'initialising' | 'ready' | 'failed';
2113
+ }
2114
+ /** 一次抽取的产物。`kind` 由 officeType 映射,不由内容推断(FR-12.1a) @experimental */
2115
+ type WebOfficeContent = {
2116
+ kind: 'document';
2117
+ title?: string;
2118
+ blocks: DocumentBlock[];
2119
+ } | {
2120
+ kind: 'workbook';
2121
+ sheets: WorkbookSheet[];
2122
+ } | {
2123
+ kind: 'presentation';
2124
+ slides: PresentationSlide[];
2125
+ } | {
2126
+ kind: 'pdf';
2127
+ source: 'text' | 'vision';
2128
+ pages: PdfPage[];
2129
+ };
2130
+ /** @experimental */
2131
+ interface DocumentBlock {
2132
+ type: 'heading' | 'paragraph' | 'listItem' | 'tableRow';
2133
+ /** 只在样式名精确匹配 `Heading 1..6` / `标题 1..6` 时出现;不靠字号猜(FR-12.2c) */
2134
+ level?: number;
2135
+ text: string;
2136
+ }
2137
+ /** @experimental */
2138
+ interface WorkbookSheet {
2139
+ name: string;
2140
+ /** 空单元格是 `null`,与空字符串区分(与分册 10 FR-10.2a 同口径) */
2141
+ rows: (string | number | boolean | null)[][];
2142
+ /** 还剩多少没读。取剩下的走 `WebOfficeReadResult.next`(FR-12.6c) */
2143
+ truncated?: {
2144
+ rows: number;
2145
+ columns: number;
2146
+ };
2147
+ /** 预算先用完了,这张表一行都没读到。名字仍然列出——整张表凭空消失才是最坏的截断 */
2148
+ unread?: true;
2149
+ }
2150
+ /** @experimental */
2151
+ interface PresentationSlide {
2152
+ index: number;
2153
+ title?: string;
2154
+ body: string[];
2155
+ notes?: string;
2156
+ /** shape 总数多于取到文本的 shape 数时出现:图片/图表里的字没读到(FR-12.4c) */
2157
+ unreadableShapes?: number;
2158
+ /** 这一页自己插的图(FR-12.4d)。只有走原件直链解包时才有 */
2159
+ imageIds?: string[];
2160
+ }
2161
+ /** @experimental */
2162
+ interface PdfPage {
2163
+ /**
2164
+ * `source==='text'` 时是文档页码;
2165
+ * `source==='vision'` 时是**截屏序号**——视觉通道只有滚动位置,不知道文档分页。
2166
+ * 上层不得当页码用(分册 13 §5.4)。
2167
+ */
2168
+ index: number;
2169
+ text?: string;
2170
+ /**
2171
+ * 这一页对应的图片分片 id。两种来源:
2172
+ * `source==='vision'` 时是那一屏的截屏;
2173
+ * `source==='text'` 时是从原件字节渲染出的**整页图**——
2174
+ * 这一页文字读不出、或页上有 ≥15% 面积的图时才有(FR-23.3)。
2175
+ */
2176
+ imageId?: string;
2177
+ }
2178
+ /**
2179
+ * 续读游标(FR-12.6c)。坐标自包含,**不在实例侧存任何状态**——
2180
+ * 实例的生命周期由页面控制(SPA 一次路由切换就没了),
2181
+ * 存游标就得回答「游标失效后怎么办」,而完整坐标没有这个问题。
2182
+ * @experimental
2183
+ */
2184
+ interface WebOfficeReadCursor {
2185
+ /** 工作簿:从第几张表继续(0 基,不含 WPS 的内部表) */
2186
+ sheet?: number;
2187
+ /** 工作簿:该表内从第几行继续(0 基) */
2188
+ row?: number;
2189
+ /** 文档:从第几个段落继续(0 基) */
2190
+ block?: number;
2191
+ /** PDF:从第几页继续(0 基) */
2192
+ page?: number;
2193
+ }
2194
+ /**
2195
+ * 一次读取的完整结果:内容 + 诚实的边角料。
2196
+ * 截断与未抽取项都在这里,因为它们要和内容一起进模型上下文(FR-12.6a)。
2197
+ * @experimental
2198
+ */
2199
+ interface WebOfficeReadResult {
2200
+ content: WebOfficeContent;
2201
+ /** 触顶的预算项,英文短句,模型据此知道内容不全 */
2202
+ truncation?: string[];
2203
+ /** 还有后续内容时给出的续读坐标;缺席即读完了(FR-12.6c) */
2204
+ next?: WebOfficeReadCursor;
2205
+ /** 视觉通道的相邻截屏重叠说明(AC-12.5) */
2206
+ overlapNote?: string;
2207
+ /**
2208
+ * 有图但本次没取的单元(分册 26 FR-26.2)。
2209
+ * 空清单时**缺席**:报一个 0 会让模型以为自己确认过没有图。
2210
+ */
2211
+ deferred?: {
2212
+ images: number;
2213
+ units: WebOfficeReadCursor[];
2214
+ note: string;
2215
+ };
2216
+ }
2217
+ /**
2218
+ * 本版**不抽取**什么。逐条写出来而不是笼统说「尽力而为」——
2219
+ * 用户要能知道自己没看到的是哪些东西(FR-12.10)。
2220
+ * @experimental
2221
+ */
2222
+ declare const WEBOFFICE_UNEXTRACTED: readonly ["styling, fonts, colours and borders", "images and charts (a screenshot captures them, but nothing is extracted from them)", "tracked changes and comments", "formula expressions (only cached values are read)", "hidden rows, hidden columns and hidden slides are not marked as hidden", "headers and footers", "embedded objects (OLE)"];
2223
+ /** 读取的通道。`vision` 要截整个可见标签页,因此授权与记忆都与 jssdk 分开(FR-13.4c) @experimental */
2224
+ type WebOfficeChannel = 'jssdk' | 'vision';
2225
+ //#endregion
2226
+ //#region src/weboffice/fingerprint.d.ts
2227
+ /**
2228
+ * 版本护栏(FR-11.6)。指纹只用 `init` 之前就看得到的东西:版本不认识时不能有任何读取尝试(AC-11.8)。
2229
+ *
2230
+ * 判据是**结构指纹**而不是 `WebOfficeSDK.version`。v2.0.5 确实带 `version` 静态属性
2231
+ * (分册 11 §1.2 的实测表原先漏记了这一项,DV-16 已补),但护栏要挡的是「形状变了」,
2232
+ * 版本号相同而形状变化、或号变而形状不变,都不该改变结论。
2233
+ */
2234
+ /** 判定的输入形状:页面赋进来的那个对象上的 `OfficeType` @experimental */
2235
+ interface WebOfficeFingerprintResult {
2236
+ supported: boolean;
2237
+ /** 不支持时的英文原因,写明检测到什么、期望什么(FR-11.6b) */
2238
+ reason?: string;
2239
+ }
2240
+ /**
2241
+ * 逐条比对 `OfficeType`:七项全中放行,多出来的新类型也放行(WPS 加一种文档类型
2242
+ * 不该让整个能力失效),缺一项或值不同即拒绝。
2243
+ * @experimental
2244
+ */
2245
+ declare function checkWebOfficeFingerprint(officeType: unknown): WebOfficeFingerprintResult;
2246
+ /** 便利包装:不支持时抛结构化错误,供调用点一行接入 @experimental */
2247
+ declare function assertWebOfficeFingerprint(officeType: unknown): void;
2248
+ //#endregion
2249
+ //#region src/weboffice/failures.d.ts
2250
+ /**
2251
+ * 失败归因(FR-11.7 / AC-11.9)。
2252
+ *
2253
+ * 「读不到这份文档」有五种完全不同的原因,用户的下一步也完全不同:
2254
+ * 换个页面、等一会儿、这个 SDK 我们不认识、这种文档没有这个能力、网络不通。
2255
+ * 混成一个 `TOOL_UNSUPPORTED` 就等于什么也没说。
2256
+ */
2257
+ type WebOfficeFailure = {
2258
+ kind: 'no-instance';
2259
+ } | {
2260
+ kind: 'not-ready';
2261
+ } | {
2262
+ kind: 'unsupported-version';
2263
+ detected: string;
2264
+ } | {
2265
+ kind: 'capability-absent';
2266
+ officeType: string;
2267
+ method: string;
2268
+ } | {
2269
+ kind: 'timeout';
2270
+ };
2271
+ /** @experimental */
2272
+ declare function webOfficeFailure(failure: WebOfficeFailure): WebSkillError;
2273
+ //#endregion
2274
+ //#region src/weboffice/handle.d.ts
2275
+ /**
2276
+ * 跨世界引用实例用的 id(FR-11.3a / AC-11.6)。
2277
+ *
2278
+ * 生成过程**不读任何入参**——不读 WPS 的 instanceId、不读 fileId、不读 DOM 顺序。
2279
+ * 那些值页面全都看得到也改得了,用它们派生等于让「不可预测」变成一句话。
2280
+ * 调用点必须在 ISOLATED 侧:MAIN 世界生成的任何值页面都读得到(分册 12 §3)。
2281
+ */
2282
+ /** @experimental */
2283
+ declare function createWebOfficeHandle(): string;
2284
+ //#endregion
2285
+ //#region src/weboffice/port.d.ts
2286
+ /**
2287
+ * 抽取协调器与桥之间的唯一接口(分册 13 §8 的硬性结构要求)。
2288
+ *
2289
+ * 协调器只认这个端口,不认扩展的消息通道——否则预算、截断、
2290
+ * 错误归因这些判据全都得开浏览器才能测,而它们本身没有一行浏览器代码。
2291
+ * @experimental
2292
+ */
2293
+ interface WebOfficeReadPort {
2294
+ /** `api.ready` 下发的方法名快照。一个实例只探一次,缓存归实现方(FR-12.8b) */
2295
+ describe(handle: string): Promise<WebOfficeApiSurface>;
2296
+ /** 调一个只读方法。返回值来自 MAIN world,**不可信**,用前必须判形状 */
2297
+ call(handle: string, method: string, args?: readonly unknown[]): Promise<unknown>;
2298
+ /** ②级:iframe 内被窥探到的原始 PDF 字节;没有即 undefined(FR-12.5b) */
2299
+ takeCapturedPdf?(handle: string): Promise<Uint8Array | undefined>;
2300
+ /** ⓪级:原件直链取回的演示文稿字节;没有即 undefined(FR-12.4d) */
2301
+ takeCapturedPresentation?(handle: string): Promise<Uint8Array | undefined>;
2302
+ }
2303
+ /**
2304
+ * 演示文稿原件的解包器(FR-12.4d)。
2305
+ *
2306
+ * 与 `PdfDocumentReader` 同一个道理:实现要 zip 库,只有浏览器扩展用得上,
2307
+ * 所以 SDK 只留接口,实现由宿主注入。**这里不是渲染器**——pptx 包里没有页面图。
2308
+ * @experimental
2309
+ */
2310
+ interface PresentationSourceReader {
2311
+ read(bytes: Uint8Array): Promise<PresentationSourceDocument>;
2312
+ }
2313
+ /** @experimental */
2314
+ interface PresentationSourceDocument {
2315
+ readonly slides: readonly PresentationSourceSlide[];
2316
+ }
2317
+ /** @experimental */
2318
+ interface PresentationSourceSlide {
2319
+ /** 形状顺序的文本,已去空 */
2320
+ readonly texts: readonly string[];
2321
+ /** 演讲者备注;没有即空串 */
2322
+ readonly notes: string;
2323
+ /** 只属于这一页的图。母版/版式上的模板底图不在其中(FR-12.4d 纪律 1) */
2324
+ readonly images: readonly {
2325
+ readonly mimeType: string;
2326
+ readonly data: string;
2327
+ }[];
2328
+ /** 这一页上解不了的媒体数(tiff/emf/wmf/视频)。进 FR-12.4c 的分母 */
2329
+ readonly skippedMedia: number;
2330
+ }
2331
+ /** @experimental */
2332
+ interface WebOfficeApiSurface {
2333
+ readonly methods: ReadonlySet<string>;
2334
+ /** 探测时刻,用于诊断上游漂移 */
2335
+ readonly capturedAt: number;
2336
+ }
2337
+ /**
2338
+ * 视觉通道的宿主出口。滚动在 iframe 内的 MAIN world 做(父页面滚不动跨源 iframe),
2339
+ * 截屏在扩展页做(`captureVisibleTab` 是唯一能拍到跨源 iframe 的途径)。
2340
+ * @experimental
2341
+ */
2342
+ interface WebOfficeVisionPort {
2343
+ /** 滚一屏并回报位置;到底时 `done` 为真 */
2344
+ scroll(handle: string): Promise<WebOfficeScrollPosition>;
2345
+ /** 拍一张并压到预算内;tab 已切走时抛错(FR-13.5c) */
2346
+ capture(handle: string): Promise<{
2347
+ mimeType: string;
2348
+ data: string;
2349
+ }>;
2350
+ }
2351
+ /** @experimental */
2352
+ interface WebOfficeScrollPosition {
2353
+ scrollTop: number;
2354
+ viewportHeight: number;
2355
+ done: boolean;
2356
+ /** 3s 内没等到渲染稳定就拍了(分册 13 §5.2);模型要知道这一张可能没画完 */
2357
+ unsettled?: boolean;
2358
+ }
2359
+ /**
2360
+ * 只读方法白名单(需求 §4.3 的第一层结构性阻断)。
2361
+ *
2362
+ * 调用器只接受这里面的名字,写方法从来不在里面——「只读」因此是结构上的,
2363
+ * 不是靠调用方自律。第二层是 `test/webOfficeReadOnly.test.ts` 的静态守卫。
2364
+ * @experimental
2365
+ */
2366
+ declare const WEB_OFFICE_READ_METHODS: {
2367
+ /** Writer 分支 A:一次取回全文 */
2368
+ readonly documentText: "GetDocumentText";
2369
+ /** Writer 分支 B:段落级遍历,带样式名 */
2370
+ readonly paragraphs: "GetParagraphs";
2371
+ /** 表格:工作表名清单 */
2372
+ readonly sheetNames: "GetSheetNames";
2373
+ /** 表格分支 A:区域级取值,一次一块 */
2374
+ readonly usedRange: "GetUsedRange";
2375
+ /** 表格分支 B:行级取值 */
2376
+ readonly sheetRows: "GetSheetRows";
2377
+ /** 表格分支 C:只有单元格级 → 按 FR-12.3a 转视觉通道 */
2378
+ readonly cell: "GetCell";
2379
+ readonly slideCount: "GetSlideCount";
2380
+ readonly slideTitle: "GetSlideTitle";
2381
+ readonly slideBody: "GetSlideBody";
2382
+ readonly slideNotes: "GetSlideNotes";
2383
+ readonly pdfPageCount: "GetPageCount";
2384
+ readonly pdfPageText: "GetPageText";
2385
+ };
2386
+ /** @experimental */
2387
+ declare function isWebOfficeReadMethod(method: string): boolean;
2388
+ /** 预算(FR-12.6)。三个计数器都装在发起读取的这一侧——MAIN world 的代码页面能改 @experimental */
2389
+ declare const WEBOFFICE_BUDGET: {
2390
+ readonly roundTrips: 200;
2391
+ readonly totalMs: 60000;
2392
+ readonly cellsPerRead: 20000;
2393
+ readonly visionPages: 50;
2394
+ /**
2395
+ * 区域级取值一次取多少**行**。
2396
+ * 单位是行不是格(DV-9):按格数折算行数的话,同一份表列数一多往返次数就跟着涨,
2397
+ * 「列数从 20 加到 40 往返次数不变」这条验收就过不了。
2398
+ */
2399
+ readonly rowsPerChunk: 200;
2400
+ /** 文本类内容的截断口径与附件一致,不另立标准 */
2401
+ readonly textChars: number;
2402
+ };
2403
+ type WebOfficeBudget = typeof WEBOFFICE_BUDGET;
2404
+ /**
2405
+ * 触到预算就停,并把停的原因留下——与分册 10「一律拒绝」相反:
2406
+ * 那边产出的是给人下载的文件,少几行没有线索;这边产出的是给模型看的上下文,
2407
+ * 截断有标记就是诚实的(FR-12.6a)。
2408
+ * @experimental
2409
+ */
2410
+ declare class WebOfficeBudgetGuard {
2411
+ #private;
2412
+ constructor(budget?: WebOfficeBudget, now?: () => number);
2413
+ /**
2414
+ * 让预算守卫顺带看住本次 run 的取消信号。
2415
+ *
2416
+ * 每个读取循环都已经在每一轮开头问一次 `spent()`,取消挂在这里就等于挂在了
2417
+ * 所有循环上;散在各处单独判 `signal.aborted` 迟早会漏掉一条分支——
2418
+ * 而漏掉的那条正是「按了终止却还在读」的那条。
2419
+ */
2420
+ stopOn(signal: AbortSignal): void;
2421
+ get roundTrips(): number;
2422
+ get truncation(): readonly string[];
2423
+ /** 触顶即返回 true,调用方停止继续读并保留已读到的部分 */
2424
+ spent(): boolean;
2425
+ countRoundTrip(): void;
2426
+ note(message: string): void;
2427
+ }
2428
+ /**
2429
+ * 调一个只读方法:先查白名单,再查描述符,最后才调(FR-12.8a)。
2430
+ *
2431
+ * 「描述符里没有」与「调用失败」必须是两个错误码——混成一个,用户就无法判断
2432
+ * 是「换个文档试试」还是「这功能不支持」。
2433
+ * @experimental
2434
+ */
2435
+ declare function callWebOfficeMethod(port: WebOfficeReadPort, surface: WebOfficeApiSurface, guard: WebOfficeBudgetGuard, handle: string, officeType: string, method: string, args?: readonly unknown[]): Promise<unknown>;
2436
+ //#endregion
2437
+ //#region src/weboffice/extract.d.ts
2438
+ /**
2439
+ * 抽取协调器(分册 12)。
2440
+ *
2441
+ * 全部判据——走哪条分支、什么时候停、截断怎么说——都在这一层,
2442
+ * 与它对话的只有 `WebOfficeReadPort`,因此十一条验收里有八条不用开浏览器就能测。
2443
+ */
2444
+ /** @experimental */
2445
+ interface WebOfficeExtractOptions {
2446
+ handle: string;
2447
+ /** 原样来自 init 参数;决定读法,不参与授权判定 */
2448
+ officeType: string;
2449
+ mode?: 'auto' | 'vision' | 'images';
2450
+ /** 上一次返回的 `next`。不传即从头读(FR-12.6c) */
2451
+ from?: WebOfficeReadCursor;
2452
+ vision?: WebOfficeVisionPort;
2453
+ /** ②级:iframe 里窥到的原始 PDF 字节 → 文本。扩展注入 pdfjs,SDK 不打包它 */
2454
+ pdfExtractor?(bytes: Uint8Array): Promise<string>;
2455
+ /**
2456
+ * ⓪级:同一份字节 → 逐页文本 + 整页渲染(FR-23.1)。
2457
+ * 类型取分册 22 已导出的那个端口,扩展里两条路共用同一份实现。
2458
+ */
2459
+ pdfDocumentReader?: PdfDocumentReader;
2460
+ /** ⓪级(演示文稿):原件字节 → 逐页文本与本页插图(FR-12.4d) */
2461
+ presentationReader?: PresentationSourceReader;
2462
+ guard?: WebOfficeBudgetGuard;
2463
+ /** 本次 run 的取消信号;用户按下终止后不再继续往下读(FR-13.9) */
2464
+ signal?: AbortSignal;
2465
+ onImage?(image: {
2466
+ id: string;
2467
+ mimeType: string;
2468
+ data: string;
2469
+ }): void;
2470
+ }
2471
+ /**
2472
+ * 样式名 → 标题级别。**只认精确匹配**(FR-12.2c):
2473
+ * 靠字号或粗体猜标题,猜错的那份大纲比没有大纲更误导人。
2474
+ * @experimental
2475
+ */
2476
+ declare function headingLevelOf(style: unknown): number | undefined;
2477
+ /** officeType → 内容形态(FR-12.1a)。三种不支持的类型在这里就被挡住 @experimental */
2478
+ declare function contentKindOf(officeType: string): WebOfficeContent['kind'] | undefined;
2479
+ /** @experimental */
2480
+ declare function extractWebOfficeContent(port: WebOfficeReadPort, options: WebOfficeExtractOptions): Promise<WebOfficeReadResult>;
2481
+ //#endregion
2482
+ //#region src/weboffice/vision.d.ts
2483
+ /**
2484
+ * 视觉通道(FR-12.7)。它不是「①②都失败时才走的兜底分支」——
2485
+ * 那样它在测试里一次都不会执行。`mode: 'vision'` 是显式入口(FR-12.5e)。
2486
+ */
2487
+ /**
2488
+ * 相邻两屏重叠的说明(AC-12.5)。
2489
+ *
2490
+ * 去重**不裁图**:裁重叠带需要精确像素对齐,裁错就是丢内容。
2491
+ * 改成如实告知——模型知道两张图有一段是同一片内容就不会把它数两遍。
2492
+ * @experimental
2493
+ */
2494
+ declare function describeScreenshotOverlap(positions: readonly WebOfficeScrollPosition[]): string | undefined;
2495
+ /** @experimental */
2496
+ interface VisionCaptureOptions {
2497
+ handle: string;
2498
+ vision: WebOfficeVisionPort;
2499
+ guard?: WebOfficeBudgetGuard;
2500
+ maxPages?: number;
2501
+ /** 图片分片 id 的前缀;同一次读取内唯一即可 */
2502
+ idPrefix?: string;
2503
+ /** 收图片分片的出口:协调器把它们交给工具层拼进 ToolResult */
2504
+ onImage(image: {
2505
+ id: string;
2506
+ mimeType: string;
2507
+ data: string;
2508
+ }): void;
2509
+ }
2510
+ /**
2511
+ * 滚一屏、拍一张,直到到底或触顶。
2512
+ * `PdfPage.index` 在这里填的是**截屏序号**,不是文档页码——视觉通道只有滚动位置。
2513
+ * @experimental
2514
+ */
2515
+ declare function captureByScrolling(options: VisionCaptureOptions): Promise<WebOfficeReadResult>;
2516
+ //#endregion
2517
+ //#region src/weboffice/authTypes.d.ts
2518
+ /** 三种动作各自确认。列出、读取、截屏对用户是三件不同的事(FR-13.4c) @experimental */
2519
+ type WebOfficeAction = 'list' | 'read' | 'capture';
2520
+ /**
2521
+ * 判定用的钥匙——**全部来自扩展自己**,页面改不了。
2522
+ *
2523
+ * 分界线是「这个值能不能让一次本该弹卡的操作变成不弹卡」:
2524
+ * `origin` 能(记忆按站点粒度),所以它必须可信;
2525
+ * `officeType` 不能(它只决定怎么读、卡上显示成什么),所以它可以来自页面。
2526
+ * @experimental
2527
+ */
2528
+ interface WebOfficeAuthorizationKey {
2529
+ /** 由扩展从 tab / frame 信息取得,不是页面自称的 */
2530
+ readonly origin: string;
2531
+ readonly tabId: number;
2532
+ /** ISOLATED 侧生成的不可预测 id */
2533
+ readonly handle: string;
2534
+ }
2535
+ /**
2536
+ * 卡上要显示、但**页面说了算**的东西(FR-13.2a)。
2537
+ * `claimed` 前缀就是标注本身:渲染层拿到的每个字段名都在提醒它是谁说的。
2538
+ *
2539
+ * 判定模块不 import 本类型——不是「记得别用」,是结构上够不着。
2540
+ * @experimental
2541
+ */
2542
+ interface WebOfficeDisplayHints {
2543
+ readonly claimedOfficeType?: string;
2544
+ readonly claimedFileId?: string;
2545
+ }
2546
+ /**
2547
+ * 「不再询问」的记忆端口。**粒度归宿主**:SDK 不知道装配方把记忆记在
2548
+ * 站点、标签页还是单份文档上,写死就是替宿主谎报授权范围(与 D-20-2 同一条思路)。
2549
+ *
2550
+ * 宿主实现了记忆就**必须**实现 `describeScope`:卡上那句「这个站点」的
2551
+ * 唯一合法来源是宿主,SDK 没资格替它宣称。
2552
+ * @experimental
2553
+ */
2554
+ interface WebOfficeConsent {
2555
+ recall(action: WebOfficeAction, key: WebOfficeAuthorizationKey): boolean | Promise<boolean>;
2556
+ remember(action: WebOfficeAction, key: WebOfficeAuthorizationKey): void | Promise<void>;
2557
+ describeScope?(action: WebOfficeAction, key: WebOfficeAuthorizationKey): string | undefined;
2558
+ }
2559
+ /**
2560
+ * 一次读取的留痕(FR-13.6)。
2561
+ *
2562
+ * **没有内容字段,也不会有**:审计要回答的是「什么时候、在哪个站点、读了什么类型的东西」。
2563
+ * 把文档正文抄进审计日志,等于把一次披露变成两次——而且第二次是持久化的。
2564
+ * @experimental
2565
+ */
2566
+ interface WebOfficeAuditRecord {
2567
+ at: string;
2568
+ origin: string;
2569
+ action: WebOfficeAction;
2570
+ /** 页面自称的类型,字段名保留 `claimed` 以免日后被当成事实读 */
2571
+ claimedOfficeType?: string;
2572
+ channel: WebOfficeChannel;
2573
+ /** 这次是靠记忆放行的还是当场问的 */
2574
+ rememberHit: boolean;
2575
+ }
2576
+ //#endregion
2577
+ //#region src/weboffice/policy.d.ts
2578
+ /**
2579
+ * 扩展(或别的宿主)提供的 WebOffice 接入面。**不注入即整条能力不存在**:
2580
+ * 工具不注册,模型看不到它——与下载文件、页面操作同一条思路。
2581
+ * @experimental
2582
+ */
2583
+ interface WebOfficeHost {
2584
+ /** 当前上下文里已捕获的实例。每次调用重新枚举,顺带清掉 iframe 已消失的那些 */
2585
+ list(): Promise<readonly WebOfficeInstanceRecord[]>;
2586
+ /**
2587
+ * handle → 可信钥匙。**只能由宿主给**:origin 与 tabId 是授权判定的输入,
2588
+ * 让页面参与提供它们,等于把「记住这个站点」变成页面可以自选的东西。
2589
+ */
2590
+ keyOf(handle: string): Promise<WebOfficeAuthorizationKey | undefined>;
2591
+ read: WebOfficeReadPort;
2592
+ /** 视觉通道。不注入即需要截屏的文档读不了,而不是静默给空内容 */
2593
+ vision?: WebOfficeVisionPort;
2594
+ /** 原始 PDF 字节 → 文本。扩展装 pdfjs,SDK 不打包它 */
2595
+ pdfExtractor?(bytes: Uint8Array): Promise<string>;
2596
+ /**
2597
+ * 原始 PDF 字节 → 逐页文本 + 整页渲染(FR-23.1)。不注入即 PDF 里的图读不到,
2598
+ * 而不是报错——与 `vision` / `pdfExtractor` 同口径(FR-23.7)。
2599
+ * 它**不参与授权判定**:渲染源是已经在本地的字节,不读屏幕(FR-23.6)。
2600
+ */
2601
+ pdfDocumentReader?: PdfDocumentReader;
2602
+ /**
2603
+ * 演示文稿原件字节 → 逐页文本与本页插图(FR-12.4d)。
2604
+ * 不注入即 PPT 只走 jssdk 形状遍历,口径同 `pdfDocumentReader`。
2605
+ */
2606
+ presentationReader?: PresentationSourceReader;
2607
+ }
2608
+ /** @experimental */
2609
+ interface WebOfficePolicyOptions {
2610
+ host?: WebOfficeHost;
2611
+ /** 授权卡出口。**必填**:接不上就构造不出策略,没有 fail-open 这条路 */
2612
+ ui: ConsentUi;
2613
+ consent?: WebOfficeConsent;
2614
+ audit?: PageAuditSink;
2615
+ auditTarget?: string;
2616
+ now?(): string;
2617
+ /** 等待用的延时。默认 `setTimeout`;测试注入立即兑现的版本,免得为一条时序判据真等几秒 */
2618
+ sleep?(ms: number): Promise<void>;
2619
+ }
2620
+ /** 模型看得到的实例摘要。字段名带 `claimed` 的都来自页面 @experimental */
2621
+ interface WebOfficeListing {
2622
+ handle: string;
2623
+ claimedOfficeType: string;
2624
+ claimedFileId?: string;
2625
+ ready: boolean;
2626
+ }
2627
+ /** @experimental */
2628
+ interface WebOfficeReadOptions {
2629
+ handle?: string;
2630
+ mode?: 'auto' | 'vision' | 'images';
2631
+ /** 上一次返回的 `next`,取剩下的那部分(FR-12.6c) */
2632
+ from?: WebOfficeReadCursor;
2633
+ /** 同一 run 内的重复请求不重弹卡,也不重复记拒绝(FR-13.7) */
2634
+ runId: string;
2635
+ /** 本次 run 的取消信号;一份上百页的文档读到一半被叫停,就得真的停 */
2636
+ signal?: AbortSignal;
2637
+ onImage?(image: {
2638
+ id: string;
2639
+ mimeType: string;
2640
+ data: string;
2641
+ }): void;
2642
+ }
2643
+ /**
2644
+ * WebOffice 读取策略(分册 13)。
2645
+ *
2646
+ * 三道闸门:宿主接没接、用户认不认、这次要不要额外的截屏授权。
2647
+ * 视觉通道的授权是**懒的**——`auto` 模式一路降级到截屏时才弹,
2648
+ * 因为在那之前谁也不知道这份文档需不需要拍照。
2649
+ * @experimental
2650
+ */
2651
+ declare class WebOfficePolicy {
2652
+ #private;
2653
+ constructor(options: WebOfficePolicyOptions);
2654
+ get enabled(): boolean;
2655
+ list(runId: string): Promise<readonly WebOfficeListing[]>;
2656
+ read(options: WebOfficeReadOptions): Promise<WebOfficeReadResult>;
2657
+ }
2658
+ //#endregion
2659
+ //#region src/weboffice/authorization.d.ts
2660
+ /**
2661
+ * 授权判定(分册 13 FR-13.3)。
2662
+ *
2663
+ * 本模块**只 import `WebOfficeAuthorizationKey`**,不 import `WebOfficeDisplayHints`:
2664
+ * 页面自称的值想混进判定,得先有人在这里加一行 import——那是 review 看得见的动作,
2665
+ * 而不是某次改动里悄悄多读了一个字段。
2666
+ */
2667
+ /** @experimental */
2668
+ interface WebOfficeAuthorizationInput {
2669
+ action: WebOfficeAction;
2670
+ key: WebOfficeAuthorizationKey;
2671
+ channel: WebOfficeChannel;
2672
+ ui: ConsentUi;
2673
+ consent?: WebOfficeConsent;
2674
+ /**
2675
+ * 卡上要显示的、来自页面的自称值。**只透传进 `details`,判定一个字节都不读**。
2676
+ * 类型是宽松的字符串字典而不是具体接口:这里根本不该有「知道它长什么样」的能力。
2677
+ */
2678
+ display?: Readonly<Record<string, string>>;
2679
+ /** 卡 id 的序号,来自调用方的计数器 */
2680
+ seq: number;
2681
+ }
2682
+ /** @experimental */
2683
+ interface WebOfficeAuthorizationOutcome {
2684
+ approved: boolean;
2685
+ /** 靠记忆放行的这次没有弹卡 */
2686
+ rememberHit: boolean;
2687
+ }
2688
+ /** @experimental */
2689
+ declare function resolveWebOfficeAuthorization(input: WebOfficeAuthorizationInput): Promise<WebOfficeAuthorizationOutcome>;
2690
+ //#endregion
2691
+ //#region src/weboffice/toolSource.d.ts
2692
+ declare const LIST_WEBOFFICE_DOCUMENTS_TOOL = "list_weboffice_documents";
2693
+ declare const READ_WEBOFFICE_DOCUMENT_TOOL = "read_weboffice_document";
2694
+ /** @experimental */
2695
+ interface WebOfficeToolSourceOptions {
2696
+ policy: WebOfficePolicy;
2697
+ }
2698
+ /**
2699
+ * 把 WebOffice 读取接到工具协议上(分册 13 §7)。
2700
+ *
2701
+ * 宿主没接或开关没开时 `listToolSpecs()` 返回空数组——模型连它的存在都看不到。
2702
+ * @experimental
2703
+ */
2704
+ declare function createWebOfficeToolSource(options: WebOfficeToolSourceOptions): ExternalToolSource;
2705
+ //#endregion
2706
+ 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, DEFAULT_MAX_VIEWER_PAYLOAD_PIXELS, DEFAULT_SOFT_VIEWER_PAYLOAD_BYTES, DEFAULT_SOFT_VIEWER_PAYLOAD_PIXELS, DOCUMENT_IMAGE_MIME_TYPES, DOCUMENT_SURFACE_AUDIT_EVENT, DOCX_IMAGE_WIDTH_RATIO, DOCX_UNEXTRACTED, type DictationAvailability, type DictationOptions, type DictationSession, type DocumentBlock, type DocumentImage, type DocumentLocationView, type DocumentSurfaceAudit, type DocumentSurfaceOptions, type DocxImagePlacement, type DocxTemplateCell, type DocxTemplateParagraph, type DocxTemplateSkeleton, type DocxTemplateSpec, type DocxTextFill, type DomPageActionExecutor, type DomPageActionOptions, type DomPerceptionReader, type DomPerceptionReaderOptions, type FetchLinkedDocumentOptions, type FetchRemoteImageOptions, 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, LIST_WEBOFFICE_DOCUMENTS_TOOL, type LlmClientConfig, type LlmEntryConfig, MAX_REMOTE_IMAGE_BYTES, type MainToWorkerMessage, type OoxmlPackage, type OpenDocumentInput, OpfsProvider, PPTX_UNEXTRACTED, PPTX_UNEXTRACTED_NOTICE, type PageAgentHandler, type PageAgentHandlerOptions, type PageAgentReply, type PageAgentRequest, type PageAgentTargetEntry, type PageAgentTransport, type PageDocumentIdentity, type PageImageHost, type PayloadDimension, type PayloadSizeNotice, type PdfPage, type PortApplicability, type PortReport, type PortSpec, type PortStatus, type PresentationSlide, type PresentationSourceDocument, type PresentationSourceReader, type PresentationSourceSlide, READ_WEBOFFICE_DOCUMENT_TOOL, REMOTE_IMAGE_TIMEOUT_MS, type RemoteFetchFailure, type RemoteImageFailure, type RemoteImageHost, type RemotePageActionExecutorOptions, type RemotePageImageHostOptions, type RemotePerceptionReaderOptions, type RemoteTargetRegistry, type RemoteTargetRegistryOptions, type RoleHint, SANDBOX_PAGE_SCRIPT_SOURCE, SHARD_SOFT_LIMIT, type SandboxMode, type SandboxTokenDiff, type SeedSkillsFromHttpOptions, type SerializedError, type TargetResolution, TsTranspiler, type TypeScriptSupportOptions, VIEWER_IMG_SRC_BASE, VIEWER_IMG_SRC_REMOTE, VIEWER_SANDBOX_TOKENS, type ViewerBlockedHost, type ViewerBlockedNotice, type ViewerBlockedResult, type ViewerCspOptions, type ViewerDocument, type ViewerShellHost, type ViewerShellMount, type ViewerShellResult, type VisionCaptureOptions, WEBOFFICE_BUDGET, WEBOFFICE_UNEXTRACTED, WEB_OFFICE_OFFICE_TYPES, WEB_OFFICE_READ_METHODS, WEB_OFFICE_SUPPORTED_TYPES, WORKER_BOOTSTRAP_SOURCE, type WebOfficeAction, type WebOfficeApiSurface, type WebOfficeAuditRecord, type WebOfficeAuthorizationInput, type WebOfficeAuthorizationKey, type WebOfficeAuthorizationOutcome, type WebOfficeBudget, WebOfficeBudgetGuard, type WebOfficeChannel, type WebOfficeConsent, type WebOfficeContent, type WebOfficeDisplayHints, type WebOfficeExtractOptions, type WebOfficeFailure, type WebOfficeFingerprintResult, type WebOfficeHost, type WebOfficeInstanceRecord, type WebOfficeListing, WebOfficePolicy, type WebOfficePolicyOptions, type WebOfficeReadCursor, type WebOfficeReadOptions, type WebOfficeReadPort, type WebOfficeReadResult, type WebOfficeScrollPosition, type WebOfficeSupportedType, type WebOfficeToolSourceOptions, type WebOfficeVisionPort, type WindowLike, type WorkbookSheet, type WorkerEvent, type WorkerFactory, type WorkerLike, type WorkerRequest, WorkerRuntimeClient, type WorkerRuntimeClientDeps, type WorkerRuntimeHostOverrides, type WorkerScopeLike, WorkerUiBridge, XLSX_IMAGE_MIN_COLUMNS, XLSX_IMAGE_MIN_ROWS, XLSX_UNEXTRACTED, type XlsxCellFill, type XlsxImagePlacement, type XlsxRowInsert, type XlsxTemplateSheet, type XlsxTemplateSkeleton, type XlsxTemplateSpec, assertWebOfficeFingerprint, auditOoxmlPackage, blockedMessage, bridgeError, callWebOfficeMethod, captureByScrolling, captureDocumentImage, captureElementImage, capturePhoto, checkCameraAvailability, checkDictationAvailability, checkWebOfficeFingerprint, classifyFetchFailure, compressImageToBudget, contentKindOf, createBrowserChatbotHost, createDocumentSurfaceHost, createDocxBlockReader, createDomPageActionExecutor, createDomPerceptionReader, createEncryptedMemoryStore, createFetchLinkedDocumentReader, createFrameRouter, createIframeWorker, createLlmClient, createPageAgentHandler, createPptxBlockReader, createRemoteImageHost, createRemotePageActionExecutor, createRemotePageImageHost, createRemotePerceptionReader, createRemoteTargetRegistry, createWebOfficeHandle, createWebOfficeToolSource, createXlsxBlockReader, deleteMemoryEncryptionKey, describeScreenshotOverlap, diffSandboxTokens, documentKey, explainResolution, extractDocxText, extractPptxText, extractWebOfficeContent, extractXlsxText, extractZipWeb, fetchRemoteImage, fillDocxTemplate, fillXlsxTemplate, generateMemoryEncryptionKey, headingLevelOf, inspectHostWiring, installWebSkillNavigator, isCapturableElement, isCaptureFailure, isEncryptedMemoryValue, isOpfsAvailable, isRemoteImageFailure, isWebOfficeReadMethod, missingPorts, openCamera, openDocumentSurface, openMemoryEncryptionKey, parseBridgeRequest, parseMainMessage, parseWorkerEvent, probeChromeBuiltinAvailability, readDocxBlocks, readDocxTemplate, readOoxmlPackage, readPptxBlocks, readXlsxBlocks, readXlsxTemplate, resolveWebOfficeAuthorization, seedSkillsFromHttp, sha256HexWeb, startDictation, startViewerShell, startWorkerRuntimeHost, toDocumentImage, viewerCspHeader, watchBlockedResources, webOfficeFailure, writeOoxmlPackage };