No description
  • TypeScript 99.8%
  • JavaScript 0.2%
Find a file
Greg Konush 3f740671e8
Some checks failed
forgejo-ci / Core Repository CI (push) Successful in 8m45s
forgejo-ci / Browser E2E (push) Successful in 2m48s
forgejo-release-images / build-bilig-app-amd64 (push) Failing after 9m15s
forgejo-release-images / build-bilig-app-arm64 (push) Successful in 24m37s
forgejo-release-images / publish-multiarch-manifests (push) Has been skipped
fix(repo): harden runtime and clean stale debt
2026-08-30 18:58:58 -07:00
.agents/skills/bilig-workpaper chore(repo): eliminate unowned cleanup debris 2026-07-08 02:26:20 -07:00
.claude chore(repo): eliminate unowned cleanup debris 2026-07-08 02:26:20 -07:00
.clinerules docs(agent): make WorkPaper skill metadata primary 2026-06-25 01:23:30 -07:00
.continue fix(ci): restore green debt baseline 2026-06-28 16:35:23 -07:00
.copilot Add live spreadsheet sync path 2026-03-21 12:06:38 -07:00
.cursor docs(agent): make WorkPaper skill metadata primary 2026-06-25 01:23:30 -07:00
.devin/rules docs(discovery): align workpaper public surfaces 2026-06-25 07:39:42 -07:00
.forgejo fix(repo): harden runtime and clean stale debt 2026-08-30 18:58:58 -07:00
.github fix(repo): harden runtime and clean stale debt 2026-08-30 18:58:58 -07:00
.junie/mcp docs(discovery): add agent framework mcp recipes 2026-06-03 14:22:20 -07:00
.kiro docs(agent): make WorkPaper skill metadata primary 2026-06-25 01:23:30 -07:00
.opencode/agents docs(agent): make WorkPaper skill metadata primary 2026-06-25 01:23:30 -07:00
.roo docs(agent): make WorkPaper skill metadata primary 2026-06-25 01:23:30 -07:00
.trae docs(growth): remove stale xlsx public route 2026-06-25 02:30:47 -07:00
.vscode docs(agent): add copilot workpaper proof surface 2026-05-29 10:19:14 -07:00
.windsurf/rules docs(discovery): align workpaper public surfaces 2026-06-25 07:39:42 -07:00
.zed docs(agent): add Zed WorkPaper MCP setup 2026-06-03 23:20:44 -07:00
actions/xlsx-cache-doctor chore(release): runtime packages v0.164.11 2026-06-28 23:58:36 +00:00
apps fix(repo): harden runtime and clean stale debt 2026-08-30 18:58:58 -07:00
docker fix(ci): drop dead postgres publication mount 2026-04-07 10:42:35 -07:00
docs fix(repo): harden runtime and clean stale debt 2026-08-30 18:58:58 -07:00
e2e/tests fix(repo): harden runtime and clean stale debt 2026-08-30 18:58:58 -07:00
examples chore(repo): eliminate unowned cleanup debris 2026-07-08 02:26:20 -07:00
integrations/n8n-nodes-workpaper chore(repo): eliminate unowned cleanup debris 2026-07-08 02:26:20 -07:00
mcp docs(agent): add ChatGPT Apps MCP discovery 2026-06-02 18:05:48 -07:00
packages fix(repo): harden runtime and clean stale debt 2026-08-30 18:58:58 -07:00
scripts fix(repo): harden runtime and clean stale debt 2026-08-30 18:58:58 -07:00
skills/bilig-workpaper chore(repo): eliminate unowned cleanup debris 2026-07-08 02:26:20 -07:00
.aider.conf.yml docs(agent): add Aider WorkPaper conventions 2026-06-03 19:28:35 -07:00
.dependency-cruiser.cjs fix(runtime): harden trust and lifecycle boundaries 2026-08-08 02:45:28 -07:00
.dockerignore fix(repo): harden runtime and clean stale debt 2026-08-30 18:58:58 -07:00
.gitignore fix(repo): harden runtime and clean stale debt 2026-08-30 18:58:58 -07:00
.mcp.json docs(agent): add ChatGPT Apps MCP discovery 2026-06-02 18:05:48 -07:00
.node-version Align CI and engines to Node 24.11.1 2026-03-21 12:52:25 -07:00
.nvmrc Align CI and engines to Node 24.11.1 2026-03-21 12:52:25 -07:00
.oxfmtrc.json feat(integrations): add workflow formula readback channels 2026-05-20 21:09:31 -07:00
.oxlintrc.json fix(repo): harden runtime and clean stale debt 2026-08-30 18:58:58 -07:00
.release-please-manifest.json chore(release): runtime packages v0.164.11 2026-06-28 23:58:36 +00:00
action.yml chore(release): runtime packages v0.164.11 2026-06-28 23:58:36 +00:00
AGENTS.md chore(repo): eliminate unowned cleanup debris 2026-07-08 02:26:20 -07:00
CLAUDE.md docs(growth): clean package discovery metadata 2026-06-25 03:20:19 -07:00
CODE_OF_CONDUCT.md docs: add public support and security policies 2026-05-06 20:47:05 -07:00
compose.dev-local.yaml fix(dev): avoid local stack port collisions 2026-04-11 12:07:23 -07:00
compose.yaml fix(repo): harden runtime and clean stale debt 2026-08-30 18:58:58 -07:00
context7.json docs(agent): clean WorkPaper discovery copy 2026-05-29 23:28:16 -07:00
CONTRIBUTING.md chore(ci): remove stale proof surfaces 2026-07-03 11:00:42 -07:00
CONVENTIONS.md docs(agent): make WorkPaper skill metadata primary 2026-06-25 01:23:30 -07:00
Dockerfile fix(build): use dedicated deployment lockfile 2026-08-08 04:38:29 -07:00
gemini-extension.json chore(release): runtime packages v0.164.11 2026-06-28 23:58:36 +00:00
gemini-workpaper-context.md feat(agent): add Gemini CLI WorkPaper extension 2026-05-26 10:50:46 -07:00
glama.json chore(mcp): add glama maintainer metadata 2026-05-17 01:01:01 -07:00
knip.json fix(repo): harden runtime and clean stale debt 2026-08-30 18:58:58 -07:00
LAUNCHGUIDE.md docs(growth): align launch guide with cache doctor 2026-05-30 02:42:12 -07:00
LICENSE feat: build monorepo spreadsheet engine 2026-03-13 01:34:44 -07:00
llms-install.md fix(workpaper): harden public onboarding proof 2026-08-30 17:39:27 -07:00
opencode.jsonc chore(repo): eliminate unowned cleanup debris 2026-07-08 02:26:20 -07:00
package.json fix(runtime): harden trust and lifecycle boundaries 2026-08-08 02:45:28 -07:00
playwright.config.ts ci(browser): isolate webgpu e2e phase 2026-04-26 16:40:48 -07:00
playwright.prod.config.ts fix(zero): harden monolith stability 2026-04-01 23:13:57 -07:00
pnpm-lock.yaml fix(repo): harden runtime and clean stale debt 2026-08-30 18:58:58 -07:00
pnpm-workspace.yaml fix(repo): harden runtime and clean stale debt 2026-08-30 18:58:58 -07:00
README.md fix(workpaper): harden public onboarding proof 2026-08-30 17:39:27 -07:00
release-please-config.json ci(headless): add release workflow 2026-04-10 00:12:49 -07:00
SECURITY.md docs(community): tighten contributor onramp 2026-05-07 15:10:13 -07:00
SUPPORT.md docs: add public support and security policies 2026-05-06 20:47:05 -07:00
tsconfig.base.json Enforce stricter TypeScript and lint rules 2026-03-21 12:27:50 -07:00
tsconfig.json feat(excel-import): add wasm worksheet scan storage 2026-05-22 08:52:02 -07:00
tsconfig.workspace-paths.json chore(repo): burn down cleanup debt 2026-07-04 12:46:06 -07:00
vitest.config.ts chore(repo): burn down cleanup debt 2026-07-04 12:46:06 -07:00
vitest.workspace.ts chore(format): enforce oxfmt style defaults 2026-04-15 23:03:29 -07:00
workspace-resolution.generated.json chore(repo): burn down cleanup debt 2026-07-04 12:46:06 -07:00

