@armadra/agent 0.8.0 → 0.8.1

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 (512) hide show
  1. package/CHANGELOG.md +39 -32
  2. package/CHANGELOG.zh-CN.md +56 -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.d.ts +2 -2
  89. package/dist/ai/providers/catalog.js +1 -1
  90. package/dist/ai/providers/channels.d.ts +1 -1
  91. package/dist/ai/providers/channels.js +1 -1
  92. package/dist/ai/providers/enrich.d.ts +1 -1
  93. package/dist/ai/providers/enrich.js +1 -1
  94. package/dist/ai/providers/models-dev-cache.d.ts +1 -1
  95. package/dist/ai/providers/models-dev-cache.js +1 -1
  96. package/dist/ai/providers/models-dev-data.d.ts +1 -1
  97. package/dist/ai/providers/models-dev-data.js +1 -1
  98. package/dist/ai/providers/models-dev-snapshot.d.ts +1 -1
  99. package/dist/ai/providers/models-dev-snapshot.js +1 -1
  100. package/dist/ai/providers/models-dev.d.ts +4 -4
  101. package/dist/ai/providers/models-dev.js +3 -3
  102. package/dist/ai/types.d.ts +2 -2
  103. package/dist/ai/types.js +1 -1
  104. package/dist/auth/chatgpt/cli.d.ts +1 -1
  105. package/dist/auth/chatgpt/cli.js +1 -1
  106. package/dist/auth/chatgpt/host-id.d.ts +1 -1
  107. package/dist/auth/chatgpt/host-id.js +1 -1
  108. package/dist/auth/chatgpt/login.d.ts +1 -1
  109. package/dist/auth/chatgpt/login.js +1 -1
  110. package/dist/auth/chatgpt/presets.d.ts +1 -1
  111. package/dist/auth/chatgpt/presets.js +1 -1
  112. package/dist/auth/oauth/callback-server.d.ts +1 -1
  113. package/dist/auth/oauth/callback-server.js +1 -1
  114. package/dist/auth/oauth/flows.d.ts +1 -1
  115. package/dist/auth/oauth/flows.js +1 -1
  116. package/dist/auth/oauth/oidc.d.ts +1 -1
  117. package/dist/auth/oauth/oidc.js +1 -1
  118. package/dist/auth/oauth/pkce.d.ts +1 -1
  119. package/dist/auth/oauth/pkce.js +1 -1
  120. package/dist/auth/oauth/refresh.d.ts +1 -1
  121. package/dist/auth/oauth/refresh.js +1 -1
  122. package/dist/auth/oauth/token-client.d.ts +1 -1
  123. package/dist/auth/oauth/token-client.js +1 -1
  124. package/dist/auth/oauth/token-store.d.ts +1 -1
  125. package/dist/auth/oauth/token-store.js +1 -1
  126. package/dist/auth/testing/fake-oauth.d.ts +1 -1
  127. package/dist/auth/testing/fake-oauth.js +1 -1
  128. package/dist/bundle/ama.cjs +24 -24
  129. package/dist/checkpoints/blobs.d.ts +1 -1
  130. package/dist/checkpoints/blobs.js +1 -1
  131. package/dist/checkpoints/gc.d.ts +1 -1
  132. package/dist/checkpoints/gc.js +1 -1
  133. package/dist/checkpoints/git-head.d.ts +1 -1
  134. package/dist/checkpoints/git-head.js +1 -1
  135. package/dist/checkpoints/index.d.ts +1 -1
  136. package/dist/checkpoints/index.js +1 -1
  137. package/dist/checkpoints/replay.d.ts +1 -1
  138. package/dist/checkpoints/replay.js +1 -1
  139. package/dist/checkpoints/restore.d.ts +1 -1
  140. package/dist/checkpoints/restore.js +1 -1
  141. package/dist/checkpoints/settings.d.ts +1 -1
  142. package/dist/checkpoints/settings.js +1 -1
  143. package/dist/checkpoints/shadow-git.d.ts +1 -1
  144. package/dist/checkpoints/shadow-git.js +1 -1
  145. package/dist/checkpoints/shadow-restore.d.ts +1 -1
  146. package/dist/checkpoints/shadow-restore.js +1 -1
  147. package/dist/checkpoints/tracker.d.ts +1 -1
  148. package/dist/checkpoints/tracker.js +1 -1
  149. package/dist/checkpoints/types.d.ts +1 -1
  150. package/dist/checkpoints/types.js +1 -1
  151. package/dist/cli/args.d.ts +2 -2
  152. package/dist/cli/args.js +1 -1
  153. package/dist/cli/bootstrap.js +1 -1
  154. package/dist/cli/choice-prompt.d.ts +1 -1
  155. package/dist/cli/choice-prompt.js +1 -1
  156. package/dist/cli/codemode-notice.d.ts +1 -1
  157. package/dist/cli/codemode-notice.js +1 -1
  158. package/dist/cli/compose-agents.d.ts +1 -1
  159. package/dist/cli/compose-agents.js +1 -1
  160. package/dist/cli/compose-extensions.d.ts +1 -1
  161. package/dist/cli/compose-extensions.js +1 -1
  162. package/dist/cli/compose-memory.d.ts +1 -1
  163. package/dist/cli/compose-memory.js +1 -1
  164. package/dist/cli/compose-providers.d.ts +1 -1
  165. package/dist/cli/compose-providers.js +1 -1
  166. package/dist/cli/compose-request.d.ts +1 -1
  167. package/dist/cli/compose-request.js +1 -1
  168. package/dist/cli/from-prompt.d.ts +1 -1
  169. package/dist/cli/from-prompt.js +1 -1
  170. package/dist/cli/main.d.ts +1 -1
  171. package/dist/cli/main.js +1 -1
  172. package/dist/cli/subcommands/auth.d.ts +1 -1
  173. package/dist/cli/subcommands/auth.js +1 -1
  174. package/dist/cli/subcommands/config-set.d.ts +1 -1
  175. package/dist/cli/subcommands/config-set.js +1 -1
  176. package/dist/cli/subcommands/doctor.js +1 -1
  177. package/dist/cli/subcommands/init.d.ts +1 -1
  178. package/dist/cli/subcommands/init.js +1 -1
  179. package/dist/cli/subcommands/memory.d.ts +1 -1
  180. package/dist/cli/subcommands/memory.js +1 -1
  181. package/dist/cli/subcommands/models.js +1 -1
  182. package/dist/cli/subcommands/providers-list.d.ts +1 -1
  183. package/dist/cli/subcommands/providers-list.js +1 -1
  184. package/dist/cli/subcommands/providers-plan.d.ts +1 -1
  185. package/dist/cli/subcommands/providers-plan.js +1 -1
  186. package/dist/cli/subcommands/providers.d.ts +1 -1
  187. package/dist/cli/subcommands/providers.js +1 -1
  188. package/dist/cli/subcommands/sessions-export.d.ts +1 -1
  189. package/dist/cli/subcommands/sessions-export.js +1 -1
  190. package/dist/cli/subcommands/sessions-trace.d.ts +1 -1
  191. package/dist/cli/subcommands/sessions-trace.js +1 -1
  192. package/dist/cli/subcommands/sessions.d.ts +1 -1
  193. package/dist/cli/subcommands/sessions.js +1 -1
  194. package/dist/cli/subcommands/stats.d.ts +1 -1
  195. package/dist/cli/subcommands/stats.js +1 -1
  196. package/dist/codemode/capability.d.ts +1 -1
  197. package/dist/codemode/capability.js +1 -1
  198. package/dist/codemode/host-side.d.ts +2 -2
  199. package/dist/codemode/host-side.js +2 -2
  200. package/dist/compaction/image-budget.d.ts +1 -1
  201. package/dist/compaction/image-budget.js +1 -1
  202. package/dist/config/edit.d.ts +1 -1
  203. package/dist/config/edit.js +1 -1
  204. package/dist/config/init.d.ts +1 -1
  205. package/dist/config/init.js +1 -1
  206. package/dist/config/json-schema.d.ts +2 -2
  207. package/dist/config/json-schema.js +2 -2
  208. package/dist/config/schema-w5.d.ts +1 -1
  209. package/dist/config/schema-w5.js +1 -1
  210. package/dist/config/schema-w6.d.ts +1 -1
  211. package/dist/config/schema-w6.js +1 -1
  212. package/dist/config/settings-registry.d.ts +1 -1
  213. package/dist/config/settings-registry.js +1 -1
  214. package/dist/config/types-w5.d.ts +2 -2
  215. package/dist/config/types-w5.js +2 -2
  216. package/dist/config/types-w6.d.ts +5 -5
  217. package/dist/config/types-w6.js +1 -1
  218. package/dist/config/types.d.ts +6 -6
  219. package/dist/config/types.js +1 -1
  220. package/dist/drivers/acp/client.d.ts +1 -1
  221. package/dist/drivers/acp/client.js +1 -1
  222. package/dist/drivers/acp/driver.d.ts +1 -1
  223. package/dist/drivers/acp/driver.js +1 -1
  224. package/dist/drivers/acp/testing/fake-agent.d.ts +1 -1
  225. package/dist/drivers/acp/testing/fake-agent.js +1 -1
  226. package/dist/drivers/acp/types.d.ts +1 -1
  227. package/dist/drivers/acp/types.js +1 -1
  228. package/dist/drivers/agents.d.ts +1 -1
  229. package/dist/drivers/agents.js +1 -1
  230. package/dist/drivers/base.d.ts +1 -1
  231. package/dist/drivers/base.js +1 -1
  232. package/dist/drivers/catalog.d.ts +1 -1
  233. package/dist/drivers/catalog.js +1 -1
  234. package/dist/drivers/env.d.ts +1 -1
  235. package/dist/drivers/env.js +1 -1
  236. package/dist/drivers/host-runners.d.ts +1 -1
  237. package/dist/drivers/host-runners.js +1 -1
  238. package/dist/drivers/jsonrpc.d.ts +1 -1
  239. package/dist/drivers/jsonrpc.js +1 -1
  240. package/dist/drivers/native/claude-normalize.d.ts +1 -1
  241. package/dist/drivers/native/claude-normalize.js +1 -1
  242. package/dist/drivers/native/claude-stream.d.ts +1 -1
  243. package/dist/drivers/native/claude-stream.js +1 -1
  244. package/dist/drivers/native/codex-app-server.d.ts +1 -1
  245. package/dist/drivers/native/codex-app-server.js +1 -1
  246. package/dist/drivers/native/codex-normalize.d.ts +1 -1
  247. package/dist/drivers/native/codex-normalize.js +1 -1
  248. package/dist/drivers/native/oneshot.d.ts +1 -1
  249. package/dist/drivers/native/oneshot.js +1 -1
  250. package/dist/drivers/permissions.d.ts +1 -1
  251. package/dist/drivers/permissions.js +1 -1
  252. package/dist/drivers/pids.d.ts +1 -1
  253. package/dist/drivers/pids.js +1 -1
  254. package/dist/drivers/pool.d.ts +1 -1
  255. package/dist/drivers/pool.js +1 -1
  256. package/dist/drivers/probe.d.ts +1 -1
  257. package/dist/drivers/probe.js +1 -1
  258. package/dist/drivers/process.d.ts +1 -1
  259. package/dist/drivers/process.js +1 -1
  260. package/dist/drivers/runner.d.ts +1 -1
  261. package/dist/drivers/runner.js +1 -1
  262. package/dist/drivers/store.d.ts +1 -1
  263. package/dist/drivers/store.js +1 -1
  264. package/dist/drivers/types.d.ts +1 -1
  265. package/dist/drivers/types.js +1 -1
  266. package/dist/git/info.d.ts +1 -1
  267. package/dist/git/info.js +1 -1
  268. package/dist/host/api-impl.d.ts +1 -1
  269. package/dist/host/api-impl.js +1 -1
  270. package/dist/host/types.d.ts +2 -2
  271. package/dist/i18n/catalog.d.ts +2 -2
  272. package/dist/i18n/catalog.js +2 -2
  273. package/dist/i18n/format.d.ts +1 -1
  274. package/dist/i18n/format.js +1 -1
  275. package/dist/i18n/index.d.ts +1 -1
  276. package/dist/i18n/index.js +1 -1
  277. package/dist/i18n/messages/acp.d.ts +1 -1
  278. package/dist/i18n/messages/acp.js +1 -1
  279. package/dist/i18n/messages/agents.d.ts +1 -1
  280. package/dist/i18n/messages/agents.js +1 -1
  281. package/dist/i18n/messages/approval.d.ts +1 -1
  282. package/dist/i18n/messages/approval.js +1 -1
  283. package/dist/i18n/messages/auth.d.ts +1 -1
  284. package/dist/i18n/messages/auth.js +1 -1
  285. package/dist/i18n/messages/cli.d.ts +1 -1
  286. package/dist/i18n/messages/cli.js +1 -1
  287. package/dist/i18n/messages/config-keys.js +12 -12
  288. package/dist/i18n/messages/config.d.ts +1 -1
  289. package/dist/i18n/messages/config.js +3 -3
  290. package/dist/i18n/messages/drivers.d.ts +1 -1
  291. package/dist/i18n/messages/drivers.js +1 -1
  292. package/dist/i18n/messages/errors.d.ts +1 -1
  293. package/dist/i18n/messages/errors.js +1 -1
  294. package/dist/i18n/messages/interactive-line.d.ts +1 -1
  295. package/dist/i18n/messages/interactive-line.js +1 -1
  296. package/dist/i18n/messages/interactive-startup.d.ts +1 -1
  297. package/dist/i18n/messages/interactive-startup.js +1 -1
  298. package/dist/i18n/messages/interactive-view.d.ts +1 -1
  299. package/dist/i18n/messages/interactive-view.js +1 -1
  300. package/dist/i18n/messages/interactive.d.ts +1 -1
  301. package/dist/i18n/messages/interactive.js +1 -1
  302. package/dist/i18n/messages/memory.d.ts +1 -1
  303. package/dist/i18n/messages/memory.js +1 -1
  304. package/dist/i18n/messages/panels.d.ts +1 -1
  305. package/dist/i18n/messages/panels.js +1 -1
  306. package/dist/i18n/messages/permissions.d.ts +1 -1
  307. package/dist/i18n/messages/permissions.js +1 -1
  308. package/dist/i18n/messages/plan.d.ts +1 -1
  309. package/dist/i18n/messages/plan.js +1 -1
  310. package/dist/i18n/messages/print.d.ts +2 -2
  311. package/dist/i18n/messages/print.js +2 -2
  312. package/dist/i18n/messages/report-context.d.ts +1 -1
  313. package/dist/i18n/messages/report-context.js +1 -1
  314. package/dist/i18n/messages/report.d.ts +1 -1
  315. package/dist/i18n/messages/report.js +1 -1
  316. package/dist/i18n/messages/rewind.d.ts +1 -1
  317. package/dist/i18n/messages/rewind.js +1 -1
  318. package/dist/i18n/messages/session.d.ts +1 -1
  319. package/dist/i18n/messages/session.js +1 -1
  320. package/dist/i18n/messages/settings.d.ts +1 -1
  321. package/dist/i18n/messages/settings.js +1 -1
  322. package/dist/i18n/messages/subcommands.d.ts +1 -1
  323. package/dist/i18n/messages/subcommands.js +1 -1
  324. package/dist/i18n/messages/trace.d.ts +1 -1
  325. package/dist/i18n/messages/trace.js +1 -1
  326. package/dist/i18n/types.d.ts +1 -1
  327. package/dist/i18n/types.js +1 -1
  328. package/dist/memory/frontmatter.d.ts +1 -1
  329. package/dist/memory/frontmatter.js +1 -1
  330. package/dist/memory/index.d.ts +1 -1
  331. package/dist/memory/index.js +1 -1
  332. package/dist/memory/lock.d.ts +1 -1
  333. package/dist/memory/lock.js +1 -1
  334. package/dist/memory/paths.d.ts +1 -1
  335. package/dist/memory/paths.js +1 -1
  336. package/dist/memory/runtime.d.ts +1 -1
  337. package/dist/memory/runtime.js +1 -1
  338. package/dist/memory/secrets.d.ts +1 -1
  339. package/dist/memory/secrets.js +1 -1
  340. package/dist/memory/section.d.ts +1 -1
  341. package/dist/memory/section.js +1 -1
  342. package/dist/memory/store.d.ts +1 -1
  343. package/dist/memory/store.js +1 -1
  344. package/dist/memory/tool.d.ts +1 -1
  345. package/dist/memory/tool.js +1 -1
  346. package/dist/modes/acp/acp-auth-gate.d.ts +1 -1
  347. package/dist/modes/acp/acp-auth-gate.js +1 -1
  348. package/dist/modes/acp/acp-config.d.ts +1 -1
  349. package/dist/modes/acp/acp-config.js +1 -1
  350. package/dist/modes/acp/acp-connection.d.ts +1 -1
  351. package/dist/modes/acp/acp-connection.js +1 -1
  352. package/dist/modes/acp/acp-events.d.ts +1 -1
  353. package/dist/modes/acp/acp-events.js +1 -1
  354. package/dist/modes/acp/acp-mode.d.ts +1 -1
  355. package/dist/modes/acp/acp-mode.js +1 -1
  356. package/dist/modes/acp/acp-server.d.ts +2 -2
  357. package/dist/modes/acp/acp-server.js +2 -2
  358. package/dist/modes/acp/acp-sessions.d.ts +2 -2
  359. package/dist/modes/acp/acp-sessions.js +2 -2
  360. package/dist/modes/acp/acp-tool-text.d.ts +1 -1
  361. package/dist/modes/acp/acp-tool-text.js +1 -1
  362. package/dist/modes/commands-core.js +1 -1
  363. package/dist/modes/image-input.d.ts +1 -1
  364. package/dist/modes/image-input.js +1 -1
  365. package/dist/modes/interactive/agent-bar.d.ts +1 -1
  366. package/dist/modes/interactive/agent-bar.js +1 -1
  367. package/dist/modes/interactive/agent-transcript.d.ts +1 -1
  368. package/dist/modes/interactive/agent-transcript.js +1 -1
  369. package/dist/modes/interactive/agent-view.d.ts +1 -1
  370. package/dist/modes/interactive/agent-view.js +1 -1
  371. package/dist/modes/interactive/approval-dock.d.ts +1 -1
  372. package/dist/modes/interactive/approval-dock.js +1 -1
  373. package/dist/modes/interactive/config-panel.d.ts +1 -1
  374. package/dist/modes/interactive/config-panel.js +1 -1
  375. package/dist/modes/interactive/config-ui.d.ts +1 -1
  376. package/dist/modes/interactive/config-ui.js +1 -1
  377. package/dist/modes/interactive/memory-panel.d.ts +1 -1
  378. package/dist/modes/interactive/memory-panel.js +1 -1
  379. package/dist/modes/interactive/plan-command.d.ts +1 -1
  380. package/dist/modes/interactive/plan-command.js +1 -1
  381. package/dist/modes/interactive/plan-dialog.d.ts +1 -1
  382. package/dist/modes/interactive/plan-dialog.js +1 -1
  383. package/dist/modes/interactive/plan-flow.d.ts +1 -1
  384. package/dist/modes/interactive/plan-flow.js +1 -1
  385. package/dist/modes/interactive/subagent-view.d.ts +1 -1
  386. package/dist/modes/interactive/subagent-view.js +1 -1
  387. package/dist/modes/interactive/task-background.d.ts +1 -1
  388. package/dist/modes/interactive/task-background.js +1 -1
  389. package/dist/modes/interactive/trace-view.d.ts +1 -1
  390. package/dist/modes/interactive/trace-view.js +1 -1
  391. package/dist/modes/print/json-event.d.ts +1 -1
  392. package/dist/modes/print/json-event.js +2 -2
  393. package/dist/modes/print/print-mode.d.ts +1 -1
  394. package/dist/modes/print/print-mode.js +1 -1
  395. package/dist/modes/print/search-hint.d.ts +1 -1
  396. package/dist/modes/print/search-hint.js +1 -1
  397. package/dist/modes/rpc/commands.js +2 -2
  398. package/dist/permissions/auto-safe.d.ts +1 -1
  399. package/dist/permissions/auto-safe.js +1 -1
  400. package/dist/permissions/bypass.d.ts +1 -1
  401. package/dist/permissions/bypass.js +1 -1
  402. package/dist/permissions/classifier.d.ts +1 -1
  403. package/dist/permissions/classifier.js +1 -1
  404. package/dist/permissions/memory-class.d.ts +1 -1
  405. package/dist/permissions/memory-class.js +1 -1
  406. package/dist/permissions/pipeline.d.ts +2 -2
  407. package/dist/permissions/pipeline.js +2 -2
  408. package/dist/permissions/protected.d.ts +1 -1
  409. package/dist/permissions/protected.js +1 -1
  410. package/dist/permissions/readonly-bash.d.ts +1 -1
  411. package/dist/permissions/readonly-bash.js +1 -1
  412. package/dist/permissions/types.d.ts +2 -2
  413. package/dist/plan/done-markers.d.ts +1 -1
  414. package/dist/plan/done-markers.js +1 -1
  415. package/dist/plan/extract.d.ts +1 -1
  416. package/dist/plan/extract.js +1 -1
  417. package/dist/plan/prompts.d.ts +1 -1
  418. package/dist/plan/prompts.js +1 -1
  419. package/dist/plan/store.d.ts +1 -1
  420. package/dist/plan/store.js +1 -1
  421. package/dist/rpc.d.ts +3 -3
  422. package/dist/rpc.js +3 -3
  423. package/dist/sandbox/bash.d.ts +1 -1
  424. package/dist/sandbox/bash.js +1 -1
  425. package/dist/sandbox/detect.d.ts +1 -1
  426. package/dist/sandbox/detect.js +1 -1
  427. package/dist/sandbox/index.d.ts +1 -1
  428. package/dist/sandbox/index.js +1 -1
  429. package/dist/sandbox/profile.d.ts +1 -1
  430. package/dist/sandbox/profile.js +1 -1
  431. package/dist/sandbox/wrap.d.ts +1 -1
  432. package/dist/sandbox/wrap.js +1 -1
  433. package/dist/sdk.d.ts +3 -3
  434. package/dist/sdk.js +2 -2
  435. package/dist/session/line-reader.d.ts +1 -1
  436. package/dist/session/line-reader.js +1 -1
  437. package/dist/session/list.d.ts +1 -1
  438. package/dist/session/list.js +1 -1
  439. package/dist/session/migrate.d.ts +1 -1
  440. package/dist/session/migrate.js +1 -1
  441. package/dist/session/store.d.ts +1 -1
  442. package/dist/session/store.js +1 -1
  443. package/dist/skills/builtin.js +2 -2
  444. package/dist/tools/background-jobs.d.ts +1 -1
  445. package/dist/tools/background-jobs.js +1 -1
  446. package/dist/tools/clipboard-image.d.ts +1 -1
  447. package/dist/tools/clipboard-image.js +1 -1
  448. package/dist/tools/edit.d.ts +1 -1
  449. package/dist/tools/edit.js +1 -1
  450. package/dist/tools/grep.d.ts +1 -1
  451. package/dist/tools/grep.js +1 -1
  452. package/dist/tools/image-resize.d.ts +1 -1
  453. package/dist/tools/image-resize.js +1 -1
  454. package/dist/tools/read-lines.d.ts +1 -1
  455. package/dist/tools/read-lines.js +1 -1
  456. package/dist/tools/read.d.ts +1 -1
  457. package/dist/tools/read.js +1 -1
  458. package/dist/tools/task-ctl.d.ts +1 -1
  459. package/dist/tools/task-ctl.js +1 -1
  460. package/dist/tools/task.d.ts +2 -2
  461. package/dist/tools/task.js +2 -2
  462. package/dist/tools/types.d.ts +3 -3
  463. package/dist/tools/types.js +1 -1
  464. package/dist/trace/build.d.ts +1 -1
  465. package/dist/trace/build.js +1 -1
  466. package/dist/trace/detail.d.ts +1 -1
  467. package/dist/trace/detail.js +1 -1
  468. package/dist/trace/flatten.d.ts +1 -1
  469. package/dist/trace/flatten.js +1 -1
  470. package/dist/trace/format.d.ts +1 -1
  471. package/dist/trace/format.js +1 -1
  472. package/dist/trace/html-template.d.ts +1 -1
  473. package/dist/trace/html-template.js +1 -1
  474. package/dist/trace/html.d.ts +1 -1
  475. package/dist/trace/html.js +1 -1
  476. package/dist/trace/query-session.d.ts +1 -1
  477. package/dist/trace/query-session.js +1 -1
  478. package/dist/trace/query.d.ts +1 -1
  479. package/dist/trace/query.js +1 -1
  480. package/dist/trace/types.d.ts +1 -1
  481. package/dist/trace/types.js +1 -1
  482. package/dist/tui/components/settings-list.d.ts +1 -1
  483. package/dist/tui/components/settings-list.js +1 -1
  484. package/docs/README.md +85 -0
  485. package/docs/assets/ama-wordmark-dark.svg +37 -0
  486. package/docs/assets/ama-wordmark-light.svg +37 -0
  487. package/docs/en/README.md +39 -0
  488. package/docs/en/{permissions.md → guides/permissions.md} +14 -14
  489. package/docs/en/{providers.md → guides/providers.md} +6 -6
  490. package/docs/en/{sessions.md → guides/sessions.md} +6 -6
  491. package/docs/en/{tui.md → guides/tui.md} +15 -15
  492. package/docs/en/{acp.md → reference/acp.md} +6 -6
  493. package/docs/en/{host-api.md → reference/host-api.md} +7 -7
  494. package/docs/en/{rpc.md → reference/rpc.md} +13 -13
  495. package/docs/{agents.md → guides/agents.md} +13 -13
  496. package/docs/{codemode.md → guides/codemode.md} +3 -3
  497. package/docs/{hooks.md → guides/hooks.md} +2 -2
  498. package/docs/guides/i18n.md +93 -0
  499. package/docs/{memory.md → guides/memory.md} +1 -1
  500. package/docs/{permissions.md → guides/permissions.md} +2 -2
  501. package/docs/{plan.md → guides/plan.md} +4 -4
  502. package/docs/{providers.md → guides/providers.md} +4 -4
  503. package/docs/{sessions.md → guides/sessions.md} +5 -5
  504. package/docs/{tui.md → guides/tui.md} +8 -8
  505. package/docs/{acp.md → reference/acp.md} +5 -5
  506. package/docs/{host-api.md → reference/host-api.md} +4 -4
  507. package/docs/{rpc.md → reference/rpc.md} +11 -11
  508. package/docs/{session-format.md → reference/session-format.md} +7 -7
  509. package/package.json +12 -23
  510. package/docs/rewind-plan.md +0 -181
  511. package/docs/tui-design.md +0 -764
  512. /package/docs/{sandbox.md → guides/sandbox.md} +0 -0
