@integrity-labs/agt-cli 0.28.1254 → 0.28.1256

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 (35) hide show
  1. package/dist/{api-client-EW7NBMWI.js → api-client-U52DMNUZ.js} +3 -3
  2. package/dist/bin/agt.js +7 -7
  3. package/dist/{chunk-AZOT5URF.js → chunk-3DOSUOHP.js} +2 -2
  4. package/dist/{chunk-EWD3K6YD.js → chunk-47XHFW55.js} +14 -2
  5. package/dist/chunk-47XHFW55.js.map +1 -0
  6. package/dist/{chunk-ZDON4IXL.js → chunk-4RTRYTAS.js} +2 -2
  7. package/dist/{chunk-FD3GWWVL.js → chunk-5MAK4D4P.js} +3 -3
  8. package/dist/{chunk-SEXB6LTM.js → chunk-KYA2WIES.js} +15 -13
  9. package/dist/chunk-KYA2WIES.js.map +1 -0
  10. package/dist/{chunk-ZKLOPCWS.js → chunk-SR36GVLZ.js} +56 -9
  11. package/dist/{chunk-ZKLOPCWS.js.map → chunk-SR36GVLZ.js.map} +1 -1
  12. package/dist/{claude-code-updater-CHEL6LOF.js → claude-code-updater-VKTFAUV3.js} +3 -3
  13. package/dist/{claude-pair-runtime-AGJH54AR.js → claude-pair-runtime-WMP5O3JG.js} +3 -3
  14. package/dist/lib/manager-worker.js +29 -22
  15. package/dist/lib/manager-worker.js.map +1 -1
  16. package/dist/mcp/direct-chat-channel.js +13 -1
  17. package/dist/mcp/index.js +13 -1
  18. package/dist/mcp/origami.js +13 -1
  19. package/dist/mcp/slack-channel.js +13 -1
  20. package/dist/mcp/telegram-channel.js +13 -1
  21. package/dist/{persistent-session-HQPQPNPK.js → persistent-session-UXXRNZ74.js} +4 -4
  22. package/dist/{responsiveness-probe-6GNSPLD2.js → responsiveness-probe-X4QJKKRR.js} +4 -4
  23. package/dist/{session-auth-dead-4Z24MU6C.js → session-auth-dead-T4FSSZWG.js} +3 -3
  24. package/package.json +1 -1
  25. package/dist/chunk-EWD3K6YD.js.map +0 -1
  26. package/dist/chunk-SEXB6LTM.js.map +0 -1
  27. /package/dist/{api-client-EW7NBMWI.js.map → api-client-U52DMNUZ.js.map} +0 -0
  28. /package/dist/{chunk-AZOT5URF.js.map → chunk-3DOSUOHP.js.map} +0 -0
  29. /package/dist/{chunk-ZDON4IXL.js.map → chunk-4RTRYTAS.js.map} +0 -0
  30. /package/dist/{chunk-FD3GWWVL.js.map → chunk-5MAK4D4P.js.map} +0 -0
  31. /package/dist/{claude-code-updater-CHEL6LOF.js.map → claude-code-updater-VKTFAUV3.js.map} +0 -0
  32. /package/dist/{claude-pair-runtime-AGJH54AR.js.map → claude-pair-runtime-WMP5O3JG.js.map} +0 -0
  33. /package/dist/{persistent-session-HQPQPNPK.js.map → persistent-session-UXXRNZ74.js.map} +0 -0
  34. /package/dist/{responsiveness-probe-6GNSPLD2.js.map → responsiveness-probe-X4QJKKRR.js.map} +0 -0
  35. /package/dist/{session-auth-dead-4Z24MU6C.js.map → session-auth-dead-T4FSSZWG.js.map} +0 -0
