@armadra/agent 0.8.0 → 0.9.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.
Files changed (514) hide show
  1. package/CHANGELOG.md +52 -32
  2. package/CHANGELOG.zh-CN.md +69 -49
  3. package/README.md +162 -204
  4. package/README.zh-CN.md +150 -199
  5. package/dist/acp.d.ts +1 -1
  6. package/dist/acp.js +1 -1
  7. package/dist/agent/limits.d.ts +1 -1
  8. package/dist/agent/limits.js +1 -1
  9. package/dist/agent/loop-guard.d.ts +1 -1
  10. package/dist/agent/loop-guard.js +1 -1
  11. package/dist/agent/prompt-rules.d.ts +1 -1
  12. package/dist/agent/prompt-rules.js +1 -1
  13. package/dist/agent/reminders.d.ts +1 -1
  14. package/dist/agent/reminders.js +1 -1
  15. package/dist/agent/session-cache-key.d.ts +1 -1
  16. package/dist/agent/session-cache-key.js +1 -1
  17. package/dist/agent/session-extensions.d.ts +1 -1
  18. package/dist/agent/session-extensions.js +1 -1
  19. package/dist/agent/session-images.d.ts +1 -1
  20. package/dist/agent/session-images.js +1 -1
  21. package/dist/agent/session-plan.d.ts +1 -1
  22. package/dist/agent/session-plan.js +1 -1
  23. package/dist/agent/session-rewind.d.ts +1 -1
  24. package/dist/agent/session-rewind.js +1 -1
  25. package/dist/agent/session-settings.d.ts +1 -1
  26. package/dist/agent/session-settings.js +1 -1
  27. package/dist/agent/session-subagent.d.ts +1 -1
  28. package/dist/agent/session-subagent.js +1 -1
  29. package/dist/agent/session-telemetry.d.ts +1 -1
  30. package/dist/agent/session-telemetry.js +1 -1
  31. package/dist/agent/session-trace-writer.d.ts +1 -1
  32. package/dist/agent/session-trace-writer.js +1 -1
  33. package/dist/agent/session.js +1 -1
  34. package/dist/agent/subagent-background.d.ts +1 -1
  35. package/dist/agent/subagent-background.js +1 -1
  36. package/dist/agent/subagent-direct.d.ts +1 -1
  37. package/dist/agent/subagent-direct.js +1 -1
  38. package/dist/agent/subagent-fork.d.ts +1 -1
  39. package/dist/agent/subagent-fork.js +1 -1
  40. package/dist/agent/subagent-registry.d.ts +1 -1
  41. package/dist/agent/subagent-registry.js +1 -1
  42. package/dist/agent/system-prompt.js +1 -1
  43. package/dist/agent/tool-availability.d.ts +1 -1
  44. package/dist/agent/tool-availability.js +1 -1
  45. package/dist/agent/types-w5.d.ts +2 -2
  46. package/dist/agent/types-w5.js +1 -1
  47. package/dist/agent/types-w6.d.ts +1 -1
  48. package/dist/agent/types-w6.js +1 -1
  49. package/dist/agent/types.d.ts +1 -1
  50. package/dist/agent/worktree.d.ts +1 -1
  51. package/dist/agent/worktree.js +1 -1
  52. package/dist/agents/builtin.d.ts +1 -1
  53. package/dist/agents/builtin.js +1 -1
  54. package/dist/agents/catalog.d.ts +1 -1
  55. package/dist/agents/catalog.js +1 -1
  56. package/dist/agents/discover.d.ts +1 -1
  57. package/dist/agents/discover.js +1 -1
  58. package/dist/agents/external.d.ts +1 -1
  59. package/dist/agents/external.js +1 -1
  60. package/dist/agents/parse.d.ts +1 -1
  61. package/dist/agents/parse.js +1 -1
  62. package/dist/agents/result.d.ts +1 -1
  63. package/dist/agents/result.js +2 -2
  64. package/dist/agents/task-record.d.ts +3 -3
  65. package/dist/agents/task-record.js +2 -2
  66. package/dist/agents/types.d.ts +1 -1
  67. package/dist/agents/types.js +1 -1
  68. package/dist/ai/apis/anthropic-compat.d.ts +2 -2
  69. package/dist/ai/apis/anthropic-compat.js +2 -2
  70. package/dist/ai/apis/cache-params.d.ts +1 -1
  71. package/dist/ai/apis/cache-params.js +1 -1
  72. package/dist/ai/apis/chatgpt-backend.d.ts +1 -1
  73. package/dist/ai/apis/chatgpt-backend.js +1 -1
  74. package/dist/ai/apis/chatgpt-rate-limits.d.ts +1 -1
  75. package/dist/ai/apis/chatgpt-rate-limits.js +1 -1
  76. package/dist/ai/apis/max-tokens.d.ts +1 -1
  77. package/dist/ai/apis/max-tokens.js +1 -1
  78. package/dist/ai/apis/shared.d.ts +1 -1
  79. package/dist/ai/apis/shared.js +1 -1
  80. package/dist/ai/image-intern.d.ts +2 -2
  81. package/dist/ai/image-intern.js +1 -1
  82. package/dist/ai/image-limits.d.ts +1 -1
  83. package/dist/ai/image-limits.js +1 -1
  84. package/dist/ai/json-body.d.ts +1 -1
  85. package/dist/ai/json-body.js +1 -1
  86. package/dist/ai/providers/builtin.d.ts +2 -2
  87. package/dist/ai/providers/builtin.js +4 -4
  88. package/dist/ai/providers/catalog-data.js +2 -2
  89. package/dist/ai/providers/catalog.d.ts +2 -2
  90. package/dist/ai/providers/catalog.js +1 -1
  91. package/dist/ai/providers/channels.d.ts +1 -1
  92. package/dist/ai/providers/channels.js +1 -1
  93. package/dist/ai/providers/enrich.d.ts +1 -1
  94. package/dist/ai/providers/enrich.js +1 -1
  95. package/dist/ai/providers/models-dev-cache.d.ts +1 -1
  96. package/dist/ai/providers/models-dev-cache.js +1 -1
  97. package/dist/ai/providers/models-dev-data.d.ts +1 -1
  98. package/dist/ai/providers/models-dev-data.js +12 -12
  99. package/dist/ai/providers/models-dev-snapshot.d.ts +1 -1
  100. package/dist/ai/providers/models-dev-snapshot.js +1 -1
  101. package/dist/ai/providers/models-dev.d.ts +4 -4
  102. package/dist/ai/providers/models-dev.js +3 -3
  103. package/dist/ai/types.d.ts +2 -2
  104. package/dist/ai/types.js +1 -1
  105. package/dist/auth/chatgpt/cli.d.ts +1 -1
  106. package/dist/auth/chatgpt/cli.js +1 -1
  107. package/dist/auth/chatgpt/host-id.d.ts +1 -1
  108. package/dist/auth/chatgpt/host-id.js +1 -1
  109. package/dist/auth/chatgpt/login.d.ts +1 -1
  110. package/dist/auth/chatgpt/login.js +1 -1
  111. package/dist/auth/chatgpt/presets.d.ts +1 -1
  112. package/dist/auth/chatgpt/presets.js +1 -1
  113. package/dist/auth/oauth/callback-server.d.ts +1 -1
  114. package/dist/auth/oauth/callback-server.js +1 -1
  115. package/dist/auth/oauth/flows.d.ts +1 -1
  116. package/dist/auth/oauth/flows.js +1 -1
  117. package/dist/auth/oauth/oidc.d.ts +1 -1
  118. package/dist/auth/oauth/oidc.js +1 -1
  119. package/dist/auth/oauth/pkce.d.ts +1 -1
  120. package/dist/auth/oauth/pkce.js +1 -1
  121. package/dist/auth/oauth/refresh.d.ts +1 -1
  122. package/dist/auth/oauth/refresh.js +1 -1
  123. package/dist/auth/oauth/token-client.d.ts +1 -1
  124. package/dist/auth/oauth/token-client.js +1 -1
  125. package/dist/auth/oauth/token-store.d.ts +1 -1
  126. package/dist/auth/oauth/token-store.js +1 -1
  127. package/dist/auth/testing/fake-oauth.d.ts +1 -1
  128. package/dist/auth/testing/fake-oauth.js +1 -1
  129. package/dist/bundle/ama.cjs +41 -38
  130. package/dist/checkpoints/backend.js +6 -1
  131. package/dist/checkpoints/blobs.d.ts +1 -1
  132. package/dist/checkpoints/blobs.js +1 -1
  133. package/dist/checkpoints/gc.d.ts +1 -1
  134. package/dist/checkpoints/gc.js +1 -1
  135. package/dist/checkpoints/git-head.d.ts +1 -1
  136. package/dist/checkpoints/git-head.js +1 -1
  137. package/dist/checkpoints/index.d.ts +1 -1
  138. package/dist/checkpoints/index.js +1 -1
  139. package/dist/checkpoints/replay.d.ts +1 -1
  140. package/dist/checkpoints/replay.js +1 -1
  141. package/dist/checkpoints/restore.d.ts +1 -1
  142. package/dist/checkpoints/restore.js +1 -1
  143. package/dist/checkpoints/settings.d.ts +1 -1
  144. package/dist/checkpoints/settings.js +1 -1
  145. package/dist/checkpoints/shadow-git.d.ts +1 -1
  146. package/dist/checkpoints/shadow-git.js +1 -1
  147. package/dist/checkpoints/shadow-restore.d.ts +1 -1
  148. package/dist/checkpoints/shadow-restore.js +1 -1
  149. package/dist/checkpoints/tracker.d.ts +1 -1
  150. package/dist/checkpoints/tracker.js +1 -1
  151. package/dist/checkpoints/types.d.ts +1 -1
  152. package/dist/checkpoints/types.js +1 -1
  153. package/dist/cli/args.d.ts +2 -2
  154. package/dist/cli/args.js +1 -1
  155. package/dist/cli/bootstrap.js +1 -1
  156. package/dist/cli/choice-prompt.d.ts +1 -1
  157. package/dist/cli/choice-prompt.js +1 -1
  158. package/dist/cli/codemode-notice.d.ts +1 -1
  159. package/dist/cli/codemode-notice.js +1 -1
  160. package/dist/cli/compose-agents.d.ts +1 -1
  161. package/dist/cli/compose-agents.js +1 -1
  162. package/dist/cli/compose-extensions.d.ts +1 -1
  163. package/dist/cli/compose-extensions.js +1 -1
  164. package/dist/cli/compose-memory.d.ts +1 -1
  165. package/dist/cli/compose-memory.js +1 -1
  166. package/dist/cli/compose-providers.d.ts +1 -1
  167. package/dist/cli/compose-providers.js +1 -1
  168. package/dist/cli/compose-request.d.ts +1 -1
  169. package/dist/cli/compose-request.js +1 -1
  170. package/dist/cli/from-prompt.d.ts +1 -1
  171. package/dist/cli/from-prompt.js +1 -1
  172. package/dist/cli/main.d.ts +1 -1
  173. package/dist/cli/main.js +1 -1
  174. package/dist/cli/subcommands/auth.d.ts +1 -1
  175. package/dist/cli/subcommands/auth.js +1 -1
  176. package/dist/cli/subcommands/config-set.d.ts +1 -1
  177. package/dist/cli/subcommands/config-set.js +1 -1
  178. package/dist/cli/subcommands/doctor.js +1 -1
  179. package/dist/cli/subcommands/init.d.ts +1 -1
  180. package/dist/cli/subcommands/init.js +1 -1
  181. package/dist/cli/subcommands/memory.d.ts +1 -1
  182. package/dist/cli/subcommands/memory.js +1 -1
  183. package/dist/cli/subcommands/models.js +1 -1
  184. package/dist/cli/subcommands/providers-list.d.ts +1 -1
  185. package/dist/cli/subcommands/providers-list.js +1 -1
  186. package/dist/cli/subcommands/providers-plan.d.ts +1 -1
  187. package/dist/cli/subcommands/providers-plan.js +1 -1
  188. package/dist/cli/subcommands/providers.d.ts +1 -1
  189. package/dist/cli/subcommands/providers.js +1 -1
  190. package/dist/cli/subcommands/sessions-export.d.ts +1 -1
  191. package/dist/cli/subcommands/sessions-export.js +1 -1
  192. package/dist/cli/subcommands/sessions-trace.d.ts +1 -1
  193. package/dist/cli/subcommands/sessions-trace.js +1 -1
  194. package/dist/cli/subcommands/sessions.d.ts +1 -1
  195. package/dist/cli/subcommands/sessions.js +1 -1
  196. package/dist/cli/subcommands/stats.d.ts +1 -1
  197. package/dist/cli/subcommands/stats.js +1 -1
  198. package/dist/codemode/capability.d.ts +1 -1
  199. package/dist/codemode/capability.js +1 -1
  200. package/dist/codemode/host-side.d.ts +2 -2
  201. package/dist/codemode/host-side.js +2 -2
  202. package/dist/compaction/image-budget.d.ts +1 -1
  203. package/dist/compaction/image-budget.js +1 -1
  204. package/dist/config/edit.d.ts +1 -1
  205. package/dist/config/edit.js +1 -1
  206. package/dist/config/init.d.ts +1 -1
  207. package/dist/config/init.js +1 -1
  208. package/dist/config/json-schema.d.ts +2 -2
  209. package/dist/config/json-schema.js +2 -2
  210. package/dist/config/schema-w5.d.ts +1 -1
  211. package/dist/config/schema-w5.js +1 -1
  212. package/dist/config/schema-w6.d.ts +1 -1
  213. package/dist/config/schema-w6.js +1 -1
  214. package/dist/config/settings-registry.d.ts +1 -1
  215. package/dist/config/settings-registry.js +1 -1
  216. package/dist/config/types-w5.d.ts +2 -2
  217. package/dist/config/types-w5.js +2 -2
  218. package/dist/config/types-w6.d.ts +5 -5
  219. package/dist/config/types-w6.js +1 -1
  220. package/dist/config/types.d.ts +6 -6
  221. package/dist/config/types.js +1 -1
  222. package/dist/drivers/acp/client.d.ts +1 -1
  223. package/dist/drivers/acp/client.js +1 -1
  224. package/dist/drivers/acp/driver.d.ts +1 -1
  225. package/dist/drivers/acp/driver.js +1 -1
  226. package/dist/drivers/acp/testing/fake-agent.d.ts +1 -1
  227. package/dist/drivers/acp/testing/fake-agent.js +1 -1
  228. package/dist/drivers/acp/types.d.ts +1 -1
  229. package/dist/drivers/acp/types.js +1 -1
  230. package/dist/drivers/agents.d.ts +1 -1
  231. package/dist/drivers/agents.js +1 -1
  232. package/dist/drivers/base.d.ts +1 -1
  233. package/dist/drivers/base.js +1 -1
  234. package/dist/drivers/catalog.d.ts +1 -1
  235. package/dist/drivers/catalog.js +1 -1
  236. package/dist/drivers/env.d.ts +1 -1
  237. package/dist/drivers/env.js +1 -1
  238. package/dist/drivers/host-runners.d.ts +1 -1
  239. package/dist/drivers/host-runners.js +1 -1
  240. package/dist/drivers/jsonrpc.d.ts +1 -1
  241. package/dist/drivers/jsonrpc.js +1 -1
  242. package/dist/drivers/native/claude-normalize.d.ts +1 -1
  243. package/dist/drivers/native/claude-normalize.js +1 -1
  244. package/dist/drivers/native/claude-stream.d.ts +1 -1
  245. package/dist/drivers/native/claude-stream.js +1 -1
  246. package/dist/drivers/native/codex-app-server.d.ts +1 -1
  247. package/dist/drivers/native/codex-app-server.js +1 -1
  248. package/dist/drivers/native/codex-normalize.d.ts +1 -1
  249. package/dist/drivers/native/codex-normalize.js +1 -1
  250. package/dist/drivers/native/oneshot.d.ts +1 -1
  251. package/dist/drivers/native/oneshot.js +1 -1
  252. package/dist/drivers/permissions.d.ts +1 -1
  253. package/dist/drivers/permissions.js +1 -1
  254. package/dist/drivers/pids.d.ts +1 -1
  255. package/dist/drivers/pids.js +1 -1
  256. package/dist/drivers/pool.d.ts +1 -1
  257. package/dist/drivers/pool.js +1 -1
  258. package/dist/drivers/probe.d.ts +1 -1
  259. package/dist/drivers/probe.js +1 -1
  260. package/dist/drivers/process.d.ts +1 -1
  261. package/dist/drivers/process.js +1 -1
  262. package/dist/drivers/runner.d.ts +1 -1
  263. package/dist/drivers/runner.js +1 -1
  264. package/dist/drivers/store.d.ts +1 -1
  265. package/dist/drivers/store.js +1 -1
  266. package/dist/drivers/types.d.ts +1 -1
  267. package/dist/drivers/types.js +1 -1
  268. package/dist/git/info.d.ts +1 -1
  269. package/dist/git/info.js +1 -1
  270. package/dist/host/api-impl.d.ts +1 -1
  271. package/dist/host/api-impl.js +1 -1
  272. package/dist/host/types.d.ts +2 -2
  273. package/dist/i18n/catalog.d.ts +2 -2
  274. package/dist/i18n/catalog.js +2 -2
  275. package/dist/i18n/format.d.ts +1 -1
  276. package/dist/i18n/format.js +1 -1
  277. package/dist/i18n/index.d.ts +1 -1
  278. package/dist/i18n/index.js +1 -1
  279. package/dist/i18n/messages/acp.d.ts +1 -1
  280. package/dist/i18n/messages/acp.js +1 -1
  281. package/dist/i18n/messages/agents.d.ts +1 -1
  282. package/dist/i18n/messages/agents.js +1 -1
  283. package/dist/i18n/messages/approval.d.ts +1 -1
  284. package/dist/i18n/messages/approval.js +1 -1
  285. package/dist/i18n/messages/auth.d.ts +1 -1
  286. package/dist/i18n/messages/auth.js +1 -1
  287. package/dist/i18n/messages/cli.d.ts +1 -1
  288. package/dist/i18n/messages/cli.js +1 -1
  289. package/dist/i18n/messages/config-keys.js +12 -12
  290. package/dist/i18n/messages/config.d.ts +1 -1
  291. package/dist/i18n/messages/config.js +3 -3
  292. package/dist/i18n/messages/drivers.d.ts +1 -1
  293. package/dist/i18n/messages/drivers.js +1 -1
  294. package/dist/i18n/messages/errors.d.ts +1 -1
  295. package/dist/i18n/messages/errors.js +1 -1
  296. package/dist/i18n/messages/interactive-line.d.ts +1 -1
  297. package/dist/i18n/messages/interactive-line.js +1 -1
  298. package/dist/i18n/messages/interactive-startup.d.ts +1 -1
  299. package/dist/i18n/messages/interactive-startup.js +1 -1
  300. package/dist/i18n/messages/interactive-view.d.ts +1 -1
  301. package/dist/i18n/messages/interactive-view.js +1 -1
  302. package/dist/i18n/messages/interactive.d.ts +1 -1
  303. package/dist/i18n/messages/interactive.js +1 -1
  304. package/dist/i18n/messages/memory.d.ts +1 -1
  305. package/dist/i18n/messages/memory.js +1 -1
  306. package/dist/i18n/messages/panels.d.ts +1 -1
  307. package/dist/i18n/messages/panels.js +1 -1
  308. package/dist/i18n/messages/permissions.d.ts +1 -1
  309. package/dist/i18n/messages/permissions.js +1 -1
  310. package/dist/i18n/messages/plan.d.ts +1 -1
  311. package/dist/i18n/messages/plan.js +1 -1
  312. package/dist/i18n/messages/print.d.ts +2 -2
  313. package/dist/i18n/messages/print.js +2 -2
  314. package/dist/i18n/messages/report-context.d.ts +1 -1
  315. package/dist/i18n/messages/report-context.js +1 -1
  316. package/dist/i18n/messages/report.d.ts +1 -1
  317. package/dist/i18n/messages/report.js +1 -1
  318. package/dist/i18n/messages/rewind.d.ts +1 -1
  319. package/dist/i18n/messages/rewind.js +1 -1
  320. package/dist/i18n/messages/session.d.ts +1 -1
  321. package/dist/i18n/messages/session.js +1 -1
  322. package/dist/i18n/messages/settings.d.ts +1 -1
  323. package/dist/i18n/messages/settings.js +1 -1
  324. package/dist/i18n/messages/subcommands.d.ts +1 -1
  325. package/dist/i18n/messages/subcommands.js +1 -1
  326. package/dist/i18n/messages/trace.d.ts +1 -1
  327. package/dist/i18n/messages/trace.js +1 -1
  328. package/dist/i18n/types.d.ts +1 -1
  329. package/dist/i18n/types.js +1 -1
  330. package/dist/memory/frontmatter.d.ts +1 -1
  331. package/dist/memory/frontmatter.js +1 -1
  332. package/dist/memory/index.d.ts +1 -1
  333. package/dist/memory/index.js +1 -1
  334. package/dist/memory/lock.d.ts +1 -1
  335. package/dist/memory/lock.js +1 -1
  336. package/dist/memory/paths.d.ts +1 -1
  337. package/dist/memory/paths.js +1 -1
  338. package/dist/memory/runtime.d.ts +1 -1
  339. package/dist/memory/runtime.js +1 -1
  340. package/dist/memory/secrets.d.ts +1 -1
  341. package/dist/memory/secrets.js +1 -1
  342. package/dist/memory/section.d.ts +1 -1
  343. package/dist/memory/section.js +1 -1
  344. package/dist/memory/store.d.ts +1 -1
  345. package/dist/memory/store.js +1 -1
  346. package/dist/memory/tool.d.ts +1 -1
  347. package/dist/memory/tool.js +1 -1
  348. package/dist/modes/acp/acp-auth-gate.d.ts +1 -1
  349. package/dist/modes/acp/acp-auth-gate.js +1 -1
  350. package/dist/modes/acp/acp-config.d.ts +1 -1
  351. package/dist/modes/acp/acp-config.js +1 -1
  352. package/dist/modes/acp/acp-connection.d.ts +1 -1
  353. package/dist/modes/acp/acp-connection.js +1 -1
  354. package/dist/modes/acp/acp-events.d.ts +1 -1
  355. package/dist/modes/acp/acp-events.js +1 -1
  356. package/dist/modes/acp/acp-mode.d.ts +1 -1
  357. package/dist/modes/acp/acp-mode.js +1 -1
  358. package/dist/modes/acp/acp-server.d.ts +2 -2
  359. package/dist/modes/acp/acp-server.js +2 -2
  360. package/dist/modes/acp/acp-sessions.d.ts +2 -2
  361. package/dist/modes/acp/acp-sessions.js +2 -2
  362. package/dist/modes/acp/acp-tool-text.d.ts +1 -1
  363. package/dist/modes/acp/acp-tool-text.js +1 -1
  364. package/dist/modes/commands-core.js +1 -1
  365. package/dist/modes/image-input.d.ts +1 -1
  366. package/dist/modes/image-input.js +1 -1
  367. package/dist/modes/interactive/agent-bar.d.ts +1 -1
  368. package/dist/modes/interactive/agent-bar.js +1 -1
  369. package/dist/modes/interactive/agent-transcript.d.ts +1 -1
  370. package/dist/modes/interactive/agent-transcript.js +1 -1
  371. package/dist/modes/interactive/agent-view.d.ts +1 -1
  372. package/dist/modes/interactive/agent-view.js +1 -1
  373. package/dist/modes/interactive/approval-dock.d.ts +1 -1
  374. package/dist/modes/interactive/approval-dock.js +1 -1
  375. package/dist/modes/interactive/config-panel.d.ts +1 -1
  376. package/dist/modes/interactive/config-panel.js +1 -1
  377. package/dist/modes/interactive/config-ui.d.ts +1 -1
  378. package/dist/modes/interactive/config-ui.js +1 -1
  379. package/dist/modes/interactive/memory-panel.d.ts +1 -1
  380. package/dist/modes/interactive/memory-panel.js +1 -1
  381. package/dist/modes/interactive/plan-command.d.ts +1 -1
  382. package/dist/modes/interactive/plan-command.js +1 -1
  383. package/dist/modes/interactive/plan-dialog.d.ts +1 -1
  384. package/dist/modes/interactive/plan-dialog.js +1 -1
  385. package/dist/modes/interactive/plan-flow.d.ts +1 -1
  386. package/dist/modes/interactive/plan-flow.js +1 -1
  387. package/dist/modes/interactive/subagent-view.d.ts +1 -1
  388. package/dist/modes/interactive/subagent-view.js +1 -1
  389. package/dist/modes/interactive/task-background.d.ts +1 -1
  390. package/dist/modes/interactive/task-background.js +1 -1
  391. package/dist/modes/interactive/trace-view.d.ts +1 -1
  392. package/dist/modes/interactive/trace-view.js +1 -1
  393. package/dist/modes/print/json-event.d.ts +1 -1
  394. package/dist/modes/print/json-event.js +2 -2
  395. package/dist/modes/print/print-mode.d.ts +1 -1
  396. package/dist/modes/print/print-mode.js +1 -1
  397. package/dist/modes/print/search-hint.d.ts +1 -1
  398. package/dist/modes/print/search-hint.js +1 -1
  399. package/dist/modes/rpc/commands.js +2 -2
  400. package/dist/permissions/auto-safe.d.ts +1 -1
  401. package/dist/permissions/auto-safe.js +1 -1
  402. package/dist/permissions/bypass.d.ts +1 -1
  403. package/dist/permissions/bypass.js +1 -1
  404. package/dist/permissions/classifier.d.ts +1 -1
  405. package/dist/permissions/classifier.js +1 -1
  406. package/dist/permissions/memory-class.d.ts +1 -1
  407. package/dist/permissions/memory-class.js +1 -1
  408. package/dist/permissions/pipeline.d.ts +2 -2
  409. package/dist/permissions/pipeline.js +2 -2
  410. package/dist/permissions/protected.d.ts +1 -1
  411. package/dist/permissions/protected.js +1 -1
  412. package/dist/permissions/readonly-bash.d.ts +1 -1
  413. package/dist/permissions/readonly-bash.js +1 -1
  414. package/dist/permissions/types.d.ts +2 -2
  415. package/dist/plan/done-markers.d.ts +1 -1
  416. package/dist/plan/done-markers.js +1 -1
  417. package/dist/plan/extract.d.ts +1 -1
  418. package/dist/plan/extract.js +1 -1
  419. package/dist/plan/prompts.d.ts +1 -1
  420. package/dist/plan/prompts.js +1 -1
  421. package/dist/plan/store.d.ts +1 -1
  422. package/dist/plan/store.js +1 -1
  423. package/dist/rpc.d.ts +3 -3
  424. package/dist/rpc.js +3 -3
  425. package/dist/sandbox/bash.d.ts +1 -1
  426. package/dist/sandbox/bash.js +1 -1
  427. package/dist/sandbox/detect.d.ts +1 -1
  428. package/dist/sandbox/detect.js +1 -1
  429. package/dist/sandbox/index.d.ts +1 -1
  430. package/dist/sandbox/index.js +1 -1
  431. package/dist/sandbox/profile.d.ts +1 -1
  432. package/dist/sandbox/profile.js +1 -1
  433. package/dist/sandbox/wrap.d.ts +1 -1
  434. package/dist/sandbox/wrap.js +1 -1
  435. package/dist/sdk.d.ts +3 -3
  436. package/dist/sdk.js +2 -2
  437. package/dist/session/line-reader.d.ts +1 -1
  438. package/dist/session/line-reader.js +1 -1
  439. package/dist/session/list.d.ts +1 -1
  440. package/dist/session/list.js +1 -1
  441. package/dist/session/migrate.d.ts +1 -1
  442. package/dist/session/migrate.js +1 -1
  443. package/dist/session/store.d.ts +1 -1
  444. package/dist/session/store.js +1 -1
  445. package/dist/skills/builtin.js +2 -2
  446. package/dist/tools/background-jobs.d.ts +1 -1
  447. package/dist/tools/background-jobs.js +1 -1
  448. package/dist/tools/clipboard-image.d.ts +1 -1
  449. package/dist/tools/clipboard-image.js +1 -1
  450. package/dist/tools/edit.d.ts +1 -1
  451. package/dist/tools/edit.js +1 -1
  452. package/dist/tools/grep.d.ts +1 -1
  453. package/dist/tools/grep.js +1 -1
  454. package/dist/tools/image-resize.d.ts +1 -1
  455. package/dist/tools/image-resize.js +1 -1
  456. package/dist/tools/read-lines.d.ts +1 -1
  457. package/dist/tools/read-lines.js +1 -1
  458. package/dist/tools/read.d.ts +1 -1
  459. package/dist/tools/read.js +1 -1
  460. package/dist/tools/task-ctl.d.ts +1 -1
  461. package/dist/tools/task-ctl.js +1 -1
  462. package/dist/tools/task.d.ts +2 -2
  463. package/dist/tools/task.js +2 -2
  464. package/dist/tools/types.d.ts +3 -3
  465. package/dist/tools/types.js +1 -1
  466. package/dist/trace/build.d.ts +1 -1
  467. package/dist/trace/build.js +1 -1
  468. package/dist/trace/detail.d.ts +1 -1
  469. package/dist/trace/detail.js +1 -1
  470. package/dist/trace/flatten.d.ts +1 -1
  471. package/dist/trace/flatten.js +1 -1
  472. package/dist/trace/format.d.ts +1 -1
  473. package/dist/trace/format.js +1 -1
  474. package/dist/trace/html-template.d.ts +1 -1
  475. package/dist/trace/html-template.js +1 -1
  476. package/dist/trace/html.d.ts +1 -1
  477. package/dist/trace/html.js +1 -1
  478. package/dist/trace/query-session.d.ts +1 -1
  479. package/dist/trace/query-session.js +1 -1
  480. package/dist/trace/query.d.ts +1 -1
  481. package/dist/trace/query.js +1 -1
  482. package/dist/trace/types.d.ts +1 -1
  483. package/dist/trace/types.js +1 -1
  484. package/dist/tui/components/settings-list.d.ts +1 -1
  485. package/dist/tui/components/settings-list.js +1 -1
  486. package/docs/README.md +85 -0
  487. package/docs/assets/ama-wordmark-dark.svg +37 -0
  488. package/docs/assets/ama-wordmark-light.svg +37 -0
  489. package/docs/en/README.md +39 -0
  490. package/docs/en/{permissions.md → guides/permissions.md} +14 -14
  491. package/docs/en/{providers.md → guides/providers.md} +6 -6
  492. package/docs/en/{sessions.md → guides/sessions.md} +6 -6
  493. package/docs/en/{tui.md → guides/tui.md} +15 -15
  494. package/docs/en/{acp.md → reference/acp.md} +6 -6
  495. package/docs/en/{host-api.md → reference/host-api.md} +7 -7
  496. package/docs/en/{rpc.md → reference/rpc.md} +13 -13
  497. package/docs/{agents.md → guides/agents.md} +13 -13
  498. package/docs/{codemode.md → guides/codemode.md} +3 -3
  499. package/docs/{hooks.md → guides/hooks.md} +2 -2
  500. package/docs/guides/i18n.md +93 -0
  501. package/docs/{memory.md → guides/memory.md} +1 -1
  502. package/docs/{permissions.md → guides/permissions.md} +2 -2
  503. package/docs/{plan.md → guides/plan.md} +4 -4
  504. package/docs/{providers.md → guides/providers.md} +4 -4
  505. package/docs/{sessions.md → guides/sessions.md} +5 -5
  506. package/docs/{tui.md → guides/tui.md} +8 -8
  507. package/docs/{acp.md → reference/acp.md} +5 -5
  508. package/docs/{host-api.md → reference/host-api.md} +4 -4
  509. package/docs/{rpc.md → reference/rpc.md} +11 -11
  510. package/docs/{session-format.md → reference/session-format.md} +7 -7
  511. package/package.json +12 -23
  512. package/docs/rewind-plan.md +0 -181
  513. package/docs/tui-design.md +0 -764
  514. /package/docs/{sandbox.md → guides/sandbox.md} +0 -0
