agents-can-communicate 0.3.0 → 0.4.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 (157) hide show
  1. package/README.md +112 -91
  2. package/SECURITY.md +8 -5
  3. package/bin/acc-bootstrap.mjs +5 -54
  4. package/bin/acc-claude-channel.mjs +8 -175
  5. package/bin/acc-hook.mjs +4 -133
  6. package/bin/acc-mcp.mjs +4 -59
  7. package/bin/acc-update-worker.mjs +8 -0
  8. package/bin/acc.mjs +5 -39
  9. package/bin/entrypoints/acc-bootstrap.mjs +47 -0
  10. package/bin/entrypoints/acc-claude-channel.mjs +149 -0
  11. package/bin/entrypoints/acc-hook.mjs +58 -0
  12. package/bin/entrypoints/acc-mcp.mjs +70 -0
  13. package/bin/entrypoints/acc.mjs +51 -0
  14. package/bin/entrypoints/claude-channel-stdio.mjs +29 -0
  15. package/bin/entrypoints/hook-output.mjs +73 -0
  16. package/docs/ADAPTER_AUTHORING.md +62 -24
  17. package/docs/ARCHITECTURE.md +79 -20
  18. package/docs/CAPABILITIES.md +52 -30
  19. package/docs/CLI.md +164 -35
  20. package/docs/CONCEPTS.md +97 -93
  21. package/docs/CONFIGURATION.md +66 -45
  22. package/docs/DESIGN_DECISIONS.md +24 -15
  23. package/docs/GETTING_STARTED.md +124 -118
  24. package/docs/GLOSSARY.md +12 -6
  25. package/docs/HOW_IT_WORKS.md +136 -229
  26. package/docs/MCP.md +98 -31
  27. package/docs/PROTOCOL.md +76 -14
  28. package/docs/RELEASING.md +128 -86
  29. package/docs/SECURITY_MODEL.md +52 -15
  30. package/docs/TROUBLESHOOTING.md +88 -18
  31. package/docs/UPGRADING.md +119 -0
  32. package/docs/WHY_ACC.md +19 -16
  33. package/docs/index.md +40 -24
  34. package/node_modules/@agents-can-communicate/adapter-claude-code/package.json +1 -1
  35. package/node_modules/@agents-can-communicate/adapter-claude-code/plugin/skills/acc/SKILL.md +112 -9
  36. package/node_modules/@agents-can-communicate/adapter-claude-code/src/install.mjs +6 -6
  37. package/node_modules/@agents-can-communicate/adapter-claude-code/src/native-delivery.mjs +2 -1
  38. package/node_modules/@agents-can-communicate/adapter-codex/certification.json +38 -13
  39. package/node_modules/@agents-can-communicate/adapter-codex/fixtures/certification-provenance.json +220 -0
  40. package/node_modules/@agents-can-communicate/adapter-codex/fixtures/delivery/codex-cli-0.152.1-local-daemon-current-binding-product-evidence.json +1549 -0
  41. package/node_modules/@agents-can-communicate/adapter-codex/fixtures/delivery/codex-cli-0.152.1-local-daemon-current-binding-product.json +27 -0
  42. package/node_modules/@agents-can-communicate/adapter-codex/fixtures/delivery/codex-cli-0.152.1-local-daemon-product-evidence.json +1549 -0
  43. package/node_modules/@agents-can-communicate/adapter-codex/fixtures/delivery/codex-cli-0.152.1-local-daemon-product.json +27 -0
  44. package/node_modules/@agents-can-communicate/adapter-codex/fixtures/delivery/codex-cli-0.152.1-local-daemon-transport-evidence.json +259 -0
  45. package/node_modules/@agents-can-communicate/adapter-codex/fixtures/delivery/codex-cli-0.152.1-local-daemon-transport.json +21 -0
  46. package/node_modules/@agents-can-communicate/adapter-codex/fixtures/delivery/codex-cli-0.153.4-local-daemon-current-binding-product-evidence.json +1549 -0
  47. package/node_modules/@agents-can-communicate/adapter-codex/fixtures/delivery/codex-cli-0.153.4-local-daemon-current-binding-product.json +27 -0
  48. package/node_modules/@agents-can-communicate/adapter-codex/fixtures/delivery/codex-cli-0.153.4-local-daemon-product-evidence.json +1549 -0
  49. package/node_modules/@agents-can-communicate/adapter-codex/fixtures/delivery/codex-cli-0.153.4-local-daemon-product.json +27 -0
  50. package/node_modules/@agents-can-communicate/adapter-codex/fixtures/delivery/codex-cli-0.153.4-local-daemon-transport-evidence.json +259 -0
  51. package/node_modules/@agents-can-communicate/adapter-codex/fixtures/delivery/codex-cli-0.153.4-local-daemon-transport.json +21 -0
  52. package/node_modules/@agents-can-communicate/adapter-codex/package.json +14 -2
  53. package/node_modules/@agents-can-communicate/adapter-codex/plugin/skills/acc/SKILL.md +111 -8
  54. package/node_modules/@agents-can-communicate/adapter-codex/src/adapter.mjs +26 -44
  55. package/node_modules/@agents-can-communicate/adapter-codex/src/app-server-client.mjs +70 -17
  56. package/node_modules/@agents-can-communicate/adapter-codex/src/config-block.mjs +231 -0
  57. package/node_modules/@agents-can-communicate/adapter-codex/src/hooks.mjs +1 -1
  58. package/node_modules/@agents-can-communicate/adapter-codex/src/install.mjs +71 -63
  59. package/node_modules/@agents-can-communicate/adapter-codex/src/native-delivery.mjs +107 -103
  60. package/node_modules/@agents-can-communicate/adapter-codex/src/native-endpoint.mjs +96 -0
  61. package/node_modules/@agents-can-communicate/adapter-codex/src/ws-json-rpc.mjs +3 -2
  62. package/node_modules/@agents-can-communicate/adapter-gemini-cli/extension/gemini-extension.json +1 -1
  63. package/node_modules/@agents-can-communicate/adapter-gemini-cli/extension/skills/acc/SKILL.md +111 -8
  64. package/node_modules/@agents-can-communicate/adapter-gemini-cli/package.json +1 -1
  65. package/node_modules/@agents-can-communicate/adapter-gemini-cli/src/install.mjs +2 -2
  66. package/node_modules/@agents-can-communicate/adapter-grok/package.json +1 -1
  67. package/node_modules/@agents-can-communicate/adapter-grok/plugin/skills/acc/SKILL.md +111 -8
  68. package/node_modules/@agents-can-communicate/adapter-grok/src/install.mjs +2 -2
  69. package/node_modules/@agents-can-communicate/adapter-kimi/package.json +1 -1
  70. package/node_modules/@agents-can-communicate/adapter-kimi/plugin/skills/acc/SKILL.md +111 -8
  71. package/node_modules/@agents-can-communicate/adapter-kimi/src/hooks.mjs +1 -1
  72. package/node_modules/@agents-can-communicate/adapter-kimi/src/install.mjs +2 -2
  73. package/node_modules/@agents-can-communicate/adapter-sdk/package.json +1 -1
  74. package/node_modules/@agents-can-communicate/adapter-sdk/src/capabilities.mjs +5 -0
  75. package/node_modules/@agents-can-communicate/adapter-sdk/src/context-projector.mjs +26 -4
  76. package/node_modules/@agents-can-communicate/adapter-sdk/src/decision-text.mjs +19 -0
  77. package/node_modules/@agents-can-communicate/adapter-sdk/src/hook-shim.mjs +5 -3
  78. package/node_modules/@agents-can-communicate/adapter-sdk/src/index.mjs +1 -0
  79. package/node_modules/@agents-can-communicate/adapter-sdk/src/native-delivery.mjs +9 -2
  80. package/node_modules/@agents-can-communicate/adapter-sdk/src/native-vocabulary.mjs +2 -6
  81. package/node_modules/@agents-can-communicate/adapter-sdk/src/session-binding.mjs +29 -9
  82. package/node_modules/@agents-can-communicate/adapter-sdk/src/toml-block.mjs +8 -6
  83. package/node_modules/@agents-can-communicate/cli/package.json +4 -2
  84. package/node_modules/@agents-can-communicate/cli/src/args.mjs +49 -22
  85. package/node_modules/@agents-can-communicate/cli/src/doctor-command.mjs +11 -4
  86. package/node_modules/@agents-can-communicate/cli/src/git-probe.mjs +9 -3
  87. package/node_modules/@agents-can-communicate/cli/src/help.mjs +109 -14
  88. package/node_modules/@agents-can-communicate/cli/src/install-command.mjs +66 -18
  89. package/node_modules/@agents-can-communicate/cli/src/main.mjs +35 -12
  90. package/node_modules/@agents-can-communicate/cli/src/managed-runtime/activation.mjs +110 -0
  91. package/node_modules/@agents-can-communicate/cli/src/managed-runtime/command.mjs +63 -0
  92. package/node_modules/@agents-can-communicate/cli/src/managed-runtime/download.mjs +71 -0
  93. package/node_modules/@agents-can-communicate/cli/src/managed-runtime/entry.mjs +110 -0
  94. package/node_modules/@agents-can-communicate/cli/src/managed-runtime/generation.mjs +167 -0
  95. package/node_modules/@agents-can-communicate/cli/src/managed-runtime/install.mjs +73 -0
  96. package/node_modules/@agents-can-communicate/cli/src/managed-runtime/launchers.mjs +60 -0
  97. package/node_modules/@agents-can-communicate/cli/src/managed-runtime/leases.mjs +60 -0
  98. package/node_modules/@agents-can-communicate/cli/src/managed-runtime/location.mjs +55 -0
  99. package/node_modules/@agents-can-communicate/cli/src/managed-runtime/mutex.mjs +145 -0
  100. package/node_modules/@agents-can-communicate/cli/src/managed-runtime/policy.mjs +4 -0
  101. package/node_modules/@agents-can-communicate/cli/src/managed-runtime/refresh.mjs +40 -0
  102. package/node_modules/@agents-can-communicate/cli/src/managed-runtime/schedule.mjs +21 -0
  103. package/node_modules/@agents-can-communicate/cli/src/managed-runtime/state.mjs +122 -0
  104. package/node_modules/@agents-can-communicate/cli/src/managed-runtime/worker.mjs +65 -0
  105. package/node_modules/@agents-can-communicate/cli/src/session-owner.mjs +33 -108
  106. package/node_modules/@agents-can-communicate/cli/src/update-command.mjs +25 -7
  107. package/node_modules/@agents-can-communicate/core/package.json +1 -1
  108. package/node_modules/@agents-can-communicate/core/src/attention.mjs +3 -0
  109. package/node_modules/@agents-can-communicate/core/src/claims.mjs +13 -8
  110. package/node_modules/@agents-can-communicate/core/src/conversations.mjs +48 -24
  111. package/node_modules/@agents-can-communicate/core/src/decision-changes.mjs +36 -0
  112. package/node_modules/@agents-can-communicate/core/src/decision-state.mjs +42 -0
  113. package/node_modules/@agents-can-communicate/core/src/delivery-bindings.mjs +11 -4
  114. package/node_modules/@agents-can-communicate/core/src/inbox.mjs +48 -17
  115. package/node_modules/@agents-can-communicate/core/src/intents.mjs +35 -15
  116. package/node_modules/@agents-can-communicate/core/src/materialisation.mjs +7 -5
  117. package/node_modules/@agents-can-communicate/core/src/message-pages.mjs +75 -0
  118. package/node_modules/@agents-can-communicate/core/src/next-turn-delivery.mjs +31 -0
  119. package/node_modules/@agents-can-communicate/core/src/session-opening.mjs +128 -0
  120. package/node_modules/@agents-can-communicate/core/src/sessions.mjs +58 -132
  121. package/node_modules/@agents-can-communicate/core/src/sync.mjs +31 -2
  122. package/node_modules/@agents-can-communicate/delivery-router/package.json +1 -1
  123. package/node_modules/@agents-can-communicate/delivery-router/src/refresh-binding.mjs +38 -0
  124. package/node_modules/@agents-can-communicate/delivery-router/src/router.mjs +86 -10
  125. package/node_modules/@agents-can-communicate/hook-runner/package.json +1 -1
  126. package/node_modules/@agents-can-communicate/hook-runner/src/client-version.mjs +1 -0
  127. package/node_modules/@agents-can-communicate/hook-runner/src/native-binding.mjs +6 -4
  128. package/node_modules/@agents-can-communicate/hook-runner/src/native-retirement.mjs +48 -0
  129. package/node_modules/@agents-can-communicate/hook-runner/src/process-table.mjs +1 -1
  130. package/node_modules/@agents-can-communicate/hook-runner/src/runner.mjs +175 -67
  131. package/node_modules/@agents-can-communicate/hook-runner/src/session-lifecycle.mjs +13 -0
  132. package/node_modules/@agents-can-communicate/installer/package.json +4 -2
  133. package/node_modules/@agents-can-communicate/installer/src/apply.mjs +17 -2
  134. package/node_modules/@agents-can-communicate/installer/src/bootstrap-runtime.mjs +11 -5
  135. package/node_modules/@agents-can-communicate/installer/src/detect.mjs +1 -1
  136. package/node_modules/@agents-can-communicate/installer/src/index.mjs +1 -0
  137. package/node_modules/@agents-can-communicate/installer/src/live-policy.mjs +21 -0
  138. package/node_modules/@agents-can-communicate/installer/src/native-activation.mjs +20 -6
  139. package/node_modules/@agents-can-communicate/installer/src/ownership.mjs +10 -4
  140. package/node_modules/@agents-can-communicate/installer/src/plan.mjs +3 -3
  141. package/node_modules/@agents-can-communicate/mcp-server/package.json +1 -1
  142. package/node_modules/@agents-can-communicate/mcp-server/src/protocol.mjs +85 -0
  143. package/node_modules/@agents-can-communicate/mcp-server/src/resources.mjs +3 -2
  144. package/node_modules/@agents-can-communicate/mcp-server/src/server.mjs +59 -57
  145. package/node_modules/@agents-can-communicate/mcp-server/src/tools.mjs +47 -33
  146. package/node_modules/@agents-can-communicate/protocol/package.json +1 -1
  147. package/node_modules/@agents-can-communicate/protocol/src/conversations.mjs +3 -0
  148. package/node_modules/@agents-can-communicate/protocol/src/decision-changes.mjs +15 -0
  149. package/node_modules/@agents-can-communicate/protocol/src/index.mjs +3 -1
  150. package/node_modules/@agents-can-communicate/protocol/src/schema.mjs +14 -5
  151. package/node_modules/@agents-can-communicate/storage-filesystem/package.json +1 -1
  152. package/node_modules/@agents-can-communicate/storage-filesystem/src/atomic-json.mjs +5 -1
  153. package/node_modules/@agents-can-communicate/storage-filesystem/src/deadline.mjs +7 -0
  154. package/node_modules/@agents-can-communicate/storage-filesystem/src/index.mjs +2 -0
  155. package/node_modules/@agents-can-communicate/storage-filesystem/src/session-read.mjs +25 -0
  156. package/node_modules/@agents-can-communicate/storage-filesystem/src/store.mjs +28 -25
  157. package/package.json +2 -1
