@staff0rd/assist 0.620.0 → 0.621.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.620.0",
9
+ version: "0.621.1",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -32220,6 +32220,21 @@ function registerSync(program2) {
32220
32220
  // src/commands/transcript/clean.ts
32221
32221
  import { existsSync as existsSync71 } from "fs";
32222
32222
 
32223
+ // src/commands/transcript/convert/formatTimestamp.ts
32224
+ function pad(value, width) {
32225
+ return String(value).padStart(width, "0");
32226
+ }
32227
+ function formatTimestamp2(ms) {
32228
+ const totalSeconds = Math.floor(ms / 1e3);
32229
+ const hours = Math.floor(totalSeconds / 3600);
32230
+ const minutes = Math.floor(totalSeconds % 3600 / 60);
32231
+ const seconds = totalSeconds % 60;
32232
+ return `${pad(hours, 2)}:${pad(minutes, 2)}:${pad(seconds, 2)}.${pad(ms % 1e3, 3)}`;
32233
+ }
32234
+ function formatClock(ms) {
32235
+ return formatTimestamp2(ms).slice(0, 8);
32236
+ }
32237
+
32223
32238
  // src/commands/transcript/cleanText.ts
32224
32239
  function cleanText(text18) {
32225
32240
  const words = text18.split(/\s+/);
@@ -32408,7 +32423,7 @@ function cuesToChatMessages(cues) {
32408
32423
  if (lastMessage && lastMessage.speaker === speaker) {
32409
32424
  lastMessage.text += ` ${cue.text}`;
32410
32425
  } else {
32411
- messages.push({ speaker, text: cue.text });
32426
+ messages.push({ speaker, text: cue.text, startMs: cue.startMs });
32412
32427
  }
32413
32428
  }
32414
32429
  return messages.map((msg) => ({
@@ -32416,30 +32431,20 @@ function cuesToChatMessages(cues) {
32416
32431
  text: cleanText(msg.text)
32417
32432
  }));
32418
32433
  }
32419
- function formatChatLog(messages) {
32420
- return messages.map((msg) => `${msg.speaker}: ${msg.text}`).join("\n\n");
32434
+ function formatChatLog(messages, options2 = {}) {
32435
+ return messages.map((msg) => {
32436
+ const prefix2 = options2.timestamps ? `[${formatClock(msg.startMs)}] ` : "";
32437
+ return `${prefix2}${msg.speaker}: ${msg.text}`;
32438
+ }).join("\n\n");
32421
32439
  }
32422
32440
 
32423
32441
  // src/commands/transcript/convert/formatVtt.ts
32424
- function pad(value, width) {
32425
- return String(value).padStart(width, "0");
32426
- }
32427
- function formatTimestamp2(ms) {
32428
- const totalSeconds = Math.floor(ms / 1e3);
32429
- const hours = Math.floor(totalSeconds / 3600);
32430
- const minutes = Math.floor(totalSeconds % 3600 / 60);
32431
- const seconds = totalSeconds % 60;
32432
- return `${pad(hours, 2)}:${pad(minutes, 2)}:${pad(seconds, 2)}.${pad(ms % 1e3, 3)}`;
32433
- }
32434
32442
  function formatCue(cue) {
32435
32443
  const timing = `${formatTimestamp2(cue.startMs)} --> ${formatTimestamp2(cue.endMs)}`;
32436
32444
  const text18 = cue.speaker ? `<v ${cue.speaker}>${cue.text}` : cue.text;
32437
32445
  return `${timing}
32438
32446
  ${text18}`;
32439
32447
  }
32440
- function formatClock(ms) {
32441
- return formatTimestamp2(ms).slice(0, 8);
32442
- }
32443
32448
  function formatNoteBlock(lines2) {
32444
32449
  return lines2.length ? [lines2.map((line) => `NOTE ${line}`).join("\n")] : [];
32445
32450
  }
@@ -32471,8 +32476,8 @@ var FORMATS = ["md", "vtt"];
32471
32476
  function isCleanFormat(value) {
32472
32477
  return FORMATS.includes(value);
32473
32478
  }
32474
- function serialise(cues, format) {
32475
- return format === "vtt" ? formatVtt(cues) : formatChatLog(cuesToChatMessages(cues));
32479
+ function serialise(cues, format, timestamps) {
32480
+ return format === "vtt" ? formatVtt(cues) : formatChatLog(cuesToChatMessages(cues), { timestamps });
32476
32481
  }
32477
32482
  function clean(file, options2 = {}) {
32478
32483
  const format = options2.format ?? "md";
@@ -32482,6 +32487,13 @@ function clean(file, options2 = {}) {
32482
32487
  );
32483
32488
  process.exit(1);
32484
32489
  }
32490
+ const timestamps = options2.timestamps ?? false;
32491
+ if (timestamps && format !== "md") {
32492
+ console.error(
32493
+ `Error: --timestamps applies only to --format md (got: ${format})`
32494
+ );
32495
+ process.exit(1);
32496
+ }
32485
32497
  if (!existsSync71(file)) {
32486
32498
  console.error(`Error: VTT file not found: ${file}`);
32487
32499
  process.exit(1);
@@ -32491,7 +32503,7 @@ function clean(file, options2 = {}) {
32491
32503
  console.error(`Error: no cues found in: ${file}`);
32492
32504
  process.exit(1);
32493
32505
  }
32494
- console.log(serialise(cues, format));
32506
+ console.log(serialise(cues, format, timestamps));
32495
32507
  }
32496
32508
 
32497
32509
  // src/commands/transcript/shared.ts
@@ -32778,13 +32790,37 @@ function move(file, options2) {
32778
32790
  console.log(`Summary target: ${summaryPath}`);
32779
32791
  }
32780
32792
 
32793
+ // src/commands/transcript/transcriptWorkflowHelp.ts
32794
+ function transcriptWorkflowHelp() {
32795
+ return [
32796
+ "",
32797
+ "Collapsing several conversations into one transcript \u2014 read, select, merge:",
32798
+ "",
32799
+ " 1. Read assist transcript clean ./a.vtt --format md --timestamps",
32800
+ " Each speaker turn is prefixed [hh:mm:ss], so the passages worth keeping",
32801
+ " can be cited as ranges. Repeat per source.",
32802
+ "",
32803
+ " 2. Select Write the ranges to keep, and a reason per dropped passage:",
32804
+ ' { "keep": [{ "file": "a.vtt", "from": "00:14:22", "to": "00:19:40" }],',
32805
+ ' "removed": ["private", "off-topic"] }',
32806
+ " from/to are matched against the source times printed in step 1.",
32807
+ "",
32808
+ " 3. Merge assist transcript merge ./a.vtt ./b.vtt --select ./selection.json --out ./merged.vtt",
32809
+ " Cue times are rebased onto one continuous timeline; the sources, the",
32810
+ " removal count and each passage's original start survive as NOTE blocks."
32811
+ ].join("\n");
32812
+ }
32813
+
32781
32814
  // src/commands/registerTranscript.ts
32782
32815
  function registerTranscript(program2) {
32783
- const transcriptCommand = program2.command("transcript").description("Meeting transcript utilities");
32816
+ const transcriptCommand = program2.command("transcript").description("Meeting transcript utilities").addHelpText("after", () => transcriptWorkflowHelp());
32784
32817
  configHelp(transcriptCommand, transcriptConfigHelp);
32785
32818
  transcriptCommand.command("configure").description("Configure transcript directories").action(configure);
32786
32819
  transcriptCommand.command("list").description("List raw .vtt filenames waiting in the pick-up directory").action(list4);
32787
- transcriptCommand.command("clean <path>").description("Clean any .vtt file and write the result to stdout").option("--format <md|vtt>", "output format", "md").action(clean);
32820
+ transcriptCommand.command("clean <path>").description("Clean any .vtt file and write the result to stdout").option("--format <md|vtt>", "output format", "md").option(
32821
+ "--timestamps",
32822
+ "prefix each speaker turn with its start time (--format md only)"
32823
+ ).action(clean);
32788
32824
  transcriptCommand.command("merge <path...>").description(
32789
32825
  "Collapse several .vtt files into one transcript with NOTE provenance"
32790
32826
  ).option("--out <path>", "write the merged transcript to this path").option(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staff0rd/assist",
3
- "version": "0.620.0",
3
+ "version": "0.621.1",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "bin": {