agents-can-communicate 0.4.2 → 0.4.4

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 (67) hide show
  1. package/README.md +12 -4
  2. package/bin/acc-maintenance-worker.mjs +6 -0
  3. package/docs/ARCHITECTURE.md +12 -5
  4. package/docs/CLI.md +13 -6
  5. package/docs/CONCEPTS.md +2 -1
  6. package/docs/CONFIGURATION.md +27 -1
  7. package/docs/GETTING_STARTED.md +10 -4
  8. package/docs/HOW_IT_WORKS.md +2 -1
  9. package/docs/PROTOCOL.md +4 -0
  10. package/docs/RELEASING.md +1 -1
  11. package/docs/SECURITY_MODEL.md +19 -5
  12. package/docs/TROUBLESHOOTING.md +22 -4
  13. package/docs/UPGRADING.md +60 -14
  14. package/docs/WHY_ACC.md +1 -1
  15. package/node_modules/@agents-can-communicate/adapter-claude-code/package.json +1 -1
  16. package/node_modules/@agents-can-communicate/adapter-claude-code/src/channel.mjs +2 -4
  17. package/node_modules/@agents-can-communicate/adapter-claude-code/src/native-delivery.mjs +3 -1
  18. package/node_modules/@agents-can-communicate/adapter-codex/package.json +1 -1
  19. package/node_modules/@agents-can-communicate/adapter-codex/src/adapter.mjs +6 -2
  20. package/node_modules/@agents-can-communicate/adapter-codex/src/config-block.mjs +4 -88
  21. package/node_modules/@agents-can-communicate/adapter-codex/src/install.mjs +36 -15
  22. package/node_modules/@agents-can-communicate/adapter-codex/src/live-permissions.mjs +110 -0
  23. package/node_modules/@agents-can-communicate/adapter-codex/src/maintenance-host.mjs +120 -0
  24. package/node_modules/@agents-can-communicate/adapter-codex/src/maintenance-threads.mjs +49 -0
  25. package/node_modules/@agents-can-communicate/adapter-codex/src/maintenance.mjs +108 -0
  26. package/node_modules/@agents-can-communicate/adapter-codex/src/native-delivery.mjs +1 -0
  27. package/node_modules/@agents-can-communicate/adapter-codex/src/permission-ownership.mjs +109 -0
  28. package/node_modules/@agents-can-communicate/adapter-codex/src/toml-scan.mjs +99 -0
  29. package/node_modules/@agents-can-communicate/adapter-gemini-cli/extension/gemini-extension.json +1 -1
  30. package/node_modules/@agents-can-communicate/adapter-gemini-cli/package.json +1 -1
  31. package/node_modules/@agents-can-communicate/adapter-grok/package.json +1 -1
  32. package/node_modules/@agents-can-communicate/adapter-kimi/package.json +1 -1
  33. package/node_modules/@agents-can-communicate/adapter-sdk/package.json +1 -1
  34. package/node_modules/@agents-can-communicate/adapter-sdk/src/channel-directory.mjs +8 -0
  35. package/node_modules/@agents-can-communicate/adapter-sdk/src/index.mjs +1 -0
  36. package/node_modules/@agents-can-communicate/cli/package.json +1 -1
  37. package/node_modules/@agents-can-communicate/cli/src/args.mjs +1 -1
  38. package/node_modules/@agents-can-communicate/cli/src/doctor-command.mjs +5 -4
  39. package/node_modules/@agents-can-communicate/cli/src/help.mjs +2 -0
  40. package/node_modules/@agents-can-communicate/cli/src/install-command.mjs +3 -0
  41. package/node_modules/@agents-can-communicate/cli/src/main.mjs +8 -4
  42. package/node_modules/@agents-can-communicate/cli/src/managed-runtime/activation.mjs +45 -7
  43. package/node_modules/@agents-can-communicate/cli/src/managed-runtime/command.mjs +15 -0
  44. package/node_modules/@agents-can-communicate/cli/src/managed-runtime/diagnostics.mjs +35 -0
  45. package/node_modules/@agents-can-communicate/cli/src/managed-runtime/entry.mjs +40 -8
  46. package/node_modules/@agents-can-communicate/cli/src/managed-runtime/legacy-maintenance.mjs +47 -0
  47. package/node_modules/@agents-can-communicate/cli/src/managed-runtime/maintenance-state.mjs +57 -0
  48. package/node_modules/@agents-can-communicate/cli/src/managed-runtime/maintenance-worker.mjs +110 -0
  49. package/node_modules/@agents-can-communicate/cli/src/managed-runtime/maintenance.mjs +92 -0
  50. package/node_modules/@agents-can-communicate/cli/src/managed-runtime/management-recovery.mjs +71 -0
  51. package/node_modules/@agents-can-communicate/cli/src/managed-runtime/refresh.mjs +6 -7
  52. package/node_modules/@agents-can-communicate/cli/src/managed-runtime/schedule.mjs +4 -2
  53. package/node_modules/@agents-can-communicate/cli/src/managed-runtime/worker.mjs +16 -4
  54. package/node_modules/@agents-can-communicate/cli/src/native-delivery-status.mjs +1 -1
  55. package/node_modules/@agents-can-communicate/core/package.json +1 -1
  56. package/node_modules/@agents-can-communicate/core/src/receipts.mjs +1 -0
  57. package/node_modules/@agents-can-communicate/delivery-router/package.json +1 -1
  58. package/node_modules/@agents-can-communicate/delivery-router/src/router.mjs +1 -1
  59. package/node_modules/@agents-can-communicate/hook-runner/package.json +1 -1
  60. package/node_modules/@agents-can-communicate/installer/package.json +1 -1
  61. package/node_modules/@agents-can-communicate/installer/src/apply.mjs +4 -2
  62. package/node_modules/@agents-can-communicate/installer/src/detect.mjs +5 -2
  63. package/node_modules/@agents-can-communicate/installer/src/plan.mjs +15 -3
  64. package/node_modules/@agents-can-communicate/mcp-server/package.json +1 -1
  65. package/node_modules/@agents-can-communicate/protocol/package.json +1 -1
  66. package/node_modules/@agents-can-communicate/storage-filesystem/package.json +1 -1
  67. package/package.json +2 -1
