import { z } from "zod";
import { toolbarConfigurationSchema } from "../toolbar.js";
import { handleGroupManifestSchema } from "./handle.js";
const nodeShapeSchema = z["enum"]([
    'circle',
    'square',
    'rectangle',
    'container'
]);
const nodeDebugManifestSchema = z.object({
    runtime: z.string().min(1)
});
const nodeDisplayManifestSchema = z.object({
    label: z.string().min(1),
    canvasLabel: z.string().min(1).optional(),
    description: z.string().optional(),
    icon: z.string().min(1).optional(),
    shape: nodeShapeSchema.optional(),
    color: z.string().optional(),
    background: z.string().optional(),
    iconBackground: z.string().optional(),
    iconBackgroundDark: z.string().optional(),
    iconColor: z.string().optional(),
    shadow: z.boolean().optional()
});
const nodeRuntimeConstraintsManifestSchema = z.union([
    z.object({
        include: z.array(z.string())
    }),
    z.object({
        exclude: z.array(z.string())
    })
]);
const nodeManifestSchema = z.object({
    nodeType: z.string().min(1),
    version: z.string().min(1),
    description: z.string().optional(),
    category: z.string().min(1).optional(),
    tags: z.array(z.string()),
    sortOrder: z.number().int().nonnegative(),
    display: nodeDisplayManifestSchema,
    handleConfiguration: z.array(handleGroupManifestSchema),
    toolbarExtensions: toolbarConfigurationSchema.optional(),
    suppressDefaultToolbarActions: z.record(z.string(), z.array(z.string())).optional(),
    inputDefaults: z.record(z.string(), z.unknown()).optional(),
    inputDefinition: z.record(z.string(), z.any()).optional(),
    outputDefinition: z.record(z.string(), z.any()).optional(),
    drillable: z.boolean().optional(),
    debug: nodeDebugManifestSchema.optional(),
    model: z.any().optional(),
    defaultProperties: z.record(z.string(), z.unknown()).optional(),
    form: z.custom().optional(),
    deprecated: z.boolean().optional(),
    runtimeConstraints: nodeRuntimeConstraintsManifestSchema.optional()
});
export { nodeDebugManifestSchema, nodeDisplayManifestSchema, nodeManifestSchema, nodeRuntimeConstraintsManifestSchema, nodeShapeSchema };
