import { z } from 'zod';

/**
 * Top Plugin Interface
 * Unified interface for top plugins data
 */
interface TopPlugin {
    avatar: string;
    /** Call count (when sortBy is 'calls') */
    callCount?: number;
    category: string;
    identifier: string;
    /** Install count (when sortBy is 'installs') */
    installCount?: number;
    name: string;
}
/**
 * Sort options for top plugins
 */
type PluginSortBy = 'installs' | 'calls';
/**
 * Top plugins query parameters
 */
interface TopPluginsQuery {
    /** Maximum number of plugins to return */
    limit?: number;
    /** Date range as [startDate, endDate] */
    range: [string, string];
    /** Sort criteria: 'installs' or 'calls' */
    sortBy?: PluginSortBy;
}
/**
 * Install Failure Analysis Interface
 * Defines the structure for plugin install failure analysis data
 */
interface InstallFailureAnalysis {
    /** Number of failed installation attempts */
    failureCount: number;
    /** Failure rate as a decimal (e.g., 0.2736 for 27.36%) */
    failureRate: number;
    /** Most common error message for this plugin */
    mostCommonError: string;
    /** Plugin identifier */
    pluginIdentifier: string;
    /** Plugin display name */
    pluginName: string;
    /** Total number of installation attempts (successful + failed) */
    totalInstallAttempts: number;
}
/**
 * Install failure analysis query parameters
 */
interface InstallFailureAnalysisQuery {
    /** Maximum number of plugins to return */
    limit?: number;
    /** Date range as [startDate, endDate] */
    range: [string, string];
}

/**
 * Base structure for a single resource item in the marketplace.
 * This interface defines the common properties shared by all marketplace items,
 * including plugins, agents, and other resources.
 */
interface MarketItemBase {
    /** Author or organization name */
    author?: string;
    /** Category name used for classification */
    category?: string;
    /** Optional: Compatibility information for different platforms or versions */
    compatibility?: Record<string, any>;
    /** Resource creation date in the marketplace (ISO 8601 format) */
    createdAt: string;
    /** Localized short description displayed in the marketplace listing */
    description: string;
    /** URL to the resource's homepage or documentation */
    homepage?: string;
    /** Icon URL or Emoji character */
    icon?: string;
    /** Globally unique identifier, typically contains author/namespace and name */
    identifier: string;
    /** URL pointing to the detailed manifest file for this resource */
    manifestUrl: string;
    /** Localized display name shown in the marketplace listing */
    name: string;
    /** List of localized tags for filtering and categorization */
    tags?: string[];
    /** Resource's last update date in the marketplace (ISO 8601 format) */
    updatedAt: string;
}
/**
 * Category list request query parameters
 *
 * Query parameters for retrieving category statistics with optional filtering.
 */
interface CategoryListQuery {
    /** Optional locale for localized search, defaults to 'en-US' */
    locale?: string;
    /** Optional search query to filter plugins before counting categories */
    q?: string;
}
/**
 * Single category item with plugin count
 *
 * Represents a category and the number of plugins in that category.
 */
interface CategoryItem {
    /** Category name */
    category: string;
    /** Number of plugins in this category */
    count: number;
}
/**
 * Category list response type
 *
 * Array of categories with their respective plugin counts.
 */
type CategoryListResponse = CategoryItem[];

/**
 * Connection types for plugin communication.
 * - http: The plugin communicates via HTTP protocol
 * - stdio: The plugin communicates via standard input/output
 */
declare const ConnectionTypeEnum: z.ZodEnum<["http", "stdio"]>;
type ConnectionType = z.infer<typeof ConnectionTypeEnum>;
/**
 * Plugin connection types for overall plugin communication strategy.
 * - local: Plugin only supports local communication (stdio)
 * - remote: Plugin only supports remote communication (http)
 * - hybrid: Plugin supports both local and remote communication
 */
declare const PluginConnectionTypeEnum: z.ZodEnum<["local", "remote", "hybrid"]>;
type PluginConnectionType = z.infer<typeof PluginConnectionTypeEnum>;
/**
 * Plugin installation methods.
 * Different ways to install and deploy a plugin.
 */
declare const InstallationMethodEnum: z.ZodEnum<["npm", "go", "python", "docker", "git", "binaryUrl", "manual", "none"]>;
type InstallationMethod = z.infer<typeof InstallationMethodEnum>;
/**
 * System dependency required by a plugin.
 * Defines a software dependency that must be installed on the system.
 */