package/README.md CHANGED
@@ -65,6 +65,12 @@ then restart your clients from the project directory. In Codex, check `/plugins`
65
65
  review the current ACC definitions in `/hooks`; changed hooks may need fresh trust.
66
66
  [Getting started](docs/GETTING_STARTED.md) covers activation and preserved sandbox settings.
67
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. If its local service is missing, doctor gives the command
71
+ `codex app-server daemon start`; then open a new Codex session. Doctor reports receiving
72
+ channel state and outgoing permission configuration separately.
73
+
68
74
  Open two sessions and give them ordinary tasks, as above. Look for an agent discovering a
69
75
  peer, checking who is changing a file, asking about a shared dependency, or replying to a
70
76
  review request.
@@ -73,8 +79,8 @@ Run `acc doctor` from the project if a peer is missing. A directory containing A
73
79
  state, commonly your home directory, cannot be used as a workspace; start the client in a
74
80
  project directory. See [Troubleshooting](docs/TROUBLESHOOTING.md).
75
81
 
76
- Already using ACC? Follow the [upgrade guide](docs/UPGRADING.md), including the 0.4.0/0.4.1 →
77
- 0.4.2 update and the data-format boundary when moving from 0.3.1.
82
+ Already using ACC? Follow the [upgrade guide](docs/UPGRADING.md), including the 0.4.x →
83
+ 0.4.4 update and the data-format boundary when moving from 0.3.1.
78
84
 
79
85
  ## When messages arrive
80
86
 
@@ -136,8 +142,10 @@ One npm package. ACC needs no separate account, model API key, or hosted service
136
142
 
137
143
  Initial installation enables automatic updates. ACC downloads stable releases in the
138
144
  background and waits for active clients and ACC processes to exit before switching the
