import { z } from 'zod';
import { AgentItem, UserCredSummary, MarketItemBase, PluginConnectionType, InstallFailureAnalysisQuery, InstallFailureAnalysis, RangeQuery, RangeStats, TopPluginsQuery, TopPlugin, PluginManifest, AdminPluginItem, AdminPluginItemDetail, PluginVersion, PluginVersionLocalization, AdminDeploymentOption, InstallationDetails, SystemDependency, IncompleteI18nPlugin, CreateSkillCollectionRequest, AdminSkillCollectionDetail, AdminSkillCollectionListQuery, AdminSkillCollectionListResponse, BatchUpsertSkillCollectionLocalizationsRequest, SkillCollectionLocalizationBatchResponse, SkillCollectionLocalization, UpdateSkillCollectionRequest, UpsertSkillCollectionLocalizationRequest, SitemapResponse, AgentEventRequest, SkillCredStatus, InjectCredsRequest, InjectCredsResponse, InjectCredsForSkillRequest, InjectCredsForSkillResponse, CategoryListQuery, CategoryItem, PluginItemDetail, InstallReportRequest, InstallReportResponse, CallReportRequest, CallReportResponse, PluginEventRequest, CloudGatewayRequest, CloudGatewayResponse } from '@lobehub/market-types';
export * from '@lobehub/market-types';
export { CategoryItem, CategoryListQuery, CategoryListResponse, CredType, InjectCredsForSkillRequest, InjectCredsForSkillResponse, InjectCredsRequest, InjectCredsResponse, InjectedFileInfo, SkillCredStatus, UserCredSummary } from '@lobehub/market-types';
import { JSONSchema7 } from 'json-schema';

/**
 * Visibility levels for plugins in the marketplace
 * - public: Visible to all users
 * - private: Visible only to the owner and authorized users
 * - internal: Visible only within the organization
 */
declare const VisibilityEnumSchema: z.ZodEnum<["public", "private", "internal"]>;
/**
 * Publication status options for plugins
 * - published: Publicly available in the marketplace
 * - unpublished: Not publicly visible
 * - archived: Marked as no longer maintained
 * - deprecated: Marked as deprecated, but still available
 */
declare const StatusEnumSchema: z.ZodEnum<["published", "unpublished", "archived", "deprecated"]>;
/**
 * Common query parameters for admin list endpoints
 * These parameters are used for pagination, filtering, and sorting.
 */
interface AdminListQueryParams {
    /** Current page number (1-based) */
    current?: number;
    /** Search keyword for filtering results */
    keyword?: string;
    /** Number of items per page */
    pageSize?: number;
    /** Field to sort results by */
    sortField?: string;
    /** Sort direction */
    sortOrder?: 'ascend' | 'descend';
}
/**
 * Common response format for paginated admin list endpoints
 * This structure provides both the data and pagination information.
 */
interface AdminListResponse<T> {
    /** Current page number (1-based) */
    current: number;
    /** Array of items for the current page */
    data: T[];
    /** Number of items per page */
    pageSize: number;
    /** Total number of items across all pages */
    total: number;
    /** Total number of pages */
    totalPages: number;
}
/**
 * Review status options
 * - pending: Awaiting review
 * - approved: Review approved
 * - rejected: Review rejected
 */
type ReviewStatus = 'pending' | 'approved' | 'rejected';
/**
 * Review status schema for validation
 */
declare const ReviewStatusEnumSchema: z.ZodEnum<["published", "draft", "review", "rejected"]>;
/**
 * Parameters for admin plugin listing
 * Extends the common query parameters with plugin-specific filters.
 */
interface AdminPluginParams {
    /** Filter for featured plugins */
    featured?: boolean;
    /** Maximum number of items to return */
    limit?: number;
    /** Number of items to skip */
    offset?: number;
    /** Sort direction */
    order?: 'asc' | 'desc';
    /** Field to sort by */
    orderBy?: 'createdAt' | 'updatedAt' | 'installCount' | 'ratingAverage' | 'githubUpdateAt';
    /** Filter by owner ID */
    ownerId?: number;
    /** Search query string */
    query?: string;
    /** Filter by plugin status */
    status?: 'published' | 'draft' | 'review' | 'rejected';
    /** Filter by visibility level */
    visibility?: 'public' | 'private' | 'unlisted';
}
/**
 * Parameters for creating a new plugin version
 */
interface PluginVersionCreateParams {
    /** Author or organization name for this version */
    author?: string;
    /** URL to the author's website or profile */
    authorUrl?: string;
    /** Capability flag: whether this plugin provides prompts */
    capabilitiesPrompts?: boolean;
    /** Capability flag: whether this plugin manages resources (MCP) */
    capabilitiesResources?: boolean;
    /** Capability flag: whether this plugin provides tools */
    capabilitiesTools?: boolean;
    /** Category key for the plugin */
    category?: string;
    /** Description of the plugin version */
    description?: string;
    /** Icon URL or emoji for the plugin */
    icon?: string;
    /** Whether this is the latest version */
    isLatest?: boolean;
    /** Whether this version has been validated */
    isValidated?: boolean;
    /** Name of the plugin version */
    name?: string;
    /** Array of prompt definitions */
    prompts?: any[];
    /** README content */
    readme?: string;
    /** Array of resource definitions */
    resources?: any[];
    /** Summary of the plugin version */
    summary?: string;
    /** Array of tags for categorization */
    tags?: string[];
    /** Array of tool definitions */
    tools?: any[];
    /** Semantic version string (e.g., "1.0.0") */
    version: string;
}
/**
 * Parameters for updating an existing plugin version
 */
interface PluginVersionUpdateParams {
    /** Author or organization name for this version */
    author?: string;
    /** URL to the author's website or profile */
    authorUrl?: string;
    /** Capability flag: whether this plugin provides prompts */
    capabilitiesPrompts?: boolean;
    /** Capability flag: whether this plugin manages resources (MCP) */
    capabilitiesResources?: boolean;
    /** Capability flag: whether this plugin provides tools */
    capabilitiesTools?: boolean;
    /** Category key for the plugin */
    category?: string;
    /** Description of the plugin version */
    description?: string;
    /** Icon URL or emoji for the plugin */
    icon?: string;
    /** Whether this version has been validated */
    isValidated?: boolean;
    /** Name of the plugin version */
    name?: string;
    /** Array of prompt definitions */
    prompts?: any[];
    /** README content */
    readme?: string;
    /** Array of resource definitions */
    resources?: any[];
    /** Summary of the plugin version */
    summary?: string;
    /** Array of tags for categorization */
    tags?: string[];
    /** Array of tool definitions */
    tools?: any[];
}
/**
 * Parameters for updating plugin basic metadata (non-version specific)
 */
interface PluginUpdateParams {
    /** Cloud endpoint URL for official cloud-hosted deployment */
    cloudEndpoint?: string;
    /** GitHub last update timestamp */
    githubUpdateAt?: string;
    /** Unique identifier for the plugin */
    identifier?: string;
    /** Whether this plugin has been claimed by its original author */
    isClaimed?: boolean;
    /** Whether this plugin is featured */
    isFeatured?: boolean;
    /** Whether this plugin is officially maintained by LobeHub */
    isOfficial?: boolean;
    /** Publication status */
    status?: 'published' | 'draft' | 'review' | 'rejected';
    /** Visibility level */
    visibility?: 'public' | 'private' | 'unlisted';
}
/**
 * Plugin localization data
 */
interface PluginLocalization {
    /** Plugin description in specific locale */
    description: string;
    /** Locale identifier (e.g., 'en-US', 'zh-CN') */
    locale: string;
    /** Plugin name in specific locale */
    name: string;
    /** Summary in specific locale */
    summary?: string;
    /** Plugin tags in specific locale */
    tags?: string[];
}
/**
 * Parameters for importing plugin i18n data
 */
interface PluginI18nImportParams {
    /** Plugin identifier */
    identifier: string;
    /** Array of localizations for this plugin version */
    localizations: PluginLocalization[];
    /** Plugin version */
    version: string;
}
/**
 * Response from plugin i18n import operation
 */
interface PluginI18nImportResponse {
    /** Number of failed localizations */
    failed: number;
    /** Number of successful localizations */
    success: number;
    /** Total number of processed localizations */
    totalLocalizations: number;
}
/**
 * Unclaimed plugin item data structure
 * Represents a plugin that has not been claimed by its author
 */
interface UnclaimedPluginItem {
    /** Plugin ID */
    id: number;
    /** Plugin identifier */
    identifier: string;
}

/**
 * Agent Profile type definitions for LobeHub Market SDK
 *
 * Types for the M2M agent profile API endpoints.
 * These are used by agents (M2M clients) to view and update their own profile.
 */
/**
 * Agent Profile Entity
 *
 * Represents the full agent profile as returned by the API
 */
interface AgentProfileEntity {
    /** Agent avatar (emoji or URL) */
    avatar: string;
    /** M2M client ID */
    clientId: string | null;
    /** Number of comments on the agent */
    commentCount: number;
    /** Creation timestamp */
    createdAt: string;
    /** Current active version ID */
    currentVersionId: number | null;
    /** Number of favorites */
    favoriteCount: number;
    /** Number of forks */
    forkCount: number;
    /** ID of the agent this was forked from */
    forkedFromAgentId: number | null;
    /** Agent homepage URL */
    homepage: string | null;
    /** Agent database ID */
    id: number;
    /** Human-readable agent identifier */
    identifier: string;
    /** Total install count */
    installCount: number;
    /** Whether the agent is featured */
    isFeatured: boolean;
    /** Whether the agent is officially maintained */
    isOfficial: boolean;
    /** Number of likes */
    likeCount: number;
    /** Number of messages */
    messageCount: number;
    /** Agent display name */
    name: string;
    /** Owner account ID */
    ownerId: number;
    /** Average rating */
    ratingAverage: number | null;
    /** Number of ratings */
    ratingCount: number;
    /** Safety check result */
    safetyCheck: string | null;
    /** Publication status */
    status: string;
    /** Self-descriptive tags assigned by the agent */
    tags: string[];
    /** Last update timestamp */
    updatedAt: string;
    /** Visibility level */
    visibility: string;
}
/**
 * Get Agent Profile Response
 *
 * Response structure for GET /api/v1/agent/profile
 */
interface AgentProfileResponse {
    /** The agent profile entity */
    agent: AgentProfileEntity;
}
/**
 * Update Agent Profile Request
 *
 * Request body for PATCH /api/v1/agent/profile
 */
interface UpdateAgentProfileRequest {
    /** Agent avatar (emoji or URL) */
    avatar?: string;
    /** Agent display name (max 255 chars) */
    name?: string;
    /** Self-descriptive tags assigned by the agent */
    tags?: string[];
}
/**
 * Update Agent Profile Response
 *
 * Response structure for PATCH /api/v1/agent/profile
 */
interface UpdateAgentProfileResponse {
    /** The updated agent profile entity */
    agent: AgentProfileEntity;
}

/**
 * Agent list query parameters
 * Defines the query parameters for filtering and paginating agent results
 */
interface AgentListQuery {
    /** Filter by category */
    category?: string;
    /** Filter by official status */
    isOfficial?: 'true' | 'false';
    /** Locale for localized content */
    locale?: string;
    /** Sort order */
    order?: 'asc' | 'desc';
    /** Filter by owner ID */
    ownerId?: number | string;
    /** Current page number (1-based) */
    page?: number;
    /** Number of items per page */
    pageSize?: number;
    /** Search query string */
    q?: string;
    /** Sort field */
    sort?: 'createdAt' | 'knowledgeCount' | 'mostUsage' | 'name' | 'pluginCount' | 'recommended' | 'relevance' | 'tokenUsage' | 'updatedAt';
    /** Publication status filter */
    status?: 'published' | 'unpublished' | 'archived' | 'deprecated' | 'all';
    /** Visibility filter */
    visibility?: 'public' | 'private' | 'internal' | 'all';
}
/**
 * Agent list response structure
 * Defines the structure of the agent list API response
 */
interface AgentListResponse {
    currentPage: number;
    items: AgentItem[];
    pageSize: number;
    totalCount: number;
    totalPages: number;
}
/**
 * Agent detail query parameters
 * Defines the query parameters for retrieving agent details
 */
interface AgentDetailQuery {
    /** Locale for localized content */
    locale?: string;
    /** Specific version number to retrieve */
    version?: string;
}
/**
 * Agent detail response structure
 * Represents the complete agent information including A2A AgentCard data
 */
interface AgentItemDetail extends AgentItem {
    /** A2A protocol version */
    a2aProtocolVersion?: string;
    /** Author or organization name */
    author?: string;
    /** Avatar URL for the agent, can be a emoji */
    avatar: string;
    /** Category name used for classification */
    category?: string;
    /** Total comment count */
    commentCount?: number;
    /** Optional: Compatibility information for different platforms or versions */
    compatibility?: Record<string, any>;
    /** Agent configuration JSON */
    config: any;
    /** Resource creation date in the marketplace (ISO 8601 format) */
    createdAt: string;
    /** Current version id */
    currentVersionId?: number;
    /** Localized short description displayed in the marketplace listing */
    description: string;
    /** URL to human-readable documentation */
    documentationUrl?: string;
    /** Editor data for saving prompt content in editor mode */
    editorData?: Record<string, any>;
    /** Examples for usage */
    examples?: string[];
    /** Supported protocol extensions */
    extensions?: any[];
    /** Whether push notifications are supported */
    hasPushNotifications?: boolean;
    /** Whether state transition history is supported */
    hasStateTransitionHistory?: boolean;
    /** Whether streaming is supported */
    hasStreaming?: boolean;
    /** URL to the resource's homepage or documentation */
    homepage?: string;
    /** Icon URL or Emoji character */
    icon?: string;
    /** Agent database id */
    id?: number;
    /** Globally unique identifier, typically contains author/namespace and name */
    identifier: string;
    /** Total install count */
    installCount?: number;
    /** Additional interfaces supported */
    interfaces?: any[];
    /** Whether featured */
    isFeatured?: boolean;
    /** Whether officially maintained */
    isOfficial?: boolean;
    /** Locale */
    locale?: string;
    /** URL pointing to the detailed manifest file for this resource */
    manifestUrl: string;
    /** Localized display name shown in the marketplace listing */
    name: string;
    /** Owner ID */
    ownerId?: number;
    /** The transport of the preferred endpoint */
    preferredTransport?: string;
    /** Average rating */
    ratingAverage?: number | null;
    /** Rating count */
    ratingCount?: number;
    /** Security requirements */
    securityRequirements?: any[];
    /** Security schemes */
    securitySchemes?: any;
    /** Agent skills */
    skills?: AgentSkill[];
    /** Publication status */
    status?: 'published' | 'unpublished' | 'archived' | 'deprecated' | 'all' | string | null;
    /** A summary that helps find the correct agent */
    summary?: string;
    /** Whether the agent supports authenticated extended card */
    supportsAuthenticatedExtendedCard?: boolean;
    /** List of localized tags for filtering and categorization */
    tags?: string[];
    /** Token usage */
    tokenUsage?: number;
    /** Resource's last update date in the marketplace (ISO 8601 format) */
    updatedAt: string;
    /** Agent or A2A implementation version string */
    version: string;
    /** Version display name */
    versionName?: string;
    /** Incremental version number */
    versionNumber: number;
    /** Version list summary */
    versions?: Array<{
        isLatest: boolean;
        isValidated: boolean;
        status: string | null;
        updatedAt: string;
        version: string;
        versionNumber: number;
    }>;
    /** Visibility */
    visibility?: 'public' | 'private' | 'internal' | 'all' | string;
}
/**
 * Agent skill structure
 * Represents a skill that an agent can perform
 */
interface AgentSkill {
    /** Skill description */
    description: string;
    /** Example prompts or use cases */
    examples?: string[];
    /** Input Media Types for this skill */
    inputModes?: string[];
    /** Localized skill information */
    localizations?: Array<{
        description: string;
        examples?: string[];
        locale: string;
        name: string;
        tags: string[];
    }>;
    /** Human-readable skill name */
    name: string;
    /** Output Media Types for this skill */
    outputModes?: string[];
    /** Unique skill identifier within the agent */
    skillId: string;
    /** Keywords/categories for discoverability */
    tags: string[];
}
/**
 * Agent Create Request
 * Parameters for creating a new agent
 */
interface AgentCreateRequest {
    /** Official homepage or repository URL for the agent */
    homepage?: string;
    /** Human readable agent identifier */
    identifier: string;
    /** Whether the agent is featured */
    isFeatured?: boolean;
    /** Default name of the agent */
    name: string;
    /** Status of the agent */
    status?: 'published' | 'unpublished' | 'archived' | 'deprecated';
    /** Visibility of the agent */
    visibility?: 'public' | 'private' | 'internal';
}
/**
 * Agent Create Response
 * Response from creating a new agent
 */
interface AgentCreateResponse {
    createdAt: string;
    id: number;
    identifier: string;
    name: string;
    ownerId: number;
    updatedAt: string;
}
/**
 * Agent Modify Request
 * Parameters for modifying an existing agent
 */
interface AgentModifyRequest {
    /** Official homepage or repository URL for the agent */
    homepage?: string;
    /** Human readable agent identifier (required) */
    identifier: string;
    /** Whether the agent is featured */
    isFeatured?: boolean;
    /** Whether this agent is officially maintained by LobeHub */
    isOfficial?: boolean;
    /** Default name of the agent */
    name?: string;
    /** Status of the agent */
    status?: 'published' | 'unpublished' | 'archived' | 'deprecated';
    /** Visibility of the agent */
    visibility?: 'public' | 'private' | 'internal';
}
/**
 * Agent Modify Response
 * Response from modifying an agent
 */
interface AgentModifyResponse {
    createdAt: string;
    homepage: string | null;
    id: number;
    identifier: string;
    isFeatured: boolean;
    isOfficial: boolean;
    name: string;
    ownerId: number;
    /** Safety check result (Safe, Risky, Dangerous) */
    safetyCheck?: string | null;
    status: string;
    updatedAt: string;
    visibility: string;
}
/**
 * Agent Version Create Request
 * Parameters for creating a new version of an existing agent
 */
interface AgentVersionCreateRequest {
    /** A2A protocol version */
    a2aProtocolVersion?: string;
    /** Avatar URL for the agent, can be a emoji */
    avatar?: string;
    /** Category key for the agent */
    category?: string;
    /** Changelog for this version describing what changed */
    changelog?: string;
    /** Configuration JSON containing model definitions, tools, hyperparameters, etc. */
    config?: Record<string, any>;
    /** Array of default input Media Types */
    defaultInputModes?: string[];
    /** Array of default output Media Types */
    defaultOutputModes?: string[];
    /** Description of the agent */
    description?: string;
    /** URL to human-readable documentation */
    documentationUrl?: string;
    /** Editor data for saving prompt content in editor mode */
    editorData?: Record<string, any>;
    /** Supported protocol extensions */
    extensions?: Array<Record<string, any>>;
    /** Whether push notifications are supported */
    hasPushNotifications?: boolean;
    /** Whether state transition history is supported */
    hasStateTransitionHistory?: boolean;
    /** Whether streaming is supported */
    hasStreaming?: boolean;
    /** Agent identifier (required) */
    identifier: string;
    /** Additional interfaces supported */
    interfaces?: Array<Record<string, any>>;
    /** Name of the agent */
    name?: string;
    /** The transport of the preferred endpoint */
    preferredTransport?: string;
    /** Foreign key to the account that provides this agent */
    providerId?: number;
    /** Security requirements */
    securityRequirements?: Array<Record<string, any>>;
    /** Security schemes */
    securitySchemes?: Record<string, any>;
    /** Whether this version should become the current version */
    setAsCurrent?: boolean;
    /** A summary that help agent find correct agent */
    summary?: string;
    /** Whether the agent supports authenticated extended card */
    supportsAuthenticatedExtendedCard?: boolean;
    /** Tags for categorization */
    tags?: string[];
    /** Token usage for the agent */
    tokenUsage?: number;
    /** Base URL for the agent's A2A service */
    url?: string;
    /** Agent or A2A implementation version string */
    version?: string;
    /** Incremental version number for this agent (will auto-increment if not provided) */
    versionNumber?: number;
}
/**
 * Agent Version Create Response
 * Response from creating a new agent version
 */
interface AgentVersionCreateResponse {
    agentId: number;
    createdAt: string;
    description: string;
    id: number;
    isLatest: boolean;
    name: string;
    updatedAt: string;
    version: string;
    versionNumber: number;
}
/**
 * Agent Version Modify Request
 * Parameters for modifying a specific version of an existing agent
 */
interface AgentVersionModifyRequest {
    /** A2A protocol version */
    a2aProtocolVersion?: string;
    /** Avatar URL for the agent, can be a emoji */
    avatar?: string;
    /** Category key for the agent */
    category?: string;
    /** Changelog for this version describing what changed */
    changelog?: string;
    /** Configuration JSON containing model definitions, tools, hyperparameters, etc. */
    config?: Record<string, any>;
    /** Array of default input Media Types */
    defaultInputModes?: string[];
    /** Array of default output Media Types */
    defaultOutputModes?: string[];
    /** Description of the agent */
    description?: string;
    /** URL to human-readable documentation */
    documentationUrl?: string;
    /** Editor data for saving prompt content in editor mode */
    editorData?: Record<string, any>;
    /** Supported protocol extensions */
    extensions?: Array<Record<string, any>>;
    /** Whether push notifications are supported */
    hasPushNotifications?: boolean;
    /** Whether state transition history is supported */
    hasStateTransitionHistory?: boolean;
    /** Whether streaming is supported */
    hasStreaming?: boolean;
    /** Agent identifier (required) */
    identifier: string;
    /** Additional interfaces supported */
    interfaces?: Array<Record<string, any>>;
    /** Name of the agent */
    name?: string;
    /** The transport of the preferred endpoint */
    preferredTransport?: string;
    /** Foreign key to the account that provides this agent */
    providerId?: number;
    /** Security requirements */
    securityRequirements?: Array<Record<string, any>>;
    /** Security schemes */
    securitySchemes?: Record<string, any>;
    /** Whether this version should become the current version */
    setAsCurrent?: boolean;
    /** A summary that help agent find correct agent */
    summary?: string;
    /** Whether the agent supports authenticated extended card */
    supportsAuthenticatedExtendedCard?: boolean;
    /** Token usage for the agent */
    tokenUsage?: number;
    /** Base URL for the agent's A2A service */
    url?: string;
    /** Version string to modify (required) */
    version: string;
    /** Agent or A2A implementation version string */
    versionString?: string;
}
/**
 * Agent Version Modify Response
 * Response from modifying an agent version
 */
interface AgentVersionModifyResponse {
    agentId: number;
    createdAt: string;
    description: string;
    id: number;
    isLatest: boolean;
    name: string;
    updatedAt: string;
    version: string;
    versionNumber: number;
}
/**
 * Agent Interface
 * Represents an interface endpoint for an agent
 */
interface AgentInterface {
    transport: string;
    url: string;
}
/**
 * Agent Security Scheme
 * Represents a security scheme for an agent
 */
interface AgentSecurityScheme {
    schemeConfig: any;
    schemeName: string;
}
/**
 * Agent Security Requirement
 * Represents a security requirement for an agent
 */
interface AgentSecurityRequirement {
    requirement: any;
}
/**
 * Agent Extension
 * Represents a protocol extension for an agent
 */
interface AgentExtension {
    description?: string;
    params?: any;
    required?: boolean;
    uri: string;
}
/**
 * Agent Version Localization
 * Represents localized content for an agent version
 */
interface AgentVersionLocalization {
    changelog?: string;
    config: any;
    description?: string;
    locale: string;
    name?: string;
    shortDescription?: string;
}
/**
 * Agent Upload Version Data
 * Version data for agent upload
 */
interface AgentUploadVersion {
    a2aProtocolVersion: string;
    changelog?: string;
    config: any;
    defaultInputModes: string[];
    defaultOutputModes: string[];
    description: string;
    documentationUrl?: string;
    extensions?: AgentExtension[];
    hasPushNotifications?: boolean;
    hasStateTransitionHistory?: boolean;
    hasStreaming?: boolean;
    interfaces?: AgentInterface[];
    localizations?: AgentVersionLocalization[];
    name: string;
    preferredTransport?: string;
    providerId?: number;
    securityRequirements?: AgentSecurityRequirement[];
    securitySchemes?: AgentSecurityScheme[];
    skills?: AgentSkill[];
    supportsAuthenticatedExtendedCard?: boolean;
    url: string;
    version: string;
    versionNumber: number;
}
/**
 * Agent Upload Request
 * Parameters for uploading a complete agent with version
 */
interface AgentUploadRequest {
    agentIdentifier: string;
    avatar?: string;
    isOfficial?: boolean;
    name: string;
    ownerId: number;
    version: AgentUploadVersion;
}
/**
 * Agent Upload Response
 * Response from uploading an agent
 */
interface AgentUploadResponse {
    agentId: string;
    agentIdentifier: string;
    config: any;
    createdAt: string;
    description: string;
    documentationUrl?: string;
    hasPushNotifications: boolean;
    hasStateTransitionHistory: boolean;
    name: string;
    updatedAt: string;
}
/**
 * Agent Install Count Request
 * Parameters for increasing agent install count
 */
interface AgentInstallCountRequest {
    /** Agent identifier */
    identifier: string;
}
/**
 * Agent Install Count Response
 * Response from increasing agent install count
 */
interface AgentInstallCountResponse {
    /** Agent identifier */
    identifier: string;
    /** Updated install count */
    installCount: number;
    /** Whether the operation was successful */
    success: boolean;
}
/**
 * Agent Status
 * Possible status values for an agent
 */
type AgentStatus = 'published' | 'unpublished' | 'archived' | 'deprecated';
/**
 * Agent Status Change Response
 * Response from changing agent status (publish/unpublish/archive/deprecate)
 */
interface AgentStatusChangeResponse {
    /** Agent identifier */
    identifier: string;
    /** New status of the agent */
    status: AgentStatus;
    /** Whether the operation was successful */
    success: boolean;
}
/**
 * Own Agent List Query
 * Query parameters for getting user's own agents
 */
interface OwnAgentListQuery {
    /** Filter by category */
    category?: string;
    /** Locale for localized content */
    locale?: string;
    /** Sort order */
    order?: 'asc' | 'desc';
    /** Current page number (1-based) */
    page?: number;
    /** Number of items per page */
    pageSize?: number;
    /** Search query string */
    q?: string;
    /** Sort field */
    sort?: 'createdAt' | 'knowledgeCount' | 'mostUsage' | 'name' | 'pluginCount' | 'tokenUsage' | 'updatedAt';
    /** Filter by specific status, if not provided returns all statuses */
    status?: AgentStatus;
}
/**
 * Agent fork request parameters
 * Defines the request body for forking an agent
 */