@@ -4,7 +4,7 @@ import {
4
4
  rotateDailySession,
5
5
  sessionFileExists,
6
6
  todayLocalIso
7
- } from "./chunk-ZDON4IXL.js";
7
+ } from "./chunk-4RTRYTAS.js";
8
8
  import {
9
9
  classifyUnanswerablePane,
10
10
  customApiKeyDialogKeys,
@@ -51,7 +51,7 @@ import {
51
51
  remoteMcpConnectionEnvInfix,
52
52
  remoteMcpConnectionLabel,
53
53
  remoteMcpConnectionScopedEnvVar
54
- } from "./chunk-EWD3K6YD.js";
54
+ } from "./chunk-47XHFW55.js";
55
55
  import {
56
56
  CLAUDE_CONFIG_DIR_ENV,
57
57
  approveApiKeyInClaudeConfig,
@@ -1088,6 +1088,23 @@ function hasGatedTool(tiers) {
1088
1088
  return true;
1089
1089
  return Object.values(tiers).some((tier) => !isAutoTier(tier));
1090
1090
  }
1091
+ function remoteMcpToolAllowlist(spec) {
1092
+ const raw = spec?.tool_allowlist;
1093
+ if (!Array.isArray(raw))
1094
+ return null;
1095
+ const names = raw.filter((n) => typeof n === "string" && n.trim() !== "" && !n.includes(",")).map((n) => n.trim());
1096
+ return names.length > 0 ? names : null;
1097
+ }
1098
+ function hasUnusableToolAllowlist(spec) {
1099
+ return hasToolAllowlistField(spec) && remoteMcpToolAllowlist(spec) === null;
1100
+ }
1101
+ function hasToolAllowlistField(spec) {
1102
+ return Array.isArray(spec?.tool_allowlist);
1103
+ }
1104
+ function toolAllowlistEnv(spec) {
1105
+ const names = remoteMcpToolAllowlist(spec);
1106
+ return names ? { [REMOTE_MCP_PROXY_ENV.toolAllowlist]: names.join(",") } : {};
1107
+ }
1091
1108
  function toolTiersEnv(tiers) {
1092
1109
  if (!tiers)
1093
1110
  return {};
@@ -1097,6 +1114,10 @@ function buildLiveHeaderRemoteMcpProxyEntry(definitionId, dbSpec, paths, connect
1097
1114
  const spec = dbSpec ?? INTEGRATION_REGISTRY.find((d) => d.id === definitionId)?.remoteMcp;
1098
1115
  if (!spec?.liveHeaderRefresh)
1099
1116
  return null;
1117
+ if (hasUnusableToolAllowlist(spec))
1118
+ return null;
1119
+ if (requiresRemoteMcpToolGate(definitionId, spec) && toolTiers == null)
1120
+ return null;
1100
1121
  assertSafeRemoteMcpUrl(spec.url, definitionId);
1101
1122
  if (!spec.auth || spec.auth.scheme !== "header" || !spec.auth.header_name) {
1102
1123
  throw new Error(`remoteMcp.liveHeaderRefresh for '${definitionId}' requires a header-scheme 'auth' with a header_name`);
@@ -1121,7 +1142,9 @@ function buildLiveHeaderRemoteMcpProxyEntry(definitionId, dbSpec, paths, connect
1121
1142
  // ENG-10614: the catalogued HITL floors. anchor-browser reaches the proxy
1122
1143
  // via this branch, so this is where its one gated tool
1123
1144
  // (`anchor_network_requests`, write_high_risk) starts being enforced.
1124
- ...toolTiersEnv(toolTiers)
1145
+ ...toolTiersEnv(toolTiers),
1146
+ // ENG-11915: the granted-tool allowlist, when a scope is denied.
1147
+ ...toolAllowlistEnv(spec)
1125
1148
  }
1126
1149
  };
1127
1150
  }
@@ -1176,16 +1199,36 @@ function requiresRemoteMcpToolGate(definitionId, dbSpec) {
1176
1199
  const spec = dbSpec ?? INTEGRATION_REGISTRY.find((d) => d.id === definitionId)?.remoteMcp;
1177
1200
  return spec?.requireToolTiers === true;
1178
1201
  }
1202
+ function mustNotRenderDirectRemoteMcp(definitionId, dbSpec) {
1203
+ if (requiresRemoteMcpToolGate(definitionId, dbSpec))
1204
+ return true;
1205
+ const spec = dbSpec ?? INTEGRATION_REGISTRY.find((d) => d.id === definitionId)?.remoteMcp;
1206
+ return hasToolAllowlistField(spec);
1207
+ }
1208
+ function withheldRemoteMcpReasonFor(integration) {
1209
+ if (integration.remoteMcp?.requireToolTiers === true && integration.toolTiers == null)
1210
+ return "no_tier_table";
1211
+ if (hasToolAllowlistField(integration.remoteMcp))
1212
+ return "tool_allowlist_unrendered";
1213
+ return integration.toolTiers == null ? "no_tier_table" : "no_gated_tool";
1214
+ }
1179
1215
  function withheldRemoteMcpMessage(definitionId, reason) {
1216
+ if (reason === "tool_allowlist_unrendered") {
1217
+ return `[provisioning] ENG-11915: remote MCP '${definitionId}' WITHHELD: the agent was granted only some of its scopes, which only the remote-MCP proxy can enforce, and no proxy entry could be rendered. It gets no entry rather than one serving the denied scopes' tools.`;
1218
+ }
1180
1219
  const why = reason === "no_tier_table" ? "no tool tier table arrived this cycle (did the tool_definitions read fail?)" : reason === "no_gated_tool" ? "its tier table has no gated tool, so no proxy was rendered" : "this framework cannot gate remote MCPs";
1181
1220
  return `[provisioning] CS-1561: remote MCP '${definitionId}' WITHHELD: it requires its tool tier gate and ${why}. It gets no entry rather than an ungated one, so the agent has no ${definitionId} tools until this clears.`;
1182
1221
  }
1183
1222
  function buildApiKeyRemoteMcpProxyEntry(definitionId, dbSpec, paths, connectionKey, toolTiers) {
1184
- if (!hasGatedTool(toolTiers))
1185
- return null;
1186
1223
  const spec = dbSpec ?? INTEGRATION_REGISTRY.find((d) => d.id === definitionId)?.remoteMcp;
1187
1224
  if (!spec)
1188
1225
  return null;
1226
+ if (hasUnusableToolAllowlist(spec))
1227
+ return null;
1228
+ if (!hasGatedTool(toolTiers) && remoteMcpToolAllowlist(spec) === null)
1229
+ return null;
1230
+ if (requiresRemoteMcpToolGate(definitionId, spec) && toolTiers == null)
1231
+ return null;
1189
1232
  if (spec.liveHeaderRefresh)
1190
1233
  return null;
1191
1234
  if (!spec.auth?.credential_ref)
@@ -1215,7 +1258,8 @@ function buildApiKeyRemoteMcpProxyEntry(definitionId, dbSpec, paths, connectionK
1215
1258
  AGT_REMOTE_MCP_LABEL: remoteMcpConnectionLabel(definitionId, connectionKey),
1216
1259
  ...scheme === "header" && spec.auth.header_name ? { AGT_REMOTE_MCP_AUTH_HEADER: spec.auth.header_name } : {},
1217
1260
  ...extraPairs.length > 0 ? { AGT_REMOTE_MCP_EXTRA_HEADERS: extraPairs.join(",") } : {},
1218
- ...toolTiersEnv(toolTiers)
1261
+ ...toolTiersEnv(toolTiers),
1262
+ ...toolAllowlistEnv(spec)
1219
1263
  }
1220
1264
  };
1221
1265
  }
@@ -1352,8 +1396,8 @@ function buildOpencodeIntegrationServers(integrations, ctx) {
1352
1396
  }
1353
1397
  for (const integration of integrations) {
1354
1398
  const def = INTEGRATION_REGISTRY.find((d) => d.id === integration.definition_id);
1355
- if (requiresRemoteMcpToolGate(integration.definition_id, integration.remoteMcp ?? null)) {
1356
- console.error(withheldRemoteMcpMessage(integration.definition_id, "framework_cannot_gate"));
1399
+ if (mustNotRenderDirectRemoteMcp(integration.definition_id, integration.remoteMcp ?? null)) {
1400
+ console.error(withheldRemoteMcpMessage(integration.definition_id, hasToolAllowlistField(integration.remoteMcp ?? null) ? "tool_allowlist_unrendered" : "framework_cannot_gate"));
1357
1401
  continue;
1358
1402
  }
1359
1403
  const remote = buildRemoteMcpEntry(integration.definition_id, integration.remoteMcp ?? null);
@@ -6093,9 +6137,12 @@ export {
6093
6137
  PLATFORM_DENY_PERMISSIONS,
6094
6138
  agentTmpDirFor,
6095
6139
  buildRemoteMcpEntry,
6140
+ hasToolAllowlistField,
6096
6141
  buildLiveHeaderRemoteMcpProxyEntry,
6097
6142
  buildOAuthRemoteMcpProxyEntry,
6098
6143
  requiresRemoteMcpToolGate,
6144
+ mustNotRenderDirectRemoteMcp,
6145
+ withheldRemoteMcpReasonFor,
6099
6146
  withheldRemoteMcpMessage,
6100
6147
  buildApiKeyRemoteMcpProxyEntry,
6101
6148
  buildNativeMcpEntry,
@@ -6230,4 +6277,4 @@ export {
6230
6277
  stopAllSessionsAndWait,
6231
6278
  getProjectDir
6232
6279
  };
6233
- //# sourceMappingURL=chunk-ZKLOPCWS.js.map
6280
+ //# sourceMappingURL=chunk-SR36GVLZ.js.map