u-foo 4.0.0 → 4.0.2

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 (158) hide show
  1. package/OBSERVABILITY.md +65 -0
  2. package/README.md +90 -30
  3. package/README.zh-CN.md +76 -26
  4. package/SKILLS/ufoo/SKILL.md +25 -1
  5. package/SKILLS/ufoo-bus/SKILL.md +25 -2
  6. package/bin/ucode.js +4 -0
  7. package/bin/ufoo.js +3 -3
  8. package/dist/tui/darwin-arm64/ufoo-tui +0 -0
  9. package/dist/tui/darwin-x64/ufoo-tui +0 -0
  10. package/dist/tui/linux-arm64/ufoo-tui +0 -0
  11. package/dist/tui/linux-x64/ufoo-tui +0 -0
  12. package/package.json +6 -6
  13. package/src/agents/activity/activityDetector.js +1 -1
  14. package/src/agents/capabilities/agentManagement/service.js +40 -13
  15. package/src/agents/capabilities/coordination/index.js +1 -1
  16. package/src/agents/capabilities/taskReports/index.js +1 -1
  17. package/src/agents/controller/controllerToolExecutor.js +36 -20
  18. package/src/agents/controller/index.js +1 -6
  19. package/src/agents/internal/internalRunner.js +90 -56
  20. package/src/agents/launch/index.js +0 -1
  21. package/src/agents/launch/launcher.js +38 -29
  22. package/src/agents/launch/launcherReadiness.js +35 -0
  23. package/src/agents/launch/notifier.js +2 -2
  24. package/src/agents/launch/ptyWrapper.js +5 -2
  25. package/src/agents/launch/readyDetector.js +2 -2
  26. package/src/agents/profiles/main.js +1 -1
  27. package/src/agents/prompts/cooperation.js +14 -0
  28. package/src/agents/prompts/defaultBootstrap.js +1 -1
  29. package/src/agents/prompts/groupBootstrap.js +23 -7
  30. package/src/agents/prompts/mainAgent.js +11 -2
  31. package/src/agents/prompts/native/system.js +4 -1
  32. package/src/agents/prompts/native/ufoo.js +11 -3
  33. package/src/agents/prompts/promptProfiles.js +2 -0
  34. package/src/agents/prompts/reporting.js +16 -0
  35. package/src/agents/providers/claudeEventTranslator.js +3 -0
  36. package/src/agents/providers/claudeThreadProvider.js +3 -2
  37. package/src/agents/providers/clientIdentity.js +75 -0
  38. package/src/agents/providers/codexEventTranslator.js +23 -2
  39. package/src/agents/providers/codexThreadProvider.js +15 -6
  40. package/src/agents/providers/credentials/index.js +2 -0
  41. package/src/agents/providers/directAuthStatus.js +1 -1
  42. package/src/agents/providers/index.js +1 -1
  43. package/src/agents/providers/modelSettings.js +34 -0
  44. package/src/agents/providers/modelsCatalog.js +379 -0
  45. package/src/agents/providers/nativeTransport.js +58 -40
  46. package/src/agents/providers/runtimeConfig.js +10 -8
  47. package/src/agents/providers/thinkingLevels.js +10 -36
  48. package/src/agents/providers/transports/responsesProtocol.js +11 -6
  49. package/src/agents/providers/upstreamRuntime.js +135 -0
  50. package/src/agents/runtime/context/checkpointStore.js +38 -0
  51. package/src/agents/runtime/context/compaction.js +151 -0
  52. package/src/agents/runtime/context/contextBudget.js +93 -0
  53. package/src/agents/runtime/context/replayHistory.js +28 -0
  54. package/src/agents/runtime/context/runtimeStore.js +2 -1
  55. package/src/agents/runtime/core/agentLoop.js +99 -18
  56. package/src/agents/runtime/core/executionBudget.js +36 -0
  57. package/src/agents/runtime/createAgentRuntime.js +16 -4
  58. package/src/agents/runtime/prompts/responseLanguage.js +12 -0
  59. package/src/agents/runtime/protocol/runObservation.js +24 -0
  60. package/src/agents/runtime/protocol/traceContext.js +9 -0
  61. package/src/app/chat/ChatController.js +26 -53
  62. package/src/app/chat/agentDirectory.js +1 -16
  63. package/src/app/chat/bootstrap.js +1 -2
  64. package/src/app/chat/commandExecutor.js +93 -285
  65. package/src/app/chat/commands.js +32 -45
  66. package/src/app/chat/daemonMessageRouter.js +0 -45
  67. package/src/app/chat/historyStore.js +12 -48
  68. package/src/app/chat/inputSubmitHandler.js +7 -33
  69. package/src/app/chat/internalAgentLogHistory.js +19 -60
  70. package/src/app/chat/multiWindow/paneManager.js +10 -3
  71. package/src/app/chat/streamState.js +0 -4
  72. package/src/app/cli/features/init.js +5 -5
  73. package/src/app/cli/metricsCommands.js +68 -0
  74. package/src/app/cli/run.js +42 -3
  75. package/src/app/cli/traceCommands.js +36 -0
  76. package/src/code/agent.js +18 -13
  77. package/src/code/busConsumer.js +1 -3
  78. package/src/code/commands.js +1 -1
  79. package/src/code/context/assembler.js +7 -8
  80. package/src/code/context/stateCommit.js +2 -1
  81. package/src/code/internalThread.js +10 -3
  82. package/src/code/launcher/ucode.js +1 -1
  83. package/src/code/launcher/ucodeBootstrap.js +1 -1
  84. package/src/code/modelCommand.js +11 -35
  85. package/src/code/nativeRunner.js +55 -17
  86. package/src/code/providers/modelsCatalog.js +1 -317
  87. package/src/code/repl.js +4 -11
  88. package/src/code/sessionStore.js +3 -3
  89. package/src/code/taskDecomposer.js +18 -0
  90. package/src/code/toolBudget.js +1 -17
  91. package/src/config.js +22 -72
  92. package/src/coordination/bus/index.js +12 -3
  93. package/src/coordination/bus/inject.js +2 -2
  94. package/src/coordination/bus/message.js +15 -1
  95. package/src/coordination/bus/nickname.js +1 -1
  96. package/src/coordination/bus/subscriber.js +3 -2
  97. package/src/coordination/bus/utils.js +1 -1
  98. package/src/coordination/history/agentPerformance.js +279 -0
  99. package/src/coordination/history/agentTrace.js +249 -0
  100. package/src/coordination/state/workspaceAccess.js +1 -1
  101. package/src/orchestration/controller/index.js +1 -8
  102. package/src/orchestration/controller/launchRouting.js +1 -1
  103. package/src/orchestration/solo/commands.js +3 -1
  104. package/src/runtime/contracts/agentMode.js +11 -2
  105. package/src/runtime/contracts/uiProtocol.js +18 -19
  106. package/src/runtime/daemon/agentHost.js +57 -25
  107. package/src/runtime/daemon/agentRecoveryGroups.js +70 -0
  108. package/src/runtime/daemon/busBridge.js +1 -1
  109. package/src/runtime/daemon/controlPlaneService.js +1 -1
  110. package/src/runtime/daemon/groupOrchestrator.js +20 -5
  111. package/src/runtime/daemon/groupStatus.js +20 -0
  112. package/src/runtime/daemon/index.js +19 -44
  113. package/src/runtime/daemon/mcpHttpServer.js +39 -10
  114. package/src/runtime/daemon/mcpServer.js +1 -1
  115. package/src/runtime/daemon/nicknameScope.js +1 -1
  116. package/src/runtime/daemon/ops.js +46 -23
  117. package/src/runtime/daemon/projectRuntimeGateway.js +2 -0
  118. package/src/runtime/daemon/promptRequest.js +92 -589
  119. package/src/runtime/daemon/status.js +5 -6
  120. package/src/tools/controllerSchemas.js +6 -2
  121. package/src/tools/handlers/tier2.js +4 -2
  122. package/src/tools/registry.js +4 -0
  123. package/src/tools/schemaFixtures.js +26 -2
  124. package/src/tools/tier0/readAgentMetrics.js +14 -0
  125. package/src/tools/tier0/readAgentTrace.js +12 -0
  126. package/src/ui/agentSettingsController.js +107 -0
  127. package/src/ui/agentSurface.js +1 -1
  128. package/src/ui/dashboardBridge.js +1 -1
  129. package/src/ui/format/banner.js +1 -4
  130. package/src/ui/format/index.js +14 -10
  131. package/src/ui/format/loopSummary.js +50 -0
  132. package/src/ui/format/markdownRenderer.js +3 -4
  133. package/src/ui/rustChatHost.js +191 -206
  134. package/src/ui/rustMultiSession.js +77 -36
  135. package/src/ui/rustUcodeHost.js +6 -1
  136. package/src/ui/settingsBridge.js +33 -16
  137. package/src/ui/toolMergeBridge.js +0 -4
  138. package/src/ui/uiHostServer.js +5 -8
  139. package/src/agents/controller/loopObservability.js +0 -200
  140. package/src/agents/controller/loopRuntime.js +0 -336
  141. package/src/agents/controller/ufooAgent.js +0 -830
  142. package/src/agents/launch/ptyRunner.js +0 -1135
  143. package/src/agents/providers/controllerJsonTransport.js +0 -28
  144. package/src/agents/providers/upstreamTransport.js +0 -698
  145. package/src/app/chat/agentBar.js +0 -135
  146. package/src/app/chat/agentSockets.js +0 -225
  147. package/src/app/chat/dashboardView.js +0 -405
  148. package/src/app/chat/rawKeyMap.js +0 -42
  149. package/src/app/chat/settingsController.js +0 -111
  150. package/src/coordination/history/controllerSummary.js +0 -23
  151. package/src/orchestration/controller/flags.js +0 -167
  152. package/src/orchestration/controller/gateRouter.js +0 -211
  153. package/src/orchestration/controller/routerFastPath.js +0 -22
  154. package/src/orchestration/controller/routerFinalize.js +0 -222
  155. package/src/orchestration/controller/shadowGuard.js +0 -280
  156. package/src/runtime/daemon/executionPaths.js +0 -30
  157. package/src/runtime/daemon/promptLoop.js +0 -136
  158. package/src/runtime/privacy/shadowDiff.js +0 -174
