@integrity-labs/agt-cli 0.28.319 → 0.28.321

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.
@@ -14768,7 +14768,7 @@ function isMaintenanceModeActive(opts) {
14768
14768
  });
14769
14769
  }
14770
14770
 
14771
- // src/sender-policy-decline.ts
14771
+ // ../core/dist/channels/governance/sender-policy-decline.js
14772
14772
  function decideDeclineReply(input) {
14773
14773
  const last = input.cache.get(input.key);
14774
14774
  if (last !== void 0) {
@@ -14233,7 +14233,7 @@ var Server = class extends Protocol {
14233
14233
  }
14234
14234
  };
14235
14235
 
14236
- // src/slack-rich-text.ts
14236
+ // ../core/dist/channels/slack-rich-text.js
14237
14237
  var MAX_DEPTH = 12;
14238
14238
  function isRecord(v) {
14239
14239
  return typeof v === "object" && v !== null && !Array.isArray(v);
@@ -14262,14 +14262,16 @@ function renderEmoji(el) {
14262
14262
  return name ? `:${name}:` : "";
14263
14263
  }
14264
14264
  function renderLeaf(el) {
14265
- if (!isRecord(el)) return "";
14265
+ if (!isRecord(el))
14266
+ return "";
14266
14267
  switch (asString(el.type)) {
14267
14268
  case "text":
14268
14269
  return asString(el.text);
14269
14270
  case "link": {
14270
14271
  const label = asString(el.text);
14271
14272
  const url = asString(el.url);
14272
- if (label && url && label !== url) return `${label} (${url})`;
14273
+ if (label && url && label !== url)
14274
+ return `${label} (${url})`;
14273
14275
  return label || url;
14274
14276
  }
14275
14277
  case "emoji":
@@ -14285,7 +14287,8 @@ function renderLeaf(el) {
14285
14287
  case "date":
14286
14288
  return asString(el.fallback) || asString(el.timestamp);
14287
14289
  default:
14288
- if (Array.isArray(el.elements)) return renderInline(el.elements);
14290
+ if (Array.isArray(el.elements))
14291
+ return renderInline(el.elements);
14289
14292
  return asString(el.text);
14290
14293
  }
14291
14294
  }
@@ -14293,20 +14296,27 @@ function renderInline(elements) {
14293
14296
  return elements.map(renderLeaf).join("");
14294
14297
  }
14295
14298
  function deepText(node, depth) {
14296
- if (depth > MAX_DEPTH) return "";
14297
- if (typeof node === "string") return node;
14298
- if (Array.isArray(node)) return node.map((n) => deepText(n, depth + 1)).join("");
14299
- if (!isRecord(node)) return "";
14299
+ if (depth > MAX_DEPTH)
14300
+ return "";
14301
+ if (typeof node === "string")
14302
+ return node;
14303
+ if (Array.isArray(node))
14304
+ return node.map((n) => deepText(n, depth + 1)).join("");
14305
+ if (!isRecord(node))
14306
+ return "";
14300
14307
  const type = asString(node.type);
14301
14308
  if (type && type !== "rich_text" && !type.startsWith("rich_text_") && !type.includes("table")) {
14302
14309
  return renderLeaf(node);
14303
14310
  }
14304
- if (Array.isArray(node.elements)) return node.elements.map((n) => deepText(n, depth + 1)).join("");
14305
- if (Array.isArray(node.rows)) return node.rows.map((n) => deepText(n, depth + 1)).join(" ");
14311
+ if (Array.isArray(node.elements))
14312
+ return node.elements.map((n) => deepText(n, depth + 1)).join("");
14313
+ if (Array.isArray(node.rows))
14314
+ return node.rows.map((n) => deepText(n, depth + 1)).join(" ");
14306
14315
  return asString(node.text);
14307
14316
  }
14308
14317
  function renderCell(cell) {
14309
- if (!isRecord(cell)) return deepText(cell, 0).replace(/\s*\n\s*/g, " ").trim();
14318
+ if (!isRecord(cell))
14319
+ return deepText(cell, 0).replace(/\s*\n\s*/g, " ").trim();
14310
14320
  const inner = Array.isArray(cell.elements) ? renderSection(cell, 0) : deepText(cell, 0);
14311
14321
  return inner.replace(/\s*\n\s*/g, " ").trim();
14312
14322
  }
@@ -14314,9 +14324,11 @@ function renderTable(el) {
14314
14324
  const rawRows = asArray(el.elements).length ? asArray(el.elements) : asArray(el.rows);
14315
14325
  const rows = [];
14316
14326
  for (const row of rawRows) {
14317
- if (!isRecord(row) && !Array.isArray(row)) continue;
14327
+ if (!isRecord(row) && !Array.isArray(row))
14328
+ continue;
14318
14329
  const rawCells = Array.isArray(row) ? row : asArray(row.elements).length ? asArray(row.elements) : asArray(row.cells);
14319
- if (rawCells.length === 0) continue;
14330
+ if (rawCells.length === 0)
14331
+ continue;
14320
14332
  rows.push(rawCells.map(renderCell));
14321
14333
  }
14322
14334
  if (rows.length === 0) {
@@ -14326,7 +14338,8 @@ function renderTable(el) {
14326
14338
  const colCount = rows.reduce((max, r) => Math.max(max, r.length), 0);
14327
14339
  const pad = (r) => {
14328
14340
  const cells = r.slice();
14329
- while (cells.length < colCount) cells.push("");
14341
+ while (cells.length < colCount)
14342
+ cells.push("");
14330
14343
  return cells.map((c) => c.replace(/\|/g, "\\|"));
14331
14344
  };
14332
14345
  const lines = [];
@@ -14334,13 +14347,16 @@ function renderTable(el) {
14334
14347
  const body = rows.slice(1);
14335
14348
  lines.push(`| ${pad(header).join(" | ")} |`);
14336
14349
  lines.push(`| ${Array.from({ length: colCount }, () => "---").join(" | ")} |`);
14337
- for (const r of body) lines.push(`| ${pad(r).join(" | ")} |`);
14350
+ for (const r of body)
14351
+ lines.push(`| ${pad(r).join(" | ")} |`);
14338
14352
  return lines.join("\n");
14339
14353
  }
14340
14354
  function renderSection(section, depth) {
14341
- if (depth > MAX_DEPTH || !isRecord(section)) return "";
14355
+ if (depth > MAX_DEPTH || !isRecord(section))
14356
+ return "";
14342
14357
  const type = asString(section.type);
14343
- if (isTableElement(section)) return renderTable(section);
14358
+ if (isTableElement(section))
14359
+ return renderTable(section);
14344
14360
  switch (type) {
14345
14361
  case "rich_text_section":
14346
14362
  return renderInline(asArray(section.elements));
@@ -14364,7 +14380,8 @@ ${code}
14364
14380
  return items.join("\n");
14365
14381
  }
14366
14382
  default:
14367
- if (Array.isArray(section.elements)) return renderInline(asArray(section.elements));
14383
+ if (Array.isArray(section.elements))
14384
+ return renderInline(asArray(section.elements));
14368
14385
  return deepText(section, depth + 1);
14369
14386
  }
14370
14387
  }
@@ -14373,18 +14390,23 @@ function renderSlackBlocks(blocks) {
14373
14390
  const out = [];
14374
14391
  try {
14375
14392
  for (const block of asArray(blocks)) {
14376
- if (!isRecord(block)) continue;
14393
+ if (!isRecord(block))
14394
+ continue;
14377
14395
  if (isTableElement(block)) {
14378
14396
  hadTable = true;
14379
14397
  const rendered = renderTable(block);
14380
- if (rendered.trim().length > 0) out.push(rendered);
14398
+ if (rendered.trim().length > 0)
14399
+ out.push(rendered);
14381
14400
  continue;
14382
14401
  }
14383
- if (asString(block.type) !== "rich_text") continue;
14402
+ if (asString(block.type) !== "rich_text")
14403
+ continue;
14384
14404
  for (const section of asArray(block.elements)) {
14385
- if (isTableElement(section)) hadTable = true;
14405
+ if (isTableElement(section))
14406
+ hadTable = true;
14386
14407
  const rendered = renderSection(section, 0);
14387
- if (rendered.trim().length > 0) out.push(rendered);
14408
+ if (rendered.trim().length > 0)
14409
+ out.push(rendered);
14388
14410
  }
14389
14411
  }
14390
14412
  } catch {
@@ -14394,28 +14416,33 @@ function renderSlackBlocks(blocks) {
14394
14416
  }
14395
14417
  function mergeInboundText(text, blocks) {
14396
14418
  const { text: rendered, hadTable } = renderSlackBlocks(blocks);
14397
- if (!hadTable) return { content: text, recoveredTable: false };
14419
+ if (!hadTable)
14420
+ return { content: text, recoveredTable: false };
14398
14421
  const content = rendered.length > 0 ? rendered : text;
14399
14422
  return { content, recoveredTable: rendered.length > 0 && content !== text };
14400
14423
  }
14401
14424
 
14402
- // src/slack-forwarded.ts
14425
+ // ../core/dist/channels/governance/slack-forwarded.js
14403
14426
  function asTrimmed(v) {
14404
14427
  return typeof v === "string" ? v.trim() : "";
14405
14428
  }
14406
14429
  function extractForwardedContent(attachments) {
14407
- if (!Array.isArray(attachments)) return { text: "", files: [] };
14430
+ if (!Array.isArray(attachments))
14431
+ return { text: "", files: [] };
14408
14432
  const parts = [];
14409
14433
  const files = [];
14410
14434
  for (const raw of attachments) {
14411
- if (!raw || typeof raw !== "object") continue;
14435
+ if (!raw || typeof raw !== "object")
14436
+ continue;
14412
14437
  const att = raw;
14413
14438
  const textBody = asTrimmed(att.text);
14414
14439
  let body = textBody || asTrimmed(att.fallback);
14415
14440
  const blockSources = [];
14416
- if (Array.isArray(att.blocks)) blockSources.push(att.blocks);
14441
+ if (Array.isArray(att.blocks))
14442
+ blockSources.push(att.blocks);
14417
14443
  if (Array.isArray(att.message_blocks)) {
14418
- for (const mb of att.message_blocks) blockSources.push(mb?.message?.blocks);
14444
+ for (const mb of att.message_blocks)
14445
+ blockSources.push(mb?.message?.blocks);
14419
14446
  }
14420
14447
  for (const source of blockSources) {
14421
14448
  const rendered = renderSlackBlocks(source);
@@ -14429,12 +14456,18 @@ function extractForwardedContent(attachments) {
14429
14456
  const link = asTrimmed(att.title_link) || asTrimmed(att.from_url);
14430
14457
  const imageUrl = asTrimmed(att.image_url) || asTrimmed(att.thumb_url);
14431
14458
  const lines = [];
14432
- if (body) lines.push(body);
14433
- if (title && title !== body) lines.push(title);
14434
- if (link) lines.push(link);
14435
- if (imageUrl) lines.push(`[image] ${imageUrl}`);
14436
- if (lines.length) parts.push(lines.join("\n"));
14437
- if (Array.isArray(att.files)) files.push(...att.files);
14459
+ if (body)
14460
+ lines.push(body);
14461
+ if (title && title !== body)
14462
+ lines.push(title);
14463
+ if (link)
14464
+ lines.push(link);
14465
+ if (imageUrl)
14466
+ lines.push(`[image] ${imageUrl}`);
14467
+ if (lines.length)
14468
+ parts.push(lines.join("\n"));
14469
+ if (Array.isArray(att.files))
14470
+ files.push(...att.files);
14438
14471
  }
14439
14472
  return { text: parts.join("\n\n"), files };
14440
14473
  }
@@ -14443,7 +14476,7 @@ function hasForwardedContent(attachments) {
14443
14476
  return text.length > 0 || files.length > 0;
14444
14477
  }
14445
14478
 
14446
- // src/slack-inbound-filter.ts
14479
+ // ../core/dist/channels/governance/slack-inbound-filter.js
14447
14480
  var ALLOWED_MESSAGE_SUBTYPES = /* @__PURE__ */ new Set([
14448
14481
  void 0,
14449
14482
  "file_share",
@@ -14469,9 +14502,12 @@ function decideSlackMessageForward(evt) {
14469
14502
  return { forward: true };
14470
14503
  }
14471
14504
  function isAppMentionEcho(evt, botUserId2) {
14472
- if (evt.type !== "message") return false;
14473
- if (!botUserId2) return false;
14474
- if (evt.channel?.startsWith("D")) return false;
14505
+ if (evt.type !== "message")
14506
+ return false;
14507
+ if (!botUserId2)
14508
+ return false;
14509
+ if (evt.channel?.startsWith("D"))
14510
+ return false;
14475
14511
  return typeof evt.text === "string" && evt.text.includes(`<@${botUserId2}>`);
14476
14512
  }
14477
14513
  function decideSlackEngagement(input) {
@@ -14485,18 +14521,21 @@ function decideSlackAckReaction(input) {
14485
14521
  return Boolean(input.channel && input.ts);
14486
14522
  }
14487
14523
  function isRestartSenderAllowed(allowedUsers, userId) {
14488
- if (allowedUsers.size === 0) return true;
14524
+ if (allowedUsers.size === 0)
14525
+ return true;
14489
14526
  return userId != null && allowedUsers.has(userId);
14490
14527
  }
14491
14528
  function extractAugmentedSlackLabel(evt) {
14492
- if (evt.metadata?.event_type !== "augmented_agent_message") return null;
14529
+ if (evt.metadata?.event_type !== "augmented_agent_message")
14530
+ return null;
14493
14531
  return {
14494
14532
  teamId: evt.metadata.event_payload?.["augmented_team_id"],
14495
14533
  agentId: evt.metadata.event_payload?.["augmented_agent_id"]
14496
14534
  };
14497
14535
  }
14498
14536
  function decideModeForward(evt, policy) {
14499
- if (policy.mode === "all") return { forward: true };
14537
+ if (policy.mode === "all")
14538
+ return { forward: true };
14500
14539
  if (policy.mode === "manager_only") {
14501
14540
  if (policy.principalSlackUserId && evt.user === policy.principalSlackUserId) {
14502
14541
  return { forward: true };
@@ -14508,7 +14547,8 @@ function decideModeForward(evt, policy) {
14508
14547
  }
14509
14548
  }
14510
14549
  const label = extractAugmentedSlackLabel(evt);
14511
- if (!label) return { forward: false, reason: "sender_policy" };
14550
+ if (!label)
14551
+ return { forward: false, reason: "sender_policy" };
14512
14552
  if (policy.mode === "team_agents_only" || policy.mode === "manager_only" || policy.mode === "team_only") {
14513
14553
  if (!policy.teamId || label.teamId !== policy.teamId) {
14514
14554
  return { forward: false, reason: "sender_policy" };
@@ -14518,13 +14558,15 @@ function decideModeForward(evt, policy) {
14518
14558
  }
14519
14559
  function decideSenderPolicyForward(evt, policy) {
14520
14560
  if (policy.internalOnly) {
14521
- if (!policy.homeTeamId) return { forward: false, reason: "sender_policy" };
14522
- if (evt.team !== policy.homeTeamId) return { forward: false, reason: "sender_policy" };
14561
+ if (!policy.homeTeamId)
14562
+ return { forward: false, reason: "sender_policy" };
14563
+ if (evt.team !== policy.homeTeamId)
14564
+ return { forward: false, reason: "sender_policy" };
14523
14565
  }
14524
14566
  return decideModeForward(evt, policy);
14525
14567
  }
14526
14568
 
14527
- // src/sender-policy-decline.ts
14569
+ // ../core/dist/channels/governance/sender-policy-decline.js
14528
14570
  function classifySlackPolicyBlock(evt, policy) {
14529
14571
  if (policy.internalOnly && (!policy.homeTeamId || evt.team !== policy.homeTeamId)) {
14530
14572
  return "internal_only";
@@ -14572,13 +14614,15 @@ function declineCacheKey(channelId, senderId, reason) {
14572
14614
  }
14573
14615
  function readDeclineCooldownMs(envVarName, defaultSeconds = 1800) {
14574
14616
  const raw = process.env[envVarName];
14575
- if (!raw) return defaultSeconds * 1e3;
14617
+ if (!raw)
14618
+ return defaultSeconds * 1e3;
14576
14619
  const parsed = Number(raw);
14577
- if (!Number.isFinite(parsed) || parsed < 0) return defaultSeconds * 1e3;
14620
+ if (!Number.isFinite(parsed) || parsed < 0)
14621
+ return defaultSeconds * 1e3;
14578
14622
  return parsed * 1e3;
14579
14623
  }
14580
14624
 
14581
- // src/inbound-access.ts
14625
+ // ../core/dist/channels/governance/inbound-access.js
14582
14626
  function decideInboundAccess(input) {
14583
14627
  if (!input.content.forward) {
14584
14628
  return { kind: "drop", reason: `content:${input.content.reason}` };
@@ -17609,10 +17653,11 @@ function buildDmUserInfo(usersInfoRes) {
17609
17653
  return out;
17610
17654
  }
17611
17655
 
17612
- // src/slack-peer-classifier.ts
17656
+ // ../core/dist/channels/governance/slack-peer-classifier.js
17613
17657
  var CODE_NAME_RE = /^[a-z0-9]+(-[a-z0-9]+)*$/;
17614
17658
  function classifyPeerMessage(msg, cfg, self) {
17615
- if (!msg.bot_id) return { kind: "human" };
17659
+ if (!msg.bot_id)
17660
+ return { kind: "human" };
17616
17661
  if (self.bot_user_id !== null && msg.user === self.bot_user_id) {
17617
17662
  return { kind: "self" };
17618
17663
  }
@@ -17669,14 +17714,16 @@ function classifyAddressing(msg, ourBotUserId) {
17669
17714
  return { addressed: false, viaReplyOnly: false };
17670
17715
  }
17671
17716
  function parsePeersEnv(raw, gateRaw) {
17672
- if (!raw || raw.trim().length === 0) return [];
17717
+ if (!raw || raw.trim().length === 0)
17718
+ return [];
17673
17719
  let parsed;
17674
17720
  try {
17675
17721
  parsed = JSON.parse(raw);
17676
17722
  } catch {
17677
17723
  return [];
17678
17724
  }
17679
- if (!Array.isArray(parsed)) return [];
17725
+ if (!Array.isArray(parsed))
17726
+ return [];
17680
17727
  const gateMap = /* @__PURE__ */ new Map();
17681
17728
  let gateConfigInvalid = false;
17682
17729
  if (gateRaw && gateRaw.trim().length > 0) {
@@ -17706,9 +17753,7 @@ function parsePeersEnv(raw, gateRaw) {
17706
17753
  gateConfigInvalid = true;
17707
17754
  }
17708
17755
  if (gateConfigInvalid) {
17709
- console.error(
17710
- "[slack-peer-classifier] SLACK_PEERS_GATE is present but malformed; failing closed (every peer drops as cross_team_grant_missing)"
17711
- );
17756
+ console.error("[slack-peer-classifier] SLACK_PEERS_GATE is present but malformed; failing closed (every peer drops as cross_team_grant_missing)");
17712
17757
  }
17713
17758
  }
17714
17759
  const out = [];
@@ -17731,11 +17776,13 @@ function parsePeersEnv(raw, gateRaw) {
17731
17776
  return out;
17732
17777
  }
17733
17778
  function parsePeerGroupIdsEnv(raw) {
17734
- if (!raw) return [];
17779
+ if (!raw)
17780
+ return [];
17735
17781
  return raw.split(",").map((s) => s.trim()).filter(Boolean);
17736
17782
  }
17737
17783
  function parsePeerAgentModeEnv(raw) {
17738
- if (raw === "listen" || raw === "respond") return raw;
17784
+ if (raw === "listen" || raw === "respond")
17785
+ return raw;
17739
17786
  return "off";
17740
17787
  }
17741
17788
 
@@ -14766,14 +14766,17 @@ function buildChannelInfoResult(input) {
14766
14766
  };
14767
14767
  }
14768
14768
 
14769
- // src/teams-inbound-filter.ts
14769
+ // ../core/dist/channels/governance/teams-inbound-filter.js
14770
14770
  function mentionsBot(text, activity, botObjectId) {
14771
- if (!botObjectId) return text.includes("<at>");
14771
+ if (!botObjectId)
14772
+ return text.includes("<at>");
14772
14773
  const mentionEntities = activity.entities?.filter((e) => e.type === "mention") ?? [];
14773
14774
  for (const e of mentionEntities) {
14774
- if (e.mentioned?.id === botObjectId) return true;
14775
+ if (e.mentioned?.id === botObjectId)
14776
+ return true;
14775
14777
  }
14776
- if (mentionEntities.length === 0 && text.includes("<at>")) return true;
14778
+ if (mentionEntities.length === 0 && text.includes("<at>"))
14779
+ return true;
14777
14780
  return false;
14778
14781
  }
14779
14782
  function decideTeamsActivityForward(input) {
@@ -14813,11 +14816,13 @@ function decideTeamsActivityForward(input) {
14813
14816
  }
14814
14817
  function extractAugmentedTeamsLabel(activity) {
14815
14818
  const entity = activity.entities?.find((e) => e.type === "augmented/agent");
14816
- if (!entity) return null;
14819
+ if (!entity)
14820
+ return null;
14817
14821
  return { teamId: entity.teamId, agentId: entity.agentId };
14818
14822
  }
14819
14823
  function decideModeForwardTeams(activity, policy) {
14820
- if (policy.mode === "all") return { forward: true };
14824
+ if (policy.mode === "all")
14825
+ return { forward: true };
14821
14826
  if (policy.mode === "manager_only") {
14822
14827
  if (policy.principalAadObjectId && activity.from?.aadObjectId === policy.principalAadObjectId) {
14823
14828
  return { forward: true };
@@ -14830,7 +14835,8 @@ function decideModeForwardTeams(activity, policy) {
14830
14835
  }
14831
14836
  }
14832
14837
  const label = extractAugmentedTeamsLabel(activity);
14833
- if (!label) return { forward: false, reason: "sender_policy" };
14838
+ if (!label)
14839
+ return { forward: false, reason: "sender_policy" };
14834
14840
  if (policy.mode === "team_agents_only" || policy.mode === "manager_only" || policy.mode === "team_only") {
14835
14841
  if (!policy.teamId || label.teamId !== policy.teamId) {
14836
14842
  return { forward: false, reason: "sender_policy" };
@@ -14840,7 +14846,8 @@ function decideModeForwardTeams(activity, policy) {
14840
14846
  }
14841
14847
  function decideSenderPolicyForwardTeams(activity, policy) {
14842
14848
  if (policy.internalOnly) {
14843
- if (!policy.homeTenantId) return { forward: false, reason: "sender_policy" };
14849
+ if (!policy.homeTenantId)
14850
+ return { forward: false, reason: "sender_policy" };
14844
14851
  const senderTenant = activity.channelData?.tenant?.id ?? activity.conversation?.tenantId;
14845
14852
  if (senderTenant !== policy.homeTenantId) {
14846
14853
  return { forward: false, reason: "sender_policy" };
@@ -14849,7 +14856,7 @@ function decideSenderPolicyForwardTeams(activity, policy) {
14849
14856
  return decideModeForwardTeams(activity, policy);
14850
14857
  }
14851
14858
 
14852
- // src/sender-policy-decline.ts
14859
+ // ../core/dist/channels/governance/sender-policy-decline.js
14853
14860
  function classifyTeamsPolicyBlock(activity, policy) {
14854
14861
  const senderTenantId = activity.channelData?.tenant?.id ?? activity.conversation?.tenantId;
14855
14862
  if (policy.internalOnly && (!policy.homeTenantId || policy.homeTenantId === "common" || senderTenantId !== policy.homeTenantId)) {
@@ -14898,13 +14905,15 @@ function declineCacheKey(channelId, senderId, reason) {
14898
14905
  }
14899
14906
  function readDeclineCooldownMs(envVarName, defaultSeconds = 1800) {
14900
14907
  const raw = process.env[envVarName];
14901
- if (!raw) return defaultSeconds * 1e3;
14908
+ if (!raw)
14909
+ return defaultSeconds * 1e3;
14902
14910
  const parsed = Number(raw);
14903
- if (!Number.isFinite(parsed) || parsed < 0) return defaultSeconds * 1e3;
14911
+ if (!Number.isFinite(parsed) || parsed < 0)
14912
+ return defaultSeconds * 1e3;
14904
14913
  return parsed * 1e3;
14905
14914
  }
14906
14915
 
14907
- // src/inbound-access.ts
14916
+ // ../core/dist/channels/governance/inbound-access.js
14908
14917
  function decideInboundAccess(input) {
14909
14918
  if (!input.content.forward) {
14910
14919
  return { kind: "drop", reason: `content:${input.content.reason}` };
@@ -14836,9 +14836,10 @@ function configFromEnv(env = process.env) {
14836
14836
  };
14837
14837
  }
14838
14838
 
14839
- // src/telegram-peer-classifier.ts
14839
+ // ../core/dist/channels/governance/telegram-peer-classifier.js
14840
14840
  function classifyPeerMessage(msg, cfg, self) {
14841
- if (!msg.from?.is_bot) return { kind: "human" };
14841
+ if (!msg.from?.is_bot)
14842
+ return { kind: "human" };
14842
14843
  if (self.bot_id !== null && msg.from.id === self.bot_id) {
14843
14844
  return { kind: "self" };
14844
14845
  }
@@ -14901,20 +14902,24 @@ function classifyAddressing(msg, ourBotId, ourBotUsername) {
14901
14902
  }
14902
14903
  }
14903
14904
  const viaReply = msg.reply_to_message?.from?.id === ourBotId;
14904
- if (viaMentionOrCommand) return { addressed: true, viaReplyOnly: false };
14905
- if (viaReply) return { addressed: true, viaReplyOnly: true };
14905
+ if (viaMentionOrCommand)
14906
+ return { addressed: true, viaReplyOnly: false };
14907
+ if (viaReply)
14908
+ return { addressed: true, viaReplyOnly: true };
14906
14909
  return { addressed: false, viaReplyOnly: false };
14907
14910
  }
14908
14911
  var CODE_NAME_RE = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
14909
14912
  function parsePeersEnv(raw, gateRaw) {
14910
- if (!raw || raw.trim().length === 0) return [];
14913
+ if (!raw || raw.trim().length === 0)
14914
+ return [];
14911
14915
  let parsed;
14912
14916
  try {
14913
14917
  parsed = JSON.parse(raw);
14914
14918
  } catch {
14915
14919
  return [];
14916
14920
  }
14917
- if (!Array.isArray(parsed)) return [];
14921
+ if (!Array.isArray(parsed))
14922
+ return [];
14918
14923
  const gateMap = /* @__PURE__ */ new Map();
14919
14924
  let gateConfigInvalid = false;
14920
14925
  if (gateRaw && gateRaw.trim().length > 0) {
@@ -14944,9 +14949,7 @@ function parsePeersEnv(raw, gateRaw) {
14944
14949
  gateConfigInvalid = true;
14945
14950
  }
14946
14951
  if (gateConfigInvalid) {
14947
- console.error(
14948
- "[telegram-peer-classifier] TELEGRAM_PEERS_GATE is present but malformed; failing closed (every peer drops as cross_team_grant_missing)"
14949
- );
14952
+ console.error("[telegram-peer-classifier] TELEGRAM_PEERS_GATE is present but malformed; failing closed (every peer drops as cross_team_grant_missing)");
14950
14953
  }
14951
14954
  }
14952
14955
  const out = [];
@@ -14968,15 +14971,17 @@ function parsePeersEnv(raw, gateRaw) {
14968
14971
  return out;
14969
14972
  }
14970
14973
  function parsePeerGroupIdsEnv(raw) {
14971
- if (!raw) return [];
14974
+ if (!raw)
14975
+ return [];
14972
14976
  return raw.split(",").map((s) => s.trim()).filter(Boolean);
14973
14977
  }
14974
14978
  function parsePeerAgentModeEnv(raw) {
14975
- if (raw === "listen" || raw === "respond") return raw;
14979
+ if (raw === "listen" || raw === "respond")
14980
+ return raw;
14976
14981
  return "off";
14977
14982
  }
14978
14983
 
14979
- // src/sender-policy-decline.ts
14984
+ // ../core/dist/channels/governance/sender-policy-decline.js
14980
14985
  function politeDeclineCopy(reason) {
14981
14986
  switch (reason) {
14982
14987
  case "internal_only":
@@ -15003,7 +15008,7 @@ function decideDeclineReply(input) {
15003
15008
  return { reply: true };
15004
15009
  }
15005
15010
 
15006
- // src/inbound-access.ts
15011
+ // ../core/dist/channels/governance/inbound-access.js
15007
15012
  function decideInboundAccess(input) {
15008
15013
  if (!input.content.forward) {
15009
15014
  return { kind: "drop", reason: `content:${input.content.reason}` };
@@ -36,7 +36,7 @@ import {
36
36
  writeDirectChatSessionState,
37
37
  writeEgressAllowlist,
38
38
  writePersistentClaudeWrapper
39
- } from "./chunk-ISHK77EM.js";
39
+ } from "./chunk-NAS4DZNG.js";
40
40
  import "./chunk-XWVM4KPK.js";
41
41
  export {
42
42
  EGRESS_BASELINE_DOMAINS,
@@ -77,4 +77,4 @@ export {
77
77
  writeEgressAllowlist,
78
78
  writePersistentClaudeWrapper
79
79
  };
80
- //# sourceMappingURL=persistent-session-U5IQYEXX.js.map
80
+ //# sourceMappingURL=persistent-session-ZQSAZIVM.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  paneLogPath
3
- } from "./chunk-ISHK77EM.js";
3
+ } from "./chunk-NAS4DZNG.js";
4
4
  import "./chunk-XWVM4KPK.js";
5
5
 
6
6
  // src/lib/responsiveness-probe.ts
@@ -427,4 +427,4 @@ export {
427
427
  readAndResetSlackReplyBindingClassifications,
428
428
  readAndResetSlackReplyTargetClassifications
429
429
  };
430
- //# sourceMappingURL=responsiveness-probe-YIESMTKL.js.map
430
+ //# sourceMappingURL=responsiveness-probe-NARLJJGH.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integrity-labs/agt-cli",
3
- "version": "0.28.319",
3
+ "version": "0.28.321",
4
4
  "description": "Augmented Team CLI — agent provisioning and management",
5
5
  "type": "module",
6
6
  "engines": {