@sheetxl/query 0.7.28-beta.4 → 0.8.0-beta.2

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 (32) hide show
  1. package/browser/cjs/index.cjs +44 -25
  2. package/browser/esm/index.mjs +3094 -1131
  3. package/node/esm/index.mjs +3331 -1334
  4. package/package.json +3 -3
  5. package/types/src/Tool.d.ts +38 -0
  6. package/types/src/api/apiTool.d.ts +22 -0
  7. package/types/src/api/index.d.ts +4 -0
  8. package/types/src/api/lookupApi.d.ts +127 -0
  9. package/types/src/api/renderApi.d.ts +13 -0
  10. package/types/src/grep/GrepTypes.d.ts +75 -17
  11. package/types/src/grep/grep.d.ts +4 -1
  12. package/types/src/index.d.ts +9 -0
  13. package/types/src/markdown/appendDependencies.d.ts +106 -0
  14. package/types/src/markdown/appendPivotTables.d.ts +22 -0
  15. package/types/src/markdown/appendSections.d.ts +37 -108
  16. package/types/src/markdown/describeChart.d.ts +72 -0
  17. package/types/src/markdown/describeHistogram.d.ts +186 -0
  18. package/types/src/markdown/describeRegionPayload.d.ts +1 -1
  19. package/types/src/markdown/findLabels.d.ts +26 -0
  20. package/types/src/markdown/index.d.ts +3 -0
  21. package/types/src/markdown/profileRegion.d.ts +56 -1
  22. package/types/src/markdown/registry.d.ts +11 -2
  23. package/types/src/markdown/renderCell.d.ts +13 -11
  24. package/types/src/markdown/renderCellRange.d.ts +3 -2
  25. package/types/src/markdown/renderModules.d.ts +55 -0
  26. package/types/src/markdown/renderMovable.d.ts +69 -13
  27. package/types/src/markdown/renderNames.d.ts +2 -2
  28. package/types/src/markdown/renderProtection.d.ts +81 -0
  29. package/types/src/markdown/renderRegions.d.ts +1 -0
  30. package/types/src/markdown/renderSheet.d.ts +6 -7
  31. package/types/src/markdown/renderTable.d.ts +11 -3
  32. package/types/src/markdown/renderWorkbook.d.ts +33 -26
@@ -1,23 +1,25 @@
1
1
  import { ICell } from '@sheetxl/sdk';
2
- import { AppendDependencyOptions } from './appendSections';
2
+ import { AppendDependencyOptions } from './appendDependencies';
3
3
  /**
4
- * Renders a cell's report: value, formula, spans, spill, the effective style, and its position in
5
- * the dependency graph.
4
+ * Renders a cell's report: value, formula, the block it sits in, whether it agrees with its
5
+ * siblings, its reach through the dependency graph, and the effective style.
6
6
  *
7
7
  * @remarks
8
+ * A cell is usually arrived at cold — a chat mention, a grep hit, a node in someone else's tree —
9
+ * so the report orients before it details: which block this is and what its labels say, whether
10
+ * this formula is the same as the ones beside it, and how much of the model it reads and feeds.
11
+ * Each of those is an index read, not a scan.
12
+ *
8
13
  * A cell is the one altitude where **resolved effect** belongs. A range reports style as authored
9
14
  * layers and never composes them, because composition is an expansion — a banded table is one
10
15
  * authored fact and an unbounded number of effective ranges. For a single cell the expansion is
11
16
  * one row, and "what does a human actually see here" is the question being asked, so `getStyle()`
12
- * is read rendered rather than direct.
13
- *
14
- * The dependency graph, by contrast, is NOT cell-only. It is indexed by range, so a range
15
- * answers the same four questions in one call and {@link renderCellRange} reports them too — the
16
- * cell form is that one over a 1×1.
17
+ * is read rendered rather than direct, and the line says so.
17
18
  *
18
19
  * Facets that are not present are omitted rather than reported as absent — merge spans on an
19
- * unmerged cell, a spill range on a cell that is not spilled. Value text goes through
20
- * {@link encodeCell}, so whatever this prints, grep can find.
20
+ * unmerged cell, a spill range on a cell that is not spilled. Zeros that ARE facts are printed:
21
+ * a formula nothing reads is an output, and `Dependents (0)` is how the report says it. Value text
22
+ * goes through {@link encodeCell}, so whatever this prints, grep can find.
21
23
  */
