@webskill/sdk 0.20.0 → 0.21.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.
@@ -78,7 +78,13 @@ const AUDIT_EVENT_TYPES = {
78
78
  * 技能脚本读用户本轮上传的文件(0.15.0 分册 17 · FR-17.7)。
79
79
  * 载荷记文件名 / 类型 / 字节数与是否被拒,**不含文件内容**。
80
80
  */
81
- uploadFileRead: "upload.file.read"
81
+ uploadFileRead: "upload.file.read",
82
+ /**
83
+ * 读取页面里嵌的 WPS WebOffice 文档(0.21.0 分册 13 · FR-13.6)。
84
+ * 载荷固定为站点 / 动作 / 页面自称的文档类型 / 通道 / 是否命中记忆,
85
+ * **不含文档内容**——审计日志不是第二份文档副本。
86
+ */
87
+ webOfficeRead: "weboffice.read"
82
88
  };
83
89
  /** 稳定展示序:筛选下拉与文档表格都从这里取,不各自维护一份顺序 */
84
90
  const AUDIT_EVENT_TYPE_LIST = Object.values(AUDIT_EVENT_TYPES);
@@ -1,6 +1,6 @@
1
- import { S as UiBridge, U as FileSystemProvider, X as PageQuery, Y as Page, f as LlmMessage, ft as SkillDocument, gt as SkillManagerPort, l as LlmClient, ut as SkillCatalogEntry } from "./types-Btpdd1y--BcxQ10Fa.js";
2
- import { $ as IntegrityVerdict, Wn as WebSkillRuntime, cn as SkillStateGuard, in as SkillOutcomeReporter, rn as SkillIntegrityGuard, zt as RuntimeRun } from "./index-BDyXe-a5.js";
3
- import { _ as SkillState, a as AuditLog, b as SkillVersionStore, c as CandidateFile, d as CandidateSkill, f as CandidateSource, g as SKILL_VERSION_PAGE_SIZE, h as CompositeApprovalPolicy, i as AuditEvent, l as CandidatePage, m as CandidateStore, n as ApprovalDecision, o as AuditQueryFilter, p as CandidateStatus, r as ApprovalPolicy, s as CANDIDATE_PAGE_SIZE, t as AlwaysHumanApprovalPolicy, u as CandidateRisk, v as SkillVersion, x as candidateToCatalogEntry, y as SkillVersionPage } from "./skillVersionStore-B24Jjjry-v2CCU0Xo.js";
1
+ import { S as UiBridge, U as FileSystemProvider, X as Page, Z as PageQuery, _t as SkillManagerPort, dt as SkillCatalogEntry, f as LlmMessage, l as LlmClient, pt as SkillDocument } from "./types-BvTV_05--BW8zDuEk.js";
2
+ import { $ as IntegrityVerdict, ar as WebSkillRuntime, dn as SkillStateGuard, on as SkillIntegrityGuard, sn as SkillOutcomeReporter, zt as RuntimeRun } from "./index-DHopiH_m.js";
3
+ import { _ as SkillState, a as AuditLog, b as SkillVersionStore, c as CandidateFile, d as CandidateSkill, f as CandidateSource, g as SKILL_VERSION_PAGE_SIZE, h as CompositeApprovalPolicy, i as AuditEvent, l as CandidatePage, m as CandidateStore, n as ApprovalDecision, o as AuditQueryFilter, p as CandidateStatus, r as ApprovalPolicy, s as CANDIDATE_PAGE_SIZE, t as AlwaysHumanApprovalPolicy, u as CandidateRisk, v as SkillVersion, x as candidateToCatalogEntry, y as SkillVersionPage } from "./skillVersionStore-B24Jjjry-BkOk9wI_.js";
4
4
  //#region ../governance/dist/index.d.ts
5
5
  //#region src/candidate/candidateNormalizer.d.ts
6
6
  /** 剥 markdown fence 与 <think> 块、截取首尾 {};非对象 → CANDIDATE_INVALID */
