@integrity-labs/agt-cli 0.28.499 → 0.28.501

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.
@@ -6,7 +6,7 @@ import {
6
6
  import { spawn as spawn2, execSync as execSync2, execFileSync as execFileSync3 } from "child_process";
7
7
  import { join as join5, dirname as dirname3 } from "path";
8
8
  import { homedir as homedir5, platform, userInfo as userInfo2 } from "os";
9
- import { existsSync as existsSync6, readFileSync as readFileSync7, readdirSync as readdirSync3, writeFileSync as writeFileSync5, appendFileSync as appendFileSync2, mkdirSync as mkdirSync5, chmodSync as chmodSync3, copyFileSync, rmSync as rmSync3, lstatSync, realpathSync } from "fs";
9
+ import { existsSync as existsSync6, readFileSync as readFileSync7, readdirSync as readdirSync3, writeFileSync as writeFileSync5, appendFileSync as appendFileSync2, mkdirSync as mkdirSync5, chmodSync as chmodSync3, copyFileSync, rmSync as rmSync3, lstatSync, realpathSync, renameSync as renameSync2, statSync as statSync2 } from "fs";
10
10
 
11
11
  // src/lib/mcp-sanitize.ts
12
12
  import { readFileSync, writeFileSync } from "fs";
@@ -13631,6 +13631,28 @@ function setupPaneLog2(tmuxSession, codeName, log2) {
13631
13631
  log2(`[persistent-session] pipe-pane setup failed for '${codeName}': ${err.message}`);
13632
13632
  }
13633
13633
  }
13634
+ function rotatePaneLogForDayRollover(codeName, log2, agentTimezone, now = /* @__PURE__ */ new Date()) {
13635
+ const logPath = paneLogPath(codeName);
13636
+ try {
13637
+ if (!existsSync6(logPath)) return null;
13638
+ if (statSync2(logPath).size === 0) return null;
13639
+ const stamp = todayLocalIso(now, agentTimezone ?? void 0).replace(/-/g, "");
13640
+ const dir = dirname3(logPath);
13641
+ let target = join5(dir, `pane.log-${stamp}`);
13642
+ if (existsSync6(target)) {
13643
+ const hhmmss = now.toISOString().slice(11, 19).replace(/:/g, "");
13644
+ target = join5(dir, `pane.log-${stamp}-${hhmmss}`);
13645
+ }
13646
+ renameSync2(logPath, target);
13647
+ writeFileSync5(logPath, "", "utf-8");
13648
+ const rotated = target.slice(dir.length + 1);
13649
+ log2(`[persistent-session] Rotated pane.log for '${codeName}' \u2192 ${rotated} (day-rollover)`);
13650
+ return rotated;
13651
+ } catch (err) {
13652
+ log2(`[persistent-session] pane.log rotation failed for '${codeName}': ${err.message}`);
13653
+ return null;
13654
+ }
13655
+ }
13634
13656
  function readPaneLogTail(codeName, lines = PANE_TAIL_LINES) {
13635
13657
  const logPath = paneLogPath(codeName);
13636
13658
  if (!existsSync6(logPath)) return null;
@@ -14688,6 +14710,7 @@ export {
14688
14710
  buildDockerRunCommand,
14689
14711
  writePersistentClaudeWrapper,
14690
14712
  paneLogPath,
14713
+ rotatePaneLogForDayRollover,
14691
14714
  readPaneLogTail,
14692
14715
  prepareForRespawn,
14693
14716
  rotateSessionForWedge,
@@ -14713,4 +14736,4 @@ export {
14713
14736
  stopAllSessionsAndWait,
14714
14737
  getProjectDir
14715
14738
  };
14716
- //# sourceMappingURL=chunk-5XHO4HKA.js.map
14739
+ //# sourceMappingURL=chunk-XKBUTWON.js.map