Skip to content

Releases: zh30/amberjs

Release v1.16.0

Choose a tag to compare

@zh30 zh30 released this 16 Sep 08:27

Beejs v1.16.0

Release date: 2026-09-16

Highlights

  • Wasm Engine 2.0 zero-copy memory between WebAssembly.Memory and V8 ArrayBuffer, plus mmap module load and require('bee:wasm').
  • Production bee bundle (oxc) and bee compile single-file executables.
  • Full-spectrum benchmark suite 2.0 (24 in-process workloads, Fetch/SQLite, bee:ai.Tensor).
  • URL, fetch(), and ReadableStream hot-path RSI: all three now beat Node.js on the suite 2.0 workloads.

Performance

Workload Before After (v1.16.0)
URL + URLSearchParams (20k) 234 ms (19.6x slower than Node) 7.28 ms (faster than Node)
fetch 100 sequential GETs 1452 ms (43.7x slower than Node) 6.51 ms (faster than Node)
ReadableStream 5k chunks 4.53 ms (4.4x slower than Node) 0.92 ms (faster than Node)

Node.js Conformance 5.0 remains 55/55 PASS.


📦 预编译二进制资产与 SHA-256 校验和

资产文件名 目标系统 / 架构 文件大小 SHA-256 校验和
bee-v1.16.0-aarch64-apple-darwin.tar.gz macOS Apple Silicon (ARM64) 23.0 MB 87c2ba4f824fd94afff033f23df64bbb1445c38019110960400df6a2276f5b8e
bee-v1.16.0-aarch64-unknown-linux-gnu.tar.gz Linux (aarch64) 26.2 MB 91fbb2a4bd7d8a532489542b0c425180efd04d740295a2d03491fa31e2127799
bee-v1.16.0-x86_64-apple-darwin.tar.gz macOS Intel (x86_64) 24.2 MB 1778f09fb344290b79f23464c25ae2ff8ac3cc42951d59fe601196fbe2e4bbe1
bee-v1.16.0-x86_64-pc-windows-msvc.zip Windows (x86_64) 22.3 MB cb9365e311da60310ec151f236dd5dd3ac23e04e9918894c5398430a093e0d6e
bee-v1.16.0-x86_64-unknown-linux-gnu.tar.gz Linux (x86_64) 25.6 MB b21daedb68a127f32d1e4fcda090cfc28e4ea9ebd2c6712630df88f530cb01e7

校验方法

# 下载对应架构压缩包与 checksums.txt 后执行:
shasum -a 256 -c checksums.txt
# 或 Linux 环境下:
sha256sum -c checksums.txt

Release v1.9.1

Choose a tag to compare

@github-actions github-actions released this 11 Sep 02:37

Beejs v1.9.1 Release Notes: infrastructure second wave

Release Tag: v1.9.1
Release Type: Patch
Date: 2026-09-10

v1.9.1 closes the second-wave runtime supporting facilities from IMPLEMENTATION_PLAN_v1.9.1.md.

Highlights

  • Windows MSVC is a required Release target (bee-v1.9.1-x86_64-pc-windows-msvc.zip containing bee.exe).
  • bee serve --https speaks HTTP/1.1 over rustls. Missing --cert/--key exits non-zero.
  • bee run --inspect-brk waits for DevTools, serves GET /json/version, and evaluates Runtime.evaluate on the isolate.
  • process.dlopen calls napi_register_module_v1 for a C hello addon. Experimental; not Prisma/sharp.
  • TypeScript stacks name .ts lines. bee test --parallel exits 2.
  • rustc 1.97.1, fail-closed cargo-audit, cargo deny. GHCR is linux/amd64 only.
  • Homebrew formula hashes are rewritten from GitHub Release archives. V8 stays rusty_v8 0.22.

Install

curl -fsSL https://bee.zhanghe.dev/install.sh | sh
brew install zh30/tap/bee

Windows:

irm https://bee.zhanghe.dev/install.ps1 | iex

GHCR: ghcr.io/zh30/beejs:1.9.1 (linux/amd64 only).


📦 预编译二进制资产与 SHA-256 校验和

