@integrity-labs/agt-cli 0.28.993 → 0.28.994

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.
Files changed (32) hide show
  1. package/dist/bin/agt.js +5 -4
  2. package/dist/bin/agt.js.map +1 -1
  3. package/dist/{chunk-ACCF4BLS.js → chunk-3OI4ZHJZ.js} +110 -2
  4. package/dist/chunk-3OI4ZHJZ.js.map +1 -0
  5. package/dist/chunk-DGUM43GV.js +11 -0
  6. package/dist/{chunk-ZHXBC3AZ.js → chunk-VCNTJ345.js} +7 -7
  7. package/dist/{claude-code-brew-result-3A4E7GTC.js → claude-code-brew-result-BAXXH2DJ.js} +3 -1
  8. package/dist/{claude-code-brew-result-3A4E7GTC.js.map → claude-code-brew-result-BAXXH2DJ.js.map} +1 -1
  9. package/dist/{claude-code-updater-NAHJ6O6C.js → claude-code-updater-45MB2AXE.js} +2 -1
  10. package/dist/{claude-code-updater-NAHJ6O6C.js.map → claude-code-updater-45MB2AXE.js.map} +1 -1
  11. package/dist/{claude-pair-runtime-WYZOO6QU.js → claude-pair-runtime-QVKJZJIO.js} +3 -2
  12. package/dist/{claude-pair-runtime-WYZOO6QU.js.map → claude-pair-runtime-QVKJZJIO.js.map} +1 -1
  13. package/dist/{host-security-6PDFG7F5.js → host-security-KQYYZZVW.js} +3 -1
  14. package/dist/{host-security-6PDFG7F5.js.map → host-security-KQYYZZVW.js.map} +1 -1
  15. package/dist/lib/manager-worker.js +19 -18
  16. package/dist/lib/manager-worker.js.map +1 -1
  17. package/dist/{manager-supervisor-P5G44DPX.js → manager-supervisor-IVMG2ACE.js} +3 -1
  18. package/dist/{manager-supervisor-P5G44DPX.js.map → manager-supervisor-IVMG2ACE.js.map} +1 -1
  19. package/dist/{pane-mcp-banner-scraper-JA437JIB.js → pane-mcp-banner-scraper-VR5QGP3J.js} +3 -1
  20. package/dist/{pane-mcp-banner-scraper-JA437JIB.js.map → pane-mcp-banner-scraper-VR5QGP3J.js.map} +1 -1
  21. package/dist/{persistent-session-IVDW4O3C.js → persistent-session-DA22LYBZ.js} +3 -2
  22. package/dist/{responsiveness-probe-GGRTBWWR.js → responsiveness-probe-725OVJWA.js} +3 -2
  23. package/dist/{responsiveness-probe-GGRTBWWR.js.map → responsiveness-probe-725OVJWA.js.map} +1 -1
  24. package/dist/{scheduler-engine-NDP36U7O.js → scheduler-engine-M6AFZWNU.js} +2 -1
  25. package/dist/scheduler-engine-M6AFZWNU.js.map +1 -0
  26. package/dist/{session-auth-dead-XPDRV7M5.js → session-auth-dead-4NUNUCRK.js} +2 -1
  27. package/dist/{session-auth-dead-XPDRV7M5.js.map → session-auth-dead-4NUNUCRK.js.map} +1 -1
  28. package/package.json +1 -1
  29. package/dist/chunk-ACCF4BLS.js.map +0 -1
  30. /package/dist/{persistent-session-IVDW4O3C.js.map → chunk-DGUM43GV.js.map} +0 -0
  31. /package/dist/{chunk-ZHXBC3AZ.js.map → chunk-VCNTJ345.js.map} +0 -0
  32. /package/dist/{scheduler-engine-NDP36U7O.js.map → persistent-session-DA22LYBZ.js.map} +0 -0
