@sideboard-ai/core 0.1.341 → 0.1.343
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-MK4T5FZY.js → abletime-MSIMJKKQ.js} +4 -4
- package/dist/{abletime-AYYRRDT2.js → abletime-ZIYFR4SI.js} +4 -4
- package/dist/{abletime-oauth-NB34M4X4.js → abletime-oauth-2RUKRZYZ.js} +3 -3
- package/dist/{abletime-oauth-7TOEFRWH.js → abletime-oauth-IQZ3LOB2.js} +3 -3
- package/dist/{abletime-rest-IF7IMJGU.js → abletime-rest-7YAO5B74.js} +3 -3
- package/dist/{abletime-rest-7M3QXAXY.js → abletime-rest-UBLSGMSA.js} +3 -3
- package/dist/{agents-4WL4U5WD.js → agents-7DCNOMFP.js} +7 -7
- package/dist/{agents-FH5NVVCJ.js → agents-LNZ465IM.js} +7 -7
- package/dist/{app-settings-377375BJ.js → app-settings-FS7TM55D.js} +9 -1
- package/dist/{app-settings-YTOPIRDH.js → app-settings-Q2F57NVK.js} +9 -1
- package/dist/{chunk-MGV6JFDY.js → chunk-2BLJ726H.js} +4 -3
- package/dist/{chunk-3HJ2USRA.js → chunk-3DMRQB4Y.js} +1 -1
- package/dist/{chunk-I5C42O2M.js → chunk-3J3XOIHF.js} +3 -3
- package/dist/{chunk-2IA556KV.js → chunk-4HELMBYR.js} +2 -2
- package/dist/{chunk-5MHENWO5.js → chunk-4PXHJA5K.js} +2 -2
- package/dist/{chunk-TZFYBQAD.js → chunk-4TTTEKNV.js} +2 -2
- package/dist/{chunk-K355SYYX.js → chunk-5BFEHSHO.js} +4 -3
- package/dist/{chunk-CN7GSNEL.js → chunk-5SJGR3VS.js} +1 -1
- package/dist/{chunk-WSW27W5R.js → chunk-5TS3KVGI.js} +1 -1
- package/dist/{chunk-43BOPWFV.js → chunk-6RO2AOE5.js} +2 -2
- package/dist/{chunk-QULOUTDQ.js → chunk-A4ZI7SA3.js} +3 -3
- package/dist/{chunk-NF3KRZXV.js → chunk-D7US5R4H.js} +1 -1
- package/dist/{chunk-4RIKHUKB.js → chunk-DEQLDEYR.js} +5 -5
- package/dist/{chunk-PHLFFV2M.js → chunk-EDEYEYU6.js} +159 -89
- package/dist/{chunk-HZRYQ27Z.js → chunk-G3UV3GXJ.js} +2 -2
- package/dist/{chunk-IY4YNHYD.js → chunk-GUIJMZQG.js} +1 -1
- package/dist/{chunk-O6UAW76V.js → chunk-JHT3CYLT.js} +1 -1
- package/dist/{chunk-SLTWZRBN.js → chunk-JX3OWNOT.js} +1 -1
- package/dist/{chunk-COFHTNQU.js → chunk-KCZM7WZ3.js} +152 -84
- package/dist/{chunk-5VXE4ZI4.js → chunk-LDJT3TLN.js} +7 -7
- package/dist/{chunk-FVX7JWFW.js → chunk-LHU6ZBFB.js} +2 -2
- package/dist/{chunk-ZS7AY6DS.js → chunk-NDBMDHQ5.js} +5 -5
- package/dist/{chunk-DF3S5X3H.js → chunk-NGIGRAZB.js} +5 -5
- package/dist/{chunk-47UDPUVZ.js → chunk-O2IRQAFB.js} +3 -3
- package/dist/{chunk-QBUX2EDG.js → chunk-RTZO2YJC.js} +2 -2
- package/dist/{chunk-CMYGUGGZ.js → chunk-S3DTEGMK.js} +8 -8
- package/dist/{chunk-DF34F3QR.js → chunk-S3UGLMGE.js} +21 -0
- package/dist/{chunk-4BUTF5LN.js → chunk-SLLTEMIL.js} +2 -2
- package/dist/{chunk-RZUZU5KD.js → chunk-TKEYXNXY.js} +21 -0
- package/dist/{chunk-HNIEEKKR.js → chunk-WO7VF4FG.js} +5 -5
- package/dist/{conductor-RGVRIOTZ.js → conductor-4SWJM5FS.js} +5 -5
- package/dist/{conductor-QZKG7YPO.js → conductor-Q433HU77.js} +5 -5
- package/dist/{coordinator-prompt-CDVIFBYS.js → coordinator-prompt-5QHWCO7V.js} +4 -4
- package/dist/{coordinator-prompt-66UHVADL.js → coordinator-prompt-Z7PPP45X.js} +4 -4
- package/dist/{global-workspace-KMQSUF2G.js → global-workspace-DL4K4K7O.js} +4 -4
- package/dist/{global-workspace-FNDRAJLF.js → global-workspace-VDCZMFCZ.js} +4 -4
- package/dist/index.cjs +193 -73
- package/dist/index.d.cts +18 -2
- package/dist/index.d.ts +18 -2
- package/dist/index.js +53 -26
- package/dist/{linear-ZJQM5IGJ.js → linear-JE4WAZ3W.js} +2 -2
- package/dist/{linear-6DM4FJWT.js → linear-UXMDJAD4.js} +2 -2
- package/dist/{linear-list-POPBU2VC.js → linear-list-I4NAOWPN.js} +1 -1
- package/dist/{linear-list-4EPKZTYE.js → linear-list-KDLU7QWX.js} +1 -1
- package/dist/mcp/run-stdio.cjs +181 -73
- package/dist/mcp/run-stdio.js +39 -22
- package/dist/{optional-cli-3G2274LT.js → optional-cli-7QXXPEN6.js} +3 -3
- package/dist/{optional-cli-CZF2ZFU5.js → optional-cli-RUUCLNSM.js} +4 -4
- package/dist/{orchestrator-BKCQUMLB.js → orchestrator-RLFBFRAG.js} +10 -10
- package/dist/{orchestrator-SCFWTIE7.js → orchestrator-Y5JCAJGV.js} +10 -10
- package/dist/{thread-store-OARQT6DL.js → thread-store-HETUMDVA.js} +2 -2
- package/dist/{thread-store-W2SSO6IQ.js → thread-store-ILM2ZJCB.js} +2 -2
- package/dist/{workspaces-6GB56LMJ.js → workspaces-EIIHHH4S.js} +4 -4
- package/dist/{workspaces-EWWLVSZ5.js → workspaces-MX4W4SSB.js} +4 -4
- package/dist/{worktree-BRKMPZMJ.js → worktree-BD3EJE24.js} +3 -3
- package/dist/{worktree-OB5ABI22.js → worktree-QBVLKACU.js} +3 -3
- package/package.json +1 -1
package/dist/mcp/run-stdio.cjs
CHANGED
|
@@ -4880,6 +4880,9 @@ __export(app_settings_exports, {
|
|
|
4880
4880
|
GITHUB_GIT_AUTH_MODES: () => GITHUB_GIT_AUTH_MODES,
|
|
4881
4881
|
HARNESS_ENV_KEYS: () => HARNESS_ENV_KEYS,
|
|
4882
4882
|
ISSUE_SOURCE_LABELS: () => ISSUE_SOURCE_LABELS,
|
|
4883
|
+
MAX_ORCH_THREADS_DEFAULT: () => MAX_ORCH_THREADS_DEFAULT,
|
|
4884
|
+
MAX_ORCH_THREADS_MAX: () => MAX_ORCH_THREADS_MAX,
|
|
4885
|
+
MAX_ORCH_THREADS_MIN: () => MAX_ORCH_THREADS_MIN,
|
|
4883
4886
|
PROFILE_NOTES_MAX: () => PROFILE_NOTES_MAX,
|
|
4884
4887
|
REVIEW_LABEL_MAX: () => REVIEW_LABEL_MAX,
|
|
4885
4888
|
USAGE_ON_LIMIT_VALUES: () => USAGE_ON_LIMIT_VALUES,
|
|
@@ -4942,6 +4945,7 @@ __export(app_settings_exports, {
|
|
|
4942
4945
|
issueSourceLabel: () => issueSourceLabel,
|
|
4943
4946
|
loadAppSettings: () => loadAppSettings,
|
|
4944
4947
|
maxConcurrentAgents: () => maxConcurrentAgents,
|
|
4948
|
+
maxOrchThreads: () => maxOrchThreads,
|
|
4945
4949
|
normalizeReviewLabel: () => normalizeReviewLabel,
|
|
4946
4950
|
orchestrationQuotaFallbackAgent: () => orchestrationQuotaFallbackAgent,
|
|
4947
4951
|
orchestrationQuotaOnLimit: () => orchestrationQuotaOnLimit,
|
|
@@ -5404,6 +5408,9 @@ function normalizeAdvanced(raw) {
|
|
|
5404
5408
|
if (typeof source.maxConcurrent === "number" && Number.isFinite(source.maxConcurrent)) {
|
|
5405
5409
|
out.maxConcurrent = Math.max(1, Math.min(32, Math.floor(source.maxConcurrent)));
|
|
5406
5410
|
}
|
|
5411
|
+
if (typeof source.maxOrchThreads === "number" && Number.isFinite(source.maxOrchThreads)) {
|
|
5412
|
+
out.maxOrchThreads = clampMaxOrchThreads(source.maxOrchThreads);
|
|
5413
|
+
}
|
|
5407
5414
|
if (typeof source.worktreeMaxCount === "number" && Number.isFinite(source.worktreeMaxCount)) {
|
|
5408
5415
|
out.worktreeMaxCount = Math.max(1, Math.min(500, Math.floor(source.worktreeMaxCount)));
|
|
5409
5416
|
}
|
|
@@ -6300,6 +6307,9 @@ function updateAdvancedSettings(patch) {
|
|
|
6300
6307
|
if (typeof patch.maxConcurrent === "number" && Number.isFinite(patch.maxConcurrent)) {
|
|
6301
6308
|
advanced.maxConcurrent = Math.max(1, Math.min(32, Math.floor(patch.maxConcurrent)));
|
|
6302
6309
|
}
|
|
6310
|
+
if (typeof patch.maxOrchThreads === "number" && Number.isFinite(patch.maxOrchThreads)) {
|
|
6311
|
+
advanced.maxOrchThreads = clampMaxOrchThreads(patch.maxOrchThreads);
|
|
6312
|
+
}
|
|
6303
6313
|
if (typeof patch.worktreeMaxCount === "number" && Number.isFinite(patch.worktreeMaxCount)) {
|
|
6304
6314
|
advanced.worktreeMaxCount = Math.max(1, Math.min(500, Math.floor(patch.worktreeMaxCount)));
|
|
6305
6315
|
}
|
|
@@ -6436,6 +6446,14 @@ function maxConcurrentAgents(settings = loadAppSettings()) {
|
|
|
6436
6446
|
}
|
|
6437
6447
|
return 5;
|
|
6438
6448
|
}
|
|
6449
|
+
function clampMaxOrchThreads(n) {
|
|
6450
|
+
return Math.max(MAX_ORCH_THREADS_MIN, Math.min(MAX_ORCH_THREADS_MAX, Math.floor(n)));
|
|
6451
|
+
}
|
|
6452
|
+
function maxOrchThreads(settings = loadAppSettings()) {
|
|
6453
|
+
const n = settings.advanced.maxOrchThreads;
|
|
6454
|
+
if (typeof n === "number" && Number.isFinite(n)) return clampMaxOrchThreads(n);
|
|
6455
|
+
return MAX_ORCH_THREADS_DEFAULT;
|
|
6456
|
+
}
|
|
6439
6457
|
function resolveClaudeExecutable(settings = loadAppSettings()) {
|
|
6440
6458
|
return resolveAgentExecutable("claude", settings);
|
|
6441
6459
|
}
|
|
@@ -6516,7 +6534,7 @@ function childEnvWithAppSettings(extra) {
|
|
|
6516
6534
|
function harnessEnvKey(harness) {
|
|
6517
6535
|
return HARNESS_ENV_KEYS[harness];
|
|
6518
6536
|
}
|
|
6519
|
-
var import_node_crypto2, import_node_fs15, import_node_os6, import_node_path16, HARNESS_ENV_KEYS, DEFAULT_AGENTS, GITHUB_GIT_AUTH_MODES, FOLLOW_UP_BEHAVIORS, AGENT_DONE_SOUNDS, CHAT_TEXT_SCALES, CHAT_TEXT_SCALE_DEFAULT, INTEGRATION_VAULT_KEYS, CLOUD_CONNECT_AGENTS, ISSUE_SOURCES, GIT_AUTH_MODES, REVIEW_LABEL_MAX, EMPTY_SETTINGS, CONFIRM_ACCOUNT, CONFIRM_PROJECT, DEFAULT_CLI_BIN;
|
|
6537
|
+
var import_node_crypto2, import_node_fs15, import_node_os6, import_node_path16, HARNESS_ENV_KEYS, DEFAULT_AGENTS, GITHUB_GIT_AUTH_MODES, FOLLOW_UP_BEHAVIORS, AGENT_DONE_SOUNDS, CHAT_TEXT_SCALES, CHAT_TEXT_SCALE_DEFAULT, INTEGRATION_VAULT_KEYS, CLOUD_CONNECT_AGENTS, ISSUE_SOURCES, GIT_AUTH_MODES, REVIEW_LABEL_MAX, EMPTY_SETTINGS, CONFIRM_ACCOUNT, CONFIRM_PROJECT, MAX_ORCH_THREADS_DEFAULT, MAX_ORCH_THREADS_MIN, MAX_ORCH_THREADS_MAX, DEFAULT_CLI_BIN;
|
|
6520
6538
|
var init_app_settings = __esm({
|
|
6521
6539
|
"src/store/app-settings.ts"() {
|
|
6522
6540
|
"use strict";
|
|
@@ -6613,6 +6631,9 @@ var init_app_settings = __esm({
|
|
|
6613
6631
|
};
|
|
6614
6632
|
CONFIRM_ACCOUNT = "Show the user the proposed account context, call ask_user (Save this context / Do not save), wait for their answer, then retry with confirmed=true.";
|
|
6615
6633
|
CONFIRM_PROJECT = "Show the user the proposed project context, call ask_user (Save this context / Do not save), wait for their answer, then retry with confirmed=true.";
|
|
6634
|
+
MAX_ORCH_THREADS_DEFAULT = 5;
|
|
6635
|
+
MAX_ORCH_THREADS_MIN = 1;
|
|
6636
|
+
MAX_ORCH_THREADS_MAX = 32;
|
|
6616
6637
|
DEFAULT_CLI_BIN = {
|
|
6617
6638
|
claude: "claude",
|
|
6618
6639
|
codex: "codex",
|
|
@@ -11213,6 +11234,7 @@ var init_coordinator_prompt = __esm({
|
|
|
11213
11234
|
"- add_project / remove_project \u2014 register or unregister a git repo",
|
|
11214
11235
|
"Workspaces and chats:",
|
|
11215
11236
|
'- create_workspace \u2014 create a workspace (isolated checkout + first chat) from branch | pr | ticket (appears on Home). A ticket, PR, or named branch has one checkout: a second call returns that workspace (alreadyStarted=true) and chats for every agent already on it. That is not one agent. To put another agent on that checkout, fork_chat. send_to_chat only the chat that should do this job. Creating from the default branch still opens a new isolated workspace. Pass repoPath + parentChatId; omit agent and model so Sideboard applies Settings \u2192 Default agent, model & effort (never pass your own agent or agent=cursor). Pass the same tags (short labels, e.g. "phone-sync") on every workspace you open for one task so they group in the sidebar; reusing a checkout adds those tags. If the repo has a setup script, Sideboard runs it in the background (does not block send_to_chat). Nested Codex (you are Codex and the child would be Codex) can deadlock on ~/.codex locks \u2014 omit agent; Sideboard switches the child to Cursor when a CURSOR_API_KEY is set, otherwise keeps the Account default',
|
|
11237
|
+
"- One orchestration chat can create at most the Settings \u2192 Advanced \u201CMax orchestration threads\u201D cap of child workspaces (default 5). fork_chat on an existing checkout does not use a slot.",
|
|
11216
11238
|
"- set_workspace_tags \u2014 set, add, or remove labels on a workspace after create. Pass any chat id on that checkout. Same tags on every workspace from one task. Worktree agents can update tags on their own checkout (they omit ref). set_wake_on_github_edges opts a workspace into CI and review-request wakes once Settings \u2192 Advanced is on. Pass a child chat id. Do not flip the Advanced switch.",
|
|
11217
11239
|
"- set_plan / show_plan / list_order / set_dependency / clear_dependency / satisfy_dependency / execute_plan \u2014 This chat owns one plan. show_plan opens it in the side column, the same way a worktree agent does. The Orchestration row in the sidebar opens that chat. Draft with set_plan (title, summary, and goal) and set_dependency. A step may loop back to an earlier step. This is a plan, not a one-way waterfall. Call show_plan after you draft or change the plan. Do not paste the diagram in chat. Do not create workspaces or send_to_chat for that work while the plan is draft. execute_plan with agreed: true only after they tell you to run it. It marks the plan active and returns ready vs waiting. Start ready steps with create_workspace or send_to_chat. Leave waiting steps alone. Merge only if they asked. Worktree agents show_plan to open the diagram and this checkout's implementation plan when plan.md exists. set_dependency / clear_dependency only for a step they are part of. A dependency says one PR, issue, or workspace must reach a gate before another can start or merge. gate=in-main is met when that PR is merged; gate=in-prod stays waiting until satisfy_dependency (Sideboard cannot see production). hold=start blocks starting the subject; hold=merge blocks merging it. Example: PR 1 in prod before PR 2 can merge; PR 3 in main before issue 4 can start. Pass waitsOnKind (pr|issue|workspace), waitsOnRef, gate, subjectKind, subjectRef, hold. Pass repoPath when the same number exists in more than one project. A step can name another orchestration chat (kind orchestration, ref that chat id). That chat drafts its own plan. Each orchestration chat opens its own plan with show_plan. Worktree agents set their own checkout and omit subject. Plan mode on a workspace agent stays a separate plan for that checkout. Do not tell a child to merge or start while list_order still marks that step waiting.",
|
|
11218
11240
|
"- start_board_card \u2014 same as create_workspace for a ticket/PR/named branch (attaches issue text when resolvable). Then send_to_chat.",
|
|
@@ -28623,54 +28645,6 @@ var init_expand = __esm({
|
|
|
28623
28645
|
}
|
|
28624
28646
|
});
|
|
28625
28647
|
|
|
28626
|
-
// src/composer/agent-has-replied.ts
|
|
28627
|
-
function joinSteerPrompt(base, addition) {
|
|
28628
|
-
const next = addition.trim();
|
|
28629
|
-
if (!next) return base;
|
|
28630
|
-
const head = base.replace(/\s+$/, "");
|
|
28631
|
-
if (!head) return next;
|
|
28632
|
-
return `${head}
|
|
28633
|
-
${next}`;
|
|
28634
|
-
}
|
|
28635
|
-
function messagesWithRewrittenUserPrompt(messages, from, to) {
|
|
28636
|
-
if (from === to) return null;
|
|
28637
|
-
const next = messages.slice();
|
|
28638
|
-
for (let i = next.length - 1; i >= 0; i--) {
|
|
28639
|
-
const message = next[i];
|
|
28640
|
-
if (!message || message.origin === "continue" || message.role === "summary") continue;
|
|
28641
|
-
if (message.role !== "user") continue;
|
|
28642
|
-
if (message.text !== from) return null;
|
|
28643
|
-
next[i] = { ...message, text: to };
|
|
28644
|
-
return next;
|
|
28645
|
-
}
|
|
28646
|
-
return null;
|
|
28647
|
-
}
|
|
28648
|
-
function trailingUnansweredUserText(messages) {
|
|
28649
|
-
for (let i = messages.length - 1; i >= 0; i--) {
|
|
28650
|
-
const message = messages[i];
|
|
28651
|
-
if (!message || message.origin === "continue" || message.role === "summary") continue;
|
|
28652
|
-
if (message.role === "agent") {
|
|
28653
|
-
const text7 = (message.text ?? "").trim();
|
|
28654
|
-
if (text7 || (message.parts?.length ?? 0) > 0) return null;
|
|
28655
|
-
continue;
|
|
28656
|
-
}
|
|
28657
|
-
if (message.role === "user") return message.text;
|
|
28658
|
-
}
|
|
28659
|
-
return null;
|
|
28660
|
-
}
|
|
28661
|
-
function livePartsShowAgentReply(parts) {
|
|
28662
|
-
for (const part of parts) {
|
|
28663
|
-
if (part.type === "tool") return true;
|
|
28664
|
-
if ((part.type === "text" || part.type === "thinking") && part.text.trim()) return true;
|
|
28665
|
-
}
|
|
28666
|
-
return false;
|
|
28667
|
-
}
|
|
28668
|
-
var init_agent_has_replied = __esm({
|
|
28669
|
-
"src/composer/agent-has-replied.ts"() {
|
|
28670
|
-
"use strict";
|
|
28671
|
-
}
|
|
28672
|
-
});
|
|
28673
|
-
|
|
28674
28648
|
// src/composer/consume-attachments.ts
|
|
28675
28649
|
function consumeComposerAttachments(thread) {
|
|
28676
28650
|
return {
|
|
@@ -28681,6 +28655,22 @@ function consumeComposerAttachments(thread) {
|
|
|
28681
28655
|
function takePendingTurnAttachments(thread) {
|
|
28682
28656
|
return [...thread.pendingTurnAttachments ?? []];
|
|
28683
28657
|
}
|
|
28658
|
+
function mergeTurnAttachments(base, extra) {
|
|
28659
|
+
const next = [];
|
|
28660
|
+
const seen = /* @__PURE__ */ new Set();
|
|
28661
|
+
for (const att of [...base ?? [], ...extra ?? []]) {
|
|
28662
|
+
if (seen.has(att.id)) continue;
|
|
28663
|
+
seen.add(att.id);
|
|
28664
|
+
next.push(att);
|
|
28665
|
+
}
|
|
28666
|
+
return next;
|
|
28667
|
+
}
|
|
28668
|
+
function sameTurnAttachments(a, b) {
|
|
28669
|
+
const left = a ?? [];
|
|
28670
|
+
const right = b ?? [];
|
|
28671
|
+
if (left.length !== right.length) return false;
|
|
28672
|
+
return left.every((att, i) => att.id === right[i]?.id);
|
|
28673
|
+
}
|
|
28684
28674
|
function alignQueueAttachments(queueLength, existing) {
|
|
28685
28675
|
const next = (existing ?? []).slice(0, queueLength).map((slot) => [...slot ?? []]);
|
|
28686
28676
|
while (next.length < queueLength) next.push([]);
|
|
@@ -28728,15 +28718,101 @@ var init_consume_attachments = __esm({
|
|
|
28728
28718
|
}
|
|
28729
28719
|
});
|
|
28730
28720
|
|
|
28721
|
+
// src/composer/agent-has-replied.ts
|
|
28722
|
+
function joinSteerPrompt(base, addition) {
|
|
28723
|
+
const next = addition.trim();
|
|
28724
|
+
if (!next) return base;
|
|
28725
|
+
const head = base.replace(/\s+$/, "");
|
|
28726
|
+
if (!head) return next;
|
|
28727
|
+
return `${head}
|
|
28728
|
+
${next}`;
|
|
28729
|
+
}
|
|
28730
|
+
function messagesWithRewrittenUserPrompt(messages, from, to, attachments) {
|
|
28731
|
+
const extra = attachments ?? [];
|
|
28732
|
+
if (from === to && extra.length === 0) return null;
|
|
28733
|
+
const next = messages.slice();
|
|
28734
|
+
for (let i = next.length - 1; i >= 0; i--) {
|
|
28735
|
+
const message = next[i];
|
|
28736
|
+
if (!message || message.origin === "continue" || message.role === "summary") continue;
|
|
28737
|
+
if (message.role !== "user") continue;
|
|
28738
|
+
if (message.text !== from) return null;
|
|
28739
|
+
const merged = mergeTurnAttachments(message.attachments, extra);
|
|
28740
|
+
if (from === to && merged.length === (message.attachments?.length ?? 0)) return null;
|
|
28741
|
+
next[i] = {
|
|
28742
|
+
...message,
|
|
28743
|
+
text: to,
|
|
28744
|
+
...merged.length > 0 ? { attachments: merged } : {}
|
|
28745
|
+
};
|
|
28746
|
+
return next;
|
|
28747
|
+
}
|
|
28748
|
+
return null;
|
|
28749
|
+
}
|
|
28750
|
+
function trailingUnansweredUserText(messages) {
|
|
28751
|
+
for (let i = messages.length - 1; i >= 0; i--) {
|
|
28752
|
+
const message = messages[i];
|
|
28753
|
+
if (!message || message.origin === "continue" || message.role === "summary") continue;
|
|
28754
|
+
if (message.role === "agent") {
|
|
28755
|
+
const text7 = (message.text ?? "").trim();
|
|
28756
|
+
if (text7 || (message.parts?.length ?? 0) > 0) return null;
|
|
28757
|
+
continue;
|
|
28758
|
+
}
|
|
28759
|
+
if (message.role === "user") return message.text;
|
|
28760
|
+
}
|
|
28761
|
+
return null;
|
|
28762
|
+
}
|
|
28763
|
+
function livePartsShowAgentReply(parts) {
|
|
28764
|
+
for (const part of parts) {
|
|
28765
|
+
if (part.type === "tool") return true;
|
|
28766
|
+
if ((part.type === "text" || part.type === "thinking") && part.text.trim()) return true;
|
|
28767
|
+
}
|
|
28768
|
+
return false;
|
|
28769
|
+
}
|
|
28770
|
+
var init_agent_has_replied = __esm({
|
|
28771
|
+
"src/composer/agent-has-replied.ts"() {
|
|
28772
|
+
"use strict";
|
|
28773
|
+
init_consume_attachments();
|
|
28774
|
+
}
|
|
28775
|
+
});
|
|
28776
|
+
|
|
28731
28777
|
// src/orchestrator/enqueue-thread-send.ts
|
|
28732
28778
|
function resolveSendFollowUp(thread, requested) {
|
|
28733
28779
|
if (requested === "steer" || requested === "queue") return requested;
|
|
28734
28780
|
return isOrchestratorThread(thread) ? followUpBehavior() : "queue";
|
|
28735
28781
|
}
|
|
28736
|
-
function
|
|
28782
|
+
function beginOpenSteerDraft(text7) {
|
|
28783
|
+
return { text: text7, spawned: false, attachments: [] };
|
|
28784
|
+
}
|
|
28785
|
+
function seedOpenSteerAttachments(draft, sent) {
|
|
28786
|
+
if (!draft) return [...sent ?? []];
|
|
28787
|
+
draft.attachments = mergeTurnAttachments(sent, draft.attachments);
|
|
28788
|
+
return draft.attachments ?? [];
|
|
28789
|
+
}
|
|
28790
|
+
function openSteerTurnAttachments(draft, fallback, autoContinue) {
|
|
28791
|
+
if (autoContinue) return [];
|
|
28792
|
+
return [...draft?.attachments ?? fallback];
|
|
28793
|
+
}
|
|
28794
|
+
function promptAfterJoinedSteer(input) {
|
|
28795
|
+
if (input.draft) input.draft.spawned = true;
|
|
28796
|
+
return promptForJoinedSteer({
|
|
28797
|
+
threadId: input.threadId,
|
|
28798
|
+
promptText: input.promptText,
|
|
28799
|
+
latestPrompt: input.draft?.text ?? input.promptText,
|
|
28800
|
+
agentPrompt: input.agentPrompt,
|
|
28801
|
+
expandedPrompt: input.expandedPrompt,
|
|
28802
|
+
worktreePath: input.worktreePath,
|
|
28803
|
+
attachments: input.expandedAttachments,
|
|
28804
|
+
latestAttachments: openSteerTurnAttachments(
|
|
28805
|
+
input.draft,
|
|
28806
|
+
input.expandedAttachments,
|
|
28807
|
+
input.autoContinue
|
|
28808
|
+
),
|
|
28809
|
+
gitForge: input.gitForge
|
|
28810
|
+
});
|
|
28811
|
+
}
|
|
28812
|
+
function rewriteTrailingUserPrompt(threadId, from, to, attachments) {
|
|
28737
28813
|
const thread = readThread(threadId);
|
|
28738
28814
|
if (!thread) return;
|
|
28739
|
-
const messages = messagesWithRewrittenUserPrompt(thread.messages, from, to);
|
|
28815
|
+
const messages = messagesWithRewrittenUserPrompt(thread.messages, from, to, attachments);
|
|
28740
28816
|
if (!messages) return;
|
|
28741
28817
|
updateThread(threadId, { messages });
|
|
28742
28818
|
}
|
|
@@ -28751,12 +28827,18 @@ function reuseJoinedUserBubble(reused, threadId, messages, promptText) {
|
|
|
28751
28827
|
return false;
|
|
28752
28828
|
}
|
|
28753
28829
|
function promptForJoinedSteer(input) {
|
|
28754
|
-
|
|
28755
|
-
|
|
28830
|
+
const latestAttachments = input.latestAttachments ?? input.attachments;
|
|
28831
|
+
const textSame = input.latestPrompt === input.promptText;
|
|
28832
|
+
if (textSame && sameTurnAttachments(input.attachments, latestAttachments)) {
|
|
28833
|
+
return input.agentPrompt;
|
|
28834
|
+
}
|
|
28835
|
+
if (!textSame) {
|
|
28836
|
+
rewriteTrailingUserPrompt(input.threadId, input.promptText, input.latestPrompt);
|
|
28837
|
+
}
|
|
28756
28838
|
const { agentPrompt: expandedLatest } = expandComposerPrompt(
|
|
28757
28839
|
input.worktreePath,
|
|
28758
28840
|
expandCanonicalGitRequest(input.latestPrompt, { forge: input.gitForge }),
|
|
28759
|
-
{ attachments:
|
|
28841
|
+
{ attachments: latestAttachments }
|
|
28760
28842
|
);
|
|
28761
28843
|
return input.expandedPrompt && input.agentPrompt.endsWith(input.expandedPrompt) ? input.agentPrompt.slice(0, -input.expandedPrompt.length) + expandedLatest : `${input.agentPrompt}
|
|
28762
28844
|
|
|
@@ -28792,7 +28874,13 @@ async function enqueueThreadSend(host, threadRef, prompt, opts) {
|
|
|
28792
28874
|
const combined = joinSteerPrompt(unanswered, prompt);
|
|
28793
28875
|
if (draft && !draft.spawned) {
|
|
28794
28876
|
draft.text = combined;
|
|
28795
|
-
|
|
28877
|
+
if (consumed.consumed.length > 0) {
|
|
28878
|
+
draft.attachments = mergeTurnAttachments(draft.attachments, consumed.consumed);
|
|
28879
|
+
}
|
|
28880
|
+
rewriteTrailingUserPrompt(current.id, unanswered, combined, consumed.consumed);
|
|
28881
|
+
if (explicit === void 0 && consumed.consumed.length > 0) {
|
|
28882
|
+
updateThread(current.id, { attachments: consumed.attachments });
|
|
28883
|
+
}
|
|
28796
28884
|
} else {
|
|
28797
28885
|
const queue = current.queue.slice();
|
|
28798
28886
|
queue[0] = combined;
|
|
@@ -28814,8 +28902,13 @@ async function enqueueThreadSend(host, threadRef, prompt, opts) {
|
|
|
28814
28902
|
}
|
|
28815
28903
|
const promptToQueue = unanswered != null ? joinSteerPrompt(unanswered, prompt) : prompt;
|
|
28816
28904
|
if (unanswered != null) {
|
|
28817
|
-
if (draft)
|
|
28818
|
-
|
|
28905
|
+
if (draft) {
|
|
28906
|
+
draft.text = promptToQueue;
|
|
28907
|
+
if (consumed.consumed.length > 0) {
|
|
28908
|
+
draft.attachments = mergeTurnAttachments(draft.attachments, consumed.consumed);
|
|
28909
|
+
}
|
|
28910
|
+
}
|
|
28911
|
+
rewriteTrailingUserPrompt(current.id, unanswered, promptToQueue, consumed.consumed);
|
|
28819
28912
|
host.reusedUserPrompt.add(current.id);
|
|
28820
28913
|
}
|
|
28821
28914
|
const queued = appendQueuedItem(
|
|
@@ -31966,10 +32059,7 @@ var init_orchestrator = __esm({
|
|
|
31966
32059
|
this.emit({ type: "status_changed", threadId, status: "running" });
|
|
31967
32060
|
this.emit({ type: "turn_started", threadId, prompt });
|
|
31968
32061
|
try {
|
|
31969
|
-
this.openSteerPrompt.set(threadId,
|
|
31970
|
-
text: typeof prompt === "string" ? prompt : "",
|
|
31971
|
-
spawned: false
|
|
31972
|
-
});
|
|
32062
|
+
this.openSteerPrompt.set(threadId, beginOpenSteerDraft(typeof prompt === "string" ? prompt : ""));
|
|
31973
32063
|
try {
|
|
31974
32064
|
const baseline = await captureTurnBaseline(thread.worktreePath);
|
|
31975
32065
|
if (baseline) this.turnBaselines.set(threadId, baseline);
|
|
@@ -31999,13 +32089,14 @@ var init_orchestrator = __esm({
|
|
|
31999
32089
|
const autoContinue = isJobContinuePrompt(promptText) || promptText.startsWith("The previous agent process ended before it finished.");
|
|
32000
32090
|
const parked = takePendingTurnAttachments(thread);
|
|
32001
32091
|
const sentAttachments = !autoContinue && parked.length > 0 ? parked : void 0;
|
|
32092
|
+
const turnAttachments = seedOpenSteerAttachments(this.openSteerPrompt.get(threadId), sentAttachments);
|
|
32002
32093
|
if (!autoContinue) clearAgentBlock(threadId);
|
|
32003
32094
|
const shown = this.requireThread(threadId).messages;
|
|
32004
32095
|
if (!reuseJoinedUserBubble(this.reusedUserPrompt, threadId, shown, promptText)) {
|
|
32005
32096
|
appendMessage(threadId, {
|
|
32006
32097
|
role: "user",
|
|
32007
32098
|
text: promptText,
|
|
32008
|
-
...
|
|
32099
|
+
...turnAttachments.length > 0 ? { attachments: turnAttachments } : {},
|
|
32009
32100
|
...autoContinue ? { origin: "continue" } : {},
|
|
32010
32101
|
ts: (/* @__PURE__ */ new Date()).toISOString()
|
|
32011
32102
|
});
|
|
@@ -32035,11 +32126,12 @@ var init_orchestrator = __esm({
|
|
|
32035
32126
|
thread = this.requireThread(threadId);
|
|
32036
32127
|
const turnOrigin = thread.worktreePath?.trim() ? await resolveOriginRemote(thread.worktreePath).catch(() => null) : null;
|
|
32037
32128
|
const gitPrompt = expandCanonicalGitRequest(promptText, { forge: turnOrigin?.forge });
|
|
32129
|
+
const expandedAttachments = openSteerTurnAttachments(this.openSteerPrompt.get(threadId), turnAttachments, autoContinue);
|
|
32038
32130
|
const { agentPrompt: expandedPrompt } = expandComposerPrompt(
|
|
32039
32131
|
thread.worktreePath,
|
|
32040
32132
|
gitPrompt,
|
|
32041
32133
|
{
|
|
32042
|
-
attachments:
|
|
32134
|
+
attachments: expandedAttachments
|
|
32043
32135
|
}
|
|
32044
32136
|
);
|
|
32045
32137
|
const slackInbound = /^(Slack DM|Slack @mention)(?:\n|$)/.test(
|
|
@@ -32207,16 +32299,15 @@ ${formatEnvReminder(projectNameForRepoPath(thread.repoPath || thread.worktreePat
|
|
|
32207
32299
|
].filter(Boolean).join("\n\n---\n\n");
|
|
32208
32300
|
const stderrTail = [];
|
|
32209
32301
|
traceTurn("runTurn.beforeSpawn", { threadId, agent: fresh.agent });
|
|
32210
|
-
const
|
|
32211
|
-
|
|
32212
|
-
|
|
32302
|
+
const promptForAgent = promptAfterJoinedSteer({
|
|
32303
|
+
draft: this.openSteerPrompt.get(threadId),
|
|
32304
|
+
autoContinue,
|
|
32305
|
+
expandedAttachments,
|
|
32213
32306
|
threadId,
|
|
32214
32307
|
promptText,
|
|
32215
|
-
latestPrompt: steerDraft?.text ?? promptText,
|
|
32216
32308
|
agentPrompt,
|
|
32217
32309
|
expandedPrompt,
|
|
32218
32310
|
worktreePath: fresh.worktreePath,
|
|
32219
|
-
attachments: autoContinue ? [] : sentAttachments ?? [],
|
|
32220
32311
|
gitForge: turnOrigin?.forge
|
|
32221
32312
|
});
|
|
32222
32313
|
const handle = await spawnAgentTurn(
|
|
@@ -34801,6 +34892,8 @@ function applyWakeOnGithubEdges(threadRef, enabled) {
|
|
|
34801
34892
|
// src/mcp/create-orch-child.ts
|
|
34802
34893
|
init_chat_tabs();
|
|
34803
34894
|
init_worktree_labels();
|
|
34895
|
+
init_app_settings();
|
|
34896
|
+
init_global_workspace();
|
|
34804
34897
|
|
|
34805
34898
|
// src/mcp/create-thread-agent.ts
|
|
34806
34899
|
init_cursor();
|
|
@@ -34849,8 +34942,22 @@ function orchCreateThreadAgentNote(input) {
|
|
|
34849
34942
|
}
|
|
34850
34943
|
|
|
34851
34944
|
// src/mcp/create-orch-child.ts
|
|
34852
|
-
var MAX_ORCH_THREADS = 5;
|
|
34853
34945
|
var CREATE_THREAD_TIMEOUT_MS = 9e4;
|
|
34946
|
+
function orchChildWorkspaceCount(threads, parentId) {
|
|
34947
|
+
const seen = /* @__PURE__ */ new Set();
|
|
34948
|
+
let unpathed = 0;
|
|
34949
|
+
for (const thread of threads) {
|
|
34950
|
+
if (thread.parentThreadId !== parentId) continue;
|
|
34951
|
+
if (isOrchestratorThread(thread)) continue;
|
|
34952
|
+
const raw = thread.worktreePath?.trim();
|
|
34953
|
+
if (!raw) {
|
|
34954
|
+
unpathed += 1;
|
|
34955
|
+
continue;
|
|
34956
|
+
}
|
|
34957
|
+
seen.add(normalizeWorktreePath(raw));
|
|
34958
|
+
}
|
|
34959
|
+
return seen.size + unpathed;
|
|
34960
|
+
}
|
|
34854
34961
|
function withTimeout2(promise, ms, label) {
|
|
34855
34962
|
return new Promise((resolve3, reject) => {
|
|
34856
34963
|
const timer2 = setTimeout(() => {
|
|
@@ -34888,11 +34995,12 @@ async function createOrchChildThread(orch, args, resolveNewThreadOptions2) {
|
|
|
34888
34995
|
parent = null;
|
|
34889
34996
|
}
|
|
34890
34997
|
if (parentId) {
|
|
34891
|
-
const
|
|
34892
|
-
|
|
34998
|
+
const cap = maxOrchThreads();
|
|
34999
|
+
const used = orchChildWorkspaceCount(orch.getThreads(false), parentId);
|
|
35000
|
+
if (used >= cap) {
|
|
34893
35001
|
return {
|
|
34894
35002
|
ok: false,
|
|
34895
|
-
text: `
|
|
35003
|
+
text: `Workspace cap (${cap}) reached for this orchestration session. Raise it in Settings \u2192 Advanced \u2192 Max orchestration threads.`
|
|
34896
35004
|
};
|
|
34897
35005
|
}
|
|
34898
35006
|
}
|
|
@@ -38553,7 +38661,7 @@ async function startMcpServer() {
|
|
|
38553
38661
|
);
|
|
38554
38662
|
server.tool(
|
|
38555
38663
|
"create_workspace",
|
|
38556
|
-
`Create a workspace (isolated git checkout + first chat) from branch, pr, or ticket. A ticket, PR, or named branch has one checkout \u2014 if one already matches, returns it (alreadyStarted=true) instead of a second checkout. That is not one agent: chats lists every agent on that checkout. Add another with fork_chat; send_to_chat only the chat that should do this job. Creating from the default branch still opens a new isolated checkout. Pass repoPath from list_projects. cowboy=true uses the project folder on the default branch (no isolated worktree; land is commit+push). From an orchestration chat, omit parentChatId (Sideboard binds the child to this chat) or pass the exact id from the turn reminder \u2014 never invent a uuid. Omit agent/model \u2014 Sideboard applies ${accountDefaultsHint}. Do not pass your own agent or agent=cursor; those are ignored. Setup (settings.toml, .cursor/worktrees.json, or script/setup) runs in the background in parallel with the first turn (skipped for cowboy). Pass the same tags on every workspace you open for one task (short labels such as "phone-sync") so they still match in the sidebar the next day. Reusing a checkout adds those tags.`,
|
|
38664
|
+
`Create a workspace (isolated git checkout + first chat) from branch, pr, or ticket. A ticket, PR, or named branch has one checkout \u2014 if one already matches, returns it (alreadyStarted=true) instead of a second checkout. That is not one agent: chats lists every agent on that checkout. Add another with fork_chat; send_to_chat only the chat that should do this job. Creating from the default branch still opens a new isolated checkout. Pass repoPath from list_projects. cowboy=true uses the project folder on the default branch (no isolated worktree; land is commit+push). From an orchestration chat, omit parentChatId (Sideboard binds the child to this chat) or pass the exact id from the turn reminder \u2014 never invent a uuid. Omit agent/model \u2014 Sideboard applies ${accountDefaultsHint}. Do not pass your own agent or agent=cursor; those are ignored. Setup (settings.toml, .cursor/worktrees.json, or script/setup) runs in the background in parallel with the first turn (skipped for cowboy). Pass the same tags on every workspace you open for one task (short labels such as "phone-sync") so they still match in the sidebar the next day. Reusing a checkout adds those tags. Each orchestration chat can create at most the Settings \u2192 Advanced \u201CMax orchestration threads\u201D cap of child workspaces (default 5). fork_chat on an existing checkout does not use a slot.`,
|
|
38557
38665
|
{
|
|
38558
38666
|
sourceType: import_zod12.z.enum(["branch", "pr", "ticket"]),
|
|
38559
38667
|
sourceRef: import_zod12.z.string(),
|
package/dist/mcp/run-stdio.js
CHANGED
|
@@ -45,7 +45,7 @@ import {
|
|
|
45
45
|
syncBoardPins,
|
|
46
46
|
workspaceTagTargetRef,
|
|
47
47
|
writeAgentBlock
|
|
48
|
-
} from "../chunk-
|
|
48
|
+
} from "../chunk-KCZM7WZ3.js";
|
|
49
49
|
import "../chunk-DC3VZXMA.js";
|
|
50
50
|
import {
|
|
51
51
|
SIDEBOARD_THREAD_ID_ENV,
|
|
@@ -55,7 +55,7 @@ import {
|
|
|
55
55
|
shouldRegisterMcpWaitForTurn,
|
|
56
56
|
sideboardMcpProfile,
|
|
57
57
|
worktreeMcpToolNames
|
|
58
|
-
} from "../chunk-
|
|
58
|
+
} from "../chunk-S3DTEGMK.js";
|
|
59
59
|
import {
|
|
60
60
|
mcpWaitForJobTimeoutMs,
|
|
61
61
|
mcpWaitForTurnTimeoutMs,
|
|
@@ -66,7 +66,7 @@ import {
|
|
|
66
66
|
waitForDetachedJob,
|
|
67
67
|
waitForTurnToolResult,
|
|
68
68
|
workspaceAgentChatSummaries
|
|
69
|
-
} from "../chunk-
|
|
69
|
+
} from "../chunk-DEQLDEYR.js";
|
|
70
70
|
import {
|
|
71
71
|
HUGE_TOOL_RESULT_SUMMARY,
|
|
72
72
|
clipToolResultForStore,
|
|
@@ -87,13 +87,13 @@ import {
|
|
|
87
87
|
searchAbleTimeTasks,
|
|
88
88
|
toAbleTimeIssueInfo,
|
|
89
89
|
updateAbleTimeTask
|
|
90
|
-
} from "../chunk-
|
|
91
|
-
import "../chunk-
|
|
92
|
-
import "../chunk-
|
|
90
|
+
} from "../chunk-3J3XOIHF.js";
|
|
91
|
+
import "../chunk-LHU6ZBFB.js";
|
|
92
|
+
import "../chunk-NDBMDHQ5.js";
|
|
93
93
|
import {
|
|
94
94
|
normalizeServiceOrigin
|
|
95
|
-
} from "../chunk-
|
|
96
|
-
import "../chunk-
|
|
95
|
+
} from "../chunk-5SJGR3VS.js";
|
|
96
|
+
import "../chunk-4PXHJA5K.js";
|
|
97
97
|
import {
|
|
98
98
|
PRESENT_PLAN_REQUIRES_PLAN_MODE,
|
|
99
99
|
PRESENT_PLAN_TOOL_DESCRIPTION,
|
|
@@ -104,8 +104,9 @@ import {
|
|
|
104
104
|
import {
|
|
105
105
|
GLOBAL_WORKSPACE_ID,
|
|
106
106
|
isCloudCoordinatorThread,
|
|
107
|
-
isGlobalThread
|
|
108
|
-
|
|
107
|
+
isGlobalThread,
|
|
108
|
+
isOrchestratorThread
|
|
109
|
+
} from "../chunk-5BFEHSHO.js";
|
|
109
110
|
import {
|
|
110
111
|
canonicalizeRepoPath,
|
|
111
112
|
formatGhLandError,
|
|
@@ -118,7 +119,7 @@ import {
|
|
|
118
119
|
resolveProjectRemoteTag,
|
|
119
120
|
resolveRepoRoot,
|
|
120
121
|
warmGithubAgentAuth
|
|
121
|
-
} from "../chunk-
|
|
122
|
+
} from "../chunk-RTZO2YJC.js";
|
|
122
123
|
import "../chunk-I6RGRUNY.js";
|
|
123
124
|
import "../chunk-E63AM3PW.js";
|
|
124
125
|
import {
|
|
@@ -131,7 +132,7 @@ import {
|
|
|
131
132
|
listLinearProjects,
|
|
132
133
|
listLinearTeams,
|
|
133
134
|
updateLinearIssue
|
|
134
|
-
} from "../chunk-
|
|
135
|
+
} from "../chunk-5TS3KVGI.js";
|
|
135
136
|
import {
|
|
136
137
|
formatGitHubSearchUpdatedSince,
|
|
137
138
|
issueMatchesUpdatedSince,
|
|
@@ -151,7 +152,7 @@ import {
|
|
|
151
152
|
import {
|
|
152
153
|
httpFetch
|
|
153
154
|
} from "../chunk-2GPQZZLY.js";
|
|
154
|
-
import "../chunk-
|
|
155
|
+
import "../chunk-3DMRQB4Y.js";
|
|
155
156
|
import "../chunk-GK7H3SY7.js";
|
|
156
157
|
import {
|
|
157
158
|
gh,
|
|
@@ -173,7 +174,7 @@ import {
|
|
|
173
174
|
scheduleNeedsCaffeinate,
|
|
174
175
|
updateSchedule,
|
|
175
176
|
updateThread
|
|
176
|
-
} from "../chunk-
|
|
177
|
+
} from "../chunk-JHT3CYLT.js";
|
|
177
178
|
import "../chunk-WMZIANPV.js";
|
|
178
179
|
import {
|
|
179
180
|
formatWorkspaceProfileSuffix,
|
|
@@ -181,12 +182,13 @@ import {
|
|
|
181
182
|
isLinearConnected,
|
|
182
183
|
isPosthogConnected,
|
|
183
184
|
loadAppSettings,
|
|
185
|
+
maxOrchThreads,
|
|
184
186
|
resolveEffectiveIssueSource,
|
|
185
187
|
resolveProjectReviewLabel,
|
|
186
188
|
resolveViewerProfile,
|
|
187
189
|
resolveViewerProfileForRepo,
|
|
188
190
|
wakeOrchestratorOnGithubEdgesEnabled
|
|
189
|
-
} from "../chunk-
|
|
191
|
+
} from "../chunk-S3UGLMGE.js";
|
|
190
192
|
import {
|
|
191
193
|
writePrivateFile
|
|
192
194
|
} from "../chunk-NSTQ6QKD.js";
|
|
@@ -1116,8 +1118,22 @@ function orchCreateThreadAgentNote(input) {
|
|
|
1116
1118
|
}
|
|
1117
1119
|
|
|
1118
1120
|
// src/mcp/create-orch-child.ts
|
|
1119
|
-
var MAX_ORCH_THREADS = 5;
|
|
1120
1121
|
var CREATE_THREAD_TIMEOUT_MS = 9e4;
|
|
1122
|
+
function orchChildWorkspaceCount(threads, parentId) {
|
|
1123
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1124
|
+
let unpathed = 0;
|
|
1125
|
+
for (const thread of threads) {
|
|
1126
|
+
if (thread.parentThreadId !== parentId) continue;
|
|
1127
|
+
if (isOrchestratorThread(thread)) continue;
|
|
1128
|
+
const raw = thread.worktreePath?.trim();
|
|
1129
|
+
if (!raw) {
|
|
1130
|
+
unpathed += 1;
|
|
1131
|
+
continue;
|
|
1132
|
+
}
|
|
1133
|
+
seen.add(normalizeWorktreePath(raw));
|
|
1134
|
+
}
|
|
1135
|
+
return seen.size + unpathed;
|
|
1136
|
+
}
|
|
1121
1137
|
function withTimeout(promise, ms, label) {
|
|
1122
1138
|
return new Promise((resolve, reject) => {
|
|
1123
1139
|
const timer = setTimeout(() => {
|
|
@@ -1155,11 +1171,12 @@ async function createOrchChildThread(orch, args, resolveNewThreadOptions) {
|
|
|
1155
1171
|
parent = null;
|
|
1156
1172
|
}
|
|
1157
1173
|
if (parentId) {
|
|
1158
|
-
const
|
|
1159
|
-
|
|
1174
|
+
const cap = maxOrchThreads();
|
|
1175
|
+
const used = orchChildWorkspaceCount(orch.getThreads(false), parentId);
|
|
1176
|
+
if (used >= cap) {
|
|
1160
1177
|
return {
|
|
1161
1178
|
ok: false,
|
|
1162
|
-
text: `
|
|
1179
|
+
text: `Workspace cap (${cap}) reached for this orchestration session. Raise it in Settings \u2192 Advanced \u2192 Max orchestration threads.`
|
|
1163
1180
|
};
|
|
1164
1181
|
}
|
|
1165
1182
|
}
|
|
@@ -4131,7 +4148,7 @@ async function startMcpServer() {
|
|
|
4131
4148
|
);
|
|
4132
4149
|
}
|
|
4133
4150
|
try {
|
|
4134
|
-
const { maxConcurrentAgents } = await import("../app-settings-
|
|
4151
|
+
const { maxConcurrentAgents } = await import("../app-settings-Q2F57NVK.js");
|
|
4135
4152
|
orch.setMaxConcurrent(maxConcurrentAgents());
|
|
4136
4153
|
} catch {
|
|
4137
4154
|
}
|
|
@@ -4710,7 +4727,7 @@ async function startMcpServer() {
|
|
|
4710
4727
|
if (!worktreeProfile) {
|
|
4711
4728
|
registerConnectedIssueVendorTools(server);
|
|
4712
4729
|
const { getCaffeinateHold, setCaffeinateHold } = await import("../caffeinate-hold-H7TTUDGM.js");
|
|
4713
|
-
const { resolveNewThreadOptions, resolveThreadDefaults } = await import("../app-settings-
|
|
4730
|
+
const { resolveNewThreadOptions, resolveThreadDefaults } = await import("../app-settings-Q2F57NVK.js");
|
|
4714
4731
|
const accountDefaults = resolveThreadDefaults();
|
|
4715
4732
|
const accountDefaultsHint = `Account defaults: agent=${accountDefaults.agent}, model=${accountDefaults.model?.trim() || "Auto"}, effort=${accountDefaults.effort}`;
|
|
4716
4733
|
server.tool(
|
|
@@ -4741,7 +4758,7 @@ async function startMcpServer() {
|
|
|
4741
4758
|
);
|
|
4742
4759
|
server.tool(
|
|
4743
4760
|
"create_workspace",
|
|
4744
|
-
`Create a workspace (isolated git checkout + first chat) from branch, pr, or ticket. A ticket, PR, or named branch has one checkout \u2014 if one already matches, returns it (alreadyStarted=true) instead of a second checkout. That is not one agent: chats lists every agent on that checkout. Add another with fork_chat; send_to_chat only the chat that should do this job. Creating from the default branch still opens a new isolated checkout. Pass repoPath from list_projects. cowboy=true uses the project folder on the default branch (no isolated worktree; land is commit+push). From an orchestration chat, omit parentChatId (Sideboard binds the child to this chat) or pass the exact id from the turn reminder \u2014 never invent a uuid. Omit agent/model \u2014 Sideboard applies ${accountDefaultsHint}. Do not pass your own agent or agent=cursor; those are ignored. Setup (settings.toml, .cursor/worktrees.json, or script/setup) runs in the background in parallel with the first turn (skipped for cowboy). Pass the same tags on every workspace you open for one task (short labels such as "phone-sync") so they still match in the sidebar the next day. Reusing a checkout adds those tags.`,
|
|
4761
|
+
`Create a workspace (isolated git checkout + first chat) from branch, pr, or ticket. A ticket, PR, or named branch has one checkout \u2014 if one already matches, returns it (alreadyStarted=true) instead of a second checkout. That is not one agent: chats lists every agent on that checkout. Add another with fork_chat; send_to_chat only the chat that should do this job. Creating from the default branch still opens a new isolated checkout. Pass repoPath from list_projects. cowboy=true uses the project folder on the default branch (no isolated worktree; land is commit+push). From an orchestration chat, omit parentChatId (Sideboard binds the child to this chat) or pass the exact id from the turn reminder \u2014 never invent a uuid. Omit agent/model \u2014 Sideboard applies ${accountDefaultsHint}. Do not pass your own agent or agent=cursor; those are ignored. Setup (settings.toml, .cursor/worktrees.json, or script/setup) runs in the background in parallel with the first turn (skipped for cowboy). Pass the same tags on every workspace you open for one task (short labels such as "phone-sync") so they still match in the sidebar the next day. Reusing a checkout adds those tags. Each orchestration chat can create at most the Settings \u2192 Advanced \u201CMax orchestration threads\u201D cap of child workspaces (default 5). fork_chat on an existing checkout does not use a slot.`,
|
|
4745
4762
|
{
|
|
4746
4763
|
sourceType: z9.enum(["branch", "pr", "ticket"]),
|
|
4747
4764
|
sourceRef: z9.string(),
|
|
@@ -4,16 +4,16 @@ import {
|
|
|
4
4
|
OPTIONAL_SERVICES,
|
|
5
5
|
isOptionalServiceId,
|
|
6
6
|
optionalServiceSpec
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-5SJGR3VS.js";
|
|
8
8
|
import {
|
|
9
9
|
installNpmGlobalPackage,
|
|
10
10
|
whichOnPath
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-4PXHJA5K.js";
|
|
12
12
|
import "./chunk-2GPQZZLY.js";
|
|
13
13
|
import {
|
|
14
14
|
enrichPathWithNpmGlobalBin
|
|
15
15
|
} from "./chunk-TL2HK6LZ.js";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-S3UGLMGE.js";
|
|
17
17
|
import "./chunk-NSTQ6QKD.js";
|
|
18
18
|
import "./chunk-WWUABK6B.js";
|
|
19
19
|
import "./chunk-FJZWM2ON.js";
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
detectOptionalServiceClis,
|
|
4
4
|
installOptionalServiceCli,
|
|
5
5
|
optionalCliPresence
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-SLLTEMIL.js";
|
|
7
|
+
import "./chunk-4TTTEKNV.js";
|
|
8
|
+
import "./chunk-6RO2AOE5.js";
|
|
9
9
|
import "./chunk-JAT3JFOS.js";
|
|
10
10
|
import "./chunk-R4W4VQJZ.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-TKEYXNXY.js";
|
|
12
12
|
import "./chunk-4TR3HZFT.js";
|
|
13
13
|
import "./chunk-WDRMZKVB.js";
|
|
14
14
|
import "./chunk-KI45T4DI.js";
|