资产文件名 目标系统 / 架构 文件大小 SHA-256 校验和
bee-v1.9.1-aarch64-apple-darwin.tar.gz macOS Apple Silicon (ARM64) 11.6 MB e1d90bb30d0a4912675410b4625089827fc7d62b7e9d91821bd5bdb22388848e
bee-v1.9.1-aarch64-unknown-linux-gnu.tar.gz Linux (aarch64) 13.1 MB cc7c1a40139b5fe7ce081aae84371b370427e7c7cb535d8ba97f91e5c114783a
bee-v1.9.1-x86_64-apple-darwin.tar.gz macOS Intel (x86_64) 12.7 MB e97a01a7e6791b350685df646767b209d3557cf3968b948064a15095351d15f4
bee-v1.9.1-x86_64-pc-windows-msvc.zip Windows (x86_64) 11.4 MB 35d744ab8bdc17b2396cd4c3395f7321ce3c554ef8454b7c595e581710d4d66c
bee-v1.9.1-x86_64-unknown-linux-gnu.tar.gz Linux (x86_64) 13.4 MB e2ecbe29f3a7419bb085e54ef13d852ffb73c89b1f636a7adbad2cd187b2b445

校验方法

# 下载对应架构压缩包与 checksums.txt 后执行:
shasum -a 256 -c checksums.txt
# 或 Linux 环境下:
sha256sum -c checksums.txt

Release v1.9.0

Choose a tag to compare

@github-actions github-actions released this 09 Sep 16:12
6057f77

Beejs v1.9.0 Release Notes: WinterTC baseline, TLS sockets, and runtime release infrastructure

Release Tag: v1.9.0
Release Type: Minor Release
Date: 2026-09-09


Overview

Beejs v1.9.0 closes the WinterTC baseline on the default runtime and ships the GitHub Release / CI / install matrix a language runtime needs.

  1. WinterTC (ECMA-429 / TR-114): DOMException, URLPattern, navigator, queuing strategies, ReadableStream.from, bee:sockets, wintercg/wintertc export conditions, and import.meta.main / env / resolve.
  2. TLS sockets: rustls client with Mozilla webpki roots. secureTransport: "on" and startTls() perform a real handshake. Untrusted certificates fail; they do not silently stay in the clear.
  3. Release infrastructure: v* tags publish linux gnu x64/arm64, macOS arm64/x64, and Windows x64 archives, with SHA-256 checksums, CycloneDX SBOM, and cosign signatures. install.sh maps Darwin/Linux x64 and arm64; Windows uses install.ps1. Homebrew formula lives at Formula/bee.rb. GHCR publishes ghcr.io/zh30/beejs.

Runtime

const { connect } = require('bee:sockets');
const socket = connect({ hostname: 'example.com', port: 443 }, { secureTransport: 'on' });
await socket.opened;
  • import.meta.resolve('pkg') uses the same ESM resolver as require / import, so "wintercg" exports beat "node".
  • Unhandled promise rejections dispatch PromiseRejectionEvent on onunhandledrejection.

Install

curl -fsSL https://bee.zhanghe.dev/install.sh | sh
brew install zh30/tap/bee

Windows:

irm https://bee.zhanghe.dev/install.ps1 | iex

Compatibility

v1.9.0 is additive. v1.8.0 bee:bus, bee:grammar, and bee:checkpoint APIs are unchanged.

Live GitHub Release assets, GHCR images, and Homebrew bottle hashes appear after the v1.9.0 tag is pushed.


📦 预编译二进制资产与 SHA-256 校验和

资产文件名 目标系统 / 架构 文件大小 SHA-256 校验和
bee-v1.9.0-aarch64-apple-darwin.tar.gz macOS Apple Silicon (ARM64) 11.5 MB bfe216eac220a46ace8307cc1f6e777d57f8e0a78513f8d4b35e2d9ee6f6c788
bee-v1.9.0-aarch64-unknown-linux-gnu.tar.gz Linux (aarch64) 13.0 MB 294094e2f1ef13a319cb22517a7cf5e96b635cd5023345a9a79b698906f0be1f
bee-v1.9.0-x86_64-apple-darwin.tar.gz macOS Intel (x86_64) 12.6 MB 16caa07b07c28980419b125a86952c8d534430c841fdc061a739b1d9fa647633
bee-v1.9.0-x86_64-unknown-linux-gnu.tar.gz Linux (x86_64) 13.4 MB e2dfccd9275dd4ae40ac1cc355c1f71226a973663a1b25a9749949f6404598a4

校验方法

# 下载对应架构压缩包与 checksums.txt 后执行:
shasum -a 256 -c checksums.txt
# 或 Linux 环境下:
sha256sum -c checksums.txt

Release v0.4.0: Native Test Runner 2.0, Agent Deterministic Sandbox & Virtual Time, and Node Conformance 4.0

Choose a tag to compare

