@sideboard-ai/core 0.1.153 → 0.1.156
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/cursor-runner.cjs +6 -1
- package/dist/agents/cursor-runner.js +6 -1
- package/dist/{agents-V24DYZI4.js → agents-2FTZAXO3.js} +4 -2
- package/dist/{agents-YVW75KBO.js → agents-IY4CSPWV.js} +4 -2
- package/dist/{chunk-KMNODRWF.js → chunk-7EIPEPAH.js} +22 -24
- package/dist/{chunk-2F63IMCL.js → chunk-MSFPM5VK.js} +3 -3
- package/dist/{chunk-2NRNP7QP.js → chunk-OLE2BLIX.js} +15 -23
- package/dist/{chunk-RNC3GR6L.js → chunk-TI6UMRWK.js} +3 -3
- package/dist/{chunk-4THE3EY7.js → chunk-UA3YZKRX.js} +197 -38
- package/dist/{chunk-QZEZXYVV.js → chunk-XLU7DXHH.js} +260 -32
- package/dist/{coordinator-prompt-7FHKCWXB.js → coordinator-prompt-D2FHU5IZ.js} +1 -1
- package/dist/{coordinator-prompt-KX2FVVYT.js → coordinator-prompt-UZDNIVP7.js} +1 -1
- package/dist/{global-workspace-2BRRKSDN.js → global-workspace-5WZVSWNT.js} +1 -1
- package/dist/{global-workspace-4LHCZ2DC.js → global-workspace-MR75BDBY.js} +1 -1
- package/dist/index.cjs +510 -337
- package/dist/index.d.cts +50 -2
- package/dist/index.d.ts +50 -2
- package/dist/index.js +19 -73
- package/dist/mcp/run-stdio.cjs +437 -274
- package/dist/mcp/run-stdio.js +3 -3
- package/dist/{orchestrator-5PSHBLP6.js → orchestrator-G4WKJG5Y.js} +3 -3
- package/dist/{orchestrator-ZSSU3FKW.js → orchestrator-LXO2CDOG.js} +3 -3
- package/dist/{workspaces-MQYNZXUK.js → workspaces-HO4EQNNM.js} +1 -1
- package/dist/{workspaces-5UNDTN4G.js → workspaces-RP32AW6X.js} +1 -1
- package/package.json +1 -1
|
@@ -771,7 +771,12 @@ async function main() {
|
|
|
771
771
|
});
|
|
772
772
|
const mode = req.planMode ? "plan" : "agent";
|
|
773
773
|
const store = localAgentStore(req.threadId);
|
|
774
|
-
const
|
|
774
|
+
const isolateSources = [];
|
|
775
|
+
const local = withCursorLocalHangGuards({
|
|
776
|
+
cwd: req.cwd,
|
|
777
|
+
store,
|
|
778
|
+
...req.isolateAmbientMcp ? { settingSources: isolateSources } : {}
|
|
779
|
+
});
|
|
775
780
|
const mcpServers = req.mcpServers && Object.keys(req.mcpServers).length > 0 ? req.mcpServers : void 0;
|
|
776
781
|
const createOpts = {
|
|
777
782
|
apiKey,
|
|
@@ -210,7 +210,12 @@ async function main() {
|
|
|
210
210
|
});
|
|
211
211
|
const mode = req.planMode ? "plan" : "agent";
|
|
212
212
|
const store = localAgentStore(req.threadId);
|
|
213
|
-
const
|
|
213
|
+
const isolateSources = [];
|
|
214
|
+
const local = withCursorLocalHangGuards({
|
|
215
|
+
cwd: req.cwd,
|
|
216
|
+
store,
|
|
217
|
+
...req.isolateAmbientMcp ? { settingSources: isolateSources } : {}
|
|
218
|
+
});
|
|
214
219
|
const mcpServers = req.mcpServers && Object.keys(req.mcpServers).length > 0 ? req.mcpServers : void 0;
|
|
215
220
|
const createOpts = {
|
|
216
221
|
apiKey,
|
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
listModelsForAgent,
|
|
25
25
|
listOpencodeModels,
|
|
26
26
|
loginAgent,
|
|
27
|
+
mcpStatusThinkingFromClaudeInit,
|
|
27
28
|
openInSystemTerminal,
|
|
28
29
|
opencodeAdapter,
|
|
29
30
|
parseCursorRunnerLine,
|
|
@@ -36,7 +37,7 @@ import {
|
|
|
36
37
|
resolveQuotaFallbackAgent,
|
|
37
38
|
turnCostUsdFromCursorUsage,
|
|
38
39
|
whichOnPath
|
|
39
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-UA3YZKRX.js";
|
|
40
41
|
import "./chunk-LZ6QMEQC.js";
|
|
41
42
|
import "./chunk-S42XV45P.js";
|
|
42
43
|
import "./chunk-6GN5WPYZ.js";
|
|
@@ -45,7 +46,7 @@ import {
|
|
|
45
46
|
assertOrchestratorCapableAgent,
|
|
46
47
|
coerceOrchestratorAgent,
|
|
47
48
|
isOrchestratorCapableAgent
|
|
48
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-TI6UMRWK.js";
|
|
49
50
|
import "./chunk-CJQLPPEJ.js";
|
|
50
51
|
import "./chunk-NVXVEGGM.js";
|
|
51
52
|
import "./chunk-LZQULFIT.js";
|
|
@@ -95,6 +96,7 @@ export {
|
|
|
95
96
|
listModelsForAgent,
|
|
96
97
|
listOpencodeModels,
|
|
97
98
|
loginAgent,
|
|
99
|
+
mcpStatusThinkingFromClaudeInit,
|
|
98
100
|
openInSystemTerminal,
|
|
99
101
|
opencodeAdapter,
|
|
100
102
|
parseCursorRunnerLine,
|
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
listModelsForAgent,
|
|
22
22
|
listOpencodeModels,
|
|
23
23
|
loginAgent,
|
|
24
|
+
mcpStatusThinkingFromClaudeInit,
|
|
24
25
|
openInSystemTerminal,
|
|
25
26
|
opencodeAdapter,
|
|
26
27
|
parseSessionQuotaResetAt,
|
|
@@ -30,13 +31,13 @@ import {
|
|
|
30
31
|
resolveLoginCommand,
|
|
31
32
|
resolveQuotaFallbackAgent,
|
|
32
33
|
whichOnPath
|
|
33
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-XLU7DXHH.js";
|
|
34
35
|
import {
|
|
35
36
|
ORCHESTRATOR_AGENT_KINDS,
|
|
36
37
|
assertOrchestratorCapableAgent,
|
|
37
38
|
coerceOrchestratorAgent,
|
|
38
39
|
isOrchestratorCapableAgent
|
|
39
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-MSFPM5VK.js";
|
|
40
41
|
import "./chunk-LQMFCS54.js";
|
|
41
42
|
import "./chunk-JRH62XC4.js";
|
|
42
43
|
import "./chunk-XD2BAANL.js";
|
|
@@ -96,6 +97,7 @@ export {
|
|
|
96
97
|
listModelsForAgent,
|
|
97
98
|
listOpencodeModels,
|
|
98
99
|
loginAgent,
|
|
100
|
+
mcpStatusThinkingFromClaudeInit,
|
|
99
101
|
openInSystemTerminal,
|
|
100
102
|
opencodeAdapter,
|
|
101
103
|
parseCursorRunnerLine,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
stripBrightsyNdjsonNoise,
|
|
25
25
|
sumUsageList,
|
|
26
26
|
toolDescription
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-XLU7DXHH.js";
|
|
28
28
|
import {
|
|
29
29
|
SLACK_REPLY_FORMATTING,
|
|
30
30
|
addWorkspace,
|
|
@@ -50,7 +50,7 @@ import {
|
|
|
50
50
|
stageAbsolutePathsAsAttachments,
|
|
51
51
|
stageBuffersAsAttachments,
|
|
52
52
|
syncWorkspacesFromThreads
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-MSFPM5VK.js";
|
|
54
54
|
import {
|
|
55
55
|
addPrStackLayer,
|
|
56
56
|
allocateTeamName,
|
|
@@ -457,7 +457,7 @@ async function continueSourceThread(threadId, prompt) {
|
|
|
457
457
|
await continueOnReply(threadId, prompt);
|
|
458
458
|
return;
|
|
459
459
|
}
|
|
460
|
-
const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-
|
|
460
|
+
const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-G4WKJG5Y.js");
|
|
461
461
|
await getOrchestrator2().send(threadId, prompt);
|
|
462
462
|
} catch {
|
|
463
463
|
}
|
|
@@ -737,9 +737,9 @@ async function spawnAgentTurn(thread, input, onEvent) {
|
|
|
737
737
|
`Cannot spawn ${thread.agent}: thread ${thread.id} has no worktreePath`
|
|
738
738
|
);
|
|
739
739
|
}
|
|
740
|
-
const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-
|
|
740
|
+
const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-5WZVSWNT.js");
|
|
741
741
|
if (isGlobalThread2(thread)) {
|
|
742
|
-
const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-
|
|
742
|
+
const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-D2FHU5IZ.js");
|
|
743
743
|
ensureGlobalCoordinatorCwd2(
|
|
744
744
|
isOrchestratorThread(thread) ? { orchestratorThreadId: thread.id } : void 0
|
|
745
745
|
);
|
|
@@ -3297,7 +3297,7 @@ async function createThread(input, _onSetupLine) {
|
|
|
3297
3297
|
return readThread(thread.id) ?? thread;
|
|
3298
3298
|
}
|
|
3299
3299
|
async function listLinearIssues(agent, repoPath) {
|
|
3300
|
-
const { getAdapter: getAdapter2 } = await import("./agents-
|
|
3300
|
+
const { getAdapter: getAdapter2 } = await import("./agents-IY4CSPWV.js");
|
|
3301
3301
|
await requireAgent(agent, { requireLinear: true });
|
|
3302
3302
|
const adapter = getAdapter2(agent);
|
|
3303
3303
|
if (!adapter.listLinearIssues) {
|
|
@@ -3451,9 +3451,13 @@ function shouldReadThreadToHealReconcile(eventType, lastCheckAt, now) {
|
|
|
3451
3451
|
// src/orchestrator/setup-last-error.ts
|
|
3452
3452
|
function shouldStampSetupLastError(opts) {
|
|
3453
3453
|
if (opts.turnInFlight) return false;
|
|
3454
|
-
if (opts.status === "running") return false;
|
|
3454
|
+
if (opts.status === "running" || opts.status === "queued") return false;
|
|
3455
|
+
if (opts.hasQueuedPrompt) return false;
|
|
3455
3456
|
return true;
|
|
3456
3457
|
}
|
|
3458
|
+
function isSetupLastError(err) {
|
|
3459
|
+
return /^Setup (exited|failed)\b/i.test(err?.trim() ?? "");
|
|
3460
|
+
}
|
|
3457
3461
|
function isStaleLastErrorDuringTurn(err) {
|
|
3458
3462
|
return Boolean(err?.trim());
|
|
3459
3463
|
}
|
|
@@ -3704,7 +3708,7 @@ async function adoptThread(input) {
|
|
|
3704
3708
|
messages: input.messages ?? []
|
|
3705
3709
|
});
|
|
3706
3710
|
writeThread(thread);
|
|
3707
|
-
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-
|
|
3711
|
+
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-RP32AW6X.js");
|
|
3708
3712
|
await ensureWorkspace2(repoPath);
|
|
3709
3713
|
const { ensureWorktreeSideboardIgnored: ensureWorktreeSideboardIgnored2 } = await import("./worktree-exclude-X54WSOXM.js");
|
|
3710
3714
|
await ensureWorktreeSideboardIgnored2(input.worktreePath);
|
|
@@ -6174,7 +6178,7 @@ function formatScheduledPrompt(name, prompt) {
|
|
|
6174
6178
|
${prompt}`;
|
|
6175
6179
|
}
|
|
6176
6180
|
async function defaultDeps() {
|
|
6177
|
-
const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-
|
|
6181
|
+
const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-G4WKJG5Y.js");
|
|
6178
6182
|
const orch = getOrchestrator2();
|
|
6179
6183
|
return {
|
|
6180
6184
|
findThread: (id) => findThreadByRef(id),
|
|
@@ -6684,21 +6688,11 @@ var Orchestrator = class {
|
|
|
6684
6688
|
/** Run workspace setup after a new worktree is created (no-op if none configured). */
|
|
6685
6689
|
async runSetupAfterCreate(threadId) {
|
|
6686
6690
|
try {
|
|
6687
|
-
await this.runSetup(threadId);
|
|
6691
|
+
await this.runSetup(threadId, { stampLastError: false });
|
|
6688
6692
|
} catch (err) {
|
|
6689
6693
|
const message = err instanceof Error ? err.message : String(err);
|
|
6690
6694
|
if (/no setup script/i.test(message)) return;
|
|
6691
6695
|
if (/already running/i.test(message)) return;
|
|
6692
|
-
const live = readThread(threadId);
|
|
6693
|
-
if (!shouldStampSetupLastError({
|
|
6694
|
-
turnInFlight: this.activeTurns.has(threadId) || this.startingTurns.has(threadId),
|
|
6695
|
-
status: live?.status
|
|
6696
|
-
})) {
|
|
6697
|
-
return;
|
|
6698
|
-
}
|
|
6699
|
-
updateThread(threadId, {
|
|
6700
|
-
lastError: `Setup failed: ${message}`
|
|
6701
|
-
});
|
|
6702
6696
|
}
|
|
6703
6697
|
}
|
|
6704
6698
|
listWorkspaces() {
|
|
@@ -7486,7 +7480,7 @@ var Orchestrator = class {
|
|
|
7486
7480
|
}
|
|
7487
7481
|
return snap;
|
|
7488
7482
|
}
|
|
7489
|
-
async runSetup(threadRef) {
|
|
7483
|
+
async runSetup(threadRef, opts) {
|
|
7490
7484
|
const thread = this.requireThread(threadRef);
|
|
7491
7485
|
this.assertNotGlobal(thread, "Setup");
|
|
7492
7486
|
const key = `${thread.id}:setup`;
|
|
@@ -7527,9 +7521,10 @@ var Orchestrator = class {
|
|
|
7527
7521
|
}
|
|
7528
7522
|
if (setup.exitCode !== 0 && setup.exitCode !== null) {
|
|
7529
7523
|
const live = readThread(thread.id);
|
|
7530
|
-
if (shouldStampSetupLastError({
|
|
7524
|
+
if ((opts?.stampLastError ?? true) && shouldStampSetupLastError({
|
|
7531
7525
|
turnInFlight: this.activeTurns.has(thread.id) || this.startingTurns.has(thread.id),
|
|
7532
|
-
status: live?.status
|
|
7526
|
+
status: live?.status,
|
|
7527
|
+
hasQueuedPrompt: Boolean(live?.queue?.length)
|
|
7533
7528
|
})) {
|
|
7534
7529
|
updateThread(thread.id, {
|
|
7535
7530
|
lastError: `Setup exited ${setup.exitCode}`
|
|
@@ -8184,7 +8179,7 @@ var Orchestrator = class {
|
|
|
8184
8179
|
this.emit({ type: "status_changed", threadId: archived.id, status: "archived" });
|
|
8185
8180
|
if (thread.repoPath && !isGlobalRepoPath(thread.repoPath)) {
|
|
8186
8181
|
try {
|
|
8187
|
-
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-
|
|
8182
|
+
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-RP32AW6X.js");
|
|
8188
8183
|
await ensureWorkspace2(thread.repoPath);
|
|
8189
8184
|
} catch {
|
|
8190
8185
|
}
|
|
@@ -8522,6 +8517,9 @@ export {
|
|
|
8522
8517
|
isPrimaryCheckoutThread,
|
|
8523
8518
|
shouldRemoveWorktreeOnTeardown,
|
|
8524
8519
|
readTurnLive,
|
|
8520
|
+
shouldStampSetupLastError,
|
|
8521
|
+
isSetupLastError,
|
|
8522
|
+
isStaleLastErrorDuringTurn,
|
|
8525
8523
|
forkThreadWorktree,
|
|
8526
8524
|
resolveConductorCursorAgentId,
|
|
8527
8525
|
adoptThread,
|
|
@@ -395,8 +395,8 @@ var COORDINATOR_TOOL_PLAYBOOK = [
|
|
|
395
395
|
"- list_workspaces \u2014 registered repos (path + github slug + roles/notes when set). Use that profile to pick the right repo for tickets or reviews.",
|
|
396
396
|
"- list_board \u2014 Home Kanban of worktrees (New / Draft / Review / Merged; one card per checkout). Path to merge: no PR \u2192 draft PR \u2192 open PR \u2192 merged. Archive removes the card to Settings \u2192 History. Queued/running are activity on the card, not columns. Orchestration chats are not on the board. Filters: query, repoPath, kind, column, limit.",
|
|
397
397
|
'- list_branches / list_prs / list_issues \u2014 pass repoPath from list_workspaces. Review is PRs (the surface for assigned ticket work), not the tickets: "Get me N tickets to review" \u2192 list_prs(queue=review, limit=N) then create_thread sourceType=pr. That is open non-draft PRs labeled eng-review with no individual user reviewer yet. A team request (engineering-team) is not a claim \u2014 the viewer is on that team and can pick it up; claimed means an individual account is the reviewer. Bots ignored. Prefer teams that match Settings \u2192 Agents / Projects roles (check one or more of Engineering, Design, Product, or extras they added \u2014 never a combined both value; project roles override account for that repo). queue=mine is review-requested:@me; queue=approved|changes uses those labels. Also: state, label, reviewer=me|unassigned|login, query, limit default 40 max 250; raise limit or tighten when truncated. list_issues (query, assignee=me|unassigned|all|user, limit default 40 max 250) lists Linear, AbleTime, or GitHub tickets \u2014 do not use it for that review-inbox ask. When they ask for tickets to work on, use their notes (assignee=me or unassigned as the notes say) and prefer ones that match their roles.',
|
|
398
|
-
"- Find work: when they ask to find work, pick up tickets, or list reviews, use Settings \u2192 Agents (account) plus Settings \u2192 Projects (per-repo) roles and notes. Tickets \u2192 list_issues. Reviews \u2192 list_prs(queue=review). Show the options \u2014 do not create_thread or start unless they also asked to start (e.g. \u201Cfind me work and start it\u201D). Do not start this unprompted.",
|
|
399
|
-
"- linear_* (when Linear is connected) \u2014 list_teams for team key/states; get/create/update/comment with ENG-123. Scope errors: reconnect Linear in Account settings.",
|
|
398
|
+
"- Find work: when they ask to find work, pick up tickets, or list reviews, use Settings \u2192 Agents (account) plus Settings \u2192 Projects (per-repo) roles and notes. Tickets \u2192 Sideboard list_issues / linear_* (Account Linear). Reviews \u2192 list_prs(queue=review). Do not call Claude Linear MCP or any other vendor Linear MCP \u2014 those HTTP connectors hang or flap on the first turn. If a vendor MCP is down or reconnecting, ignore it and keep going with Sideboard tools. Show the options \u2014 do not create_thread or start unless they also asked to start (e.g. \u201Cfind me work and start it\u201D). Do not start this unprompted.",
|
|
399
|
+
"- linear_* (when Linear is connected) \u2014 list_teams for team key/states; get/create/update/comment with ENG-123. Scope errors: reconnect Linear in Account settings. Prefer these over any Linear MCP the CLI may still list.",
|
|
400
400
|
"- abletime_* (when AbleTime is connected) \u2014 orientation first; ensure_task when work has no ticket (or create_thread from the default branch auto-creates one).",
|
|
401
401
|
"- list_teams / slack_list_channels / slack_list_users / slack_search / slack_read / slack_post / slack_replies \u2014 Slack workspaces from Settings \u2192 Remote; pass team_id from list_teams",
|
|
402
402
|
"- Optional connectors (Vercel, Supabase, PostHog, Sentry) in Settings \u2192 Connectors inject tokens into worktree agent env when connected. Prefer official CLIs (`vercel`, `supabase`, `sentry-cli`) with those env vars. PostHog has no first-class CLI \u2014 use the HTTP API (`POSTHOG_PERSONAL_API_KEY`). If a CLI is missing, the user can Install CLI on that row (not auto-installed on Connect). Do not add vendor MCPs or ask the user to paste tokens again. Git (`gh`) stays Settings \u2192 Git; issue tracking stays Settings \u2192 Issues; Slack stays Settings \u2192 Remote (Sideboard MCP).",
|
|
@@ -557,7 +557,7 @@ function ensureGlobalCoordinatorCwd(opts) {
|
|
|
557
557
|
"Never pass `agent=codex` when you yourself are Codex \u2014 nested Codex deadlocks on shared ~/.codex locks. Omit agent (Account default) or use cursor/claude.",
|
|
558
558
|
"Typical flow (Home board): list_board \u2192 create_thread (sourceType=ticket|pr|branch) \u2192 send_to_thread \u2192 wait_for_turn (loop while stillRunning) \u2192 ask_git create-draft \u2192 wait_for_turn. Merge only if the user explicitly asked (`ask_git` merge).",
|
|
559
559
|
"Typical flow (branch / explicit source): list_workspaces \u2192 list_branches|list_prs|list_issues \u2192 create_thread \u2192 send_to_thread \u2192 wait_for_turn (loop while stillRunning) \u2192 ask_git create-draft.",
|
|
560
|
-
"Typical flow (find work): list_workspaces \u2192 pick repo(s) matching viewer roles/notes \u2192 list_issues (tickets) or list_prs(queue=review) (reviews) \u2192 show the options. Only create_thread + send_to_thread when they asked to start (e.g. \u201Cfind me work and start it\u201D) \u2014 then wait_for_turn (loop while stillRunning) \u2192 ask_git create-draft.",
|
|
560
|
+
"Typical flow (find work): list_workspaces \u2192 pick repo(s) matching viewer roles/notes \u2192 Sideboard list_issues / linear_* (tickets) or list_prs(queue=review) (reviews) \u2192 show the options. Never wait on Claude Linear MCP. Only create_thread + send_to_thread when they asked to start (e.g. \u201Cfind me work and start it\u201D) \u2014 then wait_for_turn (loop while stillRunning) \u2192 ask_git create-draft.",
|
|
561
561
|
'Typical flow (review inbox): list_workspaces \u2192 list_prs(queue=review, limit=N) \u2192 show those PRs (ticket ids in the title when present). create_thread sourceType=pr only when they asked to start / do the work. Do not list_issues for "tickets to review".',
|
|
562
562
|
"Typical flow (new app): Bash create/clone under repos dir \u2192 add_workspace \u2192 create_thread \u2192 send_to_thread (implement) \u2192 wait_for_turn (loop while stillRunning) \u2192 ask_git create-draft.",
|
|
563
563
|
"Always ask worktree agents to commit, push, and open draft PRs (`ask_git` / `send_to_thread`). If the user gave a goal (Greptile 5/5, CI green), pass that goal through so they watch-fix-push until it lands \u2014 do not start that loop on a plain push, and do not tell the human to poll. Tell them to merge only when the user explicitly asked. The worktree agent runs git/gh; never merge from this orchestration cwd."
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
summarizeTurnStderr,
|
|
34
34
|
toolDescription,
|
|
35
35
|
turnFailChatText
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-UA3YZKRX.js";
|
|
37
37
|
import {
|
|
38
38
|
extractPresentedPlan,
|
|
39
39
|
readPlanFile,
|
|
@@ -67,7 +67,7 @@ import {
|
|
|
67
67
|
stageAbsolutePathsAsAttachments,
|
|
68
68
|
stageBuffersAsAttachments,
|
|
69
69
|
syncWorkspacesFromThreads
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-TI6UMRWK.js";
|
|
71
71
|
import {
|
|
72
72
|
addPrStackLayer,
|
|
73
73
|
allocateTeamName,
|
|
@@ -392,7 +392,7 @@ async function continueSourceThread(threadId, prompt) {
|
|
|
392
392
|
await continueOnReply(threadId, prompt);
|
|
393
393
|
return;
|
|
394
394
|
}
|
|
395
|
-
const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-
|
|
395
|
+
const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-LXO2CDOG.js");
|
|
396
396
|
await getOrchestrator2().send(threadId, prompt);
|
|
397
397
|
} catch {
|
|
398
398
|
}
|
|
@@ -733,9 +733,9 @@ async function spawnAgentTurn(thread, input, onEvent) {
|
|
|
733
733
|
`Cannot spawn ${thread.agent}: thread ${thread.id} has no worktreePath`
|
|
734
734
|
);
|
|
735
735
|
}
|
|
736
|
-
const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-
|
|
736
|
+
const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-MR75BDBY.js");
|
|
737
737
|
if (isGlobalThread2(thread)) {
|
|
738
|
-
const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-
|
|
738
|
+
const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-UZDNIVP7.js");
|
|
739
739
|
ensureGlobalCoordinatorCwd2(
|
|
740
740
|
isOrchestratorThread(thread) ? { orchestratorThreadId: thread.id } : void 0
|
|
741
741
|
);
|
|
@@ -3315,7 +3315,8 @@ function shouldReadThreadToHealReconcile(eventType, lastCheckAt, now) {
|
|
|
3315
3315
|
// src/orchestrator/setup-last-error.ts
|
|
3316
3316
|
function shouldStampSetupLastError(opts) {
|
|
3317
3317
|
if (opts.turnInFlight) return false;
|
|
3318
|
-
if (opts.status === "running") return false;
|
|
3318
|
+
if (opts.status === "running" || opts.status === "queued") return false;
|
|
3319
|
+
if (opts.hasQueuedPrompt) return false;
|
|
3319
3320
|
return true;
|
|
3320
3321
|
}
|
|
3321
3322
|
function isStaleLastErrorDuringTurn(err) {
|
|
@@ -3568,7 +3569,7 @@ async function adoptThread(input) {
|
|
|
3568
3569
|
messages: input.messages ?? []
|
|
3569
3570
|
});
|
|
3570
3571
|
writeThread(thread);
|
|
3571
|
-
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-
|
|
3572
|
+
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-HO4EQNNM.js");
|
|
3572
3573
|
await ensureWorkspace2(repoPath);
|
|
3573
3574
|
const { ensureWorktreeSideboardIgnored: ensureWorktreeSideboardIgnored2 } = await import("./worktree-exclude-N5X5I422.js");
|
|
3574
3575
|
await ensureWorktreeSideboardIgnored2(input.worktreePath);
|
|
@@ -5789,7 +5790,7 @@ function formatScheduledPrompt(name, prompt) {
|
|
|
5789
5790
|
${prompt}`;
|
|
5790
5791
|
}
|
|
5791
5792
|
async function defaultDeps() {
|
|
5792
|
-
const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-
|
|
5793
|
+
const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-LXO2CDOG.js");
|
|
5793
5794
|
const orch = getOrchestrator2();
|
|
5794
5795
|
return {
|
|
5795
5796
|
findThread: (id) => findThreadByRef(id),
|
|
@@ -6299,21 +6300,11 @@ var Orchestrator = class {
|
|
|
6299
6300
|
/** Run workspace setup after a new worktree is created (no-op if none configured). */
|
|
6300
6301
|
async runSetupAfterCreate(threadId) {
|
|
6301
6302
|
try {
|
|
6302
|
-
await this.runSetup(threadId);
|
|
6303
|
+
await this.runSetup(threadId, { stampLastError: false });
|
|
6303
6304
|
} catch (err) {
|
|
6304
6305
|
const message = err instanceof Error ? err.message : String(err);
|
|
6305
6306
|
if (/no setup script/i.test(message)) return;
|
|
6306
6307
|
if (/already running/i.test(message)) return;
|
|
6307
|
-
const live = readThread(threadId);
|
|
6308
|
-
if (!shouldStampSetupLastError({
|
|
6309
|
-
turnInFlight: this.activeTurns.has(threadId) || this.startingTurns.has(threadId),
|
|
6310
|
-
status: live?.status
|
|
6311
|
-
})) {
|
|
6312
|
-
return;
|
|
6313
|
-
}
|
|
6314
|
-
updateThread(threadId, {
|
|
6315
|
-
lastError: `Setup failed: ${message}`
|
|
6316
|
-
});
|
|
6317
6308
|
}
|
|
6318
6309
|
}
|
|
6319
6310
|
listWorkspaces() {
|
|
@@ -7101,7 +7092,7 @@ var Orchestrator = class {
|
|
|
7101
7092
|
}
|
|
7102
7093
|
return snap;
|
|
7103
7094
|
}
|
|
7104
|
-
async runSetup(threadRef) {
|
|
7095
|
+
async runSetup(threadRef, opts) {
|
|
7105
7096
|
const thread = this.requireThread(threadRef);
|
|
7106
7097
|
this.assertNotGlobal(thread, "Setup");
|
|
7107
7098
|
const key = `${thread.id}:setup`;
|
|
@@ -7142,9 +7133,10 @@ var Orchestrator = class {
|
|
|
7142
7133
|
}
|
|
7143
7134
|
if (setup.exitCode !== 0 && setup.exitCode !== null) {
|
|
7144
7135
|
const live = readThread(thread.id);
|
|
7145
|
-
if (shouldStampSetupLastError({
|
|
7136
|
+
if ((opts?.stampLastError ?? true) && shouldStampSetupLastError({
|
|
7146
7137
|
turnInFlight: this.activeTurns.has(thread.id) || this.startingTurns.has(thread.id),
|
|
7147
|
-
status: live?.status
|
|
7138
|
+
status: live?.status,
|
|
7139
|
+
hasQueuedPrompt: Boolean(live?.queue?.length)
|
|
7148
7140
|
})) {
|
|
7149
7141
|
updateThread(thread.id, {
|
|
7150
7142
|
lastError: `Setup exited ${setup.exitCode}`
|
|
@@ -7799,7 +7791,7 @@ var Orchestrator = class {
|
|
|
7799
7791
|
this.emit({ type: "status_changed", threadId: archived.id, status: "archived" });
|
|
7800
7792
|
if (thread.repoPath && !isGlobalRepoPath(thread.repoPath)) {
|
|
7801
7793
|
try {
|
|
7802
|
-
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-
|
|
7794
|
+
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-HO4EQNNM.js");
|
|
7803
7795
|
await ensureWorkspace2(thread.repoPath);
|
|
7804
7796
|
} catch {
|
|
7805
7797
|
}
|
|
@@ -350,8 +350,8 @@ var COORDINATOR_TOOL_PLAYBOOK = [
|
|
|
350
350
|
"- list_workspaces \u2014 registered repos (path + github slug + roles/notes when set). Use that profile to pick the right repo for tickets or reviews.",
|
|
351
351
|
"- list_board \u2014 Home Kanban of worktrees (New / Draft / Review / Merged; one card per checkout). Path to merge: no PR \u2192 draft PR \u2192 open PR \u2192 merged. Archive removes the card to Settings \u2192 History. Queued/running are activity on the card, not columns. Orchestration chats are not on the board. Filters: query, repoPath, kind, column, limit.",
|
|
352
352
|
'- list_branches / list_prs / list_issues \u2014 pass repoPath from list_workspaces. Review is PRs (the surface for assigned ticket work), not the tickets: "Get me N tickets to review" \u2192 list_prs(queue=review, limit=N) then create_thread sourceType=pr. That is open non-draft PRs labeled eng-review with no individual user reviewer yet. A team request (engineering-team) is not a claim \u2014 the viewer is on that team and can pick it up; claimed means an individual account is the reviewer. Bots ignored. Prefer teams that match Settings \u2192 Agents / Projects roles (check one or more of Engineering, Design, Product, or extras they added \u2014 never a combined both value; project roles override account for that repo). queue=mine is review-requested:@me; queue=approved|changes uses those labels. Also: state, label, reviewer=me|unassigned|login, query, limit default 40 max 250; raise limit or tighten when truncated. list_issues (query, assignee=me|unassigned|all|user, limit default 40 max 250) lists Linear, AbleTime, or GitHub tickets \u2014 do not use it for that review-inbox ask. When they ask for tickets to work on, use their notes (assignee=me or unassigned as the notes say) and prefer ones that match their roles.',
|
|
353
|
-
"- Find work: when they ask to find work, pick up tickets, or list reviews, use Settings \u2192 Agents (account) plus Settings \u2192 Projects (per-repo) roles and notes. Tickets \u2192 list_issues. Reviews \u2192 list_prs(queue=review). Show the options \u2014 do not create_thread or start unless they also asked to start (e.g. \u201Cfind me work and start it\u201D). Do not start this unprompted.",
|
|
354
|
-
"- linear_* (when Linear is connected) \u2014 list_teams for team key/states; get/create/update/comment with ENG-123. Scope errors: reconnect Linear in Account settings.",
|
|
353
|
+
"- Find work: when they ask to find work, pick up tickets, or list reviews, use Settings \u2192 Agents (account) plus Settings \u2192 Projects (per-repo) roles and notes. Tickets \u2192 Sideboard list_issues / linear_* (Account Linear). Reviews \u2192 list_prs(queue=review). Do not call Claude Linear MCP or any other vendor Linear MCP \u2014 those HTTP connectors hang or flap on the first turn. If a vendor MCP is down or reconnecting, ignore it and keep going with Sideboard tools. Show the options \u2014 do not create_thread or start unless they also asked to start (e.g. \u201Cfind me work and start it\u201D). Do not start this unprompted.",
|
|
354
|
+
"- linear_* (when Linear is connected) \u2014 list_teams for team key/states; get/create/update/comment with ENG-123. Scope errors: reconnect Linear in Account settings. Prefer these over any Linear MCP the CLI may still list.",
|
|
355
355
|
"- abletime_* (when AbleTime is connected) \u2014 orientation first; ensure_task when work has no ticket (or create_thread from the default branch auto-creates one).",
|
|
356
356
|
"- list_teams / slack_list_channels / slack_list_users / slack_search / slack_read / slack_post / slack_replies \u2014 Slack workspaces from Settings \u2192 Remote; pass team_id from list_teams",
|
|
357
357
|
"- Optional connectors (Vercel, Supabase, PostHog, Sentry) in Settings \u2192 Connectors inject tokens into worktree agent env when connected. Prefer official CLIs (`vercel`, `supabase`, `sentry-cli`) with those env vars. PostHog has no first-class CLI \u2014 use the HTTP API (`POSTHOG_PERSONAL_API_KEY`). If a CLI is missing, the user can Install CLI on that row (not auto-installed on Connect). Do not add vendor MCPs or ask the user to paste tokens again. Git (`gh`) stays Settings \u2192 Git; issue tracking stays Settings \u2192 Issues; Slack stays Settings \u2192 Remote (Sideboard MCP).",
|
|
@@ -512,7 +512,7 @@ function ensureGlobalCoordinatorCwd(opts) {
|
|
|
512
512
|
"Never pass `agent=codex` when you yourself are Codex \u2014 nested Codex deadlocks on shared ~/.codex locks. Omit agent (Account default) or use cursor/claude.",
|
|
513
513
|
"Typical flow (Home board): list_board \u2192 create_thread (sourceType=ticket|pr|branch) \u2192 send_to_thread \u2192 wait_for_turn (loop while stillRunning) \u2192 ask_git create-draft \u2192 wait_for_turn. Merge only if the user explicitly asked (`ask_git` merge).",
|
|
514
514
|
"Typical flow (branch / explicit source): list_workspaces \u2192 list_branches|list_prs|list_issues \u2192 create_thread \u2192 send_to_thread \u2192 wait_for_turn (loop while stillRunning) \u2192 ask_git create-draft.",
|
|
515
|
-
"Typical flow (find work): list_workspaces \u2192 pick repo(s) matching viewer roles/notes \u2192 list_issues (tickets) or list_prs(queue=review) (reviews) \u2192 show the options. Only create_thread + send_to_thread when they asked to start (e.g. \u201Cfind me work and start it\u201D) \u2014 then wait_for_turn (loop while stillRunning) \u2192 ask_git create-draft.",
|
|
515
|
+
"Typical flow (find work): list_workspaces \u2192 pick repo(s) matching viewer roles/notes \u2192 Sideboard list_issues / linear_* (tickets) or list_prs(queue=review) (reviews) \u2192 show the options. Never wait on Claude Linear MCP. Only create_thread + send_to_thread when they asked to start (e.g. \u201Cfind me work and start it\u201D) \u2014 then wait_for_turn (loop while stillRunning) \u2192 ask_git create-draft.",
|
|
516
516
|
'Typical flow (review inbox): list_workspaces \u2192 list_prs(queue=review, limit=N) \u2192 show those PRs (ticket ids in the title when present). create_thread sourceType=pr only when they asked to start / do the work. Do not list_issues for "tickets to review".',
|
|
517
517
|
"Typical flow (new app): Bash create/clone under repos dir \u2192 add_workspace \u2192 create_thread \u2192 send_to_thread (implement) \u2192 wait_for_turn (loop while stillRunning) \u2192 ask_git create-draft.",
|
|
518
518
|
"Always ask worktree agents to commit, push, and open draft PRs (`ask_git` / `send_to_thread`). If the user gave a goal (Greptile 5/5, CI green), pass that goal through so they watch-fix-push until it lands \u2014 do not start that loop on a plain push, and do not tell the human to poll. Tell them to merge only when the user explicitly asked. The worktree agent runs git/gh; never merge from this orchestration cwd."
|