@integrity-labs/agt-cli 0.28.497 → 0.28.499

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-I5RQJEM7.js";
43
+ } from "../chunk-Q5O2VAQA.js";
44
44
  import {
45
45
  AnchorSessionClient,
46
46
  CHANNEL_REGISTRY,
@@ -71,7 +71,7 @@ import {
71
71
  requiredMcpWildcard,
72
72
  resolveChannels,
73
73
  serializeManifestForSlackCli
74
- } from "../chunk-UNAP4CMY.js";
74
+ } from "../chunk-5XHO4HKA.js";
75
75
  import "../chunk-XWVM4KPK.js";
76
76
 
77
77
  // src/bin/agt.ts
@@ -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.497" : "dev";
4833
+ var cliVersion = true ? "0.28.499" : "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.497" : "dev";
6005
+ var cliVersion2 = true ? "0.28.499" : "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) => {
@@ -6063,6 +6063,42 @@ function buildForwardHeaders(token, authHeader, extras, readVar) {
6063
6063
  return headers;
6064
6064
  }
6065
6065
 
6066
+ // ../../packages/core/dist/integrations/remote-mcp-connection.js
6067
+ var DEFAULT_REMOTE_MCP_CONNECTION_KEY = "default";
6068
+ function isDefaultRemoteMcpConnection(connectionKey) {
6069
+ return !connectionKey || connectionKey === DEFAULT_REMOTE_MCP_CONNECTION_KEY;
6070
+ }
6071
+ function sanitizeBase(definitionId) {
6072
+ return definitionId.replace(/[^a-z0-9]/gi, "_").toLowerCase();
6073
+ }
6074
+ function remoteMcpServerKey(definitionId, connectionKey) {
6075
+ if (isDefaultRemoteMcpConnection(connectionKey))
6076
+ return definitionId;
6077
+ return `${sanitizeBase(definitionId)}-${connectionKey}`;
6078
+ }
6079
+ function remoteMcpConnectionEnvInfix(connectionKey) {
6080
+ if (isDefaultRemoteMcpConnection(connectionKey))
6081
+ return "";
6082
+ return `__${connectionKey.replace(/-/g, "_").toUpperCase()}`;
6083
+ }
6084
+ function remoteMcpEnvPrefix(definitionId, connectionKey) {
6085
+ const idPart = definitionId.toUpperCase().replace(/[^A-Z0-9]/g, "_");
6086
+ return `${idPart}${remoteMcpConnectionEnvInfix(connectionKey)}`;
6087
+ }
6088
+ function remoteMcpConnectionScopedEnvVar(definitionId, varName, connectionKey) {
6089
+ if (isDefaultRemoteMcpConnection(connectionKey))
6090
+ return varName;
6091
+ const idPart = definitionId.toUpperCase().replace(/[^A-Z0-9]/g, "_");
6092
+ if (!varName.startsWith(`${idPart}_`))
6093
+ return varName;
6094
+ return `${idPart}${remoteMcpConnectionEnvInfix(connectionKey)}_${varName.slice(idPart.length + 1)}`;
6095
+ }
6096
+ function remoteMcpConnectionLabel(definitionId, connectionKey) {
6097
+ if (isDefaultRemoteMcpConnection(connectionKey))
6098
+ return definitionId;
6099
+ return `${definitionId} (${connectionKey})`;
6100
+ }
6101
+
6066
6102
  // ../../packages/core/dist/integrations/registry.js
