@integrity-labs/agt-cli 0.28.1309 → 0.28.1311

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-OU7NANHC.js → api-client-LJIV4E3U.js} +3 -3
  2. package/dist/bin/agt.js +7 -7
  3. package/dist/{chunk-VSJUMNQ5.js → chunk-AATR5MO7.js} +30 -9
  4. package/dist/{chunk-VSJUMNQ5.js.map → chunk-AATR5MO7.js.map} +1 -1
  5. package/dist/{chunk-JZOA4A3J.js → chunk-C35ONIOM.js} +2 -2
  6. package/dist/{chunk-WW2CTOEO.js → chunk-DTGNYXYM.js} +1 -1
  7. package/dist/chunk-DTGNYXYM.js.map +1 -0
  8. package/dist/{chunk-GODP7VNT.js → chunk-LNLKOJC5.js} +15 -9
  9. package/dist/chunk-LNLKOJC5.js.map +1 -0
  10. package/dist/{chunk-LZZNWEAC.js → chunk-NYBVFW7X.js} +3 -3
  11. package/dist/{chunk-NXTNYNNV.js → chunk-PRSMP7YW.js} +2 -2
  12. package/dist/{claude-code-updater-OU4AEM5Y.js → claude-code-updater-QRAOQLXJ.js} +3 -3
  13. package/dist/{claude-pair-runtime-H7A7ZOEW.js → claude-pair-runtime-ZI2LPY5E.js} +3 -3
  14. package/dist/lib/manager-worker.js +46 -24
  15. package/dist/lib/manager-worker.js.map +1 -1
  16. package/dist/{persistent-session-OUCTECWP.js → persistent-session-ADLDX7QL.js} +4 -4
  17. package/dist/{responsiveness-probe-SC72APRB.js → responsiveness-probe-ETVF2D2O.js} +4 -4
  18. package/dist/{session-auth-dead-MQR2SLW5.js → session-auth-dead-36OZTRBJ.js} +3 -3
  19. package/package.json +1 -1
  20. package/dist/chunk-GODP7VNT.js.map +0 -1
  21. package/dist/chunk-WW2CTOEO.js.map +0 -1
  22. /package/dist/{api-client-OU7NANHC.js.map → api-client-LJIV4E3U.js.map} +0 -0
  23. /package/dist/{chunk-JZOA4A3J.js.map → chunk-C35ONIOM.js.map} +0 -0
  24. /package/dist/{chunk-LZZNWEAC.js.map → chunk-NYBVFW7X.js.map} +0 -0
  25. /package/dist/{chunk-NXTNYNNV.js.map → chunk-PRSMP7YW.js.map} +0 -0
  26. /package/dist/{claude-code-updater-OU4AEM5Y.js.map → claude-code-updater-QRAOQLXJ.js.map} +0 -0
  27. /package/dist/{claude-pair-runtime-H7A7ZOEW.js.map → claude-pair-runtime-ZI2LPY5E.js.map} +0 -0
  28. /package/dist/{persistent-session-OUCTECWP.js.map → persistent-session-ADLDX7QL.js.map} +0 -0
  29. /package/dist/{responsiveness-probe-SC72APRB.js.map → responsiveness-probe-ETVF2D2O.js.map} +0 -0
  30. /package/dist/{session-auth-dead-MQR2SLW5.js.map → session-auth-dead-36OZTRBJ.js.map} +0 -0
@@ -15,8 +15,8 @@ import {
15
15
  mintRotatedHostKey,
16
16
  probeHostKey,
17
17
  setConfigHash
18
- } from "./chunk-LZZNWEAC.js";
19
- import "./chunk-WW2CTOEO.js";
18
+ } from "./chunk-NYBVFW7X.js";
19
+ import "./chunk-DTGNYXYM.js";
20
20
  import "./chunk-DGUM43GV.js";
21
21
  export {
22
22
  ApiError,
@@ -36,4 +36,4 @@ export {
36
36
  probeHostKey,
37
37
  setConfigHash
38
38
  };
39
- //# sourceMappingURL=api-client-OU7NANHC.js.map
39
+ //# sourceMappingURL=api-client-LJIV4E3U.js.map
package/dist/bin/agt.js CHANGED
@@ -31,7 +31,7 @@ import {
31
31
  success,
32
32
  table,
33
33
  warn
34
- } from "../chunk-GODP7VNT.js";
34
+ } from "../chunk-LNLKOJC5.js";
35
35
  import {
36
36
  ApiError,
37
37
  PROD_AGT_HOST,
@@ -42,17 +42,17 @@ import {
42
42
  getHost,
43
43
  getHostId,
44
44
  setActiveTeam
45
- } from "../chunk-LZZNWEAC.js";
45
+ } from "../chunk-NYBVFW7X.js";
46
46
  import {
47
47
  getProjectDir,
48
48
  isSessionResumeDisabled,
49
49
  readDirectChatSessionState
50
- } from "../chunk-VSJUMNQ5.js";
50
+ } from "../chunk-AATR5MO7.js";
51
51
  import {
52
52
  markDailySessionSpawn,
53
53
  sessionFileExists,
54
54
  sessionTranscriptDir
55
- } from "../chunk-NXTNYNNV.js";
55
+ } from "../chunk-PRSMP7YW.js";
56
56
  import "../chunk-XL2HPM67.js";