Bilig

CI npm Node.js OpenSSF Scorecard License: MIT

Keep the workbook model. Run the rule in Node.

Bilig is a TypeScript-native, headless WorkPaper runtime for Node.js services, tests, and AI agents. Set inputs, recalculate formulas, read computed outputs, persist WorkPaper JSON, restore it, and verify the result—without driving Excel or a browser grid.

Docs · Quick start · TypeScript API · MCP · Examples · Discussions

A WorkPaper input edit recalculating a formula, then surviving JSON restore

Note

Bilig is a headless workbook runtime, not a visual spreadsheet app or a claim of full Excel compatibility. If an .xlsx file is your contract, start with the compatibility report.

Quick Start

Prove the published package before installing it:

npm exec --yes --package @bilig/workpaper@latest -- bilig-evaluate --door workpaper-service --json

The evaluator edits Inputs!B2, recalculates Summary!B2, saves the WorkPaper, restores it, and compares the restored value:

{
  "schemaVersion": "bilig-evaluator.v1",
  "door": "workpaper-service",
  "evidence": {
    "editedCell": "Inputs!B2",
    "dependentCell": "Summary!B2",
    "before": 24000,
    "after": 38400,
    "afterRestore": 38400
  },
  "verified": true
}

verified: true means the write, formula readback, JSON export, and restored readback all passed. It is stronger evidence than a successful write call.

