@aragon-agent/cli 0.6.12 → 0.6.14

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 (119) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +108 -31
  3. package/dist/agent/controller.d.ts +38 -2
  4. package/dist/agent/controller.js +185 -34
  5. package/dist/agent/model-profile-settings.d.ts +31 -0
  6. package/dist/agent/model-profile-settings.js +208 -0
  7. package/dist/agent/queued-messages.d.ts +12 -0
  8. package/dist/agent/queued-messages.js +18 -0
  9. package/dist/agent/reducer.d.ts +13 -1
  10. package/dist/agent/reducer.js +52 -12
  11. package/dist/boot/guard.d.ts +3 -3
  12. package/dist/boot/guard.js +3 -3
  13. package/dist/cli.js +48 -16
  14. package/dist/commands/builtins.js +66 -39
  15. package/dist/commands/queue-command.d.ts +3 -0
  16. package/dist/commands/queue-command.js +5 -0
  17. package/dist/commands/registry.d.ts +3 -0
  18. package/dist/compaction/child.d.ts +4 -2
  19. package/dist/compaction/child.js +8 -1
  20. package/dist/compaction/compactor.d.ts +7 -2
  21. package/dist/compaction/compactor.js +21 -16
  22. package/dist/compaction/context-command.js +10 -3
  23. package/dist/compaction/meter.js +2 -0
  24. package/dist/compaction/pressure.d.ts +1 -0
  25. package/dist/compaction/pressure.js +1 -0
  26. package/dist/compaction/types.d.ts +2 -0
  27. package/dist/compaction/wiring.d.ts +4 -3
  28. package/dist/compaction/wiring.js +10 -2
  29. package/dist/config/cli-commands.d.ts +2 -0
  30. package/dist/config/cli-commands.js +16 -4
  31. package/dist/config/load.d.ts +5 -2
  32. package/dist/config/load.js +23 -12
  33. package/dist/config/model-profile-resolution.d.ts +20 -0
  34. package/dist/config/model-profile-resolution.js +81 -0
  35. package/dist/config/model-profile-store.d.ts +67 -0
  36. package/dist/config/model-profile-store.js +153 -0
  37. package/dist/config/model-profiles.d.ts +44 -0
  38. package/dist/config/model-profiles.js +121 -0
  39. package/dist/config/schema.d.ts +11 -2
  40. package/dist/config/store.d.ts +11 -1
  41. package/dist/config/store.js +43 -27
  42. package/dist/fast/resolve.d.ts +2 -1
  43. package/dist/fast/resolve.js +6 -4
  44. package/dist/fast/wiring.d.ts +5 -3
  45. package/dist/fast/wiring.js +8 -4
  46. package/dist/input/stdin-filter.js +3 -2
  47. package/dist/logging/install.js +4 -2
  48. package/dist/logging/secret-registry.d.ts +2 -0
  49. package/dist/logging/secret-registry.js +18 -0
  50. package/dist/team/runtime.d.ts +2 -1
  51. package/dist/team/subagent.d.ts +3 -1
  52. package/dist/team/subagent.js +3 -1
  53. package/dist/ui/ActivityLine.d.ts +6 -70
  54. package/dist/ui/ActivityLine.js +12 -34
  55. package/dist/ui/App.d.ts +1 -0
  56. package/dist/ui/App.js +116 -215
  57. package/dist/ui/BottomStatusRow.d.ts +6 -86
  58. package/dist/ui/BottomStatusRow.js +11 -26
  59. package/dist/ui/Composer.d.ts +16 -83
  60. package/dist/ui/Composer.js +9 -100
  61. package/dist/ui/Logo.d.ts +3 -5
  62. package/dist/ui/Logo.js +4 -8
  63. package/dist/ui/PromptInput.d.ts +4 -1
  64. package/dist/ui/PromptInput.js +44 -35
  65. package/dist/ui/QueuePanel.d.ts +8 -0
  66. package/dist/ui/QueuePanel.js +9 -0
  67. package/dist/ui/QueueStatusRow.d.ts +2 -0
  68. package/dist/ui/QueueStatusRow.js +1 -1
  69. package/dist/ui/StatusBar.d.ts +13 -149
  70. package/dist/ui/StatusBar.js +27 -142
  71. package/dist/ui/capabilities.d.ts +2 -0
  72. package/dist/ui/capabilities.js +6 -0
  73. package/dist/ui/clipboard-task.d.ts +29 -0
  74. package/dist/ui/clipboard-task.js +66 -0
  75. package/dist/ui/clipboard.d.ts +29 -50
  76. package/dist/ui/clipboard.js +141 -75
  77. package/dist/ui/color-runtime.d.ts +5 -0
  78. package/dist/ui/color-runtime.js +29 -0
  79. package/dist/ui/composer-limits.d.ts +3 -4
  80. package/dist/ui/composer-limits.js +4 -9
  81. package/dist/ui/composer-rows.d.ts +1 -1
  82. package/dist/ui/composer-rows.js +24 -137
  83. package/dist/ui/editor-navigation.d.ts +45 -0
  84. package/dist/ui/editor-navigation.js +85 -0
  85. package/dist/ui/editor-reducer.d.ts +4 -0
  86. package/dist/ui/editor-reducer.js +29 -15
  87. package/dist/ui/glyphs.js +10 -8
  88. package/dist/ui/ink-runtime.d.ts +3 -0
  89. package/dist/ui/ink-runtime.js +30 -0
  90. package/dist/ui/interaction-copy.d.ts +77 -0
  91. package/dist/ui/interaction-copy.js +40 -0
  92. package/dist/ui/interaction-hints.d.ts +18 -0
  93. package/dist/ui/interaction-hints.js +92 -0
  94. package/dist/ui/layout/budget.js +1 -1
  95. package/dist/ui/layout/queue-layout.d.ts +19 -0
  96. package/dist/ui/layout/queue-layout.js +26 -0
  97. package/dist/ui/layout/status-layout.d.ts +55 -0
  98. package/dist/ui/layout/status-layout.js +110 -0
  99. package/dist/ui/layout/todo-layout.d.ts +1 -0
  100. package/dist/ui/layout/todo-layout.js +1 -1
  101. package/dist/ui/overlays/HelpOverlay.js +8 -8
  102. package/dist/ui/overlays/ModelProfileEditor.d.ts +12 -0
  103. package/dist/ui/overlays/ModelProfileEditor.js +103 -0
  104. package/dist/ui/overlays/ModelProfilePicker.d.ts +35 -0
  105. package/dist/ui/overlays/ModelProfilePicker.js +167 -0
  106. package/dist/ui/overlays/QueueOverlay.d.ts +22 -0
  107. package/dist/ui/overlays/QueueOverlay.js +79 -0
  108. package/dist/ui/overlays/SettingsScreen.d.ts +9 -2
  109. package/dist/ui/overlays/SettingsScreen.js +347 -3
  110. package/dist/ui/overlays/model-profile-state.d.ts +74 -0
  111. package/dist/ui/overlays/model-profile-state.js +119 -0
  112. package/dist/ui/render-cache.d.ts +2 -2
  113. package/dist/ui/render-cache.js +4 -3
  114. package/dist/ui/run-status-row.d.ts +7 -19
  115. package/dist/ui/run-status-row.js +2 -18
  116. package/dist/ui/selection/selection-controller.d.ts +2 -2
  117. package/dist/ui/selection/selection-controller.js +1 -0
  118. package/dist/ui/use-wheel-routing.js +2 -1
  119. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -7,6 +7,33 @@ were written.
