agents-can-communicate 0.5.6 → 0.5.7

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.
@@ -11,11 +11,14 @@ import { randomBytes } from "node:crypto";
11
11
  import { createClaudeCodeAdapter } from "@agents-can-communicate/adapter-claude-code";
12
12
  import { listSessionBindings } from "@agents-can-communicate/adapter-sdk";
13
13
  import { createCoordinationService } from "@agents-can-communicate/core";
14
+ import { createDeliveryRouter } from "@agents-can-communicate/delivery-router";
15
+ import { readInstalledLivePolicy } from "@agents-can-communicate/installer";
16
+ import { recordAndOffer } from "@agents-can-communicate/mcp-server";
14
17
  import { resolveClientPid } from "@agents-can-communicate/hook-runner/client-pid";
15
18
  import { readProcessTable } from "@agents-can-communicate/hook-runner/process-table";
16
19
  import { createId } from "@agents-can-communicate/protocol";
17
20
  import { openFilesystemStore } from "@agents-can-communicate/storage-filesystem";
18
- import { createGitProbe, discoverWorkspace, platformDataHome, runtimePaths }
21
+ import { ALL_ADAPTERS, createGitProbe, discoverWorkspace, platformDataHome, runtimePaths }
19
22
  from "@agents-can-communicate/cli";
20
23
 
21
24
  import { createAccChannel, endpointDir, routeAck, routeReply }
@@ -105,8 +108,8 @@ export async function resolveWithin({ resolve, deadline, intervalMs = BINDING_PO
105
108
  async function compose() {
106
109
  const descriptor = await discoverWorkspace({ cwd: process.cwd(), env: process.env,
107
110
  gitProbe: createGitProbe() });
108
- const paths = runtimePaths({ dataHome: platformDataHome({ platform: process.platform,
109
- env: process.env }), workspaceId: descriptor.id, workspaceRoots: descriptor.roots });
111
+ const dataHome = platformDataHome({ platform: process.platform, env: process.env });
112
+ const paths = runtimePaths({ dataHome, workspaceId: descriptor.id, workspaceRoots: descriptor.roots });
110
113
  const store = await openFilesystemStore({ root: paths.root, clock, ids,
111
114
  workspaceId: descriptor.id });
112
115
  const service = createCoordinationService({ store, clock, ids });
@@ -126,11 +129,18 @@ async function compose() {
126
129
  return startInertChannel({ write });
127
130
  }
128
131
 
132
+ const deliveryRouter = createDeliveryRouter({ service, adapters: ALL_ADAPTERS(), clock,
133
+ readLivePolicy: ({ adapter }) => readInstalledLivePolicy({ dataHome, adapterId: adapter.id }) });
129
134
  const channel = createAccChannel({
130
135
  endpointDir: endpointDir(paths.root),
131
136
  clientPid: session.clientPid,
132
137
  write,
133
- routeReply: ({ messageId, body }) => routeReply({ service, session, messageId, body }),
138
+ // The Channel tool records through its own bound session, then uses the
139
+ // same durable-first offer as ordinary MCP. A successful reply record alone
140
+ // does not deliver it to the peer, and a failed offer must not lose it.
141
+ routeReply: ({ messageId, body }) => recordAndOffer({ router: deliveryRouter,
142
+ selectMessage: value => value.reply,
143
+ record: () => routeReply({ service, session, messageId, body }) }),
134
144
  routeAck: ({ messageId }) => routeAck({ service, session, messageId }),
135
145
  // This process is the only party that knows the endpoint is still being
136
146
  // served, and Claude publishes no heartbeat, so nothing else would move
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agents-can-communicate/adapter-claude-code",
3
- "version": "0.5.6",
3
+ "version": "0.5.7",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": {
@@ -196,11 +196,17 @@ export function createAccChannel({ endpointDir, socketDir = channelSocketDirecto
196
196
  if (!nonEmpty(args.messageId)) throw new Error(`${name} requires messageId`);
197
197
  if (name === "acc_reply" && !nonEmpty(args.body)) throw new Error("acc_reply requires body");
198
198
  if (!seen.has(args.messageId)) throw new Error(`${args.messageId} has no delivered message`);
199
- if (name === "acc_reply") await routeReply({ messageId: args.messageId, body: args.body });
200
- else await routeAck({ messageId: args.messageId });
199
+ const routed = name === "acc_reply"
200
+ ? await routeReply({ messageId: args.messageId, body: args.body })
201
+ : await routeAck({ messageId: args.messageId });
201
202
  observe({ event: name === "acc_reply" ? "reply_routed" : "ack_routed", at: clock(),
202
203
  messageId: args.messageId });
203
- return { content: [{ type: "text", text: "sent" }] };
204
+ if (name === "acc_reply" && routed?.recorded?.reply) {
205
+ const structuredContent = { status: "recorded", messageId: routed.recorded.reply.messageId,
206
+ delivery: routed.delivery };
207
+ return { content: [{ type: "text", text: JSON.stringify(structuredContent) }], structuredContent };
208
+ }
209
+ return { content: [{ type: "text", text: name === "acc_reply" ? "recorded" : "acknowledged" }] };
204
210
  }
205
211
 
206
212
  function channelTools() {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agents-can-communicate/adapter-codex",
3
- "version": "0.5.6",
3
+ "version": "0.5.7",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agents-can-communicate",
3
- "version": "0.5.6",
3
+ "version": "0.5.7",
4
4
  "description": "Coordinate this Gemini CLI session with other AI agent sessions working in the same workspace.",
5
5
  "contextFileName": "skills/acc/SKILL.md"
6
6
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agents-can-communicate/adapter-gemini-cli",
3
- "version": "0.5.6",
3
+ "version": "0.5.7",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agents-can-communicate/adapter-grok",
3
- "version": "0.5.6",
3
+ "version": "0.5.7",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agents-can-communicate/adapter-kimi",
3
- "version": "0.5.6",
3
+ "version": "0.5.7",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agents-can-communicate/adapter-sdk",
3
- "version": "0.5.6",
3
+ "version": "0.5.7",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agents-can-communicate/cli",
3
- "version": "0.5.6",
3
+ "version": "0.5.7",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agents-can-communicate/core",
3
- "version": "0.5.6",
3
+ "version": "0.5.7",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agents-can-communicate/delivery-router",
3
- "version": "0.5.6",
3
+ "version": "0.5.7",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agents-can-communicate/hook-runner",
3
- "version": "0.5.6",
3
+ "version": "0.5.7",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agents-can-communicate/installer",
3
- "version": "0.5.6",
3
+ "version": "0.5.7",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agents-can-communicate/mcp-server",
3
- "version": "0.5.6",
3
+ "version": "0.5.7",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agents-can-communicate/protocol",
3
- "version": "0.5.6",
3
+ "version": "0.5.7",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agents-can-communicate/storage-filesystem",
3
- "version": "0.5.6",
3
+ "version": "0.5.7",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agents-can-communicate",
3
- "version": "0.5.6",
3
+ "version": "0.5.7",
4
4
  "accManagedUpdateProtocol": 2,
5
5
  "accStoreVersion": 6,
6
6
  "type": "module",