@agentv/core 4.34.0-next.1 → 4.35.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/evaluation/validation/index.cjs +121 -1
- package/dist/evaluation/validation/index.cjs.map +1 -1
- package/dist/evaluation/validation/index.js +121 -1
- package/dist/evaluation/validation/index.js.map +1 -1
- package/dist/index.cjs +23 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +20 -22
- package/dist/index.d.ts +20 -22
- package/dist/index.js +23 -21
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -2051,7 +2051,29 @@ function validateProjects(errors, filePath, projects) {
|
|
|
2051
2051
|
validateRequiredString(errors, filePath, projectRecord.id, `${location}.id`);
|
|
2052
2052
|
validateRequiredString(errors, filePath, projectRecord.name, `${location}.name`);
|
|
2053
2053
|
validateRequiredString(errors, filePath, projectRecord.path, `${location}.path`);
|
|
2054
|
-
|
|
2054
|
+
if (projectRecord.source !== void 0) {
|
|
2055
|
+
errors.push({
|
|
2056
|
+
severity: "error",
|
|
2057
|
+
filePath,
|
|
2058
|
+
location: `${location}.source`,
|
|
2059
|
+
message: `Field '${location}.source' was removed. Move 'source.url' to '${location}.repo_url' and move 'source.ref' to '${location}.ref'. Use a Git remote URL such as https://github.com/example/repo.git or git@github.com:example/repo.git.`
|
|
2060
|
+
});
|
|
2061
|
+
}
|
|
2062
|
+
if (projectRecord.repository !== void 0) {
|
|
2063
|
+
errors.push({
|
|
2064
|
+
severity: "error",
|
|
2065
|
+
filePath,
|
|
2066
|
+
location: `${location}.repository`,
|
|
2067
|
+
message: `Field '${location}.repository' was removed. Use '${location}.repo_url' with a Git remote URL instead.`
|
|
2068
|
+
});
|
|
2069
|
+
}
|
|
2070
|
+
if (projectRecord.repo_url !== void 0) {
|
|
2071
|
+
validateGitRemoteUrl(errors, filePath, projectRecord.repo_url, `${location}.repo_url`);
|
|
2072
|
+
}
|
|
2073
|
+
if (projectRecord.ref !== void 0) {
|
|
2074
|
+
validateRequiredString(errors, filePath, projectRecord.ref, `${location}.ref`);
|
|
2075
|
+
}
|
|
2076
|
+
validateProjectResultsConfig(errors, filePath, projectRecord.results, `${location}.results`);
|
|
2055
2077
|
});
|
|
2056
2078
|
}
|
|
2057
2079
|
function validateRequiredString(errors, filePath, value, location) {
|
|
@@ -2064,6 +2086,104 @@ function validateRequiredString(errors, filePath, value, location) {
|
|
|
2064
2086
|
});
|
|
2065
2087
|
}
|
|
2066
2088
|
}
|
|
2089
|
+
function validateGitRemoteUrl(errors, filePath, value, location) {
|
|
2090
|
+
if (typeof value !== "string" || value.trim().length === 0) {
|
|
2091
|
+
errors.push({
|
|
2092
|
+
severity: "error",
|
|
2093
|
+
filePath,
|
|
2094
|
+
location,
|
|
2095
|
+
message: `Field '${location}' must be a non-empty Git remote URL (e.g., https://github.com/EntityProcess/agentv.git or git@github.com:EntityProcess/agentv.git)`
|
|
2096
|
+
});
|
|
2097
|
+
return;
|
|
2098
|
+
}
|
|
2099
|
+
const repoUrl = value.trim();
|
|
2100
|
+
if (!/^(https?:\/\/|ssh:\/\/|git@|file:\/\/).+/.test(repoUrl)) {
|
|
2101
|
+
errors.push({
|
|
2102
|
+
severity: "error",
|
|
2103
|
+
filePath,
|
|
2104
|
+
location,
|
|
2105
|
+
message: `Field '${location}' must be a Git remote URL, not an owner/name shorthand. Use https://github.com/owner/repo.git or git@github.com:owner/repo.git.`
|
|
2106
|
+
});
|
|
2107
|
+
}
|
|
2108
|
+
}
|
|
2109
|
+
function validateProjectResultsConfig(errors, filePath, rawResults, location) {
|
|
2110
|
+
if (rawResults === void 0) {
|
|
2111
|
+
return;
|
|
2112
|
+
}
|
|
2113
|
+
if (typeof rawResults !== "object" || rawResults === null || Array.isArray(rawResults)) {
|
|
2114
|
+
errors.push({
|
|
2115
|
+
severity: "error",
|
|
2116
|
+
filePath,
|
|
2117
|
+
location,
|
|
2118
|
+
message: `Field '${location}' must be an object`
|
|
2119
|
+
});
|
|
2120
|
+
return;
|
|
2121
|
+
}
|
|
2122
|
+
const resultsRecord = rawResults;
|
|
2123
|
+
const removedFields = {
|
|
2124
|
+
mode: `Remove '${location}.mode'; project results use '${location}.repo_url' as the Git remote URL.`,
|
|
2125
|
+
repo: `Field '${location}.repo' was removed. Use '${location}.repo_url' with a Git remote URL instead.`,
|
|
2126
|
+
repository: `Field '${location}.repository' was removed. Use '${location}.repo_url' with a Git remote URL instead.`,
|
|
2127
|
+
local_path: `Field '${location}.local_path' was removed. Use '${location}.path' for the local clone path instead.`,
|
|
2128
|
+
auto_push: `Field '${location}.auto_push' was removed. Use '${location}.sync.auto_push' instead.`
|
|
2129
|
+
};
|
|
2130
|
+
for (const [field, message] of Object.entries(removedFields)) {
|
|
2131
|
+
if (resultsRecord[field] !== void 0) {
|
|
2132
|
+
errors.push({
|
|
2133
|
+
severity: "error",
|
|
2134
|
+
filePath,
|
|
2135
|
+
location: `${location}.${field}`,
|
|
2136
|
+
message
|
|
2137
|
+
});
|
|
2138
|
+
}
|
|
2139
|
+
}
|
|
2140
|
+
validateGitRemoteUrl(errors, filePath, resultsRecord.repo_url, `${location}.repo_url`);
|
|
2141
|
+
if (resultsRecord.path !== void 0) {
|
|
2142
|
+
if (typeof resultsRecord.path !== "string" || resultsRecord.path.trim().length === 0) {
|
|
2143
|
+
errors.push({
|
|
2144
|
+
severity: "error",
|
|
2145
|
+
filePath,
|
|
2146
|
+
location: `${location}.path`,
|
|
2147
|
+
message: `Field '${location}.path' must be a non-empty string`
|
|
2148
|
+
});
|
|
2149
|
+
} else if (!isFilesystemPath(resultsRecord.path.trim())) {
|
|
2150
|
+
errors.push({
|
|
2151
|
+
severity: "error",
|
|
2152
|
+
filePath,
|
|
2153
|
+
location: `${location}.path`,
|
|
2154
|
+
message: `'${location}.path' must be an absolute or home-relative filesystem path (e.g., ~/data/agentv-results).`
|
|
2155
|
+
});
|
|
2156
|
+
}
|
|
2157
|
+
}
|
|
2158
|
+
if (resultsRecord.sync !== void 0) {
|
|
2159
|
+
if (typeof resultsRecord.sync !== "object" || resultsRecord.sync === null || Array.isArray(resultsRecord.sync)) {
|
|
2160
|
+
errors.push({
|
|
2161
|
+
severity: "error",
|
|
2162
|
+
filePath,
|
|
2163
|
+
location: `${location}.sync`,
|
|
2164
|
+
message: `Field '${location}.sync' must be an object`
|
|
2165
|
+
});
|
|
2166
|
+
} else {
|
|
2167
|
+
const syncRecord = resultsRecord.sync;
|
|
2168
|
+
if (syncRecord.auto_push !== void 0 && typeof syncRecord.auto_push !== "boolean") {
|
|
2169
|
+
errors.push({
|
|
2170
|
+
severity: "error",
|
|
2171
|
+
filePath,
|
|
2172
|
+
location: `${location}.sync.auto_push`,
|
|
2173
|
+
message: `Field '${location}.sync.auto_push' must be a boolean`
|
|
2174
|
+
});
|
|
2175
|
+
}
|
|
2176
|
+
}
|
|
2177
|
+
}
|
|
2178
|
+
if (resultsRecord.branch_prefix !== void 0 && (typeof resultsRecord.branch_prefix !== "string" || resultsRecord.branch_prefix.trim().length === 0)) {
|
|
2179
|
+
errors.push({
|
|
2180
|
+
severity: "error",
|
|
2181
|
+
filePath,
|
|
2182
|
+
location: `${location}.branch_prefix`,
|
|
2183
|
+
message: `Field '${location}.branch_prefix' must be a non-empty string`
|
|
2184
|
+
});
|
|
2185
|
+
}
|
|
2186
|
+
}
|
|
2067
2187
|
function validateResultsConfig(errors, filePath, rawResults, location) {
|
|
2068
2188
|
if (rawResults === void 0) {
|
|
2069
2189
|
return;
|