replicas-cli 0.2.694 → 0.2.695
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 +14 -44
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -22938,29 +22938,6 @@ function coerceAuthFallbackPayload(payload) {
|
|
|
22938
22938
|
}
|
|
22939
22939
|
|
|
22940
22940
|
// ../shared/src/engine/v1.ts
|
|
22941
|
-
var CHAT_STREAM_RESYNC_EVENT_TYPE = "chat.stream.resync";
|
|
22942
|
-
var CHAT_STREAM_READY_EVENT_TYPE = "chat.stream.ready";
|
|
22943
|
-
var chatEventSubscriptionsSchema = external_exports.object({
|
|
22944
|
-
chats: external_exports.array(external_exports.object({
|
|
22945
|
-
workspaceId: external_exports.string().uuid(),
|
|
22946
|
-
chatId: external_exports.string().min(1).max(256),
|
|
22947
|
-
after: external_exports.string().regex(/^\d+-\d+$/)
|
|
22948
|
-
})).min(1).max(256)
|
|
22949
|
-
});
|
|
22950
|
-
function isChatStreamEvent(value) {
|
|
22951
|
-
return isRecord(value) && typeof value.id === "string" && typeof value.ts === "string" && typeof value.type === "string" && value.type.startsWith("chat.") && isRecord(value.payload);
|
|
22952
|
-
}
|
|
22953
|
-
var ENGINE_CHAT_EVENTS_PUSH_MAX_EVENTS = 500;
|
|
22954
|
-
var chatScopedEngineEventSchema = external_exports.custom(
|
|
22955
|
-
(value) => isChatStreamEvent(value) && value.type !== CHAT_STREAM_RESYNC_EVENT_TYPE && value.type !== CHAT_STREAM_READY_EVENT_TYPE
|
|
22956
|
-
);
|
|
22957
|
-
var engineChatEventsPushRequestSchema = external_exports.object({
|
|
22958
|
-
epoch: external_exports.string().min(1).max(64),
|
|
22959
|
-
events: external_exports.array(external_exports.object({
|
|
22960
|
-
seq: external_exports.number().int().positive(),
|
|
22961
|
-
event: chatScopedEngineEventSchema
|
|
22962
|
-
})).max(ENGINE_CHAT_EVENTS_PUSH_MAX_EVENTS)
|
|
22963
|
-
});
|
|
22964
22941
|
function getChatExecutionProvider(chat) {
|
|
22965
22942
|
return chat.provider === "relay" ? chat.relayBaseProvider ?? DEFAULT_RELAY_BASE_PROVIDER : chat.provider;
|
|
22966
22943
|
}
|
|
@@ -27388,7 +27365,7 @@ var headlessFilesystemAgentResultSchema = external_exports.object({
|
|
|
27388
27365
|
});
|
|
27389
27366
|
|
|
27390
27367
|
// ../shared/src/cli-version.ts
|
|
27391
|
-
var CLI_VERSION = "0.2.
|
|
27368
|
+
var CLI_VERSION = "0.2.695";
|
|
27392
27369
|
|
|
27393
27370
|
// ../shared/src/version.ts
|
|
27394
27371
|
function compareVersions(v1, v2) {
|
|
@@ -28009,17 +27986,14 @@ var MAX_ENGINE_LOG_BYTES = 50 * 1024 * 1024;
|
|
|
28009
27986
|
// ../shared/src/sse.ts
|
|
28010
27987
|
function parseSseChunk(chunk) {
|
|
28011
27988
|
let data = "";
|
|
28012
|
-
let id = null;
|
|
28013
27989
|
for (const line of chunk.split("\n")) {
|
|
28014
27990
|
if (line.startsWith("data: ")) {
|
|
28015
27991
|
data += line.slice(6);
|
|
28016
|
-
} else if (line.startsWith("id: ")) {
|
|
28017
|
-
id = line.slice(4);
|
|
28018
27992
|
}
|
|
28019
27993
|
}
|
|
28020
27994
|
if (!data) return null;
|
|
28021
27995
|
try {
|
|
28022
|
-
return
|
|
27996
|
+
return JSON.parse(data);
|
|
28023
27997
|
} catch {
|
|
28024
27998
|
return null;
|
|
28025
27999
|
}
|
|
@@ -28028,22 +28002,18 @@ async function readSseStream(body, onEvent, shouldContinue = () => true) {
|
|
|
28028
28002
|
const reader = body.getReader();
|
|
28029
28003
|
const decoder2 = new TextDecoder();
|
|
28030
28004
|
let buffer = "";
|
|
28031
|
-
|
|
28032
|
-
|
|
28033
|
-
|
|
28034
|
-
|
|
28035
|
-
|
|
28036
|
-
|
|
28037
|
-
|
|
28038
|
-
|
|
28039
|
-
|
|
28040
|
-
|
|
28041
|
-
|
|
28042
|
-
|
|
28043
|
-
}
|
|
28044
|
-
}
|
|
28045
|
-
} finally {
|
|
28046
|
-
await reader.cancel().catch(() => void 0);
|
|
28005
|
+
while (shouldContinue()) {
|
|
28006
|
+
const { done, value } = await reader.read();
|
|
28007
|
+
if (done) break;
|
|
28008
|
+
buffer += decoder2.decode(value, { stream: true });
|
|
28009
|
+
const chunks = buffer.split("\n\n");
|
|
28010
|
+
buffer = chunks.pop() ?? "";
|
|
28011
|
+
for (const chunk of chunks) {
|
|
28012
|
+
if (!shouldContinue()) break;
|
|
28013
|
+
const event = parseSseChunk(chunk);
|
|
28014
|
+
if (!event) continue;
|
|
28015
|
+
await onEvent(event);
|
|
28016
|
+
}
|
|
28047
28017
|
}
|
|
28048
28018
|
}
|
|
28049
28019
|
|