@jstxn/agentdir-pi 0.7.4 → 0.7.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # AgentDir
2
2
 
3
3
  <p align="center">
4
- <img src="docs/assets/agentdir-overview.png" alt="AgentDir turns agent work into a saved trail, searchable memory, and proof for engineers." />
4
+ <img src="https://raw.githubusercontent.com/jstxn/agentdir/main/docs/assets/agentdir-overview.png" alt="AgentDir turns agent work into a saved trail, searchable memory, and proof for engineers." />
5
5
  </p>
6
6
 
7
7
  <p align="center">
@@ -78,23 +78,25 @@ agentdir work finish --json
78
78
 
79
79
  ## Install
80
80
 
81
- AgentDir is distributed through GitHub Releases. For the private
82
- `jstxn/agentdir` repo, authenticate GitHub CLI first:
81
+ Install from PyPI (the package is `agentdir-cli`; the command it installs is
82
+ `agentdir`):
83
83
 
84
84
  ```bash
85
- gh auth login
85
+ uv tool install agentdir-cli
86
+ # or
87
+ pipx install agentdir-cli
86
88
  ```
87
89
 
88
- Install the latest release:
90
+ Or use the GitHub Release installer:
89
91
 
90
92
  ```bash
91
- gh api -H "Accept: application/vnd.github.raw" \
92
- 'repos/jstxn/agentdir/contents/scripts/install.sh?ref=v0.7.4' | bash
93
+ curl -fsSL https://raw.githubusercontent.com/jstxn/agentdir/main/scripts/install.sh | bash
93
94
  ```
94
95
 
95
96
  The installer uses `pipx` when available. Otherwise it creates a self-contained
96
97
  virtual environment under `~/.local/share/agentdir` and links the CLI into
97
- `~/.local/bin`.
98
+ `~/.local/bin`. It does not edit Git configuration or ignore files; after
99
+ installation it prints the explicit adoption choices.
98
100
 
99
101
  Verify:
100
102
 
@@ -103,6 +105,16 @@ agentdir --version
103
105
  agentdir --help
104
106
  ```
105
107
 
108
+ Update an existing install to the latest release and refresh adoption for the
109
+ current repository:
110
+
111
+ ```bash
112
+ agentdir update
113
+ agentdir update --dry-run
114
+ ```
115
+
116
+ The older `agentdir --upgrade` interface remains supported for compatibility.
117
+
106
118
  ## Pi Package
107
119
 
108
120
  Pi users can install this repository as a Pi package so the AgentDir skill is
@@ -111,7 +123,7 @@ available automatically during coding tasks:
111
123
  Package page: [@jstxn/agentdir-pi](https://pi.dev/packages/@jstxn/agentdir-pi)
112
124
 
113
125
  ```bash
114
- pi install npm:@jstxn/agentdir-pi@0.7.4
126
+ pi install npm:@jstxn/agentdir-pi@0.7.8
115
127
  # or install directly from a local checkout / release tag:
116
128
  pi install /absolute/path/to/agentdir
117
129
  pi install git:github.com/jstxn/agentdir@<tag-or-commit>
@@ -130,6 +142,13 @@ Run once from a git repository:
130
142
  agentdir adopt
131
143
  ```
132
144
 
145
+ Coding agents use the non-interactive form below so `.agentdir/` is ignored at
146
+ the user level without creating a repository `.gitignore` change:
147
+
148
+ ```bash
149
+ agentdir adopt --gitignore user
150
+ ```
151
+
133
152
  This is intentionally boring setup. It prepares the repository once, then agents
134
153
  operate AgentDir during normal coding work:
135
154
 
@@ -157,6 +176,16 @@ instead of project instruction files:
157
176
  agentdir adopt --install-skill store --install-generic store --integration-target store
158
177
  ```
159
178
 