7
7
 
8
8
  ## Unreleased
9
9
 
10
+ ### Consistent TUI styling
11
+
12
+ - Interactive sessions always use Unicode and default to truecolor, including
13
+ PowerShell sessions without terminal or UTF locale markers. Ink's actual color
14
+ output follows the same policy, with renderer state restored on exit.
15
+ - Explicit color opt-outs keep Unicode borders and icons; the opening logo now
16
+ depends only on available space. Headless terminal detection is unchanged.
17
+ - Reloading model settings preserves session display preferences. Syntax
18
+ highlighting follows the same color policy, and status icons use consistent
19
+ single-column glyphs to prevent narrow-frame overflow.
20
+ - Hiding the editor caret while scrolling preserves draft geometry, preventing
21
+ a layout update loop when entering text above the full startup logo.
22
+ - Register exit cleanup before mounting the application, so immediate exits and
23
+ initial render failures restore terminal and color state reliably. Failed
24
+ mounts no longer mark an auto-installed build as healthy.
25
+
26
+ ### Model context window
27
+
28
+ - Discover context limits at startup and after connection changes without blocking
29
+ input. The status bar and compaction use the discovered limit; `/context` names
30
+ API versus catalog metadata. Unknown windows show `?`, not a fabricated 128k
31
+ capacity or percentage. Manual `contextWindow` overrides retain precedence.
32
+ - Window overrides now apply to tail relief and compaction progress as well as
33
+ the gauge. Workers on different models/endpoints do not inherit the lead's
34
+ override. API-key changes refresh metadata, and ending a session cancels its
35
+ pending model queries. `/context` also hides unknown capacities/percentages.
36
+
10
37
  ### TUI 输入与排队可靠性