@@ -12,7 +12,7 @@
12
12
  * - `defineTool()` 是恒等函数,只为推断 `I`;放在契约文件里供 SDK 再导出。
13
13
  * - `ToolRegistryApi` 是 Runtime 需要的最小接口,B3 的 `ToolRegistry` 实现它。
14
14
  * - (W3-C0)`SubagentResult.cache` 可选:子会话的命中率与重计费 token。
15
- * - (W5-C0)第五波(docs/wave5-plan.md §7.3–§7.6、§8.2 C4、§8.3 H1):`annotations.pollable /
15
+ * - (W5-C0)第五波(docs/history/wave5-plan.md §7.3–§7.6、§8.2 C4、§8.3 H1):`annotations.pollable /
16
16
  * keepInContext`;`SubagentRequest` 加 `agent / background / taskId / isolation / budgetUsd`;
17
17
  * `SubagentResult` 加 `taskId / status / outputFile / sessionRef`(契约要求向后兼容,全部可选);
18
18
  * 统一入口 `SubagentRunner / RunnerHandle / SubagentEvent`(ama 子会话、外部 CLI、宿主 runner);
@@ -158,7 +158,7 @@ export type SubagentEvent = {
158
158
  turn: number;
159
159
  }
160
160
  /**
161
- * [W6-C0] 外部 Agent 一个回合结束时的骨架(docs/wave6-plan.md §2.2):任务注册表写成父会话的
161
+ * [W6-C0] 外部 Agent 一个回合结束时的骨架(docs/history/wave6-plan.md §2.2):任务注册表写成父会话的
162
162
  * `ama.trace{kind:"external_turn"}`。只有种类、状态、时间与计数——不含工具标题、命令行、路径。
163
163
  */
164
164
  | {
@@ -281,7 +281,7 @@ export interface ToolContext {
281
281
  /** 活动分支上最近一条该类型 custom 条目的 data。 */
282
282
  lastCustom(customType: string): unknown;
283
283
  };
284
- /** 检查点(docs/rewind-plan.md §2):edit / write 写文件前后调用;未启用时为 undefined。 */
284
+ /** 检查点(docs/history/rewind-plan.md §2):edit / write 写文件前后调用;未启用时为 undefined。 */
285
285
  readonly checkpoint?: CheckpointHooks;
286
286
  /** 仅 depth 0 且 task 可用时存在。 */
287
287
  readonly spawnSubagent?: (request: SubagentRequest) => Promise<SubagentResult>;
@@ -12,7 +12,7 @@
12
12
  * - `defineTool()` 是恒等函数,只为推断 `I`;放在契约文件里供 SDK 再导出。
13
13
  * - `ToolRegistryApi` 是 Runtime 需要的最小接口,B3 的 `ToolRegistry` 实现它。
14
14
  * - (W3-C0)`SubagentResult.cache` 可选:子会话的命中率与重计费 token。
15
- * - (W5-C0)第五波(docs/wave5-plan.md §7.3–§7.6、§8.2 C4、§8.3 H1):`annotations.pollable /
15
+ * - (W5-C0)第五波(docs/history/wave5-plan.md §7.3–§7.6、§8.2 C4、§8.3 H1):`annotations.pollable /
16
16
  * keepInContext`;`SubagentRequest` 加 `agent / background / taskId / isolation / budgetUsd`;