179
+ Adoption adapts to repos where other tools own these files. When
180
+ [rulesync](https://github.com/dyoshikawa/rulesync) generates the guidance
181
+ files, the managed rule is written to `.rulesync/rules/agentdir.md` instead so
182
+ it survives regeneration, and files with generated-file headers are never
183
+ edited without `--force`. When lefthook, husky, or pre-commit own the Git
184
+ hooks, adopt warns up front, `agentdir doctor` flags hook shims those tools
185
+ later overwrite, and `agentdir hooks install` restores them. See
186
+ [docs/INSTALL.md](docs/INSTALL.md#coexisting-with-rule-generators-and-hook-managers)
187
+ for details.
188
+
160
189
  For non-interactive installs, choose the ignore destination explicitly:
161
190
 
162
191
  ```bash
@@ -165,6 +194,10 @@ agentdir adopt --gitignore user # write the user-level Git excludes file
165
194
  agentdir adopt --gitignore none # leave ignore files unchanged
166
195
  ```
167
196
 
197
+ Generated AgentDir guidance selects `--gitignore user` by default. The plain
198
+ interactive command still prompts, and all three explicit choices remain
199
+ available.
200
+
168
201
  Undo managed setup while keeping the `.agentdir` evidence store:
169
202
 
170
203
  ```bash
@@ -178,17 +211,22 @@ Default adoption writes only local files:
178
211
 
179
212
  ```text
180
213
  <repo>/.agentdir/ # evidence, artifacts, indexes, state
181
- <repo>/.git/hooks/* # managed hook shims with backups
214
+ <repo>/.agentdir/hooks.json # installed-hook drift manifest
215
+ <active-hooks-directory>/* # managed hook shims with backups
182
216
  <repo>/AGENTS.md # generic / Codex-readable guidance
183
217
  <repo>/CLAUDE.md # Claude Code guidance
184
218
  <repo>/.github/copilot-instructions.md # Copilot guidance
185
219
  <repo>/.cursor/rules/agentdir.mdc # Cursor guidance
186
220
  <repo>/.windsurf/rules/agentdir.md # Windsurf guidance
221
+ <repo>/.rulesync/rules/agentdir.md # rulesync source, when detected
187
222
  ~/.codex/skills/agentdir/SKILL.md # Codex skill, by default
188
223
  ```
189
224
 
190
225
  Managed guidance is wrapped in AgentDir markers. Existing unmanaged content is
191
- preserved where the target format supports managed blocks.
226
+ preserved where the target format supports managed blocks. The active hooks
227
+ directory is `.git/hooks` by default and follows `core.hooksPath` or linked
228
+ worktree configuration. In rulesync repos, the source rule replaces the listed
229
+ project guidance files as the managed source of truth.
192
230
 
193
231
  ## Inspect A Session
194
232
 
@@ -341,8 +379,7 @@ agentdir --upgrade
341
379
  Rollback to the previous stable release:
342
380
 
343
381
  ```bash
344
- gh api -H "Accept: application/vnd.github.raw" \
345
- 'repos/jstxn/agentdir/contents/scripts/rollback.sh?ref=v0.7.4' | bash
382
+ curl -fsSL https://raw.githubusercontent.com/jstxn/agentdir/main/scripts/rollback.sh | bash
346
383
  ```
347
384
 
348
385
  ## Learn More
@@ -9,7 +9,9 @@ skills/agentdir/SKILL.md
9
9
 
10
10
  The skill teaches Pi to start AgentDir sessions, wrap evidence-bearing shell
11
11
  commands, use local memory/context packs, and produce evidence-aware handoffs.
12
- It does not install the `agentdir` CLI; install AgentDir separately first.
12
+ It also tells Pi to adopt unprepared repositories with `--gitignore user`, so
13
+ the local store stays out of Git without changing project files. It does not
14
+ install the `agentdir` CLI; install AgentDir separately first.
13
15
 
14
16
  ## Install
15
17
 
@@ -34,7 +36,7 @@ pi install git:github.com/jstxn/agentdir@<tag-or-commit>
34
36
  If the npm package has been published:
35
37
 
36
38
  ```bash
37
- pi install npm:@jstxn/agentdir-pi@0.7.4
39
+ pi install npm:@jstxn/agentdir-pi@0.7.8
38
40
  ```
39
41
 
40
42
  Use `pi config` to enable or disable the bundled skill after installation.
@@ -48,7 +50,7 @@ The root `package.json` declares the Pi resources:
48
50
  "keywords": ["pi-package"],
49
51
  "pi": {
50
52
  "skills": ["./skills"],
51
- "image": "https://raw.githubusercontent.com/jstxn/agentdir/v0.7.4/docs/assets/agentdir-overview.png"
53
+ "image": "https://raw.githubusercontent.com/jstxn/agentdir/v0.7.8/docs/assets/agentdir-overview.png"
52
54
  }
53
55
  }
54
56
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jstxn/agentdir-pi",
3
- "version": "0.7.4",
3
+ "version": "0.7.8",
4
4
  "description": "Pi package for AgentDir local-first coding-agent memory and evidence capture.",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -29,6 +29,6 @@
29
29
  "skills": [
30
30
  "./skills"
31
31
  ],
32
- "image": "https://raw.githubusercontent.com/jstxn/agentdir/v0.7.4/docs/assets/agentdir-overview.png"
32
+ "image": "https://raw.githubusercontent.com/jstxn/agentdir/v0.7.8/docs/assets/agentdir-overview.png"
33
33
  }
34
34
  }
@@ -21,7 +21,7 @@ This Pi package teaches Pi how to operate AgentDir. It does not install the `age
21
21
 
22
22
  At the start of a non-trivial coding task in a software repository:
23
23
 
24
- 1. If `.agentdir` is missing, run `agentdir adopt` once before work begins.
24
+ 1. If `.agentdir` is missing, run `agentdir adopt --gitignore user` once so the local store stays out of Git without changing the repository's `.gitignore`.
25
25
  2. Start the session with `agentdir work start "<short task>" --emit-context`.
26
26
  3. Keep any returned context pack id/source ids if you plan to cite or consume retrieved context later.
27
27
 
@@ -56,6 +56,14 @@ Use `agentdir evidence --brief` and `agentdir timeline` to skim what has been re
56
56
 
57
57
  Emit important plans, blockers, diffs, review decisions, and final handoffs as immutable events when they matter for future replay or audit.
58
58
 
59
+ ## Exit Codes And Structured Errors
60
+
61
+ - 0 success; `agentdir run` passes through the wrapped command's exit code (124 = `--timeout` kill).
62
+ - 2 user error, 3 state error (no root / no active session), 4 missing dependency, 5 configuration error.
63
+ - State errors name the recovery command in the message (`agentdir adopt`, `agentdir work start`).
64
+ - Add `--json` to get a `{"success": false, "exit_code": ..., "error_code": ...}` envelope on failure; add `--quiet` for exit-code-only checks.
65
+ - `agentdir run --session require` fails fast instead of auto-creating a session; `--session create` forces a fresh one.
66
+
59
67
  ## Finish Work
60
68
 
61
69
  Before the final response, run `agentdir work finish --json` when practical. Read the `agent_handoff` object before making final verification claims.