22
- export declare function renderCell(cell: ICell, options?: AppendDependencyOptions): string;
24
+ export declare function renderCell(cell: ICell, options?: AppendDependencyOptions): Promise<string>;
23
25
  //# sourceMappingURL=renderCell.d.ts.map
@@ -1,6 +1,7 @@
1
1
  import { ICellRange } from '@sheetxl/sdk';
2
2
  import { CellEncoding } from '../encode';
3
- import { AppendDependencyOptions, AppendFeatureOptions } from './appendSections';
3
+ import { AppendDependencyOptions } from './appendDependencies';
4
+ import { AppendFeatureOptions } from './appendSections';
4
5
  import { ProfileRegionOptions } from './profileRegion';
5
6
  /**
6
7
  * Options for {@link renderCellRange}.
@@ -57,5 +58,5 @@ export interface RenderCellRangeOptions extends AppendFeatureOptions, AppendDepe
57
58
  *
58
59
  * Cell text goes through {@link encodeCell}, so whatever a report prints, grep can find.
59
60
  */
60
- export declare function renderCellRange(range: ICellRange, options?: RenderCellRangeOptions): string;
61
+ export declare function renderCellRange(range: ICellRange, options?: RenderCellRangeOptions): Promise<string>;
61
62
  //# sourceMappingURL=renderCellRange.d.ts.map
@@ -0,0 +1,55 @@
1
+ import { IModule, IModuleCollection, IWorkbook } from '@sheetxl/sdk';
2
+ import { MarkdownBuilder } from './MarkdownBuilder';
3
+ /**
4
+ * Options for {@link renderModules} and {@link renderModule}.
5
+ */
6
+ export interface RenderModulesOptions {
7
+ /** Maximum modules listed before the tail is reported as a count. */
8
+ maxModules?: number;
9
+ /** Maximum source lines shown per module in the full listing. */
10
+ maxSourceLines?: number;
11
+ }
12
+ /**
13
+ * Every module in the workbook, its own and its sheets', in one list.
14
+ *
15
+ * @remarks
16
+ * Both levels, because "does this workbook contain code" is one question and a reader who has to
17
+ * ask it per sheet will not ask it at all. Unfiltered by language — the default TypeScript filter
18
+ * exists to protect callers that only want runnable scripts, and this report exists precisely to
19
+ * say what is there.
20
+ */
21
+ export declare function collectModules(workbook: IWorkbook): IModule[];
22
+ /**
23
+ * Appends the code announcement — what has code, what runs itself, and what SheetXL will not run.
24
+ *
25
+ * @remarks
26
+ * **Names the modules that have source, and only those.** Excel writes an empty `ThisWorkbook`
27
+ * and an empty document module per sheet whether or not anyone wrote a line in them, so listing
28
+ * every module reports scaffolding as content — a five-row table for one macro, in which the
29
+ * reader has to work out which row matters. The heading still counts the whole collection, so
30
+ * nothing is hidden; the rows are the part worth reading, and `getModules()` reaches the rest.
31
+ *
32
+ * Nothing is printed for a workbook with no modules at all. Absence of code is the norm and does
33
+ * not need a section saying so.
34
+ */
35
+ export declare function appendModules(md: MarkdownBuilder, modules: readonly IModule[], options?: RenderModulesOptions): void;
36
+ /**
37
+ * Renders one module — its facts, then its source.
38
+ *
39
+ * @remarks
40
+ * The report that answers "what does this code do", which is why it prints the body rather than
41
+ * measuring it.
42
+ */
43
+ export declare function renderModule(module: IModule, options?: RenderModulesOptions): string;
44
+ /**
45
+ * Renders a module collection — the roster, then each module's source.
46
+ *
47
+ * @remarks
48
+ * **What it holds is decided by where the collection came from**, the same rule
49
+ * `renderNames` follows: `wb.getScripts().getModules()` is the workbook's own modules,
50
+ * `sheet.getModules()` is that sheet's. Neither is filtered here — a caller who reached this
51
+ * report asked to see what exists, so `language` is left wide open rather than defaulting to
52
+ * TypeScript the way an ordinary `getItems()` does.
53
+ */
54
+ export declare function renderModules(modules: IModuleCollection, options?: RenderModulesOptions): string;
55
+ //# sourceMappingURL=renderModules.d.ts.map
@@ -1,31 +1,87 @@
1
1
  import { IMovable } from '@sheetxl/sdk';