@@ -246,6 +246,12 @@ declare const AUDIT_EVENT_TYPES: {
246
246
  * 载荷记文件名 / 类型 / 字节数与是否被拒,**不含文件内容**。
247
247
  */
248
248
  readonly uploadFileRead: "upload.file.read";
249
+ /**
250
+ * 读取页面里嵌的 WPS WebOffice 文档(0.21.0 分册 13 · FR-13.6)。
251
+ * 载荷固定为站点 / 动作 / 页面自称的文档类型 / 通道 / 是否命中记忆,
252
+ * **不含文档内容**——审计日志不是第二份文档副本。
253
+ */
254
+ readonly webOfficeRead: "weboffice.read";
249
255
  };
250
256
  type AuditEventType = (typeof AUDIT_EVENT_TYPES)[keyof typeof AUDIT_EVENT_TYPES];
251
257
  /** 稳定展示序:筛选下拉与文档表格都从这里取,不各自维护一份顺序 */
@@ -2,7 +2,7 @@ import { n as messageOf, t as WebSkillError } from "./errors-BDZNpC13.js";
2
2
  import { y as isValidSkillName } from "./skill-CAJMsLod.js";
3
3
  import { a as atomicWriteText, t as assertSafePathSegment } from "./pathSecurity-B1owvJAF.js";
4
4
  import { d as partsToText, p as textParts } from "./llm-eIQNO9tr.js";
5
- import { n as AUDIT_EVENT_TYPE_LIST, t as AUDIT_EVENT_TYPES } from "./eventTypes-CwciaqCU.js";
5
+ import { n as AUDIT_EVENT_TYPE_LIST, t as AUDIT_EVENT_TYPES } from "./eventTypes-DcTQXSV1.js";
6
6
 
7
7
  //#region ../governance/src/candidate/candidateNormalizer.ts
8
8
  const invalid = (message, details) => {
@@ -1,5 +1,5 @@
1
- import { C as UiSpecActionCapability, D as UiSpecSnapshot, K as JsonSchema, Ot as UiSpecNode, S as UiBridge, b as RenderResultRequest, c as InteractionResponse, r as ChartSpec, s as InteractionRequest, y as RenderBlock } from "./types-Btpdd1y--BcxQ10Fa.js";
2
- import { z as ExternalToolSource } from "./index-BDyXe-a5.js";
1
+ import { C as UiSpecActionCapability, D as UiSpecSnapshot, S as UiBridge, b as RenderResultRequest, c as InteractionResponse, kt as UiSpecNode, q as JsonSchema, r as ChartSpec, s as InteractionRequest, y as RenderBlock } from "./types-BvTV_05--BW8zDuEk.js";
2
+ import { z as ExternalToolSource } from "./index-DHopiH_m.js";
3
3
  import { z } from "zod";
4
4
  import { ComponentType, ReactNode } from "react";
5
5
  //#region ../ui/dist/index.d.ts
@@ -1,5 +1,5 @@
1
- import { I as ChatAttachmentKind, Nt as WebSkillErrorCode, S as UiBridge, Z as RemoteUrlPolicy, a as InteractionOrigin, c as InteractionResponse, s as InteractionRequest } from "./types-Btpdd1y--BcxQ10Fa.js";
2
- import { Kn as XlsxTextExtractor, P as DocxTextExtractor, bn as ToolStepReader, j as DataSourceInfo, z as ExternalToolSource } from "./index-BDyXe-a5.js";
1
+ import { I as ChatAttachmentKind, Pt as WebSkillErrorCode, Q as RemoteUrlPolicy, S as UiBridge, a as InteractionOrigin, c as InteractionResponse, s as InteractionRequest, t as Artifact } from "./types-BvTV_05--BW8zDuEk.js";
2
+ import { En as ToolStepReader, P as DocxTextExtractor, bn as ToolCallContext, cr as XlsxTextExtractor, dt as PdfTextExtractor, j as DataSourceInfo, z as ExternalToolSource } from "./index-DHopiH_m.js";
3
3
  //#region ../agent/dist/index.d.ts
4
4
  //#region src/todo/types.d.ts
5
5
  /** 待办条目状态:未开始 / 进行中 / 已完成(FR-3.1) */
@@ -1694,6 +1694,13 @@ interface DownloadedFilePolicyOptions {
1694
1694
  docxExtractor?: DocxTextExtractor;
1695
1695
  /** xlsx → 文本。同上 */
1696
1696
  xlsxExtractor?: XlsxTextExtractor;
1697
+ /** 超阈值 PDF 的兜底抽取(AC-21.2)。同样必须与手动上传共用一个实现 */
1698
+ pdfExtractor?: PdfTextExtractor;
1699
+ /**
1700
+ * PDF 原件直传的字节上限,量的是 base64 编码后的长度,与上传侧 `loop.maxDocumentBytes` 同源。
1701
+ * 每次读取,设置改完立刻生效;缺省即**不设限**(保持 0.14.0 的直传行为)。
1702
+ */
1703
+ maxDocumentBytes?(): number;
1697
1704
  now?(): string;
1698
1705
  }
1699
1706
  /**
@@ -1712,6 +1719,18 @@ declare class DownloadedFilePolicy {
1712
1719
  get records(): readonly DownloadedFileRecord[];
1713
1720
  list(): Promise<readonly DownloadedFileListing[]>;
1714
1721
  read(id: string): Promise<DownloadedFileReadResult>;
1722
+ /**
1723
+ * 取原始字节,不做形态化(0.21.0 分册 22 · FR-22.4)。
1724
+ *
1725
+ * 授权卡、审计留痕与 `read()` 完全一致——逐单元读文档要的是字节本身,
1726
+ * 但绝不能因此绕过策略:那等于给「读用户本机磁盘」开第二个没有授权的入口。
1727
+ * @experimental
1728
+ */
1729
+ readBytes(id: string): Promise<{
1730
+ entry: DownloadedFileEntry;
1731
+ contentType: string;
1732
+ bytes: Uint8Array;
1733
+ }>;
1715
1734
  }