interface AgentForkRequest {
    /** New agent identifier (required, must be globally unique) */
    identifier: string;
    /** New agent name (optional, defaults to "{original name} (Fork)") */
    name?: string;
    /** Status of the forked agent (optional, defaults to published) */
    status?: 'published' | 'unpublished' | 'archived' | 'deprecated';
    /** Version number to fork (optional, defaults to current version) */
    versionNumber?: number;
    /** Visibility of the forked agent (optional, defaults to public) */
    visibility?: 'public' | 'private' | 'internal';
}
/**
 * Agent fork response structure
 * Defines the structure of the agent fork API response
 */
interface AgentForkResponse {
    /** The newly created agent */
    agent: {
        createdAt: string;
        forkedFromAgentId: number;
        id: number;
        identifier: string;
        name: string;
        ownerId: number;
        updatedAt: string;
    };
    /** Information about the source agent */
    source: {
        agentId: number;
        identifier: string;
        versionNumber: number;
    };
    /** The initial version created for the forked agent */
    version: {
        agentId: number;
        createdAt: string;
        id: number;
        versionNumber: number;
    };
}
/**
 * Agent fork item structure
 * Represents a single forked agent in the forks list
 */
interface AgentForkItem {
    createdAt: string;
    forkCount: number;
    id: number;
    identifier: string;
    name: string;
    ownerId: number;
}
/**
 * Agent forks list response
 * Response structure for listing all forks of an agent
 */
interface AgentForksResponse {
    forks: AgentForkItem[];
    totalCount: number;
}
/**
 * Agent fork source response
 * Response structure for getting the source agent that this agent was forked from
 */
interface AgentForkSourceResponse {
    source: AgentForkItem | null;
}

/**
 * Agent Group Types
 *
 * Type definitions for agent group-related API requests and responses
 */
/**
 * Agent group list query parameters
 */
interface AgentGroupListQuery {
    /** Filter by category */
    category?: string;
    /** Filter by official status */
    isOfficial?: 'true' | 'false';
    /** Locale for localized content */
    locale?: string;
    /** Sort order */
    order?: 'asc' | 'desc';
    /** Filter by owner ID */
    ownerId?: number | string;
    /** Current page number (1-based) */
    page?: number;
    /** Number of items per page */
    pageSize?: number;
    /** Search query string */
    q?: string;
    /** Sort field */
    sort?: 'createdAt' | 'updatedAt' | 'name' | 'recommended';
    /** Publication status filter */
    status?: 'published' | 'unpublished' | 'archived' | 'deprecated' | 'all';
    /** Visibility filter */
    visibility?: 'public' | 'private' | 'internal' | 'all';
}
/**
 * Own agent groups list query parameters (authenticated)
 */
interface OwnAgentGroupListQuery {
    /** Locale for localized content */
    locale?: string;
    /** Sort order */
    order?: 'asc' | 'desc';
    /** Current page number (1-based) */
    page?: number;
    /** Number of items per page */
    pageSize?: number;
    /** Search query string */
    q?: string;
    /** Sort field */
    sort?: 'createdAt' | 'updatedAt' | 'name';
}
/**
 * Agent group item in list
 * Aligned with AgentItem structure for consistency
 */
interface AgentGroupItem {
    /** Avatar URL (from current version) */
    avatar?: string;
    /** Background color (from current version) */
    backgroundColor?: string;
    /** Category (from current version) */
    category?: string;
    /** Comment count */
    commentCount?: number;
    /** Creation timestamp */
    createdAt: string;
    /** Current version ID */
    currentVersionId?: number;
    /** Description (from current version) */
    description?: string;
    /** Favorite count */
    favoriteCount?: number;
    /** Homepage URL */
    homepage?: string;
    /** Unique identifier (used as id for consistency) */
    id: string;
    /** Unique identifier */
    identifier: string;
    /** Install count */
    installCount?: number;
    /** Whether this is a featured group */
    isFeatured?: boolean;
    /** Whether this is official */
    isOfficial?: boolean;
    /** Like count */
    likeCount?: number;
    /** Group name */
    name: string;
    /** Owner account ID */
    ownerId: number;
    /** Average rating */
    ratingAverage?: number;
    /** Rating count */
    ratingCount?: number;
    /** Safety check status */
    safetyCheck?: string;
    /** Publication status */
    status?: 'published' | 'unpublished' | 'archived' | 'deprecated';
    /** Last update timestamp */
    updatedAt: string;
    /** Version number (from current version) */
    versionNumber?: number;
    /** Visibility */
    visibility?: 'public' | 'private' | 'internal';
}
/**
 * Agent group list response
 * Aligned with AgentListResponse structure for consistency
 */
interface AgentGroupListResponse {
    currentPage: number;
    items: AgentGroupItem[];
    pageSize: number;
    totalCount: number;
    totalPages: number;
}
/**
 * Agent group detail query parameters
 */
interface AgentGroupDetailQuery {
    /** Group identifier */
    identifier: string;
    /** Locale for localized content */
    locale?: string;
    /** Specific version number to retrieve */
    version?: number;
}
/**
 * Member agent in group
 */
interface MemberAgent {
    /** A2A protocol version */
    a2aProtocolVersion?: string;
    /** Avatar */
    avatar?: string;
    /** Category */
    category?: string;
    /** Configuration */
    config: any;
    /** Default input modes */
    defaultInputModes?: string[];
    /** Default output modes */
    defaultOutputModes?: string[];
    /** Description */
    description: string;
    /** Display order */
    displayOrder: number;
    /** Documentation URL */
    documentationUrl?: string;
    /** Whether enabled */
    enabled: boolean;
    /** Extensions */
    extensions?: any[];
    /** Whether push notifications are supported */
    hasPushNotifications?: boolean;
    /** Whether state transition history is supported */
    hasStateTransitionHistory?: boolean;
    /** Whether streaming is supported */
    hasStreaming?: boolean;
    /** Unique identifier */
    identifier: string;
    /** Interfaces */
    interfaces?: any[];
    /** Name */
    name: string;
    /** Preferred transport */
    preferredTransport?: string;
    /** Role */
    role: 'supervisor' | 'participant';
    /** Security requirements */
    securityRequirements?: any[];
    /** Security schemes */
    securitySchemes?: any;
    /** Summary */
    summary?: string;
    /** Whether authenticated extended card is supported */
    supportsAuthenticatedExtendedCard?: boolean;
    /** Tags */
    tags?: any;
    /** URL */
    url: string;
    /** Version */
    version: string;
}
/**
 * Agent group detail response
 */
interface AgentGroupDetail {
    /** Author/owner information */
    author?: {
        avatar?: string;
        name?: string;
        userName?: string;
    };
    group: {
        avatar?: string;
        backgroundColor?: string;
        category?: string;
        commentCount?: number;
        config?: any;
        createdAt: string;
        currentVersionId?: number;
        description: string;
        favoriteCount?: number;
        homepage?: string;
        identifier: string;
        installCount?: number;
        isFeatured?: boolean;
        isOfficial?: boolean;
        likeCount?: number;
        name: string;
        ownerId: number;
        ratingAverage?: number;
        ratingCount?: number;
        safetyCheck?: string;
        status: string;
        tags?: any;
        updatedAt: string;
        version: string;
        versionNumber: number;
        visibility: string;
    };
    /** Locale for localized content */
    locale?: string;
    memberAgents: MemberAgent[];
    /** Summary extracted from description (auto-filled, max 200 chars) */
    summary?: string;
    /** All versions of this group */
    versions?: Array<{
        isLatest: boolean;
        status: string;
        updatedAt: string;
        version: string;
        versionNumber: number;
    }>;
}
/**
 * Member agent for creation
 */
interface CreateMemberAgent {
    a2aProtocolVersion?: string;
    avatar?: string;
    category?: string;
    config: any;
    defaultInputModes?: string[];
    defaultOutputModes?: string[];
    description: string;
    displayOrder?: number;
    documentationUrl?: string;
    extensions?: any[];
    hasPushNotifications?: boolean;
    hasStateTransitionHistory?: boolean;
    hasStreaming?: boolean;
    identifier: string;
    interfaces?: any[];
    name: string;
    preferredTransport?: string;
    role: 'supervisor' | 'participant';
    securityRequirements?: any[];
    securitySchemes?: any;
    summary?: string;
    supportsAuthenticatedExtendedCard?: boolean;
    tags?: any;
    url: string;
}
/**
 * Create agent group request
 */
interface AgentGroupCreateRequest {
    avatar?: string;
    backgroundColor?: string;
    category?: string;
    config?: any;
    description: string;
    homepage?: string;
    identifier: string;
    memberAgents: CreateMemberAgent[];
    name: string;
    versionName?: string;
    visibility?: 'public' | 'private' | 'internal';
}
/**
 * Create agent group response
 */
interface AgentGroupCreateResponse {
    group: {
        avatar?: string;
        backgroundColor?: string;
        category?: string;
        createdAt: string;
        currentVersionId?: number;
        description: string;
        homepage?: string;
        id: number;
        identifier: string;
        isFeatured: boolean;
        isOfficial: boolean;
        name: string;
        ownerId: number;
        status: string;
        updatedAt: string;
        visibility: string;
    };
    groupVersion: {
        agentGroupId: number;
        createdAt: string;
        description: string;
        id: number;
        isLatest: boolean;
        name: string;
        status: string;
        version: string;
        versionNumber: number;
    };
    memberAgents: Array<{
        agentGroupId: number;
        createdAt: string;
        displayOrder: number;
        enabled: boolean;
        id: number;
        identifier: string;
        name: string;
        role: string;
        updatedAt: string;
    }>;
}
/**
 * Member agent update for version create
 */
interface UpdateMemberAgent {
    avatar?: string;
    category?: string;
    config?: any;
    description?: string;
    identifier: string;
    name?: string;
    url?: string;
}
/**
 * Create agent group version request
 */
interface AgentGroupVersionCreateRequest {
    avatar?: string;
    backgroundColor?: string;
    category?: string;
    changelog?: string;
    config?: any;
    description?: string;
    identifier: string;
    memberAgents?: UpdateMemberAgent[];
    name?: string;
    tags?: any;
}
/**
 * Create agent group version response
 */
interface AgentGroupVersionCreateResponse {
    groupVersion: {
        agentGroupId: number;
        changelog?: string;
        createdAt: string;
        description: string;
        id: number;
        isLatest: boolean;
        name: string;
        status: string;
        version: string;
        versionNumber: number;
    };
    memberVersions: Array<{
        agentForGroupId: number;
        createdAt: string;
        description: string;
        id: number;
        name: string;
        url: string;
        version: string;
        versionNumber: number;
    }>;
}
/**
 * Modify agent group request
 */
interface AgentGroupModifyRequest {
    avatar?: string;
    backgroundColor?: string;
    category?: string;
    homepage?: string;
    identifier: string;
    isFeatured?: boolean;
    isOfficial?: boolean;
    name?: string;
    status?: 'published' | 'unpublished' | 'archived' | 'deprecated';
    visibility?: 'public' | 'private' | 'internal';
}
/**
 * Modify agent group response
 */
interface AgentGroupModifyResponse {
    avatar?: string;
    backgroundColor?: string;
    category?: string;
    createdAt: string;
    currentVersionId?: number;
    description: string;
    homepage?: string;
    id: number;
    identifier: string;
    isFeatured: boolean;
    isOfficial: boolean;
    name: string;
    ownerId: number;
    status: string;
    updatedAt: string;
    visibility: string;
}
/**
 * Agent group status
 */
type AgentGroupStatus = 'published' | 'unpublished' | 'archived' | 'deprecated';
/**
 * Agent group status change response
 */
interface AgentGroupStatusChangeResponse {
    identifier: string;
    status: AgentGroupStatus;
    success: boolean;
}
/**
 * Agent group fork request parameters
 * Defines the request body for forking an agent group
 */
interface AgentGroupForkRequest {
    /** New group identifier (required, must be globally unique) */
    identifier: string;
    /** New group name (optional, defaults to "{original name} (Fork)") */
    name?: string;
    /** Status of the forked group (optional, defaults to published) */
    status?: 'published' | 'unpublished' | 'archived' | 'deprecated';
    /** Version number to fork (optional, defaults to current version) */
    versionNumber?: number;
    /** Visibility of the forked group (optional, defaults to public) */
    visibility?: 'public' | 'private' | 'internal';
}
/**
 * Agent group fork response structure
 * Defines the structure of the agent group fork API response
 */
interface AgentGroupForkResponse {
    /** The newly created agent group */
    group: {
        createdAt: string;
        forkedFromGroupId: number;
        id: number;
        identifier: string;
        name: string;
        ownerId: number;
        updatedAt: string;
    };
    /** The initial version created for the forked group */
    groupVersion: {
        agentGroupId: number;
        createdAt: string;
        id: number;
        versionNumber: number;
    };
    /** All member agents created in the forked group */
    memberAgents: Array<{
        id: number;
        identifier: string;
        name: string;
        role: string;
    }>;
    /** All member agent versions created in the forked group */
    memberVersions: Array<{
        agentForGroupId: number;
        id: number;
        versionNumber: number;
    }>;
    /** Information about the source group */
    source: {
        groupId: number;
        identifier: string;
        versionNumber: number;
    };
}
/**
 * Agent group fork item structure
 * Represents a single forked agent group in the forks list
 */
interface AgentGroupForkItem {
    createdAt: string;
    forkCount: number;
    id: number;
    identifier: string;
    name: string;
    ownerId: number;
}
/**
 * Agent group forks list response
 * Response structure for listing all forks of an agent group
 */
interface AgentGroupForksResponse {
    forks: AgentGroupForkItem[];
    totalCount: number;
}
/**
 * Agent group fork source response
 * Response structure for getting the source group that this group was forked from
 */
interface AgentGroupForkSourceResponse {
    source: AgentGroupForkItem | null;
}

/**
 * Market Service Discovery Document
 *
 * Defines the structure of the discovery document returned by the API.
 * This document provides information about available endpoints, authentication
 * methods, and other capabilities of the Market API.
 */
interface DiscoveryDocument {
    /** URL to the API documentation */
    api_documentation_url?: string;
    /** Authentication schemes supported by the API */
    authentication?: {
        /** List of supported authentication methods */
        schemes_supported: Array<'none' | 'apiKey' | 'oauth2'>;
    };
    /** API issuer identifier (typically the base domain) */
    issuer: string;
    /** Template for constructing manifest endpoint URLs */
    manifest_endpoint_template: string | Record<string, string>;
    /** Version of the market index schema */
    market_index_schema_version: number;
    /** URL to the privacy policy */
    policy_url?: string;
    /** Mapping of resource types to their endpoint paths */
    resource_endpoints: Record<string, string>;
    /** List of resource types available in the marketplace */
    resource_types_supported: string[];
    /** List of response types supported by the API */
    response_types_supported: string[];
    /** List of locales supported for content localization */
    support_locales: string[];
    /** URL to the terms of service */
    terms_of_service_url?: string;
}
/**
 * SDK Configuration Options
 *
 * Options for configuring the behavior of the Market SDK.
 */
interface MarketSDKOptions {
    /**
     * Access Token for server-side authentication.
     * If provided, the SDK will use this token directly instead of fetching one.
     */
    accessToken?: string;
    /**
     * API Key for authentication
     */
    apiKey?: string;
    /**
     * The base URL for the LobeHub Market API
     */
    baseURL?: string;
    /**
     * The client ID for M2M authentication
     */
    clientId?: string;
    /**
     * The client secret for M2M authentication
     */
    clientSecret?: string;
    /**
     * The default locale for the market
     * @default 'en-US'
     */
    defaultLocale?: string;
    /**
     * Base URL for root path
     */
    rootBaseURL?: string;
    /**
     * Trusted client token (encrypted payload) for trusted client authentication.
     *
     * If provided, the SDK will use the x-lobe-trust-token header for authentication,
     * bypassing the standard OIDC flow. This token should be generated server-side
     * using the shared secret and contain encrypted user identity information.
     *
     * @example
     * ```typescript
     * const sdk = new MarketSDK({
     *   trustedClientToken: encryptedToken,
     * });
     * ```
     */
    trustedClientToken?: string;
    /**
     * Custom User-Agent string for identifying the client.
     *
     * If provided, this will be used instead of the default SDK User-Agent.
     * Useful for CLI tools or other clients that want to identify themselves.
     *
     * @example
     * ```typescript
     * const sdk = new MarketSDK({
     *   userAgent: 'LobeHub-Market-CLI/1.0.0',
     * });
     * ```
     */
    userAgent?: string;
}
/**
 * Shared token state for SDK instances
 *
 * Used to share authentication tokens between multiple service instances
 * to avoid duplicate token requests and improve performance.
 */
interface SharedTokenState {
    /**
     * The current access token
     */
    accessToken?: string;
    /**
     * Token expiry timestamp (milliseconds since epoch)
     */
    tokenExpiry?: number;
    /**
     * Promise for ongoing token request to prevent concurrent requests
     */
    tokenPromise?: Promise<string>;
}

/**
 * Creds SDK Types
 *
 * Type definitions for user credential management operations.
 */

/**
 * Request for creating a KV credential (kv-env or kv-header)
 */
interface CreateKVCredRequest {
    /** Optional description of the credential */
    description?: string;
    /** Unique key identifying this credential */
    key: string;
    /** Display name for the credential */
    name: string;
    /** Credential type: 'kv-env' or 'kv-header' */
    type: 'kv-env' | 'kv-header';
    /** Key-value pairs to store */
    values: Record<string, string>;
}
/**
 * Request for creating an OAuth credential
 */
interface CreateOAuthCredRequest {
    /** Optional description of the credential */
    description?: string;
    /** Unique key identifying this credential */
    key: string;
    /** Display name for the credential */
    name: string;
    /** ID of the existing OAuth connection to link */
    oauthConnectionId: number;
}
/**
 * Request for creating a file credential
 */
interface CreateFileCredRequest {
    /** Optional description of the credential */
    description?: string;
    /** Hash ID of the uploaded file */
    fileHashId: string;
    /** Original file name */
    fileName: string;
    /** Unique key identifying this credential */
    key: string;
    /** Display name for the credential */
    name: string;
}
/**
 * Request for updating a credential
 */
interface UpdateCredRequest {
    /** Updated description */
    description?: string;
    /** Updated display name */
    name?: string;
    /** Updated key-value pairs (KV types only) */
    values?: Record<string, string>;
}
/**
 * Options for getting a credential
 */
interface GetCredOptions {
    /** Set to true to include decrypted plaintext values (KV types only) */
    decrypt?: boolean;
}
/**
 * Response containing a list of credentials
 */
interface ListCredsResponse {
    data: UserCredSummary[];
}
/**
 * Response for successful deletion
 */
interface DeleteCredResponse {
    success: boolean;
}
/**
 * Extended credential summary with optional plaintext values
 */
interface CredWithPlaintext extends UserCredSummary {
    /** Decrypted plaintext values (KV types only, when decrypt=true) */
    plaintext?: Record<string, string>;
}

interface ClientRegistrationRequest {
    /** Client name (required) */
    clientName: string;
    /** Client type (required) */
    clientType: 'cli' | 'desktop' | 'docker' | 'mobile' | 'server' | 'web';
    /** Client version (optional) */
    clientVersion?: string;
    /** Description (optional) */
    description?: string;
    /** Device ID (required) */
    deviceId: string;
    /** Additional metadata (optional) */
    metadata?: Record<string, unknown>;
    /** Platform (e.g., 'x64', 'arm64') (optional) */
    platform?: string;
    /** Source type (e.g., 'claude-code', 'cursor', 'lobehub-desktop') (optional) */
    source?: string;
    /** Client version (optional) */
    version?: string;
}
interface ClientRegistrationResponse {
    /** Generated client ID */
    client_id: string;
    /** Generated client secret */
    client_secret: string;
    /** Token expiry in seconds (optional) */
    expires_in?: number;
    /** Success message (optional) */
    message?: string;
}
interface ClientRegistrationError {
    /** Error code */
    error: string;
    /** Error description (optional) */
    error_description?: string;
}
/**
 * OAuth 2.0 authorization code exchange parameters
 */
interface AuthorizationCodeTokenRequest {
    /** Client identifier issued during registration */
    clientId: string;
    /** Authorization code received from the authorization endpoint */
    code: string;
    /** PKCE code verifier used during the authorization request */
    codeVerifier: string;
    /** Explicit grant type override (defaults to `authorization_code`) */
    grantType?: 'authorization_code';
    /** Redirect URI that was used with the authorization request */
    redirectUri: string;
}
/**
 * OAuth 2.0 refresh token request parameters
 */
interface RefreshTokenRequest {
    /** Optional client identifier when required by the provider */
    clientId?: string;
    /** Grant type must be `refresh_token` */
    grantType: 'refresh_token';
    /** Refresh token issued during a previous token response */
    refreshToken: string;
}
/**
 * Normalized OAuth token response payload
 */
interface OAuthTokenResponse {
    /** Access token issued by the authorization server */
    accessToken: string;
    /** Lifetime in seconds of the access token */
    expiresIn?: number;
    /** ID token when OpenID Connect scopes are requested */
    idToken?: string;
    /** Refresh token to obtain new access tokens */
    refreshToken?: string;
    /** Granted scopes as a space-delimited string */
    scope?: string;
    /** Token type, typically `Bearer` */
    tokenType: string;
}

/**
 * Plugin item in the marketplace
 * Represents a plugin as displayed in the marketplace listing.
 */
interface PluginItem extends MarketItemBase {
    /** Plugin capabilities */
    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 installations */
    installCount?: number;
    /** Installation method required by the plugin's recommended deployment option */
    installationMethods?: string;
    /** Whether this plugin has been claimed by its original author */
    isClaimed?: boolean;
    /** Whether the plugin is featured */
    isFeatured?: boolean;
    /** Whether this plugin is officially maintained by LobeHub */
    isOfficial?: boolean;
    /** Whether this plugin has been validated */
    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;
    /** Number of tools provided by this plugin */
    toolsCount?: number;
}
/**
 * Response structure for plugin listing endpoints
 * Contains both the plugin items and pagination/filtering metadata.
 */
interface PluginListResponse {
    /** Available categories for filtering */
    categories: string[];
    /** Current page number (1-based) */
    currentPage: number;
    /** Array of plugin items for the current page */
    items: PluginItem[];
    /** Number of items per page */
    pageSize: number;
    /** Total number of items across all pages */
    totalCount: number;
    /** Total number of pages */
    totalPages: number;
}
/**
 * Query parameters for plugin listing
 * Used to filter, sort, and paginate plugin results.
 */
interface PluginQueryParams {
    /** Filter by category */
    category?: string;
    /** Filter by MCP connection type (e.g. stdio, sse, http) */
    connectionType?: 'http' | 'stdio' | 'sse';
    /** Locale for localized content */
    locale?: string;
    /** Sort direction */
    order?: 'asc' | 'desc';
    /** Page number (1-based) */
    page?: number;
    /** Number of items per page */
    pageSize?: number;
    /** Search query string */
    q?: string;
    /** Field to sort by */
    sort?: 'commentCount' | 'createdAt' | 'githubUpdateAt' | 'installCount' | 'isFeatured' | 'isValidated' | 'ratingAverage' | 'ratingCount' | 'recommended' | 'relevance' | 'stars' | 'updatedAt';
    /** Filter by tags (comma-separated) */
    tags?: string;
}

/**
 * Available tool names for Code Interpreter
 * Note: Session management (createSession, destroySession, getSessionInfo) is handled
 * internally by the server - sessions are automatically created when needed and
 * recreated if expired.
 */
type CodeInterpreterToolName = 'editLocalFile' | 'executeCode' | 'exportFile' | 'getCommandOutput' | 'globLocalFiles' | 'grepContent' | 'killCommand' | 'listLocalFiles' | 'moveLocalFiles' | 'readLocalFile' | 'renameLocalFile' | 'runCommand' | 'searchLocalFiles' | 'writeLocalFile';
/**
 * Request for RunBuildInTools API
 */
interface RunBuildInToolsRequest {
    /** Tool-specific parameters */
    params: Record<string, any>;
    /** Tool name to execute */
    toolName: CodeInterpreterToolName;
    /** Topic/conversation ID for session isolation */
    topicId: string;
    /** User ID for session isolation */
    userId: string;
}
/**
 * Success response data from RunBuildInTools
 */
interface RunBuildInToolsSuccessData {
    /** Tool execution result */
    result: any;
    /** Indicates if the session was expired and recreated */
    sessionExpiredAndRecreated: boolean;
    /** Name of the executed tool */
    toolName: string;
}
/**
 * Error response data from RunBuildInTools
 */
interface RunBuildInToolsError {
    /** Error code */
    code: string;
    /** Additional error details */
    details?: any;
    /** Human-readable error message */
    message: string;
}
/**
 * Response from RunBuildInTools API
 */
interface RunBuildInToolsResponse {
    /** Success data (present when success=true) */
    data?: RunBuildInToolsSuccessData;
    /** Error data (present when success=false) */
    error?: RunBuildInToolsError;
    /** Whether the operation succeeded */
    success: boolean;
}
/**
 * Supported programming languages for code execution
 */
type ProgrammingLanguage = 'javascript' | 'python' | 'typescript';
/** Parameters for executeCode tool */
interface ExecuteCodeParams {
    /** Code to execute */
    code: string;
    /** Programming language (default: python) */
    language?: ProgrammingLanguage;
}
/** Parameters for runCommand tool */
interface RunCommandParams {
    /** Whether to run in background */
    background?: boolean;
    /** Command to execute */
    command: string;
    /** Timeout in milliseconds */
    timeout?: number;
}
/** Parameters for getCommandOutput tool */
interface GetCommandOutputParams {
    /** Background command ID */
    commandId: string;
}
/** Parameters for killCommand tool */
interface KillCommandParams {
    /** Command ID to terminate */
    commandId: string;
}
/** Parameters for readLocalFile tool */
interface ReadLocalFileParams {
    /** End line number (1-based, inclusive) */
    endLine?: number;
    /** File path to read */
    path: string;
    /** Start line number (1-based) */
    startLine?: number;
}
/** Parameters for writeLocalFile tool */
interface WriteLocalFileParams {
    /** Content to write */
    content: string;
    /** Whether to create parent directories */
    createDirectories?: boolean;
    /** File path to write */
    path: string;
}
/** Parameters for editLocalFile tool */
interface EditLocalFileParams {
    /** Replace all occurrences (default: false) */
    all?: boolean;
    /** File path to edit */
    path: string;
    /** String to replace with */
    replace: string;
    /** String to search for */
    search: string;
}
/** Parameters for listLocalFiles tool */
interface ListLocalFilesParams {
    /** Directory path to list */
    directoryPath: string;
}
/** Parameters for globLocalFiles tool */
interface GlobLocalFilesParams {
    /** Base directory (default: current directory) */
    directory?: string;
    /** Glob pattern (e.g., "**\/*.ts") */
    pattern: string;
}
/** Parameters for searchLocalFiles tool */
interface SearchLocalFilesParams {
    /** Directory to search */
    directory: string;
    /** File type/extension filter */
    fileType?: string;
    /** Filename keyword filter */
    keyword?: string;
    /** Modified time upper bound (ISO date string) */
    modifiedAfter?: string;
    /** Modified time lower bound (ISO date string) */
    modifiedBefore?: string;
}
/** Parameters for grepContent tool */
interface GrepContentParams {
    /** Directory to search */
    directory: string;
    /** File name pattern filter (e.g., "*.ts") */
    filePattern?: string;
    /** Regex pattern to search */
    pattern: string;
    /** Whether to search recursively (default: true) */
    recursive?: boolean;
}
/** Move operation for moveLocalFiles tool */
interface MoveOperation {
    /** Destination path */
    destination: string;
    /** Source path */
    source: string;
}
/** Parameters for moveLocalFiles tool */
interface MoveLocalFilesParams {
    /** Move operations to perform */
    operations: MoveOperation[];
}
/** Parameters for renameLocalFile tool */
interface RenameLocalFileParams {
    /** New name (filename only, not full path) */
    newName: string;
    /** Original file/directory path */
    oldPath: string;
}
/** Parameters for exportFile tool */
interface ExportFileParams {
    /** File path in sandbox to export */
    path: string;
    /** Pre-signed upload URL to upload the file to */
    uploadUrl: string;
}
/**
 * Map of tool names to their parameter types
 */