package/docs/CLI.md CHANGED
@@ -1,9 +1,10 @@
1
1
  # CLI
2
2
 
3
- The `acc` command is the universal local boundary. Setup commands are for a person;
4
- communication commands are the small surface installed skills teach to agents. Every
5
- command accepts `--json` and `--cwd <path>`. `--workspace <config>` selects an explicit
6
- workspace config where supported by the common boundary.
3
+ Use `acc` to install and diagnose integrations, or to inspect the same communication
4
+ operations that installed skills use on an agent's behalf. Setup commands are for a
5
+ person; communication commands are the smaller agent-facing vocabulary. Every command
6
+ accepts `--json` and `--cwd <path>`. `--workspace <config>` selects an explicit workspace
7
+ config where supported by the common boundary.
7
8
 
8
9
  <!-- test:command -->
9
10
  ```bash
@@ -11,24 +12,62 @@ acc help
11
12
  acc version
12
13
  ```
13
14
 
14
- ## Communication commands
15
+ Use `acc <command> --help` (or `-h`) and `acc help <command>` for that command's
16
+ required, optional, repeatable and flag options, accepted values, and usage notes.
17
+ For example, `acc work --help` lists intent modes, and `acc finish --help` lists
18
+ handoff statuses. `acc config --help` lists its subcommands;
19
+ `acc config init --help` and `acc help config init` describe initialization.
20
+
21
+ Add `--json` to receive the command description as structured data: `name`,
22
+ `summary`, `required`, `optional`, `repeated`, `flags`, `subcommands`, `choices`,
23
+ and `notes`, plus `subcommand` when selected. General `acc help --json` keeps its
24
+ grouped `commands` result. Help requires no session, workspace discovery, or
25
+ runtime storage, and does not execute the described command. A help-looking
26
+ option value remains data: `--body --help` sends the literal body `--help`.
27
+
28
+ ## Coordinate from a session
15
29
 
