@integrity-labs/agt-cli 0.28.1078 → 0.28.1079

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,12 +40,12 @@ import {
40
40
  success,
41
41
  table,
42
42
  warn
43
- } from "../chunk-R5IN7H32.js";
43
+ } from "../chunk-TTSW5ZM2.js";
44
44
  import {
45
45
  getProjectDir,
46
46
  isSessionResumeDisabled,
47
47
  readDirectChatSessionState
48
- } from "../chunk-PJWMW6ET.js";
48
+ } from "../chunk-OGMCA67P.js";
49
49
  import {
50
50
  AnchorSessionClient,
51
51
  CHANNEL_REGISTRY,
@@ -79,7 +79,7 @@ import {
79
79
  serializeManifestForSlackCli,
80
80
  sessionFileExists,
81
81
  sessionTranscriptDir
82
- } from "../chunk-UDJINPUK.js";
82
+ } from "../chunk-5SASCNYV.js";
83
83
  import "../chunk-OCMJ5E6J.js";
84
84
  import "../chunk-XWVM4KPK.js";
85
85
  import "../chunk-EL5MWGGH.js";
@@ -5474,7 +5474,7 @@ import { execFileSync, execSync } from "child_process";
5474
5474
  import { existsSync as existsSync11, realpathSync as realpathSync2 } from "fs";
5475
5475
  import chalk18 from "chalk";
5476
5476
  import ora16 from "ora";
5477
- var cliVersion = true ? "0.28.1078" : "dev";
5477
+ var cliVersion = true ? "0.28.1079" : "dev";
5478
5478
  async function fetchLatestVersion() {
5479
5479
  const host2 = getHost();
5480
5480
  if (!host2) return null;
@@ -6734,7 +6734,7 @@ function handleError(err) {
6734
6734
  }
6735
6735
 
6736
6736
  // src/bin/agt.ts
6737
- var cliVersion2 = true ? "0.28.1078" : "dev";
6737
+ var cliVersion2 = true ? "0.28.1079" : "dev";
6738
6738
  var program = new Command();
6739
6739
  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");
6740
6740
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -1225,16 +1225,18 @@ var REQUIRE_APPROVAL_HOW = {
1225
1225
  ` with the request_id and act only once it is approved; if it is denied or expires, do`,
1226
1226
  ` not act, and tell the user. Never just say you are waiting for, or cannot reach, your`,
1227
1227
  ` manager without filing the request. If \`request_approval\` fails, say so and leave the`,
1228
- ` action undone. For an email, pass \`detail.email\` = { to, from, subject } so your`,
1229
- ` manager sees who it goes to.`
1228
+ ` action undone.`
1230
1229
  ],
1231
1230
  warn: [
1232
1231
  ` When one of these actions is not clearly justified, ask rather than decline: call`,
1233
1232
  ` \`request_approval\` (it goes to your manager), end your turn, and act only once`,
1234
- ` \`check_approval\` says it is approved. For an email, pass \`detail.email\` =`,
1235
- ` { to, from, subject }.`
1233
+ ` \`check_approval\` says it is approved.`
1236
1234
  ]
1237
1235
  };
1236
+ var REQUIRE_APPROVAL_EMAIL_DETAIL = [
1237
+ ` For an email, pass \`detail.email\` = { to, from, subject } so your manager sees who it`,
1238
+ ` goes to.`
1239
+ ];
1238
1240
  var REQUIRE_APPROVAL_EMAIL_ACTION = "send_email";
1239
1241
  var EMAIL_REQUIRE_APPROVAL_DEF = "email.require_approval";
1240
1242
  function liveEmailHoldActions(guardrails) {
@@ -1251,7 +1253,8 @@ function requireApprovalEmailException(covered) {
1251
1253
  ` email approval hold puts every such send in front of a human, so for those do not call`,
1252
1254
  ` \`request_approval\` and do not decline on this guardrail's basis. Attempt the send and let`,
1253
1255
  ` that hold decide; asking first would make your manager approve the same email twice. Any`,
1254
- ` other way of sending email is not held: ask first with \`request_approval\`.`
1256
+ ` other way of sending email is not held: ask first with \`request_approval\`, and when you`,
1257
+ ` do, pass \`detail.email\` = { to, from, subject } so your manager sees who it goes to.`
1255
1258
  ];
1256
1259
  }
