agentdir-cli 0.7.5__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 (83) hide show
  1. agentdir_cli-0.7.5/LICENSE +21 -0
  2. agentdir_cli-0.7.5/MANIFEST.in +9 -0
  3. agentdir_cli-0.7.5/PKG-INFO +393 -0
  4. agentdir_cli-0.7.5/README.md +360 -0
  5. agentdir_cli-0.7.5/docs/AGENTIC_CODING.md +305 -0
  6. agentdir_cli-0.7.5/docs/DEMO.md +111 -0
  7. agentdir_cli-0.7.5/docs/INSTALL.md +271 -0
  8. agentdir_cli-0.7.5/docs/PI_PACKAGE.md +64 -0
  9. agentdir_cli-0.7.5/docs/PRD.md +653 -0
  10. agentdir_cli-0.7.5/docs/RELEASING.md +113 -0
  11. agentdir_cli-0.7.5/docs/TECH_BRIEF.md +596 -0
  12. agentdir_cli-0.7.5/docs/assets/agentdir-overview.png +0 -0
  13. agentdir_cli-0.7.5/docs/investigations/2026-05-12-cross-repo-ergonomics-lanes.md +729 -0
  14. agentdir_cli-0.7.5/docs/investigations/2026-05-12-rag-vector-scenarios.md +383 -0
  15. agentdir_cli-0.7.5/docs/releases/v0.1.0.md +46 -0
  16. agentdir_cli-0.7.5/docs/releases/v0.1.1.md +31 -0
  17. agentdir_cli-0.7.5/docs/releases/v0.2.0.md +31 -0
  18. agentdir_cli-0.7.5/docs/releases/v0.3.0.md +33 -0
  19. agentdir_cli-0.7.5/docs/releases/v0.3.1.md +31 -0
  20. agentdir_cli-0.7.5/docs/releases/v0.3.2.md +17 -0
  21. agentdir_cli-0.7.5/docs/releases/v0.3.3.md +17 -0
  22. agentdir_cli-0.7.5/docs/releases/v0.3.4.md +17 -0
  23. agentdir_cli-0.7.5/docs/releases/v0.4.0.md +22 -0
  24. agentdir_cli-0.7.5/docs/releases/v0.5.0.md +42 -0
  25. agentdir_cli-0.7.5/docs/releases/v0.5.1.md +42 -0
  26. agentdir_cli-0.7.5/docs/releases/v0.5.2.md +36 -0
  27. agentdir_cli-0.7.5/docs/releases/v0.5.3.md +29 -0
  28. agentdir_cli-0.7.5/docs/releases/v0.6.0.md +33 -0
  29. agentdir_cli-0.7.5/docs/releases/v0.7.0.md +37 -0
  30. agentdir_cli-0.7.5/docs/releases/v0.7.1.md +30 -0
  31. agentdir_cli-0.7.5/docs/releases/v0.7.2.md +25 -0
  32. agentdir_cli-0.7.5/docs/releases/v0.7.3.md +40 -0
  33. agentdir_cli-0.7.5/docs/releases/v0.7.4.md +45 -0
  34. agentdir_cli-0.7.5/docs/releases/v0.7.5.md +53 -0
  35. agentdir_cli-0.7.5/examples/dogfood-session.sh +147 -0
  36. agentdir_cli-0.7.5/package.json +34 -0
  37. agentdir_cli-0.7.5/pyproject.toml +54 -0
  38. agentdir_cli-0.7.5/scripts/install.sh +156 -0
  39. agentdir_cli-0.7.5/scripts/rollback.sh +61 -0
  40. agentdir_cli-0.7.5/setup.cfg +4 -0
  41. agentdir_cli-0.7.5/skills/agentdir/SKILL.md +65 -0
  42. agentdir_cli-0.7.5/src/agentdir/__init__.py +3 -0
  43. agentdir_cli-0.7.5/src/agentdir/__main__.py +6 -0
  44. agentdir_cli-0.7.5/src/agentdir/actors.py +50 -0
  45. agentdir_cli-0.7.5/src/agentdir/artifacts.py +56 -0
  46. agentdir_cli-0.7.5/src/agentdir/audit.py +339 -0
  47. agentdir_cli-0.7.5/src/agentdir/capture.py +187 -0
  48. agentdir_cli-0.7.5/src/agentdir/cli.py +1900 -0
  49. agentdir_cli-0.7.5/src/agentdir/context.py +654 -0
  50. agentdir_cli-0.7.5/src/agentdir/control.py +729 -0
  51. agentdir_cli-0.7.5/src/agentdir/daemon.py +253 -0
  52. agentdir_cli-0.7.5/src/agentdir/doctor.py +115 -0
  53. agentdir_cli-0.7.5/src/agentdir/envelope.py +147 -0
  54. agentdir_cli-0.7.5/src/agentdir/events.py +72 -0
  55. agentdir_cli-0.7.5/src/agentdir/federation.py +530 -0
  56. agentdir_cli-0.7.5/src/agentdir/git.py +45 -0
  57. agentdir_cli-0.7.5/src/agentdir/gitignore.py +106 -0
  58. agentdir_cli-0.7.5/src/agentdir/hooks.py +215 -0
  59. agentdir_cli-0.7.5/src/agentdir/index.py +362 -0
  60. agentdir_cli-0.7.5/src/agentdir/mailbox.py +84 -0
  61. agentdir_cli-0.7.5/src/agentdir/memory.py +1274 -0
  62. agentdir_cli-0.7.5/src/agentdir/query.py +65 -0
  63. agentdir_cli-0.7.5/src/agentdir/redaction.py +42 -0
  64. agentdir_cli-0.7.5/src/agentdir/rendering.py +89 -0
  65. agentdir_cli-0.7.5/src/agentdir/replay.py +31 -0
  66. agentdir_cli-0.7.5/src/agentdir/retention.py +319 -0
  67. agentdir_cli-0.7.5/src/agentdir/review.py +288 -0
  68. agentdir_cli-0.7.5/src/agentdir/secrets.py +158 -0
  69. agentdir_cli-0.7.5/src/agentdir/sessions.py +171 -0
  70. agentdir_cli-0.7.5/src/agentdir/skills.py +685 -0
  71. agentdir_cli-0.7.5/src/agentdir/store.py +270 -0
  72. agentdir_cli-0.7.5/src/agentdir/upgrade.py +252 -0
  73. agentdir_cli-0.7.5/src/agentdir_cli.egg-info/PKG-INFO +393 -0
  74. agentdir_cli-0.7.5/src/agentdir_cli.egg-info/SOURCES.txt +81 -0
  75. agentdir_cli-0.7.5/src/agentdir_cli.egg-info/dependency_links.txt +1 -0
  76. agentdir_cli-0.7.5/src/agentdir_cli.egg-info/entry_points.txt +2 -0
  77. agentdir_cli-0.7.5/src/agentdir_cli.egg-info/requires.txt +15 -0
  78. agentdir_cli-0.7.5/src/agentdir_cli.egg-info/top_level.txt +1 -0
  79. agentdir_cli-0.7.5/tests/test_agent_first.py +724 -0
  80. agentdir_cli-0.7.5/tests/test_audit.py +397 -0
  81. agentdir_cli-0.7.5/tests/test_pi_package.py +39 -0
  82. agentdir_cli-0.7.5/tests/test_v1_behavior.py +737 -0
  83. agentdir_cli-0.7.5/tests/test_vector_memory.py +713 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 AgentDir 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,9 @@
