@integrity-labs/agt-cli 0.28.1193 → 0.28.1194

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 (29) hide show
  1. package/dist/bin/agt.js +6 -6
  2. package/dist/{chunk-UUO7QTLC.js → chunk-2HAH3TZ4.js} +15 -1
  3. package/dist/{chunk-UUO7QTLC.js.map → chunk-2HAH3TZ4.js.map} +1 -1
  4. package/dist/{chunk-ZTA7AGKM.js → chunk-DPXWD2HJ.js} +44 -11
  5. package/dist/{chunk-ZTA7AGKM.js.map → chunk-DPXWD2HJ.js.map} +1 -1
  6. package/dist/{chunk-NJ2AUTIO.js → chunk-KL35IHP2.js} +3 -3
  7. package/dist/{chunk-DXLSLT5G.js → chunk-MLIFIEIF.js} +2 -2
  8. package/dist/{chunk-UQYIFOWE.js → chunk-WUYF7RDA.js} +2 -2
  9. package/dist/{claude-code-updater-EOJQHUZ2.js → claude-code-updater-DLTAAQOT.js} +3 -3
  10. package/dist/{claude-pair-runtime-WKTA3HNF.js → claude-pair-runtime-XAUZPAUP.js} +3 -3
  11. package/dist/lib/manager-worker.js +91 -28
  12. package/dist/lib/manager-worker.js.map +1 -1
  13. package/dist/mcp/direct-chat-channel.js +2 -0
  14. package/dist/mcp/index.js +2 -0
  15. package/dist/mcp/origami.js +2 -0
  16. package/dist/mcp/slack-channel.js +2 -0
  17. package/dist/mcp/telegram-channel.js +2 -0
  18. package/dist/{persistent-session-5MGJGJIB.js → persistent-session-TV4FIBN4.js} +4 -4
  19. package/dist/{responsiveness-probe-J4CBYZS3.js → responsiveness-probe-BBAAYANU.js} +4 -4
  20. package/dist/{session-auth-dead-7CSZHNBK.js → session-auth-dead-JMYATIQN.js} +3 -3
  21. package/package.json +1 -1
  22. /package/dist/{chunk-NJ2AUTIO.js.map → chunk-KL35IHP2.js.map} +0 -0
  23. /package/dist/{chunk-DXLSLT5G.js.map → chunk-MLIFIEIF.js.map} +0 -0
  24. /package/dist/{chunk-UQYIFOWE.js.map → chunk-WUYF7RDA.js.map} +0 -0
  25. /package/dist/{claude-code-updater-EOJQHUZ2.js.map → claude-code-updater-DLTAAQOT.js.map} +0 -0
  26. /package/dist/{claude-pair-runtime-WKTA3HNF.js.map → claude-pair-runtime-XAUZPAUP.js.map} +0 -0
  27. /package/dist/{persistent-session-5MGJGJIB.js.map → persistent-session-TV4FIBN4.js.map} +0 -0
  28. /package/dist/{responsiveness-probe-J4CBYZS3.js.map → responsiveness-probe-BBAAYANU.js.map} +0 -0
  29. /package/dist/{session-auth-dead-7CSZHNBK.js.map → session-auth-dead-JMYATIQN.js.map} +0 -0
