my-agent-mesh 0.3.0__tar.gz

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 (64) hide show
  1. my_agent_mesh-0.3.0/LICENSE +21 -0
  2. my_agent_mesh-0.3.0/PKG-INFO +418 -0
  3. my_agent_mesh-0.3.0/README.md +394 -0
  4. my_agent_mesh-0.3.0/pyproject.toml +53 -0
  5. my_agent_mesh-0.3.0/setup.cfg +4 -0
  6. my_agent_mesh-0.3.0/src/agent_mesh/__init__.py +3 -0
  7. my_agent_mesh-0.3.0/src/agent_mesh/adapters/__init__.py +71 -0
  8. my_agent_mesh-0.3.0/src/agent_mesh/adapters/base.py +73 -0
  9. my_agent_mesh-0.3.0/src/agent_mesh/adapters/default.py +93 -0
  10. my_agent_mesh-0.3.0/src/agent_mesh/adoption.py +298 -0
  11. my_agent_mesh-0.3.0/src/agent_mesh/cli/__init__.py +1 -0
  12. my_agent_mesh-0.3.0/src/agent_mesh/cli/mail.py +3425 -0
  13. my_agent_mesh-0.3.0/src/agent_mesh/cli/q.py +1993 -0
  14. my_agent_mesh-0.3.0/src/agent_mesh/config.py +1058 -0
  15. my_agent_mesh-0.3.0/src/agent_mesh/core/__init__.py +1 -0
  16. my_agent_mesh-0.3.0/src/agent_mesh/core/agent_instances.py +269 -0
  17. my_agent_mesh-0.3.0/src/agent_mesh/core/chain.py +160 -0
  18. my_agent_mesh-0.3.0/src/agent_mesh/core/decision_schema.py +276 -0
  19. my_agent_mesh-0.3.0/src/agent_mesh/core/dispatch_schema.py +393 -0
  20. my_agent_mesh-0.3.0/src/agent_mesh/core/events.py +631 -0
  21. my_agent_mesh-0.3.0/src/agent_mesh/core/external_recovery_plan.py +151 -0
  22. my_agent_mesh-0.3.0/src/agent_mesh/core/hashing.py +24 -0
  23. my_agent_mesh-0.3.0/src/agent_mesh/core/ids.py +35 -0
  24. my_agent_mesh-0.3.0/src/agent_mesh/core/lock.py +284 -0
  25. my_agent_mesh-0.3.0/src/agent_mesh/core/provenance.py +230 -0
  26. my_agent_mesh-0.3.0/src/agent_mesh/core/recovery.py +362 -0
  27. my_agent_mesh-0.3.0/src/agent_mesh/core/source_recovery.py +872 -0
  28. my_agent_mesh-0.3.0/src/agent_mesh/core/source_recovery_audit.py +663 -0
  29. my_agent_mesh-0.3.0/src/agent_mesh/core/source_recovery_promotion.py +212 -0
  30. my_agent_mesh-0.3.0/src/agent_mesh/core/workflow_origin.py +129 -0
  31. my_agent_mesh-0.3.0/src/agent_mesh/dispatch/__init__.py +141 -0
  32. my_agent_mesh-0.3.0/src/agent_mesh/dispatch/adapters.py +222 -0
  33. my_agent_mesh-0.3.0/src/agent_mesh/dispatch/atomic.py +96 -0
  34. my_agent_mesh-0.3.0/src/agent_mesh/dispatch/dispatch.py +315 -0
  35. my_agent_mesh-0.3.0/src/agent_mesh/dispatch/emitter.py +374 -0
  36. my_agent_mesh-0.3.0/src/agent_mesh/dispatch/eval.py +122 -0
  37. my_agent_mesh-0.3.0/src/agent_mesh/dispatch/execution.py +423 -0
  38. my_agent_mesh-0.3.0/src/agent_mesh/dispatch/grounding.py +270 -0
  39. my_agent_mesh-0.3.0/src/agent_mesh/dispatch/guard.py +225 -0
  40. my_agent_mesh-0.3.0/src/agent_mesh/dispatch/output_policy.py +130 -0
  41. my_agent_mesh-0.3.0/src/agent_mesh/dispatch/profiles.py +339 -0
  42. my_agent_mesh-0.3.0/src/agent_mesh/dispatch/runtime.py +344 -0
  43. my_agent_mesh-0.3.0/src/agent_mesh/dispatch/types.py +155 -0
  44. my_agent_mesh-0.3.0/src/agent_mesh/message_packet.py +124 -0
  45. my_agent_mesh-0.3.0/src/agent_mesh/project_registry.py +321 -0
  46. my_agent_mesh-0.3.0/src/agent_mesh/skill/__init__.py +22 -0
  47. my_agent_mesh-0.3.0/src/agent_mesh/skill/render.py +277 -0
  48. my_agent_mesh-0.3.0/src/agent_mesh/store/__init__.py +1 -0
  49. my_agent_mesh-0.3.0/src/agent_mesh/store/rebuild.py +2336 -0
  50. my_agent_mesh-0.3.0/src/agent_mesh/store/sqlite.py +717 -0
  51. my_agent_mesh-0.3.0/src/agent_mesh/views/__init__.py +20 -0
  52. my_agent_mesh-0.3.0/src/agent_mesh/views/archive.py +4 -0
  53. my_agent_mesh-0.3.0/src/agent_mesh/views/inbox.py +4 -0
  54. my_agent_mesh-0.3.0/src/agent_mesh/views/log.py +4 -0
  55. my_agent_mesh-0.3.0/src/agent_mesh/views/outbox.py +4 -0
  56. my_agent_mesh-0.3.0/src/agent_mesh/views/rendering.py +397 -0
  57. my_agent_mesh-0.3.0/src/agent_mesh/workbench.py +4958 -0
  58. my_agent_mesh-0.3.0/src/agent_mesh/workbench_service.py +601 -0
  59. my_agent_mesh-0.3.0/src/my_agent_mesh.egg-info/PKG-INFO +418 -0
  60. my_agent_mesh-0.3.0/src/my_agent_mesh.egg-info/SOURCES.txt +62 -0
  61. my_agent_mesh-0.3.0/src/my_agent_mesh.egg-info/dependency_links.txt +1 -0
  62. my_agent_mesh-0.3.0/src/my_agent_mesh.egg-info/entry_points.txt +3 -0
  63. my_agent_mesh-0.3.0/src/my_agent_mesh.egg-info/requires.txt +4 -0
  64. my_agent_mesh-0.3.0/src/my_agent_mesh.egg-info/top_level.txt +1 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 agent-mesh contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,418 @@
