@integrity-labs/agt-cli 0.28.1029 → 0.28.1031

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.
@@ -30718,7 +30718,10 @@ function isTelegramDeclineAddressed(input) {
30718
30718
  if (input.botId !== null && input.replyToFromId !== null && input.replyToFromId !== void 0 && input.replyToFromId === input.botId) {
30719
30719
  return true;
30720
30720
  }
30721
- return !!input.botUsername && typeof input.text === "string" && input.text.toLowerCase().includes(`@${input.botUsername.toLowerCase()}`);
30721
+ if (!input.botUsername)
30722
+ return false;
30723
+ const mention = `@${input.botUsername.toLowerCase()}`;
30724
+ return [input.text, input.caption].some((body) => typeof body === "string" && body.toLowerCase().includes(mention));
30722
30725
  }
30723
30726
  function decideDeclineReply(input) {
30724
30727
  const last = input.cache.get(input.key);
@@ -37406,7 +37409,10 @@ var FLAG_REGISTRY = [
37406
37409
  // Disabling this RESTORES the shared host-wide key to every container, and
37407
37410
  // with it the cross-agent credential read ENG-8992 closes. A credential-scope
37408
37411
  // reduction should not be one click away without confirmation — same posture
37409
- // as `github-broker-credentials`, the other credential-delivery flag.
37412
+ // as the credential-delivery flags `github-broker-credentials` and
37413
+ // `xero-broker-credentials`. (This said "the OTHER credential-delivery flag"
37414
+ // while there was one; ENG-10939 added the second, so the singular had to go
37415
+ // rather than silently become a claim that github is the only sibling.)
37410
37416
  sensitive: true,
37411
37417
  // The reader is host-side (`hostFlagStore().getBoolean(...)` in the manager),
37412
37418
  // so a host on an older agt-cli has no consumer code: it keeps forwarding the
@@ -38553,6 +38559,12 @@ var FLAG_REGISTRY = [
38553
38559
  // are the precedent: pinned ABOVE every published release ON PURPOSE,
38554
38560
  // labelled as a placeholder, and gated on a post-publish bisect.
38555
38561
  //
38562
+ // ENG-10939: `xero-broker-credentials` is the worked example of the other
38563
+ // half of that convention - the bisect that DISCHARGES a placeholder. Its
38564
+ // `since` is a real published version read off `npm pack` tarballs, with the
38565
+ // markers it was bisected on written down, so the two entries together show
38566
+ // both states this field is allowed to be in.
38567
+ //
38556
38568
  // (This cited `claudecode-agt-bin-credential-helpers` until obi-wan
38557
38569
  // `8f9d3c43076c` pointed out no such key exists anywhere in the repo - the
38558
38570
  // only occurrence in the tree was this citation. The precedent was real and
@@ -39319,6 +39331,56 @@ var FLAG_REGISTRY = [
39319
39331
  // flips); shipping a guessed number is not.
39320
39332
  since: "0.29.0"
39321
39333
  },
39334
+ {
39335
+ key: "xero-broker-credentials",
39336
+ description: 'Deliver the Xero OAuth access token to the vendor Xero MCP server through the broker credential endpoint at USE time, instead of materializing it onto the agent host at spawn (ENG-10939, step 1 of the Xero lockdown ENG-10927). Mechanically the sibling of `github-broker-credentials`; the REASON and the cost of a bad flip are both different. ON: POST /host/agent-integrations strips `access_token`, `refresh_token` and `token_expires_at` from the xero row and marks it credential_delivery=broker, so XERO_ACCESS_TOKEN stops being written to .env.integrations. Nothing replaces it host-side and nothing needs to: the vendor MCP server has fetched a fresh token per call from POST /host/agent-integrations/:id/credential since ENG-4920, and `brokerMode` is true for every install carrying an id - so XERO_CLIENT_BEARER_TOKEN: ${XERO_ACCESS_TOKEN} is already not emitted and no dangling reference is left behind. `granted_scopes` and `read_only` are deliberately KEPT: they are consent metadata the host reports scope drift from, not credentials. OFF (default): byte-for-byte today\'s behaviour. WHY THIS IS NOT THE GITHUB FLAG. For github, an under-`since` host on a flipped flag LOSES `git`/`gh` - an outage. For xero the equivalent host LEAKS: before ENG-10939 the ENG-8344 broker guard was a loop-level `continue` that also skipped the config-derived env vars, so a broker-marked xero row dropped XERO_TENANT_ID, and per ENG-4898 the vendor MCP server then falls back to `tenants[0]` - a CROSS-TENANT DATA LEAK with no error anywhere. The dangerous fleet is therefore an INTERVAL, not "old hosts", and BOTH edges are bisected from published tarballs rather than named by issue: below agt-cli 0.28.508 a host carries no `credentialDelivery` handling at all, so it ignores the marker and is SAFE; from 0.28.508 up to (not including) 0.28.1015 it honours the marker with the WIDE skip and LEAKS; at 0.28.1015 and above the skip is narrowed and the behaviour is correct. `since` is a lower bound, so it classifies BOTH ends of that interval as `stale` and cannot tell a safe pre-0.28.508 host from a leaking-middle one. THE FLIP GATE IS THEREFORE NOT "the modal shows reach": it is zero xero-bearing hosts below 0.28.1015 per hosts.agt_version, counting NULL and stale as UNCONVERGED (the heartbeat writes that column conditionally on presence, so a host that stopped reporting keeps its last value - the async-export-rollout pattern). AND A SECOND GATE THE MODAL CANNOT SEE AT ALL: the rewritten Xero skills (ENG-10961) must be live in the catalog AND have reached hosts BEFORE this is flipped. Reversed, a host has no token while its own skills still tell it to read one - a silent read outage with no error at the write site. The catalog reaches prod through `pnpm db:catalog:seed` on deploy, not through the code deploy itself, so "merged" is not "live". EXPECTED ON FLIP DAY, so it is not a surprise: the payload shrinks, so computeIntegrationsHash moves once and XERO_ACCESS_TOKEN reads present->absent in the env diff. That does NOT respawn the session. `liveProxyTokenVars` collects AGT_REMOTE_MCP_TOKEN_VAR from .mcp.json (= XERO_ACCESS_TOKEN in broker mode) and the manager filters it out of `respawnVars` BY NAME, kind-blind - so a removal is exempt on exactly the same line a rotation is (ENG-8264). The ENG-5318 child-kill path is likewise unreachable, because broker mode never emits the ${XERO_ACCESS_TOKEN} reference the stale-mcp-reaper keys on. Both restart paths that touch this var are already quiet. Evaluated API-side only, per agent, in POST /host/agent-integrations. The host does not read this flag - it keys off the resulting credential_delivery marker - so there is deliberately NO host-side envVar that could put the token back on its own. Roll back from the flag.',
39337
+ flagType: "boolean",
39338
+ // Declared safe value is `false` = today's env delivery. Fail-safe here is
39339
+ // not symmetrical with github's: OFF leaves a credential on the host (bad,
39340
+ // but the status quo this epic is closing), while a wrongly-ON flip on an
39341
+ // under-`since` host LEAKS ANOTHER TENANT'S DATA. `false` is still the right
39342
+ // default, because the ON path is the one with a reach precondition — but
39343
+ // the reason is "do not arm this until the fleet is measured", not "a flag
39344
+ // blip must not break the agent".
39345
+ defaultValue: false,
39346
+ // Flipping ON changes how every Xero agent on the scope authenticates, and
39347
+ // on an unconverged host it is a cross-tenant leak rather than an outage. A
39348
+ // deliberate, confirmed action (ADR-0022 §4).
39349
+ sensitive: true,
39350
+ // A REAL bisected threshold, not the placeholder `github-broker-credentials`
39351
+ // and `per-agent-host-credentials` had to ship with: the host-side code this
39352
+ // flag depends on (ENG-10939 item 0, narrowing the ENG-8344 broker guard so
39353
+ // it skips the CREDENTIAL and not the whole row's config) landed in PR #6443
39354
+ // and has already published.
39355
+ //
39356
+ // Read off the published tarballs rather than inferred from the merge
39357
+ // timestamp. #6443 merged at 2026-09-24T01:54:41Z; 0.28.1015 published at
39358
+ // 01:59:23Z. `npm pack` of 0.28.1013/1014/1015/1016 + grep of the extracted
39359
+ // bundle agrees in both directions on four independent markers:
39360
+ // 0.28.1014 — `writeTokenFile` present (4 files), `isRespawnExemptEnvVar`
39361
+ // and `RESPAWN_EXEMPT_CONFIG_TAILS` absent, and the only
39362
+ // broker-guard spelling is `credentialDelivery === "broker"`
39363
+ // (the wide skip).
39364
+ // 0.28.1015 — `writeTokenFile` gone, both new exports present, and
39365
+ // `credentialDelivery !== "broker"` (the narrowed block form)
39366
+ // appears for the first time.
39367
+ // The `!==` form is the one that matters: it is the guard that keeps
39368
+ // XERO_TENANT_ID on a broker-marked row, i.e. the thing whose absence is the
39369
+ // ENG-4898 leak.
39370
+ //
39371
+ // The interval's OTHER edge was bisected the same way, so the description
39372
+ // above can name a version instead of an issue: `credentialDelivery` appears
39373
+ // in no file of 0.28.507 and in five files of 0.28.508, so ENG-8344's marker
39374
+ // handling first shipped in 0.28.508. A host below that is genuinely safe
39375
+ // rather than merely old — it has no code to honour the marker with.
39376
+ //
39377
+ // Same caveat as every other `since` in this registry: it is ADVISORY. It is
39378
+ // read only by `computeFlagReach` behind GET /flags/admin/reach, so it
39379
+ // changes what an operator is TOLD and does not stop a flip on an
39380
+ // under-`since` host. What holds the line is `defaultValue: false`, plus
39381
+ // `sensitive: true`, plus the two gates spelled out in the description.
39382
+ since: "0.28.1015"
39383
+ },
39322
39384
  {
39323
39385
  key: "help-kb-auto-grant",
39324
39386
  description: "Auto-grant the `augmented-help-kb` integration at ORG scope when an organization is provisioned (ENG-8542), so every agent in that org gets product-doc search without a per-agent operator action. One organization_integrations row reaches every agent in the org: POST /host/agent-integrations merges org -> team -> agent and buildMcpJson's predicate reads that merged set with no scope filter. ON: the two org-provisioning call sites write the row (status=active, created_by=the org owner). OFF (default): they write nothing - byte-for-byte today's behaviour. STAGED ROLLOUT IS THE POINT. ENG-8332 argues against widening distribution of the help KB until two things close, because distributing a corpus with wrong articles \"converts one agent's wrong answer into everyone's\": (1) a live 200 from GET /host/kb/search as the anon role has still never been observed - ENG-7260 was closed on remediation evidence, not on a live call, and the deploy seed log is SERVICE-ROLE evidence that says nothing about the anon grant; (2) the `site-structure` article is unverified against the current IA. Turning this on for ONE org and watching that org's help-kb connectivity-probe verdicts (ENG-8332 added a real mcp_stdio probe that calls search_knowledge_base) is the cheap positive control for (1) - an ENG-7260-class 500 then reports as `down` per agent instead of as silence. Widen only after it comes back healthy. REVOKING IS DELETING THE ROW, not flipping this off: the flag gates GRANTING, so an already-granted org keeps its row when the flag goes off. Evaluated API-side only, per org, inside grantHelpKbToOrg; no host-side envVar and deliberately no sst.config.ts entry (a literal default there would pin it - ENG-8303).",
@@ -46757,6 +46819,8 @@ async function pollLoop() {
46757
46819
  if (access.decline !== void 0 && msg.from?.id != null && selfIdentity !== null && isTelegramDeclineAddressed({
46758
46820
  chatType: msg.chat?.type,
46759
46821
  text: msg.text,
46822
+ // Obi Wan `89b7a96d4f60`: a photo/document mention lives in the caption.
46823
+ caption: msg.caption,
46760
46824
  botUsername: selfIdentity.bot_username,
46761
46825
  botId: selfIdentity.bot_id,
46762
46826
  replyToFromId: msg.reply_to_message?.from?.id ?? null,
@@ -65,8 +65,8 @@ import {
65
65
  writeDirectChatSessionState,
66
66
  writeEgressAllowlist,
67
67
  writePersistentClaudeWrapper
68
- } from "./chunk-7LBSHOJ7.js";
69
- import "./chunk-3V43FBP4.js";
68
+ } from "./chunk-XD5GMJGJ.js";
69
+ import "./chunk-TFFXAGBJ.js";
70
70
  import "./chunk-TQDIIS3X.js";
71
71
  import "./chunk-XWVM4KPK.js";
72
72
  import "./chunk-EL5MWGGH.js";
@@ -139,4 +139,4 @@ export {
139
139
  writeEgressAllowlist,
140
140
  writePersistentClaudeWrapper
141
141
  };
142
- //# sourceMappingURL=persistent-session-U2DXYFIU.js.map
142
+ //# sourceMappingURL=persistent-session-AMUXFQKY.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  paneLogPath
3
- } from "./chunk-7LBSHOJ7.js";
4
- import "./chunk-3V43FBP4.js";
3
+ } from "./chunk-XD5GMJGJ.js";
4
+ import "./chunk-TFFXAGBJ.js";
5
5
  import "./chunk-TQDIIS3X.js";
6
6
  import "./chunk-XWVM4KPK.js";
7
7
  import "./chunk-EL5MWGGH.js";
@@ -802,4 +802,4 @@ export {
802
802
  readAndResetSlackReplyBindingClassifications,
803
803
  readAndResetSlackReplyTargetClassifications
804
804
  };
805
- //# sourceMappingURL=responsiveness-probe-7KPMAX2A.js.map
805
+ //# sourceMappingURL=responsiveness-probe-73AXZT6D.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  sessionTranscriptDir
3
- } from "./chunk-3V43FBP4.js";
3
+ } from "./chunk-TFFXAGBJ.js";
4
4
  import "./chunk-DGUM43GV.js";
5
5
 
6
6
  // src/lib/session-auth-dead.ts
@@ -204,4 +204,4 @@ export {
204
204
  decideSessionAuthState,
205
205
  probeSessionAuth
206
206
  };
207
- //# sourceMappingURL=session-auth-dead-PZGGUZWK.js.map
207
+ //# sourceMappingURL=session-auth-dead-VINCM3ZI.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integrity-labs/agt-cli",
3
- "version": "0.28.1029",
3
+ "version": "0.28.1031",
4
4
  "description": "Augmented Team CLI — agent provisioning and management",
5
5
  "type": "module",
6
6
  "engines": {