@sideboard-ai/core 0.1.318 → 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-KWOBUL46.js → abletime-DVYO4IVS.js} +5 -3
- 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-IUIAGLFJ.js → abletime-oauth-6DTX7LB7.js} +2 -2
- package/dist/{abletime-rest-ORBELZQO.js → abletime-rest-7NICZYOC.js} +2 -2
- package/dist/{abletime-rest-RWN4EPY3.js → abletime-rest-PYQM234B.js} +2 -2
- package/dist/{chunk-XOZNEAWF.js → chunk-5OM7UCTQ.js} +2 -2
- package/dist/{chunk-2HOZMSKQ.js → chunk-AUJ4XB6H.js} +1 -1
- package/dist/{chunk-VZAJVX36.js → chunk-JD7CC6SW.js} +1 -1
- package/dist/{chunk-7ADEYEMH.js → chunk-LXBZQP2Q.js} +4 -4
- package/dist/{chunk-BXTISNKW.js → chunk-OO3R6CS2.js} +216 -64
- package/dist/{chunk-I5CLCWUK.js → chunk-QPLQXWND.js} +8 -4
- package/dist/{chunk-23ZUL2EX.js → chunk-U2N32EA6.js} +216 -64
- package/dist/{chunk-W5QZWAUB.js → chunk-WLZHRNE6.js} +8 -4
- package/dist/{chunk-7SCVGGF6.js → chunk-ZM43NTJJ.js} +4 -4
- package/dist/index.cjs +272 -73
- package/dist/index.d.cts +27 -9
- package/dist/index.d.ts +27 -9
- package/dist/index.js +34 -11
- package/dist/mcp/run-stdio.cjs +240 -63
- package/dist/mcp/run-stdio.js +4 -4
- package/dist/{orchestrator-N54V3B76.js → orchestrator-H3DSZ5RM.js} +1 -1
- package/dist/{orchestrator-2SXK4U65.js → orchestrator-NCA4LSCC.js} +1 -1
- package/package.json +1 -1
package/dist/mcp/run-stdio.cjs
CHANGED
|
@@ -22170,6 +22170,7 @@ var init_abletime_projects = __esm({
|
|
|
22170
22170
|
var abletime_exports = {};
|
|
22171
22171
|
__export(abletime_exports, {
|
|
22172
22172
|
ableTimeDependencyTarget: () => ableTimeDependencyTarget,
|
|
22173
|
+
ableTimeStateIsClosed: () => ableTimeStateIsClosed,
|
|
22173
22174
|
commentAbleTimeTask: () => commentAbleTimeTask,
|
|
22174
22175
|
createAbleTimeTask: () => createAbleTimeTask,
|
|
22175
22176
|
downloadAbleTimeAttachment: () => downloadAbleTimeAttachment,
|
|
@@ -22323,9 +22324,12 @@ function issueAttachmentForAbleTimeTask(task) {
|
|
|
22323
22324
|
].filter(Boolean).join("\n")
|
|
22324
22325
|
};
|
|
22325
22326
|
}
|
|
22327
|
+
function ableTimeStateIsClosed(state) {
|
|
22328
|
+
const value = (state ?? "").trim().toLowerCase();
|
|
22329
|
+
return Boolean(value && CLOSED_STATES.has(value));
|
|
22330
|
+
}
|
|
22326
22331
|
function isOpenTask(task) {
|
|
22327
|
-
|
|
22328
|
-
return !state || !CLOSED_STATES.has(state);
|
|
22332
|
+
return !ableTimeStateIsClosed(task.state);
|
|
22329
22333
|
}
|
|
22330
22334
|
async function getAbleTimeOrientation(opts) {
|
|
22331
22335
|
const raw = await callAbleTimeTool("orientation", {}, opts);
|
|
@@ -23301,6 +23305,9 @@ function writeTurnLive(threadId, progress) {
|
|
|
23301
23305
|
}
|
|
23302
23306
|
}
|
|
23303
23307
|
}
|
|
23308
|
+
function readTurnLiveParts(threadId) {
|
|
23309
|
+
return buffers.get(threadId)?.parts.slice() ?? [];
|
|
23310
|
+
}
|
|
23304
23311
|
function readTurnLive(threadId) {
|
|
23305
23312
|
const path = threadLivePath(threadId);
|
|
23306
23313
|
if (!(0, import_node_fs55.existsSync)(path)) return null;
|
|
@@ -25585,6 +25592,41 @@ var init_expand = __esm({
|
|
|
25585
25592
|
}
|
|
25586
25593
|
});
|
|
25587
25594
|
|
|
25595
|
+
// src/composer/agent-has-replied.ts
|
|
25596
|
+
function joinSteerPrompt(base, addition) {
|
|
25597
|
+
const next = addition.trim();
|
|
25598
|
+
if (!next) return base;
|
|
25599
|
+
const head = base.replace(/\s+$/, "");
|
|
25600
|
+
if (!head) return next;
|
|
25601
|
+
return `${head}
|
|
25602
|
+
${next}`;
|
|
25603
|
+
}
|
|
25604
|
+
function trailingUnansweredUserText(messages) {
|
|
25605
|
+
for (let i = messages.length - 1; i >= 0; i--) {
|
|
25606
|
+
const message = messages[i];
|
|
25607
|
+
if (!message || message.origin === "continue" || message.role === "summary") continue;
|
|
25608
|
+
if (message.role === "agent") {
|
|
25609
|
+
const text7 = (message.text ?? "").trim();
|
|
25610
|
+
if (text7 || (message.parts?.length ?? 0) > 0) return null;
|
|
25611
|
+
continue;
|
|
25612
|
+
}
|
|
25613
|
+
if (message.role === "user") return message.text;
|
|
25614
|
+
}
|
|
25615
|
+
return null;
|
|
25616
|
+
}
|
|
25617
|
+
function livePartsShowAgentReply(parts) {
|
|
25618
|
+
for (const part of parts) {
|
|
25619
|
+
if (part.type === "tool") return true;
|
|
25620
|
+
if ((part.type === "text" || part.type === "thinking") && part.text.trim()) return true;
|
|
25621
|
+
}
|
|
25622
|
+
return false;
|
|
25623
|
+
}
|
|
25624
|
+
var init_agent_has_replied = __esm({
|
|
25625
|
+
"src/composer/agent-has-replied.ts"() {
|
|
25626
|
+
"use strict";
|
|
25627
|
+
}
|
|
25628
|
+
});
|
|
25629
|
+
|
|
25588
25630
|
// src/composer/consume-attachments.ts
|
|
25589
25631
|
function consumeComposerAttachments(thread) {
|
|
25590
25632
|
return {
|
|
@@ -25642,6 +25684,142 @@ var init_consume_attachments = __esm({
|
|
|
25642
25684
|
}
|
|
25643
25685
|
});
|
|
25644
25686
|
|
|
25687
|
+
// src/orchestrator/enqueue-thread-send.ts
|
|
25688
|
+
function resolveSendFollowUp(thread, requested) {
|
|
25689
|
+
if (requested === "steer" || requested === "queue") return requested;
|
|
25690
|
+
return isOrchestratorThread(thread) ? followUpBehavior() : "queue";
|
|
25691
|
+
}
|
|
25692
|
+
function rewriteTrailingUserPrompt(threadId, from, to) {
|
|
25693
|
+
if (from === to) return;
|
|
25694
|
+
const thread = readThread(threadId);
|
|
25695
|
+
if (!thread) return;
|
|
25696
|
+
const messages = thread.messages.slice();
|
|
25697
|
+
for (let i = messages.length - 1; i >= 0; i--) {
|
|
25698
|
+
const message = messages[i];
|
|
25699
|
+
if (!message || message.origin === "continue" || message.role === "summary") continue;
|
|
25700
|
+
if (message.role === "user" && message.text === from) {
|
|
25701
|
+
messages[i] = { ...message, text: to };
|
|
25702
|
+
updateThread(threadId, { messages });
|
|
25703
|
+
}
|
|
25704
|
+
return;
|
|
25705
|
+
}
|
|
25706
|
+
}
|
|
25707
|
+
function reuseJoinedUserBubble(reused, threadId, last, promptText) {
|
|
25708
|
+
return reused.delete(threadId) && last?.role === "user" && last.origin !== "continue" && last.text === promptText;
|
|
25709
|
+
}
|
|
25710
|
+
function promptForJoinedSteer(input) {
|
|
25711
|
+
if (input.latestPrompt === input.promptText) return input.agentPrompt;
|
|
25712
|
+
rewriteTrailingUserPrompt(input.threadId, input.promptText, input.latestPrompt);
|
|
25713
|
+
const { agentPrompt: expandedLatest } = expandComposerPrompt(
|
|
25714
|
+
input.worktreePath,
|
|
25715
|
+
expandCanonicalGitRequest(input.latestPrompt),
|
|
25716
|
+
{ attachments: input.attachments }
|
|
25717
|
+
);
|
|
25718
|
+
return input.expandedPrompt && input.agentPrompt.endsWith(input.expandedPrompt) ? input.agentPrompt.slice(0, -input.expandedPrompt.length) + expandedLatest : `${input.agentPrompt}
|
|
25719
|
+
|
|
25720
|
+
${expandedLatest}`;
|
|
25721
|
+
}
|
|
25722
|
+
function clearSendBookkeeping(host, threadId) {
|
|
25723
|
+
host.crashContinued.delete(threadId);
|
|
25724
|
+
host.jobContinueCount.delete(threadId);
|
|
25725
|
+
host.jobContinueNudged.delete(threadId);
|
|
25726
|
+
host.haltDrain.delete(threadId);
|
|
25727
|
+
}
|
|
25728
|
+
async function enqueueThreadSend(host, threadRef, prompt, opts) {
|
|
25729
|
+
const thread = host.requireThread(threadRef);
|
|
25730
|
+
if (thread.status === "archived") {
|
|
25731
|
+
throw new Error(`Thread is archived: ${thread.id}`);
|
|
25732
|
+
}
|
|
25733
|
+
let shouldSteer = false;
|
|
25734
|
+
const sent = await withThreadLock(thread.id, async () => {
|
|
25735
|
+
const current = host.requireThread(thread.id);
|
|
25736
|
+
if (current.status === "archived") {
|
|
25737
|
+
throw new Error(`Thread is archived: ${thread.id}`);
|
|
25738
|
+
}
|
|
25739
|
+
const followUp = resolveSendFollowUp(current, opts?.followUp);
|
|
25740
|
+
const explicit = opts?.attachments;
|
|
25741
|
+
const consumed = explicit !== void 0 ? { attachments: current.attachments, consumed: explicit } : consumeComposerAttachments(current);
|
|
25742
|
+
const inFlightEarly = host.activeTurns.has(thread.id) || host.startingTurns.has(thread.id) || current.status === "running";
|
|
25743
|
+
const agentHasRepliedEarly = livePartsShowAgentReply(readTurnLiveParts(current.id));
|
|
25744
|
+
const draft = host.openSteerPrompt.get(current.id);
|
|
25745
|
+
const queuedHead = !inFlightEarly && current.status === "queued" && current.queue.length > 0 ? current.queue[0] : null;
|
|
25746
|
+
const unanswered = followUp === "steer" && !agentHasRepliedEarly ? draft?.text ?? (inFlightEarly ? trailingUnansweredUserText(current.messages) : queuedHead) : null;
|
|
25747
|
+
if (unanswered != null && (draft ? !draft.spawned : queuedHead != null)) {
|
|
25748
|
+
clearSendBookkeeping(host, thread.id);
|
|
25749
|
+
const combined = joinSteerPrompt(unanswered, prompt);
|
|
25750
|
+
if (draft && !draft.spawned) {
|
|
25751
|
+
draft.text = combined;
|
|
25752
|
+
rewriteTrailingUserPrompt(current.id, unanswered, combined);
|
|
25753
|
+
} else {
|
|
25754
|
+
const queue = current.queue.slice();
|
|
25755
|
+
queue[0] = combined;
|
|
25756
|
+
const queueAttachments = alignQueueAttachments(queue.length, current.queueAttachments);
|
|
25757
|
+
if (consumed.consumed.length > 0) {
|
|
25758
|
+
queueAttachments[0] = [...queueAttachments[0] ?? [], ...consumed.consumed];
|
|
25759
|
+
}
|
|
25760
|
+
const patch2 = { queue, queueAttachments };
|
|
25761
|
+
if (explicit === void 0 && consumed.consumed.length > 0) {
|
|
25762
|
+
patch2.attachments = consumed.attachments;
|
|
25763
|
+
}
|
|
25764
|
+
updateThread(current.id, patch2);
|
|
25765
|
+
host.emit({ type: "queue_changed", threadId: current.id, queue });
|
|
25766
|
+
}
|
|
25767
|
+
if (thisProcessShouldDrainAgentQueues() && !inFlightEarly) {
|
|
25768
|
+
host.armDrain(current.id);
|
|
25769
|
+
}
|
|
25770
|
+
return host.requireThread(current.id);
|
|
25771
|
+
}
|
|
25772
|
+
const promptToQueue = unanswered != null ? joinSteerPrompt(unanswered, prompt) : prompt;
|
|
25773
|
+
if (unanswered != null) {
|
|
25774
|
+
if (draft) draft.text = promptToQueue;
|
|
25775
|
+
rewriteTrailingUserPrompt(current.id, unanswered, promptToQueue);
|
|
25776
|
+
host.reusedUserPrompt.add(current.id);
|
|
25777
|
+
}
|
|
25778
|
+
const queued = appendQueuedItem(
|
|
25779
|
+
current.queue,
|
|
25780
|
+
current.queueAttachments,
|
|
25781
|
+
promptToQueue,
|
|
25782
|
+
consumed.consumed
|
|
25783
|
+
);
|
|
25784
|
+
clearSendBookkeeping(host, thread.id);
|
|
25785
|
+
const inFlight = host.activeTurns.has(thread.id) || host.startingTurns.has(thread.id) || current.status === "running";
|
|
25786
|
+
shouldSteer = followUp === "steer" && (inFlight || current.queue.length > 0);
|
|
25787
|
+
const patch = queued;
|
|
25788
|
+
if (explicit === void 0 && consumed.consumed.length > 0) {
|
|
25789
|
+
patch.attachments = consumed.attachments;
|
|
25790
|
+
}
|
|
25791
|
+
if (!inFlight) patch.status = "queued";
|
|
25792
|
+
const pid = current.agentPid;
|
|
25793
|
+
if (typeof pid === "number" && pid > 0 && !host.pidAlive(pid)) {
|
|
25794
|
+
patch.agentPid = null;
|
|
25795
|
+
}
|
|
25796
|
+
updateThread(thread.id, patch);
|
|
25797
|
+
host.emit({ type: "queue_changed", threadId: thread.id, queue: queued.queue });
|
|
25798
|
+
if (!inFlight) {
|
|
25799
|
+
host.emit({ type: "status_changed", threadId: thread.id, status: "queued" });
|
|
25800
|
+
}
|
|
25801
|
+
if (thisProcessShouldDrainAgentQueues() && !shouldSteer) {
|
|
25802
|
+
host.armDrain(thread.id);
|
|
25803
|
+
}
|
|
25804
|
+
return host.requireThread(thread.id);
|
|
25805
|
+
});
|
|
25806
|
+
return { thread: sent, shouldSteer };
|
|
25807
|
+
}
|
|
25808
|
+
var init_enqueue_thread_send = __esm({
|
|
25809
|
+
"src/orchestrator/enqueue-thread-send.ts"() {
|
|
25810
|
+
"use strict";
|
|
25811
|
+
init_agent_git_actions();
|
|
25812
|
+
init_agent_has_replied();
|
|
25813
|
+
init_expand();
|
|
25814
|
+
init_consume_attachments();
|
|
25815
|
+
init_desktop_host();
|
|
25816
|
+
init_thread_store();
|
|
25817
|
+
init_turn_live();
|
|
25818
|
+
init_app_settings();
|
|
25819
|
+
init_global_workspace();
|
|
25820
|
+
}
|
|
25821
|
+
});
|
|
25822
|
+
|
|
25645
25823
|
// src/skills/detached-job-path.ts
|
|
25646
25824
|
function compiledModuleDir() {
|
|
25647
25825
|
const cjsDir = typeof __dirname !== "undefined" ? __dirname : "";
|
|
@@ -27385,10 +27563,6 @@ async function waitForPidExit(pid, timeoutMs) {
|
|
|
27385
27563
|
}
|
|
27386
27564
|
return true;
|
|
27387
27565
|
}
|
|
27388
|
-
function resolveSendFollowUp(thread, requested) {
|
|
27389
|
-
if (requested === "steer" || requested === "queue") return requested;
|
|
27390
|
-
return isOrchestratorThread(thread) ? followUpBehavior() : "queue";
|
|
27391
|
-
}
|
|
27392
27566
|
function resolveOrchChildFollowUp(requested) {
|
|
27393
27567
|
if (requested === "steer" || requested === "queue") return requested;
|
|
27394
27568
|
return followUpBehavior();
|
|
@@ -27538,6 +27712,7 @@ var init_orchestrator = __esm({
|
|
|
27538
27712
|
init_read_worktree_tail();
|
|
27539
27713
|
init_discover();
|
|
27540
27714
|
init_expand();
|
|
27715
|
+
init_enqueue_thread_send();
|
|
27541
27716
|
init_consume_attachments();
|
|
27542
27717
|
init_stage_files();
|
|
27543
27718
|
init_context_compact();
|
|
@@ -27555,6 +27730,7 @@ var init_orchestrator = __esm({
|
|
|
27555
27730
|
init_caffeinate_hold();
|
|
27556
27731
|
init_schedule_runner();
|
|
27557
27732
|
init_coordinator_prompt();
|
|
27733
|
+
init_enqueue_thread_send();
|
|
27558
27734
|
LIVE_TURN_SPAWN_GRACE_MS = 15e3;
|
|
27559
27735
|
RUN_SCRIPT_DESKTOP_ADOPT_MS = 2e4;
|
|
27560
27736
|
STALE_AGENT_PID_WAIT_MS = 2500;
|
|
@@ -27566,6 +27742,13 @@ var init_orchestrator = __esm({
|
|
|
27566
27742
|
draining = /* @__PURE__ */ new Set();
|
|
27567
27743
|
/** Threads past setStatus(running) but not yet in activeTurns (spawn in flight). */
|
|
27568
27744
|
startingTurns = /* @__PURE__ */ new Set();
|
|
27745
|
+
/**
|
|
27746
|
+
* Prompt for the turn that has not been answered yet. Steer follow-ups before
|
|
27747
|
+
* any agent output are joined onto this text instead of starting a second bubble.
|
|
27748
|
+
*/
|
|
27749
|
+
openSteerPrompt = /* @__PURE__ */ new Map();
|
|
27750
|
+
/** Next runTurn should keep the user bubble already rewritten to this prompt. */
|
|
27751
|
+
reusedUserPrompt = /* @__PURE__ */ new Set();
|
|
27569
27752
|
/** Last sync thread-file read for false-stop heal (throttled per thread). */
|
|
27570
27753
|
lastReconcileHealAt = /* @__PURE__ */ new Map();
|
|
27571
27754
|
/** Per-repo timestamp of the last `reconcile(repo, { light: true })`. */
|
|
@@ -28176,54 +28359,29 @@ var init_orchestrator = __esm({
|
|
|
28176
28359
|
return thread;
|
|
28177
28360
|
}
|
|
28178
28361
|
async send(threadRef, prompt, opts) {
|
|
28179
|
-
const
|
|
28180
|
-
|
|
28181
|
-
|
|
28182
|
-
|
|
28183
|
-
|
|
28184
|
-
|
|
28185
|
-
|
|
28186
|
-
|
|
28187
|
-
|
|
28188
|
-
|
|
28189
|
-
|
|
28190
|
-
|
|
28191
|
-
|
|
28192
|
-
|
|
28193
|
-
|
|
28194
|
-
|
|
28195
|
-
|
|
28196
|
-
|
|
28197
|
-
|
|
28198
|
-
|
|
28199
|
-
this.
|
|
28200
|
-
this.jobContinueNudged.delete(thread.id);
|
|
28201
|
-
this.haltDrain.delete(thread.id);
|
|
28202
|
-
const inFlight = this.activeTurns.has(thread.id) || this.startingTurns.has(thread.id) || current.status === "running";
|
|
28203
|
-
shouldSteer = followUp === "steer" && (inFlight || current.queue.length > 0);
|
|
28204
|
-
const patch = queued;
|
|
28205
|
-
if (explicit === void 0 && consumed.consumed.length > 0) {
|
|
28206
|
-
patch.attachments = consumed.attachments;
|
|
28207
|
-
}
|
|
28208
|
-
if (!inFlight) patch.status = "queued";
|
|
28209
|
-
const pid = current.agentPid;
|
|
28210
|
-
if (typeof pid === "number" && pid > 0 && !isPidAlive(pid)) {
|
|
28211
|
-
patch.agentPid = null;
|
|
28212
|
-
}
|
|
28213
|
-
updateThread(thread.id, patch);
|
|
28214
|
-
this.emit({ type: "queue_changed", threadId: thread.id, queue: queued.queue });
|
|
28215
|
-
if (!inFlight) {
|
|
28216
|
-
this.emit({ type: "status_changed", threadId: thread.id, status: "queued" });
|
|
28217
|
-
}
|
|
28218
|
-
if (thisProcessShouldDrainAgentQueues() && !shouldSteer) {
|
|
28219
|
-
this.armDrain(thread.id);
|
|
28220
|
-
}
|
|
28221
|
-
return this.requireThread(thread.id);
|
|
28222
|
-
});
|
|
28223
|
-
if (shouldSteer && sent.queue.length > 0) {
|
|
28224
|
-
return this.sendQueuedMessageNow(sent.id, sent.queue.length - 1);
|
|
28362
|
+
const sent = await enqueueThreadSend(
|
|
28363
|
+
{
|
|
28364
|
+
activeTurns: this.activeTurns,
|
|
28365
|
+
startingTurns: this.startingTurns,
|
|
28366
|
+
openSteerPrompt: this.openSteerPrompt,
|
|
28367
|
+
reusedUserPrompt: this.reusedUserPrompt,
|
|
28368
|
+
crashContinued: this.crashContinued,
|
|
28369
|
+
jobContinueCount: this.jobContinueCount,
|
|
28370
|
+
jobContinueNudged: this.jobContinueNudged,
|
|
28371
|
+
haltDrain: this.haltDrain,
|
|
28372
|
+
emit: (event) => this.emit(event),
|
|
28373
|
+
armDrain: (id) => this.armDrain(id),
|
|
28374
|
+
requireThread: (ref) => this.requireThread(ref),
|
|
28375
|
+
pidAlive: (pid) => isPidAlive(pid)
|
|
28376
|
+
},
|
|
28377
|
+
threadRef,
|
|
28378
|
+
prompt,
|
|
28379
|
+
opts
|
|
28380
|
+
);
|
|
28381
|
+
if (sent.shouldSteer && sent.thread.queue.length > 0) {
|
|
28382
|
+
return this.sendQueuedMessageNow(sent.thread.id, sent.thread.queue.length - 1);
|
|
28225
28383
|
}
|
|
28226
|
-
return sent;
|
|
28384
|
+
return sent.thread;
|
|
28227
28385
|
}
|
|
28228
28386
|
async fanOut(threadRefs, prompt, opts) {
|
|
28229
28387
|
const results = [];
|
|
@@ -28380,6 +28538,10 @@ var init_orchestrator = __esm({
|
|
|
28380
28538
|
this.emit({ type: "status_changed", threadId, status: "running" });
|
|
28381
28539
|
this.emit({ type: "turn_started", threadId, prompt });
|
|
28382
28540
|
try {
|
|
28541
|
+
this.openSteerPrompt.set(threadId, {
|
|
28542
|
+
text: typeof prompt === "string" ? prompt : "",
|
|
28543
|
+
spawned: false
|
|
28544
|
+
});
|
|
28383
28545
|
try {
|
|
28384
28546
|
const baseline = await captureTurnBaseline(thread.worktreePath);
|
|
28385
28547
|
if (baseline) this.turnBaselines.set(threadId, baseline);
|
|
@@ -28405,18 +28567,21 @@ var init_orchestrator = __esm({
|
|
|
28405
28567
|
this.emit({ type: "error", threadId, message: `context compact failed: ${message}` });
|
|
28406
28568
|
thread = this.requireThread(threadId);
|
|
28407
28569
|
}
|
|
28408
|
-
const promptText = typeof prompt === "string" ? prompt : "";
|
|
28570
|
+
const promptText = this.openSteerPrompt.get(threadId)?.text ?? (typeof prompt === "string" ? prompt : "");
|
|
28409
28571
|
const autoContinue = isJobContinuePrompt(promptText) || promptText.startsWith("The previous agent process ended before it finished.");
|
|
28410
28572
|
const parked = takePendingTurnAttachments(thread);
|
|
28411
28573
|
const sentAttachments = !autoContinue && parked.length > 0 ? parked : void 0;
|
|
28412
28574
|
if (!autoContinue) clearAgentBlock(threadId);
|
|
28413
|
-
|
|
28414
|
-
|
|
28415
|
-
|
|
28416
|
-
|
|
28417
|
-
|
|
28418
|
-
|
|
28419
|
-
|
|
28575
|
+
const lastShown = this.requireThread(threadId).messages.at(-1);
|
|
28576
|
+
if (!reuseJoinedUserBubble(this.reusedUserPrompt, threadId, lastShown, promptText)) {
|
|
28577
|
+
appendMessage(threadId, {
|
|
28578
|
+
role: "user",
|
|
28579
|
+
text: promptText,
|
|
28580
|
+
...sentAttachments ? { attachments: sentAttachments } : {},
|
|
28581
|
+
...autoContinue ? { origin: "continue" } : {},
|
|
28582
|
+
ts: (/* @__PURE__ */ new Date()).toISOString()
|
|
28583
|
+
});
|
|
28584
|
+
}
|
|
28420
28585
|
if (!autoContinue) {
|
|
28421
28586
|
const live = this.requireThread(threadId);
|
|
28422
28587
|
const stamp = agentPurposeStamp({
|
|
@@ -28615,11 +28780,22 @@ ${formatEnvReminder(projectNameForRepoPath(thread.repoPath || thread.worktreePat
|
|
|
28615
28780
|
].filter(Boolean).join("\n\n---\n\n");
|
|
28616
28781
|
const stderrTail = [];
|
|
28617
28782
|
traceTurn("runTurn.beforeSpawn", { threadId, agent: fresh.agent });
|
|
28783
|
+
const steerDraft = this.openSteerPrompt.get(threadId);
|
|
28784
|
+
if (steerDraft) steerDraft.spawned = true;
|
|
28785
|
+
const promptForAgent = promptForJoinedSteer({
|
|
28786
|
+
threadId,
|
|
28787
|
+
promptText,
|
|
28788
|
+
latestPrompt: steerDraft?.text ?? promptText,
|
|
28789
|
+
agentPrompt,
|
|
28790
|
+
expandedPrompt,
|
|
28791
|
+
worktreePath: fresh.worktreePath,
|
|
28792
|
+
attachments: autoContinue ? [] : sentAttachments ?? []
|
|
28793
|
+
});
|
|
28618
28794
|
const handle = await spawnAgentTurn(
|
|
28619
28795
|
fresh,
|
|
28620
28796
|
{
|
|
28621
28797
|
cachedPrefix,
|
|
28622
|
-
prompt:
|
|
28798
|
+
prompt: promptForAgent,
|
|
28623
28799
|
systemPrompt: turnReminders,
|
|
28624
28800
|
isolateCodexPlugins: fresh.isolateCodexPlugins === true
|
|
28625
28801
|
},
|
|
@@ -28747,7 +28923,7 @@ ${formatEnvReminder(projectNameForRepoPath(thread.repoPath || thread.worktreePat
|
|
|
28747
28923
|
retryThread,
|
|
28748
28924
|
{
|
|
28749
28925
|
cachedPrefix: retryPrefix,
|
|
28750
|
-
prompt:
|
|
28926
|
+
prompt: promptForAgent,
|
|
28751
28927
|
systemPrompt: turnReminders,
|
|
28752
28928
|
isolateCodexPlugins: isolateCodexPluginRetry || retryThread.isolateCodexPlugins === true
|
|
28753
28929
|
},
|
|
@@ -28907,6 +29083,7 @@ ${formatEnvReminder(projectNameForRepoPath(thread.repoPath || thread.worktreePat
|
|
|
28907
29083
|
} finally {
|
|
28908
29084
|
this.startingTurns.delete(threadId);
|
|
28909
29085
|
this.activeTurns.delete(threadId);
|
|
29086
|
+
this.openSteerPrompt.delete(threadId);
|
|
28910
29087
|
this.processes.delete(`${threadId}:agent`);
|
|
28911
29088
|
this.stoppedTurns.delete(threadId);
|
|
28912
29089
|
this.runningCount = Math.max(0, this.runningCount - 1);
|
package/dist/mcp/run-stdio.js
CHANGED
|
@@ -56,7 +56,7 @@ import {
|
|
|
56
56
|
updateSchedule,
|
|
57
57
|
workspaceTagTargetRef,
|
|
58
58
|
writeAgentBlock
|
|
59
|
-
} from "../chunk-
|
|
59
|
+
} from "../chunk-OO3R6CS2.js";
|
|
60
60
|
import "../chunk-LX5R5JOR.js";
|
|
61
61
|
import {
|
|
62
62
|
commentAbleTimeTask,
|
|
@@ -76,9 +76,9 @@ import {
|
|
|
76
76
|
searchAbleTimeTasks,
|
|
77
77
|
toAbleTimeIssueInfo,
|
|
78
78
|
updateAbleTimeTask
|
|
79
|
-
} from "../chunk-
|
|
80
|
-
import "../chunk-
|
|
81
|
-
import "../chunk-
|
|
79
|
+
} from "../chunk-QPLQXWND.js";
|
|
80
|
+
import "../chunk-JD7CC6SW.js";
|
|
81
|
+
import "../chunk-ZM43NTJJ.js";
|
|
82
82
|
import {
|
|
83
83
|
normalizeServiceOrigin
|
|
84
84
|
} from "../chunk-MBYGWNLQ.js";
|