@milaboratories/pl-model-middle-layer 1.20.0 → 1.22.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.
Files changed (56) hide show
  1. package/dist/block_meta/block_components.cjs +19 -26
  2. package/dist/block_meta/block_components.cjs.map +1 -1
  3. package/dist/block_meta/block_components.d.ts +46 -428
  4. package/dist/block_meta/block_components.d.ts.map +1 -1
  5. package/dist/block_meta/block_components.js +19 -23
  6. package/dist/block_meta/block_components.js.map +1 -1
  7. package/dist/block_meta/block_description.cjs +5 -3
  8. package/dist/block_meta/block_description.cjs.map +1 -1
  9. package/dist/block_meta/block_description.d.ts +277 -789
  10. package/dist/block_meta/block_description.d.ts.map +1 -1
  11. package/dist/block_meta/block_description.js +5 -3
  12. package/dist/block_meta/block_description.js.map +1 -1
  13. package/dist/block_meta/block_manifest.cjs +10 -1
  14. package/dist/block_meta/block_manifest.cjs.map +1 -1
  15. package/dist/block_meta/block_manifest.d.ts +700 -1278
  16. package/dist/block_meta/block_manifest.d.ts.map +1 -1
  17. package/dist/block_meta/block_manifest.js +11 -2
  18. package/dist/block_meta/block_manifest.js.map +1 -1
  19. package/dist/block_meta/block_meta.cjs.map +1 -1
  20. package/dist/block_meta/block_meta.d.ts +92 -174
  21. package/dist/block_meta/block_meta.d.ts.map +1 -1
  22. package/dist/block_meta/block_meta.js.map +1 -1
  23. package/dist/block_meta/content_types.cjs +25 -77
  24. package/dist/block_meta/content_types.cjs.map +1 -1
  25. package/dist/block_meta/content_types.d.ts +67 -383
  26. package/dist/block_meta/content_types.d.ts.map +1 -1
  27. package/dist/block_meta/content_types.js +26 -64
  28. package/dist/block_meta/content_types.js.map +1 -1
  29. package/dist/block_meta/index.d.ts +3 -3
  30. package/dist/block_registry/block_pack_spec.d.ts +8 -8
  31. package/dist/block_registry/overview.d.ts +200 -200
  32. package/dist/block_registry/registry_spec.d.ts +20 -20
  33. package/dist/index.cjs +1 -18
  34. package/dist/index.d.ts +4 -4
  35. package/dist/index.js +3 -3
  36. package/dist/pframe/internal_api/api_factory.cjs.map +1 -1
  37. package/dist/pframe/internal_api/api_factory.d.ts +36 -2
  38. package/dist/pframe/internal_api/api_factory.d.ts.map +1 -1
  39. package/dist/pframe/internal_api/api_factory.js.map +1 -1
  40. package/dist/pframe/internal_api/api_read.d.ts +40 -3
  41. package/dist/pframe/internal_api/api_read.d.ts.map +1 -1
  42. package/dist/pframe/internal_api/index.d.ts +5 -5
  43. package/dist/pframe/internal_api/pframe.d.ts +21 -3
  44. package/dist/pframe/internal_api/pframe.d.ts.map +1 -1
  45. package/dist/pframe/internal_api/table.d.ts +51 -1
  46. package/dist/pframe/internal_api/table.d.ts.map +1 -1
  47. package/package.json +3 -3
  48. package/src/block_meta/block_components.ts +67 -42
  49. package/src/block_meta/block_description.ts +18 -3
  50. package/src/block_meta/block_manifest.ts +14 -3
  51. package/src/block_meta/block_meta.ts +40 -6
  52. package/src/block_meta/content_types.ts +149 -207
  53. package/src/pframe/internal_api/api_factory.ts +44 -0
  54. package/src/pframe/internal_api/api_read.ts +48 -1
  55. package/src/pframe/internal_api/pframe.ts +23 -2
  56. package/src/pframe/internal_api/table.ts +54 -0
@@ -1,8 +1,46 @@
1
+ import { ContentRelativeBinary, ContentRelativeText } from "./content_types.js";
1
2
  import { z } from "zod";
2
3
 
3
4
  //#region src/block_meta/block_meta.d.ts
4
5
  declare const BlockPlatform: z.ZodEnum<["windows-x64", "windows-aarch64", "macosx-x64", "macosx-aarch64", "linux-x64", "linux-aarch64"]>;
5
6
  type BlockPlatform = z.infer<typeof BlockPlatform>;