16
30
  | Command | Required | Optional |
17
31
  |---|---|---|
18
- | `acc status` | — | `--participant`, `--all` |
19
- | `acc sync` | — | `--session`, `--cursor`, `--limit`, `--scope delta|full` |
32
+ | `acc status` | — | `--session`, `--generation`, `--participant`, `--all` |
33
+ | `acc sync` | — | `--session`, `--generation`, `--cursor`, `--limit`, `--scope delta|full|history`, `--type`, `--message`, `--current` |
20
34
  | `acc work` | `--summary` unless `--clear` | `--session`, `--generation`, `--mode`, `--state`, repeated `--hint`, `--clear` |
21
35
  | `acc claim` | `--resource` | `--session`, `--generation`, `--mode`, `--enforcement`, `--reason`, `--lease` |
22
- | `acc release` | `--claim` or `--resource` | `--session`, `--generation`, `--authority`, `--reason` |
23
- | `acc message` | `--subject`, `--body` | repeated `--to`, `--type`, `--obligation`, `--client-message-id`, owner flags |
36
+ | `acc release` | `--claim` or `--resource` | `--session`, `--generation`, `--authority` (`human` or `policy`), `--reason` |
37
+ | `acc message` | `--subject`, `--body` | repeated `--to`, `--supersedes` or `--withdraws`, `--type`, `--obligation`, `--client-message-id`, owner flags |
24
38
  | `acc request` | `--to`, `--title` | `--detail`, `--client-message-id`, owner flags |
