From c44efe3d50e4501ded5b17dd8a1ad159270e4f4a Mon Sep 17 00:00:00 2001 From: Christopher Tso Date: Tue, 11 Nov 2025 14:08:31 +1100 Subject: [PATCH 1/4] add convenience script and fix yaml parser for windows line endings --- package.json | 3 ++- packages/core/src/evaluation/yaml-parser.ts | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 403ff283e..eabcc3bd7 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,8 @@ "test:coverage": "turbo run test:coverage", "format": "prettier --cache --write .", "format:check": "prettier --check .", - "dev": "pnpm --filter @agentevo/cli dev" + "dev": "pnpm --filter @agentevo/cli dev", + "agentevo": "node apps/cli/dist/index.js" }, "devDependencies": { "@types/node": "24.1.0", diff --git a/packages/core/src/evaluation/yaml-parser.ts b/packages/core/src/evaluation/yaml-parser.ts index 591d4789c..6623a3547 100644 --- a/packages/core/src/evaluation/yaml-parser.ts +++ b/packages/core/src/evaluation/yaml-parser.ts @@ -166,7 +166,7 @@ export async function loadTestCases( } try { - const fileContent = await readFile(resolvedPath, "utf8"); + const fileContent = (await readFile(resolvedPath, "utf8")).replace(/\r\n/g, "\n"); if (isGuidelineFile(displayPath)) { guidelinePaths.push(path.resolve(resolvedPath)); if (verbose) { @@ -253,7 +253,7 @@ export async function buildPromptInputs( } try { - const content = await readFile(absolutePath, "utf8"); + const content = (await readFile(absolutePath, "utf8")).replace(/\r\n/g, "\n"); guidelineContents.push(`=== ${path.basename(absolutePath)} ===\n${content}`); } catch (error) { logWarning(`Could not read guideline file ${absolutePath}: ${(error as Error).message}`); From 5c7c8affeff8acf6695019f812e81f9e7e478157 Mon Sep 17 00:00:00 2001 From: Christopher Tso Date: Tue, 11 Nov 2025 14:20:12 +1100 Subject: [PATCH 2/4] update AGENTS.md --- AGENTS.md | 4 ++++ package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index 5c0fb455a..5e005ac67 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,5 +1,9 @@ +# AGENTS.md + When running python scripts, ALWAYS use command `uv run `. +When functionally testing changes to the AgentEvo CLI, use `pnpm agentevo ` from the repository root to run the built version. + # OpenSpec Instructions diff --git a/package.json b/package.json index eabcc3bd7..d88aa2c47 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "@entityprocess/agentevo-workspace", + "name": "@agentevo/workspace", "version": "0.0.0", "private": true, "description": "AgentEvo monorepo workspace", From 603f0dd1074e4de0b455ca43b55ae91c5958e9fd Mon Sep 17 00:00:00 2001 From: Christopher Tso Date: Tue, 11 Nov 2025 14:30:13 +1100 Subject: [PATCH 3/4] fix: bundle @agentevo/core for npm distribution - Add noExternal config to tsup to bundle workspace dependency - Bump version to 0.1.4 - Fixes ERR_MODULE_NOT_FOUND when installing via npm --- apps/cli/package.json | 2 +- apps/cli/tsup.config.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/cli/package.json b/apps/cli/package.json index 95ff96922..57d3beb1b 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -1,6 +1,6 @@ { "name": "agentevo", - "version": "0.1.3", + "version": "0.1.4", "description": "CLI entry point for AgentEvo", "type": "module", "repository": { diff --git a/apps/cli/tsup.config.ts b/apps/cli/tsup.config.ts index aebcfaf0c..1029b141f 100644 --- a/apps/cli/tsup.config.ts +++ b/apps/cli/tsup.config.ts @@ -8,4 +8,6 @@ export default defineConfig({ dts: false, target: "node20", tsconfig: "./tsconfig.build.json", + // Bundle @agentevo/core since it's a workspace dependency + noExternal: ["@agentevo/core"], }); From 9556c01191afe70c6ade6347fabcd4235055d868 Mon Sep 17 00:00:00 2001 From: Christopher Tso Date: Tue, 11 Nov 2025 14:44:29 +1100 Subject: [PATCH 4/4] update AGENTS.md --- AGENTS.md | 53 ++++++++++++++++++++++++++++++++++++++++++++++++----- CLAUDE.md | 2 ++ 2 files changed, 50 insertions(+), 5 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 5e005ac67..d2b861ed5 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,8 +1,51 @@ -# AGENTS.md - -When running python scripts, ALWAYS use command `uv run `. - -When functionally testing changes to the AgentEvo CLI, use `pnpm agentevo ` from the repository root to run the built version. +# Repository Guidelines + +This is a TypeScript monorepo for AgentEvo - an AI agent evaluation framework. + +## Tech Stack & Tools +- **Language:** TypeScript 5.x targeting ES2022 +- **Package Manager:** pnpm 10.20.0 (use `pnpm` for all package operations) +- **Build System:** Turbo (monorepo task orchestration) +- **Bundler:** tsup (TypeScript bundler) +- **Testing:** Vitest +- **LLM Framework:** @ax-llm/ax, Vercel AI SDK +- **Validation:** Zod + +## Project Structure +- `packages/core/` - Evaluation engine, providers, grading +- `apps/cli/` - Command-line interface (published as `agentevo`) + +## Essential Commands +- `pnpm install` - Install dependencies +- `pnpm build` - Build all packages +- `pnpm test` - Run tests +- `pnpm typecheck` - Type checking +- `pnpm lint` - Lint code +- `pnpm format` - Format with Prettier + +## Functional Testing + +When functionally testing changes to the AgentEvo CLI, **NEVER** use `agentevo` directly as it may run the globally installed npm version. Instead: + +- **From repository root:** Use `pnpm agentevo ` to run the locally built version +- **From apps/cli directory:** Use `pnpm dev -- ` to run from TypeScript source with tsx + +This ensures you're testing your local changes, not the published npm package. + +## TypeScript Guidelines +- Target ES2022 with Node 20+ +- Prefer type inference over explicit types +- Use `async/await` for async operations +- Prefer named exports +- Keep modules cohesive + +## Package Publishing +- CLI package (`apps/cli`) is published as `agentevo` on npm +- Uses tsup with `noExternal: ["@agentevo/core"]` to bundle workspace dependencies +- Install command: `npm install -g agentevo` + +## Python Scripts +When running Python scripts, always use: `uv run ` # OpenSpec Instructions diff --git a/CLAUDE.md b/CLAUDE.md index 7f111dd72..07ae07c37 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,3 +1,5 @@ +Always follow instructions in `@AGENTS.md`. + # OpenSpec Instructions