@n1creator/openacp-cli 2026.712.2 → 2026.712.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.
package/dist/cli.js CHANGED
@@ -199,11 +199,11 @@ async function shutdownLogger() {
199
199
  logDir = void 0;
200
200
  initialized = false;
201
201
  if (transport) {
202
- await new Promise((resolve9) => {
203
- const timeout = setTimeout(resolve9, 3e3);
202
+ await new Promise((resolve8) => {
203
+ const timeout = setTimeout(resolve8, 3e3);
204
204
  transport.on("close", () => {
205
205
  clearTimeout(timeout);
206
- resolve9();
206
+ resolve8();
207
207
  });
208
208
  transport.end();
209
209
  });
@@ -345,21 +345,21 @@ function compareVersions(current, latest) {
345
345
  }
346
346
  async function runUpdate() {
347
347
  const { spawn: spawn9 } = await import("child_process");
348
- return new Promise((resolve9) => {
348
+ return new Promise((resolve8) => {
349
349
  const child = spawn9("npm", ["install", "-g", `${NPM_PACKAGE}@latest`], {
350
350
  stdio: "inherit",
351
351
  shell: false
352
352
  });
353
353
  const onSignal = () => {
354
354
  child.kill("SIGTERM");
355
- resolve9(false);
355
+ resolve8(false);
356
356
  };
357
357
  process.on("SIGINT", onSignal);
358
358
  process.on("SIGTERM", onSignal);
359
359
  child.on("close", (code) => {
360
360
  process.off("SIGINT", onSignal);
361
361
  process.off("SIGTERM", onSignal);
362
- resolve9(code === 0);
362
+ resolve8(code === 0);
363
363
  });
364
364
  });
365
365
  }
@@ -6090,7 +6090,7 @@ import https from "https";
6090
6090
  import os3 from "os";
6091
6091
  import { execFileSync as execFileSync3 } from "child_process";
6092
6092
  function downloadFile(url, dest, maxRedirects = 10) {
6093
- return new Promise((resolve9, reject) => {
6093
+ return new Promise((resolve8, reject) => {
6094
6094
  const file = fs11.createWriteStream(dest);
6095
6095
  const cleanup = () => {
6096
6096
  try {
@@ -6109,7 +6109,7 @@ function downloadFile(url, dest, maxRedirects = 10) {
6109
6109
  }
6110
6110
  file.close(() => {
6111
6111
  cleanup();
6112
- downloadFile(response.headers.location, dest, maxRedirects - 1).then(resolve9).catch(reject);
6112
+ downloadFile(response.headers.location, dest, maxRedirects - 1).then(resolve8).catch(reject);
6113
6113
  });
6114
6114
  return;
6115
6115
  }
@@ -6133,7 +6133,7 @@ function downloadFile(url, dest, maxRedirects = 10) {
6133
6133
  }
6134
6134
  });
6135
6135
  response.pipe(file);
6136
- file.on("finish", () => file.close(() => resolve9(dest)));
6136
+ file.on("finish", () => file.close(() => resolve8(dest)));
6137
6137
  file.on("error", (err) => {
6138
6138
  file.close(() => {
6139
6139
  cleanup();
@@ -6282,7 +6282,7 @@ var init_cloudflare = __esm({
6282
6282
  if (this.options.domain) {
6283
6283
  args2.push("--hostname", String(this.options.domain));
6284
6284
  }
6285
- return new Promise((resolve9, reject) => {
6285
+ return new Promise((resolve8, reject) => {
6286
6286
  let settled = false;
6287
6287
  const settle = (fn) => {
6288
6288
  if (!settled) {
@@ -6310,7 +6310,7 @@ var init_cloudflare = __esm({
6310
6310
  clearTimeout(timeout);
6311
6311
  this.publicUrl = match[0];
6312
6312
  log4.info({ url: this.publicUrl }, "Cloudflare tunnel ready");
6313
- settle(() => resolve9(this.publicUrl));
6313
+ settle(() => resolve8(this.publicUrl));
6314
6314
  }
6315
6315
  };
6316
6316
  this.child.stdout?.on("data", onData);
@@ -6343,8 +6343,8 @@ var init_cloudflare = __esm({
6343
6343
  }
6344
6344
  child.kill("SIGTERM");
6345
6345
  const exited = await Promise.race([
6346
- new Promise((resolve9) => child.on("exit", () => resolve9(true))),
6347
- new Promise((resolve9) => setTimeout(() => resolve9(false), SIGKILL_TIMEOUT_MS))
6346
+ new Promise((resolve8) => child.on("exit", () => resolve8(true))),
6347
+ new Promise((resolve8) => setTimeout(() => resolve8(false), SIGKILL_TIMEOUT_MS))
6348
6348
  ]);
6349
6349
  if (!exited) {
6350
6350
  log4.warn("cloudflared did not exit after SIGTERM, sending SIGKILL");
@@ -6397,7 +6397,7 @@ var init_ngrok = __esm({
6397
6397
  if (this.options.region) {
6398
6398
  args2.push("--region", String(this.options.region));
6399
6399
  }
6400
- return new Promise((resolve9, reject) => {
6400
+ return new Promise((resolve8, reject) => {
6401
6401
  let settled = false;
6402
6402
  const settle = (fn) => {
6403
6403
  if (!settled) {
@@ -6427,7 +6427,7 @@ var init_ngrok = __esm({
6427
6427
  clearTimeout(timeout);
6428
6428
  this.publicUrl = match[0];
6429
6429
  log5.info({ url: this.publicUrl }, "ngrok tunnel ready");
6430
- settle(() => resolve9(this.publicUrl));
6430
+ settle(() => resolve8(this.publicUrl));
6431
6431
  }
6432
6432
  };
6433
6433
  this.child.stdout?.on("data", onData);
@@ -6462,8 +6462,8 @@ var init_ngrok = __esm({
6462
6462
  }
6463
6463
  child.kill("SIGTERM");
6464
6464
  const exited = await Promise.race([
6465
- new Promise((resolve9) => child.on("exit", () => resolve9(true))),
6466
- new Promise((resolve9) => setTimeout(() => resolve9(false), SIGKILL_TIMEOUT_MS2))
6465
+ new Promise((resolve8) => child.on("exit", () => resolve8(true))),
6466
+ new Promise((resolve8) => setTimeout(() => resolve8(false), SIGKILL_TIMEOUT_MS2))
6467
6467
  ]);
6468
6468
  if (!exited) {
6469
6469
  log5.warn("ngrok did not exit after SIGTERM, sending SIGKILL");
@@ -6507,7 +6507,7 @@ var init_bore = __esm({
6507
6507
  if (this.options.secret) {
6508
6508
  args2.push("--secret", String(this.options.secret));
6509
6509
  }
6510
- return new Promise((resolve9, reject) => {
6510
+ return new Promise((resolve8, reject) => {
6511
6511
  let settled = false;
6512
6512
  const settle = (fn) => {
6513
6513
  if (!settled) {
@@ -6537,7 +6537,7 @@ var init_bore = __esm({
6537
6537
  clearTimeout(timeout);
6538
6538
  this.publicUrl = `http://${match[1]}:${match[2]}`;
6539
6539
  log6.info({ url: this.publicUrl }, "Bore tunnel ready");
6540
- settle(() => resolve9(this.publicUrl));
6540
+ settle(() => resolve8(this.publicUrl));
6541
6541
  }
6542
6542
  };
6543
6543
  this.child.stdout?.on("data", onData);
@@ -6572,8 +6572,8 @@ var init_bore = __esm({
6572
6572
  }
6573
6573
  child.kill("SIGTERM");
6574
6574
  const exited = await Promise.race([
6575
- new Promise((resolve9) => child.on("exit", () => resolve9(true))),
6576
- new Promise((resolve9) => setTimeout(() => resolve9(false), SIGKILL_TIMEOUT_MS3))
6575
+ new Promise((resolve8) => child.on("exit", () => resolve8(true))),
6576
+ new Promise((resolve8) => setTimeout(() => resolve8(false), SIGKILL_TIMEOUT_MS3))
6577
6577
  ]);
6578
6578
  if (!exited) {
6579
6579
  log6.warn("bore did not exit after SIGTERM, sending SIGKILL");
@@ -6622,7 +6622,7 @@ var init_tailscale = __esm({
6622
6622
  if (this.options.bg) {
6623
6623
  args2.push("--bg");
6624
6624
  }
6625
- return new Promise((resolve9, reject) => {
6625
+ return new Promise((resolve8, reject) => {
6626
6626
  let settled = false;
6627
6627
  const settle = (fn) => {
6628
6628
  if (!settled) {
@@ -6652,7 +6652,7 @@ var init_tailscale = __esm({
6652
6652
  clearTimeout(timeout);
6653
6653
  this.publicUrl = match[0];
6654
6654
  log7.info({ url: this.publicUrl }, "Tailscale funnel ready");
6655
- settle(() => resolve9(this.publicUrl));
6655
+ settle(() => resolve8(this.publicUrl));
6656
6656
  }
6657
6657
  };
6658
6658
  this.child.stdout?.on("data", onData);
@@ -6670,7 +6670,7 @@ var init_tailscale = __esm({
6670
6670
  this.publicUrl = `https://${hostname}:${localPort}`;
6671
6671
  this.child = null;
6672
6672
  log7.info({ url: this.publicUrl }, "Tailscale funnel ready (constructed from hostname)");
6673
- settle(() => resolve9(this.publicUrl));
6673
+ settle(() => resolve8(this.publicUrl));
6674
6674
  } else {
6675
6675
  settle(() => reject(new Error(`tailscale exited with code ${code} before establishing funnel`)));
6676
6676
  }
@@ -6694,8 +6694,8 @@ var init_tailscale = __esm({
6694
6694
  }
6695
6695
  child.kill("SIGTERM");
6696
6696
  const exited = await Promise.race([
6697
- new Promise((resolve9) => child.on("exit", () => resolve9(true))),
6698
- new Promise((resolve9) => setTimeout(() => resolve9(false), SIGKILL_TIMEOUT_MS4))
6697
+ new Promise((resolve8) => child.on("exit", () => resolve8(true))),
6698
+ new Promise((resolve8) => setTimeout(() => resolve8(false), SIGKILL_TIMEOUT_MS4))
6699
6699
  ]);
6700
6700
  if (!exited) {
6701
6701
  log7.warn("tailscale did not exit after SIGTERM, sending SIGKILL");
@@ -6813,7 +6813,7 @@ var init_openacp = __esm({
6813
6813
  }
6814
6814
  async spawnCloudflared(binaryPath, token, port) {
6815
6815
  const args2 = ["tunnel", "run", "--url", `http://localhost:${port}`, "--token", token];
6816
- return new Promise((resolve9, reject) => {
6816
+ return new Promise((resolve8, reject) => {
6817
6817
  let settled = false;
6818
6818
  const settle = (fn) => {
6819
6819
  if (!settled) {
@@ -6823,7 +6823,7 @@ var init_openacp = __esm({
6823
6823
  };
6824
6824
  const timeout = setTimeout(() => {
6825
6825
  log8.info({ port }, "cloudflared still running after startup window \u2014 assuming tunnel active");
6826
- settle(resolve9);
6826
+ settle(resolve8);
6827
6827
  }, STARTUP_TIMEOUT_MS);
6828
6828
  let child;
6829
6829
  try {
@@ -6839,7 +6839,7 @@ var init_openacp = __esm({
6839
6839
  if (/Registered tunnel connection/.test(line)) {
6840
6840
  clearTimeout(timeout);
6841
6841
  log8.info({ port }, "cloudflared connection registered");
6842
- settle(resolve9);
6842
+ settle(resolve8);
6843
6843
  }
6844
6844
  };
6845
6845
  child.stdout?.on("data", onData);
@@ -11507,17 +11507,9 @@ __export(api_server_exports, {
11507
11507
  import * as fs22 from "fs";
11508
11508
  import * as crypto3 from "crypto";
11509
11509
  import * as path26 from "path";
11510
- import { fileURLToPath as fileURLToPath3 } from "url";
11511
11510
  function getVersion() {
11512
11511
  if (cachedVersion) return cachedVersion;
11513
- try {
11514
- const __filename = fileURLToPath3(import.meta.url);
11515
- const pkgPath = path26.resolve(path26.dirname(__filename), "../../../package.json");
11516
- const pkg = JSON.parse(fs22.readFileSync(pkgPath, "utf-8"));
11517
- cachedVersion = pkg.version ?? "0.0.0-dev";
11518
- } catch {
11519
- cachedVersion = "0.0.0-dev";
11520
- }
11512
+ cachedVersion = getCurrentVersion();
11521
11513
  return cachedVersion;
11522
11514
  }
11523
11515
  function loadOrCreateSecret(secretFilePath) {
@@ -11846,6 +11838,7 @@ var init_api_server = __esm({
11846
11838
  "use strict";
11847
11839
  init_events();
11848
11840
  init_log();
11841
+ init_version();
11849
11842
  log15 = createChildLogger({ module: "api-server" });
11850
11843
  api_server_default = createApiServerPlugin();
11851
11844
  }
@@ -15673,12 +15666,12 @@ function isProcessAlive(pid) {
15673
15666
  }
15674
15667
  }
15675
15668
  function checkPortInUse(port) {
15676
- return new Promise((resolve9) => {
15669
+ return new Promise((resolve8) => {
15677
15670
  const server = net.createServer();
15678
- server.once("error", () => resolve9(true));
15671
+ server.once("error", () => resolve8(true));
15679
15672
  server.once("listening", () => {
15680
15673
  server.close();
15681
- resolve9(false);
15674
+ resolve8(false);
15682
15675
  });
15683
15676
  server.listen(port, "127.0.0.1");
15684
15677
  });
@@ -17531,10 +17524,10 @@ var init_send_queue = __esm({
17531
17524
  const type = opts?.type ?? "other";
17532
17525
  const key = opts?.key;
17533
17526
  const category = opts?.category;
17534
- let resolve9;
17527
+ let resolve8;
17535
17528
  let reject;
17536
17529
  const promise = new Promise((res, rej) => {
17537
- resolve9 = res;
17530
+ resolve8 = res;
17538
17531
  reject = rej;
17539
17532
  });
17540
17533
  promise.catch(() => {
@@ -17545,12 +17538,12 @@ var init_send_queue = __esm({
17545
17538
  );
17546
17539
  if (idx !== -1) {
17547
17540
  this.items[idx].resolve(void 0);
17548
- this.items[idx] = { fn, type, key, category, resolve: resolve9, reject, promise };
17541
+ this.items[idx] = { fn, type, key, category, resolve: resolve8, reject, promise };
17549
17542
  this.scheduleProcess();
17550
17543
  return promise;
17551
17544
  }
17552
17545
  }
17553
- this.items.push({ fn, type, key, category, resolve: resolve9, reject, promise });
17546
+ this.items.push({ fn, type, key, category, resolve: resolve8, reject, promise });
17554
17547
  this.scheduleProcess();
17555
17548
  return promise;
17556
17549
  }
@@ -20788,7 +20781,7 @@ function startDaemon(pidPath, logDir2, instanceRoot) {
20788
20781
  return { pid: child.pid };
20789
20782
  }
20790
20783
  function sleep2(ms) {
20791
- return new Promise((resolve9) => setTimeout(resolve9, ms));
20784
+ return new Promise((resolve8) => setTimeout(resolve8, ms));
20792
20785
  }
20793
20786
  function isProcessAlive2(pid) {
20794
20787
  try {
@@ -21328,15 +21321,15 @@ var init_env_filter = __esm({
21328
21321
  function nodeToWebWritable(nodeStream) {
21329
21322
  return new WritableStream({
21330
21323
  write(chunk) {
21331
- return new Promise((resolve9, reject) => {
21324
+ return new Promise((resolve8, reject) => {
21332
21325
  const ok3 = nodeStream.write(chunk);
21333
21326
  if (ok3) {
21334
- resolve9();
21327
+ resolve8();
21335
21328
  return;
21336
21329
  }
21337
21330
  const onDrain = () => {
21338
21331
  nodeStream.removeListener("error", onError);
21339
- resolve9();
21332
+ resolve8();
21340
21333
  };
21341
21334
  const onError = (err) => {
21342
21335
  nodeStream.removeListener("drain", onDrain);
@@ -21666,12 +21659,12 @@ var init_terminal_manager = __esm({
21666
21659
  signal: state.exitStatus.signal
21667
21660
  };
21668
21661
  }
21669
- return new Promise((resolve9) => {
21662
+ return new Promise((resolve8) => {
21670
21663
  state.process.on("exit", (code, signal) => {
21671
- resolve9({ exitCode: code, signal });
21664
+ resolve8({ exitCode: code, signal });
21672
21665
  });
21673
21666
  if (state.exitStatus !== null) {
21674
- resolve9({
21667
+ resolve8({
21675
21668
  exitCode: state.exitStatus.exitCode,
21676
21669
  signal: state.exitStatus.signal
21677
21670
  });
@@ -21894,7 +21887,7 @@ function resolveAgentCommand(cmd) {
21894
21887
  }
21895
21888
  function withAgentTimeout(promise, agentName, op, timeoutMs) {
21896
21889
  const timeout = timeoutMs ?? AGENT_INIT_TIMEOUT_MS;
21897
- return new Promise((resolve9, reject) => {
21890
+ return new Promise((resolve8, reject) => {
21898
21891
  const timer = setTimeout(() => {
21899
21892
  reject(new Error(
21900
21893
  `Agent "${agentName}" did not respond to ${op} within ${timeout / 1e3}s. The agent process may have hung during initialization.`
@@ -21903,7 +21896,7 @@ function withAgentTimeout(promise, agentName, op, timeoutMs) {
21903
21896
  promise.then(
21904
21897
  (val) => {
21905
21898
  clearTimeout(timer);
21906
- resolve9(val);
21899
+ resolve8(val);
21907
21900
  },
21908
21901
  (err) => {
21909
21902
  clearTimeout(timer);
@@ -22007,7 +22000,7 @@ var init_agent_instance = __esm({
22007
22000
  env: filterEnv(process.env, agentDef.env)
22008
22001
  }
22009
22002
  );
22010
- await new Promise((resolve9, reject) => {
22003
+ await new Promise((resolve8, reject) => {
22011
22004
  instance.child.on("error", (err) => {
22012
22005
  reject(
22013
22006
  new Error(
@@ -22015,7 +22008,7 @@ var init_agent_instance = __esm({
22015
22008
  )
22016
22009
  );
22017
22010
  });
22018
- instance.child.on("spawn", () => resolve9());
22011
+ instance.child.on("spawn", () => resolve8());
22019
22012
  });
22020
22013
  instance.stderrCapture = new StderrCapture(50);
22021
22014
  instance.child.stderr.on("data", (chunk) => {
@@ -22641,15 +22634,15 @@ ${skipNote}`;
22641
22634
  this._destroying = true;
22642
22635
  this.terminalManager.destroyAll();
22643
22636
  if (this.child.exitCode !== null) return;
22644
- await new Promise((resolve9) => {
22637
+ await new Promise((resolve8) => {
22645
22638
  this.child.on("exit", () => {
22646
22639
  clearTimeout(forceKillTimer);
22647
- resolve9();
22640
+ resolve8();
22648
22641
  });
22649
22642
  this.child.kill("SIGTERM");
22650
22643
  const forceKillTimer = setTimeout(() => {
22651
22644
  if (this.child.exitCode === null) this.child.kill("SIGKILL");
22652
- resolve9();
22645
+ resolve8();
22653
22646
  }, 1e4);
22654
22647
  if (typeof forceKillTimer === "object" && forceKillTimer !== null && "unref" in forceKillTimer) {
22655
22648
  forceKillTimer.unref();
@@ -22894,8 +22887,8 @@ var init_prompt_queue = __esm({
22894
22887
  if (this.processing) {
22895
22888
  const position = this.queue.length + 1;
22896
22889
  this.onActuallyQueued?.(turnId, position, routing);
22897
- return new Promise((resolve9) => {
22898
- this.queue.push({ text: text5, userPrompt, attachments, routing, turnId, meta, resolve: resolve9 });
22890
+ return new Promise((resolve8) => {
22891
+ this.queue.push({ text: text5, userPrompt, attachments, routing, turnId, meta, resolve: resolve8 });
22899
22892
  });
22900
22893
  }
22901
22894
  await this.process(text5, userPrompt, attachments, routing, turnId, meta);
@@ -23031,8 +23024,8 @@ var init_permission_gate = __esm({
23031
23024
  this.request = request;
23032
23025
  this.settled = false;
23033
23026
  this.clearTimeout();
23034
- return new Promise((resolve9, reject) => {
23035
- this.resolveFn = resolve9;
23027
+ return new Promise((resolve8, reject) => {
23028
+ this.resolveFn = resolve8;
23036
23029
  this.rejectFn = reject;
23037
23030
  this.timeoutTimer = setTimeout(() => {
23038
23031
  this.reject("Permission request timed out (no response received)");
@@ -27048,13 +27041,13 @@ var init_plugin_context = __esm({
27048
27041
 
27049
27042
  // src/core/plugin/lifecycle-manager.ts
27050
27043
  function withTimeout(promise, ms, label) {
27051
- return new Promise((resolve9, reject) => {
27044
+ return new Promise((resolve8, reject) => {
27052
27045
  const timer = setTimeout(() => reject(new Error(`Timeout: ${label} exceeded ${ms}ms`)), ms);
27053
27046
  if (typeof timer === "object" && timer !== null && "unref" in timer) {
27054
27047
  ;
27055
27048
  timer.unref();
27056
27049
  }
27057
- promise.then(resolve9, reject).finally(() => clearTimeout(timer));
27050
+ promise.then(resolve8, reject).finally(() => clearTimeout(timer));
27058
27051
  });
27059
27052
  }
27060
27053
  function resolvePluginConfig(pluginName, configManager) {
@@ -32541,7 +32534,7 @@ function showInteractiveMenu(options) {
32541
32534
  }
32542
32535
  }
32543
32536
  console.log("");
32544
- return new Promise((resolve9) => {
32537
+ return new Promise((resolve8) => {
32545
32538
  process.stdin.setRawMode(true);
32546
32539
  process.stdin.resume();
32547
32540
  const onData = async (buf) => {
@@ -32560,7 +32553,7 @@ function showInteractiveMenu(options) {
32560
32553
  console.error(err);
32561
32554
  process.exit(1);
32562
32555
  }
32563
- resolve9(true);
32556
+ resolve8(true);
32564
32557
  }
32565
32558
  };
32566
32559
  const cleanup = () => {
@@ -33882,7 +33875,7 @@ Shows the version of the currently running daemon process.
33882
33875
  const state = toggle === "on" ? "enabled" : "disabled";
33883
33876
  console.log(`Bypass permissions ${state} for session ${sessionId}`);
33884
33877
  } else if (subCmd === "health") {
33885
- const res = await call("/api/health");
33878
+ const res = await call("/api/v1/system/health/details");
33886
33879
  const data = await res.json();
33887
33880
  if (!res.ok) {
33888
33881
  if (json) jsonError(ErrorCodes.API_ERROR, extractApiError(data));
@@ -33908,7 +33901,7 @@ Shows the version of the currently running daemon process.
33908
33901
  console.log(`Adapters : ${adapters}`);
33909
33902
  console.log(`Tunnel : ${tunnelStr}`);
33910
33903
  } else if (subCmd === "restart") {
33911
- const res = await call("/api/restart", { method: "POST" });
33904
+ const res = await call("/api/v1/system/restart", { method: "POST" });
33912
33905
  const data = await res.json();
33913
33906
  if (!res.ok) {
33914
33907
  if (json) jsonError(ErrorCodes.API_ERROR, extractApiError(data));
@@ -33967,7 +33960,7 @@ Shows the version of the currently running daemon process.
33967
33960
  process.exit(1);
33968
33961
  }
33969
33962
  } else if (subCmd === "adapters") {
33970
- const res = await call("/api/adapters");
33963
+ const res = await call("/api/v1/system/adapters");
33971
33964
  const data = await res.json();
33972
33965
  if (!res.ok) {
33973
33966
  if (json) jsonError(ErrorCodes.API_ERROR, String(data.error ?? "API request failed"));
@@ -34015,7 +34008,7 @@ Shows the version of the currently running daemon process.
34015
34008
  if (json) jsonSuccess({ sent: true });
34016
34009
  console.log("Notification sent to all channels.");
34017
34010
  } else if (subCmd === "version") {
34018
- const res = await call("/api/version");
34011
+ const res = await call("/api/v1/system/version");
34019
34012
  const data = await res.json();
34020
34013
  if (!res.ok) {
34021
34014
  if (json) jsonError(ErrorCodes.API_ERROR, extractApiError(data));