acp-kernel 0.0.67-pr.267.121 → 0.0.67-pr.269.122
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/compress-tools.d.ts +156 -108
- package/dist/compress-tools.d.ts.map +1 -1
- package/dist/index.js +101 -33
- package/dist/index.js.map +1 -1
- package/dist/parse-compress-input.d.ts +5 -0
- package/dist/parse-compress-input.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/compress-tools.d.ts
CHANGED
|
@@ -41,25 +41,33 @@ export declare const COMPRESS_TOOL: {
|
|
|
41
41
|
type: string;
|
|
42
42
|
description: string;
|
|
43
43
|
items: {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
44
|
+
anyOf: ({
|
|
45
|
+
type: string;
|
|
46
|
+
description: string;
|
|
47
|
+
properties?: undefined;
|
|
48
|
+
required?: undefined;
|
|
49
|
+
} | {
|
|
50
|
+
type: string;
|
|
51
|
+
properties: {
|
|
52
|
+
topic: {
|
|
53
|
+
type: string;
|
|
54
|
+
};
|
|
55
|
+
startId: {
|
|
56
|
+
type: string;
|
|
57
|
+
description: string;
|
|
58
|
+
};
|
|
59
|
+
endId: {
|
|
60
|
+
type: string;
|
|
61
|
+
description: string;
|
|
62
|
+
};
|
|
63
|
+
summary: {
|
|
64
|
+
type: string;
|
|
65
|
+
description: string;
|
|
66
|
+
};
|
|
60
67
|
};
|
|
61
|
-
|
|
62
|
-
|
|
68
|
+
required: string[];
|
|
69
|
+
description?: undefined;
|
|
70
|
+
})[];
|
|
63
71
|
};
|
|
64
72
|
};
|
|
65
73
|
};
|
|
@@ -96,25 +104,33 @@ export declare const COMPRESS_TOOL_OPENAI: {
|
|
|
96
104
|
type: string;
|
|
97
105
|
description: string;
|
|
98
106
|
items: {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
107
|
+
anyOf: ({
|
|
108
|
+
type: string;
|
|
109
|
+
description: string;
|
|
110
|
+
properties?: undefined;
|
|
111
|
+
required?: undefined;
|
|
112
|
+
} | {
|
|
113
|
+
type: string;
|
|
114
|
+
properties: {
|
|
115
|
+
topic: {
|
|
116
|
+
type: string;
|
|
117
|
+
};
|
|
118
|
+
startId: {
|
|
119
|
+
type: string;
|
|
120
|
+
description: string;
|
|
121
|
+
};
|
|
122
|
+
endId: {
|
|
123
|
+
type: string;
|
|
124
|
+
description: string;
|
|
125
|
+
};
|
|
126
|
+
summary: {
|
|
127
|
+
type: string;
|
|
128
|
+
description: string;
|
|
129
|
+
};
|
|
115
130
|
};
|
|
116
|
-
|
|
117
|
-
|
|
131
|
+
required: string[];
|
|
132
|
+
description?: undefined;
|
|
133
|
+
})[];
|
|
118
134
|
};
|
|
119
135
|
};
|
|
120
136
|
};
|
|
@@ -198,25 +214,33 @@ export declare const ACP_TOOLS_OPENAI: readonly [{
|
|
|
198
214
|
type: string;
|
|
199
215
|
description: string;
|
|
200
216
|
items: {
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
+
anyOf: ({
|
|
218
|
+
type: string;
|
|
219
|
+
description: string;
|
|
220
|
+
properties?: undefined;
|
|
221
|
+
required?: undefined;
|
|
222
|
+
} | {
|
|
223
|
+
type: string;
|
|
224
|
+
properties: {
|
|
225
|
+
topic: {
|
|
226
|
+
type: string;
|
|
227
|
+
};
|
|
228
|
+
startId: {
|
|
229
|
+
type: string;
|
|
230
|
+
description: string;
|
|
231
|
+
};
|
|
232
|
+
endId: {
|
|
233
|
+
type: string;
|
|
234
|
+
description: string;
|
|
235
|
+
};
|
|
236
|
+
summary: {
|
|
237
|
+
type: string;
|
|
238
|
+
description: string;
|
|
239
|
+
};
|
|
217
240
|
};
|
|
218
|
-
|
|
219
|
-
|
|
241
|
+
required: string[];
|
|
242
|
+
description?: undefined;
|
|
243
|
+
})[];
|
|
220
244
|
};
|
|
221
245
|
};
|
|
222
246
|
};
|
|
@@ -345,25 +369,33 @@ export declare const ACP_TOOLS_ANTHROPIC: readonly [{
|
|
|
345
369
|
type: string;
|
|
346
370
|
description: string;
|
|
347
371
|
items: {
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
372
|
+
anyOf: ({
|
|
373
|
+
type: string;
|
|
374
|
+
description: string;
|
|
375
|
+
properties?: undefined;
|
|
376
|
+
required?: undefined;
|
|
377
|
+
} | {
|
|
378
|
+
type: string;
|
|
379
|
+
properties: {
|
|
380
|
+
topic: {
|
|
381
|
+
type: string;
|
|
382
|
+
};
|
|
383
|
+
startId: {
|
|
384
|
+
type: string;
|
|
385
|
+
description: string;
|
|
386
|
+
};
|
|
387
|
+
endId: {
|
|
388
|
+
type: string;
|
|
389
|
+
description: string;
|
|
390
|
+
};
|
|
391
|
+
summary: {
|
|
392
|
+
type: string;
|
|
393
|
+
description: string;
|
|
394
|
+
};
|
|
364
395
|
};
|
|
365
|
-
|
|
366
|
-
|
|
396
|
+
required: string[];
|
|
397
|
+
description?: undefined;
|
|
398
|
+
})[];
|
|
367
399
|
};
|
|
368
400
|
};
|
|
369
401
|
};
|
|
@@ -430,25 +462,33 @@ export declare const COMPRESS_TOOL_RESPONSES: {
|
|
|
430
462
|
type: string;
|
|
431
463
|
description: string;
|
|
432
464
|
items: {
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
465
|
+
anyOf: ({
|
|
466
|
+
type: string;
|
|
467
|
+
description: string;
|
|
468
|
+
properties?: undefined;
|
|
469
|
+
required?: undefined;
|
|
470
|
+
} | {
|
|
471
|
+
type: string;
|
|
472
|
+
properties: {
|
|
473
|
+
topic: {
|
|
474
|
+
type: string;
|
|
475
|
+
};
|
|
476
|
+
startId: {
|
|
477
|
+
type: string;
|
|
478
|
+
description: string;
|
|
479
|
+
};
|
|
480
|
+
endId: {
|
|
481
|
+
type: string;
|
|
482
|
+
description: string;
|
|
483
|
+
};
|
|
484
|
+
summary: {
|
|
485
|
+
type: string;
|
|
486
|
+
description: string;
|
|
487
|
+
};
|
|
449
488
|
};
|
|
450
|
-
|
|
451
|
-
|
|
489
|
+
required: string[];
|
|
490
|
+
description?: undefined;
|
|
491
|
+
})[];
|
|
452
492
|
};
|
|
453
493
|
};
|
|
454
494
|
};
|
|
@@ -522,25 +562,33 @@ export declare const ACP_TOOLS_RESPONSES: readonly [{
|
|
|
522
562
|
type: string;
|
|
523
563
|
description: string;
|
|
524
564
|
items: {
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
565
|
+
anyOf: ({
|
|
566
|
+
type: string;
|
|
567
|
+
description: string;
|
|
568
|
+
properties?: undefined;
|
|
569
|
+
required?: undefined;
|
|
570
|
+
} | {
|
|
571
|
+
type: string;
|
|
572
|
+
properties: {
|
|
573
|
+
topic: {
|
|
574
|
+
type: string;
|
|
575
|
+
};
|
|
576
|
+
startId: {
|
|
577
|
+
type: string;
|
|
578
|
+
description: string;
|
|
579
|
+
};
|
|
580
|
+
endId: {
|
|
581
|
+
type: string;
|
|
582
|
+
description: string;
|
|
583
|
+
};
|
|
584
|
+
summary: {
|
|
585
|
+
type: string;
|
|
586
|
+
description: string;
|
|
587
|
+
};
|
|
541
588
|
};
|
|
542
|
-
|
|
543
|
-
|
|
589
|
+
required: string[];
|
|
590
|
+
description?: undefined;
|
|
591
|
+
})[];
|
|
544
592
|
};
|
|
545
593
|
};
|
|
546
594
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compress-tools.d.ts","sourceRoot":"","sources":["../src/compress-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAkB,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5D,OAAO,EAAyB,KAAK,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAEzF,eAAO,MAAM,kBAAkB,aAAa,CAAC;AAC7C,eAAO,MAAM,oBAAoB,eAAe,CAAC;AACjD,eAAO,MAAM,wBAAwB,mBAAmB,CAAC;AACzD,eAAO,MAAM,oBAAoB,eAAe,CAAC;AACjD,eAAO,MAAM,gBAAgB,WAAW,CAAC;AAEzC;;;6DAG6D;AAC7D,eAAO,MAAM,aAAa,mBAAmB,CAAC;AAC9C,eAAO,MAAM,cAAc,oBAAoB,CAAC;AAChD,eAAO,MAAM,eAAe,iBAAiB,CAAC;AAC9C,eAAO,MAAM,gBAAgB,kBAAkB,CAAC;AAChD,eAAO,MAAM,eAAe,iBAAiB,CAAC;AAC9C,eAAO,MAAM,gBAAgB,kBAAkB,CAAC;AAChD,eAAO,MAAM,mBAAmB,qB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;;;;CAKnC,CAAC;AAEF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;CAKrC,CAAC;AAEF,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;CAKzC,CAAC;AAEF,eAAO,MAAM,yBAAyB;;;;;;;;CAKrC,CAAC;AAEF,2EAA2E;AAC3E,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKtB,CAAC;AAEX;;;;;gFAKgF;AAChF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAI/B,CAAC;AAEX;;iDAEiD;AACjD,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,MAAM,CAK7C,CAAC;AAEH;qEACqE;AACrE,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAGjD,CAAC;AAEH;qEACqE;AACrE,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAGjD,CAAC;AAEH;mEACmE;AACnE,eAAO,MAAM,uBAAuB,mUAC8R,CAAC;AAmBnU,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;CAIvB,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;CAO9B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -878,7 +878,7 @@ var ACP_DECOMPRESS_OPEN = "<acp_decompress>";
|
|
|
878
878
|
var ACP_DECOMPRESS_CLOSE = "</acp_decompress>";
|
|
879
879
|
var COMPRESS_TOOL = {
|
|
880
880
|
name: COMPRESS_TOOL_NAME,
|
|
881
|
-
description: "Replace
|
|
881
|
+
description: "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. Line form (preferred): content = one STRING per range \u2014 first line 'm00150\u2013m00220 optional topic', remaining lines the markdown summary written verbatim (no JSON structure, no escaping). Legacy object form {startId,endId,summary,topic?} also accepted. Use when content is genuinely consumed. REQUIRED \u2014 compress without content is invalid.",
|
|
882
882
|
input_schema: {
|
|
883
883
|
type: "object",
|
|
884
884
|
properties: {
|
|
@@ -888,25 +888,33 @@ var COMPRESS_TOOL = {
|
|
|
888
888
|
},
|
|
889
889
|
content: {
|
|
890
890
|
type: "array",
|
|
891
|
-
description: "One or more ranges to compress into separate summary blocks",
|
|
891
|
+
description: "One or more ranges to compress into separate summary blocks. Line form (preferred): one string per range \u2014 first line 'm00150\u2013m00220 optional topic', remaining lines the markdown summary verbatim. Object form also accepted.",
|
|
892
892
|
items: {
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
topic: { type: "string" },
|
|
896
|
-
startId: {
|
|
893
|
+
anyOf: [
|
|
894
|
+
{
|
|
897
895
|
type: "string",
|
|
898
|
-
description: "
|
|
896
|
+
description: "Line form: first line 'm00150\u2013m00220 optional topic', remaining lines the summary markdown, verbatim (no JSON escaping)"
|
|
899
897
|
},
|
|
900
|
-
|
|
901
|
-
type: "
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
898
|
+
{
|
|
899
|
+
type: "object",
|
|
900
|
+
properties: {
|
|
901
|
+
topic: { type: "string" },
|
|
902
|
+
startId: {
|
|
903
|
+
type: "string",
|
|
904
|
+
description: "mNNNNN ref at the start of the range"
|
|
905
|
+
},
|
|
906
|
+
endId: {
|
|
907
|
+
type: "string",
|
|
908
|
+
description: "mNNNNN ref at the end of the range"
|
|
909
|
+
},
|
|
910
|
+
summary: {
|
|
911
|
+
type: "string",
|
|
912
|
+
description: "Self-contained summary replacing the range"
|
|
913
|
+
}
|
|
914
|
+
},
|
|
915
|
+
required: ["startId", "endId", "summary"]
|
|
907
916
|
}
|
|
908
|
-
|
|
909
|
-
required: ["startId", "endId", "summary"]
|
|
917
|
+
]
|
|
910
918
|
}
|
|
911
919
|
}
|
|
912
920
|
},
|
|
@@ -970,25 +978,33 @@ var COMPRESS_TOOL_OPENAI = {
|
|
|
970
978
|
},
|
|
971
979
|
content: {
|
|
972
980
|
type: "array",
|
|
973
|
-
description: "One or more ranges to compress into separate summary blocks. REQUIRED \u2014 compress without content is invalid.",
|
|
981
|
+
description: "One or more ranges to compress into separate summary blocks. Line form (preferred): one string per range \u2014 first line 'm00150\u2013m00220 optional topic', remaining lines the markdown summary verbatim. Object form also accepted. REQUIRED \u2014 compress without content is invalid.",
|
|
974
982
|
items: {
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
topic: { type: "string" },
|
|
978
|
-
startId: {
|
|
983
|
+
anyOf: [
|
|
984
|
+
{
|
|
979
985
|
type: "string",
|
|
980
|
-
description: "
|
|
986
|
+
description: "Line form: first line 'm00150\u2013m00220 optional topic', remaining lines the summary markdown, verbatim (no JSON escaping)"
|
|
981
987
|
},
|
|
982
|
-
|
|
983
|
-
type: "
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
988
|
+
{
|
|
989
|
+
type: "object",
|
|
990
|
+
properties: {
|
|
991
|
+
topic: { type: "string" },
|
|
992
|
+
startId: {
|
|
993
|
+
type: "string",
|
|
994
|
+
description: "mNNNNN ref at the start of the range"
|
|
995
|
+
},
|
|
996
|
+
endId: {
|
|
997
|
+
type: "string",
|
|
998
|
+
description: "mNNNNN ref at the end of the range"
|
|
999
|
+
},
|
|
1000
|
+
summary: {
|
|
1001
|
+
type: "string",
|
|
1002
|
+
description: "Self-contained summary replacing the range"
|
|
1003
|
+
}
|
|
1004
|
+
},
|
|
1005
|
+
required: ["startId", "endId", "summary"]
|
|
989
1006
|
}
|
|
990
|
-
|
|
991
|
-
required: ["startId", "endId", "summary"]
|
|
1007
|
+
]
|
|
992
1008
|
}
|
|
993
1009
|
}
|
|
994
1010
|
},
|
|
@@ -3101,7 +3117,7 @@ var LEAN_TOOL_PROMPTS = {
|
|
|
3101
3117
|
compress: {
|
|
3102
3118
|
description: "Replace consumed conversation ranges with self-contained summaries using mNNNNN or bN refs.",
|
|
3103
3119
|
paramDescriptions: {
|
|
3104
|
-
content: "
|
|
3120
|
+
content: "One string per range: first line 'm00150\u2013m00220 optional topic', remaining lines the summary markdown. Object form also accepted.",
|
|
3105
3121
|
startId: "Inclusive first mNNNNN or bN ref.",
|
|
3106
3122
|
endId: "Inclusive last mNNNNN or bN ref.",
|
|
3107
3123
|
summary: "Self-contained replacement preserving exact technical details.",
|
|
@@ -3810,7 +3826,15 @@ function parseObjectValue(value, callId, diag) {
|
|
|
3810
3826
|
entries = content;
|
|
3811
3827
|
} else if (typeof content === "string") {
|
|
3812
3828
|
const parsed = parseContentArray(content);
|
|
3813
|
-
if (parsed === null) {
|
|
3829
|
+
if (parsed === null || parsed.entries.length === 0 && content.trim().length > 0) {
|
|
3830
|
+
const entries2 = splitLineEntries(content);
|
|
3831
|
+
const { ranges: ranges2, invalid: invalid2, reasons: reasons2 } = validateEntries(entries2, callId);
|
|
3832
|
+
if (ranges2.length > 0) {
|
|
3833
|
+
diag.invalidItems = invalid2;
|
|
3834
|
+
if (reasons2.length > 0) diag.invalidReasons = reasons2;
|
|
3835
|
+
diag.kind = "ok";
|
|
3836
|
+
return finish(ranges2, diag);
|
|
3837
|
+
}
|
|
3814
3838
|
diag.kind = "content-not-array";
|
|
3815
3839
|
return finish([], diag);
|
|
3816
3840
|
}
|
|
@@ -3886,7 +3910,51 @@ function validateEntries(entries, callId) {
|
|
|
3886
3910
|
}
|
|
3887
3911
|
return { ranges, invalid, reasons };
|
|
3888
3912
|
}
|
|
3913
|
+
var REF_PAIR_IN_LINE = /\bm(\d{3,7})\s*(?:[-\u2013\u2014~]|\.\.\.|to)\s*m(\d{3,7})\b/i;
|
|
3914
|
+
var SINGLE_REF_IN_LINE = /\bm(\d{3,7})\b/i;
|
|
3915
|
+
function parseLineEntry(entry, callId) {
|
|
3916
|
+
const head = entry.slice(0, 240);
|
|
3917
|
+
const pair = REF_PAIR_IN_LINE.exec(head);
|
|
3918
|
+
let startRef;
|
|
3919
|
+
let endRef;
|
|
3920
|
+
let afterRefs;
|
|
3921
|
+
if (pair !== null) {
|
|
3922
|
+
startRef = `m${pair[1]}`;
|
|
3923
|
+
endRef = `m${pair[2]}`;
|
|
3924
|
+
afterRefs = pair.index + pair[0].length;
|
|
3925
|
+
} else {
|
|
3926
|
+
const single = SINGLE_REF_IN_LINE.exec(head);
|
|
3927
|
+
if (single === null) return { reason: "line entry: no mNNNNN refs in header" };
|
|
3928
|
+
startRef = `m${single[1]}`;
|
|
3929
|
+
endRef = startRef;
|
|
3930
|
+
afterRefs = single.index + single[0].length;
|
|
3931
|
+
}
|
|
3932
|
+
const lineEnd = entry.indexOf("\n", afterRefs);
|
|
3933
|
+
const explicitTopic = (lineEnd === -1 ? entry.slice(afterRefs) : entry.slice(afterRefs, lineEnd)).trim();
|
|
3934
|
+
const summary = (lineEnd === -1 ? "" : entry.slice(lineEnd + 1)).trim();
|
|
3935
|
+
if (summary.length === 0) return { reason: "line entry: missing summary after the refs header line" };
|
|
3936
|
+
const range = {
|
|
3937
|
+
startRef,
|
|
3938
|
+
endRef,
|
|
3939
|
+
summary,
|
|
3940
|
+
topic: explicitTopic.length > 0 ? explicitTopic : deriveTopicFromSummary(summary)
|
|
3941
|
+
};
|
|
3942
|
+
if (callId !== void 0) range.compressCallId = callId;
|
|
3943
|
+
return { range };
|
|
3944
|
+
}
|
|
3945
|
+
function deriveTopicFromSummary(summary) {
|
|
3946
|
+
const heading = /^#{1,6}\s+(.+)$/m.exec(summary);
|
|
3947
|
+
const source = heading !== null ? heading[1] : summary.split("\n").find((l) => l.trim().length > 0) ?? "";
|
|
3948
|
+
const text = source.trim().replace(/^[\u2022\-*]\s+/, "");
|
|
3949
|
+
if (text.length === 0) return void 0;
|
|
3950
|
+
return text.length > 60 ? text.slice(0, 60).trimEnd() : text;
|
|
3951
|
+
}
|
|
3952
|
+
function splitLineEntries(content) {
|
|
3953
|
+
const parts = content.split(/\n(?=m\d{3,7}\s*(?:[-\u2013\u2014~]|\.\.\.|to)\s*m\d{3,7}\b)/i).map((p) => p.trim()).filter((p) => p.length > 0);
|
|
3954
|
+
return parts.length > 0 ? parts : [content.trim()];
|
|
3955
|
+
}
|
|
3889
3956
|
function validateEntry(entry, callId) {
|
|
3957
|
+
if (typeof entry === "string") return parseLineEntry(entry, callId);
|
|
3890
3958
|
if (entry === null || typeof entry !== "object" || Array.isArray(entry)) return { reason: "not an object" };
|
|
3891
3959
|
const e = entry;
|
|
3892
3960
|
const start = stringOr(e["startRef"]) ?? stringOr(e["startId"]) ?? stringOr(e["messageId"]);
|