@mastra/json-render 0.0.0-dashboard-view-tabs-20261123152418

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.
@@ -0,0 +1,236 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * The components Mastra Studio renders in agent replies, drawn with its design system.
4
+ * Give it to an agent's `JsonRenderProcessor` to let the agent compose interfaces in Studio chat.
5
+ * `@json-render/react/schema` only describes the spec format; it does not load React.
6
+ */
7
+ export declare const studioCatalog: import("@json-render/core").Catalog<{
8
+ spec: import("@json-render/core").SchemaType<"object", {
9
+ root: import("@json-render/core").SchemaType<"string", unknown>;
10
+ elements: import("@json-render/core").SchemaType<"record", import("@json-render/core").SchemaType<"object", {
11
+ type: import("@json-render/core").SchemaType<"ref", string>;
12
+ props: import("@json-render/core").SchemaType<"propsOf", string>;
13
+ children: import("@json-render/core").SchemaType<"array", import("@json-render/core").SchemaType<"string", unknown>>;
14
+ slots: {
15
+ optional: true;
16
+ kind: "record";
17
+ inner?: import("@json-render/core").SchemaType<"array", import("@json-render/core").SchemaType<"string", unknown>> | undefined;
18
+ };
19
+ visible: {
20
+ optional: true;
21
+ kind: "any";
22
+ inner?: unknown;
23
+ };
24
+ repeat: {
25
+ optional: true;
26
+ kind: "any";
27
+ inner?: unknown;
28
+ };
29
+ }>>;
30
+ }>;
31
+ catalog: import("@json-render/core").SchemaType<"object", {
32
+ components: import("@json-render/core").SchemaType<"map", {
33
+ props: import("@json-render/core").SchemaType<"zod", unknown>;
34
+ slots: import("@json-render/core").SchemaType<"array", import("@json-render/core").SchemaType<"string", unknown>>;
35
+ description: import("@json-render/core").SchemaType<"string", unknown>;
36
+ example: import("@json-render/core").SchemaType<"any", unknown>;
37
+ }>;
38
+ actions: import("@json-render/core").SchemaType<"map", {
39
+ params: import("@json-render/core").SchemaType<"zod", unknown>;
40
+ description: import("@json-render/core").SchemaType<"string", unknown>;
41
+ }>;
42
+ }>;
43
+ }, {
44
+ components: {
45
+ Stack: {
46
+ props: z.ZodObject<{
47
+ direction: z.ZodOptional<z.ZodEnum<{
48
+ horizontal: "horizontal";
49
+ vertical: "vertical";
50
+ }>>;
51
+ gap: z.ZodOptional<z.ZodEnum<{
52
+ lg: "lg";
53
+ md: "md";
54
+ sm: "sm";
55
+ }>>;
56
+ align: z.ZodOptional<z.ZodEnum<{
57
+ center: "center";
58
+ end: "end";
59
+ start: "start";
60
+ stretch: "stretch";
61
+ }>>;
62
+ }, z.core.$strip>;
63
+ slots: string[];
64
+ description: string;
65
+ };
66
+ Grid: {
67
+ props: z.ZodObject<{
68
+ columns: z.ZodNumber;
69
+ }, z.core.$strip>;
70
+ slots: string[];
71
+ description: string;
72
+ };
73
+ Card: {
74
+ props: z.ZodObject<{
75
+ title: z.ZodOptional<z.ZodString>;
76
+ description: z.ZodOptional<z.ZodString>;
77
+ }, z.core.$strip>;
78
+ slots: string[];
79
+ description: string;
80
+ };
81
+ Heading: {
82
+ props: z.ZodObject<{
83
+ text: z.ZodString;
84
+ size: z.ZodOptional<z.ZodEnum<{
85
+ lg: "lg";
86
+ md: "md";
87
+ sm: "sm";
88
+ }>>;
89
+ }, z.core.$strip>;
90
+ slots: never[];
91
+ description: string;
92
+ };
93
+ Text: {
94
+ props: z.ZodObject<{
95
+ text: z.ZodString;
96
+ tone: z.ZodOptional<z.ZodEnum<{
97
+ default: "default";
98
+ muted: "muted";
99
+ }>>;
100
+ }, z.core.$strip>;
101
+ slots: never[];
102
+ description: string;
103
+ };
104
+ Badge: {
105
+ props: z.ZodObject<{
106
+ text: z.ZodString;
107
+ variant: z.ZodOptional<z.ZodEnum<{
108
+ destructive: "destructive";
109
+ info: "info";
110
+ neutral: "neutral";
111
+ success: "success";
112
+ warning: "warning";
113
+ }>>;
114
+ }, z.core.$strip>;
115
+ slots: never[];
116
+ description: string;
117
+ };
118
+ Stat: {
119
+ props: z.ZodObject<{
120
+ label: z.ZodString;
121
+ value: z.ZodString;
122
+ detail: z.ZodOptional<z.ZodString>;
123
+ trend: z.ZodOptional<z.ZodEnum<{
124
+ down: "down";
125
+ flat: "flat";
126
+ up: "up";
127
+ }>>;
128
+ }, z.core.$strip>;
129
+ slots: never[];
130
+ description: string;
131
+ };
132
+ Table: {
133
+ props: z.ZodObject<{
134
+ columns: z.ZodArray<z.ZodString>;
135
+ rows: z.ZodArray<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
136
+ }, z.core.$strip>;
137
+ slots: never[];
138
+ description: string;
139
+ };
140
+ List: {
141
+ props: z.ZodObject<{
142
+ items: z.ZodArray<z.ZodString>;
143
+ ordered: z.ZodOptional<z.ZodBoolean>;
144
+ }, z.core.$strip>;
145
+ slots: never[];
146
+ description: string;
147
+ };
148
+ Progress: {
149
+ props: z.ZodObject<{
150
+ label: z.ZodString;
151
+ value: z.ZodNumber;
152
+ detail: z.ZodOptional<z.ZodString>;
153
+ }, z.core.$strip>;
154
+ slots: never[];
155
+ description: string;
156
+ };
157
+ Notice: {
158
+ props: z.ZodObject<{
159
+ text: z.ZodString;
160
+ title: z.ZodOptional<z.ZodString>;
161
+ variant: z.ZodOptional<z.ZodEnum<{
162
+ destructive: "destructive";
163
+ info: "info";
164
+ note: "note";
165
+ success: "success";
166
+ warning: "warning";
167
+ }>>;
168
+ }, z.core.$strip>;
169
+ slots: never[];
170
+ description: string;
171
+ };
172
+ Separator: {
173
+ props: z.ZodObject<{}, z.core.$strip>;
174
+ slots: never[];
175
+ description: string;
176
+ };
177
+ Button: {
178
+ props: z.ZodObject<{
179
+ label: z.ZodString;
180
+ variant: z.ZodOptional<z.ZodEnum<{
181
+ default: "default";
182
+ ghost: "ghost";
183
+ primary: "primary";
184
+ }>>;
185
+ }, z.core.$strip>;
186
+ slots: never[];
187
+ events: string[];
188
+ description: string;
189
+ };
190
+ Input: {
191
+ props: z.ZodObject<{
192
+ label: z.ZodString;
193
+ value: z.ZodOptional<z.ZodString>;
194
+ placeholder: z.ZodOptional<z.ZodString>;
195
+ type: z.ZodOptional<z.ZodEnum<{
196
+ email: "email";
197
+ number: "number";
198
+ text: "text";
199
+ }>>;
200
+ }, z.core.$strip>;
201
+ slots: never[];
202
+ description: string;
203
+ };
204
+ Select: {
205
+ props: z.ZodObject<{
206
+ label: z.ZodString;
207
+ options: z.ZodArray<z.ZodObject<{
208
+ label: z.ZodString;
209
+ value: z.ZodString;
210
+ }, z.core.$strip>>;
211
+ value: z.ZodOptional<z.ZodString>;
212
+ placeholder: z.ZodOptional<z.ZodString>;
213
+ }, z.core.$strip>;
214
+ slots: never[];
215
+ description: string;
216
+ };
217
+ Checkbox: {
218
+ props: z.ZodObject<{
219
+ label: z.ZodString;
220
+ checked: z.ZodOptional<z.ZodBoolean>;
221
+ }, z.core.$strip>;
222
+ slots: never[];
223
+ description: string;
224
+ };
225
+ };
226
+ actions: {
227
+ sendMessage: {
228
+ params: z.ZodObject<{
229
+ message: z.ZodString;
230
+ }, z.core.$strip>;
231
+ description: string;
232
+ };
233
+ };
234
+ }>;
235
+ export type StudioCatalog = typeof studioCatalog;
236
+ //# sourceMappingURL=catalog.d.ts.map
@@ -0,0 +1,195 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_state = require("../state-BJ97_AE8.cjs");
3
+ let _json_render_core = require("@json-render/core");
4
+ let _json_render_react_schema = require("@json-render/react/schema");
5
+ let zod = require("zod");
6
+ // src/studio/catalog.ts
7
+ /**
8
+ * The components Mastra Studio renders in agent replies, drawn with its design system.
9
+ * Give it to an agent's `JsonRenderProcessor` to let the agent compose interfaces in Studio chat.
10
+ * `@json-render/react/schema` only describes the spec format; it does not load React.
11
+ */
12
+ const studioCatalog = (0, _json_render_core.defineCatalog)(_json_render_react_schema.schema, {
13
+ components: {
14
+ Stack: {
15
+ props: zod.z.object({
16
+ direction: zod.z.enum(["vertical", "horizontal"]).optional(),
17
+ gap: zod.z.enum([
18
+ "sm",
19
+ "md",
20
+ "lg"
21
+ ]).optional(),
22
+ align: zod.z.enum([
23
+ "start",
24
+ "center",
25
+ "end",
26
+ "stretch"
27
+ ]).optional()
28
+ }),
29
+ slots: ["default"],
30
+ description: "Lays children out in a column (default) or a wrapping row."
31
+ },
32
+ Grid: {
33
+ props: zod.z.object({ columns: zod.z.number().int().min(1).max(4) }),
34
+ slots: ["default"],
35
+ description: "Grid of equal columns; collapses to one column on narrow screens. Use for Stat or Card groups."
36
+ },
37
+ Card: {
38
+ props: zod.z.object({
39
+ title: zod.z.string().optional(),
40
+ description: zod.z.string().optional()
41
+ }),
42
+ slots: ["default"],
43
+ description: "Surface grouping related content, with an optional title and description."
44
+ },
45
+ Heading: {
46
+ props: zod.z.object({
47
+ text: zod.z.string(),
48
+ size: zod.z.enum([
49
+ "lg",
50
+ "md",
51
+ "sm"
52
+ ]).optional()
53
+ }),
54
+ slots: [],
55
+ description: "Section heading."
56
+ },
57
+ Text: {
58
+ props: zod.z.object({
59
+ text: zod.z.string(),
60
+ tone: zod.z.enum(["default", "muted"]).optional()
61
+ }),
62
+ slots: [],
63
+ description: "A paragraph of plain text."
64
+ },
65
+ Badge: {
66
+ props: zod.z.object({
67
+ text: zod.z.string(),
68
+ variant: zod.z.enum([
69
+ "neutral",
70
+ "success",
71
+ "warning",
72
+ "destructive",
73
+ "info"
74
+ ]).optional()
75
+ }),
76
+ slots: [],
77
+ description: "Short status or category label, e.g. \"On track\" or \"Blocked\"."
78
+ },
79
+ Stat: {
80
+ props: zod.z.object({
81
+ label: zod.z.string(),
82
+ value: zod.z.string(),
83
+ detail: zod.z.string().optional(),
84
+ trend: zod.z.enum([
85
+ "up",
86
+ "down",
87
+ "flat"
88
+ ]).optional()
89
+ }),
90
+ slots: [],
91
+ description: "A key figure with its label, e.g. a metric, price or score. `detail` is a short note like '+12% vs last week'."
92
+ },
93
+ Table: {
94
+ props: zod.z.object({
95
+ columns: zod.z.array(zod.z.string()).min(1),
96
+ rows: zod.z.array(zod.z.array(zod.z.union([zod.z.string(), zod.z.number()])))
97
+ }),
98
+ slots: [],
99
+ description: "Tabular data. Each row lists one cell per column, in column order."
100
+ },
101
+ List: {
102
+ props: zod.z.object({
103
+ items: zod.z.array(zod.z.string()),
104
+ ordered: zod.z.boolean().optional()
105
+ }),
106
+ slots: [],
107
+ description: "Bulleted (or numbered when `ordered`) list of short items."
108
+ },
109
+ Progress: {
110
+ props: zod.z.object({
111
+ label: zod.z.string(),
112
+ value: zod.z.number().min(0).max(100),
113
+ detail: zod.z.string().optional()
114
+ }),
115
+ slots: [],
116
+ description: "Labeled progress bar; `value` is a percentage from 0 to 100."
117
+ },
118
+ Notice: {
119
+ props: zod.z.object({
120
+ text: zod.z.string(),
121
+ title: zod.z.string().optional(),
122
+ variant: zod.z.enum([
123
+ "info",
124
+ "success",
125
+ "warning",
126
+ "destructive",
127
+ "note"
128
+ ]).optional()
129
+ }),
130
+ slots: [],
131
+ description: "Callout that draws attention to a note, tip, warning or error."
132
+ },
133
+ Separator: {
134
+ props: zod.z.object({}),
135
+ slots: [],
136
+ description: "Horizontal divider between sections."
137
+ },
138
+ Button: {
139
+ props: zod.z.object({
140
+ label: zod.z.string(),
141
+ variant: zod.z.enum([
142
+ "primary",
143
+ "default",
144
+ "ghost"
145
+ ]).optional()
146
+ }),
147
+ slots: [],
148
+ events: ["press"],
149
+ description: "Button. Bind its `press` event with `on`, e.g. to `sendMessage` to answer on the user's behalf, or to `setState`."
150
+ },
151
+ Input: {
152
+ props: zod.z.object({
153
+ label: zod.z.string(),
154
+ value: zod.z.string().optional(),
155
+ placeholder: zod.z.string().optional(),
156
+ type: zod.z.enum([
157
+ "text",
158
+ "number",
159
+ "email"
160
+ ]).optional()
161
+ }),
162
+ slots: [],
163
+ description: "Labeled text field. Bind `value` to state with { \"$bindState\": \"/path\" } so its value can be read."
164
+ },
165
+ Select: {
166
+ props: zod.z.object({
167
+ label: zod.z.string(),
168
+ options: zod.z.array(zod.z.object({
169
+ label: zod.z.string(),
170
+ value: zod.z.string()
171
+ })).min(1),
172
+ value: zod.z.string().optional(),
173
+ placeholder: zod.z.string().optional()
174
+ }),
175
+ slots: [],
176
+ description: "Labeled dropdown. Bind `value` to state with { \"$bindState\": \"/path\" }."
177
+ },
178
+ Checkbox: {
179
+ props: zod.z.object({
180
+ label: zod.z.string(),
181
+ checked: zod.z.boolean().optional()
182
+ }),
183
+ slots: [],
184
+ description: "Labeled checkbox. Bind `checked` to state with { \"$bindState\": \"/path\" }."
185
+ }
186
+ },
187
+ actions: { sendMessage: {
188
+ params: zod.z.object({ message: zod.z.string().min(1) }),
189
+ description: "Sends `message` to you as the user's next turn, e.g. when they pick an option or submit a form. Pass a field's value with { \"$state\": \"/path\" }."
190
+ } }
191
+ });
192
+ exports.JSON_RENDER_STATE = require_state.JSON_RENDER_STATE;
193
+ exports.studioCatalog = studioCatalog;
194
+
195
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","names":["defineCatalog","schema","z"],"sources":["../../src/studio/catalog.ts"],"sourcesContent":["import { defineCatalog } from '@json-render/core';\nimport { schema } from '@json-render/react/schema';\nimport { z } from 'zod';\n\n/**\n * The components Mastra Studio renders in agent replies, drawn with its design system.\n * Give it to an agent's `JsonRenderProcessor` to let the agent compose interfaces in Studio chat.\n * `@json-render/react/schema` only describes the spec format; it does not load React.\n */\nexport const studioCatalog = defineCatalog(schema, {\n components: {\n Stack: {\n props: z.object({\n direction: z.enum(['vertical', 'horizontal']).optional(),\n gap: z.enum(['sm', 'md', 'lg']).optional(),\n align: z.enum(['start', 'center', 'end', 'stretch']).optional(),\n }),\n slots: ['default'],\n description: 'Lays children out in a column (default) or a wrapping row.',\n },\n Grid: {\n props: z.object({ columns: z.number().int().min(1).max(4) }),\n slots: ['default'],\n description: 'Grid of equal columns; collapses to one column on narrow screens. Use for Stat or Card groups.',\n },\n Card: {\n props: z.object({ title: z.string().optional(), description: z.string().optional() }),\n slots: ['default'],\n description: 'Surface grouping related content, with an optional title and description.',\n },\n Heading: {\n props: z.object({ text: z.string(), size: z.enum(['lg', 'md', 'sm']).optional() }),\n slots: [],\n description: 'Section heading.',\n },\n Text: {\n props: z.object({ text: z.string(), tone: z.enum(['default', 'muted']).optional() }),\n slots: [],\n description: 'A paragraph of plain text.',\n },\n Badge: {\n props: z.object({\n text: z.string(),\n variant: z.enum(['neutral', 'success', 'warning', 'destructive', 'info']).optional(),\n }),\n slots: [],\n description: 'Short status or category label, e.g. \"On track\" or \"Blocked\".',\n },\n Stat: {\n props: z.object({\n label: z.string(),\n value: z.string(),\n detail: z.string().optional(),\n trend: z.enum(['up', 'down', 'flat']).optional(),\n }),\n slots: [],\n description:\n \"A key figure with its label, e.g. a metric, price or score. `detail` is a short note like '+12% vs last week'.\",\n },\n Table: {\n props: z.object({\n columns: z.array(z.string()).min(1),\n rows: z.array(z.array(z.union([z.string(), z.number()]))),\n }),\n slots: [],\n description: 'Tabular data. Each row lists one cell per column, in column order.',\n },\n List: {\n props: z.object({ items: z.array(z.string()), ordered: z.boolean().optional() }),\n slots: [],\n description: 'Bulleted (or numbered when `ordered`) list of short items.',\n },\n Progress: {\n props: z.object({ label: z.string(), value: z.number().min(0).max(100), detail: z.string().optional() }),\n slots: [],\n description: 'Labeled progress bar; `value` is a percentage from 0 to 100.',\n },\n Notice: {\n props: z.object({\n text: z.string(),\n title: z.string().optional(),\n variant: z.enum(['info', 'success', 'warning', 'destructive', 'note']).optional(),\n }),\n slots: [],\n description: 'Callout that draws attention to a note, tip, warning or error.',\n },\n Separator: {\n props: z.object({}),\n slots: [],\n description: 'Horizontal divider between sections.',\n },\n Button: {\n props: z.object({ label: z.string(), variant: z.enum(['primary', 'default', 'ghost']).optional() }),\n slots: [],\n events: ['press'],\n description:\n \"Button. Bind its `press` event with `on`, e.g. to `sendMessage` to answer on the user's behalf, or to `setState`.\",\n },\n Input: {\n props: z.object({\n label: z.string(),\n value: z.string().optional(),\n placeholder: z.string().optional(),\n type: z.enum(['text', 'number', 'email']).optional(),\n }),\n slots: [],\n description: 'Labeled text field. Bind `value` to state with { \"$bindState\": \"/path\" } so its value can be read.',\n },\n Select: {\n props: z.object({\n label: z.string(),\n options: z.array(z.object({ label: z.string(), value: z.string() })).min(1),\n value: z.string().optional(),\n placeholder: z.string().optional(),\n }),\n slots: [],\n description: 'Labeled dropdown. Bind `value` to state with { \"$bindState\": \"/path\" }.',\n },\n Checkbox: {\n props: z.object({ label: z.string(), checked: z.boolean().optional() }),\n slots: [],\n description: 'Labeled checkbox. Bind `checked` to state with { \"$bindState\": \"/path\" }.',\n },\n },\n actions: {\n sendMessage: {\n params: z.object({ message: z.string().min(1) }),\n description:\n 'Sends `message` to you as the user\\'s next turn, e.g. when they pick an option or submit a form. Pass a field\\'s value with { \"$state\": \"/path\" }.',\n },\n },\n});\n\nexport type StudioCatalog = typeof studioCatalog;\n"],"mappings":";;;;;;;;;;;AASA,MAAa,iBAAA,GAAgBA,kBAAAA,cAAAA,CAAcC,0BAAAA,QAAQ;CACjD,YAAY;EACV,OAAO;GACL,OAAOC,IAAAA,EAAE,OAAO;IACd,WAAWA,IAAAA,EAAE,KAAK,CAAC,YAAY,YAAY,CAAC,CAAC,CAAC,SAAS;IACvD,KAAKA,IAAAA,EAAE,KAAK;KAAC;KAAM;KAAM;IAAI,CAAC,CAAC,CAAC,SAAS;IACzC,OAAOA,IAAAA,EAAE,KAAK;KAAC;KAAS;KAAU;KAAO;IAAS,CAAC,CAAC,CAAC,SAAS;GAChE,CAAC;GACD,OAAO,CAAC,SAAS;GACjB,aAAa;EACf;EACA,MAAM;GACJ,OAAOA,IAAAA,EAAE,OAAO,EAAE,SAASA,IAAAA,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;GAC3D,OAAO,CAAC,SAAS;GACjB,aAAa;EACf;EACA,MAAM;GACJ,OAAOA,IAAAA,EAAE,OAAO;IAAE,OAAOA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS;IAAG,aAAaA,IAAAA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,EAAE,OAAO,CAAC,CAAC,SAAS;IACjC,MAAMA,IAAAA,EAAE,KAAK;KAAC;KAAQ;KAAU;IAAO,CAAC,CAAC,CAAC,SAAS;GACrD,CAAC;GACD,OAAO,CAAC;GACR,aAAa;EACf;EACA,QAAQ;GACN,OAAOA,IAAAA,EAAE,OAAO;IACd,OAAOA,IAAAA,EAAE,OAAO;IAChB,SAASA,IAAAA,EAAE,MAAMA,IAAAA,EAAE,OAAO;KAAE,OAAOA,IAAAA,EAAE,OAAO;KAAG,OAAOA,IAAAA,EAAE,OAAO;IAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC1E,OAAOA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS;IAC3B,aAAaA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS;GACnC,CAAC;GACD,OAAO,CAAC;GACR,aAAa;EACf;EACA,UAAU;GACR,OAAOA,IAAAA,EAAE,OAAO;IAAE,OAAOA,IAAAA,EAAE,OAAO;IAAG,SAASA,IAAAA,EAAE,QAAQ,CAAC,CAAC,SAAS;GAAE,CAAC;GACtE,OAAO,CAAC;GACR,aAAa;EACf;CACF;CACA,SAAS,EACP,aAAa;EACX,QAAQA,IAAAA,EAAE,OAAO,EAAE,SAASA,IAAAA,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;EAC/C,aACE;CACJ,EACF;AACF,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { studioCatalog } from './catalog.js';
2
+ export type { StudioCatalog } from './catalog.js';
3
+ export { JSON_RENDER_STATE } from '../state.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,193 @@
1
+ import { t as JSON_RENDER_STATE } from "../state-Bl6NZlzO.js";
2
+ import { defineCatalog } from "@json-render/core";
3
+ import { schema } from "@json-render/react/schema";
4
+ import { z } from "zod";
5
+ // src/studio/catalog.ts
6
+ /**
7
+ * The components Mastra Studio renders in agent replies, drawn with its design system.
8
+ * Give it to an agent's `JsonRenderProcessor` to let the agent compose interfaces in Studio chat.
9
+ * `@json-render/react/schema` only describes the spec format; it does not load React.
10
+ */
11
+ const studioCatalog = defineCatalog(schema, {
12
+ components: {
13
+ Stack: {
14
+ props: z.object({
15
+ direction: z.enum(["vertical", "horizontal"]).optional(),
16
+ gap: z.enum([
17
+ "sm",
18
+ "md",
19
+ "lg"
20
+ ]).optional(),
21
+ align: z.enum([
22
+ "start",
23
+ "center",
24
+ "end",
25
+ "stretch"
26
+ ]).optional()
27
+ }),
28
+ slots: ["default"],
29
+ description: "Lays children out in a column (default) or a wrapping row."
30
+ },
31
+ Grid: {
32
+ props: z.object({ columns: z.number().int().min(1).max(4) }),
33
+ slots: ["default"],
34
+ description: "Grid of equal columns; collapses to one column on narrow screens. Use for Stat or Card groups."
35
+ },
36
+ Card: {
37
+ props: z.object({
38
+ title: z.string().optional(),
39
+ description: z.string().optional()
40
+ }),
41
+ slots: ["default"],
42
+ description: "Surface grouping related content, with an optional title and description."
43
+ },
44
+ Heading: {
45
+ props: z.object({
46
+ text: z.string(),
47
+ size: z.enum([
48
+ "lg",
49
+ "md",
50
+ "sm"
51
+ ]).optional()
52
+ }),
53
+ slots: [],
54
+ description: "Section heading."
55
+ },
56
+ Text: {
57
+ props: z.object({
58
+ text: z.string(),
59
+ tone: z.enum(["default", "muted"]).optional()
60
+ }),
61
+ slots: [],
62
+ description: "A paragraph of plain text."
63
+ },
64
+ Badge: {
65
+ props: z.object({
66
+ text: z.string(),
67
+ variant: z.enum([
68
+ "neutral",
69
+ "success",
70
+ "warning",
71
+ "destructive",
72
+ "info"
73
+ ]).optional()
74
+ }),
75
+ slots: [],
76
+ description: "Short status or category label, e.g. \"On track\" or \"Blocked\"."
77
+ },
78
+ Stat: {
79
+ props: z.object({
80
+ label: z.string(),
81
+ value: z.string(),
82
+ detail: z.string().optional(),
83
+ trend: z.enum([
84
+ "up",
85
+ "down",
86
+ "flat"
87
+ ]).optional()
88
+ }),
89
+ slots: [],
90
+ description: "A key figure with its label, e.g. a metric, price or score. `detail` is a short note like '+12% vs last week'."
91
+ },
92
+ Table: {
93
+ props: z.object({
94
+ columns: z.array(z.string()).min(1),
95
+ rows: z.array(z.array(z.union([z.string(), z.number()])))
96
+ }),
97
+ slots: [],
98
+ description: "Tabular data. Each row lists one cell per column, in column order."
99
+ },
100
+ List: {
101
+ props: z.object({
102
+ items: z.array(z.string()),
103
+ ordered: z.boolean().optional()
104
+ }),
105
+ slots: [],
106
+ description: "Bulleted (or numbered when `ordered`) list of short items."
107
+ },
108
+ Progress: {
109
+ props: z.object({
110
+ label: z.string(),
111
+ value: z.number().min(0).max(100),
112
+ detail: z.string().optional()
113
+ }),
114
+ slots: [],
115
+ description: "Labeled progress bar; `value` is a percentage from 0 to 100."
116
+ },
117
+ Notice: {
118
+ props: z.object({
119
+ text: z.string(),
120
+ title: z.string().optional(),
121
+ variant: z.enum([
122
+ "info",
123
+ "success",
124
+ "warning",
125
+ "destructive",
126
+ "note"
127
+ ]).optional()
128
+ }),
129
+ slots: [],
130
+ description: "Callout that draws attention to a note, tip, warning or error."
131
+ },
132
+ Separator: {
133
+ props: z.object({}),
134
+ slots: [],
135
+ description: "Horizontal divider between sections."
136
+ },
137
+ Button: {
138
+ props: z.object({
139
+ label: z.string(),
140
+ variant: z.enum([
141
+ "primary",
142
+ "default",
143
+ "ghost"
144
+ ]).optional()
145
+ }),
146
+ slots: [],
147
+ events: ["press"],
148
+ description: "Button. Bind its `press` event with `on`, e.g. to `sendMessage` to answer on the user's behalf, or to `setState`."
149
+ },
150
+ Input: {
151
+ props: z.object({
152
+ label: z.string(),
153
+ value: z.string().optional(),
154
+ placeholder: z.string().optional(),
155
+ type: z.enum([
156
+ "text",
157
+ "number",
158
+ "email"
159
+ ]).optional()
160
+ }),
161
+ slots: [],
162
+ description: "Labeled text field. Bind `value` to state with { \"$bindState\": \"/path\" } so its value can be read."
163
+ },
164
+ Select: {
165
+ props: z.object({
166
+ label: z.string(),
167
+ options: z.array(z.object({
168
+ label: z.string(),
169
+ value: z.string()
170
+ })).min(1),
171
+ value: z.string().optional(),
172
+ placeholder: z.string().optional()
173
+ }),
174
+ slots: [],
175
+ description: "Labeled dropdown. Bind `value` to state with { \"$bindState\": \"/path\" }."
176
+ },
177
+ Checkbox: {
178
+ props: z.object({
179
+ label: z.string(),
180
+ checked: z.boolean().optional()
181
+ }),
182
+ slots: [],
183
+ description: "Labeled checkbox. Bind `checked` to state with { \"$bindState\": \"/path\" }."
184
+ }
185
+ },
186
+ actions: { sendMessage: {
187
+ params: z.object({ message: z.string().min(1) }),
188
+ description: "Sends `message` to you as the user's next turn, e.g. when they pick an option or submit a form. Pass a field's value with { \"$state\": \"/path\" }."
189
+ } }
190
+ });
191
+ export { JSON_RENDER_STATE, studioCatalog };
192
+
193
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/studio/catalog.ts"],"sourcesContent":["import { defineCatalog } from '@json-render/core';\nimport { schema } from '@json-render/react/schema';\nimport { z } from 'zod';\n\n/**\n * The components Mastra Studio renders in agent replies, drawn with its design system.\n * Give it to an agent's `JsonRenderProcessor` to let the agent compose interfaces in Studio chat.\n * `@json-render/react/schema` only describes the spec format; it does not load React.\n */\nexport const studioCatalog = defineCatalog(schema, {\n components: {\n Stack: {\n props: z.object({\n direction: z.enum(['vertical', 'horizontal']).optional(),\n gap: z.enum(['sm', 'md', 'lg']).optional(),\n align: z.enum(['start', 'center', 'end', 'stretch']).optional(),\n }),\n slots: ['default'],\n description: 'Lays children out in a column (default) or a wrapping row.',\n },\n Grid: {\n props: z.object({ columns: z.number().int().min(1).max(4) }),\n slots: ['default'],\n description: 'Grid of equal columns; collapses to one column on narrow screens. Use for Stat or Card groups.',\n },\n Card: {\n props: z.object({ title: z.string().optional(), description: z.string().optional() }),\n slots: ['default'],\n description: 'Surface grouping related content, with an optional title and description.',\n },\n Heading: {\n props: z.object({ text: z.string(), size: z.enum(['lg', 'md', 'sm']).optional() }),\n slots: [],\n description: 'Section heading.',\n },\n Text: {\n props: z.object({ text: z.string(), tone: z.enum(['default', 'muted']).optional() }),\n slots: [],\n description: 'A paragraph of plain text.',\n },\n Badge: {\n props: z.object({\n text: z.string(),\n variant: z.enum(['neutral', 'success', 'warning', 'destructive', 'info']).optional(),\n }),\n slots: [],\n description: 'Short status or category label, e.g. \"On track\" or \"Blocked\".',\n },\n Stat: {\n props: z.object({\n label: z.string(),\n value: z.string(),\n detail: z.string().optional(),\n trend: z.enum(['up', 'down', 'flat']).optional(),\n }),\n slots: [],\n description:\n \"A key figure with its label, e.g. a metric, price or score. `detail` is a short note like '+12% vs last week'.\",\n },\n Table: {\n props: z.object({\n columns: z.array(z.string()).min(1),\n rows: z.array(z.array(z.union([z.string(), z.number()]))),\n }),\n slots: [],\n description: 'Tabular data. Each row lists one cell per column, in column order.',\n },\n List: {\n props: z.object({ items: z.array(z.string()), ordered: z.boolean().optional() }),\n slots: [],\n description: 'Bulleted (or numbered when `ordered`) list of short items.',\n },\n Progress: {\n props: z.object({ label: z.string(), value: z.number().min(0).max(100), detail: z.string().optional() }),\n slots: [],\n description: 'Labeled progress bar; `value` is a percentage from 0 to 100.',\n },\n Notice: {\n props: z.object({\n text: z.string(),\n title: z.string().optional(),\n variant: z.enum(['info', 'success', 'warning', 'destructive', 'note']).optional(),\n }),\n slots: [],\n description: 'Callout that draws attention to a note, tip, warning or error.',\n },\n Separator: {\n props: z.object({}),\n slots: [],\n description: 'Horizontal divider between sections.',\n },\n Button: {\n props: z.object({ label: z.string(), variant: z.enum(['primary', 'default', 'ghost']).optional() }),\n slots: [],\n events: ['press'],\n description:\n \"Button. Bind its `press` event with `on`, e.g. to `sendMessage` to answer on the user's behalf, or to `setState`.\",\n },\n Input: {\n props: z.object({\n label: z.string(),\n value: z.string().optional(),\n placeholder: z.string().optional(),\n type: z.enum(['text', 'number', 'email']).optional(),\n }),\n slots: [],\n description: 'Labeled text field. Bind `value` to state with { \"$bindState\": \"/path\" } so its value can be read.',\n },\n Select: {\n props: z.object({\n label: z.string(),\n options: z.array(z.object({ label: z.string(), value: z.string() })).min(1),\n value: z.string().optional(),\n placeholder: z.string().optional(),\n }),\n slots: [],\n description: 'Labeled dropdown. Bind `value` to state with { \"$bindState\": \"/path\" }.',\n },\n Checkbox: {\n props: z.object({ label: z.string(), checked: z.boolean().optional() }),\n slots: [],\n description: 'Labeled checkbox. Bind `checked` to state with { \"$bindState\": \"/path\" }.',\n },\n },\n actions: {\n sendMessage: {\n params: z.object({ message: z.string().min(1) }),\n description:\n 'Sends `message` to you as the user\\'s next turn, e.g. when they pick an option or submit a form. Pass a field\\'s value with { \"$state\": \"/path\" }.',\n },\n },\n});\n\nexport type StudioCatalog = typeof studioCatalog;\n"],"mappings":";;;;;;;;;;AASA,MAAa,gBAAgB,cAAc,QAAQ;CACjD,YAAY;EACV,OAAO;GACL,OAAO,EAAE,OAAO;IACd,WAAW,EAAE,KAAK,CAAC,YAAY,YAAY,CAAC,CAAC,CAAC,SAAS;IACvD,KAAK,EAAE,KAAK;KAAC;KAAM;KAAM;IAAI,CAAC,CAAC,CAAC,SAAS;IACzC,OAAO,EAAE,KAAK;KAAC;KAAS;KAAU;KAAO;IAAS,CAAC,CAAC,CAAC,SAAS;GAChE,CAAC;GACD,OAAO,CAAC,SAAS;GACjB,aAAa;EACf;EACA,MAAM;GACJ,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;GAC3D,OAAO,CAAC,SAAS;GACjB,aAAa;EACf;EACA,MAAM;GACJ,OAAO,EAAE,OAAO;IAAE,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS;IAAG,aAAa,EAAE,OAAO,CAAC,CAAC,SAAS;GAAE,CAAC;GACpF,OAAO,CAAC,SAAS;GACjB,aAAa;EACf;EACA,SAAS;GACP,OAAO,EAAE,OAAO;IAAE,MAAM,EAAE,OA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