@integrity-labs/agt-cli 0.12.9 → 0.14.0
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 +3 -3
- package/dist/{chunk-ZFTZDO5E.js → chunk-Y2ZGJIXI.js} +26 -3
- package/dist/chunk-Y2ZGJIXI.js.map +1 -0
- package/dist/lib/manager-worker.js +339 -37
- package/dist/lib/manager-worker.js.map +1 -1
- package/mcp/direct-chat-channel.js +1 -0
- package/mcp/slack-channel.js +47 -5
- package/mcp/telegram-channel.js +1 -0
- package/package.json +1 -1
- package/dist/chunk-ZFTZDO5E.js.map +0 -1
|
@@ -13995,3 +13995,4 @@ process.stdin.on("close", () => shutdown("stdin closed"));
|
|
|
13995
13995
|
process.stdin.on("end", () => shutdown("stdin ended"));
|
|
13996
13996
|
process.on("SIGTERM", () => shutdown("SIGTERM"));
|
|
13997
13997
|
process.on("SIGINT", () => shutdown("SIGINT"));
|
|
13998
|
+
process.on("SIGHUP", () => shutdown("SIGHUP"));
|
package/mcp/slack-channel.js
CHANGED
|
@@ -13865,6 +13865,43 @@ var StdioServerTransport = class {
|
|
|
13865
13865
|
import { readFileSync, statSync } from "fs";
|
|
13866
13866
|
import { basename, resolve } from "path";
|
|
13867
13867
|
import { homedir } from "os";
|
|
13868
|
+
|
|
13869
|
+
// src/slack-response-mode.ts
|
|
13870
|
+
var MODES = [
|
|
13871
|
+
"mention_only",
|
|
13872
|
+
"broadcast",
|
|
13873
|
+
"addressed_team",
|
|
13874
|
+
"all"
|
|
13875
|
+
];
|
|
13876
|
+
function parseResponseMode(raw) {
|
|
13877
|
+
if (!raw) return "mention_only";
|
|
13878
|
+
const v = raw.trim().toLowerCase();
|
|
13879
|
+
return MODES.includes(v) ? v : "mention_only";
|
|
13880
|
+
}
|
|
13881
|
+
function matchesBroadcast(text) {
|
|
13882
|
+
if (/<!channel>|<!here>/.test(text)) return true;
|
|
13883
|
+
if (/(?:^|\s)@(channel|here)(?=$|[\s.,!?;:])/i.test(text)) return true;
|
|
13884
|
+
return false;
|
|
13885
|
+
}
|
|
13886
|
+
function matchesAddressedTeam(text) {
|
|
13887
|
+
const t = text.trim();
|
|
13888
|
+
if (t.length === 0) return false;
|
|
13889
|
+
if (/^(hey|hi|hello|howdy|good (morning|afternoon|evening)|morning|afternoon)\s+team(?=$|[\s,.!?:])/i.test(t)) return true;
|
|
13890
|
+
if (/(?:^|\s)@team\b/i.test(t)) return true;
|
|
13891
|
+
if (/^team\s*[:,—-]/i.test(t)) return true;
|
|
13892
|
+
if (/(?:^|\s)@(everyone|all)\b/i.test(t)) return true;
|
|
13893
|
+
if (/^(everyone|all)\s*[:,—-]/i.test(t)) return true;
|
|
13894
|
+
return false;
|
|
13895
|
+
}
|
|
13896
|
+
function channelMessageShouldRespond(text, mode) {
|
|
13897
|
+
if (mode === "all") return true;
|
|
13898
|
+
if (mode === "mention_only") return false;
|
|
13899
|
+
if (matchesBroadcast(text)) return true;
|
|
13900
|
+
if (mode === "addressed_team" && matchesAddressedTeam(text)) return true;
|
|
13901
|
+
return false;
|
|
13902
|
+
}
|
|
13903
|
+
|
|
13904
|
+
// src/slack-channel.ts
|
|
13868
13905
|
var BOT_TOKEN = process.env.SLACK_BOT_TOKEN;
|
|
13869
13906
|
var APP_TOKEN = process.env.SLACK_APP_TOKEN;
|
|
13870
13907
|
var AGENT_CODE_NAME = process.env.AGT_AGENT_CODE_NAME ?? null;
|
|
@@ -13872,6 +13909,7 @@ var ALLOWED_USERS = new Set(
|
|
|
13872
13909
|
(process.env.SLACK_ALLOWED_USERS ?? "").split(",").map((s) => s.trim()).filter(Boolean)
|
|
13873
13910
|
);
|
|
13874
13911
|
var THREAD_AUTO_FOLLOW = process.env.SLACK_THREAD_AUTO_FOLLOW ?? "off";
|
|
13912
|
+
var CHANNEL_RESPONSE_MODE = parseResponseMode(process.env.SLACK_CHANNEL_RESPONSE_MODE);
|
|
13875
13913
|
var RESPONSE_TIMEOUT_MS = 12e4;
|
|
13876
13914
|
var pendingMessages = /* @__PURE__ */ new Map();
|
|
13877
13915
|
function trackPendingMessage(channel, threadTs, messageTs) {
|
|
@@ -14338,11 +14376,14 @@ async function connectSocketMode() {
|
|
|
14338
14376
|
trackedThreads.set(threadKey, trackedThreads.get(threadKey) ?? "mentioned");
|
|
14339
14377
|
}
|
|
14340
14378
|
if (evt.type === "message" && evt.channel && !isDirectMessage) {
|
|
14341
|
-
if (
|
|
14342
|
-
|
|
14343
|
-
|
|
14344
|
-
|
|
14345
|
-
|
|
14379
|
+
if (isThreadReply) {
|
|
14380
|
+
if (THREAD_AUTO_FOLLOW === "off") return;
|
|
14381
|
+
const threadInvolvement = trackedThreads.get(threadKey);
|
|
14382
|
+
if (!threadInvolvement) return;
|
|
14383
|
+
if (THREAD_AUTO_FOLLOW === "started" && threadInvolvement !== "started") return;
|
|
14384
|
+
} else {
|
|
14385
|
+
if (!channelMessageShouldRespond(evt.text ?? "", CHANNEL_RESPONSE_MODE)) return;
|
|
14386
|
+
}
|
|
14346
14387
|
}
|
|
14347
14388
|
if (ALLOWED_USERS.size > 0 && evt.user && !ALLOWED_USERS.has(evt.user)) return;
|
|
14348
14389
|
const text = evt.text ?? "";
|
|
@@ -14411,6 +14452,7 @@ process.stdin.on("close", () => shutdown("stdin closed"));
|
|
|
14411
14452
|
process.stdin.on("end", () => shutdown("stdin ended"));
|
|
14412
14453
|
process.on("SIGTERM", () => shutdown("SIGTERM"));
|
|
14413
14454
|
process.on("SIGINT", () => shutdown("SIGINT"));
|
|
14455
|
+
process.on("SIGHUP", () => shutdown("SIGHUP"));
|
|
14414
14456
|
botUserId = await getBotUserId();
|
|
14415
14457
|
process.stderr.write(`slack-channel: Bot user ID: ${botUserId}
|
|
14416
14458
|
`);
|
package/mcp/telegram-channel.js
CHANGED
|
@@ -14205,6 +14205,7 @@ process.stdin.on("close", () => shutdown("stdin closed"));
|
|
|
14205
14205
|
process.stdin.on("end", () => shutdown("stdin ended"));
|
|
14206
14206
|
process.on("SIGTERM", () => shutdown("SIGTERM"));
|
|
14207
14207
|
process.on("SIGINT", () => shutdown("SIGINT"));
|
|
14208
|
+
process.on("SIGHUP", () => shutdown("SIGHUP"));
|
|
14208
14209
|
process.stderr.write(
|
|
14209
14210
|
`telegram-channel(${AGENT_CODE_NAME}): started, long-polling getUpdates
|
|
14210
14211
|
`
|