17
17
  * `SubagentResult` 加 `taskId / status / outputFile / sessionRef`(契约要求向后兼容,全部可选);
18
18
  * 统一入口 `SubagentRunner / RunnerHandle / SubagentEvent`(ama 子会话、外部 CLI、宿主 runner);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 轨迹构建器(docs/wave6-plan.md §2.3、D6)。[W6-T1]
2
+ * 轨迹构建器(docs/history/wave6-plan.md §2.3、D6)。[W6-T1]
3
3
  *
4
4
  * `buildTrace(input, opts)` 把会话条目重建成 `Trace`(Turn → Step → Tool → Subcall / Subagent):
5
5
  * TUI `/trace`、`ama sessions trace`、RPC `get_trace` 三方共用同一棵树。
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 轨迹构建器(docs/wave6-plan.md §2.3、D6)。[W6-T1]
2
+ * 轨迹构建器(docs/history/wave6-plan.md §2.3、D6)。[W6-T1]
3
3
  *
4
4
  * `buildTrace(input, opts)` 把会话条目重建成 `Trace`(Turn → Step → Tool → Subcall / Subagent):
5
5
  * TUI `/trace`、`ama sessions trace`、RPC `get_trace` 三方共用同一棵树。
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 轨迹节点的正文预览与详情卡片(docs/wave6-plan.md §2.4:Enter 详情——概要 / 用量与缓存 / 参数与结果预览)。
2
+ * 轨迹节点的正文预览与详情卡片(docs/history/wave6-plan.md §2.4:Enter 详情——概要 / 用量与缓存 / 参数与结果预览)。
3
3
  * [W6-T1]
