Why it matters
Bilig addresses a critical need for AI agents and Node.js services that require robust, verifiable spreadsheet functionality without human intervention. Its ability to handle complex formula recalculations and persist state as JSON makes it ideal for automating tasks like pricing rules, budget checks, and import validation within AI workflows, ensuring accuracy and auditability.

Bilig is a TypeScript-based library designed to integrate spreadsheet formula recalculation capabilities into Node.js services and AI agent tools. It allows developers to programmatically interact with workbooks, including editing cell values, triggering formula recalculations, and verifying the computed results. The library supports reading and writing workbook states, persisting them as JSON, and handling XLSX files. This functionality is particularly useful for scenarios where calculations need to be performed in a server-side environment, a queue worker, a serverless function, or as a tool for a coding agent, eliminating the need for a graphical spreadsheet interface.

Key features of Bilig include: * **Headless Operation:** Performs spreadsheet operations without a UI, suitable for backend services and automated agents. * **Formula Recalculation:** Accurately recalculates formulas after input changes, supporting complex spreadsheet logic. * **State Management:** Allows workbooks to be built, inputs written, results read, and the entire state saved as JSON. * **XLSX Compatibility:** Integrates with existing SheetJS/xlsx pipelines to process and update formula values in XLSX files. * **Agent Tooling:** Provides an agent contract with read, write, recalculate, persist, and restore functionalities, along with a compact proof object for verification.

Bilig is suitable for applications such as pricing engines, budget validation systems, payout models, and data import validation where spreadsheet logic needs to be executed programmatically and verifiably. It is available as scoped `@bilig/` packages, with `@bilig/workpaper` recommended for service-owned workbook state and `@bilig/xlsx` for recalculating stale XLSX formula values.

Share:XHacker NewsLink
Article ID - cmpjjw8oz0