@staff0rd/assist 0.47.1 → 0.48.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/index.js +34 -20
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// src/index.ts
|
|
4
|
-
import { execSync as
|
|
4
|
+
import { execSync as execSync20 } from "child_process";
|
|
5
5
|
import { Command } from "commander";
|
|
6
6
|
|
|
7
7
|
// package.json
|
|
8
8
|
var package_default = {
|
|
9
9
|
name: "@staff0rd/assist",
|
|
10
|
-
version: "0.
|
|
10
|
+
version: "0.48.0",
|
|
11
11
|
type: "module",
|
|
12
12
|
main: "dist/index.js",
|
|
13
13
|
bin: {
|
|
@@ -2387,6 +2387,9 @@ function registerDevlog(program2) {
|
|
|
2387
2387
|
devlogCommand.command("skip <date>").description("Add a date (YYYY-MM-DD) to the skip list").action(skip);
|
|
2388
2388
|
}
|
|
2389
2389
|
|
|
2390
|
+
// src/commands/prs/fixed.ts
|
|
2391
|
+
import { execSync as execSync13 } from "child_process";
|
|
2392
|
+
|
|
2390
2393
|
// src/commands/prs/resolveCommentWithReply.ts
|
|
2391
2394
|
import { execSync as execSync12 } from "child_process";
|
|
2392
2395
|
import { unlinkSync as unlinkSync3, writeFileSync as writeFileSync9 } from "fs";
|
|
@@ -2514,11 +2517,22 @@ function resolveCommentWithReply(commentId, message) {
|
|
|
2514
2517
|
}
|
|
2515
2518
|
|
|
2516
2519
|
// src/commands/prs/fixed.ts
|
|
2520
|
+
function verifySha(sha) {
|
|
2521
|
+
try {
|
|
2522
|
+
return execSync13(`git rev-parse --verify ${sha}`, {
|
|
2523
|
+
encoding: "utf-8"
|
|
2524
|
+
}).trim();
|
|
2525
|
+
} catch {
|
|
2526
|
+
console.error(`Error: '${sha}' is not a valid commit in this repository.`);
|
|
2527
|
+
process.exit(1);
|
|
2528
|
+
}
|
|
2529
|
+
}
|
|
2517
2530
|
function fixed(commentId, sha) {
|
|
2518
2531
|
try {
|
|
2532
|
+
const fullSha = verifySha(sha);
|
|
2519
2533
|
const { org, repo } = getRepoInfo();
|
|
2520
2534
|
const repoUrl = `https://github.com/${org}/${repo}`;
|
|
2521
|
-
const message = `Fixed in [${
|
|
2535
|
+
const message = `Fixed in [${fullSha}](${repoUrl}/commit/${fullSha})`;
|
|
2522
2536
|
resolveCommentWithReply(commentId, message);
|
|
2523
2537
|
} catch (error) {
|
|
2524
2538
|
if (isGhNotInstalled(error)) {
|
|
@@ -2541,7 +2555,7 @@ function isClaudeCode() {
|
|
|
2541
2555
|
}
|
|
2542
2556
|
|
|
2543
2557
|
// src/commands/prs/fetchThreadIds.ts
|
|
2544
|
-
import { execSync as
|
|
2558
|
+
import { execSync as execSync14 } from "child_process";
|
|
2545
2559
|
import { unlinkSync as unlinkSync4, writeFileSync as writeFileSync10 } from "fs";
|
|
2546
2560
|
import { tmpdir as tmpdir2 } from "os";
|
|
2547
2561
|
import { join as join11 } from "path";
|
|
@@ -2550,7 +2564,7 @@ function fetchThreadIds(org, repo, prNumber) {
|
|
|
2550
2564
|
const queryFile = join11(tmpdir2(), `gh-query-${Date.now()}.graphql`);
|
|
2551
2565
|
writeFileSync10(queryFile, THREAD_QUERY);
|
|
2552
2566
|
try {
|
|
2553
|
-
const result =
|
|
2567
|
+
const result = execSync14(
|
|
2554
2568
|
`gh api graphql -F query=@${queryFile} -F owner="${org}" -F repo="${repo}" -F prNumber=${prNumber}`,
|
|
2555
2569
|
{ encoding: "utf-8" }
|
|
2556
2570
|
);
|
|
@@ -2572,9 +2586,9 @@ function fetchThreadIds(org, repo, prNumber) {
|
|
|
2572
2586
|
}
|
|
2573
2587
|
|
|
2574
2588
|
// src/commands/prs/listComments/fetchReviewComments.ts
|
|
2575
|
-
import { execSync as
|
|
2589
|
+
import { execSync as execSync15 } from "child_process";
|
|
2576
2590
|
function fetchJson(endpoint) {
|
|
2577
|
-
const result =
|
|
2591
|
+
const result = execSync15(`gh api ${endpoint}`, { encoding: "utf-8" });
|
|
2578
2592
|
if (!result.trim()) return [];
|
|
2579
2593
|
return JSON.parse(result);
|
|
2580
2594
|
}
|
|
@@ -2700,7 +2714,7 @@ async function listComments() {
|
|
|
2700
2714
|
}
|
|
2701
2715
|
|
|
2702
2716
|
// src/commands/prs/prs/index.ts
|
|
2703
|
-
import { execSync as
|
|
2717
|
+
import { execSync as execSync16 } from "child_process";
|
|
2704
2718
|
|
|
2705
2719
|
// src/commands/prs/prs/displayPaginated/index.ts
|
|
2706
2720
|
import enquirer4 from "enquirer";
|
|
@@ -2806,7 +2820,7 @@ async function displayPaginated(pullRequests) {
|
|
|
2806
2820
|
async function prs(options) {
|
|
2807
2821
|
const state = options.open ? "open" : options.closed ? "closed" : "all";
|
|
2808
2822
|
try {
|
|
2809
|
-
const result =
|
|
2823
|
+
const result = execSync16(
|
|
2810
2824
|
`gh pr list --state ${state} --json number,title,url,author,createdAt,mergedAt,closedAt,state,changedFiles --limit 100`,
|
|
2811
2825
|
{ encoding: "utf-8" }
|
|
2812
2826
|
);
|
|
@@ -2829,7 +2843,7 @@ async function prs(options) {
|
|
|
2829
2843
|
}
|
|
2830
2844
|
|
|
2831
2845
|
// src/commands/prs/wontfix.ts
|
|
2832
|
-
import { execSync as
|
|
2846
|
+
import { execSync as execSync17 } from "child_process";
|
|
2833
2847
|
function validateReason(reason) {
|
|
2834
2848
|
const lowerReason = reason.toLowerCase();
|
|
2835
2849
|
if (lowerReason.includes("claude") || lowerReason.includes("opus")) {
|
|
@@ -2846,7 +2860,7 @@ function validateShaReferences(reason) {
|
|
|
2846
2860
|
const invalidShas = [];
|
|
2847
2861
|
for (const sha of shas) {
|
|
2848
2862
|
try {
|
|
2849
|
-
|
|
2863
|
+
execSync17(`git cat-file -t ${sha}`, { stdio: "pipe" });
|
|
2850
2864
|
} catch {
|
|
2851
2865
|
invalidShas.push(sha);
|
|
2852
2866
|
}
|
|
@@ -2947,7 +2961,7 @@ Refactor check failed:
|
|
|
2947
2961
|
}
|
|
2948
2962
|
|
|
2949
2963
|
// src/commands/refactor/check/getViolations/index.ts
|
|
2950
|
-
import { execSync as
|
|
2964
|
+
import { execSync as execSync18 } from "child_process";
|
|
2951
2965
|
import fs15 from "fs";
|
|
2952
2966
|
import { minimatch as minimatch2 } from "minimatch";
|
|
2953
2967
|
|
|
@@ -2997,7 +3011,7 @@ function getGitFiles(options) {
|
|
|
2997
3011
|
}
|
|
2998
3012
|
const files = /* @__PURE__ */ new Set();
|
|
2999
3013
|
if (options.staged || options.modified) {
|
|
3000
|
-
const staged =
|
|
3014
|
+
const staged = execSync18("git diff --cached --name-only", {
|
|
3001
3015
|
encoding: "utf-8"
|
|
3002
3016
|
});
|
|
3003
3017
|
for (const file of staged.trim().split("\n").filter(Boolean)) {
|
|
@@ -3005,7 +3019,7 @@ function getGitFiles(options) {
|
|
|
3005
3019
|
}
|
|
3006
3020
|
}
|
|
3007
3021
|
if (options.unstaged || options.modified) {
|
|
3008
|
-
const unstaged =
|
|
3022
|
+
const unstaged = execSync18("git diff --name-only", { encoding: "utf-8" });
|
|
3009
3023
|
for (const file of unstaged.trim().split("\n").filter(Boolean)) {
|
|
3010
3024
|
files.add(file);
|
|
3011
3025
|
}
|
|
@@ -3832,7 +3846,7 @@ function cleanText(text) {
|
|
|
3832
3846
|
return cleaned.join(" ").replace(/\s+/g, " ").trim();
|
|
3833
3847
|
}
|
|
3834
3848
|
|
|
3835
|
-
// src/commands/transcript/format/parseVtt/deduplicateCues/removeSubstringDuplicates.ts
|
|
3849
|
+
// src/commands/transcript/format/processVttFile/parseVtt/deduplicateCues/removeSubstringDuplicates.ts
|
|
3836
3850
|
function normalizeText(text) {
|
|
3837
3851
|
return text.toLowerCase().trim();
|
|
3838
3852
|
}
|
|
@@ -3875,7 +3889,7 @@ function removeSubstringDuplicates(cues) {
|
|
|
3875
3889
|
return cues.filter((_, i) => !toRemove.has(i));
|
|
3876
3890
|
}
|
|
3877
3891
|
|
|
3878
|
-
// src/commands/transcript/format/parseVtt/deduplicateCues/index.ts
|
|
3892
|
+
// src/commands/transcript/format/processVttFile/parseVtt/deduplicateCues/index.ts
|
|
3879
3893
|
function findWordOverlap(currentWords, nextWords) {
|
|
3880
3894
|
for (let j = Math.min(5, currentWords.length); j >= 1; j--) {
|
|
3881
3895
|
const suffix = currentWords.slice(-j).join(" ");
|
|
@@ -3923,7 +3937,7 @@ function deduplicateCues(cues) {
|
|
|
3923
3937
|
}));
|
|
3924
3938
|
}
|
|
3925
3939
|
|
|
3926
|
-
// src/commands/transcript/format/parseVtt/index.ts
|
|
3940
|
+
// src/commands/transcript/format/processVttFile/parseVtt/index.ts
|
|
3927
3941
|
function parseHMS(h, m, s) {
|
|
3928
3942
|
return Number.parseInt(h, 10) * 3600 + Number.parseInt(m, 10) * 60 + Number.parseFloat(s);
|
|
3929
3943
|
}
|
|
@@ -4267,11 +4281,11 @@ function registerTranscript(program2) {
|
|
|
4267
4281
|
}
|
|
4268
4282
|
|
|
4269
4283
|
// src/commands/verify/hardcodedColors.ts
|
|
4270
|
-
import { execSync as
|
|
4284
|
+
import { execSync as execSync19 } from "child_process";
|
|
4271
4285
|
var pattern = "0x[0-9a-fA-F]{6}|#[0-9a-fA-F]{3,6}";
|
|
4272
4286
|
function hardcodedColors() {
|
|
4273
4287
|
try {
|
|
4274
|
-
const output =
|
|
4288
|
+
const output = execSync19(`grep -rEnH '${pattern}' src/`, {
|
|
4275
4289
|
encoding: "utf-8"
|
|
4276
4290
|
});
|
|
4277
4291
|
const lines = output.trim().split("\n");
|
|
@@ -4651,7 +4665,7 @@ program.command("init").description("Initialize VS Code and verify configuration
|
|
|
4651
4665
|
program.command("commit <message>").description("Create a git commit with validation").action(commit);
|
|
4652
4666
|
program.command("update").description("Update claude-code to the latest version").action(() => {
|
|
4653
4667
|
console.log("Updating claude-code...");
|
|
4654
|
-
|
|
4668
|
+
execSync20("npm install -g @anthropic-ai/claude-code", { stdio: "inherit" });
|
|
4655
4669
|
});
|
|
4656
4670
|
var configCommand = program.command("config").description("View and modify assist.yml configuration");
|
|
4657
4671
|
configCommand.command("set <key> <value>").description("Set a config value (e.g. commit.push true)").action(configSet);
|