/** * `/meta` payload — the contract between `createRemoteServer` (producer) * and `deployCheck` (verifier). Both sides parse through `MetaSchema`, so * a new field added here flows to both paths and drift is caught at the * boundary rather than silently skipped. * * Scope: **domain workers only**. Kernels rely on OIDC discovery * (`/.well-known/openid-configuration`) + JWKS — they have no `/meta`. */ import { z } from 'zod' export const MetaSchema = z.object({ // The version of the meta payload. Incremented on any change to the payload version: z.number().int().min(1).default(1), /** Base URL where JWKS is published. Always stamped by `createRemoteServer` * and required by `deployCheck` to verify JWKS reachability. */ iss: z.string().min(1), /** Short git SHA of the SDK used to build the worker. */ sdkCommit: z.string().optional(), /** Deterministic hash of the compiled spec (`sha256:`). */ schemaHash: z.string().optional(), /** Local directory name under `kernel/domains/<...>/` — used to auto-resolve the local spec. */ domainName: z.string().optional(), /** * Optional presentation metadata declared on the domain (`defineDomain`): * `logo` (inline SVG / `data:` URL), `entrypoint` (a view slug — the domain's * entry surface), and the domain's declared `roles` (registered by a workspace * at app install). Served verbatim so a host UI can brand a freshly-installed * domain. */ manifest: z .object({ logo: z.string().optional(), entrypoint: z.string().optional(), roles: z .array( z.object({ slug: z.string().min(1), name: z.string().optional(), description: z.string().optional(), default: z.boolean().optional(), }), ) .optional(), }) .optional(), }) export type Meta = z.infer