2
2
  import { MarkdownBuilder } from './MarkdownBuilder';
3
+ /** A shape with something written on it, the text already read. */
4
+ export interface ShapeTextEntry {
5
+ movable: IMovable;
6
+ text: string;
7
+ }
8
+ /** The anchor as a plain A1 address — `toString()` may carry the sheet, and these rows decide that themselves. */
9
+ export declare const describeAnchor: (movable: IMovable) => string;
10
+ /** A shape's text as a listing prints it: quoted, capped, the recovery named where it was cut. */
11
+ export declare const describeShapeText: ({ movable, text }: ShapeTextEntry) => string;
12
+ /** The text written on a shape — `''` for a bare one — or `null` for content that is not a shape. */
13
+ export declare const readShapeText: (movable: IMovable) => string | null;
3
14
  /**
4
- * `## Movables (3)` over ` C3:F12 chart Chart 1 — column` rows — the pictures, charts, shapes
5
- * and slicers floating over the report's range.
15
+ * The shapes among `movables` that have something written on them, in reading order.
16
+ *
17
+ * @remarks
18
+ * **Only non-empty text.** On a shape with an empty body "no text" is itself the information: a
19
+ * bare rectangle is a box drawn around the cells under it.
20
+ *
21
+ * **Reading order, not z-order**: by the anchor's top-left, row-major. Z-order is the order the
22
+ * author happened to draw them in; callouts are written to be read down the sheet.
23
+ *
24
+ * Hidden shapes are included. Hidden text is exactly what a reviewer wants surfaced, and the row
25
+ * marks it so the reader knows a human looking at the grid does not see it.
26
+ */
27
+ export declare function collectShapeText(movables: readonly IMovable[]): ShapeTextEntry[];
28
+ /**
29
+ * One movable as one line of prose: `Picture 1 — logo.png`, or for a chart
30
+ * `line · 8 series · values NOI!C4:J111 · categories NOI!B4:B111 · Chart 2`.
31
+ *
32
+ * @remarks
33
+ * Name first because it is what the object is called everywhere else — the OOXML `cNvPr/@name`,
34
+ * the UI's selection pane — and because for a slicer or a shape it is the ONLY description
35
+ * anything can offer. A chart is the exception and its name goes last: `Chart 2` says nothing, and
36
+ * what the chart plots is the one fact on the row that points back at cells.
37
+ *
38
+ * The alt text joins it when set. It is prose a human wrote about a graphic a text report cannot
39
+ * show, so here it is not decoration: for a chart or a smart-art frame it is frequently the only
40
+ * sentence in the whole file that says what the graphic shows.
41
+ */
42
+ export declare const describeMovableSummary: (movable: IMovable) => string;
43
+ /** `Charts` for `chart` — a type the table does not know still gets a section, named after itself. */
44
+ export declare const describeTypeHeading: (type: string) => string;
45
+ /**
46
+ * `movables` by content type, in section order: the known types as {@link TYPE_HEADINGS} lists
47
+ * them, then any other in the order it first appears. Z-order is kept within a type.
48
+ */
49
+ export declare function groupMovables(movables: readonly IMovable[]): Map<string, IMovable[]>;
50
+ /**
51
+ * One section per content type — `## Charts (1)`, `## Shapes (11 · 4 with text)` — over the
52
+ * pictures, charts, shapes and slicers floating over the report's range.
6
53
  *
7
54
  * @remarks
8
55
  * **The one class of sheet content that appears in no other section.** Everything else these
9
56
  * reports describe lives in cells and is reachable by address; a movable floats over the grid and
10
- * is invisible to every values, region and rule listing — so without this section a report about
11
- * a dashboard sheet says the sheet is nearly empty, which is true of its cells and false of what
57
+ * is invisible to every values, region and rule listing — so without these a report about a
58
+ * dashboard sheet says the sheet is nearly empty, which is true of its cells and false of what
12
59
  * anyone looking at it sees.
13
60
  *
14
- * Rows are `anchor · type · prose`, and both leading columns are arguments rather than labels: the
15
- * address is what `getRange()` takes, and the type is exactly what `getMovables({ type })` filters
16
- * on — the filter compares this same string.
61
+ * **A section per type, the way tables have one.** A reader looks for charts, or for the notes an
62
+ * author left; nobody looks for "movables", which is the SDK's word for how these are stored. The
63
+ * heading is the type, so no row spends a column repeating it.
64
+ *
65
+ * Rows are `anchor · preset · prose · "text"`. The anchor is what `getRange()` takes and says which
66
+ * cells the object is about; the preset says what kind of shape it is — a callout points at
67
+ * something, a text box stands alone. A chart's type takes the preset's column, and what it plots
68
+ * is labeled lines beneath its row, the way a table's facts are: a chart states three ranges, and
69
+ * on one line nothing says which is which.
17
70
  *
18
- * Listed in z-order, which is the order the collection returns them in and the order they paint,
19
- * so where two movables overlap the later row is the one on top. Hidden movables are listed and
20
- * marked; they are the ones a reader cannot otherwise learn about.
71
+ * **What is written on a shape rides its row, and those rows lead** — in reading order, ahead of
72
+ * the rest in z-order. Text on a shape is almost never decoration: it is a note from the author to
73
+ * the reader — what a block means, which cell to change, what not to touch — and the heading
74
+ * counts them so a reader knows to look. Leading also makes the cap safe: what it eats is bare
75
+ * rectangles. Hidden movables are listed and marked; they are the ones a reader cannot otherwise
76
+ * learn about.
21
77
  */
