@milaboratories/pl-model-middle-layer 1.21.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 (42) 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 +402 -914
  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_id.d.ts +4 -4
  14. package/dist/block_meta/block_manifest.cjs +10 -1
  15. package/dist/block_meta/block_manifest.cjs.map +1 -1
  16. package/dist/block_meta/block_manifest.d.ts +1045 -1623
  17. package/dist/block_meta/block_manifest.d.ts.map +1 -1
  18. package/dist/block_meta/block_manifest.js +11 -2
  19. package/dist/block_meta/block_manifest.js.map +1 -1
  20. package/dist/block_meta/block_meta.cjs.map +1 -1
  21. package/dist/block_meta/block_meta.d.ts +164 -246
  22. package/dist/block_meta/block_meta.d.ts.map +1 -1
  23. package/dist/block_meta/block_meta.js.map +1 -1
  24. package/dist/block_meta/content_types.cjs +25 -77
  25. package/dist/block_meta/content_types.cjs.map +1 -1
  26. package/dist/block_meta/content_types.d.ts +71 -387
  27. package/dist/block_meta/content_types.d.ts.map +1 -1
  28. package/dist/block_meta/content_types.js +26 -64
  29. package/dist/block_meta/content_types.js.map +1 -1
  30. package/dist/block_meta/index.d.ts +3 -3
  31. package/dist/block_registry/block_pack_spec.d.ts +16 -16
  32. package/dist/block_registry/overview.d.ts +1534 -1534
  33. package/dist/block_registry/registry_spec.d.ts +12 -12
  34. package/dist/index.cjs +1 -18
  35. package/dist/index.d.ts +4 -4
  36. package/dist/index.js +3 -3
  37. package/package.json +2 -2
  38. package/src/block_meta/block_components.ts +67 -42
  39. package/src/block_meta/block_description.ts +18 -3
  40. package/src/block_meta/block_manifest.ts +14 -3
  41. package/src/block_meta/block_meta.ts +40 -6
  42. package/src/block_meta/content_types.ts +149 -207
@@ -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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8B,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"}
@@ -1,108 +1,56 @@
1
1
  require("../_virtual/_rolldown/runtime.cjs");
2
2
  let zod = require("zod");
3
3
  //#region src/block_meta/content_types.ts
