u-foo 2.3.15 → 2.3.17

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.
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # ufoo
2
2
 
3
- [中文文档](README.zh-CN.md)
3
+ [Chinese documentation](README.zh-CN.md)
4
4
 
5
- 🤖 Multi-agent AI collaboration framework for orchestrating Claude Code, OpenAI Codex, and custom AI agents.
5
+ Multi-agent workspace protocol for running Claude Code, OpenAI Codex, ufoo's native `ucode`, and coordinated agent groups from one project-scoped runtime.
6
6
 
7
- 📦 **npm**: [https://www.npmjs.com/package/u-foo](https://www.npmjs.com/package/u-foo)
7
+ Package: [u-foo on npm](https://www.npmjs.com/package/u-foo)
8
8
 
9
9
  [![npm version](https://img.shields.io/npm/v/u-foo.svg)](https://www.npmjs.com/package/u-foo)
10
10
  [![npm downloads](https://img.shields.io/npm/dm/u-foo.svg)](https://www.npmjs.com/package/u-foo)
@@ -12,395 +12,412 @@
12
12
  [![Node](https://img.shields.io/badge/node-%3E%3D18-brightgreen.svg)](https://nodejs.org)
13
13
  [![Platform](https://img.shields.io/badge/platform-macOS-blue.svg)](https://www.apple.com/macos)
14
14
 
15
- ## Why ufoo?
15
+ ## What It Does
16
16
 
17
- ufoo solves the challenge of coordinating multiple AI coding agents:
17
+ ufoo adds a coordination layer around coding agents:
18
18
 
19
- - **🔗 Unified Interface** - One chat UI to manage all your AI agents
20
- - **📬 Message Routing** - Agents can communicate and collaborate via event bus
21
- - **🧠 Context Sharing** - Shared decisions and knowledge across agents
22
- - **🚀 Auto-initialization** - Agent wrappers handle setup automatically
23
- - **📝 Decision Tracking** - Record architectural decisions and trade-offs
24
- - **⚡ Real-time Updates** - See agent status and messages instantly
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.
25
26
 
26
- ## Features
27
+ ## Requirements
27
28
 
28
- - **Chat Interface** - Interactive multi-agent chat UI (`ufoo chat`)
29
- - Real-time agent communication and status monitoring
30
- - Dashboard with agent list, online status, and quick actions
31
- - Direct messaging to specific agents with `@agent-name`
32
- - **Event Bus** - Real-time inter-agent messaging (`ufoo bus`)
33
- - **Context Sharing** - Shared decisions and project context (`ufoo ctx`)
34
- - **Agent Wrappers** - Auto-initialization for Claude Code (`uclaude`), Codex (`ucodex`), and ucode assistant (`ucode`)
35
- - **PTY Wrapper** - Intelligent terminal emulation with ready detection
36
- - **Smart Probe Injection** - Waits for agent initialization before injecting commands
37
- - **Consistent Branding** - Unified agent naming (e.g., ucode-1, claude-1, codex-1)
38
- - **Skills System** - Extensible agent capabilities (`ufoo skills`)
29
+ - 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.
39
32
 
40
33
  ## Installation
41
34
 
35
+ Install the published package:
36
+
42
37
  ```bash
43
- # Install globally from npm (recommended)
44
38
  npm install -g u-foo
45
39
  ```
46
40
 
47
- Or install from source:
41
+ Or link this repository for local development:
48
42
 
49
43
  ```bash
50
- git clone https://github.com/Icyoung/ufoo.git ~/.ufoo
51
- cd ~/.ufoo && npm install && npm link
44
+ git clone https://github.com/Icyoung/ufoo.git
45
+ cd ufoo
46
+ npm install
47
+ npm link
52
48
  ```
53
49
 
54
- After installation, the following commands are available globally: `ufoo`, `uclaude`, `ucodex`, `ucode`.
50
+ Installed binaries:
51
+
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.
55
57
 
56
58
  ## Quick Start
57
59
 
60
+ Initialize a project and open chat:
61
+
58
62
  ```bash
59
- # Initialize a project
60
63
  cd your-project
61
- ufoo init
62
-
63
- # Launch chat interface (default command)
64
- ufoo chat
65
- # or just
64
+ ufoo init --modules context,bus
66
65
  ufoo
66
+ ```
67
67
 
68
- # Use agent wrappers (auto-init + bus join)
69
- uclaude # Claude Code wrapper
70
- ucodex # Codex wrapper
71
- ucode # ucode assistant (self-developed AI coding agent)
68
+ Launch agents from the chat UI:
69
+
70
+ ```text
71
+ > /launch claude
72
+ > /launch codex
73
+ > /launch ucode
74
+ > @claude-1 read the project structure and summarize the risks
72
75
  ```
73
76
 
74
- ## Example Workflow
77
+ Or launch wrappers directly from a project directory:
75
78
 
76
79
  ```bash
77
- # 1. Start the chat interface
78
- $ ufoo
80
+ uclaude
81
+ ucodex
82
+ ucode
83
+ ```
79
84
 
80
- # 2. Launch agents from chat
81
- > /launch claude
82
- > /launch ucode
85
+ `ufoo chat` starts the project daemon when needed. For global cross-project mode, use:
83
86
 
84
- # 3. Send tasks to agents
85
- > @claude-1 Please analyze the current codebase structure
86
- > @ucode-1 Fix the bug in authentication module
87
+ ```bash
88
+ ufoo -g
89
+ ```
87
90
 
88
- # 4. Agents communicate via bus
89
- claude-1: Analysis complete. Found 3 areas needing refactoring...
90
- ucode-1: Bug fixed. Running tests...
91
+ ## Architecture
91
92
 
92
- # 5. Check decisions made
93
- > /decisions
93
+ ```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
94
113
  ```
95
114
 
96
- Native self-developed implementation lives under `src/code`.
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.
116
+
117
+ ## Core Usage
97
118
 
98
- Prepare and verify `ucode` runtime wiring:
119
+ ### Project Runtime
99
120
 
100
121
  ```bash
101
- ufoo ucode doctor
102
- ufoo ucode prepare
103
- ufoo ucode build
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
104
128
  ```
105
129
 
106
- Try native core queue runtime (WIP):
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.
131
+
132
+ ### Chat And Agents
107
133
 
108
134
  ```bash
109
- ucode-core submit --tool read --args-json '{"path":"README.md"}'
110
- ucode-core run-once --json
111
- ucode-core list --json
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
112
144
  ```
113
145
 
114
- ## Global Chat (`ufoo -g`)
146
+ Common chat commands include `/status`, `/bus list`, `/bus status`, `/settings`, `/project list`, `/project switch <index|path>`, `/open <path>`, `/resume list`, `/group status`, and `@nickname <message>`.
147
+
148
+ ### Event Bus
149
+
150
+ ```bash
151
+ ufoo bus join
152
+ ufoo bus status
153
+ ufoo bus send codex:abc123 "Please implement the approved slice."
154
+ ufoo bus check codex:abc123
155
+ ufoo bus listen codex:abc123 --from-beginning
156
+ ufoo bus alert codex:abc123 --daemon --notify
157
+ ufoo bus wake ufoo-builder --reason follow-up
158
+ ufoo bus activate ufoo-builder
159
+ ```
115
160
 
116
- Use `ufoo -g` (or `ufoo --global`) to launch a cross-project chat dashboard. Instead of being scoped to the current working directory, global mode runs from a home-scoped controller context and stores its runtime under `~/.ufoo`, then connects to project daemons on demand.
161
+ 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.
117
162
 
118
- When global chat stays on the home-scoped controller, plain prompts first go through the controller's `ufoo-agent`, which picks the best registered project and forwards the prompt to that project's `ufoo-agent` for agent-level routing.
163
+ ### Context, Memory, And Reports
119
164
 
120
165
  ```bash
121
- $ ufoo -g
166
+ ufoo ctx decisions -l
167
+ ufoo ctx decisions -n 1
168
+ ufoo ctx decisions new "Adopt API-backed loop architecture"
122
169
 
123
- > /project list # List all running project daemons
124
- > /project switch 2 # Switch to project #2
125
- > /open ~/Code/my-app # Initialize/start/switch to a project by path
126
- > /launch claude scope=inplace # Launch agent in current context
127
- > @claude-1 Start reviewing the auth module
170
+ ufoo memory add "Provider contract" --body "Durable fact..." --tags provider,contract
171
+ ufoo memory list --tag provider
172
+ ufoo memory show mem-0001
173
+
174
+ ufoo history build
175
+ ufoo history show 20
176
+ ufoo history prompt 30
177
+
178
+ ufoo report start "Implement README refresh" --task docs-readme --agent ufoo-builder
179
+ ufoo report done "README updated" --task docs-readme --agent ufoo-builder
180
+ ufoo report list
128
181
  ```
129
182
 
130
- | Command | Description |
131
- |---------|-------------|
132
- | `/project list` | List running projects from global runtime registry |
133
- | `/project switch <index\|path>` | Switch active project daemon connection |
134
- | `/open <path>` | Global-mode shortcut to initialize/start/open a project daemon by path |
135
- | `/launch <agent> scope=inplace` | Launch agent in current workspace |
136
- | `/launch <agent> scope=window` | Launch agent in separate terminal window |
183
+ Use decisions sparingly for plan-level constraints. Durable project facts belong in memory.
137
184
 
138
- Notes:
139
- - If you just type a normal message in the controller view, global `ufoo-agent` will try to route it to the most relevant registered project first.
140
- - The selected project's `ufoo-agent` then continues the second-hop routing to a concrete coding agent.
185
+ ### Command Reference
141
186
 
142
- ## Agent Configuration
187
+ | Area | Commands |
188
+ |------|----------|
189
+ | Runtime | `ufoo`, `ufoo chat`, `ufoo -g`, `ufoo init`, `ufoo status`, `ufoo doctor`, `ufoo daemon --start|--status|--stop` |
190
+ | Projects | `ufoo project list`, `ufoo project current`, `ufoo project switch` (chat-only in v1), chat `/open <path>` |
191
+ | Agents | `ufoo launch`, `ufoo solo list|run`, `ufoo role`, `ufoo resume <target>`, `ufoo recover list|run` |
192
+ | Bus | `ufoo bus join|status|send|check|listen|alert|wake|activate` |
193
+ | Context | `ufoo ctx doctor`, `ufoo ctx decisions`, `ufoo ctx sync` |
194
+ | Memory | `ufoo memory add|list|show|edit|forget|rebuild-index|audit` |
195
+ | Reports | `ufoo report start|progress|done|error|list` |
196
+ | Groups | `ufoo group templates|template|run|status|diagram|stop` |
197
+ | Online | `ufoo online server|token|room|channel|connect|send|inbox` |
198
+ | History | `ufoo history build|show|prompt` |
199
+ | Skills | `ufoo skills list|install` |
200
+ | Chat settings | `/settings`, `/settings agent`, `/settings router`, `/settings ucode` |
143
201
 
144
- Configure AI providers in `.ufoo/config.json`:
202
+ ### Groups
145
203
 
146
- ### ucode Configuration (Self-developed Assistant)
147
- ```json
148
- {
149
- "ucodeProvider": "openai", // or "anthropic", "azure", etc.
150
- "ucodeModel": "gpt-4-turbo-preview",
151
- "ucodeBaseUrl": "https://api.openai.com/v1",
152
- "ucodeApiKey": "sk-***"
153
- }
204
+ Built-in group templates live in `templates/groups/`.
205
+
206
+ ```bash
207
+ ufoo group templates
208
+ ufoo group template show build-lane
209
+ ufoo group template validate templates/groups/build-lane.json
210
+ ufoo group run build-lane --dry-run
211
+ ufoo group run build-lane --instance docs-refresh
212
+ ufoo group status
213
+ ufoo group diagram build-lane --mermaid
214
+ ufoo group stop docs-refresh
154
215
  ```
155
216
 
156
- ### Claude Configuration
157
- ```json
158
- {
159
- "claudeProvider": "claude-cli", // Uses Claude CLI
160
- "claudeModel": "claude-3-opus" // or "claude-3-sonnet"
161
- }
217
+ Current built-ins include `build-lane`, `build-ultra`, `design-system`, `product-discovery`, `ui-plan-review`, `ui-polish`, and `verify-ship`.
218
+
219
+ ### Online Relay
220
+
221
+ ```bash
222
+ ufoo online server --host 127.0.0.1 --port 8787
223
+ ufoo online token codex:abc123 --nickname builder
224
+ ufoo online channel list --nickname builder
225
+ ufoo online room create --nickname builder --name review-room --type private --password secret
226
+ ufoo online connect --nickname builder --room <room_id> --room-password secret
227
+ ufoo online send --nickname builder --room <room_id> --text "handoff ready"
228
+ ufoo online inbox builder --unread
229
+ ```
230
+
231
+ `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`.
232
+
233
+ ### Native ucode Runtime
234
+
235
+ Prepare and inspect native `ucode` wiring:
236
+
237
+ ```bash
238
+ ufoo ucode doctor
239
+ ufoo ucode prepare
240
+ ufoo ucode build
241
+ ```
242
+
243
+ Use the low-level queue runtime:
244
+
245
+ ```bash
246
+ ucode-core submit --tool read --args-json '{"path":"README.md"}' --json
247
+ ucode-core run-once --json
248
+ ucode-core list --json
162
249
  ```
163
250
 
164
- ### Codex Configuration
251
+ ## Configuration
252
+
253
+ 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.
254
+
255
+ Common project settings:
256
+
165
257
  ```json
166
258
  {
167
- "codexProvider": "codex-cli", // Uses Codex CLI
168
- "codexModel": "gpt-4" // or "gpt-4-turbo-preview"
259
+ "launchMode": "auto",
260
+ "agentProvider": "codex-cli",
261
+ "controllerMode": "main",
262
+ "codexInternalThreadMode": "api",
263
+ "codexAuthPath": "",
264
+ "codexOauthRefreshWindowSec": 300,
265
+ "claudeOauthProfile": "",
266
+ "claudeOauthTokenPath": "",
267
+ "claudeOauthRefreshWindowSec": 300,
268
+ "routerProvider": "",
269
+ "routerModel": "",
270
+ "agentModel": "",
271
+ "autoResume": true
169
272
  }
170
273
  ```
171
274
 
172
- ### Complete Example
275
+ Supported `launchMode` values are `auto`, `internal`, `internal-pty`, `tmux`, `terminal`, and `host`. `controllerMode` accepts `main`, `shadow`, `loop`, and legacy compatibility values.
276
+
277
+ Global `ucode` settings:
278
+
173
279
  ```json
174
280
  {
175
- "launchMode": "internal",
176
281
  "ucodeProvider": "openai",
177
- "ucodeModel": "gpt-4-turbo-preview",
282
+ "ucodeModel": "gpt-4.1",
178
283
  "ucodeBaseUrl": "https://api.openai.com/v1",
179
- "ucodeApiKey": "sk-***",
180
- "claudeProvider": "claude-cli",
181
- "claudeModel": "claude-3-opus",
182
- "codexProvider": "codex-cli",
183
- "codexModel": "gpt-4"
284
+ "ucodeApiKey": "sk-...",
285
+ "ucodeAgentDir": ""
184
286
  }
185
287
  ```
186
288
 
187
- `ucode` writes these into a global config directory (`~/.ufoo/agent/ucode/config`) and uses them for native planner/engine calls. Configure once, use across all projects. Project-level `.ufoo/config.json` can override global settings when needed.
289
+ ## Project Layout
188
290
 
189
- ## Architecture
291
+ Repository layout:
190
292
 
293
+ ```text
294
+ ufoo/
295
+ bin/ CLI entry points
296
+ src/ CommonJS implementation
297
+ agent/ agent launch, bootstrap, runtime, providers
298
+ bus/ project event bus
299
+ chat/ terminal dashboard UI
300
+ cli/ command adapters
301
+ code/ native ucode core
302
+ controller/ gate router, launch routing, shadow guards
303
+ context/ decisions and context checks
304
+ daemon/ project daemon, IPC, orchestration
305
+ group/ prompt profiles and group templates
306
+ memory/ shared memory store
307
+ online/ relay client/server helpers
308
+ projects/ global project registry
309
+ providerapi/ redaction and provider shadow-diff helpers
310
+ report/ agent report store
311
+ terminal/ Terminal.app, iTerm2, tmux, host adapters
312
+ tools/ controller/tool handler registry
313
+ templates/groups/ built-in multi-agent group templates
314
+ modules/ init templates and packaged module docs
315
+ SKILLS/ packaged agent skills
316
+ test/ Jest unit and integration tests
191
317
  ```
192
- ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
193
- │ uclaude │ │ ucodex │ │ other... │
194
- └──────┬──────┘ └──────┬──────┘ └──────┬──────┘
195
- │ │ │
196
- └───────────────────┼───────────────────┘
197
-
198
- ┌──────▼──────┐
199
- │ ufoo bus │ Event Bus
200
- └──────┬──────┘
201
-
202
- ┌────────────┼────────────┐
203
- │ │ │
204
- ┌──────▼──────┐ ┌───▼───┐ ┌──────▼──────┐
205
- │ .ufoo/bus │ │context│ │ decisions │
206
- └─────────────┘ └───────┘ └─────────────┘
207
- ```
208
-
209
- Bus state lives in `.ufoo/agent/all-agents.json` (metadata), `.ufoo/bus/*` (queues/events), and `.ufoo/daemon/*` (bus daemon runtime).
210
-
211
- ## Commands
212
-
213
- ### Core Commands
214
- | Command | Description |
215
- |---------|-------------|
216
- | `ufoo` | Launch chat interface (default) |
217
- | `ufoo chat` | Launch interactive multi-agent chat UI |
218
- | `ufoo -g` | Launch global chat mode (cross-project dashboard) |
219
- | `ufoo init` | Initialize .ufoo in current project |
220
- | `ufoo status` | Show banner, unread bus messages, open decisions |
221
- | `ufoo doctor` | Check installation health |
222
318
 
223
- ### Agent Management
224
- | Command | Description |
225
- |---------|-------------|
226
- | `ufoo daemon start` | Start ufoo daemon |
227
- | `ufoo daemon stop` | Stop ufoo daemon |
228
- | `ufoo daemon status` | Check daemon status |
229
- | `ufoo resume [nickname]` | Resume agent sessions |
230
-
231
- ### Event Bus
232
- | Command | Description |
233
- |---------|-------------|
234
- | `ufoo bus join` | Join event bus (auto by agent wrappers) |
235
- | `ufoo bus send <id> <msg>` | Send message to agent |
236
- | `ufoo bus check <id>` | Check pending messages |
237
- | `ufoo bus status` | Show bus status and online agents |
238
-
239
- ### Context & Decisions
240
- | Command | Description |
241
- |---------|-------------|
242
- | `ufoo ctx decisions -l` | List all decisions |
243
- | `ufoo ctx decisions -n 1` | Show latest decision |
244
- | `ufoo ctx decisions new <title>` | Create new decision |
245
-
246
- ### Skills
247
- | Command | Description |
248
- |---------|-------------|
249
- | `ufoo skills list` | List available skills |
250
- | `ufoo skills show <skill>` | Show skill details |
251
-
252
- Notes:
253
- - Claude CLI headless agent uses `--dangerously-skip-permissions`.
254
-
255
- ## Project Structure
319
+ Created by `ufoo init --modules context,bus`:
256
320
 
321
+ ```text
322
+ your-project/
323
+ .ufoo/
324
+ memory/ durable project facts
325
+ context/
326
+ decisions/ decision files
327
+ decisions.jsonl decision index
328
+ bus/
329
+ events/ event log files
330
+ queues/ per-agent queues
331
+ logs/ bus logs
332
+ offsets/ read offsets
333
+ agent/
334
+ all-agents.json agent metadata registry
335
+ daemon/
336
+ counts/ bus daemon delivery counts
337
+ docs -> docs/ optional symlink when project docs exist
338
+ AGENTS.md canonical agent instructions
339
+ CLAUDE.md Claude-compatible instructions file
257
340
  ```
258
- ufoo/
259
- ├── bin/
260
- │ ├── ufoo # Main CLI entry (bash)
261
- │ ├── ufoo.js # Node wrapper
262
- │ ├── uclaude # Claude Code wrapper
263
- │ ├── ucodex # Codex wrapper
264
- │ └── ucode # ucode assistant wrapper
265
- ├── SKILLS/ # Global skills (uinit, ustatus)
266
- ├── src/
267
- │ ├── bus/ # Event bus implementation (JS)
268
- │ ├── daemon/ # Daemon + chat bridge
269
- │ ├── agent/ # Agent launch/runtime
270
- │ └── code/ # Native ucode core implementation
271
- ├── scripts/ # Legacy helpers (bash, deprecated)
272
- ├── modules/
273
- │ ├── context/ # Decision/context protocol
274
- │ ├── bus/ # Bus module resources
275
- │ └── resources/ # UI/icons (optional)
276
- ├── AGENTS.md # Project instructions (canonical)
277
- └── CLAUDE.md # Points to AGENTS.md
341
+
342
+ Created at runtime or when the related feature is used:
343
+
344
+ ```text
345
+ .ufoo/run/
346
+ ufoo.sock project daemon IPC socket
347
+ ufoo-daemon.pid project daemon pid
348
+ ufoo-daemon.log project daemon log
349
+ .ufoo/daemon/
350
+ daemon.pid bus auto-inject daemon pid
351
+ daemon.log bus auto-inject daemon log
352
+ .ufoo/chat/ chat runtime state
353
+ .ufoo/groups/ group runtime instances
354
+ .ufoo/history/ agent input timeline
355
+ .ufoo/agent/
356
+ reports/ agent report records
357
+ private-inbox/ private controller inbox
358
+ sessions/ provider/session metadata
278
359
  ```
279
360
 
280
- ## Per-Project Layout
361
+ `CLAUDE.md` may be a regular file or a symlink; project instructions should be edited in `AGENTS.md`.
281
362
 
282
- After `ufoo init`, your project gets:
363
+ 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.
283
364
 
284
- ```
285
- your-project/
286
- ├── .ufoo/
287
- │ ├── bus/
288
- │ │ ├── events/ # Event log (append-only)
289
- │ │ ├── queues/ # Per-agent message queues
290
- │ │ └── offsets/ # Read position tracking
291
- │ └── context/
292
- │ ├── decisions/ # Decision records
293
- │ └── decisions.jsonl # Decision index
294
- ├── scripts/ # Legacy symlink (optional)
295
- ├── AGENTS.md # Injected protocol blocks
296
- └── CLAUDE.md # → AGENTS.md
365
+ ## Development
366
+
367
+ ```bash
368
+ npm install
369
+ npm link
370
+ node bin/ufoo.js --help
371
+ npm test
297
372
  ```
298
373
 
299
- ## Chat Interface
300
-
301
- The interactive chat UI provides a centralized hub for agent management:
302
-
303
- ### Features
304
- - **Real-time Communication** - See all agent messages in one place
305
- - **Agent Dashboard** - Monitor online status, session IDs, and nicknames
306
- - **Direct Messaging** - Use `@agent-name` to target specific agents
307
- - **Command Completion** - Tab completion for commands and agent names
308
- - **Mouse Support** - Toggle with `Ctrl+M` for scrolling vs text selection
309
- - **Session History** - Persistent message history across sessions
310
-
311
- ### Keyboard Shortcuts
312
- | Key | Action |
313
- |-----|--------|
314
- | `Tab` | Auto-complete commands/agents |
315
- | `Ctrl+C` | Exit chat |
316
- | `Ctrl+M` | Toggle mouse mode |
317
- | `Ctrl+L` | Clear screen |
318
- | `Ctrl+R` | Refresh agent list |
319
- | `↑/↓` | Navigate command history |
320
-
321
- ### Chat Commands
322
- | Command | Description |
323
- |---------|-------------|
324
- | `/help` | Show available commands |
325
- | `/agents` | List online agents |
326
- | `/clear` | Clear chat history |
327
- | `/settings` | Configure chat preferences |
328
- | `@agent-name <message>` | Send to specific agent |
329
-
330
- ## Agent Communication
331
-
332
- Agents communicate via the event bus:
374
+ Useful checks:
333
375
 
334
376
  ```bash
335
- # Agent A sends task to Agent B
336
- ufoo bus send "codex:abc123" "Please analyze the project structure"
337
-
338
- # Agent B checks and executes
339
- ufoo bus check "codex:abc123"
340
- # → Executes task automatically
341
- # → Replies with result
342
- ufoo bus send "claude-code:xyz789" "分析完成:..."
377
+ npm run test:watch
378
+ npm run test:coverage
379
+ npm run bench:global-switch
380
+ node bin/ucode-core.js --help
343
381
  ```
344
382
 
345
- ## Skills (for Agents)
383
+ The test runner is Jest with `testEnvironment: "node"`. Coverage ignores `node_modules` and `src/code/tui.js`.
346
384
 
347
- Built-in skills triggered by slash commands:
385
+ ## Release
348
386
 
349
- - `/ubus` - Check and auto-execute pending messages
350
- - `/uctx` - Quick context status check
351
- - `/ustatus` - Unified status view (banner, unread bus, open decisions)
352
- - `/uinit` - Manual .ufoo initialization
387
+ There is no dedicated release script in `package.json`. Use the standard npm flow from a clean worktree:
353
388
 
354
- ## Requirements
355
-
356
- - **macOS** - Required for Terminal.app/iTerm2 integration
357
- - **Node.js >= 18** - For npm installation and JavaScript runtime
358
- - **Bash 4+** - For shell scripts and command execution
359
- - **Terminal** - iTerm2 or Terminal.app for agent launching
389
+ ```bash
390
+ npm test
391
+ npm pack --dry-run
392
+ npm version patch # or minor/major
393
+ npm publish
394
+ git push --follow-tags
395
+ ```
360
396
 
361
- ## Codex CLI Notes
397
+ `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.
362
398
 
363
- `ufoo chat` automatically starts the daemon if not running - no need to run `ufoo daemon start` separately.
399
+ ## Troubleshooting
364
400
 
365
- If Codex CLI fails with permission errors under `~/.codex` (e.g. sessions dir), set `CODEX_HOME` to a writable path:
401
+ If `ufoo` is not on `PATH`, run the repository entry directly:
366
402
 
367
403
  ```bash
368
- export CODEX_HOME="$PWD/.ufoo/codex"
369
- ufoo chat # daemon auto-starts
404
+ node bin/ufoo.js --help
370
405
  ```
371
406
 
372
- ## Development
407
+ If Codex cannot write under its default home, point it at a project-local directory before launching chat or agents:
373
408
 
374
- ### Setup
375
409
  ```bash
376
- # Clone the repository
377
- git clone https://github.com/Icyoung/ufoo.git
378
- cd ufoo
379
-
380
- # Install dependencies
381
- npm install
382
-
383
- # Link for local development
384
- npm link
385
-
386
- # Run tests
387
- npm test
410
+ export CODEX_HOME="$PWD/.ufoo/codex"
411
+ ufoo
388
412
  ```
389
413
 
390
- ### Contributing
391
- - Fork the repository
392
- - Create a feature branch (`git checkout -b feature/amazing-feature`)
393
- - Commit your changes (`git commit -m 'Add amazing feature'`)
394
- - Push to the branch (`git push origin feature/amazing-feature`)
395
- - Open a Pull Request
414
+ For Codex-friendly notifications, prefer foreground or daemon bus helpers instead of terminal text injection:
396
415
 
397
- ### Project Structure
398
- - `src/` - Core JavaScript implementation
399
- - `bin/` - CLI entry points
400
- - `modules/` - Modular features (bus, context, etc.)
401
- - `test/` - Unit and integration tests
402
- - `SKILLS/` - Agent skill definitions
416
+ ```bash
417
+ ufoo bus alert codex:abc123 --daemon
418
+ ufoo bus listen codex:abc123
419
+ ```
403
420
 
404
421
  ## License
405
422
 
406
- UNLICENSED (Private)
423
+ UNLICENSED. See [LICENSE](LICENSE).