@plaud-ai/cli 0.3.7 → 0.3.8

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 +62 -23
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -20379,7 +20379,7 @@ function isNewer(current, latest) {
20379
20379
  return false;
20380
20380
  }
20381
20381
  var updateCommand = new Command("update").description("Check npm for the latest Plaud CLI and print the upgrade command").action(async () => {
20382
- const current = "0.3.7";
20382
+ const current = "0.3.8";
20383
20383
  const spinner = ora("Checking npm for latest version...").start();
20384
20384
  const latest = await fetchLatestVersion();
20385
20385
  spinner.stop();
@@ -20434,10 +20434,10 @@ async function checkForUpdate(current) {
20434
20434
  return isNewer(current, latest) ? latest : null;
20435
20435
  }
20436
20436
  var versionCommand = new Command2("version").description("Show CLI version information").action(async () => {
20437
- const current = "0.3.7";
20437
+ const current = "0.3.8";
20438
20438
  console.log(`plaud ${current}`);
20439
- if ("bacaae9") console.log(`commit ${"bacaae9"}`);
20440
- if ("2026-08-05T03:31:25.414Z") console.log(`built ${"2026-08-05T03:31:25.414Z"}`);
20439
+ if ("be0dfaa") console.log(`commit ${"be0dfaa"}`);
20440
+ if ("2026-08-10T08:40:12.325Z") console.log(`built ${"2026-08-10T08:40:12.325Z"}`);
20441
20441
  if (current === "unknown") return;
20442
20442
  const newer = await checkForUpdate(current);
20443
20443
  if (newer) {
@@ -20902,6 +20902,49 @@ async function loadBlockContent(block) {
20902
20902
  return "";
20903
20903
  }
20904
20904
 
20905
+ // ../shared/dist/time.js
20906
+ var HAS_TIMEZONE = /(?:[Zz]|[+-]\d{2}(?::?\d{2})?)$/;
20907
+ var HAS_TIME = /\d{2}:\d{2}/;
20908
+ var DATE_ONLY = /^(\d{4})-(\d{2})-(\d{2})$/;
20909
+ function parseApiTimestamp(value) {
20910
+ if (!value)
20911
+ return null;
20912
+ const trimmed = value.trim();
20913
+ if (!trimmed)
20914
+ return null;
20915
+ const normalised = HAS_TIME.test(trimmed) && !HAS_TIMEZONE.test(trimmed) ? `${trimmed}Z` : trimmed;
20916
+ const ms = new Date(normalised).getTime();
20917
+ return Number.isNaN(ms) ? null : ms;
20918
+ }
20919
+ function localDayStart(value) {
20920
+ const parts = parseDateOnly(value);
20921
+ if (!parts)
20922
+ return null;
20923
+ const [y, m, d] = parts;
20924
+ return new Date(y, m - 1, d, 0, 0, 0, 0).getTime();
20925
+ }
20926
+ function localDayEnd(value) {
20927
+ const parts = parseDateOnly(value);
20928
+ if (!parts)
20929
+ return null;
20930
+ const [y, m, d] = parts;
20931
+ return new Date(y, m - 1, d + 1, 0, 0, 0, 0).getTime() - 1;
20932
+ }
20933
+ function parseDateOnly(value) {
20934
+ if (!value)
20935
+ return null;
20936
+ const match = DATE_ONLY.exec(value.trim());
20937
+ if (!match)
20938
+ return null;
20939
+ const y = Number(match[1]);
20940
+ const m = Number(match[2]);
20941
+ const d = Number(match[3]);
20942
+ const probe = new Date(y, m - 1, d);
20943
+ if (probe.getFullYear() !== y || probe.getMonth() !== m - 1 || probe.getDate() !== d)
20944
+ return null;
20945
+ return [y, m, d];
20946
+ }
20947
+
20905
20948
  // src/config.ts
20906
20949
  import { readFileSync, existsSync } from "fs";
20907
20950
  import { homedir as homedir4 } from "os";
@@ -21138,8 +21181,9 @@ function formatDuration(ms) {
21138
21181
  }
21139
21182
  function formatDate(iso) {
21140
21183
  if (!iso) return "-";
21141
- const d = new Date(iso);
21142
- if (Number.isNaN(d.getTime())) return iso;
21184
+ const ms = parseApiTimestamp(iso);
21185
+ if (ms === null) return iso;
21186
+ const d = new Date(ms);
21143
21187
  const y = d.getFullYear();
21144
21188
  const m = String(d.getMonth() + 1).padStart(2, "0");
21145
21189
  const day = String(d.getDate()).padStart(2, "0");
@@ -21231,7 +21275,8 @@ var getFileCommand = new Command7("file").description("Get details of a specific
21231
21275
  console.log(` ${chalk8.cyan("start_at")}: ${file.start_at ?? "-"}`);
21232
21276
  console.log(` ${chalk8.cyan("duration")}: ${formatDuration(file.duration)}`);
21233
21277
  console.log(` ${chalk8.cyan("serial_number")}: ${file.serial_number ?? "-"}`);
21234
- console.log(` ${chalk8.cyan("audio")}: ${file.presigned_url ? chalk8.green("available") : chalk8.gray("unavailable")}`);
21278
+ const audioState = file.presigned_url ? chalk8.green("available") : chalk8.gray("unknown (run `plaud audio` to check)");
21279
+ console.log(` ${chalk8.cyan("audio")}: ${audioState}`);
21235
21280
  console.log(` ${chalk8.cyan("transcript")}: ${hasTranscript ? chalk8.green("available") : chalk8.gray("unavailable")}`);
21236
21281
  console.log(` ${chalk8.cyan("summary")}: ${hasSummary ? chalk8.green("available") : chalk8.gray("unavailable")}`);
21237
21282
  console.log();
@@ -21426,25 +21471,19 @@ import chalk12 from "chalk";
21426
21471
  import ora9 from "ora";
21427
21472
  var MAX_PAGES = 5;
21428
21473
  var PAGE_SIZE = 100;
21429
- function parseDate(s) {
21430
- if (!s) return null;
21431
- const d = new Date(s);
21432
- return Number.isNaN(d.getTime()) ? null : d.getTime();
21433
- }
21434
21474
  var searchCommand = new Command11("search").description("Search recordings by name keyword (client-side, scans up to 500 most recent recordings)").argument("<keyword>", "Case-insensitive substring to match against recording names").option("--from <date>", "Start date inclusive, YYYY-MM-DD").option("--to <date>", "End date inclusive, YYYY-MM-DD").option("--max <n>", "Maximum matches to display", "50").action(async (keyword, opts) => {
21435
21475
  const max = parseInt(opts.max);
21436
21476
  if (isNaN(max) || max < 1 || max > 500) {
21437
21477
  printError("INVALID_ARGS", "--max must be a number between 1 and 500");
21438
21478
  await telemetryExit(ExitCode.ERROR);
21439
21479
  }
21440
- const from = parseDate(opts.from);
21441
- const toRaw = parseDate(opts.to);
21442
- const to = toRaw !== null ? toRaw + 24 * 60 * 60 * 1e3 - 1 : null;
21480
+ const from = localDayStart(opts.from);
21481
+ const to = localDayEnd(opts.to);
21443
21482
  if (opts.from && from === null) {
21444
21483
  printError("INVALID_ARGS", `Invalid --from date: ${opts.from}`);
21445
21484
  await telemetryExit(ExitCode.ERROR);
21446
21485
  }
21447
- if (opts.to && toRaw === null) {
21486
+ if (opts.to && to === null) {
21448
21487
  printError("INVALID_ARGS", `Invalid --to date: ${opts.to}`);
21449
21488
  await telemetryExit(ExitCode.ERROR);
21450
21489
  }
@@ -21462,7 +21501,7 @@ var searchCommand = new Command11("search").description("Search recordings by na
21462
21501
  for (const file of result.data) {
21463
21502
  if (!(file.name ?? "").toLowerCase().includes(q)) continue;
21464
21503
  if (from !== null || to !== null) {
21465
- const created = parseDate(file.created_at);
21504
+ const created = parseApiTimestamp(file.created_at);
21466
21505
  if (created === null) continue;
21467
21506
  if (from !== null && created < from) continue;
21468
21507
  if (to !== null && created > to) continue;
@@ -21537,8 +21576,8 @@ var recentCommand = new Command12("recent").description("List recordings from th
21537
21576
  let allOlder = true;
21538
21577
  let hasValidTimestamps = false;
21539
21578
  for (const file of result.data) {
21540
- const created = new Date(file.created_at).getTime();
21541
- if (Number.isNaN(created)) continue;
21579
+ const created = parseApiTimestamp(file.created_at);
21580
+ if (created === null) continue;
21542
21581
  hasValidTimestamps = true;
21543
21582
  if (created >= from) {
21544
21583
  matches.push(file);
@@ -21591,8 +21630,8 @@ var todayCommand = new Command12("today").description("List recordings created t
21591
21630
  const result = await client2.listFiles(1, 50);
21592
21631
  spinner.stop();
21593
21632
  const matches = result.data.filter((f2) => {
21594
- const t = new Date(f2.created_at).getTime();
21595
- return !Number.isNaN(t) && t >= startMs;
21633
+ const t = parseApiTimestamp(f2.created_at);
21634
+ return t !== null && t >= startMs;
21596
21635
  });
21597
21636
  if (matches.length === 0) {
21598
21637
  console.log(chalk13.yellow("No recordings created today."));
@@ -21716,7 +21755,7 @@ async function runWizard() {
21716
21755
  try {
21717
21756
  await initTelemetry({
21718
21757
  surface: "cli",
21719
- appVersion: "0.3.7"
21758
+ appVersion: "0.3.8"
21720
21759
  });
21721
21760
  } catch {
21722
21761
  }
@@ -21725,7 +21764,7 @@ async function notifyUpdate() {
21725
21764
  if (sub === "version" || sub === "update") return;
21726
21765
  if (process.env.PLAUD_NO_UPDATE_NOTIFIER) return;
21727
21766
  if (!process.stderr.isTTY) return;
21728
- const current = "0.3.7";
21767
+ const current = "0.3.8";
21729
21768
  if (current === "0.0.0") return;
21730
21769
  try {
21731
21770
  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.7",
3
+ "version": "0.3.8",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "plaud": "dist/index.js"