@ai-matrx/content-ir 0.16.1 → 0.16.2
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 +8 -0
- package/dist/index.cjs +127 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +127 -17
- package/dist/index.js.map +1 -1
- package/dist/source.cjs +127 -16
- package/dist/source.cjs.map +1 -1
- package/dist/source.d.cts +5 -14
- package/dist/source.d.ts +5 -14
- package/dist/source.js +127 -17
- package/dist/source.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -7,5 +7,5 @@ export { DualGateDefinition, DualGateInput, DualGateResolvedComponent, DualGateR
|
|
|
7
7
|
export { ArrayItemKindBinding, BlockSchemaDraft, ConversionProblem, DroppedMetadata, FieldComparison, ItemKindRefCheck, JsonSchemaNode, KindJsonSchemaExport, KindJsonSchemaOptions, KindSchemaFromJsonResult, SavePlanEntry, SavePlanValidation, SchemaConversionResult, buildAgentSchemaWithRenderBlockSupport, collectReferencedKinds, collectSchemaReferencedKinds, compareWithExistingKindSchema, convertAiSchemaToBlockFields, fieldsToDbPayload, injectKindIntoObjectSchema, isDuplicateBlockSlug, kindSchemaFromJsonSchema, kindSchemaToJsonSchema, normalizeAiSchemaInput, runSchemaConversion, validateBlockSchemaSavePlan } from './convert.cjs';
|
|
8
8
|
export { AnyPartialKindEvent, IR_PARTIAL_KEY, KindVerdict, NODE_OUTCOME_KIND, NodeOutcomeWrapper, PartialKindEvent, PartialKindNode, PartialKindState, RUN_RESULT_KIND, RetractedKindEvent, RunResultWrapper, SupersededKindEvent, advancePartialKind, emitPayloadFence, emitPayloadJson, isProvisionalKind, isTerminalKindEvent, kindVerdictOf, makePartialKindStalenessGate, readNodeOutcomeValue, readOutputRef, readPartialKindEvent, readRunResultValue, rehydrateNodeOutcome, rehydrateRunResult, sanitizeInboundPartialKindMetadata, withRootKind } from './wire.cjs';
|
|
9
9
|
export { ACTION_BY_CLASS, CAPABILITY_BY_CLASS, CLASSES, DIRECTIVE_VERSION, DecodedDirective, DirectiveCapability, DirectiveClass, DirectiveDecodeError, DirectiveDisplay, DirectiveItemKindLookup, DirectiveItemsEdge, DirectiveNounCatalog, DirectiveNounEntry, DirectiveSlug, IN_CONTENT_CLASSES, ItemFact, KindDirectiveShell, RESERVED_PREFIX, SIDE_EFFECT_CLASSES, SLUG_PREFIX, asKindInstance, buildDirectiveSlug, buildKindDirective, capabilityOf, decodeDirective, directiveDisplay, directiveItemKindFromEdges, directiveSlugOf, executesAtOutputRoot, isDirectiveClass, isKindDirective, isLegacyShell, isReservedDirectiveSlug, itemFacts, itemSubtitle, itemTitle, legacyShellUses, looksLikeDirectiveHead, nounFamily, nounLabel, nounTitleColumn, parseDirectiveSlug, resetLegacyShellUses, resolvesInContent, titleCaseToken, tryDecodeDirective, tryDecodeDirectiveContent } from './directives.cjs';
|
|
10
|
-
export { BlockIslandType, CALLOUT_NAMES, CodePointIndex, DisturbedIsland, FENCE_OPENER_WHITESPACE, FENCE_WHITESPACE, InlineIslandType, InnerFenceLine, IslandMeta, IslandType, MapOptions, MappedPosition, MappedRange, NESTING_FENCE_LANGUAGES, ReadXmlTag, SourceBlock, SourceBlockKind, SourceChange, SourceEdit, SourceIsland, SourceSpan, SourceSpliceError, SourceSpliceErrorCode, SpliceIntegrity, SpliceOptions, SpliceResult, TokenizeOptions, XmlContainerTracker, blockAt, blockEdit, blockRangeEdit, buildCodePointIndex, classifyInnerFenceLine, fenceNestsInnerFences, isSingleDollarMath, islandEdit, joinSource, listIslands, looksLikeDisplayMath, mapPosition, mapRange, pairDisplayMath, parseFenceOpener, pendingDisplayMathOpener, readXmlTag, singleDollarMathEnd, spliceSave, splitsSurrogatePair, toCodePointOffset, toUtf16Offset, tokenizeSource, trimFenceLine } from './source.cjs';
|
|
10
|
+
export { BlockIslandType, CALLOUT_NAMES, CodePointIndex, DisturbedIsland, FENCE_OPENER_WHITESPACE, FENCE_WHITESPACE, InlineIslandType, InnerFenceLine, IslandMeta, IslandType, MapOptions, MappedPosition, MappedRange, NESTING_FENCE_LANGUAGES, ReadXmlTag, SourceBlock, SourceBlockKind, SourceChange, SourceEdit, SourceIsland, SourceSpan, SourceSpliceError, SourceSpliceErrorCode, SpliceIntegrity, SpliceOptions, SpliceResult, TokenizeOptions, XmlContainerTracker, blockAt, blockEdit, blockRangeEdit, buildCodePointIndex, classifyInnerFenceLine, fenceNestsInnerFences, isMathPlaceholder, isSingleDollarMath, islandEdit, joinSource, listIslands, looksLikeDisplayMath, mapPosition, mapRange, pairDisplayMath, parseFenceOpener, pendingDisplayMathOpener, readXmlTag, singleDollarMathEnd, spliceSave, splitsSurrogatePair, toCodePointOffset, toUtf16Offset, tokenizeSource, trimFenceLine } from './source.cjs';
|
|
11
11
|
import 'react';
|
package/dist/index.d.ts
CHANGED
|
@@ -7,5 +7,5 @@ export { DualGateDefinition, DualGateInput, DualGateResolvedComponent, DualGateR
|
|
|
7
7
|
export { ArrayItemKindBinding, BlockSchemaDraft, ConversionProblem, DroppedMetadata, FieldComparison, ItemKindRefCheck, JsonSchemaNode, KindJsonSchemaExport, KindJsonSchemaOptions, KindSchemaFromJsonResult, SavePlanEntry, SavePlanValidation, SchemaConversionResult, buildAgentSchemaWithRenderBlockSupport, collectReferencedKinds, collectSchemaReferencedKinds, compareWithExistingKindSchema, convertAiSchemaToBlockFields, fieldsToDbPayload, injectKindIntoObjectSchema, isDuplicateBlockSlug, kindSchemaFromJsonSchema, kindSchemaToJsonSchema, normalizeAiSchemaInput, runSchemaConversion, validateBlockSchemaSavePlan } from './convert.js';
|
|
8
8
|
export { AnyPartialKindEvent, IR_PARTIAL_KEY, KindVerdict, NODE_OUTCOME_KIND, NodeOutcomeWrapper, PartialKindEvent, PartialKindNode, PartialKindState, RUN_RESULT_KIND, RetractedKindEvent, RunResultWrapper, SupersededKindEvent, advancePartialKind, emitPayloadFence, emitPayloadJson, isProvisionalKind, isTerminalKindEvent, kindVerdictOf, makePartialKindStalenessGate, readNodeOutcomeValue, readOutputRef, readPartialKindEvent, readRunResultValue, rehydrateNodeOutcome, rehydrateRunResult, sanitizeInboundPartialKindMetadata, withRootKind } from './wire.js';
|
|
9
9
|
export { ACTION_BY_CLASS, CAPABILITY_BY_CLASS, CLASSES, DIRECTIVE_VERSION, DecodedDirective, DirectiveCapability, DirectiveClass, DirectiveDecodeError, DirectiveDisplay, DirectiveItemKindLookup, DirectiveItemsEdge, DirectiveNounCatalog, DirectiveNounEntry, DirectiveSlug, IN_CONTENT_CLASSES, ItemFact, KindDirectiveShell, RESERVED_PREFIX, SIDE_EFFECT_CLASSES, SLUG_PREFIX, asKindInstance, buildDirectiveSlug, buildKindDirective, capabilityOf, decodeDirective, directiveDisplay, directiveItemKindFromEdges, directiveSlugOf, executesAtOutputRoot, isDirectiveClass, isKindDirective, isLegacyShell, isReservedDirectiveSlug, itemFacts, itemSubtitle, itemTitle, legacyShellUses, looksLikeDirectiveHead, nounFamily, nounLabel, nounTitleColumn, parseDirectiveSlug, resetLegacyShellUses, resolvesInContent, titleCaseToken, tryDecodeDirective, tryDecodeDirectiveContent } from './directives.js';
|
|
10
|
-
export { BlockIslandType, CALLOUT_NAMES, CodePointIndex, DisturbedIsland, FENCE_OPENER_WHITESPACE, FENCE_WHITESPACE, InlineIslandType, InnerFenceLine, IslandMeta, IslandType, MapOptions, MappedPosition, MappedRange, NESTING_FENCE_LANGUAGES, ReadXmlTag, SourceBlock, SourceBlockKind, SourceChange, SourceEdit, SourceIsland, SourceSpan, SourceSpliceError, SourceSpliceErrorCode, SpliceIntegrity, SpliceOptions, SpliceResult, TokenizeOptions, XmlContainerTracker, blockAt, blockEdit, blockRangeEdit, buildCodePointIndex, classifyInnerFenceLine, fenceNestsInnerFences, isSingleDollarMath, islandEdit, joinSource, listIslands, looksLikeDisplayMath, mapPosition, mapRange, pairDisplayMath, parseFenceOpener, pendingDisplayMathOpener, readXmlTag, singleDollarMathEnd, spliceSave, splitsSurrogatePair, toCodePointOffset, toUtf16Offset, tokenizeSource, trimFenceLine } from './source.js';
|
|
10
|
+
export { BlockIslandType, CALLOUT_NAMES, CodePointIndex, DisturbedIsland, FENCE_OPENER_WHITESPACE, FENCE_WHITESPACE, InlineIslandType, InnerFenceLine, IslandMeta, IslandType, MapOptions, MappedPosition, MappedRange, NESTING_FENCE_LANGUAGES, ReadXmlTag, SourceBlock, SourceBlockKind, SourceChange, SourceEdit, SourceIsland, SourceSpan, SourceSpliceError, SourceSpliceErrorCode, SpliceIntegrity, SpliceOptions, SpliceResult, TokenizeOptions, XmlContainerTracker, blockAt, blockEdit, blockRangeEdit, buildCodePointIndex, classifyInnerFenceLine, fenceNestsInnerFences, isMathPlaceholder, isSingleDollarMath, islandEdit, joinSource, listIslands, looksLikeDisplayMath, mapPosition, mapRange, pairDisplayMath, parseFenceOpener, pendingDisplayMathOpener, readXmlTag, singleDollarMathEnd, spliceSave, splitsSurrogatePair, toCodePointOffset, toUtf16Offset, tokenizeSource, trimFenceLine } from './source.js';
|
|
11
11
|
import 'react';
|
package/dist/index.js
CHANGED
|
@@ -5288,6 +5288,9 @@ var STRUCTURAL_MARKDOWN = /\]\(|https?:\/\/|\*\*|(?:^|\n)[ \t]{0,3}#{1,6}[ \t]|(
|
|
|
5288
5288
|
var LATEX_COMMAND = /\\[a-zA-Z]/;
|
|
5289
5289
|
var PROSE_WORD = /[A-Za-z]{3,}/g;
|
|
5290
5290
|
var PROSE_WORD_LIMIT = 6;
|
|
5291
|
+
function isMathPlaceholder(inner) {
|
|
5292
|
+
return /^[\s.…·⋯_-]*$/.test(inner) && /[.…·⋯]/.test(inner);
|
|
5293
|
+
}
|
|
5291
5294
|
function opensFlowBlock(text, open) {
|
|
5292
5295
|
for (let k = open - 1; k >= 0 && text[k] !== "\n"; k--) if (text[k] !== " " && text[k] !== " ") return false;
|
|
5293
5296
|
for (let k = open + 2; k < text.length && text[k] !== "\n"; k++) if (text[k] !== " " && text[k] !== " " && text[k] !== "\r") return false;
|
|
@@ -5306,13 +5309,84 @@ function looksLikeDisplayMath(inner, flow = false) {
|
|
|
5306
5309
|
}
|
|
5307
5310
|
function codeRanges(text) {
|
|
5308
5311
|
const ranges = [];
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
|
|
5313
|
-
|
|
5312
|
+
const n = text.length;
|
|
5313
|
+
let fence = null;
|
|
5314
|
+
let para = -1;
|
|
5315
|
+
const spans = (from, to) => {
|
|
5316
|
+
const runs = [];
|
|
5317
|
+
for (let k = from; k < to; ) {
|
|
5318
|
+
if (text.charCodeAt(k) !== 96) {
|
|
5319
|
+
k++;
|
|
5320
|
+
continue;
|
|
5321
|
+
}
|
|
5322
|
+
let len = 1;
|
|
5323
|
+
while (k + len < to && text.charCodeAt(k + len) === 96) len++;
|
|
5324
|
+
runs.push([k, len]);
|
|
5325
|
+
k += len;
|
|
5326
|
+
}
|
|
5327
|
+
const nextSame = new Array(runs.length).fill(-1);
|
|
5328
|
+
const last = /* @__PURE__ */ new Map();
|
|
5329
|
+
for (let r = runs.length - 1; r >= 0; r--) {
|
|
5330
|
+
const len = runs[r][1];
|
|
5331
|
+
nextSame[r] = last.get(len) ?? -1;
|
|
5332
|
+
last.set(len, r);
|
|
5333
|
+
}
|
|
5334
|
+
for (let r = 0; r < runs.length; ) {
|
|
5335
|
+
const j = nextSame[r];
|
|
5336
|
+
if (j === -1) {
|
|
5337
|
+
r++;
|
|
5338
|
+
continue;
|
|
5339
|
+
}
|
|
5340
|
+
const [s0] = runs[r];
|
|
5341
|
+
const [s1, l1] = runs[j];
|
|
5342
|
+
ranges.push([s0, s1 + l1]);
|
|
5343
|
+
r = j + 1;
|
|
5314
5344
|
}
|
|
5315
|
-
}
|
|
5345
|
+
};
|
|
5346
|
+
let pos = 0;
|
|
5347
|
+
while (pos <= n) {
|
|
5348
|
+
const nl = text.indexOf("\n", pos);
|
|
5349
|
+
const lineEnd = nl === -1 ? n : nl;
|
|
5350
|
+
const line = text.slice(pos, lineEnd);
|
|
5351
|
+
let indent = 0;
|
|
5352
|
+
while (indent < line.length && line[indent] === " ") indent++;
|
|
5353
|
+
const body = line.slice(indent);
|
|
5354
|
+
if (fence) {
|
|
5355
|
+
const trimmed = trimFenceLine(line);
|
|
5356
|
+
let closes = false;
|
|
5357
|
+
if (fence.char === "`") {
|
|
5358
|
+
const kind = classifyInnerFenceLine(trimmed, fence.len, fence.nests, fence.depth);
|
|
5359
|
+
if (kind === "open-nested") fence.depth++;
|
|
5360
|
+
else if (kind === "close-nested") fence.depth--;
|
|
5361
|
+
else if (kind === "close-outer") closes = indent <= 3;
|
|
5362
|
+
} else {
|
|
5363
|
+
let t = 0;
|
|
5364
|
+
while (t < trimmed.length && trimmed[t] === "~") t++;
|
|
5365
|
+
closes = indent <= 3 && t >= fence.len && trimFenceLine(trimmed.slice(t)) === "";
|
|
5366
|
+
}
|
|
5367
|
+
if (closes) {
|
|
5368
|
+
ranges.push([fence.start, lineEnd]);
|
|
5369
|
+
fence = null;
|
|
5370
|
+
}
|
|
5371
|
+
} else {
|
|
5372
|
+
const opener = indent <= 3 ? /^(`{3,}|~{3,})(.*)$/.exec(body) : null;
|
|
5373
|
+
const info = opener ? opener[2] : "";
|
|
5374
|
+
if (opener && !(opener[1][0] === "`" && info.includes("`"))) {
|
|
5375
|
+
if (para !== -1) spans(para, pos);
|
|
5376
|
+
para = -1;
|
|
5377
|
+
const char = opener[1][0];
|
|
5378
|
+
const parsed = char === "`" ? parseFenceOpener(line) : null;
|
|
5379
|
+
fence = { char, len: opener[1].length, start: pos, nests: fenceNestsInnerFences(parsed?.lang), depth: 0 };
|
|
5380
|
+
} else if (body.trim() === "") {
|
|
5381
|
+
if (para !== -1) spans(para, pos);
|
|
5382
|
+
para = -1;
|
|
5383
|
+
} else if (para === -1) para = pos;
|
|
5384
|
+
}
|
|
5385
|
+
if (nl === -1) break;
|
|
5386
|
+
pos = nl + 1;
|
|
5387
|
+
}
|
|
5388
|
+
if (fence) ranges.push([fence.start, n]);
|
|
5389
|
+
else if (para !== -1) spans(para, n);
|
|
5316
5390
|
return ranges.sort((a, b) => a[0] - b[0]);
|
|
5317
5391
|
}
|
|
5318
5392
|
function pendingDisplayMathOpener(text) {
|
|
@@ -5335,6 +5409,10 @@ function pendingDisplayMathOpener(text) {
|
|
|
5335
5409
|
const open = tokens[j];
|
|
5336
5410
|
const close = tokens[j + 1];
|
|
5337
5411
|
if (close === void 0) break;
|
|
5412
|
+
if (isMathPlaceholder(text.slice(open + 2, close))) {
|
|
5413
|
+
j += 2;
|
|
5414
|
+
continue;
|
|
5415
|
+
}
|
|
5338
5416
|
if (looksLikeDisplayMath(text.slice(open + 2, close), opensFlowBlock(text, open))) {
|
|
5339
5417
|
paired.add(open);
|
|
5340
5418
|
paired.add(close);
|
|
@@ -5379,6 +5457,10 @@ function pairDisplayMath(text) {
|
|
|
5379
5457
|
const open = tokens[j];
|
|
5380
5458
|
const close = tokens[j + 1];
|
|
5381
5459
|
if (close === void 0) break;
|
|
5460
|
+
if (isMathPlaceholder(text.slice(open + 2, close))) {
|
|
5461
|
+
j += 2;
|
|
5462
|
+
continue;
|
|
5463
|
+
}
|
|
5382
5464
|
if (looksLikeDisplayMath(text.slice(open + 2, close), opensFlowBlock(text, open))) {
|
|
5383
5465
|
pairs.set(open, close);
|
|
5384
5466
|
j += 2;
|
|
@@ -5716,6 +5798,19 @@ var Tokenizer = class {
|
|
|
5716
5798
|
this.mathPairs = pairDisplayMath(text);
|
|
5717
5799
|
this.provisionalFrom = streaming ? pendingDisplayMathOpener(text) : -1;
|
|
5718
5800
|
if (this.provisionalFrom === -1) this.provisionalFrom = Number.POSITIVE_INFINITY;
|
|
5801
|
+
if (streaming && text.includes("$$")) {
|
|
5802
|
+
for (const pad of ["`", "``", "```", "~~~"]) {
|
|
5803
|
+
const alt = pairDisplayMath(text + pad);
|
|
5804
|
+
for (const [open, close] of this.mathPairs) {
|
|
5805
|
+
if (alt.get(open) !== close) this.provisionalFrom = Math.min(this.provisionalFrom, open);
|
|
5806
|
+
}
|
|
5807
|
+
for (const [open, close] of alt) {
|
|
5808
|
+
if (close < text.length && this.mathPairs.get(open) !== close) {
|
|
5809
|
+
this.provisionalFrom = Math.min(this.provisionalFrom, open);
|
|
5810
|
+
}
|
|
5811
|
+
}
|
|
5812
|
+
}
|
|
5813
|
+
}
|
|
5719
5814
|
let start = 0;
|
|
5720
5815
|
for (let i = 0; i < text.length; i++) {
|
|
5721
5816
|
if (text.charCodeAt(i) === 10) {
|
|
@@ -5756,13 +5851,17 @@ var Tokenizer = class {
|
|
|
5756
5851
|
/**
|
|
5757
5852
|
* Streaming: an open last line that begins with `{` is undecided — each new
|
|
5758
5853
|
* byte can balance or unbalance its braces and flip the whole line between
|
|
5759
|
-
* prose and a JSON island — so
|
|
5854
|
+
* prose and a JSON island — and so is a line that is exactly one allowed
|
|
5855
|
+
* HTML tag so far; both are provisional until they end (G5).
|
|
5760
5856
|
*/
|
|
5761
5857
|
markOpenJsonTail() {
|
|
5762
5858
|
const last = this.lineStarts.length - 1;
|
|
5763
5859
|
if (!this.isOpenTail(last)) return;
|
|
5764
5860
|
const start = this.lineStarts[last];
|
|
5765
|
-
|
|
5861
|
+
const t = this.lineText(last).trim();
|
|
5862
|
+
const oneTag = t.startsWith("<") ? readXmlTag(t, 0) : null;
|
|
5863
|
+
const loneTag = !!oneTag && oneTag.raw === t && ALLOWED_RAW_HTML_TAGS.has(oneTag.tagName.toLowerCase());
|
|
5864
|
+
if (t.startsWith("{") || loneTag) {
|
|
5766
5865
|
this.provisionalFrom = Math.min(this.provisionalFrom, start);
|
|
5767
5866
|
}
|
|
5768
5867
|
}
|
|
@@ -6056,10 +6155,16 @@ var Tokenizer = class {
|
|
|
6056
6155
|
continue;
|
|
6057
6156
|
}
|
|
6058
6157
|
if (FOOTNOTE_DEF.test(line.trimStart()) || this.detectBlock(this.lineStarts[k], k, false)) break;
|
|
6059
|
-
if (this.isOpenTail(k))
|
|
6158
|
+
if (this.isOpenTail(k)) return this.heldFootnote(p, open[1]);
|
|
6060
6159
|
last = k;
|
|
6061
6160
|
}
|
|
6062
|
-
|
|
6161
|
+
const end = this.contentEnds[last];
|
|
6162
|
+
if (this.paragraphMayGrow(end)) return this.heldFootnote(p, open[1]);
|
|
6163
|
+
return this.island("footnote_def", p, end, true, { id: open[1] });
|
|
6164
|
+
}
|
|
6165
|
+
/** A footnote whose continuation is still arriving: open to the end of the text. */
|
|
6166
|
+
heldFootnote(p, id) {
|
|
6167
|
+
return this.island("footnote_def", p, this.n, false, { id });
|
|
6063
6168
|
}
|
|
6064
6169
|
/**
|
|
6065
6170
|
* Backtick fence — the renderer splitter's close rules: JSON-string aware for
|
|
@@ -6303,7 +6408,12 @@ var Tokenizer = class {
|
|
|
6303
6408
|
return this.island("html_block", p, close.index + close[0].length, true, { tag: name });
|
|
6304
6409
|
}
|
|
6305
6410
|
const typeSix = HTML_BLOCK_LEVEL_TAGS.has(name);
|
|
6306
|
-
const
|
|
6411
|
+
const loneTag = atParaStart && t.trimEnd() === tag.raw;
|
|
6412
|
+
if (loneTag && this.isOpenTail(li)) {
|
|
6413
|
+
this.provisionalFrom = Math.min(this.provisionalFrom, p);
|
|
6414
|
+
return null;
|
|
6415
|
+
}
|
|
6416
|
+
const typeSeven = loneTag;
|
|
6307
6417
|
if (!typeSix && !typeSeven) return null;
|
|
6308
6418
|
let end = this.contentEnds[li];
|
|
6309
6419
|
for (let k = li + 1; k < this.lineCount && !this.lineIsBlank(k); k++) {
|
|
@@ -6395,10 +6505,6 @@ var Tokenizer = class {
|
|
|
6395
6505
|
let breakLine = -1;
|
|
6396
6506
|
for (let k = li + 1; k < this.lineCount; k++) {
|
|
6397
6507
|
if (this.lineIsBlank(k)) break;
|
|
6398
|
-
if (this.lineStarts[k] >= this.provisionalFrom) {
|
|
6399
|
-
end = this.n;
|
|
6400
|
-
break;
|
|
6401
|
-
}
|
|
6402
6508
|
if (this.detectBlock(this.lineStarts[k], k, false)) {
|
|
6403
6509
|
breakLine = k;
|
|
6404
6510
|
break;
|
|
@@ -6541,7 +6647,11 @@ var Tokenizer = class {
|
|
|
6541
6647
|
}
|
|
6542
6648
|
const end = singleDollarMathEnd(text, i, pe);
|
|
6543
6649
|
this.tick(end > 0 ? end - i : Math.min(403, pe - i));
|
|
6544
|
-
if (end > 0 &&
|
|
6650
|
+
if (end > 0 && this.streaming && end === this.n) {
|
|
6651
|
+
this.provisionalFrom = Math.min(this.provisionalFrom, i);
|
|
6652
|
+
return { inlines, breakIsland: null, orphan: false };
|
|
6653
|
+
}
|
|
6654
|
+
if (end > 0) {
|
|
6545
6655
|
inlines.push(this.island("math_inline", i, end, true, { delimiter: "$" }));
|
|
6546
6656
|
i = end;
|
|
6547
6657
|
continue;
|
|
@@ -7032,6 +7142,6 @@ function mapRange(changes, start, end, unit = "utf16") {
|
|
|
7032
7142
|
return { start: newStart, end: newEnd, touched, collapsed: newEnd === newStart && end > start };
|
|
7033
7143
|
}
|
|
7034
7144
|
|
|
7035
|
-
export { ACTION_BY_CLASS, CALLOUT_NAMES, CAPABILITY_BY_CLASS, CLASSES, DIRECTIVE_VERSION, DirectiveDecodeError, FENCE_OPENER_WHITESPACE, FENCE_WHITESPACE, IN_CONTENT_CLASSES, IR_ENVELOPE_CACHE_VERSION, IR_ENVELOPE_KEY, IR_PARTIAL_KEY, IR_VERSION, IrTree, JSON_DISCRIMINATOR, JsonStreamTokenizer, KIND_KEY, KindStorageError, KindStreamParser, NESTING_FENCE_LANGUAGES, NODE_OUTCOME_KIND, ParseSession, RESERVED_PREFIX, ROOT_STORAGE_NAME, RUN_RESULT_KIND, SIDE_EFFECT_CLASSES, SLUG_PREFIX, SourceSpliceError, XmlContainerTracker, advancePartialKind, asKindInstance, blockAt, blockEdit, blockRangeEdit, buildAgentSchemaWithRenderBlockSupport, buildCodePointIndex, buildCompliantKindSnapshot, buildDirectiveSlug, buildKindDirective, capabilityOf, classifyInboundEnvelopeMetadata, classifyInnerFenceLine, collectReferencedKinds, collectSchemaReferencedKinds, compareWithExistingKindSchema, convertAiSchemaToBlockFields, createFingerprinter, createKindStreamParser, decodeDirective, describeDualGateFailure, directiveDisplay, directiveItemKindFromEdges, directiveSlugOf, disposeParseSession, emitPayloadFence, emitPayloadJson, emptyValueForFieldSchema, envelopeCacheFromEnvelopes, envelopeFromCompleteValue, executesAtOutputRoot, fenceDiscriminator, fenceNestsInnerFences, fieldsToDbPayload, fingerprintText, formatBlockLabel, getParseSession, injectKindIntoObjectSchema, irPathIsUnderOrEqual, irPathKey, irPathLabel, irPathsEqual, isCanonicalBlockIR, isDirectiveClass, isDuplicateBlockSlug, isEmptyResidue, isIrEnvelopeCache, isJsonAnyField, isKindDirective, isLegacyShell, isProvisionalKind, isReservedDirectiveSlug, isScalarArrayType, isSingleDollarMath, isTerminalKindEvent, islandEdit, itemFacts, itemSubtitle, itemTitle, joinSource, kindSchemaFromJsonSchema, kindSchemaToJsonSchema, kindSchemaToStorage, kindVerdictOf, legacyShellUses, listIslands, looksLikeDirectiveHead, looksLikeDisplayMath, makePartialKindStalenessGate, mapPosition, mapRange, mergeResidueIntoValue, normalizeAiSchemaInput, normalizeJsonRegion, nounFamily, nounLabel, nounTitleColumn, openParseSession, pairDisplayMath, parseDirectiveSlug, parseFenceOpener, pendingDisplayMathOpener, readEnvelope, readNodeOutcomeValue, readObjectKind, readOutputRef, readPartialKindEvent, readRunResultValue, readXmlTag, reconstructRegionValue, rehydrateNodeOutcome, rehydrateRunResult, resetLegacyShellUses, resolvesInContent, reuseEnvelopeIfCurrent, runKindDualGate, runSchemaConversion, sanitizeInboundEnvelopeMetadata, sanitizeInboundPartialKindMetadata, scalarArrayItemType, schemaLayoutMode, schemaStructureDepth, setJsonRootKeyLookup, singleDollarMathEnd, spliceSave, splitsSurrogatePair, storageToKindSchema, stripKindDeep, titleCaseToken, toCodePointOffset, toUtf16Offset, tokenizeSource, trimFenceLine, tryDecodeDirective, tryDecodeDirectiveContent, validateBlockSchemaSavePlan, validateStructuralLeg, withRootKind, xmlDiscriminator };
|
|
7145
|
+
export { ACTION_BY_CLASS, CALLOUT_NAMES, CAPABILITY_BY_CLASS, CLASSES, DIRECTIVE_VERSION, DirectiveDecodeError, FENCE_OPENER_WHITESPACE, FENCE_WHITESPACE, IN_CONTENT_CLASSES, IR_ENVELOPE_CACHE_VERSION, IR_ENVELOPE_KEY, IR_PARTIAL_KEY, IR_VERSION, IrTree, JSON_DISCRIMINATOR, JsonStreamTokenizer, KIND_KEY, KindStorageError, KindStreamParser, NESTING_FENCE_LANGUAGES, NODE_OUTCOME_KIND, ParseSession, RESERVED_PREFIX, ROOT_STORAGE_NAME, RUN_RESULT_KIND, SIDE_EFFECT_CLASSES, SLUG_PREFIX, SourceSpliceError, XmlContainerTracker, advancePartialKind, asKindInstance, blockAt, blockEdit, blockRangeEdit, buildAgentSchemaWithRenderBlockSupport, buildCodePointIndex, buildCompliantKindSnapshot, buildDirectiveSlug, buildKindDirective, capabilityOf, classifyInboundEnvelopeMetadata, classifyInnerFenceLine, collectReferencedKinds, collectSchemaReferencedKinds, compareWithExistingKindSchema, convertAiSchemaToBlockFields, createFingerprinter, createKindStreamParser, decodeDirective, describeDualGateFailure, directiveDisplay, directiveItemKindFromEdges, directiveSlugOf, disposeParseSession, emitPayloadFence, emitPayloadJson, emptyValueForFieldSchema, envelopeCacheFromEnvelopes, envelopeFromCompleteValue, executesAtOutputRoot, fenceDiscriminator, fenceNestsInnerFences, fieldsToDbPayload, fingerprintText, formatBlockLabel, getParseSession, injectKindIntoObjectSchema, irPathIsUnderOrEqual, irPathKey, irPathLabel, irPathsEqual, isCanonicalBlockIR, isDirectiveClass, isDuplicateBlockSlug, isEmptyResidue, isIrEnvelopeCache, isJsonAnyField, isKindDirective, isLegacyShell, isMathPlaceholder, isProvisionalKind, isReservedDirectiveSlug, isScalarArrayType, isSingleDollarMath, isTerminalKindEvent, islandEdit, itemFacts, itemSubtitle, itemTitle, joinSource, kindSchemaFromJsonSchema, kindSchemaToJsonSchema, kindSchemaToStorage, kindVerdictOf, legacyShellUses, listIslands, looksLikeDirectiveHead, looksLikeDisplayMath, makePartialKindStalenessGate, mapPosition, mapRange, mergeResidueIntoValue, normalizeAiSchemaInput, normalizeJsonRegion, nounFamily, nounLabel, nounTitleColumn, openParseSession, pairDisplayMath, parseDirectiveSlug, parseFenceOpener, pendingDisplayMathOpener, readEnvelope, readNodeOutcomeValue, readObjectKind, readOutputRef, readPartialKindEvent, readRunResultValue, readXmlTag, reconstructRegionValue, rehydrateNodeOutcome, rehydrateRunResult, resetLegacyShellUses, resolvesInContent, reuseEnvelopeIfCurrent, runKindDualGate, runSchemaConversion, sanitizeInboundEnvelopeMetadata, sanitizeInboundPartialKindMetadata, scalarArrayItemType, schemaLayoutMode, schemaStructureDepth, setJsonRootKeyLookup, singleDollarMathEnd, spliceSave, splitsSurrogatePair, storageToKindSchema, stripKindDeep, titleCaseToken, toCodePointOffset, toUtf16Offset, tokenizeSource, trimFenceLine, tryDecodeDirective, tryDecodeDirectiveContent, validateBlockSchemaSavePlan, validateStructuralLeg, withRootKind, xmlDiscriminator };
|
|
7036
7146
|
//# sourceMappingURL=index.js.map
|
|
7037
7147
|
//# sourceMappingURL=index.js.map
|