@rallycry/conveyor-agent 10.2.0 → 10.2.2
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-EDEMOFUN.js → chunk-53ZLFIAI.js} +67 -14
- package/dist/chunk-53ZLFIAI.js.map +1 -0
- package/dist/cli.js +234 -46
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +24 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-EDEMOFUN.js.map +0 -1
|
@@ -188,6 +188,8 @@ var AgentConnection = class _AgentConnection {
|
|
|
188
188
|
finalizeSnapshotCallback = null;
|
|
189
189
|
runStartCommandCallback = null;
|
|
190
190
|
earlyPullBranches = [];
|
|
191
|
+
spawnReviewCallback = null;
|
|
192
|
+
earlySpawnReviews = [];
|
|
191
193
|
// PTY relay (S5 terminal). Single-slot callbacks, set per PtySession run.
|
|
192
194
|
ptyInputCallback = null;
|
|
193
195
|
ptyResizeCallback = null;
|
|
@@ -391,6 +393,10 @@ var AgentConnection = class _AgentConnection {
|
|
|
391
393
|
if (this.pullBranchCallback) this.pullBranchCallback(data);
|
|
392
394
|
else this.earlyPullBranches.push(data);
|
|
393
395
|
});
|
|
396
|
+
this.socket.on("session:spawnReview", (data) => {
|
|
397
|
+
if (this.spawnReviewCallback) this.spawnReviewCallback(data);
|
|
398
|
+
else this.earlySpawnReviews.push(data);
|
|
399
|
+
});
|
|
394
400
|
this.socket.on("session:finalizeSnapshot", () => {
|
|
395
401
|
this.finalizeSnapshotCallback?.();
|
|
396
402
|
});
|
|
@@ -621,6 +627,26 @@ var AgentConnection = class _AgentConnection {
|
|
|
621
627
|
for (const data of this.earlyPullBranches) callback(data);
|
|
622
628
|
this.earlyPullBranches = [];
|
|
623
629
|
}
|
|
630
|
+
onSpawnReview(callback) {
|
|
631
|
+
this.spawnReviewCallback = callback;
|
|
632
|
+
for (const data of this.earlySpawnReviews) callback(data);
|
|
633
|
+
this.earlySpawnReviews = [];
|
|
634
|
+
}
|
|
635
|
+
/**
|
|
636
|
+
* Report that a same-pod review child failed to spawn (fire-and-forget).
|
|
637
|
+
* The server Ends the orphaned review session and falls back to a dedicated
|
|
638
|
+
* review pod. sessionId is OUR (builder) session — the SEC-9 guard runs on
|
|
639
|
+
* it; the review session is identified separately.
|
|
640
|
+
*/
|
|
641
|
+
reportReviewSpawnFailure(reviewSessionId, error) {
|
|
642
|
+
if (!this.socket) return;
|
|
643
|
+
void this.call("reportReviewSpawnFailure", {
|
|
644
|
+
sessionId: this.config.sessionId,
|
|
645
|
+
reviewSessionId,
|
|
646
|
+
...error ? { error: error.slice(0, 2e3) } : {}
|
|
647
|
+
}).catch(() => {
|
|
648
|
+
});
|
|
649
|
+
}
|
|
624
650
|
onFinalizeSnapshot(callback) {
|
|
625
651
|
this.finalizeSnapshotCallback = callback;
|
|
626
652
|
}
|
|
@@ -2612,6 +2638,11 @@ var EmitAgentEventRequestSchema = z.object({
|
|
|
2612
2638
|
var RefreshGithubTokenRequestSchema = z.object({
|
|
2613
2639
|
sessionId: z.string()
|
|
2614
2640
|
});
|
|
2641
|
+
var ReportReviewSpawnFailureRequestSchema = z.object({
|
|
2642
|
+
sessionId: z.string(),
|
|
2643
|
+
reviewSessionId: z.string(),
|
|
2644
|
+
error: z.string().max(2e3).optional()
|
|
2645
|
+
});
|
|
2615
2646
|
var RefreshGithubTokenResponseSchema = z.object({
|
|
2616
2647
|
token: z.string()
|
|
2617
2648
|
});
|
|
@@ -2771,7 +2802,9 @@ var StopProjectWorkspaceRequestSchema = z2.object({
|
|
|
2771
2802
|
requestingUserId: z2.string().optional()
|
|
2772
2803
|
});
|
|
2773
2804
|
var ListMyLiveSessionsRequestSchema = z2.object({
|
|
2774
|
-
projectId: z2.string()
|
|
2805
|
+
projectId: z2.string(),
|
|
2806
|
+
/** Admin-only: list another member's sessions instead of the caller's. */
|
|
2807
|
+
targetUserId: z2.string().optional()
|
|
2775
2808
|
});
|
|
2776
2809
|
var StartAdhocSessionRequestSchema = z2.object({
|
|
2777
2810
|
projectId: z2.string(),
|
|
@@ -3976,6 +4009,18 @@ var PLAN_DIALOG_INTERVAL_MS = 1500;
|
|
|
3976
4009
|
var PLAN_DIALOG_SLOW_INTERVAL_MS = 5e3;
|
|
3977
4010
|
var PLAN_DIALOG_FAST_WINDOW_MS = 1e4;
|
|
3978
4011
|
var PLAN_DIALOG_WINDOW_MS = 9e4;
|
|
4012
|
+
function resolveSubmitNudgeTiming() {
|
|
4013
|
+
const envMs = (name, fallback) => {
|
|
4014
|
+
const raw = Number(process.env[name]);
|
|
4015
|
+
return Number.isFinite(raw) && raw > 0 ? raw : fallback;
|
|
4016
|
+
};
|
|
4017
|
+
return {
|
|
4018
|
+
intervalMs: envMs("CONVEYOR_PTY_NUDGE_INTERVAL_MS", SUBMIT_NUDGE_INTERVAL_MS),
|
|
4019
|
+
slowIntervalMs: envMs("CONVEYOR_PTY_NUDGE_SLOW_INTERVAL_MS", SUBMIT_NUDGE_SLOW_INTERVAL_MS),
|
|
4020
|
+
maxPresses: SUBMIT_NUDGE_MAX_PRESSES,
|
|
4021
|
+
windowMs: envMs("CONVEYOR_PTY_NUDGE_WINDOW_MS", SUBMIT_NUDGE_WINDOW_MS)
|
|
4022
|
+
};
|
|
4023
|
+
}
|
|
3979
4024
|
function turnOptionsFrom(options) {
|
|
3980
4025
|
return {
|
|
3981
4026
|
canUseTool: options.canUseTool,
|
|
@@ -4475,20 +4520,21 @@ var PtySession = class {
|
|
|
4475
4520
|
if (this.submitNudgeTimer) return;
|
|
4476
4521
|
this.pendingSubmitNudge = true;
|
|
4477
4522
|
const startedAt = Date.now();
|
|
4523
|
+
const { intervalMs, slowIntervalMs, maxPresses, windowMs } = resolveSubmitNudgeTiming();
|
|
4478
4524
|
let presses = 0;
|
|
4479
4525
|
const press = () => {
|
|
4480
|
-
if (this._toreDown || !this.pendingSubmitNudge || Date.now() - startedAt >=
|
|
4526
|
+
if (this._toreDown || !this.pendingSubmitNudge || Date.now() - startedAt >= windowMs) {
|
|
4481
4527
|
this.disarmSubmitNudge();
|
|
4482
4528
|
return;
|
|
4483
4529
|
}
|
|
4484
4530
|
presses++;
|
|
4485
4531
|
this.writeStdin("\r");
|
|
4486
|
-
if (presses ===
|
|
4532
|
+
if (presses === maxPresses && this.submitNudgeTimer) {
|
|
4487
4533
|
clearInterval(this.submitNudgeTimer);
|
|
4488
|
-
this.submitNudgeTimer = setInterval(press,
|
|
4534
|
+
this.submitNudgeTimer = setInterval(press, slowIntervalMs);
|
|
4489
4535
|
}
|
|
4490
4536
|
};
|
|
4491
|
-
this.submitNudgeTimer = setInterval(press,
|
|
4537
|
+
this.submitNudgeTimer = setInterval(press, intervalMs);
|
|
4492
4538
|
}
|
|
4493
4539
|
disarmSubmitNudge() {
|
|
4494
4540
|
this.pendingSubmitNudge = false;
|
|
@@ -8325,6 +8371,14 @@ function hasExistingSessionFile(taskId, cwd, lineage) {
|
|
|
8325
8371
|
const key = sessionLineageKey(taskId, lineage.agentMode, lineage.runnerMode);
|
|
8326
8372
|
return sessionFileExists(taskIdToSessionUuid(key), cwd);
|
|
8327
8373
|
}
|
|
8374
|
+
function resolveSessionStart(lineageKey, cwd) {
|
|
8375
|
+
const sessionUuid = taskIdToSessionUuid(lineageKey);
|
|
8376
|
+
if (sessionFileExists(sessionUuid, cwd)) {
|
|
8377
|
+
repairTornSessionFile(sessionTranscriptPath(cwd, sessionUuid));
|
|
8378
|
+
return { resume: sessionUuid };
|
|
8379
|
+
}
|
|
8380
|
+
return { sessionId: sessionUuid };
|
|
8381
|
+
}
|
|
8328
8382
|
function repairTornSessionFile(path4) {
|
|
8329
8383
|
try {
|
|
8330
8384
|
if (!existsSync(path4)) return false;
|
|
@@ -8524,13 +8578,11 @@ async function runSdkQuery(host, context, followUpContent, promptDeliveryOverrid
|
|
|
8524
8578
|
if (needsPlanSync) {
|
|
8525
8579
|
host.snapshotPlanFiles();
|
|
8526
8580
|
}
|
|
8527
|
-
const
|
|
8528
|
-
sessionLineageKey(context.taskId, mode, host.config.mode)
|
|
8581
|
+
const sessionStart = resolveSessionStart(
|
|
8582
|
+
sessionLineageKey(context.taskId, mode, host.config.mode),
|
|
8583
|
+
host.config.workspaceDir
|
|
8529
8584
|
);
|
|
8530
|
-
const hasExistingSession =
|
|
8531
|
-
if (hasExistingSession) {
|
|
8532
|
-
repairTornSessionFile(sessionTranscriptPath(host.config.workspaceDir, sessionUuid));
|
|
8533
|
-
}
|
|
8585
|
+
const hasExistingSession = !!sessionStart.resume;
|
|
8534
8586
|
const promptDelivery = promptDeliveryOverride ?? resolvePromptDelivery({
|
|
8535
8587
|
harnessKind: host.harnessKind,
|
|
8536
8588
|
runnerMode: host.config.mode,
|
|
@@ -8542,9 +8594,9 @@ async function runSdkQuery(host, context, followUpContent, promptDeliveryOverrid
|
|
|
8542
8594
|
const options = {
|
|
8543
8595
|
...buildQueryOptions(host, context),
|
|
8544
8596
|
promptDelivery,
|
|
8545
|
-
...
|
|
8597
|
+
...sessionStart.sessionId ? { sessionId: sessionStart.sessionId } : {}
|
|
8546
8598
|
};
|
|
8547
|
-
const resume =
|
|
8599
|
+
const resume = sessionStart.resume;
|
|
8548
8600
|
if (followUpContent) {
|
|
8549
8601
|
await runFollowUpQuery(host, context, options, resume, followUpContent);
|
|
8550
8602
|
} else if (isDiscoveryLike && promptDelivery !== "prefill") {
|
|
@@ -10635,6 +10687,7 @@ export {
|
|
|
10635
10687
|
updateRemoteToken,
|
|
10636
10688
|
flushPendingChanges,
|
|
10637
10689
|
pushToOrigin,
|
|
10690
|
+
resolveSessionStart,
|
|
10638
10691
|
PlanSync,
|
|
10639
10692
|
sampleKeyUsage,
|
|
10640
10693
|
awaitGitReady,
|
|
@@ -10653,4 +10706,4 @@ export {
|
|
|
10653
10706
|
runStartCommand,
|
|
10654
10707
|
unshallowRepo
|
|
10655
10708
|
};
|
|
10656
|
-
//# sourceMappingURL=chunk-
|
|
10709
|
+
//# sourceMappingURL=chunk-53ZLFIAI.js.map
|