agentv 4.37.0-next.1 → 4.38.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.
Files changed (32) hide show
  1. package/dist/{artifact-writer-GFNKYREE.js → artifact-writer-MK5X5MSO.js} +4 -4
  2. package/dist/{chunk-P4LSNFZR.js → chunk-3G4BK6Z5.js} +21 -20
  3. package/dist/{chunk-P4LSNFZR.js.map → chunk-3G4BK6Z5.js.map} +1 -1
  4. package/dist/{chunk-N6E5XFOM.js → chunk-DKUAETXE.js} +3 -3
  5. package/dist/{chunk-M7AMFWBZ.js → chunk-EKMMIULD.js} +42 -37
  6. package/dist/chunk-EKMMIULD.js.map +1 -0
  7. package/dist/{chunk-OYI35QFW.js → chunk-NLTIK3LV.js} +32 -250
  8. package/dist/chunk-NLTIK3LV.js.map +1 -0
  9. package/dist/{chunk-RL4S2FBZ.js → chunk-VBHHZQS6.js} +902 -488
  10. package/dist/chunk-VBHHZQS6.js.map +1 -0
  11. package/dist/cli.js +5 -5
  12. package/dist/dashboard/assets/index-BpnllKET.css +1 -0
  13. package/dist/dashboard/assets/index-Cm9SUopp.js +118 -0
  14. package/dist/dashboard/assets/{index-BDRYJsGF.js → index-SIl6NbIJ.js} +1 -1
  15. package/dist/dashboard/index.html +2 -2
  16. package/dist/{dist-OY3JSP6Z.js → dist-HVLBDG5F.js} +17 -13
  17. package/dist/index.js +5 -5
  18. package/dist/{interactive-CQELHITQ.js → interactive-QFAAM4SI.js} +5 -5
  19. package/dist/skills/agentv-eval-writer/SKILL.md +28 -36
  20. package/dist/skills/agentv-eval-writer/references/eval-schema.json +57 -210
  21. package/dist/{ts-eval-loader-RBTB2HG2-H5TRXZLO.js → ts-eval-loader-TJT6BGFF-DI7XNSO4.js} +2 -2
  22. package/package.json +1 -1
  23. package/dist/chunk-M7AMFWBZ.js.map +0 -1
  24. package/dist/chunk-OYI35QFW.js.map +0 -1
  25. package/dist/chunk-RL4S2FBZ.js.map +0 -1
  26. package/dist/dashboard/assets/index-9tV-u4HJ.css +0 -1
  27. package/dist/dashboard/assets/index-DuESU7zZ.js +0 -118
  28. /package/dist/{artifact-writer-GFNKYREE.js.map → artifact-writer-MK5X5MSO.js.map} +0 -0
  29. /package/dist/{chunk-N6E5XFOM.js.map → chunk-DKUAETXE.js.map} +0 -0
  30. /package/dist/{dist-OY3JSP6Z.js.map → dist-HVLBDG5F.js.map} +0 -0
  31. /package/dist/{interactive-CQELHITQ.js.map → interactive-QFAAM4SI.js.map} +0 -0
  32. /package/dist/{ts-eval-loader-RBTB2HG2-H5TRXZLO.js.map → ts-eval-loader-TJT6BGFF-DI7XNSO4.js.map} +0 -0
@@ -3,15 +3,15 @@ import {
3
3
  buildTraceFromMessages,
4
4
  external_exports,
5
5
  extractLastAssistantContent,
6
- getAgentvConfigDir,
7
6
  getAgentvDataDir,
7
+ getRepoCheckoutRef,
8
8
  interpolateEnv,
9
+ normalizeRepoIdentity,
9
10
  normalizeToolCall,
10
- parseRepoCheckout,
11
- parseRepoClone,
12
- parseRepoSource,
13
- parseYamlValue
14
- } from "./chunk-RL4S2FBZ.js";
11
+ parseRepoConfig,
12
+ parseYamlValue,
13
+ resolveRepoCloneUrl
14
+ } from "./chunk-VBHHZQS6.js";
15
15
 
