@bilig/workpaper 0.161.0 → 0.164.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/AGENTS.md CHANGED
@@ -25,13 +25,27 @@ Use this file when an AI coding agent, MCP client, or tool host needs workbook f
25
25
  `.claude/commands/bilig-workpaper-proof.md`.
26
26
  10. If you are using OpenCode, use `opencode.jsonc` and
27
27
  `.opencode/agents/bilig-workpaper.md`.
28
- 11. If you are using Cursor, Windsurf/Cascade, Cline, or Continue, use
28
+ 11. If you are using Aider, load `CONVENTIONS.md` through
29
+ `.aider.conf.yml`.
30
+ 12. If you are using OpenHands, read `AGENTS.md`, then the project skill at
31
+ `.agents/skills/bilig-workpaper/SKILL.md`; add the local MCP server with
32
+ `https://proompteng.github.io/bilig/openhands-workpaper-mcp.html`.
33
+ 13. If you are using Goose, start from the local recipe at
34
+ `examples/goose-workpaper-mcp/recipe.yaml` and the proof guide at
35
+ `https://proompteng.github.io/bilig/goose-workpaper-mcp.html`.
36
+ 14. If you are using Cursor, Kiro, Trae, Qodo IDE, Zed, Windsurf/Cascade, Cline, or Continue, use
29
37
  `.cursor/rules/bilig-workpaper.mdc` or
38
+ `.kiro/steering/bilig-workpaper.md`,
39
+ `.trae/rules/bilig-workpaper.md` with `.trae/mcp.json`,
40
+ `https://proompteng.github.io/bilig/qodo-workpaper-mcp.html` for Qodo Agentic Tools MCP JSON,
41
+ `.zed/settings.json`,
30
42
  `.devin/rules/bilig-workpaper.md`,
31
43
  `.windsurf/rules/bilig-workpaper.md`,
32
44
  `.clinerules/bilig-workpaper.md`, or
33
- `.continue/rules/bilig-workpaper.md`.
34
- 12. Start the MCP server or import `@bilig/workpaper` directly.
45
+ `.continue/rules/bilig-workpaper.md`. Continue Agent mode can also use
46
+ `.continue/mcpServers/bilig-workpaper.yaml` for the project-local
47
+ file-backed WorkPaper MCP server.
48
+ 15. Start the MCP server or import `@bilig/workpaper` directly.
35
49
 
36
50
  Remote MCP clients that support Streamable HTTP can smoke-test the stateless
37
51
  demo endpoint at `https://bilig.proompteng.ai/mcp`. Directory scanners that inspect the
@@ -72,6 +86,7 @@ npm exec --package @bilig/workpaper@latest -- bilig-agent-challenge --json
72
86
  npm exec --package @bilig/workpaper@latest -- bilig-mcp-challenge --json
73
87
  npm exec --package @bilig/workpaper@latest -- bilig-workpaper-mcp --workpaper ./pricing.workpaper.json --init-demo-workpaper --writable
74
88
  npm exec --package @bilig/workpaper@latest -- bilig-workpaper-mcp --from-xlsx ./pricing.xlsx
89
+ pnpm --dir examples/headless-workpaper run agent:mcp-xlsx-risk-preflight
75
90
  npm exec --package @bilig/workpaper@latest -- bilig-formula-clinic ./reduced.xlsx --cells "Summary!B7,Inputs!B2"