57
57
  import "../chunk-6HBXEJHO.js";
58
58
  import "../chunk-XWVM4KPK.js";
@@ -85,7 +85,7 @@ import {
85
85
  requiredMcpWildcard,
86
86
  resolveChannels,
87
87
  serializeManifestForSlackCli
88
- } from "../chunk-WW2CTOEO.js";
88
+ } from "../chunk-DTGNYXYM.js";
89
89
  import "../chunk-AIUIMEUS.js";
90
90
  import "../chunk-DGUM43GV.js";
91
91
 
@@ -5207,7 +5207,7 @@ import { execFileSync, execSync } from "child_process";
5207
5207
  import { existsSync as existsSync10, realpathSync as realpathSync2 } from "fs";
5208
5208
  import chalk17 from "chalk";
5209
5209
  import ora15 from "ora";
5210
- var cliVersion = true ? "0.28.1309" : "dev";
5210
+ var cliVersion = true ? "0.28.1311" : "dev";
5211
5211
  async function fetchLatestVersion() {
5212
5212
  const host2 = getHost();
5213
5213
  if (!host2) return null;
@@ -6467,7 +6467,7 @@ function handleError(err) {
6467
6467
  }
6468
6468
 
6469
6469
  // src/bin/agt.ts
6470
- var cliVersion2 = true ? "0.28.1309" : "dev";
6470
+ var cliVersion2 = true ? "0.28.1311" : "dev";
6471
6471
  var program = new Command();
6472
6472
  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");
6473
6473
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -4,7 +4,7 @@ import {
4
4
  rotateDailySession,
5
5
  sessionFileExists,
6
6
  todayLocalIso
7
- } from "./chunk-NXTNYNNV.js";
7
+ } from "./chunk-PRSMP7YW.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-DTGNYXYM.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);
@@ -3827,6 +3847,7 @@ function resolveModelPolicySpawnEnv(input) {
3827
3847
  const projectSettings = projectSettingsForRole(policy, active.role);
3828
3848
  const modelNote = Object.keys(modelEnv).length > 0 ? ` models=${Object.entries(modelEnv).map(([k, v]) => `${k}=${v}`).join(" ")}` : "";
3829
3849
  const advisorNote = Object.keys(projectSettings).length > 0 ? ` project-settings=${Object.entries(projectSettings).map(([k, v]) => `${k}=${v}`).join(" ")}` : "";
3850
+ const noPrimaryModelNote = modelEnv.ANTHROPIC_MODEL ? "" : Object.keys(modelEnv).length === 0 ? " models=none - this policy names NO primary model: the agent's own --model alias is NOT overridden, so the policy is not choosing what crosses this gateway" : " - but NO primary model: the agent's --model alias is suppressed by the rows above and nothing replaces it, so the policy is not choosing what crosses this gateway";
3830
3851
  const resolution = resolveBindingCredential(active, gatewayToken);
3831
3852
  switch (resolution.kind) {
3832
3853
  case "gateway":
@@ -3857,7 +3878,7 @@ function resolveModelPolicySpawnEnv(input) {
3857
3878
  },
3858
3879
  modelEnv,
3859
3880
  projectSettings,
3860
- notice: `[model-policy] '${codeName}' inference via gateway ${resolution.baseUrl} (policy '${policy.name}' rev ${policy.revision}, from ${policy.resolvedFrom})${roleNote}${modelNote}${advisorNote}`
3881
+ notice: `[model-policy] '${codeName}' inference via gateway ${resolution.baseUrl} (policy '${policy.name}' rev ${policy.revision}, from ${policy.resolvedFrom})${roleNote}${modelNote}${advisorNote}${noPrimaryModelNote}`
3861
3882
  };
3862
3883
  case "blocked":
3863
3884
  return {
@@ -6688,4 +6709,4 @@ export {
6688
6709
  stopAllSessionsAndWait,
6689
6710
  getProjectDir
6690
6711
  };
6691
- //# sourceMappingURL=chunk-VSJUMNQ5.js.map
6712
+ //# sourceMappingURL=chunk-AATR5MO7.js.map