Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/antigravity-harness.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@neta-art/cohub-cli": minor
"@neta-art/cohub": minor
---

Add Antigravity (`agy`) as a local harness: Cohub Turns run on agy's headless stream-json mode, hand over history and continue the same conversation, and terminal and desktop Antigravity chats sync read-only. Deploy API, Gateway and Agent before the CLI.
2 changes: 1 addition & 1 deletion apps/web/src/lib/assets/harness-icons/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Harness logos from [LobeHub Icons](https://lobehub.com/icons) (`@lobehub/icons-static-svg` 1.95.1, MIT).
Harness logos from [LobeHub Icons](https://lobehub.com/icons) (`@lobehub/icons-static-svg` 1.95.1, MIT; `antigravity.svg` from 1.106.0).
`workbuddy.svg` is the CodeBuddy mark: WorkBuddy's CLI is CodeBuddy Code. `pi.svg` and `cursor.svg` are monochrome (`currentColor`).
1 change: 1 addition & 0 deletions apps/web/src/lib/assets/harness-icons/antigravity.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions apps/web/src/lib/components/composer/HarnessIcon.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script lang="ts">
import type { HarnessKind } from "@cohub/protocol/runtime";
import { Monitor } from "lucide-svelte";
import antigravity from "#lib/assets/harness-icons/antigravity.svg?url";
import claude from "#lib/assets/harness-icons/claude.svg?url";
import codex from "#lib/assets/harness-icons/codex.svg?url";
import cursor from "#lib/assets/harness-icons/cursor.svg?url";
Expand All @@ -15,6 +16,7 @@ const icons: Partial<Record<HarnessKind, { url: string; mono?: boolean }>> = {
claude: { url: claude },
workbuddy: { url: workbuddy },
cursor: { url: cursor, mono: true },
antigravity: { url: antigravity },
};
const { harness, size = 16 }: { harness: HarnessKind; size?: number } =
$props();
Expand Down
5 changes: 4 additions & 1 deletion apps/web/src/tests/runtime-status-view.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ test("model counts are grouped by harness", () => {
claude: 0,
workbuddy: 0,
cursor: 0,
antigravity: 0,
});
assert.deepEqual(
harnessModelCounts(
Expand All @@ -134,7 +135,7 @@ test("model counts are grouped by harness", () => {
},
}),
),
{ pi: 2, codex: 1, claude: 0, workbuddy: 0, cursor: 0 },
{ pi: 2, codex: 1, claude: 0, workbuddy: 0, cursor: 0, antigravity: 0 },
);
});

Expand All @@ -150,6 +151,7 @@ test("the picker lists every local harness with its availability", () => {
"pi:missing",
"workbuddy:missing",
"cursor:missing",
"antigravity:missing",
]);
// Cached capabilities of an offline Runtime are not connected harnesses.
assert.deepEqual(view(["codex", "claude"], false), [
Expand All @@ -159,5 +161,6 @@ test("the picker lists every local harness with its availability", () => {
"claude:offline",
"workbuddy:offline",
"cursor:offline",
"antigravity:offline",
]);
});
23 changes: 21 additions & 2 deletions docs/local-runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Cancelling a turn on Windows stops Pi/Codex/Cursor tools by process tree; a deta
already exited can keep running. Cursor's `cursor-agent.cmd` would pass the prompt through cmd.exe and
PowerShell, so Cohub runs the newest `versions\<version>\node.exe index.js` it would start directly.
Harnesses (`pi`, `codex`, `claude` for Claude Code, `workbuddy` for the WorkBuddy CLI `codebuddy`, `cursor`
for the Cursor CLI `cursor-agent`) must
for the Cursor CLI `cursor-agent`, `antigravity` for the Antigravity CLI `agy`) must
already be installed and authenticated locally. Without `--harness`, startup discovers every installed
harness on PATH (or explicit executable overrides); one that fails its startup check is skipped with a
warning. With none left the Runtime still serves the folder, like a device Runtime: it declares no
Expand Down Expand Up @@ -124,6 +124,22 @@ prompt no other user line follows) starts a Turn, keyed by the file's checksum t
`turn_ended` settles it; tool results, model names and exact times are not recorded there. The ledger
records the Turn Cohub is running, as for CodeBuddy.