4
4
  *
5
5
  * 轨迹树不含正文;这里按节点的 `entryIds` 回会话条目取:回合 → 用户提示,请求 → 助手文字,工具 → 参数
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 轨迹节点的正文预览与详情卡片(docs/wave6-plan.md §2.4:Enter 详情——概要 / 用量与缓存 / 参数与结果预览)。
2
+ * 轨迹节点的正文预览与详情卡片(docs/history/wave6-plan.md §2.4:Enter 详情——概要 / 用量与缓存 / 参数与结果预览)。
3
3
  * [W6-T1]
4
4
  *
5
5
  * 轨迹树不含正文;这里按节点的 `entryIds` 回会话条目取:回合 → 用户提示,请求 → 助手文字,工具 → 参数
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 轨迹树扁平化(docs/wave6-plan.md §2.4)。[W6-T1]
2
+ * 轨迹树扁平化(docs/history/wave6-plan.md §2.4)。[W6-T1]
3
3
  *
4
4
  * 把 `Trace` 按展开状态摊成行数组(列表模型),TUI 只渲染可见窗口、line 模式整表输出。
5
5
  * - 行 key 是从根开始的路径(`t:<turnId>/s:<stepId>/x:<toolCallId>/a:<taskId>/…`),刷新后仍稳定,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 轨迹树扁平化(docs/wave6-plan.md §2.4)。[W6-T1]
