@agentv/core 2.15.0 → 2.16.0

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.d.cts CHANGED
@@ -514,9 +514,34 @@ type RepoConfig = {
514
514
  readonly checkout?: RepoCheckout;
515
515
  readonly clone?: RepoClone;
516
516
  };
517
- type ResetConfig = {
518
- readonly strategy?: 'none' | 'hard' | 'recreate';
519
- readonly after_each?: boolean;
517
+ type WorkspaceHookConfig = {
518
+ /** Optional command array to execute (e.g., ["bun", "run", "setup.ts"]) */
519
+ readonly command?: readonly string[];
520
+ /** @deprecated Use `command` instead */
521
+ readonly script?: readonly string[];
522
+ /** Optional timeout in milliseconds */
523
+ readonly timeout_ms?: number;
524
+ readonly timeoutMs?: number;
525
+ /** Optional working directory for command execution */
526
+ readonly cwd?: string;
527
+ /** Optional reset policy for this hook */
528
+ readonly reset?: 'none' | 'fast' | 'strict';
529
+ /** Optional cleanup policy for this hook */
530
+ readonly clean?: 'always' | 'on_success' | 'on_failure' | 'never';
531
+ };
532
+ type WorkspaceHooksConfig = {
533
+ /** Runs once before first test in the workspace lifecycle */
534
+ readonly before_all_tests?: WorkspaceHookConfig;
535
+ /** Runs before each test case */
536
+ readonly before_each_test?: WorkspaceHookConfig;
537
+ /** Runs after each test case */
538
+ readonly after_each_test?: WorkspaceHookConfig;
539
+ /** Runs once after final test in the workspace lifecycle */
540
+ readonly after_all_tests?: WorkspaceHookConfig;
541
+ /** Runs when reusing a pooled workspace slot */
542
+ readonly on_reuse?: WorkspaceHookConfig;
543
+ /** Runs/controls behavior when workspace lifecycle finishes */
544
+ readonly on_finish?: WorkspaceHookConfig;
520
545
  };
521
546
  type WorkspaceConfig = {
522
547
  /** Template directory or .code-workspace file. Directories are copied to temp workspace.
@@ -526,16 +551,14 @@ type WorkspaceConfig = {
526
551
  readonly isolation?: 'shared' | 'per_test';
527
552
  /** Repository definitions to clone/checkout into workspace */
528
553
  readonly repos?: readonly RepoConfig[];
529
- /** Reset configuration for repos between test runs */
530
- readonly reset?: ResetConfig;
531
- /** Command to run once before first test (after workspace creation, before git baseline) */
532
- readonly before_all?: WorkspaceScriptConfig;
533
- /** Command to run once after last test (before workspace cleanup) */
534
- readonly after_all?: WorkspaceScriptConfig;
535
- /** Command to run before each test */
536
- readonly before_each?: WorkspaceScriptConfig;
537
- /** Command to run after each test (e.g., git reset for workspace reuse) */
538
- readonly after_each?: WorkspaceScriptConfig;
554
+ /** Workspace lifecycle hooks */
555
+ readonly hooks?: WorkspaceHooksConfig;
556
+ /** Workspace materialization mode */
557
+ readonly mode?: 'pooled' | 'ephemeral' | 'static';
558
+ /** Required when mode=static: use this existing directory directly */
559
+ readonly static_path?: string;
560
+ /** @deprecated Use mode=pooled|ephemeral|static */
561
+ readonly pool?: boolean;
539
562
  };
540
563
  type CodeEvaluatorConfig = {
541
564
  readonly name: string;
@@ -2347,34 +2370,18 @@ declare class DeterministicAssertionEvaluator implements Evaluator {
2347
2370
  }
2348
2371
 
2349
2372
  declare class RepoManager {
2350
- private readonly cacheDir;
2351
2373
  private readonly verbose;
2352
- constructor(cacheDir?: string, verbose?: boolean);
2374
+ constructor(verbose?: boolean);
2353
2375
  private runGit;
2354
2376
  /**
2355
- * Ensure a bare mirror cache exists for the given source.
2356
- * Creates on first access, fetches updates on subsequent calls.
2357
- * Returns the absolute path to the cache directory.
2358
- */
2359
- ensureCache(source: RepoSource, depth?: number, resolve?: 'remote' | 'local'): Promise<string>;
2360
- /**
2361
- * Clone a repo from cache into the workspace at the configured path.
2377
+ * Clone a repo directly from source into the workspace at the configured path.
2362
2378
  * Handles checkout, ref resolution, ancestor walking, shallow clone, sparse checkout.
2363
2379
  */
2364
2380
  materialize(repo: RepoConfig, workspacePath: string): Promise<void>;
2365
2381
  /** Materialize all repos into the workspace. */
2366
2382
  materializeAll(repos: readonly RepoConfig[], workspacePath: string): Promise<void>;
2367
2383
  /** Reset repos in workspace to their checkout state. */
2368
- reset(repos: readonly RepoConfig[], workspacePath: string, strategy: 'hard' | 'recreate'): Promise<void>;
2369
- /**
2370
- * Seed the cache from a local repository, setting the remote to a given URL.
2371
- * Useful for avoiding slow network clones when a local clone already exists.
2372
- */
2373
- seedCache(localPath: string, remoteUrl: string, opts?: {
2374
- force?: boolean;
2375
- }): Promise<string>;
2376
- /** Remove the entire cache directory. */
2377
- cleanCache(): Promise<void>;
2384
+ reset(repos: readonly RepoConfig[], workspacePath: string, reset: 'fast' | 'strict'): Promise<void>;
2378
2385
  }
2379
2386
 
2380
2387
  type MaybePromise<T> = T | Promise<T>;
@@ -2406,6 +2413,10 @@ interface RunEvalCaseOptions {
2406
2413
  readonly keepWorkspaces?: boolean;
2407
2414
  /** Force cleanup of workspaces even on failure */
2408
2415
  readonly cleanupWorkspaces?: boolean;
2416
+ /** Retention policy for temp workspaces on successful cases */
2417
+ readonly retainOnSuccess?: 'keep' | 'cleanup';
2418
+ /** Retention policy for temp workspaces on failed cases */
2419
+ readonly retainOnFailure?: 'keep' | 'cleanup';
2409
2420
  /** Pre-created shared workspace path (shared across tests in a suite) */
2410
2421
  readonly sharedWorkspacePath?: string;
2411
2422
  /** Pre-initialized baseline commit for shared workspace */
@@ -2461,12 +2472,22 @@ interface RunEvaluationOptions {
2461
2472
  readonly totalBudgetUsd?: number;
2462
2473
  /** Execution error tolerance: true halts on first error */
2463
2474
  readonly failOnError?: FailOnError;
2464
- /** Opt-in: reuse materialized workspaces across eval runs */
2475
+ /** Workspace pooling: true (default) enables pool, false disables, undefined defaults to true */
2465
2476
  readonly poolWorkspaces?: boolean;
2466
2477
  /** Maximum number of pool slots on disk (default: 10, max: 50) */
2467
2478
  readonly poolMaxSlots?: number;
2468
2479
  /** Pre-existing workspace directory to use directly (skips clone/copy/pool) */
2469
2480
  readonly workspace?: string;
2481
+ /** Workspace materialization mode override */
2482
+ readonly workspaceMode?: 'pooled' | 'ephemeral' | 'static';
2483
+ /** Static workspace path override (used when workspaceMode=static) */
2484
+ readonly workspacePath?: string;
2485
+ /** Workspace clean policy override for pooled reset */
2486
+ readonly workspaceClean?: 'standard' | 'full';
2487
+ /** Retention policy override for successful cases */
2488
+ readonly retainOnSuccess?: 'keep' | 'cleanup';
2489
+ /** Retention policy override for failed cases */
2490
+ readonly retainOnFailure?: 'keep' | 'cleanup';
2470
2491
  }
2471
2492
  declare function runEvaluation(options: RunEvaluationOptions): Promise<readonly EvaluationResult[]>;
2472
2493
  declare function runEvalCase(options: RunEvalCaseOptions): Promise<EvaluationResult>;
@@ -2978,6 +2999,7 @@ interface AcquireWorkspaceOptions {
2978
2999
  repos: readonly RepoConfig[];
2979
3000
  maxSlots: number;
2980
3001
  repoManager: RepoManager;
3002
+ poolReset?: 'none' | 'fast' | 'strict';
2981
3003
  }
2982
3004
  interface PoolSlot {
2983
3005
  readonly index: number;
@@ -3106,7 +3128,6 @@ declare function toCamelCaseDeep(obj: unknown): unknown;
3106
3128
 
3107
3129
  declare function getAgentvHome(): string;
3108
3130
  declare function getWorkspacesRoot(): string;
3109
- declare function getGitCacheRoot(): string;
3110
3131
  declare function getSubagentsRoot(): string;
3111
3132
  declare function getTraceStateRoot(): string;
3112
3133
  declare function getWorkspacePoolRoot(): string;
@@ -3265,4 +3286,4 @@ type AgentKernel = {
3265
3286
  };
3266
3287
  declare function createAgentKernel(): AgentKernel;
3267
3288
 
3268
- export { type AcquireWorkspaceOptions, AgentJudgeEvaluator, type AgentJudgeEvaluatorConfig, type AgentJudgeEvaluatorOptions, type AgentKernel, type AgentVConfig$1 as AgentVConfig, type AgentVConfig as AgentVTsConfig, type AnthropicResolvedConfig, type ArgsMatchMode, type AssertionResult, type AssistantTestMessage, type AzureResolvedConfig, type CacheConfig, type ChildEvaluatorResult, type ClaudeResolvedConfig, type CliResolvedConfig, CodeEvaluator, type CodeEvaluatorConfig, type CodeEvaluatorOptions, type CompositeAggregatorConfig, CompositeEvaluator, type CompositeEvaluatorConfig, type CompositeEvaluatorOptions, type ConfidenceIntervalAggregation, type ContainsAllEvaluatorConfig, type ContainsAnyEvaluatorConfig, type ContainsEvaluatorConfig, type CopilotCliResolvedConfig, type CopilotSdkResolvedConfig, CostEvaluator, type CostEvaluatorConfig, type CostEvaluatorOptions, DEFAULT_EVALUATOR_TEMPLATE, DEFAULT_EVAL_PATTERNS, DEFAULT_EXPLORATION_TOOLS, DeterministicAssertionEvaluator, type EndsWithEvaluatorConfig, type EnsureSubagentsOptions, type EnsureSubagentsResult, type EnvLookup, type EqualsEvaluatorConfig, type EvalAssertionInput, type EvalCase, type EvalConfig, type EvalMetadata, type EvalRunResult, type EvalSuiteResult, type EvalSummary, type EvalTest, type EvalTestInput, type EvaluationCache, type EvaluationContext, type EvaluationResult, type EvaluationScore, type EvaluationVerdict, type Evaluator, type EvaluatorConfig, type EvaluatorDispatchContext, type EvaluatorFactory, type EvaluatorFactoryFn, type EvaluatorKind, EvaluatorRegistry, type EvaluatorResult, type ExecutionDefaults, type ExecutionError, type ExecutionMetrics, ExecutionMetricsEvaluator, type ExecutionMetricsEvaluatorConfig, type ExecutionMetricsEvaluatorOptions, type ExecutionStatus, type FailOnError, type FailureStage, FieldAccuracyEvaluator, type FieldAccuracyEvaluatorConfig, type FieldAccuracyEvaluatorOptions, type FieldAggregationType, type FieldConfig, type FieldMatchType, type GeminiResolvedConfig, type GenerateRubricsOptions, type IcontainsAllEvaluatorConfig, type IcontainsAnyEvaluatorConfig, type IcontainsEvaluatorConfig, type IsJsonEvaluatorConfig, type JsonObject, type JsonPrimitive, type JsonValue, LatencyEvaluator, type LatencyEvaluatorConfig, type LatencyEvaluatorOptions, LlmJudgeEvaluator, type LlmJudgeEvaluatorConfig, type LlmJudgeEvaluatorOptions, type LlmJudgePromptAssembly, type MeanAggregation, type Message, type MockResolvedConfig, OTEL_BACKEND_PRESETS, type OtelBackendPreset, type OtelExportOptions, OtelStreamingObserver, OtelTraceExporter, OtlpJsonFileExporter, type OutputMessage, type PassAtKAggregation, type PiAgentSdkResolvedConfig, type PiCodingAgentResolvedConfig, type PoolSlot, type ProgressEvent, type PromptInputs, type PromptScriptConfig, type Provider, type ProviderFactoryFn, type ProviderKind, ProviderRegistry, type ProviderRequest, type ProviderResponse, type ProviderStreamCallbacks, type ProviderTokenUsage, type RegexEvaluatorConfig, type RepoCheckout, type RepoClone, type RepoConfig, RepoManager, type RepoSource, type ResetConfig, type ResolvedTarget, type ResolvedWorkspaceTemplate, ResponseCache, type RubricItem, type RubricsEvaluatorConfig, type RunEvalCaseOptions, type RunEvaluationOptions, type ScoreRange, type ScriptExecutionContext, SimpleTraceFileExporter, type StartsWithEvaluatorConfig, type SystemTestMessage, TEST_MESSAGE_ROLES, type TargetAccessConfig, type TargetDefinition, TemplateNotDirectoryError, TemplateNotFoundError, type TestMessage, type TestMessageContent, type TestMessageRole, type TokenUsage, TokenUsageEvaluator, type TokenUsageEvaluatorConfig, type TokenUsageEvaluatorOptions, type ToolCall, type ToolTestMessage, ToolTrajectoryEvaluator, type ToolTrajectoryEvaluatorConfig, type ToolTrajectoryEvaluatorOptions, type ToolTrajectoryExpectedItem, type TraceComputeResult, type TraceSummary, type TrialAggregation, type TrialResult, type TrialStrategy, type TrialsConfig, type UserTestMessage, type VSCodeResolvedConfig, type WorkspaceConfig, WorkspaceCreationError, WorkspacePoolManager, type WorkspaceScriptConfig, assembleLlmJudgePrompt, avgToolDurationMs, buildDirectoryChain, buildOutputSchema, buildPromptInputs, buildRubricOutputSchema, buildScoreRangeOutputSchema, buildSearchRoots, calculateRubricScore, captureFileChanges, clampScore, cleanupEvalWorkspaces, cleanupWorkspace, computeTraceSummary, computeWorkspaceFingerprint, consumeClaudeLogEntries, consumeCodexLogEntries, consumeCopilotCliLogEntries, consumeCopilotSdkLogEntries, consumePiLogEntries, createAgentKernel, createBuiltinProviderRegistry, createBuiltinRegistry, createProvider, createTempWorkspace, deepEqual, defineConfig, detectFormat, discoverAssertions, discoverProviders, ensureVSCodeSubagents, evaluate, executeScript, executeWorkspaceScript, explorationRatio, extractCacheConfig, extractFailOnError, extractJsonBlob, extractTargetFromSuite, extractTargetsFromSuite, extractTargetsFromTestCase, extractTrialsConfig, fileExists, findGitRoot, freeformEvaluationSchema, generateRubrics, getAgentvHome, getGitCacheRoot, getHitCount, getSubagentsRoot, getTraceStateRoot, getWorkspacePath, getWorkspacePoolRoot, getWorkspacesRoot, initializeBaseline, isEvaluatorKind, isGuidelineFile, isJsonObject, isJsonValue, isNonEmptyString, isTestMessage, isTestMessageRole, listTargetNames, loadConfig, loadEvalCaseById, loadEvalCases, loadEvalSuite, loadTestById, loadTestSuite, loadTests, loadTsConfig, mergeExecutionMetrics, negateScore, normalizeLineEndings, parseJsonFromText, parseJsonSafe, readJsonFile, readTargetDefinitions, readTestSuiteMetadata, readTextFile, resolveAndCreateProvider, resolveFileReference, resolveTargetDefinition, resolveWorkspaceTemplate, rubricEvaluationSchema, runContainsAllAssertion, runContainsAnyAssertion, runContainsAssertion, runEndsWithAssertion, runEqualsAssertion, runEvalCase, runEvaluation, runIcontainsAllAssertion, runIcontainsAnyAssertion, runIcontainsAssertion, runIsJsonAssertion, runRegexAssertion, runStartsWithAssertion, scoreToVerdict, shouldEnableCache, shouldSkipCacheForTemperature, subscribeToClaudeLogEntries, subscribeToCodexLogEntries, subscribeToCopilotCliLogEntries, subscribeToCopilotSdkLogEntries, subscribeToPiLogEntries, substituteVariables, toCamelCaseDeep, toSnakeCaseDeep, tokensPerTool, trimBaselineResult };
3289
+ export { type AcquireWorkspaceOptions, AgentJudgeEvaluator, type AgentJudgeEvaluatorConfig, type AgentJudgeEvaluatorOptions, type AgentKernel, type AgentVConfig$1 as AgentVConfig, type AgentVConfig as AgentVTsConfig, type AnthropicResolvedConfig, type ArgsMatchMode, type AssertionResult, type AssistantTestMessage, type AzureResolvedConfig, type CacheConfig, type ChildEvaluatorResult, type ClaudeResolvedConfig, type CliResolvedConfig, CodeEvaluator, type CodeEvaluatorConfig, type CodeEvaluatorOptions, type CompositeAggregatorConfig, CompositeEvaluator, type CompositeEvaluatorConfig, type CompositeEvaluatorOptions, type ConfidenceIntervalAggregation, type ContainsAllEvaluatorConfig, type ContainsAnyEvaluatorConfig, type ContainsEvaluatorConfig, type CopilotCliResolvedConfig, type CopilotSdkResolvedConfig, CostEvaluator, type CostEvaluatorConfig, type CostEvaluatorOptions, DEFAULT_EVALUATOR_TEMPLATE, DEFAULT_EVAL_PATTERNS, DEFAULT_EXPLORATION_TOOLS, DeterministicAssertionEvaluator, type EndsWithEvaluatorConfig, type EnsureSubagentsOptions, type EnsureSubagentsResult, type EnvLookup, type EqualsEvaluatorConfig, type EvalAssertionInput, type EvalCase, type EvalConfig, type EvalMetadata, type EvalRunResult, type EvalSuiteResult, type EvalSummary, type EvalTest, type EvalTestInput, type EvaluationCache, type EvaluationContext, type EvaluationResult, type EvaluationScore, type EvaluationVerdict, type Evaluator, type EvaluatorConfig, type EvaluatorDispatchContext, type EvaluatorFactory, type EvaluatorFactoryFn, type EvaluatorKind, EvaluatorRegistry, type EvaluatorResult, type ExecutionDefaults, type ExecutionError, type ExecutionMetrics, ExecutionMetricsEvaluator, type ExecutionMetricsEvaluatorConfig, type ExecutionMetricsEvaluatorOptions, type ExecutionStatus, type FailOnError, type FailureStage, FieldAccuracyEvaluator, type FieldAccuracyEvaluatorConfig, type FieldAccuracyEvaluatorOptions, type FieldAggregationType, type FieldConfig, type FieldMatchType, type GeminiResolvedConfig, type GenerateRubricsOptions, type IcontainsAllEvaluatorConfig, type IcontainsAnyEvaluatorConfig, type IcontainsEvaluatorConfig, type IsJsonEvaluatorConfig, type JsonObject, type JsonPrimitive, type JsonValue, LatencyEvaluator, type LatencyEvaluatorConfig, type LatencyEvaluatorOptions, LlmJudgeEvaluator, type LlmJudgeEvaluatorConfig, type LlmJudgeEvaluatorOptions, type LlmJudgePromptAssembly, type MeanAggregation, type Message, type MockResolvedConfig, OTEL_BACKEND_PRESETS, type OtelBackendPreset, type OtelExportOptions, OtelStreamingObserver, OtelTraceExporter, OtlpJsonFileExporter, type OutputMessage, type PassAtKAggregation, type PiAgentSdkResolvedConfig, type PiCodingAgentResolvedConfig, type PoolSlot, type ProgressEvent, type PromptInputs, type PromptScriptConfig, type Provider, type ProviderFactoryFn, type ProviderKind, ProviderRegistry, type ProviderRequest, type ProviderResponse, type ProviderStreamCallbacks, type ProviderTokenUsage, type RegexEvaluatorConfig, type RepoCheckout, type RepoClone, type RepoConfig, RepoManager, type RepoSource, type ResolvedTarget, type ResolvedWorkspaceTemplate, ResponseCache, type RubricItem, type RubricsEvaluatorConfig, type RunEvalCaseOptions, type RunEvaluationOptions, type ScoreRange, type ScriptExecutionContext, SimpleTraceFileExporter, type StartsWithEvaluatorConfig, type SystemTestMessage, TEST_MESSAGE_ROLES, type TargetAccessConfig, type TargetDefinition, TemplateNotDirectoryError, TemplateNotFoundError, type TestMessage, type TestMessageContent, type TestMessageRole, type TokenUsage, TokenUsageEvaluator, type TokenUsageEvaluatorConfig, type TokenUsageEvaluatorOptions, type ToolCall, type ToolTestMessage, ToolTrajectoryEvaluator, type ToolTrajectoryEvaluatorConfig, type ToolTrajectoryEvaluatorOptions, type ToolTrajectoryExpectedItem, type TraceComputeResult, type TraceSummary, type TrialAggregation, type TrialResult, type TrialStrategy, type TrialsConfig, type UserTestMessage, type VSCodeResolvedConfig, type WorkspaceConfig, WorkspaceCreationError, type WorkspaceHookConfig, type WorkspaceHooksConfig, WorkspacePoolManager, type WorkspaceScriptConfig, assembleLlmJudgePrompt, avgToolDurationMs, buildDirectoryChain, buildOutputSchema, buildPromptInputs, buildRubricOutputSchema, buildScoreRangeOutputSchema, buildSearchRoots, calculateRubricScore, captureFileChanges, clampScore, cleanupEvalWorkspaces, cleanupWorkspace, computeTraceSummary, computeWorkspaceFingerprint, consumeClaudeLogEntries, consumeCodexLogEntries, consumeCopilotCliLogEntries, consumeCopilotSdkLogEntries, consumePiLogEntries, createAgentKernel, createBuiltinProviderRegistry, createBuiltinRegistry, createProvider, createTempWorkspace, deepEqual, defineConfig, detectFormat, discoverAssertions, discoverProviders, ensureVSCodeSubagents, evaluate, executeScript, executeWorkspaceScript, explorationRatio, extractCacheConfig, extractFailOnError, extractJsonBlob, extractTargetFromSuite, extractTargetsFromSuite, extractTargetsFromTestCase, extractTrialsConfig, fileExists, findGitRoot, freeformEvaluationSchema, generateRubrics, getAgentvHome, getHitCount, getSubagentsRoot, getTraceStateRoot, getWorkspacePath, getWorkspacePoolRoot, getWorkspacesRoot, initializeBaseline, isEvaluatorKind, isGuidelineFile, isJsonObject, isJsonValue, isNonEmptyString, isTestMessage, isTestMessageRole, listTargetNames, loadConfig, loadEvalCaseById, loadEvalCases, loadEvalSuite, loadTestById, loadTestSuite, loadTests, loadTsConfig, mergeExecutionMetrics, negateScore, normalizeLineEndings, parseJsonFromText, parseJsonSafe, readJsonFile, readTargetDefinitions, readTestSuiteMetadata, readTextFile, resolveAndCreateProvider, resolveFileReference, resolveTargetDefinition, resolveWorkspaceTemplate, rubricEvaluationSchema, runContainsAllAssertion, runContainsAnyAssertion, runContainsAssertion, runEndsWithAssertion, runEqualsAssertion, runEvalCase, runEvaluation, runIcontainsAllAssertion, runIcontainsAnyAssertion, runIcontainsAssertion, runIsJsonAssertion, runRegexAssertion, runStartsWithAssertion, scoreToVerdict, shouldEnableCache, shouldSkipCacheForTemperature, subscribeToClaudeLogEntries, subscribeToCodexLogEntries, subscribeToCopilotCliLogEntries, subscribeToCopilotSdkLogEntries, subscribeToPiLogEntries, substituteVariables, toCamelCaseDeep, toSnakeCaseDeep, tokensPerTool, trimBaselineResult };
package/dist/index.d.ts CHANGED
@@ -514,9 +514,34 @@ type RepoConfig = {
514
514
  readonly checkout?: RepoCheckout;
515
515
  readonly clone?: RepoClone;
516
516
  };
517
- type ResetConfig = {
518
- readonly strategy?: 'none' | 'hard' | 'recreate';
519
- readonly after_each?: boolean;
517
+ type WorkspaceHookConfig = {
518
+ /** Optional command array to execute (e.g., ["bun", "run", "setup.ts"]) */
519
+ readonly command?: readonly string[];
520
+ /** @deprecated Use `command` instead */
521
+ readonly script?: readonly string[];
522
+ /** Optional timeout in milliseconds */
523
+ readonly timeout_ms?: number;
524
+ readonly timeoutMs?: number;
525
+ /** Optional working directory for command execution */
526
+ readonly cwd?: string;
527
+ /** Optional reset policy for this hook */
528
+ readonly reset?: 'none' | 'fast' | 'strict';
529
+ /** Optional cleanup policy for this hook */
530
+ readonly clean?: 'always' | 'on_success' | 'on_failure' | 'never';
531
+ };
532
+ type WorkspaceHooksConfig = {
533
+ /** Runs once before first test in the workspace lifecycle */
534
+ readonly before_all_tests?: WorkspaceHookConfig;
535
+ /** Runs before each test case */
536
+ readonly before_each_test?: WorkspaceHookConfig;
537
+ /** Runs after each test case */
538
+ readonly after_each_test?: WorkspaceHookConfig;
539
+ /** Runs once after final test in the workspace lifecycle */
540
+ readonly after_all_tests?: WorkspaceHookConfig;
541
+ /** Runs when reusing a pooled workspace slot */
542
+ readonly on_reuse?: WorkspaceHookConfig;
543
+ /** Runs/controls behavior when workspace lifecycle finishes */
544
+ readonly on_finish?: WorkspaceHookConfig;
520
545
  };
521
546
  type WorkspaceConfig = {
522
547
  /** Template directory or .code-workspace file. Directories are copied to temp workspace.
@@ -526,16 +551,14 @@ type WorkspaceConfig = {
526
551
  readonly isolation?: 'shared' | 'per_test';
527
552
  /** Repository definitions to clone/checkout into workspace */
528
553
  readonly repos?: readonly RepoConfig[];
529
- /** Reset configuration for repos between test runs */
530
- readonly reset?: ResetConfig;
531
- /** Command to run once before first test (after workspace creation, before git baseline) */
532
- readonly before_all?: WorkspaceScriptConfig;
533
- /** Command to run once after last test (before workspace cleanup) */
534
- readonly after_all?: WorkspaceScriptConfig;
535
- /** Command to run before each test */
536
- readonly before_each?: WorkspaceScriptConfig;
537
- /** Command to run after each test (e.g., git reset for workspace reuse) */
538
- readonly after_each?: WorkspaceScriptConfig;
554
+ /** Workspace lifecycle hooks */
555
+ readonly hooks?: WorkspaceHooksConfig;
556
+ /** Workspace materialization mode */
557
+ readonly mode?: 'pooled' | 'ephemeral' | 'static';
558
+ /** Required when mode=static: use this existing directory directly */
559
+ readonly static_path?: string;
560
+ /** @deprecated Use mode=pooled|ephemeral|static */
561
+ readonly pool?: boolean;
539
562
  };
540
563
  type CodeEvaluatorConfig = {
541
564
  readonly name: string;
@@ -2347,34 +2370,18 @@ declare class DeterministicAssertionEvaluator implements Evaluator {
2347
2370
  }
2348
2371
 
2349
2372
  declare class RepoManager {
2350
- private readonly cacheDir;
2351
2373
  private readonly verbose;
2352
- constructor(cacheDir?: string, verbose?: boolean);
2374
+ constructor(verbose?: boolean);
2353
2375
  private runGit;
2354
2376
  /**
2355
- * Ensure a bare mirror cache exists for the given source.
2356
- * Creates on first access, fetches updates on subsequent calls.
2357
- * Returns the absolute path to the cache directory.
2358
- */
2359
- ensureCache(source: RepoSource, depth?: number, resolve?: 'remote' | 'local'): Promise<string>;
2360
- /**
2361
- * Clone a repo from cache into the workspace at the configured path.
2377
+ * Clone a repo directly from source into the workspace at the configured path.
2362
2378
  * Handles checkout, ref resolution, ancestor walking, shallow clone, sparse checkout.
2363
2379
  */
2364
2380
  materialize(repo: RepoConfig, workspacePath: string): Promise<void>;
2365
2381
  /** Materialize all repos into the workspace. */
2366
2382
  materializeAll(repos: readonly RepoConfig[], workspacePath: string): Promise<void>;
2367
2383
  /** Reset repos in workspace to their checkout state. */
2368
- reset(repos: readonly RepoConfig[], workspacePath: string, strategy: 'hard' | 'recreate'): Promise<void>;
2369
- /**
2370
- * Seed the cache from a local repository, setting the remote to a given URL.
2371
- * Useful for avoiding slow network clones when a local clone already exists.
2372
- */
2373
- seedCache(localPath: string, remoteUrl: string, opts?: {
2374
- force?: boolean;
2375
- }): Promise<string>;
2376
- /** Remove the entire cache directory. */
2377
- cleanCache(): Promise<void>;
2384
+ reset(repos: readonly RepoConfig[], workspacePath: string, reset: 'fast' | 'strict'): Promise<void>;
2378
2385
  }
2379
2386
 
2380
2387
  type MaybePromise<T> = T | Promise<T>;
@@ -2406,6 +2413,10 @@ interface RunEvalCaseOptions {
2406
2413
  readonly keepWorkspaces?: boolean;
2407
2414
  /** Force cleanup of workspaces even on failure */
2408
2415
  readonly cleanupWorkspaces?: boolean;
2416
+ /** Retention policy for temp workspaces on successful cases */
2417
+ readonly retainOnSuccess?: 'keep' | 'cleanup';
2418
+ /** Retention policy for temp workspaces on failed cases */
2419
+ readonly retainOnFailure?: 'keep' | 'cleanup';
2409
2420
  /** Pre-created shared workspace path (shared across tests in a suite) */
2410
2421
  readonly sharedWorkspacePath?: string;
2411
2422
  /** Pre-initialized baseline commit for shared workspace */
@@ -2461,12 +2472,22 @@ interface RunEvaluationOptions {
2461
2472
  readonly totalBudgetUsd?: number;
2462
2473
  /** Execution error tolerance: true halts on first error */
2463
2474
  readonly failOnError?: FailOnError;
2464
- /** Opt-in: reuse materialized workspaces across eval runs */
2475
+ /** Workspace pooling: true (default) enables pool, false disables, undefined defaults to true */
2465
2476
  readonly poolWorkspaces?: boolean;
2466
2477
  /** Maximum number of pool slots on disk (default: 10, max: 50) */
2467
2478
  readonly poolMaxSlots?: number;
2468
2479
  /** Pre-existing workspace directory to use directly (skips clone/copy/pool) */
2469
2480
  readonly workspace?: string;
2481
+ /** Workspace materialization mode override */
2482
+ readonly workspaceMode?: 'pooled' | 'ephemeral' | 'static';
2483
+ /** Static workspace path override (used when workspaceMode=static) */
2484
+ readonly workspacePath?: string;
2485
+ /** Workspace clean policy override for pooled reset */
2486
+ readonly workspaceClean?: 'standard' | 'full';
2487
+ /** Retention policy override for successful cases */
2488
+ readonly retainOnSuccess?: 'keep' | 'cleanup';
2489
+ /** Retention policy override for failed cases */
2490
+ readonly retainOnFailure?: 'keep' | 'cleanup';
2470
2491
  }
2471
2492
  declare function runEvaluation(options: RunEvaluationOptions): Promise<readonly EvaluationResult[]>;
2472
2493
  declare function runEvalCase(options: RunEvalCaseOptions): Promise<EvaluationResult>;
@@ -2978,6 +2999,7 @@ interface AcquireWorkspaceOptions {
2978
2999
  repos: readonly RepoConfig[];
2979
3000
  maxSlots: number;
2980
3001
  repoManager: RepoManager;
3002
+ poolReset?: 'none' | 'fast' | 'strict';
2981
3003
  }
2982
3004
  interface PoolSlot {
2983
3005
  readonly index: number;
@@ -3106,7 +3128,6 @@ declare function toCamelCaseDeep(obj: unknown): unknown;
3106
3128
 
3107
3129
  declare function getAgentvHome(): string;
3108
3130
  declare function getWorkspacesRoot(): string;
3109
- declare function getGitCacheRoot(): string;
3110
3131
  declare function getSubagentsRoot(): string;
3111
3132
  declare function getTraceStateRoot(): string;
3112
3133
  declare function getWorkspacePoolRoot(): string;
@@ -3265,4 +3286,4 @@ type AgentKernel = {
3265
3286
  };
3266
3287
  declare function createAgentKernel(): AgentKernel;
3267
3288
 
3268
- export { type AcquireWorkspaceOptions, AgentJudgeEvaluator, type AgentJudgeEvaluatorConfig, type AgentJudgeEvaluatorOptions, type AgentKernel, type AgentVConfig$1 as AgentVConfig, type AgentVConfig as AgentVTsConfig, type AnthropicResolvedConfig, type ArgsMatchMode, type AssertionResult, type AssistantTestMessage, type AzureResolvedConfig, type CacheConfig, type ChildEvaluatorResult, type ClaudeResolvedConfig, type CliResolvedConfig, CodeEvaluator, type CodeEvaluatorConfig, type CodeEvaluatorOptions, type CompositeAggregatorConfig, CompositeEvaluator, type CompositeEvaluatorConfig, type CompositeEvaluatorOptions, type ConfidenceIntervalAggregation, type ContainsAllEvaluatorConfig, type ContainsAnyEvaluatorConfig, type ContainsEvaluatorConfig, type CopilotCliResolvedConfig, type CopilotSdkResolvedConfig, CostEvaluator, type CostEvaluatorConfig, type CostEvaluatorOptions, DEFAULT_EVALUATOR_TEMPLATE, DEFAULT_EVAL_PATTERNS, DEFAULT_EXPLORATION_TOOLS, DeterministicAssertionEvaluator, type EndsWithEvaluatorConfig, type EnsureSubagentsOptions, type EnsureSubagentsResult, type EnvLookup, type EqualsEvaluatorConfig, type EvalAssertionInput, type EvalCase, type EvalConfig, type EvalMetadata, type EvalRunResult, type EvalSuiteResult, type EvalSummary, type EvalTest, type EvalTestInput, type EvaluationCache, type EvaluationContext, type EvaluationResult, type EvaluationScore, type EvaluationVerdict, type Evaluator, type EvaluatorConfig, type EvaluatorDispatchContext, type EvaluatorFactory, type EvaluatorFactoryFn, type EvaluatorKind, EvaluatorRegistry, type EvaluatorResult, type ExecutionDefaults, type ExecutionError, type ExecutionMetrics, ExecutionMetricsEvaluator, type ExecutionMetricsEvaluatorConfig, type ExecutionMetricsEvaluatorOptions, type ExecutionStatus, type FailOnError, type FailureStage, FieldAccuracyEvaluator, type FieldAccuracyEvaluatorConfig, type FieldAccuracyEvaluatorOptions, type FieldAggregationType, type FieldConfig, type FieldMatchType, type GeminiResolvedConfig, type GenerateRubricsOptions, type IcontainsAllEvaluatorConfig, type IcontainsAnyEvaluatorConfig, type IcontainsEvaluatorConfig, type IsJsonEvaluatorConfig, type JsonObject, type JsonPrimitive, type JsonValue, LatencyEvaluator, type LatencyEvaluatorConfig, type LatencyEvaluatorOptions, LlmJudgeEvaluator, type LlmJudgeEvaluatorConfig, type LlmJudgeEvaluatorOptions, type LlmJudgePromptAssembly, type MeanAggregation, type Message, type MockResolvedConfig, OTEL_BACKEND_PRESETS, type OtelBackendPreset, type OtelExportOptions, OtelStreamingObserver, OtelTraceExporter, OtlpJsonFileExporter, type OutputMessage, type PassAtKAggregation, type PiAgentSdkResolvedConfig, type PiCodingAgentResolvedConfig, type PoolSlot, type ProgressEvent, type PromptInputs, type PromptScriptConfig, type Provider, type ProviderFactoryFn, type ProviderKind, ProviderRegistry, type ProviderRequest, type ProviderResponse, type ProviderStreamCallbacks, type ProviderTokenUsage, type RegexEvaluatorConfig, type RepoCheckout, type RepoClone, type RepoConfig, RepoManager, type RepoSource, type ResetConfig, type ResolvedTarget, type ResolvedWorkspaceTemplate, ResponseCache, type RubricItem, type RubricsEvaluatorConfig, type RunEvalCaseOptions, type RunEvaluationOptions, type ScoreRange, type ScriptExecutionContext, SimpleTraceFileExporter, type StartsWithEvaluatorConfig, type SystemTestMessage, TEST_MESSAGE_ROLES, type TargetAccessConfig, type TargetDefinition, TemplateNotDirectoryError, TemplateNotFoundError, type TestMessage, type TestMessageContent, type TestMessageRole, type TokenUsage, TokenUsageEvaluator, type TokenUsageEvaluatorConfig, type TokenUsageEvaluatorOptions, type ToolCall, type ToolTestMessage, ToolTrajectoryEvaluator, type ToolTrajectoryEvaluatorConfig, type ToolTrajectoryEvaluatorOptions, type ToolTrajectoryExpectedItem, type TraceComputeResult, type TraceSummary, type TrialAggregation, type TrialResult, type TrialStrategy, type TrialsConfig, type UserTestMessage, type VSCodeResolvedConfig, type WorkspaceConfig, WorkspaceCreationError, WorkspacePoolManager, type WorkspaceScriptConfig, assembleLlmJudgePrompt, avgToolDurationMs, buildDirectoryChain, buildOutputSchema, buildPromptInputs, buildRubricOutputSchema, buildScoreRangeOutputSchema, buildSearchRoots, calculateRubricScore, captureFileChanges, clampScore, cleanupEvalWorkspaces, cleanupWorkspace, computeTraceSummary, computeWorkspaceFingerprint, consumeClaudeLogEntries, consumeCodexLogEntries, consumeCopilotCliLogEntries, consumeCopilotSdkLogEntries, consumePiLogEntries, createAgentKernel, createBuiltinProviderRegistry, createBuiltinRegistry, createProvider, createTempWorkspace, deepEqual, defineConfig, detectFormat, discoverAssertions, discoverProviders, ensureVSCodeSubagents, evaluate, executeScript, executeWorkspaceScript, explorationRatio, extractCacheConfig, extractFailOnError, extractJsonBlob, extractTargetFromSuite, extractTargetsFromSuite, extractTargetsFromTestCase, extractTrialsConfig, fileExists, findGitRoot, freeformEvaluationSchema, generateRubrics, getAgentvHome, getGitCacheRoot, getHitCount, getSubagentsRoot, getTraceStateRoot, getWorkspacePath, getWorkspacePoolRoot, getWorkspacesRoot, initializeBaseline, isEvaluatorKind, isGuidelineFile, isJsonObject, isJsonValue, isNonEmptyString, isTestMessage, isTestMessageRole, listTargetNames, loadConfig, loadEvalCaseById, loadEvalCases, loadEvalSuite, loadTestById, loadTestSuite, loadTests, loadTsConfig, mergeExecutionMetrics, negateScore, normalizeLineEndings, parseJsonFromText, parseJsonSafe, readJsonFile, readTargetDefinitions, readTestSuiteMetadata, readTextFile, resolveAndCreateProvider, resolveFileReference, resolveTargetDefinition, resolveWorkspaceTemplate, rubricEvaluationSchema, runContainsAllAssertion, runContainsAnyAssertion, runContainsAssertion, runEndsWithAssertion, runEqualsAssertion, runEvalCase, runEvaluation, runIcontainsAllAssertion, runIcontainsAnyAssertion, runIcontainsAssertion, runIsJsonAssertion, runRegexAssertion, runStartsWithAssertion, scoreToVerdict, shouldEnableCache, shouldSkipCacheForTemperature, subscribeToClaudeLogEntries, subscribeToCodexLogEntries, subscribeToCopilotCliLogEntries, subscribeToCopilotSdkLogEntries, subscribeToPiLogEntries, substituteVariables, toCamelCaseDeep, toSnakeCaseDeep, tokensPerTool, trimBaselineResult };
3289
+ export { type AcquireWorkspaceOptions, AgentJudgeEvaluator, type AgentJudgeEvaluatorConfig, type AgentJudgeEvaluatorOptions, type AgentKernel, type AgentVConfig$1 as AgentVConfig, type AgentVConfig as AgentVTsConfig, type AnthropicResolvedConfig, type ArgsMatchMode, type AssertionResult, type AssistantTestMessage, type AzureResolvedConfig, type CacheConfig, type ChildEvaluatorResult, type ClaudeResolvedConfig, type CliResolvedConfig, CodeEvaluator, type CodeEvaluatorConfig, type CodeEvaluatorOptions, type CompositeAggregatorConfig, CompositeEvaluator, type CompositeEvaluatorConfig, type CompositeEvaluatorOptions, type ConfidenceIntervalAggregation, type ContainsAllEvaluatorConfig, type ContainsAnyEvaluatorConfig, type ContainsEvaluatorConfig, type CopilotCliResolvedConfig, type CopilotSdkResolvedConfig, CostEvaluator, type CostEvaluatorConfig, type CostEvaluatorOptions, DEFAULT_EVALUATOR_TEMPLATE, DEFAULT_EVAL_PATTERNS, DEFAULT_EXPLORATION_TOOLS, DeterministicAssertionEvaluator, type EndsWithEvaluatorConfig, type EnsureSubagentsOptions, type EnsureSubagentsResult, type EnvLookup, type EqualsEvaluatorConfig, type EvalAssertionInput, type EvalCase, type EvalConfig, type EvalMetadata, type EvalRunResult, type EvalSuiteResult, type EvalSummary, type EvalTest, type EvalTestInput, type EvaluationCache, type EvaluationContext, type EvaluationResult, type EvaluationScore, type EvaluationVerdict, type Evaluator, type EvaluatorConfig, type EvaluatorDispatchContext, type EvaluatorFactory, type EvaluatorFactoryFn, type EvaluatorKind, EvaluatorRegistry, type EvaluatorResult, type ExecutionDefaults, type ExecutionError, type ExecutionMetrics, ExecutionMetricsEvaluator, type ExecutionMetricsEvaluatorConfig, type ExecutionMetricsEvaluatorOptions, type ExecutionStatus, type FailOnError, type FailureStage, FieldAccuracyEvaluator, type FieldAccuracyEvaluatorConfig, type FieldAccuracyEvaluatorOptions, type FieldAggregationType, type FieldConfig, type FieldMatchType, type GeminiResolvedConfig, type GenerateRubricsOptions, type IcontainsAllEvaluatorConfig, type IcontainsAnyEvaluatorConfig, type IcontainsEvaluatorConfig, type IsJsonEvaluatorConfig, type JsonObject, type JsonPrimitive, type JsonValue, LatencyEvaluator, type LatencyEvaluatorConfig, type LatencyEvaluatorOptions, LlmJudgeEvaluator, type LlmJudgeEvaluatorConfig, type LlmJudgeEvaluatorOptions, type LlmJudgePromptAssembly, type MeanAggregation, type Message, type MockResolvedConfig, OTEL_BACKEND_PRESETS, type OtelBackendPreset, type OtelExportOptions, OtelStreamingObserver, OtelTraceExporter, OtlpJsonFileExporter, type OutputMessage, type PassAtKAggregation, type PiAgentSdkResolvedConfig, type PiCodingAgentResolvedConfig, type PoolSlot, type ProgressEvent, type PromptInputs, type PromptScriptConfig, type Provider, type ProviderFactoryFn, type ProviderKind, ProviderRegistry, type ProviderRequest, type ProviderResponse, type ProviderStreamCallbacks, type ProviderTokenUsage, type RegexEvaluatorConfig, type RepoCheckout, type RepoClone, type RepoConfig, RepoManager, type RepoSource, type ResolvedTarget, type ResolvedWorkspaceTemplate, ResponseCache, type RubricItem, type RubricsEvaluatorConfig, type RunEvalCaseOptions, type RunEvaluationOptions, type ScoreRange, type ScriptExecutionContext, SimpleTraceFileExporter, type StartsWithEvaluatorConfig, type SystemTestMessage, TEST_MESSAGE_ROLES, type TargetAccessConfig, type TargetDefinition, TemplateNotDirectoryError, TemplateNotFoundError, type TestMessage, type TestMessageContent, type TestMessageRole, type TokenUsage, TokenUsageEvaluator, type TokenUsageEvaluatorConfig, type TokenUsageEvaluatorOptions, type ToolCall, type ToolTestMessage, ToolTrajectoryEvaluator, type ToolTrajectoryEvaluatorConfig, type ToolTrajectoryEvaluatorOptions, type ToolTrajectoryExpectedItem, type TraceComputeResult, type TraceSummary, type TrialAggregation, type TrialResult, type TrialStrategy, type TrialsConfig, type UserTestMessage, type VSCodeResolvedConfig, type WorkspaceConfig, WorkspaceCreationError, type WorkspaceHookConfig, type WorkspaceHooksConfig, WorkspacePoolManager, type WorkspaceScriptConfig, assembleLlmJudgePrompt, avgToolDurationMs, buildDirectoryChain, buildOutputSchema, buildPromptInputs, buildRubricOutputSchema, buildScoreRangeOutputSchema, buildSearchRoots, calculateRubricScore, captureFileChanges, clampScore, cleanupEvalWorkspaces, cleanupWorkspace, computeTraceSummary, computeWorkspaceFingerprint, consumeClaudeLogEntries, consumeCodexLogEntries, consumeCopilotCliLogEntries, consumeCopilotSdkLogEntries, consumePiLogEntries, createAgentKernel, createBuiltinProviderRegistry, createBuiltinRegistry, createProvider, createTempWorkspace, deepEqual, defineConfig, detectFormat, discoverAssertions, discoverProviders, ensureVSCodeSubagents, evaluate, executeScript, executeWorkspaceScript, explorationRatio, extractCacheConfig, extractFailOnError, extractJsonBlob, extractTargetFromSuite, extractTargetsFromSuite, extractTargetsFromTestCase, extractTrialsConfig, fileExists, findGitRoot, freeformEvaluationSchema, generateRubrics, getAgentvHome, getHitCount, getSubagentsRoot, getTraceStateRoot, getWorkspacePath, getWorkspacePoolRoot, getWorkspacesRoot, initializeBaseline, isEvaluatorKind, isGuidelineFile, isJsonObject, isJsonValue, isNonEmptyString, isTestMessage, isTestMessageRole, listTargetNames, loadConfig, loadEvalCaseById, loadEvalCases, loadEvalSuite, loadTestById, loadTestSuite, loadTests, loadTsConfig, mergeExecutionMetrics, negateScore, normalizeLineEndings, parseJsonFromText, parseJsonSafe, readJsonFile, readTargetDefinitions, readTestSuiteMetadata, readTextFile, resolveAndCreateProvider, resolveFileReference, resolveTargetDefinition, resolveWorkspaceTemplate, rubricEvaluationSchema, runContainsAllAssertion, runContainsAnyAssertion, runContainsAssertion, runEndsWithAssertion, runEqualsAssertion, runEvalCase, runEvaluation, runIcontainsAllAssertion, runIcontainsAnyAssertion, runIcontainsAssertion, runIsJsonAssertion, runRegexAssertion, runStartsWithAssertion, scoreToVerdict, shouldEnableCache, shouldSkipCacheForTemperature, subscribeToClaudeLogEntries, subscribeToCodexLogEntries, subscribeToCopilotCliLogEntries, subscribeToCopilotSdkLogEntries, subscribeToPiLogEntries, substituteVariables, toCamelCaseDeep, toSnakeCaseDeep, tokensPerTool, trimBaselineResult };