page-harness 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [中文](./README.zh-CN.md)
4
4
 
5
- Point it at any running frontend and the page gets a **Pick / Artifacts / Chat** dock, driven by the coding agent CLI already on your machine (Claude Code, Codex or Cursor Agent). No sandbox, no accounts, no changes to your app.
5
+ Point it at any running frontend and the page gets a **Pick / Artifacts / Chat** dock, driven by the coding agent CLI already on your machine (Claude Code, Codex, Cursor Agent, CodeBuddy Code or OpenCode). No sandbox, no accounts, no changes to your app.
6
6
 
7
7
  ```bash
8
8
  npx page-harness http://localhost:5173 --project ./my-app --agent claude
@@ -26,8 +26,23 @@ npx page-harness http://localhost:5173 --project ./my-app --agent claude
26
26
  - [Claude Code](https://docs.anthropic.com/en/docs/claude-code) (`claude`)
27
27
  - [Codex](https://github.com/openai/codex) (`codex`)
28
28
  - [Cursor Agent](https://docs.cursor.com/en/cli/overview) (`cursor-agent`)
29
+ - [CodeBuddy Code](https://www.codebuddy.ai/cli) (`codebuddy`, `npm i -g @tencent-ai/codebuddy-code`)
30
+ - [OpenCode](https://opencode.ai) (`opencode`, `npm i -g opencode-ai`)
29
31
 
30
- page-harness detects which ones are installed and shows them in the banner. Use `--claude-path`, `--codex-path` or `--cursor-path` for non-standard locations.
32
+ page-harness detects which ones are installed and shows them in the banner. Use `--claude-path`, `--codex-path`, `--cursor-path`, `--codebuddy-path` or `--opencode-path` for non-standard locations. Agents that are not installed stay in the chat's agent picker, greyed out, with the install command.
33
+
34
+ What each agent supports:
35
+
36
+ | | Claude Code | Codex | Cursor Agent | CodeBuddy Code | OpenCode |
37
+ |---|---|---|---|---|---|
38
+ | Streaming text / thinking | ✓ | ✓ | ✓ | ✓ | per block¹ |
39
+ | Tool cards, changed files | ✓ | ✓ | ✓ | ✓ | ✓¹ |
40
+ | Resume a chat | ✓ | ✓ | ✓ | ✓ | ✓ |
41
+ | Model list | ✓ | ✓ | ✓ | ✓ (from `--help`) | ✓ (`opencode models`) |
42
+ | Reasoning effort | – | ✓ | – | ✓ (`--effort`) | ✓ (`--variant`) |
43
+ | Image attachments | ✓ | ✓ | file path in prompt | ✓ | ✓ (`--file`) |
44
+
45
+ ¹ `opencode run --format json` reports text, reasoning and tool calls once each part has finished, so replies arrive a block at a time and a tool card opens and closes together.
31
46
 
32
47
  ## Usage
33
48
 
@@ -35,13 +50,15 @@ page-harness detects which ones are installed and shows them in the banner. Use
35
50
  page-harness <frontend-url> [options]
36
51
 
37
52
  --project <dir> Project the agent works in (default: current directory)
38
- --agent <id> claude | codex | cursor (default: first one installed)
53
+ --agent <id> claude | codex | cursor | codebuddy | opencode (default: first one installed)
39
54
  --model <name> Default model for new chats
40
55
  --port <n> App port: the proxied frontend (default 17990)
41
56
  --control-port <n> Panel / API port (default: app port + 1)
42
57
  --host <addr> Listen address (default 127.0.0.1)
43
58
  --allow-host <name> Extra Host header to accept (repeatable), e.g. a LAN name
44
59
  --keep-host Forward the browser's Host header to the target
60
+ --public-scheme <s> http | https: scheme browsers use to reach both ports (default http);
61
+ https behind a load balancer that terminates TLS on the same ports
45
62
  --open Open the browser
46
63
  --live-guard-hook Install a git pre-commit hook that rejects Live candidate markers
47
64
  --review / --source Force review mode (no source) or source mode; default is by host
@@ -57,7 +74,8 @@ page-harness <frontend-url> [options]
57
74
  browser ──► :17990 app port reverse proxy to your dev server; injects /__ph/overlay.js into HTML
58
75
  └─► :17991 control port panel UI, history page, JSON API, WebSocket, MCP endpoint
59
76
  │
60
- └─ spawns the agent CLI per turn (claude -p / codex app-server / cursor-agent -p)
77
+ └─ spawns the agent CLI per turn (claude -p / codex app-server / cursor-agent -p /
78
+ codebuddy -p / opencode run --format json)
61
79
  with a local MCP server for page_*, artifacts, questions and Live
62
80
  ```
