@rizom/brain 0.2.0-alpha.5 → 0.2.0-alpha.50

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,917 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const MessageResponseSchema: z.ZodUnion<[z.ZodObject<{
4
+ success: z.ZodBoolean;
5
+ data: z.ZodOptional<z.ZodUnknown>;
6
+ error: z.ZodOptional<z.ZodString>;
7
+ }, "strip", z.ZodTypeAny, {
8
+ success: boolean;
9
+ data?: unknown;
10
+ error?: string | undefined;
11
+ }, {
12
+ success: boolean;
13
+ data?: unknown;
14
+ error?: string | undefined;
15
+ }>, z.ZodObject<{
16
+ noop: z.ZodLiteral<true>;
17
+ }, "strip", z.ZodTypeAny, {
18
+ noop: true;
19
+ }, {
20
+ noop: true;
21
+ }>]>;
22
+ type MessageResponse<T = unknown> = ({
23
+ success: boolean;
24
+ error?: string | undefined;
25
+ } & {
26
+ data?: T | undefined;
27
+ }) | {
28
+ noop: true;
29
+ };
30
+ declare const BaseMessageSchema: z.ZodObject<{
31
+ id: z.ZodString;
32
+ timestamp: z.ZodString;
33
+ type: z.ZodString;
34
+ source: z.ZodString;
35
+ target: z.ZodOptional<z.ZodString>;
36
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
37
+ }, "strip", z.ZodTypeAny, {
38
+ type: string;
39
+ id: string;
40
+ timestamp: string;
41
+ source: string;
42
+ target?: string | undefined;
43
+ metadata?: Record<string, unknown> | undefined;
44
+ }, {
45
+ type: string;
46
+ id: string;
47
+ timestamp: string;
48
+ source: string;
49
+ target?: string | undefined;
50
+ metadata?: Record<string, unknown> | undefined;
51
+ }>;
52
+ type BaseMessage = z.infer<typeof BaseMessageSchema>;
53
+ type MessageWithPayload<T = unknown> = BaseMessage & {
54
+ payload: T;
55
+ };
56
+ interface MessageSendOptions {
57
+ broadcast?: boolean;
58
+ }
59
+ type MessageSender<T = unknown, R = unknown> = (type: string, payload: T, options?: MessageSendOptions) => Promise<MessageResponse<R>>;
60
+ interface MessageContext {
61
+ userId?: string;
62
+ channelId?: string;
63
+ messageId?: string;
64
+ timestamp?: string;
65
+ interfaceType?: string;
66
+ userPermissionLevel?: "public" | "trusted" | "anchor";
67
+ threadId?: string;
68
+ }
69
+
70
+ /** Section definition schema for site routes. */
71
+ declare const SectionDefinitionSchema: z.ZodObject<{
72
+ id: z.ZodString;
73
+ template: z.ZodString;
74
+ content: z.ZodOptional<z.ZodUnknown>;
75
+ dataQuery: z.ZodOptional<z.ZodObject<{
76
+ entityType: z.ZodOptional<z.ZodString>;
77
+ template: z.ZodOptional<z.ZodString>;
78
+ query: z.ZodOptional<z.ZodObject<{
79
+ id: z.ZodOptional<z.ZodString>;
80
+ limit: z.ZodOptional<z.ZodNumber>;
81
+ offset: z.ZodOptional<z.ZodNumber>;
82
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
83
+ id: z.ZodOptional<z.ZodString>;
84
+ limit: z.ZodOptional<z.ZodNumber>;
85
+ offset: z.ZodOptional<z.ZodNumber>;
86
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
87
+ id: z.ZodOptional<z.ZodString>;
88
+ limit: z.ZodOptional<z.ZodNumber>;
89
+ offset: z.ZodOptional<z.ZodNumber>;
90
+ }, z.ZodTypeAny, "passthrough">>>;
91
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
92
+ entityType: z.ZodOptional<z.ZodString>;
93
+ template: z.ZodOptional<z.ZodString>;
94
+ query: z.ZodOptional<z.ZodObject<{
95
+ id: z.ZodOptional<z.ZodString>;
96
+ limit: z.ZodOptional<z.ZodNumber>;
97
+ offset: z.ZodOptional<z.ZodNumber>;
98
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
99
+ id: z.ZodOptional<z.ZodString>;
100
+ limit: z.ZodOptional<z.ZodNumber>;
101
+ offset: z.ZodOptional<z.ZodNumber>;
102
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
103
+ id: z.ZodOptional<z.ZodString>;
104
+ limit: z.ZodOptional<z.ZodNumber>;
105
+ offset: z.ZodOptional<z.ZodNumber>;
106
+ }, z.ZodTypeAny, "passthrough">>>;
107
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
108
+ entityType: z.ZodOptional<z.ZodString>;
109
+ template: z.ZodOptional<z.ZodString>;
110
+ query: z.ZodOptional<z.ZodObject<{
111
+ id: z.ZodOptional<z.ZodString>;
112
+ limit: z.ZodOptional<z.ZodNumber>;
113
+ offset: z.ZodOptional<z.ZodNumber>;
114
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
115
+ id: z.ZodOptional<z.ZodString>;
116
+ limit: z.ZodOptional<z.ZodNumber>;
117
+ offset: z.ZodOptional<z.ZodNumber>;
118
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
119
+ id: z.ZodOptional<z.ZodString>;
120
+ limit: z.ZodOptional<z.ZodNumber>;
121
+ offset: z.ZodOptional<z.ZodNumber>;
122
+ }, z.ZodTypeAny, "passthrough">>>;
123
+ }, z.ZodTypeAny, "passthrough">>>;
124
+ order: z.ZodOptional<z.ZodNumber>;
125
+ }, "strip", z.ZodTypeAny, {
126
+ id: string;
127
+ template: string;
128
+ content?: unknown;
129
+ dataQuery?: z.objectOutputType<{
130
+ entityType: z.ZodOptional<z.ZodString>;
131
+ template: z.ZodOptional<z.ZodString>;
132
+ query: z.ZodOptional<z.ZodObject<{
133
+ id: z.ZodOptional<z.ZodString>;
134
+ limit: z.ZodOptional<z.ZodNumber>;
135
+ offset: z.ZodOptional<z.ZodNumber>;
136
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
137
+ id: z.ZodOptional<z.ZodString>;
138
+ limit: z.ZodOptional<z.ZodNumber>;
139
+ offset: z.ZodOptional<z.ZodNumber>;
140
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
141
+ id: z.ZodOptional<z.ZodString>;
142
+ limit: z.ZodOptional<z.ZodNumber>;
143
+ offset: z.ZodOptional<z.ZodNumber>;
144
+ }, z.ZodTypeAny, "passthrough">>>;
145
+ }, z.ZodTypeAny, "passthrough"> | undefined;
146
+ order?: number | undefined;
147
+ }, {
148
+ id: string;
149
+ template: string;
150
+ content?: unknown;
151
+ dataQuery?: z.objectInputType<{
152
+ entityType: z.ZodOptional<z.ZodString>;
153
+ template: z.ZodOptional<z.ZodString>;
154
+ query: z.ZodOptional<z.ZodObject<{
155
+ id: z.ZodOptional<z.ZodString>;
156
+ limit: z.ZodOptional<z.ZodNumber>;
157
+ offset: z.ZodOptional<z.ZodNumber>;
158
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
159
+ id: z.ZodOptional<z.ZodString>;
160
+ limit: z.ZodOptional<z.ZodNumber>;
161
+ offset: z.ZodOptional<z.ZodNumber>;
162
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
163
+ id: z.ZodOptional<z.ZodString>;
164
+ limit: z.ZodOptional<z.ZodNumber>;
165
+ offset: z.ZodOptional<z.ZodNumber>;
166
+ }, z.ZodTypeAny, "passthrough">>>;
167
+ }, z.ZodTypeAny, "passthrough"> | undefined;
168
+ order?: number | undefined;
169
+ }>;
170
+ /** Navigation slot types. */
171
+ declare const NavigationSlots: readonly ["primary", "secondary"];
172
+ type NavigationSlot = (typeof NavigationSlots)[number];
173
+ /** Display and behavior metadata for an entity type. */
174
+ interface EntityDisplayEntry {
175
+ label: string;
176
+ pluralName?: string;
177
+ /** Layout name for this entity type's generated routes (defaults to "default") */
178
+ layout?: string;
179
+ /** Enable pagination for list pages */
180
+ paginate?: boolean;
181
+ /** Items per page (default: 10) */
182
+ pageSize?: number;
183
+ navigation?: {
184
+ show?: boolean;
185
+ slot?: NavigationSlot;
186
+ priority?: number;
187
+ };
188
+ }
189
+ /** Route definition schema. */
190
+ declare const RouteDefinitionSchema: z.ZodObject<{
191
+ id: z.ZodString;
192
+ path: z.ZodString;
193
+ title: z.ZodDefault<z.ZodString>;
194
+ description: z.ZodDefault<z.ZodString>;
195
+ sections: z.ZodDefault<z.ZodArray<z.ZodObject<{
196
+ id: z.ZodString;
197
+ template: z.ZodString;
198
+ content: z.ZodOptional<z.ZodUnknown>;
199
+ dataQuery: z.ZodOptional<z.ZodObject<{
200
+ entityType: z.ZodOptional<z.ZodString>;
201
+ template: z.ZodOptional<z.ZodString>;
202
+ query: z.ZodOptional<z.ZodObject<{
203
+ id: z.ZodOptional<z.ZodString>;
204
+ limit: z.ZodOptional<z.ZodNumber>;
205
+ offset: z.ZodOptional<z.ZodNumber>;
206
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
207
+ id: z.ZodOptional<z.ZodString>;
208
+ limit: z.ZodOptional<z.ZodNumber>;
209
+ offset: z.ZodOptional<z.ZodNumber>;
210
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
211
+ id: z.ZodOptional<z.ZodString>;
212
+ limit: z.ZodOptional<z.ZodNumber>;
213
+ offset: z.ZodOptional<z.ZodNumber>;
214
+ }, z.ZodTypeAny, "passthrough">>>;
215
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
216
+ entityType: z.ZodOptional<z.ZodString>;
217
+ template: z.ZodOptional<z.ZodString>;
218
+ query: z.ZodOptional<z.ZodObject<{
219
+ id: z.ZodOptional<z.ZodString>;
220
+ limit: z.ZodOptional<z.ZodNumber>;
221
+ offset: z.ZodOptional<z.ZodNumber>;
222
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
223
+ id: z.ZodOptional<z.ZodString>;
224
+ limit: z.ZodOptional<z.ZodNumber>;
225
+ offset: z.ZodOptional<z.ZodNumber>;
226
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
227
+ id: z.ZodOptional<z.ZodString>;
228
+ limit: z.ZodOptional<z.ZodNumber>;
229
+ offset: z.ZodOptional<z.ZodNumber>;
230
+ }, z.ZodTypeAny, "passthrough">>>;
231
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
232
+ entityType: z.ZodOptional<z.ZodString>;
233
+ template: z.ZodOptional<z.ZodString>;
234
+ query: z.ZodOptional<z.ZodObject<{
235
+ id: z.ZodOptional<z.ZodString>;
236
+ limit: z.ZodOptional<z.ZodNumber>;
237
+ offset: z.ZodOptional<z.ZodNumber>;
238
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
239
+ id: z.ZodOptional<z.ZodString>;
240
+ limit: z.ZodOptional<z.ZodNumber>;
241
+ offset: z.ZodOptional<z.ZodNumber>;
242
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
243
+ id: z.ZodOptional<z.ZodString>;
244
+ limit: z.ZodOptional<z.ZodNumber>;
245
+ offset: z.ZodOptional<z.ZodNumber>;
246
+ }, z.ZodTypeAny, "passthrough">>>;
247
+ }, z.ZodTypeAny, "passthrough">>>;
248
+ order: z.ZodOptional<z.ZodNumber>;
249
+ }, "strip", z.ZodTypeAny, {
250
+ id: string;
251
+ template: string;
252
+ content?: unknown;
253
+ dataQuery?: z.objectOutputType<{
254
+ entityType: z.ZodOptional<z.ZodString>;
255
+ template: z.ZodOptional<z.ZodString>;
256
+ query: z.ZodOptional<z.ZodObject<{
257
+ id: z.ZodOptional<z.ZodString>;
258
+ limit: z.ZodOptional<z.ZodNumber>;
259
+ offset: z.ZodOptional<z.ZodNumber>;
260
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
261
+ id: z.ZodOptional<z.ZodString>;
262
+ limit: z.ZodOptional<z.ZodNumber>;
263
+ offset: z.ZodOptional<z.ZodNumber>;
264
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
265
+ id: z.ZodOptional<z.ZodString>;
266
+ limit: z.ZodOptional<z.ZodNumber>;
267
+ offset: z.ZodOptional<z.ZodNumber>;
268
+ }, z.ZodTypeAny, "passthrough">>>;
269
+ }, z.ZodTypeAny, "passthrough"> | undefined;
270
+ order?: number | undefined;
271
+ }, {
272
+ id: string;
273
+ template: string;
274
+ content?: unknown;
275
+ dataQuery?: z.objectInputType<{
276
+ entityType: z.ZodOptional<z.ZodString>;
277
+ template: z.ZodOptional<z.ZodString>;
278
+ query: z.ZodOptional<z.ZodObject<{
279
+ id: z.ZodOptional<z.ZodString>;
280
+ limit: z.ZodOptional<z.ZodNumber>;
281
+ offset: z.ZodOptional<z.ZodNumber>;
282
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
283
+ id: z.ZodOptional<z.ZodString>;
284
+ limit: z.ZodOptional<z.ZodNumber>;
285
+ offset: z.ZodOptional<z.ZodNumber>;
286
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
287
+ id: z.ZodOptional<z.ZodString>;
288
+ limit: z.ZodOptional<z.ZodNumber>;
289
+ offset: z.ZodOptional<z.ZodNumber>;
290
+ }, z.ZodTypeAny, "passthrough">>>;
291
+ }, z.ZodTypeAny, "passthrough"> | undefined;
292
+ order?: number | undefined;
293
+ }>, "many">>;
294
+ layout: z.ZodDefault<z.ZodString>;
295
+ fullscreen: z.ZodOptional<z.ZodBoolean>;
296
+ pluginId: z.ZodOptional<z.ZodString>;
297
+ sourceEntityType: z.ZodOptional<z.ZodString>;
298
+ external: z.ZodOptional<z.ZodBoolean>;
299
+ navigation: z.ZodOptional<z.ZodObject<{
300
+ show: z.ZodDefault<z.ZodBoolean>;
301
+ label: z.ZodOptional<z.ZodString>;
302
+ slot: z.ZodDefault<z.ZodEnum<["primary", "secondary"]>>;
303
+ priority: z.ZodDefault<z.ZodNumber>;
304
+ }, "strip", z.ZodTypeAny, {
305
+ show: boolean;
306
+ slot: "primary" | "secondary";
307
+ priority: number;
308
+ label?: string | undefined;
309
+ }, {
310
+ show?: boolean | undefined;
311
+ label?: string | undefined;
312
+ slot?: "primary" | "secondary" | undefined;
313
+ priority?: number | undefined;
314
+ }>>;
315
+ }, "strip", z.ZodTypeAny, {
316
+ id: string;
317
+ path: string;
318
+ title: string;
319
+ description: string;
320
+ sections: {
321
+ id: string;
322
+ template: string;
323
+ content?: unknown;
324
+ dataQuery?: z.objectOutputType<{
325
+ entityType: z.ZodOptional<z.ZodString>;
326
+ template: z.ZodOptional<z.ZodString>;
327
+ query: z.ZodOptional<z.ZodObject<{
328
+ id: z.ZodOptional<z.ZodString>;
329
+ limit: z.ZodOptional<z.ZodNumber>;
330
+ offset: z.ZodOptional<z.ZodNumber>;
331
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
332
+ id: z.ZodOptional<z.ZodString>;
333
+ limit: z.ZodOptional<z.ZodNumber>;
334
+ offset: z.ZodOptional<z.ZodNumber>;
335
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
336
+ id: z.ZodOptional<z.ZodString>;
337
+ limit: z.ZodOptional<z.ZodNumber>;
338
+ offset: z.ZodOptional<z.ZodNumber>;
339
+ }, z.ZodTypeAny, "passthrough">>>;
340
+ }, z.ZodTypeAny, "passthrough"> | undefined;
341
+ order?: number | undefined;
342
+ }[];
343
+ layout: string;
344
+ fullscreen?: boolean | undefined;
345
+ pluginId?: string | undefined;
346
+ sourceEntityType?: string | undefined;
347
+ external?: boolean | undefined;
348
+ navigation?: {
349
+ show: boolean;
350
+ slot: "primary" | "secondary";
351
+ priority: number;
352
+ label?: string | undefined;
353
+ } | undefined;
354
+ }, {
355
+ id: string;
356
+ path: string;
357
+ title?: string | undefined;
358
+ description?: string | undefined;
359
+ sections?: {
360
+ id: string;
361
+ template: string;
362
+ content?: unknown;
363
+ dataQuery?: z.objectInputType<{
364
+ entityType: z.ZodOptional<z.ZodString>;
365
+ template: z.ZodOptional<z.ZodString>;
366
+ query: z.ZodOptional<z.ZodObject<{
367
+ id: z.ZodOptional<z.ZodString>;
368
+ limit: z.ZodOptional<z.ZodNumber>;
369
+ offset: z.ZodOptional<z.ZodNumber>;
370
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
371
+ id: z.ZodOptional<z.ZodString>;
372
+ limit: z.ZodOptional<z.ZodNumber>;
373
+ offset: z.ZodOptional<z.ZodNumber>;
374
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
375
+ id: z.ZodOptional<z.ZodString>;
376
+ limit: z.ZodOptional<z.ZodNumber>;
377
+ offset: z.ZodOptional<z.ZodNumber>;
378
+ }, z.ZodTypeAny, "passthrough">>>;
379
+ }, z.ZodTypeAny, "passthrough"> | undefined;
380
+ order?: number | undefined;
381
+ }[] | undefined;
382
+ layout?: string | undefined;
383
+ fullscreen?: boolean | undefined;
384
+ pluginId?: string | undefined;
385
+ sourceEntityType?: string | undefined;
386
+ external?: boolean | undefined;
387
+ navigation?: {
388
+ show?: boolean | undefined;
389
+ label?: string | undefined;
390
+ slot?: "primary" | "secondary" | undefined;
391
+ priority?: number | undefined;
392
+ } | undefined;
393
+ }>;
394
+ type SectionDefinition = z.infer<typeof SectionDefinitionSchema>;
395
+ type RouteDefinition = z.infer<typeof RouteDefinitionSchema>;
396
+ type RouteDefinitionInput = z.input<typeof RouteDefinitionSchema>;
397
+ /** Message payload schemas for route operations. */
398
+ declare const RegisterRoutesPayloadSchema: z.ZodObject<{
399
+ routes: z.ZodArray<z.ZodObject<{
400
+ id: z.ZodString;
401
+ path: z.ZodString;
402
+ title: z.ZodDefault<z.ZodString>;
403
+ description: z.ZodDefault<z.ZodString>;
404
+ sections: z.ZodDefault<z.ZodArray<z.ZodObject<{
405
+ id: z.ZodString;
406
+ template: z.ZodString;
407
+ content: z.ZodOptional<z.ZodUnknown>;
408
+ dataQuery: z.ZodOptional<z.ZodObject<{
409
+ entityType: z.ZodOptional<z.ZodString>;
410
+ template: z.ZodOptional<z.ZodString>;
411
+ query: z.ZodOptional<z.ZodObject<{
412
+ id: z.ZodOptional<z.ZodString>;
413
+ limit: z.ZodOptional<z.ZodNumber>;
414
+ offset: z.ZodOptional<z.ZodNumber>;
415
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
416
+ id: z.ZodOptional<z.ZodString>;
417
+ limit: z.ZodOptional<z.ZodNumber>;
418
+ offset: z.ZodOptional<z.ZodNumber>;
419
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
420
+ id: z.ZodOptional<z.ZodString>;
421
+ limit: z.ZodOptional<z.ZodNumber>;
422
+ offset: z.ZodOptional<z.ZodNumber>;
423
+ }, z.ZodTypeAny, "passthrough">>>;
424
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
425
+ entityType: z.ZodOptional<z.ZodString>;
426
+ template: z.ZodOptional<z.ZodString>;
427
+ query: z.ZodOptional<z.ZodObject<{
428
+ id: z.ZodOptional<z.ZodString>;
429
+ limit: z.ZodOptional<z.ZodNumber>;
430
+ offset: z.ZodOptional<z.ZodNumber>;
431
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
432
+ id: z.ZodOptional<z.ZodString>;
433
+ limit: z.ZodOptional<z.ZodNumber>;
434
+ offset: z.ZodOptional<z.ZodNumber>;
435
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
436
+ id: z.ZodOptional<z.ZodString>;
437
+ limit: z.ZodOptional<z.ZodNumber>;
438
+ offset: z.ZodOptional<z.ZodNumber>;
439
+ }, z.ZodTypeAny, "passthrough">>>;
440
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
441
+ entityType: z.ZodOptional<z.ZodString>;
442
+ template: z.ZodOptional<z.ZodString>;
443
+ query: z.ZodOptional<z.ZodObject<{
444
+ id: z.ZodOptional<z.ZodString>;
445
+ limit: z.ZodOptional<z.ZodNumber>;
446
+ offset: z.ZodOptional<z.ZodNumber>;
447
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
448
+ id: z.ZodOptional<z.ZodString>;
449
+ limit: z.ZodOptional<z.ZodNumber>;
450
+ offset: z.ZodOptional<z.ZodNumber>;
451
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
452
+ id: z.ZodOptional<z.ZodString>;
453
+ limit: z.ZodOptional<z.ZodNumber>;
454
+ offset: z.ZodOptional<z.ZodNumber>;
455
+ }, z.ZodTypeAny, "passthrough">>>;
456
+ }, z.ZodTypeAny, "passthrough">>>;
457
+ order: z.ZodOptional<z.ZodNumber>;
458
+ }, "strip", z.ZodTypeAny, {
459
+ id: string;
460
+ template: string;
461
+ content?: unknown;
462
+ dataQuery?: z.objectOutputType<{
463
+ entityType: z.ZodOptional<z.ZodString>;
464
+ template: z.ZodOptional<z.ZodString>;
465
+ query: z.ZodOptional<z.ZodObject<{
466
+ id: z.ZodOptional<z.ZodString>;
467
+ limit: z.ZodOptional<z.ZodNumber>;
468
+ offset: z.ZodOptional<z.ZodNumber>;
469
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
470
+ id: z.ZodOptional<z.ZodString>;
471
+ limit: z.ZodOptional<z.ZodNumber>;
472
+ offset: z.ZodOptional<z.ZodNumber>;
473
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
474
+ id: z.ZodOptional<z.ZodString>;
475
+ limit: z.ZodOptional<z.ZodNumber>;
476
+ offset: z.ZodOptional<z.ZodNumber>;
477
+ }, z.ZodTypeAny, "passthrough">>>;
478
+ }, z.ZodTypeAny, "passthrough"> | undefined;
479
+ order?: number | undefined;
480
+ }, {
481
+ id: string;
482
+ template: string;
483
+ content?: unknown;
484
+ dataQuery?: z.objectInputType<{
485
+ entityType: z.ZodOptional<z.ZodString>;
486
+ template: z.ZodOptional<z.ZodString>;
487
+ query: z.ZodOptional<z.ZodObject<{
488
+ id: z.ZodOptional<z.ZodString>;
489
+ limit: z.ZodOptional<z.ZodNumber>;
490
+ offset: z.ZodOptional<z.ZodNumber>;
491
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
492
+ id: z.ZodOptional<z.ZodString>;
493
+ limit: z.ZodOptional<z.ZodNumber>;
494
+ offset: z.ZodOptional<z.ZodNumber>;
495
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
496
+ id: z.ZodOptional<z.ZodString>;
497
+ limit: z.ZodOptional<z.ZodNumber>;
498
+ offset: z.ZodOptional<z.ZodNumber>;
499
+ }, z.ZodTypeAny, "passthrough">>>;
500
+ }, z.ZodTypeAny, "passthrough"> | undefined;
501
+ order?: number | undefined;
502
+ }>, "many">>;
503
+ layout: z.ZodDefault<z.ZodString>;
504
+ fullscreen: z.ZodOptional<z.ZodBoolean>;
505
+ pluginId: z.ZodOptional<z.ZodString>;
506
+ sourceEntityType: z.ZodOptional<z.ZodString>;
507
+ external: z.ZodOptional<z.ZodBoolean>;
508
+ navigation: z.ZodOptional<z.ZodObject<{
509
+ show: z.ZodDefault<z.ZodBoolean>;
510
+ label: z.ZodOptional<z.ZodString>;
511
+ slot: z.ZodDefault<z.ZodEnum<["primary", "secondary"]>>;
512
+ priority: z.ZodDefault<z.ZodNumber>;
513
+ }, "strip", z.ZodTypeAny, {
514
+ show: boolean;
515
+ slot: "primary" | "secondary";
516
+ priority: number;
517
+ label?: string | undefined;
518
+ }, {
519
+ show?: boolean | undefined;
520
+ label?: string | undefined;
521
+ slot?: "primary" | "secondary" | undefined;
522
+ priority?: number | undefined;
523
+ }>>;
524
+ }, "strip", z.ZodTypeAny, {
525
+ id: string;
526
+ path: string;
527
+ title: string;
528
+ description: string;
529
+ sections: {
530
+ id: string;
531
+ template: string;
532
+ content?: unknown;
533
+ dataQuery?: z.objectOutputType<{
534
+ entityType: z.ZodOptional<z.ZodString>;
535
+ template: z.ZodOptional<z.ZodString>;
536
+ query: z.ZodOptional<z.ZodObject<{
537
+ id: z.ZodOptional<z.ZodString>;
538
+ limit: z.ZodOptional<z.ZodNumber>;
539
+ offset: z.ZodOptional<z.ZodNumber>;
540
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
541
+ id: z.ZodOptional<z.ZodString>;
542
+ limit: z.ZodOptional<z.ZodNumber>;
543
+ offset: z.ZodOptional<z.ZodNumber>;
544
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
545
+ id: z.ZodOptional<z.ZodString>;
546
+ limit: z.ZodOptional<z.ZodNumber>;
547
+ offset: z.ZodOptional<z.ZodNumber>;
548
+ }, z.ZodTypeAny, "passthrough">>>;
549
+ }, z.ZodTypeAny, "passthrough"> | undefined;
550
+ order?: number | undefined;
551
+ }[];
552
+ layout: string;
553
+ fullscreen?: boolean | undefined;
554
+ pluginId?: string | undefined;
555
+ sourceEntityType?: string | undefined;
556
+ external?: boolean | undefined;
557
+ navigation?: {
558
+ show: boolean;
559
+ slot: "primary" | "secondary";
560
+ priority: number;
561
+ label?: string | undefined;
562
+ } | undefined;
563
+ }, {
564
+ id: string;
565
+ path: string;
566
+ title?: string | undefined;
567
+ description?: string | undefined;
568
+ sections?: {
569
+ id: string;
570
+ template: string;
571
+ content?: unknown;
572
+ dataQuery?: z.objectInputType<{
573
+ entityType: z.ZodOptional<z.ZodString>;
574
+ template: z.ZodOptional<z.ZodString>;
575
+ query: z.ZodOptional<z.ZodObject<{
576
+ id: z.ZodOptional<z.ZodString>;
577
+ limit: z.ZodOptional<z.ZodNumber>;
578
+ offset: z.ZodOptional<z.ZodNumber>;
579
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
580
+ id: z.ZodOptional<z.ZodString>;
581
+ limit: z.ZodOptional<z.ZodNumber>;
582
+ offset: z.ZodOptional<z.ZodNumber>;
583
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
584
+ id: z.ZodOptional<z.ZodString>;
585
+ limit: z.ZodOptional<z.ZodNumber>;
586
+ offset: z.ZodOptional<z.ZodNumber>;
587
+ }, z.ZodTypeAny, "passthrough">>>;
588
+ }, z.ZodTypeAny, "passthrough"> | undefined;
589
+ order?: number | undefined;
590
+ }[] | undefined;
591
+ layout?: string | undefined;
592
+ fullscreen?: boolean | undefined;
593
+ pluginId?: string | undefined;
594
+ sourceEntityType?: string | undefined;
595
+ external?: boolean | undefined;
596
+ navigation?: {
597
+ show?: boolean | undefined;
598
+ label?: string | undefined;
599
+ slot?: "primary" | "secondary" | undefined;
600
+ priority?: number | undefined;
601
+ } | undefined;
602
+ }>, "many">;
603
+ pluginId: z.ZodString;
604
+ }, "strip", z.ZodTypeAny, {
605
+ pluginId: string;
606
+ routes: {
607
+ id: string;
608
+ path: string;
609
+ title: string;
610
+ description: string;
611
+ sections: {
612
+ id: string;
613
+ template: string;
614
+ content?: unknown;
615
+ dataQuery?: z.objectOutputType<{
616
+ entityType: z.ZodOptional<z.ZodString>;
617
+ template: z.ZodOptional<z.ZodString>;
618
+ query: z.ZodOptional<z.ZodObject<{
619
+ id: z.ZodOptional<z.ZodString>;
620
+ limit: z.ZodOptional<z.ZodNumber>;
621
+ offset: z.ZodOptional<z.ZodNumber>;
622
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
623
+ id: z.ZodOptional<z.ZodString>;
624
+ limit: z.ZodOptional<z.ZodNumber>;
625
+ offset: z.ZodOptional<z.ZodNumber>;
626
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
627
+ id: z.ZodOptional<z.ZodString>;
628
+ limit: z.ZodOptional<z.ZodNumber>;
629
+ offset: z.ZodOptional<z.ZodNumber>;
630
+ }, z.ZodTypeAny, "passthrough">>>;
631
+ }, z.ZodTypeAny, "passthrough"> | undefined;
632
+ order?: number | undefined;
633
+ }[];
634
+ layout: string;
635
+ fullscreen?: boolean | undefined;
636
+ pluginId?: string | undefined;
637
+ sourceEntityType?: string | undefined;
638
+ external?: boolean | undefined;
639
+ navigation?: {
640
+ show: boolean;
641
+ slot: "primary" | "secondary";
642
+ priority: number;
643
+ label?: string | undefined;
644
+ } | undefined;
645
+ }[];
646
+ }, {
647
+ pluginId: string;
648
+ routes: {
649
+ id: string;
650
+ path: string;
651
+ title?: string | undefined;
652
+ description?: string | undefined;
653
+ sections?: {
654
+ id: string;
655
+ template: string;
656
+ content?: unknown;
657
+ dataQuery?: z.objectInputType<{
658
+ entityType: z.ZodOptional<z.ZodString>;
659
+ template: z.ZodOptional<z.ZodString>;
660
+ query: z.ZodOptional<z.ZodObject<{
661
+ id: z.ZodOptional<z.ZodString>;
662
+ limit: z.ZodOptional<z.ZodNumber>;
663
+ offset: z.ZodOptional<z.ZodNumber>;
664
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
665
+ id: z.ZodOptional<z.ZodString>;
666
+ limit: z.ZodOptional<z.ZodNumber>;
667
+ offset: z.ZodOptional<z.ZodNumber>;
668
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
669
+ id: z.ZodOptional<z.ZodString>;
670
+ limit: z.ZodOptional<z.ZodNumber>;
671
+ offset: z.ZodOptional<z.ZodNumber>;
672
+ }, z.ZodTypeAny, "passthrough">>>;
673
+ }, z.ZodTypeAny, "passthrough"> | undefined;
674
+ order?: number | undefined;
675
+ }[] | undefined;
676
+ layout?: string | undefined;
677
+ fullscreen?: boolean | undefined;
678
+ pluginId?: string | undefined;
679
+ sourceEntityType?: string | undefined;
680
+ external?: boolean | undefined;
681
+ navigation?: {
682
+ show?: boolean | undefined;
683
+ label?: string | undefined;
684
+ slot?: "primary" | "secondary" | undefined;
685
+ priority?: number | undefined;
686
+ } | undefined;
687
+ }[];
688
+ }>;
689
+ declare const UnregisterRoutesPayloadSchema: z.ZodObject<{
690
+ paths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
691
+ pluginId: z.ZodOptional<z.ZodString>;
692
+ }, "strip", z.ZodTypeAny, {
693
+ pluginId?: string | undefined;
694
+ paths?: string[] | undefined;
695
+ }, {
696
+ pluginId?: string | undefined;
697
+ paths?: string[] | undefined;
698
+ }>;
699
+ declare const ListRoutesPayloadSchema: z.ZodObject<{
700
+ pluginId: z.ZodOptional<z.ZodString>;
701
+ }, "strip", z.ZodTypeAny, {
702
+ pluginId?: string | undefined;
703
+ }, {
704
+ pluginId?: string | undefined;
705
+ }>;
706
+ declare const GetRoutePayloadSchema: z.ZodObject<{
707
+ path: z.ZodString;
708
+ }, "strip", z.ZodTypeAny, {
709
+ path: string;
710
+ }, {
711
+ path: string;
712
+ }>;
713
+ /** Navigation item shape for extracted navigation data. */
714
+ declare const NavigationItemSchema: z.ZodObject<{
715
+ label: z.ZodString;
716
+ href: z.ZodString;
717
+ priority: z.ZodNumber;
718
+ }, "strip", z.ZodTypeAny, {
719
+ label: string;
720
+ priority: number;
721
+ href: string;
722
+ }, {
723
+ label: string;
724
+ priority: number;
725
+ href: string;
726
+ }>;
727
+ type NavigationItem = z.infer<typeof NavigationItemSchema>;
728
+
729
+ declare const apiRouteDefinitionSchema: z.ZodObject<{
730
+ /** Path suffix (prefixed with /api/{pluginId}) */
731
+ path: z.ZodString;
732
+ /** HTTP method */
733
+ method: z.ZodDefault<z.ZodEnum<["GET", "POST", "PUT", "DELETE"]>>;
734
+ /** Tool to invoke (without plugin prefix) */
735
+ tool: z.ZodString;
736
+ /** Allow unauthenticated access */
737
+ public: z.ZodDefault<z.ZodBoolean>;
738
+ /** Redirect URL on success (for form submissions) */
739
+ successRedirect: z.ZodOptional<z.ZodString>;
740
+ /** Redirect URL on error (for form submissions) */
741
+ errorRedirect: z.ZodOptional<z.ZodString>;
742
+ }, "strip", z.ZodTypeAny, {
743
+ path: string;
744
+ method: "GET" | "POST" | "PUT" | "DELETE";
745
+ tool: string;
746
+ public: boolean;
747
+ successRedirect?: string | undefined;
748
+ errorRedirect?: string | undefined;
749
+ }, {
750
+ path: string;
751
+ tool: string;
752
+ method?: "GET" | "POST" | "PUT" | "DELETE" | undefined;
753
+ public?: boolean | undefined;
754
+ successRedirect?: string | undefined;
755
+ errorRedirect?: string | undefined;
756
+ }>;
757
+ type ApiRouteDefinition = z.infer<typeof apiRouteDefinitionSchema>;
758
+ /**
759
+ * A registered API route with full path and plugin context
760
+ * Returned by Shell.getPluginApiRoutes()
761
+ */
762
+ interface RegisteredApiRoute {
763
+ /** The plugin that registered this route */
764
+ pluginId: string;
765
+ /** Full path including /api/{pluginId} prefix */
766
+ fullPath: string;
767
+ /** The original route definition */
768
+ definition: ApiRouteDefinition;
769
+ }
770
+
771
+ declare const WebRouteMethods: readonly ["GET", "POST", "PUT", "DELETE", "OPTIONS"];
772
+ type WebRouteMethod = (typeof WebRouteMethods)[number];
773
+ type WebRouteHandler = (request: Request) => Response | Promise<Response>;
774
+ interface WebRouteDefinition {
775
+ /** Absolute mounted path (e.g. "/cms" or "/cms-config") */
776
+ path: string;
777
+ /** HTTP method */
778
+ method?: WebRouteMethod;
779
+ /** Allow unauthenticated access */
780
+ public?: boolean;
781
+ /** Request handler */
782
+ handler: WebRouteHandler;
783
+ }
784
+ interface RegisteredWebRoute {
785
+ /** The plugin that registered this route */
786
+ pluginId: string;
787
+ /** The mounted path */
788
+ fullPath: string;
789
+ /** The original route definition */
790
+ definition: WebRouteDefinition;
791
+ }
792
+
793
+ /**
794
+ * Daemon health status schema
795
+ */
796
+ declare const DaemonHealthSchema: z.ZodObject<{
797
+ status: z.ZodEnum<["healthy", "warning", "error", "unknown"]>;
798
+ message: z.ZodOptional<z.ZodString>;
799
+ lastCheck: z.ZodOptional<z.ZodDate>;
800
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
801
+ }, "strip", z.ZodTypeAny, {
802
+ status: "unknown" | "healthy" | "warning" | "error";
803
+ message?: string | undefined;
804
+ lastCheck?: Date | undefined;
805
+ details?: Record<string, unknown> | undefined;
806
+ }, {
807
+ status: "unknown" | "healthy" | "warning" | "error";
808
+ message?: string | undefined;
809
+ lastCheck?: Date | undefined;
810
+ details?: Record<string, unknown> | undefined;
811
+ }>;
812
+ type DaemonHealth = z.infer<typeof DaemonHealthSchema>;
813
+ /**
814
+ * Daemon status info schema for validation
815
+ */
816
+ declare const DaemonStatusInfoSchema: z.ZodObject<{
817
+ name: z.ZodString;
818
+ pluginId: z.ZodString;
819
+ status: z.ZodString;
820
+ health: z.ZodOptional<z.ZodObject<{
821
+ status: z.ZodEnum<["healthy", "warning", "error", "unknown"]>;
822
+ message: z.ZodOptional<z.ZodString>;
823
+ lastCheck: z.ZodOptional<z.ZodDate>;
824
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
825
+ }, "strip", z.ZodTypeAny, {
826
+ status: "unknown" | "healthy" | "warning" | "error";
827
+ message?: string | undefined;
828
+ lastCheck?: Date | undefined;
829
+ details?: Record<string, unknown> | undefined;
830
+ }, {
831
+ status: "unknown" | "healthy" | "warning" | "error";
832
+ message?: string | undefined;
833
+ lastCheck?: Date | undefined;
834
+ details?: Record<string, unknown> | undefined;
835
+ }>>;
836
+ }, "strip", z.ZodTypeAny, {
837
+ status: string;
838
+ name: string;
839
+ pluginId: string;
840
+ health?: {
841
+ status: "unknown" | "healthy" | "warning" | "error";
842
+ message?: string | undefined;
843
+ lastCheck?: Date | undefined;
844
+ details?: Record<string, unknown> | undefined;
845
+ } | undefined;
846
+ }, {
847
+ status: string;
848
+ name: string;
849
+ pluginId: string;
850
+ health?: {
851
+ status: "unknown" | "healthy" | "warning" | "error";
852
+ message?: string | undefined;
853
+ lastCheck?: Date | undefined;
854
+ details?: Record<string, unknown> | undefined;
855
+ } | undefined;
856
+ }>;
857
+ type DaemonStatusInfo = z.infer<typeof DaemonStatusInfoSchema>;
858
+ /**
859
+ * Daemon interface for long-running interface processes
860
+ */
861
+ interface Daemon {
862
+ /**
863
+ * Start the daemon - called when plugin is initialized
864
+ */
865
+ start: () => Promise<void>;
866
+ /**
867
+ * Stop the daemon - called when plugin is unloaded/shutdown
868
+ */
869
+ stop: () => Promise<void>;
870
+ /**
871
+ * Optional health check - called periodically to monitor daemon health
872
+ */
873
+ healthCheck?: () => Promise<DaemonHealth>;
874
+ }
875
+ /**
876
+ * Information about a registered daemon
877
+ */
878
+ interface DaemonInfo {
879
+ name: string;
880
+ daemon: Daemon;
881
+ pluginId: string;
882
+ status: "stopped" | "starting" | "running" | "stopping" | "error";
883
+ health?: DaemonHealth;
884
+ error?: Error;
885
+ startedAt?: Date;
886
+ stoppedAt?: Date;
887
+ }
888
+
889
+ /**
890
+ * User permission level schema
891
+ */
892
+ declare const UserPermissionLevelSchema: z.ZodEnum<["anchor", "trusted", "public"]>;
893
+ type UserPermissionLevel = z.infer<typeof UserPermissionLevelSchema>;
894
+ /**
895
+ * Generic interface for items with visibility
896
+ */
897
+ interface WithVisibility {
898
+ visibility?: UserPermissionLevel;
899
+ }
900
+ /**
901
+ * Permission rule for pattern-based permission matching
902
+ */
903
+ interface PermissionRule {
904
+ pattern: string;
905
+ level: UserPermissionLevel;
906
+ }
907
+ /**
908
+ * Configuration for the permission system
909
+ */
910
+ interface PermissionConfig {
911
+ anchors?: string[];
912
+ trusted?: string[];
913
+ rules?: PermissionRule[];
914
+ }
915
+
916
+ export { BaseMessageSchema, GetRoutePayloadSchema, ListRoutesPayloadSchema, MessageResponseSchema, NavigationSlots, RegisterRoutesPayloadSchema, RouteDefinitionSchema, UnregisterRoutesPayloadSchema, UserPermissionLevelSchema };
917
+ export type { ApiRouteDefinition, BaseMessage, Daemon, DaemonHealth, DaemonInfo, DaemonStatusInfo, EntityDisplayEntry, MessageContext, MessageResponse, MessageSendOptions, MessageSender, MessageWithPayload, NavigationItem, NavigationSlot, PermissionConfig, PermissionRule, RegisteredApiRoute, RegisteredWebRoute, RouteDefinition, RouteDefinitionInput, SectionDefinition, UserPermissionLevel, WebRouteDefinition, WebRouteHandler, WebRouteMethod, WithVisibility };