Use It From TypeScript

npm install @bilig/workpaper
import { buildA1WorkPaper } from "@bilig/workpaper";

const pricing = buildA1WorkPaper({
  Inputs: [
    ["Metric", "Value"],
    ["Units", 20],
    ["Price", 1200],
  ],
  Summary: [
    ["Metric", "Value"],
    ["Revenue", "=Inputs!B2*Inputs!B3"],
  ],
});

const proof = pricing.editAndReadback("Inputs!B2", 32, {
  readbackRange: "Summary!B2",
});

console.log(proof.afterReadback.displayValues[0]?.[0]); // 38400
console.log(proof.verified); // true

pricing.dispose();

For ordinary operations, use set(), setMany(), readMany(), display(), and saveJson(). Use editManyAndReadback() when multiple inputs must be committed and verified as one edit. The complete public API is documented in packages/workpaper/README.md.

The lifecycle is deliberately small:

inputs → formula recalculation → typed readback → JSON persistence → restore verification

Why Bilig

Capability What it gives you
Workbook-shaped models Sheets, A1 addresses, formulas, ranges, and named expressions without a spreadsheet UI.
Verified mutations Before/after computed values plus persistence and restore checks.
Service-owned state Portable WorkPaper JSON for routes, queues, tests, tools, and audit trails.
Agent-safe tools Narrow read/write tools with exact cells, computed readback, and writable-sheet boundaries.
Explicit file boundaries Separate XLSX import, export, risk inspection, and Excel-oracle workflows.

Use Bilig for pricing, quote approval, payouts, forecasts, validation rules, formula-backed workflows, and tests where a service or tool should own the model. Choose a spreadsheet application or hosted spreadsheet API when you need visual editing, collaboration, macros, interactive pivots or charts, or desktop fidelity.

Agents And MCP

Agents should first ask which system owns state, then run the smallest matching proof. For a tool host or MCP client:

npm exec --yes --package @bilig/workpaper@latest -- bilig-agent-start --json
npm exec --yes --package @bilig/workpaper@latest -- bilig-evaluate --door agent-mcp --json

The MCP evaluator proves tool discovery, mutation, recalculated readback, JSON export, disk persistence, process restart, and restored readback. For a local, writable WorkPaper:

npm exec --yes --package @bilig/workpaper@latest -- bilig-workpaper-mcp --workpaper ./pricing.workpaper.json --init-demo-workpaper --writable

Use that local stdio path for private or persistent project state. The hosted https://bilig.proompteng.ai/mcp endpoint is request-local and only intended for stateless connector discovery and smoke tests; do not send private workbook data to it.

The server exposes list_sheets, read_range, read_cell, set_cell_contents, set_cell_contents_and_readback, get_cell_display_value, export_workpaper_document, and validate_formula. It also publishes MCP resources and prompts so capable hosts can discover the workflow before editing cells.

Machine-readable entry points:

Need Entry point
A compact routing card docs/agent-start.txt
A concise model index docs/llms.txt
Full agent documentation docs/llms-full.txt
Installation context docs/llms-install.md
Structured capabilities docs/agent.json
Reusable skill skills/bilig-workpaper/SKILL.md
Proof and host matrix docs/agent-adoption-kit.md

The published package also carries AGENTS.md and SKILL.md, so an agent can discover the same proof contract from node_modules. Install or inspect the public skill with either source:

npx --yes skills@latest add https://bilig.proompteng.ai --list
npx --yes skills@latest add proompteng/bilig --skill bilig-workpaper --list
Host-specific project files

Use the agent rule chooser or the host handoff prompt. The repository includes CLAUDE.md, .claude/skills/bilig-workpaper/SKILL.md, .claude/commands/bilig-workpaper-proof.md, .cursor/rules/bilig-workpaper.mdc, .devin/rules/bilig-workpaper.md, .windsurf/rules/bilig-workpaper.md, .clinerules/bilig-workpaper.md, .continue/rules/bilig-workpaper.md, .zed/settings.json, opencode.jsonc, and .opencode/agents/bilig-workpaper.md.

Integration Recipes After The Proof

