@integrity-labs/agt-cli 0.28.977 → 0.28.979
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-TIVMLJTE.js → chunk-4K6ZLKIZ.js} +2 -2
- package/dist/lib/manager-worker.js +125 -33
- package/dist/lib/manager-worker.js.map +1 -1
- package/dist/mcp/direct-chat-channel.js +12 -2
- package/dist/mcp/slack-channel.js +26 -4
- package/dist/mcp/telegram-channel.js +12 -2
- package/package.json +1 -1
- /package/dist/{chunk-TIVMLJTE.js.map → chunk-4K6ZLKIZ.js.map} +0 -0
|
@@ -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
|
-
|
|
40722
|
-
|
|
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
|
-
|
|
47710
|
-
|
|
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
|
-
|
|
45260
|
-
|
|
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
|
File without changes
|