interface SystemDependency {
    /** Command to check if the dependency is installed */
    checkCommand?: string;
    /** Description of what this dependency is for */
    description?: string;
    /** Platform-specific installation instructions */
    installInstructions?: Record<string, string>;
    /** Name of the dependency */
    name: string;
    /** Minimum required version */
    requiredVersion?: string;
    /** Type of dependency (e.g., 'runtime', 'library') */
    type?: string;
    /** Whether version parsing is required to check compatibility */
    versionParsingRequired?: boolean;
}
/**
 * Connection configuration for a plugin.
 * Defines how the application should communicate with the plugin.
 */
interface ConnectionConfig {
    /** Command-line arguments for the plugin process */
    args?: string[];
    /** Command to execute to start the plugin */
    command?: string;
    /**
     * JSON Schema 配置
     * 插件运行时需要的 configSchema
     */
    configSchema?: any;
    /** Type of connection (http or stdio) */
    type: ConnectionType;
    /** URL for HTTP-based plugins */
    url?: string;
}
/**
 * Details for installing a plugin.
 * Provides specific information needed during the installation process.
 */
interface InstallationDetails {
    /** Package name for npm, pip, or other package managers */
    packageName?: string;
    /** Git repository URL to clone */
    repositoryUrlToClone?: string;
    /** Ordered list of setup steps to execute after installation */
    setupSteps?: string[];
}
/**
 * Deployment option for a plugin.
 * A plugin can offer multiple deployment options, each with different requirements.
 */
interface DeploymentOption {
    /** Connection configuration for this deployment option */
    connection: ConnectionConfig;
    /** Human-readable description of this deployment option */
    description?: string;
    /** Detailed installation instructions */
    installationDetails?: InstallationDetails;
    /** Method used to install this plugin */
    installationMethod: string;
    /** Whether this is the recommended deployment option */
    isRecommended?: boolean;
    /** System dependencies required for this deployment option */
    systemDependencies?: SystemDependency[];
}

/**
 * Schema defining the capabilities a plugin can provide.
 * Each capability is represented as a boolean flag.
 */
declare const PluginCapabilitiesSchema: z.ZodObject<{
    /** Whether the plugin provides custom prompts */
    prompts: z.ZodDefault<z.ZodBoolean>;
    /** Whether the plugin provides resources (assets) */
    resources: z.ZodDefault<z.ZodBoolean>;
    /** Whether the plugin provides tools (functions) */
    tools: z.ZodDefault<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
    prompts: boolean;
    resources: boolean;
    tools: boolean;
}, {
    prompts?: boolean | undefined;
    resources?: boolean | undefined;
    tools?: boolean | undefined;
}>;
/**
 * Definition of a tool that a plugin can provide.
 * Tools are functions that can be called by the chat application.
 */
interface PluginTool {
    /** Human-readable description of what the tool does */
    description?: string;
    /** JSON schema defining the expected input parameters */
    inputSchema?: Record<string, any>;
    /** Unique identifier for the tool within the plugin */
    name: string;
}
/**
 * Definition of a resource (asset) that a plugin can provide.
 * Resources can be images, data files, or other assets needed by the plugin.
 */
interface PluginResource {
    /** MIME type of the resource (e.g., 'image/png', 'application/json') */
    mimeType?: string;
    /** Optional display name for the resource */
    name?: string;
    /** URI where the resource can be accessed */
    uri: string;
}
/**
 * Definition of an argument for a prompt template.
 * Arguments allow users to customize the prompt when using it.
 */
interface PromptArgument {
    /** Human-readable description of the argument's purpose */
    description?: string;
    /** Argument identifier */
    name: string;
    /** Whether the argument must be provided (defaults to false if omitted) */
    required?: boolean;
    /** Data type of the argument (e.g., 'string', 'number') */
    type?: string;
}
/**
 * Definition of a prompt template that a plugin can provide.
 * Prompts are pre-defined templates that can be used in conversations.
 */
interface PluginPrompt {
    /** List of customizable arguments for this prompt */
    arguments?: PromptArgument[];
    /** Human-readable description of what the prompt does */
    description: string;
    /** Unique identifier for the prompt within the plugin */
    name: string;
}

/**
 * Plugin compatibility information.
 * Defines the compatibility requirements for a plugin with respect to app versions and platforms.
 */