Run an evaluator first, then use the recipe owned by your host:

  • OpenAI Agents SDK: direct tools, MCPServerStdio, and MCPServerStreamableHttp.
  • OpenAI Responses API: function-call readback with explicit before/after evidence.
  • Vercel AI SDK: generateText() and streamText() tool loops.
  • Open WebUI: local or hosted MCP discovery.
  • n8n: the @bilig/n8n-nodes-workpaper community node.

Choose An Evaluation Path

Your state owner Start here Evidence to require
TypeScript application npm install @bilig/workpaper direct A1 API and focused application tests
Node service, route, queue, or test bilig-evaluate --door workpaper-service --json edit, recalculation, JSON export, restore, verified: true
MCP client or tool host bilig-evaluate --door agent-mcp --json discovery, readback, disk persistence, restart
Imported .xlsx is the contract workbook-compatibility-report workbook.xlsx --json unsupported formulas and workbook risk reasons for that file
Cached .xlsx values look stale xlsx-cache-doctor workbook.xlsx --json stale-cache diagnosis, recalculation, and readback for that file

The workbook-compatibility and xlsx-cache evaluator doors use bundled demo workbooks to smoke-test the published package; they do not inspect your file. Do not treat any evaluator as proof of desktop Excel parity.

Examples And Deeper Guides

Start with one maintained example, not the whole monorepo:

Useful decision guides:

Runnable integration and diagnostic commands
pnpm --dir examples/headless-workpaper run agent:ai-sdk-generate-text
pnpm --dir examples/headless-workpaper run agent:ai-sdk-stream-text
pnpm --dir examples/headless-workpaper run agent:openai-responses
pnpm --dir examples/headless-workpaper run agent:mcp-xlsx-risk-preflight
pnpm --dir examples/serverless-workpaper-api run hono-route
pnpm --dir examples/serverless-workpaper-api run next-server-action
pnpm --dir examples/serverless-workpaper-api run next-server-action-formdata

The AI SDK generateText() smoke lives at ai-sdk-generate-text-tool-smoke.ts. The OpenAI example is documented in openai-responses-workpaper-tool-call.

For a reduced formula or import bug:

npm exec --yes --package @bilig/workpaper@latest -- bilig-formula-clinic ./reduced.xlsx --cells "Summary!B7,Inputs!B2"

XLSX And Excel Compatibility

Bilig can import and export workbook files, but cached formula values inside an .xlsx are diagnostics—not an accuracy oracle. Inspect the file before trusting it:

npm exec --yes --package @bilig/xlsx-formula-recalc@latest -- bilig-evaluate --door workbook-compatibility --json
npm exec --yes --package @bilig/xlsx-formula-recalc@latest -- workbook-compatibility-report workbook.xlsx --json
npm exec --yes --package @bilig/xlsx-formula-recalc@latest -- xlsx-cache-doctor workbook.xlsx --json

The first command is a package smoke test over a bundled demo. The next two inspect the named file. The compatibility report identifies unsupported functions, external links, macros, pivots, volatile formulas, and other risks; it does not certify Excel compatibility. When correctness matters, compare against a workbook freshly recalculated by Excel. See the compatibility limits and Excel oracle walkthrough.

Packages And Repository Map

Path Role
packages/workpaper Recommended @bilig/workpaper API, evaluators, AI SDK adapter, MCP server, and XLSX boundary.
packages/headless Lower-level WorkPaper runtime and integration primitives.
packages/xlsx-formula-recalc Real-file compatibility and stale-cache diagnostics.
packages/formula Formula parser, binder, compiler, and evaluator.
packages/core Workbook state, mutations, snapshots, and scheduling.
apps/web Browser spreadsheet shell.
apps/bilig Full-stack runtime, APIs, and static site host.

The public package requires Node.js >=22. Local monorepo development uses Node.js 24+, Bun, and pnpm@10.32.1.

Published releases include npm registry signatures and provenance attestations:

npm view @bilig/workpaper version dist.attestations dist.signatures --json
npm audit signatures

Development

Choose one long-running development server:

pnpm dev:web
pnpm dev:web-local

Install and validate the repository with:

pnpm install
pnpm build
pnpm lint
pnpm typecheck
pnpm test
pnpm run ci

Architecture lives in docs/architecture.md. Read CONTRIBUTING.md before opening a pull request; first-time contributors can start with the new contributor guide and starter issues. All participation follows the CODE_OF_CONDUCT.md.

Support And Security

If Bilig fits one of your services or agent workflows, star the repository to follow releases and help other Node developers find it. Tell us what proof or formula is still missing.

License

MIT