6067
6103
  var INTEGRATION_REGISTRY = [
6068
6104
  {
@@ -7214,6 +7250,11 @@ var AGENT_DIRECTED_KIND_SET = new Set(AGENT_DIRECTED_NOTICE_KINDS);
7214
7250
  // ../../packages/core/dist/direct-chat/cursor-advance.js
7215
7251
  var CURSOR_SHORTFALL_REASONS = [
7216
7252
  "not_found",
7253
+ // ENG-8348: `/consume` only. The row belongs to this agent+session but was
7254
+ // never claimed, so the caller is acking work it cannot have done — the one
7255
+ // case that route's widened predicate deliberately refuses to advance. It has
7256
+ // to be nameable or the refusal is unmeasurable.
7257
+ "unclaimed",
7217
7258
  "gave_up",
7218
7259
  "already_delivered",
7219
7260
  "error",
@@ -10047,6 +10088,18 @@ var FLAG_REGISTRY = [
10047
10088
  // env var is retired.
10048
10089
  envVar: "AUGMENTED_CONNECTIVITY_ESCALATION_ENABLED"
10049
10090
  },
10091
+ {
10092
+ key: "integration-reauth-reminders",
10093
+ description: "Re-notify an integration that stays in needs_reauth (ENG-8370). Failure notification is at-most-once PER TRANSITION, so an integration nobody repairs is announced once and then silent forever - prod carried a row failing every 30-minute tick for ~21 days on a single day-one notification. When on, the IntegrationReauthReminder cron re-fires the existing reconnect notification on a backoff measured from failure ONSET (+1d, +3d, +7d, then weekly), skipping rows an operator has muted. When off the cron still scans and logs what it WOULD have sent, so the volume can be sized before anyone is messaged. Boolean gate; ships dark.",
10094
+ flagType: "boolean",
10095
+ // `false` is both the pre-ENG-8370 fleet behaviour AND the fail-safe
10096
+ // direction: this flag governs how often real humans get messaged, so a
10097
+ // flag-DB read error must never start sending on its own. Turning it on is
10098
+ // a deliberate per-org act from the admin Feature Flags page, never a
10099
+ // side-effect of a deploy. No env override - net-new gate, registry-only
10100
+ // (ADR-0022).
10101
+ defaultValue: false
10102
+ },
10050
10103
  {
10051
10104
  key: "managed-health-connectivity-flip",
10052
10105
  description: "Arm the managed-connection-health status flip on data-plane hard-down (ENG-7539). When on, the managed-connection-health cron flips a managed integration to needs_reauth when the host-side connectivity probe reports a sustained hard-down (consecutive_connectivity_failures at/over the hysteresis threshold with a down observation), even if Composio account-status still reads ACTIVE. When off it keeps the pre-ENG-7539 behaviour: status is driven only by the account-status probe, so a live 401 behind an ACTIVE account never flips status. Boolean gate; ships dark. Sibling of integration-connectivity-escalation: that flag arms the alert; this flag arms the status flip plus the reconnect notification.",
@@ -10760,13 +10813,14 @@ function generateAgentsMd(input) {
10760
10813
  }
10761
10814
 
10762
10815
  // ../../packages/core/dist/provisioning/remote-mcp.js
10763
- function envVarForToken(definitionId) {
10764
- return `${definitionId.replace(/-/g, "_").toUpperCase()}_ACCESS_TOKEN`;
10816
+ function envVarForToken(definitionId, connectionKey) {
10817
+ const idPart = definitionId.replace(/-/g, "_").toUpperCase();
10818
+ return `${idPart}${remoteMcpConnectionEnvInfix(connectionKey)}_ACCESS_TOKEN`;
10765
10819
  }
10766
- function credentialEnvVar(definitionId, credentialRef) {
10820
+ function credentialEnvVar(definitionId, credentialRef, connectionKey) {
10767
10821
  const idPart = definitionId.replace(/-/g, "_").toUpperCase();
10768
10822
  const credPart = credentialRef.replace(/-/g, "_").toUpperCase();
10769
- return `${idPart}_${credPart}`;
10823
+ return `${idPart}${remoteMcpConnectionEnvInfix(connectionKey)}_${credPart}`;
10770
10824
  }
10771
10825
  function assertSafeRemoteMcpUrl(url, definitionId) {
10772
10826
  let u;
@@ -10787,11 +10841,11 @@ function assertSafeRemoteMcpUrl(url, definitionId) {
10787
10841
  throw new Error(`remoteMcp.url for '${definitionId}' resolves to a disallowed (internal/link-local/metadata) host: ${host}`);
10788
10842
  }
10789
10843
  }
10790
- function renderRemoteMcpSpec(definitionId, spec) {
10844
+ function renderRemoteMcpSpec(definitionId, spec, connectionKey) {
10791
10845
  assertSafeRemoteMcpUrl(spec.url, definitionId);
10792
10846
  const headers = {};
10793
10847
  if (spec.auth) {
10794
- const envVar = credentialEnvVar(definitionId, spec.auth.credential_ref);
10848
+ const envVar = credentialEnvVar(definitionId, spec.auth.credential_ref, connectionKey);
10795
10849
  const value = `\${${envVar}}`;
10796
10850
  if (spec.auth.scheme === "bearer") {
10797
10851
  headers["Authorization"] = `Bearer ${value}`;
@@ -10802,17 +10856,24 @@ function renderRemoteMcpSpec(definitionId, spec) {
10802
10856
  headers[spec.auth.header_name] = value;
10803
10857
  }
10804
10858
  }
10805
- Object.assign(headers, spec.headers ?? {});
10859
+ if (isDefaultRemoteMcpConnection(connectionKey)) {
10860
+ Object.assign(headers, spec.headers ?? {});
10861
+ } else {
10862
+ for (const [header, value] of Object.entries(spec.headers ?? {})) {
10863
+ const varName = extractHeaderVarName(value);
10864
+ headers[header] = varName ? `\${${remoteMcpConnectionScopedEnvVar(definitionId, varName, connectionKey)}}` : value;
10865
+ }
10866
+ }
10806
10867
  return {
10807
10868
  type: spec.type ?? "http",
10808
10869
  url: spec.url,
10809
10870
  ...Object.keys(headers).length > 0 ? { headers } : {}
10810
10871
  };
10811
10872
  }
10812
- function buildRemoteMcpEntry(definitionId, dbSpec) {
10873
+ function buildRemoteMcpEntry(definitionId, dbSpec, connectionKey) {
10813
10874
  const spec = dbSpec ?? INTEGRATION_REGISTRY.find((d) => d.id === definitionId)?.remoteMcp;
10814
10875
  if (spec) {
10815
- return renderRemoteMcpSpec(definitionId, spec);
10876
+ return renderRemoteMcpSpec(definitionId, spec, connectionKey);
10816
10877
  }
10817
10878
  const provider = OAUTH_PROVIDERS[definitionId];
10818
10879
  if (!provider?.mcpUrl)
@@ -10821,7 +10882,7 @@ function buildRemoteMcpEntry(definitionId, dbSpec) {
10821
10882
  type: "http",
10822
10883
  url: provider.mcpUrl,
10823
10884
  headers: {
10824
- Authorization: `Bearer \${${envVarForToken(definitionId)}}`
10885
+ Authorization: `Bearer \${${envVarForToken(definitionId, connectionKey)}}`
10825
10886
  }
10826
10887
  };
10827
10888
  }
@@ -10832,7 +10893,7 @@ function extractHeaderVarName(value) {
10832
10893
  const m = /^\$\{([A-Za-z_][A-Za-z0-9_]*)\}$/.exec(value.trim());
10833
10894
  return m ? m[1] : null;
10834
10895
  }
10835
- function buildLiveHeaderRemoteMcpProxyEntry(definitionId, dbSpec, paths) {
10896
+ function buildLiveHeaderRemoteMcpProxyEntry(definitionId, dbSpec, paths, connectionKey) {
10836
10897
  const spec = dbSpec ?? INTEGRATION_REGISTRY.find((d) => d.id === definitionId)?.remoteMcp;
10837
10898
  if (!spec?.liveHeaderRefresh)
10838
10899
  return null;
@@ -10843,8 +10904,9 @@ function buildLiveHeaderRemoteMcpProxyEntry(definitionId, dbSpec, paths) {
10843
10904
  const extraPairs = [];
10844
10905
  for (const [header, value] of Object.entries(spec.headers ?? {})) {
10845
10906
  const varName = extractHeaderVarName(value);
10846
- if (varName)
10847
- extraPairs.push(`${header}:${varName}`);
10907
+ if (varName) {
10908
+ extraPairs.push(`${header}:${remoteMcpConnectionScopedEnvVar(definitionId, varName, connectionKey)}`);
10909
+ }
10848
10910
  }
10849
10911
  return {
10850
10912
  command: "node",
@@ -10852,14 +10914,14 @@ function buildLiveHeaderRemoteMcpProxyEntry(definitionId, dbSpec, paths) {
10852
10914
  env: {
10853
10915
  AGT_REMOTE_MCP_URL: spec.url,
10854
10916
  AGT_REMOTE_MCP_TOKEN_FILE: paths.tokenFile,
10855
- AGT_REMOTE_MCP_TOKEN_VAR: credentialEnvVar(definitionId, spec.auth.credential_ref),
10917
+ AGT_REMOTE_MCP_TOKEN_VAR: credentialEnvVar(definitionId, spec.auth.credential_ref, connectionKey),
10856
10918
  AGT_REMOTE_MCP_AUTH_HEADER: spec.auth.header_name,
10857
- AGT_REMOTE_MCP_LABEL: definitionId,
10919
+ AGT_REMOTE_MCP_LABEL: remoteMcpConnectionLabel(definitionId, connectionKey),
10858
10920
  ...extraPairs.length > 0 ? { AGT_REMOTE_MCP_EXTRA_HEADERS: extraPairs.join(",") } : {}
10859
10921
  }
10860
10922
  };
10861
10923
  }
10862
- function buildOAuthRemoteMcpProxyEntry(definitionId, paths) {
10924
+ function buildOAuthRemoteMcpProxyEntry(definitionId, paths, connectionKey) {
10863
10925
  const def = INTEGRATION_REGISTRY.find((d) => d.id === definitionId);
10864
10926
  if (def?.remoteMcp)
10865
10927
  return null;
@@ -10872,8 +10934,8 @@ function buildOAuthRemoteMcpProxyEntry(definitionId, paths) {
10872
10934
  env: {
10873
10935
  AGT_REMOTE_MCP_URL: provider.mcpUrl,
10874
10936
  AGT_REMOTE_MCP_TOKEN_FILE: paths.tokenFile,
10875
- AGT_REMOTE_MCP_TOKEN_VAR: envVarForToken(definitionId),
10876
- AGT_REMOTE_MCP_LABEL: definitionId,
10937
+ AGT_REMOTE_MCP_TOKEN_VAR: envVarForToken(definitionId, connectionKey),
10938
+ AGT_REMOTE_MCP_LABEL: remoteMcpConnectionLabel(definitionId, connectionKey),
10877
10939
  // ENG-6948: cap the agent's exposed surface to the curated allowlist. The
10878
10940
  // proxy filters tools/list and gates tools/call against this set. Omitted
10879
10941
  // when the provider has no allowlist, leaving the proxy a pass-through.
@@ -14490,6 +14552,10 @@ export {
14490
14552
  INTEGRATION_REGISTRY,
14491
14553
  getIntegration,
14492
14554
  OAUTH_PROVIDERS,
14555
+ isDefaultRemoteMcpConnection,
14556
+ remoteMcpServerKey,
14557
+ remoteMcpEnvPrefix,
14558
+ remoteMcpConnectionScopedEnvVar,
14493
14559
  buildRemoteMcpEntry,
14494
14560
  buildHostBrokeredRemoteMcpEntry,
14495
14561
  buildLiveHeaderRemoteMcpProxyEntry,
@@ -14647,4 +14713,4 @@ export {
14647
14713
  stopAllSessionsAndWait,
14648
14714
  getProjectDir
14649
14715
  };
14650
- //# sourceMappingURL=chunk-UNAP4CMY.js.map
14716
+ //# sourceMappingURL=chunk-5XHO4HKA.js.map