@integrity-labs/agt-cli 0.28.322 → 0.28.324

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
@@ -38,7 +38,7 @@ import {
38
38
  success,
39
39
  table,
40
40
  warn
41
- } from "../chunk-FG7ELAP4.js";
41
+ } from "../chunk-KHSPRKK2.js";
42
42
  import {
43
43
  AnchorSessionClient,
44
44
  CHANNEL_REGISTRY,
@@ -68,7 +68,7 @@ import {
68
68
  renderTemplate,
69
69
  resolveChannels,
70
70
  serializeManifestForSlackCli
71
- } from "../chunk-LJT3U3GQ.js";
71
+ } from "../chunk-BSTFCC62.js";
72
72
  import "../chunk-XWVM4KPK.js";
73
73
 
74
74
  // src/bin/agt.ts
@@ -4827,7 +4827,7 @@ import { execFileSync, execSync } from "child_process";
4827
4827
  import { existsSync as existsSync10, realpathSync as realpathSync2 } from "fs";
4828
4828
  import chalk18 from "chalk";
4829
4829
  import ora16 from "ora";
4830
- var cliVersion = true ? "0.28.322" : "dev";
4830
+ var cliVersion = true ? "0.28.324" : "dev";
4831
4831
  async function fetchLatestVersion() {
4832
4832
  const host2 = getHost();
4833
4833
  if (!host2) return null;
@@ -5931,7 +5931,7 @@ function handleError(err) {
5931
5931
  }
5932
5932
 
5933
5933
  // src/bin/agt.ts
5934
- var cliVersion2 = true ? "0.28.322" : "dev";
5934
+ var cliVersion2 = true ? "0.28.324" : "dev";
5935
5935
  var program = new Command();
5936
5936
  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");
5937
5937
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -6733,9 +6733,10 @@ function resolveDmTarget(target, agent, people) {
6733
6733
  detail: `person ${effectivePersonId.person_id} not present in resolver people map`
6734
6734
  };
6735
6735
  }
6736
- const FALLBACK_ORDER = ["slack", "telegram"];
6736
+ const reachable = (m) => agent.dm_capable_mediums.includes(m) && personHasMedium(person, m);
6737
6737
  const preferredMedium = target.medium === "auto" ? null : target.medium;
6738
- const chosenMedium = preferredMedium ? agent.dm_capable_mediums.includes(preferredMedium) && personHasMedium(person, preferredMedium) ? preferredMedium : null : FALLBACK_ORDER.find((m) => agent.dm_capable_mediums.includes(m) && personHasMedium(person, m)) ?? null;
6738
+ const usePreferred = target.follow_reports_to ? person.preferred_channel : null;
6739
+ const chosenMedium = preferredMedium ? reachable(preferredMedium) ? preferredMedium : null : autoMediumOrder(usePreferred).find(reachable) ?? null;
6739
6740
  if (!chosenMedium) {
6740
6741
  return {
6741
6742
  ok: false,
@@ -6778,6 +6779,13 @@ function personHasMedium(person, medium) {
6778
6779
  return Boolean(person.slack_user_id);
6779
6780
  return Boolean(person.telegram_chat_id);
6780
6781
  }
6782
+ function autoMediumOrder(preferred) {
6783
+ const FALLBACK_ORDER = ["slack", "telegram"];
6784
+ if (preferred === "slack" || preferred === "telegram") {
6785
+ return [preferred, ...FALLBACK_ORDER.filter((m) => m !== preferred)];
6786
+ }
6787
+ return FALLBACK_ORDER;
6788
+ }
6781
6789
  function isResolveError(v) {
6782
6790
  return "ok" in v && v.ok === false;
6783
6791
  }
@@ -10032,4 +10040,4 @@ export {
10032
10040
  stopAllSessionsAndWait,
10033
10041
  getProjectDir
10034
10042
  };
10035
- //# sourceMappingURL=chunk-LJT3U3GQ.js.map
10043
+ //# sourceMappingURL=chunk-BSTFCC62.js.map