@discovery-tree/runner 0.1.4 → 0.1.6
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 +40 -1
- package/dist/cli.js +1050 -676
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -123,8 +123,23 @@ could not do it. What it may do without asking:
|
|
|
123
123
|
request Discovery Tree opened from its branch, its checks and review comments. They run as
|
|
124
124
|
your `gh` login and can read whatever it can. Install the [GitHub CLI](https://cli.github.com)
|
|
125
125
|
and run `gh auth login` for them to work; `doctor` checks.
|
|
126
|
+
Also on it, what an agent needs to start a dev server and check it: `cd`, `sleep`, `lsof`
|
|
127
|
+
and `TaskStop` (stops a command started with the Bash tool's background option). The agent
|
|
128
|
+
checks the server with `node -e "fetch('http://localhost:<port>/', …)"` (60-second timeout), which the `node` rule
|
|
129
|
+
already allows; there is no `curl` rule, because none keeps `curl` local (a second URL,
|
|
130
|
+
userinfo, `-x`, `--resolve`, `-K`). Not `kill`: the process holding a port may be yours; the
|
|
131
|
+
agent is told to use another port. A server started this way ends with the Claude Code
|
|
132
|
+
process (at most `idleTimeoutMinutes` after the last turn, or when the runner stops): Claude
|
|
133
|
+
Code runs in a process group of its own, and the runner ends what is left in it however
|
|
134
|
+
Claude Code exited. An interrupted turn leaves it running (unless Claude Code does not
|
|
135
|
+
answer the interrupt and the SIGINT the runner then sends ends it). It can be left running
|
|
136
|
+
only if it moves itself out of that group (`setsid`, a daemon), if the runner itself is
|
|
137
|
+
killed with SIGKILL (or the computer loses power), or on Windows, where there are no
|
|
138
|
+
process groups, when Claude Code exits on its own and leaves it behind.
|
|
126
139
|
Left off on purpose: `WebFetch` and `WebSearch` (the easiest way for a manipulated agent to
|
|
127
|
-
send data out), `
|
|
140
|
+
send data out), `curl`, `kill`, `docker` and `sudo` (to start a database: run it
|
|
141
|
+
yourself beforehand, or add `"Bash(docker compose *)"` to `extraAllowedTools`; Docker access
|
|
142
|
+
is close to root on most machines), `find` (`-exec`), `sed`, `cp`, `mv` (they can write anywhere; the Edit and
|
|
128
143
|
Write tools cover changes in the worktree), `git push` (the runner pushes) and `gh` commands
|
|
129
144
|
that change GitHub, `gh api` included (Discovery Tree opens the pull request). Add, say,
|
|
130
145
|
`"Bash(gh pr comment *)"` to `extraAllowedTools` if you want the agent to reply on its pull
|
|
@@ -196,6 +211,30 @@ url."git@my-alias:".insteadOf "git@github.com:"`), which git applies after the r
|
|
|
196
211
|
5. When Discovery Tree closes the session, the worktree is removed (`git worktree remove --force`).
|
|
197
212
|
The branch stays, locally and on the remote.
|
|
198
213
|
|
|
214
|
+
### Screenshots
|
|
215
|
+
|
|
216
|
+
Discovery Tree asks for a screenshot of every user-visible change, in the pull request
|
|
217
|
+
description. A hosted agent's platform keeps the images it captures; on your computer they are
|
|
218
|
+
files nobody else can open, and GitHub has no API for pull request attachments. So the runner
|
|
219
|
+
publishes them:
|
|
220
|
+
|
|
221
|
+
1. The agent saves images (PNG, JPEG, GIF, WebP; up to 12 a turn, 8 MB each) in `.dt-evidence/`
|
|
222
|
+
at the root of its worktree. The folder is listed in the clone's `.git/info/exclude`, so
|
|
223
|
+
neither the agent's commits nor the runner's commit of leftovers include it.
|
|
224
|
+
2. At the end of the turn, after the work branch is pushed, the runner commits them to a branch of
|
|
225
|
+
their own, `dt-evidence/<workBranch>` with `/` written `%2F` (built with `git hash-object`/`commit-tree`, without
|
|
226
|
+
touching the worktree), and pushes it. The images never merge with the change.
|
|
227
|
+
3. It adds a `## Screenshots` section to the turn's final message, linking each image as
|
|
228
|
+
`https://github.com/<owner>/<repo>/raw/<commit>/<file>`. That message becomes the pull request
|
|
229
|
+
description, where the images render for anyone who can read the repository, and Discovery
|
|
230
|
+
Tree's review inbox reads them through its GitHub App. Published images move to
|
|
231
|
+
`.dt-evidence/published/`. On a later turn, when the pull request is already open,
|
|
232
|
+
Discovery Tree adds that turn's screenshots to the end of its description.
|
|
233
|
+
|
|
234
|
+
The `dt-evidence/…` branches stay on the remote; delete one (`git push origin --delete
|
|
235
|
+
dt-evidence/<branch>`) once its pull request is closed. Its images stop showing after GitHub
|
|
236
|
+
cleans up the commits.
|
|
237
|
+
|
|
199
238
|
A session without a repository runs in an empty scratch directory.
|
|
200
239
|
|
|
201
240
|
State lives under `$XDG_STATE_HOME/discovery-tree/runner` (usually `~/.local/state/…`): one folder
|