2
+ * 轨迹树扁平化(docs/history/wave6-plan.md §2.4)。[W6-T1]
3
3
  *
4
4
  * 把 `Trace` 按展开状态摊成行数组(列表模型),TUI 只渲染可见窗口、line 模式整表输出。
5
5
  * - 行 key 是从根开始的路径(`t:<turnId>/s:<stepId>/x:<toolCallId>/a:<taskId>/…`),刷新后仍稳定,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 轨迹行的文本格式(docs/wave6-plan.md §2.4)。[W6-T1]
2
+ * 轨迹行的文本格式(docs/history/wave6-plan.md §2.4)。[W6-T1]
3
3
  *
4
4
  * 一行:`光标 缩进 折叠符 状态 标签 耗时 ▕████▒▒▒░░▏ ↑in ↓out 缓存%`
5
5
  * - 条形是所在回合的相对时间轴:`▒` = TTFT、`█` = 解码、`░` = 工具、`│` = 进行中节点的起点(不编造时长);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 轨迹行的文本格式(docs/wave6-plan.md §2.4)。[W6-T1]
2
+ * 轨迹行的文本格式(docs/history/wave6-plan.md §2.4)。[W6-T1]
3
3
  *
4
4
  * 一行:`光标 缩进 折叠符 状态 标签 耗时 ▕████▒▒▒░░▏ ↑in ↓out 缓存%`
