@integrity-labs/agt-cli 0.28.635 → 0.28.636

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,10 +40,10 @@ import {
40
40
  success,
41
41
  table,
42
42
  warn
43
- } from "../chunk-J6KQDGWM.js";
43
+ } from "../chunk-KIOTRBOI.js";
44
44
  import {
45
45
  readDirectChatSessionState
46
- } from "../chunk-GNTCOXZG.js";
46
+ } from "../chunk-4HVSMJFM.js";
47
47
  import {
48
48
  AnchorSessionClient,
49
49
  CHANNEL_REGISTRY,
@@ -73,7 +73,7 @@ import {
73
73
  requiredMcpWildcard,
74
74
  resolveChannels,
75
75
  serializeManifestForSlackCli
76
- } from "../chunk-FKG7DIE2.js";
76
+ } from "../chunk-O4ADFO57.js";
77
77
  import "../chunk-XWVM4KPK.js";
78
78
 
79
79
  // src/bin/agt.ts
@@ -4909,7 +4909,7 @@ import { execFileSync, execSync } from "child_process";
4909
4909
  import { existsSync as existsSync10, realpathSync as realpathSync2 } from "fs";
4910
4910
  import chalk18 from "chalk";
4911
4911
  import ora16 from "ora";
4912
- var cliVersion = true ? "0.28.635" : "dev";
4912
+ var cliVersion = true ? "0.28.636" : "dev";
4913
4913
  async function fetchLatestVersion() {
4914
4914
  const host2 = getHost();
4915
4915
  if (!host2) return null;
@@ -6089,7 +6089,7 @@ function handleError(err) {
6089
6089
  }
6090
6090
 
6091
6091
  // src/bin/agt.ts
6092
- var cliVersion2 = true ? "0.28.635" : "dev";
6092
+ var cliVersion2 = true ? "0.28.636" : "dev";
6093
6093
  var program = new Command();
6094
6094
  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");
6095
6095
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -16,7 +16,7 @@ import {
16
16
  rotateDailySession,
17
17
  sessionFileExists,
18
18
  todayLocalIso
19
- } from "./chunk-FKG7DIE2.js";
19
+ } from "./chunk-O4ADFO57.js";
20
20
  import {
21
21
  reapOrphanChannelMcps
22
22
  } from "./chunk-XWVM4KPK.js";
@@ -4313,4 +4313,4 @@ export {
4313
4313
  stopAllSessionsAndWait,
4314
4314
  getProjectDir
4315
4315
  };