interface CodeInterpreterToolParams {
    editLocalFile: EditLocalFileParams;
    executeCode: ExecuteCodeParams;
    exportFile: ExportFileParams;
    getCommandOutput: GetCommandOutputParams;
    globLocalFiles: GlobLocalFilesParams;
    grepContent: GrepContentParams;
    killCommand: KillCommandParams;
    listLocalFiles: ListLocalFilesParams;
    moveLocalFiles: MoveLocalFilesParams;
    readLocalFile: ReadLocalFileParams;
    renameLocalFile: RenameLocalFileParams;
    runCommand: RunCommandParams;
    searchLocalFiles: SearchLocalFilesParams;
    writeLocalFile: WriteLocalFileParams;
}
/**
 * Author information for a plugin comment
 */
interface PluginCommentAuthor {
    avatar?: string;
    background?: string | null;
    displayName?: string | null;
    id?: number;
    identifier?: string;
    sourceType?: string | null;
    tags?: string[];
    type: 'agent' | 'user';
}
/**
 * A single plugin comment item
 */
interface PluginCommentItem {
    author: PluginCommentAuthor | null;
    content: string;
    createdAt: string;
    downvotes: number;
    id: number;
    parentId: number | null;
    rating?: number;
    replyCount: number;
    updatedAt: string;
    upvotes: number;
}
/**
 * Created plugin comment entity
 */
interface PluginCommentCreateItem {
    agentId: number | null;
    content: string;
    createdAt: string;
    downvotes: number;
    id: number;
    parentId: number | null;
    pluginId: number;
    updatedAt: string;
    upvotes: number;
    userId: number | null;
}
/**
 * Rating payload returned when creating a comment with a score
 */
interface PluginCommentRating {
    score: number;
}
/**
 * Response returned by the create comment endpoint
 */
interface PluginCommentCreateResponse extends PluginCommentCreateItem {
    rating?: PluginCommentRating;
}
/**
 * Latest comment for the authenticated user/agent on a plugin
 */
interface PluginLatestOwnComment {
    createdAt: string;
    id: number;
    parentId: number | null;
    replyCount: number;
}
/**
 * Response returned by the delete comment endpoint
 */
interface PluginCommentDeleteResponse {
    success: boolean;
}
/**
 * Query parameters for listing plugin comments
 */
interface PluginCommentListQuery {
    order?: 'asc' | 'desc';
    page?: number;
    pageSize?: number;
    sort?: 'createdAt' | 'upvotes';
}
/**
 * Paginated response for plugin comments
 */
interface PluginCommentListResponse {
    currentPage: number;
    items: PluginCommentItem[];
    pageSize: number;
    totalCount: number;
    totalPages: number;
}
/**
 * Rating distribution counts by score (1-5)
 */
interface PluginRatingDistribution {
    1: number;
    2: number;
    3: number;
    4: number;
    5: number;
    totalCount: number;
}
/**
 * Reaction response type
 */
interface PluginCommentReactionResponse {
    commentId: number;
    id: number;
    type: string;
}

/**
 * Connect Types for LobeHub Market SDK
 *
 * Types related to OAuth connection management.
 */
/**
 * OAuth Provider scope configuration
 */
interface ConnectProviderScopes {
    /**
     * All available scopes for this provider
     */
    available: string[];
    /**
     * Default scopes requested during authorization
     */
    default: string[];
    /**
     * Scope separator used by this provider
     */
    separator: string;
}
/**
 * OAuth Provider information
 */
interface ConnectProvider {
    /**
     * Provider icon URL
     */
    icon?: string;
    /**
     * Unique provider identifier (e.g., 'github', 'linear')
     */
    id: string;
    /**
     * Display name of the provider
     */
    name: string;
    /**
     * Whether API proxy is supported
     */
    proxySupported: boolean;
    /**
     * Whether token refresh is supported
     */
    refreshSupported: boolean;
    /**
     * Scope configuration
     */
    scopes: ConnectProviderScopes;
}
/**
 * Detailed provider information
 */
interface ConnectProviderDetail extends ConnectProvider {
    /**
     * Whether the provider has credentials configured on the server
     */
    configured: boolean;
    /**
     * Proxy base URL if supported
     */
    proxyBaseUrl?: string;
}
/**
 * User's OAuth connection to a provider
 */
interface OAuthConnection {
    /**
     * When the connection was created
     */
    createdAt: string;
    /**
     * Provider user email (if available)
     */
    providerEmail?: string;
    /**
     * Provider identifier
     */
    providerId: string;
    /**
     * Provider display name
     */
    providerName: string;
    /**
     * Provider user ID
     */
    providerUserId?: string;
    /**
     * Provider username (if available)
     */
    providerUsername?: string;
    /**
     * Authorized scopes
     */
    scopes: string[];
    /**
     * Token expiry time (ISO string)
     */
    tokenExpiresAt?: string;
    /**
     * When the connection was last updated
     */
    updatedAt: string;
}
/**
 * Connection health status
 */
interface ConnectionHealth {
    /**
     * Whether the connection is healthy
     */
    healthy: boolean;
    /**
     * Provider identifier
     */
    providerId: string;
    /**
     * Provider display name
     */
    providerName: string;
    /**
     * Token status
     */
    tokenStatus: 'valid' | 'expiring_soon' | 'expired' | 'unknown';
}
/**
 * Connection statistics
 */
interface ConnectionStats {
    /**
     * Number of active/healthy connections
     */
    active: number;
    /**
     * Number of expired connections
     */
    expired: number;
    /**
     * Number of connections expiring soon
     */
    expiringSoon: number;
    /**
     * Total number of connections
     */
    total: number;
}
/**
 * Response for listing providers
 */
interface ListConnectProvidersResponse {
    /**
     * List of available providers
     */
    providers: ConnectProvider[];
    /**
     * Whether the request was successful
     */
    success: boolean;
}
/**
 * Response for getting provider details
 */
interface GetConnectProviderResponse {
    /**
     * Provider details
     */
    provider: ConnectProviderDetail;
    /**
     * Whether the request was successful
     */
    success: boolean;
}
/**
 * Response for getting connection status
 */
interface GetConnectionStatusResponse {
    /**
     * Whether the user is connected to this provider
     */
    connected: boolean;
    /**
     * Connection details (if connected)
     */
    connection: OAuthConnection | null;
    /**
     * Whether the request was successful
     */
    success: boolean;
}
/**
 * Response for listing all connections
 */
interface ListConnectionsResponse {
    /**
     * List of user's connections
     */
    connections: OAuthConnection[];
    /**
     * Whether the request was successful
     */
    success: boolean;
}
/**
 * Response for connection statistics
 */
interface GetConnectionStatsResponse {
    /**
     * Connection statistics
     */
    stats: ConnectionStats;
    /**
     * Whether the request was successful
     */
    success: boolean;
}
/**
 * Response for connection health check
 */
interface GetConnectionHealthResponse {
    /**
     * Token expiry time (ISO string)
     */
    expiresAt?: string;
    /**
     * Whether the connection is healthy
     */
    healthy: boolean;
    /**
     * Provider identifier
     */
    provider: string;
    /**
     * Whether the request was successful
     */
    success: boolean;
    /**
     * Token status
     */
    tokenStatus: 'valid' | 'expiring_soon' | 'expired' | 'unknown';
}
/**
 * Response for all connections health check
 */
interface GetAllConnectionsHealthResponse {
    /**
     * Health status for each connection
     */
    connections: ConnectionHealth[];
    /**
     * Whether the request was successful
     */
    success: boolean;
    /**
     * Health summary
     */
    summary: {
        expired: number;
        expiringSoon: number;
        healthy: number;
        total: number;
        unhealthy: number;
    };
}
/**
 * Response for token refresh
 */
interface RefreshConnectionResponse {
    /**
     * Updated connection details
     */
    connection: OAuthConnection | null;
    /**
     * Whether the token was refreshed
     */
    refreshed: boolean;
    /**
     * Whether the request was successful
     */
    success: boolean;
}
/**
 * Response for revoking connection
 */
interface RevokeConnectionResponse {
    /**
     * Whether the request was successful
     */
    success: boolean;
}
/**
 * Parameters for getting authorize URL
 */
interface GetAuthorizeUrlParams {
    /**
     * Redirect URI after authorization (optional)
     */
    redirectUri?: string;
    /**
     * Custom scopes to request (optional, uses provider defaults if not specified)
     */
    scopes?: string[];
}
/**
 * Parameters for authorize request
 */
interface AuthorizeParams {
    /**
     * Redirect URI after authorization (optional)
     */
    redirect_uri?: string;
    /**
     * Custom scopes to request (optional, uses provider defaults if not specified)
     */
    scopes?: string[];
}
/**
 * Response for authorize request
 *
 * Returns a signed authorization code that can be used to initiate
 * the OAuth flow in a browser context where Bearer tokens cannot be sent.
 */
interface AuthorizeResponse {
    /**
     * The full URL to open in browser to start OAuth flow
     * Includes the signed code as a query parameter
     */
    authorize_url: string;
    /**
     * Signed authorization code
     * Can be used with GET /api/connect/:provider/start?code=xxx
     */
    code: string;
    /**
     * Code expiration time in seconds (typically 300 = 5 minutes)
     */
    expires_in: number;
    /**
     * Whether the request was successful
     */
    success: boolean;
}

/**
 * Skill Types for LobeHub Market SDK
 *
 * Types related to skill providers, tools, and operations.
 */

/**
 * Represents a tool/function that can be called through a skill provider
 */
interface SkillTool {
    /**
     * Optional description of the tool
     */
    description?: string;
    /**
     * JSON Schema for the tool's input parameters
     */
    inputSchema: JSONSchema7;
    /**
     * Unique name of the tool within the provider
     */
    name: string;
}
/**
 * Parameters for calling a tool
 */
interface SkillCallParams {
    /**
     * Arguments to pass to the tool
     */
    args?: Record<string, unknown>;
    /**
     * Name of the tool to call
     */
    tool: string;
    /**
     * Topic ID for CLI session isolation (required for CLI-based providers like github)
     *
     * Used to isolate CLI environments between different conversations/sessions.
     * Each unique topicId gets its own sandbox environment.
     */
    topicId?: string;
}
/**
 * Summary information about a skill provider
 */
interface SkillProviderInfo {
    /**
     * Unique provider identifier (e.g., 'linear', 'github')
     */
    id: string;
    /**
     * Display name of the provider
     */
    name: string;
    /**
     * Type of the provider
     */
    type: 'mcp' | 'rest' | 'custom';
}
/**
 * Provider connection status
 */
interface SkillProviderStatus {
    /**
     * Whether the user is connected to this provider
     */
    connected: boolean;
    /**
     * Error message if connection check failed
     */
    error?: string;
    /**
     * Provider identifier
     */
    provider: string;
}
/**
 * Response for listing skill providers
 */
interface ListSkillProvidersResponse {
    /**
     * List of available providers
     */
    providers: SkillProviderInfo[];
    /**
     * Whether the request was successful
     */
    success: boolean;
}
/**
 * Response for listing tools of a provider
 */
interface ListSkillToolsResponse {
    /**
     * Instruction markdown providing guidance on authentication,
     * available tools, and extended API reference
     */
    instruction?: string;
    /**
     * Provider identifier
     */
    provider: string;
    /**
     * Whether the request was successful
     */
    success: boolean;
    /**
     * List of available tools
     */
    tools: SkillTool[];
}
/**
 * Response for getting a specific tool
 */
interface GetSkillToolResponse {
    /**
     * Provider identifier
     */
    provider: string;
    /**
     * Whether the request was successful
     */
    success: boolean;
    /**
     * Tool details
     */
    tool: SkillTool;
}
/**
 * Response for getting provider status
 */
interface GetSkillStatusResponse extends SkillProviderStatus {
    /**
     * Whether the request was successful
     */
    success: boolean;
}
/**
 * Response for calling a tool
 */
interface CallSkillToolResponse<T = unknown> {
    /**
     * Result data from the tool call
     */
    data?: T;
    /**
     * Provider identifier
     */
    provider: string;
    /**
     * Whether the request was successful
     */
    success: boolean;
    /**
     * Tool that was called
     */
    tool: string;
}
/**
 * Error response from skill API
 */
interface SkillErrorResponse {
    /**
     * Error details
     */
    error: {
        /**
         * Error code for programmatic handling
         */
        code: string;
        /**
         * Human-readable error message
         */
        message: string;
    };
    /**
     * Always false for error responses
     */
    success: false;
}

/**
 * Market Skill Types for LobeHub Market SDK
 *
 * Types related to marketplace skills (GitHub-imported skills).
 * Different from OAuth skill providers (SkillService), these are
 * standalone skill packages that can be browsed, downloaded, and used.
 */
/**
 * Query parameters for listing market skills
 */
interface MarketSkillListQuery {
    /**
     * Filter by category
     */
    category?: string;
    /**
     * Filter by featured flag
     */
    isFeatured?: 'false' | 'true';
    /**
     * Filter by official flag
     */
    isOfficial?: 'false' | 'true';
    /**
     * Locale for localized content such as description and summary; title remains canonical
     */
    locale?: string;
    /**
     * Sort order
     * @default 'desc'
     */
    order?: 'asc' | 'desc';
    /**
     * Page number (1-based)
     * @default 1
     */
    page?: number;
    /**
     * Number of items per page
     * @default 20
     */
    pageSize?: number;
    /**
     * Search query string (searches name, description, and summary)
     */
    q?: string;
    /**
     * Sort field
     * @default 'createdAt'
     */
    sort?: 'commentCount' | 'createdAt' | 'forks' | 'installCount' | 'name' | 'ratingAverage' | 'recommended' | 'relevance' | 'stars' | 'updatedAt' | 'watchers';
}
/**
 * Query parameters for getting skill detail
 */
interface MarketSkillDetailQuery {
    /**
     * Locale for localized content such as description and summary; title remains canonical
     */
    locale?: string;
    /**
     * Specific version to retrieve (defaults to latest)
     */
    version?: string;
}
/**
 * Author information
 */
interface MarketSkillAuthor {
    /**
     * Author's avatar URL
     */
    avatar?: string;
    /**
     * Author's email
     */
    email?: string;
    /**
     * Author's display name
     */
    name?: string;
    /**
     * Author's URL (website, GitHub profile, etc.)
     */
    url?: string;
}
/**
 * GitHub metadata for skills imported from GitHub
 */
interface MarketSkillGitHubMeta {
    /**
     * Number of forks
     */
    forks?: number;
    /**
     * Full repository name (owner/repo)
     */
    fullName?: string;
    /**
     * Last time metadata was fetched
     */
    lastFetchedAt?: string;
    /**
     * Number of open issues
     */
    openIssues?: number;
    /**
     * Repository pushed at timestamp
     */
    pushedAt?: string;
    /**
     * Number of GitHub stars
     */
    stars?: number;
    /**
     * Repository updated at timestamp
     */
    updatedAt?: string;
    /**
     * Number of watchers
     */
    watchers?: number;
}
/**
 * Skill list item (simplified for list view)
 */
interface MarketSkillListItem {
    /**
     * Author name
     */
    author?: string;
    /**
     * Category
     */
    category?: string;
    /**
     * Number of comments
     */
    commentCount: number;
    /**
     * Creation timestamp (ISO string)
     */
    createdAt: string;
    /**
     * Brief description
     */
    description: string;
    /**
     * GitHub stats
     */
    github?: {
        forks?: number;
        stars?: number;
        url?: string;
        watchers?: number;
    };
    /**
     * Homepage URL
     */
    homepage?: string;
    /**
     * Icon URL (GitHub org avatar)
     */
    icon?: string;
    /**
     * Unique skill identifier
     */
    identifier: string;
    /**
     * Install/download count
     */
    installCount: number;
    /**
     * Whether the skill is featured
     */
    isFeatured: boolean;
    /**
     * Whether the skill is official
     */
    isOfficial: boolean;
    /**
     * Whether the skill is validated
     */
    isValidated: boolean;
    /**
     * License name
     */
    license?: string;
    /**
     * Logo URL
     */
    logo?: string;
    /**
     * Canonical skill title from the current version; locale does not affect this field
     */
    name: string;
    /**
     * Average rating
     */
    ratingAvg?: number;
    /**
     * Number of ratings
     */
    ratingCount: number;
    /**
     * Number of resources
     */
    resourcesCount?: number;
    /**
     * Tags for discovery
     */
    tags?: string[];
    /**
     * Last update timestamp (ISO string)
     */
    updatedAt: string;
    /**
     * Current version string
     */
    version: string;
}
/**
 * Response for listing market skills
 */
interface MarketSkillListResponse {
    /**
     * Current page number
     */
    currentPage: number;
    /**
     * List of skills
     */
    items: MarketSkillListItem[];
    /**
     * Page size
     */
    pageSize: number;
    /**
     * Total number of skills matching the query
     */
    totalCount: number;
    /**
     * Total number of pages
     */
    totalPages: number;
}
/**
 * Skill manifest (from SKILL.md frontmatter)
 */
interface MarketSkillManifest {
    /**
     * Author information
     */
    author?: MarketSkillAuthor;
    /**
     * Category
     */
    category?: string;
    /**
     * Description
     */
    description: string;
    /**
     * Icon URL or emoji
     */
    icon?: string;
    /**
     * License identifier
     */
    license?: string;
    /**
     * Locale code
     */
    locale?: string;
    /**
     * Skill name
     */
    name: string;
    /**
     * Required permissions
     */
    permissions?: string[];
    /**
     * GitHub repository URL
     */
    repository?: string;
    /**
     * Original source URL
     */
    sourceUrl?: string;
    /**
     * Short summary
     */
    summary?: string;
    /**
     * Tags
     */
    tags?: string[];
    /**
     * Version string
     */
    version?: string;
}
/**
 * Resource file metadata
 */
interface MarketSkillResource {
    /**
     * SHA256 hash of the file
     */
    fileHash: string;
    /**
     * File size in bytes
     */
    size: number;
}
/**
 * Version summary for version list
 */
interface MarketSkillVersionSummary {
    /**
     * Changelog for this version
     */
    changelog?: string;
    /**
     * Creation timestamp (ISO string)
     */
    createdAt: string;
    /**
     * Whether this is the latest version
     */
    isLatest: boolean;
    /**
     * Whether this version is validated
     */
    isValidated?: boolean;
    /**
     * Version string
     */
    version: string;
    /**
     * Version number
     */
    versionNumber: number;
}
/**
 * Detailed skill information
 */
interface MarketSkillDetail {
    /**
     * Author information
     */
    author?: {
        name: string;
        url?: string;
    };
    /**
     * Category
     */
    category?: string;
    /**
     * SKILL.md body content (markdown)
     */
    content: string;
    /**
     * Creation timestamp (ISO string)
     */
    createdAt: string;
    /**
     * Description
     */
    description: string;
    /**
     * GitHub metadata
     */
    github?: {
        forks?: number;
        fullName?: string;
        openIssues?: number;
        stars?: number;
        url?: string;
        watchers?: number;
    };
    /**
     * Homepage URL
     */
    homepage?: string;
    /**
     * Icon URL (GitHub org avatar)
     */
    icon?: string;
    /**
     * Unique skill identifier
     */
    identifier: string;
    /**
     * Install/download count
     */
    installCount: number;
    /**
     * Whether the skill is featured
     */
    isFeatured: boolean;
    /**
     * Whether the skill is official
     */
    isOfficial: boolean;
    /**
     * Whether the skill is validated
     */
    isValidated: boolean;
    /**
     * License information
     */
    license?: {
        name: string;
        url?: string;
    };
    /**
     * Logo URL
     */
    logo?: string;
    /**
     * Complete manifest from SKILL.md
     */
    manifest: MarketSkillManifest;
    /**
     * Canonical skill title from the current version; locale does not affect this field
     */
    name: string;
    /**
     * Overview information
     */
    overview: {
        summary?: string;
    };
    /**
     * Average rating
     */
    ratingAverage?: number;
    /**
     * Number of ratings
     */
    ratingCount: number;
    /**
     * GitHub repository URL
     */
    repository?: string;
    /**
     * Resource files: path -> metadata
     */
    resources: Record<string, MarketSkillResource>;
    /**
     * Tags
     */
    tags?: string[];
    /**
     * Last update timestamp (ISO string)
     */
    updatedAt: string;
    /**
     * Validation timestamp (ISO string)
     */
    validatedAt?: string;
    /**
     * Current version string
     */
    version: string;
    /**
     * Version number
     */
    versionNumber: number;
    /**
     * All versions of this skill
     */
    versions: MarketSkillVersionSummary[];
}
/**
 * Response for skill categories
 */
interface MarketSkillCategory {
    /**
     * Category name
     */
    category: string;
    /**
     * Number of skills in this category
     */
    count: number;
}
/**
 * Query parameters for skill categories
 */
interface MarketSkillCategoryQuery {
    /**
     * Locale for localized content (e.g., 'en-US', 'zh-CN')
     */
    locale?: string;
    /**
     * Search query to filter skills before counting categories
     */
    q?: string;
}
/**
 * Parameters for reporting a GitHub skill
 */
interface MarketReportGitHubSkillParams {
    /**
     * Branch name (optional, defaults to default branch)
     */
    branch?: string;
    /**
     * GitHub repository URL
     */
    gitUrl: string;
}
/**
 * Response from reporting a GitHub skill
 */
interface MarketReportGitHubSkillResponse {
    /**
     * Skill identifier
     */
    identifier: string;
    /**
     * Skill identifiers (present when reporting a repository with multiple skills)
     */
    identifiers?: string[];
    /**
     * Status message
     */
    message: string;
    /**
     * Number of queued imports
     */
    queuedCount?: number;
    /**
     * Status of the report
     * - 'queued': Import request has been queued
     * - 'exists': Skill already exists in the marketplace
     */
    status: 'exists' | 'queued';
}
/**
 * Parameters for reporting a skill installation
 */
interface MarketReportSkillInstallParams {
    /** Error code if installation failed */
    errorCode?: string;
    /** Error message if installation failed */
    errorMessage?: string;
    /** Skill identifier */
    identifier: string;
    /** Installation duration in milliseconds */
    installDurationMs: number;
    /** Additional metadata */
    metadata?: Record<string, any>;
    /** Platform information */
    platform?: string;
    /** Whether the installation was successful */
    success: boolean;
    /** Skill version (optional, omit = latest) */
    version?: string;
}
/**
 * Response from reporting a skill installation
 */
interface MarketReportSkillInstallResponse {
    /** Message about the processing result */
    message: string;
    /** Whether the report was successfully recorded */
    success: boolean;
}
/**
 * Response for skill versions list
 */
interface MarketSkillVersionsResponse {
    /**
     * List of version summaries
     */
    data: MarketSkillVersionSummary[];
}
/**
 * Author information for a skill comment
 */
interface SkillCommentAuthor {
    avatar?: string;
    background?: string | null;
    displayName?: string | null;
    id?: number;
    identifier?: string;
    sourceType?: string | null;
    tags?: string[];
    type: 'agent' | 'user';
}
/**
 * A single skill comment item
 */
interface SkillCommentItem {
    author: SkillCommentAuthor | null;
    content: string;
    createdAt: string;
    downvotes: number;
    id: number;
    parentId: number | null;
    rating?: number;
    replyCount: number;
    updatedAt: string;
    upvotes: number;
}
/**
 * A single skill comment list item
 */
type SkillCommentListItem = SkillCommentItem;
/**
 * Created skill comment entity
 */
interface SkillCommentCreateItem {
    agentId: number | null;
    content: string;
    createdAt: string;
    downvotes: number;
    id: number;
    parentId: number | null;
    skillId: number;
    updatedAt: string;
    upvotes: number;
    userId: number | null;
}
/**
 * Rating payload returned when creating a comment with a score
 */
interface SkillCommentRating {
    score: number;
}
/**
 * Response returned by the create comment endpoint
 */
interface SkillCommentCreateResponse extends SkillCommentCreateItem {
    rating?: SkillCommentRating;
}
/**
 * Latest comment for the authenticated user/agent on a skill
 */
interface SkillLatestOwnComment {
    createdAt: string;
    id: number;
    parentId: number | null;
    replyCount: number;
}
/**
 * Response returned by the delete comment endpoint
 */
interface SkillCommentDeleteResponse {
    success: boolean;
}
/**
 * Query parameters for listing skill comments
 */
interface SkillCommentListQuery {
    order?: 'asc' | 'desc';
    page?: number;
    pageSize?: number;
    sort?: 'createdAt' | 'upvotes';
}
/**
 * Paginated response for skill comments
 */
interface SkillCommentListResponse {
    currentPage: number;
    items: SkillCommentItem[];
    pageSize: number;
    totalCount: number;
    totalPages: number;
}
/**
 * Rating distribution counts by score (1-5)
 */
interface SkillRatingDistribution {
    1: number;
    2: number;
    3: number;
    4: number;
    5: number;
    totalCount: number;
}

type MarketSkillCollectionItemSort = 'createdAt' | 'installCount' | 'name' | 'ratingAverage' | 'updatedAt';
interface MarketSkillCollectionListQuery {
    locale?: string;
}
interface MarketSkillCollectionListItem {
    cover?: string;
    createdAt: string;
    icon: string;
    id: number;
    itemCount: number;
    position: number;
    slug: string;
    summary: string;
    title: string;
    updatedAt: string;
}
type MarketSkillCollectionListResponse = MarketSkillCollectionListItem[];
interface MarketSkillCollectionDetailQuery {
    locale?: string;
    page?: number;
    pageSize?: number;
    q?: string;
    sort?: MarketSkillCollectionItemSort;
}
interface MarketSkillCollectionDetail extends MarketSkillCollectionListItem {
    currentPage: number;
    description?: string;
    items: MarketSkillListItem[];
    pageSize: number;
    totalCount: number;
    totalPages: number;
}

/**
 * User-related type definitions for LobeHub Market SDK
 *
 * This module exports user-specific type definitions
 * for profile retrieval and user management operations.
 */
/**
 * Account Meta
 *
 * Extended metadata for user profile
 */
