@agentv/core 4.24.1-next.1 → 4.25.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/index.cjs +42 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.js +41 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -24451,6 +24451,7 @@ __export(index_exports, {
|
|
|
24451
24451
|
deriveBenchmarkId: () => deriveBenchmarkId,
|
|
24452
24452
|
deriveCategory: () => deriveCategory,
|
|
24453
24453
|
detectFormat: () => detectFormat,
|
|
24454
|
+
directPushResults: () => directPushResults,
|
|
24454
24455
|
directorySizeBytes: () => directorySizeBytes,
|
|
24455
24456
|
discoverAssertions: () => discoverAssertions,
|
|
24456
24457
|
discoverBenchmarks: () => discoverBenchmarks,
|
|
@@ -25470,6 +25471,46 @@ async function createDraftResultsPr(params) {
|
|
|
25470
25471
|
);
|
|
25471
25472
|
return stdout.trim();
|
|
25472
25473
|
}
|
|
25474
|
+
var DIRECT_PUSH_MAX_RETRIES = 3;
|
|
25475
|
+
async function directPushResults(params) {
|
|
25476
|
+
const normalized = normalizeResultsExportConfig(params.config);
|
|
25477
|
+
const repoDir = await ensureResultsRepoClone(normalized);
|
|
25478
|
+
const baseBranch = await resolveDefaultBranch(repoDir);
|
|
25479
|
+
await updateCacheRepo(repoDir, baseBranch);
|
|
25480
|
+
const destinationDir = import_node_path54.default.join(repoDir, normalized.path, params.destinationPath);
|
|
25481
|
+
await stageResultsArtifacts({
|
|
25482
|
+
repoDir,
|
|
25483
|
+
sourceDir: params.sourceDir,
|
|
25484
|
+
destinationDir
|
|
25485
|
+
});
|
|
25486
|
+
await runGit(["add", "--all"], { cwd: repoDir });
|
|
25487
|
+
const { stdout: status } = await runGit(["status", "--porcelain"], {
|
|
25488
|
+
cwd: repoDir,
|
|
25489
|
+
check: false
|
|
25490
|
+
});
|
|
25491
|
+
if (status.trim().length === 0) {
|
|
25492
|
+
return false;
|
|
25493
|
+
}
|
|
25494
|
+
await runGit(["commit", "-m", params.commitMessage], { cwd: repoDir });
|
|
25495
|
+
for (let attempt = 1; attempt <= DIRECT_PUSH_MAX_RETRIES; attempt++) {
|
|
25496
|
+
try {
|
|
25497
|
+
await runGit(["push", "origin", baseBranch], { cwd: repoDir });
|
|
25498
|
+
updateStatusFile(normalized, {
|
|
25499
|
+
last_synced_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
25500
|
+
last_error: void 0
|
|
25501
|
+
});
|
|
25502
|
+
return true;
|
|
25503
|
+
} catch (error) {
|
|
25504
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
25505
|
+
if (attempt < DIRECT_PUSH_MAX_RETRIES && message.includes("non-fast-forward")) {
|
|
25506
|
+
await runGit(["pull", "--rebase", "origin", baseBranch], { cwd: repoDir });
|
|
25507
|
+
} else {
|
|
25508
|
+
throw error;
|
|
25509
|
+
}
|
|
25510
|
+
}
|
|
25511
|
+
}
|
|
25512
|
+
return false;
|
|
25513
|
+
}
|
|
25473
25514
|
|
|
25474
25515
|
// src/index.ts
|
|
25475
25516
|
init_paths();
|
|
@@ -26979,6 +27020,7 @@ function createAgentKernel() {
|
|
|
26979
27020
|
deriveBenchmarkId,
|
|
26980
27021
|
deriveCategory,
|
|
26981
27022
|
detectFormat,
|
|
27023
|
+
directPushResults,
|
|
26982
27024
|
directorySizeBytes,
|
|
26983
27025
|
discoverAssertions,
|
|
26984
27026
|
discoverBenchmarks,
|