@livx.cc/agentx 0.99.87 → 0.99.89

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/cli.js CHANGED
@@ -17215,6 +17215,7 @@ function resolveModelOrNewest(model) {
17215
17215
  return fallback;
17216
17216
  }
17217
17217
  var ENV_KEY_ALIASES = { google: ["GEMINI_API_KEY"] };
17218
+ var fileEnvNames = /* @__PURE__ */ new Set();
17218
17219
  function loadEnvFile(file) {
17219
17220
  if (!existsSync9(file)) return;
17220
17221
  for (const line of readFileSync10(file, "utf8").split("\n")) {
@@ -17224,6 +17225,7 @@ function loadEnvFile(file) {
17224
17225
  if (val.startsWith('"') && val.endsWith('"') || val.startsWith("'") && val.endsWith("'")) val = val.slice(1, -1);
17225
17226
  else val = val.replace(/\s+#.*$/, "").trim();
17226
17227
  process.env[m[1]] = val;
17228
+ fileEnvNames.add(m[1]);
17227
17229
  }
17228
17230
  }
17229
17231
  function loadInstallEnv() {
@@ -17234,12 +17236,17 @@ function loadInstallEnv() {
17234
17236
  loadEnvFile(join16(homedir10(), ".agent", name));
17235
17237
  }
17236
17238
  }
17239
+ function paraVaultToken() {
17240
+ if (process.platform !== "darwin") return void 0;
17241
+ const r = Bun.spawnSync(["/usr/bin/security", "find-generic-password", "-s", "Para Settings", "-a", "VAULT_TOKEN", "-w"], { stdout: "pipe", stderr: "pipe" });
17242
+ return r.exitCode === 0 ? r.stdout.toString().trim() || void 0 : void 0;
17243
+ }
17237
17244
  async function loadBodifySecrets() {
17238
- const apiKey = process.env.BODIFY_API_KEY, appId = process.env.BODIFY_APP_ID;
17239
- if (!apiKey || !appId) return;
17245
+ const apiKey = process.env.BODIFY_API_KEY || paraVaultToken(), appId = process.env.BODIFY_APP_ID || "para-browser";
17246
+ if (!apiKey) return;
17240
17247
  const base = process.env.BODIFY_URL || "https://bodify.bod.ee";
17241
17248
  try {
17242
- const res = await fetch(`${base}/api/apps/${encodeURIComponent(appId)}/env`, {
17249
+ const res = await fetch(`${base}/api/apps/${encodeURIComponent(appId)}/env?environment=${encodeURIComponent(process.env.BODIFY_ENV || "prod")}`, {
17243
17250
  headers: { Authorization: `Bearer ${apiKey}` },
17244
17251
  signal: AbortSignal.timeout(5e3)
17245
17252
  });
@@ -17250,7 +17257,7 @@ async function loadBodifySecrets() {
17250
17257
  const { values } = await res.json();
17251
17258
  if (!values) return;
17252
17259
  for (const [k, v] of Object.entries(values)) {
17253
- if (!(k in process.env)) process.env[k] = v;
17260
+ if (!(k in process.env) || fileEnvNames.has(k)) process.env[k] = v;
17254
17261
  }
17255
17262
  } catch (e) {
17256
17263
  console.error(` bodify secrets: ${e.message ?? e}`);
@@ -19137,7 +19144,7 @@ ${task}`;
19137
19144
  `));
19138
19145
  const keys = ["ANTHROPIC_API_KEY", "OPENAI_API_KEY", "GOOGLE_API_KEY", "GROQ_API_KEY"].filter((k) => process.env[k]);
19139
19146
  keys.length ? ok(`provider keys: ${keys.join(", ")}`) : bad("no provider keys set (ANTHROPIC_API_KEY / OPENAI_API_KEY / GOOGLE_API_KEY / GROQ_API_KEY)");
19140
- process.env.BODIFY_API_KEY && process.env.BODIFY_APP_ID ? ok(`bodify secrets: ${process.env.BODIFY_APP_ID}`) : warn("bodify secrets: not configured (set BODIFY_API_KEY + BODIFY_APP_ID)");
19147
+ process.env.BODIFY_API_KEY || paraVaultToken() ? ok(`bodify secrets: ${process.env.BODIFY_APP_ID || "para-browser"}`) : warn("bodify secrets: no vault token (connect the vault in Para Settings \u25B8 Keys, or set BODIFY_API_KEY)");
19141
19148
  {
19142
19149
  const has = hasCommand;
19143
19150
  if (!VoiceIO.available()) warn("voice: keys missing (SONIOX_API_KEY / CARTESIA_API_KEY / CARTESIA_VOICE_ID) \u2014 voice disabled");