@armadra/agent 0.6.2 → 0.6.4

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 (147) hide show
  1. package/CHANGELOG.md +85 -0
  2. package/CHANGELOG.zh-CN.md +59 -0
  3. package/README.md +168 -575
  4. package/README.zh-CN.md +165 -596
  5. package/dist/agent/queue.d.ts +9 -0
  6. package/dist/agent/queue.js +27 -0
  7. package/dist/agent/session-subagent.d.ts +1 -0
  8. package/dist/agent/session-subagent.js +9 -0
  9. package/dist/agent/session.d.ts +11 -0
  10. package/dist/agent/session.js +29 -2
  11. package/dist/agent/subagent-background.d.ts +75 -0
  12. package/dist/agent/subagent-background.js +209 -0
  13. package/dist/agent/subagent-direct.d.ts +5 -2
  14. package/dist/agent/subagent-direct.js +34 -1
  15. package/dist/agent/subagent-registry.d.ts +26 -6
  16. package/dist/agent/subagent-registry.js +66 -94
  17. package/dist/agent/types-w5.d.ts +11 -1
  18. package/dist/agent/types.d.ts +12 -0
  19. package/dist/agents/builtin.js +0 -1
  20. package/dist/agents/external.js +0 -1
  21. package/dist/agents/parse.js +4 -3
  22. package/dist/agents/result.d.ts +7 -1
  23. package/dist/agents/result.js +20 -1
  24. package/dist/agents/task-control.d.ts +13 -2
  25. package/dist/agents/task-record.d.ts +16 -4
  26. package/dist/agents/task-record.js +32 -0
  27. package/dist/agents/types.d.ts +5 -1
  28. package/dist/ai/apis/chatgpt-rate-limits.js +7 -2
  29. package/dist/ai/providers/discovered-cache.d.ts +10 -4
  30. package/dist/ai/providers/discovered-cache.js +30 -14
  31. package/dist/ai/types.d.ts +2 -1
  32. package/dist/auth/chatgpt/backend-client.d.ts +6 -5
  33. package/dist/auth/chatgpt/backend-client.js +8 -7
  34. package/dist/bundle/ama.cjs +2034 -552
  35. package/dist/cli/compose-agents.d.ts +2 -1
  36. package/dist/cli/compose-agents.js +11 -2
  37. package/dist/cli/subcommands/models-discover.d.ts +1 -0
  38. package/dist/cli/subcommands/models-discover.js +12 -2
  39. package/dist/config/json-schema.js +10 -2
  40. package/dist/config/key-docs.js +9 -2
  41. package/dist/config/merge.d.ts +1 -1
  42. package/dist/config/merge.js +20 -3
  43. package/dist/config/schema-w5.js +4 -2
  44. package/dist/config/schema.js +4 -0
  45. package/dist/config/settings-registry.js +5 -0
  46. package/dist/config/types-w5.d.ts +10 -0
  47. package/dist/config/types-w5.js +2 -0
  48. package/dist/config/types.d.ts +5 -1
  49. package/dist/drivers/runner.js +29 -2
  50. package/dist/git/info.d.ts +19 -0
  51. package/dist/git/info.js +64 -8
  52. package/dist/i18n/catalog.d.ts +58 -8
  53. package/dist/i18n/messages/agents.d.ts +60 -0
  54. package/dist/i18n/messages/agents.js +62 -2
  55. package/dist/i18n/messages/config-keys.d.ts +8 -0
  56. package/dist/i18n/messages/config-keys.js +18 -10
  57. package/dist/i18n/messages/config.d.ts +8 -0
  58. package/dist/i18n/messages/interactive-startup.d.ts +0 -16
  59. package/dist/i18n/messages/interactive-startup.js +0 -16
  60. package/dist/i18n/messages/interactive-view.d.ts +8 -0
  61. package/dist/i18n/messages/interactive-view.js +10 -0
  62. package/dist/i18n/messages/interactive.d.ts +33 -16
  63. package/dist/i18n/messages/interactive.js +31 -0
  64. package/dist/i18n/messages/print.d.ts +4 -0
  65. package/dist/i18n/messages/print.js +4 -0
  66. package/dist/i18n/messages/report.d.ts +8 -0
  67. package/dist/i18n/messages/report.js +12 -4
  68. package/dist/i18n/messages/settings.d.ts +8 -0
  69. package/dist/i18n/messages/settings.js +8 -0
  70. package/dist/i18n/messages/subcommands-config.d.ts +4 -0
  71. package/dist/i18n/messages/subcommands-config.js +4 -0
  72. package/dist/i18n/messages/subcommands.d.ts +4 -0
  73. package/dist/index.d.ts +1 -0
  74. package/dist/modes/commands-core.js +19 -4
  75. package/dist/modes/interactive/agent-bar.d.ts +3 -1
  76. package/dist/modes/interactive/agent-bar.js +12 -5
  77. package/dist/modes/interactive/agent-ui.d.ts +21 -3
  78. package/dist/modes/interactive/agent-ui.js +82 -12
  79. package/dist/modes/interactive/agent-view.d.ts +9 -0
  80. package/dist/modes/interactive/agent-view.js +28 -4
  81. package/dist/modes/interactive/approval-dock.d.ts +51 -0
  82. package/dist/modes/interactive/approval-dock.js +112 -0
  83. package/dist/modes/interactive/approval-ui.d.ts +43 -0
  84. package/dist/modes/interactive/approval-ui.js +64 -0
  85. package/dist/modes/interactive/commands.js +4 -1
  86. package/dist/modes/interactive/event-notices.d.ts +6 -1
  87. package/dist/modes/interactive/event-notices.js +7 -1
  88. package/dist/modes/interactive/interactive-mode.d.ts +4 -2
  89. package/dist/modes/interactive/interactive-mode.js +46 -39
  90. package/dist/modes/interactive/interrupt-send.d.ts +25 -0
  91. package/dist/modes/interactive/interrupt-send.js +32 -0
  92. package/dist/modes/interactive/key-dispatch.d.ts +29 -5
  93. package/dist/modes/interactive/key-dispatch.js +97 -8
  94. package/dist/modes/interactive/line/line-mode.d.ts +1 -0
  95. package/dist/modes/interactive/line/line-mode.js +34 -7
  96. package/dist/modes/interactive/run-indicator.d.ts +34 -2
  97. package/dist/modes/interactive/run-indicator.js +62 -8
  98. package/dist/modes/interactive/session-events.js +5 -1
  99. package/dist/modes/interactive/startup-header.d.ts +29 -14
  100. package/dist/modes/interactive/startup-header.js +93 -59
  101. package/dist/modes/interactive/startup-logo.d.ts +83 -0
  102. package/dist/modes/interactive/startup-logo.js +183 -0
  103. package/dist/modes/interactive/status-area.d.ts +18 -0
  104. package/dist/modes/interactive/status-area.js +67 -1
  105. package/dist/modes/interactive/status-bar.d.ts +13 -2
  106. package/dist/modes/interactive/status-bar.js +60 -17
  107. package/dist/modes/interactive/status-line.d.ts +11 -8
  108. package/dist/modes/interactive/status-line.js +52 -39
  109. package/dist/modes/interactive/status-quota.d.ts +58 -0
  110. package/dist/modes/interactive/status-quota.js +155 -0
  111. package/dist/modes/interactive/subagent-view.d.ts +1 -0
  112. package/dist/modes/interactive/subagent-view.js +8 -0
  113. package/dist/modes/interactive/task-background.d.ts +31 -0
  114. package/dist/modes/interactive/task-background.js +68 -0
  115. package/dist/modes/interactive/tool-view.d.ts +7 -1
  116. package/dist/modes/interactive/tool-view.js +24 -1
  117. package/dist/modes/print/print-mode.d.ts +11 -0
  118. package/dist/modes/print/print-mode.js +36 -1
  119. package/dist/modes/rpc/commands.d.ts +4 -1
  120. package/dist/modes/rpc/commands.js +24 -2
  121. package/dist/rpc.d.ts +20 -0
  122. package/dist/rpc.js +3 -0
  123. package/dist/tools/task-ctl.d.ts +2 -0
  124. package/dist/tools/task-ctl.js +7 -2
  125. package/dist/tools/task.d.ts +11 -0
  126. package/dist/tools/task.js +20 -2
  127. package/dist/tools/types.d.ts +6 -0
  128. package/dist/tui/components/editor.d.ts +2 -0
  129. package/dist/tui/components/editor.js +4 -0
  130. package/dist/tui/components/loader.d.ts +5 -1
  131. package/dist/tui/components/loader.js +18 -5
  132. package/dist/tui/keybindings.d.ts +15 -3
  133. package/dist/tui/keybindings.js +15 -3
  134. package/docs/agents.md +52 -28
  135. package/docs/en/host-api.md +5 -1
  136. package/docs/en/providers.md +1 -1
  137. package/docs/en/rpc.md +28 -14
  138. package/docs/en/sessions.md +3 -1
  139. package/docs/en/tui.md +106 -70
  140. package/docs/host-api.md +5 -1
  141. package/docs/providers.md +4 -2
  142. package/docs/rpc.md +28 -14
  143. package/docs/session-format.md +1 -1
  144. package/docs/sessions.md +2 -1
  145. package/docs/tui-design.md +42 -29
  146. package/docs/tui.md +106 -70
  147. package/package.json +1 -1
