u-foo 1.9.3 → 1.9.5
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/package.json
CHANGED
|
@@ -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(
|
|
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(
|
|
171
|
+
startDaemon(targetRoot);
|
|
170
172
|
await sleep(1000);
|
|
171
|
-
if (isDaemonRunning(
|
|
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(
|
|
184
|
+
stopDaemon(targetRoot);
|
|
183
185
|
await sleep(1000);
|
|
184
|
-
if (!isDaemonRunning(
|
|
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
|
-
|
|
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(
|
|
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