11
38
 
12
39
  - Shift+Enter 与粘贴按输入顺序处理;普通 Enter 保持弹层兼容,混合输入最多提交一次,
package/README.md CHANGED
@@ -432,8 +432,8 @@ completes, `Up` / `Down` moves the selection, `Esc` closes it.
432
432
 
433
433
  | Key | Action |
434
434
  | --- | --- |
435
- | `Enter` | Submit (idle) / queue a steering message (running) — shown as `Queue: …` until the agent picks it up |
436
- | `Ctrl+J` / `Alt+Enter` / `Shift+Enter` | Insert a newline. `Ctrl+J` and `Alt+Enter` work everywhere; a distinct `Shift+Enter` needs a one-line terminal binding — see [`/terminal-setup`](#terminal-setup) |
435
+ | `Enter` | 空闲时发送,运行时加入队列;收到 Core 已纳入会话的接收凭据后才移除 Queue 提示 |
436
+ | `Ctrl+J` / `Alt+Enter` / `Shift+Enter` | 插入换行。Ctrl+J 已通过输入链路测试;另外两种组合键需要宿主发送独立序列,Alt+Enter 可能被宿主拦截。参见 [终端设置](#terminal-setup-for-shiftenter) |
437
437
  | `Shift+Tab` | Toggle **plan mode** (`BUILD` <-> `PLAN`). Equivalent: `/plan`. On Windows this needs a console flag Node < 22.17 does not set; aragon sets it at startup — see [Requirements](#requirements) |
438
438
  | `Ctrl+P` | The same toggle, over a channel no Windows console can swallow. Use it if `Shift+Tab` does nothing |
439
439
  | `Esc` | Close an overlay or popup; otherwise ask for interruption confirmation. While idle, cancel pending auto-continuation |
@@ -452,7 +452,7 @@ completes, `Up` / `Down` moves the selection, `Esc` closes it.
452
452
  | `Alt/Ctrl+←` / `→` | Word-wise cursor jump |
453
453
  | `Ctrl+W`, `Alt+Backspace` | Delete the previous word |
454
454
  | `Ctrl+U` / `Ctrl+K` | Kill to line start / end |
455
- | `Up` / `Down` | Move between draft lines; recall prompt history at the edges |
455
+ | `Up` / `Down` | 按视觉行移动;空草稿或正在浏览历史时,才在边界召回历史,避免覆盖新草稿 |
456
456
  | Paste | Inserted as-is up to 6 lines / 400 chars; larger collapses to `[Pasted text #1 +15 lines]`, which deletes as one unit and expands in full when you send. `--no-paste` restores the pre-0.6.3 behaviour |
457
457
  | `?` | Open help (empty input) |
458
458
 
@@ -462,7 +462,7 @@ new output automatically; once you scroll away the status bar shows `↑N`, a sl
462
462
  scrollbar occupies the terminal's last column (including 40-column windows). Drag its thumb
463
463
  to move through history, or click the track to move one page. Messages, the team panel
464
464
  and the input area scroll together; typing or editing returns to the input without
465
- losing the draft. The fixed status row shows `PgDn down` while reading history.
465
+ losing the draft. The fixed status row reports the distance from the end while reading history.
466
466
  `PgDn` moves one page down; editing or submitting returns directly to the end.
467
467
 
468
468
  **The mouse wheel is a viewport gesture and nothing else.** Wherever the pointer
@@ -498,10 +498,9 @@ Shift+Enter 与 Enter 都发送为 CR,应用无法区分;请用 `/terminal-s
498
498
  让 Shift+Enter 发送 `\u001b[13;2u`。合并到已有终端配置,不要覆盖其他快捷键;
499
499
  终端拦截某个组合键时可使用另外两种方式。参考绑定如下:
500
500
 
501
- - **Windows Terminal** — `settings.json`, `actions`:
502
- `{ "keys": "shift+enter", "command": { "action": "sendInput", "input": "\u001b[13;2u" } }`
501
+ - **Windows Terminal** — `settings.json` 的 `actions` 与 `keybindings` 分别定义动作和按键;完整示例见下文“输入、待处理队列与底部状态区”。
503
502
  - **VS Code integrated terminal** — `keybindings.json`:
504
- `{ "key": "shift+enter", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[13;2u" } }`
503
+ `{ "key": "shift+enter", "command": "workbench.action.terminal.sendSequence", "when": "terminalFocus", "args": { "text": "\u001b[13;2u" } }`
505
504
  - **iTerm2** — Settings > Profiles > Keys > Key Mappings, `Shift+Enter` ->
506
505
  *Send Escape Sequence* `[13;2u`
507
506
  - **kitty / WezTerm / foot** — native once keyboard-enhancement mode is on
@@ -518,9 +517,9 @@ user-side binding reaches the same result for the one key that needs it.
518
517
 
519
518
  ## Queued messages while the agent runs
520
519
 
521
- Agent 运行中发送的消息会进入队列。固定状态行显示最早待接收消息的首个非空行,
522
- 多条时显示剩余数量;即使转录滚动离开底部,提示仍可见,且没有自动消失的时间限制。
523
- 转录同时保留每条完整消息:
520
+ Agent 运行中发送的消息会进入队列。输入框附近的独立 Queue 面板按顺序显示摘要,
521
+ 限高后显示隐藏条数;固定状态栏始终显示真实待处理总数,没有自动消失的时间限制。
522
+ 使用 `/queue` 分页查看所有消息的完整原文,未接收消息不会在普通转录中重复显示:
524
523
 
525
524
  ```
526
525
  ◷ Queue: also check the tests
@@ -528,11 +527,9 @@ Agent 运行中发送的消息会进入队列。固定状态行显示最早待
528
527
 
529
528
  仅当 Core 将消息写入对话历史并发出对应消息 ID 的接收回执,Queue 状态才移除。
530
529
  这表示引擎已接管后续处理,不表示回答完成;`turn_start`、动画和提示超时都不能代替回执。
531
- 相同正文的两次发送仍是两条消息。中断或失败后尚未接收的消息显示 `Queue (paused)`。
532
-
533
- 窄屏使用 `P>B` / `B>P` 表示待切换模式,`E2` / `E!` 表示两次 Esc 中断 / 再按 Esc 强停,
534
- `S+` / `T+` 表示后台服务 / TODO 存在,`Queue(p)` 表示暂停;`(+99+)` 表示至少还有
535
- 100 条消息。完整服务和 TODO 数量分别可用 `/bg` 与 `/todo status` 查看。
530
+ 相同正文的两次发送仍是两条消息。中断或失败后尚未接收的消息保留并标记暂停。
531
+ 窄屏优先保留运行状态、待处理数量和上下文;其他字段整项隐藏,不截断关键数值。
532
+ 快捷键集中在操作提示行,并随覆盖层、补全、选区和中断确认状态变化。
536
533
 
537
534
  `/clear` 清转录和 TODO,但保留待接收队列。保存和退出会补回被清屏或保留环裁剪的
538
535
  未发送全文。恢复存档时,queued 一律成为 `Queued but never sent: ...` 警告,
@@ -1319,9 +1316,9 @@ The readouts drop as the terminal narrows, in that order of priority:
1319
1316
  either no completed turn has reported usage yet (right after `/resume`, or
1320
1317
  right after a compaction), or tool results have been appended since the last
1321
1318
  measurement and their size is estimated.
1322
- - `?` sits on the **window** and means the *denominator* is a guess: the model is
1323
- not in the built-in table, so a flat 128 000 was substituted. See
1324
- `contextWindow` below.
1319
+ - `?` replaces the **window** when neither the API nor the catalog provides a
1320
+ limit. No percentage is shown in that case. The internal 128 000-token fallback
1321
+ remains a compaction budget, not a claim about model capacity. See `contextWindow` below.
1325
1322
 
1326
1323
  **The percentage keeps moving during a turn.** Every tool result nudges it,
1327
1324
  whether or not compaction is enabled — it is not a compaction feature, and a
@@ -1346,7 +1343,7 @@ Context
1346
1343
  ```
1347
1344
 
1348
1345
  Two lines are worth reading closely. **`Window`** always names where the number
1349
- came from — the model table, your own `contextWindow`, or the invented
1346
+ came from — the model API, the model table, your own `contextWindow`, or the invented
1350
1347
  placeholder — because those are indistinguishable everywhere else. And
1351
1348
  **`Compaction`** reports what is actually true of this session, including
1352
1349
  `off - not registered for this session (started with --no-compaction)`; it never
@@ -1354,13 +1351,21 @@ promises a threshold that nothing will act on.
1354
1351
 
1355
1352
  ### `contextWindow`
1356
1353
 
1357
- When the model is not in the built-in table — a custom `baseUrl`, a self-hosted
1358
- id, something released last week — the denominator is a **fabricated** 128 000
1359
- and the percentage is meaningless. Correct it:
1354
+ Window resolution uses your explicit override first, then API metadata from the
1355
+ configured endpoint, then the built-in catalog (including known aliases and dated
1356
+ snapshots). Startup, connection changes, and subsequent prompts refresh discovery
1357
+ in the background, with a five-minute cache. OpenAI-compatible endpoints may expose
1358
+ `context_length` or `context_window`; Anthropic uses `max_input_tokens`; Google uses
1359
+ `inputTokenLimit`. An ID-only models response cannot establish the real limit.
1360
+ Google/Anthropic lists are paginated (up to 20 pages within one 15-second deadline).
1361
+ Changing the connection or ending the session cancels its pending lookup.
1362
+
1363
+ If neither the endpoint nor the catalog knows your model, the status bar shows `?`.
1364
+ Set a verified provider limit explicitly:
1360
1365
 
1361
1366
  ```bash
1362
1367
  aragon config set contextWindow 1000000 # persisted; prints "Set contextWindow = 1000000"
1363
- aragon config set contextWindow auto # back to the model table / placeholder
1368
+ aragon config set contextWindow auto # back to API discovery / catalog
1364
1369
  ARAGON_CONTEXT_WINDOW=1000000 aragon # one session
1365
1370
  ```
1366
1371
 
@@ -1893,7 +1898,7 @@ env / `.env` → CLI flags**.
1893
1898
  | Config key | Default | Meaning |
1894
1899
  | --- | --- | --- |
1895
1900
  | `maxTokens` | `64000` | Output token cap, clamped to `[256, 200000]`. `null` means **auto** — use each model's own ceiling, never above 64000. Absent means the default. See [Output token limits](#output-token-limits). |
1896
- | `contextWindow` | `null` | The window the context gauge measures against, clamped to `[8000, 5000000]`. `null` means **auto** — the built-in model table, or a fabricated 128000 for a model it has never seen. Set it when the gauge shows `?` on the denominator. See [The context gauge](#the-context-gauge). |
1901
+ | `contextWindow` | `null` | The window the context gauge measures against, clamped to `[8000, 5000000]`. `null` means **auto** — API metadata, then the built-in catalog. Unknown windows show `?`; the internal fallback is 128000. See [The context gauge](#the-context-gauge). |
1897
1902
  | `showThinking` | `false` | Draw the reasoning the model returns. `thinkingLevel` is the effort the provider is asked to **spend**; this is whether the terminal **shows** it. Off by default: a settled turn that thought leaves one muted `thought for 12s` row in its place, so nothing is hidden silently. |
1898
1903
  | `liveToolOutput` | `true` | Draw up to eight sanitised rows of a **running** tool's output on its card, plus a `no output for Ns` row when the child goes quiet. On by default, unlike `showThinking`: this ADDS the information a long `bash` call otherwise hides, and its cost is bounded by construction — eight rows per call, sixteen calls, whatever the command emits. Turn it off and the card is a single `running` row again, with no store allocated and no recorder attached. |
1899
1904
  | `exitTranscript` | `true` | Replay a plain-text session summary after exiting (full-screen only). |
@@ -1971,7 +1976,7 @@ aragon config set maxTokens 32000 # persisted; prints "Set maxTokens = 32000"
1971
1976
  aragon config set maxTokens auto # persisted as null
1972
1977
  aragon config set maxTokens default # back to 64000
1973
1978
  aragon config set contextWindow 1000000 # the gauge's denominator
1974
- aragon config set contextWindow auto # back to the model table
1979
+ aragon config set contextWindow auto # back to API discovery / catalog
1975
1980
  aragon config get maxTokens # "64000" | "auto"
1976
1981
  ```
1977
1982
 
@@ -2275,12 +2280,15 @@ quiet output is required.
2275
2280
  `--theme` / `config.theme` / `/theme` pick a palette: `warm`, `cool`, `light`, or
2276
2281
  `auto` (which resolves to `warm` — terminals can't reliably report their
2277
2282
  background). `dark` remains accepted everywhere as an alias for `cool`.
2278
- Colors degrade automatically to your terminal's depth (truecolor → 256 → 16 →
2279
- monochrome) and glyphs fall back to ASCII on terminals without Unicode. Color is
2280
- disabled — and the UI renders plain monochrome with ASCII glyphs — when any of
2281
- `NO_COLOR`, `--no-color`, `TERM=dumb`, or `config.color=false` is set; `FORCE_COLOR`
2282
- is respected. `reducedMotion` (also `ARAGON_REDUCED_MOTION`, and implied by
2283
- `--no-color`) replaces spinners with a static glyph.
2283
+ Interactive sessions always use Unicode borders, icons and scrollbars, with
2284
+ truecolor and gradients by default. Missing terminal/locale markers, `TERM=dumb`,
2285
+ and low `FORCE_COLOR` levels do not simplify the TUI. `--no-color`, `NO_COLOR`
2286
+ (including an empty value), or `FORCE_COLOR=0/false` explicitly disable color;
2287
+ Unicode stays enabled. The opening logo adapts only to available space and
2288
+ remains visible in monochrome. `reducedMotion` (also `ARAGON_REDUCED_MOTION`,
2289
+ and implied by disabling color) replaces spinners with a static glyph.
2290
+ Headless commands retain their existing terminal detection. The terminal and
2291
+ font still need to support the characters and colors the TUI emits.
2284
2292
 
2285
2293
  ### Timeout invariant
2286
2294
 
@@ -2345,3 +2353,72 @@ UTF-16 编辑和 ZWJ/组合字形仍有既有限制,本次修复保证视觉
2345
2353
  检查流式输出不阻止闪烁;单 ESC 不停止任务,两击中断,卡住时第三击强停;菜单关闭不计入两击。
2346
2354
  任务结束后保留最终计划,下一条普通消息启动时旧计划消失,新有效计划出现才恢复;显式续跑保留计划。
2347
2355
  强停后立即提交,在等待中双 ESC 取消,旧引擎退出后不得自行执行已取消的消息。
2356
+
2357
+ ## 输入、待处理队列与底部状态区
2358
+
2359
+ Enter 在空闲时发送,运行时加入队列;启动阶段拒绝重复提交并保留草稿。
2360
+ Ctrl+J 换行;终端能发送独立序列时,Shift+Enter 与 Alt+Enter 也可换行。
2361
+ 光标按完整字素移动,支持中文、组合字符和 emoji;输入最多占终端高度四分之一且不超过六行。
2362
+ 括号粘贴保留换行,不触发发送。过滤器或粘贴支持关闭时,不保证未标记多行粘贴安全。
2363
+ 过滤器不可用时 Delete 保守按 Backspace 处理,避免退格误删后文。
2364
+
2365
+ 应用鼠标拖选只建立选区,Ctrl+C 才复制;复制中再次按 Ctrl+C 不会退出或停止服务。
2366
+ 原生剪贴板工具完成后显示确认,OSC 52 只表示请求已发送,终端可能拒绝。
2367
+ Shift+拖动或 `/mouse off` 后的选区由宿主管理,应用无法关闭宿主的自动复制。
2368
+
2369
+ Queue 面板逐条显示待处理消息,数量始终留在状态栏。只有 Core 已把消息纳入会话并发回接收凭据,
2370
+ 该条提示才会消失。中断时未接收消息显示暂停;`/queue` 可分页查看全部原文,Esc 关闭。
2371
+ `/clear` 不丢待处理消息;`/reset`、切换会话会明确报告取消数量;恢复保存的未发送历史不会自动重发。
2372
+
2373
+ 底部依次为输入框、固定操作提示/短反馈行、全局状态栏。状态字段按显示宽度完整保留或整项隐藏。
2374
+ 上下文表示当前主 Agent 的已用/上限 tokens;`~` 表示含估算,`?` 表示上限未知。
2375
+ 费用是含子代理、快速模型及压缩的会话估算 USD,恢复会话沿用累计,缺价格按零计,零值不保证免费。
2376
+ 本轮均速是本轮期间入账输出 token 增量除以耗时,可能包含上述辅助调用,并非瞬时生成速度。
2377
+ `/context` 提供统计范围和完整值。
2378
+
2379
+ Windows Terminal:在设置 JSON **根级**添加 `"copyOnSelect": false`,把以下条目合并到已有数组:
2380
+
2381
+ ```json
2382
+ {
2383
+ "actions": [{ "id": "User.AragonNewline", "command": {
2384
+ "action": "sendInput", "input": "\u001b[13;2u"
2385
+ } }],
2386
+ "keybindings": [{ "keys": "shift+enter", "id": "User.AragonNewline" }]
2387
+ }
2388
+ ```
2389
+
2390
+ 依据:[Windows Terminal 交互设置](https://learn.microsoft.com/en-us/windows/terminal/customize-settings/interaction)、
2391
+ [按键动作](https://learn.microsoft.com/en-us/windows/terminal/customize-settings/actions)。PowerShell 是 shell,不能在其 profile 中设置终端按键映射。
2392
+
2393
+ VS Code 用户设置添加 `"terminal.integrated.copyOnSelection": false`,快捷键 JSON 添加:
2394
+
2395
+ ```json
2396
+ {
2397
+ "key": "shift+enter", "command": "workbench.action.terminal.sendSequence",
2398
+ "when": "terminalFocus", "args": { "text": "\u001b[13;2u" }
2399
+ }
2400
+ ```
2401
+
2402
+ 依据:[终端基础](https://code.visualstudio.com/docs/terminal/basics)、
2403
+ [终端高级设置](https://code.visualstudio.com/docs/terminal/advanced)。应用的 `/terminal-setup` 只输出说明,不修改宿主配置。
2404
+ 若宿主把 Shift+Enter 或 IME 候选确认同样编码为 CR,应用无法从相同字节推断用户意图。
2405
+ 可使用经输入链路测试的 Ctrl+J、独立 CSI-u 绑定及外部编辑后括号粘贴;具体宿主组合仍需实测。
2406
+ 双宿主、微软拼音及持续流式性能验收状态见 `docs/plans/tui-composer-queue-status/manual-test.md`。
2407
+
2408
+ ## 多套模型配置
2409
+
2410
+ 在 `/settings` 中使用 **Main profile** 和 **Fast profile**,可以分别为主任务与快速模型选择已保存的方案。两种角色共享配置库,但各自选择互不影响,也可以选择同一个方案。**Manage profiles** 提供新建、编辑、复制和删除;名称留空时采用模型名。同名方案通过地址主机和唯一 ID 区分。超过八条时按 `/` 搜索名称、模型或服务商。
2411
+
2412
+ 上下方向键或 Tab 移动,Enter 选择或编辑,根设置页 Ctrl+S 保存。普通文本字段的 Enter 仍保存设置。选择和子表单的修改先进入草稿;Esc 返回或确认丢弃。被主模型或快速模型引用的方案必须先解除绑定才能删除。复制包含本轮已经编辑的凭据,并产生新的 ID。
2413
+
2414
+ 方案保存服务商、模型、地址和凭据,不改变思考级别、token 上限、快速评审频率或预算。选择快速模型方案不会自动启用快速层。若本次启动时快速层未注册,首次启用会提示“已保存,待重启”;缺少模型或凭据时也需要先补齐。
2415
+
2416
+ **Current custom** 保留旧式连接,可继续编辑原连接字段。创建方案时从磁盘上的旧式配置预填,不复制环境变量或 `--api-key` 的运行时密钥。专属密钥可保持、替换或切换为共享/环境凭据;修改服务商或地址后,必须明确选择保留原密钥,或重新输入。空地址在方案中表示服务商默认地址,快速方案不会继承主网关。
2417
+
2418
+ 启动优先级为 CLI 参数、环境变量、所选方案、旧式字段、默认值。界面显示启动覆盖;明确重新选择方案可对本次会话立即生效,重启仍遵循启动参数。专属密钥仅对对应角色和目标地址生效;主模型启动密钥不会跟随切换发往另一个网关。
2419
+
2420
+ 运行、团队任务、后台评审或压缩尚未结束时禁止保存。保存采用原子文件替换,同时检查磁盘与当前会话版本;失败保留草稿,发生冲突时选择 Reload settings。写入已成功但会话应用异常时会明确提示重启并禁用重复保存。跨进程版本检查属于乐观检查,不能消除同时写入的极小竞态。
2421
+
2422
+ `/model`、`/fast model` 和 `config set` 修改连接会回到对应角色的自定义配置。若解除绑定会丢失专属账户或默认地址语义,命令会拒绝并引导到设置中编辑或复制。`/reload` 会一起刷新两个角色的连接和凭据,保留对话与用量。
2423
+
2424
+ 配置库仍位于 `ARAGON_HOME` 指向目录中的 `config.json`,不写入会话文件。密钥按现有机制明文保存:POSIX 创建权限为 0600,Windows 依赖用户目录 ACL,不提供加密。`config get/list` 对方案密钥使用固定掩码;损坏或未来版本的配置段整体隐藏。既有 `config edit` 备份也包含凭据。关闭通用日志脱敏、使用短密钥或分享第三方 SDK 错误日志时,仍需自行检查日志内容。
@@ -1,3 +1,5 @@
1
+ import { type ModelSettingsSnapshot } from './model-profile-settings.js';
2
+ import type { ModelSettingsDraft, ModelSettingsPatch, ModelSettingsSaveResult } from '../config/model-profile-store.js';
1
3
  /**
2
4
  * AgentController — builds the core `Agent`, wires the built-in toolset, and
3
5
  * exposes a small run/abort/steer surface plus the pre-flight validation that
@@ -11,6 +13,7 @@
11
13
  import type { PromptOptions, PromptOutcome } from './prompt-options.js';
12
14
  import { ModelRegistry, type AgentEvent, type AgentTool, type Message, type ModelInfo, type ModelRef, type ProviderRegistry, type ThinkingLevel } from '@aragon-agent/core';
13
15
  import type { CliConfig, CompactionConfig, FastConfig, RetryConfig, TeamConfig, ThemeName, TodoConfig } from '../config/schema.js';
16
+ import type { ModelRole } from '../config/model-profiles.js';
14
17
  import { type ConfirmRequest } from '../tools/index.js';
15
18
  import type { ToolPermission } from '../exec/permission.js';
16
19
  import { type ToolOutputListener } from '../tools/tool-output-store.js';
@@ -120,6 +123,10 @@ export declare class AgentController {
120
123
  private readonly agent;
121
124
  private readonly providerRegistry;
122
125
  private readonly modelRegistry;
126
+ private modelMetadataEnabled;
127
+ private modelMetadataGeneration;
128
+ private modelMetadataAbort;
129
+ private disposed;
123
130
  private readonly tools;
124
131
  private readonly skills;
125
132
  private readonly skillsEnabled;
@@ -180,6 +187,9 @@ export declare class AgentController {
180
187
  private readonly outputListeners;
181
188
  private readonly fast;
182
189
  private readonly compaction;
190
+ private settingsRevision;
191
+ private modelSettingsBlocked;
192
+ private preparedSystemPrompt;
183
193
  private readonly contextMeter;
184
194
  private readonly procs;
185
195
  /**
@@ -249,7 +259,7 @@ export declare class AgentController {
249
259
  * Read-only CLI-layer helper for the Header/Welcome key-status dot (P1-1);
250
260
  * does not touch `@aragon-agent/core`.
251
261
  */
252
- hasApiKey(provider?: string): boolean;
262
+ hasApiKey(provider?: string, role?: ModelRole): boolean;
253
263
  /**
254
264
  * Set the color theme live. Mirrors the `setModel` / `setThinkingLevel`
255
265
  * mutator pattern — a subsequent re-render re-reads `getConfig().theme` and
@@ -524,6 +534,28 @@ export declare class AgentController {
524
534
  * the runtime nor the file.
525
535
  */
526
536
  setRetryConfig(patch: Partial<RetryConfig>): RetryConfig;
537
+ /** True while any request can still use a model or credential snapshot. */
538
+ isModelSettingsBusy(): boolean;
539
+ /** Monotonic revision protects an editor from all intervening settings changes. */
540
+ getSettingsRevision(): number;
541
+ /** Read-only draft creation; no startup migration or credential copying. */
542
+ createModelSettingsDraft(): ModelSettingsDraft;
543
+ /** Save an explicit draft as a single disk/live transaction. */
544
+ saveModelSettings(draft: ModelSettingsDraft): ModelSettingsSaveResult;
545
+ /** Legacy commands share the same lossless conversion and atomic save path. */
546
+ saveModelSettingsPatch(patch: ModelSettingsPatch): ModelSettingsSaveResult;
547
+ /** Refresh both role connections and credentials while retaining conversation state. */
548
+ reloadModelSettings(): ModelSettingsSaveResult;
549
+ /** Prebuild all potentially failing model/prompt work before committing the file. */
550
+ prepareModelSettingsSnapshot(config: CliConfig): ModelSettingsSnapshot;
551
+ /** Apply prepared state synchronously, without rebuilding the controller or its history. */
552
+ applyModelSettingsSnapshot(snapshot: ModelSettingsSnapshot): void;
553
+ /** Potentially failing ordinary-setting side effects are isolated from model application. */
554
+ applyModelSettingsEffects(): void;
555
+ /** A partially applied model snapshot must never reach another provider request. */
556
+ blockModelSettingsRequests(): void;
557
+ /** The UI uses this before accepting or draining queued prompts. */
558
+ areModelSettingsBlocked(): boolean;
527
559
  setModel(provider: string, model: string, baseUrl?: string): void;
528
560
  setThinkingLevel(level: ThinkingLevel): void;
529
561
  setMaxTokens(value: number | undefined): void;
@@ -580,7 +612,11 @@ export declare class AgentController {
580
612
  * cost table for the model that actually billed" cannot drift from "the cost
581
613
  * table for the session's model" as two separate bodies.
582
614
  */
583
- getModelInfoFor(ref: Pick<ModelRef, 'providerId' | 'modelId'>): ModelInfo;
615
+ getModelInfoFor(ref: Pick<ModelRef, 'providerId' | 'modelId' | 'baseUrl'>): ModelInfo;
616
+ /** Best-effort metadata lookup; never block typing or a model request. */
617
+ refreshModelMetadata(): Promise<void>;
618
+ /** Invalidate an old connection without restarting a lookup on every prompt. */
619
+ private resetModelMetadataRequest;
584
620
  /**
585
621
  * Whether the STATIC table knows this model's price (C-11 / RV-4).
586
622
  *