@staff0rd/assist 0.1185.2 → 0.1185.4
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/.build-files +86 -86
- package/dist/{addActivity-VWFJOAEG.js → addActivity-IJ7GPTGZ.js} +3 -3
- package/dist/{addPhase-I6IY7FEJ.js → addPhase-ORSNDH7W.js} +4 -4
- package/dist/{advise-7I4S5K2M.js → advise-ZVSZMEXH.js} +4 -4
- package/dist/{askCheck-YRVKCMID.js → askCheck-A2XWWDWT.js} +8 -8
- package/dist/{askDesign-SJ3MNPFE.js → askDesign-WMNM7RLO.js} +2 -2
- package/dist/{branch-5QSVUNDX.js → branch-ALJBAHML.js} +4 -4
- package/dist/built-version +1 -1
- package/dist/{chunk-LXL7IJDI.js → chunk-4QF7YVZ5.js} +3 -3
- package/dist/{chunk-N45WGW2P.js → chunk-5MJTFJGT.js} +1 -1
- package/dist/{chunk-SORWZAHF.js → chunk-5QM5VR3J.js} +1 -0
- package/dist/{chunk-WBDH7XCZ.js → chunk-5UX4ZTFR.js} +6 -6
- package/dist/{chunk-PBA5AY4X.js → chunk-7TAUUXVY.js} +1 -1
- package/dist/{chunk-LJF44BOU.js → chunk-AFN4FULQ.js} +1 -1
- package/dist/{chunk-V6HENIYV.js → chunk-CYOY666F.js} +1 -1
- package/dist/{chunk-A5PV6HEK.js → chunk-DZBGDSCK.js} +1 -1
- package/dist/{chunk-KYB4QM5B.js → chunk-E2IZIDQ3.js} +2 -2
- package/dist/{chunk-I7WSEOJX.js → chunk-F42QFS5Z.js} +1 -1
- package/dist/{chunk-ZN6EQMYU.js → chunk-FZDQG67V.js} +2 -2
- package/dist/{chunk-TE2FHIWS.js → chunk-HCYTW3DN.js} +1 -1
- package/dist/{chunk-6K75OLQN.js → chunk-HPV2ZVOX.js} +1 -1
- package/dist/{chunk-I7QJUUQ5.js → chunk-HW4J7F4X.js} +1 -1
- package/dist/{chunk-WGZBTGKA.js → chunk-ICCOBGY5.js} +1 -1
- package/dist/{chunk-DWXXA5BF.js → chunk-IKCS5JTK.js} +1 -1
- package/dist/{chunk-LBTJOD75.js → chunk-JH524KAM.js} +2 -2
- package/dist/{chunk-GURN5643.js → chunk-KTUSVJW3.js} +2 -2
- package/dist/{chunk-Y6P4BRKB.js → chunk-L6SCN5J6.js} +1 -1
- package/dist/{chunk-WMMPGPFK.js → chunk-LKRWILE6.js} +7 -2
- package/dist/{chunk-QCKGNH44.js → chunk-N3QOIXVQ.js} +1 -1
- package/dist/{chunk-4QBROVCM.js → chunk-ND2FWXCR.js} +1 -1
- package/dist/{chunk-NULLVW23.js → chunk-PDXOHW2M.js} +2 -2
- package/dist/{chunk-D4K2EXMS.js → chunk-PNDUTAZR.js} +5 -5
- package/dist/{chunk-UETLXHQ4.js → chunk-QFY6KBY4.js} +1 -1
- package/dist/{chunk-43UV77PT.js → chunk-QQDELJQD.js} +3 -3
- package/dist/{chunk-7OWMI6MW.js → chunk-QQVNL74P.js} +1 -1
- package/dist/{chunk-I5WU4LMN.js → chunk-QYYVW7BX.js} +2 -2
- package/dist/{chunk-EVTO23NP.js → chunk-RSSSZURM.js} +222 -71
- package/dist/{chunk-2BXG4NQG.js → chunk-SN2GTNL4.js} +1 -1
- package/dist/{chunk-7YBIKUGH.js → chunk-SSOJWOYS.js} +1 -1
- package/dist/{chunk-QAU4ACLB.js → chunk-SY4PNEQP.js} +1 -1
- package/dist/{chunk-D47FDWIG.js → chunk-TUTLULTR.js} +1 -1
- package/dist/{chunk-IMEG34TV.js → chunk-UGICWHVH.js} +1 -1
- package/dist/{chunk-YJTFNXDP.js → chunk-VWKPR7P4.js} +1 -1
- package/dist/{chunk-YWAICNEQ.js → chunk-WGDN4CNI.js} +1 -1
- package/dist/{chunk-MKT6HLUK.js → chunk-XTQP2MUZ.js} +1 -1
- package/dist/{chunk-YV2YMBDC.js → chunk-XXUZRL3Q.js} +1 -1
- package/dist/{chunk-KBG335EU.js → chunk-YJL4PXQB.js} +2 -2
- package/dist/{chunk-TPSUKH63.js → chunk-YPHZSKNP.js} +8 -8
- package/dist/{chunk-HUWALF4X.js → chunk-ZDWZ2VI3.js} +1 -1
- package/dist/{cliHook-5QAWK55J.js → cliHook-2K2PQZOJ.js} +7 -7
- package/dist/{cliHookCheck-GUU4GSRL.js → cliHookCheck-AWYDTDE5.js} +3 -3
- package/dist/{codexHook-SJOJJDAN.js → codexHook-HLMVUPGF.js} +9 -9
- package/dist/commands/sessions/web/bundle.js +1 -1
- package/dist/{commit-ZF3ZK5MP.js → commit-TMVTH55J.js} +27 -26
- package/dist/{doctorNodes-VHZ6SPOP.js → doctorNodes-YPC6M4SI.js} +5 -5
- package/dist/{done-N5DKY66V.js → done-3VAD7V2R.js} +5 -5
- package/dist/{editHook-GO3EG666.js → editHook-S6MCRMW4.js} +7 -7
- package/dist/{fixConflict-IZHOVB5C.js → fixConflict-ORCRRXKK.js} +5 -5
- package/dist/index.js +52 -52
- package/dist/{launchMode-JABYPVKP.js → launchMode-V5JZGAQP.js} +15 -15
- package/dist/{list-UPXSS5BF.js → list-ZX7F2OVV.js} +6 -6
- package/dist/{migrate-PUUK4MPL.js → migrate-DLSTMFQW.js} +4 -4
- package/dist/{next-EQJJNYO6.js → next-MUFPBSR3.js} +14 -14
- package/dist/{phaseDone-T7C4KJRU.js → phaseDone-RP54LWOJ.js} +6 -6
- package/dist/{piHook-DB35QCNY.js → piHook-RPXIGRLL.js} +7 -7
- package/dist/{propose-OURQOJ3D.js → propose-AA5ND2CO.js} +5 -5
- package/dist/{refine-UW4PQIIQ.js → refine-B5J2AJSZ.js} +16 -16
- package/dist/{restartDaemon-UXFWI7FO.js → restartDaemon-Y7V2QF3N.js} +2 -2
- package/dist/{restartNode-N7R42QZY.js → restartNode-P4JBLX5L.js} +5 -5
- package/dist/{review-KU6V6DNZ.js → review-5635HCXL.js} +5 -5
- package/dist/{reviewPrComments-QXKVMFOK.js → reviewPrComments-E5Y5AQ7D.js} +5 -5
- package/dist/{rewindPhase-JF5EITNU.js → rewindPhase-S6NGWRFK.js} +9 -9
- package/dist/{run-LQNYRVK6.js → run-TSPTUSMX.js} +12 -12
- package/dist/{run-4776ITKB.js → run-ZRNTAO7O.js} +12 -12
- package/dist/{runDaemon-X22NBEPT.js → runDaemon-Z57GTMCH.js} +68 -38
- package/dist/{runParallelPhase-JDOXAC6I.js → runParallelPhase-V2LPUTA3.js} +8 -8
- package/dist/{runRefine-IQRQBG6Q.js → runRefine-DSGHXEKJ.js} +16 -16
- package/dist/{scan-GPTSBYX7.js → scan-A4DFCQZJ.js} +3 -3
- package/dist/{schemaConfirm-IYKPVP5S.js → schemaConfirm-UDCEVEA7.js} +3 -3
- package/dist/{schemaLock-Y35ITWOU.js → schemaLock-4VUXSRRD.js} +3 -3
- package/dist/{schemaUnlock-2QUPRWYP.js → schemaUnlock-QZRZFQJ4.js} +3 -3
- package/dist/{search-FAXDMX7R.js → search-XUG36ZL2.js} +6 -6
- package/dist/{show-CZRMUDLL.js → show-INQEZ755.js} +4 -4
- package/dist/{show-66M53CNS.js → show-WD57SDPL.js} +4 -4
- package/dist/{signExtension-WBE5CEPS.js → signExtension-7JTRFHE2.js} +1 -1
- package/dist/{update-ESCLMLUB.js → update-W7ANHGDR.js} +2 -2
- package/dist/{updateNode-P4O6UC7J.js → updateNode-4PQFFCTZ.js} +5 -5
- package/dist/{updatePlan-U5UPDSAB.js → updatePlan-PYKAHGKE.js} +5 -5
- package/dist/{web-KGPMM3LG.js → web-CFWILIBT.js} +18 -18
- package/dist/{web-HHQD26QN.js → web-WDK7TZDD.js} +18 -18
- package/package.json +1 -1
|
@@ -25,9 +25,17 @@ import {
|
|
|
25
25
|
import {
|
|
26
26
|
expandTilde
|
|
27
27
|
} from "./chunk-LKDW2GWH.js";
|
|
28
|
+
import {
|
|
29
|
+
loginShellCommand
|
|
30
|
+
} from "./chunk-XXUZRL3Q.js";
|
|
28
31
|
import {
|
|
29
32
|
daemonLog
|
|
30
33
|
} from "./chunk-MRUIXQXS.js";
|
|
34
|
+
import {
|
|
35
|
+
NODE_VERSION_KEY,
|
|
36
|
+
declaredNode,
|
|
37
|
+
resolveNodeSpec
|
|
38
|
+
} from "./chunk-5QM5VR3J.js";
|
|
31
39
|
import {
|
|
32
40
|
getCachedOrigin
|
|
33
41
|
} from "./chunk-FLDRXYEM.js";
|
|
@@ -190,12 +198,20 @@ function allocateTree(requestedCwd, boundTreeRoots, options = {}) {
|
|
|
190
198
|
return { cwd: path, kind: "worktree", created: true, clone, ready };
|
|
191
199
|
}
|
|
192
200
|
|
|
201
|
+
// src/commands/sessions/daemon/worktree/installFailureMessage.ts
|
|
202
|
+
function installFailureMessage(worktreePath, { path, reason, output }) {
|
|
203
|
+
const where = path ? ` in ${path}` : "";
|
|
204
|
+
const tail = output ? `:
|
|
205
|
+
${output}` : "";
|
|
206
|
+
return `worktree ${worktreePath} install${where} failed (${reason})${tail}`;
|
|
207
|
+
}
|
|
208
|
+
|
|
193
209
|
// src/commands/sessions/daemon/worktree/seedWorktree.ts
|
|
194
|
-
import { copyFileSync, existsSync as
|
|
195
|
-
import { dirname as
|
|
210
|
+
import { copyFileSync, existsSync as existsSync4, mkdirSync } from "fs";
|
|
211
|
+
import { dirname as dirname3, join as join4 } from "path";
|
|
196
212
|
|
|
197
213
|
// src/commands/sessions/daemon/worktree/installPaths.ts
|
|
198
|
-
import { resolve } from "path";
|
|
214
|
+
import { resolve as resolve2 } from "path";
|
|
199
215
|
|
|
200
216
|
// src/commands/sessions/daemon/worktree/enclosingPaths.ts
|
|
201
217
|
import { isAbsolute, relative } from "path";
|
|
@@ -238,10 +254,10 @@ function detectInstallCommand(dir) {
|
|
|
238
254
|
import { spawn } from "child_process";
|
|
239
255
|
|
|
240
256
|
// src/commands/sessions/daemon/worktree/installInvocation.ts
|
|
241
|
-
function installInvocation(worktreePath, command) {
|
|
257
|
+
function installInvocation(worktreePath, command, binDir) {
|
|
242
258
|
const windows = /^[A-Za-z]:[\\/]/.test(worktreePath);
|
|
243
259
|
const shell = windows ? "cmd.exe" : process.env.SHELL ?? "bash";
|
|
244
|
-
const args = windows ? ["/c",
|
|
260
|
+
const args = windows ? ["/c", windowsCommand(worktreePath, command, binDir)] : ["-l", "-c", posixCommand(worktreePath, command, binDir)];
|
|
245
261
|
return [
|
|
246
262
|
shell,
|
|
247
263
|
args,
|
|
@@ -249,10 +265,18 @@ function installInvocation(worktreePath, command) {
|
|
|
249
265
|
cwd: worktreePath,
|
|
250
266
|
detached: true,
|
|
251
267
|
windowsHide: true,
|
|
252
|
-
stdio: ["ignore", "
|
|
268
|
+
stdio: ["ignore", "pipe", "pipe"]
|
|
253
269
|
}
|
|
254
270
|
];
|
|
255
271
|
}
|
|
272
|
+
function windowsCommand(worktreePath, command, binDir) {
|
|
273
|
+
const inner = `cd /d ${quoteForCmd(worktreePath)} && ${command}`;
|
|
274
|
+
return binDir ? `set "PATH=${binDir.replaceAll('"', "")};%PATH%" && ${inner}` : inner;
|
|
275
|
+
}
|
|
276
|
+
function posixCommand(worktreePath, command, binDir) {
|
|
277
|
+
const inner = `cd ${quoteForPosixShell(worktreePath)} && ${command}`;
|
|
278
|
+
return binDir ? loginShellCommand(inner, binDir) : inner;
|
|
279
|
+
}
|
|
256
280
|
function quoteForCmd(value) {
|
|
257
281
|
return `"${value.replaceAll('"', "")}"`;
|
|
258
282
|
}
|
|
@@ -260,18 +284,67 @@ function quoteForPosixShell(value) {
|
|
|
260
284
|
return `'${value.replaceAll("'", `'\\''`)}'`;
|
|
261
285
|
}
|
|
262
286
|
|
|
263
|
-
// src/commands/sessions/daemon/worktree/
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
287
|
+
// src/commands/sessions/daemon/worktree/findNodePin.ts
|
|
288
|
+
import { existsSync as existsSync3, readFileSync } from "fs";
|
|
289
|
+
import { dirname as dirname2, join as join3, resolve } from "path";
|
|
290
|
+
var PIN_FILES = [".node-version", ".nvmrc"];
|
|
291
|
+
function readPin(file) {
|
|
292
|
+
if (!existsSync3(file)) return void 0;
|
|
293
|
+
try {
|
|
294
|
+
return readFileSync(file, "utf8").split(/\r?\n/).map((line) => line.trim()).find((line) => line && !line.startsWith("#"));
|
|
295
|
+
} catch {
|
|
296
|
+
return void 0;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
function findNodePin(dir, root) {
|
|
300
|
+
const top = resolve(root);
|
|
301
|
+
let current = resolve(dir);
|
|
302
|
+
for (; ; ) {
|
|
303
|
+
for (const name of PIN_FILES) {
|
|
304
|
+
const file = join3(current, name);
|
|
305
|
+
const spec = readPin(file);
|
|
306
|
+
if (spec) return { file, spec };
|
|
307
|
+
}
|
|
308
|
+
const parent = dirname2(current);
|
|
309
|
+
if (current === top || parent === current) return void 0;
|
|
310
|
+
current = parent;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
// src/commands/sessions/daemon/worktree/resolveInstallNode.ts
|
|
315
|
+
var defaultDeps = {
|
|
316
|
+
resolve: (spec) => resolveNodeSpec(spec),
|
|
317
|
+
declared: declaredNode
|
|
269
318
|
};
|
|
270
|
-
function
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
const
|
|
274
|
-
|
|
319
|
+
function resolveInstallNode(dir, root, deps = defaultDeps) {
|
|
320
|
+
const pin = findNodePin(dir, root);
|
|
321
|
+
if (!pin) return unpinnedNode(deps.declared());
|
|
322
|
+
const resolution = deps.resolve(pin.spec);
|
|
323
|
+
if (!resolution.ok)
|
|
324
|
+
return {
|
|
325
|
+
ok: false,
|
|
326
|
+
error: `${pin.file} pins node "${pin.spec}" but it could not be resolved: ${resolution.error}`
|
|
327
|
+
};
|
|
328
|
+
const { binDir, version } = resolution.node;
|
|
329
|
+
return {
|
|
330
|
+
ok: true,
|
|
331
|
+
binDir,
|
|
332
|
+
description: `node v${version} (${binDir}) pinned by ${pin.file}`
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
function unpinnedNode(declared) {
|
|
336
|
+
if (!declared?.ok)
|
|
337
|
+
return {
|
|
338
|
+
ok: true,
|
|
339
|
+
binDir: void 0,
|
|
340
|
+
description: `the login shell's default node (no .node-version or .nvmrc, and ${NODE_VERSION_KEY} ${declared ? "unresolved" : "unset"})`
|
|
341
|
+
};
|
|
342
|
+
const { binDir, version } = declared.node;
|
|
343
|
+
return {
|
|
344
|
+
ok: true,
|
|
345
|
+
binDir,
|
|
346
|
+
description: `the daemon's node v${version} (${binDir}) from ${NODE_VERSION_KEY}; no .node-version or .nvmrc`
|
|
347
|
+
};
|
|
275
348
|
}
|
|
276
349
|
|
|
277
350
|
// src/commands/sessions/daemon/killTree.ts
|
|
@@ -322,86 +395,155 @@ function stopInstall(worktreePath) {
|
|
|
322
395
|
}
|
|
323
396
|
}
|
|
324
397
|
|
|
325
|
-
// src/commands/sessions/daemon/worktree/
|
|
326
|
-
var
|
|
327
|
-
function
|
|
328
|
-
|
|
329
|
-
const
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
child.
|
|
333
|
-
|
|
334
|
-
|
|
398
|
+
// src/commands/sessions/daemon/worktree/captureOutputTail.ts
|
|
399
|
+
var OUTPUT_TAIL = 2e3;
|
|
400
|
+
function captureOutputTail(child) {
|
|
401
|
+
let output = "";
|
|
402
|
+
const capture = (chunk) => {
|
|
403
|
+
output = (output + chunk.toString()).slice(-OUTPUT_TAIL);
|
|
404
|
+
};
|
|
405
|
+
child.stdout?.on("data", capture);
|
|
406
|
+
child.stderr?.on("data", capture);
|
|
407
|
+
return () => output.trim();
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
// src/commands/sessions/daemon/worktree/missingToolMessage.ts
|
|
411
|
+
var COMMAND_NOT_FOUND_EXIT_CODES = /* @__PURE__ */ new Set([127, 9009]);
|
|
412
|
+
var INSTALL_HINTS = {
|
|
413
|
+
pnpm: "npm install -g pnpm (or: corepack enable pnpm)",
|
|
414
|
+
yarn: "npm install -g yarn (or: corepack enable yarn)",
|
|
415
|
+
bun: "npm install -g bun"
|
|
416
|
+
};
|
|
417
|
+
function missingToolMessage(command, code) {
|
|
418
|
+
if (code === null || !COMMAND_NOT_FOUND_EXIT_CODES.has(code)) return null;
|
|
419
|
+
const tool = command.trim().split(/\s+/)[0];
|
|
420
|
+
const hint = INSTALL_HINTS[tool];
|
|
421
|
+
return hint ? `${tool} is not installed; install it with: ${hint}` : `${tool} is not installed`;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
// src/commands/sessions/daemon/worktree/closeFailure.ts
|
|
425
|
+
function closeFailure(command, code, signal) {
|
|
426
|
+
if (signal) return `signal ${signal}`;
|
|
427
|
+
const missing = missingToolMessage(command, code);
|
|
428
|
+
return missing ? `exit ${code}: ${missing}` : `exit ${code}`;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
// src/commands/sessions/daemon/worktree/watchInstall.ts
|
|
432
|
+
function watchInstall(worktreePath, child, command, where, onDone) {
|
|
433
|
+
const tail = captureOutputTail(child);
|
|
335
434
|
let settled = false;
|
|
336
|
-
const settle = (
|
|
435
|
+
const settle = (failure) => {
|
|
337
436
|
if (settled) return;
|
|
338
437
|
settled = true;
|
|
339
438
|
const stopped = !untrackInstall(worktreePath, child);
|
|
340
|
-
|
|
341
|
-
|
|
439
|
+
const reason = stopped ? "stopped at teardown" : failure;
|
|
440
|
+
if (reason === void 0) {
|
|
441
|
+
daemonLog(`worktree ${worktreePath} install${where} complete`);
|
|
442
|
+
onDone({ ok: true });
|
|
443
|
+
return;
|
|
444
|
+
}
|
|
445
|
+
const output = tail();
|
|
446
|
+
daemonLog(
|
|
447
|
+
`worktree ${worktreePath} install${where} failed (${reason}): ${output || "no output"}`
|
|
448
|
+
);
|
|
449
|
+
onDone({ ok: false, stopped, reason, output });
|
|
342
450
|
};
|
|
343
|
-
child.on(
|
|
344
|
-
"error",
|
|
345
|
-
(error) => settle(false, `failed to start: ${error.message}`)
|
|
346
|
-
);
|
|
451
|
+
child.on("error", (error) => settle(`failed to start: ${error.message}`));
|
|
347
452
|
child.on(
|
|
348
453
|
"close",
|
|
349
|
-
(code, signal) => settle(
|
|
350
|
-
code === 0,
|
|
351
|
-
code === 0 ? "complete" : `failed (${signal ? `signal ${signal}` : `exit ${code}`}): ${missingToolMessage(command, code) ?? (stderr.trim() || "no output")}`
|
|
352
|
-
)
|
|
454
|
+
(code, signal) => settle(code === 0 ? void 0 : closeFailure(command, code, signal))
|
|
353
455
|
);
|
|
354
456
|
}
|
|
355
457
|
|
|
458
|
+
// src/commands/sessions/daemon/worktree/spawnInstall.ts
|
|
459
|
+
function spawnInstall(worktreePath, cwd, command, where, onDone) {
|
|
460
|
+
daemonLog(`worktree ${worktreePath} installing deps${where}: ${command}`);
|
|
461
|
+
const node = resolveInstallNode(cwd, worktreePath);
|
|
462
|
+
if (!node.ok) {
|
|
463
|
+
daemonLog(
|
|
464
|
+
`worktree ${worktreePath} install${where} not run: ${node.error}`
|
|
465
|
+
);
|
|
466
|
+
onDone({ ok: false, stopped: false, reason: node.error, output: "" });
|
|
467
|
+
return;
|
|
468
|
+
}
|
|
469
|
+
daemonLog(
|
|
470
|
+
`worktree ${worktreePath} install${where} runs on ${node.description}`
|
|
471
|
+
);
|
|
472
|
+
const child = spawn(...installInvocation(cwd, command, node.binDir));
|
|
473
|
+
trackInstall(worktreePath, child);
|
|
474
|
+
watchInstall(worktreePath, child, command, where, onDone);
|
|
475
|
+
}
|
|
476
|
+
|
|
356
477
|
// src/commands/sessions/daemon/worktree/startPathInstall.ts
|
|
357
478
|
function startPathInstall(worktreePath, rel, dir, onDone) {
|
|
358
479
|
const command = detectInstallCommand(dir);
|
|
359
480
|
if (!command) {
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
);
|
|
363
|
-
return
|
|
481
|
+
const reason = `no package.json at ${dir}`;
|
|
482
|
+
daemonLog(`worktree ${worktreePath} install in ${rel} failed: ${reason}`);
|
|
483
|
+
onDone({ ok: false, stopped: false, reason, output: "" });
|
|
484
|
+
return;
|
|
364
485
|
}
|
|
365
|
-
spawnInstall(
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
486
|
+
spawnInstall(worktreePath, dir, command, ` in ${rel}`, onDone);
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
// src/commands/sessions/daemon/worktree/pathFailure.ts
|
|
490
|
+
function pathFailure(path, outcome) {
|
|
491
|
+
if (outcome.ok) return void 0;
|
|
492
|
+
return { path, reason: outcome.reason, output: outcome.output };
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
// src/commands/sessions/daemon/worktree/pathsOutcome.ts
|
|
496
|
+
function pathsOutcome(paths, states, failures) {
|
|
497
|
+
const failed = failures.find((failure) => failure !== void 0);
|
|
498
|
+
if (failed) return { ok: false, ...failed };
|
|
499
|
+
const skipped = states.indexOf("skipped");
|
|
500
|
+
if (skipped === -1) return { ok: true };
|
|
501
|
+
return { ok: false, path: paths[skipped], reason: "skipped", output: "" };
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
// src/commands/sessions/daemon/worktree/pathsProgress.ts
|
|
505
|
+
function pathsProgress(paths, states, failures, onInstalling) {
|
|
506
|
+
const running2 = paths.filter((_, i) => states[i] === "running");
|
|
507
|
+
if (running2.length > 0) {
|
|
508
|
+
onInstalling(running2.join(", "));
|
|
509
|
+
return void 0;
|
|
510
|
+
}
|
|
511
|
+
if (states.includes("pending")) return void 0;
|
|
512
|
+
return pathsOutcome(paths, states, failures);
|
|
373
513
|
}
|
|
374
514
|
|
|
375
515
|
// src/commands/sessions/daemon/worktree/installPaths.ts
|
|
376
516
|
function installPaths(worktreePath, paths, onSeeded, onInstalling) {
|
|
377
|
-
const dirs = paths.map((rel) =>
|
|
517
|
+
const dirs = paths.map((rel) => resolve2(worktreePath, rel));
|
|
378
518
|
const enclosing = enclosingPaths(dirs);
|
|
379
519
|
const states = paths.map(() => "pending");
|
|
520
|
+
const failures = paths.map(() => void 0);
|
|
380
521
|
let stopped = false;
|
|
522
|
+
let seeded = false;
|
|
381
523
|
const pump = () => {
|
|
382
524
|
for (let i = 0; i < paths.length; i++) {
|
|
383
525
|
if (states[i] !== "pending") continue;
|
|
384
526
|
const action = pendingPathAction(enclosing[i], states, paths, stopped);
|
|
385
|
-
if (action.kind === "start")
|
|
386
|
-
states[i] =
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
}
|
|
395
|
-
);
|
|
527
|
+
if (action.kind === "start") {
|
|
528
|
+
states[i] = "running";
|
|
529
|
+
startPathInstall(worktreePath, paths[i], dirs[i], (outcome2) => {
|
|
530
|
+
states[i] = outcome2.ok ? "ok" : "failed";
|
|
531
|
+
failures[i] = pathFailure(paths[i], outcome2);
|
|
532
|
+
stopped ||= !outcome2.ok && outcome2.stopped;
|
|
533
|
+
pump();
|
|
534
|
+
});
|
|
535
|
+
}
|
|
396
536
|
if (action.kind !== "skip") continue;
|
|
397
537
|
states[i] = "skipped";
|
|
398
538
|
daemonLog(
|
|
399
539
|
`worktree ${worktreePath} install skipping ${paths[i]}: ${action.reason}`
|
|
400
540
|
);
|
|
401
541
|
}
|
|
402
|
-
const
|
|
403
|
-
if (
|
|
404
|
-
|
|
542
|
+
const outcome = pathsProgress(paths, states, failures, onInstalling);
|
|
543
|
+
if (outcome && !seeded) {
|
|
544
|
+
seeded = true;
|
|
545
|
+
onSeeded(outcome);
|
|
546
|
+
}
|
|
405
547
|
};
|
|
406
548
|
pump();
|
|
407
549
|
}
|
|
@@ -422,11 +564,19 @@ function runInstall(worktreePath, clone, install, onSeeded, onInstalling = () =>
|
|
|
422
564
|
}
|
|
423
565
|
const command = resolveInstallCommand(clone, install);
|
|
424
566
|
if (!command) {
|
|
425
|
-
onSeeded();
|
|
567
|
+
onSeeded({ ok: true });
|
|
426
568
|
return;
|
|
427
569
|
}
|
|
428
570
|
onInstalling();
|
|
429
|
-
spawnInstall(
|
|
571
|
+
spawnInstall(
|
|
572
|
+
worktreePath,
|
|
573
|
+
worktreePath,
|
|
574
|
+
command,
|
|
575
|
+
"",
|
|
576
|
+
(outcome) => onSeeded(
|
|
577
|
+
outcome.ok ? outcome : { ok: false, reason: outcome.reason, output: outcome.output }
|
|
578
|
+
)
|
|
579
|
+
);
|
|
430
580
|
}
|
|
431
581
|
|
|
432
582
|
// src/commands/sessions/daemon/worktree/seedWorktree.ts
|
|
@@ -438,11 +588,11 @@ function seedWorktree(worktreePath, clone, onSeeded = () => {
|
|
|
438
588
|
}
|
|
439
589
|
function copyConfigFiles(worktreePath, clone, copy) {
|
|
440
590
|
for (const rel of copy) {
|
|
441
|
-
const src =
|
|
442
|
-
if (!
|
|
443
|
-
const dest =
|
|
591
|
+
const src = join4(clone, rel);
|
|
592
|
+
if (!existsSync4(src)) continue;
|
|
593
|
+
const dest = join4(worktreePath, rel);
|
|
444
594
|
try {
|
|
445
|
-
mkdirSync(
|
|
595
|
+
mkdirSync(dirname3(dest), { recursive: true });
|
|
446
596
|
copyFileSync(src, dest);
|
|
447
597
|
daemonLog(`worktree ${worktreePath} seeded ${rel}`);
|
|
448
598
|
} catch (error) {
|
|
@@ -470,6 +620,7 @@ function worktreeWithBranch(listing, branch) {
|
|
|
470
620
|
|
|
471
621
|
export {
|
|
472
622
|
allocateTree,
|
|
623
|
+
installFailureMessage,
|
|
473
624
|
killTree,
|
|
474
625
|
stopInstall,
|
|
475
626
|
seedWorktree,
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
} from "./chunk-P56S7RYB.js";
|
|
7
7
|
import {
|
|
8
8
|
resolveRewindPlan
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-JH524KAM.js";
|
|
10
10
|
import {
|
|
11
11
|
resolvePlan
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-QQVNL74P.js";
|
|
13
13
|
import {
|
|
14
14
|
resetPhaseAndDependents,
|
|
15
15
|
updateStatus
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "./chunk-JM57BCD6.js";
|
|
11
11
|
import {
|
|
12
12
|
firstBrokenHop
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-VWKPR7P4.js";
|
|
14
14
|
import {
|
|
15
15
|
describePeerError,
|
|
16
16
|
fetchPeerJson
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
resolveLinkTarget,
|
|
40
40
|
usageWindowKey,
|
|
41
41
|
watcherLogPath
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-PDXOHW2M.js";
|
|
43
43
|
import {
|
|
44
44
|
TRACE_HEADER,
|
|
45
45
|
newTraceId
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
import {
|
|
48
48
|
ASSIST_VERSION,
|
|
49
49
|
PROTOCOL_VERSION
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-ICCOBGY5.js";
|
|
51
51
|
import {
|
|
52
52
|
findLinkSpec
|
|
53
53
|
} from "./chunk-J2PPCMCR.js";
|
|
@@ -84,7 +84,7 @@ import {
|
|
|
84
84
|
} from "./chunk-UJBW7FVI.js";
|
|
85
85
|
import {
|
|
86
86
|
targetConversationEvents
|
|
87
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-FZDQG67V.js";
|
|
88
88
|
import {
|
|
89
89
|
configEntryLayers,
|
|
90
90
|
ghFailure,
|
|
@@ -245,7 +245,7 @@ import {
|
|
|
245
245
|
} from "./chunk-VAFCLLQN.js";
|
|
246
246
|
import {
|
|
247
247
|
rewindItemToPhase
|
|
248
|
-
} from "./chunk-
|
|
248
|
+
} from "./chunk-YJL4PXQB.js";
|
|
249
249
|
import {
|
|
250
250
|
loadItemSummaries,
|
|
251
251
|
phaseUsageTotals,
|
|
@@ -268,7 +268,7 @@ import {
|
|
|
268
268
|
} from "./chunk-H2KHIEQF.js";
|
|
269
269
|
import {
|
|
270
270
|
resolveRewindPlan
|
|
271
|
-
} from "./chunk-
|
|
271
|
+
} from "./chunk-JH524KAM.js";
|
|
272
272
|
import {
|
|
273
273
|
deleteItem,
|
|
274
274
|
getOrigin,
|
|
@@ -317,7 +317,7 @@ import {
|
|
|
317
317
|
discoverSessionJsonlPaths,
|
|
318
318
|
harnessAdapter,
|
|
319
319
|
parseSessionFile
|
|
320
|
-
} from "./chunk-
|
|
320
|
+
} from "./chunk-XXUZRL3Q.js";
|
|
321
321
|
import {
|
|
322
322
|
harnessLabel
|
|
323
323
|
} from "./chunk-DUNO7WBT.js";
|
|
@@ -348,7 +348,7 @@ import {
|
|
|
348
348
|
import {
|
|
349
349
|
ensureDaemonRunning,
|
|
350
350
|
restartDaemon
|
|
351
|
-
} from "./chunk-
|
|
351
|
+
} from "./chunk-L6SCN5J6.js";
|
|
352
352
|
import {
|
|
353
353
|
waitForBuild
|
|
354
354
|
} from "./chunk-4CP23TT2.js";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
decideToolOperations,
|
|
3
3
|
logPolicyDeny
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-QQDELJQD.js";
|
|
5
5
|
import "./chunk-CDU6M5IX.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-WGDN4CNI.js";
|
|
7
|
+
import "./chunk-ZDWZ2VI3.js";
|
|
8
8
|
import "./chunk-CUOHHT2F.js";
|
|
9
9
|
import {
|
|
10
10
|
currentExecutionIdentity
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-F42QFS5Z.js";
|
|
12
12
|
import "./chunk-ZMH7UZNP.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-SY4PNEQP.js";
|
|
14
14
|
import "./chunk-VDXS55BC.js";
|
|
15
15
|
import "./chunk-HKGCLAZ7.js";
|
|
16
16
|
import "./chunk-FPWL4VRC.js";
|
|
@@ -28,7 +28,7 @@ import "./chunk-IBVCCKC3.js";
|
|
|
28
28
|
import "./chunk-FAYB2ZL6.js";
|
|
29
29
|
import {
|
|
30
30
|
claudeAdapter
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-XXUZRL3Q.js";
|
|
32
32
|
import "./chunk-MRUIXQXS.js";
|
|
33
33
|
import "./chunk-DIAC4XYA.js";
|
|
34
34
|
import "./chunk-5SXNWSSH.js";
|
|
@@ -46,7 +46,7 @@ import "./chunk-EW2ZM2PC.js";
|
|
|
46
46
|
import "./chunk-MYH4MQX2.js";
|
|
47
47
|
import "./chunk-XDIVXGPQ.js";
|
|
48
48
|
import "./chunk-ES5IPLDM.js";
|
|
49
|
-
import "./chunk-
|
|
49
|
+
import "./chunk-5QM5VR3J.js";
|
|
50
50
|
import "./chunk-UFSOFNXQ.js";
|
|
51
51
|
import "./chunk-FLDRXYEM.js";
|
|
52
52
|
import "./chunk-GRXFWFGP.js";
|
|
@@ -5,9 +5,9 @@ import {
|
|
|
5
5
|
findTruncatedReadDenyRaw,
|
|
6
6
|
isApprovedRead,
|
|
7
7
|
splitCompound
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-SY4PNEQP.js";
|
|
9
9
|
import "./chunk-VDXS55BC.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-XXUZRL3Q.js";
|
|
11
11
|
import "./chunk-MRUIXQXS.js";
|
|
12
12
|
import "./chunk-DIAC4XYA.js";
|
|
13
13
|
import "./chunk-5SXNWSSH.js";
|
|
@@ -19,7 +19,7 @@ import "./chunk-DUNO7WBT.js";
|
|
|
19
19
|
import "./chunk-BFQSGIN6.js";
|
|
20
20
|
import "./chunk-D7UZLH36.js";
|
|
21
21
|
import "./chunk-XDIVXGPQ.js";
|
|
22
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-5QM5VR3J.js";
|
|
23
23
|
import "./chunk-UFSOFNXQ.js";
|
|
24
24
|
import "./chunk-FLDRXYEM.js";
|
|
25
25
|
import "./chunk-GRXFWFGP.js";
|