7
+ /**
8
+ * Static metadata a block author ships: title, descriptions, logos, social
9
+ * links, and capability requirements. Parameterized by the carriers used for
10
+ * long-string fields (`LongString`) and binary fields (`Binary`); the same
11
+ * shape carries `package.json` form (loose strings), manifest form (relative
12
+ * paths), and embedded form (inlined base64 or bytes).
13
+ *
14
+ * Forward-compatibility: the boundary zod schemas (`BlockPackMeta(...)` and
15
+ * `organization`) use `.passthrough()` so that unknown sibling fields survive
16
+ * parse/round-trip verbatim. A registry mutator that predates a new meta
17
+ * field must not silently strip it (otherwise mark-stable / refresh-overview
18
+ * / restore-overview would quietly undo publishes). Code consuming these
19
+ * objects sees only the known fields listed below; the schemas guard the
20
+ * round-trip behavior. Combined with the `require-latest @platforma-sdk/block-tools`
21
+ * CI gate, this future-proofs every subsequent field addition.
22
+ */
23
+ type BlockPackMeta<LongString, Binary> = {
24
+ title: string;
25
+ description: string;
26
+ longDescription?: LongString;
27
+ changelog?: LongString;
28
+ logo?: Binary;
29
+ url?: string;
30
+ docs?: string;
31
+ support?: string;
32
+ tags?: string[];
33
+ organization: {
34
+ name: string;
35
+ url: string;
36
+ logo?: Binary;
37
+ };
38
+ marketplaceRanking?: number;
39
+ deprecated?: boolean;
40
+ termsOfServiceUrl?: string;
41
+ supportedPlatforms?: BlockPlatform[];
42
+ requiredCapabilities?: string[];
43
+ };
6
44
  declare function BlockPackMeta<const LongStringType extends z.ZodTypeAny, const BinaryType extends z.ZodTypeAny>(longString: LongStringType, binary: BinaryType): z.ZodObject<{
7
45
  title: z.ZodString;
8
46
  description: z.ZodString;
@@ -169,13 +207,7 @@ declare function BlockPackMeta<const LongStringType extends z.ZodTypeAny, const
169
207
  declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
170
208
  title: z.ZodString;
171
209
  description: z.ZodString;
172
- longDescription: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, {
173
- type: "explicit-string";
174
- content: string;
175
- } | {
176
- type: "relative";
177
- path: string;
178
- }, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
210
+ longDescription: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, ContentRelativeText, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
179
211
  type: z.ZodLiteral<"explicit-string">;
180
212
  content: z.ZodString;
181
213
  }, "strict", z.ZodTypeAny, {
@@ -188,11 +220,11 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
188
220
  type: z.ZodLiteral<"relative">;
189
221
  path: z.ZodString;
190
222
  }, "strict", z.ZodTypeAny, {
191
- type: "relative";
192
223
  path: string;
193
- }, {
194
224
  type: "relative";
225
+ }, {
195
226
  path: string;
227
+ type: "relative";
196
228
  }>, z.ZodObject<{
197
229
  type: z.ZodLiteral<"absolute-file">;
198
230
  file: z.ZodString;
@@ -203,13 +235,7 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
203
235
  type: "absolute-file";
204
236
  file: string;
205
237
  }>]>]>>;
206
- changelog: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, {
207
- type: "explicit-string";
208
- content: string;
209
- } | {
210
- type: "relative";
211
- path: string;
212
- }, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
238
+ changelog: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, ContentRelativeText, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
213
239
  type: z.ZodLiteral<"explicit-string">;
214
240
  content: z.ZodString;
215
241
  }, "strict", z.ZodTypeAny, {
@@ -222,11 +248,11 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
222
248
  type: z.ZodLiteral<"relative">;
223
249
  path: z.ZodString;
224
250
  }, "strict", z.ZodTypeAny, {
225
- type: "relative";
226
251
  path: string;
227
- }, {
228
252
  type: "relative";
253
+ }, {
229
254
  path: string;
255
+ type: "relative";
230
256
  }>, z.ZodObject<{
231
257
  type: z.ZodLiteral<"absolute-file">;
232
258
  file: z.ZodString;
@@ -237,14 +263,7 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
237
263
  type: "absolute-file";
238
264
  file: string;
239
265
  }>]>]>>;
240
- logo: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, {
241
- type: "explicit-base64";
242
- mimeType: string;
243
- content: string;
244
- } | {
245
- type: "relative";
246
- path: string;
247
- }, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
266
+ logo: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, ContentRelativeBinary, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
248
267
  type: z.ZodLiteral<"explicit-base64">;
249
268
  mimeType: z.ZodString;
250
269
  content: z.ZodString;
@@ -260,11 +279,11 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
260
279
  type: z.ZodLiteral<"relative">;
261
280
  path: z.ZodString;
