@ai-matrx/content-ir 0.22.5 → 0.22.7

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,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.22.7
4
+
5
+ - `kindSchemaFromJsonSchema` / `convertAiSchemaToBlockFields`: a `$ref` to a `$def` that does NOT declare its kind (`__kind` const/enum) is a plain nested structure and now converts IN PLACE — `inline_object` for a field, a nullable `inline_object` for `anyOf: [$ref, null]`. It used to become `{type:"object", kind:"<ClassName>"}`, so the parser demanded `__kind === "<ClassName>"` of every pydantic sub-structure (they carry none) and the whole instance resolved `raw` the moment a kind's database schema reached the registry — the generic key/value fallback instead of the kind's component (Applet builder floating window, 2026-10-07). Live corpus: 397 optional-`__kind` defs across 134 active kinds, plus 89 defs with no `__kind`. A def that declares its kind is still a kind reference; array-item `$ref`s are unchanged.
6
+
7
+ **Consumer action:** `pnpm up @ai-matrx/content-ir@latest`. Nothing else — the kind registry's cold fetch derives through this converter.
8
+
9
+ ## 0.22.6
10
+
11
+ - `startsLikeTableRow` / `isGrowingDelimiterRow` (the streaming forms of the table rule) now live in `source/gfm-table.ts` beside the rest of THE GFM table rule; the public exports are unchanged (AP-2: `check-table-readers` green with an empty baseline).
12
+
13
+ **Consumer action:** none.
14
+
3
15
  ## 0.22.5
4
16
 
5
17
  Automatic changed-only republish (docs/metadata drift since the last tag — see
package/dist/convert.cjs CHANGED
@@ -517,7 +517,7 @@ function buildAgentSchemaWithRenderBlockSupport(input, rootKindSlug, arrayBindin
517
517
  }
518
518
  function resolveRef(ref, ctx) {
519
519
  if (ref === "#" || ref === "#/") {
520
- return { slug: ctx.schemaName, node: ctx.rootSchema };
520
+ return { slug: ctx.schemaName, node: ctx.rootSchema, declaresKind: true };
521
521
  }
522
522
  const match = /^#\/(?:\$defs|definitions)\/(.+)$/.exec(ref);
523
523
  if (!match) return null;
@@ -527,7 +527,11 @@ function resolveRef(ref, ctx) {
527
527
  const node = ctx.defs[name];
528
528
  if (!isRecord(node)) return null;
529
529
  const declared = isRecord(node.properties) ? readBlockKindFromProperties(node.properties) : null;
530
- return { slug: declared ?? name, node };
530
+ return { slug: declared ?? name, node, declaresKind: declared !== null };
531
+ }
532
+ function inlineRefNode(refNode, resolved) {
533
+ const { $ref: _ref, ...beside } = refNode;
534
+ return { ...resolved.node, ...beside };
531
535
  }
532
536
  function refToObjectField(resolved, path, ctx) {
533
537
  if (ctx.refsInProgress.has(resolved.slug)) return;
@@ -597,6 +601,29 @@ function convertPropertyCore(fieldName, node, required, path, ctx) {
597
601
  });
598
602
  return null;
599
603
  }
604
+ if (!resolved.declaresKind) {
605
+ const guard = `$def:${node.$ref}`;
606
+ if (ctx.refsInProgress.has(guard)) {
607
+ ctx.problems.push({
608
+ severity: "info",
609
+ path,
610
+ message: `Self-referencing structure "${node.$ref}" \u2014 carried as any JSON value (json).`
611
+ });
612
+ return { ...requiredNullableFlags(required), type: "json" };
613
+ }
614
+ ctx.refsInProgress.add(guard);
615
+ try {
616
+ return convertPropertyCore(
617
+ fieldName,
618
+ inlineRefNode(node, resolved),
619
+ required,
620
+ path,
621
+ ctx
622
+ );
623
+ } finally {
624
+ ctx.refsInProgress.delete(guard);
625
+ }
626
+ }
600
627
  refToObjectField(resolved, path, ctx);
601
628
  return {
602
629
  ...requiredNullableFlags(required),
@@ -628,6 +655,10 @@ function convertPropertyCore(fieldName, node, required, path, ctx) {
628
655
  unsupported = true;
629
656
  continue;
630
657
  }
658
+ if (!resolvedVariant.declaresKind) {
659
+ anonymousObjects.push(inlineRefNode(variant, resolvedVariant));
660
+ continue;
661
+ }
631
662
  refToObjectField(resolvedVariant, path, ctx);
632
663
  memberKinds.push(resolvedVariant.slug);
633
664
  continue;