@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/docs/README.md ADDED
@@ -0,0 +1,85 @@
1
+ # 文档索引
2
+
3
+ [English](en/README.md) · 简体中文
4
+
5
+ 本文件是 `docs/` 的入口,新增文档登记在这里。仓库内的相对链接与源码注释里的 `docs/…md` 路径由
6
+ `pnpm check:docs`(`scripts/check-doc-links.mjs`)校验。
7
+
8
+ | 目录 | 内容 |
9
+ | ------------- | ------------------------------------------------------------- |
10
+ | `guides/` | 使用说明与现行行为,与代码同步维护 |
11
+ | `reference/` | 协议与文件格式,形状改动必须同步(见 `AGENTS.md`「协议面」) |
12
+ | `design/` | 目标设计与视觉规范;首段写明状态,现状以代码与 `guides/` 为准 |
13
+ | `history/` | 已完成的实施计划与审计,只用于追溯,不作为实施要求 |
14
+ | `research/` | 调研报告,只用于追溯 |
15
+ | `benchmarks/` | 实测记录与原始数据 |
16
+ | `en/` | 英文译本,按同样的分层放;中英不一致时以中文版为准 |
17
+ | `assets/` | README 用的字标等图片 |
18
+
19
+ ## guides/ 使用与现状
20
+
21
+ | 文档 | 内容 |
22
+ | ----------------------------------------- | --------------------------------------------------------------------------- |
23
+ | [终端界面](guides/tui.md) | 布局、状态栏、按键、命令、回滚、审批、Agent 栏、轨迹、`/config`;组件库 API |
24
+ | [供应商与模型](guides/providers.md) | 内置供应商、渠道、API Key、ChatGPT 登录、中转、models.dev、图像、缓存 |
25
+ | [权限](guides/permissions.md) | 六种模式、判定顺序、`auto` 的三层判定 |
26
+ | [Plan 模式](guides/plan.md) | 只读调研、计划格式、审批入口与持久化 |
27
+ | [会话](guides/sessions.md) | 统计、检索、`--from` 复用、导出、轨迹、检查点 |
28
+ | [子 Agent 与外部 Agent](guides/agents.md) | `task` / `task_ctl`、fork、worktree 隔离、外部 Agent 驱动与能力矩阵 |
29
+ | [记忆](guides/memory.md) | 跨会话笔记,缺省关闭 |
30
+ | [命令式 Hook](guides/hooks.md) | `hooks.json` 的事件、退出码与 stdout JSON |
31
+ | [codemode](guides/codemode.md) | 模型写脚本批量调用工具,子进程与权限 |
32
+ | [操作系统级沙箱](guides/sandbox.md) | macOS `sandbox-exec` 与 Linux bubblewrap,codemode 与 bash 接入 |
33
+ | [界面语言](guides/i18n.md) | 中英双语的选择规则与开发约定 |
34
+
35
+ ## reference/ 协议与格式
36
+
37
+ | 文档 | 内容 |
38
+ | ------------------------------------------- | -------------------------------------------------------- |
39
+ | [RPC 协议](reference/rpc.md) | `ama --mode rpc` 的 stdio JSONL 命令、响应与事件 |
40
+ | [ACP](reference/acp.md) | `ama --mode acp` 服务端、登录方法、偏差,以及 ACP 客户端 |
41
+ | [宿主适配器 API](reference/host-api.md) | `@armadra/agent/host`:注册工具、审批、注入消息、状态 |
42
+ | [会话文件格式](reference/session-format.md) | JSONL 条目树、头、条目类型与版本 |
43
+
44
+ ## design/ 目标设计
45
+
46
+ | 文档 | 状态与内容 |
47
+ | ---------------------------------------- | -------------------------------------------------------------------------- |
48
+ | [总体设计](design/design.md) | 架构、工程约定、缓存保证与决定表;硬约束仍以此为准,细节现状见 `guides/` |
49
+ | [终端界面视觉规范](design/tui-design.md) | 主题、逐屏样稿与交互细节;已按此实现,作为界面改动的规范 |
50
+ | [检索与网络搜索](design/search-plan.md) | 只实施了本地检索增强;`web_fetch`、`web_search` 与引用呈现保留为将来的设计 |
51
+ | [本地扩展](design/extensions.md) | 设计草案,尚未实现 |
52
+
53
+ ## history/ 已完成的计划与审计
54
+
55
+ | 文档 | 内容 |
56
+ | ---------------------------------------------------------- | ------------------------------------------------------------ |
57
+ | [第二、三波实施设计](history/implementation-plan.md) | 组装根、RPC / SDK、交互模式、codemode 各批次 |
58
+ | [第三波计划](history/wave3-plan.md) | 缓存设计与验收、其余批次编排 |
59
+ | [第五波计划](history/wave5-plan.md) | 状态栏、模型元数据、渠道、外部 Agent、Plan、子 Agent、压缩 |
60
+ | [第六波计划](history/wave6-plan.md) | Agent 栏、轨迹、记忆、ChatGPT 登录、双语、`/config` |
61
+ | [检查点与回滚](history/rewind-plan.md) | 检查点、回滚与影子 git |
62
+ | [ACP 补全](history/acp-plan.md) | 对照 ACP v1 schema 的补全 |
63
+ | [Agent 切换与并行交流](history/agents-concurrency-plan.md) | Agent 栏进入方式、后台审批停靠 |
64
+ | [内存占用优化](history/memory-plan.md) | read 流式、ACP 释放、图片驻留 |
65
+ | [模型调用效率](history/model-efficiency-plan.md) | 缓存、用量、重试与元数据 |
66
+ | [未关闭 Issue 设计与分批](history/open-issues-plan.md) | #149–#156、#183:fork 缺省、子会话防串台、取样、上限持久化等 |
67
+ | [内存优化遗留项](history/memory-residue-plan.md) | #165–#173:常驻会话、通知回合、图片释放、读窗口等 |
68
+ | [缺口与默认值审计](history/gap-audit-2026-10.md) | 2026-10-02 的只读审计 |
69
+
70
+ ## research/ 与 benchmarks/
71
+
72
+ - [调研报告](research/README.md):第五波 R1–R5、第六波 R6–R10、ACP 差距审计、模型调用效率与内存占用审计。
73
+ - 实测记录:
74
+ - [外部 Agent 驱动实测](benchmarks/external-agents-2026-10.md)
75
+ - [模型调用效率实测](benchmarks/efficiency-2026-10.md)
76
+ - [内存占用实测](benchmarks/memory-2026-10.md)
77
+ - [缓存验收实验](benchmarks/cache-2026-10-02.md)、[自动压缩 E6](benchmarks/cache-e6-2026-10-02.md)、[对话中途的 system 消息](benchmarks/cache-midconvo-2026-10-09.md)
78
+ - [三预设基准](benchmarks/presets-2026-10-02.md)、[todo 进 default](benchmarks/presets-todo-2026-10-02.md)、[多步长任务复测](benchmarks/presets-todo-2026-10-03.md)
79
+
80
+ ## en/ 英文译本
81
+
82
+ [终端界面](en/guides/tui.md)、[供应商与模型](en/guides/providers.md)、[权限](en/guides/permissions.md)、
83
+ [会话](en/guides/sessions.md)、[RPC 协议](en/reference/rpc.md)、[ACP](en/reference/acp.md)、
84
+ [宿主适配器 API](en/reference/host-api.md)。译本头部记着翻译时的中文版提交,`pnpm release:check` 在中文版
85
+ 之后改动较多时提示同步。
@@ -0,0 +1,37 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="216" height="96" viewBox="0 0 216 96" shape-rendering="crispEdges" role="img" aria-label="ama">
2
+ <title>ama</title>
3
+ <g fill="#5fafff">
4
+ <rect x="24" y="8" width="24" height="8"/>
5
+ <rect x="16" y="16" width="40" height="8"/>
6
+ <rect x="8" y="24" width="24" height="8"/>
7
+ <rect x="40" y="24" width="24" height="8"/>
8
+ <rect x="8" y="32" width="16" height="8"/>
9
+ <rect x="48" y="32" width="16" height="8"/>
10
+ <rect x="8" y="40" width="56" height="16"/>
11
+ <rect x="8" y="56" width="16" height="24"/>
12
+ <rect x="48" y="56" width="16" height="24"/>
13
+ </g>
14
+ <g fill="#87afff">
15
+ <rect x="72" y="8" width="16" height="8"/>
16
+ <rect x="128" y="8" width="16" height="8"/>
17
+ <rect x="72" y="16" width="24" height="16"/>
18
+ <rect x="120" y="16" width="24" height="16"/>
19
+ <rect x="72" y="32" width="32" height="8"/>
20
+ <rect x="112" y="32" width="32" height="8"/>
21
+ <rect x="72" y="40" width="16" height="40"/>
22
+ <rect x="96" y="40" width="24" height="8"/>
23
+ <rect x="128" y="40" width="16" height="40"/>
24
+ <rect x="104" y="48" width="8" height="8"/>
25
+ </g>
26
+ <g fill="#af87ff">
27
+ <rect x="168" y="8" width="24" height="8"/>
28
+ <rect x="160" y="16" width="40" height="8"/>
29
+ <rect x="152" y="24" width="24" height="8"/>
30
+ <rect x="184" y="24" width="24" height="8"/>
31
+ <rect x="152" y="32" width="16" height="8"/>
32
+ <rect x="192" y="32" width="16" height="8"/>
33
+ <rect x="152" y="40" width="56" height="16"/>
34
+ <rect x="152" y="56" width="16" height="24"/>
35
+ <rect x="192" y="56" width="16" height="24"/>
36
+ </g>
37
+ </svg>
@@ -0,0 +1,37 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="216" height="96" viewBox="0 0 216 96" shape-rendering="crispEdges" role="img" aria-label="ama">
2
+ <title>ama</title>
3
+ <g fill="#005fd7">
4
+ <rect x="24" y="8" width="24" height="8"/>
5
+ <rect x="16" y="16" width="40" height="8"/>
6
+ <rect x="8" y="24" width="24" height="8"/>
7
+ <rect x="40" y="24" width="24" height="8"/>
8
+ <rect x="8" y="32" width="16" height="8"/>
9
+ <rect x="48" y="32" width="16" height="8"/>
10
+ <rect x="8" y="40" width="56" height="16"/>
11
+ <rect x="8" y="56" width="16" height="24"/>
12
+ <rect x="48" y="56" width="16" height="24"/>
13
+ </g>
14
+ <g fill="#005faf">
15
+ <rect x="72" y="8" width="16" height="8"/>
16
+ <rect x="128" y="8" width="16" height="8"/>
17
+ <rect x="72" y="16" width="24" height="16"/>
18
+ <rect x="120" y="16" width="24" height="16"/>
19
+ <rect x="72" y="32" width="32" height="8"/>
20
+ <rect x="112" y="32" width="32" height="8"/>
21
+ <rect x="72" y="40" width="16" height="40"/>
22
+ <rect x="96" y="40" width="24" height="8"/>
23
+ <rect x="128" y="40" width="16" height="40"/>
24
+ <rect x="104" y="48" width="8" height="8"/>
25
+ </g>
26
+ <g fill="#8700af">
27
+ <rect x="168" y="8" width="24" height="8"/>
28
+ <rect x="160" y="16" width="40" height="8"/>
29
+ <rect x="152" y="24" width="24" height="8"/>
30
+ <rect x="184" y="24" width="24" height="8"/>
31
+ <rect x="152" y="32" width="16" height="8"/>
32
+ <rect x="192" y="32" width="16" height="8"/>
33
+ <rect x="152" y="40" width="56" height="16"/>
34
+ <rect x="152" y="56" width="16" height="24"/>
35
+ <rect x="192" y="56" width="16" height="24"/>
36
+ </g>
37
+ </svg>
@@ -0,0 +1,39 @@
1
+ # Documentation index
2
+
3
+ English · [简体中文](../README.md)
4
+
5
+ Most documents are written in Chinese; seven have English translations, kept in the same layout under `docs/en/`.
6
+ When a translation and the Chinese version differ, the Chinese version is authoritative. Relative links and the
7
+ `docs/…md` paths in source comments are checked by `pnpm check:docs` (`scripts/check-doc-links.mjs`).
8
+
9
+ | Directory | Contents |
10
+ | ------------- | ----------------------------------------------------------------------------- |
11
+ | `guides/` | How to use ama and how it behaves today; kept in step with the code |
12
+ | `reference/` | Protocols and file formats; shape changes must update these |
13
+ | `design/` | Target designs and the visual spec; each states its status in the first lines |
14
+ | `history/` | Finished implementation plans and audits, kept for the record only |
15
+ | `research/` | Research reports, kept for the record only |
16
+ | `benchmarks/` | Measurements and raw data |
17
+
18
+ ## English translations
19
+
20
+ | Document | Contents |
21
+ | ------------------------------------------- | ----------------------------------------------------------------------------------- |
22
+ | [Terminal UI](guides/tui.md) | Layout, status bar, keys, commands, rewind, approvals, agent bar, traces, `/config` |
23
+ | [Providers and models](guides/providers.md) | Built-in providers, channels, keys, ChatGPT login, relays, models.dev, caching |
24
+ | [Permissions](guides/permissions.md) | The six modes, decision order, auto's three tiers |
25
+ | [Sessions](guides/sessions.md) | Stats, search, `--from`, export, traces, checkpoints |
26
+ | [RPC protocol](reference/rpc.md) | `ama --mode rpc`: stdio JSONL commands, responses and events |
27
+ | [ACP](reference/acp.md) | `ama --mode acp`, sign-in methods, deviations, the ACP client |
28
+ | [Host adapter API](reference/host-api.md) | `@armadra/agent/host`: tools, approvals, injected messages, status |
29
+
30
+ ## Chinese only
31
+
32
+ - Guides: [plan mode](../guides/plan.md), [sub-agents and external agents](../guides/agents.md) (with the
33
+ capability matrix), [memory](../guides/memory.md), [command hooks](../guides/hooks.md),
34
+ [codemode](../guides/codemode.md), [OS sandbox](../guides/sandbox.md), [interface language](../guides/i18n.md).
35
+ - Reference: [session file format](../reference/session-format.md).
36
+ - Design: [overall design](../design/design.md), [terminal UI visual spec](../design/tui-design.md),
37
+ [search and web access](../design/search-plan.md) (only local search is implemented),
38
+ [local extensions](../design/extensions.md) (draft, not implemented).
39
+ - History, research and benchmarks: see the [Chinese index](../README.md).
@@ -1,22 +1,22 @@
1
1
  # Permission modes and auto decisions
