wechat-to-anything 0.6.10 → 0.6.12
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/cli/agent-adapter.mjs +1 -2
- package/cli/bridge.mjs +4 -6
- package/cli/weixin.mjs +1 -1
- package/package.json +1 -1
package/cli/agent-adapter.mjs
CHANGED
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
* - cli://gemini → 内置 Gemini CLI 适配器
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import { execFile } from "node:child_process";
|
|
12
11
|
import { writeFile, readFile, unlink, mkdir } from "node:fs/promises";
|
|
13
12
|
import { join } from "node:path";
|
|
14
13
|
import { tmpdir } from "node:os";
|
|
@@ -219,7 +218,7 @@ function runClaude(prompt) {
|
|
|
219
218
|
|
|
220
219
|
function runOpenClaw(prompt) {
|
|
221
220
|
return new Promise((resolve, reject) => {
|
|
222
|
-
const child =
|
|
221
|
+
const child = crossSpawn("openclaw", [
|
|
223
222
|
"agent", "--agent", "main",
|
|
224
223
|
"--message", prompt, "--json",
|
|
225
224
|
], {
|
package/cli/bridge.mjs
CHANGED
|
@@ -30,19 +30,17 @@ export async function start(agents, defaultAgent, { port = 9099 } = {}) {
|
|
|
30
30
|
if (!creds) {
|
|
31
31
|
console.log(pc.yellow("📱 首次使用,请扫码登录微信\n"));
|
|
32
32
|
try {
|
|
33
|
-
creds = await loginWithQR(async (
|
|
33
|
+
creds = await loginWithQR(async (qrUrl) => {
|
|
34
34
|
try {
|
|
35
35
|
const qrt = await import("qrcode-terminal");
|
|
36
36
|
await new Promise((resolve) => {
|
|
37
|
-
qrt.default.generate(
|
|
37
|
+
qrt.default.generate(qrUrl, { small: true }, (qr) => {
|
|
38
38
|
console.log(qr);
|
|
39
39
|
resolve();
|
|
40
40
|
});
|
|
41
41
|
});
|
|
42
|
-
} catch {
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
console.log(pc.dim(` 浏览器扫码备用: ${qrImgUrl}`));
|
|
42
|
+
} catch {}
|
|
43
|
+
console.log(pc.dim(` 扫码链接: ${qrUrl}\n`));
|
|
46
44
|
});
|
|
47
45
|
console.log(pc.green("✅ 微信登录成功!"));
|
|
48
46
|
} catch (err) {
|
package/cli/weixin.mjs
CHANGED
|
@@ -82,7 +82,7 @@ export async function pollQRStatus(qrcode) {
|
|
|
82
82
|
*/
|
|
83
83
|
export async function loginWithQR(onQrCode) {
|
|
84
84
|
const qr = await getQRCode();
|
|
85
|
-
await onQrCode(qr.
|
|
85
|
+
await onQrCode(qr.qrcode_img_content);
|
|
86
86
|
|
|
87
87
|
const deadline = Date.now() + 5 * 60_000; // 5 min
|
|
88
88
|
while (Date.now() < deadline) {
|