Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
a1c0ea6
feat(spreadsheet): merge TanStack Spreadsheet packages, docs, and demo
jherr Dec 3, 2026
425bf07
feat(spreadsheet-demo): add "State Manager" demo; rename Grid → Simpl…
jherr Dec 3, 2026
248fafe
fix(spreadsheet): unblock CI — compiler preset, store publish, NUL li…
jherr Dec 3, 2026
228c666
refactor(spreadsheet): tighten public surface to match TanStack conve…
jherr Dec 3, 2026
338ce5d
fix(spreadsheet-table-v9): correct selection rect under an active sort
jherr Dec 3, 2026
13c136f
fix(spreadsheet-core): make setFormat reactive
jherr Dec 3, 2026
f4e6aef
refactor(spreadsheet): unify React reactivity on @tanstack/react-store
jherr Dec 3, 2026
f2cf106
refactor(react-spreadsheet): rename grid hook, split entry, add useSp…
jherr Dec 3, 2026
5e4aba7
docs(spreadsheet): fold into the Table docs site
jherr Dec 3, 2026
0c09729
chore(spreadsheet): add release changeset and register in vitest work…
jherr Dec 3, 2026
8c61bc0
docs(spreadsheet-demo): fix README routes, filter name, and add deplo…
jherr Dec 3, 2026
b01a05d
refactor(spreadsheet-core): add typed capability registry; extract fo…
jherr Dec 3, 2026
31d029f
refactor(spreadsheet-core): extract provenance capability
jherr Dec 3, 2026
6659f82
refactor(spreadsheet-core): extract merges capability
jherr Dec 3, 2026
aa882d3
refactor(spreadsheet-core): extract clipboard and fill capabilities
jherr Dec 3, 2026
ea8b221
refactor(spreadsheet-core): extract names capability
jherr Dec 3, 2026
9d77f92
refactor(spreadsheet-core): extract async capability
jherr Dec 3, 2026
ebbc09a
build(spreadsheet-core): add lean ./construct and ./capabilities subp…
jherr Dec 3, 2026
64afa45
chore(spreadsheet): finalize capability-registry integration (knip + …
jherr Dec 3, 2026
09fd935
docs(spreadsheet): add per-package READMEs
jherr Dec 3, 2026
296f863
test(react-spreadsheet): cover useSpreadsheet overloads, SSR, cleanup…
jherr Dec 3, 2026
60af41b
chore(spreadsheet): add size-limit budgets
jherr Dec 3, 2026
83800db
test(spreadsheet-core): add v8 coverage config and test:coverage script
jherr Dec 4, 2026
344641f
chore(spreadsheet-demo): make the demo type-check and lint cleanly
jherr Dec 4, 2026
3a80a69
test(spreadsheet-demo): wire the demo model tests to a test:lib script
jherr Dec 4, 2026
b98ff0a
docs(spreadsheet): author Intent skills for spreadsheet packages
jherr Dec 4, 2026
56d972e
Merge remote-tracking branch 'github/main' into feat/spreadsheet
jherr Dec 4, 2026
a5b96a3
chore(spreadsheet): align deps with main after merge
jherr Dec 4, 2026
9e6efc3
fix(spreadsheet-demo): commit generated routeTree.gen.ts for CI test:…
jherr Dec 4, 2026
6d71a87
fix(spreadsheet-store): clear ragged-replacement holes when re-staging
jherr Dec 4, 2026
1887c11
fix(spreadsheet): acquire table subscription in an effect, not in render
jherr Dec 4, 2026
a71a0ec
refactor(spreadsheet): rename spreadsheet-table-v9 → spreadsheet-tabl…
jherr Dec 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .changeset/tanstack-spreadsheet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
'@tanstack/spreadsheet-core': minor
'@tanstack/spreadsheet-store': minor
'@tanstack/spreadsheet-packs': minor
'@tanstack/spreadsheet-xlsx': minor
'@tanstack/spreadsheet-codemode': minor
'@tanstack/spreadsheet-agent': minor
'@tanstack/spreadsheet-table': minor
'@tanstack/react-spreadsheet': minor
---

Add TanStack Spreadsheet (experimental): a headless, framework-agnostic spreadsheet engine — addressing, parser, dependency graph, and evaluator — that projects into TanStack Table v9. Includes the core workbook, a TanStack Store interop layer, async function packs, `.xlsx` import/export, on-the-fly Code Mode cell functions, an agent toolkit, the table adapter, and React bindings.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ A headless table library for building powerful datagrids with full control over
- Sorting, filtering, grouping, aggregation & row selection
- Lightweight, virtualizable & server‑side friendly

> [!NOTE]
> **TanStack Spreadsheet (experimental)** — a headless, framework-agnostic
> spreadsheet engine (parser, dependency graph, evaluator) that projects into
> TanStack Table. See the
> [Spreadsheet docs](https://tanstack.com/table/latest/docs/spreadsheet/overview).

### <a href="https://tanstack.com/table">Read the Docs →</a>

## Using an AI Coding Agent?
Expand Down
109 changes: 109 additions & 0 deletions _artifacts/domain_map.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2625,6 +2625,115 @@ skills:
thresholds, accessors, bounds, and diacritic handling. Routes TanStack
Table filterMeta wiring to filtering skills.
requires: []
- slug: core
package: '@tanstack/spreadsheet-core'
domain: spreadsheet
type: core
purpose:
Establish the headless workbook kernel, the input-patch commit pipeline,
errors and pending as first-class cell values, region subscriptions, and
the opt-in capability model.
sources:
- TanStack/table:packages/spreadsheet-core/src/index.ts
- TanStack/table:packages/spreadsheet-core/src/types.ts
- TanStack/table:packages/spreadsheet-core/src/workbook.ts
- TanStack/table:packages/spreadsheet-core/src/kernel.ts
- TanStack/table:packages/spreadsheet-core/src/construct.ts
- TanStack/table:packages/spreadsheet-core/src/capability.ts
- TanStack/table:packages/spreadsheet-core/src/eval.ts
- TanStack/table:packages/spreadsheet-core/src/capabilities/index.ts
failure_modes:
- Treating an error or pending result as an exception or null instead of
narrowing the CellValue with isErr, isPending, or isBlocking.
- Mutating cells directly or storing computed values in patches rather
than committing input strings through setInput and applyPatches.
- Reaching for every capability by default instead of constructing a
lean workbook with only the capabilities the task needs.
description:
Use the TanStack Spreadsheet workbook kernel and capability model. Route
cell input, patches, computed reads, errors and pending as values, region
subscriptions, and opt-in capabilities. Load before the react, table-v9,
or xlsx spreadsheet skills.
requires: []
- slug: core
package: '@tanstack/react-spreadsheet'
domain: spreadsheet
type: framework
framework: react
purpose: Drive a workbook from React with owned or provided instances,
revision-tracked cell and region reads, and the /table grid entry.
sources:
- TanStack/table:packages/react-spreadsheet/src/index.ts
- TanStack/table:packages/react-spreadsheet/src/hooks.ts
- TanStack/table:packages/react-spreadsheet/src/table.ts
- TanStack/table:packages/react-spreadsheet/src/useSpreadsheetTable.ts
failure_modes:
- Rendering a raw CellValue that may be an error or pending object into
JSX instead of narrowing and formatting it first.
- Expecting later useSpreadsheet option changes to rebuild the workbook
when construction is frozen on first render.
- Importing the /table grid hook into cell-only views and pulling in the
table-v9 projection unnecessarily.
description:
Drive a TanStack Spreadsheet workbook from React. Route owned vs. provided
workbooks, revision-tracked cell and region reads, and the /table grid
entry. Use spreadsheet-core for the kernel and value model.
requires:
- '@tanstack/spreadsheet-core#core'
- slug: core
package: '@tanstack/spreadsheet-table'
domain: spreadsheet
type: framework
purpose:
Project a workbook sheet window onto a TanStack Table v9 instance with
createSpreadsheetTable, the registered feature set, and the selection,
fill, clipboard, and merge verbs.
sources:
- TanStack/table:packages/spreadsheet-table/src/index.ts
- TanStack/table:packages/spreadsheet-table/src/controller.ts
- TanStack/table:packages/spreadsheet-table/src/features.ts
- TanStack/table:packages/spreadsheet-table/src/projection.ts
- TanStack/table:packages/spreadsheet-table/src/types.ts
failure_modes:
- Mutating the projected rows instead of editing through the verbs or the
workbook, which is the single source of truth.
- Forgetting to call destroy and leaking the workbook revision
subscription when the table is discarded.
- Treating the result as a plain object rather than a v9 Table whose
standard row-model APIs coexist with the spreadsheet verbs.
description:
Project a TanStack Spreadsheet workbook onto a TanStack Table v9 instance
with createSpreadsheetTable. Route the registered features, the
sheet-to-rows/columns projection, and the spreadsheet verbs. Use
spreadsheet-core for the kernel.
requires:
- '@tanstack/spreadsheet-core#core'
- slug: core
package: '@tanstack/spreadsheet-xlsx'
domain: spreadsheet
type: integration
purpose:
Round-trip .xlsx bytes through a workbook with importXlsx and exportXlsx,
surfacing the structured issues model and the fixed dropped-feature list.
sources:
- TanStack/table:packages/spreadsheet-xlsx/src/index.ts
- TanStack/table:packages/spreadsheet-xlsx/src/importer.ts
- TanStack/table:packages/spreadsheet-xlsx/src/exporter.ts
- TanStack/table:packages/spreadsheet-xlsx/src/drops.ts
failure_modes:
- Assuming a clean import instead of reading ImportResult.issues and
summary.byKind for degraded cells and dropped features.
- Expecting an unsupported formula to throw rather than keeping its cached
value and recording an issue.
- Exporting without warning users via DROPPED_FEATURES or
DROPPED_FEATURES_SENTENCE about features that cannot cross over.
description:
Round-trip .xlsx bytes through a TanStack Spreadsheet workbook with
importXlsx and exportXlsx. Route the issues/degradation model and the
fixed dropped-feature list. Use spreadsheet-core for the workbook and
value model.
requires:
- '@tanstack/spreadsheet-core#core'

cross_references:
- from: core
Expand Down
74 changes: 74 additions & 0 deletions _artifacts/skill_tree.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -925,3 +925,77 @@ skills:
- TanStack/table:packages/match-sorter-utils/src/index.ts
- TanStack/table:docs/framework/react/guide/fuzzy-filtering.md
- TanStack/table:examples/react/filters-fuzzy
- name: Spreadsheet Core
slug: core
type: core
domain: spreadsheet
path: packages/spreadsheet-core/skills/core/SKILL.md
package: packages/spreadsheet-core
description:
Use the TanStack Spreadsheet workbook kernel and capability model. Route
cell input, patches, computed reads, errors and pending as values, region
subscriptions, and opt-in capabilities. Load before the react, table-v9,
or xlsx spreadsheet skills.
sources:
- TanStack/table:packages/spreadsheet-core/src/index.ts
- TanStack/table:packages/spreadsheet-core/src/types.ts
- TanStack/table:packages/spreadsheet-core/src/workbook.ts
- TanStack/table:packages/spreadsheet-core/src/kernel.ts
- TanStack/table:packages/spreadsheet-core/src/construct.ts
- TanStack/table:packages/spreadsheet-core/src/capability.ts
- TanStack/table:packages/spreadsheet-core/src/eval.ts
- TanStack/table:packages/spreadsheet-core/src/capabilities/index.ts
- name: React Spreadsheet Core
slug: core
type: framework
domain: spreadsheet
path: packages/react-spreadsheet/skills/core/SKILL.md
package: packages/react-spreadsheet
description:
Drive a TanStack Spreadsheet workbook from React. Route owned vs. provided
workbooks, revision-tracked cell and region reads, and the /table grid
entry. Use spreadsheet-core for the kernel and value model.
requires:
- '@tanstack/spreadsheet-core#core'
sources:
- TanStack/table:packages/react-spreadsheet/src/index.ts
- TanStack/table:packages/react-spreadsheet/src/hooks.ts
- TanStack/table:packages/react-spreadsheet/src/table.ts
- TanStack/table:packages/react-spreadsheet/src/useSpreadsheetTable.ts
- name: Spreadsheet Table
slug: core
type: framework
domain: spreadsheet
path: packages/spreadsheet-table/skills/core/SKILL.md
package: packages/spreadsheet-table
description:
Project a TanStack Spreadsheet workbook onto a TanStack Table v9 instance
with createSpreadsheetTable. Route the registered features, the
sheet-to-rows/columns projection, and the spreadsheet verbs. Use
spreadsheet-core for the kernel.
requires:
- '@tanstack/spreadsheet-core#core'
sources:
- TanStack/table:packages/spreadsheet-table/src/index.ts
- TanStack/table:packages/spreadsheet-table/src/controller.ts
- TanStack/table:packages/spreadsheet-table/src/features.ts
- TanStack/table:packages/spreadsheet-table/src/projection.ts
- TanStack/table:packages/spreadsheet-table/src/types.ts
- name: Spreadsheet XLSX
slug: core
type: integration
domain: spreadsheet
path: packages/spreadsheet-xlsx/skills/core/SKILL.md
package: packages/spreadsheet-xlsx
description:
Round-trip .xlsx bytes through a TanStack Spreadsheet workbook with
importXlsx and exportXlsx. Route the issues/degradation model and the
fixed dropped-feature list. Use spreadsheet-core for the workbook and
value model.
requires:
- '@tanstack/spreadsheet-core#core'
sources:
- TanStack/table:packages/spreadsheet-xlsx/src/index.ts
- TanStack/table:packages/spreadsheet-xlsx/src/importer.ts
- TanStack/table:packages/spreadsheet-xlsx/src/exporter.ts
- TanStack/table:packages/spreadsheet-xlsx/src/drops.ts
22 changes: 22 additions & 0 deletions docs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -1631,6 +1631,28 @@
]
}
]
},
{
"label": "TanStack Spreadsheet (Experimental)",
"children": [
{ "label": "Overview", "to": "spreadsheet/overview" },
{ "label": "Quick Start", "to": "spreadsheet/quick-start" },
{ "label": "Installation", "to": "spreadsheet/installation" },
{ "label": "Formula Language", "to": "spreadsheet/formula-language" },
{ "label": "Workbook API", "to": "spreadsheet/workbook-api" },
{
"label": "Functions, Packs & the Registry",
"to": "spreadsheet/registry-and-packs"
},
{
"label": "Projecting into TanStack Table",
"to": "spreadsheet/projection-guide"
},
{ "label": "React Bindings", "to": "spreadsheet/react-guide" },
{ "label": "XLSX Fidelity", "to": "spreadsheet/xlsx-fidelity" },
{ "label": "TanStack Store", "to": "spreadsheet/store-guide" },
{ "label": "The Agent Surface", "to": "spreadsheet/agent-guide" }
]
}
]
}
80 changes: 80 additions & 0 deletions docs/spreadsheet/agent-guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
title: The Agent Surface
---

