u-foo 3.0.11 → 3.0.12

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.
@@ -1,18 +1,19 @@
1
1
  ---
2
2
  name: ubus
3
3
  description: |
4
- Poll event bus, check pending messages.
5
- Use when: (1) check if other Agents sent messages, (2) view bus status, (3) periodic polling.
4
+ Check and handle pending event-bus messages when /ubus is explicitly invoked.
5
+ Use when: (1) asked to check messages, (2) view bus status, (3) use watch/listen/auto modes.
6
6
  If not yet joined bus, will auto-join.
7
7
  ---
8
8
 
9
- # /ubus - Event Bus Polling
9
+ # /ubus - Check Event Bus Messages
10
10
 
11
- Check pending messages on the event bus.
11
+ Check and handle pending messages on the event bus when `/ubus` is explicitly
12
+ invoked.
12
13
 
13
14
  ## Arguments
14
15
 
15
- - `/ubus` - Check messages and show status
16
+ - `/ubus` - Pull pending messages and show status
16
17
  - `/ubus watch` - Start background auto-notification (title badge + bell + notification center)
17
18
  - `/ubus stop` - Stop background auto-notification
18
19
  - `/ubus listen` - Foreground continuous listener, print new messages (suitable for side terminal)
@@ -74,7 +75,7 @@ If argument is `listen`, foreground blocking listener (no background task tool n
74
75
  ufoo bus listen "$SUBSCRIBER" --from-beginning
75
76
  ```
76
77
 
77
- If argument is `auto`, unattended auto-execute:
78
+ If argument is `auto`, use unattended auto-execute:
78
79
 
79
80
  ```bash
80
81
  # Start daemon (background resident), auto-inject /ubus + Enter on new message
@@ -118,7 +119,8 @@ After you have read and processed the messages, you MUST acknowledge them to pre
118
119
  ufoo bus ack "$SUBSCRIBER"
119
120
  ```
120
121
 
121
- **This is critical** - if you don't ack, the daemon will keep injecting `/ubus` commands.
122
+ **This is critical** - if you don't ack, the runtime may retry delivery or keep
123
+ the event pending.
122
124
 
123
125
  **Default behavior is ack-only, no reply.** If there's nothing to do (no actionable task, no question to answer, no follow-up the sender genuinely needs), just ack and stop. Silence is a valid response — see "Handling Received Messages" below for when a reply IS warranted.
124
126
 
@@ -196,11 +198,15 @@ and the two of you will ping-pong forever.
196
198
  | `这个 bug 的根因是什么?` (question) | ✅ reply with answer |
197
199
  | `我帮你找到了 X,需要你做 Y` (request) | ✅ reply with status |
198
200
 
199
- When in doubt: ack and wait. If the sender genuinely needs something
200
- from you, they will follow up with a concrete question or task.
201
+ When in doubt: ack and stop. If the sender genuinely needs something from you,
202
+ they will follow up with a concrete question or task.
201
203
 
202
204
  ## Sending Messages
203
205
 
206
+ After sending a message, do not run `/ubus`, poll, sleep, or wait for a reply.
207
+ Continue the current task. Any follow-up message will be automatically injected
208
+ into your prompt/session.
209
+
204
210
  ### Smart Routing (when you don't know the target ID)
205
211
 
206
212
  If the user says "notify codex to do X" without specifying an ID, use smart routing:
@@ -117,11 +117,21 @@ ufoo memory audit mem-0001
117
117
 
118
118
  ## 3. Event Bus (ubus)
119
119
 
120
+ ### Delivery Rule
121
+
122
+ After `ufoo bus send` or `ufoo bus broadcast`, do not run
123
+ `ufoo bus check`, invoke `/ubus`, sleep, or wait for a reply. Continue the
124
+ current task. Any follow-up message will be automatically injected into your
125
+ prompt/session.
126
+
127
+ When `/ubus` is explicitly requested, follow its pending-message flow
128
+ immediately. Do not invoke it merely to wait for a reply to a message you sent.
129
+
120
130
  ### Commands
121
131
 
122
132
  ```bash
123
- ufoo bus check "$UFOO_SUBSCRIBER_ID" # Check pending messages
124
- ufoo bus ack "$UFOO_SUBSCRIBER_ID" # Acknowledge after handling
133
+ ufoo bus check "$UFOO_SUBSCRIBER_ID" # Used by an explicit /ubus request
134
+ ufoo bus ack "$UFOO_SUBSCRIBER_ID" # Acknowledge after handling
125
135
  ufoo bus send "<target>" "<message>" # Send message
126
136
  ufoo bus broadcast "<message>" # Broadcast to all
127
137
  ufoo bus status # Show bus status
@@ -149,13 +159,13 @@ Notes:
149
159
  - Type: `codex` (all codex agents)
150
160
  - Wildcard: `*` (broadcast)
151
161
 
152
- ### CRITICAL: When you receive pending messages
162
+ ### CRITICAL: When a message is received
153
163
 
154
164
  **EXECUTE tasks immediately. Do NOT ask the user.**
155
165
 
156
- 1. Check: `ufoo bus check $UFOO_SUBSCRIBER_ID`
157
- 2. Execute each task
158
- 3. **Always ack**: `ufoo bus ack $UFOO_SUBSCRIBER_ID`
166
+ 1. Read the available `[ufoo]<from:...>` message.
167
+ 2. Execute each task.
168
+ 3. **Always ack after handling**: `ufoo bus ack $UFOO_SUBSCRIBER_ID`
159
169
  4. Reply only when substantive — send `ufoo bus send "<publisher>" "<result>"` only if:
160
170
  - The sender asked a question → reply with the answer
161
171
  - The sender delegated a task → reply with the result / artifact
@@ -164,6 +174,10 @@ Notes:
164
174
  5. **Report** if the work arrived from `[manual]<to:...>` or `[ufoo]<from:...>`:
165
175
  `ufoo report progress|done|error "<short summary>"`
166
176
 
177
+ If `/ubus` is explicitly requested, run
178
+ `ufoo bus check "$UFOO_SUBSCRIBER_ID"` and then follow the same execute → ack
179
+ flow.
180
+
167
181
  ---
168
182
 
169
183
  ## 4. Message Format
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "u-foo",
3
- "version": "3.0.11",
3
+ "version": "3.0.12",
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",
@@ -40,6 +40,10 @@ const SHARED_UFOO_PROTOCOL = [
40
40
  "",
41
41
  "`ufoo bus send <target> \"<message>\"`",
42
42
  "",
43
+ "After sending, do not poll `ufoo bus check`, invoke `/ubus`, sleep, or wait",
44
+ "for a reply. Continue the current task; any follow-up message will be",
45
+ "automatically injected into your prompt/session.",
46
+ "",
43
47
  "On received bus work: execute it, then `ufoo bus ack \"$UFOO_SUBSCRIBER_ID\"`.",
44
48
  "Reply only if you have a concrete result, answer, or follow-up the sender",
45
49
  "needs. Default is ack-only; silence is a valid response.",
@@ -9,11 +9,13 @@ Participate in multi-agent coordination through the ufoo bus/context system:
9
9
  - Use shared memory for durable project facts. Read existing memory before writing new memory; do not use it for transient task state.
10
10
  - Support launch/close/resume/inject flows managed by ufoo daemon.
11
11
  - Prefer canonical ufoo commands (\`ufoo ctx\`, \`ufoo bus\`, \`ufoo memory\`, \`ufoo report\`) for coordination and status sync.
12
+ - After sending a bus message, do not poll \`ufoo bus check\`, invoke \`/ubus\`, sleep, or wait for a reply. Continue the current task; any follow-up message will be automatically injected into your prompt/session.
12
13
 
13
14
  Execution protocol:
14
15
  - On session start, check context quickly:
15
16
  \`ufoo ctx decisions -l\`
16
17
  \`ufoo ctx decisions -n 1\`
18
+ - If \`ubus\` is explicitly requested, execute its pending-message flow immediately; this does not change the no-polling rule after you send a message.
17
19
  - After handling work that arrived from chat (\`[manual]<to:...>\`) or bus (\`[ufoo]<from:...>\`), report lifecycle:
18
20
  \`ufoo report start|progress|done|error "<short summary>"\`
19
21
  Do not emulate report failures with \`ufoo bus send ufoo-agent ...\`; if \`ufoo report\` fails, continue without a fallback bus report.
@@ -17,11 +17,13 @@ ufoo integration requirements:
17
17
  - Use shared memory for durable project facts. Read existing memory before writing new memory; do not use it for transient task state.
18
18
  - Support launch/close/resume/inject flows managed by ufoo daemon.
19
19
  - Prefer canonical ufoo commands (`ufoo ctx`, `ufoo bus`, `ufoo memory`, `ufoo report`) for coordination and status sync.
20
+ - After sending a bus message, do not poll `ufoo bus check`, invoke `/ubus`, sleep, or wait for a reply. Continue the current task; any follow-up message will be automatically injected into your prompt/session.
20
21
 
21
22
  Execution protocol:
22
23
  - On session start, check context quickly:
23
24
  `ufoo ctx decisions -l`
24
25
  `ufoo ctx decisions -n 1`
26
+ - If `ubus` is explicitly requested, execute its pending-message flow immediately; this does not change the no-polling rule after you send a message.
25
27
  - After handling work that arrived from chat (`[manual]<to:...>`) or bus (`[ufoo]<from:...>`), report lifecycle:
26
28
  `ufoo report start|progress|done|error "<short summary>"`
27
29
  Do not emulate report failures with `ufoo bus send ufoo-agent ...`; if `ufoo report` fails, continue without a fallback bus report.