package/README.md CHANGED
@@ -1,154 +1,160 @@
1
- # ama
1
+ <div align="center">
2
2
 
3
- [![CI](https://github.com/Owlbay/armadra-agent/actions/workflows/ci.yml/badge.svg)](https://github.com/Owlbay/armadra-agent/actions/workflows/ci.yml)
4
- [![npm](https://img.shields.io/npm/v/@armadra/agent)](https://www.npmjs.com/package/@armadra/agent)
5
- [![license](https://img.shields.io/npm/l/@armadra/agent)](LICENSE)
6
- [![node](https://img.shields.io/node/v/@armadra/agent)](https://nodejs.org)
3
+ <picture>
4
+ <source media="(prefers-color-scheme: dark)" srcset="docs/assets/ama-wordmark-dark.svg">
5
+ <img src="docs/assets/ama-wordmark-light.svg" alt="ama" width="216">
6
+ </picture>
7
7
 
8
8
  English · [简体中文](README.zh-CN.md)
9
9
 
10
- A coding agent for your terminal that can also coordinate other agents. Use it on its own, or embed it in the [Armadra](https://github.com/Owlbay/Armadra) canvas.
10
+ **A coding agent for your terminal that scripts, editors and hosts can call, and that can hand work to other coding agents.**
11
11
 
12
- ```text
13
- ▄███▄ ██▄ ▄██ ▄███▄ ama
14
- ██▀ ▀██ ███▄ ▄███ ██▀ ▀██ anthropic/claude-sonnet-4-5@messages · thinking medium
15
- ███████ ██ ▀█▀ ██ ███████ ~/Projects/demo · trusted
16
- ██ ██ ██ ██ ██ ██ Accept edits · preset default
17
- ▀▀ ▀▀ ▀▀ ▀▀ ▀▀ ▀▀ AGENTS.md · 2 Skill
18
- /help commands · Shift+Tab mode · Ctrl+O expand tool output
19
- ```
12
+ [![CI](https://github.com/AMA-Link/armadra-agent/actions/workflows/ci.yml/badge.svg)](https://github.com/AMA-Link/armadra-agent/actions/workflows/ci.yml)
13
+ [![npm](https://img.shields.io/npm/v/@armadra/agent)](https://www.npmjs.com/package/@armadra/agent)
14
+ [![license](https://img.shields.io/npm/l/@armadra/agent)](LICENSE)
15
+ [![node](https://img.shields.io/node/v/@armadra/agent)](https://nodejs.org)
20
16
 
21
- - [What is ama](#what-is-ama)
22
- - [Quick start](#quick-start)
23
- - [Capabilities](#capabilities)
24
- - [Embedding and integration](#embedding-and-integration)
25
- - [Command reference](#command-reference)
26
- - [Exit codes](#exit-codes)
27
- - [Documentation](#documentation)
28
- - [Known limitations](#known-limitations)
29
- - [Development](#development)
30
- - [License and acknowledgements](#license-and-acknowledgements)
17
+ [Install](#install) · [Connect a model](#connect-a-model) · [Usage](#usage) · [Configuration and permissions](#configuration-and-permissions) · [Docs](docs/README.md) · [Changelog](CHANGELOG.md)
31
18
 
32
- ## What is ama
19
+ </div>
33
20
 
34
- ama reads, edits and runs code in your project from a terminal UI, and answers one-shot questions with `ama -p`. It can also hand work to other agents: its own sub-agents, or external coding agents such as Claude Code, Codex and any ACP agent, each using that CLI's own login. Inside Armadra it acts as the coordinator on the canvas: it dispatches work to other CLI agents, collects their reports and summarizes them.
21
+ ---
35
22
 
36
- Design choices:
23
+ ama reads, edits and runs code in your project from a terminal UI, and answers one-shot questions with `ama -p`. It can
24
+ delegate to its own sub-agents or drive external coding agents (Claude Code, Codex, GitHub Copilot CLI, OpenCode, Pi and
25
+ any ACP agent) with the login you already have in each CLI. Use it on its own, from your editor over ACP, embedded through
26
+ RPC or the SDK, or as the coordinator on the [Armadra](https://github.com/AMA-Link/Armadra) canvas.
37
27
 
38
- - **Small and self-contained**: TypeScript with zero runtime dependencies; also shipped as a single `ama.cjs` file. Requires Node ≥ 22.
39
- - **Built to be called**: `-p`, `--mode rpc`, `--mode acp`, the SDK and host adapters are first-class entry points; exit codes and JSON shapes are contracts.
40
- - **Cache first**: the request prefix stays byte-stable, cache breakpoints follow each provider, and the UI shows whether the cache works and why it missed. The system prompt plus tool table of the main presets stays within token budgets enforced by tests.
41
- - **Approvals are never answered for you**: neither ama nor the model answers a permission prompt on a person's behalf; when nobody can approve, the answer is "deny".
42
- - **Skills, not MCP**: extend ama with `SKILL.md` directories, prompt templates, command hooks and host adapters.
43
- - **Little configuration**: one environment variable is enough to start; everything else has a default.
28
+ ## Why ama
44
29
 
45
- ## Quick start
30
+ - **Zero runtime dependencies**: TypeScript on Node ≥ 22 with nothing in `dependencies`; also shipped as a single
31
+ `ama.cjs` file. HTTP, SSE, YAML frontmatter and JSON Schema handling are written in-house.
32
+ - **Cache first**: the system prompt and tool table stay byte-stable within a session, changes are only appended, cache
33
+ breakpoints follow each provider, and the status bar shows the hit rate and why a request missed. Token budgets for
34
+ the main tool presets are enforced by tests.
35
+ - **Approvals go to a person**: neither ama nor the model answers a permission prompt, including those raised by
36
+ sub-agents and external agents. When nobody can approve (`-p`, unattended RPC), the answer is "deny".
37
+ - **Built to be called**: `-p`, `--mode rpc`, `--mode acp`, the SDK and host adapters are first-class entry points;
38
+ exit codes and JSON shapes are contracts, versioned and checked before every release.
39
+ - **Skills, not MCP**: extend ama with `SKILL.md` directories, prompt templates, command hooks and host adapters.
46
40
 
47
- ### Install
41
+ ## Install
48
42
 
49
43
  ```sh
50
44
  npm i -g @armadra/agent
51
45
  ama --version
52
46
  ```
53
47
 
54
- [Releases](https://github.com/Owlbay/armadra-agent/releases) also ship a single-file build (`ama.cjs` plus the codemode sandbox entry `ama-sandbox.cjs`, kept in the same directory) and `package.tgz` for offline installs.
48
+ Each [release](https://github.com/AMA-Link/armadra-agent/releases) also ships a single-file build (`ama.cjs` plus the
49
+ codemode sandbox entry `ama-sandbox.cjs`, kept in the same directory) and `package.tgz` for offline installs.
55
50
 
56
- ### Connect a model
51
+ ## Connect a model
57
52
 
58
53
  Pick one:
59
54
 
60
55
  ```sh
61
- export ANTHROPIC_API_KEY=sk-... # or OPENAI_API_KEY, GEMINI_API_KEY, DEEPSEEK_API_KEY, …
62
- ama auth set deepseek # store a key in ~/.config/ama/auth.json (0600), read from stdin
63
- ama providers add packy --base-url https://proxy.example/v1 --probe # a relay or gateway: baseUrl + key
64
- ama auth login chatgpt # your own ChatGPT Plus / Pro plan instead of an API key
65
- ama --model ollama/<model> # local Ollama / LM Studio need no key
56
+ export ANTHROPIC_API_KEY=sk-... # or OPENAI_API_KEY, GEMINI_API_KEY, DEEPSEEK_API_KEY, …
57
+ ama auth set deepseek # store a key in ~/.config/ama/auth.json (0600), read from stdin
58
+ ama auth login chatgpt # use your own ChatGPT Plus / Pro plan instead of an API key
59
+ ama providers add packy --base-url https://relay.example/v1 --probe # a relay: list models, probe protocols, write config
60
+ ama --model ollama/<model> # local Ollama / LM Studio need no key
66
61
  ```
67
62
 
68
- With a key present, ama picks the first provider that has one and that provider's default model; `ama config show` explains which and why.
63
+ - **Built-in providers (18)**: Anthropic, OpenAI, Google, DeepSeek, Moonshot (Kimi), Zhipu, Qwen (DashScope), OpenRouter,
64
+ Groq, xAI, Mistral, MiniMax, StepFun, Volcengine Ark, Tencent, ChatGPT (plan login), Ollama and LM Studio, over four
65
+ protocols: Anthropic Messages, OpenAI Responses, OpenAI Chat Completions and Google Generative AI.
66
+ - **Channels**: one provider can expose several endpoints; `provider/model@channel` picks one, e.g.
67
+ `deepseek/deepseek-v4-pro@messages`.
68
+ - **Model metadata** (context window, output limit, image input, reasoning, prices) comes from a bundled models.dev
69
+ snapshot, so startup needs no network; `ama models refresh` updates it on demand.
70
+ - With a key present, ama picks the first provider that has one and its default model; `ama config show` says which
71
+ and why.
72
+
73
+ Details: [providers and models](docs/en/guides/providers.md), [ChatGPT login](docs/en/guides/providers.md#chatgpt-login),
74
+ [connecting relays](docs/en/guides/providers.md#connecting-relays).
75
+
76
+ ## Usage
69
77
 
70
- ### First conversation
78
+ ### Terminal UI
71
79
 
72
80
  ```sh
73
81
  cd your-project
74
- ama # terminal UI
75
- ama -p "explain src/index.ts" # one-shot: prints the answer and exits
76
- git diff | ama -p "review this change" # piped input is appended to the prompt
77
- ama -p "list the TODOs" --output-format json
82
+ ama
78
83
  ```
79
84
 
80
- `-p` has nobody to approve, so writes and commands are denied unless you allow them (`--permission-mode auto-edit`, `auto`, or `--allow "bash(npm test*)"`).
81
-
82
- ### Keys to know
83
-
84
85
  | Key / command | Effect |
85
86
  | ---------------------- | --------------------------------------------------------------------------- |
86
87
  | Shift+Tab (Tab, empty) | Cycle permission modes; entering Bypass asks to confirm |
87
- | `/model` (Ctrl+L) | Pick a model; Tab shows all providers, Space adds the model to your list |
88
+ | `/model` (Ctrl+L) | Pick a model |
88
89
  | ↓ on an empty input | Focus the agent bar; Enter opens a live view of a sub-agent |
89
90
  | Ctrl+B | Move a blocking foreground sub-agent to the background (in tmux: `C-b C-b`) |
90
91
  | Esc / Esc Esc | Interrupt the run / (idle, empty input) open the rewind list |
91
- | Ctrl+G | Status bar: full ↔ compact |
92
- | Ctrl+O | Expand / fold tool output and thinking |
92
+ | `/plan <goal>` | Research read-only, then approve a plan before anything is changed |
93
+ | `/trace` | Tree of turns, requests, tools and sub-agents with timing |
93
94
  | `/config` | Settings panel |
94
- | Ctrl+C twice | Quit (the resume command stays in the scrollback) |
95
-
96
- `/help` lists every command. Keys can be remapped in `~/.config/ama/keybindings.json`; see [docs/en/tui.md](docs/en/tui.md#keys).
97
-
98
- ## Capabilities
99
-
100
- ### Models and providers
101
-
102
- Four protocol lines (Anthropic Messages, OpenAI Responses, OpenAI Chat Completions, Google Generative AI) and 18 built-in providers: Anthropic, OpenAI, Google, DeepSeek, Moonshot (Kimi), Zhipu, Qwen (DashScope), OpenRouter, Groq, xAI, Mistral, MiniMax, StepFun, Volcengine Ark, Tencent, ChatGPT (plan login), Ollama and LM Studio. One provider can mount several channels; Messages / Responses are preferred and Chat is the fallback, and `provider/model@channel` picks one explicitly. Relays connect with `ama providers add`, which lists the models, probes the channels and writes the config. Context window, output limit, image input, reasoning and prices come from a bundled models.dev snapshot, so startup needs no network (`ama models refresh` updates it on demand). `models.enabled` (`ama models enable|disable`, or Space in `/model`) keeps the picker to the models you use. See [docs/en/providers.md](docs/en/providers.md) and [ChatGPT login](docs/en/providers.md#chatgpt-login).
103
-
104
- ### Permissions and sandbox
105
-
106
- | Mode | Display name | Writes | Commands |
107
- | ----------- | ------------------ | ----------- | --------------------------------- |
108
- | `default` | Manual | ask | ask |
109
- | `auto-edit` | Accept edits | allow | ask |
110
- | `plan` | Plan | deny | read-only commands only |
111
- | `auto` | Auto | allow ¹ | safe ones allowed, risky ones ask |
112
- | `full-auto` | Bypass permissions | allow | allow (dangerous commands ask) |
113
- | `allowlist` | Allowlist only | allow rules | allow rules (for CI) |
114
-
115
- ¹ Secrets, `.git/`, `.ama/` and paths outside the project still ask. `auto` decides in three tiers: rules, then a static safe list, then a model classifier on a separate request. Allow / deny rules (`bash(git push*)`, `write(src/**)`), dangerous-command detection that sees through `sh -c` / `eval` / `xargs`, and project trust apply in every mode; project config can only tighten. On macOS (`sandbox-exec`) and Linux (bubblewrap) an OS sandbox isolates codemode, and optionally bash (`sandbox.bash: "auto"`). See [docs/en/permissions.md](docs/en/permissions.md) and [docs/sandbox.md](docs/sandbox.md) (Chinese).
116
-
117
- ### Sub-agents and external agents
118
-
119
- The `task` tool hands a sub-task to a sub-agent with a fresh context: built-in `general`, `explore` and `plan`, or your own types defined in `~/.config/ama/agents/*.md`, `.ama/agents/*.md` (trusted projects) or `--agent-dir`. Under the `default` preset `task` is callable from codemode scripts; `tools.default: ["+task"]` exposes it directly. In the terminal UI, RPC and ACP a task runs in the background by default and reports back with a notification; `-p` waits for it. Running tasks appear in the agent bar above the status line, where you can open a live view and talk to a sub-agent directly. `task(agent="claude" | "codex" | "acp:<program>")` drives an external agent with your existing login in that CLI; its approvals go to a human only and its mode is never wider than ama's. `ama --mode acp` exposes ama itself as an ACP agent. See [docs/agents.md](docs/agents.md) (Chinese) and [docs/en/tui.md](docs/en/tui.md#agent-bar).
120
95
 
121
- ### Plan mode
96
+ `/help` lists every command. Each turn is a checkpoint that `/rewind` can return to (code, conversation or both).
97
+ See [terminal UI](docs/en/guides/tui.md) and [sessions](docs/en/guides/sessions.md).
122
98
 
123
- In Plan mode (`Shift+Tab`, `/plan <goal>`, `--permission-mode plan`) the model researches read-only and ends with a plan. ama saves it and opens an approval dialog: approve and execute (optionally in a fresh context, with a choice of execution mode), keep revising, or discard. Steps become todos. Unattended `-p` stops with exit code 9 instead of approving; `plan.model` lets planning and execution use different models. See [docs/plan.md](docs/plan.md) (Chinese).
99
+ ### One-shot runs: `-p`
124
100
 
125
- ### Rewind and checkpoints
126
-
127
- Each turn is a checkpoint: files are backed up before ama first writes them, and `checkpoints.mode: "shadow-git"` snapshots the whole working directory so bash changes can be undone too. Double Esc (or `/rewind`) returns to before any message, restoring code, conversation or both, or summarizing from that point. Files you changed by hand are listed as conflicts and skipped by default. See [docs/en/tui.md](docs/en/tui.md#rewind) and [docs/en/sessions.md](docs/en/sessions.md).
128
-
129
- ### Context and caching
130
-
131
- Long sessions compact automatically in two tiers: large old tool results are pruned first, then the history is summarized, with the summary request reusing the cached prefix. ama keeps the prefix byte-stable, detects and explains cache misses, tells endpoints that report cache usage from those that do not, and can warm the cache during long tool runs (`cache.warming`). Cross-session memory is off by default; `ama memory enable` turns it on, and requests are byte-identical while it is off. See [docs/en/providers.md](docs/en/providers.md#caching) and [docs/memory.md](docs/memory.md) (Chinese).
132
-
133
- ### Observability
134
-
135
- The status bar shows throughput (tok/s, time to first token), usage and cache hit rate on the first line; mode, model, context, git branch, cost and duration on the second; and with a ChatGPT plan a third line with quota usage and reset times. `Ctrl+G` folds it to one line. `/trace` opens a tree of turns, requests, tools and sub-agents with timing; `ama sessions trace <id> --html` writes the same as a redacted single-file page. `ama stats` aggregates requests, tokens, cache hit rate and cost across sessions. See [docs/en/tui.md](docs/en/tui.md#layout) and [docs/en/sessions.md](docs/en/sessions.md).
136
-
137
- ### codemode and tool presets
138
-
139
- codemode lets the model write a short JavaScript that orchestrates many tool calls; it runs in a `node --permission` child process (inside the OS sandbox when available) and only its output goes back to the model. Every inner call still passes hooks and permissions. Tool presets: `default` (read, edit, write, bash, grep, glob, plus codemode when the network is isolated), `minimal`, `codemode-only` and `coordinator`. See [docs/codemode.md](docs/codemode.md) (Chinese).
140
-
141
- ### Configuration
142
-
143
- One user file, `~/.config/ama/config.json`, created on first use with a JSON schema for editors. Layers merge as built-in defaults ← user ← profile ← project ← command line; the project level (`.ama/config.json`) can only tighten. `/config` opens a settings panel; from the shell use `ama config get|set|unset|list`, and `ama config show` prints every effective value with its source. Project conventions in `AGENTS.md` are picked up automatically. `ama doctor` checks layers, trust, key sources, hooks and sandbox. See [docs/en/tui.md](docs/en/tui.md#the-config-settings-panel-and-ama-config).
144
-
145
- ### Interface language
146
-
147
- The interface is available in Chinese and English: `ui.language` (`auto` / `zh` / `en`), `--lang` or `AMA_LANG`; `auto` follows `LANG`. Text sent to the model is always English, so requests are identical in both languages; set `ui.replyLanguage` (for example `"Chinese"`) to have the model reply in another language.
101
+ ```sh
102
+ ama -p "explain src/index.ts"
103
+ git diff | ama -p "review this change"
104
+ npm test 2>&1 | ama -p "why does this fail" -
105
+ ama -p "list the TODOs" --output-format json # or stream-json, same events as RPC
106
+ ```
148
107
 
149
- ## Embedding and integration
108
+ `-p` has nobody to approve, so writes and commands are denied unless you allow them (`--permission-mode auto-edit`,
109
+ `auto`, or `--allow "bash(npm test*)"`). Budgets: `--max-turns`, `--max-cost`. Exit codes are listed at the end of
110
+ `ama --help` (for example 7 = tool calls denied, 8 = budget reached, 9 = plan awaiting approval).
111
+
112
+ ### Coordinate external agents
113
+
114
+ `task(agent="…")` runs another coding agent with that CLI's own login, model and permission policy; the result comes back
115
+ as a tool result. Approvals it raises go to you only, and its mode is never wider than ama's.
116
+
117
+ | `agent` | Driver | Status (2026-10-10) |
118
+ | --------------------------------- | ------------------------------------------------------------ | -------------------- |
119
+ | `claude` | `claude-agent-acp` → `claude -p` stream-json → one-shot JSON | Verified |
120
+ | `codex` | `codex-acp` → `codex app-server` → `codex exec` (one-shot) | Verified |
121
+ | `copilot` | `copilot --acp --stdio` | Verified |
122
+ | `opencode` | `opencode acp` | Verified |
123
+ | `pi` | `pi --mode rpc` with an approval gate loaded for the run | Verified |
124
+ | `cursor` | `cursor-agent acp` | Listed, not verified |
125
+ | `gemini`, `qwen`, `kimi`, `goose` | Their ACP subcommands | Listed, not verified |
126
+ | `acp:<program>` | Any other ACP agent | — |
127
+
128
+ `task` is not in the default tool list: enable it with `tools.default: ["+task"]` (or `--tools …,task`). `/agents`
129
+ shows which CLIs are installed. Capability matrix, mode mapping and accounts:
130
+ [sub-agents and external agents](docs/guides/agents.md#实测能力矩阵2026-10-10) (Chinese), measurements in
131
+ [external agent benchmarks](docs/benchmarks/external-agents-2026-10.md).
132
+
133
+ ### Sub-agents and fork
134
+
135
+ The same `task` tool starts ama's own sub-agents: built-in `general`, `explore` and `plan`, or your types in
136
+ `~/.config/ama/agents/*.md`, `.ama/agents/*.md` (trusted projects) or `--agent-dir`. A sub-agent starts with a fresh
137
+ context by default; `context: "fork"` inherits the parent conversation and reuses its cached prefix. Tasks run in the
138
+ background in the UI, RPC and ACP (`-p` waits), can be isolated in a git worktree, and appear in the agent bar where you
139
+ can watch and talk to them. Depth is 1: sub-agents cannot delegate again.
140
+
141
+ ### Embed and integrate
142
+
143
+ | Entry point | Use | Docs |
144
+ | -------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------------- |
145
+ | `ama --mode acp` | ACP agent for Zed, JetBrains and Armadra; also an ACP client | [ACP](docs/en/reference/acp.md) |
146
+ | `ama --mode rpc` | JSONL over stdio for hosts; types in `@armadra/agent/rpc` | [RPC protocol](docs/en/reference/rpc.md) |
147
+ | SDK | `createAgentSession()` / `createRuntime()` from `@armadra/agent` | [example](examples/sdk-demo.ts) |
148
+ | `--profile <file>` | Host adapter: register tools, answer approvals, inject messages | [host adapter API](docs/en/reference/host-api.md) |
149
+ | `@armadra/agent/tui` | The terminal component library | [terminal UI](docs/en/guides/tui.md#component-library-armadraagenttui) |
150
+
151
+ Zed (`settings.json`):
152
+
153
+ ```json
154
+ { "agent_servers": { "ama": { "type": "custom", "command": "ama", "args": ["--mode", "acp"] } } }
155
+ ```
150
156
 
151
- **SDK**: `npm i @armadra/agent`.
157
+ SDK:
152
158
 
153
159
  ```ts
154
160
  import { createAgentSession } from "@armadra/agent";
@@ -157,121 +163,73 @@ const session = await createAgentSession({
157
163
  cwd: process.cwd(),
158
164
  model: "anthropic/<model-id>", // "fake/echo" for a dry run
159
165
  auth: { kind: "env" },
160
- permission: {
161
- mode: "default",
162
- ask: async (request) => (request.toolName === "read" ? "allow" : "deny"),
163
- },
166
+ permission: { mode: "default", ask: async (req) => (req.toolName === "read" ? "allow" : "deny") },
164
167
  });
165
168
  await session.prompt("list the entry files under src");
166
169
  console.log(session.getLastAssistantText());
167
170
  await session.dispose();
168
171
  ```
169
172
 
170
- `createAgentSession` reads no config files; `createRuntime({ argv })` runs the same startup as the `ama` command. A fuller example is [examples/sdk-demo.ts](https://github.com/Owlbay/armadra-agent/blob/main/examples/sdk-demo.ts).
171
-
172
- | Entry point | Use | Docs |
173
- | -------------------- | ----------------------------------------------------------------- | ------------------------------------------ |
174
- | `ama --mode rpc` | JSONL over stdio for hosts; types in `@armadra/agent/rpc` | [docs/en/rpc.md](docs/en/rpc.md) |
175
- | `ama --mode acp` | ACP agent for editors and Armadra; client in `@armadra/agent/acp` | [docs/en/acp.md](docs/en/acp.md) |
176
- | `--profile <file>` | Host adapter: canvas tools, approvals, injected messages, status | [docs/en/host-api.md](docs/en/host-api.md) |
177
- | `@armadra/agent/tui` | The terminal component library | [docs/en/tui.md](docs/en/tui.md) |
178
-
179
- Armadra starts ama with `ama --profile <path>` and the `coordinator` preset: the coordinator reads files and calls canvas tools but never edits code itself.
180
-
181
- ## Command reference
182
-
183
- | Command | Purpose |
184
- | -------------------------------------------------------- | --------------------------------------------------------- |
185
- | `ama` / `ama --no-tui` | Terminal UI / line mode |
186
- | `ama -p "<prompt>"` | One-shot run (`--output-format text\|json\|stream-json`) |
187
- | `ama -c` / `ama -r [id]` | Continue the latest session here / resume a session |
188
- | `ama auth set\|list\|remove <provider>` | Manage stored API keys |
189
- | `ama auth login\|logout\|status chatgpt` | ChatGPT plan login |
190
- | `ama providers add\|list\|channels\|remove\|refresh` | Relays and custom providers |
191
- | `ama models list\|check\|discover\|refresh` | Models, availability, relay discovery, models.dev refresh |
192
- | `ama models enable\|disable` | The `/model` list (`models.enabled`) |
193
- | `ama models cache-probe <provider/id>` | Whether an endpoint reports cache usage |
194
- | `ama config show\|path\|edit\|get\|set\|unset\|list` | Settings |
195
- | `ama sessions list\|show\|search\|export\|trace\|prune` | Sessions, full-text search, export, traces |
196
- | `ama stats [--since 7d] [--by model]` | Usage across sessions |
197
- | `ama memory list\|show\|edit\|rm\|path\|enable\|disable` | Memory |
198
- | `ama doctor` / `ama init` | Diagnostics / create the config directory |
199
-
200
- Common flags: `--model`, `--thinking`, `--permission-mode`, `--allow` / `--deny`, `--tools-preset`, `--max-turns`, `--max-cost`, `--image`, `--lang`. `ama --help` lists everything.
201
-
202
- ## Exit codes
203
-
204
- | Code | Meaning |
205
- | ---- | ----------------------------------------------------------------------- |
206
- | 0 | Success |
207
- | 1 | Runtime error (the model ultimately failed, etc.) |
208
- | 2 | Usage error; the current model does not accept images |
209
- | 3 | Config / profile / path error; `ama config set` rejected a key or value |
210
- | 4 | No usable model or key |
211
- | 5 | Session missing or corrupted |
212
- | 6 | Host / hook startup failure |
213
- | 7 | `-p` had tool calls denied (no approver, deny rules, plan, …) |
214
- | 8 | `-p` reached a budget limit (`--max-turns` / `--max-cost` / `limits`) |
215
- | 9 | `-p` saved a plan that awaits approval |
216
- | 78 | Host API version mismatch |
217
- | 130 | SIGINT; 143 = SIGTERM |
173
+ ## Configuration and permissions
174
+
175
+ - **Config**: one user file, `~/.config/ama/config.json`, merged as built-in defaults ← user ← profile ← project ←
176
+ command line. The project level (`.ama/config.json`) can only tighten. `ama config show` prints every effective value
177
+ with its source; `ama doctor` checks layers, trust, key sources, hooks and the sandbox.
178
+ - **AGENTS.md**: read automatically, no trust needed. In each directory the first of `AGENTS.override.md`, `AGENTS.md`,
179
+ `AGENTS.MD` is used; the user-level `~/.config/ama/AGENTS.md` comes first, then ancestors from the outermost down to
180
+ the current directory. Identical copies (for example a worktree inside the main repo) are read once.
181
+ - **Trust**: project hooks (`.ama/hooks.json`), skills (`.ama/skills/`, ancestor `.agents/skills/`) and prompt templates
182
+ load only in trusted projects. ama asks once in the terminal UI and can remember the answer; `--trust` / `--no-trust`
183
+ decide for one launch; unattended runs default to untrusted.
184
+ - **Permission modes**:
185
+
186
+ | Mode | Display name | Writes | Commands |
187
+ | ----------- | ------------------ | ----------- | -------------------------------------------------- |
188
+ | `default` | Manual | ask | ask |
189
+ | `auto-edit` | Accept edits | allow | ask |
190
+ | `plan` | Plan | deny | read-only commands only |
191
+ | `auto` | Auto | allow ¹ | safe list allowed, the rest judged by a classifier |
192
+ | `full-auto` | Bypass permissions | allow | allow (dangerous commands ask) |
193
+ | `allowlist` | Allowlist only | allow rules | allow rules (for CI) |
194
+
195
+ ¹ Secrets, `.git/`, `.ama/` and paths outside the project still ask. Deny rules and dangerous-command detection apply in
196
+ every mode. On macOS (`sandbox-exec`) and Linux (bubblewrap) an OS sandbox isolates codemode and, optionally, bash; Windows has none. See
197
+ [permissions](docs/en/guides/permissions.md) and [sandbox](docs/guides/sandbox.md) (Chinese).
198
+
199
+ The interface is available in English and Chinese (`--lang`, `AMA_LANG` or `ui.language`); text sent to the model is
200
+ always English, so requests are byte-identical in both languages.
218
201
 
219
202
  ## Documentation
220
203
 
221
- Seven docs have English versions; the rest are in Chinese.
222
-
223
- **User docs**
224
-
225
- - [Providers and models](docs/en/providers.md) ([中文](docs/providers.md)): providers, channels, keys, ChatGPT login, relays, models.dev, images, caching
226
- - [Terminal UI](docs/en/tui.md) ([中文](docs/tui.md)): layout, status bar, keys, commands, rewind, approvals, agent bar, traces, `/config`
227
- - [Permissions](docs/en/permissions.md) ([中文](docs/permissions.md)): modes, decision order, auto's three tiers
228
- - [Sessions](docs/en/sessions.md) ([中文](docs/sessions.md)): stats, search, `--from`, export, traces, checkpoints
229
- - [Sub-agents and external agents](docs/agents.md), [Plan mode](docs/plan.md), [Memory](docs/memory.md), [Sandbox](docs/sandbox.md), [codemode](docs/codemode.md), [Command hooks](docs/hooks.md) (Chinese)
230
-
231
- **Integration docs**
232
-
233
- - [RPC protocol](docs/en/rpc.md) ([中文](docs/rpc.md)), [Host adapter API](docs/en/host-api.md) ([中文](docs/host-api.md))
234
- - [ACP](docs/en/acp.md) ([中文](docs/acp.md)): `ama --mode acp`, sessions, tool calls, sign-in, deviations, the ACP client
235
- - [Session file format](docs/session-format.md) (Chinese)
236
-
237
- **Design and research** (Chinese)
238
-
239
- - [Overall design and decision log][design], [terminal UI visual spec](docs/tui-design.md), [rewind design](docs/rewind-plan.md), [bilingual conventions][i18n]
240
- - [Local extensions (draft, not implemented)][extensions], [benchmarks][benchmarks], [research reports][research]
241
- - Wave plans: [wave 3][w3], [wave 5][wave5], [wave 6][wave6], [early implementation plan][impl]
242
-
243
- [design]: https://github.com/Owlbay/armadra-agent/blob/main/docs/design.md
244
- [i18n]: https://github.com/Owlbay/armadra-agent/blob/main/docs/i18n.md
245
- [extensions]: https://github.com/Owlbay/armadra-agent/blob/main/docs/extensions.md
246
- [benchmarks]: https://github.com/Owlbay/armadra-agent/tree/main/docs/benchmarks
247
- [research]: https://github.com/Owlbay/armadra-agent/tree/main/docs/research
248
- [w3]: https://github.com/Owlbay/armadra-agent/blob/main/docs/wave3-plan.md
249
- [wave5]: https://github.com/Owlbay/armadra-agent/blob/main/docs/wave5-plan.md
250
- [wave6]: https://github.com/Owlbay/armadra-agent/blob/main/docs/wave6-plan.md
251
- [impl]: https://github.com/Owlbay/armadra-agent/blob/main/docs/implementation-plan.md
252
-
253
- Release notes: [CHANGELOG.md](CHANGELOG.md) (English, from 0.6.0) and [CHANGELOG.zh-CN.md](CHANGELOG.zh-CN.md) (Chinese, complete history).
204
+ The [documentation index](docs/README.md) lists every document (an English index is in
205
+ [docs/en/README.md](docs/en/README.md)). Layout:
254
206
 
255
- ## Known limitations
207
+ - `docs/guides/`: how things work today: [terminal UI](docs/en/guides/tui.md), [providers](docs/en/guides/providers.md),
208
+ [permissions](docs/en/guides/permissions.md), [sessions](docs/en/guides/sessions.md), plus agents, plan mode, memory,
209
+ hooks, codemode, sandbox and i18n in Chinese.
210
+ - `docs/reference/`: protocols and formats: [RPC](docs/en/reference/rpc.md), [ACP](docs/en/reference/acp.md),
211
+ [host adapter API](docs/en/reference/host-api.md), [session file format](docs/reference/session-format.md) (Chinese).
212
+ - `docs/design/`: the [overall design](docs/design/design.md) and other target designs.
213
+ - `docs/history/`, `docs/research/`, `docs/benchmarks/`: finished plans, research and measurements, for the record.
256
214
 
257
- - **Linux sandbox not verified on real machines**: bubblewrap policies are covered by unit tests and Ubuntu CI only. Windows has no OS sandbox: on Node 22 / 24 codemode there is not network-isolated and asks for approval every time.
258
- - **External agents against real CLIs run locally only**: CI uses recorded replays and ama driving ama; real `claude` / `codex` runs need a logged-in machine and `AMA_E2E_AGENTS=1`.
259
- - **ChatGPT login not yet verified with a real account**: both login flavors are tested against a local mock; real-account checks run locally with `AMA_E2E_CHATGPT=1`.
260
- - **DeepSeek, Zhipu and Kimi default to the Chat channel**: their Messages channels (`@messages`) have only been tested through relays.
261
- - Sub-agents have depth 1 and no fork mode that inherits the parent conversation.
215
+ Release notes: [CHANGELOG.md](CHANGELOG.md) (English, from 0.6.0) and [CHANGELOG.zh-CN.md](CHANGELOG.zh-CN.md)
216
+ (Chinese, complete history).
262
217
 
263
- ## Development
218
+ ## Development and release
264
219
 
265
220
  Requires Node ≥ 22 and pnpm (`corepack enable`).
266
221
 
267
222
  ```sh
268
223
  pnpm install
269
- pnpm run ci # typecheck, format, dependency and i18n checks, release check, tests, build
224
+ pnpm run ci # typecheck, format, dependency, i18n and doc-link checks, release check, tests, build
270
225
  AMA_E2E=1 pnpm test:e2e # bundle-level end-to-end tests with the free fake provider
271
226
  ```
272
227
 
273
- Tests use the scripted `fake` provider (`AMA_FAKE_SCRIPT`), never a real model. `src/` may only use `node:` built-ins and relative imports (`pnpm check:deps`). To release, bump the version, update both changelogs and push a `v<version>` tag; GitHub Actions creates the release and publishes to npm through trusted publishing.
228
+ Tests use the scripted `fake` provider, never a real model. Conventions are in [AGENTS.md](AGENTS.md) and
229
+ [CONTRIBUTING](.github/CONTRIBUTING.md). Releases are cut by pushing a `v<version>` tag: CI creates the GitHub Release
230
+ and publishes to npm through trusted publishing.
274
231
 
275
- ## License and acknowledgements
232
+ ## License
276
233
 
277
- [MIT](LICENSE). Model metadata comes from [models.dev](https://models.dev) (MIT); see [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
234
+ [MIT](LICENSE). Model metadata comes from [models.dev](https://models.dev) (MIT); see
235
+ [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).