revise 2.1.0 → 3.0.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 (126) hide show
  1. package/CHANGELOG.md +47 -1088
  2. package/LICENSE +24 -41
  3. package/README.md +103 -26
  4. package/agent.d.ts +139 -0
  5. package/chunks/chunk-U5X47PZ6.js +135 -0
  6. package/chunks/chunk-U6YKQBKL.js +15 -0
  7. package/chunks/chunk-ZLQVPMBN.js +1650 -0
  8. package/chunks/package-5SHL5FOJ.js +14 -0
  9. package/chunks/render-QD5VWKSV.js +109 -0
  10. package/cli-output.schema.json +1984 -0
  11. package/cli.js +3604 -0
  12. package/document.d.ts +320 -0
  13. package/docx.d.ts +73 -0
  14. package/errors.d.ts +14 -0
  15. package/index.d.ts +13 -967
  16. package/index.js +31 -1
  17. package/legacy/editor.d.ts +19 -0
  18. package/legacy/editor.js +16 -0
  19. package/legacy/server.d.ts +37 -0
  20. package/legacy/server.js +25 -0
  21. package/legacy/style.css +2 -0
  22. package/package.d.ts +23 -0
  23. package/package.json +49 -55
  24. package/render.d.ts +27 -0
  25. package/FONT-LICENSE-HAN-EXT-B.txt +0 -91
  26. package/FONT-LICENSE-KATEX.txt +0 -95
  27. package/FONT-LICENSE-LIBERATION.txt +0 -102
  28. package/FONT-LICENSE-NOTO-MULTILINGUAL.txt +0 -93
  29. package/FONT-LICENSE-NOTO-SANS-SC.txt +0 -93
  30. package/FONT-LICENSE-NOTO.txt +0 -94
  31. package/FONT-LICENSE-SOURCE-CODE-PRO.txt +0 -94
  32. package/FONT-LICENSE-SOURCE-SERIF-4.txt +0 -93
  33. package/THIRD-PARTY-NOTICES.md +0 -3376
  34. package/assets/historyMaterializeWorker-C4uxcZEh.js +0 -607
  35. package/backend.d.ts +0 -155
  36. package/backend.js +0 -3
  37. package/chunks/AgentPageRenderer-BFB0arQL.js +0 -1
  38. package/chunks/AgentPageRenderer-Dn6SaRjW.js +0 -1
  39. package/chunks/AttachmentDocumentImporter-BHDJAdky.js +0 -1
  40. package/chunks/AttachmentDocumentImporter-CxOZqzt1.js +0 -1
  41. package/chunks/BidiText-C8PBPSQY.js +0 -160
  42. package/chunks/ColorParserFull-BKH72fK8.js +0 -446
  43. package/chunks/DocumentMutator-4vBJQ74L.js +0 -31
  44. package/chunks/DocumentScrubber-COPepQKE.js +0 -1
  45. package/chunks/DocumentScrubber-Cf_QqHhF.js +0 -1
  46. package/chunks/DocumentScrubber-DS4LFDKS.js +0 -18
  47. package/chunks/DocumentStylesheet-byN5dtC6.js +0 -7
  48. package/chunks/DocxConverter-BCEB7jWY.js +0 -1083
  49. package/chunks/DocxConverter-C3NflpDr.js +0 -11
  50. package/chunks/DocxConverter-D9ZNn4nX.js +0 -11
  51. package/chunks/DocxGraft-Ba63IRP4.js +0 -1
  52. package/chunks/DocxGraft-DjERgl-z.js +0 -7
  53. package/chunks/DocxGraft-cYlmw4Ab.js +0 -1
  54. package/chunks/FileImporter-CHXj9sNX.js +0 -1
  55. package/chunks/FileImporter-DetvRoJc.js +0 -1
  56. package/chunks/HorizontalRuleOrnaments-gmUZ3R7Q.js +0 -3
  57. package/chunks/HtmlConverter-Sd9t49vH.js +0 -267
  58. package/chunks/ListNumbering-Qlu6AuRZ.js +0 -23
  59. package/chunks/MarkdownConverter-BdJgh8xt.js +0 -57
  60. package/chunks/MathRenderer-B0Y1h1JU.js +0 -62
  61. package/chunks/OdtConverter-BKtyx012.js +0 -1
  62. package/chunks/OdtConverter-Ce9j8PRt.js +0 -1
  63. package/chunks/OdtConverter-D709qfYb.js +0 -31
  64. package/chunks/ParagraphDiffAnalysis-DrmStvmz.js +0 -36
  65. package/chunks/PdfConverter-BA8XLTAM.js +0 -21
  66. package/chunks/PdfConverter-CkDClffR.js +0 -438
  67. package/chunks/PdfConverter-CxLxd-LJ.js +0 -21
  68. package/chunks/PdfImportService-CQCgsRX1.js +0 -2
  69. package/chunks/PdfImportService-xl7fstr-.js +0 -2
  70. package/chunks/RtfConverter-BZOnMUGH.js +0 -14
  71. package/chunks/RtfConverter-Bs81AfXt.js +0 -14
  72. package/chunks/RtfConverter-DfuE5olb.js +0 -45
  73. package/chunks/TableBorders-Cdkc62cX.js +0 -30
  74. package/chunks/TableGrid-DbroRucl.js +0 -12
  75. package/chunks/TextFileDecoder--rsVs3NR.js +0 -9
  76. package/chunks/TxtConverter-C-oiFUAp.js +0 -14
  77. package/chunks/UnicodeUtils-CXtusU4g.js +0 -10
  78. package/chunks/XmlConverter-C0FnrVYk.js +0 -70
  79. package/chunks/XmlConverter-CQa8baOF.js +0 -2
  80. package/chunks/XmlConverter-DjEYaIyf.js +0 -2
  81. package/chunks/__vite-browser-external-l0sNRNKZ.js +0 -0
  82. package/chunks/_commonjsHelpers-DaMA6jEr.js +0 -2
  83. package/chunks/_revise-sdk-lazy-harfbuzz-CDWdjF9f.js +0 -1
  84. package/chunks/_revise-sdk-lazy-harfbuzz-X8gnYTZL.js +0 -1
  85. package/chunks/ar-BdmGnaKI.js +0 -14
  86. package/chunks/backend-BIhAX-Gi.js +0 -484
  87. package/chunks/base64-Qx0OzT4p.js +0 -196
  88. package/chunks/browser-module-CFmqfGkE.js +0 -1791
  89. package/chunks/browser-module-CYGCfEyx.js +0 -3
  90. package/chunks/browser-module-DgvTMhpA.js +0 -3
  91. package/chunks/bundle.min-DRpfgV69.js +0 -782
  92. package/chunks/capture-BAJ2in5p.js +0 -9
  93. package/chunks/carrier-C5VZRMxZ.js +0 -6
  94. package/chunks/de-DldIXRFC.js +0 -14
  95. package/chunks/es-CnyKlSPK.js +0 -14
  96. package/chunks/footnoteFlatten-Bekh8ZfM.js +0 -6
  97. package/chunks/graftExport-CRRm1Oe_.js +0 -82
  98. package/chunks/html2canvas.esm-CntiHiYW.js +0 -997
  99. package/chunks/index-B1idHquf.js +0 -1094
  100. package/chunks/index-BWdRWxoH.js +0 -1807
  101. package/chunks/index-C-4H81OE.js +0 -378
  102. package/chunks/index-iZC8xN0t.js +0 -378
  103. package/chunks/index.es-Bwt05m_b.js +0 -5
  104. package/chunks/index.es-CI0QPo8w.js +0 -780
  105. package/chunks/index.es-DAQD57G4.js +0 -5
  106. package/chunks/jspdf.es.min-CnNRolk9.js +0 -77
  107. package/chunks/jspdf.es.min-DU74zN8b.js +0 -1792
  108. package/chunks/jspdf.es.min-DlTF8uTw.js +0 -77
  109. package/chunks/jszip.min-CPW0h1Kx.js +0 -476
  110. package/chunks/katex-DWj8TvwO.js +0 -1462
  111. package/chunks/pdf-BLWDCiFF.js +0 -1828
  112. package/chunks/persistInlineDocumentImages-DQj2iaqg.js +0 -1
  113. package/chunks/pseudoLocale-BoJwIubw.js +0 -1
  114. package/chunks/pseudoLocale-DWAm7Dpa.js +0 -1
  115. package/chunks/purify.es-BwLardii.js +0 -107
  116. package/chunks/serverDocumentSession-DASrQAbW.js +0 -15
  117. package/chunks/signatures-CBF7NZUy.js +0 -17
  118. package/chunks/tree-sitter-D6zWWUMP.js +0 -4
  119. package/chunks/wasmInline.generated-CBYFkdSM.js +0 -1
  120. package/chunks/web-tree-sitter-BXGZGnNj.js +0 -2
  121. package/full.js +0 -1
  122. package/root.d.ts +0 -5
  123. package/root.js +0 -2
  124. package/serverToolContract.d.ts +0 -391
  125. package/serverToolInputs.generated.d.ts +0 -250
  126. package/style.css +0 -1
