@integrity-labs/agt-cli 0.28.1299 → 0.28.1301

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.
@@ -15,7 +15,7 @@ import {
15
15
  mintRotatedHostKey,
16
16
  probeHostKey,
17
17
  setConfigHash
18
- } from "./chunk-S5U3LYB3.js";
18
+ } from "./chunk-TIKMCV7Q.js";
19
19
  import "./chunk-FPJRE3WT.js";
20
20
  import "./chunk-DGUM43GV.js";
21
21
  export {
@@ -36,4 +36,4 @@ export {
36
36
  probeHostKey,
37
37
  setConfigHash
38
38
  };
39
- //# sourceMappingURL=api-client-LU5ZWPZ7.js.map
39
+ //# sourceMappingURL=api-client-GU2U5HSM.js.map
package/dist/bin/agt.js CHANGED
@@ -31,7 +31,7 @@ import {
31
31
  success,
32
32
  table,
33
33
  warn
34
- } from "../chunk-EZ44D4NQ.js";
34
+ } from "../chunk-2IGE3OML.js";
35
35
  import {
36
36
  ApiError,
37
37
  PROD_AGT_HOST,
@@ -42,7 +42,7 @@ import {
42
42
  getHost,
43
43
  getHostId,
44
44
  setActiveTeam
45
- } from "../chunk-S5U3LYB3.js";
45
+ } from "../chunk-TIKMCV7Q.js";
46
46
  import {
47
47
  getProjectDir,
48
48
  isSessionResumeDisabled,
@@ -5207,7 +5207,7 @@ import { execFileSync, execSync } from "child_process";
5207
5207
  import { existsSync as existsSync10, realpathSync as realpathSync2 } from "fs";
5208
5208
  import chalk17 from "chalk";
5209
5209
  import ora15 from "ora";
5210
- var cliVersion = true ? "0.28.1299" : "dev";
5210
+ var cliVersion = true ? "0.28.1301" : "dev";
5211
5211
  async function fetchLatestVersion() {
5212
5212
  const host2 = getHost();
5213
5213
  if (!host2) return null;
@@ -6467,7 +6467,7 @@ function handleError(err) {
6467
6467
  }
6468
6468
 
6469
6469
  // src/bin/agt.ts
6470
- var cliVersion2 = true ? "0.28.1299" : "dev";
6470
+ var cliVersion2 = true ? "0.28.1301" : "dev";
6471
6471
  var program = new Command();
6472
6472
  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");
6473
6473
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -2,7 +2,7 @@ import {
2
2
  exchangeApiKey,
3
3
  getApiKey,
4
4
  getHost
5
- } from "./chunk-S5U3LYB3.js";
5
+ } from "./chunk-TIKMCV7Q.js";
6
6
  import {
7
7
  LATE_BOUND_VARS,
8
8
  PLATFORM_DENY_PERMISSIONS,
@@ -13876,4 +13876,4 @@ export {
13876
13876
  managerInstallSystemUnitCommand,
13877
13877
  managerUninstallSystemUnitCommand
13878
13878
  };
13879
- //# sourceMappingURL=chunk-EZ44D4NQ.js.map
13879
+ //# sourceMappingURL=chunk-2IGE3OML.js.map
@@ -103,7 +103,7 @@ function exchangeFailureKind(err) {
103
103
  }
104
104
 
105
105
  // src/lib/api-client.ts
106
- var agtCliVersion = true ? "0.28.1299" : "dev";
106
+ var agtCliVersion = true ? "0.28.1301" : "dev";
107
107
  var lastConfigHash = null;
108
108
  function setConfigHash(hash) {
109
109
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -468,4 +468,4 @@ export {
468
468
  api,
469
469
  getHostId
470
470
  };
471
- //# sourceMappingURL=chunk-S5U3LYB3.js.map
471
+ //# sourceMappingURL=chunk-TIKMCV7Q.js.map
@@ -70,7 +70,7 @@ import {
70
70
  tripClass,
71
71
  writeEtcEnvironment,
72
72
  writeProfileDScript
73
- } from "../chunk-EZ44D4NQ.js";
73
+ } from "../chunk-2IGE3OML.js";
74
74
  import {
75
75
  ApiError,
76
76
  adoptHostKeyInProcess,
@@ -88,7 +88,7 @@ import {
88
88
  probeHostKey,
89
89
  requireHost,
90
90
  setConfigHash
91
- } from "../chunk-S5U3LYB3.js";
91
+ } from "../chunk-TIKMCV7Q.js";
92
92
  import {
93
93
  BLOCKED_ON_PROMPT_DECISION,
94
94
  CHANNEL_SECRET_ENV_KEYS,
@@ -15774,7 +15774,7 @@ function createFileMigrationReportIO(codeName, log2) {
15774
15774
  };
15775
15775
  }
15776
15776
  var managerHostPost = async (path, body) => {
15777
- const { api: api2, ApiError: ApiError3 } = await import("../api-client-LU5ZWPZ7.js");
15777
+ const { api: api2, ApiError: ApiError3 } = await import("../api-client-GU2U5HSM.js");
15778
15778
  try {
15779
15779
  const json = await api2.post(path, body);
15780
15780
  return { status: 200, json };
@@ -18759,7 +18759,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
18759
18759
  var lastVersionCheckAt = 0;
18760
18760
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
18761
18761
  var lastResponsivenessProbeAt = 0;
18762
- var agtCliVersion = true ? "0.28.1299" : "dev";
18762
+ var agtCliVersion = true ? "0.28.1301" : "dev";
18763
18763
  function resolveBrewPath(execFileSync5) {
18764
18764
  try {
18765
18765
  const out = execFileSync5("which", ["brew"], { timeout: 5e3 }).toString().trim();
package/dist/mcp/index.js CHANGED
@@ -2224,20 +2224,20 @@ var require_resolve = __commonJS({
2224
2224
  return false;
2225
2225
  }
2226
2226
  function countKeys(schema) {
2227
- let count = 0;
2227
+ let count2 = 0;
2228
2228
  for (const key in schema) {
2229
2229
  if (key === "$ref")
2230
2230
  return Infinity;
2231
- count++;
2231
+ count2++;
2232
2232
  if (SIMPLE_INLINED.has(key))
2233
2233
  continue;
2234
2234
  if (typeof schema[key] == "object") {
2235
- (0, util_1.eachItem)(schema[key], (sch) => count += countKeys(sch));
2235
+ (0, util_1.eachItem)(schema[key], (sch) => count2 += countKeys(sch));
2236
2236
  }
2237
- if (count === Infinity)
2237
+ if (count2 === Infinity)
2238
2238
  return Infinity;
2239
2239
  }
2240
- return count;
2240
+ return count2;
2241
2241
  }
2242
2242
  function getFullPath(resolver, id = "", normalize) {
2243
2243
  if (normalize !== false)
@@ -5322,8 +5322,8 @@ var require_contains = __commonJS({
5322
5322
  cxt.result(valid, () => cxt.reset());
5323
5323
  function validateItemsWithCount() {
5324
5324
  const schValid = gen.name("_valid");
5325
- const count = gen.let("count", 0);
5326
- validateItems(schValid, () => gen.if(schValid, () => checkLimits(count)));
5325
+ const count2 = gen.let("count", 0);
5326
+ validateItems(schValid, () => gen.if(schValid, () => checkLimits(count2)));
5327
5327
  }
5328
5328
  function validateItems(_valid, block) {
5329
5329
  gen.forRange("i", 0, len, (i) => {
@@ -5336,16 +5336,16 @@ var require_contains = __commonJS({
5336
5336
  block();
5337
5337
  });
5338
5338
  }
5339
- function checkLimits(count) {
5340
- gen.code((0, codegen_1._)`${count}++`);
5339
+ function checkLimits(count2) {
5340
+ gen.code((0, codegen_1._)`${count2}++`);
5341
5341
  if (max === void 0) {
5342
- gen.if((0, codegen_1._)`${count} >= ${min}`, () => gen.assign(valid, true).break());
5342
+ gen.if((0, codegen_1._)`${count2} >= ${min}`, () => gen.assign(valid, true).break());
5343
5343
  } else {
5344
- gen.if((0, codegen_1._)`${count} > ${max}`, () => gen.assign(valid, false).break());
5344
+ gen.if((0, codegen_1._)`${count2} > ${max}`, () => gen.assign(valid, false).break());
5345
5345
  if (min === 1)
5346
5346
  gen.assign(valid, true);
5347
5347
  else
5348
- gen.if((0, codegen_1._)`${count} >= ${min}`, () => gen.assign(valid, true));
5348
+ gen.if((0, codegen_1._)`${count2} >= ${min}`, () => gen.assign(valid, true));
5349
5349
  }
5350
5350
  }
5351
5351
  }
@@ -8198,8 +8198,8 @@ var require_Node = __commonJS({
8198
8198
  };
8199
8199
  const res = toJS.toJS(this, "", ctx);
8200
8200
  if (typeof onAnchor === "function")
8201
- for (const { count, res: res2 } of ctx.anchors.values())
8202
- onAnchor(res2, count);
8201
+ for (const { count: count2, res: res2 } of ctx.anchors.values())
8202
+ onAnchor(res2, count2);
8203
8203
  return typeof reviver === "function" ? applyReviver.applyReviver(reviver, { "": res }, "", res) : res;
8204
8204
  }
8205
8205
  };
@@ -8305,13 +8305,13 @@ var require_Alias = __commonJS({
8305
8305
  const anchor = anchors2 && source && anchors2.get(source);
8306
8306
  return anchor ? anchor.count * anchor.aliasCount : 0;
8307
8307
  } else if (identity.isCollection(node)) {
8308
- let count = 0;
8308
+ let count2 = 0;
8309
8309
  for (const item of node.items) {
8310
8310
  const c = getAliasCount(doc, item, anchors2);
8311
- if (c > count)
8312
- count = c;
8311
+ if (c > count2)
8312
+ count2 = c;
8313
8313
  }
8314
- return count;
8314
+ return count2;
8315
8315
  } else if (identity.isPair(node)) {
8316
8316
  const kc = getAliasCount(doc, node.key, anchors2);
8317
8317
  const vc = getAliasCount(doc, node.value, anchors2);
@@ -11264,8 +11264,8 @@ var require_Document = __commonJS({
11264
11264
  };
11265
11265
  const res = toJS.toJS(this.contents, jsonArg ?? "", ctx);
11266
11266
  if (typeof onAnchor === "function")
11267
- for (const { count, res: res2 } of ctx.anchors.values())
11268
- onAnchor(res2, count);
11267
+ for (const { count: count2, res: res2 } of ctx.anchors.values())
11268
+ onAnchor(res2, count2);
11269
11269
  return typeof reviver === "function" ? applyReviver.applyReviver(reviver, { "": res }, "", res) : res;
11270
11270
  }
11271
11271
  /**
@@ -11342,12 +11342,12 @@ var require_errors2 = __commonJS({
11342
11342
  lineStr = prev + lineStr;
11343
11343
  }
11344
11344
  if (/[^ ]/.test(lineStr)) {
11345
- let count = 1;
11345
+ let count2 = 1;
11346
11346
  const end = error2.linePos[1];
11347
11347
  if (end?.line === line2 && end.col > col) {
11348
- count = Math.max(1, Math.min(end.col - col, 80 - ci));
11348
+ count2 = Math.max(1, Math.min(end.col - col, 80 - ci));
11349
11349
  }
11350
- const pointer = " ".repeat(ci) + "^".repeat(count);
11350
+ const pointer = " ".repeat(ci) + "^".repeat(count2);
11351
11351
  error2.message += `:
11352
11352
 
11353
11353
  ${lineStr}
@@ -18867,7 +18867,7 @@ var require_filters = __commonJS({
18867
18867
  return r.copySafeness(str2, res);
18868
18868
  }
18869
18869
  _exports.indent = indent;
18870
- function join11(arr, del, attr) {
18870
+ function join12(arr, del, attr) {
18871
18871
  del = del || "";
18872
18872
  if (attr) {
18873
18873
  arr = lib.map(arr, function(v) {
@@ -18876,7 +18876,7 @@ var require_filters = __commonJS({
18876
18876
  }
18877
18877
  return arr.join(del);
18878
18878
  }
18879
- _exports.join = join11;
18879
+ _exports.join = join12;
18880
18880
  function last(arr) {
18881
18881
  return arr[arr.length - 1];
18882
18882
  }
@@ -18985,11 +18985,11 @@ var require_filters = __commonJS({
18985
18985
  return str2;
18986
18986
  }
18987
18987
  var pos = 0;
18988
- var count = 0;
18989
- while (nextIndex > -1 && (maxCount === -1 || count < maxCount)) {
18988
+ var count2 = 0;
18989
+ while (nextIndex > -1 && (maxCount === -1 || count2 < maxCount)) {
18990
18990
  res += str2.substring(pos, nextIndex) + new_;
18991
18991
  pos = nextIndex + old.length;
18992
- count++;
18992
+ count2++;
18993
18993
  nextIndex = str2.indexOf(old, pos);
18994
18994
  }
18995
18995
  if (pos < str2.length) {
@@ -20811,12 +20811,12 @@ var require_chokidar = __commonJS({
20811
20811
  let timeoutObject;
20812
20812
  const clear = () => {
20813
20813
  const item = action.get(path);
20814
- const count = item ? item.count : 0;
20814
+ const count2 = item ? item.count : 0;
20815
20815
  action.delete(path);
20816
20816
  clearTimeout(timeoutObject);
20817
20817
  if (item)
20818
20818
  clearTimeout(item.timeoutObject);
20819
- return count;
20819
+ return count2;
20820
20820
  };
20821
20821
  timeoutObject = setTimeout(clear, timeout);
20822
20822
  const thr = { timeoutObject, clear, count: 0 };
@@ -22182,14 +22182,14 @@ var require_jinja_compat = __commonJS({
22182
22182
  }
22183
22183
  throw new Error("ValueError");
22184
22184
  },
22185
- count: function count(element) {
22186
- var count2 = 0;
22185
+ count: function count2(element) {
22186
+ var count3 = 0;
22187
22187
  for (var i = 0; i < this.length; i++) {
22188
22188
  if (this[i] === element) {
22189
- count2++;
22189
+ count3++;
22190
22190
  }
22191
22191
  }
22192
- return count2;
22192
+ return count3;
22193
22193
  },
22194
22194
  index: function index(element) {
22195
22195
  var i;
@@ -37680,6 +37680,9 @@ var DASHBOARD_WIDGET_SCHEMAS = {
37680
37680
  var Y_AXIS_WIDGET_KINDS = ["area", "line", "bar"];
37681
37681
  var Y_AXIS_MAX_TICKS = 21;
37682
37682
 
37683
+ // ../core/dist/dashboards/title-style.js
37684
+ var WIDGET_TITLE_TONES = ["info", "warning", "critical"];
37685
+
37683
37686
  // src/dashboard-widget-def-schema.ts
37684
37687
  var WidgetDefSchema = external_exports.object({
37685
37688
  id: external_exports.string().describe("Stable id within the dashboard, e.g. 'kpi.revenue' or 'chart.cashflow'."),
@@ -37694,6 +37697,13 @@ var WidgetDefSchema = external_exports.object({
37694
37697
  Exactly one cell per column in every row. state (${TABLE_CELL_STATES.join("|")}) colours the cell. Optional intensity (0-1) shades that state's colour from light to dark for a heatmap (e.g. variance); it needs a non-empty state, and legend ramp: true shows the light-to-dark scale. For a grid coloured by category (e.g. work type), map each category to a state and name it in legend.`
37695
37698
  ),
37696
37699
  title: external_exports.string().optional().describe("Title shown above the widget."),
37700
+ // CS-2642: declared for the same reason as y_axis below; z.object would strip it.
37701
+ title_style: external_exports.object({
37702
+ tone: external_exports.enum(WIDGET_TITLE_TONES).optional(),
37703
+ bold: external_exports.boolean().optional()
37704
+ }).strict().optional().describe(
37705
+ `Optional, any kind: make this widget's title stand out, e.g. { tone: "critical", bold: true } for an urgent tile. tone (${WIDGET_TITLE_TONES.join("|")}) colours the title with that theme ink. With no tone, bold: true alone gives the foreground ink; with neither, the title stays the default grey. bold: true gives a heavier, larger title. Colours are not accepted. Use it sparingly: one or two emphasised titles per dashboard.`
37706
+ ),
37697
37707
  prompt: external_exports.string().describe("What future-you reads on every refresh. Tight, specific \u2014 e.g. 'Total Xero revenue last 30 days. value as $N,NNN AUD (whole dollars \u2014 no cents on dashboards), delta vs prior 30d, values = daily revenue.'"),
37698
37708
  refresh_cron: external_exports.string().optional().describe('Optional per-widget cron override (e.g. "0 6 * * *" for 6am daily).'),
37699
37709
  // CS-1708: without this key z.object strips y_axis, and the hint never reaches the host.
@@ -37727,7 +37737,7 @@ function renderKnowledgeBody(content) {
37727
37737
 
37728
37738
  // src/index.ts
37729
37739
  import { homedir as homedir5 } from "os";
37730
- import { isAbsolute as isAbsolute2, join as join10, resolve as pathResolve, sep as sep2 } from "path";
37740
+ import { isAbsolute as isAbsolute2, join as join11, resolve as pathResolve, sep as sep2 } from "path";
37731
37741
 
37732
37742
  // src/agent-status-render.ts
37733
37743
  var STATE_TEXT = {
@@ -47500,7 +47510,7 @@ var ExperimentalMcpServerTasks = class {
47500
47510
 
47501
47511
  // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js
47502
47512
  function toolInputElementCount(value, max) {
47503
- let count = 0;
47513
+ let count2 = 0;
47504
47514
  const stack = [value];
47505
47515
  while (stack.length > 0) {
47506
47516
  const node = stack.pop();
@@ -47508,8 +47518,8 @@ function toolInputElementCount(value, max) {
47508
47518
  continue;
47509
47519
  if (Array.isArray(node)) {
47510
47520
  for (const child of node) {
47511
- if (++count > max)
47512
- return count;
47521
+ if (++count2 > max)
47522
+ return count2;
47513
47523
  if (child !== null && typeof child === "object")
47514
47524
  stack.push(child);
47515
47525
  }
@@ -47517,15 +47527,15 @@ function toolInputElementCount(value, max) {
47517
47527
  for (const key in node) {
47518
47528
  if (!Object.prototype.hasOwnProperty.call(node, key))
47519
47529
  continue;
47520
- if (++count > max)
47521
- return count;
47530
+ if (++count2 > max)
47531
+ return count2;
47522
47532
  const child = node[key];
47523
47533
  if (child !== null && typeof child === "object")
47524
47534
  stack.push(child);
47525
47535
  }
47526
47536
  }
47527
47537
  }
47528
- return count;
47538
+ return count2;
47529
47539
  }
47530
47540
  function resolveMaxToolInputElements(value) {
47531
47541
  if (value === void 0 || value === Infinity)
@@ -49340,10 +49350,10 @@ function formatPeekAge(ageHours) {
49340
49350
  }
49341
49351
  function renderKanbanPeek(data, fallbackTeam) {
49342
49352
  const parts = PEEK_RENDER_COLUMNS.map(([key, label]) => {
49343
- const count = data[key];
49353
+ const count2 = data[key];
49344
49354
  const oldest = data.oldest?.[key];
49345
49355
  const age = oldest === void 0 ? "" : ` (oldest ${formatPeekAge(oldest.age_hours)}, id ${oldest.card_id})`;
49346
- return `${label}: ${count}${age}`;
49356
+ return `${label}: ${count2}${age}`;
49347
49357
  });
49348
49358
  const where = data.cross_team ? ` on team ${data.target_team ?? fallbackTeam ?? "?"}` : "";
49349
49359
  return `${data.target_agent}${where} \u2014 ${parts.join(" \xB7 ")}`;
@@ -49886,7 +49896,7 @@ function startToolCatalogWatch(deps) {
49886
49896
  let unverified = deps.initialVerified === false;
49887
49897
  let waiting = false;
49888
49898
  let stopped = false;
49889
- const read = () => {
49899
+ const read2 = () => {
49890
49900
  try {
49891
49901
  const v = deps.readVersion();
49892
49902
  return typeof v === "string" && v.length > 0 ? v : void 0;
@@ -49928,7 +49938,7 @@ function startToolCatalogWatch(deps) {
49928
49938
  };
49929
49939
  const poll2 = () => {
49930
49940
  if (stopped) return;
49931
- const current = read();
49941
+ const current = read2();
49932
49942
  if (current !== void 0 && current !== baseline) {
49933
49943
  if (baseline === void 0 && !unverified) {
49934
49944
  log(`augmented-mcp: tool catalog version ${current} adopted as baseline`);
@@ -49991,6 +50001,87 @@ function isInContainer(env2 = process.env) {
49991
50001
  return raw === "true" || raw === "1";
49992
50002
  }
49993
50003
 
50004
+ // src/container-limits.ts
50005
+ import { readFileSync as readFileSync8 } from "fs";
50006
+ import { join as join10 } from "path";
50007
+ var V1_UNLIMITED_BYTES = 2 ** 62;
50008
+ function read(path) {
50009
+ try {
50010
+ return readFileSync8(path, "utf8").trim();
50011
+ } catch {
50012
+ return null;
50013
+ }
50014
+ }
50015
+ function count(raw) {
50016
+ if (raw === null) return "unknown";
50017
+ if (raw === "max") return "max";
50018
+ return /^\d+$/.test(raw) ? Number(raw) : "unknown";
50019
+ }
50020
+ function parseCpuMax(raw) {
50021
+ if (raw === null) return "unknown";
50022
+ const m = /^(\d+|max)\s+(\d+)$/.exec(raw);
50023
+ if (!m) return "unknown";
50024
+ if (m[1] === "max") return "max";
50025
+ const period = Number(m[2]);
50026
+ return period > 0 ? Math.round(Number(m[1]) / period * 100) / 100 : "unknown";
50027
+ }
50028
+ function readContainerLimits(root = "/sys/fs/cgroup", env2 = process.env) {
50029
+ if (!isInContainer(env2)) {
50030
+ return { isolated: false, memory_bytes: "max", cpus: "max", pids_max: "max", source: "none" };
50031
+ }
50032
+ const v2 = {
50033
+ memory: read(join10(root, "memory.max")),
50034
+ cpu: read(join10(root, "cpu.max")),
50035
+ pids: read(join10(root, "pids.max")),
50036
+ marker: read(join10(root, "cgroup.controllers"))
50037
+ };
50038
+ if (v2.memory !== null || v2.cpu !== null || v2.pids !== null || v2.marker !== null) {
50039
+ return {
50040
+ isolated: true,
50041
+ memory_bytes: count(v2.memory),
50042
+ cpus: parseCpuMax(v2.cpu),
50043
+ pids_max: count(v2.pids),
50044
+ source: "cgroup-v2"
50045
+ };
50046
+ }
50047
+ const v1Memory = read(join10(root, "memory", "memory.limit_in_bytes"));
50048
+ const quota = read(join10(root, "cpu", "cpu.cfs_quota_us"));
50049
+ const period = read(join10(root, "cpu", "cpu.cfs_period_us"));
50050
+ const v1Pids = read(join10(root, "pids", "pids.max"));
50051
+ if (v1Memory !== null || quota !== null || period !== null || v1Pids !== null) {
50052
+ const memory = count(v1Memory);
50053
+ const cpus = quota === null || period === null || !/^-?\d+$/.test(quota) || !/^\d+$/.test(period) ? "unknown" : quota === "-1" ? "max" : Number(period) > 0 ? Math.round(Number(quota) / Number(period) * 100) / 100 : "unknown";
50054
+ return {
50055
+ isolated: true,
50056
+ memory_bytes: typeof memory === "number" && memory >= V1_UNLIMITED_BYTES ? "max" : memory,
50057
+ cpus,
50058
+ pids_max: count(v1Pids),
50059
+ source: "cgroup-v1"
50060
+ };
50061
+ }
50062
+ return { isolated: true, memory_bytes: "unknown", cpus: "unknown", pids_max: "unknown", source: "none" };
50063
+ }
50064
+ var gib = (b) => `${Math.round(b / 1024 ** 3 * 100) / 100} GiB`;
50065
+ function renderContainerLimits(l) {
50066
+ if (!l.isolated) {
50067
+ return "You are not running in an isolated container, so no container caps apply: the host's own memory, CPU and process limits are yours.";
50068
+ }
50069
+ const show = (v, fmt, none) => v === "max" ? none : v === "unknown" ? "unknown (could not be read)" : fmt(v);
50070
+ const lines = [
50071
+ `Memory: ${show(l.memory_bytes, gib, "no cap")}`,
50072
+ `CPUs: ${show(l.cpus, (c) => String(c), "no cap")}`,
50073
+ `Processes and threads: ${show(l.pids_max, (p2) => String(p2), "no cap")}`,
50074
+ `(read from ${l.source === "none" ? "no readable cgroup files" : l.source})`,
50075
+ "",
50076
+ "These are the limits the kernel enforces on you. `free`, `top` and /proc/meminfo inside this container show the HOST's memory, not yours.",
50077
+ // CodeRabbit on #7836: an OOM can kill one process without restarting the
50078
+ // container (memory.oom.group=0), so say what CAN happen, and where to see
50079
+ // whether a restart DID.
50080
+ "A job that needs more memory than this can be killed without warning: at the cap the kernel kills processes in this container, and that may take the whole container down and restart it. Check agent_restart_history to see whether a restart actually happened. Size heavy work (video renders, large builds, big datasets) to fit, or ask for the advanced class."
50081
+ ];
50082
+ return lines.join("\n");
50083
+ }
50084
+
49994
50085
  // src/feature-request.ts
49995
50086
  var NEW_CAPABILITY_TYPES = ["integration", "tool", "channel", "capability", "other"];
49996
50087
  var SUPPORT_REQUEST_FEATURE_TYPE = "bug";
@@ -51853,6 +51944,18 @@ server.tool(
51853
51944
  }
51854
51945
  }
51855
51946
  );
51947
+ server.tool(
51948
+ "container_limits",
51949
+ "Your real memory, CPU and process limits. Inside an isolated container `free`, `top` and /proc/meminfo show the HOST's memory, not yours: use this before a heavy job (a video render, a large build, a big dataset) so it fits. A job over the memory cap is killed without warning.",
51950
+ {},
51951
+ async () => {
51952
+ try {
51953
+ return { content: [{ type: "text", text: renderContainerLimits(readContainerLimits()) }] };
51954
+ } catch (err) {
51955
+ return { content: [{ type: "text", text: `Could not read container limits: ${err instanceof Error ? err.message : String(err)}` }], isError: true };
51956
+ }
51957
+ }
51958
+ );
51856
51959
  server.tool(
51857
51960
  "agent_session_status",
51858
51961
  "See what ANOTHER agent's session is doing: mid-turn, idle at its prompt, blocked on a prompt, turn killed or no session, plus its last completed turn and transcript activity. Use it instead of guessing from token usage. An agent on your own team unless you pass `target_team` (which needs a peer grant). If you are its direct manager on the same team you also get its current card title and last tool call, unless it is a manager-only agent. Comes from the host's last report, so check `as of`; `unknown` means no report, not unhealthy.",
@@ -54319,9 +54422,9 @@ async function forwardToolCall(toolName, args) {
54319
54422
  // root to its canonical form so both sides of the comparison are real
54320
54423
  // paths. Falls back to the unresolved join if the dir is missing, which
54321
54424
  // then simply refuses (there is nothing to read anyway).
54322
- agentDir: canonicalAgentDir(join10(homedir5(), ".augmented", AGT_AGENT_CODE_NAME)),
54425
+ agentDir: canonicalAgentDir(join11(homedir5(), ".augmented", AGT_AGENT_CODE_NAME)),
54323
54426
  // agent-dir-allow: immediately realpath-resolved to the ADR-0049 agent_id-keyed dir before use as a containment root
54324
- path: { isAbsolute: isAbsolute2, resolve: pathResolve, join: join10, sep: sep2 },
54427
+ path: { isAbsolute: isAbsolute2, resolve: pathResolve, join: join11, sep: sep2 },
54325
54428
  // O_NOFOLLOW is the whole point of opening by flags: the path is already
54326
54429
  // symlink-resolved, so a symlink at the final component means it was
54327
54430
  // swapped after the check, and this turns that into an ELOOP.
@@ -54359,14 +54462,14 @@ async function forwardToolCall(toolName, args) {
54359
54462
  // exploitable primitive within reach of the next change.
54360
54463
  readFdSync: (fd, maxBytes) => {
54361
54464
  const buf = Buffer.alloc(maxBytes + 1);
54362
- let read = 0;
54465
+ let read2 = 0;
54363
54466
  for (; ; ) {
54364
- const n = readSync(fd, buf, read, buf.length - read, null);
54467
+ const n = readSync(fd, buf, read2, buf.length - read2, null);
54365
54468
  if (n <= 0) break;
54366
- read += n;
54367
- if (read >= buf.length) break;
54469
+ read2 += n;
54470
+ if (read2 >= buf.length) break;
54368
54471
  }
54369
- return buf.subarray(0, read);
54472
+ return buf.subarray(0, read2);
54370
54473
  },
54371
54474
  decodeUtf8: (bytes) => Buffer.from(bytes).toString("utf8")
54372
54475
  }
@@ -54393,6 +54496,8 @@ async function forwardToolCall(toolName, args) {
54393
54496
  );
54394
54497
  }
54395
54498
  var LOCAL_TOOL_NAMES = /* @__PURE__ */ new Set([
54499
+ // ENG-12321: read from the container's own cgroup files, never forwarded.
54500
+ "container_limits",
54396
54501
  // ENG-6452: generic agent-approval seam (always registered locally).
54397
54502
  "request_approval",
54398
54503
  "check_approval",
@@ -54824,7 +54929,7 @@ async function saveArtefactSourceToFile(artefactId) {
54824
54929
  };
54825
54930
  let result = await readOnce();
54826
54931
  if (result.revisionState !== "stable") result = await readOnce();
54827
- const filePath = join10(dir, safeDownloadName(`${artefactId}.html`, `${artefactId}.html`));
54932
+ const filePath = join11(dir, safeDownloadName(`${artefactId}.html`, `${artefactId}.html`));
54828
54933
  await writeFile(filePath, result.html, "utf8");
54829
54934
  return {
54830
54935
  path: filePath,
@@ -54901,7 +55006,7 @@ async function exportArtefactToFile(dir, artefactId, format, item) {
54901
55006
  return { kind: "pending", jobId: outcome.jobId, retryAfterMs: outcome.retryAfterMs };
54902
55007
  }
54903
55008
  const fallback = `${artefactId}${item !== void 0 ? `-item-${item + 1}` : ""}.${format}`;
54904
- const filePath = join10(dir, safeDownloadName(outcome.body.filename, fallback));
55009
+ const filePath = join11(dir, safeDownloadName(outcome.body.filename, fallback));
54905
55010
  const buf = Buffer.from(outcome.body.base64, "base64");
54906
55011
  await writeFile(filePath, buf);
54907
55012
  return {
@@ -54935,10 +55040,10 @@ async function downloadArtefactText(params) {
54935
55040
  if (params.format === "pdf") {
54936
55041
  items = [void 0];
54937
55042
  } else if (params.item === void 0) {
54938
- const { count, total } = await resolveItemCountForPng(params.artefact_id);
54939
- if (count > 1) {
54940
- items = Array.from({ length: count }, (_, i) => i);
54941
- if (total > count) truncatedFrom = total;
55043
+ const { count: count2, total } = await resolveItemCountForPng(params.artefact_id);
55044
+ if (count2 > 1) {
55045
+ items = Array.from({ length: count2 }, (_, i) => i);
55046
+ if (total > count2) truncatedFrom = total;
54942
55047
  } else {
54943
55048
  items = [void 0];
54944
55049
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integrity-labs/agt-cli",
3
- "version": "0.28.1299",
3
+ "version": "0.28.1301",
4
4
  "description": "Augmented Team CLI — agent provisioning and management",
5
5
  "type": "module",
6
6
  "engines": {