@sideboard-ai/core 0.1.130 → 0.1.133
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-DDTV7WO3.js +36 -0
- package/dist/abletime-VTP4JR63.js +37 -0
- package/dist/agents/cursor-runner.js +1 -1
- package/dist/{agents-7BUQY2WX.js → agents-NHS6P25H.js} +8 -6
- package/dist/{agents-X2I3RNCY.js → agents-SOU5GPWI.js} +9 -7
- package/dist/{app-settings-6RPALX4J.js → app-settings-U5RZKUXG.js} +11 -1
- package/dist/{app-settings-E7NEQY7D.js → app-settings-YQ7YX2CC.js} +11 -1
- package/dist/chunk-2XXAAIN3.js +463 -0
- package/dist/{chunk-VE22NWBD.js → chunk-3UVVWNHF.js} +2 -2
- package/dist/{chunk-NV73AO7Q.js → chunk-4YAVXWFR.js} +21 -9
- package/dist/{chunk-RSFCB23A.js → chunk-6CRKPD4C.js} +4 -3
- package/dist/chunk-6GN5WPYZ.js +31 -0
- package/dist/{chunk-ZMUOPTKZ.js → chunk-AK7SWE2U.js} +55 -12
- package/dist/chunk-AT346U23.js +468 -0
- package/dist/{chunk-YMRT2DU6.js → chunk-ED4UPEJX.js} +25 -50
- package/dist/chunk-ELBYOGVA.js +32 -0
- package/dist/{chunk-IUJOI7KK.js → chunk-FSCQXMGI.js} +35 -4
- package/dist/{chunk-HUYEU4GS.js → chunk-GJBHOJCZ.js} +83 -2
- package/dist/{chunk-ZND6XV6J.js → chunk-GKKHXZCT.js} +83 -2
- package/dist/{chunk-HZPO3SSZ.js → chunk-IM36S4HZ.js} +4 -3
- package/dist/{chunk-EKIDHL2T.js → chunk-KBWND62T.js} +32 -55
- package/dist/{chunk-HULESWLI.js → chunk-LTP7GHIF.js} +3 -3
- package/dist/chunk-M267JPEA.js +103 -0
- package/dist/{chunk-HRSBZIXS.js → chunk-Q6XQXCOM.js} +1 -1
- package/dist/chunk-S42XV45P.js +104 -0
- package/dist/{chunk-YALVX3UE.js → chunk-TG7YU2KG.js} +157 -40
- package/dist/{chunk-FMBLOOAO.js → chunk-VSON7EJ6.js} +155 -39
- package/dist/{chunk-UDQI3N47.js → chunk-WEU5M7BW.js} +1 -1
- package/dist/{chunk-SYLTXDRF.js → chunk-Y645NFYN.js} +2 -2
- package/dist/{chunk-MNL4FSKY.js → chunk-YEIH7P7D.js} +3 -3
- package/dist/{connected-teams-ZCOU6KCD.js → connected-teams-4A2AXDNN.js} +3 -1
- package/dist/{connected-teams-O6D4PM7A.js → connected-teams-IJUJQ7R6.js} +3 -1
- package/dist/{coordinator-prompt-SPJSGAQS.js → coordinator-prompt-DXHEDRRN.js} +3 -3
- package/dist/{coordinator-prompt-MEEUOEF2.js → coordinator-prompt-XF7LVOUN.js} +3 -3
- package/dist/{global-workspace-KNESLWKG.js → global-workspace-2LO5ATOH.js} +4 -4
- package/dist/{global-workspace-BMWP7YZC.js → global-workspace-MLQNULOU.js} +4 -4
- package/dist/index.cjs +1410 -425
- package/dist/index.d.cts +224 -16
- package/dist/index.d.ts +224 -16
- package/dist/index.js +461 -292
- package/dist/mcp/run-stdio.cjs +1261 -342
- package/dist/mcp/run-stdio.js +340 -209
- package/dist/oauth-A7XXI2TM.js +11 -0
- package/dist/oauth-YJBAURIJ.js +13 -0
- package/dist/{orchestrator-3ZSFTG72.js → orchestrator-KR5RA5B7.js} +10 -8
- package/dist/{orchestrator-G6DU3AF3.js → orchestrator-P2SYHVLS.js} +11 -9
- package/dist/{workspaces-O4QZOASB.js → workspaces-ARWPZG6F.js} +5 -5
- package/dist/{workspaces-HSYRYJYV.js → workspaces-MINB764G.js} +5 -5
- package/dist/{worktree-ERHC7Q4F.js → worktree-EBZMUUAL.js} +2 -2
- package/dist/{worktree-JVGSLSLJ.js → worktree-S7MKMYAT.js} +2 -2
- package/package.json +1 -1
|
@@ -18,13 +18,13 @@ import {
|
|
|
18
18
|
stripBrightsyNdjsonNoise,
|
|
19
19
|
sumUsageList,
|
|
20
20
|
toolDescription
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-4YAVXWFR.js";
|
|
22
22
|
import {
|
|
23
23
|
addWorkspace,
|
|
24
24
|
ensureWorkspace,
|
|
25
25
|
removeWorkspace,
|
|
26
26
|
syncWorkspacesFromThreads
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-3UVVWNHF.js";
|
|
28
28
|
import {
|
|
29
29
|
assertOrchestratorCapableAgent,
|
|
30
30
|
coerceOrchestratorAgent,
|
|
@@ -37,14 +37,14 @@ import {
|
|
|
37
37
|
isOrchestratorThread,
|
|
38
38
|
isSlackCoordinatorThread,
|
|
39
39
|
orchestratorSessionPoisonedByBuiltins
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-LTP7GHIF.js";
|
|
41
41
|
import {
|
|
42
42
|
SLACK_REPLY_FORMATTING,
|
|
43
43
|
coordinatorSystemPrompt,
|
|
44
44
|
coordinatorTurnReminder,
|
|
45
45
|
enrichWorkspacesWithGithub,
|
|
46
46
|
ensureGlobalCoordinatorCwd
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-IM36S4HZ.js";
|
|
48
48
|
import {
|
|
49
49
|
extractPresentedPlan,
|
|
50
50
|
readPlanFile,
|
|
@@ -56,15 +56,17 @@ import {
|
|
|
56
56
|
import {
|
|
57
57
|
applyAgentRunnerHeapEnv,
|
|
58
58
|
fallbackTurnFailDetail,
|
|
59
|
+
formatAgentErrorContinuePrompt,
|
|
59
60
|
formatTurnExitError,
|
|
60
61
|
looksLikeAgentFailureMessage,
|
|
61
62
|
looksLikeInvalidAgentSession,
|
|
62
63
|
looksLikeV8Oom,
|
|
63
64
|
pushTurnStderr,
|
|
65
|
+
shouldFeedErrorBackToAgent,
|
|
64
66
|
shouldRetryFailedAgentTurn,
|
|
65
67
|
summarizeTurnStderr,
|
|
66
68
|
turnFailChatText
|
|
67
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-FSCQXMGI.js";
|
|
68
70
|
import {
|
|
69
71
|
releaseCaffeinateHoldForThread
|
|
70
72
|
} from "./chunk-DCOZABNT.js";
|
|
@@ -112,7 +114,7 @@ import {
|
|
|
112
114
|
withRepoGitLock,
|
|
113
115
|
worktreeDisplayLabelForGroup,
|
|
114
116
|
worktreeNameFromPath
|
|
115
|
-
} from "./chunk-
|
|
117
|
+
} from "./chunk-WEU5M7BW.js";
|
|
116
118
|
import {
|
|
117
119
|
ATTACHMENTS_DIR,
|
|
118
120
|
LEGACY_ATTACHMENTS_DIR,
|
|
@@ -120,6 +122,8 @@ import {
|
|
|
120
122
|
} from "./chunk-FKOIHGKV.js";
|
|
121
123
|
import {
|
|
122
124
|
childEnvWithAppSettings,
|
|
125
|
+
getIssueSource,
|
|
126
|
+
isAbleTimeConnected,
|
|
123
127
|
isSecureFileEncrypted,
|
|
124
128
|
loadAppSettings,
|
|
125
129
|
orchestrationQuotaFallbackAgent,
|
|
@@ -130,7 +134,7 @@ import {
|
|
|
130
134
|
resolveVaultKey,
|
|
131
135
|
updateAdvancedSettings,
|
|
132
136
|
writeSecureJson
|
|
133
|
-
} from "./chunk-
|
|
137
|
+
} from "./chunk-GJBHOJCZ.js";
|
|
134
138
|
import {
|
|
135
139
|
stripNestedElectronEnv
|
|
136
140
|
} from "./chunk-4TR3HZFT.js";
|
|
@@ -441,7 +445,7 @@ async function continueSourceThread(threadId, prompt) {
|
|
|
441
445
|
await continueOnReply(threadId, prompt);
|
|
442
446
|
return;
|
|
443
447
|
}
|
|
444
|
-
const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-
|
|
448
|
+
const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-P2SYHVLS.js");
|
|
445
449
|
await getOrchestrator2().send(threadId, prompt);
|
|
446
450
|
} catch {
|
|
447
451
|
}
|
|
@@ -721,9 +725,9 @@ async function spawnAgentTurn(thread, input, onEvent) {
|
|
|
721
725
|
`Cannot spawn ${thread.agent}: thread ${thread.id} has no worktreePath`
|
|
722
726
|
);
|
|
723
727
|
}
|
|
724
|
-
const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-
|
|
728
|
+
const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-MLQNULOU.js");
|
|
725
729
|
if (isGlobalThread2(thread)) {
|
|
726
|
-
const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-
|
|
730
|
+
const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-XF7LVOUN.js");
|
|
727
731
|
ensureGlobalCoordinatorCwd2(
|
|
728
732
|
isOrchestratorThread(thread) ? { orchestratorThreadId: thread.id } : void 0
|
|
729
733
|
);
|
|
@@ -2320,7 +2324,49 @@ function isMergedPrState(prUrl, prState) {
|
|
|
2320
2324
|
if (!prUrl?.trim()) return false;
|
|
2321
2325
|
return (prState ?? "").trim().toUpperCase() === "MERGED";
|
|
2322
2326
|
}
|
|
2323
|
-
|
|
2327
|
+
var DEFAULT_WORKTREE_SORT = "created";
|
|
2328
|
+
function groupCreatedAt(group) {
|
|
2329
|
+
let min = group[0]?.createdAt ?? "";
|
|
2330
|
+
for (const t of group) {
|
|
2331
|
+
if (t.createdAt && t.createdAt < min) min = t.createdAt;
|
|
2332
|
+
}
|
|
2333
|
+
return min;
|
|
2334
|
+
}
|
|
2335
|
+
function groupUpdatedAt(group) {
|
|
2336
|
+
let max = group[0]?.updatedAt ?? "";
|
|
2337
|
+
for (const t of group) {
|
|
2338
|
+
if (t.updatedAt && t.updatedAt > max) max = t.updatedAt;
|
|
2339
|
+
}
|
|
2340
|
+
return max;
|
|
2341
|
+
}
|
|
2342
|
+
function sortThreadsInWorktree(list) {
|
|
2343
|
+
return [...list].sort((a, b) => {
|
|
2344
|
+
const created = a.createdAt.localeCompare(b.createdAt);
|
|
2345
|
+
if (created !== 0) return created;
|
|
2346
|
+
return a.id.localeCompare(b.id);
|
|
2347
|
+
});
|
|
2348
|
+
}
|
|
2349
|
+
function compareWorktreeGroups(a, b, mode, labelOf) {
|
|
2350
|
+
if (mode === "name") {
|
|
2351
|
+
const named = (labelOf?.(a) ?? a[0]?.id ?? "").localeCompare(
|
|
2352
|
+
labelOf?.(b) ?? b[0]?.id ?? "",
|
|
2353
|
+
void 0,
|
|
2354
|
+
{ sensitivity: "base" }
|
|
2355
|
+
);
|
|
2356
|
+
if (named !== 0) return named;
|
|
2357
|
+
} else if (mode === "activity") {
|
|
2358
|
+
const activity = groupUpdatedAt(b).localeCompare(groupUpdatedAt(a));
|
|
2359
|
+
if (activity !== 0) return activity;
|
|
2360
|
+
} else {
|
|
2361
|
+
const created = groupCreatedAt(b).localeCompare(groupCreatedAt(a));
|
|
2362
|
+
if (created !== 0) return created;
|
|
2363
|
+
}
|
|
2364
|
+
return (a[0]?.id ?? "").localeCompare(b[0]?.id ?? "");
|
|
2365
|
+
}
|
|
2366
|
+
function defaultWorktreeGroupLabel(group) {
|
|
2367
|
+
return worktreeDisplayLabelForGroup(group);
|
|
2368
|
+
}
|
|
2369
|
+
function groupHomeBoardWorktrees(threads, sort = DEFAULT_WORKTREE_SORT, labelOf = defaultWorktreeGroupLabel) {
|
|
2324
2370
|
const map = /* @__PURE__ */ new Map();
|
|
2325
2371
|
for (const t of threads) {
|
|
2326
2372
|
const key = normalizeWorktreePath(t.worktreePath);
|
|
@@ -2328,7 +2374,7 @@ function groupHomeBoardWorktrees(threads) {
|
|
|
2328
2374
|
list.push(t);
|
|
2329
2375
|
map.set(key, list);
|
|
2330
2376
|
}
|
|
2331
|
-
return [...map.values()].map((list) => list.sort((a, b) =>
|
|
2377
|
+
return [...map.values()].map((list) => sortThreadsInWorktree(list)).sort((a, b) => compareWorktreeGroups(a, b, sort, labelOf));
|
|
2332
2378
|
}
|
|
2333
2379
|
function classifyWorktreeColumn(group) {
|
|
2334
2380
|
if (group.some((t) => isMergedPrState(t.prUrl, t.prState))) return "done";
|
|
@@ -2381,6 +2427,9 @@ function issueNeedsWorkspacePick(provider, workspaceCount) {
|
|
|
2381
2427
|
if (workspaceCount <= 1) return false;
|
|
2382
2428
|
return provider !== "github";
|
|
2383
2429
|
}
|
|
2430
|
+
function isAccountWideIssueSource(source) {
|
|
2431
|
+
return source === "linear" || source === "abletime";
|
|
2432
|
+
}
|
|
2384
2433
|
function boardPrKey(pr) {
|
|
2385
2434
|
return pr.url?.trim() || `${pr.repoPath}::${pr.number}`;
|
|
2386
2435
|
}
|
|
@@ -2636,8 +2685,7 @@ function assembleHomeBoard(input) {
|
|
|
2636
2685
|
const kind = input.kind ?? "all";
|
|
2637
2686
|
const limit = Math.max(1, input.limit ?? BOARD_PAGE_SIZE);
|
|
2638
2687
|
const wsName = input.workspaceName ?? (() => "");
|
|
2639
|
-
const
|
|
2640
|
-
const live = input.threads.filter((t) => t.status !== "archived" && isHomeBoardThread(t)).sort(byUpdated);
|
|
2688
|
+
const live = input.threads.filter((t) => t.status !== "archived" && isHomeBoardThread(t));
|
|
2641
2689
|
const columns = emptyColumns();
|
|
2642
2690
|
const hidden = emptyHidden();
|
|
2643
2691
|
const totals = {
|
|
@@ -2724,7 +2772,7 @@ async function createThread(input, _onSetupLine) {
|
|
|
2724
2772
|
});
|
|
2725
2773
|
await requireAgent(resolved.agent);
|
|
2726
2774
|
if (input.cowboy) {
|
|
2727
|
-
const { cowboyModeEnabled } = await import("./app-settings-
|
|
2775
|
+
const { cowboyModeEnabled } = await import("./app-settings-U5RZKUXG.js");
|
|
2728
2776
|
if (!cowboyModeEnabled()) {
|
|
2729
2777
|
throw new Error(
|
|
2730
2778
|
"Cowboy mode is off. Enable it in Settings \u2192 Advanced."
|
|
@@ -2772,11 +2820,29 @@ async function createThread(input, _onSetupLine) {
|
|
|
2772
2820
|
await ensureWorkspace(repoPath);
|
|
2773
2821
|
return readThread(thread2.id) ?? thread2;
|
|
2774
2822
|
}
|
|
2823
|
+
let sourceType = input.sourceType;
|
|
2775
2824
|
let sourceRef = input.sourceRef;
|
|
2825
|
+
let persistedSourceRef = input.sourceRef;
|
|
2826
|
+
let attachments = input.attachments ?? [];
|
|
2827
|
+
let title = input.title;
|
|
2776
2828
|
let sourceIsFork = false;
|
|
2829
|
+
if (!input.cowboy && sourceType === "branch" && (!sourceRef || sourceRef === "HEAD" || sourceRef === "default")) {
|
|
2830
|
+
if (isAbleTimeConnected() && getIssueSource() === "abletime") {
|
|
2831
|
+
const { ensureAbleTimeTask, issueAttachmentForAbleTimeTask } = await import("./abletime-DDTV7WO3.js");
|
|
2832
|
+
const task = await ensureAbleTimeTask({
|
|
2833
|
+
title: title?.trim() || "Untitled work",
|
|
2834
|
+
description: input.prompt?.trim() || void 0
|
|
2835
|
+
});
|
|
2836
|
+
sourceType = "ticket";
|
|
2837
|
+
sourceRef = task.identifier;
|
|
2838
|
+
persistedSourceRef = task.identifier;
|
|
2839
|
+
title = title?.trim() || task.title;
|
|
2840
|
+
attachments = [...attachments, issueAttachmentForAbleTimeTask(task)];
|
|
2841
|
+
}
|
|
2842
|
+
}
|
|
2777
2843
|
let prUrl = null;
|
|
2778
2844
|
let prTitle = null;
|
|
2779
|
-
if (
|
|
2845
|
+
if (sourceType === "pr") {
|
|
2780
2846
|
const num = Number(input.sourceRef.replace(/^#/, ""));
|
|
2781
2847
|
if (!Number.isFinite(num)) throw new Error(`Invalid PR number: ${input.sourceRef}`);
|
|
2782
2848
|
const pr = await getPr(repoPath, num);
|
|
@@ -2786,9 +2852,9 @@ async function createThread(input, _onSetupLine) {
|
|
|
2786
2852
|
const localFetchBranch = `sideboard-pr-${pr.number}`;
|
|
2787
2853
|
await fetchPrHead(repoPath, pr.number, localFetchBranch);
|
|
2788
2854
|
sourceRef = localFetchBranch;
|
|
2789
|
-
} else if (
|
|
2855
|
+
} else if (sourceType === "ticket") {
|
|
2790
2856
|
sourceRef = await resolveDefaultBranch(repoPath);
|
|
2791
|
-
} else if (
|
|
2857
|
+
} else if (sourceType === "branch") {
|
|
2792
2858
|
if (!sourceRef || sourceRef === "HEAD" || sourceRef === "default") {
|
|
2793
2859
|
sourceRef = await resolveDefaultBranch(repoPath);
|
|
2794
2860
|
} else {
|
|
@@ -2798,7 +2864,7 @@ async function createThread(input, _onSetupLine) {
|
|
|
2798
2864
|
prTitle = existing.title;
|
|
2799
2865
|
}
|
|
2800
2866
|
}
|
|
2801
|
-
} else if (
|
|
2867
|
+
} else if (sourceType === "adopt") {
|
|
2802
2868
|
throw new Error("Use adoptThread() for adopt sources");
|
|
2803
2869
|
}
|
|
2804
2870
|
const team = allocateTeamSlug(repoPath);
|
|
@@ -2808,12 +2874,12 @@ async function createThread(input, _onSetupLine) {
|
|
|
2808
2874
|
slug: team.slug
|
|
2809
2875
|
});
|
|
2810
2876
|
copyConfiguredFiles(repoPath, worktreePath);
|
|
2811
|
-
const explicitTitle =
|
|
2877
|
+
const explicitTitle = title?.trim();
|
|
2812
2878
|
const thread = createEmptyThread({
|
|
2813
2879
|
title: explicitTitle || team.name,
|
|
2814
2880
|
userSetTitle: Boolean(explicitTitle),
|
|
2815
|
-
sourceType
|
|
2816
|
-
sourceRef:
|
|
2881
|
+
sourceType,
|
|
2882
|
+
sourceRef: persistedSourceRef === "default" ? sourceRef : persistedSourceRef,
|
|
2817
2883
|
branchName,
|
|
2818
2884
|
worktreePath,
|
|
2819
2885
|
repoPath,
|
|
@@ -2823,7 +2889,7 @@ async function createThread(input, _onSetupLine) {
|
|
|
2823
2889
|
effort: resolved.effort,
|
|
2824
2890
|
fast: resolved.fast,
|
|
2825
2891
|
planMode: Boolean(input.planMode),
|
|
2826
|
-
attachments
|
|
2892
|
+
attachments,
|
|
2827
2893
|
sourceIsFork,
|
|
2828
2894
|
parentThreadId: input.parentThreadId ?? null,
|
|
2829
2895
|
status: "idle",
|
|
@@ -2835,7 +2901,7 @@ async function createThread(input, _onSetupLine) {
|
|
|
2835
2901
|
return readThread(thread.id) ?? thread;
|
|
2836
2902
|
}
|
|
2837
2903
|
async function listLinearIssues(agent, repoPath) {
|
|
2838
|
-
const { getAdapter: getAdapter2 } = await import("./agents-
|
|
2904
|
+
const { getAdapter: getAdapter2 } = await import("./agents-SOU5GPWI.js");
|
|
2839
2905
|
await requireAgent(agent, { requireLinear: true });
|
|
2840
2906
|
const adapter = getAdapter2(agent);
|
|
2841
2907
|
if (!adapter.listLinearIssues) {
|
|
@@ -3232,7 +3298,7 @@ async function adoptThread(input) {
|
|
|
3232
3298
|
messages: input.messages ?? []
|
|
3233
3299
|
});
|
|
3234
3300
|
writeThread(thread);
|
|
3235
|
-
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-
|
|
3301
|
+
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-ARWPZG6F.js");
|
|
3236
3302
|
await ensureWorkspace2(repoPath);
|
|
3237
3303
|
return thread;
|
|
3238
3304
|
}
|
|
@@ -5506,7 +5572,7 @@ function formatScheduledPrompt(name, prompt) {
|
|
|
5506
5572
|
${prompt}`;
|
|
5507
5573
|
}
|
|
5508
5574
|
async function defaultDeps() {
|
|
5509
|
-
const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-
|
|
5575
|
+
const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-P2SYHVLS.js");
|
|
5510
5576
|
const orch = getOrchestrator2();
|
|
5511
5577
|
return {
|
|
5512
5578
|
findThread: (id) => findThreadByRef(id),
|
|
@@ -5657,6 +5723,11 @@ var Orchestrator = class {
|
|
|
5657
5723
|
turnBaselines = /* @__PURE__ */ new Map();
|
|
5658
5724
|
/** Timers for orchestration session-quota auto-resume. */
|
|
5659
5725
|
quotaResumeTimers = /* @__PURE__ */ new Map();
|
|
5726
|
+
/**
|
|
5727
|
+
* Threads that already got a crash-continue turn. Cleared on a successful
|
|
5728
|
+
* finish or a user send so a later crash can recover again.
|
|
5729
|
+
*/
|
|
5730
|
+
crashContinued = /* @__PURE__ */ new Set();
|
|
5660
5731
|
maxConcurrent;
|
|
5661
5732
|
runningCount = 0;
|
|
5662
5733
|
constructor(opts) {
|
|
@@ -5726,7 +5797,7 @@ var Orchestrator = class {
|
|
|
5726
5797
|
orphans: orphans.map((o) => ({ path: o.path, repoPath: o.repoPath }))
|
|
5727
5798
|
});
|
|
5728
5799
|
}
|
|
5729
|
-
const { autoCleanupOrphansEnabled } = await import("./app-settings-
|
|
5800
|
+
const { autoCleanupOrphansEnabled } = await import("./app-settings-U5RZKUXG.js");
|
|
5730
5801
|
if (autoCleanupOrphansEnabled() && shouldRunWorktreeCleanup() && orphans.length > 0) {
|
|
5731
5802
|
await cleanupOrphanWorktrees({ repoPaths });
|
|
5732
5803
|
}
|
|
@@ -5870,6 +5941,29 @@ var Orchestrator = class {
|
|
|
5870
5941
|
);
|
|
5871
5942
|
}
|
|
5872
5943
|
}
|
|
5944
|
+
/**
|
|
5945
|
+
* Cursor-style recovery: after a runner crash, feed the error back as the
|
|
5946
|
+
* next prompt so the same agent can continue instead of sitting on lastError.
|
|
5947
|
+
*/
|
|
5948
|
+
maybeEnqueueCrashContinue(threadId, opts) {
|
|
5949
|
+
if (this.crashContinued.has(threadId)) return;
|
|
5950
|
+
if (this.haltDrain.has(threadId)) return;
|
|
5951
|
+
if (!shouldFeedErrorBackToAgent({
|
|
5952
|
+
detail: opts.detail,
|
|
5953
|
+
assistantText: opts.assistantText,
|
|
5954
|
+
partsCount: opts.partsCount
|
|
5955
|
+
})) {
|
|
5956
|
+
return;
|
|
5957
|
+
}
|
|
5958
|
+
const thread = readThread(threadId);
|
|
5959
|
+
if (!thread || thread.status === "archived") return;
|
|
5960
|
+
this.crashContinued.add(threadId);
|
|
5961
|
+
const prompt = formatAgentErrorContinuePrompt(opts.detail);
|
|
5962
|
+
const queue = [prompt, ...thread.queue];
|
|
5963
|
+
updateThread(threadId, { queue });
|
|
5964
|
+
this.emit({ type: "queue_changed", threadId, queue });
|
|
5965
|
+
this.haltDrain.delete(threadId);
|
|
5966
|
+
}
|
|
5873
5967
|
getThreads(includeArchived = false) {
|
|
5874
5968
|
return listThreads({ includeArchived });
|
|
5875
5969
|
}
|
|
@@ -5914,7 +6008,7 @@ var Orchestrator = class {
|
|
|
5914
6008
|
}
|
|
5915
6009
|
await setup;
|
|
5916
6010
|
if (skipSetup) return;
|
|
5917
|
-
const { autoRunAfterSetupEnabled } = await import("./app-settings-
|
|
6011
|
+
const { autoRunAfterSetupEnabled } = await import("./app-settings-U5RZKUXG.js");
|
|
5918
6012
|
if (autoRunAfterSetupEnabled()) {
|
|
5919
6013
|
try {
|
|
5920
6014
|
await this.startDev(threadId);
|
|
@@ -5969,15 +6063,20 @@ var Orchestrator = class {
|
|
|
5969
6063
|
throw new Error(`Thread is archived: ${thread.id}`);
|
|
5970
6064
|
}
|
|
5971
6065
|
const queue = [...current.queue, prompt];
|
|
6066
|
+
this.crashContinued.delete(thread.id);
|
|
5972
6067
|
this.haltDrain.delete(thread.id);
|
|
5973
|
-
const
|
|
6068
|
+
const inFlight = this.activeTurns.has(thread.id) || this.startingTurns.has(thread.id) || current.status === "running";
|
|
6069
|
+
const patch = { queue };
|
|
6070
|
+
if (!inFlight) patch.status = "queued";
|
|
5974
6071
|
const pid = current.agentPid;
|
|
5975
6072
|
if (typeof pid === "number" && pid > 0 && !isPidAlive(pid)) {
|
|
5976
6073
|
patch.agentPid = null;
|
|
5977
6074
|
}
|
|
5978
6075
|
updateThread(thread.id, patch);
|
|
5979
6076
|
this.emit({ type: "queue_changed", threadId: thread.id, queue });
|
|
5980
|
-
|
|
6077
|
+
if (!inFlight) {
|
|
6078
|
+
this.emit({ type: "status_changed", threadId: thread.id, status: "queued" });
|
|
6079
|
+
}
|
|
5981
6080
|
if (thisProcessShouldDrainAgentQueues()) {
|
|
5982
6081
|
void this.drainQueue(thread.id);
|
|
5983
6082
|
}
|
|
@@ -6199,7 +6298,7 @@ var Orchestrator = class {
|
|
|
6199
6298
|
}
|
|
6200
6299
|
const isBrightsy = fresh.agent === "brightsy";
|
|
6201
6300
|
const isOrchestration = isOrchestratorThread(fresh);
|
|
6202
|
-
const { autoRenameBranchEnabled, getGithubGitAuthMode } = await import("./app-settings-
|
|
6301
|
+
const { autoRenameBranchEnabled, getGithubGitAuthMode } = await import("./app-settings-U5RZKUXG.js");
|
|
6203
6302
|
const gitAuthMode = getGithubGitAuthMode();
|
|
6204
6303
|
const worktreeDirective = isBrightsy || isOrchestration ? null : formatWorktreeDirective(fresh, {
|
|
6205
6304
|
githubSlug: await resolveGithubRepoSlug(fresh.worktreePath).catch(
|
|
@@ -6298,7 +6397,7 @@ var Orchestrator = class {
|
|
|
6298
6397
|
let parts = result.parts;
|
|
6299
6398
|
let usage = result.usage ?? void 0;
|
|
6300
6399
|
let exitCode = result.exitCode;
|
|
6301
|
-
if (this.requireThread(threadId).agent === "cursor" && exitCode !== 0 && !assistantText && parts.length === 0) {
|
|
6400
|
+
if (!this.stoppedTurns.has(threadId) && this.requireThread(threadId).agent === "cursor" && exitCode !== 0 && !assistantText && parts.length === 0) {
|
|
6302
6401
|
const sessionId = result.sessionId || this.requireThread(threadId).sessionId || "";
|
|
6303
6402
|
if (sessionId) {
|
|
6304
6403
|
const { recoverFinishedCursorRun } = await import("./cursor-recover-QSLWEZNA.js");
|
|
@@ -6319,7 +6418,7 @@ var Orchestrator = class {
|
|
|
6319
6418
|
}
|
|
6320
6419
|
let lastStderr = summarizeTurnStderr(stderrTail);
|
|
6321
6420
|
let detail = lastStderr || (exitCode !== 0 ? fallbackTurnFailDetail(assistantText) : "");
|
|
6322
|
-
if (exitCode !== 0 && !assistantText && parts.length === 0 && !this.stoppedTurns.has(threadId) &&
|
|
6421
|
+
if (exitCode !== 0 && !assistantText && parts.length === 0 && !this.stoppedTurns.has(threadId) && shouldRetryFailedAgentTurn(detail, {
|
|
6323
6422
|
hasSession: Boolean(this.requireThread(threadId).sessionId)
|
|
6324
6423
|
})) {
|
|
6325
6424
|
updateThread(threadId, { sessionId: null });
|
|
@@ -6415,7 +6514,11 @@ var Orchestrator = class {
|
|
|
6415
6514
|
)) {
|
|
6416
6515
|
updateThread(threadId, { sessionId: null });
|
|
6417
6516
|
}
|
|
6418
|
-
|
|
6517
|
+
if (this.stoppedTurns.has(threadId)) {
|
|
6518
|
+
void syncThreadBranchFromGit(threadId).catch(() => void 0);
|
|
6519
|
+
} else {
|
|
6520
|
+
await syncThreadBranchFromGit(threadId);
|
|
6521
|
+
}
|
|
6419
6522
|
if (this.stoppedTurns.has(threadId)) {
|
|
6420
6523
|
const stopped = writeLiveStatus(threadId, "stopped");
|
|
6421
6524
|
if (stopped?.status === "stopped") {
|
|
@@ -6439,9 +6542,16 @@ var Orchestrator = class {
|
|
|
6439
6542
|
});
|
|
6440
6543
|
}
|
|
6441
6544
|
this.emit({ type: "turn_finished", threadId, exitCode });
|
|
6442
|
-
if (exitCode
|
|
6545
|
+
if (exitCode === 0) {
|
|
6546
|
+
this.crashContinued.delete(threadId);
|
|
6547
|
+
} else {
|
|
6443
6548
|
const blob = [chatText, detail].filter(Boolean).join("\n");
|
|
6444
6549
|
void this.maybeHandleOrchestrationQuotaFailover(threadId, blob);
|
|
6550
|
+
this.maybeEnqueueCrashContinue(threadId, {
|
|
6551
|
+
detail: detail || failDetail,
|
|
6552
|
+
assistantText: chatText,
|
|
6553
|
+
partsCount: parts.length
|
|
6554
|
+
});
|
|
6445
6555
|
}
|
|
6446
6556
|
}
|
|
6447
6557
|
} catch (err) {
|
|
@@ -6461,6 +6571,11 @@ var Orchestrator = class {
|
|
|
6461
6571
|
}
|
|
6462
6572
|
this.emit({ type: "turn_finished", threadId, exitCode: 1 });
|
|
6463
6573
|
void this.maybeHandleOrchestrationQuotaFailover(threadId, message);
|
|
6574
|
+
this.maybeEnqueueCrashContinue(threadId, {
|
|
6575
|
+
detail: message,
|
|
6576
|
+
assistantText: "",
|
|
6577
|
+
partsCount: 0
|
|
6578
|
+
});
|
|
6464
6579
|
}
|
|
6465
6580
|
} finally {
|
|
6466
6581
|
this.startingTurns.delete(threadId);
|
|
@@ -6986,7 +7101,7 @@ var Orchestrator = class {
|
|
|
6986
7101
|
updateThread(thread.id, { title: meta.title });
|
|
6987
7102
|
}
|
|
6988
7103
|
}
|
|
6989
|
-
const { autoArchiveOnMergeEnabled } = await import("./app-settings-
|
|
7104
|
+
const { autoArchiveOnMergeEnabled } = await import("./app-settings-U5RZKUXG.js");
|
|
6990
7105
|
const latest = this.requireThread(thread.id);
|
|
6991
7106
|
if (!shouldAutoArchiveOnPrMerge({
|
|
6992
7107
|
previousPrState: prevState || null,
|
|
@@ -7296,7 +7411,7 @@ var Orchestrator = class {
|
|
|
7296
7411
|
this.emit({ type: "status_changed", threadId: archived.id, status: "archived" });
|
|
7297
7412
|
if (thread.repoPath && !isGlobalRepoPath(thread.repoPath)) {
|
|
7298
7413
|
try {
|
|
7299
|
-
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-
|
|
7414
|
+
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-ARWPZG6F.js");
|
|
7300
7415
|
await ensureWorkspace2(thread.repoPath);
|
|
7301
7416
|
} catch {
|
|
7302
7417
|
}
|
|
@@ -7323,7 +7438,7 @@ var Orchestrator = class {
|
|
|
7323
7438
|
await runArchiveScript(thread.repoPath, thread.worktreePath);
|
|
7324
7439
|
} catch {
|
|
7325
7440
|
}
|
|
7326
|
-
const { deleteBranchOnPurgeEnabled } = await import("./app-settings-
|
|
7441
|
+
const { deleteBranchOnPurgeEnabled } = await import("./app-settings-U5RZKUXG.js");
|
|
7327
7442
|
const deleteBranch = opts?.deleteBranch ?? deleteBranchOnPurgeEnabled();
|
|
7328
7443
|
await removeWorktree(thread.repoPath, thread.worktreePath, {
|
|
7329
7444
|
deleteBranch: deleteBranch ? thread.branchName : void 0
|
|
@@ -7350,7 +7465,7 @@ var Orchestrator = class {
|
|
|
7350
7465
|
`Cowboy checkout missing: ${thread.worktreePath}. Re-add the project folder, then restore.`
|
|
7351
7466
|
);
|
|
7352
7467
|
}
|
|
7353
|
-
const { createThreadWorktree: createThreadWorktree2 } = await import("./worktree-
|
|
7468
|
+
const { createThreadWorktree: createThreadWorktree2 } = await import("./worktree-S7MKMYAT.js");
|
|
7354
7469
|
const slug = thread.worktreePath.split("/").pop();
|
|
7355
7470
|
const dest = thread.worktreePath;
|
|
7356
7471
|
await withRepoGitLock(thread.repoPath, async () => {
|
|
@@ -7458,7 +7573,7 @@ async function startOrchestration(opts) {
|
|
|
7458
7573
|
sourceRef: "default",
|
|
7459
7574
|
...createOpts
|
|
7460
7575
|
}).catch(async () => {
|
|
7461
|
-
const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-
|
|
7576
|
+
const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-S7MKMYAT.js");
|
|
7462
7577
|
const repo = await resolveRepoRoot2(repoPath);
|
|
7463
7578
|
const def = await resolveDefaultBranch2(repo);
|
|
7464
7579
|
return orch.createThread({
|
|
@@ -7593,11 +7708,13 @@ export {
|
|
|
7593
7708
|
isHomeBoardThread,
|
|
7594
7709
|
BOARD_COLUMN_DEFS,
|
|
7595
7710
|
HOME_BOARD_CACHE_TTL_MS,
|
|
7711
|
+
DEFAULT_WORKTREE_SORT,
|
|
7596
7712
|
groupHomeBoardWorktrees,
|
|
7597
7713
|
classifyWorktreeColumn,
|
|
7598
7714
|
worktreeBoardStatus,
|
|
7599
7715
|
dedupeBoardIssues,
|
|
7600
7716
|
issueNeedsWorkspacePick,
|
|
7717
|
+
isAccountWideIssueSource,
|
|
7601
7718
|
findLiveThreadForCreate,
|
|
7602
7719
|
boardPinIdentity,
|
|
7603
7720
|
findBoardPin,
|