@armadra/agent 0.6.2 → 0.6.3

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 (130) hide show
  1. package/CHANGELOG.md +63 -0
  2. package/CHANGELOG.zh-CN.md +44 -0
  3. package/README.md +168 -575
  4. package/README.zh-CN.md +165 -596
  5. package/dist/agent/session.d.ts +6 -0
  6. package/dist/agent/session.js +8 -0
  7. package/dist/agent/subagent-background.d.ts +75 -0
  8. package/dist/agent/subagent-background.js +209 -0
  9. package/dist/agent/subagent-registry.d.ts +24 -5
  10. package/dist/agent/subagent-registry.js +64 -92
  11. package/dist/agent/types-w5.d.ts +11 -1
  12. package/dist/agent/types.d.ts +5 -0
  13. package/dist/agents/builtin.js +0 -1
  14. package/dist/agents/external.js +0 -1
  15. package/dist/agents/parse.js +4 -3
  16. package/dist/agents/result.d.ts +7 -1
  17. package/dist/agents/result.js +20 -1
  18. package/dist/agents/task-control.d.ts +13 -2
  19. package/dist/agents/task-record.d.ts +13 -1
  20. package/dist/agents/task-record.js +32 -0
  21. package/dist/agents/types.d.ts +5 -1
  22. package/dist/ai/providers/discovered-cache.d.ts +10 -4
  23. package/dist/ai/providers/discovered-cache.js +30 -14
  24. package/dist/auth/chatgpt/backend-client.d.ts +6 -5
  25. package/dist/auth/chatgpt/backend-client.js +8 -7
  26. package/dist/bundle/ama.cjs +1691 -500
  27. package/dist/cli/compose-agents.d.ts +2 -1
  28. package/dist/cli/compose-agents.js +11 -2
  29. package/dist/cli/subcommands/models-discover.d.ts +1 -0
  30. package/dist/cli/subcommands/models-discover.js +12 -2
  31. package/dist/config/json-schema.js +9 -2
  32. package/dist/config/key-docs.js +2 -2
  33. package/dist/config/merge.d.ts +1 -1
  34. package/dist/config/merge.js +20 -3
  35. package/dist/config/schema-w5.js +4 -2
  36. package/dist/config/schema.js +2 -0
  37. package/dist/config/settings-registry.js +4 -0
  38. package/dist/config/types-w5.d.ts +10 -0
  39. package/dist/config/types-w5.js +2 -0
  40. package/dist/config/types.d.ts +3 -1
  41. package/dist/git/info.d.ts +19 -0
  42. package/dist/git/info.js +64 -8
  43. package/dist/i18n/catalog.d.ts +45 -8
  44. package/dist/i18n/messages/agents.d.ts +56 -0
  45. package/dist/i18n/messages/agents.js +58 -2
  46. package/dist/i18n/messages/config-keys.d.ts +6 -0
  47. package/dist/i18n/messages/config-keys.js +16 -10
  48. package/dist/i18n/messages/config.d.ts +6 -0
  49. package/dist/i18n/messages/interactive-startup.d.ts +0 -16
  50. package/dist/i18n/messages/interactive-startup.js +0 -16
  51. package/dist/i18n/messages/interactive.d.ts +23 -16
  52. package/dist/i18n/messages/interactive.js +25 -0
  53. package/dist/i18n/messages/print.d.ts +4 -0
  54. package/dist/i18n/messages/print.js +4 -0
  55. package/dist/i18n/messages/report.js +4 -4
  56. package/dist/i18n/messages/settings.d.ts +6 -0
  57. package/dist/i18n/messages/settings.js +6 -0
  58. package/dist/i18n/messages/subcommands-config.d.ts +4 -0
  59. package/dist/i18n/messages/subcommands-config.js +4 -0
  60. package/dist/i18n/messages/subcommands.d.ts +4 -0
  61. package/dist/index.d.ts +1 -0
  62. package/dist/modes/commands-core.js +8 -4
  63. package/dist/modes/interactive/agent-bar.d.ts +3 -1
  64. package/dist/modes/interactive/agent-bar.js +12 -5
  65. package/dist/modes/interactive/agent-ui.d.ts +21 -3
  66. package/dist/modes/interactive/agent-ui.js +81 -12
  67. package/dist/modes/interactive/agent-view.d.ts +4 -0
  68. package/dist/modes/interactive/agent-view.js +14 -1
  69. package/dist/modes/interactive/approval-dock.d.ts +51 -0
  70. package/dist/modes/interactive/approval-dock.js +112 -0
  71. package/dist/modes/interactive/approval-ui.d.ts +43 -0
  72. package/dist/modes/interactive/approval-ui.js +64 -0
  73. package/dist/modes/interactive/commands.js +4 -1
  74. package/dist/modes/interactive/event-notices.d.ts +6 -1
  75. package/dist/modes/interactive/event-notices.js +7 -1
  76. package/dist/modes/interactive/interactive-mode.d.ts +4 -2
  77. package/dist/modes/interactive/interactive-mode.js +33 -38
  78. package/dist/modes/interactive/key-dispatch.d.ts +21 -4
  79. package/dist/modes/interactive/key-dispatch.js +60 -8
  80. package/dist/modes/interactive/line/line-mode.js +5 -0
  81. package/dist/modes/interactive/run-indicator.d.ts +15 -0
  82. package/dist/modes/interactive/run-indicator.js +37 -5
  83. package/dist/modes/interactive/session-events.js +5 -1
  84. package/dist/modes/interactive/startup-header.d.ts +29 -14
  85. package/dist/modes/interactive/startup-header.js +93 -59
  86. package/dist/modes/interactive/startup-logo.d.ts +83 -0
  87. package/dist/modes/interactive/startup-logo.js +183 -0
  88. package/dist/modes/interactive/status-area.d.ts +18 -0
  89. package/dist/modes/interactive/status-area.js +67 -1
  90. package/dist/modes/interactive/status-bar.d.ts +9 -1
  91. package/dist/modes/interactive/status-bar.js +43 -11
  92. package/dist/modes/interactive/status-line.d.ts +2 -0
  93. package/dist/modes/interactive/status-line.js +11 -6
  94. package/dist/modes/interactive/status-quota.d.ts +44 -0
  95. package/dist/modes/interactive/status-quota.js +135 -0
  96. package/dist/modes/interactive/subagent-view.d.ts +1 -0
  97. package/dist/modes/interactive/subagent-view.js +8 -0
  98. package/dist/modes/interactive/task-background.d.ts +31 -0
  99. package/dist/modes/interactive/task-background.js +68 -0
  100. package/dist/modes/interactive/tool-view.d.ts +7 -1
  101. package/dist/modes/interactive/tool-view.js +24 -1
  102. package/dist/modes/print/print-mode.d.ts +11 -0
  103. package/dist/modes/print/print-mode.js +36 -1
  104. package/dist/modes/rpc/commands.d.ts +2 -1
  105. package/dist/modes/rpc/commands.js +9 -1
  106. package/dist/rpc.d.ts +13 -0
  107. package/dist/rpc.js +3 -0
  108. package/dist/tools/task-ctl.d.ts +2 -0
  109. package/dist/tools/task-ctl.js +7 -2
  110. package/dist/tools/task.d.ts +11 -0
  111. package/dist/tools/task.js +20 -2
  112. package/dist/tui/components/editor.d.ts +2 -0
  113. package/dist/tui/components/editor.js +4 -0
  114. package/dist/tui/components/loader.d.ts +5 -1
  115. package/dist/tui/components/loader.js +18 -5
  116. package/dist/tui/keybindings.d.ts +8 -3
  117. package/dist/tui/keybindings.js +8 -3
  118. package/docs/agents.md +52 -28
  119. package/docs/en/host-api.md +5 -1
  120. package/docs/en/providers.md +1 -1
  121. package/docs/en/rpc.md +19 -7
  122. package/docs/en/sessions.md +3 -1
  123. package/docs/en/tui.md +84 -66
  124. package/docs/host-api.md +5 -1
  125. package/docs/providers.md +4 -2
  126. package/docs/rpc.md +19 -7
  127. package/docs/sessions.md +2 -1
  128. package/docs/tui-design.md +42 -29
  129. package/docs/tui.md +67 -49
  130. package/package.json +1 -1