@@ -0,0 +1,65 @@
1
+ # ufoo agent 表现观测
2
+
3
+ 观测用于定位行为、建立基线和比较优化前后的表现。执行完成、worker 报告完成和主 agent 验收通过是三个不同的事实,不合并成一个“成功率”。指标不自动判断代码质量,也不触发重试、投递、消费消息或验收。
4
+
5
+ ## 使用
6
+
7
+ ```sh
8
+ # 当前项目汇总;完全本地查询,无模型请求,也不启动 daemon
9
+ ufoo metrics
10
+
11
+ # 查一个任务及其子任务,或一个 agent
12
+ ufoo metrics <task-id> --json
13
+ ufoo metrics --agent reviewer --json
14
+
15
+ # 时间窗口按运行开始时间选择,保留选中运行的完整可见生命周期
16
+ ufoo metrics --since 2026-10-11T00:00:00Z --until 2026-10-12T00:00:00Z --json
17
+
18
+ # 保存基线、之后比较
19
+ ufoo metrics --json > baseline.json
20
+ ufoo metrics --baseline baseline.json --json > comparison.json
21
+
22
+ # 从汇总定位到过程和经过脱敏的工具参数/结果
23
+ ufoo trace <task-id> --details --json
24
+ ufoo trace --agent reviewer --follow --json
25
+ ```
26
+
27
+ MCP 提供只读 `read_agent_metrics`;`read_agent_trace` 的结果及 JSONL follow 状态也包含表现汇总。指标与 trace 来自同一批 journal、worker surface、报告和队列。分页只限制返回的运行记录:默认最近 20 条,`--limit` 最大 100,汇总使用全部已读取且匹配的运行。Trace 附带汇总不返回完整运行列表。
28
+
29
+ ## 指标口径
30
+
31
+ | 维度 | 观测内容 | 解释 |
32
+ |---|---|---|
33
+ | 执行 | completed、failed、cancelled、interrupted、running、waiting_user、queued | 每个 taskRunId 只计一次;恢复后续执行仍属于原运行。completedOfFinished 的分母只包括四种结束状态。 |
34
+ | 响应 | 排队、首段文字、首段思考摘要、总耗时、活动时间、等待用户时间 | 时间单位为毫秒;首段文字是已观察到的文本输出,不保证是给用户的最终回复。缺失起点/终点返回 null。 |
35
+ | 模型 | 主模型调用、SDK turns、失败、空回复重试、上下文溢出重试、自动续跑 | SDK 内部 HTTP 次数不可见,不推算。模型阶段与工具阶段累计耗时是服务时间,不能当作互不重叠的总耗时分解。 |
36
+ | 工具 | 执行、错误、执行异常、校验拒绝、未配对调用、相同工具参数重复、loop guard 警告/停止 | 执行异常单独计数并保留副作用未知的状态。同参数重复是调查线索,合法轮询或重读也可能重复。进行中的工具及等待用户的工具可以暂时未配对;这不等于失败。 |
37
+ | 用量 | input、output、cacheRead、cacheCreation | 按已有 provider 解析器的字段语义分别汇总,不把 SDK/API 数据或缓存字段重复相加。未回传 usage 不按零计算。部分回传仅汇总可见部分,并标出完整用量覆盖率;不估算费用。 |
38
+ | 缓存 | cache.hitRate、cachedTokens、promptTokens、样本和完整覆盖率 | 按 tokens 加权:命中 tokens 总量 / 同批样本的输入总量。OpenAI 的输入总量已含缓存;Anthropic 的分母为 input + cacheRead + cacheCreation。缺少缓存字段或无法确定输入口径的样本不参加缓存率计算;明确回传 cached_tokens=0 才能作为零命中样本。压缩缓存另列 compactionCache。 |
39
+ | 压缩 | 尝试、完成、失败、耗时、压缩调用用量 | 压缩用量单独放在 compactionUsage,避免藏在主模型用量里。 |
40
+ | 协作 | 委派数、报告数、待验收、accepted、rejected、投递不确定、报告到验收延迟 | acceptedOfReviewed = accepted / (accepted + rejected);没有验收样本时为 null。不会用 done 报告代替 accepted。 |
41
+ | 输出 | 流式文字量、最终回复长度、报告长度 | 按 Unicode 字符计数;报告超过协议默认 600 字符会出现 long_report 线索。最终回复与过程流分开计数。 |
42
+ | 活动 | 最后事件距今时间、队列年龄 | running 五分钟无可见事件会标出线索;模型/SDK 可能仍在工作,不自动判定卡死。排队耗时只来自 request.accepted 或精确匹配的 bus sequence。 |
43
+
44
+ 每个运行记录包含 provider、model、thinking、ufoo 版本、执行循环/SDK runner 指纹、实际提示词和工具 schema 指纹、输入指纹,以及请求类型。主 agent 区分用户请求、worker 报告唤醒、独立编码任务和任务结果唤醒;无法辨认的来源保留 unknown。面板 worker 区分已指派任务和其他 bus 消息。配置记录只保留这些元数据和指纹,不新增凭据、header、URL 或提示词正文。
45
+
46
+ Provider/model、thinking、版本、执行引擎指纹、请求类型形成 cohort,API 与 SDK 分开聚合。提示词指纹包含运行时上下文,适合查明某次运行实际用了哪份输入,不应当作稳定实验分组。引擎指纹覆盖共享循环或 SDK runner 函数,不能代表整个仓库或 SDK 内部实现;依赖或其他 host/capability 改动仍需保存源码版本。
47
+
48
+ ## 后续优化方法
49
+
50
+ 1. 选一组固定的开发任务,保存任务说明、仓库起点、预期产物和验证命令;同时覆盖直接编码、委派、group、错误纠正和长会话。
51
+ 2. 固定模型、thinking、凭据来源和任务环境;运行后保存 metrics JSON、精确任务的 trace,以及代码 diff 和验证结果。
52
+ 3. 一次改一个变量,例如系统提示词、路由策略、报告约束或压缩策略;复跑同一任务集。
53
+ 4. 对比验收、错误和重复行为,再看耗时、用量及输出长度;同时人工检查真实产物。快、少 tokens 或短报告本身不代表质量提高。
54
+
55
+ `--baseline` 输出指标差值和变化比例;不同任务、样本量、模型或不完整来源可能影响结果,因此它是观测差异,不是因果结论。没有真实质量评分或独立验收的数据,不生成质量评分。
56
+
57
+ 缓存统计同时出现在 CLI、JSON、MCP 和各个 cohort。缓存率只使用同时具备命中量和可确定输入总量的样本,旁边显示样本覆盖情况。基线缓存率比较要求双方所有运行具有完整缓存观测,否则差值保留 null。Responses API 读取 `usage.input_tokens_details.cached_tokens`,Chat Completions 读取 `usage.prompt_tokens_details.cached_tokens`;写缓存 tokens 计入 cacheCreation,不当作缓存命中。指标口径参考 [OpenAI 官方缓存文档](https://developers.openai.com/api/docs/guides/prompt-caching)。旧解析器遗漏后写成零的日志无法还原真实命中量;修复作用于新请求。
58
+
59
+ ## 数据与边界
60
+
61
+ 源数据使用已有 `.ufoo/agent/*/runtimes/*/events.jsonl`、bus surface、`reports.jsonl` 和活动队列,不引入第二份可变执行状态。旧日志仍可查询,缺少配置、身份关联或生命周期时使用 unknown/null 和 coverage;不补造旧事件。queues 是查询当下的待处理/已领取消息快照,不是时间窗口内的历史队列重建,provider/model 过滤也不改变这份快照。
62
+
63
+ 查询沿用 trace 的读取限制:最多 200 个 runtime journal、14 个 bus 日文件、每文件 2 MiB、总计 32 MiB。截断、损坏记录和读取失败会出现在 warnings/incomplete;指标仅代表已读取的样本。最多返回 100 个 cohort,超出时同样告知。没有事件的项目也不被初始化或修复。
64
+
65
+ 源代码入口:`src/agents/runtime/protocol/runObservation.js` 生成配置指纹;共享循环和 internal runner 写既有观测事件;`src/coordination/history/agentTrace.js` 读取并归一化;`agentPerformance.js` 计算指标;`src/app/cli/metricsCommands.js` 与共享 MCP 工具提供查询。
package/README.md CHANGED
@@ -287,9 +287,9 @@ tasks. The global profile selects projects before coding begins. Long tasks run
287
287
  in the daemon; disconnecting chat does not cancel them, and reconnecting replays
288
288
  runtime events.
289
289
 
290
- Existing controller conversations retain their executor. Use `/session new` to
291
- start a main conversation with current settings; existing provider/model bindings
292
- stay pinned. A crash during an active round marks it interrupted: inspect actual
290
+ All main conversations use the shared runtime. Use `/session new` to start a
291
+ conversation with current settings; existing provider/model bindings stay pinned.
292
+ A crash during an active round marks it interrupted: inspect actual
293
293
  effects before resubmitting. Writes, shell commands, launches, and uncertain
294
294
  deliveries are not automatically replayed. Managed writers share directory
295
295
  leases; verified git worktrees can run independently. These checks are not an OS
@@ -312,42 +312,59 @@ sandbox for shell commands. See the [runtime implementation record](AGENT_RUNTIM
312
312
  /session show
313
313
  /session new
314
314
  /settings
315
- /multi
316
- /multi on
317
- /multi off
318
- /multi @reviewer
319
- /resume list
315
+ /window main
316
+ /window side
317
+ /window multi
318
+ /resume
320
319
  /project list
321
320
  /project switch 2
322
321
  /open /path/to/project
323
322
  ```
324
323
 
325
- The dashboard keeps three layouts: main agent only, main plus one selected
326
- internal agent, and main plus all internal agents. Wrapper and MCP agents stay
324
+ The dashboard keeps three layouts: `main` (main agent only), `side` (main plus
325
+ one selected internal agent), and `multi` (main plus all internal agents). Wrapper and MCP agents stay
327
326
  outside the dashboard. Dashboard child launches use internal mode and never
328
327
  open an external terminal. A project with no chat or input history shows the
329
328
  existing compact ufoo banner as its welcome screen.
330
- `/multi` or `Ctrl+T` toggles the all-agent layout; from a single-agent layout it
331
- expands to all agents. `/multi @reviewer` opens just that internal agent.
332
- `Ctrl+M` opens the all-agent layout and leaves it open when pressed again.
333
- It requires a terminal that reports modified keys separately from Enter; the
334
- dashboard requests the enhanced keyboard protocol automatically. In legacy
335
- terminals where Ctrl+M and Enter share the same encoding, Enter keeps submitting
336
- input and `/multi` or `Ctrl+T` remains available.
337
- In either split layout, `Esc` first returns child focus to the main agent;
338
- when the main agent has focus, `Esc` closes the split. Drafts and running tasks
339
- are preserved. `Ctrl+Q` or `/multi off` closes either split directly.
340
- At the main-only root, `Esc` never exits the application; use `Ctrl+C`.
329
+ `Ctrl+W` cycles `main → side → multi → main`.
330
+ `/window main`, `/window side` and `/window multi`
331
+ select each layout directly. The one-child layout selects the most recently
332
+ activated live internal agent, or the first agent when none has been activated.
333
+ With no children, split modes remain selected while showing only the full-width
334
+ main pane; new children appear automatically when they become available.
335
+ When the input has focus and contains text, `Ctrl+C` first clears the selected
336
+ agent's draft without cancelling work or switching focus. `Esc` preserves the
337
+ draft. In either split layout, both keys first leave the footer if it has focus,
338
+ then return child focus to the main agent, then close the split. Running tasks
339
+ are preserved while moving through these layers. Both keys also
340
+ dismiss command completion and follow the main input's cancellation and project
341
+ return layers. At the main-only root, `Esc` keeps the application open and only
342
+ `Ctrl+C` exits. `Ctrl+Q` or `/window main` closes either split directly.
343
+ Drag over visible text in the main or an internal agent pane to select it;
344
+ releasing the mouse copies it to the clipboard. Selection stays within that pane,
345
+ excluding its border and adjacent agents. Local macOS uses the system clipboard;
346
+ other terminals use OSC 52 and require terminal clipboard support.
347
+ `/resume` opens a second-level menu of recoverable internal sessions. Independent
348
+ agents appear individually; group members appear together as `group:<group-id>`.
349
+ Selecting a group resumes its inactive members with saved sessions, skips members
350
+ that are already active, and updates the group's member identities. Native
351
+ coding agents register as `agent_type: ucode` with `ucode:<session>` identities;
352
+ their saved conversations remain under `.ufoo/agent/ucode/`.
341
353
  `Tab` cycles keyboard focus through the main agent and the visible child panes;
342
354
  all agents share one bottom input, which follows the selected agent while
343
355
  preserving each draft. Each agent's live status sits in its pane's bottom border;
344
356
  the main agent's input is labelled `main`, and its status stays independent of
345
357
  child selection, focus changes and child activity.
358
+ Internal Codex enables network access within its workspace sandbox, including
359
+ local services such as ADB and Gradle. Peer replies contain the final answer;
360
+ progress and tool output stay visible in the agent's pane. Reports and handoffs
361
+ default to 1-4 short lines with checks and blockers; longer evidence is saved in
362
+ a referenced workspace file.
346
363
  The selected pane's body uses the terminal's default foreground. In the main-only
347
364
  layout, `Tab` selects the first agent in the bottom bar, then advances through
348
365
  the agents and wraps to the first. `Esc` returns to
349
366
  the main input. Command completion keeps its existing `Tab` behavior in the
350
- main-only layout.
367
+ main-only layout. An open completion menu also owns `Tab` in split layouts.
351
368
  Layout commands also work from an internal child's input. Switching layouts
352
369
  keeps unsent child drafts and does not stop running agents.
353
370
  With a child active, `Down` from an empty input or a footer click opens the Agents
@@ -480,11 +497,27 @@ ufoo history prompt 30
480
497
  ufoo report start "Implement README refresh" --task docs-readme --agent builder
481
498
  ufoo report done "README updated" --task docs-readme --agent builder
482
499
  ufoo report list
500
+
501
+ ufoo trace <task-id> --json
502
+ ufoo trace --agent <id-or-nickname> --follow
503
+ ufoo trace --details --limit 2000
483
504
  ```
484
505
 
485
506
  Use decisions only for plan-level constraints. Durable project facts belong in
486
507
  memory.
487
508
 
509
+ `trace` links parent/worker model and tool events, reports, queue claims and
510
+ context compression without starting a daemon or calling a model. MCP exposes
511
+ the same read-only view as `read_agent_trace`. Parameters and results are
512
+ redacted; bounded or incomplete source reads are explicitly marked in JSON.
513
+
514
+ `ufoo metrics --json` summarizes observed outcomes, latency, tokens, tool
515
+ errors/repetition, report size and delegation acceptance. Save a report and use
516
+ `ufoo metrics --baseline baseline.json --json` to compare later samples. MCP
517
+ provides `read_agent_metrics`; metric definitions and an optimization workflow
518
+ are in [OBSERVABILITY.md](OBSERVABILITY.md). Missing evidence stays unknown,
519
+ and execution completion is separate from acceptance.
520
+
488
521
  ### Groups
489
522
 
490
523
  Built-in group templates live in `templates/groups/`.
@@ -547,27 +580,54 @@ Common project settings:
547
580
  {
548
581
  "launchMode": "auto",
549
582
  "agentProvider": "codex-cli",
550
- "controllerMode": "main",
551
- "codexInternalThreadMode": "api",
552
583
  "codexAuthPath": "",
553
584
  "codexOauthRefreshWindowSec": 300,
554
585
  "claudeOauthProfile": "",
555
586
  "claudeOauthTokenPath": "",
556
587
  "claudeOauthRefreshWindowSec": 300,
557
- "routerProvider": "",
558
- "routerModel": "",
559
588
  "agentModel": "",
560
589
  "autoResume": false
561
590
  }
562
591
  ```
563
592
 
593
+ Internal Codex and Claude always use their SDKs; there is no thread-mode setting.
594
+
564
595
  Supported `launchMode` values: `auto`, `internal`, `tmux`, `terminal`, and
565
- `host`. `controllerMode` accepts `main`, `shadow`, `loop`, and legacy
566
- compatibility values.
596
+ `host`. The dashboard supports internal Codex, Claude and ucode workers only; provider selections remain independent.
597
+
598
+ The dashboard always uses internal children and has no `/mode` command;
599
+ the binary has no `ufoo mode` command either.
600
+ Manual `ucodex` and `uclaude` wrappers detect tmux, host sessions, Terminal.app
601
+ and iTerm2 from their environment, then register the actual terminal type, TTY
602
+ and delivery channels with the daemon. Their event-bus communication works
603
+ without a dashboard. MCP agents communicate through MCP message interfaces
604
+ without requiring a terminal adapter.
605
+ The main agent uses one runtime for coding and routing, configured by
606
+ `agentProvider` and `agentModel`. `/settings agent` manages these settings;
607
+ `/settings ucode` manages the independent ucode gateway settings.
608
+
609
+ The bottom Settings bar includes `custom`, `model`, and `thinking`. Select
610
+ `custom` to enter an API URL and hidden API key, then choose its model and
611
+ thinking intensity. `/settings agent custom`, `/settings agent model`, and
612
+ `/settings agent thinking` open the same controls. Model menus fetch the current
613
+ provider's complete selectable catalog, including paginated results; Codex
614
+ menus omit entries marked hidden by the provider. Endpoints without a
615
+ models route also allow a manually entered model ID. Changing model or thinking
616
+ applies to the next request and keeps the current conversation. Changing provider
617
+ starts a new conversation, retaining the old one in runtime storage.
618
+ OpenAI thinking choices include separate `xhigh` and `max` values, preserved in
619
+ requests. When a provider uses a configured gateway, the model list comes from
620
+ that gateway; upgrading an agent SDK does not change the gateway's catalog.
621
+
622
+ Custom main-agent settings use `agentProvider: "custom"`, `agentBaseUrl`,
623
+ `agentApiKey`, `agentModel`, and `agentThinking` in `.ufoo/config.json`.
624
+ Custom APIs use OpenAI Chat Completions by default, or Responses when the URL
625
+ ends in `/responses`. There is no Anthropic protocol selector for custom APIs.
626
+ Internal Claude retains its native provider transport and credentials.
567
627
 
568
628
  Ordinary provider sessions authenticate through their provider-owned adapters;
569
- MCP `agent_handle` is never model authentication. Select `agentProvider=ucode`
570
- to use the ucode gateway settings below.
629
+ MCP `agent_handle` is never model authentication. Standalone and internal ucode
630
+ use the independent gateway settings below.
571
631
 
572
632
  Global `ucode` settings:
573
633
 
package/README.zh-CN.md CHANGED
@@ -205,11 +205,11 @@ ufoo -g
205
205
  切换。全局 daemon 只启动一次,各项目 runtime 按需激活。
206
206
 
207
207
  默认项目主 Agent 与 `ucode` 共用可组合的 runtime,可直接读取、修改代码并执行验证,
208
- 也可委派外部 Agent 或创建独立任务。全局入口只负责选择项目;进入项目后才获得
208
+ 也可委派 internal Agent 或创建独立任务。全局入口只负责选择项目;进入项目后才获得
209
209
  编码能力。长任务在后台运行,断开 chat 不会取消任务,重连会补发运行事件。
210
210
 
211
- 旧 controller 会话保留原执行路径。用 `/session new` 开始新主会话;旧会话的
212
- provider/model 绑定不会随设置变更而切换。副作用执行期间进程崩溃后,任务会标为
211
+ 主 agent 的所有会话统一使用共享 runtime。用 `/session new` 开始使用当前设置的
212
+ 新会话;已有会话的 provider/model 绑定不会随设置变更而切换。副作用执行期间进程崩溃后,任务会标为
213
213
  interrupted,需检查实际结果后决定是否重新提交;不会自动重复文件修改、shell、
214
214
  启动或投递。相同目录的托管写操作共用锁,独立且经过验证的 git worktree 可并行。
215
215
  这些约束不构成 shell 的操作系统沙箱。实现与恢复契约见
@@ -231,29 +231,37 @@ interrupted,需检查实际结果后决定是否重新提交;不会自动重
231
231
  /session show
232
232
  /session new
233
233
  /settings
234
- /multi
235
- /multi on
236
- /multi off
237
- /multi @reviewer
238
- /resume list
234
+ /window main
235
+ /window side
236
+ /window multi
237
+ /resume
239
238
  /project list
240
239
  /project switch 2
241
240
  /open /path/to/project
242
241
  ```
243
242
 
244
- 面板保留三种布局:仅主 agent、主 agent 加一个选中的 internal 子 agent、
245
- 主 agent 加全部 internal 子 agent。包装器与 MCP agent 不进入面板;面板
243
+ 面板保留三种布局:`main`(仅主 agent)、`side`(主 agent 加一个选中的
244
+ internal 子 agent)、`multi`(主 agent 加全部 internal 子 agent)。包装器与 MCP agent 不进入面板;面板
246
245
  启动的子 agent 只使用 internal 模式,不会打开外部终端。当前文件夹没有
247
246
  聊天或输入历史时,欢迎页复用已有的紧凑 ufoo banner。
248
- `/multi` 或 `Ctrl+T` 切换全部子 agent 布局,在单子 agent 布局中使用会展开全部。
249
- `Ctrl+M` 打开全部子 agent 布局,再按一次仍保持打开。面板会自动请求增强键盘
250
- 协议,需要终端能区分 Ctrl+M 与回车;传统终端中两者编码相同,回车仍用于提交,
251
- 可继续使用 `/multi` 或 `Ctrl+T`。
252
- `/multi @reviewer` 只打开指定 internal 子 agent。两种分屏布局中,子 agent
253
- 获得焦点时按 `Esc` 先回到主 agent 输入栏,再按一次退出分屏;焦点已在
254
- 主 agent 时,按 `Esc` 直接退出分屏。草稿和运行中的任务都会保留。
255
- `Ctrl+Q` 或 `/multi off` 仍可直接退出分屏。
256
- 回到仅主 agent 后,再按 `Esc` 不会退出应用;退出请使用 `Ctrl+C`。
247
+ `Ctrl+W` 依次循环切换:`main → side → multi → main`。
248
+ `/window main`、`/window side` 和
249
+ `/window multi` 可直接选择对应布局。单子 agent 布局默认选最近激活的
250
+ 有效 internal 子 agent,没有激活记录则选第一个。没有子 agent 时仍保留模式,
251
+ 主窗格占满宽度,右侧不显示空框;子 agent 出现后自动按当前模式展示。
252
+ 两种分屏布局中,`Esc` 和 `Ctrl+C` 共用回退栈:优先退出底栏焦点,再从子 agent
253
+ 回到主 agent 输入栏,最后退出分屏。回退这些界面层级时,草稿和运行中的任务都会保留。
254
+ 两者也会关闭命令补全,并沿用主输入栏的任务取消、返回全局项目层级。
255
+ `Ctrl+Q` 或 `/window main` 可直接退出分屏。
256
+ 到达最外层后,`Esc` 不会退出应用,只有 `Ctrl+C` 才退出。
257
+ 在主 agent 或 internal 子 agent 窗格内拖选可见文字,松开鼠标即复制到剪贴板。
258
+ 选择范围限定在起始窗格内,不包含边框和相邻 agent。本地 macOS 使用系统剪贴板;
259
+ 其他终端通过 OSC 52 复制,需要终端支持剪贴板写入。
260
+ `/resume` 打开可恢复 internal 会话的二级菜单。独立启动的 agent 单独列出,
261
+ group 的成员聚合为 `group:<group-id>`;选择 group 会批量恢复有已保存会话的
262
+ 非活跃成员,跳过已活跃成员,并更新 group 中的成员 ID。
263
+ 原生编码 agent 的注册类型统一为 `ucode`,ID 使用 `ucode:<session>`;
264
+ 会话文件仍保存在 `.ufoo/agent/ucode/`。
257
265
  `Tab` 在主 agent 和当前显示的子 agent 窗格之间循环切换输入焦点;单子 agent
258
266
  布局在这两个 agent 之间切换。所有 agent 共用底部一个输入框,随当前选中的 agent
259
267
  切换,每个 agent 的草稿独立保留。各 agent 的实时状态嵌在各自窗格底边,选中窗格
@@ -262,7 +270,7 @@ interrupted,需检查实际结果后决定是否重新提交;不会自动重
262
270
  不会覆盖主 agent 自己的状态。
263
271
  仅主 agent 时,`Tab` 先选中底部第一个 agent,之后依次选择下一个,末尾回到第一个;
264
272
  `Esc` 返回主输入栏。仅主 agent 布局
265
- 下,命令补全仍沿用 `Tab`。布局命令在选中 internal 子 agent 的共享输入框中
273
+ 下,命令补全仍沿用 `Tab`;分屏中打开补全菜单时,`Tab` 也优先补全。布局命令在选中 internal 子 agent 的共享输入框中
266
274
  也可以使用;切换布局会保留未发送的子 agent 输入,不会停止运行中的任务。
267
275
  子 agent 激活时,在空输入框按 `↓` 或点击底栏可进入 Agents 选择;再按 `↓`
268
276
  进入 provider 设置和 cron 控制。`Esc` 返回原 agent 的输入框,选择 agent 后按
@@ -368,10 +376,29 @@ ufoo history prompt 30
368
376
  ufoo report start "Implement README refresh" --task docs-readme --agent builder
369
377
  ufoo report done "README updated" --task docs-readme --agent builder
370
378
  ufoo report list
379
+
380
+ ufoo trace <task-id> --json
381
+ ufoo trace --agent <id-or-nickname> --follow
382
+ ufoo trace --details --limit 2000
371
383
  ```
372
384
 
373
385
  Decision 只用于计划级约束;长期项目事实应写入 memory。
374
386
 
387
+ `trace` 可串联父子任务的模型、工具、报告、队列与压缩记录,不启动 daemon、
388
+ 不调用模型。MCP 提供相同的只读工具 `read_agent_trace`。参数和结果经过脱敏;
389
+ 读取范围受限、数据缺失或未写完时,JSON 中会明确标记。
390
+
391
+ `ufoo metrics --json` 汇总执行结果、耗时、tokens、工具错误/重复、报告长度
392
+ 与委派验收。保存报告后,可用 `ufoo metrics --baseline baseline.json --json`
393
+ 对比后续样本。MCP 提供 `read_agent_metrics`;指标口径和优化流程见
394
+ [OBSERVABILITY.md](OBSERVABILITY.md)。缺失证据保留 unknown,执行完成与
395
+ 验收通过分开统计。
396
+
397
+ report 和 agent 交接默认使用 1–4 行短消息,包含结果、改动、检查和阻塞;
398
+ 详细计划或证据写入工作区文件,并附准确路径。internal agent 向同伴转发
399
+ 最终回复,过程与工具输出保留在自己的窗口。internal Codex 在 workspace
400
+ 沙箱内开启网络权限,支持 ADB、Gradle 等本地端口服务。
401
+
375
402
  ### Group
376
403
 
377
404
  内置 group 模板位于 `templates/groups/`。
@@ -431,25 +458,48 @@ ufoo ucode build
431
458
  {
432
459
  "launchMode": "auto",
433
460
  "agentProvider": "codex-cli",
434
- "controllerMode": "main",
435
- "codexInternalThreadMode": "api",
436
461
  "codexAuthPath": "",
437
462
  "codexOauthRefreshWindowSec": 300,
438
463
  "claudeOauthProfile": "",
439
464
  "claudeOauthTokenPath": "",
440
465
  "claudeOauthRefreshWindowSec": 300,
441
- "routerProvider": "",
442
- "routerModel": "",
443
466
  "agentModel": "",
444
467
  "autoResume": false
445
468
  }
446
469
  ```
447
470
 
471
+ internal Codex 和 Claude 固定使用各自 SDK,不再提供 thread mode 配置。
472
+
448
473
  `launchMode` 支持 `auto`、`internal`、`tmux`、`terminal`、`host`。
449
- `controllerMode` 支持 `main`、`shadow`、`loop` 和 legacy 兼容值。
474
+ 面板仅支持 internal Codex、Claude 和 ucode 子 agent;provider 的类型独立于 worker 类型。
475
+
476
+ 面板固定使用 internal 子 agent,不提供 `/mode` 命令,二进制也不提供
477
+ `ufoo mode` 命令。直接运行 `ucodex` 或
478
+ `uclaude` 时,包装器通过环境识别 tmux、host 会话、Terminal.app 或 iTerm2,
479
+ 并向 daemon 登记实际终端类型、TTY 及消息通道,无需打开面板即可通过 event bus
480
+ 互联。MCP agent 使用 MCP 消息接口通信,不需要终端适配器。
481
+ 主 agent 使用同一个 runtime 完成编码与路由,只配置 `agentProvider` 和
482
+ `agentModel`。`/settings agent` 管理主 agent 配置,`/settings ucode` 管理
483
+ 独立的 ucode 网关配置。
484
+
485
+ 底部 Settings 提供 `custom`、`model`、`thinking`。选择 `custom` 后依次输入
486
+ API 地址和隐藏显示的 key,再选择模型与思考强度。也可以使用
487
+ `/settings agent custom`、`/settings agent model`、`/settings agent thinking`。
488
+ 模型菜单读取当前 provider 的完整可选目录,包括分页结果;Codex 菜单会过滤
489
+ provider 标记为隐藏的内部模型。服务没有 `/models`
490
+ 接口时可以手动输入模型 ID。切换模型与思考强度保留当前对话,并用于下一次
491
+ 请求;切换 provider 会开始新对话,旧对话仍保留在 runtime 存储中。
492
+ OpenAI 思考强度提供独立的 `xhigh` 和 `max`,请求会保留所选值。
493
+ provider 配置了网关时,模型列表来自该网关;升级 agent SDK 不会改变网关的目录。
494
+
495
+ custom 使用项目 `.ufoo/config.json` 中的 `agentProvider: "custom"`、
496
+ `agentBaseUrl`、`agentApiKey`、`agentModel`、`agentThinking`。
497
+ 默认使用 OpenAI Chat Completions 协议,地址以 `/responses` 结尾时使用
498
+ OpenAI Responses。custom 不提供 Anthropic 协议选项;internal Claude
499
+ 保留自身的原生接入与凭据。
450
500
 
451
501
  普通 provider 会话通过各自的凭据适配器认证;MCP `agent_handle` 不用于模型请求。
452
- 只有选择 `agentProvider=ucode` 才使用下列 ucode 网关设置。
502
+ 独立和 internal ucode 使用下面的独立网关设置。
453
503
 
454
504
  全局 `ucode` 配置:
455
505
 
@@ -60,6 +60,10 @@ Managed identities must not call MCP `wait_for_message`,
60
60
 
61
61
  ## Handle delivered messages
62
62
 
63
+ Use the same natural language as the user's task prompt for replies, progress,
64
+ report summaries, and handoffs, unless the user requests another language.
65
+ Preserve that language when delegating; English protocol text does not override it.
66
+
63
67
  Treat these prompt prefixes as work inputs:
64
68
 
65
69
  - `[ufoo]<from:id(nickname)>` — event-bus delivery from direct injection or the
@@ -69,7 +73,11 @@ Treat these prompt prefixes as work inputs:
69
73
  For each received bus task:
70
74
 
71
75
  1. Execute it immediately within the current authority.
72
- 2. Acknowledge it only after handling. A wrapper-managed Agent uses:
76
+ 2. In internal mode (`UFOO_LAUNCH_MODE=internal`), the runner confirms the
77
+ delivered task after execution. Do not check or acknowledge the inbox
78
+ yourself; queued messages are future tasks. CLI/MCP ack calls for internal
79
+ agents leave those messages pending.
80
+ Outside internal mode, acknowledge only after handling. A wrapper-managed Agent uses:
73
81
 
74
82
  ```bash
75
83
  ufoo bus ack "<subscriber-id>"
@@ -94,11 +102,27 @@ For each received bus task:
94
102
  requested scope and controller: private controller work uses
95
103
  `--scope private --controller ufoo-agent`, or the corresponding MCP fields.
96
104
 
105
+ Acknowledgement-only inputs, repeated completion notices, and unchanged status
106
+ are not new work. If they contain no question, action, new result, or remaining
107
+ assigned obligation, end silently without a bus reply, lifecycle report, or
108
+ final response. Internal final text is automatically sent to the peer: do not
109
+ write "received", "confirmed", or "nothing to do" as a final reply. Never
110
+ acknowledge an acknowledgement or report receipt of a report. Perform an
111
+ assigned validation of a new result once; report the substantive outcome only.
112
+
97
113
  After sending or broadcasting, continue the current task. Do not start an
98
114
  ad-hoc check or poll, sleep, or wait for a reply. A wrapper-managed Agent
99
115
  receives follow-ups by direct injection; an external Agent leaves its existing
100
116
  App-specific `$ufoo-bus-poll` receive wait armed when idle.
101
117
 
118
+ Keep reports, peer handoffs and final replies to 1-4 short lines and at most
119
+ 600 characters unless the user requests inline detail. A result includes the
120
+ outcome, changed files or commit, exact checks (pass/fail/not run), and blockers;
121
+ a handoff adds the next owner's action. Put longer plans, findings and logs in
122
+ a workspace note or existing evidence file and send its exact path. Report only
123
+ new information; omit tool transcripts, repeated analysis and duplicated final
124
+ summaries. Preserve assigned task IDs and required acceptance evidence.
125
+
102
126
  ## Preserve shared knowledge
103
127
 
104
128
  Record a decision only for architecture, meaningful trade-offs, cross-agent
@@ -54,6 +54,11 @@ ownership: never call `wait_for_message`, `publish_activity_state`, or
54
54
 
55
55
  ## Handle pending messages
56
56
 
57
+ For internal agents (`UFOO_LAUNCH_MODE=internal`), the runner delivers each task
58
+ and confirms it after execution. Do not check or acknowledge the inbox yourself;
59
+ later messages are future tasks. CLI/MCP ack calls leave internal queues intact.
60
+ The manual inbox flow below applies to wrapper/external agents.
61
+
57
62
  If a wrapper-managed Agent was explicitly asked for a manual inbox check, run:
58
63
 
59
64
  ```bash
@@ -85,8 +90,17 @@ For every pending batch:
85
90
  4. Reply only when the sender requested an answer, delegated work whose result
86
91
  is needed, or needs a discovered blocker or fact.
87
92
 
88
- Do not reply to greetings, thanks, `ok`, `收到`, or other acknowledgement-only
89
- messages. Acknowledge them locally and stop.
93
+ Do not reply or report to greetings, thanks, `ok`, `收到`, receipts, repeated
94
+ completion notices, unchanged status, or other acknowledgement-only messages
95
+ with no question, action, new result, or remaining assigned obligation. End
96
+ silently; internal final text is automatically delivered to the sender, so
97
+ "confirmed" or "nothing to do" is still a reply. Never acknowledge an
98
+ acknowledgement or report receipt of a report. Outside internal mode, acknowledge
99
+ locally according to the selected receive contract; internal runners own that step.
100
+
101
+ Use the user's task language for substantive replies, progress, reports, and
102
+ handoffs unless explicitly asked otherwise. Pass that language to delegated
103
+ workers; protocol text and tool output do not set the response language.
90
104
 
91
105
  ## Route messages
92
106
 
@@ -159,3 +173,12 @@ reports; it binds the worker result to its parent task. Ordinary replies and
159
173
  queued/delivered receipts do not complete or accept the task. The parent checks
160
174
  validation evidence before accepting a reported result. Worker reports cannot
161
175
  change project roots or grant controller permissions.
176
+
177
+ Keep reports and peer handoffs to 1-4 short lines and at most 600 characters
178
+ unless the user requests inline detail. Include the outcome, changed files or
179
+ commit, exact checks (pass/fail/not run), blockers, and the next owner's action
180
+ when handing off. Save longer plans, findings and logs in a workspace note or
181
+ existing evidence file and send its exact path. Send only new information;
182
+ omit raw tool output, repeated analysis and duplicated final summaries. Do not
183
+ split a long report across messages or drop assigned task IDs or acceptance
184
+ evidence to shorten it.
package/bin/ucode.js CHANGED
@@ -16,6 +16,10 @@ const { resolveUcodeLaunch } = require("../src/code/launcher/ucode");
16
16
  const { prepareUcodeBootstrap } = require("../src/code/launcher/ucodeBootstrap");
17
17
  const { prepareUcodeRuntimeConfig } = require("../src/code/launcher/ucodeRuntimeConfig");
18
18
 
19
+ // CLI-wrapper startup text belongs to the parent agent. Native ucode loads
20
+ // its own system prompt; do not inject or pass the parent's text to its tools.
21
+ delete process.env.UFOO_STARTUP_BOOTSTRAP_TEXT;
22
+
19
23
  function stripAppendSystemPromptArgs(args = [], targetFile = "") {
20
24
  const normalizedTarget = String(targetFile || "").trim();
21
25
  if (!Array.isArray(args) || args.length === 0) return { args: [], removed: false };
package/bin/ufoo.js CHANGED
@@ -120,7 +120,7 @@ async function main() {
120
120
  inOnlineSection = false;
121
121
  continue;
122
122
  }
123
- // Parse agent line: "ufoo-code:abc123 (nickname)"
123
+ // Parse agent line: "ucode:abc123 (nickname)"
124
124
  const agentMatch = trimmedLine.match(/^[-\s]*([a-z-]+:[a-f0-9]+|[a-z-]+)(?:\s+\(([^)]+)\))?/i);
125
125
  if (agentMatch) {
126
126
  const subscriberId = agentMatch[1];
@@ -150,7 +150,7 @@ async function main() {
150
150
  let scriptName = "";
151
151
  let displayName = "";
152
152
 
153
- if (agentType === "ufoo-code") {
153
+ if (agentType === "ucode") {
154
154
  scriptName = "ucode.js";
155
155
  displayName = "ucode";
156
156
  } else if (agentType === "claude-code") {
@@ -198,7 +198,7 @@ async function main() {
198
198
  const targetLower = target.toLowerCase();
199
199
  let scriptName = "";
200
200
 
201
- if (targetLower === "ucode" || targetLower === "ufoo-code" || targetLower === "ufoo") {
201
+ if (targetLower === "ucode") {
202
202
  scriptName = "ucode.js";
203
203
  } else if (targetLower === "uclaude" || targetLower === "claude-code" || targetLower === "claude") {
204
204
  scriptName = "uclaude.js";
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "u-foo",
3
- "version": "4.0.0",
3
+ "version": "4.0.2",
4
4
  "description": "Multi-Agent Workspace Protocol. Just add u. claude → uclaude, codex → ucodex.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "homepage": "https://ufoo.dev",
@@ -41,7 +41,8 @@
41
41
  "SKILLS/",
42
42
  "OPTIONAL_SKILLS/",
43
43
  "LICENSE",
44
- "README.md"
44
+ "README.md",
45
+ "OBSERVABILITY.md"
45
46
  ],
46
47
  "type": "commonjs",
47
48
  "engines": {
@@ -56,11 +57,10 @@
56
57
  "test:coverage": "jest --coverage"
57
58
  },
58
59
  "dependencies": {
59
- "@anthropic-ai/claude-agent-sdk": "^0.2.141",
60
+ "@anthropic-ai/claude-agent-sdk": "^0.3.295",
61
+ "@anthropic-ai/sdk": "^0.132.1",
60
62
  "@modelcontextprotocol/sdk": "^1.32.1",
61
- "@openai/codex-sdk": "^0.145.0",
62
- "@xterm/addon-serialize": "^0.14.0",
63
- "@xterm/headless": "^6.0.0",
63
+ "@openai/codex-sdk": "^0.162.0",
64
64
  "chalk": "^4.1.2",
65
65
  "commander": "^13.1.0",
66
66
  "gray-matter": "^4.0.3",
@@ -161,7 +161,7 @@ class ActivityDetector {
161
161
  /**
162
162
  * @param {string} agentType - e.g. "claude-code", "codex"
163
163
  * @param {object} [options]
164
- * @param {string} [options.mode] - launch mode ("terminal"/"tmux"/"iterm2"/"pty-runner")
164
+ * @param {string} [options.mode] - launch mode ("internal"/"terminal"/"tmux"/"iterm2")
165
165
  * @param {number} [options.bufferSize=4000] - rolling buffer size in chars
166
166
  * @param {number} [options.tailLines=10] - number of tail lines used for quiet-time prompt detection
167
167
  * @param {boolean} [options.startOnOutput=false] - allow STARTING -> WORKING on first output