@integrity-labs/agt-cli 0.27.23 → 0.27.24
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-RM4XYPLD.js → chunk-JNDNHPKT.js} +23 -3
- package/dist/{chunk-RM4XYPLD.js.map → chunk-JNDNHPKT.js.map} +1 -1
- package/dist/lib/manager-worker.js +3 -3
- package/dist/lib/manager-worker.js.map +1 -1
- package/dist/mcp/slack-channel.js +20 -5
- package/package.json +1 -1
|
@@ -14237,7 +14237,7 @@ function extractAugmentedSlackLabel(evt) {
|
|
|
14237
14237
|
agentId: evt.metadata.event_payload?.["augmented_agent_id"]
|
|
14238
14238
|
};
|
|
14239
14239
|
}
|
|
14240
|
-
function
|
|
14240
|
+
function decideModeForward(evt, policy) {
|
|
14241
14241
|
if (policy.mode === "all") return { forward: true };
|
|
14242
14242
|
if (policy.mode === "manager_only") {
|
|
14243
14243
|
if (policy.principalSlackUserId && evt.user === policy.principalSlackUserId) {
|
|
@@ -14253,6 +14253,13 @@ function decideSenderPolicyForward(evt, policy) {
|
|
|
14253
14253
|
}
|
|
14254
14254
|
return { forward: true };
|
|
14255
14255
|
}
|
|
14256
|
+
function decideSenderPolicyForward(evt, policy) {
|
|
14257
|
+
if (policy.internalOnly) {
|
|
14258
|
+
if (!policy.homeTeamId) return { forward: false, reason: "sender_policy" };
|
|
14259
|
+
if (evt.team !== policy.homeTeamId) return { forward: false, reason: "sender_policy" };
|
|
14260
|
+
}
|
|
14261
|
+
return decideModeForward(evt, policy);
|
|
14262
|
+
}
|
|
14256
14263
|
|
|
14257
14264
|
// src/ack-reaction.ts
|
|
14258
14265
|
import { readdirSync, readFileSync } from "fs";
|
|
@@ -15520,13 +15527,21 @@ var AGT_AGENT_ID = process.env.AGT_AGENT_ID ?? null;
|
|
|
15520
15527
|
var AGT_TEAM_ID = process.env.AGT_TEAM_ID ?? null;
|
|
15521
15528
|
var SLACK_SENDER_POLICY = (() => {
|
|
15522
15529
|
const raw = (process.env.SLACK_SENDER_POLICY ?? "all").trim().toLowerCase();
|
|
15523
|
-
|
|
15524
|
-
|
|
15530
|
+
const internalOnly = process.env.SLACK_INTERNAL_ONLY === "true";
|
|
15531
|
+
const homeTeamId = process.env.SLACK_HOME_TEAM_ID;
|
|
15532
|
+
if (internalOnly && !homeTeamId) {
|
|
15533
|
+
throw new Error(
|
|
15534
|
+
"SLACK_INTERNAL_ONLY=true requires SLACK_HOME_TEAM_ID. The bot install must have a known team_id (run auth.test against the workspace and persist the result)."
|
|
15535
|
+
);
|
|
15536
|
+
}
|
|
15537
|
+
const internalOnlyFields = internalOnly ? { internalOnly: true, homeTeamId } : {};
|
|
15538
|
+
if (raw === "all") return { mode: "all", ...internalOnlyFields };
|
|
15539
|
+
if (raw === "agents_only") return { mode: "agents_only", ...internalOnlyFields };
|
|
15525
15540
|
if (raw === "team_agents_only") {
|
|
15526
15541
|
if (!AGT_TEAM_ID) {
|
|
15527
15542
|
throw new Error("SLACK_SENDER_POLICY=team_agents_only requires AGT_TEAM_ID");
|
|
15528
15543
|
}
|
|
15529
|
-
return { mode: "team_agents_only", teamId: AGT_TEAM_ID };
|
|
15544
|
+
return { mode: "team_agents_only", teamId: AGT_TEAM_ID, ...internalOnlyFields };
|
|
15530
15545
|
}
|
|
15531
15546
|
if (raw === "manager_only") {
|
|
15532
15547
|
const principalSlackUserId = process.env.SLACK_SENDER_POLICY_PRINCIPAL_ID;
|
|
@@ -15538,7 +15553,7 @@ var SLACK_SENDER_POLICY = (() => {
|
|
|
15538
15553
|
"SLACK_SENDER_POLICY=manager_only requires SLACK_SENDER_POLICY_PRINCIPAL_ID. Set agent.reports_to_person with a slack_user_id in contact_preferences and re-run /host/refresh."
|
|
15539
15554
|
);
|
|
15540
15555
|
}
|
|
15541
|
-
return { mode: "manager_only", teamId: AGT_TEAM_ID, principalSlackUserId };
|
|
15556
|
+
return { mode: "manager_only", teamId: AGT_TEAM_ID, principalSlackUserId, ...internalOnlyFields };
|
|
15542
15557
|
}
|
|
15543
15558
|
throw new Error(`Invalid SLACK_SENDER_POLICY=${JSON.stringify(process.env.SLACK_SENDER_POLICY)}`);
|
|
15544
15559
|
})();
|