interface PluginCompatibility {
    /** Maximum app version the plugin is compatible with */
    maxAppVersion?: string;
    /** Minimum app version required to use the plugin */
    minAppVersion?: string;
    /** List of supported platforms (e.g., 'web', 'desktop', 'mobile') */
    platforms?: string[];
}
/**
 * Simplified plugin version information.
 * Contains minimal version data for plugin version lists.
 */
interface PluginVersionSummary {
    /** Creation timestamp (ISO 8601 format) */
    createdAt: string;
    /** Whether this is the latest version of the plugin */
    isLatest: boolean;
    /** Whether this version has been validated by the system */
    isValidated: boolean;
    /** Semantic version string (e.g., "1.0.0") */
    version: string;
}
/**
 * Base plugin item schema with Zod validation.
 * Defines the structure and validation rules for plugin items in the marketplace.
 */
declare const BasePluginItemSchema: z.ZodObject<{
    author: z.ZodOptional<z.ZodString>;
    capabilities: z.ZodObject<{
        prompts: z.ZodDefault<z.ZodBoolean>;
        resources: z.ZodDefault<z.ZodBoolean>;
        tools: z.ZodDefault<z.ZodBoolean>;
    }, "strip", z.ZodTypeAny, {
        prompts: boolean;
        resources: boolean;
        tools: boolean;
    }, {
        prompts?: boolean | undefined;
        resources?: boolean | undefined;
        tools?: boolean | undefined;
    }>;
    category: z.ZodOptional<z.ZodString>;
    commentCount: z.ZodDefault<z.ZodNumber>;
    connectionType: z.ZodOptional<z.ZodEnum<["local", "remote", "hybrid"]>>;
    createdAt: z.ZodString;
    description: z.ZodString;
    github: z.ZodOptional<z.ZodObject<{
        language: z.ZodOptional<z.ZodString>;
        license: z.ZodOptional<z.ZodString>;
        stars: z.ZodOptional<z.ZodNumber>;
        url: z.ZodString;
    }, "strip", z.ZodTypeAny, {
        url: string;
        language?: string | undefined;
        license?: string | undefined;
        stars?: number | undefined;
    }, {
        url: string;
        language?: string | undefined;
        license?: string | undefined;
        stars?: number | undefined;
    }>>;
    homepage: z.ZodOptional<z.ZodString>;
    icon: z.ZodOptional<z.ZodString>;
    identifier: z.ZodString;
    installCount: z.ZodDefault<z.ZodNumber>;
    isClaimed: z.ZodDefault<z.ZodBoolean>;
    isFeatured: z.ZodDefault<z.ZodBoolean>;
    isOfficial: z.ZodDefault<z.ZodBoolean>;
    isValidated: z.ZodDefault<z.ZodBoolean>;
    manifestUrl: z.ZodString;
    name: z.ZodString;
    promptsCount: z.ZodOptional<z.ZodNumber>;
    ratingAverage: z.ZodOptional<z.ZodNumber>;
    ratingCount: z.ZodDefault<z.ZodNumber>;
    resourcesCount: z.ZodOptional<z.ZodNumber>;
    toolsCount: z.ZodOptional<z.ZodNumber>;
    updatedAt: z.ZodString;
}, "strip", z.ZodTypeAny, {
    capabilities: {
        prompts: boolean;
        resources: boolean;
        tools: boolean;
    };
    commentCount: number;
    createdAt: string;
    description: string;
    identifier: string;
    installCount: number;
    isClaimed: boolean;
    isFeatured: boolean;
    isOfficial: boolean;
    isValidated: boolean;
    manifestUrl: string;
    name: string;
    ratingCount: number;
    updatedAt: string;
    author?: string | undefined;
    category?: string | undefined;
    connectionType?: "local" | "remote" | "hybrid" | undefined;
    github?: {
        url: string;
        language?: string | undefined;
        license?: string | undefined;
        stars?: number | undefined;
    } | undefined;
    homepage?: string | undefined;
    icon?: string | undefined;
    promptsCount?: number | undefined;
    ratingAverage?: number | undefined;
    resourcesCount?: number | undefined;
    toolsCount?: number | undefined;
}, {
    capabilities: {
        prompts?: boolean | undefined;
        resources?: boolean | undefined;
        tools?: boolean | undefined;
    };
    createdAt: string;
    description: string;
    identifier: string;
    manifestUrl: string;
    name: string;
    updatedAt: string;
    author?: string | undefined;
    category?: string | undefined;
    commentCount?: number | undefined;
    connectionType?: "local" | "remote" | "hybrid" | undefined;
    github?: {
        url: string;
        language?: string | undefined;
        license?: string | undefined;
        stars?: number | undefined;
    } | undefined;
    homepage?: string | undefined;
    icon?: string | undefined;
    installCount?: number | undefined;
    isClaimed?: boolean | undefined;
    isFeatured?: boolean | undefined;
    isOfficial?: boolean | undefined;
    isValidated?: boolean | undefined;
    promptsCount?: number | undefined;
    ratingAverage?: number | undefined;
    ratingCount?: number | undefined;
    resourcesCount?: number | undefined;
    toolsCount?: number | undefined;
}>;
/**
 * Plugin marketplace item definition.
 * Extends the base marketplace item with plugin-specific properties.
 * This interface represents a plugin as it appears in the marketplace listing.
 */
