@integrity-labs/agt-cli 0.28.1123 → 0.28.1125
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-IXCMKMDT.js → chunk-C5YNHEST.js} +2 -2
- package/dist/chunk-JEC3BUC6.js +29 -0
- package/dist/chunk-JEC3BUC6.js.map +1 -0
- package/dist/{chunk-E2RGZJA2.js → chunk-JHKH2EYM.js} +4 -4
- package/dist/{chunk-J7GZNCX2.js → chunk-JI2D2TA2.js} +7 -1
- package/dist/{chunk-J7GZNCX2.js.map → chunk-JI2D2TA2.js.map} +1 -1
- package/dist/{claude-pair-runtime-NHQCMIW6.js → claude-pair-runtime-5OBFRZWS.js} +8 -3
- package/dist/claude-pair-runtime-5OBFRZWS.js.map +1 -0
- package/dist/lib/manager-worker.js +75 -62
- package/dist/lib/manager-worker.js.map +1 -1
- package/dist/mcp/direct-chat-channel.js +6 -0
- package/dist/mcp/index.js +6 -0
- package/dist/mcp/origami.js +6 -0
- package/dist/mcp/slack-channel.js +6 -0
- package/dist/mcp/telegram-channel.js +98 -0
- package/dist/{persistent-session-URAR5HDF.js → persistent-session-E5IR3RBF.js} +3 -3
- package/dist/{responsiveness-probe-OICDEM3R.js → responsiveness-probe-KCICZE6E.js} +3 -3
- package/dist/{session-auth-dead-QYQXJNZP.js → session-auth-dead-VYP4VCMX.js} +2 -2
- package/package.json +1 -1
- package/dist/claude-pair-runtime-NHQCMIW6.js.map +0 -1
- /package/dist/{chunk-IXCMKMDT.js.map → chunk-C5YNHEST.js.map} +0 -0
- /package/dist/{chunk-E2RGZJA2.js.map → chunk-JHKH2EYM.js.map} +0 -0
- /package/dist/{persistent-session-URAR5HDF.js.map → persistent-session-E5IR3RBF.js.map} +0 -0
- /package/dist/{responsiveness-probe-OICDEM3R.js.map → responsiveness-probe-KCICZE6E.js.map} +0 -0
- /package/dist/{session-auth-dead-QYQXJNZP.js.map → session-auth-dead-VYP4VCMX.js.map} +0 -0
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
hostClaudeOneShotArgs
|
|
3
|
+
} from "../chunk-JEC3BUC6.js";
|
|
1
4
|
import {
|
|
2
5
|
ApiError,
|
|
3
6
|
COMPUTER_USE_MCP_KEY,
|
|
@@ -68,7 +71,7 @@ import {
|
|
|
68
71
|
safeWriteJsonAtomic,
|
|
69
72
|
setConfigHash,
|
|
70
73
|
tripClass
|
|
71
|
-
} from "../chunk-
|
|
74
|
+
} from "../chunk-JHKH2EYM.js";
|
|
72
75
|
import {
|
|
73
76
|
getProjectDir as getProjectDir2,
|
|
74
77
|
getReadyTasks,
|
|
@@ -155,7 +158,7 @@ import {
|
|
|
155
158
|
webFetchBaselineValue,
|
|
156
159
|
webFetchRestartNeeded,
|
|
157
160
|
writeEgressAllowlist
|
|
158
|
-
} from "../chunk-
|
|
161
|
+
} from "../chunk-C5YNHEST.js";
|
|
159
162
|
import {
|
|
160
163
|
ACCOUNT_ENFORCEMENT_MARKER_FILENAME,
|
|
161
164
|
AnchorSessionClient,
|
|
@@ -265,7 +268,7 @@ import {
|
|
|
265
268
|
subagentActivityAgeSeconds,
|
|
266
269
|
sumTranscriptUsageInWindow,
|
|
267
270
|
transcriptActivityAgeSeconds
|
|
268
|
-
} from "../chunk-
|
|
271
|
+
} from "../chunk-JI2D2TA2.js";
|
|
269
272
|
import {
|
|
270
273
|
classifyUnanswerablePane,
|
|
271
274
|
paneRemedy
|
|
@@ -284,7 +287,7 @@ import "../chunk-DGUM43GV.js";
|
|
|
284
287
|
|
|
285
288
|
// src/lib/manager-worker.ts
|
|
286
289
|
import { createHash as createHash20 } from "crypto";
|
|
287
|
-
import { readFileSync as readFileSync34, writeFileSync as writeFileSync18, mkdirSync as
|
|
290
|
+
import { readFileSync as readFileSync34, writeFileSync as writeFileSync18, mkdirSync as mkdirSync16, existsSync as existsSync19, rmSync as rmSync8, readdirSync as readdirSync13, statSync as statSync14, unlinkSync as unlinkSync6, renameSync as renameSync11, utimesSync as utimesSync4 } from "fs";
|
|
288
291
|
|
|
289
292
|
// src/lib/atomic-file-replace.ts
|
|
290
293
|
import { copyFileSync, renameSync, unlinkSync } from "fs";
|
|
@@ -3334,24 +3337,6 @@ async function maybePollHostUsage(deps) {
|
|
|
3334
3337
|
}
|
|
3335
3338
|
}
|
|
3336
3339
|
|
|
3337
|
-
// src/lib/claude-host-args.ts
|
|
3338
|
-
var HOST_CLAUDE_RETENTION_SETTINGS = JSON.stringify({ cleanupPeriodDays: 3650 });
|
|
3339
|
-
function hostClaudeOneShotArgs(emptyMcpConfigPath) {
|
|
3340
|
-
return [
|
|
3341
|
-
// No project config, no MCP, no tools: these exercise the model or auth only.
|
|
3342
|
-
"--mcp-config",
|
|
3343
|
-
emptyMcpConfigPath,
|
|
3344
|
-
"--strict-mcp-config",
|
|
3345
|
-
"--permission-mode",
|
|
3346
|
-
"auto",
|
|
3347
|
-
"--allowedTools",
|
|
3348
|
-
"",
|
|
3349
|
-
// ENG-11277: never age anything out of the shared ~/.claude from here.
|
|
3350
|
-
"--settings",
|
|
3351
|
-
HOST_CLAUDE_RETENTION_SETTINGS
|
|
3352
|
-
];
|
|
3353
|
-
}
|
|
3354
|
-
|
|
3355
3340
|
// src/lib/claude-account-fingerprint.ts
|
|
3356
3341
|
import { createHash as createHash6 } from "crypto";
|
|
3357
3342
|
import { readFile as readFile3, readdir as readdir3 } from "fs/promises";
|
|
@@ -7889,10 +7874,10 @@ function resolveModelChain(refreshData) {
|
|
|
7889
7874
|
}
|
|
7890
7875
|
|
|
7891
7876
|
// src/lib/manager/claude-auth.ts
|
|
7892
|
-
import { existsSync as existsSync14, rmSync as rmSync6 } from "fs";
|
|
7877
|
+
import { chmodSync as chmodSync2, existsSync as existsSync14, lstatSync as lstatSync2, mkdirSync as mkdirSync11, rmSync as rmSync6 } from "fs";
|
|
7893
7878
|
import { join as join34 } from "path";
|
|
7894
7879
|
import { homedir as homedir13 } from "os";
|
|
7895
|
-
async function applyClaudeAuthToEnv(childEnv, label) {
|
|
7880
|
+
async function applyClaudeAuthToEnv(childEnv, label, options = {}) {
|
|
7896
7881
|
const apiKey = getApiKey();
|
|
7897
7882
|
if (!apiKey) {
|
|
7898
7883
|
throw new Error("AGT_API_KEY is not set");
|
|
@@ -7903,7 +7888,11 @@ async function applyClaudeAuthToEnv(childEnv, label) {
|
|
|
7903
7888
|
throw new Error("claude_auth_mode=api_key but /host/exchange returned no decrypted key");
|
|
7904
7889
|
}
|
|
7905
7890
|
childEnv.ANTHROPIC_API_KEY = exchange.anthropicApiKey;
|
|
7906
|
-
|
|
7891
|
+
if (options.isolateApiKeyConfigDir) {
|
|
7892
|
+
ensurePrivateConfigDir(options.isolateApiKeyConfigDir);
|
|
7893
|
+
childEnv.CLAUDE_CONFIG_DIR = options.isolateApiKeyConfigDir;
|
|
7894
|
+
}
|
|
7895
|
+
const claudeDir = claudeConfigDirForChild(childEnv);
|
|
7907
7896
|
for (const filename of [".credentials.json", "credentials.json"]) {
|
|
7908
7897
|
const p = join34(claudeDir, filename);
|
|
7909
7898
|
if (existsSync14(p)) {
|
|
@@ -7914,9 +7903,29 @@ async function applyClaudeAuthToEnv(childEnv, label) {
|
|
|
7914
7903
|
}
|
|
7915
7904
|
}
|
|
7916
7905
|
}
|
|
7917
|
-
|
|
7918
|
-
delete childEnv.ANTHROPIC_API_KEY;
|
|
7906
|
+
return { isolated: !!options.isolateApiKeyConfigDir };
|
|
7919
7907
|
}
|
|
7908
|
+
delete childEnv.ANTHROPIC_API_KEY;
|
|
7909
|
+
return { isolated: false };
|
|
7910
|
+
}
|
|
7911
|
+
function claudeConfigDirForChild(childEnv) {
|
|
7912
|
+
return childEnv.CLAUDE_CONFIG_DIR?.trim() || join34(homedir13(), ".claude");
|
|
7913
|
+
}
|
|
7914
|
+
function ensurePrivateConfigDir(dir, platform4 = process.platform, chmod = chmodSync2) {
|
|
7915
|
+
mkdirSync11(dir, { recursive: true, mode: 448 });
|
|
7916
|
+
const st = lstatSync2(dir);
|
|
7917
|
+
if (!st.isDirectory()) {
|
|
7918
|
+
throw new Error(`isolated Claude config dir ${dir} is not a real directory (symlink or file); refusing`);
|
|
7919
|
+
}
|
|
7920
|
+
if (platform4 === "win32") return;
|
|
7921
|
+
if ((st.mode & 511) !== 448) chmod(dir, 448);
|
|
7922
|
+
const mode = lstatSync2(dir).mode & 511;
|
|
7923
|
+
if (mode !== 448) {
|
|
7924
|
+
throw new Error(`isolated Claude config dir ${dir} could not be made private (mode ${mode.toString(8)}); refusing`);
|
|
7925
|
+
}
|
|
7926
|
+
}
|
|
7927
|
+
function oneShotIsolatedConfigDir() {
|
|
7928
|
+
return join34(homedir13(), ".augmented", "claude-oneshot");
|
|
7920
7929
|
}
|
|
7921
7930
|
|
|
7922
7931
|
// src/lib/claude-runtime-auth-probe.ts
|
|
@@ -8891,7 +8900,7 @@ function closeSessionRunForCode(codeName, outcome, reason) {
|
|
|
8891
8900
|
|
|
8892
8901
|
// src/lib/manager/scheduler/kanban-route.ts
|
|
8893
8902
|
import { createHash as createHash15 } from "crypto";
|
|
8894
|
-
import { writeFileSync as writeFileSync14, renameSync as renameSync8, mkdirSync as
|
|
8903
|
+
import { writeFileSync as writeFileSync14, renameSync as renameSync8, mkdirSync as mkdirSync12, readFileSync as readFileSync28, unlinkSync as unlinkSync3 } from "fs";
|
|
8895
8904
|
import { homedir as homedir14 } from "os";
|
|
8896
8905
|
import { join as join36, dirname as dirname9 } from "path";
|
|
8897
8906
|
|
|
@@ -9329,7 +9338,7 @@ async function routeScheduledTaskViaKanban(codeName, agentId, task, prompt, dura
|
|
|
9329
9338
|
}
|
|
9330
9339
|
try {
|
|
9331
9340
|
const doorbell = directChatDoorbellPath(agentId, homedir14());
|
|
9332
|
-
|
|
9341
|
+
mkdirSync12(dirname9(doorbell), { recursive: true });
|
|
9333
9342
|
writeFileSync14(doorbell, String(Date.now()));
|
|
9334
9343
|
} catch (err) {
|
|
9335
9344
|
log(`[scheduled-kanban] doorbell ring failed for '${codeName}': ${err.message} (notice still queued)`);
|
|
@@ -11515,7 +11524,7 @@ async function fireOpencodeScheduledTask(agent, task) {
|
|
|
11515
11524
|
|
|
11516
11525
|
// src/lib/opencode-telegram-ingest.ts
|
|
11517
11526
|
import { createHash as createHash19 } from "crypto";
|
|
11518
|
-
import { existsSync as existsSync17, mkdirSync as
|
|
11527
|
+
import { existsSync as existsSync17, mkdirSync as mkdirSync13, readFileSync as readFileSync31, renameSync as renameSync9, unlinkSync as unlinkSync4, writeFileSync as writeFileSync15 } from "fs";
|
|
11519
11528
|
import { randomUUID } from "crypto";
|
|
11520
11529
|
import { join as join40 } from "path";
|
|
11521
11530
|
|
|
@@ -12197,7 +12206,7 @@ function createFileOffsetStore(codeName, log2, currentBotId) {
|
|
|
12197
12206
|
if (!filePath || !dir) return;
|
|
12198
12207
|
const tmpPath = `${filePath}.${process.pid}.${randomUUID()}.tmp`;
|
|
12199
12208
|
try {
|
|
12200
|
-
|
|
12209
|
+
mkdirSync13(dir, { recursive: true, mode: 448 });
|
|
12201
12210
|
writeFileSync15(
|
|
12202
12211
|
tmpPath,
|
|
12203
12212
|
JSON.stringify({
|
|
@@ -12454,7 +12463,7 @@ function partitionActionableByPoison(actionable, states, config2) {
|
|
|
12454
12463
|
}
|
|
12455
12464
|
|
|
12456
12465
|
// src/lib/restart-flags.ts
|
|
12457
|
-
import { existsSync as existsSync18, mkdirSync as
|
|
12466
|
+
import { existsSync as existsSync18, mkdirSync as mkdirSync14, readdirSync as readdirSync11, readFileSync as readFileSync32, renameSync as renameSync10, rmSync as rmSync7, writeFileSync as writeFileSync16 } from "fs";
|
|
12458
12467
|
import { homedir as homedir16 } from "os";
|
|
12459
12468
|
import { join as join41 } from "path";
|
|
12460
12469
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
@@ -12589,7 +12598,7 @@ async function sendError(flag, opts, text) {
|
|
|
12589
12598
|
}
|
|
12590
12599
|
|
|
12591
12600
|
// src/lib/restart-context.ts
|
|
12592
|
-
import { readdirSync as readdirSync12, readFileSync as readFileSync33, writeFileSync as writeFileSync17, mkdirSync as
|
|
12601
|
+
import { readdirSync as readdirSync12, readFileSync as readFileSync33, writeFileSync as writeFileSync17, mkdirSync as mkdirSync15, unlinkSync as unlinkSync5 } from "fs";
|
|
12593
12602
|
import { dirname as dirname10, join as join42 } from "path";
|
|
12594
12603
|
var SLACK_PENDING_INBOUND_DIRNAME = "slack-pending-inbound";
|
|
12595
12604
|
var SLACK_RESTART_CONTEXT_DIRNAME = "slack-restart-context";
|
|
@@ -12656,7 +12665,7 @@ function readStrandedMarker(path) {
|
|
|
12656
12665
|
return null;
|
|
12657
12666
|
}
|
|
12658
12667
|
function writeHintFile(path, dir, hint) {
|
|
12659
|
-
|
|
12668
|
+
mkdirSync15(dir, { recursive: true, mode: 448 });
|
|
12660
12669
|
writeFileSync17(path, JSON.stringify(hint), { mode: 384 });
|
|
12661
12670
|
}
|
|
12662
12671
|
function pruneHintsExcept(codeName, freshFilenames) {
|
|
@@ -14183,7 +14192,7 @@ var pendingDayRolloverReset = /* @__PURE__ */ new Set();
|
|
|
14183
14192
|
var dayRolloverInboundHold = /* @__PURE__ */ new Map();
|
|
14184
14193
|
var INBOUND_HOLD_EPISODE_GAP_MS = 12e4;
|
|
14185
14194
|
async function channelInboundActivityAgeSecondsFor(codeName) {
|
|
14186
|
-
const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-
|
|
14195
|
+
const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-KCICZE6E.js");
|
|
14187
14196
|
const newest = newestPendingInboundActivityMtimeMs(dirname11(paneLogPath(codeName)));
|
|
14188
14197
|
if (newest === null) return null;
|
|
14189
14198
|
return Math.max(0, Math.floor((Date.now() - newest) / 1e3));
|
|
@@ -14941,7 +14950,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
|
|
|
14941
14950
|
var lastVersionCheckAt = 0;
|
|
14942
14951
|
var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
|
|
14943
14952
|
var lastResponsivenessProbeAt = 0;
|
|
14944
|
-
var agtCliVersion = true ? "0.28.
|
|
14953
|
+
var agtCliVersion = true ? "0.28.1125" : "dev";
|
|
14945
14954
|
function resolveBrewPath(execFileSync3) {
|
|
14946
14955
|
try {
|
|
14947
14956
|
const out = execFileSync3("which", ["brew"], { timeout: 5e3 }).toString().trim();
|
|
@@ -15309,7 +15318,7 @@ function ensureClaudeManagedSettings(path = claudeManagedSettingsPath()) {
|
|
|
15309
15318
|
for (const [k, v] of missingEnv) env[k] = v;
|
|
15310
15319
|
settings["env"] = env;
|
|
15311
15320
|
}
|
|
15312
|
-
|
|
15321
|
+
mkdirSync16(dirname11(path), { recursive: true });
|
|
15313
15322
|
writeFileSync18(path, `${JSON.stringify(settings, null, 2)}
|
|
15314
15323
|
`);
|
|
15315
15324
|
const changed = [
|
|
@@ -15975,7 +15984,9 @@ async function runClaudeRuntimeAuthProbe() {
|
|
|
15975
15984
|
async function runHostUsageCommand() {
|
|
15976
15985
|
try {
|
|
15977
15986
|
const childEnv = { ...process.env };
|
|
15978
|
-
await applyClaudeAuthToEnv(childEnv, "host-usage-poll"
|
|
15987
|
+
await applyClaudeAuthToEnv(childEnv, "host-usage-poll", {
|
|
15988
|
+
isolateApiKeyConfigDir: oneShotIsolatedConfigDir()
|
|
15989
|
+
});
|
|
15979
15990
|
const emptyMcp = ensureEvalEmptyMcpConfig();
|
|
15980
15991
|
const args = [
|
|
15981
15992
|
...USAGE_COMMAND_ARGS,
|
|
@@ -16031,7 +16042,7 @@ function ensureEvalEmptyMcpConfig() {
|
|
|
16031
16042
|
if (evalEmptyMcpConfigPath && existsSync19(evalEmptyMcpConfigPath)) return evalEmptyMcpConfigPath;
|
|
16032
16043
|
const dir = join43(homedir17(), ".augmented");
|
|
16033
16044
|
try {
|
|
16034
|
-
|
|
16045
|
+
mkdirSync16(dir, { recursive: true });
|
|
16035
16046
|
} catch {
|
|
16036
16047
|
}
|
|
16037
16048
|
const p = join43(dir, ".eval-empty-mcp.json");
|
|
@@ -16041,7 +16052,9 @@ function ensureEvalEmptyMcpConfig() {
|
|
|
16041
16052
|
}
|
|
16042
16053
|
async function runEvalClaude(prompt, model) {
|
|
16043
16054
|
const childEnv = { ...process.env };
|
|
16044
|
-
await applyClaudeAuthToEnv(childEnv, "conversation-eval"
|
|
16055
|
+
await applyClaudeAuthToEnv(childEnv, "conversation-eval", {
|
|
16056
|
+
isolateApiKeyConfigDir: oneShotIsolatedConfigDir()
|
|
16057
|
+
});
|
|
16045
16058
|
const emptyMcp = ensureEvalEmptyMcpConfig();
|
|
16046
16059
|
const args = [
|
|
16047
16060
|
"-p",
|
|
@@ -16567,7 +16580,7 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
|
|
|
16567
16580
|
if (codeNames.length === 0) return;
|
|
16568
16581
|
void (async () => {
|
|
16569
16582
|
try {
|
|
16570
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
16583
|
+
const { collectDiagnostics } = await import("../persistent-session-E5IR3RBF.js");
|
|
16571
16584
|
await api.post("/host/heartbeat", {
|
|
16572
16585
|
host_id: hostId,
|
|
16573
16586
|
agent_diagnostics: collectDiagnostics(codeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor)
|
|
@@ -16709,7 +16722,7 @@ async function pollCycleInner() {
|
|
|
16709
16722
|
}
|
|
16710
16723
|
try {
|
|
16711
16724
|
const { detectHostSecurity } = await import("../host-security-KQYYZZVW.js");
|
|
16712
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
16725
|
+
const { collectDiagnostics } = await import("../persistent-session-E5IR3RBF.js");
|
|
16713
16726
|
const diagCodeNames = [...agentState.persistentSessionAgents];
|
|
16714
16727
|
const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor) : void 0;
|
|
16715
16728
|
let tailscaleHostname;
|
|
@@ -16917,7 +16930,7 @@ async function pollCycleInner() {
|
|
|
16917
16930
|
collectPanelessActivityProbes,
|
|
16918
16931
|
getResponsivenessIntervalMs,
|
|
16919
16932
|
occupancyQualificationClassifications
|
|
16920
|
-
} = await import("../responsiveness-probe-
|
|
16933
|
+
} = await import("../responsiveness-probe-KCICZE6E.js");
|
|
16921
16934
|
const probeIntervalMs = getResponsivenessIntervalMs();
|
|
16922
16935
|
if (now - lastResponsivenessProbeAt > probeIntervalMs) {
|
|
16923
16936
|
const probeCodeNames = [...agentState.persistentSessionAgents];
|
|
@@ -17034,7 +17047,7 @@ async function pollCycleInner() {
|
|
|
17034
17047
|
collectResponsivenessProbes,
|
|
17035
17048
|
livePendingInboundOldestAgeSeconds,
|
|
17036
17049
|
parkPendingInbound
|
|
17037
|
-
} = await import("../responsiveness-probe-
|
|
17050
|
+
} = await import("../responsiveness-probe-KCICZE6E.js");
|
|
17038
17051
|
const { getProjectDir: wedgeProjectDir } = await import("../scheduler-engine-M6AFZWNU.js");
|
|
17039
17052
|
const wedgeNow = /* @__PURE__ */ new Date();
|
|
17040
17053
|
const liveAgents = agentState.persistentSessionAgents;
|
|
@@ -17320,7 +17333,7 @@ async function pollCycleInner() {
|
|
|
17320
17333
|
}
|
|
17321
17334
|
}
|
|
17322
17335
|
);
|
|
17323
|
-
const { parkPendingInbound } = await import("../responsiveness-probe-
|
|
17336
|
+
const { parkPendingInbound } = await import("../responsiveness-probe-KCICZE6E.js");
|
|
17324
17337
|
const { parked, deadLettered } = parkPendingInbound(codeName, new Date(fatalNowMs));
|
|
17325
17338
|
paneFatalStreak.delete(codeName);
|
|
17326
17339
|
paneFatalRestarts.set(codeName, [...history, fatalNowMs]);
|
|
@@ -17351,7 +17364,7 @@ async function pollCycleInner() {
|
|
|
17351
17364
|
TRANSCRIPT_MOUNT_ESCALATION_REFRESH_MS,
|
|
17352
17365
|
bindSourceEscalations
|
|
17353
17366
|
} = await import("../transcript-mount-health-OHE6IVJV.js");
|
|
17354
|
-
const { transcriptBindSourcesFor, ensureTranscriptBindSources } = await import("../persistent-session-
|
|
17367
|
+
const { transcriptBindSourcesFor, ensureTranscriptBindSources } = await import("../persistent-session-E5IR3RBF.js");
|
|
17355
17368
|
const mountConfig = resolveTranscriptMountConfig();
|
|
17356
17369
|
const liveAgents = agentState.persistentSessionAgents;
|
|
17357
17370
|
for (const tracked of [
|
|
@@ -17516,7 +17529,7 @@ async function pollCycleInner() {
|
|
|
17516
17529
|
}
|
|
17517
17530
|
try {
|
|
17518
17531
|
const { scrapeMcpFailedBannerCount } = await import("../pane-mcp-banner-scraper-VR5QGP3J.js");
|
|
17519
|
-
const { probeSessionAuth } = await import("../session-auth-dead-
|
|
17532
|
+
const { probeSessionAuth } = await import("../session-auth-dead-VYP4VCMX.js");
|
|
17520
17533
|
const observations = [];
|
|
17521
17534
|
const pendingCacheCommits = [];
|
|
17522
17535
|
const modelApiErrorReportingOn = hostFlagStore().getBoolean("model-api-error-reporting");
|
|
@@ -18715,7 +18728,7 @@ async function processAgent(agent, agentStates, managedToolkits) {
|
|
|
18715
18728
|
try {
|
|
18716
18729
|
const artifacts = generateArtifacts(agent, refreshData, frameworkAdapter, renderIntegrationsSection);
|
|
18717
18730
|
const changedFiles = [];
|
|
18718
|
-
|
|
18731
|
+
mkdirSync16(agentDir, { recursive: true });
|
|
18719
18732
|
for (const artifact of artifacts) {
|
|
18720
18733
|
const filePath = join43(agentDir, artifact.relativePath);
|
|
18721
18734
|
let existingHash;
|
|
@@ -18793,7 +18806,7 @@ async function processAgent(agent, agentStates, managedToolkits) {
|
|
|
18793
18806
|
log(`${verb} '${agent.code_name}': ${fileNames}`);
|
|
18794
18807
|
for (const file of changedFiles) {
|
|
18795
18808
|
const filePath = join43(agentDir, file.relativePath);
|
|
18796
|
-
|
|
18809
|
+
mkdirSync16(dirname11(filePath), { recursive: true });
|
|
18797
18810
|
if (file.relativePath === ".mcp.json") {
|
|
18798
18811
|
safeWriteJsonAtomic(filePath, file.content, { mode: 384 });
|
|
18799
18812
|
} else {
|
|
@@ -19223,7 +19236,7 @@ async function processAgent(agent, agentStates, managedToolkits) {
|
|
|
19223
19236
|
const writeDmNoticeMarkers = isChannelAddRestart ? () => {
|
|
19224
19237
|
try {
|
|
19225
19238
|
const agentAugmentedDir = join43(homedir17(), ".augmented", agent.code_name);
|
|
19226
|
-
|
|
19239
|
+
mkdirSync16(agentAugmentedDir, { recursive: true });
|
|
19227
19240
|
const markerJson = JSON.stringify({
|
|
19228
19241
|
version: 1,
|
|
19229
19242
|
at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -19530,8 +19543,8 @@ async function processAgent(agent, agentStates, managedToolkits) {
|
|
|
19530
19543
|
try {
|
|
19531
19544
|
const agentProvisionDir = agentDir;
|
|
19532
19545
|
const projectDir = join43(homedir17(), ".augmented", agent.code_name, "project");
|
|
19533
|
-
|
|
19534
|
-
|
|
19546
|
+
mkdirSync16(agentProvisionDir, { recursive: true });
|
|
19547
|
+
mkdirSync16(projectDir, { recursive: true });
|
|
19535
19548
|
const provisionMcpPath = join43(agentProvisionDir, ".mcp.json");
|
|
19536
19549
|
const projectMcpPath = join43(projectDir, ".mcp.json");
|
|
19537
19550
|
let mcpConfig = { mcpServers: {} };
|
|
@@ -22103,7 +22116,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
|
|
|
22103
22116
|
try {
|
|
22104
22117
|
const freshId = rotateSessionForWedge(codeName);
|
|
22105
22118
|
consecutiveWedgeCycles.delete(codeName);
|
|
22106
|
-
const { parkPendingInbound: parkForRestart } = await import("../responsiveness-probe-
|
|
22119
|
+
const { parkPendingInbound: parkForRestart } = await import("../responsiveness-probe-KCICZE6E.js");
|
|
22107
22120
|
const { parked, deadLettered } = parkForRestart(codeName, /* @__PURE__ */ new Date());
|
|
22108
22121
|
const parkNote = parked > 0 ? `, ${parked} inbound parked` : "";
|
|
22109
22122
|
const deadNote = deadLettered > 0 ? `, ${deadLettered} undeliverable dead-lettered` : "";
|
|
@@ -22146,7 +22159,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
|
|
|
22146
22159
|
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}`));
|
|
22147
22160
|
void (async () => {
|
|
22148
22161
|
try {
|
|
22149
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
22162
|
+
const { collectDiagnostics } = await import("../persistent-session-E5IR3RBF.js");
|
|
22150
22163
|
await api.post("/host/heartbeat", {
|
|
22151
22164
|
host_id: hostId,
|
|
22152
22165
|
agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor)
|
|
@@ -22197,7 +22210,7 @@ async function respawnAgentAfterMcpStop(codeName, reason) {
|
|
|
22197
22210
|
}
|
|
22198
22211
|
try {
|
|
22199
22212
|
const hostId = await getHostId();
|
|
22200
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
22213
|
+
const { collectDiagnostics } = await import("../persistent-session-E5IR3RBF.js");
|
|
22201
22214
|
await api.post("/host/heartbeat", {
|
|
22202
22215
|
host_id: hostId,
|
|
22203
22216
|
agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor)
|
|
@@ -22624,7 +22637,7 @@ async function processDirectChatMessage(agent, msg) {
|
|
|
22624
22637
|
if (useDoorbell) {
|
|
22625
22638
|
try {
|
|
22626
22639
|
const doorbell = directChatDoorbellPath(agent.agentId, homedir17());
|
|
22627
|
-
|
|
22640
|
+
mkdirSync16(dirname11(doorbell), { recursive: true });
|
|
22628
22641
|
writeFileSync18(doorbell, String(Date.now()));
|
|
22629
22642
|
log(`[direct-chat] Doorbell rung for '${agent.codeName}' (msg=${msg.id}) \u2014 in-session MCP will pull via the cursor`);
|
|
22630
22643
|
return;
|
|
@@ -22753,7 +22766,7 @@ ${formatRunMarker(run_id)}` : KANBAN_CHECK_COMMAND;
|
|
|
22753
22766
|
if (run_id) openInjectedRunByCode.set(codeName, run_id);
|
|
22754
22767
|
try {
|
|
22755
22768
|
const doorbell = directChatDoorbellPath(agentId, homedir17());
|
|
22756
|
-
|
|
22769
|
+
mkdirSync16(dirname11(doorbell), { recursive: true });
|
|
22757
22770
|
writeFileSync18(doorbell, String(Date.now()));
|
|
22758
22771
|
} catch (err) {
|
|
22759
22772
|
log(`[kanban] doorbell ring failed for '${codeName}': ${err.message} (notice still queued)`);
|
|
@@ -22870,7 +22883,7 @@ async function processClaudePairSessions(agents) {
|
|
|
22870
22883
|
// cannot take it for itself — by the time it runs, the write it is looking
|
|
22871
22884
|
// for may already have happened.
|
|
22872
22885
|
snapshotPairConfig
|
|
22873
|
-
} = await import("../claude-pair-runtime-
|
|
22886
|
+
} = await import("../claude-pair-runtime-5OBFRZWS.js");
|
|
22874
22887
|
for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
|
|
22875
22888
|
log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
|
|
22876
22889
|
const killed = await killPairSession(pairTmuxSession(pairId));
|
|
@@ -23173,7 +23186,7 @@ function saveMemoryManifest(agentId, configDir, codeName) {
|
|
|
23173
23186
|
if (!manifest) return;
|
|
23174
23187
|
try {
|
|
23175
23188
|
const path = memoryManifestPath(configDir, codeName);
|
|
23176
|
-
|
|
23189
|
+
mkdirSync16(memoryRetirementDir(configDir, codeName), { recursive: true });
|
|
23177
23190
|
const tmp = `${path}.tmp`;
|
|
23178
23191
|
writeFileSync18(tmp, JSON.stringify(manifest, null, 2));
|
|
23179
23192
|
renameSync11(tmp, path);
|
|
@@ -23278,7 +23291,7 @@ function applyMemoryTombstones(opts) {
|
|
|
23278
23291
|
continue;
|
|
23279
23292
|
}
|
|
23280
23293
|
const destDir = retiredMemoryDir(configDir, agent.code_name);
|
|
23281
|
-
|
|
23294
|
+
mkdirSync16(destDir, { recursive: true });
|
|
23282
23295
|
const stamp = Date.now();
|
|
23283
23296
|
let dest = join43(destDir, `${entry.file}.${stamp}.retired`);
|
|
23284
23297
|
for (let n = 1; existsSync19(dest); n++) {
|
|
@@ -23503,7 +23516,7 @@ async function downloadMemories(agent, memoryDir, log2, { force, configDir }) {
|
|
|
23503
23516
|
lastDownloadHash.set(agent.agent_id, responseHash);
|
|
23504
23517
|
lastLocalFileHash.set(agent.agent_id, localListHash);
|
|
23505
23518
|
if (memories?.length) {
|
|
23506
|
-
|
|
23519
|
+
mkdirSync16(memoryDir, { recursive: true });
|
|
23507
23520
|
const manifest = loadMemoryManifest(agent.agent_id, configDir, agent.code_name);
|
|
23508
23521
|
let written = 0;
|
|
23509
23522
|
let overwritten = 0;
|
|
@@ -24079,7 +24092,7 @@ function restartRunningChannelMcps(basenames) {
|
|
|
24079
24092
|
}
|
|
24080
24093
|
function deployMcpAssets() {
|
|
24081
24094
|
const targetDir = join43(homedir17(), ".augmented", "_mcp");
|
|
24082
|
-
|
|
24095
|
+
mkdirSync16(targetDir, { recursive: true });
|
|
24083
24096
|
const moduleDir = dirname11(fileURLToPath2(import.meta.url));
|
|
24084
24097
|
let mcpSourceDir = "";
|
|
24085
24098
|
let dir = moduleDir;
|