@stina/extension-api 1.16.0 → 1.18.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/dist/index.cjs +10 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/runtime.d.cts +2 -2
- package/dist/runtime.d.ts +2 -2
- package/dist/schemas/index.cjs +533 -523
- package/dist/schemas/index.cjs.map +1 -1
- package/dist/schemas/index.d.cts +245 -222
- package/dist/schemas/index.d.ts +245 -222
- package/dist/schemas/index.js +533 -523
- package/dist/schemas/index.js.map +1 -1
- package/dist/{types.tools-CK0As7KV.d.cts → types.tools-D_srSS_m.d.cts} +72 -47
- package/dist/{types.tools-CK0As7KV.d.ts → types.tools-D_srSS_m.d.ts} +72 -47
- package/package.json +1 -1
- package/schema/extension-manifest.schema.json +46 -21
- package/src/index.ts +2 -0
- package/src/schemas/card.schema.ts +14 -13
- package/src/schemas/components.schema.ts +42 -41
- package/src/schemas/contributions.schema.ts +15 -14
- package/src/schemas/localization.schema.ts +15 -0
- package/src/types.components.ts +43 -41
- package/src/types.contributions.ts +37 -5
- package/src/types.ts +2 -0
package/dist/schemas/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../chunk-DGUM43GV.js";
|
|
2
2
|
|
|
3
3
|
// src/schemas/manifest.schema.ts
|
|
4
|
-
import { z as
|
|
4
|
+
import { z as z5 } from "zod";
|
|
5
5
|
|
|
6
6
|
// src/schemas/permissions.schema.ts
|
|
7
7
|
import { z } from "zod";
|
|
@@ -88,11 +88,17 @@ function isValidPermission(permission) {
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
// src/schemas/contributions.schema.ts
|
|
91
|
-
import { z as
|
|
91
|
+
import { z as z4 } from "zod";
|
|
92
92
|
|
|
93
93
|
// src/schemas/components.schema.ts
|
|
94
|
+
import { z as z3 } from "zod";
|
|
95
|
+
|
|
96
|
+
// src/schemas/localization.schema.ts
|
|
94
97
|
import { z as z2 } from "zod";
|
|
95
|
-
var
|
|
98
|
+
var LocalizedStringSchema = z2.union([z2.string(), z2.record(z2.string())]).describe("String or localized string map");
|
|
99
|
+
|
|
100
|
+
// src/schemas/components.schema.ts
|
|
101
|
+
var AllowedCSSPropertySchema = z3.enum([
|
|
96
102
|
// Colors
|
|
97
103
|
"color",
|
|
98
104
|
"background-color",
|
|
@@ -164,252 +170,252 @@ var AllowedCSSPropertySchema = z2.enum([
|
|
|
164
170
|
"border-collapse",
|
|
165
171
|
"border-spacing"
|
|
166
172
|
]);
|
|
167
|
-
var ExtensionComponentStyleSchema =
|
|
168
|
-
var ExtensionComponentDataSchema =
|
|
169
|
-
() =>
|
|
170
|
-
component:
|
|
173
|
+
var ExtensionComponentStyleSchema = z3.record(AllowedCSSPropertySchema, z3.string()).describe("Safe CSS styles for the component");
|
|
174
|
+
var ExtensionComponentDataSchema = z3.lazy(
|
|
175
|
+
() => z3.object({
|
|
176
|
+
component: z3.string().describe("Component type name"),
|
|
171
177
|
style: ExtensionComponentStyleSchema.optional()
|
|
172
178
|
}).passthrough().describe("Extension component definition")
|
|
173
179
|
);
|
|
174
|
-
var ExtensionActionCallSchema =
|
|
175
|
-
action:
|
|
176
|
-
params:
|
|
180
|
+
var ExtensionActionCallSchema = z3.object({
|
|
181
|
+
action: z3.string().describe("Name of the registered action"),
|
|
182
|
+
params: z3.record(z3.unknown()).optional().describe("Parameters to pass")
|
|
177
183
|
}).describe("Action call with parameters");
|
|
178
|
-
var ExtensionActionRefSchema =
|
|
179
|
-
var ExtensionComponentIteratorSchema =
|
|
180
|
-
each:
|
|
181
|
-
as:
|
|
182
|
-
items:
|
|
184
|
+
var ExtensionActionRefSchema = z3.union([z3.string(), ExtensionActionCallSchema]).describe("Action reference");
|
|
185
|
+
var ExtensionComponentIteratorSchema = z3.object({
|
|
186
|
+
each: z3.union([z3.string(), z3.array(z3.unknown())]).describe("Data source to iterate over"),
|
|
187
|
+
as: z3.string().describe("Variable name for current item in scope"),
|
|
188
|
+
items: z3.array(ExtensionComponentDataSchema).describe("Components to render for each item")
|
|
183
189
|
}).describe("Iterator for rendering lists");
|
|
184
|
-
var ExtensionComponentChildrenSchema =
|
|
185
|
-
var ExtensionDataSourceSchema =
|
|
186
|
-
action:
|
|
187
|
-
params:
|
|
188
|
-
refreshOn:
|
|
190
|
+
var ExtensionComponentChildrenSchema = z3.union([z3.array(ExtensionComponentDataSchema), ExtensionComponentIteratorSchema]).describe("Child components or iterator");
|
|
191
|
+
var ExtensionDataSourceSchema = z3.object({
|
|
192
|
+
action: z3.string().describe("Action to call for fetching data"),
|
|
193
|
+
params: z3.record(z3.unknown()).optional().describe("Parameters to pass to the action"),
|
|
194
|
+
refreshOn: z3.array(z3.string()).optional().describe("Event names that trigger a refresh")
|
|
189
195
|
}).describe("Data source definition");
|
|
190
|
-
var HeaderPropsSchema =
|
|
191
|
-
component:
|
|
192
|
-
level:
|
|
193
|
-
title:
|
|
194
|
-
description:
|
|
195
|
-
icon:
|
|
196
|
+
var HeaderPropsSchema = z3.object({
|
|
197
|
+
component: z3.literal("Header"),
|
|
198
|
+
level: z3.number().min(1).max(6).describe("Heading level (1-6)"),
|
|
199
|
+
title: LocalizedStringSchema.describe("Header title"),
|
|
200
|
+
description: z3.union([LocalizedStringSchema, z3.array(LocalizedStringSchema)]).optional().describe("Description text"),
|
|
201
|
+
icon: z3.string().optional().describe("Icon name"),
|
|
196
202
|
style: ExtensionComponentStyleSchema.optional()
|
|
197
203
|
}).passthrough().describe("Header component");
|
|
198
|
-
var LabelPropsSchema =
|
|
199
|
-
component:
|
|
200
|
-
text:
|
|
204
|
+
var LabelPropsSchema = z3.object({
|
|
205
|
+
component: z3.literal("Label"),
|
|
206
|
+
text: LocalizedStringSchema.describe("Label text"),
|
|
201
207
|
style: ExtensionComponentStyleSchema.optional()
|
|
202
208
|
}).passthrough().describe("Label component");
|
|
203
|
-
var ClockPropsSchema =
|
|
204
|
-
component:
|
|
209
|
+
var ClockPropsSchema = z3.object({
|
|
210
|
+
component: z3.literal("Clock"),
|
|
205
211
|
style: ExtensionComponentStyleSchema.optional()
|
|
206
212
|
}).passthrough().describe("Clock component: the current date and time where the user is");
|
|
207
|
-
var ParagraphPropsSchema =
|
|
208
|
-
component:
|
|
209
|
-
text:
|
|
213
|
+
var ParagraphPropsSchema = z3.object({
|
|
214
|
+
component: z3.literal("Paragraph"),
|
|
215
|
+
text: LocalizedStringSchema.describe("Paragraph text"),
|
|
210
216
|
style: ExtensionComponentStyleSchema.optional()
|
|
211
217
|
}).passthrough().describe("Paragraph component");
|
|
212
|
-
var ButtonPropsSchema =
|
|
213
|
-
component:
|
|
214
|
-
text:
|
|
215
|
-
type:
|
|
216
|
-
title:
|
|
217
|
-
disabled:
|
|
218
|
+
var ButtonPropsSchema = z3.object({
|
|
219
|
+
component: z3.literal("Button"),
|
|
220
|
+
text: LocalizedStringSchema.describe("Button text"),
|
|
221
|
+
type: z3.enum(["normal", "primary", "danger", "accent"]).optional().describe("Visual style"),
|
|
222
|
+
title: LocalizedStringSchema.optional().describe("Tooltip shown on hover"),
|
|
223
|
+
disabled: z3.boolean().optional().describe("Disable the button"),
|
|
218
224
|
onClickAction: ExtensionActionRefSchema.describe("Action to call on click"),
|
|
219
225
|
style: ExtensionComponentStyleSchema.optional()
|
|
220
226
|
}).passthrough().describe("Button component");
|
|
221
|
-
var TextInputPropsSchema =
|
|
222
|
-
component:
|
|
223
|
-
label:
|
|
224
|
-
placeholder:
|
|
225
|
-
value:
|
|
227
|
+
var TextInputPropsSchema = z3.object({
|
|
228
|
+
component: z3.literal("TextInput"),
|
|
229
|
+
label: LocalizedStringSchema.describe("Input label"),
|
|
230
|
+
placeholder: LocalizedStringSchema.optional().describe("Placeholder text"),
|
|
231
|
+
value: z3.string().optional().describe("Current value"),
|
|
226
232
|
onChangeAction: ExtensionActionRefSchema.optional().describe("Action to call on change"),
|
|
227
233
|
style: ExtensionComponentStyleSchema.optional()
|
|
228
234
|
}).passthrough().describe("TextInput component");
|
|
229
|
-
var PasswordInputPropsSchema =
|
|
230
|
-
component:
|
|
231
|
-
label:
|
|
232
|
-
placeholder:
|
|
233
|
-
value:
|
|
235
|
+
var PasswordInputPropsSchema = z3.object({
|
|
236
|
+
component: z3.literal("PasswordInput"),
|
|
237
|
+
label: LocalizedStringSchema.describe("Input label"),
|
|
238
|
+
placeholder: LocalizedStringSchema.optional().describe("Placeholder text"),
|
|
239
|
+
value: z3.string().optional().describe("Current value"),
|
|
234
240
|
onChangeAction: ExtensionActionRefSchema.optional().describe("Action to call on change"),
|
|
235
241
|
style: ExtensionComponentStyleSchema.optional()
|
|
236
242
|
}).passthrough().describe("Password input component (text is masked)");
|
|
237
|
-
var NumberInputPropsSchema =
|
|
238
|
-
component:
|
|
239
|
-
label:
|
|
240
|
-
placeholder:
|
|
241
|
-
value:
|
|
242
|
-
min:
|
|
243
|
-
max:
|
|
244
|
-
step:
|
|
243
|
+
var NumberInputPropsSchema = z3.object({
|
|
244
|
+
component: z3.literal("NumberInput"),
|
|
245
|
+
label: LocalizedStringSchema.describe("Input label"),
|
|
246
|
+
placeholder: LocalizedStringSchema.optional().describe("Placeholder text"),
|
|
247
|
+
value: z3.union([z3.string(), z3.number()]).optional().describe("Current value"),
|
|
248
|
+
min: z3.number().optional().describe("Minimum value"),
|
|
249
|
+
max: z3.number().optional().describe("Maximum value"),
|
|
250
|
+
step: z3.number().optional().describe("Step"),
|
|
245
251
|
onChangeAction: ExtensionActionRefSchema.optional().describe("Action to call on change"),
|
|
246
252
|
style: ExtensionComponentStyleSchema.optional()
|
|
247
253
|
}).passthrough().describe("Numeric input component");
|
|
248
|
-
var TextAreaPropsSchema =
|
|
249
|
-
component:
|
|
250
|
-
label:
|
|
251
|
-
placeholder:
|
|
252
|
-
value:
|
|
253
|
-
rows:
|
|
254
|
+
var TextAreaPropsSchema = z3.object({
|
|
255
|
+
component: z3.literal("TextArea"),
|
|
256
|
+
label: LocalizedStringSchema.describe("Input label"),
|
|
257
|
+
placeholder: LocalizedStringSchema.optional().describe("Placeholder text"),
|
|
258
|
+
value: z3.string().optional().describe("Current value"),
|
|
259
|
+
rows: z3.number().int().positive().optional().describe("Number of visible text rows"),
|
|
254
260
|
onChangeAction: ExtensionActionRefSchema.optional().describe("Action to call on change"),
|
|
255
261
|
style: ExtensionComponentStyleSchema.optional()
|
|
256
262
|
}).passthrough().describe("TextArea component for multi-line text input");
|
|
257
|
-
var DateTimeInputPropsSchema =
|
|
258
|
-
component:
|
|
259
|
-
label:
|
|
260
|
-
value:
|
|
263
|
+
var DateTimeInputPropsSchema = z3.object({
|
|
264
|
+
component: z3.literal("DateTimeInput"),
|
|
265
|
+
label: LocalizedStringSchema.describe("Input label"),
|
|
266
|
+
value: z3.string().optional().describe("Current value"),
|
|
261
267
|
onChangeAction: ExtensionActionRefSchema.optional().describe("Action to call on change"),
|
|
262
268
|
style: ExtensionComponentStyleSchema.optional()
|
|
263
269
|
}).passthrough().describe("DateTimeInput component");
|
|
264
|
-
var SelectPropsSchema =
|
|
265
|
-
component:
|
|
266
|
-
label:
|
|
267
|
-
options:
|
|
268
|
-
selectedValue:
|
|
270
|
+
var SelectPropsSchema = z3.object({
|
|
271
|
+
component: z3.literal("Select"),
|
|
272
|
+
label: LocalizedStringSchema.describe("Select label"),
|
|
273
|
+
options: z3.array(z3.object({ label: LocalizedStringSchema, value: z3.string() })).describe("Available options"),
|
|
274
|
+
selectedValue: z3.string().optional().describe("Currently selected value"),
|
|
269
275
|
onChangeAction: ExtensionActionRefSchema.optional().describe("Action to call on change"),
|
|
270
276
|
style: ExtensionComponentStyleSchema.optional()
|
|
271
277
|
}).passthrough().describe("Select component");
|
|
272
|
-
var IconPickerPropsSchema =
|
|
273
|
-
component:
|
|
274
|
-
label:
|
|
275
|
-
value:
|
|
278
|
+
var IconPickerPropsSchema = z3.object({
|
|
279
|
+
component: z3.literal("IconPicker"),
|
|
280
|
+
label: LocalizedStringSchema.optional().describe("Picker label"),
|
|
281
|
+
value: z3.string().optional().describe("Currently selected icon name"),
|
|
276
282
|
onChangeAction: ExtensionActionRefSchema.optional().describe("Action to call on change"),
|
|
277
283
|
style: ExtensionComponentStyleSchema.optional()
|
|
278
284
|
}).passthrough().describe("IconPicker component");
|
|
279
|
-
var VerticalStackPropsSchema =
|
|
280
|
-
component:
|
|
281
|
-
gap:
|
|
285
|
+
var VerticalStackPropsSchema = z3.object({
|
|
286
|
+
component: z3.literal("VerticalStack"),
|
|
287
|
+
gap: z3.number().optional().describe("Gap between children"),
|
|
282
288
|
children: ExtensionComponentChildrenSchema.describe("Child components"),
|
|
283
289
|
style: ExtensionComponentStyleSchema.optional()
|
|
284
290
|
}).passthrough().describe("VerticalStack layout component");
|
|
285
|
-
var HorizontalStackPropsSchema =
|
|
286
|
-
component:
|
|
287
|
-
gap:
|
|
291
|
+
var HorizontalStackPropsSchema = z3.object({
|
|
292
|
+
component: z3.literal("HorizontalStack"),
|
|
293
|
+
gap: z3.number().optional().describe("Gap between children"),
|
|
288
294
|
children: ExtensionComponentChildrenSchema.describe("Child components"),
|
|
289
295
|
style: ExtensionComponentStyleSchema.optional()
|
|
290
296
|
}).passthrough().describe("HorizontalStack layout component");
|
|
291
|
-
var GridPropsSchema =
|
|
292
|
-
component:
|
|
293
|
-
columns:
|
|
294
|
-
gap:
|
|
297
|
+
var GridPropsSchema = z3.object({
|
|
298
|
+
component: z3.literal("Grid"),
|
|
299
|
+
columns: z3.number().describe("Number of columns"),
|
|
300
|
+
gap: z3.number().optional().describe("Gap between items"),
|
|
295
301
|
children: ExtensionComponentChildrenSchema.describe("Child components"),
|
|
296
302
|
style: ExtensionComponentStyleSchema.optional()
|
|
297
303
|
}).passthrough().describe("Grid layout component");
|
|
298
|
-
var DividerPropsSchema =
|
|
299
|
-
component:
|
|
304
|
+
var DividerPropsSchema = z3.object({
|
|
305
|
+
component: z3.literal("Divider"),
|
|
300
306
|
style: ExtensionComponentStyleSchema.optional()
|
|
301
307
|
}).passthrough().describe("Divider component");
|
|
302
|
-
var IconPropsSchema =
|
|
303
|
-
component:
|
|
304
|
-
name:
|
|
305
|
-
title:
|
|
308
|
+
var IconPropsSchema = z3.object({
|
|
309
|
+
component: z3.literal("Icon"),
|
|
310
|
+
name: z3.string().describe("Icon name"),
|
|
311
|
+
title: LocalizedStringSchema.optional().describe("Icon title"),
|
|
306
312
|
style: ExtensionComponentStyleSchema.optional()
|
|
307
313
|
}).passthrough().describe("Icon component");
|
|
308
|
-
var IconButtonTypeSchema =
|
|
309
|
-
var IconButtonPropsSchema =
|
|
310
|
-
component:
|
|
311
|
-
icon:
|
|
312
|
-
tooltip:
|
|
313
|
-
active:
|
|
314
|
-
disabled:
|
|
314
|
+
var IconButtonTypeSchema = z3.enum(["normal", "primary", "danger", "accent"]).describe("Button type");
|
|
315
|
+
var IconButtonPropsSchema = z3.object({
|
|
316
|
+
component: z3.literal("IconButton"),
|
|
317
|
+
icon: z3.string().describe("Icon name"),
|
|
318
|
+
tooltip: LocalizedStringSchema.describe("Tooltip text"),
|
|
319
|
+
active: z3.boolean().optional().describe("Whether the button is active"),
|
|
320
|
+
disabled: z3.boolean().optional().describe("Whether the button is disabled"),
|
|
315
321
|
type: IconButtonTypeSchema.optional().describe("Button style type"),
|
|
316
322
|
onClickAction: ExtensionActionRefSchema.describe("Action to call on click"),
|
|
317
323
|
style: ExtensionComponentStyleSchema.optional()
|
|
318
324
|
}).passthrough().describe("IconButton component");
|
|
319
|
-
var PanelActionSchema =
|
|
320
|
-
icon:
|
|
321
|
-
tooltip:
|
|
325
|
+
var PanelActionSchema = z3.object({
|
|
326
|
+
icon: z3.string().describe("Icon name"),
|
|
327
|
+
tooltip: LocalizedStringSchema.describe("Tooltip text"),
|
|
322
328
|
action: ExtensionActionRefSchema.describe("Action to call"),
|
|
323
329
|
type: IconButtonTypeSchema.optional().describe("Button style type")
|
|
324
330
|
}).describe("Panel action button");
|
|
325
|
-
var PanelPropsSchema =
|
|
326
|
-
component:
|
|
327
|
-
title:
|
|
328
|
-
description:
|
|
329
|
-
icon:
|
|
330
|
-
actions:
|
|
331
|
+
var PanelPropsSchema = z3.object({
|
|
332
|
+
component: z3.literal("Panel"),
|
|
333
|
+
title: LocalizedStringSchema.describe("Panel title"),
|
|
334
|
+
description: z3.union([LocalizedStringSchema, z3.array(LocalizedStringSchema)]).optional().describe("Description text"),
|
|
335
|
+
icon: z3.string().optional().describe("Icon name"),
|
|
336
|
+
actions: z3.array(PanelActionSchema).optional().describe("Action buttons"),
|
|
331
337
|
content: ExtensionComponentDataSchema.optional().describe("Panel content"),
|
|
332
338
|
style: ExtensionComponentStyleSchema.optional()
|
|
333
339
|
}).passthrough().describe("Panel component");
|
|
334
|
-
var TogglePropsSchema =
|
|
335
|
-
component:
|
|
336
|
-
label:
|
|
337
|
-
description:
|
|
338
|
-
checked:
|
|
339
|
-
disabled:
|
|
340
|
+
var TogglePropsSchema = z3.object({
|
|
341
|
+
component: z3.literal("Toggle"),
|
|
342
|
+
label: LocalizedStringSchema.optional().describe("Toggle label"),
|
|
343
|
+
description: LocalizedStringSchema.optional().describe("Description text"),
|
|
344
|
+
checked: z3.boolean().optional().describe("Whether the toggle is checked"),
|
|
345
|
+
disabled: z3.boolean().optional().describe("Whether the toggle is disabled"),
|
|
340
346
|
onChangeAction: ExtensionActionRefSchema.optional().describe("Action to call on change"),
|
|
341
347
|
style: ExtensionComponentStyleSchema.optional()
|
|
342
348
|
}).passthrough().describe("Toggle component");
|
|
343
|
-
var CollapsiblePropsSchema =
|
|
344
|
-
component:
|
|
345
|
-
title:
|
|
346
|
-
description:
|
|
347
|
-
icon:
|
|
348
|
-
defaultExpanded:
|
|
349
|
+
var CollapsiblePropsSchema = z3.object({
|
|
350
|
+
component: z3.literal("Collapsible"),
|
|
351
|
+
title: LocalizedStringSchema.describe("Title displayed in the header"),
|
|
352
|
+
description: z3.union([LocalizedStringSchema, z3.array(LocalizedStringSchema)]).optional().describe("Description text"),
|
|
353
|
+
icon: z3.string().optional().describe("Icon name"),
|
|
354
|
+
defaultExpanded: z3.boolean().optional().describe("Whether expanded by default"),
|
|
349
355
|
content: ExtensionComponentDataSchema.optional().describe("Content when expanded"),
|
|
350
356
|
style: ExtensionComponentStyleSchema.optional()
|
|
351
357
|
}).passthrough().describe("Collapsible component");
|
|
352
|
-
var PillVariantSchema =
|
|
353
|
-
var PillPropsSchema =
|
|
354
|
-
component:
|
|
355
|
-
text:
|
|
356
|
-
icon:
|
|
358
|
+
var PillVariantSchema = z3.enum(["default", "primary", "success", "warning", "danger", "accent"]).describe("Pill color variant");
|
|
359
|
+
var PillPropsSchema = z3.object({
|
|
360
|
+
component: z3.literal("Pill"),
|
|
361
|
+
text: LocalizedStringSchema.describe("Pill text"),
|
|
362
|
+
icon: z3.string().optional().describe("Icon name"),
|
|
357
363
|
variant: PillVariantSchema.optional().describe("Color variant"),
|
|
358
364
|
style: ExtensionComponentStyleSchema.optional()
|
|
359
365
|
}).passthrough().describe("Pill component");
|
|
360
|
-
var CheckboxPropsSchema =
|
|
361
|
-
component:
|
|
362
|
-
label:
|
|
363
|
-
checked:
|
|
364
|
-
disabled:
|
|
365
|
-
strikethrough:
|
|
366
|
+
var CheckboxPropsSchema = z3.object({
|
|
367
|
+
component: z3.literal("Checkbox"),
|
|
368
|
+
label: LocalizedStringSchema.describe("Checkbox label"),
|
|
369
|
+
checked: z3.boolean().optional().describe("Whether the checkbox is checked"),
|
|
370
|
+
disabled: z3.boolean().optional().describe("Whether the checkbox is disabled"),
|
|
371
|
+
strikethrough: z3.boolean().optional().describe("Strike through label when checked"),
|
|
366
372
|
onChangeAction: ExtensionActionRefSchema.optional().describe("Action to call on change"),
|
|
367
373
|
style: ExtensionComponentStyleSchema.optional()
|
|
368
374
|
}).passthrough().describe("Checkbox component");
|
|
369
|
-
var MarkdownPropsSchema =
|
|
370
|
-
component:
|
|
371
|
-
content:
|
|
375
|
+
var MarkdownPropsSchema = z3.object({
|
|
376
|
+
component: z3.literal("Markdown"),
|
|
377
|
+
content: LocalizedStringSchema.describe("Markdown content"),
|
|
372
378
|
style: ExtensionComponentStyleSchema.optional()
|
|
373
379
|
}).passthrough().describe("Markdown component");
|
|
374
|
-
var TextPreviewPropsSchema =
|
|
375
|
-
component:
|
|
376
|
-
content:
|
|
377
|
-
maxLines:
|
|
380
|
+
var TextPreviewPropsSchema = z3.object({
|
|
381
|
+
component: z3.literal("TextPreview"),
|
|
382
|
+
content: z3.string().describe("Markdown content"),
|
|
383
|
+
maxLines: z3.number().optional().describe("Max visible lines before truncating (default 5)"),
|
|
378
384
|
style: ExtensionComponentStyleSchema.optional()
|
|
379
385
|
}).passthrough().describe("TextPreview component");
|
|
380
|
-
var ModalPropsSchema =
|
|
381
|
-
component:
|
|
382
|
-
title:
|
|
383
|
-
open:
|
|
384
|
-
maxWidth:
|
|
386
|
+
var ModalPropsSchema = z3.object({
|
|
387
|
+
component: z3.literal("Modal"),
|
|
388
|
+
title: LocalizedStringSchema.describe("Modal title"),
|
|
389
|
+
open: z3.boolean().optional().describe("Whether the modal is open"),
|
|
390
|
+
maxWidth: z3.string().optional().describe("Max width of the modal"),
|
|
385
391
|
body: ExtensionComponentDataSchema.optional().describe("Modal body content"),
|
|
386
392
|
footer: ExtensionComponentDataSchema.optional().describe("Modal footer content"),
|
|
387
393
|
onCloseAction: ExtensionActionRefSchema.optional().describe("Action to call on close"),
|
|
388
394
|
style: ExtensionComponentStyleSchema.optional()
|
|
389
395
|
}).passthrough().describe("Modal component");
|
|
390
|
-
var ConditionalGroupPropsSchema =
|
|
391
|
-
component:
|
|
392
|
-
condition:
|
|
396
|
+
var ConditionalGroupPropsSchema = z3.object({
|
|
397
|
+
component: z3.literal("ConditionalGroup"),
|
|
398
|
+
condition: z3.string().describe("Condition expression to evaluate"),
|
|
393
399
|
children: ExtensionComponentChildrenSchema.describe("Children to render when condition is true"),
|
|
394
400
|
style: ExtensionComponentStyleSchema.optional()
|
|
395
401
|
}).passthrough().describe("ConditionalGroup component");
|
|
396
|
-
var FrameVariantSchema =
|
|
397
|
-
var FramePropsSchema =
|
|
398
|
-
component:
|
|
399
|
-
title:
|
|
400
|
-
icon:
|
|
401
|
-
collapsible:
|
|
402
|
-
defaultExpanded:
|
|
402
|
+
var FrameVariantSchema = z3.enum(["border", "solid"]).describe("Frame visual variant");
|
|
403
|
+
var FramePropsSchema = z3.object({
|
|
404
|
+
component: z3.literal("Frame"),
|
|
405
|
+
title: z3.union([LocalizedStringSchema, ExtensionComponentChildrenSchema]).optional().describe("Optional title (string or components)"),
|
|
406
|
+
icon: z3.string().optional().describe("Icon name"),
|
|
407
|
+
collapsible: z3.boolean().optional().describe("Whether content can be toggled"),
|
|
408
|
+
defaultExpanded: z3.boolean().optional().describe("Whether expanded by default"),
|
|
403
409
|
variant: FrameVariantSchema.optional().describe("Visual variant"),
|
|
404
410
|
children: ExtensionComponentChildrenSchema.describe("Child components"),
|
|
405
411
|
style: ExtensionComponentStyleSchema.optional()
|
|
406
412
|
}).passthrough().describe("Frame container component");
|
|
407
|
-
var ListPropsSchema =
|
|
408
|
-
component:
|
|
413
|
+
var ListPropsSchema = z3.object({
|
|
414
|
+
component: z3.literal("List"),
|
|
409
415
|
children: ExtensionComponentChildrenSchema.describe("Child components rendered as list items"),
|
|
410
416
|
style: ExtensionComponentStyleSchema.optional()
|
|
411
417
|
}).passthrough().describe("List component");
|
|
412
|
-
var WeatherConditionSchema =
|
|
418
|
+
var WeatherConditionSchema = z3.enum([
|
|
413
419
|
"clear",
|
|
414
420
|
"partly-cloudy",
|
|
415
421
|
"cloudy",
|
|
@@ -426,164 +432,164 @@ var WeatherConditionSchema = z2.enum([
|
|
|
426
432
|
"hail",
|
|
427
433
|
"windy"
|
|
428
434
|
]).describe("Weather condition");
|
|
429
|
-
var WeatherWindSchema =
|
|
430
|
-
speed:
|
|
431
|
-
unit:
|
|
432
|
-
direction:
|
|
433
|
-
gust:
|
|
435
|
+
var WeatherWindSchema = z3.object({
|
|
436
|
+
speed: z3.number().describe("Sustained wind speed"),
|
|
437
|
+
unit: z3.string().optional().describe("Unit written after the speed. Defaults to m/s"),
|
|
438
|
+
direction: z3.string().optional().describe("Compass direction, in the caller's own words"),
|
|
439
|
+
gust: z3.number().optional().describe("Gust speed, in the same unit")
|
|
434
440
|
}).passthrough().describe("Wind reading");
|
|
435
|
-
var WeatherNowPropsSchema =
|
|
436
|
-
component:
|
|
437
|
-
place:
|
|
441
|
+
var WeatherNowPropsSchema = z3.object({
|
|
442
|
+
component: z3.literal("WeatherNow"),
|
|
443
|
+
place: z3.string().describe("Where the reading is from"),
|
|
438
444
|
condition: WeatherConditionSchema,
|
|
439
|
-
conditionLabel:
|
|
440
|
-
temperature:
|
|
441
|
-
feelsLike:
|
|
442
|
-
unit:
|
|
445
|
+
conditionLabel: z3.string().optional().describe("The condition in the user's own language"),
|
|
446
|
+
temperature: z3.number().describe("Current temperature"),
|
|
447
|
+
feelsLike: z3.number().optional().describe("Apparent temperature"),
|
|
448
|
+
unit: z3.string().optional().describe("Written after every temperature. Defaults to \xB0"),
|
|
443
449
|
wind: WeatherWindSchema.optional(),
|
|
444
|
-
night:
|
|
445
|
-
summary:
|
|
450
|
+
night: z3.boolean().optional().describe("Draw the night variant of the icon"),
|
|
451
|
+
summary: z3.string().optional().describe("One line of context under the numbers"),
|
|
446
452
|
style: ExtensionComponentStyleSchema.optional()
|
|
447
453
|
}).passthrough().describe("Current weather component");
|
|
448
|
-
var WeatherForecastStepSchema =
|
|
449
|
-
label:
|
|
454
|
+
var WeatherForecastStepSchema = z3.object({
|
|
455
|
+
label: z3.string().describe("Short step label, e.g. 14 or Tors"),
|
|
450
456
|
condition: WeatherConditionSchema,
|
|
451
|
-
conditionLabel:
|
|
452
|
-
high:
|
|
453
|
-
low:
|
|
454
|
-
night:
|
|
455
|
-
precipitation:
|
|
456
|
-
current:
|
|
457
|
+
conditionLabel: z3.string().optional(),
|
|
458
|
+
high: z3.number().describe("The warmer temperature, or the only one"),
|
|
459
|
+
low: z3.number().optional().describe("The colder temperature"),
|
|
460
|
+
night: z3.boolean().optional(),
|
|
461
|
+
precipitation: z3.number().min(0).max(100).optional().describe("Chance of precipitation, 0-100"),
|
|
462
|
+
current: z3.boolean().optional().describe("The step the reader is at; drawn larger")
|
|
457
463
|
}).passthrough().describe("One forecast step");
|
|
458
|
-
var WeatherForecastPropsSchema =
|
|
459
|
-
component:
|
|
460
|
-
title:
|
|
461
|
-
icon:
|
|
462
|
-
unit:
|
|
463
|
-
steps:
|
|
464
|
+
var WeatherForecastPropsSchema = z3.object({
|
|
465
|
+
component: z3.literal("WeatherForecast"),
|
|
466
|
+
title: LocalizedStringSchema.optional().describe("Heading above the row"),
|
|
467
|
+
icon: z3.string().optional().describe("Icon shown to the left of the title"),
|
|
468
|
+
unit: z3.string().optional().describe("Written after every temperature. Defaults to \xB0"),
|
|
469
|
+
steps: z3.array(WeatherForecastStepSchema).min(1).describe("Steps, hourly or daily"),
|
|
464
470
|
style: ExtensionComponentStyleSchema.optional()
|
|
465
471
|
}).passthrough().describe("Weather forecast component");
|
|
466
|
-
var ChartKindSchema =
|
|
467
|
-
var ChartSeriesSchema =
|
|
468
|
-
name:
|
|
469
|
-
points:
|
|
472
|
+
var ChartKindSchema = z3.enum(["line", "bar", "area"]).describe("How the chart draws");
|
|
473
|
+
var ChartSeriesSchema = z3.object({
|
|
474
|
+
name: z3.string().optional().describe("Named in the legend"),
|
|
475
|
+
points: z3.array(z3.number().nullable()).describe("One value per label. null is a gap, drawn as one")
|
|
470
476
|
}).passthrough().describe("One chart series");
|
|
471
|
-
var ChartPropsSchema =
|
|
472
|
-
component:
|
|
477
|
+
var ChartPropsSchema = z3.object({
|
|
478
|
+
component: z3.literal("Chart"),
|
|
473
479
|
chart: ChartKindSchema.optional().describe("Defaults to line"),
|
|
474
|
-
series:
|
|
475
|
-
labels:
|
|
476
|
-
title:
|
|
477
|
-
icon:
|
|
478
|
-
unit:
|
|
479
|
-
zeroBaseline:
|
|
480
|
-
height:
|
|
480
|
+
series: z3.array(ChartSeriesSchema).min(1).max(8).describe("At most eight series"),
|
|
481
|
+
labels: z3.array(z3.string()).optional().describe("One per point, along the horizontal axis"),
|
|
482
|
+
title: LocalizedStringSchema.optional().describe("Heading above the plot"),
|
|
483
|
+
icon: z3.string().optional().describe("Icon shown to the left of the title"),
|
|
484
|
+
unit: z3.string().optional().describe("Written after every value"),
|
|
485
|
+
zeroBaseline: z3.boolean().optional().describe("Force the value axis to include zero"),
|
|
486
|
+
height: z3.number().min(4).max(24).optional().describe("Plot height in rem. Defaults to 9"),
|
|
481
487
|
style: ExtensionComponentStyleSchema.optional()
|
|
482
488
|
}).passthrough().describe("Chart component");
|
|
483
|
-
var StatTrendSchema =
|
|
484
|
-
var StatTilePropsSchema =
|
|
485
|
-
component:
|
|
486
|
-
label:
|
|
487
|
-
value:
|
|
488
|
-
unit:
|
|
489
|
-
caption:
|
|
490
|
-
icon:
|
|
489
|
+
var StatTrendSchema = z3.enum(["up", "down", "flat"]).describe("Direction of change");
|
|
490
|
+
var StatTilePropsSchema = z3.object({
|
|
491
|
+
component: z3.literal("StatTile"),
|
|
492
|
+
label: LocalizedStringSchema.describe("What the number is"),
|
|
493
|
+
value: z3.union([z3.string(), z3.number()]).describe("The number itself"),
|
|
494
|
+
unit: z3.string().optional().describe("Written after the value in smaller type"),
|
|
495
|
+
caption: LocalizedStringSchema.optional().describe("One quiet line under the number"),
|
|
496
|
+
icon: z3.string().optional().describe("Icon name"),
|
|
491
497
|
trend: StatTrendSchema.optional(),
|
|
492
|
-
trendLabel:
|
|
493
|
-
trendIsGood:
|
|
498
|
+
trendLabel: z3.string().optional().describe("The change in words"),
|
|
499
|
+
trendIsGood: z3.boolean().optional().describe("Whether up is the good direction. Defaults to true"),
|
|
494
500
|
style: ExtensionComponentStyleSchema.optional()
|
|
495
501
|
}).passthrough().describe("Single-number stat tile component");
|
|
496
|
-
var ProgressShapeSchema =
|
|
497
|
-
var ProgressColorSchema =
|
|
498
|
-
var ProgressBarPropsSchema =
|
|
499
|
-
component:
|
|
500
|
-
label:
|
|
501
|
-
value:
|
|
502
|
-
min:
|
|
503
|
-
max:
|
|
502
|
+
var ProgressShapeSchema = z3.enum(["bar", "circle"]).describe("Drawn as a rail or as a ring");
|
|
503
|
+
var ProgressColorSchema = z3.enum(["accent", "success", "warning", "danger", "info", "neutral"]).describe("One of the theme colours");
|
|
504
|
+
var ProgressBarPropsSchema = z3.object({
|
|
505
|
+
component: z3.literal("ProgressBar"),
|
|
506
|
+
label: LocalizedStringSchema.describe("What is being measured"),
|
|
507
|
+
value: z3.number().describe("Where the reading sits. Clamped to the range"),
|
|
508
|
+
min: z3.number().optional().describe("Bottom of the range. Defaults to 0"),
|
|
509
|
+
max: z3.number().optional().describe("Top of the range. Defaults to 100"),
|
|
504
510
|
shape: ProgressShapeSchema.optional().describe("Defaults to bar"),
|
|
505
511
|
color: ProgressColorSchema.optional().describe("Defaults to accent"),
|
|
506
|
-
unit:
|
|
507
|
-
valueLabel:
|
|
508
|
-
caption:
|
|
509
|
-
icon:
|
|
512
|
+
unit: z3.string().optional().describe("Written after the value"),
|
|
513
|
+
valueLabel: z3.string().optional().describe("The readout in words, replacing value and unit"),
|
|
514
|
+
caption: LocalizedStringSchema.optional().describe("One quiet line under the reading"),
|
|
515
|
+
icon: z3.string().optional().describe("Icon name"),
|
|
510
516
|
style: ExtensionComponentStyleSchema.optional()
|
|
511
517
|
}).passthrough().describe("Progress component");
|
|
512
|
-
var KeyValueRowSchema =
|
|
513
|
-
label:
|
|
514
|
-
value:
|
|
515
|
-
icon:
|
|
518
|
+
var KeyValueRowSchema = z3.object({
|
|
519
|
+
label: z3.string(),
|
|
520
|
+
value: z3.string(),
|
|
521
|
+
icon: z3.string().optional().describe("Icon name")
|
|
516
522
|
}).passthrough().describe("One key/value row");
|
|
517
|
-
var KeyValueListPropsSchema =
|
|
518
|
-
component:
|
|
519
|
-
rows:
|
|
523
|
+
var KeyValueListPropsSchema = z3.object({
|
|
524
|
+
component: z3.literal("KeyValueList"),
|
|
525
|
+
rows: z3.array(KeyValueRowSchema).min(1).describe("Facts in two aligned columns"),
|
|
520
526
|
style: ExtensionComponentStyleSchema.optional()
|
|
521
527
|
}).passthrough().describe("Key/value list component");
|
|
522
|
-
var TimelineVariantSchema =
|
|
523
|
-
var TimelineEntrySchema =
|
|
524
|
-
time:
|
|
525
|
-
title:
|
|
526
|
-
description:
|
|
527
|
-
icon:
|
|
528
|
-
duration:
|
|
529
|
-
badge:
|
|
530
|
-
current:
|
|
531
|
-
past:
|
|
528
|
+
var TimelineVariantSchema = z3.enum(["default", "accent", "success", "warning", "danger"]).describe("How much a timeline entry stands out");
|
|
529
|
+
var TimelineEntrySchema = z3.object({
|
|
530
|
+
time: z3.string().describe("When it happens, worded as it should be read"),
|
|
531
|
+
title: z3.string(),
|
|
532
|
+
description: z3.string().optional().describe("A line under the title"),
|
|
533
|
+
icon: z3.string().optional().describe("Icon name"),
|
|
534
|
+
duration: z3.string().optional().describe("How long it lasts, in words"),
|
|
535
|
+
badge: z3.string().optional().describe("Trailing badge"),
|
|
536
|
+
current: z3.boolean().optional().describe("The entry the reader is at"),
|
|
537
|
+
past: z3.boolean().optional().describe("Already behind us; drawn recessive"),
|
|
532
538
|
variant: TimelineVariantSchema.optional()
|
|
533
539
|
}).passthrough().describe("One timeline entry");
|
|
534
|
-
var TimelinePropsSchema =
|
|
535
|
-
component:
|
|
536
|
-
title:
|
|
537
|
-
icon:
|
|
538
|
-
entries:
|
|
540
|
+
var TimelinePropsSchema = z3.object({
|
|
541
|
+
component: z3.literal("Timeline"),
|
|
542
|
+
title: LocalizedStringSchema.optional().describe("Heading above the rail"),
|
|
543
|
+
icon: z3.string().optional().describe("Icon shown to the left of the title"),
|
|
544
|
+
entries: z3.array(TimelineEntrySchema).min(1).describe("Entries, in the order they happen"),
|
|
539
545
|
style: ExtensionComponentStyleSchema.optional()
|
|
540
546
|
}).passthrough().describe("Vertical timeline component");
|
|
541
|
-
var NoteVariantSchema =
|
|
542
|
-
var NotePropsSchema =
|
|
543
|
-
component:
|
|
544
|
-
title:
|
|
545
|
-
icon:
|
|
546
|
-
badge:
|
|
547
|
-
content:
|
|
548
|
-
footer:
|
|
547
|
+
var NoteVariantSchema = z3.enum(["default", "accent", "success", "warning", "danger"]).describe("How much a note stands out");
|
|
548
|
+
var NotePropsSchema = z3.object({
|
|
549
|
+
component: z3.literal("Note"),
|
|
550
|
+
title: LocalizedStringSchema.optional(),
|
|
551
|
+
icon: z3.string().optional().describe("Icon shown to the left of the title"),
|
|
552
|
+
badge: z3.string().optional().describe("Trailing badge next to the title"),
|
|
553
|
+
content: z3.string().describe("The body, as markdown"),
|
|
554
|
+
footer: z3.string().optional().describe("One quiet line at the bottom"),
|
|
549
555
|
variant: NoteVariantSchema.optional(),
|
|
550
556
|
style: ExtensionComponentStyleSchema.optional()
|
|
551
557
|
}).passthrough().describe("Titled block of prose component");
|
|
552
|
-
var CalendarEventStatusSchema =
|
|
553
|
-
var CalendarEventPropsSchema =
|
|
554
|
-
component:
|
|
555
|
-
title:
|
|
556
|
-
start:
|
|
557
|
-
end:
|
|
558
|
-
allDay:
|
|
559
|
-
location:
|
|
560
|
-
organizer:
|
|
561
|
-
attendees:
|
|
562
|
-
calendar:
|
|
558
|
+
var CalendarEventStatusSchema = z3.enum(["confirmed", "tentative", "cancelled"]).describe("Whether an event is going ahead");
|
|
559
|
+
var CalendarEventPropsSchema = z3.object({
|
|
560
|
+
component: z3.literal("CalendarEvent"),
|
|
561
|
+
title: z3.string(),
|
|
562
|
+
start: z3.string().describe("ISO 8601 with an offset"),
|
|
563
|
+
end: z3.string().optional().describe("ISO 8601 with an offset"),
|
|
564
|
+
allDay: z3.boolean().optional(),
|
|
565
|
+
location: z3.string().optional(),
|
|
566
|
+
organizer: z3.string().optional(),
|
|
567
|
+
attendees: z3.array(z3.string()).optional(),
|
|
568
|
+
calendar: z3.string().optional().describe("Which calendar it sits in; shown as a badge"),
|
|
563
569
|
status: CalendarEventStatusSchema.optional(),
|
|
564
|
-
recurrence:
|
|
565
|
-
notes:
|
|
570
|
+
recurrence: z3.string().optional().describe("How it repeats, in words"),
|
|
571
|
+
notes: z3.string().optional(),
|
|
566
572
|
style: ExtensionComponentStyleSchema.optional()
|
|
567
573
|
}).passthrough().describe("Single calendar event component");
|
|
568
|
-
var AgendaEventSchema =
|
|
569
|
-
id:
|
|
570
|
-
title:
|
|
571
|
-
start:
|
|
572
|
-
end:
|
|
573
|
-
allDay:
|
|
574
|
-
detail:
|
|
574
|
+
var AgendaEventSchema = z3.object({
|
|
575
|
+
id: z3.string().optional().describe("Handed back to onEventClickAction as $event.id"),
|
|
576
|
+
title: z3.string(),
|
|
577
|
+
start: z3.string().describe("ISO 8601 with an offset"),
|
|
578
|
+
end: z3.string().optional().describe("ISO 8601 with an offset"),
|
|
579
|
+
allDay: z3.boolean().optional(),
|
|
580
|
+
detail: z3.string().optional().describe("One quiet line under the title")
|
|
575
581
|
}).passthrough().describe("One agenda event");
|
|
576
|
-
var AgendaDaySchema =
|
|
577
|
-
label:
|
|
578
|
-
date:
|
|
579
|
-
events:
|
|
582
|
+
var AgendaDaySchema = z3.object({
|
|
583
|
+
label: z3.string().describe("The day heading"),
|
|
584
|
+
date: z3.string().optional().describe("A quieter line beside the heading"),
|
|
585
|
+
events: z3.array(AgendaEventSchema)
|
|
580
586
|
}).passthrough().describe("One agenda day");
|
|
581
|
-
var AgendaPropsSchema =
|
|
582
|
-
component:
|
|
583
|
-
title:
|
|
584
|
-
icon:
|
|
585
|
-
days:
|
|
586
|
-
warnOverlaps:
|
|
587
|
+
var AgendaPropsSchema = z3.object({
|
|
588
|
+
component: z3.literal("Agenda"),
|
|
589
|
+
title: LocalizedStringSchema.optional(),
|
|
590
|
+
icon: z3.string().optional().describe("Icon shown to the left of the title"),
|
|
591
|
+
days: z3.array(AgendaDaySchema),
|
|
592
|
+
warnOverlaps: z3.boolean().optional().describe("Word clashes between events"),
|
|
587
593
|
onEventClickAction: ExtensionActionRefSchema.optional().describe(
|
|
588
594
|
"Action to call when an event is clicked, with the event as $event"
|
|
589
595
|
),
|
|
@@ -591,365 +597,369 @@ var AgendaPropsSchema = z2.object({
|
|
|
591
597
|
}).passthrough().describe("Schedule component that tracks the current time");
|
|
592
598
|
|
|
593
599
|
// src/schemas/contributions.schema.ts
|
|
594
|
-
var
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
secondaryKey: z3.string().optional().describe("Key for secondary label")
|
|
600
|
+
var ToolSettingsListMappingSchema = z4.object({
|
|
601
|
+
itemsKey: z4.string().describe("Key for items array in tool result data"),
|
|
602
|
+
countKey: z4.string().optional().describe("Key for total count"),
|
|
603
|
+
idKey: z4.string().describe("Key for item ID"),
|
|
604
|
+
labelKey: z4.string().describe("Key for item label"),
|
|
605
|
+
descriptionKey: z4.string().optional().describe("Key for item description"),
|
|
606
|
+
secondaryKey: z4.string().optional().describe("Key for secondary label")
|
|
602
607
|
}).describe("Mapping from tool list data to UI fields");
|
|
603
|
-
var ToolSettingsActionDataSourceSchema =
|
|
604
|
-
action:
|
|
605
|
-
params:
|
|
606
|
-
refreshOn:
|
|
608
|
+
var ToolSettingsActionDataSourceSchema = z4.object({
|
|
609
|
+
action: z4.string().describe("Action ID to call for fetching data"),
|
|
610
|
+
params: z4.record(z4.unknown()).optional().describe("Parameters to pass to the action"),
|
|
611
|
+
refreshOn: z4.array(z4.string()).optional().describe("Event names that trigger refresh")
|
|
607
612
|
}).describe("Action-based data source");
|
|
608
|
-
var ToolSettingsListGroupBySchema =
|
|
609
|
-
key:
|
|
610
|
-
order:
|
|
611
|
-
labels:
|
|
613
|
+
var ToolSettingsListGroupBySchema = z4.object({
|
|
614
|
+
key: z4.string().describe("Key in each item used to determine group membership"),
|
|
615
|
+
order: z4.array(z4.string()).optional().describe("Explicit ordering of group values; unlisted groups appear afterwards alphabetically"),
|
|
616
|
+
labels: z4.record(LocalizedStringSchema).optional().describe("Human-friendly labels per group value (rendered as section headers)")
|
|
612
617
|
}).describe("List view grouping configuration");
|
|
613
|
-
var ToolSettingsListViewSchema =
|
|
614
|
-
kind:
|
|
615
|
-
listToolId:
|
|
616
|
-
getToolId:
|
|
617
|
-
upsertToolId:
|
|
618
|
-
deleteToolId:
|
|
618
|
+
var ToolSettingsListViewSchema = z4.object({
|
|
619
|
+
kind: z4.literal("list").describe("View kind"),
|
|
620
|
+
listToolId: z4.string().describe("Tool ID for listing items"),
|
|
621
|
+
getToolId: z4.string().optional().describe("Tool ID for fetching details"),
|
|
622
|
+
upsertToolId: z4.string().optional().describe("Tool ID for creating/updating items"),
|
|
623
|
+
deleteToolId: z4.string().optional().describe("Tool ID for deleting items"),
|
|
619
624
|
mapping: ToolSettingsListMappingSchema.describe("Mapping from tool data to UI"),
|
|
620
|
-
searchParam:
|
|
621
|
-
limitParam:
|
|
622
|
-
idParam:
|
|
623
|
-
listParams:
|
|
624
|
-
editView:
|
|
625
|
+
searchParam: z4.string().optional().describe("Param name for search query"),
|
|
626
|
+
limitParam: z4.string().optional().describe("Param name for limit"),
|
|
627
|
+
idParam: z4.string().optional().describe("Param name for get/delete ID"),
|
|
628
|
+
listParams: z4.record(z4.unknown()).optional().describe("Static params for list tool"),
|
|
629
|
+
editView: z4.object({
|
|
625
630
|
content: ExtensionComponentDataSchema.describe("Root component for the create/edit modal")
|
|
626
631
|
}).optional().describe("Component-tree create/edit form bound to $item.<key>"),
|
|
627
632
|
groupBy: ToolSettingsListGroupBySchema.optional().describe(
|
|
628
633
|
"Optional grouping configuration; when set, items are visually grouped by this field"
|
|
629
634
|
)
|
|
630
635
|
}).describe("List view backed by tools");
|
|
631
|
-
var ToolSettingsComponentViewSchema =
|
|
632
|
-
kind:
|
|
633
|
-
data:
|
|
636
|
+
var ToolSettingsComponentViewSchema = z4.object({
|
|
637
|
+
kind: z4.literal("component").describe("View kind"),
|
|
638
|
+
data: z4.record(ToolSettingsActionDataSourceSchema).optional().describe("Data sources"),
|
|
634
639
|
content: ExtensionComponentDataSchema.describe("Root component to render")
|
|
635
640
|
}).describe("Component-based tool settings view");
|
|
636
|
-
var ToolSettingsViewSchema =
|
|
637
|
-
var ToolSettingsViewDefinitionSchema =
|
|
638
|
-
id:
|
|
639
|
-
title:
|
|
640
|
-
description:
|
|
641
|
+
var ToolSettingsViewSchema = z4.union([ToolSettingsListViewSchema, ToolSettingsComponentViewSchema]).describe("Tool settings view");
|
|
642
|
+
var ToolSettingsViewDefinitionSchema = z4.object({
|
|
643
|
+
id: z4.string().describe("Unique view ID within the extension"),
|
|
644
|
+
title: LocalizedStringSchema.describe("Display title"),
|
|
645
|
+
description: LocalizedStringSchema.optional().describe("Help text"),
|
|
646
|
+
// A string rather than the known topics: one this host does not know yet must not stop
|
|
647
|
+
// the extension installing, it only lands on the extension's own page.
|
|
648
|
+
topic: z4.string().optional().describe(
|
|
649
|
+
"What the view is about, which decides where Stina shows it: accounts, notifications, personal or tracking. Without one, or with one Stina does not know, the view is shown on the extension's own page."
|
|
650
|
+
),
|
|
641
651
|
view: ToolSettingsViewSchema.describe("View configuration")
|
|
642
652
|
}).describe("Tool settings view definition");
|
|
643
|
-
var PanelActionDataSourceSchema =
|
|
644
|
-
action:
|
|
645
|
-
params:
|
|
646
|
-
refreshOn:
|
|
653
|
+
var PanelActionDataSourceSchema = z4.object({
|
|
654
|
+
action: z4.string().describe("Action ID to call for fetching data"),
|
|
655
|
+
params: z4.record(z4.unknown()).optional().describe("Parameters to pass to the action"),
|
|
656
|
+
refreshOn: z4.array(z4.string()).optional().describe("Event names that trigger refresh")
|
|
647
657
|
}).describe("Panel data source");
|
|
648
|
-
var PanelComponentViewSchema =
|
|
649
|
-
kind:
|
|
650
|
-
data:
|
|
658
|
+
var PanelComponentViewSchema = z4.object({
|
|
659
|
+
kind: z4.literal("component").describe("View kind"),
|
|
660
|
+
data: z4.record(PanelActionDataSourceSchema).optional().describe("Data sources"),
|
|
651
661
|
content: ExtensionComponentDataSchema.describe("Root component to render")
|
|
652
662
|
}).describe("Component-based panel view");
|
|
653
|
-
var PanelUnknownViewSchema =
|
|
654
|
-
kind:
|
|
663
|
+
var PanelUnknownViewSchema = z4.object({
|
|
664
|
+
kind: z4.string().describe("View kind")
|
|
655
665
|
}).passthrough().describe("Unknown panel view");
|
|
656
|
-
var PanelViewSchema =
|
|
657
|
-
var PanelDefinitionSchema =
|
|
658
|
-
id:
|
|
659
|
-
title:
|
|
660
|
-
icon:
|
|
666
|
+
var PanelViewSchema = z4.union([PanelComponentViewSchema, PanelUnknownViewSchema]).describe("Panel view");
|
|
667
|
+
var PanelDefinitionSchema = z4.object({
|
|
668
|
+
id: z4.string().describe("Unique panel ID within the extension"),
|
|
669
|
+
title: LocalizedStringSchema.describe("Display title"),
|
|
670
|
+
icon: z4.string().optional().describe("Icon name (from huge-icons)"),
|
|
661
671
|
view: PanelViewSchema.describe("Panel view schema")
|
|
662
672
|
}).describe("Panel definition");
|
|
663
|
-
var StatusCardDefinitionSchema =
|
|
664
|
-
id:
|
|
665
|
-
title:
|
|
666
|
-
icon:
|
|
667
|
-
size:
|
|
673
|
+
var StatusCardDefinitionSchema = z4.object({
|
|
674
|
+
id: z4.string().describe("Unique card ID within the extension"),
|
|
675
|
+
title: LocalizedStringSchema.describe("What it is called where the user picks it"),
|
|
676
|
+
icon: z4.string().optional().describe("Icon name (from huge-icons)"),
|
|
677
|
+
size: z4.enum(["line", "block"]).describe("How much room it may take: one row, or up to three"),
|
|
668
678
|
view: PanelComponentViewSchema.describe("What it draws, and where the data comes from")
|
|
669
679
|
}).describe("Status card definition");
|
|
670
|
-
var ProviderConfigViewSchema =
|
|
680
|
+
var ProviderConfigViewSchema = z4.object({
|
|
671
681
|
content: ExtensionComponentDataSchema.describe("Root component to render")
|
|
672
682
|
}).describe("Provider configuration view (component tree)");
|
|
673
|
-
var ProviderDefinitionSchema =
|
|
674
|
-
id:
|
|
675
|
-
name:
|
|
676
|
-
description:
|
|
677
|
-
suggestedDefaultModel:
|
|
678
|
-
defaultSettings:
|
|
683
|
+
var ProviderDefinitionSchema = z4.object({
|
|
684
|
+
id: z4.string().describe("Provider ID"),
|
|
685
|
+
name: z4.string().describe("Display name"),
|
|
686
|
+
description: z4.string().optional().describe("Description"),
|
|
687
|
+
suggestedDefaultModel: z4.string().optional().describe("Suggested default model"),
|
|
688
|
+
defaultSettings: z4.record(z4.unknown()).optional().describe("Default settings"),
|
|
679
689
|
configView: ProviderConfigViewSchema.optional().describe("Component-tree configuration view")
|
|
680
690
|
}).describe("Provider definition");
|
|
681
|
-
var ToolDefinitionSchema =
|
|
682
|
-
id:
|
|
691
|
+
var ToolDefinitionSchema = z4.object({
|
|
692
|
+
id: z4.string().describe("Tool ID"),
|
|
683
693
|
name: LocalizedStringSchema.describe("Display name"),
|
|
684
694
|
description: LocalizedStringSchema.describe("Description for Stina"),
|
|
685
|
-
parameters:
|
|
686
|
-
requiresConfirmation:
|
|
695
|
+
parameters: z4.record(z4.unknown()).optional().describe("Parameter schema (JSON Schema)"),
|
|
696
|
+
requiresConfirmation: z4.boolean().optional().describe("Whether this tool requires user confirmation before execution (default: true)"),
|
|
687
697
|
confirmationPrompt: LocalizedStringSchema.optional().describe("Custom confirmation prompt")
|
|
688
698
|
}).describe("Tool definition");
|
|
689
|
-
var CommandDefinitionSchema =
|
|
690
|
-
id:
|
|
691
|
-
name:
|
|
692
|
-
description:
|
|
699
|
+
var CommandDefinitionSchema = z4.object({
|
|
700
|
+
id: z4.string().describe('Command ID (e.g., "weather" for /weather)'),
|
|
701
|
+
name: z4.string().describe("Display name"),
|
|
702
|
+
description: z4.string().describe("Description")
|
|
693
703
|
}).describe("Command definition");
|
|
694
|
-
var PromptSectionSchema =
|
|
695
|
-
var PromptContributionSchema =
|
|
696
|
-
id:
|
|
697
|
-
title:
|
|
704
|
+
var PromptSectionSchema = z4.enum(["system", "behavior", "tools"]).describe("Prompt section placement");
|
|
705
|
+
var PromptContributionSchema = z4.object({
|
|
706
|
+
id: z4.string().describe("Unique ID within the extension"),
|
|
707
|
+
title: z4.string().optional().describe("Optional title for the prompt chunk"),
|
|
698
708
|
section: PromptSectionSchema.optional().describe("Prompt section placement"),
|
|
699
|
-
text:
|
|
700
|
-
i18n:
|
|
701
|
-
order:
|
|
709
|
+
text: z4.string().optional().describe("Plain text prompt content"),
|
|
710
|
+
i18n: z4.record(z4.string()).optional().describe("Localized prompt content"),
|
|
711
|
+
order: z4.number().optional().describe("Ordering hint (lower comes first)")
|
|
702
712
|
}).describe("Prompt contribution");
|
|
703
|
-
var StorageCollectionConfigSchema =
|
|
704
|
-
indexes:
|
|
713
|
+
var StorageCollectionConfigSchema = z4.object({
|
|
714
|
+
indexes: z4.array(z4.string()).optional().describe("Fields to index for fast queries")
|
|
705
715
|
}).describe("Collection configuration");
|
|
706
|
-
var StorageContributionsSchema =
|
|
707
|
-
collections:
|
|
716
|
+
var StorageContributionsSchema = z4.object({
|
|
717
|
+
collections: z4.record(StorageCollectionConfigSchema).describe("Collection definitions")
|
|
708
718
|
}).describe("Storage contributions");
|
|
709
719
|
var GRAPH_SCOPE_PATTERN = /^[A-Za-z]+(\.[A-Za-z]+)+$/;
|
|
710
720
|
var HOST_ACCOUNT_SCOPES = ["offline_access", "User.Read", "openid", "profile", "email"];
|
|
711
|
-
var AccountProviderSchema =
|
|
712
|
-
var AccountContributionSchema =
|
|
721
|
+
var AccountProviderSchema = z4.enum(["microsoft"]).describe("External account provider");
|
|
722
|
+
var AccountContributionSchema = z4.object({
|
|
713
723
|
provider: AccountProviderSchema,
|
|
714
|
-
scopes:
|
|
715
|
-
|
|
724
|
+
scopes: z4.array(
|
|
725
|
+
z4.string().regex(GRAPH_SCOPE_PATTERN, 'Must be a Microsoft Graph permission name, such as "Mail.Read"').refine(
|
|
716
726
|
(scope) => !HOST_ACCOUNT_SCOPES.some((hostScope) => hostScope.toLowerCase() === scope.toLowerCase()),
|
|
717
727
|
{ message: "Requested by the host already; leave it out" }
|
|
718
728
|
)
|
|
719
729
|
).min(1).describe("Microsoft Graph delegated permissions"),
|
|
720
730
|
reason: LocalizedStringSchema.optional().describe("Why the extension needs them")
|
|
721
731
|
}).describe("An external account the extension works through");
|
|
722
|
-
var ExtensionContributionsSchema =
|
|
723
|
-
toolSettings:
|
|
724
|
-
panels:
|
|
725
|
-
statusCards:
|
|
726
|
-
providers:
|
|
727
|
-
tools:
|
|
728
|
-
commands:
|
|
729
|
-
prompts:
|
|
732
|
+
var ExtensionContributionsSchema = z4.object({
|
|
733
|
+
toolSettings: z4.array(ToolSettingsViewDefinitionSchema).optional().describe("Tool settings views"),
|
|
734
|
+
panels: z4.array(PanelDefinitionSchema).optional().describe("Right panel contributions"),
|
|
735
|
+
statusCards: z4.array(StatusCardDefinitionSchema).optional().describe("Cards for the strip above the conversation list"),
|
|
736
|
+
providers: z4.array(ProviderDefinitionSchema).optional().describe("AI providers"),
|
|
737
|
+
tools: z4.array(ToolDefinitionSchema).optional().describe("Tools for Stina to use"),
|
|
738
|
+
commands: z4.array(CommandDefinitionSchema).optional().describe("Slash commands"),
|
|
739
|
+
prompts: z4.array(PromptContributionSchema).optional().describe("Prompt contributions"),
|
|
730
740
|
storage: StorageContributionsSchema.optional().describe("Storage collection declarations"),
|
|
731
|
-
accounts:
|
|
741
|
+
accounts: z4.array(AccountContributionSchema).optional().describe("External accounts the extension works through, signed in once in Stina's settings")
|
|
732
742
|
}).describe("What an extension can contribute to Stina");
|
|
733
743
|
|
|
734
744
|
// src/schemas/manifest.schema.ts
|
|
735
|
-
var PlatformSchema =
|
|
736
|
-
var AuthorSchema =
|
|
737
|
-
name:
|
|
738
|
-
url:
|
|
745
|
+
var PlatformSchema = z5.enum(["web", "electron", "tui"]).describe("Supported platform");
|
|
746
|
+
var AuthorSchema = z5.object({
|
|
747
|
+
name: z5.string().min(1).describe("Author name"),
|
|
748
|
+
url: z5.string().url().optional().describe("Author URL")
|
|
739
749
|
}).describe("Author information");
|
|
740
|
-
var EnginesSchema =
|
|
741
|
-
stina:
|
|
750
|
+
var EnginesSchema = z5.object({
|
|
751
|
+
stina: z5.string().describe("Minimum Stina version required")
|
|
742
752
|
}).describe("Engine requirements");
|
|
743
|
-
var ExtensionManifestSchema =
|
|
744
|
-
id:
|
|
745
|
-
name:
|
|
746
|
-
version:
|
|
747
|
-
description:
|
|
753
|
+
var ExtensionManifestSchema = z5.object({
|
|
754
|
+
id: z5.string().regex(/^[a-z0-9-]+$/, "ID must be lowercase alphanumeric with hyphens").describe('Unique identifier (e.g., "ollama-provider")'),
|
|
755
|
+
name: z5.string().min(1).describe("Human-readable name"),
|
|
756
|
+
version: z5.string().regex(/^\d+\.\d+\.\d+/, 'Must be semver format (e.g., "1.0.0")').describe("Version string (semver)"),
|
|
757
|
+
description: z5.string().min(1).describe("Short description"),
|
|
748
758
|
// Optional icon (Hugeicons name) used as the default icon for proactive
|
|
749
759
|
// conversation list entries this extension triggers. Kept optional so the
|
|
750
760
|
// field is preserved (not stripped) when a manifest is parsed at load time.
|
|
751
|
-
icon:
|
|
761
|
+
icon: z5.string().optional().describe("Icon (Hugeicons name) representing the extension"),
|
|
752
762
|
author: AuthorSchema.describe("Author information"),
|
|
753
|
-
repository:
|
|
754
|
-
license:
|
|
763
|
+
repository: z5.string().url().optional().describe("Repository URL"),
|
|
764
|
+
license: z5.string().optional().describe("License identifier"),
|
|
755
765
|
engines: EnginesSchema.optional().describe("Minimum Stina version required"),
|
|
756
|
-
platforms:
|
|
757
|
-
main:
|
|
758
|
-
permissions:
|
|
766
|
+
platforms: z5.array(PlatformSchema).optional().describe("Supported platforms"),
|
|
767
|
+
main: z5.string().describe("Entry point file (relative to extension root)"),
|
|
768
|
+
permissions: z5.array(PermissionSchema).describe("Required permissions"),
|
|
759
769
|
contributes: ExtensionContributionsSchema.optional().describe("What the extension contributes")
|
|
760
770
|
}).describe("Extension manifest format");
|
|
761
771
|
|
|
762
772
|
// src/schemas/card.schema.ts
|
|
763
|
-
import { z as
|
|
773
|
+
import { z as z6 } from "zod";
|
|
764
774
|
var style = ExtensionComponentStyleSchema.optional();
|
|
765
|
-
var children =
|
|
766
|
-
() =>
|
|
775
|
+
var children = z6.lazy(
|
|
776
|
+
() => z6.array(ChatCardComponentSchema).max(40)
|
|
767
777
|
);
|
|
768
|
-
var VerticalStackCardSchema =
|
|
769
|
-
component:
|
|
778
|
+
var VerticalStackCardSchema = z6.object({
|
|
779
|
+
component: z6.literal("VerticalStack"),
|
|
770
780
|
children,
|
|
771
781
|
style
|
|
772
782
|
}).strict();
|
|
773
|
-
var HorizontalStackCardSchema =
|
|
774
|
-
component:
|
|
783
|
+
var HorizontalStackCardSchema = z6.object({
|
|
784
|
+
component: z6.literal("HorizontalStack"),
|
|
775
785
|
children,
|
|
776
786
|
style
|
|
777
787
|
}).strict();
|
|
778
|
-
var GridCardSchema =
|
|
779
|
-
component:
|
|
780
|
-
columns:
|
|
788
|
+
var GridCardSchema = z6.object({
|
|
789
|
+
component: z6.literal("Grid"),
|
|
790
|
+
columns: z6.number().min(1).max(6),
|
|
781
791
|
children,
|
|
782
792
|
style
|
|
783
793
|
}).strict();
|
|
784
|
-
var FrameCardSchema =
|
|
785
|
-
component:
|
|
794
|
+
var FrameCardSchema = z6.object({
|
|
795
|
+
component: z6.literal("Frame"),
|
|
786
796
|
// Only the string form: the components form of a title is for panels that
|
|
787
797
|
// put controls in their header, which a card has no business doing.
|
|
788
|
-
title:
|
|
789
|
-
collapsible:
|
|
790
|
-
defaultExpanded:
|
|
798
|
+
title: LocalizedStringSchema.optional(),
|
|
799
|
+
collapsible: z6.boolean().optional(),
|
|
800
|
+
defaultExpanded: z6.boolean().optional(),
|
|
791
801
|
variant: FrameVariantSchema.optional(),
|
|
792
802
|
children,
|
|
793
803
|
style
|
|
794
804
|
}).strict();
|
|
795
|
-
var ListCardSchema =
|
|
796
|
-
var DividerCardSchema =
|
|
797
|
-
var HeaderCardSchema =
|
|
798
|
-
component:
|
|
799
|
-
level:
|
|
800
|
-
title:
|
|
801
|
-
description:
|
|
802
|
-
icon:
|
|
805
|
+
var ListCardSchema = z6.object({ component: z6.literal("List"), children, style }).strict();
|
|
806
|
+
var DividerCardSchema = z6.object({ component: z6.literal("Divider"), style }).strict();
|
|
807
|
+
var HeaderCardSchema = z6.object({
|
|
808
|
+
component: z6.literal("Header"),
|
|
809
|
+
level: z6.number().min(1).max(6),
|
|
810
|
+
title: LocalizedStringSchema,
|
|
811
|
+
description: z6.union([LocalizedStringSchema, z6.array(LocalizedStringSchema)]).optional(),
|
|
812
|
+
icon: z6.string().optional(),
|
|
803
813
|
style
|
|
804
814
|
}).strict();
|
|
805
|
-
var LabelCardSchema =
|
|
806
|
-
var ParagraphCardSchema =
|
|
807
|
-
var MarkdownCardSchema =
|
|
808
|
-
var IconCardSchema =
|
|
809
|
-
component:
|
|
810
|
-
name:
|
|
811
|
-
title:
|
|
815
|
+
var LabelCardSchema = z6.object({ component: z6.literal("Label"), text: z6.string(), style }).strict();
|
|
816
|
+
var ParagraphCardSchema = z6.object({ component: z6.literal("Paragraph"), text: z6.string(), style }).strict();
|
|
817
|
+
var MarkdownCardSchema = z6.object({ component: z6.literal("Markdown"), content: z6.string(), style }).strict();
|
|
818
|
+
var IconCardSchema = z6.object({
|
|
819
|
+
component: z6.literal("Icon"),
|
|
820
|
+
name: z6.string(),
|
|
821
|
+
title: LocalizedStringSchema.optional(),
|
|
812
822
|
style
|
|
813
823
|
}).strict();
|
|
814
|
-
var PillCardSchema =
|
|
815
|
-
component:
|
|
816
|
-
text:
|
|
817
|
-
icon:
|
|
824
|
+
var PillCardSchema = z6.object({
|
|
825
|
+
component: z6.literal("Pill"),
|
|
826
|
+
text: LocalizedStringSchema,
|
|
827
|
+
icon: z6.string().optional(),
|
|
818
828
|
variant: PillVariantSchema.optional(),
|
|
819
829
|
style
|
|
820
830
|
}).strict();
|
|
821
|
-
var WeatherNowCardSchema =
|
|
822
|
-
component:
|
|
823
|
-
place:
|
|
831
|
+
var WeatherNowCardSchema = z6.object({
|
|
832
|
+
component: z6.literal("WeatherNow"),
|
|
833
|
+
place: z6.string(),
|
|
824
834
|
condition: WeatherConditionSchema,
|
|
825
|
-
conditionLabel:
|
|
826
|
-
temperature:
|
|
827
|
-
feelsLike:
|
|
828
|
-
unit:
|
|
835
|
+
conditionLabel: z6.string().optional(),
|
|
836
|
+
temperature: z6.number(),
|
|
837
|
+
feelsLike: z6.number().optional(),
|
|
838
|
+
unit: z6.string().optional(),
|
|
829
839
|
wind: WeatherWindSchema.optional(),
|
|
830
|
-
night:
|
|
831
|
-
summary:
|
|
840
|
+
night: z6.boolean().optional(),
|
|
841
|
+
summary: z6.string().optional(),
|
|
832
842
|
style
|
|
833
843
|
}).strict();
|
|
834
|
-
var WeatherForecastCardSchema =
|
|
835
|
-
component:
|
|
836
|
-
title:
|
|
837
|
-
icon:
|
|
838
|
-
unit:
|
|
839
|
-
steps:
|
|
840
|
-
|
|
841
|
-
label:
|
|
844
|
+
var WeatherForecastCardSchema = z6.object({
|
|
845
|
+
component: z6.literal("WeatherForecast"),
|
|
846
|
+
title: LocalizedStringSchema.optional(),
|
|
847
|
+
icon: z6.string().optional(),
|
|
848
|
+
unit: z6.string().optional(),
|
|
849
|
+
steps: z6.array(
|
|
850
|
+
z6.object({
|
|
851
|
+
label: z6.string(),
|
|
842
852
|
condition: WeatherConditionSchema,
|
|
843
|
-
conditionLabel:
|
|
844
|
-
high:
|
|
845
|
-
low:
|
|
846
|
-
night:
|
|
847
|
-
precipitation:
|
|
848
|
-
current:
|
|
853
|
+
conditionLabel: z6.string().optional(),
|
|
854
|
+
high: z6.number(),
|
|
855
|
+
low: z6.number().optional(),
|
|
856
|
+
night: z6.boolean().optional(),
|
|
857
|
+
precipitation: z6.number().min(0).max(100).optional(),
|
|
858
|
+
current: z6.boolean().optional()
|
|
849
859
|
}).strict()
|
|
850
860
|
).min(1).max(24),
|
|
851
861
|
style
|
|
852
862
|
}).strict();
|
|
853
|
-
var ChartCardSchema =
|
|
854
|
-
component:
|
|
863
|
+
var ChartCardSchema = z6.object({
|
|
864
|
+
component: z6.literal("Chart"),
|
|
855
865
|
chart: ChartKindSchema.optional(),
|
|
856
|
-
series:
|
|
857
|
-
|
|
858
|
-
name:
|
|
859
|
-
points:
|
|
866
|
+
series: z6.array(
|
|
867
|
+
z6.object({
|
|
868
|
+
name: z6.string().optional(),
|
|
869
|
+
points: z6.array(z6.number().nullable()).min(1).max(200)
|
|
860
870
|
}).strict()
|
|
861
871
|
).min(1).max(8),
|
|
862
|
-
labels:
|
|
863
|
-
title:
|
|
864
|
-
icon:
|
|
865
|
-
unit:
|
|
866
|
-
zeroBaseline:
|
|
867
|
-
height:
|
|
872
|
+
labels: z6.array(z6.string()).max(200).optional(),
|
|
873
|
+
title: LocalizedStringSchema.optional(),
|
|
874
|
+
icon: z6.string().optional(),
|
|
875
|
+
unit: z6.string().optional(),
|
|
876
|
+
zeroBaseline: z6.boolean().optional(),
|
|
877
|
+
height: z6.number().min(4).max(24).optional(),
|
|
868
878
|
style
|
|
869
879
|
}).strict();
|
|
870
|
-
var StatTileCardSchema =
|
|
871
|
-
component:
|
|
872
|
-
label:
|
|
873
|
-
value:
|
|
874
|
-
unit:
|
|
875
|
-
caption:
|
|
876
|
-
icon:
|
|
880
|
+
var StatTileCardSchema = z6.object({
|
|
881
|
+
component: z6.literal("StatTile"),
|
|
882
|
+
label: LocalizedStringSchema,
|
|
883
|
+
value: z6.union([z6.string(), z6.number()]),
|
|
884
|
+
unit: z6.string().optional(),
|
|
885
|
+
caption: LocalizedStringSchema.optional(),
|
|
886
|
+
icon: z6.string().optional(),
|
|
877
887
|
trend: StatTrendSchema.optional(),
|
|
878
|
-
trendLabel:
|
|
879
|
-
trendIsGood:
|
|
888
|
+
trendLabel: z6.string().optional(),
|
|
889
|
+
trendIsGood: z6.boolean().optional(),
|
|
880
890
|
style
|
|
881
891
|
}).strict();
|
|
882
|
-
var ProgressBarCardSchema =
|
|
883
|
-
component:
|
|
884
|
-
label:
|
|
885
|
-
value:
|
|
886
|
-
min:
|
|
887
|
-
max:
|
|
892
|
+
var ProgressBarCardSchema = z6.object({
|
|
893
|
+
component: z6.literal("ProgressBar"),
|
|
894
|
+
label: LocalizedStringSchema,
|
|
895
|
+
value: z6.number(),
|
|
896
|
+
min: z6.number().optional(),
|
|
897
|
+
max: z6.number().optional(),
|
|
888
898
|
shape: ProgressShapeSchema.optional(),
|
|
889
899
|
color: ProgressColorSchema.optional(),
|
|
890
|
-
unit:
|
|
891
|
-
valueLabel:
|
|
892
|
-
caption:
|
|
893
|
-
icon:
|
|
900
|
+
unit: z6.string().optional(),
|
|
901
|
+
valueLabel: z6.string().optional(),
|
|
902
|
+
caption: LocalizedStringSchema.optional(),
|
|
903
|
+
icon: z6.string().optional(),
|
|
894
904
|
style
|
|
895
905
|
}).strict();
|
|
896
|
-
var KeyValueListCardSchema =
|
|
897
|
-
component:
|
|
898
|
-
rows:
|
|
899
|
-
|
|
906
|
+
var KeyValueListCardSchema = z6.object({
|
|
907
|
+
component: z6.literal("KeyValueList"),
|
|
908
|
+
rows: z6.array(
|
|
909
|
+
z6.object({ label: z6.string(), value: z6.string(), icon: z6.string().optional() }).strict()
|
|
900
910
|
).min(1).max(40),
|
|
901
911
|
style
|
|
902
912
|
}).strict();
|
|
903
|
-
var TimelineCardSchema =
|
|
904
|
-
component:
|
|
905
|
-
title:
|
|
906
|
-
icon:
|
|
907
|
-
entries:
|
|
908
|
-
|
|
909
|
-
time:
|
|
910
|
-
title:
|
|
911
|
-
description:
|
|
912
|
-
icon:
|
|
913
|
-
duration:
|
|
914
|
-
badge:
|
|
915
|
-
current:
|
|
916
|
-
past:
|
|
913
|
+
var TimelineCardSchema = z6.object({
|
|
914
|
+
component: z6.literal("Timeline"),
|
|
915
|
+
title: LocalizedStringSchema.optional(),
|
|
916
|
+
icon: z6.string().optional(),
|
|
917
|
+
entries: z6.array(
|
|
918
|
+
z6.object({
|
|
919
|
+
time: z6.string(),
|
|
920
|
+
title: z6.string(),
|
|
921
|
+
description: z6.string().optional(),
|
|
922
|
+
icon: z6.string().optional(),
|
|
923
|
+
duration: z6.string().optional(),
|
|
924
|
+
badge: z6.string().optional(),
|
|
925
|
+
current: z6.boolean().optional(),
|
|
926
|
+
past: z6.boolean().optional(),
|
|
917
927
|
variant: TimelineVariantSchema.optional()
|
|
918
928
|
}).strict()
|
|
919
929
|
).min(1).max(40),
|
|
920
930
|
style
|
|
921
931
|
}).strict();
|
|
922
|
-
var NoteCardSchema =
|
|
923
|
-
component:
|
|
924
|
-
title:
|
|
925
|
-
icon:
|
|
926
|
-
badge:
|
|
927
|
-
content:
|
|
928
|
-
footer:
|
|
932
|
+
var NoteCardSchema = z6.object({
|
|
933
|
+
component: z6.literal("Note"),
|
|
934
|
+
title: LocalizedStringSchema.optional(),
|
|
935
|
+
icon: z6.string().optional(),
|
|
936
|
+
badge: z6.string().optional(),
|
|
937
|
+
content: z6.string(),
|
|
938
|
+
footer: z6.string().optional(),
|
|
929
939
|
variant: NoteVariantSchema.optional(),
|
|
930
940
|
style
|
|
931
941
|
}).strict();
|
|
932
|
-
var QuoteCardSchema =
|
|
933
|
-
component:
|
|
934
|
-
text:
|
|
935
|
-
source:
|
|
936
|
-
context:
|
|
937
|
-
footer:
|
|
942
|
+
var QuoteCardSchema = z6.object({
|
|
943
|
+
component: z6.literal("Quote"),
|
|
944
|
+
text: z6.string(),
|
|
945
|
+
source: z6.string().optional(),
|
|
946
|
+
context: z6.string().optional(),
|
|
947
|
+
footer: z6.string().optional(),
|
|
938
948
|
style
|
|
939
949
|
}).strict();
|
|
940
|
-
var CalendarEventCardSchema =
|
|
941
|
-
component:
|
|
942
|
-
title:
|
|
943
|
-
start:
|
|
944
|
-
end:
|
|
945
|
-
allDay:
|
|
946
|
-
location:
|
|
947
|
-
organizer:
|
|
948
|
-
attendees:
|
|
949
|
-
calendar:
|
|
950
|
+
var CalendarEventCardSchema = z6.object({
|
|
951
|
+
component: z6.literal("CalendarEvent"),
|
|
952
|
+
title: z6.string(),
|
|
953
|
+
start: z6.string(),
|
|
954
|
+
end: z6.string().optional(),
|
|
955
|
+
allDay: z6.boolean().optional(),
|
|
956
|
+
location: z6.string().optional(),
|
|
957
|
+
organizer: z6.string().optional(),
|
|
958
|
+
attendees: z6.array(z6.string()).max(40).optional(),
|
|
959
|
+
calendar: z6.string().optional(),
|
|
950
960
|
status: CalendarEventStatusSchema.optional(),
|
|
951
|
-
recurrence:
|
|
952
|
-
notes:
|
|
961
|
+
recurrence: z6.string().optional(),
|
|
962
|
+
notes: z6.string().optional(),
|
|
953
963
|
style
|
|
954
964
|
}).strict();
|
|
955
965
|
var CHAT_CARD_COMPONENTS = [
|
|
@@ -1009,8 +1019,8 @@ var CHAT_CARD_PROPS = Object.freeze(
|
|
|
1009
1019
|
})
|
|
1010
1020
|
)
|
|
1011
1021
|
);
|
|
1012
|
-
var ChatCardComponentSchema =
|
|
1013
|
-
() =>
|
|
1022
|
+
var ChatCardComponentSchema = z6.lazy(
|
|
1023
|
+
() => z6.discriminatedUnion(
|
|
1014
1024
|
"component",
|
|
1015
1025
|
CARD_MEMBERS
|
|
1016
1026
|
)
|