interface MarketPluginItem extends MarketItemBase {
    /** Capabilities provided by this plugin */
    capabilities?: {
        /** Whether the plugin provides custom prompts */
        prompts: boolean;
        /** Whether the plugin provides resources (assets) */
        resources: boolean;
        /** Whether the plugin provides tools (functions) */
        tools: boolean;
    };
    /** Number of comments on this plugin */
    commentCount?: number;
    /** Connection type strategy for communicating with the plugin */
    connectionType?: PluginConnectionType;
    /** GitHub repository information */
    github?: {
        language?: string;
        license?: string;
        stars?: number;
        url: string;
    };
    /** Number of times this plugin has been installed */
    installCount?: number;
    /** Whether this plugin has been claimed by its original author */
    isClaimed?: boolean;
    /** Whether this plugin is featured in the marketplace */
    isFeatured?: boolean;
    /** Whether this plugin is officially maintained by LobeHub */
    isOfficial?: boolean;
    /** Whether this plugin has been validated by the system */
    isValidated?: boolean;
    /** Number of prompts provided by this plugin */
    promptsCount?: number;
    /** Average rating (typically 1-5 scale) */
    ratingAverage?: number;
    /** Number of ratings received */
    ratingCount?: number;
    /** Number of resources provided by this plugin */
    resourcesCount?: number;
    summary?: string;
    /** Number of tools provided by this plugin */
    toolsCount?: number;
}
/** Type alias for the base plugin item validated by Zod schema */
type BasePluginItem = z.infer<typeof BasePluginItemSchema>;
/**
 * Plugin manifest definition.
 * This is the complete specification of a plugin, including all its capabilities,
 * metadata, and deployment options.
 */
interface PluginItemDetail extends Omit<MarketPluginItem, 'author' | 'manifestUrl'> {
    artifacts?: {
        docker?: {
            imageName?: string;
            tag?: string;
        };
        npm?: {
            packageName?: string;
            version?: string;
        };
        pypi?: {
            packageName?: string;
            version?: string;
        };
    };
    /** Author information */
    author?: {
        /** Author or organization name */
        name: string;
        /** URL to the author's website or profile */
        url?: string;
    };
    /** Connection type strategy for communicating with the plugin */
    connectionType?: PluginConnectionType;
    /** Available deployment options */
    deploymentOptions?: DeploymentOption[];
    /**
     * GitHub
     */
    github?: {
        language?: string;
        license?: string;
        stars?: number;
        url: string;
    };
    overview: {
        readme: string;
        summary?: string;
    };
    /** List of prompt templates provided by this plugin */
    prompts?: PluginPrompt[];
    /** List of resources provided by this plugin */
    resources?: PluginResource[];
    /** List of tools provided by this plugin */
    tools?: PluginTool[];
    /** Date when the plugin was created in the marketplace (ISO 8601 format) */
    validatedAt?: string;
    /** Semantic version string (e.g., "1.0.0") */
    version: string;
    /** List of all versions of this plugin with simplified information */
    versions: PluginVersionSummary[];
}
/**
 * Plugin manifest definition.
 * This is the complete specification of a plugin, including all its capabilities,
 * metadata, and deployment options.
 */
interface PluginManifest extends Omit<MarketPluginItem, 'author' | 'manifestUrl'> {
    /** Author information */
    author?: {
        /** Author or organization name */
        name: string;
        /** URL to the author's website or profile */
        url?: string;
    };
    /** Available deployment options */
    deploymentOptions?: DeploymentOption[];
    overview?: {
        readme?: string;
        summary?: string;
    };
    /** List of prompt templates provided by this plugin */
    prompts?: PluginPrompt[];
    /** List of resources provided by this plugin */
    resources?: PluginResource[];
    /** List of tools provided by this plugin */
    tools?: PluginTool[];
    /** Date when the plugin was created in the marketplace (ISO 8601 format) */
    validatedAt?: string;
    /** Semantic version string (e.g., "1.0.0") */
    version: string;
}

