@integrity-labs/agt-cli 0.28.423 → 0.28.424
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-4SEBGBAO.js → chunk-2QBY2QVX.js} +3 -3
- package/dist/{chunk-XFC7YVGS.js → chunk-CWIWI2ZX.js} +1 -1
- package/dist/{chunk-XFC7YVGS.js.map → chunk-CWIWI2ZX.js.map} +1 -1
- package/dist/{claude-pair-runtime-3JHCWZZD.js → claude-pair-runtime-PAP4BS3I.js} +2 -2
- package/dist/lib/manager-worker.js +63 -42
- package/dist/lib/manager-worker.js.map +1 -1
- package/dist/mcp/direct-chat-channel.js +80 -64
- package/dist/mcp/slack-channel.js +1 -1
- package/dist/mcp/telegram-channel.js +113 -97
- package/dist/{persistent-session-HWCKGPYF.js → persistent-session-O7OCNB6B.js} +2 -2
- package/dist/{responsiveness-probe-4CGMUXOH.js → responsiveness-probe-R5FWKHPI.js} +2 -2
- package/package.json +1 -1
- /package/dist/{chunk-4SEBGBAO.js.map → chunk-2QBY2QVX.js.map} +0 -0
- /package/dist/{claude-pair-runtime-3JHCWZZD.js.map → claude-pair-runtime-PAP4BS3I.js.map} +0 -0
- /package/dist/{persistent-session-HWCKGPYF.js.map → persistent-session-O7OCNB6B.js.map} +0 -0
- /package/dist/{responsiveness-probe-4CGMUXOH.js.map → responsiveness-probe-R5FWKHPI.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-O7OCNB6B.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-PAP4BS3I.js.map
|
|
@@ -45,7 +45,7 @@ import {
|
|
|
45
45
|
resolveEffectivePinRaw,
|
|
46
46
|
safeWriteJsonAtomic,
|
|
47
47
|
setConfigHash
|
|
48
|
-
} from "../chunk-
|
|
48
|
+
} from "../chunk-2QBY2QVX.js";
|
|
49
49
|
import {
|
|
50
50
|
getProjectDir as getProjectDir2,
|
|
51
51
|
getReadyTasks,
|
|
@@ -150,14 +150,14 @@ import {
|
|
|
150
150
|
toOpencodeModel,
|
|
151
151
|
transcriptActivityAgeSeconds,
|
|
152
152
|
writeEgressAllowlist
|
|
153
|
-
} from "../chunk-
|
|
153
|
+
} from "../chunk-CWIWI2ZX.js";
|
|
154
154
|
import {
|
|
155
155
|
reapOrphanChannelMcps
|
|
156
156
|
} from "../chunk-XWVM4KPK.js";
|
|
157
157
|
|
|
158
158
|
// src/lib/manager-worker.ts
|
|
159
159
|
import { createHash as createHash15 } from "crypto";
|
|
160
|
-
import { readFileSync as
|
|
160
|
+
import { readFileSync as readFileSync19, writeFileSync as writeFileSync12, mkdirSync as mkdirSync10, existsSync as existsSync11, rmSync as rmSync5, readdirSync as readdirSync6, statSync as statSync4, copyFileSync } from "fs";
|
|
161
161
|
import { execFileSync as syncExecFile } from "child_process";
|
|
162
162
|
import { join as join22, dirname as dirname7, delimiter as pathDelimiter } from "path";
|
|
163
163
|
import { homedir as homedir10 } from "os";
|
|
@@ -5084,7 +5084,7 @@ function closeScheduledRunsForCode(codeName, outcome, reason) {
|
|
|
5084
5084
|
|
|
5085
5085
|
// src/lib/manager/scheduler/kanban-route.ts
|
|
5086
5086
|
import { createHash as createHash10 } from "crypto";
|
|
5087
|
-
import { writeFileSync as writeFileSync8, renameSync, mkdirSync as mkdirSync6 } from "fs";
|
|
5087
|
+
import { writeFileSync as writeFileSync8, renameSync, mkdirSync as mkdirSync6, readFileSync as readFileSync15, unlinkSync } from "fs";
|
|
5088
5088
|
import { homedir as homedir7 } from "os";
|
|
5089
5089
|
import { join as join17, dirname as dirname5 } from "path";
|
|
5090
5090
|
|
|
@@ -5282,6 +5282,14 @@ async function deliverScheduledTaskOutput(agentCodeName, agentId, rawTarget, bod
|
|
|
5282
5282
|
|
|
5283
5283
|
// src/lib/manager/scheduler/kanban-route.ts
|
|
5284
5284
|
async function deliverScheduledCardResult(codeName, agentId, cardId, completedBy = "self") {
|
|
5285
|
+
const seen = { taskRef: null };
|
|
5286
|
+
const result = await runScheduledCardDelivery(codeName, agentId, cardId, completedBy, seen);
|
|
5287
|
+
if (seen.taskRef && (result === "delivered" || result === "terminal")) {
|
|
5288
|
+
clearScheduledTurnMarkerForTask(codeName, seen.taskRef);
|
|
5289
|
+
}
|
|
5290
|
+
return result;
|
|
5291
|
+
}
|
|
5292
|
+
async function runScheduledCardDelivery(codeName, agentId, cardId, completedBy, seen) {
|
|
5285
5293
|
if (!claimScheduledCardDelivery(cardId)) {
|
|
5286
5294
|
return completedScheduledCards.has(cardId) ? "terminal" : "in_flight";
|
|
5287
5295
|
}
|
|
@@ -5302,6 +5310,9 @@ async function deliverScheduledCardResult(codeName, agentId, cardId, completedBy
|
|
|
5302
5310
|
log(`[scheduled-kanban] delivery fetch failed for card ${cardId} on '${codeName}': ${err.message} \u2014 will retry`);
|
|
5303
5311
|
return "retry";
|
|
5304
5312
|
}
|
|
5313
|
+
if (card?.source_type === "scheduled_task" && card.source_ref) {
|
|
5314
|
+
seen.taskRef = card.source_ref;
|
|
5315
|
+
}
|
|
5305
5316
|
if (!card || card.status !== "done" || card.source_type !== "scheduled_task" || !card.source_ref) {
|
|
5306
5317
|
markScheduledCardDeliveryComplete(cardId);
|
|
5307
5318
|
return "terminal";
|
|
@@ -5424,6 +5435,16 @@ function stampScheduledTurnMarker(codeName, taskId, target) {
|
|
|
5424
5435
|
log(`[scheduled-kanban] scheduled-turn marker write failed for '${codeName}': ${err.message}`);
|
|
5425
5436
|
}
|
|
5426
5437
|
}
|
|
5438
|
+
function clearScheduledTurnMarkerForTask(codeName, taskId) {
|
|
5439
|
+
const file = join17(homedir7(), ".augmented", codeName, SCHEDULED_TURN_MARKER_FILENAME);
|
|
5440
|
+
try {
|
|
5441
|
+
const raw = JSON.parse(readFileSync15(file, "utf8"));
|
|
5442
|
+
if (typeof raw?.task_id !== "string" || raw.task_id !== taskId) return;
|
|
5443
|
+
unlinkSync(file);
|
|
5444
|
+
log(`[scheduled-kanban] scheduled-turn marker cleared for '${codeName}' (task ${taskId} complete)`);
|
|
5445
|
+
} catch {
|
|
5446
|
+
}
|
|
5447
|
+
}
|
|
5427
5448
|
async function routeScheduledTaskViaKanban(codeName, agentId, task, prompt, durableDelivery = false) {
|
|
5428
5449
|
const priorRuns = await fetchPriorScheduledRuns(agentId, task.taskId);
|
|
5429
5450
|
const contextBlocks = buildScheduledTaskContextBlocks({ priorRuns, timezone: task.timezone });
|
|
@@ -6797,7 +6818,7 @@ async function fireOpencodeScheduledTask(agent, task) {
|
|
|
6797
6818
|
|
|
6798
6819
|
// src/lib/opencode-telegram-ingest.ts
|
|
6799
6820
|
import { createHash as createHash14 } from "crypto";
|
|
6800
|
-
import { existsSync as existsSync9, mkdirSync as mkdirSync7, readFileSync as
|
|
6821
|
+
import { existsSync as existsSync9, mkdirSync as mkdirSync7, readFileSync as readFileSync16, renameSync as renameSync2, unlinkSync as unlinkSync2, writeFileSync as writeFileSync9 } from "fs";
|
|
6801
6822
|
import { randomUUID } from "crypto";
|
|
6802
6823
|
import { join as join19 } from "path";
|
|
6803
6824
|
|
|
@@ -7356,7 +7377,7 @@ function createFileOffsetStore(codeName, log2, currentBotId) {
|
|
|
7356
7377
|
load() {
|
|
7357
7378
|
if (!filePath) return 0;
|
|
7358
7379
|
try {
|
|
7359
|
-
const parsed = JSON.parse(
|
|
7380
|
+
const parsed = JSON.parse(readFileSync16(filePath, "utf-8"));
|
|
7360
7381
|
if (currentBotId != null && typeof parsed?.bot_id === "number" && parsed.bot_id !== currentBotId) {
|
|
7361
7382
|
log2(`[telegram-ingest:${codeName}] offset cursor belongs to a different bot; ignoring (bot swap)`);
|
|
7362
7383
|
return 0;
|
|
@@ -7389,7 +7410,7 @@ function createFileOffsetStore(codeName, log2, currentBotId) {
|
|
|
7389
7410
|
} catch (err) {
|
|
7390
7411
|
log2(`[telegram-ingest:${codeName}] offset persist failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
7391
7412
|
try {
|
|
7392
|
-
if (existsSync9(tmpPath))
|
|
7413
|
+
if (existsSync9(tmpPath)) unlinkSync2(tmpPath);
|
|
7393
7414
|
} catch {
|
|
7394
7415
|
}
|
|
7395
7416
|
}
|
|
@@ -7606,7 +7627,7 @@ function partitionActionableByPoison(actionable, states, config2) {
|
|
|
7606
7627
|
}
|
|
7607
7628
|
|
|
7608
7629
|
// src/lib/restart-flags.ts
|
|
7609
|
-
import { existsSync as existsSync10, mkdirSync as mkdirSync8, readdirSync as readdirSync4, readFileSync as
|
|
7630
|
+
import { existsSync as existsSync10, mkdirSync as mkdirSync8, readdirSync as readdirSync4, readFileSync as readFileSync17, renameSync as renameSync3, rmSync as rmSync4, writeFileSync as writeFileSync10 } from "fs";
|
|
7610
7631
|
import { homedir as homedir9 } from "os";
|
|
7611
7632
|
import { join as join20 } from "path";
|
|
7612
7633
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
@@ -7623,7 +7644,7 @@ function readRestartFlags() {
|
|
|
7623
7644
|
for (const entry of readdirSync4(dir)) {
|
|
7624
7645
|
if (!entry.endsWith(".flag")) continue;
|
|
7625
7646
|
try {
|
|
7626
|
-
const raw =
|
|
7647
|
+
const raw = readFileSync17(join20(dir, entry), "utf8");
|
|
7627
7648
|
const parsed = JSON.parse(raw);
|
|
7628
7649
|
if (typeof parsed.codeName !== "string" || parsed.codeName.length === 0) {
|
|
7629
7650
|
parsed.codeName = entry.replace(/\.flag$/, "");
|
|
@@ -7741,7 +7762,7 @@ async function sendError(flag, opts, text) {
|
|
|
7741
7762
|
}
|
|
7742
7763
|
|
|
7743
7764
|
// src/lib/restart-context.ts
|
|
7744
|
-
import { readdirSync as readdirSync5, readFileSync as
|
|
7765
|
+
import { readdirSync as readdirSync5, readFileSync as readFileSync18, writeFileSync as writeFileSync11, mkdirSync as mkdirSync9, unlinkSync as unlinkSync3 } from "fs";
|
|
7745
7766
|
import { dirname as dirname6, join as join21 } from "path";
|
|
7746
7767
|
var SLACK_PENDING_INBOUND_DIRNAME = "slack-pending-inbound";
|
|
7747
7768
|
var SLACK_RESTART_CONTEXT_DIRNAME = "slack-restart-context";
|
|
@@ -7799,7 +7820,7 @@ function safeReaddir(dir) {
|
|
|
7799
7820
|
}
|
|
7800
7821
|
function readStrandedMarker(path) {
|
|
7801
7822
|
try {
|
|
7802
|
-
const parsed = JSON.parse(
|
|
7823
|
+
const parsed = JSON.parse(readFileSync18(path, "utf-8"));
|
|
7803
7824
|
if (typeof parsed.channel === "string" && typeof parsed.thread_ts === "string") {
|
|
7804
7825
|
return { channel: parsed.channel, thread_ts: parsed.thread_ts };
|
|
7805
7826
|
}
|
|
@@ -7817,7 +7838,7 @@ function pruneHintsExcept(codeName, freshFilenames) {
|
|
|
7817
7838
|
if (!filename.endsWith(".json")) continue;
|
|
7818
7839
|
if (freshFilenames.has(filename)) continue;
|
|
7819
7840
|
try {
|
|
7820
|
-
|
|
7841
|
+
unlinkSync3(join21(ctxDir, filename));
|
|
7821
7842
|
} catch {
|
|
7822
7843
|
}
|
|
7823
7844
|
}
|
|
@@ -9082,7 +9103,7 @@ var runningChannelSecretHashes = /* @__PURE__ */ new Map();
|
|
|
9082
9103
|
var sessionLaunchManagedStructure = /* @__PURE__ */ new Map();
|
|
9083
9104
|
function projectMcpHash(_codeName, projectDir) {
|
|
9084
9105
|
try {
|
|
9085
|
-
const raw =
|
|
9106
|
+
const raw = readFileSync19(join22(projectDir, ".mcp.json"), "utf-8");
|
|
9086
9107
|
return createHash15("sha256").update(canonicalJson(JSON.parse(raw))).digest("hex");
|
|
9087
9108
|
} catch {
|
|
9088
9109
|
return null;
|
|
@@ -9090,7 +9111,7 @@ function projectMcpHash(_codeName, projectDir) {
|
|
|
9090
9111
|
}
|
|
9091
9112
|
function projectMcpKeys(_codeName, projectDir) {
|
|
9092
9113
|
try {
|
|
9093
|
-
const raw =
|
|
9114
|
+
const raw = readFileSync19(join22(projectDir, ".mcp.json"), "utf-8");
|
|
9094
9115
|
const parsed = JSON.parse(raw);
|
|
9095
9116
|
const servers = parsed.mcpServers;
|
|
9096
9117
|
if (!servers || typeof servers !== "object") return /* @__PURE__ */ new Set();
|
|
@@ -9108,7 +9129,7 @@ function seedSessionLaunchBaselines(codeName, projectDir) {
|
|
|
9108
9129
|
else runningMcpServerKeys.delete(codeName);
|
|
9109
9130
|
let launchStructure = null;
|
|
9110
9131
|
try {
|
|
9111
|
-
const raw =
|
|
9132
|
+
const raw = readFileSync19(join22(projectDir, ".mcp.json"), "utf-8");
|
|
9112
9133
|
launchStructure = managedMcpStructureHashFromFile(
|
|
9113
9134
|
JSON.parse(raw),
|
|
9114
9135
|
isManagedMcpServerKey
|
|
@@ -9212,7 +9233,7 @@ async function runAgentSessionToolBindProbes(agent, integrations, projectDir, op
|
|
|
9212
9233
|
if (result && result.rebindCandidates.length > 0 && hostFlagStore().getBoolean("session-tool-rebind")) {
|
|
9213
9234
|
let mcpJsonForRebind = null;
|
|
9214
9235
|
try {
|
|
9215
|
-
mcpJsonForRebind = JSON.parse(
|
|
9236
|
+
mcpJsonForRebind = JSON.parse(readFileSync19(join22(projectDir, ".mcp.json"), "utf-8"));
|
|
9216
9237
|
} catch {
|
|
9217
9238
|
mcpJsonForRebind = null;
|
|
9218
9239
|
}
|
|
@@ -9363,7 +9384,7 @@ function checkMcpConfigDriftAndScheduleRestart(codeName, projectDir) {
|
|
|
9363
9384
|
function projectChannelSecretHash(projectDir) {
|
|
9364
9385
|
try {
|
|
9365
9386
|
const entries = parseEnvIntegrations(
|
|
9366
|
-
|
|
9387
|
+
readFileSync19(join22(projectDir, ".env.integrations"), "utf-8")
|
|
9367
9388
|
);
|
|
9368
9389
|
return channelSecretValueHash(entries, CHANNEL_SECRET_ENV_KEYS);
|
|
9369
9390
|
} catch {
|
|
@@ -9458,7 +9479,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
|
|
|
9458
9479
|
var lastVersionCheckAt = 0;
|
|
9459
9480
|
var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
|
|
9460
9481
|
var lastResponsivenessProbeAt = 0;
|
|
9461
|
-
var agtCliVersion = true ? "0.28.
|
|
9482
|
+
var agtCliVersion = true ? "0.28.424" : "dev";
|
|
9462
9483
|
function resolveBrewPath(execFileSync2) {
|
|
9463
9484
|
try {
|
|
9464
9485
|
const out = execFileSync2("which", ["brew"], { timeout: 5e3 }).toString().trim();
|
|
@@ -9747,7 +9768,7 @@ function ensureClaudeManagedSettings(path = claudeManagedSettingsPath()) {
|
|
|
9747
9768
|
try {
|
|
9748
9769
|
let settings = {};
|
|
9749
9770
|
if (existsSync11(path)) {
|
|
9750
|
-
const raw =
|
|
9771
|
+
const raw = readFileSync19(path, "utf-8").trim();
|
|
9751
9772
|
if (raw) {
|
|
9752
9773
|
let parsed;
|
|
9753
9774
|
try {
|
|
@@ -10606,7 +10627,7 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
|
|
|
10606
10627
|
if (codeNames.length === 0) return;
|
|
10607
10628
|
void (async () => {
|
|
10608
10629
|
try {
|
|
10609
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
10630
|
+
const { collectDiagnostics } = await import("../persistent-session-O7OCNB6B.js");
|
|
10610
10631
|
await api.post("/host/heartbeat", {
|
|
10611
10632
|
host_id: hostId,
|
|
10612
10633
|
agent_diagnostics: collectDiagnostics(codeNames, quarantineEntriesFor)
|
|
@@ -10713,7 +10734,7 @@ async function pollCycle() {
|
|
|
10713
10734
|
}
|
|
10714
10735
|
try {
|
|
10715
10736
|
const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
|
|
10716
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
10737
|
+
const { collectDiagnostics } = await import("../persistent-session-O7OCNB6B.js");
|
|
10717
10738
|
const diagCodeNames = [...agentState.persistentSessionAgents];
|
|
10718
10739
|
const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames, quarantineEntriesFor) : void 0;
|
|
10719
10740
|
let tailscaleHostname;
|
|
@@ -10827,7 +10848,7 @@ async function pollCycle() {
|
|
|
10827
10848
|
collectResponsivenessProbes,
|
|
10828
10849
|
collectPanelessActivityProbes,
|
|
10829
10850
|
getResponsivenessIntervalMs
|
|
10830
|
-
} = await import("../responsiveness-probe-
|
|
10851
|
+
} = await import("../responsiveness-probe-R5FWKHPI.js");
|
|
10831
10852
|
const probeIntervalMs = getResponsivenessIntervalMs();
|
|
10832
10853
|
if (now - lastResponsivenessProbeAt > probeIntervalMs) {
|
|
10833
10854
|
const probeCodeNames = [...agentState.persistentSessionAgents];
|
|
@@ -10866,7 +10887,7 @@ async function pollCycle() {
|
|
|
10866
10887
|
collectResponsivenessProbes,
|
|
10867
10888
|
livePendingInboundOldestAgeSeconds,
|
|
10868
10889
|
parkPendingInbound
|
|
10869
|
-
} = await import("../responsiveness-probe-
|
|
10890
|
+
} = await import("../responsiveness-probe-R5FWKHPI.js");
|
|
10870
10891
|
const { getProjectDir: wedgeProjectDir } = await import("../scheduler-engine-NDP36U7O.js");
|
|
10871
10892
|
const wedgeNow = /* @__PURE__ */ new Date();
|
|
10872
10893
|
const liveAgents = agentState.persistentSessionAgents;
|
|
@@ -10955,7 +10976,7 @@ async function pollCycle() {
|
|
|
10955
10976
|
);
|
|
10956
10977
|
if (hostFlagStore().getBoolean("wedge-transient-notice")) {
|
|
10957
10978
|
try {
|
|
10958
|
-
const paneTail =
|
|
10979
|
+
const paneTail = readFileSync19(paneLogPath(codeName), "utf8").slice(-65536);
|
|
10959
10980
|
const transient = detectTransientApiErrorInLog(paneTail);
|
|
10960
10981
|
if (transient) {
|
|
10961
10982
|
const wedgeHome = join22(homedir10(), ".augmented", codeName);
|
|
@@ -11701,7 +11722,7 @@ async function processAgent(agent, agentStates) {
|
|
|
11701
11722
|
newHash = sha256(stripDynamicSections(artifact.content));
|
|
11702
11723
|
try {
|
|
11703
11724
|
const projectClaudeMd = join22(config.configDir, agent.code_name, "project", "CLAUDE.md");
|
|
11704
|
-
const existing =
|
|
11725
|
+
const existing = readFileSync19(projectClaudeMd, "utf-8");
|
|
11705
11726
|
existingHash = sha256(stripDynamicSections(existing));
|
|
11706
11727
|
} catch {
|
|
11707
11728
|
existingHash = null;
|
|
@@ -11719,7 +11740,7 @@ async function processAgent(agent, agentStates) {
|
|
|
11719
11740
|
const generatorKeys = Object.keys(generatorServers);
|
|
11720
11741
|
let existingRaw = "";
|
|
11721
11742
|
try {
|
|
11722
|
-
existingRaw =
|
|
11743
|
+
existingRaw = readFileSync19(filePath, "utf-8");
|
|
11723
11744
|
} catch {
|
|
11724
11745
|
}
|
|
11725
11746
|
const existingServers = parseMcp(existingRaw);
|
|
@@ -11735,7 +11756,7 @@ async function processAgent(agent, agentStates) {
|
|
|
11735
11756
|
} else if (artifact.relativePath === "opencode.json") {
|
|
11736
11757
|
let existingRaw = null;
|
|
11737
11758
|
try {
|
|
11738
|
-
existingRaw =
|
|
11759
|
+
existingRaw = readFileSync19(filePath, "utf-8");
|
|
11739
11760
|
} catch {
|
|
11740
11761
|
}
|
|
11741
11762
|
const mergeResult = mergeOpencodeConfigArtifact(artifact.content, existingRaw);
|
|
@@ -12292,7 +12313,7 @@ async function processAgent(agent, agentStates) {
|
|
|
12292
12313
|
const projectMcpPath = join22(projectDir, ".mcp.json");
|
|
12293
12314
|
let mcpConfig = { mcpServers: {} };
|
|
12294
12315
|
try {
|
|
12295
|
-
mcpConfig = JSON.parse(
|
|
12316
|
+
mcpConfig = JSON.parse(readFileSync19(provisionMcpPath, "utf-8"));
|
|
12296
12317
|
if (!mcpConfig.mcpServers) mcpConfig.mcpServers = {};
|
|
12297
12318
|
} catch {
|
|
12298
12319
|
}
|
|
@@ -12557,7 +12578,7 @@ async function processAgent(agent, agentStates) {
|
|
|
12557
12578
|
const envIntPath = join22(projectDir, ".env.integrations");
|
|
12558
12579
|
let preWriteEnv;
|
|
12559
12580
|
try {
|
|
12560
|
-
preWriteEnv =
|
|
12581
|
+
preWriteEnv = readFileSync19(envIntPath, "utf-8");
|
|
12561
12582
|
} catch {
|
|
12562
12583
|
preWriteEnv = void 0;
|
|
12563
12584
|
}
|
|
@@ -12575,8 +12596,8 @@ async function processAgent(agent, agentStates) {
|
|
|
12575
12596
|
if (fw === "claude-code" && isSessionHealthy(agent.code_name)) {
|
|
12576
12597
|
try {
|
|
12577
12598
|
const projectMcpPath = join22(projectDir, ".mcp.json");
|
|
12578
|
-
const postWriteEnv =
|
|
12579
|
-
const mcpContent =
|
|
12599
|
+
const postWriteEnv = readFileSync19(envIntPath, "utf-8");
|
|
12600
|
+
const mcpContent = readFileSync19(projectMcpPath, "utf-8");
|
|
12580
12601
|
const changedVars = diffEnvIntegrations(preWriteEnv, postWriteEnv);
|
|
12581
12602
|
const mcpJsonForReap = JSON.parse(mcpContent);
|
|
12582
12603
|
const affectedServerKeys = findMcpServersUsingVars(mcpJsonForReap, changedVars);
|
|
@@ -13116,7 +13137,7 @@ async function processAgent(agent, agentStates) {
|
|
|
13116
13137
|
let mcpJsonParsed = null;
|
|
13117
13138
|
try {
|
|
13118
13139
|
const mcpPath = join22(getProjectDir(agent.code_name), ".mcp.json");
|
|
13119
|
-
mcpJsonParsed = JSON.parse(
|
|
13140
|
+
mcpJsonParsed = JSON.parse(readFileSync19(mcpPath, "utf-8"));
|
|
13120
13141
|
} catch {
|
|
13121
13142
|
}
|
|
13122
13143
|
reapMissingMcpSessions({
|
|
@@ -14177,7 +14198,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
|
|
|
14177
14198
|
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}`));
|
|
14178
14199
|
void (async () => {
|
|
14179
14200
|
try {
|
|
14180
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
14201
|
+
const { collectDiagnostics } = await import("../persistent-session-O7OCNB6B.js");
|
|
14181
14202
|
await api.post("/host/heartbeat", {
|
|
14182
14203
|
host_id: hostId,
|
|
14183
14204
|
agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor)
|
|
@@ -14227,7 +14248,7 @@ async function respawnAgentAfterMcpStop(codeName, reason) {
|
|
|
14227
14248
|
}
|
|
14228
14249
|
try {
|
|
14229
14250
|
const hostId = await getHostId();
|
|
14230
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
14251
|
+
const { collectDiagnostics } = await import("../persistent-session-O7OCNB6B.js");
|
|
14231
14252
|
await api.post("/host/heartbeat", {
|
|
14232
14253
|
host_id: hostId,
|
|
14233
14254
|
agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor)
|
|
@@ -14680,7 +14701,7 @@ async function processClaudePairSessions(agents) {
|
|
|
14680
14701
|
killPairSession,
|
|
14681
14702
|
pairTmuxSession,
|
|
14682
14703
|
finalizeClaudePairOnboarding
|
|
14683
|
-
} = await import("../claude-pair-runtime-
|
|
14704
|
+
} = await import("../claude-pair-runtime-PAP4BS3I.js");
|
|
14684
14705
|
for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
|
|
14685
14706
|
log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
|
|
14686
14707
|
const killed = await killPairSession(pairTmuxSession(pairId));
|
|
@@ -14949,7 +14970,7 @@ async function syncMemories(agent, configDir, log2) {
|
|
|
14949
14970
|
for (const file of readdirSync6(memoryDir)) {
|
|
14950
14971
|
if (!file.endsWith(".md")) continue;
|
|
14951
14972
|
try {
|
|
14952
|
-
const raw =
|
|
14973
|
+
const raw = readFileSync19(join22(memoryDir, file), "utf-8");
|
|
14953
14974
|
const fileHash = createHash15("sha256").update(raw).digest("hex").slice(0, 16);
|
|
14954
14975
|
currentHashes.set(file, fileHash);
|
|
14955
14976
|
if (prevHashes.get(file) === fileHash) continue;
|
|
@@ -14974,7 +14995,7 @@ async function syncMemories(agent, configDir, log2) {
|
|
|
14974
14995
|
} catch (err) {
|
|
14975
14996
|
for (const mem of changedMemories) {
|
|
14976
14997
|
for (const [file] of currentHashes) {
|
|
14977
|
-
const parsed = parseMemoryFile(
|
|
14998
|
+
const parsed = parseMemoryFile(readFileSync19(join22(memoryDir, file), "utf-8"), file.replace(/\.md$/, ""));
|
|
14978
14999
|
if (parsed?.name === mem.name) currentHashes.delete(file);
|
|
14979
15000
|
}
|
|
14980
15001
|
}
|
|
@@ -15021,7 +15042,7 @@ ${mem.content}
|
|
|
15021
15042
|
if (existsSync11(filePath)) {
|
|
15022
15043
|
let existing = "";
|
|
15023
15044
|
try {
|
|
15024
|
-
existing =
|
|
15045
|
+
existing = readFileSync19(filePath, "utf-8");
|
|
15025
15046
|
} catch {
|
|
15026
15047
|
}
|
|
15027
15048
|
if (existing === desired) continue;
|
|
@@ -15283,7 +15304,7 @@ function startManager(opts) {
|
|
|
15283
15304
|
try {
|
|
15284
15305
|
const stateFile = getStateFile();
|
|
15285
15306
|
if (existsSync11(stateFile)) {
|
|
15286
|
-
const raw =
|
|
15307
|
+
const raw = readFileSync19(stateFile, "utf-8");
|
|
15287
15308
|
const parsed = JSON.parse(raw);
|
|
15288
15309
|
if (Array.isArray(parsed.agents)) {
|
|
15289
15310
|
state6.agents = parsed.agents;
|
|
@@ -15339,7 +15360,7 @@ async function reapOrphanedClaudePids() {
|
|
|
15339
15360
|
const looksLikeClaude = (pid) => {
|
|
15340
15361
|
if (process.platform !== "linux") return true;
|
|
15341
15362
|
try {
|
|
15342
|
-
const comm =
|
|
15363
|
+
const comm = readFileSync19(`/proc/${pid}/comm`, "utf-8").trim().toLowerCase();
|
|
15343
15364
|
return comm.includes("claude");
|
|
15344
15365
|
} catch {
|
|
15345
15366
|
return false;
|
|
@@ -15459,7 +15480,7 @@ function deployMcpAssets() {
|
|
|
15459
15480
|
const fileHash = (p) => {
|
|
15460
15481
|
try {
|
|
15461
15482
|
if (!existsSync11(p)) return null;
|
|
15462
|
-
return createHash15("sha256").update(
|
|
15483
|
+
return createHash15("sha256").update(readFileSync19(p)).digest("hex");
|
|
15463
15484
|
} catch {
|
|
15464
15485
|
return null;
|
|
15465
15486
|
}
|
|
@@ -15551,7 +15572,7 @@ function deployMcpAssets() {
|
|
|
15551
15572
|
for (const subdir of ["provision", "project"]) {
|
|
15552
15573
|
const mcpJsonPath = join22(agentsDir, entry.name, subdir, ".mcp.json");
|
|
15553
15574
|
try {
|
|
15554
|
-
const raw =
|
|
15575
|
+
const raw = readFileSync19(mcpJsonPath, "utf-8");
|
|
15555
15576
|
if (!raw.includes("@integrity-labs/augmented-mcp")) continue;
|
|
15556
15577
|
const mcpConfig = JSON.parse(raw);
|
|
15557
15578
|
const augServer = mcpConfig.mcpServers?.["augmented"];
|