76
91
  ```
77
92
 
@@ -82,7 +97,11 @@ Claude Desktop users can install the released MCPB bundle from:
82
97
 
83
98
  ## Direct TypeScript
84
99
 
85
- Use `WorkPaper.buildFromSheets()` for hand-authored models, `setCellContents()` for edits, `getCellDisplayValue()` for readback, and `exportWorkPaperDocument()` plus `serializeWorkPaperDocument()` for persistence proof.
100
+ Use `buildA1WorkPaper()` for hand-authored models. Prefer
101
+ `book.set("Inputs!B2", value)`, `book.display("Summary!B2")`, and
102
+ `book.editAndReadback("Inputs!B2", value, { readbackRange: "Summary!B2" })`
103
+ before reaching for lower-level sheet ids or zero-based `{ row, col }`
104
+ addresses.
86
105
 
87
106
  ## Boundaries
88
107
 
package/README.md CHANGED
@@ -1,7 +1,6 @@
1
1
  # @bilig/workpaper
2
2
 
3
- WorkPaper API, CLI evaluator, and MCP server for headless spreadsheet formulas
4
- in Node.js services and agents.
3
+ Bilig WorkPaper is an API, CLI evaluator, and MCP server for headless spreadsheet formulas in Node.js services and agents.
5
4
 
6
5
  Use this when business logic is easiest to review as workbook cells and
7
6
  formulas, but the calculation needs to run in a backend service, queue worker,
@@ -48,7 +47,7 @@ The useful output is not a write-call status. It is readback proof:
48
47
  "door": "agent-mcp",
49
48
  "verified": true,
50
49
  "packageVersions": {
51
- "@bilig/workpaper": "0.153.0"
50
+ "@bilig/workpaper": "0.163.0"
52
51
  },
53
52
  "evidence": {
54
53
  "scenario": "revenue-plan",
@@ -127,9 +126,9 @@ not the first-run path:
127
126
  ## Use A WorkPaper In Node
128
127
 
129
128
  ```ts
130
- import { WorkPaper } from '@bilig/workpaper'
129
+ import { buildA1WorkPaper } from '@bilig/workpaper'
131
130
 
