@integrity-labs/agt-cli 0.28.23 → 0.28.25
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.
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
provisionStopHook,
|
|
23
23
|
requireHost,
|
|
24
24
|
safeWriteJsonAtomic
|
|
25
|
-
} from "../chunk-
|
|
25
|
+
} from "../chunk-6MF3QAKQ.js";
|
|
26
26
|
import {
|
|
27
27
|
getProjectDir as getProjectDir2,
|
|
28
28
|
getReadyTasks,
|
|
@@ -5362,7 +5362,7 @@ var cachedMaintenanceWindow = null;
|
|
|
5362
5362
|
var lastVersionCheckAt = 0;
|
|
5363
5363
|
var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
|
|
5364
5364
|
var lastResponsivenessProbeAt = 0;
|
|
5365
|
-
var agtCliVersion = true ? "0.28.
|
|
5365
|
+
var agtCliVersion = true ? "0.28.25" : "dev";
|
|
5366
5366
|
function resolveBrewPath(execFileSync4) {
|
|
5367
5367
|
try {
|
|
5368
5368
|
const out = execFileSync4("which", ["brew"], { timeout: 5e3 }).toString().trim();
|
|
@@ -11773,12 +11773,32 @@ function startPolling() {
|
|
|
11773
11773
|
scheduleNext();
|
|
11774
11774
|
});
|
|
11775
11775
|
}
|
|
11776
|
+
async function reportSelfUpdateRestarts() {
|
|
11777
|
+
const liveAgents = [...agentState.persistentSessionAgents];
|
|
11778
|
+
if (liveAgents.length === 0) return;
|
|
11779
|
+
const reason = `CLI self-update${pendingUpgradeVersion ? ` to ${pendingUpgradeVersion}` : ""}`;
|
|
11780
|
+
const posts = Promise.allSettled(
|
|
11781
|
+
liveAgents.map((codeName) => {
|
|
11782
|
+
const agentId = agentState.codeNameToAgentId.get(codeName);
|
|
11783
|
+
if (!agentId) return Promise.resolve();
|
|
11784
|
+
return api.post("/host/restart-event", {
|
|
11785
|
+
agent_id: agentId,
|
|
11786
|
+
source: "self-update",
|
|
11787
|
+
reason
|
|
11788
|
+
});
|
|
11789
|
+
})
|
|
11790
|
+
).then(() => void 0);
|
|
11791
|
+
const deadline = new Promise((resolve) => setTimeout(resolve, 3e3));
|
|
11792
|
+
await Promise.race([posts, deadline]);
|
|
11793
|
+
}
|
|
11776
11794
|
function scheduleNext() {
|
|
11777
11795
|
if (!running || !config) return;
|
|
11778
11796
|
const restartNow = () => {
|
|
11779
11797
|
log(`[self-update] Restarting manager to load upgraded binary (${pendingUpgradeVersion ?? "unknown version"})`);
|
|
11780
|
-
void
|
|
11781
|
-
|
|
11798
|
+
void reportSelfUpdateRestarts().catch((err) => log(`[self-update] restart-event audit failed: ${err.message}`)).finally(() => {
|
|
11799
|
+
void stopPolling({ forcedExitCode: SUPERVISOR_RESTART_EXIT_CODE }).then(() => {
|
|
11800
|
+
process.exit(SUPERVISOR_RESTART_EXIT_CODE);
|
|
11801
|
+
});
|
|
11782
11802
|
});
|
|
11783
11803
|
};
|
|
11784
11804
|
if (restartAfterUpgrade) {
|