@lobehub/market-types 1.11.2 → 1.11.4

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.
Files changed (2) hide show
  1. package/dist/index.d.mts +265 -208
  2. package/package.json +1 -1
package/dist/index.d.mts CHANGED
@@ -1,172 +1,121 @@
1
1
  import { z } from 'zod';
2
2
 
3
3
  /**
4
- * Plugin Call Report Types
5
- *
6
- * This module defines the types for plugin call reporting functionality.
7
- * These types support users reporting their plugin method invocations to help improve
8
- * plugin performance monitoring and provide usage analytics.
9
- * These types are shared between the API server and client SDKs.
4
+ * Top Plugin Interface
5
+ * Unified interface for top plugins data
10
6
  */
7
+ interface TopPlugin {
8
+ avatar: string;
9
+ /** Call count (when sortBy is 'calls') */
10
+ callCount?: number;
11
+ category: string;
12
+ identifier: string;
13
+ /** Install count (when sortBy is 'installs') */
14
+ installCount?: number;
15
+ name: string;
16
+ }
11
17
  /**
12
- * Plugin method types
18
+ * Sort options for top plugins
13
19
  */
14
- type PluginMethodType = 'tool' | 'prompt' | 'resource';
20
+ type PluginSortBy = 'installs' | 'calls';
15
21
  /**
16
- * Custom plugin information for non-marketplace plugins
22
+ * Top plugins query parameters
17
23
  */
