@integrity-labs/agt-cli 0.28.471 → 0.28.472

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-SJ7HNXKL.js";
43
+ } from "../chunk-KCU4ZTE4.js";
44
44
  import {
45
45
  AnchorSessionClient,
46
46
  CHANNEL_REGISTRY,
@@ -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.471" : "dev";
4833
+ var cliVersion = true ? "0.28.472" : "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.471" : "dev";
6005
+ var cliVersion2 = true ? "0.28.472" : "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) => {
@@ -4932,7 +4932,7 @@ function exchangeFailureKind(err) {
4932
4932
  }
4933
4933
 
4934
4934
  // src/lib/api-client.ts
4935
- var agtCliVersion = true ? "0.28.471" : "dev";
4935
+ var agtCliVersion = true ? "0.28.472" : "dev";
4936
4936
  var lastConfigHash = null;
4937
4937
  function setConfigHash(hash) {
4938
4938
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -7661,4 +7661,4 @@ export {
7661
7661
  managerInstallSystemUnitCommand,
7662
7662
  managerUninstallSystemUnitCommand
7663
7663
  };
7664
- //# sourceMappingURL=chunk-SJ7HNXKL.js.map
7664
+ //# sourceMappingURL=chunk-KCU4ZTE4.js.map
@@ -44,7 +44,7 @@ import {
44
44
  resolveEffectivePinRaw,
45
45
  safeWriteJsonAtomic,
46
46
  setConfigHash
47
- } from "../chunk-SJ7HNXKL.js";
47
+ } from "../chunk-KCU4ZTE4.js";
48
48
  import {
49
49
  getProjectDir as getProjectDir2,
50
50
  getReadyTasks,
@@ -10038,7 +10038,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
10038
10038
  var lastVersionCheckAt = 0;
10039
10039
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
10040
10040
  var lastResponsivenessProbeAt = 0;
10041
- var agtCliVersion = true ? "0.28.471" : "dev";
10041
+ var agtCliVersion = true ? "0.28.472" : "dev";
10042
10042
  function resolveBrewPath(execFileSync2) {
10043
10043
  try {
10044
10044
  const out = execFileSync2("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -39,14 +39,27 @@ function parsePreEnableToolsets(raw) {
39
39
  }
40
40
  return out;
41
41
  }
42
+ var ACTIVATION_TOOL = "enable_toolset";
42
43
  function buildEnableToolsetRequest(toolset) {
43
44
  return JSON.stringify({
44
45
  jsonrpc: "2.0",
45
46
  id: `agt-preenable-${toolset}`,
46
47
  method: "tools/call",
47
- params: { name: "enable_toolset", arguments: { name: toolset } }
48
+ params: { name: ACTIVATION_TOOL, arguments: { name: toolset } }
48
49
  });
49
50
  }
51
+ function stripActivationTool(tools) {
52
+ return tools.filter((t) => toolName(t) !== ACTIVATION_TOOL);
53
+ }
54
+ function isManagedActivationCall(method, params) {
55
+ if (method !== "tools/call") return false;
56
+ const name = params && typeof params === "object" && typeof params.name === "string" ? params.name : "";
57
+ return name === ACTIVATION_TOOL;
58
+ }
59
+ function activationRefusalMessage(label2, managed) {
60
+ const groups = managed.length > 0 ? managed.join(", ") : "none";
61
+ return `${label2}: toolset activation is managed by this connection, not by the agent. This connection manages these toolsets, and their tools are already in this session's tool list: ${groups}. Calling ${ACTIVATION_TOOL} cannot add a callable tool \u2014 the tool list is fixed for the session, so anything it reported as "newly available" would still answer "No such tool available". Call the tool you need directly; if it is not in your tool list, it is not enabled for this integration.`;
62
+ }
50
63
  function buildToolsListRequest() {
51
64
  return JSON.stringify({ jsonrpc: "2.0", id: "agt-union-list", method: "tools/list", params: {} });
52
65
  }
@@ -250,6 +263,10 @@ function ensureUnionManifest(token) {
250
263
  return unionOnce;
251
264
  }
252
265
  async function forward(line, id, isNotification, method, params) {
266
+ if (preEnableToolsets.length > 0 && isManagedActivationCall(method, params)) {
267
+ logErr(`refused agent-issued ${ACTIVATION_TOOL} (activation is proxy-managed)`);
268
+ return isNotification ? [] : [jsonRpcError(id, -32601, activationRefusalMessage(label, preEnableToolsets))];
269
+ }
253
270
  const token = readCurrentToken(tokenFile, tokenVar);
254
271
  if (!token) {
255
272
  logErr(`no token in ${tokenFile} (var ${tokenVar})`);
@@ -259,6 +276,7 @@ async function forward(line, id, isNotification, method, params) {
259
276
  await ensureUnionManifest(token);
260
277
  let tools = [...unionToolByName.values()];
261
278
  if (toolAllowlist.size > 0) tools = tools.filter((t) => toolAllowlist.has(toolName(t)));
279
+ tools = stripActivationTool(tools);
262
280
  return [JSON.stringify({ jsonrpc: "2.0", id: id ?? null, result: { tools } })];
263
281
  }
264
282
  if (method === "tools/call" && preEnableToolsets.length > 0) {
@@ -384,12 +402,16 @@ if (invokedDirectly) {
384
402
  void main();
385
403
  }
386
404
  export {
405
+ ACTIVATION_TOOL,
406
+ activationRefusalMessage,
387
407
  buildEnableToolsetRequest,
388
408
  buildForwardHeaders,
389
409
  buildToolsListRequest,
390
410
  extractJsonRpcMessages,
391
411
  extractToolsArray,
392
412
  filterToolsListMessage,
413
+ forward,
414
+ isManagedActivationCall,
393
415
  isToolCallBlocked,
394
416
  main,
395
417
  parseEnableToolsetResponse,
@@ -397,5 +419,6 @@ export {
397
419
  parsePreEnableToolsets,
398
420
  parseToolAllowlist,
399
421
  readCurrentToken,
422
+ stripActivationTool,
400
423
  toolName
401
424
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integrity-labs/agt-cli",
3
- "version": "0.28.471",
3
+ "version": "0.28.472",
4
4
  "description": "Augmented Team CLI — agent provisioning and management",
5
5
  "type": "module",
6
6
  "engines": {