@integrity-labs/agt-cli 0.28.304 → 0.28.305
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 +4 -4
- package/dist/{chunk-5WQATS6J.js → chunk-A546IARM.js} +15 -3
- package/dist/chunk-A546IARM.js.map +1 -0
- package/dist/{chunk-OA5EO3U4.js → chunk-XVLVNR33.js} +3 -3
- package/dist/{claude-pair-runtime-FOFN74JS.js → claude-pair-runtime-6MRJ6ZJV.js} +2 -2
- package/dist/lib/manager-worker.js +10 -10
- package/dist/mcp/origami.js +2 -2
- package/dist/mcp/slack-channel.js +139 -3
- package/dist/mcp/telegram-channel.js +29 -0
- package/dist/{persistent-session-52DPSJGK.js → persistent-session-WYNJBCVB.js} +2 -2
- package/dist/{responsiveness-probe-KXWV4FXD.js → responsiveness-probe-2FQLPFAR.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-5WQATS6J.js.map +0 -1
- /package/dist/{chunk-OA5EO3U4.js.map → chunk-XVLVNR33.js.map} +0 -0
- /package/dist/{claude-pair-runtime-FOFN74JS.js.map → claude-pair-runtime-6MRJ6ZJV.js.map} +0 -0
- /package/dist/{persistent-session-52DPSJGK.js.map → persistent-session-WYNJBCVB.js.map} +0 -0
- /package/dist/{responsiveness-probe-KXWV4FXD.js.map → responsiveness-probe-2FQLPFAR.js.map} +0 -0
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
resolveConnectivityProbe,
|
|
19
19
|
worseConnectivityOutcome,
|
|
20
20
|
wrapScheduledTaskPrompt
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-A546IARM.js";
|
|
22
22
|
import {
|
|
23
23
|
parsePsRows
|
|
24
24
|
} from "./chunk-XWVM4KPK.js";
|
|
@@ -5882,7 +5882,7 @@ function requireHost() {
|
|
|
5882
5882
|
}
|
|
5883
5883
|
|
|
5884
5884
|
// src/lib/api-client.ts
|
|
5885
|
-
var agtCliVersion = true ? "0.28.
|
|
5885
|
+
var agtCliVersion = true ? "0.28.305" : "dev";
|
|
5886
5886
|
var lastConfigHash = null;
|
|
5887
5887
|
function setConfigHash(hash) {
|
|
5888
5888
|
lastConfigHash = hash && hash.length > 0 ? hash : null;
|
|
@@ -8181,4 +8181,4 @@ export {
|
|
|
8181
8181
|
managerInstallSystemUnitCommand,
|
|
8182
8182
|
managerUninstallSystemUnitCommand
|
|
8183
8183
|
};
|
|
8184
|
-
//# sourceMappingURL=chunk-
|
|
8184
|
+
//# sourceMappingURL=chunk-XVLVNR33.js.map
|
|
@@ -100,7 +100,7 @@ async function spawnPairSession(session) {
|
|
|
100
100
|
return { ok: true };
|
|
101
101
|
} catch {
|
|
102
102
|
}
|
|
103
|
-
const { resolveClaudeBinary } = await import("./persistent-session-
|
|
103
|
+
const { resolveClaudeBinary } = await import("./persistent-session-WYNJBCVB.js");
|
|
104
104
|
const claudeBin = resolveClaudeBinary();
|
|
105
105
|
const pairEnv = {
|
|
106
106
|
...process.env,
|
|
@@ -373,4 +373,4 @@ export {
|
|
|
373
373
|
startClaudePair,
|
|
374
374
|
submitClaudePairCode
|
|
375
375
|
};
|
|
376
|
-
//# sourceMappingURL=claude-pair-runtime-
|
|
376
|
+
//# sourceMappingURL=claude-pair-runtime-6MRJ6ZJV.js.map
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
requireHost,
|
|
40
40
|
safeWriteJsonAtomic,
|
|
41
41
|
setConfigHash
|
|
42
|
-
} from "../chunk-
|
|
42
|
+
} from "../chunk-XVLVNR33.js";
|
|
43
43
|
import {
|
|
44
44
|
getProjectDir as getProjectDir2,
|
|
45
45
|
getReadyTasks,
|
|
@@ -127,7 +127,7 @@ import {
|
|
|
127
127
|
takeZombieDetection,
|
|
128
128
|
transcriptActivityAgeSeconds,
|
|
129
129
|
writeEgressAllowlist
|
|
130
|
-
} from "../chunk-
|
|
130
|
+
} from "../chunk-A546IARM.js";
|
|
131
131
|
import {
|
|
132
132
|
reapOrphanChannelMcps
|
|
133
133
|
} from "../chunk-XWVM4KPK.js";
|
|
@@ -6997,7 +6997,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
|
|
|
6997
6997
|
var lastVersionCheckAt = 0;
|
|
6998
6998
|
var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
|
|
6999
6999
|
var lastResponsivenessProbeAt = 0;
|
|
7000
|
-
var agtCliVersion = true ? "0.28.
|
|
7000
|
+
var agtCliVersion = true ? "0.28.305" : "dev";
|
|
7001
7001
|
function resolveBrewPath(execFileSync2) {
|
|
7002
7002
|
try {
|
|
7003
7003
|
const out = execFileSync2("which", ["brew"], { timeout: 5e3 }).toString().trim();
|
|
@@ -7852,7 +7852,7 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
|
|
|
7852
7852
|
if (codeNames.length === 0) return;
|
|
7853
7853
|
void (async () => {
|
|
7854
7854
|
try {
|
|
7855
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
7855
|
+
const { collectDiagnostics } = await import("../persistent-session-WYNJBCVB.js");
|
|
7856
7856
|
await api.post("/host/heartbeat", {
|
|
7857
7857
|
host_id: hostId,
|
|
7858
7858
|
agent_diagnostics: collectDiagnostics(codeNames)
|
|
@@ -7950,7 +7950,7 @@ async function pollCycle() {
|
|
|
7950
7950
|
}
|
|
7951
7951
|
try {
|
|
7952
7952
|
const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
|
|
7953
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
7953
|
+
const { collectDiagnostics } = await import("../persistent-session-WYNJBCVB.js");
|
|
7954
7954
|
const diagCodeNames = [...agentState.persistentSessionAgents];
|
|
7955
7955
|
const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames) : void 0;
|
|
7956
7956
|
let tailscaleHostname;
|
|
@@ -8098,7 +8098,7 @@ async function pollCycle() {
|
|
|
8098
8098
|
const {
|
|
8099
8099
|
collectResponsivenessProbes,
|
|
8100
8100
|
getResponsivenessIntervalMs
|
|
8101
|
-
} = await import("../responsiveness-probe-
|
|
8101
|
+
} = await import("../responsiveness-probe-2FQLPFAR.js");
|
|
8102
8102
|
const probeIntervalMs = getResponsivenessIntervalMs();
|
|
8103
8103
|
if (now - lastResponsivenessProbeAt > probeIntervalMs) {
|
|
8104
8104
|
const probeCodeNames = [...agentState.persistentSessionAgents];
|
|
@@ -8130,7 +8130,7 @@ async function pollCycle() {
|
|
|
8130
8130
|
collectResponsivenessProbes,
|
|
8131
8131
|
livePendingInboundOldestAgeSeconds,
|
|
8132
8132
|
parkPendingInbound
|
|
8133
|
-
} = await import("../responsiveness-probe-
|
|
8133
|
+
} = await import("../responsiveness-probe-2FQLPFAR.js");
|
|
8134
8134
|
const { getProjectDir: wedgeProjectDir } = await import("../claude-scheduler-FATCLHDM.js");
|
|
8135
8135
|
const wedgeNow = /* @__PURE__ */ new Date();
|
|
8136
8136
|
const liveAgents = agentState.persistentSessionAgents;
|
|
@@ -11113,7 +11113,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
|
|
|
11113
11113
|
void api.post("/host/restart-ack", { host_id: hostId, agent_id: agentId, restart_requested_at: requestedAt }).catch((err) => log(`[restart-lane] ack failed for '${codeName}': ${err.message}`));
|
|
11114
11114
|
void (async () => {
|
|
11115
11115
|
try {
|
|
11116
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
11116
|
+
const { collectDiagnostics } = await import("../persistent-session-WYNJBCVB.js");
|
|
11117
11117
|
await api.post("/host/heartbeat", {
|
|
11118
11118
|
host_id: hostId,
|
|
11119
11119
|
agent_diagnostics: collectDiagnostics([codeName])
|
|
@@ -11163,7 +11163,7 @@ async function respawnAgentAfterMcpStop(codeName, reason) {
|
|
|
11163
11163
|
}
|
|
11164
11164
|
try {
|
|
11165
11165
|
const hostId = await getHostId();
|
|
11166
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
11166
|
+
const { collectDiagnostics } = await import("../persistent-session-WYNJBCVB.js");
|
|
11167
11167
|
await api.post("/host/heartbeat", {
|
|
11168
11168
|
host_id: hostId,
|
|
11169
11169
|
agent_diagnostics: collectDiagnostics([codeName])
|
|
@@ -11587,7 +11587,7 @@ async function processClaudePairSessions(agents) {
|
|
|
11587
11587
|
killPairSession,
|
|
11588
11588
|
pairTmuxSession,
|
|
11589
11589
|
finalizeClaudePairOnboarding
|
|
11590
|
-
} = await import("../claude-pair-runtime-
|
|
11590
|
+
} = await import("../claude-pair-runtime-6MRJ6ZJV.js");
|
|
11591
11591
|
for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
|
|
11592
11592
|
log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
|
|
11593
11593
|
const killed = await killPairSession(pairTmuxSession(pairId));
|
package/dist/mcp/origami.js
CHANGED
|
@@ -40400,9 +40400,9 @@ var FLAG_REGISTRY = [
|
|
|
40400
40400
|
},
|
|
40401
40401
|
{
|
|
40402
40402
|
key: "notify-dispatch",
|
|
40403
|
-
description: "Membership-based channel-notify dispatch (ENG-7682 / notify Slice 1). off = today's behaviour: a non-@mention top-level channel message is dropped by the mention_only engagement gate (SLACK_CHANNEL_RESPONSE_MODE). membership = the agent's Slack MCP ADMITS non-@mention channel messages in channels its bot is a member of (the Socket Mode websocket already receives them), waking the agent in-thread via the SAME existing wake path used for @mentions/DMs. Only the mention_only engagement gate is relaxed - the echo/dedup, bot_id/self, and peer-classifier safety leaves still apply, so this never opens a bot-to-bot wake loop. The channel server can't evaluate flags, so the manager materializes the resolved value into the AGT_NOTIFY_DISPATCH spawn env (operator/canary override, ADR-0022).
|
|
40403
|
+
description: "Membership-based channel-notify dispatch (ENG-7682 / notify Slice 1). off = today's behaviour: a non-@mention top-level channel message is dropped by the mention_only engagement gate (SLACK_CHANNEL_RESPONSE_MODE). membership = the agent's Slack MCP ADMITS non-@mention channel messages in channels its bot is a member of (the Socket Mode websocket already receives them), waking the agent in-thread via the SAME existing wake path used for @mentions/DMs. Only the mention_only engagement gate is relaxed - the echo/dedup, bot_id/self, and peer-classifier safety leaves still apply, so this never opens a bot-to-bot wake loop. The channel server can't evaluate flags, so the manager materializes the resolved value into the AGT_NOTIFY_DISPATCH spawn env (operator/canary override, ADR-0022). filter = like membership (opt-out) but honours a per-channel mute list: a member-channel message wakes the agent UNLESS the user muted that channel via the /notify slash command. The manager materializes the muted set into AGT_NOTIFY_MUTED_CHANNELS from agent_notify_channel_prefs (ENG-7682 Slice 2). Ships dark (default off).",
|
|
40404
40404
|
flagType: "enum",
|
|
40405
|
-
allowedValues: ["off", "membership"],
|
|
40405
|
+
allowedValues: ["off", "membership", "filter"],
|
|
40406
40406
|
// Declared safe value is `off`: the mention_only gate stays in force, byte-
|
|
40407
40407
|
// identical to today. membership is the deliberate, per-agent flip that
|
|
40408
40408
|
// widens what wakes the agent.
|
|
@@ -6997,8 +6997,10 @@ __export(slack_block_kit_runtime_exports, {
|
|
|
6997
6997
|
decodeActionId: () => decodeActionId,
|
|
6998
6998
|
encodeActionId: () => encodeActionId,
|
|
6999
6999
|
generateOptionToken: () => generateOptionToken,
|
|
7000
|
+
getMutedNotifyChannels: () => getMutedNotifyChannels,
|
|
7000
7001
|
recordSlackDelivery: () => recordSlackDelivery,
|
|
7001
7002
|
resolveInteractive: () => resolveInteractive,
|
|
7003
|
+
setNotifyChannelPref: () => setNotifyChannelPref,
|
|
7002
7004
|
submitInteractive: () => submitInteractive,
|
|
7003
7005
|
updatePendingInteractionMessageTs: () => updatePendingInteractionMessageTs,
|
|
7004
7006
|
validateAskUserOptions: () => validateAskUserOptions,
|
|
@@ -7210,6 +7212,33 @@ async function recordSlackDelivery(cfg, input) {
|
|
|
7210
7212
|
throw new Error(`recordSlackDelivery failed (${res.status}): ${body.slice(0, 200)}`);
|
|
7211
7213
|
}
|
|
7212
7214
|
}
|
|
7215
|
+
async function setNotifyChannelPref(cfg, input) {
|
|
7216
|
+
try {
|
|
7217
|
+
const res = await apiCall(cfg, "POST", "/host/notify-prefs", {
|
|
7218
|
+
agent_id: cfg.agentId,
|
|
7219
|
+
channel_id: input.channelId,
|
|
7220
|
+
wake: input.wake,
|
|
7221
|
+
updated_by: input.userId ?? null
|
|
7222
|
+
});
|
|
7223
|
+
return res.ok;
|
|
7224
|
+
} catch {
|
|
7225
|
+
return false;
|
|
7226
|
+
}
|
|
7227
|
+
}
|
|
7228
|
+
async function getMutedNotifyChannels(cfg) {
|
|
7229
|
+
try {
|
|
7230
|
+
const res = await apiCall(
|
|
7231
|
+
cfg,
|
|
7232
|
+
"GET",
|
|
7233
|
+
`/host/notify-prefs?agent_id=${encodeURIComponent(cfg.agentId)}`
|
|
7234
|
+
);
|
|
7235
|
+
if (!res.ok) return [];
|
|
7236
|
+
const body = await res.json().catch(() => ({}));
|
|
7237
|
+
return Array.isArray(body.muted_channels) ? body.muted_channels.filter((x) => typeof x === "string") : [];
|
|
7238
|
+
} catch {
|
|
7239
|
+
return [];
|
|
7240
|
+
}
|
|
7241
|
+
}
|
|
7213
7242
|
var SLACK_LIMITS, SUPPORTED_BLOCK_TYPES, SUPPORTED_ACTION_ELEMENTS, ACTION_ID_RE;
|
|
7214
7243
|
var init_slack_block_kit_runtime = __esm({
|
|
7215
7244
|
"src/slack-block-kit-runtime.ts"() {
|
|
@@ -17430,12 +17459,32 @@ function channelMessageShouldRespond(text, mode) {
|
|
|
17430
17459
|
}
|
|
17431
17460
|
function parseNotifyDispatchMode(raw) {
|
|
17432
17461
|
if (!raw) return "off";
|
|
17433
|
-
|
|
17462
|
+
const v = raw.trim().toLowerCase();
|
|
17463
|
+
if (v === "membership") return "membership";
|
|
17464
|
+
if (v === "filter") return "filter";
|
|
17465
|
+
return "off";
|
|
17434
17466
|
}
|
|
17435
|
-
function
|
|
17467
|
+
function parseMutedChannels(raw) {
|
|
17468
|
+
if (!raw) return /* @__PURE__ */ new Set();
|
|
17469
|
+
return new Set(
|
|
17470
|
+
raw.split(",").map((s) => s.trim()).filter(Boolean)
|
|
17471
|
+
);
|
|
17472
|
+
}
|
|
17473
|
+
function channelMessageShouldWake(text, responseMode, notifyMode, channelId, mutedChannels) {
|
|
17436
17474
|
if (notifyMode === "membership") return true;
|
|
17475
|
+
if (notifyMode === "filter") {
|
|
17476
|
+
if (channelId && mutedChannels && mutedChannels.has(channelId)) return false;
|
|
17477
|
+
return true;
|
|
17478
|
+
}
|
|
17437
17479
|
return channelMessageShouldRespond(text, responseMode);
|
|
17438
17480
|
}
|
|
17481
|
+
function parseNotifyCommand(text, currentChannelId) {
|
|
17482
|
+
const arg = (text ?? "").trim().toLowerCase().split(/\s+/)[0] ?? "";
|
|
17483
|
+
if (arg === "off" || arg === "mute") return { action: "mute", channelId: currentChannelId };
|
|
17484
|
+
if (arg === "on" || arg === "unmute") return { action: "unmute", channelId: currentChannelId };
|
|
17485
|
+
if (arg === "" || arg === "status") return { action: "status", channelId: currentChannelId };
|
|
17486
|
+
return { action: "help", channelId: currentChannelId };
|
|
17487
|
+
}
|
|
17439
17488
|
|
|
17440
17489
|
// src/slack-list-channels.ts
|
|
17441
17490
|
function normaliseForMatch(s) {
|
|
@@ -18293,6 +18342,7 @@ var SLACK_SKIP_REACTION = (process.env.SLACK_SKIP_REACTION ?? "").trim();
|
|
|
18293
18342
|
var SLACK_ACK_REACTION = (process.env.SLACK_ACK_REACTION ?? "").trim() || "eyes";
|
|
18294
18343
|
var CHANNEL_RESPONSE_MODE = parseResponseMode(process.env.SLACK_CHANNEL_RESPONSE_MODE);
|
|
18295
18344
|
var NOTIFY_DISPATCH_MODE = parseNotifyDispatchMode(process.env.AGT_NOTIFY_DISPATCH);
|
|
18345
|
+
var MUTED_CHANNELS = parseMutedChannels(process.env.AGT_NOTIFY_MUTED_CHANNELS);
|
|
18296
18346
|
var SLACK_PEER_DISABLED_MODE = (() => {
|
|
18297
18347
|
const raw = (process.env.PEER_DISABLED ?? "").trim().toLowerCase();
|
|
18298
18348
|
if (raw === "" || raw === "off") return "off";
|
|
@@ -19769,6 +19819,61 @@ ${renderSlackStatusSections(merged, {
|
|
|
19769
19819
|
})}`;
|
|
19770
19820
|
await postEphemeralViaResponseUrl(responseUrl, finalReport, codeName, { replaceOriginal: true });
|
|
19771
19821
|
}
|
|
19822
|
+
async function handleNotifyCommand(payload, codeName) {
|
|
19823
|
+
const responseUrl = payload.response_url;
|
|
19824
|
+
if (!responseUrl) return;
|
|
19825
|
+
const channelId = payload.channel_id ?? "";
|
|
19826
|
+
if (!channelId) {
|
|
19827
|
+
await postEphemeralViaResponseUrl(responseUrl, "Run `/notify` inside a channel.", codeName);
|
|
19828
|
+
return;
|
|
19829
|
+
}
|
|
19830
|
+
const notifyAllowed = getEffectivePingAllowedUsers();
|
|
19831
|
+
if (notifyAllowed.size === 0 || !payload.user_id || !notifyAllowed.has(payload.user_id)) {
|
|
19832
|
+
process.stderr.write(`slack-channel(${codeName}): /notify denied - user not in the allowlist
|
|
19833
|
+
`);
|
|
19834
|
+
await postEphemeralViaResponseUrl(
|
|
19835
|
+
responseUrl,
|
|
19836
|
+
`\u{1F6AB} \`/notify\` is limited to \`${codeName}\`'s team and the person it reports to. If that's you, link your Slack in your Augmented Team contact preferences and wait for the next refresh.`,
|
|
19837
|
+
codeName
|
|
19838
|
+
);
|
|
19839
|
+
return;
|
|
19840
|
+
}
|
|
19841
|
+
const inactiveNote = NOTIFY_DISPATCH_MODE === "filter" ? "" : " _(note: I\u2019m not in per-channel filter mode right now, so this is saved but won\u2019t take effect until an operator enables it.)_";
|
|
19842
|
+
const { action } = parseNotifyCommand(payload.text, channelId);
|
|
19843
|
+
if (action === "help") {
|
|
19844
|
+
await postEphemeralViaResponseUrl(
|
|
19845
|
+
responseUrl,
|
|
19846
|
+
"`/notify off` \u2014 stop waking me on this channel\u2019s messages. `/notify on` \u2014 resume. `/notify status` \u2014 show the current setting. (An @-mention always reaches me.)",
|
|
19847
|
+
codeName
|
|
19848
|
+
);
|
|
19849
|
+
return;
|
|
19850
|
+
}
|
|
19851
|
+
if (action === "status") {
|
|
19852
|
+
const muted = MUTED_CHANNELS.has(channelId);
|
|
19853
|
+
await postEphemeralViaResponseUrl(
|
|
19854
|
+
responseUrl,
|
|
19855
|
+
(muted ? ":mute: This channel is *muted* \u2014 I won\u2019t wake on its messages (an @-mention still reaches me). `/notify on` to resume." : ":bell: This channel is *active* \u2014 I wake on its messages. `/notify off` to mute.") + inactiveNote,
|
|
19856
|
+
codeName
|
|
19857
|
+
);
|
|
19858
|
+
return;
|
|
19859
|
+
}
|
|
19860
|
+
const mute = action === "mute";
|
|
19861
|
+
if (mute) MUTED_CHANNELS.add(channelId);
|
|
19862
|
+
else MUTED_CHANNELS.delete(channelId);
|
|
19863
|
+
const runtime = await Promise.resolve().then(() => (init_slack_block_kit_runtime(), slack_block_kit_runtime_exports));
|
|
19864
|
+
const cfg = statusRuntimeConfig();
|
|
19865
|
+
const persisted = cfg ? await runtime.setNotifyChannelPref(cfg, {
|
|
19866
|
+
channelId,
|
|
19867
|
+
wake: !mute,
|
|
19868
|
+
userId: payload.user_id ?? null
|
|
19869
|
+
}) : false;
|
|
19870
|
+
const durabilityNote = persisted ? "" : " (couldn\u2019t save it durably just now \u2014 it\u2019ll reset if I restart; re-run to retry)";
|
|
19871
|
+
await postEphemeralViaResponseUrl(
|
|
19872
|
+
responseUrl,
|
|
19873
|
+
(mute ? `:mute: Muted this channel \u2014 I\u2019ll stop waking on its messages (an @-mention still reaches me).${durabilityNote}` : `:bell: Un-muted this channel \u2014 I\u2019ll wake on its messages again.${durabilityNote}`) + inactiveNote,
|
|
19874
|
+
codeName
|
|
19875
|
+
);
|
|
19876
|
+
}
|
|
19772
19877
|
async function postEphemeralViaResponseUrl(responseUrl, text, logTag, opts = {}) {
|
|
19773
19878
|
try {
|
|
19774
19879
|
const res = await fetch(responseUrl, {
|
|
@@ -20040,6 +20145,10 @@ async function handleSlashCommandEnvelope(payload) {
|
|
|
20040
20145
|
await handleStatusCommand(responseUrl, codeName);
|
|
20041
20146
|
return;
|
|
20042
20147
|
}
|
|
20148
|
+
if (matchesAgentCommand(command, "/notify")) {
|
|
20149
|
+
await handleNotifyCommand(payload, codeName);
|
|
20150
|
+
return;
|
|
20151
|
+
}
|
|
20043
20152
|
if (matchesAgentCommand(command, "/help")) {
|
|
20044
20153
|
await postEphemeralViaResponseUrl(responseUrl, buildSlackHelpMessage(codeName), codeName);
|
|
20045
20154
|
return;
|
|
@@ -22047,7 +22156,28 @@ async function resolveUserName(userId) {
|
|
|
22047
22156
|
var currentWs = null;
|
|
22048
22157
|
var isShuttingDown = false;
|
|
22049
22158
|
var acquiredLockPath = null;
|
|
22159
|
+
async function seedMutedChannelsFromApi() {
|
|
22160
|
+
try {
|
|
22161
|
+
const cfg = statusRuntimeConfig();
|
|
22162
|
+
if (!cfg) return;
|
|
22163
|
+
const runtime = await Promise.resolve().then(() => (init_slack_block_kit_runtime(), slack_block_kit_runtime_exports));
|
|
22164
|
+
const muted = await runtime.getMutedNotifyChannels(cfg);
|
|
22165
|
+
for (const ch of muted) MUTED_CHANNELS.add(ch);
|
|
22166
|
+
if (muted.length > 0) {
|
|
22167
|
+
process.stderr.write(
|
|
22168
|
+
`slack-channel: seeded ${muted.length} muted channel(s) from notify-prefs
|
|
22169
|
+
`
|
|
22170
|
+
);
|
|
22171
|
+
}
|
|
22172
|
+
} catch (err) {
|
|
22173
|
+
process.stderr.write(
|
|
22174
|
+
`slack-channel: notify-prefs seed failed: ${err.message}
|
|
22175
|
+
`
|
|
22176
|
+
);
|
|
22177
|
+
}
|
|
22178
|
+
}
|
|
22050
22179
|
function connectSocketModeSafely() {
|
|
22180
|
+
if (NOTIFY_DISPATCH_MODE === "filter") void seedMutedChannelsFromApi();
|
|
22051
22181
|
void runOrRetry(connectSocketMode, {
|
|
22052
22182
|
retryDelayMs: 1e4,
|
|
22053
22183
|
onError: (err) => process.stderr.write(
|
|
@@ -22439,7 +22569,13 @@ async function connectSocketMode() {
|
|
|
22439
22569
|
return;
|
|
22440
22570
|
}
|
|
22441
22571
|
} else {
|
|
22442
|
-
if (!channelMessageShouldWake(
|
|
22572
|
+
if (!channelMessageShouldWake(
|
|
22573
|
+
evt.text ?? "",
|
|
22574
|
+
CHANNEL_RESPONSE_MODE,
|
|
22575
|
+
NOTIFY_DISPATCH_MODE,
|
|
22576
|
+
evt.channel,
|
|
22577
|
+
MUTED_CHANNELS
|
|
22578
|
+
))
|
|
22443
22579
|
return;
|
|
22444
22580
|
}
|
|
22445
22581
|
}
|
|
@@ -6997,8 +6997,10 @@ __export(slack_block_kit_runtime_exports, {
|
|
|
6997
6997
|
decodeActionId: () => decodeActionId,
|
|
6998
6998
|
encodeActionId: () => encodeActionId,
|
|
6999
6999
|
generateOptionToken: () => generateOptionToken,
|
|
7000
|
+
getMutedNotifyChannels: () => getMutedNotifyChannels,
|
|
7000
7001
|
recordSlackDelivery: () => recordSlackDelivery,
|
|
7001
7002
|
resolveInteractive: () => resolveInteractive,
|
|
7003
|
+
setNotifyChannelPref: () => setNotifyChannelPref,
|
|
7002
7004
|
submitInteractive: () => submitInteractive,
|
|
7003
7005
|
updatePendingInteractionMessageTs: () => updatePendingInteractionMessageTs,
|
|
7004
7006
|
validateAskUserOptions: () => validateAskUserOptions,
|
|
@@ -7210,6 +7212,33 @@ async function recordSlackDelivery(cfg, input) {
|
|
|
7210
7212
|
throw new Error(`recordSlackDelivery failed (${res.status}): ${body.slice(0, 200)}`);
|
|
7211
7213
|
}
|
|
7212
7214
|
}
|
|
7215
|
+
async function setNotifyChannelPref(cfg, input) {
|
|
7216
|
+
try {
|
|
7217
|
+
const res = await apiCall(cfg, "POST", "/host/notify-prefs", {
|
|
7218
|
+
agent_id: cfg.agentId,
|
|
7219
|
+
channel_id: input.channelId,
|
|
7220
|
+
wake: input.wake,
|
|
7221
|
+
updated_by: input.userId ?? null
|
|
7222
|
+
});
|
|
7223
|
+
return res.ok;
|
|
7224
|
+
} catch {
|
|
7225
|
+
return false;
|
|
7226
|
+
}
|
|
7227
|
+
}
|
|
7228
|
+
async function getMutedNotifyChannels(cfg) {
|
|
7229
|
+
try {
|
|
7230
|
+
const res = await apiCall(
|
|
7231
|
+
cfg,
|
|
7232
|
+
"GET",
|
|
7233
|
+
`/host/notify-prefs?agent_id=${encodeURIComponent(cfg.agentId)}`
|
|
7234
|
+
);
|
|
7235
|
+
if (!res.ok) return [];
|
|
7236
|
+
const body = await res.json().catch(() => ({}));
|
|
7237
|
+
return Array.isArray(body.muted_channels) ? body.muted_channels.filter((x) => typeof x === "string") : [];
|
|
7238
|
+
} catch {
|
|
7239
|
+
return [];
|
|
7240
|
+
}
|
|
7241
|
+
}
|
|
7213
7242
|
var SLACK_LIMITS, SUPPORTED_BLOCK_TYPES, SUPPORTED_ACTION_ELEMENTS, ACTION_ID_RE;
|
|
7214
7243
|
var init_slack_block_kit_runtime = __esm({
|
|
7215
7244
|
"src/slack-block-kit-runtime.ts"() {
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
writeDirectChatSessionState,
|
|
37
37
|
writeEgressAllowlist,
|
|
38
38
|
writePersistentClaudeWrapper
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-A546IARM.js";
|
|
40
40
|
import "./chunk-XWVM4KPK.js";
|
|
41
41
|
export {
|
|
42
42
|
EGRESS_BASELINE_DOMAINS,
|
|
@@ -77,4 +77,4 @@ export {
|
|
|
77
77
|
writeEgressAllowlist,
|
|
78
78
|
writePersistentClaudeWrapper
|
|
79
79
|
};
|
|
80
|
-
//# sourceMappingURL=persistent-session-
|
|
80
|
+
//# sourceMappingURL=persistent-session-WYNJBCVB.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
paneLogPath
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-A546IARM.js";
|
|
4
4
|
import "./chunk-XWVM4KPK.js";
|
|
5
5
|
|
|
6
6
|
// src/lib/responsiveness-probe.ts
|
|
@@ -425,4 +425,4 @@ export {
|
|
|
425
425
|
readAndResetSlackReplyBindingClassifications,
|
|
426
426
|
readAndResetSlackReplyTargetClassifications
|
|
427
427
|
};
|
|
428
|
-
//# sourceMappingURL=responsiveness-probe-
|
|
428
|
+
//# sourceMappingURL=responsiveness-probe-2FQLPFAR.js.map
|