5
5
  * - 条形是所在回合的相对时间轴:`▒` = TTFT、`█` = 解码、`░` = 工具、`│` = 进行中节点的起点(不编造时长);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 轨迹 HTML 的页面骨架、样式与脚本(docs/wave6-plan.md §2.5)。[W6-T2]
2
+ * 轨迹 HTML 的页面骨架、样式与脚本(docs/history/wave6-plan.md §2.5)。[W6-T2]
3
3
  *
4
4
  * 全部静态:页面只插入三样东西——`lang`、转义过的 `<title>`、已做脚本安全转义的 JSON(`html.ts`)。
5
5
  * 脚本只用 `textContent` / `createElement` 写 DOM,不用 `innerHTML`;没有任何外部资源(CSP 见 `CSP`)。
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 轨迹 HTML 的页面骨架、样式与脚本(docs/wave6-plan.md §2.5)。[W6-T2]
2
+ * 轨迹 HTML 的页面骨架、样式与脚本(docs/history/wave6-plan.md §2.5)。[W6-T2]
3
3
  *
4
4
  * 全部静态:页面只插入三样东西——`lang`、转义过的 `<title>`、已做脚本安全转义的 JSON(`html.ts`)。
5
5
  * 脚本只用 `textContent` / `createElement` 写 DOM,不用 `innerHTML`;没有任何外部资源(CSP 见 `CSP`)。
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 轨迹 HTML 导出:`ama sessions trace --html`(docs/wave6-plan.md §2.5、D7)。[W6-T2]
2
+ * 轨迹 HTML 导出:`ama sessions trace --html`(docs/history/wave6-plan.md §2.5、D7)。[W6-T2]
3
3
  *