Antigravity runs one headless `agy --input-format stream-json --output-format stream-json` process per
Turn, the CLI's own scripting interface. Discovery checks `--help` for the flags a Turn uses and lists
`agy models`; effort variants (`gemini-4-neon-high`) become one model whose thinking levels are passed as
`--effort`. The CLI reports its conversation id before reading a prompt, so the Turn starts on the real
transcript; later Turns continue with `--conversation`. A new chat or cross-harness handoff puts projected
Cohub history in a `<cohub_session_history>` block of the first prompt, as does a continued conversation
Antigravity no longer has. Images are passed as temporary files the agent opens with `read_file`. Headless
mode cannot ask, so whatever needs approval is denied and a Turn ending on such a denial reports it. Approval
modes: follow local settings, full access (`--dangerously-skip-permissions`), and read-only, which adds deny
rules for file writes, commands, MCP and web through `--settings` (keeping the user's own deny rules, since
that flag replaces the list); deny rules win over every mode. Stopping sends SIGINT. Native state is SQLite
and protobuf, so Turns stage no archive. Terminal and desktop chats sync read-only from
`~/.gemini/antigravity-cli/brain/<id>/.system_generated/logs/transcript.jsonl` (and `~/.gemini/antigravity`),
with the project and sub-agents read from `conversation_summaries.db`; Cohub's own Turn is named by the step
index its run reported.