22
78
  export declare function appendMovables(md: MarkdownBuilder, movables: readonly IMovable[]): void;
23
79
  /**
24
- * Renders one movable's report — what it is, where it is anchored, and whether anyone can see it.
80
+ * Renders one movable's report — what it is, where it is anchored, and whether it is hidden.
25
81
  *
26
82
  * @remarks
27
- * The listing carries the identity; this adds what does not fit on a row: the pixel bounds, the
28
- * anchor behavior that decides what an insert does to this object, and the display note in full.
83
+ * The listing carries the identity; this adds what does not fit on a row: the pixel bounds and
84
+ * the anchor behavior that decides what an insert does to this object.
29
85
  *
30
86
  * **A movable has no name-based lookup**, so unlike a table this report leads with the anchor —
31
87
  * the address is how a reader gets back to it (`range.getMovables()`), and the name is the first
@@ -24,9 +24,9 @@ export interface RenderNamesOptions extends AppendNamesOptions {
24
24
  * the workbook roster), and this is the report that has to be complete: a hidden broken name with
25
25
  * dependents is precisely the row a debugging agent must see, and the triage sort surfaces it.
26
26
  *
27
- * Synchronous, like every renderer: the dependents column is read off COMPILED formulas, so the
27
+ * The dependents column is the engine's answer, and it is read off COMPILED formulas, so the
28
28
  * caller settles the engine first — `renderMarkdown` settles its workbook argument before
29
29
  * dispatching here.
30
30
  */
31
- export declare function renderNames(names: INamedCollection, options?: RenderNamesOptions): string;
31
+ export declare function renderNames(names: INamedCollection, options?: RenderNamesOptions): Promise<string>;
32
32
  //# sourceMappingURL=renderNames.d.ts.map
