@staff0rd/assist 0.549.0 → 0.549.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/README.md +10 -3
- package/claude/commands/review-pr-comments.md +14 -2
- package/dist/commands/sessions/web/bundle.js +1 -1
- package/dist/index.js +111 -76
- 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.549.
|
|
9
|
+
version: "0.549.1",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -22467,10 +22467,10 @@ async function edit(options2) {
|
|
|
22467
22467
|
}
|
|
22468
22468
|
|
|
22469
22469
|
// src/commands/prs/fixed.ts
|
|
22470
|
-
import { execSync as
|
|
22470
|
+
import { execSync as execSync45 } from "child_process";
|
|
22471
22471
|
|
|
22472
22472
|
// src/commands/prs/resolveCommentWithReply.ts
|
|
22473
|
-
import { execSync as
|
|
22473
|
+
import { execSync as execSync44 } from "child_process";
|
|
22474
22474
|
import { unlinkSync as unlinkSync14, writeFileSync as writeFileSync33 } from "fs";
|
|
22475
22475
|
import { tmpdir as tmpdir6 } from "os";
|
|
22476
22476
|
import { join as join57 } from "path";
|
|
@@ -22511,12 +22511,22 @@ function deleteCommentsCache(org, repo, prNumber) {
|
|
|
22511
22511
|
}
|
|
22512
22512
|
|
|
22513
22513
|
// src/commands/prs/replyToComment.ts
|
|
22514
|
-
import {
|
|
22514
|
+
import { spawnSync as spawnSync5 } from "child_process";
|
|
22515
22515
|
function replyToComment(org, repo, prNumber, commentId, message3) {
|
|
22516
|
-
|
|
22517
|
-
|
|
22518
|
-
|
|
22516
|
+
const result = spawnSync5(
|
|
22517
|
+
"gh",
|
|
22518
|
+
[
|
|
22519
|
+
"api",
|
|
22520
|
+
`repos/${org}/${repo}/pulls/${prNumber}/comments`,
|
|
22521
|
+
"-f",
|
|
22522
|
+
`body=${message3}`,
|
|
22523
|
+
"-F",
|
|
22524
|
+
`in_reply_to=${commentId}`
|
|
22525
|
+
],
|
|
22526
|
+
{ encoding: "utf8", windowsHide: true }
|
|
22519
22527
|
);
|
|
22528
|
+
if (result.error) throw result.error;
|
|
22529
|
+
if (result.status !== 0) throw new Error(result.stderr || result.stdout);
|
|
22520
22530
|
}
|
|
22521
22531
|
|
|
22522
22532
|
// src/commands/prs/resolveCommentWithReply.ts
|
|
@@ -22525,7 +22535,7 @@ function resolveThread(threadId) {
|
|
|
22525
22535
|
const queryFile = join57(tmpdir6(), `gh-mutation-${Date.now()}.graphql`);
|
|
22526
22536
|
writeFileSync33(queryFile, mutation);
|
|
22527
22537
|
try {
|
|
22528
|
-
|
|
22538
|
+
execSync44(
|
|
22529
22539
|
`gh api graphql -F query=@${queryFile} -f threadId="${threadId}"`,
|
|
22530
22540
|
{ stdio: ["inherit", "pipe", "inherit"] }
|
|
22531
22541
|
);
|
|
@@ -22577,7 +22587,7 @@ function resolveCommentWithReply(commentId, message3) {
|
|
|
22577
22587
|
// src/commands/prs/fixed.ts
|
|
22578
22588
|
function verifySha(sha) {
|
|
22579
22589
|
try {
|
|
22580
|
-
return
|
|
22590
|
+
return execSync45(`git rev-parse --verify ${sha}`, {
|
|
22581
22591
|
encoding: "utf8"
|
|
22582
22592
|
}).trim();
|
|
22583
22593
|
} catch {
|
|
@@ -22604,7 +22614,7 @@ function fixed(commentId, sha) {
|
|
|
22604
22614
|
}
|
|
22605
22615
|
|
|
22606
22616
|
// src/commands/prs/fetchThreadIds.ts
|
|
22607
|
-
import { execSync as
|
|
22617
|
+
import { execSync as execSync46 } from "child_process";
|
|
22608
22618
|
import { unlinkSync as unlinkSync15, writeFileSync as writeFileSync34 } from "fs";
|
|
22609
22619
|
import { tmpdir as tmpdir7 } from "os";
|
|
22610
22620
|
import { join as join58 } from "path";
|
|
@@ -22613,7 +22623,7 @@ function fetchThreadIds(org, repo, prNumber) {
|
|
|
22613
22623
|
const queryFile = join58(tmpdir7(), `gh-query-${Date.now()}.graphql`);
|
|
22614
22624
|
writeFileSync34(queryFile, THREAD_QUERY);
|
|
22615
22625
|
try {
|
|
22616
|
-
const result =
|
|
22626
|
+
const result = execSync46(
|
|
22617
22627
|
`gh api graphql -F query=@${queryFile} -F owner="${org}" -F repo="${repo}" -F prNumber=${prNumber}`,
|
|
22618
22628
|
{ encoding: "utf8" }
|
|
22619
22629
|
);
|
|
@@ -22635,9 +22645,9 @@ function fetchThreadIds(org, repo, prNumber) {
|
|
|
22635
22645
|
}
|
|
22636
22646
|
|
|
22637
22647
|
// src/commands/prs/listComments/fetchReviewComments.ts
|
|
22638
|
-
import { execSync as
|
|
22648
|
+
import { execSync as execSync47 } from "child_process";
|
|
22639
22649
|
function fetchJson(endpoint) {
|
|
22640
|
-
const result =
|
|
22650
|
+
const result = execSync47(`gh api --paginate ${endpoint}`, {
|
|
22641
22651
|
encoding: "utf8"
|
|
22642
22652
|
});
|
|
22643
22653
|
if (!result.trim()) return [];
|
|
@@ -22913,7 +22923,7 @@ async function listComments() {
|
|
|
22913
22923
|
}
|
|
22914
22924
|
|
|
22915
22925
|
// src/commands/prs/prs/index.ts
|
|
22916
|
-
import { execSync as
|
|
22926
|
+
import { execSync as execSync48 } from "child_process";
|
|
22917
22927
|
|
|
22918
22928
|
// src/commands/prs/prs/displayPaginated/index.ts
|
|
22919
22929
|
import enquirer9 from "enquirer";
|
|
@@ -23020,7 +23030,7 @@ async function prs(options2) {
|
|
|
23020
23030
|
const state = options2.open ? "open" : options2.closed ? "closed" : "all";
|
|
23021
23031
|
try {
|
|
23022
23032
|
const { org, repo } = getRepoInfo();
|
|
23023
|
-
const result =
|
|
23033
|
+
const result = execSync48(
|
|
23024
23034
|
`gh pr list --state ${state} --json number,title,url,author,createdAt,mergedAt,closedAt,state,changedFiles --limit 100 -R ${org}/${repo}`,
|
|
23025
23035
|
{ encoding: "utf8" }
|
|
23026
23036
|
);
|
|
@@ -23091,16 +23101,16 @@ function buildCreateArgs(title, body, options2) {
|
|
|
23091
23101
|
}
|
|
23092
23102
|
|
|
23093
23103
|
// src/commands/prs/readSessionPrRef.ts
|
|
23094
|
-
import { execSync as
|
|
23104
|
+
import { execSync as execSync49 } from "child_process";
|
|
23095
23105
|
function readSessionPrRef() {
|
|
23096
23106
|
try {
|
|
23097
|
-
const branch2 =
|
|
23107
|
+
const branch2 = execSync49("git rev-parse --abbrev-ref HEAD", {
|
|
23098
23108
|
encoding: "utf8",
|
|
23099
23109
|
stdio: ["pipe", "pipe", "pipe"]
|
|
23100
23110
|
}).trim();
|
|
23101
23111
|
if (!branch2 || branch2 === "HEAD") return null;
|
|
23102
23112
|
const pr = JSON.parse(
|
|
23103
|
-
|
|
23113
|
+
execSync49(`gh pr view ${branch2} --json number,title,url,state`, {
|
|
23104
23114
|
encoding: "utf8",
|
|
23105
23115
|
stdio: ["pipe", "pipe", "pipe"]
|
|
23106
23116
|
})
|
|
@@ -23357,7 +23367,7 @@ function reply(commentId, body) {
|
|
|
23357
23367
|
}
|
|
23358
23368
|
|
|
23359
23369
|
// src/commands/prs/wontfix.ts
|
|
23360
|
-
import { execSync as
|
|
23370
|
+
import { execSync as execSync50 } from "child_process";
|
|
23361
23371
|
function validateReason(reason4) {
|
|
23362
23372
|
const lowerReason = reason4.toLowerCase();
|
|
23363
23373
|
if (lowerReason.includes("claude") || lowerReason.includes("opus")) {
|
|
@@ -23374,7 +23384,7 @@ function validateShaReferences(reason4) {
|
|
|
23374
23384
|
const invalidShas = [];
|
|
23375
23385
|
for (const sha of shas) {
|
|
23376
23386
|
try {
|
|
23377
|
-
|
|
23387
|
+
execSync50(`git cat-file -t ${sha}`, { stdio: "pipe" });
|
|
23378
23388
|
} catch {
|
|
23379
23389
|
invalidShas.push(sha);
|
|
23380
23390
|
}
|
|
@@ -23401,6 +23411,45 @@ function wontfix(commentId, reason4) {
|
|
|
23401
23411
|
}
|
|
23402
23412
|
}
|
|
23403
23413
|
|
|
23414
|
+
// src/commands/prs/readBodyArgument.ts
|
|
23415
|
+
async function readBodyArgument(value) {
|
|
23416
|
+
if (value !== "-") return value;
|
|
23417
|
+
const body = (await readStdinBuffer()).toString("utf8").replace(/\n+$/, "");
|
|
23418
|
+
if (body.trim().length === 0) {
|
|
23419
|
+
console.error("Error: No body was provided on stdin.");
|
|
23420
|
+
process.exit(1);
|
|
23421
|
+
}
|
|
23422
|
+
return body;
|
|
23423
|
+
}
|
|
23424
|
+
|
|
23425
|
+
// src/commands/registerPrsComments.ts
|
|
23426
|
+
function registerPrsComments(prsCommand) {
|
|
23427
|
+
prsCommand.command("list-comments").description("List all comments on the current branch's pull request").action(() => {
|
|
23428
|
+
listComments().then(printComments2);
|
|
23429
|
+
});
|
|
23430
|
+
prsCommand.command("fixed <comment-id> <sha>").description("Reply with commit link and resolve thread").action((commentId, sha) => {
|
|
23431
|
+
fixed(Number.parseInt(commentId, 10), sha);
|
|
23432
|
+
});
|
|
23433
|
+
prsCommand.command("wontfix <comment-id> <reason>").description(
|
|
23434
|
+
"Reply with reason and resolve thread (reason of - reads it from stdin)"
|
|
23435
|
+
).action(async (commentId, reason4) => {
|
|
23436
|
+
wontfix(
|
|
23437
|
+
Number.parseInt(commentId, 10),
|
|
23438
|
+
await readBodyArgument(reason4)
|
|
23439
|
+
);
|
|
23440
|
+
});
|
|
23441
|
+
prsCommand.command("reply <comment-id> <body>").description(
|
|
23442
|
+
"Reply to a comment thread without resolving it (body of - reads it from stdin)"
|
|
23443
|
+
).action(async (commentId, body) => {
|
|
23444
|
+
reply(Number.parseInt(commentId, 10), await readBodyArgument(body));
|
|
23445
|
+
});
|
|
23446
|
+
prsCommand.command("comment <path> <line> <body>").description(
|
|
23447
|
+
"Add a line comment to the pending review (body of - reads it from stdin)"
|
|
23448
|
+
).action(async (path73, line, body) => {
|
|
23449
|
+
comment2(path73, Number.parseInt(line, 10), await readBodyArgument(body));
|
|
23450
|
+
});
|
|
23451
|
+
}
|
|
23452
|
+
|
|
23404
23453
|
// src/commands/prs/prConcisenessGuidance.ts
|
|
23405
23454
|
var prConcisenessGuidance = `Brevity budget \u2014 one paragraph per section, and these are ceilings, not targets:
|
|
23406
23455
|
|
|
@@ -23606,21 +23655,7 @@ function registerPrs(program2) {
|
|
|
23606
23655
|
const prsCommand = program2.command("prs").description("Pull request utilities").option("--open", "List only open pull requests").option("--closed", "List only closed pull requests").action(prs);
|
|
23607
23656
|
registerPrsRaise(prsCommand);
|
|
23608
23657
|
registerPrsEdit(prsCommand);
|
|
23609
|
-
prsCommand
|
|
23610
|
-
listComments().then(printComments2);
|
|
23611
|
-
});
|
|
23612
|
-
prsCommand.command("fixed <comment-id> <sha>").description("Reply with commit link and resolve thread").action((commentId, sha) => {
|
|
23613
|
-
fixed(Number.parseInt(commentId, 10), sha);
|
|
23614
|
-
});
|
|
23615
|
-
prsCommand.command("wontfix <comment-id> <reason>").description("Reply with reason and resolve thread").action((commentId, reason4) => {
|
|
23616
|
-
wontfix(Number.parseInt(commentId, 10), reason4);
|
|
23617
|
-
});
|
|
23618
|
-
prsCommand.command("reply <comment-id> <body>").description("Reply to a comment thread without resolving it").action((commentId, body) => {
|
|
23619
|
-
reply(Number.parseInt(commentId, 10), body);
|
|
23620
|
-
});
|
|
23621
|
-
prsCommand.command("comment <path> <line> <body>").description("Add a line comment to the pending review").action((path73, line, body) => {
|
|
23622
|
-
comment2(path73, Number.parseInt(line, 10), body);
|
|
23623
|
-
});
|
|
23658
|
+
registerPrsComments(prsCommand);
|
|
23624
23659
|
configHelp(prsCommand, prsConfigHelp);
|
|
23625
23660
|
}
|
|
23626
23661
|
|
|
@@ -23694,10 +23729,10 @@ import chalk174 from "chalk";
|
|
|
23694
23729
|
import Enquirer2 from "enquirer";
|
|
23695
23730
|
|
|
23696
23731
|
// src/commands/ravendb/searchItems.ts
|
|
23697
|
-
import { execSync as
|
|
23732
|
+
import { execSync as execSync51 } from "child_process";
|
|
23698
23733
|
import chalk173 from "chalk";
|
|
23699
23734
|
function opExec(args) {
|
|
23700
|
-
return
|
|
23735
|
+
return execSync51(`op ${args}`, {
|
|
23701
23736
|
encoding: "utf8",
|
|
23702
23737
|
stdio: ["pipe", "pipe", "pipe"]
|
|
23703
23738
|
}).trim();
|
|
@@ -23849,7 +23884,7 @@ ${errorText}`
|
|
|
23849
23884
|
}
|
|
23850
23885
|
|
|
23851
23886
|
// src/commands/ravendb/resolveOpSecret.ts
|
|
23852
|
-
import { execSync as
|
|
23887
|
+
import { execSync as execSync52 } from "child_process";
|
|
23853
23888
|
import chalk178 from "chalk";
|
|
23854
23889
|
function resolveOpSecret(reference) {
|
|
23855
23890
|
if (!reference.startsWith("op://")) {
|
|
@@ -23857,7 +23892,7 @@ function resolveOpSecret(reference) {
|
|
|
23857
23892
|
process.exit(1);
|
|
23858
23893
|
}
|
|
23859
23894
|
try {
|
|
23860
|
-
return
|
|
23895
|
+
return execSync52(`op read "${reference}"`, {
|
|
23861
23896
|
encoding: "utf8",
|
|
23862
23897
|
stdio: ["pipe", "pipe", "pipe"]
|
|
23863
23898
|
}).trim();
|
|
@@ -24107,7 +24142,7 @@ Refactor check failed:
|
|
|
24107
24142
|
}
|
|
24108
24143
|
|
|
24109
24144
|
// src/commands/refactor/check/getViolations/index.ts
|
|
24110
|
-
import { execSync as
|
|
24145
|
+
import { execSync as execSync53 } from "child_process";
|
|
24111
24146
|
import fs25 from "fs";
|
|
24112
24147
|
import { minimatch as minimatch6 } from "minimatch";
|
|
24113
24148
|
|
|
@@ -24157,7 +24192,7 @@ function getGitFiles(options2) {
|
|
|
24157
24192
|
}
|
|
24158
24193
|
const files = /* @__PURE__ */ new Set();
|
|
24159
24194
|
if (options2.staged || options2.modified) {
|
|
24160
|
-
const staged =
|
|
24195
|
+
const staged = execSync53("git diff --cached --name-only", {
|
|
24161
24196
|
encoding: "utf8"
|
|
24162
24197
|
});
|
|
24163
24198
|
for (const file of staged.trim().split("\n").filter(Boolean)) {
|
|
@@ -24165,7 +24200,7 @@ function getGitFiles(options2) {
|
|
|
24165
24200
|
}
|
|
24166
24201
|
}
|
|
24167
24202
|
if (options2.unstaged || options2.modified) {
|
|
24168
|
-
const unstaged =
|
|
24203
|
+
const unstaged = execSync53("git diff --name-only", { encoding: "utf8" });
|
|
24169
24204
|
for (const file of unstaged.trim().split("\n").filter(Boolean)) {
|
|
24170
24205
|
files.add(file);
|
|
24171
24206
|
}
|
|
@@ -25863,9 +25898,9 @@ function buildReviewPaths(repoRoot2, key) {
|
|
|
25863
25898
|
}
|
|
25864
25899
|
|
|
25865
25900
|
// src/commands/review/fetchExistingComments.ts
|
|
25866
|
-
import { execSync as
|
|
25901
|
+
import { execSync as execSync54 } from "child_process";
|
|
25867
25902
|
function fetchRawComments(org, repo, prNumber) {
|
|
25868
|
-
const out =
|
|
25903
|
+
const out = execSync54(
|
|
25869
25904
|
`gh api --paginate repos/${org}/${repo}/pulls/${prNumber}/comments`,
|
|
25870
25905
|
{ encoding: "utf8", maxBuffer: 64 * 1024 * 1024 }
|
|
25871
25906
|
);
|
|
@@ -25896,14 +25931,14 @@ function fetchExistingComments() {
|
|
|
25896
25931
|
}
|
|
25897
25932
|
|
|
25898
25933
|
// src/commands/review/gatherContext.ts
|
|
25899
|
-
import { execSync as
|
|
25934
|
+
import { execSync as execSync57 } from "child_process";
|
|
25900
25935
|
|
|
25901
25936
|
// src/commands/review/fetchPrDiff.ts
|
|
25902
|
-
import { execSync as
|
|
25937
|
+
import { execSync as execSync55 } from "child_process";
|
|
25903
25938
|
function fetchPrDiff(prNumber, baseSha, headSha) {
|
|
25904
25939
|
const { org, repo } = getRepoInfo();
|
|
25905
25940
|
try {
|
|
25906
|
-
return
|
|
25941
|
+
return execSync55(`gh pr diff ${prNumber} -R ${org}/${repo}`, {
|
|
25907
25942
|
encoding: "utf8",
|
|
25908
25943
|
maxBuffer: 256 * 1024 * 1024,
|
|
25909
25944
|
stdio: ["ignore", "pipe", "pipe"]
|
|
@@ -25918,19 +25953,19 @@ function isDiffTooLarge(error) {
|
|
|
25918
25953
|
}
|
|
25919
25954
|
function fetchDiffViaGit(baseSha, headSha) {
|
|
25920
25955
|
try {
|
|
25921
|
-
|
|
25956
|
+
execSync55(`git fetch origin ${baseSha} ${headSha}`, { stdio: "ignore" });
|
|
25922
25957
|
} catch {
|
|
25923
25958
|
}
|
|
25924
|
-
return
|
|
25959
|
+
return execSync55(`git diff ${baseSha}...${headSha}`, {
|
|
25925
25960
|
encoding: "utf8",
|
|
25926
25961
|
maxBuffer: 256 * 1024 * 1024
|
|
25927
25962
|
});
|
|
25928
25963
|
}
|
|
25929
25964
|
|
|
25930
25965
|
// src/commands/review/fetchPrDiffInfo.ts
|
|
25931
|
-
import { execSync as
|
|
25966
|
+
import { execSync as execSync56 } from "child_process";
|
|
25932
25967
|
function getCurrentBranch3() {
|
|
25933
|
-
return
|
|
25968
|
+
return execSync56("git rev-parse --abbrev-ref HEAD", {
|
|
25934
25969
|
encoding: "utf8"
|
|
25935
25970
|
}).trim();
|
|
25936
25971
|
}
|
|
@@ -25938,7 +25973,7 @@ function fetchPrDiffInfo() {
|
|
|
25938
25973
|
const { org, repo } = getRepoInfo();
|
|
25939
25974
|
const branch2 = getCurrentBranch3();
|
|
25940
25975
|
const fields = "number,baseRefName,baseRefOid,headRefName,headRefOid";
|
|
25941
|
-
const raw =
|
|
25976
|
+
const raw = execSync56(
|
|
25942
25977
|
`gh pr list --state open --head ${branch2} --json ${fields} -R ${org}/${repo}`,
|
|
25943
25978
|
{
|
|
25944
25979
|
encoding: "utf8",
|
|
@@ -25963,7 +25998,7 @@ function fetchPrDiffInfo() {
|
|
|
25963
25998
|
}
|
|
25964
25999
|
function fetchPrChangedFiles(prNumber) {
|
|
25965
26000
|
const { org, repo } = getRepoInfo();
|
|
25966
|
-
const out =
|
|
26001
|
+
const out = execSync56(
|
|
25967
26002
|
`gh api repos/${org}/${repo}/pulls/${prNumber}/files --paginate --jq ".[].filename"`,
|
|
25968
26003
|
{
|
|
25969
26004
|
encoding: "utf8",
|
|
@@ -25975,11 +26010,11 @@ function fetchPrChangedFiles(prNumber) {
|
|
|
25975
26010
|
|
|
25976
26011
|
// src/commands/review/gatherContext.ts
|
|
25977
26012
|
function gatherContext() {
|
|
25978
|
-
const branch2 =
|
|
26013
|
+
const branch2 = execSync57("git rev-parse --abbrev-ref HEAD", {
|
|
25979
26014
|
encoding: "utf8"
|
|
25980
26015
|
}).trim();
|
|
25981
|
-
const sha =
|
|
25982
|
-
const shortSha =
|
|
26016
|
+
const sha = execSync57("git rev-parse HEAD", { encoding: "utf8" }).trim();
|
|
26017
|
+
const shortSha = execSync57("git rev-parse --short=7 HEAD", {
|
|
25983
26018
|
encoding: "utf8"
|
|
25984
26019
|
}).trim();
|
|
25985
26020
|
const prInfo = fetchPrDiffInfo();
|
|
@@ -26713,9 +26748,9 @@ var MultiSpinner = class {
|
|
|
26713
26748
|
};
|
|
26714
26749
|
|
|
26715
26750
|
// src/commands/review/ensureCodexAvailable.ts
|
|
26716
|
-
import { spawnSync as
|
|
26751
|
+
import { spawnSync as spawnSync6 } from "child_process";
|
|
26717
26752
|
function runNpmInstall() {
|
|
26718
|
-
const result =
|
|
26753
|
+
const result = spawnSync6("npm", ["install", "-g", "@openai/codex"], {
|
|
26719
26754
|
stdio: "inherit",
|
|
26720
26755
|
shell: true
|
|
26721
26756
|
});
|
|
@@ -29068,7 +29103,7 @@ function registerVerify(program2) {
|
|
|
29068
29103
|
}
|
|
29069
29104
|
|
|
29070
29105
|
// src/commands/voice/devices.ts
|
|
29071
|
-
import { spawnSync as
|
|
29106
|
+
import { spawnSync as spawnSync7 } from "child_process";
|
|
29072
29107
|
import { join as join74 } from "path";
|
|
29073
29108
|
|
|
29074
29109
|
// src/commands/voice/shared.ts
|
|
@@ -29101,7 +29136,7 @@ function getLockFile() {
|
|
|
29101
29136
|
// src/commands/voice/devices.ts
|
|
29102
29137
|
function devices() {
|
|
29103
29138
|
const script = join74(getPythonDir(), "list_devices.py");
|
|
29104
|
-
|
|
29139
|
+
spawnSync7(getVenvPython(), [script], { stdio: "inherit" });
|
|
29105
29140
|
}
|
|
29106
29141
|
|
|
29107
29142
|
// src/commands/voice/logs.ts
|
|
@@ -29133,12 +29168,12 @@ function logs(options2) {
|
|
|
29133
29168
|
}
|
|
29134
29169
|
|
|
29135
29170
|
// src/commands/voice/setup.ts
|
|
29136
|
-
import { spawnSync as
|
|
29171
|
+
import { spawnSync as spawnSync8 } from "child_process";
|
|
29137
29172
|
import { mkdirSync as mkdirSync27 } from "fs";
|
|
29138
29173
|
import { join as join76 } from "path";
|
|
29139
29174
|
|
|
29140
29175
|
// src/commands/voice/checkLockFile.ts
|
|
29141
|
-
import { execSync as
|
|
29176
|
+
import { execSync as execSync58 } from "child_process";
|
|
29142
29177
|
import { existsSync as existsSync60, mkdirSync as mkdirSync26, readFileSync as readFileSync49, writeFileSync as writeFileSync42 } from "fs";
|
|
29143
29178
|
import { join as join75 } from "path";
|
|
29144
29179
|
function isProcessAlive2(pid) {
|
|
@@ -29167,7 +29202,7 @@ function bootstrapVenv() {
|
|
|
29167
29202
|
if (existsSync60(getVenvPython())) return;
|
|
29168
29203
|
console.log("Setting up Python environment...");
|
|
29169
29204
|
const pythonDir = getPythonDir();
|
|
29170
|
-
|
|
29205
|
+
execSync58(
|
|
29171
29206
|
`uv sync --project "${pythonDir}" --extra runtime --no-install-project`,
|
|
29172
29207
|
{
|
|
29173
29208
|
stdio: "inherit",
|
|
@@ -29194,7 +29229,7 @@ function setup() {
|
|
|
29194
29229
|
bootstrapVenv();
|
|
29195
29230
|
console.log("\nDownloading models...\n");
|
|
29196
29231
|
const script = join76(getPythonDir(), "setup_models.py");
|
|
29197
|
-
const result =
|
|
29232
|
+
const result = spawnSync8(getVenvPython(), [script], {
|
|
29198
29233
|
stdio: "inherit",
|
|
29199
29234
|
env: { ...process.env, VOICE_LOG_FILE: voicePaths.log }
|
|
29200
29235
|
});
|
|
@@ -29750,11 +29785,11 @@ function runCommandToCompletion(command, args, env, cwd, quiet) {
|
|
|
29750
29785
|
}
|
|
29751
29786
|
|
|
29752
29787
|
// src/commands/run/runPreCommands.ts
|
|
29753
|
-
import { execSync as
|
|
29788
|
+
import { execSync as execSync59 } from "child_process";
|
|
29754
29789
|
function runPreCommands(pre, cwd) {
|
|
29755
29790
|
for (const cmd of pre) {
|
|
29756
29791
|
try {
|
|
29757
|
-
|
|
29792
|
+
execSync59(cmd, { stdio: "inherit", cwd });
|
|
29758
29793
|
} catch (error) {
|
|
29759
29794
|
const code = error && typeof error === "object" && "status" in error ? error.status : 1;
|
|
29760
29795
|
process.exit(code);
|
|
@@ -30446,7 +30481,7 @@ function registerRun(program2) {
|
|
|
30446
30481
|
}
|
|
30447
30482
|
|
|
30448
30483
|
// src/commands/screenshot/index.ts
|
|
30449
|
-
import { execSync as
|
|
30484
|
+
import { execSync as execSync60 } from "child_process";
|
|
30450
30485
|
import { existsSync as existsSync67, mkdirSync as mkdirSync30, unlinkSync as unlinkSync22, writeFileSync as writeFileSync45 } from "fs";
|
|
30451
30486
|
import { tmpdir as tmpdir8 } from "os";
|
|
30452
30487
|
import { join as join83, resolve as resolve19 } from "path";
|
|
@@ -30589,7 +30624,7 @@ function runPowerShellScript(processName, outputPath) {
|
|
|
30589
30624
|
const scriptPath = join83(tmpdir8(), `assist-screenshot-${Date.now()}.ps1`);
|
|
30590
30625
|
writeFileSync45(scriptPath, captureWindowPs1, "utf8");
|
|
30591
30626
|
try {
|
|
30592
|
-
|
|
30627
|
+
execSync60(
|
|
30593
30628
|
`powershell -NoProfile -ExecutionPolicy Bypass -File "${scriptPath}" -ProcessName "${processName}" -OutputPath "${outputPath}"`,
|
|
30594
30629
|
{ stdio: ["ignore", "pipe", "pipe"], encoding: "utf8" }
|
|
30595
30630
|
);
|
|
@@ -36085,7 +36120,7 @@ async function statusLine() {
|
|
|
36085
36120
|
}
|
|
36086
36121
|
|
|
36087
36122
|
// src/commands/update.ts
|
|
36088
|
-
import { execSync as
|
|
36123
|
+
import { execSync as execSync61 } from "child_process";
|
|
36089
36124
|
import * as path72 from "path";
|
|
36090
36125
|
|
|
36091
36126
|
// src/commands/restartDaemonAfterUpdate.ts
|
|
@@ -36109,7 +36144,7 @@ function isGlobalNpmInstall(dir) {
|
|
|
36109
36144
|
if (resolved.split(path72.sep).includes("node_modules")) {
|
|
36110
36145
|
return true;
|
|
36111
36146
|
}
|
|
36112
|
-
const globalPrefix =
|
|
36147
|
+
const globalPrefix = execSync61("npm prefix -g", { stdio: "pipe" }).toString().trim();
|
|
36113
36148
|
return resolved.toLowerCase().startsWith(path72.resolve(globalPrefix).toLowerCase());
|
|
36114
36149
|
} catch {
|
|
36115
36150
|
return false;
|
|
@@ -36120,18 +36155,18 @@ async function update2() {
|
|
|
36120
36155
|
console.log(`Assist is installed at: ${installDir}`);
|
|
36121
36156
|
if (isGitRepo(installDir)) {
|
|
36122
36157
|
console.log("Detected git repo installation, pulling latest...");
|
|
36123
|
-
|
|
36158
|
+
execSync61("git pull", { cwd: installDir, stdio: "inherit" });
|
|
36124
36159
|
console.log("Installing dependencies...");
|
|
36125
|
-
|
|
36160
|
+
execSync61("npm i", { cwd: installDir, stdio: "inherit" });
|
|
36126
36161
|
console.log("Building...");
|
|
36127
|
-
|
|
36162
|
+
execSync61("npm run build", { cwd: installDir, stdio: "inherit" });
|
|
36128
36163
|
console.log("Syncing commands...");
|
|
36129
|
-
|
|
36164
|
+
execSync61("assist sync", { stdio: "inherit" });
|
|
36130
36165
|
} else if (isGlobalNpmInstall(installDir)) {
|
|
36131
36166
|
console.log("Detected global npm installation, updating...");
|
|
36132
|
-
|
|
36167
|
+
execSync61("npm i -g @staff0rd/assist@latest", { stdio: "inherit" });
|
|
36133
36168
|
console.log("Syncing commands...");
|
|
36134
|
-
|
|
36169
|
+
execSync61("assist sync", { stdio: "inherit" });
|
|
36135
36170
|
} else {
|
|
36136
36171
|
console.error(
|
|
36137
36172
|
"Could not determine installation method. Expected a git repo or global npm install."
|