18
- interface CustomPluginInfo {
19
- avatar?: string;
20
- /** Plugin description */
21
- description?: string;
22
- /** Plugin name/title */
23
- name?: string;
24
+ interface TopPluginsQuery {
25
+ /** Maximum number of plugins to return */
26
+ limit?: number;
27
+ /** Date range as [startDate, endDate] */
28
+ range: [string, string];
29
+ /** Sort criteria: 'installs' or 'calls' */
30
+ sortBy?: PluginSortBy;
24
31
  }
25
32
  /**
26
- * Call report request data
33
+ * Install Failure Analysis Interface
34
+ * Defines the structure for plugin install failure analysis data
27
35
  */
28
- interface CallReportRequest {
29
- /** Call execution duration in milliseconds */
30
- callDurationMs: number;
31
- /** Client ID (optional, for M2M authentication) */
32
- clientId?: string;
33
- /** Client IP address (real user IP) */
34
- clientIp?: string;
35
- /** Custom plugin information (required if isCustomPlugin is true) */
36
- customPluginInfo?: CustomPluginInfo;
37
- /** Error code if call failed */
38
- errorCode?: string;
39
- /** Error message if call failed */
40
- errorMessage?: string;
36
+ interface InstallFailureAnalysis {
37
+ /** Number of failed installation attempts */
38
+ failureCount: number;
39
+ /** Failure rate as a decimal (e.g., 0.2736 for 27.36%) */
40
+ failureRate: number;
41
+ /** Most common error message for this plugin */
42
+ mostCommonError: string;
41
43
  /** Plugin identifier */
42
- identifier: string;
43
- /** Input parameters sent to the method */
44
- inputParams?: any;
45
- /** Whether this is a custom/local plugin (not from marketplace) */
46
- isCustomPlugin?: boolean;
47
- /** Additional metadata about the call */
48
- metadata?: Record<string, any>;
49
- /** Specific method name being called */
50
- methodName: string;
51
- /** Plugin method type (tool/prompt/resource) */
52
- methodType: PluginMethodType;
53
- /** Output/response from the method */
54
- outputResult?: any;
55
- /** Platform information */
56
- platform?: string;
57
- /** Request size in bytes */
58
- requestSizeBytes?: number;
59
- /** Response size in bytes */
60
- responseSizeBytes?: number;
61
- /** Session ID for correlating multiple calls */
62
- sessionId?: string;
63
- /** Whether the call was successful */
64
- success: boolean;
65
- /** Trace ID for distributed tracing */
66
- traceId?: string;
67
- /** User agent (real user agent) */
68
- userAgent?: string;
69
- /** Plugin version */
70
- version: string;
44
+ pluginIdentifier: string;
45
+ /** Plugin display name */
46
+ pluginName: string;
47
+ /** Total number of installation attempts (successful + failed) */
48
+ totalInstallAttempts: number;
71
49
  }
72
50
  /**
73
- * Call report response data
51
+ * Install failure analysis query parameters
74
52
  */
75
- interface CallReportResponse {
76
- /** Message about the processing result */
77
- message: string;
78
- /** Whether the report was successfully recorded */
79
- success: boolean;
53
+ interface InstallFailureAnalysisQuery {
54
+ /** Maximum number of plugins to return */
55
+ limit?: number;
56
+ /** Date range as [startDate, endDate] */
57
+ range: [string, string];
80
58
  }
59
+
81
60
  /**
82
- * Call statistics data
61
+ * Base structure for a single resource item in the marketplace.
62
+ * This interface defines the common properties shared by all marketplace items,
63
+ * including plugins, agents, and other resources.
83
64
  */
84
- interface CallStats {
85
- /** Average call duration in milliseconds */
86
- averageCallTime: number;
87
- /** Call statistics by method type */
88
- byMethodType: Record<PluginMethodType, {
89
- averageCallTime: number;
90
- failedCalls: number;
91
- successRate: number;
92
- successfulCalls: number;
93
- totalCalls: number;
94
- }>;
95
- /** Statistics by plugin source (marketplace vs custom) */
96
- byPluginSource: {
97
- custom: {
98
- averageCallTime: number;
99
- successRate: number;
100
- totalCalls: number;
101
- };
102
- marketplace: {
103
- averageCallTime: number;
104
- successRate: number;
105
- totalCalls: number;
106
- };
107
- };
108
- /** Number of failed calls */
109
- failedCalls: number;
110
- /** Success rate as percentage */
111
- successRate: number;
112
- /** Number of successful calls */
113
- successfulCalls: number;
114
- /** Most common call errors */
115
- topErrors: Array<{
116
- count: number;
117
- errorCode: string;
118
- errorMessage: string;
119
- }>;
120
- /** Most frequently called methods */
121
- topMethods: Array<{
122
- averageCallTime: number;
123
- count: number;
124
- methodName: string;
125
- methodType: PluginMethodType;
126
- successRate: number;
127
- }>;
128
- /** Total number of call attempts */
129
- totalCalls: number;
65
+ interface MarketItemBase {
66
+ /** Author or organization name */
67
+ author?: string;
68
+ /** Category name used for classification */
69
+ category?: string;
70
+ /** Optional: Compatibility information for different platforms or versions */
71
+ compatibility?: Record<string, any>;
72
+ /** Resource creation date in the marketplace (ISO 8601 format) */
73
+ createdAt: string;
74
+ /** Localized short description displayed in the marketplace listing */
75
+ description: string;
76
+ /** URL to the resource's homepage or documentation */
77
+ homepage?: string;
78
+ /** Icon URL or Emoji character */
79
+ icon?: string;
80
+ /** Globally unique identifier, typically contains author/namespace and name */
81
+ identifier: string;
82
+ /** URL pointing to the detailed manifest file for this resource */
83
+ manifestUrl: string;
84
+ /** Localized display name shown in the marketplace listing */
85
+ name: string;
86
+ /** List of localized tags for filtering and categorization */
87
+ tags?: string[];
88
+ /** Resource's last update date in the marketplace (ISO 8601 format) */
89
+ updatedAt: string;
130
90
  }
131
91
  /**
132
- * Call log entry data
92
+ * Category list request query parameters
93
+ *
94
+ * Query parameters for retrieving category statistics with optional filtering.
133
95
  */
134
- interface CallLogEntry {
135
- /** Call execution duration in milliseconds */
136
- callDurationMs: number;
137
- /** When the log was created */
138
- createdAt: string;
139
- /** Custom plugin information */
140
- customPluginInfo?: CustomPluginInfo | null;
141
- /** Error code if failed */
142
- errorCode?: string | null;
143
- /** Error message if failed */
144
- errorMessage?: string | null;
145
- /** Log entry ID */
146
- id: number;
147
- /** Plugin identifier */
148
- identifier: string;
149
- /** Whether this is a custom plugin */
150
- isCustomPlugin: boolean;
151
- /** Method name */
152
- methodName: string;
153
- /** Plugin method type */
154
- methodType: PluginMethodType;
155
- /** Platform information */
156
- platform?: string | null;
157
- /** Request size in bytes */
158
- requestSizeBytes?: number | null;
159
- /** Response size in bytes */
160
- responseSizeBytes?: number | null;
161
- /** Session ID */
162
- sessionId?: string | null;
163
- /** Whether call was successful */
164
- success: boolean;
165
- /** Trace ID */
166
- traceId?: string | null;
167
- /** Plugin version */
168
- version: string;
96
+ interface CategoryListQuery {
97
+ /** Optional locale for localized search, defaults to 'en-US' */
98
+ locale?: string;
99
+ /** Optional search query to filter plugins before counting categories */
100
+ q?: string;
101
+ }
102
+ /**
103
+ * Single category item with plugin count
104
+ *
105
+ * Represents a category and the number of plugins in that category.
106
+ */
107
+ interface CategoryItem {
108
+ /** Category name */
109
+ category: string;
110
+ /** Number of plugins in this category */
111
+ count: number;
169
112
  }
113
+ /**
114
+ * Category list response type
115
+ *
116
+ * Array of categories with their respective plugin counts.
117
+ */
118
+ type CategoryListResponse = CategoryItem[];
170
119
 
171
120
  /**
172
121
  * Connection types for plugin communication.
@@ -259,66 +208,6 @@ interface DeploymentOption {
259
208
  systemDependencies?: SystemDependency[];
260
209
  }
261
210
 
262
- /**
263
- * Base structure for a single resource item in the marketplace.
264
- * This interface defines the common properties shared by all marketplace items,
265
- * including plugins, agents, and other resources.
266
- */
267
- interface MarketItemBase {
268
- /** Author or organization name */
269
- author?: string;
270
- /** Category name used for classification */
271
- category?: string;
272
- /** Optional: Compatibility information for different platforms or versions */
273
- compatibility?: Record<string, any>;
274
- /** Resource creation date in the marketplace (ISO 8601 format) */
275
- createdAt: string;
276
- /** Localized short description displayed in the marketplace listing */
277
- description: string;
278
- /** URL to the resource's homepage or documentation */
279
- homepage?: string;
280
- /** Icon URL or Emoji character */
281
- icon?: string;
282
- /** Globally unique identifier, typically contains author/namespace and name */
283
- identifier: string;
284
- /** URL pointing to the detailed manifest file for this resource */
285
- manifestUrl: string;
286
- /** Localized display name shown in the marketplace listing */
287
- name: string;
288
- /** List of localized tags for filtering and categorization */
289
- tags?: string[];
290
- /** Resource's last update date in the marketplace (ISO 8601 format) */
291
- updatedAt: string;
292
- }
293
- /**
294
- * Category list request query parameters
295
- *
296
- * Query parameters for retrieving category statistics with optional filtering.
297
- */
298
- interface CategoryListQuery {
299
- /** Optional locale for localized search, defaults to 'en-US' */
300
- locale?: string;
301
- /** Optional search query to filter plugins before counting categories */
302
- q?: string;
303
- }
304
- /**
305
- * Single category item with plugin count
306
- *
307
- * Represents a category and the number of plugins in that category.
308
- */
309
- interface CategoryItem {
310
- /** Category name */
311
- category: string;
312
- /** Number of plugins in this category */
313
- count: number;
314
- }
315
- /**
316
- * Category list response type
317
- *
318
- * Array of categories with their respective plugin counts.
319
- */
320
- type CategoryListResponse = CategoryItem[];
321
-
322
211
  /**
323
212
  * Schema defining the capabilities a plugin can provide.
324
213
  * Each capability is represented as a boolean flag.
@@ -959,6 +848,174 @@ interface RangeQuery {
959
848
  range: [string, string];
960
849
  }
961
850
 
851
+ /**
852
+ * Plugin Call Report Types
853
+ *
854
+ * This module defines the types for plugin call reporting functionality.
855
+ * These types support users reporting their plugin method invocations to help improve
856
+ * plugin performance monitoring and provide usage analytics.
857
+ * These types are shared between the API server and client SDKs.
858
+ */
859
+ /**
860
+ * Plugin method types
861
+ */
862
+ type PluginMethodType = 'tool' | 'prompt' | 'resource';
863
+ /**
864
+ * Custom plugin information for non-marketplace plugins
865
+ */
866
+ interface CustomPluginInfo {
867
+ avatar?: string;
868
+ /** Plugin description */
869
+ description?: string;
870
+ /** Plugin name/title */
871
+ name?: string;
872
+ }
873
+ /**
874
+ * Call report request data
875
+ */
876
+ interface CallReportRequest {
877
+ /** Call execution duration in milliseconds */
878
+ callDurationMs: number;
879
+ /** Client ID (optional, for M2M authentication) */
880
+ clientId?: string;
881
+ /** Client IP address (real user IP) */
882
+ clientIp?: string;
883
+ /** Custom plugin information (required if isCustomPlugin is true) */
884
+ customPluginInfo?: CustomPluginInfo;
885
+ /** Error code if call failed */
886
+ errorCode?: string;
887
+ /** Error message if call failed */
888
+ errorMessage?: string;
889
+ /** Plugin identifier */
890
+ identifier: string;
891
+ /** Input parameters sent to the method */
892
+ inputParams?: any;
893
+ /** Whether this is a custom/local plugin (not from marketplace) */
894
+ isCustomPlugin?: boolean;
895
+ /** Additional metadata about the call */
896
+ metadata?: Record<string, any>;
897
+ /** Specific method name being called */
898
+ methodName: string;
899
+ /** Plugin method type (tool/prompt/resource) */
900
+ methodType: PluginMethodType;
901
+ /** Output/response from the method */
902
+ outputResult?: any;
903
+ /** Platform information */
904
+ platform?: string;
905
+ /** Request size in bytes */
906
+ requestSizeBytes?: number;
907
+ /** Response size in bytes */
908
+ responseSizeBytes?: number;
909
+ /** Session ID for correlating multiple calls */
910
+ sessionId?: string;
911
+ /** Whether the call was successful */
912
+ success: boolean;
913
+ /** Trace ID for distributed tracing */
914
+ traceId?: string;
915
+ /** User agent (real user agent) */
916
+ userAgent?: string;
917
+ /** Plugin version */
918
+ version: string;
919
+ }
920
+ /**
921
+ * Call report response data
922
+ */
923
+ interface CallReportResponse {
924
+ /** Message about the processing result */
925
+ message: string;
926
+ /** Whether the report was successfully recorded */
927
+ success: boolean;
928
+ }
929
+ /**
930
+ * Call statistics data
931
+ */
932
+ interface CallStats {
933
+ /** Average call duration in milliseconds */
934
+ averageCallTime: number;
935
+ /** Call statistics by method type */
936
+ byMethodType: Record<PluginMethodType, {
937
+ averageCallTime: number;
938
+ failedCalls: number;
939
+ successRate: number;
940
+ successfulCalls: number;
941
+ totalCalls: number;
942
+ }>;
943
+ /** Statistics by plugin source (marketplace vs custom) */
944
+ byPluginSource: {
945
+ custom: {
946
+ averageCallTime: number;
947
+ successRate: number;
948
+ totalCalls: number;
949
+ };
950
+ marketplace: {
951
+ averageCallTime: number;
952
+ successRate: number;
953
+ totalCalls: number;
954
+ };
955
+ };
956
+ /** Number of failed calls */
957
+ failedCalls: number;
958
+ /** Success rate as percentage */
959
+ successRate: number;
960
+ /** Number of successful calls */
961
+ successfulCalls: number;
962
+ /** Most common call errors */
963
+ topErrors: Array<{
964
+ count: number;
965
+ errorCode: string;
966
+ errorMessage: string;
967
+ }>;
968
+ /** Most frequently called methods */
969
+ topMethods: Array<{
970
+ averageCallTime: number;
971
+ count: number;
972
+ methodName: string;
973
+ methodType: PluginMethodType;
974
+ successRate: number;
975
+ }>;
976
+ /** Total number of call attempts */
977
+ totalCalls: number;
978
+ }
979
+ /**
980
+ * Call log entry data
981
+ */
982
+ interface CallLogEntry {
983
+ /** Call execution duration in milliseconds */
984
+ callDurationMs: number;
985
+ /** When the log was created */
986
+ createdAt: string;
987
+ /** Custom plugin information */
988
+ customPluginInfo?: CustomPluginInfo | null;
989
+ /** Error code if failed */
990
+ errorCode?: string | null;
991
+ /** Error message if failed */
992
+ errorMessage?: string | null;
993
+ /** Log entry ID */
994
+ id: number;
995
+ /** Plugin identifier */
996
+ identifier: string;
997
+ /** Whether this is a custom plugin */
998
+ isCustomPlugin: boolean;
999
+ /** Method name */
1000
+ methodName: string;
1001
+ /** Plugin method type */
1002
+ methodType: PluginMethodType;
1003
+ /** Platform information */
1004
+ platform?: string | null;
1005
+ /** Request size in bytes */
1006
+ requestSizeBytes?: number | null;
1007
+ /** Response size in bytes */
1008
+ responseSizeBytes?: number | null;
1009
+ /** Session ID */
1010
+ sessionId?: string | null;
1011
+ /** Whether call was successful */
1012
+ success: boolean;
1013
+ /** Trace ID */
1014
+ traceId?: string | null;
1015
+ /** Plugin version */
1016
+ version: string;
1017
+ }
1018
+
962
1019
  /**
963
1020
  * Plugin Install Report Types
964
1021
  *
@@ -1056,4 +1113,4 @@ interface InstallLogEntry {
1056
1113
  version: string;
1057
1114
  }
1058
1115
 
1059
- export { type AdminDeploymentOption, type AdminPluginItem, type AdminPluginItemDetail, AdminPluginItemSchema, type AdminSystemDependency, type BasePluginItem, BasePluginItemSchema, type CallLogEntry, type CallReportRequest, type CallReportResponse, type CallStats, type CategoryItem, type CategoryListQuery, type CategoryListResponse, type ConnectionConfig, type ConnectionType, ConnectionTypeEnum, type CustomPluginInfo, type DeploymentOption, type IncompleteI18nPlugin, type InstallLogEntry, type InstallReportRequest, type InstallReportResponse, type InstallStats, type InstallationDetails, type InstallationMethod, InstallationMethodEnum, type MarketItemBase, type MarketPluginItem, PluginCapabilitiesSchema, type PluginCompatibility, type PluginConnectionType, PluginConnectionTypeEnum, type PluginItemDetail, type PluginManifest, type PluginMethodType, type PluginPrompt, type PluginResource, type PluginTool, type PluginVersion, type PluginVersionLocalization, type PluginVersionSummary, type PromptArgument, type RangeDataPoint, type RangeQuery, type RangeStats, type SystemDependency };
1116
+ export { type AdminDeploymentOption, type AdminPluginItem, type AdminPluginItemDetail, AdminPluginItemSchema, type AdminSystemDependency, type BasePluginItem, BasePluginItemSchema, type CallLogEntry, type CallReportRequest, type CallReportResponse, type CallStats, type CategoryItem, type CategoryListQuery, type CategoryListResponse, type ConnectionConfig, type ConnectionType, ConnectionTypeEnum, type CustomPluginInfo, type DeploymentOption, type IncompleteI18nPlugin, type InstallFailureAnalysis, type InstallFailureAnalysisQuery, type InstallLogEntry, type InstallReportRequest, type InstallReportResponse, type InstallStats, type InstallationDetails, type InstallationMethod, InstallationMethodEnum, type MarketItemBase, type MarketPluginItem, PluginCapabilitiesSchema, type PluginCompatibility, type PluginConnectionType, PluginConnectionTypeEnum, type PluginItemDetail, type PluginManifest, type PluginMethodType, type PluginPrompt, type PluginResource, type PluginSortBy, type PluginTool, type PluginVersion, type PluginVersionLocalization, type PluginVersionSummary, type PromptArgument, type RangeDataPoint, type RangeQuery, type RangeStats, type SystemDependency, type TopPlugin, type TopPluginsQuery };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/market-types",
3
- "version": "1.11.2",
3
+ "version": "1.11.4",
4
4
  "keywords": [
5
5
  "lobehub",
6
6
  "market",