@sideboard-ai/core 0.1.202 → 0.1.204
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/{abletime-KGPD3UUJ.js → abletime-S3UHQZVW.js} +4 -2
- package/dist/{abletime-345SE3B4.js → abletime-TONBQP4O.js} +4 -2
- package/dist/abletime-oauth-AVCEO2DY.js +314 -0
- package/dist/abletime-oauth-SD4SZY5U.js +52 -0
- package/dist/abletime-rest-6ODSXV7G.js +25 -0
- package/dist/abletime-rest-J2OBB4VA.js +24 -0
- package/dist/agents/cursor-runner.js +1 -1
- package/dist/{agents-573ZDIX6.js → agents-67K4BQFJ.js} +4 -4
- package/dist/{agents-OXX3ONVY.js → agents-BVOJNHV6.js} +5 -5
- package/dist/{app-settings-V6IHESEQ.js → app-settings-LGHMNHSP.js} +1 -1
- package/dist/{app-settings-AXCURTZJ.js → app-settings-YEPF46IJ.js} +1 -1
- package/dist/chunk-3K257PCS.js +393 -0
- package/dist/{chunk-54RSAMBH.js → chunk-5SMS6QTO.js} +2 -2
- package/dist/chunk-6Q7DFVDQ.js +309 -0
- package/dist/chunk-CYLDJWRK.js +391 -0
- package/dist/{chunk-PGQGP4FD.js → chunk-FO2NTJ7L.js} +37 -219
- package/dist/{chunk-7NKY2OX7.js → chunk-FO45DMJ5.js} +125 -109
- package/dist/{chunk-CQ5R3VPP.js → chunk-KZ7PI7FE.js} +18 -0
- package/dist/{chunk-7AHAABKN.js → chunk-QAVWH2RQ.js} +37 -229
- package/dist/{chunk-CXFW5LIH.js → chunk-QFBBUFD4.js} +38 -3
- package/dist/{chunk-RPX6VDW7.js → chunk-QUW5D62C.js} +34 -20
- package/dist/chunk-SGUVAK66.js +262 -0
- package/dist/{chunk-27GGXX27.js → chunk-ULZLWQBS.js} +128 -112
- package/dist/{chunk-LJHC62LZ.js → chunk-VIPA75ZA.js} +2 -2
- package/dist/chunk-W6VM36YO.js +272 -0
- package/dist/{chunk-NIVF5NDN.js → chunk-WF33LOP4.js} +44 -6
- package/dist/{chunk-STPZQR5B.js → chunk-WVATAIF4.js} +34 -20
- package/dist/{chunk-ISV5IFH3.js → chunk-X743YN5Y.js} +38 -3
- package/dist/{chunk-A2TAKYSG.js → chunk-YOSTWSNC.js} +27 -7
- package/dist/{coordinator-prompt-BH4EHFOO.js → coordinator-prompt-NPT555BO.js} +3 -3
- package/dist/{coordinator-prompt-TY5FHAXC.js → coordinator-prompt-WEPXXLLX.js} +3 -3
- package/dist/{global-workspace-NLLAPQJI.js → global-workspace-2I2T7FL5.js} +3 -3
- package/dist/{global-workspace-5AZEEQRU.js → global-workspace-NSILADOM.js} +3 -3
- package/dist/index.cjs +1137 -213
- package/dist/index.d.cts +87 -13
- package/dist/index.d.ts +87 -13
- package/dist/index.js +94 -19
- package/dist/mcp/run-stdio.cjs +1023 -180
- package/dist/mcp/run-stdio.js +22 -20
- package/dist/{orchestrator-JNSQDRZI.js → orchestrator-CMAVNELS.js} +6 -6
- package/dist/{orchestrator-NCYKEI3E.js → orchestrator-I7GFXLHF.js} +6 -6
- package/dist/{workspaces-RP76JH3J.js → workspaces-BOC6M7BW.js} +3 -3
- package/dist/{workspaces-PEWYWVHZ.js → workspaces-RFGZBUAR.js} +3 -3
- package/dist/{worktree-72TZWUSH.js → worktree-G3ZLM4DC.js} +4 -2
- package/dist/{worktree-ZQEUKSNE.js → worktree-WSUQMMK4.js} +4 -2
- package/package.json +1 -1
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
+
import {
|
|
4
|
+
extractPresentedPlan,
|
|
5
|
+
readPlanFile,
|
|
6
|
+
writePlanFile
|
|
7
|
+
} from "./chunk-JFOPOMK7.js";
|
|
3
8
|
import {
|
|
4
9
|
releaseCaffeinateHoldForThread
|
|
5
10
|
} from "./chunk-YWI3IBP2.js";
|
|
@@ -38,7 +43,7 @@ import {
|
|
|
38
43
|
summarizeTurnStderr,
|
|
39
44
|
toolDescription,
|
|
40
45
|
turnFailChatText
|
|
41
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-WF33LOP4.js";
|
|
42
47
|
import {
|
|
43
48
|
SLACK_REPLY_FORMATTING,
|
|
44
49
|
addWorkspace,
|
|
@@ -61,18 +66,14 @@ import {
|
|
|
61
66
|
stageAbsolutePathsAsAttachments,
|
|
62
67
|
stageBuffersAsAttachments,
|
|
63
68
|
syncWorkspacesFromThreads
|
|
64
|
-
} from "./chunk-
|
|
65
|
-
import {
|
|
66
|
-
extractPresentedPlan,
|
|
67
|
-
readPlanFile,
|
|
68
|
-
writePlanFile
|
|
69
|
-
} from "./chunk-JFOPOMK7.js";
|
|
69
|
+
} from "./chunk-5SMS6QTO.js";
|
|
70
70
|
import {
|
|
71
71
|
addPrStackLayer,
|
|
72
72
|
allocateTeamName,
|
|
73
73
|
allocateTeamSlug,
|
|
74
74
|
canonicalizeRepoPath,
|
|
75
75
|
commitAll,
|
|
76
|
+
connectedPrSelectors,
|
|
76
77
|
createExistingBranchWorktree,
|
|
77
78
|
createOrUpdatePr,
|
|
78
79
|
createThreadWorktree,
|
|
@@ -107,7 +108,6 @@ import {
|
|
|
107
108
|
resolveDiffBaseRef,
|
|
108
109
|
resolveGithubRepoSlug,
|
|
109
110
|
resolvePrSelector,
|
|
110
|
-
resolvePrSelectors,
|
|
111
111
|
resolveRepoRoot,
|
|
112
112
|
takenSlugsFromThread,
|
|
113
113
|
threadDisplayLabel,
|
|
@@ -116,7 +116,7 @@ import {
|
|
|
116
116
|
worktreeDisplayLabelForGroup,
|
|
117
117
|
worktreeNameFromPath,
|
|
118
118
|
worktreeSlugForTicket
|
|
119
|
-
} from "./chunk-
|
|
119
|
+
} from "./chunk-QUW5D62C.js";
|
|
120
120
|
import {
|
|
121
121
|
ATTACHMENTS_DIR,
|
|
122
122
|
DETACHED_JOBS_DIR,
|
|
@@ -170,7 +170,7 @@ import {
|
|
|
170
170
|
updateAdvancedSettings,
|
|
171
171
|
usageOnLimit,
|
|
172
172
|
writeSecureJson
|
|
173
|
-
} from "./chunk-
|
|
173
|
+
} from "./chunk-X743YN5Y.js";
|
|
174
174
|
import {
|
|
175
175
|
writePrivateFile
|
|
176
176
|
} from "./chunk-NSTQ6QKD.js";
|
|
@@ -408,7 +408,7 @@ async function continueSourceThread(threadId, prompt) {
|
|
|
408
408
|
await continueOnReply(threadId, prompt);
|
|
409
409
|
return;
|
|
410
410
|
}
|
|
411
|
-
const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-
|
|
411
|
+
const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-I7GFXLHF.js");
|
|
412
412
|
await getOrchestrator2().send(threadId, prompt);
|
|
413
413
|
} catch {
|
|
414
414
|
}
|
|
@@ -801,9 +801,9 @@ async function spawnAgentTurn(thread, input, onEvent) {
|
|
|
801
801
|
`Cannot spawn ${thread.agent}: thread ${thread.id} has no worktreePath`
|
|
802
802
|
);
|
|
803
803
|
}
|
|
804
|
-
const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-
|
|
804
|
+
const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-2I2T7FL5.js");
|
|
805
805
|
if (isGlobalThread2(thread)) {
|
|
806
|
-
const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-
|
|
806
|
+
const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-NPT555BO.js");
|
|
807
807
|
ensureGlobalCoordinatorCwd2(
|
|
808
808
|
isOrchestratorThread(thread) ? { orchestratorThreadId: thread.id } : void 0
|
|
809
809
|
);
|
|
@@ -1011,6 +1011,33 @@ var FIX_CI_RE = /^Fix CI: .+\.$/;
|
|
|
1011
1011
|
function normalizePrState(state) {
|
|
1012
1012
|
return (state ?? "").trim().toUpperCase();
|
|
1013
1013
|
}
|
|
1014
|
+
function sameLoginList(a, b) {
|
|
1015
|
+
const left = [...a ?? []].map((s) => s.trim().toLowerCase()).filter(Boolean).sort();
|
|
1016
|
+
const right = [...b ?? []].map((s) => s.trim().toLowerCase()).filter(Boolean).sort();
|
|
1017
|
+
return left.length === right.length && left.every((login, i) => login === right[i]);
|
|
1018
|
+
}
|
|
1019
|
+
function threadPrMetaPatch(thread, meta) {
|
|
1020
|
+
const prevState = normalizePrState(thread.prState);
|
|
1021
|
+
const nextState = normalizePrState(meta.state);
|
|
1022
|
+
const patch = {};
|
|
1023
|
+
if (meta.url && meta.url !== thread.prUrl) patch.prUrl = meta.url;
|
|
1024
|
+
if (meta.title && meta.title !== thread.prTitle) patch.prTitle = meta.title;
|
|
1025
|
+
if (nextState && nextState !== prevState) patch.prState = nextState;
|
|
1026
|
+
const nextDraft = Boolean(meta.isDraft) && nextState !== "MERGED" && nextState !== "CLOSED";
|
|
1027
|
+
if (nextDraft !== Boolean(thread.prIsDraft)) patch.prIsDraft = nextDraft;
|
|
1028
|
+
const nextAuthor = meta.authorLogin?.trim() || "";
|
|
1029
|
+
if (nextAuthor && nextAuthor !== (thread.prAuthorLogin ?? "").trim()) {
|
|
1030
|
+
patch.prAuthorLogin = nextAuthor;
|
|
1031
|
+
}
|
|
1032
|
+
const nextReviewers = meta.reviewerLogins ?? [];
|
|
1033
|
+
if (!sameLoginList(nextReviewers, thread.prReviewerLogins)) {
|
|
1034
|
+
patch.prReviewerLogins = nextReviewers;
|
|
1035
|
+
}
|
|
1036
|
+
if (thread.skipAutoArchiveOnMerge && nextState && nextState !== "MERGED" && nextState !== "CLOSED") {
|
|
1037
|
+
patch.skipAutoArchiveOnMerge = false;
|
|
1038
|
+
}
|
|
1039
|
+
return patch;
|
|
1040
|
+
}
|
|
1014
1041
|
function shouldAutoArchiveOnPrMerge(opts) {
|
|
1015
1042
|
if (!opts.autoArchiveEnabled) return false;
|
|
1016
1043
|
if (opts.isGlobal) return false;
|
|
@@ -3602,7 +3629,7 @@ async function createThread(input, _onSetupLine) {
|
|
|
3602
3629
|
});
|
|
3603
3630
|
await requireAgent(resolved.agent);
|
|
3604
3631
|
if (input.cowboy) {
|
|
3605
|
-
const { cowboyModeEnabled } = await import("./app-settings-
|
|
3632
|
+
const { cowboyModeEnabled } = await import("./app-settings-LGHMNHSP.js");
|
|
3606
3633
|
if (!cowboyModeEnabled()) {
|
|
3607
3634
|
throw new Error(
|
|
3608
3635
|
"Cowboy mode is off. Enable it in Settings \u2192 Advanced."
|
|
@@ -3660,7 +3687,7 @@ async function createThread(input, _onSetupLine) {
|
|
|
3660
3687
|
let sourceIsFork = false;
|
|
3661
3688
|
if (!input.cowboy && sourceType === "branch" && (!sourceRef || sourceRef === "HEAD" || sourceRef === "default")) {
|
|
3662
3689
|
if (isAbleTimeConnected() && getIssueSource() === "abletime") {
|
|
3663
|
-
const { ensureAbleTimeTask, issueAttachmentForAbleTimeTask } = await import("./abletime-
|
|
3690
|
+
const { ensureAbleTimeTask, issueAttachmentForAbleTimeTask } = await import("./abletime-S3UHQZVW.js");
|
|
3664
3691
|
const task = await ensureAbleTimeTask({
|
|
3665
3692
|
title: title?.trim() || "Untitled work",
|
|
3666
3693
|
description: input.prompt?.trim() || void 0
|
|
@@ -4072,6 +4099,13 @@ var QUOTA_CONTINUE_PROMPT = (fromAgent, fallback) => [
|
|
|
4072
4099
|
"Proceed with the goal. Leave model Auto unless needed."
|
|
4073
4100
|
].join(" ");
|
|
4074
4101
|
var QUOTA_RESUME_PROMPT = "Session/usage limit window should have reset. Continue this chat from where you left off.";
|
|
4102
|
+
async function isolateQuotaFailover(run2) {
|
|
4103
|
+
try {
|
|
4104
|
+
return await run2();
|
|
4105
|
+
} catch {
|
|
4106
|
+
return true;
|
|
4107
|
+
}
|
|
4108
|
+
}
|
|
4075
4109
|
function createQuotaFailoverChat(from, fallbackAgent, limitText) {
|
|
4076
4110
|
const handoff = buildQuotaHandoffAttachment(from, limitText, fallbackAgent);
|
|
4077
4111
|
const tab = createChatTab({
|
|
@@ -4189,7 +4223,7 @@ async function adoptThread(input) {
|
|
|
4189
4223
|
messages: input.messages ?? []
|
|
4190
4224
|
});
|
|
4191
4225
|
writeThread(thread);
|
|
4192
|
-
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-
|
|
4226
|
+
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-RFGZBUAR.js");
|
|
4193
4227
|
await ensureWorkspace2(repoPath);
|
|
4194
4228
|
const { ensureWorktreeSideboardIgnored: ensureWorktreeSideboardIgnored2 } = await import("./worktree-exclude-N5X5I422.js");
|
|
4195
4229
|
await ensureWorktreeSideboardIgnored2(input.worktreePath);
|
|
@@ -6567,7 +6601,7 @@ function formatScheduledPrompt(name, prompt) {
|
|
|
6567
6601
|
${prompt}`;
|
|
6568
6602
|
}
|
|
6569
6603
|
async function defaultDeps() {
|
|
6570
|
-
const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-
|
|
6604
|
+
const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-I7GFXLHF.js");
|
|
6571
6605
|
const orch = getOrchestrator2();
|
|
6572
6606
|
return {
|
|
6573
6607
|
findThread: (id) => findThreadByRef(id),
|
|
@@ -6681,11 +6715,6 @@ function isPidAlive(pid) {
|
|
|
6681
6715
|
return false;
|
|
6682
6716
|
}
|
|
6683
6717
|
}
|
|
6684
|
-
function sameLoginList(a, b) {
|
|
6685
|
-
const left = [...a ?? []].map((s) => s.trim().toLowerCase()).filter(Boolean).sort();
|
|
6686
|
-
const right = [...b ?? []].map((s) => s.trim().toLowerCase()).filter(Boolean).sort();
|
|
6687
|
-
return left.length === right.length && left.every((login, i) => login === right[i]);
|
|
6688
|
-
}
|
|
6689
6718
|
async function waitForPidExit(pid, timeoutMs) {
|
|
6690
6719
|
const start = Date.now();
|
|
6691
6720
|
while (isPidAlive(pid)) {
|
|
@@ -6842,7 +6871,7 @@ var Orchestrator = class {
|
|
|
6842
6871
|
orphans: orphans.map((o) => ({ path: o.path, repoPath: o.repoPath }))
|
|
6843
6872
|
});
|
|
6844
6873
|
}
|
|
6845
|
-
const { autoCleanupOrphansEnabled } = await import("./app-settings-
|
|
6874
|
+
const { autoCleanupOrphansEnabled } = await import("./app-settings-LGHMNHSP.js");
|
|
6846
6875
|
if (autoCleanupOrphansEnabled() && shouldRunWorktreeCleanup() && orphans.length > 0) {
|
|
6847
6876
|
await cleanupOrphanWorktrees({ repoPaths });
|
|
6848
6877
|
}
|
|
@@ -6964,51 +6993,62 @@ var Orchestrator = class {
|
|
|
6964
6993
|
if (plan.action === "wait_reset" && plan.resumeAt) {
|
|
6965
6994
|
this.haltDrain.add(threadId);
|
|
6966
6995
|
this.scheduleQuotaResume(threadId, plan.resumeAt);
|
|
6967
|
-
|
|
6968
|
-
|
|
6969
|
-
|
|
6970
|
-
|
|
6971
|
-
|
|
6972
|
-
|
|
6973
|
-
|
|
6974
|
-
|
|
6975
|
-
|
|
6976
|
-
|
|
6977
|
-
|
|
6978
|
-
|
|
6979
|
-
|
|
6980
|
-
|
|
6996
|
+
try {
|
|
6997
|
+
setStatus(threadId, "idle", null);
|
|
6998
|
+
appendMessage(threadId, {
|
|
6999
|
+
role: "agent",
|
|
7000
|
+
text: `Sideboard will auto-retry this chat around ${plan.resumeAt.toLocaleString()} when the session limit resets.`,
|
|
7001
|
+
ts: (/* @__PURE__ */ new Date()).toISOString()
|
|
7002
|
+
});
|
|
7003
|
+
this.emit({
|
|
7004
|
+
type: "quota_failover",
|
|
7005
|
+
threadId,
|
|
7006
|
+
action: "wait_reset",
|
|
7007
|
+
message: plan.reason,
|
|
7008
|
+
resumeAt: plan.resumeAt.toISOString()
|
|
7009
|
+
});
|
|
7010
|
+
this.emit({ type: "status_changed", threadId, status: "idle" });
|
|
7011
|
+
} catch {
|
|
7012
|
+
}
|
|
6981
7013
|
return true;
|
|
6982
7014
|
}
|
|
6983
7015
|
if (plan.action === "switch_agent" && plan.fallbackAgent) {
|
|
6984
7016
|
this.haltDrain.add(threadId);
|
|
6985
|
-
|
|
6986
|
-
|
|
6987
|
-
|
|
6988
|
-
|
|
6989
|
-
|
|
7017
|
+
let next;
|
|
7018
|
+
try {
|
|
7019
|
+
next = createQuotaFailoverChat(
|
|
7020
|
+
thread,
|
|
7021
|
+
plan.fallbackAgent,
|
|
7022
|
+
plan.limitText
|
|
7023
|
+
);
|
|
7024
|
+
} catch {
|
|
7025
|
+
return false;
|
|
7026
|
+
}
|
|
6990
7027
|
this.clearQuotaResumeTimer(threadId);
|
|
6991
7028
|
try {
|
|
6992
7029
|
updateThread(threadId, { quotaResumeAt: null });
|
|
6993
7030
|
} catch {
|
|
6994
7031
|
}
|
|
6995
|
-
|
|
6996
|
-
|
|
6997
|
-
|
|
6998
|
-
|
|
6999
|
-
|
|
7000
|
-
|
|
7001
|
-
|
|
7002
|
-
|
|
7003
|
-
|
|
7004
|
-
|
|
7005
|
-
|
|
7006
|
-
|
|
7007
|
-
|
|
7008
|
-
|
|
7009
|
-
|
|
7010
|
-
|
|
7011
|
-
|
|
7032
|
+
try {
|
|
7033
|
+
appendMessage(threadId, {
|
|
7034
|
+
role: "agent",
|
|
7035
|
+
text: `Session limit on ${thread.agent}. Sideboard continued on ${plan.fallbackAgent} (Auto) in [${next.title}](sideboard://thread/${next.id}).`,
|
|
7036
|
+
ts: (/* @__PURE__ */ new Date()).toISOString()
|
|
7037
|
+
});
|
|
7038
|
+
this.emit({
|
|
7039
|
+
type: "quota_failover",
|
|
7040
|
+
threadId,
|
|
7041
|
+
action: "switch_agent",
|
|
7042
|
+
toThreadId: next.id,
|
|
7043
|
+
message: plan.reason
|
|
7044
|
+
});
|
|
7045
|
+
this.emit({
|
|
7046
|
+
type: "status_changed",
|
|
7047
|
+
threadId: next.id,
|
|
7048
|
+
status: next.status
|
|
7049
|
+
});
|
|
7050
|
+
} catch {
|
|
7051
|
+
}
|
|
7012
7052
|
void this.send(
|
|
7013
7053
|
next.id,
|
|
7014
7054
|
QUOTA_CONTINUE_PROMPT(thread.agent, plan.fallbackAgent)
|
|
@@ -7123,7 +7163,7 @@ var Orchestrator = class {
|
|
|
7123
7163
|
}
|
|
7124
7164
|
await setup;
|
|
7125
7165
|
if (skipSetup) return;
|
|
7126
|
-
const { autoRunAfterSetupEnabled } = await import("./app-settings-
|
|
7166
|
+
const { autoRunAfterSetupEnabled } = await import("./app-settings-LGHMNHSP.js");
|
|
7127
7167
|
if (autoRunAfterSetupEnabled()) {
|
|
7128
7168
|
try {
|
|
7129
7169
|
await this.startDev(threadId);
|
|
@@ -7447,7 +7487,7 @@ var Orchestrator = class {
|
|
|
7447
7487
|
}
|
|
7448
7488
|
const isBrightsy = fresh.agent === "brightsy";
|
|
7449
7489
|
const isOrchestration = isOrchestratorThread(fresh);
|
|
7450
|
-
const { autoRenameBranchEnabled, getGithubGitAuthMode, gitBranchPrefixSetting } = await import("./app-settings-
|
|
7490
|
+
const { autoRenameBranchEnabled, getGithubGitAuthMode, gitBranchPrefixSetting } = await import("./app-settings-LGHMNHSP.js");
|
|
7451
7491
|
const gitAuthMode = getGithubGitAuthMode();
|
|
7452
7492
|
const worktreeDirective = isBrightsy || isOrchestration ? null : formatWorktreeDirective(fresh, {
|
|
7453
7493
|
githubSlug: await resolveGithubRepoSlug(fresh.worktreePath).catch(
|
|
@@ -7739,9 +7779,8 @@ var Orchestrator = class {
|
|
|
7739
7779
|
this.maybeEnqueueJobContinue(threadId, chatText, parts);
|
|
7740
7780
|
} else {
|
|
7741
7781
|
const blob = [chatText, detail].filter(Boolean).join("\n");
|
|
7742
|
-
const failedOver = await
|
|
7743
|
-
threadId,
|
|
7744
|
-
blob
|
|
7782
|
+
const failedOver = await isolateQuotaFailover(
|
|
7783
|
+
() => this.maybeHandleOrchestrationQuotaFailover(threadId, blob)
|
|
7745
7784
|
);
|
|
7746
7785
|
this.maybeEnqueueCrashContinue(threadId, {
|
|
7747
7786
|
detail: detail || failDetail,
|
|
@@ -7775,9 +7814,8 @@ var Orchestrator = class {
|
|
|
7775
7814
|
this.emit({ type: "status_changed", threadId, status: "error" });
|
|
7776
7815
|
}
|
|
7777
7816
|
this.emit({ type: "turn_finished", threadId, exitCode: 1 });
|
|
7778
|
-
const failedOver = await
|
|
7779
|
-
threadId,
|
|
7780
|
-
message
|
|
7817
|
+
const failedOver = await isolateQuotaFailover(
|
|
7818
|
+
() => this.maybeHandleOrchestrationQuotaFailover(threadId, message)
|
|
7781
7819
|
);
|
|
7782
7820
|
this.maybeEnqueueCrashContinue(threadId, {
|
|
7783
7821
|
detail: message,
|
|
@@ -8387,12 +8425,18 @@ var Orchestrator = class {
|
|
|
8387
8425
|
/** Resolve PR selectors and optionally persist `prUrl` when found. */
|
|
8388
8426
|
async withPrSelector(threadRef) {
|
|
8389
8427
|
const thread = this.requireThread(threadRef);
|
|
8390
|
-
const selectors = resolvePrSelectors(thread);
|
|
8391
8428
|
const cwd = thread.worktreePath;
|
|
8392
8429
|
if (!cwd?.trim()) {
|
|
8393
8430
|
throw new Error(`Thread ${threadRef} has no worktreePath`);
|
|
8394
8431
|
}
|
|
8395
|
-
|
|
8432
|
+
let headUrl = null;
|
|
8433
|
+
try {
|
|
8434
|
+
const head = await getPrForHeadBranch(cwd, thread.branchName);
|
|
8435
|
+
headUrl = head?.url?.trim() || null;
|
|
8436
|
+
} catch {
|
|
8437
|
+
headUrl = null;
|
|
8438
|
+
}
|
|
8439
|
+
return { thread, selectors: connectedPrSelectors(thread, headUrl), cwd };
|
|
8396
8440
|
}
|
|
8397
8441
|
async getPrChecks(threadRef) {
|
|
8398
8442
|
const { selectors, cwd } = await this.withPrSelector(threadRef);
|
|
@@ -8420,31 +8464,18 @@ var Orchestrator = class {
|
|
|
8420
8464
|
async persistPrMetaAndMaybeArchive(thread, meta) {
|
|
8421
8465
|
const prevState = normalizePrState(thread.prState);
|
|
8422
8466
|
const nextState = normalizePrState(meta.state);
|
|
8423
|
-
const
|
|
8424
|
-
|
|
8425
|
-
|
|
8426
|
-
|
|
8427
|
-
|
|
8428
|
-
|
|
8429
|
-
const nextAuthor = meta.authorLogin?.trim() || "";
|
|
8430
|
-
if (nextAuthor && nextAuthor !== (thread.prAuthorLogin ?? "").trim()) {
|
|
8431
|
-
patch.prAuthorLogin = nextAuthor;
|
|
8432
|
-
}
|
|
8433
|
-
const nextReviewers = meta.reviewerLogins ?? [];
|
|
8434
|
-
if (!sameLoginList(nextReviewers, thread.prReviewerLogins)) {
|
|
8435
|
-
patch.prReviewerLogins = nextReviewers;
|
|
8436
|
-
}
|
|
8437
|
-
if (thread.skipAutoArchiveOnMerge && nextState && nextState !== "MERGED" && nextState !== "CLOSED") {
|
|
8438
|
-
patch.skipAutoArchiveOnMerge = false;
|
|
8467
|
+
const siblings = threadsSharingWorktree(thread.worktreePath);
|
|
8468
|
+
const targets = siblings.length > 0 ? siblings : [thread];
|
|
8469
|
+
for (const t of targets) {
|
|
8470
|
+
const patch = threadPrMetaPatch(t, meta);
|
|
8471
|
+
if (Object.keys(patch).length === 0) continue;
|
|
8472
|
+
updateThread(t.id, patch);
|
|
8439
8473
|
}
|
|
8440
|
-
|
|
8441
|
-
|
|
8442
|
-
|
|
8443
|
-
if (!latest2.userSetTitle && meta.title && latest2.title !== meta.title) {
|
|
8444
|
-
updateThread(thread.id, { title: meta.title });
|
|
8445
|
-
}
|
|
8474
|
+
const titled = this.requireThread(thread.id);
|
|
8475
|
+
if (!titled.userSetTitle && meta.title && titled.title !== meta.title) {
|
|
8476
|
+
updateThread(thread.id, { title: meta.title });
|
|
8446
8477
|
}
|
|
8447
|
-
const { autoArchiveOnMergeEnabled } = await import("./app-settings-
|
|
8478
|
+
const { autoArchiveOnMergeEnabled } = await import("./app-settings-LGHMNHSP.js");
|
|
8448
8479
|
const latest = this.requireThread(thread.id);
|
|
8449
8480
|
if (!shouldAutoArchiveOnPrMerge({
|
|
8450
8481
|
previousPrState: prevState || null,
|
|
@@ -8456,22 +8487,7 @@ var Orchestrator = class {
|
|
|
8456
8487
|
})) {
|
|
8457
8488
|
return;
|
|
8458
8489
|
}
|
|
8459
|
-
const
|
|
8460
|
-
for (const t of siblings) {
|
|
8461
|
-
const sibPatch = { prState: "MERGED", prIsDraft: false };
|
|
8462
|
-
if (meta.url && meta.url !== t.prUrl) sibPatch.prUrl = meta.url;
|
|
8463
|
-
if (meta.title && meta.title !== t.prTitle) sibPatch.prTitle = meta.title;
|
|
8464
|
-
const sibAuthor = meta.authorLogin?.trim() || "";
|
|
8465
|
-
if (sibAuthor && sibAuthor !== (t.prAuthorLogin ?? "").trim()) {
|
|
8466
|
-
sibPatch.prAuthorLogin = sibAuthor;
|
|
8467
|
-
}
|
|
8468
|
-
const sibReviewers = meta.reviewerLogins ?? [];
|
|
8469
|
-
if (!sameLoginList(sibReviewers, t.prReviewerLogins)) {
|
|
8470
|
-
sibPatch.prReviewerLogins = sibReviewers;
|
|
8471
|
-
}
|
|
8472
|
-
if (Object.keys(sibPatch).length > 0) updateThread(t.id, sibPatch);
|
|
8473
|
-
}
|
|
8474
|
-
for (const t of siblings) {
|
|
8490
|
+
for (const t of threadsSharingWorktree(latest.worktreePath)) {
|
|
8475
8491
|
if (this.requireThread(t.id).status === "archived") continue;
|
|
8476
8492
|
await this.archive(t.id);
|
|
8477
8493
|
}
|
|
@@ -8736,7 +8752,7 @@ var Orchestrator = class {
|
|
|
8736
8752
|
this.emit({ type: "status_changed", threadId: archived.id, status: "archived" });
|
|
8737
8753
|
if (thread.repoPath && !isGlobalRepoPath(thread.repoPath)) {
|
|
8738
8754
|
try {
|
|
8739
|
-
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-
|
|
8755
|
+
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-RFGZBUAR.js");
|
|
8740
8756
|
await ensureWorkspace2(thread.repoPath);
|
|
8741
8757
|
} catch {
|
|
8742
8758
|
}
|
|
@@ -8763,7 +8779,7 @@ var Orchestrator = class {
|
|
|
8763
8779
|
await runArchiveScript(thread.repoPath, thread.worktreePath);
|
|
8764
8780
|
} catch {
|
|
8765
8781
|
}
|
|
8766
|
-
const { deleteBranchOnPurgeEnabled } = await import("./app-settings-
|
|
8782
|
+
const { deleteBranchOnPurgeEnabled } = await import("./app-settings-LGHMNHSP.js");
|
|
8767
8783
|
const deleteBranch = opts?.deleteBranch ?? deleteBranchOnPurgeEnabled();
|
|
8768
8784
|
await removeWorktree(thread.repoPath, thread.worktreePath, {
|
|
8769
8785
|
deleteBranch: deleteBranch ? thread.branchName : void 0
|
|
@@ -8790,7 +8806,7 @@ var Orchestrator = class {
|
|
|
8790
8806
|
`Cowboy checkout missing: ${thread.worktreePath}. Re-add the project folder, then restore.`
|
|
8791
8807
|
);
|
|
8792
8808
|
}
|
|
8793
|
-
const { createThreadWorktree: createThreadWorktree2 } = await import("./worktree-
|
|
8809
|
+
const { createThreadWorktree: createThreadWorktree2 } = await import("./worktree-WSUQMMK4.js");
|
|
8794
8810
|
const slug = thread.worktreePath.split("/").pop();
|
|
8795
8811
|
const dest = thread.worktreePath;
|
|
8796
8812
|
await withRepoGitLock(thread.repoPath, async () => {
|
|
@@ -8900,7 +8916,7 @@ async function startOrchestration(opts) {
|
|
|
8900
8916
|
sourceRef: "default",
|
|
8901
8917
|
...createOpts
|
|
8902
8918
|
}).catch(async () => {
|
|
8903
|
-
const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-
|
|
8919
|
+
const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-WSUQMMK4.js");
|
|
8904
8920
|
const repo = await resolveRepoRoot2(repoPath);
|
|
8905
8921
|
const def = await resolveDefaultBranch2(repo);
|
|
8906
8922
|
return orch.createThread({
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
resolveRepoRoot,
|
|
6
6
|
takenSlugsFromThread,
|
|
7
7
|
teamSlugFromName
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-WVATAIF4.js";
|
|
9
9
|
import {
|
|
10
10
|
ATTACHMENTS_DIR,
|
|
11
11
|
attachmentsGitignoreBody
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
resolveThreadDefaults,
|
|
23
23
|
resolveViewerProfile,
|
|
24
24
|
resolveViewerProfileForRepo
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-QFBBUFD4.js";
|
|
26
26
|
import {
|
|
27
27
|
createEmptyThread,
|
|
28
28
|
listThreads,
|