63
81
 
@@ -136,7 +154,7 @@ There is no login: it is a local developer tool and binds to `127.0.0.1` by defa
136
154
  - **Artifacts.** HTML and SVG artifacts are served with a `sandbox` CSP and shown in iframes without `allow-same-origin`.
137
155
  - **Page control** is opt-in per browser, shown with a banner, and password values are never sent to the agent.
138
156
 
139
- Agents run with their CLI's non-interactive permissions (e.g. Claude Code `--permission-mode bypassPermissions`, Codex with approvals off, Cursor Agent `--force`) inside `--project`. Only point page-harness at projects you would let the agent edit.
157
+ Agents run with their CLI's non-interactive permissions (e.g. Claude Code `--permission-mode bypassPermissions`, Codex with approvals off, Cursor Agent `--force`, CodeBuddy Code `--permission-mode bypassPermissions`, OpenCode `run --auto`) inside `--project`. Only point page-harness at projects you would let the agent edit.
140
158
 
141
159
  ## Data
142
160
 
package/README.zh-CN.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [English](./README.md)
4
4
 
5
- 给任意正在运行的前端地址,页面上就多出 **取点 / 产物 / 对话** 底栏,由你本机已有的编码 Agent CLI(Claude Code、Codex、Cursor Agent)驱动。不需要沙箱、不需要账号、不用改你的项目代码。
5
+ 给任意正在运行的前端地址,页面上就多出 **取点 / 产物 / 对话** 底栏,由你本机已有的编码 Agent CLI(Claude Code、Codex、Cursor Agent、CodeBuddy Code、OpenCode)驱动。不需要沙箱、不需要账号、不用改你的项目代码。
6
6
 
7
7
  ```bash
8
8
  npx page-harness http://localhost:5173 --project ./my-app --agent claude
@@ -26,8 +26,23 @@ npx page-harness http://localhost:5173 --project ./my-app --agent claude
26
26
  - [Claude Code](https://docs.anthropic.com/en/docs/claude-code)(`claude`)
27
27
  - [Codex](https://github.com/openai/codex)(`codex`)
28
28
  - [Cursor Agent](https://docs.cursor.com/en/cli/overview)(`cursor-agent`)
29
+ - [CodeBuddy Code](https://www.codebuddy.ai/cli)(`codebuddy`,`npm i -g @tencent-ai/codebuddy-code`)
30
+ - [OpenCode](https://opencode.ai)(`opencode`,`npm i -g opencode-ai`)
29
31
 
30
- 启动时会自动检测已安装的 CLI 并在终端里列出。不在默认位置时用 `--claude-path` / `--codex-path` / `--cursor-path` 指定。
32
+ 启动时会自动检测已安装的 CLI 并在终端里列出。不在默认位置时用 `--claude-path` / `--codex-path` / `--cursor-path` / `--codebuddy-path` / `--opencode-path` 指定。没装的 Agent 也会出现在对话的 Agent 选择器里,置灰,点一下能看到安装命令。
33
+
34
+ 各 Agent 支持情况:
35
+
36
+ | | Claude Code | Codex | Cursor Agent | CodeBuddy Code | OpenCode |
37
+ |---|---|---|---|---|---|
38
+ | 流式文字 / 思考过程 | ✓ | ✓ | ✓ | ✓ | 按段¹ |
39
+ | 工具卡片、改动文件 | ✓ | ✓ | ✓ | ✓ | ✓¹ |
40
+ | 续接对话 | ✓ | ✓ | ✓ | ✓ | ✓ |
41
+ | 模型列表 | ✓ | ✓ | ✓ | ✓(取自 `--help`) | ✓(`opencode models`) |
42
+ | 推理强度 | – | ✓ | – | ✓(`--effort`) | ✓(`--variant`) |
43
+ | 图片附件 | ✓ | ✓ | 只传文件路径 | ✓ | ✓(`--file`) |
44
+
45
+ ¹ `opencode run --format json` 只在每段文字、思考和工具调用结束后才输出,所以回复是一段一段出来的,工具卡片也是一次性出现并完成。
31
46
 
32
47
  ## 用法
33
48
 
@@ -35,13 +50,15 @@ npx page-harness http://localhost:5173 --project ./my-app --agent claude
35
50
  page-harness <前端地址> [选项]
36
51
 
37
52
  --project <dir> Agent 工作的项目目录(默认当前目录)
38
- --agent <id> claude | codex | cursor(默认第一个已安装的)
53
+ --agent <id> claude | codex | cursor | codebuddy | opencode(默认第一个已安装的)
39
54
  --model <name> 新会话的默认模型
40
55
  --port <n> 应用端口:代理后的前端(默认 17990)
41
56
  --control-port <n> 面板 / API 端口(默认应用端口 + 1)
42
57
  --host <addr> 监听地址(默认 127.0.0.1)
43
58
  --allow-host <name> 额外允许的 Host 头(可重复),比如局域网域名
44
59
  --keep-host 把浏览器的 Host 头原样转发给目标
60
+ --public-scheme <s> http | https:浏览器访问两个端口用的协议(默认 http);
61
+ 放在同端口卸载 TLS 的负载均衡后面时用 https
45
62
  --open 自动打开浏览器
46
63
  --live-guard-hook 安装 git pre-commit 钩子,拒绝提交 Live 候选标记
47
64
  --review / --source 强制评审模式(无源码)或源码模式;默认按域名判断
@@ -57,7 +74,8 @@ page-harness <前端地址> [选项]
57
74
  浏览器 ──► :17990 应用端口 反向代理到你的开发服务器,在 HTML 里注入 /__ph/overlay.js
58
75
  └─► :17991 控制端口 面板 UI、聊天记录页、JSON API、WebSocket、MCP
59
76
  │
60
- └─ 每一轮对话启动一次 Agent CLI(claude -p / codex app-server / cursor-agent -p),
77
+ └─ 每一轮对话启动一次 Agent CLI(claude -p / codex app-server / cursor-agent -p /
78
+ codebuddy -p / opencode run --format json),
61
79
  并接入本地 MCP:page_*、产物、提问、Live
62
80
  ```
