agentv 4.42.3 → 4.42.4
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/{artifact-writer-6EDNHQHX.js → artifact-writer-7PXSB6LM.js} +2 -2
- package/dist/{chunk-DZYUOKTI.js → chunk-ISPJY2AX.js} +4 -4
- package/dist/{chunk-BACWATIZ.js → chunk-N6U3GXMF.js} +6 -6
- package/dist/{chunk-BACWATIZ.js.map → chunk-N6U3GXMF.js.map} +1 -1
- package/dist/{chunk-SLK6MUSS.js → chunk-RBOP5X36.js} +59 -17
- package/dist/chunk-RBOP5X36.js.map +1 -0
- package/dist/cli.js +3 -3
- package/dist/{dist-IUZ5JPF5.js → dist-VQWTETNY.js} +2 -2
- package/dist/index.js +3 -3
- package/dist/{interactive-YDTA2QJF.js → interactive-TNRJEFA2.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-SLK6MUSS.js.map +0 -1
- /package/dist/{artifact-writer-6EDNHQHX.js.map → artifact-writer-7PXSB6LM.js.map} +0 -0
- /package/dist/{chunk-DZYUOKTI.js.map → chunk-ISPJY2AX.js.map} +0 -0
- /package/dist/{dist-IUZ5JPF5.js.map → dist-VQWTETNY.js.map} +0 -0
- /package/dist/{interactive-YDTA2QJF.js.map → interactive-TNRJEFA2.js.map} +0 -0
|
@@ -686,6 +686,8 @@ var RESULTS_REPO_COMMIT_EMAIL = "agentv@results-repo";
|
|
|
686
686
|
var RESULTS_REPO_COMMIT_NAME = "AgentV Results";
|
|
687
687
|
var DEFAULT_RESULTS_BRANCH = "agentv/results/v1";
|
|
688
688
|
var GIT_EMPTY_TREE = "4b825dc642cb6eb9a060e54bf8d69288fbee4904";
|
|
689
|
+
var RESULTS_REPO_GENESIS_MESSAGE = "chore(results): initialize AgentV results branch";
|
|
690
|
+
var RESULTS_REPO_GENESIS_DATE = "@0 +0000";
|
|
689
691
|
var activeResultsRepoSyncs = /* @__PURE__ */ new Set();
|
|
690
692
|
function sanitizeRepoSlug(repo) {
|
|
691
693
|
return repo.trim().replace(/[^A-Za-z0-9._-]+/g, "-");
|
|
@@ -813,8 +815,17 @@ async function resolveDefaultBranch(repoDir) {
|
|
|
813
815
|
}
|
|
814
816
|
return "main";
|
|
815
817
|
}
|
|
816
|
-
async function fetchResultsRepo(repoDir, remote = "origin") {
|
|
818
|
+
async function fetchResultsRepo(repoDir, remote = "origin", branch) {
|
|
817
819
|
await runGit(["fetch", remote, "--prune"], { cwd: repoDir });
|
|
820
|
+
if (branch) {
|
|
821
|
+
await fetchResultsBranchRef(repoDir, remote, branch);
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
async function fetchResultsBranchRef(repoDir, remote, branch) {
|
|
825
|
+
await runGit(["fetch", remote, `+refs/heads/${branch}:refs/remotes/${remote}/${branch}`], {
|
|
826
|
+
cwd: repoDir,
|
|
827
|
+
check: false
|
|
828
|
+
});
|
|
818
829
|
}
|
|
819
830
|
function remoteBranchRef(branch, remote = "origin") {
|
|
820
831
|
return `${remote}/${branch}`;
|
|
@@ -877,12 +888,27 @@ async function checkoutConfiguredResultsBranch(repoDir, config) {
|
|
|
877
888
|
return remoteRef;
|
|
878
889
|
}
|
|
879
890
|
async function createOrphanResultsBranch(repoDir, branch) {
|
|
891
|
+
await runGit(["update-ref", `refs/heads/${branch}`, await createResultsGenesisCommit(repoDir)], {
|
|
892
|
+
cwd: repoDir
|
|
893
|
+
});
|
|
894
|
+
}
|
|
895
|
+
async function createResultsGenesisCommit(repoDir) {
|
|
880
896
|
await ensureResultsRepoCommitIdentity(repoDir);
|
|
881
897
|
const { stdout } = await runGit(
|
|
882
|
-
["commit-tree", GIT_EMPTY_TREE, "-m",
|
|
883
|
-
{
|
|
898
|
+
["commit-tree", GIT_EMPTY_TREE, "-m", RESULTS_REPO_GENESIS_MESSAGE],
|
|
899
|
+
{
|
|
900
|
+
cwd: repoDir,
|
|
901
|
+
env: {
|
|
902
|
+
GIT_AUTHOR_NAME: RESULTS_REPO_COMMIT_NAME,
|
|
903
|
+
GIT_AUTHOR_EMAIL: RESULTS_REPO_COMMIT_EMAIL,
|
|
904
|
+
GIT_COMMITTER_NAME: RESULTS_REPO_COMMIT_NAME,
|
|
905
|
+
GIT_COMMITTER_EMAIL: RESULTS_REPO_COMMIT_EMAIL,
|
|
906
|
+
GIT_AUTHOR_DATE: RESULTS_REPO_GENESIS_DATE,
|
|
907
|
+
GIT_COMMITTER_DATE: RESULTS_REPO_GENESIS_DATE
|
|
908
|
+
}
|
|
909
|
+
}
|
|
884
910
|
);
|
|
885
|
-
|
|
911
|
+
return stdout.trim();
|
|
886
912
|
}
|
|
887
913
|
async function isGitRepository(repoDir) {
|
|
888
914
|
try {
|
|
@@ -1266,14 +1292,18 @@ async function getResultsRepoSyncStatus(config) {
|
|
|
1266
1292
|
}
|
|
1267
1293
|
try {
|
|
1268
1294
|
if (normalized.repo_path) {
|
|
1269
|
-
await fetchResultsRepo(normalized.path, normalized.remote).catch(
|
|
1295
|
+
await fetchResultsRepo(normalized.path, normalized.remote, normalized.branch).catch(
|
|
1296
|
+
() => void 0
|
|
1297
|
+
);
|
|
1270
1298
|
return withGitInspection(
|
|
1271
1299
|
baseStatus,
|
|
1272
1300
|
await inspectResultsStorageBranchGit(normalized.path, normalized)
|
|
1273
1301
|
);
|
|
1274
1302
|
}
|
|
1275
1303
|
if (normalized.branch) {
|
|
1276
|
-
await fetchResultsRepo(normalized.path, normalized.remote).catch(
|
|
1304
|
+
await fetchResultsRepo(normalized.path, normalized.remote, normalized.branch).catch(
|
|
1305
|
+
() => void 0
|
|
1306
|
+
);
|
|
1277
1307
|
await checkoutConfiguredResultsBranch(normalized.path, normalized);
|
|
1278
1308
|
}
|
|
1279
1309
|
return withGitInspection(baseStatus, await inspectResultsRepoGit(normalized.path, normalized));
|
|
@@ -1290,7 +1320,7 @@ async function syncResultsRepo(config) {
|
|
|
1290
1320
|
const normalized = normalizeResultsConfig(config);
|
|
1291
1321
|
try {
|
|
1292
1322
|
const repoDir = await ensureResultsRepoClone(normalized);
|
|
1293
|
-
await fetchResultsRepo(repoDir, normalized.remote);
|
|
1323
|
+
await fetchResultsRepo(repoDir, normalized.remote, normalized.branch);
|
|
1294
1324
|
if (!normalized.repo_path) {
|
|
1295
1325
|
await checkoutConfiguredResultsBranch(repoDir, normalized);
|
|
1296
1326
|
}
|
|
@@ -1328,7 +1358,7 @@ async function syncResultsRepoForProject(config) {
|
|
|
1328
1358
|
const repoDir = await ensureResultsRepoClone(normalized);
|
|
1329
1359
|
if (normalized.repo_path) {
|
|
1330
1360
|
try {
|
|
1331
|
-
await fetchResultsRepo(repoDir, normalized.remote);
|
|
1361
|
+
await fetchResultsRepo(repoDir, normalized.remote, normalized.branch);
|
|
1332
1362
|
} catch (error) {
|
|
1333
1363
|
if (normalized.require_push) {
|
|
1334
1364
|
throw error;
|
|
@@ -1378,7 +1408,7 @@ async function syncResultsRepoForProject(config) {
|
|
|
1378
1408
|
commitCreated
|
|
1379
1409
|
});
|
|
1380
1410
|
}
|
|
1381
|
-
await fetchResultsRepo(repoDir, normalized.remote);
|
|
1411
|
+
await fetchResultsRepo(repoDir, normalized.remote, normalized.branch);
|
|
1382
1412
|
await checkoutConfiguredResultsBranch(repoDir, normalized);
|
|
1383
1413
|
let inspection = await inspectResultsRepoGit(repoDir, normalized);
|
|
1384
1414
|
if (inspection.syncStatus === "conflicted") {
|
|
@@ -1514,10 +1544,12 @@ async function syncResultsRepoForProject(config) {
|
|
|
1514
1544
|
try {
|
|
1515
1545
|
await runGit(["push", normalized.remote, `HEAD:${targetBranch}`], { cwd: repoDir });
|
|
1516
1546
|
pushPerformed = true;
|
|
1517
|
-
await fetchResultsRepo(repoDir, normalized.remote);
|
|
1547
|
+
await fetchResultsRepo(repoDir, normalized.remote, normalized.branch);
|
|
1518
1548
|
inspection = await inspectResultsRepoGit(repoDir, normalized);
|
|
1519
1549
|
} catch (error) {
|
|
1520
|
-
await fetchResultsRepo(repoDir, normalized.remote).catch(
|
|
1550
|
+
await fetchResultsRepo(repoDir, normalized.remote, normalized.branch).catch(
|
|
1551
|
+
() => void 0
|
|
1552
|
+
);
|
|
1521
1553
|
inspection = await inspectResultsRepoGit(repoDir, normalized);
|
|
1522
1554
|
const status = withGitInspection(getResultsRepoStatus(normalized), inspection);
|
|
1523
1555
|
const reason = `Results repo push was rejected: ${getStatusMessage(error)}`;
|
|
@@ -1744,11 +1776,19 @@ async function commitResultsRunWithTemporaryIndex(params) {
|
|
|
1744
1776
|
await ensureResultsBranchNotCheckedOut(params.repoDir, normalized);
|
|
1745
1777
|
const destinationRunPath = normalizeDestinationPath(params.destinationPath);
|
|
1746
1778
|
const destinationTreePath = path4.posix.join(RESULTS_REPO_RUNS_DIR, destinationRunPath);
|
|
1747
|
-
|
|
1779
|
+
let base = await resolveStorageBranchBase({
|
|
1748
1780
|
repoDir: params.repoDir,
|
|
1749
1781
|
normalized,
|
|
1750
1782
|
preferRemote: params.preferRemoteBase
|
|
1751
1783
|
});
|
|
1784
|
+
if (!base.baseRef) {
|
|
1785
|
+
await createOrphanResultsBranch(params.repoDir, normalized.branch);
|
|
1786
|
+
base = await resolveStorageBranchBase({
|
|
1787
|
+
repoDir: params.repoDir,
|
|
1788
|
+
normalized,
|
|
1789
|
+
preferRemote: params.preferRemoteBase
|
|
1790
|
+
});
|
|
1791
|
+
}
|
|
1752
1792
|
const indexRoot = await mkdtemp(path4.join(os.tmpdir(), "agentv-results-index-"));
|
|
1753
1793
|
const indexFile = path4.join(indexRoot, "index");
|
|
1754
1794
|
const indexEnv = { GIT_INDEX_FILE: indexFile };
|
|
@@ -1856,12 +1896,14 @@ async function pushDirectResultsToStorageBranch(params) {
|
|
|
1856
1896
|
last_synced_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1857
1897
|
last_error: void 0
|
|
1858
1898
|
});
|
|
1859
|
-
await fetchResultsRepo(params.repoDir, params.normalized.remote).catch(
|
|
1899
|
+
await fetchResultsRepo(params.repoDir, params.normalized.remote, params.storageBranch).catch(
|
|
1900
|
+
() => void 0
|
|
1901
|
+
);
|
|
1860
1902
|
return;
|
|
1861
1903
|
} catch (error) {
|
|
1862
1904
|
const message = error instanceof Error ? error.message : String(error);
|
|
1863
1905
|
if (attempt < DIRECT_PUSH_MAX_RETRIES && message.includes("non-fast-forward")) {
|
|
1864
|
-
await fetchResultsRepo(params.repoDir, params.normalized.remote);
|
|
1906
|
+
await fetchResultsRepo(params.repoDir, params.normalized.remote, params.storageBranch);
|
|
1865
1907
|
const remoteRef = remoteBranchRef(params.storageBranch, params.normalized.remote);
|
|
1866
1908
|
const localOnlyCount = await gitRefExists(params.repoDir, remoteRef) ? await countUnpushedCommits(params.repoDir, remoteRef, params.storageBranch) : 0;
|
|
1867
1909
|
if (localOnlyCount > 1) {
|
|
@@ -1887,7 +1929,7 @@ async function pushDirectResultsToStorageBranch(params) {
|
|
|
1887
1929
|
async function directPushResults(params) {
|
|
1888
1930
|
const normalized = normalizeResultsConfig(params.config);
|
|
1889
1931
|
const repoDir = await ensureResultsRepoClone(normalized);
|
|
1890
|
-
await fetchResultsRepo(repoDir, normalized.remote).catch((error) => {
|
|
1932
|
+
await fetchResultsRepo(repoDir, normalized.remote, normalized.branch).catch((error) => {
|
|
1891
1933
|
if (normalized.require_push) {
|
|
1892
1934
|
throw error;
|
|
1893
1935
|
}
|
|
@@ -2057,7 +2099,7 @@ function buildWipBranchName(runDir) {
|
|
|
2057
2099
|
async function setupWipWorktree(params) {
|
|
2058
2100
|
const normalized = normalizeResultsConfig(params.config);
|
|
2059
2101
|
const cloneDir = await ensureResultsRepoClone(normalized);
|
|
2060
|
-
await fetchResultsRepo(cloneDir, normalized.remote).catch((error) => {
|
|
2102
|
+
await fetchResultsRepo(cloneDir, normalized.remote, normalized.branch).catch((error) => {
|
|
2061
2103
|
if (normalized.require_push) {
|
|
2062
2104
|
throw error;
|
|
2063
2105
|
}
|
|
@@ -3418,4 +3460,4 @@ export {
|
|
|
3418
3460
|
TranscriptProvider,
|
|
3419
3461
|
createAgentKernel
|
|
3420
3462
|
};
|
|
3421
|
-
//# sourceMappingURL=chunk-
|
|
3463
|
+
//# sourceMappingURL=chunk-RBOP5X36.js.map
|