@agentv/core 2.17.2 → 2.18.1
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/{chunk-PSYFRPNT.js → chunk-I4VQY3XJ.js} +6 -1
- package/dist/chunk-I4VQY3XJ.js.map +1 -0
- package/dist/evaluation/validation/index.cjs +10 -0
- package/dist/evaluation/validation/index.cjs.map +1 -1
- package/dist/evaluation/validation/index.js +11 -1
- package/dist/evaluation/validation/index.js.map +1 -1
- package/dist/index.cjs +37 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +33 -18
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-PSYFRPNT.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -548,11 +548,9 @@ type WorkspaceConfig = {
|
|
|
548
548
|
/** Workspace lifecycle hooks */
|
|
549
549
|
readonly hooks?: WorkspaceHooksConfig;
|
|
550
550
|
/** Workspace materialization mode */
|
|
551
|
-
readonly mode?: 'pooled' | '
|
|
551
|
+
readonly mode?: 'pooled' | 'temp' | 'static';
|
|
552
552
|
/** Required when mode=static: use this existing directory directly */
|
|
553
|
-
readonly
|
|
554
|
-
/** @deprecated Use mode=pooled|ephemeral|static */
|
|
555
|
-
readonly pool?: boolean;
|
|
553
|
+
readonly path?: string;
|
|
556
554
|
};
|
|
557
555
|
type CodeEvaluatorConfig = {
|
|
558
556
|
readonly name: string;
|
|
@@ -2479,7 +2477,7 @@ interface RunEvaluationOptions {
|
|
|
2479
2477
|
/** Pre-existing workspace directory to use directly (skips clone/copy/pool) */
|
|
2480
2478
|
readonly workspace?: string;
|
|
2481
2479
|
/** Workspace materialization mode override */
|
|
2482
|
-
readonly workspaceMode?: 'pooled' | '
|
|
2480
|
+
readonly workspaceMode?: 'pooled' | 'temp' | 'static';
|
|
2483
2481
|
/** Static workspace path override (used when workspaceMode=static) */
|
|
2484
2482
|
readonly workspacePath?: string;
|
|
2485
2483
|
/** Workspace clean policy override for pooled reset */
|
|
@@ -3011,9 +3009,11 @@ interface PoolSlot {
|
|
|
3011
3009
|
}
|
|
3012
3010
|
/**
|
|
3013
3011
|
* Compute a deterministic SHA-256 fingerprint for a workspace configuration.
|
|
3014
|
-
* The fingerprint captures
|
|
3012
|
+
* The fingerprint captures only repo materialization inputs (source, checkout, clone options)
|
|
3013
|
+
* in a canonical order. Template path is excluded because template files are re-copied on
|
|
3014
|
+
* every pool reuse and don't affect the cloned checkout state.
|
|
3015
3015
|
*/
|
|
3016
|
-
declare function computeWorkspaceFingerprint(
|
|
3016
|
+
declare function computeWorkspaceFingerprint(repos: readonly RepoConfig[]): string;
|
|
3017
3017
|
/**
|
|
3018
3018
|
* Pools entire workspaces (template files + git repos) for reuse across eval runs.
|
|
3019
3019
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -548,11 +548,9 @@ type WorkspaceConfig = {
|
|
|
548
548
|
/** Workspace lifecycle hooks */
|
|
549
549
|
readonly hooks?: WorkspaceHooksConfig;
|
|
550
550
|
/** Workspace materialization mode */
|
|
551
|
-
readonly mode?: 'pooled' | '
|
|
551
|
+
readonly mode?: 'pooled' | 'temp' | 'static';
|
|
552
552
|
/** Required when mode=static: use this existing directory directly */
|
|
553
|
-
readonly
|
|
554
|
-
/** @deprecated Use mode=pooled|ephemeral|static */
|
|
555
|
-
readonly pool?: boolean;
|
|
553
|
+
readonly path?: string;
|
|
556
554
|
};
|
|
557
555
|
type CodeEvaluatorConfig = {
|
|
558
556
|
readonly name: string;
|
|
@@ -2479,7 +2477,7 @@ interface RunEvaluationOptions {
|
|
|
2479
2477
|
/** Pre-existing workspace directory to use directly (skips clone/copy/pool) */
|
|
2480
2478
|
readonly workspace?: string;
|
|
2481
2479
|
/** Workspace materialization mode override */
|
|
2482
|
-
readonly workspaceMode?: 'pooled' | '
|
|
2480
|
+
readonly workspaceMode?: 'pooled' | 'temp' | 'static';
|
|
2483
2481
|
/** Static workspace path override (used when workspaceMode=static) */
|
|
2484
2482
|
readonly workspacePath?: string;
|
|
2485
2483
|
/** Workspace clean policy override for pooled reset */
|
|
@@ -3011,9 +3009,11 @@ interface PoolSlot {
|
|
|
3011
3009
|
}
|
|
3012
3010
|
/**
|
|
3013
3011
|
* Compute a deterministic SHA-256 fingerprint for a workspace configuration.
|
|
3014
|
-
* The fingerprint captures
|
|
3012
|
+
* The fingerprint captures only repo materialization inputs (source, checkout, clone options)
|
|
3013
|
+
* in a canonical order. Template path is excluded because template files are re-copied on
|
|
3014
|
+
* every pool reuse and don't affect the cloned checkout state.
|
|
3015
3015
|
*/
|
|
3016
|
-
declare function computeWorkspaceFingerprint(
|
|
3016
|
+
declare function computeWorkspaceFingerprint(repos: readonly RepoConfig[]): string;
|
|
3017
3017
|
/**
|
|
3018
3018
|
* Pools entire workspaces (template files + git repos) for reuse across eval runs.
|
|
3019
3019
|
*
|
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
readTextFile,
|
|
18
18
|
resolveFileReference,
|
|
19
19
|
resolveTargetDefinition
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-I4VQY3XJ.js";
|
|
21
21
|
import {
|
|
22
22
|
OtlpJsonFileExporter
|
|
23
23
|
} from "./chunk-HFSYZHGF.js";
|
|
@@ -3187,6 +3187,17 @@ async function resolveWorkspaceConfig(raw, evalFileDir) {
|
|
|
3187
3187
|
function parseWorkspaceConfig(raw, evalFileDir) {
|
|
3188
3188
|
if (!isJsonObject(raw)) return void 0;
|
|
3189
3189
|
const obj = raw;
|
|
3190
|
+
if ("static_path" in obj) {
|
|
3191
|
+
throw new Error(
|
|
3192
|
+
"workspace.static_path has been removed. Use workspace.path with workspace.mode=static."
|
|
3193
|
+
);
|
|
3194
|
+
}
|
|
3195
|
+
if ("pool" in obj) {
|
|
3196
|
+
throw new Error("workspace.pool has been removed. Use workspace.mode='pooled' or 'temp'.");
|
|
3197
|
+
}
|
|
3198
|
+
if ("static" in obj) {
|
|
3199
|
+
throw new Error("workspace.static has been removed. Use workspace.mode='static'.");
|
|
3200
|
+
}
|
|
3190
3201
|
let template = typeof obj.template === "string" ? obj.template : void 0;
|
|
3191
3202
|
if (template && !path8.isAbsolute(template)) {
|
|
3192
3203
|
template = path8.resolve(evalFileDir, template);
|
|
@@ -3194,19 +3205,17 @@ function parseWorkspaceConfig(raw, evalFileDir) {
|
|
|
3194
3205
|
const isolation = obj.isolation === "shared" || obj.isolation === "per_test" ? obj.isolation : void 0;
|
|
3195
3206
|
const repos = Array.isArray(obj.repos) ? obj.repos.map(parseRepoConfig).filter(Boolean) : void 0;
|
|
3196
3207
|
const hooks = parseWorkspaceHooksConfig(obj.hooks, evalFileDir);
|
|
3197
|
-
const
|
|
3198
|
-
const
|
|
3199
|
-
const
|
|
3200
|
-
if (!template && !isolation && !repos && !hooks && !mode && !
|
|
3201
|
-
return void 0;
|
|
3208
|
+
const explicitMode = obj.mode === "pooled" || obj.mode === "temp" || obj.mode === "static" ? obj.mode : void 0;
|
|
3209
|
+
const workspacePath = typeof obj.path === "string" ? obj.path : void 0;
|
|
3210
|
+
const mode = explicitMode ?? (workspacePath ? "static" : void 0);
|
|
3211
|
+
if (!template && !isolation && !repos && !hooks && !mode && !workspacePath) return void 0;
|
|
3202
3212
|
return {
|
|
3203
3213
|
...template !== void 0 && { template },
|
|
3204
3214
|
...isolation !== void 0 && { isolation },
|
|
3205
3215
|
...repos !== void 0 && { repos },
|
|
3206
3216
|
...hooks !== void 0 && { hooks },
|
|
3207
3217
|
...mode !== void 0 && { mode },
|
|
3208
|
-
...
|
|
3209
|
-
...pool !== void 0 && { pool }
|
|
3218
|
+
...workspacePath !== void 0 && { path: workspacePath }
|
|
3210
3219
|
};
|
|
3211
3220
|
}
|
|
3212
3221
|
function mergeWorkspaceConfigs(suiteLevel, caseLevel) {
|
|
@@ -3233,8 +3242,7 @@ function mergeWorkspaceConfigs(suiteLevel, caseLevel) {
|
|
|
3233
3242
|
repos: caseLevel.repos ?? suiteLevel.repos,
|
|
3234
3243
|
...hasHooks && { hooks: mergedHooks },
|
|
3235
3244
|
mode: caseLevel.mode ?? suiteLevel.mode,
|
|
3236
|
-
|
|
3237
|
-
pool: caseLevel.pool ?? suiteLevel.pool
|
|
3245
|
+
path: caseLevel.path ?? suiteLevel.path
|
|
3238
3246
|
};
|
|
3239
3247
|
}
|
|
3240
3248
|
function asString6(value) {
|
|
@@ -12940,9 +12948,8 @@ function normalizeRepoForFingerprint(repo) {
|
|
|
12940
12948
|
}
|
|
12941
12949
|
return result;
|
|
12942
12950
|
}
|
|
12943
|
-
function computeWorkspaceFingerprint(
|
|
12951
|
+
function computeWorkspaceFingerprint(repos) {
|
|
12944
12952
|
const canonical = {
|
|
12945
|
-
templatePath: templatePath ?? null,
|
|
12946
12953
|
repos: [...repos].sort((a, b) => a.path.localeCompare(b.path)).map(normalizeRepoForFingerprint)
|
|
12947
12954
|
};
|
|
12948
12955
|
return createHash("sha256").update(JSON.stringify(canonical)).digest("hex");
|
|
@@ -12984,7 +12991,7 @@ var WorkspacePoolManager = class {
|
|
|
12984
12991
|
*/
|
|
12985
12992
|
async acquireWorkspace(options) {
|
|
12986
12993
|
const { templatePath, repos, maxSlots, repoManager, poolReset } = options;
|
|
12987
|
-
const fingerprint = computeWorkspaceFingerprint(
|
|
12994
|
+
const fingerprint = computeWorkspaceFingerprint(repos);
|
|
12988
12995
|
const poolDir = path36.join(this.poolRoot, fingerprint);
|
|
12989
12996
|
await mkdir11(poolDir, { recursive: true });
|
|
12990
12997
|
const drifted = await this.checkDrift(poolDir, fingerprint);
|
|
@@ -13595,19 +13602,27 @@ async function runEvaluation(options) {
|
|
|
13595
13602
|
}
|
|
13596
13603
|
};
|
|
13597
13604
|
const isPerTestIsolation = suiteWorkspace?.isolation === "per_test";
|
|
13598
|
-
const
|
|
13599
|
-
const
|
|
13600
|
-
|
|
13605
|
+
const cliWorkspacePath = workspacePath ?? legacyWorkspacePath;
|
|
13606
|
+
const yamlWorkspacePath = suiteWorkspace?.path;
|
|
13607
|
+
if (cliWorkspacePath && workspaceMode && workspaceMode !== "static") {
|
|
13608
|
+
throw new Error("--workspace-path requires --workspace-mode static when both are provided");
|
|
13609
|
+
}
|
|
13610
|
+
const configuredMode = cliWorkspacePath ? "static" : workspaceMode ?? suiteWorkspace?.mode ?? (yamlWorkspacePath ? "static" : "pooled");
|
|
13611
|
+
const configuredStaticPath = cliWorkspacePath ?? yamlWorkspacePath;
|
|
13612
|
+
const useStaticWorkspace = configuredMode === "static";
|
|
13601
13613
|
if (useStaticWorkspace && isPerTestIsolation) {
|
|
13602
13614
|
throw new Error(
|
|
13603
13615
|
"static workspace mode is incompatible with isolation: per_test. Use isolation: shared (default)."
|
|
13604
13616
|
);
|
|
13605
13617
|
}
|
|
13606
13618
|
if (configuredMode === "static" && !configuredStaticPath) {
|
|
13607
|
-
throw new Error("workspace.mode=static requires workspace.
|
|
13619
|
+
throw new Error("workspace.mode=static requires workspace.path or --workspace-path");
|
|
13620
|
+
}
|
|
13621
|
+
if (configuredMode !== "static" && configuredStaticPath) {
|
|
13622
|
+
throw new Error("workspace.path requires workspace.mode=static");
|
|
13608
13623
|
}
|
|
13609
13624
|
const hasSharedWorkspace = !!(useStaticWorkspace || workspaceTemplate || suiteWorkspace?.hooks || suiteWorkspace?.repos?.length && !isPerTestIsolation);
|
|
13610
|
-
const poolEnabled = configuredMode === "pooled"
|
|
13625
|
+
const poolEnabled = configuredMode === "pooled";
|
|
13611
13626
|
const usePool = poolEnabled !== false && !!suiteWorkspace?.repos?.length && !isPerTestIsolation && !useStaticWorkspace;
|
|
13612
13627
|
const resolvedRetainOnSuccess = retainOnSuccess ?? (keepWorkspaces ? "keep" : "cleanup");
|
|
13613
13628
|
const resolvedRetainOnFailure = retainOnFailure ?? (cleanupWorkspaces ? "cleanup" : "keep");
|