@plaud-ai/cli 0.3.4 → 0.3.5

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 +49 -12
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -20364,7 +20364,7 @@ function isNewer(current, latest) {
20364
20364
  return false;
20365
20365
  }
20366
20366
  var updateCommand = new Command("update").description("Check npm for the latest Plaud CLI and print the upgrade command").action(async () => {
20367
- const current = "0.3.4";
20367
+ const current = "0.3.5";
20368
20368
  const spinner = ora("Checking npm for latest version...").start();
20369
20369
  const latest = await fetchLatestVersion();
20370
20370
  spinner.stop();
@@ -20419,10 +20419,10 @@ async function checkForUpdate(current) {
20419
20419
  return isNewer(current, latest) ? latest : null;
20420
20420
  }
20421
20421
  var versionCommand = new Command2("version").description("Show CLI version information").action(async () => {
20422
- const current = "0.3.4";
20422
+ const current = "0.3.5";
20423
20423
  console.log(`plaud ${current}`);
20424
- if ("f7c7d70") console.log(`commit ${"f7c7d70"}`);
20425
- if ("2026-06-29T07:35:15.095Z") console.log(`built ${"2026-06-29T07:35:15.095Z"}`);
20424
+ if ("3c993f6") console.log(`commit ${"3c993f6"}`);
20425
+ if ("2026-07-29T10:32:49.064Z") console.log(`built ${"2026-07-29T10:32:49.064Z"}`);
20426
20426
  if (current === "unknown") return;
20427
20427
  const newer = await checkForUpdate(current);
20428
20428
  if (newer) {
@@ -20870,6 +20870,23 @@ function runOAuthCallback(opts) {
20870
20870
  });
20871
20871
  }
20872
20872
 
20873
+ // ../shared/dist/source-block.js
20874
+ async function loadBlockContent(block) {
20875
+ if (!block)
20876
+ return "";
20877
+ const inline = block.data_content;
20878
+ if (typeof inline === "string" && inline.length > 0)
20879
+ return inline;
20880
+ const link = block.data_link;
20881
+ if (typeof link === "string" && link.length > 0) {
20882
+ const res = await fetch(link);
20883
+ if (!res.ok)
20884
+ throw new Error(`Failed to fetch block content from data_link (HTTP ${res.status})`);
20885
+ return await res.text();
20886
+ }
20887
+ return "";
20888
+ }
20889
+
20873
20890
  // src/config.ts
20874
20891
  import { readFileSync, existsSync } from "fs";
20875
20892
  import { homedir as homedir4 } from "os";
@@ -21268,23 +21285,43 @@ import { Command as Command9 } from "commander";
21268
21285
  import chalk10 from "chalk";
21269
21286
  import ora7 from "ora";
21270
21287
  import { writeFile as writeFile4 } from "fs/promises";
21271
- var transcriptCommand = new Command9("transcript").description("Get the transcript for a Plaud recording").argument("<file_id>", "The file ID to retrieve transcript for").option("-o, --output <file>", "Save transcript to a file").action(async (fileId, opts) => {
21288
+ var BLOCKS = ["transaction", "transaction_polish", "outline"];
21289
+ var transcriptCommand = new Command9("transcript").description("Get the transcript for a Plaud recording").argument("<file_id>", "The file ID to retrieve transcript for").option("-o, --output <file>", "Save transcript to a file").option(
21290
+ "--block <block>",
21291
+ `Which block to fetch: ${BLOCKS.join(" | ")} (default: transaction)`
21292
+ ).option("--polished", "Shortcut for --block transaction_polish (AI-cleaned transcript)").action(async (fileId, opts) => {
21293
+ const block = opts.polished ? "transaction_polish" : opts.block ?? "transaction";
21294
+ if (!BLOCKS.includes(block)) {
21295
+ printError("BAD_ARGS", `Unknown --block "${block}". Choose one of: ${BLOCKS.join(", ")}.`);
21296
+ await telemetryExit(ExitCode.ERROR);
21297
+ }
21272
21298
  const client2 = getClient2();
21273
21299
  const spinner = ora7("Fetching transcript...").start();
21274
21300
  try {
21275
21301
  const file = await client2.getFile(fileId);
21276
- spinner.stop();
21277
21302
  const sourceList = file.source_list ?? [];
21278
- const source = sourceList.find((s) => s.data_type === "transaction");
21303
+ const source = sourceList.find((s) => s.data_type === block);
21279
21304
  if (!source) {
21280
- console.log(chalk10.yellow("Transcript not available for this recording."));
21305
+ spinner.stop();
21306
+ const available = sourceList.map((s) => s.data_type).filter(Boolean).join(", ") || "(none)";
21307
+ console.log(chalk10.yellow(`No "${block}" transcript for this recording. Available: ${available}.`));
21308
+ return;
21309
+ }
21310
+ const content = await loadBlockContent(source);
21311
+ spinner.stop();
21312
+ if (!content) {
21313
+ console.log(
21314
+ chalk10.yellow(
21315
+ block === "transaction_polish" ? "The cleaned-up (polished) transcript hasn't been generated for this recording yet." : `The "${block}" transcript is not available for this recording.`
21316
+ )
21317
+ );
21281
21318
  return;
21282
21319
  }
21283
- const segments = JSON.parse(source.data_content);
21320
+ const segments = JSON.parse(content);
21284
21321
  const lines = segments.map((seg) => {
21285
21322
  const time = `[${formatTime(seg.start_time)} - ${formatTime(seg.end_time)}]`;
21286
21323
  const speaker = seg.speaker ? `${seg.speaker}: ` : "";
21287
- return `${time} ${speaker}${seg.content}`;
21324
+ return `${time} ${speaker}${seg.content ?? seg.topic ?? ""}`;
21288
21325
  });
21289
21326
  const output = lines.join("\n");
21290
21327
  if (opts.output) {
@@ -21659,7 +21696,7 @@ async function runWizard() {
21659
21696
  try {
21660
21697
  await initTelemetry({
21661
21698
  surface: "cli",
21662
- appVersion: "0.3.4"
21699
+ appVersion: "0.3.5"
21663
21700
  });
21664
21701
  } catch {
21665
21702
  }
@@ -21668,7 +21705,7 @@ async function notifyUpdate() {
21668
21705
  if (sub === "version" || sub === "update") return;
21669
21706
  if (process.env.PLAUD_NO_UPDATE_NOTIFIER) return;
21670
21707
  if (!process.stderr.isTTY) return;
21671
- const current = "0.3.4";
21708
+ const current = "0.3.5";
21672
21709
  if (current === "0.0.0") return;
21673
21710
  try {
21674
21711
  const newer = await checkForUpdate(current);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plaud-ai/cli",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "plaud": "dist/index.js"