multiclaws 0.4.11 → 0.4.13

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.
Files changed (2) hide show
  1. package/dist/infra/frp.js +10 -4
  2. package/package.json +1 -1
package/dist/infra/frp.js CHANGED
@@ -233,7 +233,9 @@ class FrpTunnelManager {
233
233
  }
234
234
  /* ── Private: poll admin API ──────────────────────────────────── */
235
235
  async waitForProxy(proxyName) {
236
- const url = `http://127.0.0.1:${this.adminPort}/api/proxy/tcp`;
236
+ // frpc 0.61.x uses /api/status (returns { tcp: [...], udp: [...], ... })
237
+ // older versions used /api/proxy/tcp (returns flat array or { proxies: [...] })
238
+ const statusUrl = `http://127.0.0.1:${this.adminPort}/api/status`;
237
239
  for (let attempt = 0; attempt < ADMIN_API_POLL_MAX_RETRIES; attempt++) {
238
240
  await new Promise((r) => setTimeout(r, ADMIN_API_POLL_INTERVAL_MS));
239
241
  // Check if process has already exited
@@ -241,11 +243,13 @@ class FrpTunnelManager {
241
243
  throw new Error("frpc process exited before proxy became ready");
242
244
  }
243
245
  try {
244
- const res = await fetch(url, { signal: AbortSignal.timeout(3_000) });
246
+ const res = await fetch(statusUrl, { signal: AbortSignal.timeout(3_000) });
245
247
  if (!res.ok)
246
248
  continue;
247
249
  const data = (await res.json());
248
- const proxy = data.proxies?.find((p) => p.name === proxyName);
250
+ // /api/status groups proxies by type: { tcp: [...], udp: [...], ... }
251
+ const tcpProxies = data.tcp ?? [];
252
+ const proxy = tcpProxies.find((p) => p.name === proxyName);
249
253
  if (!proxy)
250
254
  continue;
251
255
  if (proxy.status === "running") {
@@ -272,13 +276,15 @@ class FrpTunnelManager {
272
276
  if (this._status.status !== "running")
273
277
  return;
274
278
  try {
275
- const res = await fetch(`http://127.0.0.1:${this.adminPort}/api/proxy/tcp`, { signal: AbortSignal.timeout(5_000) });
279
+ const res = await fetch(`http://127.0.0.1:${this.adminPort}/api/status`, { signal: AbortSignal.timeout(5_000) });
276
280
  if (!res.ok) {
277
281
  this.logger.warn("[frp] health check: admin API returned non-OK");
282
+ this._status = { status: "error", reason: "admin API returned non-OK status" };
278
283
  }
279
284
  }
280
285
  catch {
281
286
  this.logger.warn("[frp] health check: failed to reach admin API");
287
+ this._status = { status: "error", reason: "admin API unreachable" };
282
288
  }
283
289
  }, HEALTH_CHECK_INTERVAL_MS);
284
290
  // Don't prevent Node from exiting
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "multiclaws",
3
- "version": "0.4.11",
3
+ "version": "0.4.13",
4
4
  "description": "MultiClaws plugin for OpenClaw collaboration via A2A protocol",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",