@ai-matrx/content-ir-react 0.10.0 → 0.11.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 +50 -0
- package/dist/db-component.d.cts +8 -8
- package/dist/db-component.d.ts +8 -8
- package/dist/directive-host-DAb7Keg8.d.cts +63 -0
- package/dist/directive-host-DAb7Keg8.d.ts +63 -0
- package/dist/directives.cjs +382 -0
- package/dist/directives.cjs.map +1 -0
- package/dist/directives.d.cts +70 -0
- package/dist/directives.d.ts +70 -0
- package/dist/directives.js +369 -0
- package/dist/directives.js.map +1 -0
- package/dist/{host-types-CDcLW0TD.d.cts → host-types-C8jR31Wk.d.cts} +9 -0
- package/dist/{host-types-CpItjcYh.d.ts → host-types-IUEDmso7.d.ts} +9 -0
- package/dist/host.cjs +14 -4
- package/dist/host.cjs.map +1 -1
- package/dist/host.d.cts +5 -4
- package/dist/host.d.ts +5 -4
- package/dist/host.js +14 -4
- package/dist/host.js.map +1 -1
- package/dist/index.cjs +437 -46
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +85 -21
- package/dist/index.d.ts +85 -21
- package/dist/index.js +435 -30
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +401 -46
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +11 -10
- package/dist/react.d.ts +11 -10
- package/dist/react.js +398 -29
- package/dist/react.js.map +1 -1
- package/dist/{route-QL2Vqf2e.d.cts → route-Bu85A41G.d.cts} +83 -3
- package/dist/{route-PUuEuEug.d.ts → route-DoFoDKBn.d.ts} +83 -3
- package/dist/route.cjs +14 -0
- package/dist/route.cjs.map +1 -1
- package/dist/route.d.cts +1 -1
- package/dist/route.d.ts +1 -1
- package/dist/route.js +15 -0
- package/dist/route.js.map +1 -1
- package/package.json +15 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { C as ComponentResolutionSource, a as ComponentResolution, b as ContentIrErrorReporter } from './component-resolution.types-DLO2w-0n.cjs';
|
|
2
2
|
export { c as ComponentRole, d as ContentIrErrorReport, J as JsonObject, K as KindComponentRow, S as SystemComponentEntry, e as consoleErrorReporter } from './component-resolution.types-DLO2w-0n.cjs';
|
|
3
|
-
import { C as ContentIrHost, K as KindRouteEnv, a as KindDefinitionSource } from './route-
|
|
4
|
-
export { b as ContentIrRenderSeams, D as DB_KIND_COMPONENT_KEY, G as GENERIC_STRUCTURED_COMPONENT_KEY,
|
|
5
|
-
import * as
|
|
6
|
-
import
|
|
3
|
+
import { C as ContentIrHost, K as KindRouteEnv, a as KindDefinitionSource } from './route-Bu85A41G.cjs';
|
|
4
|
+
export { b as ContentIrRenderSeams, D as DB_KIND_COMPONENT_KEY, c as DIRECTIVE_BLOCK_TYPE, d as DirectiveApplyResult, e as DirectiveCopyProps, f as DirectiveHost, g as DirectiveHostProvider, h as DirectiveHostProviderProps, i as DirectiveOpenItemOptions, G as GENERIC_STRUCTURED_COMPONENT_KEY, j as GenericFallbackReason, I as IR_PROVISIONAL_KEY, k as IR_ROUTE_KEY, l as IrRenderBlock, m as IrRoutableBlock, n as IrRouteMarker, o as KindRouteBinding, p as KindRouteOptions, P as PartialRenderOptions, q as ProvisionalKindRender, S as StructuredValueRenderProps, r as applyIrKindRoute, s as createKindRouteBinding, t as envelopeFromPartialKind, u as isPartialReadyKind, v as isProvisionalBlock, w as kindServerDataFromStoredValue, x as markKindPartialUnsafe, y as readIrRouteMarker, z as resetPartialUnsafeKinds, A as resetSourcelessDbRowReports, B as resolveAnnouncedKindLoading, E as resolveProvisionalKindRender, F as routeEnvOf, H as useDirectiveHost } from './route-Bu85A41G.cjs';
|
|
5
|
+
import * as react from 'react';
|
|
6
|
+
import react__default, { ReactNode, ComponentType } from 'react';
|
|
7
7
|
export { ComponentResolver, ComponentResolverOptions } from './resolver.cjs';
|
|
8
|
-
import '@ai-matrx/content-ir';
|
|
8
|
+
import { DecodedDirective, DirectiveClass } from '@ai-matrx/content-ir';
|
|
9
9
|
|
|
10
10
|
interface ContentIrRenderProviderProps {
|
|
11
11
|
host: ContentIrHost;
|
|
12
12
|
children: ReactNode;
|
|
13
13
|
}
|
|
14
|
-
declare function ContentIrRenderProvider({ host, children, }: ContentIrRenderProviderProps):
|
|
14
|
+
declare function ContentIrRenderProvider({ host, children, }: ContentIrRenderProviderProps): react.JSX.Element;
|
|
15
15
|
/**
|
|
16
16
|
* The wired host, or null. For the rare consumer that can legitimately run
|
|
17
17
|
* without a provider because it was handed its sources explicitly (see
|
|
@@ -100,7 +100,7 @@ interface KindInstanceRenderProps {
|
|
|
100
100
|
variant?: "card" | "bare";
|
|
101
101
|
className?: string;
|
|
102
102
|
}
|
|
103
|
-
declare function KindInstanceRender(
|
|
103
|
+
declare function KindInstanceRender(props: KindInstanceRenderProps): react.JSX.Element;
|
|
104
104
|
|
|
105
105
|
/**
|
|
106
106
|
* The safety net + the "still arriving" affordance for a provisional kind
|
|
@@ -134,7 +134,7 @@ interface ProvisionalKindBoundaryOwnProps {
|
|
|
134
134
|
fallback: ReactNode;
|
|
135
135
|
children: ReactNode;
|
|
136
136
|
}
|
|
137
|
-
declare function ProvisionalKindBoundary(props: ProvisionalKindBoundaryOwnProps):
|
|
137
|
+
declare function ProvisionalKindBoundary(props: ProvisionalKindBoundaryOwnProps): react__default.JSX.Element;
|
|
138
138
|
/**
|
|
139
139
|
* The "still arriving" frame. `aria-busy` carries the same fact to assistive
|
|
140
140
|
* tech that the chip carries visually. The chip's own rendering is a host seam
|
|
@@ -143,7 +143,7 @@ declare function ProvisionalKindBoundary(props: ProvisionalKindBoundaryOwnProps)
|
|
|
143
143
|
*/
|
|
144
144
|
declare function ProvisionalKindFrame({ children }: {
|
|
145
145
|
children: ReactNode;
|
|
146
|
-
}):
|
|
146
|
+
}): react__default.JSX.Element;
|
|
147
147
|
|
|
148
148
|
interface GenericStructuredViewProps {
|
|
149
149
|
/** The raw region source — the zero-loss floor when no envelope survived. */
|
|
@@ -157,7 +157,7 @@ interface GenericStructuredViewProps {
|
|
|
157
157
|
streamingIndicator?: ReactNode;
|
|
158
158
|
className?: string;
|
|
159
159
|
}
|
|
160
|
-
declare function GenericStructuredView({ content, metadata, streamingIndicator, className, }: GenericStructuredViewProps):
|
|
160
|
+
declare function GenericStructuredView({ content, metadata, streamingIndicator, className, }: GenericStructuredViewProps): react.JSX.Element;
|
|
161
161
|
|
|
162
162
|
interface DelegatedOutputProps {
|
|
163
163
|
output: unknown;
|
|
@@ -185,14 +185,14 @@ interface DelegatedOutputProps {
|
|
|
185
185
|
* holding, so it is what routes. With no kind at all there is nothing to route
|
|
186
186
|
* to, and the host's fallback (or the floor) shows what the step produced.
|
|
187
187
|
*/
|
|
188
|
-
declare function DelegatedOutput({ output, declaredKind, fallback, emptyLabel, }: DelegatedOutputProps):
|
|
188
|
+
declare function DelegatedOutput({ output, declaredKind, fallback, emptyLabel, }: DelegatedOutputProps): react.JSX.Element;
|
|
189
189
|
interface NodeOutcomeViewProps {
|
|
190
190
|
serverData?: unknown;
|
|
191
191
|
/** Passed through to {@link DelegatedOutput}. */
|
|
192
192
|
fallback?: (output: unknown) => ReactNode;
|
|
193
193
|
}
|
|
194
194
|
/** THE renderer for the `node_outcome` runtime wrapper kind. */
|
|
195
|
-
declare function NodeOutcomeView({ serverData, fallback }: NodeOutcomeViewProps):
|
|
195
|
+
declare function NodeOutcomeView({ serverData, fallback }: NodeOutcomeViewProps): react.JSX.Element | null;
|
|
196
196
|
interface RunResultViewProps {
|
|
197
197
|
serverData?: unknown;
|
|
198
198
|
fallback?: (output: unknown) => ReactNode;
|
|
@@ -209,7 +209,71 @@ interface RunResultViewProps {
|
|
|
209
209
|
* outcomes — otherwise it is the same content the outcomes already carry, and
|
|
210
210
|
* showing both is the duplication the wrapper exists to prevent.
|
|
211
211
|
*/
|
|
212
|
-
declare function RunResultView({ serverData, fallback }: RunResultViewProps):
|
|
212
|
+
declare function RunResultView({ serverData, fallback }: RunResultViewProps): react.JSX.Element | null;
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Kind Directives — the renderer registry, and THE PREFIX TIER.
|
|
216
|
+
*
|
|
217
|
+
* A directive IS a kind instance, so the renderer for one is resolved from its
|
|
218
|
+
* SLUG, in the same shape the kind component resolver uses:
|
|
219
|
+
*
|
|
220
|
+
* getDirectiveRenderer(directive)
|
|
221
|
+
* → an exact-slug renderer (directive_v1_action_plan_tree)
|
|
222
|
+
* → else the CLASS prefix rule (every directive_v1_reference_*)
|
|
223
|
+
* → else null (DirectiveRender's own tier: the
|
|
224
|
+
* side-effect card, then the floor)
|
|
225
|
+
*
|
|
226
|
+
* THE PREFIX RULE is Arman's routing-language ruling made real: registering
|
|
227
|
+
* `reference` once gives EVERY enrolled noun a renderer for free; a custom
|
|
228
|
+
* renderer for one slug overrides it; a brand-new server noun renders with
|
|
229
|
+
* ZERO client edits. Hosts register their bespoke renderers (reference chips,
|
|
230
|
+
* plan trees) here; the package supplies the side-effect card and the floor.
|
|
231
|
+
*/
|
|
232
|
+
|
|
233
|
+
interface DirectiveRendererProps {
|
|
234
|
+
/** The decoded two-key shell — slug, class, noun, items, position law. */
|
|
235
|
+
directive: DecodedDirective;
|
|
236
|
+
}
|
|
237
|
+
type DirectiveRenderer = ComponentType<DirectiveRendererProps>;
|
|
238
|
+
/**
|
|
239
|
+
* Register a renderer for a whole CLASS (the prefix rule), or for one exact
|
|
240
|
+
* `(class, noun)` pair, which wins. `noun` is passed as a noun, never a
|
|
241
|
+
* hand-typed slug: the slug is BUILT by the grammar, so a registration whose
|
|
242
|
+
* slug could not be parsed back is unconstructable rather than unreachable.
|
|
243
|
+
*/
|
|
244
|
+
declare function registerDirectiveRenderer(directiveClass: DirectiveClass, renderer: DirectiveRenderer, noun?: string): void;
|
|
245
|
+
/** The renderer for a slug: exact → class prefix rule → null. */
|
|
246
|
+
declare function getDirectiveRenderer(directive: Pick<DecodedDirective, "slug" | "directiveClass">): DirectiveRenderer | null;
|
|
247
|
+
/** Tests only. */
|
|
248
|
+
declare function resetDirectiveRenderers(): void;
|
|
249
|
+
|
|
250
|
+
interface ApplyDirectiveButtonProps {
|
|
251
|
+
directive: DecodedDirective;
|
|
252
|
+
label?: string;
|
|
253
|
+
/** How many things this will write — shown during the wait so a long apply reads as work, not a frozen spinner. */
|
|
254
|
+
itemCount?: number;
|
|
255
|
+
onApplied?: () => void;
|
|
256
|
+
}
|
|
257
|
+
declare function ApplyDirectiveButton({ directive, label, itemCount, onApplied, }: ApplyDirectiveButtonProps): react.JSX.Element | null;
|
|
258
|
+
|
|
259
|
+
interface SideEffectDirectiveCardProps {
|
|
260
|
+
directive: DecodedDirective;
|
|
261
|
+
}
|
|
262
|
+
declare function SideEffectDirectiveCard({ directive }: SideEffectDirectiveCardProps): react.JSX.Element;
|
|
263
|
+
|
|
264
|
+
interface DirectiveFallbackCardProps {
|
|
265
|
+
directive: DecodedDirective;
|
|
266
|
+
/** Short, human explanation of why the rich renderer degraded. */
|
|
267
|
+
reason?: string;
|
|
268
|
+
}
|
|
269
|
+
declare function DirectiveFallbackCard({ directive, reason }: DirectiveFallbackCardProps): react.JSX.Element;
|
|
270
|
+
|
|
271
|
+
interface DirectiveRenderProps {
|
|
272
|
+
/** The fence body (JSON string) or an already-parsed shell / value. */
|
|
273
|
+
content: unknown;
|
|
274
|
+
className?: string;
|
|
275
|
+
}
|
|
276
|
+
declare function DirectiveRender({ content, className }: DirectiveRenderProps): react.JSX.Element;
|
|
213
277
|
|
|
214
278
|
/**
|
|
215
279
|
* The DB-component COMPILE CACHE — session-scoped, keyed per winning row
|
|
@@ -307,7 +371,7 @@ interface DbKindComponentRenderProps {
|
|
|
307
371
|
uiOptions?: KindComponentUiOptions;
|
|
308
372
|
}
|
|
309
373
|
interface CompiledDbKindComponent {
|
|
310
|
-
Component:
|
|
374
|
+
Component: react.ComponentType<DbKindComponentRenderProps>;
|
|
311
375
|
/** Compiled `props_transform`, or null when the row declares none. */
|
|
312
376
|
transform: ((data: unknown) => unknown) | null;
|
|
313
377
|
}
|
|
@@ -357,7 +421,7 @@ type DbKindComponentCompiler = (args: {
|
|
|
357
421
|
code: string;
|
|
358
422
|
allowedImports: string[];
|
|
359
423
|
}) => {
|
|
360
|
-
Component:
|
|
424
|
+
Component: react.ComponentType<Record<string, unknown>> | null;
|
|
361
425
|
error: string | null;
|
|
362
426
|
};
|
|
363
427
|
interface DbKindComponentCachePorts {
|
|
@@ -444,8 +508,8 @@ interface DbKindComponentErrorBoundaryProps {
|
|
|
444
508
|
kind: string;
|
|
445
509
|
/** The resolved component's `updated_at`; a change means a new version. */
|
|
446
510
|
resetSignal: string | null;
|
|
447
|
-
fallback:
|
|
448
|
-
children:
|
|
511
|
+
fallback: react.ReactNode;
|
|
512
|
+
children: react.ReactNode;
|
|
449
513
|
/**
|
|
450
514
|
* Where the catch lands. A host binds structured capture + incident filing
|
|
451
515
|
* here; the default screams to the console. NOTE for hosts whose console
|
|
@@ -466,12 +530,12 @@ interface State {
|
|
|
466
530
|
*/
|
|
467
531
|
signalAtLastRender: string | null;
|
|
468
532
|
}
|
|
469
|
-
declare class DbKindComponentErrorBoundary extends
|
|
533
|
+
declare class DbKindComponentErrorBoundary extends react.Component<DbKindComponentErrorBoundaryProps, State> {
|
|
470
534
|
constructor(props: DbKindComponentErrorBoundaryProps);
|
|
471
535
|
static getDerivedStateFromError(): Partial<State>;
|
|
472
536
|
static getDerivedStateFromProps(props: DbKindComponentErrorBoundaryProps, state: State): State | null;
|
|
473
|
-
componentDidCatch(error: Error, errorInfo:
|
|
474
|
-
render():
|
|
537
|
+
componentDidCatch(error: Error, errorInfo: react.ErrorInfo): void;
|
|
538
|
+
render(): react.ReactNode;
|
|
475
539
|
}
|
|
476
540
|
|
|
477
|
-
export { type CompiledDbKindComponent, ComponentResolution, ComponentResolutionSource, ContentIrErrorReporter, ContentIrHost, ContentIrRenderProvider, type ContentIrRenderProviderProps, type DbKindActionResult, type DbKindCompileResult, type DbKindComponentCache, type DbKindComponentCachePorts, type DbKindComponentCompiler, DbKindComponentErrorBoundary, type DbKindComponentErrorBoundaryProps, type DbKindComponentIncident, type DbKindComponentIncidentSink, type DbKindComponentIncidentType, type DbKindComponentRenderProps, DelegatedOutput, type DelegatedOutputProps, GenericStructuredView, type GenericStructuredViewProps, type KindComponentUiOptions, KindDefinitionSource, KindInstanceRender, type KindInstanceRenderProps, KindRouteEnv, type KindVersionSources, NodeOutcomeView, type NodeOutcomeViewProps, ProvisionalKindBoundary, ProvisionalKindFrame, type ResolveKindValue, type RunDbKindAction, RunResultView, type RunResultViewProps, createDbKindComponentCache, isDbKindComponentBodyPending, isRecordValue, kindIsRoutable, useContentIrHost, useContentIrHostOrNull, useContentIrKindVersion, useKindRouteEnv };
|
|
541
|
+
export { ApplyDirectiveButton, type ApplyDirectiveButtonProps, type CompiledDbKindComponent, ComponentResolution, ComponentResolutionSource, ContentIrErrorReporter, ContentIrHost, ContentIrRenderProvider, type ContentIrRenderProviderProps, type DbKindActionResult, type DbKindCompileResult, type DbKindComponentCache, type DbKindComponentCachePorts, type DbKindComponentCompiler, DbKindComponentErrorBoundary, type DbKindComponentErrorBoundaryProps, type DbKindComponentIncident, type DbKindComponentIncidentSink, type DbKindComponentIncidentType, type DbKindComponentRenderProps, DelegatedOutput, type DelegatedOutputProps, DirectiveFallbackCard, type DirectiveFallbackCardProps, DirectiveRender, type DirectiveRenderProps, type DirectiveRenderer, type DirectiveRendererProps, GenericStructuredView, type GenericStructuredViewProps, type KindComponentUiOptions, KindDefinitionSource, KindInstanceRender, type KindInstanceRenderProps, KindRouteEnv, type KindVersionSources, NodeOutcomeView, type NodeOutcomeViewProps, ProvisionalKindBoundary, ProvisionalKindFrame, type ResolveKindValue, type RunDbKindAction, RunResultView, type RunResultViewProps, SideEffectDirectiveCard, type SideEffectDirectiveCardProps, createDbKindComponentCache, getDirectiveRenderer, isDbKindComponentBodyPending, isRecordValue, kindIsRoutable, registerDirectiveRenderer, resetDirectiveRenderers, useContentIrHost, useContentIrHostOrNull, useContentIrKindVersion, useKindRouteEnv };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { C as ComponentResolutionSource, a as ComponentResolution, b as ContentIrErrorReporter } from './component-resolution.types-DLO2w-0n.js';
|
|
2
2
|
export { c as ComponentRole, d as ContentIrErrorReport, J as JsonObject, K as KindComponentRow, S as SystemComponentEntry, e as consoleErrorReporter } from './component-resolution.types-DLO2w-0n.js';
|
|
3
|
-
import { C as ContentIrHost, K as KindRouteEnv, a as KindDefinitionSource } from './route-
|
|
4
|
-
export { b as ContentIrRenderSeams, D as DB_KIND_COMPONENT_KEY, G as GENERIC_STRUCTURED_COMPONENT_KEY,
|
|
5
|
-
import * as
|
|
6
|
-
import
|
|
3
|
+
import { C as ContentIrHost, K as KindRouteEnv, a as KindDefinitionSource } from './route-DoFoDKBn.js';
|
|
4
|
+
export { b as ContentIrRenderSeams, D as DB_KIND_COMPONENT_KEY, c as DIRECTIVE_BLOCK_TYPE, d as DirectiveApplyResult, e as DirectiveCopyProps, f as DirectiveHost, g as DirectiveHostProvider, h as DirectiveHostProviderProps, i as DirectiveOpenItemOptions, G as GENERIC_STRUCTURED_COMPONENT_KEY, j as GenericFallbackReason, I as IR_PROVISIONAL_KEY, k as IR_ROUTE_KEY, l as IrRenderBlock, m as IrRoutableBlock, n as IrRouteMarker, o as KindRouteBinding, p as KindRouteOptions, P as PartialRenderOptions, q as ProvisionalKindRender, S as StructuredValueRenderProps, r as applyIrKindRoute, s as createKindRouteBinding, t as envelopeFromPartialKind, u as isPartialReadyKind, v as isProvisionalBlock, w as kindServerDataFromStoredValue, x as markKindPartialUnsafe, y as readIrRouteMarker, z as resetPartialUnsafeKinds, A as resetSourcelessDbRowReports, B as resolveAnnouncedKindLoading, E as resolveProvisionalKindRender, F as routeEnvOf, H as useDirectiveHost } from './route-DoFoDKBn.js';
|
|
5
|
+
import * as react from 'react';
|
|
6
|
+
import react__default, { ReactNode, ComponentType } from 'react';
|
|
7
7
|
export { ComponentResolver, ComponentResolverOptions } from './resolver.js';
|
|
8
|
-
import '@ai-matrx/content-ir';
|
|
8
|
+
import { DecodedDirective, DirectiveClass } from '@ai-matrx/content-ir';
|
|
9
9
|
|
|
10
10
|
interface ContentIrRenderProviderProps {
|
|
11
11
|
host: ContentIrHost;
|
|
12
12
|
children: ReactNode;
|
|
13
13
|
}
|
|
14
|
-
declare function ContentIrRenderProvider({ host, children, }: ContentIrRenderProviderProps):
|
|
14
|
+
declare function ContentIrRenderProvider({ host, children, }: ContentIrRenderProviderProps): react.JSX.Element;
|
|
15
15
|
/**
|
|
16
16
|
* The wired host, or null. For the rare consumer that can legitimately run
|
|
17
17
|
* without a provider because it was handed its sources explicitly (see
|
|
@@ -100,7 +100,7 @@ interface KindInstanceRenderProps {
|
|
|
100
100
|
variant?: "card" | "bare";
|
|
101
101
|
className?: string;
|
|
102
102
|
}
|
|
103
|
-
declare function KindInstanceRender(
|
|
103
|
+
declare function KindInstanceRender(props: KindInstanceRenderProps): react.JSX.Element;
|
|
104
104
|
|
|
105
105
|
/**
|
|
106
106
|
* The safety net + the "still arriving" affordance for a provisional kind
|
|
@@ -134,7 +134,7 @@ interface ProvisionalKindBoundaryOwnProps {
|
|
|
134
134
|
fallback: ReactNode;
|
|
135
135
|
children: ReactNode;
|
|
136
136
|
}
|
|
137
|
-
declare function ProvisionalKindBoundary(props: ProvisionalKindBoundaryOwnProps):
|
|
137
|
+
declare function ProvisionalKindBoundary(props: ProvisionalKindBoundaryOwnProps): react__default.JSX.Element;
|
|
138
138
|
/**
|
|
139
139
|
* The "still arriving" frame. `aria-busy` carries the same fact to assistive
|
|
140
140
|
* tech that the chip carries visually. The chip's own rendering is a host seam
|
|
@@ -143,7 +143,7 @@ declare function ProvisionalKindBoundary(props: ProvisionalKindBoundaryOwnProps)
|
|
|
143
143
|
*/
|
|
144
144
|
declare function ProvisionalKindFrame({ children }: {
|
|
145
145
|
children: ReactNode;
|
|
146
|
-
}):
|
|
146
|
+
}): react__default.JSX.Element;
|
|
147
147
|
|
|
148
148
|
interface GenericStructuredViewProps {
|
|
149
149
|
/** The raw region source — the zero-loss floor when no envelope survived. */
|
|
@@ -157,7 +157,7 @@ interface GenericStructuredViewProps {
|
|
|
157
157
|
streamingIndicator?: ReactNode;
|
|
158
158
|
className?: string;
|
|
159
159
|
}
|
|
160
|
-
declare function GenericStructuredView({ content, metadata, streamingIndicator, className, }: GenericStructuredViewProps):
|
|
160
|
+
declare function GenericStructuredView({ content, metadata, streamingIndicator, className, }: GenericStructuredViewProps): react.JSX.Element;
|
|
161
161
|
|
|
162
162
|
interface DelegatedOutputProps {
|
|
163
163
|
output: unknown;
|
|
@@ -185,14 +185,14 @@ interface DelegatedOutputProps {
|
|
|
185
185
|
* holding, so it is what routes. With no kind at all there is nothing to route
|
|
186
186
|
* to, and the host's fallback (or the floor) shows what the step produced.
|
|
187
187
|
*/
|
|
188
|
-
declare function DelegatedOutput({ output, declaredKind, fallback, emptyLabel, }: DelegatedOutputProps):
|
|
188
|
+
declare function DelegatedOutput({ output, declaredKind, fallback, emptyLabel, }: DelegatedOutputProps): react.JSX.Element;
|
|
189
189
|
interface NodeOutcomeViewProps {
|
|
190
190
|
serverData?: unknown;
|
|
191
191
|
/** Passed through to {@link DelegatedOutput}. */
|
|
192
192
|
fallback?: (output: unknown) => ReactNode;
|
|
193
193
|
}
|
|
194
194
|
/** THE renderer for the `node_outcome` runtime wrapper kind. */
|
|
195
|
-
declare function NodeOutcomeView({ serverData, fallback }: NodeOutcomeViewProps):
|
|
195
|
+
declare function NodeOutcomeView({ serverData, fallback }: NodeOutcomeViewProps): react.JSX.Element | null;
|
|
196
196
|
interface RunResultViewProps {
|
|
197
197
|
serverData?: unknown;
|
|
198
198
|
fallback?: (output: unknown) => ReactNode;
|
|
@@ -209,7 +209,71 @@ interface RunResultViewProps {
|
|
|
209
209
|
* outcomes — otherwise it is the same content the outcomes already carry, and
|
|
210
210
|
* showing both is the duplication the wrapper exists to prevent.
|
|
211
211
|
*/
|
|
212
|
-
declare function RunResultView({ serverData, fallback }: RunResultViewProps):
|
|
212
|
+
declare function RunResultView({ serverData, fallback }: RunResultViewProps): react.JSX.Element | null;
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Kind Directives — the renderer registry, and THE PREFIX TIER.
|
|
216
|
+
*
|
|
217
|
+
* A directive IS a kind instance, so the renderer for one is resolved from its
|
|
218
|
+
* SLUG, in the same shape the kind component resolver uses:
|
|
219
|
+
*
|
|
220
|
+
* getDirectiveRenderer(directive)
|
|
221
|
+
* → an exact-slug renderer (directive_v1_action_plan_tree)
|
|
222
|
+
* → else the CLASS prefix rule (every directive_v1_reference_*)
|
|
223
|
+
* → else null (DirectiveRender's own tier: the
|
|
224
|
+
* side-effect card, then the floor)
|
|
225
|
+
*
|
|
226
|
+
* THE PREFIX RULE is Arman's routing-language ruling made real: registering
|
|
227
|
+
* `reference` once gives EVERY enrolled noun a renderer for free; a custom
|
|
228
|
+
* renderer for one slug overrides it; a brand-new server noun renders with
|
|
229
|
+
* ZERO client edits. Hosts register their bespoke renderers (reference chips,
|
|
230
|
+
* plan trees) here; the package supplies the side-effect card and the floor.
|
|
231
|
+
*/
|
|
232
|
+
|
|
233
|
+
interface DirectiveRendererProps {
|
|
234
|
+
/** The decoded two-key shell — slug, class, noun, items, position law. */
|
|
235
|
+
directive: DecodedDirective;
|
|
236
|
+
}
|
|
237
|
+
type DirectiveRenderer = ComponentType<DirectiveRendererProps>;
|
|
238
|
+
/**
|
|
239
|
+
* Register a renderer for a whole CLASS (the prefix rule), or for one exact
|
|
240
|
+
* `(class, noun)` pair, which wins. `noun` is passed as a noun, never a
|
|
241
|
+
* hand-typed slug: the slug is BUILT by the grammar, so a registration whose
|
|
242
|
+
* slug could not be parsed back is unconstructable rather than unreachable.
|
|
243
|
+
*/
|
|
244
|
+
declare function registerDirectiveRenderer(directiveClass: DirectiveClass, renderer: DirectiveRenderer, noun?: string): void;
|
|
245
|
+
/** The renderer for a slug: exact → class prefix rule → null. */
|
|
246
|
+
declare function getDirectiveRenderer(directive: Pick<DecodedDirective, "slug" | "directiveClass">): DirectiveRenderer | null;
|
|
247
|
+
/** Tests only. */
|
|
248
|
+
declare function resetDirectiveRenderers(): void;
|
|
249
|
+
|
|
250
|
+
interface ApplyDirectiveButtonProps {
|
|
251
|
+
directive: DecodedDirective;
|
|
252
|
+
label?: string;
|
|
253
|
+
/** How many things this will write — shown during the wait so a long apply reads as work, not a frozen spinner. */
|
|
254
|
+
itemCount?: number;
|
|
255
|
+
onApplied?: () => void;
|
|
256
|
+
}
|
|
257
|
+
declare function ApplyDirectiveButton({ directive, label, itemCount, onApplied, }: ApplyDirectiveButtonProps): react.JSX.Element | null;
|
|
258
|
+
|
|
259
|
+
interface SideEffectDirectiveCardProps {
|
|
260
|
+
directive: DecodedDirective;
|
|
261
|
+
}
|
|
262
|
+
declare function SideEffectDirectiveCard({ directive }: SideEffectDirectiveCardProps): react.JSX.Element;
|
|
263
|
+
|
|
264
|
+
interface DirectiveFallbackCardProps {
|
|
265
|
+
directive: DecodedDirective;
|
|
266
|
+
/** Short, human explanation of why the rich renderer degraded. */
|
|
267
|
+
reason?: string;
|
|
268
|
+
}
|
|
269
|
+
declare function DirectiveFallbackCard({ directive, reason }: DirectiveFallbackCardProps): react.JSX.Element;
|
|
270
|
+
|
|
271
|
+
interface DirectiveRenderProps {
|
|
272
|
+
/** The fence body (JSON string) or an already-parsed shell / value. */
|
|
273
|
+
content: unknown;
|
|
274
|
+
className?: string;
|
|
275
|
+
}
|
|
276
|
+
declare function DirectiveRender({ content, className }: DirectiveRenderProps): react.JSX.Element;
|
|
213
277
|
|
|
214
278
|
/**
|
|
215
279
|
* The DB-component COMPILE CACHE — session-scoped, keyed per winning row
|
|
@@ -307,7 +371,7 @@ interface DbKindComponentRenderProps {
|
|
|
307
371
|
uiOptions?: KindComponentUiOptions;
|
|
308
372
|
}
|
|
309
373
|
interface CompiledDbKindComponent {
|
|
310
|
-
Component:
|
|
374
|
+
Component: react.ComponentType<DbKindComponentRenderProps>;
|
|
311
375
|
/** Compiled `props_transform`, or null when the row declares none. */
|
|
312
376
|
transform: ((data: unknown) => unknown) | null;
|
|
313
377
|
}
|
|
@@ -357,7 +421,7 @@ type DbKindComponentCompiler = (args: {
|
|
|
357
421
|
code: string;
|
|
358
422
|
allowedImports: string[];
|
|
359
423
|
}) => {
|
|
360
|
-
Component:
|
|
424
|
+
Component: react.ComponentType<Record<string, unknown>> | null;
|
|
361
425
|
error: string | null;
|
|
362
426
|
};
|
|
363
427
|
interface DbKindComponentCachePorts {
|
|
@@ -444,8 +508,8 @@ interface DbKindComponentErrorBoundaryProps {
|
|
|
444
508
|
kind: string;
|
|
445
509
|
/** The resolved component's `updated_at`; a change means a new version. */
|
|
446
510
|
resetSignal: string | null;
|
|
447
|
-
fallback:
|
|
448
|
-
children:
|
|
511
|
+
fallback: react.ReactNode;
|
|
512
|
+
children: react.ReactNode;
|
|
449
513
|
/**
|
|
450
514
|
* Where the catch lands. A host binds structured capture + incident filing
|
|
451
515
|
* here; the default screams to the console. NOTE for hosts whose console
|
|
@@ -466,12 +530,12 @@ interface State {
|
|
|
466
530
|
*/
|
|
467
531
|
signalAtLastRender: string | null;
|
|
468
532
|
}
|
|
469
|
-
declare class DbKindComponentErrorBoundary extends
|
|
533
|
+
declare class DbKindComponentErrorBoundary extends react.Component<DbKindComponentErrorBoundaryProps, State> {
|
|
470
534
|
constructor(props: DbKindComponentErrorBoundaryProps);
|
|
471
535
|
static getDerivedStateFromError(): Partial<State>;
|
|
472
536
|
static getDerivedStateFromProps(props: DbKindComponentErrorBoundaryProps, state: State): State | null;
|
|
473
|
-
componentDidCatch(error: Error, errorInfo:
|
|
474
|
-
render():
|
|
537
|
+
componentDidCatch(error: Error, errorInfo: react.ErrorInfo): void;
|
|
538
|
+
render(): react.ReactNode;
|
|
475
539
|
}
|
|
476
540
|
|
|
477
|
-
export { type CompiledDbKindComponent, ComponentResolution, ComponentResolutionSource, ContentIrErrorReporter, ContentIrHost, ContentIrRenderProvider, type ContentIrRenderProviderProps, type DbKindActionResult, type DbKindCompileResult, type DbKindComponentCache, type DbKindComponentCachePorts, type DbKindComponentCompiler, DbKindComponentErrorBoundary, type DbKindComponentErrorBoundaryProps, type DbKindComponentIncident, type DbKindComponentIncidentSink, type DbKindComponentIncidentType, type DbKindComponentRenderProps, DelegatedOutput, type DelegatedOutputProps, GenericStructuredView, type GenericStructuredViewProps, type KindComponentUiOptions, KindDefinitionSource, KindInstanceRender, type KindInstanceRenderProps, KindRouteEnv, type KindVersionSources, NodeOutcomeView, type NodeOutcomeViewProps, ProvisionalKindBoundary, ProvisionalKindFrame, type ResolveKindValue, type RunDbKindAction, RunResultView, type RunResultViewProps, createDbKindComponentCache, isDbKindComponentBodyPending, isRecordValue, kindIsRoutable, useContentIrHost, useContentIrHostOrNull, useContentIrKindVersion, useKindRouteEnv };
|
|
541
|
+
export { ApplyDirectiveButton, type ApplyDirectiveButtonProps, type CompiledDbKindComponent, ComponentResolution, ComponentResolutionSource, ContentIrErrorReporter, ContentIrHost, ContentIrRenderProvider, type ContentIrRenderProviderProps, type DbKindActionResult, type DbKindCompileResult, type DbKindComponentCache, type DbKindComponentCachePorts, type DbKindComponentCompiler, DbKindComponentErrorBoundary, type DbKindComponentErrorBoundaryProps, type DbKindComponentIncident, type DbKindComponentIncidentSink, type DbKindComponentIncidentType, type DbKindComponentRenderProps, DelegatedOutput, type DelegatedOutputProps, DirectiveFallbackCard, type DirectiveFallbackCardProps, DirectiveRender, type DirectiveRenderProps, type DirectiveRenderer, type DirectiveRendererProps, GenericStructuredView, type GenericStructuredViewProps, type KindComponentUiOptions, KindDefinitionSource, KindInstanceRender, type KindInstanceRenderProps, KindRouteEnv, type KindVersionSources, NodeOutcomeView, type NodeOutcomeViewProps, ProvisionalKindBoundary, ProvisionalKindFrame, type ResolveKindValue, type RunDbKindAction, RunResultView, type RunResultViewProps, SideEffectDirectiveCard, type SideEffectDirectiveCardProps, createDbKindComponentCache, getDirectiveRenderer, isDbKindComponentBodyPending, isRecordValue, kindIsRoutable, registerDirectiveRenderer, resetDirectiveRenderers, useContentIrHost, useContentIrHostOrNull, useContentIrKindVersion, useKindRouteEnv };
|