@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 +1 @@
1
- {"version":3,"file":"block_description.d.ts","names":[],"sources":["../../src/block_meta/block_description.ts"],"mappings":";;;;;;AAWA;;cAAa,sCAAA,EAAsC,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAIxB,uBAAA,GAA0B,CAAA,CAAE,KAAA,QAAa,uBAAA;AAAA,iBAErC,0BAAA;EAAuC,EAAA,EAAI,WAAA;AAAA,EAAA,CACzD,QAAA,EAAU,CAAA,EACV,UAAA,WACC,CAAA"}
@@ -4,9 +4,11 @@ import { BlockPackMetaDescriptionRaw } from "./block_meta.js";
4
4
  import { z } from "zod";
5
5
  import { toMerged } from "es-toolkit";
6
6
  //#region src/block_meta/block_description.ts
7
- /** Description, as appears in root block package.json file,
8
- * `file:` references are parsed into relative content of corresponding type, depending on the context,
9
- * strings are converted to explicit content type. */
7
+ /**
8
+ * Description as it appears in the root block `package.json`. `file:`-prefixed
9
+ * strings become `ContentRelative`; bare text strings become
10
+ * `ContentExplicitString`. See `DescriptionContentText`/`DescriptionContentBinary`.
11
+ */
10
12
  const BlockPackDescriptionFromPackageJsonRaw = z.object({
11
13
  components: BlockComponentsDescriptionRaw,
12
14
  meta: BlockPackMetaDescriptionRaw
@@ -1 +1 @@
1
- {"version":3,"file":"block_description.js","names":[],"sources":["../../src/block_meta/block_description.ts"],"sourcesContent":["import type { ZodTypeAny } from \"zod\";\nimport { z } from \"zod\";\nimport { BlockComponentsDescriptionRaw } from \"./block_components\";\nimport { BlockPackMetaDescriptionRaw } from \"./block_meta\";\nimport { BlockPackId } from \"./block_id\";\nimport { toMerged } from \"es-toolkit\";\nimport type { BlockCodeKnownFeatureFlags } from \"@milaboratories/pl-model-common\";\n\n/** Description, as appears in root block package.json file,\n * `file:` references are parsed into relative content of corresponding type, depending on the context,\n * strings are converted to explicit content type. */\nexport const BlockPackDescriptionFromPackageJsonRaw = z.object({\n components: BlockComponentsDescriptionRaw,\n meta: BlockPackMetaDescriptionRaw,\n});\n\nexport const FeatureFlags = z\n .record(z.string(), z.union([z.boolean(), z.number()]))\n .transform((flags) => flags as BlockCodeKnownFeatureFlags);\n\nexport function CreateBlockPackDescriptionSchema<\n Components extends ZodTypeAny,\n Meta extends ZodTypeAny,\n>(components: Components, meta: Meta) {\n return z\n .object({\n id: BlockPackId,\n components,\n meta,\n featureFlags: FeatureFlags.optional(),\n })\n .passthrough();\n}\n\nexport const BlockPackDescriptionRaw = CreateBlockPackDescriptionSchema(\n BlockComponentsDescriptionRaw,\n BlockPackMetaDescriptionRaw,\n);\nexport type BlockPackDescriptionRaw = z.infer<typeof BlockPackDescriptionRaw>;\n\nexport function overrideDescriptionVersion<T extends { id: BlockPackId }>(\n manifest: T,\n newVersion: string,\n): T {\n return toMerged(manifest, { id: { version: newVersion } }) as T;\n}\n"],"mappings":";;;;;;;;;AAWA,MAAa,yCAAyC,EAAE,OAAO;CAC7D,YAAY;CACZ,MAAM;CACP,CAAC;AAEF,MAAa,eAAe,EACzB,OAAO,EAAE,QAAQ,EAAE,EAAE,MAAM,CAAC,EAAE,SAAS,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC,CACtD,WAAW,UAAU,MAAoC;AAE5D,SAAgB,iCAGd,YAAwB,MAAY;AACpC,QAAO,EACJ,OAAO;EACN,IAAI;EACJ;EACA;EACA,cAAc,aAAa,UAAU;EACtC,CAAC,CACD,aAAa;;AAGlB,MAAa,0BAA0B,iCACrC,+BACA,4BACD;AAGD,SAAgB,2BACd,UACA,YACG;AACH,QAAO,SAAS,UAAU,EAAE,IAAI,EAAE,SAAS,YAAY,EAAE,CAAC"}
1
+ {"version":3,"file":"block_description.js","names":[],"sources":["../../src/block_meta/block_description.ts"],"sourcesContent":["import type { ZodTypeAny } from \"zod\";\nimport { z } from \"zod\";\nimport { BlockComponentsDescriptionRaw } from \"./block_components\";\nimport { BlockPackMetaDescriptionRaw } from \"./block_meta\";\nimport { BlockPackId } from \"./block_id\";\nimport { toMerged } from \"es-toolkit\";\nimport type { BlockCodeKnownFeatureFlags } from \"@milaboratories/pl-model-common\";\n\n/**\n * Block-pack description: a `BlockPackId`, the typed `components` and `meta`\n * payloads, and optional `featureFlags`. The two type parameters let the same\n * shape carry every form a description travels in — `package.json` source,\n * relative-path manifest, absolute-path resolved.\n */\nexport type BlockPackDescription<Components, Meta> = {\n id: BlockPackId;\n components: Components;\n meta: Meta;\n featureFlags?: BlockCodeKnownFeatureFlags;\n};\n\n/**\n * Description as it appears in the root block `package.json`. `file:`-prefixed\n * strings become `ContentRelative`; bare text strings become\n * `ContentExplicitString`. See `DescriptionContentText`/`DescriptionContentBinary`.\n */\nexport const BlockPackDescriptionFromPackageJsonRaw = z.object({\n components: BlockComponentsDescriptionRaw,\n meta: BlockPackMetaDescriptionRaw,\n});\n\nexport const FeatureFlags = z\n .record(z.string(), z.union([z.boolean(), z.number()]))\n .transform((flags) => flags as BlockCodeKnownFeatureFlags);\n\nexport function CreateBlockPackDescriptionSchema<\n Components extends ZodTypeAny,\n Meta extends ZodTypeAny,\n>(components: Components, meta: Meta) {\n return z\n .object({\n id: BlockPackId,\n components,\n meta,\n featureFlags: FeatureFlags.optional(),\n })\n .passthrough();\n}\n\nexport const BlockPackDescriptionRaw = CreateBlockPackDescriptionSchema(\n BlockComponentsDescriptionRaw,\n BlockPackMetaDescriptionRaw,\n);\nexport type BlockPackDescriptionRaw = z.infer<typeof BlockPackDescriptionRaw>;\n\nexport function overrideDescriptionVersion<T extends { id: BlockPackId }>(\n manifest: T,\n newVersion: string,\n): T {\n return toMerged(manifest, { id: { version: newVersion } }) as T;\n}\n"],"mappings":";;;;;;;;;;;AA0BA,MAAa,yCAAyC,EAAE,OAAO;CAC7D,YAAY;CACZ,MAAM;CACP,CAAC;AAEF,MAAa,eAAe,EACzB,OAAO,EAAE,QAAQ,EAAE,EAAE,MAAM,CAAC,EAAE,SAAS,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC,CACtD,WAAW,UAAU,MAAoC;AAE5D,SAAgB,iCAGd,YAAwB,MAAY;AACpC,QAAO,EACJ,OAAO;EACN,IAAI;EACJ;EACA;EACA,cAAc,aAAa,UAAU;EACtC,CAAC,CACD,aAAa;;AAGlB,MAAa,0BAA0B,iCACrC,+BACA,4BACD;AAGD,SAAgB,2BACd,UACA,YACG;AACH,QAAO,SAAS,UAAU,EAAE,IAAI,EAAE,SAAS,YAAY,EAAE,CAAC"}
@@ -6,7 +6,16 @@ const require_block_description = require("./block_description.cjs");
6
6
  let zod = require("zod");
7
7
  let es_toolkit = require("es-toolkit");
8
8
  //#region src/block_meta/block_manifest.ts
9
- const BlockComponentsManifest = require_block_components.BlockComponents(require_content_types.ContentRelative, require_content_types.ContentRelative);
9
+ /**
10
+ * Block-components shape stored in a manifest. The consolidator always writes
11
+ * the wrapped `{type: "workflow-v1", main: ...}` form, so the manifest schema
12
+ * accepts the wrapped form only.
13
+ */
14
+ const BlockComponentsManifest = zod.z.object({
15
+ workflow: require_block_components.WorkflowSchemaV1(require_content_types.ContentRelative),
16
+ model: require_content_types.ContentRelative,
17
+ ui: require_content_types.ContentRelative
18
+ });
10
19
  const BlockPackMetaManifest = require_block_meta.BlockPackMeta(require_content_types.ContentRelativeText, require_content_types.ContentRelativeBinary);
11
20
  /** Block description to be used in block manifest */
12
21
  const BlockPackDescriptionManifest = require_block_description.CreateBlockPackDescriptionSchema(BlockComponentsManifest, BlockPackMetaManifest);
@@ -1 +1 @@
1
- {"version":3,"file":"block_manifest.cjs","names":["BlockComponents","ContentRelative","BlockPackMeta","ContentRelativeText","ContentRelativeBinary","CreateBlockPackDescriptionSchema","z"],"sources":["../../src/block_meta/block_manifest.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { BlockComponents } from \"./block_components\";\nimport { ContentRelative, ContentRelativeBinary, ContentRelativeText } from \"./content_types\";\nimport { CreateBlockPackDescriptionSchema } from \"./block_description\";\nimport { BlockPackMeta } from \"./block_meta\";\nimport { toMerged } from \"es-toolkit\";\nimport type { BlockPackId } from \"./block_id\";\n\nexport const BlockComponentsManifest = BlockComponents(ContentRelative, ContentRelative);\nexport type BlockComponentsManifest = z.infer<typeof BlockComponentsManifest>;\n\nexport const BlockPackMetaManifest = BlockPackMeta(ContentRelativeText, ContentRelativeBinary);\nexport type BlockPackMetaManifest = z.infer<typeof BlockPackMetaManifest>;\n\n/** Block description to be used in block manifest */\nexport const BlockPackDescriptionManifest = CreateBlockPackDescriptionSchema(\n BlockComponentsManifest,\n BlockPackMetaManifest,\n);\nexport type BlockPackDescriptionManifest = z.infer<typeof BlockPackDescriptionManifest>;\n\nexport const Sha256Schema = z\n .string()\n .regex(/[0-9a-fA-F]/)\n .toUpperCase()\n .length(64); // 256 / 4 (bits per hex register);\n\nexport const ManifestFileInfo = z.object({\n name: z.string(),\n size: z.number().int(),\n sha256: Sha256Schema,\n});\nexport type ManifestFileInfo = z.infer<typeof ManifestFileInfo>;\n\nexport const BlockPackManifest = z\n .object({\n schema: z.literal(\"v2\"),\n description: BlockPackDescriptionManifest,\n timestamp: z.number().optional(),\n files: z.array(ManifestFileInfo),\n })\n .passthrough();\nexport type BlockPackManifest = z.infer<typeof BlockPackManifest>;\n\nexport const BlockPackManifestFile = \"manifest.json\";\n\nexport function overrideManifestVersion<T extends { description: { id: BlockPackId } }>(\n manifest: T,\n newVersion: string,\n): T {\n return toMerged(manifest, { description: { id: { version: newVersion } } }) as T;\n}\n"],"mappings":";;;;;;;;AAQA,MAAa,0BAA0BA,yBAAAA,gBAAgBC,sBAAAA,iBAAiBA,sBAAAA,gBAAgB;AAGxF,MAAa,wBAAwBC,mBAAAA,cAAcC,sBAAAA,qBAAqBC,sBAAAA,sBAAsB;;AAI9F,MAAa,+BAA+BC,0BAAAA,iCAC1C,yBACA,sBACD;AAGD,MAAa,eAAeC,IAAAA,EACzB,QAAQ,CACR,MAAM,cAAc,CACpB,aAAa,CACb,OAAO,GAAG;AAEb,MAAa,mBAAmBA,IAAAA,EAAE,OAAO;CACvC,MAAMA,IAAAA,EAAE,QAAQ;CAChB,MAAMA,IAAAA,EAAE,QAAQ,CAAC,KAAK;CACtB,QAAQ;CACT,CAAC;AAGF,MAAa,oBAAoBA,IAAAA,EAC9B,OAAO;CACN,QAAQA,IAAAA,EAAE,QAAQ,KAAK;CACvB,aAAa;CACb,WAAWA,IAAAA,EAAE,QAAQ,CAAC,UAAU;CAChC,OAAOA,IAAAA,EAAE,MAAM,iBAAiB;CACjC,CAAC,CACD,aAAa;AAGhB,MAAa,wBAAwB;AAErC,SAAgB,wBACd,UACA,YACG;AACH,SAAA,GAAA,WAAA,UAAgB,UAAU,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,YAAY,EAAE,EAAE,CAAC"}
1
+ {"version":3,"file":"block_manifest.cjs","names":["z","WorkflowSchemaV1","ContentRelative","BlockPackMeta","ContentRelativeText","ContentRelativeBinary","CreateBlockPackDescriptionSchema"],"sources":["../../src/block_meta/block_manifest.ts"],"sourcesContent":["import { z } from \"zod\";\nimport type { BlockComponents } from \"./block_components\";\nimport { WorkflowSchemaV1 } from \"./block_components\";\nimport { ContentRelative, ContentRelativeBinary, ContentRelativeText } from \"./content_types\";\nimport { CreateBlockPackDescriptionSchema } from \"./block_description\";\nimport { BlockPackMeta } from \"./block_meta\";\nimport { toMerged } from \"es-toolkit\";\nimport type { BlockPackId } from \"./block_id\";\n\nexport type BlockComponentsManifest = BlockComponents<ContentRelative, ContentRelative>;\n\n/**\n * Block-components shape stored in a manifest. The consolidator always writes\n * the wrapped `{type: \"workflow-v1\", main: ...}` form, so the manifest schema\n * accepts the wrapped form only.\n */\nexport const BlockComponentsManifest = z.object({\n workflow: WorkflowSchemaV1(ContentRelative),\n model: ContentRelative,\n ui: ContentRelative,\n}) satisfies z.ZodType<BlockComponentsManifest>;\n\nexport const BlockPackMetaManifest = BlockPackMeta(ContentRelativeText, ContentRelativeBinary);\nexport type BlockPackMetaManifest = z.infer<typeof BlockPackMetaManifest>;\n\n/** Block description to be used in block manifest */\nexport const BlockPackDescriptionManifest = CreateBlockPackDescriptionSchema(\n BlockComponentsManifest,\n BlockPackMetaManifest,\n);\nexport type BlockPackDescriptionManifest = z.infer<typeof BlockPackDescriptionManifest>;\n\nexport const Sha256Schema = z\n .string()\n .regex(/[0-9a-fA-F]/)\n .toUpperCase()\n .length(64); // 256 / 4 (bits per hex register);\n\nexport const ManifestFileInfo = z.object({\n name: z.string(),\n size: z.number().int(),\n sha256: Sha256Schema,\n});\nexport type ManifestFileInfo = z.infer<typeof ManifestFileInfo>;\n\nexport const BlockPackManifest = z\n .object({\n schema: z.literal(\"v2\"),\n description: BlockPackDescriptionManifest,\n timestamp: z.number().optional(),\n files: z.array(ManifestFileInfo),\n })\n .passthrough();\nexport type BlockPackManifest = z.infer<typeof BlockPackManifest>;\n\nexport const BlockPackManifestFile = \"manifest.json\";\n\nexport function overrideManifestVersion<T extends { description: { id: BlockPackId } }>(\n manifest: T,\n newVersion: string,\n): T {\n return toMerged(manifest, { description: { id: { version: newVersion } } }) as T;\n}\n"],"mappings":";;;;;;;;;;;;;AAgBA,MAAa,0BAA0BA,IAAAA,EAAE,OAAO;CAC9C,UAAUC,yBAAAA,iBAAiBC,sBAAAA,gBAAgB;CAC3C,OAAOA,sBAAAA;CACP,IAAIA,sBAAAA;CACL,CAAC;AAEF,MAAa,wBAAwBC,mBAAAA,cAAcC,sBAAAA,qBAAqBC,sBAAAA,sBAAsB;;AAI9F,MAAa,+BAA+BC,0BAAAA,iCAC1C,yBACA,sBACD;AAGD,MAAa,eAAeN,IAAAA,EACzB,QAAQ,CACR,MAAM,cAAc,CACpB,aAAa,CACb,OAAO,GAAG;AAEb,MAAa,mBAAmBA,IAAAA,EAAE,OAAO;CACvC,MAAMA,IAAAA,EAAE,QAAQ;CAChB,MAAMA,IAAAA,EAAE,QAAQ,CAAC,KAAK;CACtB,QAAQ;CACT,CAAC;AAGF,MAAa,oBAAoBA,IAAAA,EAC9B,OAAO;CACN,QAAQA,IAAAA,EAAE,QAAQ,KAAK;CACvB,aAAa;CACb,WAAWA,IAAAA,EAAE,QAAQ,CAAC,UAAU;CAChC,OAAOA,IAAAA,EAAE,MAAM,iBAAiB;CACjC,CAAC,CACD,aAAa;AAGhB,MAAa,wBAAwB;AAErC,SAAgB,wBACd,UACA,YACG;AACH,SAAA,GAAA,WAAA,UAAgB,UAAU,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,YAAY,EAAE,EAAE,CAAC"}