Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
811 changes: 345 additions & 466 deletions package-lock.json

Large diffs are not rendered by default.

12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,18 @@
"node": ">=18.0.0"
},
"dependencies": {
"@anthropic-ai/sdk": "^0.30.1",
"@google/generative-ai": "^0.24.1",
"@perplexity-ai/perplexity_ai": "^0.16.0",
"@ai-sdk/anthropic": "^1.0.0",
"@ai-sdk/azure": "^3.0.31",
"@ai-sdk/google": "^1.0.0",
"@ai-sdk/openai": "^1.0.0",
"@ai-sdk/perplexity": "^1.0.0",
"@types/micromatch": "^4.0.9",
"ai": "^4.0.0",
"chalk": "^5.3.0",
"commander": "^12.0.0",
"fast-glob": "^3.3.2",
"fuzzball": "^2.2.3",
"micromatch": "^4.0.5",
"openai": "^4.0.0",
"smol-toml": "^1.6.0",
"strip-ansi": "^7.1.0",
"yaml": "^2.5.0",
Expand All @@ -86,4 +88,4 @@
"typescript-eslint": "^8.46.1",
"vitest": "^2.0.0"
}
}
}
33 changes: 0 additions & 33 deletions src/boundaries/api-client.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/boundaries/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
export * from './cli-parser';
export * from './config-loader';
export * from './yaml-parser';
export * from './api-client';
export * from './env-parser';
21 changes: 20 additions & 1 deletion src/cli/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,25 @@ const __filename = fileURLToPath(import.meta.url);
// eslint-disable-next-line @typescript-eslint/naming-convention
const __dirname = dirname(__filename);

/**
* Resolves the presets directory for both dev and built modes.
* - Built mode: __dirname is `dist/`, so `../presets` resolves to project root `presets/`
* - Dev mode: __dirname is `src/cli/`, so `../../presets` resolves to project root `presets/`
*/
function resolvePresetsDir(dir: string): string {
const buildPath = path.resolve(dir, '../presets');
if (existsSync(path.join(buildPath, 'meta.json'))) {
return buildPath;
}
// Dev mode fallback: src/cli/ → ../../presets
const devPath = path.resolve(dir, '../../presets');
if (existsSync(path.join(devPath, 'meta.json'))) {
return devPath;
}

throw new Error(`Could not locate presets directory containing meta.json. Looked in ${buildPath} and ${devPath}`);
}

/*
* Registers the main evaluation command with Commander.
* This is the default command that runs content evaluations against target files.
Expand Down Expand Up @@ -117,7 +136,7 @@ export function registerMainCommand(program: Command): void {

const prompts: PromptFile[] = [];
try {
const presetsDir = path.resolve(__dirname, '../presets');
const presetsDir = resolvePresetsDir(__dirname);
const presetLoader = new PresetLoader(presetsDir);
const loader = new RulePackLoader(presetLoader);

Expand Down
241 changes: 0 additions & 241 deletions src/providers/anthropic-provider.ts

This file was deleted.

Loading