@sideboard-ai/core 0.1.169 → 0.1.171
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-IC2V7CNB.js → abletime-7VW4EGPT.js} +2 -2
- package/dist/{abletime-ESVTHTFH.js → abletime-PCLL36HW.js} +2 -2
- package/dist/{agents-V7CF33IK.js → agents-7UTRNLXQ.js} +4 -4
- package/dist/{agents-LNFEVU2F.js → agents-CTWLBPCV.js} +4 -4
- package/dist/{app-settings-VMOTQORT.js → app-settings-663VQWUV.js} +1 -1
- package/dist/{app-settings-LF3TS7XS.js → app-settings-74HBAAH7.js} +1 -1
- package/dist/{chunk-P2VCMIZU.js → chunk-234EKD2F.js} +2 -2
- package/dist/{chunk-DHPZW2EA.js → chunk-2RM6BZQ2.js} +2 -2
- package/dist/{chunk-QHCSYWEC.js → chunk-3F7AXVIL.js} +30 -10
- package/dist/{chunk-BLSTB2AD.js → chunk-6X6KMUI2.js} +29 -10
- package/dist/{chunk-DKLGWRWC.js → chunk-AQPVBVJE.js} +1 -1
- package/dist/{chunk-NB7TEKCF.js → chunk-CMJ2FBBV.js} +1 -1
- package/dist/{chunk-7IUO67CW.js → chunk-J7LQVLFQ.js} +15 -8
- package/dist/{chunk-YMF5WCIA.js → chunk-OKZFTOM2.js} +15 -8
- package/dist/{chunk-Y7DJA3UW.js → chunk-PXNOT6NV.js} +1 -1
- package/dist/{chunk-ISMGVHP4.js → chunk-QYJS7LYE.js} +181 -207
- package/dist/{chunk-3C4B52TS.js → chunk-QYZYDO3F.js} +1 -1
- package/dist/{chunk-M3OIQZRS.js → chunk-ZTVBIBLB.js} +177 -138
- package/dist/{coordinator-prompt-JTDCEU74.js → coordinator-prompt-7CTI6HRH.js} +3 -3
- package/dist/{coordinator-prompt-RRUU2OYO.js → coordinator-prompt-PM6MPYYB.js} +3 -3
- package/dist/{global-workspace-ZF6EJAM3.js → global-workspace-CMYSFRCM.js} +3 -3
- package/dist/{global-workspace-4SI3CRRT.js → global-workspace-CRJ6ZVIY.js} +3 -3
- package/dist/index.cjs +205 -203
- package/dist/index.d.cts +49 -21
- package/dist/index.d.ts +49 -21
- package/dist/index.js +16 -14
- package/dist/mcp/run-stdio.cjs +197 -132
- package/dist/mcp/run-stdio.js +8 -8
- package/dist/{orchestrator-67BPEJZL.js → orchestrator-RW4IVITI.js} +5 -5
- package/dist/{orchestrator-FCH2PFPX.js → orchestrator-VPT4SXXD.js} +5 -5
- package/dist/{workspaces-NOC2MWQV.js → workspaces-L73MCDFA.js} +3 -3
- package/dist/{workspaces-A7C3WA54.js → workspaces-UYSD2STS.js} +3 -3
- package/dist/{worktree-GXO2VDQF.js → worktree-SQD3DBYC.js} +2 -2
- package/dist/{worktree-PODE23PD.js → worktree-WVEDT3FM.js} +2 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1141,7 +1141,7 @@ function normalizeClaude(raw) {
|
|
|
1141
1141
|
const out = {};
|
|
1142
1142
|
if (typeof source.executablePath === "string") {
|
|
1143
1143
|
const path2 = source.executablePath.trim();
|
|
1144
|
-
if (path2) out.executablePath = path2;
|
|
1144
|
+
if (path2 && (0, import_node_path8.isAbsolute)(path2)) out.executablePath = path2;
|
|
1145
1145
|
}
|
|
1146
1146
|
if (typeof source.chromeEnabled === "boolean") {
|
|
1147
1147
|
out.chromeEnabled = source.chromeEnabled;
|
|
@@ -1154,17 +1154,24 @@ function normalizeCliExecutable(raw) {
|
|
|
1154
1154
|
const out = {};
|
|
1155
1155
|
if (typeof source.executablePath === "string") {
|
|
1156
1156
|
const path2 = source.executablePath.trim();
|
|
1157
|
-
if (path2) out.executablePath = path2;
|
|
1157
|
+
if (path2 && (0, import_node_path8.isAbsolute)(path2)) out.executablePath = path2;
|
|
1158
1158
|
}
|
|
1159
1159
|
return out;
|
|
1160
1160
|
}
|
|
1161
|
+
function absoluteExecutablePath(value) {
|
|
1162
|
+
const path2 = value.trim();
|
|
1163
|
+
if (!(0, import_node_path8.isAbsolute)(path2)) {
|
|
1164
|
+
throw new Error("Executable path must be absolute. Leave it empty to use the system CLI.");
|
|
1165
|
+
}
|
|
1166
|
+
return path2;
|
|
1167
|
+
}
|
|
1161
1168
|
function normalizeBrightsy(raw) {
|
|
1162
1169
|
if (!raw || typeof raw !== "object") return {};
|
|
1163
1170
|
const source = raw;
|
|
1164
1171
|
const out = {};
|
|
1165
1172
|
if (typeof source.executablePath === "string") {
|
|
1166
1173
|
const path2 = source.executablePath.trim();
|
|
1167
|
-
if (path2) out.executablePath = path2;
|
|
1174
|
+
if (path2 && (0, import_node_path8.isAbsolute)(path2)) out.executablePath = path2;
|
|
1168
1175
|
}
|
|
1169
1176
|
if (typeof source.cloudConnectEnabled === "boolean") {
|
|
1170
1177
|
out.cloudConnectEnabled = source.cloudConnectEnabled;
|
|
@@ -1643,7 +1650,7 @@ function updateClaudeSettings(patch) {
|
|
|
1643
1650
|
if (patch.executablePath == null || patch.executablePath.trim() === "") {
|
|
1644
1651
|
delete claude.executablePath;
|
|
1645
1652
|
} else {
|
|
1646
|
-
claude.executablePath = patch.executablePath
|
|
1653
|
+
claude.executablePath = absoluteExecutablePath(patch.executablePath);
|
|
1647
1654
|
}
|
|
1648
1655
|
}
|
|
1649
1656
|
if (typeof patch.chromeEnabled === "boolean") {
|
|
@@ -1658,7 +1665,7 @@ function updateBrightsySettings(patch) {
|
|
|
1658
1665
|
if (patch.executablePath == null || patch.executablePath.trim() === "") {
|
|
1659
1666
|
delete brightsy.executablePath;
|
|
1660
1667
|
} else {
|
|
1661
|
-
brightsy.executablePath = patch.executablePath
|
|
1668
|
+
brightsy.executablePath = absoluteExecutablePath(patch.executablePath);
|
|
1662
1669
|
}
|
|
1663
1670
|
}
|
|
1664
1671
|
if (typeof patch.cloudConnectEnabled === "boolean") {
|
|
@@ -1683,7 +1690,7 @@ function updateCodexSettings(patch) {
|
|
|
1683
1690
|
if (patch.executablePath == null || patch.executablePath.trim() === "") {
|
|
1684
1691
|
delete codex.executablePath;
|
|
1685
1692
|
} else {
|
|
1686
|
-
codex.executablePath = patch.executablePath
|
|
1693
|
+
codex.executablePath = absoluteExecutablePath(patch.executablePath);
|
|
1687
1694
|
}
|
|
1688
1695
|
}
|
|
1689
1696
|
return saveAppSettings({ ...current, codex });
|
|
@@ -1695,7 +1702,7 @@ function updateOpencodeSettings(patch) {
|
|
|
1695
1702
|
if (patch.executablePath == null || patch.executablePath.trim() === "") {
|
|
1696
1703
|
delete opencode.executablePath;
|
|
1697
1704
|
} else {
|
|
1698
|
-
opencode.executablePath = patch.executablePath
|
|
1705
|
+
opencode.executablePath = absoluteExecutablePath(patch.executablePath);
|
|
1699
1706
|
}
|
|
1700
1707
|
}
|
|
1701
1708
|
return saveAppSettings({ ...current, opencode });
|
|
@@ -9434,22 +9441,38 @@ var init_brightsy_targets = __esm({
|
|
|
9434
9441
|
// src/agents/turn-input.ts
|
|
9435
9442
|
function normalizeTurnInput(input) {
|
|
9436
9443
|
if (typeof input === "string") return { prompt: input };
|
|
9437
|
-
return {
|
|
9444
|
+
return {
|
|
9445
|
+
prompt: input.prompt,
|
|
9446
|
+
cachedPrefix: input.cachedPrefix?.trim() || void 0,
|
|
9447
|
+
systemPrompt: input.systemPrompt?.trim() || void 0
|
|
9448
|
+
};
|
|
9438
9449
|
}
|
|
9439
9450
|
function dropCachedPrefixOnResume(input, sessionId) {
|
|
9440
9451
|
const turn = normalizeTurnInput(input);
|
|
9441
|
-
if (sessionId)
|
|
9452
|
+
if (sessionId) {
|
|
9453
|
+
return turn.systemPrompt ? { prompt: turn.prompt, systemPrompt: turn.systemPrompt } : { prompt: turn.prompt };
|
|
9454
|
+
}
|
|
9442
9455
|
return turn;
|
|
9443
9456
|
}
|
|
9444
9457
|
function flattenTurnInput(input) {
|
|
9445
|
-
const { cachedPrefix, prompt } = normalizeTurnInput(input);
|
|
9446
|
-
if (
|
|
9447
|
-
return `${cachedPrefix}
|
|
9458
|
+
const { cachedPrefix, prompt, systemPrompt } = normalizeTurnInput(input);
|
|
9459
|
+
if (cachedPrefix) return `${cachedPrefix}
|
|
9448
9460
|
|
|
9449
9461
|
---
|
|
9450
9462
|
|
|
9451
9463
|
Current request:
|
|
9452
9464
|
${prompt}`;
|
|
9465
|
+
if (systemPrompt) return `${systemPrompt}
|
|
9466
|
+
|
|
9467
|
+
${prompt}`;
|
|
9468
|
+
return prompt;
|
|
9469
|
+
}
|
|
9470
|
+
function splitTurnInputForSystemPrompt(input) {
|
|
9471
|
+
const turn = normalizeTurnInput(input);
|
|
9472
|
+
return {
|
|
9473
|
+
promptText: flattenTurnInput({ cachedPrefix: turn.cachedPrefix, prompt: turn.prompt }),
|
|
9474
|
+
systemPrompt: turn.systemPrompt
|
|
9475
|
+
};
|
|
9453
9476
|
}
|
|
9454
9477
|
function buildCachedUserContent(input) {
|
|
9455
9478
|
return [{ type: "text", text: flattenTurnInput(input) }];
|
|
@@ -11489,7 +11512,7 @@ var init_claude = __esm({
|
|
|
11489
11512
|
const claude = resolveClaudeExecutable();
|
|
11490
11513
|
const sessionId = await this.resolveSessionId(thread.worktreePath, thread.sessionId);
|
|
11491
11514
|
const effective = dropCachedPrefixOnResume(input, sessionId);
|
|
11492
|
-
const promptText =
|
|
11515
|
+
const { promptText, systemPrompt } = splitTurnInputForSystemPrompt(effective);
|
|
11493
11516
|
const useStdin = promptText.length > CLAUDE_PROMPT_ARG_MAX;
|
|
11494
11517
|
if (process.env.SIDEBOARD_DEBUG_CLAUDE_TURN === "1") {
|
|
11495
11518
|
console.error(
|
|
@@ -11541,6 +11564,9 @@ var init_claude = __esm({
|
|
|
11541
11564
|
"--permission-mode",
|
|
11542
11565
|
mode.claude
|
|
11543
11566
|
];
|
|
11567
|
+
if (systemPrompt) {
|
|
11568
|
+
args.push("--append-system-prompt", systemPrompt);
|
|
11569
|
+
}
|
|
11544
11570
|
const mcpConfigPath = writeMcpServersConfig(injectedServers);
|
|
11545
11571
|
if (mcpConfigPath) {
|
|
11546
11572
|
args.push("--mcp-config", mcpConfigPath);
|
|
@@ -13962,7 +13988,50 @@ function agentGitPrompt(action, opts) {
|
|
|
13962
13988
|
return "Merge PR.";
|
|
13963
13989
|
}
|
|
13964
13990
|
}
|
|
13965
|
-
|
|
13991
|
+
function gitActionExpansion(action, base) {
|
|
13992
|
+
switch (action) {
|
|
13993
|
+
case "commit-push":
|
|
13994
|
+
return "Commit any uncommitted work with a purpose-stating message, then push to origin (`git push -u origin HEAD`; this updates an existing PR when one is linked). Do not start a checks loop unless a goal was given.";
|
|
13995
|
+
case "create-draft":
|
|
13996
|
+
return "Commit, push, then create a draft PR with `gh pr create --draft -R <origin-owner/name>` (title/body from the change purpose). Update the existing PR instead if one is linked.";
|
|
13997
|
+
case "create-web":
|
|
13998
|
+
return "Commit, push, then `gh pr create --web -R <origin-owner/name>`.";
|
|
13999
|
+
case "resolve-conflicts":
|
|
14000
|
+
return `Fetch the PR base${base ? ` (\`${base}\`)` : ""}, merge it into this branch, resolve conflicts carefully, then commit and push until the PR is mergeable.`;
|
|
14001
|
+
case "merge":
|
|
14002
|
+
return "This phrase is the explicit ask to merge this thread's open pull request on GitHub. If `gh stack view` shows a stack, use `gh stack merge`; otherwise `gh pr merge` (respect repo defaults / squash vs merge). Do not force-push main/master or merge locally into the main checkout.";
|
|
14003
|
+
}
|
|
14004
|
+
}
|
|
14005
|
+
function expandCanonicalGitRequest(prompt) {
|
|
14006
|
+
const trimmed = prompt.trim();
|
|
14007
|
+
let action = null;
|
|
14008
|
+
let base = null;
|
|
14009
|
+
for (const candidate of AGENT_GIT_ACTIONS) {
|
|
14010
|
+
if (candidate === "resolve-conflicts") continue;
|
|
14011
|
+
if (agentGitPrompt(candidate) === trimmed) {
|
|
14012
|
+
action = candidate;
|
|
14013
|
+
break;
|
|
14014
|
+
}
|
|
14015
|
+
}
|
|
14016
|
+
if (!action) {
|
|
14017
|
+
const m = RESOLVE_CONFLICTS_RE.exec(trimmed);
|
|
14018
|
+
if (m) {
|
|
14019
|
+
action = "resolve-conflicts";
|
|
14020
|
+
base = m[1] ?? null;
|
|
14021
|
+
}
|
|
14022
|
+
}
|
|
14023
|
+
let expansion = action ? gitActionExpansion(action, base) : null;
|
|
14024
|
+
if (!expansion && trimmed === "Address review comments.") {
|
|
14025
|
+
expansion = "Read the PR review feedback (`gh pr view --comments`, `gh api` review comments), make the requested changes, commit, and push.";
|
|
14026
|
+
} else if (!expansion && FIX_CI_RE.test(trimmed)) {
|
|
14027
|
+
expansion = "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.";
|
|
14028
|
+
}
|
|
14029
|
+
if (!expansion) return prompt;
|
|
14030
|
+
return `${trimmed}
|
|
14031
|
+
|
|
14032
|
+
(Sideboard git request \u2014 do not ask for clarification: ${expansion})`;
|
|
14033
|
+
}
|
|
14034
|
+
var AGENT_GIT_ACTIONS, RESOLVE_CONFLICTS_RE, FIX_CI_RE;
|
|
13966
14035
|
var init_agent_git_actions = __esm({
|
|
13967
14036
|
"src/git/agent-git-actions.ts"() {
|
|
13968
14037
|
"use strict";
|
|
@@ -13973,6 +14042,8 @@ var init_agent_git_actions = __esm({
|
|
|
13973
14042
|
"resolve-conflicts",
|
|
13974
14043
|
"merge"
|
|
13975
14044
|
];
|
|
14045
|
+
RESOLVE_CONFLICTS_RE = /^Merge the remote branch(?: \(([^)]+)\))? into your branch and resolve conflicts\. Then, commit and push your changes\.$/;
|
|
14046
|
+
FIX_CI_RE = /^Fix CI: .+\.$/;
|
|
13976
14047
|
}
|
|
13977
14048
|
});
|
|
13978
14049
|
|
|
@@ -14230,47 +14301,82 @@ function formatToolPart(t, detail) {
|
|
|
14230
14301
|
}
|
|
14231
14302
|
function formatMessagesAsTranscript(messages, opts) {
|
|
14232
14303
|
const tools = opts?.tools ?? "full";
|
|
14233
|
-
const
|
|
14234
|
-
|
|
14235
|
-
|
|
14236
|
-
|
|
14237
|
-
|
|
14238
|
-
|
|
14239
|
-
|
|
14240
|
-
|
|
14241
|
-
|
|
14242
|
-
|
|
14243
|
-
|
|
14244
|
-
}
|
|
14245
|
-
const bits = [];
|
|
14246
|
-
if (m.text?.trim()) {
|
|
14247
|
-
bits.push(`### Agent
|
|
14304
|
+
const thinking = opts?.thinking ?? true;
|
|
14305
|
+
return messages.map((m) => formatMessageBlock(m, { tools, thinking })).join("\n\n");
|
|
14306
|
+
}
|
|
14307
|
+
function formatMessageBlock(m, opts) {
|
|
14308
|
+
if (m.role === "summary") return `## Prior summary
|
|
14309
|
+
${m.text}`;
|
|
14310
|
+
if (m.role === "user") return `### User
|
|
14311
|
+
${m.text}`;
|
|
14312
|
+
const bits = [];
|
|
14313
|
+
if (m.text?.trim()) {
|
|
14314
|
+
bits.push(`### Agent
|
|
14248
14315
|
${m.text}`);
|
|
14249
|
-
|
|
14250
|
-
|
|
14251
|
-
|
|
14252
|
-
|
|
14253
|
-
for (const th of
|
|
14316
|
+
} else {
|
|
14317
|
+
bits.push("### Agent");
|
|
14318
|
+
}
|
|
14319
|
+
if (opts.thinking) {
|
|
14320
|
+
for (const th of m.parts ?? []) {
|
|
14254
14321
|
if (th.type !== "thinking" || !th.text.trim()) continue;
|
|
14255
14322
|
bits.push("Thinking:");
|
|
14256
14323
|
bits.push(th.text);
|
|
14257
14324
|
}
|
|
14258
|
-
|
|
14259
|
-
|
|
14260
|
-
)
|
|
14261
|
-
|
|
14262
|
-
|
|
14263
|
-
|
|
14264
|
-
|
|
14265
|
-
|
|
14325
|
+
}
|
|
14326
|
+
const toolParts = (m.parts ?? []).filter(
|
|
14327
|
+
(p) => p.type === "tool"
|
|
14328
|
+
);
|
|
14329
|
+
if (opts.tools !== "none" && toolParts.length > 0) {
|
|
14330
|
+
if (opts.tools === "summary") bits.push("Tools:");
|
|
14331
|
+
for (const t of toolParts) {
|
|
14332
|
+
bits.push(formatToolPart(t, opts.tools));
|
|
14266
14333
|
}
|
|
14267
|
-
blocks.push(bits.join("\n"));
|
|
14268
14334
|
}
|
|
14269
|
-
return
|
|
14335
|
+
return bits.join("\n");
|
|
14270
14336
|
}
|
|
14271
14337
|
function buildSessionSeed(messages, opts) {
|
|
14272
14338
|
if (messages.length === 0) return null;
|
|
14273
|
-
const
|
|
14339
|
+
const tools = opts?.tools ?? "full";
|
|
14340
|
+
const fullCount = opts?.fullToolMessages ?? SEED_FULL_TOOL_MESSAGES;
|
|
14341
|
+
const maxChars = opts?.maxChars ?? SEED_MAX_CHARS;
|
|
14342
|
+
const olderTools = tools === "none" ? "none" : "summary";
|
|
14343
|
+
const fullFrom = Math.max(0, messages.length - fullCount);
|
|
14344
|
+
const blocks = messages.map(
|
|
14345
|
+
(m, i) => formatMessageBlock(m, {
|
|
14346
|
+
tools: i >= fullFrom ? tools : olderTools,
|
|
14347
|
+
thinking: false
|
|
14348
|
+
})
|
|
14349
|
+
);
|
|
14350
|
+
const keep = new Array(blocks.length).fill(false);
|
|
14351
|
+
let used = 0;
|
|
14352
|
+
for (let i = 0; i < blocks.length; i++) {
|
|
14353
|
+
if (messages[i].role === "summary") {
|
|
14354
|
+
keep[i] = true;
|
|
14355
|
+
used += blocks[i].length + 2;
|
|
14356
|
+
}
|
|
14357
|
+
}
|
|
14358
|
+
for (let i = blocks.length - 1; i >= 0; i--) {
|
|
14359
|
+
if (keep[i]) continue;
|
|
14360
|
+
const next = used + blocks[i].length + 2;
|
|
14361
|
+
if (next > maxChars && used > 0) break;
|
|
14362
|
+
keep[i] = true;
|
|
14363
|
+
used = next;
|
|
14364
|
+
}
|
|
14365
|
+
const dropped = keep.filter((k) => !k).length;
|
|
14366
|
+
const kept = [];
|
|
14367
|
+
let markerPlaced = false;
|
|
14368
|
+
for (let i = 0; i < blocks.length; i++) {
|
|
14369
|
+
if (!keep[i]) continue;
|
|
14370
|
+
if (dropped > 0 && !markerPlaced && messages[i].role !== "summary") {
|
|
14371
|
+
kept.push(`_(${dropped} older message${dropped === 1 ? "" : "s"} omitted for length)_`);
|
|
14372
|
+
markerPlaced = true;
|
|
14373
|
+
}
|
|
14374
|
+
kept.push(blocks[i]);
|
|
14375
|
+
}
|
|
14376
|
+
if (dropped > 0 && !markerPlaced) {
|
|
14377
|
+
kept.push(`_(${dropped} older message${dropped === 1 ? "" : "s"} omitted for length)_`);
|
|
14378
|
+
}
|
|
14379
|
+
const body = kept.join("\n\n");
|
|
14274
14380
|
if (!body.trim()) return null;
|
|
14275
14381
|
return [
|
|
14276
14382
|
"Sideboard conversation context (restored after compaction or a new session):",
|
|
@@ -14328,7 +14434,7 @@ function messagesSinceLastBrightsyContextSummary(messages) {
|
|
|
14328
14434
|
function buildBrightsySessionSeed(messages) {
|
|
14329
14435
|
const match = findLastBrightsyContextSummary(messages);
|
|
14330
14436
|
const tail = match ? messages.slice(match.index + 1) : messages;
|
|
14331
|
-
const body = formatMessagesAsTranscript(tail, { tools: "none" });
|
|
14437
|
+
const body = formatMessagesAsTranscript(tail, { tools: "none", thinking: false });
|
|
14332
14438
|
if (!match && !body.trim()) return null;
|
|
14333
14439
|
const blocks = [
|
|
14334
14440
|
"Sideboard conversation context (restored after compaction or a new session):",
|
|
@@ -14395,7 +14501,7 @@ async function maybeCompactContext(thread, thresholds = {}, summarize = summariz
|
|
|
14395
14501
|
olderCount: older.length
|
|
14396
14502
|
};
|
|
14397
14503
|
}
|
|
14398
|
-
var CONTEXT_COMPACT_CHARS, CONTEXT_KEEP_RECENT_CHARS, CONTEXT_KEEP_RECENT_MESSAGES, CONTEXT_MIN_MESSAGES, SESSION_RESET_OCCUPANCY_TOKENS, BRIGHTSY_SUMMARIZE_CONTEXT_TOOL;
|
|
14504
|
+
var CONTEXT_COMPACT_CHARS, CONTEXT_KEEP_RECENT_CHARS, CONTEXT_KEEP_RECENT_MESSAGES, CONTEXT_MIN_MESSAGES, SESSION_RESET_OCCUPANCY_TOKENS, SEED_MAX_CHARS, SEED_FULL_TOOL_MESSAGES, BRIGHTSY_SUMMARIZE_CONTEXT_TOOL;
|
|
14399
14505
|
var init_context_compact = __esm({
|
|
14400
14506
|
"src/composer/context-compact.ts"() {
|
|
14401
14507
|
"use strict";
|
|
@@ -14408,6 +14514,8 @@ var init_context_compact = __esm({
|
|
|
14408
14514
|
CONTEXT_KEEP_RECENT_MESSAGES = 12;
|
|
14409
14515
|
CONTEXT_MIN_MESSAGES = 10;
|
|
14410
14516
|
SESSION_RESET_OCCUPANCY_TOKENS = 75e4;
|
|
14517
|
+
SEED_MAX_CHARS = 6e4;
|
|
14518
|
+
SEED_FULL_TOOL_MESSAGES = 6;
|
|
14411
14519
|
BRIGHTSY_SUMMARIZE_CONTEXT_TOOL = "summarize_context";
|
|
14412
14520
|
}
|
|
14413
14521
|
});
|
|
@@ -19476,67 +19584,37 @@ function formatWorktreeDirective(thread, opts) {
|
|
|
19476
19584
|
lines.push(
|
|
19477
19585
|
"- Always use this worktree's `origin` remote (`git remote get-url origin` from this cwd). Never push to or open PRs against `upstream` (template remotes)."
|
|
19478
19586
|
);
|
|
19479
|
-
lines.push(
|
|
19480
|
-
"- Push with `git push -u origin HEAD` (or the current branch name). Do not `git push upstream`."
|
|
19481
|
-
);
|
|
19482
|
-
lines.push("");
|
|
19483
19587
|
lines.push(formatGitAuthModeDirective(opts?.gitAuthMode ?? "auto"));
|
|
19484
19588
|
lines.push(
|
|
19485
|
-
"-
|
|
19486
|
-
);
|
|
19487
|
-
lines.push(
|
|
19488
|
-
"- Prefer a concise imperative title (Conventional Commits style when it fits: feat:/fix:/chore:/docs:). Body should summarize intent, key changes, and test notes."
|
|
19589
|
+
"- PR title/body and commit messages state what the change does and why (inspect the diff/commits and the user request) \u2014 never the worktree nickname or placeholder branch. Concise imperative title (Conventional Commits when it fits: feat:/fix:/chore:/docs:); body = intent, key changes, test notes."
|
|
19489
19590
|
);
|
|
19490
19591
|
lines.push(
|
|
19491
|
-
"-
|
|
19592
|
+
"- Stay on this thread branch. Never push to main/master or merge locally into the main checkout. Merge the PR only when this turn is a Merge PR request or the user explicitly asked \u2014 via GitHub from this worktree (`gh pr merge` / `gh stack merge`)."
|
|
19492
19593
|
);
|
|
19493
19594
|
if (thread.prUrl) {
|
|
19494
19595
|
lines.push(
|
|
19495
19596
|
`- A PR already exists (${thread.prUrl}). Update it (push + edit title/body if the purpose drifted) instead of opening a duplicate.`
|
|
19496
19597
|
);
|
|
19497
|
-
} else if (opts?.githubSlug) {
|
|
19498
|
-
lines.push(
|
|
19499
|
-
`- 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\`.`
|
|
19500
|
-
);
|
|
19501
19598
|
} else {
|
|
19599
|
+
const slug = opts?.githubSlug ?? "<origin-owner/name>";
|
|
19600
|
+
const resolve = opts?.githubSlug ? "" : " Resolve `<origin-owner/name>` with `git remote get-url origin` in this worktree.";
|
|
19502
19601
|
lines.push(
|
|
19503
|
-
|
|
19602
|
+
`- Prefer a draft PR first: \`gh pr create --draft -R ${slug}\` (update via \`gh pr edit -R ${slug}\`). Always pass \`-R\` \u2014 bare \`gh pr create\` may target upstream on dual-remote checkouts.${resolve} Mark ready for review only when asked. If GitHub rejects the body as too long, retry with a short \`--body-file\` \u2014 do not paste a changelog or diff into \`--body\`.`
|
|
19504
19603
|
);
|
|
19505
19604
|
}
|
|
19506
|
-
lines.push("");
|
|
19507
|
-
lines.push(
|
|
19508
|
-
"Short git requests from the Sideboard UI are complete instructions \u2014 expand them using the rules above without asking for clarification:"
|
|
19509
|
-
);
|
|
19510
|
-
lines.push(
|
|
19511
|
-
'- "Commit and push." \u2192 commit any uncommitted work with a purpose-stating message, then push to origin (updates an existing PR if one is linked). Do not start a checks loop unless they gave a goal.'
|
|
19512
|
-
);
|
|
19513
19605
|
lines.push(
|
|
19514
|
-
'- "Commit
|
|
19606
|
+
'- Sideboard git buttons send short phrases ("Commit and push.", "Merge PR.", \u2026) with their meaning attached \u2014 act on them without asking for clarification. If the user gives a goal (Greptile 5/5, CI green, until checks pass), you get the watch-fix-push playbook with that request.'
|
|
19515
19607
|
);
|
|
19516
|
-
lines.push(
|
|
19517
|
-
'- "Commit, push, and open a PR in the browser." \u2192 commit, push, then `gh pr create --web -R \u2026`.'
|
|
19518
|
-
);
|
|
19519
|
-
lines.push(
|
|
19520
|
-
'- "Fix CI: <name>." \u2192 investigate that failing check, fix it, commit, and push. Loop only if they gave a goal to keep going until it passes.'
|
|
19521
|
-
);
|
|
19522
|
-
lines.push(
|
|
19523
|
-
'- "Merge the remote branch (<base>) into your branch and resolve conflicts. Then, commit and push your changes." \u2192 fetch the PR base, merge it into this branch, resolve conflicts carefully, commit, and push until the PR is mergeable.'
|
|
19524
|
-
);
|
|
19525
|
-
lines.push(
|
|
19526
|
-
'- "Address review comments." \u2192 read PR review feedback, make the requested changes, commit, and push.'
|
|
19527
|
-
);
|
|
19528
|
-
lines.push(
|
|
19529
|
-
'- "Merge PR." \u2192 merge this thread\'s open pull request on GitHub (this phrase is the explicit ask). If `gh stack view` shows a stack, use `gh stack merge`; otherwise `gh pr merge` (respect repo defaults / squash vs merge). Do not force-push main/master or merge locally into the main checkout.'
|
|
19530
|
-
);
|
|
19531
|
-
lines.push("");
|
|
19532
|
-
lines.push(formatPrGateDirective());
|
|
19533
19608
|
lines.push("");
|
|
19534
|
-
lines.push(formatProcessGuideDirective());
|
|
19609
|
+
lines.push(formatProcessGuideDirective({ worktreePath: thread.worktreePath }));
|
|
19535
19610
|
return lines.join("\n");
|
|
19536
19611
|
}
|
|
19537
19612
|
function formatWorktreeReminder() {
|
|
19538
19613
|
return "Sideboard worktree: stay in this cwd for all file and git work. Push and open PRs against origin, never upstream. Do not edit the main repo checkout. If a goal is given (Greptile 5/5, CI green), watch-fix-push until it lands \u2014 do not watch after every push.";
|
|
19539
19614
|
}
|
|
19615
|
+
function mentionsPrGoal(prompt) {
|
|
19616
|
+
return PR_GOAL_RE.test(prompt);
|
|
19617
|
+
}
|
|
19540
19618
|
function issueTicketFromThread(thread, preferredSource = "github") {
|
|
19541
19619
|
if (thread?.sourceType !== "ticket") return null;
|
|
19542
19620
|
const ref = thread.sourceRef?.trim() ?? "";
|
|
@@ -19625,29 +19703,27 @@ function formatPrGateDirective() {
|
|
|
19625
19703
|
"- Greptile 5/5: wait for the greptile check; read the latest `N/5` from the PR body or Greptile\u2019s most recently *updated* issue comment; also fetch unresolved review comments / the \u201CPrompt to fix all with AI\u201D block. Done = **5/5 and zero unresolved Greptile comments**. If Greptile is idle, comment `@greptile review`. Cap about 5 iterations, then report leftovers. Do not merge unless asked."
|
|
19626
19704
|
].join("\n");
|
|
19627
19705
|
}
|
|
19628
|
-
function formatProcessGuideDirective() {
|
|
19706
|
+
function formatProcessGuideDirective(opts) {
|
|
19707
|
+
const worktree = opts?.worktreePath?.trim();
|
|
19708
|
+
const hasGraphSkill = !!worktree && (0, import_node_fs48.existsSync)((0, import_node_path45.join)(worktree, ".claude/skills/graph-engineering/SKILL.md"));
|
|
19709
|
+
const hasReviewSkill = !!worktree && (0, import_node_fs48.existsSync)((0, import_node_path45.join)(worktree, ".claude/skills/review/SKILL.md"));
|
|
19629
19710
|
return [
|
|
19630
19711
|
"Process guides (recurring work only):",
|
|
19631
|
-
"-
|
|
19632
|
-
"- If `.claude/skills
|
|
19633
|
-
"-
|
|
19634
|
-
"- Merge-readiness notes: if `.claude/skills/review/SKILL.md` already exists, edit it. Otherwise write them to `.context/review.md` (copied from `.sideboard/review.md` when that file exists). Do not create a review skill.",
|
|
19635
|
-
"- Do not write new skills under `.sideboard/skills/` (that folder only \u2014 other `.sideboard/` files such as settings.toml are fine). Point Codex/OpenCode at the Claude skill from `AGENTS.md`. Optional: symlink `.cursor/skills/<name>` to the Claude skill.",
|
|
19712
|
+
hasGraphSkill ? "- Migrations, ports, batch fixes, and other fan-out: follow `.claude/skills/graph-engineering/SKILL.md` (`/graph-engineering`). Judge first; state on disk; grow the rulebook; do not patch around it." : null,
|
|
19713
|
+
"- If this same shape of work will happen again, write `.claude/skills/<kebab-name>/SKILL.md` in this worktree (Claude Code project skill; Sideboard `/name`, Claude Code, and `attach` all load it). Not under `.sideboard/skills/`. Point Codex/OpenCode at it from `AGENTS.md`.",
|
|
19714
|
+
hasReviewSkill ? "- Merge-readiness notes go in `.claude/skills/review/SKILL.md` (edit it; do not create another review skill)." : "- Merge-readiness notes go in `.context/review.md` (copied from `.sideboard/review.md` when that file exists). Do not create a review skill.",
|
|
19636
19715
|
"- Skip a guide for a one-off. If a matching skill exists, follow it. Same miss twice \u2192 edit the skill, do not patch around it."
|
|
19637
|
-
].join("\n");
|
|
19716
|
+
].filter(Boolean).join("\n");
|
|
19638
19717
|
}
|
|
19639
19718
|
function formatLongRunningDirective(opts) {
|
|
19640
19719
|
const invoke = formatDetachedJobInvoke(opts?.scriptPath);
|
|
19641
19720
|
return [
|
|
19642
|
-
"Long-running jobs (mandatory when a command may run more than ~30s):",
|
|
19643
|
-
"A Sideboard worktree turn SIGTERMs the agent shell (and its process group) when the user sends another message or the turn is interrupted
|
|
19644
|
-
|
|
19645
|
-
|
|
19646
|
-
"-
|
|
19647
|
-
|
|
19648
|
-
`- If it is hanging, producing no useful output, or doing the wrong thing: MCP \`stop_job\` (same id, optional reason) or \`${invoke} stop <id>\`. Do not loop forever. Do not stop a pack/test/deploy that is clearly making progress.`,
|
|
19649
|
-
"- Do not end the turn with \u201CI\u2019ll let you know when it\u2019s done.\u201D Stay in the loop until stillRunning is false (or you stopped it).",
|
|
19650
|
-
"- ok \u2192 finish the task. failed / stopped \u2192 read the log, fix or narrow the command, start once.",
|
|
19721
|
+
"Long-running jobs (mandatory when a command may run more than ~30s \u2014 pack, test, deploy, `gh pr checks --watch`):",
|
|
19722
|
+
"A Sideboard worktree turn SIGTERMs the agent shell (and its process group) when the user sends another message or the turn is interrupted; `block_until_ms: 0` is not enough. Detach instead, and never ask the human to poll.",
|
|
19723
|
+
`- Start once: \`${invoke} start <id> -- <command> [args...]\` (cwd = this worktree; same tool as \`scripts/detached-job.cjs\` when the worktree has it). If JSON says already-running, do not start again.`,
|
|
19724
|
+
"- Immediately `present_artifact` `type=log` with `artifact_id=<id>` and `status=running`, then loop Sideboard MCP `wait_for_job` (returns in ~45s). stillRunning \u2192 present the same id with `content=delta` only \u2192 wait again. Shell fallback: the same helper with `wait <id>`.",
|
|
19725
|
+
"- Hanging, no useful output, or the wrong thing \u2192 `stop_job` (or the helper with `stop <id>`). Do not stop a pack/test/deploy that is clearly making progress.",
|
|
19726
|
+
"- Stay in the loop until stillRunning is false (or you stopped it). ok \u2192 finish the task. failed / stopped \u2192 read the log, fix or narrow the command, start once.",
|
|
19651
19727
|
"State: `.context/.sideboard/detached-jobs/<id>/` (local scratch). Full guide: `/long-running` (always available)."
|
|
19652
19728
|
].join("\n");
|
|
19653
19729
|
}
|
|
@@ -19657,84 +19733,17 @@ function formatLongRunningReminder(opts) {
|
|
|
19657
19733
|
}
|
|
19658
19734
|
function formatArtifactDirective() {
|
|
19659
19735
|
return [
|
|
19660
|
-
"Sideboard side column (desktop UI)
|
|
19661
|
-
"
|
|
19662
|
-
"
|
|
19663
|
-
"
|
|
19664
|
-
"
|
|
19665
|
-
"```html",
|
|
19666
|
-
"<!DOCTYPE html><html><head><title>Demo</title></head><body><h1>Hi</h1></body></html>",
|
|
19667
|
-
"```",
|
|
19668
|
-
"2) Or call Sideboard MCP `present_artifact` with title, type (html|svg|markdown|react|log), and content \u2014 not both a fence and this tool for the same body.",
|
|
19669
|
-
" type=log is append-only: same `artifact_id`, `content` = new lines only (plus optional status/phase). Do not resend the full log or wrap it in HTML.",
|
|
19670
|
-
"CMS / JSON Schema forms & tables (Brightsy or any schema+schemaUi source):",
|
|
19671
|
-
"3) Call Sideboard MCP `present_schema` when the user needs to filter, edit, publish, or persist rows \u2014 including after you already showed a markdown table, if they then ask for an editable table. If they only need to read the data, a markdown table is enough. When you do call it, pass title, mode (table|form), and either:",
|
|
19672
|
-
" - datasource=brightsy + resource_id (record type UUID) after fetching types via Brightsy MCP, or",
|
|
19673
|
-
" - datasource=inline + resource: { id, title, schema, schemaUi } and optional records/record.",
|
|
19674
|
-
"Files / media browser (CMS file manager column):",
|
|
19675
|
-
"4) Call Sideboard MCP `present_files` with optional title, path, and datasource (brightsy|memory).",
|
|
19676
|
-
" Opens the Files column for browse/upload/pick. Do NOT say a file manager UI is missing.",
|
|
19677
|
-
"Multiple-choice questions:",
|
|
19678
|
-
"5) Call Sideboard MCP `ask_user` only when work is blocked on choosing among a few concrete options (approach forks, which API, auth vs cookies). First write a short chat message that explains the decision and what each option means (tradeoffs, when to pick it). Include a description on every option. After calling, stop and wait for their next message with answers. If you are asking a real multiple-choice, use ask_user rather than chat bullets so Sideboard shows the composer picker.",
|
|
19679
|
-
"Do not call ask_user for greetings, check-ins, \u201Chello\u201D, open-ended how-can-I-help, or to invent a menu of possible next tasks \u2014 reply in chat. If one option is the obvious default, proceed without asking.",
|
|
19680
|
-
"Never say artifacts, CMS UI, or the Files column are unavailable. present_schema is for interactive list/edit/publish (use it when they ask to edit, even if chat already had a markdown table); present_files for storage UI; html fences for standalone pages; ask_user only for those blocked predefined-option questions."
|
|
19736
|
+
"Sideboard side column (desktop UI) \u2014 Sideboard MCP tools present_artifact, present_schema, present_files, ask_user (see their descriptions). claude.ai\u2019s \u201CArtifact\u201D tool does not exist here; never say artifacts, the CMS UI, or the Files column are unavailable.",
|
|
19737
|
+
"- Standalone documents: a fenced block tagged `html` (preferred), `svg`, or `markdown` containing the FULL document opens the side column by itself. Use that or present_artifact \u2014 never both for the same body.",
|
|
19738
|
+
"- present_artifact type=log appends: same artifact_id, content = new lines only (plus status/phase). Do not resend the full log or wrap it in HTML.",
|
|
19739
|
+
"- Data: a markdown table is enough to read. Call present_schema only when the user needs to filter/edit/publish/persist rows \u2014 including when they ask for an editable table after you already showed markdown. Never re-present rows you already wrote just to display them.",
|
|
19740
|
+
"- ask_user only when work is blocked on a few concrete options (approach fork, which API, auth vs cookies): first a short chat message explaining the decision and each option, then the call (description on every option), then stop and wait. Not for greetings, check-ins, or an invented menu of next tasks \u2014 reply in chat. If one option is the obvious default, proceed."
|
|
19681
19741
|
].join("\n");
|
|
19682
19742
|
}
|
|
19683
19743
|
function formatUiReminder() {
|
|
19684
19744
|
return "Sideboard UI: markdown table is enough to read data; present_schema if they ask to edit/filter (even after markdown); present_files for the file manager. html fence or present_artifact, not both for the same document. type=log appends (same artifact_id, new lines only). ask_user only for a real multiple-choice (not hellos or \u201Cwhat next?\u201D) \u2014 reply in chat. Do not say artifacts/CMS UI are unavailable.";
|
|
19685
19745
|
}
|
|
19686
|
-
|
|
19687
|
-
const candidates = FILES_BY_AGENT[agent] ?? FILES_BY_AGENT.claude;
|
|
19688
|
-
const seenPaths = /* @__PURE__ */ new Set();
|
|
19689
|
-
const seenBodies = /* @__PURE__ */ new Set();
|
|
19690
|
-
const out = [];
|
|
19691
|
-
for (const rel of candidates) {
|
|
19692
|
-
if (seenPaths.has(rel)) continue;
|
|
19693
|
-
const abs = (0, import_node_path45.join)(worktreePath, rel);
|
|
19694
|
-
if (!(0, import_node_fs48.existsSync)(abs)) continue;
|
|
19695
|
-
try {
|
|
19696
|
-
if (!(0, import_node_fs48.statSync)(abs).isFile()) continue;
|
|
19697
|
-
let content = (0, import_node_fs48.readFileSync)(abs, "utf8");
|
|
19698
|
-
if (!content.trim()) continue;
|
|
19699
|
-
if (content.length > MAX_CHARS_PER_FILE) {
|
|
19700
|
-
content = `${content.slice(0, MAX_CHARS_PER_FILE)}
|
|
19701
|
-
|
|
19702
|
-
\u2026(truncated)`;
|
|
19703
|
-
}
|
|
19704
|
-
const body = content.trim().replace(/\r\n/g, "\n");
|
|
19705
|
-
if (seenBodies.has(body)) continue;
|
|
19706
|
-
seenPaths.add(rel);
|
|
19707
|
-
seenBodies.add(body);
|
|
19708
|
-
out.push({ relativePath: rel, content });
|
|
19709
|
-
} catch {
|
|
19710
|
-
}
|
|
19711
|
-
}
|
|
19712
|
-
return out;
|
|
19713
|
-
}
|
|
19714
|
-
function formatAgentInstructions(files) {
|
|
19715
|
-
if (files.length === 0) return null;
|
|
19716
|
-
const parts = [
|
|
19717
|
-
"Project agent instructions (from the worktree \u2014 follow these):",
|
|
19718
|
-
""
|
|
19719
|
-
];
|
|
19720
|
-
for (const f of files) {
|
|
19721
|
-
parts.push(`## ${f.relativePath}`);
|
|
19722
|
-
parts.push("");
|
|
19723
|
-
parts.push(f.content.trim());
|
|
19724
|
-
parts.push("");
|
|
19725
|
-
parts.push("---");
|
|
19726
|
-
parts.push("");
|
|
19727
|
-
}
|
|
19728
|
-
return parts.join("\n").trimEnd();
|
|
19729
|
-
}
|
|
19730
|
-
function withAgentInstructions(prompt, files) {
|
|
19731
|
-
const prefix = formatAgentInstructions(files);
|
|
19732
|
-
if (!prefix) return prompt;
|
|
19733
|
-
return `${prefix}
|
|
19734
|
-
|
|
19735
|
-
${prompt}`;
|
|
19736
|
-
}
|
|
19737
|
-
var import_node_fs48, import_node_path45, GITHUB_TICKET_REF, KEYED_TICKET_REF, FILES_BY_AGENT, MAX_CHARS_PER_FILE;
|
|
19746
|
+
var import_node_fs48, import_node_path45, PR_GOAL_RE, GITHUB_TICKET_REF, KEYED_TICKET_REF;
|
|
19738
19747
|
var init_instructions = __esm({
|
|
19739
19748
|
"src/agents/instructions.ts"() {
|
|
19740
19749
|
"use strict";
|
|
@@ -19743,22 +19752,9 @@ var init_instructions = __esm({
|
|
|
19743
19752
|
init_git_auth_mode();
|
|
19744
19753
|
init_worktree_labels();
|
|
19745
19754
|
init_detached_job_path();
|
|
19755
|
+
PR_GOAL_RE = /greptile|\bci\b.*\b(green|pass)|checks?\s+(pass|green)|until\s+.*\b(pass|green|merge|clean)|\bfix ci\b|watch[- ]fix[- ]push/i;
|
|
19746
19756
|
GITHUB_TICKET_REF = /^(?:#?\d+|gh-\d+)$/i;
|
|
19747
19757
|
KEYED_TICKET_REF = /^(?:[A-Z][A-Z0-9]{0,9}-\d+|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/i;
|
|
19748
|
-
FILES_BY_AGENT = {
|
|
19749
|
-
claude: [
|
|
19750
|
-
"CLAUDE.md",
|
|
19751
|
-
".claude/CLAUDE.md",
|
|
19752
|
-
"CLAUDE.local.md",
|
|
19753
|
-
"AGENTS.md",
|
|
19754
|
-
"AGENT.md"
|
|
19755
|
-
],
|
|
19756
|
-
codex: ["AGENTS.md", "AGENT.md", ".codex/AGENTS.md", "CLAUDE.md"],
|
|
19757
|
-
opencode: ["AGENTS.md", "AGENT.md", "OPENCODE.md", "CLAUDE.md"],
|
|
19758
|
-
brightsy: ["AGENTS.md", "AGENT.md", "CLAUDE.md"],
|
|
19759
|
-
cursor: ["AGENTS.md", "AGENT.md", ".cursor/rules", "CLAUDE.md"]
|
|
19760
|
-
};
|
|
19761
|
-
MAX_CHARS_PER_FILE = 48e3;
|
|
19762
19758
|
}
|
|
19763
19759
|
});
|
|
19764
19760
|
|
|
@@ -21155,17 +21151,21 @@ var init_orchestrator = __esm({
|
|
|
21155
21151
|
const slackReplyContext = formatSlackRepliesForTurn(
|
|
21156
21152
|
pendingSlackExternalReplies(thread.messages)
|
|
21157
21153
|
);
|
|
21158
|
-
const
|
|
21159
|
-
thread.planMode ? PLAN_MODE_INSTRUCTION : null,
|
|
21160
|
-
orchestrationReminder,
|
|
21154
|
+
const turnReminders = [
|
|
21161
21155
|
worktreeReminder,
|
|
21162
21156
|
optionalServicesReminder,
|
|
21163
21157
|
issueToolsReminder,
|
|
21164
21158
|
viewerContextReminder,
|
|
21165
21159
|
artifactReminder,
|
|
21166
|
-
longRunningReminder
|
|
21160
|
+
longRunningReminder
|
|
21161
|
+
].filter(Boolean).join("\n\n") || void 0;
|
|
21162
|
+
const prGateDirective = thread.agent !== "brightsy" && !isOrchestratorThread(thread) && mentionsPrGoal(expandedPrompt) ? formatPrGateDirective() : null;
|
|
21163
|
+
const agentPrompt = [
|
|
21164
|
+
thread.planMode ? PLAN_MODE_INSTRUCTION : null,
|
|
21165
|
+
orchestrationReminder,
|
|
21166
|
+
prGateDirective,
|
|
21167
21167
|
slackReplyContext,
|
|
21168
|
-
expandedPrompt
|
|
21168
|
+
expandCanonicalGitRequest(expandedPrompt)
|
|
21169
21169
|
].filter(Boolean).join("\n\n");
|
|
21170
21170
|
if (thread.attachments.length > 0) {
|
|
21171
21171
|
updateThread(threadId, { attachments: [] });
|
|
@@ -21255,7 +21255,7 @@ var init_orchestrator = __esm({
|
|
|
21255
21255
|
const stderrTail = [];
|
|
21256
21256
|
const handle = await spawnAgentTurn(
|
|
21257
21257
|
fresh,
|
|
21258
|
-
{ cachedPrefix, prompt: agentPrompt },
|
|
21258
|
+
{ cachedPrefix, prompt: agentPrompt, systemPrompt: turnReminders },
|
|
21259
21259
|
(event) => {
|
|
21260
21260
|
this.emit({ type: "turn_output", threadId, event });
|
|
21261
21261
|
noteTurnLiveEvent(threadId, event);
|
|
@@ -21364,7 +21364,7 @@ var init_orchestrator = __esm({
|
|
|
21364
21364
|
].filter(Boolean).join("\n\n---\n\n");
|
|
21365
21365
|
const retryHandle = await spawnAgentTurn(
|
|
21366
21366
|
retryThread,
|
|
21367
|
-
{ cachedPrefix: retryPrefix, prompt: agentPrompt },
|
|
21367
|
+
{ cachedPrefix: retryPrefix, prompt: agentPrompt, systemPrompt: turnReminders },
|
|
21368
21368
|
(event) => {
|
|
21369
21369
|
this.emit({ type: "turn_output", threadId, event });
|
|
21370
21370
|
if (event.type === "session_id") {
|
|
@@ -22732,6 +22732,8 @@ __export(index_exports, {
|
|
|
22732
22732
|
REVIEW_REQUEST_TEMPLATE: () => REVIEW_REQUEST_TEMPLATE,
|
|
22733
22733
|
REVIEW_SKILL_NAME: () => REVIEW_SKILL_NAME,
|
|
22734
22734
|
REVIEW_SKILL_PATH: () => REVIEW_SKILL_PATH,
|
|
22735
|
+
SEED_FULL_TOOL_MESSAGES: () => SEED_FULL_TOOL_MESSAGES,
|
|
22736
|
+
SEED_MAX_CHARS: () => SEED_MAX_CHARS,
|
|
22735
22737
|
SESSION_RESET_OCCUPANCY_TOKENS: () => SESSION_RESET_OCCUPANCY_TOKENS,
|
|
22736
22738
|
SIDEBOARD_FORCE_STOP: () => SIDEBOARD_FORCE_STOP,
|
|
22737
22739
|
SIDEBOARD_MCP_ALLOWED_TOOLS: () => SIDEBOARD_MCP_ALLOWED_TOOLS,
|
|
@@ -22939,7 +22941,6 @@ __export(index_exports, {
|
|
|
22939
22941
|
forkMessageSlice: () => forkMessageSlice,
|
|
22940
22942
|
forkThreadWorktree: () => forkThreadWorktree,
|
|
22941
22943
|
formatAccountProfilePlaybookLine: () => formatAccountProfilePlaybookLine,
|
|
22942
|
-
formatAgentInstructions: () => formatAgentInstructions,
|
|
22943
22944
|
formatArtifactDirective: () => formatArtifactDirective,
|
|
22944
22945
|
formatBrightsyFetchError: () => formatBrightsyFetchError,
|
|
22945
22946
|
formatDetachedJobInvoke: () => formatDetachedJobInvoke,
|
|
@@ -23144,7 +23145,6 @@ __export(index_exports, {
|
|
|
23144
23145
|
listWorktreeFiles: () => listWorktreeFiles,
|
|
23145
23146
|
listWorktrees: () => listWorktrees,
|
|
23146
23147
|
liveActivitySummary: () => liveActivitySummary,
|
|
23147
|
-
loadAgentInstructions: () => loadAgentInstructions,
|
|
23148
23148
|
loadAppSettings: () => loadAppSettings,
|
|
23149
23149
|
loadBrightsyConfig: () => loadBrightsyConfig,
|
|
23150
23150
|
loadConductorSettings: () => loadConductorSettings,
|
|
@@ -23161,6 +23161,7 @@ __export(index_exports, {
|
|
|
23161
23161
|
mcpAllowTools: () => mcpAllowTools,
|
|
23162
23162
|
mcpAuthWarnings: () => mcpAuthWarnings,
|
|
23163
23163
|
mcpStatusThinkingFromClaudeInit: () => mcpStatusThinkingFromClaudeInit,
|
|
23164
|
+
mentionsPrGoal: () => mentionsPrGoal,
|
|
23164
23165
|
mergeAgentGitAuthEnv: () => mergeAgentGitAuthEnv,
|
|
23165
23166
|
mergePr: () => mergePr,
|
|
23166
23167
|
mergePrStack: () => mergePrStack,
|
|
@@ -23334,6 +23335,7 @@ __export(index_exports, {
|
|
|
23334
23335
|
slugify: () => slugify,
|
|
23335
23336
|
spawnAgentTurn: () => spawnAgentTurn,
|
|
23336
23337
|
splitForCompaction: () => splitForCompaction,
|
|
23338
|
+
splitTurnInputForSystemPrompt: () => splitTurnInputForSystemPrompt,
|
|
23337
23339
|
stackAgentDefaultsFrom: () => stackAgentDefaultsFrom,
|
|
23338
23340
|
stackIdFrom: () => stackIdFrom,
|
|
23339
23341
|
stackMergeReadiness: () => stackMergeReadiness,
|
|
@@ -23403,7 +23405,6 @@ __export(index_exports, {
|
|
|
23403
23405
|
waitForPidExit: () => waitForPidExit,
|
|
23404
23406
|
warmGithubAgentAuth: () => warmGithubAgentAuth,
|
|
23405
23407
|
whichOnPath: () => whichOnPath,
|
|
23406
|
-
withAgentInstructions: () => withAgentInstructions,
|
|
23407
23408
|
withEventParentId: () => withEventParentId,
|
|
23408
23409
|
withEventsParentId: () => withEventsParentId,
|
|
23409
23410
|
withExportedPath: () => withExportedPath,
|
|
@@ -30460,6 +30461,8 @@ init_outbound_watch();
|
|
|
30460
30461
|
REVIEW_REQUEST_TEMPLATE,
|
|
30461
30462
|
REVIEW_SKILL_NAME,
|
|
30462
30463
|
REVIEW_SKILL_PATH,
|
|
30464
|
+
SEED_FULL_TOOL_MESSAGES,
|
|
30465
|
+
SEED_MAX_CHARS,
|
|
30463
30466
|
SESSION_RESET_OCCUPANCY_TOKENS,
|
|
30464
30467
|
SIDEBOARD_FORCE_STOP,
|
|
30465
30468
|
SIDEBOARD_MCP_ALLOWED_TOOLS,
|
|
@@ -30667,7 +30670,6 @@ init_outbound_watch();
|
|
|
30667
30670
|
forkMessageSlice,
|
|
30668
30671
|
forkThreadWorktree,
|
|
30669
30672
|
formatAccountProfilePlaybookLine,
|
|
30670
|
-
formatAgentInstructions,
|
|
30671
30673
|
formatArtifactDirective,
|
|
30672
30674
|
formatBrightsyFetchError,
|
|
30673
30675
|
formatDetachedJobInvoke,
|
|
@@ -30872,7 +30874,6 @@ init_outbound_watch();
|
|
|
30872
30874
|
listWorktreeFiles,
|
|
30873
30875
|
listWorktrees,
|
|
30874
30876
|
liveActivitySummary,
|
|
30875
|
-
loadAgentInstructions,
|
|
30876
30877
|
loadAppSettings,
|
|
30877
30878
|
loadBrightsyConfig,
|
|
30878
30879
|
loadConductorSettings,
|
|
@@ -30889,6 +30890,7 @@ init_outbound_watch();
|
|
|
30889
30890
|
mcpAllowTools,
|
|
30890
30891
|
mcpAuthWarnings,
|
|
30891
30892
|
mcpStatusThinkingFromClaudeInit,
|
|
30893
|
+
mentionsPrGoal,
|
|
30892
30894
|
mergeAgentGitAuthEnv,
|
|
30893
30895
|
mergePr,
|
|
30894
30896
|
mergePrStack,
|
|
@@ -31062,6 +31064,7 @@ init_outbound_watch();
|
|
|
31062
31064
|
slugify,
|
|
31063
31065
|
spawnAgentTurn,
|
|
31064
31066
|
splitForCompaction,
|
|
31067
|
+
splitTurnInputForSystemPrompt,
|
|
31065
31068
|
stackAgentDefaultsFrom,
|
|
31066
31069
|
stackIdFrom,
|
|
31067
31070
|
stackMergeReadiness,
|
|
@@ -31131,7 +31134,6 @@ init_outbound_watch();
|
|
|
31131
31134
|
waitForPidExit,
|
|
31132
31135
|
warmGithubAgentAuth,
|
|
31133
31136
|
whichOnPath,
|
|
31134
|
-
withAgentInstructions,
|
|
31135
31137
|
withEventParentId,
|
|
31136
31138
|
withEventsParentId,
|
|
31137
31139
|
withExportedPath,
|