@integrity-labs/agt-cli 0.28.1308 → 0.28.1310

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 (30) hide show
  1. package/dist/{api-client-QHGAABOL.js → api-client-A3QUGSNM.js} +3 -3
  2. package/dist/bin/agt.js +7 -7
  3. package/dist/{chunk-GZT7DHPV.js → chunk-6WALYNWT.js} +3 -3
  4. package/dist/{chunk-JZOA4A3J.js → chunk-B762DH5R.js} +2 -2
  5. package/dist/{chunk-HMH4EOV5.js → chunk-PN5AZVKG.js} +15 -9
  6. package/dist/chunk-PN5AZVKG.js.map +1 -0
  7. package/dist/{chunk-NXTNYNNV.js → chunk-QSND4PGO.js} +2 -2
  8. package/dist/{chunk-VSJUMNQ5.js → chunk-V4LGFXJD.js} +28 -8
  9. package/dist/{chunk-VSJUMNQ5.js.map → chunk-V4LGFXJD.js.map} +1 -1
  10. package/dist/{chunk-WW2CTOEO.js → chunk-XSXBOLMK.js} +1 -1
  11. package/dist/chunk-XSXBOLMK.js.map +1 -0
  12. package/dist/{claude-code-updater-OU4AEM5Y.js → claude-code-updater-MC24BHPQ.js} +3 -3
  13. package/dist/{claude-pair-runtime-H7A7ZOEW.js → claude-pair-runtime-DI4N4NQ5.js} +3 -3
  14. package/dist/lib/manager-worker.js +53 -25
  15. package/dist/lib/manager-worker.js.map +1 -1
  16. package/dist/{persistent-session-OUCTECWP.js → persistent-session-WRHN2XP6.js} +4 -4
  17. package/dist/{responsiveness-probe-SC72APRB.js → responsiveness-probe-ZH5C4LKK.js} +4 -4
  18. package/dist/{session-auth-dead-MQR2SLW5.js → session-auth-dead-ZZO7YYU7.js} +3 -3
  19. package/package.json +1 -1
  20. package/dist/chunk-HMH4EOV5.js.map +0 -1
  21. package/dist/chunk-WW2CTOEO.js.map +0 -1
  22. /package/dist/{api-client-QHGAABOL.js.map → api-client-A3QUGSNM.js.map} +0 -0
  23. /package/dist/{chunk-GZT7DHPV.js.map → chunk-6WALYNWT.js.map} +0 -0
  24. /package/dist/{chunk-JZOA4A3J.js.map → chunk-B762DH5R.js.map} +0 -0
  25. /package/dist/{chunk-NXTNYNNV.js.map → chunk-QSND4PGO.js.map} +0 -0
  26. /package/dist/{claude-code-updater-OU4AEM5Y.js.map → claude-code-updater-MC24BHPQ.js.map} +0 -0
  27. /package/dist/{claude-pair-runtime-H7A7ZOEW.js.map → claude-pair-runtime-DI4N4NQ5.js.map} +0 -0
  28. /package/dist/{persistent-session-OUCTECWP.js.map → persistent-session-WRHN2XP6.js.map} +0 -0
  29. /package/dist/{responsiveness-probe-SC72APRB.js.map → responsiveness-probe-ZH5C4LKK.js.map} +0 -0
  30. /package/dist/{session-auth-dead-MQR2SLW5.js.map → session-auth-dead-ZZO7YYU7.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  encodeClaudeProjectPath
3
- } from "./chunk-WW2CTOEO.js";
3
+ } from "./chunk-XSXBOLMK.js";
4
4
 
5
5
  // src/lib/daily-session.ts
6
6
  import { randomUUID } from "crypto";
@@ -245,4 +245,4 @@ export {
245
245
  peekPreviousSession,
246
246
  readDailySessionPin
247
247
  };
