// SPEC-597-EXEMPT: canonical type union (framework names enumerated for type safety)
// — these literals ARE the canonical contract; no runtime detection logic to migrate.
// types/plugin-install.ts — Domain types for SPEC-596 plugin installation
import { z } from 'zod';
// ---------------------------------------------------------------------------
// Zod schemas (source of truth) — TypeScript types derived from these
// ---------------------------------------------------------------------------
export const PluginInstallModeSchema = z
    .enum(['minimal', 'recommended', 'full'])
    .describe('Installation mode: ' +
    'minimal=only always-install plugins (commit-commands); ' +
    'recommended=above + stack-matched plugins; ' +
    'full=above + all catalog plugins for detected stacks');
export const StackSignalSchema = z.object({
    name: z
        .string()
        .describe('Stack or technology identifier, e.g. "vercel", "nextjs", "react", "vitest"'),
    confidence: z
        .enum(['low', 'medium', 'high'])
        .describe('Detection confidence: low=heuristic, medium=config file, high=package.json dep'),
    source: z.string().describe('How this was detected, e.g. "package.json" or "vercel.json"'),
});
export const PluginRecommendationSchema = z.object({
    id: z.string().describe('Plugin identifier as used in `claude plugin install <id>`'),
    displayName: z.string().describe('Human-readable plugin name for output'),
    tier: z
        .enum(['always', 'stack-matched', 'optional'])
        .describe('Install tier: ' +
        'always=install regardless of stack; ' +
        'stack-matched=only when matching stack signals found; ' +
        'optional=user opt-in (full mode only)'),
    stacks: z
        .array(z.string())
        .describe('Stack signal names that trigger this plugin. Empty means install always.'),
    description: z.string().describe('Brief description of what the plugin provides'),
});
export const PluginInstallPlanSchema = z.object({
    marketplaceAlreadyRegistered: z
        .boolean()
        .describe('Whether the Anthropic marketplace was already registered before this run'),
    marketplaceToRegister: z
        .boolean()
        .describe('Whether the marketplace will be registered in this run'),
    toInstall: z
        .array(PluginRecommendationSchema)
        .describe('Plugins that will be installed (not already installed)'),
    toSkip: z
        .array(PluginRecommendationSchema)
        .describe('Plugins that are already installed — will be skipped'),
    detectedStacks: z.array(z.string()).describe('Stack signal names that drove the selection'),
    mode: PluginInstallModeSchema,
});
export const PluginInstallResultSchema = z.object({
    projectPath: z.string().describe('Absolute project path where the operation ran'),
    mode: PluginInstallModeSchema,
    dryRun: z.boolean().describe('When true, plan was computed but no CLI commands were executed'),
    marketplaceAdded: z
        .boolean()
        .describe('Whether the Anthropic marketplace was registered during this run'),
    installed: z.array(z.string()).describe('Plugin IDs successfully installed'),
    skipped: z.array(z.string()).describe('Plugin IDs already installed — skipped'),
    failed: z.array(z.string()).describe('Plugin IDs where install command failed'),
    message: z.string().describe('Human-readable summary of what happened'),
});
export const MarketplaceRegistrationStatusSchema = z.object({
    alreadyRegistered: z.boolean().describe('True when marketplace was registered before this call'),
    registered: z.boolean().describe('True when registration was performed during this call'),
    skipped: z.boolean().describe('True when dry-run; no commands were executed'),
});
//# sourceMappingURL=plugin-install.js.map