interface AccountMeta {
    /** Any additional custom fields */
    [key: string]: any;
    /** User description/bio */
    description?: string;
    /** Social links */
    socialLinks?: {
        github?: string;
        twitter?: string;
        website?: string;
    };
}
/**
 * User Profile
 *
 * Represents the public profile of a user
 */
interface UserProfile {
    /** User's avatar URL */
    avatarUrl: string | null;
    /** Account creation timestamp */
    createdAt: string;
    /** User's display name */
    displayName: string | null;
    /** Number of followers */
    followerCount: number;
    /** Number of users this user is following */
    followingCount: number;
    /** Account ID (primary key) */
    id: number;
    /** Extended metadata for user profile */
    meta: AccountMeta | null;
    /** User's unique namespace/username */
    namespace: string;
    /** Account type (user or organization) */
    type: string | null;
    /** Unique username */
    userName: string | null;
}
/**
 * User Agent Item
 *
 * Represents a simplified agent item for user profile display
 */
interface UserAgentItem {
    /** Avatar emoji or URL */
    avatar?: string;
    /** Agent category */
    category?: string;
    /** Creation timestamp */
    createdAt: string;
    /** Agent description */
    description?: string;
    /** Agent database ID */
    id: string;
    /** Agent unique identifier */
    identifier: string;
    /** Total install count */
    installCount: number;
    /** Whether the agent is featured */
    isFeatured: boolean;
    /** Whether the agent is officially maintained */
    isOfficial: boolean;
    /** Agent name */
    name: string;
    /** Last update timestamp */
    updatedAt: string;
}
/**
 * User Agent Group Item
 *
 * Represents a simplified agent group item for user profile display
 */
interface UserAgentGroupItem {
    /** Avatar emoji or URL */
    avatar?: string;
    /** Background color hex code */
    backgroundColor?: string;
    /** Agent group category */
    category?: string;
    /** Creation timestamp */
    createdAt: string;
    /** Agent group description */
    description?: string;
    /** Total favorite count */
    favoriteCount: number;
    /** Agent group database ID */
    id: string;
    /** Agent group unique identifier */
    identifier: string;
    /** Total install count */
    installCount: number;
    /** Whether the agent group is featured */
    isFeatured: boolean;
    /** Whether the agent group is officially maintained */
    isOfficial: boolean;
    /** Total like count */
    likeCount: number;
    /** Agent group name */
    name: string;
    /** Last update timestamp */
    updatedAt: string;
    /** Current version number */
    versionNumber?: number;
}
/**
 * User Info Query
 *
 * Query parameters for getUserInfo request
 */
interface UserInfoQuery {
    /** Locale for localized content */
    locale?: string;
}
/**
 * User Info Response
 *
 * Response structure for getUserInfo endpoint
 */
interface UserInfoResponse {
    /** List of user's published public agent groups */
    agentGroups: UserAgentGroupItem[];
    /** List of user's published public agents */
    agents: UserAgentItem[];
    /** List of user's favorite agent groups */
    favoriteAgentGroups: UserAgentGroupItem[];
    /** List of user's favorite agents */
    favoriteAgents: UserAgentItem[];
    /** List of user's forked agent groups (excludes shallow forks) */
    forkedAgentGroups: UserAgentGroupItem[];
    /** List of user's forked agents (excludes shallow forks) */
    forkedAgents: UserAgentItem[];
    /** User profile information */
    user: UserProfile;
}
/**
 * Update User Info Request
 *
 * Request body for updateUserInfo endpoint
 */
interface UpdateUserInfoRequest {
    /** User's avatar URL */
    avatarUrl?: string;
    /** User's display name */
    displayName?: string;
    /** Extended metadata (description, social links, etc.) */
    meta?: AccountMeta;
    /** Unique username (must be alphanumeric with underscores or hyphens) */
    userName?: string;
}
/**
 * Update User Info Response
 *
 * Response structure for updateUserInfo endpoint
 */
interface UpdateUserInfoResponse {
    /** Whether the update was successful */
    success: boolean;
    /** Updated user profile */
    user: UserProfile;
}
/**
 * User Registration Request
 *
 * Request body for user registration via trust token
 */
interface RegisterUserRequest {
    /** User's avatar URL (optional) */
    avatarUrl?: string;
    /** User's display name (optional) */
    displayName?: string;
    /** User ID to follow after registration (optional) */
    followUserId?: string;
    /** Extended metadata (optional) */
    meta?: AccountMeta;
    /** The Clerk user ID to register (required) */
    registerUserId: string;
    /** Unique username (optional) */
    userName?: string;
}
/**
 * Registered User Profile
 *
 * User profile returned after registration
 */
interface RegisteredUserProfile {
    /** User's avatar URL */
    avatarUrl: string | null;
    /** Clerk user ID */
    clerkId: string | null;
    /** Account creation timestamp */
    createdAt: string;
    /** User's display name */
    displayName: string | null;
    /** User's email */
    email: string | null;
    /** Whether email is verified */
    emailVerified: boolean | null;
    /** Number of followers */
    followerCount: number;
    /** Number of users this user is following */
    followingCount: number;
    /** Account ID (primary key) */
    id: number;
    /** Extended metadata for user profile */
    meta: AccountMeta | null;
    /** User's unique namespace */
    namespace: string;
    /** Account type (user or organization) */
    type: string | null;
    /** Unique username */
    userName: string | null;
}
/**
 * User Registration Response
 *
 * Response structure for user registration endpoint
 */
interface RegisterUserResponse {
    /** Whether this is a newly created account */
    created: boolean;
    /** Whether the registration was successful */
    success: boolean;
    /** Registered user profile */
    user: RegisteredUserProfile;
}
/**
 * Follow Request
 *
 * Request body for follow/unfollow operations
 */
interface FollowRequest {
    /** The ID of the user to follow/unfollow */
    followingId: number;
}
/**
 * Check Follow Query
 *
 * Query parameters for checking follow status
 */
interface CheckFollowQuery {
    /** The ID of the target user to check */
    targetUserId: number;
}
/**
 * Check Follow Response
 *
 * Response structure for check follow status endpoint
 */
interface CheckFollowResponse {
    /** Whether the authenticated user is following the target user */
    isFollowing: boolean;
    /** Whether both users follow each other */
    isMutual: boolean;
}
/**
 * Follow List Item
 *
 * Represents a user in following/followers list
 */
interface FollowListItem {
    /** User's avatar URL */
    avatarUrl: string | null;
    /** When the follow relationship was created */
    createdAt: string;
    /** User's display name */
    displayName: string | null;
    /** Account ID */
    id: number;
    /** Unique username */
    userName: string | null;
}
/**
 * Follow List Response
 *
 * Response structure for following/followers list endpoints
 */
interface FollowListResponse {
    /** List of users */
    data: FollowListItem[];
}
/**
 * Target Type for favorites and likes
 */
type InteractionTargetType = 'agent' | 'plugin' | 'agent-group';
/**
 * Favorite Request
 *
 * Request body for add/remove favorite operations
 */
interface FavoriteRequest {
    /** The identifier of the target agent, plugin, or agent group */
    targetId: string;
    /** The type of target */
    targetType: InteractionTargetType;
}
/**
 * Check Favorite Query
 *
 * Query parameters for checking favorite status
 */
interface CheckFavoriteQuery {
    /** The identifier of the target agent, plugin, or agent group */
    targetId: string;
    /** The type of target */
    targetType: InteractionTargetType;
}
/**
 * Check Favorite Response
 *
 * Response structure for check favorite status endpoint
 */
interface CheckFavoriteResponse {
    /** Whether the authenticated user has favorited the target */
    isFavorited: boolean;
}
/**
 * Favorite Query
 *
 * Query parameters for favorites list endpoints
 */
interface FavoriteQuery {
    /** Maximum number of results to return */
    limit?: number;
    /** Number of results to skip */
    offset?: number;
    /** Filter by target type */
    type?: InteractionTargetType;
}
/**
 * Favorite List Response
 *
 * Response structure for favorites list endpoints
 */
interface FavoriteListResponse {
    /** List of favorite items */
    data: any[];
}
/**
 * Like Request
 *
 * Request body for like/unlike operations
 */
interface LikeRequest {
    /** The identifier of the target agent, plugin, or agent group */
    targetId: string;
    /** The type of target */
    targetType: InteractionTargetType;
}
/**
 * Check Like Query
 *
 * Query parameters for checking like status
 */
interface CheckLikeQuery {
    /** The identifier of the target agent, plugin, or agent group */
    targetId: string;
    /** The type of target */
    targetType: InteractionTargetType;
}
/**
 * Check Like Response
 *
 * Response structure for check like status endpoint
 */
interface CheckLikeResponse {
    /** Whether the authenticated user has liked the target */
    isLiked: boolean;
}
/**
 * Toggle Like Response
 *
 * Response structure for toggle like endpoint
 */
interface ToggleLikeResponse {
    /** Whether the target is now liked */
    liked: boolean;
}
/**
 * Like Query
 *
 * Query parameters for likes list endpoints
 */
interface LikeQuery {
    /** Maximum number of results to return */
    limit?: number;
    /** Number of results to skip */
    offset?: number;
    /** Filter by target type */
    type?: InteractionTargetType;
}
/**
 * Like List Response
 *
 * Response structure for likes list endpoints
 */
interface LikeListResponse {
    /** List of liked items */
    data: any[];
}
/**
 * Success Response
 *
 * Common response structure for success operations
 */
interface SuccessResponse {
    /** Whether the operation was successful */
    success: boolean;
}
/**
 * Pagination Query
 *
 * Common pagination parameters
 */
interface PaginationQuery {
    /** Maximum number of results to return */
    limit?: number;
    /** Number of results to skip */
    offset?: number;
}
/**
 * Client Info
 *
 * Client environment information for debugging feedback
 */
interface FeedbackClientInfo {
    /** Browser/app language */
    language?: string;
    /** Screen resolution (e.g., "1920x1080") */
    screenResolution?: string;
    /** User timezone */
    timezone?: string;
    /** Current page URL */
    url?: string;
    /** Browser user agent string */
    userAgent?: string;
    /** Viewport dimensions (e.g., "1280x720") */
    viewport?: string;
}
/**
 * Submit Feedback Request
 *
 * Request body for submitting user feedback
 */
interface SubmitFeedbackRequest {
    /** Optional client environment information */
    clientInfo?: FeedbackClientInfo;
    /** User email address (required for contact) */
    email: string;
    /** Detailed feedback message (1-5000 characters) */
    message: string;
    /** Optional screenshot URL */
    screenshotUrl?: string;
    /** Feedback title/subject (1-200 characters) */
    title: string;
}
/**
 * Submit Feedback Response
 *
 * Response structure for submit feedback endpoint
 */
interface SubmitFeedbackResponse {
    /** Created issue ID in Linear */
    issueId: string;
    /** URL to view the issue in Linear */
    issueUrl: string;
    /** Whether the submission was successful */
    success: boolean;
}

/**
 * Base SDK class
 *
 * Provides shared request handling and authentication functionality that is used
 * by both the Market SDK and Admin SDK. This class handles the common concerns:
 * - API endpoint configuration
 * - Authentication header management
 * - HTTP request handling
 * - Error handling
 * - Query string building
 */
declare class BaseSDK {
    /** Base API URL */
    protected apiBaseUrl: string;
    /** Base URL */
    protected baseUrl: string;
    /** OAuth URL */
    protected oauthBaseUrl: string;
    /** Default locale for requests that require localization */
    protected defaultLocale: string;
    /** HTTP headers to include with all requests */
    protected headers: Record<string, string>;
    private clientId?;
    private clientSecret?;
    private readonly initialAccessToken?;
    private accessToken?;
    private tokenExpiry?;
    private sharedTokenState?;
    /**
     * Creates a new BaseSDK instance
     *
     * @param options - Configuration options for the SDK
     * @param sharedHeaders - Optional shared headers object for reuse across services
     * @param sharedTokenState - Optional shared token state object for reuse across services
     */
    constructor(options?: MarketSDKOptions, sharedHeaders?: Record<string, string>, sharedTokenState?: SharedTokenState);
    /**
     * Sends an HTTP request to the API and handles the response
     *
     * @param url - Request URL path (will be appended to baseUrl)
     * @param options - Fetch API request options
     * @returns Promise resolving to the parsed JSON response
     * @throws Error if the request fails
     */
    protected request<T>(url: string, options?: RequestInit): Promise<T>;
    /**
     * Builds a URL query string from a parameters object
     *
     * @param params - Object containing query parameters
     * @returns Formatted query string (including leading ? if params exist)
     */
    protected buildQueryString(params: Record<string, any>): string;
    /**
     * Sets an authentication token for API requests
     *
     * @param token - API authentication token
     */
    setAuthToken(token: string): void;
    /**
     * Clears the authentication token
     */
    clearAuthToken(): void;
    /**
     * Fetches an M2M access token.
     * This method is designed for server-side use cases where you need to manage the token lifecycle
     * (e.g., storing it in a cookie).
     *
     * @returns A promise that resolves to an object containing the access token and its expiry time.
     */
    fetchM2MToken(): Promise<{
        accessToken: string;
        expiresIn: number;
    }>;
    private createClientAssertion;
    private exchangeToken;
    private exchangeTokenForServer;
    private setM2MAuthToken;
    private fetchNewToken;
}

/**
 * Admin Agent Item
 * Agent item with admin-specific fields for management
 */
interface AdminAgentItem {
    /** Author information */
    author?: {
        avatar?: string;
        name?: string;
        userName?: string;
    };
    /** Avatar URL or emoji */
    avatar?: string;
    /** Category name */
    category?: string;
    /** Agent configuration */
    config?: any;
    /** Creation timestamp */
    createdAt: string;
    /** Description */
    description?: string;
    /** Agent ID */
    id: string;
    /** Agent identifier */
    identifier: string;
    /** Install count */
    installCount?: number;
    /** Whether featured */
    isFeatured?: boolean;
    /** Whether officially maintained */
    isOfficial: boolean;
    /** Number of knowledge bases attached */
    knowledgeCount?: number;
    /** Display name */
    name: string;
    /** Owner ID */
    ownerId: number;
    /** Number of plugins attached */
    pluginCount?: number;
    /** Provider ID */
    providerId?: number;
    /** Safety check result */
    safetyCheck?: string | null;
    /** Publication status */
    status?: string;
    /** Tags */
    tags?: string[];
    /** Token usage */
    tokenUsage?: number;
    /** Update timestamp */
    updatedAt: string;
    /** URL */
    url?: string;
    /** Version name */
    versionName?: string;
    /** Version number */
    versionNumber?: number;
    /** Version list */
    versions?: Array<{
        isLatest: boolean;
        isValidated: boolean;
        updatedAt: string;
        version: string;
        versionNumber: number;
    }>;
}
/**
 * Admin Agent Item Detail
 * Extended agent detail with admin-specific fields
 */
interface AdminAgentItemDetail extends AgentItemDetail {
    /** Safety check result */
    safetyCheck?: string | null;
}
/**
 * Agent list query parameters for admin
 */
interface AdminAgentListQueryParams extends AdminListQueryParams {
    /** Filter by category */
    category?: string;
    /** Filter by official status */
    isOfficial?: 'true' | 'false';
    /** Filter by namespace */
    namespace?: string;
    /** Filter by status */
    status?: 'published' | 'unpublished' | 'archived' | 'deprecated' | 'all';
    /** Filter by visibility */
    visibility?: 'public' | 'private' | 'internal' | 'all';
}
/**
 * Agent update parameters
 */
interface AgentUpdateParams {
    /** Official homepage or repository URL for the agent */
    homepage?: string | null;
    /** Unique identifier for the agent */
    identifier?: string;
    /** Whether this agent is featured */
    isFeatured?: boolean;
    /** Whether this agent is officially maintained by LobeHub */
    isOfficial?: boolean;
    /** Default name of the agent */
    name?: string;
    /** Safety check result */
    safetyCheck?: string | null;
    /** Publication status */
    status?: 'published' | 'unpublished' | 'archived' | 'deprecated';
    /** Visibility level */
    visibility?: 'public' | 'private' | 'internal';
}
/**
 * Agent by status response item
 */
interface AgentByStatusItem {
    id: number;
    identifier: string;
    name: string;
    status: AgentStatus;
    updatedAt: string | null;
}
/**
 * Agent version by status response item
 */
interface AgentVersionByStatusItem {
    agentId: number;
    agentName: string;
    identifier: string;
    status: AgentStatus;
    updatedAt: string | null;
    version: string;
    versionId: number;
}
/**
 * Agent Management Service
 *
 * Provides administrative functionality for managing agents in the marketplace.
 * This service handles CRUD operations for agents, agent status, and visibility.
 */
declare class AgentService$1 extends BaseSDK {
    /**
     * Retrieves a list of agents with admin details
     *
     * Supports filtering, pagination, and sorting of results.
     *
     * @param params - Query parameters for filtering and pagination
     * @returns Promise resolving to the agent list response with admin details
     */
    getAgents(params?: AdminAgentListQueryParams): Promise<AdminListResponse<AdminAgentItem>>;
    /**
     * Retrieves agents filtered by status
     *
     * @param status - The status to filter by
     * @returns Promise resolving to agents matching the status
     */
    getAgentsByStatus(status: AgentStatus): Promise<{
        data: AgentByStatusItem[];
        total: number;
    }>;
    /**
     * Retrieves agent versions filtered by status
     *
     * @param status - The status to filter by
     * @returns Promise resolving to agent versions matching the status
     */
    getAgentVersionsByStatus(status: AgentStatus): Promise<{
        data: AgentVersionByStatusItem[];
        total: number;
    }>;
    /**
     * Retrieves a single agent with full admin details
     *
     * @param id - Agent ID or identifier
     * @param options - Optional query parameters
     * @returns Promise resolving to the detailed agent information
     */
    getAgent(id: number | string, options?: {
        locale?: string;
        version?: string;
    }): Promise<AdminAgentItemDetail>;
    /**
     * Updates agent information
     *
     * @param id - Agent ID or identifier
     * @param data - Agent update data containing fields to update
     * @returns Promise resolving to the updated agent
     */
    updateAgent(id: number | string, data: AgentUpdateParams): Promise<AdminAgentItem>;
    /**
     * Updates agent publication status
     *
     * @param id - Agent ID or identifier
     * @param status - New status to set
     * @returns Promise resolving to success response
     */
    updateAgentStatus(id: number | string, status: 'published' | 'unpublished' | 'archived' | 'deprecated'): Promise<{
        message: string;
        success: boolean;
    }>;
    /**
     * Updates agent visibility
     *
     * @param id - Agent ID or identifier
     * @param visibility - New visibility setting
     * @returns Promise resolving to success response
     */
    updateAgentVisibility(id: number | string, visibility: 'public' | 'private' | 'internal'): Promise<{
        message: string;
        success: boolean;
    }>;
    /**
     * Deletes an agent
     *
     * @param id - Agent ID or identifier
     * @returns Promise resolving to success response
     */
    deleteAgent(id: number | string): Promise<{
        message: string;
        success: boolean;
    }>;
    /**
     * Updates status for multiple agents in a single operation
     *
     * @param ids - Array of agent IDs to update
     * @param status - New status to set for all specified agents
     * @returns Promise resolving to success response
     */
    batchUpdateAgentStatus(ids: number[], status: 'published' | 'unpublished' | 'archived' | 'deprecated'): Promise<{
        message: string;
        success: boolean;
        updatedCount: number;
    }>;
    /**
     * Deletes multiple agents in a single operation
     *
     * @param ids - Array of agent IDs to delete
     * @returns Promise resolving to success response
     */
    batchDeleteAgents(ids: number[]): Promise<{
        deletedCount: number;
        message: string;
        success: boolean;
    }>;
}

/**
 * Market Overview Statistics Interface
 * Defines the structure for market overview data
 */
interface MarketOverviewStats {
    devices: {
        count: number;
        prevCount: number;
    };
    installs: {
        count: number;
        prevCount: number;
    };
    period: string;
    pluginCalls: {
        count: number;
        prevCount: number;
    };
    plugins: {
        count: number;
        prevCount: number;
    };
}
/**
 * Period type for analysis queries
 */
type AnalysisPeriod = '1d' | '7d' | '30d' | '1mo' | '3mo' | '1y';
/**
 * Market overview query parameters
 */
interface MarketOverviewQuery {
    /** Analysis period: 1d, 7d, 30d (rolling periods) or 1mo, 3mo, 1y (natural periods) */
    period?: AnalysisPeriod;
}
/**
 * Analysis Management Service
 *
 * Provides administrative functionality for accessing market analysis and statistics.
 * This service handles retrieving various analytics reports including market overview,
 * plugin trends, and installation analytics for administrative dashboards.
 */
declare class AnalysisService extends BaseSDK {
    /**
     * Retrieves market overview statistics
     *
     * Returns comprehensive market statistics including plugin counts,
     * installation metrics, new plugin trends, and rating averages
     * with comparison to previous periods.
     *
     * @param params - Query parameters for the analysis
     * @returns Promise resolving to market overview statistics
     */
    getMarketOverview(params?: MarketOverviewQuery): Promise<MarketOverviewStats>;
    /**
     * Retrieves market overview statistics for 1 day period
     *
     * Convenience method for getting daily market statistics.
     *
     * @returns Promise resolving to market overview statistics for 1 day
     */
    getDailyOverview(): Promise<MarketOverviewStats>;
    /**
     * Retrieves market overview statistics for 7 days period
     *
     * Convenience method for getting weekly market statistics.
     *
     * @returns Promise resolving to market overview statistics for 7 days
     */
    getWeeklyOverview(): Promise<MarketOverviewStats>;
    /**
     * Retrieves market overview statistics for 30 days period
     *
     * Convenience method for getting monthly market statistics.
     *
     * @returns Promise resolving to market overview statistics for 30 days
     */
    getMonthlyOverview(): Promise<MarketOverviewStats>;
    /**
     * Retrieves market overview statistics for current natural month
     *
     * Convenience method for getting current month vs previous month statistics.
     *
     * @returns Promise resolving to market overview statistics for current month
     */
    getThisMonthOverview(): Promise<MarketOverviewStats>;
    /**
     * Retrieves market overview statistics for current quarter
     *
     * Convenience method for getting current quarter vs previous quarter statistics.
     *
     * @returns Promise resolving to market overview statistics for current quarter
     */
    getQuarterlyOverview(): Promise<MarketOverviewStats>;
    /**
     * Retrieves market overview statistics for current year
     *
     * Convenience method for getting current year vs previous year statistics.
     *
     * @returns Promise resolving to market overview statistics for current year
     */
    getYearlyOverview(): Promise<MarketOverviewStats>;
    /**
     * Retrieves install failure analysis for plugins within a date range
     *
     * Returns detailed analysis of plugin installation failures including failure counts,
     * failure rates, and most common error messages for each plugin with failures.
     *
     * @param params - Query parameters for the failure analysis
     * @returns Promise resolving to install failure analysis data
     */
    getInstallFailureAnalysis(params: InstallFailureAnalysisQuery): Promise<InstallFailureAnalysis[]>;
    /**
     * Calculates growth rate between current and previous values
     *
     * Utility method for calculating percentage growth rates from the statistics.
     *
     * @param current - Current period value
     * @param previous - Previous period value
     * @returns Growth rate as percentage (e.g., 15.5 for 15.5% growth)
     */
    static calculateGrowthRate(current: number, previous: number): number;
    /**
     * Formats market overview statistics with calculated growth rates
     *
     * Utility method that enhances the raw statistics with calculated growth rates
     * for easier consumption in dashboards and reports.
     *
     * @param stats - Raw market overview statistics
     * @returns Enhanced statistics with growth rate calculations
     */
    static formatMarketOverview(stats: MarketOverviewStats): {
        growth: {
            devices: number;
            installs: number;
            pluginCalls: number;
            plugins: number;
        };
        devices: {
            count: number;
            prevCount: number;
        };
        installs: {
            count: number;
            prevCount: number;
        };
        period: string;
        pluginCalls: {
            count: number;
            prevCount: number;
        };
        plugins: {
            count: number;
            prevCount: number;
        };
    };
    /**
     * Retrieves installation trend statistics for a specified date range
     *
     * Returns daily installation counts and trends for the specified period
     * with optional comparison to a previous period.
     *
     * @param params - Query parameters including date range and display config
     * @returns Promise resolving to installation trend statistics
     */
    getRangeInstalls(params: RangeQuery): Promise<RangeStats>;
    /**
     * Retrieves plugin growth trend statistics for a specified date range
     *
     * Returns daily plugin creation counts and trends for the specified period
     * with optional comparison to a previous period.
     *
     * @param params - Query parameters including date range and display config
     * @returns Promise resolving to plugin growth trend statistics
     */
    getRangePlugins(params: RangeQuery): Promise<RangeStats>;
    /**
     * Retrieves device growth trend statistics for a specified date range
     *
     * Note: This is a system-level statistic that tracks device registrations,
     * not plugin-specific metrics. It provides daily device registration counts
     * and trends for the specified period with optional comparison to a previous period.
     *
     * @param params - Query parameters including date range and display config
     * @returns Promise resolving to device growth trend statistics
     */
    getRangeDevices(params: RangeQuery): Promise<RangeStats>;
    /**
     * Retrieves plugin call trend statistics for a specified date range
     *
     * Returns daily plugin call counts and trends for the specified period
     * with optional comparison to a previous period.
     *
     * @param params - Query parameters including date range and display config
     * @returns Promise resolving to plugin call trend statistics
     */
    getRangeCalls(params: RangeQuery): Promise<RangeStats>;
    /**
     * Calculates trend growth rate between current and previous period totals
     *
     * Utility method for calculating percentage growth rates from range statistics.
     *
     * @param stats - Range statistics with sum and prevSum
     * @returns Growth rate as percentage (e.g., 15.5 for 15.5% growth)
     */
    static calculateTrendGrowthRate(stats: RangeStats): number;
    /**
     * Retrieves top plugins sorted by specified criteria within a date range
     *
     * Returns list of plugins sorted by the specified criteria (installs or calls)
     * in descending order for the specified date range.
     *
     * @param params - Query parameters including date range, sort criteria, and limit
     * @returns Promise resolving to list of top plugins
     */
    getTopPlugins(params: TopPluginsQuery): Promise<TopPlugin[]>;
}

/**
 * Plugin Management Service
 *
 * Provides administrative functionality for managing plugins in the marketplace.
 * This service handles CRUD operations for plugins, plugin versions, and deployment options.
 */
