claude-codex-wechat 0.1.44 → 0.1.46
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 +19 -2
- package/package.json +1 -1
package/dist/server/cli.js
CHANGED
|
@@ -5651,12 +5651,29 @@ async function startDaemon(options) {
|
|
|
5651
5651
|
configPath,
|
|
5652
5652
|
...options.tunnelProvider ? { tunnelProvider: options.tunnelProvider } : {}
|
|
5653
5653
|
});
|
|
5654
|
+
const relayAuthToken = ensureRelayAuthTokenSync({ configPath });
|
|
5655
|
+
const relayServerUrl = bridgeDefaults.tunnel.relay?.serverUrl ?? "wss://wechat.style520.com/agent";
|
|
5656
|
+
await persistBridgeDefaultsToConfigFile({
|
|
5657
|
+
configPath,
|
|
5658
|
+
defaultProvider: bridgeDefaults.defaultProvider,
|
|
5659
|
+
defaultWorkspace: bridgeDefaults.defaultWorkspace,
|
|
5660
|
+
tunnel: {
|
|
5661
|
+
relay: {
|
|
5662
|
+
serverUrl: relayServerUrl,
|
|
5663
|
+
authToken: relayAuthToken
|
|
5664
|
+
}
|
|
5665
|
+
}
|
|
5666
|
+
}).catch((error) => {
|
|
5667
|
+
console.warn("[config] \u5199\u5165 bridge/relay \u9ED8\u8BA4\u503C\u5931\u8D25\uFF1A", error instanceof Error ? error.message : String(error));
|
|
5668
|
+
});
|
|
5654
5669
|
await options.attachFrontend(app);
|
|
5655
5670
|
await app.listen({ host, port });
|
|
5656
5671
|
const address = app.server.address();
|
|
5657
5672
|
const actualPort = typeof address === "object" && address ? address.port : port;
|
|
5658
|
-
if (
|
|
5659
|
-
|
|
5673
|
+
if (relayServerUrl && relayAuthToken) {
|
|
5674
|
+
void resolvedTunnelProvider?.start().catch((error) => {
|
|
5675
|
+
console.warn("[relay] \u96A7\u9053\u540E\u53F0\u542F\u52A8\u5931\u8D25\uFF0C\u5C06\u81EA\u52A8\u91CD\u8FDE\uFF1A", error instanceof Error ? error.message : String(error));
|
|
5676
|
+
});
|
|
5660
5677
|
}
|
|
5661
5678
|
if (options.enableUpdateCheck) {
|
|
5662
5679
|
createUpdateChecker({ currentVersion: readClientVersion(), configPath }).start().catch(() => void 0);
|