@matelink/cli 2026.4.19 → 2026.4.21
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/matecli.mjs +15 -15
- package/package.json +1 -1
package/bin/matecli.mjs
CHANGED
|
@@ -21,7 +21,7 @@ const GROUP_SIZE = 4;
|
|
|
21
21
|
const DEFAULT_RELAY_WORKER_WAIT_SECONDS = 600;
|
|
22
22
|
const DEFAULT_NETWORK_TIMEOUT_MS = 600000;
|
|
23
23
|
const BRIDGE_RETRY_DELAY_MS = 2000;
|
|
24
|
-
const DEFAULT_RELAY_URL = "
|
|
24
|
+
const DEFAULT_RELAY_URL = "https://test-mate.clipzap.ai";
|
|
25
25
|
const DEFAULT_GATEWAY_HOST = "127.0.0.1";
|
|
26
26
|
const DEFAULT_WEBHOOK_PATH = "/testnextim/webhook";
|
|
27
27
|
const DEFAULT_BIND_PATH = "/testnextim/bind";
|
|
@@ -1650,12 +1650,12 @@ async function readRelayGatewayBinding({
|
|
|
1650
1650
|
gatewayToken,
|
|
1651
1651
|
}) {
|
|
1652
1652
|
const url = `${trimSlash(relayUrl)}/v1/gateways/${encodeURIComponent(gatewayId)}/binding`;
|
|
1653
|
-
const response = await
|
|
1653
|
+
const response = await fetchWithTimeout(url, {
|
|
1654
1654
|
method: "GET",
|
|
1655
1655
|
headers: {
|
|
1656
1656
|
...relayGatewayHeaders(gatewayToken),
|
|
1657
1657
|
},
|
|
1658
|
-
});
|
|
1658
|
+
}, 30000);
|
|
1659
1659
|
const text = await response.text();
|
|
1660
1660
|
const decoded = text ? safeJsonParse(text) : null;
|
|
1661
1661
|
if (response.status === 404) {
|
|
@@ -1691,12 +1691,12 @@ async function resetRelayGatewayBinding({
|
|
|
1691
1691
|
gatewayToken,
|
|
1692
1692
|
}) {
|
|
1693
1693
|
const url = `${trimSlash(relayUrl)}/v1/gateways/${encodeURIComponent(gatewayId)}/reset`;
|
|
1694
|
-
const response = await
|
|
1694
|
+
const response = await fetchWithTimeout(url, {
|
|
1695
1695
|
method: "POST",
|
|
1696
1696
|
headers: {
|
|
1697
1697
|
...relayGatewayHeaders(gatewayToken),
|
|
1698
1698
|
},
|
|
1699
|
-
});
|
|
1699
|
+
}, 30000);
|
|
1700
1700
|
const text = await response.text();
|
|
1701
1701
|
const decoded = text ? safeJsonParse(text) : null;
|
|
1702
1702
|
if (response.status === 404) {
|
|
@@ -2375,11 +2375,11 @@ async function probeGatewayResponsesEndpoint({
|
|
|
2375
2375
|
}
|
|
2376
2376
|
|
|
2377
2377
|
try {
|
|
2378
|
-
const response = await
|
|
2378
|
+
const response = await fetchWithTimeout(url, {
|
|
2379
2379
|
method: "POST",
|
|
2380
2380
|
headers,
|
|
2381
2381
|
body: JSON.stringify({}),
|
|
2382
|
-
});
|
|
2382
|
+
}, 10000);
|
|
2383
2383
|
return {
|
|
2384
2384
|
ok: ![401, 403, 404].includes(response.status),
|
|
2385
2385
|
status: response.status,
|
|
@@ -2483,7 +2483,7 @@ async function publishPairToRelay({
|
|
|
2483
2483
|
"content-type": "application/json",
|
|
2484
2484
|
...relayAuthHeaders(),
|
|
2485
2485
|
};
|
|
2486
|
-
const response = await
|
|
2486
|
+
const response = await fetchWithTimeout(url, {
|
|
2487
2487
|
method: "POST",
|
|
2488
2488
|
headers,
|
|
2489
2489
|
body: JSON.stringify({
|
|
@@ -2513,7 +2513,7 @@ async function publishPairToRelay({
|
|
|
2513
2513
|
|
|
2514
2514
|
async function readPairSessionFromRelay({ relayUrl, code }) {
|
|
2515
2515
|
const url = `${relayUrl}/v1/pair-sessions/${encodeURIComponent(code)}`;
|
|
2516
|
-
const response = await
|
|
2516
|
+
const response = await fetchWithTimeout(url, { method: "GET" }, 30000);
|
|
2517
2517
|
const text = await response.text();
|
|
2518
2518
|
const decoded = text ? safeJsonParse(text) : null;
|
|
2519
2519
|
if (response.status === 404) {
|
|
@@ -2557,12 +2557,12 @@ async function readRelayNextBindRequest({ relayUrl, code, after, waitSeconds })
|
|
|
2557
2557
|
}
|
|
2558
2558
|
url.searchParams.set("waitSeconds", String(waitSeconds));
|
|
2559
2559
|
|
|
2560
|
-
const response = await
|
|
2560
|
+
const response = await fetchWithTimeout(url, {
|
|
2561
2561
|
method: "GET",
|
|
2562
2562
|
headers: {
|
|
2563
2563
|
...relayAuthHeaders(),
|
|
2564
2564
|
},
|
|
2565
|
-
});
|
|
2565
|
+
}, 95000);
|
|
2566
2566
|
|
|
2567
2567
|
if (response.status === 204) {
|
|
2568
2568
|
return null;
|
|
@@ -2601,14 +2601,14 @@ async function readRelayNextBindRequest({ relayUrl, code, after, waitSeconds })
|
|
|
2601
2601
|
|
|
2602
2602
|
async function publishRelayBindResult({ relayUrl, code, payload }) {
|
|
2603
2603
|
const url = `${relayUrl}/v1/pair-sessions/${encodeURIComponent(code)}/bind-results`;
|
|
2604
|
-
const response = await
|
|
2604
|
+
const response = await fetchWithTimeout(url, {
|
|
2605
2605
|
method: "POST",
|
|
2606
2606
|
headers: {
|
|
2607
2607
|
"content-type": "application/json",
|
|
2608
2608
|
...relayAuthHeaders(),
|
|
2609
2609
|
},
|
|
2610
2610
|
body: JSON.stringify(payload),
|
|
2611
|
-
});
|
|
2611
|
+
}, 30000);
|
|
2612
2612
|
|
|
2613
2613
|
const text = await response.text();
|
|
2614
2614
|
if (!response.ok) {
|
|
@@ -3543,11 +3543,11 @@ async function proxyGatewayRequestLocal({
|
|
|
3543
3543
|
|
|
3544
3544
|
let response;
|
|
3545
3545
|
try {
|
|
3546
|
-
response = await
|
|
3546
|
+
response = await fetchWithTimeout(localUrl, {
|
|
3547
3547
|
method: "POST",
|
|
3548
3548
|
headers,
|
|
3549
3549
|
body: JSON.stringify(payload),
|
|
3550
|
-
});
|
|
3550
|
+
}, DEFAULT_NETWORK_TIMEOUT_MS);
|
|
3551
3551
|
} catch (error) {
|
|
3552
3552
|
await publishRelayGatewayEvent({
|
|
3553
3553
|
relayUrl,
|