@sideboard-ai/core 0.1.331 → 0.1.333
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.js +2 -2
- package/dist/{agents-JXQKHY7Q.js → agents-5NJ3FROS.js} +8 -8
- package/dist/{agents-JH4WV2ZH.js → agents-SRM6OVML.js} +7 -7
- package/dist/{chunk-NQHTYX35.js → chunk-25KXB7W6.js} +1 -1
- package/dist/{chunk-QHKNPN55.js → chunk-4J7R2BFU.js} +31 -18
- package/dist/{chunk-G45SGI57.js → chunk-6RUSADA7.js} +4 -4
- package/dist/{chunk-QKHEVSB5.js → chunk-BMRJNRQK.js} +1 -1
- package/dist/{chunk-JQWCZGSO.js → chunk-CS6LQUL6.js} +110 -11
- package/dist/{chunk-KUD24QYI.js → chunk-ELDJBZ52.js} +5 -5
- package/dist/{chunk-4YXZOXMT.js → chunk-GK7H3SY7.js} +1 -1
- package/dist/{chunk-6U6QRUHY.js → chunk-I6RGRUNY.js} +1 -1
- package/dist/{chunk-P4QRDXRY.js → chunk-JJRTVB7D.js} +2 -2
- package/dist/{chunk-O7JSWISN.js → chunk-LEUAYFSG.js} +4 -4
- package/dist/{chunk-U7EANR52.js → chunk-P7S3XGKL.js} +2 -2
- package/dist/{chunk-OOSAMSTE.js → chunk-QKJC725N.js} +29 -16
- package/dist/{chunk-XOIJJRAQ.js → chunk-QNKJCD7B.js} +110 -11
- package/dist/{chunk-2TUE6JKQ.js → chunk-R4W4VQJZ.js} +2 -0
- package/dist/{chunk-7L36GZA4.js → chunk-RCRDNOAT.js} +1 -1
- package/dist/{chunk-PZ5MVD27.js → chunk-RJT6JPNX.js} +5 -5
- package/dist/{chunk-YBTSZ2SW.js → chunk-TL2HK6LZ.js} +2 -0
- package/dist/{chunk-DFKLWWLY.js → chunk-TLL2K2MY.js} +6 -6
- package/dist/{chunk-NURZOXGN.js → chunk-UGUWFONI.js} +1 -1
- package/dist/{chunk-3DJQLQWU.js → chunk-UV33UCV6.js} +3 -3
- package/dist/{chunk-DBRQ5NNB.js → chunk-WXOJSFGO.js} +5 -5
- package/dist/{chunk-S5CJUIPY.js → chunk-XOEKCE6L.js} +5 -5
- package/dist/{conductor-FA27ZGCV.js → conductor-LUPB6RBH.js} +5 -5
- package/dist/{conductor-6DIR7A4N.js → conductor-XSP3SOS2.js} +5 -5
- package/dist/{connected-teams-H4LZOJDC.js → connected-teams-2YDE2EZ2.js} +2 -2
- package/dist/{connected-teams-XYRZMQO4.js → connected-teams-6756SMAW.js} +2 -2
- package/dist/{coordinator-prompt-B6RHGEJK.js → coordinator-prompt-EJJNJ5K7.js} +4 -4
- package/dist/{coordinator-prompt-KAZXK5FZ.js → coordinator-prompt-O75QUEHP.js} +4 -4
- package/dist/{global-workspace-IOKHZCXD.js → global-workspace-3IG44NAT.js} +4 -4
- package/dist/{global-workspace-JKINHUY3.js → global-workspace-Q4OURN7M.js} +4 -4
- package/dist/index.cjs +314 -174
- package/dist/index.d.cts +23 -3
- package/dist/index.d.ts +23 -3
- package/dist/index.js +36 -18
- package/dist/mcp/run-stdio.cjs +206 -154
- package/dist/mcp/run-stdio.js +12 -12
- package/dist/{optional-cli-FOSC4NVE.js → optional-cli-KWIII44P.js} +3 -3
- package/dist/{optional-cli-NSQZ2DYK.js → optional-cli-XJE4BELL.js} +4 -4
- package/dist/{orchestrator-EKG7FUFK.js → orchestrator-IYXIWNB5.js} +11 -11
- package/dist/{orchestrator-L44O3JPD.js → orchestrator-WHXHBNRS.js} +10 -10
- package/dist/{run-7QMRYP3F.js → run-ARDGUXUN.js} +1 -1
- package/dist/{run-UPNCCRCN.js → run-ZKK3VGO5.js} +1 -1
- package/dist/{workspaces-FJL3TL3K.js → workspaces-ALUHOCWK.js} +4 -4
- package/dist/{workspaces-OLONQF2C.js → workspaces-QGKSXA76.js} +4 -4
- package/dist/{worktree-TX4WXQZV.js → worktree-6WWUWH4K.js} +3 -3
- package/dist/{worktree-QSQJ2POO.js → worktree-N435EXSP.js} +3 -3
- package/dist/{worktree-exclude-P5NJODWP.js → worktree-exclude-KMZQXZKP.js} +2 -2
- package/dist/{worktree-exclude-INRDQFWV.js → worktree-exclude-YQBN43QD.js} +2 -2
- package/package.json +1 -1
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
fetchCursorTurnCostUsd,
|
|
21
21
|
importCursorSdk,
|
|
22
22
|
resolveCursorSdkRoot
|
|
23
|
-
} from "../chunk-
|
|
23
|
+
} from "../chunk-UGUWFONI.js";
|
|
24
24
|
import {
|
|
25
25
|
TOOL_RESULT_STORE_MAX_CHARS,
|
|
26
26
|
createCursorStreamToolProgress,
|
|
@@ -34,7 +34,7 @@ import "../chunk-6K64FJDD.js";
|
|
|
34
34
|
import {
|
|
35
35
|
cursorSdkStoreDir
|
|
36
36
|
} from "../chunk-LG6RJBIY.js";
|
|
37
|
-
import "../chunk-
|
|
37
|
+
import "../chunk-R4W4VQJZ.js";
|
|
38
38
|
import "../chunk-SUZOPJZC.js";
|
|
39
39
|
import {
|
|
40
40
|
dropNestedElectronEnvFromProcess
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
planModeTurnInstruction,
|
|
38
38
|
resolveCursorModelId,
|
|
39
39
|
resolveQuotaFallbackAgent
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-TLL2K2MY.js";
|
|
41
41
|
import {
|
|
42
42
|
getAgentSetupInfo,
|
|
43
43
|
installAgent,
|
|
@@ -49,14 +49,14 @@ import {
|
|
|
49
49
|
prepareTerminalCommand,
|
|
50
50
|
resolveLoginCommand,
|
|
51
51
|
whichOnPath
|
|
52
|
-
} from "./chunk-
|
|
53
|
-
import "./chunk-
|
|
52
|
+
} from "./chunk-QNKJCD7B.js";
|
|
53
|
+
import "./chunk-XOEKCE6L.js";
|
|
54
54
|
import "./chunk-ZT5YPYZE.js";
|
|
55
55
|
import "./chunk-OOXRMTU6.js";
|
|
56
|
-
import "./chunk-
|
|
57
|
-
import "./chunk-
|
|
56
|
+
import "./chunk-LEUAYFSG.js";
|
|
57
|
+
import "./chunk-JJRTVB7D.js";
|
|
58
58
|
import "./chunk-QVLDZWHZ.js";
|
|
59
|
-
import "./chunk-
|
|
59
|
+
import "./chunk-BMRJNRQK.js";
|
|
60
60
|
import "./chunk-RSA47QYR.js";
|
|
61
61
|
import "./chunk-JAT3JFOS.js";
|
|
62
62
|
import "./chunk-N6ZF3XRP.js";
|
|
@@ -68,7 +68,7 @@ import {
|
|
|
68
68
|
preferredCursorCostCents,
|
|
69
69
|
resolveCursorSdkRoot,
|
|
70
70
|
turnCostUsdFromCursorUsage
|
|
71
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-UGUWFONI.js";
|
|
72
72
|
import "./chunk-OPXEJJBM.js";
|
|
73
73
|
import "./chunk-6K64FJDD.js";
|
|
74
74
|
import "./chunk-LG6RJBIY.js";
|
|
@@ -82,7 +82,7 @@ import {
|
|
|
82
82
|
posixShellSingleQuote,
|
|
83
83
|
resolveCommandBinarySync,
|
|
84
84
|
withExportedPath
|
|
85
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-R4W4VQJZ.js";
|
|
86
86
|
import "./chunk-SUZOPJZC.js";
|
|
87
87
|
import {
|
|
88
88
|
ORCHESTRATOR_AGENT_KINDS,
|
|
@@ -46,7 +46,7 @@ import {
|
|
|
46
46
|
resolveCursorSdkRoot,
|
|
47
47
|
resolveQuotaFallbackAgent,
|
|
48
48
|
turnCostUsdFromCursorUsage
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-WXOJSFGO.js";
|
|
50
50
|
import "./chunk-5MXLDDYF.js";
|
|
51
51
|
import {
|
|
52
52
|
getAgentSetupInfo,
|
|
@@ -59,15 +59,15 @@ import {
|
|
|
59
59
|
prepareTerminalCommand,
|
|
60
60
|
resolveLoginCommand,
|
|
61
61
|
whichOnPath
|
|
62
|
-
} from "./chunk-
|
|
63
|
-
import "./chunk-
|
|
64
|
-
import "./chunk-
|
|
65
|
-
import "./chunk-
|
|
62
|
+
} from "./chunk-CS6LQUL6.js";
|
|
63
|
+
import "./chunk-6RUSADA7.js";
|
|
64
|
+
import "./chunk-P7S3XGKL.js";
|
|
65
|
+
import "./chunk-I6RGRUNY.js";
|
|
66
66
|
import "./chunk-E63AM3PW.js";
|
|
67
67
|
import "./chunk-N2WW62LF.js";
|
|
68
68
|
import "./chunk-2GPQZZLY.js";
|
|
69
69
|
import "./chunk-NCFYUUSC.js";
|
|
70
|
-
import "./chunk-
|
|
70
|
+
import "./chunk-GK7H3SY7.js";
|
|
71
71
|
import {
|
|
72
72
|
conductorBundledBinDir,
|
|
73
73
|
enrichPathWithNpmGlobalBin,
|
|
@@ -78,7 +78,7 @@ import {
|
|
|
78
78
|
posixShellSingleQuote,
|
|
79
79
|
resolveCommandBinarySync,
|
|
80
80
|
withExportedPath
|
|
81
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-TL2HK6LZ.js";
|
|
82
82
|
import "./chunk-EW5D53VB.js";
|
|
83
83
|
import "./chunk-WMZIANPV.js";
|
|
84
84
|
import {
|
|
@@ -125,7 +125,7 @@ async function connectedCliPresence(integrations) {
|
|
|
125
125
|
const ids = connectedOptionalServices(integrations).filter((spec) => spec.cli).map((spec) => spec.id);
|
|
126
126
|
if (ids.length === 0) return void 0;
|
|
127
127
|
try {
|
|
128
|
-
const { optionalCliPresence } = await import("./optional-cli-
|
|
128
|
+
const { optionalCliPresence } = await import("./optional-cli-KWIII44P.js");
|
|
129
129
|
return await optionalCliPresence(ids);
|
|
130
130
|
} catch {
|
|
131
131
|
return void 0;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
formatOptionalServicesDirectiveForTurn,
|
|
3
3
|
formatOptionalServicesReminderForTurn
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-RCRDNOAT.js";
|
|
5
5
|
import {
|
|
6
6
|
extractPresentedPlan,
|
|
7
7
|
isPresentPlanToolName,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
parseSessionQuotaResetAt,
|
|
22
22
|
planModeTurnInstruction,
|
|
23
23
|
resolveQuotaFallbackAgent
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-TLL2K2MY.js";
|
|
25
25
|
import {
|
|
26
26
|
applyWorktreePkgCacheEnv,
|
|
27
27
|
buildBrightsySessionSeed,
|
|
@@ -55,7 +55,7 @@ import {
|
|
|
55
55
|
worktreeDevProcessKey,
|
|
56
56
|
worktreeRunProcessKey,
|
|
57
57
|
worktreeSetupProcessKey
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-ELDJBZ52.js";
|
|
59
59
|
import {
|
|
60
60
|
applyAgentEvent,
|
|
61
61
|
clipAgentEventForPaint,
|
|
@@ -98,7 +98,7 @@ import {
|
|
|
98
98
|
stageAbsolutePathsAsAttachments,
|
|
99
99
|
stageBuffersAsAttachments,
|
|
100
100
|
syncWorkspacesFromThreads
|
|
101
|
-
} from "./chunk-
|
|
101
|
+
} from "./chunk-LEUAYFSG.js";
|
|
102
102
|
import {
|
|
103
103
|
addPrStackLayer,
|
|
104
104
|
allocateTeamSlug,
|
|
@@ -149,7 +149,7 @@ import {
|
|
|
149
149
|
resolveRepoRoot,
|
|
150
150
|
switchWorktreeBranch,
|
|
151
151
|
withRepoGitLock
|
|
152
|
-
} from "./chunk-
|
|
152
|
+
} from "./chunk-JJRTVB7D.js";
|
|
153
153
|
import {
|
|
154
154
|
REVIEW_TAB_TITLE,
|
|
155
155
|
agentNicknameFromWorktreePath,
|
|
@@ -199,7 +199,7 @@ import {
|
|
|
199
199
|
import {
|
|
200
200
|
applyAgentRunnerHeapEnv,
|
|
201
201
|
packagedMcpDir
|
|
202
|
-
} from "./chunk-
|
|
202
|
+
} from "./chunk-UGUWFONI.js";
|
|
203
203
|
import {
|
|
204
204
|
fallbackTurnFailDetail,
|
|
205
205
|
formatAgentErrorContinuePrompt,
|
|
@@ -222,7 +222,7 @@ import {
|
|
|
222
222
|
gh,
|
|
223
223
|
git,
|
|
224
224
|
resolveGitDirsForLockRecovery
|
|
225
|
-
} from "./chunk-
|
|
225
|
+
} from "./chunk-R4W4VQJZ.js";
|
|
226
226
|
import {
|
|
227
227
|
HISTORY_CLEANUP_INTERVAL_HOURS_DEFAULT,
|
|
228
228
|
applyTurnUsage,
|
|
@@ -517,9 +517,9 @@ async function spawnAgentTurn(thread, input, onEvent) {
|
|
|
517
517
|
`Cannot spawn ${thread.agent}: thread ${thread.id} has no worktreePath`
|
|
518
518
|
);
|
|
519
519
|
}
|
|
520
|
-
const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-
|
|
520
|
+
const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-Q4OURN7M.js");
|
|
521
521
|
if (isGlobalThread2(thread)) {
|
|
522
|
-
const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-
|
|
522
|
+
const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-O75QUEHP.js");
|
|
523
523
|
ensureGlobalCoordinatorCwd2(
|
|
524
524
|
isOrchestratorThread(thread) ? { orchestratorThreadId: thread.id } : void 0
|
|
525
525
|
);
|
|
@@ -891,11 +891,24 @@ function expandCanonicalGitRequest(prompt, opts) {
|
|
|
891
891
|
expansion = forge === "cursor" ? "Investigate that failing check (`origin pr checks`, `origin pr watch`), fix it, commit, and push. Loop only if a goal to keep going until it passes was given. Do not use `gh run`." : forge === "entire" ? "Investigate the blocking gate (`entire trail merge --dry-run`, `entire trail finding list`, `entire trail watch`), fix it, commit, and push. Loop only if a goal to keep going until it passes was given. Do not use `gh run`." : "Investigate that failing check (`gh pr checks`, `gh run view --log-failed`), fix it, commit, and push. Loop only if a goal to keep going until it passes was given.";
|
|
892
892
|
}
|
|
893
893
|
if (!expansion) return prompt;
|
|
894
|
+
if (expansionPushes(action, trimmed)) expansion = withPushReview(expansion);
|
|
894
895
|
return `${trimmed}
|
|
895
896
|
|
|
896
897
|
(Sideboard git request \u2014 do not ask for clarification: ${expansion})`;
|
|
897
898
|
}
|
|
898
899
|
var FIX_CI_RE = /^Fix CI: .+\.$/;
|
|
900
|
+
var PUSH_WAKES_REVIEW = "A push can start or refresh a third-party PR review (whichever bot this repo runs). If this chat already has a goal to keep going until CI or that review is clean, read the reviewer\u2019s latest comment and unresolved threads and address them. Do not start that loop on a plain push.";
|
|
901
|
+
var CHECKS_LOOP_UNLESS_GOAL = / ?Do not start a checks loop unless a goal was given\./g;
|
|
902
|
+
function withPushReview(expansion) {
|
|
903
|
+
const base = expansion.replace(CHECKS_LOOP_UNLESS_GOAL, "").trim();
|
|
904
|
+
if (base.includes("third-party PR review")) return base;
|
|
905
|
+
return `${base} ${PUSH_WAKES_REVIEW}`;
|
|
906
|
+
}
|
|
907
|
+
function expansionPushes(action, prompt) {
|
|
908
|
+
if (action === "ready-for-review" || action === "merge") return false;
|
|
909
|
+
if (action) return true;
|
|
910
|
+
return prompt === "Address review comments." || FIX_CI_RE.test(prompt);
|
|
911
|
+
}
|
|
899
912
|
|
|
900
913
|
// src/git/pr-merge-archive.ts
|
|
901
914
|
function normalizePrState(state) {
|
|
@@ -3383,7 +3396,7 @@ async function createThread(input, _onSetupLine) {
|
|
|
3383
3396
|
return readThread(thread.id) ?? thread;
|
|
3384
3397
|
}
|
|
3385
3398
|
async function listLinearIssues(agent, repoPath) {
|
|
3386
|
-
const { getAdapter: getAdapter2 } = await import("./agents-
|
|
3399
|
+
const { getAdapter: getAdapter2 } = await import("./agents-5NJ3FROS.js");
|
|
3387
3400
|
await requireAgent(agent, { requireLinear: true });
|
|
3388
3401
|
const adapter = getAdapter2(agent);
|
|
3389
3402
|
if (!adapter.listLinearIssues) {
|
|
@@ -4151,7 +4164,7 @@ async function adoptThread(input) {
|
|
|
4151
4164
|
throw new Error(`Worktree not found: ${input.worktreePath}`);
|
|
4152
4165
|
}
|
|
4153
4166
|
const repoPath = await resolveRepoRoot(input.worktreePath);
|
|
4154
|
-
const { stdout: branch } = await import("./run-
|
|
4167
|
+
const { stdout: branch } = await import("./run-ARDGUXUN.js").then(
|
|
4155
4168
|
({ git: git2 }) => git2(["rev-parse", "--abbrev-ref", "HEAD"], input.worktreePath)
|
|
4156
4169
|
);
|
|
4157
4170
|
const thread = createEmptyThread({
|
|
@@ -4166,9 +4179,9 @@ async function adoptThread(input) {
|
|
|
4166
4179
|
messages: input.messages ?? []
|
|
4167
4180
|
});
|
|
4168
4181
|
writeThread(thread);
|
|
4169
|
-
const { addWorkspace: addWorkspace2 } = await import("./workspaces-
|
|
4182
|
+
const { addWorkspace: addWorkspace2 } = await import("./workspaces-QGKSXA76.js");
|
|
4170
4183
|
await addWorkspace2(repoPath);
|
|
4171
|
-
const { ensureWorktreeSideboardIgnored } = await import("./worktree-exclude-
|
|
4184
|
+
const { ensureWorktreeSideboardIgnored } = await import("./worktree-exclude-YQBN43QD.js");
|
|
4172
4185
|
await ensureWorktreeSideboardIgnored(input.worktreePath);
|
|
4173
4186
|
return thread;
|
|
4174
4187
|
}
|
|
@@ -5752,7 +5765,7 @@ async function confirmLand(thread, opts) {
|
|
|
5752
5765
|
if (preview.dirty) {
|
|
5753
5766
|
committed = await commitAll(thread.worktreePath, meta.commitMessage);
|
|
5754
5767
|
}
|
|
5755
|
-
const { git: git2 } = await import("./run-
|
|
5768
|
+
const { git: git2 } = await import("./run-ARDGUXUN.js");
|
|
5756
5769
|
const { stdout: headOut } = await git2(
|
|
5757
5770
|
["rev-parse", "--abbrev-ref", "HEAD"],
|
|
5758
5771
|
thread.worktreePath,
|
|
@@ -6704,7 +6717,7 @@ function formatPrGateDirective() {
|
|
|
6704
6717
|
"If a goal is given (not after every push):",
|
|
6705
6718
|
"- Enter a watch-fix-push loop and stay in it until that goal is met or you are blocked (examples: \u201CGreptile 5/5\u201D, \u201CCI green\u201D, \u201Cuntil checks pass\u201D). Do not stop after one red run or one review cycle.",
|
|
6706
6719
|
"- Wait with `/long-running`: detach `gh pr checks --watch` (add `-R <origin>` when needed), then loop `wait_for_job` until stillRunning is false. Do not end the turn \u2014 a native CLI Task or bash notify does not resume this chat. Do not ask the human to poll.",
|
|
6707
|
-
"-
|
|
6720
|
+
"- A commit or push can start or refresh a third-party PR review (Greptile, CodeRabbit, Bugbot, Copilot, or another bot on the PR). Read that reviewer\u2019s latest comment and unresolved threads, including any score or fix-it block they posted. Acknowledge it: make the requested changes, push, and wait for the refreshed review. Done = the goal the user named, with that reviewer\u2019s unresolved comments addressed. Do not invent a vendor trigger. Cap about 5 iterations, then report leftovers. Do not merge unless asked."
|
|
6708
6721
|
].join("\n");
|
|
6709
6722
|
}
|
|
6710
6723
|
function formatProcessGuideDirective(opts) {
|
|
@@ -7155,7 +7168,7 @@ function formatScheduledPrompt(name, prompt) {
|
|
|
7155
7168
|
${prompt}`;
|
|
7156
7169
|
}
|
|
7157
7170
|
async function defaultDeps() {
|
|
7158
|
-
const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-
|
|
7171
|
+
const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-IYXIWNB5.js");
|
|
7159
7172
|
const orch = getOrchestrator2();
|
|
7160
7173
|
return {
|
|
7161
7174
|
findThread: (id) => findThreadByRef(id),
|
|
@@ -9987,7 +10000,7 @@ ${formatEnvReminder(projectNameForRepoPath(thread.repoPath || thread.worktreePat
|
|
|
9987
10000
|
await withRepoGitLock(thread.repoPath, async () => {
|
|
9988
10001
|
await git(["worktree", "add", dest, thread.branchName], thread.repoPath);
|
|
9989
10002
|
});
|
|
9990
|
-
const { ensureWorktreeSideboardIgnored } = await import("./worktree-exclude-
|
|
10003
|
+
const { ensureWorktreeSideboardIgnored } = await import("./worktree-exclude-YQBN43QD.js");
|
|
9991
10004
|
await ensureWorktreeSideboardIgnored(dest);
|
|
9992
10005
|
}
|
|
9993
10006
|
const restorePatch = {};
|
|
@@ -10093,7 +10106,7 @@ async function startOrchestration(opts) {
|
|
|
10093
10106
|
sourceRef: "default",
|
|
10094
10107
|
...createOpts
|
|
10095
10108
|
}).catch(async () => {
|
|
10096
|
-
const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-
|
|
10109
|
+
const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-6WWUWH4K.js");
|
|
10097
10110
|
const repo = await resolveRepoRoot2(repoPath);
|
|
10098
10111
|
const def = await resolveDefaultBranch2(repo);
|
|
10099
10112
|
return orch.createThread({
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
resolveGithubRepoSlug,
|
|
8
8
|
resolveOriginRemote,
|
|
9
9
|
resolveRepoRoot
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-P7S3XGKL.js";
|
|
11
11
|
import {
|
|
12
12
|
ATTACHMENTS_DIR,
|
|
13
13
|
attachmentsGitignoreBody
|
|
@@ -356,7 +356,7 @@ var COORDINATOR_TOOL_PLAYBOOK = [
|
|
|
356
356
|
"- ask_user \u2014 composer multiple-choice only when blocked on a concrete choice (approach fork, which API, Save this context / Do not save). Never for hellos, check-ins, invented \u201Cwhat should we do?\u201D menus, or after a review \u2014 reply in chat. Explain options first, description on every option, then wait.",
|
|
357
357
|
"- get_viewer_context / update_viewer_context \u2014 read or replace Settings \u2192 Agents (account) and Settings \u2192 Projects (per-repo) context. You can update a project: pass scope=project and repoPath from list_projects (this cwd is not a project). update_viewer_context requires confirmed=true after ask_user. Never write context unprompted.",
|
|
358
358
|
"- list_env / set_env / delete_env \u2014 Settings \u2192 Environment. scope=project requires repoPath from list_projects and stores the key under that project prefix (the project name, uppercased, plus _). APPLE_ID for sideboard is SIDEBOARD_APPLE_ID. scope=account is shared by every project and is not prefixed. list_env returns names only.",
|
|
359
|
-
"- set_caffeinate \u2014 keep this Mac awake across turns (macOS caffeinate).
|
|
359
|
+
"- set_caffeinate \u2014 keep this Mac awake across turns (macOS caffeinate). A connected phone already holds caffeinate (lid can close on power), so do not turn this on just because they are on the phone. Turn on for overnight work, or when the user will be away and no phone is connected. Turn OFF when they say they are done, wrapping up, going to sleep, or no longer need the machine awake. Closing this chat also releases it.",
|
|
360
360
|
"- list_schedules / create_schedule / update_schedule / delete_schedule / run_schedule \u2014 automations that send a prompt to a chat (chatId or self) or start a new Global chat (omit chatId). A job bound to a chat is removed when that chat is archived. Omit chatId only for a Global automation that should outlive the chat. One-shot `at`, interval `every` (15m/1h/6h/1d), clock time `time` + `days` (07:30 and weekdays, or mon,wed), or 5-field `cron`. Recurring jobs without chatId open a new chat each run and archive it when that run finishes unless archiveChat is false (leave the chat open to keep talking). History keeps the last 5 archived runs for that automation. Worktree agents have the same tools (`chatId=self` continues that coding chat and is removed when that chat is archived). Jobs fire only while Sideboard.app is running; sleep skips until wake. Creating or enabling a future job turns on Settings \u2192 Advanced \u2192 Caffeinate while automations are enabled (or call set_caffeinate). The desktop lists them in the sidebar after Board.",
|
|
361
361
|
"Projects:",
|
|
362
362
|
"- add_project / remove_project \u2014 register or unregister a git repo",
|
|
@@ -382,7 +382,7 @@ var COORDINATOR_TOOL_PLAYBOOK = [
|
|
|
382
382
|
"- get_diff \u2014 compact diff summary",
|
|
383
383
|
"- get_pr_checks \u2014 snapshot of a worktree thread's PR checks (null = no PR). Use this to inspect status. If the user gave a goal, the worktree agent watches with `gh pr checks --watch` on GitHub, `origin pr watch` on Cursor, or `entire trail watch` on Entire \u2014 do not poll for the human.",
|
|
384
384
|
'- request_review \u2014 run a Review on a worktree thread. Reuses the only unused idle agent when the checkout has a single chat with no messages; otherwise opens a Review tab (attaches .claude/skills/review/SKILL.md when present, else .context/review.md copied from .sideboard/review.md / stock; sends "Review changes in this workspace."); then wait_for_turn (loop while stillRunning) / get_turn_result on the returned id. The review stays in that chat so they can read it and type next steps \u2014 do not tell the child to comment or update the PR or ticket.',
|
|
385
|
-
"- ask_git \u2014 commit & push, open a draft PR, mark ready for review, resolve conflicts, or merge \u2014 same prompts as the desktop git buttons (Resolve, Create PR, \u2026). Always steers the worktree agent; then wait_for_turn (loop while stillRunning). Prefer this over paraphrasing. If the user gave a goal (Greptile 5/5, CI green), send_to_chat that goal so the worktree agent enters the watch-fix-push loop \u2014 do not tell the human to poll.",
|
|
385
|
+
"- ask_git \u2014 commit & push, open a draft PR, mark ready for review, resolve conflicts, or merge \u2014 same prompts as the desktop git buttons (Resolve, Create PR, \u2026). Always steers the worktree agent; then wait_for_turn (loop while stillRunning). Prefer this over paraphrasing. If the user gave a goal (Greptile 5/5, CI green), send_to_chat that goal so the worktree agent enters the watch-fix-push loop \u2014 do not tell the human to poll. A push can wake a third-party PR review; the worktree agent acknowledges that review only inside an existing goal, not on a plain push.",
|
|
386
386
|
'- Merge (`ask_git` action=merge / send_to_chat "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.',
|
|
387
387
|
'- Or send_to_chat with those exact phrases: "Commit and push.", "Commit, push, and open a draft PR.", "Ready for review.", "Merge PR." Prefer ask_git resolve-conflicts (it names the actual PR base \u2014 not always main) over paraphrasing. Draft PRs follow that workspace origin: GitHub (`github:`) uses `gh pr create --draft --assignee @me -R <slug>`; Cursor (`cursor:`) uses `origin pr create --draft --push -R <slug>`; Entire (`entire:`) uses `entire trail create --title` (Trails have no draft state). Never upstream. Never run git, gh, origin, or entire from this orchestration cwd, and never merge the PR yourself.',
|
|
388
388
|
"Process guides:",
|
|
@@ -515,7 +515,7 @@ function ensureGlobalCoordinatorCwd(opts) {
|
|
|
515
515
|
"Typical flow (find work): list_projects \u2192 pick repo(s) matching account / project context \u2192 Sideboard list_issues / linear_* (tickets) or list_prs(queue=review) (reviews) \u2192 show the options. Never wait on Claude Linear MCP. Only create_workspace + send_to_chat 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_projects \u2192 list_prs(queue=review, limit=N) \u2192 show those PRs (ticket ids in the title when present). create_workspace sourceType=pr only when they asked to start / do the work. Do not list_issues for "tickets to review". The child writes the review in chat and stops \u2014 do not ask_user after it. Do not github_comment / linear_comment / update the PR or ticket, and do not tell the child to post, until the user types a next step. They should work through the feedback in chat first. The PR or ticket author sees those writes immediately.',
|
|
517
517
|
"Typical flow (new app): Bash create/clone under repos dir \u2192 add_project \u2192 create_workspace \u2192 send_to_chat (implement) \u2192 wait_for_turn (loop while stillRunning) \u2192 ask_git create-draft.",
|
|
518
|
-
"Always ask worktree agents to commit, push, and open draft PRs (`ask_git` / `send_to_chat`). 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."
|
|
518
|
+
"Always ask worktree agents to commit, push, and open draft PRs (`ask_git` / `send_to_chat`). 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. A push can wake a third-party PR review; acknowledge it only inside that goal. Tell them to merge only when the user explicitly asked. The worktree agent runs git/gh; never merge from this orchestration cwd."
|
|
519
519
|
].join("\n");
|
|
520
520
|
try {
|
|
521
521
|
writeFileSync2(join2(dir, "AGENTS.md"), `${body}
|
|
@@ -6,22 +6,93 @@ import {
|
|
|
6
6
|
resolveCommandBinarySync,
|
|
7
7
|
run,
|
|
8
8
|
withExportedPath
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-TL2HK6LZ.js";
|
|
10
10
|
import {
|
|
11
11
|
resolveAgentExecutable
|
|
12
12
|
} from "./chunk-7BAS6DF7.js";
|
|
13
13
|
|
|
14
14
|
// src/agents/install.ts
|
|
15
|
-
import { existsSync } from "fs";
|
|
15
|
+
import { chmodSync, existsSync } from "fs";
|
|
16
|
+
import { join } from "path";
|
|
17
|
+
|
|
18
|
+
// src/agents/install-native.ts
|
|
19
|
+
var CLAUDE_NATIVE_INSTALL = "curl -fsSL https://claude.ai/install.sh | bash";
|
|
20
|
+
var OPENCODE_NATIVE_INSTALL = "curl -fsSL https://opencode.ai/install | bash";
|
|
21
|
+
async function installCurlScript(opts) {
|
|
22
|
+
const result = await run("bash", ["-c", opts.command], {
|
|
23
|
+
reject: false,
|
|
24
|
+
timeoutMs: 3e5
|
|
25
|
+
});
|
|
26
|
+
if (result.exitCode === 0) {
|
|
27
|
+
const binPath = await whichOnPath(opts.bin);
|
|
28
|
+
if (binPath) {
|
|
29
|
+
return {
|
|
30
|
+
ok: true,
|
|
31
|
+
command: opts.command,
|
|
32
|
+
exitCode: 0,
|
|
33
|
+
stdout: result.stdout,
|
|
34
|
+
stderr: result.stderr,
|
|
35
|
+
message: `Installed ${opts.label} \u2192 ${binPath}`
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
ok: false,
|
|
40
|
+
command: opts.command,
|
|
41
|
+
exitCode: result.exitCode,
|
|
42
|
+
stdout: result.stdout,
|
|
43
|
+
stderr: result.stderr,
|
|
44
|
+
message: `${opts.label} installer finished, but \`${opts.bin}\` is not on PATH. Expected ${opts.expected}.`
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
const detail = result.stderr.trim() || result.stdout.trim();
|
|
48
|
+
try {
|
|
49
|
+
await openInSystemTerminal(opts.command);
|
|
50
|
+
return {
|
|
51
|
+
ok: false,
|
|
52
|
+
openedTerminal: true,
|
|
53
|
+
command: opts.command,
|
|
54
|
+
exitCode: result.exitCode,
|
|
55
|
+
stdout: result.stdout,
|
|
56
|
+
stderr: result.stderr,
|
|
57
|
+
message: `${opts.label} install failed (exit ${result.exitCode}). Opened Terminal with: ${opts.command}`
|
|
58
|
+
};
|
|
59
|
+
} catch {
|
|
60
|
+
return {
|
|
61
|
+
ok: false,
|
|
62
|
+
command: opts.command,
|
|
63
|
+
exitCode: result.exitCode,
|
|
64
|
+
stdout: result.stdout,
|
|
65
|
+
stderr: result.stderr,
|
|
66
|
+
message: detail ? `${opts.label} install failed (exit ${result.exitCode}). ${detail}` : `${opts.label} install failed (exit ${result.exitCode})`
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function installClaudeNative() {
|
|
71
|
+
return installCurlScript({
|
|
72
|
+
command: CLAUDE_NATIVE_INSTALL,
|
|
73
|
+
bin: "claude",
|
|
74
|
+
label: "Claude Code",
|
|
75
|
+
expected: "~/.local/bin/claude"
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
function installOpenCodeNative() {
|
|
79
|
+
return installCurlScript({
|
|
80
|
+
command: OPENCODE_NATIVE_INSTALL,
|
|
81
|
+
bin: "opencode",
|
|
82
|
+
label: "OpenCode",
|
|
83
|
+
expected: "~/.opencode/bin/opencode"
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// src/agents/install.ts
|
|
16
88
|
var SETUP = {
|
|
17
89
|
claude: {
|
|
18
90
|
agent: "claude",
|
|
19
91
|
kind: "cli",
|
|
20
|
-
summary: "Install
|
|
92
|
+
summary: "Install Claude Code, then complete login in a terminal.",
|
|
21
93
|
docsUrl: "https://code.claude.com/docs/en/install",
|
|
22
|
-
installCommand:
|
|
94
|
+
installCommand: CLAUDE_NATIVE_INSTALL,
|
|
23
95
|
loginCommand: "claude auth login",
|
|
24
|
-
npmPackage: "@anthropic-ai/claude-code",
|
|
25
96
|
updateArgs: ["update"]
|
|
26
97
|
},
|
|
27
98
|
codex: {
|
|
@@ -37,12 +108,12 @@ var SETUP = {
|
|
|
37
108
|
opencode: {
|
|
38
109
|
agent: "opencode",
|
|
39
110
|
kind: "cli",
|
|
40
|
-
summary: "Install OpenCode
|
|
111
|
+
summary: "Install OpenCode, then authenticate providers.",
|
|
41
112
|
docsUrl: "https://opencode.ai/docs",
|
|
42
|
-
//
|
|
43
|
-
|
|
113
|
+
// npm package `opencode-ai` ships the same kind of non-executable native stub
|
|
114
|
+
// as Claude. The curl installer writes ~/.opencode/bin/opencode.
|
|
115
|
+
installCommand: OPENCODE_NATIVE_INSTALL,
|
|
44
116
|
loginCommand: "opencode auth login",
|
|
45
|
-
npmPackage: "opencode-ai@latest",
|
|
46
117
|
updateArgs: ["upgrade"]
|
|
47
118
|
},
|
|
48
119
|
cursor: {
|
|
@@ -179,7 +250,17 @@ async function installNpmGlobalPackage(opts) {
|
|
|
179
250
|
}
|
|
180
251
|
}
|
|
181
252
|
enrichPathWithNpmGlobalBin();
|
|
182
|
-
const binPath = opts.cliBin ? await
|
|
253
|
+
const binPath = opts.cliBin ? await resolveCliAfterNpmInstall(opts.cliBin) : null;
|
|
254
|
+
if (opts.cliBin && !binPath) {
|
|
255
|
+
return {
|
|
256
|
+
ok: false,
|
|
257
|
+
command: opts.installCommand,
|
|
258
|
+
exitCode: 0,
|
|
259
|
+
stdout: result.stdout,
|
|
260
|
+
stderr: result.stderr,
|
|
261
|
+
message: `Installed ${opts.npmPackage}, but \`${opts.cliBin}\` is not on PATH.`
|
|
262
|
+
};
|
|
263
|
+
}
|
|
183
264
|
return {
|
|
184
265
|
ok: true,
|
|
185
266
|
command: opts.installCommand,
|
|
@@ -187,9 +268,25 @@ async function installNpmGlobalPackage(opts) {
|
|
|
187
268
|
stdout: result.stdout,
|
|
188
269
|
stderr: result.stderr,
|
|
189
270
|
// Library-only packages (`@cursor/sdk`) have no CLI to look for.
|
|
190
|
-
message: !opts.cliBin ? `Installed ${opts.npmPackage}` :
|
|
271
|
+
message: !opts.cliBin ? `Installed ${opts.npmPackage}` : `Installed ${opts.npmPackage} \u2192 ${binPath}`
|
|
191
272
|
};
|
|
192
273
|
}
|
|
274
|
+
async function resolveCliAfterNpmInstall(cliBin) {
|
|
275
|
+
const found = await whichOnPath(cliBin);
|
|
276
|
+
if (found) return found;
|
|
277
|
+
const prefix = await run("npm", ["prefix", "-g"], { reject: false, timeoutMs: 8e3 });
|
|
278
|
+
if (prefix.exitCode !== 0) return null;
|
|
279
|
+
const root = prefix.stdout.split(/\r?\n/).map((line) => line.trim()).filter((line) => line.startsWith("/")).pop();
|
|
280
|
+
if (!root) return null;
|
|
281
|
+
const candidate = join(root, "bin", cliBin);
|
|
282
|
+
if (!existsSync(candidate)) return null;
|
|
283
|
+
try {
|
|
284
|
+
chmodSync(candidate, 493);
|
|
285
|
+
} catch {
|
|
286
|
+
}
|
|
287
|
+
enrichPathWithNpmGlobalBin();
|
|
288
|
+
return whichOnPath(cliBin);
|
|
289
|
+
}
|
|
193
290
|
async function resolveExistingCli(agent) {
|
|
194
291
|
if (agent === "cursor") return null;
|
|
195
292
|
const exe = resolveAgentExecutable(agent);
|
|
@@ -232,6 +329,8 @@ async function installAgent(agent) {
|
|
|
232
329
|
if (existing && info.updateArgs?.length) {
|
|
233
330
|
return runVendorUpdate(existing, info.updateArgs);
|
|
234
331
|
}
|
|
332
|
+
if (agent === "claude") return installClaudeNative();
|
|
333
|
+
if (agent === "opencode") return installOpenCodeNative();
|
|
235
334
|
if (info.npmPackage && !isCurlInstaller(info.installCommand)) {
|
|
236
335
|
const cliBin = agent === "cursor" ? null : CLI_BIN[agent];
|
|
237
336
|
return installNpmGlobalPackage({
|
|
@@ -8,11 +8,11 @@ import {
|
|
|
8
8
|
isGlobalThread,
|
|
9
9
|
isOrchestratorThread,
|
|
10
10
|
isSlackCoordinatorThread
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-LEUAYFSG.js";
|
|
12
12
|
import {
|
|
13
13
|
mergeAgentGitAuthEnv,
|
|
14
14
|
resolveAgentGitAuthEnv
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-JJRTVB7D.js";
|
|
16
16
|
import {
|
|
17
17
|
REVIEW_TAB_TITLE,
|
|
18
18
|
allocateTeamName,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
} from "./chunk-QVLDZWHZ.js";
|
|
28
28
|
import {
|
|
29
29
|
ensureWorktreeSideboardIgnored
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-BMRJNRQK.js";
|
|
31
31
|
import {
|
|
32
32
|
extractPendingPlanQuestions,
|
|
33
33
|
isAskUserToolName,
|
|
@@ -45,7 +45,7 @@ import {
|
|
|
45
45
|
import {
|
|
46
46
|
ensureAgentPath,
|
|
47
47
|
run
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-R4W4VQJZ.js";
|
|
49
49
|
import {
|
|
50
50
|
assertOrchestratorCapableAgent,
|
|
51
51
|
contextTokens
|
|
@@ -1664,7 +1664,7 @@ var PORT_RANGE_SIZE = 10;
|
|
|
1664
1664
|
var RECLAIM_RETRY_DELAY_MS = 40;
|
|
1665
1665
|
var RECLAIM_TRIES = 8;
|
|
1666
1666
|
async function killReclaimable(ports, worktreePath, signal) {
|
|
1667
|
-
const { killListenersOnPorts: killListenersOnPorts2, killStaleWorktreeListeners: killStaleWorktreeListeners2 } = await import("./conductor-
|
|
1667
|
+
const { killListenersOnPorts: killListenersOnPorts2, killStaleWorktreeListeners: killStaleWorktreeListeners2 } = await import("./conductor-LUPB6RBH.js");
|
|
1668
1668
|
if (worktreePath) killStaleWorktreeListeners2(ports, worktreePath, signal);
|
|
1669
1669
|
else killListenersOnPorts2(ports);
|
|
1670
1670
|
}
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from "./chunk-QVLDZWHZ.js";
|
|
8
8
|
import {
|
|
9
9
|
ensureWorktreeSideboardIgnored
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-BMRJNRQK.js";
|
|
11
11
|
import {
|
|
12
12
|
isWorkspaceScratchPath
|
|
13
13
|
} from "./chunk-6K64FJDD.js";
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
materializeGithubAgentAuth,
|
|
22
22
|
originCli,
|
|
23
23
|
resolveGhAuthToken
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-R4W4VQJZ.js";
|
|
25
25
|
import {
|
|
26
26
|
getGithubGitAuthMode,
|
|
27
27
|
getGithubPat
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
resolveGithubRepoSlug,
|
|
6
6
|
resolveOriginRemote,
|
|
7
7
|
resolveRepoRoot
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-JJRTVB7D.js";
|
|
9
9
|
import {
|
|
10
10
|
allocateTeamName,
|
|
11
11
|
createEmptyThread,
|
|
@@ -401,7 +401,7 @@ var COORDINATOR_TOOL_PLAYBOOK = [
|
|
|
401
401
|
"- ask_user \u2014 composer multiple-choice only when blocked on a concrete choice (approach fork, which API, Save this context / Do not save). Never for hellos, check-ins, invented \u201Cwhat should we do?\u201D menus, or after a review \u2014 reply in chat. Explain options first, description on every option, then wait.",
|
|
402
402
|
"- get_viewer_context / update_viewer_context \u2014 read or replace Settings \u2192 Agents (account) and Settings \u2192 Projects (per-repo) context. You can update a project: pass scope=project and repoPath from list_projects (this cwd is not a project). update_viewer_context requires confirmed=true after ask_user. Never write context unprompted.",
|
|
403
403
|
"- list_env / set_env / delete_env \u2014 Settings \u2192 Environment. scope=project requires repoPath from list_projects and stores the key under that project prefix (the project name, uppercased, plus _). APPLE_ID for sideboard is SIDEBOARD_APPLE_ID. scope=account is shared by every project and is not prefixed. list_env returns names only.",
|
|
404
|
-
"- set_caffeinate \u2014 keep this Mac awake across turns (macOS caffeinate).
|
|
404
|
+
"- set_caffeinate \u2014 keep this Mac awake across turns (macOS caffeinate). A connected phone already holds caffeinate (lid can close on power), so do not turn this on just because they are on the phone. Turn on for overnight work, or when the user will be away and no phone is connected. Turn OFF when they say they are done, wrapping up, going to sleep, or no longer need the machine awake. Closing this chat also releases it.",
|
|
405
405
|
"- list_schedules / create_schedule / update_schedule / delete_schedule / run_schedule \u2014 automations that send a prompt to a chat (chatId or self) or start a new Global chat (omit chatId). A job bound to a chat is removed when that chat is archived. Omit chatId only for a Global automation that should outlive the chat. One-shot `at`, interval `every` (15m/1h/6h/1d), clock time `time` + `days` (07:30 and weekdays, or mon,wed), or 5-field `cron`. Recurring jobs without chatId open a new chat each run and archive it when that run finishes unless archiveChat is false (leave the chat open to keep talking). History keeps the last 5 archived runs for that automation. Worktree agents have the same tools (`chatId=self` continues that coding chat and is removed when that chat is archived). Jobs fire only while Sideboard.app is running; sleep skips until wake. Creating or enabling a future job turns on Settings \u2192 Advanced \u2192 Caffeinate while automations are enabled (or call set_caffeinate). The desktop lists them in the sidebar after Board.",
|
|
406
406
|
"Projects:",
|
|
407
407
|
"- add_project / remove_project \u2014 register or unregister a git repo",
|
|
@@ -427,7 +427,7 @@ var COORDINATOR_TOOL_PLAYBOOK = [
|
|
|
427
427
|
"- get_diff \u2014 compact diff summary",
|
|
428
428
|
"- get_pr_checks \u2014 snapshot of a worktree thread's PR checks (null = no PR). Use this to inspect status. If the user gave a goal, the worktree agent watches with `gh pr checks --watch` on GitHub, `origin pr watch` on Cursor, or `entire trail watch` on Entire \u2014 do not poll for the human.",
|
|
429
429
|
'- request_review \u2014 run a Review on a worktree thread. Reuses the only unused idle agent when the checkout has a single chat with no messages; otherwise opens a Review tab (attaches .claude/skills/review/SKILL.md when present, else .context/review.md copied from .sideboard/review.md / stock; sends "Review changes in this workspace."); then wait_for_turn (loop while stillRunning) / get_turn_result on the returned id. The review stays in that chat so they can read it and type next steps \u2014 do not tell the child to comment or update the PR or ticket.',
|
|
430
|
-
"- ask_git \u2014 commit & push, open a draft PR, mark ready for review, resolve conflicts, or merge \u2014 same prompts as the desktop git buttons (Resolve, Create PR, \u2026). Always steers the worktree agent; then wait_for_turn (loop while stillRunning). Prefer this over paraphrasing. If the user gave a goal (Greptile 5/5, CI green), send_to_chat that goal so the worktree agent enters the watch-fix-push loop \u2014 do not tell the human to poll.",
|
|
430
|
+
"- ask_git \u2014 commit & push, open a draft PR, mark ready for review, resolve conflicts, or merge \u2014 same prompts as the desktop git buttons (Resolve, Create PR, \u2026). Always steers the worktree agent; then wait_for_turn (loop while stillRunning). Prefer this over paraphrasing. If the user gave a goal (Greptile 5/5, CI green), send_to_chat that goal so the worktree agent enters the watch-fix-push loop \u2014 do not tell the human to poll. A push can wake a third-party PR review; the worktree agent acknowledges that review only inside an existing goal, not on a plain push.",
|
|
431
431
|
'- Merge (`ask_git` action=merge / send_to_chat "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.',
|
|
432
432
|
'- Or send_to_chat with those exact phrases: "Commit and push.", "Commit, push, and open a draft PR.", "Ready for review.", "Merge PR." Prefer ask_git resolve-conflicts (it names the actual PR base \u2014 not always main) over paraphrasing. Draft PRs follow that workspace origin: GitHub (`github:`) uses `gh pr create --draft --assignee @me -R <slug>`; Cursor (`cursor:`) uses `origin pr create --draft --push -R <slug>`; Entire (`entire:`) uses `entire trail create --title` (Trails have no draft state). Never upstream. Never run git, gh, origin, or entire from this orchestration cwd, and never merge the PR yourself.',
|
|
433
433
|
"Process guides:",
|
|
@@ -560,7 +560,7 @@ function ensureGlobalCoordinatorCwd(opts) {
|
|
|
560
560
|
"Typical flow (find work): list_projects \u2192 pick repo(s) matching account / project context \u2192 Sideboard list_issues / linear_* (tickets) or list_prs(queue=review) (reviews) \u2192 show the options. Never wait on Claude Linear MCP. Only create_workspace + send_to_chat 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_projects \u2192 list_prs(queue=review, limit=N) \u2192 show those PRs (ticket ids in the title when present). create_workspace sourceType=pr only when they asked to start / do the work. Do not list_issues for "tickets to review". The child writes the review in chat and stops \u2014 do not ask_user after it. Do not github_comment / linear_comment / update the PR or ticket, and do not tell the child to post, until the user types a next step. They should work through the feedback in chat first. The PR or ticket author sees those writes immediately.',
|
|
562
562
|
"Typical flow (new app): Bash create/clone under repos dir \u2192 add_project \u2192 create_workspace \u2192 send_to_chat (implement) \u2192 wait_for_turn (loop while stillRunning) \u2192 ask_git create-draft.",
|
|
563
|
-
"Always ask worktree agents to commit, push, and open draft PRs (`ask_git` / `send_to_chat`). 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."
|
|
563
|
+
"Always ask worktree agents to commit, push, and open draft PRs (`ask_git` / `send_to_chat`). 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. A push can wake a third-party PR review; acknowledge it only inside that goal. Tell them to merge only when the user explicitly asked. The worktree agent runs git/gh; never merge from this orchestration cwd."
|
|
564
564
|
].join("\n");
|
|
565
565
|
try {
|
|
566
566
|
writeFileSync2(join2(dir, "AGENTS.md"), `${body}
|