agent-comms 1.30.0 → 1.32.0

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.
Files changed (39) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/README.md +1 -1
  4. package/dist/bridges/mcp/index.d.ts.map +1 -1
  5. package/dist/bridges/mcp/index.js +3 -11
  6. package/dist/bridges/mcp/index.js.map +1 -1
  7. package/dist/core/bridge-mesh.d.ts +14 -0
  8. package/dist/core/bridge-mesh.d.ts.map +1 -0
  9. package/dist/core/bridge-mesh.js +19 -0
  10. package/dist/core/bridge-mesh.js.map +1 -0
  11. package/dist/core/index.d.ts +2 -0
  12. package/dist/core/index.d.ts.map +1 -1
  13. package/dist/core/index.js +1 -0
  14. package/dist/core/index.js.map +1 -1
  15. package/dist/core/wire-mesh-transport.d.ts +57 -0
  16. package/dist/core/wire-mesh-transport.d.ts.map +1 -0
  17. package/dist/core/wire-mesh-transport.js +466 -0
  18. package/dist/core/wire-mesh-transport.js.map +1 -0
  19. package/dist/test/bridge-mesh.test.d.ts +5 -0
  20. package/dist/test/bridge-mesh.test.d.ts.map +1 -0
  21. package/dist/test/bridge-mesh.test.js +67 -0
  22. package/dist/test/bridge-mesh.test.js.map +1 -0
  23. package/dist/test/delivery-receipt.runner.d.ts +2 -7
  24. package/dist/test/delivery-receipt.runner.d.ts.map +1 -1
  25. package/dist/test/delivery-receipt.runner.js +4 -9
  26. package/dist/test/delivery-receipt.runner.js.map +1 -1
  27. package/dist/test/test-transport.d.ts +4 -0
  28. package/dist/test/test-transport.d.ts.map +1 -1
  29. package/dist/test/test-transport.js +13 -0
  30. package/dist/test/test-transport.js.map +1 -1
  31. package/dist/test/wire-mesh-transport-approval.integration.test.d.ts +5 -0
  32. package/dist/test/wire-mesh-transport-approval.integration.test.d.ts.map +1 -0
  33. package/dist/test/wire-mesh-transport-approval.integration.test.js +164 -0
  34. package/dist/test/wire-mesh-transport-approval.integration.test.js.map +1 -0
  35. package/dist/test/wire-mesh-transport.integration.test.d.ts +5 -0
  36. package/dist/test/wire-mesh-transport.integration.test.d.ts.map +1 -0
  37. package/dist/test/wire-mesh-transport.integration.test.js +89 -0
  38. package/dist/test/wire-mesh-transport.integration.test.js.map +1 -0
  39. package/package.json +4 -6
@@ -15,7 +15,7 @@
15
15
  "url": "https://github.com/ExaDev/agent-comms.git"
16
16
  },
17
17
  "description": "Cross-harness LLM agent communication mesh — rooms, DMs, and presence",
18
- "version": "1.30.0"
18
+ "version": "1.32.0"
19
19
  }
20
20
  ]
21
21
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "agent-comms",
3
3
  "description": "Cross-harness LLM agent communication mesh — rooms, DMs, and presence",
