🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

agent-comms

Package Overview
Dependencies
Maintainers
1
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

agent-comms - npm Package Compare versions

Comparing version
1.21.2
to
1.22.0
+34
hooks/drain.sh
#!/usr/bin/env bash
# Drain pending agent-comms events and exit 2 to wake idle Claude via asyncRewake.
#
# Called by Claude Code hooks (PostToolUse, Stop). If there are pending events,
# writes them to stderr and exits 2 — Claude Code wraps the stderr in a
# <system-reminder> and enqueues it as a task-notification, waking idle Claude.
#
# Uses atomic rename to drain so concurrent drains (in-process tool drain vs
# this out-of-process hook) never duplicate or lose events.
set -euo pipefail
SLUG="${PWD//[^a-zA-Z0-9]/_}"
PENDING="$HOME/.agents/bus/pending/claude-code--${SLUG}.jsonl"
DRAINING="${PENDING}.draining-$$-$(date +%s%N 2>/dev/null || date +%s)"
# Atomic drain — if rename fails (file absent), nothing to surface.
if ! mv "$PENDING" "$DRAINING" 2>/dev/null; then
exit 0
fi
CONTENT=$(cat "$DRAINING")
rm -f "$DRAINING"
if [ -z "$CONTENT" ]; then
exit 0
fi
echo "Pending agent-comms messages:" >&2
while IFS= read -r line; do
[ -n "$line" ] && echo " 📬 $line" >&2
done <<< "$CONTENT"
exit 2
{
"PostToolUse": [
{
"matcher": "*",
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/drain.sh",
"asyncRewake": true,
"timeout": 5
}
]
}
],
"Stop": [
{
"matcher": "*",
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/drain.sh",
"asyncRewake": true,
"timeout": 5
}
]
}
],
"UserPromptSubmit": [
{
"matcher": "*",
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/drain.sh",
"timeout": 5
}
]
}
]
}
+2
-1
{
"name": "agent-comms",
"description": "Cross-harness LLM agent communication mesh — rooms, DMs, and presence",
"version": "1.21.2",
"version": "1.22.0",
"author": {

@@ -11,2 +11,3 @@ "name": "ExaDev"

"license": "MIT",
"hooks": "./hooks/hooks.json",
"mcpServers": {

@@ -13,0 +14,0 @@ "agent-comms": {

@@ -5,9 +5,12 @@ /**

* MCP channel server that provides the "agent_comms" tool and pushes
* incoming messages into Claude's context via <channel> events.
* incoming messages into Claude's context via <channel> events and hooks.
* Uses TCP mesh for real-time delivery — no filesystem polling.
*
* Run via: npx agent-comms bridge claude-code
* Requires: claude --dangerously-load-development-channels
*
* Pending events are persisted to ~/.agents/bus/pending/claude-code--<slug>.jsonl
* so the asyncRewake hook scripts (hooks/drain.sh) can drain them out-of-process
* and wake idle Claude via exit code 2.
*/
export declare function run(): Promise<void>;
//# sourceMappingURL=channel.d.ts.map

@@ -1,1 +0,1 @@

{"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../../../src/bridges/claude-code/channel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAwBH,wBAAsB,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,CAgHzC"}
{"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../../../src/bridges/claude-code/channel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAgEH,wBAAsB,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,CAiHzC"}

@@ -5,8 +5,14 @@ /**

* MCP channel server that provides the "agent_comms" tool and pushes
* incoming messages into Claude's context via <channel> events.
* incoming messages into Claude's context via <channel> events and hooks.
* Uses TCP mesh for real-time delivery — no filesystem polling.
*
* Run via: npx agent-comms bridge claude-code
* Requires: claude --dangerously-load-development-channels
*
* Pending events are persisted to ~/.agents/bus/pending/claude-code--<slug>.jsonl
* so the asyncRewake hook scripts (hooks/drain.sh) can drain them out-of-process
* and wake idle Claude via exit code 2.
*/
import * as fs from "node:fs";
import * as os from "node:os";
import * as path from "node:path";
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";

@@ -22,2 +28,30 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";

}
function isErrnoException(err) {
return typeof err === "object" && err !== null && "code" in err;
}
function pendingFilePath(cwd) {
const slug = cwd.replace(/[^a-zA-Z0-9]/g, "_");
return path.join(os.homedir(), ".agents", "bus", "pending", `claude-code--${slug}.jsonl`);
}
function appendPending(filePath, line) {
fs.mkdirSync(path.dirname(filePath), { recursive: true });
fs.appendFileSync(filePath, line + "\n");
}
function drainPending(filePath) {
const drainPath = `${filePath}.draining-${String(process.pid)}-${String(Date.now())}`;
try {
fs.renameSync(filePath, drainPath);
}
catch (err) {
if (isErrnoException(err) && err.code === "ENOENT")
return [];
throw err;
}
const content = fs.readFileSync(drainPath, "utf-8");
fs.unlinkSync(drainPath);
return content
.split("\n")
.map((l) => l.trim())
.filter((l) => l.length > 0);
}
export async function run() {

@@ -30,3 +64,3 @@ const identity = generateIdentity();

let agentId;
const pendingBuffer = [];
const pendingFile = pendingFilePath(process.cwd());
const mcp = new McpServer({ name: "agent-comms", version: "0.2.0" }, {

@@ -37,6 +71,6 @@ capabilities: {

});
// All events land in the drain buffer so idle-Claude never silently misses
// a message. Actionable events also get an eager channel push for mid-turn
// delivery. If the push fired and Claude caught it, the drain will echo it
// on the next tool call — acceptable duplication, far better than loss.
// All events are written to the pending file so the out-of-process hook
// drain script can surface them to idle Claude via asyncRewake exit 2.
// Actionable events also get an eager channel push for mid-turn delivery
// when channels are enabled (--dangerously-load-development-channels).
store.onDelivery = async (_targetId, event) => {

@@ -46,3 +80,3 @@ const line = formatDeliveryEvent(event);

const shouldPush = isActionableEvent(event) && hint !== "info";
pendingBuffer.push(line);
appendPending(pendingFile, line);
if (shouldPush) {

@@ -66,3 +100,3 @@ await mcp.server.notification({

"send, dm, list_agents, read_room, invite, decline_invite, kick, destroy_room.",
'Incoming messages appear as <channel source="agent-comms"> events.',
'Incoming messages appear as <channel source="agent-comms"> events or [comms] Pending prefix.',
"Use streamingBehavior on send/dm: steer (act now), followUp (act when idle), info (whenever, default).",

@@ -93,3 +127,3 @@ ].join(" "),

}, action);
const pending = pendingBuffer.splice(0);
const pending = drainPending(pendingFile);
const prefix = pending.length > 0

@@ -96,0 +130,0 @@ ? `[comms] Pending:\n${pending.map((l) => ` 📬 ${l}`).join("\n")}\n\n`

@@ -1,1 +0,1 @@

{"version":3,"file":"channel.js","sourceRoot":"","sources":["../../../src/bridges/claude-code/channel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAEjF,OAAO,EACL,SAAS,EACT,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,wBAAwB,EACxB,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,GAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,GAAG;IACvB,MAAM,QAAQ,GAAG,gBAAgB,EAAE,CAAC;IACpC,MAAM,KAAK,GAAG,IAAI,SAAS,EAAE,CAAC;IAC9B,KAAK,CAAC,MAAM,GAAG,QAAQ,CAAC,WAAW,CAAC;IACpC,KAAK,CAAC,YAAY,CAAC,IAAI,YAAY,CAAC,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC7D,MAAM,IAAI,GAAG,IAA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
"version": "1.22.0",
"description": "Cross-harness communication mesh for LLM agents — rooms, DMs, presence, and real-time push delivery over TCP",

@@ -37,3 +37,4 @@ "type": "module",

"dist",
".claude-plugin/"
".claude-plugin/",
"hooks/"
],

@@ -40,0 +41,0 @@ "bin": {

@@ -5,3 +5,3 @@ # Agent Comms

[![npm](https://img.shields.io/badge/npm-CB3837?logo=npm&logoColor=white)](https://www.npmjs.com/package/agent-comms)
[![version](https://img.shields.io/badge/version-1.21.2-blue)](https://github.com/ExaDev/agent-comms/releases/tag/v1.21.2)
[![version](https://img.shields.io/badge/version-1.22.0-blue)](https://github.com/ExaDev/agent-comms/releases/tag/v1.22.0)
[![CI](https://img.shields.io/github/actions/workflow/status/ExaDev/agent-comms/ci.yml?branch=main)](https://github.com/ExaDev/agent-comms/actions)

@@ -221,3 +221,3 @@

**Limitations on non-native harnesses**: Claude Code's channel protocol is a single-lane push — there is no runtime mechanism to force a mid-call interrupt. The `[STEER]` and `[FOLLOWUP]` markers are visible in the session and structured `meta.streamingBehavior` carries the intent, but acting on them is down to the receiving agent. The pi bridge honours the hint natively.
**Claude Code delivery mechanism**: Events are written to `~/.agents/bus/pending/claude-code--<cwd-slug>.jsonl`. Three Claude Code hooks (`PostToolUse`, `Stop`, `UserPromptSubmit`) invoke `hooks/drain.sh`, which atomically renames the file, writes its content to stderr, and exits 2. Claude Code's `asyncRewake` mechanism wraps the stderr in a `<system-reminder>` and wakes idle Claude. When the `agent_comms` tool is called directly, the tool handler drains the same file via the same atomic rename — concurrent drains never duplicate because rename is the synchronisation primitive. The `[STEER]` and `[FOLLOWUP]` markers and `meta.streamingBehavior` carry timing intent; acting on them is down to the receiving agent. The pi bridge honours the hint natively via `deliverAs`.

@@ -224,0 +224,0 @@ ## Room types