262
281
  }, "strict", z.ZodTypeAny, {
263
- type: "relative";
264
282
  path: string;
265
- }, {
266
283
  type: "relative";
284
+ }, {
267
285
  path: string;
286
+ type: "relative";
268
287
  }>, z.ZodObject<{
269
288
  type: z.ZodLiteral<"absolute-file">;
270
289
  file: z.ZodString;
@@ -282,14 +301,7 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
282
301
  organization: z.ZodObject<{
283
302
  name: z.ZodString;
284
303
  url: z.ZodString;
285
- logo: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, {
286
- type: "explicit-base64";
287
- mimeType: string;
288
- content: string;
289
- } | {
290
- type: "relative";
291
- path: string;
292
- }, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
304
+ logo: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, ContentRelativeBinary, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
293
305
  type: z.ZodLiteral<"explicit-base64">;
294
306
  mimeType: z.ZodString;
295
307
  content: z.ZodString;
@@ -305,11 +317,11 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
305
317
  type: z.ZodLiteral<"relative">;
306
318
  path: z.ZodString;
307
319
  }, "strict", z.ZodTypeAny, {
308
- type: "relative";
309
320
  path: string;
310
- }, {
311
321
  type: "relative";
322
+ }, {
312
323
  path: string;
324
+ type: "relative";
313
325
  }>, z.ZodObject<{
314
326
  type: z.ZodLiteral<"absolute-file">;
315
327
  file: z.ZodString;
@@ -323,14 +335,7 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
323
335
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
324
336
  name: z.ZodString;
325
337
  url: z.ZodString;
326
- logo: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, {
327
- type: "explicit-base64";
328
- mimeType: string;
329
- content: string;
330
- } | {
331
- type: "relative";
332
- path: string;
333
- }, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
338
+ logo: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, ContentRelativeBinary, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
334
339
  type: z.ZodLiteral<"explicit-base64">;
335
340
  mimeType: z.ZodString;
336
341
  content: z.ZodString;
@@ -346,11 +351,11 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
346
351
  type: z.ZodLiteral<"relative">;
347
352
  path: z.ZodString;
348
353
  }, "strict", z.ZodTypeAny, {
349
- type: "relative";
350
354
  path: string;
351
- }, {
352
355
  type: "relative";
356
+ }, {
353
357
  path: string;
358
+ type: "relative";
354
359
  }>, z.ZodObject<{
355
360
  type: z.ZodLiteral<"absolute-file">;
356
361
  file: z.ZodString;
@@ -364,14 +369,7 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
364
369
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
365
370
  name: z.ZodString;
366
371
  url: z.ZodString;
367
- logo: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, {
368
- type: "explicit-base64";
369
- mimeType: string;
370
- content: string;
371
- } | {
372
- type: "relative";
373
- path: string;
374
- }, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
372
+ logo: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, ContentRelativeBinary, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
375
373
  type: z.ZodLiteral<"explicit-base64">;
376
374
  mimeType: z.ZodString;
377
375
  content: z.ZodString;
@@ -387,11 +385,11 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
387
385
  type: z.ZodLiteral<"relative">;
388
386
  path: z.ZodString;
389
387
  }, "strict", z.ZodTypeAny, {
390
- type: "relative";
391
388
  path: string;
392
- }, {
393
389
  type: "relative";
390
+ }, {
394
391
  path: string;
392
+ type: "relative";
395
393
  }>, z.ZodObject<{
396
394
  type: z.ZodLiteral<"absolute-file">;
397
395
  file: z.ZodString;
@@ -437,13 +435,7 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
437
435
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
438
436
  title: z.ZodString;
439
437
  description: z.ZodString;
440
- longDescription: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, {
441
- type: "explicit-string";
442
- content: string;
443
- } | {
444
- type: "relative";
445
- path: string;
446
- }, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
438
+ longDescription: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, ContentRelativeText, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
447
439
  type: z.ZodLiteral<"explicit-string">;
448
440
  content: z.ZodString;
449
441
  }, "strict", z.ZodTypeAny, {
@@ -456,11 +448,11 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
456
448
  type: z.ZodLiteral<"relative">;
457
449
  path: z.ZodString;
458
450
  }, "strict", z.ZodTypeAny, {
459
- type: "relative";
460
451
  path: string;
461
- }, {
462
452
  type: "relative";
453
+ }, {
463
454
  path: string;
455
+ type: "relative";
464
456
  }>, z.ZodObject<{
465
457
  type: z.ZodLiteral<"absolute-file">;
466
458
  file: z.ZodString;
@@ -471,13 +463,7 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
471
463
  type: "absolute-file";
472
464
  file: string;
473
465
  }>]>]>>;
474
- changelog: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, {
475
- type: "explicit-string";
476
- content: string;
477
- } | {
478
- type: "relative";
479
- path: string;
480
- }, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
466
+ changelog: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, ContentRelativeText, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
481
467
  type: z.ZodLiteral<"explicit-string">;
482
468
  content: z.ZodString;