4
- "version": "1.30.0",
4
+ "version": "1.32.0",
5
5
  "author": {
6
6
  "name": "ExaDev"
7
7
  },
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![GitHub](https://img.shields.io/badge/GitHub-181717?logo=github&logoColor=white)](https://github.com/ExaDev/agent-comms)
4
4
  [![npm](https://img.shields.io/badge/npm-CB3837?logo=npm&logoColor=white)](https://www.npmjs.com/package/agent-comms)
5
- [![version](https://img.shields.io/badge/version-1.30.0-blue)](https://github.com/ExaDev/agent-comms/releases/tag/v1.30.0)
5
+ [![version](https://img.shields.io/badge/version-1.32.0-blue)](https://github.com/ExaDev/agent-comms/releases/tag/v1.32.0)
6
6
  [![CI](https://img.shields.io/github/actions/workflow/status/ExaDev/agent-comms/ci.yml?branch=main)](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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/bridges/mcp/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAyBH,wBAAsB,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,CAwFzC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/bridges/mcp/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAoBH,wBAAsB,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,CAkFzC"}
@@ -9,24 +9,16 @@
9
9
  */
10
10
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
11
11
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
12
- import { MeshStore, CommsTool, buildAction, ensureRegistered, drainAndFormat, MCP_TOOL_PARAMS, } from "../../core/index.js";
13
- import { TlsTransport } from "../../core/tls-transport.js";
14
- import { loadOrCreateIdentity, } from "../../core/identity-store.js";
12
+ import { createBridgeMesh, buildAction, ensureRegistered, drainAndFormat, MCP_TOOL_PARAMS, } from "../../core/index.js";
15
13
  import { tryStartWebServer } from "../user/web/server.js";
16
14
  import { nanoid } from "../../core/nanoid.js";
17
15
  function isRecord(value) {
18
16
  return typeof value === "object" && value !== null && !Array.isArray(value);
19
17
  }
20
18
  export async function run() {
21
- // Persistent identity for this slot: a stable fingerprint means the agent
22
- // ID survives restarts, so peers can keep targeting us. The stdio server
23
- // has no graceful shutdown hook; a stale lock self-heals via the pid probe.
19
+ // Persistent identity for this slot: a stable device-id means the agent ID survives restarts, so peers can keep targeting us. The stdio server has no graceful shutdown hook; a stale lock self-heals via the pid probe.
24
20
  const identitySlot = { harness: "mcp", cwd: process.cwd() };
25
- const identity = loadOrCreateIdentity(identitySlot);
26
- const store = new MeshStore();
27
- store.peerId = identity.fingerprint;
28
- store.setTransport(new TlsTransport(store.events, identity));
29
- const tool = new CommsTool(store, store.discovery);
21
+ const { store, tool } = createBridgeMesh(identitySlot);
30
22
  let agentId;
31
23
  const mcp = new McpServer({ name: "agent-comms", version: "1.1.0" }, { capabilities: {} });
32
24
  // -----------------------------------------------------------------------
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/bridges/mcp/index.ts"],"names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BAAgB,CAAC;QACjC,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;QAClB,KAAK;QACL,OAAO,EAAE,KAAK;QACd,WAAW,EAAE,OAAO,MAAM,CAAC,CAAC,CAAC,EAAE;KAChC,CAAC,CAAC;IACH,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC;AACxB,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Shared bootstrap for a bridge's own mesh participation: load or create this bridge's persisted identity, construct a MeshStore wired to WireMeshTransport, and build the CommsTool that sits on top of it. Every bridge previously repeated this same four-line block against TlsTransport/identity.fingerprint directly; this factory is the single place that wiring lives now, so the substrate a bridge runs on is a one-line change here rather than six repeated ones.
3
+ *
4
+ * peerId is deviceIdToHex(identity.deviceId), not identity.fingerprint -- WireMeshTransport's own session bookkeeping is keyed by device-id, so MeshStore's own notion of "this peer's id" has to be the same value for the two to correlate. Every existing agent id changes the first time a bridge starts through this factory: there is no migration path, since the value is a hash of genuinely different bytes (device-id is SHA-256(raw public key); fingerprint is SHA-256(certificate DER)) -- a hard cutover, already established as correct when identity.ts first grew deviceId, not relitigated here.
5
+ */
6
+ import { MeshStore } from "./mesh-store.js";
7
+ import { CommsTool } from "./tool.js";
8
+ import type { IdentitySlot } from "./identity-store.js";
9
+ export interface BridgeMesh {
10
+ store: MeshStore;
11
+ tool: CommsTool;
12
+ }
13
+ export declare function createBridgeMesh(slot: Readonly<IdentitySlot>, coordinatorPort?: number): BridgeMesh;
14
+ //# sourceMappingURL=bridge-mesh.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bridge-mesh.d.ts","sourceRoot":"","sources":["../../src/core/bridge-mesh.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAGtC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,QAAQ,CAAC,YAAY,CAAC,EAC5B,eAAe,CAAC,EAAE,MAAM,GACvB,UAAU,CAOZ"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Shared bootstrap for a bridge's own mesh participation: load or create this bridge's persisted identity, construct a MeshStore wired to WireMeshTransport, and build the CommsTool that sits on top of it. Every bridge previously repeated this same four-line block against TlsTransport/identity.fingerprint directly; this factory is the single place that wiring lives now, so the substrate a bridge runs on is a one-line change here rather than six repeated ones.
3
+ *
4
+ * peerId is deviceIdToHex(identity.deviceId), not identity.fingerprint -- WireMeshTransport's own session bookkeeping is keyed by device-id, so MeshStore's own notion of "this peer's id" has to be the same value for the two to correlate. Every existing agent id changes the first time a bridge starts through this factory: there is no migration path, since the value is a hash of genuinely different bytes (device-id is SHA-256(raw public key); fingerprint is SHA-256(certificate DER)) -- a hard cutover, already established as correct when identity.ts first grew deviceId, not relitigated here.
5
+ */
6
+ import { deviceIdToHex } from "@exadev/wire-mesh-core/domain/device-id";
7
+ import { MeshStore } from "./mesh-store.js";
8
+ import { CommsTool } from "./tool.js";
9
+ import { WireMeshTransport } from "./wire-mesh-transport.js";
10
+ import { loadOrCreateIdentity } from "./identity-store.js";
11
+ export function createBridgeMesh(slot, coordinatorPort) {
12
+ const identity = loadOrCreateIdentity(slot);
13
+ const store = new MeshStore(coordinatorPort);
14
+ store.peerId = deviceIdToHex(Uint8Array.from(identity.deviceId));
15
+ store.setTransport(new WireMeshTransport(store.events, identity));
16
+ const tool = new CommsTool(store, store.discovery);
17
+ return { store, tool };
18
+ }
19
+ //# sourceMappingURL=bridge-mesh.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bridge-mesh.js","sourceRoot":"","sources":["../../src/core/bridge-mesh.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAQ3D,MAAM,UAAU,gBAAgB,CAC9B,IAA4B,EAC5B,eAAwB;IAExB,MAAM,QAAQ,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAC;IAC5C,MAAM,KAAK,GAAG,IAAI,SAAS,CAAC,eAAe,CAAC,CAAC;IAC7C,KAAK,CAAC,MAAM,GAAG,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;IACjE,KAAK,CAAC,YAAY,CAAC,IAAI,iBAAiB,CAAC,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;IAClE,MAAM,IAAI,GAAG,IAAI,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IACnD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AACzB,CAAC"}
@@ -8,6 +8,8 @@ export type { CommsStore } from "./comms-store.js";
8
8
  export { FileStore, CommsError } from "./store.js";
9
9
  export { MeshStore } from "./mesh-store.js";
10
10
  export { CommsTool } from "./tool.js";
11
+ export { createBridgeMesh } from "./bridge-mesh.js";
12
+ export type { BridgeMesh } from "./bridge-mesh.js";
11
13
  export type { CommsContext, CommsResult } from "./tool.js";
12
14
  export { buildAction, formatDeliveryEvent, extractStreamingBehavior, isActionableEvent, ensureRegistered, ensureProjectRoom, drainAndFormat, MCP_TOOL_PARAMS, } from "./bridge.js";
13
15
  export type { RegistrationResult } from "./bridge.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mapp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AAiB,CAAC"}
@@ -7,6 +7,7 @@
7
7
  export { FileStore, CommsError } from "./store.js";
8
8
  export { MeshStore } from "./mesh-store.js";
9
9
  export { CommsTool } from "./tool.js";
10
+ export { createBridgeMesh } from "./bridge-mesh.js";
10
11
  export { buildAction, formatDeliveryEvent, extractStreamingBehavior, isActionableEvent, ensureRegistered, ensureProjectRoom, drainAndFormat, MCP_TOOL_PARAMS, } from "./bridge.js";
11
12
  export { generateVapidKeys } from "./vapid.js";
12
13
  export { PushManager } from "./push-manager.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,wBAAwB,EACxB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,eAAe,GAChB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAMlD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,cAAc,YAAY,CAAC;AAM3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGpD,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,wBAAwB,EACxB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,eAAe,GAChB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAMlD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,cAAc,YAAY,CAAC;AAM3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * WireMeshTransport — MeshTransport implemented over @exadev/wire-mesh-core, carrying the existing MeshMessage union as an opaque payload rather than inventing new wire semantics. This is the P2 substrate swap's own deliverable: MeshStore, CommsTool, and every existing agent/room/message behaviour above the transport are completely unaffected -- only how bytes move between peers changes.
3
+ *
4
+ * Every agent-comms MeshMessage rides as a single namespaced manage-command verb (FRAME_VERB) under one flat scope (FRAME_SCOPE); the message itself is carried opaquely in the command's own params.message field. This needs no spec/CDDL change: manage-command-params is already an open `{* tstr => any}` socket for exactly this purpose.
5
+ *
6
+ * Peer identity is authenticated at the transport layer, not asserted on the wire: createTlsTransport verifies a peer's presented certificate cryptographically and exposes the result as Connection.peerDeviceId before any MeshMessage is ever exchanged, which is what lets the `pong` self-identification message retire entirely -- there is nothing left for it to prove that the connection itself hasn't already proven.
7
+ *
8
+ * connect_request's accept/reject flow maps onto sendManageRequest's own request/response round trip directly, rather than a separate pair of connect_accepted/connect_rejected messages: manage-request-frame already tolerates arbitrary latency between a request and its response, so "waiting for a human to approve" is simply a manage-response that hasn't been sent yet, not a protocol gap needing its own mechanism. connect_request therefore holds its own IncomingManageRequest open (rather than responding immediately) until acceptConnection/rejectConnection is actually called.
9
+ */
10
+ import type { MeshMessage, PeerInfo } from "./wire-protocol.js";
11
+ import type { ConnectionHandle, ListenerInfo, ListenerPolicy, MeshTransport, TransportEvents } from "./transport.js";
12
+ import type { PeerIdentity } from "./identity.js";
13
+ export declare class WireMeshTransport implements MeshTransport {
14
+ private readonly wireTransport;
15
+ private readonly events;
16
+ private readonly identityReady;
17
+ private _dataPort;
18
+ private _isCoordinator;
19
+ private shutDown;
20
+ /** A method call, not a direct property read -- deliberately, so TS's control-flow narrowing (which does track `this.shutDown` as staying false for the rest of a function once an early `if (this.shutDown) return` has passed, with no awareness that an `await` in between gave a concurrent shutdown() call the chance to flip it) doesn't treat every later re-check in the same async function as unreachable. Each of these re-checks is real: shutdown() can run at any time this function is suspended on an await. */
21
+ private isShuttingDown;
22
+ private dataListener;
23
+ private coordinatorListeners;
24
+ private defaultListenerId;
25
+ private coordinatorSession;
26
+ private peerSessions;
27
+ private allSessions;
28
+ /** Registers a session in both peerSessions (addressing -- last one in for a given peer wins) and allSessions (shutdown -- every session, always). */
29
+ private trackSession;
30
+ private dataDials;
31
+ private pendingConnections;
32
+ constructor(events: TransportEvents, identity: Readonly<PeerIdentity>);
33
+ get dataPort(): number;
34
+ get isCoordinator(): boolean;
35
+ get hasCoordinatorConnection(): boolean;
36
+ private handleAcceptedConnection;
37
+ private consumeIncoming;
38
+ private dispatchIncoming;
39
+ /** Routes an already-decoded MeshMessage to the matching TransportEvents callback -- the same dispatch regardless of which listener (coordinator or data) accepted the connection it arrived on, since the message's own method, not the port it arrived on, is what determines meaning. */
40
+ private route;
41
+ private watchForDisconnect;
42
+ startDataServer(): Promise<void>;
43
+ connectToCoordinator(host: string, port: number, peerId: string, dataPort: number): Promise<void>;
44
+ becomeCoordinator(host: string, port: number): Promise<void>;
45
+ connectToPeer(peer: PeerInfo, _ownPeerId: string): Promise<void>;
46
+ send(handle: ConnectionHandle, message: MeshMessage): Promise<void>;
47
+ broadcast(message: MeshMessage): Promise<void>;
48
+ connectToRemote(host: string, port: number, peerId: string, dataPort: number, name: string, fingerprint: string): Promise<void>;
49
+ acceptConnection(handle: ConnectionHandle): Promise<void>;
50
+ rejectConnection(handle: ConnectionHandle, reason: string): Promise<void>;
51
+ addListener(host: string, port: number, policy: ListenerPolicy): Promise<string>;
52
+ removeListener(id: string): Promise<void>;
53
+ listListeners(): ListenerInfo[];
54
+ shutdown(): Promise<void>;
55
+ unref(): void;
56
+ }
57
+ //# sourceMappingURL=wire-mesh-transport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wire-mesh-transport.d.ts","sourceRoot":"","sources":["../../src/core/wire-mesh-transport.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAmBH,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,aAAa,EACb,eAAe,EAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AA6DlD,qBAAa,iBAAkB,YAAW,aAAa;IACrD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAY;IAC1C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;IACzC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAE5B;IAEF,OAAO,CAAC,SAAS,CAAK;IACtB,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAS;IAEzB,ggBAAggB;IAChgB,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,YAAY,CAAuB;IAG3C,OAAO,CAAC,oBAAoB,CAAsC;IAClE,OAAO,CAAC,iBAAiB,CAAqB;IAG9C,OAAO,CAAC,kB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