@ai-matrx/content-ir-react 0.2.0 → 0.5.0
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 +36 -0
- package/dist/index.cjs +11 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +31 -1
- package/dist/index.d.ts +31 -1
- package/dist/index.js +11 -3
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.0 — 2026-08-29
|
|
4
|
+
|
|
5
|
+
- **`hasComponentSource` — the seam that lets component BODIES load lazily.**
|
|
6
|
+
`KindComponentRow` gains optional `hasComponentSource` (a host whose warm
|
|
7
|
+
list is body-less supplies it; omitted → derived from `componentSource`,
|
|
8
|
+
so eager hosts change nothing) and `ComponentResolution` carries it
|
|
9
|
+
computed. `routeToDbComponent` now gates on the FLAG, never on body
|
|
10
|
+
presence: a body-less row from a lazy warm list still routes to
|
|
11
|
+
`db_kind_component`, and the renderer fetches/compiles the body per kind
|
|
12
|
+
on demand. A row that truly has no body screams and falls through exactly
|
|
13
|
+
as before. Pinned by a new kind-route test.
|
|
14
|
+
|
|
15
|
+
## 0.4.0 — 2026-08-29
|
|
16
|
+
|
|
17
|
+
- **NO EXCEPTIONS for a root `__kind` (Arman's ruling, 2026-08-29).** The
|
|
18
|
+
strangler carve-out that left an UNREGISTERED kind slug untouched ("not
|
|
19
|
+
ours to claim" — teaching content, typos) is retired: any envelope with a
|
|
20
|
+
non-empty root kind now routes into the kind system. Unregistered slugs
|
|
21
|
+
reach the generic floor with the new `GenericFallbackReason`
|
|
22
|
+
`"unregistered"` (kind-preserved raws included), so the reader always sees
|
|
23
|
+
the payload acknowledged AS a kind instance — never an anonymous code
|
|
24
|
+
block. Both former pass-through tests flipped to pin the new behavior.
|
|
25
|
+
|
|
26
|
+
## 0.3.0 — 2026-08-29
|
|
27
|
+
|
|
28
|
+
- **`broken-instance` — the kind route now acknowledges BROKEN kind
|
|
29
|
+
instances.** An envelope whose root is a kind-preserved raw
|
|
30
|
+
(`kindState: "raw"`, kernel ≥ 0.3.0 preserves the kind on structural
|
|
31
|
+
failures too) routes to the generic floor with
|
|
32
|
+
`reason: "broken-instance"` when the kind is registered — never to a
|
|
33
|
+
bridge/db component (they must not receive non-compliant values) and never
|
|
34
|
+
as anonymous raw JSON. Unregistered slugs still pass through untouched.
|
|
35
|
+
New `GenericFallbackReason` member; `GenericStructuredView`'s honesty note
|
|
36
|
+
names the schema mismatch. Pinned by two new kind-route tests.
|
|
37
|
+
- Depends on `@ai-matrx/content-ir` 0.3.0.
|
|
38
|
+
|
|
3
39
|
## 0.1.0 — 2026-08-23
|
|
4
40
|
|
|
5
41
|
First release: the shared Content IR RENDER layer, extracted from
|
package/dist/index.cjs
CHANGED
|
@@ -126,6 +126,7 @@ var ComponentResolver = class {
|
|
|
126
126
|
resolvedBy: "db",
|
|
127
127
|
componentSource: dbRow.componentSource,
|
|
128
128
|
propsTransform: dbRow.propsTransform,
|
|
129
|
+
hasComponentSource: dbRow.hasComponentSource ?? Boolean(dbRow.componentSource && dbRow.componentSource.trim()),
|
|
129
130
|
pinnedKindVersion: dbRow.pinnedKindVersion,
|
|
130
131
|
updatedAt: dbRow.updatedAt,
|
|
131
132
|
createdBy: dbRow.createdBy
|
|
@@ -142,6 +143,7 @@ var ComponentResolver = class {
|
|
|
142
143
|
resolvedBy: "compiled",
|
|
143
144
|
componentSource: null,
|
|
144
145
|
propsTransform: null,
|
|
146
|
+
hasComponentSource: false,
|
|
145
147
|
pinnedKindVersion: null,
|
|
146
148
|
updatedAt: null,
|
|
147
149
|
createdBy: null
|
|
@@ -328,7 +330,7 @@ function resetSourcelessDbRowReports() {
|
|
|
328
330
|
}
|
|
329
331
|
function routeToDbComponent(block, kind, resolution, env) {
|
|
330
332
|
if (!isDbSourceResolution(resolution)) return null;
|
|
331
|
-
if (!resolution.
|
|
333
|
+
if (!resolution.hasComponentSource) {
|
|
332
334
|
reportDbRowWithoutSource(kind, env);
|
|
333
335
|
return null;
|
|
334
336
|
}
|
|
@@ -387,6 +389,12 @@ function applyIrKindRoute(block, env, options) {
|
|
|
387
389
|
if (envelope.root.kindState === "pending_schema") return block;
|
|
388
390
|
const def = env.kinds.getDefinition(kind);
|
|
389
391
|
const resolution = env.components.resolve(kind, env.platform, "output");
|
|
392
|
+
if (envelope.root.kindState === "raw") {
|
|
393
|
+
return routeToGeneric(
|
|
394
|
+
block,
|
|
395
|
+
def || resolution ? "broken-instance" : "unregistered"
|
|
396
|
+
);
|
|
397
|
+
}
|
|
390
398
|
const dbRouted = routeToDbComponent(block, kind, resolution, env);
|
|
391
399
|
if (dbRouted) return dbRouted;
|
|
392
400
|
if (def?.legacyBlockType) {
|
|
@@ -419,7 +427,7 @@ function applyIrKindRoute(block, env, options) {
|
|
|
419
427
|
if (def) {
|
|
420
428
|
return routeToGeneric(block, resolution ? "inactive" : "no-component");
|
|
421
429
|
}
|
|
422
|
-
return block;
|
|
430
|
+
return routeToGeneric(block, "unregistered");
|
|
423
431
|
}
|
|
424
432
|
function kindServerDataFromStoredValue(value, env) {
|
|
425
433
|
if (!isRecord(value)) return null;
|
|
@@ -653,7 +661,7 @@ function GenericStructuredView({
|
|
|
653
661
|
const { value, recovered } = readStructuredValue(content, metadata);
|
|
654
662
|
const kind = envelope?.root.kind ?? (typeof value === "object" && value !== null && !Array.isArray(value) ? contentIr.readObjectKind(value) : null) ?? "";
|
|
655
663
|
const marker = readIrRouteMarker(metadata);
|
|
656
|
-
const note = marker?.reason === "inactive" ? "a custom view is registered but held inactive" : "no custom view yet";
|
|
664
|
+
const note = marker?.reason === "inactive" ? "a custom view is registered but held inactive" : marker?.reason === "broken-instance" ? "this instance did not match the shape's schema" : marker?.reason === "unregistered" ? "this shape isn't registered on this platform" : "no custom view yet";
|
|
657
665
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: className ? `my-2 min-w-0 ${className}` : "my-2 min-w-0", children: [
|
|
658
666
|
status === "streaming" ? streamingIndicator ?? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-2 text-xs text-muted-foreground", children: "Still arriving\u2026" }) : null,
|
|
659
667
|
recovered ? host.renderValue({ value, ...kind ? { kind } : {}, note }) : (
|