@sideboard-ai/core 0.1.317 → 0.1.319
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-NZ2ABWAL.js → abletime-DVYO4IVS.js} +6 -4
- package/dist/{abletime-TKAFNXCM.js → abletime-L3ODNTBT.js} +5 -3
- package/dist/{abletime-oauth-S4AXA4WR.js → abletime-oauth-2VWQCXGT.js} +2 -2
- package/dist/{abletime-oauth-CBFFBINA.js → abletime-oauth-6DTX7LB7.js} +3 -3
- package/dist/{abletime-rest-ORBELZQO.js → abletime-rest-7NICZYOC.js} +2 -2
- package/dist/{abletime-rest-NSOP72AI.js → abletime-rest-PYQM234B.js} +3 -3
- package/dist/{agents-BJVSYC6Y.js → agents-2AR7I6B6.js} +5 -5
- package/dist/{app-settings-RQAFJZCD.js → app-settings-V6YPYY57.js} +1 -1
- package/dist/{chunk-CCUGIVYN.js → chunk-5OM7UCTQ.js} +3 -3
- package/dist/{chunk-NXNNYY3Q.js → chunk-AESO2KJS.js} +2 -2
- package/dist/{chunk-VVV7EI6T.js → chunk-AUJ4XB6H.js} +2 -2
- package/dist/{chunk-S3U4HR5F.js → chunk-AZ4GEEGL.js} +2 -2
- package/dist/{chunk-U7PNCYNX.js → chunk-E52SQENB.js} +1 -0
- package/dist/{chunk-OLYNM52B.js → chunk-FDXHNROD.js} +2 -2
- package/dist/{chunk-XWUDFLBX.js → chunk-IAPO7ZFG.js} +4 -4
- package/dist/{chunk-VZAJVX36.js → chunk-JD7CC6SW.js} +1 -1
- package/dist/{chunk-ELBK34TY.js → chunk-LXBZQP2Q.js} +5 -5
- package/dist/{chunk-BXTISNKW.js → chunk-OO3R6CS2.js} +216 -64
- package/dist/{chunk-I5CLCWUK.js → chunk-QPLQXWND.js} +8 -4
- package/dist/{chunk-4XZJYBO2.js → chunk-ST2UQBJT.js} +4 -4
- package/dist/{chunk-YN6XONV5.js → chunk-TUJFCJJU.js} +1 -1
- package/dist/{chunk-U53JICJ2.js → chunk-U2N32EA6.js} +233 -81
- package/dist/{chunk-GXSV3X3L.js → chunk-WLZHRNE6.js} +9 -5
- package/dist/{chunk-PX324N7P.js → chunk-YALFZKSC.js} +2 -2
- package/dist/{chunk-7SCVGGF6.js → chunk-ZM43NTJJ.js} +4 -4
- package/dist/{conductor-TP2NA44I.js → conductor-MG2RAQNT.js} +4 -4
- package/dist/{coordinator-prompt-FQC2SZPP.js → coordinator-prompt-X74F3JIC.js} +3 -3
- package/dist/{global-workspace-72K6D354.js → global-workspace-FTNJEML3.js} +3 -3
- package/dist/index.cjs +301 -79
- package/dist/index.d.cts +29 -9
- package/dist/index.d.ts +29 -9
- package/dist/index.js +72 -27
- package/dist/mcp/run-stdio.cjs +240 -63
- package/dist/mcp/run-stdio.js +4 -4
- package/dist/{optional-cli-LMSRZNH4.js → optional-cli-6GGESWGE.js} +4 -4
- package/dist/{orchestrator-N54V3B76.js → orchestrator-H3DSZ5RM.js} +1 -1
- package/dist/{orchestrator-E72HYGTB.js → orchestrator-NCA4LSCC.js} +8 -8
- package/dist/{workspaces-GAUHXBUL.js → workspaces-MGKEAYNM.js} +3 -3
- package/dist/{worktree-6FUQ7FEF.js → worktree-THAXW5U7.js} +2 -2
- package/package.json +1 -1
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
parseSessionQuotaResetAt,
|
|
15
15
|
planModeTurnInstruction,
|
|
16
16
|
resolveQuotaFallbackAgent
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-IAPO7ZFG.js";
|
|
18
18
|
import {
|
|
19
19
|
applyWorktreePkgCacheEnv,
|
|
20
20
|
askBlockStillWaiting,
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
worktreeDevProcessKey,
|
|
53
53
|
worktreeRunProcessKey,
|
|
54
54
|
worktreeSetupProcessKey
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-ST2UQBJT.js";
|
|
56
56
|
import {
|
|
57
57
|
applyAgentEvent,
|
|
58
58
|
clipAgentEventForPaint,
|
|
@@ -74,7 +74,7 @@ import {
|
|
|
74
74
|
import {
|
|
75
75
|
formatOptionalServicesDirectiveForTurn,
|
|
76
76
|
formatOptionalServicesReminderForTurn
|
|
77
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-FDXHNROD.js";
|
|
78
78
|
import {
|
|
79
79
|
SLACK_REPLY_FORMATTING,
|
|
80
80
|
addWorkspace,
|
|
@@ -99,7 +99,7 @@ import {
|
|
|
99
99
|
stageAbsolutePathsAsAttachments,
|
|
100
100
|
stageBuffersAsAttachments,
|
|
101
101
|
syncWorkspacesFromThreads
|
|
102
|
-
} from "./chunk-
|
|
102
|
+
} from "./chunk-YALFZKSC.js";
|
|
103
103
|
import {
|
|
104
104
|
addPrStackLayer,
|
|
105
105
|
allocateTeamSlug,
|
|
@@ -143,7 +143,7 @@ import {
|
|
|
143
143
|
resolveRepoRoot,
|
|
144
144
|
switchWorktreeBranch,
|
|
145
145
|
withRepoGitLock
|
|
146
|
-
} from "./chunk-
|
|
146
|
+
} from "./chunk-TUJFCJJU.js";
|
|
147
147
|
import {
|
|
148
148
|
REVIEW_TAB_TITLE,
|
|
149
149
|
agentNicknameFromWorktreePath,
|
|
@@ -239,7 +239,7 @@ import {
|
|
|
239
239
|
usageOnLimit,
|
|
240
240
|
withTurnScopedCost,
|
|
241
241
|
writeViewerContext
|
|
242
|
-
} from "./chunk-
|
|
242
|
+
} from "./chunk-E52SQENB.js";
|
|
243
243
|
import {
|
|
244
244
|
examplePrefixedBranch,
|
|
245
245
|
sanitizeGitBranchPrefix
|
|
@@ -461,9 +461,9 @@ async function spawnAgentTurn(thread, input, onEvent) {
|
|
|
461
461
|
`Cannot spawn ${thread.agent}: thread ${thread.id} has no worktreePath`
|
|
462
462
|
);
|
|
463
463
|
}
|
|
464
|
-
const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-
|
|
464
|
+
const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-FTNJEML3.js");
|
|
465
465
|
if (isGlobalThread2(thread)) {
|
|
466
|
-
const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-
|
|
466
|
+
const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-X74F3JIC.js");
|
|
467
467
|
ensureGlobalCoordinatorCwd2(
|
|
468
468
|
isOrchestratorThread(thread) ? { orchestratorThreadId: thread.id } : void 0
|
|
469
469
|
);
|
|
@@ -2930,7 +2930,7 @@ async function createThread(input, _onSetupLine) {
|
|
|
2930
2930
|
});
|
|
2931
2931
|
await requireAgent(resolved.agent);
|
|
2932
2932
|
if (input.cowboy) {
|
|
2933
|
-
const { cowboyModeEnabled } = await import("./app-settings-
|
|
2933
|
+
const { cowboyModeEnabled } = await import("./app-settings-V6YPYY57.js");
|
|
2934
2934
|
if (!cowboyModeEnabled()) {
|
|
2935
2935
|
throw new Error(
|
|
2936
2936
|
"Cowboy mode is off. Enable it in Settings \u2192 Advanced."
|
|
@@ -2989,7 +2989,7 @@ async function createThread(input, _onSetupLine) {
|
|
|
2989
2989
|
let sourceIsFork = false;
|
|
2990
2990
|
if (!input.cowboy && sourceType === "branch" && (!sourceRef || sourceRef === "HEAD" || sourceRef === "default")) {
|
|
2991
2991
|
if (isAbleTimeConnected() && getIssueSource() === "abletime") {
|
|
2992
|
-
const { ensureAbleTimeTask, issueAttachmentForAbleTimeTask } = await import("./abletime-
|
|
2992
|
+
const { ensureAbleTimeTask, issueAttachmentForAbleTimeTask } = await import("./abletime-DVYO4IVS.js");
|
|
2993
2993
|
const task = await ensureAbleTimeTask({
|
|
2994
2994
|
title: title?.trim() || "Untitled work",
|
|
2995
2995
|
description: input.prompt?.trim() || void 0
|
|
@@ -3100,7 +3100,7 @@ async function createThread(input, _onSetupLine) {
|
|
|
3100
3100
|
return readThread(thread.id) ?? thread;
|
|
3101
3101
|
}
|
|
3102
3102
|
async function listLinearIssues(agent, repoPath) {
|
|
3103
|
-
const { getAdapter: getAdapter2 } = await import("./agents-
|
|
3103
|
+
const { getAdapter: getAdapter2 } = await import("./agents-2AR7I6B6.js");
|
|
3104
3104
|
await requireAgent(agent, { requireLinear: true });
|
|
3105
3105
|
const adapter = getAdapter2(agent);
|
|
3106
3106
|
if (!adapter.listLinearIssues) {
|
|
@@ -3877,7 +3877,7 @@ async function adoptThread(input) {
|
|
|
3877
3877
|
messages: input.messages ?? []
|
|
3878
3878
|
});
|
|
3879
3879
|
writeThread(thread);
|
|
3880
|
-
const { addWorkspace: addWorkspace2 } = await import("./workspaces-
|
|
3880
|
+
const { addWorkspace: addWorkspace2 } = await import("./workspaces-MGKEAYNM.js");
|
|
3881
3881
|
await addWorkspace2(repoPath);
|
|
3882
3882
|
const { ensureWorktreeSideboardIgnored } = await import("./worktree-exclude-RXZPTCNH.js");
|
|
3883
3883
|
await ensureWorktreeSideboardIgnored(input.worktreePath);
|
|
@@ -5710,6 +5710,36 @@ function expandComposerPrompt(worktreePath, prompt, opts) {
|
|
|
5710
5710
|
};
|
|
5711
5711
|
}
|
|
5712
5712
|
|
|
5713
|
+
// src/composer/agent-has-replied.ts
|
|
5714
|
+
function joinSteerPrompt(base, addition) {
|
|
5715
|
+
const next = addition.trim();
|
|
5716
|
+
if (!next) return base;
|
|
5717
|
+
const head = base.replace(/\s+$/, "");
|
|
5718
|
+
if (!head) return next;
|
|
5719
|
+
return `${head}
|
|
5720
|
+
${next}`;
|
|
5721
|
+
}
|
|
5722
|
+
function trailingUnansweredUserText(messages) {
|
|
5723
|
+
for (let i = messages.length - 1; i >= 0; i--) {
|
|
5724
|
+
const message = messages[i];
|
|
5725
|
+
if (!message || message.origin === "continue" || message.role === "summary") continue;
|
|
5726
|
+
if (message.role === "agent") {
|
|
5727
|
+
const text3 = (message.text ?? "").trim();
|
|
5728
|
+
if (text3 || (message.parts?.length ?? 0) > 0) return null;
|
|
5729
|
+
continue;
|
|
5730
|
+
}
|
|
5731
|
+
if (message.role === "user") return message.text;
|
|
5732
|
+
}
|
|
5733
|
+
return null;
|
|
5734
|
+
}
|
|
5735
|
+
function livePartsShowAgentReply(parts) {
|
|
5736
|
+
for (const part of parts) {
|
|
5737
|
+
if (part.type === "tool") return true;
|
|
5738
|
+
if ((part.type === "text" || part.type === "thinking") && part.text.trim()) return true;
|
|
5739
|
+
}
|
|
5740
|
+
return false;
|
|
5741
|
+
}
|
|
5742
|
+
|
|
5713
5743
|
// src/composer/consume-attachments.ts
|
|
5714
5744
|
function consumeComposerAttachments(thread) {
|
|
5715
5745
|
return {
|
|
@@ -5762,6 +5792,128 @@ function shiftQueuedItem(queue, queueAttachments) {
|
|
|
5762
5792
|
};
|
|
5763
5793
|
}
|
|
5764
5794
|
|
|
5795
|
+
// src/orchestrator/enqueue-thread-send.ts
|
|
5796
|
+
function resolveSendFollowUp(thread, requested) {
|
|
5797
|
+
if (requested === "steer" || requested === "queue") return requested;
|
|
5798
|
+
return isOrchestratorThread(thread) ? followUpBehavior() : "queue";
|
|
5799
|
+
}
|
|
5800
|
+
function rewriteTrailingUserPrompt(threadId, from, to) {
|
|
5801
|
+
if (from === to) return;
|
|
5802
|
+
const thread = readThread(threadId);
|
|
5803
|
+
if (!thread) return;
|
|
5804
|
+
const messages = thread.messages.slice();
|
|
5805
|
+
for (let i = messages.length - 1; i >= 0; i--) {
|
|
5806
|
+
const message = messages[i];
|
|
5807
|
+
if (!message || message.origin === "continue" || message.role === "summary") continue;
|
|
5808
|
+
if (message.role === "user" && message.text === from) {
|
|
5809
|
+
messages[i] = { ...message, text: to };
|
|
5810
|
+
updateThread(threadId, { messages });
|
|
5811
|
+
}
|
|
5812
|
+
return;
|
|
5813
|
+
}
|
|
5814
|
+
}
|
|
5815
|
+
function reuseJoinedUserBubble(reused, threadId, last, promptText) {
|
|
5816
|
+
return reused.delete(threadId) && last?.role === "user" && last.origin !== "continue" && last.text === promptText;
|
|
5817
|
+
}
|
|
5818
|
+
function promptForJoinedSteer(input) {
|
|
5819
|
+
if (input.latestPrompt === input.promptText) return input.agentPrompt;
|
|
5820
|
+
rewriteTrailingUserPrompt(input.threadId, input.promptText, input.latestPrompt);
|
|
5821
|
+
const { agentPrompt: expandedLatest } = expandComposerPrompt(
|
|
5822
|
+
input.worktreePath,
|
|
5823
|
+
expandCanonicalGitRequest(input.latestPrompt),
|
|
5824
|
+
{ attachments: input.attachments }
|
|
5825
|
+
);
|
|
5826
|
+
return input.expandedPrompt && input.agentPrompt.endsWith(input.expandedPrompt) ? input.agentPrompt.slice(0, -input.expandedPrompt.length) + expandedLatest : `${input.agentPrompt}
|
|
5827
|
+
|
|
5828
|
+
${expandedLatest}`;
|
|
5829
|
+
}
|
|
5830
|
+
function clearSendBookkeeping(host, threadId) {
|
|
5831
|
+
host.crashContinued.delete(threadId);
|
|
5832
|
+
host.jobContinueCount.delete(threadId);
|
|
5833
|
+
host.jobContinueNudged.delete(threadId);
|
|
5834
|
+
host.haltDrain.delete(threadId);
|
|
5835
|
+
}
|
|
5836
|
+
async function enqueueThreadSend(host, threadRef, prompt, opts) {
|
|
5837
|
+
const thread = host.requireThread(threadRef);
|
|
5838
|
+
if (thread.status === "archived") {
|
|
5839
|
+
throw new Error(`Thread is archived: ${thread.id}`);
|
|
5840
|
+
}
|
|
5841
|
+
let shouldSteer = false;
|
|
5842
|
+
const sent = await withThreadLock(thread.id, async () => {
|
|
5843
|
+
const current = host.requireThread(thread.id);
|
|
5844
|
+
if (current.status === "archived") {
|
|
5845
|
+
throw new Error(`Thread is archived: ${thread.id}`);
|
|
5846
|
+
}
|
|
5847
|
+
const followUp = resolveSendFollowUp(current, opts?.followUp);
|
|
5848
|
+
const explicit = opts?.attachments;
|
|
5849
|
+
const consumed = explicit !== void 0 ? { attachments: current.attachments, consumed: explicit } : consumeComposerAttachments(current);
|
|
5850
|
+
const inFlightEarly = host.activeTurns.has(thread.id) || host.startingTurns.has(thread.id) || current.status === "running";
|
|
5851
|
+
const agentHasRepliedEarly = livePartsShowAgentReply(readTurnLiveParts(current.id));
|
|
5852
|
+
const draft = host.openSteerPrompt.get(current.id);
|
|
5853
|
+
const queuedHead = !inFlightEarly && current.status === "queued" && current.queue.length > 0 ? current.queue[0] : null;
|
|
5854
|
+
const unanswered = followUp === "steer" && !agentHasRepliedEarly ? draft?.text ?? (inFlightEarly ? trailingUnansweredUserText(current.messages) : queuedHead) : null;
|
|
5855
|
+
if (unanswered != null && (draft ? !draft.spawned : queuedHead != null)) {
|
|
5856
|
+
clearSendBookkeeping(host, thread.id);
|
|
5857
|
+
const combined = joinSteerPrompt(unanswered, prompt);
|
|
5858
|
+
if (draft && !draft.spawned) {
|
|
5859
|
+
draft.text = combined;
|
|
5860
|
+
rewriteTrailingUserPrompt(current.id, unanswered, combined);
|
|
5861
|
+
} else {
|
|
5862
|
+
const queue = current.queue.slice();
|
|
5863
|
+
queue[0] = combined;
|
|
5864
|
+
const queueAttachments = alignQueueAttachments(queue.length, current.queueAttachments);
|
|
5865
|
+
if (consumed.consumed.length > 0) {
|
|
5866
|
+
queueAttachments[0] = [...queueAttachments[0] ?? [], ...consumed.consumed];
|
|
5867
|
+
}
|
|
5868
|
+
const patch2 = { queue, queueAttachments };
|
|
5869
|
+
if (explicit === void 0 && consumed.consumed.length > 0) {
|
|
5870
|
+
patch2.attachments = consumed.attachments;
|
|
5871
|
+
}
|
|
5872
|
+
updateThread(current.id, patch2);
|
|
5873
|
+
host.emit({ type: "queue_changed", threadId: current.id, queue });
|
|
5874
|
+
}
|
|
5875
|
+
if (thisProcessShouldDrainAgentQueues() && !inFlightEarly) {
|
|
5876
|
+
host.armDrain(current.id);
|
|
5877
|
+
}
|
|
5878
|
+
return host.requireThread(current.id);
|
|
5879
|
+
}
|
|
5880
|
+
const promptToQueue = unanswered != null ? joinSteerPrompt(unanswered, prompt) : prompt;
|
|
5881
|
+
if (unanswered != null) {
|
|
5882
|
+
if (draft) draft.text = promptToQueue;
|
|
5883
|
+
rewriteTrailingUserPrompt(current.id, unanswered, promptToQueue);
|
|
5884
|
+
host.reusedUserPrompt.add(current.id);
|
|
5885
|
+
}
|
|
5886
|
+
const queued = appendQueuedItem(
|
|
5887
|
+
current.queue,
|
|
5888
|
+
current.queueAttachments,
|
|
5889
|
+
promptToQueue,
|
|
5890
|
+
consumed.consumed
|
|
5891
|
+
);
|
|
5892
|
+
clearSendBookkeeping(host, thread.id);
|
|
5893
|
+
const inFlight = host.activeTurns.has(thread.id) || host.startingTurns.has(thread.id) || current.status === "running";
|
|
5894
|
+
shouldSteer = followUp === "steer" && (inFlight || current.queue.length > 0);
|
|
5895
|
+
const patch = queued;
|
|
5896
|
+
if (explicit === void 0 && consumed.consumed.length > 0) {
|
|
5897
|
+
patch.attachments = consumed.attachments;
|
|
5898
|
+
}
|
|
5899
|
+
if (!inFlight) patch.status = "queued";
|
|
5900
|
+
const pid = current.agentPid;
|
|
5901
|
+
if (typeof pid === "number" && pid > 0 && !host.pidAlive(pid)) {
|
|
5902
|
+
patch.agentPid = null;
|
|
5903
|
+
}
|
|
5904
|
+
updateThread(thread.id, patch);
|
|
5905
|
+
host.emit({ type: "queue_changed", threadId: thread.id, queue: queued.queue });
|
|
5906
|
+
if (!inFlight) {
|
|
5907
|
+
host.emit({ type: "status_changed", threadId: thread.id, status: "queued" });
|
|
5908
|
+
}
|
|
5909
|
+
if (thisProcessShouldDrainAgentQueues() && !shouldSteer) {
|
|
5910
|
+
host.armDrain(thread.id);
|
|
5911
|
+
}
|
|
5912
|
+
return host.requireThread(thread.id);
|
|
5913
|
+
});
|
|
5914
|
+
return { thread: sent, shouldSteer };
|
|
5915
|
+
}
|
|
5916
|
+
|
|
5765
5917
|
// src/agents/instructions.ts
|
|
5766
5918
|
import { existsSync as existsSync12 } from "fs";
|
|
5767
5919
|
import { join as join12 } from "path";
|
|
@@ -6815,7 +6967,7 @@ function formatScheduledPrompt(name, prompt) {
|
|
|
6815
6967
|
${prompt}`;
|
|
6816
6968
|
}
|
|
6817
6969
|
async function defaultDeps() {
|
|
6818
|
-
const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-
|
|
6970
|
+
const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-NCA4LSCC.js");
|
|
6819
6971
|
const orch = getOrchestrator2();
|
|
6820
6972
|
return {
|
|
6821
6973
|
findThread: (id) => findThreadByRef(id),
|
|
@@ -6931,10 +7083,6 @@ async function waitForPidExit(pid, timeoutMs) {
|
|
|
6931
7083
|
}
|
|
6932
7084
|
return true;
|
|
6933
7085
|
}
|
|
6934
|
-
function resolveSendFollowUp(thread, requested) {
|
|
6935
|
-
if (requested === "steer" || requested === "queue") return requested;
|
|
6936
|
-
return isOrchestratorThread(thread) ? followUpBehavior() : "queue";
|
|
6937
|
-
}
|
|
6938
7086
|
function resolveOrchChildFollowUp(requested) {
|
|
6939
7087
|
if (requested === "steer" || requested === "queue") return requested;
|
|
6940
7088
|
return followUpBehavior();
|
|
@@ -6963,6 +7111,13 @@ var Orchestrator = class {
|
|
|
6963
7111
|
draining = /* @__PURE__ */ new Set();
|
|
6964
7112
|
/** Threads past setStatus(running) but not yet in activeTurns (spawn in flight). */
|
|
6965
7113
|
startingTurns = /* @__PURE__ */ new Set();
|
|
7114
|
+
/**
|
|
7115
|
+
* Prompt for the turn that has not been answered yet. Steer follow-ups before
|
|
7116
|
+
* any agent output are joined onto this text instead of starting a second bubble.
|
|
7117
|
+
*/
|
|
7118
|
+
openSteerPrompt = /* @__PURE__ */ new Map();
|
|
7119
|
+
/** Next runTurn should keep the user bubble already rewritten to this prompt. */
|
|
7120
|
+
reusedUserPrompt = /* @__PURE__ */ new Set();
|
|
6966
7121
|
/** Last sync thread-file read for false-stop heal (throttled per thread). */
|
|
6967
7122
|
lastReconcileHealAt = /* @__PURE__ */ new Map();
|
|
6968
7123
|
/** Per-repo timestamp of the last `reconcile(repo, { light: true })`. */
|
|
@@ -7133,7 +7288,7 @@ var Orchestrator = class {
|
|
|
7133
7288
|
orphans: orphans.map((o) => ({ path: o.path, repoPath: o.repoPath }))
|
|
7134
7289
|
});
|
|
7135
7290
|
}
|
|
7136
|
-
const { autoCleanupOrphansEnabled } = await import("./app-settings-
|
|
7291
|
+
const { autoCleanupOrphansEnabled } = await import("./app-settings-V6YPYY57.js");
|
|
7137
7292
|
if (autoCleanupOrphansEnabled() && shouldRunWorktreeCleanup() && orphans.length > 0) {
|
|
7138
7293
|
await cleanupOrphanWorktrees({ repoPaths });
|
|
7139
7294
|
}
|
|
@@ -7527,7 +7682,7 @@ var Orchestrator = class {
|
|
|
7527
7682
|
}
|
|
7528
7683
|
await setup;
|
|
7529
7684
|
if (skipSetup) return;
|
|
7530
|
-
const { autoRunAfterSetupEnabled } = await import("./app-settings-
|
|
7685
|
+
const { autoRunAfterSetupEnabled } = await import("./app-settings-V6YPYY57.js");
|
|
7531
7686
|
if (autoRunAfterSetupEnabled()) {
|
|
7532
7687
|
try {
|
|
7533
7688
|
await this.startDev(threadId);
|
|
@@ -7573,54 +7728,29 @@ var Orchestrator = class {
|
|
|
7573
7728
|
return thread;
|
|
7574
7729
|
}
|
|
7575
7730
|
async send(threadRef, prompt, opts) {
|
|
7576
|
-
const
|
|
7577
|
-
|
|
7578
|
-
|
|
7579
|
-
|
|
7580
|
-
|
|
7581
|
-
|
|
7582
|
-
|
|
7583
|
-
|
|
7584
|
-
|
|
7585
|
-
|
|
7586
|
-
|
|
7587
|
-
|
|
7588
|
-
|
|
7589
|
-
|
|
7590
|
-
|
|
7591
|
-
|
|
7592
|
-
|
|
7593
|
-
|
|
7594
|
-
|
|
7595
|
-
|
|
7596
|
-
this.
|
|
7597
|
-
this.jobContinueNudged.delete(thread.id);
|
|
7598
|
-
this.haltDrain.delete(thread.id);
|
|
7599
|
-
const inFlight = this.activeTurns.has(thread.id) || this.startingTurns.has(thread.id) || current.status === "running";
|
|
7600
|
-
shouldSteer = followUp === "steer" && (inFlight || current.queue.length > 0);
|
|
7601
|
-
const patch = queued;
|
|
7602
|
-
if (explicit === void 0 && consumed.consumed.length > 0) {
|
|
7603
|
-
patch.attachments = consumed.attachments;
|
|
7604
|
-
}
|
|
7605
|
-
if (!inFlight) patch.status = "queued";
|
|
7606
|
-
const pid = current.agentPid;
|
|
7607
|
-
if (typeof pid === "number" && pid > 0 && !isPidAlive(pid)) {
|
|
7608
|
-
patch.agentPid = null;
|
|
7609
|
-
}
|
|
7610
|
-
updateThread(thread.id, patch);
|
|
7611
|
-
this.emit({ type: "queue_changed", threadId: thread.id, queue: queued.queue });
|
|
7612
|
-
if (!inFlight) {
|
|
7613
|
-
this.emit({ type: "status_changed", threadId: thread.id, status: "queued" });
|
|
7614
|
-
}
|
|
7615
|
-
if (thisProcessShouldDrainAgentQueues() && !shouldSteer) {
|
|
7616
|
-
this.armDrain(thread.id);
|
|
7617
|
-
}
|
|
7618
|
-
return this.requireThread(thread.id);
|
|
7619
|
-
});
|
|
7620
|
-
if (shouldSteer && sent.queue.length > 0) {
|
|
7621
|
-
return this.sendQueuedMessageNow(sent.id, sent.queue.length - 1);
|
|
7731
|
+
const sent = await enqueueThreadSend(
|
|
7732
|
+
{
|
|
7733
|
+
activeTurns: this.activeTurns,
|
|
7734
|
+
startingTurns: this.startingTurns,
|
|
7735
|
+
openSteerPrompt: this.openSteerPrompt,
|
|
7736
|
+
reusedUserPrompt: this.reusedUserPrompt,
|
|
7737
|
+
crashContinued: this.crashContinued,
|
|
7738
|
+
jobContinueCount: this.jobContinueCount,
|
|
7739
|
+
jobContinueNudged: this.jobContinueNudged,
|
|
7740
|
+
haltDrain: this.haltDrain,
|
|
7741
|
+
emit: (event) => this.emit(event),
|
|
7742
|
+
armDrain: (id) => this.armDrain(id),
|
|
7743
|
+
requireThread: (ref) => this.requireThread(ref),
|
|
7744
|
+
pidAlive: (pid) => isPidAlive(pid)
|
|
7745
|
+
},
|
|
7746
|
+
threadRef,
|
|
7747
|
+
prompt,
|
|
7748
|
+
opts
|
|
7749
|
+
);
|
|
7750
|
+
if (sent.shouldSteer && sent.thread.queue.length > 0) {
|
|
7751
|
+
return this.sendQueuedMessageNow(sent.thread.id, sent.thread.queue.length - 1);
|
|
7622
7752
|
}
|
|
7623
|
-
return sent;
|
|
7753
|
+
return sent.thread;
|
|
7624
7754
|
}
|
|
7625
7755
|
async fanOut(threadRefs, prompt, opts) {
|
|
7626
7756
|
const results = [];
|
|
@@ -7777,6 +7907,10 @@ var Orchestrator = class {
|
|
|
7777
7907
|
this.emit({ type: "status_changed", threadId, status: "running" });
|
|
7778
7908
|
this.emit({ type: "turn_started", threadId, prompt });
|
|
7779
7909
|
try {
|
|
7910
|
+
this.openSteerPrompt.set(threadId, {
|
|
7911
|
+
text: typeof prompt === "string" ? prompt : "",
|
|
7912
|
+
spawned: false
|
|
7913
|
+
});
|
|
7780
7914
|
try {
|
|
7781
7915
|
const baseline = await captureTurnBaseline(thread.worktreePath);
|
|
7782
7916
|
if (baseline) this.turnBaselines.set(threadId, baseline);
|
|
@@ -7802,18 +7936,21 @@ var Orchestrator = class {
|
|
|
7802
7936
|
this.emit({ type: "error", threadId, message: `context compact failed: ${message}` });
|
|
7803
7937
|
thread = this.requireThread(threadId);
|
|
7804
7938
|
}
|
|
7805
|
-
const promptText = typeof prompt === "string" ? prompt : "";
|
|
7939
|
+
const promptText = this.openSteerPrompt.get(threadId)?.text ?? (typeof prompt === "string" ? prompt : "");
|
|
7806
7940
|
const autoContinue = isJobContinuePrompt(promptText) || promptText.startsWith("The previous agent process ended before it finished.");
|
|
7807
7941
|
const parked = takePendingTurnAttachments(thread);
|
|
7808
7942
|
const sentAttachments = !autoContinue && parked.length > 0 ? parked : void 0;
|
|
7809
7943
|
if (!autoContinue) clearAgentBlock(threadId);
|
|
7810
|
-
|
|
7811
|
-
|
|
7812
|
-
|
|
7813
|
-
|
|
7814
|
-
|
|
7815
|
-
|
|
7816
|
-
|
|
7944
|
+
const lastShown = this.requireThread(threadId).messages.at(-1);
|
|
7945
|
+
if (!reuseJoinedUserBubble(this.reusedUserPrompt, threadId, lastShown, promptText)) {
|
|
7946
|
+
appendMessage(threadId, {
|
|
7947
|
+
role: "user",
|
|
7948
|
+
text: promptText,
|
|
7949
|
+
...sentAttachments ? { attachments: sentAttachments } : {},
|
|
7950
|
+
...autoContinue ? { origin: "continue" } : {},
|
|
7951
|
+
ts: (/* @__PURE__ */ new Date()).toISOString()
|
|
7952
|
+
});
|
|
7953
|
+
}
|
|
7817
7954
|
if (!autoContinue) {
|
|
7818
7955
|
const live = this.requireThread(threadId);
|
|
7819
7956
|
const stamp = agentPurposeStamp({
|
|
@@ -7921,7 +8058,7 @@ ${formatEnvReminder(projectNameForRepoPath(thread.repoPath || thread.worktreePat
|
|
|
7921
8058
|
}
|
|
7922
8059
|
const isBrightsy = fresh.agent === "brightsy";
|
|
7923
8060
|
const isOrchestration = isOrchestratorThread(fresh);
|
|
7924
|
-
const { autoRenameBranchEnabled, getGithubGitAuthMode, gitBranchPrefixSetting } = await import("./app-settings-
|
|
8061
|
+
const { autoRenameBranchEnabled, getGithubGitAuthMode, gitBranchPrefixSetting } = await import("./app-settings-V6YPYY57.js");
|
|
7925
8062
|
const gitAuthMode = getGithubGitAuthMode();
|
|
7926
8063
|
const worktreeDirective = isBrightsy || isOrchestration ? null : formatWorktreeDirective(fresh, {
|
|
7927
8064
|
githubSlug: await withTimeout(
|
|
@@ -8012,11 +8149,22 @@ ${formatEnvReminder(projectNameForRepoPath(thread.repoPath || thread.worktreePat
|
|
|
8012
8149
|
].filter(Boolean).join("\n\n---\n\n");
|
|
8013
8150
|
const stderrTail = [];
|
|
8014
8151
|
traceTurn("runTurn.beforeSpawn", { threadId, agent: fresh.agent });
|
|
8152
|
+
const steerDraft = this.openSteerPrompt.get(threadId);
|
|
8153
|
+
if (steerDraft) steerDraft.spawned = true;
|
|
8154
|
+
const promptForAgent = promptForJoinedSteer({
|
|
8155
|
+
threadId,
|
|
8156
|
+
promptText,
|
|
8157
|
+
latestPrompt: steerDraft?.text ?? promptText,
|
|
8158
|
+
agentPrompt,
|
|
8159
|
+
expandedPrompt,
|
|
8160
|
+
worktreePath: fresh.worktreePath,
|
|
8161
|
+
attachments: autoContinue ? [] : sentAttachments ?? []
|
|
8162
|
+
});
|
|
8015
8163
|
const handle = await spawnAgentTurn(
|
|
8016
8164
|
fresh,
|
|
8017
8165
|
{
|
|
8018
8166
|
cachedPrefix,
|
|
8019
|
-
prompt:
|
|
8167
|
+
prompt: promptForAgent,
|
|
8020
8168
|
systemPrompt: turnReminders,
|
|
8021
8169
|
isolateCodexPlugins: fresh.isolateCodexPlugins === true
|
|
8022
8170
|
},
|
|
@@ -8144,7 +8292,7 @@ ${formatEnvReminder(projectNameForRepoPath(thread.repoPath || thread.worktreePat
|
|
|
8144
8292
|
retryThread,
|
|
8145
8293
|
{
|
|
8146
8294
|
cachedPrefix: retryPrefix,
|
|
8147
|
-
prompt:
|
|
8295
|
+
prompt: promptForAgent,
|
|
8148
8296
|
systemPrompt: turnReminders,
|
|
8149
8297
|
isolateCodexPlugins: isolateCodexPluginRetry || retryThread.isolateCodexPlugins === true
|
|
8150
8298
|
},
|
|
@@ -8304,6 +8452,7 @@ ${formatEnvReminder(projectNameForRepoPath(thread.repoPath || thread.worktreePat
|
|
|
8304
8452
|
} finally {
|
|
8305
8453
|
this.startingTurns.delete(threadId);
|
|
8306
8454
|
this.activeTurns.delete(threadId);
|
|
8455
|
+
this.openSteerPrompt.delete(threadId);
|
|
8307
8456
|
this.processes.delete(`${threadId}:agent`);
|
|
8308
8457
|
this.stoppedTurns.delete(threadId);
|
|
8309
8458
|
this.runningCount = Math.max(0, this.runningCount - 1);
|
|
@@ -9237,7 +9386,7 @@ ${formatEnvReminder(projectNameForRepoPath(thread.repoPath || thread.worktreePat
|
|
|
9237
9386
|
if (Object.keys(patch).length === 0) continue;
|
|
9238
9387
|
updateThread(t.id, patch);
|
|
9239
9388
|
}
|
|
9240
|
-
const { autoArchiveOnMergeEnabled } = await import("./app-settings-
|
|
9389
|
+
const { autoArchiveOnMergeEnabled } = await import("./app-settings-V6YPYY57.js");
|
|
9241
9390
|
const latest = this.requireThread(thread.id);
|
|
9242
9391
|
if (!shouldAutoArchiveOnPrMerge({
|
|
9243
9392
|
previousPrState: prevState || null,
|
|
@@ -9561,7 +9710,7 @@ ${formatEnvReminder(projectNameForRepoPath(thread.repoPath || thread.worktreePat
|
|
|
9561
9710
|
await runArchiveScript(thread.repoPath, thread.worktreePath);
|
|
9562
9711
|
} catch {
|
|
9563
9712
|
}
|
|
9564
|
-
const { deleteBranchOnPurgeEnabled } = await import("./app-settings-
|
|
9713
|
+
const { deleteBranchOnPurgeEnabled } = await import("./app-settings-V6YPYY57.js");
|
|
9565
9714
|
const deleteBranch = opts?.deleteBranch ?? deleteBranchOnPurgeEnabled();
|
|
9566
9715
|
await removeWorktree(thread.repoPath, thread.worktreePath, {
|
|
9567
9716
|
deleteBranch: deleteBranch ? thread.branchName : void 0
|
|
@@ -9697,7 +9846,7 @@ async function startOrchestration(opts) {
|
|
|
9697
9846
|
sourceRef: "default",
|
|
9698
9847
|
...createOpts
|
|
9699
9848
|
}).catch(async () => {
|
|
9700
|
-
const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-
|
|
9849
|
+
const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-THAXW5U7.js");
|
|
9701
9850
|
const repo = await resolveRepoRoot2(repoPath);
|
|
9702
9851
|
const def = await resolveDefaultBranch2(repo);
|
|
9703
9852
|
return orch.createThread({
|
|
@@ -9867,6 +10016,9 @@ export {
|
|
|
9867
10016
|
discoverSkills,
|
|
9868
10017
|
readSkillBody,
|
|
9869
10018
|
expandComposerPrompt,
|
|
10019
|
+
joinSteerPrompt,
|
|
10020
|
+
trailingUnansweredUserText,
|
|
10021
|
+
livePartsShowAgentReply,
|
|
9870
10022
|
consumeComposerAttachments,
|
|
9871
10023
|
takePendingTurnAttachments,
|
|
9872
10024
|
alignQueueAttachments,
|
|
@@ -9875,6 +10027,7 @@ export {
|
|
|
9875
10027
|
removeQueuedItem,
|
|
9876
10028
|
moveQueuedItemToFront,
|
|
9877
10029
|
shiftQueuedItem,
|
|
10030
|
+
resolveSendFollowUp,
|
|
9878
10031
|
packagedDetachedJobPath,
|
|
9879
10032
|
resolveDetachedJobScript,
|
|
9880
10033
|
formatDetachedJobInvoke,
|
|
@@ -9914,7 +10067,6 @@ export {
|
|
|
9914
10067
|
RUN_SCRIPT_DESKTOP_ADOPT_MS,
|
|
9915
10068
|
isPidAlive,
|
|
9916
10069
|
waitForPidExit,
|
|
9917
|
-
resolveSendFollowUp,
|
|
9918
10070
|
resolveOrchChildFollowUp,
|
|
9919
10071
|
LIGHT_RECONCILE_THROTTLE_MS,
|
|
9920
10072
|
Orchestrator,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
abletimeRestUrl,
|
|
3
3
|
textFromAbleTimeDoc
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-AUJ4XB6H.js";
|
|
5
5
|
import {
|
|
6
6
|
assertAbleTimeCredential,
|
|
7
7
|
callAbleTimeTool,
|
|
8
8
|
normalizeAbleTimeHost,
|
|
9
9
|
rewriteAbleTimeError
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-LXBZQP2Q.js";
|
|
11
11
|
import {
|
|
12
12
|
httpFetch
|
|
13
13
|
} from "./chunk-JAT3JFOS.js";
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
getAbleTimeHost,
|
|
21
21
|
isAbleTimeConnected,
|
|
22
22
|
saveAbleTimeConnection
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-E52SQENB.js";
|
|
24
24
|
|
|
25
25
|
// src/integrations/issue-attachments.ts
|
|
26
26
|
import { existsSync, mkdirSync, writeFileSync } from "fs";
|
|
@@ -549,9 +549,12 @@ function issueAttachmentForAbleTimeTask(task) {
|
|
|
549
549
|
].filter(Boolean).join("\n")
|
|
550
550
|
};
|
|
551
551
|
}
|
|
552
|
+
function ableTimeStateIsClosed(state) {
|
|
553
|
+
const value = (state ?? "").trim().toLowerCase();
|
|
554
|
+
return Boolean(value && CLOSED_STATES.has(value));
|
|
555
|
+
}
|
|
552
556
|
function isOpenTask(task) {
|
|
553
|
-
|
|
554
|
-
return !state || !CLOSED_STATES.has(state);
|
|
557
|
+
return !ableTimeStateIsClosed(task.state);
|
|
555
558
|
}
|
|
556
559
|
async function getAbleTimeOrientation(opts) {
|
|
557
560
|
const raw = await callAbleTimeTool("orientation", {}, opts);
|
|
@@ -847,6 +850,7 @@ export {
|
|
|
847
850
|
mapAbleTimeTask,
|
|
848
851
|
toAbleTimeIssueInfo,
|
|
849
852
|
issueAttachmentForAbleTimeTask,
|
|
853
|
+
ableTimeStateIsClosed,
|
|
850
854
|
getAbleTimeOrientation,
|
|
851
855
|
listAbleTimeProjects,
|
|
852
856
|
listAbleTimeTasks,
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
ensureGhPreferOrigin,
|
|
4
4
|
resolveGithubRepoSlug,
|
|
5
5
|
resolveRepoRoot
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-TUJFCJJU.js";
|
|
7
7
|
import {
|
|
8
8
|
allocateTeamName,
|
|
9
9
|
createEmptyThread,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
resolveThreadDefaults,
|
|
30
30
|
resolveViewerProfile,
|
|
31
31
|
resolveViewerProfileForRepo
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-E52SQENB.js";
|
|
33
33
|
import {
|
|
34
34
|
appDataDir,
|
|
35
35
|
globalAgentCwd,
|
|
@@ -155,7 +155,7 @@ function textsFromUnknown(value) {
|
|
|
155
155
|
return "";
|
|
156
156
|
}
|
|
157
157
|
async function abletimeMcpRequest(method, params, opts) {
|
|
158
|
-
const rawToken = opts?.token ?? await import("./abletime-oauth-
|
|
158
|
+
const rawToken = opts?.token ?? await import("./abletime-oauth-2VWQCXGT.js").then((m) => m.ensureAbleTimeAccessToken());
|
|
159
159
|
if (!rawToken?.trim()) {
|
|
160
160
|
throw new Error("AbleTime is not connected \u2014 paste a personal access token in Account settings");
|
|
161
161
|
}
|
|
@@ -226,9 +226,9 @@ async function callAbleTimeTool(name, args = {}, opts) {
|
|
|
226
226
|
if (!opts?.token && !isAbleTimeConnected()) {
|
|
227
227
|
throw new Error("AbleTime is not connected \u2014 paste a personal access token in Account settings");
|
|
228
228
|
}
|
|
229
|
-
const rawToken = opts?.token ?? await import("./abletime-oauth-
|
|
229
|
+
const rawToken = opts?.token ?? await import("./abletime-oauth-2VWQCXGT.js").then((m) => m.ensureAbleTimeAccessToken());
|
|
230
230
|
if (rawToken && ableTimeUsesRest(rawToken)) {
|
|
231
|
-
const { callAbleTimeRestTool } = await import("./abletime-rest-
|
|
231
|
+
const { callAbleTimeRestTool } = await import("./abletime-rest-7NICZYOC.js");
|
|
232
232
|
return callAbleTimeRestTool(name, args, { ...opts, token: rawToken });
|
|
233
233
|
}
|
|
234
234
|
const requestOpts = { ...opts, pm: opts?.pm ?? abletimeToolUsesPm(name) };
|
|
@@ -244,7 +244,7 @@ async function callAbleTimeTool(name, args = {}, opts) {
|
|
|
244
244
|
return await call();
|
|
245
245
|
}
|
|
246
246
|
if (rawToken && ableTimeUsesRest(rawToken) && isAbleTimeRejectedCredential(message)) {
|
|
247
|
-
const { callAbleTimeRestTool } = await import("./abletime-rest-
|
|
247
|
+
const { callAbleTimeRestTool } = await import("./abletime-rest-7NICZYOC.js");
|
|
248
248
|
return callAbleTimeRestTool(name, args, { ...opts, token: rawToken });
|
|
249
249
|
}
|
|
250
250
|
throw err instanceof Error ? new Error(rewriteAbleTimeError(err.message)) : err;
|
|
@@ -32,10 +32,10 @@ import {
|
|
|
32
32
|
tryReservePort,
|
|
33
33
|
tryReservePorts,
|
|
34
34
|
worktreeRunPortsPath
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-ST2UQBJT.js";
|
|
36
36
|
import "./chunk-7Q327QF2.js";
|
|
37
|
-
import "./chunk-
|
|
38
|
-
import "./chunk-
|
|
37
|
+
import "./chunk-YALFZKSC.js";
|
|
38
|
+
import "./chunk-TUJFCJJU.js";
|
|
39
39
|
import "./chunk-YEIHCSZS.js";
|
|
40
40
|
import "./chunk-2P4XKWV2.js";
|
|
41
41
|
import "./chunk-F2PVRF3B.js";
|
|
@@ -43,7 +43,7 @@ import "./chunk-5XNT6BCG.js";
|
|
|
43
43
|
import "./chunk-6K64FJDD.js";
|
|
44
44
|
import "./chunk-LG6RJBIY.js";
|
|
45
45
|
import "./chunk-QVN2WOKJ.js";
|
|
46
|
-
import "./chunk-
|
|
46
|
+
import "./chunk-E52SQENB.js";
|
|
47
47
|
import "./chunk-77WWLBCI.js";
|
|
48
48
|
import {
|
|
49
49
|
stripNestedElectronEnv
|
|
@@ -7,15 +7,15 @@ import {
|
|
|
7
7
|
enrichWorkspacesWithGithub,
|
|
8
8
|
ensureGlobalCoordinatorCwd,
|
|
9
9
|
formatWorkspaceInventory
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-YALFZKSC.js";
|
|
11
|
+
import "./chunk-TUJFCJJU.js";
|
|
12
12
|
import "./chunk-YEIHCSZS.js";
|
|
13
13
|
import "./chunk-2P4XKWV2.js";
|
|
14
14
|
import "./chunk-F2PVRF3B.js";
|
|
15
15
|
import "./chunk-6K64FJDD.js";
|
|
16
16
|
import "./chunk-LG6RJBIY.js";
|
|
17
17
|
import "./chunk-QVN2WOKJ.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-E52SQENB.js";
|
|
19
19
|
import "./chunk-77WWLBCI.js";
|
|
20
20
|
import "./chunk-4TR3HZFT.js";
|
|
21
21
|
import "./chunk-WDRMZKVB.js";
|