483
469
  }, "strict", z.ZodTypeAny, {
@@ -490,11 +476,11 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
490
476
  type: z.ZodLiteral<"relative">;
491
477
  path: z.ZodString;
492
478
  }, "strict", z.ZodTypeAny, {
493
- type: "relative";
494
479
  path: string;
495
- }, {
496
480
  type: "relative";
481
+ }, {
497
482
  path: string;
483
+ type: "relative";
498
484
  }>, z.ZodObject<{
499
485
  type: z.ZodLiteral<"absolute-file">;
500
486
  file: z.ZodString;
@@ -505,14 +491,7 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
505
491
  type: "absolute-file";
506
492
  file: string;
507
493
  }>]>]>>;
508
- logo: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, {
509
- type: "explicit-base64";
510
- mimeType: string;
511
- content: string;
512
- } | {
513
- type: "relative";
514
- path: string;
515
- }, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
494
+ logo: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, ContentRelativeBinary, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
516
495
  type: z.ZodLiteral<"explicit-base64">;
517
496
  mimeType: z.ZodString;
518
497
  content: z.ZodString;
@@ -528,11 +507,11 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
528
507
  type: z.ZodLiteral<"relative">;
529
508
  path: z.ZodString;
530
509
  }, "strict", z.ZodTypeAny, {
531
- type: "relative";
532
510
  path: string;
533
- }, {
534
511
  type: "relative";
512
+ }, {
535
513
  path: string;
514
+ type: "relative";
536
515
  }>, z.ZodObject<{
537
516
  type: z.ZodLiteral<"absolute-file">;
538
517
  file: z.ZodString;
@@ -550,14 +529,7 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
550
529
  organization: z.ZodObject<{
551
530
  name: z.ZodString;
552
531
  url: z.ZodString;
553
- logo: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, {
554
- type: "explicit-base64";
555
- mimeType: string;
556
- content: string;
557
- } | {
558
- type: "relative";
559
- path: string;
560
- }, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
532
+ logo: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, ContentRelativeBinary, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
561
533
  type: z.ZodLiteral<"explicit-base64">;
562
534
  mimeType: z.ZodString;
563
535
  content: z.ZodString;
@@ -573,11 +545,11 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
573
545
  type: z.ZodLiteral<"relative">;
574
546
  path: z.ZodString;
575
547
  }, "strict", z.ZodTypeAny, {
576
- type: "relative";
577
548
  path: string;
578
- }, {
579
549
  type: "relative";
550
+ }, {
580
551
  path: string;
552
+ type: "relative";
581
553
  }>, z.ZodObject<{
582
554
  type: z.ZodLiteral<"absolute-file">;
583
555
  file: z.ZodString;
@@ -591,14 +563,7 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
591
563
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
592
564
  name: z.ZodString;
593
565
  url: z.ZodString;
594
- logo: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, {
595
- type: "explicit-base64";
596
- mimeType: string;
597
- content: string;
598
- } | {
599
- type: "relative";
600
- path: string;
601
- }, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
566
+ logo: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, ContentRelativeBinary, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
602
567
  type: z.ZodLiteral<"explicit-base64">;
603
568
  mimeType: z.ZodString;
604
569
  content: z.ZodString;
@@ -614,11 +579,11 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
614
579
  type: z.ZodLiteral<"relative">;
615
580
  path: z.ZodString;
616
581
  }, "strict", z.ZodTypeAny, {
617
- type: "relative";
618
582
  path: string;
619
- }, {
620
583
  type: "relative";
584
+ }, {
621
585
  path: string;
586
+ type: "relative";
622
587
  }>, z.ZodObject<{
623
588
  type: z.ZodLiteral<"absolute-file">;
624
589
  file: z.ZodString;
@@ -632,14 +597,7 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
632
597
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
633
598
  name: z.ZodString;
634
599
  url: z.ZodString;
635
- logo: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, {
636
- type: "explicit-base64";
637
- mimeType: string;
638
- content: string;
639
- } | {
640
- type: "relative";
641
- path: string;
642
- }, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
600
+ logo: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, ContentRelativeBinary, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
643
601
  type: z.ZodLiteral<"explicit-base64">;
644
602
  mimeType: z.ZodString;
645
603
  content: z.ZodString;
@@ -655,11 +613,11 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
655
613
  type: z.ZodLiteral<"relative">;
656
614
  path: z.ZodString;
657
615
  }, "strict", z.ZodTypeAny, {
658
- type: "relative";
659
616
  path: string;
660
- }, {
661
617
  type: "relative";
618
+ }, {
662
619
  path: string;
620
+ type: "relative";
663
621
  }>, z.ZodObject<{
664
622
  type: z.ZodLiteral<"absolute-file">;
665
623
  file: z.ZodString;
@@ -705,13 +663,7 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
705
663
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
706
664
  title: z.ZodString;
707
665
  description: z.ZodString;
708
- longDescription: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, {
709
- type: "explicit-string";
710
- content: string;
711
- } | {
712
- type: "relative";
713
- path: string;
714
- }, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
666
+ longDescription: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, ContentRelativeText, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
715
667
  type: z.ZodLiteral<"explicit-string">;
716
668
  content: z.ZodString;
717
669
  }, "strict", z.ZodTypeAny, {
@@ -724,11 +676,11 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
724
676
  type: z.ZodLiteral<"relative">;
725
677
  path: z.ZodString;
726
678
  }, "strict", z.ZodTypeAny, {
727
- type: "relative";
728
679
  path: string;
729
- }, {
730
680
  type: "relative";
681
+ }, {
731
682
  path: string;
683
+ type: "relative";
732
684
  }>, z.ZodObject<{
733
685
  type: z.ZodLiteral<"absolute-file">;
734
686
  file: z.ZodString;
@@ -739,13 +691,7 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
739
691
  type: "absolute-file";
740
692
  file: string;
741
693
  }>]>]>>;
