@integrity-labs/agt-cli 0.28.468 → 0.28.470

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,7 +40,7 @@ import {
40
40
  success,
41
41
  table,
42
42
  warn
43
- } from "../chunk-Y2XU2XWM.js";
43
+ } from "../chunk-BFCHF4XF.js";
44
44
  import {
45
45
  AnchorSessionClient,
46
46
  CHANNEL_REGISTRY,
@@ -4830,7 +4830,7 @@ import { execFileSync, execSync } from "child_process";
4830
4830
  import { existsSync as existsSync10, realpathSync as realpathSync2 } from "fs";
4831
4831
  import chalk18 from "chalk";
4832
4832
  import ora16 from "ora";
4833
- var cliVersion = true ? "0.28.468" : "dev";
4833
+ var cliVersion = true ? "0.28.470" : "dev";
4834
4834
  async function fetchLatestVersion() {
4835
4835
  const host2 = getHost();
4836
4836
  if (!host2) return null;
@@ -6002,7 +6002,7 @@ function handleError(err) {
6002
6002
  }
6003
6003
 
6004
6004
  // src/bin/agt.ts
6005
- var cliVersion2 = true ? "0.28.468" : "dev";
6005
+ var cliVersion2 = true ? "0.28.470" : "dev";
6006
6006
  var program = new Command();
6007
6007
  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");
6008
6008
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -4932,7 +4932,7 @@ function exchangeFailureKind(err) {
4932
4932
  }
4933
4933
 
4934
4934
  // src/lib/api-client.ts
4935
- var agtCliVersion = true ? "0.28.468" : "dev";
4935
+ var agtCliVersion = true ? "0.28.470" : "dev";
4936
4936
  var lastConfigHash = null;
4937
4937
  function setConfigHash(hash) {
4938
4938
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -7661,4 +7661,4 @@ export {
7661
7661
  managerInstallSystemUnitCommand,
7662
7662
  managerUninstallSystemUnitCommand
7663
7663
  };
7664
- //# sourceMappingURL=chunk-Y2XU2XWM.js.map
7664
+ //# sourceMappingURL=chunk-BFCHF4XF.js.map
@@ -44,7 +44,7 @@ import {
44
44
  resolveEffectivePinRaw,
45
45
  safeWriteJsonAtomic,
46
46
  setConfigHash
47
- } from "../chunk-Y2XU2XWM.js";
47
+ } from "../chunk-BFCHF4XF.js";
48
48
  import {
49
49
  getProjectDir as getProjectDir2,
50
50
  getReadyTasks,
@@ -10038,7 +10038,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
10038
10038
  var lastVersionCheckAt = 0;
10039
10039
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
10040
10040
  var lastResponsivenessProbeAt = 0;
10041
- var agtCliVersion = true ? "0.28.468" : "dev";
10041
+ var agtCliVersion = true ? "0.28.470" : "dev";
10042
10042
  function resolveBrewPath(execFileSync2) {
10043
10043
  try {
10044
10044
  const out = execFileSync2("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -38733,6 +38733,31 @@ function describeChannelRedirect(input) {
38733
38733
  return `Heads up: this was delivered to ${effectiveChannel}, NOT the ${requestedChannel} you named${why}. routed_to=${effectiveChannel}. If ${effectiveChannel} is not where you intended this to go, the destination is misconfigured; do not assume it posted to ${requestedChannel}.`;
38734
38734
  }
38735
38735
 
38736
+ // src/channel-send-destination.ts
38737
+ function describeSendDestination(dest) {
38738
+ const where = dest.threadTs ? `channel=${dest.channel} thread_ts=${dest.threadTs}` : `channel=${dest.channel} at the channel root (no thread)`;
38739
+ return `\u2192 ${where}`;
38740
+ }
38741
+ function describeSendFallback(dest) {
38742
+ if (!dest.fellBack) return null;
38743
+ switch (dest.reason) {
38744
+ case "unresolved_inbound": {
38745
+ const id = dest.requestedInboundId ? ` "${dest.requestedInboundId}"` : "";
38746
+ const landed = dest.threadTs ? `Your coordinates were used instead and it threaded correctly.` : `Your coordinates did not name a thread either, so it posted at the CHANNEL ROOT \u2014 if you meant to continue a thread, resend with an explicit thread_ts.`;
38747
+ return `WARNING: the inbound_id${id} you named could not be resolved (it may be stale, or this process restarted since that message was answered). ${landed}`;
38748
+ }
38749
+ case "scheduled":
38750
+ return `WARNING: this was routed to the active scheduled-task destination rather than the channel you named. If you meant to answer a person, name their inbound_id.`;
38751
+ default:
38752
+ return null;
38753
+ }
38754
+ }
38755
+ function describeSendOutcome(dest) {
38756
+ const warning = describeSendFallback(dest);
38757
+ const where = describeSendDestination(dest);
38758
+ return warning ? `${warning} ${where}` : where;
38759
+ }
38760
+
38736
38761
  // src/slack-reply-binding-telemetry.ts
38737
38762
  import { readFileSync as readFileSync17, writeFileSync as writeFileSync11 } from "fs";
38738
38763
  import { join as join17 } from "path";
@@ -38918,11 +38943,15 @@ function scheduledDestOverridesNamedChannel(opts) {
38918
38943
  return opts.scheduledTargetChannel !== opts.namedChannel;
38919
38944
  }
38920
38945
  function resolveSlackScheduledPriority(opts) {
38921
- const inboundWins = !!(opts.inboundId || opts.enforceBound);
38922
- const effectiveChannel = inboundWins ? opts.bindingChannel ?? opts.fallbackChannel : opts.scheduledDest ? opts.scheduledDest.channel : opts.fallbackChannel;
38923
- const effectiveThreadTs = inboundWins ? opts.bindingThreadTs ?? void 0 : opts.scheduledDest ? opts.scheduledDest.thread_ts : opts.fallbackThreadTs ?? void 0;
38946
+ const inboundUnresolved = !!opts.inboundId && opts.inboundResolved === false;
38947
+ const inboundWins = !!(opts.inboundId && !inboundUnresolved || opts.enforceBound);
38948
+ const effectiveChannel = inboundWins ? opts.bindingChannel ?? opts.fallbackChannel : opts.scheduledDest && !inboundUnresolved ? opts.scheduledDest.channel : opts.fallbackChannel;
38949
+ const effectiveThreadTs = opts.forcedRoot ? void 0 : inboundWins ? opts.bindingThreadTs ?? void 0 : opts.scheduledDest && !inboundUnresolved ? opts.scheduledDest.thread_ts : opts.fallbackThreadTs ?? void 0;
38924
38950
  const settleThreadTs = inboundWins ? opts.bindingThreadTs ?? void 0 : opts.fallbackSettleThreadTs ?? void 0;
38925
- return { effectiveChannel, effectiveThreadTs, settleThreadTs };
38951
+ const scheduledRetarget = !inboundWins && !inboundUnresolved && !!opts.scheduledDest;
38952
+ const fellBack = inboundUnresolved || scheduledRetarget;
38953
+ const reason = inboundUnresolved ? "unresolved_inbound" : scheduledRetarget ? "scheduled" : opts.forcedRoot ? "forced_root" : inboundWins ? "bound" : "fallback";
38954
+ return { effectiveChannel, effectiveThreadTs, settleThreadTs, reason, fellBack };
38926
38955
  }
38927
38956
 
38928
38957
  // src/slack-allowlist-source.ts
@@ -42695,7 +42724,7 @@ mcp.setRequestHandler(ListToolsRequestSchema, async () => ({
42695
42724
  // WS2 (cross-thread reply routing): the preferred way to target a reply.
42696
42725
  inbound_id: {
42697
42726
  type: "string",
42698
- description: `The inbound_id attribute of the <channel> tag you are answering (e.g. "ib_a1b2c3d4e5f6"). ALWAYS include it when replying to a message - it is STRONGLY PREFERRED over channel/thread_ts/message_ts because the server resolves the exact destination (channel AND thread) from it, so your reply can never land in another user's channel or thread. Copy it verbatim from the tag of the message you are replying to. Omit it only for a proactive (self-initiated) send.`
42727
+ description: `The inbound_id attribute of the <channel> tag you are answering (e.g. "ib_a1b2c3d4e5f6"). ALWAYS include it when replying to a message - it is STRONGLY PREFERRED over channel/thread_ts/message_ts because the server resolves the exact destination (channel AND thread) from it, so your reply can never land in another user's channel or thread. Copy it verbatim from the tag of the message you are replying to. Omit it only for a proactive (self-initiated) send. NOTE (ENG-8280): an inbound_id can go stale - it stops resolving if this process restarted after you already answered that message. A stale one no longer silently posts at the channel root: the server falls back to your channel/thread_ts coordinates and the response tells you it did. For a self-initiated FOLLOW-UP into a thread you already answered, prefer passing thread_ts explicitly rather than re-using the old inbound_id.`
42699
42728
  },
42700
42729
  proactive: {
42701
42730
  type: "boolean",
@@ -42707,7 +42736,7 @@ mcp.setRequestHandler(ListToolsRequestSchema, async () => ({
42707
42736
  // conversation is a separate, deliberate action signalled here.
42708
42737
  to_channel_root: {
42709
42738
  type: "boolean",
42710
- description: "Set true to DELIBERATELY post a new top-level message at the channel root instead of threading into the conversation you are currently working in. Use it only when you genuinely want to start a new topic in the channel (not a reply to, or a continuation of, an existing thread). Leave it off (default) for anything that belongs in an ongoing thread."
42739
+ description: "Set true to DELIBERATELY post a new top-level message at the channel root instead of threading into the conversation you are currently working in. Use it only when you genuinely want to start a new topic in the channel (not a reply to, or a continuation of, an existing thread). Leave it off (default) for anything that belongs in an ongoing thread. It now overrides every other destination signal including inbound_id (ENG-8280 - previously it was silently ignored whenever inbound_id was also passed)."
42711
42740
  }
42712
42741
  },
42713
42742
  required: ["channel", "text"]
@@ -43119,8 +43148,26 @@ mcp.setRequestHandler(CallToolRequestSchema, async (req) => {
43119
43148
  }
43120
43149
  }
43121
43150
  }
43122
- const { effectiveChannel, effectiveThreadTs, settleThreadTs } = resolveSlackScheduledPriority({
43151
+ const {
43152
+ effectiveChannel,
43153
+ effectiveThreadTs,
43154
+ settleThreadTs,
43155
+ reason: routingReason,
43156
+ fellBack: routingFellBack
43157
+ } = resolveSlackScheduledPriority({
43123
43158
  inboundId: inbound_id,
43159
+ // ENG-8280: tell the resolver whether the inbound_id actually resolved.
43160
+ // `binding.unknownInboundId` was already computed here and fed to
43161
+ // telemetry, but never to routing — so an id the registry could not find
43162
+ // was still treated as an authoritative "post nowhere", discarding the
43163
+ // message_ts / active-card / hot-thread fallbacks and landing the reply
43164
+ // at the channel root with the agent told only `sent`.
43165
+ inboundResolved: !binding.unknownInboundId,
43166
+ // ENG-8280: an explicit to_channel_root (or the thread_ts:null sentinel)
43167
+ // was previously honoured ONLY on the plain-reply branch, so pairing it
43168
+ // with an inbound_id silently ignored it. It is the least ambiguous
43169
+ // instruction this tool takes and now wins everywhere.
43170
+ forcedRoot,
43124
43171
  enforceBound,
43125
43172
  scheduledDest: scheduledDest ?? null,
43126
43173
  bindingChannel: binding.channel,
@@ -43289,6 +43336,19 @@ mcp.setRequestHandler(CallToolRequestSchema, async (req) => {
43289
43336
  );
43290
43337
  }
43291
43338
  }
43339
+ base += `. ${describeSendOutcome({
43340
+ channel: effectiveChannel,
43341
+ threadTs: effectiveThreadTs,
43342
+ reason: routingReason,
43343
+ fellBack: routingFellBack,
43344
+ requestedInboundId: inbound_id
43345
+ })}`;
43346
+ if (routingFellBack) {
43347
+ process.stderr.write(
43348
+ `slack-channel(${AGENT_CODE_NAME}): send_fell_back reason=${routingReason} channel=${redactSlackId(effectiveChannel)} thread=${redactSlackId(effectiveThreadTs)} inbound_id=${redactSlackId(inbound_id ?? void 0)}
43349
+ `
43350
+ );
43351
+ }
43292
43352
  const sentTs = typeof data.ts === "string" ? data.ts : void 0;
43293
43353
  await maybeSendSlackAccountWarn({ channel: effectiveChannel, threadTs: effectiveThreadTs });
43294
43354
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integrity-labs/agt-cli",
3
- "version": "0.28.468",
3
+ "version": "0.28.470",
4
4
  "description": "Augmented Team CLI — agent provisioning and management",
5
5
  "type": "module",
6
6
  "engines": {