@integrity-labs/agt-cli 0.28.990 → 0.28.991

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.
Files changed (26) hide show
  1. package/dist/bin/agt.js +5 -5
  2. package/dist/{chunk-TGCA3LTI.js → chunk-C72SNMP6.js} +26 -5
  3. package/dist/chunk-C72SNMP6.js.map +1 -0
  4. package/dist/{chunk-6KYXH6ZZ.js → chunk-DN3KNGP4.js} +68 -6
  5. package/dist/{chunk-6KYXH6ZZ.js.map → chunk-DN3KNGP4.js.map} +1 -1
  6. package/dist/{chunk-P7B5IRH5.js → chunk-RQ3I7GMD.js} +19 -8
  7. package/dist/chunk-RQ3I7GMD.js.map +1 -0
  8. package/dist/{claude-pair-runtime-GQM26I3M.js → claude-pair-runtime-6IA4RPMQ.js} +2 -2
  9. package/dist/lib/manager-worker.js +31 -14
  10. package/dist/lib/manager-worker.js.map +1 -1
  11. package/dist/mcp/direct-chat-channel.js +15 -1
  12. package/dist/mcp/index.js +15 -1
  13. package/dist/mcp/origami.js +15 -1
  14. package/dist/mcp/remote-oauth-proxy.js +120 -29
  15. package/dist/mcp/slack-channel.js +15 -1
  16. package/dist/mcp/telegram-channel.js +15 -1
  17. package/dist/{persistent-session-PYYD53GZ.js → persistent-session-5EDOQC2H.js} +3 -3
  18. package/dist/{responsiveness-probe-JENZOOKG.js → responsiveness-probe-SKX77FST.js} +3 -3
  19. package/dist/{session-auth-dead-BGXRQB27.js → session-auth-dead-XTMVOHUX.js} +2 -2
  20. package/package.json +1 -1
  21. package/dist/chunk-P7B5IRH5.js.map +0 -1
  22. package/dist/chunk-TGCA3LTI.js.map +0 -1
  23. /package/dist/{claude-pair-runtime-GQM26I3M.js.map → claude-pair-runtime-6IA4RPMQ.js.map} +0 -0
  24. /package/dist/{persistent-session-PYYD53GZ.js.map → persistent-session-5EDOQC2H.js.map} +0 -0
  25. /package/dist/{responsiveness-probe-JENZOOKG.js.map → responsiveness-probe-SKX77FST.js.map} +0 -0
  26. /package/dist/{session-auth-dead-BGXRQB27.js.map → session-auth-dead-XTMVOHUX.js.map} +0 -0
