replicas-cli 0.3.83 → 0.3.84
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/dist/index.cjs +11 -6
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -28646,7 +28646,7 @@ var headlessAgentRequestSchema = external_exports.object({
|
|
|
28646
28646
|
});
|
|
28647
28647
|
|
|
28648
28648
|
// ../shared/src/cli-version.ts
|
|
28649
|
-
var CLI_VERSION = "0.3.
|
|
28649
|
+
var CLI_VERSION = "0.3.84";
|
|
28650
28650
|
|
|
28651
28651
|
// ../shared/src/version.ts
|
|
28652
28652
|
function compareVersions(v1, v2) {
|
|
@@ -29377,24 +29377,29 @@ function parseSseChunk(chunk) {
|
|
|
29377
29377
|
return null;
|
|
29378
29378
|
}
|
|
29379
29379
|
}
|
|
29380
|
-
async function
|
|
29380
|
+
async function* iterateSseStream(body) {
|
|
29381
29381
|
const reader = body.getReader();
|
|
29382
29382
|
const decoder2 = new TextDecoder();
|
|
29383
29383
|
let buffer = "";
|
|
29384
|
-
while (
|
|
29384
|
+
while (true) {
|
|
29385
29385
|
const { done, value } = await reader.read();
|
|
29386
29386
|
if (done) break;
|
|
29387
29387
|
buffer += decoder2.decode(value, { stream: true });
|
|
29388
29388
|
const chunks = buffer.split("\n\n");
|
|
29389
29389
|
buffer = chunks.pop() ?? "";
|
|
29390
29390
|
for (const chunk of chunks) {
|
|
29391
|
-
if (!shouldContinue()) break;
|
|
29392
29391
|
const event = parseSseChunk(chunk);
|
|
29393
|
-
if (
|
|
29394
|
-
await onEvent(event);
|
|
29392
|
+
if (event) yield event;
|
|
29395
29393
|
}
|
|
29396
29394
|
}
|
|
29397
29395
|
}
|
|
29396
|
+
async function readSseStream(body, onEvent, shouldContinue = () => true) {
|
|
29397
|
+
if (!shouldContinue()) return;
|
|
29398
|
+
for await (const event of iterateSseStream(body)) {
|
|
29399
|
+
if (!shouldContinue()) break;
|
|
29400
|
+
await onEvent(event);
|
|
29401
|
+
}
|
|
29402
|
+
}
|
|
29398
29403
|
|
|
29399
29404
|
// src/lib/auth.ts
|
|
29400
29405
|
var import_supabase_js2 = require("@supabase/supabase-js");
|