1
+ Metadata-Version: 2.4
2
+ Name: my-agent-mesh
3
+ Version: 0.3.0
4
+ Summary: Local, auditable coordination and decision tracking for human and AI-agent teams
5
+ Author: agent-mesh contributors
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/cbalgeman/agent-mesh
8
+ Project-URL: Repository, https://github.com/cbalgeman/agent-mesh
9
+ Project-URL: Issues, https://github.com/cbalgeman/agent-mesh/issues
10
+ Project-URL: Changelog, https://github.com/cbalgeman/agent-mesh/blob/main/CHANGELOG.md
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Topic :: Software Development :: Libraries
17
+ Requires-Python: >=3.11
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+ Provides-Extra: test
21
+ Requires-Dist: pytest>=7; extra == "test"
22
+ Requires-Dist: ruff>=0.4; extra == "test"
23
+ Dynamic: license-file
24
+
25
+ # agent-mesh
26
+
27
+ Agent Mesh gives a human one reliable place to coordinate the AI agents working
28
+ on a software project. It turns important requests, decisions, backlog items,
29
+ handoffs, and results into a durable, project-local history that survives chat
30
+ boundaries and changes of agent.
31
+
32
+ ## Why adopt it?
33
+
34
+ AI-assisted work easily becomes scattered across chat windows, agents, and
35
+ private notes. Agent Mesh adds a shared source of truth, human-readable work
36
+ IDs, explicit human approval for durable decisions, and a local Workbench where
37
+ you can see what is open, decided, or complete. Agents can recover the relevant
38
+ context and hand work off without copying whole conversations. Ordinary chat
39
+ can remain chat, and project state stays private and local by default.
40
+
41
+ ## What adoption looks like
42
+
43
+ Give your coding agent access to Agent Mesh and the repository you want to
44
+ adopt. The agent inspects the project, asks you only for the choices it cannot
45
+ safely infer, initializes the local Agent Mesh state, installs the project
46
+ contract, verifies it, and opens the Workbench. You remain the approval point
47
+ for durable decisions and for whether any Agent Mesh state is shared through
48
+ Git. Existing workflows can move over gradually instead of being replaced all
49
+ at once.
50
+
51
+ ## Human User experience
52
+
53
+ The Workbench is the primary human control surface. It keeps review, priority,
54
+ and approval understandable without requiring the human to reconstruct project
55
+ state from agent chats or operate the CLI.
56
+
57
+ ### What you see in the Workbench
58
+
59
+ | View | What you can see and do | Why it matters |
60
+ |---|---|---|
61
+ | Repository selector and health | Choose the active repository and see the local server and agent-contract status. | Keeps every action in the intended project and makes a broken or stale setup visible. |
62
+ | Dashboard | See open requests and feedback, urgent and pending-user work, progress totals, priority and lane breakdowns, and recent backlog activity. | Gives you an immediate answer to “What needs my attention?” without asking an agent to reconstruct it. |
63
+ | Verify / Feedback | Record an observation, severity, target, references, and screenshots, then submit it as a durable REQ addressed to one or more agents. | Creates attributable, trackable work instead of a comment that disappears in chat. Relay its ID to an agent so it can retrieve and process the feedback, respond on the same thread, and create or link backlog items when follow-up work is needed. |
64
+ | Messages | Search requests and responses by status, kind, origin, participant, or text; inspect a thread; and close or reopen a request with a reason. | Preserves assignments, handoffs, outcomes, and the context needed by the next human or agent. |
65
+ | Backlog | Search and filter work by status, lane, priority, owner, type, scope, or origin, and update its status, lane, or priority. | Provides one current, human-readable work queue across agents. |
66
+ | Decisions | Search proposed, accepted, in-force, rejected, superseded, and retired decisions; create or revise proposals; and approve an exact revision with a note. | Shows what the human actually authorized and prevents an edited decision from silently inheriting an earlier approval. |
67
+ | Kanban | See backlog items grouped by lane and move them between lanes. | Makes flow, ownership, and bottlenecks easy to scan. |
68
+
69
+ ### Human control and privacy
70
+
71
+ - New projects are private by default: `local-only` keeps `.agent-mesh/` out of
72
+ normal Git adds. `git-shared` is an explicit opt-in that exposes the canonical
73
+ config, event log, and body files to everyone who can read the repository.
74
+ - Agent Mesh is not a secret store. Free-form messages and bodies can contain
75
+ anything a participant writes, and there is currently no automatic redaction,
76
+ deletion, or retention policy. Do not record credentials or unnecessary
77
+ personal information.
78
+ - Uploaded attachments stay local and are not included by the `git-shared`
79
+ allowlist, but their paths can be referenced by feedback records.
80
+ - Decisions require direct human approval. Agents may propose or revise them,
81
+ but cannot approve them on the human's behalf.
82
+ - Memory is project-scoped and deliberately retrieved. Agent Mesh does not
83
+ semantically inject every past record into every prompt or provide
84
+ multi-tenant access control inside one project store.
85
+ - The Workbench is served only on the local loopback interface and uses a
86
+ private access token. It is a local UI, not a hosted Agent Mesh service.
87
+
88
+ ## What Agent Mesh records
89
+
90
+ Behind those views, the durable project record includes:
91
+
92
+ - **Requests and responses** with bodies, status history, participants,
93
+ timestamps, and thread relationships.
94
+ - **Long-lived AI-agent instances** with stable IDs, human-friendly labels,
95
+ provider and workstream metadata, per-event attribution, and direct request or
96
+ backlog ownership. This distinguishes two Claude chats in the same project
97
+ without pretending they are different providers.
98
+ - **Human feedback** with its severity, target, references, and paths to any
99
+ locally stored attachments.
100
+ - **Backlog work** with descriptions, priorities, lanes, owners, relationships,
101
+ notes, and activity history.
102
+ - **Decisions** with proposals, revisions, lifecycle status, human approval
103
+ identity and notes, affected paths, required checks, and verification results.
104
+ - **Provenance and settings** with source and causal links, body fidelity,
105
+ project identity, participant aliases, routing defaults, and sharing mode.
106
+
107
+ Ordinary conversation is not copied automatically. A human or agent promotes a
108
+ concise request, decision, or material result when it should survive the chat.
109
+
110
+ ## How it works
111
+
112
+ The canonical source of truth is `.agent-mesh/events.jsonl`, an append-only,
113
+ hash-linked event log. Longer bodies may be stored as separate files addressed
114
+ by content hash. A SQLite database and optional Markdown views are derived from
115
+ the log and can be rebuilt. The `agent-mesh` CLI and local browser Workbench are
116
+ the supported write surfaces; `agent-q` provides bounded reads for humans and
117
+ agents. Repository locking and crash recovery make concurrent local writers
118
+ safe.
119
+
120
+ The hash chain is tamper-evident, not encryption or cryptographic identity
121
+ proof. Corrections are recorded as new events so history remains auditable.
122
+
123
+ For parallel agent chats, an instance ID can remain stable across days and
124
+ process restarts. A case-study agent can create a REQ or backlog item addressed
125
+ to a specific design-system agent, and the receiving chat can retrieve the
126
+ canonical packet by ID. The chat must keep supplying its assigned ID; Agent Mesh
127
+ cannot infer provider chat continuity or preserve the provider's context window.
128
+
129
+ ## Status
130
+
131
+ Pre-1.0. The command and storage contracts may still change before a stable
132
+ release. Agent Mesh is implemented with the Python standard library and has no
133
+ required hosted service, model provider, database server, or third-party runtime
134
+ dependency.
135
+
136
+ ## Installation and releases
137
+
138
+ Install a published PyPI release with:
139
+
140
+ ```bash
141
+ python -m pip install my-agent-mesh
142
+ ```
143
+
144
+ See the [changelog](https://github.com/cbalgeman/agent-mesh/blob/main/CHANGELOG.md)
145
+ for release notes. Maintainers use the documented
146
+ [release procedure](https://github.com/cbalgeman/agent-mesh/blob/main/docs/releasing.md).
147
+
148
+ ## Verify the published source
149
+
150
+ The public repository includes a privacy-reviewed contract pack covering the
151
+ request/response smoke flow, hash-chain tamper detection, decision lifecycle
152
+ stop-lines, and local-only versus Git-shared privacy behavior. Run the same
153
+ checks used by public CI with:
154
+
155
+ ```bash
156
+ python -m pip install -e ".[test]"
157
+ python -m ruff check src tests/public
158
+ python -m pytest -q
159
+ ```
160
+
161
+ Public CI runs this pack on the supported Python 3.11 and 3.12 versions. The
162
+ larger development suite is deliberately not copied into the curated repository.
163
+
164
+ ## Support
165
+
166
+ Use [GitHub Issues](https://github.com/cbalgeman/agent-mesh/issues) for bug
167
+ reports, feature requests, and usage questions. Do not include credentials,
168
+ private repository content, or local `.agent-mesh/` state in a public issue.
169
+
170
+ ## License
171
+
172
+ MIT. See `LICENSE`.
173
+
174
+ ## Human Users can stop reading here
175
+
176
+ You now have the information needed to decide whether Agent Mesh fits your
177
+ workflow. To adopt it, give your coding agent access to the Agent Mesh repository
178
+ and the repository you want to adopt, then send this instruction:
179
+
180
+ ```text
181
+ Adopt Agent Mesh in the target repository. Read the AI Agent guide below, then
182
+ read docs/adoption.md and docs/privacy.md. Inspect the target repository, ask me
183
+ only for choices you cannot safely infer, complete the setup, and return the
184
+ Workbench bookmark and verification results. Do not accept decisions or enable
185
+ Git sharing on my behalf.
186
+ ```
187
+
188
+ Everything after this line is written exclusively for the AI Agent performing
189
+ the adoption and ongoing project work.
190
+
191
+ ---
192
+
193
+ # AI Agent guide
194
+
195
+ ## AI Agent experience
196
+
197
+ Agent Mesh is model- and runtime-neutral. It gives you, the agent working in the
198
+ repository, a stable contract and bounded retrieval tools. A project may also
199
+ configure an optional, explicit runtime profile for Agent Mesh to dispatch work
200
+ to an external agent executable; a participant identity alone never selects or
201
+ launches a model.
202
+
203
+ - The managed repository contract tells you which records are canonical, when
204
+ to create a REQ or material RES, how to read applicable decisions, and which
205
+ actions remain human-only.
206
+ - `agent-q packet --id <REQ-or-RES-id>` retrieves bounded thread context;
207
+ `agent-q backlog get <BKL-id>` retrieves a work item; and
208
+ `agent-q decisions show <D-id>` retrieves canonical decision metadata,
209
+ status, affected paths, checks, and verification state.
210
+ - Process a feedback REQ by retrieving it, recording findings on the same
211
+ thread, and creating or linking backlog work when implementation is needed.
212
+ Preserve the REQ as the provenance-bearing source for any derived backlog
213
+ items.
214
+ - Write durable changes through the CLI or Workbench and verify the resulting
215
+ record. You may propose or revise decisions but must never approve one for the
216
+ human.
217
+
218
+ ### Address long-lived agent instances
219
+
220
+ Use an agent-instance identity when multiple long-running chats share one
221
+ participant or provider but own different workstreams. Register each chat once,
222
+ then launch or resume it from an environment that binds all of its Agent Mesh
223
+ writes to the stable ID or label:
224
+
225
+ ```bash
226
+ agent-mesh instance register --participant claude --provider anthropic \
227
+ --label claude-case-study --workstream case-study
228
+ agent-mesh instance register --participant claude --provider anthropic \
229
+ --label claude-design --workstream design-system
230
+
231
+ export AGENT_MESH_INSTANCE_ID=claude-case-study
232
+ # launch or resume the intended agent from this shell
233
+ ```
234
+
235
+ If the environment cannot persist with the chat, put the global option before
236
+ every subcommand. The same binding makes a cross-instance handoff explicit:
237
+
238
+ ```bash
239
+ agent-mesh --instance claude-case-study request --from claude \
240
+ --to-instance claude-design \
241
+ "Fix the design token" "The case study exposed a shared styling issue."
242
+
243
+ agent-mesh --instance claude-case-study backlog create --actor claude \
244
+ --owner-instance claude-design --title "Normalize the design token"
245
+
246
+ agent-q list --to-instance claude-design --status open
247
+ agent-q backlog list --owner-instance claude-design
248
+ ```
249
+
250
+ Once a participant has an active registered instance, unbound new events from
251
+ that participant fail instead of falling back to provider-only attribution.
252
+ Specific-instance REQs are not launched by generic runtime dispatch, because a
253
+ dispatcher cannot safely recreate an existing provider chat. Relay the REQ ID
254
+ to the named chat, which retrieves it with `agent-q packet --id <REQ-id>`.
255
+
256
+ The identity is durable Agent Mesh state, not cryptographic authentication or a
257
+ copy of chat context. A resumed multi-day chat keeps its identity only when its
258
+ environment, wrapper, or instructions continue supplying the same ID. See
259
+ `docs/agent-instances.md` for lifecycle, privacy, and retirement details.
260
+
261
+ ### Keep durable context beside important code
262
+
263
+ Place a short Agent Mesh reference in a code comment when a non-obvious
264
+ constraint should remain beside the code it governs while pointing to the fuller
265
+ canonical record:
266
+
267
+ ```text
268
+ # <D-id>: preserve direct human approval; do not automate this transition.
269
+ # <BKL-id>: remove this compatibility path after the linked migration closes.
270
+ ```
271
+
272
+ Include the one-line rationale, not only a bare ID. This lets the next human or
273
+ agent understand why the comment matters before retrieving the decision,
274
+ request, or work item.
275
+
276
+ This is a reliable but bounded feature today. Human-readable decision IDs,
277
+ REQ/RES IDs, backlog IDs, and AI-agent instance IDs resolve through Agent Mesh
278
+ query commands, and
279
+ `agent-mesh check refs` can scan tracked code and fail on a dangling decision,
280
+ request, response, backlog, or instance reference. The managed repository contract also
281
+ requires you to consult canonical decisions before a related durable choice.
282
+
283
+ The references are validated pointers, not automatic enforcement. Agent Mesh
284
+ does not yet guarantee that every agent harness will inject a referenced record,
285
+ rerun retrieval when a file is edited, detect a semantic contradiction, or
286
+ enforce every affected decision before commit. Opt the repository into the
287
+ reference check in local hooks or CI, follow the managed contract, and retrieve
288
+ the cited record before changing the governed behavior.
289
+
290
+ ## First-Time Adoption Instructions
291
+
292
+ Read `docs/adoption.md` before initializing a target repository. Inspect the
293
+ target yourself, summarize only the setup decisions that require human input,
294
+ and wait for the human's response. After the human responds, record the durable
295
+ choices as Proposed decisions. The human then directly approves each decision
296
+ in Workbench, or by running the interactive CLI acceptance command; never accept
297
+ a decision on the human's behalf. Continue setup after acceptance and verify the
298
+ records in Workbench's Decisions tab. Keep all `.agent-mesh/` state local by
299
+ default; sharing canonical state through Git is a separate explicit onboarding
300
+ choice.
301
+
302
+ ## Manual Quickstart
303
+
304
+ ```bash
305
+ pip install my-agent-mesh
306
+ cd ~/your-project
307
+ agent-mesh init --participants human,agent --default-sender human --default-recipient agent
308
+ agent-mesh adopt --repo .
309
+ agent-mesh adopt --repo . --check
310
+ agent-mesh request --to agent "Review the auth refactor"
311
+ agent-q list --status open
312
+ agent-q packet --id <REQ-id>
313
+ agent-mesh workbench --repo .
314
+ ```
315
+
316
+ The quickstart uses the privacy-first `local-only` default. It causes a normal
317
+ `git add -A` to select no `.agent-mesh/` path. Use
318
+ `--state-sharing git-shared` only after approving Git access to the canonical
319
+ config, event log, and externalized bodies. See `docs/privacy.md` before sharing
320
+ a repository or changing this setting.
321
+
322
+ ## Automatic Workbench
323
+
324
+ The recommended adoption flow installs one automatic Workbench service for the
325
+ current user:
326
+
327
+ ```bash
328
+ agent-mesh workbench service install --repo . --open
329
+ ```
330
+
331
+ The command is idempotent and uses `launchd` on macOS, `systemd --user` on Linux,
332
+ or Task Scheduler on Windows. The service starts at sign-in and restarts after a
333
+ failure. It serves every valid repo in the machine-local Workbench registry, so
334
+ adopting another project does not create another background process. After an
335
+ agent installs it, the human can use the stable machine-local bookmark printed
336
+ by the command without opening a terminal. Reinstalling from another project or
337
+ restarting the service refreshes that same bookmark. Use
338
+ `agent-mesh workbench service open` whenever the bookmark is not already saved;
339
+ `service status` prints both its exact path and the open command. Use `start`,
340
+ `restart`, or `uninstall` for lifecycle management. Installing or refreshing the
341
+ service also turns the anchor repo's old project-local bookmark into a token-free
342
+ pointer to the managed bookmark. The manual
343
+ `agent-mesh workbench --repo .` command remains the fallback when the native user
344
+ supervisor is unavailable.
345
+
346
+ `agent-q packet` returns bounded, thread-scoped JSON for grounding an agent on a
347
+ request or response. `agent-mesh workbench` starts a small local UI and writes a
348
+ bookmarkable `.agent-mesh/workbench.html` file for the project. Its Decisions tab
349
+ creates Proposed decisions, appends revisions, and records explicit human
350
+ acceptance. Editing an accepted or in-force decision requires a reason and
351
+ returns it to Proposed until it is accepted again. Repository Markdown decision
352
+ logs are optional generated compatibility views, never separate writable
353
+ tracking surfaces.
354
+
355
+ `agent-mesh init` automatically registers the repo in the machine-local
356
+ Workbench registry and reports when the managed agent contract is incomplete.
357
+ `agent-mesh adopt` installs a versioned contract in applicable agent instruction
358
+ files; `agent-mesh adopt --check` detects stale contracts and conflicting legacy
359
+ decision-write guidance. The Workbench shows the same contract health signal.
360
+
361
+ The repository selector can switch among registered repos, and the server
362
+ resolves its opaque repo ID before feedback, request-status, backlog, attachment,
363
+ or decision operations. The bookmark is static, while live reads and writes
364
+ require the loopback server. With the automatic service, native supervision and
365
+ the page's reconnect loop keep that server available. If a service restart leaves
366
+ an already-open page with the prior token, the page reloads the latest private
367
+ bookmark once; a successful health check resets that bounded recovery for the
368
+ next restart. The browser never executes a shell command. Feedback submits use retry-safe receipts so an uncertain retry
369
+ returns the original REQ instead of creating a duplicate. A per-server access
370
+ token and restricted browser origins protect the local mutation APIs
371
+ automatically. The server is loopback-only, the HTTP launch URL carries its token
372
+ only in a URL fragment, and the managed token-bearing bookmark is private (`0600`
373
+ on macOS/Linux) and stored outside project repositories. Manual project bookmarks
374
+ remain ignored by Git.
375
+
376
+ ## Configuration
377
+
378
+ Project-local configuration lives in `.agent-mesh/config.toml`. See `docs/configuration.md` for the supported config surface, including how to add a new agent/participant to an existing project without rewriting historical events. Long-lived chat identities are documented in `docs/agent-instances.md`. Privacy and Git-tracking behavior are documented in `docs/privacy.md`.
379
+
380
+ ## Agent-Driven Adoption
381
+
382
+ For first-time setup in a real repository, start with `docs/adoption.md`. It is
383
+ written for the coding agent: it tells the agent how to inspect the target repo,
384
+ ask only for missing project-local input, initialize `.agent-mesh/`, verify the
385
+ chain, start the Workbench, and give the human a bookmarkable Workbench path.
386
+
387
+ ## Migrating Existing Workflows
388
+
389
+ If you already coordinate through scripts, markdown files, issue trackers, or
390
+ chat logs, see `docs/migration.md`. The recommended path is shadow-first:
391
+ inventory the current workflow, import into `.agent-mesh/`, preserve source
392
+ provenance, let agents review a dry-run, and keep old surfaces as projections
393
+ until the chain and compatibility views are verified.
394
+
395
+ Project-specific importers should live in the consumer repository. `agent-mesh`
396
+ ships the generic substrate, recovery reports, projections, and review commands.
397
+
398
+ ## Examples
399
+
400
+ ```bash
401
+ bash examples/solo-project/run.sh
402
+ N=3 bash examples/n-agent/run.sh
403
+ ```
404
+
405
+ ## Layout
406
+
407
+ ```text
408
+ src/agent_mesh/
409
+ ├── core/ # events.jsonl, lock, recovery, hashing
410
+ ├── store/ # SQLite schema + queries
411
+ ├── views/ # rendered inbox/outbox/archive
412
+ ├── cli/ # agent-mesh + agent-q CLIs
413
+ └── config.py # .agent-mesh/config.toml loader
414
+
415
+ examples/
416
+ ├── solo-project/ # 1 agent, simple use
417
+ └── n-agent/ # parameterized N-agent flow
418
+ ```