@integrity-labs/agt-cli 0.28.657 → 0.28.659

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-PHIFSHBS.js";
43
+ } from "../chunk-ACQZZIK6.js";
44
44
  import {
45
45
  readDirectChatSessionState
46
- } from "../chunk-OBIOE63G.js";
46
+ } from "../chunk-LUIGOCT4.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-XUJIPPKF.js";
76
+ } from "../chunk-NLCHGFD5.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.657" : "dev";
4912
+ var cliVersion = true ? "0.28.659" : "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.657" : "dev";
6092
+ var cliVersion2 = true ? "0.28.659" : "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) => {
@@ -8,7 +8,7 @@ import {
8
8
  isolationMode,
9
9
  log,
10
10
  parseEnvIntegrations
11
- } from "./chunk-OBIOE63G.js";
11
+ } from "./chunk-LUIGOCT4.js";
12
12
  import {
13
13
  BIND_FAILURE_QUARANTINE_THRESHOLD,
14
14
  INTEGRATIONS_SECTION_END,
@@ -55,7 +55,7 @@ import {
55
55
  resolveConnectivityProbe,
56
56
  worseConnectivityOutcome,
57
57
  wrapScheduledTaskPrompt
58
- } from "./chunk-XUJIPPKF.js";
58
+ } from "./chunk-NLCHGFD5.js";
59
59
  import {
60
60
  parsePsRows
61
61
  } from "./chunk-XWVM4KPK.js";
@@ -1076,13 +1076,25 @@ function mcpConfigAgentIds() {
1076
1076
  * process env held a stale one inherited from elsewhere, so the broker was asked
1077
1077
  * for an integration belonging to somebody else and answered, correctly, 404.
1078
1078
  *
1079
+ * ONLY ON A 404, and the gate is the point rather than a tidy-up. The sentence
1080
+ * below does not hedge - it asserts that the broker "answered not found" and
1081
+ * that "your GitHub integration is probably fine". On a 500 both halves are
1082
+ * false: the broker answered nothing, and the state of the integration is
1083
+ * unknown. It used to be appended to EVERY credential-fetch failure, so during
1084
+ * the broker outage of 2026-08-20 any agent whose process env id disagreed with
1085
+ * its .mcp.json would have been told, in confident prose, to go and fix its
1086
+ * provisioner while the actual fault was an outage it had no part in. A
1087
+ * diagnostic that is right about a 404 and wrong about a 500 is worse than no
1088
+ * diagnostic, because it is believed.
1089
+ *
1079
1090
  * DIAGNOSTIC ONLY. It deliberately does NOT fall back to the .mcp.json value.
1080
1091
  * The broker authorises with the HOST key, which covers every agent on the host,
1081
1092
  * so honouring an agent-writable file as the identity would let any agent mint
1082
1093
  * another agent's GitHub token. The process env stays the only accepted source;
1083
1094
  * a mismatch is something an operator fixes at the provisioner.
1084
1095
  */
1085
- function identityMismatchHint() {
1096
+ function identityMismatchHint(status) {
1097
+ if (status !== 404) return '';
1086
1098
  const ids = mcpConfigAgentIds();
1087
1099
  if (ids.length === 0 || ids.indexOf(AGT_AGENT_ID) !== -1) return '';
1088
1100
  return (
@@ -1135,7 +1147,14 @@ async function postJson(url, body, headers) {
1135
1147
  const parsed = JSON.parse(text);
1136
1148
  if (parsed && parsed.error) detail = String(parsed.error);
1137
1149
  } catch { /* keep the raw body */ }
1138
- throw new Error(url + ' returned HTTP ' + res.status + (detail ? ': ' + detail : ''));
1150
+ // The STATUS travels with the error, not just inside its prose. A caller
1151
+ // that needs to branch on it (identityMismatchHint does) would otherwise
1152
+ // have to regex its own message back apart, and a diagnostic built on
1153
+ // string-matching an error it also formats is one wording change from
1154
+ // silently never firing again.
1155
+ const httpError = new Error(url + ' returned HTTP ' + res.status + (detail ? ': ' + detail : ''));
1156
+ httpError.status = res.status;
1157
+ throw httpError;
1139
1158
  }
1140
1159
  try {
1141
1160
  return JSON.parse(text);
@@ -1166,7 +1185,7 @@ async function resolveToken() {
1166
1185
  { Authorization: 'Bearer ' + jwt },
1167
1186
  );
1168
1187
  } catch (err) {
1169
- fail('broker credential fetch failed - ' + err.message + identityMismatchHint());
1188
+ fail('broker credential fetch failed - ' + err.message + identityMismatchHint(err && err.status));
1170
1189
  }
1171
1190
  const token = credential && credential.access_token;
1172
1191
  if (typeof token !== 'string' || token === '') {
@@ -6073,7 +6092,7 @@ function exchangeFailureKind(err) {
6073
6092
  }
6074
6093
 
6075
6094
  // src/lib/api-client.ts
6076
- var agtCliVersion = true ? "0.28.657" : "dev";
6095
+ var agtCliVersion = true ? "0.28.659" : "dev";
6077
6096
  var lastConfigHash = null;
6078
6097
  function setConfigHash(hash) {
6079
6098
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -9815,4 +9834,4 @@ export {
9815
9834
  managerInstallSystemUnitCommand,
9816
9835
  managerUninstallSystemUnitCommand
9817
9836
  };
9818
- //# sourceMappingURL=chunk-PHIFSHBS.js.map
9837
+ //# sourceMappingURL=chunk-ACQZZIK6.js.map