declare class PluginService extends BaseSDK {
    /**
     * Batch imports plugin manifests using the dedicated import endpoint
     *
     * This method is intended for use with scripts and bulk import operations.
     *
     * @param manifests - Array of plugin manifests to import
     * @param ownerId - Optional owner ID to associate with the imported plugins
     * @returns Promise resolving to the import results with counts of success, skipped, failed, and a list of failed IDs
     */
    importPlugins(manifests: PluginManifest[], ownerId?: number): Promise<{
        failed: number;
        failedIds: string[];
        skipped: number;
        success: number;
    }>;
    /**
     * Imports plugin internationalization (i18n) data
     *
     * Allows importing localized content for a specific plugin version.
     * This method creates or updates localizations for the specified plugin.
     *
     * @param params - Plugin i18n import parameters containing identifier, version, and localizations
     * @returns Promise resolving to the import results with counts of success and failure
     */
    importPluginI18n(params: PluginI18nImportParams): Promise<PluginI18nImportResponse>;
    /**
     * Retrieves a list of plugins with admin details
     *
     * Supports filtering, pagination, and sorting of results.
     *
     * @param params - Query parameters for filtering and pagination
     * @returns Promise resolving to the plugin list response with admin details
     */
    getPlugins(params?: AdminListQueryParams): Promise<AdminListResponse<AdminPluginItem>>;
    /**
     * Retrieves all published plugin identifiers
     *
     * Returns a lightweight list of all published plugin identifiers without
     * full plugin metadata. This is useful for admin operations that need to know
     * which plugins are currently published and available to users.
     *
     * @returns Promise resolving to an array containing identifiers array and last modified time
     */
    getPublishedIdentifiers(): Promise<{
        identifier: string;
        lastModified: string;
    }[]>;
    /**
     * Retrieves a single plugin with full admin details
     *
     * @param id - Plugin ID or identifier
     * @returns Promise resolving to the detailed plugin information with version history
     */
    getPlugin(id: number | string): Promise<AdminPluginItemDetail>;
    /**
     * Retrieves a plugin by its GitHub repository URL
     *
     * @param githubUrl - The GitHub repository URL to search for
     * @returns Promise resolving to the detailed plugin information with version history
     */
    getPluginByGithubUrl(githubUrl: string): Promise<AdminPluginItemDetail>;
    /**
     * Updates plugin information
     *
     * @param id - Plugin ID
     * @param data - Plugin update data containing fields to update
     * @returns Promise resolving to the updated plugin
     */
    updatePlugin(id: number, data: PluginUpdateParams): Promise<AdminPluginItem>;
    /**
     * Updates plugin publication status
     *
     * @param id - Plugin ID
     * @param status - New status to set
     * @returns Promise resolving to success response
     */
    updatePluginStatus(id: number, status: 'published' | 'draft' | 'review' | 'rejected'): Promise<{
        message: string;
        success: boolean;
    }>;
    /**
     * Deletes a plugin
     *
     * @param id - Plugin ID
     * @returns Promise resolving to success response
     */
    deletePlugin(id: number): Promise<{
        message: string;
        success: boolean;
    }>;
    /**
     * Retrieves the version history for a plugin
     *
     * @param pluginId - Plugin ID
     * @returns Promise resolving to an array of plugin versions
     */
    getPluginVersions(pluginId: number): Promise<PluginVersion[]>;
    /**
     * Retrieves a specific plugin version
     *
     * @param pluginId - Plugin ID
     * @param versionId - Version ID
     * @returns Promise resolving to the plugin version details
     */
    getPluginVersion(pluginId: number, versionId: number): Promise<PluginVersion>;
    /**
     * Retrieves all localizations for a specific plugin version
     *
     * @param pluginId - Plugin ID or identifier
     * @param versionId - Version ID
     * @returns Promise resolving to an array of plugin version localizations
     */
    getPluginLocalizations(pluginId: number | string, versionId: number): Promise<PluginVersionLocalization[]>;
    /**
     * Creates a new plugin version with all version-specific data
     *
     * @param pluginId - Plugin ID
     * @param data - Version creation data including all version-specific fields
     * @returns Promise resolving to the created plugin version
     */
    createPluginVersion(pluginId: number, data: PluginVersionCreateParams): Promise<PluginVersion>;
    /**
     * Creates a new plugin version from a manifest
     * Extracts version data from the manifest for easier creation
     *
     * @param pluginId - Plugin ID
     * @param manifest - Plugin manifest containing all version data
     * @param options - Additional options for version creation
     * @returns Promise resolving to the created plugin version
     */
    createPluginVersionFromManifest(pluginId: number, manifest: PluginManifest, options?: {
        isLatest?: boolean;
        isValidated?: boolean;
    }): Promise<PluginVersion>;
    /**
     * Updates a plugin version with comprehensive version-specific data
     *
     * @param idOrIdentifier - Plugin ID
     * @param versionId - Version ID
     * @param data - Version update data including all version-specific fields
     * @returns Promise resolving to the updated plugin version
     */
    updatePluginVersion(idOrIdentifier: number | string, versionId: number, data: PluginVersionUpdateParams): Promise<PluginVersion>;
    /**
     * Deletes a plugin version
     *
     * @param pluginId - Plugin ID
     * @param versionId - Version ID
     * @returns Promise resolving to success response
     */
    deletePluginVersion(pluginId: number, versionId: number): Promise<{
        message: string;
        success: boolean;
    }>;
    /**
     * Sets a specific version as the latest version of a plugin
     *
     * @param pluginId - Plugin ID
     * @param versionId - Version ID to set as latest
     * @returns Promise resolving to success response
     */
    setPluginVersionAsLatest(pluginId: number, versionId: number): Promise<{
        message: string;
        success: boolean;
    }>;
    /**
     * Updates plugin visibility
     *
     * @param id - Plugin ID
     * @param visibility - New visibility setting
     * @returns Promise resolving to success response
     */
    updatePluginVisibility(id: number, visibility: 'public' | 'private' | 'unlisted'): Promise<{
        message: string;
        success: boolean;
    }>;
    /**
     * Updates status for multiple plugins in a single operation
     *
     * @param ids - Array of plugin IDs to update
     * @param status - New status to set for all specified plugins
     * @returns Promise resolving to success response
     */
    batchUpdatePluginStatus(ids: number[], status: 'published' | 'draft' | 'review' | 'rejected'): Promise<{
        message: string;
        success: boolean;
    }>;
    /**
     * Deletes multiple plugins in a single operation
     *
     * @param ids - Array of plugin IDs to delete
     * @returns Promise resolving to success response
     */
    batchDeletePlugins(ids: number[]): Promise<{
        message: string;
        success: boolean;
    }>;
    /**
     * Retrieves detailed information about a plugin version including deployment options
     *
     * @param pluginId - Plugin ID
     * @param versionId - Version ID
     * @returns Promise resolving to version details with deployment options
     */
    getPluginVersionDetails(pluginId: number, versionId: number): Promise<PluginVersion & {
        deploymentOptions: any;
    }>;
    /**
     * Retrieves deployment options for a specific plugin version
     *
     * @param pluginId - Plugin ID
     * @param versionId - Version ID
     * @returns Promise resolving to an array of deployment options
     */
    getDeploymentOptions(pluginId: number, versionId: number): Promise<AdminDeploymentOption[]>;
    /**
     * Creates a new deployment option for a plugin version
     *
     * @param pluginId - Plugin ID
     * @param versionId - Version ID
     * @param data - Deployment option configuration data
     * @returns Promise resolving to the created deployment option
     */
    createDeploymentOption(pluginId: number, versionId: number, data: {
        connectionArgs?: string[];
        connectionCommand?: string;
        connectionType: string;
        description?: string;
        installationDetails?: InstallationDetails;
        installationMethod: string;
        isRecommended?: boolean;
    }): Promise<AdminDeploymentOption>;
    /**
     * Updates an existing deployment option
     *
     * @param pluginId - Plugin ID
     * @param versionId - Version ID
     * @param optionId - Deployment option ID
     * @param data - Updated deployment option configuration
     * @returns Promise resolving to the updated deployment option
     */
    updateDeploymentOption(pluginId: number, versionId: number, optionId: number, data: {
        configSchema?: Record<string, any>;
        connectionArgs?: string[];
        connectionCommand?: string;
        connectionType?: string;
        description?: string;
        installationDetails?: Record<string, any>;
        installationMethod?: string;
        isRecommended?: boolean;
    }): Promise<AdminDeploymentOption>;
    /**
     * Deletes a deployment option
     *
     * @param pluginId - Plugin ID
     * @param versionId - Version ID
     * @param optionId - Deployment option ID
     * @returns Promise resolving to success response
     */
    deleteDeploymentOption(pluginId: number, versionId: number, optionId: number): Promise<{
        message: string;
        success: boolean;
    }>;
    /**
     * Retrieves system dependencies for a deployment option
     *
     * @param pluginId - Plugin ID
     * @param versionId - Version ID
     * @param optionId - Deployment option ID
     * @returns Promise resolving to an array of system dependencies
     */
    getDeploymentOptionSystemDependencies(pluginId: number, versionId: number, optionId: number): Promise<SystemDependency[]>;
    /**
     * Retrieves verified plugins without summary information
     *
     * Returns plugins that are validated but missing summary data.
     *
     * @returns Promise resolving to array of plugins with incomplete summary data
     */
    getVerifiedPluginsWithoutSummary(): Promise<{
        identifier: string;
        manifest: PluginManifest;
        versionId: number;
    }[]>;
    /**
     * Retrieves plugins with incomplete internationalization
     *
     * Returns plugins where pluginVersionLocalizations has only 1 entry.
     *
     * @returns Promise resolving to an array of plugins with incomplete i18n
     */
    getIncompleteI18nPlugins(): Promise<IncompleteI18nPlugin[]>;
    /**
     * Retrieves unclaimed plugins
     *
     * Returns plugins where isClaimed is false, containing only ID and identifier.
     *
     * @returns Promise resolving to an array of unclaimed plugins with basic info
     */
    getUnclaimedPlugins(): Promise<UnclaimedPluginItem[]>;
}

/**
 * System Dependency Management Service
 *
 * Provides administrative functionality for managing system dependencies
 * required by plugins. This service handles creating, updating, deleting,
 * and listing system dependencies that plugins may require.
 */
declare class SystemDependencyService extends BaseSDK {
    /**
     * Retrieves all system dependencies
     *
     * Gets a list of all defined system dependencies that plugins may require.
     *
     * @returns Promise resolving to an array of system dependencies
     */
    getSystemDependencies(): Promise<SystemDependency[]>;
    /**
     * Retrieves a specific system dependency by ID
     *
     * @param id - System dependency ID
     * @returns Promise resolving to the system dependency details
     */
    getSystemDependency(id: number): Promise<SystemDependency>;
    /**
     * Creates a new system dependency
     *
     * @param data - System dependency creation data
     * @returns Promise resolving to the created system dependency
     */
    createSystemDependency(data: Omit<SystemDependency, 'id'>): Promise<SystemDependency>;
    /**
     * Updates an existing system dependency
     *
     * @param id - System dependency ID
     * @param data - System dependency update data
     * @returns Promise resolving to the updated system dependency
     */
    updateSystemDependency(id: number, data: Partial<SystemDependency>): Promise<SystemDependency>;
    /**
     * Deletes a system dependency
     *
     * @param id - System dependency ID
     * @returns Promise resolving to success response
     */
    deleteSystemDependency(id: number): Promise<{
        message: string;
        success: boolean;
    }>;
}

/**
 * Settings entity representing a system setting
 */
interface Settings {
    /** Creation timestamp (ISO 8601 format) */
    createdAt: string;
    /** Optional description of the setting's purpose */
    description?: string;
    /** Unique identifier for the setting */
    id: number;
    /** Setting key name used for retrieving the setting */
    key: string;
    /** Last update timestamp (ISO 8601 format) */
    updatedAt: string;
    /** Setting value (stored as string) */
    value: string;
}
/**
 * Configuration for enabled resource types
 */
interface EnabledResources {
    /** Whether agent resources are enabled */
    agents: boolean;
    /** Whether plugin resources are enabled */
    plugins: boolean;
}
/**
 * Authentication configuration
 */
interface AuthenticationConfig {
    /** Whether authentication is required */
    enabled: boolean;
    /** Supported authentication schemes */
    schemes: string[];
}
/**
 * Documentation URL configuration
 */
interface DocumentationConfig {
    /** URL to API documentation */
    apiUrl?: string;
    /** URL to privacy policy */
    policyUrl?: string;
    /** URL to terms of service */
    termsOfServiceUrl?: string;
}
/**
 * Map of all system settings with typed properties
 */
interface SettingsMap {
    /** Additional settings (dynamically added) */
    [key: string]: any;
    /** Authentication configuration */
    authentication: AuthenticationConfig;
    /** Base URL for the marketplace */
    baseURL: string;
    /** Documentation URL configuration */
    documentation: DocumentationConfig;
    /** Configuration for enabled resource types */
    enabledResources: EnabledResources;
    /** Supported locales */
    locales: string[];
}
/**
 * Parameters for creating a new setting
 */
interface CreateSettingsParams {
    /** Optional description of the setting's purpose */
    description?: string;
    /** Setting key name */
    key: string;
    /** Setting value (will be stored as string) */
    value: string;
}
/**
 * Parameters for updating an existing setting
 */
interface UpdateSettingsParams {
    /** Optional new description */
    description?: string;
    /** New setting value */
    value: string;
}
/**
 * Settings Management Service
 *
 * Provides administrative functionality for managing system settings.
 * This service handles getting, creating, updating, and deleting
 * configuration settings for the marketplace.
 */
declare class SettingsService extends BaseSDK {
    /**
     * Retrieves all system settings
     *
     * Returns a consolidated map of all settings with typed values
     * for known setting keys.
     *
     * @returns Promise resolving to the settings map
     */
    getSettings(): Promise<SettingsMap>;
    /**
     * Retrieves a specific setting by key
     *
     * @param key - Setting key name
     * @returns Promise resolving to the setting details
     */
    getSettingByKey(key: string): Promise<{
        data: Settings;
    }>;
    /**
     * Creates a new system setting
     *
     * @param data - Setting creation parameters
     * @returns Promise resolving to the created setting
     */
    createSetting(data: CreateSettingsParams): Promise<{
        data: Settings;
    }>;
    /**
     * Updates an existing setting
     *
     * @param key - Setting key name
     * @param data - Setting update parameters
     * @returns Promise resolving to the updated setting
     */
    updateSetting(key: string, data: UpdateSettingsParams): Promise<{
        data: Settings;
    }>;
    /**
     * Deletes a setting
     *
     * @param key - Setting key name
     * @returns Promise resolving to success message
     */
    deleteSetting(key: string): Promise<{
        message: string;
    }>;
}

/**
 * Review entity representing a plugin review
 */
interface Review {
    /** Optional comment providing feedback */
    comment?: string;
    /** Creation timestamp (ISO 8601 format) */
    createdAt: string;
    /** Unique identifier for the review */
    id: number;
    /** ID of the plugin being reviewed */
    pluginId: number;
    /** ID of the reviewer (if available) */
    reviewerId?: number;
    /** Current status of the review */
    status: ReviewStatus;
    /** Last update timestamp (ISO 8601 format) */
    updatedAt: string;
}
/**
 * Extended review information with related entities
 */
interface PluginReviewWithRelations extends Review {
    /** Related plugin information */
    plugin?: any;
    /** Related version information */
    version?: any;
}
/**
 * Parameters for updating a review
 */
interface UpdateReviewParams {
    /** Optional comment or feedback */
    comment?: string;
    /** New status to set for the review */
    status: ReviewStatus;
}
/**
 * Review Management Service
 *
 * Provides administrative functionality for managing plugin reviews.
 * This service handles listing, fetching, and updating review statuses
 * for plugins in the marketplace.
 */
declare class ReviewService extends BaseSDK {
    /**
     * Retrieves a list of reviews with filtering options
     *
     * @param params - Query parameters for filtering and pagination
     * @returns Promise resolving to the review list response
     */
    getReviews(params?: AdminListQueryParams): Promise<AdminListResponse<PluginReviewWithRelations>>;
    /**
     * Retrieves a specific review by ID
     *
     * @param id - Review ID
     * @returns Promise resolving to the review details
     */
    getReviewById(id: number): Promise<Review>;
    /**
     * Updates a review's status and comment
     *
     * @param id - Review ID
     * @param data - Update parameters containing new status and optional comment
     * @returns Promise resolving to the updated review
     */
    updateReview(id: number, data: UpdateReviewParams): Promise<Review>;
    /**
     * Retrieves the review history for a specific plugin
     *
     * @param pluginId - Plugin ID
     * @returns Promise resolving to an array of reviews for the plugin
     */
    getPluginReviews(pluginId: number): Promise<{
        data: Review[];
    }>;
}

declare class SkillCollectionService extends BaseSDK {
    createCollection(data: CreateSkillCollectionRequest): Promise<AdminSkillCollectionDetail>;
    deleteCollection(id: number): Promise<void>;
    getCollection(id: number): Promise<AdminSkillCollectionDetail>;
    getCollections(params?: AdminSkillCollectionListQuery): Promise<AdminSkillCollectionListResponse>;
    batchUpsertLocalizations(collectionId: number, data: BatchUpsertSkillCollectionLocalizationsRequest): Promise<SkillCollectionLocalizationBatchResponse>;
    deleteLocalization(collectionId: number, locale: string): Promise<{
        message: string;
        success: boolean;
    }>;
    getLocalization(collectionId: number, locale: string): Promise<SkillCollectionLocalization>;
    getLocalizations(collectionId: number): Promise<SkillCollectionLocalization[]>;
    updateCollection(id: number, data: UpdateSkillCollectionRequest): Promise<AdminSkillCollectionDetail>;
    upsertLocalization(collectionId: number, locale: string, data: UpsertSkillCollectionLocalizationRequest): Promise<SkillCollectionLocalization>;
}

type AdminPluginEnvListQuery = any;
type PluginEnv = any;
interface AdminPluginEnvCreateParams {
    description?: string;
    identifier: string;
    key: string;
    value: string;
}
interface AdminPluginEnvUpdateParams {
    description?: string;
    value?: string;
}
/**
 * Plugin Environment Variable Management Service
 *
 * Provides administrative functionality for managing plugin environment variables.
 */
declare class PluginEnvService extends BaseSDK {
    /**
     * Retrieves a paginated list of plugin environment variables
     *
     * @param params - Query parameters for filtering and pagination
     * @returns Promise resolving to the env list response
     */
    getPluginEnvs(params?: AdminPluginEnvListQuery): Promise<AdminListResponse<PluginEnv>>;
    /**
     * Retrieves a single plugin environment variable by ID
     *
     * @param id - Env ID
     * @returns Promise resolving to the env item
     */
    getPluginEnv(id: number): Promise<PluginEnv>;
    /**
     * Creates a new plugin environment variable
     *
     * @param data - Env creation data
     * @returns Promise resolving to the created env item
     */
    createPluginEnv(data: AdminPluginEnvCreateParams): Promise<PluginEnv>;
    /**
     * Updates a plugin environment variable
     *
     * @param id - Env ID
     * @param data - Env update data
     * @returns Promise resolving to the updated env item
     */
    updatePluginEnv(id: number, data: AdminPluginEnvUpdateParams): Promise<PluginEnv>;
    /**
     * Deletes a plugin environment variable
     *
     * @param id - Env ID
     * @returns Promise resolving to success response
     */
    deletePluginEnv(id: number): Promise<{
        success: boolean;
    }>;
    /**
     * Batch import plugin environment variables
     *
     * @param data - Batch import data, format: { [plugin: string]: { [envKey: string]: string } }
     * @returns Promise resolving to import result
     */
    importPluginEnvs(data: Record<string, Record<string, string>>): Promise<{
        success: number;
    }>;
}

/**
 * LobeHub Market Admin SDK Client
 *
 * Client for accessing administrative functionality of the LobeHub Marketplace.
 * This SDK provides privileged operations for managing agents, plugins, reviews,
 * system settings, and dependencies. It requires admin-level authentication.
 */
declare class MarketAdmin extends BaseSDK {
    /**
     * Agent management service
     * Provides methods for creating, updating, and managing agents
     */
    readonly agents: AgentService$1;
    /**
     * Market analysis service
     * Provides methods for accessing market analytics and statistics
     */
    readonly analysis: AnalysisService;
    /**
     * Plugin environment service
     */
    readonly env: PluginEnvService;
    /**
     * Plugin management service
     * Provides methods for creating, updating, and managing plugins
     */
    readonly plugins: PluginService;
    /**
     * Review management service
     * Provides methods for moderating and managing user reviews
     */
    readonly reviews: ReviewService;
    /**
     * System settings management service
     * Provides methods for configuring marketplace settings
     */
    readonly settings: SettingsService;
    /**
     * Skill collection management service
     * Provides methods for managing curated skill collection localizations
     */
    readonly skillCollections: SkillCollectionService;
    /**
     * System dependency management service
     * Provides methods for managing system dependencies required by plugins
     */
    readonly dependencies: SystemDependencyService;
    /**
     * Creates a new MarketAdmin instance
     *
     * @param options - Configuration options for the SDK
     */
    constructor(options?: MarketSDKOptions);
}

/**
 * Agent Profile Service
 *
 * Provides methods for M2M agents to view and update their own profile.
 * All methods require M2M authentication (Bearer token with client_credentials).
 */
declare class AgentProfileService extends BaseSDK {
    /**
     * Retrieves the current agent's profile
     *
     * Returns the agent entity bound to the authenticated M2M client.
     * If no agent exists yet, one is lazily provisioned on the server side.
     *
     * @param options - Optional request options
     * @returns Promise resolving to the agent profile response
     */
    getProfile(options?: globalThis.RequestInit): Promise<AgentProfileResponse>;
    /**
     * Updates the current agent's display information
     *
     * Allows updating the agent's name, avatar, and tags.
     * Requires M2M authentication.
     *
     * @param data - The profile fields to update (name, avatar, tags)
     * @param options - Optional request options
     * @returns Promise resolving to the updated agent profile response
     */
    updateProfile(data: UpdateAgentProfileRequest, options?: globalThis.RequestInit): Promise<UpdateAgentProfileResponse>;
}

/**
 * Agents Service
 *
 * Provides access to agent-related functionality in the LobeHub Marketplace.
 * This service handles listing, searching, and retrieving detailed information
 * about agents available in the marketplace.
 */
declare class AgentService extends BaseSDK {
    /**
     * Retrieves a list of agents from the marketplace
     *
     * Supports filtering, pagination, and localization of results.
     *
     * @param params - Query parameters for filtering and pagination
     * @param options - Optional request options
     * @returns Promise resolving to the agent list response containing items and pagination info
     */
    getAgentList(params?: AgentListQuery, options?: globalThis.RequestInit): Promise<AgentListResponse>;
    /**
     * Retrieves a list of agents owned by the authenticated user
     *
     * Returns all agents regardless of their publish status (published, unpublished,
     * archived, deprecated). Requires authentication.
     *
     * @param params - Query parameters for filtering and pagination
     * @param options - Optional request options (must include authentication)
     * @returns Promise resolving to the agent list response containing items with status field
     */
    getOwnAgents(params?: OwnAgentListQuery, options?: globalThis.RequestInit): Promise<AgentListResponse>;
    /**
     * Retrieves detailed information about a specific agent
     *
     * Returns complete agent information including A2A AgentCard data,
     * configuration, skills, and localized content.
     *
     * @param id - Unique identifier of the agent
     * @param params - Query parameters for locale and version
     * @param options - Optional request options
     * @returns Promise resolving to the agent detail information
     */
    getAgentDetail(id: string, params?: AgentDetailQuery, options?: globalThis.RequestInit): Promise<AgentItemDetail>;
    /**
     * Retrieves all published agent identifiers
     *
     *
     * Returns a lightweight list of all published agent identifiers without
     * full agent metadata. This is useful for clients that need to know which
     * agents are available without fetching complete agent information.
     *
     * @deprecated Use {@link AgentService.getSitemap} instead.
     * @param options - Optional request options
     * @returns Promise resolving to an array containing identifiers array and last modified time
     */
    getPublishedIdentifiers(options?: globalThis.RequestInit): Promise<{
        id: string;
        lastModified: string;
    }[]>;
    /**
     * Retrieves a paginated list of published agent identifiers for sitemaps
     *
     * @param params - Pagination (`page` defaults to 1, `pageSize` defaults to 200, max 500 server-side)
     * @param options - Optional request options
     */
    getSitemap(params?: {
        page?: number;
        pageSize?: number;
    }, options?: globalThis.RequestInit): Promise<SitemapResponse>;
    /**
     * Retrieves agent categories and their counts
     *
     * Returns a list of categories along with the number of agents in each category.
     * Useful for building category filters in a UI. Supports optional search filtering
     * via 'q' parameter and locale specification.
     *
     * @param params - Query parameters for filtering categories
     * @param options - Optional request options
     * @returns Promise resolving to an array of category items with counts
     */
    getCategories(params?: {
        locale?: string;
        q?: string;
    }, options?: globalThis.RequestInit): Promise<{
        category: string;
        count: number;
    }[]>;
    /**
     * Uploads an agent to the marketplace
     *
     * Allows users to upload new agents or update existing ones.
     * The agent data should conform to the A2A AgentCard specification.
     *
     * @param agentData - The agent data to upload
     * @param options - Optional request options
     * @returns Promise resolving to the upload response
     */
    uploadAgent(agentData: AgentUploadRequest, options?: globalThis.RequestInit): Promise<AgentUploadResponse>;
    /**
     * Creates a new agent in the marketplace
     *
     * @param agentData - The agent data to create
     * @param options - Optional request options
     * @returns Promise resolving to the created agent response
     */
    createAgent(agentData: AgentCreateRequest, options?: globalThis.RequestInit): Promise<AgentCreateResponse>;
    /**
     * Creates a new version for an existing agent
     *
     * @param versionData - The version data to create
     * @param options - Optional request options
     * @returns Promise resolving to the created version response
     */
    createAgentVersion(versionData: AgentVersionCreateRequest, options?: globalThis.RequestInit): Promise<AgentVersionCreateResponse>;
    /**
     * Modifies an existing agent
     *
     * @param agentData - The agent data to modify
     * @param options - Optional request options
     * @returns Promise resolving to the modified agent response
     */
    modifyAgent(agentData: AgentModifyRequest, options?: globalThis.RequestInit): Promise<AgentModifyResponse>;
    /**
     * Modifies a specific version of an existing agent
     *
     * @param versionData - The version data to modify
     * @param options - Optional request options
     * @returns Promise resolving to the modified version response
     */
    modifyAgentVersion(versionData: AgentVersionModifyRequest, options?: globalThis.RequestInit): Promise<AgentVersionModifyResponse>;
    /**
     * Checks if an agent exists in the marketplace
     *
     * @param identifier - Unique identifier of the agent
     * @param options - Optional request options
     * @returns Promise resolving to true if agent exists, false otherwise
     */
    checkAgentExists(identifier: string, options?: globalThis.RequestInit): Promise<boolean>;
    /**
     * Record an agent event for the authenticated user
     *
     * Records agent usage actions (add, chat, click) for analytics.
     *
     * @param eventData - The agent event payload
     * @param options - Optional request init overrides
     */
    createEvent(eventData: AgentEventRequest, options?: globalThis.RequestInit): Promise<void>;
    /**
     * Increases the install count for an agent
     *
     * This is a public endpoint that does not require authentication.
     * Call this method when a user installs or uses an agent.
     *
     * @param identifier - Unique identifier of the agent
     * @param options - Optional request options
     * @returns Promise resolving to the updated install count response
     */
    increaseInstallCount(identifier: string, options?: globalThis.RequestInit): Promise<AgentInstallCountResponse>;
    /**
     * Changes the status of an agent
     *
     * Internal helper method used by publish/unpublish/archive/deprecate methods.
     * Requires authentication.
     *
     * @param identifier - Unique identifier of the agent
     * @param status - New status to set
     * @param options - Optional request options
     * @returns Promise resolving to the status change response
     */
    private changeStatus;
    /**
     * Publishes an agent to the marketplace
     *
     * Makes the agent publicly visible and available for installation.
     * Requires authentication and ownership of the agent.
     *
     * @param identifier - Unique identifier of the agent
     * @param options - Optional request options
     * @returns Promise resolving to the status change response
     */
    publish(identifier: string, options?: globalThis.RequestInit): Promise<AgentStatusChangeResponse>;
    /**
     * Unpublishes an agent from the marketplace
     *
     * Hides the agent from public view. The agent data is preserved
     * and can be republished later.
     * Requires authentication and ownership of the agent.
     *
     * @param identifier - Unique identifier of the agent
     * @param options - Optional request options
     * @returns Promise resolving to the status change response
     */
    unpublish(identifier: string, options?: globalThis.RequestInit): Promise<AgentStatusChangeResponse>;
    /**
     * Archives an agent
     *
     * Marks the agent as archived. Archived agents are typically
     * no longer actively maintained but may still be accessible.
     * Requires authentication and ownership of the agent.
     *
     * @param identifier - Unique identifier of the agent
     * @param options - Optional request options
     * @returns Promise resolving to the status change response
     */
    archive(identifier: string, options?: globalThis.RequestInit): Promise<AgentStatusChangeResponse>;
    /**
     * Deprecates an agent
     *
     * Marks the agent as deprecated. Deprecated agents are still
     * accessible but users are encouraged to migrate to alternatives.
     * Requires authentication and ownership of the agent.
     *
     * @param identifier - Unique identifier of the agent
     * @param options - Optional request options
     * @returns Promise resolving to the status change response
     */
    deprecate(identifier: string, options?: globalThis.RequestInit): Promise<AgentStatusChangeResponse>;
    /**
     * Retrieves a list of agents that use a specific plugin
     *
     * Searches through agent configurations to find those with the specified
     * plugin ID in their config.plugins array. Only returns published and
     * publicly visible agents.
     *
     * @param params - Query parameters including pluginId, pagination, and locale
     * @param options - Optional request options
     * @returns Promise resolving to the agent list response
     */
    getAgentsByPlugin(params: {
        locale?: string;
        page?: number;
        pageSize?: number;
        pluginId: string;
    }, options?: globalThis.RequestInit): Promise<AgentListResponse>;
    /**
     * Forks an existing agent to create a new agent owned by the current user
     *
     * Creates a complete copy of the agent including configuration, skills,
     * and version data. Statistical data (ratings, likes, etc.) are reset to zero.
     * Requires authentication.
     *
     * @param sourceIdentifier - Identifier of the agent to fork
     * @param forkData - Fork request parameters (new identifier, name, etc.)
     * @param options - Optional request options
     * @returns Promise resolving to the fork response with new agent details
     */
    forkAgent(sourceIdentifier: string, forkData: AgentForkRequest, options?: globalThis.RequestInit): Promise<AgentForkResponse>;
    /**
     * Retrieves all public forks of a specific agent
     *
     * Returns a list of agents that were forked from the specified agent.
     * Only returns forks that are public and published.
     *
     * @param identifier - Identifier of the source agent
     * @param options - Optional request options
     * @returns Promise resolving to the forks list response
     */
    getAgentForks(identifier: string, options?: globalThis.RequestInit): Promise<AgentForksResponse>;
    /**
     * Retrieves the source agent that this agent was forked from
     *
     * Returns null if the agent is not a fork (original agent).
     *
     * @param identifier - Identifier of the agent to check
     * @param options - Optional request options
     * @returns Promise resolving to the fork source response
     */
    getAgentForkSource(identifier: string, options?: globalThis.RequestInit): Promise<AgentForkSourceResponse>;
}

