@ai-matrx/content-ir 0.19.2 → 0.19.3

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 CHANGED
@@ -1,5 +1,25 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.19.3
4
+
5
+ Automatic republish — despite the generated note, this version carries source
6
+ changes: **RC-B3 round 4 close-out** (verify-RC-B3 § round 4, RC-B3 lane; swept
7
+ into aidream 57b7a956da by the local-work sweeper).
8
+
9
+ - `/source` streaming (D1): a footnote's lazy connector lines that a tree may
10
+ still claim hold the note open; an inline island read out of a paragraph
11
+ that reaches into provisional text is held; a note that took in provisional
12
+ text (a `$$` that may still pair across a blank line) is held. Each pinned by
13
+ a reproducer that fails when its hold alone is removed.
14
+ - D2: the provisional mark in the JSON-head branch (braces balancing on the
15
+ open last line, unrecognized head) is deleted as redundant — planted
16
+ mutation: 1,120 differing streamed prefixes, 0 settled-island changes over
17
+ 12,000 documents.
18
+ - `isSingleDollarMath` (D5): shell arithmetic `$((1+2))$` and PowerShell's
19
+ `$_.Name$` / `$_[0]` are not math (vectors). Read-only measurement over 87,527
20
+ assistant messages + 4,351 notes: 0 such spans in stored content.
21
+ - No consumer action required.
22
+
3
23
  ## 0.19.2
4
24
  ### Unreleased
5
25
 
package/dist/index.cjs CHANGED
@@ -5807,6 +5807,7 @@ var IDENTIFIER = /^[A-Za-z_][A-Za-z0-9_]*$/;
5807
5807
  var MATH_SUFFIX = /^(?:s|es|th|st|nd|rd)$/i;
5808
5808
  function isVariableChain(content, after) {
5809
5809
  if (/^\{[A-Za-z_][\w.]*\}$/.test(content)) return true;
5810
+ if (/^\(\(.*\)\)$/.test(content) || /^_[.[]/.test(content)) return true;
5810
5811
  if (!after) return false;
5811
5812
  if (after[0] === "{") return IDENTIFIER.test(content);
5812
5813
  const run = /^[A-Za-z0-9_]+/.exec(after)?.[0];
@@ -6378,6 +6379,16 @@ var Tokenizer = class {
6378
6379
  holdUndecidedTail() {
6379
6380
  const last = this.lineStarts.length - 1;
6380
6381
  if (last < 0) return;
6382
+ if (this.provisionalFrom < this.n) {
6383
+ for (let b = 0; b < this.blocks.length; b++) {
6384
+ const block = this.blocks[b];
6385
+ if (block.end <= this.provisionalFrom) continue;
6386
+ if (block.kind === "prose") block.inlines = block.inlines.filter((inline) => inline.end <= this.provisionalFrom);
6387
+ else if (block.island?.fromParagraph && block.start < this.provisionalFrom) {
6388
+ this.blocks[b] = { kind: "prose", start: block.start, end: block.end, island: null, inlines: [] };
6389
+ }
6390
+ }
6391
+ }
6381
6392
  if (this.isOpenTail(last)) {
6382
6393
  let b = this.blocks.length - 1;
6383
6394
  while (b >= 0 && this.blocks[b].kind === "gap") b--;
@@ -6675,6 +6686,9 @@ var Tokenizer = class {
6675
6686
  }
6676
6687
  if (this.isOpenTail(k)) return this.heldFootnote(p, open[1]);
6677
6688
  if (FOOTNOTE_DEF.test(line.trimStart())) break;
6689
+ if (this.streaming && TREE_GLYPHS.test(line) && this.connectorRunReachesEnd(k)) {
6690
+ return this.heldFootnote(p, open[1]);
6691
+ }
6678
6692
  const block = this.detectBlock(this.lineStarts[k], k, false);
6679
6693
  if (block && this.mayDissolve(block)) return this.heldFootnote(p, open[1]);
6680
6694
  if (block) break;
@@ -6682,8 +6696,22 @@ var Tokenizer = class {
6682
6696
  }
6683
6697
  const end = this.contentEnds[last];
6684
6698
  if (this.paragraphMayGrow(end)) return this.heldFootnote(p, open[1]);
6699
+ if (this.streaming && end > this.provisionalFrom) return this.heldFootnote(p, open[1]);
6685
6700
  return this.island("footnote_def", p, end, true, { id: open[1] });
6686
6701
  }
6702
+ /** Every line from `k` to the end is a connector line or blank (a tree may still form there). */
6703
+ connectorRunReachesEnd(k) {
6704
+ if (this.lastNonConnectorLine === void 0) {
6705
+ let j = this.lineCount - 1;
6706
+ for (; j >= 0; j--) {
6707
+ this.tick(1);
6708
+ if (!this.lineIsBlank(j) && !TREE_GLYPHS.test(this.lineText(j))) break;
6709
+ }
6710
+ this.lastNonConnectorLine = j;
6711
+ }
6712
+ return k > this.lastNonConnectorLine;
6713
+ }
6714
+ lastNonConnectorLine = void 0;
6687
6715
  /** A footnote whose continuation is still arriving: open to the end of the text. */
6688
6716
  heldFootnote(p, id) {
6689
6717
  return this.island("footnote_def", p, this.n, false, { id });
@@ -6948,7 +6976,6 @@ var Tokenizer = class {
6948
6976
  if (isRecognizedJsonHead(this.text.slice(tp, tp + 512))) {
6949
6977
  return this.island("json", p, this.n, false, jsonMeta(this.text.slice(tp)));
6950
6978
  }
6951
- this.provisionalFrom = Math.min(this.provisionalFrom, p);
6952
6979
  return null;
6953
6980
  }
6954
6981
  if (net !== 0) return null;