@ai-matrx/content-ir 0.24.0 → 0.24.1
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/CHANGELOG.md +6 -1
- package/dist/surfaces.cjs +8 -3
- package/dist/surfaces.cjs.map +1 -1
- package/dist/surfaces.js +8 -3
- package/dist/surfaces.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.24.1
|
|
4
|
+
|
|
5
|
+
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
|
6
|
+
`git diff npm/content-ir-core/v0.24.0..npm/content-ir-core/v0.24.1 -- apps/shared/content-ir-core`).
|
|
7
|
+
No source changes intended and no consumer action required.
|
|
3
8
|
|
|
4
9
|
## 0.24.0 — one thinking-strip rule
|
|
5
10
|
|
|
@@ -16,7 +21,7 @@ Consumer action: none. Output differs only in the newlines around a removed bloc
|
|
|
16
21
|
- `/source` gains the delimiter guard (`guardMarkdownDelimiters`, `guardMathDelimiters`,
|
|
17
22
|
`guardRunawayLinks`, `reportDelimiterViolations` + types) and the thinking-tag helpers
|
|
18
23
|
(`stripThinking`, `hasThinkingTags`, `stripThinkingStreaming`), moved from `@ai-matrx/kit`. The
|
|
19
|
-
guard's math rules are now THE rules of `source/math-pairs` (kit carried a private copy);
|
|
24
|
+
guard's math rules are now THE rules of `source/math-pairs` (kit carried a private copy);
|
|
20
25
|
`opensFlowBlock` is exported there.
|
|
21
26
|
- New subpath `/json-extract` (moved from `@ai-matrx/kit/json-extract`): JSON in model text,
|
|
22
27
|
fenced or bare, complete or streaming. New dependencies: `json5`, `jsonrepair`.
|
package/dist/surfaces.cjs
CHANGED
|
@@ -1784,7 +1784,8 @@ var KIND_KEY_TEXT_G = /(?<!\\)"__kind"\s*:/g;
|
|
|
1784
1784
|
function findBrokenKindJsonRegions(source, options = {}) {
|
|
1785
1785
|
const broken = [];
|
|
1786
1786
|
if (!KIND_KEY_TEXT.test(source)) return broken;
|
|
1787
|
-
const
|
|
1787
|
+
const mayHaveBalancedValue = source.includes("}") || source.includes("]");
|
|
1788
|
+
const endOf = mayHaveBalancedValue ? lazyJsonEnds(source) : null;
|
|
1788
1789
|
const keys = [];
|
|
1789
1790
|
KIND_KEY_TEXT_G.lastIndex = 0;
|
|
1790
1791
|
for (let m = KIND_KEY_TEXT_G.exec(source); m; m = KIND_KEY_TEXT_G.exec(source)) keys.push(m.index);
|
|
@@ -1818,7 +1819,7 @@ function findBrokenKindJsonRegions(source, options = {}) {
|
|
|
1818
1819
|
break;
|
|
1819
1820
|
}
|
|
1820
1821
|
if (verdict.at <= key) continue;
|
|
1821
|
-
const end = endOf(start);
|
|
1822
|
+
const end = endOf?.(start) ?? null;
|
|
1822
1823
|
if (end !== null && lenientJson(source.slice(start, end))) {
|
|
1823
1824
|
broken.push({ start, end, content: source.slice(start, end) });
|
|
1824
1825
|
start = end - 1;
|
|
@@ -2165,6 +2166,7 @@ function quotedCodeRanges(text) {
|
|
|
2165
2166
|
}
|
|
2166
2167
|
function noteUnreadableKinds(text) {
|
|
2167
2168
|
if (!hasKindKey(text)) return text;
|
|
2169
|
+
if (!text.includes("}") && !text.includes("]")) return text;
|
|
2168
2170
|
const quoted = quotedCodeRanges(text);
|
|
2169
2171
|
const fences = findCodeRanges(text).filter((range) => range.kind === "fence");
|
|
2170
2172
|
const spans = [];
|
|
@@ -2306,7 +2308,8 @@ ${out}`;
|
|
|
2306
2308
|
${out}`;
|
|
2307
2309
|
}
|
|
2308
2310
|
function convertRegions(text, excludeLiteralContexts, options, leftover = (piece) => piece) {
|
|
2309
|
-
const
|
|
2311
|
+
const completeRegions = text.includes("}") || text.includes("]") ? findKindCarryingJsonValues(text, { excludeLiteralContexts }) : [];
|
|
2312
|
+
const spans = completeRegions.map(
|
|
2310
2313
|
(region) => ({ start: region.start, end: region.end, md: valueMarkdown(region.value) })
|
|
2311
2314
|
);
|
|
2312
2315
|
if (options.broken === "note") {
|
|
@@ -2361,6 +2364,7 @@ function convertRegions(text, excludeLiteralContexts, options, leftover = (piece
|
|
|
2361
2364
|
var JSON_FENCE_LANGS2 = /* @__PURE__ */ new Set(["", "json", "jsonc", "json5"]);
|
|
2362
2365
|
var QUOTE_PREFIX = /^(?: {0,3}> ?)*/;
|
|
2363
2366
|
function convertKindFences(text, options) {
|
|
2367
|
+
if (!text.includes("`") && !text.includes("~")) return text;
|
|
2364
2368
|
const fences = findCodeRanges(text).filter((range) => range.kind === "fence");
|
|
2365
2369
|
let out = text;
|
|
2366
2370
|
for (let i = fences.length - 1; i >= 0; i--) {
|
|
@@ -2415,6 +2419,7 @@ function convertFrontMatterKind(text, options) {
|
|
|
2415
2419
|
return md + openAfter(text.slice(end));
|
|
2416
2420
|
}
|
|
2417
2421
|
function convertCommentKinds(text, options) {
|
|
2422
|
+
if (!text.includes("<!--")) return text;
|
|
2418
2423
|
const quoted = quotedCodeRanges(text);
|
|
2419
2424
|
const comments = [...text.matchAll(/<!--[\s\S]*?(?:-->|$)/g)].filter(
|
|
2420
2425
|
(m) => hasKindKey(m[0]) && !quoted.some(([a, b]) => m.index >= a && m.index < b)
|