agentv 2.16.0 → 2.17.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/{chunk-JZ62HLUC.js → chunk-FIWNPMZ4.js} +4 -4
- package/dist/{chunk-QLCVA3ZS.js → chunk-H6WRFW2C.js} +9 -9
- package/dist/chunk-H6WRFW2C.js.map +1 -0
- package/dist/{chunk-LZ5MPQFM.js → chunk-UJMO2T4J.js} +75 -48
- package/dist/chunk-UJMO2T4J.js.map +1 -0
- package/dist/cli.js +3 -3
- package/dist/{dist-BMNEH377.js → dist-4SYTSJN2.js} +2 -2
- package/dist/index.js +3 -3
- package/dist/{interactive-ZXYNPRCT.js → interactive-7K5546RV.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-LZ5MPQFM.js.map +0 -1
- package/dist/chunk-QLCVA3ZS.js.map +0 -1
- /package/dist/{chunk-JZ62HLUC.js.map → chunk-FIWNPMZ4.js.map} +0 -0
- /package/dist/{dist-BMNEH377.js.map → dist-4SYTSJN2.js.map} +0 -0
- /package/dist/{interactive-ZXYNPRCT.js.map → interactive-7K5546RV.js.map} +0 -0
|
@@ -148,7 +148,7 @@ var require_dist = __commonJS({
|
|
|
148
148
|
}
|
|
149
149
|
});
|
|
150
150
|
|
|
151
|
-
// ../../packages/core/dist/chunk-
|
|
151
|
+
// ../../packages/core/dist/chunk-CPPYERD2.js
|
|
152
152
|
import { constants } from "node:fs";
|
|
153
153
|
import { access, readFile } from "node:fs/promises";
|
|
154
154
|
import path from "node:path";
|
|
@@ -4195,7 +4195,7 @@ var coerce = {
|
|
|
4195
4195
|
};
|
|
4196
4196
|
var NEVER = INVALID;
|
|
4197
4197
|
|
|
4198
|
-
// ../../packages/core/dist/chunk-
|
|
4198
|
+
// ../../packages/core/dist/chunk-CPPYERD2.js
|
|
4199
4199
|
var TEST_MESSAGE_ROLE_VALUES = ["system", "user", "assistant", "tool"];
|
|
4200
4200
|
var TEST_MESSAGE_ROLES = TEST_MESSAGE_ROLE_VALUES;
|
|
4201
4201
|
var TEST_MESSAGE_ROLE_SET = new Set(TEST_MESSAGE_ROLE_VALUES);
|
|
@@ -37017,30 +37017,24 @@ function parseWorkspaceHookConfig(raw, evalFileDir) {
|
|
|
37017
37017
|
const script = parseWorkspaceScriptConfig(raw, evalFileDir);
|
|
37018
37018
|
const obj = raw;
|
|
37019
37019
|
const reset = obj.reset === "none" || obj.reset === "fast" || obj.reset === "strict" ? obj.reset : void 0;
|
|
37020
|
-
|
|
37021
|
-
if (!script && !reset && !clean) return void 0;
|
|
37020
|
+
if (!script && !reset) return void 0;
|
|
37022
37021
|
return {
|
|
37023
37022
|
...script ?? {},
|
|
37024
|
-
...reset !== void 0 && { reset }
|
|
37025
|
-
...clean !== void 0 && { clean }
|
|
37023
|
+
...reset !== void 0 && { reset }
|
|
37026
37024
|
};
|
|
37027
37025
|
}
|
|
37028
37026
|
function parseWorkspaceHooksConfig(raw, evalFileDir) {
|
|
37029
37027
|
if (!isJsonObject(raw)) return void 0;
|
|
37030
37028
|
const obj = raw;
|
|
37031
|
-
const
|
|
37032
|
-
const
|
|
37033
|
-
const
|
|
37034
|
-
const
|
|
37035
|
-
const onReuse = parseWorkspaceHookConfig(obj.on_reuse, evalFileDir);
|
|
37036
|
-
const onFinish = parseWorkspaceHookConfig(obj.on_finish, evalFileDir);
|
|
37029
|
+
const beforeAll = parseWorkspaceHookConfig(obj.before_all, evalFileDir);
|
|
37030
|
+
const beforeEach = parseWorkspaceHookConfig(obj.before_each, evalFileDir);
|
|
37031
|
+
const afterEach = parseWorkspaceHookConfig(obj.after_each, evalFileDir);
|
|
37032
|
+
const afterAll = parseWorkspaceHookConfig(obj.after_all, evalFileDir);
|
|
37037
37033
|
const hooks = {
|
|
37038
|
-
...
|
|
37039
|
-
...
|
|
37040
|
-
...
|
|
37041
|
-
...
|
|
37042
|
-
...onReuse !== void 0 && { on_reuse: onReuse },
|
|
37043
|
-
...onFinish !== void 0 && { on_finish: onFinish }
|
|
37034
|
+
...beforeAll !== void 0 && { before_all: beforeAll },
|
|
37035
|
+
...beforeEach !== void 0 && { before_each: beforeEach },
|
|
37036
|
+
...afterEach !== void 0 && { after_each: afterEach },
|
|
37037
|
+
...afterAll !== void 0 && { after_all: afterAll }
|
|
37044
37038
|
};
|
|
37045
37039
|
return Object.keys(hooks).length > 0 ? hooks : void 0;
|
|
37046
37040
|
}
|
|
@@ -37101,18 +37095,10 @@ function mergeWorkspaceConfigs(suiteLevel, caseLevel) {
|
|
|
37101
37095
|
};
|
|
37102
37096
|
};
|
|
37103
37097
|
const mergedHooks = {
|
|
37104
|
-
|
|
37105
|
-
|
|
37106
|
-
|
|
37107
|
-
)
|
|
37108
|
-
before_each_test: mergeHook(
|
|
37109
|
-
suiteLevel.hooks?.before_each_test,
|
|
37110
|
-
caseLevel.hooks?.before_each_test
|
|
37111
|
-
),
|
|
37112
|
-
after_each_test: mergeHook(suiteLevel.hooks?.after_each_test, caseLevel.hooks?.after_each_test),
|
|
37113
|
-
after_all_tests: mergeHook(suiteLevel.hooks?.after_all_tests, caseLevel.hooks?.after_all_tests),
|
|
37114
|
-
on_reuse: mergeHook(suiteLevel.hooks?.on_reuse, caseLevel.hooks?.on_reuse),
|
|
37115
|
-
on_finish: mergeHook(suiteLevel.hooks?.on_finish, caseLevel.hooks?.on_finish)
|
|
37098
|
+
before_all: mergeHook(suiteLevel.hooks?.before_all, caseLevel.hooks?.before_all),
|
|
37099
|
+
before_each: mergeHook(suiteLevel.hooks?.before_each, caseLevel.hooks?.before_each),
|
|
37100
|
+
after_each: mergeHook(suiteLevel.hooks?.after_each, caseLevel.hooks?.after_each),
|
|
37101
|
+
after_all: mergeHook(suiteLevel.hooks?.after_all, caseLevel.hooks?.after_all)
|
|
37116
37102
|
};
|
|
37117
37103
|
const hasHooks = Object.values(mergedHooks).some((hook) => hook !== void 0);
|
|
37118
37104
|
return {
|
|
@@ -39186,6 +39172,7 @@ var CopilotCliProvider = class {
|
|
|
39186
39172
|
const agentProcess = spawn(executable, args, {
|
|
39187
39173
|
stdio: ["pipe", "pipe", "inherit"]
|
|
39188
39174
|
});
|
|
39175
|
+
await waitForProcessSpawn(agentProcess, executable, this.targetName);
|
|
39189
39176
|
const toolCallsInProgress = /* @__PURE__ */ new Map();
|
|
39190
39177
|
const completedToolCalls = [];
|
|
39191
39178
|
let finalContent = "";
|
|
@@ -39465,6 +39452,47 @@ var CopilotCliProvider = class {
|
|
|
39465
39452
|
}
|
|
39466
39453
|
}
|
|
39467
39454
|
};
|
|
39455
|
+
async function waitForProcessSpawn(proc, executable, targetName) {
|
|
39456
|
+
if (proc.pid) {
|
|
39457
|
+
return;
|
|
39458
|
+
}
|
|
39459
|
+
await new Promise((resolve2, reject) => {
|
|
39460
|
+
const onSpawn = () => {
|
|
39461
|
+
cleanup();
|
|
39462
|
+
resolve2();
|
|
39463
|
+
};
|
|
39464
|
+
const onError = (error40) => {
|
|
39465
|
+
cleanup();
|
|
39466
|
+
reject(new Error(formatCopilotSpawnError(error40, executable, targetName)));
|
|
39467
|
+
};
|
|
39468
|
+
const cleanup = () => {
|
|
39469
|
+
proc.off("spawn", onSpawn);
|
|
39470
|
+
proc.off("error", onError);
|
|
39471
|
+
};
|
|
39472
|
+
proc.once("spawn", onSpawn);
|
|
39473
|
+
proc.once("error", onError);
|
|
39474
|
+
});
|
|
39475
|
+
}
|
|
39476
|
+
function formatCopilotSpawnError(error40, executable, targetName) {
|
|
39477
|
+
const code = error40.code;
|
|
39478
|
+
const base = `Failed to start Copilot CLI executable '${executable}' for target '${targetName}'. ${error40.message}`;
|
|
39479
|
+
if (process.platform !== "win32") {
|
|
39480
|
+
return base;
|
|
39481
|
+
}
|
|
39482
|
+
if (code !== "ENOENT" && code !== "EINVAL") {
|
|
39483
|
+
return base;
|
|
39484
|
+
}
|
|
39485
|
+
return `${base}
|
|
39486
|
+
|
|
39487
|
+
On Windows, shell commands like 'copilot -h' can work via .ps1/.bat shims, but AgentV launches a subprocess that needs a directly spawnable executable path.
|
|
39488
|
+
|
|
39489
|
+
Fix options:
|
|
39490
|
+
1) Install native Copilot binary package:
|
|
39491
|
+
npm install -g @github/copilot-win32-x64
|
|
39492
|
+
2) Set explicit executable for Copilot targets:
|
|
39493
|
+
- In .env: COPILOT_EXE=C:\\Users\\<you>\\AppData\\Roaming\\npm\\node_modules\\@github\\copilot-win32-x64\\copilot.exe
|
|
39494
|
+
- In .agentv/targets.yaml: executable: \${{ COPILOT_EXE }}`;
|
|
39495
|
+
}
|
|
39468
39496
|
function summarizeAcpEvent(eventType, data) {
|
|
39469
39497
|
if (!data || typeof data !== "object") {
|
|
39470
39498
|
return eventType;
|
|
@@ -47183,9 +47211,8 @@ async function runEvaluation(options) {
|
|
|
47183
47211
|
const hasSharedWorkspace = !!(useStaticWorkspace || workspaceTemplate || suiteWorkspace?.hooks || suiteWorkspace?.repos?.length && !isPerTestIsolation);
|
|
47184
47212
|
const poolEnabled = configuredMode === "pooled" ? true : configuredMode === "ephemeral" || useStaticWorkspace ? false : suiteWorkspace?.pool ?? poolWorkspaces ?? true;
|
|
47185
47213
|
const usePool = poolEnabled !== false && !!suiteWorkspace?.repos?.length && !isPerTestIsolation && !useStaticWorkspace;
|
|
47186
|
-
const
|
|
47187
|
-
const
|
|
47188
|
-
const resolvedRetainOnFailure = (finishCleanPolicy === "always" || finishCleanPolicy === "on_failure" ? "cleanup" : finishCleanPolicy === "on_success" || finishCleanPolicy === "never" ? "keep" : void 0) ?? retainOnFailure ?? (cleanupWorkspaces ? "cleanup" : "keep");
|
|
47214
|
+
const resolvedRetainOnSuccess = retainOnSuccess ?? (keepWorkspaces ? "keep" : "cleanup");
|
|
47215
|
+
const resolvedRetainOnFailure = retainOnFailure ?? (cleanupWorkspaces ? "cleanup" : "keep");
|
|
47189
47216
|
const requestedWorkers = options.maxConcurrency ?? target.workers ?? 1;
|
|
47190
47217
|
const workers = hasSharedWorkspace && !usePool ? 1 : requestedWorkers;
|
|
47191
47218
|
setupLog(
|
|
@@ -47220,7 +47247,7 @@ async function runEvaluation(options) {
|
|
|
47220
47247
|
repos: suiteWorkspace.repos,
|
|
47221
47248
|
maxSlots: poolMaxSlots,
|
|
47222
47249
|
repoManager: poolRepoManager,
|
|
47223
|
-
poolReset: (workspaceClean === "full" ? "strict" : workspaceClean === "standard" ? "fast" : null) ??
|
|
47250
|
+
poolReset: (workspaceClean === "full" ? "strict" : workspaceClean === "standard" ? "fast" : null) ?? "fast"
|
|
47224
47251
|
});
|
|
47225
47252
|
poolSlots.push(slot);
|
|
47226
47253
|
setupLog(`pool slot ${i} acquired at: ${slot.path} (existing=${slot.isExisting})`);
|
|
@@ -47271,7 +47298,7 @@ async function runEvaluation(options) {
|
|
|
47271
47298
|
throw new Error(`Failed to materialize repos: ${message}`);
|
|
47272
47299
|
}
|
|
47273
47300
|
}
|
|
47274
|
-
const suiteBeforeAllHook = suiteWorkspace?.hooks?.
|
|
47301
|
+
const suiteBeforeAllHook = suiteWorkspace?.hooks?.before_all;
|
|
47275
47302
|
if (sharedWorkspacePath && hasHookCommand(suiteBeforeAllHook)) {
|
|
47276
47303
|
const beforeAllHook = suiteBeforeAllHook;
|
|
47277
47304
|
const beforeAllCommand = (beforeAllHook.command ?? beforeAllHook.script ?? []).join(" ");
|
|
@@ -47286,7 +47313,7 @@ async function runEvaluation(options) {
|
|
|
47286
47313
|
};
|
|
47287
47314
|
try {
|
|
47288
47315
|
beforeAllOutput = await executeWorkspaceScript(
|
|
47289
|
-
toScriptConfig(beforeAllHook, "
|
|
47316
|
+
toScriptConfig(beforeAllHook, "before_all", "suite workspace"),
|
|
47290
47317
|
scriptContext
|
|
47291
47318
|
);
|
|
47292
47319
|
setupLog("shared before_all completed");
|
|
@@ -47311,7 +47338,7 @@ async function runEvaluation(options) {
|
|
|
47311
47338
|
};
|
|
47312
47339
|
try {
|
|
47313
47340
|
const output = await executeWorkspaceScript(
|
|
47314
|
-
toScriptConfig(beforeAllHook, "
|
|
47341
|
+
toScriptConfig(beforeAllHook, "before_all", "suite workspace"),
|
|
47315
47342
|
scriptContext
|
|
47316
47343
|
);
|
|
47317
47344
|
if (!beforeAllOutput) beforeAllOutput = output;
|
|
@@ -47540,7 +47567,7 @@ async function runEvaluation(options) {
|
|
|
47540
47567
|
}
|
|
47541
47568
|
}
|
|
47542
47569
|
const afterAllWorkspaces = poolSlots.length > 1 ? poolSlots.map((s) => s.path) : sharedWorkspacePath ? [sharedWorkspacePath] : [];
|
|
47543
|
-
const suiteAfterAllHook = suiteWorkspace?.hooks?.
|
|
47570
|
+
const suiteAfterAllHook = suiteWorkspace?.hooks?.after_all;
|
|
47544
47571
|
if (afterAllWorkspaces.length > 0 && hasHookCommand(suiteAfterAllHook)) {
|
|
47545
47572
|
const afterAllHook = suiteAfterAllHook;
|
|
47546
47573
|
for (const wsPath of afterAllWorkspaces) {
|
|
@@ -47552,7 +47579,7 @@ async function runEvaluation(options) {
|
|
|
47552
47579
|
};
|
|
47553
47580
|
try {
|
|
47554
47581
|
const afterAllOutput = await executeWorkspaceScript(
|
|
47555
|
-
toScriptConfig(afterAllHook, "
|
|
47582
|
+
toScriptConfig(afterAllHook, "after_all", "suite workspace"),
|
|
47556
47583
|
scriptContext,
|
|
47557
47584
|
"warn"
|
|
47558
47585
|
);
|
|
@@ -47849,7 +47876,7 @@ async function runEvalCase(options) {
|
|
|
47849
47876
|
);
|
|
47850
47877
|
}
|
|
47851
47878
|
}
|
|
47852
|
-
const caseBeforeAllHook = evalCase.workspace?.hooks?.
|
|
47879
|
+
const caseBeforeAllHook = evalCase.workspace?.hooks?.before_all;
|
|
47853
47880
|
if (workspacePath && hasHookCommand(caseBeforeAllHook)) {
|
|
47854
47881
|
const beforeAllHook = caseBeforeAllHook;
|
|
47855
47882
|
const beforeAllCommand = (beforeAllHook.command ?? beforeAllHook.script ?? []).join(" ");
|
|
@@ -47868,7 +47895,7 @@ async function runEvalCase(options) {
|
|
|
47868
47895
|
};
|
|
47869
47896
|
try {
|
|
47870
47897
|
beforeAllOutput = await executeWorkspaceScript(
|
|
47871
|
-
toScriptConfig(beforeAllHook, "
|
|
47898
|
+
toScriptConfig(beforeAllHook, "before_all", `test '${evalCase.id}'`),
|
|
47872
47899
|
scriptContext
|
|
47873
47900
|
);
|
|
47874
47901
|
if (setupDebug) {
|
|
@@ -47893,7 +47920,7 @@ async function runEvalCase(options) {
|
|
|
47893
47920
|
}
|
|
47894
47921
|
}
|
|
47895
47922
|
}
|
|
47896
|
-
const caseBeforeEachHook = evalCase.workspace?.hooks?.
|
|
47923
|
+
const caseBeforeEachHook = evalCase.workspace?.hooks?.before_each;
|
|
47897
47924
|
if (workspacePath && hasHookCommand(caseBeforeEachHook)) {
|
|
47898
47925
|
const beforeEachHook = caseBeforeEachHook;
|
|
47899
47926
|
const scriptContext = {
|
|
@@ -47906,7 +47933,7 @@ async function runEvalCase(options) {
|
|
|
47906
47933
|
};
|
|
47907
47934
|
try {
|
|
47908
47935
|
beforeEachOutput = await executeWorkspaceScript(
|
|
47909
|
-
toScriptConfig(beforeEachHook, "
|
|
47936
|
+
toScriptConfig(beforeEachHook, "before_each", `test '${evalCase.id}'`),
|
|
47910
47937
|
scriptContext
|
|
47911
47938
|
);
|
|
47912
47939
|
} catch (error40) {
|
|
@@ -48023,17 +48050,17 @@ async function runEvalCase(options) {
|
|
|
48023
48050
|
}
|
|
48024
48051
|
}
|
|
48025
48052
|
const providerError = extractProviderError(providerResponse);
|
|
48026
|
-
if (repoManager && workspacePath && evalCase.workspace?.hooks?.
|
|
48053
|
+
if (repoManager && workspacePath && evalCase.workspace?.hooks?.after_each?.reset && evalCase.workspace.hooks.after_each.reset !== "none" && evalCase.workspace.repos) {
|
|
48027
48054
|
try {
|
|
48028
48055
|
await repoManager.reset(
|
|
48029
48056
|
evalCase.workspace.repos,
|
|
48030
48057
|
workspacePath,
|
|
48031
|
-
evalCase.workspace.hooks.
|
|
48058
|
+
evalCase.workspace.hooks.after_each.reset
|
|
48032
48059
|
);
|
|
48033
48060
|
} catch {
|
|
48034
48061
|
}
|
|
48035
48062
|
}
|
|
48036
|
-
const caseAfterEachHook = evalCase.workspace?.hooks?.
|
|
48063
|
+
const caseAfterEachHook = evalCase.workspace?.hooks?.after_each;
|
|
48037
48064
|
if (workspacePath && hasHookCommand(caseAfterEachHook)) {
|
|
48038
48065
|
const afterEachHook = caseAfterEachHook;
|
|
48039
48066
|
const scriptContext = {
|
|
@@ -48046,7 +48073,7 @@ async function runEvalCase(options) {
|
|
|
48046
48073
|
};
|
|
48047
48074
|
try {
|
|
48048
48075
|
afterEachOutput = await executeWorkspaceScript(
|
|
48049
|
-
toScriptConfig(afterEachHook, "
|
|
48076
|
+
toScriptConfig(afterEachHook, "after_each", `test '${evalCase.id}'`),
|
|
48050
48077
|
scriptContext,
|
|
48051
48078
|
"warn"
|
|
48052
48079
|
);
|
|
@@ -49654,4 +49681,4 @@ export {
|
|
|
49654
49681
|
OtelStreamingObserver,
|
|
49655
49682
|
createAgentKernel
|
|
49656
49683
|
};
|
|
49657
|
-
//# sourceMappingURL=chunk-
|
|
49684
|
+
//# sourceMappingURL=chunk-UJMO2T4J.js.map
|