claude-codex-wechat 0.1.21 → 0.1.23
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/server/cli.js
CHANGED
|
@@ -12,7 +12,7 @@ import { networkInterfaces } from "node:os";
|
|
|
12
12
|
// src/daemon/server.ts
|
|
13
13
|
import { mkdtempSync } from "node:fs";
|
|
14
14
|
import { tmpdir as tmpdir2 } from "node:os";
|
|
15
|
-
import { dirname as
|
|
15
|
+
import { dirname as dirname11, join as join10 } from "node:path";
|
|
16
16
|
import Fastify from "fastify";
|
|
17
17
|
|
|
18
18
|
// src/channels/platforms.ts
|
|
@@ -4450,6 +4450,20 @@ var RelayTunnelRouter = class {
|
|
|
4450
4450
|
}
|
|
4451
4451
|
};
|
|
4452
4452
|
|
|
4453
|
+
// src/shared/version.ts
|
|
4454
|
+
import { readFileSync as readFileSync7 } from "node:fs";
|
|
4455
|
+
import { dirname as dirname10, join as join9 } from "node:path";
|
|
4456
|
+
import { fileURLToPath } from "node:url";
|
|
4457
|
+
function readClientVersion() {
|
|
4458
|
+
try {
|
|
4459
|
+
const here2 = dirname10(fileURLToPath(import.meta.url));
|
|
4460
|
+
const pkg = JSON.parse(readFileSync7(join9(here2, "..", "..", "package.json"), "utf8"));
|
|
4461
|
+
return typeof pkg.version === "string" && pkg.version ? pkg.version : "0.0.0";
|
|
4462
|
+
} catch {
|
|
4463
|
+
return "0.0.0";
|
|
4464
|
+
}
|
|
4465
|
+
}
|
|
4466
|
+
|
|
4453
4467
|
// src/daemon/server.ts
|
|
4454
4468
|
function readUpdateStatusBestEffort(configPath) {
|
|
4455
4469
|
if (!configPath) return { ok: false };
|
|
@@ -4462,7 +4476,7 @@ function readUpdateStatusBestEffort(configPath) {
|
|
|
4462
4476
|
function createDaemonServer(options = {}) {
|
|
4463
4477
|
const app = Fastify({ logger: true });
|
|
4464
4478
|
const events = new BridgeEventHub();
|
|
4465
|
-
const configPath = options.configPath ?? process.env.BRIDGE_CONFIG ??
|
|
4479
|
+
const configPath = options.configPath ?? process.env.BRIDGE_CONFIG ?? join10(mkdtempSync(join10(tmpdir2(), "claude-codex-wechat-")), "config.json");
|
|
4466
4480
|
const persistedConfig = loadBridgeConfig(configPath);
|
|
4467
4481
|
const bridgeDefaults = {
|
|
4468
4482
|
defaultProvider: options.bridgeDefaults?.defaultProvider ?? persistedConfig.bridge?.defaultProvider ?? "claude-code",
|
|
@@ -4519,7 +4533,7 @@ function createDaemonServer(options = {}) {
|
|
|
4519
4533
|
});
|
|
4520
4534
|
}
|
|
4521
4535
|
const weixinStateStore = configPath ? new FileWeixinStateStore(configPath) : void 0;
|
|
4522
|
-
const weixinMediaDir = configPath ?
|
|
4536
|
+
const weixinMediaDir = configPath ? join10(dirname11(configPath), "media") : void 0;
|
|
4523
4537
|
const managedWechatChannel = options.channel ? null : new ManagedWeixinDirectAdapter(options.wechat, weixinStateStore, weixinMediaDir);
|
|
4524
4538
|
const channel = options.channel ?? managedWechatChannel;
|
|
4525
4539
|
const weixinOutboundGate = managedWechatChannel && weixinStateStore ? new WeixinOutboundGate({
|
|
@@ -4634,6 +4648,7 @@ function createDaemonServer(options = {}) {
|
|
|
4634
4648
|
const update = read.ok ? read.update ?? null : persistedConfig.update ?? null;
|
|
4635
4649
|
return {
|
|
4636
4650
|
ok: true,
|
|
4651
|
+
version: readClientVersion(),
|
|
4637
4652
|
sessions: conversation.getCurrent() ? [conversation.getCurrent()] : [],
|
|
4638
4653
|
update,
|
|
4639
4654
|
preferredLocalUrl: (() => {
|
|
@@ -4750,20 +4765,6 @@ function createUpdateChecker(opts) {
|
|
|
4750
4765
|
};
|
|
4751
4766
|
}
|
|
4752
4767
|
|
|
4753
|
-
// src/shared/version.ts
|
|
4754
|
-
import { readFileSync as readFileSync7 } from "node:fs";
|
|
4755
|
-
import { dirname as dirname11, join as join10 } from "node:path";
|
|
4756
|
-
import { fileURLToPath } from "node:url";
|
|
4757
|
-
function readClientVersion() {
|
|
4758
|
-
try {
|
|
4759
|
-
const here2 = dirname11(fileURLToPath(import.meta.url));
|
|
4760
|
-
const pkg = JSON.parse(readFileSync7(join10(here2, "..", "..", "package.json"), "utf8"));
|
|
4761
|
-
return typeof pkg.version === "string" && pkg.version ? pkg.version : "0.0.0";
|
|
4762
|
-
} catch {
|
|
4763
|
-
return "0.0.0";
|
|
4764
|
-
}
|
|
4765
|
-
}
|
|
4766
|
-
|
|
4767
4768
|
// src/daemon/bootstrap.ts
|
|
4768
4769
|
async function startDaemon(options) {
|
|
4769
4770
|
const port = options.port ?? Number(process.env.BRIDGE_PORT ?? 8787);
|