agentv 4.31.2 → 4.31.3

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.
@@ -46,7 +46,7 @@ import {
46
46
  validateFileReferences,
47
47
  validateTargetsFile,
48
48
  validateWorkspacePaths
49
- } from "./chunk-B2QPMP2E.js";
49
+ } from "./chunk-CO23UZAA.js";
50
50
  import {
51
51
  RESULT_INDEX_FILENAME,
52
52
  aggregateRunDir,
@@ -72,6 +72,7 @@ import {
72
72
  scanRepoDeps,
73
73
  syncProjects,
74
74
  toTranscriptJsonLines,
75
+ touchProject,
75
76
  transpileEvalYamlFile,
76
77
  trimBaselineResult
77
78
  } from "./chunk-LOYPSIE7.js";
@@ -4054,7 +4055,7 @@ var evalRunCommand = command({
4054
4055
  },
4055
4056
  handler: async (args) => {
4056
4057
  if (args.evalPaths.length === 0 && process.stdin.isTTY) {
4057
- const { launchInteractiveWizard } = await import("./interactive-TR7LRTBF.js");
4058
+ const { launchInteractiveWizard } = await import("./interactive-QBLQNYDH.js");
4058
4059
  await launchInteractiveWizard();
4059
4060
  return;
4060
4061
  }
@@ -11008,11 +11009,18 @@ Serving most recent: ${metas[0].path}
11008
11009
  }
11009
11010
  return metas[0].path;
11010
11011
  }
11011
- function resolveDashboardMode(projectCount, options) {
11012
+ function resolveDashboardMode(_projectCount, options) {
11012
11013
  if (options.single === true) {
11013
11014
  return { projectDashboard: false };
11014
11015
  }
11015
- return { projectDashboard: projectCount > 0 };
11016
+ return { projectDashboard: true };
11017
+ }
11018
+ function bootstrapCurrentProject(cwd, options) {
11019
+ if (options.single === true) return {};
11020
+ if (!existsSync15(path21.join(cwd, ".agentv"))) return {};
11021
+ const entry = addProject(cwd);
11022
+ touchProject(entry.id);
11023
+ return { currentProjectId: entry.id };
11016
11024
  }
11017
11025
  function feedbackPath(resultDir) {
11018
11026
  return path21.join(resultDir, "feedback.json");
@@ -11632,7 +11640,8 @@ function handleConfig(c4, { agentvDir, searchDir }, options) {
11632
11640
  ...loadStudioConfig(agentvDir),
11633
11641
  read_only: options?.readOnly === true,
11634
11642
  project_name: path21.basename(searchDir),
11635
- project_dashboard: options?.projectDashboard === true
11643
+ project_dashboard: options?.projectDashboard === true,
11644
+ ...options?.currentProjectId && { current_project_id: options.currentProjectId }
11636
11645
  });
11637
11646
  }
11638
11647
  function handleFeedbackRead(c4, { searchDir }) {
@@ -11836,7 +11845,8 @@ function createApp(results, resultDir, cwd, sourceFile, options) {
11836
11845
  "/api/config",
11837
11846
  (c4) => handleConfig(c4, defaultCtx, {
11838
11847
  readOnly,
11839
- projectDashboard: options?.projectDashboard
11848
+ projectDashboard: options?.projectDashboard,
11849
+ currentProjectId: options?.currentProjectId
11840
11850
  })
11841
11851
  );
11842
11852
  app2.get("/api/remote/status", async (c4) => c4.json(await getRemoteResultsStatus(searchDir)));
@@ -12137,9 +12147,12 @@ var resultsServeCommand = command({
12137
12147
  if (yamlConfig?.required_version) {
12138
12148
  await enforceRequiredVersion(yamlConfig.required_version);
12139
12149
  }
12150
+ const { currentProjectId } = bootstrapCurrentProject(cwd, { single });
12140
12151
  const registry = loadProjectRegistry();
12141
12152
  const { projectDashboard } = resolveDashboardMode(registry.projects.length, { single });
12142
- syncProjects(registry.projects).catch((err2) => console.error("Background project sync failed:", err2));
12153
+ syncProjects(registry.projects).catch(
12154
+ (err2) => console.error("Background project sync failed:", err2)
12155
+ );
12143
12156
  try {
12144
12157
  let results = [];
12145
12158
  let sourceFile;
@@ -12163,10 +12176,14 @@ var resultsServeCommand = command({
12163
12176
  const resultDir = sourceFile ? path21.dirname(path21.resolve(sourceFile)) : cwd;
12164
12177
  const app2 = createApp(results, resultDir, cwd, sourceFile, {
12165
12178
  readOnly,
12166
- projectDashboard
12179
+ projectDashboard,
12180
+ currentProjectId
12167
12181
  });
12168
12182
  if (projectDashboard) {
12169
12183
  console.log(`Project dashboard: ${registry.projects.length} project(s) registered`);
12184
+ if (currentProjectId) {
12185
+ console.log(`Default project: ${currentProjectId}`);
12186
+ }
12170
12187
  } else if (results.length > 0 && sourceFile) {
12171
12188
  console.log(`Serving ${results.length} result(s) from ${sourceFile}`);
12172
12189
  } else {
@@ -13646,4 +13663,4 @@ export {
13646
13663
  preprocessArgv,
13647
13664
  runCli
13648
13665
  };
13649
- //# sourceMappingURL=chunk-2WKSJ7MB.js.map
13666
+ //# sourceMappingURL=chunk-4POCDPC2.js.map