@integrity-labs/agt-cli 0.28.1143 → 0.28.1144
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 +13 -11
- package/dist/bin/agt.js.map +1 -1
- package/dist/{chunk-F4NFTLDH.js → chunk-C33IQH4H.js} +17 -15
- package/dist/{chunk-F4NFTLDH.js.map → chunk-C33IQH4H.js.map} +1 -1
- package/dist/{chunk-ZJFS74H5.js → chunk-EZYLIFK2.js} +24 -22
- package/dist/{chunk-ZJFS74H5.js.map → chunk-EZYLIFK2.js.map} +1 -1
- package/dist/{chunk-JM47BARM.js → chunk-FQD4EIUF.js} +2 -233
- package/dist/chunk-FQD4EIUF.js.map +1 -0
- package/dist/chunk-XAZ4C444.js +238 -0
- package/dist/chunk-XAZ4C444.js.map +1 -0
- package/dist/{claude-code-updater-NEJCTT7S.js → claude-code-updater-HTDCRIMM.js} +99 -4
- package/dist/claude-code-updater-HTDCRIMM.js.map +1 -0
- package/dist/{claude-pair-runtime-A3OWKP3K.js → claude-pair-runtime-VEDZCIJR.js} +2 -2
- package/dist/lib/manager-worker.js +43 -37
- package/dist/lib/manager-worker.js.map +1 -1
- package/dist/{persistent-session-VNJDG3VN.js → persistent-session-JKD36BCM.js} +4 -3
- package/dist/{responsiveness-probe-ABQGETFV.js → responsiveness-probe-GGBDYMEW.js} +4 -3
- package/dist/{responsiveness-probe-ABQGETFV.js.map → responsiveness-probe-GGBDYMEW.js.map} +1 -1
- package/dist/{session-auth-dead-DVE6OGRT.js → session-auth-dead-7AG56OKQ.js} +3 -2
- package/dist/{session-auth-dead-DVE6OGRT.js.map → session-auth-dead-7AG56OKQ.js.map} +1 -1
- package/package.json +1 -1
- package/dist/chunk-JM47BARM.js.map +0 -1
- package/dist/claude-code-updater-NEJCTT7S.js.map +0 -1
- /package/dist/{claude-pair-runtime-A3OWKP3K.js.map → claude-pair-runtime-VEDZCIJR.js.map} +0 -0
- /package/dist/{persistent-session-VNJDG3VN.js.map → persistent-session-JKD36BCM.js.map} +0 -0
|
@@ -16747,224 +16747,6 @@ function deriveBindFailureQuarantineThreshold(provisioningMax) {
|
|
|
16747
16747
|
}
|
|
16748
16748
|
var MIN_PROVISIONING_MAX_FOR_QUARANTINE_ORDERING = BIND_FAILURE_QUARANTINE_THRESHOLD + 1;
|
|
16749
16749
|
|
|
16750
|
-
// src/lib/daily-session.ts
|
|
16751
|
-
import { randomUUID } from "crypto";
|
|
16752
|
-
import { existsSync, mkdirSync, readFileSync, readdirSync, renameSync, statSync, writeFileSync } from "fs";
|
|
16753
|
-
import { homedir } from "os";
|
|
16754
|
-
import { join } from "path";
|
|
16755
|
-
var HISTORY_DAYS = 7;
|
|
16756
|
-
function profileDir(codeName) {
|
|
16757
|
-
return join(homedir(), ".augmented", codeName);
|
|
16758
|
-
}
|
|
16759
|
-
function dailySessionPath(codeName) {
|
|
16760
|
-
return join(profileDir(codeName), "daily-session.json");
|
|
16761
|
-
}
|
|
16762
|
-
function todayLocalIso(now = /* @__PURE__ */ new Date(), timezone) {
|
|
16763
|
-
if (timezone) {
|
|
16764
|
-
try {
|
|
16765
|
-
const fmt = new Intl.DateTimeFormat("en-CA", {
|
|
16766
|
-
timeZone: timezone,
|
|
16767
|
-
year: "numeric",
|
|
16768
|
-
month: "2-digit",
|
|
16769
|
-
day: "2-digit"
|
|
16770
|
-
});
|
|
16771
|
-
return fmt.format(now);
|
|
16772
|
-
} catch {
|
|
16773
|
-
}
|
|
16774
|
-
}
|
|
16775
|
-
const y = now.getFullYear();
|
|
16776
|
-
const m = String(now.getMonth() + 1).padStart(2, "0");
|
|
16777
|
-
const d = String(now.getDate()).padStart(2, "0");
|
|
16778
|
-
return `${y}-${m}-${d}`;
|
|
16779
|
-
}
|
|
16780
|
-
function readFile(codeName) {
|
|
16781
|
-
const path = dailySessionPath(codeName);
|
|
16782
|
-
if (!existsSync(path)) return { current: null, history: [] };
|
|
16783
|
-
try {
|
|
16784
|
-
const raw = readFileSync(path, "utf-8");
|
|
16785
|
-
const parsed = JSON.parse(raw);
|
|
16786
|
-
return {
|
|
16787
|
-
current: parsed.current ?? null,
|
|
16788
|
-
history: Array.isArray(parsed.history) ? parsed.history : []
|
|
16789
|
-
};
|
|
16790
|
-
} catch {
|
|
16791
|
-
return { current: null, history: [] };
|
|
16792
|
-
}
|
|
16793
|
-
}
|
|
16794
|
-
function writeFile(codeName, data) {
|
|
16795
|
-
const dir = profileDir(codeName);
|
|
16796
|
-
mkdirSync(dir, { recursive: true });
|
|
16797
|
-
const finalPath = dailySessionPath(codeName);
|
|
16798
|
-
const tmpPath = `${finalPath}.${process.pid}.${randomUUID()}.tmp`;
|
|
16799
|
-
writeFileSync(tmpPath, JSON.stringify(data, null, 2), "utf-8");
|
|
16800
|
-
renameSync(tmpPath, finalPath);
|
|
16801
|
-
}
|
|
16802
|
-
function trimHistory(history, now, timezone) {
|
|
16803
|
-
const cutoff = new Date(now);
|
|
16804
|
-
cutoff.setDate(cutoff.getDate() - HISTORY_DAYS);
|
|
16805
|
-
const cutoffIso = todayLocalIso(cutoff, timezone);
|
|
16806
|
-
return history.filter((h) => h.date >= cutoffIso).slice(0, HISTORY_DAYS);
|
|
16807
|
-
}
|
|
16808
|
-
function getOrCreateDailySession(codeName, now = /* @__PURE__ */ new Date(), timezone) {
|
|
16809
|
-
const today = todayLocalIso(now, timezone);
|
|
16810
|
-
const file = readFile(codeName);
|
|
16811
|
-
if (file.current && file.current.date === today) {
|
|
16812
|
-
return { sessionId: file.current.sessionId, isNew: false };
|
|
16813
|
-
}
|
|
16814
|
-
const next = {
|
|
16815
|
-
date: today,
|
|
16816
|
-
sessionId: randomUUID(),
|
|
16817
|
-
startedAt: now.toISOString()
|
|
16818
|
-
};
|
|
16819
|
-
const history = trimHistory(
|
|
16820
|
-
[...file.current ? [file.current] : [], ...file.history],
|
|
16821
|
-
now,
|
|
16822
|
-
timezone
|
|
16823
|
-
);
|
|
16824
|
-
writeFile(codeName, { current: next, history });
|
|
16825
|
-
return { sessionId: next.sessionId, isNew: true };
|
|
16826
|
-
}
|
|
16827
|
-
function markDailySessionSpawn(codeName, sessionId, now = /* @__PURE__ */ new Date(), timezone) {
|
|
16828
|
-
const today = todayLocalIso(now, timezone);
|
|
16829
|
-
const file = readFile(codeName);
|
|
16830
|
-
if (file.current && file.current.date === today && file.current.sessionId === sessionId) {
|
|
16831
|
-
return;
|
|
16832
|
-
}
|
|
16833
|
-
const next = {
|
|
16834
|
-
date: today,
|
|
16835
|
-
sessionId,
|
|
16836
|
-
startedAt: now.toISOString()
|
|
16837
|
-
};
|
|
16838
|
-
const history = trimHistory(
|
|
16839
|
-
[...file.current ? [file.current] : [], ...file.history],
|
|
16840
|
-
now,
|
|
16841
|
-
timezone
|
|
16842
|
-
);
|
|
16843
|
-
writeFile(codeName, { current: next, history });
|
|
16844
|
-
}
|
|
16845
|
-
function rotateDailySession(codeName, now = /* @__PURE__ */ new Date(), timezone) {
|
|
16846
|
-
const today = todayLocalIso(now, timezone);
|
|
16847
|
-
const file = readFile(codeName);
|
|
16848
|
-
const next = {
|
|
16849
|
-
date: today,
|
|
16850
|
-
sessionId: randomUUID(),
|
|
16851
|
-
startedAt: now.toISOString()
|
|
16852
|
-
};
|
|
16853
|
-
const history = trimHistory(
|
|
16854
|
-
[...file.current ? [file.current] : [], ...file.history],
|
|
16855
|
-
now,
|
|
16856
|
-
timezone
|
|
16857
|
-
);
|
|
16858
|
-
writeFile(codeName, { current: next, history });
|
|
16859
|
-
return next.sessionId;
|
|
16860
|
-
}
|
|
16861
|
-
var encodeProjectPath = encodeClaudeProjectPath;
|
|
16862
|
-
function sessionFileExists(projectDir, sessionId) {
|
|
16863
|
-
const path = join(
|
|
16864
|
-
homedir(),
|
|
16865
|
-
".claude",
|
|
16866
|
-
"projects",
|
|
16867
|
-
encodeProjectPath(projectDir),
|
|
16868
|
-
`${sessionId}.jsonl`
|
|
16869
|
-
);
|
|
16870
|
-
return existsSync(path);
|
|
16871
|
-
}
|
|
16872
|
-
function sessionTranscriptDir(projectDir) {
|
|
16873
|
-
return join(homedir(), ".claude", "projects", encodeProjectPath(projectDir));
|
|
16874
|
-
}
|
|
16875
|
-
function sessionFilePath(projectDir, sessionId) {
|
|
16876
|
-
return join(sessionTranscriptDir(projectDir), `${sessionId}.jsonl`);
|
|
16877
|
-
}
|
|
16878
|
-
function transcriptActivityAgeSeconds(projectDir, sessionId, now = /* @__PURE__ */ new Date()) {
|
|
16879
|
-
if (!sessionId) return null;
|
|
16880
|
-
try {
|
|
16881
|
-
const mtimeMs = statSync(sessionFilePath(projectDir, sessionId)).mtimeMs;
|
|
16882
|
-
return Math.max(0, Math.floor((now.getTime() - mtimeMs) / 1e3));
|
|
16883
|
-
} catch {
|
|
16884
|
-
return null;
|
|
16885
|
-
}
|
|
16886
|
-
}
|
|
16887
|
-
function subagentActivityAgeSeconds(projectDir, sessionId, now = /* @__PURE__ */ new Date()) {
|
|
16888
|
-
if (!sessionId) return null;
|
|
16889
|
-
const dir = join(sessionTranscriptDir(projectDir), sessionId, "subagents");
|
|
16890
|
-
try {
|
|
16891
|
-
let freshestMtimeMs = null;
|
|
16892
|
-
for (const name of readdirSync(dir)) {
|
|
16893
|
-
if (!name.endsWith(".jsonl")) continue;
|
|
16894
|
-
try {
|
|
16895
|
-
const mtimeMs = statSync(join(dir, name)).mtimeMs;
|
|
16896
|
-
if (freshestMtimeMs === null || mtimeMs > freshestMtimeMs) freshestMtimeMs = mtimeMs;
|
|
16897
|
-
} catch {
|
|
16898
|
-
}
|
|
16899
|
-
}
|
|
16900
|
-
if (freshestMtimeMs === null) return null;
|
|
16901
|
-
return Math.max(0, Math.floor((now.getTime() - freshestMtimeMs) / 1e3));
|
|
16902
|
-
} catch {
|
|
16903
|
-
return null;
|
|
16904
|
-
}
|
|
16905
|
-
}
|
|
16906
|
-
function isAgentIdle(projectDir, sessionId, idleSeconds = 60, now = /* @__PURE__ */ new Date()) {
|
|
16907
|
-
const path = sessionFilePath(projectDir, sessionId);
|
|
16908
|
-
if (!existsSync(path)) return true;
|
|
16909
|
-
try {
|
|
16910
|
-
const mtimeMs = statSync(path).mtimeMs;
|
|
16911
|
-
return now.getTime() - mtimeMs >= idleSeconds * 1e3;
|
|
16912
|
-
} catch {
|
|
16913
|
-
return false;
|
|
16914
|
-
}
|
|
16915
|
-
}
|
|
16916
|
-
function isStaleForToday(codeName, now = /* @__PURE__ */ new Date(), timezone) {
|
|
16917
|
-
const file = readFile(codeName);
|
|
16918
|
-
if (!file.current) return false;
|
|
16919
|
-
return file.current.date !== todayLocalIso(now, timezone);
|
|
16920
|
-
}
|
|
16921
|
-
function minutesSinceLocalMidnight(now = /* @__PURE__ */ new Date(), timezone) {
|
|
16922
|
-
if (timezone) {
|
|
16923
|
-
try {
|
|
16924
|
-
const fmt = new Intl.DateTimeFormat("en-GB", {
|
|
16925
|
-
timeZone: timezone,
|
|
16926
|
-
hour: "2-digit",
|
|
16927
|
-
minute: "2-digit",
|
|
16928
|
-
hourCycle: "h23"
|
|
16929
|
-
});
|
|
16930
|
-
const parts = fmt.formatToParts(now);
|
|
16931
|
-
const hh = Number(parts.find((p2) => p2.type === "hour")?.value ?? "0");
|
|
16932
|
-
const mm = Number(parts.find((p2) => p2.type === "minute")?.value ?? "0");
|
|
16933
|
-
if (Number.isFinite(hh) && Number.isFinite(mm)) return hh * 60 + mm;
|
|
16934
|
-
} catch {
|
|
16935
|
-
}
|
|
16936
|
-
}
|
|
16937
|
-
return now.getHours() * 60 + now.getMinutes();
|
|
16938
|
-
}
|
|
16939
|
-
function peekCurrentSession(codeName) {
|
|
16940
|
-
return readFile(codeName).current;
|
|
16941
|
-
}
|
|
16942
|
-
function readDailySessionPin(codeName) {
|
|
16943
|
-
const path = dailySessionPath(codeName);
|
|
16944
|
-
if (!existsSync(path)) {
|
|
16945
|
-
return { path, present: false, raw: null, currentDate: null, currentSessionId: null };
|
|
16946
|
-
}
|
|
16947
|
-
let raw;
|
|
16948
|
-
try {
|
|
16949
|
-
raw = readFileSync(path, "utf-8");
|
|
16950
|
-
} catch {
|
|
16951
|
-
return { path, present: true, raw: null, currentDate: null, currentSessionId: null };
|
|
16952
|
-
}
|
|
16953
|
-
try {
|
|
16954
|
-
const parsed = JSON.parse(raw);
|
|
16955
|
-
const current = parsed.current ?? null;
|
|
16956
|
-
return {
|
|
16957
|
-
path,
|
|
16958
|
-
present: true,
|
|
16959
|
-
raw,
|
|
16960
|
-
currentDate: current?.date ?? null,
|
|
16961
|
-
currentSessionId: current?.sessionId ?? null
|
|
16962
|
-
};
|
|
16963
|
-
} catch {
|
|
16964
|
-
return { path, present: true, raw, currentDate: null, currentSessionId: null };
|
|
16965
|
-
}
|
|
16966
|
-
}
|
|
16967
|
-
|
|
16968
16750
|
export {
|
|
16969
16751
|
resolveAgentConsoleUrl,
|
|
16970
16752
|
normaliseSlackPeerAgentMode,
|
|
@@ -17148,19 +16930,6 @@ export {
|
|
|
17148
16930
|
FORCED_UPDATE_RELAX_AFTER_MS,
|
|
17149
16931
|
FORCED_UPDATE_HARD_DEADLINE_MS,
|
|
17150
16932
|
forcedUpdatePendingForMs,
|
|
17151
|
-
isForcedUpdatePastDeadline
|
|
17152
|
-
todayLocalIso,
|
|
17153
|
-
getOrCreateDailySession,
|
|
17154
|
-
markDailySessionSpawn,
|
|
17155
|
-
rotateDailySession,
|
|
17156
|
-
sessionFileExists,
|
|
17157
|
-
sessionTranscriptDir,
|
|
17158
|
-
transcriptActivityAgeSeconds,
|
|
17159
|
-
subagentActivityAgeSeconds,
|
|
17160
|
-
isAgentIdle,
|
|
17161
|
-
isStaleForToday,
|
|
17162
|
-
minutesSinceLocalMidnight,
|
|
17163
|
-
peekCurrentSession,
|
|
17164
|
-
readDailySessionPin
|
|
16933
|
+
isForcedUpdatePastDeadline
|
|
17165
16934
|
};
|
|
17166
|
-
//# sourceMappingURL=chunk-
|
|
16935
|
+
//# sourceMappingURL=chunk-FQD4EIUF.js.map
|