@sideboard-ai/core 0.1.149 → 0.1.151
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-QEVAE67D.js → abletime-223A3LY6.js} +2 -2
- package/dist/{abletime-DI55AJX3.js → abletime-CLC5UJC2.js} +2 -2
- package/dist/agents/cursor-runner.cjs +40 -35
- package/dist/agents/cursor-runner.js +2 -2
- package/dist/{agents-V4MTDWXS.js → agents-JAOMXDXN.js} +10 -9
- package/dist/{agents-HSVQ2Z6Y.js → agents-U2JCFXW4.js} +10 -9
- package/dist/{app-settings-WJDCJFSY.js → app-settings-3CHCNIMD.js} +5 -1
- package/dist/{app-settings-ZCN632OJ.js → app-settings-J3JBCUOT.js} +5 -1
- package/dist/{chunk-N5PM7HGQ.js → chunk-2SDMENAL.js} +1 -1
- package/dist/{chunk-JTPDWTWJ.js → chunk-3JBMACYX.js} +137 -114
- package/dist/{chunk-I77RYPOH.js → chunk-4XNSGDXE.js} +12 -0
- package/dist/{chunk-JDYKQ6OI.js → chunk-6H4TJ5TA.js} +136 -75
- package/dist/{chunk-EGDRPA4B.js → chunk-77MP647F.js} +6 -6
- package/dist/{chunk-KBWND62T.js → chunk-7F4XE6UG.js} +5 -5
- package/dist/{chunk-R4JP32P5.js → chunk-ADCEGG4A.js} +4 -4
- package/dist/{chunk-BOD5V52W.js → chunk-B7XK37WZ.js} +1 -1
- package/dist/{chunk-BGQBELGJ.js → chunk-CZD4NRDZ.js} +12 -0
- package/dist/{chunk-KPIYENTF.js → chunk-FNQNJOHY.js} +89 -5
- package/dist/{chunk-ED4UPEJX.js → chunk-G7SIQFBQ.js} +1 -1
- package/dist/{chunk-TZWO7J4W.js → chunk-GCWAAPJ5.js} +115 -54
- package/dist/{chunk-YP3CSOZ6.js → chunk-GE7M3QTE.js} +142 -114
- package/dist/{chunk-LAFA56WD.js → chunk-HEII7W3Q.js} +1 -1
- package/dist/{chunk-3QRGCKYL.js → chunk-HWZWBJWL.js} +2 -2
- package/dist/{chunk-FKOIHGKV.js → chunk-JRH62XC4.js} +5 -1
- package/dist/{chunk-Q5DHVMXB.js → chunk-LZAOX76N.js} +18 -7
- package/dist/{chunk-B3SJXYIJ.js → chunk-NVXVEGGM.js} +1 -1
- package/dist/{chunk-ZVYLEF72.js → chunk-OXOU2FRS.js} +6 -6
- package/dist/chunk-QQKDGPUI.js +63 -0
- package/dist/{chunk-QTUESPAW.js → chunk-RFMQY56R.js} +1 -1
- package/dist/chunk-SYFVUF2C.js +65 -0
- package/dist/{chunk-Q62SDB53.js → chunk-TSCWSAQL.js} +2 -2
- package/dist/{chunk-DVM4ID64.js → chunk-UFHNSFAS.js} +89 -5
- package/dist/{chunk-PTI5H3RK.js → chunk-UIS7BVCX.js} +24 -13
- package/dist/{chunk-VZJVKQHH.js → chunk-WLV7TRMR.js} +1 -1
- package/dist/{chunk-N3VNOFXQ.js → chunk-Y2FNDKHF.js} +4 -4
- package/dist/{connected-teams-IJUJQ7R6.js → connected-teams-I2WZZZFA.js} +2 -2
- package/dist/{connected-teams-4A2AXDNN.js → connected-teams-XO766HB4.js} +2 -2
- package/dist/{coordinator-prompt-ZWBMAIWA.js → coordinator-prompt-LWYUZAXR.js} +6 -5
- package/dist/{coordinator-prompt-5GXGBGEZ.js → coordinator-prompt-ZK5MII7W.js} +6 -5
- package/dist/{global-workspace-OJRXWXEA.js → global-workspace-IB2CCEJF.js} +7 -6
- package/dist/{global-workspace-2SIPM4PW.js → global-workspace-T7RL3XEC.js} +7 -6
- package/dist/index.cjs +1010 -577
- package/dist/index.d.cts +96 -11
- package/dist/index.d.ts +96 -11
- package/dist/index.js +272 -93
- package/dist/mcp/run-stdio.cjs +981 -581
- package/dist/mcp/run-stdio.js +196 -43
- package/dist/{orchestrator-Z2O5OVJA.js → orchestrator-DPTRBKEH.js} +16 -13
- package/dist/{orchestrator-6TXQWBXN.js → orchestrator-Y5MWUU7C.js} +14 -11
- package/dist/{plan-file-6O7G4VPQ.js → plan-file-LSSSQGTQ.js} +2 -2
- package/dist/{plan-file-PHVKUAEE.js → plan-file-OZEBFSGQ.js} +2 -2
- package/dist/{run-XQKGHQZ2.js → run-CAGKZLHA.js} +1 -1
- package/dist/{run-USF6FRKV.js → run-EBWL2Q4N.js} +1 -1
- package/dist/{workspaces-UUJNOO4T.js → workspaces-VICQYI2N.js} +8 -7
- package/dist/{workspaces-3NUUZTQK.js → workspaces-ZXCUVCZC.js} +8 -7
- package/dist/{worktree-RZRJNHYL.js → worktree-DPIREDFR.js} +5 -4
- package/dist/{worktree-UCWWTVLS.js → worktree-HTUM35NT.js} +5 -4
- package/dist/worktree-exclude-N5X5I422.js +13 -0
- package/dist/worktree-exclude-X54WSOXM.js +11 -0
- package/package.json +1 -1
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import {
|
|
2
|
+
extractPresentedPlan,
|
|
3
|
+
readPlanFile,
|
|
4
|
+
writePlanFile
|
|
5
|
+
} from "./chunk-RFMQY56R.js";
|
|
1
6
|
import {
|
|
2
7
|
PLAN_MODE_INSTRUCTION,
|
|
3
8
|
allAdapters,
|
|
@@ -7,6 +12,7 @@ import {
|
|
|
7
12
|
finalizeParts,
|
|
8
13
|
getAdapter,
|
|
9
14
|
isBrightsyNdjsonLine,
|
|
15
|
+
isInternalAgentStatusText,
|
|
10
16
|
isPollWrapperToolName,
|
|
11
17
|
isSessionQuotaLimit,
|
|
12
18
|
liveActivitySummary,
|
|
@@ -18,13 +24,13 @@ import {
|
|
|
18
24
|
stripBrightsyNdjsonNoise,
|
|
19
25
|
sumUsageList,
|
|
20
26
|
toolDescription
|
|
21
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-UIS7BVCX.js";
|
|
22
28
|
import {
|
|
23
29
|
addWorkspace,
|
|
24
30
|
ensureWorkspace,
|
|
25
31
|
removeWorkspace,
|
|
26
32
|
syncWorkspacesFromThreads
|
|
27
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-HWZWBJWL.js";
|
|
28
34
|
import {
|
|
29
35
|
assertOrchestratorCapableAgent,
|
|
30
36
|
attachmentsFromWorktreePaths,
|
|
@@ -41,43 +47,14 @@ import {
|
|
|
41
47
|
persistPendingFileAttachments,
|
|
42
48
|
stageAbsolutePathsAsAttachments,
|
|
43
49
|
stageBuffersAsAttachments
|
|
44
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-ADCEGG4A.js";
|
|
45
51
|
import {
|
|
46
52
|
SLACK_REPLY_FORMATTING,
|
|
47
53
|
coordinatorSystemPrompt,
|
|
48
54
|
coordinatorTurnReminder,
|
|
49
55
|
enrichWorkspacesWithGithub,
|
|
50
56
|
ensureGlobalCoordinatorCwd
|
|
51
|
-
} from "./chunk-
|
|
52
|
-
import {
|
|
53
|
-
httpFetch
|
|
54
|
-
} from "./chunk-ELBYOGVA.js";
|
|
55
|
-
import {
|
|
56
|
-
extractPresentedPlan,
|
|
57
|
-
readPlanFile,
|
|
58
|
-
writePlanFile
|
|
59
|
-
} from "./chunk-QTUESPAW.js";
|
|
60
|
-
import {
|
|
61
|
-
createAgentStreamCoalescer
|
|
62
|
-
} from "./chunk-AXQ4ZWHK.js";
|
|
63
|
-
import {
|
|
64
|
-
applyAgentRunnerHeapEnv,
|
|
65
|
-
fallbackTurnFailDetail,
|
|
66
|
-
formatAgentErrorContinuePrompt,
|
|
67
|
-
formatTurnExitError,
|
|
68
|
-
looksLikeAgentFailureMessage,
|
|
69
|
-
looksLikeInvalidAgentSession,
|
|
70
|
-
looksLikeV8Oom,
|
|
71
|
-
packagedMcpDir,
|
|
72
|
-
pushTurnStderr,
|
|
73
|
-
shouldFeedErrorBackToAgent,
|
|
74
|
-
shouldRetryFailedAgentTurn,
|
|
75
|
-
summarizeTurnStderr,
|
|
76
|
-
turnFailChatText
|
|
77
|
-
} from "./chunk-LAFA56WD.js";
|
|
78
|
-
import {
|
|
79
|
-
releaseCaffeinateHoldForThread
|
|
80
|
-
} from "./chunk-DCOZABNT.js";
|
|
57
|
+
} from "./chunk-77MP647F.js";
|
|
81
58
|
import {
|
|
82
59
|
addPrStackLayer,
|
|
83
60
|
allocateTeamName,
|
|
@@ -125,11 +102,32 @@ import {
|
|
|
125
102
|
withRepoGitLock,
|
|
126
103
|
worktreeDisplayLabelForGroup,
|
|
127
104
|
worktreeNameFromPath
|
|
128
|
-
} from "./chunk-
|
|
105
|
+
} from "./chunk-GE7M3QTE.js";
|
|
129
106
|
import {
|
|
130
107
|
ATTACHMENTS_DIR,
|
|
131
108
|
LEGACY_ATTACHMENTS_DIR
|
|
132
|
-
} from "./chunk-
|
|
109
|
+
} from "./chunk-JRH62XC4.js";
|
|
110
|
+
import {
|
|
111
|
+
httpFetch
|
|
112
|
+
} from "./chunk-ELBYOGVA.js";
|
|
113
|
+
import {
|
|
114
|
+
createAgentStreamCoalescer
|
|
115
|
+
} from "./chunk-AXQ4ZWHK.js";
|
|
116
|
+
import {
|
|
117
|
+
applyAgentRunnerHeapEnv,
|
|
118
|
+
fallbackTurnFailDetail,
|
|
119
|
+
formatAgentErrorContinuePrompt,
|
|
120
|
+
formatTurnExitError,
|
|
121
|
+
looksLikeAgentFailureMessage,
|
|
122
|
+
looksLikeInvalidAgentSession,
|
|
123
|
+
looksLikeV8Oom,
|
|
124
|
+
packagedMcpDir,
|
|
125
|
+
pushTurnStderr,
|
|
126
|
+
shouldFeedErrorBackToAgent,
|
|
127
|
+
shouldRetryFailedAgentTurn,
|
|
128
|
+
summarizeTurnStderr,
|
|
129
|
+
turnFailChatText
|
|
130
|
+
} from "./chunk-HEII7W3Q.js";
|
|
133
131
|
import {
|
|
134
132
|
childEnvWithAppSettings,
|
|
135
133
|
getIssueSource,
|
|
@@ -145,10 +143,13 @@ import {
|
|
|
145
143
|
saveAppSettings,
|
|
146
144
|
updateAdvancedSettings,
|
|
147
145
|
writeSecureJson
|
|
148
|
-
} from "./chunk-
|
|
146
|
+
} from "./chunk-4XNSGDXE.js";
|
|
149
147
|
import {
|
|
150
148
|
stripNestedElectronEnv
|
|
151
149
|
} from "./chunk-4TR3HZFT.js";
|
|
150
|
+
import {
|
|
151
|
+
releaseCaffeinateHoldForThread
|
|
152
|
+
} from "./chunk-DCOZABNT.js";
|
|
152
153
|
import {
|
|
153
154
|
writePrivateFile
|
|
154
155
|
} from "./chunk-JT7R45JB.js";
|
|
@@ -176,6 +177,9 @@ import {
|
|
|
176
177
|
workspaceSettingsSourceLabel,
|
|
177
178
|
worktreesRoot
|
|
178
179
|
} from "./chunk-QZQEXME2.js";
|
|
180
|
+
import {
|
|
181
|
+
ensureWorktreeSideboardIgnored
|
|
182
|
+
} from "./chunk-QQKDGPUI.js";
|
|
179
183
|
import {
|
|
180
184
|
clearStaleIndexLocks,
|
|
181
185
|
enrichPathWithNpmGlobalBin,
|
|
@@ -183,7 +187,7 @@ import {
|
|
|
183
187
|
git,
|
|
184
188
|
resolveGitDirsForLockRecovery,
|
|
185
189
|
run
|
|
186
|
-
} from "./chunk-
|
|
190
|
+
} from "./chunk-UFHNSFAS.js";
|
|
187
191
|
|
|
188
192
|
// src/orchestrator/orchestrator.ts
|
|
189
193
|
import { EventEmitter } from "events";
|
|
@@ -456,7 +460,7 @@ async function continueSourceThread(threadId, prompt) {
|
|
|
456
460
|
await continueOnReply(threadId, prompt);
|
|
457
461
|
return;
|
|
458
462
|
}
|
|
459
|
-
const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-
|
|
463
|
+
const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-DPTRBKEH.js");
|
|
460
464
|
await getOrchestrator2().send(threadId, prompt);
|
|
461
465
|
} catch {
|
|
462
466
|
}
|
|
@@ -736,9 +740,9 @@ async function spawnAgentTurn(thread, input, onEvent) {
|
|
|
736
740
|
`Cannot spawn ${thread.agent}: thread ${thread.id} has no worktreePath`
|
|
737
741
|
);
|
|
738
742
|
}
|
|
739
|
-
const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-
|
|
743
|
+
const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-IB2CCEJF.js");
|
|
740
744
|
if (isGlobalThread2(thread)) {
|
|
741
|
-
const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-
|
|
745
|
+
const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-LWYUZAXR.js");
|
|
742
746
|
ensureGlobalCoordinatorCwd2(
|
|
743
747
|
isOrchestratorThread(thread) ? { orchestratorThreadId: thread.id } : void 0
|
|
744
748
|
);
|
|
@@ -2002,6 +2006,7 @@ async function runConventionSetup(repoPath, worktreePath, onLine, opts) {
|
|
|
2002
2006
|
};
|
|
2003
2007
|
}
|
|
2004
2008
|
async function runWorkspaceSetup(repoPath, worktreePath, onLine, opts) {
|
|
2009
|
+
await ensureWorktreeSideboardIgnored(worktreePath);
|
|
2005
2010
|
const reviewSkill = ensureReviewSkillFile(worktreePath);
|
|
2006
2011
|
if (reviewSkill.wrote) {
|
|
2007
2012
|
onLine?.(
|
|
@@ -2942,7 +2947,7 @@ async function createThread(input, _onSetupLine) {
|
|
|
2942
2947
|
});
|
|
2943
2948
|
await requireAgent(resolved.agent);
|
|
2944
2949
|
if (input.cowboy) {
|
|
2945
|
-
const { cowboyModeEnabled } = await import("./app-settings-
|
|
2950
|
+
const { cowboyModeEnabled } = await import("./app-settings-3CHCNIMD.js");
|
|
2946
2951
|
if (!cowboyModeEnabled()) {
|
|
2947
2952
|
throw new Error(
|
|
2948
2953
|
"Cowboy mode is off. Enable it in Settings \u2192 Advanced."
|
|
@@ -3000,7 +3005,7 @@ async function createThread(input, _onSetupLine) {
|
|
|
3000
3005
|
let sourceIsFork = false;
|
|
3001
3006
|
if (!input.cowboy && sourceType === "branch" && (!sourceRef || sourceRef === "HEAD" || sourceRef === "default")) {
|
|
3002
3007
|
if (isAbleTimeConnected() && getIssueSource() === "abletime") {
|
|
3003
|
-
const { ensureAbleTimeTask, issueAttachmentForAbleTimeTask } = await import("./abletime-
|
|
3008
|
+
const { ensureAbleTimeTask, issueAttachmentForAbleTimeTask } = await import("./abletime-223A3LY6.js");
|
|
3004
3009
|
const task = await ensureAbleTimeTask({
|
|
3005
3010
|
title: title?.trim() || "Untitled work",
|
|
3006
3011
|
description: input.prompt?.trim() || void 0
|
|
@@ -3073,7 +3078,7 @@ async function createThread(input, _onSetupLine) {
|
|
|
3073
3078
|
return readThread(thread.id) ?? thread;
|
|
3074
3079
|
}
|
|
3075
3080
|
async function listLinearIssues(agent, repoPath) {
|
|
3076
|
-
const { getAdapter: getAdapter2 } = await import("./agents-
|
|
3081
|
+
const { getAdapter: getAdapter2 } = await import("./agents-U2JCFXW4.js");
|
|
3077
3082
|
await requireAgent(agent, { requireLinear: true });
|
|
3078
3083
|
const adapter = getAdapter2(agent);
|
|
3079
3084
|
if (!adapter.listLinearIssues) {
|
|
@@ -3465,7 +3470,7 @@ async function adoptThread(input) {
|
|
|
3465
3470
|
throw new Error(`Worktree not found: ${input.worktreePath}`);
|
|
3466
3471
|
}
|
|
3467
3472
|
const repoPath = await resolveRepoRoot(input.worktreePath);
|
|
3468
|
-
const { stdout: branch } = await import("./run-
|
|
3473
|
+
const { stdout: branch } = await import("./run-CAGKZLHA.js").then(
|
|
3469
3474
|
({ git: git2 }) => git2(["rev-parse", "--abbrev-ref", "HEAD"], input.worktreePath)
|
|
3470
3475
|
);
|
|
3471
3476
|
const thread = createEmptyThread({
|
|
@@ -3480,8 +3485,10 @@ async function adoptThread(input) {
|
|
|
3480
3485
|
messages: input.messages ?? []
|
|
3481
3486
|
});
|
|
3482
3487
|
writeThread(thread);
|
|
3483
|
-
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-
|
|
3488
|
+
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-ZXCUVCZC.js");
|
|
3484
3489
|
await ensureWorkspace2(repoPath);
|
|
3490
|
+
const { ensureWorktreeSideboardIgnored: ensureWorktreeSideboardIgnored2 } = await import("./worktree-exclude-X54WSOXM.js");
|
|
3491
|
+
await ensureWorktreeSideboardIgnored2(input.worktreePath);
|
|
3485
3492
|
return thread;
|
|
3486
3493
|
}
|
|
3487
3494
|
function conductorDbPath() {
|
|
@@ -4790,7 +4797,7 @@ async function confirmLand(thread, opts) {
|
|
|
4790
4797
|
if (preview.dirty) {
|
|
4791
4798
|
committed = await commitAll(thread.worktreePath, meta.commitMessage);
|
|
4792
4799
|
}
|
|
4793
|
-
const { git: git2 } = await import("./run-
|
|
4800
|
+
const { git: git2 } = await import("./run-CAGKZLHA.js");
|
|
4794
4801
|
const { stdout: headOut } = await git2(
|
|
4795
4802
|
["rev-parse", "--abbrev-ref", "HEAD"],
|
|
4796
4803
|
thread.worktreePath,
|
|
@@ -4852,7 +4859,7 @@ node <detached-job.js> wait <id> --until-done
|
|
|
4852
4859
|
node <detached-job.js> status <id>
|
|
4853
4860
|
\`\`\`
|
|
4854
4861
|
|
|
4855
|
-
\`<id>\` is kebab-case (\`mac-release\`, \`core-test\`, \`fly-deploy\`). State is \`.sideboard/detached-jobs/<id>/\` (local scratch).
|
|
4862
|
+
\`<id>\` is kebab-case (\`mac-release\`, \`core-test\`, \`fly-deploy\`). State is \`.context/.sideboard/detached-jobs/<id>/\` (local scratch).
|
|
4856
4863
|
|
|
4857
4864
|
Wait JSON:
|
|
4858
4865
|
|
|
@@ -5243,11 +5250,11 @@ function formatWorktreeDirective(thread, opts) {
|
|
|
5243
5250
|
);
|
|
5244
5251
|
} else if (opts?.githubSlug) {
|
|
5245
5252
|
lines.push(
|
|
5246
|
-
`- Prefer a draft PR first: \`gh pr create --draft -R ${opts.githubSlug}\` (or update via \`gh pr edit -R ${opts.githubSlug}\`) once the change set is coherent. Always pass \`-R ${opts.githubSlug}\` (this worktree's origin). Bare \`gh pr create\` may target upstream instead of origin on dual-remote checkouts. Mark ready for review only when asked. Title/body must reflect the change purpose, not the worktree name
|
|
5253
|
+
`- Prefer a draft PR first: \`gh pr create --draft -R ${opts.githubSlug}\` (or update via \`gh pr edit -R ${opts.githubSlug}\`) once the change set is coherent. Always pass \`-R ${opts.githubSlug}\` (this worktree's origin). Bare \`gh pr create\` may target upstream instead of origin on dual-remote checkouts. Mark ready for review only when asked. Title/body must reflect the change purpose, not the worktree name. If GitHub rejects the GraphQL body as too long, retry with a short \`--body-file\` (limit 65,536 characters) \u2014 do not paste a changelog or diff into \`--body\`.`
|
|
5247
5254
|
);
|
|
5248
5255
|
} else {
|
|
5249
5256
|
lines.push(
|
|
5250
|
-
"- Prefer a draft PR first: `gh pr create --draft -R <origin-owner/name>` (or update via `gh pr edit -R \u2026`) once the change set is coherent. Resolve `<origin-owner/name>` with `git remote get-url origin` in this worktree \u2014 never from `upstream`. Mark ready for review only when asked. Title/body must reflect the change purpose, not the worktree name."
|
|
5257
|
+
"- Prefer a draft PR first: `gh pr create --draft -R <origin-owner/name>` (or update via `gh pr edit -R \u2026`) once the change set is coherent. Resolve `<origin-owner/name>` with `git remote get-url origin` in this worktree \u2014 never from `upstream`. Mark ready for review only when asked. Title/body must reflect the change purpose, not the worktree name. If GitHub rejects the GraphQL body as too long, retry with a short `--body-file` (limit 65,536 characters) \u2014 do not paste a changelog or diff into `--body`."
|
|
5251
5258
|
);
|
|
5252
5259
|
}
|
|
5253
5260
|
lines.push("");
|
|
@@ -5303,7 +5310,7 @@ function formatLongRunningDirective(opts) {
|
|
|
5303
5310
|
"- Immediately `present_artifact` `type=log` with `artifact_id=<id>` and `status=running` \u2014 the side column is the live view.",
|
|
5304
5311
|
`- Loop \`${invoke} wait <id>\` (returns in ~45s). stillRunning \u2192 present the same id with \`content=delta\` only \u2192 wait again. Do not resend the full log or HTML.`,
|
|
5305
5312
|
"- ok \u2192 finish the task. failed \u2192 read the log, fix, start once.",
|
|
5306
|
-
"State: `.sideboard/detached-jobs/<id>/` (local scratch). Full guide: `/long-running` (always available)."
|
|
5313
|
+
"State: `.context/.sideboard/detached-jobs/<id>/` (local scratch). Full guide: `/long-running` (always available)."
|
|
5307
5314
|
].join("\n");
|
|
5308
5315
|
}
|
|
5309
5316
|
function formatLongRunningReminder(opts) {
|
|
@@ -5928,7 +5935,7 @@ function formatScheduledPrompt(name, prompt) {
|
|
|
5928
5935
|
${prompt}`;
|
|
5929
5936
|
}
|
|
5930
5937
|
async function defaultDeps() {
|
|
5931
|
-
const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-
|
|
5938
|
+
const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-DPTRBKEH.js");
|
|
5932
5939
|
const orch = getOrchestrator2();
|
|
5933
5940
|
return {
|
|
5934
5941
|
findThread: (id) => findThreadByRef(id),
|
|
@@ -6032,6 +6039,7 @@ function armSchedules() {
|
|
|
6032
6039
|
}
|
|
6033
6040
|
|
|
6034
6041
|
// src/orchestrator/orchestrator.ts
|
|
6042
|
+
var LIVE_TURN_SPAWN_GRACE_MS = 15e3;
|
|
6035
6043
|
function isPidAlive(pid) {
|
|
6036
6044
|
if (!Number.isFinite(pid) || pid <= 0) return false;
|
|
6037
6045
|
try {
|
|
@@ -6110,6 +6118,39 @@ var Orchestrator = class {
|
|
|
6110
6118
|
if (typeof pid === "number" && pid > 0 && isPidAlive(pid)) return false;
|
|
6111
6119
|
return true;
|
|
6112
6120
|
}
|
|
6121
|
+
/**
|
|
6122
|
+
* Whether a child is actually turning — not leftover disk `running` after
|
|
6123
|
+
* the process died. Coordinators were telling users “Agent is running.
|
|
6124
|
+
* Waiting for gate to pass” from stale stillRunning.
|
|
6125
|
+
*/
|
|
6126
|
+
threadLooksLive(thread) {
|
|
6127
|
+
if (thread.status === "queued") {
|
|
6128
|
+
if (this.draining.has(thread.id) || this.startingTurns.has(thread.id)) return true;
|
|
6129
|
+
return thread.queue.length > 0;
|
|
6130
|
+
}
|
|
6131
|
+
if (thread.status !== "running") return false;
|
|
6132
|
+
if (this.activeTurns.has(thread.id) || this.startingTurns.has(thread.id)) return true;
|
|
6133
|
+
const pid = thread.agentPid;
|
|
6134
|
+
if (typeof pid === "number" && pid > 0 && isPidAlive(pid)) return true;
|
|
6135
|
+
const updated = Date.parse(thread.updatedAt ?? "");
|
|
6136
|
+
if (Number.isFinite(updated) && Date.now() - updated < LIVE_TURN_SPAWN_GRACE_MS) return true;
|
|
6137
|
+
return false;
|
|
6138
|
+
}
|
|
6139
|
+
/** Desktop-only: persist idle/stopped when MCP would otherwise keep reporting live. */
|
|
6140
|
+
healStaleReportedActivity(thread) {
|
|
6141
|
+
if (!thisProcessShouldDrainAgentQueues()) return thread;
|
|
6142
|
+
if (this.threadLooksLive(thread)) return thread;
|
|
6143
|
+
if (thread.status === "running") {
|
|
6144
|
+
this.healStaleRunningTurns();
|
|
6145
|
+
return readThread(thread.id) ?? thread;
|
|
6146
|
+
}
|
|
6147
|
+
if (thread.status === "queued" && thread.queue.length === 0 && !this.activeTurns.has(thread.id) && !this.startingTurns.has(thread.id) && !this.draining.has(thread.id)) {
|
|
6148
|
+
setStatus(thread.id, "idle");
|
|
6149
|
+
this.emit({ type: "status_changed", threadId: thread.id, status: "idle" });
|
|
6150
|
+
return readThread(thread.id) ?? thread;
|
|
6151
|
+
}
|
|
6152
|
+
return thread;
|
|
6153
|
+
}
|
|
6113
6154
|
async reconcile(repoPath, opts) {
|
|
6114
6155
|
const reclaimStaleTurns = opts?.reclaimStaleTurns === true;
|
|
6115
6156
|
const drainQueues = opts?.drainQueues !== false;
|
|
@@ -6153,7 +6194,7 @@ var Orchestrator = class {
|
|
|
6153
6194
|
orphans: orphans.map((o) => ({ path: o.path, repoPath: o.repoPath }))
|
|
6154
6195
|
});
|
|
6155
6196
|
}
|
|
6156
|
-
const { autoCleanupOrphansEnabled } = await import("./app-settings-
|
|
6197
|
+
const { autoCleanupOrphansEnabled } = await import("./app-settings-3CHCNIMD.js");
|
|
6157
6198
|
if (autoCleanupOrphansEnabled() && shouldRunWorktreeCleanup() && orphans.length > 0) {
|
|
6158
6199
|
await cleanupOrphanWorktrees({ repoPaths });
|
|
6159
6200
|
}
|
|
@@ -6393,7 +6434,7 @@ var Orchestrator = class {
|
|
|
6393
6434
|
}
|
|
6394
6435
|
await setup;
|
|
6395
6436
|
if (skipSetup) return;
|
|
6396
|
-
const { autoRunAfterSetupEnabled } = await import("./app-settings-
|
|
6437
|
+
const { autoRunAfterSetupEnabled } = await import("./app-settings-3CHCNIMD.js");
|
|
6397
6438
|
if (autoRunAfterSetupEnabled()) {
|
|
6398
6439
|
try {
|
|
6399
6440
|
await this.startDev(threadId);
|
|
@@ -6444,12 +6485,14 @@ var Orchestrator = class {
|
|
|
6444
6485
|
this.emit({ type: "status_changed", threadId: thread.id, status: thread.status });
|
|
6445
6486
|
return thread;
|
|
6446
6487
|
}
|
|
6447
|
-
async send(threadRef, prompt) {
|
|
6488
|
+
async send(threadRef, prompt, opts) {
|
|
6448
6489
|
const thread = this.requireThread(threadRef);
|
|
6449
6490
|
if (thread.status === "archived") {
|
|
6450
6491
|
throw new Error(`Thread is archived: ${thread.id}`);
|
|
6451
6492
|
}
|
|
6452
|
-
|
|
6493
|
+
const followUp = opts?.followUp === "steer" ? "steer" : "queue";
|
|
6494
|
+
let shouldSteer = false;
|
|
6495
|
+
const sent = await withThreadLock(thread.id, async () => {
|
|
6453
6496
|
const current = this.requireThread(thread.id);
|
|
6454
6497
|
if (current.status === "archived") {
|
|
6455
6498
|
throw new Error(`Thread is archived: ${thread.id}`);
|
|
@@ -6458,6 +6501,7 @@ var Orchestrator = class {
|
|
|
6458
6501
|
this.crashContinued.delete(thread.id);
|
|
6459
6502
|
this.haltDrain.delete(thread.id);
|
|
6460
6503
|
const inFlight = this.activeTurns.has(thread.id) || this.startingTurns.has(thread.id) || current.status === "running";
|
|
6504
|
+
shouldSteer = followUp === "steer" && (inFlight || current.queue.length > 0);
|
|
6461
6505
|
const patch = { queue };
|
|
6462
6506
|
if (!inFlight) patch.status = "queued";
|
|
6463
6507
|
const pid = current.agentPid;
|
|
@@ -6469,16 +6513,20 @@ var Orchestrator = class {
|
|
|
6469
6513
|
if (!inFlight) {
|
|
6470
6514
|
this.emit({ type: "status_changed", threadId: thread.id, status: "queued" });
|
|
6471
6515
|
}
|
|
6472
|
-
if (thisProcessShouldDrainAgentQueues()) {
|
|
6516
|
+
if (thisProcessShouldDrainAgentQueues() && !shouldSteer) {
|
|
6473
6517
|
void this.drainQueue(thread.id);
|
|
6474
6518
|
}
|
|
6475
6519
|
return this.requireThread(thread.id);
|
|
6476
6520
|
});
|
|
6521
|
+
if (shouldSteer && sent.queue.length > 0) {
|
|
6522
|
+
return this.sendQueuedMessageNow(sent.id, sent.queue.length - 1);
|
|
6523
|
+
}
|
|
6524
|
+
return sent;
|
|
6477
6525
|
}
|
|
6478
|
-
async fanOut(threadRefs, prompt) {
|
|
6526
|
+
async fanOut(threadRefs, prompt, opts) {
|
|
6479
6527
|
const results = [];
|
|
6480
6528
|
for (const ref of threadRefs) {
|
|
6481
|
-
results.push(await this.send(ref, prompt));
|
|
6529
|
+
results.push(await this.send(ref, prompt, opts));
|
|
6482
6530
|
}
|
|
6483
6531
|
return results;
|
|
6484
6532
|
}
|
|
@@ -6694,7 +6742,7 @@ var Orchestrator = class {
|
|
|
6694
6742
|
}
|
|
6695
6743
|
const isBrightsy = fresh.agent === "brightsy";
|
|
6696
6744
|
const isOrchestration = isOrchestratorThread(fresh);
|
|
6697
|
-
const { autoRenameBranchEnabled, getGithubGitAuthMode } = await import("./app-settings-
|
|
6745
|
+
const { autoRenameBranchEnabled, getGithubGitAuthMode } = await import("./app-settings-3CHCNIMD.js");
|
|
6698
6746
|
const gitAuthMode = getGithubGitAuthMode();
|
|
6699
6747
|
const worktreeDirective = isBrightsy || isOrchestration ? null : formatWorktreeDirective(fresh, {
|
|
6700
6748
|
githubSlug: await resolveGithubRepoSlug(fresh.worktreePath).catch(
|
|
@@ -7282,8 +7330,8 @@ var Orchestrator = class {
|
|
|
7282
7330
|
return created;
|
|
7283
7331
|
}
|
|
7284
7332
|
async waitForTurn(threadRef, timeoutMs = 6e5, opts) {
|
|
7285
|
-
const thread = this.requireThread(threadRef);
|
|
7286
|
-
if (!
|
|
7333
|
+
const thread = this.healStaleReportedActivity(this.requireThread(threadRef));
|
|
7334
|
+
if (!this.threadLooksLive(thread)) {
|
|
7287
7335
|
return thread;
|
|
7288
7336
|
}
|
|
7289
7337
|
const start = Date.now();
|
|
@@ -7320,12 +7368,13 @@ var Orchestrator = class {
|
|
|
7320
7368
|
}
|
|
7321
7369
|
});
|
|
7322
7370
|
timer = setInterval(() => {
|
|
7323
|
-
const
|
|
7324
|
-
if (!
|
|
7371
|
+
const raw = readThread(thread.id);
|
|
7372
|
+
if (!raw) {
|
|
7325
7373
|
finish(() => reject(new Error(`Thread not found: ${thread.id}`)));
|
|
7326
7374
|
return;
|
|
7327
7375
|
}
|
|
7328
|
-
|
|
7376
|
+
const current = this.healStaleReportedActivity(raw);
|
|
7377
|
+
if (!this.threadLooksLive(current)) {
|
|
7329
7378
|
finish(() => resolve(current));
|
|
7330
7379
|
return;
|
|
7331
7380
|
}
|
|
@@ -7348,20 +7397,22 @@ var Orchestrator = class {
|
|
|
7348
7397
|
};
|
|
7349
7398
|
}
|
|
7350
7399
|
getTurnResult(threadRef) {
|
|
7351
|
-
const thread = this.requireThread(threadRef);
|
|
7400
|
+
const thread = this.healStaleReportedActivity(this.requireThread(threadRef));
|
|
7352
7401
|
const lastAgent = [...thread.messages].reverse().find((m) => m.role === "agent");
|
|
7353
7402
|
const lastError = thread.lastError ?? null;
|
|
7354
|
-
const
|
|
7355
|
-
const
|
|
7403
|
+
const rawText = (lastAgent?.text ?? "").trim();
|
|
7404
|
+
const text = (rawText && !isInternalAgentStatusText(rawText) ? rawText : "") || (thread.status === "error" || thread.status === "stopped" || thread.status === "broken" ? lastError ?? "" : "");
|
|
7405
|
+
const stillRunning = this.threadLooksLive(thread);
|
|
7356
7406
|
const live = stillRunning ? readTurnLive(thread.id) : null;
|
|
7357
|
-
const
|
|
7407
|
+
const liveSummary = live?.summary && !isInternalAgentStatusText(live.summary) ? live.summary : null;
|
|
7408
|
+
const queuedHint = stillRunning && thread.status === "queued" && !liveSummary ? "Queued \u2014 waiting for a concurrency slot" : null;
|
|
7358
7409
|
return {
|
|
7359
7410
|
text,
|
|
7360
7411
|
status: thread.status,
|
|
7361
7412
|
sessionId: thread.sessionId,
|
|
7362
7413
|
lastError,
|
|
7363
7414
|
stillRunning,
|
|
7364
|
-
progress:
|
|
7415
|
+
progress: liveSummary ?? queuedHint,
|
|
7365
7416
|
lastActivityAt: live?.updatedAt ?? null,
|
|
7366
7417
|
usage: lastAgent?.usage ?? null
|
|
7367
7418
|
};
|
|
@@ -7554,7 +7605,7 @@ var Orchestrator = class {
|
|
|
7554
7605
|
updateThread(thread.id, { title: meta.title });
|
|
7555
7606
|
}
|
|
7556
7607
|
}
|
|
7557
|
-
const { autoArchiveOnMergeEnabled } = await import("./app-settings-
|
|
7608
|
+
const { autoArchiveOnMergeEnabled } = await import("./app-settings-3CHCNIMD.js");
|
|
7558
7609
|
const latest = this.requireThread(thread.id);
|
|
7559
7610
|
if (!shouldAutoArchiveOnPrMerge({
|
|
7560
7611
|
previousPrState: prevState || null,
|
|
@@ -7709,7 +7760,14 @@ var Orchestrator = class {
|
|
|
7709
7760
|
);
|
|
7710
7761
|
}
|
|
7711
7762
|
if ((action === "commit-push" || action === "create-draft" || action === "create-web") && thread.worktreePath?.trim() && !await isDirty(thread.worktreePath)) {
|
|
7712
|
-
|
|
7763
|
+
try {
|
|
7764
|
+
await this.pushAndMaybeOpenPr(thread, action);
|
|
7765
|
+
} catch (err) {
|
|
7766
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
7767
|
+
updateThread(thread.id, { lastError: message });
|
|
7768
|
+
this.emit({ type: "error", threadId: thread.id, message });
|
|
7769
|
+
throw err;
|
|
7770
|
+
}
|
|
7713
7771
|
return this.requireThread(threadRef);
|
|
7714
7772
|
}
|
|
7715
7773
|
let prBase;
|
|
@@ -7864,7 +7922,7 @@ var Orchestrator = class {
|
|
|
7864
7922
|
this.emit({ type: "status_changed", threadId: archived.id, status: "archived" });
|
|
7865
7923
|
if (thread.repoPath && !isGlobalRepoPath(thread.repoPath)) {
|
|
7866
7924
|
try {
|
|
7867
|
-
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-
|
|
7925
|
+
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-ZXCUVCZC.js");
|
|
7868
7926
|
await ensureWorkspace2(thread.repoPath);
|
|
7869
7927
|
} catch {
|
|
7870
7928
|
}
|
|
@@ -7891,7 +7949,7 @@ var Orchestrator = class {
|
|
|
7891
7949
|
await runArchiveScript(thread.repoPath, thread.worktreePath);
|
|
7892
7950
|
} catch {
|
|
7893
7951
|
}
|
|
7894
|
-
const { deleteBranchOnPurgeEnabled } = await import("./app-settings-
|
|
7952
|
+
const { deleteBranchOnPurgeEnabled } = await import("./app-settings-3CHCNIMD.js");
|
|
7895
7953
|
const deleteBranch = opts?.deleteBranch ?? deleteBranchOnPurgeEnabled();
|
|
7896
7954
|
await removeWorktree(thread.repoPath, thread.worktreePath, {
|
|
7897
7955
|
deleteBranch: deleteBranch ? thread.branchName : void 0
|
|
@@ -7918,12 +7976,14 @@ var Orchestrator = class {
|
|
|
7918
7976
|
`Cowboy checkout missing: ${thread.worktreePath}. Re-add the project folder, then restore.`
|
|
7919
7977
|
);
|
|
7920
7978
|
}
|
|
7921
|
-
const { createThreadWorktree: createThreadWorktree2 } = await import("./worktree-
|
|
7979
|
+
const { createThreadWorktree: createThreadWorktree2 } = await import("./worktree-DPIREDFR.js");
|
|
7922
7980
|
const slug = thread.worktreePath.split("/").pop();
|
|
7923
7981
|
const dest = thread.worktreePath;
|
|
7924
7982
|
await withRepoGitLock(thread.repoPath, async () => {
|
|
7925
7983
|
await git(["worktree", "add", dest, thread.branchName], thread.repoPath);
|
|
7926
7984
|
});
|
|
7985
|
+
const { ensureWorktreeSideboardIgnored: ensureWorktreeSideboardIgnored2 } = await import("./worktree-exclude-X54WSOXM.js");
|
|
7986
|
+
await ensureWorktreeSideboardIgnored2(dest);
|
|
7927
7987
|
void createThreadWorktree2;
|
|
7928
7988
|
void slug;
|
|
7929
7989
|
}
|
|
@@ -8026,7 +8086,7 @@ async function startOrchestration(opts) {
|
|
|
8026
8086
|
sourceRef: "default",
|
|
8027
8087
|
...createOpts
|
|
8028
8088
|
}).catch(async () => {
|
|
8029
|
-
const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-
|
|
8089
|
+
const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-DPIREDFR.js");
|
|
8030
8090
|
const repo = await resolveRepoRoot2(repoPath);
|
|
8031
8091
|
const def = await resolveDefaultBranch2(repo);
|
|
8032
8092
|
return orch.createThread({
|
|
@@ -8253,6 +8313,7 @@ export {
|
|
|
8253
8313
|
connectedOptionalServices,
|
|
8254
8314
|
formatOptionalServicesDirective,
|
|
8255
8315
|
formatOptionalServicesReminder,
|
|
8316
|
+
LIVE_TURN_SPAWN_GRACE_MS,
|
|
8256
8317
|
isPidAlive,
|
|
8257
8318
|
waitForPidExit,
|
|
8258
8319
|
Orchestrator,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveGithubRepoSlug
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GE7M3QTE.js";
|
|
4
4
|
import {
|
|
5
5
|
resolveThreadDefaults
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4XNSGDXE.js";
|
|
7
7
|
import {
|
|
8
8
|
globalAgentCwd,
|
|
9
9
|
sideboardReposDir
|
|
@@ -45,8 +45,8 @@ var COORDINATOR_TOOL_PLAYBOOK = [
|
|
|
45
45
|
"Discover:",
|
|
46
46
|
"- list_workspaces \u2014 registered repos (path + github slug when known)",
|
|
47
47
|
"- 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.",
|
|
48
|
-
"- list_branches / list_prs / list_issues \u2014 pass repoPath from list_workspaces (issues: Linear, AbleTime MCP, or GitHub Issues)",
|
|
49
|
-
"- linear_list_teams / linear_get_issue / linear_create_issue / linear_update_issue / linear_comment \u2014 Linear Account connection; call linear_list_teams for team key and workflow states; pass ENG-123 or uuid. linear_get_issue returns comments, relations, parent/children, and the rest of the issue metadata. If mutations fail with a scope error, Disconnect and Connect Linear in Account settings.",
|
|
48
|
+
"- list_branches / list_prs / list_issues \u2014 pass repoPath from list_workspaces (issues: Linear, AbleTime MCP, or GitHub Issues). list_issues accepts query and assignee (me / unassigned / all / user id) so Linear is not limited to tickets assigned to you.",
|
|
49
|
+
"- linear_list_teams / linear_search_issues / linear_get_issue / linear_create_issue / linear_update_issue / linear_comment \u2014 Linear Account connection; call linear_list_teams for team key and workflow states; pass ENG-123 or uuid. linear_search_issues finds unassigned and other people's open issues (assignee=unassigned|all|me|user). linear_get_issue returns comments, relations, parent/children, and the rest of the issue metadata. If mutations fail with a scope error, Disconnect and Connect Linear in Account settings.",
|
|
50
50
|
"- abletime_orientation / abletime_list_projects / abletime_list_tasks / abletime_search_tasks / abletime_get_task / abletime_create_task / abletime_ensure_task \u2014 AbleTime Account personal access token (hosted MCP). Call orientation first. If work has no task yet, abletime_ensure_task creates one to track against (or create_thread from the default branch does that automatically when AbleTime is the preferred issue source).",
|
|
51
51
|
"- 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",
|
|
52
52
|
"- 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).",
|
|
@@ -65,7 +65,7 @@ var COORDINATOR_TOOL_PLAYBOOK = [
|
|
|
65
65
|
"- fork_worktree \u2014 fork a worktree chat into a NEW git worktree + chat (transcript attached); optional agent; leave model unset (Auto) unless you have a reason. Not for orchestration chats.",
|
|
66
66
|
"- fork_chat \u2014 fork a worktree chat (same worktree tab) OR a Global orchestration chat (new orchestration tab); optional agent; leave model unset (Auto) unless you have a reason. Remote coordinators: use this to continue another orchestration chat on a different agent after session limits.",
|
|
67
67
|
"- send_to_thread \u2014 queue a prompt (start/continue a chat turn). force_stop: true only to replace a wrong in-flight request \u2014 never to check in, resume after a halt notice, or because wait_for_turn returned stillRunning (that kills the child mid-thought)",
|
|
68
|
-
"- wait_for_turn / get_turn_result \u2014 wait for and read the agent reply (includes last-turn usage / costUsd when the child agent reported it). wait_for_turn returns within ~45s even if the child is still working (MCP clients kill longer tool calls). If stillRunning is true, progress is a live snapshot of tools/thinking \u2014 call wait_for_turn again. status=queued with no lastActivityAt means the child has not started yet (concurrency cap) \u2014 keep waiting; do not force_stop or send a check-in. Do not send \u201Care you stuck?\u201D or assume a hang while lastActivityAt is recent. On status error, lastError (and text) is the failure \u2014 switch agent, tell the user, or retry; do not treat empty text as success. On status stopped or broken (or incomplete=true), the child was interrupted or died \u2014 resume with send_to_thread or tell the user; never treat stopped as a finished turn. Sideboard also injects a notice into this chat when a child stops unexpectedly.",
|
|
68
|
+
"- wait_for_turn / get_turn_result \u2014 wait for and read the agent reply (includes last-turn usage / costUsd when the child agent reported it). wait_for_turn returns within ~45s even if the child is still working (MCP clients kill longer tool calls). stillRunning is the source of truth \u2014 if it is false, the child is not working; do not tell the user it is running or \u201Cwaiting for a gate,\u201D even if status still says running/queued. If stillRunning is true, progress is a live snapshot of tools/thinking \u2014 call wait_for_turn again. status=queued with no lastActivityAt means the child has not started yet (concurrency cap) \u2014 keep waiting; do not force_stop or send a check-in. Do not send \u201Care you stuck?\u201D or assume a hang while lastActivityAt is recent. If stillRunning stays true across many waits with the same lastActivityAt, the child is stuck \u2014 tell the user; do not invent a gate. On status error, lastError (and text) is the failure \u2014 switch agent, tell the user, or retry; do not treat empty text as success. On status stopped or broken (or incomplete=true), the child was interrupted or died \u2014 resume with send_to_thread or tell the user; never treat stopped as a finished turn. Sideboard also injects a notice into this chat when a child stops unexpectedly.",
|
|
69
69
|
"- stop_thread \u2014 force-stop: kill in-flight turn AND clear queued prompts (do not leave stale queue after an interrupt)",
|
|
70
70
|
"- archive_thread / restore_thread \u2014 archive (tears down worktree when last tab) or restore",
|
|
71
71
|
"Setup / run:",
|
|
@@ -74,7 +74,7 @@ var COORDINATOR_TOOL_PLAYBOOK = [
|
|
|
74
74
|
"Inspect / review / PRs:",
|
|
75
75
|
"- get_diff \u2014 compact diff summary",
|
|
76
76
|
'- request_review \u2014 open a Review chat tab on a worktree thread (attaches .claude/skills/review/SKILL.md when present, else seeds that skill / local guidelines; sends "Review changes in this workspace."); then wait_for_turn (loop while stillRunning) / get_turn_result on the returned id',
|
|
77
|
-
"- ask_git \u2014 commit & push, open a draft PR, resolve conflicts, or merge. When the worktree is clean, Sideboard pushes / opens the PR itself. When dirty, it queues the worktree agent \u2014 then wait_for_turn (loop while stillRunning). Prefer this over paraphrasing.",
|
|
77
|
+
"- ask_git \u2014 commit & push, open a draft PR, resolve conflicts, or merge. When the worktree is clean, Sideboard pushes / opens the PR itself. When dirty, it queues the worktree agent \u2014 then wait_for_turn (loop while stillRunning). Prefer this over paraphrasing. If ask_git / get_thread lastError says the GraphQL/PR body is too long, the branch is already pushed \u2014 send_to_thread so the worktree agent runs `gh pr create --body-file` with a short description. Do not invent SSH or auth failures from that error.",
|
|
78
78
|
'- Merge (`ask_git` action=merge / send_to_thread "Merge PR.") only when the user explicitly asked to merge that PR. Do not merge because the work looks done, CI is green, or a typical flow includes it.',
|
|
79
79
|
'- Or send_to_thread with those exact phrases: "Commit and push.", "Commit, push, and open a draft PR.", "Merge the remote branch (main) into your branch and resolve conflicts. Then, commit and push your changes.", "Merge PR." (draft PRs: `gh pr create --draft -R <origin-owner/name>` using the workspace `github:` slug \u2014 never upstream). Never run git/gh from this orchestration cwd, and never merge the PR yourself.',
|
|
80
80
|
"Process guides:",
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "./chunk-QZQEXME2.js";
|
|
11
11
|
import {
|
|
12
12
|
run
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-UFHNSFAS.js";
|
|
14
14
|
|
|
15
15
|
// src/brightsy/connected-teams.ts
|
|
16
16
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
@@ -18,7 +18,7 @@ import { join } from "path";
|
|
|
18
18
|
|
|
19
19
|
// src/brightsy/accounts.ts
|
|
20
20
|
async function loadConnectedTeams() {
|
|
21
|
-
const { listConnectedBrightsyTeams: listConnectedBrightsyTeams2 } = await import("./connected-teams-
|
|
21
|
+
const { listConnectedBrightsyTeams: listConnectedBrightsyTeams2 } = await import("./connected-teams-XO766HB4.js");
|
|
22
22
|
return listConnectedBrightsyTeams2();
|
|
23
23
|
}
|
|
24
24
|
async function runBrightsyTeamsJson(args) {
|
|
@@ -47,14 +47,14 @@ async function listBrightsyAccounts() {
|
|
|
47
47
|
async function getBrightsySession() {
|
|
48
48
|
try {
|
|
49
49
|
const { ensureBrightsyLocalConfigFresh: ensureBrightsyLocalConfigFresh2 } = await import("./oauth-A7XXI2TM.js");
|
|
50
|
-
const { ensureConnectedBrightsyTeamTokens: ensureConnectedBrightsyTeamTokens2 } = await import("./connected-teams-
|
|
50
|
+
const { ensureConnectedBrightsyTeamTokens: ensureConnectedBrightsyTeamTokens2 } = await import("./connected-teams-XO766HB4.js");
|
|
51
51
|
await ensureBrightsyLocalConfigFresh2();
|
|
52
52
|
await ensureConnectedBrightsyTeamTokens2();
|
|
53
53
|
loadBrightsyConfig();
|
|
54
54
|
const data = await runBrightsyTeamsJson([]);
|
|
55
55
|
const accounts = Array.isArray(data.teams) ? data.teams : [];
|
|
56
56
|
const active = data.active ?? accounts.find((a) => a.active) ?? null;
|
|
57
|
-
const { ensureCliTeamTracked: ensureCliTeamTracked2 } = await import("./connected-teams-
|
|
57
|
+
const { ensureCliTeamTracked: ensureCliTeamTracked2 } = await import("./connected-teams-XO766HB4.js");
|
|
58
58
|
const connectedTeams = ensureCliTeamTracked2(
|
|
59
59
|
active ? { id: active.id, slug: active.slug, name: active.name } : void 0
|
|
60
60
|
);
|
|
@@ -94,7 +94,7 @@ async function performBrightsyAccountSwitch(accountIdOrSlug) {
|
|
|
94
94
|
return { cfg, target: data.active };
|
|
95
95
|
}
|
|
96
96
|
async function switchBrightsyAccount(accountIdOrSlug) {
|
|
97
|
-
const { connectBrightsyTeam: connectBrightsyTeam2 } = await import("./connected-teams-
|
|
97
|
+
const { connectBrightsyTeam: connectBrightsyTeam2 } = await import("./connected-teams-XO766HB4.js");
|
|
98
98
|
await connectBrightsyTeam2(accountIdOrSlug);
|
|
99
99
|
return getBrightsySession();
|
|
100
100
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ensureGlobalCoordinatorCwd
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-77MP647F.js";
|
|
4
4
|
import {
|
|
5
5
|
allocateTeamName,
|
|
6
6
|
takenSlugsFromThread,
|
|
7
7
|
teamSlugFromName
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-GE7M3QTE.js";
|
|
9
9
|
import {
|
|
10
10
|
ATTACHMENTS_DIR,
|
|
11
11
|
attachmentsGitignoreBody
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-JRH62XC4.js";
|
|
13
13
|
import {
|
|
14
14
|
resolveNewThreadOptions,
|
|
15
15
|
resolveThreadDefaults
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-4XNSGDXE.js";
|
|
17
17
|
import {
|
|
18
18
|
createEmptyThread,
|
|
19
19
|
listThreads,
|