@atcx/contract

中文文档
7.7.2发布于 2026/10/31MITTypeScriptES Module构建来源已验证

atc's public contract: the daemon's request contract, the event, session record, hello and config schemas, the error codes, the session env names, the state paths, and the gateway's routes and registry schema

原始使用文档
文档目录4 节
  1. Install
  2. Features
  3. Configuration
  4. Documentation

The schemas and constants a program needs to talk to an atc daemon and read what it writes.

atc hosts coding-agent sessions in a daemon, and this package holds the daemon's side of the conversation: the oRPC request contract, the event and session record schemas, the hello answer, the error codes, the session environment names, and the paths of the daemon's sockets and state. The daemon and every atc client build on the same package, and each atc release publishes it at its own version. To start, resolve the daemon's socket with resolveAtcPaths, send daemon.hello, and pass the answer to checkDaemon to learn whether the daemon speaks your version of the contract.

Install

The package ships an ES module with its type declarations, for Node or Bun. It depends on Zod 4 and oRPC's contract library.

bun add @atcx/contract

oRPC's declarations import @opentelemetry/api, which oRPC lists only as an optional peer. A project that type-checks the declarations of its dependencies, with skipLibCheck off, installs it beside the package:

bun add -d @opentelemetry/api

Features

  • The request contract. DAEMON_CONTRACT, the oRPC contract of every daemon procedure, with each input and answer schema.
  • Events and records. DAEMON_EVENT_SCHEMA for the event stream, and PUBLISHED_RECORD_SCHEMA for the session record a session's helpers read.
  • Checking a daemon. checkDaemon compares the major version in the hello answer with the contract's, and lists the features that differ.
  • The gateway. GATEWAY_PATHS, the routes atc-gateway serves grouped as browser, machine and probe paths, and GATEWAY_REGISTRY_SCHEMA, the rules of the gateway's registry file.
  • The light entry. @atcx/contract/light holds the session environment names, the state paths and the error codes without the request contract, for a process that starts once per event.

Configuration

CONFIG_FILE_SCHEMA parses the top-level keys of atc's config.json, and the configuration guide describes each key.

Documentation

The published contract covers what the package holds and how its version moves with atc's.

版本与发布记录

@atcx/contract 共发布 9 个版本,首次发布于 2026/10/23;过去 12 个月发布了 9 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
7.7.2latest2026/10/312 天前
7.7.12026/10/313 天前
7.7.02026/10/303 天前
7.6.02026/10/294 天前
7.5.12026/10/295 天前
7.5.02026/10/285 天前

关于 @atcx/contract 的常见问题

@atcx/contract 是什么?

Atc的公共契约:守护进程的请求契约、事件、会话记录、hello和配置模式、错误代码、会话环境名称、状态路径以及网关的路由和注册表模式

如何安装 @atcx/contract?

在项目目录运行 npm install @atcx/contract,或使用 pnpm add / yarn add / bun add。

@atcx/contract 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@atcx/contract 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@atcx/contract 可以商用吗?

@atcx/contract 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@atcx/contract 还在维护吗?

最新版本 7.7.2 发布于 2026/10/31(2 天前);至今共发布 9 个版本,其中过去 12 个月发布了 9 个;首次发布于 2026/10/23。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。