1
+ include LICENSE
2
+ include README.md
3
+ include package.json
4
+ recursive-include docs *.md
5
+ recursive-include skills *.md
6
+ recursive-include docs *.png
7
+ recursive-include examples *.sh
8
+ recursive-include scripts *.sh
9
+ recursive-include tests *.py
@@ -0,0 +1,393 @@
1
+ Metadata-Version: 2.4
2
+ Name: agentdir-cli
3
+ Version: 0.7.5
4
+ Summary: Local-first Maildir-inspired work mailstore for software agents
5
+ Author: AgentDir Contributors
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/jstxn/agentdir
8
+ Project-URL: Repository, https://github.com/jstxn/agentdir
9
+ Project-URL: Issues, https://github.com/jstxn/agentdir/issues
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3 :: Only
15
+ Classifier: Topic :: Software Development
16
+ Classifier: Topic :: System :: Archiving
17
+ Requires-Python: >=3.11
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+ Requires-Dist: platformdirs>=4.2
21
+ Requires-Dist: rich>=13.7
22
+ Provides-Extra: watch
23
+ Requires-Dist: watchfiles>=0.21; extra == "watch"
24
+ Provides-Extra: semantic
25
+ Requires-Dist: fastembed>=0.4; extra == "semantic"
26
+ Requires-Dist: sqlite-vec>=0.1; extra == "semantic"
27
+ Provides-Extra: team
28
+ Requires-Dist: qdrant-client>=1.9; extra == "team"
29
+ Requires-Dist: lancedb>=0.9; extra == "team"
30
+ Requires-Dist: opentelemetry-api>=1.24; extra == "team"
31
+ Requires-Dist: opentelemetry-sdk>=1.24; extra == "team"
32
+ Dynamic: license-file
33
+
34
+ # AgentDir
35
+
36
+ <p align="center">
37
+ <img src="docs/assets/agentdir-overview.png" alt="AgentDir turns agent work into a saved trail, searchable memory, and proof for engineers." />
38
+ </p>
39
+
40
+ <p align="center">
41
+ <strong>Local-first memory and evidence for agentic engineering.</strong>
42
+ </p>
43
+
44
+ AgentDir is a flight recorder for coding agents. It lets agents record what
45
+ happened during a software task, then gives engineers a clean way to inspect,
46
+ replay, search, and audit that work later.
47
+
48
+ The goal is simple: AgentDir should be nearly invisible while you work.
49
+
50
+ Engineers should not have to manually start sessions, wrap commands, collect
51
+ evidence, or maintain agent memory by hand. Once a repository is adopted, the
52
+ agent operates AgentDir in the background and leaves behind a useful trail.
53
+
54
+ ## Why AgentDir Exists
55
+
56
+ Agentic engineering has a trust gap.
57
+
58
+ Agents can edit code, run tools, and summarize results, but their work often
59
+ ends up scattered across chat history, terminal scrollback, temporary files, and
60
+ unverified final claims. That makes it hard to answer basic questions:
61
+
62
+ - What did the agent actually do?
63
+ - Which commands support the final answer?
64
+ - Were tests, builds, lint, or release checks really run?
65
+ - What context did the agent retrieve and rely on?
66
+ - Can a future agent learn from this session?
67
+ - Can the index or memory layer be rebuilt if it breaks?
68
+
69
+ AgentDir gives those answers a local, durable home.
70
+
71
+ ## What You Get
72
+
73
+ | Capability | What it means |
74
+ | --- | --- |
75
+ | Invisible agent workflow | Agents run AgentDir commands during normal work, so engineers keep using their coding assistant normally. |
76
+ | Evidence-backed claims | Test, build, lint, typecheck, doctor, and release claims can be checked against recorded tool results. |
77
+ | Replayable sessions | Inspect the task, decisions, commands, outputs, blockers, summaries, and handoffs after the fact. |
78
+ | Local-first storage | Records live in the repo-local `.agentdir` directory by default. No hosted service is required. |
79
+ | Rebuildable memory | Raw event files are the source of truth. SQLite search and memory indexes can be rebuilt. |
80
+ | Context lineage | Agents can emit context packs, then record which retrieved sources were consumed or cited. |
81
+ | Cross-repo memory | Explicitly registered AgentDir roots can be searched together without moving canonical records. |
82
+ | Secret-aware persistence | Common secret-like patterns are redacted before storage, with scan and cleanup commands for older records. |
83
+
84
+ ## The Invisible Workflow
85
+
86
+ AgentDir is designed around a small separation of responsibility.
87
+
88
+ | Human does | Agent does |
89
+ | --- | --- |
90
+ | Install AgentDir once. | Start and finish AgentDir sessions. |
91
+ | Run `agentdir adopt` once per repo. | Capture evidence-bearing commands with `agentdir run`. |
92
+ | Ask the coding agent to do work. | Record decisions, blockers, context, and handoffs. |
93
+ | Inspect evidence only when needed. | Audit session quality and final claims before reporting. |
94
+
95
+ In day-to-day use, the human workflow stays the same:
96
+
97
+ ```text
98
+ Ask the agent to do the task.
99
+ Review the result.
100
+ Use AgentDir only when you want the trail.
101
+ ```
102
+
103
+ The agent handles the recording surface:
104
+
105
+ ```bash
106
+ agentdir work start "fix checkout failure" --emit-context
107
+ agentdir run -- pytest -q
108
+ agentdir audit session
109
+ agentdir work finish --json
110
+ ```
111
+
112
+ ## Install
113
+
114
+ Install from PyPI (the package is `agentdir-cli`; the command it installs is
115
+ `agentdir`):
116
+
117
+ ```bash
118
+ uv tool install agentdir-cli
119
+ # or
120
+ pipx install agentdir-cli
121
+ ```
122
+
123
+ Or use the GitHub Release installer:
124
+
125
+ ```bash
126
+ curl -fsSL https://raw.githubusercontent.com/jstxn/agentdir/main/scripts/install.sh | bash
127
+ ```
128
+
129
+ The installer uses `pipx` when available. Otherwise it creates a self-contained
130
+ virtual environment under `~/.local/share/agentdir` and links the CLI into
131
+ `~/.local/bin`.
132
+
133
+ Verify:
134
+
135
+ ```bash
136
+ agentdir --version
137
+ agentdir --help
138
+ ```
139
+
140
+ ## Pi Package
141
+
142
+ Pi users can install this repository as a Pi package so the AgentDir skill is
143
+ available automatically during coding tasks:
144
+
145
+ Package page: [@jstxn/agentdir-pi](https://pi.dev/packages/@jstxn/agentdir-pi)
146
+
147
+ ```bash
148
+ pi install npm:@jstxn/agentdir-pi@0.7.5
149
+ # or install directly from a local checkout / release tag:
150
+ pi install /absolute/path/to/agentdir
151
+ pi install git:github.com/jstxn/agentdir@<tag-or-commit>
152
+ ```
153
+
154
+ The package exposes `skills/agentdir/SKILL.md`; it teaches Pi to start AgentDir
155
+ sessions, wrap evidence-bearing commands, use local memory/context packs, and
156
+ produce evidence-aware handoffs. See [AgentDir Pi Package](docs/PI_PACKAGE.md)
157
+ for details.
158
+
159
+ ## Adopt A Repository
160
+
161
+ Run once from a git repository:
162
+
163
+ ```bash
164
+ agentdir adopt
165
+ ```
166
+
167
+ This is intentionally boring setup. It prepares the repository once, then agents
168
+ operate AgentDir during normal coding work:
169
+
170
+ - creates the repo-local `.agentdir` store
171
+ - installs AgentDir-managed git hook shims
172
+ - installs the Codex skill into the user skill directory
173
+ - writes managed project guidance for common agent tools
174
+ - asks interactive users whether `.agentdir/` should be added to the project or
175
+ user-level Git ignore file
176
+ - runs `doctor` to confirm the store is healthy
177
+
178
+ After that, agents have the guidance they need to use AgentDir without the
179
+ engineer manually operating it during normal work.
180
+
181
+ Preview setup without writing anything:
182
+
183
+ ```bash
184
+ agentdir adopt --dry-run --json
185
+ ```
186
+
187
+ If you want generated integration files to stay inside the AgentDir store
188
+ instead of project instruction files:
189
+
190
+ ```bash
191
+ agentdir adopt --install-skill store --install-generic store --integration-target store
192
+ ```
193
+
194
+ For non-interactive installs, choose the ignore destination explicitly:
195
+
196
+ ```bash
197
+ agentdir adopt --gitignore project # write <repo>/.gitignore
198
+ agentdir adopt --gitignore user # write the user-level Git excludes file
199
+ agentdir adopt --gitignore none # leave ignore files unchanged
200
+ ```
201
+
202
+ Undo managed setup while keeping the `.agentdir` evidence store:
203
+
204
+ ```bash
205
+ agentdir unadopt # dry-run
206
+ agentdir unadopt --apply # remove managed hooks and guidance
207
+ ```
208
+
209
+ ## What Gets Written
210
+
211
+ Default adoption writes only local files:
212
+
213
+ ```text
214
+ <repo>/.agentdir/ # evidence, artifacts, indexes, state
215
+ <repo>/.git/hooks/* # managed hook shims with backups
216
+ <repo>/AGENTS.md # generic / Codex-readable guidance
217
+ <repo>/CLAUDE.md # Claude Code guidance
218
+ <repo>/.github/copilot-instructions.md # Copilot guidance
219
+ <repo>/.cursor/rules/agentdir.mdc # Cursor guidance
220
+ <repo>/.windsurf/rules/agentdir.md # Windsurf guidance
221
+ ~/.codex/skills/agentdir/SKILL.md # Codex skill, by default
222
+ ```
223
+
224
+ Managed guidance is wrapped in AgentDir markers. Existing unmanaged content is
225
+ preserved where the target format supports managed blocks.
226
+
227
+ ## Inspect A Session
228
+
229
+ Most users will not need these commands every day, but they are the reason
230
+ AgentDir exists.
231
+
232
+ ```bash
233
+ agentdir status
234
+ agentdir evidence --brief
235
+ agentdir timeline
236
+ agentdir report final --format json
237
+ agentdir replay
238
+ agentdir memory search "checkout failure"
239
+ ```
240
+
241
+ For final-answer support:
242
+
243
+ ```bash
244
+ agentdir audit session
245
+ agentdir audit claims --text final-response.md
246
+ ```
247
+
248
+ Audits are advisory by default. Use `--strict` when unsupported or contradicted
249
+ claims should fail a check.
250
+
251
+ ## How AgentDir Works
252
+
253
+ AgentDir has one source of truth and several rebuildable views:
254
+
255
+ ```text
256
+ raw envelopes -> SQLite index -> memory/search/audit/report
257
+ ^
258
+ |
259
+ rebuilt from envelopes
260
+ ```
261
+
262
+ 1. **Raw envelopes**
263
+ Each meaningful event is stored as an immutable file in a Maildir-inspired
264
+ directory layout. These files are the source of truth.
265
+ 2. **Derived indexes**
266
+ SQLite indexes, search tables, memory passages, context packs, and audit
267
+ views are derived from the raw event files and can be rebuilt.
268
+
269
+ Default project layout:
270
+
271
+ ```text
272
+ <repo>/.agentdir/
273
+ sessions/
274
+ actors/
275
+ artifacts/
276
+ archives/
277
+ indexes/agentdir.sqlite3
278
+ state/
279
+ integrations/
280
+ ```
281
+
282
+ The important property is recoverability: deleting the derived index does not
283
+ destroy the session. AgentDir can rebuild from the envelope store.
284
+
285
+ The agent-facing report surface is JSON. `agentdir report final --format json`
286
+ and `agentdir work finish --json` include an `agent_handoff` object with
287
+ verification evidence, failed evidence, claim support, context lineage, known
288
+ gaps, and recommended next agent actions.
289
+
290
+ ## Unique Capabilities
291
+
292
+ ### Claims-To-Evidence Checks
293
+
294
+ AgentDir can compare final-response claims such as "tests passed" or "build
295
+ passed" against the latest recorded tool results. It does this with
296
+ deterministic heuristics, not an LLM.
297
+
298
+ Supported claim families:
299
+
300
+ - test
301
+ - lint
302
+ - typecheck
303
+ - build
304
+ - doctor
305
+ - release
306
+
307
+ ### Context Packs
308
+
309
+ Agents can package retrieved context into auditable source manifests:
310
+
311
+ ```bash
312
+ agentdir context build "checkout failure" --emit
313
+ agentdir context consume --pack <pack-id> --source <source-id> --purpose plan
314
+ agentdir context cite --pack <pack-id>
315
+ agentdir audit context --pack <pack-id>
316
+ ```
317
+
318
+ This does not prove a model paid attention, but it does make cooperative agent
319
+ behavior visible.
320
+
321
+ ### Local Agent Memory
322
+
323
+ AgentDir builds searchable local memory from prior sessions. Agents can search
324
+ similar work, explain why a memory hit matched, and include relevant history in
325
+ new context packs.
326
+
327
+ ```bash
328
+ agentdir memory search "release evidence"
329
+ agentdir memory explain "release evidence"
330
+ agentdir context build "release evidence" --emit
331
+ ```
332
+
333
+ Optional semantic extras exist, but the default path does not require a vector
334
+ database or external embedding service.
335
+
336
+ ### Federated Memory
337
+
338
+ For multi-repo work, AgentDir can search explicitly registered roots:
339
+
340
+ ```bash
341
+ agentdir roots register ../other-repo --name other-repo
342
+ agentdir memory search --federated "release evidence"
343
+ ```
344
+
345
+ Each repository remains the canonical owner of its own `.agentdir` store.
346
+
347
+ ## Safety Model
348
+
349
+ AgentDir is local-first and advisory by design.
350
+
351
+ - It records what agents choose to record.
352
+ - It does not replace code review or CI.
353
+ - It does not send data to a hosted AgentDir service.
354
+ - It treats raw envelopes as the source of truth.
355
+ - It redacts common secret-like patterns before persistence.
356
+ - It provides `secrets scan` and `secrets redact --apply` for cleanup.
357
+
358
+ Useful commands:
359
+
360
+ ```bash
361
+ agentdir doctor
362
+ agentdir secrets scan
363
+ agentdir secrets redact
364
+ agentdir secrets redact --apply
365
+ ```
366
+
367
+ ## Upgrade And Rollback
368
+
369
+ Upgrade an existing install and refresh current repo adoption:
370
+
371
+ ```bash
372
+ agentdir --upgrade
373
+ ```
374
+
375
+ Rollback to the previous stable release:
376
+
377
+ ```bash
378
+ curl -fsSL https://raw.githubusercontent.com/jstxn/agentdir/main/scripts/rollback.sh | bash
379
+ ```
380
+
381
+ ## Learn More
382
+
383
+ - [Install Guide](docs/INSTALL.md)
384
+ - [Agentic Coding Guide](docs/AGENTIC_CODING.md)
385
+ - [Technical Brief](docs/TECH_BRIEF.md)
386
+ - [Release Guide](docs/RELEASING.md)
387
+ - [PRD](docs/PRD.md)
388
+
389
+ ## Project Status
390
+
391
+ AgentDir is beta software for local-first agentic engineering workflows. The
392
+ core model is stable: agents operate the recorder, engineers get the evidence,
393
+ and raw local envelopes remain the recoverable source of truth.