@grid-is/agent-tools 0.2.3 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
+ import { C as runFormula, D as whatIf, E as viewRange, S as readCalculatedValues, T as symbols, _ as isToolError, a as dependents, b as manageSheets, c as editCells, d as generateWorkbookContext, f as getComment, g as inspect, h as goalSeek, i as captureRange, l as fillCells, m as getStyles, n as ToolContext, o as describeStructure, p as getComments, s as editCellStyles, t as SpreadsheetTool, u as findCells, v as listErrors, x as precedents, y as manageRowsAndColumns } from "./index-DtYMYL_H.js";
1
2
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
- import { Cell, CellValue, FormulaError, Model, WorkbookDescription } from "@grid-is/apiary";
3
3
  import { z } from "zod";
4
- //#region src/tools.d.ts
4
+ //#region src/session.d.ts
5
5
  interface ToolResult {
6
6
  text: string;
7
7
  isError: boolean;
@@ -18,1550 +18,6 @@ interface GridTool {
18
18
  }
19
19
  declare function createGridTools(cwd?: string): GridTool[];
20
20
  //#endregion
21
- //#region node_modules/@jsfkit/types/dist/index.d.ts
22
- /**
23
- * A whole number without a fractional value.
24
- *
25
- * @group Workbooks
26
- */
27
- type integer = number;
28
- /**
29
- * A numeric value measured in pixels.
30
- *
31
- * @min 0
32
- * @group Workbooks
33
- */
34
- type PixelValue = number;
35
- /**
36
- * Automatic colour choice. The application decides on what exact colour to use. Typically this
37
- * means black for text, white for background.
38
- *
39
- * @group Colors
40
- */
41
- type AutoColor = {
42
- type: 'auto';
43
- };
44
- /**
45
- * Represents a single transformation that can be applied to a colour.
46
- *
47
- * Most transforms have a `type` that specifies the kind of transformation, and a `value` that
48
- * provides the necessary parameter for that transformation. The exact meaning and valid range of
49
- * `value` depends on the `type` of transform. The exception are a handful of whole-colour
50
- * transformations that affect the entire colour; they have `type` but no `value.`
51
- *
52
- * The supported transform types include:
53
- *
54
- * - Tint and shade: blend the colour towards white (tint) or black (shade) by a specified
55
- * percentage.
56
- * - Alpha: adjust the opacity of the colour using various methods (absolute value, multiplicative,
57
- * or additive).
58
- * - Hue, saturation, and luminance: rotate a colour attribute of the colour by a specified amount
59
- * (absolute, multiplicative, or additive).
60
- * - Per-channel RGB adjustments: modify individual red, green, or blue channels (absolute,
61
- * multiplicative, or additive).
62
- * - Whole-colour operations: apply transformations that affect the entire colour (complement,
63
- * invert, grayscale, gamma adjustments).
64
- *
65
- * @group Colors
66
- */
67
- type ColorTransform = {
68
- /**
69
- * Produces a lighter version of the input colour. A 10% tint is 10% of the input colour
70
- * combined with 90% white. */
71
- type: 'tint';
72
- /**
73
- * Percentage (clamped to 0-100).
74
- * @min 0
75
- * @max 100
76
- */
77
- value: number;
78
- } | {
79
- /**
80
- * Produces a darker version of the input colour. A 10% shade is 10% of the input colour
81
- * combined with 90% black.
82
- */
83
- type: 'shade';
84
- /**
85
- * Percentage (clamped to 0-100).
86
- * @min 0
87
- * @max 100
88
- */
89
- value: number;
90
- } | {
91
- /** Alters the input colour to have the specified opacity, but with its colour unchanged. */
92
- type: 'alpha';
93
- /**
94
- * Percentage (clamped to 0-100).
95
- * @min 0
96
- * @max 100
97
- */
98
- value: number;
99
- } | {
100
- /**
101
- * Produces a more or less opaque version of the input colour. An alpha modulate never increases
102
- * the alpha beyond 100%. A 200% alpha modulate makes an input colour twice as opaque as before.
103
- * A 50% alpha modulate makes an input colour half as opaque as before.
104
- */
105
- type: 'alphaMod';
106
- /**
107
- * Positive percentage.
108
- * @min 0
109
- */
110
- value: number;
111
- } | {
112
- /**
113
- * Produces a more or less opaque version of the input colour.
114
- *
115
- * Increases or decreases the input alpha percentage by the specified percentage offset. A 10%
116
- * alpha offset increases a 50% opacity to 60%. A -10% alpha offset decreases a 50% opacity to
117
- * 40%. The transformed alpha values are limited to a range of 0 to 100%. A 10% alpha offset
118
- * increase to a 100% opaque object still results in 100% opacity.
119
- */
120
- type: 'alphaOff';
121
- /**
122
- * Percentage (clamped to -100 to 100).
123
- * @min -100
124
- * @max 100
125
- */
126
- value: number;
127
- } | {
128
- /**
129
- * Alters the input colour so it has the specified hue, but with its saturation and luminance
130
- * unchanged.
131
- */
132
- type: 'hue';
133
- /**
134
- * Degrees (clamped to 0-360).
135
- * @min 0
136
- * @max 360
137
- */
138
- value: number;
139
- } | {
140
- /**
141
- * Modulates the input colour's hue by the given percentage. A 50% hue modulate decreases the
142
- * angular hue value by half. A 200% hue modulate doubles the angular hue value.
143
- */
144
- type: 'hueMod';
145
- /**
146
- * Positive percentage.
147
- * @min 0
148
- */
149
- value: number;
150
- } | {
151
- /**
152
- * Produces the input colour with its hue shifted, but with its saturation and luminance
153
- * unchanged.
154
- */
155
- type: 'hueOff';
156
- /** Degrees. */
157
- value: number;
158
- } | {
159
- /**
160
- * Alters the input colour so it has the specified saturation, but with its hue and luminance
161
- * unchanged.
162
- */
163
- type: 'sat';
164
- /** Unbounded percentage. */
165
- value: number;
166
- } | {
167
- /**
168
- * Modulates the input colour's saturation by the given percentage.
169
- *
170
- * A 50% saturation modulate reduces the saturation by half. A 200% saturation modulate doubles
171
- * the saturation.
172
- */
173
- type: 'satMod';
174
- /** Unbounded percentage. */
175
- value: number;
176
- } | {
177
- /**
178
- * Produces the input colour with its saturation shifted, but with its hue and luminance
179
- * unchanged. A 10% offset to 20% saturation yields 30% saturation.
180
- */
181
- type: 'satOff';
182
- /** Unbounded percentage. */
183
- value: number;
184
- } | {
185
- /**
186
- * Alters the input colour so it has the specified luminance, but with its hue and saturation
187
- * unchanged.
188
- */
189
- type: 'lum';
190
- /** Unbounded percentage. */
191
- value: number;
192
- } | {
193
- /**
194
- * Alters the input colour's luminance modulated by the given percentage.
195
- *
196
- * A 50% luminance modulate reduces the luminance by half. A 200% luminance modulate doubles the
197
- * luminance.
198
- */
199
- type: 'lumMod';
200
- /** Unbounded percentage. */
201
- value: number;
202
- } | {
203
- /**
204
- * Produces the input colour with its luminance shifted, but with its hue and saturation
205
- * unchanged.
206
- */
207
- type: 'lumOff';
208
- /** Unbounded percentage. */
209
- value: number;
210
- } | {
211
- /**
212
- * Produces the input colour with the specified red component. The green and blue colour
213
- * components unchanged.
214
- */
215
- type: 'red';
216
- /** Unbounded percentage. */
217
- value: number;
218
- } | {
219
- /**
220
- * Alters the input colour so its red component is modulated by the given percentage. A 50% red
221
- * modulate reduces the red component by half. A 200% red modulate doubles the red component.
222
- */
223
- type: 'redMod';
224
- /** Unbounded percentage. */
225
- value: number;
226
- } | {
227
- /**
228
- * Alters the input colour so its red component is shifted. Its green and blue colour components
229
- * unchanged.
230
- */
231
- type: 'redOff';
232
- /** Unbounded percentage. */
233
- value: number;
234
- } | {
235
- /**
236
- * Provides the input colour with the specified green component. Its red and blue colour
237
- * components unchanged.
238
- */
239
- type: 'green';
240
- /** Unbounded percentage. */
241
- value: number;
242
- } | {
243
- /**
244
- * Modulates the input colour's green component by the given percentage.
245
- *
246
- * A 50% green modulate reduces the green component by half. A 200% green modulate doubles the
247
- * green component.
248
- */
249
- type: 'greenMod';
250
- /** Unbounded percentage. */
251
- value: number;
252
- } | {
253
- /**
254
- * Alters the input colour so its green component is shifted. Its red and blue colour components
255
- * unchanged.
256
- */
257
- type: 'greenOff';
258
- /** Unbounded percentage. */
259
- value: number;
260
- } | {
261
- /**
262
- * Provides the input colour with the specified blue component. Its red and green colour
263
- * components unchanged.
264
- */
265
- type: 'blue';
266
- /** Unbounded percentage. */
267
- value: number;
268
- } | {
269
- /**
270
- * Modulates the input colour's blue component by the given percentage.
271
- *
272
- * A 50% blue modulate reduces the blue component by half. A 200% blue modulate doubles the blue
273
- * component.
274
- */
275
- type: 'blueMod';
276
- /** Unbounded percentage. */
277
- value: number;
278
- } | {
279
- /**
280
- * Alters the input colour so its blue component is shifted, but with its red and green colour
281
- * components unchanged.
282
- */
283
- type: 'blueOff';
284
- /** Unbounded percentage. */
285
- value: number;
286
- } | {
287
- /**
288
- * Specifies that the colour rendered should be the complement of the input colour with the
289
- * complement being defined as such.
290
- */
291
- type: 'comp';
292
- } | {
293
- /**
294
- * Specifies the inverse of the input colour. For example, the inverse of red (1, 0, 0) is cyan
295
- * (0, 1, 1 ).
296
- */
297
- type: 'inv';
298
- } | {
299
- /**
300
- * Specifies a grey scale of the input colour, taking into relative intensities of the red,
301
- * green, and blue primaries.
302
- */
303
- type: 'gray';
304
- } | {
305
- /**
306
- * Specifies that the output colour rendered by the generating application should be the sRGB
307
- * gamma shift of the input colour.
308
- */
309
- type: 'gamma';
310
- } | {
311
- /**
312
- * Specifies that the output colour rendered by the generating application should be the inverse
313
- * sRGB gamma shift of the input colour.
314
- */
315
- type: 'invGamma';
316
- };
317
- /**
318
- * Hue / saturation / lightness.
319
- *
320
- * Hue, saturation and lightness follow CSS Color Level 4 conventions, but using the range (0-100)
321
- * rather than (0-1).
322
- *
323
- * @group Colors
324
- */
325
- type HslColor = {
326
- type: 'hsl';
327
- /**
328
- * Degrees (0-360). Must be positive.
329
- * @min 0
330
- * @max 360
331
- */
332
- hue: number;
333
- /** Percentage. */
334
- saturation: number;
335
- /** Percentage. */
336
- lightness: number;
337
- };
338
- /**
339
- * A legacy colour indexing scheme, still occasionally required for backwards compatibility.
340
- *
341
- * An enumerated set of RGB colours values that correspond to a zero-based index.
342
- *
343
- * The table below lists the mapping from indexed colour value to RGB value. Note that indexes 8-15
344
- * are copies of indexes 0-7. All colours are fully opaque.
345
- *
346
- * | Index | RGB hex colour |
347
- * |------:|------------------:|
348
- * | 0 | #000000 |
349
- * | 1 | #FFFFFF |
350
- * | 2 | #FF0000 |
351
- * | 3 | #00FF00 |
352
- * | 4 | #0000FF |
353
- * | 5 | #FFFF00 |
354
- * | 6 | #FF00FF |
355
- * | 7 | #00FFFF |
356
- * | 8 | #000000 |
357
- * | 9 | #FFFFFF |
358
- * | 10 | #FF0000 |
359
- * | 11 | #00FF00 |
360
- * | 12 | #0000FF |
361
- * | 13 | #FFFF00 |
362
- * | 14 | #FF00FF |
363
- * | 15 | #00FFFF |
364
- * | 16 | #800000 |
365
- * | 17 | #008000 |
366
- * | 18 | #000080 |
367
- * | 19 | #808000 |
368
- * | 20 | #800080 |
369
- * | 21 | #008080 |
370
- * | 22 | #C0C0C0 |
371
- * | 23 | #808080 |
372
- * | 24 | #9999FF |
373
- * | 25 | #993366 |
374
- * | 26 | #FFFFCC |
375
- * | 27 | #CCFFFF |
376
- * | 28 | #660066 |
377
- * | 29 | #FF8080 |
378
- * | 30 | #0066CC |
379
- * | 31 | #CCCCFF |
380
- * | 32 | #000080 |
381
- * | 33 | #FF00FF |
382
- * | 34 | #FFFF00 |
383
- * | 35 | #00FFFF |
384
- * | 36 | #800080 |
385
- * | 37 | #800000 |
386
- * | 38 | #008080 |
387
- * | 39 | #0000FF |
388
- * | 40 | #00CCFF |
389
- * | 41 | #CCFFFF |
390
- * | 42 | #CCFFCC |
391
- * | 43 | #FFFF99 |
392
- * | 44 | #99CCFF |
393
- * | 45 | #FF99CC |
394
- * | 46 | #CC99FF |
395
- * | 47 | #FFCC99 |
396
- * | 48 | #3366FF |
397
- * | 49 | #33CCCC |
398
- * | 50 | #99CC00 |
399
- * | 51 | #FFCC00 |
400
- * | 52 | #FF9900 |
401
- * | 53 | #FF6600 |
402
- * | 54 | #666699 |
403
- * | 55 | #969696 |
404
- * | 56 | #003366 |
405
- * | 57 | #339966 |
406
- * | 58 | #003300 |
407
- * | 59 | #333300 |
408
- * | 60 | #993300 |
409
- * | 61 | #993366 |
410
- * | 62 | #333399 |
411
- * | 63 | #333333 |
412
- * | 64 | System foreground |
413
- * | 65 | System background |
414
- *
415
- * @group Colors
416
- */
417
- type IndexedColor = {
418
- type: 'indexed';
419
- value: number;
420
- };
421
- /**
422
- * A named colour from a predefined collection of colours.
423
- *
424
- * The preset colours are analogous to the extended colour keywords from CSS Colors Level 3,
425
- * but using camel casing and abbreviated forms (e.g. `dkMagenta` vs `darkmagenta`).
426
- *
427
- * @group Colors
428
- */
429
- type PresetColor = {
430
- type: 'preset';
431
- /** Preset name, e.g. "aliceBlue", "coral". */
432
- value: 'aliceBlue' | 'antiqueWhite' | 'aqua' | 'aquamarine' | 'azure' | 'beige' | 'bisque' | 'black' | 'blanchedAlmond' | 'blue' | 'blueViolet' | 'brown' | 'burlyWood' | 'cadetBlue' | 'chartreuse' | 'chocolate' | 'coral' | 'cornflowerBlue' | 'cornsilk' | 'crimson' | 'cyan' | 'dkBlue' | 'dkCyan' | 'dkGoldenrod' | 'dkGray' | 'dkGreen' | 'dkKhaki' | 'dkMagenta' | 'dkOliveGreen' | 'dkOrange' | 'dkOrchid' | 'dkRed' | 'dkSalmon' | 'dkSeaGreen' | 'dkSlateBlue' | 'dkSlateGray' | 'dkTurquoise' | 'dkViolet' | 'deepPink' | 'deepSkyBlue' | 'dimGray' | 'dodgerBlue' | 'firebrick' | 'floralWhite' | 'forestGreen' | 'fuchsia' | 'gainsboro' | 'ghostWhite' | 'gold' | 'goldenrod' | 'gray' | 'green' | 'greenYellow' | 'honeydew' | 'hotPink' | 'indianRed' | 'indigo' | 'ivory' | 'khaki' | 'lavender' | 'lavenderBlush' | 'lawnGreen' | 'lemonChiffon' | 'ltBlue' | 'ltCoral' | 'ltCyan' | 'ltGoldenrodYellow' | 'ltGray' | 'ltGreen' | 'ltPink' | 'ltSalmon' | 'ltSeaGreen' | 'ltSkyBlue' | 'ltSlateGray' | 'ltSteelBlue' | 'ltYellow' | 'lime' | 'limeGreen' | 'linen' | 'magenta' | 'maroon' | 'medAquamarine' | 'medBlue' | 'medOrchid' | 'medPurple' | 'medSeaGreen' | 'medSlateBlue' | 'medSpringGreen' | 'medTurquoise' | 'medVioletRed' | 'midnightBlue' | 'mintCream' | 'mistyRose' | 'moccasin' | 'navajoWhite' | 'navy' | 'oldLace' | 'olive' | 'oliveDrab' | 'orange' | 'orangeRed' | 'orchid' | 'paleGoldenrod' | 'paleGreen' | 'paleTurquoise' | 'paleVioletRed' | 'papayaWhip' | 'peachPuff' | 'peru' | 'pink' | 'plum' | 'powderBlue' | 'purple' | 'red' | 'rosyBrown' | 'royalBlue' | 'saddleBrown' | 'salmon' | 'sandyBrown' | 'seaGreen' | 'seaShell' | 'sienna' | 'silver' | 'skyBlue' | 'slateBlue' | 'slateGray' | 'snow' | 'springGreen' | 'steelBlue' | 'tan' | 'teal' | 'thistle' | 'tomato' | 'turquoise' | 'violet' | 'wheat' | 'white' | 'whiteSmoke' | 'yellow' | 'yellowGreen';
433
- };
434
- /**
435
- * A colour in Microsoft's scRGB colour space.
436
- *
437
- * Equivalent to CSS `srgb-linear` colour space.
438
- *
439
- * @group Colors
440
- */
441
- type ScRgbColor = {
442
- type: 'scrgb';
443
- /** Red value as a percentage. Can be outside the range 0-100. */
444
- red: number;
445
- /** Green value as a percentage. Can be outside the range 0-100. */
446
- green: number;
447
- /** Blue value as a percentage. Can be outside the range 0-100. */
448
- blue: number;
449
- };
450
- /**
451
- * Standard sRGB colour space.
452
- *
453
- * @group Colors
454
- */
455
- type SrgbColor = {
456
- type: 'srgb';
457
- /**
458
- * CSS-style hex, e.g. `FF0000`. Always six digits, always uppercase. No alpha channel.
459
- * @pattern ^[A-F0-9]{6}$
460
- */
461
- value: string;
462
- };
463
- /**
464
- * OS-defined system colour (e.g. window text, highlight).
465
- *
466
- * The value must be one of the pre-defined values. The colour matching each of these values should
467
- * match the closest analogous colour in the OS in use.
468
- *
469
- * @group Colors
470
- */
471
- type SystemColor = {
472
- type: 'system';
473
- /** System colour name. */
474
- value: 'scrollBar' | 'background' | 'activeCaption' | 'inactiveCaption' | 'menu' | 'window' | 'windowFrame' | 'menuText' | 'windowText' | 'captionText' | 'activeBorder' | 'inactiveBorder' | 'appWorkspace' | 'highlight' | 'highlightText' | 'btnFace' | 'btnShadow' | 'grayText' | 'btnText' | 'inactiveCaptionText' | 'btnHighlight' | '3dDkShadow' | '3dLight' | 'infoText' | 'infoBk' | 'hotLight' | 'gradientActiveCaption' | 'gradientInactiveCaption' | 'menuHighlight' | 'menuBar';
475
- };
476
- /** Reference to a theme colour. */
477
- /**
478
- * Reference to a theme colour.
479
- *
480
- * A theme colour is defined in the workbook's theme. Theme colours are used to ensure a consistent
481
- * palette across a workbook.
482
- *
483
- * @group Colors
484
- */
485
- type SchemeColor = {
486
- type: 'theme';
487
- /**
488
- * Theme colour name.
489
- *
490
- * Must be one of a limited set of values. The actual colour that matches the name is defined
491
- * elsewhere in the theme.
492
- */
493
- value: 'bg1' | 'tx1' | 'bg2' | 'tx2' | 'accent1' | 'accent2' | 'accent3' | 'accent4' | 'accent5' | 'accent6' | 'hlink' | 'folHlink' | 'phClr' | 'dk1' | 'lt1' | 'dk2' | 'lt2';
494
- };
495
- /**
496
- * A colour, which can be used is various parts of a workbook. The base colour can be transformed
497
- * using a list of colour transformations.
498
- *
499
- * The base colour must be defined using one of the following colour models:
500
- *
501
- * - {@link SrgbColor}: Standard sRGB colour space, defined by a CSS-style hex string (e.g.
502
- * `FF0000`).
503
- * - {@link ScRgbColor}: A colour in Microsoft's scRGB colour space, defined by red, green, and blue
504
- * values as percentages.
505
- * - {@link HslColor}: A colour in HSL colour space, defined by hue, saturation, and lightness
506
- * values.
507
- * - {@link SystemColor}: An OS-defined system colour (e.g. window text, highlight), defined using
508
- * one of an enumerated set of values.
509
- * - {@link SchemeColor}: A reference to a theme colour.
510
- * - {@link PresetColor}: A preset colour, similar to CSS's defined colours.
511
- * - {@link AutoColor}: Colour choice left to the application.
512
- * - {@link IndexedColor}: A legacy colour indexing scheme.
513
- *
514
- * @group Colors
515
- */
516
- type Color = (SrgbColor | ScRgbColor | HslColor | SystemColor | SchemeColor | PresetColor | AutoColor | IndexedColor) & {
517
- /**
518
- * Optional list of colour transformations to apply to the base colour.
519
- *
520
- * The transformations must be applied in order, and each transformation must be applied to the
521
- * result of the previous one. There can be multiple transformations of the same type.
522
- *
523
- * The transformations are defined by {@link ColorTransform}, which includes operations such as
524
- * tinting, shading, and saturation adjustments.
525
- */
526
- transforms?: ColorTransform[];
527
- };
528
- /**
529
- * The style to use when drawing a cell border. If the worksheet's zoom factor is changed the width
530
- * of the border is expected to stay the same.
531
- *
532
- * @group Workbooks
533
- */
534
- type BorderStyle =
535
- /** No border is drawn.*/
536
- 'none' |
537
- /** Equivalent to SVG `stroke-dasharray="4 1 2 1"`, at a 1px width.*/
538
- 'dashDot' |
539
- /** Equivalent to SVG `stroke-dasharray="4 1 2 1 2 1"`, at a 1px width.*/
540
- 'dashDotDot' |
541
- /** Equivalent to SVG `stroke-dasharray=""3 1`, at a 1px width.*/
542
- 'dashed' |
543
- /** Equivalent to SVG `stroke-dasharray="1"`, at a 1px width.*/
544
- 'dotted' |
545
- /** Draw two 1px wide continuous parallel lines with a 1px gap between them.*/
546
- 'double' |
547
- /** Draw a 1px wide pixel continuous hairline.*/
548
- 'hair' |
549
- /** Draw a 2px wide pixel continuous line.*/
550
- 'medium' |
551
- /** Equivalent to SVG `stroke-dasharray="4 1 2 1"`, at a 2px width.*/
552
- 'mediumDashDot' |
553
- /** Equivalent to SVG `stroke-dasharray="4 1 2 1 2 1"`, at a 2px width.*/
554
- 'mediumDashDotDot' |
555
- /** Equivalent to SVG `stroke-dasharray=""3 1`, at a 2px width.*/
556
- 'mediumDashed' |
557
- /**
558
- * Draw two 1px parallel dashed lines where the lower/left line 1px "behind" the other, creating
559
- * a slant.
560
- */
561
- 'slantDashDot' |
562
- /** Draw a 3px wide pixel continuous line.*/
563
- 'thick' |
564
- /** Draw a 1px wide pixel continuous line.*/
565
- 'thin';
566
- /**
567
- * Specifies the horizontal alignment of content (text) within a container (cell).
568
- *
569
- * @group Workbooks
570
- */
571
- type HAlign =
572
- /**
573
- * The horizontal alignment is general-aligned. Text data is left-aligned. Numbers, dates, and
574
- * times are right- aligned. Boolean types are centered.
575
- */
576
- 'general' |
577
- /** Aligns content at the left edge of the cell (even in RTL mode). */
578
- 'left' |
579
- /** The horizontal alignment is centered, meaning the text is centered across the cell. */
580
- 'center' |
581
- /** Aligns content at the right edge of the cell (even in RTL mode). */
582
- 'right' |
583
- /**
584
- * Indicates that the value of the cell should be filled across the entire width of the cell. If
585
- * blank cells to the right also have the fill alignment, they are also filled with the value,
586
- * using a convention similar to `centerContinuous`.
587
- */
588
- 'fill' |
589
- /**
590
- * For each line of text, aligns each line of the wrapped text in a cell to the right and left
591
- * (except the last line).
592
- */
593
- 'justify' |
594
- /** The horizontal alignment is centered across multiple cells. */
595
- 'centerContinuous' |
596
- /**
597
- * Indicates that each 'word' in each line of text inside the cell is evenly distributed across
598
- * the width of the cell, with flush right and left margins.
599
- */
600
- 'distributed';
601
- /**
602
- * The style of fill pattern used for a cell background. If the worksheets zoom factor is changed
603
- * the pixel scale of the pattern is still expected to stay the same.
604
- *
605
- * @group Workbooks
606
- */
607
- type PatternStyle = 'none' | 'solid' | 'mediumGray' | 'darkGray' | 'lightGray' | 'darkHorizontal' | 'darkVertical' | 'darkDown' | 'darkUp' | 'darkGrid' | 'darkTrellis' | 'lightHorizontal' | 'lightVertical' | 'lightDown' | 'lightUp' | 'lightGrid' | 'lightTrellis' | 'gray125' | 'gray0625';
608
- /**
609
- * Which type of underline to use when rendering text.
610
- *
611
- * @group Workbooks
612
- */
613
- type Underline = 'none' | 'single' | 'singleAccounting' | 'double' | 'doubleAccounting';
614
- /**
615
- * Vertical alignment of a cell content.
616
- *
617
- * @group Workbooks
618
- */
619
- type VAlign = 'bottom' | 'top' | 'center' | 'justify' | 'distributed';
620
- /**
621
- * Style rules that specify the visual presentation of a cell.
622
- *
623
- * @group Workbooks
624
- */
625
- type Style = {
626
- /**
627
- * The name of the font family used to render text, e.g. `"Arial"`.
628
- *
629
- * @default "Calibri"
630
- */
631
- fontFamily?: string;
632
- /**
633
- * Identifies the font scheme, if any, to which this style's font belongs.
634
- *
635
- * When set, the {@link Style.fontFamily} property is ignored and the font is instead resolved by
636
- * the workbook theme. `"major"` maps to the theme's heading font and `"minor"` to the body font.
637
- * The actual typeface is determined by the theme's {@link ThemeFontCollection} at render time.
638
- *
639
- * When the theme changes, an application is expected to update the fonts associated with a scheme
640
- * automatically.
641
- *
642
- * It is an error to set this when a workbook has no theme.
643
- *
644
- * @see {@link Workbook.theme}
645
- * @see {@link Theme.fontScheme}
646
- * @see {@link ThemeFontScheme}
647
- * @see {@link ThemeFontCollection}
648
- */
649
- fontScheme?: 'major' | 'minor';
650
- /**
651
- * The font size in pixels.
652
- *
653
- * @default 11
654
- */
655
- fontSize?: PixelValue;
656
- /**
657
- * The color used to render text.
658
- *
659
- * @default "#000"
660
- */
661
- color?: Color;
662
- /**
663
- * Indicates whether the text is bold.
664
- *
665
- * @default false
666
- */
667
- bold?: boolean;
668
- /**
669
- * Indicates whether the text is italic.
670
- *
671
- * @default false
672
- */
673
- italic?: boolean;
674
- /**
675
- * Text underline decoration type.
676
- *
677
- * @default "none"
678
- */
679
- underline?: Underline;
680
- /**
681
- * The cell's background color.
682
- *
683
- * @default "#FFFFFF"
684
- */
685
- fillColor?: Color;
686
- /**
687
- * The color of a cell's background fill.
688
- *
689
- * @default "#000000"
690
- */
691
- patternColor?: Color;
692
- /**
693
- * The style of a cell's background fill.
694
- *
695
- * @default "none"
696
- */
697
- patternStyle?: PatternStyle;
698
- /**
699
- * Top border style.
700
- *
701
- * @default "none"
702
- */
703
- borderTopStyle?: BorderStyle;
704
- /**
705
- * Top border color.
706
- */
707
- borderTopColor?: Color;
708
- /**
709
- * Left border style.
710
- *
711
- * @default "none"
712
- */
713
- borderLeftStyle?: BorderStyle;
714
- /**
715
- * Left border color.
716
- */
717
- borderLeftColor?: Color;
718
- /**
719
- * Bottom border style.
720
- *
721
- * @default "none"
722
- */
723
- borderBottomStyle?: BorderStyle;
724
- /**
725
- * Bottom border color.
726
- */
727
- borderBottomColor?: Color;
728
- /**
729
- * Right border style.
730
- *
731
- * @default "none"
732
- */
733
- borderRightStyle?: BorderStyle;
734
- /**
735
- * Right border color.
736
- */
737
- borderRightColor?: Color;
738
- /**
739
- * Horizontal alignment of the cells [text] content.
740
- *
741
- * @default "general"
742
- */
743
- horizontalAlignment?: HAlign;
744
- /**
745
- * Vertical alignment of the cells [text] content.
746
- *
747
- * @default "bottom"
748
- */
749
- verticalAlignment?: VAlign;
750
- /**
751
- * Indicates whether text should be wrapped when it exceeds the cell's width.
752
- *
753
- * @default false
754
- */
755
- wrapText?: boolean;
756
- /**
757
- * Indicates whether the font-size should be automatically reduced in order to make the contents
758
- * of the cell visible.
759
- */
760
- shrinkToFit?: boolean;
761
- /**
762
- * The degrees to which the cell text should be rotated. Values range from 0 to 180, and 255 to
763
- * indicate vertical text. The origin of the rotation is the first letter of the text.
764
- *
765
- * @min 0
766
- * @max 255
767
- * @defaultValue 0
768
- */
769
- textRotation?: integer;
770
- /**
771
- * Formatting directions for rendering the cell's value to text.
772
- */
773
- numberFormat?: string;
774
- /**
775
- * Name of the named style this style inherits from (e.g. "Percent", "Heading 1").
776
- * Refers to a key in {@link Workbook.namedStyles}.
777
- * When absent, the style inherits from the default style (typically "Normal").
778
- */
779
- extendsStyle?: string;
780
- /**
781
- * Whether the a cell should appear as a pivot-table button header (typically shown with a
782
- * dropdown-arrow filter UI, e.g. on "Row Labels" / "Column Labels").
783
- *
784
- * Should be set only on cell styles used in a pivot table's layout.
785
- */
786
- pivotButton?: boolean;
787
- };
788
- //#endregion
789
- //#region node_modules/@grid-is/grid-prompt-tools/dist/index.d.ts
790
- //#endregion
791
- //#region src/load_mismatches.d.ts
792
- /**
793
- * The flavour of cell value carried in load-mismatch entries.
794
- *
795
- * Sheet cells in Apiary always materialise to plain CellValue (number,
796
- * string, boolean, FormulaError, or null) — never Matrix/Reference/Lambda.
797
- * Both cached and computed sides of a mismatch are therefore CellValue.
798
- */
799
- type CellValue$1 = CellValue;
800
- interface MismatchEntry {
801
- readonly sheetName: string;
802
- readonly a1: string;
803
- readonly cachedValue: CellValue$1;
804
- readonly calculatedValue: CellValue$1;
805
- readonly source: "formula" | "spill";
806
- }
807
- declare class LoadMismatches {
808
- private readonly _entries;
809
- constructor(entries?: Map<string, MismatchEntry>);
810
- get count(): number;
811
- /** Lookup by sheet-qualified A1; returns the entry or undefined. */
812
- get(sheetName: string, a1: string): MismatchEntry | undefined;
813
- [Symbol.iterator](): IterableIterator<MismatchEntry>;
814
- }
815
- //#endregion
816
- //#region src/tools/types.d.ts
817
- type ToolError = {
818
- error: string;
819
- };
820
- /**
821
- * Per-call context passed to tool implementations. Carries the model under
822
- * test plus any per-call data the tool may want (load-time mismatches today,
823
- * potentially more later).
824
- */
825
- interface ToolContext {
826
- readonly model: Model;
827
- readonly mismatches?: LoadMismatches;
828
- }
829
- declare function isToolError(value: unknown): value is ToolError;
830
- declare class SpreadsheetTool<TParams extends z.ZodType = z.ZodType, TResult = unknown> {
831
- readonly name: string;
832
- readonly description: string;
833
- readonly parameters: TParams;
834
- private _run;
835
- constructor(options: {
836
- name: string;
837
- description: string;
838
- parameters: TParams;
839
- run: (ctx: ToolContext, input: z.infer<TParams>) => TResult;
840
- });
841
- execute(ctx: ToolContext, input: z.infer<TParams>): TResult | ToolError;
842
- }
843
- //#endregion
844
- //#region src/tools/describe_structure.d.ts
845
- type SheetStructure = {
846
- name: string;
847
- cellCount: number;
848
- formulaCount: number;
849
- errorCount?: number;
850
- errorSample?: Array<{
851
- key: string;
852
- count: number;
853
- cells: string[];
854
- }>;
855
- labels: string[];
856
- totalLabels?: number;
857
- };
858
- type DescribeStructureResult = {
859
- sheets: SheetStructure[];
860
- totalErrors?: number;
861
- summary: string;
862
- };
863
- declare const describeStructure: SpreadsheetTool<z.ZodObject<{
864
- sheets: z.ZodOptional<z.ZodArray<z.ZodString>>;
865
- labelOffset: z.ZodOptional<z.ZodNumber>;
866
- }, z.core.$strip>, DescribeStructureResult | ToolError>;
867
- //#endregion
868
- //#region src/tools/utils/read_cells.d.ts
869
- /**
870
- * Cell information with optional A1 reference.
871
- * When returned as a dict, ref is omitted (it's the key).
872
- * When returned as a single cell, ref is included.
873
- */
874
- type CellInfo = {
875
- /** Cell value */ v?: string | number | boolean; /** Formula string as stored by Apiary */
876
- f?: string; /** Cell type: 'z'=blank, 'b'=boolean, 'n'=number, 's'=string, 'e'=error */
877
- t?: "z" | "b" | "n" | "s" | "e"; /** A1 address of the cell (e.g., "A1", "B10"). Omitted when returned in a dict. */
878
- ref?: string; /** Number format string (omitted if default/general) */
879
- num_format?: string; /** Index into workbook.styles array (omitted if cell has no style) */
880
- style_index?: number; /** Formatted display value (only present when num_format is set) */
881
- formatted?: string; /** Full style object (bold, italic, numberFormat, etc.) */
882
- style?: Style | null; /** Hyperlink URL */
883
- href?: string | null; /** For anchor cells: the full merged range (e.g., "A1:B2") */
884
- mergedRange?: string; /** For non-anchor cells in a merge: the anchor cell to write to instead */
885
- mergedInto?: string; /** Full FormulaError metadata. Present only when t === "e". */
886
- error?: {
887
- /** Error name, e.g. "#DIV/0!", "#NAME?", "#REF!". Same value as the stringified v. */ name: string; /** Integer error code from Apiary's FormulaError. */
888
- code: number; /** Optional detail message, e.g. "function name not found". Present only if FormulaError.detail is set. */
889
- detail?: string; /** Sheet-qualified reference of the cell where the error originated. Present only if FormulaError.origin is set. Compare to the inspected cell's own ref to tell whether the error originated here or propagated from elsewhere. */
890
- origin?: string;
891
- };
892
- /**
893
- * Load-time mismatch warning. Present when the JSF cache disagrees with
894
- * Apiary's recalculated value for this cell. `cachedValue` is what the
895
- * source workbook (e.g. Excel) wrote into the JSF; `calculatedValue` is
896
- * what Apiary computed. See `LoadMismatches` for details.
897
- */
898
- mismatch?: {
899
- note: string;
900
- cachedValue: string | number | boolean | null | FormulaError;
901
- calculatedValue: string | number | boolean | null | FormulaError;
902
- };
903
- };
904
- /** Multi-cell read result: dict of cells with optional metadata */
905
- type MultiCellResult = Record<string, CellInfo> & {
906
- _note?: string;
907
- };
908
- //#endregion
909
- //#region src/tools/utils/slice_range.d.ts
910
- interface TruncatedPage {
911
- data: MultiCellResult;
912
- truncated: true;
913
- totalCells: number;
914
- returnedCells: number;
915
- offset: number;
916
- nextOffset: number;
917
- reference: string;
918
- }
919
- type PaginatedReadResult = CellInfo | MultiCellResult | TruncatedPage;
920
- //#endregion
921
- //#region src/tools/read_calculated_values.d.ts
922
- type ExpressionResult = CellInfo | MultiCellResult | TruncatedPage | {
923
- error: string;
924
- };
925
- type ReadCalculatedValuesResult = Record<string, ExpressionResult>;
926
- declare const readCalculatedValues: SpreadsheetTool<z.ZodObject<{
927
- read: z.ZodArray<z.ZodString>;
928
- apply: z.ZodOptional<z.ZodArray<z.ZodObject<{
929
- cell: z.ZodString;
930
- value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
931
- }, z.core.$strip>>>;
932
- cursors: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
933
- }, z.core.$strip>, ToolError | ReadCalculatedValuesResult>;
934
- //#endregion
935
- //#region src/tools/run_formula.d.ts
936
- type RunFormulaResult = Record<string, unknown> & {
937
- _note?: string;
938
- };
939
- declare const runFormula: SpreadsheetTool<z.ZodObject<{
940
- apply: z.ZodOptional<z.ZodArray<z.ZodObject<{
941
- cell: z.ZodString;
942
- value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
943
- }, z.core.$strip>>>;
944
- formula: z.ZodOptional<z.ZodString>;
945
- formulas: z.ZodOptional<z.ZodArray<z.ZodString>>;
946
- sheet: z.ZodOptional<z.ZodString>;
947
- }, z.core.$strip>, ToolError | RunFormulaResult>;
948
- //#endregion
949
- //#region src/tools/edit_cells.d.ts
950
- interface TypeChangeWarning {
951
- level: "high" | "low";
952
- note: string;
953
- }
954
- type EditCellsResult = {
955
- success: true;
956
- cellsModified: number;
957
- changedCells: string[];
958
- merged?: string[];
959
- unmerged?: string[];
960
- errors?: Record<string, string>;
961
- mergeErrors?: Record<string, string>;
962
- cell_errors?: Record<string, string[]>;
963
- warnings?: Record<string, TypeChangeWarning>;
964
- };
965
- declare const editCells: SpreadsheetTool<z.ZodObject<{
966
- apply: z.ZodArray<z.ZodObject<{
967
- target: z.ZodString;
968
- value: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
969
- styleIndex: z.ZodOptional<z.ZodNumber>;
970
- }, z.core.$strip>>;
971
- styles: z.ZodOptional<z.ZodArray<z.ZodObject<{
972
- bold: z.ZodOptional<z.ZodBoolean>;
973
- borderBottomColor: z.ZodOptional<z.ZodString>;
974
- borderBottomStyle: z.ZodOptional<z.ZodEnum<{
975
- none: "none";
976
- dashDot: "dashDot";
977
- dashDotDot: "dashDotDot";
978
- dashed: "dashed";
979
- dotted: "dotted";
980
- double: "double";
981
- hair: "hair";
982
- medium: "medium";
983
- mediumDashDot: "mediumDashDot";
984
- mediumDashDotDot: "mediumDashDotDot";
985
- mediumDashed: "mediumDashed";
986
- slantDashDot: "slantDashDot";
987
- thick: "thick";
988
- thin: "thin";
989
- }>>;
990
- borderLeftColor: z.ZodOptional<z.ZodString>;
991
- borderLeftStyle: z.ZodOptional<z.ZodEnum<{
992
- none: "none";
993
- dashDot: "dashDot";
994
- dashDotDot: "dashDotDot";
995
- dashed: "dashed";
996
- dotted: "dotted";
997
- double: "double";
998
- hair: "hair";
999
- medium: "medium";
1000
- mediumDashDot: "mediumDashDot";
1001
- mediumDashDotDot: "mediumDashDotDot";
1002
- mediumDashed: "mediumDashed";
1003
- slantDashDot: "slantDashDot";
1004
- thick: "thick";
1005
- thin: "thin";
1006
- }>>;
1007
- borderRightColor: z.ZodOptional<z.ZodString>;
1008
- borderRightStyle: z.ZodOptional<z.ZodEnum<{
1009
- none: "none";
1010
- dashDot: "dashDot";
1011
- dashDotDot: "dashDotDot";
1012
- dashed: "dashed";
1013
- dotted: "dotted";
1014
- double: "double";
1015
- hair: "hair";
1016
- medium: "medium";
1017
- mediumDashDot: "mediumDashDot";
1018
- mediumDashDotDot: "mediumDashDotDot";
1019
- mediumDashed: "mediumDashed";
1020
- slantDashDot: "slantDashDot";
1021
- thick: "thick";
1022
- thin: "thin";
1023
- }>>;
1024
- borderTopColor: z.ZodOptional<z.ZodString>;
1025
- borderTopStyle: z.ZodOptional<z.ZodEnum<{
1026
- none: "none";
1027
- dashDot: "dashDot";
1028
- dashDotDot: "dashDotDot";
1029
- dashed: "dashed";
1030
- dotted: "dotted";
1031
- double: "double";
1032
- hair: "hair";
1033
- medium: "medium";
1034
- mediumDashDot: "mediumDashDot";
1035
- mediumDashDotDot: "mediumDashDotDot";
1036
- mediumDashed: "mediumDashed";
1037
- slantDashDot: "slantDashDot";
1038
- thick: "thick";
1039
- thin: "thin";
1040
- }>>;
1041
- fillColor: z.ZodOptional<z.ZodString>;
1042
- fontColor: z.ZodOptional<z.ZodString>;
1043
- fontName: z.ZodOptional<z.ZodString>;
1044
- fontSize: z.ZodOptional<z.ZodNumber>;
1045
- horizontalAlignment: z.ZodOptional<z.ZodEnum<{
1046
- fill: "fill";
1047
- general: "general";
1048
- left: "left";
1049
- center: "center";
1050
- right: "right";
1051
- justify: "justify";
1052
- centerContinuous: "centerContinuous";
1053
- distributed: "distributed";
1054
- }>>;
1055
- italic: z.ZodOptional<z.ZodBoolean>;
1056
- numberFormat: z.ZodOptional<z.ZodString>;
1057
- numberFormatFromFormula: z.ZodOptional<z.ZodString>;
1058
- shrinkToFit: z.ZodOptional<z.ZodBoolean>;
1059
- underline: z.ZodOptional<z.ZodEnum<{
1060
- none: "none";
1061
- double: "double";
1062
- single: "single";
1063
- singleAccounting: "singleAccounting";
1064
- doubleAccounting: "doubleAccounting";
1065
- }>>;
1066
- verticalAlignment: z.ZodOptional<z.ZodEnum<{
1067
- center: "center";
1068
- justify: "justify";
1069
- distributed: "distributed";
1070
- bottom: "bottom";
1071
- top: "top";
1072
- }>>;
1073
- wrapText: z.ZodOptional<z.ZodBoolean>;
1074
- }, z.core.$strip>>>;
1075
- note: z.ZodOptional<z.ZodString>;
1076
- merge: z.ZodOptional<z.ZodArray<z.ZodString>>;
1077
- unmerge: z.ZodOptional<z.ZodArray<z.ZodString>>;
1078
- }, z.core.$strip>, ToolError | EditCellsResult>;
1079
- //#endregion
1080
- //#region src/tools/fill_cells.d.ts
1081
- type FillCellsResult = {
1082
- success: true;
1083
- filledRange: string;
1084
- changedCells: string[];
1085
- cell_errors?: Record<string, string[]>;
1086
- };
1087
- declare const fillCells: SpreadsheetTool<z.ZodObject<{
1088
- sheet: z.ZodString;
1089
- selection: z.ZodString;
1090
- extend_to: z.ZodString;
1091
- note: z.ZodOptional<z.ZodString>;
1092
- }, z.core.$strip>, ToolError | FillCellsResult>;
1093
- //#endregion
1094
- //#region src/tools/manage_sheets.d.ts
1095
- type ManageSheetsResult = {
1096
- success: true;
1097
- sheets: string[];
1098
- };
1099
- declare const manageSheets: SpreadsheetTool<z.ZodObject<{
1100
- add: z.ZodOptional<z.ZodObject<{
1101
- name: z.ZodString;
1102
- }, z.core.$strip>>;
1103
- remove: z.ZodOptional<z.ZodObject<{
1104
- sheet: z.ZodString;
1105
- }, z.core.$strip>>;
1106
- rename: z.ZodOptional<z.ZodObject<{
1107
- sheet: z.ZodString;
1108
- name: z.ZodString;
1109
- }, z.core.$strip>>;
1110
- setVisibility: z.ZodOptional<z.ZodObject<{
1111
- sheet: z.ZodString;
1112
- hidden: z.ZodEnum<{
1113
- visible: "visible";
1114
- hidden: "hidden";
1115
- veryHidden: "veryHidden";
1116
- }>;
1117
- }, z.core.$strip>>;
1118
- note: z.ZodOptional<z.ZodString>;
1119
- }, z.core.$strip>, ToolError | ManageSheetsResult>;
1120
- //#endregion
1121
- //#region src/tools/manage_rows_and_columns.d.ts
1122
- type ManageRowsAndColumnsResult = {
1123
- success: true;
1124
- changedCells: string[];
1125
- };
1126
- declare const manageRowsAndColumns: SpreadsheetTool<z.ZodObject<{
1127
- sheet: z.ZodString;
1128
- columns: z.ZodOptional<z.ZodObject<{
1129
- insert: z.ZodOptional<z.ZodObject<{
1130
- column: z.ZodString;
1131
- count: z.ZodNumber;
1132
- }, z.core.$strip>>;
1133
- delete: z.ZodOptional<z.ZodObject<{
1134
- column: z.ZodString;
1135
- count: z.ZodNumber;
1136
- }, z.core.$strip>>;
1137
- autoSize: z.ZodOptional<z.ZodArray<z.ZodString>>;
1138
- }, z.core.$strip>>;
1139
- rows: z.ZodOptional<z.ZodObject<{
1140
- insert: z.ZodOptional<z.ZodObject<{
1141
- row: z.ZodNumber;
1142
- count: z.ZodNumber;
1143
- }, z.core.$strip>>;
1144
- delete: z.ZodOptional<z.ZodObject<{
1145
- row: z.ZodNumber;
1146
- count: z.ZodNumber;
1147
- }, z.core.$strip>>;
1148
- autoSize: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
1149
- }, z.core.$strip>>;
1150
- note: z.ZodOptional<z.ZodString>;
1151
- }, z.core.$strip>, ToolError | ManageRowsAndColumnsResult>;
1152
- //#endregion
1153
- //#region src/tools/edit_cell_styles.d.ts
1154
- type EditCellStylesResult = {
1155
- success: true;
1156
- rangesStyled: number;
1157
- };
1158
- declare const editCellStyles: SpreadsheetTool<z.ZodObject<{
1159
- sheet: z.ZodString;
1160
- apply: z.ZodArray<z.ZodObject<{
1161
- target: z.ZodString;
1162
- styles: z.ZodObject<{
1163
- bold: z.ZodOptional<z.ZodBoolean>;
1164
- borderBottomColor: z.ZodOptional<z.ZodString>;
1165
- borderBottomStyle: z.ZodOptional<z.ZodEnum<{
1166
- none: "none";
1167
- dashDot: "dashDot";
1168
- dashDotDot: "dashDotDot";
1169
- dashed: "dashed";
1170
- dotted: "dotted";
1171
- double: "double";
1172
- hair: "hair";
1173
- medium: "medium";
1174
- mediumDashDot: "mediumDashDot";
1175
- mediumDashDotDot: "mediumDashDotDot";
1176
- mediumDashed: "mediumDashed";
1177
- slantDashDot: "slantDashDot";
1178
- thick: "thick";
1179
- thin: "thin";
1180
- }>>;
1181
- borderLeftColor: z.ZodOptional<z.ZodString>;
1182
- borderLeftStyle: z.ZodOptional<z.ZodEnum<{
1183
- none: "none";
1184
- dashDot: "dashDot";
1185
- dashDotDot: "dashDotDot";
1186
- dashed: "dashed";
1187
- dotted: "dotted";
1188
- double: "double";
1189
- hair: "hair";
1190
- medium: "medium";
1191
- mediumDashDot: "mediumDashDot";
1192
- mediumDashDotDot: "mediumDashDotDot";
1193
- mediumDashed: "mediumDashed";
1194
- slantDashDot: "slantDashDot";
1195
- thick: "thick";
1196
- thin: "thin";
1197
- }>>;
1198
- borderRightColor: z.ZodOptional<z.ZodString>;
1199
- borderRightStyle: z.ZodOptional<z.ZodEnum<{
1200
- none: "none";
1201
- dashDot: "dashDot";
1202
- dashDotDot: "dashDotDot";
1203
- dashed: "dashed";
1204
- dotted: "dotted";
1205
- double: "double";
1206
- hair: "hair";
1207
- medium: "medium";
1208
- mediumDashDot: "mediumDashDot";
1209
- mediumDashDotDot: "mediumDashDotDot";
1210
- mediumDashed: "mediumDashed";
1211
- slantDashDot: "slantDashDot";
1212
- thick: "thick";
1213
- thin: "thin";
1214
- }>>;
1215
- borderTopColor: z.ZodOptional<z.ZodString>;
1216
- borderTopStyle: z.ZodOptional<z.ZodEnum<{
1217
- none: "none";
1218
- dashDot: "dashDot";
1219
- dashDotDot: "dashDotDot";
1220
- dashed: "dashed";
1221
- dotted: "dotted";
1222
- double: "double";
1223
- hair: "hair";
1224
- medium: "medium";
1225
- mediumDashDot: "mediumDashDot";
1226
- mediumDashDotDot: "mediumDashDotDot";
1227
- mediumDashed: "mediumDashed";
1228
- slantDashDot: "slantDashDot";
1229
- thick: "thick";
1230
- thin: "thin";
1231
- }>>;
1232
- fillColor: z.ZodOptional<z.ZodString>;
1233
- fontColor: z.ZodOptional<z.ZodString>;
1234
- fontName: z.ZodOptional<z.ZodString>;
1235
- fontSize: z.ZodOptional<z.ZodNumber>;
1236
- horizontalAlignment: z.ZodOptional<z.ZodEnum<{
1237
- fill: "fill";
1238
- general: "general";
1239
- left: "left";
1240
- center: "center";
1241
- right: "right";
1242
- justify: "justify";
1243
- centerContinuous: "centerContinuous";
1244
- distributed: "distributed";
1245
- }>>;
1246
- italic: z.ZodOptional<z.ZodBoolean>;
1247
- numberFormat: z.ZodOptional<z.ZodString>;
1248
- numberFormatFromFormula: z.ZodOptional<z.ZodString>;
1249
- shrinkToFit: z.ZodOptional<z.ZodBoolean>;
1250
- underline: z.ZodOptional<z.ZodEnum<{
1251
- none: "none";
1252
- double: "double";
1253
- single: "single";
1254
- singleAccounting: "singleAccounting";
1255
- doubleAccounting: "doubleAccounting";
1256
- }>>;
1257
- verticalAlignment: z.ZodOptional<z.ZodEnum<{
1258
- center: "center";
1259
- justify: "justify";
1260
- distributed: "distributed";
1261
- bottom: "bottom";
1262
- top: "top";
1263
- }>>;
1264
- wrapText: z.ZodOptional<z.ZodBoolean>;
1265
- }, z.core.$strip>;
1266
- }, z.core.$strip>>;
1267
- note: z.ZodOptional<z.ZodString>;
1268
- }, z.core.$strip>, ToolError | EditCellStylesResult>;
1269
- //#endregion
1270
- //#region src/tools/get_styles.d.ts
1271
- type GetStylesResult = Record<number, unknown> | unknown[];
1272
- declare const getStyles: SpreadsheetTool<z.ZodObject<{
1273
- indices: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
1274
- }, z.core.$strip>, ToolError | GetStylesResult>;
1275
- //#endregion
1276
- //#region src/tools/goal_seek.d.ts
1277
- type GoalSeekResult = {
1278
- success: true;
1279
- goalSeek: {
1280
- targetCell: string;
1281
- targetValue: number;
1282
- controlCell: string;
1283
- solution: unknown;
1284
- };
1285
- };
1286
- declare const goalSeek: SpreadsheetTool<z.ZodObject<{
1287
- write: z.ZodArray<z.ZodObject<{
1288
- cell: z.ZodString;
1289
- value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
1290
- }, z.core.$strip>>;
1291
- goalSeek: z.ZodObject<{
1292
- targetCell: z.ZodString;
1293
- targetValue: z.ZodNumber;
1294
- controlCell: z.ZodString;
1295
- }, z.core.$strip>;
1296
- persist: z.ZodOptional<z.ZodBoolean>;
1297
- }, z.core.$strip>, ToolError | GoalSeekResult>;
1298
- //#endregion
1299
- //#region src/tools/intelligence/symbols.d.ts
1300
- type SymbolsResult = {
1301
- sheets: {
1302
- name: string;
1303
- size: [number, number];
1304
- }[];
1305
- namedRanges: {
1306
- name: string;
1307
- formula: string | null;
1308
- scope: string;
1309
- }[];
1310
- tables: {
1311
- name: string;
1312
- sheet: string;
1313
- ref: string;
1314
- headers: number;
1315
- totals: number;
1316
- }[];
1317
- stats: {
1318
- cells: number;
1319
- graphNodes: number;
1320
- graphEdges: number;
1321
- };
1322
- };
1323
- declare const symbols: SpreadsheetTool<z.ZodObject<{}, z.core.$strip>, ToolError | SymbolsResult>;
1324
- //#endregion
1325
- //#region src/tools/intelligence/what_if.d.ts
1326
- type WhatIfResult = {
1327
- applied: Record<string, string | number | boolean | null>;
1328
- affected: Record<string, {
1329
- before: string | number | boolean | null;
1330
- after: string | number | boolean | null;
1331
- formula: string | null;
1332
- }>;
1333
- truncated?: boolean;
1334
- totalAffected?: number;
1335
- };
1336
- declare const whatIf: SpreadsheetTool<z.ZodObject<{
1337
- changes: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
1338
- }, z.core.$strip>, ToolError | WhatIfResult>;
1339
- //#endregion
1340
- //#region src/tools/intelligence/chunked_graph_node.d.ts
1341
- type ChunkNode = WorkbookDescription["calculated"][number];
1342
- /**
1343
- * A node in a chunked dependency-graph traversal tree. Chunks represent groups
1344
- * of cells with structurally identical formulas, collapsed into labeled nodes.
1345
- *
1346
- * Nodes are keyed by their chunk reference in the parent's `precedents` /
1347
- * `dependents` dict (e.g. "Sheet1!C2:C10"), so there is no separate `ref`
1348
- * field — its key is its address.
1349
- */
1350
- type ChunkedGraphNode = {
1351
- type: ChunkNode["type"];
1352
- labels: string[];
1353
- formula: string | null;
1354
- rootHeight?: number;
1355
- leafDepth?: number;
1356
- precedents?: Record<string, ChunkedGraphNode>;
1357
- dependents?: Record<string, ChunkedGraphNode>;
1358
- alreadyVisited?: true;
1359
- truncated?: {
1360
- reason: "maxDepth" | "maxNodes";
1361
- totalChildren?: number;
1362
- };
1363
- };
1364
- /** Top-level result: a single-entry dict keyed by the root chunk's ref. */
1365
- type ChunkedGraphWalkResult = Record<string, ChunkedGraphNode>;
1366
- //#endregion
1367
- //#region src/tools/intelligence/graph_node.d.ts
1368
- /**
1369
- * A node in a dependency-graph traversal tree. The same shape is used for
1370
- * both the precedents tool (walks outgoing edges, populates `precedents`)
1371
- * and the dependents tool (walks incoming edges, populates `dependents`).
1372
- *
1373
- * Nodes are keyed by their cell/range/name reference in the parent's
1374
- * `precedents` / `dependents` dict, so there is no `ref` field on the node
1375
- * itself — its key is its address.
1376
- */
1377
- type GraphNode = {
1378
- kind: "cell" | "range" | "name";
1379
- formula: string | null;
1380
- value?: string | number | boolean | null;
1381
- errorValue?: string;
1382
- precedents?: Record<string, GraphNode>;
1383
- dependents?: Record<string, GraphNode>;
1384
- alreadyVisited?: true;
1385
- truncated?: {
1386
- reason: "maxDepth" | "maxNodes";
1387
- totalChildren?: number;
1388
- };
1389
- };
1390
- /** Top-level result: a single-entry dict keyed by the root node's ref. */
1391
- type GraphWalkResult = Record<string, GraphNode>;
1392
- //#endregion
1393
- //#region src/tools/intelligence/make_graph_tool.d.ts
1394
- type GraphToolResult = GraphWalkResult | ChunkedGraphWalkResult | ToolError;
1395
- //#endregion
1396
- //#region src/tools/list_errors.d.ts
1397
- type ListErrorsResult = {
1398
- formulaErrors: {
1399
- groups: Array<{
1400
- key: string;
1401
- count: number;
1402
- cells: string[];
1403
- omittedCells?: number;
1404
- }>;
1405
- totalCells: number;
1406
- perSheet: Record<string, number>;
1407
- };
1408
- modelErrors: {
1409
- entries: Array<{
1410
- type: string;
1411
- level: "ERROR" | "WARNING" | "NOTICE";
1412
- message: string;
1413
- references: string[];
1414
- }>;
1415
- total: number;
1416
- };
1417
- truncated?: {
1418
- groupsWithOmittedCells: number;
1419
- hint: string;
1420
- };
1421
- };
1422
- declare const listErrors: SpreadsheetTool<z.ZodObject<{
1423
- sheet: z.ZodOptional<z.ZodString>;
1424
- range: z.ZodOptional<z.ZodString>;
1425
- max: z.ZodOptional<z.ZodNumber>;
1426
- }, z.core.$strip>, ToolError | ListErrorsResult>;
1427
- //#endregion
1428
- //#region src/tools/find_cells.d.ts
1429
- type FindCellsMatch = {
1430
- /** Sheet-qualified A1 reference of the matching cell. */ ref: string; /** Cell value (stringified; omitted if blank). */
1431
- value?: string; /** Formula text (omitted for value cells). */
1432
- formula?: string; /** Human-readable fill color string (omitted if no fill). */
1433
- fillColor?: string;
1434
- };
1435
- type FindCellsResult = {
1436
- matches: FindCellsMatch[];
1437
- totalMatches: number;
1438
- truncated?: {
1439
- maxMatches: number;
1440
- hint: string;
1441
- };
1442
- };
1443
- declare const findCells: SpreadsheetTool<z.ZodObject<{
1444
- sheet: z.ZodOptional<z.ZodString>;
1445
- range: z.ZodOptional<z.ZodString>;
1446
- matchMode: z.ZodOptional<z.ZodEnum<{
1447
- AND: "AND";
1448
- OR: "OR";
1449
- }>>;
1450
- hasFormula: z.ZodOptional<z.ZodBoolean>;
1451
- fillColor: z.ZodOptional<z.ZodString>;
1452
- formulaContains: z.ZodOptional<z.ZodString>;
1453
- valueContains: z.ZodOptional<z.ZodString>;
1454
- valueWithin: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
1455
- }, z.core.$strip>, ToolError | FindCellsResult>;
1456
- //#endregion
1457
- //#region src/tools/capture_range.d.ts
1458
- declare const captureRange: SpreadsheetTool<z.ZodObject<{
1459
- reference: z.ZodString;
1460
- headers: z.ZodDefault<z.ZodBoolean>;
1461
- scale: z.ZodDefault<z.ZodNumber>;
1462
- }, z.core.$strip>, Promise<ToolError | Uint8Array<ArrayBufferLike>>>;
1463
- //#endregion
1464
- //#region src/tools/comments/helpers.d.ts
1465
- type CommentEntry = {
1466
- /** Sheet-qualified A1 address, e.g. `'LBO Model'!E46`. */ address: string; /** `thread` = modern threaded comment; `note` = legacy single-author note. */
1467
- kind: "thread" | "note";
1468
- author: string; /** ISO datetime if known (threaded comments only). */
1469
- datetime?: string; /** Number of replies on a thread; omitted for notes and unreplied threads. */
1470
- replyCount?: number;
1471
- resolved?: boolean; /** First `PREVIEW_CHARS` chars of the root text, whitespace-collapsed. */
1472
- preview: string;
1473
- truncated?: boolean;
1474
- };
1475
- type ThreadEntry = {
1476
- author: string;
1477
- datetime?: string;
1478
- text: string;
1479
- isReply: boolean;
1480
- };
1481
- //#endregion
1482
- //#region src/tools/comments/get_comment.d.ts
1483
- type GetCommentResult = {
1484
- address: string;
1485
- kind: "thread";
1486
- resolved?: boolean;
1487
- entries: ThreadEntry[];
1488
- } | {
1489
- address: string;
1490
- kind: "note";
1491
- author: string;
1492
- text: string;
1493
- } | {
1494
- address: string;
1495
- kind: "none";
1496
- };
1497
- declare const getComment: SpreadsheetTool<z.ZodObject<{
1498
- address: z.ZodString;
1499
- }, z.core.$strip>, ToolError | GetCommentResult>;
1500
- //#endregion
1501
- //#region src/tools/comments/get_comments.d.ts
1502
- type GetCommentsResult = {
1503
- comments: CommentEntry[];
1504
- total: number;
1505
- offset: number;
1506
- hasMore: boolean;
1507
- nextOffset?: number;
1508
- };
1509
- declare const getComments: SpreadsheetTool<z.ZodObject<{
1510
- sheet: z.ZodOptional<z.ZodString>;
1511
- offset: z.ZodOptional<z.ZodNumber>;
1512
- }, z.core.$strip>, ToolError | GetCommentsResult>;
1513
- //#endregion
1514
- //#region src/tools/intelligence/dependents.d.ts
1515
- declare const dependents: SpreadsheetTool<import("zod").ZodObject<{
1516
- reference: import("zod").ZodString;
1517
- mode: import("zod").ZodDefault<import("zod").ZodEnum<{
1518
- cells: "cells";
1519
- grouped: "grouped";
1520
- }>>;
1521
- maxDepth: import("zod").ZodOptional<import("zod").ZodNumber>;
1522
- maxNodes: import("zod").ZodOptional<import("zod").ZodNumber>;
1523
- }, import("zod/v4/core").$strip>, GraphToolResult>;
1524
- //#endregion
1525
- //#region src/tools/intelligence/inspect.d.ts
1526
- declare const inspect: SpreadsheetTool<z.ZodObject<{
1527
- reference: z.ZodString;
1528
- offset: z.ZodOptional<z.ZodNumber>;
1529
- }, z.core.$strip>, ToolError | PaginatedReadResult>;
1530
- //#endregion
1531
- //#region src/tools/intelligence/precedents.d.ts
1532
- declare const precedents: SpreadsheetTool<import("zod").ZodObject<{
1533
- reference: import("zod").ZodString;
1534
- mode: import("zod").ZodDefault<import("zod").ZodEnum<{
1535
- cells: "cells";
1536
- grouped: "grouped";
1537
- }>>;
1538
- maxDepth: import("zod").ZodOptional<import("zod").ZodNumber>;
1539
- maxNodes: import("zod").ZodOptional<import("zod").ZodNumber>;
1540
- }, import("zod/v4/core").$strip>, GraphToolResult>;
1541
- //#endregion
1542
- //#region src/tools/view_range.d.ts
1543
- declare const viewRange: SpreadsheetTool<z.ZodObject<{
1544
- reference: z.ZodString;
1545
- show: z.ZodOptional<z.ZodEnum<{
1546
- value: "value";
1547
- formula: "formula";
1548
- fill: "fill";
1549
- fontColor: "fontColor";
1550
- numberFormat: "numberFormat";
1551
- rawValue: "rawValue";
1552
- }>>;
1553
- }, z.core.$strip>, string>;
1554
- //#endregion
1555
- //#region src/tools/workbook_context.d.ts
1556
- /**
1557
- * Generate a pre-analyzed workbook summary suitable for injection into
1558
- * an LLM system prompt. Combines the information from `symbols` and
1559
- * `describeStructure` into a concise, structured format.
1560
- *
1561
- * Returns `null` only if the underlying tools fail.
1562
- */
1563
- declare function generateWorkbookContext(model: Model): string | null;
1564
- //#endregion
1565
21
  //#region src/index.d.ts
1566
22
  declare function toMcpServer(tools?: GridTool[], info?: {
1567
23
  name?: string;