@integrity-labs/agt-cli 0.28.237 → 0.28.238
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-DN4HSL6M.js → chunk-D4HUKRER.js} +77 -3
- package/dist/chunk-D4HUKRER.js.map +1 -0
- package/dist/{chunk-PYVEJMY2.js → chunk-P7TUBBQL.js} +33 -1
- package/dist/{chunk-PYVEJMY2.js.map → chunk-P7TUBBQL.js.map} +1 -1
- package/dist/{claude-pair-runtime-2ZFH6K4I.js → claude-pair-runtime-A4P6E7U5.js} +2 -2
- package/dist/lib/manager-worker.js +9 -9
- package/dist/mcp/direct-chat-channel.js +63 -21
- package/dist/mcp/slack-channel.js +551 -100
- package/dist/mcp/telegram-channel.js +111 -69
- package/dist/{persistent-session-LVDRHYX7.js → persistent-session-HTOCDCII.js} +2 -2
- package/dist/{responsiveness-probe-UW5TXKMS.js → responsiveness-probe-JY4C4RI4.js} +118 -3
- package/dist/responsiveness-probe-JY4C4RI4.js.map +1 -0
- package/package.json +1 -1
- package/dist/chunk-DN4HSL6M.js.map +0 -1
- package/dist/responsiveness-probe-UW5TXKMS.js.map +0 -1
- /package/dist/{claude-pair-runtime-2ZFH6K4I.js.map → claude-pair-runtime-A4P6E7U5.js.map} +0 -0
- /package/dist/{persistent-session-LVDRHYX7.js.map → persistent-session-HTOCDCII.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-HTOCDCII.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-A4P6E7U5.js.map
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
requireHost,
|
|
38
38
|
safeWriteJsonAtomic,
|
|
39
39
|
setConfigHash
|
|
40
|
-
} from "../chunk-
|
|
40
|
+
} from "../chunk-D4HUKRER.js";
|
|
41
41
|
import {
|
|
42
42
|
getProjectDir as getProjectDir2,
|
|
43
43
|
getReadyTasks,
|
|
@@ -122,7 +122,7 @@ import {
|
|
|
122
122
|
takeZombieDetection,
|
|
123
123
|
transcriptActivityAgeSeconds,
|
|
124
124
|
writeEgressAllowlist
|
|
125
|
-
} from "../chunk-
|
|
125
|
+
} from "../chunk-P7TUBBQL.js";
|
|
126
126
|
import {
|
|
127
127
|
reapOrphanChannelMcps
|
|
128
128
|
} from "../chunk-XWVM4KPK.js";
|
|
@@ -6498,7 +6498,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
|
|
|
6498
6498
|
var lastVersionCheckAt = 0;
|
|
6499
6499
|
var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
|
|
6500
6500
|
var lastResponsivenessProbeAt = 0;
|
|
6501
|
-
var agtCliVersion = true ? "0.28.
|
|
6501
|
+
var agtCliVersion = true ? "0.28.238" : "dev";
|
|
6502
6502
|
function resolveBrewPath(execFileSync2) {
|
|
6503
6503
|
try {
|
|
6504
6504
|
const out = execFileSync2("which", ["brew"], { timeout: 5e3 }).toString().trim();
|
|
@@ -7423,7 +7423,7 @@ async function pollCycle() {
|
|
|
7423
7423
|
}
|
|
7424
7424
|
try {
|
|
7425
7425
|
const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
|
|
7426
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
7426
|
+
const { collectDiagnostics } = await import("../persistent-session-HTOCDCII.js");
|
|
7427
7427
|
const diagCodeNames = [...agentState.persistentSessionAgents];
|
|
7428
7428
|
const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames) : void 0;
|
|
7429
7429
|
let tailscaleHostname;
|
|
@@ -7571,7 +7571,7 @@ async function pollCycle() {
|
|
|
7571
7571
|
const {
|
|
7572
7572
|
collectResponsivenessProbes,
|
|
7573
7573
|
getResponsivenessIntervalMs
|
|
7574
|
-
} = await import("../responsiveness-probe-
|
|
7574
|
+
} = await import("../responsiveness-probe-JY4C4RI4.js");
|
|
7575
7575
|
const probeIntervalMs = getResponsivenessIntervalMs();
|
|
7576
7576
|
if (now - lastResponsivenessProbeAt > probeIntervalMs) {
|
|
7577
7577
|
const probeCodeNames = [...agentState.persistentSessionAgents];
|
|
@@ -7603,7 +7603,7 @@ async function pollCycle() {
|
|
|
7603
7603
|
collectResponsivenessProbes,
|
|
7604
7604
|
livePendingInboundOldestAgeSeconds,
|
|
7605
7605
|
parkPendingInbound
|
|
7606
|
-
} = await import("../responsiveness-probe-
|
|
7606
|
+
} = await import("../responsiveness-probe-JY4C4RI4.js");
|
|
7607
7607
|
const { getProjectDir: wedgeProjectDir } = await import("../claude-scheduler-FATCLHDM.js");
|
|
7608
7608
|
const wedgeNow = /* @__PURE__ */ new Date();
|
|
7609
7609
|
const liveAgents = agentState.persistentSessionAgents;
|
|
@@ -7899,7 +7899,7 @@ async function pollCycle() {
|
|
|
7899
7899
|
if (restartedCodeNames.length > 0) {
|
|
7900
7900
|
void (async () => {
|
|
7901
7901
|
try {
|
|
7902
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
7902
|
+
const { collectDiagnostics } = await import("../persistent-session-HTOCDCII.js");
|
|
7903
7903
|
const freshDiagnostics = collectDiagnostics(restartedCodeNames);
|
|
7904
7904
|
await api.post("/host/heartbeat", {
|
|
7905
7905
|
host_id: hostId,
|
|
@@ -10418,7 +10418,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
|
|
|
10418
10418
|
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}`));
|
|
10419
10419
|
void (async () => {
|
|
10420
10420
|
try {
|
|
10421
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
10421
|
+
const { collectDiagnostics } = await import("../persistent-session-HTOCDCII.js");
|
|
10422
10422
|
await api.post("/host/heartbeat", {
|
|
10423
10423
|
host_id: hostId,
|
|
10424
10424
|
agent_diagnostics: collectDiagnostics([codeName])
|
|
@@ -10812,7 +10812,7 @@ async function processClaudePairSessions(agents) {
|
|
|
10812
10812
|
killPairSession,
|
|
10813
10813
|
pairTmuxSession,
|
|
10814
10814
|
finalizeClaudePairOnboarding
|
|
10815
|
-
} = await import("../claude-pair-runtime-
|
|
10815
|
+
} = await import("../claude-pair-runtime-A4P6E7U5.js");
|
|
10816
10816
|
for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
|
|
10817
10817
|
log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
|
|
10818
10818
|
const killed = await killPairSession(pairTmuxSession(pairId));
|
|
@@ -14196,8 +14196,46 @@ function buildDirectChatChannelMeta(input) {
|
|
|
14196
14196
|
}
|
|
14197
14197
|
|
|
14198
14198
|
// src/turn-initiator-marker.ts
|
|
14199
|
-
import { writeFileSync, mkdirSync, renameSync } from "fs";
|
|
14200
|
-
import { dirname } from "path";
|
|
14199
|
+
import { writeFileSync, readFileSync as readFileSync2, mkdirSync, renameSync } from "fs";
|
|
14200
|
+
import { dirname, join as join2 } from "path";
|
|
14201
|
+
var TURN_INITIATOR_MAX_AGE_MS = 5 * 60 * 1e3;
|
|
14202
|
+
var TURN_INITIATOR_LEDGER_MAX_ENTRIES = 20;
|
|
14203
|
+
var TURN_INITIATOR_LEDGER_FILENAME = ".turn-initiator-ledger.json";
|
|
14204
|
+
function turnInitiatorLedgerPath(singleSlotFile) {
|
|
14205
|
+
return join2(dirname(singleSlotFile), TURN_INITIATOR_LEDGER_FILENAME);
|
|
14206
|
+
}
|
|
14207
|
+
function foldTurnInitiatorLedger(existing, marker, maxAgeMs = TURN_INITIATOR_MAX_AGE_MS, maxEntries = TURN_INITIATOR_LEDGER_MAX_ENTRIES) {
|
|
14208
|
+
const now = marker.ts;
|
|
14209
|
+
const key = (e) => `${e.channel}\0${e.channel_ref ?? ""}`;
|
|
14210
|
+
const markerKey = key(marker);
|
|
14211
|
+
const prior = existing && Array.isArray(existing.entries) ? existing.entries : [];
|
|
14212
|
+
const kept = prior.filter(
|
|
14213
|
+
(e) => e && typeof e.ts === "number" && Number.isFinite(e.ts) && now - e.ts <= maxAgeMs && now - e.ts >= 0 && key(e) !== markerKey
|
|
14214
|
+
// the same thread is replaced by the new entry below
|
|
14215
|
+
);
|
|
14216
|
+
kept.push({
|
|
14217
|
+
channel: marker.channel,
|
|
14218
|
+
sender_id: marker.sender_id,
|
|
14219
|
+
...marker.sender_name ? { sender_name: marker.sender_name } : {},
|
|
14220
|
+
...marker.channel_ref ? { channel_ref: marker.channel_ref } : {},
|
|
14221
|
+
ts: marker.ts
|
|
14222
|
+
});
|
|
14223
|
+
kept.sort((a, b) => b.ts - a.ts);
|
|
14224
|
+
return { v: 1, entries: kept.slice(0, maxEntries) };
|
|
14225
|
+
}
|
|
14226
|
+
function updateTurnInitiatorLedger(singleSlotFile, marker) {
|
|
14227
|
+
const ledgerFile = turnInitiatorLedgerPath(singleSlotFile);
|
|
14228
|
+
let existing = null;
|
|
14229
|
+
try {
|
|
14230
|
+
const parsed = JSON.parse(readFileSync2(ledgerFile, "utf8"));
|
|
14231
|
+
if (parsed && parsed.v === 1 && Array.isArray(parsed.entries)) existing = parsed;
|
|
14232
|
+
} catch {
|
|
14233
|
+
}
|
|
14234
|
+
const next = foldTurnInitiatorLedger(existing, marker);
|
|
14235
|
+
const tmp = `${ledgerFile}.tmp`;
|
|
14236
|
+
writeFileSync(tmp, JSON.stringify(next), "utf8");
|
|
14237
|
+
renameSync(tmp, ledgerFile);
|
|
14238
|
+
}
|
|
14201
14239
|
function writeTurnInitiatorMarker(input) {
|
|
14202
14240
|
const file = process.env["AGT_TURN_INITIATOR_FILE"];
|
|
14203
14241
|
if (!file || !input.sender_id) return;
|
|
@@ -14207,6 +14245,10 @@ function writeTurnInitiatorMarker(input) {
|
|
|
14207
14245
|
const tmp = `${file}.tmp`;
|
|
14208
14246
|
writeFileSync(tmp, JSON.stringify(marker), "utf8");
|
|
14209
14247
|
renameSync(tmp, file);
|
|
14248
|
+
try {
|
|
14249
|
+
updateTurnInitiatorLedger(file, marker);
|
|
14250
|
+
} catch {
|
|
14251
|
+
}
|
|
14210
14252
|
} catch {
|
|
14211
14253
|
}
|
|
14212
14254
|
}
|
|
@@ -14235,12 +14277,12 @@ async function fetchWithTimeout(input, init, timeoutMs, fetchImpl = fetch) {
|
|
|
14235
14277
|
import {
|
|
14236
14278
|
existsSync as existsSync2,
|
|
14237
14279
|
mkdirSync as mkdirSync2,
|
|
14238
|
-
readFileSync as
|
|
14280
|
+
readFileSync as readFileSync3,
|
|
14239
14281
|
renameSync as renameSync2,
|
|
14240
14282
|
unlinkSync,
|
|
14241
14283
|
writeFileSync as writeFileSync2
|
|
14242
14284
|
} from "fs";
|
|
14243
|
-
import { join as
|
|
14285
|
+
import { join as join3 } from "path";
|
|
14244
14286
|
function defaultIsPidAlive(pid) {
|
|
14245
14287
|
if (!Number.isFinite(pid) || pid <= 0) return false;
|
|
14246
14288
|
try {
|
|
@@ -14258,7 +14300,7 @@ function acquireMcpSpawnLock(args) {
|
|
|
14258
14300
|
const isPidAlive = options.isPidAlive ?? defaultIsPidAlive;
|
|
14259
14301
|
const selfPid = options.selfPid ?? process.pid;
|
|
14260
14302
|
const now = options.now ?? (() => (/* @__PURE__ */ new Date()).toISOString());
|
|
14261
|
-
const path =
|
|
14303
|
+
const path = join3(agentDir, basename);
|
|
14262
14304
|
const existing = readLockHolder(path);
|
|
14263
14305
|
if (existing) {
|
|
14264
14306
|
if (existing.pid === selfPid) {
|
|
@@ -14289,7 +14331,7 @@ function releaseMcpSpawnLock(lockPath, opts = {}) {
|
|
|
14289
14331
|
function readLockHolder(path) {
|
|
14290
14332
|
if (!existsSync2(path)) return null;
|
|
14291
14333
|
try {
|
|
14292
|
-
const raw =
|
|
14334
|
+
const raw = readFileSync3(path, "utf8");
|
|
14293
14335
|
const parsed = JSON.parse(raw);
|
|
14294
14336
|
const pid = typeof parsed.pid === "number" ? parsed.pid : Number(parsed.pid);
|
|
14295
14337
|
if (!Number.isFinite(pid) || pid <= 0) return null;
|
|
@@ -14302,35 +14344,35 @@ function readLockHolder(path) {
|
|
|
14302
14344
|
|
|
14303
14345
|
// src/direct-chat-channel.ts
|
|
14304
14346
|
import { homedir as homedir2 } from "os";
|
|
14305
|
-
import { join as
|
|
14347
|
+
import { join as join6 } from "path";
|
|
14306
14348
|
import { randomUUID } from "crypto";
|
|
14307
14349
|
import {
|
|
14308
14350
|
watch,
|
|
14309
14351
|
mkdirSync as mkdirSync3,
|
|
14310
14352
|
writeFileSync as writeFileSync3,
|
|
14311
|
-
readFileSync as
|
|
14353
|
+
readFileSync as readFileSync5,
|
|
14312
14354
|
existsSync as existsSync4,
|
|
14313
14355
|
renameSync as renameSync3,
|
|
14314
14356
|
unlinkSync as unlinkSync2
|
|
14315
14357
|
} from "fs";
|
|
14316
14358
|
|
|
14317
14359
|
// src/direct-chat-inbound-attachments.ts
|
|
14318
|
-
import { dirname as dirname2, join as
|
|
14360
|
+
import { dirname as dirname2, join as join4 } from "path";
|
|
14319
14361
|
var MAX_INBOUND_ATTACHMENT_BYTES = 10 * 1024 * 1024;
|
|
14320
14362
|
var INBOUND_ATTACHMENTS_SUBDIR = "direct-chat-inbound";
|
|
14321
14363
|
function resolveInboundAttachmentsDir(input) {
|
|
14322
14364
|
const { codeName, turnInitiatorFile, agentId, homeDir } = input;
|
|
14323
14365
|
const codeNameTrimmed = typeof codeName === "string" ? codeName.trim() : "";
|
|
14324
14366
|
if (codeNameTrimmed) {
|
|
14325
|
-
return
|
|
14367
|
+
return join4(homeDir, ".augmented", codeNameTrimmed, INBOUND_ATTACHMENTS_SUBDIR);
|
|
14326
14368
|
}
|
|
14327
14369
|
const initiator = typeof turnInitiatorFile === "string" ? turnInitiatorFile.trim() : "";
|
|
14328
14370
|
if (initiator) {
|
|
14329
|
-
return
|
|
14371
|
+
return join4(dirname2(initiator), INBOUND_ATTACHMENTS_SUBDIR);
|
|
14330
14372
|
}
|
|
14331
14373
|
const agentIdTrimmed = typeof agentId === "string" ? agentId.trim() : "";
|
|
14332
14374
|
if (agentIdTrimmed) {
|
|
14333
|
-
return
|
|
14375
|
+
return join4(homeDir, ".augmented", agentIdTrimmed, INBOUND_ATTACHMENTS_SUBDIR);
|
|
14334
14376
|
}
|
|
14335
14377
|
return null;
|
|
14336
14378
|
}
|
|
@@ -14428,11 +14470,11 @@ async function downloadInboundAttachments(attachments, dir, deps) {
|
|
|
14428
14470
|
}
|
|
14429
14471
|
|
|
14430
14472
|
// src/flags-cache-read.ts
|
|
14431
|
-
import { existsSync as existsSync3, readFileSync as
|
|
14473
|
+
import { existsSync as existsSync3, readFileSync as readFileSync4 } from "fs";
|
|
14432
14474
|
import { homedir } from "os";
|
|
14433
|
-
import { join as
|
|
14475
|
+
import { join as join5 } from "path";
|
|
14434
14476
|
function defaultFlagsCachePath() {
|
|
14435
|
-
return
|
|
14477
|
+
return join5(homedir(), ".augmented", "flags-cache.json");
|
|
14436
14478
|
}
|
|
14437
14479
|
function envBoolean(raw) {
|
|
14438
14480
|
if (raw === void 0) return void 0;
|
|
@@ -14445,7 +14487,7 @@ function envBoolean(raw) {
|
|
|
14445
14487
|
function cachedBoolean(key, path) {
|
|
14446
14488
|
try {
|
|
14447
14489
|
if (!existsSync3(path)) return void 0;
|
|
14448
|
-
const parsed = JSON.parse(
|
|
14490
|
+
const parsed = JSON.parse(readFileSync4(path, "utf8"));
|
|
14449
14491
|
if (!parsed || typeof parsed !== "object") return void 0;
|
|
14450
14492
|
const flags = parsed.flags;
|
|
14451
14493
|
if (!flags || typeof flags !== "object") return void 0;
|
|
@@ -14746,7 +14788,7 @@ var DIRECT_CHAT_MAINTENANCE_COOLDOWN_MS = (() => {
|
|
|
14746
14788
|
var AGT_HOST = process.env.AGT_HOST;
|
|
14747
14789
|
var AGT_API_KEY = process.env.AGT_API_KEY;
|
|
14748
14790
|
var AGT_AGENT_ID = process.env.AGT_AGENT_ID;
|
|
14749
|
-
var DIRECT_CHAT_AGENT_DIR = AGT_AGENT_ID ?
|
|
14791
|
+
var DIRECT_CHAT_AGENT_DIR = AGT_AGENT_ID ? join6(homedir2(), ".augmented", AGT_AGENT_ID) : null;
|
|
14750
14792
|
var INBOUND_ATTACHMENTS_DIR = resolveInboundAttachmentsDir({
|
|
14751
14793
|
codeName: process.env.AGT_AGENT_CODE_NAME,
|
|
14752
14794
|
turnInitiatorFile: process.env.AGT_TURN_INITIATOR_FILE,
|
|
@@ -14754,7 +14796,7 @@ var INBOUND_ATTACHMENTS_DIR = resolveInboundAttachmentsDir({
|
|
|
14754
14796
|
homeDir: homedir2()
|
|
14755
14797
|
});
|
|
14756
14798
|
var AGT_AGENT_CODE_NAME = process.env.AGT_AGENT_CODE_NAME;
|
|
14757
|
-
var PROGRESS_HEARTBEAT_PATH = AGT_AGENT_CODE_NAME ?
|
|
14799
|
+
var PROGRESS_HEARTBEAT_PATH = AGT_AGENT_CODE_NAME ? join6(homedir2(), ".augmented", AGT_AGENT_CODE_NAME, "channel-progress-heartbeat.json") : null;
|
|
14758
14800
|
var progressReceivedAt = /* @__PURE__ */ new Map();
|
|
14759
14801
|
var directChatProgressState = { tracked: null };
|
|
14760
14802
|
var directChatProgressTickRunning = false;
|
|
@@ -14773,7 +14815,7 @@ var directChatKanbanCardClient = createKanbanCardActiveClient({
|
|
|
14773
14815
|
function readProgressHeartbeat() {
|
|
14774
14816
|
if (!PROGRESS_HEARTBEAT_PATH || !existsSync4(PROGRESS_HEARTBEAT_PATH)) return null;
|
|
14775
14817
|
try {
|
|
14776
|
-
return parseProgressHeartbeat(
|
|
14818
|
+
return parseProgressHeartbeat(readFileSync5(PROGRESS_HEARTBEAT_PATH, "utf-8"));
|
|
14777
14819
|
} catch {
|
|
14778
14820
|
return null;
|
|
14779
14821
|
}
|
|
@@ -14782,7 +14824,7 @@ function seedProgressHeartbeat() {
|
|
|
14782
14824
|
if (!PROGRESS_HEARTBEAT_PATH) return;
|
|
14783
14825
|
const tmp = `${PROGRESS_HEARTBEAT_PATH}.${process.pid}.tmp`;
|
|
14784
14826
|
try {
|
|
14785
|
-
mkdirSync3(
|
|
14827
|
+
mkdirSync3(join6(homedir2(), ".augmented", AGT_AGENT_CODE_NAME), { recursive: true });
|
|
14786
14828
|
writeFileSync3(tmp, serializeProgressHeartbeat(SEED_PROGRESS_STEP, Date.now()), { mode: 384 });
|
|
14787
14829
|
renameSync3(tmp, PROGRESS_HEARTBEAT_PATH);
|
|
14788
14830
|
} catch {
|
|
@@ -14940,7 +14982,7 @@ var inboundAttachmentDeps = {
|
|
|
14940
14982
|
},
|
|
14941
14983
|
ensureDir: (dir) => mkdirSync3(dir, { recursive: true }),
|
|
14942
14984
|
writeFile: (path, bytes) => writeFileSync3(path, bytes, { mode: 384 }),
|
|
14943
|
-
joinPath: (...parts) =>
|
|
14985
|
+
joinPath: (...parts) => join6(...parts),
|
|
14944
14986
|
warn: (msg) => process.stderr.write(`${msg}
|
|
14945
14987
|
`)
|
|
14946
14988
|
};
|