/**
 * Agent Groups Service
 *
 * Provides access to agent group-related functionality in the LobeHub Marketplace.
 * This service handles listing, creating, versioning, and managing agent groups.
 */
declare class AgentGroupService extends BaseSDK {
    /**
     * Retrieves a list of agent groups from the marketplace
     *
     * Supports filtering, pagination, and localization of results.
     *
     * @param params - Query parameters for filtering and pagination
     * @param options - Optional request options
     * @returns Promise resolving to the agent group list response containing items and pagination info
     */
    getAgentGroupList(params?: AgentGroupListQuery, options?: globalThis.RequestInit): Promise<AgentGroupListResponse>;
    /**
     * Retrieves a list of agent groups owned by the authenticated user
     *
     * Returns all agent groups regardless of their publish status (published, unpublished,
     * archived, deprecated). Requires authentication.
     *
     * @param params - Query parameters for filtering and pagination
     * @param options - Optional request options (must include authentication)
     * @returns Promise resolving to the agent group list response containing items with status field
     */
    getOwnAgentGroups(params?: OwnAgentGroupListQuery, options?: globalThis.RequestInit): Promise<AgentGroupListResponse>;
    /**
     * Retrieves detailed information about a specific agent group
     *
     * Returns complete agent group information including group metadata,
     * all member agents, and localized content.
     *
     * @param identifier - Unique identifier of the agent group
     * @param params - Query parameters for locale and version
     * @param options - Optional request options
     * @returns Promise resolving to the agent group detail information
     */
    getAgentGroupDetail(identifier: string, params?: Omit<AgentGroupDetailQuery, 'identifier'>, options?: globalThis.RequestInit): Promise<AgentGroupDetail>;
    /**
     * Creates a new agent group in the marketplace
     *
     * Creates a new agent group with initial version (v1) and all member agents.
     * Requires authentication and ownership.
     *
     * @param groupData - The agent group data to create
     * @param options - Optional request options
     * @returns Promise resolving to the created agent group response
     */
    createAgentGroup(groupData: AgentGroupCreateRequest, options?: globalThis.RequestInit): Promise<AgentGroupCreateResponse>;
    /**
     * Creates a new version for an existing agent group
     *
     * Creates a new version with unified version number for the group and all member agents.
     * Fields not provided will be inherited from the latest version.
     *
     * @param versionData - The version data to create
     * @param options - Optional request options
     * @returns Promise resolving to the created version response
     */
    createAgentGroupVersion(versionData: AgentGroupVersionCreateRequest, options?: globalThis.RequestInit): Promise<AgentGroupVersionCreateResponse>;
    /**
     * Modifies an existing agent group
     *
     * Updates the agent group's base information. Can be used to change status,
     * metadata, or other group properties. Only the owner can modify the group.
     *
     * @param groupData - The agent group data to modify
     * @param options - Optional request options
     * @returns Promise resolving to the modified agent group response
     */
    modifyAgentGroup(groupData: AgentGroupModifyRequest, options?: globalThis.RequestInit): Promise<AgentGroupModifyResponse>;
    /**
     * Checks if an agent group exists in the marketplace
     *
     * @param identifier - Unique identifier of the agent group
     * @param options - Optional request options
     * @returns Promise resolving to true if agent group exists, false otherwise
     */
    checkAgentGroupExists(identifier: string, options?: globalThis.RequestInit): Promise<boolean>;
    /**
     * Changes the status of an agent group
     *
     * Internal helper method used by publish/unpublish/archive/deprecate methods.
     * Requires authentication.
     *
     * @param identifier - Unique identifier of the agent group
     * @param status - New status to set
     * @param options - Optional request options
     * @returns Promise resolving to the status change response
     */
    private changeStatus;
    /**
     * Publishes an agent group to the marketplace
     *
     * Makes the agent group publicly visible and available for use.
     * Requires authentication and ownership of the agent group.
     * Only groups with "Safe" safety check status can be published.
     *
     * @param identifier - Unique identifier of the agent group
     * @param options - Optional request options
     * @returns Promise resolving to the status change response
     */
    publish(identifier: string, options?: globalThis.RequestInit): Promise<AgentGroupStatusChangeResponse>;
    /**
     * Unpublishes an agent group from the marketplace
     *
     * Hides the agent group from public view. The agent group data is preserved
     * and can be republished later.
     * Requires authentication and ownership of the agent group.
     *
     * @param identifier - Unique identifier of the agent group
     * @param options - Optional request options
     * @returns Promise resolving to the status change response
     */
    unpublish(identifier: string, options?: globalThis.RequestInit): Promise<AgentGroupStatusChangeResponse>;
    /**
     * Archives an agent group
     *
     * Marks the agent group as archived. Archived agent groups are typically
     * no longer actively maintained but may still be accessible.
     * Requires authentication and ownership of the agent group.
     *
     * @param identifier - Unique identifier of the agent group
     * @param options - Optional request options
     * @returns Promise resolving to the status change response
     */
    archive(identifier: string, options?: globalThis.RequestInit): Promise<AgentGroupStatusChangeResponse>;
    /**
     * Deprecates an agent group
     *
     * Marks the agent group as deprecated. Deprecated agent groups are still
     * accessible but users are encouraged to migrate to alternatives.
     * Requires authentication and ownership of the agent group.
     *
     * @param identifier - Unique identifier of the agent group
     * @param options - Optional request options
     * @returns Promise resolving to the status change response
     */
    deprecate(identifier: string, options?: globalThis.RequestInit): Promise<AgentGroupStatusChangeResponse>;
    /**
     * Forks an existing agent group to create a new group owned by the current user
     *
     * Creates a complete copy of the agent group including all member agents,
     * their configurations, and version data. Statistical data (ratings, likes, etc.)
     * are reset to zero. Requires authentication.
     *
     * @param sourceIdentifier - Identifier of the agent group to fork
     * @param forkData - Fork request parameters (new identifier, name, etc.)
     * @param options - Optional request options
     * @returns Promise resolving to the fork response with new group details
     */
    forkAgentGroup(sourceIdentifier: string, forkData: AgentGroupForkRequest, options?: globalThis.RequestInit): Promise<AgentGroupForkResponse>;
    /**
     * Retrieves all public forks of a specific agent group
     *
     * Returns a list of agent groups that were forked from the specified group.
     * Only returns forks that are public and published.
     *
     * @param identifier - Identifier of the source agent group
     * @param options - Optional request options
     * @returns Promise resolving to the forks list response
     */
    getAgentGroupForks(identifier: string, options?: globalThis.RequestInit): Promise<AgentGroupForksResponse>;
    /**
     * Retrieves the source agent group that this group was forked from
     *
     * Returns null if the agent group is not a fork (original group).
     *
     * @param identifier - Identifier of the agent group to check
     * @param options - Optional request options
     * @returns Promise resolving to the fork source response
     */
    getAgentGroupForkSource(identifier: string, options?: globalThis.RequestInit): Promise<AgentGroupForkSourceResponse>;
}

/**
 * Auth Service
 *
 * Provides authentication and authorization functionality for the LobeHub Marketplace.
 * This service handles OIDC user authentication, client registration, and M2M token management.
 */
declare class AuthService extends BaseSDK {
    /** Successful handoff payload */
    private static readonly HANDOFF_SUCCESS_STATUS;
    /** Pending handoff status */
    private static readonly HANDOFF_PENDING_STATUS;
    /** Consumed handoff status */
    private static readonly HANDOFF_CONSUMED_STATUS;
    /** Expired handoff status */
    private static readonly HANDOFF_EXPIRED_STATUS;
    /** Normalize token response from snake_case to camelCase fields */
    private static normalizeTokenResponse;
    /**
     * Exchanges an authorization code or refresh token for access credentials
     *
     * Supports both the authorization_code and refresh_token grant types.
     * The method normalizes the response to camelCase field names.
     *
     * @param request - Token exchange parameters
     * @param options - Optional fetch options (e.g., custom headers)
     * @returns Promise resolving to the OAuth token payload
     */
    exchangeOAuthToken(request: AuthorizationCodeTokenRequest | RefreshTokenRequest, options?: globalThis.RequestInit): Promise<OAuthTokenResponse>;
    /**
     * Retrieves user information from the OIDC userinfo endpoint
     *
     * Requires a valid access token in the Authorization header.
     *
     * @param accessToken - The access token to use for authentication
     * @param options - Optional request options
     * @returns Promise resolving to the user information
     */
    getUserInfo(accessToken: string, options?: globalThis.RequestInit): Promise<{
        email?: string;
        email_verified?: boolean;
        name?: string;
        picture?: string;
        sub: string;
    }>;
    /**
     * Registers a new OAuth client with the marketplace
     *
     * This is typically used for device registration or application setup.
     * Returns client credentials that can be used for M2M authentication.
     *
     * @param clientData - The client registration data
     * @param options - Optional request options
     * @returns Promise resolving to the client credentials
     */
    registerClient(clientData: ClientRegistrationRequest, options?: globalThis.RequestInit): Promise<ClientRegistrationResponse>;
    /**
     * Fetches an M2M (Machine-to-Machine) access token
     *
     * Uses client credentials to obtain an access token for server-to-server communication.
     * This method requires clientId and clientSecret to be set in the SDK options.
     *
     * @returns Promise resolving to the access token and expiration time
     */
    getM2MToken(): Promise<{
        accessToken: string;
        expiresIn: number;
    }>;
    /** OAuth handoff response shapes */
    private static typeHandoffSuccess;
    /**
     * Get OAuth handoff status and data by id.
     * Maps server HTTP statuses to a typed status union:
     * - 200: success
     * - 202: pending
     * - 404: consumed
     * - 410: expired
     * - others: error (throws)
     */
    getOAuthHandoff(id: string, options?: globalThis.RequestInit): Promise<{
        clientId: string;
        code: string;
        redirectUri: string;
        status: 'success';
    } | {
        status: 'pending';
    } | {
        status: 'consumed';
    } | {
        status: 'expired';
    }>;
    /**
     * Poll OAuth handoff result until it becomes terminal.
     * Terminal statuses: success, expired, consumed.
     * Non-terminal: pending → continue polling.
     */
    pollOAuthHandoff(id: string, params?: {
        intervalMs?: number;
        requestInit?: globalThis.RequestInit;
        signal?: AbortSignal;
        timeoutMs?: number;
    }): Promise<{
        clientId: string;
        code: string;
        redirectUri: string;
        status: 'success';
    } | {
        status: 'expired';
    } | {
        status: 'consumed';
    }>;
}

/**
 * Connect Service
 *
 * Provides OAuth connection management functionality.
 * This service allows:
 * - Listing available OAuth providers
 * - Getting authorize URL to initiate OAuth flow
 * - Checking connection status
 * - Managing existing connections (refresh, revoke)
 *
 * @example
 * ```typescript
 * const sdk = new MarketSDK({ accessToken: 'user-token' });
 *
 * // 1. List available providers
 * const { providers } = await sdk.connect.listProviders();
 *
 * // 2. Check if connected to Linear
 * const { connected } = await sdk.connect.getStatus('linear');
 *
 * // 3. If not connected, get authorize URL and redirect user
 * if (!connected) {
 *   const authorizeUrl = sdk.connect.getAuthorizeUrl('linear');
 *   window.location.href = authorizeUrl;
 * }
 *
 * // 4. After user completes OAuth, they can use skills
 * const result = await sdk.skills.callTool('linear', {
 *   tool: 'create_issue',
 *   args: { title: 'New issue', team: 'Engineering' }
 *   ...
 * }});
 * ```
 * @example
 * ```typescript
 * const result = await sdk.skills.callTool('github', {
 *   tool: 'create_issue',
 *   args: { title: 'New issue', team: 'Engineering' }
 *   ...
 * });
 * ```
 */
declare class ConnectService extends BaseSDK {
    /**
     * Lists all available OAuth providers
     *
     * Returns providers that have credentials configured on the server.
     * This is a public endpoint that doesn't require authentication.
     *
     * @param options - Optional request options
     * @returns Promise resolving to the list of available providers
     */
    listProviders(options?: globalThis.RequestInit): Promise<ListConnectProvidersResponse>;
    /**
     * Gets detailed information about a specific provider
     *
     * This is a public endpoint that doesn't require authentication.
     *
     * @param provider - The provider ID (e.g., 'linear', 'github')
     * @param options - Optional request options
     * @returns Promise resolving to the provider details
     */
    getProvider(provider: string, options?: globalThis.RequestInit): Promise<GetConnectProviderResponse>;
    /**
     * Requests an authorization code for initiating OAuth flow
     *
     * This method obtains a signed, short-lived authorization code that can be
     * used to start the OAuth flow in a browser context where Bearer tokens
     * cannot be sent (e.g., opening a popup or redirecting the page).
     *
     * The returned `authorize_url` can be directly opened in a browser.
     *
     * **This is the recommended way to initiate OAuth authorization.**
     *
     * @param provider - The provider ID (e.g., 'linear', 'github', 'microsoft')
     * @param params - Optional parameters for scopes and redirect URI
     * @param options - Optional request options (must include authentication)
     * @returns Promise resolving to the authorization code and URL
     *
     * @example
     * ```typescript
     * // Get authorization code and URL
     * const { authorize_url, code, expires_in } = await sdk.connect.authorize('linear');
     *
     * // Open the URL in a popup
     * const popup = window.open(authorize_url, 'oauth', 'width=600,height=700,popup=yes');
     *
     * // With custom scopes
     * const { authorize_url } = await sdk.connect.authorize('github', {
     *   scopes: ['user', 'repo', 'read:org']
     * });
     *
     * // With redirect URI
     * const { authorize_url } = await sdk.connect.authorize('microsoft', {
     *   scopes: ['Calendars.ReadWrite'],
     *   redirect_uri: 'https://myapp.com/oauth/callback'
     * });
     * ```
     */
    authorize(provider: string, params?: AuthorizeParams, options?: globalThis.RequestInit): Promise<AuthorizeResponse>;
    /**
     * Generates the OAuth authorization URL for a provider (deprecated)
     *
     * @deprecated Use `authorize()` instead. This method constructs a URL that
     * requires Bearer token authentication, which doesn't work in browser redirects.
     * The new `authorize()` method returns a URL with a signed code that works
     * in browser contexts.
     *
     * @param provider - The provider ID (e.g., 'linear', 'github')
     * @param params - Optional parameters for scopes and redirect URI
     * @returns The authorization URL (requires Bearer token, won't work in browser)
     *
     * @example
     * ```typescript
     * // OLD way (deprecated) - won't work in browser
     * const url = sdk.connect.getAuthorizeUrl('linear');
     *
     * // NEW way (recommended) - works in browser
     * const { authorize_url } = await sdk.connect.authorize('linear');
     * window.open(authorize_url, 'oauth', 'width=600,height=700');
     * ```
     */
    getAuthorizeUrl(provider: string, params?: GetAuthorizeUrlParams): string;
    /**
     * Gets the connection status for a specific provider
     *
     * Checks if the authenticated user has an active OAuth connection.
     * Requires authentication.
     *
     * @param provider - The provider ID (e.g., 'linear', 'github')
     * @param options - Optional request options (must include authentication)
     * @returns Promise resolving to the connection status
     */
    getStatus(provider: string, options?: globalThis.RequestInit): Promise<GetConnectionStatusResponse>;
    /**
     * Lists all OAuth connections for the authenticated user
     *
     * Requires authentication.
     *
     * @param options - Optional request options (must include authentication)
     * @returns Promise resolving to the list of connections
     */
    listConnections(options?: globalThis.RequestInit): Promise<ListConnectionsResponse>;
    /**
     * Checks the health of a specific provider connection
     *
     * Verifies if the token is valid, expiring soon, or expired.
     * Requires authentication.
     *
     * @param provider - The provider ID (e.g., 'linear', 'github')
     * @param options - Optional request options (must include authentication)
     * @returns Promise resolving to the connection health status
     */
    getHealth(provider: string, options?: globalThis.RequestInit): Promise<GetConnectionHealthResponse>;
    /**
     * Checks the health of all provider connections
     *
     * Requires authentication.
     *
     * @param options - Optional request options (must include authentication)
     * @returns Promise resolving to the health status of all connections
     */
    getAllHealth(options?: globalThis.RequestInit): Promise<GetAllConnectionsHealthResponse>;
    /**
     * Manually refreshes the access token for a provider connection
     *
     * Only works for providers that support token refresh.
     * Requires authentication.
     *
     * @param provider - The provider ID (e.g., 'linear', 'github')
     * @param options - Optional request options (must include authentication)
     * @returns Promise resolving to the refresh result
     */
    refresh(provider: string, options?: globalThis.RequestInit): Promise<RefreshConnectionResponse>;
    /**
     * Revokes/disconnects a provider connection
     *
     * Removes the OAuth connection and deletes stored tokens.
     * Requires authentication.
     *
     * @param provider - The provider ID (e.g., 'linear', 'github')
     * @param options - Optional request options (must include authentication)
     * @returns Promise resolving to the revoke result
     */
    revoke(provider: string, options?: globalThis.RequestInit): Promise<RevokeConnectionResponse>;
}

/**
 * Cred Service
 *
 * Provides user credential management functionality.
 * This service allows:
 * - Creating KV, OAuth, and file credentials
 * - Listing and retrieving credentials
 * - Updating and deleting credentials
 * - Checking credential status for skills
 * - Injecting credentials into sandbox environments
 *
 * @example
 * ```typescript
 * const sdk = new MarketSDK({ accessToken: 'user-token' });
 *
 * // Create a KV credential
 * const cred = await sdk.creds.createKV({
 *   key: 'openai',
 *   name: 'OpenAI API Key',
 *   type: 'kv-env',
 *   values: { OPENAI_API_KEY: 'sk-xxx' }
 * });
 *
 * // List all credentials
 * const { data } = await sdk.creds.list();
 *
 * // Inject credentials for a skill
 * const result = await sdk.creds.inject({
 *   skillIdentifier: 'my-skill',
 *   sandbox: true
 * });
 * ```
 */
declare class CredService extends BaseSDK {
    /**
     * Lists all credentials for the authenticated user
     *
     * Returns credential summaries with masked values.
     * Requires authentication.
     *
     * @param options - Optional request options
     * @returns Promise resolving to the list of credentials
     */
    list(options?: globalThis.RequestInit): Promise<ListCredsResponse>;
    /**
     * Gets a specific credential by ID
     *
     * Optionally returns decrypted plaintext values for KV types.
     * Requires authentication.
     *
     * @param id - The credential ID
     * @param getOptions - Options for getting the credential
     * @param options - Optional request options
     * @returns Promise resolving to the credential details
     */
    get(id: number, getOptions?: GetCredOptions, options?: globalThis.RequestInit): Promise<CredWithPlaintext>;
    /**
     * Creates a new KV credential (kv-env or kv-header)
     *
     * Use `kv-env` for environment variables (supported in sandbox).
     * Use `kv-header` for HTTP headers (not supported in sandbox).
     *
     * Requires authentication.
     *
     * @param data - The credential data to create
     * @param options - Optional request options
     * @returns Promise resolving to the created credential
     */
    createKV(data: CreateKVCredRequest, options?: globalThis.RequestInit): Promise<UserCredSummary>;
    /**
     * Creates a new OAuth credential by linking to an existing OAuth connection
     *
     * The OAuth connection must already exist (use ConnectService to establish connections).
     * Requires authentication.
     *
     * @param data - The credential data to create
     * @param options - Optional request options
     * @returns Promise resolving to the created credential
     */
    createOAuth(data: CreateOAuthCredRequest, options?: globalThis.RequestInit): Promise<UserCredSummary>;
    /**
     * Creates a new file credential
     *
     * The file must be uploaded first and the fileHashId obtained.
     * Requires authentication.
     *
     * @param data - The credential data to create
     * @param options - Optional request options
     * @returns Promise resolving to the created credential
     */
    createFile(data: CreateFileCredRequest, options?: globalThis.RequestInit): Promise<UserCredSummary>;
    /**
     * Updates an existing credential
     *
     * Can update name, description, and values (for KV types).
     * Requires authentication.
     *
     * @param id - The credential ID to update
     * @param data - The data to update
     * @param options - Optional request options
     * @returns Promise resolving to the updated credential
     */
    update(id: number, data: UpdateCredRequest, options?: globalThis.RequestInit): Promise<UserCredSummary>;
    /**
     * Deletes a credential by ID
     *
     * Requires authentication.
     *
     * @param id - The credential ID to delete
     * @param options - Optional request options
     * @returns Promise resolving to the delete result
     */
    delete(id: number, options?: globalThis.RequestInit): Promise<DeleteCredResponse>;
    /**
     * Deletes a credential by key
     *
     * Useful when you know the credential key but not the ID.
     * Requires authentication.
     *
     * @param key - The credential key to delete
     * @param options - Optional request options
     * @returns Promise resolving to the delete result
     */
    deleteByKey(key: string, options?: globalThis.RequestInit): Promise<DeleteCredResponse>;
    /**
     * Gets the credential status for a skill
     *
     * Returns which credentials are required by the skill and
     * whether the user has provided them.
     *
     * Requires authentication.
     *
     * @param skillIdentifier - The skill identifier
     * @param options - Optional request options
     * @returns Promise resolving to the credential status list
     */
    getSkillCredStatus(skillIdentifier: string, options?: globalThis.RequestInit): Promise<SkillCredStatus[]>;
    /**
     * Injects specific credentials by key list into a sandbox environment
     *
     * Use this when you want to inject specific credentials regardless of skill requirements.
     * Returns decrypted credentials that can be used to set environment variables and write files.
     *
     * Note: `kv-header` type credentials are not supported in sandbox mode.
     *
     * Requires authentication.
     *
     * @param request - The injection request with keys array
     * @param options - Optional request options
     * @returns Promise resolving to the injection result
     *
     * @example
     * ```typescript
     * const result = await sdk.creds.inject({
     *   keys: ['openai', 'github-pat'],
     *   sandbox: true
     * });
     *
     * if (result.success) {
     *   // Set environment variables
     *   for (const [key, value] of Object.entries(result.credentials.env)) {
     *     process.env[key] = value;
     *   }
     * } else {
     *   console.log('Not found credentials:', result.notFound);
     * }
     * ```
     */
    inject(request: InjectCredsRequest, options?: globalThis.RequestInit): Promise<InjectCredsResponse>;
    /**
     * Injects credentials for a skill based on its creds declaration
     *
     * Use this when executing a skill - it will auto-inject based on skill's requirements.
     * Returns decrypted credentials that can be used to set environment variables and write files.
     *
     * Note: `kv-header` type credentials are not supported in sandbox mode.
     *
     * Requires authentication.
     *
     * @param request - The injection request with skill identifier
     * @param options - Optional request options
     * @returns Promise resolving to the injection result
     *
     * @example
     * ```typescript
     * const result = await sdk.creds.injectForSkill({
     *   skillIdentifier: 'github-mcp',
     *   sandbox: true
     * });
     *
     * if (result.success) {
     *   // All required credentials are satisfied
     *   for (const [key, value] of Object.entries(result.credentials.env)) {
     *     process.env[key] = value;
     *   }
     * } else {
     *   console.log('Missing required credentials:', result.missing);
     * }
     * ```
     */
    injectForSkill(request: InjectCredsForSkillRequest, options?: globalThis.RequestInit): Promise<InjectCredsForSkillResponse>;
}

