agents-can-communicate 0.5.7 → 0.5.8
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/README.md +99 -161
- package/bin/entrypoints/acc-claude-channel.mjs +8 -1
- package/bin/entrypoints/claude-channel-binding.mjs +46 -0
- package/docs/ARCHITECTURE.md +7 -0
- package/node_modules/@agents-can-communicate/adapter-claude-code/package.json +1 -1
- package/node_modules/@agents-can-communicate/adapter-codex/package.json +1 -1
- package/node_modules/@agents-can-communicate/adapter-gemini-cli/extension/gemini-extension.json +1 -1
- package/node_modules/@agents-can-communicate/adapter-gemini-cli/package.json +1 -1
- package/node_modules/@agents-can-communicate/adapter-grok/package.json +1 -1
- package/node_modules/@agents-can-communicate/adapter-kimi/package.json +1 -1
- package/node_modules/@agents-can-communicate/adapter-sdk/package.json +1 -1
- package/node_modules/@agents-can-communicate/adapter-sdk/src/native-attempt.mjs +1 -1
- package/node_modules/@agents-can-communicate/cli/package.json +1 -1
- package/node_modules/@agents-can-communicate/core/package.json +1 -1
- package/node_modules/@agents-can-communicate/delivery-router/package.json +1 -1
- package/node_modules/@agents-can-communicate/hook-runner/package.json +4 -2
- package/node_modules/@agents-can-communicate/installer/package.json +1 -1
- package/node_modules/@agents-can-communicate/mcp-server/package.json +1 -1
- package/node_modules/@agents-can-communicate/protocol/package.json +1 -1
- package/node_modules/@agents-can-communicate/storage-filesystem/package.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,186 +1,124 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
**
|
|
1
|
+
# Agents Can Communicate (ACC)
|
|
2
|
+
|
|
3
|
+
**Let your AI coding sessions talk to each other.**
|
|
4
|
+
|
|
5
|
+
ACC connects independent AI coding sessions in the clients you already use. They can ask each
|
|
6
|
+
other questions, exchange reviews, and leave handoffs for another session to continue.
|
|
7
|
+
|
|
8
|
+
You open each client normally and choose its work. Every session keeps its own model,
|
|
9
|
+
conversation, and permissions. Coordination runs locally, with no lead agent managing the
|
|
10
|
+
others.
|
|
11
|
+
|
|
12
|
+
```mermaid
|
|
13
|
+
flowchart TB
|
|
14
|
+
you["You choose the tools and work"]
|
|
15
|
+
codex["Codex<br/>Feature A"]
|
|
16
|
+
claude["Claude Code<br/>Feature B"]
|
|
17
|
+
gemini["Gemini CLI<br/>Feature C"]
|
|
18
|
+
acc["Communication via ACC"]
|
|
19
|
+
|
|
20
|
+
you -.-> codex
|
|
21
|
+
you -.-> claude
|
|
22
|
+
you -.-> gemini
|
|
23
|
+
codex <--> acc
|
|
24
|
+
claude <--> acc
|
|
25
|
+
gemini <--> acc
|
|
26
|
+
|
|
27
|
+
subgraph handoff["When you switch models"]
|
|
28
|
+
direction LR
|
|
29
|
+
current["Current<br/>session"] --> saved["Handoff<br/>Done · Decisions<br/>Next steps"]
|
|
30
|
+
saved --> next["Next<br/>session"]
|
|
31
|
+
end
|
|
32
|
+
acc ~~~ handoff
|
|
33
|
+
|
|
34
|
+
classDef human fill:#f1f5f9,stroke:#8593a3,color:#202a35
|
|
35
|
+
classDef session fill:#fff,stroke:#ced4d9,color:#202a35
|
|
36
|
+
classDef shared fill:#e8edff,stroke:#385cde,color:#202a35
|
|
37
|
+
class you human
|
|
38
|
+
class codex,claude,gemini,current,next session
|
|
39
|
+
class acc,saved shared
|
|
40
|
+
style handoff fill:transparent,stroke:#ced4d9
|
|
41
|
+
linkStyle 3,4,5,6,7 stroke:#385cde,stroke-width:2px
|
|
42
|
+
```
|
|
4
43
|
|
|
5
|
-
|
|
6
|
-
and models you prefer.
|
|
44
|
+
## When ACC helps
|
|
7
45
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
46
|
+
- **Switch models mid-feature.** When a limit approaches or you want another model’s approach,
|
|
47
|
+
leave a handoff with decisions and unfinished work for the next session.
|
|
48
|
+
- **Get a second opinion.** Ask another session to review a specific change and send its
|
|
49
|
+
findings directly to the implementing agent.
|
|
50
|
+
- **Bring parallel features together.** Let sessions working on frontend and backend ask each
|
|
51
|
+
other about a shared API before building around different assumptions.
|
|
12
52
|
|
|
13
|
-
|
|
14
|
-
the same workspace on the same machine and operating-system user; Git is optional.
|
|
53
|
+
## Try one handoff
|
|
15
54
|
|
|
16
|
-
|
|
55
|
+
You’ll need **macOS or Linux, Node.js 24 or newer**, and supported coding clients on the same
|
|
56
|
+
machine and operating-system user.
|
|
17
57
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
58
|
+
```bash
|
|
59
|
+
npm install -g agents-can-communicate
|
|
60
|
+
acc install
|
|
61
|
+
```
|
|
21
62
|
|
|
22
|
-
|
|
63
|
+
The installer connects supported clients it finds. Follow its activation instructions, review
|
|
64
|
+
any required hook or plugin trust, then restart your clients from the project directory. The
|
|
65
|
+
[setup guide](docs/GETTING_STARTED.md) covers client-specific steps.
|
|
23
66
|
|
|
24
|
-
|
|
67
|
+
For example, when pausing work on an account-registration feature, ask:
|
|
25
68
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
69
|
+
```text
|
|
70
|
+
Save a partial handoff in ACC for the registration feature. Include
|
|
71
|
+
what is done, our decisions, what remains, and what you actually
|
|
72
|
+
verified. I will continue in another session.
|
|
73
|
+
```
|
|
30
74
|
|
|
31
|
-
|
|
32
|
-
others are doing. As they work, they can notice a dependency and coordinate. An
|
|
33
|
-
illustrative exchange:
|
|
75
|
+
Open another supported client in the same project and ask:
|
|
34
76
|
|
|
35
77
|
```text
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
78
|
+
Continue the registration feature from its ACC handoff. Check the
|
|
79
|
+
saved decisions against the current files, then take the next
|
|
80
|
+
unfinished step. Ask me if the scope is unclear.
|
|
39
81
|
```
|
|
40
82
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
every task. [Client support](#when-messages-arrive) determines how automatically that
|
|
44
|
-
awareness reaches it.
|
|
83
|
+
The next session should identify the saved decision and begin the remaining work. It can find
|
|
84
|
+
the handoff even if it was opened after the previous session stopped.
|
|
45
85
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
work, remaining work, and blockers. A later session can look up that history. Git commits
|
|
49
|
-
can identify a revision; named files and versions work when Git is unavailable.
|
|
50
|
-
See [requests and replies](docs/CLI.md#messages-and-requests) and
|
|
51
|
-
[handoffs](docs/CLI.md#handoff).
|
|
86
|
+
Save the handoff while the first model can still respond. ACC preserves explicitly recorded
|
|
87
|
+
context; it cannot recover details that were never saved.
|
|
52
88
|
|
|
53
|
-
##
|
|
89
|
+
## Client support
|
|
54
90
|
|
|
55
|
-
|
|
56
|
-
|
|
91
|
+
Integrations are available for **Claude Code, Codex, Gemini CLI, Grok, and Kimi Code**. Other
|
|
92
|
+
clients can connect through [MCP](docs/MCP.md) with their own configuration and coordination
|
|
93
|
+
instructions.
|
|
57
94
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
acc install
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
The installer connects the supported clients it finds. Follow its activation instructions,
|
|
64
|
-
then restart your clients from the project directory. In Codex, check `/plugins` and
|
|
65
|
-
review the current ACC definitions in `/hooks`; changed hooks may need fresh trust.
|
|
66
|
-
[Getting started](docs/GETTING_STARTED.md) covers activation and preserved sandbox settings.
|
|
67
|
-
|
|
68
|
-
For Codex live delivery on Apple Silicon macOS, installation also configures outgoing
|
|
69
|
-
local socket access on Codex 0.153.4 or newer when using default workspace permissions.
|
|
70
|
-
Custom policies are preserved. One default-No choice covers all selected clients that need
|
|
71
|
-
live-delivery consent. On Codex 0.154.0 or newer, the choice includes downloading a missing
|
|
72
|
-
standalone package from OpenAI and starting its local service. ACC installs the matching
|
|
73
|
-
version and preserves your existing `codex` command and shell profiles. The client still owns session
|
|
74
|
-
startup, hook trust, and Claude Channels approval. Doctor reports service infrastructure,
|
|
75
|
-
session binding, and outgoing permissions separately.
|
|
76
|
-
|
|
77
|
-
Open two sessions and give them ordinary tasks, as above. Look for an agent discovering a
|
|
78
|
-
peer, checking who is changing a file, asking about a shared dependency, or replying to a
|
|
79
|
-
review request.
|
|
80
|
-
|
|
81
|
-
Run `acc doctor` from the project if a peer is missing. A directory containing ACC's own
|
|
82
|
-
state, commonly your home directory, cannot be used as a workspace; start the client in a
|
|
83
|
-
project directory. See [Troubleshooting](docs/TROUBLESHOOTING.md).
|
|
84
|
-
|
|
85
|
-
Already using ACC? Follow the [upgrade guide](docs/UPGRADING.md), including the 0.4.x →
|
|
86
|
-
0.5.0 update and the data-format boundary when moving from 0.3.1.
|
|
87
|
-
|
|
88
|
-
## When messages arrive
|
|
89
|
-
|
|
90
|
-
Messages are saved locally before delivery is attempted. A durable inbox remains
|
|
91
|
-
available when a faster route cannot be used.
|
|
92
|
-
|
|
93
|
-
| Client | How the agent receives a message |
|
|
94
|
-
|---|---|
|
|
95
|
-
| Codex CLI, Claude Code, Gemini CLI, Kimi Code | At the next normal turn on the exact verified versions and platforms; otherwise through explicit ACC inbox reads. |
|
|
96
|
-
| Grok | Through explicit ACC inbox reads, using its installed hooks and skill. CLI ownership was verified on Grok 1.0.24. |
|
|
97
|
-
| Other clients connected through [MCP](docs/MCP.md) | Through ACC tools and inbox reads. Generic MCP requires its own client configuration and coordination instructions. |
|
|
98
|
-
|
|
99
|
-
Grok's updated skill first runs public status through the terminal. The ACC hook reminder
|
|
100
|
-
after that result supplies the session's own CLI arguments for subsequent inbox reads and
|
|
101
|
-
mutations. It adds no automatic peer-message injection or idle delivery. A relocated
|
|
102
|
-
`GROK_HOME` is respected by install, doctor, and uninstall.
|
|
103
|
-
|
|
104
|
-
**Optional live delivery can start a turn in an idle Codex or Claude Code session.** It is
|
|
105
|
-
experimental, off by default, and can spend model tokens. On Apple Silicon Macs, Codex
|
|
106
|
-
0.152.1 or newer requires LocalDaemon infrastructure and a verified session;
|
|
107
|
-
Claude Code 2.1.258 or newer requires zsh and client-side Channels activation; check its
|
|
108
|
-
startup notice for ACC and accept the development warning when shown. An MCP connection
|
|
109
|
-
alone does not verify inbound delivery. Messages arriving mid-turn wait for the turn to
|
|
110
|
-
finish. The receiving session's
|
|
111
|
-
opt-in policy and current reachability determine whether delivery can proceed.
|
|
112
|
-
`acc install` reports each client's delivery state and can save Codex consent before its
|
|
113
|
-
service is available. Use `--delivery actionable|all` for explicit automation and
|
|
114
|
-
`--delivery off` to disable incoming automatic requests. `acc doctor` also names each session’s last native binding result,
|
|
115
|
-
including missing launch consent, an unidentified client process or a failed handshake.
|
|
116
|
-
It distinguishes a disabled policy from an unavailable service or a missing live channel
|
|
117
|
-
in the current project.
|
|
118
|
-
|
|
119
|
-
A Codex thread retained by LocalDaemon can receive opted-in messages after its terminal
|
|
120
|
-
exits. Turning ACC delivery off prevents new native offers; already accepted queue entries
|
|
121
|
-
remain with the client. [Compatibility and delivery controls](docs/CAPABILITIES.md) describe
|
|
122
|
-
the exact evidence, versions, platforms, and fallback paths.
|
|
123
|
-
|
|
124
|
-
A recorded message is send success. An offer is not proof of reading, and an
|
|
125
|
-
acknowledgement or reply is not proof that the requested work is complete.
|
|
126
|
-
|
|
127
|
-
## Keep the workflow you like
|
|
128
|
-
|
|
129
|
-
- **Your usual tools.** Start clients with their normal commands. You choose each agent's
|
|
130
|
-
task, model, and permissions.
|
|
131
|
-
- **Separate checkouts, one project.** Git worktrees share an ACC workspace. Plain folders
|
|
132
|
-
work too; optional workspace configuration can supply a shared identity and roots.
|
|
133
|
-
- **Agree before editing.** Agents can claim files and identify overlapping work. CLI claims
|
|
134
|
-
default to advisory. Guarded claims require certified guards from every live participant.
|
|
135
|
-
[How claims work](docs/CONCEPTS.md#intent-is-awareness-a-claim-commits).
|
|
136
|
-
- **Focused context and durable history.** Normal turn context is bounded. Inbox and history
|
|
137
|
-
return summary pages, with message bodies fetched by id. Agents can supersede or withdraw
|
|
138
|
-
old decisions and recover prior handoffs when needed.
|
|
139
|
-
- **Local coordination.** State lives in app data outside your project. ACC never collects
|
|
140
|
-
or shares raw transcripts; peer messages are untrusted input. Your clients keep using
|
|
141
|
-
their usual model providers.
|
|
142
|
-
|
|
143
|
-
One npm package. ACC needs no separate account, model API key, or hosted service.
|
|
144
|
-
|
|
145
|
-
## Update or remove ACC
|
|
146
|
-
|
|
147
|
-
Initial installation enables automatic updates. ACC downloads stable releases in the
|
|
148
|
-
background, then switches the runtime and refreshes integrations once nothing blocks. A
|
|
149
|
-
live client or ACC process blocks only while the store contract it declares differs from
|
|
150
|
-
the incoming version's or is unknown; one declaring a matching contract keeps running
|
|
151
|
-
through the switch. When a verified Codex service needs a restart,
|
|
152
|
-
`acc update` asks once, then completes maintenance in a separate process. Open clients
|
|
153
|
-
disconnect; `acc doctor` reports progress and the result. See [update and recovery details](docs/UPGRADING.md#confirmed-client-service-maintenance).
|
|
154
|
-
Restart or resume clients afterward and complete any requested hook or plugin trust review.
|
|
155
|
-
|
|
156
|
-
For an immediate update:
|
|
95
|
+
Automatic delivery depends on the client version and platform. Verified integrations can
|
|
96
|
+
provide messages at the next normal turn; other sessions read their ACC inbox explicitly.
|
|
157
97
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
98
|
+
Experimental live delivery can wake eligible Claude Code and Codex sessions on Apple Silicon
|
|
99
|
+
macOS. It requires opt-in and an active verified connection, is off by default, and can spend
|
|
100
|
+
model tokens. Messages for busy sessions queue until the current turn ends.
|
|
161
101
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
`acc update --auto on` once: that version's uninstall record lost the previous preference.
|
|
102
|
+
See [client capabilities](docs/CAPABILITIES.md) for exact support. Run `acc doctor` from your
|
|
103
|
+
project if a peer is missing or delivery differs from what you expect; see
|
|
104
|
+
[troubleshooting](docs/TROUBLESHOOTING.md). Agents decide when to coordinate; ACC does not
|
|
105
|
+
guarantee they will notice every dependency.
|
|
167
106
|
|
|
168
|
-
|
|
107
|
+
## Local and independent
|
|
169
108
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
109
|
+
Sessions share coordination within the same ACC workspace. Git is optional; worktrees of one
|
|
110
|
+
repository share that workspace while keeping separate files. Messages and handoffs are stored
|
|
111
|
+
in local app data outside your project. ACC never collects or shares raw session transcripts.
|
|
173
112
|
|
|
174
|
-
ACC
|
|
175
|
-
|
|
176
|
-
preference.
|
|
113
|
+
ACC needs no separate account, model API key, or hosted service. Your coding clients keep using
|
|
114
|
+
their existing provider access.
|
|
177
115
|
|
|
178
|
-
|
|
116
|
+
Automatic updates are enabled on first install. Use `acc update --auto off` to disable them,
|
|
117
|
+
`acc update` to update manually, and `acc uninstall` to remove integrations. See
|
|
118
|
+
[update controls](docs/UPGRADING.md) for details.
|
|
179
119
|
|
|
180
|
-
|
|
181
|
-
[
|
|
182
|
-
[Security](docs/SECURITY_MODEL.md)
|
|
120
|
+
MIT-licensed and permanently noncommercial. Try it on one real task and
|
|
121
|
+
[tell us where you still had to carry messages yourself](https://github.com/automatis-tools/agents-can-communicate/issues).
|
|
183
122
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
and the [adapter guide](docs/ADAPTER_AUTHORING.md).
|
|
123
|
+
[Documentation](docs/index.md) ·
|
|
124
|
+
[Contributing](https://github.com/automatis-tools/agents-can-communicate/blob/main/AGENTS.md)
|
|
@@ -25,6 +25,7 @@ import { createAccChannel, endpointDir, routeAck, routeReply }
|
|
|
25
25
|
from "@agents-can-communicate/adapter-claude-code/channel";
|
|
26
26
|
|
|
27
27
|
import { pump, startInertChannel } from "./claude-channel-stdio.mjs";
|
|
28
|
+
import { activateClaudeChannel } from "./claude-channel-binding.mjs";
|
|
28
29
|
|
|
29
30
|
const clock = { now: () => new Date().toISOString() };
|
|
30
31
|
const ids = { next: kind => createId(kind, randomBytes) };
|
|
@@ -70,7 +71,8 @@ export async function resolveSession({ runtimeDir, service, env, ownClientPid,
|
|
|
70
71
|
const matched = mine.filter(binding => exported.has(binding.harnessSessionId));
|
|
71
72
|
const chosen = mine.length === 1 ? mine[0] : matched.length === 1 ? matched[0] : null;
|
|
72
73
|
return chosen === null ? null
|
|
73
|
-
: { sessionId: chosen.accSessionId, generation: chosen.generation, clientPid: chosen.clientPid
|
|
74
|
+
: { sessionId: chosen.accSessionId, generation: chosen.generation, clientPid: chosen.clientPid,
|
|
75
|
+
harnessSessionId: chosen.harnessSessionId };
|
|
74
76
|
}
|
|
75
77
|
|
|
76
78
|
/** The client process this Channel was spawned by, or null when nobody knows. */
|
|
@@ -151,6 +153,11 @@ async function compose() {
|
|
|
151
153
|
});
|
|
152
154
|
await channel.listen();
|
|
153
155
|
pump(channel.handleLine, () => { channel.close(); process.exit(0); });
|
|
156
|
+
// Serve MCP immediately; a slow or failed ACC binding must not stop the
|
|
157
|
+
// client connecting. The listening endpoint lets an in-flight hook finish
|
|
158
|
+
// before this owner acquires the same lifecycle lock and completes startup.
|
|
159
|
+
await activateClaudeChannel({ session, service, runtimeDir: paths.root, dataHome,
|
|
160
|
+
env: process.env }).catch(() => {});
|
|
154
161
|
return channel;
|
|
155
162
|
}
|
|
156
163
|
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { createClaudeCodeAdapter } from "@agents-can-communicate/adapter-claude-code";
|
|
2
|
+
import { loadSessionBinding, storeNativeAttempt } from "@agents-can-communicate/adapter-sdk";
|
|
3
|
+
import { createCoordinationService } from "@agents-can-communicate/core";
|
|
4
|
+
import { establishNativeBinding, livePolicyFrom } from "@agents-can-communicate/hook-runner/native-binding";
|
|
5
|
+
import { withSessionLifecycle } from "@agents-can-communicate/hook-runner/session-lifecycle";
|
|
6
|
+
import { readInstalledLivePolicy } from "@agents-can-communicate/installer";
|
|
7
|
+
import { openFilesystemStore } from "@agents-can-communicate/storage-filesystem";
|
|
8
|
+
|
|
9
|
+
// SessionStart cannot wait for MCP indefinitely. The endpoint's owner completes
|
|
10
|
+
// the same handshake when it starts later, without a prompt or an LLM turn.
|
|
11
|
+
// Serialize with the hooks, then reread ownership: a queued startup must never
|
|
12
|
+
// publish for a replaced/closed session or undo SessionEnd's retirement.
|
|
13
|
+
export async function activateClaudeChannel({ session, service, runtimeDir, dataHome, env,
|
|
14
|
+
deadlineAt = Date.now() + 5_000 }) {
|
|
15
|
+
if (typeof session.harnessSessionId !== "string") return null;
|
|
16
|
+
return withSessionLifecycle({ root: runtimeDir, sessionId: session.harnessSessionId,
|
|
17
|
+
clock: service.clock, deadlineAt }, async () => {
|
|
18
|
+
// A prior hook can die after committing its journal. Recover that close
|
|
19
|
+
// before reading ownership, just as the hook runner does under this lock.
|
|
20
|
+
const { clock, ids } = service;
|
|
21
|
+
const store = await openFilesystemStore({ root: runtimeDir, clock, ids,
|
|
22
|
+
workspaceId: service.store.workspaceId, deadlineAt });
|
|
23
|
+
service = createCoordinationService({ store, clock, ids });
|
|
24
|
+
const current = await loadSessionBinding({ runtimeDir,
|
|
25
|
+
harnessSessionId: session.harnessSessionId });
|
|
26
|
+
if (current?.accSessionId !== session.sessionId || current.generation !== session.generation
|
|
27
|
+
|| current.clientPid !== session.clientPid) return null;
|
|
28
|
+
const located = await service.locateSession(session.sessionId);
|
|
29
|
+
if (located?.record.state !== "open" || located.record.generation !== session.generation) return null;
|
|
30
|
+
const policy = livePolicyFrom(env);
|
|
31
|
+
if (policy === "off" || await readInstalledLivePolicy({ dataHome,
|
|
32
|
+
adapterId: "claude_code" }) === "off") return null;
|
|
33
|
+
if (Date.now() >= deadlineAt) return null;
|
|
34
|
+
const result = await establishNativeBinding({ adapter: createClaudeCodeAdapter(),
|
|
35
|
+
event: { kind: "channelReady", sessionId: session.harnessSessionId },
|
|
36
|
+
hookBinding: current, clientVersion: current.clientVersion, platform: current.platform,
|
|
37
|
+
livePolicy: policy, service, runtimeDir, clock: service.clock, env,
|
|
38
|
+
timeoutMs: Math.max(1, Math.min(750, deadlineAt - Date.now())) });
|
|
39
|
+
await storeNativeAttempt({ runtimeDir, harnessSessionId: session.harnessSessionId,
|
|
40
|
+
accSessionId: session.sessionId, generation: session.generation, deadlineAt,
|
|
41
|
+
nativeAttempt: { at: service.clock.now(), event: "channelReady", state: result.state,
|
|
42
|
+
reasonCode: result.reasonCode, policy, policySource: "bootstrap-environment",
|
|
43
|
+
policyStatus: "enabled", clientProcess: "identified" } });
|
|
44
|
+
return result;
|
|
45
|
+
});
|
|
46
|
+
}
|
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -78,6 +78,13 @@ or projected into agent context; session restart replaces it and SessionEnd atte
|
|
|
78
78
|
cleanup. Doctor ignores closed or superseded generations even if cleanup could not finish. Diagnostic disk I/O runs in an
|
|
79
79
|
unreferenced worker, so a stalled write cannot hold the hook process open.
|
|
80
80
|
|
|
81
|
+
Claude's MCP process can become ready after the bounded SessionStart handshake
|
|
82
|
+
has ended. Once its endpoint listens, the Channel completes the same validated
|
|
83
|
+
binding without a user prompt. It acquires the session lifecycle lock, recovers
|
|
84
|
+
any committed journal, and rechecks its exact owner and current consent before
|
|
85
|
+
publication. The optional diagnostic records `channelReady`; MCP remains responsive
|
|
86
|
+
if registration fails. This does not create a session or revive a closed one.
|
|
87
|
+
|
|
81
88
|
## Certified capability versus current reachability
|
|
82
89
|
|
|
83
90
|
Ordinary hook capabilities say an exact client version on an exact platform passed a
|
|
@@ -11,7 +11,7 @@ import { NATIVE_REASON_CODES, TIMESTAMP } from "./native-vocabulary.mjs";
|
|
|
11
11
|
export function nativeAttemptFrom(value) {
|
|
12
12
|
if (!value || typeof value.at !== "string" || !TIMESTAMP.test(value.at)
|
|
13
13
|
|| !Number.isFinite(Date.parse(value.at))
|
|
14
|
-
|| !["sessionStart", "beforeTurn"].includes(value.event)
|
|
14
|
+
|| !["sessionStart", "beforeTurn", "channelReady"].includes(value.event)
|
|
15
15
|
|| !["active", "off", "degraded", "unsupported"].includes(value.state)
|
|
16
16
|
|| !(value.reasonCode === null || NATIVE_REASON_CODES.includes(value.reasonCode))
|
|
17
17
|
|| !["off", "actionable", "all"].includes(value.policy)
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agents-can-communicate/hook-runner",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.8",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": "./src/runner.mjs",
|
|
8
8
|
"./client-pid": "./src/client-pid.mjs",
|
|
9
|
-
"./process-table": "./src/process-table.mjs"
|
|
9
|
+
"./process-table": "./src/process-table.mjs",
|
|
10
|
+
"./native-binding": "./src/native-binding.mjs",
|
|
11
|
+
"./session-lifecycle": "./src/session-lifecycle.mjs"
|
|
10
12
|
},
|
|
11
13
|
"files": [
|
|
12
14
|
"src/"
|