@openclaw/voice-call 2026.5.16-beta.2 → 2026.5.16-beta.4

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 +10 -4
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -24,6 +24,12 @@ function writeStdoutLine(...values) {
24
24
  function writeStdoutJson(value) {
25
25
  process.stdout.write(`${JSON.stringify(value, null, 2)}\n`);
26
26
  }
27
+ function parseVoiceCallIntOption(raw, optionName, opts) {
28
+ const min = opts?.min ?? 0;
29
+ const parsed = Number(raw);
30
+ if (!Number.isInteger(parsed) || parsed < min) throw new Error(`Invalid numeric value for ${optionName}: ${raw ?? ""}`);
31
+ return parsed;
32
+ }
27
33
  function isRecord$1(value) {
28
34
  return Boolean(value && typeof value === "object" && !Array.isArray(value));
29
35
  }
@@ -402,8 +408,8 @@ function registerVoiceCallCli(params) {
402
408
  });
403
409
  root.command("tail").description("Tail voice-call JSONL logs (prints new lines; useful during provider tests)").option("--file <path>", "Path to calls.jsonl", resolveDefaultStorePath(config)).option("--since <n>", "Print last N lines first", "25").option("--poll <ms>", "Poll interval in ms", "250").action(async (options) => {
404
410
  const file = options.file;
405
- const since = Math.max(0, Number(options.since ?? 0));
406
- const pollMs = Math.max(50, Number(options.poll ?? 250));
411
+ const since = parseVoiceCallIntOption(options.since, "--since", { min: 0 });
412
+ const pollMs = parseVoiceCallIntOption(options.poll, "--poll", { min: 50 });
407
413
  if (!fs.existsSync(file)) {
408
414
  logger.error(`No log file at ${file}`);
409
415
  process.exit(1);
@@ -434,7 +440,7 @@ function registerVoiceCallCli(params) {
434
440
  });
435
441
  root.command("latency").description("Summarize turn latency metrics from voice-call JSONL logs").option("--file <path>", "Path to calls.jsonl", resolveDefaultStorePath(config)).option("--last <n>", "Analyze last N records", "200").action(async (options) => {
436
442
  const file = options.file;
437
- const last = Math.max(1, Number(options.last ?? 200));
443
+ const last = parseVoiceCallIntOption(options.last, "--last", { min: 1 });
438
444
  if (!fs.existsSync(file)) throw new Error("No log file at " + file);
439
445
  const lines = fs.readFileSync(file, "utf8").split("\n").filter(Boolean).slice(-last);
440
446
  const turnLatencyMs = [];
@@ -454,7 +460,7 @@ function registerVoiceCallCli(params) {
454
460
  });
455
461
  root.command("expose").description("Enable/disable Tailscale serve/funnel for the webhook").option("--mode <mode>", "off | serve (tailnet) | funnel (public)", "funnel").option("--path <path>", "Tailscale path to expose (recommend matching serve.path)").option("--port <port>", "Local webhook port").option("--serve-path <path>", "Local webhook path").action(async (options) => {
456
462
  const mode = resolveMode(options.mode ?? "funnel");
457
- const servePort = Number(options.port ?? config.serve.port ?? 3334);
463
+ const servePort = parseVoiceCallIntOption(options.port ?? String(config.serve.port ?? 3334), "--port", { min: 1 });
458
464
  const servePath = options.servePath ?? config.serve.path ?? "/voice/webhook";
459
465
  const tsPath = options.path ?? config.tailscale?.path ?? servePath;
460
466
  const localUrl = `http://127.0.0.1:${servePort}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/voice-call",
3
- "version": "2026.5.16-beta.2",
3
+ "version": "2026.5.16-beta.4",
4
4
  "description": "OpenClaw voice-call plugin",
5
5
  "repository": {
6
6
  "type": "git",
@@ -18,7 +18,7 @@
18
18
  "openclaw": "workspace:*"
19
19
  },
20
20
  "peerDependencies": {
21
- "openclaw": ">=2026.5.16-beta.2"
21
+ "openclaw": ">=2026.5.16-beta.4"
22
22
  },
23
23
  "peerDependenciesMeta": {
24
24
  "openclaw": {
@@ -35,10 +35,10 @@
35
35
  "minHostVersion": ">=2026.4.10"
36
36
  },
37
37
  "compat": {
38
- "pluginApi": ">=2026.5.16-beta.2"
38
+ "pluginApi": ">=2026.5.16-beta.4"
39
39
  },
40
40
  "build": {
41
- "openclawVersion": "2026.5.16-beta.2"
41
+ "openclawVersion": "2026.5.16-beta.4"
42
42
  },
43
43
  "release": {
44
44
  "publishToClawHub": true,