update-harness-dependencies

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Update the harness packages

更新harness包

The harness adapters are all the
packages/harness-*
packages. They each rely on one or more third-party packages for the respective harness's primary SDK. It is crucial to keep those dependencies up to date.
Below you find the instructions on how to update those packages to their latest versions, while adhering to the minimum release age defined in
pnpm-workspace.yaml
.
harness适配器指所有
packages/harness-*
包。每个适配器都依赖一个或多个第三方包作为对应harness的主要SDK,保持这些依赖的最新版本至关重要。
以下是将这些包更新到最新版本的操作说明,更新过程需遵守
pnpm-workspace.yaml
中定义的最小发布时长要求。

Update the harness dependency packages

更新harness依赖包

Run the following commands to update each harness's primary SDK packages.
  • For bridge harnesses (e.g. Claude Code), this will update the packages in
    devDependencies
    , while the actual package versions used as
    dependencies
    are only relevant to the harness's bridge itself.
  • For non-bridge harnesses (e.g. Pi), this will update the packages in
    dependencies
    .
Run these commands exactly as below:
bash
undefined
运行以下命令更新各个harness的主要SDK包。
  • 对于桥接型harness(例如Claude Code),此操作会更新
    devDependencies
    中的包,而作为
    dependencies
    使用的实际包版本仅与harness的桥接模块本身相关。
  • 对于非桥接型harness(例如Pi),此操作会更新
    dependencies
    中的包。
请严格按照以下内容运行命令:
bash
undefined

ACP

ACP

pnpm --filter harness-acp update @agentclientprotocol/sdk @modelcontextprotocol/sdk --latest --lockfile-only
pnpm --filter harness-acp update @agentclientprotocol/sdk @modelcontextprotocol/sdk --latest --lockfile-only

Claude Code

Claude Code

pnpm --filter harness-claude-code update @anthropic-ai/claude-agent-sdk @modelcontextprotocol/sdk --latest --lockfile-only
pnpm --filter harness-claude-code update @anthropic-ai/claude-agent-sdk @modelcontextprotocol/sdk --latest --lockfile-only

Cline

Cline

pnpm --filter harness-cline update @cline/agents --latest --lockfile-only
pnpm --filter harness-cline update @cline/agents --latest --lockfile-only

Codex

Codex

pnpm --filter harness-codex update @openai/codex-sdk --latest --lockfile-only
pnpm --filter harness-codex update @openai/codex-sdk --latest --lockfile-only

Deep Agents

Deep Agents

pnpm --filter harness-deepagents update @langchain/core @langchain/langgraph deepagents langchain langsmith --latest --lockfile-only
pnpm --filter harness-deepagents update @langchain/core @langchain/langgraph deepagents langchain langsmith --latest --lockfile-only

GitHub Copilot

GitHub Copilot

pnpm --filter harness-github-copilot update @github/copilot --latest --lockfile-only
pnpm --filter harness-github-copilot update @github/copilot --latest --lockfile-only

Grok Build

Grok Build

pnpm --filter harness-grok-build update @xai-official/grok --latest --lockfile-only
pnpm --filter harness-grok-build update @xai-official/grok --latest --lockfile-only

OpenCode

OpenCode

pnpm --filter harness-opencode update @opencode-ai/sdk --latest --lockfile-only
pnpm --filter harness-opencode update @opencode-ai/sdk --latest --lockfile-only

Pi

Pi

pnpm --filter harness-pi update @earendil-works/pi-coding-agent --latest --lockfile-only

For the bridge dependencies of bridge harnesses, you must additionally run the following commands. It is important to specify the `config.minimumReleaseAge` flag in accordance with what `pnpm-workspace.yaml` defines, because for these commands the `--ignore-workspace` flag is needed.

Run these commands exactly as below:

```bash
pnpm --filter harness-pi update @earendil-works/pi-coding-agent --latest --lockfile-only

对于桥接型harness的桥接依赖,你还需要运行以下命令。必须根据 `pnpm-workspace.yaml` 中的定义指定 `config.minimumReleaseAge` 参数,因为这些命令需要使用 `--ignore-workspace` 参数。

请严格按照以下内容运行命令:

```bash

ACP

ACP

pnpm --dir packages/harness-acp/src/v1/bridge update @agentclientprotocol/sdk @modelcontextprotocol/sdk --latest --ignore-workspace --config.minimumReleaseAge=4320
pnpm --dir packages/harness-acp/src/v1/bridge update @agentclientprotocol/sdk @modelcontextprotocol/sdk --latest --ignore-workspace --config.minimumReleaseAge=4320

Claude Code

Claude Code