2
2
 
3
- English · [简体中文](../permissions.md)
3
+ English · [简体中文](../../guides/permissions.md)
4
4
 
5
- > Translated from the Chinese [docs/permissions.md](../permissions.md) as of commit `6b5455a`. When the two differ, the
5
+ > Translated from the Chinese [docs/guides/permissions.md](../../guides/permissions.md) as of commit `6b5455a`. When the two differ, the
6
6
  > Chinese version is authoritative.
7
7
 
8
- This document covers ama's six permission modes, the decision order for every tool call, and how the three tiers of `auto` mode, "rule tier → static judgement → model classifier", decide between allowing and asking. The overall design is in [design.md](../design.md) §6.3 and §7 (Chinese); hook input and output are in [hooks.md](../hooks.md) (Chinese).
8
+ This document covers ama's six permission modes, the decision order for every tool call, and how the three tiers of `auto` mode, "rule tier → static judgement → model classifier", decide between allowing and asking. The overall design is in [design.md](../../design/design.md) §6.3 and §7 (Chinese); hook input and output are in [hooks.md](../../guides/hooks.md) (Chinese).
9
9
 
10
10
  ## Modes
11
11
 
12
- | Value | Display name | Read | Write (inside the project) | Execute (bash etc.) | When to use |
13
- | ----------- | ------------------ | ---- | ----------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------------------------- |
14
- | `default` | Manual | ✓ | ask | ask | Default |
15
- | `auto-edit` | Accept edits | ✓ | ✓ | ask | You trust it to edit code but want to see each command |
16
- | `plan` | Plan | ✓ | deny | read-only commands allowed, everything else denied | Read-only research, then a plan for approval ([plan.md](../plan.md), Chinese) |
17
- | `auto` | Auto | ✓ | ✓ (protected paths and outside the project ask) | safe-list commands allowed, the rest judged by a classifier | Recommended: routine work is not interrupted, only risky steps ask |
18
- | `full-auto` | Bypass permissions | ✓ | ✓ | ✓ | Throwaway sandboxes, containers |
19
- | `allowlist` | Allowlist only | ✓ | only calls matching allow rules | read-only commands and calls matching allow rules | CI: never asks; anything not listed is denied |
12
+ | Value | Display name | Read | Write (inside the project) | Execute (bash etc.) | When to use |
13
+ | ----------- | ------------------ | ---- | ----------------------------------------------- | ----------------------------------------------------------- | --------------------------------------------------------------------------------------- |
14
+ | `default` | Manual | ✓ | ask | ask | Default |
15
+ | `auto-edit` | Accept edits | ✓ | ✓ | ask | You trust it to edit code but want to see each command |
16
+ | `plan` | Plan | ✓ | deny | read-only commands allowed, everything else denied | Read-only research, then a plan for approval ([plan.md](../../guides/plan.md), Chinese) |
17
+ | `auto` | Auto | ✓ | ✓ (protected paths and outside the project ask) | safe-list commands allowed, the rest judged by a classifier | Recommended: routine work is not interrupted, only risky steps ask |
18
+ | `full-auto` | Bypass permissions | ✓ | ✓ | ✓ | Throwaway sandboxes, containers |
19
+ | `allowlist` | Allowlist only | ✓ | only calls matching allow rules | read-only commands and calls matching allow rules | CI: never asks; anything not listed is denied |
20
20
 