/**
 * Schema for admin-managed plugin items with additional status and visibility fields.
 * Extends the base plugin schema with administrative properties.
 */
declare const AdminPluginItemSchema: z.ZodObject<{
    author: z.ZodOptional<z.ZodString>;
    capabilities: z.ZodObject<{
        prompts: z.ZodDefault<z.ZodBoolean>;
        resources: z.ZodDefault<z.ZodBoolean>;
        tools: z.ZodDefault<z.ZodBoolean>;
    }, "strip", z.ZodTypeAny, {
        prompts: boolean;
        resources: boolean;
        tools: boolean;
    }, {
        prompts?: boolean | undefined;
        resources?: boolean | undefined;
        tools?: boolean | undefined;
    }>;
    category: z.ZodOptional<z.ZodString>;
    commentCount: z.ZodDefault<z.ZodNumber>;
    connectionType: z.ZodOptional<z.ZodEnum<["local", "remote", "hybrid"]>>;
    createdAt: z.ZodString;
    description: z.ZodString;
    github: z.ZodOptional<z.ZodObject<{
        language: z.ZodOptional<z.ZodString>;
        license: z.ZodOptional<z.ZodString>;
        stars: z.ZodOptional<z.ZodNumber>;
        url: z.ZodString;
    }, "strip", z.ZodTypeAny, {
        url: string;
        language?: string | undefined;
        license?: string | undefined;
        stars?: number | undefined;
    }, {
        url: string;
        language?: string | undefined;
        license?: string | undefined;
        stars?: number | undefined;
    }>>;
    homepage: z.ZodOptional<z.ZodString>;
    icon: z.ZodOptional<z.ZodString>;
    identifier: z.ZodString;
    installCount: z.ZodDefault<z.ZodNumber>;
    isClaimed: z.ZodDefault<z.ZodBoolean>;
    isFeatured: z.ZodDefault<z.ZodBoolean>;
    isOfficial: z.ZodDefault<z.ZodBoolean>;
    isValidated: z.ZodDefault<z.ZodBoolean>;
    manifestUrl: z.ZodString;
    name: z.ZodString;
    promptsCount: z.ZodOptional<z.ZodNumber>;
    ratingAverage: z.ZodOptional<z.ZodNumber>;
    ratingCount: z.ZodDefault<z.ZodNumber>;
    resourcesCount: z.ZodOptional<z.ZodNumber>;
    toolsCount: z.ZodOptional<z.ZodNumber>;
    updatedAt: z.ZodString;
} & {
    /** Publication status of the plugin */
    status: z.ZodEnum<["published", "unpublished", "archived", "deprecated"]>;
    /** Visibility level of the plugin */
    visibility: z.ZodEnum<["public", "private", "internal"]>;
}, "strip", z.ZodTypeAny, {
    status: "published" | "unpublished" | "archived" | "deprecated";
    capabilities: {
        prompts: boolean;
        resources: boolean;
        tools: boolean;
    };
    commentCount: number;
    createdAt: string;
    description: string;
    identifier: string;
    installCount: number;
    isClaimed: boolean;
    isFeatured: boolean;
    isOfficial: boolean;
    isValidated: boolean;
    manifestUrl: string;
    name: string;
    ratingCount: number;
    updatedAt: string;
    visibility: "public" | "private" | "internal";
    author?: string | undefined;
    category?: string | undefined;
    connectionType?: "local" | "remote" | "hybrid" | undefined;
    github?: {
        url: string;
        language?: string | undefined;
        license?: string | undefined;
        stars?: number | undefined;
    } | undefined;
    homepage?: string | undefined;
    icon?: string | undefined;
    promptsCount?: number | undefined;
    ratingAverage?: number | undefined;
    resourcesCount?: number | undefined;
    toolsCount?: number | undefined;
}, {
    status: "published" | "unpublished" | "archived" | "deprecated";
    capabilities: {
        prompts?: boolean | undefined;
        resources?: boolean | undefined;
        tools?: boolean | undefined;
    };
    createdAt: string;
    description: string;
    identifier: string;
    manifestUrl: string;
    name: string;
    updatedAt: string;
    visibility: "public" | "private" | "internal";
    author?: string | undefined;
    category?: string | undefined;
    commentCount?: number | undefined;
    connectionType?: "local" | "remote" | "hybrid" | undefined;
    github?: {
        url: string;
        language?: string | undefined;
        license?: string | undefined;
        stars?: number | undefined;
    } | undefined;
    homepage?: string | undefined;
    icon?: string | undefined;
    installCount?: number | undefined;
    isClaimed?: boolean | undefined;
    isFeatured?: boolean | undefined;
    isOfficial?: boolean | undefined;
    isValidated?: boolean | undefined;
    promptsCount?: number | undefined;
    ratingAverage?: number | undefined;
    ratingCount?: number | undefined;
    resourcesCount?: number | undefined;
    toolsCount?: number | undefined;
}>;
/**
 * Interface for admin-managed plugin items.
 * Extends the market plugin item with administrative properties.
 */