pnpm --dir packages/harness-claude-code/src/bridge update @anthropic-ai/claude-agent-sdk @anthropic-ai/claude-code @modelcontextprotocol/sdk --latest --ignore-workspace --config.minimumReleaseAge=4320
pnpm --dir packages/harness-claude-code/src/bridge update @anthropic-ai/claude-agent-sdk @anthropic-ai/claude-code @modelcontextprotocol/sdk --latest --ignore-workspace --config.minimumReleaseAge=4320

Codex

Codex

pnpm --dir packages/harness-codex/src/bridge update @openai/codex-sdk --latest --ignore-workspace --config.minimumReleaseAge=4320
pnpm --dir packages/harness-codex/src/bridge update @openai/codex-sdk --latest --ignore-workspace --config.minimumReleaseAge=4320

Deep Agents

Deep Agents

pnpm --dir packages/harness-deepagents/src/bridge update @langchain/anthropic @langchain/core @langchain/langgraph deepagents langchain langsmith --latest --ignore-workspace --config.minimumReleaseAge=4320
pnpm --dir packages/harness-deepagents/src/bridge update @langchain/anthropic @langchain/core @langchain/langgraph deepagents langchain langsmith --latest --ignore-workspace --config.minimumReleaseAge=4320

GitHub Copilot

GitHub Copilot

pnpm --dir packages/harness-github-copilot/src/bridge update @github/copilot --latest --ignore-workspace --config.minimumReleaseAge=4320
pnpm --dir packages/harness-github-copilot/src/bridge update @github/copilot --latest --ignore-workspace --config.minimumReleaseAge=4320

Grok Build

Grok Build

pnpm --dir packages/harness-grok-build/src/bridge update @agentclientprotocol/sdk @modelcontextprotocol/sdk @xai-official/grok --latest --ignore-workspace --config.minimumReleaseAge=4320
pnpm --dir packages/harness-grok-build/src/bridge update @agentclientprotocol/sdk @modelcontextprotocol/sdk @xai-official/grok --latest --ignore-workspace --config.minimumReleaseAge=4320

OpenCode

OpenCode

pnpm --dir packages/harness-opencode/src/bridge update @opencode-ai/sdk opencode-ai --latest --ignore-workspace --config.minimumReleaseAge=4320

For bridge CLI packages that require install scripts, also update the exact
version in the bridge's `pnpm-workspace.yaml` `allowBuilds` entry to match the
new version in its `package.json`:

- `packages/harness-claude-code/src/bridge/pnpm-workspace.yaml`
- `packages/harness-github-copilot/src/bridge/pnpm-workspace.yaml`
- `packages/harness-grok-build/src/bridge/pnpm-workspace.yaml`
- `packages/harness-opencode/src/bridge/pnpm-workspace.yaml`

The following harness adapters use an unversioned installer script instead of an NPM package for their SDK / CLI and therefore can be ignored:

- `packages/harness-cursor`
- `packages/harness-fx`
pnpm --dir packages/harness-opencode/src/bridge update @opencode-ai/sdk opencode-ai --latest --ignore-workspace --config.minimumReleaseAge=4320

对于需要安装脚本的桥接CLI包,还需要更新桥接模块 `pnpm-workspace.yaml` 中 `allowBuilds` 条目里的精确版本号,使其与 `package.json` 中的新版本保持一致:

- `packages/harness-claude-code/src/bridge/pnpm-workspace.yaml`
- `packages/harness-github-copilot/src/bridge/pnpm-workspace.yaml`
- `packages/harness-grok-build/src/bridge/pnpm-workspace.yaml`
- `packages/harness-opencode/src/bridge/pnpm-workspace.yaml`

以下harness适配器使用无版本号的安装脚本而非NPM包来提供其SDK/CLI,因此可以忽略:

- `packages/harness-cursor`
- `packages/harness-fx`

Example dependencies

示例依赖

Check the
package.json
files in
examples/harness-e2e-next
and
examples/harness-e2e-tui
for any of the above SDKs they depend on. Those dependencies need to be updated to match the exact version used in the packages as well.
检查
examples/harness-e2e-next
和
examples/harness-e2e-tui
目录下的
package.json
文件,查看它们是否依赖上述任何SDK。这些依赖也需要更新到与包中使用的精确版本一致。

Verification

验证

Run the verification script to ensure all relevant dependency versions are aligned:
bash
./tools/verify-harness-adapter-deps.mjs
If this script shows errors, you must address them, then rerun the verification script until it passes.
运行验证脚本以确保所有相关依赖版本保持一致:
bash
./tools/verify-harness-adapter-deps.mjs
如果脚本报错,你必须修复这些问题,然后重新运行验证脚本直到通过。