742
- changelog: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, {
743
- type: "explicit-string";
744
- content: string;
745
- } | {
746
- type: "relative";
747
- path: string;
748
- }, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
694
+ changelog: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, ContentRelativeText, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
749
695
  type: z.ZodLiteral<"explicit-string">;
750
696
  content: z.ZodString;
751
697
  }, "strict", z.ZodTypeAny, {
@@ -758,11 +704,11 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
758
704
  type: z.ZodLiteral<"relative">;
759
705
  path: z.ZodString;
760
706
  }, "strict", z.ZodTypeAny, {
761
- type: "relative";
762
707
  path: string;
763
- }, {
764
708
  type: "relative";
709
+ }, {
765
710
  path: string;
711
+ type: "relative";
766
712
  }>, z.ZodObject<{
767
713
  type: z.ZodLiteral<"absolute-file">;
768
714
  file: z.ZodString;
@@ -773,14 +719,7 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
773
719
  type: "absolute-file";
774
720
  file: string;
775
721
  }>]>]>>;
776
- logo: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, {
777
- type: "explicit-base64";
778
- mimeType: string;
779
- content: string;
780
- } | {
781
- type: "relative";
782
- path: string;
783
- }, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
722
+ logo: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, ContentRelativeBinary, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
784
723
  type: z.ZodLiteral<"explicit-base64">;
785
724
  mimeType: z.ZodString;
786
725
  content: z.ZodString;
@@ -796,11 +735,11 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
796
735
  type: z.ZodLiteral<"relative">;
797
736
  path: z.ZodString;
