@clawos-dev/clawd 0.2.210 → 0.2.211-beta.422.937132d

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/cli.cjs +20 -2
  2. package/package.json +1 -1
package/dist/cli.cjs CHANGED
@@ -53873,6 +53873,8 @@ function pumpClientToOutbound(client, outbound, peerDeviceId, peerDisplayName, d
53873
53873
  let bytesClientToOutbound = 0;
53874
53874
  let bytesOutboundToClient = 0;
53875
53875
  let settled = false;
53876
+ const preOpenQueue = [];
53877
+ let preOpenQueuedBytes = 0;
53876
53878
  const cleanup = (reason, code = 1e3) => {
53877
53879
  if (settled) return;
53878
53880
  settled = true;
@@ -53902,9 +53904,20 @@ function pumpClientToOutbound(client, outbound, peerDeviceId, peerDisplayName, d
53902
53904
  };
53903
53905
  outbound.on("open", () => {
53904
53906
  outboundOpened = true;
53907
+ const queuedFrames = preOpenQueue.length;
53908
+ if (queuedFrames > 0) {
53909
+ for (const buf of preOpenQueue) outbound.send(buf, { binary: true });
53910
+ preOpenQueue.length = 0;
53911
+ sshLog.info(
53912
+ "relay.preopen-flush",
53913
+ "outbound \u5C31\u7EEA\u524D\u7F13\u51B2\u7684 client \u5B57\u8282\u5DF2\u6309\u5E8F flush\uFF08\u542B SSH banner\uFF09",
53914
+ { peerDeviceId, peerDisplayName, queuedFrames, queuedBytes: preOpenQueuedBytes }
53915
+ );
53916
+ }
53905
53917
  sshLog.info("relay.dial-open", "outbound ws open\uFF0C\u8FDB\u5165\u53CC\u5411 pipe", {
53906
53918
  peerDeviceId,
53907
- peerDisplayName
53919
+ peerDisplayName,
53920
+ preOpenQueuedFrames: queuedFrames
53908
53921
  });
53909
53922
  });
53910
53923
  outbound.on("message", (data) => {
@@ -53929,7 +53942,12 @@ function pumpClientToOutbound(client, outbound, peerDeviceId, peerDisplayName, d
53929
53942
  const buf = toBuffer(data);
53930
53943
  if (!buf) return;
53931
53944
  bytesClientToOutbound += buf.length;
53932
- if (outbound.readyState === outbound.OPEN) outbound.send(buf, { binary: true });
53945
+ if (outbound.readyState === outbound.OPEN) {
53946
+ outbound.send(buf, { binary: true });
53947
+ } else {
53948
+ preOpenQueue.push(buf);
53949
+ preOpenQueuedBytes += buf.length;
53950
+ }
53933
53951
  });
53934
53952
  client.on("close", () => cleanup("client close", 1e3));
53935
53953
  client.on("error", (err) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clawos-dev/clawd",
3
- "version": "0.2.210",
3
+ "version": "0.2.211-beta.422.937132d",
4
4
  "description": "Standalone clawd daemon — Claude Code (and future Codex) session server over WebSocket",
5
5
  "type": "module",
6
6
  "license": "MIT",