acp-kernel 0.0.67-pr.271.128 → 0.0.67-pr.271.131
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.js +11 -2
- package/dist/index.js.map +1 -1
- package/dist/parse-compress-input.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3827,7 +3827,8 @@ function parseObjectValue(value, callId, diag) {
|
|
|
3827
3827
|
} else if (typeof content === "string") {
|
|
3828
3828
|
const parsed = parseContentArray(content);
|
|
3829
3829
|
if (parsed === null || parsed.entries.length === 0 && content.trim().length > 0) {
|
|
3830
|
-
const
|
|
3830
|
+
const bare = stripJsonWrapperResidue(content);
|
|
3831
|
+
const entries2 = splitLineEntries(bare);
|
|
3831
3832
|
const { ranges: ranges2, invalid: invalid2, reasons: reasons2 } = validateEntries(entries2, callId);
|
|
3832
3833
|
if (ranges2.length > 0) {
|
|
3833
3834
|
diag.invalidItems = invalid2;
|
|
@@ -3955,9 +3956,17 @@ function deriveTopicFromSummary(summary) {
|
|
|
3955
3956
|
return text.length > 60 ? text.slice(0, 60).trimEnd() : text;
|
|
3956
3957
|
}
|
|
3957
3958
|
function splitLineEntries(content) {
|
|
3958
|
-
const parts = content.split(/\n(
|
|
3959
|
+
const parts = content.split(/\n(?=\s*(?:["']\s*,\s*)?["']?\s*[mb]\d{1,7}\s*(?:[-\u2013\u2014\u2026~]|\.\.\.|to)\s*[mb]\d{1,7}\b)/i).map((p) => p.trim().replace(/^(?:["']\s*,?\s*)+/, "").replace(/["']\s*$/, "")).filter((p) => p.length > 0);
|
|
3959
3960
|
return parts.length > 0 ? parts : [content.trim()];
|
|
3960
3961
|
}
|
|
3962
|
+
function stripJsonWrapperResidue(s) {
|
|
3963
|
+
let t = s.trim();
|
|
3964
|
+
if (t.startsWith("[")) t = t.replace(/^\[+\s*/, "");
|
|
3965
|
+
t = t.replace(/^"/, "");
|
|
3966
|
+
if (t.endsWith("]")) t = t.replace(/\s*\]+$/, "");
|
|
3967
|
+
t = t.replace(/"$/, "");
|
|
3968
|
+
return t.trim();
|
|
3969
|
+
}
|
|
3961
3970
|
function validateEntry(entry, callId) {
|
|
3962
3971
|
if (typeof entry === "string") return parseLineEntry(entry, callId);
|
|
3963
3972
|
if (entry === null || typeof entry !== "object" || Array.isArray(entry)) return { reason: "not an object" };
|