798
737
  }, "strict", z.ZodTypeAny, {
799
- type: "relative";
800
738
  path: string;
801
- }, {
802
739
  type: "relative";
740
+ }, {
803
741
  path: string;
742
+ type: "relative";
804
743
  }>, z.ZodObject<{
805
744
  type: z.ZodLiteral<"absolute-file">;
806
745
  file: z.ZodString;
@@ -818,14 +757,7 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
818
757
  organization: z.ZodObject<{
819
758
  name: z.ZodString;
820
759
  url: z.ZodString;
821
- logo: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, {
822
- type: "explicit-base64";
823
- mimeType: string;
824
- content: string;
825
- } | {
826
- type: "relative";
827
- path: string;
828
- }, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
760
+ logo: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, ContentRelativeBinary, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
829
761
  type: z.ZodLiteral<"explicit-base64">;
830
762
  mimeType: z.ZodString;
831
763
  content: z.ZodString;
@@ -841,11 +773,11 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
841
773
  type: z.ZodLiteral<"relative">;
842
774
  path: z.ZodString;
843
775
  }, "strict", z.ZodTypeAny, {
844
- type: "relative";
845
776
  path: string;
846
- }, {
847
777
  type: "relative";
778
+ }, {
848
779
  path: string;
780
+ type: "relative";
849
781
  }>, z.ZodObject<{
850
782
  type: z.ZodLiteral<"absolute-file">;
851
783
  file: z.ZodString;
@@ -859,14 +791,7 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
859
791
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
860
792
  name: z.ZodString;
861
793
  url: z.ZodString;
862
- logo: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, {
863
- type: "explicit-base64";
864
- mimeType: string;
865
- content: string;
866
- } | {
867
- type: "relative";
868
- path: string;
869
- }, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
794
+ logo: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, ContentRelativeBinary, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
870
795
  type: z.ZodLiteral<"explicit-base64">;
871
796
  mimeType: z.ZodString;
872
797
  content: z.ZodString;
@@ -882,11 +807,11 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
882
807
  type: z.ZodLiteral<"relative">;
883
808
  path: z.ZodString;
884
809
  }, "strict", z.ZodTypeAny, {
885
- type: "relative";
886
810
  path: string;
887
- }, {
888
811
  type: "relative";
812
+ }, {
889
813
  path: string;
814
+ type: "relative";
890
815
  }>, z.ZodObject<{
891
816
  type: z.ZodLiteral<"absolute-file">;
892
817
  file: z.ZodString;
@@ -900,14 +825,7 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
900
825
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
901
826
  name: z.ZodString;
902
827
  url: z.ZodString;
903
- logo: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, {
904
- type: "explicit-base64";
905
- mimeType: string;
906
- content: string;
907
- } | {
908
- type: "relative";
909
- path: string;
910
- }, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
828
+ logo: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, ContentRelativeBinary, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
911
829
  type: z.ZodLiteral<"explicit-base64">;
912
830
  mimeType: z.ZodString;
913
831
  content: z.ZodString;
@@ -923,11 +841,11 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
923
841
  type: z.ZodLiteral<"relative">;
924
842
  path: z.ZodString;
925
843
  }, "strict", z.ZodTypeAny, {
926
- type: "relative";
927
844
  path: string;
928
- }, {
929
845
  type: "relative";
846
+ }, {
930
847
  path: string;
848
+ type: "relative";
931
849
  }>, z.ZodObject<{
932
850
  type: z.ZodLiteral<"absolute-file">;
933
851
  file: z.ZodString;
@@ -1 +1 @@
1
- {"version":3,"file":"block_meta.d.ts","names":[],"sources":["../../src/block_meta/block_meta.ts"],"mappings":";;;cAQa,aAAA,EAAa,CAAA,CAAA,OAAA;AAAA,KAQd,aAAA,GAAgB,CAAA,CAAE,KAAA,QAAa,aAAA;AAAA,iBAE3B,aAAA,8BACe,CAAA,CAAE,UAAA,2BACN,CAAA,CAAE,UAAA,CAAA,CAC3B,UAAA,EAAY,cAAA,EAAgB,MAAA,EAAQ,UAAA,GAAU,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA4DnC,2BAAA,EAA2B,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAC5B,2BAAA,GAA8B,CAAA,CAAE,KAAA,QAAa,2BAAA;AAAA,cAE5C,0BAAA,EAA0B,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAC3B,0BAAA,GAA6B,CAAA,CAAE,KAAA,QAAa,0BAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"block_meta.js","names":[],"sources":["../../src/block_meta/block_meta.ts"],"sourcesContent":["import { z } from \"zod\";\nimport {\n ContentExplicitBase64,\n ContentExplicitBytes,\n DescriptionContentBinary,\n DescriptionContentText,\n} from \"./content_types\";\n\nexport const BlockPlatform = z.enum([\n \"windows-x64\",\n \"windows-aarch64\",\n \"macosx-x64\",\n \"macosx-aarch64\",\n \"linux-x64\",\n \"linux-aarch64\",\n]);\nexport type BlockPlatform = z.infer<typeof BlockPlatform>;\n\nexport function BlockPackMeta<\n const LongStringType extends z.ZodTypeAny,\n const BinaryType extends z.ZodTypeAny,\n>(longString: LongStringType, binary: BinaryType) {\n return z\n .object({\n title: z.string(),\n description: z.string(),\n longDescription: longString.optional(),\n changelog: longString.optional(),\n logo: binary.optional(),\n url: z.string().url().optional(),\n docs: z.string().url().optional(),\n support: z.union([z.string().url(), z.string().email()]).optional(),\n tags: z.array(z.string()).optional(),\n organization: z\n .object({\n name: z.string(),\n url: z.string().url(),\n logo: binary.optional(),\n })\n .passthrough(),\n /**\n * The order of blocks on the \"marketplace\" (higher values push block higher to the top of the list).\n * `undefined` value or absent field is treated exactly the same as number `0`.\n */\n marketplaceRanking: z.number().optional(),\n /**\n * If true, the block is deprecated and should not be used.\n */\n deprecated: z.boolean().optional(),\n /**\n * The URL to the Terms of Service for the block. If provided checkbox with link to this URL should be shown in order to add block.\n */\n termsOfServiceUrl: z.string().url().optional(),\n /**\n * Supported operating systems.\n * If not provided, the block is supported on all operating systems.\n */\n supportedPlatforms: z.array(BlockPlatform).optional(),\n /**\n * Runtime capabilities the block needs from the backend (e.g.\n * \"wasm:v1\"). Desktop refuses to install if any listed token is\n * missing from the backend's `serverInfo.capabilities`.\n *\n * Tokens follow the backend's `<feature>:<version>` format defined in\n * `core/pl/platform/api/plapiserver/server_capabilities.go`. The\n * schema itself accepts loose strings (not an enum) so future\n * capabilities don't break Desktops that ship before each token is\n * added — the same forward-compat property `BlockPackMeta` itself\n * enjoys at the field level, applied recursively at the token level.\n */\n requiredCapabilities: z.array(z.string()).optional(),\n })\n .passthrough();\n // `.passthrough()` preserves unknown sibling keys through `parse`/round-trip.\n // Without it, a block-tools version that predates a newly-added meta field\n // would strip that field on every registry-mutating command (mark-stable,\n // refresh-registry, restore-overview-from-snapshot) — silently undoing\n // publishes. Combined with the `require-latest @platforma-sdk/block-tools`\n // CI gate, this future-proofs the schema for all subsequent field additions.\n}\n\nexport const BlockPackMetaDescriptionRaw = BlockPackMeta(\n DescriptionContentText,\n DescriptionContentBinary,\n);\nexport type BlockPackMetaDescriptionRaw = z.infer<typeof BlockPackMetaDescriptionRaw>;\n\nexport const BlockPackMetaEmbeddedBase64 = BlockPackMeta(z.string(), ContentExplicitBase64);\nexport type BlockPackMetaEmbeddedBase64 = z.infer<typeof BlockPackMetaEmbeddedBase64>;\n\nexport const BlockPackMetaEmbeddedBytes = BlockPackMeta(z.string(), ContentExplicitBytes);\nexport type BlockPackMetaEmbeddedBytes = z.infer<typeof BlockPackMetaEmbeddedBytes>;\n"],"mappings":";;;AAQA,MAAa,gBAAgB,EAAE,KAAK;CAClC;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;AAGF,SAAgB,cAGd,YAA4B,QAAoB;AAChD,QAAO,EACJ,OAAO;EACN,OAAO,EAAE,QAAQ;EACjB,aAAa,EAAE,QAAQ;EACvB,iBAAiB,WAAW,UAAU;EACtC,WAAW,WAAW,UAAU;EAChC,MAAM,OAAO,UAAU;EACvB,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU;EAChC,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU;EACjC,SAAS,EAAE,MAAM,CAAC,EAAE,QAAQ,CAAC,KAAK,EAAE,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU;EACnE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,UAAU;EACpC,cAAc,EACX,OAAO;GACN,MAAM,EAAE,QAAQ;GAChB,KAAK,EAAE,QAAQ,CAAC,KAAK;GACrB,MAAM,OAAO,UAAU;GACxB,CAAC,CACD,aAAa;EAKhB,oBAAoB,EAAE,QAAQ,CAAC,UAAU;EAIzC,YAAY,EAAE,SAAS,CAAC,UAAU;EAIlC,mBAAmB,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU;EAK9C,oBAAoB,EAAE,MAAM,cAAc,CAAC,UAAU;EAarD,sBAAsB,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,UAAU;EACrD,CAAC,CACD,aAAa;;AASlB,MAAa,8BAA8B,cACzC,wBACA,yBACD;AAGD,MAAa,8BAA8B,cAAc,EAAE,QAAQ,EAAE,sBAAsB;AAG3F,MAAa,6BAA6B,cAAc,EAAE,QAAQ,EAAE,qBAAqB"}
1
+ {"version":3,"file":"block_meta.js","names":[],"sources":["../../src/block_meta/block_meta.ts"],"sourcesContent":["import { z } from \"zod\";\nimport {\n ContentExplicitBase64,\n ContentExplicitBytes,\n DescriptionContentBinary,\n DescriptionContentText,\n} from \"./content_types\";\n\nexport const BlockPlatform = z.enum([\n \"windows-x64\",\n \"windows-aarch64\",\n \"macosx-x64\",\n \"macosx-aarch64\",\n \"linux-x64\",\n \"linux-aarch64\",\n]);\nexport type BlockPlatform = z.infer<typeof BlockPlatform>;\n\n/**\n * Static metadata a block author ships: title, descriptions, logos, social\n * links, and capability requirements. Parameterized by the carriers used for\n * long-string fields (`LongString`) and binary fields (`Binary`); the same\n * shape carries `package.json` form (loose strings), manifest form (relative\n * paths), and embedded form (inlined base64 or bytes).\n *\n * Forward-compatibility: the boundary zod schemas (`BlockPackMeta(...)` and\n * `organization`) use `.passthrough()` so that unknown sibling fields survive\n * parse/round-trip verbatim. A registry mutator that predates a new meta\n * field must not silently strip it (otherwise mark-stable / refresh-overview\n * / restore-overview would quietly undo publishes). Code consuming these\n * objects sees only the known fields listed below; the schemas guard the\n * round-trip behavior. Combined with the `require-latest @platforma-sdk/block-tools`\n * CI gate, this future-proofs every subsequent field addition.\n */\nexport type BlockPackMeta<LongString, Binary> = {\n title: string;\n description: string;\n longDescription?: LongString;\n changelog?: LongString;\n logo?: Binary;\n url?: string;\n docs?: string;\n support?: string;\n tags?: string[];\n organization: {\n name: string;\n url: string;\n logo?: Binary;\n };\n marketplaceRanking?: number;\n deprecated?: boolean;\n termsOfServiceUrl?: string;\n supportedPlatforms?: BlockPlatform[];\n requiredCapabilities?: string[];\n};\n\nexport function BlockPackMeta<\n const LongStringType extends z.ZodTypeAny,\n const BinaryType extends z.ZodTypeAny,\n>(longString: LongStringType, binary: BinaryType) {\n return z\n .object({\n title: z.string(),\n description: z.string(),\n longDescription: longString.optional(),\n changelog: longString.optional(),\n logo: binary.optional(),\n url: z.string().url().optional(),\n docs: z.string().url().optional(),\n support: z.union([z.string().url(), z.string().email()]).optional(),\n tags: z.array(z.string()).optional(),\n organization: z\n .object({\n name: z.string(),\n url: z.string().url(),\n logo: binary.optional(),\n })\n .passthrough(),\n /**\n * The order of blocks on the \"marketplace\" (higher values push block higher to the top of the list).\n * `undefined` value or absent field is treated exactly the same as number `0`.\n */\n marketplaceRanking: z.number().optional(),\n /**\n * If true, the block is deprecated and should not be used.\n */\n deprecated: z.boolean().optional(),\n /**\n * The URL to the Terms of Service for the block. If provided checkbox with link to this URL should be shown in order to add block.\n */\n termsOfServiceUrl: z.string().url().optional(),\n /**\n * Supported operating systems.\n * If not provided, the block is supported on all operating systems.\n */\n supportedPlatforms: z.array(BlockPlatform).optional(),\n /**\n * Runtime capabilities the block needs from the backend (e.g.\n * \"wasm:v1\"). Desktop refuses to install if any listed token is\n * missing from the backend's `serverInfo.capabilities`.\n *\n * Tokens follow the backend's `<feature>:<version>` format defined in\n * `core/pl/platform/api/plapiserver/server_capabilities.go`. The\n * schema itself accepts loose strings (not an enum) so future\n * capabilities don't break Desktops that ship before each token is\n * added — the same forward-compat property `BlockPackMeta` itself\n * enjoys at the field level, applied recursively at the token level.\n */\n requiredCapabilities: z.array(z.string()).optional(),\n })\n .passthrough();\n // `.passthrough()` is intentional — see forward-compat note on\n // `BlockPackMeta` type above.\n}\n\nexport const BlockPackMetaDescriptionRaw = BlockPackMeta(\n DescriptionContentText,\n DescriptionContentBinary,\n);\nexport type BlockPackMetaDescriptionRaw = z.infer<typeof BlockPackMetaDescriptionRaw>;\n\nexport const BlockPackMetaEmbeddedBase64 = BlockPackMeta(z.string(), ContentExplicitBase64);\nexport type BlockPackMetaEmbeddedBase64 = z.infer<typeof BlockPackMetaEmbeddedBase64>;\n\nexport const BlockPackMetaEmbeddedBytes = BlockPackMeta(z.string(), ContentExplicitBytes);\nexport type BlockPackMetaEmbeddedBytes = z.infer<typeof BlockPackMetaEmbeddedBytes>;\n"],"mappings":";;;AAQA,MAAa,gBAAgB,EAAE,KAAK;CAClC;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;AAyCF,SAAgB,cAGd,YAA4B,QAAoB;AAChD,QAAO,EACJ,OAAO;EACN,OAAO,EAAE,QAAQ;EACjB,aAAa,EAAE,QAAQ;EACvB,iBAAiB,WAAW,UAAU;EACtC,WAAW,WAAW,UAAU;EAChC,MAAM,OAAO,UAAU;EACvB,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU;EAChC,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU;EACjC,SAAS,EAAE,MAAM,CAAC,EAAE,QAAQ,CAAC,KAAK,EAAE,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU;EACnE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,UAAU;EACpC,cAAc,EACX,OAAO;GACN,MAAM,EAAE,QAAQ;GAChB,KAAK,EAAE,QAAQ,CAAC,KAAK;GACrB,MAAM,OAAO,UAAU;GACxB,CAAC,CACD,aAAa;EAKhB,oBAAoB,EAAE,QAAQ,CAAC,UAAU;EAIzC,YAAY,EAAE,SAAS,CAAC,UAAU;EAIlC,mBAAmB,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU;EAK9C,oBAAoB,EAAE,MAAM,cAAc,CAAC,UAAU;EAarD,sBAAsB,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,UAAU;EACrD,CAAC,CACD,aAAa;;AAKlB,MAAa,8BAA8B,cACzC,wBACA,yBACD;AAGD,MAAa,8BAA8B,cAAc,EAAE,QAAQ,EAAE,sBAAsB;AAG3F,MAAa,6BAA6B,cAAc,EAAE,QAAQ,EAAE,qBAAqB"}