@sideboard-ai/core 0.1.194 → 0.1.195
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/{chunk-VRPPFKAO.js → chunk-GFH3QVAV.js} +153 -48
- package/dist/{chunk-NY366OEZ.js → chunk-HAVI6AY3.js} +153 -48
- package/dist/index.cjs +1002 -888
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1 -1
- package/dist/mcp/run-stdio.cjs +171 -57
- package/dist/mcp/run-stdio.js +1 -1
- package/dist/{orchestrator-S3M2E7O6.js → orchestrator-6ESBGMDN.js} +1 -1
- package/dist/{orchestrator-A5KF2335.js → orchestrator-EHRFN3Q6.js} +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -4489,9 +4489,12 @@ declare class Orchestrator {
|
|
|
4489
4489
|
ports: number[];
|
|
4490
4490
|
}>;
|
|
4491
4491
|
stopDev(threadRef: string, scriptName?: string): void;
|
|
4492
|
+
private syncWorktreeRuns;
|
|
4492
4493
|
listThreadRunScripts(threadRef: string): RunScript[];
|
|
4493
4494
|
getActiveRuns(threadRef: string): ActiveRun[];
|
|
4494
4495
|
getSetupLog(threadRef: string): SetupLogSnapshot;
|
|
4496
|
+
private hasWorktreeSetupProcess;
|
|
4497
|
+
private writeSetupLog;
|
|
4495
4498
|
runSetup(threadRef: string, opts?: {
|
|
4496
4499
|
stampLastError?: boolean;
|
|
4497
4500
|
}): Promise<{
|
package/dist/index.d.ts
CHANGED
|
@@ -4489,9 +4489,12 @@ declare class Orchestrator {
|
|
|
4489
4489
|
ports: number[];
|
|
4490
4490
|
}>;
|
|
4491
4491
|
stopDev(threadRef: string, scriptName?: string): void;
|
|
4492
|
+
private syncWorktreeRuns;
|
|
4492
4493
|
listThreadRunScripts(threadRef: string): RunScript[];
|
|
4493
4494
|
getActiveRuns(threadRef: string): ActiveRun[];
|
|
4494
4495
|
getSetupLog(threadRef: string): SetupLogSnapshot;
|
|
4496
|
+
private hasWorktreeSetupProcess;
|
|
4497
|
+
private writeSetupLog;
|
|
4495
4498
|
runSetup(threadRef: string, opts?: {
|
|
4496
4499
|
stampLastError?: boolean;
|
|
4497
4500
|
}): Promise<{
|
package/dist/index.js
CHANGED
package/dist/mcp/run-stdio.cjs
CHANGED
|
@@ -13022,6 +13022,59 @@ var init_context_compact = __esm({
|
|
|
13022
13022
|
}
|
|
13023
13023
|
});
|
|
13024
13024
|
|
|
13025
|
+
// src/threads/worktree-runtime.ts
|
|
13026
|
+
function worktreeProcessPrefix(worktreePath) {
|
|
13027
|
+
return `wt:${normalizeWorktreePath(worktreePath)}`;
|
|
13028
|
+
}
|
|
13029
|
+
function worktreeSetupProcessKey(worktreePath) {
|
|
13030
|
+
return `${worktreeProcessPrefix(worktreePath)}:setup`;
|
|
13031
|
+
}
|
|
13032
|
+
function worktreeRunProcessKey(worktreePath, scriptName) {
|
|
13033
|
+
return `${worktreeProcessPrefix(worktreePath)}:run:${scriptName}`;
|
|
13034
|
+
}
|
|
13035
|
+
function worktreeDevProcessKey(worktreePath) {
|
|
13036
|
+
return `${worktreeProcessPrefix(worktreePath)}:dev`;
|
|
13037
|
+
}
|
|
13038
|
+
function isWorktreeRunProcessKey(key, worktreePath) {
|
|
13039
|
+
const prefix = worktreeProcessPrefix(worktreePath);
|
|
13040
|
+
return key.startsWith(`${prefix}:run:`) || key === `${prefix}:dev`;
|
|
13041
|
+
}
|
|
13042
|
+
function pickRichestSetupLog(snaps) {
|
|
13043
|
+
let best;
|
|
13044
|
+
for (const snap of snaps) {
|
|
13045
|
+
if (!snap.output && !snap.running && snap.exitCode == null) continue;
|
|
13046
|
+
if (!best) {
|
|
13047
|
+
best = snap;
|
|
13048
|
+
continue;
|
|
13049
|
+
}
|
|
13050
|
+
if (snap.running && !best.running) {
|
|
13051
|
+
best = snap;
|
|
13052
|
+
continue;
|
|
13053
|
+
}
|
|
13054
|
+
if (snap.running === best.running && snap.output.length > best.output.length) {
|
|
13055
|
+
best = snap;
|
|
13056
|
+
}
|
|
13057
|
+
}
|
|
13058
|
+
return best;
|
|
13059
|
+
}
|
|
13060
|
+
function mergeWorktreeActiveRuns(threads) {
|
|
13061
|
+
const byName = /* @__PURE__ */ new Map();
|
|
13062
|
+
let devPort = null;
|
|
13063
|
+
for (const thread of threads) {
|
|
13064
|
+
if (thread.devPort != null && devPort == null) devPort = thread.devPort;
|
|
13065
|
+
for (const run2 of thread.activeRuns ?? []) {
|
|
13066
|
+
if (!byName.has(run2.scriptName)) byName.set(run2.scriptName, run2);
|
|
13067
|
+
}
|
|
13068
|
+
}
|
|
13069
|
+
return { activeRuns: [...byName.values()], devPort };
|
|
13070
|
+
}
|
|
13071
|
+
var init_worktree_runtime = __esm({
|
|
13072
|
+
"src/threads/worktree-runtime.ts"() {
|
|
13073
|
+
"use strict";
|
|
13074
|
+
init_worktree_labels();
|
|
13075
|
+
}
|
|
13076
|
+
});
|
|
13077
|
+
|
|
13025
13078
|
// src/threads/chat-tabs.ts
|
|
13026
13079
|
function sameWorktreePath(a, b) {
|
|
13027
13080
|
return normalizeWorktreePath(a) === normalizeWorktreePath(b);
|
|
@@ -13118,7 +13171,8 @@ function createChatTab(input) {
|
|
|
13118
13171
|
planMode: from.planMode,
|
|
13119
13172
|
autonomy: input.autonomy ?? from.autonomy,
|
|
13120
13173
|
attachments: input.attachments ?? [],
|
|
13121
|
-
status: "idle"
|
|
13174
|
+
status: "idle",
|
|
13175
|
+
...mergeWorktreeActiveRuns(threadsSharingWorktree(binding.worktreePath))
|
|
13122
13176
|
});
|
|
13123
13177
|
writeThread(thread);
|
|
13124
13178
|
return thread;
|
|
@@ -13152,6 +13206,7 @@ var init_chat_tabs = __esm({
|
|
|
13152
13206
|
init_global_workspace();
|
|
13153
13207
|
init_orchestrator_capable();
|
|
13154
13208
|
init_thread_store();
|
|
13209
|
+
init_worktree_runtime();
|
|
13155
13210
|
init_worktree_labels();
|
|
13156
13211
|
}
|
|
13157
13212
|
});
|
|
@@ -13820,6 +13875,10 @@ var init_conductor = __esm({
|
|
|
13820
13875
|
function setupLogPath(threadId) {
|
|
13821
13876
|
return (0, import_node_path36.join)(threadsDir(), `${threadId}.setup.log.json`);
|
|
13822
13877
|
}
|
|
13878
|
+
function setupLogKeyForWorktree(worktreePath) {
|
|
13879
|
+
const norm = normalizeWorktreePath(worktreePath);
|
|
13880
|
+
return `wt-${(0, import_node_crypto8.createHash)("sha1").update(norm).digest("hex").slice(0, 16)}`;
|
|
13881
|
+
}
|
|
13823
13882
|
function emptySetupLog() {
|
|
13824
13883
|
return { ...EMPTY };
|
|
13825
13884
|
}
|
|
@@ -13910,12 +13969,14 @@ function finishSetupLog(threadId, exitCode, source) {
|
|
|
13910
13969
|
persistNow(threadId);
|
|
13911
13970
|
return clone(snap);
|
|
13912
13971
|
}
|
|
13913
|
-
var import_node_fs36, import_node_path36, EMPTY, memory, persistTimers;
|
|
13972
|
+
var import_node_crypto8, import_node_fs36, import_node_path36, EMPTY, memory, persistTimers;
|
|
13914
13973
|
var init_setup_log = __esm({
|
|
13915
13974
|
"src/store/setup-log.ts"() {
|
|
13916
13975
|
"use strict";
|
|
13976
|
+
import_node_crypto8 = require("crypto");
|
|
13917
13977
|
import_node_fs36 = require("fs");
|
|
13918
13978
|
import_node_path36 = require("path");
|
|
13979
|
+
init_worktree_labels();
|
|
13919
13980
|
init_paths();
|
|
13920
13981
|
EMPTY = {
|
|
13921
13982
|
output: "",
|
|
@@ -16384,7 +16445,7 @@ function buildQuotaHandoffAttachment(from, limitText, fallbackAgent) {
|
|
|
16384
16445
|
`- Do not wait on the limited ${from.agent} account; keep going on ${fallbackAgent}.`
|
|
16385
16446
|
].join("\n");
|
|
16386
16447
|
return {
|
|
16387
|
-
id: (0,
|
|
16448
|
+
id: (0, import_node_crypto9.randomUUID)(),
|
|
16388
16449
|
name: "Orchestration quota handoff.md",
|
|
16389
16450
|
kind: "transcript",
|
|
16390
16451
|
content: body
|
|
@@ -16405,11 +16466,11 @@ function createQuotaFailoverChat(from, fallbackAgent, limitText) {
|
|
|
16405
16466
|
sourceType: "orchestration"
|
|
16406
16467
|
});
|
|
16407
16468
|
}
|
|
16408
|
-
var
|
|
16469
|
+
var import_node_crypto9, QUOTA_CONTINUE_PROMPT, QUOTA_RESUME_PROMPT;
|
|
16409
16470
|
var init_quota_failover = __esm({
|
|
16410
16471
|
"src/orchestrator/quota-failover.ts"() {
|
|
16411
16472
|
"use strict";
|
|
16412
|
-
|
|
16473
|
+
import_node_crypto9 = require("crypto");
|
|
16413
16474
|
init_session_quota();
|
|
16414
16475
|
init_app_settings();
|
|
16415
16476
|
init_global_workspace();
|
|
@@ -19167,7 +19228,7 @@ function buildTask(input, now) {
|
|
|
19167
19228
|
const ts = nowIso2(now);
|
|
19168
19229
|
const agent = input.agent ? coerceOrchestratorAgent(input.agent) : null;
|
|
19169
19230
|
return {
|
|
19170
|
-
id: (0,
|
|
19231
|
+
id: (0, import_node_crypto10.randomUUID)(),
|
|
19171
19232
|
name: input.name?.trim() || defaultScheduleName(prompt),
|
|
19172
19233
|
prompt,
|
|
19173
19234
|
enabled: input.enabled !== false,
|
|
@@ -19254,11 +19315,11 @@ function recordScheduleRun(id, result) {
|
|
|
19254
19315
|
writeAll2(rows);
|
|
19255
19316
|
return next;
|
|
19256
19317
|
}
|
|
19257
|
-
var
|
|
19318
|
+
var import_node_crypto10, import_node_fs51, import_node_path48, import_croner, DURATION_RE, UNIT_MS;
|
|
19258
19319
|
var init_schedules = __esm({
|
|
19259
19320
|
"src/store/schedules.ts"() {
|
|
19260
19321
|
"use strict";
|
|
19261
|
-
|
|
19322
|
+
import_node_crypto10 = require("crypto");
|
|
19262
19323
|
import_node_fs51 = require("fs");
|
|
19263
19324
|
import_node_path48 = require("path");
|
|
19264
19325
|
import_croner = require("croner");
|
|
@@ -19666,6 +19727,7 @@ var init_orchestrator = __esm({
|
|
|
19666
19727
|
init_setup_last_error();
|
|
19667
19728
|
init_request_review();
|
|
19668
19729
|
init_fork_worktree();
|
|
19730
|
+
init_worktree_runtime();
|
|
19669
19731
|
init_quota_failover();
|
|
19670
19732
|
init_adopt();
|
|
19671
19733
|
init_stack_layers();
|
|
@@ -20831,22 +20893,25 @@ var init_orchestrator = __esm({
|
|
|
20831
20893
|
"No run script found for this worktree. Add [scripts.run.*] in the worktree\u2019s .sideboard/settings.toml or .conductor/settings.toml (or settings.local.toml on the main repo)."
|
|
20832
20894
|
);
|
|
20833
20895
|
}
|
|
20834
|
-
const
|
|
20835
|
-
const
|
|
20836
|
-
const
|
|
20896
|
+
const siblings = threadsSharingWorktree(thread.worktreePath);
|
|
20897
|
+
const shared = mergeWorktreeActiveRuns(siblings);
|
|
20898
|
+
const runKey = worktreeRunProcessKey(thread.worktreePath, resolvedName);
|
|
20899
|
+
const existing = this.processes.get(runKey) ?? siblings.map((t) => this.processes.get(`${t.id}:run:${resolvedName}`)).find(Boolean);
|
|
20900
|
+
const active = shared.activeRuns.find((r) => r.scriptName === resolvedName);
|
|
20837
20901
|
if (existing && active) {
|
|
20838
20902
|
return { port: active.port, scriptName: resolvedName, ports: active.ports };
|
|
20839
20903
|
}
|
|
20840
20904
|
if (!scriptName) {
|
|
20841
|
-
const legacy = this.processes.get(`${
|
|
20842
|
-
if (legacy &&
|
|
20843
|
-
return { port:
|
|
20905
|
+
const legacy = this.processes.get(worktreeDevProcessKey(thread.worktreePath)) ?? siblings.map((t) => this.processes.get(`${t.id}:dev`)).find(Boolean);
|
|
20906
|
+
if (legacy && shared.devPort) {
|
|
20907
|
+
return { port: shared.devPort, scriptName: resolvedName, ports: [shared.devPort] };
|
|
20844
20908
|
}
|
|
20845
20909
|
}
|
|
20846
20910
|
const mode = getRunMode(thread.worktreePath, thread.repoPath);
|
|
20847
20911
|
if (mode === "nonconcurrent") {
|
|
20912
|
+
const here = normalizeWorktreePath(thread.worktreePath);
|
|
20848
20913
|
for (const t of listThreads()) {
|
|
20849
|
-
if (t.
|
|
20914
|
+
if (normalizeWorktreePath(t.worktreePath) === here) continue;
|
|
20850
20915
|
const runs = t.activeRuns ?? [];
|
|
20851
20916
|
if (runs.length > 0 || t.devPort) {
|
|
20852
20917
|
throw new Error(
|
|
@@ -20881,7 +20946,7 @@ var init_orchestrator = __esm({
|
|
|
20881
20946
|
});
|
|
20882
20947
|
const isDefault = scripts.find((s) => s.default)?.name === resolvedName || !scripts.some((s) => s.default) && (resolvedName === "dev" || resolvedName === scripts[0]?.name);
|
|
20883
20948
|
if (isDefault) {
|
|
20884
|
-
this.processes.set(
|
|
20949
|
+
this.processes.set(worktreeDevProcessKey(thread.worktreePath), {
|
|
20885
20950
|
kind: "dev",
|
|
20886
20951
|
pid: handle.pid,
|
|
20887
20952
|
startedAt,
|
|
@@ -20896,13 +20961,14 @@ var init_orchestrator = __esm({
|
|
|
20896
20961
|
startedAt
|
|
20897
20962
|
};
|
|
20898
20963
|
const nextRuns = [
|
|
20899
|
-
...
|
|
20964
|
+
...shared.activeRuns.filter((r) => r.scriptName !== resolvedName),
|
|
20900
20965
|
run2
|
|
20901
20966
|
];
|
|
20902
|
-
|
|
20903
|
-
|
|
20904
|
-
|
|
20905
|
-
|
|
20967
|
+
this.syncWorktreeRuns(
|
|
20968
|
+
thread.worktreePath,
|
|
20969
|
+
nextRuns,
|
|
20970
|
+
isDefault ? handle.port : shared.devPort
|
|
20971
|
+
);
|
|
20906
20972
|
this.emit({
|
|
20907
20973
|
type: "dev_server_started",
|
|
20908
20974
|
threadId: thread.id,
|
|
@@ -20911,15 +20977,14 @@ var init_orchestrator = __esm({
|
|
|
20911
20977
|
});
|
|
20912
20978
|
void handle.done.then(() => {
|
|
20913
20979
|
this.processes.delete(runKey);
|
|
20914
|
-
if (isDefault) this.processes.delete(
|
|
20915
|
-
const latest =
|
|
20916
|
-
const remaining =
|
|
20917
|
-
|
|
20980
|
+
if (isDefault) this.processes.delete(worktreeDevProcessKey(thread.worktreePath));
|
|
20981
|
+
const latest = mergeWorktreeActiveRuns(threadsSharingWorktree(thread.worktreePath));
|
|
20982
|
+
const remaining = latest.activeRuns.filter((r) => r.scriptName !== resolvedName);
|
|
20983
|
+
this.syncWorktreeRuns(
|
|
20984
|
+
thread.worktreePath,
|
|
20985
|
+
remaining,
|
|
20986
|
+
isDefault ? null : latest.devPort
|
|
20918
20987
|
);
|
|
20919
|
-
updateThread(thread.id, {
|
|
20920
|
-
activeRuns: remaining,
|
|
20921
|
-
devPort: isDefault ? null : latest?.devPort ?? null
|
|
20922
|
-
});
|
|
20923
20988
|
this.emit({
|
|
20924
20989
|
type: "dev_server_stopped",
|
|
20925
20990
|
threadId: thread.id,
|
|
@@ -20930,51 +20995,82 @@ var init_orchestrator = __esm({
|
|
|
20930
20995
|
}
|
|
20931
20996
|
stopDev(threadRef, scriptName) {
|
|
20932
20997
|
const thread = this.requireThread(threadRef);
|
|
20998
|
+
const siblings = threadsSharingWorktree(thread.worktreePath);
|
|
20999
|
+
const shared = mergeWorktreeActiveRuns(siblings);
|
|
20933
21000
|
if (scriptName) {
|
|
20934
|
-
const
|
|
20935
|
-
|
|
20936
|
-
|
|
20937
|
-
|
|
20938
|
-
const
|
|
20939
|
-
|
|
20940
|
-
|
|
20941
|
-
|
|
20942
|
-
|
|
20943
|
-
|
|
21001
|
+
const keys = [
|
|
21002
|
+
worktreeRunProcessKey(thread.worktreePath, scriptName),
|
|
21003
|
+
...siblings.map((t) => `${t.id}:run:${scriptName}`)
|
|
21004
|
+
];
|
|
21005
|
+
for (const key of keys) {
|
|
21006
|
+
const proc = this.processes.get(key);
|
|
21007
|
+
if (proc) proc.kill();
|
|
21008
|
+
this.processes.delete(key);
|
|
21009
|
+
}
|
|
21010
|
+
const remaining = shared.activeRuns.filter((r) => r.scriptName !== scriptName);
|
|
21011
|
+
const isPrimary = shared.devPort != null && shared.activeRuns.find((r) => r.scriptName === scriptName)?.port === shared.devPort;
|
|
21012
|
+
this.syncWorktreeRuns(
|
|
21013
|
+
thread.worktreePath,
|
|
21014
|
+
remaining,
|
|
21015
|
+
isPrimary ? null : shared.devPort
|
|
21016
|
+
);
|
|
20944
21017
|
this.emit({ type: "dev_server_stopped", threadId: thread.id, scriptName });
|
|
20945
21018
|
return;
|
|
20946
21019
|
}
|
|
20947
21020
|
for (const [key, proc] of [...this.processes.entries()]) {
|
|
20948
|
-
if (key.startsWith(`${
|
|
21021
|
+
if (isWorktreeRunProcessKey(key, thread.worktreePath) || siblings.some((t) => key.startsWith(`${t.id}:run:`) || key === `${t.id}:dev`)) {
|
|
20949
21022
|
proc.kill();
|
|
20950
21023
|
this.processes.delete(key);
|
|
20951
21024
|
}
|
|
20952
21025
|
}
|
|
20953
|
-
|
|
21026
|
+
this.syncWorktreeRuns(thread.worktreePath, [], null);
|
|
20954
21027
|
this.emit({ type: "dev_server_stopped", threadId: thread.id });
|
|
20955
21028
|
}
|
|
21029
|
+
syncWorktreeRuns(worktreePath, activeRuns, devPort) {
|
|
21030
|
+
for (const sibling of threadsSharingWorktree(worktreePath)) {
|
|
21031
|
+
updateThread(sibling.id, { activeRuns, devPort });
|
|
21032
|
+
}
|
|
21033
|
+
}
|
|
20956
21034
|
listThreadRunScripts(threadRef) {
|
|
20957
21035
|
const thread = this.requireThread(threadRef);
|
|
20958
21036
|
return listRunScripts(thread.worktreePath, thread.repoPath);
|
|
20959
21037
|
}
|
|
20960
21038
|
getActiveRuns(threadRef) {
|
|
20961
|
-
|
|
21039
|
+
const thread = this.requireThread(threadRef);
|
|
21040
|
+
return mergeWorktreeActiveRuns(threadsSharingWorktree(thread.worktreePath)).activeRuns;
|
|
20962
21041
|
}
|
|
20963
21042
|
getSetupLog(threadRef) {
|
|
20964
21043
|
const thread = this.getThread(threadRef);
|
|
20965
21044
|
if (!thread) return readSetupLog(threadRef);
|
|
20966
|
-
const
|
|
20967
|
-
|
|
21045
|
+
const siblingIds = [
|
|
21046
|
+
thread.id,
|
|
21047
|
+
...threadsSharingWorktree(thread.worktreePath).map((t) => t.id)
|
|
21048
|
+
];
|
|
21049
|
+
const snap = pickRichestSetupLog([
|
|
21050
|
+
readSetupLog(setupLogKeyForWorktree(thread.worktreePath)),
|
|
21051
|
+
...[...new Set(siblingIds)].map((id) => readSetupLog(id))
|
|
21052
|
+
]) ?? readSetupLog(thread.id);
|
|
21053
|
+
if (snap.running && !this.hasWorktreeSetupProcess(thread.worktreePath)) {
|
|
20968
21054
|
return { ...snap, running: false };
|
|
20969
21055
|
}
|
|
20970
21056
|
return snap;
|
|
20971
21057
|
}
|
|
21058
|
+
hasWorktreeSetupProcess(worktreePath) {
|
|
21059
|
+
if (this.processes.has(worktreeSetupProcessKey(worktreePath))) return true;
|
|
21060
|
+
return threadsSharingWorktree(worktreePath).some(
|
|
21061
|
+
(t) => this.processes.has(`${t.id}:setup`)
|
|
21062
|
+
);
|
|
21063
|
+
}
|
|
21064
|
+
writeSetupLog(threadId, worktreePath, fn) {
|
|
21065
|
+
fn(setupLogKeyForWorktree(worktreePath));
|
|
21066
|
+
fn(threadId);
|
|
21067
|
+
}
|
|
20972
21068
|
async runSetup(threadRef, opts) {
|
|
20973
21069
|
const thread = this.requireThread(threadRef);
|
|
20974
21070
|
this.assertNotGlobal(thread, "Setup");
|
|
20975
|
-
const key =
|
|
20976
|
-
if (this.
|
|
20977
|
-
throw new Error("Setup already running for this
|
|
21071
|
+
const key = worktreeSetupProcessKey(thread.worktreePath);
|
|
21072
|
+
if (this.hasWorktreeSetupProcess(thread.worktreePath)) {
|
|
21073
|
+
throw new Error("Setup already running for this worktree");
|
|
20978
21074
|
}
|
|
20979
21075
|
const abort = new AbortController();
|
|
20980
21076
|
this.processes.set(key, {
|
|
@@ -20982,13 +21078,17 @@ var init_orchestrator = __esm({
|
|
|
20982
21078
|
startedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
20983
21079
|
kill: () => abort.abort()
|
|
20984
21080
|
});
|
|
20985
|
-
|
|
21081
|
+
this.writeSetupLog(thread.id, thread.worktreePath, beginSetupLog);
|
|
20986
21082
|
this.emit({ type: "setup_started", threadId: thread.id });
|
|
20987
21083
|
let finished = false;
|
|
20988
21084
|
const finish = (exitCode, source) => {
|
|
20989
21085
|
if (finished) return;
|
|
20990
21086
|
finished = true;
|
|
20991
|
-
|
|
21087
|
+
this.writeSetupLog(
|
|
21088
|
+
thread.id,
|
|
21089
|
+
thread.worktreePath,
|
|
21090
|
+
(logKey) => finishSetupLog(logKey, exitCode, source)
|
|
21091
|
+
);
|
|
20992
21092
|
this.emit({ type: "setup_finished", threadId: thread.id, exitCode });
|
|
20993
21093
|
};
|
|
20994
21094
|
try {
|
|
@@ -20996,14 +21096,22 @@ var init_orchestrator = __esm({
|
|
|
20996
21096
|
thread.repoPath,
|
|
20997
21097
|
thread.worktreePath,
|
|
20998
21098
|
(line) => {
|
|
20999
|
-
|
|
21099
|
+
this.writeSetupLog(
|
|
21100
|
+
thread.id,
|
|
21101
|
+
thread.worktreePath,
|
|
21102
|
+
(logKey) => appendSetupLog(logKey, line)
|
|
21103
|
+
);
|
|
21000
21104
|
this.emit({ type: "setup_output", threadId: thread.id, line });
|
|
21001
21105
|
},
|
|
21002
21106
|
{ signal: abort.signal }
|
|
21003
21107
|
);
|
|
21004
21108
|
if (!setup.ran) {
|
|
21005
21109
|
const line = "No setup script in .sideboard/settings.toml, .conductor/settings.toml, .cursor/worktrees.json, or script/setup (bin/setup, scripts/setup)";
|
|
21006
|
-
|
|
21110
|
+
this.writeSetupLog(
|
|
21111
|
+
thread.id,
|
|
21112
|
+
thread.worktreePath,
|
|
21113
|
+
(logKey) => appendSetupLog(logKey, line)
|
|
21114
|
+
);
|
|
21007
21115
|
this.emit({ type: "setup_output", threadId: thread.id, line });
|
|
21008
21116
|
finish(null, null);
|
|
21009
21117
|
throw new Error(line);
|
|
@@ -21031,8 +21139,14 @@ var init_orchestrator = __esm({
|
|
|
21031
21139
|
}
|
|
21032
21140
|
cancelSetup(threadRef) {
|
|
21033
21141
|
const thread = this.requireThread(threadRef);
|
|
21034
|
-
const
|
|
21035
|
-
|
|
21142
|
+
const keys = [
|
|
21143
|
+
worktreeSetupProcessKey(thread.worktreePath),
|
|
21144
|
+
...threadsSharingWorktree(thread.worktreePath).map((t) => `${t.id}:setup`)
|
|
21145
|
+
];
|
|
21146
|
+
for (const key of [...new Set(keys)]) {
|
|
21147
|
+
const proc = this.processes.get(key);
|
|
21148
|
+
if (proc) proc.kill();
|
|
21149
|
+
}
|
|
21036
21150
|
}
|
|
21037
21151
|
async applyIntoMain(threadRef, opts) {
|
|
21038
21152
|
const thread = this.requireThread(threadRef);
|
|
@@ -21782,7 +21896,7 @@ init_system_ca();
|
|
|
21782
21896
|
var import_mcp = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
21783
21897
|
var import_stdio = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
21784
21898
|
var import_zod9 = require("zod");
|
|
21785
|
-
var
|
|
21899
|
+
var import_node_crypto13 = require("crypto");
|
|
21786
21900
|
var import_node_path52 = require("path");
|
|
21787
21901
|
init_orchestrator();
|
|
21788
21902
|
init_worktree();
|
|
@@ -22209,7 +22323,7 @@ async function createGitHubIssue(input, opts) {
|
|
|
22209
22323
|
init_fetch();
|
|
22210
22324
|
|
|
22211
22325
|
// src/integrations/linear-oauth.ts
|
|
22212
|
-
var
|
|
22326
|
+
var import_node_crypto11 = require("crypto");
|
|
22213
22327
|
var import_node_http = require("http");
|
|
22214
22328
|
init_app_settings();
|
|
22215
22329
|
init_fetch();
|
|
@@ -25192,7 +25306,7 @@ init_worktree();
|
|
|
25192
25306
|
init_paths();
|
|
25193
25307
|
|
|
25194
25308
|
// src/board/board-pins.ts
|
|
25195
|
-
var
|
|
25309
|
+
var import_node_crypto12 = require("crypto");
|
|
25196
25310
|
var import_node_fs54 = require("fs");
|
|
25197
25311
|
var import_node_path50 = require("path");
|
|
25198
25312
|
init_paths();
|
|
@@ -26041,7 +26155,7 @@ async function startMcpServer() {
|
|
|
26041
26155
|
const ident = issue?.identifier ?? ref.trim();
|
|
26042
26156
|
const attachments = issue ? [
|
|
26043
26157
|
{
|
|
26044
|
-
id: (0,
|
|
26158
|
+
id: (0, import_node_crypto13.randomUUID)(),
|
|
26045
26159
|
name: issue.identifier,
|
|
26046
26160
|
kind: "issue",
|
|
26047
26161
|
content: [
|
package/dist/mcp/run-stdio.js
CHANGED