4
4
  * 产物是**单文件、零依赖**的页面:样式与脚本内联(`html-template.ts`),数据放
5
5
  * `<script type="application/json">`,`<meta>` CSP 禁止一切外联。页面在浏览器里只用 `textContent` 写字,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 轨迹 HTML 导出:`ama sessions trace --html`(docs/wave6-plan.md §2.5、D7)。[W6-T2]
2
+ * 轨迹 HTML 导出:`ama sessions trace --html`(docs/history/wave6-plan.md §2.5、D7)。[W6-T2]
3
3
  *
4
4
  * 产物是**单文件、零依赖**的页面:样式与脚本内联(`html-template.ts`),数据放
5
5
  * `<script type="application/json">`,`<meta>` CSP 禁止一切外联。页面在浏览器里只用 `textContent` 写字,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 运行中会话的轨迹查询:RPC `get_trace` 与 SDK `session.trace()`(docs/wave6-plan.md §2.6、D29)。[W6-T2]
2
+ * 运行中会话的轨迹查询:RPC `get_trace` 与 SDK `session.trace()`(docs/history/wave6-plan.md §2.6、D29)。[W6-T2]
3
3
  *
4
4
  * 构建器输入取自会话(`traceInputOf`);运行中时叠一层 `{ running: true }`(没有结果的工具算 running 而不是
5
5
  * interrupted,不编造时长);子会话读取按会话缓存(mtime + 大小没变就不重读)。
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 运行中会话的轨迹查询:RPC `get_trace` 与 SDK `session.trace()`(docs/wave6-plan.md §2.6、D29)。[W6-T2]
2
+ * 运行中会话的轨迹查询:RPC `get_trace` 与 SDK `session.trace()`(docs/history/wave6-plan.md §2.6、D29)。[W6-T2]
3
3
  *
