@integrity-labs/agt-cli 0.19.6 → 0.19.8

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
@@ -50,7 +50,7 @@ import {
50
50
  success,
51
51
  table,
52
52
  warn
53
- } from "../chunk-QKLXUYAR.js";
53
+ } from "../chunk-E4TNET3D.js";
54
54
 
55
55
  // src/bin/agt.ts
56
56
  import { join as join10 } from "path";
@@ -3734,7 +3734,7 @@ import { execFileSync, execSync } from "child_process";
3734
3734
  import { existsSync as existsSync5, realpathSync } from "fs";
3735
3735
  import chalk17 from "chalk";
3736
3736
  import ora15 from "ora";
3737
- var cliVersion = true ? "0.19.6" : "dev";
3737
+ var cliVersion = true ? "0.19.8" : "dev";
3738
3738
  async function fetchLatestVersion() {
3739
3739
  const host2 = getHost();
3740
3740
  if (!host2) return null;
@@ -4192,7 +4192,7 @@ function handleError(err) {
4192
4192
  }
4193
4193
 
4194
4194
  // src/bin/agt.ts
4195
- var cliVersion2 = true ? "0.19.6" : "dev";
4195
+ var cliVersion2 = true ? "0.19.8" : "dev";
4196
4196
  var program = new Command();
4197
4197
  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");
4198
4198
  program.hook("preAction", (thisCommand) => {
@@ -8181,4 +8181,4 @@ export {
8181
8181
  managerInstallSystemUnitCommand,
8182
8182
  managerUninstallSystemUnitCommand
8183
8183
  };
8184
- //# sourceMappingURL=chunk-QKLXUYAR.js.map
8184
+ //# sourceMappingURL=chunk-E4TNET3D.js.map
@@ -22,7 +22,7 @@ import {
22
22
  resolveChannels,
23
23
  resolveDmTarget,
24
24
  wrapScheduledTaskPrompt
25
- } from "../chunk-QKLXUYAR.js";
25
+ } from "../chunk-E4TNET3D.js";
26
26
  import {
27
27
  findTaskByTemplate,
28
28
  getProjectDir,
@@ -1630,7 +1630,7 @@ function clearAgentCaches(agentId, codeName) {
1630
1630
  var cachedFrameworkVersion = null;
1631
1631
  var lastVersionCheckAt = 0;
1632
1632
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
1633
- var agtCliVersion = true ? "0.19.6" : "dev";
1633
+ var agtCliVersion = true ? "0.19.8" : "dev";
1634
1634
  function resolveBrewPath(execFileSync2) {
1635
1635
  try {
1636
1636
  const out = execFileSync2("which", ["brew"], { timeout: 5e3 }).toString().trim();
package/mcp/index.js CHANGED
@@ -21125,10 +21125,10 @@ async function getToken() {
21125
21125
  }
21126
21126
  return AGT_TOKEN;
21127
21127
  }
21128
- async function apiPost(path, body, retried = false) {
21129
- const controller = new AbortController();
21130
- const timeout = setTimeout(() => controller.abort(), 15e3);
21128
+ async function apiPost(path, body, retried = false, timeoutMs = 15e3) {
21131
21129
  const token = await getToken();
21130
+ const controller = new AbortController();
21131
+ const timeout = setTimeout(() => controller.abort(), timeoutMs);
21132
21132
  try {
21133
21133
  const res = await fetch(`${AGT_HOST}${path}`, {
21134
21134
  method: "POST",
@@ -21142,7 +21142,7 @@ async function apiPost(path, body, retried = false) {
21142
21142
  if (res.status === 401 && AGT_API_KEY && !retried) {
21143
21143
  clearTimeout(timeout);
21144
21144
  tokenExpiresAt = 0;
21145
- return apiPost(path, body, true);
21145
+ return apiPost(path, body, true, timeoutMs);
21146
21146
  }
21147
21147
  if (!res.ok) {
21148
21148
  const text = await res.text().catch(() => res.statusText);
@@ -21151,7 +21151,7 @@ async function apiPost(path, body, retried = false) {
21151
21151
  return await res.json();
21152
21152
  } catch (err) {
21153
21153
  if (err instanceof DOMException && err.name === "AbortError") {
21154
- throw new Error(`API ${path} timed out after 15s`);
21154
+ throw new Error(`API ${path} timed out after ${timeoutMs}ms`);
21155
21155
  }
21156
21156
  throw err;
21157
21157
  } finally {
@@ -22206,37 +22206,38 @@ function priorityLabel(priority) {
22206
22206
  return priority === 1 ? "HIGH" : priority === 3 ? "LOW" : "MED";
22207
22207
  }
22208
22208
  async function discoverApiTools() {
22209
- if (!AGT_AGENT_CODE_NAME) return [];
22210
- const path = `/agents/${encodeURIComponent(AGT_AGENT_CODE_NAME)}/mcp`;
22211
- const body = { jsonrpc: "2.0", id: 1, method: "tools/list" };
22209
+ if (!AGT_AGENT_ID) return [];
22212
22210
  try {
22213
- const res = await apiPost(path, body);
22211
+ const res = await apiPost(
22212
+ "/host/mcp/tools/list",
22213
+ { agent_id: AGT_AGENT_ID }
22214
+ );
22214
22215
  if (res.error) {
22215
- console.error(`augmented-mcp: tools/list returned error ${res.error.code}: ${res.error.message}`);
22216
+ console.error(`augmented-mcp: tools/list returned error: ${res.error}`);
22216
22217
  return [];
22217
22218
  }
22218
- return res.result?.tools ?? [];
22219
+ return res.tools ?? [];
22219
22220
  } catch (err) {
22220
22221
  console.error(`augmented-mcp: tools/list failed: ${err.message}`);
22221
22222
  return [];
22222
22223
  }
22223
22224
  }
22225
+ var FORWARD_TOOL_CALL_TIMEOUT_MS = 35e3;
22224
22226
  async function forwardToolCall(toolName, args) {
22225
- if (!AGT_AGENT_CODE_NAME) {
22226
- throw new Error("Cannot forward tool call: AGT_AGENT_CODE_NAME is not set");
22227
- }
22228
- const path = `/agents/${encodeURIComponent(AGT_AGENT_CODE_NAME)}/mcp`;
22229
- const body = {
22230
- jsonrpc: "2.0",
22231
- id: Date.now(),
22232
- method: "tools/call",
22233
- params: { name: toolName, arguments: args }
22234
- };
22235
- const res = await apiPost(path, body);
22236
- if (res.error) {
22237
- throw new Error(`API tool ${toolName} returned ${res.error.code}: ${res.error.message}`);
22227
+ if (!AGT_AGENT_ID) {
22228
+ throw new Error("Cannot forward tool call: AGT_AGENT_ID is not set");
22238
22229
  }
22239
- return res.result;
22230
+ return apiPost(
22231
+ "/host/mcp/tools/call",
22232
+ {
22233
+ agent_id: AGT_AGENT_ID,
22234
+ name: toolName,
22235
+ arguments: args,
22236
+ run_id: AGT_RUN_ID ?? null
22237
+ },
22238
+ false,
22239
+ FORWARD_TOOL_CALL_TIMEOUT_MS
22240
+ );
22240
22241
  }
22241
22242
  async function registerForwardedApiTools() {
22242
22243
  const apiTools = await discoverApiTools();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integrity-labs/agt-cli",
3
- "version": "0.19.6",
3
+ "version": "0.19.8",
4
4
  "description": "Augmented Team CLI — agent provisioning and management",
5
5
  "type": "module",
6
6
  "engines": {