@discovery-tree/runner 0.1.3 → 0.1.4
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 +9 -1
- package/dist/cli.js +32 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -118,9 +118,17 @@ could not do it. What it may do without asking:
|
|
|
118
118
|
`cargo` and `go` run code**, from the repository (package scripts, build files, tests) or
|
|
119
119
|
written by the agent, so this list amounts to arbitrary code execution as you. It keeps the
|
|
120
120
|
agent from stalling on every command; it is not a sandbox.
|
|
121
|
+
Also on it, the `gh` commands that only read (`gh pr view/diff/checks/list/status`,
|
|
122
|
+
`gh run view/list`, `gh issue view/list`, `gh repo view`), so the agent can see the pull
|
|
123
|
+
request Discovery Tree opened from its branch, its checks and review comments. They run as
|
|
124
|
+
your `gh` login and can read whatever it can. Install the [GitHub CLI](https://cli.github.com)
|
|
125
|
+
and run `gh auth login` for them to work; `doctor` checks.
|
|
121
126
|
Left off on purpose: `WebFetch` and `WebSearch` (the easiest way for a manipulated agent to
|
|
122
127
|
send data out), `find` (`-exec`), `sed`, `cp`, `mv` (they can write anywhere; the Edit and
|
|
123
|
-
Write tools cover changes in the worktree)
|
|
128
|
+
Write tools cover changes in the worktree), `git push` (the runner pushes) and `gh` commands
|
|
129
|
+
that change GitHub, `gh api` included (Discovery Tree opens the pull request). Add, say,
|
|
130
|
+
`"Bash(gh pr comment *)"` to `extraAllowedTools` if you want the agent to reply on its pull
|
|
131
|
+
request as you.
|
|
124
132
|
- **The deny list** (`--disallowedTools`, which wins over the allow-list): the agent's file
|
|
125
133
|
tools may not read or edit `~/.ssh`, `~/.aws`, `~/.config/gcloud`, `~/.azure`, `~/.gnupg`,
|
|
126
134
|
`~/.netrc`, `~/.git-credentials`, `~/.config/gh`, `~/.docker/config.json`, `~/.kube`,
|
package/dist/cli.js
CHANGED
|
@@ -33,7 +33,7 @@ var RUNNER_EVENT_TEXT_MAX_LENGTH = 64e3;
|
|
|
33
33
|
var RUNNER_EVENTS_MAX_BODY_BYTES = 8 * 1024 * 1024;
|
|
34
34
|
|
|
35
35
|
// src/version.ts
|
|
36
|
-
var RUNNER_VERSION = true ? "0.1.
|
|
36
|
+
var RUNNER_VERSION = true ? "0.1.4" : "0.0.0-dev";
|
|
37
37
|
var RUNNER_PLATFORM = `${process.platform}-${process.arch}`;
|
|
38
38
|
|
|
39
39
|
// src/api.ts
|
|
@@ -331,7 +331,13 @@ function runnerSystemPrompt(input) {
|
|
|
331
331
|
"Commit your work to this branch as you go, with clear, descriptive commit messages.",
|
|
332
332
|
"Do not push, do not switch, create or delete branches, and do not rewrite commits that may",
|
|
333
333
|
"already be pushed: the runner commits anything left over and pushes this branch for you",
|
|
334
|
-
"at the end of every turn."
|
|
334
|
+
"at the end of every turn.",
|
|
335
|
+
"Do not open a pull request either: Discovery Tree opens it from this branch when a turn",
|
|
336
|
+
"ends, with that turn\u2019s final message as its description, and later turns add to it.",
|
|
337
|
+
"Before then (your first turn) there is none; say so rather than trying to open one.",
|
|
338
|
+
`To read it, use \`gh pr view ${input.workBranch}\` (\`--comments\` for the conversation),`,
|
|
339
|
+
"`gh pr diff`, `gh pr checks`, and `gh run view` for a check run\u2019s logs. Only `gh` commands",
|
|
340
|
+
"that read are allowed; ones that change GitHub (comment, edit, merge, `gh api`) are denied."
|
|
335
341
|
].join(" ");
|
|
336
342
|
}
|
|
337
343
|
|
|
@@ -403,6 +409,16 @@ var DEFAULT_ALLOWED_TOOLS = [
|
|
|
403
409
|
"Bash(git stash *)",
|
|
404
410
|
"Bash(git blame *)",
|
|
405
411
|
"Bash(git grep *)",
|
|
412
|
+
"Bash(gh pr view *)",
|
|
413
|
+
"Bash(gh pr diff *)",
|
|
414
|
+
"Bash(gh pr checks *)",
|
|
415
|
+
"Bash(gh pr list *)",
|
|
416
|
+
"Bash(gh pr status *)",
|
|
417
|
+
"Bash(gh run view *)",
|
|
418
|
+
"Bash(gh run list *)",
|
|
419
|
+
"Bash(gh issue view *)",
|
|
420
|
+
"Bash(gh issue list *)",
|
|
421
|
+
"Bash(gh repo view *)",
|
|
406
422
|
"Bash(npm *)",
|
|
407
423
|
"Bash(npx *)",
|
|
408
424
|
"Bash(pnpm *)",
|
|
@@ -2485,6 +2501,20 @@ async function runDoctor(env = process.env) {
|
|
|
2485
2501
|
} catch {
|
|
2486
2502
|
checks.push({ name: "git", level: "fail", detail: "git is not installed (or not on PATH)" });
|
|
2487
2503
|
}
|
|
2504
|
+
try {
|
|
2505
|
+
const res = await exec("gh", ["auth", "status"], { timeoutMs: 1e4 });
|
|
2506
|
+
checks.push({
|
|
2507
|
+
name: "GitHub CLI",
|
|
2508
|
+
level: res.code === 0 ? "ok" : "warn",
|
|
2509
|
+
detail: res.code === 0 ? "signed in: the agent can read its pull request, checks and runs" : "not signed in: run `gh auth login` so the agent can read its pull request"
|
|
2510
|
+
});
|
|
2511
|
+
} catch {
|
|
2512
|
+
checks.push({
|
|
2513
|
+
name: "GitHub CLI",
|
|
2514
|
+
level: "warn",
|
|
2515
|
+
detail: "not installed (no `gh` on PATH): the agent cannot read its pull request; see https://cli.github.com"
|
|
2516
|
+
});
|
|
2517
|
+
}
|
|
2488
2518
|
const bin = await findClaude(env);
|
|
2489
2519
|
if (!bin) {
|
|
2490
2520
|
checks.push({
|
package/package.json
CHANGED