@integrity-labs/agt-cli 0.28.807 → 0.28.808

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,12 +40,12 @@ import {
40
40
  success,
41
41
  table,
42
42
  warn
43
- } from "../chunk-SHQCTBFE.js";
43
+ } from "../chunk-LLR42RME.js";
44
44
  import {
45
45
  getProjectDir,
46
46
  isSessionResumeDisabled,
47
47
  readDirectChatSessionState
48
- } from "../chunk-GIV6ORI3.js";
48
+ } from "../chunk-TLPQULYH.js";
49
49
  import {
50
50
  AnchorSessionClient,
51
51
  CHANNEL_REGISTRY,
@@ -79,7 +79,7 @@ import {
79
79
  serializeManifestForSlackCli,
80
80
  sessionFileExists,
81
81
  sessionTranscriptDir
82
- } from "../chunk-VK35F6O7.js";
82
+ } from "../chunk-SWUBTUYM.js";
83
83
  import "../chunk-XWVM4KPK.js";
84
84
 
85
85
  // src/bin/agt.ts
@@ -5467,7 +5467,7 @@ import { execFileSync, execSync } from "child_process";
5467
5467
  import { existsSync as existsSync11, realpathSync as realpathSync2 } from "fs";
5468
5468
  import chalk18 from "chalk";
5469
5469
  import ora16 from "ora";
5470
- var cliVersion = true ? "0.28.807" : "dev";
5470
+ var cliVersion = true ? "0.28.808" : "dev";
5471
5471
  async function fetchLatestVersion() {
5472
5472
  const host2 = getHost();
5473
5473
  if (!host2) return null;
@@ -6658,7 +6658,7 @@ function handleError(err) {
6658
6658
  }
6659
6659
 
6660
6660
  // src/bin/agt.ts
6661
- var cliVersion2 = true ? "0.28.807" : "dev";
6661
+ var cliVersion2 = true ? "0.28.808" : "dev";
6662
6662
  var program = new Command();
6663
6663
  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");
6664
6664
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -16,7 +16,7 @@ import {
16
16
  parseEnvIntegrations,
17
17
  shellQuote,
18
18
  summarizeUnanswerablePane
19
- } from "./chunk-GIV6ORI3.js";
19
+ } from "./chunk-TLPQULYH.js";
20
20
  import {
21
21
  BIND_FAILURE_QUARANTINE_THRESHOLD,
22
22
  INTEGRATIONS_SECTION_END,
@@ -71,7 +71,7 @@ import {
71
71
  sessionTranscriptDir,
72
72
  worseConnectivityOutcome,
73
73
  wrapScheduledTaskPrompt
74
- } from "./chunk-VK35F6O7.js";
74
+ } from "./chunk-SWUBTUYM.js";
75
75
  import {
76
76
  parsePsRows
77
77
  } from "./chunk-XWVM4KPK.js";
@@ -6523,7 +6523,7 @@ function exchangeFailureKind(err) {
6523
6523
  }
6524
6524
 
6525
6525
  // src/lib/api-client.ts
6526
- var agtCliVersion = true ? "0.28.807" : "dev";
6526
+ var agtCliVersion = true ? "0.28.808" : "dev";
6527
6527
  var lastConfigHash = null;
6528
6528
  function setConfigHash(hash) {
6529
6529
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -10818,4 +10818,4 @@ export {
10818
10818
  managerInstallSystemUnitCommand,
10819
10819
  managerUninstallSystemUnitCommand
10820
10820
  };
10821
- //# sourceMappingURL=chunk-SHQCTBFE.js.map
10821
+ //# sourceMappingURL=chunk-LLR42RME.js.map
@@ -357,6 +357,32 @@ function checkClaudeMdSize(md) {
357
357
  overBy: Math.max(0, chars - CLAUDE_MD_CONTEXT_ALARM_CHARS)
358
358
  };
359
359
  }