`@tanstack/spreadsheet-agent` is the one tool surface an agent calls against a
workbook. It is A1-addressed, reads the real dependency graph (no formula
re-parsing), returns plain data, and composes into any agent framework. There is
no second, library-shaped toolkit — this is the single door.

Above: the demo's `/agent` route. Claude writes a **Code Mode** program (TypeScript
run in a QuickJS-WASM sandbox in the browser) that calls this very tool surface —
`set_cells`, `read_sheet`, `verify` — to build and check the sheet. The model
completion runs server-side, so the API key never reaches the browser; the
generated code runs sandboxed in it.

## The tools

```ts
import {
setCells,
readSheet,
explain,
listErrors,
listPending,
listFunctions,
verify,
} from '@tanstack/spreadsheet-agent'

setCells(wb, [
{ a1: 'A1', input: '10' },
{ a1: 'A2', input: '=A1*2' },
]) // one batched transaction → one recalc

readSheet(wb, 's1') // [{ a1, input, value, kind }, …]
explain(wb, 'A2') // { value, input, precedents, precedentRanges, dependents } — all A1
listErrors(wb) // [{ a1, code }]
listPending(wb) // ['B3', …]
listFunctions(wb) // the function catalog (with origin + callSites)
```

`explain` reads `workbook.precedentsOf` / `dependentsOf` directly — it does not
re-parse formulas, and it follows the graph the engine actually computes on.

