
Company News
Free Business Plan Upgrades for Open Source Maintainers
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.
@bilig/core
Advanced tools
Local-first spreadsheet engine core for bilig with calc, selection, and commit semantics.
Local-first spreadsheet engine core for bilig with calc, selection, and commit semantics.
npm install @bilig/core
import { SpreadsheetEngine, createSpreadsheetEngineFromDocument, exportSpreadsheetEngineDocument } from '@bilig/core'
const engine = new SpreadsheetEngine({ workbookName: 'Budget' })
await engine.ready()
engine.createSheet('Sheet1')
engine.setCellValue('Sheet1', 'A1', 10)
engine.setCellFormula('Sheet1', 'B1', 'A1*2')
const document = exportSpreadsheetEngineDocument(engine)
const restored = await createSpreadsheetEngineFromDocument(document, {
replicaId: 'restored-budget',
})
@bilig/core can execute generic plans produced by @bilig/workbook without
hardcoded business models:
import { createWorkbookRunAdapter, SpreadsheetEngine } from '@bilig/core'
import { runWorkbookAction } from '@bilig/workbook'
import { model } from './model.js'
const engine = new SpreadsheetEngine({ workbookName: 'Agent workbook' })
await engine.ready()
const result = await runWorkbookAction(model, 'calculate', createWorkbookRunAdapter(engine))
createWorkbookRunAdapter(engine) materializes generic plan.commands into
engine operations, including range and table-column writes. Formula commands use
the plan's explicit formula labels to replace table, row-filtered, name, and
range tokens with concrete cell references. The adapter also falls back to
explicit plan.ops for low-level plans, reads single-cell valueEquals and
formulaEquals targets, and verifies generic exists and noFormulaErrors
checks. Apply results include the stable workbookPlanId(plan), preview ops,
applied ops, per-command receipts, and a small proof object, so callers can
require plan-bound and command-bound runtime proof before trusting a run. When
undo is captured, the returned undo.ops are portable workbook operations that
can be applied by the runtime. Consumer-defined model semantics stay in the
model; the core adapter only handles workbook execution and proof.
@bilig/core exposes a canonical persistence surface for standalone engine usage:
exportSpreadsheetEngineDocument(engine)importSpreadsheetEngineDocument(engine, document)createSpreadsheetEngineFromDocument(document, options?)serializeSpreadsheetEngineDocument(document)parseSpreadsheetEngineDocument(json)The persisted document format stores:
snapshot: workbook semantic statereplica: optional replica/sync stateThis makes SpreadsheetEngine usable without Zero or any bilig app runtime.
./dist/index.js./dist/index.d.tsThis package is part of the bilig monorepo.
FAQs
Local-first spreadsheet engine core for bilig with calc, selection, and commit semantics.
The npm package @bilig/core receives a total of 1,048 weekly downloads. As such, @bilig/core popularity was classified as popular.
We found that @bilig/core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.