@gnsx/genesys.agent.eval 1.0.0 → 1.0.2
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/bundle/cli.js +1149 -0
- package/dist/bundle/cli.js.map +1 -0
- package/dist/src/args.d.ts +2 -16
- package/dist/src/args.d.ts.map +1 -1
- package/dist/src/args.js +57 -207
- package/dist/src/args.js.map +1 -1
- package/dist/src/{launcher.d.ts → cli.d.ts} +1 -1
- package/dist/src/cli.d.ts.map +1 -0
- package/dist/src/{launcher.js → cli.js} +5 -11
- package/dist/src/cli.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/tsup.config.d.ts +3 -0
- package/dist/tsup.config.d.ts.map +1 -0
- package/dist/tsup.config.js +13 -0
- package/dist/tsup.config.js.map +1 -0
- package/package.json +20 -16
- package/dist/src/adapters/anthropic-adapter.d.ts +0 -24
- package/dist/src/adapters/anthropic-adapter.d.ts.map +0 -1
- package/dist/src/adapters/anthropic-adapter.js +0 -80
- package/dist/src/adapters/anthropic-adapter.js.map +0 -1
- package/dist/src/adapters/gemini-adapter.d.ts +0 -23
- package/dist/src/adapters/gemini-adapter.d.ts.map +0 -1
- package/dist/src/adapters/gemini-adapter.js +0 -79
- package/dist/src/adapters/gemini-adapter.js.map +0 -1
- package/dist/src/adapters/ollama-adapter.d.ts +0 -28
- package/dist/src/adapters/ollama-adapter.d.ts.map +0 -1
- package/dist/src/adapters/ollama-adapter.js +0 -54
- package/dist/src/adapters/ollama-adapter.js.map +0 -1
- package/dist/src/adapters/openai-adapter.d.ts +0 -24
- package/dist/src/adapters/openai-adapter.d.ts.map +0 -1
- package/dist/src/adapters/openai-adapter.js +0 -80
- package/dist/src/adapters/openai-adapter.js.map +0 -1
- package/dist/src/adapters/pi-adapter.d.ts +0 -27
- package/dist/src/adapters/pi-adapter.d.ts.map +0 -1
- package/dist/src/adapters/pi-adapter.js +0 -136
- package/dist/src/adapters/pi-adapter.js.map +0 -1
- package/dist/src/agent-adapter.d.ts +0 -130
- package/dist/src/agent-adapter.d.ts.map +0 -1
- package/dist/src/agent-adapter.js +0 -134
- package/dist/src/agent-adapter.js.map +0 -1
- package/dist/src/launcher.d.ts.map +0 -1
- package/dist/src/launcher.js.map +0 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const _default: import("tsup").Options | import("tsup").Options[] | ((overrideOptions: import("tsup").Options) => import("tsup").Options | import("tsup").Options[] | Promise<import("tsup").Options | import("tsup").Options[]>);
|
|
2
|
+
export default _default;
|
|
3
|
+
//# sourceMappingURL=tsup.config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tsup.config.d.ts","sourceRoot":"","sources":["../tsup.config.ts"],"names":[],"mappings":";AAEA,wBAUG"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { defineConfig } from 'tsup';
|
|
2
|
+
export default defineConfig({
|
|
3
|
+
entry: ['src/cli.ts'],
|
|
4
|
+
outDir: 'dist/bundle',
|
|
5
|
+
format: 'esm',
|
|
6
|
+
platform: 'node',
|
|
7
|
+
bundle: true,
|
|
8
|
+
splitting: false,
|
|
9
|
+
sourcemap: true,
|
|
10
|
+
clean: true,
|
|
11
|
+
external: ['@mariozechner/*', 'commander', 'dotenv'],
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=tsup.config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tsup.config.js","sourceRoot":"","sources":["../tsup.config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAEpC,eAAe,YAAY,CAAC;IAC1B,KAAK,EAAE,CAAC,YAAY,CAAC;IACrB,MAAM,EAAE,aAAa;IACrB,MAAM,EAAE,KAAK;IACb,QAAQ,EAAE,MAAM;IAChB,MAAM,EAAE,IAAI;IACZ,SAAS,EAAE,KAAK;IAChB,SAAS,EAAE,IAAI;IACf,KAAK,EAAE,IAAI;IACX,QAAQ,EAAE,CAAC,iBAAiB,EAAE,WAAW,EAAE,QAAQ,CAAC;CACrD,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gnsx/genesys.agent.eval",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Agent evaluation harness for benchmarking AI agents against test suites",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
8
8
|
},
|
|
9
9
|
"bin": {
|
|
10
|
-
"genesys-eval": "./dist/
|
|
10
|
+
"genesys-eval": "./dist/bundle/cli.js"
|
|
11
11
|
},
|
|
12
12
|
"exports": {
|
|
13
13
|
".": "./dist/index.js",
|
|
@@ -18,24 +18,28 @@
|
|
|
18
18
|
"dist",
|
|
19
19
|
"examples"
|
|
20
20
|
],
|
|
21
|
-
"scripts": {
|
|
22
|
-
"compile": "run-cmd tsc --build",
|
|
23
|
-
"build": "run-cmd tsc --build",
|
|
24
|
-
"dev": "tsx src/launcher.ts",
|
|
25
|
-
"lint": "run-cmd run-eslint ."
|
|
26
|
-
},
|
|
27
21
|
"dependencies": {
|
|
28
22
|
"@ai-sdk/anthropic": "^1.0.0",
|
|
29
23
|
"@ai-sdk/google": "^1.0.0",
|
|
30
24
|
"@ai-sdk/openai": "^1.0.0",
|
|
31
|
-
"@huggingface/transformers": "
|
|
32
|
-
"ai": "
|
|
33
|
-
"
|
|
34
|
-
"
|
|
25
|
+
"@huggingface/transformers": "^3.8.1",
|
|
26
|
+
"ai": "^6.0.116",
|
|
27
|
+
"commander": "^14.0.2",
|
|
28
|
+
"yaml": "^2.8.1",
|
|
29
|
+
"zod": "^3.25.76"
|
|
35
30
|
},
|
|
36
31
|
"devDependencies": {
|
|
37
|
-
"@
|
|
38
|
-
"
|
|
32
|
+
"@types/node": "^25.0.9",
|
|
33
|
+
"tsup": "^8.5.1",
|
|
34
|
+
"@gnsx/cli-utils": "1.0.0",
|
|
35
|
+
"@gnsx/dev-tools": "1.0.0"
|
|
39
36
|
},
|
|
40
|
-
"license": "UNLICENSED"
|
|
41
|
-
|
|
37
|
+
"license": "UNLICENSED",
|
|
38
|
+
"scripts": {
|
|
39
|
+
"compile": "run-cmd tsc --build",
|
|
40
|
+
"bundle": "tsup",
|
|
41
|
+
"build": "run-cmd tsc --build && pnpm bundle",
|
|
42
|
+
"dev": "tsx src/cli.ts",
|
|
43
|
+
"lint": "run-cmd run-eslint ."
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Direct Anthropic API adapter using the Vercel AI SDK.
|
|
3
|
-
*
|
|
4
|
-
* @module adapters/anthropic-adapter
|
|
5
|
-
*/
|
|
6
|
-
import { BaseAgentAdapter } from '../agent-adapter.js';
|
|
7
|
-
import type { AgentConfig, AgentResponse, TestCase } from '../types.js';
|
|
8
|
-
/**
|
|
9
|
-
* Agent adapter for direct Anthropic API access.
|
|
10
|
-
*
|
|
11
|
-
* Uses the Vercel AI SDK for clean integration with retry logic,
|
|
12
|
-
* streaming support, and proper error handling.
|
|
13
|
-
*/
|
|
14
|
-
export declare class AnthropicAdapter extends BaseAgentAdapter {
|
|
15
|
-
readonly name = "anthropic";
|
|
16
|
-
private _model;
|
|
17
|
-
private _apiKey?;
|
|
18
|
-
constructor();
|
|
19
|
-
get model(): string;
|
|
20
|
-
initialize(config: AgentConfig): Promise<void>;
|
|
21
|
-
run(test: TestCase, suiteContext?: string): Promise<AgentResponse>;
|
|
22
|
-
dispose(): Promise<void>;
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=anthropic-adapter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic-adapter.d.ts","sourceRoot":"","sources":["../../../src/adapters/anthropic-adapter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAEL,gBAAgB,EAEjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAExE;;;;;GAKG;AACH,qBAAa,gBAAiB,SAAQ,gBAAgB;IACpD,QAAQ,CAAC,IAAI,eAAe;IAE5B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,OAAO,CAAC,CAAS;;IAOzB,IAAI,KAAK,IAAI,MAAM,CAElB;IAEK,UAAU,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAkB9C,GAAG,CAAC,IAAI,EAAE,QAAQ,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IA4ClE,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAI/B"}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Direct Anthropic API adapter using the Vercel AI SDK.
|
|
3
|
-
*
|
|
4
|
-
* @module adapters/anthropic-adapter
|
|
5
|
-
*/
|
|
6
|
-
import { anthropic } from '@ai-sdk/anthropic';
|
|
7
|
-
import { generateText } from 'ai';
|
|
8
|
-
import { AdapterError, BaseAgentAdapter, registerAdapter, } from '../agent-adapter.js';
|
|
9
|
-
/**
|
|
10
|
-
* Agent adapter for direct Anthropic API access.
|
|
11
|
-
*
|
|
12
|
-
* Uses the Vercel AI SDK for clean integration with retry logic,
|
|
13
|
-
* streaming support, and proper error handling.
|
|
14
|
-
*/
|
|
15
|
-
export class AnthropicAdapter extends BaseAgentAdapter {
|
|
16
|
-
name = 'anthropic';
|
|
17
|
-
_model;
|
|
18
|
-
_apiKey;
|
|
19
|
-
constructor() {
|
|
20
|
-
super();
|
|
21
|
-
this._model = 'claude-3-5-sonnet-20241022';
|
|
22
|
-
}
|
|
23
|
-
get model() {
|
|
24
|
-
return this._model;
|
|
25
|
-
}
|
|
26
|
-
async initialize(config) {
|
|
27
|
-
await super.initialize(config);
|
|
28
|
-
// Check for API key
|
|
29
|
-
this._apiKey = process.env.ANTHROPIC_API_KEY;
|
|
30
|
-
if (!this._apiKey) {
|
|
31
|
-
throw new AdapterError('ANTHROPIC_API_KEY environment variable is required', this.name);
|
|
32
|
-
}
|
|
33
|
-
// Set model if provided
|
|
34
|
-
if (config.model) {
|
|
35
|
-
this._model = config.model;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
async run(test, suiteContext) {
|
|
39
|
-
this.assertInitialized();
|
|
40
|
-
const prompt = this.buildPrompt(test, suiteContext);
|
|
41
|
-
const startTime = Date.now();
|
|
42
|
-
try {
|
|
43
|
-
const result = await generateText({
|
|
44
|
-
model: anthropic(this._model),
|
|
45
|
-
messages: [
|
|
46
|
-
{
|
|
47
|
-
role: 'user',
|
|
48
|
-
content: prompt,
|
|
49
|
-
},
|
|
50
|
-
],
|
|
51
|
-
});
|
|
52
|
-
const durationMs = Date.now() - startTime;
|
|
53
|
-
// Extract usage information safely
|
|
54
|
-
const usage = result.usage;
|
|
55
|
-
const tokensUsed = usage ? {
|
|
56
|
-
prompt: usage.promptTokens ?? 0,
|
|
57
|
-
completion: usage.completionTokens ?? 0,
|
|
58
|
-
total: usage.totalTokens ?? 0,
|
|
59
|
-
} : undefined;
|
|
60
|
-
return {
|
|
61
|
-
output: result.text,
|
|
62
|
-
metadata: {
|
|
63
|
-
model: `anthropic/${this._model}`,
|
|
64
|
-
tokensUsed,
|
|
65
|
-
durationMs,
|
|
66
|
-
},
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
catch (error) {
|
|
70
|
-
throw new AdapterError(`Anthropic API call failed: ${error instanceof Error ? error.message : String(error)}`, this.name, error);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
async dispose() {
|
|
74
|
-
this._apiKey = undefined;
|
|
75
|
-
await super.dispose();
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
// Register the adapter
|
|
79
|
-
registerAdapter('anthropic', () => new AnthropicAdapter());
|
|
80
|
-
//# sourceMappingURL=anthropic-adapter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic-adapter.js","sourceRoot":"","sources":["../../../src/adapters/anthropic-adapter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAElC,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,eAAe,GAChB,MAAM,qBAAqB,CAAC;AAG7B;;;;;GAKG;AACH,MAAM,OAAO,gBAAiB,SAAQ,gBAAgB;IAC3C,IAAI,GAAG,WAAW,CAAC;IAEpB,MAAM,CAAS;IACf,OAAO,CAAU;IAEzB;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,MAAM,GAAG,4BAA4B,CAAC;IAC7C,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,MAAmB;QAClC,MAAM,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAE/B,oBAAoB;QACpB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;QAC7C,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YAClB,MAAM,IAAI,YAAY,CACpB,oDAAoD,EACpD,IAAI,CAAC,IAAI,CACV,CAAC;QACJ,CAAC;QAED,wBAAwB;QACxB,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;YACjB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC;QAC7B,CAAC;IACH,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,IAAc,EAAE,YAAqB;QAC7C,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAEzB,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW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AACvB,eAAe,CAAC,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI,gBAAgB,EAAE,CAAC,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Google Gemini API adapter using the Vercel AI SDK.
|
|
3
|
-
*
|
|
4
|
-
* @module adapters/gemini-adapter
|
|
5
|
-
*/
|
|
6
|
-
import { BaseAgentAdapter } from '../agent-adapter.js';
|
|
7
|
-
import type { AgentConfig, AgentResponse, TestCase } from '../types.js';
|
|
8
|
-
/**
|
|
9
|
-
* Agent adapter for Google Gemini API.
|
|
10
|
-
*
|
|
11
|
-
* Uses the Vercel AI SDK for clean integration with Google's Gemini models.
|
|
12
|
-
*/
|
|
13
|
-
export declare class GeminiAdapter extends BaseAgentAdapter {
|
|
14
|
-
readonly name = "gemini";
|
|
15
|
-
private _model;
|
|
16
|
-
private _apiKey?;
|
|
17
|
-
constructor();
|
|
18
|
-
get model(): string;
|
|
19
|
-
initialize(config: AgentConfig): Promise<void>;
|
|
20
|
-
run(test: TestCase, suiteContext?: string): Promise<AgentResponse>;
|
|
21
|
-
dispose(): Promise<void>;
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=gemini-adapter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gemini-adapter.d.ts","sourceRoot":"","sources":["../../../src/adapters/gemini-adapter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAEL,gBAAgB,EAEjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAExE;;;;GAIG;AACH,qBAAa,aAAc,SAAQ,gBAAgB;IACjD,QAAQ,CAAC,IAAI,YAAY;IAEzB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,OAAO,CAAC,CAAS;;IAOzB,IAAI,KAAK,IAAI,MAAM,CAElB;IAEK,UAAU,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAkB9C,GAAG,CAAC,IAAI,EAAE,QAAQ,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IA4ClE,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAI/B"}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Google Gemini API adapter using the Vercel AI SDK.
|
|
3
|
-
*
|
|
4
|
-
* @module adapters/gemini-adapter
|
|
5
|
-
*/
|
|
6
|
-
import { google } from '@ai-sdk/google';
|
|
7
|
-
import { generateText } from 'ai';
|
|
8
|
-
import { AdapterError, BaseAgentAdapter, registerAdapter, } from '../agent-adapter.js';
|
|
9
|
-
/**
|
|
10
|
-
* Agent adapter for Google Gemini API.
|
|
11
|
-
*
|
|
12
|
-
* Uses the Vercel AI SDK for clean integration with Google's Gemini models.
|
|
13
|
-
*/
|
|
14
|
-
export class GeminiAdapter extends BaseAgentAdapter {
|
|
15
|
-
name = 'gemini';
|
|
16
|
-
_model;
|
|
17
|
-
_apiKey;
|
|
18
|
-
constructor() {
|
|
19
|
-
super();
|
|
20
|
-
this._model = 'gemini-1.5-pro';
|
|
21
|
-
}
|
|
22
|
-
get model() {
|
|
23
|
-
return this._model;
|
|
24
|
-
}
|
|
25
|
-
async initialize(config) {
|
|
26
|
-
await super.initialize(config);
|
|
27
|
-
// Check for API key
|
|
28
|
-
this._apiKey = process.env.GOOGLE_GENERATIVE_AI_API_KEY;
|
|
29
|
-
if (!this._apiKey) {
|
|
30
|
-
throw new AdapterError('GOOGLE_GENERATIVE_AI_API_KEY environment variable is required', this.name);
|
|
31
|
-
}
|
|
32
|
-
// Set model if provided
|
|
33
|
-
if (config.model) {
|
|
34
|
-
this._model = config.model;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
async run(test, suiteContext) {
|
|
38
|
-
this.assertInitialized();
|
|
39
|
-
const prompt = this.buildPrompt(test, suiteContext);
|
|
40
|
-
const startTime = Date.now();
|
|
41
|
-
try {
|
|
42
|
-
const result = await generateText({
|
|
43
|
-
model: google(this._model),
|
|
44
|
-
messages: [
|
|
45
|
-
{
|
|
46
|
-
role: 'user',
|
|
47
|
-
content: prompt,
|
|
48
|
-
},
|
|
49
|
-
],
|
|
50
|
-
});
|
|
51
|
-
const durationMs = Date.now() - startTime;
|
|
52
|
-
// Extract usage information safely
|
|
53
|
-
const usage = result.usage;
|
|
54
|
-
const tokensUsed = usage ? {
|
|
55
|
-
prompt: usage.promptTokens ?? 0,
|
|
56
|
-
completion: usage.completionTokens ?? 0,
|
|
57
|
-
total: usage.totalTokens ?? 0,
|
|
58
|
-
} : undefined;
|
|
59
|
-
return {
|
|
60
|
-
output: result.text,
|
|
61
|
-
metadata: {
|
|
62
|
-
model: `google/${this._model}`,
|
|
63
|
-
tokensUsed,
|
|
64
|
-
durationMs,
|
|
65
|
-
},
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
catch (error) {
|
|
69
|
-
throw new AdapterError(`Gemini API call failed: ${error instanceof Error ? error.message : String(error)}`, this.name, error);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
async dispose() {
|
|
73
|
-
this._apiKey = undefined;
|
|
74
|
-
await super.dispose();
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
// Register the adapter
|
|
78
|
-
registerAdapter('gemini', () => new GeminiAdapter());
|
|
79
|
-
//# sourceMappingURL=gemini-adapter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gemini-adapter.js","sourceRoot":"","sources":["../../../src/adapters/gemini-adapter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAElC,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,eAAe,GAChB,MAAM,qBAAq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;YAE1C,mCAAmC;YACnC,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;YAC3B,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC;gBACzB,MAAM,EAAG,KAAmC,CAAC,YAAY,IAAI,CAAC;gBAC9D,UAAU,EAAG,KAAuC,CAAC,gBAAgB,IAAI,CAAC;gBAC1E,KAAK,EAAG,KAAkC,CAAC,WAAW,IAAI,CAAC;aAC5D,CAAC,CAAC,CAAC,SAAS,CAAC;YAEd,OAAO;gBACL,MAAM,EAAE,MAAM,CAAC,IAAI;gBACnB,QAAQ,EAAE;oBACR,KAAK,EAAE,UAAU,IAAI,CAAC,MAAM,EAAE;oBAC9B,UAAU;oBACV,UAAU;iBACX;aACF,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,YAAY,CACpB,2BAA2B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EACnF,IAAI,CAAC,IAAI,EACT,KAAK,CACN,CAAC;QACJ,CAAC;IACH,CAAC;IAED,KAAK,CAAC,OAAO;QACX,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC;QACzB,MAAM,KAAK,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;CACF;AAED,uBAAuB;AACvB,eAAe,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,aAAa,EAAE,CAAC,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Ollama local model adapter stub.
|
|
3
|
-
*
|
|
4
|
-
* @module adapters/ollama-adapter
|
|
5
|
-
*
|
|
6
|
-
* @remarks
|
|
7
|
-
* This is a stub implementation. The @ai-sdk/ollama package is not yet available.
|
|
8
|
-
* When it becomes available, this adapter should be updated to use it.
|
|
9
|
-
*/
|
|
10
|
-
import { BaseAgentAdapter } from '../agent-adapter.js';
|
|
11
|
-
import type { AgentConfig, AgentResponse, TestCase } from '../types.js';
|
|
12
|
-
/**
|
|
13
|
-
* Agent adapter stub for Ollama local models.
|
|
14
|
-
*
|
|
15
|
-
* @remarks
|
|
16
|
-
* Not yet implemented - requires @ai-sdk/ollama package.
|
|
17
|
-
*/
|
|
18
|
-
export declare class OllamaAdapter extends BaseAgentAdapter {
|
|
19
|
-
readonly name = "ollama";
|
|
20
|
-
private _model;
|
|
21
|
-
private _baseUrl;
|
|
22
|
-
constructor();
|
|
23
|
-
get model(): string;
|
|
24
|
-
initialize(config: AgentConfig): Promise<void>;
|
|
25
|
-
run(_test: TestCase, _suiteContext?: string): Promise<AgentResponse>;
|
|
26
|
-
dispose(): Promise<void>;
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=ollama-adapter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ollama-adapter.d.ts","sourceRoot":"","sources":["../../../src/adapters/ollama-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAEL,gBAAgB,EAEjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAExE;;;;;GAKG;AACH,qBAAa,aAAc,SAAQ,gBAAgB;IACjD,QAAQ,CAAC,IAAI,YAAY;IAEzB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,QAAQ,CAAS;;IAQzB,IAAI,KAAK,IAAI,MAAM,CAElB;IAEK,UAAU,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAsB9C,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAOpE,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAG/B"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Ollama local model adapter stub.
|
|
3
|
-
*
|
|
4
|
-
* @module adapters/ollama-adapter
|
|
5
|
-
*
|
|
6
|
-
* @remarks
|
|
7
|
-
* This is a stub implementation. The @ai-sdk/ollama package is not yet available.
|
|
8
|
-
* When it becomes available, this adapter should be updated to use it.
|
|
9
|
-
*/
|
|
10
|
-
import { AdapterError, BaseAgentAdapter, registerAdapter, } from '../agent-adapter.js';
|
|
11
|
-
/**
|
|
12
|
-
* Agent adapter stub for Ollama local models.
|
|
13
|
-
*
|
|
14
|
-
* @remarks
|
|
15
|
-
* Not yet implemented - requires @ai-sdk/ollama package.
|
|
16
|
-
*/
|
|
17
|
-
export class OllamaAdapter extends BaseAgentAdapter {
|
|
18
|
-
name = 'ollama';
|
|
19
|
-
_model;
|
|
20
|
-
_baseUrl;
|
|
21
|
-
constructor() {
|
|
22
|
-
super();
|
|
23
|
-
this._model = 'llama3.1';
|
|
24
|
-
this._baseUrl = 'http://localhost:11434';
|
|
25
|
-
}
|
|
26
|
-
get model() {
|
|
27
|
-
return this._model;
|
|
28
|
-
}
|
|
29
|
-
async initialize(config) {
|
|
30
|
-
await super.initialize(config);
|
|
31
|
-
// Set model if provided
|
|
32
|
-
if (config.model) {
|
|
33
|
-
this._model = config.model;
|
|
34
|
-
}
|
|
35
|
-
// Allow custom base URL via options or env var
|
|
36
|
-
if (config.options?.baseUrl) {
|
|
37
|
-
this._baseUrl = config.options.baseUrl;
|
|
38
|
-
}
|
|
39
|
-
else if (process.env.OLLAMA_BASE_URL) {
|
|
40
|
-
this._baseUrl = process.env.OLLAMA_BASE_URL;
|
|
41
|
-
}
|
|
42
|
-
// Check if Ollama is available
|
|
43
|
-
throw new AdapterError('Ollama adapter is not yet implemented. The @ai-sdk/ollama package is required but not available.', this.name);
|
|
44
|
-
}
|
|
45
|
-
async run(_test, _suiteContext) {
|
|
46
|
-
throw new AdapterError('Ollama adapter is not yet implemented', this.name);
|
|
47
|
-
}
|
|
48
|
-
async dispose() {
|
|
49
|
-
await super.dispose();
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
// Register the adapter
|
|
53
|
-
registerAdapter('ollama', () => new OllamaAdapter());
|
|
54
|
-
//# sourceMappingURL=ollama-adapter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ollama-adapter.js","sourceRoot":"","sources":["../../../src/adapters/ollama-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,eAAe,GAChB,MAAM,qBAAqB,CAAC;AAG7B;;;;;GAKG;AACH,MAAM,OAAO,aAAc,SAAQ,gBAAgB;IACxC,IAAI,GAAG,QAAQ,CAAC;IAEjB,MAAM,CAAS;IACf,QAAQ,CAAS;IAEzB;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC;QACzB,IAAI,CAAC,QAAQ,GAAG,wBAAwB,CAAC;IAC3C,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,MAAmB;QAClC,MAAM,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAE/B,wBAAwB;QACxB,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;YACjB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC;QAC7B,CAAC;QAED,+CAA+C;QAC/C,IAAI,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC;YAC5B,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,OAAiB,CAAC;QACnD,CAAC;aAAM,IAAI,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,CAAC;YACvC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;QAC9C,CAAC;QAED,+BAA+B;QAC/B,MAAM,IAAI,YAAY,CACpB,kGAAkG,EAClG,IAAI,CAAC,IAAI,CACV,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,KAAe,EAAE,aAAsB;QAC/C,MAAM,IAAI,YAAY,CACpB,uCAAuC,EACvC,IAAI,CAAC,IAAI,CACV,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,OAAO;QACX,MAAM,KAAK,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;CACF;AAED,uBAAuB;AACvB,eAAe,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,aAAa,EAAE,CAAC,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Direct OpenAI API adapter using the Vercel AI SDK.
|
|
3
|
-
*
|
|
4
|
-
* @module adapters/openai-adapter
|
|
5
|
-
*/
|
|
6
|
-
import { BaseAgentAdapter } from '../agent-adapter.js';
|
|
7
|
-
import type { AgentConfig, AgentResponse, TestCase } from '../types.js';
|
|
8
|
-
/**
|
|
9
|
-
* Agent adapter for direct OpenAI API access.
|
|
10
|
-
*
|
|
11
|
-
* Uses the Vercel AI SDK for clean integration with retry logic,
|
|
12
|
-
* streaming support, and proper error handling.
|
|
13
|
-
*/
|
|
14
|
-
export declare class OpenAIAdapter extends BaseAgentAdapter {
|
|
15
|
-
readonly name = "openai";
|
|
16
|
-
private _model;
|
|
17
|
-
private _apiKey?;
|
|
18
|
-
constructor();
|
|
19
|
-
get model(): string;
|
|
20
|
-
initialize(config: AgentConfig): Promise<void>;
|
|
21
|
-
run(test: TestCase, suiteContext?: string): Promise<AgentResponse>;
|
|
22
|
-
dispose(): Promise<void>;
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=openai-adapter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"openai-adapter.d.ts","sourceRoot":"","sources":["../../../src/adapters/openai-adapter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAEL,gBAAgB,EAEjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAExE;;;;;GAKG;AACH,qBAAa,aAAc,SAAQ,gBAAgB;IACjD,QAAQ,CAAC,IAAI,YAAY;IAEzB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,OAAO,CAAC,CAAS;;IAOzB,IAAI,KAAK,IAAI,MAAM,CAElB;IAEK,UAAU,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAkB9C,GAAG,CAAC,IAAI,EAAE,QAAQ,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IA4ClE,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAI/B"}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Direct OpenAI API adapter using the Vercel AI SDK.
|
|
3
|
-
*
|
|
4
|
-
* @module adapters/openai-adapter
|
|
5
|
-
*/
|
|
6
|
-
import { openai } from '@ai-sdk/openai';
|
|
7
|
-
import { generateText } from 'ai';
|
|
8
|
-
import { AdapterError, BaseAgentAdapter, registerAdapter, } from '../agent-adapter.js';
|
|
9
|
-
/**
|
|
10
|
-
* Agent adapter for direct OpenAI API access.
|
|
11
|
-
*
|
|
12
|
-
* Uses the Vercel AI SDK for clean integration with retry logic,
|
|
13
|
-
* streaming support, and proper error handling.
|
|
14
|
-
*/
|
|
15
|
-
export class OpenAIAdapter extends BaseAgentAdapter {
|
|
16
|
-
name = 'openai';
|
|
17
|
-
_model;
|
|
18
|
-
_apiKey;
|
|
19
|
-
constructor() {
|
|
20
|
-
super();
|
|
21
|
-
this._model = 'gpt-4o';
|
|
22
|
-
}
|
|
23
|
-
get model() {
|
|
24
|
-
return this._model;
|
|
25
|
-
}
|
|
26
|
-
async initialize(config) {
|
|
27
|
-
await super.initialize(config);
|
|
28
|
-
// Check for API key
|
|
29
|
-
this._apiKey = process.env.OPENAI_API_KEY;
|
|
30
|
-
if (!this._apiKey) {
|
|
31
|
-
throw new AdapterError('OPENAI_API_KEY environment variable is required', this.name);
|
|
32
|
-
}
|
|
33
|
-
// Set model if provided
|
|
34
|
-
if (config.model) {
|
|
35
|
-
this._model = config.model;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
async run(test, suiteContext) {
|
|
39
|
-
this.assertInitialized();
|
|
40
|
-
const prompt = this.buildPrompt(test, suiteContext);
|
|
41
|
-
const startTime = Date.now();
|
|
42
|
-
try {
|
|
43
|
-
const result = await generateText({
|
|
44
|
-
model: openai(this._model),
|
|
45
|
-
messages: [
|
|
46
|
-
{
|
|
47
|
-
role: 'user',
|
|
48
|
-
content: prompt,
|
|
49
|
-
},
|
|
50
|
-
],
|
|
51
|
-
});
|
|
52
|
-
const durationMs = Date.now() - startTime;
|
|
53
|
-
// Extract usage information safely
|
|
54
|
-
const usage = result.usage;
|
|
55
|
-
const tokensUsed = usage ? {
|
|
56
|
-
prompt: usage.promptTokens ?? 0,
|
|
57
|
-
completion: usage.completionTokens ?? 0,
|
|
58
|
-
total: usage.totalTokens ?? 0,
|
|
59
|
-
} : undefined;
|
|
60
|
-
return {
|
|
61
|
-
output: result.text,
|
|
62
|
-
metadata: {
|
|
63
|
-
model: `openai/${this._model}`,
|
|
64
|
-
tokensUsed,
|
|
65
|
-
durationMs,
|
|
66
|
-
},
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
catch (error) {
|
|
70
|
-
throw new AdapterError(`OpenAI API call failed: ${error instanceof Error ? error.message : String(error)}`, this.name, error);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
async dispose() {
|
|
74
|
-
this._apiKey = undefined;
|
|
75
|
-
await super.dispose();
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
// Register the adapter
|
|
79
|
-
registerAdapter('openai', () => new OpenAIAdapter());
|
|
80
|
-
//# sourceMappingURL=openai-adapter.js.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|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pi framework agent adapter.
|
|
3
|
-
*
|
|
4
|
-
* Uses the @mariozechner/pi-coding-agent package for running tests.
|
|
5
|
-
*
|
|
6
|
-
* @module adapters/pi-adapter
|
|
7
|
-
*/
|
|
8
|
-
import { BaseAgentAdapter } from '../agent-adapter.js';
|
|
9
|
-
import type { AgentConfig, AgentResponse, TestCase } from '../types.js';
|
|
10
|
-
/**
|
|
11
|
-
* Agent adapter that uses the pi framework.
|
|
12
|
-
*
|
|
13
|
-
* This adapter creates a headless agent session and runs tests by sending
|
|
14
|
-
* prompts and collecting responses through the event stream.
|
|
15
|
-
*/
|
|
16
|
-
export declare class PiAgentAdapter extends BaseAgentAdapter {
|
|
17
|
-
readonly name = "pi";
|
|
18
|
-
private _model;
|
|
19
|
-
private _session?;
|
|
20
|
-
private _resourceLoader?;
|
|
21
|
-
constructor();
|
|
22
|
-
get model(): string;
|
|
23
|
-
initialize(config: AgentConfig): Promise<void>;
|
|
24
|
-
run(test: TestCase, suiteContext?: string): Promise<AgentResponse>;
|
|
25
|
-
dispose(): Promise<void>;
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=pi-adapter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pi-adapter.d.ts","sourceRoot":"","sources":["../../../src/adapters/pi-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAaH,OAAO,EAEL,gBAAgB,EAEjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAExE;;;;;GAKG;AACH,qBAAa,cAAe,SAAQ,gBAAgB;IAClD,QAAQ,CAAC,IAAI,QAAQ;IAErB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,QAAQ,CAAC,CAAe;IAChC,OAAO,CAAC,eAAe,CAAC,CAAwB;;IAUhD,IAAI,KAAK,IAAI,MAAM,CAElB;IAEK,UAAU,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAoD9C,GAAG,CAAC,IAAI,EAAE,QAAQ,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAmElE,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAQ/B"}
|