## Verify composition

`verify` is a **pure** function: it takes the (already settled) workbook plus
the caller's checks and returns a list of [`Issue`](./xlsx-fidelity.md)s — the
same shared type XLSX import produces. Sequencing is the caller's ordinary async
code, shown explicitly:

```ts
build(wb) // your edits, e.g. setCells(...)
await wb.settle() // let async cells resolve
const issues = verify(wb, {
sheet: 's1',
checks: [{ label: 'total is 30', ok: total(wb) === 30 }],
})
if (issues.length) {
/* failing checks + unexpected error cells, each with a message (and ref) */
}
```

There is no `buildAndVerify` hybrid: `verify` verifies, `settle` settles, and
your code composes them.

## Framework tool definitions

`spreadsheetTools(wb)` returns framework-agnostic specs
(`{ name, description, parameters, execute }`) you map onto your framework's tool
definition — e.g. TanStack AI's `toolDefinition`. The demo's `/agent` route
dogfoods exactly this surface: its `set_cells` / `read_sheet` / `verify` tool
bodies call these functions rather than re-implementing workbook access.

## With Code Mode

Authoring a Code Mode function (`@tanstack/spreadsheet-codemode`:
`stageFunction` → `approveAndRegister`) and calling the agent tools fit together:
the agent builds the sheet with `setCells`, authors a function (staged + example
-gated), a human approves registration, and `verify` confirms the result before
a diff is shown. Code Mode is authoring; the agent surface is read/edit/verify.
Loading
Loading