replicas-cli 0.2.784 → 0.2.785
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 +26 -8
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -25774,12 +25774,25 @@ function removeReplicasInstructions(text2) {
|
|
|
25774
25774
|
|
|
25775
25775
|
// ../shared/src/user-message-attachments.ts
|
|
25776
25776
|
var ATTACHMENT_PLACEHOLDER_REGEX = /^\[\d+ (?:(?:images?|files?)(?: and \d+ files?)? attached|(?:image )?attachments?)\]$/;
|
|
25777
|
+
var WALKTHROUGH_NOTE_REGEX = /(?:^|\n\n)<replicas_walkthrough path="([^"\n]+)" duration_seconds="(\d+)" audio="(true|false)">\n[^<]*\n<\/replicas_walkthrough>$/;
|
|
25778
|
+
var TRUNCATED_WALKTHROUGH_NOTE_REGEX = /(?:^|\n\n)<replicas_walkthrough path="([^"\n]*)(?:" duration_seconds="(\d*))?(?:" audio="(true)?)?[^<]*(?:<\/?[a-z_]*)?$/;
|
|
25777
25779
|
function stripAttachmentNote(text2) {
|
|
25778
25780
|
const match = text2.match(/(?:^|\n\n)<replicas_attachments>\nUploaded files are available at:((?:\n- .*)*)(?:\n<\/?[a-z_]*>?)?$/) ?? text2.match(/(?:^|\n\n)Uploaded files are available at:((?:\n- .*)*)$/);
|
|
25779
|
-
|
|
25781
|
+
let content = match ? text2.replace(match[0], "").trim() : text2;
|
|
25782
|
+
const walkthroughs = [];
|
|
25783
|
+
const truncated = WALKTHROUGH_NOTE_REGEX.test(content) ? null : content.match(TRUNCATED_WALKTHROUGH_NOTE_REGEX);
|
|
25784
|
+
if (truncated) {
|
|
25785
|
+
walkthroughs.push({ path: truncated[1], durationSeconds: Number(truncated[2] ?? 0), audio: truncated[3] === "true" });
|
|
25786
|
+
content = content.slice(0, truncated.index).trim();
|
|
25787
|
+
}
|
|
25788
|
+
for (let walkthrough = content.match(WALKTHROUGH_NOTE_REGEX); walkthrough; walkthrough = content.match(WALKTHROUGH_NOTE_REGEX)) {
|
|
25789
|
+
walkthroughs.unshift({ path: walkthrough[1], durationSeconds: Number(walkthrough[2]), audio: walkthrough[3] === "true" });
|
|
25790
|
+
content = content.slice(0, walkthrough.index).trim();
|
|
25791
|
+
}
|
|
25780
25792
|
return {
|
|
25781
|
-
content
|
|
25782
|
-
files: [...match[1].matchAll(/^- (.+)$/gm)].map(([, path7]) => path7)
|
|
25793
|
+
content,
|
|
25794
|
+
files: match ? [...match[1].matchAll(/^- (.+)$/gm)].map(([, path7]) => path7) : [],
|
|
25795
|
+
walkthroughs
|
|
25783
25796
|
};
|
|
25784
25797
|
}
|
|
25785
25798
|
|
|
@@ -27661,14 +27674,19 @@ function filterDisplayMessages(messages, provider) {
|
|
|
27661
27674
|
}
|
|
27662
27675
|
result = result.flatMap((msg) => {
|
|
27663
27676
|
if (msg.type !== "user") return [msg];
|
|
27664
|
-
const { content, files } = stripAttachmentNote(removeReplicasInstructions(msg.content).trim());
|
|
27677
|
+
const { content, files, walkthroughs } = stripAttachmentNote(removeReplicasInstructions(msg.content).trim());
|
|
27665
27678
|
if (INTERRUPTED_MESSAGE_REGEX.test(content)) {
|
|
27666
27679
|
return [{ id: msg.id, type: "interruption", timestamp: msg.timestamp }];
|
|
27667
27680
|
}
|
|
27668
27681
|
const cleaned = (msg.images?.length || files.length) && ATTACHMENT_PLACEHOLDER_REGEX.test(content) ? "" : content;
|
|
27669
|
-
if (cleaned.length === 0 && !msg.images?.length && files.length === 0) return [];
|
|
27670
|
-
if (cleaned === msg.content && files.length === 0) return [msg];
|
|
27671
|
-
return [{
|
|
27682
|
+
if (cleaned.length === 0 && !msg.images?.length && files.length === 0 && walkthroughs.length === 0) return [];
|
|
27683
|
+
if (cleaned === msg.content && files.length === 0 && walkthroughs.length === 0) return [msg];
|
|
27684
|
+
return [{
|
|
27685
|
+
...msg,
|
|
27686
|
+
content: cleaned,
|
|
27687
|
+
...files.length > 0 ? { files } : {},
|
|
27688
|
+
...walkthroughs.length > 0 ? { walkthroughs } : {}
|
|
27689
|
+
}];
|
|
27672
27690
|
});
|
|
27673
27691
|
return result;
|
|
27674
27692
|
}
|
|
@@ -27936,7 +27954,7 @@ var headlessAgentRequestSchema = external_exports.object({
|
|
|
27936
27954
|
});
|
|
27937
27955
|
|
|
27938
27956
|
// ../shared/src/cli-version.ts
|
|
27939
|
-
var CLI_VERSION = "0.2.
|
|
27957
|
+
var CLI_VERSION = "0.2.785";
|
|
27940
27958
|
|
|
27941
27959
|
// ../shared/src/version.ts
|
|
27942
27960
|
function compareVersions(v1, v2) {
|