@devtune/agentpicks 0.4.1 → 0.4.2

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 (3) hide show
  1. package/README.md +5 -5
  2. package/dist/cli.js +81 -19
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -225,7 +225,7 @@ agentpicks validate
225
225
  agentpicks validate feature-flags agentpicks/error-tracking.yaml
226
226
  ```
227
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, 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.
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. When the table is wider than the terminal, it prints each setup as a block, one line per field; piped output is always the table. `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, 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
229
 
230
230
  ### DevTune setups
231
231
 
@@ -236,7 +236,7 @@ agentpicks push feature-flags
236
236
  agentpicks run add-feature-flags
237
237
  ```
238
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.
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, cut at a word to at most 30 characters.
240
240
 
241
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
242
 
@@ -266,7 +266,7 @@ jobs:
266
266
  steps:
267
267
  - uses: actions/checkout@v5
268
268
  - run: npm install -g @anthropic-ai/claude-code@2.1.323
269
- - uses: devtunehq/agentpicks@v0.4.1
269
+ - uses: devtunehq/agentpicks@v0.4.2
270
270
  with:
271
271
  setup: agentpicks/error-tracking.yaml
272
272
  agent: claude-code
@@ -280,7 +280,7 @@ jobs:
280
280
 
281
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
282
 
283
- Pin a release tag, such as `v0.4.1`. 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.
283
+ Pin a release tag, such as `v0.4.2`. 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
284
 
285
285
  | Input | Passed as |
286
286
  |---|---|
@@ -321,7 +321,7 @@ Install Docker, Node.js 20 or later and the agent, set `DEVTUNE_API_KEY`, `DEVTU
321
321
 
322
322
  ```sh
323
323
  npm install -g @anthropic-ai/claude-code@2.1.323
324
- npx --yes @devtune/agentpicks@0.4.1 run error-tracking --agent claude-code
324
+ npx --yes @devtune/agentpicks@0.4.2 run error-tracking --agent claude-code
325
325
  ```
326
326
 
327
327
  ## The bundle
package/dist/cli.js CHANGED
@@ -7375,7 +7375,7 @@ var import_promises4 = require("node:readline/promises");
7375
7375
  // package.json
