@integrity-labs/agt-cli 0.28.1287 → 0.28.1288

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.
@@ -15,7 +15,7 @@ import {
15
15
  mintRotatedHostKey,
16
16
  probeHostKey,
17
17
  setConfigHash
18
- } from "./chunk-3EUTIUAI.js";
18
+ } from "./chunk-Z7T5B4ES.js";
19
19
  import "./chunk-DITI25ZO.js";
20
20
  import "./chunk-DGUM43GV.js";
21
21
  export {
@@ -36,4 +36,4 @@ export {
36
36
  probeHostKey,
37
37
  setConfigHash
38
38
  };
39
- //# sourceMappingURL=api-client-GHNWOERY.js.map
39
+ //# sourceMappingURL=api-client-ONUS5KBY.js.map
package/dist/bin/agt.js CHANGED
@@ -31,7 +31,7 @@ import {
31
31
  success,
32
32
  table,
33
33
  warn
34
- } from "../chunk-QMHI734Y.js";
34
+ } from "../chunk-KWGJU7EK.js";
35
35
  import {
36
36
  ApiError,
37
37
  PROD_AGT_HOST,
@@ -42,7 +42,7 @@ import {
42
42
  getHost,
43
43
  getHostId,
44
44
  setActiveTeam
45
- } from "../chunk-3EUTIUAI.js";
45
+ } from "../chunk-Z7T5B4ES.js";
46
46
  import {
47
47
  getProjectDir,
48
48
  isSessionResumeDisabled,
@@ -5207,7 +5207,7 @@ import { execFileSync, execSync } from "child_process";
5207
5207
  import { existsSync as existsSync10, realpathSync as realpathSync2 } from "fs";
5208
5208
  import chalk17 from "chalk";
5209
5209
  import ora15 from "ora";
5210
- var cliVersion = true ? "0.28.1287" : "dev";
5210
+ var cliVersion = true ? "0.28.1288" : "dev";
5211
5211
  async function fetchLatestVersion() {
5212
5212
  const host2 = getHost();
5213
5213
  if (!host2) return null;
@@ -6467,7 +6467,7 @@ function handleError(err) {
6467
6467
  }
6468
6468
 
6469
6469
  // src/bin/agt.ts
6470
- var cliVersion2 = true ? "0.28.1287" : "dev";
6470
+ var cliVersion2 = true ? "0.28.1288" : "dev";
6471
6471
  var program = new Command();
6472
6472
  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");
6473
6473
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -2,7 +2,7 @@ import {
2
2
  exchangeApiKey,
3
3
  getApiKey,
4
4
  getHost
5
- } from "./chunk-3EUTIUAI.js";
5
+ } from "./chunk-Z7T5B4ES.js";
6
6
  import {
7
7
  LATE_BOUND_VARS,
8
8
  PLATFORM_DENY_PERMISSIONS,
@@ -13853,4 +13853,4 @@ export {
13853
13853
  managerInstallSystemUnitCommand,
13854
13854
  managerUninstallSystemUnitCommand
13855
13855
  };
13856
- //# sourceMappingURL=chunk-QMHI734Y.js.map
13856
+ //# sourceMappingURL=chunk-KWGJU7EK.js.map
@@ -103,7 +103,7 @@ function exchangeFailureKind(err) {
103
103
  }
104
104
 
105
105
  // src/lib/api-client.ts
106
- var agtCliVersion = true ? "0.28.1287" : "dev";
106
+ var agtCliVersion = true ? "0.28.1288" : "dev";
107
107
  var lastConfigHash = null;
108
108
  function setConfigHash(hash) {
109
109
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -468,4 +468,4 @@ export {
468
468
  api,
469
469
  getHostId
470
470
  };
471
- //# sourceMappingURL=chunk-3EUTIUAI.js.map
471
+ //# sourceMappingURL=chunk-Z7T5B4ES.js.map
@@ -70,7 +70,7 @@ import {
70
70
  tripClass,
71
71
  writeEtcEnvironment,
72
72
  writeProfileDScript
73
- } from "../chunk-QMHI734Y.js";
73
+ } from "../chunk-KWGJU7EK.js";
74
74
  import {
75
75
  ApiError,
76
76
  adoptHostKeyInProcess,
@@ -88,7 +88,7 @@ import {
88
88
  probeHostKey,
89
89
  requireHost,
90
90
  setConfigHash
91
- } from "../chunk-3EUTIUAI.js";
91
+ } from "../chunk-Z7T5B4ES.js";
92
92
  import {
93
93
  BLOCKED_ON_PROMPT_DECISION,
94
94
  CHANNEL_SECRET_ENV_KEYS,
@@ -15444,7 +15444,7 @@ function createFileMigrationReportIO(codeName, log2) {
15444
15444
  };
15445
15445
  }
15446
15446
  var managerHostPost = async (path, body) => {
15447
- const { api: api2, ApiError: ApiError3 } = await import("../api-client-GHNWOERY.js");
15447
+ const { api: api2, ApiError: ApiError3 } = await import("../api-client-ONUS5KBY.js");
15448
15448
  try {
15449
15449
  const json = await api2.post(path, body);
15450
15450
  return { status: 200, json };
@@ -18380,7 +18380,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
18380
18380
  var lastVersionCheckAt = 0;
18381
18381
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
18382
18382
  var lastResponsivenessProbeAt = 0;
18383
- var agtCliVersion = true ? "0.28.1287" : "dev";
18383
+ var agtCliVersion = true ? "0.28.1288" : "dev";
18384
18384
  function resolveBrewPath(execFileSync5) {
18385
18385
  try {
18386
18386
  const out = execFileSync5("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -47834,6 +47834,28 @@ function textMentionsBot(text, botId) {
47834
47834
  return text.includes(`<@${botId}>`);
47835
47835
  }
47836
47836
 
47837
+ // src/slack-thread-follow.ts
47838
+ function trackingForBotPost(input) {
47839
+ if (input.followMode === "off") return null;
47840
+ if (!input.channel) return null;
47841
+ const threadTs = input.landedThreadTs || input.postedTs;
47842
+ if (!threadTs) return null;
47843
+ return {
47844
+ channel: input.channel,
47845
+ threadTs,
47846
+ involvement: input.landedThreadTs ? "mentioned" : "started",
47847
+ botPosted: true
47848
+ };
47849
+ }
47850
+ function threadReplyGate(followMode, involvement) {
47851
+ if (followMode === "off") return { deliver: false, reason: "auto_follow_off" };
47852
+ if (!involvement) return { deliver: false, reason: "thread_not_tracked" };
47853
+ if (followMode === "started" && involvement !== "started") {
47854
+ return { deliver: false, reason: "started_mode_not_started" };
47855
+ }
47856
+ return { deliver: true };
47857
+ }
47858
+
47837
47859
  // src/mcp-spawn-lock.ts
47838
47860
  import {
47839
47861
  existsSync as existsSync9,
@@ -51023,6 +51045,10 @@ function rememberThread(channel, threadTs, involvement, opts = {}) {
51023
51045
  threadPersister?.schedule(trackedThreads);
51024
51046
  }
51025
51047
  }
51048
+ function trackBotPost(channel, landedThreadTs, postedTs) {
51049
+ const t = trackingForBotPost({ followMode: THREAD_AUTO_FOLLOW, channel, landedThreadTs, postedTs });
51050
+ if (t) rememberThread(t.channel, t.threadTs, t.involvement, { botPosted: t.botPosted });
51051
+ }
51026
51052
  if (!BOT_TOKEN || !APP_TOKEN) {
51027
51053
  console.error(
51028
51054
  "slack-channel: Missing SLACK_BOT_TOKEN or SLACK_APP_TOKEN. Cannot start."
@@ -52176,6 +52202,7 @@ ${result.formatted}` : "No messages in range, or the bot is not a member of this
52176
52202
  if (channel && thread_ts) {
52177
52203
  clearPendingMessage(channel, thread_ts);
52178
52204
  }
52205
+ trackBotPost(channel, thread_ts, void 0);
52179
52206
  const permalink = step3Data.files?.[0]?.permalink;
52180
52207
  return {
52181
52208
  content: [{
@@ -52528,6 +52555,7 @@ async function handleSendStructured(args) {
52528
52555
  return errResult(`Slack chat.postMessage failed: ${result.error ?? "unknown"}`);
52529
52556
  }
52530
52557
  if (effectiveThreadTs) clearPendingMessage(channel, effectiveThreadTs);
52558
+ trackBotPost(channel, effectiveThreadTs, result.ts);
52531
52559
  if (interactiveHostAvailable()) {
52532
52560
  const cfg = {
52533
52561
  apiHost: AGT_HOST,
@@ -52621,6 +52649,7 @@ async function handleAskUser(args) {
52621
52649
  if (!slackResult.ok || !slackResult.ts) {
52622
52650
  return errResult(`Slack chat.postMessage failed: ${slackResult.error ?? "unknown"}`);
52623
52651
  }
52652
+ trackBotPost(channel, thread_ts, slackResult.ts);
52624
52653
  try {
52625
52654
  await runtime.updatePendingInteractionMessageTs(cfg, callbackId, slackResult.ts);
52626
52655
  } catch (err) {
@@ -52733,6 +52762,8 @@ async function handleChannelRequestInput(args) {
52733
52762
  );
52734
52763
  }
52735
52764
  const callbackId = dispatchPayload.callback_id;
52765
+ const requestThread = parseThreadKey(thread_id);
52766
+ if (requestThread) trackBotPost(requestThread.channel, requestThread.threadTs, void 0);
52736
52767
  const deadline = new Date(Date.now() + timeoutSec * 1e3);
52737
52768
  const resolution = await waitForResolution2(cfg, callbackId, { deadline });
52738
52769
  if (resolution.kind === "timeout") {
@@ -53617,17 +53648,10 @@ async function connectSocketMode() {
53617
53648
  })
53618
53649
  );
53619
53650
  };
53620
- if (THREAD_AUTO_FOLLOW === "off") {
53621
- logThreadDrop("auto_follow_off");
53622
- return;
53623
- }
53624
53651
  const threadInvolvement = threadKey ? trackedThreads.get(threadKey)?.involvement : void 0;
53625
- if (!threadInvolvement) {
53626
- logThreadDrop("thread_not_tracked");
53627
- return;
53628
- }
53629
- if (THREAD_AUTO_FOLLOW === "started" && threadInvolvement !== "started") {
53630
- logThreadDrop("started_mode_not_started");
53652
+ const gate = threadReplyGate(THREAD_AUTO_FOLLOW, threadInvolvement);
53653
+ if (!gate.deliver) {
53654
+ logThreadDrop(gate.reason);
53631
53655
  return;
53632
53656
  }
53633
53657
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integrity-labs/agt-cli",
3
- "version": "0.28.1287",
3
+ "version": "0.28.1288",
4
4
  "description": "Augmented Team CLI — agent provisioning and management",
5
5
  "type": "module",
6
6
  "engines": {