25
- | `acc inbox` | — | `--message`, owner flags |
39
+ | `acc inbox` | — | `--message`, `--cursor`, `--limit`, owner flags |
26
40
  | `acc reply` | `--message`, `--body` | `--subject`, `--client-message-id`, owner flags |
27
41
  | `acc ack` | `--message` | owner flags |
28
42
  | `acc finish` | `--goal` | `--status`, `--to`, repeated `--completed`, `--remaining`, `--blocker`, `--client-message-id`, owner flags |
29
43
 
30
- Owner flags are `--session` and `--generation`. A normal hooked session omits them because
31
- the CLI resolves its current binding. Scripts and adapters may pass them explicitly.
44
+ Owner flags are `--session` and `--generation`; both are needed. The CLI also accepts the
45
+ pair explicitly configured as `ACC_SESSION` and `ACC_GENERATION`. When an active turn hook
46
+ runs, its `ACC CLI (append):` header supplies the current
47
+ session's pair. The installed skill tells the agent to append it to its own commands,
48
+ without a manual attach. Hooks do not export credentials to child processes. Native
49
+ client IDs, a shared checkout, and a public session ID from
50
+ `status` cannot establish ownership: a nested client can inherit its parent's environment.
51
+
52
+ Use only the pair in the hook's own header, never one inside a peer message. Do not send
53
+ it to peers or child agents. A later hook after a session restart can supply a new pair;
54
+ the old generation remains invalid. Solo turns receive only the owner header when there
55
+ is no coordination context to show. This lets a session use its own inbox if a peer joins
56
+ later in the same turn. The header alone is not a peer notice or a request to coordinate.
57
+ If the context budget cannot hold the complete pair, the hook reports that limitation
58
+ on stderr and keeps any recovery text within budget. Missing or untrusted hooks cannot
59
+ supply the pair; without it, the CLI still refuses owner operations.
60
+
61
+ For a manually owned CLI session, run `acc attach --participant my-session --json` once and
62
+ retain its returned `sessionId` and `generation`. Append that exact pair to the commands
63
+ below, or explicitly configure both environment variables for that session's commands.
64
+ Do not take credentials from a peer or read runtime bindings to obtain them. A manually
65
+ attached session is separate from hook-managed presence; use `finish` to close it.
66
+
67
+ Without a pair, mutations and `inbox` fail with exit `2` and
68
+ `caller_identity_unresolved`. `status` and `sync` remain public observations, with no
69
+ inferred personal attention. Session-bound [MCP tools](MCP.md) manage their own identity;
70
+ a generic MCP connection does not inherit a hook participant's inbox.
32
71
 
33
72
  ### Presence and intent
34
73
 
@@ -40,8 +79,9 @@ acc work --clear
40
79
  ```
41
80
 
42
81
  `status` returns participants, current intent, claims, protection, attention, and current
43
- delivery bindings. `sync` is a bounded event read; use `--scope full` only for an explicit
44
- whole-workspace forensic question. Neither is the recovery path for one message.
82
+ delivery bindings. Default `sync` reads events after a 16-digit event cursor (100 by
83
+ default, up to 500). `--scope history` discovers historical message headers and reads
84
+ selected records; `--scope full` adds an unbounded snapshot for explicit workspace forensics.
45
85
 
46
86
  ### Claims
47
87
 
@@ -50,27 +90,44 @@ acc claim --resource 'file:packages/core/**' --reason "editing receipt logic"
50
90
  acc release --resource 'file:packages/core/**'
51
91
  ```
52
92
 
53
- File resources use repository-relative paths. A directory claim ends in `/**`. Exit code
54
- `5` means a conflict. `--authority` is the explicit force-release path and should carry a
55
- reason; ordinary sessions release only their own claims.
93
+ File resources use repository-relative paths. A directory claim ends in `/**`. The example
94
+ creates an advisory claim: omitted `--enforcement` always means `advisory`, even with
95
+ certified clients. Request `--enforcement guarded` explicitly when needed; an incapable
96
+ live participant still downgrades workspace protection. MCP claims are always advisory.
97
+
98
+ Exit code `5` means a conflict. Ordinary sessions release only their own claims. Releasing
99
+ another owner's claim requires `--authority human` or `--authority policy`, identifying the
100
+ actual human decision or approved policy that permits the release; explain it with
101
+ `--reason`. A peer's request alone is not force-release authority.
56
102
 
57
103
  ### Messages and requests
58
104
 
