@staff0rd/assist 0.1132.0 → 0.1133.1
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/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.1133.1",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -36301,6 +36301,39 @@ function resolveIssueMilestone(target, wanted) {
|
|
|
36301
36301
|
|
|
36302
36302
|
// src/commands/prs/shared.ts
|
|
36303
36303
|
import { execSync as execSync42 } from "child_process";
|
|
36304
|
+
|
|
36305
|
+
// src/commands/prs/currentPrSelector.ts
|
|
36306
|
+
import { execFileSync as execFileSync12 } from "child_process";
|
|
36307
|
+
var PULL_REF = /^refs\/pull\/(\d+)\/head$/;
|
|
36308
|
+
function gitOrNull3(args) {
|
|
36309
|
+
try {
|
|
36310
|
+
return execFileSync12("git", args, {
|
|
36311
|
+
encoding: "utf8",
|
|
36312
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
36313
|
+
windowsHide: true
|
|
36314
|
+
}).trim() || null;
|
|
36315
|
+
} catch {
|
|
36316
|
+
return null;
|
|
36317
|
+
}
|
|
36318
|
+
}
|
|
36319
|
+
function branchConfig(branch2, key) {
|
|
36320
|
+
return gitOrNull3(["config", "--get", `branch.${branch2}.${key}`]);
|
|
36321
|
+
}
|
|
36322
|
+
function remoteOwner(remote) {
|
|
36323
|
+
const url = parseGitHubUrl(remote) ? remote : gitOrNull3(["remote", "get-url", remote]);
|
|
36324
|
+
return url ? parseGitHubUrl(url)?.org ?? null : null;
|
|
36325
|
+
}
|
|
36326
|
+
function currentPrSelector(branch2, baseOrg) {
|
|
36327
|
+
const pull = branchConfig(branch2, "merge")?.match(PULL_REF);
|
|
36328
|
+
if (pull) return pull[1];
|
|
36329
|
+
const remote = branchConfig(branch2, "remote");
|
|
36330
|
+
const owner = remote ? remoteOwner(remote) : null;
|
|
36331
|
+
if (owner && owner.toLowerCase() !== baseOrg.toLowerCase())
|
|
36332
|
+
return `${owner}:${branch2}`;
|
|
36333
|
+
return branch2;
|
|
36334
|
+
}
|
|
36335
|
+
|
|
36336
|
+
// src/commands/prs/shared.ts
|
|
36304
36337
|
function isGhNotInstalled(error) {
|
|
36305
36338
|
if (error instanceof Error) {
|
|
36306
36339
|
const msg = error.message.toLowerCase();
|
|
@@ -36323,13 +36356,11 @@ function getCurrentBranch2() {
|
|
|
36323
36356
|
}
|
|
36324
36357
|
function viewCurrentPr(fields) {
|
|
36325
36358
|
const { org, repo } = getRepoInfo();
|
|
36359
|
+
const selector = currentPrSelector(getCurrentBranch2(), org);
|
|
36326
36360
|
return JSON.parse(
|
|
36327
|
-
execSync42(
|
|
36328
|
-
|
|
36329
|
-
|
|
36330
|
-
encoding: "utf8"
|
|
36331
|
-
}
|
|
36332
|
-
)
|
|
36361
|
+
execSync42(`gh pr view ${selector} --json ${fields} -R ${org}/${repo}`, {
|
|
36362
|
+
encoding: "utf8"
|
|
36363
|
+
})
|
|
36333
36364
|
);
|
|
36334
36365
|
}
|
|
36335
36366
|
function getCurrentPrNumber() {
|
|
@@ -36475,7 +36506,7 @@ function attachArgs(attachments) {
|
|
|
36475
36506
|
}
|
|
36476
36507
|
|
|
36477
36508
|
// src/commands/prs/runGhWithAttachments.ts
|
|
36478
|
-
import { execFileSync as
|
|
36509
|
+
import { execFileSync as execFileSync13 } from "child_process";
|
|
36479
36510
|
import { basename as basename20 } from "path";
|
|
36480
36511
|
|
|
36481
36512
|
// src/shared/removeStagedAttachments.ts
|
|
@@ -36503,7 +36534,7 @@ function reportPartialFailure(attachments, stderr) {
|
|
|
36503
36534
|
function runGhWithAttachments(args, attachments) {
|
|
36504
36535
|
const attaching = attachments.length > 0;
|
|
36505
36536
|
try {
|
|
36506
|
-
const stdout =
|
|
36537
|
+
const stdout = execFileSync13("gh", args, {
|
|
36507
36538
|
encoding: "utf8",
|
|
36508
36539
|
stdio: ["inherit", "pipe", attaching ? "pipe" : "inherit"]
|
|
36509
36540
|
});
|
|
@@ -36614,7 +36645,7 @@ The project scope is needed for --project: gh auth refresh -h github.com -s proj
|
|
|
36614
36645
|
}
|
|
36615
36646
|
|
|
36616
36647
|
// src/commands/github/issue/fetchIssue.ts
|
|
36617
|
-
import { execFileSync as
|
|
36648
|
+
import { execFileSync as execFileSync14 } from "child_process";
|
|
36618
36649
|
function fetchIssue2(number, repo) {
|
|
36619
36650
|
const args = [
|
|
36620
36651
|
"issue",
|
|
@@ -36626,7 +36657,7 @@ function fetchIssue2(number, repo) {
|
|
|
36626
36657
|
if (repo) args.push("--repo", repo);
|
|
36627
36658
|
let raw;
|
|
36628
36659
|
try {
|
|
36629
|
-
raw =
|
|
36660
|
+
raw = execFileSync14("gh", args, { encoding: "utf8" });
|
|
36630
36661
|
} catch {
|
|
36631
36662
|
console.error(`Could not fetch issue #${number} with gh issue view`);
|
|
36632
36663
|
process.exit(1);
|
|
@@ -36736,12 +36767,12 @@ function prepareIssueEdit(number, repo, fresh, proposed) {
|
|
|
36736
36767
|
}
|
|
36737
36768
|
|
|
36738
36769
|
// src/commands/github/issue/pushIssueBody.ts
|
|
36739
|
-
import { execFileSync as
|
|
36770
|
+
import { execFileSync as execFileSync15 } from "child_process";
|
|
36740
36771
|
function pushIssueBody(number, repo, bodyPath) {
|
|
36741
36772
|
const args = ["issue", "edit", String(number), "--body-file", bodyPath];
|
|
36742
36773
|
if (repo) args.push("--repo", repo);
|
|
36743
36774
|
try {
|
|
36744
|
-
|
|
36775
|
+
execFileSync15("gh", args, { stdio: "inherit" });
|
|
36745
36776
|
} catch {
|
|
36746
36777
|
process.exit(1);
|
|
36747
36778
|
}
|
|
@@ -36820,12 +36851,12 @@ function setIssueParent(number, repo, parentArg) {
|
|
|
36820
36851
|
}
|
|
36821
36852
|
|
|
36822
36853
|
// src/commands/github/issue/viewIssue.ts
|
|
36823
|
-
import { execFileSync as
|
|
36854
|
+
import { execFileSync as execFileSync16 } from "child_process";
|
|
36824
36855
|
function viewIssue(number, repo) {
|
|
36825
36856
|
const args = ["issue", "view", String(number)];
|
|
36826
36857
|
if (repo) args.push("--repo", repo);
|
|
36827
36858
|
try {
|
|
36828
|
-
|
|
36859
|
+
execFileSync16("gh", args, { stdio: "inherit" });
|
|
36829
36860
|
} catch {
|
|
36830
36861
|
process.exit(1);
|
|
36831
36862
|
}
|
|
@@ -36879,7 +36910,7 @@ function registerEditIssue(issueCommand) {
|
|
|
36879
36910
|
}
|
|
36880
36911
|
|
|
36881
36912
|
// src/commands/github/issue/editIssueComment.ts
|
|
36882
|
-
import { execFileSync as
|
|
36913
|
+
import { execFileSync as execFileSync17 } from "child_process";
|
|
36883
36914
|
var USAGE5 = "Usage: assist github issue edit-comment <comment-id> --body <body> [-R <owner>/<repo>]";
|
|
36884
36915
|
async function editIssueComment(commentIdArg, options2) {
|
|
36885
36916
|
const commentId = Number.parseInt(commentIdArg, 10);
|
|
@@ -36906,7 +36937,7 @@ async function editIssueComment(commentIdArg, options2) {
|
|
|
36906
36937
|
];
|
|
36907
36938
|
let raw;
|
|
36908
36939
|
try {
|
|
36909
|
-
raw =
|
|
36940
|
+
raw = execFileSync17("gh", args, {
|
|
36910
36941
|
input: JSON.stringify({ body }),
|
|
36911
36942
|
encoding: "utf8"
|
|
36912
36943
|
});
|
|
@@ -37806,7 +37837,7 @@ function registerRefineLaunch(program, resumeFlag) {
|
|
|
37806
37837
|
import chalk202 from "chalk";
|
|
37807
37838
|
|
|
37808
37839
|
// src/commands/review/checkoutPr.ts
|
|
37809
|
-
import { execFileSync as
|
|
37840
|
+
import { execFileSync as execFileSync20 } from "child_process";
|
|
37810
37841
|
|
|
37811
37842
|
// src/commands/review/clearStalePrBranch.ts
|
|
37812
37843
|
var tipSetFromRemote = /^branch: (Created from|Reset to)|^fetch\b|: Fast-forward$/;
|
|
@@ -38437,13 +38468,13 @@ function prCliCommands(number, cwd) {
|
|
|
38437
38468
|
}
|
|
38438
38469
|
|
|
38439
38470
|
// src/commands/review/prHeadBranch.ts
|
|
38440
|
-
import { execFileSync as
|
|
38471
|
+
import { execFileSync as execFileSync18 } from "child_process";
|
|
38441
38472
|
function prHeadBranch({
|
|
38442
38473
|
headBranch
|
|
38443
38474
|
}) {
|
|
38444
38475
|
try {
|
|
38445
38476
|
return headBranch.parse(
|
|
38446
|
-
|
|
38477
|
+
execFileSync18(headBranch.file, headBranch.args, {
|
|
38447
38478
|
encoding: "utf8",
|
|
38448
38479
|
stdio: ["ignore", "pipe", "pipe"]
|
|
38449
38480
|
})
|
|
@@ -38514,7 +38545,7 @@ function worktreeHoldingBranch(cwd, branch2) {
|
|
|
38514
38545
|
import chalk201 from "chalk";
|
|
38515
38546
|
|
|
38516
38547
|
// src/commands/review/azCliProblem.ts
|
|
38517
|
-
import { execFileSync as
|
|
38548
|
+
import { execFileSync as execFileSync19 } from "child_process";
|
|
38518
38549
|
|
|
38519
38550
|
// src/commands/review/azFailureProblem.ts
|
|
38520
38551
|
var azProblems = {
|
|
@@ -38542,7 +38573,7 @@ function azFailureProblem(error) {
|
|
|
38542
38573
|
// src/commands/review/azCliProblem.ts
|
|
38543
38574
|
function runAz(args) {
|
|
38544
38575
|
try {
|
|
38545
|
-
|
|
38576
|
+
execFileSync19("az", args, { stdio: "ignore" });
|
|
38546
38577
|
return "ok";
|
|
38547
38578
|
} catch (error) {
|
|
38548
38579
|
return error.code === "ENOENT" ? "missing" : "failed";
|
|
@@ -38605,7 +38636,7 @@ async function checkoutPr(number) {
|
|
|
38605
38636
|
const from = branch2 === "HEAD" ? gitSyncOrNull(process.cwd(), ["rev-parse", "HEAD"]) : branch2;
|
|
38606
38637
|
const stale = headRef ? clearStalePrBranch(process.cwd(), headRef) : "absent";
|
|
38607
38638
|
try {
|
|
38608
|
-
|
|
38639
|
+
execFileSync20(commands.checkout.file, commands.checkout.args, {
|
|
38609
38640
|
stdio: "inherit"
|
|
38610
38641
|
});
|
|
38611
38642
|
} catch {
|
|
@@ -40659,9 +40690,9 @@ var azureDevopsThreadRequests = {
|
|
|
40659
40690
|
};
|
|
40660
40691
|
|
|
40661
40692
|
// src/commands/prs/azureDevops/currentAzureDevopsPr.ts
|
|
40662
|
-
import { execFileSync as
|
|
40693
|
+
import { execFileSync as execFileSync21 } from "child_process";
|
|
40663
40694
|
function findPrForBranch(repo, branch2) {
|
|
40664
|
-
const stdout =
|
|
40695
|
+
const stdout = execFileSync21(
|
|
40665
40696
|
"az",
|
|
40666
40697
|
[
|
|
40667
40698
|
"repos",
|
|
@@ -40708,7 +40739,7 @@ function failAzureDevops(error) {
|
|
|
40708
40739
|
}
|
|
40709
40740
|
|
|
40710
40741
|
// src/commands/prs/azureDevops/invokeAzDevops.ts
|
|
40711
|
-
import { execFileSync as
|
|
40742
|
+
import { execFileSync as execFileSync22 } from "child_process";
|
|
40712
40743
|
import { mkdtempSync as mkdtempSync2, rmSync as rmSync6, writeFileSync as writeFileSync47 } from "fs";
|
|
40713
40744
|
import { tmpdir as tmpdir7 } from "os";
|
|
40714
40745
|
import { join as join99 } from "path";
|
|
@@ -40737,7 +40768,7 @@ function azDevopsInvokeArgs(request, inFile) {
|
|
|
40737
40768
|
];
|
|
40738
40769
|
}
|
|
40739
40770
|
function runAz2(args) {
|
|
40740
|
-
const stdout =
|
|
40771
|
+
const stdout = execFileSync22("az", args, {
|
|
40741
40772
|
encoding: "utf8",
|
|
40742
40773
|
stdio: ["ignore", "pipe", "pipe"],
|
|
40743
40774
|
windowsHide: true
|
|
@@ -40804,10 +40835,10 @@ function listAzureDevopsComments(repo) {
|
|
|
40804
40835
|
}
|
|
40805
40836
|
|
|
40806
40837
|
// src/commands/prs/fetchThreadIds.ts
|
|
40807
|
-
import { execFileSync as
|
|
40838
|
+
import { execFileSync as execFileSync23 } from "child_process";
|
|
40808
40839
|
var THREAD_QUERY = `query($owner: String!, $repo: String!, $prNumber: Int!) { repository(owner: $owner, name: $repo) { pullRequest(number: $prNumber) { reviewThreads(first: 100) { nodes { id isResolved comments(first: 100) { nodes { databaseId } } } } } } }`;
|
|
40809
40840
|
function fetchThreadIds(org, repo, prNumber) {
|
|
40810
|
-
const result =
|
|
40841
|
+
const result = execFileSync23(
|
|
40811
40842
|
"gh",
|
|
40812
40843
|
[
|
|
40813
40844
|
"api",
|
|
@@ -41088,7 +41119,7 @@ function printComments2(result) {
|
|
|
41088
41119
|
import { execSync as execSync46 } from "child_process";
|
|
41089
41120
|
|
|
41090
41121
|
// src/commands/prs/threadTarget.ts
|
|
41091
|
-
import { execFileSync as
|
|
41122
|
+
import { execFileSync as execFileSync24 } from "child_process";
|
|
41092
41123
|
|
|
41093
41124
|
// src/commands/prs/azureDevops/azureDevopsThreadActions.ts
|
|
41094
41125
|
function attempt(run5) {
|
|
@@ -41136,7 +41167,7 @@ function replyToComment(org, repo, prNumber, commentId, message4) {
|
|
|
41136
41167
|
// src/commands/prs/threadTarget.ts
|
|
41137
41168
|
function resolveThread(threadId) {
|
|
41138
41169
|
const mutation = `mutation($threadId: ID!) { resolveReviewThread(input: {threadId: $threadId}) { thread { isResolved } } }`;
|
|
41139
|
-
|
|
41170
|
+
execFileSync24(
|
|
41140
41171
|
"gh",
|
|
41141
41172
|
["api", "graphql", "-f", `query=${mutation}`, "-f", `threadId=${threadId}`],
|
|
41142
41173
|
{ stdio: ["inherit", "pipe", "inherit"] }
|
|
@@ -41778,7 +41809,7 @@ function buildValidatedBody(options2, usage) {
|
|
|
41778
41809
|
}
|
|
41779
41810
|
|
|
41780
41811
|
// src/commands/prs/placePr.ts
|
|
41781
|
-
import { execFileSync as
|
|
41812
|
+
import { execFileSync as execFileSync25 } from "child_process";
|
|
41782
41813
|
|
|
41783
41814
|
// src/commands/prs/buildCreateArgs.ts
|
|
41784
41815
|
function buildCreateArgs(title, body, options2, attachments = []) {
|
|
@@ -41864,7 +41895,7 @@ function buildEditArgs(number, title, body, attachments = []) {
|
|
|
41864
41895
|
// src/commands/prs/placePr.ts
|
|
41865
41896
|
function hasUpstream2() {
|
|
41866
41897
|
try {
|
|
41867
|
-
|
|
41898
|
+
execFileSync25(
|
|
41868
41899
|
"git",
|
|
41869
41900
|
["rev-parse", "--abbrev-ref", "--symbolic-full-name", "@{u}"],
|
|
41870
41901
|
{ stdio: "pipe" }
|
|
@@ -41876,7 +41907,7 @@ function hasUpstream2() {
|
|
|
41876
41907
|
}
|
|
41877
41908
|
function ensureBranchPushed() {
|
|
41878
41909
|
const args = hasUpstream2() ? ["push"] : ["push", "--set-upstream", "origin", "HEAD"];
|
|
41879
|
-
|
|
41910
|
+
execFileSync25("git", args, { stdio: "inherit" });
|
|
41880
41911
|
}
|
|
41881
41912
|
async function placePr(prNumber, title, body, options2, attachments = []) {
|
|
41882
41913
|
const args = prNumber !== null ? buildEditArgs(prNumber, title, body, attachments) : buildCreateArgs(title, body, options2, attachments);
|
|
@@ -41947,10 +41978,10 @@ function warn(reason4) {
|
|
|
41947
41978
|
}
|
|
41948
41979
|
|
|
41949
41980
|
// src/commands/prs/enableAutoMerge.ts
|
|
41950
|
-
import { execFileSync as
|
|
41981
|
+
import { execFileSync as execFileSync26 } from "child_process";
|
|
41951
41982
|
function enableAutoMerge() {
|
|
41952
41983
|
try {
|
|
41953
|
-
|
|
41984
|
+
execFileSync26(
|
|
41954
41985
|
"gh",
|
|
41955
41986
|
["pr", "merge", getCurrentBranch2(), "--auto", "--squash"],
|
|
41956
41987
|
{ stdio: "inherit" }
|
|
@@ -42210,10 +42241,10 @@ function prsSlackChannel() {
|
|
|
42210
42241
|
}
|
|
42211
42242
|
|
|
42212
42243
|
// src/commands/prs/status/fetchReviewThreads.ts
|
|
42213
|
-
import { execFileSync as
|
|
42244
|
+
import { execFileSync as execFileSync27 } from "child_process";
|
|
42214
42245
|
var THREAD_QUERY2 = `query($owner: String!, $repo: String!, $prNumber: Int!) { repository(owner: $owner, name: $repo) { pullRequest(number: $prNumber) { reviewThreads(first: 100) { nodes { isResolved } } } } }`;
|
|
42215
42246
|
function fetchReviewThreads(org, repo, prNumber) {
|
|
42216
|
-
const output =
|
|
42247
|
+
const output = execFileSync27(
|
|
42217
42248
|
"gh",
|
|
42218
42249
|
[
|
|
42219
42250
|
"api",
|
|
@@ -46695,7 +46726,7 @@ function readGlobs(value) {
|
|
|
46695
46726
|
}
|
|
46696
46727
|
|
|
46697
46728
|
// src/commands/review/highLevel/summariseRepoTree.ts
|
|
46698
|
-
import { execFileSync as
|
|
46729
|
+
import { execFileSync as execFileSync28 } from "child_process";
|
|
46699
46730
|
import { dirname as dirname46, extname as extname6 } from "path";
|
|
46700
46731
|
var MAX_DIRECTORIES = 200;
|
|
46701
46732
|
var MAX_EXTENSIONS_PER_DIRECTORY = 6;
|
|
@@ -46711,7 +46742,7 @@ function summariseRepoTree(cwd = process.cwd()) {
|
|
|
46711
46742
|
}
|
|
46712
46743
|
function listTrackedFiles(cwd) {
|
|
46713
46744
|
try {
|
|
46714
|
-
return
|
|
46745
|
+
return execFileSync28("git", ["ls-files"], {
|
|
46715
46746
|
cwd,
|
|
46716
46747
|
encoding: "utf8",
|
|
46717
46748
|
maxBuffer: 64 * 1024 * 1024
|
|
@@ -47184,7 +47215,7 @@ function evaluateHighLevelChecks(subject) {
|
|
|
47184
47215
|
}
|
|
47185
47216
|
|
|
47186
47217
|
// src/commands/review/highLevel/fetchHighLevelFiles.ts
|
|
47187
|
-
import { execFileSync as
|
|
47218
|
+
import { execFileSync as execFileSync29 } from "child_process";
|
|
47188
47219
|
import { createHash as createHash4 } from "crypto";
|
|
47189
47220
|
var JQ = ".[] | {filename,status,additions,deletions,patch} | @json";
|
|
47190
47221
|
function toStatus(status2) {
|
|
@@ -47197,7 +47228,7 @@ function diffUrl(repo, prNumber, path128) {
|
|
|
47197
47228
|
return `https://github.com/${repo}/pull/${prNumber}/files#diff-${anchor}`;
|
|
47198
47229
|
}
|
|
47199
47230
|
function fetchHighLevelFiles(prNumber, repo) {
|
|
47200
|
-
const out =
|
|
47231
|
+
const out = execFileSync29(
|
|
47201
47232
|
"gh",
|
|
47202
47233
|
["api", `repos/${repo}/pulls/${prNumber}/files`, "--paginate", "--jq", JQ],
|
|
47203
47234
|
{ encoding: "utf8", maxBuffer: 64 * 1024 * 1024 }
|
|
@@ -47720,11 +47751,11 @@ function collectHighLevelTests(files, testPaths, readSource4) {
|
|
|
47720
47751
|
}
|
|
47721
47752
|
|
|
47722
47753
|
// src/commands/review/highLevel/fetchFileAtSha.ts
|
|
47723
|
-
import { execFileSync as
|
|
47754
|
+
import { execFileSync as execFileSync30 } from "child_process";
|
|
47724
47755
|
function fetchFileAtSha(repo, sha, path128) {
|
|
47725
47756
|
const encodedPath = path128.split("/").map(encodeURIComponent).join("/");
|
|
47726
47757
|
try {
|
|
47727
|
-
return
|
|
47758
|
+
return execFileSync30(
|
|
47728
47759
|
"gh",
|
|
47729
47760
|
[
|
|
47730
47761
|
"api",
|
|
@@ -53328,13 +53359,13 @@ Total: ${violations.length} forbidden string(s).`);
|
|
|
53328
53359
|
}
|
|
53329
53360
|
|
|
53330
53361
|
// src/commands/verify/hardcodedColors.ts
|
|
53331
|
-
import { execFileSync as
|
|
53362
|
+
import { execFileSync as execFileSync31 } from "child_process";
|
|
53332
53363
|
import { minimatch as minimatch11 } from "minimatch";
|
|
53333
53364
|
var pattern = "0x[0-9a-fA-F]{6}|#[0-9a-fA-F]{3,6}";
|
|
53334
53365
|
function hardcodedColors() {
|
|
53335
53366
|
const ignoreGlobs = loadConfig().hardcodedColors?.ignore ?? [];
|
|
53336
53367
|
try {
|
|
53337
|
-
const output =
|
|
53368
|
+
const output = execFileSync31("grep", ["-rEnH", "-f", "-", "src/"], {
|
|
53338
53369
|
encoding: "utf8",
|
|
53339
53370
|
input: `${pattern}
|
|
53340
53371
|
`
|
|
@@ -54290,11 +54321,11 @@ function consumeSimulatedDivergence(cwd) {
|
|
|
54290
54321
|
}
|
|
54291
54322
|
|
|
54292
54323
|
// src/commands/watch/fetchQuietly.ts
|
|
54293
|
-
import { execFileSync as
|
|
54324
|
+
import { execFileSync as execFileSync32 } from "child_process";
|
|
54294
54325
|
var MIN_FETCH_TIMEOUT_MS = 6e4;
|
|
54295
54326
|
function fetchQuietly(cwd, intervalMs) {
|
|
54296
54327
|
try {
|
|
54297
|
-
|
|
54328
|
+
execFileSync32("git", ["fetch", "--quiet"], {
|
|
54298
54329
|
stdio: ["pipe", "pipe", "pipe"],
|
|
54299
54330
|
cwd,
|
|
54300
54331
|
timeout: Math.max(intervalMs, MIN_FETCH_TIMEOUT_MS)
|
|
@@ -54563,7 +54594,7 @@ function registerWatch(program) {
|
|
|
54563
54594
|
}
|
|
54564
54595
|
|
|
54565
54596
|
// src/commands/roam/postRoamActivity.ts
|
|
54566
|
-
import { execFileSync as
|
|
54597
|
+
import { execFileSync as execFileSync33 } from "child_process";
|
|
54567
54598
|
import { readdirSync as readdirSync27, readFileSync as readFileSync86, statSync as statSync18 } from "fs";
|
|
54568
54599
|
import { join as join123 } from "path";
|
|
54569
54600
|
function findPortFile(roamDir) {
|
|
@@ -54602,7 +54633,7 @@ function postRoamActivity(app, event) {
|
|
|
54602
54633
|
const pid = PID_BY_APP[app] ?? 99999;
|
|
54603
54634
|
const url = `http://127.0.0.1:${port}/api/v1/activity/${app}/${event}?pid=${pid}`;
|
|
54604
54635
|
try {
|
|
54605
|
-
|
|
54636
|
+
execFileSync33("curl", ["-sf", "--max-time", "0.2", "-X", "POST", url], {
|
|
54606
54637
|
stdio: "ignore"
|
|
54607
54638
|
});
|
|
54608
54639
|
} catch {
|
|
@@ -55198,11 +55229,11 @@ function formatLink(link3) {
|
|
|
55198
55229
|
}
|
|
55199
55230
|
|
|
55200
55231
|
// src/commands/sessions/daemon/listDaemonPids.ts
|
|
55201
|
-
import { execFileSync as
|
|
55232
|
+
import { execFileSync as execFileSync34 } from "child_process";
|
|
55202
55233
|
function listDaemonPids() {
|
|
55203
55234
|
if (process.platform === "win32") return [];
|
|
55204
55235
|
try {
|
|
55205
|
-
const out =
|
|
55236
|
+
const out = execFileSync34("ps", ["-eo", "pid=,args="], {
|
|
55206
55237
|
encoding: "utf8"
|
|
55207
55238
|
});
|
|
55208
55239
|
return out.split("\n").filter((line) => line.includes("assist") && / daemon run\b/.test(line)).map((line) => Number.parseInt(line.trim(), 10)).filter((pid) => Number.isInteger(pid));
|
|
@@ -60044,7 +60075,7 @@ function releaseClient(client, clients, prPreview, verify) {
|
|
|
60044
60075
|
}
|
|
60045
60076
|
|
|
60046
60077
|
// src/commands/sessions/daemon/findPortHolderPid.ts
|
|
60047
|
-
import { execFileSync as
|
|
60078
|
+
import { execFileSync as execFileSync35 } from "child_process";
|
|
60048
60079
|
var PROBE_TIMEOUT_MS = 3e3;
|
|
60049
60080
|
function findPortHolderPid(port) {
|
|
60050
60081
|
try {
|
|
@@ -60054,7 +60085,7 @@ function findPortHolderPid(port) {
|
|
|
60054
60085
|
}
|
|
60055
60086
|
}
|
|
60056
60087
|
function probe2(command, args) {
|
|
60057
|
-
return
|
|
60088
|
+
return execFileSync35(command, args, {
|
|
60058
60089
|
encoding: "utf8",
|
|
60059
60090
|
timeout: PROBE_TIMEOUT_MS,
|
|
60060
60091
|
stdio: ["ignore", "pipe", "ignore"]
|