@integrity-labs/agt-cli 0.28.438 → 0.28.440

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 CHANGED
@@ -40,7 +40,7 @@ import {
40
40
  success,
41
41
  table,
42
42
  warn
43
- } from "../chunk-WNSFE56R.js";
43
+ } from "../chunk-V3G7G4QM.js";
44
44
  import {
45
45
  AnchorSessionClient,
46
46
  CHANNEL_REGISTRY,
@@ -71,7 +71,7 @@ import {
71
71
  requiredMcpWildcard,
72
72
  resolveChannels,
73
73
  serializeManifestForSlackCli
74
- } from "../chunk-MOASN7XT.js";
74
+ } from "../chunk-R6GVWACQ.js";
75
75
  import "../chunk-XWVM4KPK.js";
76
76
 
77
77
  // src/bin/agt.ts
@@ -4830,7 +4830,7 @@ import { execFileSync, execSync } from "child_process";
4830
4830
  import { existsSync as existsSync10, realpathSync as realpathSync2 } from "fs";
4831
4831
  import chalk18 from "chalk";
4832
4832
  import ora16 from "ora";
4833
- var cliVersion = true ? "0.28.438" : "dev";
4833
+ var cliVersion = true ? "0.28.440" : "dev";
4834
4834
  async function fetchLatestVersion() {
4835
4835
  const host2 = getHost();
4836
4836
  if (!host2) return null;
@@ -6002,7 +6002,7 @@ function handleError(err) {
6002
6002
  }
6003
6003
 
6004
6004
  // src/bin/agt.ts
6005
- var cliVersion2 = true ? "0.28.438" : "dev";
6005
+ var cliVersion2 = true ? "0.28.440" : "dev";
6006
6006
  var program = new Command();
6007
6007
  program.name("agt").description("Augmented CLI \u2014 agent provisioning and management").version(cliVersion2).option("--json", "Emit machine-readable JSON output (suppress spinners and colors)").option("--skip-update-check", "Skip the automatic update check on startup");
6008
6008
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -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 join6, dirname as dirname3 } from "path";
8
8
  import { homedir as homedir6, platform, userInfo as userInfo2 } from "os";
9
- import { existsSync as existsSync6, readFileSync as readFileSync7, readdirSync as readdirSync3, writeFileSync as writeFileSync6, appendFileSync as appendFileSync2, mkdirSync as mkdirSync6, chmodSync as chmodSync3, copyFileSync, rmSync as rmSync4 } from "fs";
9
+ import { existsSync as existsSync6, readFileSync as readFileSync8, readdirSync as readdirSync3, writeFileSync as writeFileSync6, appendFileSync as appendFileSync2, mkdirSync as mkdirSync6, chmodSync as chmodSync3, copyFileSync, rmSync as rmSync4 } from "fs";
10
10
 
11
11
  // src/lib/mcp-sanitize.ts
12
12
  import { readFileSync, writeFileSync } from "fs";
@@ -8465,6 +8465,27 @@ function serializeUsageLimitMarker(limitedUntil) {
8465
8465
  };
8466
8466
  return JSON.stringify(marker);
8467
8467
  }
8468
+ function parseUsageLimitMarker(raw) {
8469
+ let parsed;
8470
+ try {
8471
+ parsed = JSON.parse(raw);
8472
+ } catch {
8473
+ return null;
8474
+ }
8475
+ if (typeof parsed !== "object" || parsed === null || parsed.version !== USAGE_LIMIT_MARKER_VERSION) {
8476
+ return null;
8477
+ }
8478
+ const until = parsed.limited_until;
8479
+ if (typeof until !== "string" || !Number.isFinite(Date.parse(until)))
8480
+ return null;
8481
+ return { version: USAGE_LIMIT_MARKER_VERSION, limited_until: until };
8482
+ }
8483
+ function resolveUsageLimitUntil(marker, now) {
8484
+ if (!marker)
8485
+ return null;
8486
+ const until = new Date(marker.limited_until);
8487
+ return until.getTime() > now.getTime() ? until : null;
8488
+ }
8468
8489
 
8469
8490
  // ../../packages/core/dist/account-enforcement/marker.js
8470
8491
  var ACCOUNT_ENFORCEMENT_MARKER_FILENAME = "account-enforcement.json";
@@ -12778,7 +12799,7 @@ function creditWatchdogGiveUpCount(codeName, count) {
12778
12799
  }
12779
12800
 
12780
12801
  // src/lib/usage-limit-marker-file.ts