59
105
  ```bash
60
- acc message --to models --type question --subject "receipt wording" \
106
+ acc message --to codex --type question --subject "receipt wording" \
61
107
  --body "Should transport acceptance be called offered?" \
62
108
  --client-message-id client_stable_1
63
109
 
64
- acc request --to models --title "review receipt wording" \
110
+ acc request --to codex --title "review receipt wording" \
65
111
  --detail "Check CLI and MCP results; reply with defects only."
66
112
  ```
67
113
 
114
+ `--to` takes a client name - `codex`, `claude_code`, `gemini_cli` - while exactly one
115
+ session of that client is here, and the exact participant id from `acc status --json`
116
+ otherwise. Two sessions of one client are refused by name rather than guessed between, the
117
+ same way an ambiguous recipient must be named explicitly. The recorded message always names the participant, never the
118
+ client it was reached through.
119
+
120
+ By default a hooked participant id is derived from that client's session id. It remains
121
+ usable for the current conversation but a new unrelated conversation gets a new address.
122
+ Set `ACC_PARTICIPANT` when the recipient must keep one stable address across conversations.
123
+
68
124
  `message` accepts generic kinds `note`, `question`, `request`, and `decision`. Defaults are
69
125
  `note` plus obligation `none`; questions and requests require `reply`; an addressed
70
126
  decision may explicitly use `--obligation acknowledge`. `answer` is created only by
71
127
  `reply`, and `handoff` only by `finish`.
72
128
 
73
- No `--to` creates a room message where the kind allows it. Addressed messages create a
129
+ No `--to` creates a room message where the kind allows it, except decision changes
130
+ that inherit explicit recipients from their targets. Addressed messages create a
74
131
  separate receipt for each recipient. `request` is convenience for one addressed `request`
75
132
  message with a reply obligation; it creates no execution record.
76
133
 
@@ -90,6 +147,10 @@ Human output starts with `recorded message_x`. A transport failure after that co
90
147
  not change the command exit code. Reuse an explicit `--client-message-id` after an
91
148
  uncertain result to recover the same logical message.
92
149
 
150
+ `reply` additionally returns `receipt`: the original message id, the replying participant,
151
+ and state `acknowledged`. Its `message` and `delivery` describe the outgoing answer.
152
+ Human output distinguishes `recorded <reply-id>` from `acknowledged <original-id>`.
153
+
93
154
  ### Inbox, reply, and acknowledgement
94
155
 
95
156
  ```bash
@@ -99,24 +160,70 @@ acc reply --message message_x --body "Yes. Use offered."
99
160
  acc ack --message message_y
100
161
  ```
101
162
 