4
- const ContentExplicitString = zod.z.object({
4
+ const absPathRegex = new RegExp(`^(/|[A-Z]:\\\\)`);
5
+ const contentExplicitStringSchema = zod.z.object({
5
6
  type: zod.z.literal("explicit-string"),
6
- content: zod.z.string().describe("Actual string value")
7
+ content: zod.z.string()
7
8
  }).strict();
8
9
  const ContentExplicitBase64 = zod.z.object({
9
10
  type: zod.z.literal("explicit-base64"),
10
- mimeType: zod.z.string().regex(/\w+\/[-+.\w]+/).describe("MIME type to interpret content"),
11
- content: zod.z.string().base64().describe("Base64 encoded binary value")
11
+ mimeType: zod.z.string().regex(/\w+\/[-+.\w]+/),
12
+ content: zod.z.string().base64()
13
+ }).strict();
14
+ const ContentExplicitBytes = zod.z.object({
15
+ type: zod.z.literal("explicit-bytes"),
16
+ mimeType: zod.z.string().regex(/\w+\/[-+.\w]+/),
17
+ content: zod.z.instanceof(Uint8Array)
12
18
  }).strict();
13
19
  const ContentRelative = zod.z.object({
14
20
  type: zod.z.literal("relative"),
15
- path: zod.z.string().describe("Address of the file, in most cases relative to the file which this structure is a part of")
21
+ path: zod.z.string()
16
22
  }).strict();
17
- const absPathRegex = new RegExp(`^(/|[A-Z]:\\\\)`);
18
- const ContentAbsoluteFile = zod.z.object({
23
+ const contentAbsoluteFileSchema = zod.z.object({
19
24
  type: zod.z.literal("absolute-file"),
20
- file: zod.z.string().regex(absPathRegex, "path to file must be absolute").describe("Absolute address of the file in local file system")
21
- }).strict();
22
- const ContentAbsoluteUrl = zod.z.object({
23
- type: zod.z.literal("absolute-url"),
24
- url: zod.z.string().url().describe("Global URL to reach the requested file")
25
+ file: zod.z.string().regex(absPathRegex, "path to file must be absolute")
25
26
  }).strict();
26
- const ContentExplicitBytes = zod.z.object({
27
- type: zod.z.literal("explicit-bytes"),
28
- mimeType: zod.z.string().regex(/\w+\/[-+.\w]+/).describe("MIME type to interpret content"),
29
- content: zod.z.instanceof(Uint8Array).describe("Raw content")
30
- }).strict();
31
- const ContentAbsoluteFolder = zod.z.object({
32
- type: zod.z.literal("absolute-folder"),
33
- folder: zod.z.string().regex(absPathRegex, "path to folder must be absolute").describe("Absolute address of the folder in local file system")
34
- }).strict();
35
- const ContentAny = zod.z.discriminatedUnion("type", [
36
- ContentExplicitString,
37
- ContentExplicitBase64,
38
- ContentRelative,
39
- ContentAbsoluteFile,
40
- ContentAbsoluteUrl
41
- ]);
42
- const ContentExplicitOrRelative = zod.z.discriminatedUnion("type", [
43
- ContentExplicitString,
44
- ContentExplicitBase64,
45
- ContentRelative
46
- ]);
47
- const ContentAnyLocal = zod.z.discriminatedUnion("type", [
48
- ContentExplicitString,
49
- ContentExplicitBase64,
50
- ContentRelative,
51
- ContentAbsoluteFile
52
- ]);
53
- const ContentAnyRemote = zod.z.discriminatedUnion("type", [
54
- ContentExplicitString,
55
- ContentExplicitBase64,
56
- ContentRelative,
57
- ContentAbsoluteUrl
58
- ]);
59
- const ContentAnyBinaryLocal = zod.z.discriminatedUnion("type", [
60
- ContentExplicitBase64,
61
- ContentRelative,
62
- ContentAbsoluteFile
63
- ]);
64
- const ContentAnyTextLocal = zod.z.discriminatedUnion("type", [
65
- ContentExplicitString,
66
- ContentRelative,
67
- ContentAbsoluteFile
68
- ]);
69
- const ContentAbsoluteBinaryRemote = zod.z.discriminatedUnion("type", [ContentExplicitBase64, ContentAbsoluteUrl]);
70
- const ContentAbsoluteBinaryLocal = zod.z.discriminatedUnion("type", [ContentExplicitBase64, ContentAbsoluteFile]);
71
- const ContentAbsoluteTextRemote = zod.z.discriminatedUnion("type", [ContentExplicitString, ContentAbsoluteUrl]);
72
- const ContentAbsoluteTextLocal = zod.z.discriminatedUnion("type", [ContentExplicitString, ContentAbsoluteFile]);
73
27
  const ContentRelativeBinary = zod.z.discriminatedUnion("type", [ContentExplicitBase64, ContentRelative]);
74
- const ContentRelativeText = zod.z.discriminatedUnion("type", [ContentExplicitString, ContentRelative]);
28
+ const ContentRelativeText = zod.z.discriminatedUnion("type", [contentExplicitStringSchema, ContentRelative]);
75
29
  const DescriptionContentBinary = zod.z.union([zod.z.string().startsWith("file:").transform((value) => ({
76
30
  type: "relative",
77
31
  path: value.slice(5)
78
- })), ContentAnyBinaryLocal]);
32
+ })), zod.z.discriminatedUnion("type", [
33
+ ContentExplicitBase64,
34
+ ContentRelative,
35
+ contentAbsoluteFileSchema
36
+ ])]);
79
37
  const DescriptionContentText = zod.z.union([zod.z.string().transform((value) => {
80
38
  if (value.startsWith("file:")) return {
81
39
  type: "relative",
82
40
  path: value.slice(5)
83
41
  };
84
- else return {
42
+ return {
85
43
  type: "explicit-string",
86
44
  content: value
87
45
  };
88
- }), ContentAnyTextLocal]);
46
+ }), zod.z.discriminatedUnion("type", [
47
+ contentExplicitStringSchema,
48
+ ContentRelative,
49
+ contentAbsoluteFileSchema
50
+ ])]);
89
51
  //#endregion
