'use strict';

var zod = require('zod');

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

exports.ActionContributionSchema = ActionContributionSchema;
exports.ActionLocationSchema = ActionLocationSchema;
exports.ActivationEventSchema = ActivationEventSchema;
exports.CommandContributionSchema = CommandContributionSchema;
exports.MetadataIconContributionSchema = MetadataIconContributionSchema;
exports.MetadataViewerContributionSchema = MetadataViewerContributionSchema;
exports.PanelContributionSchema = PanelContributionSchema;
exports.PanelLocationSchema = PanelLocationSchema;
exports.SidebarGroupContributionSchema = SidebarGroupContributionSchema;
exports.StudioPluginContributionsSchema = StudioPluginContributionsSchema;
exports.StudioPluginManifestSchema = StudioPluginManifestSchema;
exports.ViewModeSchema = ViewModeSchema;
exports.defineStudioPlugin = defineStudioPlugin;
//# sourceMappingURL=index.js.map
//# sourceMappingURL=index.js.map