@@ -38,6 +38,9 @@ import {
38
38
  import {
39
39
  reapOrphanChannelMcps
40
40
  } from "./chunk-XWVM4KPK.js";
41
+ import {
42
+ __require
43
+ } from "./chunk-DGUM43GV.js";
41
44
 
42
45
  // src/lib/persistent-session.ts
43
46
  import { spawn as spawn2, execSync as execSync2, execFileSync as execFileSync3 } from "child_process";
@@ -2926,6 +2929,106 @@ function describeError(err) {
2926
2929
  return code ? `${code}: ${msg}` : msg;
2927
2930
  }
2928
2931
 
2932
+ // src/lib/claude-json-health.ts
2933
+ var MIN_PLAUSIBLE_CLAUDE_JSON_BYTES = 1024;
2934
+ function hasOrphanedMount(mountinfo, path) {
2935
+ if (!mountinfo) return false;
2936
+ for (const line2 of mountinfo.split("\n")) {
2937
+ if (!line2.includes("//deleted")) continue;
2938
+ const fields = line2.split(" ");
2939
+ const root = fields[3];
2940
+ const mountPoint = fields[4];
2941
+ if (mountPoint !== path) continue;
2942
+ if (root === `${path}//deleted`) return true;
2943
+ }
2944
+ return false;
2945
+ }
2946
+ function assessClaudeConfig(probe) {
2947
+ const { raw, nlink, mountinfo, path, readFailure } = probe;
2948
+ if (raw === null) {
2949
+ if (readFailure === "unreadable") {
2950
+ return {
2951
+ verdict: "unreadable",
2952
+ detail: `${path} EXISTS but could not be read (permissions, or it is not a regular file). This is not a sign-in problem and re-authenticating will not fix it.`,
2953
+ blocksSpawn: true
2954
+ };
2955
+ }
2956
+ return {
2957
+ verdict: "missing",
2958
+ detail: `${path} does not exist - Claude Code will show the login picker`,
2959
+ blocksSpawn: true
2960
+ };
2961
+ }
2962
+ if (raw.length === 0) {
2963
+ return { verdict: "empty", detail: `${path} is zero bytes`, blocksSpawn: true };
2964
+ }
2965
+ try {
2966
+ const parsed = JSON.parse(raw);
2967
+ if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
2968
+ return {
2969
+ verdict: "unparseable",
2970
+ detail: `${path} parsed but is not a JSON object`,
2971
+ blocksSpawn: true
2972
+ };
2973
+ }
2974
+ } catch {
2975
+ return {
2976
+ verdict: "unparseable",
2977
+ detail: `${path} is not valid JSON (parse error) at ${raw.length} bytes`,
2978
+ blocksSpawn: true
2979
+ };
2980
+ }
2981
+ if (raw.length < MIN_PLAUSIBLE_CLAUDE_JSON_BYTES) {
2982
+ return {
2983
+ verdict: "truncated",
2984
+ detail: `${path} parses but is only ${raw.length} bytes, below the ${MIN_PLAUSIBLE_CLAUDE_JSON_BYTES}-byte floor - a partial write, not a real config`,
2985
+ blocksSpawn: true
2986
+ };
2987
+ }
2988
+ if (nlink === 0 || hasOrphanedMount(mountinfo, path)) {
2989
+ return {
2990
+ verdict: "orphaned",
2991
+ detail: `${path} is bind-mounted from an UNLINKED inode (nlink=${nlink ?? "unknown"}) - the host replaced this file after the container started. Config writes here are invisible to the host and host-side updates, including re-auth, are invisible here. Recycle the container; do not treat this as an auth failure.`,
2992
+ // Deliberately NOT blocking: by the time this is observable the container
2993
+ // is already running, and refusing to spawn is the wrong lever. The fix
2994
+ // is a recycle, and the point of the verdict is that somebody is told.
2995
+ blocksSpawn: false
2996
+ };
2997
+ }
2998
+ return { verdict: "ok", detail: `${path} is valid (${raw.length} bytes)`, blocksSpawn: false };
2999
+ }
3000
+ function describeClaudeConfigForLog(homeDir) {
3001
+ try {
3002
+ const { readFileSync: readFileSync8, statSync: statSync2 } = __require("fs");
3003
+ const path = `${homeDir.replace(/\/+$/, "")}/.claude.json`;
3004
+ let raw = null;
3005
+ let readFailure;
3006
+ try {
3007
+ raw = readFileSync8(path, "utf8");
3008
+ } catch (err) {
3009
+ raw = null;
3010
+ readFailure = err?.code === "ENOENT" ? "missing" : "unreadable";
3011
+ }
3012
+ let nlink = null;
3013
+ try {
3014
+ nlink = statSync2(path).nlink;
3015
+ } catch {
3016
+ nlink = null;
3017
+ }
3018
+ let mountinfo = null;
3019
+ try {
3020
+ mountinfo = readFileSync8("/proc/self/mountinfo", "utf8");
3021
+ } catch {
3022
+ mountinfo = null;
3023
+ }
3024
+ const out = assessClaudeConfig({ raw, nlink, mountinfo, path, readFailure });
3025
+ if (out.verdict === "ok") return null;
3026
+ return `${out.verdict}: ${out.detail}`;
3027
+ } catch {
3028
+ return null;
3029
+ }
3030
+ }
3031
+
2929
3032
  // src/lib/session-blocked-prompt.ts
2930
3033
  import { execFile } from "child_process";
2931
3034
  var BLOCKED_PROMPT_VERDICT_TTL_MS = 15e3;
@@ -4980,7 +5083,12 @@ async function acceptDialogs(tmuxSession, codeName, log2, primaryModel = null, s
4980
5083
  if (isLoginPickerVisible(screen)) {
4981
5084
  noteSessionBlockedOnPrompt(codeName, "login-picker", "spawn-dialogs");
4982
5085
  if (!loginPickerReported) {
4983
- log2(`[persistent-session] CLAUDE LOGIN REQUIRED for '${codeName}' \u2014 agent cannot start until ~/.claude.json is provisioned. Pair via the Hosts page or run 'claude /login' on the host.`);
5086
+ const health = describeClaudeConfigForLog(homedir5());
5087
+ if (health) {
5088
+ log2(`[persistent-session] CLAUDE LOGIN REQUIRED for '${codeName}' \u2014 ${health}`);
5089
+ } else {
5090
+ log2(`[persistent-session] CLAUDE LOGIN REQUIRED for '${codeName}' \u2014 agent cannot start until ~/.claude.json is provisioned. Pair via the Hosts page or run 'claude /login' on the host.`);
5091
+ }
4984
5092
  loginPickerReported = true;
4985
5093
  }
4986
5094
  loginPickerIterations++;
@@ -5642,4 +5750,4 @@ export {
5642
5750
  stopAllSessionsAndWait,
5643
5751
  getProjectDir
5644
5752
  };
5645
- //# sourceMappingURL=chunk-ACCF4BLS.js.map
5753
+ //# sourceMappingURL=chunk-3OI4ZHJZ.js.map