@songsid/agend 2.3.0-beta.10 → 2.3.0-beta.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.
- package/dist/agent-whats-new.js +14 -9
- package/dist/agent-whats-new.js.map +1 -1
- package/dist/channel/adapters/discord-client-retirement.d.ts +5 -0
- package/dist/channel/adapters/discord-client-retirement.js +57 -0
- package/dist/channel/adapters/discord-client-retirement.js.map +1 -0
- package/dist/channel/adapters/discord.d.ts +2 -0
- package/dist/channel/adapters/discord.js +14 -4
- package/dist/channel/adapters/discord.js.map +1 -1
- package/dist/cli.js +12 -79
- package/dist/cli.js.map +1 -1
- package/dist/daemon.d.ts +3 -0
- package/dist/daemon.js +25 -0
- package/dist/daemon.js.map +1 -1
- package/dist/fleet-manager.d.ts +8 -1
- package/dist/fleet-manager.js +101 -33
- package/dist/fleet-manager.js.map +1 -1
- package/dist/fleet-process-handlers.d.ts +18 -0
- package/dist/fleet-process-handlers.js +69 -0
- package/dist/fleet-process-handlers.js.map +1 -0
- package/dist/general-knowledge/skills/web-appearance/SKILL.md +1 -1
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +8 -2
- package/dist/instance-lifecycle.d.ts +2 -0
- package/dist/instance-lifecycle.js +11 -6
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/outbound-schemas.js +1 -1
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/settings-api.d.ts +4 -0
- package/dist/settings-api.js +23 -0
- package/dist/settings-api.js.map +1 -1
- package/dist/ui/app-effects.js +13 -1
- package/dist/ui/chat-render.js +16 -1
- package/dist/ui/chat-store.js +32 -10
- package/dist/ui/chat-strings.js +16 -0
- package/dist/ui/chat-thread.js +14 -1
- package/dist/ui/panel-chat.js +57 -9
- package/dist/ui/panel-fleet.js +2 -1
- package/dist/ui/panel-settings.js +24 -0
- package/dist/ui/settings-strings.js +2 -0
- package/dist/ui/shared/app-i18n.js +1 -1
- package/dist/ui/shared/app-route.js +18 -0
- package/dist/ui/shared/app-shell.js +17 -18
- package/dist/ui/shared/app.css +1 -1
- package/dist/ui/shared/effect-owner-source.js +8 -1
- package/dist/ui/shared/effect-registry.js +10 -2
- package/dist/ui/shared/owner-css.js +30 -1
- package/dist/web-api.d.ts +6 -2
- package/dist/web-api.js +50 -14
- package/dist/web-api.js.map +1 -1
- package/dist/web-chat-history.d.ts +4 -0
- package/dist/web-chat-history.js +7 -2
- package/dist/web-chat-history.js.map +1 -1
- package/dist/web-image-meta.d.ts +13 -0
- package/dist/web-image-meta.js +62 -0
- package/dist/web-image-meta.js.map +1 -1
- package/dist/web-owner-css-store.d.ts +43 -1
- package/dist/web-owner-css-store.js +65 -9
- package/dist/web-owner-css-store.js.map +1 -1
- package/dist/web-settings-tools.js +7 -4
- package/dist/web-settings-tools.js.map +1 -1
- package/dist/web-upload.d.ts +13 -0
- package/dist/web-upload.js +39 -3
- package/dist/web-upload.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import "./node-warnings.js";
|
|
3
|
+
import { installFleetProcessHandlers } from "./fleet-process-handlers.js";
|
|
3
4
|
import { applyNetworkReliabilityDefaults } from "./network-family.js";
|
|
4
5
|
// Preserve Node's dual-stack Happy Eyeballs behavior, but avoid its 250ms
|
|
5
6
|
// premature-connect failure on WSL/VPN/high-load hosts (#658).
|
|
@@ -275,67 +276,16 @@ fleet
|
|
|
275
276
|
// without these a Ctrl-C or `systemctl stop` in that window got Node's default
|
|
276
277
|
// behaviour: instant death with fleet.pid already written, databases unclosed,
|
|
277
278
|
// and every tmux window orphaned.
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
return; // SIGINT and SIGTERM share this, and crash paths call stopAll too
|
|
282
|
-
stopping = true;
|
|
283
|
-
console.log("\nStopping fleet...");
|
|
284
|
-
// stopAll fences new profile requests synchronously, before it awaits
|
|
285
|
-
// the shared owner's stop/save. Stopping the env handle first would leave
|
|
286
|
-
// the manager open to replacing that closed owner during the save.
|
|
287
|
-
await fm.stopAll().catch(err => console.error("Shutdown error:", err));
|
|
288
|
-
process.exit(0);
|
|
289
|
-
};
|
|
290
|
-
process.on("SIGINT", shutdown);
|
|
291
|
-
process.on("SIGTERM", () => {
|
|
292
|
-
// The restart that interrupted a fleet used to leave no trace of who asked.
|
|
293
|
-
console.log(describeSignalSource(DATA_DIR, "SIGTERM"));
|
|
294
|
-
void shutdown();
|
|
295
|
-
});
|
|
296
|
-
process.on("uncaughtException", (err) => {
|
|
297
|
-
// An uncaught exception leaves unknown state — still the one case worth
|
|
298
|
-
// tearing down for.
|
|
299
|
-
console.error("Uncaught exception:", err);
|
|
300
|
-
if (stopping)
|
|
301
|
-
return;
|
|
302
|
-
stopping = true;
|
|
303
|
-
fm.stopAll().catch(() => { }).finally(() => process.exit(1));
|
|
304
|
-
});
|
|
305
|
-
process.on("unhandledRejection", (err) => {
|
|
306
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
307
|
-
// 409 = another bot poller exists — the adapter retries, don't crash.
|
|
308
|
-
if (msg.includes("409") && msg.includes("getUpdates")) {
|
|
309
|
-
console.error("Bot polling conflict (409) — retrying...");
|
|
310
|
-
return;
|
|
311
|
-
}
|
|
312
|
-
// Do NOT take the fleet down. A rejected promise in one instance's tmux
|
|
313
|
-
// call, health tick, or model switch used to stop every other working
|
|
314
|
-
// instance and exit(1) — the widest blast radius in the process. The
|
|
315
|
-
// per-instance health check and crash recovery handle a genuinely broken
|
|
316
|
-
// instance on their own.
|
|
317
|
-
//
|
|
318
|
-
// Surviving quietly would be its own failure mode, so this reports to the
|
|
319
|
-
// General topic as well as the log: the operator must not have to read
|
|
320
|
-
// daemon.log to learn the fleet swallowed a fault. notifyFleetError()
|
|
321
|
-
// throttles repeats, since these usually arrive from a loop.
|
|
322
|
-
console.error("Unhandled rejection (fleet continues):", err);
|
|
323
|
-
if (err instanceof Error && err.stack)
|
|
324
|
-
console.error(err.stack);
|
|
325
|
-
try {
|
|
326
|
-
fm.notifyFleetError(`⚠️ Fleet caught an unhandled error and kept running:\n\`${msg}\`\nSee daemon.log for the stack trace.`);
|
|
327
|
-
}
|
|
328
|
-
catch (notifyErr) {
|
|
329
|
-
// Never let the reporting path itself become an unhandled rejection.
|
|
330
|
-
console.error("Failed to report unhandled rejection:", notifyErr);
|
|
331
|
-
}
|
|
279
|
+
const handlers = installFleetProcessHandlers({
|
|
280
|
+
dataDir: DATA_DIR, manager: fm, runtime: process, console,
|
|
281
|
+
describeSignal: () => describeSignalSource(DATA_DIR, "SIGTERM"),
|
|
332
282
|
});
|
|
333
283
|
await fm.startCpuProfileControl().catch(err => console.warn(`Local profile control unavailable: ${String(err)}`));
|
|
334
284
|
await fm.startSettingsConfirmationControl().catch(err => console.warn(`Local Settings confirmation unavailable: ${String(err)}`));
|
|
335
|
-
if (stopping)
|
|
285
|
+
if (handlers.stopping)
|
|
336
286
|
return;
|
|
337
287
|
cpuProfile = await fm.startEnvironmentCpuProfile();
|
|
338
|
-
if (stopping) {
|
|
288
|
+
if (handlers.stopping) {
|
|
339
289
|
await cpuProfile?.stop("startup superseded by shutdown");
|
|
340
290
|
return;
|
|
341
291
|
}
|
|
@@ -559,31 +509,14 @@ fleet
|
|
|
559
509
|
return;
|
|
560
510
|
const { FleetManager } = await import("./fleet-manager.js");
|
|
561
511
|
const fm = new FleetManager(DATA_DIR);
|
|
512
|
+
const handlers = installFleetProcessHandlers({
|
|
513
|
+
dataDir: DATA_DIR, manager: fm, runtime: process, console,
|
|
514
|
+
describeSignal: () => describeSignalSource(DATA_DIR, "SIGTERM"),
|
|
515
|
+
});
|
|
516
|
+
if (handlers.stopping)
|
|
517
|
+
return;
|
|
562
518
|
await fm.startAll(FLEET_CONFIG_PATH);
|
|
563
519
|
console.log("Fleet restarted with new code");
|
|
564
|
-
// Keep process alive (same as fleet start)
|
|
565
|
-
const shutdown = async () => {
|
|
566
|
-
console.log("\nStopping fleet...");
|
|
567
|
-
await fm.stopAll();
|
|
568
|
-
process.exit(0);
|
|
569
|
-
};
|
|
570
|
-
process.on("SIGINT", shutdown);
|
|
571
|
-
process.on("SIGTERM", shutdown);
|
|
572
|
-
process.on("uncaughtException", async (err) => {
|
|
573
|
-
console.error("Uncaught exception:", err);
|
|
574
|
-
await fm.stopAll().catch(() => { });
|
|
575
|
-
process.exit(1);
|
|
576
|
-
});
|
|
577
|
-
process.on("unhandledRejection", async (err) => {
|
|
578
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
579
|
-
if (msg.includes("409") && msg.includes("getUpdates")) {
|
|
580
|
-
console.error("Bot polling conflict (409) — retrying...");
|
|
581
|
-
return;
|
|
582
|
-
}
|
|
583
|
-
console.error("Unhandled rejection:", err);
|
|
584
|
-
await fm.stopAll().catch(() => { });
|
|
585
|
-
process.exit(1);
|
|
586
|
-
});
|
|
587
520
|
}
|
|
588
521
|
else {
|
|
589
522
|
// Instance-only restart (existing behavior)
|