@devtune/agentpicks 0.2.0 → 0.4.0
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 +230 -10
- package/dist/cli.js +81365 -70073
- package/package.json +5 -2
- package/schema/setup.v1.json +521 -0
package/README.md
CHANGED
|
@@ -7,6 +7,8 @@ Apache-2.0.
|
|
|
7
7
|
```sh
|
|
8
8
|
npx @devtune/agentpicks login
|
|
9
9
|
npx @devtune/agentpicks run --category error-tracking --stack nextjs
|
|
10
|
+
npx @devtune/agentpicks init # writes a setup file, such as agentpicks/error-tracking.yaml
|
|
11
|
+
npx @devtune/agentpicks run error-tracking # runs agentpicks/error-tracking.yaml; see Setups
|
|
10
12
|
npm install -g @devtune/agentpicks # then: agentpicks run ...
|
|
11
13
|
```
|
|
12
14
|
|
|
@@ -15,7 +17,7 @@ npm install -g @devtune/agentpicks # then: agentpicks run ...
|
|
|
15
17
|
- Docker, running. Each run uses a fresh container with 2 CPUs and 4 GB of memory, needs 20 GB free on Docker's disk and may write up to 15 GB there. The image is built for your machine's own architecture, x86_64 or arm64, so nothing is emulated.
|
|
16
18
|
- Node.js 20 or later.
|
|
17
19
|
- A coding agent installed and signed in: Claude Code, Codex, OpenCode or Pi.
|
|
18
|
-
- To upload, a DevTune project API key with the Agent Picks Run scope, on an Agent Picks Local Runner, Cloud or Enterprise plan. See [Upload](#upload). `--no-upload` needs neither.
|
|
20
|
+
- To upload, a DevTune sign-in or project API key with the Agent Picks Run scope, on an Agent Picks Local Runner, Cloud or Enterprise plan; Visibility too for a linked setup file, a DevTune setup's name or a category, and Actions Write for a category the project has no copy of yet. See [Upload](#upload). `--no-upload` needs neither.
|
|
19
21
|
|
|
20
22
|
## Run
|
|
21
23
|
|
|
@@ -34,10 +36,14 @@ agentpicks run --category error-tracking --repo .
|
|
|
34
36
|
| `--agent` | `claude-code`, `codex`, `opencode` or `pi`. Required when several are installed. |
|
|
35
37
|
| `--model` | The model to ask for. OpenCode and Pi take `anthropic/<model>` or `openai/<model>`. |
|
|
36
38
|
| `--out` | Where bundles go. Default `./agentpicks-runs`. |
|
|
37
|
-
| `--no-upload` | Keep bundles on this machine only. Send them later with `agentpicks upload
|
|
39
|
+
| `--no-upload` | Keep bundles on this machine only. Send them later with `agentpicks upload`, except a custom setup's (see [Setups](#setups)). |
|
|
40
|
+
|
|
41
|
+
`agentpicks --help`, or `--help` after any command, prints the usage and exits successfully.
|
|
38
42
|
|
|
39
43
|
Each run asks the category's `add` request. An unknown category, stack or agent is refused with the valid values. Cursor is refused: there is no capture for its runs yet.
|
|
40
44
|
|
|
45
|
+
Uploading, `--category` runs the project's own copy of the category, as `agentpicks run <copy>` runs it with the same flags, so its runs upload under the copy and are listed on it. Without `--agent`, it runs the copy's agents. If the project has no copy, `run` creates one first, with the category's default stacks and the agent the run uses, and prints its name and the `agentpicks pull <name>` that writes it as a file. If the project has several, it runs the one named after the category, else the first DevTune lists, and says which. If the copy asks an add request of its own, `run` refuses it before Docker starts: anyone who can edit the setup in DevTune could change that request, and the agent runs it with your keys. `agentpicks pull` it, commit the file and run that. Reading the project's setups needs the Visibility scope, and creating a copy needs Actions Write; if DevTune refuses either, `run` stops before Docker starts and says how to fix it. With `--no-upload`, `--category` runs the public category itself.
|
|
46
|
+
|
|
41
47
|
### Your repository
|
|
42
48
|
|
|
43
49
|
`--repo <path>` tests the git repository at that path at one commit: `HEAD`, or `--ref`. Every run copies that commit's committed files into its container, read from git's object store: never the working tree, and never `.git`, so no history, remotes, hooks or config. Your checkout is only read. The agent's changes are diffed against that commit's files.
|
|
@@ -81,21 +87,44 @@ Claude Code on macOS keeps its sign-in in the Keychain, which `agentpicks` never
|
|
|
81
87
|
|
|
82
88
|
```sh
|
|
83
89
|
agentpicks login
|
|
84
|
-
agentpicks login --
|
|
90
|
+
agentpicks login --no-browser
|
|
91
|
+
agentpicks login --api-key [--project <project id>]
|
|
85
92
|
agentpicks upload ./agentpicks-runs
|
|
86
93
|
agentpicks upload ./agentpicks-runs/<run id>
|
|
87
94
|
```
|
|
88
95
|
|
|
89
|
-
`agentpicks login`
|
|
96
|
+
`agentpicks login` signs in to DevTune in your browser, where you choose the project and approve its scopes. Uploading needs Agent Picks Run; `login` prints every scope the sign-in holds. If no browser opens, or with `--no-browser`, it prints the address: open it in a browser on the same machine. The sign-in is renewed when it expires. Before anything starts, `run` and `upload` ask DevTune what the sign-in may do now, and stop, saying to log in again, if DevTune refuses to renew it or it lacks Agent Picks Run. If DevTune can't be reached or is briefly unavailable, they warn and carry on, and the upload checks again. If a renewal's answer is lost, so DevTune may have renewed the sign-in without `agentpicks` saving it, they stop; run `login` again. A sign-in revoked during a long `run`, or one DevTune no longer renews, is refused at upload, and the bundle stays on disk. Uploads act as the signed-in member, who needs DevTune management permission on the account and edit rights on the project.
|
|
97
|
+
|
|
98
|
+
`agentpicks login --api-key` reads a project API key from standard input instead: paste it at the prompt, which doesn't echo it, or pipe it in. Create the key under **API Keys** in DevTune, with the **Agent Picks Run** scope. `login` asks DevTune which project the key belongs to, which needs the key's Project Read scope too; with `--project`, it saves the key for that project without asking.
|
|
90
99
|
|
|
91
|
-
|
|
100
|
+
Either login is saved to `agentpicks/credentials.json` under `$XDG_CONFIG_HOME`, or else `%APPDATA%` on Windows and `~/.config` elsewhere, in a file with mode 0600, so only your user can read it, and replaces the other. `agentpicks` never prints a key or token.
|
|
92
101
|
|
|
93
|
-
|
|
102
|
+
In CI, set `DEVTUNE_API_KEY` and `DEVTUNE_PROJECT_ID` instead: they override the saved login. Without `DEVTUNE_API_KEY`, a saved sign-in is used only for its own API address and project. `DEVTUNE_API_BASE_URL` sets the API address, default `https://devtune.ai/api/v2`. These are the names the `devtune` CLI reads.
|
|
103
|
+
|
|
104
|
+
`run` checks for a sign-in or key before anything starts, and refuses without one. Once a run's bundle is written, `run` lists its files, their sizes and the redactions, then uploads it: the manifest to DevTune, and each artifact straight to storage. It prints the run id and the upload's API address. If DevTune refuses the upload, `run` prints DevTune's reason and the command that sends the bundle later, and starts no further runs. The bundle stays on disk either way.
|
|
94
105
|
|
|
95
106
|
A `--repo` run needs the repository to have a remote that `agentpicks` records (see [The bundle](#the-bundle)), since DevTune groups a repository's runs by its remote. Without one, `run` refuses before anything starts; add an `origin` remote, or pass `--no-upload`.
|
|
96
107
|
|
|
97
108
|
`agentpicks upload` takes one bundle directory, or the `--out` directory of `run`, and uploads every bundle in it. Uploading a bundle again is safe: an upload that stopped partway sends only the artifacts DevTune hasn't stored, and one that completed is left as it is. A bundle whose files changed after it was written is refused before anything is sent.
|
|
98
109
|
|
|
110
|
+
### Results
|
|
111
|
+
|
|
112
|
+
```sh
|
|
113
|
+
agentpicks results
|
|
114
|
+
agentpicks results ./agentpicks-runs ./ci-runs --json
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
`agentpicks results` prints a row for each run in `./agentpicks-runs`, or the directories named: its run id, setup or category, agent, model and pick, then how many runs in each setup picked each tool. The pick is read from the bundle with the early-stop patterns the run recorded, in the order the early stop checks them: the packages the agent added that the patterns name, else the first added line of code they match, else a config file the agent created that they match. The pick shows the package names, the code or the file, not a tool name. A run with no pick shows `none`. A run shows `Unmeasured`, with the reason printed under the counts, when:
|
|
118
|
+
|
|
119
|
+
- its bundle fails its checks, or was written before `agentpicks` recorded a run's early-stop patterns;
|
|
120
|
+
- a check is unread, because its package files or diff weren't captured or the diff was cut at its size limit, and no check before it found a pick;
|
|
121
|
+
- the early stop saw a pick during the run that the final files no longer show by the same check: a package for an install, or code or a config file for code;
|
|
122
|
+
- no check found a pick, and the setup measures a catalogue tool its early stop doesn't hold (one it names by key, or one its DevTune setup measures beside your tool and competitors), whose signals only DevTune has.
|
|
123
|
+
|
|
124
|
+
`--json` prints the rows as JSON. A directory with no bundle in it exits 1.
|
|
125
|
+
|
|
126
|
+
What an agent said it picked, and rates across runs, come from DevTune's analysis of an uploaded run.
|
|
127
|
+
|
|
99
128
|
### Clean up
|
|
100
129
|
|
|
101
130
|
```sh
|
|
@@ -104,6 +133,197 @@ agentpicks cleanup
|
|
|
104
133
|
|
|
105
134
|
Removes every container and image `agentpicks` made: all are labelled `dev.devtune.agentpicks`. The sandbox image is built from `docker/Dockerfile` the first time, tagged with this package's version; building a new version's image removes the older ones.
|
|
106
135
|
|
|
136
|
+
## Setups
|
|
137
|
+
|
|
138
|
+
A setup is what you test, kept as a YAML file in your repository: one file per setup in the `agentpicks` folder at the repository root (the git root above where you run `agentpicks`). A setup's name is its file name without `.yaml` or `.yml`.
|
|
139
|
+
|
|
140
|
+
```sh
|
|
141
|
+
agentpicks init
|
|
142
|
+
agentpicks init --yes
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
`agentpicks init` writes a setup file from a few questions. Each shows its default in brackets, and Enter takes it:
|
|
146
|
+
|
|
147
|
+
- **Job**: a built-in category, which the file inherits with `from:`, or a job line of your own. The default is the category of your tool.
|
|
148
|
+
- **Your tool**: a catalogue tool named by your `package.json` name or scope, or your git remote's repository or owner, such as `sentry` from `getsentry/sentry-docs`.
|
|
149
|
+
- **Competitors**: for a category, its tools; for your own job, typed as npm packages.
|
|
150
|
+
- **Where to test**: `repo: .` in a git repository, else the stacks your `package.json` and lockfiles name (`next`, `@tanstack/react-start`, `@sveltejs/kit` and `express`, a pnpm monorepo's apps included, plus FastAPI and Rails).
|
|
151
|
+
- **Agents**: those installed here that `run` could start now, with their sign-in or key.
|
|
152
|
+
- **Runs** and the setup's **name**.
|
|
153
|
+
|
|
154
|
+
For a custom setup, run `agentpicks push <setup>` before running it with uploads.
|
|
155
|
+
|
|
156
|
+
Signed in with `agentpicks login`, or with `DEVTUNE_API_KEY` and `DEVTUNE_PROJECT_ID` set, a job of your own is drafted by DevTune: its requests, its competitors, and each tool's packages and config names. Drafts count against your project's hourly draft allowance. If DevTune refuses a draft or can't be reached, `init` prints one warning and asks for the rest itself.
|
|
157
|
+
|
|
158
|
+
`init` checks the file as `validate` does before writing it; on a terminal it asks again until the file passes. It won't replace a setup of the same name without `--force`. `--yes` takes every default without asking, and fails, naming what it couldn't detect, when there's no default for the job or where to test. Off a terminal, `init` needs `--yes`.
|
|
159
|
+
|
|
160
|
+
`agentpicks/error-tracking.yaml` tests the built-in error tracking category:
|
|
161
|
+
|
|
162
|
+
```yaml
|
|
163
|
+
job: Add error tracking
|
|
164
|
+
from: error-tracking
|
|
165
|
+
stacks: [nextjs]
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
`agentpicks/feature-flags.yaml` tests a job of your own:
|
|
169
|
+
|
|
170
|
+
```yaml
|
|
171
|
+
job: Add feature flags
|
|
172
|
+
requests:
|
|
173
|
+
add: Add feature flags to this app, and put a new checkout page behind one.
|
|
174
|
+
tools:
|
|
175
|
+
own:
|
|
176
|
+
key: acme-flags
|
|
177
|
+
name: Acme Flags
|
|
178
|
+
domain: acme.dev
|
|
179
|
+
signals:
|
|
180
|
+
packages:
|
|
181
|
+
npm: ['@acme/flags']
|
|
182
|
+
configNames: [ACME_FLAGS_KEY]
|
|
183
|
+
competitors:
|
|
184
|
+
- key: launchdarkly
|
|
185
|
+
name: LaunchDarkly
|
|
186
|
+
domain: launchdarkly.com
|
|
187
|
+
signals:
|
|
188
|
+
packages:
|
|
189
|
+
npm: ['@launchdarkly/node-server-sdk', launchdarkly-node-server-sdk]
|
|
190
|
+
configNames: [LAUNCHDARKLY_SDK_KEY]
|
|
191
|
+
stacks: [nextjs, express]
|
|
192
|
+
agents: [claude-code, codex]
|
|
193
|
+
runs: 3
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
| Field | |
|
|
197
|
+
|---|---|
|
|
198
|
+
| `job` | The job line, which labels the setup; a run asks `requests.add`. Required without `from`. |
|
|
199
|
+
| `from` | A built-in category, as `--category` takes it. The setup inherits its job, requests and tools. |
|
|
200
|
+
| `requests` | One request per intent: `add`, `recommend`, `hosted` and `improve`, each one line of 8 to 300 characters that names none of the setup's own tools. A run asks `add`, which a setup without `from` must give. With `from`, `null` leaves out the category's request of that intent, except `add`. |
|
|
201
|
+
| `tools` | `own`, your tool, and `competitors`. Each is the key of a tool in DevTune's catalogue (`sentry`), or a full entry: `key`, `name` and `signals`, and optionally `domain`. A full entry's key can't be one of the `from` category's. A setup without `from` needs at least one tool and, when it gives any tool its own signals, a package or config name on one that doesn't yield to another tool in the setup. A setup from a category that names a catalogue tool its category doesn't measure is custom. |
|
|
202
|
+
| `signals` | How a tool is recognised: `packages` by `npm`, `pypi` or `gem` (a name ending in `*` matches every package that starts with the text before the `*`, and one ending in `/` every package under that scope or path, so `@acme/` matches `@acme/flags`), `configNames` (environment variable names or API hosts, not starting with `-`), and `importPatterns`, `configFiles`, `configPatterns`, `commandPatterns`, `selfHosted` (patterns of up to 200 characters that RE2 compiles), `aliases`, `brandDomains`, `frameworkBuiltIn`, `yieldsTo` and `receivesFrom`. Give at least one package, config name or pattern. Tools can't yield to each other in a loop. |
|
|
203
|
+
| `stacks` | Starter apps to test in, as `--stack` takes them, each once. A setup without `from` can't use `nextjs-github-actions`, `fastapi-aws` or `rails-own-servers-eu`, which run in some categories only or carry a deploy context. |
|
|
204
|
+
| `repo` | Your repository, in place of `stacks`: a path relative to the repository root, such as `.`, or `path` and `ref`. |
|
|
205
|
+
| `agents` | `claude-code`, `codex`, `opencode` or `pi`, each once and installed on the machine that runs it. Without `agents`, the one agent installed runs. |
|
|
206
|
+
| `runs` | Runs per agent and stack. Default 1. |
|
|
207
|
+
| `id` | The DevTune setup the file is linked to. `pull` and `push` write it. |
|
|
208
|
+
| `synced` | What the file and its DevTune setup held when they last matched: `setup`, the setup's digest, and `file`, the file's. `pull` and `push` write it; don't edit it. |
|
|
209
|
+
|
|
210
|
+
`schema/setup.v1.json` in this package is the file's JSON Schema. An editor with YAML support completes and checks a setup file against it, for example with a first line `# yaml-language-server: $schema=<path or URL of setup.v1.json>`.
|
|
211
|
+
|
|
212
|
+
```sh
|
|
213
|
+
agentpicks run feature-flags --no-upload
|
|
214
|
+
agentpicks run agentpicks/feature-flags.yaml --agent codex --runs 1 --no-upload
|
|
215
|
+
agentpicks run
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
`agentpicks run <setup>` takes the setup's name or the path of its file. Each run asks the setup's `add` request, once per agent and stack. Claude Code's early stop watches for the `from` category's tools and for the package and config names of the setup's own tools; a tool that yields to another tool in the setup (`yieldsTo`) doesn't stop it, and nor does a tool named by key alone, so a setup whose tools are all named by key isn't stopped early. Flags override the file: `--stack` or `--repo` replaces its stacks or repo, `--ref` its commit, `--agent` its agents, and `--runs` its runs. `--model` sets one agent's model, so a setup with several agents needs `--agent` with it. On a terminal, `agentpicks run` with no setup and no `--category` lists the setups and asks which to run.
|
|
219
|
+
|
|
220
|
+
A setup file linked to a DevTune setup (it has an `id`) uploads under that setup. An unlinked setup `from` a category, with no requests or tool signals of its own, uploads as that category. Naming the category's tools under `tools` doesn't change that. Any other setup is custom, and can't share its name with a built-in category: until `agentpicks push` saves it to DevTune, `run` refuses to start it without `--no-upload`, and `upload` refuses its bundles. A run of a linked file whose DevTune setup is gone is refused before it starts, and so is a run of a linked file with changes not pushed (push it first) or whose DevTune setup changed since the file last saw it (pull it first). DevTune refuses an upload whose prompt isn't its setup's current request, as `prompt_mismatch`. With `--no-upload`, such a run's bundles record the unpushed changes, and `upload` refuses them.
|
|
221
|
+
|
|
222
|
+
```sh
|
|
223
|
+
agentpicks list
|
|
224
|
+
agentpicks validate
|
|
225
|
+
agentpicks validate feature-flags agentpicks/error-tracking.yaml
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
`agentpicks list` prints each setup's name, job, `from`, stacks or repo, agents and runs, and flags a file that fails its checks. Signed in, it also lists the project's DevTune setups, with where each setup is (`local`, `DevTune` or `both`) and, for a linked file, whether it is in sync or which side changed. `agentpicks validate` checks every setup file, or the ones named, against the schema and the catalogue: a known `from`, tool keys in DevTune's catalogue, stacks it runs in, known agents, signals for every full tool entry, and the limits above. With no setup named, two files with one name, such as `x.yaml` and `x.yml`, both fail; a file named by path is checked alone, as `run <path>` runs it. It prints each problem as `file: field: fix` and exits 1 if any file fails, so CI can run it.
|
|
229
|
+
|
|
230
|
+
### DevTune setups
|
|
231
|
+
|
|
232
|
+
```sh
|
|
233
|
+
agentpicks pull
|
|
234
|
+
agentpicks pull feature-flags --force
|
|
235
|
+
agentpicks push feature-flags
|
|
236
|
+
agentpicks run add-feature-flags
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
`agentpicks pull` writes each of the project's DevTune setups to `agentpicks/<name>.yaml`, or into the file already linked to it, with its `id` and `synced`; `pull <setup>` writes one. It leaves a file in sync alone, and refuses to replace a file with changes not yet pushed, or an unlinked file of that name, unless you pass `--force`. A setup's name is its `from` category for an unedited copy of one, else its job line in lowercase with dashes.
|
|
240
|
+
|
|
241
|
+
`agentpicks push` saves every setup file to DevTune, and `push <setup>` one. A new file becomes a new DevTune setup, and push writes its `id` and `synced` into the file. A linked file in sync sends nothing. If the DevTune setup changed since the file last saw it, push refuses with `setup_changed` and saves nothing: pull it, apply your changes again, and push. A setup `from` a category saves as the project's setup of that category, its tools by key; a setup without `from` saves as a job. To add your own tool to a category copy, add it in the DevTune app, then run `agentpicks pull`: pull writes it as a full entry, and push refuses a full entry DevTune doesn't hold as written. DevTune doesn't send the signals of its catalogue's tools, so pull writes a catalogue tool by its key, in a job as in a copy, and push sends the key for DevTune to fill in its signals. A job can name, by key, any tool of a category DevTune publishes; a copy names its category's tools, and another only once it is added to the copy in the DevTune app and pulled. What a file can't say, such as agent models and a job's building blocks, push sends as DevTune holds it. For a new file with `repo`, push detects the repository's stacks from its manifests and lockfiles and saves those to DevTune. The file keeps `repo`, so `run <setup>` still tests your repository. If no supported stack is detected, replace `repo` with `stacks` before pushing and pass `--repo` when running. A linked file with `repo` keeps the stacks DevTune already holds.
|
|
242
|
+
|
|
243
|
+
`agentpicks run <name>` also runs a DevTune setup that has no file here, by the name `list` shows, and its runs upload under that setup. A job, or a copy that asks an add request of its own, is refused before Docker starts: anyone who can edit the setup in DevTune could change that request, and the agent runs it with your keys. `agentpicks pull` it and run the file.
|
|
244
|
+
|
|
245
|
+
`list`, `pull`, `run <name>` and an uploading `run --category` need the sign-in to read DevTune (Visibility Read), and `push`, and `run --category` when the project has no copy of the category, to edit setups (Actions Write); `agentpicks login` asks for both.
|
|
246
|
+
|
|
247
|
+
## GitHub Actions
|
|
248
|
+
|
|
249
|
+
The `devtunehq/agentpicks` action runs a setup in your workflow and uploads each run to your DevTune project. Commit the setup file to your repository (see [Setups](#setups)), such as `agentpicks/error-tracking.yaml`, then name it in `setup`.
|
|
250
|
+
|
|
251
|
+
This workflow runs that setup with Claude Code every Monday:
|
|
252
|
+
|
|
253
|
+
```yaml
|
|
254
|
+
name: Agent Picks
|
|
255
|
+
on:
|
|
256
|
+
schedule:
|
|
257
|
+
- cron: '0 6 * * 1'
|
|
258
|
+
workflow_dispatch:
|
|
259
|
+
|
|
260
|
+
permissions:
|
|
261
|
+
contents: read
|
|
262
|
+
|
|
263
|
+
jobs:
|
|
264
|
+
agentpicks:
|
|
265
|
+
runs-on: ubuntu-latest
|
|
266
|
+
steps:
|
|
267
|
+
- uses: actions/checkout@v5
|
|
268
|
+
- run: npm install -g @anthropic-ai/claude-code@2.1.323
|
|
269
|
+
- uses: devtunehq/agentpicks@v0.4.0
|
|
270
|
+
with:
|
|
271
|
+
setup: agentpicks/error-tracking.yaml
|
|
272
|
+
agent: claude-code
|
|
273
|
+
devtune-api-key: ${{ secrets.DEVTUNE_API_KEY }}
|
|
274
|
+
devtune-project-id: ${{ vars.DEVTUNE_PROJECT_ID }}
|
|
275
|
+
env:
|
|
276
|
+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
`setup` is a setup file's path in the checkout, or the name of a DevTune setup with no file, as `list` shows it. A name runs the DevTune setup, unless it is a job or a copy that asks an add request of its own, which runs only from a committed file. The action refuses a name that is also a file in the checkout's `agentpicks` folder, so name the file by its path. To run a built-in category with no setup file, set `category` with `stack` or `repo` in place of `setup`. Set one of `setup` and `category`, not both.
|
|
280
|
+
|
|
281
|
+
Use a Linux runner: `ubuntu-latest` has Docker and Node.js 20 or later. Without Docker, `run` refuses; without Node.js 20 or later, the action does. The action uses the runner's Node.js and doesn't change it for later steps.
|
|
282
|
+
|
|
283
|
+
Pin a release tag, such as `v0.4.0`. The action runs the `@devtune/agentpicks` version in the `package.json` of its ref, so a tag runs the same CLI every time. A branch moves to each new version when the mirror syncs, and fails while that version isn't on npm.
|
|
284
|
+
|
|
285
|
+
| Input | Passed as |
|
|
286
|
+
|---|---|
|
|
287
|
+
| `setup` | `run <setup>`. A path resolves in the checkout. |
|
|
288
|
+
| `category` | `--category`, in place of `setup`. |
|
|
289
|
+
| `stack` | `--stack`, in place of the setup's stacks or repo. |
|
|
290
|
+
| `repo` | `--repo`, in place of the setup's stacks or repo. `.` is the checkout. |
|
|
291
|
+
| `runs` | `--runs` |
|
|
292
|
+
| `agent` | `--agent`, in place of the setup's agents. |
|
|
293
|
+
| `model` | `--model` |
|
|
294
|
+
| `out` | `--out`. Default `./agentpicks-runs`. |
|
|
295
|
+
| `no-upload` | `--no-upload` when `true`. Default `false`. |
|
|
296
|
+
| `devtune-api-key` | `DEVTUNE_API_KEY` |
|
|
297
|
+
| `devtune-project-id` | `DEVTUNE_PROJECT_ID` |
|
|
298
|
+
| `devtune-api-base-url` | `DEVTUNE_API_BASE_URL` |
|
|
299
|
+
|
|
300
|
+
The DevTune values reach the CLI only through those environment variables, never its command line, and neither the action nor the CLI prints the key. Set `devtune-api-key` and `devtune-project-id` together: with one set, all three DevTune values come from the inputs, and the action refuses to upload when the other is empty, which is how a missing or misnamed secret shows up. With both empty, the action uses the `DEVTUNE_*` variables set on the step or job, and ignores `devtune-api-base-url`. The `bundle-dir` output is the absolute path of `out`, which holds one bundle per completed run; with `no-upload: true`, keep them with `actions/upload-artifact`.
|
|
301
|
+
|
|
302
|
+
**The API key.** Create a project API key under **API Keys** in DevTune with these scopes, and add it as the `DEVTUNE_API_KEY` secret. `DEVTUNE_PROJECT_ID` isn't secret, so it can be a variable.
|
|
303
|
+
|
|
304
|
+
| Scope | Needed to |
|
|
305
|
+
|---|---|
|
|
306
|
+
| **Agent Picks Run** | Upload each run. |
|
|
307
|
+
| **Visibility** | Upload the runs of a linked setup file (one with an `id`), run a DevTune setup by name, or run a `category`: `run` reads the project's DevTune setups to find the one its runs file under. |
|
|
308
|
+
| **Actions Write** | Run a `category` the project has no copy of yet: `run` creates the copy first. |
|
|
309
|
+
|
|
310
|
+
A linked file's run is refused before Docker starts when the file has changes not pushed, or its DevTune setup changed since the file last saw it: `push` or `pull` on your own machine after `agentpicks login`, which needs Visibility and Actions Write, then commit the file. The CI key needs no login, and Actions Write only for a `category` the project has no copy of. See [DevTune setups](#devtune-setups).
|
|
311
|
+
|
|
312
|
+
**The agent's key.** Pass it through `env:` under a name from [Credentials](#credentials): `ANTHROPIC_AUTH_TOKEN`, `ANTHROPIC_API_KEY` or `CLAUDE_CODE_OAUTH_TOKEN` for Claude Code, `OPENAI_API_KEY` or `CODEX_API_KEY` for Codex, and for OpenCode and Pi `ANTHROPIC_API_KEY` with an `anthropic/` model or `OPENAI_API_KEY` with an `openai/` model. `CLAUDE_CODE_OAUTH_TOKEN`, from `claude setup-token`, is the only subscription sign-in that works in CI: the others are saved to a file or a keyring when you log in to the agent, and a fresh runner has none to copy.
|
|
313
|
+
|
|
314
|
+
**The agent.** `agentpicks` tests the agent installed on the runner, and installs the same version in its container, so install it at a pinned version before the action: `npm install -g @openai/codex@<version>` for Codex. Install and authenticate each agent the setup lists, or pick one with `agent`. With `agent` set, or a setup that lists its agents, a run whose agent isn't installed is refused, naming it; otherwise a runner with no agent installed is refused, listing the agents `agentpicks` can run.
|
|
315
|
+
|
|
316
|
+
**Your repository.** A setup with `repo: .`, or `repo: .` on the action, tests the checked-out commit. `actions/checkout` sets the `origin` remote that an upload needs. Files the workflow writes into the checkout, `out` included, aren't read: only committed files are tested.
|
|
317
|
+
|
|
318
|
+
### Other CI systems
|
|
319
|
+
|
|
320
|
+
Install Docker, Node.js 20 or later and the agent, set `DEVTUNE_API_KEY`, `DEVTUNE_PROJECT_ID` and the agent's key from the CI system's secrets, and call the CLI at a pinned version from the checkout:
|
|
321
|
+
|
|
322
|
+
```sh
|
|
323
|
+
npm install -g @anthropic-ai/claude-code@2.1.323
|
|
324
|
+
npx --yes @devtune/agentpicks@0.4.0 run error-tracking --agent claude-code
|
|
325
|
+
```
|
|
326
|
+
|
|
107
327
|
## The bundle
|
|
108
328
|
|
|
109
329
|
Each completed run writes one directory, `<out>/<run id>/`. A run that fails writes nothing, and that includes an agent that exits nonzero, unless the early stop stopped it.
|
|
@@ -114,20 +334,20 @@ redactions.json what redaction removed, per artifact
|
|
|
114
334
|
artifacts/ what the run captured, already redacted
|
|
115
335
|
```
|
|
116
336
|
|
|
117
|
-
`manifest.json` holds `bundleVersion` (1), the generated `runId`, the runner's version, the agent's kind, version and model, the host's OS and architecture, the image digest, the container's egress IP, the stack with its starter and lock digest or the repository with its remote address (`origin`, or the first remote) as host and path alone, without user, password, query, fragment or `transport::` prefix, or `null` with no remote, a local path, or an address it can't read with confidence, and its full commit id, the category, request intent (`add`) and exact prompt, start and end times, and each artifact's size and SHA-256. The egress IP is read inside the container from `https://api.ipify.org` before setup; when it can't be read it is `null`.
|
|
337
|
+
`manifest.json` holds `bundleVersion` (1), the generated `runId`, the runner's version, the agent's kind, version and model, the host's OS and architecture, the image digest, the container's egress IP, the stack with its starter and lock digest or the repository with its remote address (`origin`, or the first remote) as host and path alone, without user, password, query, fragment or `transport::` prefix, or `null` with no remote, a local path, or an address it can't read with confidence, and its full commit id, the category (`setup:<name>` for a custom setup), request intent (`add`) and exact prompt, start and end times, and each artifact's size and SHA-256. An artifact that analysis doesn't read and that is over DevTune's upload limit (50 MiB) is trimmed to whole lines within it, and the manifest records its size before and after under `truncation`: `mitm.log` and `agent.err` keep their end, and the rest keep their start. The artifacts analysis reads (the transcript, `requests.jsonl`, the diff and the source files, and the package and manifest files before and after) are never trimmed, so a result is never drawn from part of a run; over the limit, `agentpicks upload` refuses the bundle and names the limit. The egress IP is read inside the container from `https://api.ipify.org` before setup; when it can't be read it is `null`.
|
|
118
338
|
|
|
119
339
|
The artifacts are those a DevTune managed run captures: `transcript.jsonl`, `diff.patch`, `requests.jsonl` (every request the agent's traffic made through the logging proxy), `llm-usage.jsonl`, `deps.txt`, the manifests and lockfiles before and after, `meta.json` (the agent's exit code) and `earlystop.json`, among others.
|
|
120
340
|
|
|
121
341
|
Every artifact is redacted before it is written: the credential values the run used, every secret the agent wrote itself (a value of 12 characters or more assigned to a name such as `AUTH_SECRET`, `API_KEY` or `DB_PASSWORD` in a dotenv or shell line, YAML or a quoted string, unless it is a placeholder or a reference; for a URL, its credentials), wherever it then appears, credentials in URLs and private keys, and the [gitleaks](https://github.com/gitleaks/gitleaks) rules. `agentpicks` prints each file's size and the number of redactions. A run that wrote more than 200 secrets writes no bundle, and no further runs start.
|
|
122
342
|
|
|
123
|
-
The schema is `bundleManifestSchema` and `redactionSummarySchema` in `src/bundle/schema.ts`.
|
|
343
|
+
The schema is `bundleManifestSchema` and `redactionSummarySchema` in `src/bundle/schema.ts`. Every run also writes `earlyStop`, the patterns its early stop watched for, into `manifest.json`, and a run of a setup file writes `setup` (its name, `from`, `id` and job line). Both are `agentpicks`' own, outside the bundle format, so an upload never sends them.
|
|
124
344
|
|
|
125
345
|
## The package
|
|
126
346
|
|
|
127
347
|
This package is also the open half of DevTune's Agent Picks: the `Sandbox` interface and the Docker provider, the scripts a run uploads into the sandbox (environment setup, the logging proxy, the early-stop watcher, each agent's install and launch), the run lifecycle (`runInSandbox`), the category requests, the committed starters and the trace redaction. DevTune's managed runs use the same code. Classification, parsing, cost and the model proxy stay with DevTune.
|
|
128
348
|
|
|
129
|
-
Build the CLI with `pnpm --filter @devtune/agentpicks build:cli`, which writes `dist/cli.js`. The npm package ships only that CLI and the
|
|
349
|
+
Build the CLI with `pnpm --filter @devtune/agentpicks build:cli`, which writes `dist/cli.js`. The npm package ships only that CLI, the Dockerfile and the setup file's JSON Schema; the code above is imported from source inside the monorepo.
|
|
130
350
|
|
|
131
|
-
`src/catalogue/early-stop.generated.ts` holds each category's early-stop patterns, which DevTune derives from its tool signals;
|
|
351
|
+
`src/catalogue/early-stop.generated.ts` holds each category's early-stop patterns, which DevTune derives from its tool signals, and `src/catalogue/category-tools.generated.ts` each category's tool keys and names; both are generated by `pnpm --filter @kit/agent-picks generate:early-stop`.
|
|
132
352
|
|
|
133
353
|
`src/run/trace-rules.generated.ts` is generated from the gitleaks rules in `vendor/gitleaks` (MIT) by `python3 packages/agentpicks/scripts/generate-trace-rules.py`.
|