@@ -16,11 +16,11 @@ import {
16
16
  parseEnvFileEntries,
17
17
  parseEnvIntegrations,
18
18
  shellQuote
19
- } from "./chunk-NJ2AUTIO.js";
19
+ } from "./chunk-KL35IHP2.js";
20
20
  import {
21
21
  readDailySessionPin,
22
22
  sessionTranscriptDir
23
- } from "./chunk-DXLSLT5G.js";
23
+ } from "./chunk-MLIFIEIF.js";
24
24
  import {
25
25
  classifyUnanswerablePane,
26
26
  isConsumerTermsDialogVisible,
@@ -32,6 +32,7 @@ import {
32
32
  } from "./chunk-XWVM4KPK.js";
33
33
  import {
34
34
  BIND_FAILURE_QUARANTINE_THRESHOLD,
35
+ HOST_ROTATE_KEY_CONFLICT,
35
36
  INTEGRATIONS_SECTION_END,
36
37
  INTEGRATIONS_SECTION_START,
37
38
  INTEGRATION_REGISTRY,
@@ -91,7 +92,7 @@ import {
91
92
  scanConfigForLiteralSecrets,
92
93
  worseConnectivityOutcome,
93
94
  wrapScheduledTaskPrompt
94
- } from "./chunk-UUO7QTLC.js";
95
+ } from "./chunk-2HAH3TZ4.js";
95
96
  import {
96
97
  claudeJsonPathFor,
97
98
  effectiveClaudeJsonPath,
@@ -8081,7 +8082,7 @@ function exchangeFailureKind(err) {
8081
8082
  }
8082
8083
 
8083
8084
  // src/lib/api-client.ts
8084
- var agtCliVersion = true ? "0.28.1193" : "dev";
8085
+ var agtCliVersion = true ? "0.28.1194" : "dev";
8085
8086
  var lastConfigHash = null;
8086
8087
  function setConfigHash(hash) {
8087
8088
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -8272,12 +8273,15 @@ async function mintRotatedHostKey(rawHostKey) {
8272
8273
  // 5-minute retry backoff would then re-arm the same stall. 10s matches the
8273
8274
  // other short calls in this process (`telegram-ingest.ts`). A timeout
8274
8275
  // surfaces as a thrown error, which `adoptRotatedHostKey` reports as
8275
- // `error` and the manager retries after the backoff — but the retry only
8276
- // succeeds if the SERVER never committed the mint. The abort cancels the
8277
- // client, not the route: if the key was already inserted and recorded, the
8278
- // retry hits the one-mint-per-request guard, gets 409, and the request
8279
- // needs a `compromised` rotation (Obi Wan `9b564171021b` on #7114). A lost
8280
- // response after the commit ends the same way. The runbook lists it.
8276
+ // `error` and the manager retries after the backoff. The abort cancels the
8277
+ // client, not the route, so the key may already be minted and recorded;
8278
+ // a lost response after the commit is the same case. The retry still
8279
+ // works: the server discards a minted key nobody has ever authenticated
8280
+ // with once it is older than HOST_SELF_ROTATION_STALE_MINT_MS, which is
8281
+ // shorter than the backoff, and mints again (ENG-11826; it used to need a
8282
+ // `compromised` rotation, Obi Wan `9b564171021b` on #7114). That covers
8283
+ // the backoff retry; a manager that restarts inside the window gets
8284
+ // `mint_pending`, which this version retries and older versions do not.
8281
8285
  signal: AbortSignal.timeout(1e4)
8282
8286
  });
8283
8287
  if (res.status === 403) {
@@ -8285,6 +8289,12 @@ async function mintRotatedHostKey(rawHostKey) {
8285
8289
  }
8286
8290
  if (res.status === 409) {
8287
8291
  const body = await res.json().catch(() => ({}));
8292
+ if (body["code"] === HOST_ROTATE_KEY_CONFLICT.mintPending) {
8293
+ throw new Error(`Host key rotation mint deferred: ${String(body["error"] ?? "a mint is in flight")}`);
8294
+ }
8295
+ if (body["code"] === HOST_ROTATE_KEY_CONFLICT.alreadyHoldsMintedKey && typeof body["prefix"] === "string" && body["prefix"]) {
8296
+ return { alreadyHolds: body["prefix"] };
8297
+ }
8288
8298
  return { refused: String(body["error"] ?? "conflict") };
8289
8299
  }
8290
8300
  if (!res.ok) {
@@ -8297,6 +8307,28 @@ async function mintRotatedHostKey(rawHostKey) {
8297
8307
  if (!prefix || !rawKey) return null;
8298
8308
  return { prefix, rawKey };
8299
8309
  }
8310
+ async function probeHostKey(rawKey) {
8311
+ let res;
8312
+ try {
8313
+ res = await fetch(`${requireHost()}/host/exchange`, {
8314
+ method: "POST",
8315
+ headers: { "Content-Type": "application/json" },
8316
+ body: JSON.stringify({ host_key: rawKey }),
8317
+ // Same bound as the mint, for the same reason: it runs on the poll cycle.
8318
+ signal: AbortSignal.timeout(1e4)
8319
+ });
8320
+ } catch {
8321
+ return "unknown";
8322
+ }
8323
+ if (res.ok) return "live";
8324
+ if (res.status === 401) {
8325
+ const body = await res.json().catch(() => ({}));
8326
+ if (body["code"] === "key_revoked" || body["code"] === "invalid_key" || body["code"] === "key_expired") {
8327
+ return "unusable";
8328
+ }
8329
+ }
8330
+ return "unknown";
8331
+ }
8300
8332
  function adoptHostKeyInProcess(rawKey) {
8301
8333
  process.env["AGT_API_KEY"] = rawKey;
8302
8334
  forceNextExchange();
@@ -13577,6 +13609,7 @@ export {
13577
13609
  exchangeApiKey,
13578
13610
  mintAgentKey,
13579
13611
  mintRotatedHostKey,
13612
+ probeHostKey,
13580
13613
  adoptHostKeyInProcess,
13581
13614
  ApiError,
13582
13615
  api,
@@ -13649,4 +13682,4 @@ export {
13649
13682
  managerInstallSystemUnitCommand,
13650
13683
  managerUninstallSystemUnitCommand
13651
13684
  };
13652
- //# sourceMappingURL=chunk-ZTA7AGKM.js.map
13685
+ //# sourceMappingURL=chunk-DPXWD2HJ.js.map