@rizom/brain 0.2.0-alpha.6 → 0.2.0-alpha.60

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