7376
7376
  var package_default = {
7377
7377
  name: "@devtune/agentpicks",
7378
- version: "0.4.1",
7378
+ version: "0.4.2",
7379
7379
  description: "The open Agent Picks runner: the agentpicks CLI, which tests the coding agents installed on your machine in fresh Docker containers, and the sandbox code DevTune runs its managed tests on",
7380
7380
  license: "Apache-2.0",
7381
7381
  engines: {
@@ -9567,7 +9567,7 @@ function putProp(target, key, value) {
9567
9567
  else
9568
9568
  target[key] = value;
9569
9569
  }
9570
- function mirrorShape(target, source, keys, wrap) {
9570
+ function mirrorShape(target, source, keys, wrap2) {
9571
9571
  const raw = sourceShape(source);
9572
9572
  for (const key of keys) {
9573
9573
  const desc = Object.getOwnPropertyDescriptor(raw, key);
@@ -9576,10 +9576,10 @@ function mirrorShape(target, source, keys, wrap) {
9576
9576
  if (desc.get) {
9577
9577
  deferProp(target, key, () => {
9578
9578
  const value = source._zod.def.shape[key];
9579
- return wrap ? wrap(value, key) : value;
9579
+ return wrap2 ? wrap2(value, key) : value;
9580
9580
  });
9581
9581
  } else
9582
- putProp(target, key, wrap ? wrap(desc.value, key) : desc.value);
9582
+ putProp(target, key, wrap2 ? wrap2(desc.value, key) : desc.value);
9583
9583
  }
9584
9584
  }
9585
9585
  function mirrorProps(target, source) {
@@ -78518,8 +78518,29 @@ var fileAgent = (kind) => SETUP_AGENTS.find((name) => AGENT_KINDS2.get(name) ===
78518
78518
  function nameableStack(slug2, runsIn) {
78519
78519
  return ENVIRONMENTS.some((env) => env.slug === slug2) && !isRetiredEnvironment(slug2) && environmentRunsIn(slug2, runsIn);
78520
78520
  }
78521
+ var NAME_LENGTH = 30;
78522
+ var TRAILING_WORDS = /* @__PURE__ */ new Set([
78523
+ "a",
78524
+ "an",
78525
+ "and",
78526
+ "for",
78527
+ "in",
78528
+ "of",
78529
+ "on",
78530
+ "or",
78531
+ "the",
78532
+ "to",
78533
+ "with"
78534
+ ]);
78521
78535
  function slugName(text3) {
78522
- return text3.normalize("NFKD").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60).replace(/-+$/, "") || "setup";
78536
+ const words = text3.normalize("NFKD").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean);
78537
+ const kept = [];
78538
+ for (const word of words) {
78539
+ if ([...kept, word].join("-").length > NAME_LENGTH) break;
78540
+ kept.push(word);
78541
+ }
78542
+ while (kept.length > 1 && TRAILING_WORDS.has(kept.at(-1))) kept.pop();
78543
+ return kept.join("-") || words[0]?.slice(0, NAME_LENGTH) || "setup";
78523
78544
  }
78524
78545
  function devtuneSetupNames(setups) {
78525
78546
  const names2 = /* @__PURE__ */ new Map();
@@ -82165,8 +82186,8 @@ async function listCommand(argv, ctx) {
82165
82186
  ctx.out(`${(0, import_node_path14.join)(root, SETUPS_DIR)} holds no setup files. ${WRITE_ONE}`);
82166
82187
  return 0;
82167
82188
  }
82168
- printTable(
82169
- ["NAME", "JOB", "FROM", "TESTS", "AGENTS", "RUNS"],
82189
+ printSetups(
82190
+ ["JOB", "FROM", "TESTS", "AGENTS", "RUNS"],
82170
82191
  files.map((file2) => ({
82171
82192
  name: file2.name,
82172
82193
  cells: file2.setup ? setupCells(file2.setup) : null,
@@ -82222,17 +82243,46 @@ function linkedTable(files, devtune, ctx) {
82222
82243
  ctx.out(`Neither ${SETUPS_DIR}/ nor DevTune holds a setup. ${WRITE_ONE}`);
82223
82244
  return 0;
82224
82245
  }
82225
- printTable(
82226
- ["NAME", "WHERE", "SYNC", "JOB", "FROM", "TESTS", "AGENTS", "RUNS"],
82246
+ printSetups(
82247
+ ["WHERE", "SYNC", "JOB", "FROM", "TESTS", "AGENTS", "RUNS"],
82227
82248
  rows,
82228
82249
  ctx
82229
82250
  );
82230
82251
  footer(files, ctx);
82231
82252
  return 0;
82232
82253
  }
82233
- function printTable(header, rows, ctx) {
82254
+ var TABLE_JOB_LENGTH = 48;
82255
+ function printSetups(titles, rows, ctx) {
82256
+ const table = tableLines(["NAME", ...titles], rows);
82257
+ const fits = ctx.columns === void 0 || table.every((line2) => line2.length <= ctx.columns);
82258
+ if (fits) {
82259
+ for (const line2 of table) ctx.out(line2);
82260
+ return;
82261
+ }
82262
+ const labels = [...titles.map((title) => title.toLowerCase()), "invalid"];
82263
+ const labelWidth = Math.max(...labels.map((label) => label.length));
82264
+ const field = (label, value) => {
82265
+ const lead = ` ${label.padEnd(labelWidth)} `;
82266
+ wrap(value, Math.max(ctx.columns - lead.length, 20)).forEach(
82267
+ (part, i) => ctx.out(`${i === 0 ? lead : " ".repeat(lead.length)}${part}`)
82268
+ );
82269
+ };
82270
+ rows.forEach((row, i) => {
82271
+ if (i > 0) ctx.out("");
82272
+ ctx.out(row.name);
82273
+ if (!row.cells) return field("invalid", row.problem);
82274
+ row.cells.forEach((cell, j) => {
82275
+ if (cell !== "-") field(labels[j], cell);
82276
+ });
82277
+ });
82278
+ }
82279
+ function tableLines(header, rows) {
82280
+ const jobAt = header.indexOf("JOB");
82281
+ const shown3 = (cells) => cells.map(
82282
+ (cell, i) => i === jobAt && cell.length > TABLE_JOB_LENGTH ? `${cell.slice(0, TABLE_JOB_LENGTH - 1)}\u2026` : cell
82283
+ );
82234
82284
  const full = rows.flatMap(
82235
- (row) => row.cells ? [[row.name, ...row.cells]] : []
82285
+ (row) => row.cells ? [shown3([row.name, ...row.cells])] : []
82236
82286
  );
82237
82287
  const widths = header.map(
82238
82288
  (title, i) => Math.max(title.length, ...full.map((cells) => cells[i].length))
@@ -82240,11 +82290,23 @@ function printTable(header, rows, ctx) {
82240
82290
  const line2 = (cells) => cells.map(
82241
82291
  (cell, i) => i === cells.length - 1 ? cell : cell.padEnd(widths[i])
82242
82292
  ).join(" ");
82243
- ctx.out(line2(header));
82244
- for (const row of rows)
82245
- ctx.out(
82246
- row.cells ? line2([row.name, ...row.cells]) : `${row.name.padEnd(widths[0])} invalid: ${row.problem}`
82247
- );
82293
+ return [
82294
+ line2(header),
82295
+ ...rows.map(
82296
+ (row) => row.cells ? line2(shown3([row.name, ...row.cells])) : `${row.name.padEnd(widths[0])} invalid: ${row.problem}`
82297
+ )
82298
+ ];
82299
+ }
82300
+ function wrap(text3, width) {
82301
+ const lines = [];
82302
+ let current = "";
82303
+ for (const word of text3.split(" ")) {
82304
+ if (current && current.length + 1 + word.length > width) {
82305
+ lines.push(current);
82306
+ current = word;
82307
+ } else current = current ? `${current} ${word}` : word;
82308
+ }
82309
+ return [...lines, current];
82248
82310
  }
82249
82311
  function footer(files, ctx) {
82250
82312
  const invalid = files.filter((file2) => !file2.setup).length;
@@ -82259,10 +82321,9 @@ function problemOf(file2) {
82259
82321
  return first ? `${first.field}: ${first.message}` : "";
82260
82322
  }
82261
82323
  function setupCells(setup) {
82262
- const job = setup.job.length > 48 ? `${setup.job.slice(0, 47)}\u2026` : setup.job;
82263
82324
  const tests = setup.repo ? `repo ${setup.repo.path}${setup.repo.ref ? ` at ${setup.repo.ref}` : ""}` : setup.stacks ? setup.stacks.map((env) => env.slug).join(", ") : "-";
82264
82325
  return [
82265
- job,
82326
+ setup.job,
82266
82327
  setup.from ?? "-",
82267
82328
  tests,
82268
82329
  setup.agents?.join(", ") ?? "the installed one",
@@ -85208,7 +85269,8 @@ function defaultContext(dockerfileDir) {
85208
85269
  cwd: process.cwd(),
85209
85270
  dockerfileDir,
85210
85271
  stdinIsTerminal: Boolean(process.stdin.isTTY),
85211
- interactive: Boolean(process.stdin.isTTY && process.stdout.isTTY)
85272
+ interactive: Boolean(process.stdin.isTTY && process.stdout.isTTY),
85273
+ columns: process.stdout.isTTY ? process.stdout.columns : void 0
85212
85274
  };
85213
85275
  }
85214
85276
  function printable(line2) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devtune/agentpicks",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "The open Agent Picks runner: the agentpicks CLI, which tests the coding agents installed on your machine in fresh Docker containers, and the sandbox code DevTune runs its managed tests on",
5
5
  "license": "Apache-2.0",
6
6
  "engines": {