@armadra/agent 0.7.6 → 0.8.0
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/CHANGELOG.md +13 -0
- package/CHANGELOG.zh-CN.md +13 -0
- package/dist/ai/apis/chatgpt-backend.d.ts +3 -1
- package/dist/ai/apis/chatgpt-backend.js +10 -1
- package/dist/bundle/ama.cjs +1018 -336
- package/dist/drivers/acp/driver.d.ts +22 -1
- package/dist/drivers/acp/driver.js +59 -5
- package/dist/drivers/agents.js +3 -0
- package/dist/drivers/catalog.d.ts +2 -0
- package/dist/drivers/catalog.js +94 -4
- package/dist/drivers/native/claude-normalize.d.ts +8 -0
- package/dist/drivers/native/claude-normalize.js +27 -0
- package/dist/drivers/native/claude-stream.js +16 -1
- package/dist/drivers/native/codex-app-server.js +4 -2
- package/dist/drivers/native/oneshot.js +12 -2
- package/dist/drivers/native/pi-gate.d.ts +19 -0
- package/dist/drivers/native/pi-gate.js +39 -0
- package/dist/drivers/native/pi-rpc.d.ts +29 -0
- package/dist/drivers/native/pi-rpc.js +483 -0
- package/dist/drivers/runner.js +1 -0
- package/dist/drivers/types.d.ts +1 -1
- package/dist/i18n/catalog.d.ts +3 -0
- package/dist/i18n/messages/auth.d.ts +2 -0
- package/dist/i18n/messages/auth.js +2 -0
- package/dist/i18n/messages/drivers.d.ts +4 -0
- package/dist/i18n/messages/drivers.js +4 -0
- package/docs/agents.md +56 -11
- package/docs/en/providers.md +7 -6
- package/docs/providers.md +7 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,19 @@ English · [简体中文](CHANGELOG.zh-CN.md)
|
|
|
5
5
|
> This file is in English starting with 0.6.0. Release notes for 0.1 through 0.5.1 are in Chinese in
|
|
6
6
|
> [CHANGELOG.zh-CN.md](CHANGELOG.zh-CN.md). New entries go into both files.
|
|
7
7
|
|
|
8
|
+
## 0.8.0 (2026-10-10)
|
|
9
|
+
|
|
10
|
+
### External agents
|
|
11
|
+
|
|
12
|
+
- **New `pi` driver**: `task(agent="pi")` drives `pi --mode rpc` (verified with pi 1.1.0). pi has no approval channel of its own, so ama loads a minimal extension for that run (`-e`, written to a per-session temp dir and deleted on close; pi's config is untouched) that routes every non-read-only tool call to ama: rejected in `plan` / `allowlist` (which also only enable `read,grep,find,ls`), `edit` / `write` allowed from `auto-edit` up, everything else asks you. Dialogs from your own pi extensions are cancelled, never answered. Two-turn resume, steer, interrupt, USD usage and context occupancy are reported. The community `pi-acp` adapter is not listed: it never sends permission requests (#198).
|
|
13
|
+
- **Cursor CLI listed as unverified**: `task(agent="cursor")` runs `cursor-agent acp` per Cursor's ACP docs (modes `agent` / `plan` / `ask`); not tested locally because it is not installed (#198).
|
|
14
|
+
- **Codex one-shot mode works outside git repos**: `codex exec` / `exec resume` now pass `--skip-git-repo-check` (ama only starts external agents in directories it already trusts); previously they failed immediately in a non-git directory (#198).
|
|
15
|
+
- **ACP adapters no longer stay in a looser mode**: explicit mode maps for claude-agent-acp (`auto-edit` → `acceptEdits`, `full-auto` → `auto`, so a user default of `bypassPermissions` is replaced), codex-acp (`plan` / `default` → `read-only`, `auto-edit` → `workspace-write`, `auto` / `full-auto` → `agent`; `plan` used to refuse to start) and Copilot (URL mode ids `…#plan` / `…#agent`). Modes that open every permission are never chosen (#198).
|
|
16
|
+
- **`model` reaches ACP agents**: `agents.<id>.model` and the `task` `model` argument are now applied through the agent's `model` session config option (matched by value, name, or the model part of `provider/model`); when nothing matches you get a notice and the agent's default model (#198).
|
|
17
|
+
- **Usage numbers corrected**: Codex (app-server and `exec`) and Copilot report input tokens including cache hits, and Copilot's ACP usage is a session total; ama now subtracts the cached part and takes per-turn differences, so totals no longer count cache reads twice. Claude stream-json now reports context occupancy and window like the other drivers (#198).
|
|
18
|
+
- **Verified ranges updated** after a real-CLI audit on 2026-10-10: claude-agent-acp 0.89, codex-acp 2.2, Copilot 1.0.95, OpenCode 1.18, pi 1.1; capability matrix in docs/agents.md, numbers in docs/benchmarks/external-agents-2026-10.md (#198).
|
|
19
|
+
- **`model_unavailable` for ChatGPT models the account cannot use**: a codex-backend 400 "model is not supported when using Codex with a ChatGPT account" now fails with `model_unavailable` and tells you to refresh the list with `ama models discover chatgpt` (the backend withdrew `gpt-6-astra`, which an older discovery cache still listed) (#198).
|
|
20
|
+
|
|
8
21
|
## 0.7.6 (2026-10-10)
|
|
9
22
|
|
|
10
23
|
### Model efficiency
|
package/CHANGELOG.zh-CN.md
CHANGED
|
@@ -4,6 +4,19 @@
|
|
|
4
4
|
|
|
5
5
|
> 从 0.6.0 起 [CHANGELOG.md](CHANGELOG.md) 为英文,本文件保留中文记录(0.1–0.5.1 的完整历史在此)。新条目两份都要加。
|
|
6
6
|
|
|
7
|
+
## 0.8.0(2026-10-10)
|
|
8
|
+
|
|
9
|
+
### 外部 Agent
|
|
10
|
+
|
|
11
|
+
- **新增 `pi` 驱动**:`task(agent="pi")` 驱动 `pi --mode rpc`(pi 1.1.0 实测)。pi 自己没有审批通道,ama 以 `-e` 给这一次运行加载一个最小扩展(写在每个会话自己的临时目录、关会话即删,不碰 pi 的配置),把只读工具以外的调用交给 ama:`plan` / `allowlist` 直接拒绝(并只开 `read,grep,find,ls`),`auto-edit` 及更宽放行 `edit` / `write`,其余问你。你自己的 pi 扩展弹出的对话框一律取消、不代答。支持两轮续聊、steer、中断、美元用量与上下文占用。社区适配器 `pi-acp` 从不发权限请求,不收录(#198)。
|
|
12
|
+
- **收录 Cursor CLI(未验证)**:`task(agent="cursor")` 按官方 ACP 文档运行 `cursor-agent acp`(模式 `agent` / `plan` / `ask`);本机未安装,未实测(#198)。
|
|
13
|
+
- **Codex 一次性模式在非 git 目录可用**:`codex exec` / `exec resume` 带上 `--skip-git-repo-check`(ama 只在自己已信任的目录里起外部 Agent);此前在非 git 目录直接失败(#198)。
|
|
14
|
+
- **ACP 适配器不再停在更宽的模式**:claude-agent-acp(`auto-edit` → `acceptEdits`、`full-auto` → `auto`,用户缺省为 `bypassPermissions` 时也会改回)、codex-acp(`plan` / `default` → `read-only`、`auto-edit` → `workspace-write`、`auto` / `full-auto` → `agent`;此前 `plan` 拒绝启动)、Copilot(URL 形式的模式 id `…#plan` / `…#agent`)写入显式映射,从不选放开全部权限的模式(#198)。
|
|
15
|
+
- **`model` 交给 ACP Agent**:`agents.<id>.model` 与 `task` 的 `model` 参数经 Agent 的 `model` 会话配置项设置(按值、名称或 `provider/model` 的模型部分匹配);没有匹配时提示并用它的缺省模型(#198)。
|
|
16
|
+
- **用量口径修正**:Codex(app-server 与 `exec`)和 Copilot 报的 input 含缓存命中,Copilot 的 ACP usage 还是会话累计;ama 现在扣掉缓存部分、按回合取差值,总量不再把缓存读算两次。Claude stream-json 也像其它驱动一样上报上下文占用与窗口(#198)。
|
|
17
|
+
- **已验证区间更新**:2026-10-10 用真实 CLI 实测,claude-agent-acp 0.89、codex-acp 2.2、Copilot 1.0.95、OpenCode 1.18、pi 1.1;能力矩阵见 docs/agents.md,数字见 docs/benchmarks/external-agents-2026-10.md(#198)。
|
|
18
|
+
- **ChatGPT 账户不可用的模型报 `model_unavailable`**:codex 后端以 400「model is not supported when using Codex with a ChatGPT account」拒绝时,报 `model_unavailable` 并提示用 `ama models discover chatgpt` 刷新模型表(后端已撤下 `gpt-6-astra`,旧的发现缓存里还有它)(#198)。
|
|
19
|
+
|
|
7
20
|
## 0.7.6(2026-10-10)
|
|
8
21
|
|
|
9
22
|
### 模型调用效率
|
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
* - 出错恢复(每种至多一次):401 → 强制刷新重试;SIWC 400 `subscription_sharing_unsupported_capability` → 删去
|
|
11
11
|
* `error.param` 重试;codex 400 `Instructions are not valid` → 本会话切 developer-message 重试;
|
|
12
12
|
* - 错误映射(文案带码前缀,宿主按码判断):429 配额 → `quota_exceeded`(不重试);失效 → `auth_expired`;
|
|
13
|
-
* SIWC 403 `subscription_sharing_user_not_eligible` → `not_eligible`(i18n 文案列出原因);
|
|
13
|
+
* SIWC 403 `subscription_sharing_user_not_eligible` → `not_eligible`(i18n 文案列出原因);codex 400「model is not
|
|
14
|
+
* supported when using Codex with a ChatGPT account」→ `model_unavailable`(发现缓存过期时常见,提示刷新);
|
|
15
|
+
* 503 留给会话层现有重试;
|
|
14
16
|
* - 渠道跟随登录方式由会话层做(auth/chatgpt/follow.ts);到这里仍不符说明用户显式写了 `@渠道`,报
|
|
15
17
|
* `chatgpt_flavor_mismatch`(i18n);
|
|
16
18
|
* - 用量:`cost = 0`、`billing: "subscription"`。
|
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
* - 出错恢复(每种至多一次):401 → 强制刷新重试;SIWC 400 `subscription_sharing_unsupported_capability` → 删去
|
|
11
11
|
* `error.param` 重试;codex 400 `Instructions are not valid` → 本会话切 developer-message 重试;
|
|
12
12
|
* - 错误映射(文案带码前缀,宿主按码判断):429 配额 → `quota_exceeded`(不重试);失效 → `auth_expired`;
|
|
13
|
-
* SIWC 403 `subscription_sharing_user_not_eligible` → `not_eligible`(i18n 文案列出原因);
|
|
13
|
+
* SIWC 403 `subscription_sharing_user_not_eligible` → `not_eligible`(i18n 文案列出原因);codex 400「model is not
|
|
14
|
+
* supported when using Codex with a ChatGPT account」→ `model_unavailable`(发现缓存过期时常见,提示刷新);
|
|
15
|
+
* 503 留给会话层现有重试;
|
|
14
16
|
* - 渠道跟随登录方式由会话层做(auth/chatgpt/follow.ts);到这里仍不符说明用户显式写了 `@渠道`,报
|
|
15
17
|
* `chatgpt_flavor_mismatch`(i18n);
|
|
16
18
|
* - 用量:`cost = 0`、`billing: "subscription"`。
|
|
@@ -220,6 +222,13 @@ export function recoverChatGptError(error, model, compat, options, apiKey, tried
|
|
|
220
222
|
return { kind: "retry" };
|
|
221
223
|
}
|
|
222
224
|
}
|
|
225
|
+
if (backend === "codex" &&
|
|
226
|
+
error.status === 400 &&
|
|
227
|
+
/not supported when using codex with a chatgpt account/i.test(error.body))
|
|
228
|
+
return {
|
|
229
|
+
kind: "fail",
|
|
230
|
+
error: new Error(`model_unavailable: ${msg().auth.request.modelUnavailable(`${provider}/${model.id}`)}`),
|
|
231
|
+
};
|
|
223
232
|
if (backend === "codex" &&
|
|
224
233
|
error.status === 400 &&
|
|
225
234
|
/instructions are not valid/i.test(error.body) &&
|