@integrity-labs/agt-cli 0.28.401 → 0.28.402

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-24P2BKOV.js";
43
+ } from "../chunk-CVID4T6Q.js";
44
44
  import {
45
45
  AnchorSessionClient,
46
46
  CHANNEL_REGISTRY,
@@ -4829,7 +4829,7 @@ import { execFileSync, execSync } from "child_process";
4829
4829
  import { existsSync as existsSync10, realpathSync as realpathSync2 } from "fs";
4830
4830
  import chalk18 from "chalk";
4831
4831
  import ora16 from "ora";
4832
- var cliVersion = true ? "0.28.401" : "dev";
4832
+ var cliVersion = true ? "0.28.402" : "dev";
4833
4833
  async function fetchLatestVersion() {
4834
4834
  const host2 = getHost();
4835
4835
  if (!host2) return null;
@@ -6001,7 +6001,7 @@ function handleError(err) {
6001
6001
  }
6002
6002
 
6003
6003
  // src/bin/agt.ts
6004
- var cliVersion2 = true ? "0.28.401" : "dev";
6004
+ var cliVersion2 = true ? "0.28.402" : "dev";
6005
6005
  var program = new Command();
6006
6006
  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");
6007
6007
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -6213,7 +6213,7 @@ function requireHost() {
6213
6213
  }
6214
6214
 
6215
6215
  // src/lib/api-client.ts
6216
- var agtCliVersion = true ? "0.28.401" : "dev";
6216
+ var agtCliVersion = true ? "0.28.402" : "dev";
6217
6217
  var lastConfigHash = null;
6218
6218
  function setConfigHash(hash) {
6219
6219
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -7455,71 +7455,78 @@ function runCliProbe(binary, args, opts = {}) {
7455
7455
  }
7456
7456
 
7457
7457
  // src/lib/connectivity-probe-context.ts
7458
+ function resolveHttpServerEntry(entry, env) {
7459
+ const unresolved = /* @__PURE__ */ new Set();
7460
+ const sub = (value) => {
7461
+ if (!env) return value;
7462
+ const r = expandTemplateVars(value, env);
7463
+ for (const name of r.unresolved) unresolved.add(name);
7464
+ return r.value;
7465
+ };
7466
+ if (typeof entry.url === "string" && (entry.type === "http" || entry.type === void 0)) {
7467
+ const url = sub(entry.url);
7468
+ let headers;
7469
+ if (entry.headers) {
7470
+ headers = {};
7471
+ for (const [k, v] of Object.entries(entry.headers)) headers[k] = sub(v);
7472
+ }
7473
+ return { url, ...headers ? { headers } : {}, unresolved: [...unresolved] };
7474
+ }
7475
+ const proxyUrl = entry.env?.["AGT_REMOTE_MCP_URL"];
7476
+ const tokenVar = entry.env?.["AGT_REMOTE_MCP_TOKEN_VAR"];
7477
+ if (entry.command && typeof proxyUrl === "string" && typeof tokenVar === "string") {
7478
+ const url = sub(proxyUrl);
7479
+ const bearer = sub(`\${${tokenVar}}`);
7480
+ return { url, headers: { Authorization: `Bearer ${bearer}` }, unresolved: [...unresolved] };
7481
+ }
7482
+ return null;
7483
+ }
7458
7484
  function readMcpHttpServerConfig(projectDir, serverKey, env) {
7459
7485
  try {
7460
7486
  const raw = readFileSync6(join5(projectDir, ".mcp.json"), "utf-8");
7461
7487
  const servers = JSON.parse(raw).mcpServers ?? {};
7462
7488
  const entry = servers[serverKey];
7463
7489
  if (!entry) return null;
7464
- const unresolved = /* @__PURE__ */ new Set();
7465
- const sub = (value) => {
7466
- if (!env) return value;
7467
- const r = expandTemplateVars(value, env);
7468
- for (const name of r.unresolved) unresolved.add(name);
7469
- return r.value;
7470
- };
7471
- if (typeof entry.url === "string" && (entry.type === "http" || entry.type === void 0)) {
7472
- const url = sub(entry.url);
7473
- let headers;
7474
- if (entry.headers) {
7475
- headers = {};
7476
- for (const [k, v] of Object.entries(entry.headers)) headers[k] = sub(v);
7477
- }
7478
- return { url, ...headers ? { headers } : {}, unresolved: [...unresolved] };
7479
- }
7480
- const proxyUrl = entry.env?.["AGT_REMOTE_MCP_URL"];
7481
- const tokenVar = entry.env?.["AGT_REMOTE_MCP_TOKEN_VAR"];
7482
- if (entry.command && typeof proxyUrl === "string" && typeof tokenVar === "string") {
7483
- const url = sub(proxyUrl);
7484
- const bearer = sub(`\${${tokenVar}}`);
7485
- return { url, headers: { Authorization: `Bearer ${bearer}` }, unresolved: [...unresolved] };
7486
- }
7487
- return null;
7490
+ return resolveHttpServerEntry(entry, env);
7488
7491
  } catch {
7489
7492
  return null;
7490
7493
  }
7491
7494
  }
7495
+ function resolveStdioServerEntry(entry, env) {
7496
+ if (typeof entry.command !== "string") return null;
7497
+ const unresolved = /* @__PURE__ */ new Set();
7498
+ const sub = (value) => {
7499
+ if (!env) return value;
7500
+ const r = expandTemplateVars(value, env);
7501
+ for (const name of r.unresolved) if (!LATE_BOUND_VARS.has(name)) unresolved.add(name);
7502
+ return r.value;
7503
+ };
7504
+ const resolvedEnv = {};
7505
+ for (const [k, v] of Object.entries(entry.env ?? {})) {
7506
+ if (!env) {
7507
+ resolvedEnv[k] = v;
7508
+ continue;
7509
+ }
7510
+ const r = expandTemplateVars(v, env);
7511
+ const hardUnresolved = r.unresolved.filter((name) => !LATE_BOUND_VARS.has(name));
7512
+ for (const name of hardUnresolved) unresolved.add(name);
7513
+ if (hardUnresolved.length === 0 && r.unresolved.length > 0) continue;
7514
+ resolvedEnv[k] = r.value;
7515
+ }
7516
+ return {
7517
+ command: entry.command,
7518
+ args: (entry.args ?? []).map(sub),
7519
+ env: resolvedEnv,
7520
+ unresolved: [...unresolved]
7521
+ };
7522
+ }
7492
7523
  function readMcpStdioServerConfig(projectDir, serverKey, env) {
7493
7524
  try {
7494
7525
  const raw = readFileSync6(join5(projectDir, ".mcp.json"), "utf-8");
7495
7526
  const servers = JSON.parse(raw).mcpServers ?? {};
7496
7527
  const entry = servers[serverKey];
7497
- if (!entry || typeof entry.command !== "string") return null;
7498
- const unresolved = /* @__PURE__ */ new Set();
7499
- const sub = (value) => {
7500
- if (!env) return value;
7501
- const r = expandTemplateVars(value, env);
7502
- for (const name of r.unresolved) if (!LATE_BOUND_VARS.has(name)) unresolved.add(name);
7503
- return r.value;
7504
- };
7505
- const resolvedEnv = {};
7506
- for (const [k, v] of Object.entries(entry.env ?? {})) {
7507
- if (!env) {
7508
- resolvedEnv[k] = v;
7509
- continue;
7510
- }
7511
- const r = expandTemplateVars(v, env);
7512
- const hardUnresolved = r.unresolved.filter((name) => !LATE_BOUND_VARS.has(name));
7513
- for (const name of hardUnresolved) unresolved.add(name);
7514
- if (hardUnresolved.length === 0 && r.unresolved.length > 0) continue;
7515
- resolvedEnv[k] = r.value;
7516
- }
7517
- return {
7518
- command: entry.command,
7519
- args: (entry.args ?? []).map(sub),
7520
- env: resolvedEnv,
7521
- unresolved: [...unresolved]
7522
- };
7528
+ if (!entry) return null;
7529
+ return resolveStdioServerEntry(entry, env);
7523
7530
  } catch {
7524
7531
  return null;
7525
7532
  }
@@ -7552,9 +7559,10 @@ function buildConnectivityProbeDeps(projectDir, probeEnv) {
7552
7559
  fetchImpl: fetch,
7553
7560
  runCli: (binary, args) => runCliProbe(binary, args, { env: probeEnv }),
7554
7561
  mcpProbe: async (target) => {
7555
- const cfg = readMcpHttpServerConfig(projectDir, target.serverKey, probeEnv);
7562
+ const cfg = target.inlineServerEntry ? resolveHttpServerEntry(target.inlineServerEntry, probeEnv) : readMcpHttpServerConfig(projectDir, target.serverKey, probeEnv);
7556
7563
  if (!cfg) {
7557
- return { status: "transient_error", message: `MCP server '${target.serverKey}' not resolvable from .mcp.json` };
7564
+ const src = target.inlineServerEntry ? "inline config" : ".mcp.json";
7565
+ return { status: "transient_error", message: `MCP server '${target.serverKey}' not resolvable from ${src}` };
7558
7566
  }
7559
7567
  if (cfg.unresolved.length > 0) {
7560
7568
  return {
@@ -7571,9 +7579,10 @@ function buildConnectivityProbeDeps(projectDir, probeEnv) {
7571
7579
  // env → skip as non-escalating, never spawn a doomed server. A missing
7572
7580
  // server entry is a real `down` — the tools aren't wired.
7573
7581
  mcpStdioProbe: async (target) => {
7574
- const cfg = readMcpStdioServerConfig(projectDir, target.serverKey, probeEnv);
7582
+ const cfg = target.inlineServerEntry ? resolveStdioServerEntry(target.inlineServerEntry, probeEnv) : readMcpStdioServerConfig(projectDir, target.serverKey, probeEnv);
7575
7583
  if (!cfg) {
7576
- return { status: "down", message: `MCP stdio server '${target.serverKey}' not wired in .mcp.json` };
7584
+ const src = target.inlineServerEntry ? "inline config" : ".mcp.json";
7585
+ return { status: "down", message: `MCP stdio server '${target.serverKey}' not wired in ${src}` };
7577
7586
  }
7578
7587
  if (cfg.unresolved.length > 0) {
7579
7588
  return {
@@ -7595,10 +7604,11 @@ function buildConnectivityProbeDeps(projectDir, probeEnv) {
7595
7604
  // queries with. Inputs come from the agent's OWN wired MCP server: the
7596
7605
  // `x-api-key` header and the `user_id` query param (the agent already
7597
7606
  // authenticates with these), plus the recorded connected_account_id.
7598
- composioProbe: async (serverKey, credentials) => {
7599
- const cfg = readMcpHttpServerConfig(projectDir, serverKey, probeEnv);
7607
+ composioProbe: async (serverKey, credentials, inlineServerEntry) => {
7608
+ const cfg = inlineServerEntry ? resolveHttpServerEntry(inlineServerEntry, probeEnv) : readMcpHttpServerConfig(projectDir, serverKey, probeEnv);
7600
7609
  if (!cfg) {
7601
- return { status: "transient_error", message: `MCP server '${serverKey}' not resolvable from .mcp.json` };
7610
+ const src = inlineServerEntry ? "inline config" : ".mcp.json";
7611
+ return { status: "transient_error", message: `MCP server '${serverKey}' not resolvable from ${src}` };
7602
7612
  }
7603
7613
  if (cfg.unresolved.length > 0) {
7604
7614
  return {
@@ -7625,7 +7635,7 @@ function buildConnectivityProbeDeps(projectDir, probeEnv) {
7625
7635
  // linkage surfaces as a real `No connected account found` instead of a
7626
7636
  // green handshake. Skips (`null`) when no safe read-only tool is callable.
7627
7637
  composioToolCallProbe: async (target) => {
7628
- const cfg = readMcpHttpServerConfig(projectDir, target.serverKey, probeEnv);
7638
+ const cfg = target.inlineServerEntry ? resolveHttpServerEntry(target.inlineServerEntry, probeEnv) : readMcpHttpServerConfig(projectDir, target.serverKey, probeEnv);
7629
7639
  if (!cfg) return null;
7630
7640
  if (cfg.unresolved.length > 0) return null;
7631
7641
  return probeComposioMcpToolCall({
@@ -8549,24 +8559,26 @@ async function executeConnectivityProbe(target, deps = {}) {
8549
8559
  return probeHttpProvider(target.definitionId, target.credentials, deps.fetchImpl ?? fetch);
8550
8560
  case "composio_account":
8551
8561
  if (!deps.composioProbe) return null;
8552
- return deps.composioProbe(target.mcpServerKey ?? target.definitionId, target.credentials);
8562
+ return deps.composioProbe(target.mcpServerKey ?? target.definitionId, target.credentials, target.inlineServerEntry);
8553
8563
  case "managed_composite": {
8554
8564
  const outcomes = [];
8555
8565
  if (deps.mcpProbe) {
8556
8566
  outcomes.push(
8557
8567
  await deps.mcpProbe({
8558
8568
  serverKey: target.mcpServerKey ?? target.definitionId,
8559
- definitionId: target.definitionId
8569
+ definitionId: target.definitionId,
8570
+ inlineServerEntry: target.inlineServerEntry
8560
8571
  })
8561
8572
  );
8562
8573
  }
8563
8574
  if (deps.composioProbe) {
8564
- outcomes.push(await deps.composioProbe(target.mcpServerKey ?? target.definitionId, target.credentials));
8575
+ outcomes.push(await deps.composioProbe(target.mcpServerKey ?? target.definitionId, target.credentials, target.inlineServerEntry));
8565
8576
  }
8566
8577
  if (deps.composioToolCallProbe) {
8567
8578
  const toolCall = await deps.composioToolCallProbe({
8568
8579
  serverKey: target.mcpServerKey ?? target.definitionId,
8569
8580
  definitionId: target.definitionId,
8581
+ inlineServerEntry: target.inlineServerEntry,
8570
8582
  // ENG-6242: thread the prescribed tool through to the live tool-call
8571
8583
  // leg. resolveConnectivityProbe only sets these for managed toolkits
8572
8584
  // with a stored override; the probe re-validates read-only and falls
@@ -8583,13 +8595,15 @@ async function executeConnectivityProbe(target, deps = {}) {
8583
8595
  if (!deps.mcpProbe) return null;
8584
8596
  return deps.mcpProbe({
8585
8597
  serverKey: target.mcpServerKey ?? target.definitionId,
8586
- definitionId: target.definitionId
8598
+ definitionId: target.definitionId,
8599
+ inlineServerEntry: target.inlineServerEntry
8587
8600
  });
8588
8601
  case "mcp_stdio":
8589
8602
  if (!deps.mcpStdioProbe) return null;
8590
8603
  return deps.mcpStdioProbe({
8591
8604
  serverKey: target.mcpServerKey ?? target.definitionId,
8592
8605
  definitionId: target.definitionId,
8606
+ inlineServerEntry: target.inlineServerEntry,
8593
8607
  toolName: descriptor.probeTool ?? null,
8594
8608
  toolArgs: descriptor.probeArgs ?? null
8595
8609
  });
@@ -8679,4 +8693,4 @@ export {
8679
8693
  managerInstallSystemUnitCommand,
8680
8694
  managerUninstallSystemUnitCommand
8681
8695
  };
8682
- //# sourceMappingURL=chunk-24P2BKOV.js.map
8696
+ //# sourceMappingURL=chunk-CVID4T6Q.js.map