claudexor 5.0.2 → 6.0.0

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/bin/claudexord.js CHANGED
@@ -2,5 +2,14 @@
2
2
  // Daemon entry wrapper (same contract as the claudexor bin). The boot is an
3
3
  // EXPLICIT call — the module import itself is side-effect-free (X228/X231),
4
4
  // so a wrapper path in argv[1] can never silently skip the daemon start.
5
- import { runClaudexordEntry } from "@claudexor/cli/claudexord";
5
+ //
6
+ // UV_THREADPOOL_SIZE is read when libuv creates its pool, on the first
7
+ // filesystem or dns.lookup call. A static import of the daemon graph would
8
+ // do that before this file could assign the variable, so the graph is loaded
9
+ // only after the assignment. An operator-set value is left as it is.
10
+ import { applyHostLibuvPool } from "./libuv-pool.js";
11
+
12
+ applyHostLibuvPool();
13
+
14
+ const { runClaudexordEntry } = await import("@claudexor/cli/claudexord");
6
15
  runClaudexordEntry();
@@ -0,0 +1,39 @@
1
+ import { stat } from "node:fs";
2
+ import os from "node:os";
3
+
4
+ /** libuv refuses a pool above this (MAX_THREADPOOL_SIZE). */
5
+ export const LIBUV_POOL_MAX = 1024;
6
+
7
+ /**
8
+ * The size this process applied itself. The variable is removed again, so the
9
+ * store's upload gate reads this instead. Same key as
10
+ * `packages/cli/src/host-libuv-pool.ts` and the daemon's `store/libuv-pool.ts`.
11
+ */
12
+ const APPLIED_POOL = Symbol.for("claudexor.libuvPoolSize");
13
+
14
+ /**
15
+ * Threads for this machine: parallelism plus four, at least 8, at most
16
+ * libuv's maximum. A physical pool size, not a policy. Four blocked upload
17
+ * writes filled the default of 4 and `dns.lookup("localhost")` did not start
18
+ * within 400 ms, while the request loop still ticked (46 ticks, mean 12 ms,
19
+ * max 16 ms). Same formula as `packages/cli/src/host-libuv-pool.ts`.
20
+ */
21
+ export function hostLibuvPoolSize() {
22
+ return Math.min(LIBUV_POOL_MAX, Math.max(8, os.availableParallelism() + 4));
23
+ }
24
+
25
+ /**
26
+ * An operator-set value is left untouched, including one libuv will clamp, and
27
+ * harness children inherit it. Otherwise assign the host size and submit one
28
+ * stat: libuv creates its pool on that first request, synchronously, reading
29
+ * the variable once. Then record the size and remove the variable, so harness
30
+ * children (and their tools and servers) start with their own default pool.
31
+ */
32
+ export function applyHostLibuvPool() {
33
+ if (process.env.UV_THREADPOOL_SIZE || globalThis[APPLIED_POOL] !== undefined) return;
34
+ const size = hostLibuvPoolSize();
35
+ process.env.UV_THREADPOOL_SIZE = String(size);
36
+ stat(".", () => undefined);
37
+ globalThis[APPLIED_POOL] = size;
38
+ delete process.env.UV_THREADPOOL_SIZE;
39
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claudexor",
3
- "version": "5.0.2",
3
+ "version": "6.0.0",
4
4
  "description": "Local-first multi-harness control plane for Claude Code, Codex, Cursor, and OpenCode with quota-aware rotation across multiple Claude Code and Codex subscriptions.",
5
5
  "mcpName": "io.github.razzant/claudexor",
6
6
  "type": "module",
@@ -12,7 +12,7 @@
12
12
  "bin"
13
13
  ],
14
14
  "dependencies": {
15
- "@claudexor/cli": "5.0.2"
15
+ "@claudexor/cli": "6.0.0"
16
16
  },
17
17
  "keywords": [
18
18
  "ai",