139
- runtime and refreshing integrations. Restart clients afterward and complete any requested
140
- hook or plugin trust review.
145
+ runtime and refreshing integrations. When a verified Codex service needs a restart,
146
+ `acc update` asks once, then completes maintenance in a separate process. Open clients
147
+ disconnect; `acc doctor` reports progress and the result. See [update and recovery details](docs/UPGRADING.md#confirmed-client-service-maintenance).
148
+ Restart or resume clients afterward and complete any requested hook or plugin trust review.
141
149
 
142
150
  For an immediate update:
143
151
 
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ import { runMaintenance } from "../node_modules/@agents-can-communicate/cli/src/managed-runtime/maintenance-worker.mjs";
3
+
4
+ // This private entry has no workspace admission/lease and no inherited stdio.
5
+ // Durable checkpoints remain available to the next acc update after a crash.
6
+ await runMaintenance(process.argv[2], { jobId: process.argv[3] }).catch(() => { process.exitCode = 1; });
@@ -15,8 +15,10 @@ flowchart LR
15
15
  T -->|reply or acknowledge| C
16
16
  ```
17
17
 
18
- ACC never starts, resumes, interrupts, supervises, or terminates the target client. A
19
- transport that requires owning that lifecycle is outside the product boundary.
18
+ Message delivery never starts, resumes, interrupts, supervises, or terminates the target
19
+ client. A transport that requires owning that lifecycle is outside the product boundary.
20
+ Separately, explicit update maintenance can restart a verified client service after the
21
+ user confirms the disconnection; it does not launch or assign agent tasks.
20
22
 
21
23
  ## Packages and dependency direction
22
24
 
@@ -90,8 +92,8 @@ turn.
90
92
  Claude Code Channel has installed-client evidence on 2.1.258 and 2.1.260; Codex
91
93
  LocalDaemon has it on 0.152.1 and 0.153.4. Both use a captured platform minimum,
92
94
  current probe and exact session handshake. Codex preserves the ordinary client
93
- launch and verifies its registered thread and workspace; ACC owns no vendor daemon
94
- lifecycle. Gemini CLI and Kimi Code have exact-version next-turn evidence only;
95
+ launch and verifies its registered thread and workspace; native delivery owns no vendor
96
+ daemon lifecycle. Gemini CLI and Kimi Code have exact-version next-turn evidence only;
95
97
  Grok and generic MCP use inbox polling.
96
98
 
97
99
  ## Storage and workspace identity
@@ -184,7 +186,12 @@ remains fenced and repairs forward, with the old active pointer retained but nor
184
186
  workspace admission unavailable until recovery completes. Native bindings cease holding
185
187
  after observed SessionEnd cleanup or confirmed process death; the vendor daemon may remain
186
188
  running. Unknown PIDs remain holds until lifecycle cleanup. Presence TTL, `acc finish`,
187
- and delivery off alone do not prove native lifecycle end. ACC never manages the daemon.
189
+ and delivery off alone do not prove native lifecycle end. Normal background updates never
190
+ restart a vendor daemon. An explicitly approved maintenance job can do so through the
191
+ adapter lifecycle port: it waits for idle work, validates exact process identity, stops
192
+ the service under the admission fence, refreshes integrations, and restores and verifies
193
+ the service even after a refresh failure. Checkpoints and the detached worker live outside
194
+ repositories. Approved crash recovery never blindly repeats a stop.
188
195
 
189
196
  Lock ownership never expires by age. Retained nonempty tombstones prevent delayed observers
190
197
  from reclaiming a successor. Under an acquired lock, maintenance removes historical
package/docs/CLI.md CHANGED
@@ -232,7 +232,7 @@ external AI client. An addressed handoff requires acknowledgement; a room handof
232
232
  | `acc doctor` | `--home`, `--repair` |
233
233
  | `acc config init` | `--yes`, `--force` |
234
234
  | `acc config validate` | — |
235
- | `acc update` | `--check`, `--auto on\|off`, `--pin VERSION\|none`, `--apply` (alias) |
235
+ | `acc update` | `--check`, `--auto on\|off`, `--pin VERSION\|none`, `--yes`, `--apply` (alias) |
236
236
  | `acc help` | — |
237
237
  | `acc version` | — |
238
238
 
@@ -248,8 +248,8 @@ effective policy off and prints the reason. Claude Code shell activation writes
248
248
  zsh PATH block and a shim that `exec`s the real client; `ACC_BYPASS=1` bypasses that
249
249
  activation. Codex LocalDaemon delivery uses recorded installation consent without changing
250
250
  ordinary launch arguments. Its opt-in remains active when shim variables are absent or
251
- bypassed; `acc install --adapter codex --delivery off` disables new native offers. ACC never
252
- starts or stops the vendor daemon. The install summary names each client's requested policy,
251
+ bypassed; `acc install --adapter codex --delivery off` disables new native offers. Installation
252
+ and message delivery do not start or stop the vendor daemon. The install summary names each client's requested policy,
253
253
  activation state and verified fallback. `doctor` separates protocol readiness, recorded
254
254
  consent and a live channel in the current workspace, with a next step for missing activation.
255
255
  A supported version or an installed plugin alone is not an active delivery channel.
@@ -281,8 +281,13 @@ holds. `finish`, presence TTL, and delivery off are not observed native end. Hoo
281
281
  wait for network work. `ACC_NO_UPDATE_CHECK=1` disables update networking and background
282
282
  scheduling.
283
283
 
284
- `acc update` requests the update immediately; it reports a pending update when a running or
285
- unidentified client prevents activation. `--check` only checks and cannot be combined with
284
+ `acc update` requests the update immediately. If a verified Codex service blocks activation
285
+ or runs an older version than the installed CLI, it asks once to restart that service.
286
+ After confirmation, a detached worker waits for idle work and other ACC processes, refreshes
287
+ integrations, restarts the service and verifies the result. Open clients disconnect; use
288
+ `acc doctor` for progress and resume the clients afterward. `--yes` supplies explicit
289
+ noninteractive restart consent. Without consent, or with unknown ownership, the update
290
+ remains pending. See [maintenance limits and recovery](UPGRADING.md#confirmed-client-service-maintenance). `--check` only checks and cannot be combined with
286
291
  settings changes. `--auto off` disables background updates, and `--auto on` enables them.
287
292
  `--pin 0.4.0` holds an exact stable version; `--pin none` follows stable releases. A pin
288
293
  cannot downgrade the active runtime. The old `--apply` flag remains accepted.
@@ -290,7 +295,9 @@ cannot downgrade the active runtime. The old `--apply` flag remains accepted.
290
295
  Failed downloads keep the working runtime. A failed integration refresh exits with code
291
296
  `4`, names the failed adapter and configuration error, and keeps workspace admission closed.
292
297
  Fix the reported configuration problem, then run `acc update` to finish it. `acc doctor`
293
- reports the update policy and pending notice. Native clients may still require hook trust
298
+ reports the update policy and pending notice. During blocked activation, a current launcher
299
+ returns `scope: update` and `workspaceInspection: unavailable_during_update` without opening
300
+ workspace state; `doctor --repair` remains blocked. Native clients may still require hook trust
294
301
  or activation review. See [Upgrading](UPGRADING.md) for the initial 0.3.1 transition and
295
302
  recovery details.
296
303
 
package/docs/CONCEPTS.md CHANGED
@@ -14,7 +14,8 @@ settings, clients, and checkouts. Neither is automatically in charge. Claude can
14
14
  for the endpoint shape; Codex can answer or decline under its own instructions.
15
15
 
16
16
  This resembles coordination among subagents, but the sessions were opened independently by
17
- the user. ACC never launches, assigns, supervises, or closes them.
17
+ the user. ACC does not launch, assign or supervise their work. Separately, an explicit
18
+ update can ask to restart a client service; this disconnects clients and requires user consent.
18
19
 
19
20
  ## Workspace, participant, and session
20
21
 
@@ -139,11 +139,37 @@ reports degraded reachability; it does not rewrite the installed consent.
139
139
 
140
140
  Codex LocalDaemon delivery separately requires macOS arm64, Codex 0.152.1 or newer, a
141
141
  current feature probe, and exact thread, canonical cwd, process, version and protocol
142
- checks. Its daemon must already be running; ACC never starts or stops it. Codex reads
142
+ checks. Its daemon must already be running; installation and delivery do not start or stop it.
143
+ Explicit update maintenance can restart a verified service after separate confirmation. Codex reads
143
144
  consent from the installation record, not a shell-shim variable. Unavailable or ineligible
144
145
  sessions retain durable inbox fallback. Use `acc install --adapter codex --delivery off`
145
146
  to stop new native offers; bypassing a shim does not disable that recorded opt-in.
146
147
 
148
+ ### Codex outgoing permissions
149
+
150
+ Receiving a native message and sending from the agent's sandbox are separate operations.
151
+ On Codex 0.153.4 or newer on macOS arm64, live opt-in also configures outgoing access
152
+ for default workspace permissions. This happens even when the daemon is not yet available.
153
+ Installation, its preview, and the interactive consent question disclose this change.
154
+
155
+ ACC selects a permission profile named `acc-workspace`, extending `:workspace`. It grants
156
+ write access to the ACC state directory and allows only the local ACC channel directory
157
+ (`/tmp/acc-ch-<uid>`) and the Codex home control socket. The profile enables networking
158
+ through `features.network_proxy = true`, with no external domains allowed. The proxy and
159
+ socket grants must stay together: enabling networking without the proxy changes its scope.
160
+
161
+ An existing legacy workspace-write configuration is migrated only when its sole writable
162
+ root is ACC's state directory. Custom permission/configuration profiles, additional roots,
163
+ inline settings and uncaptured clients are preserved and reported as unverified. ACC does
164
+ not merge arbitrary security policies or verify overrides in an already running session.
165
+ For a custom policy, grant the same state and socket access through the proxy in the
166
+ client's effective workspace profile; do not combine it with legacy sandbox settings.
167
+
168
+ Restart Codex after changing permissions. Explicit delivery `off` or uninstall restores
169
+ the previous configuration only while every generated permission component is unchanged.
170
+ If any component was edited or another setting depends on it, ACC preserves the entire
171
+ bundle and reports it for review. Plugin registration can still be removed independently.
172
+
147
173
  ## Override local paths and identity
148
174
 
149
175
  Nothing in `acc.workspace.json` says where state is stored, and nothing there can — that is
@@ -15,7 +15,7 @@ pair or session-bound ACC MCP tools. See [CLI ownership](CLI.md#coordinate-from-
15
15
 
16
16
  ACC requires macOS or Linux and Node.js 24 or newer.
17
17
 
18
- Already using ACC? Follow the [upgrade guide](UPGRADING.md) for the 0.4.0/0.4.1 → 0.4.2
18
+ Already using ACC? Follow the [upgrade guide](UPGRADING.md) for the 0.4.x → 0.4.4
19
19
  update or the data-format boundary when upgrading from 0.3.1.
20
20
 
21
21
  ```bash
@@ -30,7 +30,9 @@ acc install
30
30
  Initial installation also enables automatic updates; reinstalling keeps an explicit opt-out.
31
31
  ACC downloads releases in the background and
32
32
  refreshes its runtime and skills when active clients have left. Use `acc update` for an
33
- immediate update, or `acc update --auto off` to disable background updates. See
33
+ immediate update; an eligible Codex service restart asks for one confirmation. ACC then
34
+ handles maintenance and reports progress in `acc doctor`; clients disconnect and can be
35
+ resumed afterward. Use `acc update --auto off` to disable background updates. See
34
36
  [update controls](UPGRADING.md#automatic-updates-after-installation).
35
37
 
36
38
  The installer connects only the supported clients it finds. Open a new terminal and
@@ -39,8 +41,12 @@ printed by the installer. In Codex, use `/plugins` to check ACC is enabled, then
39
41
  to review each ACC hook and enable/trust its current definition if needed. Restart the
40
42
  session after that review; changed hook definitions may require trust again.
41
43
 
42
- If the installer preserved your existing Codex sandbox settings, verify the named ACC
43
- state directory is in `sandbox_workspace_write.writable_roots` in the config it identifies.
44
+ For Codex live delivery, follow the outgoing-permission and local-service instructions
45
+ from install/doctor, then start a new session. Default workspace permissions can be
46
+ configured automatically on Codex 0.153.4 or newer on macOS arm64. Custom settings are
47
+ preserved; see [outgoing permissions](CONFIGURATION.md#codex-outgoing-permissions).
48
+ With legacy sandbox settings, the named ACC state directory must also be in
49
+ `sandbox_workspace_write.writable_roots` in the config the installer identifies.
44
50
  ACC keeps those user settings unchanged. Installed files alone do not establish that hooks
45
51
  are active; `acc doctor` leaves current readiness unverified and directs you to Codex.
46
52
 
@@ -112,7 +112,8 @@ All recipients have the same durable record, but adapters expose different accel
112
112
  to an independently opened thread. It is experimental, off by default, and can
113
113
  spend tokens. Messages wait for a running turn to finish; a daemon-retained
114
114
  thread can receive them after its terminal exits. ACC adds no launch arguments
115
- and does not manage the vendor daemon.
115
+ and does not manage the vendor daemon during message delivery. Separately,
116
+ [confirmed update maintenance](UPGRADING.md#confirmed-client-service-maintenance) can restart it.
116
117
 
117
118
  Grok, generic MCP, unsupported versions and uncaptured platforms use inbox polling.
118
119
  [Capabilities](CAPABILITIES.md) lists evidence and fallback.
package/docs/PROTOCOL.md CHANGED
@@ -199,6 +199,10 @@ peer body into diagnostics.
199
199
  Receipt `offered` is committed only after the transport accepts bytes. A failed attempt
200
200
  leaves the receipt queued.
201
201
 
202
+ `transport_permission_denied` means the sender's OS or sandbox refused local transport
203
+ access (`EPERM` or `EACCES`). It is distinct from `recipient_unavailable` and remains a
204
+ failed offer with a queued receipt; raw OS error strings are not persisted.
205
+
202
206
  ## Inbox, reply, and acknowledgement
203
207
 
204
208
  Without an id, public `inbox` lists bounded summary pages for unresolved messages owned
package/docs/RELEASING.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Releasing
2
2
 
3
3
  Use this procedure to build one auditable npm artifact, verify that exact tarball, and keep
4
- its evidence tied to the commit that supplied its bytes. The package is currently `0.4.2`;
4
+ its evidence tied to the commit that supplied its bytes. The package is currently `0.4.4`;
5
5
  the commands derive the version from `package.json` so the filename cannot drift.
6
6
 
7
7
  ```mermaid
@@ -24,9 +24,10 @@ graph LR
24
24
  H["human authority"] --> C
25
25
  ```
26
26
 
27
- ACC does not read raw transcripts, relay permission approvals, or start target clients. A
28
- native delivery path may only offer an attributed peer envelope to an already-running,
29
- user-owned session.
27
+ ACC does not read raw transcripts or relay permission approvals. A native delivery path
28
+ may only offer an attributed peer envelope to an already-running, user-owned session.
29
+ Confirmed update maintenance is a separate service restart operation; a peer message or
30
+ live-delivery opt-in does not authorize it.
30
31
 
31
32
  ## Peer-content boundary
32
33
 
@@ -79,6 +80,13 @@ consent before offers. A loaded daemon thread can receive messages after its TUI
79
80
  exits. Delivery off and uninstall prevent new Codex submissions; a submission
80
81
  already accepted by the vendor queue cannot be withdrawn.
81
82
 
83
+ On captured Codex/macOS configurations, live opt-in also grants outgoing access to ACC's
84
+ state and local Unix sockets through a deny-by-default network proxy. Custom permission
85
+ policies remain user-owned. Selection, proxy and grants are restored together only while
86
+ unchanged; edited or newly referenced settings remain intact. See
87
+ [Codex outgoing permissions](CONFIGURATION.md#codex-outgoing-permissions). Configuration
88
+ readiness does not prove that an active session's overrides permit a live offer.
89
+
82
90
  ## Claims
83
91
 
84
92
  CLI claims default to advisory. Guarded enforcement must be requested explicitly and
@@ -115,8 +123,14 @@ author as a software-supply trust boundary; they do not establish that package c
115
123
 
116
124
  ACC process leases hold activation until confirmed exit. Native bindings hold until observed
117
125
  SessionEnd cleanup or confirmed process death; unknown PIDs remain conservative holds.
118
- `acc finish`, presence TTL, and delivery off do not establish native lifecycle end. ACC does
119
- not manage the vendor daemon.
126
+ `acc finish`, presence TTL, and delivery off do not establish native lifecycle end.
127
+ Normal installation and message delivery do not manage vendor services. Explicit
128
+ `acc update` maintenance requires one separate confirmation (or `--yes`) for the recorded
129
+ candidate and verified service identity. The detached worker retains that approval for
130
+ recovery, rechecks PID/start time, executable, socket, versions and idle state, and preserves
131
+ unrelated or unidentified process holds. The vendor exposes no atomic turn-drain operation:
132
+ a turn arriving between the final check and stop can be interrupted. See
133
+ [confirmed maintenance](UPGRADING.md#confirmed-client-service-maintenance).
120
134
 
121
135
  A failed download leaves the active runtime available. A partial integration refresh retains
122
136
  the old active pointer but fences normal workspace admission in `activating`; it does not
@@ -100,6 +100,20 @@ ambiguous recipients or failed identity checks retain durable inbox access.
100
100
  An interactive install can save consent in either case. ACC preserves it through a temporary
101
101
  outage and does not start the daemon for you.
102
102
 
103
+ On a supported Codex CLI, a missing daemon can be started with
104
+ `codex app-server daemon start`; open a new Codex session afterward. Doctor includes this
105
+ command when it detects the missing endpoint.
106
+
107
+ If a reply stays queued with `transport_permission_denied`, the sender's permissions
108
+ blocked local transport. This is distinct from an unavailable recipient. The message was
109
+ recorded successfully; the error does not mean it was read or acknowledged.
110
+ On Codex 0.153.4 or newer on macOS arm64, rerun `acc install --adapter codex` with existing
111
+ live consent (or add `--delivery actionable` to opt in), then start a new session.
112
+ Doctor's `outgoingDelivery` reports the installed permission configuration separately
113
+ from `nativeDelivery.runtime`: an active receiving channel does not establish outgoing
114
+ access. Custom policies and active-session overrides remain unverified; inspect the config
115
+ path doctor names and follow [outgoing permissions](CONFIGURATION.md#codex-outgoing-permissions).
116
+
103
117
  Check `acc doctor --json` and `acc status --json` while both clients are open. If policy is
104
118
  `off`, opt in with `acc install --adapter codex --delivery actionable` (or select another
105
119
  adapter). This can spend model tokens. If policy is enabled but runtime is `waiting` and
@@ -153,8 +167,9 @@ definitions need review, and a trusted hook can still be disabled.
153
167
 
154
168
  `acc doctor` reports installed files separately from hook readiness, which it leaves
155
169
  unverified. A saved trust record cannot prove current activation. If installation preserved
156
- your own sandbox configuration, doctor also names the ACC state directory whose access
157
- you should check in `sandbox_workspace_write.writable_roots`.
170
+ your own legacy sandbox configuration, doctor also names the ACC state directory whose
171
+ access you should check in `sandbox_workspace_write.writable_roots`. Live delivery requires
172
+ local socket permissions as well; a writable state directory alone is insufficient.
158
173
 
159
174
  ## Gemini does not guard a write
160
175
 
@@ -225,8 +240,11 @@ Run `acc doctor` to see the update policy and pending notice. ACC process leases
225
240
  persistent MCP servers, require confirmed process exit. Native bindings clear on observed
226
241
  SessionEnd or confirmed process death; a vendor daemon may remain alive after SessionEnd.
227
242
  Unknown PIDs remain holds until lifecycle cleanup. Close the relevant client sessions and
228
- ACC processes; `finish`, presence TTL, and delivery off do not prove native end. ACC never
229
- manages the daemon or expires safety holds merely by elapsed time.
243
+ ACC processes; `finish`, presence TTL, and delivery off do not prove native end.
244
+ `acc update` can offer a confirmed restart of an eligible Codex service. Unknown or
245
+ unrelated holds still require lifecycle cleanup or confirmed process exit; safety holds
246
+ do not expire merely by elapsed time. See
247
+ [maintenance and recovery](UPGRADING.md#confirmed-client-service-maintenance).
230
248
 
231
249
  Use `acc update` to retry a failed download or finish an interrupted integration refresh.
232
250
  A download failure keeps the working version. A partial integration refresh blocks
package/docs/UPGRADING.md CHANGED
@@ -1,13 +1,14 @@
1
- # Upgrading to 0.4.2
1
+ # Upgrading to 0.4.4
2
2
 
3
- ## From 0.4.1 or 0.4.0
3
+ ## From 0.4.3, 0.4.2, 0.4.1 or 0.4.0
4
4
 
5
- This patch keeps the existing workspace data format. It makes installation and delivery
6
- diagnostics clearer, records the last native binding attempt per session, and restores
7
- hook participation after detaching a solo session without restarting the conversation.
8
- It also includes the 0.4.1 Grok, reinstall-preference and workspace-warning fixes.
5
+ This patch keeps the existing workspace data format. It adds confirmed service maintenance
6
+ to the updater, preserves native delivery setup when readiness probes are unavailable,
7
+ and names the actual processes blocking activation. It includes the previous 0.4.x
8
+ outgoing sandbox permissions, delivery diagnostics, session recovery and integration fixes.
9
9
 
10
- Close participating clients and persistent ACC MCP processes, then run:
10
+ Run the update command; it can offer a confirmed restart for an eligible Codex service.
11
+ Other active clients and persistent ACC MCP processes still need to finish before activation:
11
12
 
12
13
  ```bash
13
14
  acc update
@@ -15,10 +16,15 @@ acc version
15
16
  acc doctor
16
17
  ```
17
18
 
18
- After publication, `acc version` should report 0.4.2. If a pin keeps an older version,
19
- select 0.4.2 or clear it first. A managed update refreshes installed integrations and
19
+ After publication, `acc version` should report 0.4.4. If a pin keeps an older version,
20
+ select 0.4.4 or clear it first. A managed update refreshes installed integrations and
20
21
  skills; use the npm instructions below for unmanaged or pre-0.4 installations. Start
21
- clients again and complete any hook/trust review they request.
22
+ clients again and complete any hook/trust review they request. With existing live consent,
23
+ Codex 0.153.4 or newer on macOS arm64 receives local socket permissions when its workspace
24
+ policy is default or contains only ACC's legacy state root. Custom policies are preserved
25
+ and reported as unverified. See [outgoing permissions](CONFIGURATION.md#codex-outgoing-permissions).
26
+ If doctor names a missing local service, run `codex app-server daemon start` before opening
27
+ the new session.
22
28
 
23
29
  Run `acc doctor` in the project after the new clients have started (or submitted a normal
24
30
  turn). Its per-session lines now explain missing launch consent, an unidentified client
@@ -31,13 +37,52 @@ Claude admitted inbound Channels messages. See [delivery troubleshooting](TROUBL
31
37
  Upgrading preserves delivery consent. If doctor reports native delivery off and you want
32
38
  automatic peer requests, use `acc install --adapter codex --delivery actionable` (or the
33
39
  relevant adapter); this can spend model tokens. Codex can save that consent before its
34
- local service/session becomes available. ACC does not start the vendor daemon, and it
40
+ local service/session becomes available. Installation does not start the vendor daemon; ACC
35
41
  keeps durable inbox access when no verified live channel is bound.
36
42
 
37
43
  In Grok, public status supplies the session's own CLI arguments through the next tool
38
44
  hook. Grok still uses explicit inbox reads; this patch adds no external wake or guards.
39
45
  Start clients in a project directory, rather than a home directory containing ACC state.
40
46
 
47
+ ## Confirmed client service maintenance
48
+
49
+ On macOS arm64, `acc update` can ask once to restart a verified Codex service that blocks
50
+ activation or runs a different version from the installed CLI. The captured maintenance
51
+ contract uses Codex CLI 0.154.0 and its `pid` backend, with compatible commands and protocol
52
+ checked again at runtime. The installed CLI and managed executable must already match;
53
+ ACC does not replace vendor binaries or install an operating-system service.
54
+
55
+ After confirmation, a detached ACC worker waits up to 15 minutes for idle Codex turns,
56
+ empty queues and other ACC processes to exit. It rechecks the approved candidate, settings,
57
+ PID/start time, executable, socket ownership and versions before stopping the service.
58
+ It refreshes integrations, starts the service again and verifies the result. If refreshing
59
+ integrations fails, it still restores the service and reports the incomplete update.
60
+ A later update worker can resume an already approved recovery without another question.
61
+ `acc doctor --json` exposes `update.maintenance`; ordinary `acc doctor` describes its state.
62
+ A current launcher can use the newer management reader while the old runtime is active.
63
+ When admission is blocked, doctor returns an update-only report without inspecting the
64
+ workspace or repairing it. Older launchers gain this reader after activation, or through
65
+ the one-time launcher bootstrap described below.
66
+
67
+ Open clients disconnect. Resume them afterward and complete any client-owned hook trust
68
+ review. Codex has no atomic idle-check-and-stop operation: a new turn arriving during the
69
+ final check can be interrupted. ACC does not promise that client UIs reconnect themselves
70
+ or that an interrupted turn continues automatically. Unknown ownership, incompatible
71
+ service layouts and unrelated active processes remain visible blockers.
72
+
73
+ For an unattended command, `acc update --yes` explicitly consents to the same restart.
74
+ `acc update --check` stays read-only. Background discovery never grants restart consent.
75
+ Changing the candidate or pin before the stop cancels that approval; idle-wait expiration
76
+ also leaves the service untouched. Delivery consent and automatic-update opt-outs survive
77
+ an update even when a native service or feature probe is temporarily unavailable.
78
+
79
+ An old installation can already be stuck with both a pre-0.4.4 pending runtime and the
80
+ old updater that waits indefinitely. That code cannot discover this fix. Bootstrap the
81
+ new launcher once with `npm install --global agents-can-communicate@0.4.4`, then run
82
+ `acc update`. The new launcher stages its verified runtime and retires only an exactly
83
+ identified obsolete ACC background updater while no integrations are being written.
84
+ This does not terminate an unrelated client or bypass its lifetime hold.
85
+
41
86
  ## From 0.3.1
42
87
 
43
88
  Upgrade all ACC installations participating in a workspace together, then restart their
@@ -59,7 +104,7 @@ restores access; deleting or editing the record is not a remedy.
59
104
  2. Install the released package, then refresh the client integrations:
60
105
 
61
106
  ```bash
62
- npm install --global agents-can-communicate@0.4.2
107
+ npm install --global agents-can-communicate@0.4.4
63
108
  acc version
64
109
  acc install
65
110
  ```
@@ -99,7 +144,8 @@ confirmed process exit. Native bindings hold until observed client SessionEnd cl
99
144
  confirmed process death; the vendor daemon can remain running after that lifecycle event.
100
145
  Unknown PIDs remain conservative holds until lifecycle cleanup. `acc finish`, presence TTL,
101
146
  and delivery off alone do not prove native end. Close the relevant client sessions and
102
- persistent ACC processes to release holds; ACC does not manage the vendor daemon.
147
+ persistent ACC processes to release holds, or accept the eligible Codex service maintenance
148
+ offer in `acc update`. Background updates never request fresh restart consent.
103
149
  Hooks never wait for a network download. If integration refresh temporarily prevents
104
150
  coordination, a hook lets the client continue; its next genuine user turn can restore a
105
151
  missing binding.
@@ -109,7 +155,7 @@ acc update # download and apply, or report what is keeping it
109
155
  acc update --check # check without installing or changing update settings
110
156
  acc update --auto off # disable background updates
111
157
  acc update --auto on # enable them again
112
- acc update --pin 0.4.2 # stay on this exact stable version
158
+ acc update --pin 0.4.4 # stay on this exact stable version
113
159
  acc update --pin none # follow stable releases again
114
160
  ```
115
161
 
package/docs/WHY_ACC.md CHANGED
@@ -46,7 +46,7 @@ actionable before two sessions collide.
46
46
  ## Choose another layer when
47
47
 
48
48
  Choose a managed runtime if you want the system to create agents, assign execution state,
49
- select models, spend token budgets, or control process lifecycle. Choose a tracker when
49
+ select models, spend token budgets, or control ongoing agent execution. Choose a tracker when
50
50
  you need organizational planning. Choose a hosted service when participants must
51
51
  coordinate across machines.
52
52
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agents-can-communicate/adapter-claude-code",
3
- "version": "0.4.2",
3
+ "version": "0.4.4",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,8 +1,8 @@
1
1
  import { randomBytes, timingSafeEqual } from "node:crypto";
2
2
  import { chmodSync, existsSync, mkdirSync, statSync, unlinkSync, writeFileSync } from "node:fs";
3
3
  import net from "node:net";
4
- import os from "node:os";
5
4
  import path from "node:path";
5
+ import { channelSocketDirectory } from "@agents-can-communicate/adapter-sdk";
6
6
 
7
7
  // The production ACC Channel: a stdio MCP server Claude Code spawns, plus a
8
8
  // session-scoped Unix endpoint the delivery router reaches. One envelope on the
@@ -39,8 +39,6 @@ const shortId = () => `endpoint_${randomBytes(16).toString("hex")}`;
39
39
  // while the registration - discoverable by the hook-resolved pid - stays under
40
40
  // the workspace. The registration records the socket's absolute path, so the
41
41
  // two are decoupled.
42
- const defaultSocketDir = () => path.join(os.tmpdir(),
43
- `acc-ch-${typeof process.getuid === "function" ? process.getuid() : "u"}`);
44
42
 
45
43
  /**
46
44
  * Compose a Channel over an endpoint directory and injected ACC callbacks.
@@ -49,7 +47,7 @@ const defaultSocketDir = () => path.join(os.tmpdir(),
49
47
  * ones backed by the real conversation service; a test supplies fakes. Neither
50
48
  * the socket path nor the nonce leaves through a return value or a log line.
51
49
  */
52
- export function createAccChannel({ endpointDir, socketDir = defaultSocketDir(), clientPid,
50
+ export function createAccChannel({ endpointDir, socketDir = channelSocketDirectory(), clientPid,
53
51
  protocolContract = PROTOCOL_CONTRACT, modes = CHANNEL_MODES, leaseMs = 60_000, routeReply,
54
52
  routeAck, refreshBinding = null, observe = () => {},
55
53
  clock = () => new Date().toISOString(), write, now = Date.now }) {
@@ -206,7 +206,9 @@ function sendEnvelope({ record, message, binding, connect, timeoutMs, rejected }
206
206
  const finish = value => { if (settled) return; settled = true; clearTimeout(timer);
207
207
  socket.destroy(); resolve(value); };
208
208
  const timer = setTimeout(() => finish(rejected("transport_error")), timeoutMs);
209
- socket.once("error", () => finish(rejected("recipient_unavailable")));
209
+ socket.once("error", error => finish(rejected(
210
+ ["EPERM", "EACCES"].includes(error.code)
211
+ ? "transport_permission_denied" : "recipient_unavailable")));
210
212
  socket.once("connect", () => {
211
213
  socket.write(`${JSON.stringify(envelope)}\n`);
212
214
  let buffer = "";
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agents-can-communicate/adapter-codex",
3
- "version": "0.4.2",
3
+ "version": "0.4.4",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": {
@@ -2,6 +2,8 @@ import { defineAdapter, projectContext, projectContextResult }
2
2
  from "@agents-can-communicate/adapter-sdk";
3
3
  import { probeNativeDelivery, planNativeActivation, bindNativeSession, refreshNativeSession, retireNativeSession, offerMessage } from "./native-delivery.mjs";
4
4
  import certification from "../certification.json" with { type: "json" };
5
+ import { createCodexMaintenance } from "./maintenance.mjs";
6
+ export { sameMaintenanceIdentity } from "./maintenance.mjs";
5
7
 
6
8
  import { PROTOCOL_CONTRACT } from "./app-server-client.mjs";
7
9
  import { allowOutcome, denyOutcome, injectOutcome, normalizeCodexHook }
@@ -16,8 +18,9 @@ export const CODEX_DELIVERY_FALLBACK = Object.freeze({
16
18
  diagnostic: "Codex native delivery requires codex-cli 0.152.1 or newer on darwin-arm64, "
17
19
  + "recorded recipient consent and a reachable LocalDaemon session with exact thread, cwd, "
18
20
  + "process, version and protocol verification. Embedded or unreachable sessions retain "
19
- + "durable messages. ACC does not start, restart or stop the vendor daemon and adds no "
20
- + "launch arguments; fallback is exact-certified next-turn delivery or acc inbox",
21
+ + "durable messages. Native delivery does not start, restart or stop the vendor daemon and adds no "
22
+ + "launch arguments; fallback is exact-certified next-turn delivery or acc inbox. "
23
+ + "Explicitly confirmed acc update maintenance has a separate daemon restart check",
21
24
  });
22
25
 
23
26
  /**
@@ -61,6 +64,7 @@ export function createCodexAdapter() {
61
64
  },
62
65
  probeNativeDelivery, planNativeActivation, bindNativeSession,
63
66
  refreshNativeSession, retireNativeSession, offerMessage,
67
+ ...createCodexMaintenance(),
64
68
  startSession: async () => ({ ok: true, changes: [], diagnostics: [] }),
65
69
  endSession: async () => ({ ok: true, changes: [], diagnostics: [] }),
66
70
  guardWrite: async () => ({ ok: true, changes: [], diagnostics: [] }),