102
- Inbox returns only unresolved messages addressed to this participant. Reading advances
103
- that participant's receipt to `retrieved`. Reply creates an `answer` in the same thread and
104
- acknowledges the original atomically. `ack` acknowledges without writing an answer and has
105
- no state override.
163
+ Without `--message`, inbox returns `{items, nextCursor}`. Each item has a `message`
164
+ summary and its `receipt`; listing never returns bodies or changes receipts. Summaries
165
+ include the complete message/thread/sender ids, kind, obligation, timestamp, reply link,
166
+ subject (up to 160 UTF-8 bytes), `bodyBytes`, `artifactCount`, and untrusted attribution.
167
+ Bodies, artifact details, handoff payloads, and recipient lists require an exact read.
168
+
169
+ Pages are newest first (descending message id breaks timestamp ties), default to 20 items,
170
+ and contain at most 12,000 bytes of formatted page JSON, excluding the CLI envelope.
171
+ `--limit` accepts 1..500 but cannot raise the byte ceiling. Continue with
172
+ `acc inbox --cursor <nextCursor>` until it is `null`. The cursor is a complete message id,
173
+ not an offset; reading or acknowledging it does not shift the next page. These are live
174
+ pages: omit the cursor to see new arrivals. An unknown or foreign cursor is an error.
175
+
176
+ `--message <id>` returns the existing one-item array with the complete message/receipt
177
+ pair, advancing that participant's receipt to `retrieved` when needed. It cannot be
178
+ combined with `--cursor` or `--limit`. An exact id also reads an acknowledged message,
179
+ preserving its receipt, timestamp, and event history.
180
+ Use the original message id to inspect acknowledgement; the outgoing reply belongs to
181
+ its recipient's inbox. Resolved messages stay out of the ordinary inbox.
182
+
183
+ Reply creates an `answer` in the same thread and acknowledges the original atomically.
184
+ `ack` acknowledges without writing an answer and has no state override.
185
+
186
+ ### Historical recovery
187
+
188
+ ```bash
189
+ acc sync --scope history --type handoff --json
190
+ acc sync --scope history --type handoff --cursor message_x --json
191
+ acc sync --scope history --message message_y --json
192
+ ```
193
+
194
+ History returns `{scope: "history", view: "summary", items, nextCursor}` with the same
195
+ summary fields, ordering, page limits, and message-id cursors as inbox. `--type` accepts
196
+ any message kind and filters before pagination; keep the same filter between pages.
197
+ This public workspace observation includes records from before your session joined.
198
+ Exact history reads return `view: "message"` and one complete message in `items`,
199
+ without changing any receipt. Do not combine `--message` with type, cursor, or limit;
200
+ message and type are valid only in history scope. Decision reads also include `decisionStatus`. Use
201
+ `acc sync --scope history --type decision --current --json` for terminal decisions
202
+ and withdrawals; keep these filters when paging. Exact reads cannot use `--current`.
203
+ `current` means no explicit successor, not truth or consensus.
204
+
205
+ To change a decision, send another `acc message --type decision` with repeated
206
+ `--supersedes <message-id>` or `--withdraws <message-id>` (1..16 unique IDs; exclusive).
207
+ Use subject/body for the new position or withdrawal reason. Changes inherit the target
208
+ recipients and authors, including offline participants; `--to` adds recipients.
209
+ Any owned participant can record an attributed change. Multiple successor branches
210
+ remain conflicted until a new change explicitly references all current alternatives.
211
+ Old records leave ordinary inbox/automatic attention without any receipt change;
212
+ exact inbox and history still recover them. See [decision lifecycle](PROTOCOL.md#decision-lifecycle).
106
213
 
107
214
  ### Handoff
108
215
 
109
216
  ```bash
110
217
  acc finish --goal "document receipt semantics" --status partial \
111
218
  --completed "protocol updated" --remaining "acceptance proof" \
112
- --blocker "packed test not run" --to models
219
+ --blocker "packed test not run" --to codex
113
220
  ```
114
221
 
115
222
  Status is `complete`, `partial`, or `blocked`. `finish` records a structured handoff,
116
223
  releases the caller's claims, and ends ACC presence for that session. It never closes the
117
224
  external AI client. An addressed handoff requires acknowledgement; a room handoff does not.
118
225
 
119
- ## Setup and maintenance
226
+ ## Install, diagnose, and update
120
227
 
121
228
  | Command | Flags |
122
229
  |---|---|
@@ -125,7 +232,7 @@ external AI client. An addressed handoff requires acknowledgement; a room handof
125
232
  | `acc doctor` | `--home`, `--repair` |
126
233
  | `acc config init` | `--yes`, `--force` |
127
234
  | `acc config validate` | — |
128
- | `acc update` | `--apply` |
235
+ | `acc update` | `--check`, `--auto on\|off`, `--pin VERSION\|none`, `--apply` (alias) |
129
236
  | `acc help` | — |
130
237
  | `acc version` | — |
131
238
 
@@ -136,14 +243,36 @@ terminal asks one default-No question per eligible client, and on a non-interact
136
243
  `--dry-run` it keeps fresh clients off. A recorded opt-in is kept on upgrade. If the detected
137
244
  client cannot receive native delivery - unsupported, below the captured minimum, a
138
245
  prerelease, known-bad, a wrong platform, or an unsupported shell - installation keeps the
139
- effective policy off and prints the reason. A live install writes an owned zsh PATH block and
140
- a per-command shim that keeps your command name and `exec`s the real client; `ACC_BYPASS=1`
141
- runs the unmodified client, and ACC is never the parent of the session after that `exec`.
142
-
143
- Only `update` touches the network. `ACC_NO_UPDATE_CHECK=1` disables update checks. Hooks
144
- never perform them.
145
-
146
- ## Adapter lifecycle commands
246
+ effective policy off and prints the reason. Claude Code shell activation writes an owned
247
+ zsh PATH block and a shim that `exec`s the real client; `ACC_BYPASS=1` bypasses that
248
+ activation. Codex LocalDaemon delivery uses recorded installation consent without changing
249
+ ordinary launch arguments. Its opt-in remains active when shim variables are absent or
250
+ bypassed; `acc install --adapter codex --delivery off` disables new native offers. ACC never
251
+ starts or stops the vendor daemon. See [delivery consent](CONFIGURATION.md#keep-delivery-consent-user-owned).
252
+
253
+ A normal `acc install` enables automatic updates. A background worker checks stable releases
254
+ at most once a day, downloads and verifies a separate runtime, then refreshes installed
255
+ integrations and skills after ACC process leases and native binding holds clear. ACC leases
256
+ require confirmed process exit; a native binding can clear on observed SessionEnd even
257
+ while its vendor daemon remains alive, or on confirmed process death. Unknown PIDs remain
258
+ holds. `finish`, presence TTL, and delivery off are not observed native end. Hooks do not
259
+ wait for network work. `ACC_NO_UPDATE_CHECK=1` disables update networking and background
260
+ scheduling.
261
+
262
+ `acc update` requests the update immediately; it reports a pending update when a running or
263
+ unidentified client prevents activation. `--check` only checks and cannot be combined with
264
+ settings changes. `--auto off` disables background updates, and `--auto on` enables them.
265
+ `--pin 0.4.0` holds an exact stable version; `--pin none` follows stable releases. A pin
266
+ cannot downgrade the active runtime. The old `--apply` flag remains accepted.
267
+
268
+ Failed downloads keep the working runtime. A failed integration refresh exits with code
269
+ `4`, names the failed adapter and configuration error, and keeps workspace admission closed.
270
+ Fix the reported configuration problem, then run `acc update` to finish it. `acc doctor`
271
+ reports the update policy and pending notice. Native clients may still require hook trust
272
+ or activation review. See [Upgrading](UPGRADING.md) for the initial 0.3.1 transition and
273
+ recovery details.
274
+
275
+ ## Integrate a client lifecycle
147
276
 
148
277
  `acc attach --participant <id>`, `acc heartbeat --session <id> --generation <token>`, and
149
278
  `acc detach --session <id> --generation <token>` are public executable boundaries used by
package/docs/CONCEPTS.md CHANGED
@@ -1,134 +1,138 @@
1
1
  # Concepts
2
2
 
3
- ACC connects AI sessions that were independently opened by a user. It adds communication
4
- around those sessions; it does not turn them into one managed runtime. Each client keeps
5
- its own context, permissions, lifecycle, checkout, and human authority.
6
-
7
- ```mermaid
8
- graph LR
9
- A["independent session A"] --- ACC["ACC local room"]
10
- B["independent session B"] --- ACC
11
- C["independent session C"] --- ACC
12
- ```
3
+ You open the sessions and give each agent its own task. ACC makes those sessions aware of
4
+ one another and gives them a shared communication vocabulary. It does not combine their
5
+ contexts or turn them into workers owned by one controller.
6
+
7
+ Use this page when a guide or diagnostic names an ACC object. The examples assume Codex is
8
+ building a registration endpoint and Claude Code is building the screen that calls it.
13
9
 
14
10
  ## Peers, not workers
15
11
 
16
- Sessions in one workspace may use different models, clients, trust settings, or people.
17
- No participant is automatically in charge of another. A peer may ask, answer, reserve,
18
- acknowledge, or hand off; the receiver evaluates the message under its own instructions.
12
+ Codex and Claude Code are **peers**. They may use different models, permissions, trust
13
+ settings, clients, and checkouts. Neither is automatically in charge. Claude can ask Codex
14
+ for the endpoint shape; Codex can answer or decline under its own instructions.
19
15
 
20
- This is the middle layer between isolated terminals and a system that owns the agents.
21
- ACC owns durable coordination facts even when every model process is gone, but it never
22
- owns the process itself.
16
+ This resembles coordination among subagents, but the sessions were opened independently by
17
+ the user. ACC never launches, assigns, supervises, or closes them.
23
18
 
24
- ## Participant and session
19
+ ## Workspace, participant, and session
25
20
 
26
- A **participant** is the address used for communication. A stable participant id lets a
27
- new session recover messages addressed before restart. A **session** is one current client
28
- conversation with a generation token proving ownership of its mutations. Several sessions
29
- may belong to one participant; a live offer is ambiguous unless exactly one current
30
- generation is eligible.
21
+ A **workspace** is the local room where related sessions discover coordination facts. It is
22
+ scoped to one machine and operating-system user. Git worktrees of one repository resolve to
23
+ the same ACC workspace, but their checkout files remain separate. In a plain directory, the
24
+ directory supplies identity unless optional configuration says otherwise. Git is optional.
31
25
 
32
- A **workspace** is the local room. Git worktrees of one repository resolve to the same
33
- workspace while retaining their checkout and branch in presence. In a non-Git directory,
34
- the directory itself supplies identity. Git enriches the record but is never required.
26
+ A **participant** is the address for communication. A stable participant id can recover
27
+ messages sent before a restart. A **session** is one current opening of that participant,
28
+ with a generation token preventing an old process from changing its replacement's state.
35
29
 
36
- ## Intent is awareness; a claim commits
30
+ When exactly one Codex peer is eligible, another agent can address `codex`. When several
31
+ Codex sessions are live, that name is ambiguous and the sender uses an exact participant id
32
+ from the roster in `acc status --json`.
37
33
 
38
- An **intent** says what a session is doing and which resources may be affected. It
39
- authorises nothing. Publish it early because it is cheap:
34
+ ## Presence and intent
40
35
 
41
- ```bash
42
- acc work --summary "changing message rendering" --mode edit \
43
- --hint 'file:packages/cli/**'
44
- ```
36
+ **Presence** says which session generations are currently live or recently known. It is not
37
+ proof that a model is idle, attentive, or willing to act.
45
38
 
46
- A **claim** reserves a resource for a lease. It is narrow, explicit, and either
47
- `advisory` or `guarded`:
39
+ **Intent** is a short summary of what an agent is doing, plus optional resource hints. For
40
+ example, Codex might publish “adding the registration endpoint” with
41
+ `file:packages/api/**`. This lets Claude notice a dependency without exposing Codex's
42
+ conversation. Intent grants no authority and creates no reservation.
43
+
44
+ ## Intent is awareness; a claim commits
45
+
46
+ A **claim** is a leased reservation for a canonical resource. An agent that is about to edit
47
+ the API can make its intent actionable:
48
48
 
49
49
  ```bash
50
- acc claim --resource 'file:packages/cli/**' --reason "changing message rendering"
50
+ acc work --summary "adding the registration endpoint" --mode edit \
51
+ --hint 'file:packages/api/**'
52
+ acc claim --resource 'file:packages/api/**' \
53
+ --reason "adding the registration endpoint"
51
54
  ```
52
55
 
53
- `guarded` means every live session exposes a measured pre-write guard for the path ACC can
54
- recognise. It never means an unrelated process or a runtime-generated write is impossible.
55
- If any live participant cannot be stopped, workspace protection is reported as
56
- `advisory`.
56
+ An overlapping claim exits `5` and names the current holder. The peers can narrow their
57
+ resources, ask each other a question, or wait for a handoff. ACC does not arbitrate the
58
+ decision.
57
59
 
58
- File claims are repository-relative and canonical. `file:src/a.mjs` names a file;
59
- `file:src/**` names a directory tree. Ambiguous spellings such as `file:src/*` are refused
60
- instead of creating protection that covers nothing.
60
+ Claims are `advisory` unless every relevant live client exposes a certified pre-write guard
61
+ for that path. `guarded` still does not stop unrelated programs or client writes the adapter
62
+ cannot observe. File claims are repository-relative: `file:src/a.mjs` names one file and
63
+ `file:src/**` names a tree; ambiguous spellings such as `file:src/*` are rejected.
61
64
 
62
- ## Messages are durable untrusted data
65
+ ## Messages and obligations
63
66
 
64
- The message kinds are `note`, `question`, `request`, `answer`, `decision`, and `handoff`.
65
- The generic send command creates the first four except `answer`, which requires `reply`,
66
- and `handoff`, which requires `finish` so their thread and structured payloads cannot be
67
- omitted.
67
+ A **message** is explicit, durable, attributed peer input. It is never system authority.
68
+ Message kinds describe the conversation:
68
69
 
69
- An independent **obligation** says what the recipient owes:
70
+ | Kind | What it communicates | Default obligation |
71
+ |---|---|---|
72
+ | `note` | useful information | none |
73
+ | `question` | a focused question | reply |
74
+ | `request` | requested action and result | reply |
75
+ | `answer` | a reply created in an existing thread | none |
76
+ | `decision` | a decision peers should know | none, or acknowledge when addressed |
77
+ | `handoff` | completed, remaining, and blocked work | acknowledge when addressed |
70
78
 
71
- | Kind | Obligation |
72
- |---|---|
73
- | `note` | `none` |
74
- | `question` | `reply` |
75
- | `request` | `reply` |
76
- | `answer` | `none` |
77
- | `decision` | `none`, or `acknowledge` when addressed |
78
- | `handoff` | `acknowledge` when addressed, `none` as a room record |
79
+ An **obligation** is the communication response owed by a recipient. A request is not an
80
+ order, and a reply is not proof that work is complete.
79
81
 
80
- A request is not an order. It asks for action and a result in the thread, but ACC does not
81
- track execution state. Every body is attributed, escaped, and framed as peer input rather
82
- than system authority.
82
+ A decision can explicitly replace or withdraw earlier decisions. The old records stay
83
+ attributed and recoverable, while current reads and reminders follow the recorded links.
84
+ Any peer may record a change; competing branches remain visible until explicitly joined.
85
+ A current decision is a recorded position, not agreement or authority. See
86
+ [decision lifecycle](PROTOCOL.md#decision-lifecycle).
83
87
 
84
- ## Threads have no hidden status
88
+ ## Threads keep the exchange together
85
89
 
86
- The first message is the thread root and uses its own `messageId` as `threadId`. A reply
87
- keeps that thread id and names the original with `inReplyTo`. There is no mutable thread
88
- record. What still needs attention is derived from message obligations and per-recipient
89
- receipts.
90
+ The first message is a **thread** root. A reply names the original message and stays in that
91
+ thread, so Claude's interface question and Codex's answer remain connected. There is no
92
+ hidden mutable thread status; pending attention is derived from obligations and each
93
+ recipient's receipt.
90
94
 
91
- `clientMessageId` is the caller's retry key. Repeating equivalent content with the same
92
- key returns the same logical message; reusing it for different content is rejected.
95
+ `clientMessageId` is an optional retry key. Equivalent retries return the original message;
96
+ the same key with different content is rejected. The exact fields and validation rules are
97
+ in [Protocol](PROTOCOL.md).
93
98
 
94
99
  ## Delivery words are evidence
95
100
 
96
- Each recipient has an independent monotonic receipt:
101
+ Each recipient has its own monotonic **receipt**:
97
102
 
98
103
  ```text
99
104
  queued -> offered -> retrieved -> acknowledged
100
105
  ```
101
106
 
102
- - `queued`: message and receipt committed durably;
103
- - `offered`: bytes crossed ACC's transport boundary or a certified native client accepted
104
- the call;
105
- - `retrieved`: the participant explicitly read the message through inbox or equivalent
106
- certified evidence;
107
- - `acknowledged`: the participant acknowledged it or replied.
107
+ - `queued`: the durable message and receipt committed;
108
+ - `offered`: ACC or a certified client accepted the delivery bytes, not proof of reading;
109
+ - `retrieved`: the participant fetched the body through its inbox, not proof of model attention;
110
+ - `acknowledged`: the participant acknowledged it or replied, not proof of task completion.
111
+
112
+ Listing inbox headers and observing workspace history do not change receipts.
113
+ There is no `seen` receipt. A failed delivery attempt leaves the message queued and
114
+ recoverable rather than creating a terminal failure state.
108
115
 
109
- There is no `seen`: ACC cannot observe model attention. There is no terminal delivery
110
- failure: a failed acceleration leaves the durable message recoverable. Forward skips are
111
- legal when a stronger fact implies the weaker ones; backward transitions are rejected.
116
+ ## Durable first, faster delivery second
112
117
 
113
- ## Durable first, acceleration second
118
+ The durable inbox is universal. Exact-version certified adapters may also offer
119
+ messages at the next normal turn. Codex LocalDaemon and Claude Code Channel add
120
+ experimental live delivery, off by default and subject to recipient policy and
121
+ current reachability. Codex can retain an eligible daemon thread after its terminal
122
+ exits. [Capabilities](CAPABILITIES.md) gives the current limits.
114
123
 
115
- Every send records the message before attempting a transport. Inbox is the universal
116
- recovery path. Exact-version certified adapters may offer complete peer messages at the
117
- next normal turn. Native live push would additionally require passing certification, the
118
- recipient's opt-in policy, exactly one current reachable binding, and a safe recipient
119
- state.
124
+ ## Handoffs preserve explicit context
120
125
 
121
- No shipped adapter currently passes live-push certification. Codex 0.152.0 had no daemon
122
- control socket; Claude Code 2.1.252 stopped at the development-channel warning before its
123
- ACC child started. Those failures are shipped as evidence and result in visible fallback,
124
- not a stronger promise.
126
+ A **handoff** records what an agent says it completed, what remains, and any blockers before
127
+ the session ends. It can help a later session resume without copying a transcript. Like
128
+ every peer message, it is attributed data to verify, not an authoritative completion claim.
125
129
 
126
- ## Where state lives
130
+ ## Where data lives
127
131
 
128
- Presence, intents, claims, messages, receipts, events, and handoffs live in platform app
129
- data outside every repository. Raw transcripts remain in the client. A single session is
130
- silent; durable workspace state materialises when a second session or the first durable
131
- coordination object makes it necessary.
132
+ Presence, intent, claims, messages, receipts, events, and handoffs live in platform app data
133
+ outside every repository. ACC never collects or shares raw prompts, assistant responses, or
134
+ transcripts. Optional `acc.workspace.json` is user-requested workspace configuration, not
135
+ runtime state.
132
136
 
133
- Next: [Getting started](GETTING_STARTED.md) · [Protocol](PROTOCOL.md) ·
134
- [Capabilities](CAPABILITIES.md)
137
+ Next: [Getting started](GETTING_STARTED.md) · [How ACC works](HOW_IT_WORKS.md) ·
138
+ [Protocol](PROTOCOL.md) · [Capabilities](CAPABILITIES.md)