@integrity-labs/agt-cli 0.28.94 → 0.28.96
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 +4 -4
- package/dist/{chunk-CSTDOXOK.js → chunk-5NQ652SP.js} +173 -3
- package/dist/chunk-5NQ652SP.js.map +1 -0
- package/dist/{chunk-7IEFSTN5.js → chunk-LFTKXQEA.js} +3 -3
- package/dist/{chunk-GLBWCCZD.js → chunk-TRKWWYRN.js} +6 -2
- package/dist/chunk-TRKWWYRN.js.map +1 -0
- package/dist/{claude-pair-runtime-FA7DXRHH.js → claude-pair-runtime-2ISKH4M2.js} +2 -2
- package/dist/lib/manager-worker.js +68 -12
- package/dist/lib/manager-worker.js.map +1 -1
- package/dist/{persistent-session-4HWN54DY.js → persistent-session-KAOPVQPC.js} +21 -3
- package/dist/{responsiveness-probe-C2N4UJSE.js → responsiveness-probe-OJPF6XDF.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-CSTDOXOK.js.map +0 -1
- package/dist/chunk-GLBWCCZD.js.map +0 -1
- /package/dist/{chunk-7IEFSTN5.js.map → chunk-LFTKXQEA.js.map} +0 -0
- /package/dist/{claude-pair-runtime-FA7DXRHH.js.map → claude-pair-runtime-2ISKH4M2.js.map} +0 -0
- /package/dist/{persistent-session-4HWN54DY.js.map → persistent-session-KAOPVQPC.js.map} +0 -0
- /package/dist/{responsiveness-probe-C2N4UJSE.js.map → responsiveness-probe-OJPF6XDF.js.map} +0 -0
|
@@ -100,7 +100,7 @@ async function spawnPairSession(session) {
|
|
|
100
100
|
return { ok: true };
|
|
101
101
|
} catch {
|
|
102
102
|
}
|
|
103
|
-
const { resolveClaudeBinary } = await import("./persistent-session-
|
|
103
|
+
const { resolveClaudeBinary } = await import("./persistent-session-KAOPVQPC.js");
|
|
104
104
|
const claudeBin = resolveClaudeBinary();
|
|
105
105
|
const pairEnv = {
|
|
106
106
|
...process.env,
|
|
@@ -373,4 +373,4 @@ export {
|
|
|
373
373
|
startClaudePair,
|
|
374
374
|
submitClaudePairCode
|
|
375
375
|
};
|
|
376
|
-
//# sourceMappingURL=claude-pair-runtime-
|
|
376
|
+
//# sourceMappingURL=claude-pair-runtime-2ISKH4M2.js.map
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
requireHost,
|
|
29
29
|
safeWriteJsonAtomic,
|
|
30
30
|
setConfigHash
|
|
31
|
-
} from "../chunk-
|
|
31
|
+
} from "../chunk-LFTKXQEA.js";
|
|
32
32
|
import {
|
|
33
33
|
getProjectDir as getProjectDir2,
|
|
34
34
|
getReadyTasks,
|
|
@@ -38,8 +38,10 @@ import {
|
|
|
38
38
|
} from "../chunk-I3YS5WFV.js";
|
|
39
39
|
import {
|
|
40
40
|
buildAllowedTools,
|
|
41
|
+
buildEgressAllowlist,
|
|
41
42
|
checkChannelInputs,
|
|
42
43
|
creditWatchdogGiveUpCount,
|
|
44
|
+
egressMode,
|
|
43
45
|
getLastFailureContext,
|
|
44
46
|
getProjectDir,
|
|
45
47
|
getSessionState,
|
|
@@ -53,8 +55,10 @@ import {
|
|
|
53
55
|
peekCurrentSession,
|
|
54
56
|
prepareForRespawn,
|
|
55
57
|
readPaneLogTail,
|
|
58
|
+
reloadEgressSidecar,
|
|
56
59
|
resetRestartCount,
|
|
57
60
|
resolveClaudeBinary,
|
|
61
|
+
restartEgressSidecar,
|
|
58
62
|
rotateSessionForWedge,
|
|
59
63
|
sanitizeMcpJson,
|
|
60
64
|
sendToAgent,
|
|
@@ -65,8 +69,9 @@ import {
|
|
|
65
69
|
subagentActivityAgeSeconds,
|
|
66
70
|
takeWatchdogGiveUpCount,
|
|
67
71
|
takeZombieDetection,
|
|
68
|
-
transcriptActivityAgeSeconds
|
|
69
|
-
|
|
72
|
+
transcriptActivityAgeSeconds,
|
|
73
|
+
writeEgressAllowlist
|
|
74
|
+
} from "../chunk-5NQ652SP.js";
|
|
70
75
|
import {
|
|
71
76
|
FLAGS_SCHEMA_VERSION,
|
|
72
77
|
FLAG_REGISTRY,
|
|
@@ -101,7 +106,7 @@ import {
|
|
|
101
106
|
resolveDmTarget,
|
|
102
107
|
sumTranscriptUsageInWindow,
|
|
103
108
|
wrapScheduledTaskPrompt
|
|
104
|
-
} from "../chunk-
|
|
109
|
+
} from "../chunk-TRKWWYRN.js";
|
|
105
110
|
import {
|
|
106
111
|
parsePsRows,
|
|
107
112
|
reapOrphanChannelMcps
|
|
@@ -850,10 +855,20 @@ import { mkdirSync as mkdirSync2, readFileSync as readFileSync2, rmSync, writeFi
|
|
|
850
855
|
import { dirname as dirname2 } from "path";
|
|
851
856
|
var ONBOARDING_REINJECT_INTERVAL_MS = 5 * 6e4;
|
|
852
857
|
var ONBOARDING_MAX_NUDGES = 3;
|
|
853
|
-
function decideOnboardingDrive(step, marker, nowMs, reinjectIntervalMs = ONBOARDING_REINJECT_INTERVAL_MS, maxNudges = ONBOARDING_MAX_NUDGES) {
|
|
858
|
+
function decideOnboardingDrive(step, marker, nowMs, generation = 0, reinjectIntervalMs = ONBOARDING_REINJECT_INTERVAL_MS, maxNudges = ONBOARDING_MAX_NUDGES) {
|
|
854
859
|
if (isOnboardingArea(step)) {
|
|
855
860
|
const sameStep = marker?.step === step;
|
|
856
861
|
const current = sameStep ? marker : null;
|
|
862
|
+
const genChanged = current !== null && current.generation !== generation;
|
|
863
|
+
if (genChanged) {
|
|
864
|
+
return {
|
|
865
|
+
inject: true,
|
|
866
|
+
clearMarker: false,
|
|
867
|
+
nextMarker: { step, injectedAtMs: nowMs, nudgeCount: 1, gaveUp: false, generation },
|
|
868
|
+
reminder: false,
|
|
869
|
+
standDown: false
|
|
870
|
+
};
|
|
871
|
+
}
|
|
857
872
|
if (current?.gaveUp) {
|
|
858
873
|
return { inject: false, clearMarker: false, nextMarker: current, reminder: false, standDown: false };
|
|
859
874
|
}
|
|
@@ -867,7 +882,7 @@ function decideOnboardingDrive(step, marker, nowMs, reinjectIntervalMs = ONBOARD
|
|
|
867
882
|
return {
|
|
868
883
|
inject: true,
|
|
869
884
|
clearMarker: false,
|
|
870
|
-
nextMarker: { step, injectedAtMs: nowMs, nudgeCount, gaveUp: isFinal },
|
|
885
|
+
nextMarker: { step, injectedAtMs: nowMs, nudgeCount, gaveUp: isFinal, generation },
|
|
871
886
|
// A middle re-fire (not fresh, not final) is a gentle "still waiting"
|
|
872
887
|
// reminder; the final one is a stand-down, not a reminder.
|
|
873
888
|
reminder: !fresh && !isFinal,
|
|
@@ -905,10 +920,12 @@ function readOnboardingDriveMarker(path) {
|
|
|
905
920
|
const raw = JSON.parse(readFileSync2(path, "utf8"));
|
|
906
921
|
if (typeof raw.step === "string" && isOnboardingArea(raw.step) && typeof raw.injectedAtMs === "number" && Number.isFinite(raw.injectedAtMs)) {
|
|
907
922
|
const nudgeCount = typeof raw.nudgeCount === "number" && Number.isFinite(raw.nudgeCount) && raw.nudgeCount >= 1 ? Math.floor(raw.nudgeCount) : 1;
|
|
923
|
+
const generation = typeof raw.generation === "number" && Number.isFinite(raw.generation) && raw.generation >= 0 ? Math.floor(raw.generation) : 0;
|
|
908
924
|
return {
|
|
909
925
|
step: raw.step,
|
|
910
926
|
injectedAtMs: raw.injectedAtMs,
|
|
911
927
|
nudgeCount,
|
|
928
|
+
generation,
|
|
912
929
|
gaveUp: raw.gaveUp === true
|
|
913
930
|
};
|
|
914
931
|
}
|
|
@@ -6936,7 +6953,7 @@ var cachedMaintenanceWindow = null;
|
|
|
6936
6953
|
var lastVersionCheckAt = 0;
|
|
6937
6954
|
var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
|
|
6938
6955
|
var lastResponsivenessProbeAt = 0;
|
|
6939
|
-
var agtCliVersion = true ? "0.28.
|
|
6956
|
+
var agtCliVersion = true ? "0.28.96" : "dev";
|
|
6940
6957
|
function resolveBrewPath(execFileSync4) {
|
|
6941
6958
|
try {
|
|
6942
6959
|
const out = execFileSync4("which", ["brew"], { timeout: 5e3 }).toString().trim();
|
|
@@ -8047,7 +8064,7 @@ async function pollCycle() {
|
|
|
8047
8064
|
}
|
|
8048
8065
|
try {
|
|
8049
8066
|
const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
|
|
8050
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
8067
|
+
const { collectDiagnostics } = await import("../persistent-session-KAOPVQPC.js");
|
|
8051
8068
|
const diagCodeNames = [...agentState.persistentSessionAgents];
|
|
8052
8069
|
const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames) : void 0;
|
|
8053
8070
|
let tailscaleHostname;
|
|
@@ -8148,7 +8165,7 @@ async function pollCycle() {
|
|
|
8148
8165
|
const {
|
|
8149
8166
|
collectResponsivenessProbes,
|
|
8150
8167
|
getResponsivenessIntervalMs
|
|
8151
|
-
} = await import("../responsiveness-probe-
|
|
8168
|
+
} = await import("../responsiveness-probe-OJPF6XDF.js");
|
|
8152
8169
|
const probeIntervalMs = getResponsivenessIntervalMs();
|
|
8153
8170
|
if (now - lastResponsivenessProbeAt > probeIntervalMs) {
|
|
8154
8171
|
const probeCodeNames = [...agentState.persistentSessionAgents];
|
|
@@ -8180,7 +8197,7 @@ async function pollCycle() {
|
|
|
8180
8197
|
collectResponsivenessProbes,
|
|
8181
8198
|
livePendingInboundOldestAgeSeconds,
|
|
8182
8199
|
parkPendingInbound
|
|
8183
|
-
} = await import("../responsiveness-probe-
|
|
8200
|
+
} = await import("../responsiveness-probe-OJPF6XDF.js");
|
|
8184
8201
|
const { getProjectDir: wedgeProjectDir } = await import("../claude-scheduler-FATCLHDM.js");
|
|
8185
8202
|
const wedgeNow = /* @__PURE__ */ new Date();
|
|
8186
8203
|
const liveAgents = agentState.persistentSessionAgents;
|
|
@@ -10448,7 +10465,7 @@ In progress for ${age} minutes \u2014 auto-failed`).catch(() => {
|
|
|
10448
10465
|
const obStep = obState.step;
|
|
10449
10466
|
const markerPath = join16(homedir9(), ".augmented", agent.code_name, "onboarding-drive.json");
|
|
10450
10467
|
const marker = readOnboardingDriveMarker(markerPath);
|
|
10451
|
-
const decision = decideOnboardingDrive(obStep, marker, Date.now());
|
|
10468
|
+
const decision = decideOnboardingDrive(obStep, marker, Date.now(), obState.generation ?? 0);
|
|
10452
10469
|
if (decision.clearMarker) {
|
|
10453
10470
|
clearOnboardingDriveMarker(markerPath);
|
|
10454
10471
|
} else if (decision.inject && isOnboardingArea(obStep) && isSessionHealthy(agent.code_name)) {
|
|
@@ -10629,6 +10646,13 @@ function cleanupOldFiles(dir, maxAgeDays, ext) {
|
|
|
10629
10646
|
var lastMcpFailedBannerCount = /* @__PURE__ */ new Map();
|
|
10630
10647
|
var persistentSessionStuckTracker = new PersistentSessionStuckTracker();
|
|
10631
10648
|
var claudeAuthTupleBySession = /* @__PURE__ */ new Map();
|
|
10649
|
+
var egressAllowlistBySession = /* @__PURE__ */ new Map();
|
|
10650
|
+
function deriveEgressAllowlist(toolsRaw) {
|
|
10651
|
+
return buildEgressAllowlist(
|
|
10652
|
+
toolsRaw ? extractFrontmatter(toolsRaw).frontmatter : null
|
|
10653
|
+
);
|
|
10654
|
+
}
|
|
10655
|
+
var egressAllowlistEqual = (a, b) => a.length === b.length && a.every((d, i) => d === b[i]);
|
|
10632
10656
|
async function ensurePersistentSession(agent, tasks, boardItems, refreshData) {
|
|
10633
10657
|
const codeName = agent.code_name;
|
|
10634
10658
|
const projectDir = getProjectDir(codeName);
|
|
@@ -10819,6 +10843,10 @@ ${truncateForLog(ctx.tail)}` : `; pane_tail_hash=sha256:${createHash9("sha256").
|
|
|
10819
10843
|
metadata: { type: "persistent_session_boot" }
|
|
10820
10844
|
});
|
|
10821
10845
|
const spawnPrimaryModel = resolveModelChain(refreshData).primary ?? refreshData.agent?.["primary_model"] ?? null;
|
|
10846
|
+
const egressAllowlist = deriveEgressAllowlist(
|
|
10847
|
+
refreshData.tools?.raw_content
|
|
10848
|
+
);
|
|
10849
|
+
egressAllowlistBySession.set(codeName, egressAllowlist);
|
|
10822
10850
|
startPersistentSession({
|
|
10823
10851
|
codeName,
|
|
10824
10852
|
agentId: agent.agent_id,
|
|
@@ -10833,6 +10861,7 @@ ${truncateForLog(ctx.tail)}` : `; pane_tail_hash=sha256:${createHash9("sha256").
|
|
|
10833
10861
|
primaryModel: spawnPrimaryModel,
|
|
10834
10862
|
runId: sessionRunResult.run_id,
|
|
10835
10863
|
agentTimezone,
|
|
10864
|
+
egressAllowlist,
|
|
10836
10865
|
log
|
|
10837
10866
|
});
|
|
10838
10867
|
agentState.persistentSessionAgents.add(codeName);
|
|
@@ -10845,6 +10874,33 @@ ${truncateForLog(ctx.tail)}` : `; pane_tail_hash=sha256:${createHash9("sha256").
|
|
|
10845
10874
|
};
|
|
10846
10875
|
}
|
|
10847
10876
|
resetRestartCount(codeName);
|
|
10877
|
+
if (egressMode(codeName) === "allowlist") {
|
|
10878
|
+
const allowlist = deriveEgressAllowlist(
|
|
10879
|
+
refreshData.tools?.raw_content
|
|
10880
|
+
);
|
|
10881
|
+
const prev = egressAllowlistBySession.get(codeName);
|
|
10882
|
+
if (!prev || !egressAllowlistEqual(prev, allowlist)) {
|
|
10883
|
+
try {
|
|
10884
|
+
writeEgressAllowlist(codeName, allowlist);
|
|
10885
|
+
const removed = prev ? prev.some((d) => !allowlist.includes(d)) : true;
|
|
10886
|
+
const applied = removed ? restartEgressSidecar(codeName) : reloadEgressSidecar(codeName);
|
|
10887
|
+
if (applied) {
|
|
10888
|
+
egressAllowlistBySession.set(codeName, allowlist);
|
|
10889
|
+
log(
|
|
10890
|
+
`[persistent-session] egress allowlist for '${codeName}' changed (${allowlist.length} domains), ${removed ? "restarted" : "reloaded"} squid sidecar`
|
|
10891
|
+
);
|
|
10892
|
+
} else {
|
|
10893
|
+
log(
|
|
10894
|
+
`[persistent-session] egress allowlist for '${codeName}' written (${allowlist.length} domains) but sidecar not running; will apply on next tick/spawn`
|
|
10895
|
+
);
|
|
10896
|
+
}
|
|
10897
|
+
} catch (err) {
|
|
10898
|
+
log(
|
|
10899
|
+
`[persistent-session] egress allowlist refresh for '${codeName}' failed (will retry next tick): ${err.message}`
|
|
10900
|
+
);
|
|
10901
|
+
}
|
|
10902
|
+
}
|
|
10903
|
+
}
|
|
10848
10904
|
if (!claudeAuthTupleBySession.has(codeName)) {
|
|
10849
10905
|
claudeAuthTupleBySession.set(codeName, currentAuthTuple);
|
|
10850
10906
|
}
|
|
@@ -11666,7 +11722,7 @@ async function processClaudePairSessions(agents) {
|
|
|
11666
11722
|
killPairSession,
|
|
11667
11723
|
pairTmuxSession,
|
|
11668
11724
|
finalizeClaudePairOnboarding
|
|
11669
|
-
} = await import("../claude-pair-runtime-
|
|
11725
|
+
} = await import("../claude-pair-runtime-2ISKH4M2.js");
|
|
11670
11726
|
for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
|
|
11671
11727
|
log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
|
|
11672
11728
|
const killed = await killPairSession(pairTmuxSession(pairId));
|