16
16
  // ../../packages/core/dist/index.js
17
17
  import { readFileSync } from "node:fs";
@@ -32,18 +32,15 @@ import { cp, mkdtemp, readdir, rm, stat } from "node:fs/promises";
32
32
  import os from "node:os";
33
33
  import path3 from "node:path";
34
34
  import { promisify } from "node:util";
35
- import { existsSync as existsSync2, mkdirSync as mkdirSync2, readFileSync as readFileSync3, readdirSync, statSync, writeFileSync as writeFileSync2 } from "node:fs";
36
- import path4 from "node:path";
37
- import { stringify as stringifyYaml } from "yaml";
38
35
  import * as childProcess from "node:child_process";
39
- import { existsSync as existsSync3 } from "node:fs";
36
+ import { existsSync as existsSync2 } from "node:fs";
40
37
  import { spawnSync } from "node:child_process";
41
38
  import { readdir as readdir2, stat as stat2 } from "node:fs/promises";
42
39
  import { homedir } from "node:os";
43
- import path5 from "node:path";
40
+ import path4 from "node:path";
44
41
  import { readdir as readdir3, stat as stat3 } from "node:fs/promises";
45
42
  import { homedir as homedir2 } from "node:os";
46
- import path6 from "node:path";
43
+ import path5 from "node:path";
47
44
  import { readFile as readFile2 } from "node:fs/promises";
