@integrity-labs/agt-cli 0.28.98 → 0.28.100

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.
@@ -14353,6 +14353,12 @@ function decideInboundAccess(input) {
14353
14353
  return { kind: "admit" };
14354
14354
  }
14355
14355
 
14356
+ // src/onboarding-dm-gate.ts
14357
+ var ONBOARDING_DM_ONLY_MESSAGE = "Sorry, I can only be onboarded from a Direct Message (DM).";
14358
+ function isSlackDirectMessage(channelId) {
14359
+ return typeof channelId === "string" && channelId.startsWith("D");
14360
+ }
14361
+
14356
14362
  // src/flags-cache-read.ts
14357
14363
  import { existsSync, readFileSync } from "fs";
14358
14364
  import { homedir } from "os";
@@ -18193,6 +18199,14 @@ async function postEphemeralViaResponseUrl(responseUrl, text, logTag) {
18193
18199
  }
18194
18200
  async function forwardOnboardingSlashCommand(opts) {
18195
18201
  const { verb, path, userId, channelId, responseUrl, codeName } = opts;
18202
+ if (!isSlackDirectMessage(channelId)) {
18203
+ await postEphemeralViaResponseUrl(
18204
+ responseUrl,
18205
+ `:warning: ${ONBOARDING_DM_ONLY_MESSAGE}`,
18206
+ codeName
18207
+ );
18208
+ return;
18209
+ }
18196
18210
  if (!AGT_HOST || !AGT_API_KEY || !AGT_AGENT_ID) {
18197
18211
  await postEphemeralViaResponseUrl(
18198
18212
  responseUrl,
@@ -15033,6 +15033,12 @@ function decideInboundAccess(input) {
15033
15033
  return { kind: "admit" };
15034
15034
  }
15035
15035
 
15036
+ // src/onboarding-dm-gate.ts
15037
+ var ONBOARDING_DM_ONLY_MESSAGE = "Sorry, I can only be onboarded from a Direct Message (DM).";
15038
+ function isTelegramPrivateChat(chatType) {
15039
+ return chatType === "private";
15040
+ }
15041
+
15036
15042
  // src/flags-cache-read.ts
15037
15043
  import { existsSync as existsSync2, readFileSync as readFileSync3 } from "fs";
15038
15044
  import { homedir as homedir2 } from "os";
@@ -15698,14 +15704,18 @@ var RESTART = {
15698
15704
  command: "restart",
15699
15705
  description: "Restart this agent"
15700
15706
  };
15707
+ var ONBOARD = {
15708
+ command: "onboard",
15709
+ description: "Re-run this agent's onboarding (re-interview; config kept)"
15710
+ };
15701
15711
  var INVESTIGATE = {
15702
15712
  command: "investigate",
15703
15713
  description: "Live tail of this agent's terminal pane (operators only)"
15704
15714
  };
15705
15715
  function buildCommandRegistrations() {
15706
15716
  return [
15707
- { scope: { type: "default" }, commands: [HELP, STATUS, RESTART] },
15708
- { scope: { type: "all_private_chats" }, commands: [HELP, STATUS, RESTART, INVESTIGATE] }
15717
+ { scope: { type: "default" }, commands: [HELP, STATUS, RESTART, ONBOARD] },
15718
+ { scope: { type: "all_private_chats" }, commands: [HELP, STATUS, RESTART, ONBOARD, INVESTIGATE] }
15709
15719
  ];
15710
15720
  }
15711
15721
 
@@ -17334,6 +17344,14 @@ async function handleOnboardingCommand(opts) {
17334
17344
  );
17335
17345
  }
17336
17346
  };
17347
+ if (!isTelegramPrivateChat(opts.chatType)) {
17348
+ process.stderr.write(
17349
+ `telegram-channel(${AGENT_CODE_NAME}): ${verb} rejected \u2014 not a DM (chat ${redactId(opts.chatId)}, type=${opts.chatType ?? "unknown"})
17350
+ `
17351
+ );
17352
+ await reply(`\u26A0\uFE0F ${ONBOARDING_DM_ONLY_MESSAGE}`);
17353
+ return;
17354
+ }
17337
17355
  if (!AGT_HOST || !AGT_API_KEY || !AGT_AGENT_ID) {
17338
17356
  process.stderr.write(
17339
17357
  `telegram-channel(${AGENT_CODE_NAME}): ${verb} missing AGT_* env \u2014 cannot reach host runtime
@@ -19383,7 +19401,9 @@ async function pollLoop() {
19383
19401
  mode: access.command === "onboard" ? "reset" : "resume",
19384
19402
  // ENG-6578: the manager gate compares the SENDER's user-id (not the
19385
19403
  // chat id — they differ in groups) to the resolved manager principal.
19386
- senderId: msg.from?.id != null ? String(msg.from.id) : void 0
19404
+ senderId: msg.from?.id != null ? String(msg.from.id) : void 0,
19405
+ // ENG-6646: DM-only — reject group/supergroup/channel before forwarding.
19406
+ chatType: msg.chat.type ?? null
19387
19407
  });
19388
19408
  }
19389
19409
  continue;
@@ -34,8 +34,8 @@ import {
34
34
  writeDirectChatSessionState,
35
35
  writeEgressAllowlist,
36
36
  writePersistentClaudeWrapper
37
- } from "./chunk-5NQ652SP.js";
38
- import "./chunk-TRKWWYRN.js";
37
+ } from "./chunk-WNN5WT42.js";
38
+ import "./chunk-5DYG42FL.js";
39
39
  import "./chunk-XWVM4KPK.js";
40
40
  export {
41
41
  EGRESS_BASELINE_DOMAINS,
@@ -74,4 +74,4 @@ export {
74
74
  writeEgressAllowlist,
75
75
  writePersistentClaudeWrapper
76
76
  };
77
- //# sourceMappingURL=persistent-session-KAOPVQPC.js.map
77
+ //# sourceMappingURL=persistent-session-6CU3BIHP.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  paneLogPath
3
- } from "./chunk-5NQ652SP.js";
4
- import "./chunk-TRKWWYRN.js";
3
+ } from "./chunk-WNN5WT42.js";
4
+ import "./chunk-5DYG42FL.js";
5
5
  import "./chunk-XWVM4KPK.js";
6
6
 
7
7
  // src/lib/responsiveness-probe.ts
@@ -250,4 +250,4 @@ export {
250
250
  parkPendingInbound,
251
251
  readAndResetChannelDeflections
252
252
  };
253
- //# sourceMappingURL=responsiveness-probe-OJPF6XDF.js.map
253
+ //# sourceMappingURL=responsiveness-probe-GLZZZ2OK.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integrity-labs/agt-cli",
3
- "version": "0.28.98",
3
+ "version": "0.28.100",
4
4
  "description": "Augmented Team CLI — agent provisioning and management",
5
5
  "type": "module",
6
6
  "engines": {