agentv 5.3.0-next.1 → 5.3.1-next.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/README.md +22 -20
- package/dist/{artifact-writer-JFNIPMKW.js → artifact-writer-7NBCOAYC.js} +4 -4
- package/dist/{chunk-T32NL3E6.js → chunk-ASIGJIOJ.js} +50 -30
- package/dist/chunk-ASIGJIOJ.js.map +1 -0
- package/dist/{chunk-6ZZCDZPD.js → chunk-ELCJ23K4.js} +12766 -12478
- package/dist/chunk-ELCJ23K4.js.map +1 -0
- package/dist/{chunk-FVR4RQFK.js → chunk-LKGARI3W.js} +333 -24
- package/dist/chunk-LKGARI3W.js.map +1 -0
- package/dist/{chunk-V52ATPTT.js → chunk-LXBI3SPX.js} +142 -14
- package/dist/chunk-LXBI3SPX.js.map +1 -0
- package/dist/{chunk-BHKQHG26.js → chunk-RKE7SSET.js} +2 -2
- package/dist/cli.js +5 -5
- package/dist/dashboard/assets/{index-DNgf3qJ2.js → index-CbEMiJSb.js} +1 -1
- package/dist/dashboard/assets/{index-r_jSJmlw.js → index-DTA6-l7q.js} +3 -3
- package/dist/dashboard/index.html +1 -1
- package/dist/{dist-6Z7U473R.js → dist-NMXMI5SK.js} +17 -5
- package/dist/index.js +5 -5
- package/dist/{interactive-RUY3OCBI.js → interactive-BN527UV3.js} +5 -5
- package/dist/skills/agentv-bench/SKILL.md +14 -13
- package/dist/skills/agentv-bench/agents/analyzer.md +1 -1
- package/dist/skills/agentv-bench/agents/executor.md +1 -1
- package/dist/skills/agentv-bench/references/autoresearch.md +9 -9
- package/dist/skills/agentv-bench/references/environment-adaptation.md +4 -4
- package/dist/skills/agentv-bench/references/eval-yaml-spec.md +30 -47
- package/dist/skills/agentv-bench/references/schemas.md +44 -60
- package/dist/skills/agentv-bench/references/subagent-pipeline.md +20 -18
- package/dist/skills/agentv-eval-migrations/SKILL.md +13 -0
- package/dist/skills/agentv-eval-migrations/references/breaking-changes.md +39 -21
- package/dist/skills/agentv-eval-writer/SKILL.md +75 -46
- package/dist/skills/agentv-eval-writer/references/custom-evaluators.md +10 -5
- package/dist/skills/agentv-eval-writer/references/eval.schema.json +749 -2158
- package/dist/skills/agentv-eval-writer/references/rubric-evaluator.md +1 -1
- package/dist/{ts-eval-loader-DQDYRULE-V3377FOL.js → ts-eval-loader-2RFVZHCT-7CZ3DCDD.js} +8 -4
- package/package.json +1 -1
- package/dist/chunk-6ZZCDZPD.js.map +0 -1
- package/dist/chunk-FVR4RQFK.js.map +0 -1
- package/dist/chunk-T32NL3E6.js.map +0 -1
- package/dist/chunk-V52ATPTT.js.map +0 -1
- /package/dist/{artifact-writer-JFNIPMKW.js.map → artifact-writer-7NBCOAYC.js.map} +0 -0
- /package/dist/{chunk-BHKQHG26.js.map → chunk-RKE7SSET.js.map} +0 -0
- /package/dist/{dist-6Z7U473R.js.map → dist-NMXMI5SK.js.map} +0 -0
- /package/dist/{interactive-RUY3OCBI.js.map → interactive-BN527UV3.js.map} +0 -0
- /package/dist/{ts-eval-loader-DQDYRULE-V3377FOL.js.map → ts-eval-loader-2RFVZHCT-7CZ3DCDD.js.map} +0 -0
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
EXECUTION_TRACE_SCHEMA_VERSION,
|
|
7
7
|
buildPromptInputs,
|
|
8
8
|
external_exports,
|
|
9
|
-
|
|
9
|
+
extractLastAssistantContent2,
|
|
10
10
|
getAgentvDataDir,
|
|
11
11
|
groupTranscriptJsonLines,
|
|
12
12
|
loadTests,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
prepareSharedWorkspaceSetup,
|
|
17
17
|
readTranscriptJsonl,
|
|
18
18
|
releaseSharedWorkspaceSetup
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-ELCJ23K4.js";
|
|
20
20
|
|
|
21
21
|
// ../../packages/core/dist/index.js
|
|
22
22
|
import { readFileSync } from "node:fs";
|
|
@@ -43,12 +43,15 @@ import { promisify } from "node:util";
|
|
|
43
43
|
import * as childProcess from "node:child_process";
|
|
44
44
|
import { existsSync as existsSync2 } from "node:fs";
|
|
45
45
|
import { spawnSync } from "node:child_process";
|
|
46
|
+
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
47
|
+
import { readFile as readFile2 } from "node:fs/promises";
|
|
48
|
+
import path4 from "node:path";
|
|
46
49
|
import { readdir as readdir2, stat as stat2 } from "node:fs/promises";
|
|
47
50
|
import { homedir } from "node:os";
|
|
48
|
-
import
|
|
51
|
+
import path5 from "node:path";
|
|
49
52
|
import { readdir as readdir3, stat as stat3 } from "node:fs/promises";
|
|
50
53
|
import { homedir as homedir2 } from "node:os";
|
|
51
|
-
import
|
|
54
|
+
import path6 from "node:path";
|
|
52
55
|
var TRACE_SESSION_SCHEMA_VERSION = "agentv.dashboard.trace_session.v1";
|
|
53
56
|
function isRecord(value) {
|
|
54
57
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -1971,7 +1974,7 @@ You must return a valid JSON object matching this schema:
|
|
|
1971
1974
|
question: prompt,
|
|
1972
1975
|
systemPrompt: system
|
|
1973
1976
|
});
|
|
1974
|
-
const text =
|
|
1977
|
+
const text = extractLastAssistantContent2(response.output);
|
|
1975
1978
|
const cleaned = text.replace(/```json\n?|```/g, "").trim();
|
|
1976
1979
|
result = rubricGenerationSchema.parse(JSON.parse(cleaned));
|
|
1977
1980
|
break;
|
|
@@ -5374,6 +5377,127 @@ function runBeforeSessionHook(command) {
|
|
|
5374
5377
|
console.log(`before_session hook injected ${injected} environment variable(s).`);
|
|
5375
5378
|
}
|
|
5376
5379
|
}
|
|
5380
|
+
var ENV_NAME_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
5381
|
+
function parseShellExportsEnv(content) {
|
|
5382
|
+
const result = {};
|
|
5383
|
+
for (const line of content.split("\n")) {
|
|
5384
|
+
const trimmed = line.trim();
|
|
5385
|
+
if (!trimmed || trimmed.startsWith("#")) continue;
|
|
5386
|
+
const match = trimmed.match(/^(?:export\s+)?([A-Za-z_][A-Za-z0-9_]*)=(.*)$/);
|
|
5387
|
+
if (!match) continue;
|
|
5388
|
+
const key = match[1];
|
|
5389
|
+
let value = match[2];
|
|
5390
|
+
if (value.startsWith('"') && value.endsWith('"') || value.startsWith("'") && value.endsWith("'")) {
|
|
5391
|
+
value = value.slice(1, -1);
|
|
5392
|
+
}
|
|
5393
|
+
result[key] = value;
|
|
5394
|
+
}
|
|
5395
|
+
return result;
|
|
5396
|
+
}
|
|
5397
|
+
function parseJsonEnv(content) {
|
|
5398
|
+
let parsed;
|
|
5399
|
+
try {
|
|
5400
|
+
parsed = JSON.parse(content);
|
|
5401
|
+
} catch {
|
|
5402
|
+
throw new Error("invalid JSON");
|
|
5403
|
+
}
|
|
5404
|
+
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
|
|
5405
|
+
throw new Error("expected a flat JSON object of string values");
|
|
5406
|
+
}
|
|
5407
|
+
const result = {};
|
|
5408
|
+
for (const [key, value] of Object.entries(parsed)) {
|
|
5409
|
+
if (!ENV_NAME_PATTERN.test(key)) {
|
|
5410
|
+
throw new Error(`invalid environment variable name "${key}"`);
|
|
5411
|
+
}
|
|
5412
|
+
if (typeof value !== "string") {
|
|
5413
|
+
throw new Error(`value for "${key}" must be a string`);
|
|
5414
|
+
}
|
|
5415
|
+
result[key] = value;
|
|
5416
|
+
}
|
|
5417
|
+
return result;
|
|
5418
|
+
}
|
|
5419
|
+
function injectEnv(vars) {
|
|
5420
|
+
let injected = 0;
|
|
5421
|
+
for (const [key, value] of Object.entries(vars)) {
|
|
5422
|
+
if (!ENV_NAME_PATTERN.test(key)) continue;
|
|
5423
|
+
if (process.env[key] === void 0) {
|
|
5424
|
+
process.env[key] = value;
|
|
5425
|
+
injected++;
|
|
5426
|
+
}
|
|
5427
|
+
}
|
|
5428
|
+
return injected;
|
|
5429
|
+
}
|
|
5430
|
+
async function loadEnvPathFiles(envPaths, baseDir) {
|
|
5431
|
+
const loaded = [];
|
|
5432
|
+
const missing = [];
|
|
5433
|
+
let injectedCount = 0;
|
|
5434
|
+
for (const envPath of envPaths) {
|
|
5435
|
+
const resolvedPath = path4.isAbsolute(envPath) ? envPath : path4.join(baseDir, envPath);
|
|
5436
|
+
let content;
|
|
5437
|
+
try {
|
|
5438
|
+
content = await readFile2(resolvedPath, "utf8");
|
|
5439
|
+
} catch (error) {
|
|
5440
|
+
if (error.code === "ENOENT") {
|
|
5441
|
+
missing.push(resolvedPath);
|
|
5442
|
+
logWarning(`env_path file not found: ${resolvedPath}`);
|
|
5443
|
+
continue;
|
|
5444
|
+
}
|
|
5445
|
+
throw new Error(`Could not read env_path file ${resolvedPath}: ${error.message}`);
|
|
5446
|
+
}
|
|
5447
|
+
injectedCount += injectEnv(parseShellExportsEnv(content));
|
|
5448
|
+
loaded.push(resolvedPath);
|
|
5449
|
+
}
|
|
5450
|
+
if (injectedCount > 0) {
|
|
5451
|
+
console.log(
|
|
5452
|
+
`env_path injected ${injectedCount} environment variable(s) from ${loaded.length} file(s).`
|
|
5453
|
+
);
|
|
5454
|
+
}
|
|
5455
|
+
return { loaded, missing, injectedCount };
|
|
5456
|
+
}
|
|
5457
|
+
function parseEnvFromOutput(stdout, format) {
|
|
5458
|
+
return format === "json" ? parseJsonEnv(stdout) : parseShellExportsEnv(stdout);
|
|
5459
|
+
}
|
|
5460
|
+
async function runEnvFromEntries(entries, options) {
|
|
5461
|
+
let injectedCount = 0;
|
|
5462
|
+
for (const entry of entries) {
|
|
5463
|
+
const [command, ...args] = entry.command;
|
|
5464
|
+
const commandLabel = entry.command.join(" ");
|
|
5465
|
+
console.log(`Running env_from command: ${commandLabel}`);
|
|
5466
|
+
const result = spawnSync2(command, args, {
|
|
5467
|
+
cwd: options.cwd,
|
|
5468
|
+
encoding: "utf8",
|
|
5469
|
+
stdio: ["ignore", "pipe", "pipe"]
|
|
5470
|
+
});
|
|
5471
|
+
if (result.stderr) {
|
|
5472
|
+
process.stderr.write(result.stderr);
|
|
5473
|
+
}
|
|
5474
|
+
if (result.error) {
|
|
5475
|
+
throw new Error(`env_from command failed to start: ${commandLabel}: ${result.error.message}`);
|
|
5476
|
+
}
|
|
5477
|
+
if (result.status !== 0) {
|
|
5478
|
+
throw new Error(
|
|
5479
|
+
`env_from command exited with code ${result.status ?? "unknown"}: ${commandLabel}`
|
|
5480
|
+
);
|
|
5481
|
+
}
|
|
5482
|
+
const format = entry.format ?? "shell_exports";
|
|
5483
|
+
let vars;
|
|
5484
|
+
try {
|
|
5485
|
+
vars = parseEnvFromOutput(result.stdout ?? "", format);
|
|
5486
|
+
} catch (error) {
|
|
5487
|
+
throw new Error(
|
|
5488
|
+
`env_from command produced invalid ${format} output: ${commandLabel}: ${error.message}`
|
|
5489
|
+
);
|
|
5490
|
+
}
|
|
5491
|
+
injectedCount += injectEnv(vars);
|
|
5492
|
+
}
|
|
5493
|
+
if (injectedCount > 0) {
|
|
5494
|
+
console.log(`env_from injected ${injectedCount} environment variable(s).`);
|
|
5495
|
+
}
|
|
5496
|
+
return { injectedCount };
|
|
5497
|
+
}
|
|
5498
|
+
function logWarning(message) {
|
|
5499
|
+
console.warn(`Warning: ${message}`);
|
|
5500
|
+
}
|
|
5377
5501
|
var SKIPPED_TYPES = /* @__PURE__ */ new Set(["progress", "system", "file-history-snapshot"]);
|
|
5378
5502
|
function parseClaudeSession(jsonl) {
|
|
5379
5503
|
const messages = [];
|
|
@@ -5727,7 +5851,7 @@ function extractResponseItemContent(content) {
|
|
|
5727
5851
|
}
|
|
5728
5852
|
return parts.length > 0 ? parts.join("") : void 0;
|
|
5729
5853
|
}
|
|
5730
|
-
var DEFAULT_SESSIONS_DIR = () =>
|
|
5854
|
+
var DEFAULT_SESSIONS_DIR = () => path5.join(homedir(), ".codex", "sessions");
|
|
5731
5855
|
async function discoverCodexSessions(opts) {
|
|
5732
5856
|
const sessionsDir = opts?.sessionsDir ?? DEFAULT_SESSIONS_DIR();
|
|
5733
5857
|
const limit = opts?.latest ? 1 : opts?.limit ?? 10;
|
|
@@ -5739,7 +5863,7 @@ async function discoverCodexSessions(opts) {
|
|
|
5739
5863
|
return [];
|
|
5740
5864
|
}
|
|
5741
5865
|
for (const year of yearDirs) {
|
|
5742
|
-
const yearPath =
|
|
5866
|
+
const yearPath = path5.join(sessionsDir, year);
|
|
5743
5867
|
let monthDirs;
|
|
5744
5868
|
try {
|
|
5745
5869
|
monthDirs = await readdir2(yearPath);
|
|
@@ -5747,7 +5871,7 @@ async function discoverCodexSessions(opts) {
|
|
|
5747
5871
|
continue;
|
|
5748
5872
|
}
|
|
5749
5873
|
for (const month of monthDirs) {
|
|
5750
|
-
const monthPath =
|
|
5874
|
+
const monthPath = path5.join(yearPath, month);
|
|
5751
5875
|
let dayDirs;
|
|
5752
5876
|
try {
|
|
5753
5877
|
dayDirs = await readdir2(monthPath);
|
|
@@ -5759,7 +5883,7 @@ async function discoverCodexSessions(opts) {
|
|
|
5759
5883
|
const dirDate = `${year}-${month}-${day}`;
|
|
5760
5884
|
if (dirDate !== opts.date) continue;
|
|
5761
5885
|
}
|
|
5762
|
-
const dayPath =
|
|
5886
|
+
const dayPath = path5.join(monthPath, day);
|
|
5763
5887
|
let files;
|
|
5764
5888
|
try {
|
|
5765
5889
|
files = await readdir2(dayPath);
|
|
@@ -5768,7 +5892,7 @@ async function discoverCodexSessions(opts) {
|
|
|
5768
5892
|
}
|
|
5769
5893
|
for (const file of files) {
|
|
5770
5894
|
if (!file.startsWith("rollout-") || !file.endsWith(".jsonl")) continue;
|
|
5771
|
-
const filePath =
|
|
5895
|
+
const filePath = path5.join(dayPath, file);
|
|
5772
5896
|
const nameWithoutExt = file.replace(/\.jsonl$/, "");
|
|
5773
5897
|
const parts = nameWithoutExt.split("-");
|
|
5774
5898
|
const sessionId = parts.length >= 6 ? parts.slice(-5).join("-") : nameWithoutExt;
|
|
@@ -5787,7 +5911,7 @@ async function discoverCodexSessions(opts) {
|
|
|
5787
5911
|
sessions.sort((a, b) => b.updatedAt.getTime() - a.updatedAt.getTime());
|
|
5788
5912
|
return sessions.slice(0, limit);
|
|
5789
5913
|
}
|
|
5790
|
-
var DEFAULT_PROJECTS_DIR = () =>
|
|
5914
|
+
var DEFAULT_PROJECTS_DIR = () => path6.join(homedir2(), ".claude", "projects");
|
|
5791
5915
|
function encodeProjectPath(projectPath) {
|
|
5792
5916
|
return projectPath.replace(/\//g, "-");
|
|
5793
5917
|
}
|
|
@@ -5806,7 +5930,7 @@ async function discoverClaudeSessions(opts) {
|
|
|
5806
5930
|
}
|
|
5807
5931
|
const sessions = [];
|
|
5808
5932
|
for (const projectDir of projectDirs) {
|
|
5809
|
-
const dirPath =
|
|
5933
|
+
const dirPath = path6.join(projectsDir, projectDir);
|
|
5810
5934
|
let entries;
|
|
5811
5935
|
try {
|
|
5812
5936
|
entries = await readdir3(dirPath);
|
|
@@ -5817,7 +5941,7 @@ async function discoverClaudeSessions(opts) {
|
|
|
5817
5941
|
if (!entry.endsWith(".jsonl")) continue;
|
|
5818
5942
|
const sessionId = entry.replace(/\.jsonl$/, "");
|
|
5819
5943
|
if (opts?.sessionId && sessionId !== opts.sessionId) continue;
|
|
5820
|
-
const filePath =
|
|
5944
|
+
const filePath = path6.join(dirPath, entry);
|
|
5821
5945
|
let updatedAt;
|
|
5822
5946
|
try {
|
|
5823
5947
|
const fileStat = await stat3(filePath);
|
|
@@ -6081,6 +6205,10 @@ export {
|
|
|
6081
6205
|
RunBudgetTracker,
|
|
6082
6206
|
parseEnvOutput,
|
|
6083
6207
|
runBeforeSessionHook,
|
|
6208
|
+
parseShellExportsEnv,
|
|
6209
|
+
parseJsonEnv,
|
|
6210
|
+
loadEnvPathFiles,
|
|
6211
|
+
runEnvFromEntries,
|
|
6084
6212
|
parseClaudeSession,
|
|
6085
6213
|
parseCodexSession,
|
|
6086
6214
|
discoverCodexSessions,
|
|
@@ -6089,4 +6217,4 @@ export {
|
|
|
6089
6217
|
parseCopilotEvents,
|
|
6090
6218
|
createAgentKernel
|
|
6091
6219
|
};
|
|
6092
|
-
//# sourceMappingURL=chunk-
|
|
6220
|
+
//# sourceMappingURL=chunk-LXBI3SPX.js.map
|