132
- const workbook = WorkPaper.buildFromSheets({
131
+ const book = buildA1WorkPaper({
133
132
  Inputs: [
134
133
  ['Metric', 'Value'],
135
134
  ['Units', 40],
@@ -141,44 +140,29 @@ const workbook = WorkPaper.buildFromSheets({
141
140
  ],
142
141
  })
143
142
 
144
- function cell(address: string) {
145
- const parsed = workbook.simpleCellAddressFromString(address)
146
-
147
- if (parsed === undefined) {
148
- throw new Error(`Unknown cell: ${address}`)
149
- }
150
-
151
- return parsed
152
- }
153
-
154
- function setCell(address: string, value: string | number | boolean | null) {
155
- workbook.setCellContents(cell(address), value)
156
- }
157
-
158
- function displayAt(address: string) {
159
- return workbook.getCellDisplayValue(cell(address))
160
- }
161
-
162
- const before = displayAt('Summary!B2')
163
-
164
- setCell('Inputs!B2', 48)
165
- setCell('Inputs!B3', 1500)
166
-
167
- const after = displayAt('Summary!B2')
168
- const document = workbook.exportSnapshot()
143
+ const proof = book.editAndReadback('Inputs!B2', 48, {
144
+ readbackRange: 'Summary!B2',
145
+ })
169
146
 
170
147
  console.log({
171
- editedCells: ['Inputs!B2', 'Inputs!B3'],
172
- readCell: 'Summary!B2',
173
- before,
174
- after,
175
- persistedDocumentBytes: JSON.stringify(document).length,
176
- verified: after === '72000',
148
+ editedCell: proof.editedCell,
149
+ before: proof.beforeReadback.displayValues,
150
+ after: proof.afterReadback.displayValues,
151
+ afterRestore: proof.restoredReadback.displayValues,
152
+ persistedDocumentBytes: proof.persistedDocumentBytes,
153
+ verified: proof.verified,
177
154
  })
178
155
 
179
- workbook.dispose()
156
+ book.dispose()
180
157
  ```
181
158
 
159
+ Use `book.set('Inputs!B2', 48)`, `book.setMany({ 'Inputs!B3': 1500 })`,
160
+ `book.readMany(['Inputs!B2', 'Summary!B2'])`, `book.display('Summary!B2')`,
161
+ and `book.saveJson()` when you do not need the full proof object. Use
162
+ `book.editManyAndReadback()` when several inputs should commit as one atomic
163
+ proof with typed readback comparison, formula diagnostics, persistence, and
164
+ restore checks.
165
+
182
166
  ## Use WorkPaper Tools With The Vercel AI SDK
183
167
 
184
168
  Install the AI SDK and Zod in the application that owns the agent loop:
package/SKILL.md CHANGED
@@ -119,6 +119,12 @@ WorkPaper. Without `--workpaper --writable`, edits stay in memory; add a
119
119
  WorkPaper JSON path only when the task needs persisted file state. It does not
120
120
  certify Excel compatibility.
121
121
 
122
+ For a maintained XLSX preflight transcript, run
123
+ `pnpm --dir examples/headless-workpaper run agent:mcp-xlsx-risk-preflight`.
124
+ It requires `analyze_workbook_risk`, `set_cell_contents_and_readback`,
125
+ `export_workpaper_document`, `Inputs!B3`, `Summary!B3`, `60000 -> 96000`,
126
+ and `verified: true`.
127
+
122
128
  After a write, always read the dependent output cell and export the WorkPaper
123
129
  document. If the listed tool set includes `set_cell_contents_and_readback`,
124
130
  prefer it for stateless clients because the edit and dependent readback happen
@@ -142,9 +148,9 @@ stdio command when the workflow must persist a project WorkPaper JSON file.
142
148
  Use `@bilig/workpaper` directly when workbook logic belongs in a service, queue worker, test, or route:
143
149
 
144
150
  ```ts
145
- import { WorkPaper, exportWorkPaperDocument, serializeWorkPaperDocument } from '@bilig/workpaper'
151
+ import { buildA1WorkPaper } from '@bilig/workpaper'
146
152
 
147
- const workbook = WorkPaper.buildFromSheets({
153
+ const book = buildA1WorkPaper({
148
154
  Inputs: [
149
155
  ['Metric', 'Value'],
150
156
  ['Customers', 20],
@@ -156,17 +162,19 @@ const workbook = WorkPaper.buildFromSheets({
156
162
  ],
157
163
  })
158
164
 
159
- const inputs = workbook.getSheetId('Inputs')
160
- const summary = workbook.getSheetId('Summary')
161
- if (inputs === undefined || summary === undefined) {
162
- throw new Error('Workbook is missing required sheets')
163
- }
165
+ const proof = book.editAndReadback('Inputs!B2', 32, {
166
+ readbackRange: 'Summary!B2',
167
+ })
164
168
 
165
- workbook.setCellContents({ sheet: inputs, row: 1, col: 1 }, 32)
166
- const revenue = workbook.getCellDisplayValue({ sheet: summary, row: 1, col: 1 })
167
- const saved = serializeWorkPaperDocument(exportWorkPaperDocument(workbook, { includeConfig: true }))
169
+ console.log({
170
+ editedCell: proof.editedCell,
171
+ after: proof.afterReadback.displayValues,
172
+ afterRestore: proof.restoredReadback.displayValues,
173
+ persistedDocumentBytes: proof.persistedDocumentBytes,
174
+ verified: proof.verified,
175
+ })
168
176
 
169
- console.log({ revenue, savedBytes: saved.length })
177
+ book.dispose()
170
178
  ```
171
179
 
172
180
  ## XLSX Formula Clinic
@@ -213,6 +221,7 @@ If any readback step fails, report the blocker instead of claiming the workbook
213
221
  - MCP server guide: https://proompteng.github.io/bilig/mcp-workpaper-tool-server.html
214
222
  - OpenHands MCP setup: https://proompteng.github.io/bilig/openhands-workpaper-mcp.html
215
223
  - OpenCode MCP setup: https://proompteng.github.io/bilig/opencode-workpaper-mcp.html
224
+ - Goose MCP recipe: https://proompteng.github.io/bilig/goose-workpaper-mcp.html
216
225
  - Open WebUI tool setup: https://proompteng.github.io/bilig/open-webui-workpaper-mcp.html
217
226
  - LobeHub MCP setup: https://proompteng.github.io/bilig/lobehub-workpaper-mcp.html
218
227
  - AnythingLLM MCP setup: https://proompteng.github.io/bilig/anythingllm-workpaper-mcp.html
@@ -1,4 +1,2 @@
1
1
  #!/usr/bin/env node
2
- const { runBiligEvaluatorCli } = await import('@bilig/xlsx-formula-recalc/evaluator')
3
-
4
- process.exitCode = runBiligEvaluatorCli(process.argv.slice(2))
2
+ await import('../dist/evaluator-bin.js')
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { runBiligEvaluatorCli } from './evaluator.js';
3
+ process.exitCode = await runBiligEvaluatorCli(process.argv.slice(2));
4
+ //# sourceMappingURL=evaluator-bin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evaluator-bin.js","sourceRoot":"","sources":["../src/evaluator-bin.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAErD,OAAO,CAAC,QAAQ,GAAG,MAAM,oBAAoB,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { biligEvaluatorSchemaVersion, buildBiligEvaluatorProof, listBiligEvaluatorDoors, runBiligEvaluatorCli } from 'bilig-workpaper';
2
+ export type { BiligEvaluatorCliContext, BiligEvaluatorDoor, BiligEvaluatorDoorSummary, BiligEvaluatorEvidence, BiligEvaluatorProof, BiligEvaluatorScenario, } from 'bilig-workpaper';
@@ -0,0 +1,2 @@
1
+ export { biligEvaluatorSchemaVersion, buildBiligEvaluatorProof, listBiligEvaluatorDoors, runBiligEvaluatorCli } from 'bilig-workpaper';
2
+ //# sourceMappingURL=evaluator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evaluator.js","sourceRoot":"","sources":["../src/evaluator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA"}
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@bilig/workpaper",
3
- "version": "0.161.0",
4
- "description": "WorkPaper API, CLI evaluator, and MCP server for headless spreadsheet formulas in Node.js services and agents.",
3
+ "version": "0.164.1",
4
+ "description": "Bilig WorkPaper API, CLI evaluator, and MCP server for headless spreadsheet formulas in Node.js services and agents.",
5
5
  "keywords": [
6
6
  "agent-tools",
7
7
  "ai-agents",
8
8
  "bilig",
9
+ "bilig-workpaper",
9
10
  "excel-formulas",
10
11
  "formula-engine",
11
12
  "headless-spreadsheet",
@@ -25,6 +26,7 @@
25
26
  "spreadsheet-formulas",
26
27
  "workbook",
27
28
  "workbook-agent",
29
+ "workbook-api",
28
30
  "workpaper",
29
31
  "xlsx"
30
32
  ],
@@ -76,6 +78,11 @@
76
78
  "import": "./dist/mcp.js",
77
79
  "default": "./dist/mcp.js"
78
80
  },
81
+ "./evaluator": {
82
+ "types": "./dist/evaluator.d.ts",
83
+ "import": "./dist/evaluator.js",
84
+ "default": "./dist/evaluator.js"
85
+ },
79
86
  "./xlsx": {
80
87
  "types": "./dist/xlsx.d.ts",
81
88
  "import": "./dist/xlsx.js",
@@ -89,9 +96,9 @@
89
96
  "build": "pnpm --dir ../.. --filter bilig-workpaper build && rm -rf dist tsconfig.tsbuildinfo && tsc -p tsconfig.json"
90
97
  },
91
98
  "dependencies": {
92
- "@bilig/headless": "0.161.0",
93
- "@bilig/xlsx-formula-recalc": "0.161.0",
94
- "bilig-workpaper": "0.161.0"
99
+ "@bilig/headless": "0.164.1",
100
+ "@bilig/xlsx-formula-recalc": "0.164.1",
101
+ "bilig-workpaper": "0.164.1"
95
102
  },
96
103
  "devDependencies": {
97
104
  "ai": "6.0.195",
package/server.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "name": "io.github.proompteng/bilig-workpaper",
4
4
  "title": "Bilig WorkPaper",
5
5
  "description": "Formula readback, input edits, JSON persistence, and workbook risk preflight for agents.",
6
- "version": "0.161.0",
6
+ "version": "0.164.1",
7
7
  "repository": {
8
8
  "url": "https://github.com/proompteng/bilig",
9
9
  "source": "github"
@@ -18,7 +18,7 @@
18
18
  {
19
19
  "registryType": "npm",
20
20
  "identifier": "@bilig/workpaper",
21
- "version": "0.161.0",
21
+ "version": "0.164.1",
22
22
  "transport": {
23
23
  "type": "stdio"
24
24
  }