@agentv/core 4.32.0-next.1 → 4.33.0-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/dist/{chunk-N5EU446L.js → chunk-7QB53OPK.js} +1277 -265
- package/dist/chunk-7QB53OPK.js.map +1 -0
- package/dist/{chunk-5RQMJZDJ.js → chunk-EW5X2RGJ.js} +110 -50
- package/dist/chunk-EW5X2RGJ.js.map +1 -0
- package/dist/evaluation/validation/index.cjs +196 -87
- package/dist/evaluation/validation/index.cjs.map +1 -1
- package/dist/evaluation/validation/index.d.cts +3 -1
- package/dist/evaluation/validation/index.d.ts +3 -1
- package/dist/evaluation/validation/index.js +170 -75
- package/dist/evaluation/validation/index.js.map +1 -1
- package/dist/index.cjs +2346 -853
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1826 -62
- package/dist/index.d.ts +1826 -62
- package/dist/index.js +624 -197
- package/dist/index.js.map +1 -1
- package/dist/{ts-eval-loader-Z6IUSDNA.js → ts-eval-loader-EQJX3OLT.js} +3 -3
- package/package.json +2 -2
- package/dist/chunk-5RQMJZDJ.js.map +0 -1
- package/dist/chunk-N5EU446L.js.map +0 -1
- /package/dist/{ts-eval-loader-Z6IUSDNA.js.map → ts-eval-loader-EQJX3OLT.js.map} +0 -0
|
@@ -1306,7 +1306,8 @@ var DEPRECATED_TARGET_CAMEL_CASE_FIELDS = /* @__PURE__ */ new Map([
|
|
|
1306
1306
|
["retryInitialDelayMs", "retry_initial_delay_ms"],
|
|
1307
1307
|
["retryMaxDelayMs", "retry_max_delay_ms"],
|
|
1308
1308
|
["retryBackoffFactor", "retry_backoff_factor"],
|
|
1309
|
-
["retryStatusCodes", "retry_status_codes"]
|
|
1309
|
+
["retryStatusCodes", "retry_status_codes"],
|
|
1310
|
+
["modelReasoningEffort", "model_reasoning_effort"]
|
|
1310
1311
|
]);
|
|
1311
1312
|
var DEPRECATED_HEALTHCHECK_CAMEL_CASE_FIELDS = /* @__PURE__ */ new Map([
|
|
1312
1313
|
["timeoutSeconds", "timeout_seconds"]
|
|
@@ -1415,6 +1416,9 @@ var PROVIDER_ALIASES = [
|
|
|
1415
1416
|
function isObject3(value) {
|
|
1416
1417
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1417
1418
|
}
|
|
1419
|
+
function isNonEmptyString(value) {
|
|
1420
|
+
return typeof value === "string" && value.trim().length > 0;
|
|
1421
|
+
}
|
|
1418
1422
|
var COMMON_SETTINGS = new Set(COMMON_TARGET_SETTINGS);
|
|
1419
1423
|
var RETRY_SETTINGS = /* @__PURE__ */ new Set([
|
|
1420
1424
|
"max_retries",
|
|
@@ -1483,6 +1487,7 @@ var GEMINI_SETTINGS = /* @__PURE__ */ new Set([
|
|
|
1483
1487
|
var CODEX_SETTINGS = /* @__PURE__ */ new Set([
|
|
1484
1488
|
...COMMON_SETTINGS,
|
|
1485
1489
|
"model",
|
|
1490
|
+
"model_reasoning_effort",
|
|
1486
1491
|
"executable",
|
|
1487
1492
|
"command",
|
|
1488
1493
|
"binary",
|
|
@@ -1492,8 +1497,7 @@ var CODEX_SETTINGS = /* @__PURE__ */ new Set([
|
|
|
1492
1497
|
"timeout_seconds",
|
|
1493
1498
|
"log_dir",
|
|
1494
1499
|
"log_directory",
|
|
1495
|
-
"
|
|
1496
|
-
"log_output_format",
|
|
1500
|
+
"stream_log",
|
|
1497
1501
|
"system_prompt"
|
|
1498
1502
|
]);
|
|
1499
1503
|
var COPILOT_SDK_SETTINGS = /* @__PURE__ */ new Set([
|
|
@@ -1618,6 +1622,26 @@ function validateUnknownSettings(target, provider, absolutePath, location, error
|
|
|
1618
1622
|
"api_format",
|
|
1619
1623
|
"The 'api_format' field is no longer supported on Azure targets. AgentV always uses Azure's Responses API (`/openai/v1/responses`). If your deployment only exposes /chat/completions, use 'provider: openai' with a deployment-scoped 'base_url' instead."
|
|
1620
1624
|
]
|
|
1625
|
+
]),
|
|
1626
|
+
codex: /* @__PURE__ */ new Map([
|
|
1627
|
+
[
|
|
1628
|
+
"log_format",
|
|
1629
|
+
"The 'log_format' field is no longer supported on Codex targets. Use 'stream_log: raw' for per-event logs or 'stream_log: summary' for consolidated logs."
|
|
1630
|
+
],
|
|
1631
|
+
[
|
|
1632
|
+
"log_output_format",
|
|
1633
|
+
"The 'log_output_format' field is no longer supported on Codex targets. Use 'stream_log: raw' for per-event logs or 'stream_log: summary' for consolidated logs."
|
|
1634
|
+
]
|
|
1635
|
+
]),
|
|
1636
|
+
"codex-cli": /* @__PURE__ */ new Map([
|
|
1637
|
+
[
|
|
1638
|
+
"log_format",
|
|
1639
|
+
"The 'log_format' field is no longer supported on Codex targets. Use 'stream_log: raw' for per-event logs or 'stream_log: summary' for consolidated logs."
|
|
1640
|
+
],
|
|
1641
|
+
[
|
|
1642
|
+
"log_output_format",
|
|
1643
|
+
"The 'log_output_format' field is no longer supported on Codex targets. Use 'stream_log: raw' for per-event logs or 'stream_log: summary' for consolidated logs."
|
|
1644
|
+
]
|
|
1621
1645
|
])
|
|
1622
1646
|
};
|
|
1623
1647
|
const removedForProvider = removedPerProvider[provider];
|
|
@@ -1654,9 +1678,11 @@ async function validateTargetsFile(filePath) {
|
|
|
1654
1678
|
const errors = [];
|
|
1655
1679
|
const absolutePath = import_node_path6.default.resolve(filePath);
|
|
1656
1680
|
let parsed;
|
|
1681
|
+
let rawParsed;
|
|
1657
1682
|
try {
|
|
1658
1683
|
const content = await (0, import_promises5.readFile)(absolutePath, "utf8");
|
|
1659
|
-
|
|
1684
|
+
rawParsed = parseYamlValue(content);
|
|
1685
|
+
parsed = interpolateEnv(rawParsed, process.env);
|
|
1660
1686
|
} catch (error) {
|
|
1661
1687
|
errors.push({
|
|
1662
1688
|
severity: "error",
|
|
@@ -1777,6 +1803,7 @@ async function validateTargetsFile(filePath) {
|
|
|
1777
1803
|
};
|
|
1778
1804
|
}
|
|
1779
1805
|
const targets = parsed.targets;
|
|
1806
|
+
const rawTargets = isObject3(rawParsed) && Array.isArray(rawParsed.targets) ? rawParsed.targets : [];
|
|
1780
1807
|
if (!Array.isArray(targets)) {
|
|
1781
1808
|
errors.push({
|
|
1782
1809
|
severity: "error",
|
|
@@ -1826,7 +1853,9 @@ async function validateTargetsFile(filePath) {
|
|
|
1826
1853
|
});
|
|
1827
1854
|
}
|
|
1828
1855
|
const provider = target.provider;
|
|
1829
|
-
const
|
|
1856
|
+
const rawTarget = rawTargets[i];
|
|
1857
|
+
const rawUseTarget = isObject3(rawTarget) ? rawTarget.use_target : void 0;
|
|
1858
|
+
const hasUseTarget = isNonEmptyString(target.use_target) || isNonEmptyString(rawUseTarget);
|
|
1830
1859
|
const providerValue = typeof provider === "string" ? provider.trim().toLowerCase() : void 0;
|
|
1831
1860
|
const isTemplated = typeof provider === "string" && /^\$\{\{.+\}\}$/.test(provider.trim());
|
|
1832
1861
|
if (!hasUseTarget && (typeof provider !== "string" || provider.trim().length === 0)) {
|
|
@@ -1870,8 +1899,24 @@ async function validateTargetsFile(filePath) {
|
|
|
1870
1899
|
|
|
1871
1900
|
// src/evaluation/validation/config-validator.ts
|
|
1872
1901
|
var import_promises6 = require("fs/promises");
|
|
1873
|
-
|
|
1902
|
+
var import_node_path8 = __toESM(require("path"), 1);
|
|
1903
|
+
|
|
1904
|
+
// src/paths.ts
|
|
1905
|
+
var import_node_os2 = __toESM(require("os"), 1);
|
|
1906
|
+
var import_node_path7 = __toESM(require("path"), 1);
|
|
1907
|
+
function readEnvPath(name) {
|
|
1908
|
+
const value = process.env[name];
|
|
1909
|
+
if (!value || value === "undefined") return void 0;
|
|
1910
|
+
return value;
|
|
1911
|
+
}
|
|
1912
|
+
function getAgentvConfigDir() {
|
|
1913
|
+
return readEnvPath("AGENTV_HOME") ?? import_node_path7.default.join(import_node_os2.default.homedir(), ".agentv");
|
|
1914
|
+
}
|
|
1915
|
+
|
|
1916
|
+
// src/evaluation/validation/config-validator.ts
|
|
1917
|
+
async function validateConfigFile(filePath, options = {}) {
|
|
1874
1918
|
const errors = [];
|
|
1919
|
+
const scope = options.scope ?? inferConfigScope(filePath);
|
|
1875
1920
|
try {
|
|
1876
1921
|
const content = await (0, import_promises6.readFile)(filePath, "utf8");
|
|
1877
1922
|
const parsed = interpolateEnv(parseYamlValue(content), process.env);
|
|
@@ -1920,78 +1965,43 @@ async function validateConfigFile(filePath) {
|
|
|
1920
1965
|
});
|
|
1921
1966
|
}
|
|
1922
1967
|
}
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1968
|
+
validateResultsConfig(errors, filePath, config.results, "results");
|
|
1969
|
+
const projects = config.projects;
|
|
1970
|
+
if (projects !== void 0) {
|
|
1971
|
+
if (scope === "project") {
|
|
1972
|
+
errors.push({
|
|
1973
|
+
severity: "warning",
|
|
1974
|
+
filePath,
|
|
1975
|
+
location: "projects",
|
|
1976
|
+
message: "Field 'projects' is only valid in $AGENTV_HOME/config.yaml. Ignoring project registry entries in project-local .agentv/config.yaml."
|
|
1977
|
+
});
|
|
1978
|
+
} else if (!Array.isArray(projects)) {
|
|
1926
1979
|
errors.push({
|
|
1927
1980
|
severity: "error",
|
|
1928
1981
|
filePath,
|
|
1929
|
-
location: "
|
|
1930
|
-
message: "Field '
|
|
1982
|
+
location: "projects",
|
|
1983
|
+
message: "Field 'projects' must be an array"
|
|
1931
1984
|
});
|
|
1932
1985
|
} else {
|
|
1933
|
-
|
|
1934
|
-
if (resultsRecord.mode !== "github") {
|
|
1935
|
-
errors.push({
|
|
1936
|
-
severity: "error",
|
|
1937
|
-
filePath,
|
|
1938
|
-
location: "results.mode",
|
|
1939
|
-
message: "Field 'results.mode' must be 'github'"
|
|
1940
|
-
});
|
|
1941
|
-
}
|
|
1942
|
-
if (typeof resultsRecord.repo !== "string" || resultsRecord.repo.trim().length === 0) {
|
|
1943
|
-
errors.push({
|
|
1944
|
-
severity: "error",
|
|
1945
|
-
filePath,
|
|
1946
|
-
location: "results.repo",
|
|
1947
|
-
message: "Field 'results.repo' must be a non-empty string"
|
|
1948
|
-
});
|
|
1949
|
-
}
|
|
1950
|
-
if (resultsRecord.path !== void 0) {
|
|
1951
|
-
if (typeof resultsRecord.path !== "string" || resultsRecord.path.trim().length === 0) {
|
|
1952
|
-
errors.push({
|
|
1953
|
-
severity: "error",
|
|
1954
|
-
filePath,
|
|
1955
|
-
location: "results.path",
|
|
1956
|
-
message: "Field 'results.path' must be a non-empty string"
|
|
1957
|
-
});
|
|
1958
|
-
} else {
|
|
1959
|
-
const p = resultsRecord.path.trim();
|
|
1960
|
-
const isFilesystemPath = p.startsWith("/") || p.startsWith("~/") || p.startsWith("~\\") || p === "~" || /^[A-Za-z]:[/\\]/.test(p);
|
|
1961
|
-
if (!isFilesystemPath) {
|
|
1962
|
-
errors.push({
|
|
1963
|
-
severity: "error",
|
|
1964
|
-
filePath,
|
|
1965
|
-
location: "results.path",
|
|
1966
|
-
message: `'results.path' must be an absolute or home-relative filesystem path (e.g., ~/data/agentv-results). Found: '${p}'. Remove 'path' to use the default.`
|
|
1967
|
-
});
|
|
1968
|
-
}
|
|
1969
|
-
}
|
|
1970
|
-
}
|
|
1971
|
-
if (resultsRecord.auto_push !== void 0 && typeof resultsRecord.auto_push !== "boolean") {
|
|
1972
|
-
errors.push({
|
|
1973
|
-
severity: "error",
|
|
1974
|
-
filePath,
|
|
1975
|
-
location: "results.auto_push",
|
|
1976
|
-
message: "Field 'results.auto_push' must be a boolean"
|
|
1977
|
-
});
|
|
1978
|
-
}
|
|
1979
|
-
if (resultsRecord.branch_prefix !== void 0 && (typeof resultsRecord.branch_prefix !== "string" || resultsRecord.branch_prefix.trim().length === 0)) {
|
|
1980
|
-
errors.push({
|
|
1981
|
-
severity: "error",
|
|
1982
|
-
filePath,
|
|
1983
|
-
location: "results.branch_prefix",
|
|
1984
|
-
message: "Field 'results.branch_prefix' must be a non-empty string"
|
|
1985
|
-
});
|
|
1986
|
-
}
|
|
1986
|
+
validateProjects(errors, filePath, projects);
|
|
1987
1987
|
}
|
|
1988
1988
|
}
|
|
1989
|
+
if (config.results_by_project !== void 0) {
|
|
1990
|
+
errors.push({
|
|
1991
|
+
severity: "warning",
|
|
1992
|
+
filePath,
|
|
1993
|
+
location: "results_by_project",
|
|
1994
|
+
message: "Field 'results_by_project' is deprecated. Put per-project result repo settings under projects[].results in $AGENTV_HOME/config.yaml."
|
|
1995
|
+
});
|
|
1996
|
+
}
|
|
1989
1997
|
const allowedFields = /* @__PURE__ */ new Set([
|
|
1990
1998
|
"$schema",
|
|
1991
1999
|
"eval_patterns",
|
|
1992
2000
|
"required_version",
|
|
1993
2001
|
"execution",
|
|
1994
2002
|
"results",
|
|
2003
|
+
"projects",
|
|
2004
|
+
"results_by_project",
|
|
1995
2005
|
"dashboard",
|
|
1996
2006
|
"studio"
|
|
1997
2007
|
]);
|
|
@@ -2018,15 +2028,114 @@ async function validateConfigFile(filePath) {
|
|
|
2018
2028
|
return { valid: false, filePath, fileType: "config", errors };
|
|
2019
2029
|
}
|
|
2020
2030
|
}
|
|
2031
|
+
function inferConfigScope(filePath) {
|
|
2032
|
+
const globalConfigPath = import_node_path8.default.resolve(getAgentvConfigDir(), "config.yaml");
|
|
2033
|
+
if (import_node_path8.default.resolve(filePath) === globalConfigPath) {
|
|
2034
|
+
return "global";
|
|
2035
|
+
}
|
|
2036
|
+
return filePath.split(/[\\/]/).includes(".agentv") ? "project" : "global";
|
|
2037
|
+
}
|
|
2038
|
+
function validateProjects(errors, filePath, projects) {
|
|
2039
|
+
projects.forEach((project, index) => {
|
|
2040
|
+
const location = `projects[${index}]`;
|
|
2041
|
+
if (typeof project !== "object" || project === null || Array.isArray(project)) {
|
|
2042
|
+
errors.push({
|
|
2043
|
+
severity: "error",
|
|
2044
|
+
filePath,
|
|
2045
|
+
location,
|
|
2046
|
+
message: `Field '${location}' must be an object`
|
|
2047
|
+
});
|
|
2048
|
+
return;
|
|
2049
|
+
}
|
|
2050
|
+
const projectRecord = project;
|
|
2051
|
+
validateRequiredString(errors, filePath, projectRecord.id, `${location}.id`);
|
|
2052
|
+
validateRequiredString(errors, filePath, projectRecord.name, `${location}.name`);
|
|
2053
|
+
validateRequiredString(errors, filePath, projectRecord.path, `${location}.path`);
|
|
2054
|
+
validateResultsConfig(errors, filePath, projectRecord.results, `${location}.results`);
|
|
2055
|
+
});
|
|
2056
|
+
}
|
|
2057
|
+
function validateRequiredString(errors, filePath, value, location) {
|
|
2058
|
+
if (typeof value !== "string" || value.trim().length === 0) {
|
|
2059
|
+
errors.push({
|
|
2060
|
+
severity: "error",
|
|
2061
|
+
filePath,
|
|
2062
|
+
location,
|
|
2063
|
+
message: `Field '${location}' must be a non-empty string`
|
|
2064
|
+
});
|
|
2065
|
+
}
|
|
2066
|
+
}
|
|
2067
|
+
function validateResultsConfig(errors, filePath, rawResults, location) {
|
|
2068
|
+
if (rawResults === void 0) {
|
|
2069
|
+
return;
|
|
2070
|
+
}
|
|
2071
|
+
if (typeof rawResults !== "object" || rawResults === null || Array.isArray(rawResults)) {
|
|
2072
|
+
errors.push({
|
|
2073
|
+
severity: "error",
|
|
2074
|
+
filePath,
|
|
2075
|
+
location,
|
|
2076
|
+
message: `Field '${location}' must be an object`
|
|
2077
|
+
});
|
|
2078
|
+
return;
|
|
2079
|
+
}
|
|
2080
|
+
const resultsRecord = rawResults;
|
|
2081
|
+
if (resultsRecord.mode !== "github") {
|
|
2082
|
+
errors.push({
|
|
2083
|
+
severity: "error",
|
|
2084
|
+
filePath,
|
|
2085
|
+
location: `${location}.mode`,
|
|
2086
|
+
message: `Field '${location}.mode' must be 'github'`
|
|
2087
|
+
});
|
|
2088
|
+
}
|
|
2089
|
+
validateRequiredString(errors, filePath, resultsRecord.repo, `${location}.repo`);
|
|
2090
|
+
if (resultsRecord.path !== void 0) {
|
|
2091
|
+
if (typeof resultsRecord.path !== "string" || resultsRecord.path.trim().length === 0) {
|
|
2092
|
+
errors.push({
|
|
2093
|
+
severity: "error",
|
|
2094
|
+
filePath,
|
|
2095
|
+
location: `${location}.path`,
|
|
2096
|
+
message: `Field '${location}.path' must be a non-empty string`
|
|
2097
|
+
});
|
|
2098
|
+
} else {
|
|
2099
|
+
const p = resultsRecord.path.trim();
|
|
2100
|
+
if (!isFilesystemPath(p)) {
|
|
2101
|
+
errors.push({
|
|
2102
|
+
severity: "error",
|
|
2103
|
+
filePath,
|
|
2104
|
+
location: `${location}.path`,
|
|
2105
|
+
message: `'${location}.path' must be an absolute or home-relative filesystem path (e.g., ~/data/agentv-results). Found: '${p}'. Remove 'path' to use the default.`
|
|
2106
|
+
});
|
|
2107
|
+
}
|
|
2108
|
+
}
|
|
2109
|
+
}
|
|
2110
|
+
if (resultsRecord.auto_push !== void 0 && typeof resultsRecord.auto_push !== "boolean") {
|
|
2111
|
+
errors.push({
|
|
2112
|
+
severity: "error",
|
|
2113
|
+
filePath,
|
|
2114
|
+
location: `${location}.auto_push`,
|
|
2115
|
+
message: `Field '${location}.auto_push' must be a boolean`
|
|
2116
|
+
});
|
|
2117
|
+
}
|
|
2118
|
+
if (resultsRecord.branch_prefix !== void 0 && (typeof resultsRecord.branch_prefix !== "string" || resultsRecord.branch_prefix.trim().length === 0)) {
|
|
2119
|
+
errors.push({
|
|
2120
|
+
severity: "error",
|
|
2121
|
+
filePath,
|
|
2122
|
+
location: `${location}.branch_prefix`,
|
|
2123
|
+
message: `Field '${location}.branch_prefix' must be a non-empty string`
|
|
2124
|
+
});
|
|
2125
|
+
}
|
|
2126
|
+
}
|
|
2127
|
+
function isFilesystemPath(p) {
|
|
2128
|
+
return p.startsWith("/") || p.startsWith("~/") || p.startsWith("~\\") || p === "~" || /^[A-Za-z]:[/\\]/.test(p);
|
|
2129
|
+
}
|
|
2021
2130
|
|
|
2022
2131
|
// src/evaluation/validation/file-reference-validator.ts
|
|
2023
2132
|
var import_promises8 = require("fs/promises");
|
|
2024
|
-
var
|
|
2133
|
+
var import_node_path10 = __toESM(require("path"), 1);
|
|
2025
2134
|
|
|
2026
2135
|
// src/evaluation/file-utils.ts
|
|
2027
2136
|
var import_node_fs2 = require("fs");
|
|
2028
2137
|
var import_promises7 = require("fs/promises");
|
|
2029
|
-
var
|
|
2138
|
+
var import_node_path9 = __toESM(require("path"), 1);
|
|
2030
2139
|
async function fileExists(filePath) {
|
|
2031
2140
|
try {
|
|
2032
2141
|
await (0, import_promises7.access)(filePath, import_node_fs2.constants.F_OK);
|
|
@@ -2036,14 +2145,14 @@ async function fileExists(filePath) {
|
|
|
2036
2145
|
}
|
|
2037
2146
|
}
|
|
2038
2147
|
async function findGitRoot(startPath) {
|
|
2039
|
-
let currentDir =
|
|
2040
|
-
const root =
|
|
2148
|
+
let currentDir = import_node_path9.default.dirname(import_node_path9.default.resolve(startPath));
|
|
2149
|
+
const root = import_node_path9.default.parse(currentDir).root;
|
|
2041
2150
|
while (currentDir !== root) {
|
|
2042
|
-
const gitPath =
|
|
2151
|
+
const gitPath = import_node_path9.default.join(currentDir, ".git");
|
|
2043
2152
|
if (await fileExists(gitPath)) {
|
|
2044
2153
|
return currentDir;
|
|
2045
2154
|
}
|
|
2046
|
-
const parentDir =
|
|
2155
|
+
const parentDir = import_node_path9.default.dirname(currentDir);
|
|
2047
2156
|
if (parentDir === currentDir) {
|
|
2048
2157
|
break;
|
|
2049
2158
|
}
|
|
@@ -2054,16 +2163,16 @@ async function findGitRoot(startPath) {
|
|
|
2054
2163
|
function buildSearchRoots(evalPath, repoRoot) {
|
|
2055
2164
|
const uniqueRoots = [];
|
|
2056
2165
|
const addRoot = (root) => {
|
|
2057
|
-
const normalized =
|
|
2166
|
+
const normalized = import_node_path9.default.resolve(root);
|
|
2058
2167
|
if (!uniqueRoots.includes(normalized)) {
|
|
2059
2168
|
uniqueRoots.push(normalized);
|
|
2060
2169
|
}
|
|
2061
2170
|
};
|
|
2062
|
-
let currentDir =
|
|
2171
|
+
let currentDir = import_node_path9.default.dirname(evalPath);
|
|
2063
2172
|
let reachedBoundary = false;
|
|
2064
2173
|
while (!reachedBoundary) {
|
|
2065
2174
|
addRoot(currentDir);
|
|
2066
|
-
const parentDir =
|
|
2175
|
+
const parentDir = import_node_path9.default.dirname(currentDir);
|
|
2067
2176
|
if (currentDir === repoRoot || parentDir === currentDir) {
|
|
2068
2177
|
reachedBoundary = true;
|
|
2069
2178
|
} else {
|
|
@@ -2081,16 +2190,16 @@ function trimLeadingSeparators(value) {
|
|
|
2081
2190
|
async function resolveFileReference(rawValue, searchRoots) {
|
|
2082
2191
|
const displayPath = trimLeadingSeparators(rawValue);
|
|
2083
2192
|
const potentialPaths = [];
|
|
2084
|
-
if (
|
|
2085
|
-
potentialPaths.push(
|
|
2193
|
+
if (import_node_path9.default.isAbsolute(rawValue)) {
|
|
2194
|
+
potentialPaths.push(import_node_path9.default.normalize(rawValue));
|
|
2086
2195
|
}
|
|
2087
2196
|
for (const base of searchRoots) {
|
|
2088
|
-
potentialPaths.push(
|
|
2197
|
+
potentialPaths.push(import_node_path9.default.resolve(base, displayPath));
|
|
2089
2198
|
}
|
|
2090
2199
|
const attempted = [];
|
|
2091
2200
|
const seen = /* @__PURE__ */ new Set();
|
|
2092
2201
|
for (const candidate of potentialPaths) {
|
|
2093
|
-
const absoluteCandidate =
|
|
2202
|
+
const absoluteCandidate = import_node_path9.default.resolve(candidate);
|
|
2094
2203
|
if (seen.has(absoluteCandidate)) {
|
|
2095
2204
|
continue;
|
|
2096
2205
|
}
|
|
@@ -2109,7 +2218,7 @@ function isObject4(value) {
|
|
|
2109
2218
|
}
|
|
2110
2219
|
async function validateFileReferences(evalFilePath) {
|
|
2111
2220
|
const errors = [];
|
|
2112
|
-
const absolutePath =
|
|
2221
|
+
const absolutePath = import_node_path10.default.resolve(evalFilePath);
|
|
2113
2222
|
const gitRoot = await findGitRoot(absolutePath);
|
|
2114
2223
|
if (!gitRoot) {
|
|
2115
2224
|
errors.push({
|
|
@@ -2234,14 +2343,14 @@ async function validateMessagesFileRefs(messages, location, searchRoots, filePat
|
|
|
2234
2343
|
|
|
2235
2344
|
// src/evaluation/validation/workspace-path-validator.ts
|
|
2236
2345
|
var import_promises9 = require("fs/promises");
|
|
2237
|
-
var
|
|
2346
|
+
var import_node_path11 = __toESM(require("path"), 1);
|
|
2238
2347
|
function isObject5(value) {
|
|
2239
2348
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
2240
2349
|
}
|
|
2241
2350
|
async function validateWorkspacePaths(evalFilePath) {
|
|
2242
2351
|
const errors = [];
|
|
2243
|
-
const absolutePath =
|
|
2244
|
-
const evalDir =
|
|
2352
|
+
const absolutePath = import_node_path11.default.resolve(evalFilePath);
|
|
2353
|
+
const evalDir = import_node_path11.default.dirname(absolutePath);
|
|
2245
2354
|
let parsed;
|
|
2246
2355
|
try {
|
|
2247
2356
|
const content = await (0, import_promises9.readFile)(absolutePath, "utf8");
|
|
@@ -2253,12 +2362,12 @@ async function validateWorkspacePaths(evalFilePath) {
|
|
|
2253
2362
|
const workspaceRaw = parsed.workspace;
|
|
2254
2363
|
if (workspaceRaw === void 0 || workspaceRaw === null) return errors;
|
|
2255
2364
|
if (typeof workspaceRaw === "string") {
|
|
2256
|
-
const workspaceFilePath =
|
|
2365
|
+
const workspaceFilePath = import_node_path11.default.resolve(evalDir, workspaceRaw);
|
|
2257
2366
|
try {
|
|
2258
2367
|
const wsContent = await (0, import_promises9.readFile)(workspaceFilePath, "utf8");
|
|
2259
2368
|
const wsParsed = parseYamlValue(wsContent);
|
|
2260
2369
|
if (isObject5(wsParsed)) {
|
|
2261
|
-
const wsDir =
|
|
2370
|
+
const wsDir = import_node_path11.default.dirname(workspaceFilePath);
|
|
2262
2371
|
await validateWorkspaceObject(wsParsed, wsDir, absolutePath, "workspace", errors);
|
|
2263
2372
|
}
|
|
2264
2373
|
} catch {
|
|
@@ -2271,7 +2380,7 @@ async function validateWorkspacePaths(evalFilePath) {
|
|
|
2271
2380
|
async function validateWorkspaceObject(obj, baseDir, evalFilePath, location, errors) {
|
|
2272
2381
|
const template = obj.template;
|
|
2273
2382
|
if (typeof template === "string") {
|
|
2274
|
-
const templatePath =
|
|
2383
|
+
const templatePath = import_node_path11.default.isAbsolute(template) ? template : import_node_path11.default.resolve(baseDir, template);
|
|
2275
2384
|
if (!await fileExists2(templatePath)) {
|
|
2276
2385
|
errors.push({
|
|
2277
2386
|
severity: "error",
|
|
@@ -2287,14 +2396,14 @@ async function validateWorkspaceObject(obj, baseDir, evalFilePath, location, err
|
|
|
2287
2396
|
const hook = hooks[hookName];
|
|
2288
2397
|
if (!isObject5(hook)) continue;
|
|
2289
2398
|
const hookCwdRaw = typeof hook.cwd === "string" ? hook.cwd : void 0;
|
|
2290
|
-
const hookCwd = hookCwdRaw ?
|
|
2399
|
+
const hookCwd = hookCwdRaw ? import_node_path11.default.isAbsolute(hookCwdRaw) ? hookCwdRaw : import_node_path11.default.resolve(baseDir, hookCwdRaw) : baseDir;
|
|
2291
2400
|
const command = hook.command ?? hook.script;
|
|
2292
2401
|
if (!Array.isArray(command)) continue;
|
|
2293
2402
|
for (let i = 0; i < command.length; i++) {
|
|
2294
2403
|
const arg = command[i];
|
|
2295
2404
|
if (typeof arg !== "string") continue;
|
|
2296
2405
|
if (!looksLikeFilePath(arg)) continue;
|
|
2297
|
-
const resolved =
|
|
2406
|
+
const resolved = import_node_path11.default.isAbsolute(arg) ? arg : import_node_path11.default.resolve(hookCwd, arg);
|
|
2298
2407
|
if (!await fileExists2(resolved)) {
|
|
2299
2408
|
errors.push({
|
|
2300
2409
|
severity: "error",
|