248
- //# sourceMappingURL=chunk-NXTNYNNV.js.map
248
+ //# sourceMappingURL=chunk-QSND4PGO.js.map
@@ -4,7 +4,7 @@ import {
4
4
  rotateDailySession,
5
5
  sessionFileExists,
6
6
  todayLocalIso
7
- } from "./chunk-NXTNYNNV.js";
7
+ } from "./chunk-QSND4PGO.js";
8
8
  import {
9
9
  classifyUnanswerablePane,
10
10
  customApiKeyDialogKeys,
@@ -54,7 +54,7 @@ import {
54
54
  remoteMcpConnectionEnvInfix,
55
55
  remoteMcpConnectionLabel,
56
56
  remoteMcpConnectionScopedEnvVar
57
- } from "./chunk-WW2CTOEO.js";
57
+ } from "./chunk-XSXBOLMK.js";
58
58
  import {
59
59
  CLAUDE_CONFIG_DIR_ENV,
60
60
  approveApiKeyInClaudeConfig,
@@ -1162,11 +1162,22 @@ function isOAuthRemoteMcpDefinition(definitionId) {
1162
1162
  return false;
1163
1163
  return Boolean(OAUTH_PROVIDERS[definitionId]?.mcpUrl);
1164
1164
  }
1165
- function buildOAuthRemoteMcpProxyEntry(definitionId, paths, connectionKey, toolTiers, brokerIntegrationId, brokerAgentId) {
1165
+ function oauthProxyToolAllowlist(providerAllowlist, granted) {
1166
+ const base = providerAllowlist && providerAllowlist.length > 0 ? [...providerAllowlist] : [];
1167
+ if (granted === void 0)
1168
+ return base;
1169
+ const grantedSet = new Set(granted.filter((n) => typeof n === "string" && n.trim() !== "" && !n.includes(",")).map((n) => n.trim()));
1170
+ const out = base.length > 0 ? base.filter((n) => grantedSet.has(n)) : [...grantedSet];
1171
+ return out.length > 0 ? out : "none";
1172
+ }
1173
+ function buildOAuthRemoteMcpProxyEntry(definitionId, paths, connectionKey, toolTiers, brokerIntegrationId, brokerAgentId, options = {}) {
1166
1174
  if (!isOAuthRemoteMcpDefinition(definitionId))
1167
1175
  return null;
1168
1176
  const provider = OAUTH_PROVIDERS[definitionId];
1169
1177
  const mcpUrl = provider.mcpUrl;
1178
+ const allowlist = oauthProxyToolAllowlist(provider.toolAllowlist, options.grantedTools);
1179
+ if (allowlist === "none")
1180
+ return null;
1170
1181
  return {
1171
1182
  command: "node",
1172
1183
  args: [paths.proxyPath],
@@ -1185,7 +1196,9 @@ function buildOAuthRemoteMcpProxyEntry(definitionId, paths, connectionKey, toolT
1185
1196
  // ENG-6948: cap the agent's exposed surface to the curated allowlist. The
1186
1197
  // proxy filters tools/list and gates tools/call against this set. Omitted
1187
1198
  // when the provider has no allowlist, leaving the proxy a pass-through.
1188
- ...provider.toolAllowlist && provider.toolAllowlist.length > 0 ? { AGT_REMOTE_MCP_TOOL_ALLOWLIST: provider.toolAllowlist.join(",") } : {},
1199
+ // ENG-12314: narrowed further to the install's granted tools when the API
1200
+ // sent them, so a denied scope's tools are neither advertised nor called.
1201
+ ...allowlist.length > 0 ? { AGT_REMOTE_MCP_TOOL_ALLOWLIST: allowlist.join(",") } : {},
1189
1202
  // CS-1446: toolsets to pre-activate at session start so gated tools are
1190
1203
  // advertised in the connect-time tools/list the harness freezes. Omitted
1191
1204
  // when the provider configures none (no pre-enable, the default).
@@ -1207,9 +1220,11 @@ function requiresRemoteMcpToolGate(definitionId, dbSpec) {
1207
1220
  const spec = dbSpec ?? INTEGRATION_REGISTRY.find((d) => d.id === definitionId)?.remoteMcp;
1208
1221
  return spec?.requireToolTiers === true;
1209
1222
  }
1210
- function mustNotRenderDirectRemoteMcp(definitionId, dbSpec) {
1223
+ function mustNotRenderDirectRemoteMcp(definitionId, dbSpec, grantedTools) {
1211
1224
  if (requiresRemoteMcpToolGate(definitionId, dbSpec))
1212
1225
  return true;
1226
+ if (grantedTools !== void 0)
1227
+ return true;
1213
1228
  const spec = dbSpec ?? INTEGRATION_REGISTRY.find((d) => d.id === definitionId)?.remoteMcp;
1214
1229
  return hasToolAllowlistField(spec);
1215
1230
  }
@@ -1218,9 +1233,14 @@ function withheldRemoteMcpReasonFor(integration) {
1218
1233
  return "no_tier_table";
1219
1234
  if (hasToolAllowlistField(integration.remoteMcp))
1220
1235
  return "tool_allowlist_unrendered";
1236
+ if (integration.grantedTools !== void 0)
1237
+ return "oauth_tool_grant_unrendered";
1221
1238
  return integration.toolTiers == null ? "no_tier_table" : "no_gated_tool";
1222
1239
  }
1223
1240
  function withheldRemoteMcpMessage(definitionId, reason) {
1241
+ if (reason === "oauth_tool_grant_unrendered") {
1242
+ return `[provisioning] ENG-12314: OAuth remote MCP '${definitionId}' WITHHELD: the agent was granted only some of its scopes, and no proxy entry could enforce them (no granted tool is on the provider allowlist, or this framework cannot gate). It gets no entry rather than one serving the denied scopes' tools.`;
1243
+ }
1224
1244
  if (reason === "tool_allowlist_unrendered") {
1225
1245
  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.`;
1226
1246
  }
@@ -1404,8 +1424,8 @@ function buildOpencodeIntegrationServers(integrations, ctx) {
1404
1424
  }
1405
1425
  for (const integration of integrations) {
1406
1426
  const def = INTEGRATION_REGISTRY.find((d) => d.id === integration.definition_id);
1407
- if (mustNotRenderDirectRemoteMcp(integration.definition_id, integration.remoteMcp ?? null)) {
1408
- console.error(withheldRemoteMcpMessage(integration.definition_id, hasToolAllowlistField(integration.remoteMcp ?? null) ? "tool_allowlist_unrendered" : "framework_cannot_gate"));
1427
+ if (mustNotRenderDirectRemoteMcp(integration.definition_id, integration.remoteMcp ?? null, integration.grantedTools)) {
1428
+ console.error(withheldRemoteMcpMessage(integration.definition_id, hasToolAllowlistField(integration.remoteMcp ?? null) ? "tool_allowlist_unrendered" : integration.grantedTools !== void 0 ? "oauth_tool_grant_unrendered" : "framework_cannot_gate"));
1409
1429
  continue;
1410
1430
  }
1411
1431
  const remote = buildRemoteMcpEntry(integration.definition_id, integration.remoteMcp ?? null);
@@ -6688,4 +6708,4 @@ export {
6688
6708
  stopAllSessionsAndWait,
6689
6709
  getProjectDir
6690
6710
  };
6691
- //# sourceMappingURL=chunk-VSJUMNQ5.js.map
6711
+ //# sourceMappingURL=chunk-V4LGFXJD.js.map