Environment:1jehuang Jcode Node js
| Knowledge Sources | |
|---|---|
| Domains | SDK, API_Design |
| Last Updated | 2026-10-18 00:00 GMT |
Overview
Node.js >= 20 runtime for the @1jehuang/jcode-sdk TypeScript SDK, providing the JavaScript environment for embedding jcode as a coding agent engine.
Description
The Node.js environment provides the JavaScript runtime for the jcode TypeScript SDK. The SDK package (@1jehuang/jcode-sdk) requires Node.js >= 20 (declared in engines.node) and uses TypeScript 5.7+ for type-safe development. The SDK connects to the jcode daemon via Unix domain socket (or named pipes on Windows), using NDJSON line framing for the wire protocol. Platform-specific binary packages are distributed as optional dependencies for darwin-arm64/x64, linux-arm64/x64, and win32-arm64/x64.
Usage
Use this environment for JcodeClient — the TypeScript SDK that embeds jcode as a coding agent engine. The SDK supports launching a private daemon instance (launch()) or connecting to an existing one (connect()). It is the mandatory prerequisite for any Node.js or TypeScript application that wants to programmatically control jcode sessions.
System Requirements
| Category | Requirement | Notes |
|---|---|---|
| OS | Cross-platform | Linux, macOS, Windows (via named pipes) |
| Hardware | Any | Network-bound to daemon socket |
| Disk | ~50MB for SDK + platform binary | npm install @1jehuang/jcode-sdk
|
Dependencies
System Packages
- Node.js >= 20 (required by
engines.node)
NPM Packages
- `@1jehuang/jcode-sdk` = 1.2.0 (main SDK)
- `ajv` = ^8.20.0 (JSON Schema validation for structured output)
- `typescript` = ^5.7.2 (dev dependency, for building from source)
- `@types/node` = ^22.10.2 (dev dependency)
Platform-Specific Optional Dependencies
- `@1jehuang/jcode-darwin-arm64` (macOS ARM)
- `@1jehuang/jcode-darwin-x64` (macOS Intel)
- `@1jehuang/jcode-linux-arm64` (Linux ARM)
- `@1jehuang/jcode-linux-x64` (Linux Intel)
- `@1jehuang/jcode-win32-arm64` (Windows ARM)
- `@1jehuang/jcode-win32-x64` (Windows Intel)
Credentials
No SDK-level credentials. Provider API keys are managed by the jcode daemon, not the SDK client.
Quick Install
# Install the SDK
npm install @1jehuang/jcode-sdk
# Or with yarn:
yarn add @1jehuang/jcode-sdk
# Build from source (for contributors):
cd sdk/typescript
npm install
npm run build
Code Evidence
Node.js engine requirement from sdk/typescript/package.json:21-22:
"engines": {
"node": ">=20"
}
AJV dependency for structured output validation from sdk/typescript/package.json:57-59:
"dependencies": {
"ajv": "^8.20.0"
}
Platform-specific optional dependencies from sdk/typescript/package.json:60-67:
"optionalDependencies": {
"@1jehuang/jcode-darwin-arm64": "1.2.0",
"@1jehuang/jcode-darwin-x64": "1.2.0",
"@1jehuang/jcode-linux-arm64": "1.2.0",
"@1jehuang/jcode-linux-x64": "1.2.0",
"@1jehuang/jcode-win32-arm64": "1.2.0",
"@1jehuang/jcode-win32-x64": "1.2.0"
}
Common Errors
| Error Message | Cause | Solution |
|---|---|---|
| `Unsupported engine` | Node.js < 20 | Upgrade Node.js: nvm install 20
|
| `Cannot find module @1jehuang/jcode-linux-x64` | Platform binary missing | Run npm install with --optional enabled
|
| `ECONNREFUSED` on socket | Daemon not running | Start jcode daemon first or use JcodeClient.launch()
|
Compatibility Notes
- All platforms: Platform-specific binaries are optional dependencies auto-selected by npm based on
os/cpu. - Windows: Uses named pipes instead of Unix domain sockets for daemon communication.
- TypeScript: SDK ships pre-compiled
dist/— no TypeScript compiler needed at runtime.