@agent-wechat/cli 2.1.0 → 2.2.1
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/native-release.json +17 -17
- package/package.json +1 -1
- package/scripts/native-runtime.mjs +5 -3
package/native-release.json
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"version": "2.1
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"repository": "thisnick/agent-wechat",
|
|
5
|
-
"sourceCommit": "
|
|
5
|
+
"sourceCommit": "811d090770dd7b682b5bf69d54fc6fbd522cbe9b",
|
|
6
6
|
"sourceTreeDirty": false,
|
|
7
7
|
"assets": [
|
|
8
8
|
{
|
|
9
|
-
"name": "wx-v2.1
|
|
9
|
+
"name": "wx-v2.2.1-darwin-arm64",
|
|
10
10
|
"platform": "darwin",
|
|
11
11
|
"arch": "arm64",
|
|
12
12
|
"rustTarget": "aarch64-apple-darwin",
|
|
13
|
-
"bytes":
|
|
14
|
-
"sha256": "
|
|
13
|
+
"bytes": 34433984,
|
|
14
|
+
"sha256": "128d1def0550dd3e76351c07c26c299d1c74a7cafad769320aaeb1722211068d"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
|
-
"name": "wx-v2.1
|
|
17
|
+
"name": "wx-v2.2.1-linux-arm64-gnu",
|
|
18
18
|
"platform": "linux",
|
|
19
19
|
"arch": "arm64",
|
|
20
20
|
"libc": "gnu",
|
|
21
21
|
"minimumGlibc": "2.36",
|
|
22
22
|
"rustTarget": "aarch64-unknown-linux-gnu",
|
|
23
|
-
"bytes":
|
|
24
|
-
"sha256": "
|
|
23
|
+
"bytes": 39749968,
|
|
24
|
+
"sha256": "5b7e12f4d1585ae1cd7d541bad2207f4f53c4eec0b5ad53651278e0eb3347468"
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
|
-
"name": "wx-v2.1
|
|
27
|
+
"name": "wx-v2.2.1-linux-x64-gnu",
|
|
28
28
|
"platform": "linux",
|
|
29
29
|
"arch": "x64",
|
|
30
30
|
"libc": "gnu",
|
|
31
31
|
"minimumGlibc": "2.36",
|
|
32
32
|
"rustTarget": "x86_64-unknown-linux-gnu",
|
|
33
|
-
"bytes":
|
|
34
|
-
"sha256": "
|
|
33
|
+
"bytes": 42914864,
|
|
34
|
+
"sha256": "d95b3fa9a0be0f858c1898d22bf0c45ab837195eaa364c418acca1791d3aad8c"
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
|
-
"name": "wx-v2.1
|
|
37
|
+
"name": "wx-v2.2.1-win32-arm64.exe",
|
|
38
38
|
"platform": "win32",
|
|
39
39
|
"arch": "arm64",
|
|
40
40
|
"rustTarget": "aarch64-pc-windows-msvc",
|
|
41
|
-
"bytes":
|
|
42
|
-
"sha256": "
|
|
41
|
+
"bytes": 31325184,
|
|
42
|
+
"sha256": "da713b24c73f1b9ca301bcb52e7518e70e4b0a6c8afa1ca38a506e94150cea68"
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
|
-
"name": "wx-v2.1
|
|
45
|
+
"name": "wx-v2.2.1-win32-x64.exe",
|
|
46
46
|
"platform": "win32",
|
|
47
47
|
"arch": "x64",
|
|
48
48
|
"rustTarget": "x86_64-pc-windows-msvc",
|
|
49
|
-
"bytes":
|
|
50
|
-
"sha256": "
|
|
49
|
+
"bytes": 38180864,
|
|
50
|
+
"sha256": "abd41b969c25a8e0c9e016ad64b96fa78f51d0683da5b8c3763ab4c727cdab73"
|
|
51
51
|
}
|
|
52
52
|
]
|
|
53
53
|
}
|
package/package.json
CHANGED
|
@@ -68,10 +68,10 @@ export async function readManifest(root = packageRoot) {
|
|
|
68
68
|
const manifest = JSON.parse(data);
|
|
69
69
|
return { version: pkg.version, manifest, asset: validateManifest(manifest, pkg.version) };
|
|
70
70
|
}
|
|
71
|
-
export async function fetchBytes(url, maxBytes, { fetchImpl = fetch, allowHttpLoopback = false } = {}) {
|
|
71
|
+
export async function fetchBytes(url, maxBytes, { fetchImpl = fetch, allowHttpLoopback = false, timeoutMs = 30_000 } = {}) {
|
|
72
72
|
let current = new URL(url);
|
|
73
73
|
if (current.protocol === 'https:' && process.env.NODE_TLS_REJECT_UNAUTHORIZED === '0') throw new Error('Native downloads refuse disabled TLS verification');
|
|
74
|
-
const signal = AbortSignal.timeout(
|
|
74
|
+
const signal = AbortSignal.timeout(timeoutMs);
|
|
75
75
|
for (let redirects = 0; redirects <= 3; redirects++) {
|
|
76
76
|
const testLocal = allowHttpLoopback && current.protocol === 'http:' && ['127.0.0.1', '[::1]'].includes(current.hostname);
|
|
77
77
|
if (current.username || current.password || current.hash || (!testLocal && (current.protocol !== 'https:' || !allowedDownloadHosts.has(current.hostname) || current.port))) {
|
|
@@ -138,7 +138,9 @@ export async function installNative({ root = packageRoot, artifactDir, fetchOpti
|
|
|
138
138
|
if (!info.isFile() || info.isSymbolicLink() || info.size !== asset.bytes) throw new Error('Invalid offline native release file');
|
|
139
139
|
bytes = await readFile(source);
|
|
140
140
|
} else {
|
|
141
|
-
bytes = await fetchBytes(downloadUrl ?? releaseUrl(version, asset.name), asset.bytes,
|
|
141
|
+
bytes = await fetchBytes(downloadUrl ?? releaseUrl(version, asset.name), asset.bytes, {
|
|
142
|
+
...fetchOptions, timeoutMs: 300_000,
|
|
143
|
+
});
|
|
142
144
|
}
|
|
143
145
|
verifyBytes(bytes, asset);
|
|
144
146
|
const destination = installPath(root, version);
|