48
45
  function codeGraderInstruction(graderName, description) {
49
46
  const desc = description ? ` This grader: ${description}.` : "";
@@ -359,12 +356,12 @@ var CONFIG_FILE_NAMES = [
359
356
  ".agentv/config.js"
360
357
  ];
361
358
  async function loadTsConfig(projectRoot) {
362
- const { existsSync: existsSync4 } = await import("node:fs");
359
+ const { existsSync: existsSync3 } = await import("node:fs");
363
360
  const { pathToFileURL } = await import("node:url");
364
361
  const { join } = await import("node:path");
365
362
  for (const fileName of CONFIG_FILE_NAMES) {
366
363
  const filePath = join(projectRoot, fileName);
367
- if (!existsSync4(filePath)) {
364
+ if (!existsSync3(filePath)) {
368
365
  continue;
369
366
  }
370
367
  try {
@@ -451,16 +448,6 @@ function buildPrompt(criteria, question, referenceAnswer) {
451
448
  }
452
449
  return parts.join("\n");
453
450
  }
454
- function normalizeGitUrl(url) {
455
- let normalized = url.replace(/\.git$/, "");
456
- try {
457
- const parsed = new URL(normalized);
458
- parsed.hostname = parsed.hostname.toLowerCase();
459
- normalized = parsed.toString().replace(/\/$/, "");
460
- } catch {
461
- }
462
- return normalized;
463
- }
464
451
  async function scanRepoDeps(evalFilePaths) {
465
452
  const seen = /* @__PURE__ */ new Map();
466
453
  const errors = [];
@@ -468,20 +455,19 @@ async function scanRepoDeps(evalFilePaths) {
468
455
  try {
469
456
  const repos = await extractReposFromEvalFile(filePath);
470
457
  for (const repo of repos) {
471
- if (!repo.source || repo.source.type !== "git") continue;
472
- const ref = repo.checkout?.ref;
473
- const key = `${normalizeGitUrl(repo.source.url)}\0${ref ?? ""}`;
458
+ if (!repo.repo) continue;
459
+ const checkoutRef = getRepoCheckoutRef(repo);
460
+ const ref = checkoutRef === "HEAD" ? void 0 : checkoutRef;
461
+ const key = `${normalizeRepoIdentity(repo.repo)}\0${ref ?? ""}`;
474
462
  const existing = seen.get(key);
475
463
  if (existing) {
476
464
  existing.usedBy.push(filePath);
477
465
  } else {
478
- const { ref: _ref, ...checkoutRest } = repo.checkout ?? {};
479
- const hasCheckout = Object.keys(checkoutRest).length > 0;
480
466
  seen.set(key, {
481
- url: repo.source.url,
467
+ url: resolveRepoCloneUrl(repo.repo),
482
468
  ref,
483
- clone: repo.clone,
484
- checkout: hasCheckout ? checkoutRest : void 0,
469
+ sparse: repo.sparse,
470
+ ancestor: repo.ancestor,
485
471
  usedBy: [filePath]
486
472
  });
487
473
  }
@@ -531,15 +517,10 @@ function extractReposFromObject(obj) {
531
517
  const rawRepos = Array.isArray(obj.repos) ? obj.repos : [];
532
518
  const result = [];
533
519
  for (const r of rawRepos) {
534
- if (!r || typeof r !== "object" || Array.isArray(r)) continue;
535
- const repo = r;
536
- const source = parseRepoSource(repo.source);
537
- if (!source) continue;
538
- result.push({
539
- source,
540
- checkout: parseRepoCheckout(repo.checkout),
541
- clone: parseRepoClone(repo.clone)
542
- });
520
+ const parsed = parseRepoConfig(r);
521
+ if (parsed?.repo) {
522
+ result.push(parsed);
523
+ }
543
524
  }
544
525
  return result;
545
526
  }
@@ -1687,195 +1668,6 @@ async function materializeGitRun(repoDir, relativeRunPath, ref = "origin/main")
1687
1668
  rmSync(tempRoot, { recursive: true, force: true });
1688
1669
  }
1689
1670
  }
1690
- function getProjectsRegistryPath() {
1691
- return path4.join(getAgentvConfigDir(), "config.yaml");
1692
- }
1693
- function fromYaml(raw) {
1694
- if (!raw || typeof raw !== "object") return null;
1695
- const e = raw;
1696
- if (typeof e.id !== "string" || typeof e.name !== "string" || typeof e.path !== "string") {
1697
- return null;
1698
- }
1699
- const entry = {
1700
- id: e.id,
1701
- name: e.name,
1702
- path: e.path,
1703
- addedAt: typeof e.added_at === "string" ? e.added_at : "",
1704
- lastOpenedAt: typeof e.last_opened_at === "string" ? e.last_opened_at : ""
1705
- };
1706
- if (typeof e.repo_url === "string" && e.repo_url.trim().length > 0) {
1707
- entry.repoUrl = e.repo_url.trim();
1708
- }
1709
- if (typeof e.ref === "string" && e.ref.trim().length > 0) {
1710
- entry.ref = e.ref.trim();
1711
- }
1712
- if (e.results && typeof e.results === "object") {
1713
- const r = e.results;
1714
- if (typeof r.repo_url === "string" && r.repo_url.trim().length > 0) {
1715
- const sync = r.sync && typeof r.sync === "object" ? r.sync : void 0;
1716
- entry.results = {
1717
- repoUrl: r.repo_url.trim(),
1718
- ...typeof r.branch === "string" && r.branch.trim().length > 0 ? { branch: r.branch.trim() } : {},
1719
- ...typeof r.path === "string" && r.path.trim().length > 0 ? { path: r.path.trim() } : {},
1720
- ...sync && typeof sync.auto_push === "boolean" ? { sync: { autoPush: sync.auto_push } } : {},
1721
- ...typeof r.branch_prefix === "string" && r.branch_prefix.trim().length > 0 ? { branchPrefix: r.branch_prefix.trim() } : {}
1722
- };
1723
- }
1724
- }
1725
- return entry;
1726
- }
1727
- function toYaml(entry) {
1728
- const yaml = {
1729
- id: entry.id,
1730
- name: entry.name,
1731
- ...entry.repoUrl !== void 0 && { repo_url: entry.repoUrl },
1732
- path: entry.path,
1733
- ...entry.ref !== void 0 && { ref: entry.ref },
1734
- added_at: entry.addedAt,
1735
- last_opened_at: entry.lastOpenedAt
1736
- };
1737
- if (entry.results) {
1738
- yaml.results = {
1739
- repo_url: entry.results.repoUrl,
1740
- ...entry.results.branch !== void 0 && { branch: entry.results.branch },
1741
- ...entry.results.path !== void 0 && { path: entry.results.path },
1742
- ...entry.results.sync?.autoPush !== void 0 && {
1743
- sync: { auto_push: entry.results.sync.autoPush }
1744
- },
1745
- ...entry.results.branchPrefix !== void 0 && {
1746
- branch_prefix: entry.results.branchPrefix
1747
- }
1748
- };
1749
- }
1750
- return yaml;
1751
- }
1752
- function loadProjectRegistry() {
1753
- const registryPath = getProjectsRegistryPath();
1754
- if (!existsSync2(registryPath)) {
1755
- return { projects: [] };
1756
- }
1757
- try {
1758
- const raw = readFileSync3(registryPath, "utf-8");
1759
- const parsed = parseYamlValue(raw);
1760
- if (!parsed || typeof parsed !== "object") {
1761
- return { projects: [] };
1762
- }
1763
- const env = process.env;
1764
- const projects = Array.isArray(parsed.projects) ? parsed.projects.map((e) => fromYaml(interpolateEnv(e, env))).filter((e) => e !== null) : [];
1765
- return { projects };
1766
- } catch {
1767
- return { projects: [] };
1768
- }
1769
- }
1770
- function saveProjectRegistry(registry) {
1771
- const registryPath = getProjectsRegistryPath();
1772
- const dir = path4.dirname(registryPath);
1773
- if (!existsSync2(dir)) {
1774
- mkdirSync2(dir, { recursive: true });
1775
- }
1776
- const payload = { ...readHomeConfig(registryPath), projects: registry.projects.map(toYaml) };
1777
- writeFileSync2(registryPath, stringifyYaml(payload), "utf-8");
1778
- }
1779
- function readHomeConfig(configPath) {
1780
- if (!existsSync2(configPath)) return {};
1781
- try {
1782
- const parsed = parseYamlValue(readFileSync3(configPath, "utf-8"));
1783
- return parsed && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : {};
1784
- } catch {
1785
- return {};
1786
- }
1787
- }
1788
- function deriveProjectId(dirPath, existingIds) {
1789
- const base = path4.basename(dirPath).toLowerCase().replace(/[^a-z0-9-]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
1790
- let candidate = base || "project";
1791
- let suffix = 2;
1792
- while (existingIds.includes(candidate)) {
1793
- candidate = `${base}-${suffix}`;
1794
- suffix++;
1795
- }
1796
- return candidate;
1797
- }
1798
- function addProject(projectPath) {
1799
- const absPath = path4.resolve(projectPath);
1800
- if (!existsSync2(absPath)) {
1801
- throw new Error(`Directory not found: ${absPath}`);
1802
- }
1803
- if (!existsSync2(path4.join(absPath, ".agentv"))) {
1804
- throw new Error(`No .agentv/ directory found in ${absPath}. Run an evaluation first.`);
1805
- }
1806
- const registry = loadProjectRegistry();
1807
- const existing = registry.projects.find((p) => p.path === absPath);
1808
- if (existing) {
1809
- return existing;
1810
- }
1811
- const now = (/* @__PURE__ */ new Date()).toISOString();
1812
- const entry = {
1813
- id: deriveProjectId(
1814
- absPath,
1815
- registry.projects.map((p) => p.id)
1816
- ),
1817
- name: path4.basename(absPath),
1818
- path: absPath,
1819
- addedAt: now,
1820
- lastOpenedAt: now
1821
- };
1822
- registry.projects.push(entry);
1823
- saveProjectRegistry(registry);
1824
- return entry;
1825
- }
1826
- function removeProject(projectId) {
1827
- const registry = loadProjectRegistry();
1828
- const idx = registry.projects.findIndex((p) => p.id === projectId);
1829
- if (idx < 0) return false;
1830
- registry.projects.splice(idx, 1);
1831
- saveProjectRegistry(registry);
1832
- return true;
1833
- }
1834
- function getProject(projectId) {
1835
- return loadProjectRegistry().projects.find((p) => p.id === projectId);
1836
- }
1837
- function getProjectForPath(fsPath) {
1838
- const absPath = path4.resolve(fsPath);
1839
- return loadProjectRegistry().projects.filter((p) => {
1840
- const projectPath = path4.resolve(p.path);
1841
- const relative = path4.relative(projectPath, absPath);
1842
- return relative === "" || !relative.startsWith("..") && !path4.isAbsolute(relative);
1843
- }).sort((a, b) => path4.resolve(b.path).length - path4.resolve(a.path).length)[0];
1844
- }
1845
- function touchProject(projectId) {
1846
- const registry = loadProjectRegistry();
1847
- const entry = registry.projects.find((p) => p.id === projectId);
1848
- if (entry) {
1849
- entry.lastOpenedAt = (/* @__PURE__ */ new Date()).toISOString();
1850
- saveProjectRegistry(registry);
1851
- }
1852
- }
1853
- function discoverProjects(rootDir, maxDepth = 2) {
1854
- const absRoot = path4.resolve(rootDir);
1855
- if (!existsSync2(absRoot) || !statSync(absRoot).isDirectory()) {
1856
- return [];
1857
- }
1858
- const results = [];
1859
- function scan(dir, depth) {
1860
- if (depth > maxDepth) return;
1861
- if (existsSync2(path4.join(dir, ".agentv"))) {
1862
- results.push(dir);
1863
- return;
1864
- }
1865
- if (depth === maxDepth) return;
1866
- try {
1867
- const entries = readdirSync(dir, { withFileTypes: true });
1868
- for (const entry of entries) {
1869
- if (!entry.isDirectory()) continue;
1870
- if (entry.name.startsWith(".") || entry.name === "node_modules") continue;
1871
- scan(path4.join(dir, entry.name), depth + 1);
1872
- }
1873
- } catch {
1874
- }
1875
- }
1876
- scan(absRoot, 0);
1877
- return results.sort();
1878
- }
1879
1671
  async function syncProject(entry) {
1880
1672
  if (!entry.repoUrl) {
1881
1673
  throw new Error(`Project '${entry.id}' has no repo_url defined`);
@@ -1884,7 +1676,7 @@ async function syncProject(entry) {
1884
1676
  throw new Error(`Project '${entry.id}' has no ref defined`);
1885
1677
  }
1886
1678
  const dest = entry.path;
1887
- if (existsSync3(`${dest}/.git`)) {
1679
+ if (existsSync2(`${dest}/.git`)) {
1888
1680
  childProcess.execFileSync("git", ["-C", dest, "pull", "--ff-only"], { stdio: "inherit" });
1889
1681
  } else {
1890
1682
  childProcess.execFileSync(
@@ -2875,7 +2667,7 @@ function extractResponseItemContent(content) {
2875
2667
  }
2876
2668
  return parts.length > 0 ? parts.join("") : void 0;
2877
2669
  }
2878
- var DEFAULT_SESSIONS_DIR = () => path5.join(homedir(), ".codex", "sessions");
2670
+ var DEFAULT_SESSIONS_DIR = () => path4.join(homedir(), ".codex", "sessions");
2879
2671
  async function discoverCodexSessions(opts) {
2880
2672
  const sessionsDir = opts?.sessionsDir ?? DEFAULT_SESSIONS_DIR();
2881
2673
  const limit = opts?.latest ? 1 : opts?.limit ?? 10;
@@ -2887,7 +2679,7 @@ async function discoverCodexSessions(opts) {
2887
2679
  return [];
2888
2680
  }
2889
2681
  for (const year of yearDirs) {
2890
- const yearPath = path5.join(sessionsDir, year);
2682
+ const yearPath = path4.join(sessionsDir, year);
2891
2683
  let monthDirs;
2892
2684
  try {
2893
2685
  monthDirs = await readdir2(yearPath);
@@ -2895,7 +2687,7 @@ async function discoverCodexSessions(opts) {
2895
2687
  continue;
2896
2688
  }
2897
2689
  for (const month of monthDirs) {
2898
- const monthPath = path5.join(yearPath, month);
2690
+ const monthPath = path4.join(yearPath, month);
2899
2691
  let dayDirs;
2900
2692
  try {
2901
2693
  dayDirs = await readdir2(monthPath);
@@ -2907,7 +2699,7 @@ async function discoverCodexSessions(opts) {
2907
2699
  const dirDate = `${year}-${month}-${day}`;
2908
2700
  if (dirDate !== opts.date) continue;
2909
2701
  }
2910
- const dayPath = path5.join(monthPath, day);
2702
+ const dayPath = path4.join(monthPath, day);
2911
2703
  let files;
2912
2704
  try {
2913
2705
  files = await readdir2(dayPath);
@@ -2916,7 +2708,7 @@ async function discoverCodexSessions(opts) {
2916
2708
  }
2917
2709
  for (const file of files) {
2918
2710
  if (!file.startsWith("rollout-") || !file.endsWith(".jsonl")) continue;
2919
- const filePath = path5.join(dayPath, file);
2711
+ const filePath = path4.join(dayPath, file);
2920
2712
  const nameWithoutExt = file.replace(/\.jsonl$/, "");
2921
2713
  const parts = nameWithoutExt.split("-");
2922
2714
  const sessionId = parts.length >= 6 ? parts.slice(-5).join("-") : nameWithoutExt;
@@ -2935,7 +2727,7 @@ async function discoverCodexSessions(opts) {
2935
2727
  sessions.sort((a, b) => b.updatedAt.getTime() - a.updatedAt.getTime());
2936
2728
  return sessions.slice(0, limit);
2937
2729
  }
2938
- var DEFAULT_PROJECTS_DIR = () => path6.join(homedir2(), ".claude", "projects");
2730
+ var DEFAULT_PROJECTS_DIR = () => path5.join(homedir2(), ".claude", "projects");
2939
2731
  function encodeProjectPath(projectPath) {
2940
2732
  return projectPath.replace(/\//g, "-");
2941
2733
  }
@@ -2954,7 +2746,7 @@ async function discoverClaudeSessions(opts) {
2954
2746
  }
2955
2747
  const sessions = [];
2956
2748
  for (const projectDir of projectDirs) {
2957
- const dirPath = path6.join(projectsDir, projectDir);
2749
+ const dirPath = path5.join(projectsDir, projectDir);
2958
2750
  let entries;
2959
2751
  try {
2960
2752
  entries = await readdir3(dirPath);
@@ -2965,7 +2757,7 @@ async function discoverClaudeSessions(opts) {
2965
2757
  if (!entry.endsWith(".jsonl")) continue;
2966
2758
  const sessionId = entry.replace(/\.jsonl$/, "");
2967
2759
  if (opts?.sessionId && sessionId !== opts.sessionId) continue;
2968
- const filePath = path6.join(dirPath, entry);
2760
+ const filePath = path5.join(dirPath, entry);
2969
2761
  let updatedAt;
2970
2762
  try {
2971
2763
  const fileStat = await stat3(filePath);
@@ -3264,16 +3056,6 @@ export {
3264
3056
  deleteWipBranch,
3265
3057
  listGitRuns,
3266
3058
  materializeGitRun,
3267
- getProjectsRegistryPath,
3268
- loadProjectRegistry,
3269
- saveProjectRegistry,
3270
- deriveProjectId,
3271
- addProject,
3272
- removeProject,
3273
- getProject,
3274
- getProjectForPath,
3275
- touchProject,
3276
- discoverProjects,
3277
3059
  syncProject,
3278
3060
  syncProjects,
3279
3061
  trimBaselineResult,
@@ -3298,4 +3080,4 @@ export {
3298
3080
  TranscriptProvider,
3299
3081
  createAgentKernel
3300
3082
  };
3301
- //# sourceMappingURL=chunk-OYI35QFW.js.map
3083
+ //# sourceMappingURL=chunk-NLTIK3LV.js.map