replicas-cli 0.3.460 → 0.3.461
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 +21 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -35341,13 +35341,19 @@ function parseAnnotationsNote(body) {
|
|
|
35341
35341
|
const lines = entry.trim().split("\n");
|
|
35342
35342
|
const file2 = lines[0]?.match(ANNOTATION_FILE_REGEX);
|
|
35343
35343
|
if (file2) lines.shift();
|
|
35344
|
+
const source = lines[0]?.match(ANNOTATION_SOURCE_REGEX);
|
|
35345
|
+
if (source) lines.shift();
|
|
35346
|
+
const occurrence = lines[0]?.match(ANNOTATION_OCCURRENCE_REGEX);
|
|
35347
|
+
if (occurrence) lines.shift();
|
|
35344
35348
|
const quoteLength = lines.findIndex((line) => !line.startsWith(">"));
|
|
35345
35349
|
const quote = lines.slice(0, quoteLength === -1 ? void 0 : quoteLength).map((line) => line.replace(/^>\s?/, ""));
|
|
35346
35350
|
const comment = quoteLength === -1 ? "" : lines.slice(quoteLength).join("\n").trim();
|
|
35347
35351
|
return {
|
|
35348
35352
|
text: quote.join("\n"),
|
|
35349
35353
|
...comment ? { comment } : {},
|
|
35350
|
-
...file2 ? { lines: { path: file2[1], start: Number(file2[2]), end: Number(file2[3] ?? file2[2]) } } : {}
|
|
35354
|
+
...file2 ? { lines: { path: file2[1], start: Number(file2[2]), end: Number(file2[3] ?? file2[2]) } } : {},
|
|
35355
|
+
...occurrence ? { occurrence: Number(occurrence[1]) - 1 } : {},
|
|
35356
|
+
...source ? { messageId: source[1], ...source[2] ? { endMessageId: source[2] } : {} } : {}
|
|
35351
35357
|
};
|
|
35352
35358
|
});
|
|
35353
35359
|
}
|
|
@@ -35388,7 +35394,7 @@ function stripAttachmentNote(text4) {
|
|
|
35388
35394
|
annotations: annotationsNote ? parseAnnotationsNote(annotationsNote.body) : []
|
|
35389
35395
|
};
|
|
35390
35396
|
}
|
|
35391
|
-
var ATTACHMENT_PLACEHOLDER_REGEX, withoutAttachmentPlaceholder, annotationLinesSchema, ANNOTATIONS_NOTE_OPENING, ANNOTATIONS_NOTE_REGEX, ANNOTATION_HEADER_REGEX, ANNOTATION_FILE_REGEX, APPSHOT_NOTE_REGEX, TRUNCATED_APPSHOT_NOTE_REGEX, XML_UNESCAPES, unescapeXml, WALKTHROUGH_NOTE_REGEX, TRUNCATED_WALKTHROUGH_NOTE_REGEX, VIDEO_SIZES_REGEX, parseVideoSizes;
|
|
35397
|
+
var ATTACHMENT_PLACEHOLDER_REGEX, withoutAttachmentPlaceholder, annotationLinesSchema, messageAnnotationSchema, ANNOTATIONS_NOTE_OPENING, ANNOTATIONS_NOTE_REGEX, ANNOTATION_HEADER_REGEX, ANNOTATION_FILE_REGEX, ANNOTATION_OCCURRENCE_REGEX, ANNOTATION_SOURCE_REGEX, APPSHOT_NOTE_REGEX, TRUNCATED_APPSHOT_NOTE_REGEX, XML_UNESCAPES, unescapeXml, WALKTHROUGH_NOTE_REGEX, TRUNCATED_WALKTHROUGH_NOTE_REGEX, VIDEO_SIZES_REGEX, parseVideoSizes;
|
|
35392
35398
|
var init_user_message_attachments = __esm({
|
|
35393
35399
|
"../shared/src/user-message-attachments.ts"() {
|
|
35394
35400
|
"use strict";
|
|
@@ -35398,10 +35404,22 @@ var init_user_message_attachments = __esm({
|
|
|
35398
35404
|
ATTACHMENT_PLACEHOLDER_REGEX = /^\[\d+ (?:(?:images?|files?)(?: and \d+ files?)? attached|(?:image )?attachments?)\]$/;
|
|
35399
35405
|
withoutAttachmentPlaceholder = (content, attached) => attached && ATTACHMENT_PLACEHOLDER_REGEX.test(content) ? "" : content;
|
|
35400
35406
|
annotationLinesSchema = external_exports.object({ path: external_exports.string(), start: external_exports.number(), end: external_exports.number() });
|
|
35407
|
+
messageAnnotationSchema = external_exports.object({
|
|
35408
|
+
text: external_exports.string(),
|
|
35409
|
+
comment: external_exports.string().optional(),
|
|
35410
|
+
lines: annotationLinesSchema.optional(),
|
|
35411
|
+
/** Which match of `text` in its message was quoted, from 0, when the same words appear more than once. */
|
|
35412
|
+
occurrence: external_exports.number().int().nonnegative().optional(),
|
|
35413
|
+
/** The rendered message the quote was selected in, and its last one when it spans several, so clients find it without searching. */
|
|
35414
|
+
messageId: external_exports.string().optional(),
|
|
35415
|
+
endMessageId: external_exports.string().optional()
|
|
35416
|
+
});
|
|
35401
35417
|
ANNOTATIONS_NOTE_OPENING = '<replicas_annotations>\nThe user quoted these passages, some with a comment. Address each annotation, and when you do, refer to it as "Annotation N".';
|
|
35402
35418
|
ANNOTATIONS_NOTE_REGEX = /(?:^|\n\n)<replicas_annotations>\n([\s\S]*?)\n<\/replicas_annotations>$/;
|
|
35403
35419
|
ANNOTATION_HEADER_REGEX = /^Annotation \d+$/m;
|
|
35404
35420
|
ANNOTATION_FILE_REGEX = /^File: (.+):(\d+)(?:-(\d+))?$/;
|
|
35421
|
+
ANNOTATION_OCCURRENCE_REGEX = /^Occurrence: (\d+) /;
|
|
35422
|
+
ANNOTATION_SOURCE_REGEX = /^Source: (\S+)(?: to (\S+))?$/;
|
|
35405
35423
|
APPSHOT_NOTE_REGEX = /(?:^|\n\n)<replicas_appshot app="([^"\n]*)" window="([^"\n]*)" image="(\d+)">\n([^\n<]*)(?:\n\n([^<]*))?\n<\/replicas_appshot>$/;
|
|
35406
35424
|
TRUNCATED_APPSHOT_NOTE_REGEX = /(?:^|\n\n)<replicas_appshot app="([^"\n]*)(?:" window="([^"\n]*)(?:" image="(\d*))?)?[^<]*(?:<\/?[a-z_]*)?$/;
|
|
35407
35425
|
XML_UNESCAPES = { "&": "&", "<": "<", ">": ">", """: '"', "'": "'" };
|
|
@@ -39131,7 +39149,7 @@ var CLI_VERSION;
|
|
|
39131
39149
|
var init_cli_version = __esm({
|
|
39132
39150
|
"../shared/src/cli-version.ts"() {
|
|
39133
39151
|
"use strict";
|
|
39134
|
-
CLI_VERSION = "0.3.
|
|
39152
|
+
CLI_VERSION = "0.3.461";
|
|
39135
39153
|
}
|
|
39136
39154
|
});
|
|
39137
39155
|
|