@integrity-labs/agt-cli 0.27.22 → 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.
@@ -14237,17 +14237,29 @@ function extractAugmentedSlackLabel(evt) {
14237
14237
  agentId: evt.metadata.event_payload?.["augmented_agent_id"]
14238
14238
  };
14239
14239
  }
14240
- function decideSenderPolicyForward(evt, policy) {
14240
+ function decideModeForward(evt, policy) {
14241
14241
  if (policy.mode === "all") return { forward: true };
14242
+ if (policy.mode === "manager_only") {
14243
+ if (policy.principalSlackUserId && evt.user === policy.principalSlackUserId) {
14244
+ return { forward: true };
14245
+ }
14246
+ }
14242
14247
  const label = extractAugmentedSlackLabel(evt);
14243
14248
  if (!label) return { forward: false, reason: "sender_policy" };
14244
- if (policy.mode === "team_agents_only") {
14249
+ if (policy.mode === "team_agents_only" || policy.mode === "manager_only") {
14245
14250
  if (!policy.teamId || label.teamId !== policy.teamId) {
14246
14251
  return { forward: false, reason: "sender_policy" };
14247
14252
  }
14248
14253
  }
14249
14254
  return { forward: true };
14250
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
+ }
14251
14263
 
14252
14264
  // src/ack-reaction.ts
14253
14265
  import { readdirSync, readFileSync } from "fs";
@@ -15515,13 +15527,33 @@ var AGT_AGENT_ID = process.env.AGT_AGENT_ID ?? null;
15515
15527
  var AGT_TEAM_ID = process.env.AGT_TEAM_ID ?? null;
15516
15528
  var SLACK_SENDER_POLICY = (() => {
15517
15529
  const raw = (process.env.SLACK_SENDER_POLICY ?? "all").trim().toLowerCase();
15518
- if (raw === "all") return { mode: "all" };
15519
- if (raw === "agents_only") return { mode: "agents_only" };
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 };
15520
15540
  if (raw === "team_agents_only") {
15521
15541
  if (!AGT_TEAM_ID) {
15522
15542
  throw new Error("SLACK_SENDER_POLICY=team_agents_only requires AGT_TEAM_ID");
15523
15543
  }
15524
- return { mode: "team_agents_only", teamId: AGT_TEAM_ID };
15544
+ return { mode: "team_agents_only", teamId: AGT_TEAM_ID, ...internalOnlyFields };
15545
+ }
15546
+ if (raw === "manager_only") {
15547
+ const principalSlackUserId = process.env.SLACK_SENDER_POLICY_PRINCIPAL_ID;
15548
+ if (!AGT_TEAM_ID) {
15549
+ throw new Error("SLACK_SENDER_POLICY=manager_only requires AGT_TEAM_ID");
15550
+ }
15551
+ if (!principalSlackUserId) {
15552
+ throw new Error(
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."
15554
+ );
15555
+ }
15556
+ return { mode: "manager_only", teamId: AGT_TEAM_ID, principalSlackUserId, ...internalOnlyFields };
15525
15557
  }
15526
15558
  throw new Error(`Invalid SLACK_SENDER_POLICY=${JSON.stringify(process.env.SLACK_SENDER_POLICY)}`);
15527
15559
  })();
@@ -21,8 +21,8 @@ import {
21
21
  stopPersistentSession,
22
22
  takeZombieDetection,
23
23
  writePersistentClaudeWrapper
24
- } from "./chunk-F4NG4EXD.js";
25
- import "./chunk-HT6EETEL.js";
24
+ } from "./chunk-JIETOJQV.js";
25
+ import "./chunk-6HFXSNNY.js";
26
26
  import "./chunk-XWVM4KPK.js";
27
27
  export {
28
28
  SEND_KEYS_ENTER_DELAY_MS,
@@ -48,4 +48,4 @@ export {
48
48
  takeZombieDetection,
49
49
  writePersistentClaudeWrapper
50
50
  };
51
- //# sourceMappingURL=persistent-session-SBSOZG74.js.map
51
+ //# sourceMappingURL=persistent-session-HSHIZC2Q.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  paneLogPath
3
- } from "./chunk-F4NG4EXD.js";
4
- import "./chunk-HT6EETEL.js";
3
+ } from "./chunk-JIETOJQV.js";
4
+ import "./chunk-6HFXSNNY.js";
5
5
  import "./chunk-XWVM4KPK.js";
6
6
 
7
7
  // src/lib/responsiveness-probe.ts
@@ -30,4 +30,4 @@ export {
30
30
  collectResponsivenessProbes,
31
31
  getResponsivenessIntervalMs
32
32
  };
33
- //# sourceMappingURL=responsiveness-probe-DU4IJ2RZ.js.map
33
+ //# sourceMappingURL=responsiveness-probe-RYKS5TRP.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integrity-labs/agt-cli",
3
- "version": "0.27.22",
3
+ "version": "0.27.24",
4
4
  "description": "Augmented Team CLI — agent provisioning and management",
5
5
  "type": "module",
6
6
  "engines": {