@ai-matrx/content-ir-react 0.13.17 → 0.14.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.
@@ -17,6 +17,25 @@ interface DirectiveApplyResult {
17
17
  */
18
18
  records?: DirectiveRecordRef[];
19
19
  }
20
+ /**
21
+ * What the server's action ledger says about ONE block, read on mount so a
22
+ * reloaded page never offers "Apply" for work that already ran (reviewer
23
+ * defect 5, 2026-10-02).
24
+ *
25
+ * - `not_applied` — still to do (or partly done: the batch re-applies, and the
26
+ * server replays the members it already holds). The card offers Apply.
27
+ * - `in_flight` — another request is applying it right now. The card says it
28
+ * is finishing and asks again shortly; it offers neither Apply nor a tally.
29
+ * - `applied` — the ledger holds every item. The card shows the tally exactly
30
+ * as a fresh apply would: the ledger's own sentence and the records, as doors.
31
+ */
32
+ interface DirectiveApplyState {
33
+ state: "not_applied" | "in_flight" | "applied";
34
+ /** The ledger row's sentence ("Created task."), never composed client-side. */
35
+ message?: string | null;
36
+ /** The records the original apply wrote — the tally's doors. */
37
+ records?: DirectiveRecordRef[];
38
+ }
20
39
  /** One record a directive names: the noun it is, and its id. */