90
- exports.ContentAbsoluteBinaryLocal = ContentAbsoluteBinaryLocal;
91
- exports.ContentAbsoluteBinaryRemote = ContentAbsoluteBinaryRemote;
92
- exports.ContentAbsoluteFile = ContentAbsoluteFile;
93
- exports.ContentAbsoluteFolder = ContentAbsoluteFolder;
94
- exports.ContentAbsoluteTextLocal = ContentAbsoluteTextLocal;
95
- exports.ContentAbsoluteTextRemote = ContentAbsoluteTextRemote;
96
- exports.ContentAbsoluteUrl = ContentAbsoluteUrl;
97
- exports.ContentAny = ContentAny;
98
- exports.ContentAnyBinaryLocal = ContentAnyBinaryLocal;
99
- exports.ContentAnyLocal = ContentAnyLocal;
100
- exports.ContentAnyRemote = ContentAnyRemote;
101
- exports.ContentAnyTextLocal = ContentAnyTextLocal;
102
52
  exports.ContentExplicitBase64 = ContentExplicitBase64;
103
53
  exports.ContentExplicitBytes = ContentExplicitBytes;
104
- exports.ContentExplicitOrRelative = ContentExplicitOrRelative;
105
- exports.ContentExplicitString = ContentExplicitString;
106
54
  exports.ContentRelative = ContentRelative;
107
55
  exports.ContentRelativeBinary = ContentRelativeBinary;
108
56
  exports.ContentRelativeText = ContentRelativeText;
