@lobehub/market-types 1.2.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +22 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -74,6 +74,11 @@ interface ConnectionConfig {
|
|
|
74
74
|
args?: string[];
|
|
75
75
|
/** Command to execute to start the plugin */
|
|
76
76
|
command?: string;
|
|
77
|
+
/**
|
|
78
|
+
* JSON Schema 配置
|
|
79
|
+
* 插件运行时需要的 configSchema
|
|
80
|
+
*/
|
|
81
|
+
configSchema?: any;
|
|
77
82
|
/** Type of connection (http or stdio) */
|
|
78
83
|
type: ConnectionType;
|
|
79
84
|
/** URL for HTTP-based plugins */
|
|
@@ -193,6 +198,20 @@ interface PluginCompatibility {
|
|
|
193
198
|
/** List of supported platforms (e.g., 'web', 'desktop', 'mobile') */
|
|
194
199
|
platforms?: string[];
|
|
195
200
|
}
|
|
201
|
+
/**
|
|
202
|
+
* Simplified plugin version information.
|
|
203
|
+
* Contains minimal version data for plugin version lists.
|
|
204
|
+
*/
|
|
205
|
+
interface PluginVersionSummary {
|
|
206
|
+
/** Creation timestamp (ISO 8601 format) */
|
|
207
|
+
createdAt: string;
|
|
208
|
+
/** Whether this is the latest version of the plugin */
|
|
209
|
+
isLatest: boolean;
|
|
210
|
+
/** Whether this version has been validated by the system */
|
|
211
|
+
isValidated: boolean;
|
|
212
|
+
/** Semantic version string (e.g., "1.0.0") */
|
|
213
|
+
version: string;
|
|
214
|
+
}
|
|
196
215
|
/**
|
|
197
216
|
* Base plugin item schema with Zod validation.
|
|
198
217
|
* Defines the structure and validation rules for plugin items in the marketplace.
|
|
@@ -372,7 +391,8 @@ interface PluginItemDetail extends Omit<MarketPluginItem, 'author' | 'manifestUr
|
|
|
372
391
|
validatedAt?: string;
|
|
373
392
|
/** Semantic version string (e.g., "1.0.0") */
|
|
374
393
|
version: string;
|
|
375
|
-
versions
|
|
394
|
+
/** List of all versions of this plugin with simplified information */
|
|
395
|
+
versions: PluginVersionSummary[];
|
|
376
396
|
}
|
|
377
397
|
/**
|
|
378
398
|
* Plugin manifest definition.
|
|
@@ -399,7 +419,6 @@ interface PluginManifest extends Omit<MarketPluginItem, 'author' | 'manifestUrl'
|
|
|
399
419
|
validatedAt?: string;
|
|
400
420
|
/** Semantic version string (e.g., "1.0.0") */
|
|
401
421
|
version: string;
|
|
402
|
-
versions: string[];
|
|
403
422
|
}
|
|
404
423
|
|
|
405
424
|
/**
|
|
@@ -575,4 +594,4 @@ interface AdminSystemDependency extends SystemDependency {
|
|
|
575
594
|
id: number;
|
|
576
595
|
}
|
|
577
596
|
|
|
578
|
-
export { type AdminDeploymentOption, type AdminPluginItem, type AdminPluginItemDetail, AdminPluginItemSchema, type AdminSystemDependency, type BasePluginItem, BasePluginItemSchema, type ConnectionConfig, type ConnectionType, ConnectionTypeEnum, type DeploymentOption, type InstallationDetails, type InstallationMethod, InstallationMethodEnum, type MarketItemBase, type MarketPluginItem, PluginCapabilitiesSchema, type PluginCompatibility, type PluginItemDetail, type PluginManifest, type PluginPrompt, type PluginResource, type PluginTool, type PluginVersion, type PromptArgument, type SystemDependency };
|
|
597
|
+
export { type AdminDeploymentOption, type AdminPluginItem, type AdminPluginItemDetail, AdminPluginItemSchema, type AdminSystemDependency, type BasePluginItem, BasePluginItemSchema, type ConnectionConfig, type ConnectionType, ConnectionTypeEnum, type DeploymentOption, type InstallationDetails, type InstallationMethod, InstallationMethodEnum, type MarketItemBase, type MarketPluginItem, PluginCapabilitiesSchema, type PluginCompatibility, type PluginItemDetail, type PluginManifest, type PluginPrompt, type PluginResource, type PluginTool, type PluginVersion, type PluginVersionSummary, type PromptArgument, type SystemDependency };
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/plugin/admin.ts","../src/plugin/plugin.ts","../src/plugin/capabilities.ts","../src/plugin/deploymentOption.ts"],"sourcesContent":["// Admin plugin item schema definitions\nimport { z } from 'zod';\n\nimport { DeploymentOption, SystemDependency } from './deploymentOption';\nimport { BasePluginItemSchema, MarketPluginItem, PluginManifest } from './plugin';\n\n/**\n * Schema for admin-managed plugin items with additional status and visibility fields.\n * Extends the base plugin schema with administrative properties.\n */\nexport const AdminPluginItemSchema = BasePluginItemSchema.extend({\n /** Publication status of the plugin */\n status: z.enum(['published', 'unpublished', 'archived', 'deprecated'] as const),\n /** Visibility level of the plugin */\n visibility: z.enum(['public', 'private', 'internal'] as const),\n});\n\n/**\n * Interface for admin-managed plugin items.\n * Extends the market plugin item with administrative properties.\n */\nexport interface AdminPluginItem extends MarketPluginItem {\n /** Unique numeric identifier for the plugin in the database */\n id: number;\n /** User ID of the plugin owner */\n ownerId: number;\n /** Publication status of the plugin */\n status: 'published' | 'unpublished' | 'archived';\n /** Visibility level controlling who can access the plugin */\n visibility: 'public' | 'private' | 'internal';\n}\n\n/**\n * Plugin version database model.\n * Represents a specific version of a plugin in the database.\n */\nexport interface PluginVersion {\n /** Creation timestamp (ISO 8601 format) */\n createdAt: string;\n /** Unique numeric identifier for the version */\n id: number;\n /** Whether this is the latest version of the plugin */\n isLatest: boolean;\n /** Whether this version has been validated by the system */\n isValidated: boolean;\n /** The full manifest data for this version */\n manifest: PluginManifest;\n /** URL to the manifest file, or null if stored directly */\n manifestUrl: string | null;\n /** Additional metadata for this version */\n meta: Record<string, any> | null;\n /** ID of the parent plugin */\n pluginId: number;\n /** Number of prompts provided by this version */\n promptsCount: number;\n /** Number of resources provided by this version */\n resourcesCount: number;\n /** Number of tools provided by this version */\n toolsCount: number;\n /** Last update timestamp (ISO 8601 format) */\n updatedAt: string;\n /** Semantic version string (e.g., \"1.0.0\") */\n version: string;\n}\n\n/**\n * Detailed admin plugin item with version history.\n * Used for displaying complete plugin information in the admin interface.\n */\nexport interface AdminPluginItemDetail extends Omit<AdminPluginItem, 'manifestUrl'> {\n /** Full manifest data for the current version */\n manifest: PluginManifest;\n /** List of all versions of this plugin */\n versions: PluginVersion[];\n}\n\n/**\n * Admin deployment option with database ID.\n * Extends the basic deployment option with a database identifier.\n */\nexport interface AdminDeploymentOption extends DeploymentOption {\n /** Unique numeric identifier for the deployment option */\n id: number;\n}\n\n/**\n * Admin system dependency with database ID.\n * Extends the basic system dependency with a database identifier.\n */\nexport interface AdminSystemDependency extends SystemDependency {\n /** Unique numeric identifier for the system dependency */\n id: number;\n}\n","import { z } from 'zod';\n\nimport { MarketItemBase } from '../market';\nimport { PluginCapabilitiesSchema, PluginPrompt, PluginResource, PluginTool } from './capabilities';\nimport { DeploymentOption } from './deploymentOption';\n\n/**\n * Plugin compatibility information.\n * Defines the compatibility requirements for a plugin with respect to app versions and platforms.\n */\nexport interface PluginCompatibility {\n /** Maximum app version the plugin is compatible with */\n maxAppVersion?: string;\n /** Minimum app version required to use the plugin */\n minAppVersion?: string;\n /** List of supported platforms (e.g., 'web', 'desktop', 'mobile') */\n platforms?: string[];\n}\n\n/**\n * Base plugin item schema with Zod validation.\n * Defines the structure and validation rules for plugin items in the marketplace.\n */\nexport const BasePluginItemSchema = z.object({\n author: z.string().optional(),\n capabilities: PluginCapabilitiesSchema,\n category: z.string().optional(),\n commentCount: z.number().default(0),\n createdAt: z.string(),\n description: z.string(),\n homepage: z.string().optional(),\n icon: z.string().optional(),\n identifier: z.string(),\n installCount: z.number().default(0),\n isFeatured: z.boolean().default(false),\n isValidated: z.boolean().default(false),\n manifestUrl: z.string(),\n name: z.string(),\n promptsCount: z.number().optional(),\n ratingAverage: z.number().optional(),\n ratingCount: z.number().default(0),\n resourcesCount: z.number().optional(),\n tags: z.array(z.string()).optional(),\n toolsCount: z.number().optional(),\n updatedAt: z.string(),\n});\n\n/**\n * Plugin marketplace item definition.\n * Extends the base marketplace item with plugin-specific properties.\n * This interface represents a plugin as it appears in the marketplace listing.\n */\nexport interface MarketPluginItem extends MarketItemBase {\n /** Capabilities provided by this plugin */\n capabilities?: {\n /** Whether the plugin provides custom prompts */\n prompts: boolean;\n /** Whether the plugin provides resources (assets) */\n resources: boolean;\n /** Whether the plugin provides tools (functions) */\n tools: boolean;\n };\n /** Number of comments on this plugin */\n commentCount?: number;\n /** Number of times this plugin has been installed */\n installCount?: number;\n /** Whether this plugin is featured in the marketplace */\n isFeatured?: boolean;\n /** Whether this plugin has been validated by the system */\n isValidated?: boolean;\n /** Number of prompts provided by this plugin */\n promptsCount?: number;\n /** Average rating (typically 1-5 scale) */\n ratingAverage?: number;\n /** Number of ratings received */\n ratingCount?: number;\n /** Number of resources provided by this plugin */\n resourcesCount?: number;\n /** Number of tools provided by this plugin */\n toolsCount?: number;\n}\n\n/** Type alias for the base plugin item validated by Zod schema */\nexport type BasePluginItem = z.infer<typeof BasePluginItemSchema>;\n\n/**\n * Plugin manifest definition.\n * This is the complete specification of a plugin, including all its capabilities,\n * metadata, and deployment options.\n */\nexport interface PluginItemDetail extends Omit<MarketPluginItem, 'author' | 'manifestUrl'> {\n // 构建产物信息\n artifacts?: {\n docker?: {\n imageName?: string;\n tag?: string;\n };\n npm?: {\n packageName?: string;\n version?: string;\n };\n pypi?: {\n packageName?: string;\n version?: string;\n };\n };\n /** Author information */\n author?: {\n /** Author or organization name */\n name: string;\n /** URL to the author's website or profile */\n url?: string;\n };\n /** Available deployment options */\n deploymentOptions?: DeploymentOption[];\n /**\n * GitHub\n */\n github?: {\n language?: string;\n license?: string;\n stars?: number;\n url: string;\n };\n overview: {\n readme: string;\n summary?: string;\n };\n /** List of prompt templates provided by this plugin */\n prompts?: PluginPrompt[];\n /** List of resources provided by this plugin */\n resources?: PluginResource[];\n /** List of tools provided by this plugin */\n tools?: PluginTool[];\n\n /** Date when the plugin was created in the marketplace (ISO 8601 format) */\n validatedAt?: string;\n /** Semantic version string (e.g., \"1.0.0\") */\n version: string;\n versions: string[];\n}\n\n/**\n * Plugin manifest definition.\n * This is the complete specification of a plugin, including all its capabilities,\n * metadata, and deployment options.\n */\nexport interface PluginManifest extends Omit<MarketPluginItem, 'author' | 'manifestUrl'> {\n /** Author information */\n author?: {\n /** Author or organization name */\n name: string;\n /** URL to the author's website or profile */\n url?: string;\n };\n /** Available deployment options */\n deploymentOptions?: DeploymentOption[];\n /** List of prompt templates provided by this plugin */\n prompts?: PluginPrompt[];\n /** List of resources provided by this plugin */\n resources?: PluginResource[];\n /** List of tools provided by this plugin */\n tools?: PluginTool[];\n /** Date when the plugin was created in the marketplace (ISO 8601 format) */\n validatedAt?: string;\n /** Semantic version string (e.g., \"1.0.0\") */\n version: string;\n versions: string[];\n}\n","// Plugin capability definitions\nimport { z } from 'zod';\n\n/**\n * Schema defining the capabilities a plugin can provide.\n * Each capability is represented as a boolean flag.\n */\nexport const PluginCapabilitiesSchema = z.object({\n /** Whether the plugin provides custom prompts */\n prompts: z.boolean().default(false),\n /** Whether the plugin provides resources (assets) */\n resources: z.boolean().default(false),\n /** Whether the plugin provides tools (functions) */\n tools: z.boolean().default(false),\n});\n\n/**\n * Definition of a tool that a plugin can provide.\n * Tools are functions that can be called by the chat application.\n */\nexport interface PluginTool {\n /** Human-readable description of what the tool does */\n description?: string;\n /** JSON schema defining the expected input parameters */\n inputSchema?: Record<string, any>;\n /** Unique identifier for the tool within the plugin */\n name: string;\n}\n\n/**\n * Definition of a resource (asset) that a plugin can provide.\n * Resources can be images, data files, or other assets needed by the plugin.\n */\nexport interface PluginResource {\n /** MIME type of the resource (e.g., 'image/png', 'application/json') */\n mimeType?: string;\n /** Optional display name for the resource */\n name?: string;\n /** URI where the resource can be accessed */\n uri: string;\n}\n\n/**\n * Definition of an argument for a prompt template.\n * Arguments allow users to customize the prompt when using it.\n */\nexport interface PromptArgument {\n /** Human-readable description of the argument's purpose */\n description?: string;\n /** Argument identifier */\n name: string;\n /** Whether the argument must be provided (defaults to false if omitted) */\n required?: boolean;\n /** Data type of the argument (e.g., 'string', 'number') */\n type?: string;\n}\n\n/**\n * Definition of a prompt template that a plugin can provide.\n * Prompts are pre-defined templates that can be used in conversations.\n */\nexport interface PluginPrompt {\n /** List of customizable arguments for this prompt */\n arguments?: PromptArgument[];\n /** Human-readable description of what the prompt does */\n description: string;\n /** Unique identifier for the prompt within the plugin */\n name: string;\n}\n","import { z } from 'zod';\n\n/**\n * Connection types for plugin communication.\n * - http: The plugin communicates via HTTP protocol\n * - stdio: The plugin communicates via standard input/output\n */\nexport const ConnectionTypeEnum = z.enum(['http', 'stdio']);\nexport type ConnectionType = z.infer<typeof ConnectionTypeEnum>;\n\n/**\n * Plugin installation methods.\n * Different ways to install and deploy a plugin.\n */\nexport const InstallationMethodEnum = z.enum([\n 'npm', // Node.js package manager\n 'go', // Go language\n 'python', // Python language\n 'docker', // Docker container\n 'git', // Git repository\n 'binaryUrl', // Direct binary download URL\n 'manual', // Manual installation with instructions\n 'none', // No installation required\n]);\nexport type InstallationMethod = z.infer<typeof InstallationMethodEnum>;\n\n/**\n * System dependency required by a plugin.\n * Defines a software dependency that must be installed on the system.\n */\nexport interface SystemDependency {\n /** Command to check if the dependency is installed */\n checkCommand?: string;\n /** Description of what this dependency is for */\n description?: string;\n /** Platform-specific installation instructions */\n installInstructions?: Record<string, string>;\n /** Name of the dependency */\n name: string;\n /** Minimum required version */\n requiredVersion?: string;\n /** Type of dependency (e.g., 'runtime', 'library') */\n type?: string;\n /** Whether version parsing is required to check compatibility */\n versionParsingRequired?: boolean;\n}\n\n/**\n * Connection configuration for a plugin.\n * Defines how the application should communicate with the plugin.\n */\nexport interface ConnectionConfig {\n /** Command-line arguments for the plugin process */\n args?: string[];\n /** Command to execute to start the plugin */\n command?: string;\n /** Type of connection (http or stdio) */\n type: ConnectionType;\n /** URL for HTTP-based plugins */\n url?: string;\n}\n\n/**\n * Details for installing a plugin.\n * Provides specific information needed during the installation process.\n */\nexport interface InstallationDetails {\n /** Package name for npm, pip, or other package managers */\n packageName?: string;\n /** Git repository URL to clone */\n repositoryUrlToClone?: string;\n /** Ordered list of setup steps to execute after installation */\n setupSteps?: string[];\n}\n\n/**\n * Deployment option for a plugin.\n * A plugin can offer multiple deployment options, each with different requirements.\n */\nexport interface DeploymentOption {\n /** Connection configuration for this deployment option */\n connection: ConnectionConfig;\n /** Human-readable description of this deployment option */\n description?: string;\n /** Detailed installation instructions */\n installationDetails?: InstallationDetails;\n /** Method used to install this plugin */\n installationMethod: string;\n /** Whether this is the recommended deployment option */\n isRecommended?: boolean;\n /** System dependencies required for this deployment option */\n systemDependencies?: SystemDependency[];\n}\n"],"mappings":";AACA,SAAS,KAAAA,UAAS;;;ACDlB,SAAS,KAAAC,UAAS;;;ACClB,SAAS,SAAS;AAMX,IAAM,2BAA2B,EAAE,OAAO;AAAA;AAAA,EAE/C,SAAS,EAAE,QAAQ,EAAE,QAAQ,KAAK;AAAA;AAAA,EAElC,WAAW,EAAE,QAAQ,EAAE,QAAQ,KAAK;AAAA;AAAA,EAEpC,OAAO,EAAE,QAAQ,EAAE,QAAQ,KAAK;AAClC,CAAC;;;ADSM,IAAM,uBAAuBC,GAAE,OAAO;AAAA,EAC3C,QAAQA,GAAE,OAAO,EAAE,SAAS;AAAA,EAC5B,cAAc;AAAA,EACd,UAAUA,GAAE,OAAO,EAAE,SAAS;AAAA,EAC9B,cAAcA,GAAE,OAAO,EAAE,QAAQ,CAAC;AAAA,EAClC,WAAWA,GAAE,OAAO;AAAA,EACpB,aAAaA,GAAE,OAAO;AAAA,EACtB,UAAUA,GAAE,OAAO,EAAE,SAAS;AAAA,EAC9B,MAAMA,GAAE,OAAO,EAAE,SAAS;AAAA,EAC1B,YAAYA,GAAE,OAAO;AAAA,EACrB,cAAcA,GAAE,OAAO,EAAE,QAAQ,CAAC;AAAA,EAClC,YAAYA,GAAE,QAAQ,EAAE,QAAQ,KAAK;AAAA,EACrC,aAAaA,GAAE,QAAQ,EAAE,QAAQ,KAAK;AAAA,EACtC,aAAaA,GAAE,OAAO;AAAA,EACtB,MAAMA,GAAE,OAAO;AAAA,EACf,cAAcA,GAAE,OAAO,EAAE,SAAS;AAAA,EAClC,eAAeA,GAAE,OAAO,EAAE,SAAS;AAAA,EACnC,aAAaA,GAAE,OAAO,EAAE,QAAQ,CAAC;AAAA,EACjC,gBAAgBA,GAAE,OAAO,EAAE,SAAS;AAAA,EACpC,MAAMA,GAAE,MAAMA,GAAE,OAAO,CAAC,EAAE,SAAS;AAAA,EACnC,YAAYA,GAAE,OAAO,EAAE,SAAS;AAAA,EAChC,WAAWA,GAAE,OAAO;AACtB,CAAC;;;ADnCM,IAAM,wBAAwB,qBAAqB,OAAO;AAAA;AAAA,EAE/D,QAAQC,GAAE,KAAK,CAAC,aAAa,eAAe,YAAY,YAAY,CAAU;AAAA;AAAA,EAE9E,YAAYA,GAAE,KAAK,CAAC,UAAU,WAAW,UAAU,CAAU;AAC/D,CAAC;;;AGfD,SAAS,KAAAC,UAAS;AAOX,IAAM,qBAAqBA,GAAE,KAAK,CAAC,QAAQ,OAAO,CAAC;AAOnD,IAAM,yBAAyBA,GAAE,KAAK;AAAA,EAC3C;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AACF,CAAC;","names":["z","z","z","z","z"]}
|
|
1
|
+
{"version":3,"sources":["../src/plugin/admin.ts","../src/plugin/plugin.ts","../src/plugin/capabilities.ts","../src/plugin/deploymentOption.ts"],"sourcesContent":["// Admin plugin item schema definitions\nimport { z } from 'zod';\n\nimport { DeploymentOption, SystemDependency } from './deploymentOption';\nimport { BasePluginItemSchema, MarketPluginItem, PluginManifest } from './plugin';\n\n/**\n * Schema for admin-managed plugin items with additional status and visibility fields.\n * Extends the base plugin schema with administrative properties.\n */\nexport const AdminPluginItemSchema = BasePluginItemSchema.extend({\n /** Publication status of the plugin */\n status: z.enum(['published', 'unpublished', 'archived', 'deprecated'] as const),\n /** Visibility level of the plugin */\n visibility: z.enum(['public', 'private', 'internal'] as const),\n});\n\n/**\n * Interface for admin-managed plugin items.\n * Extends the market plugin item with administrative properties.\n */\nexport interface AdminPluginItem extends MarketPluginItem {\n /** Unique numeric identifier for the plugin in the database */\n id: number;\n /** User ID of the plugin owner */\n ownerId: number;\n /** Publication status of the plugin */\n status: 'published' | 'unpublished' | 'archived';\n /** Visibility level controlling who can access the plugin */\n visibility: 'public' | 'private' | 'internal';\n}\n\n/**\n * Plugin version database model.\n * Represents a specific version of a plugin in the database.\n */\nexport interface PluginVersion {\n /** Creation timestamp (ISO 8601 format) */\n createdAt: string;\n /** Unique numeric identifier for the version */\n id: number;\n /** Whether this is the latest version of the plugin */\n isLatest: boolean;\n /** Whether this version has been validated by the system */\n isValidated: boolean;\n /** The full manifest data for this version */\n manifest: PluginManifest;\n /** URL to the manifest file, or null if stored directly */\n manifestUrl: string | null;\n /** Additional metadata for this version */\n meta: Record<string, any> | null;\n /** ID of the parent plugin */\n pluginId: number;\n /** Number of prompts provided by this version */\n promptsCount: number;\n /** Number of resources provided by this version */\n resourcesCount: number;\n /** Number of tools provided by this version */\n toolsCount: number;\n /** Last update timestamp (ISO 8601 format) */\n updatedAt: string;\n /** Semantic version string (e.g., \"1.0.0\") */\n version: string;\n}\n\n/**\n * Detailed admin plugin item with version history.\n * Used for displaying complete plugin information in the admin interface.\n */\nexport interface AdminPluginItemDetail extends Omit<AdminPluginItem, 'manifestUrl'> {\n /** Full manifest data for the current version */\n manifest: PluginManifest;\n /** List of all versions of this plugin */\n versions: PluginVersion[];\n}\n\n/**\n * Admin deployment option with database ID.\n * Extends the basic deployment option with a database identifier.\n */\nexport interface AdminDeploymentOption extends DeploymentOption {\n /** Unique numeric identifier for the deployment option */\n id: number;\n}\n\n/**\n * Admin system dependency with database ID.\n * Extends the basic system dependency with a database identifier.\n */\nexport interface AdminSystemDependency extends SystemDependency {\n /** Unique numeric identifier for the system dependency */\n id: number;\n}\n","import { z } from 'zod';\n\nimport { MarketItemBase } from '../market';\nimport { PluginCapabilitiesSchema, PluginPrompt, PluginResource, PluginTool } from './capabilities';\nimport { DeploymentOption } from './deploymentOption';\n\n/**\n * Plugin compatibility information.\n * Defines the compatibility requirements for a plugin with respect to app versions and platforms.\n */\nexport interface PluginCompatibility {\n /** Maximum app version the plugin is compatible with */\n maxAppVersion?: string;\n /** Minimum app version required to use the plugin */\n minAppVersion?: string;\n /** List of supported platforms (e.g., 'web', 'desktop', 'mobile') */\n platforms?: string[];\n}\n\n/**\n * Simplified plugin version information.\n * Contains minimal version data for plugin version lists.\n */\nexport interface PluginVersionSummary {\n /** Creation timestamp (ISO 8601 format) */\n createdAt: string;\n /** Whether this is the latest version of the plugin */\n isLatest: boolean;\n /** Whether this version has been validated by the system */\n isValidated: boolean;\n /** Semantic version string (e.g., \"1.0.0\") */\n version: string;\n}\n\n/**\n * Base plugin item schema with Zod validation.\n * Defines the structure and validation rules for plugin items in the marketplace.\n */\nexport const BasePluginItemSchema = z.object({\n author: z.string().optional(),\n capabilities: PluginCapabilitiesSchema,\n category: z.string().optional(),\n commentCount: z.number().default(0),\n createdAt: z.string(),\n description: z.string(),\n homepage: z.string().optional(),\n icon: z.string().optional(),\n identifier: z.string(),\n installCount: z.number().default(0),\n isFeatured: z.boolean().default(false),\n isValidated: z.boolean().default(false),\n manifestUrl: z.string(),\n name: z.string(),\n promptsCount: z.number().optional(),\n ratingAverage: z.number().optional(),\n ratingCount: z.number().default(0),\n resourcesCount: z.number().optional(),\n tags: z.array(z.string()).optional(),\n toolsCount: z.number().optional(),\n updatedAt: z.string(),\n});\n\n/**\n * Plugin marketplace item definition.\n * Extends the base marketplace item with plugin-specific properties.\n * This interface represents a plugin as it appears in the marketplace listing.\n */\nexport interface MarketPluginItem extends MarketItemBase {\n /** Capabilities provided by this plugin */\n capabilities?: {\n /** Whether the plugin provides custom prompts */\n prompts: boolean;\n /** Whether the plugin provides resources (assets) */\n resources: boolean;\n /** Whether the plugin provides tools (functions) */\n tools: boolean;\n };\n /** Number of comments on this plugin */\n commentCount?: number;\n /** Number of times this plugin has been installed */\n installCount?: number;\n /** Whether this plugin is featured in the marketplace */\n isFeatured?: boolean;\n /** Whether this plugin has been validated by the system */\n isValidated?: boolean;\n /** Number of prompts provided by this plugin */\n promptsCount?: number;\n /** Average rating (typically 1-5 scale) */\n ratingAverage?: number;\n /** Number of ratings received */\n ratingCount?: number;\n /** Number of resources provided by this plugin */\n resourcesCount?: number;\n /** Number of tools provided by this plugin */\n toolsCount?: number;\n}\n\n/** Type alias for the base plugin item validated by Zod schema */\nexport type BasePluginItem = z.infer<typeof BasePluginItemSchema>;\n\n/**\n * Plugin manifest definition.\n * This is the complete specification of a plugin, including all its capabilities,\n * metadata, and deployment options.\n */\nexport interface PluginItemDetail extends Omit<MarketPluginItem, 'author' | 'manifestUrl'> {\n // 构建产物信息\n artifacts?: {\n docker?: {\n imageName?: string;\n tag?: string;\n };\n npm?: {\n packageName?: string;\n version?: string;\n };\n pypi?: {\n packageName?: string;\n version?: string;\n };\n };\n /** Author information */\n author?: {\n /** Author or organization name */\n name: string;\n /** URL to the author's website or profile */\n url?: string;\n };\n /** Available deployment options */\n deploymentOptions?: DeploymentOption[];\n /**\n * GitHub\n */\n github?: {\n language?: string;\n license?: string;\n stars?: number;\n url: string;\n };\n overview: {\n readme: string;\n summary?: string;\n };\n /** List of prompt templates provided by this plugin */\n prompts?: PluginPrompt[];\n /** List of resources provided by this plugin */\n resources?: PluginResource[];\n /** List of tools provided by this plugin */\n tools?: PluginTool[];\n\n /** Date when the plugin was created in the marketplace (ISO 8601 format) */\n validatedAt?: string;\n /** Semantic version string (e.g., \"1.0.0\") */\n version: string;\n /** List of all versions of this plugin with simplified information */\n versions: PluginVersionSummary[];\n}\n\n/**\n * Plugin manifest definition.\n * This is the complete specification of a plugin, including all its capabilities,\n * metadata, and deployment options.\n */\nexport interface PluginManifest extends Omit<MarketPluginItem, 'author' | 'manifestUrl'> {\n /** Author information */\n author?: {\n /** Author or organization name */\n name: string;\n /** URL to the author's website or profile */\n url?: string;\n };\n /** Available deployment options */\n deploymentOptions?: DeploymentOption[];\n /** List of prompt templates provided by this plugin */\n prompts?: PluginPrompt[];\n /** List of resources provided by this plugin */\n resources?: PluginResource[];\n /** List of tools provided by this plugin */\n tools?: PluginTool[];\n /** Date when the plugin was created in the marketplace (ISO 8601 format) */\n validatedAt?: string;\n /** Semantic version string (e.g., \"1.0.0\") */\n version: string;\n}\n","// Plugin capability definitions\nimport { z } from 'zod';\n\n/**\n * Schema defining the capabilities a plugin can provide.\n * Each capability is represented as a boolean flag.\n */\nexport const PluginCapabilitiesSchema = z.object({\n /** Whether the plugin provides custom prompts */\n prompts: z.boolean().default(false),\n /** Whether the plugin provides resources (assets) */\n resources: z.boolean().default(false),\n /** Whether the plugin provides tools (functions) */\n tools: z.boolean().default(false),\n});\n\n/**\n * Definition of a tool that a plugin can provide.\n * Tools are functions that can be called by the chat application.\n */\nexport interface PluginTool {\n /** Human-readable description of what the tool does */\n description?: string;\n /** JSON schema defining the expected input parameters */\n inputSchema?: Record<string, any>;\n /** Unique identifier for the tool within the plugin */\n name: string;\n}\n\n/**\n * Definition of a resource (asset) that a plugin can provide.\n * Resources can be images, data files, or other assets needed by the plugin.\n */\nexport interface PluginResource {\n /** MIME type of the resource (e.g., 'image/png', 'application/json') */\n mimeType?: string;\n /** Optional display name for the resource */\n name?: string;\n /** URI where the resource can be accessed */\n uri: string;\n}\n\n/**\n * Definition of an argument for a prompt template.\n * Arguments allow users to customize the prompt when using it.\n */\nexport interface PromptArgument {\n /** Human-readable description of the argument's purpose */\n description?: string;\n /** Argument identifier */\n name: string;\n /** Whether the argument must be provided (defaults to false if omitted) */\n required?: boolean;\n /** Data type of the argument (e.g., 'string', 'number') */\n type?: string;\n}\n\n/**\n * Definition of a prompt template that a plugin can provide.\n * Prompts are pre-defined templates that can be used in conversations.\n */\nexport interface PluginPrompt {\n /** List of customizable arguments for this prompt */\n arguments?: PromptArgument[];\n /** Human-readable description of what the prompt does */\n description: string;\n /** Unique identifier for the prompt within the plugin */\n name: string;\n}\n","import { z } from 'zod';\n\n/**\n * Connection types for plugin communication.\n * - http: The plugin communicates via HTTP protocol\n * - stdio: The plugin communicates via standard input/output\n */\nexport const ConnectionTypeEnum = z.enum(['http', 'stdio']);\nexport type ConnectionType = z.infer<typeof ConnectionTypeEnum>;\n\n/**\n * Plugin installation methods.\n * Different ways to install and deploy a plugin.\n */\nexport const InstallationMethodEnum = z.enum([\n 'npm', // Node.js package manager\n 'go', // Go language\n 'python', // Python language\n 'docker', // Docker container\n 'git', // Git repository\n 'binaryUrl', // Direct binary download URL\n 'manual', // Manual installation with instructions\n 'none', // No installation required\n]);\nexport type InstallationMethod = z.infer<typeof InstallationMethodEnum>;\n\n/**\n * System dependency required by a plugin.\n * Defines a software dependency that must be installed on the system.\n */\nexport interface SystemDependency {\n /** Command to check if the dependency is installed */\n checkCommand?: string;\n /** Description of what this dependency is for */\n description?: string;\n /** Platform-specific installation instructions */\n installInstructions?: Record<string, string>;\n /** Name of the dependency */\n name: string;\n /** Minimum required version */\n requiredVersion?: string;\n /** Type of dependency (e.g., 'runtime', 'library') */\n type?: string;\n /** Whether version parsing is required to check compatibility */\n versionParsingRequired?: boolean;\n}\n\n/**\n * Connection configuration for a plugin.\n * Defines how the application should communicate with the plugin.\n */\nexport interface ConnectionConfig {\n /** Command-line arguments for the plugin process */\n args?: string[];\n /** Command to execute to start the plugin */\n command?: string;\n /**\n * JSON Schema 配置\n * 插件运行时需要的 configSchema\n */\n configSchema?: any;\n /** Type of connection (http or stdio) */\n type: ConnectionType;\n /** URL for HTTP-based plugins */\n url?: string;\n}\n\n/**\n * Details for installing a plugin.\n * Provides specific information needed during the installation process.\n */\nexport interface InstallationDetails {\n /** Package name for npm, pip, or other package managers */\n packageName?: string;\n /** Git repository URL to clone */\n repositoryUrlToClone?: string;\n /** Ordered list of setup steps to execute after installation */\n setupSteps?: string[];\n}\n\n/**\n * Deployment option for a plugin.\n * A plugin can offer multiple deployment options, each with different requirements.\n */\nexport interface DeploymentOption {\n /** Connection configuration for this deployment option */\n connection: ConnectionConfig;\n /** Human-readable description of this deployment option */\n description?: string;\n /** Detailed installation instructions */\n installationDetails?: InstallationDetails;\n /** Method used to install this plugin */\n installationMethod: string;\n /** Whether this is the recommended deployment option */\n isRecommended?: boolean;\n /** System dependencies required for this deployment option */\n systemDependencies?: SystemDependency[];\n}\n"],"mappings":";AACA,SAAS,KAAAA,UAAS;;;ACDlB,SAAS,KAAAC,UAAS;;;ACClB,SAAS,SAAS;AAMX,IAAM,2BAA2B,EAAE,OAAO;AAAA;AAAA,EAE/C,SAAS,EAAE,QAAQ,EAAE,QAAQ,KAAK;AAAA;AAAA,EAElC,WAAW,EAAE,QAAQ,EAAE,QAAQ,KAAK;AAAA;AAAA,EAEpC,OAAO,EAAE,QAAQ,EAAE,QAAQ,KAAK;AAClC,CAAC;;;ADwBM,IAAM,uBAAuBC,GAAE,OAAO;AAAA,EAC3C,QAAQA,GAAE,OAAO,EAAE,SAAS;AAAA,EAC5B,cAAc;AAAA,EACd,UAAUA,GAAE,OAAO,EAAE,SAAS;AAAA,EAC9B,cAAcA,GAAE,OAAO,EAAE,QAAQ,CAAC;AAAA,EAClC,WAAWA,GAAE,OAAO;AAAA,EACpB,aAAaA,GAAE,OAAO;AAAA,EACtB,UAAUA,GAAE,OAAO,EAAE,SAAS;AAAA,EAC9B,MAAMA,GAAE,OAAO,EAAE,SAAS;AAAA,EAC1B,YAAYA,GAAE,OAAO;AAAA,EACrB,cAAcA,GAAE,OAAO,EAAE,QAAQ,CAAC;AAAA,EAClC,YAAYA,GAAE,QAAQ,EAAE,QAAQ,KAAK;AAAA,EACrC,aAAaA,GAAE,QAAQ,EAAE,QAAQ,KAAK;AAAA,EACtC,aAAaA,GAAE,OAAO;AAAA,EACtB,MAAMA,GAAE,OAAO;AAAA,EACf,cAAcA,GAAE,OAAO,EAAE,SAAS;AAAA,EAClC,eAAeA,GAAE,OAAO,EAAE,SAAS;AAAA,EACnC,aAAaA,GAAE,OAAO,EAAE,QAAQ,CAAC;AAAA,EACjC,gBAAgBA,GAAE,OAAO,EAAE,SAAS;AAAA,EACpC,MAAMA,GAAE,MAAMA,GAAE,OAAO,CAAC,EAAE,SAAS;AAAA,EACnC,YAAYA,GAAE,OAAO,EAAE,SAAS;AAAA,EAChC,WAAWA,GAAE,OAAO;AACtB,CAAC;;;ADlDM,IAAM,wBAAwB,qBAAqB,OAAO;AAAA;AAAA,EAE/D,QAAQC,GAAE,KAAK,CAAC,aAAa,eAAe,YAAY,YAAY,CAAU;AAAA;AAAA,EAE9E,YAAYA,GAAE,KAAK,CAAC,UAAU,WAAW,UAAU,CAAU;AAC/D,CAAC;;;AGfD,SAAS,KAAAC,UAAS;AAOX,IAAM,qBAAqBA,GAAE,KAAK,CAAC,QAAQ,OAAO,CAAC;AAOnD,IAAM,yBAAyBA,GAAE,KAAK;AAAA,EAC3C;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AACF,CAAC;","names":["z","z","z","z","z"]}
|