interface AdminPluginItem extends MarketPluginItem {
    /** Unique numeric identifier for the plugin in the database */
    id: number;
    /** User ID of the plugin owner */
    ownerId: number;
    /** Publication status of the plugin */
    status: 'published' | 'unpublished' | 'archived';
    /** Visibility level controlling who can access the plugin */
    visibility: 'public' | 'private' | 'internal';
}
/**
 * Plugin version database model.
 * Represents a specific version of a plugin in the database.
 */
interface PluginVersion {
    /** Creation timestamp (ISO 8601 format) */
    createdAt: string;
    /** Unique numeric identifier for the version */
    id: number;
    /** Whether this is the latest version of the plugin */
    isLatest: boolean;
    /** Whether this version has been validated by the system */
    isValidated: boolean;
    /** The full manifest data for this version */
    manifest: PluginManifest;
    /** URL to the manifest file, or null if stored directly */
    manifestUrl: string | null;
    /** Additional metadata for this version */
    meta: Record<string, any> | null;
    /** ID of the parent plugin */
    pluginId: number;
    /** Number of prompts provided by this version */
    promptsCount: number;
    /** Number of resources provided by this version */
    resourcesCount: number;
    /** Number of tools provided by this version */
    toolsCount: number;
    /** Last update timestamp (ISO 8601 format) */
    updatedAt: string;
    /** Semantic version string (e.g., "1.0.0") */
    version: string;
}
/**
 * Detailed admin plugin item with version history.
 * Used for displaying complete plugin information in the admin interface.
 */
interface AdminPluginItemDetail extends Omit<AdminPluginItem, 'manifestUrl'> {
    /** Full manifest data for the current version */
    manifest: PluginManifest;
    /** List of all versions of this plugin */
    versions: PluginVersion[];
}
/**
 * Admin deployment option with database ID.
 * Extends the basic deployment option with a database identifier.
 */
interface AdminDeploymentOption extends DeploymentOption {
    /** Unique numeric identifier for the deployment option */
    id: number;
}
/**
 * Admin system dependency with database ID.
 * Extends the basic system dependency with a database identifier.
 */
interface AdminSystemDependency extends SystemDependency {
    /** Unique numeric identifier for the system dependency */
    id: number;
}
/**
 * Plugin version localization data.
 * Represents localized content for a specific plugin version in a particular language.
 */
interface PluginVersionLocalization {
    /** Creation timestamp (ISO 8601 format) */
    createdAt: string;
    /** Localized description of the plugin */
    description: string;
    /** Unique numeric identifier for the localization */
    id: number;
    /** Language/locale code (e.g., 'en-US', 'zh-CN') */
    locale: string;
    /** Localized display name of the plugin */
    name: string;
    /** ID of the parent plugin version */
    pluginVersionId: number;
    /** Localized summary of the plugin */
    summary?: string;
    /** Array of localized tags for categorization and search */
    tags?: string[];
}
/**
 * 不完整i18n插件项
 * 表示pluginVersionLocalizations只有1个条目的插件
 */
interface IncompleteI18nPlugin {
    /** 插件标识符 */
    identifier: string;
    /** 本地化条目数量 */
    localizationCount: number;
    /** 插件ID */
    pluginId: number;
    /** 插件版本 */
    version: string;
}
/**
 * Range Data Point Interface
 * Defines the structure for daily trend data points in analysis
 */
interface RangeDataPoint {
    /** Current period count */
    count: number;
    /** Date in YYYY-MM-DD format */
    date: string;
    /** Previous period count for comparison */
    prevCount: number;
}
/**
 * Range Statistics Interface
 * Defines the structure for range-based statistics
 */
