@webskill/sdk 0.21.0 → 0.23.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 (135) hide show
  1. package/dist/abnfDiagram-O67JEVCF-DtYFjfqO.js +109 -0
  2. package/dist/agent.d.ts +3 -3
  3. package/dist/agent.js +1174 -169
  4. package/dist/{approval-DwN2o2QG.js → approval-7CuZS3Z4.js} +104 -18
  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 +455 -49
  11. package/dist/browser.js +2134 -138
  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/eventmodeling-NTZA5JFV-BlyuqGp0.js +4 -0
  58. package/dist/flowDiagram-KWPJA3E3-CcUJ6HbV.js +18 -0
  59. package/dist/ganttDiagram-FUAMR5RP-31UjY0KK.js +3939 -0
  60. package/dist/{toolSource-C9oNuKmr.js → geometry-CRhuySKV.js} +169 -12
  61. package/dist/gitGraph-4MIJSDKK-ChdVlrk7.js +4 -0
  62. package/dist/gitGraphDiagram-X574FWY7-DKuxJymB.js +1153 -0
  63. package/dist/governance.d.ts +22 -4
  64. package/dist/governance.js +100 -10
  65. package/dist/graphlib-tk9gQYuN.js +4194 -0
  66. package/dist/{index-DHopiH_m.d.ts → index-7No55dRb.d.ts} +161 -11
  67. package/dist/{index-B8Tgmpwh.d.ts → index-ShvCB5I9.d.ts} +2 -2
  68. package/dist/{index-CYLt5u4L.d.ts → index-V76_OFj2.d.ts} +789 -21
  69. package/dist/index.d.ts +4 -4
  70. package/dist/index.js +11 -9
  71. package/dist/info-A6RAGUB7-CxRAt9S9.js +4 -0
  72. package/dist/infoDiagram-VRGFBTTK-pRspGfjZ.js +25 -0
  73. package/dist/init-CMOIWdg-.js +16 -0
  74. package/dist/ishikawaDiagram-OU5B5YK6-DKerAPAg.js +975 -0
  75. package/dist/journeyDiagram-ZHPQQLJL-C4MK-YO5.js +1227 -0
  76. package/dist/kanban-definition-PNTS6WVX-BqsZpMXx.js +1244 -0
  77. package/dist/katex-BcRRvyh_.js +26465 -0
  78. package/dist/{kind-DaKqLX2F.js → kind-Dc8x0HWz.js} +54 -7
  79. package/dist/line-LgV8iVMV.js +48 -0
  80. package/dist/linear-BWKR0Tqd.js +393 -0
  81. package/dist/linkedDocument-CZZOl9cO.js +456 -0
  82. package/dist/mcp.d.ts +2 -2
  83. package/dist/{memoryArtifactStore-D6dLeY55.js → memoryArtifactStore-Bs7glPqm.js} +14 -0
  84. package/dist/mermaid-parser.core-pYR5siSx.js +754 -0
  85. package/dist/mermaid.core-DMtwGCHy.js +1756 -0
  86. package/dist/mindmap-definition-NLK3R4M7-CXbD-myG.js +1312 -0
  87. package/dist/node.d.ts +3 -3
  88. package/dist/node.js +12 -5
  89. package/dist/{openUiLibrary-b0i7F_oZ.js → openUiLibrary-B7j3rLrm.js} +1 -1
  90. package/dist/{openUiSpecLang-CLXJEeRU.js → openUiSpecLang-BSYYnjay.js} +1 -1
  91. package/dist/ordinal-CxA6GHQS.js +84 -0
  92. package/dist/packet-AYTQ26CC-BOm08cxl.js +4 -0
  93. package/dist/path-C27Z2Bjv.js +106 -0
  94. package/dist/{pathSecurity-B1owvJAF.js → pathSecurity-CirkQwWP.js} +12 -1
  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/quadrantDiagram-O4NWA36T-Db_wFBkT.js +2236 -0
  99. package/dist/radar-RG4KPBEZ-BZDaTu06.js +4 -0
  100. package/dist/railroad-74A4TZTK-C-UhjkOy.js +4 -0
  101. package/dist/railroad-abnf-HS5TGJTU-dUKVA4OS.js +4 -0
  102. package/dist/railroad-ebnf-LZEXJU2U-DzQumk18.js +4 -0
  103. package/dist/railroad-peg-WCYAUIDC-B3vvTWed.js +4 -0
  104. package/dist/railroadDiagram-XR7U4H2S-BY0sTM4X.js +89 -0
  105. package/dist/requirementDiagram-PLB6GJNP-3rkQfEhs.js +2474 -0
  106. package/dist/rough.cjs-AmDd_NQk.js +1395 -0
  107. package/dist/sankeyDiagram-IPEJSGJF-CGAJhyG2.js +3578 -0
  108. package/dist/sequenceDiagram-PO4LG4MO-9FJjFX06.js +5522 -0
  109. package/dist/sizeCapture-INFHLROL-D8PWxdOn.js +56 -0
  110. package/dist/{skill-CAJMsLod.js → skill-WSUDp6A1.js} +1 -1
  111. package/dist/{skillVersionStore-B24Jjjry-BkOk9wI_.d.ts → skillVersionStore-S4_HJ_Fl-Cvy9LqVu.d.ts} +35 -4
  112. package/dist/src-NkhI3UMl.js +2653 -0
  113. package/dist/stateDiagram-v2-GCMORJYK-B0O3wc1-.js +2715 -0
  114. package/dist/swimlanes-2SLR337P-D4EOnrpu.js +6637 -0
  115. package/dist/swimlanesDiagram-TC7HE7FX-BUx29EJ9.js +30 -0
  116. package/dist/testing.d.ts +2 -1
  117. package/dist/testing.js +1 -1
  118. package/dist/timeline-definition-EJHVYXUP-CrgiiB4C.js +1513 -0
  119. package/dist/treeView-Q6P3EWNA-C1by-Gzc.js +4 -0
  120. package/dist/treemap-WGGIJYW6-mC2NZ6ad.js +4 -0
  121. package/dist/{types-BvTV_05--BW8zDuEk.d.ts → types-CpDRZ0rA-BiZBXGm4.d.ts} +66 -8
  122. package/dist/ui-react.d.ts +3 -3
  123. package/dist/ui-react.js +3746 -96
  124. package/dist/ui-vue.d.ts +1 -1
  125. package/dist/ui.d.ts +3 -3
  126. package/dist/ui.js +2 -2
  127. package/dist/usecaseDiagram-POWQR4AR-BUt_TQOY.js +14397 -0
  128. package/dist/vennDiagram-UO4OBE2U-CwXr0wjA.js +2808 -0
  129. package/dist/wardley-WFR3VGLG-CVSYjq_S.js +4 -0
  130. package/dist/wardleyDiagram-VNRHLVJA-Cpfd47dQ.js +874 -0
  131. package/dist/{webSkillApi-Cib6G-94.js → webSkillApi-D5VMUnrv.js} +2 -2
  132. package/dist/{webskillLitCatalog-W06npwej.js → webskillLitCatalog-D5BCiMCU.js} +1 -1
  133. package/dist/xychartDiagram-PMCCYNJV-e1TeVoc6.js +2704 -0
  134. package/package.json +1 -1
  135. package/dist/linkedDocument-C0gj1sMq.js +0 -245
@@ -1,5 +1,5 @@
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";
1
+ import { L as ChatAttachmentKind, Rt as WebSkillErrorCode, S as UiBridge, a as InteractionOrigin, c as InteractionResponse, nt as RemoteUrlPolicy, s as InteractionRequest, t as Artifact } from "./types-CpDRZ0rA-BiZBXGm4.js";
2
+ import { B as ExternalToolSource, F as DocxTextExtractor, Fn as ToolStepReader, M as DataSourceInfo, kn as ToolCallContext, mt as PptxTextExtractor, pt as PdfTextExtractor, vr as XlsxTextExtractor, xn as SpreadsheetImageBytes } from "./index-7No55dRb.js";
3
3
  //#region ../agent/dist/index.d.ts
4
4
  //#region src/todo/types.d.ts
5
5
  /** 待办条目状态:未开始 / 进行中 / 已完成(FR-3.1) */
@@ -48,11 +48,18 @@ declare class TodoStore {
48
48
  /**
49
49
  * 更新单条。置为 `in-progress` 时其余进行中条目降级为 `pending`,
50
50
  * 每条降级各发一次 `todo.updated`,事件序列与状态变化一一对应。
51
+ *
52
+ * `options.concurrent` 由**编排器**在并发委派时传(0.23.0 分册 19 FR-19.9):
53
+ * 几个子 agent 真的在同时跑,把别人降级回 `pending` 是在界面上说谎。
54
+ * 模型经 `manage_todo` 的写入不传它,仍维持「同时只有一条进行中」——
55
+ * 那条约束针对的是模型乱标(名义并行、实则一件事),不是真并发。
51
56
  */
52
57
  update(id: string, patch: {
53
58
  status?: TodoStatus;
54
59
  title?: string;
55
60
  delegatedTo?: string;
61
+ }, options?: {
62
+ concurrent?: boolean;
56
63
  }): TodoList;
57
64
  clear(): void;
58
65
  }
