@ai-matrx/content-ir-react 0.14.0 → 0.15.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 +30 -0
- package/dist/{directive-host-DLp5QFI2.d.cts → directive-host-DJfF35FD.d.cts} +39 -9
- package/dist/{directive-host-DLp5QFI2.d.ts → directive-host-DJfF35FD.d.ts} +39 -9
- package/dist/directives.cjs +59 -15
- package/dist/directives.cjs.map +1 -1
- package/dist/directives.d.cts +9 -2
- package/dist/directives.d.ts +9 -2
- package/dist/directives.js +59 -15
- package/dist/directives.js.map +1 -1
- package/dist/{host-types-DHKFg06S.d.ts → host-types-9NfBeqrG.d.ts} +1 -1
- package/dist/{host-types-BpmKg07p.d.cts → host-types-DVIaaGR_.d.cts} +1 -1
- package/dist/host.cjs +1 -0
- package/dist/host.cjs.map +1 -1
- package/dist/host.d.cts +3 -3
- package/dist/host.d.ts +3 -3
- package/dist/host.js +1 -0
- package/dist/host.js.map +1 -1
- package/dist/index.cjs +58 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -3
- package/dist/index.d.ts +10 -3
- package/dist/index.js +58 -14
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +56 -14
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +56 -14
- package/dist/react.js.map +1 -1
- package/dist/{route-Bf-kciHw.d.cts → route-BCtPhF7W.d.cts} +39 -9
- package/dist/{route-ymqupVjr.d.ts → route-DDbgc-ID.d.ts} +39 -9
- package/dist/route.d.cts +1 -1
- package/dist/route.d.ts +1 -1
- package/package.json +3 -3
|
@@ -62,6 +62,28 @@ interface DirectiveAskRequest {
|
|
|
62
62
|
items: Record<string, unknown>[];
|
|
63
63
|
/** The noun's human label ("Task"), from the host's catalog when it has one. */
|
|
64
64
|
nounLabel: string;
|
|
65
|
+
/**
|
|
66
|
+
* True for "Run again": the ledger already holds this block, and a yes runs
|
|
67
|
+
* it a SECOND time (`force`) — another copy for a create, the same fields
|
|
68
|
+
* written again for an update, another delete for a restored record. The
|
|
69
|
+
* question must say so.
|
|
70
|
+
*/
|
|
71
|
+
again?: boolean;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* The shell a card hands its host — the two keys, plus WHERE it sits.
|
|
75
|
+
*
|
|
76
|
+
* `conversationId` is the conversation the card renders in (a chat message),
|
|
77
|
+
* absent in a person's own content (a note). It is the idempotency NAMESPACE:
|
|
78
|
+
* a card in an agent's message must apply under the SAME key as that
|
|
79
|
+
* proposal's Approve button, or the one action could run twice.
|
|
80
|
+
*/
|
|
81
|
+
interface DirectiveShell {
|
|
82
|
+
__kind: string;
|
|
83
|
+
items: Record<string, unknown>[];
|
|
84
|
+
conversationId?: string;
|
|
85
|
+
/** "Run again": skip the ledger's dedup and apply a second time. */
|
|
86
|
+
force?: boolean;
|
|
65
87
|
}
|
|
66
88
|
interface DirectiveOpenItemOptions {
|
|
67
89
|
/** The item, `__kind`-stamped when the shape has an item kind. */
|
|
@@ -90,10 +112,7 @@ interface DirectiveHost {
|
|
|
90
112
|
* item against the registered model and runs the ONE handler; idempotent).
|
|
91
113
|
* Reject with an Error whose message is safe to show.
|
|
92
114
|
*/
|
|
93
|
-
confirm?: (shell:
|
|
94
|
-
__kind: string;
|
|
95
|
-
items: Record<string, unknown>[];
|
|
96
|
-
}) => Promise<DirectiveApplyResult>;
|
|
115
|
+
confirm?: (shell: DirectiveShell) => Promise<DirectiveApplyResult>;
|
|
97
116
|
/**
|
|
98
117
|
* Ask the person BEFORE anything runs, naming the consequence (the records,
|
|
99
118
|
* what changes). Resolve `true` to go ahead, `false` to leave the card as it
|
|
@@ -113,10 +132,7 @@ interface DirectiveHost {
|
|
|
113
132
|
* read: the card reports it and offers Apply, which is safe because `confirm`
|
|
114
133
|
* is idempotent. Absent → the card starts at Apply, as before.
|
|
115
134
|
*/
|
|
116
|
-
applyState?: (shell:
|
|
117
|
-
__kind: string;
|
|
118
|
-
items: Record<string, unknown>[];
|
|
119
|
-
}) => Promise<DirectiveApplyState>;
|
|
135
|
+
applyState?: (shell: DirectiveShell) => Promise<DirectiveApplyState>;
|
|
120
136
|
/**
|
|
121
137
|
* Draw ONE existing record by its live name, as a way to open it. Used on
|
|
122
138
|
* update/delete rows (the record that will change), in the host's own ask
|
|
@@ -135,6 +151,20 @@ interface DirectiveHost {
|
|
|
135
151
|
/** Where a decode failure or an unhonourable shell is reported. Default: console.error. */
|
|
136
152
|
reportError?: (message: string) => void;
|
|
137
153
|
}
|
|
154
|
+
/** Where a directive renders — today, the conversation it sits in (if any). */
|
|
155
|
+
interface DirectiveScope {
|
|
156
|
+
conversationId?: string | null;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Tell every card below WHERE it renders. A host draws a chat message's
|
|
160
|
+
* directives inside one of these (or passes `conversationId` to
|
|
161
|
+
* `DirectiveRender`), so the card applies in that conversation's namespace —
|
|
162
|
+
* the same key the agent's proposal approves under. A note mounts none.
|
|
163
|
+
*/
|
|
164
|
+
declare function DirectiveScopeProvider({ conversationId, children, }: DirectiveScope & {
|
|
165
|
+
children: ReactNode;
|
|
166
|
+
}): react.JSX.Element;
|
|
167
|
+
declare function useDirectiveScope(): DirectiveScope;
|
|
138
168
|
interface DirectiveHostProviderProps {
|
|
139
169
|
host: DirectiveHost;
|
|
140
170
|
children: ReactNode;
|
|
@@ -635,4 +665,4 @@ interface KindRouteBinding {
|
|
|
635
665
|
/** Bind the pure routes to one host's env + owned block types. */
|
|
636
666
|
declare function createKindRouteBinding(env: KindRouteEnv, options?: KindRouteOptions): KindRouteBinding;
|
|
637
667
|
|
|
638
|
-
export {
|
|
668
|
+
export { createKindRouteBinding as A, envelopeFromPartialKind as B, type ContentIrHost as C, DB_KIND_COMPONENT_KEY as D, isPartialReadyKind as E, isProvisionalBlock as F, GENERIC_STRUCTURED_COMPONENT_KEY as G, kindServerDataFromStoredValue as H, IR_PROVISIONAL_KEY as I, markKindPartialUnsafe as J, type KindRouteEnv as K, readIrRouteMarker as L, resetPartialUnsafeKinds as M, resetSourcelessDbRowReports as N, resolveAnnouncedKindLoading as O, type PartialRenderOptions as P, resolveProvisionalKindRender as Q, resolveSupersededKindRender as R, type StructuredValueRenderProps as S, routeEnvOf as T, useDirectiveHost as U, useDirectiveScope as V, 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 DirectiveScope as n, DirectiveScopeProvider as o, type DirectiveShell as p, type GenericFallbackReason as q, IR_ROUTE_KEY as r, type IrRenderBlock as s, type IrRoutableBlock as t, type IrRouteMarker as u, type KindRouteBinding as v, type KindRouteOptions as w, type ProvisionalKindRender as x, type SupersededKindRender as y, applyIrKindRoute as z };
|
|
@@ -62,6 +62,28 @@ interface DirectiveAskRequest {
|
|
|
62
62
|
items: Record<string, unknown>[];
|
|
63
63
|
/** The noun's human label ("Task"), from the host's catalog when it has one. */
|
|
64
64
|
nounLabel: string;
|
|
65
|
+
/**
|
|
66
|
+
* True for "Run again": the ledger already holds this block, and a yes runs
|
|
67
|
+
* it a SECOND time (`force`) — another copy for a create, the same fields
|
|
68
|
+
* written again for an update, another delete for a restored record. The
|
|
69
|
+
* question must say so.
|
|
70
|
+
*/
|
|
71
|
+
again?: boolean;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* The shell a card hands its host — the two keys, plus WHERE it sits.
|
|
75
|
+
*
|
|
76
|
+
* `conversationId` is the conversation the card renders in (a chat message),
|
|
77
|
+
* absent in a person's own content (a note). It is the idempotency NAMESPACE:
|
|
78
|
+
* a card in an agent's message must apply under the SAME key as that
|
|
79
|
+
* proposal's Approve button, or the one action could run twice.
|
|
80
|
+
*/
|
|
81
|
+
interface DirectiveShell {
|
|
82
|
+
__kind: string;
|
|
83
|
+
items: Record<string, unknown>[];
|
|
84
|
+
conversationId?: string;
|
|
85
|
+
/** "Run again": skip the ledger's dedup and apply a second time. */
|
|
86
|
+
force?: boolean;
|
|
65
87
|
}
|
|
66
88
|
interface DirectiveOpenItemOptions {
|
|
67
89
|
/** The item, `__kind`-stamped when the shape has an item kind. */
|
|
@@ -90,10 +112,7 @@ interface DirectiveHost {
|
|
|
90
112
|
* item against the registered model and runs the ONE handler; idempotent).
|
|
91
113
|
* Reject with an Error whose message is safe to show.
|
|
92
114
|
*/
|
|
93
|
-
confirm?: (shell:
|
|
94
|
-
__kind: string;
|
|
95
|
-
items: Record<string, unknown>[];
|
|
96
|
-
}) => Promise<DirectiveApplyResult>;
|
|
115
|
+
confirm?: (shell: DirectiveShell) => Promise<DirectiveApplyResult>;
|
|
97
116
|
/**
|
|
98
117
|
* Ask the person BEFORE anything runs, naming the consequence (the records,
|
|
99
118
|
* what changes). Resolve `true` to go ahead, `false` to leave the card as it
|
|
@@ -113,10 +132,7 @@ interface DirectiveHost {
|
|
|
113
132
|
* read: the card reports it and offers Apply, which is safe because `confirm`
|
|
114
133
|
* is idempotent. Absent → the card starts at Apply, as before.
|
|
115
134
|
*/
|
|
116
|
-
applyState?: (shell:
|
|
117
|
-
__kind: string;
|
|
118
|
-
items: Record<string, unknown>[];
|
|
119
|
-
}) => Promise<DirectiveApplyState>;
|
|
135
|
+
applyState?: (shell: DirectiveShell) => Promise<DirectiveApplyState>;
|
|
120
136
|
/**
|
|
121
137
|
* Draw ONE existing record by its live name, as a way to open it. Used on
|
|
122
138
|
* update/delete rows (the record that will change), in the host's own ask
|
|
@@ -135,6 +151,20 @@ interface DirectiveHost {
|
|
|
135
151
|
/** Where a decode failure or an unhonourable shell is reported. Default: console.error. */
|
|
136
152
|
reportError?: (message: string) => void;
|
|
137
153
|
}
|
|
154
|
+
/** Where a directive renders — today, the conversation it sits in (if any). */
|
|
155
|
+
interface DirectiveScope {
|
|
156
|
+
conversationId?: string | null;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Tell every card below WHERE it renders. A host draws a chat message's
|
|
160
|
+
* directives inside one of these (or passes `conversationId` to
|
|
161
|
+
* `DirectiveRender`), so the card applies in that conversation's namespace —
|
|
162
|
+
* the same key the agent's proposal approves under. A note mounts none.
|
|
163
|
+
*/
|
|
164
|
+
declare function DirectiveScopeProvider({ conversationId, children, }: DirectiveScope & {
|
|
165
|
+
children: ReactNode;
|
|
166
|
+
}): react.JSX.Element;
|
|
167
|
+
declare function useDirectiveScope(): DirectiveScope;
|
|
138
168
|
interface DirectiveHostProviderProps {
|
|
139
169
|
host: DirectiveHost;
|
|
140
170
|
children: ReactNode;
|
|
@@ -635,4 +665,4 @@ interface KindRouteBinding {
|
|
|
635
665
|
/** Bind the pure routes to one host's env + owned block types. */
|
|
636
666
|
declare function createKindRouteBinding(env: KindRouteEnv, options?: KindRouteOptions): KindRouteBinding;
|
|
637
667
|
|
|
638
|
-
export {
|
|
668
|
+
export { createKindRouteBinding as A, envelopeFromPartialKind as B, type ContentIrHost as C, DB_KIND_COMPONENT_KEY as D, isPartialReadyKind as E, isProvisionalBlock as F, GENERIC_STRUCTURED_COMPONENT_KEY as G, kindServerDataFromStoredValue as H, IR_PROVISIONAL_KEY as I, markKindPartialUnsafe as J, type KindRouteEnv as K, readIrRouteMarker as L, resetPartialUnsafeKinds as M, resetSourcelessDbRowReports as N, resolveAnnouncedKindLoading as O, type PartialRenderOptions as P, resolveProvisionalKindRender as Q, resolveSupersededKindRender as R, type StructuredValueRenderProps as S, routeEnvOf as T, useDirectiveHost as U, useDirectiveScope as V, 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 DirectiveScope as n, DirectiveScopeProvider as o, type DirectiveShell as p, type GenericFallbackReason as q, IR_ROUTE_KEY as r, type IrRenderBlock as s, type IrRoutableBlock as t, type IrRouteMarker as u, type KindRouteBinding as v, type KindRouteOptions as w, type ProvisionalKindRender as x, type SupersededKindRender as y, applyIrKindRoute 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,
|
|
1
|
+
export { D as DB_KIND_COMPONENT_KEY, c as DIRECTIVE_BLOCK_TYPE, G as GENERIC_STRUCTURED_COMPONENT_KEY, q as GenericFallbackReason, I as IR_PROVISIONAL_KEY, r as IR_ROUTE_KEY, u as IrRouteMarker, v as KindRouteBinding, w as KindRouteOptions, P as PartialRenderOptions, x as ProvisionalKindRender, y as SupersededKindRender, z as applyIrKindRoute, A as createKindRouteBinding, B as envelopeFromPartialKind, E as isPartialReadyKind, F as isProvisionalBlock, H as kindServerDataFromStoredValue, J as markKindPartialUnsafe, L as readIrRouteMarker, M as resetPartialUnsafeKinds, N as resetSourcelessDbRowReports, O as resolveAnnouncedKindLoading, Q as resolveProvisionalKindRender, R as resolveSupersededKindRender } from './route-BCtPhF7W.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,
|
|
1
|
+
export { D as DB_KIND_COMPONENT_KEY, c as DIRECTIVE_BLOCK_TYPE, G as GENERIC_STRUCTURED_COMPONENT_KEY, q as GenericFallbackReason, I as IR_PROVISIONAL_KEY, r as IR_ROUTE_KEY, u as IrRouteMarker, v as KindRouteBinding, w as KindRouteOptions, P as PartialRenderOptions, x as ProvisionalKindRender, y as SupersededKindRender, z as applyIrKindRoute, A as createKindRouteBinding, B as envelopeFromPartialKind, E as isPartialReadyKind, F as isProvisionalBlock, H as kindServerDataFromStoredValue, J as markKindPartialUnsafe, L as readIrRouteMarker, M as resetPartialUnsafeKinds, N as resetSourcelessDbRowReports, O as resolveAnnouncedKindLoading, Q as resolveProvisionalKindRender, R as resolveSupersededKindRender } from './route-DDbgc-ID.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.
|
|
3
|
+
"version": "0.15.1",
|
|
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",
|
|
@@ -124,8 +124,8 @@
|
|
|
124
124
|
"react": ">=19.0.0"
|
|
125
125
|
},
|
|
126
126
|
"dependencies": {
|
|
127
|
-
"@ai-matrx/
|
|
128
|
-
"@ai-matrx/
|
|
127
|
+
"@ai-matrx/kit": "latest",
|
|
128
|
+
"@ai-matrx/content-ir": "latest"
|
|
129
129
|
},
|
|
130
130
|
"devDependencies": {
|
|
131
131
|
"@arethetypeswrong/cli": "^0.18.5",
|