@sebastiantuyu/agest 0.3.1 → 0.3.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/config.d.ts CHANGED
@@ -13,6 +13,7 @@ export interface AgestConfig {
13
13
  parallelism?: number;
14
14
  timeout?: number;
15
15
  turns?: number;
16
+ runs?: number;
16
17
  judge?: JudgeConfig;
17
18
  }
18
19
  export declare function defineConfig(config: AgestConfig): AgestConfig;
package/dist/context.js CHANGED
@@ -98,7 +98,7 @@ export class AgentContext {
98
98
  for (const hook of this._beforeEachHooks) {
99
99
  await hook();
100
100
  }
101
- const result = await executeScene(this._executor, scene, config.timeout, config.judge, config.turns);
101
+ const result = await executeScene(this._executor, scene, config.timeout, config.judge, config.turns, config.runs);
102
102
  orderedResults[i] = result;
103
103
  // Run afterEach hooks
104
104
  for (const hook of this._afterEachHooks) {
package/dist/runner.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import type { AgentExecutor, AgentResponse, SceneDefinition, SceneResult } from "./types";
2
2
  import type { JudgeConfig } from "./config";
3
3
  export declare function extractField(response: AgentResponse, field: string): unknown;
4
- export declare function executeScene(executor: AgentExecutor, scene: SceneDefinition, globalTimeout?: number, judgeConfig?: JudgeConfig, globalTurns?: number): Promise<SceneResult>;
4
+ export declare function executeScene(executor: AgentExecutor, scene: SceneDefinition, globalTimeout?: number, judgeConfig?: JudgeConfig, globalTurns?: number, globalRuns?: number): Promise<SceneResult>;
package/dist/runner.js CHANGED
@@ -35,7 +35,7 @@ async function executeSingleRun(executor, scene, timeoutMs, turns, judgeConfig)
35
35
  let duration;
36
36
  try {
37
37
  const start = performance.now();
38
- let input = scene.prompt;
38
+ const input = scene.prompt;
39
39
  for (let t = 0; t < turns; t++) {
40
40
  let timer;
41
41
  response = await Promise.race([
@@ -46,8 +46,6 @@ async function executeSingleRun(executor, scene, timeoutMs, turns, judgeConfig)
46
46
  ]);
47
47
  if (response.executionError)
48
48
  break;
49
- if (t < turns - 1)
50
- input = response.text;
51
49
  }
52
50
  duration = performance.now() - start;
53
51
  }
@@ -104,10 +102,10 @@ async function executeSingleRun(executor, scene, timeoutMs, turns, judgeConfig)
104
102
  }
105
103
  return { passed, error, response, duration, judgement };
106
104
  }
107
- export async function executeScene(executor, scene, globalTimeout, judgeConfig, globalTurns) {
105
+ export async function executeScene(executor, scene, globalTimeout, judgeConfig, globalTurns, globalRuns) {
108
106
  const timeoutMs = scene.timeout ?? globalTimeout ?? DEFAULT_SCENE_TIMEOUT;
109
107
  const turns = scene.turns ?? globalTurns ?? 1;
110
- const numRuns = scene.runs ?? 1;
108
+ const numRuns = scene.runs ?? globalRuns ?? 1;
111
109
  // Single run — original fast path
112
110
  if (numRuns <= 1) {
113
111
  const run = await executeSingleRun(executor, scene, timeoutMs, turns, judgeConfig);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sebastiantuyu/agest",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "A testing library for agents",
5
5
  "repository": {
6
6
  "type": "git",