@@ -5,6 +5,8 @@
5
5
  * 整句一个键、禁止片段拼接;插值写成函数,条件分支写进函数体。
6
6
  *
7
7
  * W6-A:Agent 栏(状态、轮数、溢出行、按键提示)与子 Agent 视图(标题、占位、发送结果、外部 Agent 的说明)。
8
+ * W7-A:进栏键落空提示、运行提示行的进栏附加项。
9
+ * W7-C:转后台(Ctrl+B / 栏内 b / `/tasks bg`)、栏内 x 双击停止、停靠审批的提示、Esc 不影响后台任务。
8
10
  */
9
11
  export declare const en: {
10
12
  status: {
@@ -21,7 +23,37 @@ export declare const en: {
21
23
  bar: {
22
24
  more: (n: number) => string;
23
25
  keys: (up: string, down: string) => string;
26
+ /** [W7-C] 聚焦时的完整按键行(窄屏退回 `keys`)。 */
27
+ keysFull: (up: string, down: string) => string;
24
28
  empty: string;
29
+ /** [W7-A] 运行提示行的附加项(有子 Agent 任务时)。 */
30
+ runHint: (down: string) => string;
31
+ };
32
+ /** [W7-A] 进栏键落空时的一行提示。 */
33
+ focus: {
34
+ busyInput: (down: string) => string;
35
+ disabled: string;
36
+ };
37
+ /** [W7-C] 前台任务转后台。 */
38
+ background: {
39
+ done: (ids: string) => string;
40
+ none: string;
41
+ notForeground: (taskId: string) => string;
42
+ runHint: (key: string) => string;
43
+ timeout: (taskId: string, agent: string) => string;
44
+ host: (taskId: string, agent: string) => string;
45
+ moved: (elapsed: string) => string;
46
+ started: string;
47
+ interrupted: (ids: string) => string;
48
+ };
49
+ /** [W7-C] 栏内 x 停止(双击确认)。 */
50
+ stop: {
51
+ confirm: (taskId: string) => string;
52
+ ended: (taskId: string) => string;
53
+ };
54
+ /** [W7-C] 后台任务的审批停靠在栏里。 */
55
+ approval: {
56
+ runHint: (down: string) => string;
25
57
  };
26
58
  view: {
27
59
  back: string;
@@ -59,7 +91,31 @@ export declare const zh: {
59
91
  bar: {
60
92
  more: (n: number) => string;
61
93
  keys: (up: string, down: string) => string;
94
+ keysFull: (up: string, down: string) => string;
62
95
  empty: string;
96
+ runHint: (down: string) => string;
97
+ };
98
+ focus: {
99
+ busyInput: (down: string) => string;
100
+ disabled: string;
101
+ };
102
+ background: {
103
+ done: (ids: string) => string;
104
+ none: string;
105
+ notForeground: (taskId: string) => string;
106
+ runHint: (key: string) => string;
107
+ timeout: (taskId: string, agent: string) => string;
108
+ host: (taskId: string, agent: string) => string;
109
+ moved: (elapsed: string) => string;
110
+ started: string;
111
+ interrupted: (ids: string) => string;
112
+ };
113
+ stop: {
114
+ confirm: (taskId: string) => string;
115
+ ended: (taskId: string) => string;
116
+ };
117
+ approval: {
118
+ runHint: (down: string) => string;
63
119
  };
64
120
  view: {
65
121
  back: string;
@@ -5,6 +5,8 @@
5
5
  * 整句一个键、禁止片段拼接;插值写成函数,条件分支写进函数体。
6
6
  *
7
7
  * W6-A:Agent 栏(状态、轮数、溢出行、按键提示)与子 Agent 视图(标题、占位、发送结果、外部 Agent 的说明)。
8
+ * W7-A:进栏键落空提示、运行提示行的进栏附加项。
9
+ * W7-C:转后台(Ctrl+B / 栏内 b / `/tasks bg`)、栏内 x 双击停止、停靠审批的提示、Esc 不影响后台任务。
8
10
  */
9
11
  import { plural } from "../format.js";
10
12
  export const en = {
@@ -22,7 +24,37 @@ export const en = {
22
24
  bar: {
23
25
  more: (n) => `${n} more`,
24
26
  keys: (up, down) => `${up}${down} select · Enter open · Esc back`,
27
+ /** [W7-C] 聚焦时的完整按键行(窄屏退回 `keys`)。 */
28
+ keysFull: (up, down) => `${up}${down} select · Enter open · b background · x stop · Esc back`,
25
29
  empty: "No sub-agent tasks yet",
30
+ /** [W7-A] 运行提示行的附加项(有子 Agent 任务时)。 */
31
+ runHint: (down) => `${down} Agent bar`,
32
+ },
33
+ /** [W7-A] 进栏键落空时的一行提示。 */
34
+ focus: {
35
+ busyInput: (down) => `Input is not empty; clear it and press ${down} for the Agent bar`,
36
+ disabled: "Agent bar is off (ui.agentBar); use /tasks",
37
+ },
38
+ /** [W7-C] 前台任务转后台。 */
39
+ background: {
40
+ done: (ids) => `Moved to the background: ${ids}; you'll be notified when it finishes`,
41
+ none: "No foreground task to move to the background",
42
+ notForeground: (taskId) => `${taskId} is not a running foreground task`,
43
+ runHint: (key) => `${key} to background`,
44
+ timeout: (taskId, agent) => `${taskId} ${agent} ran long and moved to the background (subagents.autoBackgroundAfterMs)`,
45
+ host: (taskId, agent) => `${taskId} ${agent} was moved to the background by the host`,
46
+ moved: (elapsed) => `moved to the background · ${elapsed}`,
47
+ started: "started in the background",
48
+ interrupted: (ids) => `Interrupted (background task ${ids} keeps running; Esc doesn't affect it)`,
49
+ },
50
+ /** [W7-C] 栏内 x 停止(双击确认)。 */
51
+ stop: {
52
+ confirm: (taskId) => `Press x again to stop ${taskId}`,
53
+ ended: (taskId) => `${taskId} has already finished`,
54
+ },
55
+ /** [W7-C] 后台任务的审批停靠在栏里。 */
56
+ approval: {
57
+ runHint: (down) => `${down} handle approval`,
26
58
  },
27
59
  view: {
28
60
  back: "Esc back",
@@ -34,7 +66,7 @@ export const en = {
34
66
  resumed: (taskId) => `Sent to ${taskId}; it continues in the background`,
35
67
  sendFailed: (message) => `Could not send: ${message}`,
36
68
  stopped: (taskId) => `Stopped ${taskId}`,
37
- commandsHere: "Only /tasks stop works here; press Esc to go back for other commands",
69
+ commandsHere: "Only /tasks stop and /tasks bg work here; press Esc to go back for other commands",
38
70
  removed: (taskId) => `Task ${taskId} is gone`,
39
71
  unknown: (taskId) => `No task ${taskId}`,
40
72
  turn: (n) => `turn ${n}`,
@@ -60,7 +92,31 @@ export const zh = {
60
92
  bar: {
61
93
  more: (n) => `另 ${n} 个`,
62
94
  keys: (up, down) => `${up}${down} 选择 · Enter 打开 · Esc 返回`,
95
+ keysFull: (up, down) => `${up}${down} 选择 · Enter 打开 · b 转后台 · x 停止 · Esc 返回`,
63
96
  empty: "还没有子 Agent 任务",
97
+ runHint: (down) => `${down} Agent 栏`,
98
+ },
99
+ focus: {
100
+ busyInput: (down) => `输入框有字;清空后再按 ${down} 进 Agent 栏`,
101
+ disabled: "Agent 栏已关闭(ui.agentBar),用 /tasks",
102
+ },
103
+ background: {
104
+ done: (ids) => `已转后台:${ids},完成后会通知`,
105
+ none: "没有可转后台的前台任务",
106
+ notForeground: (taskId) => `${taskId} 不是运行中的前台任务`,
107
+ runHint: (key) => `${key} 转后台`,
108
+ timeout: (taskId, agent) => `${taskId} ${agent} 运行较久,已自动转后台(subagents.autoBackgroundAfterMs)`,
109
+ host: (taskId, agent) => `${taskId} ${agent} 已由宿主转后台`,
110
+ moved: (elapsed) => `已转后台 · ${elapsed}`,
111
+ started: "已在后台启动",
112
+ interrupted: (ids) => `已中断(后台任务 ${ids} 仍在运行,Esc 不影响)`,
113
+ },
114
+ stop: {
115
+ confirm: (taskId) => `再按 x 停止 ${taskId}`,
116
+ ended: (taskId) => `${taskId} 已结束`,
117
+ },
118
+ approval: {
119
+ runHint: (down) => `${down} 处理审批`,
64
120
  },
65
121
  view: {
66
122
  back: "Esc 返回",
@@ -72,7 +128,7 @@ export const zh = {
72
128
  resumed: (taskId) => `已发给 ${taskId},在后台继续`,
73
129
  sendFailed: (message) => `发送失败:${message}`,
74
130
  stopped: (taskId) => `已停止 ${taskId}`,
75
- commandsHere: "这里只能用 /tasks stop;其它命令按 Esc 返回后输入",
131
+ commandsHere: "这里只能用 /tasks stop 与 /tasks bg;其它命令按 Esc 返回后输入",
76
132
  removed: (taskId) => `任务 ${taskId} 已不存在`,
77
133
  unknown: (taskId) => `没有任务 ${taskId}`,
78
134
  turn: (n) => `第 ${n} 轮`,
@@ -52,6 +52,7 @@ export declare const en: {
52
52
  "ui.quietStartup": string;
53
53
  "ui.ascii": string;
54
54
  "ui.compact": string;
55
+ "ui.logo": string;
55
56
  "ui.animation": string;
56
57
  "ui.restoreOnCancel": string;
57
58
  "ui.statusLine": string;
@@ -108,6 +109,8 @@ export declare const en: {
108
109
  "subagents.maxConcurrent": string;
109
110
  "subagents.maxPending": string;
110
111
  "subagents.defaultModel": string;
112
+ "subagents.background": string;
113
+ "subagents.autoBackgroundAfterMs": string;
111
114
  models: string;
112
115
  "models.aliases": string;
113
116
  "models.aliases.fast": string;
@@ -196,6 +199,7 @@ export declare const zh: {
196
199
  "ui.quietStartup": string;
197
200
  "ui.ascii": string;
198
201
  "ui.compact": string;
202
+ "ui.logo": string;
199
203
  "ui.animation": string;
200
204
  "ui.restoreOnCancel": string;
201
205
  "ui.statusLine": string;
@@ -252,6 +256,8 @@ export declare const zh: {
252
256
  "subagents.maxConcurrent": string;
253
257
  "subagents.maxPending": string;
254
258
  "subagents.defaultModel": string;
259
+ "subagents.background": string;
260
+ "subagents.autoBackgroundAfterMs": string;
255
261
  models: string;
256
262
  "models.aliases": string;
257
263
  "models.aliases.fast": string;
@@ -25,7 +25,7 @@ const dynamicDefaultsEn = {
25
25
  "limits.maxTurns": "unset: unlimited",
26
26
  "limits.maxCostUsd": "unset: unlimited",
27
27
  "ui.replyLanguage": "unset: no reply-language rule is appended (zero-byte change)",
28
- "ui.agentBar": "auto in a standalone terminal, off in an embedding host (with a profile)",
28
+ "ui.agentBar": "auto (embedding hosts turn it off in their profile)",
29
29
  "auth.chatgpt.clientId": "siwc registers dynamically on first login; codex uses the public client id (AMA_CHATGPT_CLIENT_ID overrides)",
30
30
  "auth.chatgpt.redirectPorts": "siwc 1455 → any free port; codex 1455 → 1457",
31
31
  };
@@ -48,7 +48,7 @@ const dynamicDefaultsZh = {
48
48
  "limits.maxTurns": "不设:不限",
49
49
  "limits.maxCostUsd": "不设:不限",
50
50
  "ui.replyLanguage": "不设:不追加回复语言规则(零字节变化)",
51
- "ui.agentBar": "独立终端 auto,嵌入宿主(有 profile)off",
51
+ "ui.agentBar": "auto(嵌入宿主要关在自己的 profile 写 off)",
52
52
  "auth.chatgpt.clientId": "siwc 首次登录动态注册;codex 用公开客户端 id(AMA_CHATGPT_CLIENT_ID 覆盖)",
53
53
  "auth.chatgpt.redirectPorts": "siwc 1455 → 任意空闲端口;codex 1455 → 1457",
54
54
  };
@@ -98,13 +98,14 @@ const keysEn = {
98
98
  "ui.tuiMode": "Terminal interface layout (only regular for now)",
99
99
  "ui.quietStartup": "How much the startup screen shows",
100
100
  "ui.ascii": "ASCII glyphs (> * L, + - |); when unset it is detected: on when the locale lacks UTF-8, TERM=linux or a legacy conhost; AMA_ASCII=1/0 overrides",
101
- "ui.compact": "No blank lines between message blocks and no box around the startup header",
102
- "ui.animation": "false: the spinner stays still while running and redraws only when seconds change",
101
+ "ui.compact": "No blank lines between message blocks and no AMA logo in the startup header",
102
+ "ui.logo": "AMA logo in the startup header: auto draws it when the terminal is at least 48 columns wide, off shows only the info lines",
103
+ "ui.animation": "false: the spinner stays still while running and redraws only when seconds change; the startup logo does not animate",
103
104
  "ui.restoreOnCancel": "When Esc interrupts a run before any reply or tool call in this turn, withdraw the turn and put the message back into the input box",
104
105
  "ui.statusLine": "Bottom info line: full shows two lines (rate line + status line), compact one; toggle at runtime with Ctrl+G or /statusline (effective from wave 5 W5-A)",
105
106
  "ui.language": "Interface language: auto decides from LC_ALL / LC_MESSAGES / LANG (zh* is Chinese, anything else English), zh, en; AMA_LANG and --lang override; affects the interface only, text sent to the model is always English",
106
107
  "ui.replyLanguage": "Reply language for the model (e.g. Chinese): one English rule is appended to the end of the rules section at session start; zero-byte change when unset; user level only (effective from wave 6)",
107
- "ui.agentBar": "Agent bar (sub-agent list above the status line): auto shows it while tasks exist, off hides it; enter with Ctrl+B or ↓ on an empty input (effective from wave 6 W6-A)",
108
+ "ui.agentBar": "Agent bar (sub-agent list above the status line): auto shows it while tasks exist, off hides it; press ↓ on an empty input to enter it",
108
109
  memory: "Cross-session memory (docs/memory.md): off by default, requests are byte-identical while off; project level can only set enabled: false (effective from wave 6 W6-M)",
109
110
  "memory.enabled": "Master switch; --memory / --no-memory and AMA_MEMORY=0|1 override",
110
111
  "memory.scopes": "Enabled scopes: user (data directory, across projects), project (keyed by a hash of the repository path)",
@@ -151,10 +152,12 @@ const keysEn = {
151
152
  "agents.maxConcurrent": "Total concurrency of external agents",
152
153
  "agents.sessionBudgetUsd": "USD budget for external agents in this session",
153
154
  "agents.dirs": "Extra sub-agent definition directories (*.md); accumulated across levels",
154
- subagents: "ama's own task sub-sessions; user level only (effective from wave 5 W5-G)",
155
+ subagents: "ama's own task sub-sessions; user level only except background / autoBackgroundAfterMs (effective from wave 5 W5-G)",
155
156
  "subagents.maxConcurrent": "Sub-sessions running at the same time",
156
157
  "subagents.maxPending": "Queue limit; task fails beyond it",
157
158
  "subagents.defaultModel": "Default sub-session model provider/model[@channel]",
159
+ "subagents.background": "Whether task runs in the background by default: auto = background in the TUI / RPC / ACP and foreground with -p; always / never are fixed. The call argument and the agent type's background: override it; user, project and host level",
160
+ "subagents.autoBackgroundAfterMs": "Move a foreground task to the background after it has run this many milliseconds; 0 disables; user and project level",
158
161
  models: "Model aliases and the model picker list; user level only (effective from wave 5 W5-G)",
159
162
  "models.aliases": "Models that model: fast / strong in sub-agent definitions point to",
160
163
  "models.aliases.fast": "Model for the fast alias provider/model[@channel]",
@@ -217,13 +220,14 @@ const keysZh = {
217
220
  "ui.tuiMode": "终端界面形态(目前只有 regular)",
218
221
  "ui.quietStartup": "启动画面详略",
219
222
  "ui.ascii": "ASCII 字形(> * L、+ - |);不写时自动检测:区域设置不含 UTF-8、TERM=linux、旧 conhost 时开启;AMA_ASCII=1/0 覆盖",
220
- "ui.compact": "消息区块间不空行、启动头不画框",
221
- "ui.animation": "false:运行中 spinner 静止,只在秒数变化时重绘",
223
+ "ui.compact": "消息区块间不空行、启动头不画 AMA 字符画",
224
+ "ui.logo": "启动头的 AMA 字符画:auto 在终端宽 48 列以上时画,off 只显示信息行",
225
+ "ui.animation": "false:运行中 spinner 静止,只在秒数变化时重绘;启动字符画不播放动画",
222
226
  "ui.restoreOnCancel": "运行中 Esc 中断、本回合还没有任何回复或工具调用时,撤回该回合并把原消息放回输入框",
223
227
  "ui.statusLine": "底部信息行:full 两行(速率行 + 状态行),compact 一行;运行时 Ctrl+G 或 /statusline 切换(第五波 W5-A 起生效)",
224
228
  "ui.language": "界面语言:auto 按 LC_ALL / LC_MESSAGES / LANG 判断(zh* 为中文,其余英文),zh,en;AMA_LANG、--lang 覆盖;只影响界面,发给模型的文本固定英文",
225
229
  "ui.replyLanguage": "模型回复语言(如 Chinese):会话开始在 rules 节末尾追加一句英文规则;不设时零字节变化;只认用户级(第六波起生效)",
226
- "ui.agentBar": "Agent 栏(状态行上方的子 Agent 列表):auto 有任务时显示,off 不显示;Ctrl+B / 空输入时 ↓ 进入(第六波 W6-A 起生效)",
230
+ "ui.agentBar": "Agent 栏(状态行上方的子 Agent 列表):auto 有任务时显示,off 不显示;空输入时按 ↓ 进入",
227
231
  memory: "跨会话记忆(docs/memory.md):缺省关闭,关闭时请求逐字节不变;项目级只能设 enabled: false(第六波 W6-M 起生效)",
228
232
  "memory.enabled": "总开关;--memory / --no-memory、AMA_MEMORY=0|1 覆盖",
229
233
  "memory.scopes": "启用的作用域:user(数据目录,跨项目)、project(按仓库路径哈希)",
@@ -270,10 +274,12 @@ const keysZh = {
270
274
  "agents.maxConcurrent": "外部 Agent 的总并发",
271
275
  "agents.sessionBudgetUsd": "本会话外部 Agent 的美元预算",
272
276
  "agents.dirs": "追加的子 Agent 定义目录(*.md);各层累加",
273
- subagents: "ama 自己的 task 子会话;只认用户级(第五波 W5-G 起生效)",
277
+ subagents: "ama 自己的 task 子会话;除 background / autoBackgroundAfterMs 外只认用户级(第五波 W5-G 起生效)",
274
278
  "subagents.maxConcurrent": "同时运行的子会话数",
275
279
  "subagents.maxPending": "排队上限,超出时 task 报错",
276
280
  "subagents.defaultModel": "子会话缺省模型 provider/model[@channel]",
281
+ "subagents.background": "task 缺省是否后台:auto = TUI / RPC / ACP 下后台、-p 下前台;always / never 固定。调用参数与类型定义的 background: 优先;用户、项目、宿主级都认",
282
+ "subagents.autoBackgroundAfterMs": "前台任务运行超过该毫秒数自动转后台;0 关闭;用户、项目级都认",
277
283
  models: "模型别名与模型选择器清单;只认用户级(第五波 W5-G 起生效)",
278
284
  "models.aliases": "子 Agent 定义里 model: fast / strong 指向的模型",
279
285
  "models.aliases.fast": "fast 别名的模型 provider/model[@channel]",
@@ -52,6 +52,7 @@ export declare const en: {
52
52
  "ui.quietStartup": string;
53
53
  "ui.ascii": string;
54
54
  "ui.compact": string;
55
+ "ui.logo": string;
55
56
  "ui.animation": string;
56
57
  "ui.restoreOnCancel": string;
57
58
  "ui.statusLine": string;
@@ -108,6 +109,8 @@ export declare const en: {
108
109
  "subagents.maxConcurrent": string;
109
110
  "subagents.maxPending": string;
110
111
  "subagents.defaultModel": string;
112
+ "subagents.background": string;
113
+ "subagents.autoBackgroundAfterMs": string;
111
114
  models: string;
112
115
  "models.aliases": string;
113
116
  "models.aliases.fast": string;
@@ -308,6 +311,7 @@ export declare const zh: {
308
311
  "ui.quietStartup": string;
309
312
  "ui.ascii": string;
310
313
  "ui.compact": string;
314
+ "ui.logo": string;
311
315
  "ui.animation": string;
312
316
  "ui.restoreOnCancel": string;
313
317
  "ui.statusLine": string;
@@ -364,6 +368,8 @@ export declare const zh: {
364
368
  "subagents.maxConcurrent": string;
365
369
  "subagents.maxPending": string;
366
370
  "subagents.defaultModel": string;
371
+ "subagents.background": string;
372
+ "subagents.autoBackgroundAfterMs": string;
367
373
  models: string;
368
374
  "models.aliases": string;
369
375
  "models.aliases.fast": string;
@@ -13,16 +13,8 @@ export declare const en: {
13
13
  templates: (n: number) => string;
14
14
  host: (host: string) => string;
15
15
  warnings: (n: number) => string;
16
- hintCompact: string;
17
- keyModel: string;
18
- keyDir: string;
19
- keyMode: string;
20
- keyLoaded: string;
21
- keyHost: string;
22
- keyWarnings: string;
23
16
  thinking: (level: string) => string;
24
17
  preset: (preset: string) => string;
25
- warningsValue: (n: number) => string;
26
18
  hint: string;
27
19
  };
28
20
  ui: {
@@ -59,16 +51,8 @@ export declare const zh: {
59
51
  templates: (n: number) => string;
60
52
  host: (host: string) => string;
61
53
  warnings: (n: number) => string;
62
- hintCompact: string;
63
- keyModel: string;
64
- keyDir: string;
65
- keyMode: string;
66
- keyLoaded: string;
67
- keyHost: string;
68
- keyWarnings: string;
69
54
  thinking: (level: string) => string;
70
55
  preset: (preset: string) => string;
71
- warningsValue: (n: number) => string;
72
56
  hint: string;
73
57
  };
74
58
  ui: {
@@ -14,16 +14,8 @@ export const en = {
14
14
  templates: (n) => plural(n, "template"),
15
15
  host: (host) => `host ${host}`,
16
16
  warnings: (n) => `${plural(n, "warning")} (ama doctor)`,
17
- hintCompact: "/help · Shift+Tab mode",
18
- keyModel: "Model",
19
- keyDir: "Folder",
20
- keyMode: "Mode",
21
- keyLoaded: "Loaded",
22
- keyHost: "Host",
23
- keyWarnings: "Warnings",
24
17
  thinking: (level) => `thinking ${level}`,
25
18
  preset: (preset) => `preset ${preset}`,
26
- warningsValue: (n) => `${n} (see ama doctor)`,
27
19
  hint: "/help commands · Shift+Tab mode · Ctrl+O expand tool output",
28
20
  },
29
21
  ui: {
@@ -60,16 +52,8 @@ export const zh = {
60
52
  templates: (n) => `${n} 模板`,
61
53
  host: (host) => `宿主 ${host}`,
62
54
  warnings: (n) => `警告 ${n} 条(ama doctor)`,
63
- hintCompact: "/help · Shift+Tab 切模式",
64
- keyModel: "模型",
65
- keyDir: "目录",
66
- keyMode: "模式",
67
- keyLoaded: "已加载",
68
- keyHost: "宿主",
69
- keyWarnings: "警告",
70
55
  thinking: (level) => `思考 ${level}`,
71
56
  preset: (preset) => `预设 ${preset}`,
72
- warningsValue: (n) => `${n} 条(ama doctor 查看)`,
73
57
  hint: "/help 命令 · Shift+Tab 切模式 · Ctrl+O 展开工具输出",
74
58
  },
75
59
  ui: {
@@ -91,6 +91,18 @@ export declare const en: {
91
91
  cacheSilent: string;
92
92
  sandbox: string;
93
93
  cycleHint: string;
94
+ /** [W6] 订阅配额行(full 第三行)与窄屏 / compact 短格式;标签自带分隔(英文冒号后空格)。 */
95
+ quota: {
96
+ session: string;
97
+ reset: string;
98
+ weekly: string;
99
+ weeklyReset: string;
100
+ window: (duration: string) => string;
101
+ windowReset: (duration: string) => string;
102
+ short5h: string;
103
+ shortWeek: string;
104
+ pending: string;
105
+ };
94
106
  };
95
107
  subagent: {
96
108
  running: (elapsed: string) => string;
@@ -189,16 +201,8 @@ export declare const en: {
189
201
  templates: (n: number) => string;
190
202
  host: (host: string) => string;
191
203
  warnings: (n: number) => string;
192
- hintCompact: string;
193
- keyModel: string;
194
- keyDir: string;
195
- keyMode: string;
196
- keyLoaded: string;
197
- keyHost: string;
198
- keyWarnings: string;
199
204
  thinking: (level: string) => string;
200
205
  preset: (preset: string) => string;
201
- warningsValue: (n: number) => string;
202
206
  hint: string;
203
207
  };
204
208
  ui: {
@@ -328,6 +332,17 @@ export declare const zh: {
328
332
  cacheSilent: string;
329
333
  sandbox: string;
330
334
  cycleHint: string;
335
+ quota: {
336
+ session: string;
337
+ reset: string;
338
+ weekly: string;
339
+ weeklyReset: string;
340
+ window: (duration: string) => string;
341
+ windowReset: (duration: string) => string;
342
+ short5h: string;
343
+ shortWeek: string;
344
+ pending: string;
345
+ };
331
346
  };
332
347
  subagent: {
333
348
  running: (elapsed: string) => string;
@@ -426,16 +441,8 @@ export declare const zh: {
426
441
  templates: (n: number) => string;
427
442
  host: (host: string) => string;
428
443
  warnings: (n: number) => string;
429
- hintCompact: string;
430
- keyModel: string;
431
- keyDir: string;
432
- keyMode: string;
433
- keyLoaded: string;
434
- keyHost: string;
435
- keyWarnings: string;
436
444
  thinking: (level: string) => string;
437
445
  preset: (preset: string) => string;
438
- warningsValue: (n: number) => string;
439
446
  hint: string;
440
447
  };
441
448
  ui: {
@@ -24,6 +24,7 @@ export const en = {
24
24
  "Shift+Tab / Tab (empty input) cycle permission mode (confirm before Bypass) Ctrl+L model Ctrl+T thinking level Ctrl+O expand tool output and thinking",
25
25
  "Approval: 1–3 or ↑↓ Enter to choose, y allow a allow for this session n / Esc deny v full input",
26
26
  "Plan approval: 1 approve 2 run in a fresh context 3 keep revising 4 reject and leave Plan e edit plan Esc stay in Plan",
27
+ "Ctrl+B move foreground sub-agent tasks to the background (in tmux: C-b C-b) ↓ (empty input) Agent bar: b background x twice to stop Enter open",
27
28
  "Ctrl+V paste a clipboard image (inserts @path) Ctrl+G footer two rows / one row",
28
29
  "Ctrl+C clear input (again to quit) Ctrl+D quit on empty input Tab complete @ reference a file",
29
30
  ].join("\n"),
@@ -103,6 +104,18 @@ export const en = {
103
104
  cacheSilent: "n/a",
104
105
  sandbox: "sandbox",
105
106
  cycleHint: "shift+tab to cycle",
107
+ /** [W6] 订阅配额行(full 第三行)与窄屏 / compact 短格式;标签自带分隔(英文冒号后空格)。 */
108
+ quota: {
109
+ session: "Session: ",
110
+ reset: "Reset: ",
111
+ weekly: "Weekly: ",
112
+ weeklyReset: "Weekly Reset: ",
113
+ window: (duration) => `${duration}: `,
114
+ windowReset: (duration) => `${duration} Reset: `,
115
+ short5h: "5h",
116
+ shortWeek: "wk",
117
+ pending: "Quota: shown after the first request",
118
+ },
106
119
  },
107
120
  subagent: {
108
121
  running: (elapsed) => `running ${elapsed}`,
@@ -143,6 +156,7 @@ export const zh = {
143
156
  "Shift+Tab / Tab(输入为空时)切换权限模式(进入 Bypass 前确认) Ctrl+L 模型 Ctrl+T 思考级别 Ctrl+O 展开工具输出与思考",
144
157
  "审批:1–3 或 ↑↓ Enter 选择,y 允许 a 本会话允许同类 n / Esc 拒绝 v 完整输入",
145
158
  "计划审批:1 批准 2 新上下文执行 3 继续修改 4 放弃并退出 Plan e 编辑计划 Esc 留在 Plan",
159
+ "Ctrl+B 前台子 Agent 任务转后台(tmux 里 C-b C-b) ↓(空输入)Agent 栏:b 转后台 x 连按两次停止 Enter 打开",
146
160
  "Ctrl+V 粘贴剪贴板图片(插入 @路径) Ctrl+G 底部信息行两行 / 一行",
147
161
  "Ctrl+C 清空输入(再按退出) Ctrl+D 空输入时退出 Tab 补全 @ 引用文件",
148
162
  ].join("\n"),
@@ -218,6 +232,17 @@ export const zh = {
218
232
  cacheSilent: "未报告",
219
233
  sandbox: "沙箱",
220
234
  cycleHint: "shift+tab 切换",
235
+ quota: {
236
+ session: "5 小时:",
237
+ reset: "重置:",
238
+ weekly: "本周:",
239
+ weeklyReset: "本周重置:",
240
+ window: (duration) => `${duration}:`,
241
+ windowReset: (duration) => `${duration}重置:`,
242
+ short5h: "5h",
243
+ shortWeek: "周",
244
+ pending: "配额:首次请求后显示",
245
+ },
221
246
  },
222
247
  subagent: {
223
248
  running: (elapsed) => `运行中 ${elapsed}`,
@@ -15,6 +15,7 @@ export declare const en: {
15
15
  needsPrompt: string;
16
16
  retry: (attempt: number, max: number, seconds: number, error: string) => string;
17
17
  modelFailed: string;
18
+ waitingTasks: (n: number) => string;
18
19
  planPending: (version: number, where: string) => string;
19
20
  limitTurns: (limit: number) => string;
20
21
  limitCost: (limit: string, spent: string) => string;
@@ -24,6 +25,7 @@ export declare const en: {
24
25
  rpc: {
25
26
  unknownCommand: (type: string) => string;
26
27
  parseFailed: (error: string) => string;
28
+ badTaskId: string;
27
29
  missingType: string;
28
30
  unsupported: string;
29
31
  noPlan: string;
@@ -53,6 +55,7 @@ export declare const zh: {
53
55
  seconds: (n: number) => string;
54
56
  millis: (n: number) => string;
55
57
  needsPrompt: string;
58
+ waitingTasks: (n: number) => string;
56
59
  retry: (attempt: number, max: number, seconds: number, error: string) => string;
57
60
  modelFailed: string;
58
61
  planPending: (version: number, where: string) => string;
@@ -61,6 +64,7 @@ export declare const zh: {
61
64
  denied: (count: number, tools: readonly string[], reason: string) => string;
62
65
  };
63
66
  rpc: {
67
+ badTaskId: string;
64
68
  unknownCommand: (type: string) => string;
65
69
  parseFailed: (error: string) => string;
66
70
  missingType: string;
@@ -16,6 +16,7 @@ export const en = {
16
16
  needsPrompt: "ama: -p needs a prompt (positional argument or stdin pipe)\n",
17
17
  retry: (attempt, max, seconds, error) => `ama: ↻ retry ${attempt}/${max} (in ${seconds}s): ${error}\n`,
18
18
  modelFailed: "model call failed",
19
+ waitingTasks: (n) => `ama: waiting for ${plural(n, "background task")} and their notification turns (Ctrl+C stops them)\n`,
19
20
  planPending: (version, where) => `ama: plan v${version} saved, awaiting approval (not executed): ${where}; -p does not approve on anyone's behalf — ` +
20
21
  "approve it in the interactive UI or via RPC plan_response, or set plan.unattended: approve to let -p approve and continue",
21
22
  limitTurns: (limit) => `ama: reached the turn limit ${limit} (--max-turns / limits.maxTurns); run ended before finishing`,
@@ -27,6 +28,7 @@ export const en = {
27
28
  rpc: {
28
29
  unknownCommand: (type) => `unknown command: ${type}`,
29
30
  parseFailed: (error) => `JSON parse failed: ${error}`,
31
+ badTaskId: "taskId must be a string",
30
32
  missingType: "missing type",
31
33
  unsupported: "this session does not support this command",
32
34
  noPlan: "this session has no plan extension",
@@ -56,6 +58,7 @@ export const zh = {
56
58
  seconds: (n) => `${n} 秒`,
57
59
  millis: (n) => `${n} 毫秒`,
58
60
  needsPrompt: "ama: -p 需要提示(位置参数或 stdin 管道)\n",
61
+ waitingTasks: (n) => `ama: 等待 ${n} 个后台任务及其通知回合结束(Ctrl+C 中止)\n`,
59
62
  retry: (attempt, max, seconds, error) => `ama: ↻ 重试 ${attempt}/${max}(${seconds}s 后):${error}\n`,
60
63
  modelFailed: "模型调用失败",
61
64
  planPending: (version, where) => `ama: 计划 v${version} 已落盘、待审批(未执行):${where};-p 不替人批准——` +
@@ -66,6 +69,7 @@ export const zh = {
66
69
  "-p 没有人审批,需要放行时用 --permission-mode auto-edit|auto 或 --allow <规则>",
67
70
  },
68
71
  rpc: {
72
+ badTaskId: "taskId 应为字符串",
69
73
  unknownCommand: (type) => `未知命令:${type}`,
70
74
  parseFailed: (error) => `JSON 解析失败:${error}`,
71
75
  missingType: "缺少 type",
@@ -33,7 +33,7 @@ export const en = {
33
33
  statusline: "Footer info two lines / one line (Ctrl+G)",
34
34
  planArgs: "[goal] | approve [mode|fresh] | reject",
35
35
  plan: "Show the plan and status; with a goal, enter Plan mode; approve / discard a pending plan",
36
- tasks: "Sub-agent tasks: status, output, stop",
36
+ tasks: "Sub-agent tasks: status, output, stop, background",
37
37
  agents: "Sub-agent types and external agents (installed, version)",
38
38
  paste: "Paste an image from the clipboard (Ctrl+V)",
39
39
  exit: "Exit",
@@ -53,7 +53,7 @@ export const en = {
53
53
  warmingSet: (mode) => `Warming: ${mode} (this session)`,
54
54
  cacheUsage: "usage: /cache [warm off|streaming|idle | fingerprint]",
55
55
  taskStopped: (id) => `Stopped ${id}`,
56
- tasksUsage: "usage: /tasks [id] | /tasks stop <id>",
56
+ tasksUsage: "usage: /tasks [id] | /tasks stop <id> | /tasks bg [id]",
57
57
  newSession: (id) => `New session ${id}`,
58
58
  resumed: (id, messages) => `Resumed session ${id} (${plural(messages, "message")})`,
59
59
  forked: (id) => `Forked to new session ${id}`,
@@ -276,7 +276,7 @@ export const zh = {
276
276
  statusline: "底部信息行两行 / 一行(Ctrl+G)",
277
277
  planArgs: "[目标] | approve [模式|fresh] | reject",
278
278
  plan: "查看计划与状态;带目标进入 Plan 模式;批准 / 放弃待审批的计划",
279
- tasks: "子 Agent 任务:状态、输出、停止",
279
+ tasks: "子 Agent 任务:状态、输出、停止、转后台",
280
280
  agents: "子 Agent 类型与外部 Agent(安装状态、版本)",
281
281
  paste: "粘贴剪贴板里的图片(Ctrl+V)",
282
282
  exit: "退出",
@@ -295,7 +295,7 @@ export const zh = {
295
295
  warmingSet: (mode) => `保温:${mode}(本会话)`,
296
296
  cacheUsage: "用法:/cache [warm off|streaming|idle | fingerprint]",
297
297
  taskStopped: (id) => `已停止 ${id}`,
298
- tasksUsage: "用法:/tasks [id] | /tasks stop <id>",
298
+ tasksUsage: "用法:/tasks [id] | /tasks stop <id> | /tasks bg [id]",
299
299
  newSession: (id) => `已新建会话 ${id}`,
300
300
  resumed: (id, messages) => `已恢复会话 ${id}(${messages} 条消息)`,
301
301
  forked: (id) => `已分叉到新会话 ${id}`,
@@ -25,6 +25,7 @@ export declare const en: {
25
25
  "ui.showThinking": string;
26
26
  "ui.compact": string;
27
27
  "ui.animation": string;
28
+ "ui.logo": string;
28
29
  "ui.statusLine": string;
29
30
  "ui.restoreOnCancel": string;
30
31
  "ui.quietStartup": string;
@@ -84,6 +85,8 @@ export declare const en: {
84
85
  "agents.sessionBudgetUsd": string;
85
86
  "subagents.maxConcurrent": string;
86
87
  "subagents.maxPending": string;
88
+ "subagents.background": string;
89
+ "subagents.autoBackgroundAfterMs": string;
87
90
  "memory.enabled": string;
88
91
  "memory.subagents": string;
89
92
  };
@@ -199,6 +202,7 @@ export declare const zh: {
199
202
  "ui.showThinking": string;
200
203
  "ui.compact": string;
201
204
  "ui.animation": string;
205
+ "ui.logo": string;
202
206
  "ui.statusLine": string;
203
207
  "ui.restoreOnCancel": string;
204
208
  "ui.quietStartup": string;
@@ -258,6 +262,8 @@ export declare const zh: {
258
262
  "agents.sessionBudgetUsd": string;
259
263
  "subagents.maxConcurrent": string;
260
264
  "subagents.maxPending": string;
265
+ "subagents.background": string;
266
+ "subagents.autoBackgroundAfterMs": string;
261
267
  "memory.enabled": string;
262
268
  "memory.subagents": string;
263
269
  };