Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Environment:A5c ai Babysitter Node JS 20

From Leeroopedia
Knowledge Sources
Domains Infrastructure, Runtime
Last Updated 2026-10-23 00:00 GMT

Overview

Node.js 20+ runtime environment with TypeScript ES2022 compilation target, required by all Babysitter SDK, Kradle, and release pipeline implementations.

Description

This environment provides the foundational JavaScript/TypeScript runtime for the entire Babysitter monorepo. All packages target Node.js 20+ with TypeScript `ES2022` compilation and `NodeNext` module resolution. The runtime leverages Node.js built-in modules (`node:crypto`, `node:fs`, `node:async_hooks`, `node:child_process`) exclusively in core packages, with zero external runtime dependencies in Kradle core. The `AsyncLocalStorage` from `node:async_hooks` is used for process context propagation across asynchronous boundaries.

Usage

Use this environment for any Babysitter implementation — SDK runtime, process orchestration, release tooling, Kradle controllers, or trust-core cryptographic operations. It is the mandatory baseline prerequisite for running any package in the monorepo.

System Requirements

Category Requirement Notes
OS Linux / macOS / Windows Cross-platform; WSL2 recommended for Windows
Hardware 2+ CPU cores, 4GB RAM Sufficient for development; CI runners may need more
Disk 10GB SSD For node_modules, build artifacts, and test fixtures
Runtime Node.js >= 20.0.0 Required by all packages; ES2022 + NodeNext module resolution

Dependencies

System Packages

  • `node` >= 20.0.0
  • `npm` >= 10.0.0 (bundled with Node 20)
  • `git` (for workspace and release operations)

TypeScript Packages

  • `typescript` >= 5.4.2
  • `vitest` >= 4.0.18 (test runner)
  • `@types/node` >= 20.11.30

Key npm Dependencies

  • `@modelcontextprotocol/sdk` >= 1.12.1
  • `@sinclair/typebox` >= 0.34.48
  • `zod` >= 4.0.0
  • `fs-extra` >= 11.2.0
  • `ulid` >= 2.3.0

Credentials

The following environment variables are used by the runtime:

  • `BABYSITTER_RUNS_DIR`: Overrides the runs directory (optional)
  • `BABYSITTER_MAX_ITERATIONS`: Overrides session iteration budget (optional)
  • `BABYSITTER_QUALITY_THRESHOLD`: Overrides quality threshold (optional)
  • `BABYSITTER_LOG_LEVEL`: SDK log level (optional)
  • `BABYSITTER_EXECUTE_TASKS`: Enables shell/node task auto-execution (default OFF)
  • `BABYSITTER_CROSS_SUBAGENTS`: Enables cross-harness agent auto-dispatch (default OFF)
  • `AZURE_OPENAI_API_KEY`: Azure OpenAI API key (optional, for Azure deployments)

Quick Install

# Install Node.js 20+ (using nvm)
nvm install 20
nvm use 20

# Install all monorepo dependencies
npm install

# Build the SDK and core packages
npm run build:sdk

Code Evidence

TypeScript compilation target from `tsconfig.json:3-5`:

{
  "compilerOptions": {
    "strict": true,
    "target": "ES2022",
    "module": "NodeNext",
    "moduleResolution": "NodeNext"
  }
}

Node.js type requirement from `packages/trust-core/package.json:35`:

"@types/node": "^20.11.30"

AsyncLocalStorage usage in `packages/babysitter-sdk/src/runtime/processContext.ts:1,47`:

import { AsyncLocalStorage } from "async_hooks";
// ...
const contextStorage = new AsyncLocalStorage<InternalProcessContext>();

Kradle core Node 20+ requirement from `packages/kradle/core/CLAUDE.md`:

Pure ESM JavaScript (Node 20+, zero external deps in core)

Common Errors

Error Message Cause Solution
`MissingProcessContextError` Calling ctx.task/breakpoint outside a process context Ensure the call runs within `withProcessContext()` or an orchestrated process
`SyntaxError: Cannot use import statement outside a module` Running ESM without Node 20+ or without `"type": "module"` Upgrade to Node 20+ and ensure package.json has correct type field
`ERR_MODULE_NOT_FOUND` Missing node_modules or incorrect module resolution Run `npm install` and verify `NodeNext` module resolution in tsconfig

Compatibility Notes

  • Node.js < 20: Not supported. ES2022 target and `AsyncLocalStorage` APIs require Node 20+.
  • Windows: Works with WSL2; native Windows is not officially tested.
  • Deno/Bun: Not supported; the runtime depends on Node.js built-in modules (`node:crypto`, `node:async_hooks`, `node:child_process`).

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment