{"version":3,"file":"block_pack_spec.cjs","names":["z","BlockPackId"],"sources":["../../src/block_registry/block_pack_spec.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { BlockPackId } from \"../block_meta\";\n\n/** Block pack from local folder, to be used during block development. Old layout.\n * @deprecated don't use */\nexport const BlockPackDevV1 = z.object({\n  type: z.literal(\"dev-v1\"),\n  folder: z.string(),\n  mtime: z.string().optional(),\n});\n/** @deprecated don't use */\nexport type BlockPackDevV1 = z.infer<typeof BlockPackDevV1>;\n\n/** Block pack from local folder, to be used during block development. New layout. */\nexport const BlockPackDevV2 = z.object({\n  type: z.literal(\"dev-v2\"),\n  folder: z.string(),\n  mtime: z.string().optional(),\n});\nexport type BlockPackDevV2 = z.infer<typeof BlockPackDevV2>;\n\n/** Block pack consumed from an npm-installed package's `block-pack/` folder\n * (manifest + ui.tgz). Emitted by the facade's engine-generated BlockPointer.\n * Self-describes its pack location (`packUrl`, `rootUrl`) rather than carrying\n * `dev-v2`'s `folder`. */\nexport const BlockPackFromPackV2 = z.object({\n  type: z.literal(\"from-pack-v2\"),\n  /** `file:` URL of the block-pack directory itself — it directly contains\n   * `manifest.json`, `ui.tgz`, `model.json`, `published.json`, … This is a URL,\n   * NOT a filesystem path: the facade emits a lossless OS-agnostic locator and\n   * stays dependency-free; each consumer converts at its own edge with\n   * `fileURLToPath` (in Node). Consumers MUST read artifacts from here and MUST\n   * NOT reconstruct `<root>/block-pack`: the pointer travels with the block at\n   * its build-time SDK version, and a consumer at a different version cannot\n   * know a layout the structurer may relocate. `type` versions the within-pack\n   * format — if that changes, the discriminator bumps (`from-pack-v3`). */\n  packUrl: z.string(),\n  /** `file:` URL of the facade/package root — the parent that holds the pack\n   * directory plus root-level siblings (e.g. `package.json`). A URL, not a path\n   * (convert with `fileURLToPath` at the edge). Always emitted when built from a\n   * block; optional because a future bare block-pack may ship with no root. */\n  rootUrl: z.string().optional(),\n  mtime: z.string().optional(),\n});\nexport type BlockPackFromPackV2 = z.infer<typeof BlockPackFromPackV2>;\n\n/**\n * Block pack from registry with version 2 layout, to be loaded directly\n * from the client.\n * @deprecated don't use\n * */\nexport const BlockPackFromRegistryV1 = z.object({\n  type: z.literal(\"from-registry-v1\"),\n  registryUrl: z.string(),\n  id: BlockPackId,\n});\n/** @deprecated don't use */\nexport type BlockPackFromRegistryV1 = z.infer<typeof BlockPackFromRegistryV1>;\n\n/** Block pack from registry with version 2 layout, to be loaded directly\n * from the client. */\nexport const BlockPackFromRegistryV2 = z.object({\n  type: z.literal(\"from-registry-v2\"),\n  registryUrl: z.string(),\n  id: BlockPackId,\n  channel: z.string().optional(),\n});\nexport type BlockPackFromRegistryV2 = z.infer<typeof BlockPackFromRegistryV2>;\n\n/** Information about block origin, can be used to instantiate new blocks */\nexport const BlockPackSpec = z.discriminatedUnion(\"type\", [\n  BlockPackDevV1,\n  BlockPackDevV2,\n  BlockPackFromPackV2,\n  BlockPackFromRegistryV1,\n  BlockPackFromRegistryV2,\n]);\nexport type BlockPackSpec = z.infer<typeof BlockPackSpec>;\n"],"mappings":";;;;;;AAKA,MAAa,iBAAiBA,IAAAA,EAAE,OAAO;CACrC,MAAMA,IAAAA,EAAE,QAAQ,QAAQ;CACxB,QAAQA,IAAAA,EAAE,OAAO;CACjB,OAAOA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS;AAC7B,CAAC;;AAKD,MAAa,iBAAiBA,IAAAA,EAAE,OAAO;CACrC,MAAMA,IAAAA,EAAE,QAAQ,QAAQ;CACxB,QAAQA,IAAAA,EAAE,OAAO;CACjB,OAAOA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS;AAC7B,CAAC;;;;;AAOD,MAAa,sBAAsBA,IAAAA,EAAE,OAAO;CAC1C,MAAMA,IAAAA,EAAE,QAAQ,cAAc;;;;;;;;;;CAU9B,SAASA,IAAAA,EAAE,OAAO;;;;;CAKlB,SAASA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS;CAC7B,OAAOA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS;AAC7B,CAAC;;;;;;AAQD,MAAa,0BAA0BA,IAAAA,EAAE,OAAO;CAC9C,MAAMA,IAAAA,EAAE,QAAQ,kBAAkB;CAClC,aAAaA,IAAAA,EAAE,OAAO;CACtB,IAAIC,iBAAAA;AACN,CAAC;;;AAMD,MAAa,0BAA0BD,IAAAA,EAAE,OAAO;CAC9C,MAAMA,IAAAA,EAAE,QAAQ,kBAAkB;CAClC,aAAaA,IAAAA,EAAE,OAAO;CACtB,IAAIC,iBAAAA;CACJ,SAASD,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS;AAC/B,CAAC;;AAID,MAAa,gBAAgBA,IAAAA,EAAE,mBAAmB,QAAQ;CACxD;CACA;CACA;CACA;CACA;AACF,CAAC"}