@integrity-labs/agt-cli 0.28.1056 → 0.28.1058
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 +5 -5
- package/dist/{chunk-M5P24M2Z.js → chunk-F3J3YAY3.js} +4 -4
- package/dist/{chunk-A7HDJW23.js → chunk-GSCJBZLQ.js} +2 -2
- package/dist/{chunk-P544KDE3.js → chunk-RWO2YG5B.js} +13 -1
- package/dist/{chunk-P544KDE3.js.map → chunk-RWO2YG5B.js.map} +1 -1
- package/dist/{claude-pair-runtime-TSRRFBNJ.js → claude-pair-runtime-SHXYOS5I.js} +2 -2
- package/dist/lib/manager-worker.js +78 -50
- package/dist/lib/manager-worker.js.map +1 -1
- package/dist/mcp/direct-chat-channel.js +12 -0
- package/dist/mcp/index.js +12 -0
- package/dist/mcp/origami.js +12 -0
- package/dist/mcp/slack-channel.js +12 -0
- package/dist/mcp/telegram-channel.js +12 -0
- package/dist/{persistent-session-WSJVCGEO.js → persistent-session-JKAO4GT7.js} +3 -3
- package/dist/{responsiveness-probe-7MQI6SUF.js → responsiveness-probe-5BYHCZJS.js} +3 -3
- package/dist/{session-auth-dead-NFVTUFPI.js → session-auth-dead-E6V22R4W.js} +2 -2
- package/package.json +1 -1
- /package/dist/{chunk-M5P24M2Z.js.map → chunk-F3J3YAY3.js.map} +0 -0
- /package/dist/{chunk-A7HDJW23.js.map → chunk-GSCJBZLQ.js.map} +0 -0
- /package/dist/{claude-pair-runtime-TSRRFBNJ.js.map → claude-pair-runtime-SHXYOS5I.js.map} +0 -0
- /package/dist/{persistent-session-WSJVCGEO.js.map → persistent-session-JKAO4GT7.js.map} +0 -0
- /package/dist/{responsiveness-probe-7MQI6SUF.js.map → responsiveness-probe-5BYHCZJS.js.map} +0 -0
- /package/dist/{session-auth-dead-NFVTUFPI.js.map → session-auth-dead-E6V22R4W.js.map} +0 -0
|
@@ -266,7 +266,7 @@ async function spawnPairSession(session) {
|
|
|
266
266
|
return { ok: true };
|
|
267
267
|
} catch {
|
|
268
268
|
}
|
|
269
|
-
const { resolveClaudeBinary } = await import("./persistent-session-
|
|
269
|
+
const { resolveClaudeBinary } = await import("./persistent-session-JKAO4GT7.js");
|
|
270
270
|
const claudeBin = resolveClaudeBinary();
|
|
271
271
|
const pairEnv = {
|
|
272
272
|
...process.env,
|
|
@@ -734,4 +734,4 @@ export {
|
|
|
734
734
|
startClaudePair,
|
|
735
735
|
submitClaudePairCode
|
|
736
736
|
};
|
|
737
|
-
//# sourceMappingURL=claude-pair-runtime-
|
|
737
|
+
//# sourceMappingURL=claude-pair-runtime-SHXYOS5I.js.map
|
|
@@ -67,7 +67,7 @@ import {
|
|
|
67
67
|
safeWriteJsonAtomic,
|
|
68
68
|
setConfigHash,
|
|
69
69
|
tripClass
|
|
70
|
-
} from "../chunk-
|
|
70
|
+
} from "../chunk-F3J3YAY3.js";
|
|
71
71
|
import {
|
|
72
72
|
getProjectDir as getProjectDir2,
|
|
73
73
|
getReadyTasks,
|
|
@@ -154,7 +154,7 @@ import {
|
|
|
154
154
|
webFetchBaselineValue,
|
|
155
155
|
webFetchRestartNeeded,
|
|
156
156
|
writeEgressAllowlist
|
|
157
|
-
} from "../chunk-
|
|
157
|
+
} from "../chunk-GSCJBZLQ.js";
|
|
158
158
|
import {
|
|
159
159
|
ACCOUNT_ENFORCEMENT_MARKER_FILENAME,
|
|
160
160
|
AnchorSessionClient,
|
|
@@ -263,7 +263,7 @@ import {
|
|
|
263
263
|
subagentActivityAgeSeconds,
|
|
264
264
|
sumTranscriptUsageInWindow,
|
|
265
265
|
transcriptActivityAgeSeconds
|
|
266
|
-
} from "../chunk-
|
|
266
|
+
} from "../chunk-RWO2YG5B.js";
|
|
267
267
|
import {
|
|
268
268
|
classifyUnanswerablePane,
|
|
269
269
|
paneRemedy
|
|
@@ -2799,6 +2799,17 @@ function heartbeatAccountEmailField(rawMode, detected) {
|
|
|
2799
2799
|
if (!mayReportAccountEmail(rawMode)) return void 0;
|
|
2800
2800
|
return detected ?? void 0;
|
|
2801
2801
|
}
|
|
2802
|
+
function accountFileUnreadableTransition(prevKey, observation) {
|
|
2803
|
+
const key = observation.email === null && observation.why === "unreadable" ? observation.codes.join(",") : null;
|
|
2804
|
+
if (key === prevKey) return { key, line: null };
|
|
2805
|
+
if (key !== null) {
|
|
2806
|
+
return {
|
|
2807
|
+
key,
|
|
2808
|
+
line: `[account-email] a Claude account file exists but cannot be read (${key}); claude_account_email will not be reported, so the stored label may be stale (ENG-10796)`
|
|
2809
|
+
};
|
|
2810
|
+
}
|
|
2811
|
+
return { key, line: "[account-email] Claude account file readable again (ENG-10796)" };
|
|
2812
|
+
}
|
|
2802
2813
|
|
|
2803
2814
|
// src/lib/manager/auth-resolve-decision.ts
|
|
2804
2815
|
function decideAuthResolveFailureAction(args) {
|
|
@@ -3430,12 +3441,25 @@ async function claudeConfigCandidatePaths() {
|
|
|
3430
3441
|
function hashAccount(accountUuid, organizationUuid) {
|
|
3431
3442
|
return createHash6("sha256").update(`claude-account:${accountUuid}:${organizationUuid ?? ""}`).digest("hex").slice(0, 12);
|
|
3432
3443
|
}
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3444
|
+
var ABSENT_CODES = /* @__PURE__ */ new Set(["ENOENT", "ENOTDIR"]);
|
|
3445
|
+
function errnoCode(err) {
|
|
3446
|
+
const code = err?.code;
|
|
3447
|
+
return typeof code === "string" && code.length > 0 ? code : "UNKNOWN";
|
|
3448
|
+
}
|
|
3449
|
+
async function resolveClaudeAccount(paths) {
|
|
3450
|
+
const unreadable = [];
|
|
3451
|
+
for (const path of paths) {
|
|
3452
|
+
let raw;
|
|
3453
|
+
try {
|
|
3454
|
+
raw = await readFile3(path, "utf-8");
|
|
3455
|
+
} catch (err) {
|
|
3456
|
+
const code = errnoCode(err);
|
|
3457
|
+
if (!ABSENT_CODES.has(code)) unreadable.push(code);
|
|
3458
|
+
continue;
|
|
3459
|
+
}
|
|
3436
3460
|
let parsed;
|
|
3437
3461
|
try {
|
|
3438
|
-
parsed = JSON.parse(
|
|
3462
|
+
parsed = JSON.parse(raw);
|
|
3439
3463
|
} catch {
|
|
3440
3464
|
continue;
|
|
3441
3465
|
}
|
|
@@ -3444,46 +3468,45 @@ async function detectClaudeAccountFingerprint(paths) {
|
|
|
3444
3468
|
if (typeof account !== "object" || account === null) continue;
|
|
3445
3469
|
const accountUuid = account.accountUuid;
|
|
3446
3470
|
if (typeof accountUuid !== "string" || accountUuid.trim().length === 0) continue;
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
);
|
|
3471
|
+
return {
|
|
3472
|
+
status: "found",
|
|
3473
|
+
account
|
|
3474
|
+
};
|
|
3452
3475
|
}
|
|
3453
|
-
return
|
|
3476
|
+
return unreadable.length > 0 ? { status: "unreadable", codes: [...new Set(unreadable)].sort() } : { status: "not-found" };
|
|
3477
|
+
}
|
|
3478
|
+
async function detectClaudeAccountFingerprint(paths) {
|
|
3479
|
+
const resolution = await resolveClaudeAccount(paths ?? await claudeConfigCandidatePaths());
|
|
3480
|
+
if (resolution.status !== "found") return null;
|
|
3481
|
+
const { account } = resolution;
|
|
3482
|
+
const organizationUuid = account["organizationUuid"];
|
|
3483
|
+
return hashAccount(
|
|
3484
|
+
account.accountUuid.trim(),
|
|
3485
|
+
typeof organizationUuid === "string" && organizationUuid.trim().length > 0 ? organizationUuid.trim() : null
|
|
3486
|
+
);
|
|
3454
3487
|
}
|
|
3455
3488
|
var lastKnownFingerprint = null;
|
|
3456
3489
|
var lastDetectAtMs = 0;
|
|
3457
3490
|
var lastEmailResult = null;
|
|
3458
3491
|
var lastEmailDetectAtMs = 0;
|
|
3459
3492
|
var DETECT_TTL_MS = 6e4;
|
|
3460
|
-
async function
|
|
3461
|
-
const
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
const email = account.emailAddress;
|
|
3475
|
-
if (typeof email !== "string") return null;
|
|
3476
|
-
const trimmed = email.trim().toLowerCase();
|
|
3477
|
-
if (trimmed.length === 0) return null;
|
|
3478
|
-
return trimmed;
|
|
3479
|
-
}
|
|
3480
|
-
return null;
|
|
3481
|
-
}
|
|
3482
|
-
async function getClaudeAccountEmail(paths, nowMs = Date.now()) {
|
|
3483
|
-
if (!paths && nowMs - lastEmailDetectAtMs < DETECT_TTL_MS) {
|
|
3493
|
+
async function detectClaudeAccountEmailObservation(paths) {
|
|
3494
|
+
const resolution = await resolveClaudeAccount(paths ?? await claudeConfigCandidatePaths());
|
|
3495
|
+
if (resolution.status === "unreadable") {
|
|
3496
|
+
return { email: null, why: "unreadable", codes: resolution.codes };
|
|
3497
|
+
}
|
|
3498
|
+
if (resolution.status === "not-found") return { email: null, why: "not-found" };
|
|
3499
|
+
const email = resolution.account["emailAddress"];
|
|
3500
|
+
if (typeof email !== "string") return { email: null, why: "no-address" };
|
|
3501
|
+
const trimmed = email.trim().toLowerCase();
|
|
3502
|
+
if (trimmed.length === 0) return { email: null, why: "no-address" };
|
|
3503
|
+
return { email: trimmed };
|
|
3504
|
+
}
|
|
3505
|
+
async function getClaudeAccountEmailObservation(paths, nowMs = Date.now()) {
|
|
3506
|
+
if (!paths && lastEmailResult !== null && nowMs - lastEmailDetectAtMs < DETECT_TTL_MS) {
|
|
3484
3507
|
return lastEmailResult;
|
|
3485
3508
|
}
|
|
3486
|
-
const detected = await
|
|
3509
|
+
const detected = await detectClaudeAccountEmailObservation(paths);
|
|
3487
3510
|
if (!paths) {
|
|
3488
3511
|
lastEmailDetectAtMs = nowMs;
|
|
3489
3512
|
lastEmailResult = detected;
|
|
@@ -13218,6 +13241,7 @@ function stopRealtimeChat() {
|
|
|
13218
13241
|
function escapeRegExp(s) {
|
|
13219
13242
|
return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
13220
13243
|
}
|
|
13244
|
+
var accountFileUnreadableKey = null;
|
|
13221
13245
|
function applyRestartAcks(args) {
|
|
13222
13246
|
const { agentStates, priorAgents, restartAcks } = args;
|
|
13223
13247
|
if (agentStates.length === 0) return false;
|
|
@@ -14099,7 +14123,7 @@ var pendingDayRolloverReset = /* @__PURE__ */ new Set();
|
|
|
14099
14123
|
var dayRolloverInboundHold = /* @__PURE__ */ new Map();
|
|
14100
14124
|
var INBOUND_HOLD_EPISODE_GAP_MS = 12e4;
|
|
14101
14125
|
async function channelInboundActivityAgeSecondsFor(codeName) {
|
|
14102
|
-
const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-
|
|
14126
|
+
const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-5BYHCZJS.js");
|
|
14103
14127
|
const newest = newestPendingInboundActivityMtimeMs(dirname11(paneLogPath(codeName)));
|
|
14104
14128
|
if (newest === null) return null;
|
|
14105
14129
|
return Math.max(0, Math.floor((Date.now() - newest) / 1e3));
|
|
@@ -14847,7 +14871,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
|
|
|
14847
14871
|
var lastVersionCheckAt = 0;
|
|
14848
14872
|
var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
|
|
14849
14873
|
var lastResponsivenessProbeAt = 0;
|
|
14850
|
-
var agtCliVersion = true ? "0.28.
|
|
14874
|
+
var agtCliVersion = true ? "0.28.1058" : "dev";
|
|
14851
14875
|
function resolveBrewPath(execFileSync3) {
|
|
14852
14876
|
try {
|
|
14853
14877
|
const out = execFileSync3("which", ["brew"], { timeout: 5e3 }).toString().trim();
|
|
@@ -16482,7 +16506,7 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
|
|
|
16482
16506
|
if (codeNames.length === 0) return;
|
|
16483
16507
|
void (async () => {
|
|
16484
16508
|
try {
|
|
16485
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
16509
|
+
const { collectDiagnostics } = await import("../persistent-session-JKAO4GT7.js");
|
|
16486
16510
|
await api.post("/host/heartbeat", {
|
|
16487
16511
|
host_id: hostId,
|
|
16488
16512
|
agent_diagnostics: collectDiagnostics(codeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor)
|
|
@@ -16624,7 +16648,7 @@ async function pollCycleInner() {
|
|
|
16624
16648
|
}
|
|
16625
16649
|
try {
|
|
16626
16650
|
const { detectHostSecurity } = await import("../host-security-KQYYZZVW.js");
|
|
16627
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
16651
|
+
const { collectDiagnostics } = await import("../persistent-session-JKAO4GT7.js");
|
|
16628
16652
|
const diagCodeNames = [...agentState.persistentSessionAgents];
|
|
16629
16653
|
const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor) : void 0;
|
|
16630
16654
|
let tailscaleHostname;
|
|
@@ -16661,7 +16685,11 @@ async function pollCycleInner() {
|
|
|
16661
16685
|
const claudeAuthModeRaw = getCachedClaudeAuthModeRaw();
|
|
16662
16686
|
if (mayReportAccountEmail(claudeAuthModeRaw)) {
|
|
16663
16687
|
try {
|
|
16664
|
-
|
|
16688
|
+
const observation = await getClaudeAccountEmailObservation();
|
|
16689
|
+
claudeAccountEmail = observation.email;
|
|
16690
|
+
const transition = accountFileUnreadableTransition(accountFileUnreadableKey, observation);
|
|
16691
|
+
accountFileUnreadableKey = transition.key;
|
|
16692
|
+
if (transition.line) log(transition.line);
|
|
16665
16693
|
} catch {
|
|
16666
16694
|
claudeAccountEmail = null;
|
|
16667
16695
|
}
|
|
@@ -16828,7 +16856,7 @@ async function pollCycleInner() {
|
|
|
16828
16856
|
collectPanelessActivityProbes,
|
|
16829
16857
|
getResponsivenessIntervalMs,
|
|
16830
16858
|
occupancyQualificationClassifications
|
|
16831
|
-
} = await import("../responsiveness-probe-
|
|
16859
|
+
} = await import("../responsiveness-probe-5BYHCZJS.js");
|
|
16832
16860
|
const probeIntervalMs = getResponsivenessIntervalMs();
|
|
16833
16861
|
if (now - lastResponsivenessProbeAt > probeIntervalMs) {
|
|
16834
16862
|
const probeCodeNames = [...agentState.persistentSessionAgents];
|
|
@@ -16945,7 +16973,7 @@ async function pollCycleInner() {
|
|
|
16945
16973
|
collectResponsivenessProbes,
|
|
16946
16974
|
livePendingInboundOldestAgeSeconds,
|
|
16947
16975
|
parkPendingInbound
|
|
16948
|
-
} = await import("../responsiveness-probe-
|
|
16976
|
+
} = await import("../responsiveness-probe-5BYHCZJS.js");
|
|
16949
16977
|
const { getProjectDir: wedgeProjectDir } = await import("../scheduler-engine-M6AFZWNU.js");
|
|
16950
16978
|
const wedgeNow = /* @__PURE__ */ new Date();
|
|
16951
16979
|
const liveAgents = agentState.persistentSessionAgents;
|
|
@@ -17101,7 +17129,7 @@ async function pollCycleInner() {
|
|
|
17101
17129
|
}
|
|
17102
17130
|
try {
|
|
17103
17131
|
const { scrapeMcpFailedBannerCount } = await import("../pane-mcp-banner-scraper-VR5QGP3J.js");
|
|
17104
|
-
const { probeSessionAuth } = await import("../session-auth-dead-
|
|
17132
|
+
const { probeSessionAuth } = await import("../session-auth-dead-E6V22R4W.js");
|
|
17105
17133
|
const observations = [];
|
|
17106
17134
|
const pendingCacheCommits = [];
|
|
17107
17135
|
const modelApiErrorReportingOn = hostFlagStore().getBoolean("model-api-error-reporting");
|
|
@@ -21666,7 +21694,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
|
|
|
21666
21694
|
try {
|
|
21667
21695
|
const freshId = rotateSessionForWedge(codeName);
|
|
21668
21696
|
consecutiveWedgeCycles.delete(codeName);
|
|
21669
|
-
const { parkPendingInbound: parkForRestart } = await import("../responsiveness-probe-
|
|
21697
|
+
const { parkPendingInbound: parkForRestart } = await import("../responsiveness-probe-5BYHCZJS.js");
|
|
21670
21698
|
const { parked, deadLettered } = parkForRestart(codeName, /* @__PURE__ */ new Date());
|
|
21671
21699
|
const parkNote = parked > 0 ? `, ${parked} inbound parked` : "";
|
|
21672
21700
|
const deadNote = deadLettered > 0 ? `, ${deadLettered} undeliverable dead-lettered` : "";
|
|
@@ -21709,7 +21737,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
|
|
|
21709
21737
|
void api.post("/host/restart-ack", { host_id: hostId, agent_id: agentId, restart_requested_at: requestedAt }).catch((err) => log(`[restart-lane] ack failed for '${codeName}': ${err.message}`));
|
|
21710
21738
|
void (async () => {
|
|
21711
21739
|
try {
|
|
21712
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
21740
|
+
const { collectDiagnostics } = await import("../persistent-session-JKAO4GT7.js");
|
|
21713
21741
|
await api.post("/host/heartbeat", {
|
|
21714
21742
|
host_id: hostId,
|
|
21715
21743
|
agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor)
|
|
@@ -21760,7 +21788,7 @@ async function respawnAgentAfterMcpStop(codeName, reason) {
|
|
|
21760
21788
|
}
|
|
21761
21789
|
try {
|
|
21762
21790
|
const hostId = await getHostId();
|
|
21763
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
21791
|
+
const { collectDiagnostics } = await import("../persistent-session-JKAO4GT7.js");
|
|
21764
21792
|
await api.post("/host/heartbeat", {
|
|
21765
21793
|
host_id: hostId,
|
|
21766
21794
|
agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor)
|
|
@@ -22432,7 +22460,7 @@ async function processClaudePairSessions(agents) {
|
|
|
22432
22460
|
// cannot take it for itself — by the time it runs, the write it is looking
|
|
22433
22461
|
// for may already have happened.
|
|
22434
22462
|
snapshotPairConfig
|
|
22435
|
-
} = await import("../claude-pair-runtime-
|
|
22463
|
+
} = await import("../claude-pair-runtime-SHXYOS5I.js");
|
|
22436
22464
|
for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
|
|
22437
22465
|
log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
|
|
22438
22466
|
const killed = await killPairSession(pairTmuxSession(pairId));
|