@integrity-labs/agt-cli 0.28.532 → 0.28.533
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 +3 -3
- package/dist/{chunk-DVLIHMM7.js → chunk-HILE72DT.js} +2 -2
- package/dist/lib/manager-worker.js +55 -14
- package/dist/lib/manager-worker.js.map +1 -1
- package/dist/{responsiveness-probe-DQCG2MB6.js → responsiveness-probe-THZQRNSJ.js} +8 -3
- package/dist/responsiveness-probe-THZQRNSJ.js.map +1 -0
- package/package.json +1 -1
- package/dist/responsiveness-probe-DQCG2MB6.js.map +0 -1
- /package/dist/{chunk-DVLIHMM7.js.map → chunk-HILE72DT.js.map} +0 -0
package/dist/bin/agt.js
CHANGED
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
success,
|
|
41
41
|
table,
|
|
42
42
|
warn
|
|
43
|
-
} from "../chunk-
|
|
43
|
+
} from "../chunk-HILE72DT.js";
|
|
44
44
|
import {
|
|
45
45
|
AnchorSessionClient,
|
|
46
46
|
CHANNEL_REGISTRY,
|
|
@@ -4834,7 +4834,7 @@ import { execFileSync, execSync } from "child_process";
|
|
|
4834
4834
|
import { existsSync as existsSync10, realpathSync as realpathSync2 } from "fs";
|
|
4835
4835
|
import chalk18 from "chalk";
|
|
4836
4836
|
import ora16 from "ora";
|
|
4837
|
-
var cliVersion = true ? "0.28.
|
|
4837
|
+
var cliVersion = true ? "0.28.533" : "dev";
|
|
4838
4838
|
async function fetchLatestVersion() {
|
|
4839
4839
|
const host2 = getHost();
|
|
4840
4840
|
if (!host2) return null;
|
|
@@ -6006,7 +6006,7 @@ function handleError(err) {
|
|
|
6006
6006
|
}
|
|
6007
6007
|
|
|
6008
6008
|
// src/bin/agt.ts
|
|
6009
|
-
var cliVersion2 = true ? "0.28.
|
|
6009
|
+
var cliVersion2 = true ? "0.28.533" : "dev";
|
|
6010
6010
|
var program = new Command();
|
|
6011
6011
|
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");
|
|
6012
6012
|
program.hook("preAction", async (thisCommand, actionCommand) => {
|
|
@@ -5486,7 +5486,7 @@ function exchangeFailureKind(err) {
|
|
|
5486
5486
|
}
|
|
5487
5487
|
|
|
5488
5488
|
// src/lib/api-client.ts
|
|
5489
|
-
var agtCliVersion = true ? "0.28.
|
|
5489
|
+
var agtCliVersion = true ? "0.28.533" : "dev";
|
|
5490
5490
|
var lastConfigHash = null;
|
|
5491
5491
|
function setConfigHash(hash) {
|
|
5492
5492
|
lastConfigHash = hash && hash.length > 0 ? hash : null;
|
|
@@ -8798,4 +8798,4 @@ export {
|
|
|
8798
8798
|
managerInstallSystemUnitCommand,
|
|
8799
8799
|
managerUninstallSystemUnitCommand
|
|
8800
8800
|
};
|
|
8801
|
-
//# sourceMappingURL=chunk-
|
|
8801
|
+
//# sourceMappingURL=chunk-HILE72DT.js.map
|
|
@@ -53,7 +53,7 @@ import {
|
|
|
53
53
|
safeWriteJsonAtomic,
|
|
54
54
|
setConfigHash,
|
|
55
55
|
tripClass
|
|
56
|
-
} from "../chunk-
|
|
56
|
+
} from "../chunk-HILE72DT.js";
|
|
57
57
|
import {
|
|
58
58
|
getProjectDir as getProjectDir2,
|
|
59
59
|
getReadyTasks,
|
|
@@ -6137,7 +6137,7 @@ function readAlignedTail(path, tailBytes, maxAlignBytes) {
|
|
|
6137
6137
|
let fd = null;
|
|
6138
6138
|
try {
|
|
6139
6139
|
const size = statSync5(path).size;
|
|
6140
|
-
if (size <= 0) return { content: "", complete: true };
|
|
6140
|
+
if (size <= 0) return { content: "", complete: true, truncated: false };
|
|
6141
6141
|
fd = openSync(path, "r");
|
|
6142
6142
|
let readStart = Math.max(0, size - tailBytes);
|
|
6143
6143
|
if (readStart > 0) {
|
|
@@ -6162,13 +6162,13 @@ function readAlignedTail(path, tailBytes, maxAlignBytes) {
|
|
|
6162
6162
|
} else if (scanFloor === 0) {
|
|
6163
6163
|
readStart = 0;
|
|
6164
6164
|
} else {
|
|
6165
|
-
return { content: "", complete: false };
|
|
6165
|
+
return { content: "", complete: false, truncated: true };
|
|
6166
6166
|
}
|
|
6167
6167
|
}
|
|
6168
6168
|
const len = size - readStart;
|
|
6169
6169
|
const buf = Buffer.allocUnsafe(len);
|
|
6170
6170
|
if (readSync(fd, buf, 0, len, readStart) !== len) return null;
|
|
6171
|
-
return { content: buf.toString("utf-8", 0, len), complete: true };
|
|
6171
|
+
return { content: buf.toString("utf-8", 0, len), complete: true, truncated: readStart > 0 };
|
|
6172
6172
|
} catch {
|
|
6173
6173
|
return null;
|
|
6174
6174
|
} finally {
|
|
@@ -6184,6 +6184,24 @@ function isAbsentDirError(err) {
|
|
|
6184
6184
|
const code = err.code;
|
|
6185
6185
|
return code === "ENOENT" || code === "ENOTDIR";
|
|
6186
6186
|
}
|
|
6187
|
+
function earliestCoveredMs(content) {
|
|
6188
|
+
for (const line of content.split("\n")) {
|
|
6189
|
+
const trimmed = line.trim();
|
|
6190
|
+
if (trimmed.length === 0) continue;
|
|
6191
|
+
let record;
|
|
6192
|
+
try {
|
|
6193
|
+
record = JSON.parse(trimmed);
|
|
6194
|
+
} catch {
|
|
6195
|
+
continue;
|
|
6196
|
+
}
|
|
6197
|
+
if (typeof record !== "object" || record === null) continue;
|
|
6198
|
+
const ts = record.timestamp;
|
|
6199
|
+
if (typeof ts !== "string") continue;
|
|
6200
|
+
const ms = Date.parse(ts);
|
|
6201
|
+
if (Number.isFinite(ms)) return ms;
|
|
6202
|
+
}
|
|
6203
|
+
return null;
|
|
6204
|
+
}
|
|
6187
6205
|
function candidateTranscriptPaths(dir) {
|
|
6188
6206
|
const paths = [];
|
|
6189
6207
|
let top;
|
|
@@ -6221,6 +6239,10 @@ function collectQualifyingTurns(codeName, nowMs, opts = {}) {
|
|
|
6221
6239
|
const nextCache = /* @__PURE__ */ new Map();
|
|
6222
6240
|
const all = /* @__PURE__ */ new Set();
|
|
6223
6241
|
let transcriptsRead = 0;
|
|
6242
|
+
let coveredFromMs = Number.NEGATIVE_INFINITY;
|
|
6243
|
+
const raiseCoverageFloor = (floor) => {
|
|
6244
|
+
if (floor != null && floor > coveredFromMs) coveredFromMs = floor;
|
|
6245
|
+
};
|
|
6224
6246
|
const { paths, complete: scanComplete } = candidateTranscriptPaths(dir);
|
|
6225
6247
|
let complete = scanComplete;
|
|
6226
6248
|
for (const path of paths) {
|
|
@@ -6238,6 +6260,7 @@ function collectQualifyingTurns(codeName, nowMs, opts = {}) {
|
|
|
6238
6260
|
transcriptsRead += 1;
|
|
6239
6261
|
nextCache.set(path, seen);
|
|
6240
6262
|
for (const t of seen.turns) all.add(t);
|
|
6263
|
+
raiseCoverageFloor(seen.coverageFloorMs);
|
|
6241
6264
|
continue;
|
|
6242
6265
|
}
|
|
6243
6266
|
const aligned = readAlignedTail(path, tailBytes, maxAlignBytes);
|
|
@@ -6250,13 +6273,19 @@ function collectQualifyingTurns(codeName, nowMs, opts = {}) {
|
|
|
6250
6273
|
continue;
|
|
6251
6274
|
}
|
|
6252
6275
|
const content = aligned.content;
|
|
6276
|
+
const parsedFloorMs = aligned.truncated ? earliestCoveredMs(content) : null;
|
|
6277
|
+
const floorUnknown = aligned.truncated && parsedFloorMs === null;
|
|
6278
|
+
const coverageFloorMs = aligned.truncated ? parsedFloorMs ?? nowMs : null;
|
|
6279
|
+
raiseCoverageFloor(coverageFloorMs);
|
|
6253
6280
|
transcriptsRead += 1;
|
|
6254
6281
|
const turns = extractQualifyingTurns(content, { startMs: sinceMs });
|
|
6255
|
-
|
|
6282
|
+
if (!floorUnknown) {
|
|
6283
|
+
nextCache.set(path, { mtimeMs: st.mtimeMs, size: st.size, turns, coverageFloorMs });
|
|
6284
|
+
}
|
|
6256
6285
|
for (const t of turns) all.add(t);
|
|
6257
6286
|
}
|
|
6258
6287
|
cache.set(codeName, nextCache);
|
|
6259
|
-
return { turns: [...all].sort((a, b) => a - b), transcriptsRead, complete };
|
|
6288
|
+
return { turns: [...all].sort((a, b) => a - b), transcriptsRead, complete, coveredFromMs };
|
|
6260
6289
|
}
|
|
6261
6290
|
function qualifyBuckets(buckets, qualifying, mode, nowMs, neighbourhoodMs = DEFAULT_NEIGHBOURHOOD_MS) {
|
|
6262
6291
|
const failOpen = !qualifying.complete;
|
|
@@ -6264,6 +6293,7 @@ function qualifyBuckets(buckets, qualifying, mode, nowMs, neighbourhoodMs = DEFA
|
|
|
6264
6293
|
let qualified = 0;
|
|
6265
6294
|
let unqualifiedDropped = 0;
|
|
6266
6295
|
let unreadable = 0;
|
|
6296
|
+
let coverageShortfall = 0;
|
|
6267
6297
|
for (const b of buckets) {
|
|
6268
6298
|
const startMs = Date.parse(b.bucket);
|
|
6269
6299
|
const parsed = Number.isFinite(startMs);
|
|
@@ -6276,12 +6306,17 @@ function qualifyBuckets(buckets, qualifying, mode, nowMs, neighbourhoodMs = DEFA
|
|
|
6276
6306
|
if (isBucketQualified(startMs, qualifying.turns, neighbourhoodMs)) {
|
|
6277
6307
|
qualified += 1;
|
|
6278
6308
|
kept.push(b);
|
|
6279
|
-
|
|
6280
|
-
|
|
6281
|
-
|
|
6309
|
+
continue;
|
|
6310
|
+
}
|
|
6311
|
+
if (startMs - neighbourhoodMs < qualifying.coveredFromMs) {
|
|
6312
|
+
coverageShortfall += 1;
|
|
6313
|
+
kept.push(b);
|
|
6314
|
+
continue;
|
|
6282
6315
|
}
|
|
6316
|
+
unqualifiedDropped += 1;
|
|
6317
|
+
if (mode === "shadow") kept.push(b);
|
|
6283
6318
|
}
|
|
6284
|
-
return { kept, qualified, unqualifiedDropped, unreadable };
|
|
6319
|
+
return { kept, qualified, unqualifiedDropped, unreadable, coverageShortfall };
|
|
6285
6320
|
}
|
|
6286
6321
|
|
|
6287
6322
|
// src/lib/pane-occupancy-sampler.ts
|
|
@@ -10334,7 +10369,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
|
|
|
10334
10369
|
var lastVersionCheckAt = 0;
|
|
10335
10370
|
var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
|
|
10336
10371
|
var lastResponsivenessProbeAt = 0;
|
|
10337
|
-
var agtCliVersion = true ? "0.28.
|
|
10372
|
+
var agtCliVersion = true ? "0.28.533" : "dev";
|
|
10338
10373
|
function resolveBrewPath(execFileSync2) {
|
|
10339
10374
|
try {
|
|
10340
10375
|
const out = execFileSync2("which", ["brew"], { timeout: 5e3 }).toString().trim();
|
|
@@ -11768,7 +11803,7 @@ async function pollCycle() {
|
|
|
11768
11803
|
collectPanelessActivityProbes,
|
|
11769
11804
|
getResponsivenessIntervalMs,
|
|
11770
11805
|
occupancyQualificationClassifications
|
|
11771
|
-
} = await import("../responsiveness-probe-
|
|
11806
|
+
} = await import("../responsiveness-probe-THZQRNSJ.js");
|
|
11772
11807
|
const probeIntervalMs = getResponsivenessIntervalMs();
|
|
11773
11808
|
if (now - lastResponsivenessProbeAt > probeIntervalMs) {
|
|
11774
11809
|
const probeCodeNames = [...agentState.persistentSessionAgents];
|
|
@@ -11797,7 +11832,13 @@ async function pollCycle() {
|
|
|
11797
11832
|
log(
|
|
11798
11833
|
`[occupancy-gate] qualification failed for '${codeName}' \u2014 reporting ${raw.length} bucket(s) ungated: ${err.message}`
|
|
11799
11834
|
);
|
|
11800
|
-
q = {
|
|
11835
|
+
q = {
|
|
11836
|
+
kept: raw,
|
|
11837
|
+
qualified: 0,
|
|
11838
|
+
unqualifiedDropped: 0,
|
|
11839
|
+
unreadable: raw.length,
|
|
11840
|
+
coverageShortfall: 0
|
|
11841
|
+
};
|
|
11801
11842
|
}
|
|
11802
11843
|
if (q.kept.length > 0) drainedBuckets.set(codeName, q.kept);
|
|
11803
11844
|
return {
|
|
@@ -11853,7 +11894,7 @@ async function pollCycle() {
|
|
|
11853
11894
|
collectResponsivenessProbes,
|
|
11854
11895
|
livePendingInboundOldestAgeSeconds,
|
|
11855
11896
|
parkPendingInbound
|
|
11856
|
-
} = await import("../responsiveness-probe-
|
|
11897
|
+
} = await import("../responsiveness-probe-THZQRNSJ.js");
|
|
11857
11898
|
const { getProjectDir: wedgeProjectDir } = await import("../scheduler-engine-NDP36U7O.js");
|
|
11858
11899
|
const wedgeNow = /* @__PURE__ */ new Date();
|
|
11859
11900
|
const liveAgents = agentState.persistentSessionAgents;
|