@rallycry/conveyor-agent 10.0.4 → 10.0.6
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-OOUQ2C4Z.js → chunk-37ZIDX6S.js} +25 -21
- package/dist/chunk-37ZIDX6S.js.map +1 -0
- package/dist/cli.js +59 -29
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/runtime/entrypoint.sh +53 -23
- package/dist/chunk-OOUQ2C4Z.js.map +0 -1
|
@@ -186,6 +186,7 @@ var AgentConnection = class _AgentConnection {
|
|
|
186
186
|
apiKeyUpdateCallback = null;
|
|
187
187
|
pullBranchCallback = null;
|
|
188
188
|
finalizeSnapshotCallback = null;
|
|
189
|
+
runStartCommandCallback = null;
|
|
189
190
|
earlyPullBranches = [];
|
|
190
191
|
// PTY relay (S5 terminal). Single-slot callbacks, set per PtySession run.
|
|
191
192
|
ptyInputCallback = null;
|
|
@@ -343,6 +344,9 @@ var AgentConnection = class _AgentConnection {
|
|
|
343
344
|
this.socket.on("session:finalizeSnapshot", () => {
|
|
344
345
|
this.finalizeSnapshotCallback?.();
|
|
345
346
|
});
|
|
347
|
+
this.socket.on("session:runStartCommand", () => {
|
|
348
|
+
this.runStartCommandCallback?.();
|
|
349
|
+
});
|
|
346
350
|
this.socket.on("pty:input", (data) => {
|
|
347
351
|
if (data.sessionId && data.sessionId !== this.config.sessionId) return;
|
|
348
352
|
this.ptyInputCallback?.(data.data);
|
|
@@ -568,6 +572,9 @@ var AgentConnection = class _AgentConnection {
|
|
|
568
572
|
onFinalizeSnapshot(callback) {
|
|
569
573
|
this.finalizeSnapshotCallback = callback;
|
|
570
574
|
}
|
|
575
|
+
onRunStartCommand(callback) {
|
|
576
|
+
this.runStartCommandCallback = callback;
|
|
577
|
+
}
|
|
571
578
|
// ── PTY relay (S5 Connected-TUI terminal) ──────────────────────────
|
|
572
579
|
/**
|
|
573
580
|
* Forward a raw chunk of terminal output to the S2 relay (fire-and-forget).
|
|
@@ -944,8 +951,10 @@ function createServiceLogger(service) {
|
|
|
944
951
|
}
|
|
945
952
|
|
|
946
953
|
// src/runner/git-utils.ts
|
|
947
|
-
import { execSync } from "child_process";
|
|
954
|
+
import { execSync, exec } from "child_process";
|
|
948
955
|
import { realpathSync } from "fs";
|
|
956
|
+
import { promisify } from "util";
|
|
957
|
+
var execAsync = promisify(exec);
|
|
949
958
|
function syncWithBaseBranch(cwd, baseBranch) {
|
|
950
959
|
if (!baseBranch) return true;
|
|
951
960
|
try {
|
|
@@ -1057,20 +1066,15 @@ function stageAndCommit(cwd, message) {
|
|
|
1057
1066
|
return null;
|
|
1058
1067
|
}
|
|
1059
1068
|
}
|
|
1060
|
-
function tryPush(cwd, branch, skipVerify = false) {
|
|
1069
|
+
async function tryPush(cwd, branch, skipVerify = false) {
|
|
1061
1070
|
const noVerify = skipVerify ? "--no-verify " : "";
|
|
1062
1071
|
try {
|
|
1063
|
-
|
|
1064
|
-
cwd,
|
|
1065
|
-
stdio: ["ignore", "pipe", "pipe"],
|
|
1066
|
-
timeout: 3e4
|
|
1067
|
-
});
|
|
1072
|
+
await execAsync(`git push ${noVerify}origin ${branch}`, { cwd, timeout: 3e4 });
|
|
1068
1073
|
return true;
|
|
1069
1074
|
} catch {
|
|
1070
1075
|
try {
|
|
1071
|
-
|
|
1076
|
+
await execAsync(`git push ${noVerify}--force-with-lease origin ${branch}`, {
|
|
1072
1077
|
cwd,
|
|
1073
|
-
stdio: ["ignore", "pipe", "pipe"],
|
|
1074
1078
|
timeout: 3e4
|
|
1075
1079
|
});
|
|
1076
1080
|
return true;
|
|
@@ -1079,9 +1083,9 @@ function tryPush(cwd, branch, skipVerify = false) {
|
|
|
1079
1083
|
}
|
|
1080
1084
|
}
|
|
1081
1085
|
}
|
|
1082
|
-
function isAuthError(cwd) {
|
|
1086
|
+
async function isAuthError(cwd) {
|
|
1083
1087
|
try {
|
|
1084
|
-
|
|
1088
|
+
await execAsync("git push --dry-run", { cwd, timeout: 3e4 });
|
|
1085
1089
|
return false;
|
|
1086
1090
|
} catch (err) {
|
|
1087
1091
|
if (err.killed) return true;
|
|
@@ -1243,14 +1247,14 @@ async function pushToOrigin(cwd, refreshToken, skipVerify = false) {
|
|
|
1243
1247
|
} catch {
|
|
1244
1248
|
}
|
|
1245
1249
|
}
|
|
1246
|
-
if (tryPush(cwd, currentBranch, skipVerify)) return true;
|
|
1247
|
-
if (refreshToken && isAuthError(cwd)) {
|
|
1250
|
+
if (await tryPush(cwd, currentBranch, skipVerify)) return true;
|
|
1251
|
+
if (refreshToken && await isAuthError(cwd)) {
|
|
1248
1252
|
const token = await refreshToken();
|
|
1249
1253
|
if (token) {
|
|
1250
1254
|
updateRemoteToken(cwd, token);
|
|
1251
1255
|
process.env.GITHUB_TOKEN = token;
|
|
1252
1256
|
process.env.GH_TOKEN = token;
|
|
1253
|
-
return tryPush(cwd, currentBranch, skipVerify);
|
|
1257
|
+
return await tryPush(cwd, currentBranch, skipVerify);
|
|
1254
1258
|
}
|
|
1255
1259
|
}
|
|
1256
1260
|
return false;
|
|
@@ -1779,11 +1783,11 @@ function execErrorDetail(err) {
|
|
|
1779
1783
|
const message = withStreams.message ?? String(err);
|
|
1780
1784
|
return stderr ? `${message} \u2014 stderr: ${stderr}` : message;
|
|
1781
1785
|
}
|
|
1782
|
-
function dumpPostgresIfPresent(
|
|
1786
|
+
function dumpPostgresIfPresent(exec2 = execSync2) {
|
|
1783
1787
|
if (!hasPostgresDep()) return Promise.resolve({ dumped: false });
|
|
1784
1788
|
const outputPath = path.join(tmpdir(), `conveyor-pgdump-${randomUUID()}.sql`);
|
|
1785
1789
|
try {
|
|
1786
|
-
|
|
1790
|
+
exec2(buildPgDumpCommand({ outputPath }), {
|
|
1787
1791
|
stdio: ["ignore", "pipe", "pipe"],
|
|
1788
1792
|
timeout: 6e4
|
|
1789
1793
|
});
|
|
@@ -1794,10 +1798,10 @@ function dumpPostgresIfPresent(exec = execSync2) {
|
|
|
1794
1798
|
return Promise.resolve({ dumped: false });
|
|
1795
1799
|
}
|
|
1796
1800
|
}
|
|
1797
|
-
function applyPgDumpIfConfigured(dumpPath,
|
|
1801
|
+
function applyPgDumpIfConfigured(dumpPath, exec2 = execSync2) {
|
|
1798
1802
|
if (!hasPostgresDep()) return false;
|
|
1799
1803
|
try {
|
|
1800
|
-
|
|
1804
|
+
exec2(buildPsqlRestoreCommand({ dumpPath }), {
|
|
1801
1805
|
stdio: ["ignore", "pipe", "pipe"],
|
|
1802
1806
|
timeout: 12e4
|
|
1803
1807
|
});
|
|
@@ -6129,7 +6133,7 @@ function buildCreatePullRequestTool(connection, config) {
|
|
|
6129
6133
|
"Commit message for staging uncommitted changes. If not provided, a default message based on the PR title will be used."
|
|
6130
6134
|
),
|
|
6131
6135
|
skipVerify: z5.boolean().optional().describe(
|
|
6132
|
-
"
|
|
6136
|
+
"Controls the local pre-push quality gate (lint/typecheck/test). Defaults to true (--no-verify): the push skips the local gate because you should run gates yourself before opening the PR and CI re-runs them on the resulting PR. Running the full gate synchronously during the push would block the agent's event loop long enough to drop the Conveyor socket connection. Pass false to force the local pre-push hook to run."
|
|
6133
6137
|
)
|
|
6134
6138
|
},
|
|
6135
6139
|
async ({ title, body, branch, baseBranch, commitMessage, skipVerify }) => {
|
|
@@ -6164,7 +6168,7 @@ Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>`;
|
|
|
6164
6168
|
return void 0;
|
|
6165
6169
|
}
|
|
6166
6170
|
},
|
|
6167
|
-
skipVerify ??
|
|
6171
|
+
skipVerify ?? true
|
|
6168
6172
|
);
|
|
6169
6173
|
if (pushSuccess) {
|
|
6170
6174
|
connection.sendEvent({
|
|
@@ -9916,4 +9920,4 @@ export {
|
|
|
9916
9920
|
runStartCommand,
|
|
9917
9921
|
unshallowRepo
|
|
9918
9922
|
};
|
|
9919
|
-
//# sourceMappingURL=chunk-
|
|
9923
|
+
//# sourceMappingURL=chunk-37ZIDX6S.js.map
|