@agentv/core 0.7.4 → 0.7.5

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/dist/index.cjs CHANGED
@@ -52,6 +52,7 @@ __export(index_exports, {
52
52
  isTestMessageRole: () => isTestMessageRole,
53
53
  listTargetNames: () => listTargetNames,
54
54
  loadEvalCases: () => loadEvalCases,
55
+ normalizeLineEndings: () => normalizeLineEndings,
55
56
  readTargetDefinitions: () => readTargetDefinitions,
56
57
  readTextFile: () => readTextFile,
57
58
  resolveAndCreateProvider: () => resolveAndCreateProvider,
@@ -133,9 +134,12 @@ async function fileExists(filePath) {
133
134
  return false;
134
135
  }
135
136
  }
137
+ function normalizeLineEndings(content) {
138
+ return content.replace(/\r\n/g, "\n");
139
+ }
136
140
  async function readTextFile(filePath) {
137
141
  const content = await (0, import_promises.readFile)(filePath, "utf8");
138
- return content.replace(/\r\n/g, "\n");
142
+ return normalizeLineEndings(content);
139
143
  }
140
144
  async function findGitRoot(startPath) {
141
145
  let currentDir = import_node_path.default.dirname(import_node_path.default.resolve(startPath));
@@ -959,7 +963,6 @@ async function defaultCommandRunner(command, options) {
959
963
  };
960
964
  try {
961
965
  const { stdout, stderr } = await execAsync(command, execOptions);
962
- console.error(`[CLI DEBUG] SUCCESS - stdout: ${stdout.length} bytes, stderr: ${stderr.length} bytes`);
963
966
  return {
964
967
  stdout,
965
968
  stderr,
@@ -970,8 +973,6 @@ async function defaultCommandRunner(command, options) {
970
973
  };
971
974
  } catch (error) {
972
975
  const execError = error;
973
- console.error(`[CLI DEBUG] ERROR - code: ${execError.code}, message: ${execError.message}`);
974
- console.error(`[CLI DEBUG] stdout: ${execError.stdout?.length ?? 0} bytes, stderr: ${execError.stderr?.length ?? 0} bytes`);
975
976
  return {
976
977
  stdout: execError.stdout ?? "",
977
978
  stderr: execError.stderr ?? "",
@@ -1039,7 +1040,7 @@ var CliProvider = class {
1039
1040
  }
1040
1041
  async readAndCleanupOutputFile(filePath) {
1041
1042
  try {
1042
- const content = await import_promises3.default.readFile(filePath, "utf-8");
1043
+ const content = await readTextFile(filePath);
1043
1044
  return content;
1044
1045
  } catch (error) {
1045
1046
  const errorMsg = error instanceof Error ? error.message : String(error);
@@ -4078,6 +4079,7 @@ function createAgentKernel() {
4078
4079
  isTestMessageRole,
4079
4080
  listTargetNames,
4080
4081
  loadEvalCases,
4082
+ normalizeLineEndings,
4081
4083
  readTargetDefinitions,
4082
4084
  readTextFile,
4083
4085
  resolveAndCreateProvider,