@@ -0,0 +1,81 @@
1
+ import { ICellRange, ICell, IProtectedRange, IProtection, ISheet, ISheetProtection, IWorkbookProtection } from '@sheetxl/sdk';
2
+ import { MarkdownBuilder } from './MarkdownBuilder';
3
+ type AnyProtection = IProtection<any, any, any>;
4
+ /**
5
+ * `locked · password` / `paused` — or `null` when the object is not protected.
6
+ *
7
+ * @remarks
8
+ * `null` is what every embedding report tests: an unprotected sheet says nothing about protection,
9
+ * at any altitude. Paused is reported because the document is still a protected one — it saves
10
+ * protected and `resume()` restores it — even though nothing is refused meanwhile. The password is
11
+ * only ever a word here; its hash and salt are never printed.
12
+ */
13
+ export declare const describeLock: (protection: AnyProtection) => string | null;
14
+ /**
15
+ * `structure locked · password` — the workbook report's `Protection:` line, or `null` when the
16
+ * workbook is not protected.
17
+ */
18
+ export declare const describeWorkbookProtection: (protection: IWorkbookProtection) => string | null;
19
+ /**
20
+ * A protected sheet's line on the workbook report — where it can still be written, and how much.
21
+ *
22
+ * @returns `null` when the sheet is not protected.
23
+ */
24
+ export declare function summarizeSheetProtection(sheet: ISheet): {
25
+ extent: string;
26
+ detail: string;
27
+ } | null;
28
+ /**
29
+ * Appends a sheet report's `Protection` section — nothing at all when the sheet is not protected.
30
+ *
31
+ * @remarks
32
+ * Protection is a **precondition on writing**, the same reason a data validation is reported: a
33
+ * cell that will refuse the next write looks exactly like one that will accept it. So the section
34
+ * answers the writer's three questions in order — is it enforced, which operations survive, and
35
+ * where a value can still go.
36
+ *
37
+ * The editable regions are the `unlock` partition, which is why that feature has no section of its
38
+ * own: on an unprotected sheet an unlocked cell refuses nothing and says nothing, and on a
39
+ * protected one it is this section's body.
40
+ */
41
+ export declare function appendSheetProtection(md: MarkdownBuilder, sheet: ISheet): void;
42
+ /**
43
+ * A range report's `Protection:` line — how much of the range a write reaches — or `null` when the
44
+ * sheet is not locked.
45
+ *
46
+ * @remarks
47
+ * Locked only, not paused: this line is read immediately before a write, and a paused sheet
48
+ * refuses none.
49
+ */
50
+ export declare function describeRangeProtection(range: ICellRange): string | null;
51
+ /** A cell report's `Editable:` fact, or `null` when the sheet is not locked. */
52
+ export declare function describeCellProtection(cell: ICell): string | null;
53
+ /**
54
+ * The lookup that answers a write refused by protection, or `null` for any other failure.
55
+ *
56
+ * @remarks
57
+ * The refusal itself is written for a person at a dialog ("unprotect the sheet"); a script needs
58
+ * to know what is still allowed and where. Tested by `name`, since the error routinely crosses a
59
+ * bundle boundary on its way to the host that reports it.
60
+ */
61
+ export declare function protectionPointerFor(error: unknown): string | null;
62
+ /**
63
+ * Renders a sheet's or a workbook's protection — what `getProtection()` answers with.
64
+ *
65
+ * @remarks
66
+ * The object knows its options and not its owner, so this report carries no name and no cells: the
67
+ * editable regions are the sheet report's `Protection` section, and
68
+ * `sheet.getRegions("unlock")` on their own. An unprotected object still renders — the caller asked
69
+ * — as the one line that says so, plus the options it keeps for its next lock.
70
+ */
71
+ export declare function renderProtection(protection: ISheetProtection | IWorkbookProtection): string;
72
+ /**
73
+ * Renders one unlocked range — a member of what `sheet.getProtectedRanges()` holds.
74
+ *
75
+ * @remarks
76
+ * Named for what it does rather than for its type: an `IProtectedRange` RELAXES protection, and a
77
+ * report titled "Protected Range" would tell a writer the opposite of the truth.
78
+ */
79
+ export declare function renderProtectedRange(item: IProtectedRange): string;
80
+ export {};
81
+ //# sourceMappingURL=renderProtection.d.ts.map
@@ -49,6 +49,7 @@ export interface RenderRegionsOptions extends ProfileRegionOptions {
49
49
  export declare function appendRegionList(md: MarkdownBuilder, regions: readonly ICellRegion[], options?: RenderRegionsOptions & {
50
50
  payload?: RegionPayload;
51
51
  profile?: boolean;
52
+ series?: boolean;
52
53
  }): void;
53
54
  /**
54
55
  * Renders a partition — the unit `getRegions` returns, so an agent addresses structure instead
@@ -6,18 +6,17 @@ import { AppendFeatureOptions } from './appendSections';
6
6
  export interface RenderSheetOptions extends AppendFeatureOptions {
7
7
  }
8
8
  /**
9
- * Renders a markdown report of a sheet: counts, one section per feature partition, and the
10
- * sheet-level objects (named ranges, hidden headers, tables).
9
+ * Renders a markdown report of a sheet: counts, one section per feature partition, the sheet-level
10
+ * objects (named ranges, hidden headers, tables, pivot tables) and the floating layer by type.
11
11
  *
12
12
  * @remarks
13
13
  * **No `Values` section** — that one belongs to {@link renderCellRange}, where the caller named
14
14
  * bounds, and it is the only output in these reports that scales with the number of cells.
15
15
  *
16
16
  * Everything here is bounded by the sheet's structure instead: one section per feature
17
- * partition, and a profile per contentful block that reports computed shape (types, bounds,
18
- * aggregates, distinct counts) plus the text that names a block — a 1×1 prints its value, a
19
- * table its header labels. Blocks × series, both capped, so this report cannot grow with the
20
- * data. Altitude governs content: this one says where things are and what each block is; the
17
+ * partition, and one line per contentful block — its shape, its header, and the text that names
18
+ * it (a 1×1 prints its value). Per-column profiles summarize values, so they are the range
19
+ * report's. Altitude governs content: this one says where things are and what each block is; the
21
20
  * range report reads one.
22
21
  *
23
22
  * This is the whole-sheet form of the same stats a cell range reports — which is exactly why
@@ -25,5 +24,5 @@ export interface RenderSheetOptions extends AppendFeatureOptions {
25
24
  * then asked for, so the two calls compose into the whole read: this one to find the blocks,
26
25
  * that one to read one.
27
26
  */
28
- export declare function renderSheet(sheet: ISheet, options?: RenderSheetOptions): string;
27
+ export declare function renderSheet(sheet: ISheet, options?: RenderSheetOptions): Promise<string>;
29
28
  //# sourceMappingURL=renderSheet.d.ts.map
@@ -1,10 +1,18 @@
1
1
  import { ITable } from '@sheetxl/sdk';
2
2
  import { MarkdownBuilder } from './MarkdownBuilder';
3
3
  /**
4
- * Appends one table's details — shared by the sheet report's Tables section and the standalone
5
- * table report, so the two can never describe a table differently.
4
+ * `## Tables (981 cells · 1 table)` over one `B3:J111 109×9 tblNOI` row per table, its facts
5
+ * indented beneath it.
6
+ *
7
+ * @remarks
8
+ * **The one section a table has.** A table is both a feature partition and a sheet object, and
9
+ * printing it as each said the same thing twice under two headings a letter apart. The row is the
10
+ * partition's — address, size, payload, the form every region listing uses — and the heading
11
+ * carries its two counts, so nothing the partition said is lost.
12
+ *
13
+ * @param cells The cells of `tables` inside the report's scope.
6
14
  */
7
- export declare function appendTableDetails(md: MarkdownBuilder, table: ITable): void;
15
+ export declare function appendTables(md: MarkdownBuilder, tables: readonly ITable[], cells: number): void;
8
16
  /**
9
17
  * Renders a table report.
10
18
  */
@@ -1,43 +1,50 @@
1
1
  import { IWorkbook } from '@sheetxl/sdk';
2
- import { AppendFeatureOptions, AppendNamesOptions } from './appendSections';
2
+ import { AppendNamesOptions } from './appendSections';
3
+ import { RenderModulesOptions } from './renderModules';
3
4
  /**
4
5
  * Options for {@link renderWorkbook}.
5
6
  */
6
- export interface RenderWorkbookOptions extends AppendFeatureOptions, Pick<AppendNamesOptions, 'maxNames'> {
7
- /**
8
- * Cap on sheets expanded into per-sheet sections below the roster; the rest stay roster-only
9
- * and the report says how to render one in full.
10
- *
11
- * @defaultValue 8
12
- */
13
- maxSheets?: number;
7
+ export interface RenderWorkbookOptions extends Pick<AppendNamesOptions, 'maxNames'>, Pick<RenderModulesOptions, 'maxModules'> {
14
8
  }
15
9
  /**
16
- * Renders a markdown summary of a workbook: identity, the sheet roster, what is broken, and each
17
- * sheet's structure.
10
+ * Renders a markdown summary of a workbook: identity, a summary per sheet, what is broken, names
11
+ * and code.
18
12
  *
19
13
  * @remarks
20
14
  * **The workbook report's job is routing** — *which sheet do I go to, and is anything broken?*
21
- * Every line earns its place against that, which is why the roster is a table of routing facts
22
- * (used range, cell/formula/error counts) rather than a list of names, and why errors get a
23
- * section at this altitude: a broken book must not read clean.
24
- *
25
- * **Below the roster, each sheet's own sections render inline** — the same `Type`/partition/
26
- * object sections a sheet report carries, one heading level down, through the same functions so
27
- * the two can never disagree. One shape at every size; scale is absorbed by caps, not by a mode
28
- * switch: on a small book the first call answers structure outright, on a large one every capped
29
- * list states its overflow and the recovery (`maxSheets` sheets expanded, {@link
30
- * MAX_REGIONS_PER_SHEET} regions per feature and {@link MAX_PROFILED_PER_SHEET} profiled —
31
- * tighter than a sheet report's own defaults, because here they share the budget with the whole
32
- * book). Like the sheet report, the expansion carries no `Values` section — that one is
33
- * {@link renderCellRange}'s. A contentful profile is computed shape, bounded by blocks × series
34
- * rather than by cells.
15
+ * Every line earns its place against that, and a broken book must not read clean.
16
+ *
17
+ * **One short summary per sheet, one line per layer.** Content, formulas and styles each have
18
+ * their own extent, so a single `Used` column could only report the widest of them — a column
19
+ * style running to XFC made a 33-row model read as sixteen thousand columns. Each layer line
20
+ * carries its extent and its counts: blocks against cells is the fragmentation signal, formula
21
+ * regions and distinct formulas say how many ideas the model has, and distinct fonts and formats
22
+ * say whether the styling is a convention. A layer that is empty has no line. The structure
23
+ * behind each line is the sheet report's, and the `content` line carries that sheet's call
24
+ * (`wb.getSheet("Sales") lists the blocks`): a reader routes by copying an address off the roster,
25
+ * so the call to the fuller report sits on the line the address is read from. **Twins** — sheets
26
+ * whose formula partitions are identical, where the audit is the diff between them — are named on
27
+ * the sheet.
28
+ *
29
+ * Every sheet is summarized: an agent asked about a sixty-sheet book needs sixty summaries, and
30
+ * there is no cheaper call that gives them. Labels and extents align across sheets, so reading
31
+ * down still compares them.
35
32
  *
36
33
  * Two kinds of broken, kept apart deliberately: an **error** is a successfully calculated error
37
34
  * VALUE (`#DIV/0!` from `=1/0` — the `Error` kind), a **calc failure** is the engine failing to
38
35
  * evaluate at all (mostly circular references — `CalcError`). A book with zero of one and three
39
36
  * of the other is still badly broken, so each gets its own section and neither hides the other.
40
37
  *
38
+ * **Tables, pivot tables and the floating layer each get a line, by type** — `tables`, `charts`,
39
+ * `shapes` — the same names their sections carry on the sheet's report, so a line here is the
40
+ * heading to look for there.
41
+ *
42
+ * **What the author wrote on a sheet is quoted under it.** Text on a shape is a note to the reader
43
+ * — what a block means, which cell to change — and this is the report every reader runs first, so
44
+ * the `shapes` line says how many carry text and the first few follow it, located and
45
+ * unparaphrased. Under the sheet rather than in a section of the book's: a note is about the sheet
46
+ * it sits on, and that is where a reader deciding whether to open the sheet will see it.
47
+ *
41
48
  * Sheet ids are a session concept, not a document concept, and are not stable across runs — they
42
49
  * do not appear here. Hidden sheets are marked inline where they exist rather than summarized in
43
50
  * an always-zero count line: a hidden sheet with data is a classic miss, and the mark is what
@@ -46,5 +53,5 @@ export interface RenderWorkbookOptions extends AppendFeatureOptions, Pick<Append
46
53
  * Pure rendering — the agent-priming preamble the pre-migration SDK report carried
47
54
  * (`PROMPT_STRING`) belongs to the host that primes the agent, not to the report.
48
55
  */
49
- export declare function renderWorkbook(workbook: IWorkbook, options?: RenderWorkbookOptions): string;
56
+ export declare function renderWorkbook(workbook: IWorkbook, options?: RenderWorkbookOptions): Promise<string>;
50
57
  //# sourceMappingURL=renderWorkbook.d.ts.map