@@ -2,11 +2,13 @@ import {
2
2
  INTEGRATION_REGISTRY,
3
3
  OAUTH_PROVIDERS,
4
4
  PLATFORM_STORAGE_RULE,
5
+ REMOTE_MCP_PROXY_ENV,
5
6
  SECRET_PATTERNS,
6
7
  claudeModelAlias,
7
8
  containerMemoryForAgentClass,
8
9
  encodeClaudeProjectPath,
9
10
  getOrCreateDailySession,
11
+ isAutoTier,
10
12
  isClaudeFastMode,
11
13
  isDefaultRemoteMcpConnection,
12
14
  isDeprecatedFramework,
@@ -20,7 +22,7 @@ import {
20
22
  rotateDailySession,
21
23
  sessionFileExists,
22
24
  todayLocalIso
23
- } from "./chunk-TGCA3LTI.js";
25
+ } from "./chunk-C72SNMP6.js";
24
26
  import {
25
27
  classifyUnanswerablePane,
26
28
  findUsageLimitResetHint,
@@ -1017,7 +1019,19 @@ function extractHeaderVarName(value) {
1017
1019
  const m = /^\$\{([A-Za-z_][A-Za-z0-9_]*)\}$/.exec(value.trim());
1018
1020
  return m ? m[1] : null;
1019
1021
  }
1020
- function buildLiveHeaderRemoteMcpProxyEntry(definitionId, dbSpec, paths, connectionKey) {
1022
+ function hasGatedTool(tiers) {
1023
+ if (!tiers)
1024
+ return false;
1025
+ if (Object.keys(tiers).length === 0)
1026
+ return true;
1027
+ return Object.values(tiers).some((tier) => !isAutoTier(tier));
1028
+ }
1029
+ function toolTiersEnv(tiers) {
1030
+ if (!tiers)
1031
+ return {};
1032
+ return { [REMOTE_MCP_PROXY_ENV.toolTiers]: JSON.stringify(tiers) };
1033
+ }
1034
+ function buildLiveHeaderRemoteMcpProxyEntry(definitionId, dbSpec, paths, connectionKey, toolTiers) {
1021
1035
  const spec = dbSpec ?? INTEGRATION_REGISTRY.find((d) => d.id === definitionId)?.remoteMcp;
1022
1036
  if (!spec?.liveHeaderRefresh)
1023
1037
  return null;
@@ -1041,11 +1055,15 @@ function buildLiveHeaderRemoteMcpProxyEntry(definitionId, dbSpec, paths, connect
1041
1055
  AGT_REMOTE_MCP_TOKEN_VAR: credentialEnvVar(definitionId, spec.auth.credential_ref, connectionKey),
1042
1056
  AGT_REMOTE_MCP_AUTH_HEADER: spec.auth.header_name,
1043
1057
  AGT_REMOTE_MCP_LABEL: remoteMcpConnectionLabel(definitionId, connectionKey),
1044
- ...extraPairs.length > 0 ? { AGT_REMOTE_MCP_EXTRA_HEADERS: extraPairs.join(",") } : {}
1058
+ ...extraPairs.length > 0 ? { AGT_REMOTE_MCP_EXTRA_HEADERS: extraPairs.join(",") } : {},
1059
+ // ENG-10614: the catalogued HITL floors. anchor-browser reaches the proxy
1060
+ // via this branch, so this is where its one gated tool
1061
+ // (`anchor_network_requests`, write_high_risk) starts being enforced.
1062
+ ...toolTiersEnv(toolTiers)
1045
1063
  }
1046
1064
  };
1047
1065
  }
1048
- function buildOAuthRemoteMcpProxyEntry(definitionId, paths, connectionKey) {
1066
+ function buildOAuthRemoteMcpProxyEntry(definitionId, paths, connectionKey, toolTiers) {
1049
1067
  const def = INTEGRATION_REGISTRY.find((d) => d.id === definitionId);
1050
1068
  if (def?.remoteMcp)
1051
1069
  return null;
@@ -1073,7 +1091,50 @@ function buildOAuthRemoteMcpProxyEntry(definitionId, paths, connectionKey) {
1073
1091
  // might have picked. Omitted when the provider declares none, leaving the
1074
1092
  // proxy's argument checking entirely off.
1075
1093
  ...provider.argRejects && provider.argRejects.length > 0 ? { AGT_REMOTE_MCP_ARG_REJECTS: JSON.stringify(provider.argRejects) } : {},
1076
- ...provider.preEnableToolsets && provider.preEnableToolsets.length > 0 ? { AGT_REMOTE_MCP_PREENABLE_TOOLSETS: provider.preEnableToolsets.join(",") } : {}
1094
+ ...provider.preEnableToolsets && provider.preEnableToolsets.length > 0 ? { AGT_REMOTE_MCP_PREENABLE_TOOLSETS: provider.preEnableToolsets.join(",") } : {},
1095
+ // ENG-10614: catalogued HITL floors, orthogonal to the allowlist above.
1096
+ // The allowlist answers "may this agent see the tool at all"; this answers
1097
+ // "may it run without a human". A tool can be allowlisted and still gated.
1098
+ ...toolTiersEnv(toolTiers)
1099
+ }
1100
+ };
1101
+ }
1102
+ function buildApiKeyRemoteMcpProxyEntry(definitionId, dbSpec, paths, connectionKey, toolTiers) {
1103
+ if (!hasGatedTool(toolTiers))
1104
+ return null;
1105
+ const spec = dbSpec ?? INTEGRATION_REGISTRY.find((d) => d.id === definitionId)?.remoteMcp;
1106
+ if (!spec)
1107
+ return null;
1108
+ if (spec.liveHeaderRefresh)
1109
+ return null;
1110
+ if (!spec.auth?.credential_ref)
1111
+ return null;
1112
+ assertSafeRemoteMcpUrl(spec.url, definitionId);
1113
+ const tokenVar = credentialEnvVar(definitionId, spec.auth.credential_ref, connectionKey);
1114
+ const scheme = spec.auth.scheme ?? "bearer";
1115
+ if (scheme !== "bearer" && scheme !== "header")
1116
+ return null;
1117
+ if (scheme === "header" && !spec.auth.header_name)
1118
+ return null;
1119
+ const extraPairs = [];
1120
+ for (const [header, value] of Object.entries(spec.headers ?? {})) {
1121
+ const varName = extractHeaderVarName(value);
1122
+ if (!varName) {
1123
+ throw new Error(`remoteMcp for '${definitionId}' declares a literal header '${header}' and also has a gated tool, which the tier-gating proxy cannot render (extra headers must be '\${VAR}' references). Give the header a '\${VAR}' value, or the integration would have to run un-gated.`);
1124
+ }
1125
+ extraPairs.push(`${header}:${remoteMcpConnectionScopedEnvVar(definitionId, varName, connectionKey)}`);
1126
+ }
1127
+ return {
1128
+ command: "node",
1129
+ args: [paths.proxyPath],
1130
+ env: {
1131
+ AGT_REMOTE_MCP_URL: spec.url,
1132
+ AGT_REMOTE_MCP_TOKEN_FILE: paths.tokenFile,
1133
+ AGT_REMOTE_MCP_TOKEN_VAR: tokenVar,
1134
+ AGT_REMOTE_MCP_LABEL: remoteMcpConnectionLabel(definitionId, connectionKey),
1135
+ ...scheme === "header" && spec.auth.header_name ? { AGT_REMOTE_MCP_AUTH_HEADER: spec.auth.header_name } : {},
1136
+ ...extraPairs.length > 0 ? { AGT_REMOTE_MCP_EXTRA_HEADERS: extraPairs.join(",") } : {},
1137
+ ...toolTiersEnv(toolTiers)
1077
1138
  }
1078
1139
  };
1079
1140
  }
@@ -5461,6 +5522,7 @@ export {
5461
5522
  buildRemoteMcpEntry,
5462
5523
  buildLiveHeaderRemoteMcpProxyEntry,
5463
5524
  buildOAuthRemoteMcpProxyEntry,
5525
+ buildApiKeyRemoteMcpProxyEntry,
5464
5526
  buildNativeMcpEntry,
5465
5527
  shellQuote,
5466
5528
  CHANNEL_SECRET_ENV_KEYS,
@@ -5575,4 +5637,4 @@ export {
5575
5637
  stopAllSessionsAndWait,
5576
5638
  getProjectDir
5577
5639
  };
5578
- //# sourceMappingURL=chunk-6KYXH6ZZ.js.map
5640
+ //# sourceMappingURL=chunk-DN3KNGP4.js.map