Skip to content

[PUBLISHED ON NPMJS] @takk/alkaline@1.0.0

Latest

Choose a tag to compare

@github-actions github-actions released this 18 Jun 17:42

STATUS: PUBLISHED ON NPMJS. This version was published to the npm registry on 2026-06-18T17:54:34Z with provenance attestation. View on npm: https://www.npmjs.com/package/@takk/alkaline/v/1.0.0

[1.0.0] - 2026-06-18T14:11:10Z

Initial stable release. Embeddable, zero-runtime-dependency durable execution for Massive Intelligence (IM) agents and non-human entities (NHEs): the durable workflow kernel you import instead of operate.

Added

Durable runtime

  • createRuntime(options) and defineWorkflow(definition): an in-process, event-sourced engine that runs a workflow to a terminal state or a stable suspension and survives a crash between any two ticks.
  • ctx.step(name, fn, options): a memoized step. On replay the recorded result is returned without re-running the effect; the successful outcome is therefore exactly-once.
  • Deterministic clock reads ctx.now(), ctx.random(), ctx.uuid(), recorded and replayed verbatim, plus an injectable Clock and a seeded manualClock for reproducible runs.
  • ctx.setState and per-workflow queries for read-only inspection of a live or suspended execution.

Opt-in retry policy

  • A zero-dependency RetryPolicy (maxAttempts, backoffMs, factor, maxBackoffMs) and a retryable predicate, configurable per step, per workflow, or per runtime.
  • Retry gives at-least-once execution of a step's effect while the memoized result keeps the successful outcome exactly-once. The default is a single attempt so a non-idempotent step never repeats by surprise. The attempt count is recorded in the step's history event, and the backoff delay is injectable for deterministic tests.

Loop prevention

  • Native graph cycle detection via depth headers: a workflow that re-enters its own ancestry fails with ERR_CYCLE_DETECTED, and a child chain past the configured depth fails with ERR_DEPTH_EXCEEDED.
  • An enforced token budget: ctx.spend(tokens, label) halts the execution with ERR_BUDGET_EXCEEDED the moment a charge would pass the declared budget.

Signals, queries, lifecycle, and continue-as-new

  • ctx.waitForSignal, runtime.signal, runtime.query, runtime.pause, runtime.resume, and runtime.cancel.
  • Child workflows via ctx.child, with a re-entrancy-guarded scheduler that blocks a parent on a suspended child and wakes it on completion.
  • ctx.continueAsNew(input): ends and restarts the same execution id with fresh input and an empty history, bounding long-horizon runs that would otherwise saturate a workflow log.

Swappable, rechargeable state cells (the battery)

  • A StateStore contract with four shipping cells, all zero-dependency: createMemoryStore (universal), createSqliteStore (built-in node:sqlite, Node 22.5+), and the dependency-injected createPostgresStore and createRedisStore, which take the client you already use and bundle no driver.
  • runtime.swapStore hot-swaps the cell and migrateStore recharges contents from one cell into another.

Multi-agent task board

  • createBoard (subpath @takk/alkaline/board): the NPM-standalone equivalent of the Hermes Agent Kanban. Tasks with explicit states (todo, in_progress, blocked, done, failed), claim and heartbeat, lease-based zombie reclaim, a cycle-checked dependency link graph, comments, and an append-only event log.

Entry points and tooling

  • Nine library entry points: core, ./store, ./sqlite, ./postgres, ./redis, ./board, ./replay, ./mcp, ./edge. The edge entry omits the SQLite cell and imports no Node built-in.
  • ./replay: inspectExecution, formatTrace, summarizeHistory, and historyDivergence for reading and debugging a durable trace.
  • ./mcp: durableTool and callTool, wrapping a Model Context Protocol tool call as a memoized, budget-charged step.
  • CLI alkaline (list, show) over a durable store.

Quality

  • 69 tests across 13 suites passing under Vitest 4, green on Node 20, 22, and 24.
  • Coverage: statements 88%, lines 88%, functions 93%, branches 73%.
  • TypeScript strict mode at maximum under TypeScript 6, lint and format clean under Biome 2, publint clean, are-the-types-wrong clean across all nine entry points.
  • All four state-store cells pass a shared conformance suite plus a suspend-and-resume workflow; the Postgres and Redis cells run against faithful in-memory client fakes.
  • The core, edge, board, replay, store, postgres, and redis bundles are verified free of any Node built-in; only the SQLite cell references node:sqlite, lazily.

Security

  • Published with --provenance (SLSA attestation by GitHub Actions). Consumers can verify via npm view @takk/alkaline --json | jq .dist.attestations.
  • The durable FailureInfo drops error stack traces. The Postgres and Redis cells issue only parameterized commands. See SECURITY.md.

Honest scope

  • Alkaline gives deterministic replay with divergence detection, not a sandbox: keep non-determinism inside the context and replay is faithful. It follows a single-writer model, the SQLite of durable workflows; distributed multi-writer leasing and a real-server Postgres and Redis integration matrix are on the roadmap.

Licensing

  • Licensed under the Apache License, Version 2.0. The NOTICE file ships in the tarball alongside LICENSE.

Engines

  • Node >=20.0.0. Tested on Node 20, 22, and 24.