@integrity-labs/agt-cli 0.28.23 → 0.28.24
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/bin/agt.js
CHANGED
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
success,
|
|
34
34
|
table,
|
|
35
35
|
warn
|
|
36
|
-
} from "../chunk-
|
|
36
|
+
} from "../chunk-Z5GPBUID.js";
|
|
37
37
|
import {
|
|
38
38
|
CHANNEL_REGISTRY,
|
|
39
39
|
DEPLOYMENT_TEMPLATES,
|
|
@@ -4773,7 +4773,7 @@ import { execFileSync, execSync } from "child_process";
|
|
|
4773
4773
|
import { existsSync as existsSync10, realpathSync as realpathSync2 } from "fs";
|
|
4774
4774
|
import chalk18 from "chalk";
|
|
4775
4775
|
import ora16 from "ora";
|
|
4776
|
-
var cliVersion = true ? "0.28.
|
|
4776
|
+
var cliVersion = true ? "0.28.24" : "dev";
|
|
4777
4777
|
async function fetchLatestVersion() {
|
|
4778
4778
|
const host2 = getHost();
|
|
4779
4779
|
if (!host2) return null;
|
|
@@ -5696,7 +5696,7 @@ function handleError(err) {
|
|
|
5696
5696
|
}
|
|
5697
5697
|
|
|
5698
5698
|
// src/bin/agt.ts
|
|
5699
|
-
var cliVersion2 = true ? "0.28.
|
|
5699
|
+
var cliVersion2 = true ? "0.28.24" : "dev";
|
|
5700
5700
|
var program = new Command();
|
|
5701
5701
|
program.name("agt").description("Augmented CLI \u2014 agent provisioning and management").version(cliVersion2).option("--json", "Emit machine-readable JSON output (suppress spinners and colors)").option("--skip-update-check", "Skip the automatic update check on startup");
|
|
5702
5702
|
program.hook("preAction", async (thisCommand, actionCommand) => {
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
provisionStopHook,
|
|
23
23
|
requireHost,
|
|
24
24
|
safeWriteJsonAtomic
|
|
25
|
-
} from "../chunk-
|
|
25
|
+
} from "../chunk-Z5GPBUID.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.24" : "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) {
|