u-foo 2.3.32 → 2.4.0

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 (235) hide show
  1. package/README.md +157 -213
  2. package/README.zh-CN.md +151 -197
  3. package/SKILLS/ufoo/SKILL.md +8 -8
  4. package/bin/uagy.js +69 -0
  5. package/bin/uclaude.js +2 -2
  6. package/bin/ucode.js +4 -4
  7. package/bin/ucodex.js +2 -2
  8. package/bin/ufoo.js +5 -23
  9. package/modules/AGENTS.template.md +1 -1
  10. package/modules/bus/SKILLS/ubus/SKILL.md +35 -10
  11. package/package.json +5 -5
  12. package/scripts/chat-app-smoke.js +1 -1
  13. package/scripts/global-chat-switch-benchmark.js +5 -5
  14. package/scripts/ink-demo.js +1 -1
  15. package/scripts/ink-smoke.js +1 -1
  16. package/scripts/ucode-app-smoke.js +1 -1
  17. package/src/{agent → agents/activity}/activityDetector.js +39 -2
  18. package/src/{agent → agents/activity}/activityStatePublisher.js +1 -1
  19. package/src/{agent → agents/activity}/activityStateWriter.js +2 -2
  20. package/src/{agent → agents/activity}/activityTracker.js +1 -1
  21. package/src/agents/activity/index.js +8 -0
  22. package/src/{agent → agents/controller}/controllerToolExecutor.js +4 -4
  23. package/src/agents/controller/index.js +8 -0
  24. package/src/{agent → agents/controller}/loopObservability.js +2 -2
  25. package/src/{agent → agents/controller}/loopRuntime.js +1 -1
  26. package/src/{agent → agents/controller}/ufooAgent.js +9 -9
  27. package/src/agents/index.js +10 -0
  28. package/src/agents/internal/index.js +3 -0
  29. package/src/{agent → agents/internal}/internalRunner.js +45 -22
  30. package/src/agents/launch/agyConversation.js +159 -0
  31. package/src/agents/launch/index.js +12 -0
  32. package/src/{agent → agents/launch}/launchEnvironment.js +2 -3
  33. package/src/{agent → agents/launch}/launcher.js +64 -21
  34. package/src/{agent → agents/launch}/notifier.js +23 -12
  35. package/src/{agent → agents/launch}/ptyRunner.js +44 -12
  36. package/src/{agent → agents/launch}/ptyWrapper.js +2 -2
  37. package/src/{agent → agents/launch}/publisherRouting.js +1 -1
  38. package/src/{agent → agents/launch}/readyDetector.js +23 -0
  39. package/src/{agent → agents/prompts}/defaultBootstrap.js +63 -4
  40. package/src/{group/bootstrap.js → agents/prompts/groupBootstrap.js} +41 -6
  41. package/src/agents/prompts/index.js +8 -0
  42. package/src/{code/prompts → agents/prompts/native}/index.js +1 -1
  43. package/src/{agent → agents/providers}/claudeThreadProvider.js +1 -1
  44. package/src/{agent → agents/providers}/codexThreadProvider.js +1 -1
  45. package/src/{agent → agents/providers}/directAuthStatus.js +184 -1
  46. package/src/agents/providers/index.js +13 -0
  47. package/src/{agent → agents/providers}/upstreamTransport.js +2 -2
  48. package/src/{chat → app/chat}/agentSockets.js +1 -1
  49. package/src/{chat → app/chat}/commandExecutor.js +50 -26
  50. package/src/{chat → app/chat}/commands.js +119 -5
  51. package/src/{chat → app/chat}/daemonConnection.js +1 -1
  52. package/src/{chat → app/chat}/daemonMessageRouter.js +45 -3
  53. package/src/{chat → app/chat}/dashboardView.js +2 -1
  54. package/src/app/chat/index.js +6 -0
  55. package/src/{chat → app/chat}/inputSubmitHandler.js +4 -13
  56. package/src/{chat → app/chat}/internalAgentLogHistory.js +1 -1
  57. package/src/app/chat/multiWindow/index.js +268 -0
  58. package/src/app/chat/multiWindow/paneLayout.js +84 -0
  59. package/src/app/chat/multiWindow/paneManager.js +299 -0
  60. package/src/app/chat/multiWindow/renderer.js +384 -0
  61. package/src/app/chat/multiWindow/virtualTerminal.js +327 -0
  62. package/src/{chat → app/chat}/transport.js +1 -1
  63. package/src/{cli → app/cli}/ctxCoreCommands.js +3 -3
  64. package/src/{doctor/index.js → app/cli/features/doctor.js} +1 -1
  65. package/src/{init/index.js → app/cli/features/init.js} +14 -32
  66. package/src/{cli → app/cli}/groupCoreCommands.js +2 -2
  67. package/src/app/cli/index.js +9 -0
  68. package/src/{cli → app/cli}/onlineCoreCommands.js +5 -5
  69. package/src/{cli.js → app/cli/run.js} +59 -57
  70. package/src/app/index.js +6 -0
  71. package/src/code/agent.js +10 -9
  72. package/src/code/index.js +2 -0
  73. package/src/code/launcher/index.js +9 -0
  74. package/src/{agent → code/launcher}/ucode.js +7 -8
  75. package/src/{agent → code/launcher}/ucodeBootstrap.js +3 -3
  76. package/src/{agent → code/launcher}/ucodeBuild.js +2 -2
  77. package/src/{agent → code/launcher}/ucodeDoctor.js +2 -2
  78. package/src/{agent → code/launcher}/ucodeRuntimeConfig.js +1 -2
  79. package/src/code/nativeRunner.js +4 -4
  80. package/src/code/tui.js +3 -1454
  81. package/src/config.js +15 -2
  82. package/src/{bus → coordination/bus}/activate.js +2 -2
  83. package/src/{bus → coordination/bus}/daemon.js +15 -5
  84. package/src/coordination/bus/envelope.js +173 -0
  85. package/src/{bus → coordination/bus}/index.js +7 -3
  86. package/src/{bus → coordination/bus}/inject.js +11 -3
  87. package/src/{bus → coordination/bus}/message.js +1 -1
  88. package/src/coordination/bus/messageMeta.js +130 -0
  89. package/src/coordination/bus/promptEnvelope.js +65 -0
  90. package/src/{bus → coordination/bus}/shake.js +1 -1
  91. package/src/{bus → coordination/bus}/store.js +3 -3
  92. package/src/{bus → coordination/bus}/subscriber.js +2 -2
  93. package/src/{bus → coordination/bus}/utils.js +2 -2
  94. package/src/{history → coordination/history}/inputTimeline.js +5 -5
  95. package/src/coordination/index.js +10 -0
  96. package/src/{memory → coordination/memory}/historySearch.js +1 -1
  97. package/src/{memory → coordination/memory}/index.js +3 -3
  98. package/src/{report → coordination/report}/store.js +2 -2
  99. package/src/{status → coordination/status}/index.js +3 -3
  100. package/src/online/bridge.js +2 -2
  101. package/src/{controller → orchestration/controller}/flags.js +1 -1
  102. package/src/{controller → orchestration/controller}/gateRouter.js +1 -1
  103. package/src/orchestration/controller/index.js +10 -0
  104. package/src/{controller → orchestration/controller}/shadowGuard.js +1 -1
  105. package/src/orchestration/groups/bootstrap.js +3 -0
  106. package/src/orchestration/groups/index.js +10 -0
  107. package/src/orchestration/groups/promptProfiles.js +3 -0
  108. package/src/{group → orchestration/groups}/templates.js +1 -1
  109. package/src/{group → orchestration/groups}/validateTemplate.js +1 -1
  110. package/src/orchestration/index.js +7 -0
  111. package/src/orchestration/solo/index.js +3 -0
  112. package/src/{daemon → runtime/daemon}/agentProcessManager.js +1 -1
  113. package/src/{daemon → runtime/daemon}/cronOps.js +3 -2
  114. package/src/{daemon → runtime/daemon}/groupOrchestrator.js +26 -9
  115. package/src/{daemon → runtime/daemon}/index.js +105 -53
  116. package/src/{daemon → runtime/daemon}/ipcServer.js +1 -1
  117. package/src/{daemon → runtime/daemon}/nicknameScope.js +6 -3
  118. package/src/{daemon → runtime/daemon}/ops.js +48 -61
  119. package/src/{daemon → runtime/daemon}/promptLoop.js +1 -1
  120. package/src/{daemon → runtime/daemon}/promptRequest.js +7 -7
  121. package/src/runtime/daemon/providerSessions.js +230 -0
  122. package/src/{daemon → runtime/daemon}/reporting.js +4 -4
  123. package/src/{daemon → runtime/daemon}/run.js +4 -4
  124. package/src/{daemon → runtime/daemon}/soloBootstrap.js +7 -7
  125. package/src/{daemon → runtime/daemon}/status.js +5 -5
  126. package/src/runtime/index.js +10 -0
  127. package/src/{projects → runtime/projects}/registry.js +1 -1
  128. package/src/{terminal → runtime/terminal}/adapterRouter.js +0 -10
  129. package/src/{terminal → runtime/terminal}/adapters/internalAdapter.js +0 -4
  130. package/src/tools/handlers/common.js +1 -1
  131. package/src/tools/handlers/listAgents.js +1 -1
  132. package/src/tools/handlers/memory.js +3 -3
  133. package/src/tools/handlers/readBusSummary.js +1 -1
  134. package/src/tools/handlers/readOpenDecisions.js +1 -1
  135. package/src/tools/handlers/readProjectRegistry.js +1 -1
  136. package/src/tools/handlers/readPromptHistory.js +2 -2
  137. package/src/tools/schemaFixtures.js +1 -1
  138. package/src/ui/MIGRATION.md +42 -88
  139. package/src/ui/format/index.js +5 -28
  140. package/src/ui/index.js +1 -1
  141. package/src/ui/{components → ink}/ChatApp.js +812 -88
  142. package/src/ui/ink/DashboardBar.js +685 -0
  143. package/src/ui/{components → ink}/MultilineInput.js +230 -5
  144. package/src/ui/{components → ink}/UcodeApp.js +16 -7
  145. package/src/ui/{components → ink}/agentMirror.js +24 -19
  146. package/src/ui/{components → ink}/chatReducer.js +29 -7
  147. package/src/bus/messageMeta.js +0 -52
  148. package/src/chat/agentViewController.js +0 -1072
  149. package/src/chat/chatLogController.js +0 -138
  150. package/src/chat/completionController.js +0 -533
  151. package/src/chat/dashboardKeyController.js +0 -533
  152. package/src/chat/index.js +0 -2222
  153. package/src/chat/inputHistoryController.js +0 -135
  154. package/src/chat/inputListenerController.js +0 -470
  155. package/src/chat/layout.js +0 -186
  156. package/src/chat/pasteController.js +0 -81
  157. package/src/chat/statusLineController.js +0 -223
  158. package/src/chat/streamTracker.js +0 -156
  159. package/src/code/config +0 -0
  160. package/src/daemon/providerSessions.js +0 -488
  161. package/src/terminal/adapters/internalPtyAdapter.js +0 -42
  162. package/src/ui/components/DashboardBar.js +0 -417
  163. /package/src/{code/prompts → agents/prompts/native}/actions.js +0 -0
  164. /package/src/{code/prompts → agents/prompts/native}/efficiency.js +0 -0
  165. /package/src/{code/prompts → agents/prompts/native}/environment.js +0 -0
  166. /package/src/{code/prompts → agents/prompts/native}/identity.js +0 -0
  167. /package/src/{code/prompts → agents/prompts/native}/safety.js +0 -0
  168. /package/src/{code/prompts → agents/prompts/native}/sections.js +0 -0
  169. /package/src/{code/prompts → agents/prompts/native}/system.js +0 -0
  170. /package/src/{code/prompts → agents/prompts/native}/tasks.js +0 -0
  171. /package/src/{code/prompts → agents/prompts/native}/toolDescriptions/bash.js +0 -0
  172. /package/src/{code/prompts → agents/prompts/native}/toolDescriptions/edit.js +0 -0
  173. /package/src/{code/prompts → agents/prompts/native}/toolDescriptions/read.js +0 -0
  174. /package/src/{code/prompts → agents/prompts/native}/toolDescriptions/write.js +0 -0
  175. /package/src/{code/prompts → agents/prompts/native}/ufoo.js +0 -0
  176. /package/src/{group → agents/prompts}/promptProfiles.js +0 -0
  177. /package/src/{agent → agents/providers}/claudeEventTranslator.js +0 -0
  178. /package/src/{agent → agents/providers}/claudeOauthTokenReader.js +0 -0
  179. /package/src/{agent → agents/providers}/claudeSessionFiles.js +0 -0
  180. /package/src/{agent → agents/providers}/codexEventTranslator.js +0 -0
  181. /package/src/{agent → agents/providers}/credentials/claude.js +0 -0
  182. /package/src/{agent → agents/providers}/credentials/codex.js +0 -0
  183. /package/src/{agent → agents/providers}/credentials/index.js +0 -0
  184. /package/src/{chat → app/chat}/agentBar.js +0 -0
  185. /package/src/{chat → app/chat}/agentDirectory.js +0 -0
  186. /package/src/{chat → app/chat}/cronScheduler.js +0 -0
  187. /package/src/{chat → app/chat}/daemonCoordinator.js +0 -0
  188. /package/src/{chat → app/chat}/daemonReconnect.js +0 -0
  189. /package/src/{chat → app/chat}/daemonTransport.js +0 -0
  190. /package/src/{chat → app/chat}/daemonTransportDefaults.js +0 -0
  191. /package/src/{chat → app/chat}/inputMath.js +0 -0
  192. /package/src/{chat → app/chat}/projectCloseController.js +0 -0
  193. /package/src/{chat → app/chat}/rawKeyMap.js +0 -0
  194. /package/src/{chat → app/chat}/settingsController.js +0 -0
  195. /package/src/{chat → app/chat}/shellCommand.js +0 -0
  196. /package/src/{chat → app/chat}/text.js +0 -0
  197. /package/src/{chat → app/chat}/transientAgentState.js +0 -0
  198. /package/src/{cli → app/cli}/busCoreCommands.js +0 -0
  199. /package/src/{skills/index.js → app/cli/features/skills.js} +0 -0
  200. /package/src/{bus → coordination/bus}/nickname.js +0 -0
  201. /package/src/{bus → coordination/bus}/queue.js +0 -0
  202. /package/src/{context → coordination/context}/decisions.js +0 -0
  203. /package/src/{context → coordination/context}/doctor.js +0 -0
  204. /package/src/{context → coordination/context}/index.js +0 -0
  205. /package/src/{context → coordination/context}/sync.js +0 -0
  206. /package/src/{ufoo → coordination/state}/agentRegistryDiagnostics.js +0 -0
  207. /package/src/{ufoo → coordination/state}/agentsStore.js +0 -0
  208. /package/src/{ufoo → coordination/state}/paths.js +0 -0
  209. /package/src/{controller → orchestration/controller}/launchRouting.js +0 -0
  210. /package/src/{controller → orchestration/controller}/routerFastPath.js +0 -0
  211. /package/src/{controller → orchestration/controller}/routerFinalize.js +0 -0
  212. /package/src/{group → orchestration/groups}/diagram.js +0 -0
  213. /package/src/{group → orchestration/groups}/templateValidation.js +0 -0
  214. /package/src/{solo → orchestration/solo}/commands.js +0 -0
  215. /package/src/{shared → runtime/contracts}/eventContract.js +0 -0
  216. /package/src/{shared → runtime/contracts}/ptySocketContract.js +0 -0
  217. /package/src/{providerapi → runtime/privacy}/redactor.js +0 -0
  218. /package/src/{providerapi → runtime/privacy}/shadowDiff.js +0 -0
  219. /package/src/{utils → runtime/process}/nodeExecutable.js +0 -0
  220. /package/src/{projects → runtime/projects}/identity.js +0 -0
  221. /package/src/{projects → runtime/projects}/index.js +0 -0
  222. /package/src/{projects → runtime/projects}/projectId.js +0 -0
  223. /package/src/{projects → runtime/projects}/runtimes.js +0 -0
  224. /package/src/{terminal → runtime/terminal}/adapterContract.js +0 -0
  225. /package/src/{terminal → runtime/terminal}/adapters/externalAdapter.js +0 -0
  226. /package/src/{terminal → runtime/terminal}/adapters/hostAdapter.js +0 -0
  227. /package/src/{terminal → runtime/terminal}/adapters/internalQueueAdapter.js +0 -0
  228. /package/src/{terminal → runtime/terminal}/adapters/terminalAdapter.js +0 -0
  229. /package/src/{terminal → runtime/terminal}/adapters/tmuxAdapter.js +0 -0
  230. /package/src/{terminal → runtime/terminal}/detect.js +0 -0
  231. /package/src/{terminal → runtime/terminal}/index.js +0 -0
  232. /package/src/{terminal → runtime/terminal}/iterm2.js +0 -0
  233. /package/src/{utils → ui/format}/banner.js +0 -0
  234. /package/src/{shared → ui/format}/markdownRenderer.js +0 -0
  235. /package/src/ui/{components → ink}/InkDemo.js +0 -0
