u-foo 2.5.5 → 2.5.7
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/bin/ucode.js +9 -0
- package/package.json +1 -1
- package/src/agents/launch/notifier.js +6 -0
- package/src/agents/launch/ptyRunner.js +2 -2
- package/src/agents/launch/ptyWrapper.js +2 -2
- package/src/agents/prompts/native/index.js +2 -2
- package/src/agents/prompts/native/toolDescriptions/bash.js +1 -1
- package/src/agents/prompts/native/toolDescriptions/edit.js +1 -0
- package/src/agents/prompts/native/toolDescriptions/read.js +3 -2
- package/src/code/agent.js +77 -1086
- package/src/code/busConsumer.js +504 -0
- package/src/code/dispatch.js +1 -6
- package/src/code/launcher/ucode.js +8 -254
- package/src/code/launcher/ucodeBootstrap.js +18 -1
- package/src/code/launcher/ucodeBuild.js +0 -3
- package/src/code/launcher/ucodeDoctor.js +26 -8
- package/src/code/launcher/ucodeRuntimeConfig.js +12 -3
- package/src/code/nativeRunner.js +93 -113
- package/src/code/repl.js +610 -0
- package/src/code/sessionStore.js +5 -1
- package/src/code/skills/injection.js +17 -1
- package/src/code/taskDecomposer.js +47 -31
- package/src/code/tools/bash.js +19 -2
- package/src/code/tools/common.js +34 -0
- package/src/code/tools/edit.js +11 -3
- package/src/code/tools/read.js +20 -2
- package/src/coordination/bus/inject.js +52 -7
- package/src/coordination/bus/subscriber.js +33 -6
- package/src/runtime/daemon/deliveryScheduler.js +102 -2
- package/src/runtime/daemon/index.js +8 -1
- package/src/runtime/daemon/ops.js +23 -0
|
@@ -1340,7 +1340,14 @@ function startDaemon({ projectRoot, provider, model, resumeMode = "auto" }) {
|
|
|
1340
1340
|
log(`report bus event failed request=${meta.requestId || ""} error=${err.message || String(err)}`);
|
|
1341
1341
|
}
|
|
1342
1342
|
});
|
|
1343
|
-
const deliveryScheduler = new DeliveryScheduler(projectRoot, {
|
|
1343
|
+
const deliveryScheduler = new DeliveryScheduler(projectRoot, {
|
|
1344
|
+
log,
|
|
1345
|
+
emitDelivery: async ({ subscriber, status, error } = {}) => {
|
|
1346
|
+
if (status === "error") {
|
|
1347
|
+
log(`delivery failed subscriber=${subscriber || "unknown"} error=${error || "unknown"}`);
|
|
1348
|
+
}
|
|
1349
|
+
},
|
|
1350
|
+
});
|
|
1344
1351
|
deliveryScheduler.start();
|
|
1345
1352
|
|
|
1346
1353
|
handleIpcRequest = async (req, socket) => {
|
|
@@ -282,11 +282,28 @@ function buildShellEnvPrefix(extraEnv = {}) {
|
|
|
282
282
|
.join(" ");
|
|
283
283
|
}
|
|
284
284
|
|
|
285
|
+
// osascript can hang forever on permission prompts or a stuck System Events;
|
|
286
|
+
// launch and close both await runAppleScript, so without a timeout the daemon
|
|
287
|
+
// would stay blocked until restart.
|
|
288
|
+
const APPLESCRIPT_TIMEOUT_MS = 10000;
|
|
289
|
+
|
|
290
|
+
function killAfterTimeout(proc, cmd, onTimeout) {
|
|
291
|
+
return setTimeout(() => {
|
|
292
|
+
try {
|
|
293
|
+
proc.kill("SIGKILL");
|
|
294
|
+
} catch {
|
|
295
|
+
// process already exited, nothing to kill
|
|
296
|
+
}
|
|
297
|
+
onTimeout(new Error(`${cmd} timeout after ${APPLESCRIPT_TIMEOUT_MS}ms`));
|
|
298
|
+
}, APPLESCRIPT_TIMEOUT_MS);
|
|
299
|
+
}
|
|
300
|
+
|
|
285
301
|
function runAppleScript(lines) {
|
|
286
302
|
return new Promise((resolve, reject) => {
|
|
287
303
|
const proc = spawn("osascript", lines.flatMap((l) => ["-e", l]));
|
|
288
304
|
let stderr = "";
|
|
289
305
|
let stdout = "";
|
|
306
|
+
const timeout = killAfterTimeout(proc, "osascript", reject);
|
|
290
307
|
proc.stderr.on("data", (d) => {
|
|
291
308
|
stderr += d.toString("utf8");
|
|
292
309
|
});
|
|
@@ -294,9 +311,14 @@ function runAppleScript(lines) {
|
|
|
294
311
|
stdout += d.toString("utf8");
|
|
295
312
|
});
|
|
296
313
|
proc.on("close", (code) => {
|
|
314
|
+
clearTimeout(timeout);
|
|
297
315
|
if (code === 0) resolve(stdout.trim());
|
|
298
316
|
else reject(new Error(stderr || "osascript failed"));
|
|
299
317
|
});
|
|
318
|
+
proc.on("error", (err) => {
|
|
319
|
+
clearTimeout(timeout);
|
|
320
|
+
reject(err);
|
|
321
|
+
});
|
|
300
322
|
});
|
|
301
323
|
}
|
|
302
324
|
|
|
@@ -1317,5 +1339,6 @@ module.exports = {
|
|
|
1317
1339
|
toTerminalBinary,
|
|
1318
1340
|
toTmuxBinary,
|
|
1319
1341
|
buildResumeArgs,
|
|
1342
|
+
runAppleScript,
|
|
1320
1343
|
},
|
|
1321
1344
|
};
|