@integrity-labs/agt-cli 0.28.977 → 0.28.978

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-TIVMLJTE.js";
43
+ } from "../chunk-7DI7HSGB.js";
44
44
  import {
45
45
  getProjectDir,
46
46
  isSessionResumeDisabled,
@@ -5471,7 +5471,7 @@ import { execFileSync, execSync } from "child_process";
5471
5471
  import { existsSync as existsSync11, realpathSync as realpathSync2 } from "fs";
5472
5472
  import chalk18 from "chalk";
5473
5473
  import ora16 from "ora";
5474
- var cliVersion = true ? "0.28.977" : "dev";
5474
+ var cliVersion = true ? "0.28.978" : "dev";
5475
5475
  async function fetchLatestVersion() {
5476
5476
  const host2 = getHost();
5477
5477
  if (!host2) return null;
@@ -6731,7 +6731,7 @@ function handleError(err) {
6731
6731
  }
6732
6732
 
6733
6733
  // src/bin/agt.ts
6734
- var cliVersion2 = true ? "0.28.977" : "dev";
6734
+ var cliVersion2 = true ? "0.28.978" : "dev";
6735
6735
  var program = new Command();
6736
6736
  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");
6737
6737
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -6967,7 +6967,7 @@ function exchangeFailureKind(err) {
6967
6967
  }
6968
6968
 
6969
6969
  // src/lib/api-client.ts
6970
- var agtCliVersion = true ? "0.28.977" : "dev";
6970
+ var agtCliVersion = true ? "0.28.978" : "dev";
6971
6971
  var lastConfigHash = null;
6972
6972
  function setConfigHash(hash) {
6973
6973
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -11709,4 +11709,4 @@ export {
11709
11709
  managerInstallSystemUnitCommand,
11710
11710
  managerUninstallSystemUnitCommand
11711
11711
  };
11712
- //# sourceMappingURL=chunk-TIVMLJTE.js.map
11712
+ //# sourceMappingURL=chunk-7DI7HSGB.js.map
@@ -63,7 +63,7 @@ import {
63
63
  safeWriteJsonAtomic,
64
64
  setConfigHash,
65
65
  tripClass
66
- } from "../chunk-TIVMLJTE.js";
66
+ } from "../chunk-7DI7HSGB.js";
67
67
  import {
68
68
  getProjectDir as getProjectDir2,
69
69
  getReadyTasks,
@@ -13867,7 +13867,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
13867
13867
  var lastVersionCheckAt = 0;
13868
13868
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
13869
13869
  var lastResponsivenessProbeAt = 0;
13870
- var agtCliVersion = true ? "0.28.977" : "dev";
13870
+ var agtCliVersion = true ? "0.28.978" : "dev";
13871
13871
  function resolveBrewPath(execFileSync2) {
13872
13872
  try {
13873
13873
  const out = execFileSync2("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -29550,6 +29550,12 @@ function buildImpersonationRefusal(toolName) {
29550
29550
  isError: true
29551
29551
  };
29552
29552
  }
29553
+ function shouldRefuseImpersonatedEgress(toolName, egressTools) {
29554
+ if (!isImpersonating()) return null;
29555
+ if (channelsEnabledOverride()) return null;
29556
+ if (!egressTools.has(toolName)) return null;
29557
+ return buildImpersonationRefusal(toolName);
29558
+ }
29553
29559
 
29554
29560
  // src/channel-egress-tools.ts
29555
29561
  var DIRECT_CHAT_EGRESS_TOOLS = /* @__PURE__ */ new Set([
@@ -40718,8 +40724,12 @@ mcp.setRequestHandler(ListToolsRequestSchema, async () => ({
40718
40724
  }));
40719
40725
  mcp.setRequestHandler(CallToolRequestSchema, async (req) => {
40720
40726
  const { name, arguments: args } = req.params;
40721
- if (isImpersonating() && !channelsEnabledOverride() && DIRECT_CHAT_EGRESS_TOOLS.has(name)) {
40722
- return { ...buildImpersonationRefusal(name) };
40727
+ const impersonationRefusal = shouldRefuseImpersonatedEgress(
40728
+ name,
40729
+ DIRECT_CHAT_EGRESS_TOOLS
40730
+ );
40731
+ if (impersonationRefusal) {
40732
+ return { ...impersonationRefusal };
40723
40733
  }
40724
40734
  if (name === "channel_request_input") {
40725
40735
  return {
@@ -40610,6 +40610,12 @@ function buildImpersonationRefusal(toolName) {
40610
40610
  isError: true
40611
40611
  };
40612
40612
  }
40613
+ function shouldRefuseImpersonatedEgress(toolName, egressTools) {
40614
+ if (!isImpersonating()) return null;
40615
+ if (channelsEnabledOverride()) return null;
40616
+ if (!egressTools.has(toolName)) return null;
40617
+ return buildImpersonationRefusal(toolName);
40618
+ }
40613
40619
 
40614
40620
  // src/channel-egress-tools.ts
40615
40621
  var SLACK_EGRESS_TOOLS = /* @__PURE__ */ new Set([
@@ -40618,7 +40624,8 @@ var SLACK_EGRESS_TOOLS = /* @__PURE__ */ new Set([
40618
40624
  "slack.send_structured",
40619
40625
  "slack.ask_user",
40620
40626
  "slack.upload_file",
40621
- "slack.update"
40627
+ "slack.update",
40628
+ "channel_request_input"
40622
40629
  ]);
40623
40630
 
40624
40631
  // src/slack-egress-target.ts
@@ -40631,7 +40638,11 @@ var SLACK_EGRESS_COORDS = {
40631
40638
  "slack.ask_user": { thread: ["thread_ts"] },
40632
40639
  "slack.upload_file": { thread: ["thread_ts"] },
40633
40640
  // required: channel, ts, text — `ts` names the message being edited.
40634
- "slack.update": { message: ["ts"] }
40641
+ "slack.update": { message: ["ts"] },
40642
+ // ENG-10736: posts a button card into the thread named by `thread_id`, which
40643
+ // packs channel and thread into one string. Top-level form (`thread_id` is a
40644
+ // bare channel id, no colon) names no thread, so it contributes no candidate.
40645
+ "channel_request_input": { channelThread: ["thread_id"] }
40635
40646
  };
40636
40647
  function str(v) {
40637
40648
  return typeof v === "string" && v.length > 0 ? v : void 0;
@@ -40650,6 +40661,13 @@ function resolveEgressTargets(toolName, args, registry2) {
40650
40661
  seen.add(k);
40651
40662
  out.push({ channel, threadTs });
40652
40663
  };
40664
+ for (const field of spec.channelThread ?? []) {
40665
+ const raw = str(a[field]);
40666
+ if (!raw) continue;
40667
+ const sep2 = raw.indexOf(":");
40668
+ if (sep2 <= 0) continue;
40669
+ push(raw.slice(0, sep2), str(raw.slice(sep2 + 1)));
40670
+ }
40653
40671
  for (const field of spec.inboundId ?? []) {
40654
40672
  const id = str(a[field]);
40655
40673
  if (!id || !registry2) continue;
@@ -47706,8 +47724,12 @@ mcp.setRequestHandler(ListToolsRequestSchema, async () => ({
47706
47724
  }));
47707
47725
  mcp.setRequestHandler(CallToolRequestSchema, async (req) => {
47708
47726
  const { name, arguments: args } = req.params;
47709
- if (isImpersonating() && !channelsEnabledOverride() && SLACK_EGRESS_TOOLS.has(name)) {
47710
- return buildImpersonationRefusal(name);
47727
+ const impersonationRefusal = shouldRefuseImpersonatedEgress(
47728
+ name,
47729
+ SLACK_EGRESS_TOOLS
47730
+ );
47731
+ if (impersonationRefusal) {
47732
+ return { ...impersonationRefusal };
47711
47733
  }
47712
47734
  if (shouldRefuseEgress({
47713
47735
  toolName: name,
@@ -40796,6 +40796,12 @@ function buildImpersonationRefusal(toolName) {
40796
40796
  isError: true
40797
40797
  };
40798
40798
  }
40799
+ function shouldRefuseImpersonatedEgress(toolName, egressTools) {
40800
+ if (!isImpersonating()) return null;
40801
+ if (channelsEnabledOverride()) return null;
40802
+ if (!egressTools.has(toolName)) return null;
40803
+ return buildImpersonationRefusal(toolName);
40804
+ }
40799
40805
 
40800
40806
  // src/channel-egress-tools.ts
40801
40807
  var TELEGRAM_EGRESS_TOOLS = /* @__PURE__ */ new Set([
@@ -45256,8 +45262,12 @@ mcp.setRequestHandler(ListToolsRequestSchema, async () => ({
45256
45262
  }));
45257
45263
  mcp.setRequestHandler(CallToolRequestSchema, async (req) => {
45258
45264
  const { name, arguments: args } = req.params;
45259
- if (isImpersonating() && !channelsEnabledOverride() && TELEGRAM_EGRESS_TOOLS.has(name)) {
45260
- return buildImpersonationRefusal(name);
45265
+ const impersonationRefusal = shouldRefuseImpersonatedEgress(
45266
+ name,
45267
+ TELEGRAM_EGRESS_TOOLS
45268
+ );
45269
+ if (impersonationRefusal) {
45270
+ return { ...impersonationRefusal };
45261
45271
  }
45262
45272
  if (name === "channel_request_input") {
45263
45273
  return handleChannelRequestInput(args ?? {});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integrity-labs/agt-cli",
3
- "version": "0.28.977",
3
+ "version": "0.28.978",
4
4
  "description": "Augmented Team CLI — agent provisioning and management",
5
5
  "type": "module",
6
6
  "engines": {