@@ -90,9 +97,14 @@ interface GeneratedSkillDraft {
90
97
  description: string;
91
98
  /** SKILL.md 全文,含 frontmatter */
92
99
  content: string;
100
+ /**
101
+ * 附带文件。`attachmentId` 在场即本条目的内容是**本会话已上传的那个附件的字节**,
102
+ * 此时 `content` 恒为空串——模型从没持有过那些字节,让它复述等于让它编(0.23.0 分册 20)。
103
+ */
93
104
  files?: readonly {
94
105
  path: string;
95
106
  content: string;
107
+ attachmentId?: string;
96
108
  }[];
97
109
  /**
98
110
  * 模型声称这个技能会执行的工具调用(分册 30 / FR-30.4)。
@@ -105,6 +117,30 @@ interface GeneratedSkillDraft {
105
117
  args?: Record<string, unknown>;
106
118
  }[];
107
119
  }
120
+ /**
121
+ * 一个被指认的附件的字节与身份(0.23.0 分册 20)。
122
+ * 由宿主的 `SkillGeneratorOptions.resolveAttachment` 交出。
123
+ */
124
+ interface SkillAttachmentBytes {
125
+ bytes: Uint8Array;
126
+ /** 上传时的原始文件名,供审核者辨认(FR-20.10) */
127
+ name: string;
128
+ contentType?: string;
129
+ }
130
+ /**
131
+ * 已物化的一份二进制:字节加上它的身份与校验信息(0.23.0 分册 20)。
132
+ *
133
+ * `sha256` 不是装饰——AC-20.1 的「逐字节相同」靠它判,
134
+ * 而本册要防的失败模式正是**悄悄损坏**:被 UTF-8 往返污染过的 `.xlsx`
135
+ * 仍能被宽容的解析器打开,却在用户手里丢数据。
136
+ */
137
+ interface SkillBinaryPayload {
138
+ bytes: Uint8Array;
139
+ size: number;
140
+ /** 十六进制小写 */
141
+ sha256: string;
142
+ sourceName: string;
143
+ }
108
144
  /**
109
145
  * 候选收货端口。实现由宿主注入——`@webskill/agent` 不依赖 `@webskill/governance`
110
146
  * (治理层要求宿主提供治理根与审计存储,是可选层)。
@@ -117,6 +153,11 @@ interface SkillCandidateSink {
117
153
  sessionId?: string;
118
154
  /** 用户确认的时刻(FR-9.7 要求审计能查到确认事实) */
119
155
  confirmedAt: string;
156
+ /**
157
+ * 已物化的二进制,键是 `draft.files[].path`。缺省即本次生成全是文本(0.23.0 分册 20)。
158
+ * 字节在这里就已经读出来了:候选必须能脱离会话附件独立存活(FR-20.6)。
159
+ */
160
+ binaries?: ReadonlyMap<string, SkillBinaryPayload>;
120
161
  }): Promise<{
121
162
  id: string;
122
163
  }>;
