@staff0rd/assist 0.1112.11 → 0.1115.0
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/built-version +1 -1
- package/dist/commands/sessions/web/bundle.js +434 -434
- package/dist/index.js +223 -165
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Command } from "commander";
|
|
|
6
6
|
// package.json
|
|
7
7
|
var package_default = {
|
|
8
8
|
name: "@staff0rd/assist",
|
|
9
|
-
version: "0.
|
|
9
|
+
version: "0.1115.0",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -446,13 +446,13 @@ function releaseSpawnLock() {
|
|
|
446
446
|
}
|
|
447
447
|
function spawnDaemon(reason4) {
|
|
448
448
|
const log2 = openSync(daemonPaths.log, "a");
|
|
449
|
-
const
|
|
449
|
+
const child2 = spawn(process.execPath, [process.argv[1], "daemon", "run"], {
|
|
450
450
|
detached: true,
|
|
451
451
|
windowsHide: true,
|
|
452
452
|
stdio: ["ignore", log2, log2],
|
|
453
453
|
env: { ...process.env, ASSIST_DAEMON_SPAWN_REASON: reason4 }
|
|
454
454
|
});
|
|
455
|
-
|
|
455
|
+
child2.unref();
|
|
456
456
|
}
|
|
457
457
|
function delay(ms) {
|
|
458
458
|
return new Promise((resolve35) => setTimeout(resolve35, ms));
|
|
@@ -552,6 +552,13 @@ var durationSchema = z.string().superRefine((value, ctx) => {
|
|
|
552
552
|
}
|
|
553
553
|
});
|
|
554
554
|
|
|
555
|
+
// src/shared/harnessKinds.ts
|
|
556
|
+
var harnessKinds = [
|
|
557
|
+
"claude",
|
|
558
|
+
"codex",
|
|
559
|
+
"pi"
|
|
560
|
+
];
|
|
561
|
+
|
|
555
562
|
// src/shared/hotkeys/hotkeysSchema.ts
|
|
556
563
|
import { z as z2 } from "zod";
|
|
557
564
|
|
|
@@ -764,6 +771,8 @@ var miroExtractSchema = z6.strictObject({
|
|
|
764
771
|
var DEFAULT_BACKUP_DIR = "~/.assist/backups";
|
|
765
772
|
var DEFAULT_BACKUP_STALE_AFTER = "32h";
|
|
766
773
|
var DEFAULT_CLONE_DIR = "~/git";
|
|
774
|
+
var harnessKindSchema = z6.enum(harnessKinds);
|
|
775
|
+
var sessionTypeDefaultsSchema = z6.strictObject({ harness: harnessKindSchema.optional() }).optional();
|
|
767
776
|
var assistConfigShape = {
|
|
768
777
|
advice: z6.strictObject({
|
|
769
778
|
sections: z6.partialRecord(z6.enum(adviceFragmentNames), z6.boolean()).default({}),
|
|
@@ -1008,10 +1017,17 @@ var assistConfigShape = {
|
|
|
1008
1017
|
autoConfirm: z6.boolean().default(false)
|
|
1009
1018
|
}).default({ autoConfirm: false }),
|
|
1010
1019
|
harness: z6.strictObject({
|
|
1011
|
-
engine:
|
|
1020
|
+
engine: harnessKindSchema.default("claude"),
|
|
1012
1021
|
exposeCodexActions: z6.boolean().optional(),
|
|
1013
1022
|
exposePiActions: z6.boolean().optional(),
|
|
1014
|
-
codexModel: z6.string().optional()
|
|
1023
|
+
codexModel: z6.string().optional(),
|
|
1024
|
+
defaults: z6.strictObject({
|
|
1025
|
+
draft: sessionTypeDefaultsSchema,
|
|
1026
|
+
bug: sessionTypeDefaultsSchema,
|
|
1027
|
+
prompt: sessionTypeDefaultsSchema,
|
|
1028
|
+
design: sessionTypeDefaultsSchema,
|
|
1029
|
+
run: sessionTypeDefaultsSchema
|
|
1030
|
+
}).optional()
|
|
1015
1031
|
}).default({ engine: "claude" })
|
|
1016
1032
|
};
|
|
1017
1033
|
var repoConfigSchema = z6.strictObject(assistConfigShape).partial();
|
|
@@ -4849,13 +4865,6 @@ async function daemonLogTail(req, res) {
|
|
|
4849
4865
|
});
|
|
4850
4866
|
}
|
|
4851
4867
|
|
|
4852
|
-
// src/shared/harnessKinds.ts
|
|
4853
|
-
var harnessKinds = [
|
|
4854
|
-
"claude",
|
|
4855
|
-
"codex",
|
|
4856
|
-
"pi"
|
|
4857
|
-
];
|
|
4858
|
-
|
|
4859
4868
|
// src/commands/sessions/shared/conversationFromParams.ts
|
|
4860
4869
|
function isHarnessKind(value) {
|
|
4861
4870
|
return harnessKinds.includes(value);
|
|
@@ -5525,16 +5534,16 @@ function spawnInherit(command, args, options2 = {}) {
|
|
|
5525
5534
|
CLAUDE_CODE_CHILD_SESSION: _childSession,
|
|
5526
5535
|
...env
|
|
5527
5536
|
} = process.env;
|
|
5528
|
-
const
|
|
5537
|
+
const child2 = spawn3(command, args, {
|
|
5529
5538
|
stdio: "inherit",
|
|
5530
5539
|
env: { ...env, ...options2.env },
|
|
5531
5540
|
cwd: options2.cwd
|
|
5532
5541
|
});
|
|
5533
5542
|
const done2 = new Promise((resolve35, reject) => {
|
|
5534
|
-
|
|
5535
|
-
|
|
5543
|
+
child2.on("close", (code) => resolve35(code ?? 0));
|
|
5544
|
+
child2.on("error", reject);
|
|
5536
5545
|
});
|
|
5537
|
-
return { child, done: done2 };
|
|
5546
|
+
return { child: child2, done: done2 };
|
|
5538
5547
|
}
|
|
5539
5548
|
|
|
5540
5549
|
// src/shared/spawnClaude.ts
|
|
@@ -6087,9 +6096,9 @@ function flushBuffer(buffer, onLine) {
|
|
|
6087
6096
|
if (line.trim()) onLine(line);
|
|
6088
6097
|
}
|
|
6089
6098
|
}
|
|
6090
|
-
function attachLineParser(
|
|
6099
|
+
function attachLineParser(child2, onLine) {
|
|
6091
6100
|
let buffer = "";
|
|
6092
|
-
|
|
6101
|
+
child2.stdout?.on("data", (chunk2) => {
|
|
6093
6102
|
buffer += chunk2.toString("utf8");
|
|
6094
6103
|
buffer = flushBuffer(buffer, onLine);
|
|
6095
6104
|
});
|
|
@@ -6099,9 +6108,9 @@ function attachLineParser(child, onLine) {
|
|
|
6099
6108
|
}
|
|
6100
6109
|
|
|
6101
6110
|
// src/commands/review/attachStderrCollector.ts
|
|
6102
|
-
function attachStderrCollector(
|
|
6111
|
+
function attachStderrCollector(child2) {
|
|
6103
6112
|
const state = { value: "" };
|
|
6104
|
-
|
|
6113
|
+
child2.stderr?.on("data", (chunk2) => {
|
|
6105
6114
|
state.value += chunk2.toString("utf8");
|
|
6106
6115
|
});
|
|
6107
6116
|
return state;
|
|
@@ -6425,17 +6434,17 @@ function describeExit(code, signal) {
|
|
|
6425
6434
|
return signal ? `claude was killed (${signal})` : `claude exited ${code}`;
|
|
6426
6435
|
}
|
|
6427
6436
|
async function claudeConnectorRun(run5) {
|
|
6428
|
-
const
|
|
6437
|
+
const child2 = spawn4(harnesses.claude.command, buildClaudeConnectorArgs(run5), {
|
|
6429
6438
|
stdio: ["ignore", "pipe", "pipe"],
|
|
6430
6439
|
windowsHide: true,
|
|
6431
6440
|
timeout: run5.timeoutMs
|
|
6432
6441
|
});
|
|
6433
6442
|
const stream = createClaudeConnectorStream(run5.onEvent);
|
|
6434
|
-
const flush = attachLineParser(
|
|
6435
|
-
const stderr = attachStderrCollector(
|
|
6443
|
+
const flush = attachLineParser(child2, stream.onLine);
|
|
6444
|
+
const stderr = attachStderrCollector(child2);
|
|
6436
6445
|
const exit = await new Promise((resolve35, reject) => {
|
|
6437
|
-
|
|
6438
|
-
|
|
6446
|
+
child2.on("error", reject);
|
|
6447
|
+
child2.on("close", (code, signal) => resolve35(describeExit(code, signal)));
|
|
6439
6448
|
});
|
|
6440
6449
|
flush();
|
|
6441
6450
|
const tail = stderr.value.trim().slice(-500);
|
|
@@ -6619,9 +6628,9 @@ function finaliseReviewerRun(spec, spinner, result) {
|
|
|
6619
6628
|
import { spawn as spawn5 } from "child_process";
|
|
6620
6629
|
|
|
6621
6630
|
// src/commands/review/attachStdoutTail.ts
|
|
6622
|
-
function attachStdoutTail(
|
|
6631
|
+
function attachStdoutTail(child2, maxBytes = 8192) {
|
|
6623
6632
|
const state = { value: "" };
|
|
6624
|
-
|
|
6633
|
+
child2.stdout?.on("data", (chunk2) => {
|
|
6625
6634
|
state.value += chunk2.toString("utf8");
|
|
6626
6635
|
if (state.value.length > maxBytes) {
|
|
6627
6636
|
state.value = state.value.slice(state.value.length - maxBytes);
|
|
@@ -6779,34 +6788,34 @@ function waitForChildExit(ctx) {
|
|
|
6779
6788
|
}
|
|
6780
6789
|
|
|
6781
6790
|
// src/commands/review/runStreamingChild.ts
|
|
6782
|
-
function writeStdinSafely(
|
|
6783
|
-
|
|
6791
|
+
function writeStdinSafely(child2, payload) {
|
|
6792
|
+
child2.stdin?.on("error", () => {
|
|
6784
6793
|
});
|
|
6785
6794
|
try {
|
|
6786
|
-
|
|
6787
|
-
|
|
6795
|
+
child2.stdin?.write(payload);
|
|
6796
|
+
child2.stdin?.end();
|
|
6788
6797
|
} catch {
|
|
6789
6798
|
}
|
|
6790
6799
|
}
|
|
6791
6800
|
function startChild(spec) {
|
|
6792
|
-
const
|
|
6801
|
+
const child2 = spawn5(spec.command, spec.args, {
|
|
6793
6802
|
stdio: ["pipe", "pipe", "pipe"],
|
|
6794
6803
|
shell: process.platform === "win32",
|
|
6795
6804
|
...spec.env ? { env: { ...process.env, ...spec.env } } : {}
|
|
6796
6805
|
});
|
|
6797
|
-
const flushPending = attachLineParser(
|
|
6798
|
-
const stderr = attachStderrCollector(
|
|
6799
|
-
const stdout = attachStdoutTail(
|
|
6800
|
-
writeStdinSafely(
|
|
6801
|
-
return { child, flushPending, stderr, stdout };
|
|
6806
|
+
const flushPending = attachLineParser(child2, spec.onLine);
|
|
6807
|
+
const stderr = attachStderrCollector(child2);
|
|
6808
|
+
const stdout = attachStdoutTail(child2);
|
|
6809
|
+
writeStdinSafely(child2, spec.stdin);
|
|
6810
|
+
return { child: child2, flushPending, stderr, stdout };
|
|
6802
6811
|
}
|
|
6803
6812
|
function runStreamingChild(spec) {
|
|
6804
6813
|
const startedAt = Date.now();
|
|
6805
6814
|
if (!spec.quiet)
|
|
6806
6815
|
console.log(`[${reviewerLabel(spec.name, spec.model)}] starting`);
|
|
6807
|
-
const { child, flushPending, stderr, stdout } = startChild(spec);
|
|
6816
|
+
const { child: child2, flushPending, stderr, stdout } = startChild(spec);
|
|
6808
6817
|
return waitForChildExit({
|
|
6809
|
-
child,
|
|
6818
|
+
child: child2,
|
|
6810
6819
|
flushPending,
|
|
6811
6820
|
stderr,
|
|
6812
6821
|
stdout,
|
|
@@ -9453,7 +9462,7 @@ function objectConfigNode(inner, base, build2) {
|
|
|
9453
9462
|
const shape = inner.def?.shape;
|
|
9454
9463
|
if (inner.def?.type !== "object" || !shape) return void 0;
|
|
9455
9464
|
const fields = Object.entries(shape).map(
|
|
9456
|
-
([name2,
|
|
9465
|
+
([name2, child2]) => build2(child2, [...base.path, { kind: "key", name: name2 }])
|
|
9457
9466
|
);
|
|
9458
9467
|
return { ...base, kind: "object", fields };
|
|
9459
9468
|
}
|
|
@@ -9641,9 +9650,9 @@ function isPlainRecord(value) {
|
|
|
9641
9650
|
function mapChildren(value, path118, childNode, map) {
|
|
9642
9651
|
if (!isPlainRecord(value)) return value;
|
|
9643
9652
|
return Object.fromEntries(
|
|
9644
|
-
Object.entries(value).map(([name2,
|
|
9653
|
+
Object.entries(value).map(([name2, child2]) => [
|
|
9645
9654
|
name2,
|
|
9646
|
-
walk(
|
|
9655
|
+
walk(child2, [...path118, name2], childNode(name2), map)
|
|
9647
9656
|
])
|
|
9648
9657
|
);
|
|
9649
9658
|
}
|
|
@@ -9874,6 +9883,22 @@ var harnessConfigHelp = [
|
|
|
9874
9883
|
}
|
|
9875
9884
|
];
|
|
9876
9885
|
|
|
9886
|
+
// src/commands/backlog/harnessDefaultsConfigHelp.ts
|
|
9887
|
+
var launches = {
|
|
9888
|
+
draft: "draft sessions (assist draft, New Session dialog)",
|
|
9889
|
+
bug: "bug sessions (assist bug, New Session dialog)",
|
|
9890
|
+
prompt: "prompt sessions in the New Session dialog",
|
|
9891
|
+
design: "design sessions in the New Session dialog",
|
|
9892
|
+
run: "backlog runs (assist backlog run, web Start buttons)"
|
|
9893
|
+
};
|
|
9894
|
+
var harnessDefaultsConfigHelp = Object.entries(
|
|
9895
|
+
launches
|
|
9896
|
+
).map(([type, launch]) => ({
|
|
9897
|
+
key: `harness.defaults.${type}.harness`,
|
|
9898
|
+
setter: `assist config set harness.defaults.${type}.harness <claude|codex|pi>`,
|
|
9899
|
+
note: `harness for ${launch} when none is picked; unset falls back to harness.engine`
|
|
9900
|
+
}));
|
|
9901
|
+
|
|
9877
9902
|
// src/commands/inbox/inboxConfigHelp.ts
|
|
9878
9903
|
var inboxConfigHelp = [
|
|
9879
9904
|
{
|
|
@@ -10564,6 +10589,7 @@ var configHelpEntries = [
|
|
|
10564
10589
|
...devlogConfigHelp,
|
|
10565
10590
|
...dotnetConfigHelp,
|
|
10566
10591
|
...harnessConfigHelp,
|
|
10592
|
+
...harnessDefaultsConfigHelp,
|
|
10567
10593
|
...inboxConfigHelp,
|
|
10568
10594
|
...jiraConfigHelp,
|
|
10569
10595
|
...litellmConfigHelp,
|
|
@@ -15033,24 +15059,24 @@ function runCommandToCompletion(command, args, env, cwd, quiet) {
|
|
|
15033
15059
|
});
|
|
15034
15060
|
return;
|
|
15035
15061
|
}
|
|
15036
|
-
const
|
|
15062
|
+
const child2 = spawn6(resolveCommand(command), args, {
|
|
15037
15063
|
stdio: quiet ? "pipe" : "inherit",
|
|
15038
15064
|
env: env ? { ...process.env, ...expandEnv(env) } : void 0,
|
|
15039
15065
|
cwd
|
|
15040
15066
|
});
|
|
15041
15067
|
const chunks = [];
|
|
15042
15068
|
if (quiet) {
|
|
15043
|
-
|
|
15044
|
-
|
|
15069
|
+
child2.stdout?.on("data", (data) => chunks.push(data));
|
|
15070
|
+
child2.stderr?.on("data", (data) => chunks.push(data));
|
|
15045
15071
|
}
|
|
15046
|
-
|
|
15072
|
+
child2.on("close", (code) => {
|
|
15047
15073
|
resolveResult({
|
|
15048
15074
|
kind: "completed",
|
|
15049
15075
|
exitCode: code ?? 0,
|
|
15050
15076
|
output: Buffer.concat(chunks).toString()
|
|
15051
15077
|
});
|
|
15052
15078
|
});
|
|
15053
|
-
|
|
15079
|
+
child2.on("error", (err) => {
|
|
15054
15080
|
resolveResult({
|
|
15055
15081
|
kind: "failed",
|
|
15056
15082
|
message: `Failed to execute command: ${err.message}`
|
|
@@ -15135,6 +15161,31 @@ async function revertDiffPaths(req, res) {
|
|
|
15135
15161
|
respondJson(res, 200, { reverted, failed: failed3 });
|
|
15136
15162
|
}
|
|
15137
15163
|
|
|
15164
|
+
// src/commands/sessions/web/newSessionDefaults/resolveDialogHarnesses.ts
|
|
15165
|
+
var harnessShape = assistConfigSchema.shape.harness.unwrap().shape;
|
|
15166
|
+
var engineSchema = harnessShape.engine;
|
|
15167
|
+
var typeHarnessSchema = harnessShape.defaults.unwrap().shape.draft.unwrap().shape.harness;
|
|
15168
|
+
var dialogTypes = ["draft", "bug", "prompt", "design"];
|
|
15169
|
+
function child(value, key) {
|
|
15170
|
+
if (!value || typeof value !== "object") return void 0;
|
|
15171
|
+
return value[key];
|
|
15172
|
+
}
|
|
15173
|
+
function resolveDialogHarnesses(raw) {
|
|
15174
|
+
const harness = child(raw, "harness");
|
|
15175
|
+
const engine = engineSchema.safeParse(child(harness, "engine"));
|
|
15176
|
+
if (!engine.success) return { error: "harness.engine" };
|
|
15177
|
+
const defaults = child(harness, "defaults");
|
|
15178
|
+
const harnesses2 = {};
|
|
15179
|
+
for (const type of dialogTypes) {
|
|
15180
|
+
const parsed = typeHarnessSchema.safeParse(
|
|
15181
|
+
child(child(defaults, type), "harness")
|
|
15182
|
+
);
|
|
15183
|
+
if (!parsed.success) return { error: `harness.defaults.${type}.harness` };
|
|
15184
|
+
harnesses2[type] = parsed.data ?? engine.data;
|
|
15185
|
+
}
|
|
15186
|
+
return { harnesses: harnesses2 };
|
|
15187
|
+
}
|
|
15188
|
+
|
|
15138
15189
|
// src/commands/sessions/web/newSessionDefaults.ts
|
|
15139
15190
|
var newSessionModeSchema = assistConfigSchema.shape.sessions.unwrap().shape.newSessionMode;
|
|
15140
15191
|
function configuredMode(raw) {
|
|
@@ -15161,7 +15212,12 @@ function newSessionDefaults(req, res) {
|
|
|
15161
15212
|
});
|
|
15162
15213
|
return;
|
|
15163
15214
|
}
|
|
15164
|
-
|
|
15215
|
+
const resolved = resolveDialogHarnesses(raw);
|
|
15216
|
+
if ("error" in resolved) {
|
|
15217
|
+
respondJson(res, 422, { error: `Invalid config ${resolved.error}` });
|
|
15218
|
+
return;
|
|
15219
|
+
}
|
|
15220
|
+
respondJson(res, 200, { mode: parsed.data, harnesses: resolved.harnesses });
|
|
15165
15221
|
}
|
|
15166
15222
|
|
|
15167
15223
|
// src/commands/sessions/nodes/fetchPeerJson.ts
|
|
@@ -15992,9 +16048,9 @@ function configLeafSchema(schema2, key) {
|
|
|
15992
16048
|
let current2 = schema2;
|
|
15993
16049
|
for (const name2 of key.split(".")) {
|
|
15994
16050
|
const { inner } = unwrapSchemaNode(current2);
|
|
15995
|
-
const
|
|
15996
|
-
if (!
|
|
15997
|
-
current2 =
|
|
16051
|
+
const child2 = inner.def?.type === "object" ? inner.def.shape?.[name2] : void 0;
|
|
16052
|
+
if (!child2) return void 0;
|
|
16053
|
+
current2 = child2;
|
|
15998
16054
|
}
|
|
15999
16055
|
return current2;
|
|
16000
16056
|
}
|
|
@@ -16606,24 +16662,24 @@ function withoutKey(container, key) {
|
|
|
16606
16662
|
const { [key]: _deleted, ...rest } = container;
|
|
16607
16663
|
return rest;
|
|
16608
16664
|
}
|
|
16609
|
-
function withChild(container, key,
|
|
16665
|
+
function withChild(container, key, child2) {
|
|
16610
16666
|
if (Array.isArray(container)) {
|
|
16611
16667
|
const next3 = [...container];
|
|
16612
|
-
next3[toIndex(key)] =
|
|
16668
|
+
next3[toIndex(key)] = child2;
|
|
16613
16669
|
return next3;
|
|
16614
16670
|
}
|
|
16615
|
-
return { ...container, [key]:
|
|
16671
|
+
return { ...container, [key]: child2 };
|
|
16616
16672
|
}
|
|
16617
16673
|
function isPrunable(container) {
|
|
16618
16674
|
return isPlainObject3(container) && Object.keys(container).length === 0;
|
|
16619
16675
|
}
|
|
16620
|
-
function replaceOrPrune(container, key,
|
|
16621
|
-
return isPrunable(
|
|
16676
|
+
function replaceOrPrune(container, key, child2) {
|
|
16677
|
+
return isPrunable(child2) ? withoutKey(container, key) : withChild(container, key, child2);
|
|
16622
16678
|
}
|
|
16623
16679
|
function removeFromChild(container, key, rest) {
|
|
16624
|
-
const
|
|
16625
|
-
if (!isContainer(
|
|
16626
|
-
const inner = removeAt(
|
|
16680
|
+
const child2 = getItem2(container, key);
|
|
16681
|
+
if (!isContainer(child2)) return { container, removed: false };
|
|
16682
|
+
const inner = removeAt(child2, rest);
|
|
16627
16683
|
if (!inner.removed) return { container, removed: false };
|
|
16628
16684
|
return {
|
|
16629
16685
|
container: replaceOrPrune(container, key, inner.container),
|
|
@@ -19357,11 +19413,11 @@ function spawnCommand(fullCommand, cwd, env, quiet) {
|
|
|
19357
19413
|
env: env ? { ...process.env, ...expandEnv(env) } : void 0
|
|
19358
19414
|
});
|
|
19359
19415
|
}
|
|
19360
|
-
function collectOutput(
|
|
19416
|
+
function collectOutput(child2, quiet) {
|
|
19361
19417
|
if (!shouldSuppress(quiet)) return [];
|
|
19362
19418
|
const chunks = [];
|
|
19363
|
-
|
|
19364
|
-
|
|
19419
|
+
child2.stdout?.on("data", (data) => chunks.push(data));
|
|
19420
|
+
child2.stderr?.on("data", (data) => chunks.push(data));
|
|
19365
19421
|
return chunks;
|
|
19366
19422
|
}
|
|
19367
19423
|
function flushIfFailed(exitCode, chunks) {
|
|
@@ -19381,14 +19437,14 @@ ${failed3.length} script(s) failed:`);
|
|
|
19381
19437
|
function runEntry(entry) {
|
|
19382
19438
|
return new Promise((resolve35) => {
|
|
19383
19439
|
const startTime = Date.now();
|
|
19384
|
-
const
|
|
19440
|
+
const child2 = spawnCommand(
|
|
19385
19441
|
entry.fullCommand,
|
|
19386
19442
|
entry.cwd,
|
|
19387
19443
|
entry.env,
|
|
19388
19444
|
entry.quiet
|
|
19389
19445
|
);
|
|
19390
|
-
const chunks = collectOutput(
|
|
19391
|
-
|
|
19446
|
+
const chunks = collectOutput(child2, entry.quiet);
|
|
19447
|
+
child2.on("close", (code) => {
|
|
19392
19448
|
const exitCode = code ?? 1;
|
|
19393
19449
|
flushIfFailed(exitCode, chunks);
|
|
19394
19450
|
resolve35({
|
|
@@ -21164,10 +21220,10 @@ function buildGraph(names, edges) {
|
|
|
21164
21220
|
const present = new Set(names);
|
|
21165
21221
|
const indegree = new Map(names.map((n) => [n, 0]));
|
|
21166
21222
|
const children = /* @__PURE__ */ new Map();
|
|
21167
|
-
for (const { child, parent } of edges) {
|
|
21168
|
-
if (!present.has(
|
|
21169
|
-
indegree.set(
|
|
21170
|
-
children.set(parent, [...children.get(parent) ?? [],
|
|
21223
|
+
for (const { child: child2, parent } of edges) {
|
|
21224
|
+
if (!present.has(child2) || !present.has(parent)) continue;
|
|
21225
|
+
indegree.set(child2, (indegree.get(child2) ?? 0) + 1);
|
|
21226
|
+
children.set(parent, [...children.get(parent) ?? [], child2]);
|
|
21171
21227
|
}
|
|
21172
21228
|
return { indegree, children };
|
|
21173
21229
|
}
|
|
@@ -21186,8 +21242,8 @@ function topoSort(entries, edges) {
|
|
|
21186
21242
|
throw new Error("Cannot dump: foreign-key cycle between tables.");
|
|
21187
21243
|
emitted.add(next3);
|
|
21188
21244
|
ordered.push(byRaw.get(next3));
|
|
21189
|
-
for (const
|
|
21190
|
-
indegree.set(
|
|
21245
|
+
for (const child2 of children.get(next3) ?? []) {
|
|
21246
|
+
indegree.set(child2, (indegree.get(child2) ?? 0) - 1);
|
|
21191
21247
|
}
|
|
21192
21248
|
}
|
|
21193
21249
|
return ordered;
|
|
@@ -23884,7 +23940,7 @@ function readSignal() {
|
|
|
23884
23940
|
}
|
|
23885
23941
|
|
|
23886
23942
|
// src/commands/backlog/watchForMarker.ts
|
|
23887
|
-
function watchForMarker(
|
|
23943
|
+
function watchForMarker(child2, options2) {
|
|
23888
23944
|
let killed = false;
|
|
23889
23945
|
const statusPath = getSignalPath();
|
|
23890
23946
|
if (!statusPath) return { killedOnMarker: () => killed };
|
|
@@ -23895,7 +23951,7 @@ function watchForMarker(child, options2) {
|
|
|
23895
23951
|
if (signal.event === "done" && !options2?.actOnDone) return;
|
|
23896
23952
|
unwatchFile(statusPath);
|
|
23897
23953
|
killed = true;
|
|
23898
|
-
|
|
23954
|
+
child2.kill("SIGTERM");
|
|
23899
23955
|
});
|
|
23900
23956
|
return { killedOnMarker: () => killed };
|
|
23901
23957
|
}
|
|
@@ -23909,12 +23965,12 @@ async function launchPhaseClaude(prompt, spawnOptions, context, harness) {
|
|
|
23909
23965
|
const adapter = harnessAdapter(harness);
|
|
23910
23966
|
const cwd = process.cwd();
|
|
23911
23967
|
const { allowEdits, resumeSessionId, sessionId: sessionId2 } = spawnOptions;
|
|
23912
|
-
const { child, done: done2 } = resumeSessionId ? adapter.resume(resumeSessionId, prompt, { cwd, allowEdits }) : adapter.launchPrompt(prompt, {
|
|
23968
|
+
const { child: child2, done: done2 } = resumeSessionId ? adapter.resume(resumeSessionId, prompt, { cwd, allowEdits }) : adapter.launchPrompt(prompt, {
|
|
23913
23969
|
cwd,
|
|
23914
23970
|
allowEdits,
|
|
23915
23971
|
conversationId: sessionId2
|
|
23916
23972
|
});
|
|
23917
|
-
watchForMarker(
|
|
23973
|
+
watchForMarker(child2);
|
|
23918
23974
|
const exitCode = await awaitHarness(done2, context, adapter.label);
|
|
23919
23975
|
stopWatching();
|
|
23920
23976
|
return exitCode;
|
|
@@ -24689,8 +24745,8 @@ async function launchMode(slashCommand, options2) {
|
|
|
24689
24745
|
}
|
|
24690
24746
|
if (!resumeSessionId) await pullIfConfigured();
|
|
24691
24747
|
process.env.ASSIST_SESSION_ID ??= String(process.pid);
|
|
24692
|
-
const { child, done: done2 } = spawnLaunch(adapter, slashCommand, options2 ?? {});
|
|
24693
|
-
const marker2 = watchForMarker(
|
|
24748
|
+
const { child: child2, done: done2 } = spawnLaunch(adapter, slashCommand, options2 ?? {});
|
|
24749
|
+
const marker2 = watchForMarker(child2, { actOnDone: options2?.once });
|
|
24694
24750
|
const exitCode = await awaitHarness(done2, `/${slashCommand}`, adapter.label);
|
|
24695
24751
|
stopWatching();
|
|
24696
24752
|
if (exitCode === HARNESS_SPAWN_FAILED) return;
|
|
@@ -24741,9 +24797,10 @@ async function refine(id, options2) {
|
|
|
24741
24797
|
}
|
|
24742
24798
|
|
|
24743
24799
|
// src/commands/backlog/resolveHarness.ts
|
|
24744
|
-
function resolveHarness2(value) {
|
|
24800
|
+
function resolveHarness2(value, type) {
|
|
24745
24801
|
if (value === "claude" || value === "codex" || value === "pi") return value;
|
|
24746
|
-
|
|
24802
|
+
const { harness } = loadConfig();
|
|
24803
|
+
return type && harness.defaults?.[type]?.harness || harness.engine;
|
|
24747
24804
|
}
|
|
24748
24805
|
|
|
24749
24806
|
// src/commands/backlog/registerRefineCommand.ts
|
|
@@ -24820,9 +24877,9 @@ function registerRewindCommand(cmd) {
|
|
|
24820
24877
|
|
|
24821
24878
|
// src/commands/backlog/registerRunCommand.ts
|
|
24822
24879
|
function registerRunCommand(cmd) {
|
|
24823
|
-
cmd.command("run <id>").description("Run a backlog item's plan phase-by-phase").option("-w, --write", "Run the harness with write access (default)").option("--no-write", "Run the harness without write access").option(
|
|
24880
|
+
const command = cmd.command("run <id>").description("Run a backlog item's plan phase-by-phase").option("-w, --write", "Run the harness with write access (default)").option("--no-write", "Run the harness without write access").option(
|
|
24824
24881
|
"--harness <harness>",
|
|
24825
|
-
"Coding harness to launch (claude|codex|pi); defaults to the configured harness.engine"
|
|
24882
|
+
"Coding harness to launch (claude|codex|pi); defaults to the configured harness.defaults.run.harness, then harness.engine"
|
|
24826
24883
|
).option(
|
|
24827
24884
|
"--resume-session <id>",
|
|
24828
24885
|
"Resume an interrupted Claude session for the current phase (used by the sessions daemon on restart)"
|
|
@@ -24831,11 +24888,12 @@ function registerRunCommand(cmd) {
|
|
|
24831
24888
|
if (!opts.resumeSession) await pullIfConfigured();
|
|
24832
24889
|
await run3(id, {
|
|
24833
24890
|
allowEdits: opts.write !== false,
|
|
24834
|
-
harness: resolveHarness2(opts.harness),
|
|
24891
|
+
harness: resolveHarness2(opts.harness, "run"),
|
|
24835
24892
|
resumeSessionId: opts.resumeSession
|
|
24836
24893
|
});
|
|
24837
24894
|
}
|
|
24838
24895
|
);
|
|
24896
|
+
configHelp(command, [...harnessConfigHelp, ...harnessDefaultsConfigHelp]);
|
|
24839
24897
|
}
|
|
24840
24898
|
|
|
24841
24899
|
// src/commands/backlog/search.ts
|
|
@@ -28068,11 +28126,11 @@ function showWindowsNotificationFromWsl(options2) {
|
|
|
28068
28126
|
if (sound) {
|
|
28069
28127
|
args.push("-s", "ms-winsoundevent:Notification.Default");
|
|
28070
28128
|
}
|
|
28071
|
-
const
|
|
28129
|
+
const child2 = spawn8(snoreToastPath, args, {
|
|
28072
28130
|
detached: true,
|
|
28073
28131
|
stdio: "ignore"
|
|
28074
28132
|
});
|
|
28075
|
-
|
|
28133
|
+
child2.unref();
|
|
28076
28134
|
return true;
|
|
28077
28135
|
}
|
|
28078
28136
|
|
|
@@ -28414,7 +28472,7 @@ import { spawn as spawn9 } from "child_process";
|
|
|
28414
28472
|
import { createInterface as createInterface6 } from "readline";
|
|
28415
28473
|
|
|
28416
28474
|
// src/commands/sync/createCodexRpcClient.ts
|
|
28417
|
-
function createCodexRpcClient(
|
|
28475
|
+
function createCodexRpcClient(child2, pending, timer) {
|
|
28418
28476
|
let nextId = 0;
|
|
28419
28477
|
return {
|
|
28420
28478
|
call(method, params) {
|
|
@@ -28425,15 +28483,15 @@ function createCodexRpcClient(child, pending, timer) {
|
|
|
28425
28483
|
resolve: resolve35,
|
|
28426
28484
|
reject
|
|
28427
28485
|
});
|
|
28428
|
-
|
|
28486
|
+
child2.stdin.write(`${JSON.stringify({ id, method, params })}
|
|
28429
28487
|
`);
|
|
28430
28488
|
});
|
|
28431
28489
|
},
|
|
28432
28490
|
close() {
|
|
28433
28491
|
clearTimeout(timer);
|
|
28434
|
-
|
|
28435
|
-
|
|
28436
|
-
|
|
28492
|
+
child2.removeAllListeners("exit");
|
|
28493
|
+
child2.stdin.end();
|
|
28494
|
+
child2.kill();
|
|
28437
28495
|
}
|
|
28438
28496
|
};
|
|
28439
28497
|
}
|
|
@@ -28462,15 +28520,15 @@ function routeCodexRpcLine(line, pending) {
|
|
|
28462
28520
|
}
|
|
28463
28521
|
|
|
28464
28522
|
// src/commands/sync/watchCodexAppServer.ts
|
|
28465
|
-
function watchCodexAppServer(
|
|
28523
|
+
function watchCodexAppServer(child2, fail15) {
|
|
28466
28524
|
let stderr = "";
|
|
28467
|
-
|
|
28525
|
+
child2.stderr.on("data", (chunk2) => {
|
|
28468
28526
|
stderr += chunk2;
|
|
28469
28527
|
});
|
|
28470
|
-
|
|
28471
|
-
|
|
28528
|
+
child2.on("error", fail15);
|
|
28529
|
+
child2.stdin.on("error", () => {
|
|
28472
28530
|
});
|
|
28473
|
-
|
|
28531
|
+
child2.on(
|
|
28474
28532
|
"exit",
|
|
28475
28533
|
(code) => fail15(
|
|
28476
28534
|
new Error(
|
|
@@ -28483,7 +28541,7 @@ function watchCodexAppServer(child, fail15) {
|
|
|
28483
28541
|
// src/commands/sync/openCodexAppServer.ts
|
|
28484
28542
|
var TIMEOUT_MS3 = 2e4;
|
|
28485
28543
|
async function openCodexAppServer(homeDir) {
|
|
28486
|
-
const
|
|
28544
|
+
const child2 = spawn9(harnesses.codex.command, ["app-server"], {
|
|
28487
28545
|
env: { ...process.env, CODEX_HOME: homeDir },
|
|
28488
28546
|
stdio: ["pipe", "pipe", "pipe"]
|
|
28489
28547
|
});
|
|
@@ -28492,8 +28550,8 @@ async function openCodexAppServer(homeDir) {
|
|
|
28492
28550
|
for (const entry of pending.values()) entry.reject(error);
|
|
28493
28551
|
pending.clear();
|
|
28494
28552
|
};
|
|
28495
|
-
watchCodexAppServer(
|
|
28496
|
-
createInterface6({ input:
|
|
28553
|
+
watchCodexAppServer(child2, failAll);
|
|
28554
|
+
createInterface6({ input: child2.stdout }).on(
|
|
28497
28555
|
"line",
|
|
28498
28556
|
(line) => routeCodexRpcLine(line, pending)
|
|
28499
28557
|
);
|
|
@@ -28501,7 +28559,7 @@ async function openCodexAppServer(homeDir) {
|
|
|
28501
28559
|
() => failAll(new Error("codex app-server did not respond in time")),
|
|
28502
28560
|
TIMEOUT_MS3
|
|
28503
28561
|
);
|
|
28504
|
-
const server = createCodexRpcClient(
|
|
28562
|
+
const server = createCodexRpcClient(child2, pending, timer);
|
|
28505
28563
|
try {
|
|
28506
28564
|
await server.call("initialize", {
|
|
28507
28565
|
clientInfo: { name: "assist", version: "0" }
|
|
@@ -28510,7 +28568,7 @@ async function openCodexAppServer(homeDir) {
|
|
|
28510
28568
|
server.close();
|
|
28511
28569
|
throw startupError(error);
|
|
28512
28570
|
}
|
|
28513
|
-
|
|
28571
|
+
child2.stdin.write(`${JSON.stringify({ method: "initialized" })}
|
|
28514
28572
|
`);
|
|
28515
28573
|
return server;
|
|
28516
28574
|
}
|
|
@@ -32680,9 +32738,9 @@ function buildTree(csprojPath, repoRoot3, visited = /* @__PURE__ */ new Set()) {
|
|
|
32680
32738
|
function collectAllDeps(node) {
|
|
32681
32739
|
const result = /* @__PURE__ */ new Set();
|
|
32682
32740
|
function walk2(n) {
|
|
32683
|
-
for (const
|
|
32684
|
-
result.add(
|
|
32685
|
-
walk2(
|
|
32741
|
+
for (const child2 of n.children) {
|
|
32742
|
+
result.add(child2.path);
|
|
32743
|
+
walk2(child2);
|
|
32686
32744
|
}
|
|
32687
32745
|
}
|
|
32688
32746
|
walk2(node);
|
|
@@ -32768,9 +32826,9 @@ ${totalCount} projects total (including root)`));
|
|
|
32768
32826
|
console.log();
|
|
32769
32827
|
}
|
|
32770
32828
|
function nodesToJson(node) {
|
|
32771
|
-
return node.children.map((
|
|
32772
|
-
project:
|
|
32773
|
-
dependencies: nodesToJson(
|
|
32829
|
+
return node.children.map((child2) => ({
|
|
32830
|
+
project: child2.relativePath,
|
|
32831
|
+
dependencies: nodesToJson(child2)
|
|
32774
32832
|
}));
|
|
32775
32833
|
}
|
|
32776
32834
|
function printJson(tree, totalCount, solutions) {
|
|
@@ -34280,7 +34338,7 @@ function parseIssueNode(node) {
|
|
|
34280
34338
|
repo,
|
|
34281
34339
|
typeName: raw.issueType?.name ?? null,
|
|
34282
34340
|
labels: (raw.labels?.nodes ?? []).filter((label) => label !== null),
|
|
34283
|
-
childIds: (raw.subIssues?.nodes ?? []).filter((
|
|
34341
|
+
childIds: (raw.subIssues?.nodes ?? []).filter((child2) => child2 !== null).map((child2) => child2.id)
|
|
34284
34342
|
};
|
|
34285
34343
|
}
|
|
34286
34344
|
|
|
@@ -34368,7 +34426,7 @@ function orderDepthFirst(issues) {
|
|
|
34368
34426
|
const ordered = [];
|
|
34369
34427
|
const visit2 = (issue) => {
|
|
34370
34428
|
ordered.push(issue);
|
|
34371
|
-
for (const
|
|
34429
|
+
for (const child2 of byParent.get(issue.id) ?? []) visit2(child2);
|
|
34372
34430
|
};
|
|
34373
34431
|
for (const root2 of byParent.get(null) ?? []) visit2(root2);
|
|
34374
34432
|
return ordered;
|
|
@@ -35591,17 +35649,17 @@ async function previewIssueEdit(number, repo, fresh, body) {
|
|
|
35591
35649
|
// src/commands/github/issue/setIssueParent.ts
|
|
35592
35650
|
function setIssueParent(number, repo, parentArg) {
|
|
35593
35651
|
const target = resolveIssueRepoTarget(repo);
|
|
35594
|
-
const
|
|
35652
|
+
const child2 = `${target.owner}/${target.repo}#${number}`;
|
|
35595
35653
|
try {
|
|
35596
35654
|
const childId = fetchIssueNodeId({ ...target, number });
|
|
35597
35655
|
const parent = resolveCreateIssueParent(target, parentArg);
|
|
35598
35656
|
addSubIssue(parent.id, childId);
|
|
35599
35657
|
console.log(
|
|
35600
|
-
`${
|
|
35658
|
+
`${child2} is now a sub-issue of ${parent.owner}/${parent.repo}#${parent.number}`
|
|
35601
35659
|
);
|
|
35602
35660
|
} catch (error) {
|
|
35603
35661
|
const message4 = error instanceof Error ? error.message : String(error);
|
|
35604
|
-
console.error(`Setting the parent of ${
|
|
35662
|
+
console.error(`Setting the parent of ${child2} failed: ${message4}`);
|
|
35605
35663
|
process.exit(1);
|
|
35606
35664
|
}
|
|
35607
35665
|
}
|
|
@@ -36450,15 +36508,15 @@ function renderNodes(nodes, indent4) {
|
|
|
36450
36508
|
function isListNode(node) {
|
|
36451
36509
|
return node.type === "orderedList" || node.type === "bulletList";
|
|
36452
36510
|
}
|
|
36453
|
-
function renderListChild(
|
|
36454
|
-
if (isListNode(
|
|
36455
|
-
if (
|
|
36456
|
-
const text19 = renderChildren(
|
|
36511
|
+
function renderListChild(child2, indent4, pad3, marker2, isFirst) {
|
|
36512
|
+
if (isListNode(child2)) return renderNodes([child2], indent4 + 1);
|
|
36513
|
+
if (child2.type !== "paragraph") return renderNode(child2, indent4);
|
|
36514
|
+
const text19 = renderChildren(child2, indent4);
|
|
36457
36515
|
return isFirst ? `${pad3}${marker2} ${text19}` : `${pad3} ${text19}`;
|
|
36458
36516
|
}
|
|
36459
36517
|
function renderListItem(node, indent4, marker2) {
|
|
36460
36518
|
const pad3 = " ".repeat(indent4);
|
|
36461
|
-
return (node.content ?? []).map((
|
|
36519
|
+
return (node.content ?? []).map((child2, i) => renderListChild(child2, indent4, pad3, marker2, i === 0)).join("\n");
|
|
36462
36520
|
}
|
|
36463
36521
|
function adfToText(doc) {
|
|
36464
36522
|
return renderNodes([doc], 0);
|
|
@@ -36969,26 +37027,26 @@ function quoteForPosixShell(value) {
|
|
|
36969
37027
|
// src/commands/sessions/daemon/worktree/stopInstall.ts
|
|
36970
37028
|
import { execFile as execFile14 } from "child_process";
|
|
36971
37029
|
var running2 = /* @__PURE__ */ new Map();
|
|
36972
|
-
function trackInstall(worktreePath,
|
|
37030
|
+
function trackInstall(worktreePath, child2) {
|
|
36973
37031
|
const children = running2.get(worktreePath) ?? /* @__PURE__ */ new Set();
|
|
36974
|
-
children.add(
|
|
37032
|
+
children.add(child2);
|
|
36975
37033
|
running2.set(worktreePath, children);
|
|
36976
37034
|
}
|
|
36977
|
-
function untrackInstall(worktreePath,
|
|
37035
|
+
function untrackInstall(worktreePath, child2) {
|
|
36978
37036
|
const children = running2.get(worktreePath);
|
|
36979
|
-
if (!children?.delete(
|
|
37037
|
+
if (!children?.delete(child2)) return false;
|
|
36980
37038
|
if (children.size === 0) running2.delete(worktreePath);
|
|
36981
37039
|
return true;
|
|
36982
37040
|
}
|
|
36983
37041
|
function stopInstall(worktreePath) {
|
|
36984
37042
|
const children = running2.get(worktreePath);
|
|
36985
37043
|
running2.delete(worktreePath);
|
|
36986
|
-
for (const
|
|
36987
|
-
if (!
|
|
37044
|
+
for (const child2 of children ?? []) {
|
|
37045
|
+
if (!child2.pid) continue;
|
|
36988
37046
|
daemonLog(
|
|
36989
|
-
`worktree ${worktreePath} install still running at teardown; killing pid ${
|
|
37047
|
+
`worktree ${worktreePath} install still running at teardown; killing pid ${child2.pid} so removal is not racing it`
|
|
36990
37048
|
);
|
|
36991
|
-
killTree(
|
|
37049
|
+
killTree(child2.pid);
|
|
36992
37050
|
}
|
|
36993
37051
|
}
|
|
36994
37052
|
function killTree(pid) {
|
|
@@ -37016,25 +37074,25 @@ function killTree(pid) {
|
|
|
37016
37074
|
var STDERR_TAIL = 2e3;
|
|
37017
37075
|
function spawnInstall(worktreePath, cwd, command, where, onDone) {
|
|
37018
37076
|
daemonLog(`worktree ${worktreePath} installing deps${where}: ${command}`);
|
|
37019
|
-
const
|
|
37020
|
-
trackInstall(worktreePath,
|
|
37077
|
+
const child2 = spawn10(...installInvocation(cwd, command));
|
|
37078
|
+
trackInstall(worktreePath, child2);
|
|
37021
37079
|
let stderr = "";
|
|
37022
|
-
|
|
37080
|
+
child2.stderr?.on("data", (chunk2) => {
|
|
37023
37081
|
stderr = (stderr + chunk2.toString()).slice(-STDERR_TAIL);
|
|
37024
37082
|
});
|
|
37025
37083
|
let settled = false;
|
|
37026
37084
|
const settle = (ok, outcome) => {
|
|
37027
37085
|
if (settled) return;
|
|
37028
37086
|
settled = true;
|
|
37029
|
-
const stopped = !untrackInstall(worktreePath,
|
|
37087
|
+
const stopped = !untrackInstall(worktreePath, child2);
|
|
37030
37088
|
daemonLog(`worktree ${worktreePath} install${where} ${outcome}`);
|
|
37031
37089
|
onDone({ ok, stopped });
|
|
37032
37090
|
};
|
|
37033
|
-
|
|
37091
|
+
child2.on(
|
|
37034
37092
|
"error",
|
|
37035
37093
|
(error) => settle(false, `failed to start: ${error.message}`)
|
|
37036
37094
|
);
|
|
37037
|
-
|
|
37095
|
+
child2.on(
|
|
37038
37096
|
"close",
|
|
37039
37097
|
(code, signal) => settle(
|
|
37040
37098
|
code === 0,
|
|
@@ -37507,7 +37565,7 @@ function registerReviewPrComments(program, resumeFlag) {
|
|
|
37507
37565
|
}
|
|
37508
37566
|
|
|
37509
37567
|
// src/commands/registerDescriptionLaunch.ts
|
|
37510
|
-
var harnessFlag = (feature) => `Coding harness to launch (claude|codex|pi); defaults to the configured harness.engine. Exits with the reasons, without launching, when ${feature.label} is unavailable on it`;
|
|
37568
|
+
var harnessFlag = (feature) => `Coding harness to launch (claude|codex|pi); defaults to the configured harness.defaults.<command>.harness, then harness.engine. Exits with the reasons, without launching, when ${feature.label} is unavailable on it`;
|
|
37511
37569
|
function registerDescriptionLaunch(program, name2, slashCommand, description, feature, resumeFlag, alias) {
|
|
37512
37570
|
const command = program.command(name2).argument(
|
|
37513
37571
|
"[description]",
|
|
@@ -37517,11 +37575,11 @@ function registerDescriptionLaunch(program, name2, slashCommand, description, fe
|
|
|
37517
37575
|
once: opts.once,
|
|
37518
37576
|
description: text19,
|
|
37519
37577
|
resumeSessionId: opts.resumeSession,
|
|
37520
|
-
harness: resolveHarness2(opts.harness),
|
|
37578
|
+
harness: resolveHarness2(opts.harness, name2),
|
|
37521
37579
|
feature
|
|
37522
37580
|
})
|
|
37523
37581
|
);
|
|
37524
|
-
configHelp(command, harnessConfigHelp);
|
|
37582
|
+
configHelp(command, [...harnessConfigHelp, ...harnessDefaultsConfigHelp]);
|
|
37525
37583
|
if (alias) command.alias(alias);
|
|
37526
37584
|
}
|
|
37527
37585
|
|
|
@@ -38571,8 +38629,8 @@ function visitObjects(root2, fn) {
|
|
|
38571
38629
|
if (v == null || typeof v !== "object") continue;
|
|
38572
38630
|
const o = asObject(v);
|
|
38573
38631
|
if (o) fn(o);
|
|
38574
|
-
for (const
|
|
38575
|
-
if (
|
|
38632
|
+
for (const child2 of Array.isArray(v) ? v : Object.values(v)) {
|
|
38633
|
+
if (child2 && typeof child2 === "object") stack.push(child2);
|
|
38576
38634
|
}
|
|
38577
38635
|
}
|
|
38578
38636
|
}
|
|
@@ -43257,19 +43315,19 @@ function getViolations(pattern2, options2 = {}, maxLines = DEFAULT_MAX_LINES2) {
|
|
|
43257
43315
|
// src/commands/refactor/check.ts
|
|
43258
43316
|
function runScript(script, cwd) {
|
|
43259
43317
|
return new Promise((resolve35) => {
|
|
43260
|
-
const
|
|
43318
|
+
const child2 = spawn11("npm", ["run", script], {
|
|
43261
43319
|
stdio: "pipe",
|
|
43262
43320
|
shell: true,
|
|
43263
43321
|
cwd
|
|
43264
43322
|
});
|
|
43265
43323
|
let output = "";
|
|
43266
|
-
|
|
43324
|
+
child2.stdout?.on("data", (data) => {
|
|
43267
43325
|
output += data.toString();
|
|
43268
43326
|
});
|
|
43269
|
-
|
|
43327
|
+
child2.stderr?.on("data", (data) => {
|
|
43270
43328
|
output += data.toString();
|
|
43271
43329
|
});
|
|
43272
|
-
|
|
43330
|
+
child2.on("close", (code) => {
|
|
43273
43331
|
resolve35({ script, code: code ?? 1, output });
|
|
43274
43332
|
});
|
|
43275
43333
|
});
|
|
@@ -45118,9 +45176,9 @@ import path90 from "path";
|
|
|
45118
45176
|
function insert(root2, parts2) {
|
|
45119
45177
|
let node = root2;
|
|
45120
45178
|
for (const part of parts2) {
|
|
45121
|
-
const
|
|
45122
|
-
node.set(part,
|
|
45123
|
-
node =
|
|
45179
|
+
const child2 = node.get(part) ?? /* @__PURE__ */ new Map();
|
|
45180
|
+
node.set(part, child2);
|
|
45181
|
+
node = child2;
|
|
45124
45182
|
}
|
|
45125
45183
|
}
|
|
45126
45184
|
function render(node, indent4, lines) {
|
|
@@ -45128,9 +45186,9 @@ function render(node, indent4, lines) {
|
|
|
45128
45186
|
const dirFirst = Number(cb.size > 0) - Number(ca.size > 0);
|
|
45129
45187
|
return dirFirst || a.localeCompare(b);
|
|
45130
45188
|
});
|
|
45131
|
-
for (const [name2,
|
|
45132
|
-
lines.push(`${indent4}${name2}${
|
|
45133
|
-
render(
|
|
45189
|
+
for (const [name2, child2] of entries) {
|
|
45190
|
+
lines.push(`${indent4}${name2}${child2.size > 0 ? "/" : ""}`);
|
|
45191
|
+
render(child2, `${indent4} `, lines);
|
|
45134
45192
|
}
|
|
45135
45193
|
}
|
|
45136
45194
|
function formatTree(files, scopeRoot) {
|
|
@@ -45646,7 +45704,7 @@ function byName(a, b) {
|
|
|
45646
45704
|
}
|
|
45647
45705
|
function nodesOf(at2, prefix2) {
|
|
45648
45706
|
const dirs = [...at2.dirs].map(
|
|
45649
|
-
([name2,
|
|
45707
|
+
([name2, child2]) => collapsedDirNode(name2, child2, prefix2)
|
|
45650
45708
|
);
|
|
45651
45709
|
const files = at2.files.map((file) => ({
|
|
45652
45710
|
kind: "file",
|
|
@@ -45660,10 +45718,10 @@ function collapsedDirNode(name2, at2, prefix2) {
|
|
|
45660
45718
|
let path118 = prefix2 ? `${prefix2}/${name2}` : name2;
|
|
45661
45719
|
let node = at2;
|
|
45662
45720
|
while (node.files.length === 0 && node.dirs.size === 1) {
|
|
45663
|
-
const [childName,
|
|
45721
|
+
const [childName, child2] = [...node.dirs][0];
|
|
45664
45722
|
label = `${label}/${childName}`;
|
|
45665
45723
|
path118 = `${path118}/${childName}`;
|
|
45666
|
-
node =
|
|
45724
|
+
node = child2;
|
|
45667
45725
|
}
|
|
45668
45726
|
const children = nodesOf(node, path118);
|
|
45669
45727
|
return {
|
|
@@ -46443,8 +46501,8 @@ function changedLines(call, changed) {
|
|
|
46443
46501
|
// src/commands/review/highLevel/extractTestHierarchy.ts
|
|
46444
46502
|
function collect7(node, context) {
|
|
46445
46503
|
const found = [];
|
|
46446
|
-
node.forEachChild((
|
|
46447
|
-
found.push(...visit(
|
|
46504
|
+
node.forEachChild((child2) => {
|
|
46505
|
+
found.push(...visit(child2, context));
|
|
46448
46506
|
});
|
|
46449
46507
|
return found;
|
|
46450
46508
|
}
|
|
@@ -47075,7 +47133,7 @@ function formatNode(node, indent4) {
|
|
|
47075
47133
|
const dir = node;
|
|
47076
47134
|
return [
|
|
47077
47135
|
`${indent4}${chalk268.bold(`${dir.name}/`)} ${chalk268.dim(counts(dir.additions, dir.deletions))}`,
|
|
47078
|
-
...dir.children.flatMap((
|
|
47136
|
+
...dir.children.flatMap((child2) => formatNode(child2, `${indent4} `))
|
|
47079
47137
|
];
|
|
47080
47138
|
}
|
|
47081
47139
|
function formatHighLevelStructure(structure) {
|
|
@@ -47100,7 +47158,7 @@ function formatNode2(node, depth) {
|
|
|
47100
47158
|
return [`${indent4}${chalk269.dim(changeMarker(node.change))} ${node.name}`];
|
|
47101
47159
|
return [
|
|
47102
47160
|
`${indent4}${chalk269.bold(node.name)}`,
|
|
47103
|
-
...node.children.flatMap((
|
|
47161
|
+
...node.children.flatMap((child2) => formatNode2(child2, depth + 1))
|
|
47104
47162
|
];
|
|
47105
47163
|
}
|
|
47106
47164
|
function formatHighLevelTests(files, testPaths) {
|
|
@@ -55643,7 +55701,7 @@ function runUpdateLap(cwd, onOutput) {
|
|
|
55643
55701
|
clearLapSignals(cwd);
|
|
55644
55702
|
return new Promise((resolve35, reject) => {
|
|
55645
55703
|
const { ASSIST_ACTIVITY_ID: _activity, ...env } = process.env;
|
|
55646
|
-
const
|
|
55704
|
+
const child2 = spawn13(
|
|
55647
55705
|
process.execPath,
|
|
55648
55706
|
[process.argv[1], ...WATCH_LAP_ARGS],
|
|
55649
55707
|
{
|
|
@@ -55654,16 +55712,16 @@ function runUpdateLap(cwd, onOutput) {
|
|
|
55654
55712
|
}
|
|
55655
55713
|
);
|
|
55656
55714
|
const killWithDaemon = () => {
|
|
55657
|
-
|
|
55715
|
+
child2.kill();
|
|
55658
55716
|
};
|
|
55659
55717
|
process.on("exit", killWithDaemon);
|
|
55660
|
-
|
|
55661
|
-
|
|
55662
|
-
|
|
55718
|
+
child2.stdout.on("data", (chunk2) => onOutput(chunk2.toString()));
|
|
55719
|
+
child2.stderr.on("data", (chunk2) => onOutput(chunk2.toString()));
|
|
55720
|
+
child2.on("close", (code, signal) => {
|
|
55663
55721
|
process.off("exit", killWithDaemon);
|
|
55664
55722
|
resolve35({ code, signal });
|
|
55665
55723
|
});
|
|
55666
|
-
|
|
55724
|
+
child2.on("error", (error) => {
|
|
55667
55725
|
process.off("exit", killWithDaemon);
|
|
55668
55726
|
reject(error);
|
|
55669
55727
|
});
|
|
@@ -55729,10 +55787,10 @@ function treeUnderClose(session) {
|
|
|
55729
55787
|
}
|
|
55730
55788
|
|
|
55731
55789
|
// src/commands/sessions/daemon/closeChildServerRuns.ts
|
|
55732
|
-
function isChildServerRun(
|
|
55733
|
-
if (!
|
|
55734
|
-
if (
|
|
55735
|
-
return !!parent.worktree && treeUnderClose(
|
|
55790
|
+
function isChildServerRun(child2, parent) {
|
|
55791
|
+
if (!child2.server || child2.id === parent.id) return false;
|
|
55792
|
+
if (child2.launchedFrom === parent.id) return true;
|
|
55793
|
+
return !!parent.worktree && treeUnderClose(child2)?.path === parent.worktree.path;
|
|
55736
55794
|
}
|
|
55737
55795
|
function closeChildServerRuns(sessions, parentId, close) {
|
|
55738
55796
|
const parent = sessions.get(parentId);
|
|
@@ -55740,9 +55798,9 @@ function closeChildServerRuns(sessions, parentId, close) {
|
|
|
55740
55798
|
const children = [...sessions.values()].filter(
|
|
55741
55799
|
(s) => isChildServerRun(s, parent)
|
|
55742
55800
|
);
|
|
55743
|
-
for (const
|
|
55744
|
-
daemonLog(`closing server run ${
|
|
55745
|
-
close(
|
|
55801
|
+
for (const child2 of children) {
|
|
55802
|
+
daemonLog(`closing server run ${child2.id} with ${parentId}`);
|
|
55803
|
+
close(child2.id);
|
|
55746
55804
|
}
|
|
55747
55805
|
}
|
|
55748
55806
|
|
|
@@ -63068,7 +63126,7 @@ function registerSessions(program) {
|
|
|
63068
63126
|
registerOutputCommand(cmd);
|
|
63069
63127
|
registerSetStatusCommand(cmd);
|
|
63070
63128
|
registerNodes(cmd);
|
|
63071
|
-
configHelp(cmd, sessionsConfigHelp);
|
|
63129
|
+
configHelp(cmd, [...sessionsConfigHelp, ...harnessDefaultsConfigHelp]);
|
|
63072
63130
|
}
|
|
63073
63131
|
|
|
63074
63132
|
// src/programRegistrars.ts
|