@webskill/sdk 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent.d.ts +3 -2
- package/dist/agent.js +3 -1102
- package/dist/browser.d.ts +258 -11
- package/dist/browser.js +763 -47
- package/dist/{catalogComponents-DTcYfpLQ-CcoOaz-Z.js → catalogComponents-BgAJN0p8-C3K8klJd.js} +508 -923
- package/dist/dist-DU9KDAuR.js +1468 -0
- package/dist/{dist-1OFC-zax.js → dist-DqcL6jKO.js} +668 -60
- package/dist/{dist-BViUeszk.js → dist-sdKFgERo.js} +956 -115
- package/dist/{echarts-DhNm2ene.js → echarts-De78wXqV.js} +599 -61
- package/dist/{eventTypes-s2uwAcLG-Go3l_dUe.js → eventTypes-FllCrX-Z-DNDeHWoG.js} +6 -2
- package/dist/governance.d.ts +7 -3
- package/dist/governance.js +1 -1
- package/dist/{index-B0QPLWPZ.d.ts → index-3fCHc1mQ.d.ts} +198 -11
- package/dist/{index-DtFdMKBX.d.ts → index-C9pzXLKy.d.ts} +366 -9
- package/dist/{index-BF4E1a9j.d.ts → index-DFhU1uks.d.ts} +286 -19
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -3
- package/dist/mcp.d.ts +58 -7
- package/dist/mcp.js +124 -21
- package/dist/node.d.ts +3 -3
- package/dist/node.js +60 -4
- package/dist/{openUiLibrary-CIrV--Ad-B8zG_91e.js → openUiLibrary-BKXW7Iwx-DaymVubt.js} +3 -3
- package/dist/processSandboxEntry.js +8 -1
- package/dist/sandboxWorkerEntry.js +8 -1
- package/dist/{skillVersionStore-D-qHk9ZE-DBsYYCWn.d.ts → skillVersionStore-D-qHk9ZE-DheTIwAB.d.ts} +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/{types-CrRcT-LM-DZAp8sWv.d.ts → types-DLctJep_-B5G4uk2u.d.ts} +22 -5
- package/dist/ui-react.d.ts +13 -4
- package/dist/ui-react.js +93 -259
- package/dist/ui-vue.d.ts +1 -1
- package/dist/ui-vue.js +2 -2
- package/dist/ui.d.ts +4 -4
- package/dist/ui.js +3 -3
- package/dist/{webskillLitCatalog-BJrphK0y-SGmRXaaO.js → webskillLitCatalog-D_zCqeQF-C9lrvvMr.js} +135 -16
- package/package.json +1 -1
package/dist/browser.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Ct as VerifyResult, L as FileStat, M as ArchiveLimits, R as FileSystemProvider, S as UiBridge, _t as SkillsLockfile, b as RenderResultRequest, c as InteractionResponse, dt as SkillManifest, l as LlmClient, m as LlmStreamEvent, o as InteractionPolicy, p as LlmResponse, s as InteractionRequest, st as SkillInstallSource, u as LlmCompleteInput, v as MemoryStore, wt as WebSkillError, xt as UnsignedPolicy, yt as TrustedKeyStore } from "./types-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { Ct as VerifyResult, L as FileStat, M as ArchiveLimits, R as FileSystemProvider, S as UiBridge, _t as SkillsLockfile, b as RenderResultRequest, c as InteractionResponse, dt as SkillManifest, l as LlmClient, m as LlmStreamEvent, o as InteractionPolicy, p as LlmResponse, s as InteractionRequest, st as SkillInstallSource, u as LlmCompleteInput, v as MemoryStore, wt as WebSkillError, xt as UnsignedPolicy, yt as TrustedKeyStore } from "./types-DLctJep_-B5G4uk2u.js";
|
|
2
|
+
import { Bt as ScriptExecutionContext, F as ExternalToolSource, Nn as WebSkillApi, P as ExternalSkillProvider, Rn as bridgeError, S as BridgeResponse, Vt as ScriptExecutor, cr as parseBridgeRequest, dn as ToolResult, it as NetworkPolicy, ln as ToolDefinition, m as ApprovalScope, nt as LinkedDocumentReader, x as BridgeRequest, y as BridgeCapabilities } from "./index-C9pzXLKy.js";
|
|
3
|
+
import { H as PagePerceptionPolicy, J as PerceivedNode, L as PageActionScopeInput, Q as PerceptionResult, W as PagePerceptionReader, X as PerceptionCaptureOptions, et as PerceptionScopeInput, k as PageActionExecutor } from "./index-DFhU1uks.js";
|
|
4
4
|
//#region ../browser/dist/index.d.ts
|
|
5
5
|
//#region src/fs/featureDetection.d.ts
|
|
6
6
|
/** 检测当前环境是否可用 OPFS(navigator.storage.getDirectory) */
|
|
@@ -374,14 +374,25 @@ interface DomPerceptionReaderOptions {
|
|
|
374
374
|
* 可操作范围(需求 23)。缺省即**不发任何句柄**,感知结果与 0.6.0 逐字相同。
|
|
375
375
|
* 它与感知范围分开声明:可读不等于可操作(FR-23.1)。
|
|
376
376
|
*/
|
|
377
|
-
actionScope?:
|
|
377
|
+
actionScope?: PageActionScopeInput;
|
|
378
378
|
}
|
|
379
379
|
/** DOM 遍历是同步的;不取像时比 `PagePerceptionReader` 窄,调用方无需 await @experimental */
|
|
380
380
|
interface DomPerceptionReader extends PagePerceptionReader {
|
|
381
|
-
read(scope:
|
|
382
|
-
read(scope:
|
|
381
|
+
read(scope: PerceptionScopeInput): readonly PerceivedNode[];
|
|
382
|
+
read(scope: PerceptionScopeInput, capture: PerceptionCaptureOptions): Promise<PerceptionResult>;
|
|
383
383
|
/** 把句柄换回元素;未知或已过期的句柄返回 undefined。供执行器使用,不自建第二张表 */
|
|
384
384
|
resolve(ref: string): Element | undefined;
|
|
385
|
+
/** 句柄所属的帧;主文档目标返回 undefined(FR-24.6 的确认卡措辞与审计据此区分) */
|
|
386
|
+
frameOf(ref: string): string | undefined;
|
|
387
|
+
/** 操作前的活动模态快照;与操作后做差集即「本次新打开的模态」(FR-25.6) */
|
|
388
|
+
modalSnapshot(): ReadonlySet<Element>;
|
|
389
|
+
/** 把新出现的模态纳入授权面,返回被提升的那个(没有则 undefined) */
|
|
390
|
+
elevateNewModals(before: ReadonlySet<Element>): Element | undefined;
|
|
391
|
+
/**
|
|
392
|
+
* 元素与模态的关系:不在模态里 / 在已提升的模态里 / 在未授权的模态里。
|
|
393
|
+
* 最后一种要给出可操作的拒绝理由,而不是笼统的「不在范围内」。
|
|
394
|
+
*/
|
|
395
|
+
modalStateOf(element: Element): 'none' | 'elevated' | 'unelevated';
|
|
385
396
|
/** 元素当前是否仍在可操作范围内(执行前的第二道闸门,AC-23.3) */
|
|
386
397
|
inActionScope(element: Element): boolean;
|
|
387
398
|
}
|
|
@@ -404,11 +415,19 @@ declare function createDomPerceptionReader(options?: DomPerceptionReaderOptions)
|
|
|
404
415
|
interface DomPageActionOptions {
|
|
405
416
|
/** 发放句柄的那个 reader;`resolve` / `inActionScope` 都从它取 */
|
|
406
417
|
reader: DomPerceptionReader;
|
|
418
|
+
/**
|
|
419
|
+
* `attach` 的文件来源(FR-25.5):**必须由用户手势触发**的选择器。
|
|
420
|
+
* 不注入即 `attach` 一律按「用户取消」处理 —— Agent 永远传不进本地路径。
|
|
421
|
+
*/
|
|
422
|
+
pickFiles?: () => Promise<readonly File[] | undefined>;
|
|
407
423
|
}
|
|
408
|
-
/**
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
424
|
+
/**
|
|
425
|
+
* @experimental
|
|
426
|
+
*
|
|
427
|
+
* ⚠️ 0.11.0 分册 25 起**不再是同步的**:`select` 要等下拉浮层出现,
|
|
428
|
+
* `attach` 要等用户在确认卡里选文件。接口本来就是 async,改的是这里的实现。
|
|
429
|
+
*/
|
|
430
|
+
type DomPageActionExecutor = PageActionExecutor;
|
|
412
431
|
/** @experimental */
|
|
413
432
|
declare function createDomPageActionExecutor(options: DomPageActionOptions): DomPageActionExecutor;
|
|
414
433
|
//#endregion
|
|
@@ -792,4 +811,232 @@ interface BrowserHostOptions {
|
|
|
792
811
|
}
|
|
793
812
|
declare function createBrowserChatbotHost(options: BrowserHostOptions): BrowserHostBundle;
|
|
794
813
|
//#endregion
|
|
795
|
-
|
|
814
|
+
//#region src/net/fetchLinkedDocument.d.ts
|
|
815
|
+
interface FetchLinkedDocumentOptions {
|
|
816
|
+
/**
|
|
817
|
+
* 宿主页面 origin,用于同源判定。缺省取 `location.origin`。
|
|
818
|
+
*
|
|
819
|
+
* **显式传 `undefined` 不等于取缺省**:拿不到 origin 时上游会一律按跨源处理,
|
|
820
|
+
* 即每次都问用户。那是保守方向,不是缺陷。
|
|
821
|
+
*/
|
|
822
|
+
origin?: string;
|
|
823
|
+
/** 注入点存在只为可测;生产装配留空即用全局 fetch */
|
|
824
|
+
fetch?: typeof globalThis.fetch;
|
|
825
|
+
/** 单次请求超时,缺省 30s */
|
|
826
|
+
timeoutMs?: number;
|
|
827
|
+
}
|
|
828
|
+
/**
|
|
829
|
+
* 默认的链接文档读取实现(分册 22 §2.2)。
|
|
830
|
+
*
|
|
831
|
+
* 出站准入(scheme / 私有地址)与同源判定都在**引擎侧**完成,这里只负责取字节:
|
|
832
|
+
* 把判定散到实现里,宿主换一个 reader 就能绕过整套闸门。
|
|
833
|
+
* @experimental
|
|
834
|
+
*/
|
|
835
|
+
declare function createFetchLinkedDocumentReader(options?: FetchLinkedDocumentOptions): LinkedDocumentReader;
|
|
836
|
+
//#endregion
|
|
837
|
+
//#region src/document/docx.d.ts
|
|
838
|
+
/**
|
|
839
|
+
* docx 正文抽取(分册 22 §2.4 / FR-23.7)。
|
|
840
|
+
*
|
|
841
|
+
* **零新增依赖**:zip 用仓内既有的 `unzipWithLimits`(自带解压体积上限,
|
|
842
|
+
* 顺带挡住 zip 炸弹),XML 用浏览器原生 `DOMParser`。
|
|
843
|
+
*
|
|
844
|
+
* ⚠️ `DOMParser` 是浏览器 API,Node 没有 —— 所以这个模块只在 `@webskill/browser`。
|
|
845
|
+
* Node 宿主没有 docx 能力,这是**显式声明**的限制(AC-G15),不是静默降级;
|
|
846
|
+
* 收紧到 Node 侧的备案是 D55。
|
|
847
|
+
*/
|
|
848
|
+
/**
|
|
849
|
+
* **不抽取**的内容,逐条写明而不是笼统说「尽力而为」:
|
|
850
|
+
* 样式、标题层级、图片、批注、修订、页眉页脚、脚注。
|
|
851
|
+
*
|
|
852
|
+
* 模型拿到的是纯正文文本流。把「这是 H1」这类信息也抽出来需要解析
|
|
853
|
+
* `styles.xml` 的样式继承链,那是另一个量级的工作,本版不做。
|
|
854
|
+
*/
|
|
855
|
+
declare const DOCX_UNEXTRACTED: readonly ["styles", "heading levels", "images", "comments", "tracked changes", "headers and footers", "footnotes"];
|
|
856
|
+
/**
|
|
857
|
+
* 从 docx 字节里抽出正文文本。
|
|
858
|
+
*
|
|
859
|
+
* @throws WebSkillError 归档损坏、缺 `word/document.xml`、XML 解析失败
|
|
860
|
+
*/
|
|
861
|
+
declare function extractDocxText(bytes: Uint8Array): Promise<string>;
|
|
862
|
+
//#endregion
|
|
863
|
+
//#region src/viewer/viewerCsp.d.ts
|
|
864
|
+
/** 宿主可配置的白名单方向;技能声明不了这些(FR-18.3 第 3 条) */
|
|
865
|
+
interface ViewerCspOptions {
|
|
866
|
+
/**
|
|
867
|
+
* 提供 viewer 路由的宿主来源,例如 `https://app.example`。**必填**。
|
|
868
|
+
*
|
|
869
|
+
* ⚠️ 这里**不能**用 `'self'`:文档被 `sandbox` 指令推进了 opaque origin,
|
|
870
|
+
* 而 `'self'` 匹配的是文档自身的来源——opaque origin 匹配不上任何 URL,
|
|
871
|
+
* 于是外壳自己的脚本先被挡住,页面变成一片空白。
|
|
872
|
+
* 同理,宿主还必须给 viewer 的静态资源回 `Access-Control-Allow-Origin`:
|
|
873
|
+
* 模块脚本是带 `crossorigin` 的跨源请求,`Origin: null` 拿不到默认放行。
|
|
874
|
+
*/
|
|
875
|
+
hostOrigin: string;
|
|
876
|
+
/** 文档可外发的目标;缺省 `'none'` —— 数据经 postMessage 下发,不需要外连 */
|
|
877
|
+
connectSrc?: readonly string[];
|
|
878
|
+
/** 图片来源;缺省宿主自身 + `data:`(内联图不走网络) */
|
|
879
|
+
imgSrc?: readonly string[];
|
|
880
|
+
/** 字体来源;缺省只有宿主自身,外链公文字体需宿主显式放行(FR-20.5) */
|
|
881
|
+
fontSrc?: readonly string[];
|
|
882
|
+
}
|
|
883
|
+
/**
|
|
884
|
+
* 生成 viewer 路由的 `Content-Security-Policy` 响应头值。
|
|
885
|
+
*
|
|
886
|
+
* 宿主只能**加白名单来源**,加不了 sandbox token —— 隔离边界的策略不由被隔离方
|
|
887
|
+
* 也不由宿主的白名单配置决定。
|
|
888
|
+
*/
|
|
889
|
+
declare function viewerCspHeader(options: ViewerCspOptions): string;
|
|
890
|
+
/** 本版固定的 sandbox token(供判据与装配文档引用,避免第二份清单) */
|
|
891
|
+
declare const VIEWER_SANDBOX_TOKENS: readonly string[];
|
|
892
|
+
//#endregion
|
|
893
|
+
//#region src/viewer/documentSurface.d.ts
|
|
894
|
+
/**
|
|
895
|
+
* 文档投放面(0.11.0 分册 18)。
|
|
896
|
+
*
|
|
897
|
+
* ⚠️ **三个必须避开的实现陷阱**(FR-18.4)——「生成 HTML → Blob → 新窗口」
|
|
898
|
+
* 是最自然的实现路径,也是**安全性归零**的路径:
|
|
899
|
+
*
|
|
900
|
+
* | 写法 | 为什么不安全 |
|
|
901
|
+
* | ----------------------------------------------- | ---------------------------------------------- |
|
|
902
|
+
* | `URL.createObjectURL(blob)` + `window.open` | **`blob:` 继承创建者 origin** → 同源,隔离归零 |
|
|
903
|
+
* | `window.open('about:blank')` + `document.write` | 同样继承 origin |
|
|
904
|
+
* | `data:` URL 顶层导航 | 现代浏览器已禁止;历史钓鱼载体 |
|
|
905
|
+
*
|
|
906
|
+
* 正确形态只有一种:`window.open(viewerUrl)` 指向宿主的 **HTTP 路由**,
|
|
907
|
+
* 由响应头下发 `sandbox` 指令让顶层文档自己进 opaque origin。
|
|
908
|
+
*/
|
|
909
|
+
/** 投递给 viewer 的一份文档 */
|
|
910
|
+
interface ViewerDocument {
|
|
911
|
+
/** 技能产出的 HTML 片段(**不受信**,外壳按数据写入) */
|
|
912
|
+
html: string;
|
|
913
|
+
/** 技能的样式表文本 */
|
|
914
|
+
css?: string;
|
|
915
|
+
/** 单向下发的数据;文档内的筛选是本地过滤,不回传(FR-18.7) */
|
|
916
|
+
data?: unknown;
|
|
917
|
+
}
|
|
918
|
+
interface DocumentSurfaceAudit {
|
|
919
|
+
append(event: {
|
|
920
|
+
type: string;
|
|
921
|
+
target: string;
|
|
922
|
+
data?: Record<string, unknown>;
|
|
923
|
+
}): Promise<unknown>;
|
|
924
|
+
}
|
|
925
|
+
interface OpenDocumentInput {
|
|
926
|
+
/** 产出这份文档的技能名;告知与留痕都要它(FR-18.6) */
|
|
927
|
+
skillName: string;
|
|
928
|
+
/** 数据来源描述,进告知与审计 */
|
|
929
|
+
dataSource: string;
|
|
930
|
+
document: ViewerDocument;
|
|
931
|
+
}
|
|
932
|
+
interface DocumentSurfaceOptions {
|
|
933
|
+
/** 宿主的 viewer 路由地址(必须能下发 CSP 响应头,见 viewerCsp.ts) */
|
|
934
|
+
viewerUrl: string;
|
|
935
|
+
/** 打开前的告知;返回 false 即取消(FR-18.6 第 1 条) */
|
|
936
|
+
confirm(input: {
|
|
937
|
+
skillName: string;
|
|
938
|
+
dataSource: string;
|
|
939
|
+
}): Promise<boolean>;
|
|
940
|
+
audit?: DocumentSurfaceAudit;
|
|
941
|
+
/** 投递载荷上限;超限拒绝而不是静默截断(AC-18.11) */
|
|
942
|
+
maxPayloadBytes?: number;
|
|
943
|
+
/** 握手超时;viewer 起不来时不能无限等 */
|
|
944
|
+
handshakeTimeoutMs?: number;
|
|
945
|
+
/** 仅供测试注入;缺省用 `window.open` */
|
|
946
|
+
open?(url: string, target: string): WindowLike | null;
|
|
947
|
+
}
|
|
948
|
+
/** 只用到的那部分窗口接口,便于单测替身 */
|
|
949
|
+
interface WindowLike {
|
|
950
|
+
closed: boolean;
|
|
951
|
+
close(): void;
|
|
952
|
+
postMessage(message: unknown, targetOrigin: string): void;
|
|
953
|
+
}
|
|
954
|
+
declare const DEFAULT_MAX_VIEWER_PAYLOAD_BYTES = 2000000;
|
|
955
|
+
/** 审计事件类型(与既有事件同一条链) */
|
|
956
|
+
declare const DOCUMENT_SURFACE_AUDIT_EVENT = "document.surface.open";
|
|
957
|
+
/**
|
|
958
|
+
* 打开一个文档投放面。
|
|
959
|
+
*
|
|
960
|
+
* `window.open` **必须在用户手势里调**,否则被浏览器拦截;不能在 run 收尾时自动开。
|
|
961
|
+
* 也**不加 `noopener`** —— 需要句柄才能把内容 post 进去。反控面不靠 `noopener` 封,
|
|
962
|
+
* 靠沙箱本身:无 `allow-same-origin` 读不到 opener 的任何东西,
|
|
963
|
+
* 无 `allow-top-navigation` 改不了它的地址。
|
|
964
|
+
*/
|
|
965
|
+
declare function openDocumentSurface(input: OpenDocumentInput, options: DocumentSurfaceOptions): Promise<WindowLike>;
|
|
966
|
+
//#endregion
|
|
967
|
+
//#region src/viewer/shell.d.ts
|
|
968
|
+
/**
|
|
969
|
+
* viewer 外壳(0.11.0 分册 18 §2.4)。
|
|
970
|
+
*
|
|
971
|
+
* 外壳**受信**,技能内容**不受信**,两者同处一个文档。边界:
|
|
972
|
+
* - 外壳:收 `postMessage`、写 DOM;
|
|
973
|
+
* - 技能 HTML/CSS:只作为**数据**写入。经 `innerHTML` 写入时其中的 `<script>`
|
|
974
|
+
* 本就不执行,这与「技能不写 JS」(FR-18.5)一致,**不是缺陷**。
|
|
975
|
+
*
|
|
976
|
+
* 真正的交互来自外壳挂载的预置组件(分册 19),不是技能自带脚本。
|
|
977
|
+
*/
|
|
978
|
+
interface ViewerShellHost {
|
|
979
|
+
addEventListener(type: 'message', listener: (event: MessageEvent) => void): void;
|
|
980
|
+
removeEventListener(type: 'message', listener: (event: MessageEvent) => void): void;
|
|
981
|
+
readonly opener: {
|
|
982
|
+
postMessage(message: unknown, targetOrigin: string): void;
|
|
983
|
+
} | null;
|
|
984
|
+
}
|
|
985
|
+
interface ViewerShellMount {
|
|
986
|
+
/** 技能 HTML 的落点 */
|
|
987
|
+
content: {
|
|
988
|
+
innerHTML: string;
|
|
989
|
+
};
|
|
990
|
+
/** 技能样式的落点 */
|
|
991
|
+
style: {
|
|
992
|
+
textContent: string | null;
|
|
993
|
+
};
|
|
994
|
+
}
|
|
995
|
+
interface ViewerShellResult {
|
|
996
|
+
/** 停止监听(窗口关闭 / 测试收尾) */
|
|
997
|
+
dispose(): void;
|
|
998
|
+
}
|
|
999
|
+
/**
|
|
1000
|
+
* 启动外壳:等主应用的 hello → 回报 ready → 收文档 → 写进 DOM。
|
|
1001
|
+
*
|
|
1002
|
+
* `channelId` 必须由**主应用**在 hello 里给定并全程比对。opaque origin 下
|
|
1003
|
+
* `event.origin` 恒为 `"null"`,任何沙箱页面都一样,靠 origin 分辨不了来源;
|
|
1004
|
+
* 而 `event.source` 在这一侧只能确认「来自 opener」,确认不了是哪一次投放。
|
|
1005
|
+
*/
|
|
1006
|
+
declare function startViewerShell(host: ViewerShellHost, mount: ViewerShellMount, onData?: (data: unknown) => void): ViewerShellResult;
|
|
1007
|
+
//#endregion
|
|
1008
|
+
//#region src/viewer/blockedResources.d.ts
|
|
1009
|
+
/**
|
|
1010
|
+
* viewer 里被 CSP 拦下的资源提示(0.11.0 分册 20 FR-20.5)。
|
|
1011
|
+
*
|
|
1012
|
+
* 外链公文字体默认不在白名单里,文档会**静静地**降级到系统字体。
|
|
1013
|
+
* 打印预览与实际输出不一致是最糟的体验,所以这条降级必须让用户看见——
|
|
1014
|
+
* 「不报错」不等于「不吭声」。
|
|
1015
|
+
*/
|
|
1016
|
+
interface ViewerBlockedNotice {
|
|
1017
|
+
/** 提示文案的落点;只写 `textContent`,永不 `innerHTML` */
|
|
1018
|
+
textContent: string | null;
|
|
1019
|
+
}
|
|
1020
|
+
interface ViewerBlockedHost {
|
|
1021
|
+
addEventListener(type: 'securitypolicyviolation', listener: (event: BlockedEventLike) => void): void;
|
|
1022
|
+
removeEventListener(type: 'securitypolicyviolation', listener: (event: BlockedEventLike) => void): void;
|
|
1023
|
+
}
|
|
1024
|
+
/** 只用到的那部分 `SecurityPolicyViolationEvent`,便于单测替身 */
|
|
1025
|
+
interface BlockedEventLike {
|
|
1026
|
+
effectiveDirective: string;
|
|
1027
|
+
blockedURI: string;
|
|
1028
|
+
}
|
|
1029
|
+
interface ViewerBlockedResult {
|
|
1030
|
+
dispose(): void;
|
|
1031
|
+
}
|
|
1032
|
+
/**
|
|
1033
|
+
* 监听 CSP 违规并把被拦资源汇总成一句话。
|
|
1034
|
+
*
|
|
1035
|
+
* 必须在**文档写入之前**挂上:违规事件不补发,晚一步就永远收不到。
|
|
1036
|
+
* 同一个来源只报一次——一份文档引十个图标会刷出十条同样的提示。
|
|
1037
|
+
*/
|
|
1038
|
+
declare function watchBlockedResources(host: ViewerBlockedHost, notice: ViewerBlockedNotice): ViewerBlockedResult;
|
|
1039
|
+
/** 提示文案的单一来源;判据直接引用,不各写一份字面量 */
|
|
1040
|
+
declare function blockedMessage(origins: readonly string[]): string;
|
|
1041
|
+
//#endregion
|
|
1042
|
+
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, IframeWorkerLike, type InspectHostWiringInput, type LlmClientConfig, type LlmEntryConfig, type MainToWorkerMessage, type OpenDocumentInput, OpfsProvider, type PortApplicability, type PortReport, type PortSpec, type PortStatus, 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, blockedMessage, bridgeError, captureElementImage, checkDictationAvailability, compressImageToBudget, createBrowserChatbotHost, createDomPageActionExecutor, createDomPerceptionReader, createEncryptedMemoryStore, createFetchLinkedDocumentReader, createIframeWorker, createLlmClient, deleteMemoryEncryptionKey, extractDocxText, extractZipWeb, generateMemoryEncryptionKey, inspectHostWiring, installWebSkillNavigator, isCapturableElement, isCaptureFailure, isEncryptedMemoryValue, isOpfsAvailable, missingPorts, openDocumentSurface, openMemoryEncryptionKey, parseBridgeRequest, parseMainMessage, parseWorkerEvent, probeChromeBuiltinAvailability, sha256HexWeb, startDictation, startViewerShell, startWorkerRuntimeHost, viewerCspHeader, watchBlockedResources };
|