@staff0rd/assist 0.1064.0 → 0.1065.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 +409 -409
- package/dist/index.js +351 -319
- 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.1065.0",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -482,11 +482,11 @@ function linkedWorktree(dir) {
|
|
|
482
482
|
return existsSync(clone) ? { root: root2, clone } : null;
|
|
483
483
|
}
|
|
484
484
|
function findGitLink(dir) {
|
|
485
|
-
let
|
|
486
|
-
while (
|
|
487
|
-
const entry = join4(
|
|
488
|
-
if (existsSync(entry)) return isFile(entry) ?
|
|
489
|
-
|
|
485
|
+
let current2 = resolve2(dir);
|
|
486
|
+
while (current2 !== dirname2(current2)) {
|
|
487
|
+
const entry = join4(current2, ".git");
|
|
488
|
+
if (existsSync(entry)) return isFile(entry) ? current2 : null;
|
|
489
|
+
current2 = dirname2(current2);
|
|
490
490
|
}
|
|
491
491
|
return null;
|
|
492
492
|
}
|
|
@@ -682,12 +682,12 @@ import chalk2 from "chalk";
|
|
|
682
682
|
import { existsSync as existsSync5 } from "fs";
|
|
683
683
|
import path from "path";
|
|
684
684
|
function findRepoRoot(dir) {
|
|
685
|
-
let
|
|
686
|
-
while (
|
|
687
|
-
if (existsSync5(path.join(
|
|
688
|
-
return
|
|
685
|
+
let current2 = dir;
|
|
686
|
+
while (current2 !== path.dirname(current2)) {
|
|
687
|
+
if (existsSync5(path.join(current2, ".git"))) {
|
|
688
|
+
return current2;
|
|
689
689
|
}
|
|
690
|
-
|
|
690
|
+
current2 = path.dirname(current2);
|
|
691
691
|
}
|
|
692
692
|
return null;
|
|
693
693
|
}
|
|
@@ -1468,14 +1468,14 @@ function warnUnsharedAdviceRules(globalRaw, userDb) {
|
|
|
1468
1468
|
|
|
1469
1469
|
// src/shared/loadConfigFrom.ts
|
|
1470
1470
|
function findConfigUp(startDir) {
|
|
1471
|
-
let
|
|
1472
|
-
while (
|
|
1473
|
-
const claudePath = join7(
|
|
1471
|
+
let current2 = startDir;
|
|
1472
|
+
while (current2 !== dirname3(current2)) {
|
|
1473
|
+
const claudePath = join7(current2, ".claude", "assist.yml");
|
|
1474
1474
|
if (existsSync6(claudePath))
|
|
1475
|
-
return { configPath: claudePath, rootDir:
|
|
1476
|
-
const rootPath = join7(
|
|
1477
|
-
if (existsSync6(rootPath)) return { configPath: rootPath, rootDir:
|
|
1478
|
-
|
|
1475
|
+
return { configPath: claudePath, rootDir: current2 };
|
|
1476
|
+
const rootPath = join7(current2, "assist.yml");
|
|
1477
|
+
if (existsSync6(rootPath)) return { configPath: rootPath, rootDir: current2 };
|
|
1478
|
+
current2 = dirname3(current2);
|
|
1479
1479
|
}
|
|
1480
1480
|
return null;
|
|
1481
1481
|
}
|
|
@@ -1625,15 +1625,15 @@ async function readServeConfig() {
|
|
|
1625
1625
|
|
|
1626
1626
|
// src/commands/sessions/nodes/runningStatus.ts
|
|
1627
1627
|
async function runningStatus(status2) {
|
|
1628
|
-
let
|
|
1628
|
+
let current2;
|
|
1629
1629
|
try {
|
|
1630
|
-
|
|
1630
|
+
current2 = await status2();
|
|
1631
1631
|
} catch (error) {
|
|
1632
1632
|
if (error.code === "ENOENT")
|
|
1633
1633
|
return `skipped, ${tailscaleCli()} is not installed`;
|
|
1634
1634
|
throw error;
|
|
1635
1635
|
}
|
|
1636
|
-
return
|
|
1636
|
+
return current2.BackendState === "Running" ? current2 : `skipped, Tailscale is ${current2.BackendState ?? "not running"}`;
|
|
1637
1637
|
}
|
|
1638
1638
|
|
|
1639
1639
|
// src/commands/sessions/nodes/tailnetHttpsPort.ts
|
|
@@ -1660,10 +1660,10 @@ async function ensureTailscaleServe(port, deps2 = {}) {
|
|
|
1660
1660
|
...deps2
|
|
1661
1661
|
};
|
|
1662
1662
|
if (!enabled()) return "skipped, sessions.tailscaleServe is false";
|
|
1663
|
-
const
|
|
1664
|
-
if (typeof
|
|
1663
|
+
const current2 = await runningStatus(status2);
|
|
1664
|
+
if (typeof current2 === "string") return current2;
|
|
1665
1665
|
for (let attempt2 = 1; ; attempt2++) {
|
|
1666
|
-
const plan2 = planServe(
|
|
1666
|
+
const plan2 = planServe(current2, await serveStatus(), port, httpsPort(port));
|
|
1667
1667
|
if (plan2.alreadyServing) return `${plan2.url} already serves ${plan2.target}`;
|
|
1668
1668
|
try {
|
|
1669
1669
|
await serve(plan2.args);
|
|
@@ -1817,13 +1817,13 @@ function createBrowserLink(options2 = {}) {
|
|
|
1817
1817
|
},
|
|
1818
1818
|
connectedVersion: () => state.version(),
|
|
1819
1819
|
async request(request, timeoutMs) {
|
|
1820
|
-
const
|
|
1820
|
+
const current2 = await state.connected();
|
|
1821
1821
|
const reply2 = await replies.send(
|
|
1822
|
-
|
|
1822
|
+
current2.ws,
|
|
1823
1823
|
timeoutMs,
|
|
1824
|
-
(id) =>
|
|
1824
|
+
(id) => current2.ws.send(JSON.stringify({ ...request, type: "request", id }))
|
|
1825
1825
|
);
|
|
1826
|
-
return { ...reply2, version:
|
|
1826
|
+
return { ...reply2, version: current2.version };
|
|
1827
1827
|
}
|
|
1828
1828
|
};
|
|
1829
1829
|
}
|
|
@@ -3762,12 +3762,12 @@ var BACKLOG_MARKERS = [
|
|
|
3762
3762
|
"assist.backlog.yml"
|
|
3763
3763
|
];
|
|
3764
3764
|
function findBacklogUp(startDir) {
|
|
3765
|
-
let
|
|
3766
|
-
while (
|
|
3767
|
-
if (BACKLOG_MARKERS.some((marker2) => existsSync11(join11(
|
|
3768
|
-
return
|
|
3765
|
+
let current2 = startDir;
|
|
3766
|
+
while (current2 !== dirname4(current2)) {
|
|
3767
|
+
if (BACKLOG_MARKERS.some((marker2) => existsSync11(join11(current2, marker2)))) {
|
|
3768
|
+
return current2;
|
|
3769
3769
|
}
|
|
3770
|
-
|
|
3770
|
+
current2 = dirname4(current2);
|
|
3771
3771
|
}
|
|
3772
3772
|
return null;
|
|
3773
3773
|
}
|
|
@@ -4645,14 +4645,14 @@ async function resolveTarget(port, deps2) {
|
|
|
4645
4645
|
"sessions.tailscaleServe is false on this node",
|
|
4646
4646
|
`Run \`assist config set sessions.tailscaleServe true --node\`, ${RESTART}`
|
|
4647
4647
|
);
|
|
4648
|
-
const
|
|
4649
|
-
if (typeof
|
|
4648
|
+
const current2 = await runningStatus(deps2.status);
|
|
4649
|
+
if (typeof current2 === "string")
|
|
4650
4650
|
return notServing(
|
|
4651
|
-
|
|
4651
|
+
current2.replace(/^skipped, /, ""),
|
|
4652
4652
|
`Install Tailscale and run \`${tailscaleCli()} up\`, ${RESTART}`
|
|
4653
4653
|
);
|
|
4654
4654
|
const plan2 = planServe(
|
|
4655
|
-
|
|
4655
|
+
current2,
|
|
4656
4656
|
await deps2.serveStatus(),
|
|
4657
4657
|
port,
|
|
4658
4658
|
deps2.httpsPort(port)
|
|
@@ -5831,17 +5831,17 @@ var WRAPPER_TYPES = /* @__PURE__ */ new Set([
|
|
|
5831
5831
|
]);
|
|
5832
5832
|
var OPTIONAL_TYPES = /* @__PURE__ */ new Set(["optional", "nullish"]);
|
|
5833
5833
|
function unwrapSchemaNode(node) {
|
|
5834
|
-
let
|
|
5834
|
+
let current2 = node;
|
|
5835
5835
|
let defaultValue;
|
|
5836
5836
|
let optional = false;
|
|
5837
|
-
while (
|
|
5838
|
-
if (
|
|
5839
|
-
defaultValue =
|
|
5837
|
+
while (current2.def && WRAPPER_TYPES.has(current2.def.type ?? "") && current2.def.innerType) {
|
|
5838
|
+
if (current2.def.type === "default" && defaultValue === void 0) {
|
|
5839
|
+
defaultValue = current2.def.defaultValue;
|
|
5840
5840
|
}
|
|
5841
|
-
if (OPTIONAL_TYPES.has(
|
|
5842
|
-
|
|
5841
|
+
if (OPTIONAL_TYPES.has(current2.def.type ?? "")) optional = true;
|
|
5842
|
+
current2 = current2.def.innerType;
|
|
5843
5843
|
}
|
|
5844
|
-
return { inner:
|
|
5844
|
+
return { inner: current2, defaultValue, optional };
|
|
5845
5845
|
}
|
|
5846
5846
|
|
|
5847
5847
|
// src/shared/scalarUnionMembers.ts
|
|
@@ -6145,13 +6145,13 @@ function redactConfigSecrets(value, node) {
|
|
|
6145
6145
|
function isTraversable(value) {
|
|
6146
6146
|
return value !== null && value !== void 0 && typeof value === "object";
|
|
6147
6147
|
}
|
|
6148
|
-
function stepInto(
|
|
6149
|
-
return isTraversable(
|
|
6148
|
+
function stepInto(current2, key) {
|
|
6149
|
+
return isTraversable(current2) ? current2[key] : void 0;
|
|
6150
6150
|
}
|
|
6151
6151
|
function getNestedValue(obj, path109) {
|
|
6152
|
-
let
|
|
6153
|
-
for (const key of path109.split("."))
|
|
6154
|
-
return
|
|
6152
|
+
let current2 = obj;
|
|
6153
|
+
for (const key of path109.split(".")) current2 = stepInto(current2, key);
|
|
6154
|
+
return current2;
|
|
6155
6155
|
}
|
|
6156
6156
|
|
|
6157
6157
|
// src/commands/config/configEntryLayers.ts
|
|
@@ -6202,12 +6202,12 @@ function step(node, segment) {
|
|
|
6202
6202
|
}
|
|
6203
6203
|
}
|
|
6204
6204
|
function findConfigNode(root2, path109) {
|
|
6205
|
-
let
|
|
6205
|
+
let current2 = root2;
|
|
6206
6206
|
for (const segment of path109) {
|
|
6207
|
-
if (!
|
|
6208
|
-
|
|
6207
|
+
if (!current2) return void 0;
|
|
6208
|
+
current2 = step(current2, segment);
|
|
6209
6209
|
}
|
|
6210
|
-
return
|
|
6210
|
+
return current2;
|
|
6211
6211
|
}
|
|
6212
6212
|
|
|
6213
6213
|
// src/shared/parseConfigPath.ts
|
|
@@ -7133,11 +7133,11 @@ function stepIntoNested(container, key, nextKey) {
|
|
|
7133
7133
|
function setNestedValue(obj, path109, value) {
|
|
7134
7134
|
const keys = path109.split(".");
|
|
7135
7135
|
const result = { ...obj };
|
|
7136
|
-
let
|
|
7136
|
+
let current2 = result;
|
|
7137
7137
|
for (let i = 0; i < keys.length - 1; i++) {
|
|
7138
|
-
|
|
7138
|
+
current2 = stepIntoNested(current2, keys[i], keys[i + 1]);
|
|
7139
7139
|
}
|
|
7140
|
-
setItem(
|
|
7140
|
+
setItem(current2, resolveKey(keys[keys.length - 1]), value);
|
|
7141
7141
|
return result;
|
|
7142
7142
|
}
|
|
7143
7143
|
|
|
@@ -8904,6 +8904,65 @@ function queryNodes() {
|
|
|
8904
8904
|
return requestDaemonReply({ type: "nodes" }, "nodes");
|
|
8905
8905
|
}
|
|
8906
8906
|
|
|
8907
|
+
// src/commands/watch/resolveUpstream.ts
|
|
8908
|
+
import { execFileSync as execFileSync2 } from "child_process";
|
|
8909
|
+
function runGit3(args, cwd) {
|
|
8910
|
+
return execFileSync2("git", args, {
|
|
8911
|
+
encoding: "utf8",
|
|
8912
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
8913
|
+
cwd,
|
|
8914
|
+
windowsHide: true
|
|
8915
|
+
}).trim();
|
|
8916
|
+
}
|
|
8917
|
+
function resolveUpstream(cwd) {
|
|
8918
|
+
try {
|
|
8919
|
+
runGit3(["rev-parse", "--is-inside-work-tree"], cwd);
|
|
8920
|
+
} catch {
|
|
8921
|
+
throw new Error(
|
|
8922
|
+
"not a git repository \u2014 run assist watch wait from inside a repo"
|
|
8923
|
+
);
|
|
8924
|
+
}
|
|
8925
|
+
let branch2;
|
|
8926
|
+
try {
|
|
8927
|
+
branch2 = runGit3(["symbolic-ref", "--quiet", "--short", "HEAD"], cwd);
|
|
8928
|
+
} catch {
|
|
8929
|
+
throw new Error(
|
|
8930
|
+
"HEAD is detached \u2014 check out a branch before waiting on its upstream"
|
|
8931
|
+
);
|
|
8932
|
+
}
|
|
8933
|
+
try {
|
|
8934
|
+
return {
|
|
8935
|
+
branch: branch2,
|
|
8936
|
+
upstream: runGit3(
|
|
8937
|
+
["rev-parse", "--abbrev-ref", "--symbolic-full-name", "@{u}"],
|
|
8938
|
+
cwd
|
|
8939
|
+
)
|
|
8940
|
+
};
|
|
8941
|
+
} catch {
|
|
8942
|
+
throw new Error(
|
|
8943
|
+
`branch "${branch2}" has no upstream \u2014 set one with: git push -u origin ${branch2}`
|
|
8944
|
+
);
|
|
8945
|
+
}
|
|
8946
|
+
}
|
|
8947
|
+
|
|
8948
|
+
// src/commands/watch/headCommit.ts
|
|
8949
|
+
function headCommit2(cwd) {
|
|
8950
|
+
try {
|
|
8951
|
+
return runGit3(["rev-parse", "HEAD"], cwd);
|
|
8952
|
+
} catch {
|
|
8953
|
+
return void 0;
|
|
8954
|
+
}
|
|
8955
|
+
}
|
|
8956
|
+
|
|
8957
|
+
// src/commands/sessions/web/updates/webStartCommit.ts
|
|
8958
|
+
var captured;
|
|
8959
|
+
var webStartCommit = {
|
|
8960
|
+
capture: () => {
|
|
8961
|
+
captured = headCommit2(getInstallDir());
|
|
8962
|
+
},
|
|
8963
|
+
value: () => captured
|
|
8964
|
+
};
|
|
8965
|
+
|
|
8907
8966
|
// src/commands/sessions/web/health.ts
|
|
8908
8967
|
async function health(_req, res) {
|
|
8909
8968
|
const [reachable, nodes] = await Promise.all([
|
|
@@ -8913,6 +8972,7 @@ async function health(_req, res) {
|
|
|
8913
8972
|
respondJson(res, 200, {
|
|
8914
8973
|
nodeName: resolveNodeName(),
|
|
8915
8974
|
version: ASSIST_VERSION,
|
|
8975
|
+
startCommit: webStartCommit.value(),
|
|
8916
8976
|
protocol: PROTOCOL_VERSION,
|
|
8917
8977
|
daemon: { reachable },
|
|
8918
8978
|
links: nodes?.links ?? []
|
|
@@ -9382,7 +9442,7 @@ var ownerOpenPrsQuery = `query($requested: String!, $authored: String!, $mine: S
|
|
|
9382
9442
|
var sameLogin = (a, b) => a?.toLowerCase() === b.toLowerCase();
|
|
9383
9443
|
|
|
9384
9444
|
// src/commands/sessions/web/next/headCommit.ts
|
|
9385
|
-
function
|
|
9445
|
+
function headCommit3(node) {
|
|
9386
9446
|
return node.commits?.nodes?.[0]?.commit ?? null;
|
|
9387
9447
|
}
|
|
9388
9448
|
|
|
@@ -9401,7 +9461,7 @@ function lastRequestedAt(node, viewer) {
|
|
|
9401
9461
|
return events.at(-1)?.createdAt ?? node.createdAt;
|
|
9402
9462
|
}
|
|
9403
9463
|
function toNextPr(node, author, requested, viewer) {
|
|
9404
|
-
const rollup =
|
|
9464
|
+
const rollup = headCommit3(node)?.statusCheckRollup?.state;
|
|
9405
9465
|
return {
|
|
9406
9466
|
number: node.number,
|
|
9407
9467
|
title: node.title,
|
|
@@ -9847,10 +9907,10 @@ function assertProjectScope() {
|
|
|
9847
9907
|
}
|
|
9848
9908
|
|
|
9849
9909
|
// src/shared/runGhOrThrow.ts
|
|
9850
|
-
import { execFileSync as
|
|
9910
|
+
import { execFileSync as execFileSync3 } from "child_process";
|
|
9851
9911
|
function runGhOrThrow(args, fallbackMessage, input) {
|
|
9852
9912
|
try {
|
|
9853
|
-
|
|
9913
|
+
execFileSync3("gh", args, {
|
|
9854
9914
|
stdio: [input === void 0 ? "ignore" : "pipe", "ignore", "pipe"],
|
|
9855
9915
|
encoding: "utf8",
|
|
9856
9916
|
...input === void 0 ? {} : { input }
|
|
@@ -10090,12 +10150,12 @@ function scopedClaudeFiles(target) {
|
|
|
10090
10150
|
const startDir = scopeDirectory(target);
|
|
10091
10151
|
const root2 = findRepoRoot(startDir) ?? startDir;
|
|
10092
10152
|
const files = [];
|
|
10093
|
-
let
|
|
10153
|
+
let current2 = startDir;
|
|
10094
10154
|
while (true) {
|
|
10095
|
-
const candidate = path12.join(
|
|
10155
|
+
const candidate = path12.join(current2, "CLAUDE.md");
|
|
10096
10156
|
if (existsSync21(candidate)) files.push(candidate);
|
|
10097
|
-
if (
|
|
10098
|
-
|
|
10157
|
+
if (current2 === root2 || current2 === path12.dirname(current2)) break;
|
|
10158
|
+
current2 = path12.dirname(current2);
|
|
10099
10159
|
}
|
|
10100
10160
|
return files;
|
|
10101
10161
|
}
|
|
@@ -11369,7 +11429,7 @@ function deploymentsQuery(environments) {
|
|
|
11369
11429
|
}
|
|
11370
11430
|
|
|
11371
11431
|
// src/commands/sessions/web/releases/liveDeployments.ts
|
|
11372
|
-
function
|
|
11432
|
+
function headCommit4(node) {
|
|
11373
11433
|
return node?.oid ? releaseCommit(node.oid, node) : null;
|
|
11374
11434
|
}
|
|
11375
11435
|
function environmentNodes(repository, count10) {
|
|
@@ -11396,7 +11456,7 @@ async function liveDeployments(cwd, repo, environments) {
|
|
|
11396
11456
|
if (!repository) throw new Error(`Repository not readable: ${repo}`);
|
|
11397
11457
|
return {
|
|
11398
11458
|
defaultBranch: repository.defaultBranchRef?.name ?? null,
|
|
11399
|
-
head:
|
|
11459
|
+
head: headCommit4(repository.defaultBranchRef?.target),
|
|
11400
11460
|
...deploymentMaps(environmentNodes(repository, distinct.length))
|
|
11401
11461
|
};
|
|
11402
11462
|
}
|
|
@@ -11787,13 +11847,13 @@ function expandEnv(env) {
|
|
|
11787
11847
|
}
|
|
11788
11848
|
|
|
11789
11849
|
// src/commands/run/resolveCommand.ts
|
|
11790
|
-
import { execFileSync as
|
|
11850
|
+
import { execFileSync as execFileSync4 } from "child_process";
|
|
11791
11851
|
import { existsSync as existsSync22 } from "fs";
|
|
11792
11852
|
import { dirname as dirname11, join as join26, resolve as resolve10 } from "path";
|
|
11793
11853
|
function resolveCommand(command) {
|
|
11794
11854
|
if (process.platform !== "win32" || command !== "bash") return command;
|
|
11795
11855
|
try {
|
|
11796
|
-
const gitPath =
|
|
11856
|
+
const gitPath = execFileSync4("where", ["git"], { encoding: "utf8" }).trim().split("\r\n")[0];
|
|
11797
11857
|
const gitRoot = resolve10(dirname11(gitPath), "..");
|
|
11798
11858
|
const gitBash = join26(gitRoot, "bin", "bash.exe");
|
|
11799
11859
|
if (existsSync22(gitBash)) return gitBash;
|
|
@@ -12359,14 +12419,14 @@ function coerceString(key, raw) {
|
|
|
12359
12419
|
|
|
12360
12420
|
// src/shared/configLeafSchema.ts
|
|
12361
12421
|
function configLeafSchema(schema2, key) {
|
|
12362
|
-
let
|
|
12422
|
+
let current2 = schema2;
|
|
12363
12423
|
for (const name of key.split(".")) {
|
|
12364
|
-
const { inner } = unwrapSchemaNode(
|
|
12424
|
+
const { inner } = unwrapSchemaNode(current2);
|
|
12365
12425
|
const child = inner.def?.type === "object" ? inner.def.shape?.[name] : void 0;
|
|
12366
12426
|
if (!child) return void 0;
|
|
12367
|
-
|
|
12427
|
+
current2 = child;
|
|
12368
12428
|
}
|
|
12369
|
-
return
|
|
12429
|
+
return current2;
|
|
12370
12430
|
}
|
|
12371
12431
|
|
|
12372
12432
|
// src/commands/config/coerceStructuredConfigValue.ts
|
|
@@ -12496,17 +12556,17 @@ function coerceUnion(key, raw, types) {
|
|
|
12496
12556
|
|
|
12497
12557
|
// src/shared/valueAtConfigPath.ts
|
|
12498
12558
|
function valueAtConfigPath(value, path109) {
|
|
12499
|
-
let
|
|
12559
|
+
let current2 = value;
|
|
12500
12560
|
for (const key of path109) {
|
|
12501
12561
|
if (typeof key === "number") {
|
|
12502
|
-
if (!Array.isArray(
|
|
12503
|
-
|
|
12562
|
+
if (!Array.isArray(current2)) return void 0;
|
|
12563
|
+
current2 = current2[key];
|
|
12504
12564
|
continue;
|
|
12505
12565
|
}
|
|
12506
|
-
if (typeof
|
|
12507
|
-
|
|
12566
|
+
if (typeof current2 !== "object" || current2 === null) return void 0;
|
|
12567
|
+
current2 = current2[key];
|
|
12508
12568
|
}
|
|
12509
|
-
return
|
|
12569
|
+
return current2;
|
|
12510
12570
|
}
|
|
12511
12571
|
|
|
12512
12572
|
// src/shared/restoreConfigSecrets.ts
|
|
@@ -12715,9 +12775,9 @@ async function applyUserConfigSet(key, coerced) {
|
|
|
12715
12775
|
const nodeOnly = userDbKeyError(key, "Set");
|
|
12716
12776
|
if (nodeOnly) return nodeOnly;
|
|
12717
12777
|
const orm = await getDb();
|
|
12718
|
-
const outcome = await updateUserConfig(orm, (
|
|
12719
|
-
const value = typeof coerced === "function" ? coerced(getNestedValue(
|
|
12720
|
-
const config = setNestedValue(
|
|
12778
|
+
const outcome = await updateUserConfig(orm, (current2) => {
|
|
12779
|
+
const value = typeof coerced === "function" ? coerced(getNestedValue(current2, key)) : coerced;
|
|
12780
|
+
const config = setNestedValue(current2, key, value);
|
|
12721
12781
|
const validation = validateConfig(config, key);
|
|
12722
12782
|
return validation.ok ? { ok: true, config, result: void 0 } : validation;
|
|
12723
12783
|
});
|
|
@@ -12943,9 +13003,9 @@ async function applyUserConfigUnset(key) {
|
|
|
12943
13003
|
const nodeOnly = userDbKeyError(key, "Unset");
|
|
12944
13004
|
if (nodeOnly) return nodeOnly;
|
|
12945
13005
|
const orm = await getDb();
|
|
12946
|
-
const outcome = await updateUserConfig(orm, (
|
|
12947
|
-
const { config, removed } = unsetNestedValue(
|
|
12948
|
-
if (!removed) return { ok: true, config:
|
|
13006
|
+
const outcome = await updateUserConfig(orm, (current2) => {
|
|
13007
|
+
const { config, removed } = unsetNestedValue(current2, key);
|
|
13008
|
+
if (!removed) return { ok: true, config: current2, result: false };
|
|
12949
13009
|
const validation = validateConfig(config, key);
|
|
12950
13010
|
return validation.ok ? { ok: true, config, result: true } : validation;
|
|
12951
13011
|
});
|
|
@@ -13020,6 +13080,15 @@ function autoRestartEnabled(installDir) {
|
|
|
13020
13080
|
}
|
|
13021
13081
|
}
|
|
13022
13082
|
|
|
13083
|
+
// src/commands/sessions/web/updates/autoRestart/autoRestartWait.ts
|
|
13084
|
+
var current;
|
|
13085
|
+
var autoRestartWait = {
|
|
13086
|
+
get: () => current,
|
|
13087
|
+
set: (wait2) => {
|
|
13088
|
+
current = wait2;
|
|
13089
|
+
}
|
|
13090
|
+
};
|
|
13091
|
+
|
|
13023
13092
|
// src/commands/extension/fetchLatestSignedExtension.ts
|
|
13024
13093
|
import { readFile as readFile2 } from "fs/promises";
|
|
13025
13094
|
import { join as join28 } from "path";
|
|
@@ -13075,49 +13144,6 @@ import { existsSync as existsSync26 } from "fs";
|
|
|
13075
13144
|
|
|
13076
13145
|
// src/commands/watch/gitMarkerPath.ts
|
|
13077
13146
|
import { resolve as resolve11 } from "path";
|
|
13078
|
-
|
|
13079
|
-
// src/commands/watch/resolveUpstream.ts
|
|
13080
|
-
import { execFileSync as execFileSync4 } from "child_process";
|
|
13081
|
-
function runGit3(args, cwd) {
|
|
13082
|
-
return execFileSync4("git", args, {
|
|
13083
|
-
encoding: "utf8",
|
|
13084
|
-
stdio: ["pipe", "pipe", "pipe"],
|
|
13085
|
-
cwd,
|
|
13086
|
-
windowsHide: true
|
|
13087
|
-
}).trim();
|
|
13088
|
-
}
|
|
13089
|
-
function resolveUpstream(cwd) {
|
|
13090
|
-
try {
|
|
13091
|
-
runGit3(["rev-parse", "--is-inside-work-tree"], cwd);
|
|
13092
|
-
} catch {
|
|
13093
|
-
throw new Error(
|
|
13094
|
-
"not a git repository \u2014 run assist watch wait from inside a repo"
|
|
13095
|
-
);
|
|
13096
|
-
}
|
|
13097
|
-
let branch2;
|
|
13098
|
-
try {
|
|
13099
|
-
branch2 = runGit3(["symbolic-ref", "--quiet", "--short", "HEAD"], cwd);
|
|
13100
|
-
} catch {
|
|
13101
|
-
throw new Error(
|
|
13102
|
-
"HEAD is detached \u2014 check out a branch before waiting on its upstream"
|
|
13103
|
-
);
|
|
13104
|
-
}
|
|
13105
|
-
try {
|
|
13106
|
-
return {
|
|
13107
|
-
branch: branch2,
|
|
13108
|
-
upstream: runGit3(
|
|
13109
|
-
["rev-parse", "--abbrev-ref", "--symbolic-full-name", "@{u}"],
|
|
13110
|
-
cwd
|
|
13111
|
-
)
|
|
13112
|
-
};
|
|
13113
|
-
} catch {
|
|
13114
|
-
throw new Error(
|
|
13115
|
-
`branch "${branch2}" has no upstream \u2014 set one with: git push -u origin ${branch2}`
|
|
13116
|
-
);
|
|
13117
|
-
}
|
|
13118
|
-
}
|
|
13119
|
-
|
|
13120
|
-
// src/commands/watch/gitMarkerPath.ts
|
|
13121
13147
|
function gitMarkerPath(name, cwd) {
|
|
13122
13148
|
return resolve11(
|
|
13123
13149
|
cwd ?? process.cwd(),
|
|
@@ -13269,24 +13295,6 @@ function pendingRestarts(input) {
|
|
|
13269
13295
|
];
|
|
13270
13296
|
}
|
|
13271
13297
|
|
|
13272
|
-
// src/commands/watch/headCommit.ts
|
|
13273
|
-
function headCommit4(cwd) {
|
|
13274
|
-
try {
|
|
13275
|
-
return runGit3(["rev-parse", "HEAD"], cwd);
|
|
13276
|
-
} catch {
|
|
13277
|
-
return void 0;
|
|
13278
|
-
}
|
|
13279
|
-
}
|
|
13280
|
-
|
|
13281
|
-
// src/commands/sessions/web/updates/webStartCommit.ts
|
|
13282
|
-
var captured;
|
|
13283
|
-
var webStartCommit = {
|
|
13284
|
-
capture: () => {
|
|
13285
|
-
captured = headCommit4(getInstallDir());
|
|
13286
|
-
},
|
|
13287
|
-
value: () => captured
|
|
13288
|
-
};
|
|
13289
|
-
|
|
13290
13298
|
// src/commands/sessions/web/updates/readRestartState.ts
|
|
13291
13299
|
async function readRestartState(installDir) {
|
|
13292
13300
|
const reply2 = await requestDaemonReply(
|
|
@@ -13361,6 +13369,7 @@ async function updates(_req, res) {
|
|
|
13361
13369
|
buildPending,
|
|
13362
13370
|
restart,
|
|
13363
13371
|
autoRestart: autoRestartEnabled(installDir),
|
|
13372
|
+
autoRestartWait: autoRestartWait.get(),
|
|
13364
13373
|
daemonReachable: reply2 !== void 0,
|
|
13365
13374
|
loop: reply2?.loop ?? {
|
|
13366
13375
|
phase: "off",
|
|
@@ -13847,10 +13856,10 @@ function createKeyHandler(deps2) {
|
|
|
13847
13856
|
}
|
|
13848
13857
|
|
|
13849
13858
|
// src/commands/sessions/web/restartMenu/nextIndex.ts
|
|
13850
|
-
function nextIndex(items2,
|
|
13859
|
+
function nextIndex(items2, current2, direction) {
|
|
13851
13860
|
const n = items2.length;
|
|
13852
|
-
if (n === 0) return
|
|
13853
|
-
return (
|
|
13861
|
+
if (n === 0) return current2;
|
|
13862
|
+
return (current2 + direction + n) % n;
|
|
13854
13863
|
}
|
|
13855
13864
|
function firstEnabledIndex(items2) {
|
|
13856
13865
|
const idx = items2.findIndex((item) => !item.disabled);
|
|
@@ -14057,6 +14066,11 @@ async function attemptAutoRestart(deps2, target, built) {
|
|
|
14057
14066
|
}
|
|
14058
14067
|
}
|
|
14059
14068
|
|
|
14069
|
+
// src/commands/sessions/web/updates/autoRestart/autoRestartTarget.ts
|
|
14070
|
+
function autoRestartTarget(restart) {
|
|
14071
|
+
return restart.length > 1 ? "both" : restart[0];
|
|
14072
|
+
}
|
|
14073
|
+
|
|
14060
14074
|
// src/commands/sessions/web/updates/autoRestart/autoRestartBlocker.ts
|
|
14061
14075
|
function isBusy(session) {
|
|
14062
14076
|
if (session.node !== void 0 || session.commandType === "run") return false;
|
|
@@ -14075,45 +14089,62 @@ function autoRestartBlocker(input) {
|
|
|
14075
14089
|
return void 0;
|
|
14076
14090
|
}
|
|
14077
14091
|
|
|
14078
|
-
// src/commands/sessions/web/updates/autoRestart/
|
|
14079
|
-
function
|
|
14080
|
-
|
|
14092
|
+
// src/commands/sessions/web/updates/autoRestart/blockedBy.ts
|
|
14093
|
+
function blockedBy(snap, attempted2) {
|
|
14094
|
+
if (attempted2 === snap.built) return "already attempted";
|
|
14095
|
+
return autoRestartBlocker(snap);
|
|
14096
|
+
}
|
|
14097
|
+
|
|
14098
|
+
// src/commands/sessions/web/updates/autoRestart/createAutoRestartNotes.ts
|
|
14099
|
+
function createAutoRestartNotes(deps2) {
|
|
14100
|
+
const report = deps2.report ?? (() => {
|
|
14101
|
+
});
|
|
14102
|
+
let idleSince;
|
|
14103
|
+
let lastNote;
|
|
14104
|
+
return {
|
|
14105
|
+
idleSince: () => idleSince,
|
|
14106
|
+
settling: (at2) => {
|
|
14107
|
+
idleSince = at2;
|
|
14108
|
+
},
|
|
14109
|
+
note: (message3, wait2) => {
|
|
14110
|
+
if (message3 !== void 0 && message3 !== lastNote)
|
|
14111
|
+
deps2.log(`auto-restart: ${message3}`);
|
|
14112
|
+
lastNote = message3;
|
|
14113
|
+
idleSince = void 0;
|
|
14114
|
+
report(wait2);
|
|
14115
|
+
}
|
|
14116
|
+
};
|
|
14081
14117
|
}
|
|
14082
14118
|
|
|
14083
14119
|
// src/commands/sessions/web/updates/autoRestart/createAutoRestartCheck.ts
|
|
14084
14120
|
var AUTO_RESTART_SETTLE_MS = 6e4;
|
|
14085
|
-
function skipReason(snap, attempted2) {
|
|
14086
|
-
if (attempted2 === snap.built) return `: already attempted for v${snap.built}`;
|
|
14087
|
-
const blocker = autoRestartBlocker(snap);
|
|
14088
|
-
return blocker && ` for v${snap.built}: ${blocker}`;
|
|
14089
|
-
}
|
|
14090
14121
|
function createAutoRestartCheck(deps2) {
|
|
14091
14122
|
const now = deps2.now ?? Date.now;
|
|
14092
|
-
|
|
14093
|
-
|
|
14094
|
-
const note = (message3) => {
|
|
14095
|
-
if (message3 !== void 0 && message3 !== lastNote)
|
|
14096
|
-
deps2.log(`auto-restart: ${message3}`);
|
|
14097
|
-
lastNote = message3;
|
|
14098
|
-
idleSince = void 0;
|
|
14099
|
-
};
|
|
14123
|
+
const notes = createAutoRestartNotes(deps2);
|
|
14124
|
+
const { note } = notes;
|
|
14100
14125
|
return async function tick() {
|
|
14101
14126
|
if (!deps2.enabled()) return note(void 0);
|
|
14102
14127
|
const snap = await deps2.snapshot();
|
|
14103
14128
|
if (snap.restart.length === 0) return note(void 0);
|
|
14104
14129
|
const target = autoRestartTarget(snap.restart);
|
|
14105
|
-
const
|
|
14106
|
-
if (
|
|
14130
|
+
const blocker = blockedBy(snap, deps2.attempted.get());
|
|
14131
|
+
if (blocker)
|
|
14132
|
+
return note(
|
|
14133
|
+
`skipped ${target} restart for v${snap.built}: ${blocker}`,
|
|
14134
|
+
blocker
|
|
14135
|
+
);
|
|
14107
14136
|
const at2 = now();
|
|
14137
|
+
const idleSince = notes.idleSince();
|
|
14108
14138
|
if (idleSince === void 0) {
|
|
14109
14139
|
note(
|
|
14110
|
-
`${target} restart for v${snap.built} ready; restarting once idle for ${AUTO_RESTART_SETTLE_MS / 1e3}s
|
|
14140
|
+
`${target} restart for v${snap.built} ready; restarting once idle for ${AUTO_RESTART_SETTLE_MS / 1e3}s`,
|
|
14141
|
+
`idle \xB7 restarting within ${AUTO_RESTART_SETTLE_MS / 1e3}s`
|
|
14111
14142
|
);
|
|
14112
|
-
|
|
14143
|
+
notes.settling(at2);
|
|
14113
14144
|
return;
|
|
14114
14145
|
}
|
|
14115
14146
|
if (at2 - idleSince < AUTO_RESTART_SETTLE_MS) return;
|
|
14116
|
-
note(void 0);
|
|
14147
|
+
note(void 0, "restarting");
|
|
14117
14148
|
await attemptAutoRestart(deps2, target, snap.built);
|
|
14118
14149
|
};
|
|
14119
14150
|
}
|
|
@@ -14154,7 +14185,8 @@ function startAutoRestart(port) {
|
|
|
14154
14185
|
snapshot: () => snapshot(installDir),
|
|
14155
14186
|
attempted: autoRestartAttempts(port),
|
|
14156
14187
|
restart: (target) => performRestart(target),
|
|
14157
|
-
log: (message3) => void logViaDaemon(message3)
|
|
14188
|
+
log: (message3) => void logViaDaemon(message3),
|
|
14189
|
+
report: autoRestartWait.set
|
|
14158
14190
|
});
|
|
14159
14191
|
let running3 = false;
|
|
14160
14192
|
setInterval(() => {
|
|
@@ -14326,10 +14358,10 @@ function resolveRepoGroup(cwd) {
|
|
|
14326
14358
|
};
|
|
14327
14359
|
const reaped = worktreeAttributionIncludingReaped(cwd);
|
|
14328
14360
|
if (!reaped) return { group: void 0, stable: repoDirExists(cwd) };
|
|
14329
|
-
const
|
|
14361
|
+
const current2 = currentOriginOfClone(reaped.clone);
|
|
14330
14362
|
return {
|
|
14331
|
-
group: hostedGroup(
|
|
14332
|
-
stable:
|
|
14363
|
+
group: hostedGroup(current2?.origin ?? reaped.origin, reaped.clone),
|
|
14364
|
+
stable: current2?.stable === true
|
|
14333
14365
|
};
|
|
14334
14366
|
}
|
|
14335
14367
|
function currentOriginOfClone(clone) {
|
|
@@ -16065,11 +16097,11 @@ import { existsSync as existsSync39 } from "fs";
|
|
|
16065
16097
|
import { dirname as dirname26, join as join45 } from "path";
|
|
16066
16098
|
import { fileURLToPath as fileURLToPath5 } from "url";
|
|
16067
16099
|
function adviceDir() {
|
|
16068
|
-
let
|
|
16069
|
-
while (
|
|
16070
|
-
const candidate = join45(
|
|
16100
|
+
let current2 = dirname26(fileURLToPath5(import.meta.url));
|
|
16101
|
+
while (current2 !== dirname26(current2)) {
|
|
16102
|
+
const candidate = join45(current2, "claude", "advice");
|
|
16071
16103
|
if (existsSync39(candidate)) return candidate;
|
|
16072
|
-
|
|
16104
|
+
current2 = dirname26(current2);
|
|
16073
16105
|
}
|
|
16074
16106
|
throw new Error("Could not locate the shipped claude/advice directory");
|
|
16075
16107
|
}
|
|
@@ -17231,13 +17263,13 @@ function scheduleStatus() {
|
|
|
17231
17263
|
console.error(`assist backup runs every ${block.every} (${block.cron}).`);
|
|
17232
17264
|
}
|
|
17233
17265
|
function scheduleRemove() {
|
|
17234
|
-
const
|
|
17235
|
-
if (!readScheduleBlock(
|
|
17266
|
+
const current2 = readCrontab();
|
|
17267
|
+
if (!readScheduleBlock(current2)) {
|
|
17236
17268
|
console.error("No assist backup schedule is set; nothing to remove.");
|
|
17237
17269
|
return;
|
|
17238
17270
|
}
|
|
17239
17271
|
try {
|
|
17240
|
-
writeCrontab(removeScheduleBlock(
|
|
17272
|
+
writeCrontab(removeScheduleBlock(current2));
|
|
17241
17273
|
} catch (error) {
|
|
17242
17274
|
fail2(error.message);
|
|
17243
17275
|
}
|
|
@@ -18141,9 +18173,9 @@ async function countRows(client, table) {
|
|
|
18141
18173
|
);
|
|
18142
18174
|
return rows[0].n;
|
|
18143
18175
|
}
|
|
18144
|
-
function printSummary(tables,
|
|
18176
|
+
function printSummary(tables, current2, incoming) {
|
|
18145
18177
|
const lines2 = tables.map(
|
|
18146
|
-
(t, i) => ` ${t.name}: ${
|
|
18178
|
+
(t, i) => ` ${t.name}: ${current2[i]} \u2192 ${incoming[i]} rows`
|
|
18147
18179
|
);
|
|
18148
18180
|
console.error(chalk53.bold("\nThis will REPLACE all backlog data:"));
|
|
18149
18181
|
console.error(`${lines2.join("\n")}
|
|
@@ -18155,10 +18187,10 @@ async function confirmReplace(client, tables, incoming, fromStdin) {
|
|
|
18155
18187
|
"Reading a dump from stdin requires --yes (stdin is consumed by the dump)."
|
|
18156
18188
|
);
|
|
18157
18189
|
}
|
|
18158
|
-
const
|
|
18190
|
+
const current2 = await Promise.all(
|
|
18159
18191
|
tables.map((t) => countRows(client, t.name))
|
|
18160
18192
|
);
|
|
18161
|
-
printSummary(tables,
|
|
18193
|
+
printSummary(tables, current2, incoming);
|
|
18162
18194
|
return promptConfirm("Replace all backlog data with this dump?", false);
|
|
18163
18195
|
}
|
|
18164
18196
|
|
|
@@ -18925,11 +18957,11 @@ function hasCycle(adjacency, fromId, toId) {
|
|
|
18925
18957
|
const visited = /* @__PURE__ */ new Set();
|
|
18926
18958
|
const stack = [toId];
|
|
18927
18959
|
while (stack.length > 0) {
|
|
18928
|
-
const
|
|
18929
|
-
if (
|
|
18930
|
-
if (visited.has(
|
|
18931
|
-
visited.add(
|
|
18932
|
-
for (const target of adjacency.get(
|
|
18960
|
+
const current2 = stack.pop();
|
|
18961
|
+
if (current2 === fromId) return true;
|
|
18962
|
+
if (visited.has(current2)) continue;
|
|
18963
|
+
visited.add(current2);
|
|
18964
|
+
for (const target of adjacency.get(current2) ?? []) {
|
|
18933
18965
|
stack.push(target);
|
|
18934
18966
|
}
|
|
18935
18967
|
}
|
|
@@ -21430,8 +21462,8 @@ function hasListMutations(options2) {
|
|
|
21430
21462
|
options2.add && options2.add.length > 0 || options2.edit || options2.remove
|
|
21431
21463
|
);
|
|
21432
21464
|
}
|
|
21433
|
-
function applyListMutations(
|
|
21434
|
-
let items2 = [...
|
|
21465
|
+
function applyListMutations(current2, options2, flags2) {
|
|
21466
|
+
let items2 = [...current2];
|
|
21435
21467
|
if (options2.edit) {
|
|
21436
21468
|
const [rawIndex, ...textParts] = options2.edit;
|
|
21437
21469
|
if (rawIndex === void 0 || textParts.length === 0) {
|
|
@@ -21464,7 +21496,7 @@ function applyListMutations(current, options2, flags2) {
|
|
|
21464
21496
|
}
|
|
21465
21497
|
|
|
21466
21498
|
// src/commands/backlog/update/resolveListUpdate.ts
|
|
21467
|
-
function resolveListUpdate(whole,
|
|
21499
|
+
function resolveListUpdate(whole, current2, mutations, wholeFlag, flags2) {
|
|
21468
21500
|
if (!hasListMutations(mutations)) return { ok: true, items: whole };
|
|
21469
21501
|
if (whole) {
|
|
21470
21502
|
return {
|
|
@@ -21472,7 +21504,7 @@ function resolveListUpdate(whole, current, mutations, wholeFlag, flags2) {
|
|
|
21472
21504
|
error: `Cannot combine ${wholeFlag} with ${flags2.add}/${flags2.edit}/${flags2.remove}.`
|
|
21473
21505
|
};
|
|
21474
21506
|
}
|
|
21475
|
-
return applyListMutations(
|
|
21507
|
+
return applyListMutations(current2, mutations, flags2);
|
|
21476
21508
|
}
|
|
21477
21509
|
|
|
21478
21510
|
// src/commands/backlog/resolvePhaseFields.ts
|
|
@@ -21486,19 +21518,19 @@ var CHECK_FLAGS = {
|
|
|
21486
21518
|
edit: "--edit-check",
|
|
21487
21519
|
remove: "--remove-check"
|
|
21488
21520
|
};
|
|
21489
|
-
function resolveTasks(o,
|
|
21521
|
+
function resolveTasks(o, current2) {
|
|
21490
21522
|
return resolveListUpdate(
|
|
21491
21523
|
o.task,
|
|
21492
|
-
(
|
|
21524
|
+
(current2?.tasks ?? []).map((t) => t.task),
|
|
21493
21525
|
{ add: o.addTask, edit: o.editTask, remove: o.removeTask },
|
|
21494
21526
|
"--task",
|
|
21495
21527
|
TASK_FLAGS
|
|
21496
21528
|
);
|
|
21497
21529
|
}
|
|
21498
|
-
function resolveChecks(o,
|
|
21530
|
+
function resolveChecks(o, current2) {
|
|
21499
21531
|
return resolveListUpdate(
|
|
21500
21532
|
o.manualCheck,
|
|
21501
|
-
|
|
21533
|
+
current2?.manualChecks ?? [],
|
|
21502
21534
|
{ add: o.addCheck, edit: o.editCheck, remove: o.removeCheck },
|
|
21503
21535
|
"--manual-check",
|
|
21504
21536
|
CHECK_FLAGS
|
|
@@ -21518,10 +21550,10 @@ function buildFields(name, tasks, checks2) {
|
|
|
21518
21550
|
}
|
|
21519
21551
|
return { ok: true, fields };
|
|
21520
21552
|
}
|
|
21521
|
-
function resolvePhaseFields(options2,
|
|
21522
|
-
const tasks = resolveTasks(options2,
|
|
21553
|
+
function resolvePhaseFields(options2, current2) {
|
|
21554
|
+
const tasks = resolveTasks(options2, current2);
|
|
21523
21555
|
if (!tasks.ok) return tasks;
|
|
21524
|
-
const checks2 = resolveChecks(options2,
|
|
21556
|
+
const checks2 = resolveChecks(options2, current2);
|
|
21525
21557
|
if (!checks2.ok) return checks2;
|
|
21526
21558
|
return buildFields(options2.name, tasks, checks2);
|
|
21527
21559
|
}
|
|
@@ -21643,9 +21675,9 @@ function hasAcMutations(options2) {
|
|
|
21643
21675
|
remove: options2.removeAc
|
|
21644
21676
|
});
|
|
21645
21677
|
}
|
|
21646
|
-
function applyAcMutations(
|
|
21678
|
+
function applyAcMutations(current2, options2) {
|
|
21647
21679
|
const result = applyListMutations(
|
|
21648
|
-
|
|
21680
|
+
current2,
|
|
21649
21681
|
{ add: options2.addAc, edit: options2.editAc, remove: options2.removeAc },
|
|
21650
21682
|
{ add: "--add-ac", edit: "--edit-ac", remove: "--remove-ac" }
|
|
21651
21683
|
);
|
|
@@ -22410,7 +22442,7 @@ function isUnderPosixTmp(target, tmp) {
|
|
|
22410
22442
|
}
|
|
22411
22443
|
|
|
22412
22444
|
// src/shared/consumeRedirect.ts
|
|
22413
|
-
function consumeRedirect(tokens, opIndex,
|
|
22445
|
+
function consumeRedirect(tokens, opIndex, current2) {
|
|
22414
22446
|
const target = tokens[opIndex + 1];
|
|
22415
22447
|
if (typeof target !== "string") {
|
|
22416
22448
|
return { ok: false, error: "unable to parse" };
|
|
@@ -22421,32 +22453,32 @@ function consumeRedirect(tokens, opIndex, current) {
|
|
|
22421
22453
|
error: `redirect target '${target}' is outside the OS temp directory`
|
|
22422
22454
|
};
|
|
22423
22455
|
}
|
|
22424
|
-
popFdPrefix(
|
|
22456
|
+
popFdPrefix(current2);
|
|
22425
22457
|
return { ok: true, nextIndex: opIndex + 1 };
|
|
22426
22458
|
}
|
|
22427
|
-
function popFdPrefix(
|
|
22428
|
-
if (
|
|
22429
|
-
|
|
22459
|
+
function popFdPrefix(current2) {
|
|
22460
|
+
if (current2.length > 0 && /^\d$/.test(current2[current2.length - 1])) {
|
|
22461
|
+
current2.pop();
|
|
22430
22462
|
}
|
|
22431
22463
|
}
|
|
22432
22464
|
|
|
22433
22465
|
// src/shared/consumeHeredoc.ts
|
|
22434
|
-
function consumeHeredoc(tokens, opIndex,
|
|
22466
|
+
function consumeHeredoc(tokens, opIndex, current2) {
|
|
22435
22467
|
const delimiter = tokens[opIndex + 2];
|
|
22436
22468
|
if (typeof delimiter !== "string") {
|
|
22437
22469
|
return { ok: false, error: "unable to parse" };
|
|
22438
22470
|
}
|
|
22439
|
-
popFdPrefix(
|
|
22471
|
+
popFdPrefix(current2);
|
|
22440
22472
|
return { ok: true, nextIndex: opIndex + 2 };
|
|
22441
22473
|
}
|
|
22442
22474
|
|
|
22443
22475
|
// src/shared/consumeInputRedirect.ts
|
|
22444
|
-
function consumeInputRedirect(tokens, opIndex,
|
|
22476
|
+
function consumeInputRedirect(tokens, opIndex, current2) {
|
|
22445
22477
|
const source = tokens[opIndex + 1];
|
|
22446
22478
|
if (typeof source !== "string") {
|
|
22447
22479
|
return { ok: false, error: "unable to parse" };
|
|
22448
22480
|
}
|
|
22449
|
-
popFdPrefix(
|
|
22481
|
+
popFdPrefix(current2);
|
|
22450
22482
|
return { ok: true, nextIndex: opIndex + 1 };
|
|
22451
22483
|
}
|
|
22452
22484
|
|
|
@@ -22480,8 +22512,8 @@ function handleToken(tokens, i, groups) {
|
|
|
22480
22512
|
return consumeRedirect(tokens, i, groups[groups.length - 1]);
|
|
22481
22513
|
}
|
|
22482
22514
|
if (op === INPUT_REDIRECT_OP) {
|
|
22483
|
-
const
|
|
22484
|
-
return getOp(tokens[i + 1]) === INPUT_REDIRECT_OP ? consumeHeredoc(tokens, i,
|
|
22515
|
+
const current2 = groups[groups.length - 1];
|
|
22516
|
+
return getOp(tokens[i + 1]) === INPUT_REDIRECT_OP ? consumeHeredoc(tokens, i, current2) : consumeInputRedirect(tokens, i, current2);
|
|
22485
22517
|
}
|
|
22486
22518
|
return UNPARSEABLE;
|
|
22487
22519
|
}
|
|
@@ -22882,29 +22914,29 @@ function configuresReleases(command) {
|
|
|
22882
22914
|
// src/shared/tokenize.ts
|
|
22883
22915
|
function tokenize(command) {
|
|
22884
22916
|
const tokens = [];
|
|
22885
|
-
let
|
|
22917
|
+
let current2 = "";
|
|
22886
22918
|
let inSingle = false;
|
|
22887
22919
|
let inDouble = false;
|
|
22888
22920
|
for (let i = 0; i < command.length; i++) {
|
|
22889
22921
|
const ch = command[i];
|
|
22890
22922
|
if (ch === "'" && !inDouble) {
|
|
22891
22923
|
inSingle = !inSingle;
|
|
22892
|
-
|
|
22924
|
+
current2 += ch;
|
|
22893
22925
|
} else if (ch === '"' && !inSingle) {
|
|
22894
22926
|
inDouble = !inDouble;
|
|
22895
|
-
|
|
22927
|
+
current2 += ch;
|
|
22896
22928
|
} else if (ch === "\\" && inDouble && i + 1 < command.length) {
|
|
22897
|
-
|
|
22929
|
+
current2 += ch + command[++i];
|
|
22898
22930
|
} else if (/\s/.test(ch) && !inSingle && !inDouble) {
|
|
22899
|
-
if (
|
|
22900
|
-
tokens.push(
|
|
22901
|
-
|
|
22931
|
+
if (current2) {
|
|
22932
|
+
tokens.push(current2);
|
|
22933
|
+
current2 = "";
|
|
22902
22934
|
}
|
|
22903
22935
|
} else {
|
|
22904
|
-
|
|
22936
|
+
current2 += ch;
|
|
22905
22937
|
}
|
|
22906
22938
|
}
|
|
22907
|
-
if (
|
|
22939
|
+
if (current2) tokens.push(current2);
|
|
22908
22940
|
return tokens;
|
|
22909
22941
|
}
|
|
22910
22942
|
|
|
@@ -24439,8 +24471,8 @@ function upstreamBranch() {
|
|
|
24439
24471
|
function warnIfUnexpectedBranch(config) {
|
|
24440
24472
|
const expected = config.commit?.expectedBranch;
|
|
24441
24473
|
if (!expected) return;
|
|
24442
|
-
const
|
|
24443
|
-
if (
|
|
24474
|
+
const current2 = currentBranch3();
|
|
24475
|
+
if (current2 === null || current2 === expected) return;
|
|
24444
24476
|
if (upstreamBranch() === expected) return;
|
|
24445
24477
|
const line = "\u2500".repeat(64);
|
|
24446
24478
|
console.warn(
|
|
@@ -24448,7 +24480,7 @@ function warnIfUnexpectedBranch(config) {
|
|
|
24448
24480
|
[
|
|
24449
24481
|
"",
|
|
24450
24482
|
line,
|
|
24451
|
-
`\u26A0 On branch "${
|
|
24483
|
+
`\u26A0 On branch "${current2}", but this repo expects "${expected}".`,
|
|
24452
24484
|
` Work committed here may be orphaned and never reach "${expected}".`,
|
|
24453
24485
|
line,
|
|
24454
24486
|
""
|
|
@@ -25681,8 +25713,8 @@ function exitWithConfigErrors(errors) {
|
|
|
25681
25713
|
|
|
25682
25714
|
// src/commands/config/diffRepoConfigLeaves.ts
|
|
25683
25715
|
import { isDeepStrictEqual as isDeepStrictEqual2 } from "util";
|
|
25684
|
-
function diffRepoConfigLeaves(
|
|
25685
|
-
const existing = new Map(leaves(
|
|
25716
|
+
function diffRepoConfigLeaves(current2, incoming) {
|
|
25717
|
+
const existing = new Map(leaves(current2));
|
|
25686
25718
|
return leaves(incoming).flatMap(([key, to]) => {
|
|
25687
25719
|
if (!existing.has(key)) return [{ key, to }];
|
|
25688
25720
|
const from = existing.get(key);
|
|
@@ -25703,12 +25735,12 @@ function isPlainObject4(value) {
|
|
|
25703
25735
|
function planRepoConfigImport(ymlRepos, dbRepos) {
|
|
25704
25736
|
return Object.entries(ymlRepos).map(([ymlKey, block]) => {
|
|
25705
25737
|
const dbKey = matchDbKey(dbRepos, ymlKey) ?? ymlKey;
|
|
25706
|
-
const
|
|
25738
|
+
const current2 = dbRepos[dbKey] ?? {};
|
|
25707
25739
|
const incoming = isPlainObject5(block) ? block : {};
|
|
25708
|
-
const changes = diffRepoConfigLeaves(
|
|
25740
|
+
const changes = diffRepoConfigLeaves(current2, incoming);
|
|
25709
25741
|
const merged = changes.reduce(
|
|
25710
25742
|
(acc, change) => setNestedValue(acc, change.key, change.to),
|
|
25711
|
-
|
|
25743
|
+
current2
|
|
25712
25744
|
);
|
|
25713
25745
|
const validation = validateConfig(merged, ymlKey, repoConfigSchema);
|
|
25714
25746
|
const errors = validation.ok ? [] : validation.errors.map((error) => `repos.${ymlKey}.${error}`);
|
|
@@ -25813,8 +25845,8 @@ function planValue(merged, key, incoming) {
|
|
|
25813
25845
|
};
|
|
25814
25846
|
}
|
|
25815
25847
|
function planArray(merged, key, incoming) {
|
|
25816
|
-
const
|
|
25817
|
-
const existing = Array.isArray(
|
|
25848
|
+
const current2 = getNestedValue(merged, key);
|
|
25849
|
+
const existing = Array.isArray(current2) ? current2 : [];
|
|
25818
25850
|
const added = incoming.filter(
|
|
25819
25851
|
(item) => !existing.some((entry) => isDeepStrictEqual3(entry, item))
|
|
25820
25852
|
);
|
|
@@ -25890,8 +25922,8 @@ async function configImportUser(keys) {
|
|
|
25890
25922
|
console.log("Nothing imported.");
|
|
25891
25923
|
return;
|
|
25892
25924
|
}
|
|
25893
|
-
const outcome = await updateUserConfig(orm, (
|
|
25894
|
-
const latest2 = planUserConfigImport(yml,
|
|
25925
|
+
const outcome = await updateUserConfig(orm, (current2) => {
|
|
25926
|
+
const latest2 = planUserConfigImport(yml, current2, plan2.imported);
|
|
25895
25927
|
return latest2.errors.length > 0 ? { ok: false, errors: latest2.errors } : { ok: true, config: latest2.merged, result: void 0 };
|
|
25896
25928
|
});
|
|
25897
25929
|
if (!outcome.ok) exitWithConfigErrors(outcome.errors);
|
|
@@ -27520,11 +27552,11 @@ function version() {
|
|
|
27520
27552
|
const name = getRepoName();
|
|
27521
27553
|
const lastWeek = loadDevWeeks(name, devDir).at(-1) ?? null;
|
|
27522
27554
|
const entry = lastWeek ? loadDevEntry(name, lastWeek, devDir) : null;
|
|
27523
|
-
const
|
|
27555
|
+
const current2 = getVersionAtCommit("HEAD");
|
|
27524
27556
|
printField2("name", name);
|
|
27525
27557
|
printField2("last week", lastWeek);
|
|
27526
27558
|
printField2("last version", entry?.lastVersion);
|
|
27527
|
-
printField2("current",
|
|
27559
|
+
printField2("current", current2 ? stripToMinor(current2) : null);
|
|
27528
27560
|
}
|
|
27529
27561
|
|
|
27530
27562
|
// src/commands/registerDevlog.ts
|
|
@@ -28264,20 +28296,20 @@ function findSlnInDir(dir) {
|
|
|
28264
28296
|
function findSolution() {
|
|
28265
28297
|
const repoRoot2 = findRepoRoot(process.cwd());
|
|
28266
28298
|
const ceiling = repoRoot2 ?? process.cwd();
|
|
28267
|
-
let
|
|
28299
|
+
let current2 = process.cwd();
|
|
28268
28300
|
while (true) {
|
|
28269
|
-
const slnFiles = findSlnInDir(
|
|
28301
|
+
const slnFiles = findSlnInDir(current2);
|
|
28270
28302
|
if (slnFiles.length === 1) return slnFiles[0];
|
|
28271
28303
|
if (slnFiles.length > 1) {
|
|
28272
|
-
console.error(chalk177.red(`Multiple .sln files found in ${
|
|
28304
|
+
console.error(chalk177.red(`Multiple .sln files found in ${current2}:`));
|
|
28273
28305
|
for (const f of slnFiles) console.error(` ${f}`);
|
|
28274
28306
|
console.error(
|
|
28275
28307
|
chalk177.yellow("Specify which one: assist dotnet inspect <sln>")
|
|
28276
28308
|
);
|
|
28277
28309
|
process.exit(1);
|
|
28278
28310
|
}
|
|
28279
|
-
if (
|
|
28280
|
-
|
|
28311
|
+
if (current2 === ceiling) break;
|
|
28312
|
+
current2 = dirname33(current2);
|
|
28281
28313
|
}
|
|
28282
28314
|
console.error(chalk177.red("No .sln file found between cwd and repo root"));
|
|
28283
28315
|
process.exit(1);
|
|
@@ -35119,12 +35151,12 @@ ${sections.how}`);
|
|
|
35119
35151
|
// src/commands/prs/parsePrBody.ts
|
|
35120
35152
|
function parsePrBody(body) {
|
|
35121
35153
|
const sections = [];
|
|
35122
|
-
let
|
|
35154
|
+
let current2 = null;
|
|
35123
35155
|
const flush = () => {
|
|
35124
|
-
if (
|
|
35156
|
+
if (current2) {
|
|
35125
35157
|
sections.push({
|
|
35126
|
-
heading:
|
|
35127
|
-
content:
|
|
35158
|
+
heading: current2.heading,
|
|
35159
|
+
content: current2.lines.join("\n").trim()
|
|
35128
35160
|
});
|
|
35129
35161
|
}
|
|
35130
35162
|
};
|
|
@@ -35132,9 +35164,9 @@ function parsePrBody(body) {
|
|
|
35132
35164
|
const match = /^##\s+(.+?)\s*$/.exec(line);
|
|
35133
35165
|
if (match) {
|
|
35134
35166
|
flush();
|
|
35135
|
-
|
|
35136
|
-
} else if (
|
|
35137
|
-
|
|
35167
|
+
current2 = { heading: match[1], lines: [] };
|
|
35168
|
+
} else if (current2) {
|
|
35169
|
+
current2.lines.push(line);
|
|
35138
35170
|
}
|
|
35139
35171
|
}
|
|
35140
35172
|
flush();
|
|
@@ -38370,9 +38402,9 @@ function getCalledFunctionNames(fn) {
|
|
|
38370
38402
|
function collectPrivateFunctions(target, fnMap) {
|
|
38371
38403
|
const collected = /* @__PURE__ */ new Set();
|
|
38372
38404
|
const queue = [target];
|
|
38373
|
-
let
|
|
38374
|
-
while (
|
|
38375
|
-
for (const name of getCalledFunctionNames(
|
|
38405
|
+
let current2 = queue.pop();
|
|
38406
|
+
while (current2) {
|
|
38407
|
+
for (const name of getCalledFunctionNames(current2)) {
|
|
38376
38408
|
if (collected.has(name)) continue;
|
|
38377
38409
|
const fn = fnMap.get(name);
|
|
38378
38410
|
if (fn && isPrivate(fn)) {
|
|
@@ -38380,7 +38412,7 @@ function collectPrivateFunctions(target, fnMap) {
|
|
|
38380
38412
|
queue.push(fn);
|
|
38381
38413
|
}
|
|
38382
38414
|
}
|
|
38383
|
-
|
|
38415
|
+
current2 = queue.pop();
|
|
38384
38416
|
}
|
|
38385
38417
|
return [...collected].flatMap((name) => {
|
|
38386
38418
|
const fn = fnMap.get(name);
|
|
@@ -38771,15 +38803,15 @@ var DECLARATION_KINDS = /* @__PURE__ */ new Set([
|
|
|
38771
38803
|
SyntaxKind18.ExportSpecifier
|
|
38772
38804
|
]);
|
|
38773
38805
|
function isInsideExtractedFunction(node, extracted) {
|
|
38774
|
-
let
|
|
38775
|
-
while (
|
|
38776
|
-
if (
|
|
38777
|
-
|
|
38806
|
+
let current2 = node;
|
|
38807
|
+
while (current2) {
|
|
38808
|
+
if (current2.getKind() !== SyntaxKind18.FunctionDeclaration) {
|
|
38809
|
+
current2 = current2.getParent();
|
|
38778
38810
|
continue;
|
|
38779
38811
|
}
|
|
38780
|
-
const name =
|
|
38812
|
+
const name = current2.getName?.();
|
|
38781
38813
|
if (name && extracted.has(name)) return true;
|
|
38782
|
-
|
|
38814
|
+
current2 = current2.getParent();
|
|
38783
38815
|
}
|
|
38784
38816
|
return false;
|
|
38785
38817
|
}
|
|
@@ -40271,39 +40303,39 @@ var highLevelConfigKeys = {
|
|
|
40271
40303
|
};
|
|
40272
40304
|
|
|
40273
40305
|
// src/commands/review/highLevel/buildHighLevelQuestions.ts
|
|
40274
|
-
function buildHighLevelQuestions(
|
|
40306
|
+
function buildHighLevelQuestions(current2, proposed) {
|
|
40275
40307
|
return [
|
|
40276
40308
|
{
|
|
40277
40309
|
key: highLevelConfigKeys.criticalPaths,
|
|
40278
40310
|
question: "Critical paths \u2014 comma-separated globs whose full diffs the review shows (blank to leave unset)",
|
|
40279
40311
|
suggest: suggestCriticalPaths(
|
|
40280
|
-
|
|
40312
|
+
current2.criticalPaths,
|
|
40281
40313
|
proposed.criticalPaths
|
|
40282
40314
|
)
|
|
40283
40315
|
},
|
|
40284
40316
|
{
|
|
40285
40317
|
key: highLevelConfigKeys.uiPaths,
|
|
40286
40318
|
question: "UI paths \u2014 comma-separated globs that make a change a UI change, so a screenshot or video is required (blank to leave unset)",
|
|
40287
|
-
suggest: suggestGlobs(
|
|
40319
|
+
suggest: suggestGlobs(current2.uiPaths, proposed.uiPaths)
|
|
40288
40320
|
},
|
|
40289
40321
|
{
|
|
40290
40322
|
key: highLevelConfigKeys.descriptionWordCap,
|
|
40291
40323
|
question: "Description word cap (blank to leave unset)",
|
|
40292
|
-
suggest: String(
|
|
40324
|
+
suggest: String(current2.descriptionWordCap)
|
|
40293
40325
|
},
|
|
40294
40326
|
{
|
|
40295
40327
|
key: highLevelConfigKeys.collapsedPaths,
|
|
40296
40328
|
question: "Collapsed paths \u2014 comma-separated globs whose files start collapsed in the changed-files tree (blank to leave unset)",
|
|
40297
|
-
suggest: suggestGlobs(
|
|
40329
|
+
suggest: suggestGlobs(current2.collapsedPaths, [])
|
|
40298
40330
|
}
|
|
40299
40331
|
];
|
|
40300
40332
|
}
|
|
40301
|
-
function suggestCriticalPaths(
|
|
40302
|
-
if (
|
|
40333
|
+
function suggestCriticalPaths(current2, proposed) {
|
|
40334
|
+
if (current2) return suggestGlobs(current2, []);
|
|
40303
40335
|
return [.../* @__PURE__ */ new Set([...defaultCriticalPaths, ...proposed])].join(",");
|
|
40304
40336
|
}
|
|
40305
|
-
function suggestGlobs(
|
|
40306
|
-
const globs =
|
|
40337
|
+
function suggestGlobs(current2, proposed) {
|
|
40338
|
+
const globs = current2.length > 0 ? current2 : proposed;
|
|
40307
40339
|
return globs.length > 0 ? globs.join(",") : void 0;
|
|
40308
40340
|
}
|
|
40309
40341
|
|
|
@@ -40473,11 +40505,11 @@ var NOTHING_PROPOSED2 = { criticalPaths: [], uiPaths: [] };
|
|
|
40473
40505
|
async function configureHighLevelReview(options2 = {}) {
|
|
40474
40506
|
const answers = parseConfigureAnswers(options2.answer ?? []);
|
|
40475
40507
|
const proposed = answersCoverEveryKey(answers) ? NOTHING_PROPOSED2 : proposeHighLevelGlobs();
|
|
40476
|
-
const
|
|
40508
|
+
const current2 = resolveHighLevelConfig(loadConfig());
|
|
40477
40509
|
const questions = buildHighLevelQuestions(
|
|
40478
40510
|
{
|
|
40479
|
-
...
|
|
40480
|
-
criticalPaths: isConfigKeySet(highLevelConfigKeys.criticalPaths) ?
|
|
40511
|
+
...current2,
|
|
40512
|
+
criticalPaths: isConfigKeySet(highLevelConfigKeys.criticalPaths) ? current2.criticalPaths : void 0
|
|
40481
40513
|
},
|
|
40482
40514
|
proposed
|
|
40483
40515
|
);
|
|
@@ -41776,22 +41808,22 @@ function postHighLevelReview(repo, prNumber, { event, body, comments: comments3
|
|
|
41776
41808
|
var HUNK_HEADER2 = /^@@ -(\d+)(?:,\d+)? \+(\d+)/;
|
|
41777
41809
|
function patchHunkLines(patch2) {
|
|
41778
41810
|
const hunks = [];
|
|
41779
|
-
let
|
|
41811
|
+
let current2;
|
|
41780
41812
|
let left = 0;
|
|
41781
41813
|
let right = 0;
|
|
41782
41814
|
for (const line of patch2.split("\n")) {
|
|
41783
41815
|
const header = HUNK_HEADER2.exec(line);
|
|
41784
41816
|
if (header) {
|
|
41785
|
-
|
|
41786
|
-
hunks.push(
|
|
41817
|
+
current2 = { LEFT: /* @__PURE__ */ new Set(), RIGHT: /* @__PURE__ */ new Set() };
|
|
41818
|
+
hunks.push(current2);
|
|
41787
41819
|
left = Number(header[1]);
|
|
41788
41820
|
right = Number(header[2]);
|
|
41789
|
-
} else if (!
|
|
41790
|
-
else if (line.startsWith("+"))
|
|
41791
|
-
else if (line.startsWith("-"))
|
|
41821
|
+
} else if (!current2 || line.startsWith("\\")) continue;
|
|
41822
|
+
else if (line.startsWith("+")) current2.RIGHT.add(right++);
|
|
41823
|
+
else if (line.startsWith("-")) current2.LEFT.add(left++);
|
|
41792
41824
|
else {
|
|
41793
|
-
|
|
41794
|
-
|
|
41825
|
+
current2.LEFT.add(left++);
|
|
41826
|
+
current2.RIGHT.add(right++);
|
|
41795
41827
|
}
|
|
41796
41828
|
}
|
|
41797
41829
|
return hunks;
|
|
@@ -43614,7 +43646,7 @@ async function synthesiseAfterReviewers(input) {
|
|
|
43614
43646
|
}
|
|
43615
43647
|
|
|
43616
43648
|
// src/commands/review/skipReason.ts
|
|
43617
|
-
function
|
|
43649
|
+
function skipReason(results, failures, strict) {
|
|
43618
43650
|
if (failures.length === results.length)
|
|
43619
43651
|
return "Both reviewers failed; skipping synthesis.";
|
|
43620
43652
|
if (strict && failures.length > 0)
|
|
@@ -43643,7 +43675,7 @@ async function runAndSynthesise(args) {
|
|
|
43643
43675
|
);
|
|
43644
43676
|
if (args.job) await recordReviewerRuns(fresh, args.job, startedAt);
|
|
43645
43677
|
const failures = failed2(results);
|
|
43646
|
-
const reason4 =
|
|
43678
|
+
const reason4 = skipReason(results, failures, args.strict);
|
|
43647
43679
|
if (reason4) {
|
|
43648
43680
|
console.error(reason4);
|
|
43649
43681
|
return { ok: false, failures, slots: results };
|
|
@@ -44149,10 +44181,10 @@ function currentPrNumber() {
|
|
|
44149
44181
|
}
|
|
44150
44182
|
}
|
|
44151
44183
|
function stillOnReviewedPr(prNumber) {
|
|
44152
|
-
const
|
|
44153
|
-
if (
|
|
44184
|
+
const current2 = currentPrNumber();
|
|
44185
|
+
if (current2 === prNumber) return true;
|
|
44154
44186
|
console.error(
|
|
44155
|
-
`Error: this tree is now on ${
|
|
44187
|
+
`Error: this tree is now on ${current2 === null ? "a branch with no open PR" : `PR #${current2}`}, not the reviewed PR #${prNumber}; skipping the post and any chained sessions.`
|
|
44156
44188
|
);
|
|
44157
44189
|
return false;
|
|
44158
44190
|
}
|
|
@@ -44721,12 +44753,12 @@ function resolveRuleScope(target) {
|
|
|
44721
44753
|
if (path90.basename(resolved) === "CLAUDE.md") return resolved;
|
|
44722
44754
|
const startDir = scopeDirectory(resolved);
|
|
44723
44755
|
const root2 = findRepoRoot(startDir) ?? startDir;
|
|
44724
|
-
let
|
|
44756
|
+
let current2 = startDir;
|
|
44725
44757
|
while (true) {
|
|
44726
|
-
const candidate = path90.join(
|
|
44758
|
+
const candidate = path90.join(current2, "CLAUDE.md");
|
|
44727
44759
|
if (existsSync76(candidate)) return candidate;
|
|
44728
|
-
if (
|
|
44729
|
-
|
|
44760
|
+
if (current2 === root2 || current2 === path90.dirname(current2)) break;
|
|
44761
|
+
current2 = path90.dirname(current2);
|
|
44730
44762
|
}
|
|
44731
44763
|
return path90.join(root2, "CLAUDE.md");
|
|
44732
44764
|
}
|
|
@@ -44777,8 +44809,8 @@ function optionsError(options2) {
|
|
|
44777
44809
|
return void 0;
|
|
44778
44810
|
}
|
|
44779
44811
|
async function addToUserDb(rule) {
|
|
44780
|
-
const result = await applyUserConfigSet("advice.rules", (
|
|
44781
|
-
...asRules(
|
|
44812
|
+
const result = await applyUserConfigSet("advice.rules", (current2) => [
|
|
44813
|
+
...asRules(current2),
|
|
44782
44814
|
rule
|
|
44783
44815
|
]);
|
|
44784
44816
|
if (!result.ok) return fail10(result.errors.join("\n"));
|
|
@@ -46371,23 +46403,23 @@ function joinWithOverlap(currentText, nextText) {
|
|
|
46371
46403
|
}
|
|
46372
46404
|
return currentText.includes(nextText) ? currentText : `${currentText} ${nextText}`;
|
|
46373
46405
|
}
|
|
46374
|
-
function canMergeCues(
|
|
46375
|
-
return
|
|
46406
|
+
function canMergeCues(current2, next3) {
|
|
46407
|
+
return current2.speaker === next3.speaker && next3.startMs <= current2.endMs + 500;
|
|
46376
46408
|
}
|
|
46377
46409
|
function mergeOverlappingCues(cues) {
|
|
46378
46410
|
if (cues.length === 0) return [];
|
|
46379
46411
|
const result = [];
|
|
46380
|
-
let
|
|
46412
|
+
let current2 = { ...cues[0] };
|
|
46381
46413
|
for (let i = 1; i < cues.length; i++) {
|
|
46382
|
-
if (canMergeCues(
|
|
46383
|
-
|
|
46384
|
-
|
|
46414
|
+
if (canMergeCues(current2, cues[i])) {
|
|
46415
|
+
current2.text = joinWithOverlap(current2.text, cues[i].text);
|
|
46416
|
+
current2.endMs = Math.max(current2.endMs, cues[i].endMs);
|
|
46385
46417
|
} else {
|
|
46386
|
-
result.push(
|
|
46387
|
-
|
|
46418
|
+
result.push(current2);
|
|
46419
|
+
current2 = { ...cues[i] };
|
|
46388
46420
|
}
|
|
46389
46421
|
}
|
|
46390
|
-
result.push(
|
|
46422
|
+
result.push(current2);
|
|
46391
46423
|
return result;
|
|
46392
46424
|
}
|
|
46393
46425
|
function deduplicateCues(cues) {
|
|
@@ -46579,8 +46611,8 @@ function askQuestion2(rl, question) {
|
|
|
46579
46611
|
}
|
|
46580
46612
|
|
|
46581
46613
|
// src/commands/transcript/configure.ts
|
|
46582
|
-
function buildPrompt4(label,
|
|
46583
|
-
return
|
|
46614
|
+
function buildPrompt4(label, current2) {
|
|
46615
|
+
return current2 ? `${label} [${current2}]: ` : `${label}: `;
|
|
46584
46616
|
}
|
|
46585
46617
|
function printExisting(existing) {
|
|
46586
46618
|
console.log("Current configuration:");
|
|
@@ -47309,14 +47341,14 @@ import { existsSync as existsSync86, readFileSync as readFileSync71 } from "fs";
|
|
|
47309
47341
|
// src/commands/verify/forbiddenStrings/findForbiddenStrings.ts
|
|
47310
47342
|
import { minimatch as minimatch10 } from "minimatch";
|
|
47311
47343
|
function resolveStringsAtPath(data, path109) {
|
|
47312
|
-
let
|
|
47344
|
+
let current2 = data;
|
|
47313
47345
|
for (const segment of path109.split(".")) {
|
|
47314
|
-
if (
|
|
47315
|
-
|
|
47346
|
+
if (current2 === null || typeof current2 !== "object") return [];
|
|
47347
|
+
current2 = current2[segment];
|
|
47316
47348
|
}
|
|
47317
|
-
if (typeof
|
|
47318
|
-
if (Array.isArray(
|
|
47319
|
-
return
|
|
47349
|
+
if (typeof current2 === "string") return [current2];
|
|
47350
|
+
if (Array.isArray(current2))
|
|
47351
|
+
return current2.filter(
|
|
47320
47352
|
(value) => typeof value === "string"
|
|
47321
47353
|
);
|
|
47322
47354
|
return [];
|
|
@@ -47427,10 +47459,10 @@ import { readFileSync as readFileSync72 } from "fs";
|
|
|
47427
47459
|
import path105 from "path";
|
|
47428
47460
|
|
|
47429
47461
|
// src/commands/verify/migrations/checkAppendOnly.ts
|
|
47430
|
-
function checkAppendOnly(baseline,
|
|
47462
|
+
function checkAppendOnly(baseline, current2) {
|
|
47431
47463
|
const findings2 = [];
|
|
47432
47464
|
for (const [file, content] of baseline) {
|
|
47433
|
-
const now =
|
|
47465
|
+
const now = current2.get(file);
|
|
47434
47466
|
if (now === void 0) findings2.push({ file, kind: "removed" });
|
|
47435
47467
|
else if (now !== content) findings2.push({ file, kind: "modified" });
|
|
47436
47468
|
}
|
|
@@ -47587,10 +47619,10 @@ function migrations2() {
|
|
|
47587
47619
|
const ref = resolveBaselineRef();
|
|
47588
47620
|
if (ref) {
|
|
47589
47621
|
const baseline = readBaselineMigrations(REPO_RELATIVE_DIR, ref);
|
|
47590
|
-
const
|
|
47622
|
+
const current2 = new Map(
|
|
47591
47623
|
files.map((file) => [file, readFileSync72(path105.join(dir, file), "utf8")])
|
|
47592
47624
|
);
|
|
47593
|
-
for (const finding of checkAppendOnly(baseline,
|
|
47625
|
+
for (const finding of checkAppendOnly(baseline, current2)) {
|
|
47594
47626
|
problems.push(
|
|
47595
47627
|
finding.kind === "removed" ? `Migration ${finding.file} was removed but ships in ${ref}; migrations are append-only once shipped.` : `Migration ${finding.file} was edited but already ships in ${ref}; migrations are append-only. Add a new numbered migration instead.`
|
|
47596
47628
|
);
|
|
@@ -49905,8 +49937,8 @@ import { readFile as readFile9 } from "fs/promises";
|
|
|
49905
49937
|
function normalise2(path109) {
|
|
49906
49938
|
return path109.replaceAll("\\", "/");
|
|
49907
49939
|
}
|
|
49908
|
-
function latest(
|
|
49909
|
-
return
|
|
49940
|
+
function latest(current2, at2) {
|
|
49941
|
+
return current2 === void 0 || at2 > current2 ? at2 : current2;
|
|
49910
49942
|
}
|
|
49911
49943
|
async function lastWriteTimes(transcriptPath2, target) {
|
|
49912
49944
|
const text20 = await readFile9(transcriptPath2, "utf8").catch(() => "");
|
|
@@ -51313,7 +51345,7 @@ function startAutoUpdate(ctx) {
|
|
|
51313
51345
|
stayOff(`${installDir} is not a git clone`);
|
|
51314
51346
|
return;
|
|
51315
51347
|
}
|
|
51316
|
-
autoUpdateState.setStartCommit(
|
|
51348
|
+
autoUpdateState.setStartCommit(headCommit2(installDir));
|
|
51317
51349
|
if (!autoUpdateEnabled(installDir)) {
|
|
51318
51350
|
stayOff("autoUpdate.enabled is false");
|
|
51319
51351
|
return;
|
|
@@ -51542,8 +51574,8 @@ function owningClone(worktreePath) {
|
|
|
51542
51574
|
}
|
|
51543
51575
|
async function deleteWorktreeBranch(clone, branch2) {
|
|
51544
51576
|
if (!listLocalBranches(clone).includes(branch2)) return;
|
|
51545
|
-
const
|
|
51546
|
-
if (branch2 ===
|
|
51577
|
+
const current2 = await gitOrNull(clone, ["symbolic-ref", "--short", "HEAD"]);
|
|
51578
|
+
if (branch2 === current2) return;
|
|
51547
51579
|
try {
|
|
51548
51580
|
await git2(clone, ["branch", "-D", branch2]);
|
|
51549
51581
|
daemonLog(`worktree branch ${branch2} deleted from clone ${clone}`);
|
|
@@ -51793,12 +51825,12 @@ function readOccupant(pid, procRoot = "/proc") {
|
|
|
51793
51825
|
};
|
|
51794
51826
|
}
|
|
51795
51827
|
function underVsCode(pid, procRoot) {
|
|
51796
|
-
let
|
|
51797
|
-
for (let depth = 0;
|
|
51798
|
-
const cmdline = readProc(procRoot,
|
|
51828
|
+
let current2 = pid;
|
|
51829
|
+
for (let depth = 0; current2 && current2 > 1 && depth < MAX_ANCESTORS; depth++) {
|
|
51830
|
+
const cmdline = readProc(procRoot, current2, "cmdline");
|
|
51799
51831
|
if (cmdline && VSCODE_PATHS.some((path109) => cmdline.includes(path109)))
|
|
51800
51832
|
return true;
|
|
51801
|
-
|
|
51833
|
+
current2 = parentPid(readProc(procRoot, current2, "stat"));
|
|
51802
51834
|
}
|
|
51803
51835
|
return false;
|
|
51804
51836
|
}
|