u-foo 1.9.2 → 1.9.4

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.
@@ -97,21 +97,18 @@ ufoo bus alert "$SUBSCRIBER" --stop
97
97
  ufoo bus check "$SUBSCRIBER"
98
98
  ```
99
99
 
100
- If pending events exist, show:
100
+ The system automatically prefixes each message with `[ufoo]<from:id(nickname)>` to identify the sender. You do not need to add this prefix yourself.
101
101
 
102
- ```
103
- === Pending Messages ===
102
+ If pending events exist, output looks like:
104
103
 
104
+ ```
105
105
  [ufoo]<from:claude-code:abc123(architect)>
106
106
  Type: message/targeted/message
107
107
  Content: {"message":"review src/main.ts","injection_mode":"immediate"}
108
-
109
- ---
110
- Please handle the above messages, after completion you can reply:
111
- ufoo bus send "architect" "Review completed, found 2 issues..."
112
108
  ```
113
109
 
114
- Note: Messages use `[ufoo]<from:id(nickname)>` prefix to distinguish from manual user input.
110
+ - The sender ID and nickname are in the `[ufoo]<from:...>` line use the ID to reply
111
+ - The actual task is in `Content.message`
115
112
 
116
113
  ### 5. IMPORTANT: Acknowledge messages after handling
117
114
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "u-foo",
3
- "version": "1.9.2",
3
+ "version": "1.9.4",
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",
@@ -67,6 +67,7 @@ async function withCapturedConsole(capture, fn) {
67
67
  function createCommandExecutor(options = {}) {
68
68
  const {
69
69
  projectRoot,
70
+ getActiveProjectRoot = () => projectRoot,
70
71
  parseCommand = () => null,
71
72
  escapeBlessed = (value) => String(value || ""),
72
73
  logMessage = () => {},
@@ -160,15 +161,16 @@ function createCommandExecutor(options = {}) {
160
161
 
161
162
  async function handleDaemonCommand(args = []) {
162
163
  const subcommand = args[0];
164
+ const targetRoot = getActiveProjectRoot();
163
165
 
164
166
  if (subcommand === "start") {
165
- if (isDaemonRunning(projectRoot)) {
167
+ if (isDaemonRunning(targetRoot)) {
166
168
  logMessage("system", "{white-fg}⚠{/white-fg} Daemon already running");
167
169
  } else {
168
170
  logMessage("system", "{white-fg}⚙{/white-fg} Starting daemon...");
169
- startDaemon(projectRoot);
171
+ startDaemon(targetRoot);
170
172
  await sleep(1000);
171
- if (isDaemonRunning(projectRoot)) {
173
+ if (isDaemonRunning(targetRoot)) {
172
174
  logMessage("system", "{white-fg}✓{/white-fg} Daemon started");
173
175
  } else {
174
176
  logMessage("error", "{white-fg}✗{/white-fg} Failed to start daemon");
@@ -179,9 +181,9 @@ function createCommandExecutor(options = {}) {
179
181
 
180
182
  if (subcommand === "stop") {
181
183
  logMessage("system", "{white-fg}⚙{/white-fg} Stopping daemon...");
182
- stopDaemon(projectRoot);
184
+ stopDaemon(targetRoot);
183
185
  await sleep(1000);
184
- if (!isDaemonRunning(projectRoot)) {
186
+ if (!isDaemonRunning(targetRoot)) {
185
187
  logMessage("system", "{white-fg}✓{/white-fg} Daemon stopped");
186
188
  } else {
187
189
  logMessage("error", "{white-fg}✗{/white-fg} Failed to stop daemon");
@@ -190,12 +192,21 @@ function createCommandExecutor(options = {}) {
190
192
  }
191
193
 
192
194
  if (subcommand === "restart") {
193
- await restartDaemon();
195
+ logMessage("system", "{white-fg}⚙{/white-fg} Restarting daemon...");
196
+ stopDaemon(targetRoot);
197
+ await sleep(500);
198
+ startDaemon(targetRoot);
199
+ await sleep(1000);
200
+ if (isDaemonRunning(targetRoot)) {
201
+ logMessage("system", "{white-fg}✓{/white-fg} Daemon restarted");
202
+ } else {
203
+ logMessage("error", "{white-fg}✗{/white-fg} Failed to restart daemon");
204
+ }
194
205
  return;
195
206
  }
196
207
 
197
208
  if (subcommand === "status") {
198
- if (isDaemonRunning(projectRoot)) {
209
+ if (isDaemonRunning(targetRoot)) {
199
210
  logMessage("system", "{white-fg}✓{/white-fg} Daemon is running");
200
211
  } else {
201
212
  logMessage("system", "{white-fg}✗{/white-fg} Daemon is not running");
@@ -108,7 +108,6 @@ function createDaemonConnection(options = {}) {
108
108
  if (exitRequested) return;
109
109
  if (!connectionLostNotified) {
110
110
  connectionLostNotified = true;
111
- logMessage("status", "{white-fg}✗{/white-fg} Daemon disconnected");
112
111
  }
113
112
  void ensureConnected();
114
113
  };
@@ -122,7 +121,6 @@ function createDaemonConnection(options = {}) {
122
121
  if (exitRequested) return false;
123
122
  if (reconnectPromise) return reconnectPromise;
124
123
  queueStatusLine("Reconnecting to daemon", { key: STATUS_KEY_RECONNECT });
125
- logMessage("status", "{white-fg}⚙{/white-fg} Reconnecting to daemon...");
126
124
  reconnectPromise = (async () => {
127
125
  const newClient = await connectClient();
128
126
  if (!newClient) {
package/src/chat/index.js CHANGED
@@ -1908,6 +1908,7 @@ async function runChat(projectRoot, options = {}) {
1908
1908
 
1909
1909
  const commandExecutor = createCommandExecutor({
1910
1910
  projectRoot,
1911
+ getActiveProjectRoot: () => activeProjectRoot,
1911
1912
  parseCommand,
1912
1913
  escapeBlessed,
1913
1914
  logMessage,
package/src/daemon/ops.js CHANGED
@@ -953,7 +953,7 @@ async function launchAgent(projectRoot, agent, count = 1, nickname = "", process
953
953
  normalizedAgent,
954
954
  nick,
955
955
  processManager,
956
- [],
956
+ extraArgs,
957
957
  extraEnvObject,
958
958
  hostContext
959
959
  );