@vapi-network/core 0.12.0 → 0.12.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
@@ -70095,11 +70095,19 @@ function binaryInstalled(file2, env) {
70095
70095
  if (isAbsolute(file2) || win32.isAbsolute(file2)) return existsSync(file2);
70096
70096
  return (env.PATH ?? "").split(delimiter).some((directory) => existsSync(join6(directory, file2)));
70097
70097
  }
70098
+ var SAFE_FAILURE_DETAILS = [
70099
+ "Cannot autolaunch D-Bus without X11 $DISPLAY",
70100
+ "Cannot autolaunch D-Bus",
70101
+ "The name org.freedesktop.secrets was not provided by any .service files",
70102
+ "Cannot create an item in a locked collection",
70103
+ "User interaction is not allowed.",
70104
+ "Access to the path is denied."
70105
+ ];
70098
70106
  function requireSuccess(result, what) {
70099
70107
  if (result.code === 0) return;
70100
- const detail = result.stderr.trim() || result.stdout.trim();
70108
+ const detail = SAFE_FAILURE_DETAILS.find((reason) => result.stderr.includes(reason));
70101
70109
  throw new KeystoreError(
70102
- `Could not ${what}${result.code === null ? "" : ` (exit ${result.code})`}.${detail.length === 0 ? "" : ` ${detail}`}`
70110
+ `Could not ${what}${result.code === null ? "" : ` (exit ${result.code})`}.${detail === void 0 ? "" : ` ${detail}`}`
70103
70111
  );
70104
70112
  }
70105
70113
  function withoutTrailingNewline(value) {
@@ -71084,7 +71092,7 @@ async function loadOrCreateDeviceKey(args) {
71084
71092
  await args.secrets.set(VAULT_KEY_ACCOUNT, key.toString("base64"));
71085
71093
  return key;
71086
71094
  } catch (error61) {
71087
- throw asVaultError2(error61, "Unable to load or create the device vault key.");
71095
+ throw asVaultError2(error61, deviceKeyFailureMessage(error61, args.secrets.platform));
71088
71096
  }
71089
71097
  });
71090
71098
  }
@@ -71342,6 +71350,12 @@ function parseJson(value) {
71342
71350
  function asVaultError2(error61, message) {
71343
71351
  return error61 instanceof VaultError ? error61 : new VaultError("corrupt", message, { cause: error61 });
71344
71352
  }
71353
+ var HEADLESS_LINUX_HINT = "A server, container or GitHub Codespace usually has no keyring. Run vapi on your own computer, or connect Claude from https://api.vapinetwork.ai/connect.";
71354
+ function deviceKeyFailureMessage(error61, platform2) {
71355
+ if (!(error61 instanceof KeystoreError)) return "Unable to load or create the device vault key.";
71356
+ const detail = `Unable to load or create the device vault key: ${error61.message.replace(/\.$/u, "")}.`;
71357
+ return platform2 === "linux" ? `${detail} ${HEADLESS_LINUX_HINT}` : detail;
71358
+ }
71345
71359
 
71346
71360
  // src/vault-migrate.ts
71347
71361
  import {
@@ -77171,7 +77185,7 @@ function createRunBudget(args) {
77171
77185
  import { mkdir as mkdir15, writeFile as writeFile8 } from "node:fs/promises";
77172
77186
  import { arch, platform, release } from "node:os";
77173
77187
  import { join as join13 } from "node:path";
77174
- var VAPI_CLIENT_VERSION = "0.12.0";
77188
+ var VAPI_CLIENT_VERSION = "0.12.1";
77175
77189
  async function createSupportReport(options) {
77176
77190
  const message = options.message.trim();
77177
77191
  if (!message) throw new Error("Support report message must not be empty.");