@zh30 zh30 released this 04 Sep 10:39

Beejs v0.4.0 Release Notes

Release Version: v0.4.0
Release Date: 2026-09-04
Git Commit: fa3738f0
Pull Request: #7
License: MIT

Beejs v0.4.0 是一个里程碑式的大版本更新,标志着 Beejs 在原生开发者体验(Native DX)、AI Agent 确定性沙箱执行(Deterministic Sandbox Replay)以及 Node.js 生态兼容性(Node Conformance 4.0)三个关键维度实现了系统性的飞跃。


🌟 核心战略支柱亮点

1. 原生测试运行器 2.0(bee test 晋升 Stable)

  • 零参智能文件发现(Zero-Argument Test Discovery)
    在不指定参数直接运行 bee test 时,测试引擎会自动递归遍历当前工作目录,智能发现匹配 *.test.js*.test.ts*_test.js*_test.ts 的所有测试文件。
    同时内置了严密的噪声过滤机制,自动排除 manual/node_modules/__snapshots__/.git/target/dist/ 等非测试目录。
  • 即时文件监听模式(Watch Mode: --watch
    支持 bee test --watch(自动监控项目目录变动并重跑测试集)及 bee test <path> --watch(精准监控并重跑指定单文件测试),基于事件防抖(Debounce)提供流畅快速的本地 TDD 开发循环。
  • 稳定性规范晋升
    在官方架构范围 docs/CURRENT_SCOPE.md 中,bee test 已正式从 Experimental 晋升为长期稳定维护的 Stable 等级。

2. Agent 确定性沙箱与虚拟时间(Deterministic Replay 1.0)

  • 确定性伪随机数发生器(Deterministic PRNG: --seed <u64>
    在运行时层接入 rand_chacha::ChaCha8Rng,统一接管 JavaScript 环境中的所有伪随机来源:
    • Math.random()
    • crypto.getRandomValues()(Web Crypto API)
    • crypto.randomBytes()(Node.js 兼容层)
      在指定相同 --seed 参数时,生成 100% 幂等可复现的随机数序列,彻底消除 Agent 工具执行与基准测试中的非确定性。
  • 虚拟确定性时钟(Virtual Deterministic Clock: --freeze-time <spec>
    支持传入毫秒 Unix 时间戳(如 1700000000000)或 ISO-8601 规范字符串(如 2026-09-04T00:00:00.000Z):
    • 冻结 Date.now() 返回固定的虚拟时间戳;
    • 拦截 new Date() 无参构造函数返回固定的冻结时刻;
    • 确保 new Date().toISOString() 返回与冻结时间严格对齐的标准格式;
    • 统一 performance.now() 基于虚拟时钟基准提供平滑度量,避免宿主真实时钟抖动泄露。
  • 沙箱权限与审计重置隔离
    在权限代理中引入 reset_state(),支持在运行不同用例时清空审计日志与临时权限规则,避免多任务间的污染。

3. Node.js 符合性 4.0 与核心生态内置(35/35 100% 满分)

  • 同步子进程执行(child_process.execSync & spawnSync
    • 完整实现 child_process.execSync(command, options)child_process.spawnSync(command, args, options),支持捕获 stdout/stderr、退出码与自定义工作目录。
    • 沙箱零信任拦截:执行受 PermissionKind::Process, PermissionAction::Execute 权限严格限制,在 --sandbox 模式或未授权时立即安全失败并抛出标准 Error: Permission denied
  • Buffer 与 Zlib 规范对齐
    • zlib.gzipSyncgunzipSyncdeflateSyncinflateSync 全面支持标准 Buffer / Uint8Array 传入,彻底消除被错误强制转为字符串导致乱码的问题;
    • 压缩与解压结果统一封装为标准 Node.js Buffer 对象,原生支持 .toString('utf8') 与 Buffer 方法。
  • ArrayBuffer 与空切片裸指针安全防护
    • 修复 Buffer.from(arrayBuffer) 在长度为 0 的 ArrayBuffer 上由于 V8 backing store 空指针引发 Rust std::slice::from_raw_parts 崩溃的边界隐患;
    • 强化 crypto.timingSafeEqual,支持直接对比 Node.js Buffer 实例与空切片安全防护。
  • 符合性套件满分全通
    • 测试套件从 30 个拓展至 35/35 满分通过(100% Pass Rate),涵盖 child_process、沙箱拦截、zlib Buffer 闭环、util 工具集及 crypto HMAC/UUID。

4. 生产发布工程化(Production Release Engineering)

  • 版本号全链路对齐至 0.4.0Cargo.tomlCargo.lockREADME.mdCURRENT_SCOPE.md);
  • 新增两个原生 Rust 集成测试套件(6/6 全部通过);
  • 跨平台自动化构建与多架构二进制分发流水线就绪。

📋 本次 Release 的所有修改内容明细

1. 核心运行时代码(src/

修改文件 核心改动明细
src/main.rs Command::Test 新增 --watch 参数与零参测试目录遍历发现逻辑。
• 增加自动过滤黑名单:排除 manual/node_modules/__snapshots__/.git/target/dist/
• 集成 notify 监听文件变动并防抖触发重跑。
• 在 CLI 参数中增加 --seed <u64>--freeze-time <spec> 并传递给 MinimalRuntime
src/runtime_minimal.rs • 新增 RuntimeOptions,携带可选的 seedfreeze_time
• 实现确定性 PRNG(ChaCha8Rng)并在 JS 上下文中劫持 Math.randomcrypto.getRandomValuescrypto.randomBytes
• 实现确定性虚拟时钟注入,在 JS 上下文中重载 DateDate.now()Date.prototype.toISOString 并与 performance.now 关联。
• 实现 child_process.execSyncspawnSync 原生能力,接入全局权限代理 PermissionKind::Process 进行沙箱拦截。
• 修复 Buffer.from(arrayBuffer) 在 0 长度或 NULL 指针切片上的内存安全边界检查。
src/nodejs_core/zlib.rs • 优化 bytes_from_arg,无损提取 BufferUint8Array 原始二进制字节,杜绝非预期的 JS 对象字符串化。
• 同步压缩/解压函数(gzipSync, gunzipSync, deflateSync, inflateSync)返回值全部构造为标准的 Node.js Buffer 对象。
src/nodejs_core/crypto.rs • 重构 timingSafeEqual:增加对 Node.js Buffer 实例的直接支持,加入 0 长度空指针安全防护,并在长度不匹配时安全抛出 TypeError。
• 集成确定性 PRNG,当设置 --seed 时从确定性流中产生随机字节。
src/web_api/crypto.rs • 接入确定性伪随机流,使 Web Crypto crypto.getRandomValues() 在提供 --seed 时保持 100% 幂等复现。
src/nodejs_core/performance.rs • 增加对虚拟冻结时间(get_frozen_time_ms)的联动,在虚拟时钟模式下保持度量稳定。
src/permissions.rs • 新增 PermissionBroker::reset_state(),用于在沙箱测试、单测隔离与 Agent 重放时重置所有内存权限状态与审计记录。

2. 测试套件与 Node.js 符合性用例(tests/

修改/新增文件 变更性质 核心功能与验证点
tests/deterministic_sandbox_tests.rs 新增 • 验证 --seed 12345 下多次运行 Math.random()crypto.getRandomValues() 的输出完全一致。
• 验证 --freeze-time 传入 Unix 时间戳时 Date.now()new Date().toISOString() 严格对齐。
• 验证 --freeze-time 传入 ISO-8601 字符串时的正确解析与固定时间输出。
tests/child_process_sync_tests.rs 新增 • 验证非沙箱模式下 child_process.execSync 成功执行并捕获 stdout。
• 验证非沙箱模式下 child_process.spawnSync 退出码与输出缓冲区。
• 验证沙箱模式(--sandbox)下执行子进程被立即拦截并抛出权限异常。
tests/conformance/fixtures/child_process_exec_sync.js 新增 Node.js 兼容性测试:测试 execSync('echo ...') 并断言 stdout 输出与 toString 行为。
tests/conformance/fixtures/child_process_exec_denied.js 新增 Node.js 兼容性测试:测试受限沙箱拦截 execSync 抛出标准权限异常。
tests/conformance/fixtures/child_process_exec_denied.flags 新增 声明该符合性测试运行必须带有的 --sandbox 命令行参数。
tests/conformance/fixtures/zlib_sync.js 新增 Node.js 兼容性测试:测试 zlib.gzipSynczlib.gunzipSync 的 Buffer 往返压缩解压闭环。
tests/conformance/fixtures/util_basics.js 新增 Node.js 兼容性测试:测试 util.promisifyutil.formatutil.inspectutil.types
tests/conformance/fixtures/crypto_hmac_uuid.js 新增 Node.js 兼容性测试:测试 crypto.createHmac(SHA-256)、crypto.randomUUIDcrypto.timingSafeEqual
tests/conformance/scorecard.md 修改 将通过项从 30/30 更新为 35/35 (100%),增加新增 5 项测试的正式达标记录。

3. 项目配置与文档

修改文件 核心改动明细
Cargo.toml 版本升级为 0.4.0
Cargo.lock 同步锁定依赖与项目包版本为 0.4.0
README.md • 更新主版本标头为 v0.4.0
• 更新 Node 符合性记分板为 35/35 (100%)。
• 增加 --seed--freeze-time 的 CLI 使用说明。
docs/CURRENT_SCOPE.md • 正式将 bee test 晋升为 Stable
• 登记确定性沙箱(Deterministic Replay 1.0)与 Node 符合性 4.0 架构范围。

🧪 质量门禁与验证数据

  • 代码格式规范(Format Check)cargo fmt --all -- --check —— 100% 通过
  • 代码静态分析(Clippy Lint)cargo clippy --all-targets -- -D warnings —— 0 警告,100% 通过
  • 单元测试套件(Unit Tests)cargo test --lib —— 369/369 用例 100% 通过
  • 新特性集成测试(Integration Tests)
    • deterministic_sandbox_tests: 3/3 passed (100%)
    • child_process_sync_tests: 3/3 passed (100%)
  • Node.js 符合性套件(Conformance)./tests/conformance/run_conformance.sh —— 35/35 用例满分通过 (100%)
  • GitHub Actions 持续集成流水线CI Run #33862985165 全绿灯通过(Ubuntu 与 macOS 跨平台矩阵)

🚀 快速上手与验证

1. 原生测试运行器 2.0

# 零参数自动发现并执行当前目录下所有测试
bee test

# 开启文件监听热重载测试
bee test --watch
bee test tests/my_feature.test.js --watch

2. Agent 确定性沙箱与虚拟时间

# 确定性伪随机数(多次运行输出绝对相同)
bee run --seed 42 script.js

# 虚拟冻结时间(毫秒时间戳或 ISO 字符串)
bee run --freeze-time "2026-09-04T00:00:00.000Z" script.js
bee run --freeze-time 1700000000000 script.js

# 组合沙箱与确定性选项
bee run --sandbox --seed 42 --freeze-time 1700000000000 agent_tool.js

3. 同步子进程与 Buffer 压缩

const { execSync } = require('child_process');
const zlib = require('zlib');

// 同步命令执行
const stdout = execSync('echo "hello from beejs"');
console.log(stdout.toString());

// Buffer 压缩与解压
const compressed = zlib.gzipSync(Buffer.from('hello world'));
const decompressed = zlib.gunzipSync(compressed);
console.log(decompressed.toString('utf8')); // 'hello world'

Release v0.1.2

Choose a tag to compare

@zh30 zh30 released this 02 Sep 10:51

Beejs v0.1.2 — Agent 工具沙箱

Beejs 现在是给 Agent Host 跑 JS/TS 工具的进程:默认关权限,工具 I/O 可审计。模型继续走 OpenAI / Anthropic / 本地 llama.cpp,不在 V8 里推理。

安装

curl -fsSL https://bee.zhanghe.dev/install.sh | sh
# 或指定版本
BEEJS_VERSION=v0.1.2 sh install.sh

已挂安装包:

  • bee-v0.1.2-aarch64-apple-darwin.tar.gz(Apple Silicon)
  • bee-v0.1.2-x86_64-unknown-linux-gnu.tar.gz(Linux x86_64)

x86_64-apple-darwin(Intel Mac)仍在 CI 排队,好了会补传到同一 Release。Linux arm64 需从源码编。

变更

  • bee run --sandbox:先 deny-all(fs/net/env/run),再叠加 --allow-* / --permission-policy
  • 路径 allow 改为目录前缀 jail(--allow-read ./workspace 放行子路径)
  • --audit-log:JSONL 决策(kind / action / resource / decision / ts),不写 env 值或文件正文
  • --export-toolsbee session(stdin JSON-RPC)、bee mcp(MCP stdio)
  • --isolate-per-call:每次 tool call 新建 isolate,仍走同一套 ResourceBroker
  • 符合性 24 条,含 Agent 拒绝路径

示例:

bee run --sandbox --permission-policy examples/agent/echo.policy.json --export-tools examples/agent/echo_tool.ts
bee session --sandbox --permission-policy examples/agent/echo.policy.json examples/agent/echo_tool.ts

feature=ai 不是产品 LLM,当前可能无法编译。

PR: #3