1716
1735
  //#endregion
1717
1736
  //#region src/downloads/toolSource.d.ts
@@ -1729,4 +1748,234 @@ interface DownloadedFileToolSourceOptions {
1729
1748
  */
1730
1749
  declare function createDownloadedFileToolSource(options: DownloadedFileToolSourceOptions): ExternalToolSource;
1731
1750
  //#endregion
1732
- export { NestedFrameRef as $, TAB_WORKSET_MIN_MAX as $t, DelegationRequest as A, withDelegationOrigin as An, PerceptionAuditSink as At, DownloadedFileReader as B, SkillGenerationMessages as Bt, DataSourcePolicyOptions as C, createSkillGenerationToolSource as Cn, PagePerceptionPolicy as Ct, DelegationBudget as D, frameSteps as Dn, ParentBudget as Dt, DataSourceTransport as E, frameLabel as En, PagePerceptionToolSourceOptions as Et, DownloadedFileEntry as F, PerceptionScope as Ft, FrameScope as G, SkillGeneratorOptions as Gt, DownloadedFileToolSourceOptions as H, SkillGenerationPolicy as Ht, DownloadedFileListing as I, PerceptionScopeInput as It, HttpDataSourceOptions as J, SubAgentRunInput as Jt, GENERATE_SKILL_TOOL as K, SkillTraceEvidence as Kt, DownloadedFilePolicy as L, READ_DOWNLOADED_FILE_TOOL as Lt, DelegationToolSourceOptions as M, PerceptionPagingBudget as Mt, DownloadedFileAction as N, PerceptionRecord as Nt, DelegationOrchestrator as O, toActionFrameScopes as On, PerceivedImage as Ot, DownloadedFileConsent as P, PerceptionResult as Pt, MANAGE_TODO_TOOL as Q, TAB_WORKSET_MAX_MAX as Qt, DownloadedFilePolicyOptions as R, SKILL_GENERATION_SYSTEM_PROMPT as Rt, DataSourcePolicy as S, createPagePerceptionToolSource as Sn, PageAuditSink as St, DataSourceRecord as T, createTodoToolSource as Tn, PagePerceptionReader as Tt, FOCUS_PAGE_TAB_TOOL as U, SkillGenerationToolSourceOptions as Ut, DownloadedFileRecord as V, SkillGenerationOutcome as Vt, FrameNote as W, SkillGenerator as Wt, LIST_DOWNLOADED_FILES_TOOL as X, SubtreeRejection as Xt, ImageCaptureBudget as Y, SubAgentRunner as Yt, LIST_PAGE_TABS_TOOL as Z, TAB_WORKSET_DEFAULT_MAX as Zt, DataSourceCandidatePolicyOptions as _, clampWorksetMax as _n, PageActionScope as _t, ActionTabWindow as a, TabWorksetPort as an, PAGE_DOCUMENT_REF as at, DataSourceDef as b, createHttpDataSourceTransport as bn, PageActionToolSourceOptions as bt, DELEGATE_TASK_TOOL as c, TodoItem as cn, PERCEPTION_SYSTEM_PROMPT as ct, DOWNLOAD_WAIT_MAX_MS as d, TodoStatus as dn, PageActionKind as dt, TAB_WORKSET_SYSTEM_PROMPT as en, OpenedPageInfo as et, DOWNLOAD_WAIT_MIN_MS as f, TodoStore as fn, PageActionOutcome as ft, DataSourceCandidatePolicy as g, clampDownloadWaitMs as gn, PageActionRequest as gt, DataSourceCandidateAuditSink as h, WorksetTabView as hn, PageActionRecord as ht, ActionTabWatcher as i, TabWorksetPolicyOptions as in, PAGE_ACTION_TOOL as it, DelegationResult as j, PerceptionCaptureOptions as jt, DelegationOrchestratorOptions as k, toFrameScopes as kn, PerceivedNode as kt, DELEGATION_SYSTEM_PROMPT as l, TodoList as ln, PageActionConsent as lt, DataSourceCandidate as m, WorksetTab as mn, PageActionPolicyOptions as mt, ActionDownloadWindow as n, TabAdmission as nn, PAGE_ACTION_KINDS as nt, CLOSE_PAGE_TAB_TOOL as o, TabWorksetToolSourceOptions as on, PERCEIVE_PAGE_TOOL as ot, DataSourceAuditSink as p, TodoToolSourceOptions as pn, PageActionPolicy as pt, GeneratedSkillDraft as q, SkillTraceEvidenceStep as qt, ActionFrameScope as r, TabWorksetPolicy as rn, PAGE_ACTION_SYSTEM_PROMPT as rt, ConsentUi as s, TodoEvent as sn, PERCEPTION_PAGING_DEFAULTS as st, ActionDownloadWatcher as t, TODO_SYSTEM_PROMPT as tn, OpenedTabSignal as tt, DOWNLOAD_WAIT_DEFAULT_MS as u, TodoListener as un, PageActionExecutor as ut, DataSourceCandidateRecord as v, createDelegationToolSource as vn, PageActionScopeInput as vt, DataSourceProvenance as w, createTabWorksetToolSource as wn, PagePerceptionPolicyOptions as wt, DataSourceKind as x, createPageActionToolSource as xn, PageActionUi as xt, DataSourceCandidateStore as y, createDownloadedFileToolSource as yn, PageActionTarget as yt, DownloadedFileReadResult as z, SkillCandidateSink as zt };
1751
+ //#region src/document/budget.d.ts
1752
+ /**
1753
+ * 单次 `read_document` 调用的批量预算(0.21.0 分册 22 · 设计 §6)。
1754
+ *
1755
+ * **整份文档没有上限**——只要还有单元没读,返回值就带 `next`(FR-22.3)。
1756
+ * 这里限的只是「一次调用投多少」,那是请求体的物理约束,不是策略。
1757
+ * @experimental
1758
+ */
1759
+ interface DocumentReadBudget {
1760
+ /**
1761
+ * 一次调用最多带回多少字符的文本。与感知分页同口径(约 24K token),
1762
+ * 显著小于 `loop.toolResultMaxBytes`(缺省 256 KB)——文本走 tool 消息,是受预算的分片。
1763
+ */
1764
+ textChars: number;
1765
+ /**
1766
+ * 一次调用最多投几张图。图不受 `toolResultMaxBytes` 管(只受每分片 `maxDocumentBytes`),
1767
+ * 但一次投八张已经是几 MB 的请求体;八这个数也与视觉委派的超时口径相配
1768
+ * (委派预算是 `toolTimeoutMs × 张数`,缺省 10 分钟 × 8)。
1769
+ */
1770
+ visionImages: number;
1771
+ }
1772
+ /** @experimental */
1773
+ declare const DOCUMENT_READ_BUDGET: DocumentReadBudget;
1774
+ //#endregion
1775
+ //#region src/document/types.d.ts
1776
+ /**
1777
+ * 文档逐单元读取的三个端口(0.21.0 分册 22)。
1778
+ *
1779
+ * 与既有的 `PdfTextExtractor` / `DocxTextExtractor` / `XlsxTextExtractor` 并存,不替换:
1780
+ * 那条路解决的是「这份文件太大,退而求其次给点文本」,
1781
+ * 这条路解决的是「这份文件必须读完,而且读不出字的地方要看图」。
1782
+ *
1783
+ * 三个端口**各自独立**:只接了 PDF 的宿主照样能用,另两支自动缺席(FR-22.16)。
1784
+ */
1785
+ /** @experimental */
1786
+ type DocumentFormat = 'pdf' | 'docx' | 'xlsx';
1787
+ /**
1788
+ * 一次工具调用内打开的 PDF;生命周期不跨调用(续读靠自包含坐标,不存游标)
1789
+ * @experimental
1790
+ */
1791
+ interface PdfDocumentHandle {
1792
+ readonly pageCount: number;
1793
+ /** 该页文本层;没有文本层时返回空串,由可信度判定决定要不要转视觉 */
1794
+ text(page: number): Promise<string>;
1795
+ /** 该页图像对象占页面面积的比例。只给比例不给像素:15% 的判定不需要图像数据 */
1796
+ images(page: number): Promise<readonly PdfPageImage[]>;
1797
+ /** 整页渲染;`data` 是 base64,直接就是 image 分片要的形态 */
1798
+ render(page: number): Promise<RenderedImage>;
1799
+ close(): Promise<void>;
1800
+ }
1801
+ /** @experimental */
1802
+ interface PdfPageImage {
1803
+ /** 占页面面积的比例,0~1 */
1804
+ areaRatio: number;
1805
+ }
1806
+ /** @experimental */
1807
+ interface RenderedImage {
1808
+ mimeType: string;
1809
+ data: string;
1810
+ }
1811
+ /**
1812
+ * PDF → 页(宿主注入 pdfjs)。不注入即 PDF 这一支不存在。
1813
+ * @experimental
1814
+ */
1815
+ interface PdfDocumentReader {
1816
+ open(bytes: Uint8Array): Promise<PdfDocumentHandle>;
1817
+ }
1818
+ /**
1819
+ * 文档拆出来的一块。图片块给的是**已经过阈值筛选**的图——
1820
+ * 阈值判定要读 `wp:extent` / `xdr:twoCellAnchor` 这些格式细节,只能落在端口实现里。
1821
+ * @experimental
1822
+ */
1823
+ type DocumentBlock = {
1824
+ kind: 'text';
1825
+ text: string;
1826
+ } | {
1827
+ kind: 'image';
1828
+ mimeType: string;
1829
+ data: string;
1830
+ } | {
1831
+ kind: 'skipped';
1832
+ reason: 'unsupported-format';
1833
+ format: string;
1834
+ };
1835
+ /**
1836
+ * docx → 块序列。docx **没有页**(分页是 Word 排版时算的,文件里没有),
1837
+ * 所以给的是按文档真实顺序排好的块,坐标是块序号。
1838
+ * @experimental
1839
+ */
1840
+ interface DocxDocumentReader {
1841
+ read(bytes: Uint8Array): Promise<DocxDocumentContent>;
1842
+ }
1843
+ /** @experimental */
1844
+ interface DocxDocumentContent {
1845
+ blocks: readonly DocumentBlock[];
1846
+ }
1847
+ /**
1848
+ * xlsx → 逐表的行序列。图按 `xdr:twoCellAnchor` 的锚点行号插进行流。
1849
+ * @experimental
1850
+ */
1851
+ interface XlsxDocumentReader {
1852
+ read(bytes: Uint8Array): Promise<XlsxDocumentContent>;
1853
+ }
1854
+ /** @experimental */
1855
+ interface XlsxDocumentContent {
1856
+ sheets: readonly XlsxSheetContent[];
1857
+ }
1858
+ /** @experimental */
1859
+ interface XlsxSheetContent {
1860
+ name: string;
1861
+ rows: readonly DocumentBlock[];
1862
+ }
1863
+ /** 一份可读文档的字节及其来源标识 @experimental */
1864
+ interface DocumentFileBytes {
1865
+ name: string;
1866
+ bytes: Uint8Array;
1867
+ }
1868
+ /**
1869
+ * 按标识取字节。装配方组合两个来源:当前 run 的附件、下载列表(经授权卡)。
1870
+ * 找不到返回 `undefined`,由工具层归因,不静默当空文档。
1871
+ * @experimental
1872
+ */
1873
+ interface DocumentFileSource {
1874
+ read(id: string): Promise<DocumentFileBytes | undefined>;
1875
+ }
1876
+ //#endregion
1877
+ //#region src/document/format.d.ts
1878
+ /**
1879
+ * 格式以字节为准,文件名只作次要线索:改扩展名不该改变我们如何解析它。
1880
+ * 认不出返回 `undefined`,由调用方归因。
1881
+ * @experimental
1882
+ */
1883
+ declare function sniffDocumentFormat(bytes: Uint8Array, name?: string): DocumentFormat | undefined;
1884
+ //#endregion
1885
+ //#region src/document/pdfQuality.d.ts
1886
+ /**
1887
+ * 「这一页抽出来的是不是乱码」的判定(0.21.0 分册 22 · FR-22.2)。
1888
+ *
1889
+ * 判定必须是纯函数:它决定一页走文本还是走渲染,而渲染要烧一次多模态请求。
1890
+ * 靠人眼看一遍不叫判据。
1891
+ */
1892
+ /** 坏字符占可打印字符的比例超过它即判文本层不可信 @experimental */
1893
+ declare const PDF_GARBLED_RATIO = 0.2;
1894
+ /** @experimental */
1895
+ interface PdfTextQuality {
1896
+ /** 参与判定的可打印字符数(不含空白) */
1897
+ printable: number;
1898
+ /** 其中的坏字符数 */
1899
+ garbled: number;
1900
+ /** 文本层是否可信;不可信意味着该页要转视觉 */
1901
+ trustworthy: boolean;
1902
+ }
1903
+ /**
1904
+ * 空白页一律判不可信:它要么是扫描页、要么什么都没有,
1905
+ * 两种情况都该让模型自己看一眼,而不是把一页空气交上去。
1906
+ * @experimental
1907
+ */
1908
+ declare function measurePdfTextQuality(text: string): PdfTextQuality;
1909
+ /** `measurePdfTextQuality(text).trustworthy` 的简写 @experimental */
1910
+ declare function isPdfTextTrustworthy(text: string): boolean;
1911
+ //#endregion
1912
+ //#region src/document/deferral.d.ts
1913
+ /**
1914
+ * 「这张图现在取不取」的唯一判据(0.21.0 分册 26 · FR-26.1)。
1915
+ *
1916
+ * 附件侧(`read_document`)与在线侧(`read_weboffice_document`)共用这一个函数,
1917
+ * 而不是各写一遍 `if`:FR-26.4 要的是同口径,不是碰巧同结论。
1918
+ * @experimental
1919
+ */
1920
+ /** @experimental */
1921
+ type DocumentReadMode = 'auto' | 'vision' | 'images';
1922
+ /**
1923
+ * 图在这一个单元里的地位。
1924
+ *
1925
+ * - `content`:该处文本读不出来(扫描页、纯图块),图**不可替代**,跳过等于这一段空白。
1926
+ * - `illustration`:正文已经读得到,图是补充。
1927
+ * @experimental
1928
+ */
1929
+ type DocumentImageRole = 'content' | 'illustration';
1930
+ /** @experimental */
1931
+ declare function takesImage(mode: DocumentReadMode, role: DocumentImageRole): boolean;
1932
+ /** 本次没取、但回头取得到的图(进返回值的 `deferred`) @experimental */
1933
+ declare function defersImage(mode: DocumentReadMode, role: DocumentImageRole): boolean;
1934
+ /** 入参里的 `mode` 只认这三个字面量,其余一律当 `auto` @experimental */
1935
+ declare function asReadMode(raw: unknown): DocumentReadMode;
1936
+ //#endregion
1937
+ //#region src/document/toolSource.d.ts
1938
+ /** @experimental */
1939
+ declare const READ_DOCUMENT_TOOL = "read_document";
1940
+ /** 大图的门槛:低于它的是页眉 logo、印章、项目符号,投它们等于白烧一次多模态请求 @experimental */
1941
+ declare const PDF_LARGE_IMAGE_RATIO = 0.15;
1942
+ /** @experimental */
1943
+ interface DocumentToolSourceOptions {
1944
+ files: DocumentFileSource;
1945
+ pdf?: PdfDocumentReader;
1946
+ docx?: DocxDocumentReader;
1947
+ xlsx?: XlsxDocumentReader;
1948
+ /** 每次调用重取,宿主改配置立刻生效 */
1949
+ budget?: () => DocumentReadBudget;
1950
+ }
1951
+ /**
1952
+ * 逐单元读文档,读不出字的地方出图(0.21.0 分册 22)。
1953
+ *
1954
+ * 三个端口一个都没接时 `listToolSpecs()` 返回空——模型连这个工具的存在都看不到,
1955
+ * 而不是看得到再被拒(AC-22.2)。
1956
+ * @experimental
1957
+ */
1958
+ declare function createDocumentToolSource(options: DocumentToolSourceOptions): ExternalToolSource;
1959
+ //#endregion
1960
+ //#region src/spreadsheet/toolSource.d.ts
1961
+ declare const EXPORT_SPREADSHEET_TOOL = "export_spreadsheet";
1962
+ interface SpreadsheetToolSourceOptions {
1963
+ /**
1964
+ * 落产物的出口。**不注入即整条通路不存在**:`listToolSpecs()` 返回空数组,
1965
+ * 模型连这个工具的存在都看不到,而不是看得到再被拒。
1966
+ *
1967
+ * 带 `context` 是因为产物属于某一次 run:宿主要拿 `runId` 才能写到对的地方。
1968
+ * `AgentLoop` 调外部工具时总是传它(`agentLoop.ts` 的 `source.call(…, { runId })`)。
1969
+ */
1970
+ writeArtifact?: (path: string, bytes: Uint8Array, mimeType: string, context?: ToolCallContext) => Promise<Artifact>;
1971
+ }
1972
+ /**
1973
+ * 把表格导出接到既有工具协议上。
1974
+ *
1975
+ * 做成 `ExternalToolSource` 而不是 `AgentLoop` 的内置数组(DV-4):本工具需要
1976
+ * `argCaptureTrust` 与 `captureArgs` 两个钩子,内置数组里没有这两个概念。
1977
+ * @experimental
1978
+ */
1979
+ declare function createSpreadsheetToolSource(options: SpreadsheetToolSourceOptions): ExternalToolSource;
1980
+ //#endregion
1981
+ export { DownloadedFileToolSourceOptions as $, defersImage as $n, PerceptionScope as $t, DelegationOrchestratorOptions as A, TodoList as An, PageActionRequest as At, DocumentReadMode as B, asReadMode as Bn, PagePerceptionToolSourceOptions as Bt, DataSourcePolicy as C, TabAdmission as Cn, PageActionConsent as Ct, DataSourceTransport as D, TabWorksetToolSourceOptions as Dn, PageActionPolicy as Dt, DataSourceRecord as E, TabWorksetPort as En, PageActionOutcome as Et, DocumentFileBytes as F, WorksetTab as Fn, PageActionUi as Ft, DownloadedFileConsent as G, createDownloadedFileToolSource as Gn, PdfTextQuality as Gt, DocxDocumentContent as H, clampWorksetMax as Hn, PdfDocumentHandle as Ht, DocumentFileSource as I, WorksetTabView as In, PageAuditSink as It, DownloadedFilePolicy as J, createPagePerceptionToolSource as Jn, PerceptionAuditSink as Jt, DownloadedFileEntry as K, createHttpDataSourceTransport as Kn, PerceivedImage as Kt, DocumentFormat as L, XlsxDocumentContent as Ln, PagePerceptionPolicy as Lt, DelegationResult as M, TodoStatus as Mn, PageActionScopeInput as Mt, DelegationToolSourceOptions as N, TodoStore as Nn, PageActionTarget as Nt, DelegationBudget as O, TodoEvent as On, PageActionPolicyOptions as Ot, DocumentBlock as P, TodoToolSourceOptions as Pn, PageActionToolSourceOptions as Pt, DownloadedFileRecord as Q, createTodoToolSource as Qn, PerceptionResult as Qt, DocumentImageRole as R, XlsxDocumentReader as Rn, PagePerceptionPolicyOptions as Rt, DataSourceKind as S, TODO_SYSTEM_PROMPT as Sn, PERCEPTION_SYSTEM_PROMPT as St, DataSourceProvenance as T, TabWorksetPolicyOptions as Tn, PageActionKind as Tt, DocxDocumentReader as U, createDelegationToolSource as Un, PdfDocumentReader as Ut, DocumentToolSourceOptions as V, clampDownloadWaitMs as Vn, ParentBudget as Vt, DownloadedFileAction as W, createDocumentToolSource as Wn, PdfPageImage as Wt, DownloadedFileReadResult as X, createSpreadsheetToolSource as Xn, PerceptionPagingBudget as Xt, DownloadedFilePolicyOptions as Y, createSkillGenerationToolSource as Yn, PerceptionCaptureOptions as Yt, DownloadedFileReader as Z, createTabWorksetToolSource as Zn, PerceptionRecord as Zt, DataSourceCandidatePolicy as _, SubtreeRejection as _n, PAGE_DOCUMENT_REF as _t, ActionTabWindow as a, SkillCandidateSink as an, takesImage as ar, GeneratedSkillDraft as at, DataSourceCandidateStore as b, TAB_WORKSET_MIN_MAX as bn, PERCEIVE_PAGE_TOOL as bt, DELEGATE_TASK_TOOL as c, SkillGenerationPolicy as cn, withDelegationOrigin as cr, LIST_DOWNLOADED_FILES_TOOL as ct, DOWNLOAD_WAIT_DEFAULT_MS as d, SkillGeneratorOptions as dn, NestedFrameRef as dt, PerceptionScopeInput as en, frameLabel as er, EXPORT_SPREADSHEET_TOOL as et, DOWNLOAD_WAIT_MAX_MS as f, SkillTraceEvidence as fn, OpenedPageInfo as ft, DataSourceCandidateAuditSink as g, SubAgentRunner as gn, PAGE_ACTION_TOOL as gt, DataSourceCandidate as h, SubAgentRunInput as hn, PAGE_ACTION_SYSTEM_PROMPT as ht, ActionTabWatcher as i, SKILL_GENERATION_SYSTEM_PROMPT as in, sniffDocumentFormat as ir, GENERATE_SKILL_TOOL as it, DelegationRequest as j, TodoListener as jn, PageActionScope as jt, DelegationOrchestrator as k, TodoItem as kn, PageActionRecord as kt, DELEGATION_SYSTEM_PROMPT as l, SkillGenerationToolSourceOptions as ln, LIST_PAGE_TABS_TOOL as lt, DataSourceAuditSink as m, SpreadsheetToolSourceOptions as mn, PAGE_ACTION_KINDS as mt, ActionDownloadWindow as n, READ_DOWNLOADED_FILE_TOOL as nn, isPdfTextTrustworthy as nr, FrameNote as nt, CLOSE_PAGE_TAB_TOOL as o, SkillGenerationMessages as on, toActionFrameScopes as or, HttpDataSourceOptions as ot, DOWNLOAD_WAIT_MIN_MS as p, SkillTraceEvidenceStep as pn, OpenedTabSignal as pt, DownloadedFileListing as q, createPageActionToolSource as qn, PerceivedNode as qt, ActionFrameScope as r, RenderedImage as rn, measurePdfTextQuality as rr, FrameScope as rt, ConsentUi as s, SkillGenerationOutcome as sn, toFrameScopes as sr, ImageCaptureBudget as st, ActionDownloadWatcher as t, READ_DOCUMENT_TOOL as tn, frameSteps as tr, FOCUS_PAGE_TAB_TOOL as tt, DOCUMENT_READ_BUDGET as u, SkillGenerator as un, MANAGE_TODO_TOOL as ut, DataSourceCandidatePolicyOptions as v, TAB_WORKSET_DEFAULT_MAX as vn, PDF_GARBLED_RATIO as vt, DataSourcePolicyOptions as w, TabWorksetPolicy as wn, PageActionExecutor as wt, DataSourceDef as x, TAB_WORKSET_SYSTEM_PROMPT as xn, PERCEPTION_PAGING_DEFAULTS as xt, DataSourceCandidateRecord as y, TAB_WORKSET_MAX_MAX as yn, PDF_LARGE_IMAGE_RATIO as yt, DocumentReadBudget as z, XlsxSheetContent as zn, PagePerceptionReader as zt };