@staff0rd/assist 0.272.2 → 0.273.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/commands/sessions/web/bundle.js +57 -57
- package/dist/index.js +125 -80
- 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.273.0",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -4875,6 +4875,50 @@ function githubUrl(req, res) {
|
|
|
4875
4875
|
});
|
|
4876
4876
|
}
|
|
4877
4877
|
|
|
4878
|
+
// src/commands/sessions/web/gitStatus.ts
|
|
4879
|
+
import { execSync as execSync21 } from "child_process";
|
|
4880
|
+
|
|
4881
|
+
// src/commands/sessions/web/parseGitStatus.ts
|
|
4882
|
+
function extractPath(rest) {
|
|
4883
|
+
const arrow = rest.indexOf(" -> ");
|
|
4884
|
+
return arrow === -1 ? rest : rest.slice(arrow + 4);
|
|
4885
|
+
}
|
|
4886
|
+
function categorize(xy) {
|
|
4887
|
+
if (xy === "??") return "new";
|
|
4888
|
+
const codes = xy.replace(/ /g, "");
|
|
4889
|
+
if (codes.includes("A")) return "new";
|
|
4890
|
+
if (codes.includes("D")) return "deleted";
|
|
4891
|
+
if (codes.includes("M") || codes.includes("R") || codes.includes("C")) {
|
|
4892
|
+
return "modified";
|
|
4893
|
+
}
|
|
4894
|
+
return null;
|
|
4895
|
+
}
|
|
4896
|
+
function parseGitStatus(output) {
|
|
4897
|
+
const result = { new: [], modified: [], deleted: [] };
|
|
4898
|
+
for (const line of output.split("\n")) {
|
|
4899
|
+
if (line.length < 4) continue;
|
|
4900
|
+
const category = categorize(line.slice(0, 2));
|
|
4901
|
+
if (category) result[category].push(extractPath(line.slice(3)));
|
|
4902
|
+
}
|
|
4903
|
+
return result;
|
|
4904
|
+
}
|
|
4905
|
+
|
|
4906
|
+
// src/commands/sessions/web/gitStatus.ts
|
|
4907
|
+
function gitStatus(req, res) {
|
|
4908
|
+
const cwd = getCwdParam(req, res);
|
|
4909
|
+
if (!cwd) return;
|
|
4910
|
+
try {
|
|
4911
|
+
const output = execSync21("git status --porcelain", {
|
|
4912
|
+
encoding: "utf-8",
|
|
4913
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
4914
|
+
cwd
|
|
4915
|
+
});
|
|
4916
|
+
respondJson(res, 200, parseGitStatus(output));
|
|
4917
|
+
} catch {
|
|
4918
|
+
respondJson(res, 200, { new: [], modified: [], deleted: [] });
|
|
4919
|
+
}
|
|
4920
|
+
}
|
|
4921
|
+
|
|
4878
4922
|
// src/commands/sessions/web/openInCode.ts
|
|
4879
4923
|
import { exec as exec2 } from "child_process";
|
|
4880
4924
|
import { promisify } from "util";
|
|
@@ -4918,7 +4962,8 @@ var routes = {
|
|
|
4918
4962
|
"GET /api/backlog/exists": getBacklogExists,
|
|
4919
4963
|
"POST /api/backlog/init": initBacklog,
|
|
4920
4964
|
"POST /api/open-in-code": openInCode,
|
|
4921
|
-
"GET /api/github-url": githubUrl
|
|
4965
|
+
"GET /api/github-url": githubUrl,
|
|
4966
|
+
"GET /api/git-status": gitStatus
|
|
4922
4967
|
};
|
|
4923
4968
|
var handleRequest = createFallbackHandler(
|
|
4924
4969
|
routes,
|
|
@@ -7165,7 +7210,7 @@ import { homedir as homedir8 } from "os";
|
|
|
7165
7210
|
import { join as join21 } from "path";
|
|
7166
7211
|
|
|
7167
7212
|
// src/shared/checkCliAvailable.ts
|
|
7168
|
-
import { execSync as
|
|
7213
|
+
import { execSync as execSync22 } from "child_process";
|
|
7169
7214
|
function checkCliAvailable(cli) {
|
|
7170
7215
|
const binary = cli.split(/\s+/)[0];
|
|
7171
7216
|
const opts = {
|
|
@@ -7173,11 +7218,11 @@ function checkCliAvailable(cli) {
|
|
|
7173
7218
|
stdio: ["ignore", "pipe", "pipe"]
|
|
7174
7219
|
};
|
|
7175
7220
|
try {
|
|
7176
|
-
|
|
7221
|
+
execSync22(`command -v ${binary}`, opts);
|
|
7177
7222
|
return true;
|
|
7178
7223
|
} catch {
|
|
7179
7224
|
try {
|
|
7180
|
-
|
|
7225
|
+
execSync22(`where ${binary}`, opts);
|
|
7181
7226
|
return true;
|
|
7182
7227
|
} catch {
|
|
7183
7228
|
return false;
|
|
@@ -8313,7 +8358,7 @@ function loadBlogSkipDays(repoName) {
|
|
|
8313
8358
|
}
|
|
8314
8359
|
|
|
8315
8360
|
// src/commands/devlog/shared.ts
|
|
8316
|
-
import { execSync as
|
|
8361
|
+
import { execSync as execSync23 } from "child_process";
|
|
8317
8362
|
import chalk89 from "chalk";
|
|
8318
8363
|
|
|
8319
8364
|
// src/shared/getRepoName.ts
|
|
@@ -8405,7 +8450,7 @@ function loadAllDevlogLatestDates() {
|
|
|
8405
8450
|
// src/commands/devlog/shared.ts
|
|
8406
8451
|
function getCommitFiles(hash) {
|
|
8407
8452
|
try {
|
|
8408
|
-
const output =
|
|
8453
|
+
const output = execSync23(`git show --name-only --format="" ${hash}`, {
|
|
8409
8454
|
encoding: "utf-8"
|
|
8410
8455
|
});
|
|
8411
8456
|
return output.trim().split("\n").filter(Boolean);
|
|
@@ -8501,11 +8546,11 @@ function list3(options2) {
|
|
|
8501
8546
|
}
|
|
8502
8547
|
|
|
8503
8548
|
// src/commands/devlog/getLastVersionInfo.ts
|
|
8504
|
-
import { execFileSync as execFileSync2, execSync as
|
|
8549
|
+
import { execFileSync as execFileSync2, execSync as execSync24 } from "child_process";
|
|
8505
8550
|
import semver from "semver";
|
|
8506
8551
|
function getVersionAtCommit(hash) {
|
|
8507
8552
|
try {
|
|
8508
|
-
const content =
|
|
8553
|
+
const content = execSync24(`git show ${hash}:package.json`, {
|
|
8509
8554
|
encoding: "utf-8"
|
|
8510
8555
|
});
|
|
8511
8556
|
const pkg = JSON.parse(content);
|
|
@@ -8678,7 +8723,7 @@ function next2(options2) {
|
|
|
8678
8723
|
}
|
|
8679
8724
|
|
|
8680
8725
|
// src/commands/devlog/repos/index.ts
|
|
8681
|
-
import { execSync as
|
|
8726
|
+
import { execSync as execSync25 } from "child_process";
|
|
8682
8727
|
|
|
8683
8728
|
// src/commands/devlog/repos/printReposTable.ts
|
|
8684
8729
|
import chalk93 from "chalk";
|
|
@@ -8713,7 +8758,7 @@ function getStatus(lastPush, lastDevlog) {
|
|
|
8713
8758
|
return lastDevlog < lastPush ? "outdated" : "ok";
|
|
8714
8759
|
}
|
|
8715
8760
|
function fetchRepos(days, all) {
|
|
8716
|
-
const json =
|
|
8761
|
+
const json = execSync25(
|
|
8717
8762
|
"gh repo list staff0rd --json name,pushedAt,isArchived --limit 200",
|
|
8718
8763
|
{ encoding: "utf-8" }
|
|
8719
8764
|
);
|
|
@@ -9073,7 +9118,7 @@ async function deps(csprojPath, options2) {
|
|
|
9073
9118
|
}
|
|
9074
9119
|
|
|
9075
9120
|
// src/commands/dotnet/getChangedCsFiles.ts
|
|
9076
|
-
import { execSync as
|
|
9121
|
+
import { execSync as execSync26 } from "child_process";
|
|
9077
9122
|
var SCOPE_ALL = "all";
|
|
9078
9123
|
var SCOPE_BASE = "base:";
|
|
9079
9124
|
var SCOPE_COMMIT = "commit:";
|
|
@@ -9097,7 +9142,7 @@ function getChangedCsFiles(scope) {
|
|
|
9097
9142
|
} else {
|
|
9098
9143
|
cmd = "git diff --name-only HEAD";
|
|
9099
9144
|
}
|
|
9100
|
-
const output =
|
|
9145
|
+
const output = execSync26(cmd, { encoding: "utf-8" }).trim();
|
|
9101
9146
|
if (output === "") return [];
|
|
9102
9147
|
return output.split("\n").filter((f) => f.toLowerCase().endsWith(".cs"));
|
|
9103
9148
|
}
|
|
@@ -9295,14 +9340,14 @@ function parseInspectReport(json) {
|
|
|
9295
9340
|
}
|
|
9296
9341
|
|
|
9297
9342
|
// src/commands/dotnet/runInspectCode.ts
|
|
9298
|
-
import { execSync as
|
|
9343
|
+
import { execSync as execSync27 } from "child_process";
|
|
9299
9344
|
import { existsSync as existsSync29, readFileSync as readFileSync24, unlinkSync as unlinkSync6 } from "fs";
|
|
9300
9345
|
import { tmpdir as tmpdir3 } from "os";
|
|
9301
9346
|
import path25 from "path";
|
|
9302
9347
|
import chalk103 from "chalk";
|
|
9303
9348
|
function assertJbInstalled() {
|
|
9304
9349
|
try {
|
|
9305
|
-
|
|
9350
|
+
execSync27("jb inspectcode --version", { stdio: "pipe" });
|
|
9306
9351
|
} catch {
|
|
9307
9352
|
console.error(chalk103.red("jb is not installed. Install with:"));
|
|
9308
9353
|
console.error(
|
|
@@ -9316,7 +9361,7 @@ function runInspectCode(slnPath, include, swea) {
|
|
|
9316
9361
|
const includeFlag = include ? ` --include="${include}"` : "";
|
|
9317
9362
|
const sweaFlag = swea ? " --swea" : "";
|
|
9318
9363
|
try {
|
|
9319
|
-
|
|
9364
|
+
execSync27(
|
|
9320
9365
|
`jb inspectcode "${slnPath}" -o="${reportPath}"${includeFlag}${sweaFlag} --verbosity=OFF`,
|
|
9321
9366
|
{ stdio: "pipe" }
|
|
9322
9367
|
);
|
|
@@ -9337,7 +9382,7 @@ function runInspectCode(slnPath, include, swea) {
|
|
|
9337
9382
|
}
|
|
9338
9383
|
|
|
9339
9384
|
// src/commands/dotnet/runRoslynInspect.ts
|
|
9340
|
-
import { execSync as
|
|
9385
|
+
import { execSync as execSync28 } from "child_process";
|
|
9341
9386
|
import chalk104 from "chalk";
|
|
9342
9387
|
function resolveMsbuildPath() {
|
|
9343
9388
|
const { run: run4 } = loadConfig();
|
|
@@ -9348,7 +9393,7 @@ function resolveMsbuildPath() {
|
|
|
9348
9393
|
function assertMsbuildInstalled() {
|
|
9349
9394
|
const msbuild = resolveMsbuildPath();
|
|
9350
9395
|
try {
|
|
9351
|
-
|
|
9396
|
+
execSync28(`"${msbuild}" -version`, { stdio: "pipe" });
|
|
9352
9397
|
} catch {
|
|
9353
9398
|
console.error(chalk104.red(`msbuild not found at: ${msbuild}`));
|
|
9354
9399
|
console.error(
|
|
@@ -9374,7 +9419,7 @@ function runRoslynInspect(slnPath) {
|
|
|
9374
9419
|
const msbuild = resolveMsbuildPath();
|
|
9375
9420
|
let output;
|
|
9376
9421
|
try {
|
|
9377
|
-
output =
|
|
9422
|
+
output = execSync28(
|
|
9378
9423
|
`"${msbuild}" "${slnPath}" -t:Build -v:minimal -maxcpucount -p:EnforceCodeStyleInBuild=true -p:RunAnalyzersDuringBuild=true 2>&1`,
|
|
9379
9424
|
{ encoding: "utf-8", stdio: "pipe", maxBuffer: 50 * 1024 * 1024 }
|
|
9380
9425
|
);
|
|
@@ -9952,12 +9997,12 @@ function adfToText(doc) {
|
|
|
9952
9997
|
}
|
|
9953
9998
|
|
|
9954
9999
|
// src/commands/jira/fetchIssue.ts
|
|
9955
|
-
import { execSync as
|
|
10000
|
+
import { execSync as execSync29 } from "child_process";
|
|
9956
10001
|
import chalk108 from "chalk";
|
|
9957
10002
|
function fetchIssue(issueKey, fields) {
|
|
9958
10003
|
let result;
|
|
9959
10004
|
try {
|
|
9960
|
-
result =
|
|
10005
|
+
result = execSync29(
|
|
9961
10006
|
`acli jira workitem view ${issueKey} -f ${fields} --json`,
|
|
9962
10007
|
{ encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] }
|
|
9963
10008
|
);
|
|
@@ -10003,7 +10048,7 @@ function acceptanceCriteria(issueKey) {
|
|
|
10003
10048
|
}
|
|
10004
10049
|
|
|
10005
10050
|
// src/commands/jira/jiraAuth.ts
|
|
10006
|
-
import { execSync as
|
|
10051
|
+
import { execSync as execSync30 } from "child_process";
|
|
10007
10052
|
|
|
10008
10053
|
// src/shared/loadJson.ts
|
|
10009
10054
|
import { existsSync as existsSync32, mkdirSync as mkdirSync10, readFileSync as readFileSync27, writeFileSync as writeFileSync20 } from "fs";
|
|
@@ -10067,7 +10112,7 @@ async function jiraAuth() {
|
|
|
10067
10112
|
console.error("All fields are required.");
|
|
10068
10113
|
process.exit(1);
|
|
10069
10114
|
}
|
|
10070
|
-
|
|
10115
|
+
execSync30(`acli jira auth login --site ${site} --email "${email}" --token`, {
|
|
10071
10116
|
encoding: "utf-8",
|
|
10072
10117
|
input: token,
|
|
10073
10118
|
stdio: ["pipe", "inherit", "inherit"]
|
|
@@ -10551,7 +10596,7 @@ function registerPrompts(program2) {
|
|
|
10551
10596
|
}
|
|
10552
10597
|
|
|
10553
10598
|
// src/commands/prs/shared.ts
|
|
10554
|
-
import { execSync as
|
|
10599
|
+
import { execSync as execSync31 } from "child_process";
|
|
10555
10600
|
function isGhNotInstalled(error) {
|
|
10556
10601
|
if (error instanceof Error) {
|
|
10557
10602
|
const msg = error.message.toLowerCase();
|
|
@@ -10569,12 +10614,12 @@ function getRepoInfo() {
|
|
|
10569
10614
|
const preferred = getPreferredRemoteRepo();
|
|
10570
10615
|
if (preferred) return preferred;
|
|
10571
10616
|
const repoInfo = JSON.parse(
|
|
10572
|
-
|
|
10617
|
+
execSync31("gh repo view --json owner,name", { encoding: "utf-8" })
|
|
10573
10618
|
);
|
|
10574
10619
|
return { org: repoInfo.owner.login, repo: repoInfo.name };
|
|
10575
10620
|
}
|
|
10576
10621
|
function getCurrentBranch() {
|
|
10577
|
-
return
|
|
10622
|
+
return execSync31("git rev-parse --abbrev-ref HEAD", {
|
|
10578
10623
|
encoding: "utf-8"
|
|
10579
10624
|
}).trim();
|
|
10580
10625
|
}
|
|
@@ -10582,7 +10627,7 @@ function viewCurrentPr(fields) {
|
|
|
10582
10627
|
const { org, repo } = getRepoInfo();
|
|
10583
10628
|
const branch = getCurrentBranch();
|
|
10584
10629
|
return JSON.parse(
|
|
10585
|
-
|
|
10630
|
+
execSync31(`gh pr view ${branch} --json ${fields} -R ${org}/${repo}`, {
|
|
10586
10631
|
encoding: "utf-8"
|
|
10587
10632
|
})
|
|
10588
10633
|
);
|
|
@@ -10675,7 +10720,7 @@ function comment2(path53, line, body, startLine) {
|
|
|
10675
10720
|
}
|
|
10676
10721
|
|
|
10677
10722
|
// src/commands/prs/create.ts
|
|
10678
|
-
import { execSync as
|
|
10723
|
+
import { execSync as execSync32 } from "child_process";
|
|
10679
10724
|
|
|
10680
10725
|
// src/commands/prs/buildCreateArgs.ts
|
|
10681
10726
|
function buildCreateArgs(title, body, options2) {
|
|
@@ -10730,17 +10775,17 @@ function create(options2) {
|
|
|
10730
10775
|
validatePrContent(options2.title, options2.body);
|
|
10731
10776
|
const args = buildCreateArgs(options2.title, options2.body, options2);
|
|
10732
10777
|
try {
|
|
10733
|
-
|
|
10778
|
+
execSync32(args.join(" "), { stdio: "inherit" });
|
|
10734
10779
|
} catch (_error) {
|
|
10735
10780
|
process.exit(1);
|
|
10736
10781
|
}
|
|
10737
10782
|
}
|
|
10738
10783
|
|
|
10739
10784
|
// src/commands/prs/fixed.ts
|
|
10740
|
-
import { execSync as
|
|
10785
|
+
import { execSync as execSync34 } from "child_process";
|
|
10741
10786
|
|
|
10742
10787
|
// src/commands/prs/resolveCommentWithReply.ts
|
|
10743
|
-
import { execSync as
|
|
10788
|
+
import { execSync as execSync33 } from "child_process";
|
|
10744
10789
|
import { unlinkSync as unlinkSync9, writeFileSync as writeFileSync22 } from "fs";
|
|
10745
10790
|
import { tmpdir as tmpdir5 } from "os";
|
|
10746
10791
|
import { join as join33 } from "path";
|
|
@@ -10770,7 +10815,7 @@ function deleteCommentsCache(prNumber) {
|
|
|
10770
10815
|
|
|
10771
10816
|
// src/commands/prs/resolveCommentWithReply.ts
|
|
10772
10817
|
function replyToComment(org, repo, prNumber, commentId, message) {
|
|
10773
|
-
|
|
10818
|
+
execSync33(
|
|
10774
10819
|
`gh api repos/${org}/${repo}/pulls/${prNumber}/comments -f body="${message.replace(/"/g, '\\"')}" -F in_reply_to=${commentId}`,
|
|
10775
10820
|
{ stdio: ["inherit", "pipe", "inherit"] }
|
|
10776
10821
|
);
|
|
@@ -10780,7 +10825,7 @@ function resolveThread(threadId) {
|
|
|
10780
10825
|
const queryFile = join33(tmpdir5(), `gh-mutation-${Date.now()}.graphql`);
|
|
10781
10826
|
writeFileSync22(queryFile, mutation);
|
|
10782
10827
|
try {
|
|
10783
|
-
|
|
10828
|
+
execSync33(
|
|
10784
10829
|
`gh api graphql -F query=@${queryFile} -f threadId="${threadId}"`,
|
|
10785
10830
|
{ stdio: ["inherit", "pipe", "inherit"] }
|
|
10786
10831
|
);
|
|
@@ -10832,7 +10877,7 @@ function resolveCommentWithReply(commentId, message) {
|
|
|
10832
10877
|
// src/commands/prs/fixed.ts
|
|
10833
10878
|
function verifySha(sha) {
|
|
10834
10879
|
try {
|
|
10835
|
-
return
|
|
10880
|
+
return execSync34(`git rev-parse --verify ${sha}`, {
|
|
10836
10881
|
encoding: "utf-8"
|
|
10837
10882
|
}).trim();
|
|
10838
10883
|
} catch {
|
|
@@ -10846,7 +10891,7 @@ function fixed(commentId, sha) {
|
|
|
10846
10891
|
const { org, repo } = getRepoInfo();
|
|
10847
10892
|
const repoUrl = `https://github.com/${org}/${repo}`;
|
|
10848
10893
|
const message = `Fixed in [${fullSha}](${repoUrl}/commit/${fullSha})`;
|
|
10849
|
-
|
|
10894
|
+
execSync34("git push", { stdio: "inherit" });
|
|
10850
10895
|
resolveCommentWithReply(commentId, message);
|
|
10851
10896
|
} catch (error) {
|
|
10852
10897
|
if (isGhNotInstalled(error)) {
|
|
@@ -10864,7 +10909,7 @@ import { join as join35 } from "path";
|
|
|
10864
10909
|
import { stringify } from "yaml";
|
|
10865
10910
|
|
|
10866
10911
|
// src/commands/prs/fetchThreadIds.ts
|
|
10867
|
-
import { execSync as
|
|
10912
|
+
import { execSync as execSync35 } from "child_process";
|
|
10868
10913
|
import { unlinkSync as unlinkSync10, writeFileSync as writeFileSync23 } from "fs";
|
|
10869
10914
|
import { tmpdir as tmpdir6 } from "os";
|
|
10870
10915
|
import { join as join34 } from "path";
|
|
@@ -10873,7 +10918,7 @@ function fetchThreadIds(org, repo, prNumber) {
|
|
|
10873
10918
|
const queryFile = join34(tmpdir6(), `gh-query-${Date.now()}.graphql`);
|
|
10874
10919
|
writeFileSync23(queryFile, THREAD_QUERY);
|
|
10875
10920
|
try {
|
|
10876
|
-
const result =
|
|
10921
|
+
const result = execSync35(
|
|
10877
10922
|
`gh api graphql -F query=@${queryFile} -F owner="${org}" -F repo="${repo}" -F prNumber=${prNumber}`,
|
|
10878
10923
|
{ encoding: "utf-8" }
|
|
10879
10924
|
);
|
|
@@ -10895,9 +10940,9 @@ function fetchThreadIds(org, repo, prNumber) {
|
|
|
10895
10940
|
}
|
|
10896
10941
|
|
|
10897
10942
|
// src/commands/prs/listComments/fetchReviewComments.ts
|
|
10898
|
-
import { execSync as
|
|
10943
|
+
import { execSync as execSync36 } from "child_process";
|
|
10899
10944
|
function fetchJson(endpoint) {
|
|
10900
|
-
const result =
|
|
10945
|
+
const result = execSync36(`gh api --paginate ${endpoint}`, {
|
|
10901
10946
|
encoding: "utf-8"
|
|
10902
10947
|
});
|
|
10903
10948
|
if (!result.trim()) return [];
|
|
@@ -11036,7 +11081,7 @@ async function listComments() {
|
|
|
11036
11081
|
}
|
|
11037
11082
|
|
|
11038
11083
|
// src/commands/prs/prs/index.ts
|
|
11039
|
-
import { execSync as
|
|
11084
|
+
import { execSync as execSync37 } from "child_process";
|
|
11040
11085
|
|
|
11041
11086
|
// src/commands/prs/prs/displayPaginated/index.ts
|
|
11042
11087
|
import enquirer9 from "enquirer";
|
|
@@ -11143,7 +11188,7 @@ async function prs(options2) {
|
|
|
11143
11188
|
const state = options2.open ? "open" : options2.closed ? "closed" : "all";
|
|
11144
11189
|
try {
|
|
11145
11190
|
const { org, repo } = getRepoInfo();
|
|
11146
|
-
const result =
|
|
11191
|
+
const result = execSync37(
|
|
11147
11192
|
`gh pr list --state ${state} --json number,title,url,author,createdAt,mergedAt,closedAt,state,changedFiles --limit 100 -R ${org}/${repo}`,
|
|
11148
11193
|
{ encoding: "utf-8" }
|
|
11149
11194
|
);
|
|
@@ -11166,7 +11211,7 @@ async function prs(options2) {
|
|
|
11166
11211
|
}
|
|
11167
11212
|
|
|
11168
11213
|
// src/commands/prs/wontfix.ts
|
|
11169
|
-
import { execSync as
|
|
11214
|
+
import { execSync as execSync38 } from "child_process";
|
|
11170
11215
|
function validateReason(reason) {
|
|
11171
11216
|
const lowerReason = reason.toLowerCase();
|
|
11172
11217
|
if (lowerReason.includes("claude") || lowerReason.includes("opus")) {
|
|
@@ -11183,7 +11228,7 @@ function validateShaReferences(reason) {
|
|
|
11183
11228
|
const invalidShas = [];
|
|
11184
11229
|
for (const sha of shas) {
|
|
11185
11230
|
try {
|
|
11186
|
-
|
|
11231
|
+
execSync38(`git cat-file -t ${sha}`, { stdio: "pipe" });
|
|
11187
11232
|
} catch {
|
|
11188
11233
|
invalidShas.push(sha);
|
|
11189
11234
|
}
|
|
@@ -11318,10 +11363,10 @@ import chalk122 from "chalk";
|
|
|
11318
11363
|
import Enquirer2 from "enquirer";
|
|
11319
11364
|
|
|
11320
11365
|
// src/commands/ravendb/searchItems.ts
|
|
11321
|
-
import { execSync as
|
|
11366
|
+
import { execSync as execSync39 } from "child_process";
|
|
11322
11367
|
import chalk121 from "chalk";
|
|
11323
11368
|
function opExec(args) {
|
|
11324
|
-
return
|
|
11369
|
+
return execSync39(`op ${args}`, {
|
|
11325
11370
|
encoding: "utf-8",
|
|
11326
11371
|
stdio: ["pipe", "pipe", "pipe"]
|
|
11327
11372
|
}).trim();
|
|
@@ -11473,7 +11518,7 @@ ${errorText}`
|
|
|
11473
11518
|
}
|
|
11474
11519
|
|
|
11475
11520
|
// src/commands/ravendb/resolveOpSecret.ts
|
|
11476
|
-
import { execSync as
|
|
11521
|
+
import { execSync as execSync40 } from "child_process";
|
|
11477
11522
|
import chalk126 from "chalk";
|
|
11478
11523
|
function resolveOpSecret(reference) {
|
|
11479
11524
|
if (!reference.startsWith("op://")) {
|
|
@@ -11481,7 +11526,7 @@ function resolveOpSecret(reference) {
|
|
|
11481
11526
|
process.exit(1);
|
|
11482
11527
|
}
|
|
11483
11528
|
try {
|
|
11484
|
-
return
|
|
11529
|
+
return execSync40(`op read "${reference}"`, {
|
|
11485
11530
|
encoding: "utf-8",
|
|
11486
11531
|
stdio: ["pipe", "pipe", "pipe"]
|
|
11487
11532
|
}).trim();
|
|
@@ -11730,7 +11775,7 @@ Refactor check failed:
|
|
|
11730
11775
|
}
|
|
11731
11776
|
|
|
11732
11777
|
// src/commands/refactor/check/getViolations/index.ts
|
|
11733
|
-
import { execSync as
|
|
11778
|
+
import { execSync as execSync41 } from "child_process";
|
|
11734
11779
|
import fs18 from "fs";
|
|
11735
11780
|
import { minimatch as minimatch5 } from "minimatch";
|
|
11736
11781
|
|
|
@@ -11780,7 +11825,7 @@ function getGitFiles(options2) {
|
|
|
11780
11825
|
}
|
|
11781
11826
|
const files = /* @__PURE__ */ new Set();
|
|
11782
11827
|
if (options2.staged || options2.modified) {
|
|
11783
|
-
const staged =
|
|
11828
|
+
const staged = execSync41("git diff --cached --name-only", {
|
|
11784
11829
|
encoding: "utf-8"
|
|
11785
11830
|
});
|
|
11786
11831
|
for (const file of staged.trim().split("\n").filter(Boolean)) {
|
|
@@ -11788,7 +11833,7 @@ function getGitFiles(options2) {
|
|
|
11788
11833
|
}
|
|
11789
11834
|
}
|
|
11790
11835
|
if (options2.unstaged || options2.modified) {
|
|
11791
|
-
const unstaged =
|
|
11836
|
+
const unstaged = execSync41("git diff --name-only", { encoding: "utf-8" });
|
|
11792
11837
|
for (const file of unstaged.trim().split("\n").filter(Boolean)) {
|
|
11793
11838
|
files.add(file);
|
|
11794
11839
|
}
|
|
@@ -13364,9 +13409,9 @@ function buildReviewPaths(repoRoot, key) {
|
|
|
13364
13409
|
}
|
|
13365
13410
|
|
|
13366
13411
|
// src/commands/review/fetchExistingComments.ts
|
|
13367
|
-
import { execSync as
|
|
13412
|
+
import { execSync as execSync42 } from "child_process";
|
|
13368
13413
|
function fetchRawComments(org, repo, prNumber) {
|
|
13369
|
-
const out =
|
|
13414
|
+
const out = execSync42(
|
|
13370
13415
|
`gh api --paginate repos/${org}/${repo}/pulls/${prNumber}/comments`,
|
|
13371
13416
|
{ encoding: "utf-8", maxBuffer: 64 * 1024 * 1024 }
|
|
13372
13417
|
);
|
|
@@ -13397,14 +13442,14 @@ function fetchExistingComments() {
|
|
|
13397
13442
|
}
|
|
13398
13443
|
|
|
13399
13444
|
// src/commands/review/gatherContext.ts
|
|
13400
|
-
import { execSync as
|
|
13445
|
+
import { execSync as execSync45 } from "child_process";
|
|
13401
13446
|
|
|
13402
13447
|
// src/commands/review/fetchPrDiff.ts
|
|
13403
|
-
import { execSync as
|
|
13448
|
+
import { execSync as execSync43 } from "child_process";
|
|
13404
13449
|
function fetchPrDiff(prNumber, baseSha, headSha) {
|
|
13405
13450
|
const { org, repo } = getRepoInfo();
|
|
13406
13451
|
try {
|
|
13407
|
-
return
|
|
13452
|
+
return execSync43(`gh pr diff ${prNumber} -R ${org}/${repo}`, {
|
|
13408
13453
|
encoding: "utf-8",
|
|
13409
13454
|
maxBuffer: 256 * 1024 * 1024,
|
|
13410
13455
|
stdio: ["ignore", "pipe", "pipe"]
|
|
@@ -13419,19 +13464,19 @@ function isDiffTooLarge(error) {
|
|
|
13419
13464
|
}
|
|
13420
13465
|
function fetchDiffViaGit(baseSha, headSha) {
|
|
13421
13466
|
try {
|
|
13422
|
-
|
|
13467
|
+
execSync43(`git fetch origin ${baseSha} ${headSha}`, { stdio: "ignore" });
|
|
13423
13468
|
} catch {
|
|
13424
13469
|
}
|
|
13425
|
-
return
|
|
13470
|
+
return execSync43(`git diff ${baseSha}...${headSha}`, {
|
|
13426
13471
|
encoding: "utf-8",
|
|
13427
13472
|
maxBuffer: 256 * 1024 * 1024
|
|
13428
13473
|
});
|
|
13429
13474
|
}
|
|
13430
13475
|
|
|
13431
13476
|
// src/commands/review/fetchPrDiffInfo.ts
|
|
13432
|
-
import { execSync as
|
|
13477
|
+
import { execSync as execSync44 } from "child_process";
|
|
13433
13478
|
function getCurrentBranch2() {
|
|
13434
|
-
return
|
|
13479
|
+
return execSync44("git rev-parse --abbrev-ref HEAD", {
|
|
13435
13480
|
encoding: "utf-8"
|
|
13436
13481
|
}).trim();
|
|
13437
13482
|
}
|
|
@@ -13441,7 +13486,7 @@ function fetchPrDiffInfo() {
|
|
|
13441
13486
|
const fields = "number,baseRefName,baseRefOid,headRefName,headRefOid";
|
|
13442
13487
|
let raw;
|
|
13443
13488
|
try {
|
|
13444
|
-
raw =
|
|
13489
|
+
raw = execSync44(`gh pr view ${branch} --json ${fields} -R ${org}/${repo}`, {
|
|
13445
13490
|
encoding: "utf-8",
|
|
13446
13491
|
stdio: ["ignore", "pipe", "pipe"]
|
|
13447
13492
|
});
|
|
@@ -13465,7 +13510,7 @@ function fetchPrDiffInfo() {
|
|
|
13465
13510
|
}
|
|
13466
13511
|
function fetchPrChangedFiles(prNumber) {
|
|
13467
13512
|
const { org, repo } = getRepoInfo();
|
|
13468
|
-
const out =
|
|
13513
|
+
const out = execSync44(
|
|
13469
13514
|
`gh api repos/${org}/${repo}/pulls/${prNumber}/files --paginate --jq ".[].filename"`,
|
|
13470
13515
|
{
|
|
13471
13516
|
encoding: "utf-8",
|
|
@@ -13477,11 +13522,11 @@ function fetchPrChangedFiles(prNumber) {
|
|
|
13477
13522
|
|
|
13478
13523
|
// src/commands/review/gatherContext.ts
|
|
13479
13524
|
function gatherContext() {
|
|
13480
|
-
const branch =
|
|
13525
|
+
const branch = execSync45("git rev-parse --abbrev-ref HEAD", {
|
|
13481
13526
|
encoding: "utf-8"
|
|
13482
13527
|
}).trim();
|
|
13483
|
-
const sha =
|
|
13484
|
-
const shortSha =
|
|
13528
|
+
const sha = execSync45("git rev-parse HEAD", { encoding: "utf-8" }).trim();
|
|
13529
|
+
const shortSha = execSync45("git rev-parse --short=7 HEAD", {
|
|
13485
13530
|
encoding: "utf-8"
|
|
13486
13531
|
}).trim();
|
|
13487
13532
|
const prInfo = fetchPrDiffInfo();
|
|
@@ -16317,7 +16362,7 @@ import { mkdirSync as mkdirSync17 } from "fs";
|
|
|
16317
16362
|
import { join as join46 } from "path";
|
|
16318
16363
|
|
|
16319
16364
|
// src/commands/voice/checkLockFile.ts
|
|
16320
|
-
import { execSync as
|
|
16365
|
+
import { execSync as execSync46 } from "child_process";
|
|
16321
16366
|
import { existsSync as existsSync44, mkdirSync as mkdirSync16, readFileSync as readFileSync35, writeFileSync as writeFileSync28 } from "fs";
|
|
16322
16367
|
import { join as join45 } from "path";
|
|
16323
16368
|
function isProcessAlive2(pid) {
|
|
@@ -16346,7 +16391,7 @@ function bootstrapVenv() {
|
|
|
16346
16391
|
if (existsSync44(getVenvPython())) return;
|
|
16347
16392
|
console.log("Setting up Python environment...");
|
|
16348
16393
|
const pythonDir = getPythonDir();
|
|
16349
|
-
|
|
16394
|
+
execSync46(
|
|
16350
16395
|
`uv sync --project "${pythonDir}" --extra runtime --no-install-project`,
|
|
16351
16396
|
{
|
|
16352
16397
|
stdio: "inherit",
|
|
@@ -16513,11 +16558,11 @@ import { randomBytes } from "crypto";
|
|
|
16513
16558
|
import chalk157 from "chalk";
|
|
16514
16559
|
|
|
16515
16560
|
// src/lib/openBrowser.ts
|
|
16516
|
-
import { execSync as
|
|
16561
|
+
import { execSync as execSync47 } from "child_process";
|
|
16517
16562
|
function tryExec(commands) {
|
|
16518
16563
|
for (const cmd of commands) {
|
|
16519
16564
|
try {
|
|
16520
|
-
|
|
16565
|
+
execSync47(cmd);
|
|
16521
16566
|
return true;
|
|
16522
16567
|
} catch {
|
|
16523
16568
|
}
|
|
@@ -16867,11 +16912,11 @@ function resolveParams(params, cliArgs) {
|
|
|
16867
16912
|
}
|
|
16868
16913
|
|
|
16869
16914
|
// src/commands/run/runPreCommands.ts
|
|
16870
|
-
import { execSync as
|
|
16915
|
+
import { execSync as execSync48 } from "child_process";
|
|
16871
16916
|
function runPreCommands(pre, cwd) {
|
|
16872
16917
|
for (const cmd of pre) {
|
|
16873
16918
|
try {
|
|
16874
|
-
|
|
16919
|
+
execSync48(cmd, { stdio: "inherit", cwd });
|
|
16875
16920
|
} catch (err) {
|
|
16876
16921
|
const code = err && typeof err === "object" && "status" in err ? err.status : 1;
|
|
16877
16922
|
process.exit(code);
|
|
@@ -17155,7 +17200,7 @@ function registerRun(program2) {
|
|
|
17155
17200
|
}
|
|
17156
17201
|
|
|
17157
17202
|
// src/commands/screenshot/index.ts
|
|
17158
|
-
import { execSync as
|
|
17203
|
+
import { execSync as execSync49 } from "child_process";
|
|
17159
17204
|
import { existsSync as existsSync49, mkdirSync as mkdirSync20, unlinkSync as unlinkSync16, writeFileSync as writeFileSync31 } from "fs";
|
|
17160
17205
|
import { tmpdir as tmpdir7 } from "os";
|
|
17161
17206
|
import { join as join52, resolve as resolve13 } from "path";
|
|
@@ -17298,7 +17343,7 @@ function runPowerShellScript(processName, outputPath) {
|
|
|
17298
17343
|
const scriptPath = join52(tmpdir7(), `assist-screenshot-${Date.now()}.ps1`);
|
|
17299
17344
|
writeFileSync31(scriptPath, captureWindowPs1, "utf-8");
|
|
17300
17345
|
try {
|
|
17301
|
-
|
|
17346
|
+
execSync49(
|
|
17302
17347
|
`powershell -NoProfile -ExecutionPolicy Bypass -File "${scriptPath}" -ProcessName "${processName}" -OutputPath "${outputPath}"`,
|
|
17303
17348
|
{ stdio: ["ignore", "pipe", "pipe"], encoding: "utf-8" }
|
|
17304
17349
|
);
|
|
@@ -18843,7 +18888,7 @@ function syncCommands(claudeDir, targetBase) {
|
|
|
18843
18888
|
}
|
|
18844
18889
|
|
|
18845
18890
|
// src/commands/update.ts
|
|
18846
|
-
import { execSync as
|
|
18891
|
+
import { execSync as execSync50 } from "child_process";
|
|
18847
18892
|
import * as path52 from "path";
|
|
18848
18893
|
function isGlobalNpmInstall(dir) {
|
|
18849
18894
|
try {
|
|
@@ -18851,7 +18896,7 @@ function isGlobalNpmInstall(dir) {
|
|
|
18851
18896
|
if (resolved.split(path52.sep).includes("node_modules")) {
|
|
18852
18897
|
return true;
|
|
18853
18898
|
}
|
|
18854
|
-
const globalPrefix =
|
|
18899
|
+
const globalPrefix = execSync50("npm prefix -g", { stdio: "pipe" }).toString().trim();
|
|
18855
18900
|
return resolved.toLowerCase().startsWith(path52.resolve(globalPrefix).toLowerCase());
|
|
18856
18901
|
} catch {
|
|
18857
18902
|
return false;
|
|
@@ -18862,18 +18907,18 @@ async function update2() {
|
|
|
18862
18907
|
console.log(`Assist is installed at: ${installDir}`);
|
|
18863
18908
|
if (isGitRepo(installDir)) {
|
|
18864
18909
|
console.log("Detected git repo installation, pulling latest...");
|
|
18865
|
-
|
|
18910
|
+
execSync50("git pull", { cwd: installDir, stdio: "inherit" });
|
|
18866
18911
|
console.log("Installing dependencies...");
|
|
18867
|
-
|
|
18912
|
+
execSync50("npm i", { cwd: installDir, stdio: "inherit" });
|
|
18868
18913
|
console.log("Building...");
|
|
18869
|
-
|
|
18914
|
+
execSync50("npm run build", { cwd: installDir, stdio: "inherit" });
|
|
18870
18915
|
console.log("Syncing commands...");
|
|
18871
|
-
|
|
18916
|
+
execSync50("assist sync", { stdio: "inherit" });
|
|
18872
18917
|
} else if (isGlobalNpmInstall(installDir)) {
|
|
18873
18918
|
console.log("Detected global npm installation, updating...");
|
|
18874
|
-
|
|
18919
|
+
execSync50("npm i -g @staff0rd/assist@latest", { stdio: "inherit" });
|
|
18875
18920
|
console.log("Syncing commands...");
|
|
18876
|
-
|
|
18921
|
+
execSync50("assist sync", { stdio: "inherit" });
|
|
18877
18922
|
} else {
|
|
18878
18923
|
console.error(
|
|
18879
18924
|
"Could not determine installation method. Expected a git repo or global npm install."
|