1257
1260
  function requireApprovalActions(config) {
@@ -1265,9 +1268,11 @@ function requireApprovalHowLines(g, level, emailHold) {
1265
1268
  const actions = requireApprovalActions(g.config);
1266
1269
  const namesEmail = actions === null || actions.includes(REQUIRE_APPROVAL_EMAIL_ACTION);
1267
1270
  const namesOther = actions === null || actions.some((a) => a !== REQUIRE_APPROVAL_EMAIL_ACTION);
1268
- const ask = namesOther || namesEmail && emailHold === null;
1271
+ const asksAboutEmail = namesEmail && emailHold === null;
1272
+ const ask = namesOther || asksAboutEmail;
1269
1273
  return [
1270
1274
  ...ask ? REQUIRE_APPROVAL_HOW[level] : [],
1275
+ ...asksAboutEmail ? REQUIRE_APPROVAL_EMAIL_DETAIL : [],
1271
1276
  ...namesEmail && emailHold !== null ? requireApprovalEmailException(emailHold) : []
1272
1277
  ];
1273
1278
  }
@@ -7153,6 +7158,17 @@ var FLAG_REGISTRY = [
7153
7158
  // It widens who may DECIDE an approval, so it is a control, not a display toggle.
7154
7159
  sensitive: true
7155
7160
  },
7161
+ {
7162
+ key: "approval-unified-authority",
7163
+ description: "One authority check for every approval ingress (ENG-11207, ADR-0124 Phase 0b): canDecide() runs inside tryDispatchApprovalCore for console, Slack (channel, alerts, Socket Mode, which also carries Telegram) and Direct Chat taps alike. off = not computed. shadow = compute the verdict and log approval_authority_would_reject (ingress, verb, org, reason) for every tap it would refuse, then decide exactly as today. enforce = reserved for the per-(org, verb) allowlist slice; until that ships it behaves as shadow. Evaluated per-org. Ships dark.",
7164
+ flagType: "enum",
7165
+ allowedValues: ["off", "shadow", "enforce"],
7166
+ // Safe/default value is `off` (no computation, no extra reads on the tap path). A flag-DB read
7167
+ // error degrades to this, so an outage can never change who may decide.
7168
+ defaultValue: "off",
7169
+ // Its enforce value will refuse approvals, so mutating it is worth confirming.
7170
+ sensitive: true
7171
+ },
7156
7172
  {
7157
7173
  key: "slack-reply-binding",
7158
7174
  description: "Slack reply-target binding (ENG-7396 / WS2, cross-thread reply routing): the model names which inbound it answers (inbound_id) and the server resolves the destination from its own verified record. shadow = classify + count only, routing unchanged; warn = same routing plus a tool-result note so the model self-corrects; enforce = route a bound reply to the registry thread and REJECT a reply whose target matches no inbound this process delivered. The channel server can't evaluate flags, so the manager materializes the resolved value into the AGT_SLACK_REPLY_BINDING spawn env (the operator/canary override, ADR-0022). Ships shadow.",
@@ -13088,6 +13104,11 @@ var QUOTA_EXHAUSTED_ERROR_PATTERNS = [
13088
13104
  "usage limit",
13089
13105
  "daily limit exceeded"
13090
13106
  ];
13107
+ var PROVIDER_ACCESS_BLOCKED_ERROR_PATTERNS = [
13108
+ "api access blocked",
13109
+ "api access has been blocked",
13110
+ "api access is blocked"
13111
+ ];
13091
13112
  function isReadonlyToolDescriptor(t) {
13092
13113
  if (!t?.name)
13093
13114
  return false;
@@ -13180,6 +13201,10 @@ function formatRetryWindow(seconds) {
13180
13201
  return `about ${Math.round(hours * 10) / 10} hours`;
13181
13202
  return `about ${Math.round(hours / 24 * 10) / 10} days`;
13182
13203
  }
13204
+ function isProviderAccessBlockedError(message) {
13205
+ const m = message.toLowerCase();
13206
+ return PROVIDER_ACCESS_BLOCKED_ERROR_PATTERNS.some((p2) => m.includes(p2));
13207
+ }
13183
13208
  function classifyToolCallFailure(text) {
13184
13209
  if (isAccountResolutionError(text))
13185
13210
  return "account";
@@ -13187,6 +13212,8 @@ function classifyToolCallFailure(text) {
13187
13212
  return "quota";
13188
13213
  if (isScopeDeficitError(text))
13189
13214
  return "scope";
13215
+ if (isProviderAccessBlockedError(text))
13216
+ return "blocked";
13190
13217
  if (isUpstreamAuthError(text))
13191
13218
  return "auth";
13192
13219
  if (isSiteResolutionError(text))
@@ -13339,6 +13366,13 @@ async function probeComposioMcpToolCall(config, fetchImpl = fetch) {
13339
13366
  details: { ...baseDetails, reason: "upstream_auth_rejected" }
13340
13367
  };
13341
13368
  }
13369
+ if (kind === "blocked") {
13370
+ return {
13371
+ status: "degraded",
13372
+ message: `Live tool call '${toolName}' reached the provider, which refused API access for this connection's account or app. The credential itself was accepted, so reconnecting alone will not fix it: check that the connecting user still has a role on the account and that the account is not restricted with the provider, then reconnect: ${snippet}`,
13373
+ details: { ...baseDetails, reason: "provider_access_blocked" }
13374
+ };
13375
+ }
13342
13376
  if (kind === "site") {
13343
13377
  return {
13344
13378
  status: "down",
@@ -13346,6 +13380,13 @@ async function probeComposioMcpToolCall(config, fetchImpl = fetch) {
13346
13380
  details: { ...baseDetails, reason: "site_unresolved" }
13347
13381
  };
13348
13382
  }
13383
+ if (resolved.requestedTool && !resolved.fallback && toolName === resolved.requestedTool) {
13384
+ return {
13385
+ status: "degraded",
13386
+ message: `Live tool call '${toolName}' (this integration's connectivity test) failed with an error the probe does not recognise, so the connection cannot be confirmed working: ${snippet}`,
13387
+ details: { ...baseDetails, reason: "connectivity_test_failed", tool_error: snippet }
13388
+ };
13389
+ }
13349
13390
  return {
13350
13391
  status: "ok",
13351
13392
  message: `Live tool call '${toolName}' resolved the account (tool error: ${snippet})`,
@@ -16158,4 +16199,4 @@ export {
16158
16199
  peekCurrentSession,
16159
16200
  readDailySessionPin
16160
16201
  };
16161
- //# sourceMappingURL=chunk-UDJINPUK.js.map
16202
+ //# sourceMappingURL=chunk-5SASCNYV.js.map