63
81
 
@@ -136,7 +154,7 @@ npx page-harness https://example.com --share
136
154
  - **产物。** HTML / SVG 产物带 `sandbox` CSP 返回,并放在不含 `allow-same-origin` 的 iframe 里展示。
137
155
  - **页面控制**需要在浏览器里手动开启,开启时有横幅提示,密码框的值不会发给 Agent。
138
156
 
139
- Agent 以各自 CLI 的非交互权限在 `--project` 里运行(例如 Claude Code `--permission-mode bypassPermissions`、Codex 关闭审批、Cursor Agent `--force`)。只对你愿意让 Agent 修改的项目使用。
157
+ Agent 以各自 CLI 的非交互权限在 `--project` 里运行(例如 Claude Code `--permission-mode bypassPermissions`、Codex 关闭审批、Cursor Agent `--force`、CodeBuddy Code `--permission-mode bypassPermissions`、OpenCode `run --auto`)。只对你愿意让 Agent 修改的项目使用。
140
158
 
141
159
  ## 数据
142
160
 
@@ -2923,3 +2923,34 @@ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
2923
2923
  TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
2924
2924
  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2925
2925
  ```
2926
+
2927
+ ## Agent logos (LobeHub Icons, @lobehub/icons-static-svg@1.95.1)
2928
+
2929
+ License: MIT
2930
+ Repository: https://github.com/lobehub/lobe-icons
2931
+
2932
+ The Claude, Codex, Cursor, CodeBuddy and OpenCode marks are trademarks of their owners (Anthropic, OpenAI, Anysphere, Tencent, SST) and are shown only to name the agent CLI in use.
2933
+
2934
+ ```text
2935
+ MIT License
2936
+
2937
+ Copyright (c) 2023 LobeHub
2938
+
2939
+ Permission is hereby granted, free of charge, to any person obtaining a copy
2940
+ of this software and associated documentation files (the "Software"), to deal
2941
+ in the Software without restriction, including without limitation the rights
2942
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
2943
+ copies of the Software, and to permit persons to whom the Software is
2944
+ furnished to do so, subject to the following conditions:
2945
+
2946
+ The above copyright notice and this permission notice shall be included in all
2947
+ copies or substantial portions of the Software.
2948
+
2949
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2950
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2951
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2952
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2953
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2954
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2955
+ SOFTWARE.
2956
+ ```