agent-comms 2.21.9 → 2.21.11
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/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +1 -1
- package/dist/test/agent-registry.test.d.ts +2 -0
- package/dist/test/agent-registry.test.d.ts.map +1 -0
- package/dist/test/agent-registry.test.js +275 -0
- package/dist/test/agent-registry.test.js.map +1 -0
- package/dist/test/wire-mesh-transport-shutdown-unref.test.d.ts +5 -0
- package/dist/test/wire-mesh-transport-shutdown-unref.test.d.ts.map +1 -0
- package/dist/test/wire-mesh-transport-shutdown-unref.test.js +194 -0
- package/dist/test/wire-mesh-transport-shutdown-unref.test.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://github.com/ExaDev/agent-comms)
|
|
4
4
|
[](https://www.npmjs.com/package/agent-comms)
|
|
5
|
-
[](https://github.com/ExaDev/agent-comms/releases/tag/v2.21.11)
|
|
6
6
|
[](https://github.com/ExaDev/agent-comms/actions)
|
|
7
7
|
|
|
8
8
|
Cross-harness communication mesh for LLM agents: rooms, DMs, presence, and visibility over TCP with zero filesystem dependencies.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-registry.test.d.ts","sourceRoot":"","sources":["../../src/test/agent-registry.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Direct, DI-based unit tests for AgentRegistry -- it was previously exercised only indirectly through MeshStore/room-kick-revocation integration tests, which left many individual branches, string literals, and array literals unobserved. AgentRegistryDeps is a narrow, injectable surface built exactly for this: a fake deps object with vi.fn() collaborators lets every branch be asserted on directly.
|
|
3
|
+
*
|
|
4
|
+
* One mutant Stryker raises against setAgentOffline is a true equivalent, not a gap -- documented here rather than chased with a contrived test, matching stale-agent-checker.test.ts's own precedent for the identical pattern: `this.deps.agents.set(id, agent)` right after `agent.status = "offline"` re-sets the same key to the exact same object reference `this.deps.agents.get(id)` already returned, so mutating `.status` on it has already mutated what the Map holds. No test can observe removing that call.
|
|
5
|
+
*/
|
|
6
|
+
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
7
|
+
import { AgentRegistry, } from "../core/agent-registry.js";
|
|
8
|
+
import { CommsError } from "../core/store.js";
|
|
9
|
+
const OWNER_ID = "owner-device";
|
|
10
|
+
const OTHER_ID = "other-device";
|
|
11
|
+
const STARTED_AT = "2026-01-01T00:00:00.000Z";
|
|
12
|
+
/** An arbitrary, distinctive pid used only to prove updateAgent's patch actually lands -- no significance beyond "not the seeded pid". */
|
|
13
|
+
const UPDATED_PID = 999;
|
|
14
|
+
function agent(overrides = {}) {
|
|
15
|
+
return {
|
|
16
|
+
id: OWNER_ID,
|
|
17
|
+
version: 1,
|
|
18
|
+
name: "agent-name",
|
|
19
|
+
harness: "pi",
|
|
20
|
+
cwd: "/tmp",
|
|
21
|
+
pid: 111,
|
|
22
|
+
startedAt: STARTED_AT,
|
|
23
|
+
visibility: "visible",
|
|
24
|
+
status: "active",
|
|
25
|
+
tags: [],
|
|
26
|
+
subscribedRooms: [],
|
|
27
|
+
...overrides,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function makeHarness(peerId = OWNER_ID) {
|
|
31
|
+
const bump = vi.fn();
|
|
32
|
+
const broadcastPatch = vi.fn().mockResolvedValue(undefined);
|
|
33
|
+
const notifyRoomsOfStatus = vi.fn().mockResolvedValue(undefined);
|
|
34
|
+
const notifyRoomsOfNameChange = vi.fn().mockResolvedValue(undefined);
|
|
35
|
+
const broadcastAgentVisible = vi.fn().mockResolvedValue(undefined);
|
|
36
|
+
const broadcastAgentGone = vi.fn().mockResolvedValue(undefined);
|
|
37
|
+
const deps = {
|
|
38
|
+
agents: new Map(),
|
|
39
|
+
identityCache: new Map(),
|
|
40
|
+
startedAt: STARTED_AT,
|
|
41
|
+
getPeerId: () => peerId,
|
|
42
|
+
deliveryEngine: {
|
|
43
|
+
bump,
|
|
44
|
+
broadcastPatch,
|
|
45
|
+
notifyRoomsOfStatus,
|
|
46
|
+
notifyRoomsOfNameChange,
|
|
47
|
+
},
|
|
48
|
+
federation: { broadcastAgentVisible, broadcastAgentGone },
|
|
49
|
+
};
|
|
50
|
+
return {
|
|
51
|
+
deps,
|
|
52
|
+
registry: new AgentRegistry(deps),
|
|
53
|
+
bump,
|
|
54
|
+
broadcastPatch,
|
|
55
|
+
notifyRoomsOfStatus,
|
|
56
|
+
notifyRoomsOfNameChange,
|
|
57
|
+
broadcastAgentVisible,
|
|
58
|
+
broadcastAgentGone,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
describe("AgentRegistry — identity cache", () => {
|
|
62
|
+
it("readIdentity keys by the exact harness+cwd pair, not a blank or partial key", async () => {
|
|
63
|
+
const { registry, deps } = makeHarness();
|
|
64
|
+
deps.identityCache.set("pi--/tmp/a", { id: "agent-a" });
|
|
65
|
+
deps.identityCache.set("codex--/tmp/a", { id: "agent-b" });
|
|
66
|
+
await expect(registry.readIdentity("pi", "/tmp/a")).resolves.toEqual({
|
|
67
|
+
id: "agent-a",
|
|
68
|
+
});
|
|
69
|
+
await expect(registry.readIdentity("codex", "/tmp/a")).resolves.toEqual({
|
|
70
|
+
id: "agent-b",
|
|
71
|
+
});
|
|
72
|
+
await expect(registry.readIdentity("pi", "/tmp/other")).resolves.toBeUndefined();
|
|
73
|
+
});
|
|
74
|
+
it("writeIdentity stores under the harness+cwd composite key, readable back by readIdentity", async () => {
|
|
75
|
+
const { registry } = makeHarness();
|
|
76
|
+
await registry.writeIdentity("pi", "/tmp/a", "written-id");
|
|
77
|
+
await expect(registry.readIdentity("pi", "/tmp/a")).resolves.toEqual({
|
|
78
|
+
id: "written-id",
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
describe("AgentRegistry — registerAgent", () => {
|
|
83
|
+
it("a brand-new (harness, cwd) pair creates a fresh agent with an empty subscribedRooms array", async () => {
|
|
84
|
+
const { registry, deps } = makeHarness();
|
|
85
|
+
const created = await registry.registerAgent({
|
|
86
|
+
name: "fresh",
|
|
87
|
+
harness: "pi",
|
|
88
|
+
cwd: "/tmp/fresh",
|
|
89
|
+
pid: 1,
|
|
90
|
+
visibility: "visible",
|
|
91
|
+
tags: ["x"],
|
|
92
|
+
});
|
|
93
|
+
expect(created.subscribedRooms).toEqual([]);
|
|
94
|
+
expect(deps.agents.get(OWNER_ID)).toEqual(created);
|
|
95
|
+
await expect(registry.readIdentity("pi", "/tmp/fresh")).resolves.toEqual({
|
|
96
|
+
id: OWNER_ID,
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
it("re-registering an already-known (harness, cwd) pair updates the existing agent by its original id rather than minting a fresh one", async () => {
|
|
100
|
+
let nextId = 0;
|
|
101
|
+
const peerIds = ["first-id", "second-id"];
|
|
102
|
+
const { registry, deps } = makeHarness();
|
|
103
|
+
deps.getPeerId = () => {
|
|
104
|
+
const id = peerIds[nextId];
|
|
105
|
+
nextId += 1;
|
|
106
|
+
if (id === undefined)
|
|
107
|
+
throw new Error("getPeerId called more times than expected");
|
|
108
|
+
return id;
|
|
109
|
+
};
|
|
110
|
+
const first = await registry.registerAgent({
|
|
111
|
+
name: "one",
|
|
112
|
+
harness: "pi",
|
|
113
|
+
cwd: "/tmp/same",
|
|
114
|
+
pid: 1,
|
|
115
|
+
visibility: "visible",
|
|
116
|
+
tags: [],
|
|
117
|
+
});
|
|
118
|
+
const second = await registry.registerAgent({
|
|
119
|
+
name: "two",
|
|
120
|
+
harness: "pi",
|
|
121
|
+
cwd: "/tmp/same",
|
|
122
|
+
pid: 2,
|
|
123
|
+
visibility: "hidden",
|
|
124
|
+
tags: ["updated"],
|
|
125
|
+
});
|
|
126
|
+
expect(second.id).toBe(first.id);
|
|
127
|
+
expect(nextId).toBe(1);
|
|
128
|
+
expect(second.name).toBe("two");
|
|
129
|
+
expect(second.visibility).toBe("hidden");
|
|
130
|
+
expect(second.pid).toBe(2);
|
|
131
|
+
expect(second.tags).toEqual(["updated"]);
|
|
132
|
+
});
|
|
133
|
+
it("broadcasts presence to federated links only for a visible agent, not hidden or ghost", async () => {
|
|
134
|
+
const visible = makeHarness();
|
|
135
|
+
await visible.registry.registerAgent({
|
|
136
|
+
name: "v",
|
|
137
|
+
harness: "pi",
|
|
138
|
+
cwd: "/tmp/v",
|
|
139
|
+
pid: 1,
|
|
140
|
+
visibility: "visible",
|
|
141
|
+
tags: [],
|
|
142
|
+
});
|
|
143
|
+
expect(visible.broadcastAgentVisible).toHaveBeenCalledTimes(1);
|
|
144
|
+
const hidden = makeHarness();
|
|
145
|
+
await hidden.registry.registerAgent({
|
|
146
|
+
name: "h",
|
|
147
|
+
harness: "pi",
|
|
148
|
+
cwd: "/tmp/h",
|
|
149
|
+
pid: 1,
|
|
150
|
+
visibility: "hidden",
|
|
151
|
+
tags: [],
|
|
152
|
+
});
|
|
153
|
+
expect(hidden.broadcastAgentVisible).not.toHaveBeenCalled();
|
|
154
|
+
const ghost = makeHarness();
|
|
155
|
+
await ghost.registry.registerAgent({
|
|
156
|
+
name: "g",
|
|
157
|
+
harness: "pi",
|
|
158
|
+
cwd: "/tmp/g",
|
|
159
|
+
pid: 1,
|
|
160
|
+
visibility: "ghost",
|
|
161
|
+
tags: [],
|
|
162
|
+
});
|
|
163
|
+
expect(ghost.broadcastAgentVisible).not.toHaveBeenCalled();
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
describe("AgentRegistry — getAgent", () => {
|
|
167
|
+
it("returns the stored agent for a known id, undefined for an unknown one", async () => {
|
|
168
|
+
const { registry, deps } = makeHarness();
|
|
169
|
+
const a = agent();
|
|
170
|
+
deps.agents.set(a.id, a);
|
|
171
|
+
await expect(registry.getAgent(a.id)).resolves.toEqual(a);
|
|
172
|
+
await expect(registry.getAgent("nobody")).resolves.toBeUndefined();
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
describe("AgentRegistry — updateAgent", () => {
|
|
176
|
+
let h;
|
|
177
|
+
beforeEach(() => {
|
|
178
|
+
h = makeHarness();
|
|
179
|
+
h.deps.agents.set(OWNER_ID, agent({ name: "old-name", status: "active" }));
|
|
180
|
+
});
|
|
181
|
+
it("throws a CommsError naming the exact missing agent id when the target doesn't exist", async () => {
|
|
182
|
+
await expect(h.registry.updateAgent("missing-id", {})).rejects.toMatchObject(new CommsError("Agent missing-id not found", "AGENT_NOT_FOUND"));
|
|
183
|
+
});
|
|
184
|
+
it("bumps and persists the merged patch into the agents map", async () => {
|
|
185
|
+
const updated = await h.registry.updateAgent(OWNER_ID, {
|
|
186
|
+
pid: UPDATED_PID,
|
|
187
|
+
});
|
|
188
|
+
expect(h.bump).toHaveBeenCalledWith(updated);
|
|
189
|
+
expect(h.deps.agents.get(OWNER_ID)).toEqual(updated);
|
|
190
|
+
expect(updated.pid).toBe(UPDATED_PID);
|
|
191
|
+
});
|
|
192
|
+
it("notifies rooms of a name change only when the patch actually changes the name", async () => {
|
|
193
|
+
await h.registry.updateAgent(OWNER_ID, { name: "new-name" });
|
|
194
|
+
expect(h.notifyRoomsOfNameChange).toHaveBeenCalledWith(OWNER_ID, "old-name", "new-name");
|
|
195
|
+
});
|
|
196
|
+
it("does not notify of a name change when the patch omits name", async () => {
|
|
197
|
+
await h.registry.updateAgent(OWNER_ID, { pid: 1 });
|
|
198
|
+
expect(h.notifyRoomsOfNameChange).not.toHaveBeenCalled();
|
|
199
|
+
});
|
|
200
|
+
it("does not notify of a name change when the patch repeats the current name", async () => {
|
|
201
|
+
await h.registry.updateAgent(OWNER_ID, { name: "old-name" });
|
|
202
|
+
expect(h.notifyRoomsOfNameChange).not.toHaveBeenCalled();
|
|
203
|
+
});
|
|
204
|
+
it("notifies rooms of a status change only when the patch actually changes the status", async () => {
|
|
205
|
+
await h.registry.updateAgent(OWNER_ID, { status: "offline" });
|
|
206
|
+
expect(h.notifyRoomsOfStatus).toHaveBeenCalledWith(OWNER_ID, "offline");
|
|
207
|
+
});
|
|
208
|
+
it("does not notify of a status change when the patch omits status", async () => {
|
|
209
|
+
await h.registry.updateAgent(OWNER_ID, { pid: 1 });
|
|
210
|
+
expect(h.notifyRoomsOfStatus).not.toHaveBeenCalled();
|
|
211
|
+
});
|
|
212
|
+
it("does not notify of a status change when the patch repeats the current status", async () => {
|
|
213
|
+
await h.registry.updateAgent(OWNER_ID, { status: "active" });
|
|
214
|
+
expect(h.notifyRoomsOfStatus).not.toHaveBeenCalled();
|
|
215
|
+
});
|
|
216
|
+
});
|
|
217
|
+
describe("AgentRegistry — listAgents", () => {
|
|
218
|
+
it("excludes a ghost agent from a different requester's view", async () => {
|
|
219
|
+
const { registry, deps } = makeHarness();
|
|
220
|
+
deps.agents.set("ghost-agent", agent({ id: "ghost-agent", visibility: "ghost" }));
|
|
221
|
+
deps.agents.set("visible-agent", agent({ id: "visible-agent", visibility: "visible" }));
|
|
222
|
+
const result = await registry.listAgents("some-requester");
|
|
223
|
+
expect(result.map((a) => a.id)).toEqual(["visible-agent"]);
|
|
224
|
+
});
|
|
225
|
+
it("includes a ghost agent in its own view of itself", async () => {
|
|
226
|
+
const { registry, deps } = makeHarness();
|
|
227
|
+
deps.agents.set("ghost-agent", agent({ id: "ghost-agent", visibility: "ghost" }));
|
|
228
|
+
const result = await registry.listAgents("ghost-agent");
|
|
229
|
+
expect(result.map((a) => a.id)).toEqual(["ghost-agent"]);
|
|
230
|
+
});
|
|
231
|
+
it("always includes a non-ghost agent regardless of who's asking", async () => {
|
|
232
|
+
const { registry, deps } = makeHarness();
|
|
233
|
+
deps.agents.set("visible-agent", agent({ id: "visible-agent", visibility: "visible" }));
|
|
234
|
+
const result = await registry.listAgents("anyone-else");
|
|
235
|
+
expect(result.map((a) => a.id)).toEqual(["visible-agent"]);
|
|
236
|
+
});
|
|
237
|
+
});
|
|
238
|
+
describe("AgentRegistry — setAgentOffline", () => {
|
|
239
|
+
it("is a no-op for an unknown agent id", async () => {
|
|
240
|
+
const h = makeHarness();
|
|
241
|
+
await h.registry.setAgentOffline("unknown");
|
|
242
|
+
expect(h.bump).not.toHaveBeenCalled();
|
|
243
|
+
});
|
|
244
|
+
it("is a no-op for an agent already offline", async () => {
|
|
245
|
+
const h = makeHarness();
|
|
246
|
+
h.deps.agents.set(OWNER_ID, agent({ status: "offline" }));
|
|
247
|
+
await h.registry.setAgentOffline(OWNER_ID);
|
|
248
|
+
expect(h.bump).not.toHaveBeenCalled();
|
|
249
|
+
expect(h.notifyRoomsOfStatus).not.toHaveBeenCalled();
|
|
250
|
+
});
|
|
251
|
+
it("for the owning peer's own agent, sets status offline, bumps, persists, and broadcasts to rooms/mesh/federation", async () => {
|
|
252
|
+
const h = makeHarness(OWNER_ID);
|
|
253
|
+
h.deps.agents.set(OWNER_ID, agent({ status: "active" }));
|
|
254
|
+
await h.registry.setAgentOffline(OWNER_ID);
|
|
255
|
+
expect(h.deps.agents.get(OWNER_ID)?.status).toBe("offline");
|
|
256
|
+
expect(h.bump).toHaveBeenCalledTimes(1);
|
|
257
|
+
expect(h.notifyRoomsOfStatus).toHaveBeenCalledWith(OWNER_ID, "offline");
|
|
258
|
+
expect(h.broadcastPatch).toHaveBeenCalledWith({
|
|
259
|
+
type: "agent_offline",
|
|
260
|
+
agentId: OWNER_ID,
|
|
261
|
+
});
|
|
262
|
+
expect(h.broadcastAgentGone).toHaveBeenCalledWith(OWNER_ID);
|
|
263
|
+
});
|
|
264
|
+
it("for a non-owning peer's agent, updates local state but does not broadcast anything", async () => {
|
|
265
|
+
const h = makeHarness(OWNER_ID);
|
|
266
|
+
h.deps.agents.set(OTHER_ID, agent({ id: OTHER_ID, status: "active" }));
|
|
267
|
+
await h.registry.setAgentOffline(OTHER_ID);
|
|
268
|
+
expect(h.deps.agents.get(OTHER_ID)?.status).toBe("offline");
|
|
269
|
+
expect(h.bump).toHaveBeenCalledTimes(1);
|
|
270
|
+
expect(h.notifyRoomsOfStatus).not.toHaveBeenCalled();
|
|
271
|
+
expect(h.broadcastPatch).not.toHaveBeenCalled();
|
|
272
|
+
expect(h.broadcastAgentGone).not.toHaveBeenCalled();
|
|
273
|
+
});
|
|
274
|
+
});
|
|
275
|
+
//# sourceMappingURL=agent-registry.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-registry.test.js","sourceRoot":"","sources":["../../src/test/agent-registry.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9D,OAAO,EACL,aAAa,GAEd,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG9C,MAAM,QAAQ,GAAG,cAAc,CAAC;AAChC,MAAM,QAAQ,GAAG,cAAc,CAAC;AAChC,MAAM,UAAU,GAAG,0BAA0B,CAAC;AAC9C,0IAA0I;AAC1I,MAAM,WAAW,GAAG,GAAG,CAAC;AAExB,SAAS,KAAK,CAAC,YAAoC,EAAE;IACnD,OAAO;QACL,EAAE,EAAE,QAAQ;QACZ,OAAO,EAAE,CAAC;QACV,IAAI,EAAE,YAAY;QAClB,OAAO,EAAE,IAAI;QACb,GAAG,EAAE,MAAM;QACX,GAAG,EAAE,GAAG;QACR,SAAS,EAAE,UAAU;QACrB,UAAU,EAAE,SAAS;QACrB,MAAM,EAAE,QAAQ;QAChB,IAAI,EAAE,EAAE;QACR,eAAe,EAAE,EAAE;QACnB,GAAG,SAAS;KACb,CAAC;AACJ,CAAC;AAaD,SAAS,WAAW,CAAC,MAAM,GAAG,QAAQ;IACpC,MAAM,IAAI,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;IACrB,MAAM,cAAc,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;IAC5D,MAAM,mBAAmB,GAAG,EA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MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC5D,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;QACxC,MAAM,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;QACrD,MAAM,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;QAChD,MAAM,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;IACtD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WireMeshTransport shutdown()/unref() -- direct mechanism assertions, split out of wire-mesh-transport.test.ts to stay under this repo's max-lines cap. Existing shutdown coverage in the sibling file proves observable, cross-peer behaviour (B sees A's session close, a second decision finds nothing pending). These tests instead assert directly on the specific cleanup mechanisms shutdown() itself performs -- the underlying Map/Set.clear() calls, timer cancellations, and listener unref() calls -- so a mutation removing one of those calls fails here even when nothing was ever added to the collection it clears, which no behavioural assertion downstream of an empty collection could otherwise observe.
|
|
3
|
+
*/
|
|
4
|
+
export {};
|
|
5
|
+
//# sourceMappingURL=wire-mesh-transport-shutdown-unref.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wire-mesh-transport-shutdown-unref.test.d.ts","sourceRoot":"","sources":["../../src/test/wire-mesh-transport-shutdown-unref.test.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WireMeshTransport shutdown()/unref() -- direct mechanism assertions, split out of wire-mesh-transport.test.ts to stay under this repo's max-lines cap. Existing shutdown coverage in the sibling file proves observable, cross-peer behaviour (B sees A's session close, a second decision finds nothing pending). These tests instead assert directly on the specific cleanup mechanisms shutdown() itself performs -- the underlying Map/Set.clear() calls, timer cancellations, and listener unref() calls -- so a mutation removing one of those calls fails here even when nothing was ever added to the collection it clears, which no behavioural assertion downstream of an empty collection could otherwise observe.
|
|
3
|
+
*/
|
|
4
|
+
import * as net from "node:net";
|
|
5
|
+
import { test, describe, expect, vi } from "vitest";
|
|
6
|
+
import { createTlsTransport } from "wire-mesh-core/adapters/tls-transport";
|
|
7
|
+
import { acceptMeshSession } from "wire-mesh-core/domain/mesh-session";
|
|
8
|
+
import { generateIdentity } from "../core/identity.js";
|
|
9
|
+
import { toIdentityPort } from "../core/wire-mesh-identity.js";
|
|
10
|
+
import { WireMeshTransport, DOMAIN, FRAME_SCOPE, buildCommand, } from "../core/wire-mesh-transport.js";
|
|
11
|
+
import { deviceIdToHex } from "wire-mesh-core/domain/device-id";
|
|
12
|
+
import { waitFor } from "./test-transport.js";
|
|
13
|
+
function noopEvents(overrides = {}) {
|
|
14
|
+
return {
|
|
15
|
+
onMessage: () => undefined,
|
|
16
|
+
onPeerConnected: () => undefined,
|
|
17
|
+
onPeerDisconnected: () => undefined,
|
|
18
|
+
onIntroduction: () => undefined,
|
|
19
|
+
onConnectionRequest: () => undefined,
|
|
20
|
+
onPeerList: () => undefined,
|
|
21
|
+
onPeerJoined: () => undefined,
|
|
22
|
+
onBecomeCoordinator: () => undefined,
|
|
23
|
+
onRevocationAnnounce: () => undefined,
|
|
24
|
+
onPresenceAdvert: () => undefined,
|
|
25
|
+
...overrides,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
async function findFreePort() {
|
|
29
|
+
return new Promise((resolve, reject) => {
|
|
30
|
+
const server = net.createServer();
|
|
31
|
+
server.listen(0, "127.0.0.1", () => {
|
|
32
|
+
const addr = server.address();
|
|
33
|
+
const port = typeof addr === "object" && addr !== null ? addr.port : 0;
|
|
34
|
+
server.close(() => resolve(port));
|
|
35
|
+
});
|
|
36
|
+
server.on("error", reject);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
async function peerId(identity) {
|
|
40
|
+
return deviceIdToHex(Uint8Array.from(identity.deviceId));
|
|
41
|
+
}
|
|
42
|
+
// pendingConnections, peerSessions, coordinatorListeners -- the three Maps shutdown() clears.
|
|
43
|
+
const SHUTDOWN_MAP_CLEAR_COUNT = 3;
|
|
44
|
+
describe("WireMeshTransport shutdown -- direct mechanism assertions", () => {
|
|
45
|
+
test("shutdown clears every internal bookkeeping collection, even when all of them are already empty", async () => {
|
|
46
|
+
const identity = generateIdentity();
|
|
47
|
+
const transport = new WireMeshTransport(noopEvents(), identity);
|
|
48
|
+
const mapClearSpy = vi.spyOn(Map.prototype, "clear");
|
|
49
|
+
const setClearSpy = vi.spyOn(Set.prototype, "clear");
|
|
50
|
+
try {
|
|
51
|
+
await transport.shutdown();
|
|
52
|
+
// dataDials, allSessions (Sets) + pendingConnections, peerSessions, coordinatorListeners (Maps) -- five distinct collections shutdown() is documented to clear, regardless of whether any of them held anything.
|
|
53
|
+
expect(setClearSpy.mock.calls.length).toBeGreaterThanOrEqual(2);
|
|
54
|
+
expect(mapClearSpy.mock.calls.length).toBeGreaterThanOrEqual(SHUTDOWN_MAP_CLEAR_COUNT);
|
|
55
|
+
}
|
|
56
|
+
finally {
|
|
57
|
+
mapClearSpy.mockRestore();
|
|
58
|
+
setClearSpy.mockRestore();
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
test("shutdown cancels the pending-connection timeout for every still-pending connect_request, not just its own reject response", async () => {
|
|
62
|
+
const identityA = generateIdentity();
|
|
63
|
+
const identityB = generateIdentity();
|
|
64
|
+
const idB = await peerId(await toIdentityPort(identityB));
|
|
65
|
+
const requestsSeenByA = [];
|
|
66
|
+
const transportA = new WireMeshTransport(noopEvents({
|
|
67
|
+
onConnectionRequest: (h) => void requestsSeenByA.push(h),
|
|
68
|
+
}), identityA);
|
|
69
|
+
const clearTimeoutSpy = vi.spyOn(global, "clearTimeout");
|
|
70
|
+
try {
|
|
71
|
+
await transportA.becomeCoordinator("127.0.0.1", 0);
|
|
72
|
+
const [listener] = transportA.listListeners();
|
|
73
|
+
if (listener === undefined)
|
|
74
|
+
throw new Error("expected a bound listener");
|
|
75
|
+
const clientTransport = createTlsTransport({
|
|
76
|
+
certificatePem: identityB.certificate,
|
|
77
|
+
privateKeyPem: identityB.privateKey,
|
|
78
|
+
});
|
|
79
|
+
const connection = await clientTransport.connect(`127.0.0.1:${String(listener.port)}`);
|
|
80
|
+
const clientIdentityPort = await toIdentityPort(identityB);
|
|
81
|
+
const session = await acceptMeshSession(connection, clientIdentityPort, [
|
|
82
|
+
DOMAIN,
|
|
83
|
+
]);
|
|
84
|
+
void session
|
|
85
|
+
.sendManageRequest(buildCommand({
|
|
86
|
+
method: "connect_request",
|
|
87
|
+
peerId: idB,
|
|
88
|
+
dataPort: 0,
|
|
89
|
+
name: "connector",
|
|
90
|
+
fingerprint: "",
|
|
91
|
+
}), FRAME_SCOPE)
|
|
92
|
+
.catch(() => undefined);
|
|
93
|
+
await waitFor(() => requestsSeenByA.some((h) => h.id === idB), "A observes the pending connect_request");
|
|
94
|
+
clearTimeoutSpy.mockClear();
|
|
95
|
+
await transportA.shutdown();
|
|
96
|
+
expect(clearTimeoutSpy).toHaveBeenCalled();
|
|
97
|
+
await session.close();
|
|
98
|
+
}
|
|
99
|
+
finally {
|
|
100
|
+
clearTimeoutSpy.mockRestore();
|
|
101
|
+
await transportA.shutdown();
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
test("shutdown clears the presence-readvertise interval when one was started", async () => {
|
|
105
|
+
const identity = generateIdentity();
|
|
106
|
+
const clearIntervalSpy = vi.spyOn(global, "clearInterval");
|
|
107
|
+
try {
|
|
108
|
+
const transport = new WireMeshTransport(noopEvents(), identity, undefined, undefined, () => "active");
|
|
109
|
+
clearIntervalSpy.mockClear();
|
|
110
|
+
await transport.shutdown();
|
|
111
|
+
expect(clearIntervalSpy).toHaveBeenCalledTimes(1);
|
|
112
|
+
}
|
|
113
|
+
finally {
|
|
114
|
+
clearIntervalSpy.mockRestore();
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
test("shutdown does not call clearInterval at all when no presence source was ever configured", async () => {
|
|
118
|
+
const identity = generateIdentity();
|
|
119
|
+
const clearIntervalSpy = vi.spyOn(global, "clearInterval");
|
|
120
|
+
try {
|
|
121
|
+
const transport = new WireMeshTransport(noopEvents(), identity);
|
|
122
|
+
clearIntervalSpy.mockClear();
|
|
123
|
+
await transport.shutdown();
|
|
124
|
+
expect(clearIntervalSpy).not.toHaveBeenCalled();
|
|
125
|
+
}
|
|
126
|
+
finally {
|
|
127
|
+
clearIntervalSpy.mockRestore();
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
test("a connect_request left unanswered past the configured timeout is auto-rejected with the documented error code", async () => {
|
|
131
|
+
const identityA = generateIdentity();
|
|
132
|
+
const identityB = generateIdentity();
|
|
133
|
+
const idB = await peerId(await toIdentityPort(identityB));
|
|
134
|
+
const SHORT_TIMEOUT_MS = 150;
|
|
135
|
+
const transportA = new WireMeshTransport(noopEvents(), identityA, undefined, SHORT_TIMEOUT_MS);
|
|
136
|
+
const transportB = new WireMeshTransport(noopEvents(), identityB);
|
|
137
|
+
try {
|
|
138
|
+
await transportA.becomeCoordinator("127.0.0.1", 0);
|
|
139
|
+
const [listener] = transportA.listListeners();
|
|
140
|
+
if (listener === undefined)
|
|
141
|
+
throw new Error("expected a bound listener");
|
|
142
|
+
const clientTransport = createTlsTransport({
|
|
143
|
+
certificatePem: identityB.certificate,
|
|
144
|
+
privateKeyPem: identityB.privateKey,
|
|
145
|
+
});
|
|
146
|
+
const connection = await clientTransport.connect(`127.0.0.1:${String(listener.port)}`);
|
|
147
|
+
const clientIdentityPort = await toIdentityPort(identityB);
|
|
148
|
+
const session = await acceptMeshSession(connection, clientIdentityPort, [
|
|
149
|
+
DOMAIN,
|
|
150
|
+
]);
|
|
151
|
+
const outcome = await session.sendManageRequest(buildCommand({
|
|
152
|
+
method: "connect_request",
|
|
153
|
+
peerId: idB,
|
|
154
|
+
dataPort: 0,
|
|
155
|
+
name: "connector",
|
|
156
|
+
fingerprint: "",
|
|
157
|
+
}), FRAME_SCOPE);
|
|
158
|
+
expect(outcome).toMatchObject({ result: "error", code: "timeout" });
|
|
159
|
+
await session.close();
|
|
160
|
+
}
|
|
161
|
+
finally {
|
|
162
|
+
await transportB.shutdown();
|
|
163
|
+
await transportA.shutdown();
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
describe("WireMeshTransport unref", () => {
|
|
168
|
+
test("unrefs the data listener and every coordinator listener, not just one of them", async () => {
|
|
169
|
+
const identity = generateIdentity();
|
|
170
|
+
const transport = new WireMeshTransport(noopEvents(), identity);
|
|
171
|
+
const unrefSpy = vi.spyOn(net.Server.prototype, "unref");
|
|
172
|
+
try {
|
|
173
|
+
await transport.startDataServer();
|
|
174
|
+
const port = await findFreePort();
|
|
175
|
+
await transport.addListener("127.0.0.1", port, "full");
|
|
176
|
+
unrefSpy.mockClear();
|
|
177
|
+
transport.unref();
|
|
178
|
+
// The data listener plus exactly one added coordinator listener -- two distinct real net.Server instances, each individually unref'd.
|
|
179
|
+
expect(unrefSpy).toHaveBeenCalledTimes(2);
|
|
180
|
+
}
|
|
181
|
+
finally {
|
|
182
|
+
unrefSpy.mockRestore();
|
|
183
|
+
await transport.shutdown();
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
test("unref with no listeners started at all is a safe no-op, not a throw", async () => {
|
|
187
|
+
const identity = generateIdentity();
|
|
188
|
+
const transport = new WireMeshTransport(noopEvents(), identity);
|
|
189
|
+
expect(() => {
|
|
190
|
+
transport.unref();
|
|
191
|
+
}).not.toThrow();
|
|
192
|
+
});
|
|
193
|
+
});
|
|
194
|
+
//# sourceMappingURL=wire-mesh-transport-shutdown-unref.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wire-mesh-transport-shutdown-unref.test.js","sourceRoot":"","sources":["../../src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|
{
|
|
2
2
|
"name": "agent-comms",
|
|
3
|
-
"version": "2.21.
|
|
3
|
+
"version": "2.21.11",
|
|
4
4
|
"description": "Cross-harness communication mesh for LLM agents — rooms, DMs, presence, and real-time push delivery over TCP",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "pnpm@12.4.1+sha512.2e81e399d73fe8390dab25e06aa788ab7a5908248d2f5a370f82b481147a6a7a367bf8048f9a6fdb6460f21a66f0542dedb8b94ca2c8723596741920b1656d4c",
|