@staff0rd/assist 0.102.1 → 0.104.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 +28 -16
- 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.104.0",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -2720,6 +2720,7 @@ import { parse } from "shell-quote";
|
|
|
2720
2720
|
var SEPARATOR_OPS = /* @__PURE__ */ new Set(["|", "&&", "||", ";"]);
|
|
2721
2721
|
var UNSAFE_OPS = /* @__PURE__ */ new Set(["(", ")", ">", ">>", "<", "<&", "|&", ">&"]);
|
|
2722
2722
|
var FD_REDIRECT_RE = /\d+>&\d+/g;
|
|
2723
|
+
var FD_DEVNULL_RE = /\d*>\/dev\/null/g;
|
|
2723
2724
|
function splitCompound(command) {
|
|
2724
2725
|
const tokens = tokenizeCommand(command);
|
|
2725
2726
|
if (!tokens) return void 0;
|
|
@@ -2729,7 +2730,7 @@ function splitCompound(command) {
|
|
|
2729
2730
|
return result.length > 0 ? result : void 0;
|
|
2730
2731
|
}
|
|
2731
2732
|
function tokenizeCommand(command) {
|
|
2732
|
-
const trimmed = command.trim().replace(FD_REDIRECT_RE, "");
|
|
2733
|
+
const trimmed = command.trim().replace(FD_DEVNULL_RE, "").replace(FD_REDIRECT_RE, "");
|
|
2733
2734
|
if (!trimmed) return void 0;
|
|
2734
2735
|
try {
|
|
2735
2736
|
const tokens = parse(trimmed);
|
|
@@ -4606,7 +4607,7 @@ function fetchLineComments(org, repo, prNumber, threadInfo) {
|
|
|
4606
4607
|
);
|
|
4607
4608
|
}
|
|
4608
4609
|
|
|
4609
|
-
// src/commands/prs/listComments/
|
|
4610
|
+
// src/commands/prs/listComments/printComments.ts
|
|
4610
4611
|
import chalk47 from "chalk";
|
|
4611
4612
|
function formatForHuman(comment2) {
|
|
4612
4613
|
if (comment2.type === "review") {
|
|
@@ -4625,23 +4626,32 @@ function formatForHuman(comment2) {
|
|
|
4625
4626
|
""
|
|
4626
4627
|
].join("\n");
|
|
4627
4628
|
}
|
|
4628
|
-
|
|
4629
|
-
|
|
4630
|
-
|
|
4631
|
-
|
|
4629
|
+
function summarise(comments) {
|
|
4630
|
+
const lineCount = comments.filter((c) => c.type === "line").length;
|
|
4631
|
+
const reviewCount = comments.filter((c) => c.type === "review").length;
|
|
4632
|
+
const parts = [];
|
|
4633
|
+
if (lineCount > 0) parts.push(`${lineCount} line`);
|
|
4634
|
+
if (reviewCount > 0) parts.push(`${reviewCount} review`);
|
|
4635
|
+
return `Found ${parts.join(" and ")} comment${comments.length === 1 ? "" : "s"}.`;
|
|
4632
4636
|
}
|
|
4633
|
-
function printComments(
|
|
4637
|
+
function printComments(result) {
|
|
4638
|
+
const { comments, cachePath } = result;
|
|
4634
4639
|
if (comments.length === 0) {
|
|
4635
4640
|
console.log("No comments found.");
|
|
4636
4641
|
return;
|
|
4637
4642
|
}
|
|
4638
|
-
|
|
4639
|
-
|
|
4643
|
+
if (!isClaudeCode()) {
|
|
4644
|
+
for (const comment2 of comments) {
|
|
4645
|
+
console.log(formatForHuman(comment2));
|
|
4646
|
+
}
|
|
4640
4647
|
}
|
|
4641
|
-
|
|
4642
|
-
|
|
4648
|
+
console.log(summarise(comments));
|
|
4649
|
+
if (cachePath) {
|
|
4650
|
+
console.log(`Saved to ${cachePath}`);
|
|
4643
4651
|
}
|
|
4644
4652
|
}
|
|
4653
|
+
|
|
4654
|
+
// src/commands/prs/listComments/index.ts
|
|
4645
4655
|
function writeCommentsCache(prNumber, comments) {
|
|
4646
4656
|
const assistDir = join18(process.cwd(), ".assist");
|
|
4647
4657
|
if (!existsSync23(assistDir)) {
|
|
@@ -4684,10 +4694,12 @@ async function listComments() {
|
|
|
4684
4694
|
...fetchLineComments(org, repo, prNumber, threadInfo)
|
|
4685
4695
|
];
|
|
4686
4696
|
updateCache(prNumber, allComments);
|
|
4687
|
-
|
|
4697
|
+
const hasLineComments = allComments.some((c) => c.type === "line");
|
|
4698
|
+
const cachePath = hasLineComments ? join18(process.cwd(), ".assist", `pr-${prNumber}-comments.yaml`) : null;
|
|
4699
|
+
return { comments: allComments, cachePath };
|
|
4688
4700
|
} catch (error) {
|
|
4689
4701
|
const handled = handleKnownErrors(error);
|
|
4690
|
-
if (handled !== null) return handled;
|
|
4702
|
+
if (handled !== null) return { comments: handled, cachePath: null };
|
|
4691
4703
|
throw error;
|
|
4692
4704
|
}
|
|
4693
4705
|
}
|
|
@@ -6213,7 +6225,7 @@ function buildSummaryIndex(summaryDir) {
|
|
|
6213
6225
|
)
|
|
6214
6226
|
);
|
|
6215
6227
|
}
|
|
6216
|
-
function
|
|
6228
|
+
function summarise2() {
|
|
6217
6229
|
processStagedFile();
|
|
6218
6230
|
const { transcriptsDir, summaryDir } = getTranscriptConfig();
|
|
6219
6231
|
if (!existsSync28(transcriptsDir)) {
|
|
@@ -6259,7 +6271,7 @@ function registerTranscript(program2) {
|
|
|
6259
6271
|
const transcriptCommand = program2.command("transcript").description("Meeting transcript utilities");
|
|
6260
6272
|
transcriptCommand.command("configure").description("Configure transcript directories").action(configure);
|
|
6261
6273
|
transcriptCommand.command("format").description("Convert VTT files to formatted markdown transcripts").action(format);
|
|
6262
|
-
transcriptCommand.command("summarise").description("List transcripts that do not have summaries").action(
|
|
6274
|
+
transcriptCommand.command("summarise").description("List transcripts that do not have summaries").action(summarise2);
|
|
6263
6275
|
}
|
|
6264
6276
|
|
|
6265
6277
|
// src/commands/registerVerify.ts
|