@@ -447,6 +447,8 @@ declare const en: {
447
447
  listFailed: (provider: string, error: string) => string;
448
448
  found: (provider: string, count: number, url: string) => string;
449
449
  unmatched: string;
450
+ fromBackend: string;
451
+ noBackendWindow: (ids: string) => string;
450
452
  image: string;
451
453
  reasoning: string;
452
454
  noTools: string;
@@ -495,6 +497,8 @@ declare const en: {
495
497
  clearedCtrlC: string;
496
498
  ctrlCAgain: string;
497
499
  interrupted: string;
500
+ interruptSent: string;
501
+ nothingToSend: string;
498
502
  toolsExpanded: string;
499
503
  toolsCollapsed: string;
500
504
  };
@@ -535,6 +539,17 @@ declare const en: {
535
539
  cacheSilent: string;
536
540
  sandbox: string;
537
541
  cycleHint: string;
542
+ quota: {
543
+ session: string;
544
+ reset: string;
545
+ weekly: string;
546
+ weeklyReset: string;
547
+ window: (duration: string) => string;
548
+ windowReset: (duration: string) => string;
549
+ short5h: string;
550
+ shortWeek: string;
551
+ pending: string;
552
+ };
538
553
  };
539
554
  subagent: {
540
555
  running: (elapsed: string) => string;
@@ -572,6 +587,7 @@ declare const en: {
572
587
  host: string;
573
588
  task: string;
574
589
  plan: string;
590
+ interrupt: string;
575
591
  };
576
592
  planHandoff: string;
577
593
  thinkingStreaming: (glyph: string, ellipsis: string) => string;
@@ -600,6 +616,8 @@ declare const en: {
600
616
  thinking: string;
601
617
  queueMore: (ellipsis: string, n: number) => string;
602
618
  queueHint: (arrow: string) => string;
619
+ queueHintNow: (arrow: string, key: string) => string;
620
+ sendHint: (mode: "queue" | "interrupt", key: string) => string;
603
621
  };
604
622
  tool: {
605
623
  interrupted: string;
@@ -633,16 +651,8 @@ declare const en: {
633
651
  templates: (n: number) => string;
634
652
  host: (host: string) => string;
635
653
  warnings: (n: number) => string;
636
- hintCompact: string;
637
- keyModel: string;
638
- keyDir: string;
639
- keyMode: string;
640
- keyLoaded: string;
641
- keyHost: string;
642
- keyWarnings: string;
643
654
  thinking: (level: string) => string;
644
655
  preset: (preset: string) => string;
645
- warningsValue: (n: number) => string;
646
656
  hint: string;
647
657
  };
648
658
  ui: {
@@ -1079,6 +1089,8 @@ declare const en: {
1079
1089
  tasks: string;
1080
1090
  agents: string;
1081
1091
  paste: string;
1092
+ interruptArgs: string;
1093
+ interrupt: string;
1082
1094
  exit: string;
1083
1095
  config: string;
1084
1096
  traceArgs: string;
@@ -1096,6 +1108,8 @@ declare const en: {
1096
1108
  cacheUsage: string;
1097
1109
  taskStopped: (id: string) => string;
1098
1110
  tasksUsage: string;
1111
+ interruptUsage: string;
1112
+ interruptSent: (text: string) => string;
1099
1113
  newSession: (id: string) => string;
1100
1114
  resumed: (id: string, messages: number) => string;
1101
1115
  forked: (id: string) => string;
@@ -1249,6 +1263,7 @@ declare const en: {
1249
1263
  needsPrompt: string;
1250
1264
  retry: (attempt: number, max: number, seconds: number, error: string) => string;
1251
1265
  modelFailed: string;
1266
+ waitingTasks: (n: number) => string;
1252
1267
  planPending: (version: number, where: string) => string;
1253
1268
  limitTurns: (limit: number) => string;
1254
1269
  limitCost: (limit: string, spent: string) => string;
@@ -1257,6 +1272,7 @@ declare const en: {
1257
1272
  rpc: {
1258
1273
  unknownCommand: (type: string) => string;
1259
1274
  parseFailed: (error: string) => string;
1275
+ badTaskId: string;
1260
1276
  missingType: string;
1261
1277
  unsupported: string;
1262
1278
  noPlan: string;
@@ -1325,8 +1341,10 @@ declare const en: {
1325
1341
  "ui.quietStartup": string;
1326
1342
  "ui.ascii": string;
1327
1343
  "ui.compact": string;
1344
+ "ui.logo": string;
1328
1345
  "ui.animation": string;
1329
1346
  "ui.restoreOnCancel": string;
1347
+ "ui.enterWhileRunning": string;
1330
1348
  "ui.statusLine": string;
1331
1349
  "ui.language": string;
1332
1350
  "ui.replyLanguage": string;
@@ -1381,6 +1399,8 @@ declare const en: {
1381
1399
  "subagents.maxConcurrent": string;
1382
1400
  "subagents.maxPending": string;
1383
1401
  "subagents.defaultModel": string;
1402
+ "subagents.background": string;
1403
+ "subagents.autoBackgroundAfterMs": string;
1384
1404
  models: string;
1385
1405
  "models.aliases": string;
1386
1406
  "models.aliases.fast": string;
@@ -1737,7 +1757,31 @@ declare const en: {
1737
1757
  bar: {
1738
1758
  more: (n: number) => string;
1739
1759
  keys: (up: string, down: string) => string;
1760
+ keysFull: (up: string, down: string) => string;
1740
1761
  empty: string;
1762
+ runHint: (down: string) => string;
1763
+ };
1764
+ focus: {
1765
+ busyInput: (down: string) => string;
1766
+ disabled: string;
1767
+ };
1768
+ background: {
1769
+ done: (ids: string) => string;
1770
+ none: string;
1771
+ notForeground: (taskId: string) => string;
1772
+ runHint: (key: string) => string;
1773
+ timeout: (taskId: string, agent: string) => string;
1774
+ host: (taskId: string, agent: string) => string;
1775
+ moved: (elapsed: string) => string;
1776
+ started: string;
1777
+ interrupted: (ids: string) => string;
1778
+ };
1779
+ stop: {
1780
+ confirm: (taskId: string) => string;
1781
+ ended: (taskId: string) => string;
1782
+ };
1783
+ approval: {
1784
+ runHint: (down: string) => string;
1741
1785
  };
1742
1786
  view: {
1743
1787
  back: string;
@@ -1747,6 +1791,8 @@ declare const en: {
1747
1791
  steered: (taskId: string) => string;
1748
1792
  queued: (taskId: string) => string;
1749
1793
  resumed: (taskId: string) => string;
1794
+ interrupted: (taskId: string) => string;
1795
+ queuedNoInterrupt: (taskId: string) => string;
1750
1796
  sendFailed: (message: string) => string;
1751
1797
  stopped: (taskId: string) => string;
1752
1798
  commandsHere: string;
@@ -2050,8 +2096,10 @@ declare const en: {
2050
2096
  "ui.showThinking": string;
2051
2097
  "ui.compact": string;
2052
2098
  "ui.animation": string;
2099
+ "ui.logo": string;
2053
2100
  "ui.statusLine": string;
2054
2101
  "ui.restoreOnCancel": string;
2102
+ "ui.enterWhileRunning": string;
2055
2103
  "ui.quietStartup": string;
2056
2104
  "ui.ascii": string;
2057
2105
  "ui.language": string;
@@ -2109,6 +2157,8 @@ declare const en: {
2109
2157
  "agents.sessionBudgetUsd": string;
2110
2158
  "subagents.maxConcurrent": string;
2111
2159
  "subagents.maxPending": string;
2160
+ "subagents.background": string;
2161
+ "subagents.autoBackgroundAfterMs": string;
2112
2162
  "memory.enabled": string;
2113
2163
  "memory.subagents": string;
2114
2164
  };
@@ -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;
@@ -31,6 +63,8 @@ export declare const en: {
31
63
  steered: (taskId: string) => string;
32
64
  queued: (taskId: string) => string;
33
65
  resumed: (taskId: string) => string;
66
+ interrupted: (taskId: string) => string;
67
+ queuedNoInterrupt: (taskId: string) => string;
34
68
  sendFailed: (message: string) => string;
35
69
  stopped: (taskId: string) => string;
36
70
  commandsHere: string;
@@ -59,7 +93,31 @@ export declare const zh: {
59
93
  bar: {
60
94
  more: (n: number) => string;
61
95
  keys: (up: string, down: string) => string;
96
+ keysFull: (up: string, down: string) => string;
62
97
  empty: string;
98
+ runHint: (down: string) => string;
99
+ };
100
+ focus: {
101
+ busyInput: (down: string) => string;
102
+ disabled: string;
103
+ };
104
+ background: {
105
+ done: (ids: string) => string;
106
+ none: string;
107
+ notForeground: (taskId: string) => string;
108
+ runHint: (key: string) => string;
109
+ timeout: (taskId: string, agent: string) => string;
110
+ host: (taskId: string, agent: string) => string;
111
+ moved: (elapsed: string) => string;
112
+ started: string;
113
+ interrupted: (ids: string) => string;
114
+ };
115
+ stop: {
116
+ confirm: (taskId: string) => string;
117
+ ended: (taskId: string) => string;
118
+ };
119
+ approval: {
120
+ runHint: (down: string) => string;
63
121
  };
64
122
  view: {
65
123
  back: string;
@@ -69,6 +127,8 @@ export declare const zh: {
69
127
  steered: (taskId: string) => string;
70
128
  queued: (taskId: string) => string;
71
129
  resumed: (taskId: string) => string;
130
+ interrupted: (taskId: string) => string;
131
+ queuedNoInterrupt: (taskId: string) => string;
72
132
  sendFailed: (message: string) => string;
73
133
  stopped: (taskId: string) => string;
74
134
  commandsHere: 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",
@@ -32,9 +64,11 @@ export const en = {
32
64
  steered: (taskId) => `Sent to ${taskId}; delivered when its current turn ends`,
33
65
  queued: (taskId) => `Queued for ${taskId}; sent when its current run ends`,
34
66
  resumed: (taskId) => `Sent to ${taskId}; it continues in the background`,
67
+ interrupted: (taskId) => `Interrupted ${taskId}; your message starts its next turn now`,
68
+ queuedNoInterrupt: (taskId) => `${taskId} cannot be interrupted here; queued, sent when its current run ends`,
35
69
  sendFailed: (message) => `Could not send: ${message}`,
36
70
  stopped: (taskId) => `Stopped ${taskId}`,
37
- commandsHere: "Only /tasks stop works here; press Esc to go back for other commands",
71
+ commandsHere: "Only /tasks stop and /tasks bg work here; press Esc to go back for other commands",
38
72
  removed: (taskId) => `Task ${taskId} is gone`,
39
73
  unknown: (taskId) => `No task ${taskId}`,
40
74
  turn: (n) => `turn ${n}`,
@@ -60,7 +94,31 @@ export const zh = {
60
94
  bar: {
61
95
  more: (n) => `另 ${n} 个`,
62
96
  keys: (up, down) => `${up}${down} 选择 · Enter 打开 · Esc 返回`,
97
+ keysFull: (up, down) => `${up}${down} 选择 · Enter 打开 · b 转后台 · x 停止 · Esc 返回`,
63
98
  empty: "还没有子 Agent 任务",
99
+ runHint: (down) => `${down} Agent 栏`,
100
+ },
101
+ focus: {
102
+ busyInput: (down) => `输入框有字;清空后再按 ${down} 进 Agent 栏`,
103
+ disabled: "Agent 栏已关闭(ui.agentBar),用 /tasks",
104
+ },
105
+ background: {
106
+ done: (ids) => `已转后台:${ids},完成后会通知`,
107
+ none: "没有可转后台的前台任务",
108
+ notForeground: (taskId) => `${taskId} 不是运行中的前台任务`,
109
+ runHint: (key) => `${key} 转后台`,
110
+ timeout: (taskId, agent) => `${taskId} ${agent} 运行较久,已自动转后台(subagents.autoBackgroundAfterMs)`,
111
+ host: (taskId, agent) => `${taskId} ${agent} 已由宿主转后台`,
112
+ moved: (elapsed) => `已转后台 · ${elapsed}`,
113
+ started: "已在后台启动",
114
+ interrupted: (ids) => `已中断(后台任务 ${ids} 仍在运行,Esc 不影响)`,
115
+ },
116
+ stop: {
117
+ confirm: (taskId) => `再按 x 停止 ${taskId}`,
118
+ ended: (taskId) => `${taskId} 已结束`,
119
+ },
120
+ approval: {
121
+ runHint: (down) => `${down} 处理审批`,
64
122
  },
65
123
  view: {
66
124
  back: "Esc 返回",
@@ -70,9 +128,11 @@ export const zh = {
70
128
  steered: (taskId) => `已发给 ${taskId},本轮结束后送达`,
71
129
  queued: (taskId) => `已排队,${taskId} 本次运行结束后发送`,
72
130
  resumed: (taskId) => `已发给 ${taskId},在后台继续`,
131
+ interrupted: (taskId) => `已打断 ${taskId},这条消息立即开始新一轮`,
132
+ queuedNoInterrupt: (taskId) => `${taskId} 不支持打断,已排队,本次运行结束后发送`,
73
133
  sendFailed: (message) => `发送失败:${message}`,
74
134
  stopped: (taskId) => `已停止 ${taskId}`,
75
- commandsHere: "这里只能用 /tasks stop;其它命令按 Esc 返回后输入",
135
+ commandsHere: "这里只能用 /tasks stop 与 /tasks bg;其它命令按 Esc 返回后输入",
76
136
  removed: (taskId) => `任务 ${taskId} 已不存在`,
77
137
  unknown: (taskId) => `没有任务 ${taskId}`,
78
138
  turn: (n) => `第 ${n} 轮`,
@@ -52,8 +52,10 @@ 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;
58
+ "ui.enterWhileRunning": string;
57
59
  "ui.statusLine": string;
58
60
  "ui.language": string;
59
61
  "ui.replyLanguage": string;
@@ -108,6 +110,8 @@ export declare const en: {
108
110
  "subagents.maxConcurrent": string;
109
111
  "subagents.maxPending": string;
110
112
  "subagents.defaultModel": string;
113
+ "subagents.background": string;
114
+ "subagents.autoBackgroundAfterMs": string;
111
115
  models: string;
112
116
  "models.aliases": string;
113
117
  "models.aliases.fast": string;
@@ -196,8 +200,10 @@ export declare const zh: {
196
200
  "ui.quietStartup": string;
197
201
  "ui.ascii": string;
198
202
  "ui.compact": string;
203
+ "ui.logo": string;
199
204
  "ui.animation": string;
200
205
  "ui.restoreOnCancel": string;
206
+ "ui.enterWhileRunning": string;
201
207
  "ui.statusLine": string;
202
208
  "ui.language": string;
203
209
  "ui.replyLanguage": string;
@@ -252,6 +258,8 @@ export declare const zh: {
252
258
  "subagents.maxConcurrent": string;
253
259
  "subagents.maxPending": string;
254
260
  "subagents.defaultModel": string;
261
+ "subagents.background": string;
262
+ "subagents.autoBackgroundAfterMs": string;
255
263
  models: string;
256
264
  "models.aliases": string;
257
265
  "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,15 @@ 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",
105
+ "ui.enterWhileRunning": "Enter while a run is in progress: queue (default) queues the message as a steer delivered at the next delivery point; interrupt stops the current turn and sends it at once. The app.message.interrupt key (default Ctrl+X) does the other one",
104
106
  "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
107
  "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
108
  "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)",
109
+ "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
110
  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
111
  "memory.enabled": "Master switch; --memory / --no-memory and AMA_MEMORY=0|1 override",
110
112
  "memory.scopes": "Enabled scopes: user (data directory, across projects), project (keyed by a hash of the repository path)",
@@ -151,10 +153,12 @@ const keysEn = {
151
153
  "agents.maxConcurrent": "Total concurrency of external agents",
152
154
  "agents.sessionBudgetUsd": "USD budget for external agents in this session",
153
155
  "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)",
156
+ subagents: "ama's own task sub-sessions; user level only except background / autoBackgroundAfterMs (effective from wave 5 W5-G)",
155
157
  "subagents.maxConcurrent": "Sub-sessions running at the same time",
156
158
  "subagents.maxPending": "Queue limit; task fails beyond it",
157
159
  "subagents.defaultModel": "Default sub-session model provider/model[@channel]",
160
+ "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",
161
+ "subagents.autoBackgroundAfterMs": "Move a foreground task to the background after it has run this many milliseconds; 0 disables; user and project level",
158
162
  models: "Model aliases and the model picker list; user level only (effective from wave 5 W5-G)",
159
163
  "models.aliases": "Models that model: fast / strong in sub-agent definitions point to",
160
164
  "models.aliases.fast": "Model for the fast alias provider/model[@channel]",
@@ -217,13 +221,15 @@ const keysZh = {
217
221
  "ui.tuiMode": "终端界面形态(目前只有 regular)",
218
222
  "ui.quietStartup": "启动画面详略",
219
223
  "ui.ascii": "ASCII 字形(> * L、+ - |);不写时自动检测:区域设置不含 UTF-8、TERM=linux、旧 conhost 时开启;AMA_ASCII=1/0 覆盖",
220
- "ui.compact": "消息区块间不空行、启动头不画框",
221
- "ui.animation": "false:运行中 spinner 静止,只在秒数变化时重绘",
224
+ "ui.compact": "消息区块间不空行、启动头不画 AMA 字符画",
225
+ "ui.logo": "启动头的 AMA 字符画:auto 在终端宽 48 列以上时画,off 只显示信息行",
226
+ "ui.animation": "false:运行中 spinner 静止,只在秒数变化时重绘;启动字符画不播放动画",
222
227
  "ui.restoreOnCancel": "运行中 Esc 中断、本回合还没有任何回复或工具调用时,撤回该回合并把原消息放回输入框",
228
+ "ui.enterWhileRunning": "运行中按 Enter:queue(缺省)排队插话,等下一个投递点送达;interrupt 打断当前回合并立即发送。app.message.interrupt 键(缺省 Ctrl+X)做另一种",
223
229
  "ui.statusLine": "底部信息行:full 两行(速率行 + 状态行),compact 一行;运行时 Ctrl+G 或 /statusline 切换(第五波 W5-A 起生效)",
224
230
  "ui.language": "界面语言:auto 按 LC_ALL / LC_MESSAGES / LANG 判断(zh* 为中文,其余英文),zh,en;AMA_LANG、--lang 覆盖;只影响界面,发给模型的文本固定英文",
225
231
  "ui.replyLanguage": "模型回复语言(如 Chinese):会话开始在 rules 节末尾追加一句英文规则;不设时零字节变化;只认用户级(第六波起生效)",
226
- "ui.agentBar": "Agent 栏(状态行上方的子 Agent 列表):auto 有任务时显示,off 不显示;Ctrl+B / 空输入时 ↓ 进入(第六波 W6-A 起生效)",
232
+ "ui.agentBar": "Agent 栏(状态行上方的子 Agent 列表):auto 有任务时显示,off 不显示;空输入时按 ↓ 进入",
227
233
  memory: "跨会话记忆(docs/memory.md):缺省关闭,关闭时请求逐字节不变;项目级只能设 enabled: false(第六波 W6-M 起生效)",
228
234
  "memory.enabled": "总开关;--memory / --no-memory、AMA_MEMORY=0|1 覆盖",
229
235
  "memory.scopes": "启用的作用域:user(数据目录,跨项目)、project(按仓库路径哈希)",
@@ -270,10 +276,12 @@ const keysZh = {
270
276
  "agents.maxConcurrent": "外部 Agent 的总并发",
271
277
  "agents.sessionBudgetUsd": "本会话外部 Agent 的美元预算",
272
278
  "agents.dirs": "追加的子 Agent 定义目录(*.md);各层累加",
273
- subagents: "ama 自己的 task 子会话;只认用户级(第五波 W5-G 起生效)",
279
+ subagents: "ama 自己的 task 子会话;除 background / autoBackgroundAfterMs 外只认用户级(第五波 W5-G 起生效)",
274
280
  "subagents.maxConcurrent": "同时运行的子会话数",
275
281
  "subagents.maxPending": "排队上限,超出时 task 报错",
276
282
  "subagents.defaultModel": "子会话缺省模型 provider/model[@channel]",
283
+ "subagents.background": "task 缺省是否后台:auto = TUI / RPC / ACP 下后台、-p 下前台;always / never 固定。调用参数与类型定义的 background: 优先;用户、项目、宿主级都认",
284
+ "subagents.autoBackgroundAfterMs": "前台任务运行超过该毫秒数自动转后台;0 关闭;用户、项目级都认",
277
285
  models: "模型别名与模型选择器清单;只认用户级(第五波 W5-G 起生效)",
278
286
  "models.aliases": "子 Agent 定义里 model: fast / strong 指向的模型",
279
287
  "models.aliases.fast": "fast 别名的模型 provider/model[@channel]",
@@ -52,8 +52,10 @@ 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;
58
+ "ui.enterWhileRunning": string;
57
59
  "ui.statusLine": string;
58
60
  "ui.language": string;
59
61
  "ui.replyLanguage": string;
@@ -108,6 +110,8 @@ export declare const en: {
108
110
  "subagents.maxConcurrent": string;
109
111
  "subagents.maxPending": string;
110
112
  "subagents.defaultModel": string;
113
+ "subagents.background": string;
114
+ "subagents.autoBackgroundAfterMs": string;
111
115
  models: string;
112
116
  "models.aliases": string;
113
117
  "models.aliases.fast": string;
@@ -308,8 +312,10 @@ export declare const zh: {
308
312
  "ui.quietStartup": string;
309
313
  "ui.ascii": string;
310
314
  "ui.compact": string;
315
+ "ui.logo": string;
311
316
  "ui.animation": string;
312
317
  "ui.restoreOnCancel": string;
318
+ "ui.enterWhileRunning": string;
313
319
  "ui.statusLine": string;
314
320
  "ui.language": string;
315
321
  "ui.replyLanguage": string;
@@ -364,6 +370,8 @@ export declare const zh: {
364
370
  "subagents.maxConcurrent": string;
365
371
  "subagents.maxPending": string;
366
372
  "subagents.defaultModel": string;
373
+ "subagents.background": string;
374
+ "subagents.autoBackgroundAfterMs": string;
367
375
  models: string;
368
376
  "models.aliases": string;
369
377
  "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: {
@@ -19,6 +19,7 @@ export declare const en: {
19
19
  host: string;
20
20
  task: string;
21
21
  plan: string;
22
+ interrupt: string;
22
23
  };
23
24
  planHandoff: string;
24
25
  thinkingStreaming: (glyph: string, ellipsis: string) => string;
@@ -47,6 +48,10 @@ export declare const en: {
47
48
  thinking: string;
48
49
  queueMore: (ellipsis: string, n: number) => string;
49
50
  queueHint: (arrow: string) => string;
51
+ /** 有排队的插话时(`key` = 立即送出它们的键:专用键,或 interrupt 模式下的 Enter)。 */
52
+ queueHintNow: (arrow: string, key: string) => string;
53
+ /** 输入框有字时:Enter 与专用键各做什么(`ui.enterWhileRunning`)。 */
54
+ sendHint: (mode: "queue" | "interrupt", key: string) => string;
50
55
  };
51
56
  tool: {
52
57
  interrupted: string;
@@ -85,6 +90,7 @@ export declare const zh: {
85
90
  host: string;
86
91
  task: string;
87
92
  plan: string;
93
+ interrupt: string;
88
94
  };
89
95
  planHandoff: string;
90
96
  thinkingStreaming: (glyph: string, ellipsis: string) => string;
@@ -113,6 +119,8 @@ export declare const zh: {
113
119
  thinking: string;
114
120
  queueMore: (ellipsis: string, n: number) => string;
115
121
  queueHint: (arrow: string) => string;
122
+ queueHintNow: (arrow: string, key: string) => string;
123
+ sendHint: (mode: "interrupt" | "queue", key: string) => string;
116
124
  };
117
125
  tool: {
118
126
  interrupted: string;