4316
- //# sourceMappingURL=chunk-GNTCOXZG.js.map
4316
+ //# sourceMappingURL=chunk-4HVSMJFM.js.map
@@ -7,7 +7,7 @@ import {
7
7
  expandTemplateVars,
8
8
  isolationMode,
9
9
  parseEnvIntegrations
10
- } from "./chunk-GNTCOXZG.js";
10
+ } from "./chunk-4HVSMJFM.js";
11
11
  import {
12
12
  BIND_FAILURE_QUARANTINE_THRESHOLD,
13
13
  INTEGRATIONS_SECTION_END,
@@ -33,6 +33,7 @@ import {
33
33
  handshakeToolsListOutcome,
34
34
  isControlPlaneOnlyConfigKey,
35
35
  isDefaultRemoteMcpConnection,
36
+ isSessionToolBindCandidate,
36
37
  isSlackInboundTransportDown,
37
38
  listFlagDefinitions,
38
39
  mcpWildcardsForServers,
@@ -51,7 +52,7 @@ import {
51
52
  resolveConnectivityProbe,
52
53
  worseConnectivityOutcome,
53
54
  wrapScheduledTaskPrompt
54
- } from "./chunk-FKG7DIE2.js";
55
+ } from "./chunk-O4ADFO57.js";
55
56
  import {
56
57
  parsePsRows
57
58
  } from "./chunk-XWVM4KPK.js";
@@ -6069,7 +6070,7 @@ function exchangeFailureKind(err) {
6069
6070
  }
6070
6071
 
6071
6072
  // src/lib/api-client.ts
6072
- var agtCliVersion = true ? "0.28.635" : "dev";
6073
+ var agtCliVersion = true ? "0.28.636" : "dev";
6073
6074
  var lastConfigHash = null;
6074
6075
  function setConfigHash(hash) {
6075
6076
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -8300,6 +8301,17 @@ function resolveIntegrationServerKeys(definitionId, declaredKeys, hint) {
8300
8301
  for (const c of candidates) if (declared.has(c)) out.add(c);
8301
8302
  return [...out];
8302
8303
  }
8304
+ function hasDeliverySignal(integ) {
8305
+ return DELIVERY_FIELDS.some((k) => Object.prototype.hasOwnProperty.call(integ, k));
8306
+ }
8307
+ var DELIVERY_FIELDS = [
8308
+ "source_type",
8309
+ "provider",
8310
+ "mcp_command",
8311
+ "mcp_url",
8312
+ "cli_binary",
8313
+ "cli_package"
8314
+ ];
8303
8315
  function isDue(last, now, intervalMs) {
8304
8316
  if (!last) return true;
8305
8317
  const t = Date.parse(last);
@@ -8320,6 +8332,8 @@ async function runSessionToolBindProbes(integrations, options) {
8320
8332
  const reports = [];
8321
8333
  const rebindCandidates = [];
8322
8334
  let skipped = 0;
8335
+ let notApplicable = 0;
8336
+ const skippedDetail = [];
8323
8337
  let probed = 0;
8324
8338
  for (const integ of batch) {
8325
8339
  const keys = resolveIntegrationServerKeys(
@@ -8328,7 +8342,29 @@ async function runSessionToolBindProbes(integrations, options) {
8328
8342
  integ.mcp_server_key
8329
8343
  );
8330
8344
  if (keys.length === 0) {
8345
+ if (!hasDeliverySignal(integ)) {
8346
+ skipped += 1;
8347
+ skippedDetail.push({ definition_id: integ.definition_id, reason: "delivery-unknown" });
8348
+ continue;
8349
+ }
8350
+ if (!isSessionToolBindCandidate({
8351
+ sourceType: integ.source_type,
8352
+ provider: integ.provider,
8353
+ mcpCommand: integ.mcp_command,
8354
+ mcpUrl: integ.mcp_url,
8355
+ cliBinary: integ.cli_binary,
8356
+ cliPackage: integ.cli_package
8357
+ })) {
8358
+ notApplicable += 1;
8359
+ reports.push({
8360
+ integration_id: integ.id,
8361
+ scope: integ.scope,
8362
+ status: "not_applicable"
8363
+ });
8364
+ continue;
8365
+ }
8331
8366
  skipped += 1;
8367
+ skippedDetail.push({ definition_id: integ.definition_id, reason: "no-declared-server" });
8332
8368
  continue;
8333
8369
  }
8334
8370
  probed += 1;
@@ -8358,6 +8394,7 @@ async function runSessionToolBindProbes(integrations, options) {
8358
8394
  });
8359
8395
  if (status === "unknown") {
8360
8396
  skipped += 1;
8397
+ skippedDetail.push({ definition_id: integ.definition_id, reason: "inconclusive" });
8361
8398
  continue;
8362
8399
  }
8363
8400
  reports.push({ integration_id: integ.id, scope: integ.scope, status });
@@ -8384,7 +8421,7 @@ async function runSessionToolBindProbes(integrations, options) {
8384
8421
  }
8385
8422
  }
8386
8423
  }
8387
- return { reports, rebindCandidates, due: due.length, probed, skipped };
8424
+ return { reports, rebindCandidates, due: due.length, probed, skipped, skippedDetail, notApplicable };
8388
8425
  }
8389
8426
 
8390
8427
  // src/lib/connectivity-probe-context.ts
@@ -8651,35 +8688,58 @@ import { execFileSync as syncExecFile } from "child_process";
8651
8688
  import { readFileSync as readFileSync7 } from "fs";
8652
8689
  import { join as join6 } from "path";
8653
8690
  import { dirname as dirname4 } from "path";
8691
+ function deliveryFields(i) {
8692
+ const keys = ["source_type", "provider", "mcp_command", "mcp_url", "cli_binary", "cli_package"];
8693
+ const out = {};
8694
+ for (const k of keys) {
8695
+ if (Object.prototype.hasOwnProperty.call(i, k)) out[k] = i[k];
8696
+ }
8697
+ return out;
8698
+ }
8654
8699
  async function gatherSessionToolBindProbe(agent, integrations, projectDir, opts) {
8655
8700
  if (integrations.length === 0) return null;
8656
- let mcpJson = null;
8701
+ let mcpRaw = null;
8657
8702
  try {
8658
- mcpJson = JSON.parse(readFileSync7(join6(projectDir, ".mcp.json"), "utf-8"));
8703
+ mcpRaw = readFileSync7(join6(projectDir, ".mcp.json"), "utf-8");
8659
8704
  } catch {
8660
- return null;
8705
+ mcpRaw = null;
8661
8706
  }
8662
- if (!mcpJson?.mcpServers || Object.keys(mcpJson.mcpServers).length === 0) return null;
8707
+ let parsed = null;
8708
+ if (mcpRaw !== null) {
8709
+ try {
8710
+ parsed = JSON.parse(mcpRaw);
8711
+ } catch {
8712
+ return null;
8713
+ }
8714
+ }
8715
+ const declaredServers = parsed?.mcpServers && typeof parsed.mcpServers === "object" ? parsed.mcpServers : {};
8716
+ const mcpJson = {
8717
+ ...parsed ?? {},
8718
+ mcpServers: declaredServers
8719
+ };
8720
+ const declaredServerCount = Object.keys(declaredServers).length;
8663
8721
  const isolated = isolationMode(agent.code_name) === "docker";
8664
8722
  const hasDeclaredStdio = Object.values(mcpJson.mcpServers).some(
8665
8723
  (entry) => typeof entry?.command === "string"
8666
8724
  );
8667
8725
  let missingStdioKeys = /* @__PURE__ */ new Set();
8668
- try {
8669
- const psOutput = isolated ? syncExecFile("docker", ["exec", `agt-${agent.code_name}`, "ps", "-eo", "pid,ppid,args"], {
8670
- encoding: "utf-8",
8671
- timeout: 8e3
8672
- }) : syncExecFile("ps", ["-eo", "pid,ppid,args"], { encoding: "utf-8", timeout: 5e3 });
8673
- missingStdioKeys = new Set(
8674
- findMissingMcpServers({
8675
- rows: parsePsRows(psOutput),
8676
- codeName: agent.code_name,
8677
- mcpJson,
8678
- inContainer: isolated
8679
- })
8680
- );
8681
- } catch {
8682
- if (hasDeclaredStdio) return null;
8726
+ if (declaredServerCount > 0) {
8727
+ try {
8728
+ const psOutput = isolated ? syncExecFile("docker", ["exec", `agt-${agent.code_name}`, "ps", "-eo", "pid,ppid,args"], {
8729
+ encoding: "utf-8",
8730
+ timeout: 8e3
8731
+ }) : syncExecFile("ps", ["-eo", "pid,ppid,args"], { encoding: "utf-8", timeout: 5e3 });
8732
+ missingStdioKeys = new Set(
8733
+ findMissingMcpServers({
8734
+ rows: parsePsRows(psOutput),
8735
+ codeName: agent.code_name,
8736
+ mcpJson,
8737
+ inContainer: isolated
8738
+ })
8739
+ );
8740
+ } catch {
8741
+ if (hasDeclaredStdio) return null;
8742
+ }
8683
8743
  }
8684
8744
  const probeEnv = buildProbeEnv(projectDir, agent.agent_id);
8685
8745
  const probeDeps = buildConnectivityProbeDeps(projectDir, probeEnv);
@@ -8696,6 +8756,15 @@ async function gatherSessionToolBindProbe(agent, integrations, projectDir, opts)
8696
8756
  definition_id: i.definition_id,
8697
8757
  scope: i.scope,
8698
8758
  last_session_tool_bind_at: i.last_session_tool_bind_at ?? null,
8759
+ // ENG-9114: forwarded by PRESENCE, not by value. `hasDeliverySignal` in
8760
+ // the runner asks "did the API speak about delivery at all?", and spreading
8761
+ // these unconditionally would have made it impossible to answer: a key
8762
+ // written as `undefined` is still an own property, so an old API's omitted
8763
+ // columns would have looked identical to a current API's explicit nulls.
8764
+ // Both readings are needed and they mean opposite things - explicit null is
8765
+ // a real answer (this toolkit sets no mcp_command), absence is no answer at
8766
+ // all. Omitting the key here is what keeps them distinguishable. (CodeRabbit)
8767
+ ...deliveryFields(i),
8699
8768
  // Server-key hint for managed/remote-MCP kinds; the runner also tries the
8700
8769
  // raw + sanitised definition_id against the real `.mcp.json` keys.
8701
8770
  mcp_server_key: deriveMcpServerKey({
@@ -9630,4 +9699,4 @@ export {
9630
9699
  managerInstallSystemUnitCommand,
9631
9700
  managerUninstallSystemUnitCommand
9632
9701
  };
9633
- //# sourceMappingURL=chunk-J6KQDGWM.js.map
9702
+ //# sourceMappingURL=chunk-KIOTRBOI.js.map