@@ -125,6 +166,10 @@ interface SkillCandidateSink {
125
166
  interface SkillGenerationPolicy {
126
167
  /** 单次会话内的生成次数上限,默认 3 */
127
168
  maxPerSession?: number;
169
+ /** 单个二进制条目的字节上限(0.23.0 分册 20 FR-20.12) */
170
+ maxBinaryBytes?: number;
171
+ /** 一个技能内所有二进制条目的字节总量上限(0.23.0 分册 20 FR-20.12) */
172
+ maxTotalBinaryBytes?: number;
128
173
  }
129
174
  type SkillGenerationOutcome = {
130
175
  status: 'submitted';
@@ -151,6 +196,16 @@ interface SkillGeneratorOptions {
151
196
  * 这既让本册可分步落地,也给 AC-30.14 的反向对照留了现成的造法。
152
197
  */
153
198
  steps?: ToolStepReader;
199
+ /**
200
+ * 按 id 取本会话已上传附件的字节(0.23.0 分册 20 FR-20.2)。
201
+ *
202
+ * **按 id 查而不是按路径取**是安全边界:路径入参等于给模型一条把宿主磁盘上
203
+ * 任意文件复制进技能包的通路;按 id 在本会话附件表里查,能被指认的集合
204
+ * 恰好等于「用户自己这次会话上传的东西」。查不到(含跨会话的 id)返回 `undefined`。
205
+ *
206
+ * 不注入即本宿主不支持指认附件,模型给了 `attachmentId` 也按拒绝处理。
207
+ */
208
+ resolveAttachment?: (id: string) => Promise<SkillAttachmentBytes | undefined>;
154
209
  }
155
210
  /** 生成器面向用户的文案;缺省全部为英文模板 */
156
211
  interface SkillGenerationMessages {
@@ -263,13 +318,21 @@ interface DelegationOrchestratorOptions {
263
318
  policy?: Partial<DelegationBudget>;
264
319
  /** 接上清单后委派关系在 UI 可见(FR-11.5) */
265
320
  todos?: TodoStore;
321
+ /**
322
+ * 同时在跑的子 agent 数上限(0.23.0 分册 19 FR-19.5/19.16)。
323
+ *
324
+ * 每次委派入口都会重新调用它:用户在确认卡里选的并发数是会话中途才定下来的,
325
+ * 装配期读一次就固化的话,那个旋钮永远停在默认值上。
326
+ * 缺省 1,即维持 0.22.x 之前的串行行为——只是超额的请求改为排队而不再报错。
327
+ */
328
+ concurrencyLimit?: () => number;
266
329
  }
267
330
  /**
268
- * 串行委派编排器(设计 03 §13–§16)。
331
+ * 委派编排器(设计 03 §13–§16,并发改造见 0.23.0 分册 19)。
269
332
  *
270
- * 严格串行由**内部互斥**保证而不是调用方自觉:并发委派会产生并发待决交互,
271
- * 而当前交互模型是单一待决 nonce,届时表现为「点了没反应」。
272
- * 放开并发必须显式改这里的守卫,不会悄悄发生。
333
+ * 并发放开的前提是**并行的是执行、不是提问**:待决交互仍然一次只呈现一张,
334
+ * `ReactBridgeState` / `specInteractionChannel` 的队列保证。
335
+ * 若要在别处复用本编排器,那两处的排队语义是它的前置条件。
273
336
  *
274
337
  * 上下文隔离靠回值形状达成:只有 `summary` 回到父 agent,
275
338
  * 子 agent 的消息历史根本不经过本对象。
@@ -278,7 +341,7 @@ interface DelegationOrchestratorOptions {
278
341
  declare class DelegationOrchestrator {
279
342
  #private;
280
343
  constructor(options: DelegationOrchestratorOptions);
281
- /** 当前正在执行的委派任务;无则 undefined */
344
+ /** 正在执行的委派任务之一;全部空闲则 undefined。仅供诊断 */
282
345
  get running(): string | undefined;
283
346
  delegate(request: DelegationRequest): Promise<DelegationResult>;
284
347
  }
@@ -313,10 +376,10 @@ declare function withDelegationOrigin(bridge: UiBridge, origin: InteractionOrigi
313
376
  //#endregion
314
377
  //#region src/prompts/delegation.d.ts
315
378
  /**
316
- * 串行委派的策略提示词(设计 03 §13)。
379
+ * 委派的策略提示词(设计 03 §13;并发改造见 0.23.0 分册 19)。
317
380
  *
318
- * 「一次只能有一个」是编排器的硬约束,这里写进提示词是为了让模型不去
319
- * 尝试并行委派——被拒绝的调用会浪费一轮,而不是产生并发。
381
+ * 并发数那两句是**建议**而非约束:真正拦住数量的是编排器的排队与宿主硬上限。
382
+ * 写在这里是为了让模型按任务真实需要给值,而不是一口气派出一大批。
320
383
  */
321
384
  declare const DELEGATION_SYSTEM_PROMPT: string;
322
385
  //#endregion
@@ -413,6 +476,12 @@ interface PerceivedNode {
413
476
  * 「页面变了不能点到别的东西」由执行前的实时校验承担,不由句柄寿命承担。
414
477
  */
415
478
  ref?: string;
479
+ /**
480
+ * 该节点的像素可读(0.22.0 FR-12.1)——`IMG` / `CANVAS` / `SVG` 三类。
481
+ * 只在 `ref` 存在时出现;模型据它判哪些句柄能交给 `capture_page_image`,
482
+ * 而不是靠猜元素类型先对 `<div>` 试一次。
483
+ */
484
+ capturable?: true;
416
485
  /**
417
486
  * 该节点来自哪个帧(FR-24.4),取值是帧路径的展示串(`frameLabel`)。
418
487
  * **主文档节点不带这个字段**——否则旧宿主的断言会凭空变化。
@@ -438,8 +507,23 @@ interface PerceivedNode {
438
507
  * 它的其余子节点在前一段或后一段里。缺省不带该字段。
439
508
  */
440
509
  continued?: boolean;
510
+ /**
511
+ * 此处还能往哪些方向滚(0.23.0 分册 22 FR-22.1)。只在该元素**自身**是可滚容器、
512
+ * 且该方向尚未到头时出现;两端都到头字段就消失。
513
+ *
514
+ * 不表达滚动量:给了数值模型就会算「还要滚几次」,而列虚拟化下 `scrollWidth`
515
+ * 随列的重建而变,那个算法必然算错(沿用 0.18.0 FR-10.2)。
516
+ *
517
+ * **出现该字段的节点必然带 `ref`**——标了能滚却给不出句柄,模型就处在
518
+ * 「知道能滚、够不着」的状态,正是 AC-G8 要禁的那种幽灵能力。
519
+ */
520
+ scrollable?: readonly ScrollDirection[];
441
521
  children?: readonly PerceivedNode[];
442
522
  }
523
+ /** 滚动方向(0.23.0 分册 22)。感知的 `scrollable` 与动作记录的 `direction` 共用,避免两处漂移 */
524
+ type ScrollDirection = 'up' | 'down' | 'left' | 'right';
525
+ /** 四个方向的规范清单;工具层校验与文案生成都从这里取,不各写一份 */
526
+ declare const SCROLL_DIRECTIONS: readonly ScrollDirection[];
443
527
  /** 随感知一起下发的一张图像(FR-12.1) @experimental */
444
528
  interface PerceivedImage {
445
529
  /** 与 `PerceivedNode.imageId` 对应 */
@@ -1119,15 +1203,19 @@ type PageActionScopeInput = PageActionScope | {
1119
1203
  */
1120
1204
  declare function toActionFrameScopes(scope: PageActionScopeInput): readonly ActionFrameScope[];
1121
1205
  /**
1122
- * 本版的操作集(FR-25.1 / 0.16.0 FR-13.6 / 0.18.0 FR-10.1)。拖拽仍不在内(D64);
1206
+ * 本版的操作集(FR-25.1 / 0.16.0 FR-13.6 / 0.18.0 FR-10.1 / 0.22.0 FR-17.1)。
1123
1207
  * 导航只有 `back` 一个,且它**不接受地址**——可达面被浏览器历史封死(SC-1)。
1124
1208
  *
1125
- * `select`/`set`/`attach`/`scroll` 与既有几个走**同一条** policy 路径,
1209
+ * `drag` 只表达**起点与终点**,没有中途轨迹(0.22.0 FR-17.6 裁定,D64 就此撤销):
1210
+ * 轨迹是实现细节不是意图,能画任意路径等于架空 AC-23.2,而且滑块验证码要的正是轨迹——
1211
+ * 表达不了轨迹,这个动作就天然做不了人机验证绕过。
1212
+ *
1213
+ * 这些动作与既有几个走**同一条** policy 路径,
1126
1214
  * 范围白名单、逐次确认、审计三条硬约束因此天然覆盖到它们——
1127
1215
  * 前提是新动作不绕过 policy 直调执行器(AC-25.4 守这一点)。
1128
1216
  * @experimental
1129
1217
  */
1130
- declare const PAGE_ACTION_KINDS: readonly ["click", "fill", "submit", "select", "set", "attach", "scroll", "back"];
1218
+ declare const PAGE_ACTION_KINDS: readonly ["click", "fill", "submit", "select", "set", "attach", "scroll", "hover", "drag", "back"];
1131
1219
  type PageActionKind = (typeof PAGE_ACTION_KINDS)[number];
1132
1220
  /**
1133
1221
  * `back` 的目标占位(0.16.0 分册 13 §4.1)。
@@ -1145,8 +1233,10 @@ interface PageActionRequest {
1145
1233
  action: PageActionKind;
1146
1234
  /**
1147
1235
  * `fill` 填入的文本;`select` 要选中的选项可访问名;
1148
- * `set` 的目标态(`'true'` | `'false'`);`scroll` 的方向(`'down'` | `'up'`)。
1149
- * `attach` 不用它——文件**始终由用户在确认卡里选**,Agent 传不进本地路径(FR-25.5)。
1236
+ * `set` 的目标态(`'true'` | `'false'`);`scroll` 的方向(`'down'` | `'up'`);
1237
+ * `drag` 的**终点句柄**(另一个 ref,FR-17.4)。
1238
+ * `hover` 与 `attach` 不用它——后者的文件**始终由用户在确认卡里选**,
1239
+ * Agent 传不进本地路径(FR-25.5)。
1150
1240
  */
1151
1241
  value?: string;
1152
1242
  }
@@ -1262,9 +1352,11 @@ interface PageActionRecord {
1262
1352
  * 本次滚动的方向与实际位移(0.18.0 FR-10.8);非 `scroll` 动作不带。
1263
1353
  * 位移要进留痕:只记「滚了」而不记「滚了多少」,事后分不出
1264
1354
  * 「滚到底了」与「根本没滚动」。
1355
+ *
1356
+ * 0.23.0 分册 22 起方向扩到四向:横向滚动记成 `down` 会让留痕说谎。
1265
1357
  */
1266
1358
  scrolled?: {
1267
- direction: 'down' | 'up';
1359
+ direction: ScrollDirection;
1268
1360
  movedBy: number;
1269
1361
  atEnd: boolean;
1270
1362
  };
@@ -1694,6 +1786,7 @@ interface DownloadedFilePolicyOptions {
1694
1786
  docxExtractor?: DocxTextExtractor;
1695
1787
  /** xlsx → 文本。同上 */
1696
1788
  xlsxExtractor?: XlsxTextExtractor;
1789
+ pptxExtractor?: PptxTextExtractor;
1697
1790
  /** 超阈值 PDF 的兜底抽取(AC-21.2)。同样必须与手动上传共用一个实现 */
1698
1791
  pdfExtractor?: PdfTextExtractor;
1699
1792
  /**
@@ -1774,16 +1867,16 @@ declare const DOCUMENT_READ_BUDGET: DocumentReadBudget;
1774
1867
  //#endregion
1775
1868
  //#region src/document/types.d.ts
1776
1869
  /**
1777
- * 文档逐单元读取的三个端口(0.21.0 分册 22)。
1870
+ * 文档逐单元读取的四个端口(0.21.0 分册 22;0.22.0 分册 18 添上 pptx)。
1778
1871
  *
1779
1872
  * 与既有的 `PdfTextExtractor` / `DocxTextExtractor` / `XlsxTextExtractor` 并存,不替换:
1780
1873
  * 那条路解决的是「这份文件太大,退而求其次给点文本」,
1781
1874
  * 这条路解决的是「这份文件必须读完,而且读不出字的地方要看图」。
1782
1875
  *
1783
- * 三个端口**各自独立**:只接了 PDF 的宿主照样能用,另两支自动缺席(FR-22.16)。
1876
+ * 四个端口**各自独立**:只接了 PDF 的宿主照样能用,其余几支自动缺席(FR-22.16)。
1784
1877
  */
1785
1878
  /** @experimental */
1786
- type DocumentFormat = 'pdf' | 'docx' | 'xlsx';
1879
+ type DocumentFormat = 'pdf' | 'docx' | 'xlsx' | 'pptx';
1787
1880
  /**
1788
1881
  * 一次工具调用内打开的 PDF;生命周期不跨调用(续读靠自包含坐标,不存游标)
1789
1882
  * @experimental
@@ -1860,6 +1953,25 @@ interface XlsxSheetContent {
1860
1953
  name: string;
1861
1954
  rows: readonly DocumentBlock[];
1862
1955
  }
1956
+ /**
1957
+ * pptx → 逐页的块序列。幻灯片**真有页**(不像 docx 的分页是排版算出来的),
1958
+ * 所以坐标是「第几页的第几块」。
1959
+ *
1960
+ * 给的是页上写了什么、插了哪几张图,**不是页面渲染图**:
1961
+ * OOXML 包里没有渲染好的页面,浏览器里也没有 pptx 渲染器。要版式只能退到截屏。
1962
+ * @experimental
1963
+ */
1964
+ interface PptxDocumentReader {
1965
+ read(bytes: Uint8Array): Promise<PptxDocumentContent>;
1966
+ }
1967
+ /** @experimental */
1968
+ interface PptxDocumentContent {
1969
+ slides: readonly PptxSlideContent[];
1970
+ }
1971
+ /** @experimental */
1972
+ interface PptxSlideContent {
1973
+ blocks: readonly DocumentBlock[];
1974
+ }
1863
1975
  /** 一份可读文档的字节及其来源标识 @experimental */
1864
1976
  interface DocumentFileBytes {
1865
1977
  name: string;
@@ -1945,13 +2057,14 @@ interface DocumentToolSourceOptions {
1945
2057
  pdf?: PdfDocumentReader;
1946
2058
  docx?: DocxDocumentReader;
1947
2059
  xlsx?: XlsxDocumentReader;
2060
+ pptx?: PptxDocumentReader;
1948
2061
  /** 每次调用重取,宿主改配置立刻生效 */
1949
2062
  budget?: () => DocumentReadBudget;
1950
2063
  }
1951
2064
  /**
1952
2065
  * 逐单元读文档,读不出字的地方出图(0.21.0 分册 22)。
1953
2066
  *
1954
- * 三个端口一个都没接时 `listToolSpecs()` 返回空——模型连这个工具的存在都看不到,
2067
+ * 四个端口一个都没接时 `listToolSpecs()` 返回空——模型连这个工具的存在都看不到,
1955
2068
  * 而不是看得到再被拒(AC-22.2)。
1956
2069
  * @experimental
1957
2070
  */
@@ -1968,6 +2081,13 @@ interface SpreadsheetToolSourceOptions {
1968
2081
  * `AgentLoop` 调外部工具时总是传它(`agentLoop.ts` 的 `source.call(…, { runId })`)。
1969
2082
  */
1970
2083
  writeArtifact?: (path: string, bytes: Uint8Array, mimeType: string, context?: ToolCallContext) => Promise<Artifact>;
2084
+ /**
2085
+ * 图片引用 → 字节。不注入时 `images` 整个字段不进入参 schema,提示词里也不提图——
2086
+ * 与 `writeArtifact` 同一条口径:宿主给不了的能力,模型就不该看得到。
2087
+ *
2088
+ * 解析本身不在这一层:引用能指向本会话哪些东西是宿主的事,工具源知道了就多一份路径面。
2089
+ */
2090
+ resolveImage?: (ref: string, context?: ToolCallContext) => Promise<SpreadsheetImageBytes | undefined>;
1971
2091
  }
1972
2092
  /**
1973
2093
  * 把表格导出接到既有工具协议上。
@@ -1978,4 +2098,652 @@ interface SpreadsheetToolSourceOptions {
1978
2098
  */
1979
2099
  declare function createSpreadsheetToolSource(options: SpreadsheetToolSourceOptions): ExternalToolSource;
1980
2100
  //#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 };
2101
+ //#region src/template/geometry.d.ts
2102
+ /**
2103
+ * A1 地址与 OOXML 几何换算(0.22.0 分册 42 · 设计 43 §1.6)。
2104
+ *
2105
+ * 环境无关,`@webskill/agent` 里可直接单测——几何算错的后果是图溢出单元格,
2106
+ * 而那只有人肉打开文件才看得见,所以这一层的覆盖要密。
2107
+ */
2108
+ /** 1 px 的 EMU 数(96 DPI) */
2109
+ declare const EMU_PER_PIXEL = 9525;
2110
+ /** 1 磅的 EMU 数 */
2111
+ declare const EMU_PER_POINT = 12700;
2112
+ /** 1 twip 的 EMU 数 */
2113
+ declare const EMU_PER_TWIP = 635;
2114
+ /** 默认字体的最大数字宽度,Excel 列宽换算基准 */
2115
+ declare const MAX_DIGIT_WIDTH = 7;
2116
+ interface CellAddress {
2117
+ /** 0 基 */
2118
+ readonly column: number;
2119
+ /** 0 基 */
2120
+ readonly row: number;
2121
+ }
2122
+ /** @throws WebSkillError 语法不合法 */
2123
+ declare function parseCellAddress(address: string): CellAddress;
2124
+ declare function formatCellAddress({ column, row }: CellAddress): string;
2125
+ interface CellRange {
2126
+ readonly start: CellAddress;
2127
+ readonly end: CellAddress;
2128
+ }
2129
+ /** @throws WebSkillError 语法不合法 */
2130
+ declare function parseCellRange(range: string): CellRange;
2131
+ declare function isRangeTopLeft(range: CellRange, address: CellAddress): boolean;
2132
+ declare function rangeContains(range: CellRange, address: CellAddress): boolean;
2133
+ /** Excel 的列宽单位是字符数,换算成像素(设计 43 §1.6 实测 MDW=7) */
2134
+ declare function columnWidthToPixels(width: number): number;
2135
+ interface Size {
2136
+ readonly width: number;
2137
+ readonly height: number;
2138
+ }
2139
+ /**
2140
+ * 等比缩放进框:宽高同时约束、**取两个比例里的小者**。
2141
+ *
2142
+ * FR-42.11 与 FR-42.19 是同一条口径——xlsx 的合并区和 docx 声明了 `trHeight` 的
2143
+ * 表格行都这么算。框的某一边为 0(未声明高度)时那一边不参与约束。
2144
+ */
2145
+ declare function fitWithin(natural: Size, box: Size): Size;
2146
+ /** PNG / JPEG 的像素尺寸。读文件头,不解码整张图。 */
2147
+ declare function readImageSize(bytes: Uint8Array): Size | undefined;
2148
+ //#endregion
2149
+ //#region src/template/types.d.ts
2150
+ /**
2151
+ * 模板改写的端口契约(0.22.0 分册 42 · 设计 43 §2)。
2152
+ *
2153
+ * 真正拆装 OOXML 的实现在 `@webskill/browser`(要 `DOMParser`),
2154
+ * 这里只声明形状——`@webskill/core` / `@webskill/agent` 保持环境无关。
2155
+ * @experimental
2156
+ */
2157
+ /** @experimental */
2158
+ interface TemplateCellSkeleton {
2159
+ readonly address: string;
2160
+ readonly text: string;
2161
+ /** 在则这格由模板算出,不得填 */
2162
+ readonly formula?: string;
2163
+ }
2164
+ /** @experimental */
2165
+ interface TemplateSheetSkeleton {
2166
+ readonly name: string;
2167
+ readonly range: string;
2168
+ readonly cells: readonly TemplateCellSkeleton[];
2169
+ readonly merges: readonly string[];
2170
+ readonly columnWidths: readonly number[];
2171
+ }
2172
+ /** @experimental */
2173
+ interface XlsxTemplateSkeleton {
2174
+ readonly sheets: readonly TemplateSheetSkeleton[];
2175
+ }
2176
+ /** @experimental */
2177
+ interface TemplateParagraphSkeleton {
2178
+ readonly index: number;
2179
+ readonly text: string;
2180
+ }
2181
+ /** @experimental */
2182
+ interface TemplateTableCellSkeleton {
2183
+ readonly table: number;
2184
+ readonly row: number;
2185
+ readonly column: number;
2186
+ readonly text: string;
2187
+ readonly gridSpan?: number;
2188
+ readonly vMerge?: string;
2189
+ }
2190
+ /** @experimental */
2191
+ interface DocxTemplateSkeleton {
2192
+ readonly paragraphs: readonly TemplateParagraphSkeleton[];
2193
+ readonly cells: readonly TemplateTableCellSkeleton[];
2194
+ }
2195
+ /** @experimental */
2196
+ interface TemplateImageBytes {
2197
+ readonly bytes: Uint8Array;
2198
+ readonly extension: string;
2199
+ readonly contentType: string;
2200
+ }
2201
+ /** @experimental */
2202
+ interface XlsxTemplateFillSpec {
2203
+ readonly rows?: readonly {
2204
+ sheet?: string;
2205
+ at: number;
2206
+ count: number;
2207
+ copyStyleFrom?: number;
2208
+ }[];
2209
+ readonly cells?: readonly {
2210
+ sheet?: string;
2211
+ address: string;
2212
+ value: string;
2213
+ }[];
2214
+ readonly images?: readonly ({
2215
+ sheet?: string;
2216
+ address: string;
2217
+ } & TemplateImageBytes)[];
2218
+ }
2219
+ /** @experimental */
2220
+ interface DocxTemplateFillSpec {
2221
+ readonly texts?: readonly {
2222
+ paragraph?: number;
2223
+ table?: number;
2224
+ row?: number;
2225
+ column?: number;
2226
+ value: string;
2227
+ }[];
2228
+ readonly images?: readonly ({
2229
+ paragraph?: number;
2230
+ table?: number;
2231
+ row?: number;
2232
+ column?: number;
2233
+ } & TemplateImageBytes)[];
2234
+ }
2235
+ /** @experimental */
2236
+ interface XlsxTemplateEngine {
2237
+ read(bytes: Uint8Array): Promise<XlsxTemplateSkeleton>;
2238
+ fill(bytes: Uint8Array, spec: XlsxTemplateFillSpec): Promise<Uint8Array>;
2239
+ }
2240
+ /** @experimental */
2241
+ interface DocxTemplateEngine {
2242
+ read(bytes: Uint8Array): Promise<DocxTemplateSkeleton>;
2243
+ fill(bytes: Uint8Array, spec: DocxTemplateFillSpec): Promise<Uint8Array>;
2244
+ }
2245
+ /** 模板字节的来源,与 `read_document` 同一个出口 @experimental */
2246
+ interface TemplateFileSource {
2247
+ read(id: string, context?: ToolCallContext): Promise<{
2248
+ name: string;
2249
+ bytes: Uint8Array;
2250
+ } | undefined>;
2251
+ }
2252
+ /** @experimental */
2253
+ type TemplateImageResolver = (ref: string, context?: ToolCallContext) => Promise<TemplateImageBytes | undefined>;
2254
+ //#endregion
2255
+ //#region src/template/toolSource.d.ts
2256
+ /** @experimental */
2257
+ declare const INSPECT_TEMPLATE_TOOL = "inspect_template";
2258
+ /** @experimental */
2259
+ declare const FILL_TEMPLATE_TOOL = "fill_template";
2260
+ /**
2261
+ * 骨架预算。模板不是文档,格子数是有限的(实测四份模板 32~56 个),
2262
+ * 但没人能保证用户不传一份两千行的台账进来——超了就截断并明说截了。
2263
+ * @experimental
2264
+ */
2265
+ declare const TEMPLATE_INSPECT_BUDGET: {
2266
+ readonly cells: 400;
2267
+ readonly chars: 20000;
2268
+ };
2269
+ /** @experimental */
2270
+ interface TemplateToolSourceOptions {
2271
+ /** 模板字节的来源,与 `read_document` 共用一个出口 */
2272
+ files: TemplateFileSource;
2273
+ xlsx?: XlsxTemplateEngine;
2274
+ docx?: DocxTemplateEngine;
2275
+ /** 落产物的出口。**不注入即整条通路不存在**:`fill_template` 不出现在工具清单里 */
2276
+ writeArtifact?: (path: string, bytes: Uint8Array, mimeType: string, context?: ToolCallContext) => Promise<Artifact>;
2277
+ /** 图片引用 → 字节。不注入时 `images` 整个字段不进入参 schema,提示词里也不提图 */
2278
+ resolveImage?: TemplateImageResolver;
2279
+ /** 每次调用重取,宿主改配置立刻生效 */
2280
+ budget?: () => {
2281
+ cells: number;
2282
+ chars: number;
2283
+ };
2284
+ /**
2285
+ * 宿主多认的取件号形式,追加到 `template` 的描述后面(例如「在线文档用 `weboffice:<handle>`」)。
2286
+ * 不给就不提——模型不该学会一个这台机器上读不到的号。
2287
+ */
2288
+ idHint?: string;
2289
+ }
2290
+ /**
2291
+ * 照着模板出文件(0.22.0 分册 42)。
2292
+ *
2293
+ * 两个工具而不是一个:模型得先看见模板的坐标,才谈得上决定往哪儿写。
2294
+ * 合成一个工具就只剩两条路——要么让模型盲填,要么每次把整份骨架塞进填值的返回里。
2295
+ * @experimental
2296
+ */
2297
+ declare function createTemplateToolSource(options: TemplateToolSourceOptions): ExternalToolSource;
2298
+ //#endregion
2299
+ //#region src/pageImage/toolSource.d.ts
2300
+ declare const CAPTURE_PAGE_IMAGE_TOOL = "capture_page_image";
2301
+ /** 取像成功:只有引用与事实,**没有字节**(FR-12.2 / AC-G4) @experimental */
2302
+ interface PageImageCapture {
2303
+ /** 形如 `artifact:page-image-1.png`,可直接写进 `AuthoredModel` 图片块的 `ref`(FR-12.7) */
2304
+ artifact: string;
2305
+ width: number;
2306
+ height: number;
2307
+ bytes: number;
2308
+ }
2309
+ /** 取像失败。`reason` 原样来自 `CaptureFailure`,不得二次包装或缩写(FR-12.4) @experimental */
2310
+ interface PageImageFailure {
2311
+ reason: string;
2312
+ triedLevels?: readonly string[];
2313
+ }
2314
+ /** @experimental */
2315
+ type PageImageResult = PageImageCapture | PageImageFailure;
2316
+ /** @experimental */
2317
+ interface PageImageToolSourceOptions {
2318
+ /**
2319
+ * 取像 + 落产物的出口。**不注入即整条通路不存在**:`listToolSpecs()` 返回空数组,
2320
+ * 模型连这个工具的存在都看不到。纯 Web 宿主拿不到宿主页面的 DOM,
2321
+ * 于是在那些宿主上这个工具根本不出现,而不是出现了每次都失败。
2322
+ *
2323
+ * 授权也在这一层:读页面内容已有授权面,本工具必须落进去,不新开第二个入口(FR-12.5)。
2324
+ */
2325
+ capture?: (input: {
2326
+ ref: string;
2327
+ note?: string;
2328
+ }, context?: ToolCallContext) => Promise<PageImageResult>;
2329
+ }
2330
+ /**
2331
+ * 页面取像工具(0.22.0 分册 12)。
2332
+ *
2333
+ * 与 `export_spreadsheet` 同一套 `ExternalToolSource` 范式(FR-12.1),
2334
+ * 不另造第二套注册机制。
2335
+ * @experimental
2336
+ */
2337
+ declare function createPageImageToolSource(options: PageImageToolSourceOptions): ExternalToolSource;
2338
+ //#endregion
2339
+ //#region src/remoteImage/toolSource.d.ts
2340
+ declare const FETCH_REMOTE_IMAGE_TOOL = "fetch_remote_image";
2341
+ /**
2342
+ * 抓取成功。默认只有引用与事实,**没有字节**(与 `capture_page_image` 同一条约束,AC-G4);
2343
+ * 只有模型显式要求看图时宿主才填 `mimeType` / `data`(FR-21.11)。
2344
+ * @experimental
2345
+ */
2346
+ interface RemoteImageFetch {
2347
+ /** 形如 `artifact:remote-image-1.png`,可直接写进 `AuthoredModel` 图片块的 `ref` */
2348
+ artifact: string;
2349
+ width: number;
2350
+ height: number;
2351
+ bytes: number;
2352
+ /** base64 图像数据,仅当入参 `describe` 为真时提供 */
2353
+ data?: string;
2354
+ /** 与 `data` 同进同出 */
2355
+ mimeType?: string;
2356
+ }
2357
+ /**
2358
+ * 抓取失败。`reason` 原样来自 `fetchRemoteImage`,不得二次包装(FR-13.4)。
2359
+ * `kind` 是分类,模型据此决定换 URL、重试还是放弃。
2360
+ * @experimental
2361
+ */
2362
+ interface RemoteImageFetchFailure {
2363
+ reason: string;
2364
+ kind?: string;
2365
+ }
2366
+ /** @experimental */
2367
+ type RemoteImageResult = RemoteImageFetch | RemoteImageFetchFailure;
2368
+ /** @experimental */
2369
+ interface RemoteImageToolSourceOptions {
2370
+ /**
2371
+ * 抓取 + 落产物的出口。**不注入即整条通路不存在**:`listToolSpecs()` 返回空数组。
2372
+ * 纯 Web 宿主受同源策略限制抓不到跨域字节(设计 14 §1),
2373
+ * 在那些宿主上这个工具不出现,而不是出现了每次都失败。
2374
+ *
2375
+ * 授权在这一层,且必须发生在**发请求之前**(AC-13.5)。
2376
+ * `describe` 为真时额外把字节回出来给模型看,抓取仍只发生一次(FR-21.11)。
2377
+ */
2378
+ fetchImage?: (input: {
2379
+ url: string;
2380
+ note?: string;
2381
+ describe?: boolean;
2382
+ }, context?: ToolCallContext) => Promise<RemoteImageResult>;
2383
+ }
2384
+ /**
2385
+ * 外链图片抓取工具(0.22.0 分册 13)。
2386
+ *
2387
+ * 与 `capture_page_image` 同一套范式:模型给出来源、宿主拿字节、回给模型的只有引用。
2388
+ * 三种图片来源(上传、页面、外链)因此在技能那一侧长得一模一样(AC-G1)。
2389
+ * @experimental
2390
+ */
2391
+ declare function createRemoteImageToolSource(options: RemoteImageToolSourceOptions): ExternalToolSource;
2392
+ //#endregion
2393
+ //#region src/dwg/types.d.ts
2394
+ /**
2395
+ * DWG 图纸的端口与几何模型(0.22.0 分册 19)。
2396
+ *
2397
+ * 本文件只声明**形状**:agent 包不解析 DWG,解析由宿主注入
2398
+ * (扩展侧用 `@node-projects/acad-ts`)。与 pptx 端口同构。
2399
+ *
2400
+ * 几何模型的设计前提来自对三份真实图纸的实测(见分册 19 §2.3):
2401
+ * - 块引用必须在实现侧展开并烘焙变换:`2D.dwg` 顶层只有 1129 个实体,
2402
+ * 展开后是 6044 个;不展开投放出来的是一张近乎空白的图。
2403
+ * - 实体一律带 `handle`,它是 diff 的主键(实测 16613/16618 稳定)。
2404
+ * - 只建模二维图元:图纸自带的三维实体是 ACIS,浏览器里镶嵌不了。
2405
+ */
2406
+ /** 二维点。DWG 内部是三维点,二维图元把 Z 丢掉——投放面按 Z 分层,不需要逐点 Z */
2407
+ interface DwgPoint {
2408
+ readonly x: number;
2409
+ readonly y: number;
2410
+ }
2411
+ /** 轴对齐包围盒;相机与自适应缩放都要它 */
2412
+ interface DwgBounds {
2413
+ readonly minX: number;
2414
+ readonly minY: number;
2415
+ readonly maxX: number;
2416
+ readonly maxY: number;
2417
+ }
2418
+ /**
2419
+ * 可绘制的二维图元。
2420
+ *
2421
+ * 归一到这几种形状,是为了让投放面**不必认识 DWG 实体类型**:
2422
+ * Hatch 的边界、Polyline2D、LwPolyline 都塌成折线,Ellipse 与 Arc 各自保留参数式
2423
+ * 表达(塌成折线会在放大时露出棱角,而 CAD 图纸恰恰是要放大看的)。
2424
+ */
2425
+ type DwgGeometry = {
2426
+ readonly kind: 'polyline';
2427
+ readonly points: readonly DwgPoint[];
2428
+ readonly closed: boolean;
2429
+ } | {
2430
+ readonly kind: 'circle';
2431
+ readonly center: DwgPoint;
2432
+ readonly radius: number;
2433
+ } | {
2434
+ readonly kind: 'arc';
2435
+ readonly center: DwgPoint;
2436
+ readonly radius: number;
2437
+ /** 弧度,逆时针;acad-ts 给的就是弧度,不在端口上换算成角度徒增一次转换 */
2438
+ readonly startAngle: number;
2439
+ readonly endAngle: number;
2440
+ } | {
2441
+ readonly kind: 'ellipse';
2442
+ readonly center: DwgPoint;
2443
+ /** 长轴端点相对中心的偏移;短轴由 `ratio` 导出,与 DWG 的表示一致 */
2444
+ readonly majorAxis: DwgPoint;
2445
+ readonly ratio: number;
2446
+ readonly startAngle: number;
2447
+ readonly endAngle: number;
2448
+ } | {
2449
+ readonly kind: 'point';
2450
+ readonly at: DwgPoint;
2451
+ } | {
2452
+ readonly kind: 'text';
2453
+ readonly at: DwgPoint;
2454
+ /** 已剥离 MText 格式控制码的纯文本(`{\fSimSun|b0|i0|c134|p2;餐厅}` → `餐厅`) */
2455
+ readonly text: string;
2456
+ readonly height: number;
2457
+ /** 弧度 */
2458
+ readonly rotation: number;
2459
+ /**
2460
+ * `at` 这个点落在文字的哪个位置(0.22.0 分册 25 FR-25.1)。
2461
+ *
2462
+ * 对齐是文字**几何的固有属性**而非渲染偏好:实测 `大堂立面图.dwg` 的 178 个
2463
+ * MTEXT 里有 96 个是 MiddleCenter,不带这两个字段的话每个接入方都得自己去猜,
2464
+ * 猜错的后果就是文字整体偏出半个字高加半个字宽、溢到方框和圆圈外面。
2465
+ * 省略时按 `left` / `baseline`,即分册 24 的既有行为。
2466
+ */
2467
+ readonly anchorX?: 'left' | 'center' | 'right';
2468
+ readonly anchorY?: 'top' | 'middle' | 'baseline' | 'bottom';
2469
+ /** MText 的换行宽度(世界单位);缺省或为 0 表示不折行 */
2470
+ readonly wrapWidth?: number;
2471
+ /**
2472
+ * 图纸指定的字体(0.22.0 分册 28 FR-28.5)。
2473
+ *
2474
+ * 字号一直来自 `height`,字体族却无处可取,于是每个接入方只能硬写一个。
2475
+ * 实测 `2D.dwg` 的 462 条文字里,129 条走 SHX 笔画字体、74 条走 `simhei.ttf`、
2476
+ * 223 条走 `arial.ttf`——全部画成同一个无衬线体与原图相去甚远。
2477
+ * 样式缺失或字段为空时省略。
2478
+ */
2479
+ readonly font?: DwgFont;
2480
+ };
2481
+ /**
2482
+ * 文字样式指定的字体(0.22.0 分册 28 FR-28.5)。
2483
+ *
2484
+ * 拉丁字体与 CJK 大字体是**两个独立的槽**,可以不同
2485
+ * (实测样式 `TH-STYLE2` 是 `th-rmc` + `th-chnc`),因此不能合并成一个字段。
2486
+ */
2487
+ interface DwgFont {
2488
+ /** 主字体文件名,如 `simhei.ttf` / `th-rmc`;样式未指定时省略 */
2489
+ readonly file?: string;
2490
+ /** CJK 大字体文件名,如 `th-chnc`;只有 SHX 样式才有 */
2491
+ readonly bigFile?: string;
2492
+ /** 宽度因子;1 或缺省表示不横向缩放 */
2493
+ readonly widthFactor?: number;
2494
+ }
2495
+ /**
2496
+ * 填充(0.22.0 分册 23 FR-23.3)。
2497
+ *
2498
+ * 分册 19 只取了填充的**边界**,于是真实图纸里 218 个 HATCH 全变成了空轮廓。
2499
+ * 填充单独建模而不是塑成几何,是因为它**不进指纹**:
2500
+ * 一个图案填充展开后可达 6358 条线段,让它们各自成为一条差异记录,
2501
+ * 明细表会被淢没到不可用(FR-23.3 注 / AC-23.4)。
2502
+ */
2503
+ type DwgFill = {
2504
+ /** 实心填充。多个环按奇偶规则填,带岛的图案才不会把洞填死 */
2505
+ readonly kind: 'solid';
2506
+ readonly loops: readonly (readonly DwgPoint[])[];
2507
+ /**
2508
+ * 环的组合规则(0.22.0 分册 28 FR-28.4)。缺省视同 `'evenodd'`。
2509
+ *
2510
+ * 宽多段线铺出的带面是一组互相重叠的四边形的**并集**,奇偶规则会把
2511
+ * 转角的重叠处异或成洞(实测转角处一行被切成 `5 / 9 / 5` 三截);
2512
+ * 而 HATCH 的环是带岛的**区域**,必须继续用奇偶规则,否则天井会被填实。
2513
+ */
2514
+ readonly rule?: 'evenodd' | 'nonzero';
2515
+ } | {
2516
+ /** 图案填充:`Hatch.explodePattern()` 展开后的线段,四个一组 `x1,y1,x2,y2` */
2517
+ readonly kind: 'pattern';
2518
+ readonly segments: readonly number[];
2519
+ } | {
2520
+ /** 遮罩(WIPEOUT):按边界填背景色。这就是它的语义,不是「不支持」 */
2521
+ readonly kind: 'mask';
2522
+ readonly loops: readonly (readonly DwgPoint[])[];
2523
+ };
2524
+ /**
2525
+ * 一个可绘制的实体。
2526
+ *
2527
+ * `handle` 是 DWG 自带的标识,由实现侧产出;消费方不反向解析几何。
2528
+ */
2529
+ interface DwgEntity {
2530
+ /** DWG 句柄,十六进制字符串。实测在同源另存间稳定 */
2531
+ readonly handle: string;
2532
+ /** 原始实体类型名,如 `Line` / `LwPolyline` / `MText` */
2533
+ readonly kind: string;
2534
+ readonly layer: string;
2535
+ readonly geometry: DwgGeometry | undefined;
2536
+ /** 块属性(ATTRIB)的 tag→value;无属性时为 undefined */
2537
+ readonly attributes?: Readonly<Record<string, string>>;
2538
+ /** 实体色 `#rrggbb`;缺省(ByLayer)时省略,由渲染层回落图层色 */
2539
+ readonly color?: string;
2540
+ readonly fill?: DwgFill;
2541
+ /** 线型的 dash 模式,**世界单位**(绘制时再乘镜头缩放);省略即实线 */
2542
+ readonly dash?: readonly number[];
2543
+ /**
2544
+ * 线宽,单位 0.01 mm(0.22.0 分册 25 FR-25.3)。
2545
+ *
2546
+ * `ByLayer` / `ByBlock` / `Default` 这三种间接值已在解析期解开,拿到的就是实际值;
2547
+ * 解不出来时省略。实测这张图的线宽跨越 `5`(0.05 mm) 到 `50`(0.50 mm) 共十倍,
2548
+ * 不带它就只能把图框、云线与细标注线一律画成同一种粗细。
2549
+ */
2550
+ readonly lineWeight?: number;
2551
+ }
2552
+ /**
2553
+ * 图纸空间里的一个视口(FR-23.2)。
2554
+ *
2555
+ * 它把模型空间的一块区域按相似变换画进图纸上的一个矩形窗口。
2556
+ * 实测 `大堂立面图.dwg` 的 Layout1 有 6 个视口,其中 5 个是 50:1 的立面窗口,
2557
+ * 它们同时也是一份现成的模型空间分区表(分册 23 §2.2)。
2558
+ */
2559
+ interface DwgViewport {
2560
+ /** 图纸空间里的窗口中心与尺寸 */
2561
+ readonly center: DwgPoint;
2562
+ readonly width: number;
2563
+ readonly height: number;
2564
+ /** 窗口里看到的模型空间中心与高度;缩放比 = `height / viewHeight` */
2565
+ readonly viewCenter: DwgPoint;
2566
+ readonly viewHeight: number;
2567
+ /** 视图扭角,弧度 */
2568
+ readonly twistAngle: number;
2569
+ /** 视口级冻结的图层。本图为空,但不实现就是一个会在别的图纸上炸的洞 */
2570
+ readonly frozenLayers: readonly string[];
2571
+ }
2572
+ /**
2573
+ * 图纸上的一个「物件」:一次块引用(0.22.0 分册 37 FR-37.1)。
2574
+ *
2575
+ * 门、窗、家具、洁具、消防栓在图纸里几乎全是以 `INSERT` 存在的,
2576
+ * 块名就是图纸作者亲手声明的「这是一个物件」。解析时块被展开成几何(为了画出来),
2577
+ * 这份清单是展开的同时另收的一份,**不影响渲染**(FR-37.4)。
2578
+ * @experimental
2579
+ */
2580
+ interface DwgComponent {
2581
+ /** 块名。动态块变体已回查源块取真名(FR-37.3) */
2582
+ readonly block: string;
2583
+ /** 插入点,世界坐标(嵌套块已烘焙过外层变换) */
2584
+ readonly at: DwgPoint;
2585
+ /** 旋转角,弧度 */
2586
+ readonly rotation: number;
2587
+ readonly scaleX: number;
2588
+ readonly scaleY: number;
2589
+ readonly layer: string;
2590
+ /** `ATTRIB` 的 tag→value;一个都没有时省略 */
2591
+ readonly attributes?: Readonly<Record<string, string>>;
2592
+ }
2593
+ /**
2594
+ * 一个可切换的视图(FR-23.1):模型空间或一张图纸。
2595
+ *
2596
+ * `id` 用 Layout 名(`Model` / `Layout1`)而不用句柄或序号:
2597
+ * 两份图纸的**同名** Layout 才是业务上「同一张图纸」,对比靠它配对(FR-23.7)。
2598
+ */
2599
+ interface DwgView {
2600
+ readonly id: string;
2601
+ readonly name: string;
2602
+ readonly kind: 'model' | 'layout';
2603
+ readonly entities: readonly DwgEntity[];
2604
+ readonly bounds: DwgBounds;
2605
+ /**
2606
+ * 图纸**自己声明**的范围(0.22.0 分册 29 FR-29.4)。
2607
+ *
2608
+ * 图纸空间取打印窗口(`plotType` 为「窗口」时才有),模型空间取 `$EXTMIN` / `$EXTMAX`。
2609
+ * 与量出来的 `bounds` 并存而不替代:实测 `大堂平面图.dwg` 的模型空间实体盒是
2610
+ * 4.79e10 × 1.89e10,而 `$EXTMIN`/`$EXTMAX` 只有 7.93e8 × 1.09e9——
2611
+ * 差出来的 60 倍是 1311 个原始插入点就在 −3.6e10 的属性,两个数同时在场才看得出来。
2612
+ *
2613
+ * 声明不出来(`plotType` 不是窗口、数值非有限、宽高退化为 0)时省略。
2614
+ */
2615
+ readonly extent?: DwgBounds;
2616
+ readonly viewports: readonly DwgViewport[];
2617
+ /**
2618
+ * 本视图里的构件清单(FR-37.1)。字段缺失是合法状态:
2619
+ * 宿主自己实现的解析器可以不产出它,那时「对比差异」不出现。
2620
+ */
2621
+ readonly components?: readonly DwgComponent[];
2622
+ }
2623
+ interface DwgLayer {
2624
+ readonly name: string;
2625
+ /** `#rrggbb`;实现侧把 DWG 的索引色解析成实际颜色 */
2626
+ readonly color: string;
2627
+ readonly visible: boolean;
2628
+ }
2629
+ /**
2630
+ * 图纸坐标的量纲(0.22.0 FR-31.12),取自图头的 `INSUNITS`。
2631
+ *
2632
+ * `'unitless'` 是图纸自己说不知道,**不是**「默认毫米」:
2633
+ * 猜错一次就是 1000 倍,而且不会有任何提示。
2634
+ */
2635
+ type DwgUnits = 'mm' | 'cm' | 'm' | 'km' | 'in' | 'ft' | 'yd' | 'mi' | 'unitless';
2636
+ /** 解析结果。一份图纸拉平成实体数组 + 图层表 + 元信息 */
2637
+ interface DwgDocumentContent {
2638
+ /** 文件格式版本,如 `AC1021` */
2639
+ readonly version: string;
2640
+ readonly layers: readonly DwgLayer[];
2641
+ /** 模型空间视图的实体(= `views` 里 `kind==='model'` 那一项的别名) */
2642
+ readonly entities: readonly DwgEntity[];
2643
+ readonly bounds: DwgBounds;
2644
+ /** 坐标的量纲(FR-31.12)。字段缺失与 `'unitless'` 同义:量出来的数没有单位 */
2645
+ readonly units?: DwgUnits;
2646
+ /**
2647
+ * 所有可切换的视图(FR-23.1):模型空间 + 每一张图纸。
2648
+ * 空 Layout 也列在这里——隐了会让用户以为图纸里没有这张表(FR-23.2)。
2649
+ *
2650
+ * 可选是为了给不产出图纸空间的解析实现留退路(宿主自己实现 `DwgDocumentReader`
2651
+ * 也是允许的);取用一律走 `dwgViewsOf`,它会补一个模型空间视图。
2652
+ */
2653
+ readonly views?: readonly DwgView[];
2654
+ /** 模型空间视图的构件清单(= `views` 里 `kind==='model'` 那一项的别名) */
2655
+ readonly components?: readonly DwgComponent[];
2656
+ /**
2657
+ * 无法原样呈现的内容,必须显式上报而不是静默丢弃(FR-19.7 / FR-23.6)。
2658
+ * 包括两类:完全没画的(ACIS)与降级画的(图案近似、线型退回实线)。
2659
+ */
2660
+ readonly omissions: readonly DwgOmission[];
2661
+ }
2662
+ interface DwgOmission {
2663
+ readonly kind: string;
2664
+ readonly count: number;
2665
+ readonly reason: 'acis-not-tessellated' | 'unsupported-entity' | 'pattern-approximated' | 'pattern-too-dense' | 'linetype-unavailable';
2666
+ /**
2667
+ * `dropped` = 完全没画;`degraded` = 画了,但不是原样。
2668
+ *
2669
+ * 分册 19 只上报前一类,于是界面上那句「只有 2 个图元不受支持」
2670
+ * 遮住了「218 个填充被降级了」——这比画不出来更有害(FR-23.6)。
2671
+ */
2672
+ readonly severity: 'dropped' | 'degraded';
2673
+ }
2674
+ /** 宿主注入的解析实现 */
2675
+ interface DwgDocumentReader {
2676
+ read(bytes: Uint8Array): Promise<DwgDocumentContent>;
2677
+ }
2678
+ //#endregion
2679
+ //#region src/dwg/toolSource.d.ts
2680
+ declare const VIEW_DWG_TOOL = "view_dwg";
2681
+ /**
2682
+ * `load()` 的另一种返回形态:连文件名一起给(0.22.0 FR-31.1)。
2683
+ *
2684
+ * 图纸到模型手里只有取件号(见 `SYSTEM_PROMPT`),所以 `file` 入参不是文件名;
2685
+ * 真名只有解析取件号的那一侧知道,这是它交出来的唯一通道。 @experimental
2686
+ */
2687
+ interface DwgLoadedDrawing {
2688
+ readonly document: DwgDocumentContent;
2689
+ readonly name?: string;
2690
+ }
2691
+ /** 宿主注入的解析与投放出口 @experimental */
2692
+ interface DwgToolSourceOptions {
2693
+ /**
2694
+ * 把一个文件引用读成几何模型。**不注入即整条通路不存在**——
2695
+ * `listToolSpecs()` 返回空数组,模型看不到这个工具(AC-34.3)。
2696
+ *
2697
+ * 只返回 `DwgDocumentContent` 的宿主行为不变;带上 `name` 才能让投放面显示文件名。
2698
+ */
2699
+ load?: (file: string, context?: ToolCallContext) => Promise<DwgDocumentContent | DwgLoadedDrawing>;
2700
+ /** 投放到查看器。同样由宿主实现:agent 包不认识 `documentSurface` */
2701
+ project?: (input: DwgProjection, context?: ToolCallContext) => Promise<void>;
2702
+ }
2703
+ /** 投放载荷里的一份图纸 @experimental */
2704
+ interface DwgProjectedDrawing {
2705
+ /** 模型传进来的取件号。进告知卡与审计,是**数据来源描述**,不是文件名 */
2706
+ readonly title: string;
2707
+ /** 给人看的文件名(FR-31.2)。宿主的 `load()` 没给名字时为 `undefined` */
2708
+ readonly fileName?: string;
2709
+ readonly document: DwgDocumentContent;
2710
+ }
2711
+ /**
2712
+ * 投放载荷。几何走这里去查看器,**不进模型上下文**。
2713
+ *
2714
+ * 单份与双份同形(§4.2):只看一份时 `drawings` 就是一元素数组。
2715
+ * 留一条「单份专用」旁路会让两条渲染路径各自演化。数组顺序就是初始叠放顺序,第一项在上。
2716
+ * @experimental
2717
+ */
2718
+ interface DwgProjection {
2719
+ readonly drawings: readonly DwgProjectedDrawing[];
2720
+ }
2721
+ /**
2722
+ * DWG 查看工具(0.22.0 分册 19,分册 34 收敛为单工具)。
2723
+ *
2724
+ * 与 `capture_page_image` 同一套 `ExternalToolSource` 范式。
2725
+ * 解析与投放都由宿主注入:本包不认识 `.dwg` 字节,也不认识 `documentSurface`。
2726
+ * @experimental
2727
+ */
2728
+ declare function createDwgToolSource(options: DwgToolSourceOptions): ExternalToolSource;
2729
+ //#endregion
2730
+ //#region src/dwg/views.d.ts
2731
+ /**
2732
+ * 视图取用(0.22.0 分册 23 FR-23.5 / FR-23.7)。
2733
+ *
2734
+ * 单独成文件是因为 diff、导出、投放面三边都要用同一套「哪些视图、按什么配对」,
2735
+ * 各写一份迟早会在某一边把空布局漏掉。
2736
+ */
2737
+ /** 模型空间视图的固定 id。两份图纸靠它配对 */
2738
+ declare const DWG_MODEL_VIEW_ID = "Model";
2739
+ /**
2740
+ * 文档的视图列表。
2741
+ *
2742
+ * 分册 23 之前解析出的文档没有 `views`,给它补一个模型空间视图:
2743
+ * 那时的 `entities` 本来就是模型空间的全部内容,语义对得上。
2744
+ */
2745
+ declare function dwgViewsOf(doc: DwgDocumentContent): readonly DwgView[];
2746
+ /** 按 id 取视图;取不到就退回第一个,而不是什么都没有 */
2747
+ declare function dwgPickView(doc: DwgDocumentContent, viewId: string | undefined): DwgView;
2748
+ //#endregion
2749
+ export { DownloadedFileEntry as $, SkillCandidateSink as $n, createDownloadedFileToolSource as $r, PERCEPTION_PAGING_DEFAULTS as $t, DataSourceRecord as A, PerceptionAuditSink as An, TemplateToolSourceOptions as Ar, FILL_TEMPLATE_TOOL as At, DocumentFileSource as B, READ_DOCUMENT_TOOL as Bn, WorksetTabView as Br, LIST_PAGE_TABS_TOOL as Bt, DataSourceCandidateRecord as C, rangeContains as Ci, ParentBudget as Cn, TemplateCellSkeleton as Cr, DwgView as Ct, DataSourcePolicy as D, toActionFrameScopes as Di, PdfTextQuality as Dn, TemplateParagraphSkeleton as Dr, EMU_PER_TWIP as Dt, DataSourceKind as E, takesImage as Ei, PdfPageImage as En, TemplateImageResolver as Er, EMU_PER_POINT as Et, DelegationRequest as F, PerceptionScope as Fn, TodoStatus as Fr, GeneratedSkillDraft as Ft, DocumentToolSourceOptions as G, RemoteImageToolSourceOptions as Gn, XlsxTemplateFillSpec as Gr, OpenedTabSignal as Gt, DocumentImageRole as H, RemoteImageFetch as Hn, XlsxDocumentReader as Hr, MAX_DIGIT_WIDTH as Ht, DelegationResult as I, PerceptionScopeInput as In, TodoStore as Ir, HttpDataSourceOptions as It, DocxTemplateEngine as J, SKILL_GENERATION_SYSTEM_PROMPT as Jn, clampDownloadWaitMs as Jr, PAGE_ACTION_TOOL as Jt, DocxDocumentContent as K, RenderedImage as Kn, XlsxTemplateSkeleton as Kr, PAGE_ACTION_KINDS as Kt, DelegationToolSourceOptions as L, PptxDocumentContent as Ln, TodoToolSourceOptions as Lr, INSPECT_TEMPLATE_TOOL as Lt, DelegationBudget as M, PerceptionPagingBudget as Mn, TodoItem as Mr, FrameNote as Mt, DelegationOrchestrator as N, PerceptionRecord as Nn, TodoList as Nr, FrameScope as Nt, DataSourcePolicyOptions as O, toFrameScopes as Oi, PerceivedImage as On, TemplateSheetSkeleton as Or, EXPORT_SPREADSHEET_TOOL as Ot, DelegationOrchestratorOptions as P, PerceptionResult as Pn, TodoListener as Pr, GENERATE_SKILL_TOOL as Pt, DownloadedFileConsent as Q, SkillBinaryPayload as Qn, createDocumentToolSource as Qr, PERCEIVE_PAGE_TOOL as Qt, DocumentBlock as R, PptxDocumentReader as Rn, VIEW_DWG_TOOL as Rr, ImageCaptureBudget as Rt, DataSourceCandidatePolicyOptions as S, parseCellRange as Si, PagePerceptionToolSourceOptions as Sn, TabWorksetToolSourceOptions as Sr, DwgUnits as St, DataSourceDef as T, sniffDocumentFormat as Ti, PdfDocumentReader as Tn, TemplateImageBytes as Tr, EMU_PER_PIXEL as Tt, DocumentReadBudget as U, RemoteImageFetchFailure as Un, XlsxSheetContent as Ur, NestedFrameRef as Ut, DocumentFormat as V, READ_DOWNLOADED_FILE_TOOL as Vn, XlsxDocumentContent as Vr, MANAGE_TODO_TOOL as Vt, DocumentReadMode as W, RemoteImageResult as Wn, XlsxTemplateEngine as Wr, OpenedPageInfo as Wt, DocxTemplateSkeleton as X, Size as Xn, columnWidthToPixels as Xr, PDF_GARBLED_RATIO as Xt, DocxTemplateFillSpec as Y, ScrollDirection as Yn, clampWorksetMax as Yr, PAGE_DOCUMENT_REF as Yt, DownloadedFileAction as Z, SkillAttachmentBytes as Zn, createDelegationToolSource as Zr, PDF_LARGE_IMAGE_RATIO as Zt, DWG_MODEL_VIEW_ID as _, frameSteps as _i, PageImageResult as _n, TODO_SYSTEM_PROMPT as _r, DwgOmission as _t, ActionTabWindow as a, createRemoteImageToolSource as ai, PageActionPolicy as an, SkillGeneratorOptions as ar, DownloadedFileRecord as at, DataSourceCandidateAuditSink as b, measurePdfTextQuality as bi, PagePerceptionPolicyOptions as bn, TabWorksetPolicyOptions as br, DwgProjection as bt, CellAddress as c, createTabWorksetToolSource as ci, PageActionRequest as cn, SpreadsheetToolSourceOptions as cr, DwgComponent as ct, DELEGATE_TASK_TOOL as d, defersImage as di, PageActionTarget as dn, SubtreeRejection as dr, DwgEntity as dt, createDwgToolSource as ei, PERCEPTION_SYSTEM_PROMPT as en, SkillGenerationMessages as er, DownloadedFileListing as et, DELEGATION_SYSTEM_PROMPT as f, dwgPickView as fi, PageActionToolSourceOptions as fn, TAB_WORKSET_DEFAULT_MAX as fr, DwgFill as ft, DOWNLOAD_WAIT_MIN_MS as g, frameLabel as gi, PageImageFailure as gn, TEMPLATE_INSPECT_BUDGET as gr, DwgLoadedDrawing as gt, DOWNLOAD_WAIT_MAX_MS as h, formatCellAddress as hi, PageImageCapture as hn, TAB_WORKSET_SYSTEM_PROMPT as hr, DwgLayer as ht, ActionTabWatcher as i, createPagePerceptionToolSource as ii, PageActionOutcome as in, SkillGenerator as ir, DownloadedFileReader as it, DataSourceTransport as j, PerceptionCaptureOptions as jn, TodoEvent as jr, FOCUS_PAGE_TAB_TOOL as jt, DataSourceProvenance as k, withDelegationOrigin as ki, PerceivedNode as kn, TemplateTableCellSkeleton as kr, FETCH_REMOTE_IMAGE_TOOL as kt, CellRange as l, createTemplateToolSource as li, PageActionScope as ln, SubAgentRunInput as lr, DwgDocumentContent as lt, DOWNLOAD_WAIT_DEFAULT_MS as m, fitWithin as mi, PageAuditSink as mn, TAB_WORKSET_MIN_MAX as mr, DwgGeometry as mt, ActionDownloadWindow as n, createPageActionToolSource as ni, PageActionExecutor as nn, SkillGenerationPolicy as nr, DownloadedFilePolicyOptions as nt, CAPTURE_PAGE_IMAGE_TOOL as o, createSkillGenerationToolSource as oi, PageActionPolicyOptions as on, SkillTraceEvidence as or, DownloadedFileToolSourceOptions as ot, DOCUMENT_READ_BUDGET as p, dwgViewsOf as pi, PageActionUi as pn, TAB_WORKSET_MAX_MAX as pr, DwgFont as pt, DocxDocumentReader as q, SCROLL_DIRECTIONS as qn, asReadMode as qr, PAGE_ACTION_SYSTEM_PROMPT as qt, ActionFrameScope as r, createPageImageToolSource as ri, PageActionKind as rn, SkillGenerationToolSourceOptions as rr, DownloadedFileReadResult as rt, CLOSE_PAGE_TAB_TOOL as s, createSpreadsheetToolSource as si, PageActionRecord as sn, SkillTraceEvidenceStep as sr, DwgBounds as st, ActionDownloadWatcher as t, createHttpDataSourceTransport as ti, PageActionConsent as tn, SkillGenerationOutcome as tr, DownloadedFilePolicy as tt, ConsentUi as u, createTodoToolSource as ui, PageActionScopeInput as un, SubAgentRunner as ur, DwgDocumentReader as ut, DataSourceAuditSink as v, isPdfTextTrustworthy as vi, PageImageToolSourceOptions as vn, TabAdmission as vr, DwgPoint as vt, DataSourceCandidateStore as w, readImageSize as wi, PdfDocumentHandle as wn, TemplateFileSource as wr, DwgViewport as wt, DataSourceCandidatePolicy as x, parseCellAddress as xi, PagePerceptionReader as xn, TabWorksetPort as xr, DwgToolSourceOptions as xt, DataSourceCandidate as y, isRangeTopLeft as yi, PagePerceptionPolicy as yn, TabWorksetPolicy as yr, DwgProjectedDrawing as yt, DocumentFileBytes as z, PptxSlideContent as zn, WorksetTab as zr, LIST_DOWNLOADED_FILES_TOOL as zt };