import { z } from 'zod';

// src/studio/plugin.zod.ts
var ViewModeSchema = z.enum(["preview", "design", "code", "data"]);
var MetadataViewerContributionSchema = z.object({
  /** Unique viewer ID (namespaced: `pluginId.viewerId`) */
  id: z.string().describe("Unique viewer identifier"),
  /** Metadata type(s) this viewer handles (e.g., "object", "flow", "agent") */
  metadataTypes: z.array(z.string()).min(1).describe("Metadata types this viewer can handle"),
  /** Human-readable label shown in the view switcher */
  label: z.string().describe("Viewer display label"),
  /** Priority — highest-priority viewer becomes default. Built-in default = 0 */
  priority: z.number().default(0).describe("Viewer priority (higher wins)"),
  /** View modes this viewer supports */
  modes: z.array(ViewModeSchema).default(["preview"]).describe("Supported view modes")
});
var SidebarGroupContributionSchema = z.object({
  /** Unique group key */
  key: z.string().describe("Unique group key"),
  /** Display label */
  label: z.string().describe("Group display label"),
  /** Lucide icon name (e.g., "database", "workflow") */
  icon: z.string().optional().describe("Lucide icon name"),
  /** Metadata types belonging to this group */
  metadataTypes: z.array(z.string()).describe("Metadata types in this group"),
  /** Sort order — lower values appear first */
  order: z.number().default(100).describe("Sort order (lower = higher)")
});
var ActionLocationSchema = z.enum(["toolbar", "contextMenu", "commandPalette"]);
var ActionContributionSchema = z.object({
  /** Unique action ID */
  id: z.string().describe("Unique action identifier"),
  /** Display label */
  label: z.string().describe("Action display label"),
  /** Lucide icon name */
  icon: z.string().optional().describe("Lucide icon name"),
  /** Where this action appears */
  location: ActionLocationSchema.describe("UI location"),
  /** Metadata types this action applies to (empty = all types) */
  metadataTypes: z.array(z.string()).default([]).describe("Applicable metadata types")
});
var MetadataIconContributionSchema = z.object({
  /** Metadata type this icon represents */
  metadataType: z.string().describe("Metadata type"),
  /** Human-readable label */
  label: z.string().describe("Display label"),
  /** Lucide icon name */
  icon: z.string().describe("Lucide icon name")
});
var PanelLocationSchema = z.enum(["bottom", "right", "modal"]);
var PanelContributionSchema = z.object({
  /** Unique panel ID */
  id: z.string().describe("Unique panel identifier"),
  /** Display label */
  label: z.string().describe("Panel display label"),
  /** Lucide icon name */
  icon: z.string().optional().describe("Lucide icon name"),
  /** Panel placement */
  location: PanelLocationSchema.default("bottom").describe("Panel location")
});
var CommandContributionSchema = z.object({
  /** Unique command ID (namespaced: `pluginId.commandName`) */
  id: z.string().describe("Unique command identifier"),
  /** Display label */
  label: z.string().describe("Command display label"),
  /** Keyboard shortcut (e.g., "Ctrl+Shift+P") */
  shortcut: z.string().optional().describe("Keyboard shortcut"),
  /** Lucide icon name */
  icon: z.string().optional().describe("Lucide icon name")
});
var StudioPluginContributionsSchema = z.object({
  /** Metadata viewer/designer components */
  metadataViewers: z.array(MetadataViewerContributionSchema).default([]),
  /** Sidebar navigation groups */
  sidebarGroups: z.array(SidebarGroupContributionSchema).default([]),
  /** Toolbar / context menu / command palette actions */
  actions: z.array(ActionContributionSchema).default([]),
  /** Metadata type icons & labels */
  metadataIcons: z.array(MetadataIconContributionSchema).default([]),
  /** Auxiliary panels */
  panels: z.array(PanelContributionSchema).default([]),
  /** Command palette entries */
  commands: z.array(CommandContributionSchema).default([])
});
var ActivationEventSchema = z.string().describe("Activation event pattern");
var StudioPluginManifestSchema = z.object({
  /** 
   * Unique plugin ID using reverse-domain notation.
   * @example "objectstack.object-designer"
   */
  id: z.string().regex(/^[a-z][a-z0-9-]*(\.[a-z][a-z0-9-]*)*$/).describe("Plugin ID (dot-separated lowercase)"),
  /** Human-readable plugin name */
  name: z.string().describe("Plugin display name"),
  /** Semantic version */
  version: z.string().default("0.0.1").describe("Plugin version"),
  /** Plugin description */
  description: z.string().optional().describe("Plugin description"),
  /** Author name */
  author: z.string().optional().describe("Author"),
  /** Declarative contribution points */
  contributes: StudioPluginContributionsSchema.default({
    metadataViewers: [],
    sidebarGroups: [],
    actions: [],
    metadataIcons: [],
    panels: [],
    commands: []
  }),
  /** 
   * Activation events — when to load this plugin.
   * Default `['*']` means eager activation.
   */
  activationEvents: z.array(ActivationEventSchema).default(["*"])
});
function defineStudioPlugin(input) {
  return StudioPluginManifestSchema.parse(input);
}

export { ActionContributionSchema, ActionLocationSchema, ActivationEventSchema, CommandContributionSchema, MetadataIconContributionSchema, MetadataViewerContributionSchema, PanelContributionSchema, PanelLocationSchema, SidebarGroupContributionSchema, StudioPluginContributionsSchema, StudioPluginManifestSchema, ViewModeSchema, defineStudioPlugin };
//# sourceMappingURL=index.mjs.map
//# sourceMappingURL=index.mjs.map