@@ -1,391 +0,0 @@
1
- /**
2
- * The canonical tool contract, shared by both surfaces. The `Server` prefix
3
- * marks the headless origin of these types, but since 1.0.0 the browser
4
- * surface (`editor.tools`) speaks exactly the same envelope: `execute()`
5
- * returns the same discriminated `ReviseToolResult`, `call()` throws the same
6
- * `ReviseToolError`, and inputs are typed by the same generated map. Hosts
7
- * can share result-handling code between web and Node verbatim.
8
- */
9
- import type {
10
- ReviseJsonObject,
11
- ReviseJsonValue,
12
- ReviseToolInput,
13
- ReviseToolName,
14
- } from "./serverToolInputs.generated.js";
15
-
16
- export type {
17
- ReviseJsonObject,
18
- ReviseJsonPrimitive,
19
- ReviseJsonValue,
20
- ReviseToolInput,
21
- ReviseToolInputMap,
22
- ReviseToolName,
23
- } from "./serverToolInputs.generated.js";
24
-
25
- export type ServerDocumentMode = "editing" | "suggesting";
26
-
27
- export interface ServerDocumentSessionOptions {
28
- documentId: string;
29
- /**
30
- * Initial mode; the session's mode methods can change it later. Defaults to
31
- * "suggesting" — the same posture as the browser surface, and the safe one:
32
- * a service proposes tracked changes unless it explicitly opts into
33
- * applying edits directly.
34
- */
35
- mode?: ServerDocumentMode;
36
- searchPageSize?: number;
37
- }
38
-
39
- export interface ReviseToolCallOptions {
40
- /** Apply this mutation directly, even when the session is suggesting. */
41
- directMode?: boolean;
42
- }
43
-
44
- /** Discriminant of a pending tracked-suggestion record. */
45
- export type ReviseSuggestionType =
46
- | "inline-text"
47
- | "inline-format"
48
- | "block-change"
49
- | "block-insert"
50
- | "block-delete"
51
- | "table-change"
52
- | "paragraph-split"
53
- | "paragraph-merge";
54
-
55
- /**
56
- * One pending tracked-suggestion record, projected for host review flows.
57
- * Metadata fields are absent when the underlying record predates uniform
58
- * authorship stamping or was written by an older client.
59
- */
60
- export interface ReviseSuggestionRecord {
61
- id: string;
62
- /** Absent when only stamped content marks carry the suggestion, which is
63
- * the norm for inline text edits and for restored documents. */
64
- type?: ReviseSuggestionType;
65
- /** The top-level block the suggestion targets, for block-scoped types. */
66
- blockId?: string;
67
- /** The table the suggestion targets, for table-change records. */
68
- tableId?: string;
69
- authorType?: "ai" | "human";
70
- /** Author display name: an agent name or a human's display name. */
71
- agentName?: string;
72
- /** Provider-qualified model that authored an AI suggestion. */
73
- agentModel?: string;
74
- source?: string;
75
- label?: string;
76
- createdAt?: number;
77
- }
78
-
79
- /**
80
- * Per-ID outcome of an accept or reject call. IDs a host persisted from an
81
- * earlier tool result can go stale — a later suggestion can supersede an
82
- * earlier one — so the settled and unknown sets are reported explicitly
83
- * instead of an inferred count.
84
- */
85
- export interface ReviseSuggestionDecision {
86
- /** Requested IDs that were pending and are now settled. */
87
- resolved: string[];
88
- /** Requested IDs that were not pending suggestions when the call ran. */
89
- missing: string[];
90
- /** Requested IDs that were pending but could not be settled. Rare. */
91
- unresolved: string[];
92
- }
93
-
94
- export interface ReviseToolDefinition<
95
- Name extends ReviseToolName = ReviseToolName,
96
- > {
97
- name: Name;
98
- description: string;
99
- inputSchema: ReviseJsonObject;
100
- }
101
-
102
- export interface ReviseReadCoverage {
103
- requestedBlockCount: number;
104
- readBlocksThisTurn: number;
105
- readTokenBudgetMax: number;
106
- requestedRanges: Array<{ start: number; end: number }>;
107
- fullDocumentLoaded: boolean;
108
- }
109
-
110
- export interface ReviseReadData {
111
- kind: "read_context";
112
- tool: "read_blocks_from_index" | "read_specific_blocks";
113
- loaded: ReviseJsonObject;
114
- next: { index: number; blockId?: string } | null;
115
- endOfDocument: boolean;
116
- coverage: ReviseReadCoverage;
117
- }
118
-
119
- export interface ReviseSearchMatch {
120
- blockId: string;
121
- blockIndex: number;
122
- matchedQueries?: string[];
123
- matchedColors?: string[];
124
- }
125
-
126
- export interface ReviseSearchData {
127
- kind: "search_context";
128
- tool: "search_document" | "find_highlights";
129
- queries?: string[];
130
- color?: string;
131
- totalMatches: number;
132
- search_result_id?: string;
133
- page: {
134
- current: number;
135
- total: number;
136
- startResult: number;
137
- endResult: number;
138
- };
139
- nextPage: number | null;
140
- matches: ReviseSearchMatch[];
141
- coverage: ReviseReadCoverage;
142
- }
143
-
144
- export interface ReviseDocumentMeasurementSection {
145
- startIndex: number;
146
- endIndex: number;
147
- startBlockId: string;
148
- endBlockId: string;
149
- headingLevel: 1 | 2 | 3;
150
- title: string;
151
- wordCount: number;
152
- paragraphCount: number;
153
- characterCount: number;
154
- inclusive: true;
155
- blockCount: number;
156
- pageStart?: number;
157
- pageEnd?: number;
158
- }
159
-
160
- export interface ReviseDocumentMeasurementData {
161
- kind: "document_measurement";
162
- tool: "measure_document";
163
- inclusive: true;
164
- totalBlocks: number;
165
- wordCount: number;
166
- paragraphCount: number;
167
- characterCount: number;
168
- pageCount?: number;
169
- fractionalPageCount?: number;
170
- sections?: ReviseDocumentMeasurementSection[];
171
- sectionCount?: number;
172
- sectionOffset?: number;
173
- sectionLimit?: number;
174
- returnedSectionCount?: number;
175
- hasMoreSections?: boolean;
176
- nextSectionOffset?: number;
177
- }
178
-
179
- export interface ReviseMeasuredBlockRange {
180
- startIndex: number;
181
- endIndex: number;
182
- startBlockId: string;
183
- endBlockId: string;
184
- inclusive: true;
185
- blockCount: number;
186
- wordCount: number;
187
- paragraphCount: number;
188
- characterCount: number;
189
- pageStart?: number;
190
- pageEnd?: number;
191
- }
192
-
193
- export interface ReviseBlockMeasurementData {
194
- kind: "document_measurement";
195
- tool: "measure_blocks";
196
- inclusive: true;
197
- totalBlocks: number;
198
- ranges: ReviseMeasuredBlockRange[];
199
- errors: Array<{
200
- startBlockId?: string;
201
- endBlockId?: string;
202
- error: string;
203
- }>;
204
- }
205
-
206
- export interface ReviseMutationData {
207
- tool: string;
208
- target_reference?: string;
209
- summary?: string;
210
- effect: {
211
- requested_target_count: number;
212
- changed_target_count: number;
213
- removed_target_count: number;
214
- inserted_block_count: number;
215
- top_level_blocks_before: number;
216
- top_level_blocks_after: number;
217
- [key: string]: ReviseJsonValue;
218
- };
219
- before_block?: string;
220
- }
221
-
222
- export interface ReviseCommentData {
223
- commentId: string;
224
- /** The block the comment is anchored to. */
225
- blockId: string;
226
- /** Set when the requested block did not hold the anchor text and the
227
- * comment went to the only read block that did. */
228
- requestedBlockId?: string;
229
- anchor: ReviseJsonObject;
230
- }
231
-
232
- type ReviseReadToolName = "read_blocks_from_index" | "read_specific_blocks";
233
- type ReviseSearchToolName = "search_document" | "find_highlights";
234
- type ReviseMeasurementToolName = "measure_document" | "measure_blocks";
235
- type ReviseSpecializedToolName =
236
- | ReviseReadToolName
237
- | ReviseSearchToolName
238
- | ReviseMeasurementToolName
239
- | "leave_comment";
240
- type ReviseMutationToolName = Exclude<
241
- ReviseToolName,
242
- ReviseSpecializedToolName
243
- >;
244
-
245
- export type ReviseToolDataMap = {
246
- [Name in ReviseReadToolName]: ReviseReadData;
247
- } & {
248
- [Name in ReviseSearchToolName]: ReviseSearchData;
249
- } & {
250
- measure_document: ReviseDocumentMeasurementData;
251
- measure_blocks: ReviseBlockMeasurementData;
252
- leave_comment: ReviseCommentData;
253
- } & {
254
- [Name in ReviseMutationToolName]: ReviseMutationData | null;
255
- };
256
-
257
- export type ReviseToolData<Name extends ReviseToolName> =
258
- ReviseToolDataMap[Name];
259
-
260
- /**
261
- * A tool's input as application code writes it for typed `execute()` and
262
- * `call()`.
263
- *
264
- * `context_notes` is a model's working memory, carried from one read to the
265
- * next, and the model-facing schemas require it. Host code keeps its own
266
- * state, so the field is optional here and defaults to `"N/A"`.
267
- * `executeDynamic()`, the path for model-provided calls, still requires it.
268
- */
269
- export type ReviseHostToolInput<Name extends ReviseToolName> =
270
- ReviseToolInput<Name> extends { context_notes: string }
271
- ? Omit<ReviseToolInput<Name>, "context_notes"> & { context_notes?: string }
272
- : ReviseToolInput<Name>;
273
-
274
- /** Tool arguments, with input optional only when its schema has no required fields. */
275
- export type ReviseToolArguments<Name extends ReviseToolName> =
276
- Record<string, never> extends ReviseHostToolInput<Name>
277
- ? [input?: ReviseHostToolInput<Name>, options?: ReviseToolCallOptions]
278
- : [input: ReviseHostToolInput<Name>, options?: ReviseToolCallOptions];
279
-
280
- /** Semantic document context returned by read and search calls. */
281
- export interface ReviseDocumentContext {
282
- format: "revise-html";
283
- html: string;
284
- }
285
-
286
- /** A successful tool call, ready for application code or a model transcript. */
287
- export interface ReviseToolResponse<Name extends string = ReviseToolName> {
288
- callId: string;
289
- tool: Name;
290
- /** Concise model-oriented summary of what happened. */
291
- message: string | null;
292
- /** Tool-specific structured data. Literal tool names infer this type. */
293
- data: Name extends ReviseToolName
294
- ? ReviseToolData<Name>
295
- : ReviseJsonValue | null;
296
- /** Block-ID-preserving semantic HTML, when the call loaded document text. */
297
- context: ReviseDocumentContext | null;
298
- /**
299
- * For mutation tools, the tracked suggestion records this call created:
300
- * non-empty only in suggesting mode. Empty when the edit applied directly,
301
- * changed nothing, or extended an existing pending suggestion instead of
302
- * creating its own record. Null for read, search, and measurement tools.
303
- */
304
- suggestionIds: string[] | null;
305
- /**
306
- * Image payload from browser-only tools (`view_image`). Never present on
307
- * the server surface, whose sessions exclude the image pipeline.
308
- */
309
- image?: {
310
- id: string;
311
- fileName?: string;
312
- urls?: string[];
313
- dimensions?: Array<{ width: number; height: number }>;
314
- };
315
- }
316
-
317
- /** An expected tool rejection: invalid input, stale context, or unavailable tool. */
318
- export interface ReviseToolFailure<Name extends string = ReviseToolName> {
319
- callId: string;
320
- tool: Name;
321
- code: string;
322
- message: string;
323
- }
324
-
325
- export type ReviseToolResult<Name extends string = ReviseToolName> =
326
- | { ok: true; value: ReviseToolResponse<Name> }
327
- | { ok: false; error: ReviseToolFailure<Name> };
328
-
329
- export interface ServerDocumentTools {
330
- getDefinitions(): ReviseToolDefinition[];
331
-
332
- /**
333
- * Execute a known tool and preserve expected failures as a discriminated
334
- * result. Environment and disposed-session errors still reject the promise.
335
- */
336
- execute<Name extends ReviseToolName>(
337
- name: Name,
338
- ...args: ReviseToolArguments<Name>
339
- ): Promise<ReviseToolResult<Name>>;
340
-
341
- /** Execute an untrusted model-provided name and JSON input. */
342
- executeDynamic(
343
- name: string,
344
- input?: ReviseJsonObject,
345
- options?: ReviseToolCallOptions,
346
- ): Promise<ReviseToolResult<string>>;
347
-
348
- /**
349
- * Convenient application-code form. Returns only the successful response
350
- * and throws ReviseToolError when the tool rejects the call.
351
- */
352
- call<Name extends ReviseToolName>(
353
- name: Name,
354
- ...args: ReviseToolArguments<Name>
355
- ): Promise<ReviseToolResponse<Name>>;
356
- }
357
-
358
- export interface ServerDocumentSession {
359
- /** Return the mode subsequent mutations will capture. */
360
- getMode(): ServerDocumentMode;
361
- /** Make subsequent mutations produce tracked suggestions. */
362
- setSuggestingMode(): void;
363
- /** Make subsequent mutations apply directly. */
364
- setEditingMode(): void;
365
- readonly tools: ServerDocumentTools;
366
- /** IDs of pending tracked suggestions currently stored in the Y.Doc. */
367
- getPendingSuggestionIds(): string[];
368
- /**
369
- * Every pending tracked suggestion in the Y.Doc as a reviewable record —
370
- * including collaborators' suggestions in a shared document. Filter by
371
- * author metadata before making bulk decisions on someone else's work.
372
- */
373
- listSuggestions(): ReviseSuggestionRecord[];
374
- /**
375
- * Accept specific pending suggestions by ID — the primary review path.
376
- * Collect IDs from mutation results' `suggestionIds` or from
377
- * `listSuggestions()`.
378
- */
379
- acceptSuggestions(suggestionIds: string[]): ReviseSuggestionDecision;
380
- /** Reject specific pending suggestions by ID. */
381
- rejectSuggestions(suggestionIds: string[]): ReviseSuggestionDecision;
382
- /**
383
- * Accept every pending suggestion in the Y.Doc, including collaborators'.
384
- * Prefer `acceptSuggestions(ids)` unless the host owns the whole document.
385
- */
386
- acceptAllSuggestions(): ReviseSuggestionDecision;
387
- /** Reject every pending suggestion in the Y.Doc, including collaborators'. */
388
- rejectAllSuggestions(): ReviseSuggestionDecision;
389
- /** Release observers without destroying the supplied Y.Doc. */
390
- dispose(): void;
391
- }
@@ -1,250 +0,0 @@
1
- // Input types for every Revise tool, generated from the tool schemas.
2
- export type ReviseJsonPrimitive = string | number | boolean | null;
3
- export type ReviseJsonValue =
4
- | ReviseJsonPrimitive
5
- | ReviseJsonValue[]
6
- | { [key: string]: ReviseJsonValue };
7
- export type ReviseJsonObject = { [key: string]: ReviseJsonValue };
8
-
9
- export interface ReviseToolInputMap {
10
- read_blocks_from_index: {
11
- context_notes: string;
12
- index: number;
13
- };
14
- search_document: {
15
- context_notes: string;
16
- page: number;
17
- queries: Array<string>;
18
- };
19
- find_highlights: {
20
- color?: "yellow" | "orange" | "green" | "blue" | "purple" | "pink" | "gray";
21
- context_notes: string;
22
- page: number;
23
- };
24
- read_specific_blocks: {
25
- block_ids: Array<string>;
26
- context_notes: string;
27
- };
28
- read_table: {
29
- cell_id?: string;
30
- column_count?: number;
31
- column_start?: number;
32
- context_notes: string;
33
- continuation_revision?: string;
34
- mode?: "summary" | "rows" | "cell_text";
35
- row_count?: number;
36
- row_ids?: Array<string>;
37
- row_start?: number;
38
- table_id: string;
39
- text_offset?: number;
40
- };
41
- measure_document: {
42
- heading_levels?: Array<1 | 2 | 3>;
43
- include_sections?: boolean;
44
- section_limit?: number;
45
- section_offset?: number;
46
- };
47
- measure_blocks: {
48
- mode?: "inclusive";
49
- ranges: Array<{
50
- end_block_id?: string;
51
- start_block_id: string;
52
- }>;
53
- };
54
- insert_block: {
55
- content: Array<string>;
56
- position: "before" | "after";
57
- referenceId: string;
58
- };
59
- insert_footnote: {
60
- find: string;
61
- id: string;
62
- kind?: "footnote" | "endnote";
63
- text: string;
64
- };
65
- remove_blocks: {
66
- count?: number;
67
- id?: string;
68
- ids?: Array<string>;
69
- search_result_id?: string;
70
- through_end?: boolean;
71
- };
72
- append_to_paragraph: {
73
- content: string;
74
- id: string;
75
- };
76
- break_paragraph: {
77
- id: string;
78
- substring: string;
79
- };
80
- join_paragraphs: {
81
- firstId: string;
82
- secondId: string;
83
- separator?: string;
84
- };
85
- replace_block: {
86
- content: Array<string>;
87
- count?: number;
88
- id?: string;
89
- search_result_id?: string;
90
- };
91
- style_blocks: {
92
- attrs: Array<{
93
- name: string;
94
- value: string | number | boolean | null;
95
- }>;
96
- search_result_id?: string;
97
- selectors: string | Array<string>;
98
- };
99
- clear_formatting: {
100
- id: string | Array<string>;
101
- };
102
- set_title: {
103
- title: string;
104
- };
105
- set_page_layout: {
106
- blockSpacing?: string;
107
- clearPageBorders?: boolean;
108
- columnCount?: 1 | 2 | 3;
109
- columnGap?: string;
110
- indentStep?: string;
111
- margin?: string;
112
- marginBottom?: string;
113
- marginLeft?: string;
114
- marginRight?: string;
115
- marginTop?: string;
116
- noteMode?: "footnotes" | "endnotes";
117
- orientation?: "portrait" | "landscape";
118
- pageBorders?: {
119
- bottom?: {
120
- color: string;
121
- spacePt: number;
122
- style: "single" | "double" | "dotted" | "dashed";
123
- widthPt: number;
124
- };
125
- display: "allPages" | "firstPage" | "notFirstPage";
126
- left?: {
127
- color: string;
128
- spacePt: number;
129
- style: "single" | "double" | "dotted" | "dashed";
130
- widthPt: number;
131
- };
132
- offsetFrom: "page" | "text";
133
- right?: {
134
- color: string;
135
- spacePt: number;
136
- style: "single" | "double" | "dotted" | "dashed";
137
- widthPt: number;
138
- };
139
- top?: {
140
- color: string;
141
- spacePt: number;
142
- style: "single" | "double" | "dotted" | "dashed";
143
- widthPt: number;
144
- };
145
- zOrder: "front" | "back";
146
- };
147
- pageHeight?: string;
148
- pageNumberFormat?: "decimal" | "lowerRoman" | "upperRoman";
149
- pageNumberPosition?:
150
- | "top-left"
151
- | "top-right"
152
- | "bottom-left"
153
- | "bottom-right";
154
- pageNumberRestart?: boolean;
155
- pageNumberStart?: number;
156
- pageSize?:
157
- | "letter"
158
- | "tabloid"
159
- | "legal"
160
- | "statement"
161
- | "executive"
162
- | "folio"
163
- | "a3"
164
- | "a4"
165
- | "a5"
166
- | "b4"
167
- | "b5";
168
- pageWidth?: string;
169
- pageless?: boolean;
170
- preset?: "apa7";
171
- sectionIndex?: number;
172
- showPageNumbers?: boolean;
173
- };
174
- set_header_footer: {
175
- center?: string;
176
- clear?: boolean;
177
- left?: string;
178
- right?: string;
179
- side: "header" | "footer";
180
- slot?: "default" | "first" | "even";
181
- };
182
- replace: {
183
- id?: string;
184
- replacements: Array<{
185
- comment?: string;
186
- find: string;
187
- occurrence?: "unique" | "all";
188
- replace: string;
189
- }>;
190
- search_result_id?: string;
191
- };
192
- leave_comment: {
193
- acknowledge_existing_thread_ids?: Array<string>;
194
- anchor?:
195
- | {
196
- text: string;
197
- }
198
- | {
199
- end_text: string;
200
- start_text: string;
201
- }
202
- | {
203
- whole_block: true;
204
- };
205
- comment: string;
206
- id?: string;
207
- reply_to_comment_id?: string;
208
- };
209
- insert_table_row: {
210
- content: Array<string>;
211
- position: "before" | "after";
212
- referenceIndex?: number;
213
- referenceRowId?: string;
214
- tableId: string;
215
- };
216
- remove_table_row: {
217
- rowIndex: number;
218
- tableId: string;
219
- };
220
- insert_table_column: {
221
- content: Array<string>;
222
- position: "before" | "after";
223
- referenceIndex: number;
224
- tableId: string;
225
- };
226
- remove_table_column: {
227
- columnIndex: number;
228
- tableId: string;
229
- };
230
- edit_table_cells: {
231
- cells: Array<{
232
- column: number;
233
- row_id: string;
234
- text: string;
235
- }>;
236
- mode: "fill_if_empty" | "replace";
237
- table_id: string;
238
- };
239
- remove_block: {
240
- count?: number;
241
- id?: string;
242
- ids?: Array<string>;
243
- search_result_id?: string;
244
- through_end?: boolean;
245
- };
246
- }
247
-
248
- export type ReviseToolName = keyof ReviseToolInputMap;
249
- export type ReviseToolInput<Name extends ReviseToolName> =
250
- ReviseToolInputMap[Name];