@staff0rd/assist 0.102.1 → 0.103.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.
Files changed (2) hide show
  1. package/dist/index.js +26 -15
  2. 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.102.1",
9
+ version: "0.103.0",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -4606,7 +4606,7 @@ function fetchLineComments(org, repo, prNumber, threadInfo) {
4606
4606
  );
4607
4607
  }
4608
4608
 
4609
- // src/commands/prs/listComments/formatForHuman.ts
4609
+ // src/commands/prs/listComments/printComments.ts
4610
4610
  import chalk47 from "chalk";
4611
4611
  function formatForHuman(comment2) {
4612
4612
  if (comment2.type === "review") {
@@ -4625,23 +4625,32 @@ function formatForHuman(comment2) {
4625
4625
  ""
4626
4626
  ].join("\n");
4627
4627
  }
4628
-
4629
- // src/commands/prs/listComments/index.ts
4630
- function formatComment(comment2) {
4631
- return isClaudeCode() ? JSON.stringify(comment2) : formatForHuman(comment2);
4628
+ function summarise(comments) {
4629
+ const lineCount = comments.filter((c) => c.type === "line").length;
4630
+ const reviewCount = comments.filter((c) => c.type === "review").length;
4631
+ const parts = [];
4632
+ if (lineCount > 0) parts.push(`${lineCount} line`);
4633
+ if (reviewCount > 0) parts.push(`${reviewCount} review`);
4634
+ return `Found ${parts.join(" and ")} comment${comments.length === 1 ? "" : "s"}.`;
4632
4635
  }
4633
- function printComments(comments) {
4636
+ function printComments(result) {
4637
+ const { comments, cachePath } = result;
4634
4638
  if (comments.length === 0) {
4635
4639
  console.log("No comments found.");
4636
4640
  return;
4637
4641
  }
4638
- for (const comment2 of comments) {
4639
- console.log(formatComment(comment2));
4642
+ if (!isClaudeCode()) {
4643
+ for (const comment2 of comments) {
4644
+ console.log(formatForHuman(comment2));
4645
+ }
4640
4646
  }
4641
- if (!comments.some((c) => c.type === "line")) {
4642
- console.log("No line comments to process.");
4647
+ console.log(summarise(comments));
4648
+ if (cachePath) {
4649
+ console.log(`Saved to ${cachePath}`);
4643
4650
  }
4644
4651
  }
4652
+
4653
+ // src/commands/prs/listComments/index.ts
4645
4654
  function writeCommentsCache(prNumber, comments) {
4646
4655
  const assistDir = join18(process.cwd(), ".assist");
4647
4656
  if (!existsSync23(assistDir)) {
@@ -4684,10 +4693,12 @@ async function listComments() {
4684
4693
  ...fetchLineComments(org, repo, prNumber, threadInfo)
4685
4694
  ];
4686
4695
  updateCache(prNumber, allComments);
4687
- return allComments;
4696
+ const hasLineComments = allComments.some((c) => c.type === "line");
4697
+ const cachePath = hasLineComments ? join18(process.cwd(), ".assist", `pr-${prNumber}-comments.yaml`) : null;
4698
+ return { comments: allComments, cachePath };
4688
4699
  } catch (error) {
4689
4700
  const handled = handleKnownErrors(error);
4690
- if (handled !== null) return handled;
4701
+ if (handled !== null) return { comments: handled, cachePath: null };
4691
4702
  throw error;
4692
4703
  }
4693
4704
  }
@@ -6213,7 +6224,7 @@ function buildSummaryIndex(summaryDir) {
6213
6224
  )
6214
6225
  );
6215
6226
  }
6216
- function summarise() {
6227
+ function summarise2() {
6217
6228
  processStagedFile();
6218
6229
  const { transcriptsDir, summaryDir } = getTranscriptConfig();
6219
6230
  if (!existsSync28(transcriptsDir)) {
@@ -6259,7 +6270,7 @@ function registerTranscript(program2) {
6259
6270
  const transcriptCommand = program2.command("transcript").description("Meeting transcript utilities");
6260
6271
  transcriptCommand.command("configure").description("Configure transcript directories").action(configure);
6261
6272
  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(summarise);
6273
+ transcriptCommand.command("summarise").description("List transcripts that do not have summaries").action(summarise2);
6263
6274
  }
6264
6275
 
6265
6276
  // src/commands/registerVerify.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staff0rd/assist",
3
- "version": "0.102.1",
3
+ "version": "0.103.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "bin": {