@ai-matrx/content-ir 0.19.0 → 0.19.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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.19.1
4
+
5
+ Automatic changed-only republish (docs/metadata drift since the last tag — see
6
+ `git diff npm/content-ir-core/v0.19.0..npm/content-ir-core/v0.19.1 -- apps/shared/content-ir-core`).
7
+ No source changes intended and no consumer action required.
8
+
3
9
  ## 0.19.0 — kind validation behind a schema-source port (Matrx Alchemy ALC-13)
4
10
 
5
11
  `/registry` (and the root) now export `createKindValidator(source, options?)`,
@@ -976,3 +982,4 @@ unchanged. Two things are worth doing at your next working session:
976
982
  - Added ESM and declaration builds, package linting, packed-artifact analysis, and an isolated consumer canary.
977
983
  - Preserved all parser, session, normalization, schema conversion, and structural-validation behavior with the existing shared fixtures and fingerprint vectors.
978
984
 
985
+
package/dist/index.cjs CHANGED
@@ -5648,7 +5648,7 @@ function pendingCodeSpanStart(text) {
5648
5648
  const n = text.length;
5649
5649
  if (n === 0 || /\n[ \t]*\n[ \t]*$/.test(text)) return -1;
5650
5650
  const lastLine = text.slice(text.lastIndexOf("\n") + 1);
5651
- if (lastLine && /^(?: {0,3}>[ \t]?)*[ \t]*$/.test(lastLine)) return pendingCodeSpanStart(`${text}x`);
5651
+ if (lastLine && /^(?: {0,3}>[ \t]?)*[ \t\r]*$/.test(lastLine)) return pendingCodeSpanStart(`${text}x`);
5652
5652
  const s = scan(text);
5653
5653
  const para = s.pendingPara;
5654
5654
  if (s.endsInFence || para === -1) return -1;
@@ -5812,7 +5812,7 @@ function isVariableChain(content, after) {
5812
5812
  const run = /^[A-Za-z0-9_]+/.exec(after)?.[0];
5813
5813
  if (!run) return false;
5814
5814
  if (after.length === 1) return false;
5815
- if (/^[A-Za-z_][A-Za-z0-9_]*[.@-]$/.test(content)) return true;
5815
+ if (/^[A-Za-z_][A-Za-z0-9_]*(?:[.@-]|->|::)$/.test(content)) return true;
5816
5816
  return IDENTIFIER.test(content) && !MATH_SUFFIX.test(run);
5817
5817
  }
5818
5818
  var FUNCTION_NAMES = /* @__PURE__ */ new Set([
@@ -6217,7 +6217,7 @@ var Tokenizer = class {
6217
6217
  if (close >= span) this.provisionalFrom = Math.min(this.provisionalFrom, open);
6218
6218
  }
6219
6219
  }
6220
- for (const pad of ["`", "``", "```", "~~~"]) {
6220
+ for (const pad of ["`", "``", "```", "~~~", "$"]) {
6221
6221
  const alt = pairDisplayMath(text + pad);
6222
6222
  for (const [open, close] of this.mathPairs) {
6223
6223
  if (alt.get(open) !== close) this.provisionalFrom = Math.min(this.provisionalFrom, open);
@@ -6249,19 +6249,6 @@ var Tokenizer = class {
6249
6249
  provisionalFrom = Number.POSITIVE_INFINITY;
6250
6250
  /** Streaming: the text ends in a lone CR whose LF has not arrived yet. */
6251
6251
  pendingCR = false;
6252
- /**
6253
- * Streaming: an open last line that begins with `{` is undecided — each new
6254
- * byte can balance or unbalance its braces and flip the whole line between
6255
- * prose and a JSON island — so it is provisional until it ends (G5).
6256
- * (A lone HTML tag on that line is held by {@link holdUndecidedTail}.)
6257
- */
6258
- markOpenJsonTail() {
6259
- const last = this.lineStarts.length - 1;
6260
- if (!this.isOpenTail(last)) return;
6261
- if (this.lineText(last).trim().startsWith("{")) {
6262
- this.provisionalFrom = Math.min(this.provisionalFrom, this.lineStarts[last]);
6263
- }
6264
- }
6265
6252
  /**
6266
6253
  * `text.indexOf(needle, from)` in O(log k): the first query for a needle
6267
6254
  * indexes all of its occurrences once, so repeated searches for a closer
@@ -6296,7 +6283,7 @@ var Tokenizer = class {
6296
6283
  const rest = this.n - pe;
6297
6284
  if (rest === 0) return true;
6298
6285
  const tail = this.text.slice(pe);
6299
- return /^(?:\r\n|\r|\n)[ \t]*$/.test(tail);
6286
+ return /^(?:\r\n|\r|\n)[ \t\r]*$/.test(tail);
6300
6287
  }
6301
6288
  /**
6302
6289
  * Streaming: an open block that may still turn back into prose — a `$$`
@@ -6305,7 +6292,9 @@ var Tokenizer = class {
6305
6292
  * or any opener that is itself still arriving on the open last line.
6306
6293
  */
6307
6294
  mayDissolve(block) {
6308
- if (!this.streaming || block.complete) return false;
6295
+ if (!this.streaming) return false;
6296
+ if (block.start >= this.provisionalFrom) return true;
6297
+ if (block.complete) return false;
6309
6298
  if (block.type === "math_block" || block.type === "json") return true;
6310
6299
  return this.isOpenTail(this.lineOf(block.start));
6311
6300
  }
@@ -6344,7 +6333,6 @@ var Tokenizer = class {
6344
6333
  return this.text.slice(this.lineStarts[li], this.contentEnds[li]);
6345
6334
  }
6346
6335
  run() {
6347
- if (this.streaming) this.markOpenJsonTail();
6348
6336
  let pos = 0;
6349
6337
  while (pos < this.n) {
6350
6338
  const li = this.lineOf(pos);
@@ -6582,7 +6570,7 @@ var Tokenizer = class {
6582
6570
  return { type, start, end, complete, meta };
6583
6571
  }
6584
6572
  frontMatter(li, t) {
6585
- const fence = this.lineText(li);
6573
+ const fence = this.lineText(li).replace(/^\uFEFF/, "");
6586
6574
  if (fence !== "---" && fence !== "+++" || t !== fence) return null;
6587
6575
  const toml = fence === "+++";
6588
6576
  let sawContent = false;
@@ -6593,9 +6581,13 @@ var Tokenizer = class {
6593
6581
  }
6594
6582
  if (!NOT_WHITESPACE.test(line)) continue;
6595
6583
  const shaped = toml ? /^\s*(?:[A-Za-z0-9_."-]+\s*=|\[|#)/.test(line) : /^(?:[A-Za-z0-9_"'-][^:]*:(?:\s|$)|\s+\S|-\s|#)/.test(line);
6596
- if (!shaped) return null;
6584
+ if (!shaped) {
6585
+ if (this.isOpenTail(k)) break;
6586
+ return null;
6587
+ }
6597
6588
  sawContent = true;
6598
6589
  }
6590
+ if (this.streaming) return this.island("front_matter", 0, this.n, false, { format: toml ? "toml" : "yaml" });
6599
6591
  return null;
6600
6592
  }
6601
6593
  /**
@@ -6996,7 +6988,7 @@ var Tokenizer = class {
6996
6988
  const block = this.detectBlock(this.lineStarts[k], k, false);
6997
6989
  if (block) {
6998
6990
  breakLine = k;
6999
- if (this.mayDissolve(block) || this.streaming && block.start >= this.provisionalFrom) {
6991
+ if (this.mayDissolve(block)) {
7000
6992
  this.undecidedBreaks.add(end);
7001
6993
  }
7002
6994
  break;