@philcrp/market-types 1.0.0

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.mjs ADDED
@@ -0,0 +1,178 @@
1
+ // src/creds/standardKeys.ts
2
+ var StandardCredKeys = {
3
+ // AI Providers
4
+ ANTHROPIC: "anthropic",
5
+ COHERE: "cohere",
6
+ DEEPSEEK: "deepseek",
7
+ GOOGLE_AI: "google-ai",
8
+ GROQ: "groq",
9
+ HUGGINGFACE: "huggingface",
10
+ MISTRAL: "mistral",
11
+ OPENAI: "openai",
12
+ PERPLEXITY: "perplexity",
13
+ REPLICATE: "replicate",
14
+ // Cloud Providers
15
+ AWS: "aws",
16
+ AZURE: "azure",
17
+ CLOUDFLARE: "cloudflare",
18
+ FIREBASE_SA: "firebase-sa",
19
+ GCP_SA: "gcp-sa",
20
+ SUPABASE: "supabase",
21
+ VERCEL: "vercel",
22
+ // Code & DevOps
23
+ BITBUCKET_PAT: "bitbucket-pat",
24
+ GITHUB_OAUTH: "github-oauth",
25
+ GITHUB_PAT: "github-pat",
26
+ GITLAB_PAT: "gitlab-pat",
27
+ // Communication
28
+ DISCORD_BOT: "discord-bot",
29
+ DISCORD_WEBHOOK: "discord-webhook",
30
+ SENDGRID: "sendgrid",
31
+ SLACK_OAUTH: "slack-oauth",
32
+ SLACK_WEBHOOK: "slack-webhook",
33
+ TWILIO: "twilio",
34
+ // Databases
35
+ AIRTABLE: "airtable",
36
+ MONGODB: "mongodb",
37
+ PLANETSCALE: "planetscale",
38
+ REDIS: "redis",
39
+ // Payments
40
+ STRIPE: "stripe",
41
+ // Productivity
42
+ JIRA_PAT: "jira-pat",
43
+ LINEAR_OAUTH: "linear-oauth",
44
+ NOTION_OAUTH: "notion-oauth",
45
+ NOTION_PAT: "notion-pat"
46
+ };
47
+
48
+ // src/plugin/admin.ts
49
+ import { z as z3 } from "zod";
50
+
51
+ // src/plugin/plugin.ts
52
+ import { z as z2 } from "zod";
53
+
54
+ // src/plugin/capabilities.ts
55
+ import { z } from "zod";
56
+ var PluginCapabilitiesSchema = z.object({
57
+ /** Whether the plugin provides custom prompts */
58
+ prompts: z.boolean().default(false),
59
+ /** Whether the plugin provides resources (assets) */
60
+ resources: z.boolean().default(false),
61
+ /** Whether the plugin provides tools (functions) */
62
+ tools: z.boolean().default(false)
63
+ });
64
+
65
+ // src/plugin/plugin.ts
66
+ var BasePluginItemSchema = z2.object({
67
+ author: z2.string().optional(),
68
+ capabilities: PluginCapabilitiesSchema,
69
+ category: z2.string().optional(),
70
+ commentCount: z2.number().default(0),
71
+ connectionType: z2.enum(["local", "remote", "hybrid"]).optional(),
72
+ createdAt: z2.string(),
73
+ description: z2.string(),
74
+ github: z2.object({
75
+ language: z2.string().optional(),
76
+ license: z2.string().optional(),
77
+ stars: z2.number().optional(),
78
+ url: z2.string()
79
+ }).optional(),
80
+ haveCloudEndpoint: z2.boolean().optional(),
81
+ homepage: z2.string().optional(),
82
+ icon: z2.string().optional(),
83
+ identifier: z2.string(),
84
+ installCount: z2.number().default(0),
85
+ isClaimed: z2.boolean().default(false),
86
+ isFeatured: z2.boolean().default(false),
87
+ isOfficial: z2.boolean().default(false),
88
+ isValidated: z2.boolean().default(false),
89
+ manifestUrl: z2.string(),
90
+ name: z2.string(),
91
+ promptsCount: z2.number().optional(),
92
+ ratingAverage: z2.number().optional(),
93
+ ratingCount: z2.number().default(0),
94
+ resourcesCount: z2.number().optional(),
95
+ toolsCount: z2.number().optional(),
96
+ updatedAt: z2.string()
97
+ });
98
+
99
+ // src/plugin/admin.ts
100
+ var AdminPluginItemSchema = BasePluginItemSchema.extend({
101
+ /** Publication status of the plugin */
102
+ status: z3.enum(["published", "unpublished", "archived", "deprecated"]),
103
+ /** Visibility level of the plugin */
104
+ visibility: z3.enum(["public", "private", "internal"])
105
+ });
106
+
107
+ // src/plugin/deploymentOption.ts
108
+ import { z as z4 } from "zod";
109
+ var ConnectionTypeEnum = z4.enum(["http", "stdio", "sse"]);
110
+ var PluginConnectionTypeEnum = z4.enum(["local", "remote", "hybrid"]);
111
+ var InstallationMethodEnum = z4.enum([
112
+ "npm",
113
+ // Node.js package manager
114
+ "go",
115
+ // Go language
116
+ "python",
117
+ // Python language
118
+ "docker",
119
+ // Docker container
120
+ "git",
121
+ // Git repository
122
+ "binaryUrl",
123
+ // Direct binary download URL
124
+ "manual",
125
+ // Manual installation with instructions
126
+ "none"
127
+ // No installation required
128
+ ]);
129
+
130
+ // src/skill/skill.ts
131
+ var SkillCategoryEnum = /* @__PURE__ */ ((SkillCategoryEnum2) => {
132
+ SkillCategoryEnum2["AILLMs"] = "ai-llms";
133
+ SkillCategoryEnum2["AgentToAgentProtocols"] = "agent-to-agent-protocols";
134
+ SkillCategoryEnum2["AppleAppsServices"] = "apple-apps-services";
135
+ SkillCategoryEnum2["BrowserAutomation"] = "browser-automation";
136
+ SkillCategoryEnum2["CLIUtilities"] = "cli-utilities";
137
+ SkillCategoryEnum2["CalendarScheduling"] = "calendar-scheduling";
138
+ SkillCategoryEnum2["ClawdbotTools"] = "clawdbot-tools";
139
+ SkillCategoryEnum2["CodingAgentsIDEs"] = "coding-agents-ides";
140
+ SkillCategoryEnum2["Communication"] = "communication";
141
+ SkillCategoryEnum2["DataAnalytics"] = "data-analytics";
142
+ SkillCategoryEnum2["DevOpsCloud"] = "devops-cloud";
143
+ SkillCategoryEnum2["Finance"] = "finance";
144
+ SkillCategoryEnum2["Gaming"] = "gaming";
145
+ SkillCategoryEnum2["GitGitHub"] = "git-github";
146
+ SkillCategoryEnum2["HealthFitness"] = "health-fitness";
147
+ SkillCategoryEnum2["IOSMacOSDevelopment"] = "ios-macos-development";
148
+ SkillCategoryEnum2["ImageVideoGeneration"] = "image-video-generation";
149
+ SkillCategoryEnum2["MarketingSales"] = "marketing-sales";
150
+ SkillCategoryEnum2["MediaStreaming"] = "media-streaming";
151
+ SkillCategoryEnum2["Moltbook"] = "moltbook";
152
+ SkillCategoryEnum2["NotesPKM"] = "notes-pkm";
153
+ SkillCategoryEnum2["PDFDocuments"] = "pdf-documents";
154
+ SkillCategoryEnum2["PersonalDevelopment"] = "personal-development";
155
+ SkillCategoryEnum2["ProductivityTasks"] = "productivity-tasks";
156
+ SkillCategoryEnum2["SearchResearch"] = "search-research";
157
+ SkillCategoryEnum2["SecurityPasswords"] = "security-passwords";
158
+ SkillCategoryEnum2["SelfHostedAutomation"] = "self-hosted-automation";
159
+ SkillCategoryEnum2["ShoppingEcommerce"] = "shopping-ecommerce";
160
+ SkillCategoryEnum2["SmartHomeIoT"] = "smart-home-iot";
161
+ SkillCategoryEnum2["SpeechTranscription"] = "speech-transcription";
162
+ SkillCategoryEnum2["Transportation"] = "transportation";
163
+ SkillCategoryEnum2["WebFrontendDevelopment"] = "web-frontend-development";
164
+ return SkillCategoryEnum2;
165
+ })(SkillCategoryEnum || {});
166
+ var SKILL_CATEGORY_VALUES = Object.values(SkillCategoryEnum);
167
+ export {
168
+ AdminPluginItemSchema,
169
+ BasePluginItemSchema,
170
+ ConnectionTypeEnum,
171
+ InstallationMethodEnum,
172
+ PluginCapabilitiesSchema,
173
+ PluginConnectionTypeEnum,
174
+ SKILL_CATEGORY_VALUES,
175
+ SkillCategoryEnum,
176
+ StandardCredKeys
177
+ };
178
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/creds/standardKeys.ts","../src/plugin/admin.ts","../src/plugin/plugin.ts","../src/plugin/capabilities.ts","../src/plugin/deploymentOption.ts","../src/skill/skill.ts"],"sourcesContent":["/* eslint-disable sort-keys-fix/sort-keys-fix */\n/**\n * Standard Credential Keys\n *\n * Pre-defined credential key catalog for common providers.\n * Skill authors should prefer these standard keys over custom ones.\n *\n * Rules:\n * 1. `key` represents a capability, not a final env variable name.\n * 2. Same provider with different auth methods should have different keys.\n * 3. Custom keys are allowed but standard keys should be preferred.\n */\nexport const StandardCredKeys = {\n // AI Providers\n ANTHROPIC: 'anthropic',\n COHERE: 'cohere',\n DEEPSEEK: 'deepseek',\n GOOGLE_AI: 'google-ai',\n GROQ: 'groq',\n HUGGINGFACE: 'huggingface',\n MISTRAL: 'mistral',\n OPENAI: 'openai',\n PERPLEXITY: 'perplexity',\n REPLICATE: 'replicate',\n\n // Cloud Providers\n AWS: 'aws',\n AZURE: 'azure',\n CLOUDFLARE: 'cloudflare',\n FIREBASE_SA: 'firebase-sa',\n GCP_SA: 'gcp-sa',\n SUPABASE: 'supabase',\n VERCEL: 'vercel',\n\n // Code & DevOps\n BITBUCKET_PAT: 'bitbucket-pat',\n GITHUB_OAUTH: 'github-oauth',\n GITHUB_PAT: 'github-pat',\n GITLAB_PAT: 'gitlab-pat',\n\n // Communication\n DISCORD_BOT: 'discord-bot',\n DISCORD_WEBHOOK: 'discord-webhook',\n SENDGRID: 'sendgrid',\n SLACK_OAUTH: 'slack-oauth',\n SLACK_WEBHOOK: 'slack-webhook',\n TWILIO: 'twilio',\n\n // Databases\n AIRTABLE: 'airtable',\n MONGODB: 'mongodb',\n PLANETSCALE: 'planetscale',\n REDIS: 'redis',\n\n // Payments\n STRIPE: 'stripe',\n\n // Productivity\n JIRA_PAT: 'jira-pat',\n LINEAR_OAUTH: 'linear-oauth',\n NOTION_OAUTH: 'notion-oauth',\n NOTION_PAT: 'notion-pat',\n} as const;\n/* eslint-enable sort-keys-fix/sort-keys-fix */\n\nexport type StandardCredKey = (typeof StandardCredKeys)[keyof typeof StandardCredKeys];\n","// 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 /** GitHub last update timestamp (ISO 8601 format) */\n githubUpdateAt?: string;\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\n/**\n * Plugin version localization data.\n * Represents localized content for a specific plugin version in a particular language.\n */\nexport interface PluginVersionLocalization {\n /** Creation timestamp (ISO 8601 format) */\n createdAt: string;\n /** Localized description of the plugin */\n description: string;\n /** Unique numeric identifier for the localization */\n id: number;\n /** Language/locale code (e.g., 'en-US', 'zh-CN') */\n locale: string;\n /** Localized display name of the plugin */\n name: string;\n /** ID of the parent plugin version */\n pluginVersionId: number;\n /** Localized summary of the plugin */\n summary?: string;\n /** Array of localized tags for categorization and search */\n tags?: string[];\n}\n\n/**\n * 不完整i18n插件项\n * 表示pluginVersionLocalizations只有1个条目的插件\n */\nexport interface IncompleteI18nPlugin {\n /** 插件标识符 */\n identifier: string;\n /** 本地化条目数量 */\n localizationCount: number;\n /** 插件ID */\n pluginId: number;\n /** 插件版本 */\n version: string;\n}\n\n/**\n * Range Data Point Interface\n * Defines the structure for daily trend data points in analysis\n */\nexport interface RangeDataPoint {\n /** Current period count */\n count: number;\n /** Date in YYYY-MM-DD format */\n date: string;\n /** Previous period count for comparison */\n prevCount: number;\n}\n\n/**\n * Range Statistics Interface\n * Defines the structure for range-based statistics\n */\nexport interface RangeStats {\n /** Array of daily data points */\n data: RangeDataPoint[];\n /** Display configuration */\n display: string;\n /** Total sum for previous period */\n prevSum: number;\n /** Total sum for current period */\n sum: number;\n}\n\n/**\n * Range query parameters for trend analysis\n */\nexport interface RangeQuery {\n /** Display configuration */\n display: string;\n /** Optional previous period range for comparison */\n prevRange?: [string, string];\n /** Date range as [startDate, endDate] */\n range: [string, string];\n}\n","import { z } from 'zod';\n\nimport { MarketItemBase } from '../market';\nimport { PluginCapabilitiesSchema, PluginPrompt, PluginResource, PluginTool } from './capabilities';\nimport { DeploymentOption, PluginConnectionType } 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 connectionType: z.enum(['local', 'remote', 'hybrid']).optional(),\n createdAt: z.string(),\n description: z.string(),\n github: z\n .object({\n language: z.string().optional(),\n license: z.string().optional(),\n stars: z.number().optional(),\n url: z.string(),\n })\n .optional(),\n haveCloudEndpoint: z.boolean().optional(),\n homepage: z.string().optional(),\n icon: z.string().optional(),\n identifier: z.string(),\n installCount: z.number().default(0),\n isClaimed: z.boolean().default(false),\n isFeatured: z.boolean().default(false),\n isOfficial: 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 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 /** Connection type strategy for communicating with the plugin */\n connectionType?: PluginConnectionType;\n /** GitHub repository information */\n github?: {\n language?: string;\n license?: string;\n stars?: number;\n url: string;\n };\n /** Whether the plugin has a cloud endpoint available for official cloud-hosted deployment */\n haveCloudEndpoint?: boolean;\n /** Number of times this plugin has been installed */\n installCount?: number;\n /** Whether this plugin has been claimed by its original author */\n isClaimed?: boolean;\n /** Whether this plugin is featured in the marketplace */\n isFeatured?: boolean;\n /** Whether this plugin is officially maintained by LobeHub */\n isOfficial?: 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 summary?: string;\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 * Query parameters for listing plugins in the marketplace.\n * Mirrors SkillListQuery in structure for consistency.\n */\nexport interface PluginListQuery {\n /** Filter by category */\n category?: string;\n /** Filter by MCP connection type */\n connectionType?: 'http' | 'sse' | 'stdio';\n /** Filter by claimed status */\n isClaimed?: 'false' | 'true';\n /** Filter by featured status */\n isFeatured?: 'false' | 'true';\n /** Filter by official status */\n isOfficial?: 'false' | 'true';\n /** Locale for localized content */\n locale?: string;\n /** Sort direction */\n order?: 'asc' | 'desc';\n /** Filter by owner ID */\n ownerId?: number;\n /** Page number (1-based) */\n page?: number;\n /** Number of items per page */\n pageSize?: number;\n /** Search query string */\n q?: string;\n /** Sort field */\n sort?:\n | 'commentCount'\n | 'createdAt'\n | 'githubUpdateAt'\n | 'installCount'\n | 'isFeatured'\n | 'isValidated'\n | 'ratingAverage'\n | 'ratingCount'\n | 'recommended'\n | 'relevance'\n | 'stars'\n | 'updatedAt';\n /** Publication status filter */\n status?: 'all' | 'archived' | 'deprecated' | 'published' | 'unpublished';\n /** Filter by tag */\n tag?: string;\n /** Visibility filter */\n visibility?: 'all' | 'internal' | 'private' | 'public';\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 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 /** Connection type strategy for communicating with the plugin */\n connectionType?: PluginConnectionType;\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 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 /** 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', 'sse']);\nexport type ConnectionType = z.infer<typeof ConnectionTypeEnum>;\n\n/**\n * Plugin connection types for overall plugin communication strategy.\n * - local: Plugin only supports local communication (stdio)\n * - remote: Plugin only supports remote communication (http)\n * - hybrid: Plugin supports both local and remote communication\n */\nexport const PluginConnectionTypeEnum = z.enum(['local', 'remote', 'hybrid']);\nexport type PluginConnectionType = z.infer<typeof PluginConnectionTypeEnum>;\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","/**\n * Skill Type Definitions\n *\n * This module defines types for skill entities in the marketplace.\n * Skills are standalone packages that can be imported from GitHub,\n * browsed, and downloaded.\n */\n\n/**\n * Standard skill category enum\n * Used for AI-generated and validated skill categories\n */\nexport enum SkillCategoryEnum {\n AILLMs = 'ai-llms',\n AgentToAgentProtocols = 'agent-to-agent-protocols',\n AppleAppsServices = 'apple-apps-services',\n BrowserAutomation = 'browser-automation',\n CLIUtilities = 'cli-utilities',\n CalendarScheduling = 'calendar-scheduling',\n ClawdbotTools = 'clawdbot-tools',\n CodingAgentsIDEs = 'coding-agents-ides',\n Communication = 'communication',\n DataAnalytics = 'data-analytics',\n DevOpsCloud = 'devops-cloud',\n Finance = 'finance',\n Gaming = 'gaming',\n GitGitHub = 'git-github',\n HealthFitness = 'health-fitness',\n IOSMacOSDevelopment = 'ios-macos-development',\n ImageVideoGeneration = 'image-video-generation',\n MarketingSales = 'marketing-sales',\n MediaStreaming = 'media-streaming',\n Moltbook = 'moltbook',\n NotesPKM = 'notes-pkm',\n PDFDocuments = 'pdf-documents',\n PersonalDevelopment = 'personal-development',\n ProductivityTasks = 'productivity-tasks',\n SearchResearch = 'search-research',\n SecurityPasswords = 'security-passwords',\n SelfHostedAutomation = 'self-hosted-automation',\n ShoppingEcommerce = 'shopping-ecommerce',\n SmartHomeIoT = 'smart-home-iot',\n SpeechTranscription = 'speech-transcription',\n Transportation = 'transportation',\n WebFrontendDevelopment = 'web-frontend-development',\n}\n\n/**\n * Array of valid skill category values\n */\nexport const SKILL_CATEGORY_VALUES = Object.values(SkillCategoryEnum);\n\n/**\n * Skill author information\n */\nexport interface SkillAuthor {\n /** Author's display name */\n name: string;\n /** Author's URL (website, GitHub profile, etc.) */\n url?: string;\n}\n\n/**\n * GitHub metadata for skills\n */\nexport interface SkillGitHubMeta {\n /** Number of forks */\n forks?: number;\n /** Full repository name (owner/repo) */\n fullName?: string;\n /** Number of open issues */\n openIssues?: number;\n /** Number of GitHub stars */\n stars?: number;\n /** GitHub repository URL */\n url?: string;\n /** Number of watchers */\n watchers?: number;\n}\n\n/**\n * Skill license information\n */\nexport interface SkillLicense {\n /** License name (e.g., MIT, Apache-2.0) */\n name: string;\n /** URL to the license text */\n url?: string;\n}\n\n/**\n * Resource file metadata\n */\nexport interface SkillResource {\n /** SHA256 hash of the file */\n fileHash: string;\n /** File size in bytes */\n size: number;\n}\n\n/**\n * Skill manifest from SKILL.md frontmatter\n */\nexport interface SkillManifest {\n /** Author information */\n author?: SkillAuthor;\n /** Category */\n category?: string;\n /** Description */\n description: string;\n /** Icon URL or emoji */\n icon?: string;\n /** License identifier */\n license?: string;\n /** License URL */\n licenseUrl?: string;\n /** Skill name */\n name: string;\n /** GitHub repository URL */\n repository?: string;\n /** Original source URL */\n sourceUrl?: string;\n /** Short summary */\n summary?: string;\n /** Tags for categorization */\n tags?: string[];\n /** Version string */\n version?: string;\n}\n\n/**\n * Skill list item for marketplace listing\n */\nexport interface SkillListItem {\n /** Author name */\n author?: string;\n /** Category */\n category?: string;\n /** Number of comments */\n commentCount: number;\n /** Creation timestamp (ISO string) */\n createdAt: string;\n /** Brief description */\n description: string;\n /** GitHub stats */\n github?: {\n forks?: number;\n stars?: number;\n url?: string;\n watchers?: number;\n };\n /** Homepage URL */\n homepage?: string;\n /** Icon URL (GitHub org avatar) */\n icon?: string;\n /** Unique skill identifier */\n identifier: string;\n /** Install/download count */\n installCount: number;\n /** Whether the skill is featured */\n isFeatured: boolean;\n /** Whether the skill is official */\n isOfficial: boolean;\n /** Whether the skill is validated */\n isValidated: boolean;\n /** License name */\n license?: string;\n /** Logo URL */\n logo?: string;\n /** Canonical skill title from the current version; locale does not affect this field */\n name: string;\n /** Average rating */\n ratingAvg?: number;\n /** Number of ratings */\n ratingCount: number;\n /** Number of resources */\n resourcesCount?: number;\n /** Tags for discovery */\n tags?: string[];\n /** Last update timestamp (ISO string) */\n updatedAt: string;\n /** Current version string */\n version: string;\n}\n\n/**\n * Skill list response with pagination\n */\nexport interface SkillListResponse {\n /** Available categories */\n categories: string[];\n /** Current page number */\n currentPage: number;\n /** List of skills */\n items: SkillListItem[];\n /** Page size */\n pageSize: number;\n /** Total number of skills */\n totalCount: number;\n /** Total number of pages */\n totalPages: number;\n}\n\n/**\n * Skill version summary\n */\nexport interface SkillVersionSummary {\n /** Changelog for this version */\n changelog?: string;\n /** Creation timestamp (ISO string) */\n createdAt: string;\n /** Whether this is the latest version */\n isLatest: boolean;\n /** Whether this version has been validated */\n isValidated?: boolean;\n /** Version string */\n version: string;\n /** Version number */\n versionNumber: number;\n}\n\n/**\n * Detailed skill information\n */\nexport interface SkillDetail {\n /** Author information */\n author?: SkillAuthor;\n /** Category */\n category?: string;\n /** SKILL.md body content (markdown) */\n content: string;\n /** Creation timestamp (ISO string) */\n createdAt: string;\n /** Description */\n description: string;\n /** GitHub metadata */\n github?: SkillGitHubMeta;\n /** Homepage URL */\n homepage?: string;\n /** Icon URL (GitHub org avatar) */\n icon?: string;\n /** Unique skill identifier */\n identifier: string;\n /** Install/download count */\n installCount: number;\n /** Whether the skill is featured */\n isFeatured: boolean;\n /** Whether the skill is official */\n isOfficial: boolean;\n /** Whether the skill is validated */\n isValidated: boolean;\n /** License information */\n license?: SkillLicense;\n /** Logo URL */\n logo?: string;\n /** Complete manifest from SKILL.md */\n manifest: SkillManifest;\n /** Canonical skill title from the current version; locale does not affect this field */\n name: string;\n /** Overview information */\n overview: {\n summary?: string;\n };\n /** Average rating */\n ratingAverage?: number;\n /** Number of ratings */\n ratingCount: number;\n /** GitHub repository URL */\n repository?: string;\n /** Resource files: path -> metadata */\n resources: Record<string, SkillResource>;\n /** Tags */\n tags?: string[];\n /** Last update timestamp (ISO string) */\n updatedAt: string;\n /** Validation timestamp (ISO string) */\n validatedAt?: string;\n /** Current version string */\n version: string;\n /** Version number */\n versionNumber: number;\n /** All versions of this skill */\n versions: SkillVersionSummary[];\n}\n\n/**\n * Skill category with count\n */\nexport interface SkillCategory {\n /** Category name */\n category: string;\n /** Number of skills in this category */\n count: number;\n}\n\n/**\n * Query parameters for skill categories\n */\nexport interface SkillCategoryQuery {\n /** Locale for localized content */\n locale?: string;\n /** Search query to filter skills before counting categories */\n q?: string;\n}\n\n/**\n * Query parameters for listing skills\n */\nexport interface SkillListQuery {\n /** Filter by category */\n category?: string;\n /** Filter by featured flag */\n isFeatured?: 'false' | 'true';\n /** Filter by official flag */\n isOfficial?: 'false' | 'true';\n /** Locale for localized content such as description and summary; title remains canonical */\n locale?: string;\n /** Sort order */\n order?: 'asc' | 'desc';\n /** Page number (1-based) */\n page?: number;\n /** Number of items per page */\n pageSize?: number;\n /** Search query string */\n query?: string;\n /** Sort field */\n sort?:\n | 'commentCount'\n | 'createdAt'\n | 'forks'\n | 'installCount'\n | 'name'\n | 'ratingAverage'\n | 'recommended'\n | 'relevance'\n | 'stars'\n | 'updatedAt'\n | 'watchers';\n}\n\n/**\n * Query parameters for skill detail\n */\nexport interface SkillDetailQuery {\n /** Locale for localized content such as description and summary; title remains canonical */\n locale?: string;\n /** Specific version to retrieve */\n version?: string;\n}\n\n/**\n * Parameters for reporting a GitHub skill\n */\nexport interface ReportGitHubSkillParams {\n /** Branch name (optional) */\n branch?: string;\n /** GitHub repository URL */\n gitUrl: string;\n}\n\n/**\n * Response from reporting a GitHub skill\n */\nexport interface ReportGitHubSkillResponse {\n /** Skill identifier */\n identifier: string;\n /** Status message */\n message: string;\n /** Status: 'queued' for new import, 'exists' if skill already exists */\n status: 'exists' | 'queued';\n}\n\n/**\n * Response for skill versions list\n */\nexport interface SkillVersionsResponse {\n /** List of version summaries */\n data: SkillVersionSummary[];\n}\n"],"mappings":";AAYO,IAAM,mBAAmB;AAAA;AAAA,EAE9B,WAAW;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iB;AACjB,EAAAA,mBAAA,4BAAyB;AAhCf,SAAAA;AAAA,GAAA;AAsCL,IAAM,wBAAwB,OAAO,OAAO,iBAAiB;","names":["z","z","z","z","z","SkillCategoryEnum"]}
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "@philcrp/market-types",
3
+ "version": "1.0.0",
4
+ "keywords": [
5
+ "lobehub",
6
+ "market",
7
+ "types"
8
+ ],
9
+ "homepage": "https://github.com/lobehub-biz/lobehub-market",
10
+ "bugs": {
11
+ "url": "https://github.com/lobehub-biz/lobehub-market/issues/new/choose"
12
+ },
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "https://github.com/lobehub-biz/lobehub-market.git"
16
+ },
17
+ "license": "MIT",
18
+ "author": "LobeHub <i@lobehub.com>",
19
+ "sideEffects": false,
20
+ "main": "./dist/index.mjs",
21
+ "types": "./dist/index.d.mts",
22
+ "files": [
23
+ "dist"
24
+ ],
25
+ "dependencies": {
26
+ "zod": "^3.22.4"
27
+ }
28
+ }