@integrity-labs/agt-cli 0.28.948 → 0.28.950
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-YGYDTSMZ.js → chunk-I2YUIY37.js} +4 -4
- package/dist/{chunk-LRVXTEFJ.js → chunk-K3XCSA4U.js} +2 -2
- package/dist/{chunk-YZ5HGHPG.js → chunk-SVGL52XU.js} +86 -7
- package/dist/chunk-SVGL52XU.js.map +1 -0
- package/dist/{claude-code-updater-4E5T2X3Z.js → claude-code-updater-NAHJ6O6C.js} +37 -3
- package/dist/claude-code-updater-NAHJ6O6C.js.map +1 -0
- package/dist/{claude-pair-runtime-HCFLP3RT.js → claude-pair-runtime-X2D4Z6OG.js} +2 -2
- package/dist/lib/manager-worker.js +32 -19
- package/dist/lib/manager-worker.js.map +1 -1
- package/dist/mcp/direct-chat-channel.js +99 -3
- package/dist/mcp/index.js +79 -2
- package/dist/mcp/origami.js +79 -2
- package/dist/mcp/slack-channel.js +79 -2
- package/dist/mcp/telegram-channel.js +79 -2
- package/dist/{persistent-session-WN4GLJUN.js → persistent-session-FMF3LCDW.js} +3 -3
- package/dist/{responsiveness-probe-DJMZ4WAU.js → responsiveness-probe-ZE3MSI2S.js} +3 -3
- package/dist/{session-auth-dead-T5SUK2HT.js → session-auth-dead-7G555HQQ.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-YZ5HGHPG.js.map +0 -1
- package/dist/claude-code-updater-4E5T2X3Z.js.map +0 -1
- /package/dist/{chunk-YGYDTSMZ.js.map → chunk-I2YUIY37.js.map} +0 -0
- /package/dist/{chunk-LRVXTEFJ.js.map → chunk-K3XCSA4U.js.map} +0 -0
- /package/dist/{claude-pair-runtime-HCFLP3RT.js.map → claude-pair-runtime-X2D4Z6OG.js.map} +0 -0
- /package/dist/{persistent-session-WN4GLJUN.js.map → persistent-session-FMF3LCDW.js.map} +0 -0
- /package/dist/{responsiveness-probe-DJMZ4WAU.js.map → responsiveness-probe-ZE3MSI2S.js.map} +0 -0
- /package/dist/{session-auth-dead-T5SUK2HT.js.map → session-auth-dead-7G555HQQ.js.map} +0 -0
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
|
|
6
6
|
// src/lib/claude-code-updater.ts
|
|
7
7
|
import { execFile, execFileSync } from "child_process";
|
|
8
|
-
import { existsSync, readFileSync } from "fs";
|
|
8
|
+
import { existsSync, readFileSync, realpathSync } from "fs";
|
|
9
9
|
import { homedir } from "os";
|
|
10
10
|
import { promisify } from "util";
|
|
11
11
|
var execFileAsync = promisify(execFile);
|
|
@@ -67,6 +67,32 @@ function readsAsNativeInstall(raw) {
|
|
|
67
67
|
return false;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
+
function isNativeInstallPath(realPath) {
|
|
71
|
+
return /\/claude\/versions\/\d+\.\d+\.\d+[^/]*$/.test(realPath);
|
|
72
|
+
}
|
|
73
|
+
async function resolveNativeOwnership(run, realPath, claudeJson) {
|
|
74
|
+
const configSaysNative = readsAsNativeInstall(claudeJson);
|
|
75
|
+
let resolved = null;
|
|
76
|
+
const override = process.env["CLAUDE_PATH"];
|
|
77
|
+
if (override) {
|
|
78
|
+
resolved = override;
|
|
79
|
+
} else {
|
|
80
|
+
try {
|
|
81
|
+
const { stdout } = await run("which", ["claude"]);
|
|
82
|
+
resolved = stdout.trim().split("\n")[0]?.trim() || null;
|
|
83
|
+
} catch {
|
|
84
|
+
resolved = null;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
if (resolved) {
|
|
88
|
+
try {
|
|
89
|
+
const real = realPath(resolved);
|
|
90
|
+
return { native: isNativeInstallPath(real), binary: real, configSaysNative };
|
|
91
|
+
} catch {
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return { native: configSaysNative, binary: null, configSaysNative };
|
|
95
|
+
}
|
|
70
96
|
async function resolveInstallTargetPath(run) {
|
|
71
97
|
try {
|
|
72
98
|
const { stdout } = await run("npm", ["prefix", "-g"]);
|
|
@@ -105,6 +131,7 @@ async function maybeUpdateClaudeCode(deps) {
|
|
|
105
131
|
const ps = deps.psSnapshot ?? defaultPsSnapshot;
|
|
106
132
|
const fileExists = deps.fileExists ?? existsSync;
|
|
107
133
|
const readClaudeJson = deps.readClaudeJson ?? defaultReadClaudeJson;
|
|
134
|
+
const realPath = deps.realPath ?? realpathSync;
|
|
108
135
|
const home = (deps.homeDir ?? homedir)();
|
|
109
136
|
const { log } = deps;
|
|
110
137
|
if (now - lastCheckAt < intervalMs()) {
|
|
@@ -121,7 +148,13 @@ async function maybeUpdateClaudeCode(deps) {
|
|
|
121
148
|
}
|
|
122
149
|
multiInstallWarned = true;
|
|
123
150
|
}
|
|
124
|
-
|
|
151
|
+
const ownership = await resolveNativeOwnership(run, realPath, readClaudeJson(`${home}/.claude.json`));
|
|
152
|
+
if (!ownership.native && ownership.configSaysNative) {
|
|
153
|
+
log(
|
|
154
|
+
`[claude-code-updater] ~/.claude.json says installMethod=native but the binary this host runs (${ownership.binary}) is not a native install \u2014 ignoring it and converging to the pin`
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
if (ownership.native) {
|
|
125
158
|
log("[claude-code-updater] native install detected, deferring to Anthropic autoupdater");
|
|
126
159
|
verifyMismatchState = null;
|
|
127
160
|
return { action: "skipped_native_install", target: spec };
|
|
@@ -200,9 +233,10 @@ export {
|
|
|
200
233
|
_resetClaudeCodeUpdaterState,
|
|
201
234
|
hostHasLiveAgent,
|
|
202
235
|
isConcreteVersion,
|
|
236
|
+
isNativeInstallPath,
|
|
203
237
|
maybeUpdateClaudeCode,
|
|
204
238
|
parseVersion,
|
|
205
239
|
probeClaudeInstalls,
|
|
206
240
|
readsAsNativeInstall
|
|
207
241
|
};
|
|
208
|
-
//# sourceMappingURL=claude-code-updater-
|
|
242
|
+
//# sourceMappingURL=claude-code-updater-NAHJ6O6C.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/claude-code-updater.ts"],"sourcesContent":["// ENG-5672: idle-gated, server-pinned Claude Code auto-updater.\n// ENG-5798: multi-install drift handling — detect coexisting claude binaries,\n// short-circuit on native autoupdater hosts, verify against absolute\n// install path, hard-error after N consecutive verify mismatches.\n//\n// Hosts install @anthropic-ai/claude-code once at bootstrap (host-bootstrap.ts)\n// and never refresh it, so a long-lived host runs a stale Claude Code forever.\n// This module brings a host to its *desired* version, which the server pins via\n// /host/refresh (per-host override, else fleet default, else 'latest').\n//\n// Safety properties (this runs npm install -g on live prod hosts):\n// • Idle-gated — we never install while a `claude --name agt-*` agent process\n// is running on the host (a running process holds the old binary anyway;\n// replacing it under a live session is pointless and risky). Busy → defer\n// to a later cycle.\n// • No-op when already on target — a concrete target equal to the installed\n// version short-circuits; a dist-tag ('latest') is resolved to a concrete\n// version via `npm view` and compared, so we don't reinstall every cycle.\n// • Host-global throttle — at most one check per interval (default 6h), so the\n// manager's ~10-30s poll doesn't shell out to npm/ps constantly.\n// • Log-and-continue — every failure is logged and swallowed; an error here\n// must never break the manager poll cycle.\n// • Multi-install awareness (ENG-5798) — on hosts where Anthropic's native\n// autoupdater owns /usr/bin/claude, this updater short-circuits cleanly\n// instead of fighting it. On hosts where multiple binaries coexist (e.g. a\n// brew cask alongside the npm global), we log every path+version once so\n// drift is visible in manager.log without spamming every cycle.\n//\n// The *installed* version is reported separately as hosts.framework_version\n// (the claude-code framework adapter's getVersion() == `claude --version`), so\n// this module does not report it itself.\n\nimport { execFile, execFileSync } from 'node:child_process';\nimport { existsSync, readFileSync, realpathSync } from 'node:fs';\nimport { homedir } from 'node:os';\nimport { promisify } from 'node:util';\nimport { parsePsRows, CLAUDE_AGENT_PROCESS_PATTERN } from './orphan-channel-mcp-reaper.js';\n\nconst execFileAsync = promisify(execFile);\n\nconst NPM_PKG = '@anthropic-ai/claude-code';\n\n/** Default host-global check interval. Overridable via env for tuning. */\nconst DEFAULT_INTERVAL_MS = 6 * 60 * 60 * 1000; // 6h\n\n/**\n * ENG-5798: After this many consecutive verify mismatches against the same\n * target version, emit a distinct one-shot error code that the\n * synthetic-probe / CloudWatch alarm pipeline can latch onto, instead of\n * silently re-failing forever. Overridable via env for testing.\n */\nconst DEFAULT_VERIFY_MISMATCH_THRESHOLD = 5;\n\nfunction intervalMs(): number {\n const raw = Number.parseInt(process.env['AGT_CLAUDE_UPDATE_INTERVAL_MS'] ?? '', 10);\n return Number.isFinite(raw) && raw > 0 ? raw : DEFAULT_INTERVAL_MS;\n}\n\nfunction verifyMismatchThreshold(): number {\n const raw = Number.parseInt(process.env['AGT_CLAUDE_UPDATE_VERIFY_THRESHOLD'] ?? '', 10);\n return Number.isFinite(raw) && raw > 0 ? raw : DEFAULT_VERIFY_MISMATCH_THRESHOLD;\n}\n\n/** Extract a version string (leading semver) from `claude --version` / npm output. */\nexport function parseVersion(output: string): string | null {\n const m = output.match(/\\d+\\.\\d+\\.\\d+[A-Za-z0-9.+-]*/);\n return m ? m[0] : null;\n}\n\n/** A target spec is \"concrete\" when it already names an exact version. */\nexport function isConcreteVersion(spec: string): boolean {\n return /^\\d+\\.\\d+\\.\\d+[A-Za-z0-9.+-]*$/.test(spec.trim());\n}\n\n/**\n * Well-known absolute paths where a `claude` binary may live on managed hosts.\n * Probed alongside the PATH-resolved binary so we can see all install slots,\n * even ones not on the manager systemd unit's PATH.\n */\nexport const WELL_KNOWN_CLAUDE_PATHS: readonly string[] = [\n '/usr/bin/claude', // Anthropic native autoupdater (Linux deb/rpm)\n '/usr/local/bin/claude', // npm global on macOS Intel + Linux without nvm\n '/opt/homebrew/bin/claude', // Homebrew on macOS Apple Silicon\n '/home/linuxbrew/.linuxbrew/bin/claude', // Linuxbrew (used on agt-aws-* hosts)\n];\n\nexport interface ClaudeCodeUpdaterDeps {\n /** Server-pinned target: a concrete version or an npm dist-tag like 'latest'. */\n desiredVersion: string;\n /** Currently-installed version, if the caller already knows it (e.g. the\n * manager's cachedFrameworkVersion). When omitted we run `claude --version`. */\n currentVersion?: string | null;\n log: (msg: string) => void;\n /** Override \"now\" for tests. */\n now?: () => number;\n /** Run a command; injected in tests. Defaults to execFile. */\n runCommand?: (cmd: string, args: string[]) => Promise<{ stdout: string; stderr: string }>;\n /** Raw `ps -eo pid,ppid,args` snapshot; injected in tests. */\n psSnapshot?: () => string;\n /** Sync existence probe for binary detection; injected in tests. */\n fileExists?: (path: string) => boolean;\n /** Read ~/.claude.json contents (raw); returns null when absent. Injected in tests. */\n readClaudeJson?: (path: string) => string | null;\n /** Resolve the user's home directory; injected in tests. */\n homeDir?: () => string;\n /** Resolve symlinks to a real path (throws when absent); injected in tests. */\n realPath?: (path: string) => string;\n}\n\nexport type UpdaterOutcome =\n | { action: 'throttled' }\n | { action: 'up_to_date'; version: string }\n | { action: 'deferred_busy'; target: string }\n | { action: 'skipped_native_install'; target: string }\n | { action: 'updated'; from: string | null; to: string }\n | { action: 'failed'; reason: string };\n\n// ── Host-global state (module-level; one updater per host process) ──────────\nlet lastCheckAt = 0;\n/** Per-process one-shot guard for the multi-install warn line. */\nlet multiInstallWarned = false;\n/**\n * Sticky counter for consecutive `post-install verify mismatch` against the\n * same target version. Reset on success, on target change, or after the\n * threshold error has been emitted (so we emit it exactly once per stuck run).\n */\nlet verifyMismatchState: { target: string; count: number; alarmed: boolean } | null = null;\n\n/** Test helper — reset module state. Not for production use. */\nexport function _resetClaudeCodeUpdaterState(): void {\n lastCheckAt = 0;\n multiInstallWarned = false;\n verifyMismatchState = null;\n}\n\nfunction defaultPsSnapshot(): string {\n return execFileSync('ps', ['-eo', 'pid,ppid,args'], { encoding: 'utf-8', maxBuffer: 16 * 1024 * 1024 });\n}\n\nfunction defaultReadClaudeJson(path: string): string | null {\n try {\n return readFileSync(path, 'utf-8');\n } catch {\n return null;\n }\n}\n\n/** True when at least one `claude --name agt-*` agent process is live. */\nexport function hostHasLiveAgent(psOutput: string): boolean {\n return parsePsRows(psOutput).some((r) => CLAUDE_AGENT_PROCESS_PATTERN.test(r.args));\n}\n\n/**\n * ENG-5798: returns true when ~/.claude.json reports `installMethod: \"native\"`,\n * meaning Anthropic's native autoupdater owns the on-disk binary. In that case\n * the brew/npm update path is actively harmful — it installs a second binary\n * the host's PATH never resolves to, and verify reads from yet a third.\n */\nexport function readsAsNativeInstall(raw: string | null): boolean {\n if (!raw) return false;\n try {\n const parsed = JSON.parse(raw) as { installMethod?: unknown };\n return parsed.installMethod === 'native';\n } catch {\n return false;\n }\n}\n\n/**\n * ENG-10620: true when `realPath` is a binary owned by Claude Code's native\n * installer, which keeps every version under `…/claude/versions/<semver>`\n * (e.g. `~/.local/share/claude/versions/2.1.274`, symlinked from\n * `~/.local/bin/claude`). An npm global resolves into\n * `…/node_modules/@anthropic-ai/claude-code/` instead.\n */\nexport function isNativeInstallPath(realPath: string): boolean {\n return /\\/claude\\/versions\\/\\d+\\.\\d+\\.\\d+[^/]*$/.test(realPath);\n}\n\n/**\n * ENG-10620: decide native ownership from the binary this host ACTUALLY runs,\n * not from `~/.claude.json`.\n *\n * `installMethod` is written by whichever `claude` last started, not by the\n * one the manager launches. On agt-aws-1 an operator shell's PATH resolved a\n * native `~/.local/bin/claude` while agents ran the npm global at\n * `/usr/bin/claude`; that one manual run flipped `installMethod` to `native`\n * and this updater stopped converging the host to its pin for good, while the\n * binary it would have updated was never native at all.\n *\n * Resolution mirrors how agent sessions pick their binary (resolveClaudeBinary:\n * CLAUDE_PATH, then PATH). The config key remains only as a fallback for a\n * host where no binary can be resolved.\n */\nasync function resolveNativeOwnership(\n run: (cmd: string, args: string[]) => Promise<{ stdout: string; stderr: string }>,\n realPath: (path: string) => string,\n claudeJson: string | null,\n): Promise<{ native: boolean; binary: string | null; configSaysNative: boolean }> {\n const configSaysNative = readsAsNativeInstall(claudeJson);\n let resolved: string | null = null;\n const override = process.env['CLAUDE_PATH'];\n if (override) {\n resolved = override;\n } else {\n try {\n const { stdout } = await run('which', ['claude']);\n resolved = stdout.trim().split('\\n')[0]?.trim() || null;\n } catch {\n resolved = null;\n }\n }\n if (resolved) {\n try {\n const real = realPath(resolved);\n return { native: isNativeInstallPath(real), binary: real, configSaysNative };\n } catch {\n /* unresolvable — fall back to the config key */\n }\n }\n return { native: configSaysNative, binary: null, configSaysNative };\n}\n\n/**\n * Resolve the absolute filesystem path that `npm install -g <pkg>` will write\n * the `claude` binary to. Returns null when `npm prefix -g` fails or is empty,\n * in which case the caller should fall back to PATH-based verify.\n *\n * We deliberately use `npm prefix -g` rather than `which claude` because the\n * latter resolves through PATH, which on agt-aws-* hosts can land on\n * /usr/bin/claude (the native autoupdater slot) — exactly the misalignment\n * ENG-5798 is fixing.\n */\nasync function resolveInstallTargetPath(\n run: (cmd: string, args: string[]) => Promise<{ stdout: string; stderr: string }>,\n): Promise<string | null> {\n try {\n const { stdout } = await run('npm', ['prefix', '-g']);\n const prefix = stdout.trim();\n if (!prefix) return null;\n return `${prefix}/bin/claude`;\n } catch {\n return null;\n }\n}\n\n/**\n * Enumerate every `claude` binary visible to the host: PATH-resolved + the\n * well-known absolute slots + `~/.claude/local/claude`. Returns one entry per\n * unique resolved path with the version each reports (or null if it failed to\n * execute). Used purely for the one-shot drift warn line.\n */\nexport async function probeClaudeInstalls(\n run: (cmd: string, args: string[]) => Promise<{ stdout: string; stderr: string }>,\n fileExists: (path: string) => boolean,\n home: string,\n): Promise<Array<{ path: string; version: string | null }>> {\n const candidates = new Set<string>(WELL_KNOWN_CLAUDE_PATHS);\n candidates.add(`${home}/.claude/local/claude`);\n // PATH-resolved. `which` is portable enough across the Linux + macOS hosts\n // we target; errors here just mean \"no claude on PATH\", which is fine.\n try {\n const { stdout } = await run('which', ['claude']);\n const p = stdout.trim().split('\\n')[0]?.trim();\n if (p) candidates.add(p);\n } catch {\n /* no-op */\n }\n\n const results: Array<{ path: string; version: string | null }> = [];\n for (const p of candidates) {\n if (!fileExists(p)) continue;\n let version: string | null = null;\n try {\n const { stdout } = await run(p, ['--version']);\n version = parseVersion(stdout);\n } catch {\n /* binary exists but failed to execute — record path with null version */\n }\n results.push({ path: p, version });\n }\n return results;\n}\n\n/**\n * Bring Claude Code to the desired version if the host is idle and not already\n * on target. Safe to call every manager poll — internally throttled. Returns an\n * outcome describing what happened (for logging/observability/tests).\n */\nexport async function maybeUpdateClaudeCode(deps: ClaudeCodeUpdaterDeps): Promise<UpdaterOutcome> {\n const now = deps.now ? deps.now() : Date.now();\n const run = deps.runCommand ?? ((cmd, args) => execFileAsync(cmd, args, { maxBuffer: 16 * 1024 * 1024 }));\n const ps = deps.psSnapshot ?? defaultPsSnapshot;\n const fileExists = deps.fileExists ?? existsSync;\n const readClaudeJson = deps.readClaudeJson ?? defaultReadClaudeJson;\n const realPath = deps.realPath ?? realpathSync;\n const home = (deps.homeDir ?? homedir)();\n const { log } = deps;\n\n // 1. Host-global throttle.\n if (now - lastCheckAt < intervalMs()) {\n return { action: 'throttled' };\n }\n lastCheckAt = now;\n\n try {\n const spec = (deps.desiredVersion || 'latest').trim();\n\n // 2. ENG-5798 multi-install drift detection. Emit one warn line per\n // process listing every claude binary + version we can see. This is\n // independent of the install decision below — even on hosts where we\n // proceed normally, surfacing drift is the difference between a 3-day\n // silent loop and a one-line lead.\n if (!multiInstallWarned) {\n const installs = await probeClaudeInstalls(run, fileExists, home);\n if (installs.length > 1) {\n const summary = installs\n .map((i) => `${i.path}=${i.version ?? 'unknown'}`)\n .join(', ');\n log(`[claude-code-updater] multiple claude installs detected: ${summary}`);\n }\n multiInstallWarned = true;\n }\n\n // 3. ENG-5798 native-install short-circuit. When Anthropic's native\n // autoupdater owns the host binary, the brew/npm update path is\n // actively harmful (it installs a second binary the manager's PATH\n // never resolves to, then verifies against yet a third). Defer.\n const ownership = await resolveNativeOwnership(run, realPath, readClaudeJson(`${home}/.claude.json`));\n if (!ownership.native && ownership.configSaysNative) {\n log(\n `[claude-code-updater] ~/.claude.json says installMethod=native but the binary this host runs (${ownership.binary}) is not a native install — ignoring it and converging to the pin`,\n );\n }\n if (ownership.native) {\n // One-shot info line per process — same throttle as the warn above, but\n // we re-use the throttle window to keep this from logging every poll.\n log('[claude-code-updater] native install detected, deferring to Anthropic autoupdater');\n // Reset any sticky verify-mismatch state — it can't apply once we stop\n // attempting installs.\n verifyMismatchState = null;\n return { action: 'skipped_native_install', target: spec };\n }\n\n // 4. Resolve the target to a concrete version (read-only). A concrete spec\n // is its own target; a dist-tag is resolved via `npm view`.\n let target: string;\n if (isConcreteVersion(spec)) {\n target = spec;\n } else {\n const { stdout } = await run('npm', ['view', `${NPM_PKG}@${spec}`, 'version']);\n const resolved = parseVersion(stdout);\n if (!resolved) {\n log(`[claude-code-updater] could not resolve ${NPM_PKG}@${spec} to a version; skipping`);\n return { action: 'failed', reason: 'unresolved_target' };\n }\n target = resolved;\n }\n\n // 5. Determine the installed version (prefer the caller's cached value).\n let current = deps.currentVersion ?? null;\n if (!current) {\n try {\n const { stdout } = await run('claude', ['--version']);\n current = parseVersion(stdout);\n } catch {\n current = null; // claude missing/broken — treat as \"needs install\".\n }\n }\n\n // 6. Already on target → nothing to do.\n if (current && current === target) {\n // Successful no-op — clear sticky verify mismatch state for this target.\n if (verifyMismatchState && verifyMismatchState.target === target) {\n verifyMismatchState = null;\n }\n return { action: 'up_to_date', version: target };\n }\n\n // 7. Idle gate — never replace the binary under a live agent session.\n if (hostHasLiveAgent(ps())) {\n log(`[claude-code-updater] host busy (live agent) — deferring update to ${target} to a later cycle`);\n return { action: 'deferred_busy', target };\n }\n\n // 8. Install the target, then verify against the *absolute* path of the\n // binary npm just wrote — not via PATH. PATH resolution is the original\n // ENG-5798 bug: on hosts with multiple claude installs, PATH lands on a\n // different binary than the one npm overwrites, so verify never agrees.\n const installTargetPath = await resolveInstallTargetPath(run);\n log(`[claude-code-updater] updating Claude Code ${current ?? '(none)'} → ${target}`);\n await run('npm', ['install', '-g', `${NPM_PKG}@${target}`]);\n\n // Prefer the absolute install target; fall back to PATH only when\n // `npm prefix -g` failed (in which case verify is best-effort).\n const verifyTarget = installTargetPath ?? 'claude';\n let installed: string | null = null;\n try {\n const { stdout } = await run(verifyTarget, ['--version']);\n installed = parseVersion(stdout);\n } catch {\n installed = null;\n }\n\n if (installed !== target) {\n log(\n `[claude-code-updater] post-install verify mismatch: expected ${target}, got ${installed ?? 'unknown'} from ${verifyTarget}`,\n );\n\n // ENG-5798: hard-error after N consecutive mismatches against the same\n // target. Reset the counter when the target changes — a new pin is a\n // new event, not a continuation of the old stuck run.\n if (!verifyMismatchState || verifyMismatchState.target !== target) {\n verifyMismatchState = { target, count: 1, alarmed: false };\n } else {\n verifyMismatchState.count += 1;\n }\n\n const threshold = verifyMismatchThreshold();\n if (verifyMismatchState.count >= threshold && !verifyMismatchState.alarmed) {\n verifyMismatchState.alarmed = true;\n log(\n `[claude-code-updater] ERROR verify_mismatch_stuck: ${verifyMismatchState.count} consecutive verify failures for target ${target} (verify path: ${verifyTarget}) — install is not taking effect, investigate host install slots`,\n );\n return { action: 'failed', reason: 'verify_mismatch_threshold' };\n }\n return { action: 'failed', reason: 'verify_mismatch' };\n }\n\n // Successful install — clear sticky state.\n verifyMismatchState = null;\n log(`[claude-code-updater] updated Claude Code ${current ?? '(none)'} → ${installed}`);\n return { action: 'updated', from: current, to: installed };\n } catch (err) {\n // Log-and-continue: an updater failure must never break the manager tick.\n log(`[claude-code-updater] update attempt failed: ${err instanceof Error ? err.message : String(err)}`);\n return { action: 'failed', reason: 'exception' };\n }\n}\n"],"mappings":";;;;;;AAgCA,SAAS,UAAU,oBAAoB;AACvC,SAAS,YAAY,cAAc,oBAAoB;AACvD,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAG1B,IAAM,gBAAgB,UAAU,QAAQ;AAExC,IAAM,UAAU;AAGhB,IAAM,sBAAsB,IAAI,KAAK,KAAK;AAQ1C,IAAM,oCAAoC;AAE1C,SAAS,aAAqB;AAC5B,QAAM,MAAM,OAAO,SAAS,QAAQ,IAAI,+BAA+B,KAAK,IAAI,EAAE;AAClF,SAAO,OAAO,SAAS,GAAG,KAAK,MAAM,IAAI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AI,cAAc,CAAC,WAAW,CAAC;AACxD,kBAAY,aAAa,MAAM;AAAA,IACjC,QAAQ;AACN,kBAAY;AAAA,IACd;AAEA,QAAI,cAAc,QAAQ;AACxB;AAAA,QACE,gEAAgE,MAAM,SAAS,aAAa,SAAS,SAAS,YAAY;AAAA,MAC5H;AAKA,UAAI,CAAC,uBAAuB,oBAAoB,WAAW,QAAQ;AACjE,8BAAsB,EAAE,QAAQ,OAAO,GAAG,SAAS,MAAM;AAAA,MAC3D,OAAO;AACL,4BAAoB,SAAS;AAAA,MAC/B;AAEA,YAAM,YAAY,wBAAwB;AAC1C,UAAI,oBAAoB,SAAS,aAAa,CAAC,oBAAoB,SAAS;AAC1E,4BAAoB,UAAU;AAC9B;AAAA,UACE,sDAAsD,oBAAoB,KAAK,2CAA2C,MAAM,kBAAkB,YAAY;AAAA,QAChK;AACA,eAAO,EAAE,QAAQ,UAAU,QAAQ,4BAA4B;AAAA,MACjE;AACA,aAAO,EAAE,QAAQ,UAAU,QAAQ,kBAAkB;AAAA,IACvD;AAGA,0BAAsB;AACtB,QAAI,6CAA6C,WAAW,QAAQ,WAAM,SAAS,EAAE;AACrF,WAAO,EAAE,QAAQ,WAAW,MAAM,SAAS,IAAI,UAAU;AAAA,EAC3D,SAAS,KAAK;AAEZ,QAAI,gDAAgD,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,CAAC,EAAE;AACtG,WAAO,EAAE,QAAQ,UAAU,QAAQ,YAAY;AAAA,EACjD;AACF;","names":[]}
|
|
@@ -161,7 +161,7 @@ async function spawnPairSession(session) {
|
|
|
161
161
|
return { ok: true };
|
|
162
162
|
} catch {
|
|
163
163
|
}
|
|
164
|
-
const { resolveClaudeBinary } = await import("./persistent-session-
|
|
164
|
+
const { resolveClaudeBinary } = await import("./persistent-session-FMF3LCDW.js");
|
|
165
165
|
const claudeBin = resolveClaudeBinary();
|
|
166
166
|
const pairEnv = {
|
|
167
167
|
...process.env,
|
|
@@ -472,4 +472,4 @@ export {
|
|
|
472
472
|
startClaudePair,
|
|
473
473
|
submitClaudePairCode
|
|
474
474
|
};
|
|
475
|
-
//# sourceMappingURL=claude-pair-runtime-
|
|
475
|
+
//# sourceMappingURL=claude-pair-runtime-X2D4Z6OG.js.map
|
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
safeWriteJsonAtomic,
|
|
64
64
|
setConfigHash,
|
|
65
65
|
tripClass
|
|
66
|
-
} from "../chunk-
|
|
66
|
+
} from "../chunk-I2YUIY37.js";
|
|
67
67
|
import {
|
|
68
68
|
getProjectDir as getProjectDir2,
|
|
69
69
|
getReadyTasks,
|
|
@@ -136,7 +136,7 @@ import {
|
|
|
136
136
|
takeZombieDetection,
|
|
137
137
|
toOpencodeModel,
|
|
138
138
|
writeEgressAllowlist
|
|
139
|
-
} from "../chunk-
|
|
139
|
+
} from "../chunk-K3XCSA4U.js";
|
|
140
140
|
import {
|
|
141
141
|
ACCOUNT_ENFORCEMENT_MARKER_FILENAME,
|
|
142
142
|
AnchorSessionClient,
|
|
@@ -232,7 +232,7 @@ import {
|
|
|
232
232
|
subagentActivityAgeSeconds,
|
|
233
233
|
sumTranscriptUsageInWindow,
|
|
234
234
|
transcriptActivityAgeSeconds
|
|
235
|
-
} from "../chunk-
|
|
235
|
+
} from "../chunk-SVGL52XU.js";
|
|
236
236
|
import "../chunk-DHWNVVX4.js";
|
|
237
237
|
import {
|
|
238
238
|
reapOrphanChannelMcps
|
|
@@ -13258,7 +13258,7 @@ var pendingDayRolloverReset = /* @__PURE__ */ new Set();
|
|
|
13258
13258
|
var dayRolloverInboundHold = /* @__PURE__ */ new Map();
|
|
13259
13259
|
var INBOUND_HOLD_EPISODE_GAP_MS = 12e4;
|
|
13260
13260
|
async function channelInboundActivityAgeSecondsFor(codeName) {
|
|
13261
|
-
const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-
|
|
13261
|
+
const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-ZE3MSI2S.js");
|
|
13262
13262
|
const newest = newestPendingInboundActivityMtimeMs(dirname11(paneLogPath(codeName)));
|
|
13263
13263
|
if (newest === null) return null;
|
|
13264
13264
|
return Math.max(0, Math.floor((Date.now() - newest) / 1e3));
|
|
@@ -13943,7 +13943,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
|
|
|
13943
13943
|
var lastVersionCheckAt = 0;
|
|
13944
13944
|
var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
|
|
13945
13945
|
var lastResponsivenessProbeAt = 0;
|
|
13946
|
-
var agtCliVersion = true ? "0.28.
|
|
13946
|
+
var agtCliVersion = true ? "0.28.950" : "dev";
|
|
13947
13947
|
function resolveBrewPath(execFileSync2) {
|
|
13948
13948
|
try {
|
|
13949
13949
|
const out = execFileSync2("which", ["brew"], { timeout: 5e3 }).toString().trim();
|
|
@@ -14273,6 +14273,7 @@ function claudeManagedSettingsPath() {
|
|
|
14273
14273
|
return process.platform === "darwin" ? "/Library/Application Support/ClaudeCode/managed-settings.json" : "/etc/claude-code/managed-settings.json";
|
|
14274
14274
|
}
|
|
14275
14275
|
var MANAGED_SETTINGS_KEYS = ["channelsEnabled", "enableAllProjectMcpServers"];
|
|
14276
|
+
var MANAGED_SETTINGS_ENV = { DISABLE_AUTOUPDATER: "1" };
|
|
14276
14277
|
function ensureClaudeManagedSettings(path = claudeManagedSettingsPath()) {
|
|
14277
14278
|
try {
|
|
14278
14279
|
let settings = {};
|
|
@@ -14292,12 +14293,23 @@ function ensureClaudeManagedSettings(path = claudeManagedSettingsPath()) {
|
|
|
14292
14293
|
}
|
|
14293
14294
|
}
|
|
14294
14295
|
const missing = MANAGED_SETTINGS_KEYS.filter((key) => settings[key] !== true);
|
|
14295
|
-
|
|
14296
|
+
const existingEnv = settings["env"];
|
|
14297
|
+
const env = existingEnv && typeof existingEnv === "object" && !Array.isArray(existingEnv) ? existingEnv : {};
|
|
14298
|
+
const missingEnv = Object.entries(MANAGED_SETTINGS_ENV).filter(([k, v]) => env[k] !== v);
|
|
14299
|
+
if (missing.length === 0 && missingEnv.length === 0) return "ok";
|
|
14296
14300
|
for (const key of missing) settings[key] = true;
|
|
14301
|
+
if (missingEnv.length > 0) {
|
|
14302
|
+
for (const [k, v] of missingEnv) env[k] = v;
|
|
14303
|
+
settings["env"] = env;
|
|
14304
|
+
}
|
|
14297
14305
|
mkdirSync15(dirname11(path), { recursive: true });
|
|
14298
14306
|
writeFileSync18(path, `${JSON.stringify(settings, null, 2)}
|
|
14299
14307
|
`);
|
|
14300
|
-
|
|
14308
|
+
const changed = [
|
|
14309
|
+
...missing.map((k) => `${k}:true`),
|
|
14310
|
+
...missingEnv.map(([k, v]) => `env.${k}=${v}`)
|
|
14311
|
+
];
|
|
14312
|
+
log(`[managed-settings] set ${changed.join(", ")} in ${path} (ENG-5786 unblocks Claude Code channels; ENG-9223 pre-approves project MCP servers so a headless session never freezes on the trust prompt; ENG-10620 disables Claude Code's self-updater for every launch so the fleet pin holds)`);
|
|
14301
14313
|
return "ok";
|
|
14302
14314
|
} catch (err) {
|
|
14303
14315
|
log(`[managed-settings] could not ensure ${path}: ${err.message} \u2014 Claude Code channels may be blocked and a new agent may freeze on the MCP trust prompt; set ${MANAGED_SETTINGS_KEYS.map((k) => `${k}:true`).join(" and ")} manually`);
|
|
@@ -15533,7 +15545,7 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
|
|
|
15533
15545
|
if (codeNames.length === 0) return;
|
|
15534
15546
|
void (async () => {
|
|
15535
15547
|
try {
|
|
15536
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
15548
|
+
const { collectDiagnostics } = await import("../persistent-session-FMF3LCDW.js");
|
|
15537
15549
|
await api.post("/host/heartbeat", {
|
|
15538
15550
|
host_id: hostId,
|
|
15539
15551
|
agent_diagnostics: collectDiagnostics(codeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor)
|
|
@@ -15675,7 +15687,7 @@ async function pollCycleInner() {
|
|
|
15675
15687
|
}
|
|
15676
15688
|
try {
|
|
15677
15689
|
const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
|
|
15678
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
15690
|
+
const { collectDiagnostics } = await import("../persistent-session-FMF3LCDW.js");
|
|
15679
15691
|
const diagCodeNames = [...agentState.persistentSessionAgents];
|
|
15680
15692
|
const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor) : void 0;
|
|
15681
15693
|
let tailscaleHostname;
|
|
@@ -15829,10 +15841,11 @@ async function pollCycleInner() {
|
|
|
15829
15841
|
hostFlagStore().applyBooleanFlagsByAgent(hbResp?.feature_flags_by_agent);
|
|
15830
15842
|
setConfigHash(hbResp?.config_hash ?? null);
|
|
15831
15843
|
try {
|
|
15832
|
-
|
|
15833
|
-
|
|
15844
|
+
const desiredClaudeCodeVersion = hbResp?.desired_claude_code_version?.trim();
|
|
15845
|
+
if (desiredClaudeCodeVersion && decideMaintenanceWindowGate({ window: cachedMaintenanceWindow, now: /* @__PURE__ */ new Date() }) === "proceed") {
|
|
15846
|
+
const { maybeUpdateClaudeCode } = await import("../claude-code-updater-NAHJ6O6C.js");
|
|
15834
15847
|
await maybeUpdateClaudeCode({
|
|
15835
|
-
desiredVersion:
|
|
15848
|
+
desiredVersion: desiredClaudeCodeVersion,
|
|
15836
15849
|
currentVersion: cachedFrameworkVersion,
|
|
15837
15850
|
log
|
|
15838
15851
|
});
|
|
@@ -15850,7 +15863,7 @@ async function pollCycleInner() {
|
|
|
15850
15863
|
collectPanelessActivityProbes,
|
|
15851
15864
|
getResponsivenessIntervalMs,
|
|
15852
15865
|
occupancyQualificationClassifications
|
|
15853
|
-
} = await import("../responsiveness-probe-
|
|
15866
|
+
} = await import("../responsiveness-probe-ZE3MSI2S.js");
|
|
15854
15867
|
const probeIntervalMs = getResponsivenessIntervalMs();
|
|
15855
15868
|
if (now - lastResponsivenessProbeAt > probeIntervalMs) {
|
|
15856
15869
|
const probeCodeNames = [...agentState.persistentSessionAgents];
|
|
@@ -15967,7 +15980,7 @@ async function pollCycleInner() {
|
|
|
15967
15980
|
collectResponsivenessProbes,
|
|
15968
15981
|
livePendingInboundOldestAgeSeconds,
|
|
15969
15982
|
parkPendingInbound
|
|
15970
|
-
} = await import("../responsiveness-probe-
|
|
15983
|
+
} = await import("../responsiveness-probe-ZE3MSI2S.js");
|
|
15971
15984
|
const { getProjectDir: wedgeProjectDir } = await import("../scheduler-engine-NDP36U7O.js");
|
|
15972
15985
|
const wedgeNow = /* @__PURE__ */ new Date();
|
|
15973
15986
|
const liveAgents = agentState.persistentSessionAgents;
|
|
@@ -16123,7 +16136,7 @@ async function pollCycleInner() {
|
|
|
16123
16136
|
}
|
|
16124
16137
|
try {
|
|
16125
16138
|
const { scrapeMcpFailedBannerCount } = await import("../pane-mcp-banner-scraper-JA437JIB.js");
|
|
16126
|
-
const { probeSessionAuth } = await import("../session-auth-dead-
|
|
16139
|
+
const { probeSessionAuth } = await import("../session-auth-dead-7G555HQQ.js");
|
|
16127
16140
|
const observations = [];
|
|
16128
16141
|
const pendingCacheCommits = [];
|
|
16129
16142
|
const modelApiErrorReportingOn = hostFlagStore().getBoolean("model-api-error-reporting");
|
|
@@ -20387,7 +20400,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
|
|
|
20387
20400
|
try {
|
|
20388
20401
|
const freshId = rotateSessionForWedge(codeName);
|
|
20389
20402
|
consecutiveWedgeCycles.delete(codeName);
|
|
20390
|
-
const { parkPendingInbound: parkForRestart } = await import("../responsiveness-probe-
|
|
20403
|
+
const { parkPendingInbound: parkForRestart } = await import("../responsiveness-probe-ZE3MSI2S.js");
|
|
20391
20404
|
const { parked, deadLettered } = parkForRestart(codeName, /* @__PURE__ */ new Date());
|
|
20392
20405
|
const parkNote = parked > 0 ? `, ${parked} inbound parked` : "";
|
|
20393
20406
|
const deadNote = deadLettered > 0 ? `, ${deadLettered} undeliverable dead-lettered` : "";
|
|
@@ -20430,7 +20443,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
|
|
|
20430
20443
|
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}`));
|
|
20431
20444
|
void (async () => {
|
|
20432
20445
|
try {
|
|
20433
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
20446
|
+
const { collectDiagnostics } = await import("../persistent-session-FMF3LCDW.js");
|
|
20434
20447
|
await api.post("/host/heartbeat", {
|
|
20435
20448
|
host_id: hostId,
|
|
20436
20449
|
agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor)
|
|
@@ -20481,7 +20494,7 @@ async function respawnAgentAfterMcpStop(codeName, reason) {
|
|
|
20481
20494
|
}
|
|
20482
20495
|
try {
|
|
20483
20496
|
const hostId = await getHostId();
|
|
20484
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
20497
|
+
const { collectDiagnostics } = await import("../persistent-session-FMF3LCDW.js");
|
|
20485
20498
|
await api.post("/host/heartbeat", {
|
|
20486
20499
|
host_id: hostId,
|
|
20487
20500
|
agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor)
|
|
@@ -21123,7 +21136,7 @@ async function processClaudePairSessions(agents) {
|
|
|
21123
21136
|
killPairSession,
|
|
21124
21137
|
pairTmuxSession,
|
|
21125
21138
|
finalizeClaudePairOnboarding
|
|
21126
|
-
} = await import("../claude-pair-runtime-
|
|
21139
|
+
} = await import("../claude-pair-runtime-X2D4Z6OG.js");
|
|
21127
21140
|
for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
|
|
21128
21141
|
log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
|
|
21129
21142
|
const killed = await killPairSession(pairTmuxSession(pairId));
|