replicas-cli 0.3.158 → 0.3.160

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/index.cjs +5 -4
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -29073,7 +29073,7 @@ var headlessAgentRequestSchema = external_exports.object({
29073
29073
  });
29074
29074
 
29075
29075
  // ../shared/src/cli-version.ts
29076
- var CLI_VERSION = "0.3.158";
29076
+ var CLI_VERSION = "0.3.160";
29077
29077
 
29078
29078
  // ../shared/src/version.ts
29079
29079
  function compareVersions(v1, v2) {
@@ -29848,13 +29848,14 @@ function parseSseChunk(chunk) {
29848
29848
  return null;
29849
29849
  }
29850
29850
  }
29851
- async function* iterateSseStream(body) {
29851
+ async function* iterateSseStream(body, onChunk) {
29852
29852
  const reader = body.getReader();
29853
29853
  const decoder2 = new TextDecoder();
29854
29854
  let buffer = "";
29855
29855
  while (true) {
29856
29856
  const { done, value } = await reader.read();
29857
29857
  if (done) break;
29858
+ onChunk?.();
29858
29859
  buffer += decoder2.decode(value, { stream: true });
29859
29860
  const chunks = buffer.split("\n\n");
29860
29861
  buffer = chunks.pop() ?? "";
@@ -29864,9 +29865,9 @@ async function* iterateSseStream(body) {
29864
29865
  }
29865
29866
  }
29866
29867
  }
29867
- async function readSseStream(body, onEvent, shouldContinue = () => true) {
29868
+ async function readSseStream(body, onEvent, shouldContinue = () => true, onChunk) {
29868
29869
  if (!shouldContinue()) return;
29869
- for await (const event of iterateSseStream(body)) {
29870
+ for await (const event of iterateSseStream(body, onChunk)) {
29870
29871
  if (!shouldContinue()) break;
29871
29872
  await onEvent(event);
29872
29873
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.3.158",
3
+ "version": "0.3.160",
4
4
  "description": "CLI for managing Replicas workspaces - SSH into cloud dev environments with automatic port forwarding",
5
5
  "main": "dist/index.cjs",
6
6
  "bin": {