interface RangeStats {
    /** Array of daily data points */
    data: RangeDataPoint[];
    /** Display configuration */
    display: string;
    /** Total sum for previous period */
    prevSum: number;
    /** Total sum for current period */
    sum: number;
}
/**
 * Range query parameters for trend analysis
 */
interface RangeQuery {
    /** Display configuration */
    display: string;
    /** Optional previous period range for comparison */
    prevRange?: [string, string];
    /** Date range as [startDate, endDate] */
    range: [string, string];
}

/**
 * Plugin Call Report Types
 *
 * This module defines the types for plugin call reporting functionality.
 * These types support users reporting their plugin method invocations to help improve
 * plugin performance monitoring and provide usage analytics.
 * These types are shared between the API server and client SDKs.
 */
/**
 * Plugin method types
 */
type PluginMethodType = 'tool' | 'prompt' | 'resource';
/**
 * Custom plugin information for non-marketplace plugins
 */
interface CustomPluginInfo {
    avatar?: string;
    /** Plugin description */
    description?: string;
    /** Plugin name/title */
    name?: string;
}
/**
 * Call report request data
 */
interface CallReportRequest {
    /** Call execution duration in milliseconds */
    callDurationMs: number;
    /** Client ID (optional, for M2M authentication) */
    clientId?: string;
    /** Client IP address (real user IP) */
    clientIp?: string;
    /** Custom plugin information (required if isCustomPlugin is true) */
    customPluginInfo?: CustomPluginInfo;
    /** Error code if call failed */
    errorCode?: string;
    /** Error message if call failed */
    errorMessage?: string;
    /** Plugin identifier */
    identifier: string;
    /** Input parameters sent to the method */
    inputParams?: any;
    /** Whether this is a custom/local plugin (not from marketplace) */
    isCustomPlugin?: boolean;
    /** Additional metadata about the call */
    metadata?: Record<string, any>;
    /** Specific method name being called */
    methodName: string;
    /** Plugin method type (tool/prompt/resource) */
    methodType: PluginMethodType;
    /** Output/response from the method */
    outputResult?: any;
    /** Platform information */
    platform?: string;
    /** Request size in bytes */
    requestSizeBytes?: number;
    /** Response size in bytes */
    responseSizeBytes?: number;
    /** Session ID for correlating multiple calls */
    sessionId?: string;
    /** Whether the call was successful */
    success: boolean;
    /** Trace ID for distributed tracing */
    traceId?: string;
    /** User agent (real user agent) */
    userAgent?: string;
    /** Plugin version */
    version: string;
}
/**
 * Call report response data
 */
interface CallReportResponse {
    /** Message about the processing result */
    message: string;
    /** Whether the report was successfully recorded */
    success: boolean;
}
/**
 * Call statistics data
 */
interface CallStats {
    /** Average call duration in milliseconds */
    averageCallTime: number;
    /** Call statistics by method type */
    byMethodType: Record<PluginMethodType, {
        averageCallTime: number;
        failedCalls: number;
        successRate: number;
        successfulCalls: number;
        totalCalls: number;
    }>;
    /** Statistics by plugin source (marketplace vs custom) */
    byPluginSource: {
        custom: {
            averageCallTime: number;
            successRate: number;
            totalCalls: number;
        };
        marketplace: {
            averageCallTime: number;
            successRate: number;
            totalCalls: number;
        };
    };
    /** Number of failed calls */
    failedCalls: number;
    /** Success rate as percentage */
    successRate: number;
    /** Number of successful calls */
    successfulCalls: number;
    /** Most common call errors */
    topErrors: Array<{
        count: number;
        errorCode: string;
        errorMessage: string;
    }>;
    /** Most frequently called methods */
    topMethods: Array<{
        averageCallTime: number;
        count: number;
        methodName: string;
        methodType: PluginMethodType;
        successRate: number;
    }>;
    /** Total number of call attempts */
    totalCalls: number;
}
/**
 * Call log entry data
 */