12781
- import { mkdirSync as mkdirSync5, rmSync as rmSync3, writeFileSync as writeFileSync5 } from "fs";
12802
+ import { mkdirSync as mkdirSync5, readFileSync as readFileSync7, rmSync as rmSync3, writeFileSync as writeFileSync5 } from "fs";
12782
12803
  import { homedir as homedir5 } from "os";
12783
12804
  import { join as join5 } from "path";
12784
12805
  function agentDir2(codeName) {
@@ -12802,6 +12823,25 @@ function clearUsageLimitMarker(codeName, log2) {
12802
12823
  log2(`[usage-banner] usage-limit marker clear failed for '${codeName}': ${err.message}`);
12803
12824
  }
12804
12825
  }
12826
+ function readUsageLimitUntil(opts) {
12827
+ const path = opts.filePath ?? (opts.codeName ? usageLimitMarkerPath(opts.codeName) : null);
12828
+ if (!path) return null;
12829
+ let raw;
12830
+ try {
12831
+ raw = readFileSync7(path, "utf-8");
12832
+ } catch {
12833
+ return null;
12834
+ }
12835
+ return resolveUsageLimitUntil(parseUsageLimitMarker(raw), opts.now ?? /* @__PURE__ */ new Date());
12836
+ }
12837
+ var loggedUsageCapDeferral = /* @__PURE__ */ new Map();
12838
+ function shouldLogUsageCapDeferral(site, codeName, limitedUntil) {
12839
+ const key = `${site}:${codeName}`;
12840
+ const at = limitedUntil.getTime();
12841
+ if (loggedUsageCapDeferral.get(key) === at) return false;
12842
+ loggedUsageCapDeferral.set(key, at);
12843
+ return true;
12844
+ }
12805
12845
 
12806
12846
  // src/lib/persistent-session.ts
12807
12847
  var OPENROUTER_ANTHROPIC_BASE_URL = "https://openrouter.ai/api";
@@ -13062,7 +13102,7 @@ function writePersistentClaudeWrapper(args) {
13062
13102
  function collectMcpServerNames(mcpConfigPath) {
13063
13103
  if (!existsSync6(mcpConfigPath)) return [];
13064
13104
  try {
13065
- const data = JSON.parse(readFileSync7(mcpConfigPath, "utf-8"));
13105
+ const data = JSON.parse(readFileSync8(mcpConfigPath, "utf-8"));
13066
13106
  const servers = data.mcpServers;
13067
13107
  return servers ? Object.keys(servers) : [];
13068
13108
  } catch {
@@ -13098,7 +13138,7 @@ function readPaneLogTail(codeName, lines = PANE_TAIL_LINES) {
13098
13138
  const logPath = paneLogPath(codeName);
13099
13139
  if (!existsSync6(logPath)) return null;
13100
13140
  try {
13101
- const raw = readFileSync7(logPath, "utf-8");
13141
+ const raw = readFileSync8(logPath, "utf-8");
13102
13142
  if (!raw) return null;
13103
13143
  const stripped = raw.replace(/\x1b\[[0-9;?]*[A-Za-z]/g, "");
13104
13144
  const all = stripped.split("\n").filter((l) => l.length > 0);
@@ -13173,7 +13213,7 @@ function directChatSessionStatePath(agentId) {
13173
13213
  }
13174
13214
  function readDirectChatSessionState(agentId) {
13175
13215
  try {
13176
- const parsed = JSON.parse(readFileSync7(directChatSessionStatePath(agentId), "utf-8"));
13216
+ const parsed = JSON.parse(readFileSync8(directChatSessionStatePath(agentId), "utf-8"));
13177
13217
  if (!parsed || typeof parsed !== "object") return null;
13178
13218
  const state = parsed;
13179
13219
  state.mcpServerKeys = Array.isArray(state.mcpServerKeys) ? state.mcpServerKeys.filter((k) => typeof k === "string") : void 0;
@@ -14091,6 +14131,8 @@ export {
14091
14131
  creditWatchdogGiveUpCount,
14092
14132
  writeUsageLimitMarker,
14093
14133
  clearUsageLimitMarker,
14134
+ readUsageLimitUntil,
14135
+ shouldLogUsageCapDeferral,
14094
14136
  resolveOAuthCredAction,
14095
14137
  resolveClaudeBinary,
14096
14138
  isolationMode,
@@ -14129,4 +14171,4 @@ export {
14129
14171
  stopAllSessionsAndWait,
14130
14172
  getProjectDir
14131
14173
  };
14132
- //# sourceMappingURL=chunk-MOASN7XT.js.map
14174
+ //# sourceMappingURL=chunk-R6GVWACQ.js.map