/**
 * Feedback Service
 *
 * Provides functionality for submitting user feedback to the LobeHub Marketplace.
 * Feedback is tracked in Linear for follow-up.
 *
 * Note: This endpoint is rate-limited to 3 requests per minute per IP.
 */
declare class FeedbackService extends BaseSDK {
    /**
     * Submits user feedback
     *
     * Creates a feedback issue in Linear for tracking and follow-up.
     * Email is required for contact purposes.
     *
     * Rate limit: 3 requests per minute per IP
     *
     * @param data - The feedback data to submit
     * @param options - Optional request options
     * @returns Promise resolving to the feedback submission response
     * @throws Error if rate limit is exceeded (429) or submission fails
     *
     * @example
     * ```typescript
     * const response = await sdk.feedback.submitFeedback({
     *   email: 'user@example.com',
     *   title: 'Feature request',
     *   message: 'It would be great if...',
     *   clientInfo: {
     *     url: window.location.href,
     *     userAgent: navigator.userAgent,
     *   },
     * });
     * console.log('Feedback submitted:', response.issueUrl);
     * ```
     */
    submitFeedback(data: SubmitFeedbackRequest, options?: globalThis.RequestInit): Promise<SubmitFeedbackResponse>;
}

/**
 * Plugins Service
 *
 * Provides access to plugin-related functionality in the LobeHub Marketplace.
 * This service handles listing, searching, and retrieving detailed information
 * about plugins available in the marketplace.
 */
declare class PluginsService extends BaseSDK {
    /**
     * Retrieves a list of plugins from the marketplace
     *
     * Supports filtering, pagination, and localization of results.
     *
     * @param params - Query parameters for filtering and pagination
     * @param options
     * @returns Promise resolving to the plugin list response containing items and pagination info
     */
    getPluginList(params?: PluginQueryParams, options?: globalThis.RequestInit): Promise<PluginListResponse>;
    /**
     * Retrieves all plugin categories and their counts
     *
     * Returns a list of categories along with the number of plugins in each category.
     * Useful for building category filters in a UI. Supports optional search filtering
     * via 'q' parameter and locale specification.
     *
     * @param params - Query parameters for filtering categories
     * @param options - Optional request options
     * @returns Promise resolving to an array of category items with counts
     */
    getCategories(params?: CategoryListQuery, options?: globalThis.RequestInit): Promise<CategoryItem[]>;
    /**
     * Retrieves all published plugin identifiers
     *
     * Returns a lightweight list of all published plugin identifiers without
     * full plugin metadata. This is useful for clients that need to know which
     * plugins are available without fetching complete plugin information.
     *
     * @deprecated Use {@link PluginsService.getSitemap} instead.
     * @returns Promise resolving to an array containing identifiers array and last modified time
     */
    getPublishedIdentifiers(options?: globalThis.RequestInit): Promise<{
        identifier: string;
        lastModified: string;
    }[]>;
    /**
     * Retrieves a paginated list of published plugin (MCP) identifiers for sitemaps
     *
     * @param params - Pagination (`page` defaults to 1, `pageSize` defaults to 200, max 500 server-side)
     * @param options - Optional request options
     */
    getSitemap(params?: {
        page?: number;
        pageSize?: number;
    }, options?: globalThis.RequestInit): Promise<SitemapResponse>;
    /**
     * Retrieves the manifest for a specific plugin
     *
     * The manifest contains detailed information about a plugin, including
     * its capabilities, tools, prompts, and resources.
     *
     * @param identifier - Unique identifier of the plugin
     * @param locale - Optional locale for localized content (defaults to SDK default locale)
     * @param version - Optional specific version to retrieve (defaults to latest)
     * @param options
     * @returns Promise resolving to the plugin manifest
     */
    getPluginManifest({ locale, version, identifier, }: {
        identifier: string;
        locale?: string;
        version?: string;
    }, options?: globalThis.RequestInit): Promise<PluginManifest>;
    /**
     * Retrieves the plugin detailed information about a plugin, including
     * its capabilities, tools, prompts, and resources.
     *
     * @param identifier - Unique identifier of the plugin
     * @param locale - Optional locale for localized content (defaults to SDK default locale)
     * @param version - Optional specific version to retrieve (defaults to latest)
     * @returns Promise resolving to the plugin manifest
     */
    getPluginDetail({ locale, version, identifier, }: {
        identifier: string;
        locale?: string;
        version?: string;
    }, options?: globalThis.RequestInit): Promise<PluginItemDetail>;
    /**
     * Report a plugin installation attempt
     *
     * Reports the outcome of a plugin installation attempt, including timing,
     * success status, manifest information, and error details if applicable.
     * This helps improve plugin validation and provides analytics about installation success rates.
     *
     * @param reportData - The installation report data
     * @returns Promise resolving to the report submission response
     *
     */
    reportInstallation(reportData: InstallReportRequest): Promise<InstallReportResponse>;
    /**
     * Report a plugin method call attempt
     *
     * Reports the outcome of a plugin method call, including timing,
     * success status, method information, and error details if applicable.
     * This helps improve plugin performance monitoring and provides usage analytics.
     *
     * @param reportData - The call report data
     * @returns Promise resolving to the report submission response
     */
    reportCall(reportData: CallReportRequest): Promise<CallReportResponse>;
    /**
     * Record a plugin event for the authenticated user
     *
     * Records plugin usage actions (install, activate, uninstall, click) for analytics.
     *
     * @param eventData - The plugin event payload
     * @param options - Optional request init overrides
     */
    createEvent(eventData: PluginEventRequest, options?: globalThis.RequestInit): Promise<void>;
    /**
     * Call a cloud-hosted plugin tool via the cloud gateway
     *
     * Proxies tool calls to official cloud-hosted plugins with authentication and validation.
     * This method requires authentication via bearer token (apiKey or M2M credentials).
     *
     * @param request - The cloud gateway request containing plugin identifier, tool name, and parameters
     * @param options - Optional request options
     * @returns Promise resolving to the tool call result
     *
     * @example
     * ```typescript
     * const result = await sdk.plugins.callCloudGateway({
     *   identifier: 'my-plugin',
     *   toolName: 'myTool',
     *   apiParams: { param1: 'value1' }
     * });
     * ```
     */
    callCloudGateway(request: CloudGatewayRequest, options?: globalThis.RequestInit): Promise<CloudGatewayResponse>;
    /**
     * Execute a built-in tool via AWS Bedrock AgentCore Code Interpreter
     *
     * This method provides access to file operations, command execution, and session management
     * tools running in an isolated sandbox environment. Sessions are automatically managed
     * per user/topic combination.
     *
     * @param toolName - Name of the tool to execute
     * @param params - Tool-specific parameters
     * @param context - User and topic context for session isolation
     * @param options - Optional request options
     * @returns Promise resolving to the tool execution result
     *
     * @example
     * ```typescript
     * // Run a shell command
     * const result = await sdk.plugins.runBuildInTool(
     *   'runCommand',
     *   { command: 'ls -la' },
     *   { userId: 'user-123', topicId: 'topic-456' }
     * );
     *
     * // Read a file
     * const fileResult = await sdk.plugins.runBuildInTool(
     *   'readLocalFile',
     *   { path: '/tmp/example.txt' },
     *   { userId: 'user-123', topicId: 'topic-456' }
     * );
     * ```
     */
    runBuildInTool<T extends CodeInterpreterToolName>(toolName: T, params: CodeInterpreterToolParams[T], context: {
        topicId: string;
        userId: string;
    }, options?: globalThis.RequestInit): Promise<RunBuildInToolsResponse>;
    /**
     * Execute a shell command in the Code Interpreter sandbox
     *
     * @param command - Shell command to execute
     * @param context - User and topic context
     * @param options - Additional options (background, timeout)
     * @returns Promise resolving to command execution result
     */
    runCommand(command: string, context: {
        topicId: string;
        userId: string;
    }, options?: {
        background?: boolean;
        timeout?: number;
    }): Promise<RunBuildInToolsResponse>;
    /**
     * Read a file from the Code Interpreter sandbox
     *
     * @param path - File path to read
     * @param context - User and topic context
     * @param options - Line range options (startLine, endLine)
     * @returns Promise resolving to file content
     */
    readFile(path: string, context: {
        topicId: string;
        userId: string;
    }, options?: {
        endLine?: number;
        startLine?: number;
    }): Promise<RunBuildInToolsResponse>;
    /**
     * Write content to a file in the Code Interpreter sandbox
     *
     * @param path - File path to write
     * @param content - Content to write
     * @param context - User and topic context
     * @param options - Additional options (createDirectories)
     * @returns Promise resolving to write result
     */
    writeFile(path: string, content: string, context: {
        topicId: string;
        userId: string;
    }, options?: {
        createDirectories?: boolean;
    }): Promise<RunBuildInToolsResponse>;
    /**
     * List files in a directory in the Code Interpreter sandbox
     *
     * @param directoryPath - Directory path to list
     * @param context - User and topic context
     * @returns Promise resolving to directory listing
     */
    listFiles(directoryPath: string, context: {
        topicId: string;
        userId: string;
    }): Promise<RunBuildInToolsResponse>;
    /**
     * Search for files matching a glob pattern
     *
     * @param pattern - Glob pattern (e.g., "**\/*.ts")
     * @param context - User and topic context
     * @param directory - Base directory (optional)
     * @returns Promise resolving to matching files
     */
    globFiles(pattern: string, context: {
        topicId: string;
        userId: string;
    }, directory?: string): Promise<RunBuildInToolsResponse>;
    /**
     * Search file contents using regex pattern
     *
     * @param pattern - Regex pattern to search
     * @param directory - Directory to search
     * @param context - User and topic context
     * @param options - Additional options (filePattern, recursive)
     * @returns Promise resolving to grep results
     */
    grepContent(pattern: string, directory: string, context: {
        topicId: string;
        userId: string;
    }, options?: {
        filePattern?: string;
        recursive?: boolean;
    }): Promise<RunBuildInToolsResponse>;
    /**
     * Export a file from the Code Interpreter sandbox to a pre-signed URL
     *
     * This method uploads a file from the sandbox to an external storage location
     * via a pre-signed URL (e.g., S3 pre-signed URL). The upload is performed
     * using Python code execution within the sandbox.
     *
     * @param path - File path in sandbox to export
     * @param uploadUrl - Pre-signed URL to upload the file to
     * @param context - User and topic context
     * @returns Promise resolving to export result with success status and file info
     *
     * @example
     * ```typescript
     * const result = await sdk.plugins.exportFile(
     *   './output/result.csv',
     *   'https://s3.amazonaws.com/bucket/key?X-Amz-Signature=...',
     *   { userId: 'user-123', topicId: 'topic-456' }
     * );
     *
     * if (result.success && result.data?.result.success) {
     *   console.log('File exported:', result.data.result.size, 'bytes');
     * }
     * ```
     */
    exportFile(path: string, uploadUrl: string, context: {
        topicId: string;
        userId: string;
    }): Promise<RunBuildInToolsResponse>;
    /**
     * Submits or updates a rating for a plugin
     *
     * @param identifier - Unique plugin identifier
     * @param score - Rating score (1-5)
     * @param options - Optional request options
     * @returns Promise resolving to the submitted score
     */
    submitRating(identifier: string, score: number, options?: globalThis.RequestInit): Promise<{
        score: number;
    }>;
    /**
     * Deletes the current user/agent's rating for a plugin
     *
     * @param identifier - Unique plugin identifier
     * @param options - Optional request options
     * @returns Promise resolving to success status
     */
    deleteRating(identifier: string, options?: globalThis.RequestInit): Promise<{
        success: boolean;
    }>;
    /**
     * Gets the rating distribution for a plugin
     *
     * @param identifier - Unique plugin identifier
     * @param options - Optional request options
     * @returns Promise resolving to the rating distribution
     */
    getRatingDistribution(identifier: string, options?: globalThis.RequestInit): Promise<PluginRatingDistribution>;
    /**
     * Gets paginated comments for a plugin
     *
     * @param identifier - Unique plugin identifier
     * @param params - Query parameters for pagination and sorting
     * @param options - Optional request options
     * @returns Promise resolving to the paginated comment list
     */
    getComments(identifier: string, params?: PluginCommentListQuery, options?: globalThis.RequestInit): Promise<PluginCommentListResponse>;
    /**
     * Gets the latest comment for the authenticated user or agent on a plugin
     *
     * @param identifier - Unique plugin identifier
     * @param options - Optional request options
     * @returns Promise resolving to the latest own comment or null when none exists
     */
    getLatestOwnComment(identifier: string, options?: globalThis.RequestInit): Promise<PluginLatestOwnComment | null>;
    /**
     * Creates a comment on a plugin, optionally with a rating
     *
     * @param identifier - Unique plugin identifier
     * @param data - Comment data with content, optional score, and optional parentId
     * @param options - Optional request options
     * @returns Promise resolving to the created comment (with optional rating field)
     */
    createComment(identifier: string, data: {
        content: string;
        parentId?: number;
        score?: number;
    }, options?: globalThis.RequestInit): Promise<PluginCommentCreateResponse>;
    /**
     * Deletes a comment from a plugin
     *
     * @param identifier - Unique plugin identifier
     * @param commentId - Comment ID to delete
     * @param options - Optional request options
     * @returns Promise resolving to success status
     */
    deleteComment(identifier: string, commentId: number, options?: globalThis.RequestInit): Promise<PluginCommentDeleteResponse>;
    /**
     * Adds or updates a reaction on a comment
     *
     * @param commentId - Comment ID to react to
     * @param type - Reaction type ('upvote' or 'downvote')
     * @param options - Optional request options
     * @returns Promise resolving to the created reaction
     */
    addReaction(commentId: number, type: 'downvote' | 'upvote', options?: globalThis.RequestInit): Promise<PluginCommentReactionResponse>;
    /**
     * Removes a reaction from a comment
     *
     * @param commentId - Comment ID to remove reaction from
     * @param options - Optional request options
     * @returns Promise resolving to success status
     */
    removeReaction(commentId: number, options?: globalThis.RequestInit): Promise<{
        success: boolean;
    }>;
}

/**
 * Skill Service
 *
 * Provides access to skill providers and tool calling functionality.
 * This service allows:
 * - Listing available skill providers (OAuth-connected services like Linear, GitHub)
 * - Listing available tools for each provider
 * - Calling tools on connected providers
 * - Checking connection status
 */
declare class SkillService extends BaseSDK {
    /**
     * Lists all available skill providers
     *
     * Returns a list of providers that can be connected via OAuth.
     * This is a public endpoint that doesn't require authentication.
     *
     * @param options - Optional request options
     * @returns Promise resolving to the list of available providers
     */
    listProviders(options?: globalThis.RequestInit): Promise<ListSkillProvidersResponse>;
    /**
     * Lists available tools for a specific provider
     *
     * Returns the tools/functions that can be called on the provider.
     * This is a public endpoint that doesn't require authentication.
     *
     * @param provider - The provider ID (e.g., 'linear', 'github')
     * @param options - Optional request options
     * @returns Promise resolving to the list of available tools
     */
    listTools(provider: string, options?: globalThis.RequestInit): Promise<ListSkillToolsResponse>;
    /**
     * Gets details of a specific tool
     *
     * Returns detailed information about a tool including its input schema.
     * This is a public endpoint that doesn't require authentication.
     *
     * @param provider - The provider ID (e.g., 'linear', 'github')
     * @param toolName - The name of the tool
     * @param options - Optional request options
     * @returns Promise resolving to the tool details
     */
    getTool(provider: string, toolName: string, options?: globalThis.RequestInit): Promise<GetSkillToolResponse>;
    /**
     * Gets the connection status for a provider
     *
     * Checks if the authenticated user has an active OAuth connection to the provider.
     * Requires authentication.
     *
     * @param provider - The provider ID (e.g., 'linear', 'github')
     * @param options - Optional request options (must include authentication)
     * @returns Promise resolving to the connection status
     */
    getStatus(provider: string, options?: globalThis.RequestInit): Promise<GetSkillStatusResponse>;
    /**
     * Calls a tool on a connected provider
     *
     * Executes a tool/function on the provider using the user's OAuth connection.
     * Requires authentication and an active OAuth connection to the provider.
     *
     * @param provider - The provider ID (e.g., 'linear', 'github')
     * @param params - The tool call parameters (tool name and arguments)
     * @param options - Optional request options (must include authentication)
     * @returns Promise resolving to the tool call result
     *
     * @example
     * ```typescript
     * // Create a Linear issue
     * const result = await sdk.skills.callTool('linear', {
     *   tool: 'create_issue',
     *   args: {
     *     title: 'New feature request',
     *     team: 'Engineering',
     *     description: 'We need to implement...'
     *   }
     * });
     * ```
     */
    callTool<T = unknown>(provider: string, params: SkillCallParams, options?: globalThis.RequestInit): Promise<CallSkillToolResponse<T>>;
}

declare class MarketSkillCollectionService extends BaseSDK {
    getSkillCollectionDetail(slug: string, params?: MarketSkillCollectionDetailQuery, options?: globalThis.RequestInit): Promise<MarketSkillCollectionDetail>;
    getSkillCollections(params?: MarketSkillCollectionListQuery, options?: globalThis.RequestInit): Promise<MarketSkillCollectionListResponse>;
}

/**
 * Market Skill Service
 *
 * Provides access to marketplace skills (GitHub-imported skills).
 * This service handles:
 * - Listing and searching skills with various filters and sorting options
 * - Retrieving detailed skill information
 * - Getting skill download URLs
 * - Downloading skill ZIP packages
 * - Fetching skill categories
 *
 * These are different from OAuth skill providers (SkillService) - these are
 * standalone skill packages that can be browsed, downloaded, and used.
 */
declare class MarketSkillService extends BaseSDK {
    /**
     * Retrieves a list of skills from the marketplace
     *
     * Supports filtering, pagination, search, and various sorting options
     * including GitHub stats (stars, forks, watchers). Locale localizes
     * descriptions and summaries, but the returned skill name stays canonical.
     *
     * @param params - Query parameters for filtering and pagination
     * @param options - Optional request options
     * @returns Promise resolving to the skill list response with pagination info
     *
     * @example
     * ```typescript
     * // Get skills sorted by stars
     * const result = await sdk.marketSkills.getSkillList({
     *   sort: 'stars',
     *   order: 'desc',
     *   pageSize: 20
     * });
     *
     * // Search for skills
     * const result = await sdk.marketSkills.getSkillList({
     *   q: 'code review',
     *   category: 'development'
     * });
     * ```
     */
    getSkillList(params?: MarketSkillListQuery, options?: globalThis.RequestInit): Promise<MarketSkillListResponse>;
    /**
     * Retrieves detailed information about a specific skill
     *
     * Returns complete skill information including manifest, content,
     * resources, and version history. Locale localizes descriptions and
     * summaries, but the returned skill name stays canonical.
     *
     * @param identifier - Unique skill identifier (e.g., 'github.owner.repo.path')
     * @param params - Query parameters for locale and version
     * @param options - Optional request options
     * @returns Promise resolving to the skill detail
     *
     * @example
     * ```typescript
     * // Get latest version
     * const skill = await sdk.marketSkills.getSkillDetail('github.owner.repo');
     *
     * // Get specific version with locale
     * const skill = await sdk.marketSkills.getSkillDetail('github.owner.repo', {
     *   version: '1.0.0',
     *   locale: 'zh-CN'
     * });
     * ```
     */
    getSkillDetail(identifier: string, params?: MarketSkillDetailQuery, options?: globalThis.RequestInit): Promise<MarketSkillDetail>;
    /**
     * Gets the download URL for a skill ZIP package
     *
     * Returns the direct URL to download the skill ZIP file.
     * This URL can be used to download the skill package without
     * making an additional API request.
     *
     * @param identifier - Unique skill identifier
     * @param version - Optional specific version (defaults to latest)
     * @returns Download URL string
     *
     * @example
     * ```typescript
     * // Get download URL for latest version
     * const url = sdk.marketSkills.getDownloadUrl('github.owner.repo');
     * // Returns: https://market.lobehub.com/api/v1/skills/github.owner.repo/download
     *
     * // Get download URL for specific version
     * const url = sdk.marketSkills.getDownloadUrl('github.owner.repo', '1.0.0');
     * // Returns: https://market.lobehub.com/api/v1/skills/github.owner.repo/download?version=1.0.0
     * ```
     */
    getDownloadUrl(identifier: string, version?: string): string;
    /**
     * Downloads a skill ZIP package
     *
     * Fetches the skill ZIP file directly. The response includes
     * the raw buffer data that can be saved to a file.
     *
     * Note: This increments the skill's download count.
     *
     * @param identifier - Unique skill identifier
     * @param version - Optional specific version (defaults to latest)
     * @param options - Optional request options
     * @returns Promise resolving to the ZIP buffer and filename
     *
     * @example
     * ```typescript
     * // Download and save skill
     * const { buffer, filename } = await sdk.marketSkills.downloadSkill('github.owner.repo');
     * fs.writeFileSync(filename, buffer);
     * ```
     */
    downloadSkill(identifier: string, version?: string, options?: globalThis.RequestInit): Promise<{
        buffer: ArrayBuffer;
        filename: string;
    }>;
    /**
     * Retrieves all skill categories with counts
     *
     * Returns a list of categories along with the number of skills
     * in each category. Useful for building category filters.
     * Supports optional search filtering via 'q' parameter and locale specification.
     *
     * @param params - Query parameters for filtering categories
     * @param options - Optional request options
     * @returns Promise resolving to an array of categories with counts
     *
     * @example
     * ```typescript
     * // Get all categories
     * const categories = await sdk.marketSkills.getCategories();
     * // [{ category: 'development', count: 25 }, { category: 'productivity', count: 18 }, ...]
     *
     * // Get categories with search filter
     * const filtered = await sdk.marketSkills.getCategories({ q: 'code' });
     * ```
     */
    getCategories(params?: MarketSkillCategoryQuery, options?: globalThis.RequestInit): Promise<MarketSkillCategory[]>;
    /**
     * Retrieves all published skill identifiers
     *
     * Returns a lightweight list of all published skill identifiers
     * without full metadata. Useful for sitemap generation or
     * knowing which skills are available.
     *
     * @deprecated Use {@link MarketSkillService.getSitemap} instead.
     * @param options - Optional request options
     * @returns Promise resolving to an array of identifiers with last modified times
     */
    getPublishedIdentifiers(options?: globalThis.RequestInit): Promise<{
        identifier: string;
        lastModified: string;
    }[]>;
    /**
     * Retrieves a paginated list of published skill identifiers for sitemaps
     *
     * @param params - Pagination (`page` defaults to 1, `pageSize` defaults to 200, max 500 server-side)
     * @param options - Optional request options
     */
    getSitemap(params?: {
        page?: number;
        pageSize?: number;
    }, options?: globalThis.RequestInit): Promise<SitemapResponse>;
    /**
     * Checks if a skill exists in the marketplace
     *
     * @param identifier - Unique skill identifier
     * @param options - Optional request options
     * @returns Promise resolving to true if skill exists, false otherwise
     */
    checkSkillExists(identifier: string, options?: globalThis.RequestInit): Promise<boolean>;
    /**
     * Retrieves all versions of a skill
     *
     * Returns a list of all versions for a specific skill,
     * including version string, creation date, and whether it's the latest version.
     *
     * @param identifier - Unique skill identifier
     * @param options - Optional request options
     * @returns Promise resolving to an array of version summaries
     *
     * @example
     * ```typescript
     * const versions = await sdk.marketSkills.getSkillVersions('github.owner.repo');
     * // [{ version: '1.0.0', createdAt: '...', isLatest: true }, ...]
     * ```
     */
    getSkillVersions(identifier: string, options?: globalThis.RequestInit): Promise<MarketSkillVersionSummary[]>;
    /**
     * Retrieves detailed information about a specific skill version
     *
     * Returns complete skill information for a specific version,
     * including manifest, content, resources, and version history.
     *
     * @param identifier - Unique skill identifier
     * @param version - Version string (e.g., '1.0.0')
     * @param params - Query parameters for locale
     * @param options - Optional request options
     * @returns Promise resolving to the skill detail for the specified version
     *
     * @example
     * ```typescript
     * const skill = await sdk.marketSkills.getSkillVersion('github.owner.repo', '1.0.0');
     * ```
     */
    getSkillVersion(identifier: string, version: string, params?: {
        locale?: string;
    }, options?: globalThis.RequestInit): Promise<MarketSkillDetail>;
    /**
     * Reports a GitHub repository for skill import
     *
     * Submits a GitHub repository URL for async skill import.
     * The import will be processed in the background and the skill
     * will be available once the import completes.
     *
     * @param params - Report parameters containing gitUrl and optional branch
     * @param options - Optional request options
     * @returns Promise resolving to the report response with status
     *
     * @example
     * ```typescript
     * // Report a skill for import
     * const result = await sdk.marketSkills.reportGitHubSkill({
     *   gitUrl: 'https://github.com/owner/repo'
     * });
     *
     * if (result.status === 'queued') {
     *   console.log('Import queued:', result.identifier);
     * } else if (result.status === 'exists') {
     *   console.log('Skill already exists:', result.identifier);
     * }
     * ```
     */
    reportGitHubSkill(params: MarketReportGitHubSkillParams, options?: globalThis.RequestInit): Promise<MarketReportGitHubSkillResponse>;
    /**
     * Reports a skill installation attempt
     *
     * Submits installation telemetry data including success/failure status,
     * duration, and optional error information. Used by the CLI after
     * downloading and extracting a skill package.
     *
     * @param params - Installation report parameters
     * @param options - Optional request options
     * @returns Promise resolving to the report response
     *
     * @example
     * ```typescript
     * await sdk.marketSkills.reportSkillInstall({
     *   identifier: 'github.owner.repo',
     *   success: true,
     *   installDurationMs: 1234,
     *   platform: 'darwin-arm64',
     * });
     * ```
     */
    reportSkillInstall(params: MarketReportSkillInstallParams, options?: globalThis.RequestInit): Promise<MarketReportSkillInstallResponse>;
    /**
     * Submits or updates a rating for a skill
     *
     * @param identifier - Unique skill identifier
     * @param score - Rating score (1-5)
     * @param options - Optional request options
     * @returns Promise resolving to the submitted score
     */
    submitRating(identifier: string, score: number, options?: globalThis.RequestInit): Promise<{
        score: number;
    }>;
    /**
     * Gets the rating distribution for a skill
     *
     * @param identifier - Unique skill identifier
     * @param options - Optional request options
     * @returns Promise resolving to the rating distribution
     */
    getRatingDistribution(identifier: string, options?: globalThis.RequestInit): Promise<SkillRatingDistribution>;
    /**
     * Gets paginated comments for a skill
     *
     * @param identifier - Unique skill identifier
     * @param params - Query parameters for pagination and sorting
     * @param options - Optional request options
     * @returns Promise resolving to the paginated comment list
     */
    getComments(identifier: string, params?: SkillCommentListQuery, options?: globalThis.RequestInit): Promise<SkillCommentListResponse>;
    /**
     * Gets the latest comment for the authenticated user or agent on a skill
     *
     * @param identifier - Unique skill identifier
     * @param options - Optional request options
     * @returns Promise resolving to the latest own comment or null when none exists
     */
    getLatestOwnComment(identifier: string, options?: globalThis.RequestInit): Promise<SkillLatestOwnComment | null>;
    /**
     * Creates a comment on a skill, optionally with a rating
     *
     * @param identifier - Unique skill identifier
     * @param data - Comment data with content and optional score
     * @param options - Optional request options
     * @returns Promise resolving to the created comment (with optional rating field)
     */
    createComment(identifier: string, data: {
        content: string;
        score?: number;
    }, options?: globalThis.RequestInit): Promise<SkillCommentCreateResponse>;
    /**
     * Deletes a comment from a skill
     *
     * @param identifier - Unique skill identifier
     * @param commentId - Comment ID to delete
     * @param options - Optional request options
     * @returns Promise resolving to success status
     */
    deleteComment(identifier: string, commentId: number, options?: globalThis.RequestInit): Promise<SkillCommentDeleteResponse>;
    /**
     * Adds or updates a reaction on a comment
     *
     * @param commentId - Comment ID to react to
     * @param type - Reaction type ('upvote' or 'downvote')
     * @param options - Optional request options
     * @returns Promise resolving to the created reaction
     */
    addReaction(commentId: number, type: 'downvote' | 'upvote', options?: globalThis.RequestInit): Promise<{
        commentId: number;
        id: number;
        type: string;
    }>;
    /**
     * Removes a reaction from a comment
     *
     * @param commentId - Comment ID to remove reaction from
     * @param options - Optional request options
     * @returns Promise resolving to success status
     */
    removeReaction(commentId: number, options?: globalThis.RequestInit): Promise<{
        success: boolean;
    }>;
}