360
+ var CLAUDE_MD_WARN_DELTA_CHARS = 1e3;
361
+ var CLAUDE_MD_WARN_INTERVAL_MS = 60 * 60 * 1e3;
362
+ var CLAUDE_MD_WARN_STATE_MAX = 256;
363
+ var claudeMdWarnState = /* @__PURE__ */ new Map();
364
+ function shouldWarnClaudeMdOverBudget(codeName, size, nowMs = Date.now()) {
365
+ const prev = claudeMdWarnState.get(codeName);
366
+ const changedSeverity = prev !== void 0 && prev.ok !== size.ok;
367
+ const movedMaterially = prev !== void 0 && Math.abs(size.chars - prev.chars) >= CLAUDE_MD_WARN_DELTA_CHARS;
368
+ const stale = prev !== void 0 && nowMs - prev.atMs >= CLAUDE_MD_WARN_INTERVAL_MS;
369
+ if (prev !== void 0 && !changedSeverity && !movedMaterially && !stale)
370
+ return false;
371
+ if (claudeMdWarnState.size >= CLAUDE_MD_WARN_STATE_MAX && !claudeMdWarnState.has(codeName)) {
372
+ let oldestKey;
373
+ let oldestAt = Infinity;
374
+ for (const [key, st] of claudeMdWarnState) {
375
+ if (st.atMs < oldestAt) {
376
+ oldestAt = st.atMs;
377
+ oldestKey = key;
378
+ }
379
+ }
380
+ if (oldestKey !== void 0)
381
+ claudeMdWarnState.delete(oldestKey);
382
+ }
383
+ claudeMdWarnState.set(codeName, { chars: size.chars, ok: size.ok, atMs: nowMs });
384
+ return true;
385
+ }
360
386
  function buildMemorySection() {
361
387
  const recall = `### Recall
362
388
 
@@ -1485,9 +1511,9 @@ Reversible and internal actions stay liberal \u2014 draft, edit, open a PR.
1485
1511
  - Before concluding that an agent or person doesn't exist, call \`directory_lookup\` first. Only report "not found" after the directory confirms no match. (ENG-7955)
1486
1512
  ${frontmatter.environment === "prod" ? "- Production environment: exercise extra caution with all operations.\n" : ""}`;
1487
1513
  const size = checkClaudeMdSize(body);
1488
- if (!size.withinBudget) {
1514
+ if (!size.withinBudget && shouldWarnClaudeMdOverBudget(frontmatter.code_name, size)) {
1489
1515
  const share = (size.contextShare * 100).toFixed(1);
1490
- console.warn(`[generateClaudeMd] CLAUDE.md for ${frontmatter.code_name} is ${size.chars} chars (~${size.tokens} tokens, ~${share}% of a ${CLAUDE_MD_CONTEXT_WINDOW_TOKENS}-token context window), over the ${CLAUDE_MD_BUDGET_CHARS}-char generator budget by ${size.chars - CLAUDE_MD_BUDGET_CHARS}${size.ok ? "" : ` \u2014 and past the ${CLAUDE_MD_CONTEXT_ALARM_CHARS}-char operational threshold`}. Nothing is truncated; this is context the agent pays for on every request. Trim the generated sections (ENG-8105 / ENG-9459).`);
1516
+ console.warn(`[generateClaudeMd] CLAUDE.md for ${frontmatter.code_name} is ${size.chars} chars (~${size.tokens} tokens, ~${share}% of a ${CLAUDE_MD_CONTEXT_WINDOW_TOKENS}-token context window), over the ${CLAUDE_MD_BUDGET_CHARS}-char generator budget by ${size.chars - CLAUDE_MD_BUDGET_CHARS}${size.ok ? "" : ` \u2014 and past the ${CLAUDE_MD_CONTEXT_ALARM_CHARS}-char operational threshold`}. Nothing is truncated; this is context the agent pays for on every request. Trim the generated sections \u2014 the largest movers are the per-agent role/charter prose, the Active-tasks block and the Integrations list. packages/core/src/__tests__/claudemd-size-budget.test.ts is the CI gate.`);
1491
1517
  }
1492
1518
  return body;
1493
1519
  }
@@ -13707,4 +13733,4 @@ export {
13707
13733
  peekCurrentSession,
13708
13734
  readDailySessionPin
13709
13735
  };
13710
- //# sourceMappingURL=chunk-VK35F6O7.js.map
13736
+ //# sourceMappingURL=chunk-SWUBTUYM.js.map