@integrity-labs/agt-cli 0.28.468 → 0.28.469

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-GTKULQSJ.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.469" : "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.469" : "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.469" : "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-GTKULQSJ.js.map
@@ -44,7 +44,7 @@ import {
44
44
  resolveEffectivePinRaw,
45
45
  safeWriteJsonAtomic,
46
46
  setConfigHash
47
- } from "../chunk-Y2XU2XWM.js";
47
+ } from "../chunk-GTKULQSJ.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.469" : "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,14 @@ 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 reason = opts.forcedRoot ? "forced_root" : inboundUnresolved ? "unresolved_inbound" : inboundWins ? "bound" : opts.scheduledDest ? "scheduled" : "fallback";
38952
+ const fellBack = reason === "unresolved_inbound" || reason === "scheduled";
38953
+ return { effectiveChannel, effectiveThreadTs, settleThreadTs, reason, fellBack };
38926
38954
  }
38927
38955
 
38928
38956
  // src/slack-allowlist-source.ts
@@ -42695,7 +42723,7 @@ mcp.setRequestHandler(ListToolsRequestSchema, async () => ({
42695
42723
  // WS2 (cross-thread reply routing): the preferred way to target a reply.
42696
42724
  inbound_id: {
42697
42725
  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.`
42726
+ 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
42727
  },
42700
42728
  proactive: {
42701
42729
  type: "boolean",
@@ -42707,7 +42735,7 @@ mcp.setRequestHandler(ListToolsRequestSchema, async () => ({
42707
42735
  // conversation is a separate, deliberate action signalled here.
42708
42736
  to_channel_root: {
42709
42737
  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."
42738
+ 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
42739
  }
42712
42740
  },
42713
42741
  required: ["channel", "text"]
@@ -43119,8 +43147,26 @@ mcp.setRequestHandler(CallToolRequestSchema, async (req) => {
43119
43147
  }
43120
43148
  }
43121
43149
  }
43122
- const { effectiveChannel, effectiveThreadTs, settleThreadTs } = resolveSlackScheduledPriority({
43150
+ const {
43151
+ effectiveChannel,
43152
+ effectiveThreadTs,
43153
+ settleThreadTs,
43154
+ reason: routingReason,
43155
+ fellBack: routingFellBack
43156
+ } = resolveSlackScheduledPriority({
43123
43157
  inboundId: inbound_id,
43158
+ // ENG-8280: tell the resolver whether the inbound_id actually resolved.
43159
+ // `binding.unknownInboundId` was already computed here and fed to
43160
+ // telemetry, but never to routing — so an id the registry could not find
43161
+ // was still treated as an authoritative "post nowhere", discarding the
43162
+ // message_ts / active-card / hot-thread fallbacks and landing the reply
43163
+ // at the channel root with the agent told only `sent`.
43164
+ inboundResolved: !binding.unknownInboundId,
43165
+ // ENG-8280: an explicit to_channel_root (or the thread_ts:null sentinel)
43166
+ // was previously honoured ONLY on the plain-reply branch, so pairing it
43167
+ // with an inbound_id silently ignored it. It is the least ambiguous
43168
+ // instruction this tool takes and now wins everywhere.
43169
+ forcedRoot,
43124
43170
  enforceBound,
43125
43171
  scheduledDest: scheduledDest ?? null,
43126
43172
  bindingChannel: binding.channel,
@@ -43289,6 +43335,19 @@ mcp.setRequestHandler(CallToolRequestSchema, async (req) => {
43289
43335
  );
43290
43336
  }
43291
43337
  }
43338
+ base += `. ${describeSendOutcome({
43339
+ channel: effectiveChannel,
43340
+ threadTs: effectiveThreadTs,
43341
+ reason: routingReason,
43342
+ fellBack: routingFellBack,
43343
+ requestedInboundId: inbound_id
43344
+ })}`;
43345
+ if (routingFellBack) {
43346
+ process.stderr.write(
43347
+ `slack-channel(${AGENT_CODE_NAME}): send_fell_back reason=${routingReason} channel=${redactSlackId(effectiveChannel)} thread=${redactSlackId(effectiveThreadTs)} inbound_id=${redactSlackId(inbound_id ?? void 0)}
43348
+ `
43349
+ );
43350
+ }
43292
43351
  const sentTs = typeof data.ts === "string" ? data.ts : void 0;
43293
43352
  await maybeSendSlackAccountWarn({ channel: effectiveChannel, threadTs: effectiveThreadTs });
43294
43353
  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.469",
4
4
  "description": "Augmented Team CLI — agent provisioning and management",
5
5
  "type": "module",
6
6
  "engines": {