interface CallLogEntry {
    /** Call execution duration in milliseconds */
    callDurationMs: number;
    /** When the log was created */
    createdAt: string;
    /** Custom plugin information */
    customPluginInfo?: CustomPluginInfo | null;
    /** Error code if failed */
    errorCode?: string | null;
    /** Error message if failed */
    errorMessage?: string | null;
    /** Log entry ID */
    id: number;
    /** Plugin identifier */
    identifier: string;
    /** Whether this is a custom plugin */
    isCustomPlugin: boolean;
    /** Method name */
    methodName: string;
    /** Plugin method type */
    methodType: PluginMethodType;
    /** Platform information */
    platform?: string | null;
    /** Request size in bytes */
    requestSizeBytes?: number | null;
    /** Response size in bytes */
    responseSizeBytes?: number | null;
    /** Session ID */
    sessionId?: string | null;
    /** Whether call was successful */
    success: boolean;
    /** Trace ID */
    traceId?: string | null;
    /** Plugin version */
    version: string;
}

/**
 * Plugin Install Report Types
 *
 * This module defines the types for plugin installation reporting functionality.
 * These types support users reporting their installation attempts to help improve
 * plugin validation and provide analytics. These types are shared between the API server and client SDKs.
 */

/**
 * Install report request data
 */
interface InstallReportRequest {
    /** Client ID (optional, for M2M authentication) */
    clientId?: string;
    /** Client IP address (real user IP) */
    clientIp?: string;
    /** Error code if installation failed */
    errorCode?: string;
    /** Error message if installation failed */
    errorMessage?: string;
    /** Plugin identifier */
    identifier: string;
    /** Installation duration in milliseconds */
    installDurationMs?: number;
    /** Installation parameters used */
    installParams?: any;
    /** Plugin manifest information */
    manifest?: Pick<PluginManifest, 'prompts' | 'tools' | 'resources'>;
    /** Additional metadata */
    metadata?: Record<string, any>;
    /** Platform information */
    platform?: string;
    /** Whether the installation was successful */
    success: boolean;
    /** User agent (real user agent) */
    userAgent?: string;
    /** Plugin version */
    version: string;
}
/**
 * Install report response data
 */
interface InstallReportResponse {
    /** Whether the manifest was used to update plugin version data */
    manifestUpdated?: boolean;
    /** Message about the processing result */
    message: string;
    /** Whether a new version was created based on the report */
    newVersionCreated?: boolean;
    /** Whether the report was successfully recorded */
    success: boolean;
}
/**
 * Install statistics data
 */
interface InstallStats {
    /** Average installation time in milliseconds */
    averageInstallTime: number;
    /** Number of failed installations */
    failedInstalls: number;
    /** Success rate as percentage */
    successRate: number;
    /** Number of successful installations */
    successfulInstalls: number;
    /** Most common installation errors */
    topErrors: Array<{
        count: number;
        errorCode: string;
        errorMessage: string;
    }>;
    /** Total number of installation attempts */
    totalInstalls: number;
}
/**
 * Install log entry data
 */
interface InstallLogEntry {
    /** When the log was created */
    createdAt: string;
    /** Error code if failed */
    errorCode?: string | null;
    /** Error message if failed */
    errorMessage?: string | null;
    /** Log entry ID */
    id: number;
    /** Plugin identifier */
    identifier: string;
    /** Installation duration in milliseconds */
    installDurationMs: number;
    /** Platform information */
    platform?: string | null;
    /** Whether installation was successful */
    success: boolean;
    /** Plugin version */
    version: string;
}

export { type AdminDeploymentOption, type AdminPluginItem, type AdminPluginItemDetail, AdminPluginItemSchema, type AdminSystemDependency, type BasePluginItem, BasePluginItemSchema, type CallLogEntry, type CallReportRequest, type CallReportResponse, type CallStats, type CategoryItem, type CategoryListQuery, type CategoryListResponse, type ConnectionConfig, type ConnectionType, ConnectionTypeEnum, type CustomPluginInfo, type DeploymentOption, type IncompleteI18nPlugin, type InstallFailureAnalysis, type InstallFailureAnalysisQuery, type InstallLogEntry, type InstallReportRequest, type InstallReportResponse, type InstallStats, type InstallationDetails, type InstallationMethod, InstallationMethodEnum, type MarketItemBase, type MarketPluginItem, PluginCapabilitiesSchema, type PluginCompatibility, type PluginConnectionType, PluginConnectionTypeEnum, type PluginItemDetail, type PluginManifest, type PluginMethodType, type PluginPrompt, type PluginResource, type PluginSortBy, type PluginTool, type PluginVersion, type PluginVersionLocalization, type PluginVersionSummary, type PromptArgument, type RangeDataPoint, type RangeQuery, type RangeStats, type SystemDependency, type TopPlugin, type TopPluginsQuery };
