replicas-cli 0.3.615 → 0.3.616
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 +28 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -38619,6 +38619,9 @@ function parseReplicasEvents(events) {
|
|
|
38619
38619
|
const streamEndedMs = latestMs(["assistant_message", "error", "status"].map((type) => `${HARNESS_EVENT_TYPE_PREFIX}${type}`));
|
|
38620
38620
|
const livePartialMs = latestMs([CLAUDE_PARTIAL_MESSAGE_EVENT_TYPE]);
|
|
38621
38621
|
const retryMs = latestMs([HARNESS_RETRY_EVENT_TYPE]);
|
|
38622
|
+
let working = true;
|
|
38623
|
+
let cut;
|
|
38624
|
+
let cutThisRun = false;
|
|
38622
38625
|
events.forEach((event) => {
|
|
38623
38626
|
const { payload, timestamp: timestamp2 } = event;
|
|
38624
38627
|
const message2 = isRecord(payload.message) ? payload.message : {};
|
|
@@ -38642,6 +38645,10 @@ function parseReplicasEvents(events) {
|
|
|
38642
38645
|
}
|
|
38643
38646
|
return;
|
|
38644
38647
|
}
|
|
38648
|
+
if (event.type === `${HARNESS_EVENT_TYPE_PREFIX}user_message`) {
|
|
38649
|
+
if (cut?.stopped && !cut.stopped.byUserId && Date.parse(timestamp2) - Date.parse(cut.timestamp) <= RELAY_CUT_WINDOW_MS) messages.splice(messages.lastIndexOf(cut), 1);
|
|
38650
|
+
cut = void 0;
|
|
38651
|
+
}
|
|
38645
38652
|
const images = blockImages(contentBlocks(message2.content));
|
|
38646
38653
|
const messageId = payload[USER_MESSAGE_ID_PAYLOAD_KEY];
|
|
38647
38654
|
messages.push({
|
|
@@ -38690,6 +38697,23 @@ function parseReplicasEvents(events) {
|
|
|
38690
38697
|
}));
|
|
38691
38698
|
return;
|
|
38692
38699
|
}
|
|
38700
|
+
case `${HARNESS_EVENT_TYPE_PREFIX}status`:
|
|
38701
|
+
working = payload.status === "working";
|
|
38702
|
+
cutThisRun = false;
|
|
38703
|
+
return;
|
|
38704
|
+
case `${HARNESS_EVENT_TYPE_PREFIX}interrupt`: {
|
|
38705
|
+
if (!working || !messages.length) return;
|
|
38706
|
+
if (cutThisRun && cut) {
|
|
38707
|
+
if (typeof payload.userId === "string") cut.stopped = { byUserId: payload.userId };
|
|
38708
|
+
return;
|
|
38709
|
+
}
|
|
38710
|
+
let at = messages.length;
|
|
38711
|
+
for (let previous = messages[at - 1]; previous?.type === "user" && previous.cancelled; previous = messages[at - 1]) at--;
|
|
38712
|
+
cut = { id: `replicas-interrupt-${String(payload.seq)}`, type: "interruption", stopped: typeof payload.userId === "string" ? { byUserId: payload.userId } : {}, timestamp: timestamp2 };
|
|
38713
|
+
messages.splice(at, 0, cut);
|
|
38714
|
+
cutThisRun = true;
|
|
38715
|
+
return;
|
|
38716
|
+
}
|
|
38693
38717
|
case `${HARNESS_EVENT_TYPE_PREFIX}compaction`:
|
|
38694
38718
|
messages.push({ id: `replicas-compaction-${String(payload.seq)}`, type: "reasoning", content: COMPACTION_CONTENT, status: "completed", timestamp: timestamp2, completedAt: timestamp2 });
|
|
38695
38719
|
return;
|
|
@@ -38721,7 +38745,7 @@ function parseReplicasEvents(events) {
|
|
|
38721
38745
|
});
|
|
38722
38746
|
return messages;
|
|
38723
38747
|
}
|
|
38724
|
-
var HARNESS_EVENT_TYPE_PREFIX, HARNESS_RETRY_EVENT_TYPE;
|
|
38748
|
+
var HARNESS_EVENT_TYPE_PREFIX, HARNESS_RETRY_EVENT_TYPE, RELAY_CUT_WINDOW_MS;
|
|
38725
38749
|
var init_replicas_parser = __esm({
|
|
38726
38750
|
"../shared/src/display-message/parsers/replicas-parser.ts"() {
|
|
38727
38751
|
"use strict";
|
|
@@ -38734,6 +38758,7 @@ var init_replicas_parser = __esm({
|
|
|
38734
38758
|
init_utils();
|
|
38735
38759
|
HARNESS_EVENT_TYPE_PREFIX = "harness-";
|
|
38736
38760
|
HARNESS_RETRY_EVENT_TYPE = "harness-live-retry";
|
|
38761
|
+
RELAY_CUT_WINDOW_MS = 5e3;
|
|
38737
38762
|
}
|
|
38738
38763
|
});
|
|
38739
38764
|
|
|
@@ -39508,6 +39533,7 @@ function applyInterruptions(messages, events) {
|
|
|
39508
39533
|
const ms = parseTimestampMs(msg.timestamp);
|
|
39509
39534
|
if (lastInterruption && ms - parseTimestampMs(lastInterruption.timestamp) <= INTERRUPTION_DEDUP_WINDOW_MS) {
|
|
39510
39535
|
if (msg.steered) lastInterruption.steered = true;
|
|
39536
|
+
if (!msg.stopped) delete lastInterruption.stopped;
|
|
39511
39537
|
continue;
|
|
39512
39538
|
}
|
|
39513
39539
|
lastInterruption = {
|
|
@@ -40770,7 +40796,7 @@ var CLI_VERSION;
|
|
|
40770
40796
|
var init_cli_version = __esm({
|
|
40771
40797
|
"../shared/src/cli-version.ts"() {
|
|
40772
40798
|
"use strict";
|
|
40773
|
-
CLI_VERSION = "0.3.
|
|
40799
|
+
CLI_VERSION = "0.3.616";
|
|
40774
40800
|
}
|
|
40775
40801
|
});
|
|
40776
40802
|
|