21
40
  interface DirectiveRecordRef {
22
41
  noun: string;
@@ -84,6 +103,20 @@ interface DirectiveHost {
84
103
  * will read "Applying…" while its dialog is up).
85
104
  */
86
105
  ask?: (request: DirectiveAskRequest) => Promise<boolean>;
106
+ /**
107
+ * Has this exact block already been applied? Read ONCE when the card mounts
108
+ * (and again while the answer is `in_flight`), so the card survives a reload:
109
+ * the server ledger, not component state, is what knows. The identity is the
110
+ * server's (it hashes the validated items in the same namespace `confirm`
111
+ * applies in), so a host asks — it never computes. Batch on the host side if
112
+ * a page carries many cards. Reject with an Error when the ledger cannot be
113
+ * read: the card reports it and offers Apply, which is safe because `confirm`
114
+ * is idempotent. Absent → the card starts at Apply, as before.
115
+ */
116
+ applyState?: (shell: {
117
+ __kind: string;
118
+ items: Record<string, unknown>[];
119
+ }) => Promise<DirectiveApplyState>;
87
120
  /**
88
121
  * Draw ONE existing record by its live name, as a way to open it. Used on
89
122
  * update/delete rows (the record that will change), in the host's own ask
@@ -602,4 +635,4 @@ interface KindRouteBinding {
602
635
  /** Bind the pure routes to one host's env + owned block types. */
603
636
  declare function createKindRouteBinding(env: KindRouteEnv, options?: KindRouteOptions): KindRouteBinding;
604
637
 
605
- export { kindServerDataFromStoredValue as A, markKindPartialUnsafe as B, type ContentIrHost as C, DB_KIND_COMPONENT_KEY as D, readIrRouteMarker as E, resetPartialUnsafeKinds as F, GENERIC_STRUCTURED_COMPONENT_KEY as G, resetSourcelessDbRowReports as H, IR_PROVISIONAL_KEY as I, resolveAnnouncedKindLoading as J, type KindRouteEnv as K, resolveProvisionalKindRender as L, resolveSupersededKindRender as M, routeEnvOf as N, useDirectiveHost as O, type PartialRenderOptions as P, type StructuredValueRenderProps as S, type KindDefinitionSource as a, type ContentIrRenderSeams as b, DIRECTIVE_BLOCK_TYPE as c, type DirectiveApplyResult as d, type DirectiveAskRequest as e, type DirectiveCopyProps as f, type DirectiveHost as g, DirectiveHostProvider as h, type DirectiveHostProviderProps as i, type DirectiveOpenItemOptions as j, type DirectiveRecordProps as k, type DirectiveRecordRef as l, type GenericFallbackReason as m, IR_ROUTE_KEY as n, type IrRenderBlock as o, type IrRoutableBlock as p, type IrRouteMarker as q, type KindRouteBinding as r, type KindRouteOptions as s, type ProvisionalKindRender as t, type SupersededKindRender as u, applyIrKindRoute as v, createKindRouteBinding as w, envelopeFromPartialKind as x, isPartialReadyKind as y, isProvisionalBlock as z };
638
+ export { isProvisionalBlock as A, kindServerDataFromStoredValue as B, type ContentIrHost as C, DB_KIND_COMPONENT_KEY as D, markKindPartialUnsafe as E, readIrRouteMarker as F, GENERIC_STRUCTURED_COMPONENT_KEY as G, resetPartialUnsafeKinds as H, IR_PROVISIONAL_KEY as I, resetSourcelessDbRowReports as J, type KindRouteEnv as K, resolveAnnouncedKindLoading as L, resolveProvisionalKindRender as M, resolveSupersededKindRender as N, routeEnvOf as O, type PartialRenderOptions as P, useDirectiveHost as Q, type StructuredValueRenderProps as S, type KindDefinitionSource as a, type ContentIrRenderSeams as b, DIRECTIVE_BLOCK_TYPE as c, type DirectiveApplyResult as d, type DirectiveApplyState as e, type DirectiveAskRequest as f, type DirectiveCopyProps as g, type DirectiveHost as h, DirectiveHostProvider as i, type DirectiveHostProviderProps as j, type DirectiveOpenItemOptions as k, type DirectiveRecordProps as l, type DirectiveRecordRef as m, type GenericFallbackReason as n, IR_ROUTE_KEY as o, type IrRenderBlock as p, type IrRoutableBlock as q, type IrRouteMarker as r, type KindRouteBinding as s, type KindRouteOptions as t, type ProvisionalKindRender as u, type SupersededKindRender as v, applyIrKindRoute as w, createKindRouteBinding as x, envelopeFromPartialKind as y, isPartialReadyKind as z };
@@ -17,6 +17,25 @@ interface DirectiveApplyResult {
17
17
  */
18
18
  records?: DirectiveRecordRef[];
19
19
  }
20
+ /**
21
+ * What the server's action ledger says about ONE block, read on mount so a
22
+ * reloaded page never offers "Apply" for work that already ran (reviewer
23
+ * defect 5, 2026-10-02).
24
+ *
25
+ * - `not_applied` — still to do (or partly done: the batch re-applies, and the
26
+ * server replays the members it already holds). The card offers Apply.
27
+ * - `in_flight` — another request is applying it right now. The card says it
28
+ * is finishing and asks again shortly; it offers neither Apply nor a tally.
29
+ * - `applied` — the ledger holds every item. The card shows the tally exactly
30
+ * as a fresh apply would: the ledger's own sentence and the records, as doors.
31
+ */
32
+ interface DirectiveApplyState {
33
+ state: "not_applied" | "in_flight" | "applied";
34
+ /** The ledger row's sentence ("Created task."), never composed client-side. */
35
+ message?: string | null;
36
+ /** The records the original apply wrote — the tally's doors. */
37
+ records?: DirectiveRecordRef[];
38
+ }
20
39
  /** One record a directive names: the noun it is, and its id. */
21
40
  interface DirectiveRecordRef {
22
41
  noun: string;
@@ -84,6 +103,20 @@ interface DirectiveHost {
84
103
  * will read "Applying…" while its dialog is up).
85
104
  */
86
105
  ask?: (request: DirectiveAskRequest) => Promise<boolean>;
106
+ /**
107
+ * Has this exact block already been applied? Read ONCE when the card mounts
108
+ * (and again while the answer is `in_flight`), so the card survives a reload:
109
+ * the server ledger, not component state, is what knows. The identity is the
110
+ * server's (it hashes the validated items in the same namespace `confirm`
111
+ * applies in), so a host asks — it never computes. Batch on the host side if
112
+ * a page carries many cards. Reject with an Error when the ledger cannot be
113
+ * read: the card reports it and offers Apply, which is safe because `confirm`
114
+ * is idempotent. Absent → the card starts at Apply, as before.
115
+ */
116
+ applyState?: (shell: {
117
+ __kind: string;
118
+ items: Record<string, unknown>[];
119
+ }) => Promise<DirectiveApplyState>;
87
120
  /**
88
121
  * Draw ONE existing record by its live name, as a way to open it. Used on
89
122
  * update/delete rows (the record that will change), in the host's own ask
@@ -602,4 +635,4 @@ interface KindRouteBinding {
602
635
  /** Bind the pure routes to one host's env + owned block types. */
603
636
  declare function createKindRouteBinding(env: KindRouteEnv, options?: KindRouteOptions): KindRouteBinding;
604
637
 
605
- export { kindServerDataFromStoredValue as A, markKindPartialUnsafe as B, type ContentIrHost as C, DB_KIND_COMPONENT_KEY as D, readIrRouteMarker as E, resetPartialUnsafeKinds as F, GENERIC_STRUCTURED_COMPONENT_KEY as G, resetSourcelessDbRowReports as H, IR_PROVISIONAL_KEY as I, resolveAnnouncedKindLoading as J, type KindRouteEnv as K, resolveProvisionalKindRender as L, resolveSupersededKindRender as M, routeEnvOf as N, useDirectiveHost as O, type PartialRenderOptions as P, type StructuredValueRenderProps as S, type KindDefinitionSource as a, type ContentIrRenderSeams as b, DIRECTIVE_BLOCK_TYPE as c, type DirectiveApplyResult as d, type DirectiveAskRequest as e, type DirectiveCopyProps as f, type DirectiveHost as g, DirectiveHostProvider as h, type DirectiveHostProviderProps as i, type DirectiveOpenItemOptions as j, type DirectiveRecordProps as k, type DirectiveRecordRef as l, type GenericFallbackReason as m, IR_ROUTE_KEY as n, type IrRenderBlock as o, type IrRoutableBlock as p, type IrRouteMarker as q, type KindRouteBinding as r, type KindRouteOptions as s, type ProvisionalKindRender as t, type SupersededKindRender as u, applyIrKindRoute as v, createKindRouteBinding as w, envelopeFromPartialKind as x, isPartialReadyKind as y, isProvisionalBlock as z };
638
+ export { isProvisionalBlock as A, kindServerDataFromStoredValue as B, type ContentIrHost as C, DB_KIND_COMPONENT_KEY as D, markKindPartialUnsafe as E, readIrRouteMarker as F, GENERIC_STRUCTURED_COMPONENT_KEY as G, resetPartialUnsafeKinds as H, IR_PROVISIONAL_KEY as I, resetSourcelessDbRowReports as J, type KindRouteEnv as K, resolveAnnouncedKindLoading as L, resolveProvisionalKindRender as M, resolveSupersededKindRender as N, routeEnvOf as O, type PartialRenderOptions as P, useDirectiveHost as Q, type StructuredValueRenderProps as S, type KindDefinitionSource as a, type ContentIrRenderSeams as b, DIRECTIVE_BLOCK_TYPE as c, type DirectiveApplyResult as d, type DirectiveApplyState as e, type DirectiveAskRequest as f, type DirectiveCopyProps as g, type DirectiveHost as h, DirectiveHostProvider as i, type DirectiveHostProviderProps as j, type DirectiveOpenItemOptions as k, type DirectiveRecordProps as l, type DirectiveRecordRef as m, type GenericFallbackReason as n, IR_ROUTE_KEY as o, type IrRenderBlock as p, type IrRoutableBlock as q, type IrRouteMarker as r, type KindRouteBinding as s, type KindRouteOptions as t, type ProvisionalKindRender as u, type SupersededKindRender as v, applyIrKindRoute as w, createKindRouteBinding as x, envelopeFromPartialKind as y, isPartialReadyKind as z };
package/dist/route.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- export { D as DB_KIND_COMPONENT_KEY, c as DIRECTIVE_BLOCK_TYPE, G as GENERIC_STRUCTURED_COMPONENT_KEY, m as GenericFallbackReason, I as IR_PROVISIONAL_KEY, n as IR_ROUTE_KEY, q as IrRouteMarker, r as KindRouteBinding, s as KindRouteOptions, P as PartialRenderOptions, t as ProvisionalKindRender, u as SupersededKindRender, v as applyIrKindRoute, w as createKindRouteBinding, x as envelopeFromPartialKind, y as isPartialReadyKind, z as isProvisionalBlock, A as kindServerDataFromStoredValue, B as markKindPartialUnsafe, E as readIrRouteMarker, F as resetPartialUnsafeKinds, H as resetSourcelessDbRowReports, J as resolveAnnouncedKindLoading, L as resolveProvisionalKindRender, M as resolveSupersededKindRender } from './route-DxK1SoPh.cjs';
1
+ export { D as DB_KIND_COMPONENT_KEY, c as DIRECTIVE_BLOCK_TYPE, G as GENERIC_STRUCTURED_COMPONENT_KEY, n as GenericFallbackReason, I as IR_PROVISIONAL_KEY, o as IR_ROUTE_KEY, r as IrRouteMarker, s as KindRouteBinding, t as KindRouteOptions, P as PartialRenderOptions, u as ProvisionalKindRender, v as SupersededKindRender, w as applyIrKindRoute, x as createKindRouteBinding, y as envelopeFromPartialKind, z as isPartialReadyKind, A as isProvisionalBlock, B as kindServerDataFromStoredValue, E as markKindPartialUnsafe, F as readIrRouteMarker, H as resetPartialUnsafeKinds, J as resetSourcelessDbRowReports, L as resolveAnnouncedKindLoading, M as resolveProvisionalKindRender, N as resolveSupersededKindRender } from './route-Bf-kciHw.cjs';
2
2
  import './component-resolution.types-DLO2w-0n.cjs';
3
3
  import 'react';
4
4
  import '@ai-matrx/content-ir';
package/dist/route.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { D as DB_KIND_COMPONENT_KEY, c as DIRECTIVE_BLOCK_TYPE, G as GENERIC_STRUCTURED_COMPONENT_KEY, m as GenericFallbackReason, I as IR_PROVISIONAL_KEY, n as IR_ROUTE_KEY, q as IrRouteMarker, r as KindRouteBinding, s as KindRouteOptions, P as PartialRenderOptions, t as ProvisionalKindRender, u as SupersededKindRender, v as applyIrKindRoute, w as createKindRouteBinding, x as envelopeFromPartialKind, y as isPartialReadyKind, z as isProvisionalBlock, A as kindServerDataFromStoredValue, B as markKindPartialUnsafe, E as readIrRouteMarker, F as resetPartialUnsafeKinds, H as resetSourcelessDbRowReports, J as resolveAnnouncedKindLoading, L as resolveProvisionalKindRender, M as resolveSupersededKindRender } from './route-JGZfl2nL.js';
1
+ export { D as DB_KIND_COMPONENT_KEY, c as DIRECTIVE_BLOCK_TYPE, G as GENERIC_STRUCTURED_COMPONENT_KEY, n as GenericFallbackReason, I as IR_PROVISIONAL_KEY, o as IR_ROUTE_KEY, r as IrRouteMarker, s as KindRouteBinding, t as KindRouteOptions, P as PartialRenderOptions, u as ProvisionalKindRender, v as SupersededKindRender, w as applyIrKindRoute, x as createKindRouteBinding, y as envelopeFromPartialKind, z as isPartialReadyKind, A as isProvisionalBlock, B as kindServerDataFromStoredValue, E as markKindPartialUnsafe, F as readIrRouteMarker, H as resetPartialUnsafeKinds, J as resetSourcelessDbRowReports, L as resolveAnnouncedKindLoading, M as resolveProvisionalKindRender, N as resolveSupersededKindRender } from './route-ymqupVjr.js';
2
2
  import './component-resolution.types-DLO2w-0n.js';
3
3
  import 'react';
4
4
  import '@ai-matrx/content-ir';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-matrx/content-ir-react",
3
- "version": "0.13.17",
3
+ "version": "0.14.0",
4
4
  "description": "The shared AI Matrx Content IR RENDER layer: kind routing, the component resolver, provisional (streaming) rendering, the runtime-wrapper chrome, and the generic structured floor — as portable React.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",