package/README.md CHANGED
@@ -1,8 +1,11 @@
1
1
  # ufoo
2
2
 
3
- [Chinese documentation](README.zh-CN.md)
3
+ [中文](README.zh-CN.md)
4
4
 
5
- Multi-agent workspace protocol for running Claude Code, OpenAI Codex, ufoo's native `ucode`, and coordinated agent groups from one project-scoped runtime.
5
+ ufoo is a project-scoped multi-agent workspace runtime. It wraps Claude Code,
6
+ OpenAI Codex, Antigravity, and ufoo's native `ucode` agent with a shared chat
7
+ dashboard, daemon, event bus, memory, reports, group orchestration, and terminal
8
+ launch modes.
6
9
 
7
10
  Package: [u-foo on npm](https://www.npmjs.com/package/u-foo)
8
11
 
@@ -12,23 +15,25 @@ Package: [u-foo on npm](https://www.npmjs.com/package/u-foo)
12
15
  [![Node](https://img.shields.io/badge/node-%3E%3D18-brightgreen.svg)](https://nodejs.org)
13
16
  [![Platform](https://img.shields.io/badge/platform-macOS-blue.svg)](https://www.apple.com/macos)
14
17
 
15
- ## What It Does
18
+ ## Highlights
16
19
 
17
- ufoo adds a coordination layer around coding agents:
18
-
19
- - `ufoo` / `ufoo chat` opens an interactive multi-agent dashboard.
20
- - `uclaude`, `ucodex`, and `ucode` launch agents with project bootstrap, bus identity, and ufoo protocol context.
21
- - `ufoo daemon` owns project runtime state, launch/resume operations, group orchestration, reports, and chat bridge requests.
22
- - `ufoo bus` provides project-local agent messaging, wake, listen, alert, and activation commands.
23
- - `ufoo ctx`, `ufoo memory`, and `ufoo history` keep decisions, durable facts, and input timeline context in `.ufoo/`.
24
- - `ufoo group` launches predefined multi-agent groups from templates under `templates/groups/`.
25
- - `ufoo online` provides relay helpers for remote channels, rooms, tokens, and inboxes.
20
+ - One TUI dashboard for launching, watching, messaging, and resuming agents.
21
+ - Project daemon over `.ufoo/run/ufoo.sock` for launch/resume, reports, groups,
22
+ cron, and controller routing.
23
+ - Project-local event bus for agent-to-agent messages, wakeups, queue checks,
24
+ and activation.
25
+ - Shared context primitives: decisions, durable memory, prompt history, reports,
26
+ and agent registry state.
27
+ - Launch modes for internal, tmux, host, Terminal.app, and iTerm2 workflows.
28
+ - Built-in group templates for launching and orchestrating multi-agent workflows.
29
+ - `ucode`, a native ufoo coding-agent runtime.
26
30
 
27
31
  ## Requirements
28
32
 
29
33
  - Node.js 18 or newer.
30
- - macOS for Terminal.app/iTerm2 launch and activation integrations.
31
- - Claude Code and/or Codex CLI installed if you use the `uclaude` or `ucodex` wrappers.
34
+ - macOS for Terminal.app/iTerm2 integration.
35
+ - Claude Code, Codex CLI, or Antigravity CLI installed when using the matching
36
+ wrappers: `uclaude`, `ucodex`, or `uagy`.
32
37
 
33
38
  ## Installation
34
39
 
@@ -49,15 +54,17 @@ npm link
49
54
 
50
55
  Installed binaries:
51
56
 
52
- - `ufoo`: main CLI and chat dashboard.
53
- - `uclaude`: Claude Code wrapper.
54
- - `ucodex`: Codex wrapper.
55
- - `ucode`: native ufoo coding-agent wrapper.
56
- - `ucode-core`: native queue/runtime helper.
57
+ | Binary | Purpose |
58
+ |---|---|
59
+ | `ufoo` | Main CLI, chat dashboard, daemon, groups, bus, context, memory, reports, and online helpers. |
60
+ | `uclaude` | Claude Code wrapper with ufoo bootstrap and bus identity. |
61
+ | `ucodex` | Codex wrapper with ufoo bootstrap and bus identity. |
62
+ | `uagy` | Antigravity wrapper with ufoo bootstrap and bus identity. |
63
+ | `ucode` | Native ufoo coding-agent CLI/TUI. |
57
64
 
58
65
  ## Quick Start
59
66
 
60
- Initialize a project and open chat:
67
+ Initialize a project and open the chat dashboard:
61
68
 
62
69
  ```bash
63
70
  cd your-project
@@ -65,110 +72,128 @@ ufoo init --modules context,bus
65
72
  ufoo
66
73
  ```
67
74
 
68
- Launch agents from the chat UI:
75
+ Launch agents from chat:
69
76
 
70
77
  ```text
71
- > /launch claude
72
- > /launch codex
73
- > /launch ucode
74
- > @claude-1 read the project structure and summarize the risks
78
+ > /launch codex reviewer
79
+ > /launch claude builder
80
+ > /launch ucode fixer
81
+ > @reviewer inspect the current diff and list release risks
75
82
  ```
76
83
 
77
- Or launch wrappers directly from a project directory:
84
+ Or launch wrappers directly inside a project:
78
85
 
79
86
  ```bash
80
87
  uclaude
81
88
  ucodex
89
+ uagy
82
90
  ucode
83
91
  ```
84
92
 
85
- `ufoo chat` starts the project daemon when needed. For global cross-project mode, use:
93
+ Use global chat mode to switch between registered projects:
86
94
 
87
95
  ```bash
88
96
  ufoo -g
89
97
  ```
90
98
 
91
- ## Architecture
99
+ ## Runtime Model
92
100
 
93
101
  ```text
94
- ufoo chat / ufoo -g
95
- |
96
- v
97
- +----------------+----------------+
98
- | project daemon / IPC / reports |
99
- +----------------+----------------+
100
- |
101
- +--------------+--------------+
102
- | | |
103
- v v v
104
- controller group runtime project registry
105
- gate/router loop orchestration ~/.ufoo/projects
106
- |
107
- v
108
- provider API transports and tools
109
- codex/claude/ucode, memory, bus, terminal
110
- |
111
- v
112
- uclaude / ucodex / ucode agent sessions
102
+ ufoo / ufoo chat
103
+ -> src/app/chat + src/ui/ink
104
+ -> project daemon over .ufoo/run/ufoo.sock
105
+ -> runtime daemon launch/resume/recover/reports/cron/groups
106
+ -> orchestration router, group templates, solo roles
107
+ -> agents launch/providers/internal/controller/activity
108
+ -> coordination bus/context/memory/history/report/state/status
109
+ -> shared controller/worker tools and native ucode tools
113
110
  ```
114
111
 
115
- The chat UI talks to a project daemon over `.ufoo/run/ufoo.sock`. The daemon owns launch/resume/recover, group orchestration, reporting, controller routing, and project registry updates. Agents communicate through the project event bus and can use shared decisions, memory, reports, prompt history, and tool handlers.
112
+ Chat is a UI client. The daemon owns project runtime state. Agents communicate
113
+ through bus queues, prompt injection, shared memory, reports, and tool handlers
114
+ instead of importing chat UI code.
116
115
 
117
- ## Core Usage
116
+ ## Daily Usage
118
117
 
119
- ### Project Runtime
118
+ The normal workflow is to enter chat first, then launch agents and run project
119
+ commands inside the dashboard:
120
120
 
121
121
  ```bash
122
- ufoo init --modules context,bus,resources
123
- ufoo status
124
- ufoo doctor
125
- ufoo daemon --start
126
- ufoo daemon --status
127
- ufoo daemon --stop
122
+ ufoo
123
+ ufoo -g
128
124
  ```
129
125
 
130
- `ufoo init` creates `.ufoo/`, injects the ufoo protocol block into `AGENTS.md` and `CLAUDE.md`, creates shared memory storage, and initializes selected modules. The default module set is `context`; pass `--modules context,bus` for the usual multi-agent project setup.
126
+ `ufoo` opens the current project chat. `ufoo -g` opens global chat for switching
127
+ between registered projects. The project daemon is started as needed.
131
128
 
132
- ### Chat And Agents
129
+ ### Chat Commands
133
130
 
134
- ```bash
135
- ufoo
136
- ufoo chat
137
- ufoo chat -g
138
- ufoo launch codex reviewer --profile review-critic
139
- ufoo solo list
140
- ufoo solo run implementation-lead --agent codex --nickname builder
141
- ufoo role ufoo-builder implementation-lead
142
- ufoo resume <ucode|uclaude|ucodex|nickname>
143
- ufoo recover list
131
+ ```text
132
+ /launch codex reviewer
133
+ /launch claude builder
134
+ /launch ucode fixer
135
+ @reviewer inspect the current diff and list release risks
136
+
137
+ /status
138
+ /settings
139
+ /multi
140
+ /resume list
141
+ /project list
142
+ /project switch 2
143
+ /open /path/to/project
144
144
  ```
145
145
 
146
- Common chat commands include `/status`, `/bus list`, `/bus status`, `/settings`, `/project list`, `/project switch <index|path>`, `/open <path>`, `/resume list`, `/group status`, `/skills`, and `@nickname <message>`.
146
+ Direct wrapper commands such as `uclaude`, `ucodex`, `uagy`, and `ucode` are
147
+ still available, but the normal ufoo workflow is to work from chat.
148
+
149
+ ### Initialization And Maintenance
150
+
151
+ These are setup or troubleshooting commands. In chat, use slash commands:
147
152
 
148
- In `ufoo chat`, `/skills` lists ufoo's built-in available skills and preset workflow capabilities so users can discover and choose them. It does not execute a task by itself, and it is not a private capability list for any one agent.
153
+ ```text
154
+ /init context bus resources
155
+ /doctor
156
+ /status
157
+ /daemon status
158
+ /daemon restart
159
+ /daemon stop
160
+ /daemon start
161
+ ```
162
+
163
+ `ufoo init` creates `.ufoo/`, ensures `AGENTS.md` and `CLAUDE.md`, initializes
164
+ selected modules, and prepares shared storage. `CLAUDE.md` may be a symlink;
165
+ edit project instructions in `AGENTS.md`.
166
+
167
+ Before a project has been initialized, the equivalent CLI form is also useful:
168
+ `ufoo init --modules context,bus`.
149
169
 
150
170
  ### Event Bus
151
171
 
152
- ```bash
153
- ufoo bus join
154
- ufoo bus status
155
- ufoo bus send codex:abc123 "Please implement the approved slice."
156
- ufoo bus check codex:abc123
157
- ufoo bus listen codex:abc123 --from-beginning
158
- ufoo bus alert codex:abc123 --daemon --notify
159
- ufoo bus wake ufoo-builder --reason follow-up
160
- ufoo bus activate ufoo-builder
172
+ ```text
173
+ /bus list
174
+ /bus status
175
+ /bus send codex:abc123 Please implement the approved slice.
176
+ /bus activate reviewer
177
+ /bus rename codex:abc123 reviewer
161
178
  ```
162
179
 
163
- Use `ufoo bus status` to find the real subscriber ID or resolvable nickname first. In this repository, group nicknames are project-scoped, such as `ufoo-builder`; a bare `builder` target may not resolve. Agents should execute pending bus work, reply to the sender, and acknowledge the queue after handling it.
180
+ Use `/bus status` to find the real subscriber ID or resolvable nickname
181
+ before sending. Agents should handle pending work, reply to the sender, and
182
+ acknowledge their queue.
164
183
 
165
- ### Context, Memory, And Reports
184
+ ### Context, Memory, History, Reports
166
185
 
167
- ```bash
168
- ufoo ctx decisions -l
169
- ufoo ctx decisions -n 1
170
- ufoo ctx decisions new "Adopt API-backed loop architecture"
186
+ Inside chat:
187
+
188
+ ```text
189
+ /ctx status
190
+ /ctx doctor
191
+ /ctx decisions
192
+ ```
193
+
194
+ Memory, history, and report management are CLI utilities:
171
195
 
196
+ ```bash
172
197
  ufoo memory add "Provider contract" --body "Durable fact..." --tags provider,contract
173
198
  ufoo memory list --tag provider
174
199
  ufoo memory show mem-0001
@@ -177,86 +202,58 @@ ufoo history build
177
202
  ufoo history show 20
178
203
  ufoo history prompt 30
179
204
 
180
- ufoo report start "Implement README refresh" --task docs-readme --agent ufoo-builder
181
- ufoo report done "README updated" --task docs-readme --agent ufoo-builder
205
+ ufoo report start "Implement README refresh" --task docs-readme --agent builder
206
+ ufoo report done "README updated" --task docs-readme --agent builder
182
207
  ufoo report list
183
208
  ```
184
209
 
185
- Use decisions sparingly for plan-level constraints. Durable project facts belong in memory.
186
-
187
- ### Command Reference
188
-
189
- | Area | Commands |
190
- |------|----------|
191
- | Runtime | `ufoo`, `ufoo chat`, `ufoo -g`, `ufoo init`, `ufoo status`, `ufoo doctor`, `ufoo daemon --start|--status|--stop` |
192
- | Projects | `ufoo project list`, `ufoo project current`, `ufoo project switch` (chat-only in v1), chat `/open <path>` |
193
- | Agents | `ufoo launch`, `ufoo solo list|run`, `ufoo role`, `ufoo resume <target>`, `ufoo recover list|run` |
194
- | Bus | `ufoo bus join|status|send|check|listen|alert|wake|activate` |
195
- | Context | `ufoo ctx doctor`, `ufoo ctx decisions`, `ufoo ctx sync` |
196
- | Memory | `ufoo memory add|list|show|edit|forget|rebuild-index|audit` |
197
- | Reports | `ufoo report start|progress|done|error|list` |
198
- | Groups | `ufoo group templates|template|run|status|diagram|stop` |
199
- | Online | `ufoo online server|token|room|channel|connect|send|inbox` |
200
- | History | `ufoo history build|show|prompt` |
201
- | Skills | `ufoo skills list|install` |
202
- | Chat commands | `/skills`, `/settings`, `/settings agent`, `/settings router`, `/settings ucode` |
210
+ Use decisions only for plan-level constraints. Durable project facts belong in
211
+ memory.
203
212
 
204
213
  ### Groups
205
214
 
206
215
  Built-in group templates live in `templates/groups/`.
207
216
 
208
- ```bash
209
- ufoo group templates
210
- ufoo group template show build-lane
211
- ufoo group template validate templates/groups/build-lane.json
212
- ufoo group run build-lane --dry-run
213
- ufoo group run build-lane --instance docs-refresh
214
- ufoo group status
215
- ufoo group diagram build-lane --mermaid
216
- ufoo group stop docs-refresh
217
+ ```text
218
+ /group templates
219
+ /group template show build-lane
220
+ /group template validate templates/groups/build-lane.json
221
+ /group run build-lane dry_run=true
222
+ /group run build-lane instance=docs-refresh
223
+ /group status
224
+ /group diagram build-lane mermaid
225
+ /group stop docs-refresh
217
226
  ```
218
227
 
219
- Current built-ins include `build-lane`, `build-ultra`, `design-system`, `product-discovery`, `ui-plan-review`, `ui-polish`, and `verify-ship`.
220
-
221
228
  ### Online Relay
222
229
 
223
230
  ```bash
224
231
  ufoo online server --host 127.0.0.1 --port 8787
225
232
  ufoo online token codex:abc123 --nickname builder
226
- ufoo online channel list --nickname builder
227
233
  ufoo online room create --nickname builder --name review-room --type private --password secret
228
234
  ufoo online connect --nickname builder --room <room_id> --room-password secret
229
235
  ufoo online send --nickname builder --room <room_id> --text "handoff ready"
230
236
  ufoo online inbox builder --unread
231
237
  ```
232
238
 
233
- `room create` returns a generated room ID such as `room_000000`; use that ID for `--room`. The room `--name` is display metadata, not the join/send identifier. The default public service URL is `https://online.ufoo.dev`; local development can run its own relay with `ufoo online server`.
239
+ The default public service URL is `https://online.ufoo.dev`. Local development
240
+ can run its own relay with `ufoo online server`.
234
241
 
235
242
  ### Native ucode Runtime
236
243
 
237
- Prepare and inspect native `ucode` wiring:
238
-
239
244
  ```bash
240
245
  ufoo ucode doctor
241
246
  ufoo ucode prepare
242
247
  ufoo ucode build
243
248
  ```
244
249
 
245
- Use the low-level queue runtime:
246
-
247
- ```bash
248
- ucode-core submit --tool read --args-json '{"path":"README.md"}' --json
249
- ucode-core run-once --json
250
- ucode-core list --json
251
- ucode-core skills list --json
252
- ucode-core skills show <name>
253
- ```
254
-
255
- `ucode-core skills list` discovers ufoo/ucode built-in and local `SKILL.md` preset workflow capabilities for selection. It lists metadata only; full skill bodies are loaded by ucode only when the user explicitly references a skill such as `$demo` or a direct `SKILL.md` link.
250
+ `ucode` can discover built-in and local `SKILL.md` workflow capabilities. Full
251
+ skill bodies are loaded only when explicitly referenced.
256
252
 
257
253
  ## Configuration
258
254
 
259
- Project configuration is stored in `.ufoo/config.json`. `ucode` provider credentials are stored globally in `~/.ufoo/config.json` and merged into project config at load time.
255
+ Project configuration is stored in `.ufoo/config.json`. `ucode` provider
256
+ credentials are stored globally in `~/.ufoo/config.json` and merged at load time.
260
257
 
261
258
  Common project settings:
262
259
 
@@ -278,7 +275,9 @@ Common project settings:
278
275
  }
279
276
  ```
280
277
 
281
- Supported `launchMode` values are `auto`, `internal`, `internal-pty`, `tmux`, `terminal`, and `host`. `controllerMode` accepts `main`, `shadow`, `loop`, and legacy compatibility values.
278
+ Supported `launchMode` values: `auto`, `internal`, `tmux`, `terminal`, and
279
+ `host`. `controllerMode` accepts `main`, `shadow`, `loop`, and legacy
280
+ compatibility values.
282
281
 
283
282
  Global `ucode` settings:
284
283
 
@@ -292,81 +291,24 @@ Global `ucode` settings:
292
291
  }
293
292
  ```
294
293
 
295
- ## Project Layout
296
-
297
- Repository layout:
294
+ ## Source Layout
298
295
 
299
296
  ```text
300
- ufoo/
301
- bin/ CLI entry points
302
- src/ CommonJS implementation
303
- agent/ agent launch, bootstrap, runtime, providers
304
- bus/ project event bus
305
- chat/ terminal dashboard UI
306
- cli/ command adapters
307
- code/ native ucode core
308
- controller/ gate router, launch routing, shadow guards
309
- context/ decisions and context checks
310
- daemon/ project daemon, IPC, orchestration
311
- group/ prompt profiles and group templates
312
- memory/ shared memory store
313
- online/ relay client/server helpers
314
- projects/ global project registry
315
- providerapi/ redaction and provider shadow-diff helpers
316
- report/ agent report store
317
- terminal/ Terminal.app, iTerm2, tmux, host adapters
318
- tools/ controller/tool handler registry
319
- templates/groups/ built-in multi-agent group templates
320
- modules/ init templates and packaged module docs
321
- SKILLS/ packaged agent skills
322
- test/ Jest unit and integration tests
297
+ src/
298
+ app/ chat client state and CLI command entry
299
+ ui/ Ink components and pure formatting helpers
300
+ runtime/ daemon, projects, terminal adapters, contracts, privacy, process helpers
301
+ coordination/ bus, context, memory, history, reports, state, status
302
+ orchestration/ router/controller logic, groups, solo roles
303
+ agents/ launchers, providers, prompts, internal runner, activity, controller
304
+ code/ native ucode runtime, launcher, skills, file/shell tools
305
+ tools/ shared controller/worker tool registry and handlers
306
+ online/ relay client/server/runner/token helpers
323
307
  ```
324
308
 
325
- Created by `ufoo init --modules context,bus`:
326
-
327
- ```text
328
- your-project/
329
- .ufoo/
330
- memory/ durable project facts
331
- context/
332
- decisions/ decision files
333
- decisions.jsonl decision index
334
- bus/
335
- events/ event log files
336
- queues/ per-agent queues
337
- logs/ bus logs
338
- offsets/ read offsets
339
- agent/
340
- all-agents.json agent metadata registry
341
- daemon/
342
- counts/ bus daemon delivery counts
343
- docs -> docs/ optional symlink when project docs exist
344
- AGENTS.md canonical agent instructions
345
- CLAUDE.md Claude-compatible instructions file
346
- ```
347
-
348
- Created at runtime or when the related feature is used:
349
-
350
- ```text
351
- .ufoo/run/
352
- ufoo.sock project daemon IPC socket
353
- ufoo-daemon.pid project daemon pid
354
- ufoo-daemon.log project daemon log
355
- .ufoo/daemon/
356
- daemon.pid bus auto-inject daemon pid
357
- daemon.log bus auto-inject daemon log
358
- .ufoo/chat/ chat runtime state
359
- .ufoo/groups/ group runtime instances
360
- .ufoo/history/ agent input timeline
361
- .ufoo/agent/
362
- reports/ agent report records
363
- private-inbox/ private controller inbox
364
- sessions/ provider/session metadata
365
- ```
366
-
367
- `CLAUDE.md` may be a regular file or a symlink; project instructions should be edited in `AGENTS.md`.
368
-
369
- Global runtime state lives under `~/.ufoo/`, including `~/.ufoo/config.json` for `ucode` provider settings and `~/.ufoo/projects/runtime/*.json` for global chat project registry records.
309
+ See [PROJECT.md](PROJECT.md) for the maintainer-facing map and
310
+ [docs/source-structure.md](docs/source-structure.md) for detailed package
311
+ ownership.
370
312
 
371
313
  ## Development
372
314
 
@@ -383,41 +325,43 @@ Useful checks:
383
325
  npm run test:watch
384
326
  npm run test:coverage
385
327
  npm run bench:global-switch
386
- node bin/ucode-core.js --help
387
328
  ```
388
329
 
389
- The test runner is Jest with `testEnvironment: "node"`. Coverage ignores `node_modules` and `src/code/tui.js`.
330
+ The repository is CommonJS, targets Node.js 18+, and has no build step.
390
331
 
391
332
  ## Release
392
333
 
393
- There is no dedicated release script in `package.json`. Use the standard npm flow from a clean worktree:
334
+ Use the standard npm flow from a clean worktree:
394
335
 
395
336
  ```bash
396
337
  npm test
397
338
  npm pack --dry-run
398
- npm version patch # or minor/major
399
- npm publish
339
+ npm version patch
340
+ npm publish --access public
400
341
  git push --follow-tags
401
342
  ```
402
343
 
403
- `npm pack --dry-run` should be used to verify the final tarball. The current package includes the CLI entry points, `src/`, built-in templates, scripts, packaged skills, modules, package metadata, license, and README files.
344
+ `npm pack --dry-run` should be used to verify the final tarball. Publishing
345
+ requires an npm account/token with permission for `u-foo`.
404
346
 
405
347
  ## Troubleshooting
406
348
 
407
- If `ufoo` is not on `PATH`, run the repository entry directly:
349
+ Run a local entry directly if the linked binary is not on `PATH`:
408
350
 
409
351
  ```bash
410
352
  node bin/ufoo.js --help
411
353
  ```
412
354
 
413
- If Codex cannot write under its default home, point it at a project-local directory before launching chat or agents:
355
+ If Codex cannot write under its default home, point it at a project-local
356
+ directory before launching chat or agents:
414
357
 
415
358
  ```bash
416
359
  export CODEX_HOME="$PWD/.ufoo/codex"
417
360
  ufoo
418
361
  ```
419
362
 
420
- For Codex-friendly notifications, prefer foreground or daemon bus helpers instead of terminal text injection:
363
+ For Codex-friendly notifications, prefer bus helpers over raw terminal text
364
+ injection:
421
365
 
422
366
  ```bash
423
367
  ufoo bus alert codex:abc123 --daemon