@sideboard-ai/core 0.1.331 → 0.1.332
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-5FB756FF.js} +8 -8
- package/dist/{agents-JH4WV2ZH.js → agents-XEVZ6RY2.js} +7 -7
- package/dist/{chunk-NQHTYX35.js → chunk-25KXB7W6.js} +1 -1
- package/dist/{chunk-DFKLWWLY.js → chunk-3MOUHIA2.js} +6 -6
- package/dist/{chunk-PZ5MVD27.js → chunk-5G5DTQ5N.js} +5 -5
- package/dist/{chunk-O7JSWISN.js → chunk-5MJ7FCZ2.js} +1 -1
- package/dist/{chunk-DBRQ5NNB.js → chunk-6HGTYZGL.js} +5 -5
- package/dist/{chunk-QKHEVSB5.js → chunk-BMRJNRQK.js} +1 -1
- package/dist/{chunk-JQWCZGSO.js → chunk-CS6LQUL6.js} +110 -11
- package/dist/{chunk-OOSAMSTE.js → chunk-E5DFGOAA.js} +15 -15
- package/dist/{chunk-KUD24QYI.js → chunk-EHZ24J7U.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-QHKNPN55.js → chunk-KYHW5WYT.js} +17 -17
- package/dist/{chunk-U7EANR52.js → chunk-P7S3XGKL.js} +2 -2
- 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-YBTSZ2SW.js → chunk-TL2HK6LZ.js} +2 -0
- package/dist/{chunk-G45SGI57.js → chunk-UEPTL7UG.js} +1 -1
- package/dist/{chunk-NURZOXGN.js → chunk-UGUWFONI.js} +1 -1
- package/dist/{chunk-3DJQLQWU.js → chunk-UV33UCV6.js} +3 -3
- package/dist/{chunk-S5CJUIPY.js → chunk-XOEKCE6L.js} +5 -5
- package/dist/{conductor-FA27ZGCV.js → conductor-5OTVFON5.js} +5 -5
- package/dist/{conductor-6DIR7A4N.js → conductor-CVQJEAKE.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-OD6VYETQ.js} +4 -4
- package/dist/{coordinator-prompt-KAZXK5FZ.js → coordinator-prompt-XU5KFYI5.js} +4 -4
- package/dist/{global-workspace-JKINHUY3.js → global-workspace-EW54B2P4.js} +4 -4
- package/dist/{global-workspace-IOKHZCXD.js → global-workspace-P2BW6MJ3.js} +4 -4
- package/dist/index.cjs +274 -166
- package/dist/index.js +15 -15
- package/dist/mcp/run-stdio.cjs +186 -147
- package/dist/mcp/run-stdio.js +10 -10
- 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-5X62LJ2T.js} +11 -11
- package/dist/{orchestrator-L44O3JPD.js → orchestrator-UKAXA5ZW.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-OLONQF2C.js → workspaces-CB4SCKVH.js} +4 -4
- package/dist/{workspaces-FJL3TL3K.js → workspaces-OY7JIPDE.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
package/dist/index.cjs
CHANGED
|
@@ -9394,6 +9394,8 @@ var init_path = __esm({
|
|
|
9394
9394
|
import_node_path21 = require("path");
|
|
9395
9395
|
EXTRA_BIN_DIRS = [
|
|
9396
9396
|
".local/bin",
|
|
9397
|
+
// Official OpenCode installer (`curl https://opencode.ai/install | bash`).
|
|
9398
|
+
".opencode/bin",
|
|
9397
9399
|
".cargo/bin",
|
|
9398
9400
|
".nvm/current/bin",
|
|
9399
9401
|
".asdf/shims",
|
|
@@ -21659,6 +21661,83 @@ var init_claude_usage_client = __esm({
|
|
|
21659
21661
|
}
|
|
21660
21662
|
});
|
|
21661
21663
|
|
|
21664
|
+
// src/agents/install-native.ts
|
|
21665
|
+
async function installCurlScript(opts) {
|
|
21666
|
+
const result = await run("bash", ["-c", opts.command], {
|
|
21667
|
+
reject: false,
|
|
21668
|
+
timeoutMs: 3e5
|
|
21669
|
+
});
|
|
21670
|
+
if (result.exitCode === 0) {
|
|
21671
|
+
const binPath = await whichOnPath(opts.bin);
|
|
21672
|
+
if (binPath) {
|
|
21673
|
+
return {
|
|
21674
|
+
ok: true,
|
|
21675
|
+
command: opts.command,
|
|
21676
|
+
exitCode: 0,
|
|
21677
|
+
stdout: result.stdout,
|
|
21678
|
+
stderr: result.stderr,
|
|
21679
|
+
message: `Installed ${opts.label} \u2192 ${binPath}`
|
|
21680
|
+
};
|
|
21681
|
+
}
|
|
21682
|
+
return {
|
|
21683
|
+
ok: false,
|
|
21684
|
+
command: opts.command,
|
|
21685
|
+
exitCode: result.exitCode,
|
|
21686
|
+
stdout: result.stdout,
|
|
21687
|
+
stderr: result.stderr,
|
|
21688
|
+
message: `${opts.label} installer finished, but \`${opts.bin}\` is not on PATH. Expected ${opts.expected}.`
|
|
21689
|
+
};
|
|
21690
|
+
}
|
|
21691
|
+
const detail = result.stderr.trim() || result.stdout.trim();
|
|
21692
|
+
try {
|
|
21693
|
+
await openInSystemTerminal(opts.command);
|
|
21694
|
+
return {
|
|
21695
|
+
ok: false,
|
|
21696
|
+
openedTerminal: true,
|
|
21697
|
+
command: opts.command,
|
|
21698
|
+
exitCode: result.exitCode,
|
|
21699
|
+
stdout: result.stdout,
|
|
21700
|
+
stderr: result.stderr,
|
|
21701
|
+
message: `${opts.label} install failed (exit ${result.exitCode}). Opened Terminal with: ${opts.command}`
|
|
21702
|
+
};
|
|
21703
|
+
} catch {
|
|
21704
|
+
return {
|
|
21705
|
+
ok: false,
|
|
21706
|
+
command: opts.command,
|
|
21707
|
+
exitCode: result.exitCode,
|
|
21708
|
+
stdout: result.stdout,
|
|
21709
|
+
stderr: result.stderr,
|
|
21710
|
+
message: detail ? `${opts.label} install failed (exit ${result.exitCode}). ${detail}` : `${opts.label} install failed (exit ${result.exitCode})`
|
|
21711
|
+
};
|
|
21712
|
+
}
|
|
21713
|
+
}
|
|
21714
|
+
function installClaudeNative() {
|
|
21715
|
+
return installCurlScript({
|
|
21716
|
+
command: CLAUDE_NATIVE_INSTALL,
|
|
21717
|
+
bin: "claude",
|
|
21718
|
+
label: "Claude Code",
|
|
21719
|
+
expected: "~/.local/bin/claude"
|
|
21720
|
+
});
|
|
21721
|
+
}
|
|
21722
|
+
function installOpenCodeNative() {
|
|
21723
|
+
return installCurlScript({
|
|
21724
|
+
command: OPENCODE_NATIVE_INSTALL,
|
|
21725
|
+
bin: "opencode",
|
|
21726
|
+
label: "OpenCode",
|
|
21727
|
+
expected: "~/.opencode/bin/opencode"
|
|
21728
|
+
});
|
|
21729
|
+
}
|
|
21730
|
+
var CLAUDE_NATIVE_INSTALL, OPENCODE_NATIVE_INSTALL;
|
|
21731
|
+
var init_install_native = __esm({
|
|
21732
|
+
"src/agents/install-native.ts"() {
|
|
21733
|
+
"use strict";
|
|
21734
|
+
init_run();
|
|
21735
|
+
init_install();
|
|
21736
|
+
CLAUDE_NATIVE_INSTALL = "curl -fsSL https://claude.ai/install.sh | bash";
|
|
21737
|
+
OPENCODE_NATIVE_INSTALL = "curl -fsSL https://opencode.ai/install | bash";
|
|
21738
|
+
}
|
|
21739
|
+
});
|
|
21740
|
+
|
|
21662
21741
|
// src/agents/install.ts
|
|
21663
21742
|
function getAgentSetupInfo(agent) {
|
|
21664
21743
|
return SETUP[agent];
|
|
@@ -21763,7 +21842,17 @@ async function installNpmGlobalPackage(opts) {
|
|
|
21763
21842
|
}
|
|
21764
21843
|
}
|
|
21765
21844
|
enrichPathWithNpmGlobalBin();
|
|
21766
|
-
const binPath = opts.cliBin ? await
|
|
21845
|
+
const binPath = opts.cliBin ? await resolveCliAfterNpmInstall(opts.cliBin) : null;
|
|
21846
|
+
if (opts.cliBin && !binPath) {
|
|
21847
|
+
return {
|
|
21848
|
+
ok: false,
|
|
21849
|
+
command: opts.installCommand,
|
|
21850
|
+
exitCode: 0,
|
|
21851
|
+
stdout: result.stdout,
|
|
21852
|
+
stderr: result.stderr,
|
|
21853
|
+
message: `Installed ${opts.npmPackage}, but \`${opts.cliBin}\` is not on PATH.`
|
|
21854
|
+
};
|
|
21855
|
+
}
|
|
21767
21856
|
return {
|
|
21768
21857
|
ok: true,
|
|
21769
21858
|
command: opts.installCommand,
|
|
@@ -21771,9 +21860,25 @@ async function installNpmGlobalPackage(opts) {
|
|
|
21771
21860
|
stdout: result.stdout,
|
|
21772
21861
|
stderr: result.stderr,
|
|
21773
21862
|
// Library-only packages (`@cursor/sdk`) have no CLI to look for.
|
|
21774
|
-
message: !opts.cliBin ? `Installed ${opts.npmPackage}` :
|
|
21863
|
+
message: !opts.cliBin ? `Installed ${opts.npmPackage}` : `Installed ${opts.npmPackage} \u2192 ${binPath}`
|
|
21775
21864
|
};
|
|
21776
21865
|
}
|
|
21866
|
+
async function resolveCliAfterNpmInstall(cliBin) {
|
|
21867
|
+
const found = await whichOnPath(cliBin);
|
|
21868
|
+
if (found) return found;
|
|
21869
|
+
const prefix = await run("npm", ["prefix", "-g"], { reject: false, timeoutMs: 8e3 });
|
|
21870
|
+
if (prefix.exitCode !== 0) return null;
|
|
21871
|
+
const root = prefix.stdout.split(/\r?\n/).map((line) => line.trim()).filter((line) => line.startsWith("/")).pop();
|
|
21872
|
+
if (!root) return null;
|
|
21873
|
+
const candidate = (0, import_node_path51.join)(root, "bin", cliBin);
|
|
21874
|
+
if (!(0, import_node_fs49.existsSync)(candidate)) return null;
|
|
21875
|
+
try {
|
|
21876
|
+
(0, import_node_fs49.chmodSync)(candidate, 493);
|
|
21877
|
+
} catch {
|
|
21878
|
+
}
|
|
21879
|
+
enrichPathWithNpmGlobalBin();
|
|
21880
|
+
return whichOnPath(cliBin);
|
|
21881
|
+
}
|
|
21777
21882
|
async function resolveExistingCli(agent) {
|
|
21778
21883
|
if (agent === "cursor") return null;
|
|
21779
21884
|
const exe = resolveAgentExecutable(agent);
|
|
@@ -21816,6 +21921,8 @@ async function installAgent(agent) {
|
|
|
21816
21921
|
if (existing && info.updateArgs?.length) {
|
|
21817
21922
|
return runVendorUpdate(existing, info.updateArgs);
|
|
21818
21923
|
}
|
|
21924
|
+
if (agent === "claude") return installClaudeNative();
|
|
21925
|
+
if (agent === "opencode") return installOpenCodeNative();
|
|
21819
21926
|
if (info.npmPackage && !isCurlInstaller(info.installCommand)) {
|
|
21820
21927
|
const cliBin = agent === "cursor" ? null : CLI_BIN[agent];
|
|
21821
21928
|
return installNpmGlobalPackage({
|
|
@@ -21871,23 +21978,24 @@ async function loginManagedAccount(accountId) {
|
|
|
21871
21978
|
message: `Opened Terminal to run: ${prefixed}`
|
|
21872
21979
|
};
|
|
21873
21980
|
}
|
|
21874
|
-
var import_node_fs49, SETUP, CLI_BIN, CLI_LOGIN_AGENTS;
|
|
21981
|
+
var import_node_fs49, import_node_path51, SETUP, CLI_BIN, CLI_LOGIN_AGENTS;
|
|
21875
21982
|
var init_install = __esm({
|
|
21876
21983
|
"src/agents/install.ts"() {
|
|
21877
21984
|
"use strict";
|
|
21878
21985
|
import_node_fs49 = require("fs");
|
|
21986
|
+
import_node_path51 = require("path");
|
|
21879
21987
|
init_run();
|
|
21880
21988
|
init_app_settings();
|
|
21989
|
+
init_install_native();
|
|
21881
21990
|
init_path();
|
|
21882
21991
|
SETUP = {
|
|
21883
21992
|
claude: {
|
|
21884
21993
|
agent: "claude",
|
|
21885
21994
|
kind: "cli",
|
|
21886
|
-
summary: "Install
|
|
21995
|
+
summary: "Install Claude Code, then complete login in a terminal.",
|
|
21887
21996
|
docsUrl: "https://code.claude.com/docs/en/install",
|
|
21888
|
-
installCommand:
|
|
21997
|
+
installCommand: CLAUDE_NATIVE_INSTALL,
|
|
21889
21998
|
loginCommand: "claude auth login",
|
|
21890
|
-
npmPackage: "@anthropic-ai/claude-code",
|
|
21891
21999
|
updateArgs: ["update"]
|
|
21892
22000
|
},
|
|
21893
22001
|
codex: {
|
|
@@ -21903,12 +22011,12 @@ var init_install = __esm({
|
|
|
21903
22011
|
opencode: {
|
|
21904
22012
|
agent: "opencode",
|
|
21905
22013
|
kind: "cli",
|
|
21906
|
-
summary: "Install OpenCode
|
|
22014
|
+
summary: "Install OpenCode, then authenticate providers.",
|
|
21907
22015
|
docsUrl: "https://opencode.ai/docs",
|
|
21908
|
-
//
|
|
21909
|
-
|
|
22016
|
+
// npm package `opencode-ai` ships the same kind of non-executable native stub
|
|
22017
|
+
// as Claude. The curl installer writes ~/.opencode/bin/opencode.
|
|
22018
|
+
installCommand: OPENCODE_NATIVE_INSTALL,
|
|
21910
22019
|
loginCommand: "opencode auth login",
|
|
21911
|
-
npmPackage: "opencode-ai@latest",
|
|
21912
22020
|
updateArgs: ["upgrade"]
|
|
21913
22021
|
},
|
|
21914
22022
|
cursor: {
|
|
@@ -22116,7 +22224,7 @@ function isAgentHostEnvKey(key) {
|
|
|
22116
22224
|
}
|
|
22117
22225
|
function stripHostToolingPath(pathValue) {
|
|
22118
22226
|
if (!pathValue?.trim()) return "";
|
|
22119
|
-
return pathValue.split(
|
|
22227
|
+
return pathValue.split(import_node_path52.delimiter).filter((part) => part && !HOST_PATH_NOISE.test(part.replace(/\\/g, "/"))).join(import_node_path52.delimiter);
|
|
22120
22228
|
}
|
|
22121
22229
|
function sanitizeAgentHostEnv(env, cwd) {
|
|
22122
22230
|
for (const key of Object.keys(env)) {
|
|
@@ -22130,11 +22238,11 @@ function sanitizeAgentHostEnv(env, cwd) {
|
|
|
22130
22238
|
}
|
|
22131
22239
|
return env;
|
|
22132
22240
|
}
|
|
22133
|
-
var
|
|
22241
|
+
var import_node_path52, DROP_EXACT, DROP_PREFIXES, HOST_PATH_NOISE;
|
|
22134
22242
|
var init_agent_host_env = __esm({
|
|
22135
22243
|
"src/hook/agent-host-env.ts"() {
|
|
22136
22244
|
"use strict";
|
|
22137
|
-
|
|
22245
|
+
import_node_path52 = require("path");
|
|
22138
22246
|
DROP_EXACT = /* @__PURE__ */ new Set([
|
|
22139
22247
|
"NODE_PATH",
|
|
22140
22248
|
"NODE_ENV_ELECTRON_VITE",
|
|
@@ -22173,15 +22281,15 @@ var init_agent_host_env = __esm({
|
|
|
22173
22281
|
|
|
22174
22282
|
// src/hook/worktree-pkg-cache.ts
|
|
22175
22283
|
function worktreePkgCacheRoot(worktreePath) {
|
|
22176
|
-
return (0,
|
|
22284
|
+
return (0, import_node_path53.join)(worktreePath, WORKTREE_PKG_CACHE_REL);
|
|
22177
22285
|
}
|
|
22178
22286
|
function worktreePkgCacheEnv(worktreePath) {
|
|
22179
22287
|
const root = worktreePkgCacheRoot(worktreePath);
|
|
22180
|
-
const store = (0,
|
|
22181
|
-
const pnpmCache = (0,
|
|
22182
|
-
const npmCache = (0,
|
|
22183
|
-
const nodeGyp = (0,
|
|
22184
|
-
const electron = (0,
|
|
22288
|
+
const store = (0, import_node_path53.join)(root, "pnpm-store");
|
|
22289
|
+
const pnpmCache = (0, import_node_path53.join)(root, "pnpm");
|
|
22290
|
+
const npmCache = (0, import_node_path53.join)(root, "npm");
|
|
22291
|
+
const nodeGyp = (0, import_node_path53.join)(root, "node-gyp");
|
|
22292
|
+
const electron = (0, import_node_path53.join)(root, "electron");
|
|
22185
22293
|
return {
|
|
22186
22294
|
npm_config_store_dir: store,
|
|
22187
22295
|
PNPM_STORE_DIR: store,
|
|
@@ -22217,12 +22325,12 @@ function applyWorktreePkgCacheEnv(env, worktreePath) {
|
|
|
22217
22325
|
fillGroup(env, ["electron_config_cache"], next);
|
|
22218
22326
|
ensureWorktreePkgCacheDirs(cwd);
|
|
22219
22327
|
}
|
|
22220
|
-
var import_node_fs50,
|
|
22328
|
+
var import_node_fs50, import_node_path53, WORKTREE_PKG_CACHE_REL;
|
|
22221
22329
|
var init_worktree_pkg_cache = __esm({
|
|
22222
22330
|
"src/hook/worktree-pkg-cache.ts"() {
|
|
22223
22331
|
"use strict";
|
|
22224
22332
|
import_node_fs50 = require("fs");
|
|
22225
|
-
|
|
22333
|
+
import_node_path53 = require("path");
|
|
22226
22334
|
WORKTREE_PKG_CACHE_REL = ".context/.sideboard/pkg-cache";
|
|
22227
22335
|
}
|
|
22228
22336
|
});
|
|
@@ -23709,12 +23817,12 @@ function readTextIfPresent(abs) {
|
|
|
23709
23817
|
}
|
|
23710
23818
|
}
|
|
23711
23819
|
function readLocalGuidelines(worktreePath) {
|
|
23712
|
-
const localAbs = (0,
|
|
23820
|
+
const localAbs = (0, import_node_path54.join)(worktreePath, REVIEW_REQUEST_PATH);
|
|
23713
23821
|
const localContent = readTextIfPresent(localAbs);
|
|
23714
23822
|
if (localContent && !shouldRefreshReviewRequestTemplate(localContent)) {
|
|
23715
23823
|
return { path: REVIEW_REQUEST_PATH, content: localContent };
|
|
23716
23824
|
}
|
|
23717
|
-
const legacyAbs = (0,
|
|
23825
|
+
const legacyAbs = (0, import_node_path54.join)(worktreePath, LEGACY_REVIEW_REQUEST_PATH);
|
|
23718
23826
|
const legacyContent = readTextIfPresent(legacyAbs);
|
|
23719
23827
|
if (legacyContent && !shouldRefreshReviewRequestTemplate(legacyContent)) {
|
|
23720
23828
|
return { path: LEGACY_REVIEW_REQUEST_PATH, content: legacyContent };
|
|
@@ -23738,27 +23846,27 @@ function contextGuidelines(content, source) {
|
|
|
23738
23846
|
};
|
|
23739
23847
|
}
|
|
23740
23848
|
function writeContextGuidelines(worktreePath, content) {
|
|
23741
|
-
const abs = (0,
|
|
23742
|
-
(0, import_node_fs52.mkdirSync)((0,
|
|
23849
|
+
const abs = (0, import_node_path54.join)(worktreePath, CONTEXT_REVIEW_PATH);
|
|
23850
|
+
(0, import_node_fs52.mkdirSync)((0, import_node_path54.dirname)(abs), { recursive: true });
|
|
23743
23851
|
const body = content.endsWith("\n") ? content : `${content}
|
|
23744
23852
|
`;
|
|
23745
23853
|
(0, import_node_fs52.writeFileSync)(abs, body, "utf8");
|
|
23746
23854
|
return body;
|
|
23747
23855
|
}
|
|
23748
23856
|
function readSideboardReview(worktreePath, repoPath) {
|
|
23749
|
-
const fromWorktree = readTextIfPresent((0,
|
|
23857
|
+
const fromWorktree = readTextIfPresent((0, import_node_path54.join)(worktreePath, REPO_REVIEW_PATH));
|
|
23750
23858
|
if (fromWorktree) return fromWorktree;
|
|
23751
23859
|
const repo = repoPath?.replace(/\/+$/, "");
|
|
23752
23860
|
const wt = worktreePath.replace(/\/+$/, "");
|
|
23753
23861
|
if (!repo || repo === wt) return null;
|
|
23754
|
-
return readTextIfPresent((0,
|
|
23862
|
+
return readTextIfPresent((0, import_node_path54.join)(repo, REPO_REVIEW_PATH));
|
|
23755
23863
|
}
|
|
23756
23864
|
function ensureReviewGuidelinesFile(worktreePath, repoPath) {
|
|
23757
|
-
const skillContent = readTextIfPresent((0,
|
|
23865
|
+
const skillContent = readTextIfPresent((0, import_node_path54.join)(worktreePath, REVIEW_SKILL_PATH));
|
|
23758
23866
|
if (skillContent) {
|
|
23759
23867
|
return { ...skillGuidelines(skillContent, "skill"), wrote: false };
|
|
23760
23868
|
}
|
|
23761
|
-
const contextContent = readTextIfPresent((0,
|
|
23869
|
+
const contextContent = readTextIfPresent((0, import_node_path54.join)(worktreePath, CONTEXT_REVIEW_PATH));
|
|
23762
23870
|
if (contextContent && !shouldRefreshReviewRequestTemplate(contextContent)) {
|
|
23763
23871
|
return { ...contextGuidelines(contextContent, "local"), wrote: false };
|
|
23764
23872
|
}
|
|
@@ -23796,7 +23904,7 @@ function buildReviewRequestAttachment(content, opts) {
|
|
|
23796
23904
|
};
|
|
23797
23905
|
}
|
|
23798
23906
|
function readExistingReviewRequestFile(worktreePath) {
|
|
23799
|
-
return readTextIfPresent((0,
|
|
23907
|
+
return readTextIfPresent((0, import_node_path54.join)(worktreePath, REVIEW_SKILL_PATH)) ?? readTextIfPresent((0, import_node_path54.join)(worktreePath, CONTEXT_REVIEW_PATH)) ?? readTextIfPresent((0, import_node_path54.join)(worktreePath, REPO_REVIEW_PATH)) ?? readTextIfPresent((0, import_node_path54.join)(worktreePath, REVIEW_REQUEST_PATH)) ?? readTextIfPresent((0, import_node_path54.join)(worktreePath, LEGACY_REVIEW_REQUEST_PATH));
|
|
23800
23908
|
}
|
|
23801
23909
|
function canReuseIdleWorktreeAgentForReview(from, siblings) {
|
|
23802
23910
|
const live = siblings.filter((t) => t.status !== "archived");
|
|
@@ -23844,13 +23952,13 @@ async function requestReview(threadRef, send3) {
|
|
|
23844
23952
|
const started = await send3(tab.id, REVIEW_REQUEST_PREFILL);
|
|
23845
23953
|
return { tab: started, from };
|
|
23846
23954
|
}
|
|
23847
|
-
var import_node_crypto16, import_node_fs52,
|
|
23955
|
+
var import_node_crypto16, import_node_fs52, import_node_path54, REPO_REVIEW_PATH, REPO_REVIEW_NAME, CONTEXT_REVIEW_PATH, REVIEW_REQUEST_PATH, LEGACY_REVIEW_REQUEST_PATH, REVIEW_REQUEST_NAME, REVIEW_REQUEST_PREFILL, LEGACY_REVIEW_TEMPLATE_MARKERS;
|
|
23848
23956
|
var init_request_review = __esm({
|
|
23849
23957
|
"src/review/request-review.ts"() {
|
|
23850
23958
|
"use strict";
|
|
23851
23959
|
import_node_crypto16 = require("crypto");
|
|
23852
23960
|
import_node_fs52 = require("fs");
|
|
23853
|
-
|
|
23961
|
+
import_node_path54 = require("path");
|
|
23854
23962
|
init_global_workspace();
|
|
23855
23963
|
init_chat_tabs();
|
|
23856
23964
|
init_thread_store();
|
|
@@ -23873,7 +23981,7 @@ var init_request_review = __esm({
|
|
|
23873
23981
|
|
|
23874
23982
|
// src/hook/worktree-run-ports.ts
|
|
23875
23983
|
function worktreeRunPortsPath(worktreePath) {
|
|
23876
|
-
return (0,
|
|
23984
|
+
return (0, import_node_path55.join)(worktreePath, RUN_PORTS_REL);
|
|
23877
23985
|
}
|
|
23878
23986
|
function isPort(value) {
|
|
23879
23987
|
return typeof value === "number" && Number.isInteger(value) && value > 0 && value <= 65535;
|
|
@@ -23931,16 +24039,16 @@ function saveWorktreeRunPorts(worktreePath, scriptName, ports) {
|
|
|
23931
24039
|
}
|
|
23932
24040
|
const scripts = { ...current.scripts ?? {} };
|
|
23933
24041
|
scripts[scriptName] = cleaned;
|
|
23934
|
-
(0, import_node_fs53.mkdirSync)((0,
|
|
24042
|
+
(0, import_node_fs53.mkdirSync)((0, import_node_path55.dirname)(path2), { recursive: true });
|
|
23935
24043
|
(0, import_node_fs53.writeFileSync)(path2, `${JSON.stringify({ scripts }, null, 2)}
|
|
23936
24044
|
`, "utf8");
|
|
23937
24045
|
}
|
|
23938
|
-
var import_node_fs53,
|
|
24046
|
+
var import_node_fs53, import_node_path55, RUN_PORTS_REL;
|
|
23939
24047
|
var init_worktree_run_ports = __esm({
|
|
23940
24048
|
"src/hook/worktree-run-ports.ts"() {
|
|
23941
24049
|
"use strict";
|
|
23942
24050
|
import_node_fs53 = require("fs");
|
|
23943
|
-
|
|
24051
|
+
import_node_path55 = require("path");
|
|
23944
24052
|
RUN_PORTS_REL = ".context/.sideboard/run-ports.json";
|
|
23945
24053
|
}
|
|
23946
24054
|
});
|
|
@@ -23992,7 +24100,7 @@ function readIntFile(file) {
|
|
|
23992
24100
|
return Number.isInteger(n) ? n : null;
|
|
23993
24101
|
}
|
|
23994
24102
|
function jobDir(root, id, legacy = false) {
|
|
23995
|
-
return (0,
|
|
24103
|
+
return (0, import_node_path56.join)(root, legacy ? LEGACY_DETACHED_JOBS_DIR : DETACHED_JOBS_DIR, id);
|
|
23996
24104
|
}
|
|
23997
24105
|
function resolveJobDir(root, id) {
|
|
23998
24106
|
const modern = jobDir(root, id, false);
|
|
@@ -24002,7 +24110,7 @@ function resolveJobDir(root, id) {
|
|
|
24002
24110
|
return modern;
|
|
24003
24111
|
}
|
|
24004
24112
|
function listJobIdsIn(root, rel) {
|
|
24005
|
-
const dir = (0,
|
|
24113
|
+
const dir = (0, import_node_path56.join)(root, rel);
|
|
24006
24114
|
if (!(0, import_node_fs54.existsSync)(dir)) return [];
|
|
24007
24115
|
return (0, import_node_fs54.readdirSync)(dir, { withFileTypes: true }).filter((e) => e.isDirectory() && JOB_ID_RE.test(e.name)).map((e) => e.name);
|
|
24008
24116
|
}
|
|
@@ -24016,7 +24124,7 @@ function listRunningDetachedJobs(worktreePath) {
|
|
|
24016
24124
|
const running2 = [];
|
|
24017
24125
|
for (const id of ids) {
|
|
24018
24126
|
const dir = resolveJobDir(root, id);
|
|
24019
|
-
const pid = readIntFile((0,
|
|
24127
|
+
const pid = readIntFile((0, import_node_path56.join)(dir, "pid"));
|
|
24020
24128
|
if (jobTreeAlive(pid)) running2.push(id);
|
|
24021
24129
|
}
|
|
24022
24130
|
return running2.sort();
|
|
@@ -24123,15 +24231,15 @@ function takeDelta(logFile, cursorFile) {
|
|
|
24123
24231
|
return { delta: capJobLogDelta(lines.slice(start).join("\n")), nextCursor: lines.length };
|
|
24124
24232
|
}
|
|
24125
24233
|
function snapshotJob(dir) {
|
|
24126
|
-
const pid = readIntFile((0,
|
|
24234
|
+
const pid = readIntFile((0, import_node_path56.join)(dir, "pid"));
|
|
24127
24235
|
const running2 = jobTreeAlive(pid);
|
|
24128
24236
|
return {
|
|
24129
24237
|
pid,
|
|
24130
24238
|
running: running2,
|
|
24131
|
-
exitCode: readIntFile((0,
|
|
24132
|
-
log: (0,
|
|
24133
|
-
cursor: (0,
|
|
24134
|
-
progress: tailProgress((0,
|
|
24239
|
+
exitCode: readIntFile((0, import_node_path56.join)(dir, "exit")),
|
|
24240
|
+
log: (0, import_node_path56.join)(dir, "log"),
|
|
24241
|
+
cursor: (0, import_node_path56.join)(dir, "present.cursor"),
|
|
24242
|
+
progress: tailProgress((0, import_node_path56.join)(dir, "log"))
|
|
24135
24243
|
};
|
|
24136
24244
|
}
|
|
24137
24245
|
function toResult(id, snap, extra) {
|
|
@@ -24140,7 +24248,7 @@ function toResult(id, snap, extra) {
|
|
|
24140
24248
|
const stillRunning = snap.running && !ok;
|
|
24141
24249
|
const { delta, nextCursor } = takeDelta(snap.log, snap.cursor);
|
|
24142
24250
|
try {
|
|
24143
|
-
(0, import_node_fs54.mkdirSync)((0,
|
|
24251
|
+
(0, import_node_fs54.mkdirSync)((0, import_node_path56.dirname)(snap.cursor), { recursive: true });
|
|
24144
24252
|
(0, import_node_fs54.writeFileSync)(snap.cursor, `${nextCursor}
|
|
24145
24253
|
`);
|
|
24146
24254
|
} catch {
|
|
@@ -24216,7 +24324,7 @@ function killProcessTree(pid, signal) {
|
|
|
24216
24324
|
}
|
|
24217
24325
|
function appendJobLog(logFile, line) {
|
|
24218
24326
|
try {
|
|
24219
|
-
(0, import_node_fs54.mkdirSync)((0,
|
|
24327
|
+
(0, import_node_fs54.mkdirSync)((0, import_node_path56.dirname)(logFile), { recursive: true });
|
|
24220
24328
|
const body = line.endsWith("\n") ? line : `${line}
|
|
24221
24329
|
`;
|
|
24222
24330
|
(0, import_node_fs54.appendFileSync)(logFile, body);
|
|
@@ -24265,7 +24373,7 @@ async function stopDetachedJob(cwd, id, opts) {
|
|
|
24265
24373
|
killProcessTree(targetPid, "SIGKILL");
|
|
24266
24374
|
await sleep3(100);
|
|
24267
24375
|
}
|
|
24268
|
-
const exitFile = (0,
|
|
24376
|
+
const exitFile = (0, import_node_path56.join)(dir, "exit");
|
|
24269
24377
|
if (!(0, import_node_fs54.existsSync)(exitFile)) {
|
|
24270
24378
|
try {
|
|
24271
24379
|
(0, import_node_fs54.writeFileSync)(exitFile, "1\n");
|
|
@@ -24288,12 +24396,12 @@ async function stopDetachedJob(cwd, id, opts) {
|
|
|
24288
24396
|
hint: stopped ? MCP_STOP_JOB_HINT : MCP_WAIT_JOB_STILL_RUNNING_HINT
|
|
24289
24397
|
};
|
|
24290
24398
|
}
|
|
24291
|
-
var import_node_fs54,
|
|
24399
|
+
var import_node_fs54, import_node_path56, MAX_JOB_CONTINUES, MAX_JOB_DELTA_LINES, MAX_JOB_DELTA_CHARS, DEFERRED_DONE_MAX_CHARS, GH_WATCH_REFRESH, MCP_WAIT_JOB_STILL_RUNNING_HINT, MCP_STOP_JOB_HINT, JOB_ID_RE;
|
|
24292
24400
|
var init_wait_for_job = __esm({
|
|
24293
24401
|
"src/mcp/wait-for-job.ts"() {
|
|
24294
24402
|
"use strict";
|
|
24295
24403
|
import_node_fs54 = require("fs");
|
|
24296
|
-
|
|
24404
|
+
import_node_path56 = require("path");
|
|
24297
24405
|
init_workspace_scratch();
|
|
24298
24406
|
init_job_process();
|
|
24299
24407
|
init_wait_for_turn();
|
|
@@ -24569,7 +24677,7 @@ function matchSimpleGlob(pattern, name) {
|
|
|
24569
24677
|
return new RegExp(`^${escaped}$`).test(name);
|
|
24570
24678
|
}
|
|
24571
24679
|
function readWorktreeInclude(repoPath) {
|
|
24572
|
-
const path2 = (0,
|
|
24680
|
+
const path2 = (0, import_node_path57.join)(repoPath, ".worktreeinclude");
|
|
24573
24681
|
if (!(0, import_node_fs55.existsSync)(path2)) return [];
|
|
24574
24682
|
return (0, import_node_fs55.readFileSync)(path2, "utf8").split("\n").map((l) => l.trim()).filter((l) => l && !l.startsWith("#"));
|
|
24575
24683
|
}
|
|
@@ -24584,7 +24692,7 @@ function resolveFilesToCopy(repoPath) {
|
|
|
24584
24692
|
for (const entry of (0, import_node_fs55.readdirSync)(repoPath, { withFileTypes: true })) {
|
|
24585
24693
|
if (!entry.isFile()) continue;
|
|
24586
24694
|
for (const glob of settings.fileIncludeGlobs) {
|
|
24587
|
-
if (matchSimpleGlob(glob, entry.name) || matchSimpleGlob((0,
|
|
24695
|
+
if (matchSimpleGlob(glob, entry.name) || matchSimpleGlob((0, import_node_path57.basename)(glob), entry.name)) {
|
|
24588
24696
|
matched.push(entry.name);
|
|
24589
24697
|
break;
|
|
24590
24698
|
}
|
|
@@ -24610,10 +24718,10 @@ function copyConfiguredFiles(repoPath, worktreePath) {
|
|
|
24610
24718
|
const patterns = resolveFilesToCopy(repoPath);
|
|
24611
24719
|
const copied = [];
|
|
24612
24720
|
for (const rel of patterns) {
|
|
24613
|
-
const src = (0,
|
|
24721
|
+
const src = (0, import_node_path57.join)(repoPath, rel);
|
|
24614
24722
|
if (!(0, import_node_fs55.existsSync)(src)) continue;
|
|
24615
|
-
const dest = (0,
|
|
24616
|
-
(0, import_node_fs55.mkdirSync)((0,
|
|
24723
|
+
const dest = (0, import_node_path57.join)(worktreePath, rel);
|
|
24724
|
+
(0, import_node_fs55.mkdirSync)((0, import_node_path57.dirname)(dest), { recursive: true });
|
|
24617
24725
|
(0, import_node_fs55.copyFileSync)(src, dest);
|
|
24618
24726
|
copied.push(rel);
|
|
24619
24727
|
}
|
|
@@ -24627,7 +24735,7 @@ function linkSharedDirectories(repoPath, worktreePath) {
|
|
|
24627
24735
|
for (const rel of dirs) {
|
|
24628
24736
|
if (!isSafeRelativeDir(rel)) continue;
|
|
24629
24737
|
if (!isGitignored(repoPath, rel)) continue;
|
|
24630
|
-
const src = (0,
|
|
24738
|
+
const src = (0, import_node_path57.join)(repoPath, rel);
|
|
24631
24739
|
let srcStat;
|
|
24632
24740
|
try {
|
|
24633
24741
|
srcStat = (0, import_node_fs55.lstatSync)(src);
|
|
@@ -24635,9 +24743,9 @@ function linkSharedDirectories(repoPath, worktreePath) {
|
|
|
24635
24743
|
continue;
|
|
24636
24744
|
}
|
|
24637
24745
|
if (!srcStat.isDirectory()) continue;
|
|
24638
|
-
const dest = (0,
|
|
24746
|
+
const dest = (0, import_node_path57.join)(worktreePath, rel);
|
|
24639
24747
|
if ((0, import_node_fs55.existsSync)(dest)) continue;
|
|
24640
|
-
(0, import_node_fs55.mkdirSync)((0,
|
|
24748
|
+
(0, import_node_fs55.mkdirSync)((0, import_node_path57.dirname)(dest), { recursive: true });
|
|
24641
24749
|
try {
|
|
24642
24750
|
(0, import_node_fs55.symlinkSync)(src, dest);
|
|
24643
24751
|
} catch {
|
|
@@ -24651,11 +24759,11 @@ function samePath(a, b) {
|
|
|
24651
24759
|
try {
|
|
24652
24760
|
return (0, import_node_fs55.realpathSync)(a) === (0, import_node_fs55.realpathSync)(b);
|
|
24653
24761
|
} catch {
|
|
24654
|
-
return (0,
|
|
24762
|
+
return (0, import_node_path57.resolve)(a) === (0, import_node_path57.resolve)(b);
|
|
24655
24763
|
}
|
|
24656
24764
|
}
|
|
24657
24765
|
function isSafeRelativeDir(rel) {
|
|
24658
|
-
if (!rel || (0,
|
|
24766
|
+
if (!rel || (0, import_node_path57.isAbsolute)(rel)) return false;
|
|
24659
24767
|
const parts = rel.split(/[\\/]/).filter(Boolean);
|
|
24660
24768
|
return parts.length > 0 && parts.every((part) => part !== "." && part !== "..");
|
|
24661
24769
|
}
|
|
@@ -24697,7 +24805,7 @@ function buildWorkspaceScriptEnv(opts, baseEnv) {
|
|
|
24697
24805
|
const env = stripNestedElectronEnv({
|
|
24698
24806
|
...baseEnv ?? process.env
|
|
24699
24807
|
});
|
|
24700
|
-
const name = opts.workspaceName ?? (0,
|
|
24808
|
+
const name = opts.workspaceName ?? (0, import_node_path57.basename)(opts.worktreePath);
|
|
24701
24809
|
const ports = opts.ports ?? [];
|
|
24702
24810
|
const primary = ports[0];
|
|
24703
24811
|
env.SIDEBOARD_WORKSPACE_NAME = name;
|
|
@@ -24768,18 +24876,18 @@ function realpathOrResolve(path2) {
|
|
|
24768
24876
|
try {
|
|
24769
24877
|
return (0, import_node_fs55.realpathSync)(path2);
|
|
24770
24878
|
} catch {
|
|
24771
|
-
return (0,
|
|
24879
|
+
return (0, import_node_path57.resolve)(path2);
|
|
24772
24880
|
}
|
|
24773
24881
|
}
|
|
24774
24882
|
function isOtherWorktreeListenerCwd(cwd, worktreePath) {
|
|
24775
24883
|
const wt = realpathOrResolve(worktreePath);
|
|
24776
24884
|
const c = realpathOrResolve(cwd);
|
|
24777
|
-
if (c === wt || c.startsWith(wt +
|
|
24778
|
-
const parent = (0,
|
|
24779
|
-
const thisName = (0,
|
|
24885
|
+
if (c === wt || c.startsWith(wt + import_node_path57.sep)) return false;
|
|
24886
|
+
const parent = (0, import_node_path57.dirname)(wt);
|
|
24887
|
+
const thisName = (0, import_node_path57.basename)(wt);
|
|
24780
24888
|
if (!thisName || c === parent) return false;
|
|
24781
|
-
if (!c.startsWith(parent +
|
|
24782
|
-
const first = c.slice(parent.length + 1).split(
|
|
24889
|
+
if (!c.startsWith(parent + import_node_path57.sep)) return false;
|
|
24890
|
+
const first = c.slice(parent.length + 1).split(import_node_path57.sep)[0];
|
|
24783
24891
|
return Boolean(first) && first !== thisName;
|
|
24784
24892
|
}
|
|
24785
24893
|
function signalPid(pid, signal) {
|
|
@@ -24791,7 +24899,7 @@ function signalPid(pid, signal) {
|
|
|
24791
24899
|
function isThisWorktreeListenerCwd(cwd, worktreePath) {
|
|
24792
24900
|
const wt = realpathOrResolve(worktreePath);
|
|
24793
24901
|
const c = realpathOrResolve(cwd);
|
|
24794
|
-
return c === wt || c.startsWith(wt +
|
|
24902
|
+
return c === wt || c.startsWith(wt + import_node_path57.sep);
|
|
24795
24903
|
}
|
|
24796
24904
|
function killDetachedRunTree(pid, worktreePath) {
|
|
24797
24905
|
if (!Number.isFinite(pid) || pid <= 1 || pid === process.pid) return;
|
|
@@ -25043,13 +25151,13 @@ async function startDevServer(repoPath, worktreePath, onLine, opts) {
|
|
|
25043
25151
|
throw err;
|
|
25044
25152
|
}
|
|
25045
25153
|
}
|
|
25046
|
-
var import_node_fs55, import_node_child_process6,
|
|
25154
|
+
var import_node_fs55, import_node_child_process6, import_node_path57, import_execa4, import_node_readline3, cachedLoginEnv;
|
|
25047
25155
|
var init_conductor = __esm({
|
|
25048
25156
|
"src/hook/conductor.ts"() {
|
|
25049
25157
|
"use strict";
|
|
25050
25158
|
import_node_fs55 = require("fs");
|
|
25051
25159
|
import_node_child_process6 = require("child_process");
|
|
25052
|
-
|
|
25160
|
+
import_node_path57 = require("path");
|
|
25053
25161
|
import_execa4 = require("execa");
|
|
25054
25162
|
import_node_readline3 = require("readline");
|
|
25055
25163
|
init_settings();
|
|
@@ -25116,9 +25224,9 @@ async function findOrphanWorktrees(repoPaths) {
|
|
|
25116
25224
|
if ((0, import_node_fs56.existsSync)(root)) {
|
|
25117
25225
|
for (const entry of (0, import_node_fs56.readdirSync)(root, { withFileTypes: true })) {
|
|
25118
25226
|
if (!entry.isDirectory()) continue;
|
|
25119
|
-
const path2 = (0,
|
|
25227
|
+
const path2 = (0, import_node_path58.join)(root, entry.name).replace(/\/$/, "");
|
|
25120
25228
|
if (known.has(path2) || seen.has(path2)) continue;
|
|
25121
|
-
if (!(0, import_node_fs56.existsSync)((0,
|
|
25229
|
+
if (!(0, import_node_fs56.existsSync)((0, import_node_path58.join)(path2, ".git"))) continue;
|
|
25122
25230
|
seen.add(path2);
|
|
25123
25231
|
let mtimeMs = 0;
|
|
25124
25232
|
try {
|
|
@@ -25183,12 +25291,12 @@ function worktreeCleanupSettings() {
|
|
|
25183
25291
|
autoCleanupOrphans: a.autoCleanupOrphans
|
|
25184
25292
|
};
|
|
25185
25293
|
}
|
|
25186
|
-
var import_node_fs56,
|
|
25294
|
+
var import_node_fs56, import_node_path58;
|
|
25187
25295
|
var init_orphan_cleanup = __esm({
|
|
25188
25296
|
"src/git/orphan-cleanup.ts"() {
|
|
25189
25297
|
"use strict";
|
|
25190
25298
|
import_node_fs56 = require("fs");
|
|
25191
|
-
|
|
25299
|
+
import_node_path58 = require("path");
|
|
25192
25300
|
init_worktree();
|
|
25193
25301
|
init_thread_store();
|
|
25194
25302
|
init_paths();
|
|
@@ -25364,11 +25472,11 @@ async function cloneRepoIntoSideboard(opts) {
|
|
|
25364
25472
|
if (!url) throw new Error("Clone URL is required");
|
|
25365
25473
|
let name = opts.name?.trim();
|
|
25366
25474
|
if (!name) {
|
|
25367
|
-
const leaf = (0,
|
|
25475
|
+
const leaf = (0, import_node_path59.basename)(url.replace(/\/$/, "").replace(/\.git$/, ""));
|
|
25368
25476
|
name = leaf || "repo";
|
|
25369
25477
|
}
|
|
25370
25478
|
name = name.replace(/[^a-zA-Z0-9._-]+/g, "-").replace(/^-+|-+$/g, "") || "repo";
|
|
25371
|
-
const dest = (0,
|
|
25479
|
+
const dest = (0, import_node_path59.join)(sideboardReposDir(), name);
|
|
25372
25480
|
if ((0, import_node_fs57.existsSync)(dest)) {
|
|
25373
25481
|
const repoPath2 = await resolveRepoRoot(dest);
|
|
25374
25482
|
const workspace2 = await addWorkspace(repoPath2);
|
|
@@ -25384,12 +25492,12 @@ async function cloneRepoIntoSideboard(opts) {
|
|
|
25384
25492
|
const workspace = await addWorkspace(repoPath);
|
|
25385
25493
|
return { repoPath, workspace };
|
|
25386
25494
|
}
|
|
25387
|
-
var import_node_fs57,
|
|
25495
|
+
var import_node_fs57, import_node_path59, import_execa6;
|
|
25388
25496
|
var init_clone_repo = __esm({
|
|
25389
25497
|
"src/git/clone-repo.ts"() {
|
|
25390
25498
|
"use strict";
|
|
25391
25499
|
import_node_fs57 = require("fs");
|
|
25392
|
-
|
|
25500
|
+
import_node_path59 = require("path");
|
|
25393
25501
|
import_execa6 = require("execa");
|
|
25394
25502
|
init_paths();
|
|
25395
25503
|
init_workspaces();
|
|
@@ -28153,7 +28261,7 @@ function stampOf(thread) {
|
|
|
28153
28261
|
function repoLabel(thread) {
|
|
28154
28262
|
if (isOrchestratorThread(thread)) return "Orchestration";
|
|
28155
28263
|
const path2 = thread.repoPath?.trim() ?? "";
|
|
28156
|
-
return path2 && (0,
|
|
28264
|
+
return path2 && (0, import_node_path60.basename)(path2) || path2 || "project";
|
|
28157
28265
|
}
|
|
28158
28266
|
function toAgent(thread, flags) {
|
|
28159
28267
|
const prUrl = thread.prUrl?.trim();
|
|
@@ -28352,11 +28460,11 @@ function formatFleetArchive(view) {
|
|
|
28352
28460
|
}
|
|
28353
28461
|
return lines.join("\n");
|
|
28354
28462
|
}
|
|
28355
|
-
var
|
|
28463
|
+
var import_node_path60, DEFAULT_LIMIT, MAX_LIMIT;
|
|
28356
28464
|
var init_fleet_archive = __esm({
|
|
28357
28465
|
"src/archive/fleet-archive.ts"() {
|
|
28358
28466
|
"use strict";
|
|
28359
|
-
|
|
28467
|
+
import_node_path60 = require("path");
|
|
28360
28468
|
init_global_workspace();
|
|
28361
28469
|
init_worktree_labels();
|
|
28362
28470
|
DEFAULT_LIMIT = 40;
|
|
@@ -28856,7 +28964,7 @@ var init_quota_failover = __esm({
|
|
|
28856
28964
|
// src/threads/adopt.ts
|
|
28857
28965
|
function thisModuleFile2() {
|
|
28858
28966
|
const cjsFile = typeof __filename !== "undefined" ? __filename : "";
|
|
28859
|
-
return cjsFile || process.argv[1] || (0,
|
|
28967
|
+
return cjsFile || process.argv[1] || (0, import_node_path61.join)(process.cwd(), "package.json");
|
|
28860
28968
|
}
|
|
28861
28969
|
function openReadonlySqlite(file) {
|
|
28862
28970
|
const req = (0, import_node_module6.createRequire)(thisModuleFile2());
|
|
@@ -28884,7 +28992,7 @@ function resolveConductorCursorAgentId(workspacePath) {
|
|
|
28884
28992
|
return null;
|
|
28885
28993
|
}
|
|
28886
28994
|
for (const hash of hashes) {
|
|
28887
|
-
const agentsFile = (0,
|
|
28995
|
+
const agentsFile = (0, import_node_path61.join)(CURSOR_SDK_STORE, hash, "agents.ndjson");
|
|
28888
28996
|
if (!(0, import_node_fs60.existsSync)(agentsFile)) continue;
|
|
28889
28997
|
let text7;
|
|
28890
28998
|
try {
|
|
@@ -28944,8 +29052,8 @@ function listConductorWorkspaces() {
|
|
|
28944
29052
|
if (!(0, import_node_fs60.existsSync)(CONDUCTOR_DB)) {
|
|
28945
29053
|
throw new Error(`Conductor DB not found at ${CONDUCTOR_DB}`);
|
|
28946
29054
|
}
|
|
28947
|
-
const tmp = (0, import_node_fs60.mkdtempSync)((0,
|
|
28948
|
-
const snapshot = (0,
|
|
29055
|
+
const tmp = (0, import_node_fs60.mkdtempSync)((0, import_node_path61.join)((0, import_node_os19.tmpdir)(), "sideboard-conductor-"));
|
|
29056
|
+
const snapshot = (0, import_node_path61.join)(tmp, "conductor.db");
|
|
28949
29057
|
try {
|
|
28950
29058
|
(0, import_node_fs60.copyFileSync)(CONDUCTOR_DB, snapshot);
|
|
28951
29059
|
for (const suffix of ["-wal", "-shm"]) {
|
|
@@ -29035,8 +29143,8 @@ function importConductorWorkspace(workspaceId) {
|
|
|
29035
29143
|
if (!(0, import_node_fs60.existsSync)(CONDUCTOR_DB)) {
|
|
29036
29144
|
throw new Error(`Conductor DB not found at ${CONDUCTOR_DB}`);
|
|
29037
29145
|
}
|
|
29038
|
-
const tmp = (0, import_node_fs60.mkdtempSync)((0,
|
|
29039
|
-
const snapshot = (0,
|
|
29146
|
+
const tmp = (0, import_node_fs60.mkdtempSync)((0, import_node_path61.join)((0, import_node_os19.tmpdir)(), "sideboard-conductor-"));
|
|
29147
|
+
const snapshot = (0, import_node_path61.join)(tmp, "conductor.db");
|
|
29040
29148
|
try {
|
|
29041
29149
|
(0, import_node_fs60.copyFileSync)(CONDUCTOR_DB, snapshot);
|
|
29042
29150
|
for (const suffix of ["-wal", "-shm"]) {
|
|
@@ -29130,25 +29238,25 @@ function importConductorWorkspace(workspaceId) {
|
|
|
29130
29238
|
async function importConductorWorkspaceAsync(workspaceId) {
|
|
29131
29239
|
return importConductorWorkspace(workspaceId);
|
|
29132
29240
|
}
|
|
29133
|
-
var import_node_child_process7, import_node_fs60, import_node_os19,
|
|
29241
|
+
var import_node_child_process7, import_node_fs60, import_node_os19, import_node_path61, import_node_module6, CONDUCTOR_APP_SUPPORT, CONDUCTOR_DB, CURSOR_SDK_STORE;
|
|
29134
29242
|
var init_adopt = __esm({
|
|
29135
29243
|
"src/threads/adopt.ts"() {
|
|
29136
29244
|
"use strict";
|
|
29137
29245
|
import_node_child_process7 = require("child_process");
|
|
29138
29246
|
import_node_fs60 = require("fs");
|
|
29139
29247
|
import_node_os19 = require("os");
|
|
29140
|
-
|
|
29248
|
+
import_node_path61 = require("path");
|
|
29141
29249
|
import_node_module6 = require("module");
|
|
29142
29250
|
init_worktree();
|
|
29143
29251
|
init_thread_store();
|
|
29144
|
-
CONDUCTOR_APP_SUPPORT = (0,
|
|
29252
|
+
CONDUCTOR_APP_SUPPORT = (0, import_node_path61.join)(
|
|
29145
29253
|
process.env.HOME ?? "",
|
|
29146
29254
|
"Library",
|
|
29147
29255
|
"Application Support",
|
|
29148
29256
|
"com.conductor.app"
|
|
29149
29257
|
);
|
|
29150
|
-
CONDUCTOR_DB = (0,
|
|
29151
|
-
CURSOR_SDK_STORE = (0,
|
|
29258
|
+
CONDUCTOR_DB = (0, import_node_path61.join)(CONDUCTOR_APP_SUPPORT, "conductor.db");
|
|
29259
|
+
CURSOR_SDK_STORE = (0, import_node_path61.join)(CONDUCTOR_APP_SUPPORT, "cursor-sdk-store");
|
|
29152
29260
|
}
|
|
29153
29261
|
});
|
|
29154
29262
|
|
|
@@ -29488,7 +29596,7 @@ async function formatPrCreateFailure(raw, cwd, ctx) {
|
|
|
29488
29596
|
}
|
|
29489
29597
|
async function createCursorPullRequest(worktreePath, slug, opts) {
|
|
29490
29598
|
const bodyText = (opts.body ?? opts.title).trim() || opts.title;
|
|
29491
|
-
const bodyFile = (0,
|
|
29599
|
+
const bodyFile = (0, import_node_path62.join)(
|
|
29492
29600
|
(0, import_node_os20.tmpdir)(),
|
|
29493
29601
|
`sideboard-pr-body-${process.pid}-${(0, import_node_crypto20.randomBytes)(6).toString("hex")}.md`
|
|
29494
29602
|
);
|
|
@@ -29530,7 +29638,7 @@ async function createOrUpdatePr(worktreePath, opts) {
|
|
|
29530
29638
|
const headRef = ghHeadRef(slug, opts.head);
|
|
29531
29639
|
const branchOnly = opts.head.trim().replace(/^refs\/heads\//, "");
|
|
29532
29640
|
const bodyText = clampGithubPrBody(opts.body ?? opts.title);
|
|
29533
|
-
const bodyFile = (0,
|
|
29641
|
+
const bodyFile = (0, import_node_path62.join)(
|
|
29534
29642
|
(0, import_node_os20.tmpdir)(),
|
|
29535
29643
|
`sideboard-pr-body-${process.pid}-${(0, import_node_crypto20.randomBytes)(6).toString("hex")}.md`
|
|
29536
29644
|
);
|
|
@@ -29623,14 +29731,14 @@ async function createOrUpdatePrWithBodyFile(worktreePath, opts) {
|
|
|
29623
29731
|
const url = created.stdout.trim().split("\n").find((l) => l.startsWith("http")) ?? created.stdout.trim();
|
|
29624
29732
|
return url;
|
|
29625
29733
|
}
|
|
29626
|
-
var import_node_crypto20, import_node_fs62, import_node_os20,
|
|
29734
|
+
var import_node_crypto20, import_node_fs62, import_node_os20, import_node_path62;
|
|
29627
29735
|
var init_pr_write = __esm({
|
|
29628
29736
|
"src/git/pr-write.ts"() {
|
|
29629
29737
|
"use strict";
|
|
29630
29738
|
import_node_crypto20 = require("crypto");
|
|
29631
29739
|
import_node_fs62 = require("fs");
|
|
29632
29740
|
import_node_os20 = require("os");
|
|
29633
|
-
|
|
29741
|
+
import_node_path62 = require("path");
|
|
29634
29742
|
init_gh_errors();
|
|
29635
29743
|
init_run();
|
|
29636
29744
|
init_cursor_pr();
|
|
@@ -29782,7 +29890,7 @@ new file mode 100644
|
|
|
29782
29890
|
};
|
|
29783
29891
|
}
|
|
29784
29892
|
async function untrackedPatch(worktreePath, path2, maxHunk) {
|
|
29785
|
-
const abs = (0,
|
|
29893
|
+
const abs = (0, import_node_path63.join)(worktreePath, path2);
|
|
29786
29894
|
try {
|
|
29787
29895
|
const st = (0, import_node_fs63.statSync)(abs);
|
|
29788
29896
|
if (st.isFile() && st.size > maxHunk) {
|
|
@@ -30253,7 +30361,7 @@ async function getDiff(worktreePath, repoPath, opts) {
|
|
|
30253
30361
|
}
|
|
30254
30362
|
function statWorktreePath(worktreePath, relativePath) {
|
|
30255
30363
|
assertSafeRelativePath(relativePath);
|
|
30256
|
-
const abs = (0,
|
|
30364
|
+
const abs = (0, import_node_path63.join)(worktreePath, relativePath);
|
|
30257
30365
|
if (!(0, import_node_fs63.existsSync)(abs)) return "missing";
|
|
30258
30366
|
const st = (0, import_node_fs63.statSync)(abs);
|
|
30259
30367
|
if (st.isDirectory()) return "dir";
|
|
@@ -30284,7 +30392,7 @@ function isImageRelativePath(relativePath) {
|
|
|
30284
30392
|
function readWorktreeFileForUpload(worktreePath, relativePath, opts) {
|
|
30285
30393
|
assertSafeRelativePath(relativePath);
|
|
30286
30394
|
const maxBytes = opts?.maxBytes ?? DEFAULT_UPLOAD_MAX_BYTES;
|
|
30287
|
-
const abs = (0,
|
|
30395
|
+
const abs = (0, import_node_path63.join)(worktreePath, relativePath);
|
|
30288
30396
|
const st = (0, import_node_fs63.statSync)(abs);
|
|
30289
30397
|
if (!st.isFile()) {
|
|
30290
30398
|
throw new Error(`Not a file: ${relativePath}`);
|
|
@@ -30304,7 +30412,7 @@ function readWorktreeFileForUpload(worktreePath, relativePath, opts) {
|
|
|
30304
30412
|
function readWorktreeFile(worktreePath, relativePath, opts) {
|
|
30305
30413
|
assertSafeRelativePath(relativePath);
|
|
30306
30414
|
const maxBytes = opts?.maxBytes ?? 2e5;
|
|
30307
|
-
const abs = (0,
|
|
30415
|
+
const abs = (0, import_node_path63.join)(worktreePath, relativePath);
|
|
30308
30416
|
const st = (0, import_node_fs63.statSync)(abs);
|
|
30309
30417
|
if (!st.isFile()) {
|
|
30310
30418
|
throw new Error(`Not a file: ${relativePath}`);
|
|
@@ -30352,8 +30460,8 @@ function assertSafeRelativePath(relativePath) {
|
|
|
30352
30460
|
}
|
|
30353
30461
|
function writeWorktreeFile(worktreePath, relativePath, content) {
|
|
30354
30462
|
assertSafeRelativePath(relativePath);
|
|
30355
|
-
const abs = (0,
|
|
30356
|
-
(0, import_node_fs63.mkdirSync)((0,
|
|
30463
|
+
const abs = (0, import_node_path63.join)(worktreePath, relativePath);
|
|
30464
|
+
(0, import_node_fs63.mkdirSync)((0, import_node_path63.dirname)(abs), { recursive: true });
|
|
30357
30465
|
(0, import_node_fs63.writeFileSync)(abs, content, "utf8");
|
|
30358
30466
|
return { path: relativePath };
|
|
30359
30467
|
}
|
|
@@ -30394,12 +30502,12 @@ async function getDiffSummary(worktreePath, repoPath, opts) {
|
|
|
30394
30502
|
truncated: full.files.length > maxFiles
|
|
30395
30503
|
};
|
|
30396
30504
|
}
|
|
30397
|
-
var import_node_fs63,
|
|
30505
|
+
var import_node_fs63, import_node_path63, mergeBaseCache, MERGE_BASE_TTL_MS, SHA_RE, IMAGE_EXTENSIONS2, DEFAULT_UPLOAD_MAX_BYTES;
|
|
30398
30506
|
var init_diff = __esm({
|
|
30399
30507
|
"src/diff/diff.ts"() {
|
|
30400
30508
|
"use strict";
|
|
30401
30509
|
import_node_fs63 = require("fs");
|
|
30402
|
-
|
|
30510
|
+
import_node_path63 = require("path");
|
|
30403
30511
|
init_run();
|
|
30404
30512
|
init_worktree();
|
|
30405
30513
|
mergeBaseCache = /* @__PURE__ */ new Map();
|
|
@@ -30622,7 +30730,7 @@ function readWorktreeFileTail(worktreePath, relativePath, maxBytes = WORKTREE_TA
|
|
|
30622
30730
|
if (!relativePath || relativePath.includes("..") || relativePath.startsWith("/")) {
|
|
30623
30731
|
throw new Error("Invalid path");
|
|
30624
30732
|
}
|
|
30625
|
-
const abs = (0,
|
|
30733
|
+
const abs = (0, import_node_path64.join)(worktreePath, relativePath);
|
|
30626
30734
|
const fd = (0, import_node_fs64.openSync)(abs, "r");
|
|
30627
30735
|
try {
|
|
30628
30736
|
const st = (0, import_node_fs64.fstatSync)(fd);
|
|
@@ -30652,12 +30760,12 @@ function readWorktreeFileTail(worktreePath, relativePath, maxBytes = WORKTREE_TA
|
|
|
30652
30760
|
(0, import_node_fs64.closeSync)(fd);
|
|
30653
30761
|
}
|
|
30654
30762
|
}
|
|
30655
|
-
var import_node_fs64,
|
|
30763
|
+
var import_node_fs64, import_node_path64, WORKTREE_TAIL_BYTES;
|
|
30656
30764
|
var init_read_worktree_tail = __esm({
|
|
30657
30765
|
"src/diff/read-worktree-tail.ts"() {
|
|
30658
30766
|
"use strict";
|
|
30659
30767
|
import_node_fs64 = require("fs");
|
|
30660
|
-
|
|
30768
|
+
import_node_path64 = require("path");
|
|
30661
30769
|
WORKTREE_TAIL_BYTES = 2e5;
|
|
30662
30770
|
}
|
|
30663
30771
|
});
|
|
@@ -30834,7 +30942,7 @@ function scanSkillsDir(dir, source, out) {
|
|
|
30834
30942
|
}
|
|
30835
30943
|
for (const entry of entries) {
|
|
30836
30944
|
if (entry.startsWith(".")) continue;
|
|
30837
|
-
const skillMd = (0,
|
|
30945
|
+
const skillMd = (0, import_node_path65.join)(dir, entry, "SKILL.md");
|
|
30838
30946
|
if (!(0, import_node_fs65.existsSync)(skillMd)) continue;
|
|
30839
30947
|
try {
|
|
30840
30948
|
if (!(0, import_node_fs65.statSync)(skillMd).isFile()) continue;
|
|
@@ -30856,12 +30964,12 @@ function scanClaudePluginSkills(pluginsRoot, out) {
|
|
|
30856
30964
|
return;
|
|
30857
30965
|
}
|
|
30858
30966
|
if (lookingForSkillsDir && entries.includes("SKILL.md")) {
|
|
30859
|
-
const skill = readSkill((0,
|
|
30967
|
+
const skill = readSkill((0, import_node_path65.join)(dir, "SKILL.md"), "cli");
|
|
30860
30968
|
if (skill) out.push(skill);
|
|
30861
30969
|
}
|
|
30862
30970
|
for (const entry of entries) {
|
|
30863
30971
|
if (entry === "node_modules" || entry === ".git") continue;
|
|
30864
|
-
const full = (0,
|
|
30972
|
+
const full = (0, import_node_path65.join)(dir, entry);
|
|
30865
30973
|
try {
|
|
30866
30974
|
if (!(0, import_node_fs65.statSync)(full).isDirectory()) continue;
|
|
30867
30975
|
} catch {
|
|
@@ -30881,17 +30989,17 @@ function discoverSkills(worktreePath) {
|
|
|
30881
30989
|
const home = (0, import_node_os21.homedir)();
|
|
30882
30990
|
const collected = [];
|
|
30883
30991
|
for (const rel of [".claude/skills", ".cursor/skills", ".sideboard/skills", ".brightsy/skills", "skills"]) {
|
|
30884
|
-
scanSkillsDir((0,
|
|
30992
|
+
scanSkillsDir((0, import_node_path65.join)(worktreePath, rel), "workspace", collected);
|
|
30885
30993
|
}
|
|
30886
30994
|
for (const abs of [
|
|
30887
|
-
(0,
|
|
30888
|
-
(0,
|
|
30889
|
-
(0,
|
|
30890
|
-
(0,
|
|
30995
|
+
(0, import_node_path65.join)(home, ".claude/skills"),
|
|
30996
|
+
(0, import_node_path65.join)(home, ".cursor/skills"),
|
|
30997
|
+
(0, import_node_path65.join)(home, ".sideboard/skills"),
|
|
30998
|
+
(0, import_node_path65.join)(home, ".brightsy/skills")
|
|
30891
30999
|
]) {
|
|
30892
31000
|
scanSkillsDir(abs, "user", collected);
|
|
30893
31001
|
}
|
|
30894
|
-
scanClaudePluginSkills((0,
|
|
31002
|
+
scanClaudePluginSkills((0, import_node_path65.join)(home, ".claude/plugins"), collected);
|
|
30895
31003
|
collected.push(...bundledSkills());
|
|
30896
31004
|
const rank = {
|
|
30897
31005
|
workspace: 0,
|
|
@@ -30931,13 +31039,13 @@ function readSkillBody(skillPath, maxChars = 12e3) {
|
|
|
30931
31039
|
|
|
30932
31040
|
\u2026(truncated)` : raw;
|
|
30933
31041
|
}
|
|
30934
|
-
var import_node_fs65, import_node_os21,
|
|
31042
|
+
var import_node_fs65, import_node_os21, import_node_path65, BUNDLED_SKILL_PREFIX;
|
|
30935
31043
|
var init_discover = __esm({
|
|
30936
31044
|
"src/skills/discover.ts"() {
|
|
30937
31045
|
"use strict";
|
|
30938
31046
|
import_node_fs65 = require("fs");
|
|
30939
31047
|
import_node_os21 = require("os");
|
|
30940
|
-
|
|
31048
|
+
import_node_path65 = require("path");
|
|
30941
31049
|
init_long_running();
|
|
30942
31050
|
BUNDLED_SKILL_PREFIX = "bundled:";
|
|
30943
31051
|
}
|
|
@@ -31302,7 +31410,7 @@ function compiledModuleDir() {
|
|
|
31302
31410
|
try {
|
|
31303
31411
|
const url = import_meta8.url;
|
|
31304
31412
|
if (typeof url === "string" && url.length > 0) {
|
|
31305
|
-
return (0,
|
|
31413
|
+
return (0, import_node_path66.dirname)((0, import_node_url6.fileURLToPath)(url));
|
|
31306
31414
|
}
|
|
31307
31415
|
} catch {
|
|
31308
31416
|
}
|
|
@@ -31310,7 +31418,7 @@ function compiledModuleDir() {
|
|
|
31310
31418
|
}
|
|
31311
31419
|
function detachedJobScriptIn(dir) {
|
|
31312
31420
|
for (const name of DETACHED_JOB_FILENAMES) {
|
|
31313
|
-
const script = (0,
|
|
31421
|
+
const script = (0, import_node_path66.join)(dir, "scripts", name);
|
|
31314
31422
|
if ((0, import_node_fs66.existsSync)(script)) return script;
|
|
31315
31423
|
}
|
|
31316
31424
|
return null;
|
|
@@ -31328,7 +31436,7 @@ function resolveDetachedJobScript() {
|
|
|
31328
31436
|
for (let i = 0; i < 8; i++) {
|
|
31329
31437
|
const candidate = detachedJobScriptIn(dir);
|
|
31330
31438
|
if (candidate) return candidate;
|
|
31331
|
-
const parent = (0,
|
|
31439
|
+
const parent = (0, import_node_path66.dirname)(dir);
|
|
31332
31440
|
if (parent === dir) break;
|
|
31333
31441
|
dir = parent;
|
|
31334
31442
|
}
|
|
@@ -31339,12 +31447,12 @@ function formatDetachedJobInvoke(scriptPath) {
|
|
|
31339
31447
|
if (resolved) return `node ${JSON.stringify(resolved)}`;
|
|
31340
31448
|
return "node scripts/detached-job.cjs";
|
|
31341
31449
|
}
|
|
31342
|
-
var import_node_fs66,
|
|
31450
|
+
var import_node_fs66, import_node_path66, import_node_url6, import_meta8, DETACHED_JOB_FILENAMES;
|
|
31343
31451
|
var init_detached_job_path = __esm({
|
|
31344
31452
|
"src/skills/detached-job-path.ts"() {
|
|
31345
31453
|
"use strict";
|
|
31346
31454
|
import_node_fs66 = require("fs");
|
|
31347
|
-
|
|
31455
|
+
import_node_path66 = require("path");
|
|
31348
31456
|
import_node_url6 = require("url");
|
|
31349
31457
|
init_packaged_runtime();
|
|
31350
31458
|
import_meta8 = {};
|
|
@@ -31600,9 +31708,9 @@ function formatPrGateDirective() {
|
|
|
31600
31708
|
}
|
|
31601
31709
|
function formatProcessGuideDirective(opts) {
|
|
31602
31710
|
const worktree = opts?.worktreePath?.trim();
|
|
31603
|
-
const hasGraphSkill = !!worktree && (0, import_node_fs67.existsSync)((0,
|
|
31604
|
-
const hasReviewSkill = !!worktree && (0, import_node_fs67.existsSync)((0,
|
|
31605
|
-
const hasInstallSkill = !!worktree && (0, import_node_fs67.existsSync)((0,
|
|
31711
|
+
const hasGraphSkill = !!worktree && (0, import_node_fs67.existsSync)((0, import_node_path67.join)(worktree, ".claude/skills/graph-engineering/SKILL.md"));
|
|
31712
|
+
const hasReviewSkill = !!worktree && (0, import_node_fs67.existsSync)((0, import_node_path67.join)(worktree, ".claude/skills/review/SKILL.md"));
|
|
31713
|
+
const hasInstallSkill = !!worktree && (0, import_node_fs67.existsSync)((0, import_node_path67.join)(worktree, ".claude/skills/worktree-install/SKILL.md"));
|
|
31606
31714
|
return [
|
|
31607
31715
|
"Process guides (recurring work only):",
|
|
31608
31716
|
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,
|
|
@@ -31642,12 +31750,12 @@ function formatArtifactDirective() {
|
|
|
31642
31750
|
function formatUiReminder() {
|
|
31643
31751
|
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). Chat links: `[name](sideboard://artifact/<id-or-title>)` opens that pane; `[name](sideboard://file/path#L12-L40)` opens a file. ask_user only for a real multiple-choice (not hellos, \u201Cwhat next?\u201D, or after a review) \u2014 reply in chat. ask_user wakes the parent orchestrator; notify_orchestrator if blocked without a picker. Do not say artifacts/CMS UI are unavailable. Dev / preview: run_dev_script (same as the Dev button; pass name \u2014 several scripts can run at once) returns {url, port, preview} (SIDEBOARD_PORT \u2014 never guess :3000). preview=url \u2192 open url; preview=window \u2192 Electron window is the app, url is renderer/HMR only. list_run_scripts active[].url if already running; get_run_log for that script\u2019s Run-tab terminal; stop_dev_script to stop one.";
|
|
31644
31752
|
}
|
|
31645
|
-
var import_node_fs67,
|
|
31753
|
+
var import_node_fs67, import_node_path67, PR_GOAL_RE, GITHUB_TICKET_REF, KEYED_TICKET_REF;
|
|
31646
31754
|
var init_instructions = __esm({
|
|
31647
31755
|
"src/agents/instructions.ts"() {
|
|
31648
31756
|
"use strict";
|
|
31649
31757
|
import_node_fs67 = require("fs");
|
|
31650
|
-
|
|
31758
|
+
import_node_path67 = require("path");
|
|
31651
31759
|
init_git_auth_mode();
|
|
31652
31760
|
init_forge_git_directives();
|
|
31653
31761
|
init_branch_prefix();
|
|
@@ -32457,13 +32565,13 @@ __export(plan_file_exports, {
|
|
|
32457
32565
|
writePlanFile: () => writePlanFile
|
|
32458
32566
|
});
|
|
32459
32567
|
function ensureAttachmentsGitignore(worktreePath) {
|
|
32460
|
-
const gitignoreAbs = (0,
|
|
32568
|
+
const gitignoreAbs = (0, import_node_path68.join)(worktreePath, ATTACHMENTS_DIR, ".gitignore");
|
|
32461
32569
|
if ((0, import_node_fs68.existsSync)(gitignoreAbs)) return;
|
|
32462
|
-
(0, import_node_fs68.mkdirSync)((0,
|
|
32570
|
+
(0, import_node_fs68.mkdirSync)((0, import_node_path68.dirname)(gitignoreAbs), { recursive: true });
|
|
32463
32571
|
(0, import_node_fs68.writeFileSync)(gitignoreAbs, attachmentsGitignoreBody(), "utf8");
|
|
32464
32572
|
}
|
|
32465
32573
|
function planFileAbs(worktreePath) {
|
|
32466
|
-
return (0,
|
|
32574
|
+
return (0, import_node_path68.join)(worktreePath, PLAN_FILE_REL);
|
|
32467
32575
|
}
|
|
32468
32576
|
function readTextIfPresent2(abs) {
|
|
32469
32577
|
if (!(0, import_node_fs68.existsSync)(abs)) return null;
|
|
@@ -32475,22 +32583,22 @@ function readTextIfPresent2(abs) {
|
|
|
32475
32583
|
}
|
|
32476
32584
|
}
|
|
32477
32585
|
function readPlanFile(worktreePath) {
|
|
32478
|
-
return readTextIfPresent2(planFileAbs(worktreePath)) ?? readTextIfPresent2((0,
|
|
32586
|
+
return readTextIfPresent2(planFileAbs(worktreePath)) ?? readTextIfPresent2((0, import_node_path68.join)(worktreePath, `${LEGACY_ATTACHMENTS_DIR}/plan.md`)) ?? readTextIfPresent2((0, import_node_path68.join)(worktreePath, LEGACY_PLAN_FILE_REL));
|
|
32479
32587
|
}
|
|
32480
32588
|
function writePlanFile(worktreePath, content) {
|
|
32481
32589
|
ensureAttachmentsGitignore(worktreePath);
|
|
32482
32590
|
const abs = planFileAbs(worktreePath);
|
|
32483
|
-
(0, import_node_fs68.mkdirSync)((0,
|
|
32591
|
+
(0, import_node_fs68.mkdirSync)((0, import_node_path68.dirname)(abs), { recursive: true });
|
|
32484
32592
|
const body = content.trimEnd() + (content.endsWith("\n") ? "" : "\n");
|
|
32485
32593
|
(0, import_node_fs68.writeFileSync)(abs, body, "utf8");
|
|
32486
32594
|
return PLAN_FILE_REL;
|
|
32487
32595
|
}
|
|
32488
|
-
var import_node_fs68,
|
|
32596
|
+
var import_node_fs68, import_node_path68;
|
|
32489
32597
|
var init_plan_file = __esm({
|
|
32490
32598
|
"src/plan/plan-file.ts"() {
|
|
32491
32599
|
"use strict";
|
|
32492
32600
|
import_node_fs68 = require("fs");
|
|
32493
|
-
|
|
32601
|
+
import_node_path68 = require("path");
|
|
32494
32602
|
init_workspace_scratch();
|
|
32495
32603
|
init_plan_present();
|
|
32496
32604
|
init_plan_present();
|
|
@@ -38923,7 +39031,7 @@ init_turn_live();
|
|
|
38923
39031
|
|
|
38924
39032
|
// src/remote/phone-media.ts
|
|
38925
39033
|
var import_node_fs71 = require("fs");
|
|
38926
|
-
var
|
|
39034
|
+
var import_node_path69 = require("path");
|
|
38927
39035
|
init_diff();
|
|
38928
39036
|
var PHONE_IMAGE_MAX_BYTES = 15e5;
|
|
38929
39037
|
var PHONE_TEXT_MAX_BYTES = 18e4;
|
|
@@ -38976,7 +39084,7 @@ function phoneImageDataUrl(worktreePath, raw) {
|
|
|
38976
39084
|
}
|
|
38977
39085
|
function phoneDirectoryListing(worktreePath, relative2) {
|
|
38978
39086
|
try {
|
|
38979
|
-
const entries = (0, import_node_fs71.readdirSync)((0,
|
|
39087
|
+
const entries = (0, import_node_fs71.readdirSync)((0, import_node_path69.join)(worktreePath, relative2), { withFileTypes: true });
|
|
38980
39088
|
const dirs = new Set(entries.filter((entry) => entry.isDirectory()).map((entry) => entry.name));
|
|
38981
39089
|
const names = entries.map((entry) => entry.name).filter((name) => name && !name.includes("/") && !name.includes("\0")).sort((a, b) => a.localeCompare(b));
|
|
38982
39090
|
const shown = names.slice(0, PHONE_DIR_MAX);
|
|
@@ -39002,7 +39110,7 @@ function phoneFilePreview(worktreePath, relative2, kind) {
|
|
|
39002
39110
|
}
|
|
39003
39111
|
if (relative2.toLowerCase().endsWith(".svg")) {
|
|
39004
39112
|
try {
|
|
39005
|
-
const buf = (0, import_node_fs71.readFileSync)((0,
|
|
39113
|
+
const buf = (0, import_node_fs71.readFileSync)((0, import_node_path69.join)(worktreePath, relative2));
|
|
39006
39114
|
const truncated = buf.length > PHONE_TEXT_MAX_BYTES;
|
|
39007
39115
|
return {
|
|
39008
39116
|
content: buf.subarray(0, PHONE_TEXT_MAX_BYTES).toString("utf8"),
|
|
@@ -40511,7 +40619,7 @@ function handleRemoteInbound(text7, opts) {
|
|
|
40511
40619
|
}
|
|
40512
40620
|
|
|
40513
40621
|
// src/remote/phone-board-sync.ts
|
|
40514
|
-
var
|
|
40622
|
+
var import_node_path70 = require("path");
|
|
40515
40623
|
var import_chokidar = require("chokidar");
|
|
40516
40624
|
init_orchestrator();
|
|
40517
40625
|
init_paths();
|
|
@@ -40564,7 +40672,7 @@ function subscribePhoneBoard(notify) {
|
|
|
40564
40672
|
threads.on("error", () => void 0);
|
|
40565
40673
|
const data = (0, import_chokidar.watch)(appDataDir(), { ignoreInitial: true, depth: 0 });
|
|
40566
40674
|
const onData = (changed) => {
|
|
40567
|
-
const name = (0,
|
|
40675
|
+
const name = (0, import_node_path70.basename)(changed);
|
|
40568
40676
|
if (name !== "workspaces.json" && name !== "removed-workspaces.json" && name !== "settings.json") return;
|
|
40569
40677
|
notify();
|
|
40570
40678
|
};
|
|
@@ -41813,7 +41921,7 @@ var SlackRelayHub = class {
|
|
|
41813
41921
|
// src/relay/static.ts
|
|
41814
41922
|
var import_node_fs72 = require("fs");
|
|
41815
41923
|
var import_promises = require("fs/promises");
|
|
41816
|
-
var
|
|
41924
|
+
var import_node_path71 = __toESM(require("path"), 1);
|
|
41817
41925
|
var TYPES = {
|
|
41818
41926
|
".css": "text/css; charset=utf-8",
|
|
41819
41927
|
".html": "text/html; charset=utf-8",
|
|
@@ -41844,9 +41952,9 @@ function resolveStaticPath(root, requestUrl) {
|
|
|
41844
41952
|
return null;
|
|
41845
41953
|
}
|
|
41846
41954
|
if (!pathname.startsWith("/") || pathname.includes("\0")) return null;
|
|
41847
|
-
const rootResolved =
|
|
41848
|
-
const candidate =
|
|
41849
|
-
if (candidate !== rootResolved && !candidate.startsWith(rootResolved +
|
|
41955
|
+
const rootResolved = import_node_path71.default.resolve(root);
|
|
41956
|
+
const candidate = import_node_path71.default.resolve(rootResolved, `.${pathname}`);
|
|
41957
|
+
if (candidate !== rootResolved && !candidate.startsWith(rootResolved + import_node_path71.default.sep)) {
|
|
41850
41958
|
return null;
|
|
41851
41959
|
}
|
|
41852
41960
|
return candidate;
|
|
@@ -41860,7 +41968,7 @@ async function fileSize(file) {
|
|
|
41860
41968
|
}
|
|
41861
41969
|
}
|
|
41862
41970
|
function sendFile(req, res, file, size) {
|
|
41863
|
-
const ext =
|
|
41971
|
+
const ext = import_node_path71.default.extname(file).toLowerCase();
|
|
41864
41972
|
res.writeHead(200, {
|
|
41865
41973
|
"Content-Type": TYPES[ext] ?? "application/octet-stream",
|
|
41866
41974
|
"Content-Length": size,
|
|
@@ -41879,7 +41987,7 @@ async function tryServeStatic(req, res, root) {
|
|
|
41879
41987
|
if (!candidate) return false;
|
|
41880
41988
|
const direct = await fileSize(candidate);
|
|
41881
41989
|
if (direct != null) return sendFile(req, res, candidate, direct);
|
|
41882
|
-
const asIndex =
|
|
41990
|
+
const asIndex = import_node_path71.default.join(candidate, "index.html");
|
|
41883
41991
|
const indexSize = await fileSize(asIndex);
|
|
41884
41992
|
if (indexSize != null) return sendFile(req, res, asIndex, indexSize);
|
|
41885
41993
|
return false;
|
|
@@ -42224,13 +42332,13 @@ init_protocol();
|
|
|
42224
42332
|
var import_node_crypto25 = require("crypto");
|
|
42225
42333
|
var import_node_fs73 = require("fs");
|
|
42226
42334
|
var import_node_module7 = require("module");
|
|
42227
|
-
var
|
|
42335
|
+
var import_node_path72 = require("path");
|
|
42228
42336
|
var GITHUB_ACCOUNT_ISSUER = "https://github.com";
|
|
42229
42337
|
var CURSOR_ACCOUNT_ISSUER = "https://api.cursor.com/v1/origin";
|
|
42230
42338
|
var RELAY_DEVICE_CAP = 3;
|
|
42231
42339
|
function thisModuleFile3() {
|
|
42232
42340
|
const cjsFile = typeof __filename !== "undefined" ? __filename : "";
|
|
42233
|
-
return cjsFile || process.argv[1] || (0,
|
|
42341
|
+
return cjsFile || process.argv[1] || (0, import_node_path72.join)(process.cwd(), "package.json");
|
|
42234
42342
|
}
|
|
42235
42343
|
function openDatabase(filePath) {
|
|
42236
42344
|
const req = (0, import_node_module7.createRequire)(thisModuleFile3());
|
|
@@ -42267,7 +42375,7 @@ function assertRelayAccountsDurable(filePath) {
|
|
|
42267
42375
|
if (process.env.SIDEBOARD_RELAY_ACCOUNTS_EPHEMERAL === "1") return;
|
|
42268
42376
|
if (process.env.NODE_ENV !== "production") return;
|
|
42269
42377
|
if (process.platform !== "linux") return;
|
|
42270
|
-
const dir = (0, import_node_fs73.realpathSync)((0,
|
|
42378
|
+
const dir = (0, import_node_fs73.realpathSync)((0, import_node_path72.dirname)(filePath));
|
|
42271
42379
|
const mounts = (0, import_node_fs73.readFileSync)("/proc/mounts", "utf8");
|
|
42272
42380
|
const point = longestMountPoint(dir, mounts);
|
|
42273
42381
|
if (point === "/") {
|
|
@@ -42279,7 +42387,7 @@ function assertRelayAccountsDurable(filePath) {
|
|
|
42279
42387
|
var RelayAccountStore = class {
|
|
42280
42388
|
db;
|
|
42281
42389
|
constructor(filePath) {
|
|
42282
|
-
(0, import_node_fs73.mkdirSync)((0,
|
|
42390
|
+
(0, import_node_fs73.mkdirSync)((0, import_node_path72.dirname)(filePath), { recursive: true });
|
|
42283
42391
|
this.db = openDatabase(filePath);
|
|
42284
42392
|
this.db.exec(`
|
|
42285
42393
|
CREATE TABLE IF NOT EXISTS accounts (
|
|
@@ -43845,20 +43953,20 @@ init_cursor_stream_cutoff();
|
|
|
43845
43953
|
|
|
43846
43954
|
// src/agents/tool-result-clip.ts
|
|
43847
43955
|
var import_node_fs74 = require("fs");
|
|
43848
|
-
var
|
|
43956
|
+
var import_node_path73 = require("path");
|
|
43849
43957
|
init_workspace_scratch();
|
|
43850
43958
|
init_error_detail();
|
|
43851
43959
|
function spillPath(cwd, prefix) {
|
|
43852
43960
|
const stamp = `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
|
|
43853
43961
|
const safe = prefix.replace(/[^a-zA-Z0-9_-]+/g, "-").slice(0, 40) || "tool";
|
|
43854
|
-
return (0,
|
|
43962
|
+
return (0, import_node_path73.join)(cwd, CLI_DIR, `${safe}-${stamp}.txt`);
|
|
43855
43963
|
}
|
|
43856
43964
|
function spillToolResultToCli(content, opts) {
|
|
43857
43965
|
const cwd = opts?.cwd?.trim();
|
|
43858
43966
|
if (!cwd || !content) return null;
|
|
43859
43967
|
const file = spillPath(cwd, opts?.prefix ?? "tool-result");
|
|
43860
43968
|
try {
|
|
43861
|
-
(0, import_node_fs74.mkdirSync)((0,
|
|
43969
|
+
(0, import_node_fs74.mkdirSync)((0, import_node_path73.join)(cwd, CLI_DIR), { recursive: true });
|
|
43862
43970
|
(0, import_node_fs74.writeFileSync)(file, content, "utf8");
|
|
43863
43971
|
return file;
|
|
43864
43972
|
} catch {
|
|
@@ -43946,7 +44054,7 @@ function createClippedMcpServer() {
|
|
|
43946
44054
|
// src/mcp/server.ts
|
|
43947
44055
|
var import_zod11 = require("zod");
|
|
43948
44056
|
var import_node_crypto31 = require("crypto");
|
|
43949
|
-
var
|
|
44057
|
+
var import_node_path77 = require("path");
|
|
43950
44058
|
init_orchestrator();
|
|
43951
44059
|
init_task_state();
|
|
43952
44060
|
init_worktree();
|
|
@@ -45628,7 +45736,7 @@ function registerScheduleTools(server) {
|
|
|
45628
45736
|
|
|
45629
45737
|
// src/agent-rpc/handlers.ts
|
|
45630
45738
|
var import_node_crypto29 = require("crypto");
|
|
45631
|
-
var
|
|
45739
|
+
var import_node_path74 = require("path");
|
|
45632
45740
|
init_wait_for_job();
|
|
45633
45741
|
init_wait_for_turn();
|
|
45634
45742
|
|
|
@@ -45735,7 +45843,7 @@ function invalidParams2(message) {
|
|
|
45735
45843
|
function jobCwd(rec) {
|
|
45736
45844
|
const raw = str7(rec.cwd).trim();
|
|
45737
45845
|
if (!raw) throw invalidParams2("cwd is required");
|
|
45738
|
-
if (!(0,
|
|
45846
|
+
if (!(0, import_node_path74.isAbsolute)(raw)) throw invalidParams2("cwd must be an absolute path");
|
|
45739
45847
|
return raw;
|
|
45740
45848
|
}
|
|
45741
45849
|
async function handleRuntimePing(_params, _ctx) {
|
|
@@ -45869,20 +45977,20 @@ init_git_auth_mode();
|
|
|
45869
45977
|
|
|
45870
45978
|
// src/board/load-home-board.ts
|
|
45871
45979
|
var import_node_fs76 = require("fs");
|
|
45872
|
-
var
|
|
45980
|
+
var import_node_path76 = require("path");
|
|
45873
45981
|
init_worktree();
|
|
45874
45982
|
init_paths();
|
|
45875
45983
|
|
|
45876
45984
|
// src/board/board-pins.ts
|
|
45877
45985
|
var import_node_crypto30 = require("crypto");
|
|
45878
45986
|
var import_node_fs75 = require("fs");
|
|
45879
|
-
var
|
|
45987
|
+
var import_node_path75 = require("path");
|
|
45880
45988
|
init_paths();
|
|
45881
45989
|
init_home_board();
|
|
45882
45990
|
var FILE = "home-board-pins.json";
|
|
45883
45991
|
var VERSION = 1;
|
|
45884
45992
|
function pinsFile() {
|
|
45885
|
-
return (0,
|
|
45993
|
+
return (0, import_node_path75.join)(appDataDir(), FILE);
|
|
45886
45994
|
}
|
|
45887
45995
|
function readDisk() {
|
|
45888
45996
|
const path2 = pinsFile();
|
|
@@ -45966,7 +46074,7 @@ function homeBoardWorkspaceKey(workspaces) {
|
|
|
45966
46074
|
return workspaces.map((w) => w.path).filter(Boolean).sort().join("\n");
|
|
45967
46075
|
}
|
|
45968
46076
|
function cacheFile() {
|
|
45969
|
-
return (0,
|
|
46077
|
+
return (0, import_node_path76.join)(appDataDir(), "home-board-cache.json");
|
|
45970
46078
|
}
|
|
45971
46079
|
function emptyInputs() {
|
|
45972
46080
|
return {
|
|
@@ -46231,7 +46339,7 @@ async function startMcpServer() {
|
|
|
46231
46339
|
async () => {
|
|
46232
46340
|
const threads = orch.getThreads();
|
|
46233
46341
|
const lines = threads.map((t) => {
|
|
46234
|
-
const repo = t.repoPath === GLOBAL_WORKSPACE_ID2 ? "Orchestration" : (0,
|
|
46342
|
+
const repo = t.repoPath === GLOBAL_WORKSPACE_ID2 ? "Orchestration" : (0, import_node_path77.basename)(t.repoPath) || t.repoPath;
|
|
46235
46343
|
const live = orch.threadLooksLive(t) ? readTurnLive(t.id) : null;
|
|
46236
46344
|
const parent = t.parentThreadId ? ` parent:${t.parentThreadId.slice(0, 8)}` : "";
|
|
46237
46345
|
const preview = lastMessagePreview(t.messages, 80);
|
|
@@ -48245,11 +48353,11 @@ init_model_context();
|
|
|
48245
48353
|
init_meta();
|
|
48246
48354
|
|
|
48247
48355
|
// src/slack/workspaces.ts
|
|
48248
|
-
var
|
|
48356
|
+
var import_node_path78 = require("path");
|
|
48249
48357
|
init_paths();
|
|
48250
48358
|
init_secure_file();
|
|
48251
48359
|
function storePath2() {
|
|
48252
|
-
return (0,
|
|
48360
|
+
return (0, import_node_path78.join)(appDataDir(), "slack-workspaces.json");
|
|
48253
48361
|
}
|
|
48254
48362
|
function readStore2() {
|
|
48255
48363
|
try {
|
|
@@ -48497,12 +48605,12 @@ init_thread_store();
|
|
|
48497
48605
|
|
|
48498
48606
|
// src/slack/reply-target.ts
|
|
48499
48607
|
var import_node_fs77 = require("fs");
|
|
48500
|
-
var
|
|
48608
|
+
var import_node_path79 = require("path");
|
|
48501
48609
|
init_paths();
|
|
48502
48610
|
init_private_file();
|
|
48503
48611
|
init_secure_file();
|
|
48504
48612
|
function storePath3() {
|
|
48505
|
-
return (0,
|
|
48613
|
+
return (0, import_node_path79.join)(appDataDir(), "slack-reply-to.json");
|
|
48506
48614
|
}
|
|
48507
48615
|
function readStore3() {
|
|
48508
48616
|
const path2 = storePath3();
|
|
@@ -49474,7 +49582,7 @@ async function disconnectRemoteAccount(opts) {
|
|
|
49474
49582
|
|
|
49475
49583
|
// src/slack/outbound-watch.ts
|
|
49476
49584
|
var import_node_fs78 = require("fs");
|
|
49477
|
-
var
|
|
49585
|
+
var import_node_path80 = require("path");
|
|
49478
49586
|
init_paths();
|
|
49479
49587
|
init_private_file();
|
|
49480
49588
|
init_secure_file();
|
|
@@ -49487,7 +49595,7 @@ var POLL_INTERVAL_MS = 12e3;
|
|
|
49487
49595
|
var lastPollMs = 0;
|
|
49488
49596
|
var nameCache = /* @__PURE__ */ new Map();
|
|
49489
49597
|
function storePath4() {
|
|
49490
|
-
return (0,
|
|
49598
|
+
return (0, import_node_path80.join)(appDataDir(), "slack-outbound-watch.json");
|
|
49491
49599
|
}
|
|
49492
49600
|
function watchId(teamId, channelId, ts) {
|
|
49493
49601
|
return `${teamId}:${channelId}:${ts}`;
|