@cotal-ai/orca

中文文档
0.157.2发布于 2026/11/11Apache-2.0TypeScriptES Module零依赖构建来源已验证近 30 天下载 5.9万

Cotal Orca integration: an Orca Runtime provider for spawning agents into the right Orca worktree.

原始使用文档
文档目录3 节
  1. What it does
  2. Usage
  3. Testing

@cotal-ai/orca

The Orca integration: a thin driver over the public orca CLI plus a self-registering orca Runtime provider. Importing it registers the runtime with the core Registry, so the manager can spawn agents into native Orca terminals.

Tier: extensions/. Peer-depends @cotal-ai/core; self-registers on import.

What it does

  • Resolves the launch cwd to the enclosing Orca worktree with orca worktree current --json, then targets that stable worktree id for terminal creation.
  • Runs the agent from the exact launch cwd, even though Orca terminals are attached to the worktree.
  • Keeps Cotal launch env and credentials out of the Orca command line by writing a private Node launcher script, passing only exec '<node>' '<script>' to Orca, and deleting the launcher after it loads.
  • Forces Orca CLI lifecycle calls to the local runtime by removing ambient remote-runtime selectors.
  • Uses Orca terminal handles for status, interrupt, and close. Watching is native: switch to the Orca tab rather than cotal attach.
  • Waits for exit through Orca's bounded native terminal wait --for exit, following handle rotation by stable PTY id and failing closed on timeout or an unreachable runtime.

Orca must open terminals with a POSIX-compatible shell that supports exec and single-quoted arguments. Driver calls are synchronous because Cotal's Runtime lifecycle contract is synchronous; short probe caches batch status checks and repeated launches from the same cwd. Every read-only call (status, worktree and terminal lookups, screen reads) gives up after 2 seconds, so an Orca app that stops answering cannot block the manager. A status check that gives up reports the agent as still running.

Usage

Install it into the published CLI:

cotal ext add @cotal-ai/orca
cotal supervise --runtime orca

Library composition roots can still import it explicitly:

import "@cotal-ai/orca"; // self-registers

The runtime can also be selected with runtime: orca in a mesh manifest.

Testing

pnpm smoke:orca:live exercises the driver and runtime directly. pnpm smoke:orca-e2e:live runs the complete operator journey against live Orca and Claude Code: install this package with cotal ext, launch a runtime: orca manifest, observe the agent through cotal ps, then shut down and remove the extension.

The launcher contract checks in package.smoke.ts are POSIX-only. On Windows they use the shared skipSuite helper to report a skip with zero passing cells.

版本与发布记录

@cotal-ai/orca 共发布 403 个版本,首次发布于 2026/07/11;过去 12 个月发布了 403 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.157.2latest2026/11/11今天
0.157.12026/11/11今天
0.157.02026/11/11今天
0.156.02026/11/11今天
0.155.22026/11/10今天
0.155.12026/11/10今天

其他发布通道:hack → 0.28.0-hack-20260823234508。

关于 @cotal-ai/orca 的常见问题

@cotal-ai/orca 是什么?

Cotal Orca integration: an Orca Runtime provider for spawning agents into the right Orca worktree.

如何安装 @cotal-ai/orca?

在项目目录运行 npm install @cotal-ai/orca,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@cotal-ai/core(*)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@cotal-ai/orca 支持 TypeScript 吗?

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

@cotal-ai/orca 支持 ESM 还是 CommonJS?

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

@cotal-ai/orca 可以商用吗?

@cotal-ai/orca 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@cotal-ai/orca 的下载量有多少?

根据 npm 官方下载统计,@cotal-ai/orca 在 2026/10/11 – 2026/11/09 这 30 天内被下载 58,990 次,日均约 1,966 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@cotal-ai/orca 还在维护吗?

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