replicas-cli 0.2.672 → 0.2.673

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 +26 -14
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -22818,12 +22818,20 @@ function coerceAuthFallbackPayload(payload) {
22818
22818
 
22819
22819
  // ../shared/src/engine/v1.ts
22820
22820
  var CHAT_STREAM_RESYNC_EVENT_TYPE = "chat.stream.resync";
22821
+ var CHAT_STREAM_READY_EVENT_TYPE = "chat.stream.ready";
22822
+ var chatEventSubscriptionsSchema = external_exports.object({
22823
+ chats: external_exports.array(external_exports.object({
22824
+ workspaceId: external_exports.string().uuid(),
22825
+ chatId: external_exports.string().min(1).max(256),
22826
+ after: external_exports.string().regex(/^\d+-\d+$/)
22827
+ })).min(1).max(256)
22828
+ });
22821
22829
  function isChatStreamEvent(value) {
22822
22830
  return isRecord(value) && typeof value.id === "string" && typeof value.ts === "string" && typeof value.type === "string" && value.type.startsWith("chat.") && isRecord(value.payload);
22823
22831
  }
22824
22832
  var ENGINE_CHAT_EVENTS_PUSH_MAX_EVENTS = 500;
22825
22833
  var chatScopedEngineEventSchema = external_exports.custom(
22826
- (value) => isChatStreamEvent(value) && value.type !== CHAT_STREAM_RESYNC_EVENT_TYPE
22834
+ (value) => isChatStreamEvent(value) && value.type !== CHAT_STREAM_RESYNC_EVENT_TYPE && value.type !== CHAT_STREAM_READY_EVENT_TYPE
22827
22835
  );
22828
22836
  var engineChatEventsPushRequestSchema = external_exports.object({
22829
22837
  epoch: external_exports.string().min(1).max(64),
@@ -27288,7 +27296,7 @@ var headlessFilesystemAgentResultSchema = external_exports.object({
27288
27296
  });
27289
27297
 
27290
27298
  // ../shared/src/cli-version.ts
27291
- var CLI_VERSION = "0.2.672";
27299
+ var CLI_VERSION = "0.2.673";
27292
27300
 
27293
27301
  // ../shared/src/version.ts
27294
27302
  function compareVersions(v1, v2) {
@@ -27919,18 +27927,22 @@ async function readSseStream(body, onEvent, shouldContinue = () => true) {
27919
27927
  const reader = body.getReader();
27920
27928
  const decoder2 = new TextDecoder();
27921
27929
  let buffer = "";
27922
- while (shouldContinue()) {
27923
- const { done, value } = await reader.read();
27924
- if (done) break;
27925
- buffer += decoder2.decode(value, { stream: true });
27926
- const chunks = buffer.split("\n\n");
27927
- buffer = chunks.pop() ?? "";
27928
- for (const chunk of chunks) {
27929
- if (!shouldContinue()) break;
27930
- const parsed = parseSseChunk(chunk);
27931
- if (!parsed) continue;
27932
- await onEvent(parsed.event, parsed.id);
27933
- }
27930
+ try {
27931
+ while (shouldContinue()) {
27932
+ const { done, value } = await reader.read();
27933
+ if (done) break;
27934
+ buffer += decoder2.decode(value, { stream: true });
27935
+ const chunks = buffer.split("\n\n");
27936
+ buffer = chunks.pop() ?? "";
27937
+ for (const chunk of chunks) {
27938
+ if (!shouldContinue()) break;
27939
+ const parsed = parseSseChunk(chunk);
27940
+ if (!parsed) continue;
27941
+ await onEvent(parsed.event, parsed.id);
27942
+ }
27943
+ }
27944
+ } finally {
27945
+ await reader.cancel().catch(() => void 0);
27934
27946
  }
27935
27947
  }
27936
27948
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.2.672",
3
+ "version": "0.2.673",
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": {