21
21
  In every mode, deny rules and hook denies are checked first and deny outright; the dangerous-command list (`rm -rf /`, `git push --force`, `curl … | sh` and so on, see the README "Safety" section) always asks, which becomes deny under `allowlist` and when unattended.
22
22
 
@@ -47,11 +47,11 @@ Approvals do not only come from the main session. The dialog (and RPC `permissio
47
47
  | Permission requests from external agents (claude / codex / ACP) | `[claude · session abc12345]` | The title, kind, paths involved and input summary given by the external agent | A human only: host → interface → deny when unattended; neither the auto classifier nor the model takes part |
48
48
  | First run of an external agent in this session | Title "first run of an external agent" | An explanation (runs with your login in that CLI) and the mode | allow / deny rules `task(<id>)` and `full-auto` let it through; otherwise a human decides (no classifier) |
49
49
 
50
- "Allow for this session" of an external agent is remembered by that agent itself. In Manual mode the approval of a `task(agent=…)` call and the first-run confirmation are merged into one (see [agents.md](../agents.md), Chinese). The RPC `context` is `{ depth, taskId, origin }` ([rpc.md](rpc.md) "Approvals").
50
+ "Allow for this session" of an external agent is remembered by that agent itself. In Manual mode the approval of a `task(agent=…)` call and the first-run confirmation are merged into one (see [agents.md](../../guides/agents.md), Chinese). The RPC `context` is `{ depth, taskId, origin }` ([rpc.md](../reference/rpc.md) "Approvals").
51
51
 
52
52
  ## Plan mode and read-only commands
53
53
 
54
- Step ③ of plan mode looks at the input (implemented by `planDecision` in `src/permissions/pipeline.ts`); the flow and plan approval are in [plan.md](../plan.md) (Chinese):
54
+ Step ③ of plan mode looks at the input (implemented by `planDecision` in `src/permissions/pipeline.ts`); the flow and plan approval are in [plan.md](../../guides/plan.md) (Chinese):
55
55
 
56
56
  | Call | Under plan |
57
57
  | ------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -105,7 +105,7 @@ schema validation
105
105
 
106
106
  ### Approval-free commands inside the sandbox
107
107
 
108
- With `sandbox.bash: auto` and an OS sandbox on the machine that can restrict writes ([sandbox.md](../sandbox.md) "phase two", Chinese), bash runs through the sandbox. Under default / auto-edit, a bash call needs no approval (`PermissionVerdict.sandboxed: true`) when all of the following hold:
108
+ With `sandbox.bash: auto` and an OS sandbox on the machine that can restrict writes ([sandbox.md](../../guides/sandbox.md) "phase two", Chinese), bash runs through the sandbox. Under default / auto-edit, a bash call needs no approval (`PermissionVerdict.sandboxed: true`) when all of the following hold:
109
109
 
110
110
  1. It will run inside the sandbox: no `sandbox: false`;
111
111
  2. `sandbox.network: deny` (network access can exfiltrate data, so `allow` asks as usual);
@@ -1,11 +1,11 @@
1
1
  # Providers and models
2
2
 
3
- English · [简体中文](../providers.md)
3
+ English · [简体中文](../../guides/providers.md)
4
4
 
5
- > Translated from the Chinese [docs/providers.md](../providers.md) as of commit `514202f`. When the two differ, the
5
+ > Translated from the Chinese [docs/guides/providers.md](../../guides/providers.md) as of commit `514202f`. When the two differ, the
6
6
  > Chinese version is authoritative.
7
7
 
8
- Built-in providers, model references, API keys, custom providers and relays, the compat switches of each protocol, and caching. The design rationale is in [design.md](../design.md) §3 and §9.1 (Chinese).
8
+ Built-in providers, model references, API keys, custom providers and relays, the compat switches of each protocol, and caching. The design rationale is in [design.md](../../design/design.md) §3 and §9.1 (Chinese).
9
9
 
10
10
  ## Config directory
11
11
 
@@ -449,9 +449,9 @@ OpenRouter's Messages endpoint only gives cache usage in `message_delta`; parsin
449
449
 
450
450
  Most usage in long tasks is cache reads: once the prefix changes, every later request re-reads it at full price. ama handles caching in three layers: the **protocol layer** places breakpoints, sends cache keys and retention tiers the way each provider expects, and marks whether a response had cache fields; the **session layer** records each request's prefix fingerprint, detects misses, decides whether the endpoint reports cache usage and warms the cache during long tool runs; the **display layer** is the status bar, `/session`, RPC stats and `ama models cache-probe` (how to read the interface is in [tui.md](tui.md) "Cache and context").
451
451
 
452
- Prefix stability is guaranteed by assembly: the system prompt sections have a fixed order without timestamps, tools are sorted by name, and mid-session changes are only appended at the end as system patches ([session-format.md](../session-format.md), Chinese).
452
+ Prefix stability is guaranteed by assembly: the system prompt sections have a fixed order without timestamps, tools are sorted by name, and mid-session changes are only appended at the end as system patches ([session-format.md](../../reference/session-format.md), Chinese).
453
453
 
454
- **The leading system prompt and the tool declarations are written once per session.** Section patches after the conversation has started (AGENTS.md, Skills or SessionStart hook output changed on resume, host instructions refreshed, the memory section re-rendered after compaction) do not rewrite the head: protocols without `supportsMidConvoSystemMessages` render them as a user message wrapped in `<system-reminder>` at the patch's position, so the previous request stays a byte-for-byte prefix. Measured on DeepSeek, a mid-conversation system message is accepted and the prefix cache holds, but the model still answers from the leading one, so DeepSeek keeps the switch off ([cache-midconvo-2026-10-09](../benchmarks/cache-midconvo-2026-10-09.md), Chinese).
454
+ **The leading system prompt and the tool declarations are written once per session.** Section patches after the conversation has started (AGENTS.md, Skills or SessionStart hook output changed on resume, host instructions refreshed, the memory section re-rendered after compaction) do not rewrite the head: protocols without `supportsMidConvoSystemMessages` render them as a user message wrapped in `<system-reminder>` at the patch's position, so the previous request stays a byte-for-byte prefix. Measured on DeepSeek, a mid-conversation system message is accepted and the prefix cache holds, but the model still answers from the leading one, so DeepSeek keeps the switch off ([cache-midconvo-2026-10-09](../../benchmarks/cache-midconvo-2026-10-09.md), Chinese).
455
455
 
456
456
  The tool table works the same way: tools added after the conversation started are appended at the end of the table; **removing a tool keeps its declaration**, and the reminder says `Tool "X" is no longer available in this session; calls to it are rejected.` — if the model still calls it, the execution layer rejects the call (`Tool "X" is not available in this session.`); adding it back only says `Tool "X" is available again.` and keeps the declaration that was sent first. The `tools` / `rules` sections of the system prompt are also frozen to the text already sent once the conversation has started.
457
457
 
@@ -538,7 +538,7 @@ While a tool runs for a long time (long tests, `task` sub-tasks, codemode script
538
538
  | Cancellation | Cancelled on model switch, thinking level change, compaction, `/tree` and exit; restarts with the next real request |
539
539
  | Accounting | A successful warming appends a `usage{kind:"cache_warm"}` entry (never in the context), counted in `/session` cost and RPC stats; events `cache_warm{scheduled|sent|stopped}` |
540
540
 
541
- Hosts can veto or force every warming through `api.cache.onWarmingDecision` ([host-api.md](host-api.md) "Cache warming"). Sub-sessions do not warm by default (`cache.warmSubagents: true` turns it on). By catalog prices, warming during long tool runs almost always pays off; idle warming only pays off for expensive models with long prefixes.
541
+ Hosts can veto or force every warming through `api.cache.onWarmingDecision` ([host-api.md](../reference/host-api.md) "Cache warming"). Sub-sessions do not warm by default (`cache.warmSubagents: true` turns it on). By catalog prices, warming during long tool runs almost always pays off; idle warming only pays off for expensive models with long prefixes.
542
542
 
543
543
  ### Compaction summary continuation
544
544
 
@@ -1,11 +1,11 @@
1
1
  # Session stats, search, reuse, export and checkpoints
2
2
 
3
- English · [简体中文](../sessions.md)
3
+ English · [简体中文](../../guides/sessions.md)
4
4
 
5
- > Translated from the Chinese [docs/sessions.md](../sessions.md) as of commit `e57b54f`. When the two differ, the Chinese
5
+ > Translated from the Chinese [docs/guides/sessions.md](../../guides/sessions.md) as of commit `e57b54f`. When the two differ, the Chinese
6
6
  > version is authoritative. Sample command output below is illustrative; exact wording follows the interface language.
7
7
 
8
- These commands only read the session directory (`<data dir>/sessions`, changeable with `--session-dir`; the file format is in [session-format.md](../session-format.md), Chinese): no locks, no repair of half-written lines, no file changes, so sessions that are still running can be read too. Session files are read line by line in chunks rather than loaded whole: `ama sessions list` parses only each file's header, first entry, renames and first prompt and looks at just the type of every other line, so sessions of tens of MB do not make memory grow with file size; `--resume` likewise parses a session line by line. By default the scope is the sessions of the **current directory**; `--all` covers everything.
8
+ These commands only read the session directory (`<data dir>/sessions`, changeable with `--session-dir`; the file format is in [session-format.md](../../reference/session-format.md), Chinese): no locks, no repair of half-written lines, no file changes, so sessions that are still running can be read too. Session files are read line by line in chunks rather than loaded whole: `ama sessions list` parses only each file's header, first entry, renames and first prompt and looks at just the type of every other line, so sessions of tens of MB do not make memory grow with file size; `--resume` likewise parses a session line by line. By default the scope is the sessions of the **current directory**; `--all` covers everything.
9
9
 
10
10
  ## Stats: `ama stats`
11
11
 
@@ -171,7 +171,7 @@ running sessions can be exported too.
171
171
  embedded. External agents only have skeletons anyway.
172
172
  - Previews are truncated per item (arguments 500, others 2000 characters) with a 4 M-character budget for the whole file; past
173
173
  the budget, earlier previews are dropped and the details say so.
174
- - `--json` (or `--format json`): JSON in the same shape as RPC `get_trace` ([rpc.md](rpc.md) "Traces"), with every turn, the
174
+ - `--json` (or `--format json`): JSON in the same shape as RPC `get_trace` ([rpc.md](../reference/rpc.md) "Traces"), with every turn, the
175
175
  loaded child-session traces and `previews` for this session's nodes (none with `--no-content`).
176
176
  - Output: `--html <file>` (taken as the value only when the name ends in `.html` / `.htm`; otherwise use `--output`) or
177
177
  `--output <file>` writes a file (mode 0600), otherwise stdout. `--open` opens the written file in the system browser (a
@@ -182,7 +182,7 @@ running sessions can be exported too.
182
182
 
183
183
  ## Checkpoints and file backups
184
184
 
185
- Rolling back code (`/rewind`, design in [rewind-plan.md](../rewind-plan.md), Chinese) relies on checkpoints: at the start of each new turn, ama records the contents of the files changed by edit / write at that moment.
185
+ Rolling back code (`/rewind`, design in [rewind-plan.md](../../history/rewind-plan.md), Chinese) relies on checkpoints: at the start of each new turn, ama records the contents of the files changed by edit / write at that moment.
186
186
 
187
187
  - **Storage**: backups are stored by content sha256 at `<data dir>/file-history/blobs/<first 2 chars>/<sha256>`, raw bytes, uncompressed; shared across sessions and checkpoints, so identical content is stored once. Session files only hold two kinds of `custom` entries, `ama.checkpoint` / `ama.checkpoint-track` (hashes only, never in the context). When the session directory is not in the default location (`--session-dir`, the host profile's `sessionDir`), the directory is registered in `file-history/roots.json` and scanned during cleanup as well.
188
188
  - **What is tracked**: edit / write (including codemode inner calls and task sub-sessions) back up a file before writing it the first time; afterwards each new turn re-snapshots the tracked files from the current disk contents, so bash or manual changes to those files also enter the next checkpoint. Other files created or changed by bash are not tracked.
@@ -211,7 +211,7 @@ Rolling back code (`/rewind`, design in [rewind-plan.md](../rewind-plan.md), Chi
211
211
 
212
212
  ## Rewind (within a session)
213
213
 
214
- `/rewind`, RPC `rewind` and SDK `session.rewind()` return to before a user message (design in [rewind-plan.md](../rewind-plan.md), Chinese):
214
+ `/rewind`, RPC `rewind` and SDK `session.rewind()` return to before a user message (design in [rewind-plan.md](../../history/rewind-plan.md), Chinese):
215
215
 
216
216
  - Rewind points are the user messages on the active path that start new turns, oldest first; steers, queued messages and messages continued by the Stop hook belong to the current turn and are not listed separately. Rewinding while running reports `busy`.
217
217
  - Conversation rewind reuses the `/tree` leaf switch: the abandoned branch stays in the file and can be revisited from `/tree`; the model, thinking level and permission mode stay as they are and do not change with the rewind. The system prompt, tool table and messages before the target of the next request are byte-identical to before the rewind, so the prompt cache hits as usual.
@@ -1,18 +1,18 @@
1
1
  # Terminal UI
2
2
 
3
- English · [简体中文](../tui.md)
3
+ English · [简体中文](../../guides/tui.md)
4
4
 
5
- > Translated from the Chinese [docs/tui.md](../tui.md) as of commit `4b85f89`. When the two differ, the Chinese version is
5
+ > Translated from the Chinese [docs/guides/tui.md](../../guides/tui.md) as of commit `4b85f89`. When the two differ, the Chinese version is
6
6
  > authoritative. Screens below are illustrative; the exact interface wording follows the interface language
7
7
  > (`ui.language`, `--lang`, `AMA_LANG`).
8
8
 
9
- How to use interactive mode, plus the API of the terminal component library `@armadra/agent/tui`. The design rationale is in [design.md](../design.md) §12 (Chinese).
9
+ How to use interactive mode, plus the API of the terminal component library `@armadra/agent/tui`. The design rationale is in [design.md](../../design/design.md) §12 (Chinese).
10
10
 
11
11
  Running `ama` directly in a terminal (stdin / stdout both TTYs, `TERM` not `dumb`, no `--no-tui`) enters interactive mode. The interface uses the **main screen** only: the conversation history scrolls into the terminal scrollback without switching to the alternate screen, so `capture-pane` in tmux can read the whole conversation, and it stays on screen after exit.
12
12
 
13
13
  ## Layout
14
14
 
15
- The visual spec (colors, glyphs, screen-by-screen mockups) is in [tui-design.md](../tui-design.md) (Chinese). Hierarchy is expressed by indentation: column 0 holds the user `›`, the tool `⏺` and notice symbols, column 2 the result connector `⎿`, column 4 the tool output; the structure stays readable without colors (`NO_COLOR`, `capture-pane` without `-e`).
15
+ The visual spec (colors, glyphs, screen-by-screen mockups) is in [tui-design.md](../../design/tui-design.md) (Chinese). Hierarchy is expressed by indentation: column 0 holds the user `›`, the tool `⏺` and notice symbols, column 2 the result connector `⎿`, column 4 the tool output; the structure stays readable without colors (`NO_COLOR`, `capture-pane` without `-e`).
16
16
 
17
17
  ```
18
18
  ▄███▄ ██▄ ▄██ ▄███▄ ama 0.6.2 ← startup header (normal)
@@ -57,7 +57,7 @@ Accept edits | shift+tab to cycle claude-opus-5-5 medium | Ctx 3.0% 8.2k/272k
57
57
  - **`compact`**: one line; on the right model · thinking level · `↑ ↓` · cache · cost · re-billing · context usage · dir ⎇ branch commit +a −b · session duration · queue count · codemode · preset · host status · a short subscription quota item (`5h 10% wk 31%`, only with quota data; no `·` inside the item); when narrow, these drop in order: the quota item, the switch hint, host status, preset, re-billing, cost, cache, tokens, thinking level, queue count, codemode, line changes, directory name, branch and commit, duration, context, model.
58
58
  - **git**: branch and short commit are read directly from `.git/HEAD` (worktrees understood; detached shows only the short commit; outside git the whole part is omitted, leaving only the directory name). `+a −b` is the working tree (staged included) line diff against HEAD, computed in the background with `git diff --numstat HEAD` after a turn ends, a writing tool finishes, a rewind or `/tree`, at most once every 10 seconds; if it takes longer than 2 seconds or fails, line changes are hidden for the rest of the session; `AMA_STATUS_GIT=0` turns it off. In `full`, `↑N` / `↓N` count the commits the current branch is ahead of / behind its upstream: when the branch has an upstream in the git config (`branch.<name>.merge`), the same throttled cycle then runs `git rev-list --left-right --count @{upstream}...HEAD` (same 2-second timeout; after a timeout it stops for the session); zero, no upstream or detached shows nothing; ASCII uses `^N` / `vN`.
59
59
  - **Cost** includes sub-tasks, warming, the classifier and external agent usage priced in USD (other units only in `/session`); **duration** counts from when this process opened the current session (`Ns` / `Nm` / `NhMm`).
60
- - When bash commands run in the OS sandbox (`sandbox.bash: "auto"` and available on this machine, see [sandbox.md](../sandbox.md), Chinese), the usage items gain a sandbox marker, dropped first together with codemode when space runs out.
60
+ - When bash commands run in the OS sandbox (`sandbox.bash: "auto"` and available on this machine, see [sandbox.md](../../guides/sandbox.md), Chinese), the usage items gain a sandbox marker, dropped first together with codemode when space runs out.
61
61
  - During a model fallback (`fallbackModel`: when the main model is overloaded or retries are exhausted, one retry with the fallback model) the `compact` model item shows `main model → fallback model` (the fallback in yellow), while `full` keeps only the main model there and shows `→ fallback model` on the left of the rate line; it disappears once the fallback model replies and the main model is restored, and the message area gets an explanatory line.
62
62
  - **Context refresh**: it updates right after a message is submitted (the new message counted as an estimate); while streaming, once the reply carries usage (some protocols report input tokens at the start) it switches to the measured value of the in-flight request, at most twice a second; after the reply ends, a compaction or a model change it goes back to the session stats.
63
63
  - Model names abbreviate with width (provider dropped below 100 columns, channel below 60, version suffix below 48); `compact` at ≥ 110 columns shows context as a meter `ctx ▮▮▮▯▯▯▯▯▯▯ 34%`, keeping one decimal below 1% (`ctx ≈0.4%` rather than 0%), with the same `≈` for estimates; changing numbers reserve their widest shape, so items never flicker in and out as values change. In ASCII mode `⎇` → `git`, `−` → `-`, `♨` → `~`, `↻` → `@`.
@@ -154,11 +154,11 @@ While running, Enter **queues** by default (steer): the message waits for the ne
154
154
 
155
155
  Why `Ctrl+X` by default: macOS Terminal, iTerm2, tmux and Windows Terminal all pass it through and nothing else is bound to it; `Ctrl+Enter` is indistinguishable from Enter without the kitty keyboard protocol, `Ctrl+S` may be swallowed by XOFF flow control, `Alt+Enter` is already followUp, `Alt+letter` sends no Meta by default on macOS, and `Ctrl+]` is awkward on non-US layouts. Rebind it in `keybindings.json`.
156
156
 
157
- In line mode (`--no-tui`), typing `/interrupt <text>` while running does the same (when idle it is an ordinary prompt); the TUI accepts the command too. Over RPC it is `interrupt: true` on `prompt` / `steer`, see [rpc.md](rpc.md).
157
+ In line mode (`--no-tui`), typing `/interrupt <text>` while running does the same (when idle it is an ordinary prompt); the TUI accepts the command too. Over RPC it is `interrupt: true` on `prompt` / `steer`, see [rpc.md](../reference/rpc.md).
158
158
 
159
159
  ## Rewind
160
160
 
161
- Design in [rewind-plan.md](../rewind-plan.md) (Chinese). Every user message that starts a new turn is a rewind point; files changed by edit / write have a checkpoint before the message is sent (`checkpoints.mode`; bash changes are only picked up when the next turn re-snapshots tracked files).
161
+ Design in [rewind-plan.md](../../history/rewind-plan.md) (Chinese). Every user message that starts a new turn is a rewind point; files changed by edit / write have a checkpoint before the message is sent (`checkpoints.mode`; bash changes are only picked up when the next turn re-snapshots tracked files).
162
162
 
163
163
  - **Entry**: `/rewind`, or double Esc while idle with an empty input box: the first press shows a hint at the bottom to press Esc again to rewind (gone after 1 second), and a second press within 800 ms opens the list. With text in the input box, double Esc clears it instead (with a matching hint), and the text goes into input history, recallable with ↑. While running, Esc still interrupts; when an approval dialog or a picker is open, Esc belongs to them.
164
164
  - **Interrupt to withdraw**: when Esc interrupts a run and this turn has no reply text or tool call yet and the input box is empty (`ui.restoreOnCancel`, default true), the message is withdrawn automatically and the original text put back into the input box, with a line in the message area saying the interrupted message was withdrawn.
@@ -326,11 +326,11 @@ After the input summary comes the **pre-execution preview**: what this step will
326
326
  - write: whether the target exists, its current line count and size → the new content; overwriting a file not read in this session is marked yellow.
327
327
  - edit: a dry run against the original, listing −n/+m lines per change and the total; when a match fails or is not unique, this is said up front.
328
328
 
329
- The preview is colored by severity (danger red, warning yellow, the rest dim), read-only and bounded: at most 2000 entries counted per directory and a 200 ms budget for the whole preview; beyond that it only gives a hint without lowering severity; files over 2 MiB only report their size. A failed preview does not affect the approval. Line mode prints the same preview line by line before the question; RPC clients get it from `permission_request.preview` ([rpc.md](rpc.md) "Approvals").
329
+ The preview is colored by severity (danger red, warning yellow, the rest dim), read-only and bounded: at most 2000 entries counted per directory and a 200 ms budget for the whole preview; beyond that it only gives a hint without lowering severity; files over 2 MiB only report their size. A failed preview does not affect the approval. Line mode prints the same preview line by line before the question; RPC clients get it from `permission_request.preview` ([rpc.md](../reference/rpc.md) "Approvals").
330
330
 
331
331
  ## Plan approval
332
332
 
333
- In Plan mode (Shift+Tab, `/permission plan`, `/plan <goal>`, `--permission-mode plan`) the model researches read-only and ends with a `<proposed_plan>` block (rules in [plan.md](../plan.md), Chinese). When the turn ends and the session is idle, an approval box pops up at the bottom:
333
+ In Plan mode (Shift+Tab, `/permission plan`, `/plan <goal>`, `--permission-mode plan`) the model researches read-only and ends with a `<proposed_plan>` block (rules in [plan.md](../../guides/plan.md), Chinese). When the turn ends and the session is idle, an approval box pops up at the bottom:
334
334
 
335
335
  ```
336
336
  ╭─ Plan awaiting approval ─────────────────────────────────────────────────────╮
@@ -359,7 +359,7 @@ In Plan mode (Shift+Tab, `/permission plan`, `/plan <goal>`, `--permission-mode
359
359
 
360
360
  ## Sub-agents
361
361
 
362
- Sub-agents started by the `task` tool ([agents.md](../agents.md), Chinese) fold into a task tool line in the message area, with one status line while running:
362
+ Sub-agents started by the `task` tool ([agents.md](../../guides/agents.md), Chinese) fold into a task tool line in the message area, with one status line while running:
363
363
 
364
364
  ```
365
365
  ⏺ task check test coverage gaps in src/tui
@@ -372,7 +372,7 @@ Sub-agents started by the `task` tool ([agents.md](../agents.md), Chinese) fold
372
372
  ↳ t3 explore · running 30s · 2 turns · grep
373
373
  ```
374
374
 
375
- - The status line shows the type (external agents show a runner such as `claude (claude)`), status and elapsed time, turns, the latest 3 tools and usage; after a foreground task ends it is replaced by the result summary. A background task's tool call (background is the default in the interactive UI, see [agents.md](../agents.md) "foreground and background", Chinese) returns immediately; the summary line says "started in the background", with an extra follow-up status line below (refreshed every second while running). A foreground task moved to the background shows "moved to the background · elapsed" with the same follow-up line (the explanation meant for the model is hidden; `Ctrl+O` shows it). A task moved by the auto timeout (`subagents.autoBackgroundAfterMs`) or by the host also gets a one-line notice; when it completes, the `<task-notification>` the model receives shows in the message area as a single line (e.g. "↳ sub-agent notification: t2 explore done · 7 turns · see /tasks for output"), plus a yellow notice on failure or stop.
375
+ - The status line shows the type (external agents show a runner such as `claude (claude)`), status and elapsed time, turns, the latest 3 tools and usage; after a foreground task ends it is replaced by the result summary. A background task's tool call (background is the default in the interactive UI, see [agents.md](../../guides/agents.md) "foreground and background", Chinese) returns immediately; the summary line says "started in the background", with an extra follow-up status line below (refreshed every second while running). A foreground task moved to the background shows "moved to the background · elapsed" with the same follow-up line (the explanation meant for the model is hidden; `Ctrl+O` shows it). A task moved by the auto timeout (`subagents.autoBackgroundAfterMs`) or by the host also gets a one-line notice; when it completes, the `<task-notification>` the model receives shows in the message area as a single line (e.g. "↳ sub-agent notification: t2 explore done · 7 turns · see /tasks for output"), plus a yellow notice on failure or stop.
376
376
  - `/tasks`: focus the agent bar (below); `/tasks <id>` opens that task's sub-agent view directly; `/tasks stop <id>` stops it; `/tasks bg [id]` moves it to the background (without an id: every blocking foreground task, same as `Ctrl+B`). With `ui.agentBar: "off"` `/tasks` is still the task picker (newest on top, Enter shows the output, running tasks can be stopped). Line mode: `/tasks` lists, `/tasks <id>` shows output, `/tasks stop <id>` stops, `/tasks bg [id]` moves to the background (typed while running it is still a command, not a steer).
377
377
  - Moving to the background (`Ctrl+B`, key action `app.tasks.background`): while the main turn waits for a foreground task (`task` with `background: false`, the `-p` default, or `task_ctl wait`), press it and the tool call returns at once, the task keeps running, the main turn carries on and you can keep sending messages; when the task ends the `<task-notification>` arrives and opens a turn as usual. The hint says "Moved to the background: t2; you'll be notified when it finishes". With nothing to move, `Ctrl+B` falls through to the editor (cursor left) and is not swallowed. tmux's default prefix is `C-b`: in tmux press `C-b C-b` (default `send-prefix`) to pass it to ama, or press `b` in the agent bar; you can also rebind it in `keybindings.json`.
378
378
  - Esc interrupts only the foreground: Esc while running stops the main turn and the sub-tasks still in the foreground; tasks already in the background keep running, and the hint says "Interrupted (background task t2 keeps running; Esc doesn't affect it)".
@@ -396,7 +396,7 @@ Above the status line (below the hint line) the bar lists sub-agent tasks, one l
396
396
  - When the key does not get you in, a one-line hint shows for 3 seconds: text in the input box — "Input is not empty; clear it and press ↓ for the Agent bar" (once per draft, with the cursor on the last line; `↓` still moves down); the bar is off — "Agent bar is off (ui.agentBar); use /tasks"; no tasks — "No sub-agent tasks yet". While browsing input history with `↑` `↓`, `↓` only steps through history.
397
397
  - `Ctrl+B` does not enter the bar; it moves foreground tasks to the background (above). For the old "`Ctrl+B` enters the bar", set `"app.agents.focus": ["down", "ctrl+b"]` in `keybindings.json` and rebind `app.tasks.background`.
398
398
  - In the bar: `↑` `↓` select (lists every task of the session, the window scrolls along; `↑` on the first item returns to the input box), Enter opens the sub-agent view (a docked approval of the selected task pops up right away), `b` / `Ctrl+B` moves the selected foreground task to the background (a one-line hint when it is not running in the foreground), `x` stops the selected task (the first press hints "Press x again to stop t2"; it stops only on a second press within 1.5 seconds), Esc returns to the input box; other letters return to the input box with the text filled in. The last line is the key hint `↑↓ select · Enter open · b background · x stop · Esc back`; narrow screens drop the `b` / `x` items.
399
- - Embedding hosts (with a profile) no longer turn the bar off by default; a host that shows sub-tasks itself and does not want the bar sets `ui.agentBar: "off"` in its profile (see [host-api.md](host-api.md) "Embedding in Armadra"). With the bar off it is not shown, and `↓` with tasks points to `/tasks`.
399
+ - Embedding hosts (with a profile) no longer turn the bar off by default; a host that shows sub-tasks itself and does not want the bar sets `ui.agentBar: "off"` in its profile (see [host-api.md](../reference/host-api.md) "Embedding in Armadra"). With the bar off it is not shown, and `↓` with tasks points to `/tasks`.
400
400
 
401
401
  ### Sub-agent view
402
402
 
@@ -416,7 +416,7 @@ t2 explore · running 1m05s · 3 turns · ↑12k ↓3.4k · Esc back · /tasks s
416
416
 
417
417
  - The body follows live: for ama sub-agents it shows every message and tool call of the sub-session (rendered like the message area); when the sub-session handle has been released (at most 16 are kept) or the session was resumed, the sub-session file is loaded read-only and live events are attached when the task runs again. External agents (claude / codex / ACP) show the live output held in this process's memory (text, thinking, tool start / end, turns, notices; at most 2000 items / 1 MB, never written to disk); after ama restarts only one line remains, saying to use the original CLI's resume <session id> for the full text.
418
418
  - With an empty input box: `↑` / PgUp scroll up (pausing follow, with "follow paused · End to resume" at the bottom), `↓` / PgDn scroll down, End (or `f` while paused) resumes following; `←` `→` switch to the previous / next task; Esc returns to the main screen. With text in the input box, Esc clears it first.
419
- - Enter sends the input to this sub-agent (recorded in the sub-session as a user message with `origin: "direct"`, see [session-format.md](../session-format.md), Chinese): ama sub-agent running → delivered when its current turn ends; external agent running or task still queued → continued after this run ends; finished → continued in the background (like `task_ctl send`; the main session receives the `<task-notification>` as usual when it completes). A line at the bottom reports the result. The parent session's model does not know you talked to the sub-agent directly; the result comes back through the completion notification.
419
+ - Enter sends the input to this sub-agent (recorded in the sub-session as a user message with `origin: "direct"`, see [session-format.md](../../reference/session-format.md), Chinese): ama sub-agent running → delivered when its current turn ends; external agent running or task still queued → continued after this run ends; finished → continued in the background (like `task_ctl send`; the main session receives the `<task-notification>` as usual when it completes). A line at the bottom reports the result. The parent session's model does not know you talked to the sub-agent directly; the result comes back through the completion notification.
420
420
  - `Ctrl+X` interrupts this sub-agent and sends now: an ama sub-agent that is running stops its current turn (tools finish as interrupted) and starts a new turn with the message at once; the task completes and notifies the main session as usual. An external agent whose driver can interrupt a single turn (ACP `session/cancel`, Claude stream-json interrupt, Codex `turn/interrupt`) is interrupted and its next turn starts with the message (and any messages queued before it); when it cannot (oneshot, host drivers) or the task is still waiting in the concurrency pool, the message is queued instead with a hint; a finished task continues in the background as with Enter. Swapped with Enter under `ui.enterWhileRunning: "interrupt"`. The main session is not affected.
421
421
  - Esc in the view interrupts nothing: it only goes back. To stop the task use `/tasks stop <id>`; to move it to the background use `Ctrl+B` or `/tasks bg [id]`. Both work in the view's input box (the only commands the view accepts).
422
422
  - When the viewed task waits for approval the title says "awaiting approval", and the approval dialog pops up over the view as usual (with the `[task:<type>]` origin); if its approval is docked in the bar, opening the view pops it up.
@@ -466,11 +466,11 @@ Trace · 1 turn · 2 requests · 3 tool calls · 12s · ↑8.1k ↓240 · cache
466
466
  - Auxiliary requests such as warming and permission classification are grouped at the end under "N auxiliary requests", collapsed by default.
467
467
  - In line mode (`--ui line`, pipes) `/trace [task id]` prints the same tree as text (fully expanded, no bars).
468
468
 
469
- Timing comes from `custom{customType:"ama.trace"}` entries in the session file ([session-format.md](../session-format.md), Chinese), which hold only ids, times and counts; previews of prompts, arguments and results are read from session entries on demand and never enter the trace itself. The HTML export `ama sessions trace` and RPC `get_trace` are described in [sessions.md](sessions.md) and [rpc.md](rpc.md).
469
+ Timing comes from `custom{customType:"ama.trace"}` entries in the session file ([session-format.md](../../reference/session-format.md), Chinese), which hold only ids, times and counts; previews of prompts, arguments and results are read from session entries on demand and never enter the trace itself. The HTML export `ama sessions trace` and RPC `get_trace` are described in [sessions.md](sessions.md) and [rpc.md](../reference/rpc.md).
470
470
 
471
471
  ## Memory
472
472
 
473
- Requires memory to be enabled (`ama memory enable` or `--memory`, see [memory.md](../memory.md), Chinese). `/memory` draws a card in the message area: one section per scope (`user /memories/user/ · N entries · index X / 4.0 KiB`), one line per entry "name — description updated date", entries not updated for over 90 days greyed out; when the index exceeds its limit a yellow line says how many entries did not make it into the system prompt; an untrusted project and writes disabled for this session each add a line at the bottom of the card.
473
+ Requires memory to be enabled (`ama memory enable` or `--memory`, see [memory.md](../../guides/memory.md), Chinese). `/memory` draws a card in the message area: one section per scope (`user /memories/user/ · N entries · index X / 4.0 KiB`), one line per entry "name — description updated date", entries not updated for over 90 days greyed out; when the index exceeds its limit a yellow line says how many entries did not make it into the system prompt; an untrusted project and writes disabled for this session each add a line at the bottom of the card.
474
474
 
475
475
  `/memory show <name>` renders the body as a card; `/memory edit [name|scope]` suspends the interface and opens `$VISUAL` / `$EDITOR` (on a temporary copy, saved back and the index rebuilt after you save and quit, with the same credential and size checks as model writes); `/memory rm <name>` asks for confirmation (default "Cancel", `y` deletes, `n` / Esc cancels); `/memory on|off` toggles writes for this session; `/memory reload` re-renders the system prompt's `memory` section (breaking the cache once). Line mode has the same commands with text output; `edit` uses `ama memory edit` instead and `rm` needs `--yes`. When memory is not enabled for the session it only explains how to enable it.
476
476
 
@@ -1,16 +1,16 @@
1
1
  # ACP (Agent Client Protocol)
2
2
 
3
- English · [简体中文](../acp.md)
3
+ English · [简体中文](../../reference/acp.md)
4
4
 
5
- > Translated from the Chinese [docs/acp.md](../acp.md) as of commit `f6419be`. When the two differ, the Chinese version is
5
+ > Translated from the Chinese [docs/reference/acp.md](../../reference/acp.md) as of commit `f6419be`. When the two differ, the Chinese version is
6
6
  > authoritative.
7
7
 
8
8
  ama works on both sides of ACP:
9
9
 
10
10
  - **Agent**: `ama --mode acp` exposes ama as an ACP agent for Zed, JetBrains and Armadra's ACP nodes;
11
- - **Client**: ama drives external agents over ACP (native ACP agents such as Gemini CLI, OpenCode, Kimi and Copilot, or Claude Code / Codex with an adapter installed); see [agents.md](../agents.md) (Chinese).
11
+ - **Client**: ama drives external agents over ACP (native ACP agents such as Gemini CLI, OpenCode, Kimi and Copilot, or Claude Code / Codex with an adapter installed); see [agents.md](../../guides/agents.md) (Chinese).
12
12
 
13
- The protocol stack is hand-written with no dependencies and maintained in one place: `@armadra/agent/acp` exports the types, framing, client and fake agent, and Armadra reuses them directly. The design rationale is in [wave5-plan.md](../wave5-plan.md) §5 (D14, Chinese).
13
+ The protocol stack is hand-written with no dependencies and maintained in one place: `@armadra/agent/acp` exports the types, framing, client and fake agent, and Armadra reuses them directly. The design rationale is in [wave5-plan.md](../../history/wave5-plan.md) §5 (D14, Chinese).
14
14
 
15
15
  ## Wire
16
16
 
@@ -73,7 +73,7 @@ The full before / after text of a diff only travels with live events and is neve
73
73
 
74
74
  ### Approvals
75
75
 
76
- Calls that ama needs to ask about go to the client as `session/request_permission` with three options: `allow_once` (Allow), `allow_always` (Allow for this session) and `reject_once` (Deny). `toolCall.toolCallId` refers to the id of an earlier `tool_call` — including calls inside codemode, which point at the inner `tool_call`, not the outer `codemode` one. While the question is open the call goes back to `pending`, then `in_progress` once allowed (so an approved call goes `pending → in_progress → pending → in_progress → completed`); a denied call goes straight to `failed`. When the client answers `cancelled`, the connection drops or the turn is interrupted, it counts as unanswered (denied). When ama no longer needs an answer (the turn was interrupted by `session/cancel` / `$/cancel_request`, or the 10-minute approval timeout passed), it withdraws the pending `session/request_permission` with `$/cancel_request { requestId }` so the client can close its dialog. In auto mode ama's own classifier still works — this only applies to ama's own tools; requests from external agents that ama drives go to a human only (see [agents.md](../agents.md), Chinese).
76
+ Calls that ama needs to ask about go to the client as `session/request_permission` with three options: `allow_once` (Allow), `allow_always` (Allow for this session) and `reject_once` (Deny). `toolCall.toolCallId` refers to the id of an earlier `tool_call` — including calls inside codemode, which point at the inner `tool_call`, not the outer `codemode` one. While the question is open the call goes back to `pending`, then `in_progress` once allowed (so an approved call goes `pending → in_progress → pending → in_progress → completed`); a denied call goes straight to `failed`. When the client answers `cancelled`, the connection drops or the turn is interrupted, it counts as unanswered (denied). When ama no longer needs an answer (the turn was interrupted by `session/cancel` / `$/cancel_request`, or the 10-minute approval timeout passed), it withdraws the pending `session/request_permission` with `$/cancel_request { requestId }` so the client can close its dialog. In auto mode ama's own classifier still works — this only applies to ama's own tools; requests from external agents that ama drives go to a human only (see [agents.md](../../guides/agents.md), Chinese).
77
77
 
78
78
  ### Without a model
79
79
 
@@ -145,7 +145,7 @@ These are deliberate choices, not omissions:
145
145
 
146
146
  ## As a client
147
147
 
148
- The model uses ACP agents through `task(agent="acp:<program>")` (ama itself is `task(agent="acp:ama")`; see "Using them in task" in [agents.md](../agents.md), Chinese).
148
+ The model uses ACP agents through `task(agent="acp:<program>")` (ama itself is `task(agent="acp:ama")`; see "Using them in task" in [agents.md](../../guides/agents.md), Chinese).
149
149
 
150
150
  `AcpClient` (`@armadra/agent/acp`): `initialize`, `newSession`, `resumeSession` (preferred, no replay), `loadSession`, `listSessions`, `closeSession`, `prompt`, `setMode`, `cancel`.
151
151
 
@@ -1,11 +1,11 @@
1
1
  # Host adapter API (@armadra/agent/host)
2
2
 
3
- English · [简体中文](../host-api.md)
3
+ English · [简体中文](../../reference/host-api.md)
4
4
 
5
- > Translated from the Chinese [docs/host-api.md](../host-api.md) as of commit `979608b`. When the two differ, the Chinese
5
+ > Translated from the Chinese [docs/reference/host-api.md](../../reference/host-api.md) as of commit `979608b`. When the two differ, the Chinese
6
6
  > version is authoritative.
7
7
 
8
- A host adapter is a local JS module that ama loads at startup and hands a `HostApi`. With it the adapter can register tools, append to the system prompt, observe events, answer approvals, inject user messages and show notifications and status in the interface. The Armadra canvas plugs in as a host adapter (the canvas tools `canvas_*` / `context_*` are all registered by the adapter). The types are defined in `src/host/types.ts` and exported from `@armadra/agent/host`; `HOST_API_VERSION = 1`. The design rationale is in [design.md](../design.md) §6.2, §6.3 and §11.1 step 13 (Chinese).
8
+ A host adapter is a local JS module that ama loads at startup and hands a `HostApi`. With it the adapter can register tools, append to the system prompt, observe events, answer approvals, inject user messages and show notifications and status in the interface. The Armadra canvas plugs in as a host adapter (the canvas tools `canvas_*` / `context_*` are all registered by the adapter). The types are defined in `src/host/types.ts` and exported from `@armadra/agent/host`; `HOST_API_VERSION = 1`. The design rationale is in [design.md](../../design/design.md) §6.2, §6.3 and §11.1 step 13 (Chinese).
9
9
 
10
10
  ## Module shape
11
11
 
@@ -100,7 +100,7 @@ interface ToolResult {
100
100
  }
101
101
  ```
102
102
 
103
- `ToolContext` provides `toolCallId`, `cwd`, `sessionId`, `sessionFile?`, `signal`, `depth`, `model?`, `thinkingLevel?`, `outputDir?`, `onUpdate(partial)` (output while running), `readFiles` / `markRead`, `activeTools?` (read-only snapshot of the session's active tool set, so tools can give actionable hints), `tools.executeTool(name, input)` (nested calls through the same pipeline), `session.appendCustom` / `lastCustom` (custom entries that never enter the context, see [session-format.md](../session-format.md), Chinese), `spawnSubagent?` and `log`.
103
+ `ToolContext` provides `toolCallId`, `cwd`, `sessionId`, `sessionFile?`, `signal`, `depth`, `model?`, `thinkingLevel?`, `outputDir?`, `onUpdate(partial)` (output while running), `readFiles` / `markRead`, `activeTools?` (read-only snapshot of the session's active tool set, so tools can give actionable hints), `tools.executeTool(name, input)` (nested calls through the same pipeline), `session.appendCustom` / `lastCustom` (custom entries that never enter the context, see [session-format.md](../../reference/session-format.md), Chinese), `spawnSubagent?` and `log`.
104
104
 
105
105
  Host tools take the same path as built-in tools: schema validation → command hook PreToolUse → permission pipeline (classified by `permission`) → approval → execution → PostToolUse. They can also be called from codemode scripts as `tools.<name>()`.
106
106
 
@@ -137,7 +137,7 @@ For token-level streaming content or the full event stream, use RPC or the SDK's
137
137
  - `request`: `requestId`, `toolName`, `input`, `reason: "mode" | "dangerous" | "hook"`, `hookReason?`, `preview?` (the pre-execution preview, see [rpc.md](rpc.md) "Approvals"), `context?` (`depth > 0` means it comes from a `task` sub-agent; codemode inner calls carry `parentToolCallId`).
138
138
  - On timeout (10 minutes by default, `AMA_APPROVAL_TIMEOUT_MS`) or when the run is interrupted, `signal` aborts and the decision is deny. Approvals are serial: only one request waits at a time.
139
139
  - Timing: the broker is looked up at each approval, so it can be set in `create()` or set / replaced at any later time; the last `setBroker` wins.
140
- - The host broker only decides "who answers an ask"; it cannot loosen deny rules, command hook denies or dangerous-command detection ([design.md](../design.md) §6.3, Chinese).
140
+ - The host broker only decides "who answers an ask"; it cannot loosen deny rules, command hook denies or dangerous-command detection ([design.md](../../design/design.md) §6.3, Chinese).
141
141
 
142
142
  ## Cache warming
143
143
 
@@ -155,7 +155,7 @@ interface WarmDecision {
155
155
  }
156
156
  ```
157
157
 
158
- Return `"warm"` / `"stop"` (a Promise is fine). `"stop"` skips the request and stops this warming round (when the built-in decision was warm, the stop reason is recorded as `declined`); `"warm"` can override a built-in stop. If the handler fails, the built-in decision applies. With several handlers, the last one registered and not unsubscribed wins; the return value is an unsubscribe function. The warming mechanism itself is described in [providers.md](providers.md) "Caching".
158
+ Return `"warm"` / `"stop"` (a Promise is fine). `"stop"` skips the request and stops this warming round (when the built-in decision was warm, the stop reason is recorded as `declined`); `"warm"` can override a built-in stop. If the handler fails, the built-in decision applies. With several handlers, the last one registered and not unsubscribed wins; the return value is an unsubscribe function. The warming mechanism itself is described in [providers.md](../guides/providers.md) "Caching".
159
159
 
160
160
  ## Exit
161
161
 
@@ -168,4 +168,4 @@ Armadra starts ama with a profile: `ama --profile <path>`. The profile's `host`
168
168
 
169
169
  Interface defaults with a profile: `ui.quietStartup: "header"` and `ui.statusLine: "compact"` (the last line is the status bar, which the host parses by `·`). The agent bar (`ui.agentBar`) is no longer off by default; it is `auto` as in a standalone terminal. A host that shows sub-tasks itself and does not want the bar writes `{ "ui": { "agentBar": "off" } }` into the config file its profile's `config` points to.
170
170
 
171
- Contract details are in [docs/design/coordinator-agent.md](https://github.com/yovinchen/Armadra/blob/main/docs/design/coordinator-agent.md) in the Armadra repository.
171
+ Contract details are in [docs/design/coordinator-agent.md](https://github.com/AMA-Link/Armadra/blob/main/docs/design/coordinator-agent.md) in the Armadra repository.