@sideboard-ai/core 0.1.337 → 0.1.339
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/{agents-VTLFLMMT.js → agents-6MSZHZOM.js} +3 -3
- package/dist/{agents-ISEAOZD5.js → agents-QFXIBIKJ.js} +3 -3
- package/dist/{chunk-5MXLDDYF.js → chunk-5KH3EQ2C.js} +7 -0
- package/dist/{chunk-NB4U75TJ.js → chunk-6ABL7HZN.js} +14 -4
- package/dist/{chunk-CDRGQ6GX.js → chunk-BD7QARIJ.js} +5 -3
- package/dist/{chunk-OOXRMTU6.js → chunk-DYUAVL5S.js} +7 -0
- package/dist/{chunk-EKI7D2AJ.js → chunk-ELDHERAD.js} +81 -17
- package/dist/{chunk-MGEUXR6E.js → chunk-EVYOONTE.js} +5 -3
- package/dist/{chunk-PSXBOMXI.js → chunk-EZZY3EAZ.js} +80 -16
- package/dist/{chunk-4O7436ZH.js → chunk-NHLTTT5G.js} +55 -14
- package/dist/{chunk-B6TPN624.js → chunk-PEJ3N5VE.js} +55 -14
- package/dist/{chunk-54GBJC6J.js → chunk-VHHEQP5V.js} +14 -4
- package/dist/{conductor-JH26KU3W.js → conductor-AUUXCJZT.js} +3 -3
- package/dist/{conductor-77L3QTZ2.js → conductor-LEPTWN2U.js} +3 -3
- package/dist/{coordinator-prompt-WVVC2TLP.js → coordinator-prompt-CIWWP2P6.js} +1 -1
- package/dist/{coordinator-prompt-UKJJAMBG.js → coordinator-prompt-VO42IZWS.js} +1 -1
- package/dist/{global-workspace-B5IHENCP.js → global-workspace-FKXLFKYX.js} +1 -1
- package/dist/{global-workspace-QDIPRW6G.js → global-workspace-MCAREQI7.js} +1 -1
- package/dist/index.cjs +2530 -1016
- package/dist/index.d.cts +273 -8
- package/dist/index.d.ts +273 -8
- package/dist/index.js +1541 -216
- package/dist/mcp/run-stdio.cjs +1469 -182
- package/dist/mcp/run-stdio.js +1294 -152
- package/dist/{orchestrator-BOLYQZO7.js → orchestrator-JTFCNXVR.js} +5 -5
- package/dist/{orchestrator-ZUIU667R.js → orchestrator-NOQDMYLB.js} +5 -5
- package/dist/{workspaces-VXE2MBKD.js → workspaces-D6FQCZRK.js} +1 -1
- package/dist/{workspaces-WZZNNUJL.js → workspaces-Y25L2EPV.js} +1 -1
- 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-VHHEQP5V.js";
|
|
18
18
|
import {
|
|
19
19
|
applyWorktreePkgCacheEnv,
|
|
20
20
|
askBlockStillWaiting,
|
|
@@ -39,6 +39,7 @@ import {
|
|
|
39
39
|
listRunningDetachedJobs,
|
|
40
40
|
maybeCompactContext,
|
|
41
41
|
mergeWorktreeActiveRuns,
|
|
42
|
+
orchestratorPromisedLaterReport,
|
|
42
43
|
parsePlanQuestionsInput,
|
|
43
44
|
planJobContinue,
|
|
44
45
|
planQuestionsSignature,
|
|
@@ -53,7 +54,7 @@ import {
|
|
|
53
54
|
worktreeDevProcessKey,
|
|
54
55
|
worktreeRunProcessKey,
|
|
55
56
|
worktreeSetupProcessKey
|
|
56
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-NHLTTT5G.js";
|
|
57
58
|
import {
|
|
58
59
|
applyAgentEvent,
|
|
59
60
|
clipAgentEventForPaint,
|
|
@@ -80,7 +81,7 @@ import {
|
|
|
80
81
|
summarizeTurnStderr,
|
|
81
82
|
toolDescription,
|
|
82
83
|
turnFailChatText
|
|
83
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-5KH3EQ2C.js";
|
|
84
85
|
import {
|
|
85
86
|
titleFromPrompt
|
|
86
87
|
} from "./chunk-LX5R5JOR.js";
|
|
@@ -118,7 +119,7 @@ import {
|
|
|
118
119
|
stageAbsolutePathsAsAttachments,
|
|
119
120
|
stageBuffersAsAttachments,
|
|
120
121
|
syncWorkspacesFromThreads
|
|
121
|
-
} from "./chunk-
|
|
122
|
+
} from "./chunk-EVYOONTE.js";
|
|
122
123
|
import {
|
|
123
124
|
addPrStackLayer,
|
|
124
125
|
allocateTeamSlug,
|
|
@@ -561,9 +562,9 @@ async function spawnAgentTurn(thread, input, onEvent) {
|
|
|
561
562
|
`Cannot spawn ${thread.agent}: thread ${thread.id} has no worktreePath`
|
|
562
563
|
);
|
|
563
564
|
}
|
|
564
|
-
const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-
|
|
565
|
+
const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-FKXLFKYX.js");
|
|
565
566
|
if (isGlobalThread2(thread)) {
|
|
566
|
-
const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-
|
|
567
|
+
const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-CIWWP2P6.js");
|
|
567
568
|
ensureGlobalCoordinatorCwd2(
|
|
568
569
|
isOrchestratorThread(thread) ? { orchestratorThreadId: thread.id } : void 0
|
|
569
570
|
);
|
|
@@ -2133,6 +2134,69 @@ function notifyParentOfChildHalt(child, status, send) {
|
|
|
2133
2134
|
return true;
|
|
2134
2135
|
}
|
|
2135
2136
|
|
|
2137
|
+
// src/orchestrator/child-report.ts
|
|
2138
|
+
var MAX_REPORT_WAKES = 2;
|
|
2139
|
+
var sentForReply = /* @__PURE__ */ new Set();
|
|
2140
|
+
var wakesByParent = /* @__PURE__ */ new Map();
|
|
2141
|
+
function clearParentReportWake(parentId) {
|
|
2142
|
+
wakesByParent.delete(parentId);
|
|
2143
|
+
const prefix = `${parentId}:`;
|
|
2144
|
+
for (const key of sentForReply) {
|
|
2145
|
+
if (key.startsWith(prefix)) sentForReply.delete(key);
|
|
2146
|
+
}
|
|
2147
|
+
}
|
|
2148
|
+
function parentOwesDeferredReport(parent) {
|
|
2149
|
+
if (!parent || parent.status === "archived") return false;
|
|
2150
|
+
if (!isOrchestratorThread(parent)) return false;
|
|
2151
|
+
if (parent.status !== "idle") return false;
|
|
2152
|
+
if (parent.queue.length > 0) return false;
|
|
2153
|
+
const last = lastAgentReply(parent.messages);
|
|
2154
|
+
return orchestratorPromisedLaterReport(last?.text);
|
|
2155
|
+
}
|
|
2156
|
+
function childFinishedReportPrompt(child) {
|
|
2157
|
+
const title = child.title?.trim() || "Untitled";
|
|
2158
|
+
const link = `[${title}](sideboard://chat/${child.id})`;
|
|
2159
|
+
return [
|
|
2160
|
+
`Sideboard: child worktree ${link} finished (status=idle).`,
|
|
2161
|
+
"You told the user you would report later. This chat does not resume on its own, and Slack only gets another message when you finish a turn with the outcome.",
|
|
2162
|
+
"Read get_turn_result for this child and any siblings. If any are still running (stillRunning true), loop wait_for_turn until they finish.",
|
|
2163
|
+
"Then reply with the outcome. Do not promise a later update.",
|
|
2164
|
+
"This is information \u2014 not a new user request."
|
|
2165
|
+
].join("\n");
|
|
2166
|
+
}
|
|
2167
|
+
function replyKey(parent) {
|
|
2168
|
+
const last = lastAgentReply(parent.messages);
|
|
2169
|
+
if (!last) return null;
|
|
2170
|
+
return `${parent.id}:${last.ts}`;
|
|
2171
|
+
}
|
|
2172
|
+
function notifyParentOfChildReport(child, send) {
|
|
2173
|
+
if (!child.parentThreadId) return false;
|
|
2174
|
+
const parent = readThread(child.parentThreadId);
|
|
2175
|
+
if (!parentOwesDeferredReport(parent)) return false;
|
|
2176
|
+
const key = replyKey(parent);
|
|
2177
|
+
if (!key || sentForReply.has(key)) return false;
|
|
2178
|
+
const wakes = wakesByParent.get(parent.id) ?? 0;
|
|
2179
|
+
if (wakes >= MAX_REPORT_WAKES) return false;
|
|
2180
|
+
sentForReply.add(key);
|
|
2181
|
+
wakesByParent.set(parent.id, wakes + 1);
|
|
2182
|
+
const parentId = parent.id;
|
|
2183
|
+
void send(parentId, childFinishedReportPrompt(child)).catch(() => {
|
|
2184
|
+
sentForReply.delete(key);
|
|
2185
|
+
const current = wakesByParent.get(parentId) ?? 1;
|
|
2186
|
+
if (current <= 1) wakesByParent.delete(parentId);
|
|
2187
|
+
else wakesByParent.set(parentId, current - 1);
|
|
2188
|
+
});
|
|
2189
|
+
return true;
|
|
2190
|
+
}
|
|
2191
|
+
function settleChildReportAfterTurn(thread, chatText, send) {
|
|
2192
|
+
if (!thread) return;
|
|
2193
|
+
if (isOrchestratorThread(thread)) {
|
|
2194
|
+
if (!orchestratorPromisedLaterReport(chatText)) clearParentReportWake(thread.id);
|
|
2195
|
+
return;
|
|
2196
|
+
}
|
|
2197
|
+
notifyParentOfChildReport(thread, send);
|
|
2198
|
+
}
|
|
2199
|
+
|
|
2136
2200
|
// src/orchestrator/stop-reason.ts
|
|
2137
2201
|
var STOP_REASON_MAX = 500;
|
|
2138
2202
|
function resolveStopReason(opts) {
|
|
@@ -2816,7 +2880,7 @@ function assembleHomeBoard(input) {
|
|
|
2816
2880
|
}
|
|
2817
2881
|
return { columns, hidden, totals };
|
|
2818
2882
|
}
|
|
2819
|
-
var HOME_BOARD_AGENT_HINT = "Home is a Kanban of workspaces (one card per checkout; sibling chats on a card are separate agents). Do not create a second workspace for a ticket, PR, or named branch that already has a live checkout \u2014 create_workspace / start_board_card return that checkout (alreadyStarted) and its chats. Add another agent with fork_chat. Creating from the default branch still opens a new isolated workspace.
|
|
2883
|
+
var HOME_BOARD_AGENT_HINT = "Home is a Kanban of workspaces (one card per checkout; sibling chats on a card are separate agents). Do not create a second workspace for a ticket, PR, or named branch that already has a live checkout \u2014 create_workspace / start_board_card return that checkout (alreadyStarted) and its chats. Add another agent with fork_chat. Creating from the default branch still opens a new isolated workspace. Stages are the path to merge: New (no PR) \u2192 Draft (draft PR) \u2192 Review (open PR) \u2192 Approved (approved, not merged) \u2192 Merged. ownership=mine is PRs you authored (or WIP with no PR); ownership=reviewing is someone else's PR (or a review-requested checkout). Viewer login comes from gh, not a setting. Archive removes the card to Settings \u2192 History (list_archive to browse, restore_workspace to bring it back). Queued/running are activity on the card, not stages. blockedReason means an agent on that card is waiting on a person (the question, plan approval, or a reported block) \u2014 read it and do not send_to_chat a check-in. issueBlockedBy, when present, lists issues blocking that workspace's source ticket (the tracker dependency, not a person). Orchestration chats stay in the sidebar. Do not invent status.";
|
|
2820
2884
|
|
|
2821
2885
|
// src/threads/workspace-tags.ts
|
|
2822
2886
|
function workspaceTagTargetRef(opts) {
|
|
@@ -3864,7 +3928,7 @@ async function adoptThread(input) {
|
|
|
3864
3928
|
messages: input.messages ?? []
|
|
3865
3929
|
});
|
|
3866
3930
|
writeThread(thread);
|
|
3867
|
-
const { addWorkspace: addWorkspace2 } = await import("./workspaces-
|
|
3931
|
+
const { addWorkspace: addWorkspace2 } = await import("./workspaces-D6FQCZRK.js");
|
|
3868
3932
|
await addWorkspace2(repoPath);
|
|
3869
3933
|
const { ensureWorktreeSideboardIgnored } = await import("./worktree-exclude-KMZQXZKP.js");
|
|
3870
3934
|
await ensureWorktreeSideboardIgnored(input.worktreePath);
|
|
@@ -6266,11 +6330,14 @@ function formatWorktreeDirective(thread, opts) {
|
|
|
6266
6330
|
lines.push(formatDevAccessHint(opts?.activeRuns));
|
|
6267
6331
|
lines.push("");
|
|
6268
6332
|
lines.push(
|
|
6269
|
-
"Automations (sidebar, after Board): `create_schedule` / `list_schedules` (`at` / `every` / `cron` / `time`+`days`). `archiveChat=false` keeps the new chat. `chatId=self` is removed when this chat is archived. Fires only while Sideboard.app is running.
|
|
6333
|
+
"Automations (sidebar, after Board): `create_schedule` / `list_schedules` (`at` / `every` / `cron` / `time`+`days`). `archiveChat=false` keeps the new chat. `chatId=self` is removed when this chat is archived. Fires only while Sideboard.app is running. Future jobs turn on Caffeinate."
|
|
6270
6334
|
);
|
|
6271
6335
|
lines.push(
|
|
6272
6336
|
"`set_workspace_tags` labels this checkout (omit ref; replace, add, or remove). Not another checkout."
|
|
6273
6337
|
);
|
|
6338
|
+
lines.push(
|
|
6339
|
+
"Orchestration: `show_plan` opens the diagram and plan.md. `list_order` / `set_dependency`"
|
|
6340
|
+
);
|
|
6274
6341
|
lines.push("");
|
|
6275
6342
|
lines.push(formatProcessGuideDirective({ worktreePath: thread.worktreePath }));
|
|
6276
6343
|
return lines.join("\n");
|
|
@@ -6818,7 +6885,7 @@ function formatScheduledPrompt(name, prompt) {
|
|
|
6818
6885
|
${prompt}`;
|
|
6819
6886
|
}
|
|
6820
6887
|
async function defaultDeps() {
|
|
6821
|
-
const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-
|
|
6888
|
+
const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-JTFCNXVR.js");
|
|
6822
6889
|
const orch = getOrchestrator2();
|
|
6823
6890
|
return {
|
|
6824
6891
|
findThread: (id) => findThreadByRef(id),
|
|
@@ -7484,11 +7551,7 @@ var Orchestrator = class {
|
|
|
7484
7551
|
this.emit({ type: "queue_changed", threadId, queue: next.queue });
|
|
7485
7552
|
this.haltDrain.delete(threadId);
|
|
7486
7553
|
}
|
|
7487
|
-
/**
|
|
7488
|
-
* Worktree agent ended the turn after “I’ll let you know” (or left a
|
|
7489
|
-
* detached test/pack job running). Queue a continue so the chat does not
|
|
7490
|
-
* go idle with nobody watching the log.
|
|
7491
|
-
*/
|
|
7554
|
+
/** Queue a continue when a turn promised a later report or left a detached job running. */
|
|
7492
7555
|
maybeEnqueueJobContinue(threadId, chatText, parts = []) {
|
|
7493
7556
|
if (this.haltDrain.has(threadId)) return;
|
|
7494
7557
|
const thread = readThread(threadId);
|
|
@@ -7885,7 +7948,7 @@ var Orchestrator = class {
|
|
|
7885
7948
|
goal: thread.sourceRef || thread.title
|
|
7886
7949
|
}),
|
|
7887
7950
|
slackInbound ? [
|
|
7888
|
-
"This turn is a Slack DM or @mention. Your reply is posted back in Slack \u2014 keep it concise. Sideboard signs it with this Mac's destination name; do not prefix the name yourself.",
|
|
7951
|
+
"This turn is a Slack DM or @mention. Your reply is posted back in Slack \u2014 keep it concise. Sideboard signs it with this Mac's destination name; do not prefix the name yourself. Do not end the turn by saying you will get back to them. If a child is still running, loop wait_for_turn until stillRunning is false, then reply with the outcome. If the agents are already idle, read get_turn_result and reply now. Ending the turn does not send a later Slack message.",
|
|
7889
7952
|
SLACK_REPLY_FORMATTING
|
|
7890
7953
|
].join("\n") : null
|
|
7891
7954
|
].filter(Boolean).join("\n") : null;
|
|
@@ -8292,6 +8355,7 @@ ${formatEnvReminder(projectNameForRepoPath(thread.repoPath || thread.worktreePat
|
|
|
8292
8355
|
if (exitCode === 0) {
|
|
8293
8356
|
this.crashContinued.delete(threadId);
|
|
8294
8357
|
this.maybeEnqueueJobContinue(threadId, chatText, parts);
|
|
8358
|
+
settleChildReportAfterTurn(readThread(threadId), chatText, (id, prompt2) => this.send(id, prompt2));
|
|
8295
8359
|
} else {
|
|
8296
8360
|
const blob = [chatText, detail].filter(Boolean).join("\n");
|
|
8297
8361
|
const failedOver = await isolateQuotaFailover(
|
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
compactSummaryPart,
|
|
6
6
|
isInternalAgentStatusText,
|
|
7
7
|
lastAssistantMessageText
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-5KH3EQ2C.js";
|
|
9
9
|
import {
|
|
10
10
|
isCloudCoordinatorThread,
|
|
11
11
|
isGlobalThread,
|
|
12
12
|
isOrchestratorThread,
|
|
13
13
|
isSlackCoordinatorThread
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-EVYOONTE.js";
|
|
15
15
|
import {
|
|
16
16
|
mergeAgentGitAuthEnv,
|
|
17
17
|
resolveAgentGitAuthEnv
|
|
@@ -1368,11 +1368,55 @@ function waitForTurnToolResult(input) {
|
|
|
1368
1368
|
};
|
|
1369
1369
|
}
|
|
1370
1370
|
|
|
1371
|
+
// src/orchestrator/deferred-report.ts
|
|
1372
|
+
var DEFERRED_DONE_MAX_CHARS = 480;
|
|
1373
|
+
function looksLikeDeferredDonePromise(text) {
|
|
1374
|
+
const t = (text ?? "").trim();
|
|
1375
|
+
if (!t || t.length > DEFERRED_DONE_MAX_CHARS) return false;
|
|
1376
|
+
const unquoted = t.replace(/`[^`]*`/g, " ").replace(/["“”][^"“”]*["“”]/g, " ").replace(/\s+/g, " ").trim();
|
|
1377
|
+
if (!unquoted) return false;
|
|
1378
|
+
return /\b(i['’]?ll|i will)\s+let you know\b/i.test(unquoted) || /\blet you know when\b/i.test(unquoted) || /\b(check back|ping me)\s+when\b/i.test(unquoted) || /\bi(?:['’]ll| will)\s+(report|update you)\s+when\b/i.test(unquoted) || /\bwill notify (?:me|you) when\b/i.test(unquoted) || /\bi(?:['’]ll| will) be notified when\b/i.test(unquoted) || /\bi(?:['’]ll| will)\s+(?:keep|continue)\s+(?:watching|waiting|polling|checking)\b/i.test(
|
|
1379
|
+
unquoted
|
|
1380
|
+
) || /\bi(?:['’]ll| will)\s+come back (?:when|with|once|later)\b/i.test(unquoted) || /\bi(?:['’]ll| will)\s+get back\b/i.test(unquoted) || /\bget back to (?:you|me)\b/i.test(unquoted) || /\bi(?:['’]ll| will)\s+(?:follow up|report back|circle back|check back)\b/i.test(unquoted) || /\bi(?:['’]ll| will)\s+reply (?:when|once|later|after|shortly)\b/i.test(unquoted) || /\bi(?:['’]ll| will)\s+ping you\b/i.test(unquoted) || /\bi(?:['’]ll| will)\s+ping when\b/i.test(unquoted) || /\bi(?:['’]ll| will)\s+(?:message|dm|slack) you when\b/i.test(unquoted);
|
|
1381
|
+
}
|
|
1382
|
+
function orchestratorPromisedLaterReport(text) {
|
|
1383
|
+
if (looksLikeDeferredDonePromise(text)) return true;
|
|
1384
|
+
const t = (text ?? "").trim();
|
|
1385
|
+
if (!t || t.length <= DEFERRED_DONE_MAX_CHARS) return false;
|
|
1386
|
+
const lines = t.split("\n").map((line) => line.trim()).filter(Boolean);
|
|
1387
|
+
const closing = [];
|
|
1388
|
+
let size = 0;
|
|
1389
|
+
for (let i = lines.length - 1; i >= 0; i--) {
|
|
1390
|
+
const line = lines[i];
|
|
1391
|
+
if (closing.length === 0 && line.length > DEFERRED_DONE_MAX_CHARS) {
|
|
1392
|
+
closing.push(line.slice(-DEFERRED_DONE_MAX_CHARS));
|
|
1393
|
+
break;
|
|
1394
|
+
}
|
|
1395
|
+
if (closing.length > 0 && size + line.length + 1 > DEFERRED_DONE_MAX_CHARS) break;
|
|
1396
|
+
closing.unshift(line);
|
|
1397
|
+
size += line.length + 1;
|
|
1398
|
+
if (closing.length >= 4) break;
|
|
1399
|
+
}
|
|
1400
|
+
const slice = closing.join("\n");
|
|
1401
|
+
if (!slice || slice === t) return false;
|
|
1402
|
+
return looksLikeDeferredDonePromise(slice);
|
|
1403
|
+
}
|
|
1404
|
+
function formatOrchestratorDeferredContinuePrompt() {
|
|
1405
|
+
return [
|
|
1406
|
+
"You ended the turn after promising to report later.",
|
|
1407
|
+
"This chat does not resume on its own. Slack and the desktop only see a reply when you finish a turn with the outcome.",
|
|
1408
|
+
"list_chats for the child agents on this orchestration chat.",
|
|
1409
|
+
"If any child is still running (taskState submitted or working, stillRunning true), loop wait_for_turn until stillRunning is false, then read get_turn_result.",
|
|
1410
|
+
"If every child is already idle, read get_turn_result now. Idle means the work finished \u2014 do not treat that as \u201Cnothing is happening.\u201D",
|
|
1411
|
+
"Then reply with what happened. Do not promise a later update.",
|
|
1412
|
+
"If you have not started the work yet, start it in this turn and wait until it finishes before you reply."
|
|
1413
|
+
].join(" ");
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1371
1416
|
// src/mcp/wait-for-job.ts
|
|
1372
1417
|
var MAX_JOB_CONTINUES = 8;
|
|
1373
1418
|
var MAX_JOB_DELTA_LINES = 80;
|
|
1374
1419
|
var MAX_JOB_DELTA_CHARS = 4e3;
|
|
1375
|
-
var DEFERRED_DONE_MAX_CHARS = 480;
|
|
1376
1420
|
var GH_WATCH_REFRESH = "Refreshing run status every 3 seconds.";
|
|
1377
1421
|
var MCP_WAIT_JOB_STILL_RUNNING_HINT = "Job is still running. The type=log pane already appended this delta. Call wait_for_job again. If it is hanging, producing no useful output, or doing the wrong thing, call stop_job (same id) instead of looping forever. Do not end the turn or tell the user you will let them know later.";
|
|
1378
1422
|
var MCP_STOP_JOB_HINT = "Stopped. The type=log pane is status=failed with the last delta. Do not wait again unless you start a new command.";
|
|
@@ -1422,15 +1466,6 @@ function listRunningDetachedJobs(worktreePath) {
|
|
|
1422
1466
|
}
|
|
1423
1467
|
return running.sort();
|
|
1424
1468
|
}
|
|
1425
|
-
function looksLikeDeferredDonePromise(text) {
|
|
1426
|
-
const t = (text ?? "").trim();
|
|
1427
|
-
if (!t || t.length > DEFERRED_DONE_MAX_CHARS) return false;
|
|
1428
|
-
const unquoted = t.replace(/`[^`]*`/g, " ").replace(/["“”][^"“”]*["“”]/g, " ").replace(/\s+/g, " ").trim();
|
|
1429
|
-
if (!unquoted) return false;
|
|
1430
|
-
return /\b(i['’]?ll|i will)\s+let you know\b/i.test(unquoted) || /\blet you know when\b/i.test(unquoted) || /\b(check back|ping me)\s+when\b/i.test(unquoted) || /\bi(?:['’]ll| will)\s+(report|update you)\s+when\b/i.test(unquoted) || /\bwill notify (?:me|you) when\b/i.test(unquoted) || /\bi(?:['’]ll| will) be notified when\b/i.test(unquoted) || /\bi(?:['’]ll| will)\s+(?:keep|continue)\s+(?:watching|waiting|polling|checking)\b/i.test(
|
|
1431
|
-
unquoted
|
|
1432
|
-
) || /\bi(?:['’]ll| will)\s+come back when\b/i.test(unquoted);
|
|
1433
|
-
}
|
|
1434
1469
|
function isJobContinuePrompt(text) {
|
|
1435
1470
|
if (typeof text !== "string") return false;
|
|
1436
1471
|
const t = text.trim();
|
|
@@ -1485,10 +1520,15 @@ function turnWatchedDetachedJob(parts) {
|
|
|
1485
1520
|
});
|
|
1486
1521
|
}
|
|
1487
1522
|
function planJobContinue(opts) {
|
|
1488
|
-
if (opts.isOrchestrator) return { action: "none" };
|
|
1489
1523
|
if (opts.agent === "brightsy") return { action: "none" };
|
|
1490
1524
|
if (opts.queueLength > 0) return { action: "none" };
|
|
1491
1525
|
if (opts.continueCount >= MAX_JOB_CONTINUES) return { action: "none" };
|
|
1526
|
+
if (opts.isOrchestrator) {
|
|
1527
|
+
if (orchestratorPromisedLaterReport(opts.chatText) && !opts.alreadyNudged) {
|
|
1528
|
+
return { action: "nudge", prompt: formatOrchestratorDeferredContinuePrompt() };
|
|
1529
|
+
}
|
|
1530
|
+
return { action: "none" };
|
|
1531
|
+
}
|
|
1492
1532
|
const farewell = looksLikeDeferredDonePromise(opts.chatText);
|
|
1493
1533
|
if (opts.runningJobIds.length > 0 && (farewell || opts.watchedJob)) {
|
|
1494
1534
|
return {
|
|
@@ -1696,7 +1736,7 @@ var PORT_RANGE_SIZE = 10;
|
|
|
1696
1736
|
var RECLAIM_RETRY_DELAY_MS = 40;
|
|
1697
1737
|
var RECLAIM_TRIES = 8;
|
|
1698
1738
|
async function killReclaimable(ports, worktreePath, signal) {
|
|
1699
|
-
const { killListenersOnPorts: killListenersOnPorts2, killStaleWorktreeListeners: killStaleWorktreeListeners2 } = await import("./conductor-
|
|
1739
|
+
const { killListenersOnPorts: killListenersOnPorts2, killStaleWorktreeListeners: killStaleWorktreeListeners2 } = await import("./conductor-LEPTWN2U.js");
|
|
1700
1740
|
if (worktreePath) killStaleWorktreeListeners2(ports, worktreePath, signal);
|
|
1701
1741
|
else killListenersOnPorts2(ports);
|
|
1702
1742
|
}
|
|
@@ -2410,6 +2450,7 @@ export {
|
|
|
2410
2450
|
worktreeRunPortsPath,
|
|
2411
2451
|
loadWorktreeRunPorts,
|
|
2412
2452
|
saveWorktreeRunPorts,
|
|
2453
|
+
orchestratorPromisedLaterReport,
|
|
2413
2454
|
mcpWaitForJobTimeoutMs,
|
|
2414
2455
|
listRunningDetachedJobs,
|
|
2415
2456
|
isJobContinuePrompt,
|
|
@@ -2,13 +2,13 @@ import {
|
|
|
2
2
|
compactSummaryPart,
|
|
3
3
|
isInternalAgentStatusText,
|
|
4
4
|
lastAssistantMessageText
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-DYUAVL5S.js";
|
|
6
6
|
import {
|
|
7
7
|
isCloudCoordinatorThread,
|
|
8
8
|
isGlobalThread,
|
|
9
9
|
isOrchestratorThread,
|
|
10
10
|
isSlackCoordinatorThread
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-BD7QARIJ.js";
|
|
12
12
|
import {
|
|
13
13
|
mergeAgentGitAuthEnv,
|
|
14
14
|
resolveAgentGitAuthEnv
|
|
@@ -1336,11 +1336,55 @@ function waitForTurnToolResult(input) {
|
|
|
1336
1336
|
};
|
|
1337
1337
|
}
|
|
1338
1338
|
|
|
1339
|
+
// src/orchestrator/deferred-report.ts
|
|
1340
|
+
var DEFERRED_DONE_MAX_CHARS = 480;
|
|
1341
|
+
function looksLikeDeferredDonePromise(text) {
|
|
1342
|
+
const t = (text ?? "").trim();
|
|
1343
|
+
if (!t || t.length > DEFERRED_DONE_MAX_CHARS) return false;
|
|
1344
|
+
const unquoted = t.replace(/`[^`]*`/g, " ").replace(/["“”][^"“”]*["“”]/g, " ").replace(/\s+/g, " ").trim();
|
|
1345
|
+
if (!unquoted) return false;
|
|
1346
|
+
return /\b(i['’]?ll|i will)\s+let you know\b/i.test(unquoted) || /\blet you know when\b/i.test(unquoted) || /\b(check back|ping me)\s+when\b/i.test(unquoted) || /\bi(?:['’]ll| will)\s+(report|update you)\s+when\b/i.test(unquoted) || /\bwill notify (?:me|you) when\b/i.test(unquoted) || /\bi(?:['’]ll| will) be notified when\b/i.test(unquoted) || /\bi(?:['’]ll| will)\s+(?:keep|continue)\s+(?:watching|waiting|polling|checking)\b/i.test(
|
|
1347
|
+
unquoted
|
|
1348
|
+
) || /\bi(?:['’]ll| will)\s+come back (?:when|with|once|later)\b/i.test(unquoted) || /\bi(?:['’]ll| will)\s+get back\b/i.test(unquoted) || /\bget back to (?:you|me)\b/i.test(unquoted) || /\bi(?:['’]ll| will)\s+(?:follow up|report back|circle back|check back)\b/i.test(unquoted) || /\bi(?:['’]ll| will)\s+reply (?:when|once|later|after|shortly)\b/i.test(unquoted) || /\bi(?:['’]ll| will)\s+ping you\b/i.test(unquoted) || /\bi(?:['’]ll| will)\s+ping when\b/i.test(unquoted) || /\bi(?:['’]ll| will)\s+(?:message|dm|slack) you when\b/i.test(unquoted);
|
|
1349
|
+
}
|
|
1350
|
+
function orchestratorPromisedLaterReport(text) {
|
|
1351
|
+
if (looksLikeDeferredDonePromise(text)) return true;
|
|
1352
|
+
const t = (text ?? "").trim();
|
|
1353
|
+
if (!t || t.length <= DEFERRED_DONE_MAX_CHARS) return false;
|
|
1354
|
+
const lines = t.split("\n").map((line) => line.trim()).filter(Boolean);
|
|
1355
|
+
const closing = [];
|
|
1356
|
+
let size = 0;
|
|
1357
|
+
for (let i = lines.length - 1; i >= 0; i--) {
|
|
1358
|
+
const line = lines[i];
|
|
1359
|
+
if (closing.length === 0 && line.length > DEFERRED_DONE_MAX_CHARS) {
|
|
1360
|
+
closing.push(line.slice(-DEFERRED_DONE_MAX_CHARS));
|
|
1361
|
+
break;
|
|
1362
|
+
}
|
|
1363
|
+
if (closing.length > 0 && size + line.length + 1 > DEFERRED_DONE_MAX_CHARS) break;
|
|
1364
|
+
closing.unshift(line);
|
|
1365
|
+
size += line.length + 1;
|
|
1366
|
+
if (closing.length >= 4) break;
|
|
1367
|
+
}
|
|
1368
|
+
const slice = closing.join("\n");
|
|
1369
|
+
if (!slice || slice === t) return false;
|
|
1370
|
+
return looksLikeDeferredDonePromise(slice);
|
|
1371
|
+
}
|
|
1372
|
+
function formatOrchestratorDeferredContinuePrompt() {
|
|
1373
|
+
return [
|
|
1374
|
+
"You ended the turn after promising to report later.",
|
|
1375
|
+
"This chat does not resume on its own. Slack and the desktop only see a reply when you finish a turn with the outcome.",
|
|
1376
|
+
"list_chats for the child agents on this orchestration chat.",
|
|
1377
|
+
"If any child is still running (taskState submitted or working, stillRunning true), loop wait_for_turn until stillRunning is false, then read get_turn_result.",
|
|
1378
|
+
"If every child is already idle, read get_turn_result now. Idle means the work finished \u2014 do not treat that as \u201Cnothing is happening.\u201D",
|
|
1379
|
+
"Then reply with what happened. Do not promise a later update.",
|
|
1380
|
+
"If you have not started the work yet, start it in this turn and wait until it finishes before you reply."
|
|
1381
|
+
].join(" ");
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1339
1384
|
// src/mcp/wait-for-job.ts
|
|
1340
1385
|
var MAX_JOB_CONTINUES = 8;
|
|
1341
1386
|
var MAX_JOB_DELTA_LINES = 80;
|
|
1342
1387
|
var MAX_JOB_DELTA_CHARS = 4e3;
|
|
1343
|
-
var DEFERRED_DONE_MAX_CHARS = 480;
|
|
1344
1388
|
var GH_WATCH_REFRESH = "Refreshing run status every 3 seconds.";
|
|
1345
1389
|
var MCP_WAIT_JOB_STILL_RUNNING_HINT = "Job is still running. The type=log pane already appended this delta. Call wait_for_job again. If it is hanging, producing no useful output, or doing the wrong thing, call stop_job (same id) instead of looping forever. Do not end the turn or tell the user you will let them know later.";
|
|
1346
1390
|
var MCP_STOP_JOB_HINT = "Stopped. The type=log pane is status=failed with the last delta. Do not wait again unless you start a new command.";
|
|
@@ -1390,15 +1434,6 @@ function listRunningDetachedJobs(worktreePath) {
|
|
|
1390
1434
|
}
|
|
1391
1435
|
return running.sort();
|
|
1392
1436
|
}
|
|
1393
|
-
function looksLikeDeferredDonePromise(text) {
|
|
1394
|
-
const t = (text ?? "").trim();
|
|
1395
|
-
if (!t || t.length > DEFERRED_DONE_MAX_CHARS) return false;
|
|
1396
|
-
const unquoted = t.replace(/`[^`]*`/g, " ").replace(/["“”][^"“”]*["“”]/g, " ").replace(/\s+/g, " ").trim();
|
|
1397
|
-
if (!unquoted) return false;
|
|
1398
|
-
return /\b(i['’]?ll|i will)\s+let you know\b/i.test(unquoted) || /\blet you know when\b/i.test(unquoted) || /\b(check back|ping me)\s+when\b/i.test(unquoted) || /\bi(?:['’]ll| will)\s+(report|update you)\s+when\b/i.test(unquoted) || /\bwill notify (?:me|you) when\b/i.test(unquoted) || /\bi(?:['’]ll| will) be notified when\b/i.test(unquoted) || /\bi(?:['’]ll| will)\s+(?:keep|continue)\s+(?:watching|waiting|polling|checking)\b/i.test(
|
|
1399
|
-
unquoted
|
|
1400
|
-
) || /\bi(?:['’]ll| will)\s+come back when\b/i.test(unquoted);
|
|
1401
|
-
}
|
|
1402
1437
|
function isJobContinuePrompt(text) {
|
|
1403
1438
|
if (typeof text !== "string") return false;
|
|
1404
1439
|
const t = text.trim();
|
|
@@ -1453,10 +1488,15 @@ function turnWatchedDetachedJob(parts) {
|
|
|
1453
1488
|
});
|
|
1454
1489
|
}
|
|
1455
1490
|
function planJobContinue(opts) {
|
|
1456
|
-
if (opts.isOrchestrator) return { action: "none" };
|
|
1457
1491
|
if (opts.agent === "brightsy") return { action: "none" };
|
|
1458
1492
|
if (opts.queueLength > 0) return { action: "none" };
|
|
1459
1493
|
if (opts.continueCount >= MAX_JOB_CONTINUES) return { action: "none" };
|
|
1494
|
+
if (opts.isOrchestrator) {
|
|
1495
|
+
if (orchestratorPromisedLaterReport(opts.chatText) && !opts.alreadyNudged) {
|
|
1496
|
+
return { action: "nudge", prompt: formatOrchestratorDeferredContinuePrompt() };
|
|
1497
|
+
}
|
|
1498
|
+
return { action: "none" };
|
|
1499
|
+
}
|
|
1460
1500
|
const farewell = looksLikeDeferredDonePromise(opts.chatText);
|
|
1461
1501
|
if (opts.runningJobIds.length > 0 && (farewell || opts.watchedJob)) {
|
|
1462
1502
|
return {
|
|
@@ -1664,7 +1704,7 @@ var PORT_RANGE_SIZE = 10;
|
|
|
1664
1704
|
var RECLAIM_RETRY_DELAY_MS = 40;
|
|
1665
1705
|
var RECLAIM_TRIES = 8;
|
|
1666
1706
|
async function killReclaimable(ports, worktreePath, signal) {
|
|
1667
|
-
const { killListenersOnPorts: killListenersOnPorts2, killStaleWorktreeListeners: killStaleWorktreeListeners2 } = await import("./conductor-
|
|
1707
|
+
const { killListenersOnPorts: killListenersOnPorts2, killStaleWorktreeListeners: killStaleWorktreeListeners2 } = await import("./conductor-AUUXCJZT.js");
|
|
1668
1708
|
if (worktreePath) killStaleWorktreeListeners2(ports, worktreePath, signal);
|
|
1669
1709
|
else killListenersOnPorts2(ports);
|
|
1670
1710
|
}
|
|
@@ -2429,6 +2469,7 @@ export {
|
|
|
2429
2469
|
worktreeRunPortsPath,
|
|
2430
2470
|
loadWorktreeRunPorts,
|
|
2431
2471
|
saveWorktreeRunPorts,
|
|
2472
|
+
orchestratorPromisedLaterReport,
|
|
2432
2473
|
mcpWaitForJobTimeoutMs,
|
|
2433
2474
|
listRunningDetachedJobs,
|
|
2434
2475
|
isJobContinuePrompt,
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
looksLikeSkillBody,
|
|
10
10
|
skillCommandFromBody,
|
|
11
11
|
withEventParentId
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-5KH3EQ2C.js";
|
|
13
13
|
import {
|
|
14
14
|
isOrchestratorThread
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-EVYOONTE.js";
|
|
16
16
|
import {
|
|
17
17
|
codexUnattendedGitConfigArgs,
|
|
18
18
|
mergeAgentGitAuthEnv,
|
|
@@ -1006,7 +1006,12 @@ var WORKTREE_MCP_TOOLS = [
|
|
|
1006
1006
|
"create_schedule",
|
|
1007
1007
|
"update_schedule",
|
|
1008
1008
|
"delete_schedule",
|
|
1009
|
-
"run_schedule"
|
|
1009
|
+
"run_schedule",
|
|
1010
|
+
"list_order",
|
|
1011
|
+
"show_plan",
|
|
1012
|
+
"set_dependency",
|
|
1013
|
+
"clear_dependency",
|
|
1014
|
+
"satisfy_dependency"
|
|
1010
1015
|
];
|
|
1011
1016
|
function sideboardMcpProfile(env = process.env) {
|
|
1012
1017
|
return env[SIDEBOARD_MCP_PROFILE_ENV]?.trim().toLowerCase() === "worktree" ? "worktree" : "orchestration";
|
|
@@ -1474,6 +1479,11 @@ var SIDEBOARD_ARTIFACT_MCP_ALLOWED_TOOLS = [
|
|
|
1474
1479
|
"mcp__sideboard__update_schedule",
|
|
1475
1480
|
"mcp__sideboard__delete_schedule",
|
|
1476
1481
|
"mcp__sideboard__run_schedule",
|
|
1482
|
+
"mcp__sideboard__list_order",
|
|
1483
|
+
"mcp__sideboard__show_plan",
|
|
1484
|
+
"mcp__sideboard__set_dependency",
|
|
1485
|
+
"mcp__sideboard__clear_dependency",
|
|
1486
|
+
"mcp__sideboard__satisfy_dependency",
|
|
1477
1487
|
"mcp__sideboard__posthog_api"
|
|
1478
1488
|
];
|
|
1479
1489
|
var SIDEBOARD_GITHUB_MCP_ALLOWED_TOOLS = ["mcp__sideboard__github_*"];
|
|
@@ -2966,7 +2976,7 @@ var claudeAdapter = {
|
|
|
2966
2976
|
);
|
|
2967
2977
|
}
|
|
2968
2978
|
const mode = permissionMode(thread);
|
|
2969
|
-
const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-
|
|
2979
|
+
const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-FKXLFKYX.js");
|
|
2970
2980
|
const isOrchestrator = isOrchestratorThread2(thread);
|
|
2971
2981
|
const rpc = worktreeAgentRpc(isOrchestrator);
|
|
2972
2982
|
const injectedServers = await buildInjectedMcpServers({
|
|
@@ -32,9 +32,9 @@ import {
|
|
|
32
32
|
tryReservePort,
|
|
33
33
|
tryReservePorts,
|
|
34
34
|
worktreeRunPortsPath
|
|
35
|
-
} from "./chunk-
|
|
36
|
-
import "./chunk-
|
|
37
|
-
import "./chunk-
|
|
35
|
+
} from "./chunk-PEJ3N5VE.js";
|
|
36
|
+
import "./chunk-DYUAVL5S.js";
|
|
37
|
+
import "./chunk-BD7QARIJ.js";
|
|
38
38
|
import "./chunk-4OVQGZEI.js";
|
|
39
39
|
import "./chunk-BDQFZAE6.js";
|
|
40
40
|
import "./chunk-BMRJNRQK.js";
|
|
@@ -34,9 +34,9 @@ import {
|
|
|
34
34
|
tryReservePort,
|
|
35
35
|
tryReservePorts,
|
|
36
36
|
worktreeRunPortsPath
|
|
37
|
-
} from "./chunk-
|
|
38
|
-
import "./chunk-
|
|
39
|
-
import "./chunk-
|
|
37
|
+
} from "./chunk-NHLTTT5G.js";
|
|
38
|
+
import "./chunk-5KH3EQ2C.js";
|
|
39
|
+
import "./chunk-EVYOONTE.js";
|
|
40
40
|
import "./chunk-ERCYQTJU.js";
|
|
41
41
|
import "./chunk-N2WW62LF.js";
|
|
42
42
|
import "./chunk-GK7H3SY7.js";
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
remoteCoordinatorSourceRef,
|
|
21
21
|
slackCoordinatorSourceRef,
|
|
22
22
|
takenTeamSlugsForOrchestration
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-EVYOONTE.js";
|
|
24
24
|
import "./chunk-ERCYQTJU.js";
|
|
25
25
|
import "./chunk-N2WW62LF.js";
|
|
26
26
|
import "./chunk-GK7H3SY7.js";
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
remoteCoordinatorSourceRef,
|
|
19
19
|
slackCoordinatorSourceRef,
|
|
20
20
|
takenTeamSlugsForOrchestration
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-BD7QARIJ.js";
|
|
22
22
|
import "./chunk-4OVQGZEI.js";
|
|
23
23
|
import "./chunk-BDQFZAE6.js";
|
|
24
24
|
import "./chunk-BMRJNRQK.js";
|