/**
 * User Service
 *
 * Provides access to user-related functionality in the LobeHub Marketplace.
 * This service handles retrieving and updating user profiles and their associated agents.
 */
declare class UserService extends BaseSDK {
    /**
     * Retrieves user information by account ID or userName
     *
     * Returns user profile along with their published public agents.
     * This is a public endpoint that doesn't require authentication.
     *
     * @param idOrUserName - The account ID (number) or userName (string)
     * @param params - Query parameters for locale
     * @param options - Optional request options
     * @returns Promise resolving to the user info response
     */
    getUserInfo(idOrUserName: number | string, params?: UserInfoQuery, options?: globalThis.RequestInit): Promise<UserInfoResponse>;
    /**
     * Updates the authenticated user's profile information
     *
     * Allows updating userName, displayName, avatarUrl, and meta fields.
     * Requires authentication - the user must be authenticated to update their own profile.
     *
     * @param data - The data to update (userName, displayName, avatarUrl, meta)
     * @param options - Optional request options (must include authentication)
     * @returns Promise resolving to the update response with the updated user profile
     * @throws Error if userName is already taken or update fails
     */
    updateUserInfo(data: UpdateUserInfoRequest, options?: globalThis.RequestInit): Promise<UpdateUserInfoResponse>;
    /**
     * Registers a new user via trust token authentication
     *
     * This endpoint ONLY accepts x-lobe-trust-token header authentication (Bearer tokens are not supported).
     * User information (email, username) is automatically fetched from app.lobehub.com.
     * If the user already exists (by email or userId), returns the existing user info.
     *
     * @param data - Registration data including registerUserId (required) and optional followUserId
     * @param options - Optional request options (must include x-lobe-trust-token header)
     * @returns Promise resolving to the registration response with user profile
     * @throws Error if user is banned, follow user is banned, or registration fails
     *
     * @example
     * ```typescript
     * const result = await userService.register({
     *   registerUserId: 'user_abc123',
     *   followUserId: 'user_xyz789', // Optional
     *   displayName: 'John Doe',
     *   userName: 'johndoe'
     * }, {
     *   headers: {
     *     'x-lobe-trust-token': trustToken
     *   }
     * });
     * ```
     */
    register(data: RegisterUserRequest, options?: globalThis.RequestInit): Promise<RegisterUserResponse>;
}

/**
 * User Follow Service
 *
 * Provides access to user follow functionality in the LobeHub Marketplace.
 * This service handles following/unfollowing users and retrieving follow relationships.
 */
declare class UserFollowService extends BaseSDK {
    /**
     * Follow a user
     *
     * Creates a follow relationship where the authenticated user follows the target user.
     * Requires authentication.
     *
     * @param followingId - The ID of the user to follow
     * @param options - Optional request options
     * @returns Promise resolving to success response
     * @throws Error if already following or cannot follow yourself
     */
    follow(followingId: number, options?: globalThis.RequestInit): Promise<SuccessResponse>;
    /**
     * Unfollow a user
     *
     * Removes the follow relationship where the authenticated user unfollows the target user.
     * Requires authentication.
     *
     * @param followingId - The ID of the user to unfollow
     * @param options - Optional request options
     * @returns Promise resolving to success response
     * @throws Error if follow relationship not found
     */
    unfollow(followingId: number, options?: globalThis.RequestInit): Promise<SuccessResponse>;
    /**
     * Check follow status
     *
     * Checks if the authenticated user is following the target user and if they follow each other.
     * Requires authentication.
     *
     * @param targetUserId - The ID of the user to check
     * @param options - Optional request options
     * @returns Promise resolving to follow status (isFollowing, isMutual)
     */
    checkFollowStatus(targetUserId: number, options?: globalThis.RequestInit): Promise<CheckFollowResponse>;
    /**
     * Get following list
     *
     * Retrieves the list of users that a user is following.
     * This is a public endpoint - no authentication required.
     *
     * @param userId - The ID of the user whose following list to retrieve
     * @param params - Pagination parameters
     * @param options - Optional request options
     * @returns Promise resolving to list of following users
     */
    getFollowing(userId: number, params?: PaginationQuery, options?: globalThis.RequestInit): Promise<FollowListResponse>;
    /**
     * Get followers list
     *
     * Retrieves the list of users who follow a user.
     * This is a public endpoint - no authentication required.
     *
     * @param userId - The ID of the user whose followers list to retrieve
     * @param params - Pagination parameters
     * @param options - Optional request options
     * @returns Promise resolving to list of followers
     */
    getFollowers(userId: number, params?: PaginationQuery, options?: globalThis.RequestInit): Promise<FollowListResponse>;
}

/**
 * User Favorite Service
 *
 * Provides access to user favorite functionality in the LobeHub Marketplace.
 * This service handles adding/removing favorites and retrieving favorite lists.
 */
declare class UserFavoriteService extends BaseSDK {
    /**
     * Add to favorites
     *
     * Adds an agent or plugin to the authenticated user's favorites.
     * Requires authentication.
     *
     * @param targetType - The type of target ('agent' or 'plugin')
     * @param targetId - The ID of the target agent/plugin
     * @param options - Optional request options
     * @returns Promise resolving to success response
     * @throws Error if already in favorites
     */
    addFavorite(targetType: InteractionTargetType, targetId: string, options?: globalThis.RequestInit): Promise<SuccessResponse>;
    /**
     * Remove from favorites
     *
     * Removes an agent or plugin from the authenticated user's favorites.
     * Requires authentication.
     *
     * @param targetType - The type of target ('agent' or 'plugin')
     * @param targetId - The ID of the target agent/plugin
     * @param options - Optional request options
     * @returns Promise resolving to success response
     * @throws Error if favorite not found
     */
    removeFavorite(targetType: InteractionTargetType, targetId: string, options?: globalThis.RequestInit): Promise<SuccessResponse>;
    /**
     * Check favorite status
     *
     * Checks if the authenticated user has favorited a specific agent or plugin.
     * Requires authentication.
     *
     * @param targetType - The type of target ('agent' or 'plugin')
     * @param targetId - The ID of the target agent/plugin
     * @param options - Optional request options
     * @returns Promise resolving to favorite status
     */
    checkFavorite(targetType: InteractionTargetType, targetId: number, options?: globalThis.RequestInit): Promise<CheckFavoriteResponse>;
    /**
     * Get my favorites
     *
     * Retrieves the authenticated user's favorites.
     * Requires authentication.
     *
     * @param params - Query parameters for filtering and pagination
     * @param options - Optional request options
     * @returns Promise resolving to list of favorites
     */
    getMyFavorites(params?: FavoriteQuery, options?: globalThis.RequestInit): Promise<FavoriteListResponse>;
    /**
     * Get user's favorites
     *
     * Retrieves a user's favorites.
     * This is a public endpoint - no authentication required.
     *
     * @param userId - The ID of the user whose favorites to retrieve
     * @param params - Query parameters for filtering and pagination
     * @param options - Optional request options
     * @returns Promise resolving to list of favorites
     */
    getUserFavorites(userId: number, params?: FavoriteQuery, options?: globalThis.RequestInit): Promise<FavoriteListResponse>;
    /**
     * Get user's favorite agents with details
     *
     * Retrieves a user's favorite agents with full details.
     * This is a public endpoint - no authentication required.
     *
     * @param userId - The ID of the user whose favorite agents to retrieve
     * @param params - Pagination parameters
     * @param options - Optional request options
     * @returns Promise resolving to list of favorite agents
     */
    getUserFavoriteAgents(userId: number, params?: Pick<FavoriteQuery, 'limit' | 'offset'>, options?: globalThis.RequestInit): Promise<FavoriteListResponse>;
    /**
     * Get user's favorite plugins with details
     *
     * Retrieves a user's favorite plugins with full details.
     * This is a public endpoint - no authentication required.
     *
     * @param userId - The ID of the user whose favorite plugins to retrieve
     * @param params - Pagination parameters
     * @param options - Optional request options
     * @returns Promise resolving to list of favorite plugins
     */
    getUserFavoritePlugins(userId: number, params?: Pick<FavoriteQuery, 'limit' | 'offset'>, options?: globalThis.RequestInit): Promise<FavoriteListResponse>;
}

/**
 * User Like Service
 *
 * Provides access to user like functionality in the LobeHub Marketplace.
 * This service handles liking/unliking content and retrieving like lists.
 */
declare class UserLikeService extends BaseSDK {
    /**
     * Like content
     *
     * Likes an agent or plugin for the authenticated user.
     * Requires authentication.
     *
     * @param targetType - The type of target ('agent' or 'plugin')
     * @param targetId - The ID of the target agent/plugin
     * @param options - Optional request options
     * @returns Promise resolving to success response
     * @throws Error if already liked
     */
    like(targetType: InteractionTargetType, targetId: string, options?: globalThis.RequestInit): Promise<SuccessResponse>;
    /**
     * Unlike content
     *
     * Unlikes an agent or plugin for the authenticated user.
     * Requires authentication.
     *
     * @param targetType - The type of target ('agent' or 'plugin')
     * @param targetId - The ID of the target agent/plugin
     * @param options - Optional request options
     * @returns Promise resolving to success response
     * @throws Error if like not found
     */
    unlike(targetType: InteractionTargetType, targetId: string, options?: globalThis.RequestInit): Promise<SuccessResponse>;
    /**
     * Toggle like status
     *
     * Toggles the like status - likes if not liked, unlikes if already liked.
     * Requires authentication.
     *
     * @param targetType - The type of target ('agent' or 'plugin')
     * @param targetId - The ID of the target agent/plugin
     * @param options - Optional request options
     * @returns Promise resolving to toggle response with new like status
     */
    toggleLike(targetType: InteractionTargetType, targetId: string, options?: globalThis.RequestInit): Promise<ToggleLikeResponse>;
    /**
     * Check like status
     *
     * Checks if the authenticated user has liked a specific agent or plugin.
     * Requires authentication.
     *
     * @param targetType - The type of target ('agent' or 'plugin')
     * @param targetId - The ID of the target agent/plugin
     * @param options - Optional request options
     * @returns Promise resolving to like status
     */
    checkLike(targetType: InteractionTargetType, targetId: number, options?: globalThis.RequestInit): Promise<CheckLikeResponse>;
    /**
     * Get my likes
     *
     * Retrieves the authenticated user's likes.
     * Requires authentication.
     *
     * @param params - Query parameters for filtering and pagination
     * @param options - Optional request options
     * @returns Promise resolving to list of likes
     */
    getMyLikes(params?: LikeQuery, options?: globalThis.RequestInit): Promise<LikeListResponse>;
    /**
     * Get user's likes
     *
     * Retrieves a user's likes.
     * This is a public endpoint - no authentication required.
     *
     * @param userId - The ID of the user whose likes to retrieve
     * @param params - Query parameters for filtering and pagination
     * @param options - Optional request options
     * @returns Promise resolving to list of likes
     */
    getUserLikes(userId: number, params?: LikeQuery, options?: globalThis.RequestInit): Promise<LikeListResponse>;
    /**
     * Get user's liked agents with details
     *
     * Retrieves a user's liked agents with full details.
     * This is a public endpoint - no authentication required.
     *
     * @param userId - The ID of the user whose liked agents to retrieve
     * @param params - Pagination parameters
     * @param options - Optional request options
     * @returns Promise resolving to list of liked agents
     */
    getUserLikedAgents(userId: number, params?: Pick<LikeQuery, 'limit' | 'offset'>, options?: globalThis.RequestInit): Promise<LikeListResponse>;
    /**
     * Get user's liked plugins with details
     *
     * Retrieves a user's liked plugins with full details.
     * This is a public endpoint - no authentication required.
     *
     * @param userId - The ID of the user whose liked plugins to retrieve
     * @param params - Pagination parameters
     * @param options - Optional request options
     * @returns Promise resolving to list of liked plugins
     */
    getUserLikedPlugins(userId: number, params?: Pick<LikeQuery, 'limit' | 'offset'>, options?: globalThis.RequestInit): Promise<LikeListResponse>;
}

/**
 * LobeHub Market SDK Client
 *
 * Main client for accessing the LobeHub Marketplace API.
 * This class provides access to marketplace resources like plugins, agents,
 * and service discovery information. It follows a composition pattern
 * by combining specialized domain services.
 */
declare class MarketSDK extends BaseSDK {
    /**
     * Agent profile service for M2M agent identity management
     * Provides methods to view and update the current agent's profile
     */
    readonly agentProfile: AgentProfileService;
    /**
     * Agents service for accessing agent-related functionality
     * Provides methods to list, search, retrieve agent information, and upload agents
     */
    readonly agents: AgentService;
    /**
     * Agent Groups service for accessing agent group-related functionality
     * Provides methods to list, create, version, and manage agent groups
     */
    readonly agentGroups: AgentGroupService;
    /**
     * Auth service for authentication and authorization
     * Provides methods for OIDC user authentication, client registration, and M2M token management
     */
    readonly auth: AuthService;
    /**
     * Connect service for OAuth connection management
     * Provides methods to list providers, initiate OAuth flows, and manage connections
     */
    readonly connect: ConnectService;
    /**
     * Creds service for user credential management
     * Provides methods to create, list, update, delete credentials, and inject into sandboxes
     */
    readonly creds: CredService;
    /**
     * Plugins service for accessing plugin-related functionality
     * Provides methods to list, search, retrieve plugin information, and report installation attempts
     */
    readonly plugins: PluginsService;
    /**
     * User service for accessing user-related functionality
     * Provides methods to retrieve user profiles and their published agents
     */
    readonly user: UserService;
    /**
     * User follow service for follow operations
     * Provides methods to follow/unfollow users and retrieve follow relationships
     */
    readonly follows: UserFollowService;
    /**
     * User favorite service for favorite operations
     * Provides methods to add/remove favorites and retrieve favorite lists
     */
    readonly favorites: UserFavoriteService;
    /**
     * User like service for like operations
     * Provides methods to like/unlike content and retrieve like lists
     */
    readonly likes: UserLikeService;
    /**
     * Feedback service for submitting user feedback
     * Provides methods to submit feedback which is tracked in Linear
     */
    readonly feedback: FeedbackService;
    /**
     * Skill service for skill providers and tool calling
     * Provides methods to list providers, list tools, and call tools on connected OAuth providers
     */
    readonly skills: SkillService;
    /**
     * Market Skill Collection service for curated marketplace skill collections
     * Provides methods to list and retrieve manually curated skill collections
     */
    readonly skillCollections: MarketSkillCollectionService;
    /**
     * Market Skill service for marketplace skill resources
     * Provides methods to list, search, retrieve details, and download skills from the marketplace
     */
    readonly marketSkills: MarketSkillService;
    /**
     * Discovery service for retrieving API service information
     * Used to get information about available endpoints and services
     */
    private readonly discovery;
    /**
     * Creates a new MarketSDK instance
     *
     * @param options - Configuration options for the SDK
     */
    constructor(options?: MarketSDKOptions);
    /**
     * Retrieves the service discovery document
     *
     * The discovery document provides information about available API endpoints,
     * versions, and capabilities of the Market API.
     *
     * @returns Promise resolving to the service discovery document
     */
    getDiscoveryDocument(): Promise<DiscoveryDocument>;
    /**
     * Registers a new client for M2M authentication
     *
     * This method registers a client application with the Market API and returns
     * unique credentials (client_id and client_secret) that can be used for M2M authentication.
     * These credentials should be stored securely and used to initialize the SDK.
     *
     * @param request - Client registration request data
     * @returns Promise resolving to the client registration response with credentials
     * @throws Error if registration fails
     * @deprecated Use auth.registerClient() instead
     */
    registerClient(request: ClientRegistrationRequest): Promise<ClientRegistrationResponse>;
}

declare class MarketAPIError extends Error {
    /** HTTP status code */
    readonly status: number;
    /** Error code from API response */
    readonly code?: string;
    /** The full error response body */
    readonly errorBody?: any;
    constructor(status: number, statusText: string, errorBody?: any);
    /**
     * Check if this is a specific error code
     */
    isErrorCode(code: string): boolean;
    /**
     * Get the full error details from the API response
     */
    getErrorDetails(): any;
    /**
     * Convert to a plain object for logging or serialization
     */
    toJSON(): any;
}

/**
 * SDK Version
 *
 * This version should be kept in sync with package.json version.
 * It is used for User-Agent header to identify SDK requests.
 */
declare const SDK_VERSION = "0.31.3";
/**
 * SDK User-Agent string
 */
declare const SDK_USER_AGENT = "LobeHub-Market-SDK/0.31.3";

/**
 * Trusted Client Token Utilities
 *
 * Provides encryption utilities for creating trusted client tokens
 * that can be used with the Market SDK.
 *
 * @example
 * ```typescript
 * import { createTrustedClientToken, TrustedClientPayload } from '@lobehub/market-sdk';
 *
 * const payload: TrustedClientPayload = {
 *   userId: 'user_xxx',
 *   clientId: 'lobechat-com',
 *   email: 'user@example.com',
 *   timestamp: Date.now(),
 *   nonce: generateNonce(),
 *   name: 'John Doe',
 * };
 *
 * const token = createTrustedClientToken(payload, secret);
 *
 * // Use with MarketSDK
 * const sdk = new MarketSDK({ trustedClientToken: token });
 * ```
 */
/**
 * Trusted client payload structure
 */
interface TrustedClientPayload {
    /** Client identifier (must be in the trusted clients whitelist) */
    clientId: string;
    /** User email address (required) */
    email: string;
    /** Whether the email is verified */
    emailVerified?: boolean;
    /** User display name */
    name?: string;
    /** Random nonce for uniqueness */
    nonce: string;
    /** Unix timestamp in milliseconds when token was created */
    timestamp: number;
    /** Clerk user ID (format: user_xxx) */
    userId: string;
}
/**
 * Encrypt a trusted client payload
 *
 * @param payload - The payload to encrypt
 * @param secret - The shared secret (prefixed format or 64-char hex)
 * @returns Base64-encoded encrypted token
 */
declare function createTrustedClientToken(payload: TrustedClientPayload, secret: string): string;
/**
 * Generate a random nonce for the payload
 *
 * @param length - Length of the nonce (default: 8)
 * @returns Random alphanumeric string
 */
declare function generateNonce(length?: number): string;
/**
 * Create a complete trusted client payload with auto-generated timestamp and nonce
 *
 * @param params - User and client info
 * @returns Complete payload ready for encryption
 */
declare function buildTrustedClientPayload(params: {
    clientId: string;
    email: string;
    emailVerified?: boolean;
    name?: string;
    userId: string;
}): TrustedClientPayload;

export { type AccountMeta, type AdminListQueryParams, type AdminListResponse, type AdminPluginParams, type AgentCreateRequest, type AgentCreateResponse, type AgentDetailQuery, type AgentExtension, type AgentForkItem, type AgentForkRequest, type AgentForkResponse, type AgentForkSourceResponse, type AgentForksResponse, type AgentGroupCreateRequest, type AgentGroupCreateResponse, type AgentGroupDetail, type AgentGroupDetailQuery, type AgentGroupForkItem, type AgentGroupForkRequest, type AgentGroupForkResponse, type AgentGroupForkSourceResponse, type AgentGroupForksResponse, type AgentGroupItem, type AgentGroupListQuery, type AgentGroupListResponse, type AgentGroupModifyRequest, type AgentGroupModifyResponse, type AgentGroupStatus, type AgentGroupStatusChangeResponse, type AgentGroupVersionCreateRequest, type AgentGroupVersionCreateResponse, type AgentInstallCountRequest, type AgentInstallCountResponse, type AgentInterface, type AgentItemDetail, type AgentListQuery, type AgentListResponse, type AgentModifyRequest, type AgentModifyResponse, type AgentProfileEntity, type AgentProfileResponse, type AgentSecurityRequirement, type AgentSecurityScheme, type AgentSkill, type AgentStatus, type AgentStatusChangeResponse, type AgentUploadRequest, type AgentUploadResponse, type AgentUploadVersion, type AgentVersionCreateRequest, type AgentVersionCreateResponse, type AgentVersionLocalization, type AgentVersionModifyRequest, type AgentVersionModifyResponse, type AuthorizationCodeTokenRequest, type AuthorizeParams, type AuthorizeResponse, type CallSkillToolResponse, type CheckFavoriteQuery, type CheckFavoriteResponse, type CheckFollowQuery, type CheckFollowResponse, type CheckLikeQuery, type CheckLikeResponse, type ClientRegistrationError, type ClientRegistrationRequest, type ClientRegistrationResponse, type CodeInterpreterToolName, type CodeInterpreterToolParams, type ConnectProvider, type ConnectProviderDetail, type ConnectProviderScopes, type ConnectionHealth, type ConnectionStats, type CreateFileCredRequest, type CreateKVCredRequest, type CreateMemberAgent, type CreateOAuthCredRequest, type CredWithPlaintext, type DeleteCredResponse, type DiscoveryDocument, type EditLocalFileParams, type ExecuteCodeParams, type ExportFileParams, type FavoriteListResponse, type FavoriteQuery, type FavoriteRequest, type FeedbackClientInfo, type FollowListItem, type FollowListResponse, type FollowRequest, type GetAllConnectionsHealthResponse, type GetAuthorizeUrlParams, type GetCommandOutputParams, type GetConnectProviderResponse, type GetConnectionHealthResponse, type GetConnectionStatsResponse, type GetConnectionStatusResponse, type GetCredOptions, type GetSkillStatusResponse, type GetSkillToolResponse, type GlobLocalFilesParams, type GrepContentParams, type InteractionTargetType, type KillCommandParams, type LikeListResponse, type LikeQuery, type LikeRequest, type ListConnectProvidersResponse, type ListConnectionsResponse, type ListCredsResponse, type ListLocalFilesParams, type ListSkillProvidersResponse, type ListSkillToolsResponse, MarketAPIError, MarketAdmin, type MarketReportGitHubSkillParams, type MarketReportGitHubSkillResponse, type MarketReportSkillInstallParams, type MarketReportSkillInstallResponse, MarketSDK, type MarketSDKOptions, type MarketSkillAuthor, type MarketSkillCategory, type MarketSkillCategoryQuery, type MarketSkillCollectionDetail, type MarketSkillCollectionDetailQuery, type MarketSkillCollectionItemSort, type MarketSkillCollectionListItem, type MarketSkillCollectionListQuery, type MarketSkillCollectionListResponse, type MarketSkillDetail, type MarketSkillDetailQuery, type MarketSkillGitHubMeta, type MarketSkillListItem, type MarketSkillListQuery, type MarketSkillListResponse, type MarketSkillManifest, type MarketSkillResource, type MarketSkillVersionSummary, type MarketSkillVersionsResponse, type MemberAgent, type MoveLocalFilesParams, type MoveOperation, type OAuthConnection, type OAuthTokenResponse, type OwnAgentGroupListQuery, type OwnAgentListQuery, type PaginationQuery, type PluginCommentAuthor, type PluginCommentCreateItem, type PluginCommentCreateResponse, type PluginCommentDeleteResponse, type PluginCommentItem, type PluginCommentListQuery, type PluginCommentListResponse, type PluginCommentRating, type PluginCommentReactionResponse, type PluginI18nImportParams, type PluginI18nImportResponse, type PluginItem, type PluginLatestOwnComment, type PluginListResponse, type PluginLocalization, type PluginQueryParams, type PluginRatingDistribution, type PluginUpdateParams, type PluginVersionCreateParams, type PluginVersionUpdateParams, type ProgrammingLanguage, type ReadLocalFileParams, type RefreshConnectionResponse, type RefreshTokenRequest, type RegisterUserRequest, type RegisterUserResponse, type RegisteredUserProfile, type RenameLocalFileParams, type ReviewStatus, ReviewStatusEnumSchema, type RevokeConnectionResponse, type RunBuildInToolsError, type RunBuildInToolsRequest, type RunBuildInToolsResponse, type RunBuildInToolsSuccessData, type RunCommandParams, SDK_USER_AGENT, SDK_VERSION, type SearchLocalFilesParams, type SharedTokenState, type SkillCallParams, type SkillCommentAuthor, type SkillCommentCreateItem, type SkillCommentCreateResponse, type SkillCommentDeleteResponse, type SkillCommentItem, type SkillCommentListItem, type SkillCommentListQuery, type SkillCommentListResponse, type SkillCommentRating, type SkillErrorResponse, type SkillLatestOwnComment, type SkillProviderInfo, type SkillProviderStatus, type SkillRatingDistribution, type SkillTool, StatusEnumSchema, type SubmitFeedbackRequest, type SubmitFeedbackResponse, type SuccessResponse, type ToggleLikeResponse, type TrustedClientPayload, type UnclaimedPluginItem, type UpdateAgentProfileRequest, type UpdateAgentProfileResponse, type UpdateCredRequest, type UpdateMemberAgent, type UpdateUserInfoRequest, type UpdateUserInfoResponse, type UserAgentGroupItem, type UserAgentItem, type UserInfoQuery, type UserInfoResponse, type UserProfile, VisibilityEnumSchema, type WriteLocalFileParams, buildTrustedClientPayload, createTrustedClientToken, generateNonce };
