open-agents-ai 0.187.367 → 0.187.368

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 +72 -61
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -544273,77 +544273,84 @@ async function handleSlashCommand(input, ctx3) {
544273
544273
  await showColorMenu(ctx3);
544274
544274
  return "handled";
544275
544275
  }
544276
- case "apikey": {
544277
- registerSlashCommand({
544278
- name: "apikey",
544279
- description: "Show/copy/rotate API key (show|copy|new)",
544280
- handler: async ({ arg: arg2 }) => {
544281
- const action = (arg2 || "show").trim().toLowerCase();
544282
- let key = process.env["OA_API_KEY"] || "";
544283
- if (!key) {
544284
- try {
544285
- const { homedir: homedir41 } = await import("node:os");
544286
- const { readFileSync: readFileSync72, existsSync: existsSync91 } = await import("node:fs");
544287
- const { join: join110 } = await import("node:path");
544288
- const p2 = join110(homedir41(), ".open-agents", "api.key");
544289
- if (existsSync91(p2)) key = readFileSync72(p2, "utf8").trim();
544290
- } catch {
544291
- }
544276
+ case "apikey":
544277
+ case "key": {
544278
+ const apiKeyHandler = async ({ arg: a2 }) => {
544279
+ const action = (a2 || "show").trim().toLowerCase();
544280
+ let key = process.env["OA_API_KEY"] || "";
544281
+ if (!key) {
544282
+ try {
544283
+ const { homedir: homedir41 } = await import("node:os");
544284
+ const { readFileSync: readFileSync72, existsSync: existsSync91 } = await import("node:fs");
544285
+ const { join: join110 } = await import("node:path");
544286
+ const p2 = join110(homedir41(), ".open-agents", "api.key");
544287
+ if (existsSync91(p2)) key = readFileSync72(p2, "utf8").trim();
544288
+ } catch {
544292
544289
  }
544293
- if (action === "show") {
544294
- if (!key) {
544295
- renderWarning2("No API key set. Use /access any to generate one.");
544296
- return "handled";
544297
- }
544298
- renderInfo2(`API key: ${c3.bold(c3.yellow(key))}`);
544299
- renderInfo2("Use Authorization: Bearer <key> or paste in the Web UI key modal.");
544290
+ }
544291
+ if (action === "show") {
544292
+ if (!key) {
544293
+ renderWarning2("No API key set. Use /access any to generate one.");
544300
544294
  return "handled";
544301
544295
  }
544302
- if (action === "copy") {
544303
- if (!key) {
544304
- renderWarning2("No API key set. Use /access any to generate one.");
544305
- return "handled";
544306
- }
544307
- try {
544308
- const { spawnSync: spawnSync6 } = await import("node:child_process");
544309
- const tryCmd = (cmd2, args) => spawnSync6(cmd2, args, { input: key, encoding: "utf8" });
544310
- let ok2 = false;
544311
- if (process.platform === "darwin") {
544312
- ok2 = tryCmd("pbcopy", []).status === 0;
544313
- } else if (process.platform === "win32") {
544314
- ok2 = tryCmd("clip", []).status === 0;
544315
- } else {
544316
- ok2 = tryCmd("wl-copy", []).status === 0 || tryCmd("xclip", ["-selection", "clipboard"]).status === 0;
544317
- }
544318
- renderInfo2(ok2 ? "Copied API key to clipboard." : "Copy failed — printed above, select to copy.");
544319
- } catch {
544320
- renderInfo2("Copy failed — printed above, select to copy.");
544321
- }
544296
+ renderInfo2(`API key: ${c3.bold(c3.yellow(key))}`);
544297
+ renderInfo2("Use Authorization: Bearer <key> or paste in the Web UI key modal.");
544298
+ return "handled";
544299
+ }
544300
+ if (action === "copy") {
544301
+ if (!key) {
544302
+ renderWarning2("No API key set. Use /access any to generate one.");
544322
544303
  return "handled";
544323
544304
  }
544324
- if (action === "new") {
544325
- try {
544326
- const { randomBytes: randomBytes23 } = await import("node:crypto");
544327
- const { homedir: homedir41 } = await import("node:os");
544328
- const { mkdirSync: mkdirSync58, writeFileSync: writeFileSync51 } = await import("node:fs");
544329
- const { join: join110 } = await import("node:path");
544330
- const newKey = randomBytes23(16).toString("hex");
544331
- process.env["OA_API_KEY"] = newKey;
544332
- const dir = join110(homedir41(), ".open-agents");
544333
- mkdirSync58(dir, { recursive: true });
544334
- writeFileSync51(join110(dir, "api.key"), newKey + "\n", "utf8");
544335
- renderInfo2(`New API key: ${c3.bold(c3.yellow(newKey))}`);
544336
- renderInfo2("Restart the daemon to apply if needed. Use /access any to restart quickly.");
544337
- } catch (e2) {
544338
- renderError2(`Failed to rotate key: ${e2 instanceof Error ? e2.message : String(e2)}`);
544305
+ try {
544306
+ const { spawnSync: spawnSync6 } = await import("node:child_process");
544307
+ const tryCmd = (cmd2, args) => spawnSync6(cmd2, args, { input: key, encoding: "utf8" });
544308
+ let ok2 = false;
544309
+ if (process.platform === "darwin") {
544310
+ ok2 = tryCmd("pbcopy", []).status === 0;
544311
+ } else if (process.platform === "win32") {
544312
+ ok2 = tryCmd("clip", []).status === 0;
544313
+ } else {
544314
+ ok2 = tryCmd("wl-copy", []).status === 0 || tryCmd("xclip", ["-selection", "clipboard"]).status === 0;
544339
544315
  }
544340
- return "handled";
544316
+ renderInfo2(ok2 ? "Copied API key to clipboard." : "Copy failed — printed above, select to copy.");
544317
+ } catch {
544318
+ renderInfo2("Copy failed — printed above, select to copy.");
544319
+ }
544320
+ return "handled";
544321
+ }
544322
+ if (action === "new") {
544323
+ try {
544324
+ const { randomBytes: randomBytes23 } = await import("node:crypto");
544325
+ const { homedir: homedir41 } = await import("node:os");
544326
+ const { mkdirSync: mkdirSync58, writeFileSync: writeFileSync51 } = await import("node:fs");
544327
+ const { join: join110 } = await import("node:path");
544328
+ const newKey = randomBytes23(16).toString("hex");
544329
+ process.env["OA_API_KEY"] = newKey;
544330
+ const dir = join110(homedir41(), ".open-agents");
544331
+ mkdirSync58(dir, { recursive: true });
544332
+ writeFileSync51(join110(dir, "api.key"), newKey + "\n", "utf8");
544333
+ renderInfo2(`New API key: ${c3.bold(c3.yellow(newKey))}`);
544334
+ renderInfo2("Restart the daemon to apply if needed. Use /access any to restart quickly.");
544335
+ } catch (e2) {
544336
+ renderError2(`Failed to rotate key: ${e2 instanceof Error ? e2.message : String(e2)}`);
544341
544337
  }
544342
- renderInfo2("Usage: /apikey [show|copy|new]");
544343
544338
  return "handled";
544344
544339
  }
544340
+ renderInfo2("Usage: /apikey [show|copy|new] aliases: /key");
544341
+ return "handled";
544342
+ };
544343
+ registerSlashCommand({
544344
+ name: "apikey",
544345
+ description: "Show/copy/rotate API key (show|copy|new)",
544346
+ handler: async (opts) => apiKeyHandler({ arg: opts.arg })
544345
544347
  });
544346
- return "handled";
544348
+ registerSlashCommand({
544349
+ name: "key",
544350
+ description: "Alias for /apikey",
544351
+ handler: async (opts) => apiKeyHandler({ arg: opts.arg })
544352
+ });
544353
+ return apiKeyHandler({ arg });
544347
544354
  }
544348
544355
  case "sessions":
544349
544356
  case "session": {
@@ -552609,6 +552616,10 @@ var init_render2 = __esm({
552609
552616
  ["/scheduler menu", "Interactive scheduler menu (toggle/kill)"],
552610
552617
  ["/scheduler list", "List all scheduled tasks and timers"],
552611
552618
  ["/scheduler kill", "Kill schedulers + active runs (with escalation if needed)"],
552619
+ ["/apikey", "Show current API key (for pasting into Web UI / clients)"],
552620
+ ["/apikey copy", "Copy the API key to clipboard"],
552621
+ ["/apikey new", "Rotate to a new API key (regenerate)"],
552622
+ ["/key", "Alias for /apikey"],
552612
552623
  ["/codegraph", "Code-graph snapshot: stats, top files, recent activity"],
552613
552624
  ["/codegraph watch [N]", "Subscribe to live code-graph events for N seconds (default 30)"],
552614
552625
  ["/cg", "Alias for /codegraph"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.187.367",
3
+ "version": "0.187.368",
4
4
  "description": "AI coding agent powered by open-source models (Ollama/vLLM) — interactive TUI with agentic tool-calling loop",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",