4
4
  * 构建器输入取自会话(`traceInputOf`);运行中时叠一层 `{ running: true }`(没有结果的工具算 running 而不是
5
5
  * interrupted,不编造时长);子会话读取按会话缓存(mtime + 大小没变就不重读)。
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 轨迹查询:RPC `get_trace`、SDK `session.trace()`、`ama sessions trace --json` 共用(docs/wave6-plan.md §2.6)。
2
+ * 轨迹查询:RPC `get_trace`、SDK `session.trace()`、`ama sessions trace --json` 共用(docs/history/wave6-plan.md §2.6)。
3
3
  * [W6-T2]
4
4
  *
5
5
  * - **窗口**:在 `Trace.turns` 上切。缺省尾部 `turnLimit`(50,上限 500)个回合;`before`(回合 id)向前翻页;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 轨迹查询:RPC `get_trace`、SDK `session.trace()`、`ama sessions trace --json` 共用(docs/wave6-plan.md §2.6)。
2
+ * 轨迹查询:RPC `get_trace`、SDK `session.trace()`、`ama sessions trace --json` 共用(docs/history/wave6-plan.md §2.6)。
3
3
  * [W6-T2]
4
4
  *
5
5
  * - **窗口**:在 `Trace.turns` 上切。缺省尾部 `turnLimit`(50,上限 500)个回合;`before`(回合 id)向前翻页;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 轨迹(docs/wave6-plan.md §2.1、§2.2、D5、D6)。[W6-C0] 纯类型,经 `@armadra/agent` 导出。
2
+ * 轨迹(docs/history/wave6-plan.md §2.1、§2.2、D5、D6)。[W6-C0] 纯类型,经 `@armadra/agent` 导出。
3
3
  *
4
4
  * 两部分:
5
5
  * - **持久化**:`custom{customType:"ama.trace"}` 条目的 `data`(`TraceEntryData`),由
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 轨迹(docs/wave6-plan.md §2.1、§2.2、D5、D6)。[W6-C0] 纯类型,经 `@armadra/agent` 导出。
2
+ * 轨迹(docs/history/wave6-plan.md §2.1、§2.2、D5、D6)。[W6-C0] 纯类型,经 `@armadra/agent` 导出。
3
3
  *
4
4
  * 两部分:
5
5
  * - **持久化**:`custom{customType:"ama.trace"}` 条目的 `data`(`TraceEntryData`),由
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Grouped settings list (docs/wave6-plan.md §6.3). [W6-S]
2
+ * Grouped settings list (docs/history/wave6-plan.md §6.3). [W6-S]
3
3
  *
4
4
  * Rows `› label value tag note` under muted group headers; the selected row uses the prompt glyph,
5
5
  * accent + bold and the `selection` background (same look as ChoiceDialog). A query filters rows by id,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Grouped settings list (docs/wave6-plan.md §6.3). [W6-S]
2
+ * Grouped settings list (docs/history/wave6-plan.md §6.3). [W6-S]
3
3
  *
4
4
  * Rows `› label value tag note` under muted group headers; the selected row uses the prompt glyph,
5
5
  * accent + bold and the `selection` background (same look as ChoiceDialog). A query filters rows by id,
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.