Claude Code 与 WorkBuddy 每个 Turn 启动一个 stream-json 进程:完整权限映射为 `acceptEdits`(提供审批模式的 Claude Code 未选择模式时沿用本机设置,见下);只读映射为 `plan`,
且仅开放 Read、Glob、Grep 工具、不加载 MCP(plan 模式仍会执行本机允许规则)。其他工具遵循本机权限规则;WorkBuddy 的权限请求一律拒绝,
Claude Code 的权限请求转为审批卡(见下)。云端历史投影到原生会话文件并通过 `--resume` 续接。
Expand All @@ -145,17 +161,20 @@ Windows 上 Cohub 不经 `cursor-agent.cmd`(会经 cmd.exe 与 PowerShell 转
否则按项目名还原为实际目录。`<user_query>`(或后面没有其他用户行的纯文本 prompt)开始一个 Turn,以文件到该行的校验和为键,
`turn_ended` 结算;该文件不记录工具结果、模型和精确时间。Cohub 正在执行的 Turn 由账本记录。

Antigravity 每个 Turn 启动一个 headless 进程 `agy --input-format stream-json --output-format stream-json`(CLI 自带的脚本接口)。启动检查确认 `--help` 含 Turn 所需参数并读取 `agy models`;同一模型的各档 effort(如 `gemini-4-neon-high`)合并为一个模型,思考等级经 `--effort` 传入。CLI 在读取 prompt 前就报告对话 id,Turn 直接对应真实的会话记录;后续 Turn 用 `--conversation` 续接。新会话、跨 Harness 接续,以及 Antigravity 已不存在的对话,都把云端历史放在首条 prompt 的 `<cohub_session_history>` 块中。图片作为临时文件传入,由 Agent 用 `read_file` 打开。headless 模式无法询问,需要审批的操作一律拒绝,因拒绝而结束的 Turn 会报告被拒绝的工具。审批模式:沿用本机设置、完全访问(`--dangerously-skip-permissions`)、只读;只读经 `--settings` 增加文件写入、命令、MCP 与网页的拒绝规则(该参数会替换拒绝列表,因此保留用户自己的拒绝规则),拒绝规则在任何模式下都优先。停止 Turn 发送 SIGINT。原生状态由 SQLite 与 protobuf 组成,因此不生成归档。终端与桌面端对话从 `~/.gemini/antigravity-cli/brain/<id>/.system_generated/logs/transcript.jsonl`(及 `~/.gemini/antigravity`)只读同步,项目目录与子 Agent 从 `conversation_summaries.db` 读取;Cohub 自己的 Turn 按其运行报告的步骤序号识别。

## Native clients / 原生客户端

```bash
cohub runtime up -d --harness pi --harness codex --harness claude --harness workbuddy --harness cursor
cohub runtime up -d --harness pi --harness codex --harness claude --harness workbuddy --harness cursor --harness antigravity
# One consent for this folder (default yes); Codex asks once more before sharing its app-server.
# 首次授权一次(默认 yes);Codex 共享 app-server 另确认一次。
pi # run /reload in Pi sessions that were already open
codex
claude # Claude Code and CodeBuddy sync read-only
codebuddy
cursor-agent # Cursor syncs read-only
agy # Antigravity syncs read-only
cohub runtime status
cohub runtime import # earlier conversations, newest first; Ctrl-C pauses
cohub runtime attach --harness pi # install the Pi extension by hand
Expand Down
2 changes: 1 addition & 1 deletion docs/product/en/developers/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ If not ready within 30 seconds, it returns exit code 2 and continues connecting.
`--yes` authorizes local execution without interaction. `down` retains all data and
requires `--yes` when work is unconfirmed. Network reconnection is automatic; it does
not replay model or tool work, and a disconnect does not confirm a task stopped.
Local harnesses are Pi, Codex, Claude Code (`claude`), WorkBuddy (`codebuddy`) and Cursor (`cursor-agent`). Without
Local harnesses are Pi, Codex, Claude Code (`claude`), WorkBuddy (`codebuddy`), Cursor (`cursor-agent`) and Antigravity (`agy`). Without
`--harness`, every installed one is tried and one that cannot start is skipped with a warning.
`cohub spaces prompt --harness codex --approval-mode read_only` picks one of `inherit`, `auto`,
`full_access` or `read_only` for that Turn (Codex and Claude Code), and `--service-tier priority` runs
Expand Down
2 changes: 1 addition & 1 deletion docs/product/zh/developers/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ cohub runtime up --display xvfb:1920x1080
`-d` 返回 Space 链接、进程 ID 和日志位置后在后台运行;30 秒内尚未就绪时返回退出码 2,进程继续连接。
`--yes` 用于非交互执行授权。`down` 保留所有数据,存在未确认执行时需加 `--yes`。
断网会自动重连,但不会自动重跑模型或工具;断连不代表任务已经停止。
本地 Harness 包括 Pi、Codex、Claude Code(`claude`)、WorkBuddy(`codebuddy`)和 Cursor(`cursor-agent`)。未指定 `--harness` 时
本地 Harness 包括 Pi、Codex、Claude Code(`claude`)、WorkBuddy(`codebuddy`)、Cursor(`cursor-agent`)和 Antigravity(`agy`)。未指定 `--harness` 时
会尝试所有已安装的 Harness,无法启动的会告警并跳过。
`cohub spaces prompt --harness codex --approval-mode read_only` 为该 Turn 选择 `inherit`、`auto`、`full_access` 或 `read_only`(Codex 与 Claude Code),
`--service-tier priority` 以 Codex Fast 运行。两者都需要已连接且支持该能力的 Runtime。
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ cohub -s home spaces files ls

## Local Runtime

Connect one local workspace to a Space and select Pi, Codex, Claude Code, WorkBuddy or Cursor per turn.
Terminal conversations of every harness sync to the Space; Claude Code (`claude`), WorkBuddy (`codebuddy`) and Cursor (`cursor-agent`) sync read-only.
Connect one local workspace to a Space and select Pi, Codex, Claude Code, WorkBuddy, Cursor or Antigravity per turn.
Terminal conversations of every harness sync to the Space; Claude Code (`claude`), WorkBuddy (`codebuddy`), Cursor (`cursor-agent`) and Antigravity (`agy`) sync read-only.
Without `--harness`, every installed harness is tried; one that cannot start is skipped with a warning.

To keep using native terminals with ordinary Cohub Chats / Turns:
Expand Down Expand Up @@ -193,7 +193,7 @@ are never uploaded automatically. Use `runtime logs --json` to export a failure
events carry the local `runtimeId` plus server `requestId` / `traceparent` when a turn has
reached the Agent trace.

The Runtime uses WebSockets, native Pi RPC / Codex app-server / Claude Code and Cursor stream-json, and existing cloud
The Runtime uses WebSockets, native Pi RPC / Codex app-server / Claude Code, Cursor and Antigravity stream-json, and existing cloud
streaming. Local executables and credentials are required. `sandbox up` has been
removed. Reconnection and result reconciliation are automatic; no recovery command is needed.
When a result genuinely cannot be determined, the affected Chat offers an explicit stop
Expand Down
Loading
Loading