@hoverlover/cc-discord 0.3.1 → 0.3.2
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/.env.worker.example +1 -3
- package/hooks/safe-bash.ts +1 -2
- package/package.json +1 -1
- package/scripts/channel-agent.sh +0 -1
package/.env.worker.example
CHANGED
|
@@ -30,10 +30,8 @@ BASH_POLICY_MODE=block
|
|
|
30
30
|
ALLOW_BASH_RUN_IN_BACKGROUND=true
|
|
31
31
|
ALLOW_BASH_BACKGROUND_OPS=false
|
|
32
32
|
|
|
33
|
-
# Notify Discord when safety policy is triggered
|
|
33
|
+
# Notify Discord when safety policy is triggered (sent to the agent's own channel)
|
|
34
34
|
BASH_POLICY_NOTIFY_ON_BLOCK=true
|
|
35
|
-
# Optional override channel for policy notifications (defaults to relay channel)
|
|
36
|
-
BASH_POLICY_NOTIFY_CHANNEL_ID=
|
|
37
35
|
|
|
38
36
|
# Stuck agent detection: seconds without a heartbeat + unread messages = stuck.
|
|
39
37
|
# Default 900 (15 min). Set higher if agents routinely do long tasks.
|
package/hooks/safe-bash.ts
CHANGED
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
* - ALLOW_BASH_RUN_IN_BACKGROUND=true|false (default: true)
|
|
13
13
|
* - ALLOW_BASH_BACKGROUND_OPS=true|false (default: false)
|
|
14
14
|
* - BASH_POLICY_NOTIFY_ON_BLOCK=true|false (default: true)
|
|
15
|
-
* - BASH_POLICY_NOTIFY_CHANNEL_ID=<discord-channel-id> (optional)
|
|
16
15
|
*
|
|
17
16
|
* When blocked, script exits 2 (Claude Code hook "block" behavior).
|
|
18
17
|
*/
|
|
@@ -74,7 +73,7 @@ async function notifyDiscord({ blocked, reasons, command }: { blocked: boolean;
|
|
|
74
73
|
const relayPort = process.env.RELAY_PORT || "3199";
|
|
75
74
|
const relayUrl = process.env.RELAY_URL || `http://${relayHost}:${relayPort}`;
|
|
76
75
|
const apiToken = process.env.RELAY_API_TOKEN || "";
|
|
77
|
-
const channelId = process.env.
|
|
76
|
+
const channelId = process.env.AGENT_ID || null;
|
|
78
77
|
const fromAgent = process.env.AGENT_ID || process.env.CLAUDE_AGENT_ID || "bash-guard";
|
|
79
78
|
|
|
80
79
|
const status = blocked ? "blocked" : "warning";
|
package/package.json
CHANGED
package/scripts/channel-agent.sh
CHANGED
|
@@ -37,7 +37,6 @@ WORKER_KEYS=(
|
|
|
37
37
|
ALLOW_BASH_RUN_IN_BACKGROUND
|
|
38
38
|
ALLOW_BASH_BACKGROUND_OPS
|
|
39
39
|
BASH_POLICY_NOTIFY_ON_BLOCK
|
|
40
|
-
BASH_POLICY_NOTIFY_CHANNEL_ID
|
|
41
40
|
)
|
|
42
41
|
load_env_keys "$ROOT_DIR/.env.worker" "${WORKER_KEYS[@]}"
|
|
43
42
|
load_env_keys "${CC_DISCORD_CONFIG_DIR:-$HOME/.config/cc-discord}/.env.worker" "${WORKER_KEYS[@]}"
|