@devtune/agentpicks 0.5.0 → 0.5.1

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 +3 -3
  2. package/dist/cli.js +49 -33
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -321,7 +321,7 @@ jobs:
321
321
  steps:
322
322
  - uses: actions/checkout@v5
323
323
  - run: npm install -g @anthropic-ai/claude-code@2.1.323
324
- - uses: devtunehq/agentpicks@v0.5.0
324
+ - uses: devtunehq/agentpicks@v0.5.1
325
325
  with:
326
326
  setup: agentpicks/error-tracking.yaml
327
327
  agent: claude-code
@@ -335,7 +335,7 @@ jobs:
335
335
 
336
336
  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.
337
337
 
338
- Pin a release tag, such as `v0.5.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.
338
+ Pin a release tag, such as `v0.5.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.
339
339
 
340
340
  | Input | Passed as |
341
341
  |---|---|
@@ -377,7 +377,7 @@ Install Docker, Node.js 20 or later and the agent, set `DEVTUNE_API_KEY`, `DEVTU
377
377
 
378
378
  ```sh
379
379
  npm install -g @anthropic-ai/claude-code@2.1.323
380
- npx --yes @devtune/agentpicks@0.5.0 run error-tracking --agent claude-code
380
+ npx --yes @devtune/agentpicks@0.5.1 run error-tracking --agent claude-code
381
381
  ```
382
382
 
383
383
  ## The bundle
package/dist/cli.js CHANGED
@@ -7375,7 +7375,7 @@ var import_promises5 = require("node:readline/promises");
7375
7375
  // package.json
7376
7376
  var package_default = {
7377
7377
  name: "@devtune/agentpicks",
7378
- version: "0.5.0",
7378
+ version: "0.5.1",
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: {
@@ -7429,7 +7429,7 @@ var package_default = {
7429
7429
  "@types/node": "catalog:",
7430
7430
  esbuild: "0.28.1",
7431
7431
  typescript5: "npm:typescript@5.9.3",
7432
- vitest: "^4.1.12"
7432
+ vitest: "^5.1.1"
7433
7433
  },
7434
7434
  typesVersions: {
7435
7435
  "*": {
@@ -90705,9 +90705,6 @@ function opensLineComment(line2, i, marker) {
90705
90705
  if (marker === "//") return line2[i - 1] !== ":";
90706
90706
  return i + 2 === line2.length || /\s/.test(line2[i + 2]);
90707
90707
  }
90708
- function withoutComments(path, lines) {
90709
- return commentFreeLines(path, lines).filter((l) => l.added && !l.blankedByComment).map((l) => l.text);
90710
- }
90711
90708
  function commentFreeLines(path, lines) {
90712
90709
  const syntax = COMMENT_SYNTAX.find(([pattern]) => pattern.test(path))?.[1];
90713
90710
  if (!syntax) {
@@ -90861,6 +90858,8 @@ var MESSAGE_NAME = /\b([A-Z][A-Z0-9]*(?:_[A-Z0-9]+)+)\b/g;
90861
90858
  var CREDENTIAL = String.raw`(?:environment variable|env var|api[ _-]?key|secret|token)`;
90862
90859
  var LACKS = String.raw`(?:missing|not set|isn't set|not defined|undefined|empty|required|no value|unset|must be set|not provided|not configured)`;
90863
90860
  var QUOTED_NAME = String.raw`['"\x60]?(?:process\.env\.)?(${NAME})['"\x60]?`;
90861
+ var LABEL_LEAD = String.raw`^\s*(?:[^\w\s]{1,2}\s+)?(?:Uncaught\s+)?`;
90862
+ var LABEL = String.raw`(?:[\w.]*(?:Error|Exception)|error|ERROR|fatal|FATAL)(?:\s*\[[^\]]*\])?:`;
90864
90863
  var LACKING_NAME = [
90865
90864
  new RegExp(
90866
90865
  String.raw`${CREDENTIAL}:?\s+${QUOTED_NAME}\s+(?:is\s+|was\s+)?${LACKS}\b`,
@@ -90873,6 +90872,10 @@ var LACKING_NAME = [
90873
90872
  new RegExp(
90874
90873
  String.raw`(?<![\w-])(?<!not\s)(?<!n't\s)(?:missing|required|unset|undefined)\s+(?:the\s+)?${CREDENTIAL}:?\s+${QUOTED_NAME}`,
90875
90874
  "i"
90875
+ ),
90876
+ new RegExp(
90877
+ String.raw`${LABEL_LEAD}(?![\w.]*ReferenceError)${LABEL}\s*${QUOTED_NAME}\s+(?:is\s+|was\s+)?${LACKS}\s*(?:[.!;:,]|$)`,
90878
+ "i"
90876
90879
  )
90877
90880
  ];
90878
90881
  var NODE_ENV_READ = new RegExp(
@@ -90920,7 +90923,9 @@ function pythonEnvReads(lines) {
90920
90923
  }
90921
90924
  return reads;
90922
90925
  }
90923
- var ERROR_MESSAGE = /^\s*(?:[^\w\s]{1,2}\s+)?(?:Uncaught\s+)?(?:[\w.]*(?:Error|Exception)|error|ERROR|fatal|FATAL)(?:\s*\[[^\]]*\])?:|\((?:\w+::)*\w*(?:Error|Exception)\)\s*$/;
90926
+ var ERROR_MESSAGE = new RegExp(
90927
+ String.raw`${LABEL_LEAD}${LABEL}|\((?:\w+::)*\w*(?:Error|Exception)\)\s*$`
90928
+ );
90924
90929
  var BUILD_ERROR = /^\s*(?:Type error|Failed to compile|error during build)\b|\berror TS\d+:|\[ERROR\]/i;
90925
90930
  var NOT_NEEDED = /\b(?:not|never|no longer)\s+(?:be\s+)?(?:required|needed)\b|n't\s+(?:be\s+)?(?:required|needed)\b|\boptional\b/i;
90926
90931
  function isSourceEcho(lines, i) {
@@ -90996,33 +91001,35 @@ function gitPath(path) {
90996
91001
  return new TextDecoder().decode(new Uint8Array(bytes)).replace(/^b\//, "");
90997
91002
  }
90998
91003
  var KEY = String.raw`\s*["'\`]([A-Za-z_]\w*)["'\`]`;
91004
+ var NOT_DELETED = String.raw`(?<!\b(?:delete|del)\s+[\w$.]*|\bunset\(\s*)`;
91005
+ var NOT_ASSIGNED = String.raw`(?![\w$])(?!\s*(?:\?\?|\|\|)?=(?![=>]))`;
91006
+ var envRead = (form) => new RegExp(String.raw`${NOT_DELETED}${form}${NOT_ASSIGNED}`, "g");
90999
91007
  var ENV_READS = [
91000
- new RegExp(String.raw`\benv(?:\??\.([A-Za-z_]\w*)|\[${KEY}\s*\])`, "g"),
91001
- new RegExp(String.raw`\bDeno\.env\.get\(${KEY}`, "g"),
91002
- new RegExp(String.raw`\benviron(?:\.get\(|\[)${KEY}`, "g"),
91003
- new RegExp(String.raw`\bENV(?:\.fetch\(|\[)${KEY}`, "g"),
91004
- new RegExp(
91005
- String.raw`\b(?:getenv|Getenv|LookupEnv|get_env|fetch_env!?|env::var(?:_os)?|(?:option_)?env!?)\(${KEY}`,
91006
- "g"
91008
+ envRead(String.raw`\benv(?:\??\.([A-Za-z_]\w*)|\[${KEY}\s*\])`),
91009
+ envRead(String.raw`\bDeno\.env\.get\(${KEY}`),
91010
+ envRead(String.raw`\benviron(?:\.get\(${KEY}|\[${KEY}\s*\])`),
91011
+ envRead(String.raw`\bENV(?:\.fetch\(${KEY}|\[${KEY}\s*\])`),
91012
+ envRead(
91013
+ String.raw`\b(?:getenv|Getenv|LookupEnv|get_env|fetch_env!?|env::var(?:_os)?|(?:option_)?env!?)\(${KEY}`
91007
91014
  ),
91008
- new RegExp(String.raw`\$_(?:ENV|SERVER)\[${KEY}`, "g")
91015
+ envRead(String.raw`\$_(?:ENV|SERVER)\[${KEY}\s*\]`)
91009
91016
  ];
91010
91017
  var ENV_LISTS = [
91011
- /\{([^}]*)\}\s*=\s*(?:[\w$.]*\.)?env\b/g,
91012
- /\bimport\s*\{([^}]*)\}\s*from\s*["']\$env\/static\/(?:private|public)["']/g
91018
+ /\{([^{}]*)\}\s*=\s*(?:[\w$.]*\.)?env\b/g,
91019
+ /\bimport\s*\{([^{}]*)\}\s*from\s*["']\$env\/static\/(?:private|public)["']/g
91013
91020
  ];
91014
91021
  var DOTENV_ASSIGNMENT = /^\s*(?:export\s+)?([A-Za-z_]\w*)\s*=/;
91015
91022
  function envReads(line2) {
91016
- return [
91017
- ...ENV_READS.flatMap(
91018
- (read) => [...line2.matchAll(read)].flatMap((match) => match[1] ?? match[2] ?? [])
91019
- ),
91020
- ...ENV_LISTS.flatMap(
91021
- (list) => [...line2.matchAll(list)].flatMap(
91022
- (match) => match[1].split(",").flatMap((entry) => /^\s*([A-Za-z_]\w*)/.exec(entry)?.[1] ?? [])
91023
- )
91023
+ return ENV_READS.flatMap(
91024
+ (read) => [...line2.matchAll(read)].flatMap((match) => match[1] ?? match[2] ?? [])
91025
+ );
91026
+ }
91027
+ function envLists(lines) {
91028
+ return ENV_LISTS.flatMap(
91029
+ (list) => [...lines.matchAll(list)].flatMap(
91030
+ (match) => match[1].split(",").flatMap((entry) => /^\s*([A-Za-z_]\w*)/.exec(entry)?.[1] ?? [])
91024
91031
  )
91025
- ];
91032
+ );
91026
91033
  }
91027
91034
  function referencedNames(change) {
91028
91035
  const names2 = /* @__PURE__ */ new Set();
@@ -91031,14 +91038,23 @@ function referencedNames(change) {
91031
91038
  const dotenv = DOTENV_FILE.test(path);
91032
91039
  if (!dotenv && !SOURCE_FILE.test(path)) continue;
91033
91040
  const continuation = BLOCK_COMMENT_FILE.test(path) ? /^\s*\*/ : null;
91034
- for (const line2 of file2.hunks.flatMap(
91035
- (hunk) => withoutComments(path, establishedLines(path, hunk))
91036
- )) {
91037
- if (dotenv) {
91038
- const name = DOTENV_ASSIGNMENT.exec(line2)?.[1];
91039
- if (name) names2.add(name);
91040
- } else if (!continuation?.test(line2))
91041
- for (const name of envReads(line2)) names2.add(name);
91041
+ for (const hunk of file2.hunks) {
91042
+ let added = [];
91043
+ const endAdded = () => {
91044
+ for (const name of envLists(added.join("\n"))) names2.add(name);
91045
+ added = [];
91046
+ };
91047
+ for (const line2 of commentFreeLines(path, establishedLines(path, hunk))) {
91048
+ if (dotenv) {
91049
+ const name = line2.added && DOTENV_ASSIGNMENT.exec(line2.text)?.[1];
91050
+ if (name) names2.add(name);
91051
+ } else if (!line2.added || continuation?.test(line2.text)) endAdded();
91052
+ else {
91053
+ added.push(line2.text);
91054
+ for (const name of envReads(line2.text)) names2.add(name);
91055
+ }
91056
+ }
91057
+ endAdded();
91042
91058
  }
91043
91059
  }
91044
91060
  return names2;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devtune/agentpicks",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
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": {
@@ -38,7 +38,7 @@
38
38
  "@types/node": "24.10.1",
39
39
  "esbuild": "0.28.1",
40
40
  "typescript5": "npm:typescript@5.9.3",
41
- "vitest": "^4.1.12",
41
+ "vitest": "^5.1.1",
42
42
  "@kit/tsconfig": "0.1.0"
43
43
  },
44
44
  "typesVersions": {},