@@ -1 +1 @@
1
- {"version":3,"file":"content_types.cjs","names":["z"],"sources":["../../src/block_meta/content_types.ts"],"sourcesContent":["import { z } from \"zod\";\n\n//\n// Base content types\n//\n\nexport const ContentExplicitString = z\n .object({\n type: z.literal(\"explicit-string\"),\n content: z.string().describe(\"Actual string value\"),\n })\n .strict();\nexport type ContentExplicitString = z.infer<typeof ContentExplicitString>;\n\nexport const ContentExplicitBase64 = z\n .object({\n type: z.literal(\"explicit-base64\"),\n mimeType: z\n .string()\n .regex(/\\w+\\/[-+.\\w]+/)\n .describe(\"MIME type to interpret content\"),\n content: z.string().base64().describe(\"Base64 encoded binary value\"),\n })\n .strict();\nexport type ContentExplicitBase64 = z.infer<typeof ContentExplicitBase64>;\n\nexport const ContentRelative = z\n .object({\n type: z.literal(\"relative\"),\n path: z\n .string()\n .describe(\n \"Address of the file, in most cases relative to the file which this structure is a part of\",\n ),\n })\n .strict();\nexport type ContentRelative = z.infer<typeof ContentRelative>;\n\nconst absPathRegex = new RegExp(`^(/|[A-Z]:\\\\\\\\)`);\n\nexport const ContentAbsoluteFile = z\n .object({\n type: z.literal(\"absolute-file\"),\n file: z\n .string()\n .regex(absPathRegex, \"path to file must be absolute\")\n .describe(\"Absolute address of the file in local file system\"),\n })\n .strict();\nexport type ContentAbsoluteFile = z.infer<typeof ContentAbsoluteFile>;\n\nexport const ContentAbsoluteUrl = z\n .object({\n type: z.literal(\"absolute-url\"),\n url: z.string().url().describe(\"Global URL to reach the requested file\"),\n })\n .strict();\nexport type ContentAbsoluteUrl = z.infer<typeof ContentAbsoluteUrl>;\n\n//\n// Special content types\n//\n\nexport const ContentExplicitBytes = z\n .object({\n type: z.literal(\"explicit-bytes\"),\n mimeType: z\n .string()\n .regex(/\\w+\\/[-+.\\w]+/)\n .describe(\"MIME type to interpret content\"),\n content: z.instanceof(Uint8Array).describe(\"Raw content\"),\n })\n .strict();\nexport type ContentExplicitBytes = z.infer<typeof ContentExplicitBytes>;\n\nexport const ContentAbsoluteFolder = z\n .object({\n type: z.literal(\"absolute-folder\"),\n folder: z\n .string()\n .regex(absPathRegex, \"path to folder must be absolute\")\n .describe(\"Absolute address of the folder in local file system\"),\n })\n .strict();\nexport type ContentAbsoluteFolder = z.infer<typeof ContentAbsoluteFolder>;\n\n//\n// Unions\n//\n\nexport const ContentAny = z.discriminatedUnion(\"type\", [\n ContentExplicitString,\n ContentExplicitBase64,\n ContentRelative,\n ContentAbsoluteFile,\n ContentAbsoluteUrl,\n]);\nexport type ContentAny = z.infer<typeof ContentAny>;\n\nexport const ContentExplicitOrRelative = z.discriminatedUnion(\"type\", [\n ContentExplicitString,\n ContentExplicitBase64,\n ContentRelative,\n]);\nexport type ContentExplicitOrRelative = z.infer<typeof ContentExplicitOrRelative>;\n\nexport const ContentAnyLocal = z.discriminatedUnion(\"type\", [\n ContentExplicitString,\n ContentExplicitBase64,\n ContentRelative,\n ContentAbsoluteFile,\n]);\nexport type ContentAnyLocal = z.infer<typeof ContentAnyLocal>;\n\nexport const ContentAnyRemote = z.discriminatedUnion(\"type\", [\n ContentExplicitString,\n ContentExplicitBase64,\n ContentRelative,\n ContentAbsoluteUrl,\n]);\nexport type ContentAnyRemote = z.infer<typeof ContentAnyRemote>;\n\n//\n// Narrow types with relative option\n//\n\n// export const ContentAnyBinaryRemote = z.discriminatedUnion('type', [\n// ContentExplicitBase64,\n// ContentRelative,\n// ContentAbsoluteUrl\n// ]);\n// export type ContentAnyBinaryRemote = z.infer<typeof ContentAnyBinaryRemote>;\n\nexport const ContentAnyBinaryLocal = z.discriminatedUnion(\"type\", [\n ContentExplicitBase64,\n ContentRelative,\n ContentAbsoluteFile,\n]);\nexport type ContentAnyBinaryLocal = z.infer<typeof ContentAnyBinaryLocal>;\n\n// export const ContentAnyTextRemote = z.discriminatedUnion('type', [\n// ContentExplicitString,\n// ContentRelative,\n// ContentAbsoluteUrl\n// ]);\n// export type ContentAnyTextRemote = z.infer<typeof ContentAnyTextRemote>;\n\nexport const ContentAnyTextLocal = z.discriminatedUnion(\"type\", [\n ContentExplicitString,\n ContentRelative,\n ContentAbsoluteFile,\n]);\nexport type ContentAnyTextLocal = z.infer<typeof ContentAnyTextLocal>;\n\n//\n// Narrow absolute types\n//\n\nexport const ContentAbsoluteBinaryRemote = z.discriminatedUnion(\"type\", [\n ContentExplicitBase64,\n ContentAbsoluteUrl,\n]);\nexport type ContentAbsoluteBinaryRemote = z.infer<typeof ContentAbsoluteBinaryRemote>;\n\nexport const ContentAbsoluteBinaryLocal = z.discriminatedUnion(\"type\", [\n ContentExplicitBase64,\n ContentAbsoluteFile,\n]);\nexport type ContentAbsoluteBinaryLocal = z.infer<typeof ContentAbsoluteBinaryLocal>;\n\nexport const ContentAbsoluteTextRemote = z.discriminatedUnion(\"type\", [\n ContentExplicitString,\n ContentAbsoluteUrl,\n]);\nexport type ContentAbsoluteTextRemote = z.infer<typeof ContentAbsoluteTextRemote>;\n\nexport const ContentAbsoluteTextLocal = z.discriminatedUnion(\"type\", [\n ContentExplicitString,\n ContentAbsoluteFile,\n]);\nexport type ContentAbsoluteTextLocal = z.infer<typeof ContentAbsoluteTextLocal>;\n\n//\n// Narrow relative types\n//\n\nexport const ContentRelativeBinary = z.discriminatedUnion(\"type\", [\n ContentExplicitBase64,\n ContentRelative,\n]);\nexport type ContentRelativeBinary = z.infer<typeof ContentRelativeBinary>;\n\nexport const ContentRelativeText = z.discriminatedUnion(\"type\", [\n ContentExplicitString,\n ContentRelative,\n]);\nexport type ContentRelativeText = z.infer<typeof ContentRelativeText>;\n\n// export function ConstructContent(\n// contentType: 'text',\n// contextType: 'local'\n// ): typeof ContentAnyTextLocal;\n// export function ConstructContent(\n// contentType: 'text',\n// contextType: 'remote'\n// ): typeof ContentAnyTextRemote;\n// export function ConstructContent(\n// contentType: 'binary',\n// contextType: 'local'\n// ): typeof ContentAnyBinaryLocal;\n// export function ConstructContent(\n// contentType: 'binary',\n// contextType: 'remote'\n// ): typeof ContentAnyBinaryRemote;\n// export function ConstructContent(\n// contentType: ContentType,\n// contextType: ContextType\n// ):\n// | typeof ContentAnyTextLocal\n// | typeof ContentAnyTextRemote\n// | typeof ContentAnyBinaryLocal\n// | typeof ContentAnyBinaryRemote;\n// export function ConstructContent(contentType: ContentType, contextType: ContextType) {\n// return contentType === 'text'\n// ? contextType === 'local'\n// ? ContentAnyTextLocal\n// : ContentAnyTextRemote\n// : contextType === 'local'\n// ? ContentAnyBinaryLocal\n// : ContentAnyBinaryRemote;\n// }\n\nexport const DescriptionContentBinary = z.union([\n z\n .string()\n .startsWith(\"file:\")\n .transform<ContentRelativeBinary>((value) => ({ type: \"relative\", path: value.slice(5) })),\n ContentAnyBinaryLocal,\n]);\nexport type DescriptionContentBinary = z.infer<typeof DescriptionContentBinary>;\n\nexport const DescriptionContentText = z.union([\n z.string().transform<ContentRelativeText>((value) => {\n if (value.startsWith(\"file:\")) return { type: \"relative\", path: value.slice(5) };\n else return { type: \"explicit-string\", content: value };\n }),\n ContentAnyTextLocal,\n]);\nexport type DescriptionContentText = z.infer<typeof DescriptionContentText>;\n"],"mappings":";;;AAMA,MAAa,wBAAwBA,IAAAA,EAClC,OAAO;CACN,MAAMA,IAAAA,EAAE,QAAQ,kBAAkB;CAClC,SAASA,IAAAA,EAAE,QAAQ,CAAC,SAAS,sBAAsB;CACpD,CAAC,CACD,QAAQ;AAGX,MAAa,wBAAwBA,IAAAA,EAClC,OAAO;CACN,MAAMA,IAAAA,EAAE,QAAQ,kBAAkB;CAClC,UAAUA,IAAAA,EACP,QAAQ,CACR,MAAM,gBAAgB,CACtB,SAAS,iCAAiC;CAC7C,SAASA,IAAAA,EAAE,QAAQ,CAAC,QAAQ,CAAC,SAAS,8BAA8B;CACrE,CAAC,CACD,QAAQ;AAGX,MAAa,kBAAkBA,IAAAA,EAC5B,OAAO;CACN,MAAMA,IAAAA,EAAE,QAAQ,WAAW;CAC3B,MAAMA,IAAAA,EACH,QAAQ,CACR,SACC,4FACD;CACJ,CAAC,CACD,QAAQ;AAGX,MAAM,eAAe,IAAI,OAAO,kBAAkB;AAElD,MAAa,sBAAsBA,IAAAA,EAChC,OAAO;CACN,MAAMA,IAAAA,EAAE,QAAQ,gBAAgB;CAChC,MAAMA,IAAAA,EACH,QAAQ,CACR,MAAM,cAAc,gCAAgC,CACpD,SAAS,oDAAoD;CACjE,CAAC,CACD,QAAQ;AAGX,MAAa,qBAAqBA,IAAAA,EAC/B,OAAO;CACN,MAAMA,IAAAA,EAAE,QAAQ,eAAe;CAC/B,KAAKA,IAAAA,EAAE,QAAQ,CAAC,KAAK,CAAC,SAAS,yCAAyC;CACzE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wBAAwBA,IAAAA,EAAE,mBAAmB,QAAQ,CAChE,uBACA,gBACD,CAAC;AAGF,MAAa,sBAAsBA,IAAAA,EAAE,mBAAmB,QAAQ,CAC9D,uBACA,gBACD,CAAC;AAqCF,MAAa,2BAA2BA,IAAAA,EAAE,MAAM,CAC9CA,IAAAA,EACG,QAAQ,CACR,WAAW,QAAQ,CACnB,WAAkC,WAAW;CAAE,MAAM;CAAY,MAAM,MAAM,MAAM,EAAE;CAAE,EAAE,EAC5F,sBACD,CAAC;AAGF,MAAa,yBAAyBA,IAAAA,EAAE,MAAM,CAC5CA,IAAAA,EAAE,QAAQ,CAAC,WAAgC,UAAU;AACnD,KAAI,MAAM,WAAW,QAAQ,CAAE,QAAO;EAAE,MAAM;EAAY,MAAM,MAAM,MAAM,EAAE;EAAE;KAC3E,QAAO;EAAE,MAAM;EAAmB,SAAS;EAAO;EACvD,EACF,oBACD,CAAC"}
1
+ {"version":3,"file":"content_types.cjs","names":["z"],"sources":["../../src/block_meta/content_types.ts"],"sourcesContent":["import { z } from \"zod\";\n\n//\n// Canonical content types. TypeScript is the source of truth. The zod\n// schemas below are boundary validators pegged to these types via\n// `satisfies`; they exist only to parse external data (`package.json`,\n// registry manifests, registry overview files).\n//\n\n/** Inlined plain string (e.g. a short text snippet or markdown body). */\nexport type ContentExplicitString = {\n type: \"explicit-string\";\n content: string;\n};\n\n/** Inlined binary blob carried as base64 (e.g. a serialized logo image). */\nexport type ContentExplicitBase64 = {\n type: \"explicit-base64\";\n /** MIME type used to interpret `content`. */\n mimeType: string;\n /** Base64-encoded binary payload. */\n content: string;\n};\n\n/** Inlined binary blob carried as raw bytes. Wire form only; not used in JSON. */\nexport type ContentExplicitBytes = {\n type: \"explicit-bytes\";\n /** MIME type used to interpret `content`. */\n mimeType: string;\n content: Uint8Array;\n};\n\n/** Reference to a file by path relative to the carrying structure. */\nexport type ContentRelative = {\n type: \"relative\";\n path: string;\n};\n\n/** Reference to a file at an absolute local path. */\nexport type ContentAbsoluteFile = {\n type: \"absolute-file\";\n file: string;\n};\n\n/**\n * Reference to a folder at an absolute local path. Used for UI bundles\n * delivered as folders; the desktop \"add block\" dialog reads such folders on\n * demand instead of pulling every UI bundle eagerly.\n */\nexport type ContentAbsoluteFolder = {\n type: \"absolute-folder\";\n folder: string;\n};\n\n/** Reference to a file by remote URL (e.g. served from the registry). */\nexport type ContentAbsoluteUrl = {\n type: \"absolute-url\";\n url: string;\n};\n\n/** Canonical union of every content carrier shape used across the platform. */\nexport type Content =\n | ContentExplicitString\n | ContentExplicitBase64\n | ContentExplicitBytes\n | ContentRelative\n | ContentAbsoluteFile\n | ContentAbsoluteFolder\n | ContentAbsoluteUrl;\n\n//\n// Slot-specific content unions. Each names a set of carriers allowed in a\n// particular stage of the pipeline (boundary input, manifest, resolved).\n//\n\n/** Inlined or relative-path content (text/binary inlined, or relative path). */\nexport type ContentExplicitOrRelative =\n | ContentExplicitString\n | ContentExplicitBase64\n | ContentRelative;\n\n/** Any locally-resolvable content (inlined, relative path, or absolute file). */\nexport type ContentAnyLocal =\n | ContentExplicitString\n | ContentExplicitBase64\n | ContentRelative\n | ContentAbsoluteFile;\n\n/** Text content available locally (inlined, relative path, or absolute file). */\nexport type ContentAnyTextLocal = ContentExplicitString | ContentRelative | ContentAbsoluteFile;\n\n/** Binary content available locally (inlined base64, relative path, or absolute file). */\nexport type ContentAnyBinaryLocal = ContentExplicitBase64 | ContentRelative | ContentAbsoluteFile;\n\n/** Binary content fully resolved (inlined base64 or absolute file). */\nexport type ContentAbsoluteBinaryLocal = ContentExplicitBase64 | ContentAbsoluteFile;\n\n/** Text content fully resolved (inlined string or absolute file). */\nexport type ContentAbsoluteTextLocal = ContentExplicitString | ContentAbsoluteFile;\n\n/** Binary content in manifest form (inlined base64 or path relative to the manifest). */\nexport type ContentRelativeBinary = ContentExplicitBase64 | ContentRelative;\n\n/** Text content in manifest form (inlined string or path relative to the manifest). */\nexport type ContentRelativeText = ContentExplicitString | ContentRelative;\n\n//\n// Zod schemas — boundary validators only. The TS types above are the source\n// of truth; each schema is pegged via `satisfies z.ZodType<T>`. Only the\n// schemas referenced by sibling boundary files (`block_meta.ts`,\n// `block_manifest.ts`) are exported.\n//\n\nconst absPathRegex = new RegExp(`^(/|[A-Z]:\\\\\\\\)`);\n\nconst contentExplicitStringSchema = z\n .object({\n type: z.literal(\"explicit-string\"),\n content: z.string(),\n })\n .strict() satisfies z.ZodType<ContentExplicitString>;\n\nexport const ContentExplicitBase64 = z\n .object({\n type: z.literal(\"explicit-base64\"),\n mimeType: z.string().regex(/\\w+\\/[-+.\\w]+/),\n content: z.string().base64(),\n })\n .strict() satisfies z.ZodType<ContentExplicitBase64>;\n\nexport const ContentExplicitBytes = z\n .object({\n type: z.literal(\"explicit-bytes\"),\n mimeType: z.string().regex(/\\w+\\/[-+.\\w]+/),\n content: z.instanceof(Uint8Array),\n })\n .strict() satisfies z.ZodType<ContentExplicitBytes>;\n\nexport const ContentRelative = z\n .object({\n type: z.literal(\"relative\"),\n path: z.string(),\n })\n .strict() satisfies z.ZodType<ContentRelative>;\n\nconst contentAbsoluteFileSchema = z\n .object({\n type: z.literal(\"absolute-file\"),\n file: z.string().regex(absPathRegex, \"path to file must be absolute\"),\n })\n .strict() satisfies z.ZodType<ContentAbsoluteFile>;\n\nexport const ContentRelativeBinary = z.discriminatedUnion(\"type\", [\n ContentExplicitBase64,\n ContentRelative,\n]) satisfies z.ZodType<ContentRelativeBinary>;\n\nexport const ContentRelativeText = z.discriminatedUnion(\"type\", [\n contentExplicitStringSchema,\n ContentRelative,\n]) satisfies z.ZodType<ContentRelativeText>;\n\n//\n// Boundary normalizing transforms — parse the loose forms authors write in\n// `package.json`. Bare strings with the `file:` prefix become a\n// `ContentRelative`; bare strings without the prefix become a\n// `ContentExplicitString` (text only).\n//\n\nexport const DescriptionContentBinary = z.union([\n z\n .string()\n .startsWith(\"file:\")\n .transform<ContentRelativeBinary>((value) => ({\n type: \"relative\",\n path: value.slice(5),\n })),\n z.discriminatedUnion(\"type\", [ContentExplicitBase64, ContentRelative, contentAbsoluteFileSchema]),\n]) satisfies z.ZodType<ContentAnyBinaryLocal, z.ZodTypeDef, any>;\n\nexport const DescriptionContentText = z.union([\n z.string().transform<ContentRelativeText>((value) => {\n if (value.startsWith(\"file:\")) return { type: \"relative\", path: value.slice(5) };\n return { type: \"explicit-string\", content: value };\n }),\n z.discriminatedUnion(\"type\", [\n contentExplicitStringSchema,\n ContentRelative,\n contentAbsoluteFileSchema,\n ]),\n]) satisfies z.ZodType<ContentAnyTextLocal, z.ZodTypeDef, any>;\n"],"mappings":";;;AAiHA,MAAM,eAAe,IAAI,OAAO,kBAAkB;AAElD,MAAM,8BAA8BA,IAAAA,EACjC,OAAO;CACN,MAAMA,IAAAA,EAAE,QAAQ,kBAAkB;CAClC,SAASA,IAAAA,EAAE,QAAQ;CACpB,CAAC,CACD,QAAQ;AAEX,MAAa,wBAAwBA,IAAAA,EAClC,OAAO;CACN,MAAMA,IAAAA,EAAE,QAAQ,kBAAkB;CAClC,UAAUA,IAAAA,EAAE,QAAQ,CAAC,MAAM,gBAAgB;CAC3C,SAASA,IAAAA,EAAE,QAAQ,CAAC,QAAQ;CAC7B,CAAC,CACD,QAAQ;AAEX,MAAa,uBAAuBA,IAAAA,EACjC,OAAO;CACN,MAAMA,IAAAA,EAAE,QAAQ,iBAAiB;CACjC,UAAUA,IAAAA,EAAE,QAAQ,CAAC,MAAM,gBAAgB;CAC3C,SAASA,IAAAA,EAAE,WAAW,WAAW;CAClC,CAAC,CACD,QAAQ;AAEX,MAAa,kBAAkBA,IAAAA,EAC5B,OAAO;CACN,MAAMA,IAAAA,EAAE,QAAQ,WAAW;CAC3B,MAAMA,IAAAA,EAAE,QAAQ;CACjB,CAAC,CACD,QAAQ;AAEX,MAAM,4BAA4BA,IAAAA,EAC/B,OAAO;CACN,MAAMA,IAAAA,EAAE,QAAQ,gBAAgB;CAChC,MAAMA,IAAAA,EAAE,QAAQ,CAAC,MAAM,cAAc,gC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