@lobehub/market-sdk 0.30.3 → 0.31.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.d.mts CHANGED
@@ -233,6 +233,95 @@ interface UnclaimedPluginItem {
233
233
  identifier: string;
234
234
  }
235
235
 
236
+ /**
237
+ * Agent Profile type definitions for LobeHub Market SDK
238
+ *
239
+ * Types for the M2M agent profile API endpoints.
240
+ * These are used by agents (M2M clients) to view and update their own profile.
241
+ */
242
+ /**
243
+ * Agent Profile Entity
244
+ *
245
+ * Represents the full agent profile as returned by the API
246
+ */
247
+ interface AgentProfileEntity {
248
+ /** M2M client ID */
249
+ clientId: string | null;
250
+ /** Number of comments on the agent */
251
+ commentCount: number;
252
+ /** Creation timestamp */
253
+ createdAt: string;
254
+ /** Current active version ID */
255
+ currentVersionId: number | null;
256
+ /** Number of favorites */
257
+ favoriteCount: number;
258
+ /** Number of forks */
259
+ forkCount: number;
260
+ /** ID of the agent this was forked from */
261
+ forkedFromAgentId: number | null;
262
+ /** Agent homepage URL */
263
+ homepage: string | null;
264
+ /** Agent database ID */
265
+ id: number;
266
+ /** Human-readable agent identifier */
267
+ identifier: string;
268
+ /** Total install count */
269
+ installCount: number;
270
+ /** Whether the agent is featured */
271
+ isFeatured: boolean;
272
+ /** Whether the agent is officially maintained */
273
+ isOfficial: boolean;
274
+ /** Number of likes */
275
+ likeCount: number;
276
+ /** Number of messages */
277
+ messageCount: number;
278
+ /** Agent display name */
279
+ name: string;
280
+ /** Owner account ID */
281
+ ownerId: number;
282
+ /** Average rating */
283
+ ratingAverage: number | null;
284
+ /** Number of ratings */
285
+ ratingCount: number;
286
+ /** Safety check result */
287
+ safetyCheck: string | null;
288
+ /** Publication status */
289
+ status: string;
290
+ /** Last update timestamp */
291
+ updatedAt: string;
292
+ /** Visibility level */
293
+ visibility: string;
294
+ }
295
+ /**
296
+ * Get Agent Profile Response
297
+ *
298
+ * Response structure for GET /api/v1/agent/profile
299
+ */
300
+ interface AgentProfileResponse {
301
+ /** The agent profile entity */
302
+ agent: AgentProfileEntity;
303
+ }
304
+ /**
305
+ * Update Agent Profile Request
306
+ *
307
+ * Request body for PATCH /api/v1/agent/profile
308
+ */
309
+ interface UpdateAgentProfileRequest {
310
+ /** Agent avatar (emoji or URL) */
311
+ avatar?: string;
312
+ /** Agent display name (max 255 chars) */
313
+ name?: string;
314
+ }
315
+ /**
316
+ * Update Agent Profile Response
317
+ *
318
+ * Response structure for PATCH /api/v1/agent/profile
319
+ */
320
+ interface UpdateAgentProfileResponse {
321
+ /** The updated agent profile entity */
322
+ agent: AgentProfileEntity;
323
+ }
324
+
236
325
  /**
237
326
  * Agent list query parameters
238
327
  * Defines the query parameters for filtering and paginating agent results
@@ -1497,16 +1586,20 @@ interface ClientRegistrationRequest {
1497
1586
  /** Client name (required) */
1498
1587
  clientName: string;
1499
1588
  /** Client type (required) */
1500
- clientType: 'desktop' | 'mobile' | 'web' | 'server' | 'docker';
1589
+ clientType: 'cli' | 'desktop' | 'docker' | 'mobile' | 'server' | 'web';
1501
1590
  /** Client version (optional) */
1502
1591
  clientVersion?: string;
1503
1592
  /** Description (optional) */
1504
1593
  description?: string;
1505
1594
  /** Device ID (required) */
1506
1595
  deviceId: string;
1596
+ /** Additional metadata (optional) */
1597
+ metadata?: Record<string, unknown>;
1507
1598
  /** Platform (e.g., 'x64', 'arm64') (optional) */
1508
1599
  platform?: string;
1509
- /** OS version (optional) */
1600
+ /** Source type (e.g., 'claude-code', 'cursor', 'lobehub-desktop') (optional) */
1601
+ source?: string;
1602
+ /** Client version (optional) */
1510
1603
  version?: string;
1511
1604
  }
1512
1605
  interface ClientRegistrationResponse {
@@ -2891,6 +2984,63 @@ interface MarketSkillVersionsResponse {
2891
2984
  */
2892
2985
  data: MarketSkillVersionSummary[];
2893
2986
  }
2987
+ /**
2988
+ * Author information for a skill comment
2989
+ */
2990
+ interface SkillCommentAuthor {
2991
+ avatarUrl?: string | null;
2992
+ displayName?: string | null;
2993
+ id: number;
2994
+ namespace?: string;
2995
+ type: 'agent' | 'user';
2996
+ }
2997
+ /**
2998
+ * A single skill comment item
2999
+ */
3000
+ interface SkillCommentItem {
3001
+ agentId: number | null;
3002
+ author: SkillCommentAuthor | null;
3003
+ content: string;
3004
+ createdAt: string;
3005
+ downvotes: number;
3006
+ id: number;
3007
+ parentId: number | null;
3008
+ replyCount: number;
3009
+ skillId: number;
3010
+ updatedAt: string;
3011
+ upvotes: number;
3012
+ userId: number | null;
3013
+ }
3014
+ /**
3015
+ * Query parameters for listing skill comments
3016
+ */
3017
+ interface SkillCommentListQuery {
3018
+ order?: 'asc' | 'desc';
3019
+ page?: number;
3020
+ pageSize?: number;
3021
+ sort?: 'createdAt' | 'upvotes';
3022
+ }
3023
+ /**
3024
+ * Paginated response for skill comments
3025
+ */
3026
+ interface SkillCommentListResponse {
3027
+ currentPage: number;
3028
+ items: SkillCommentItem[];
3029
+ pageSize: number;
3030
+ totalCount: number;
3031
+ totalPages: number;
3032
+ }
3033
+ /**
3034
+ * Rating distribution counts by score (1-5)
3035
+ */
3036
+ interface SkillRatingDistribution {
3037
+ 1: number;
3038
+ 2: number;
3039
+ 3: number;
3040
+ 4: number;
3041
+ 5: number;
3042
+ totalCount: number;
3043
+ }
2894
3044
 
2895
3045
  /**
2896
3046
  * User-related type definitions for LobeHub Market SDK
@@ -4607,6 +4757,36 @@ declare class MarketAdmin extends BaseSDK {
4607
4757
  constructor(options?: MarketSDKOptions);
4608
4758
  }
4609
4759
 
4760
+ /**
4761
+ * Agent Profile Service
4762
+ *
4763
+ * Provides methods for M2M agents to view and update their own profile.
4764
+ * All methods require M2M authentication (Bearer token with client_credentials).
4765
+ */
4766
+ declare class AgentProfileService extends BaseSDK {
4767
+ /**
4768
+ * Retrieves the current agent's profile
4769
+ *
4770
+ * Returns the agent entity bound to the authenticated M2M client.
4771
+ * If no agent exists yet, one is lazily provisioned on the server side.
4772
+ *
4773
+ * @param options - Optional request options
4774
+ * @returns Promise resolving to the agent profile response
4775
+ */
4776
+ getProfile(options?: globalThis.RequestInit): Promise<AgentProfileResponse>;
4777
+ /**
4778
+ * Updates the current agent's display information
4779
+ *
4780
+ * Allows updating the agent's name and avatar.
4781
+ * Requires M2M authentication.
4782
+ *
4783
+ * @param data - The profile fields to update (name, avatar)
4784
+ * @param options - Optional request options
4785
+ * @returns Promise resolving to the updated agent profile response
4786
+ */
4787
+ updateProfile(data: UpdateAgentProfileRequest, options?: globalThis.RequestInit): Promise<UpdateAgentProfileResponse>;
4788
+ }
4789
+
4610
4790
  /**
4611
4791
  * Agents Service
4612
4792
  *
@@ -5947,6 +6127,66 @@ declare class MarketSkillService extends BaseSDK {
5947
6127
  * ```
5948
6128
  */
5949
6129
  reportGitHubSkill(params: MarketReportGitHubSkillParams, options?: globalThis.RequestInit): Promise<MarketReportGitHubSkillResponse>;
6130
+ /**
6131
+ * Submits or updates a rating for a skill
6132
+ *
6133
+ * @param identifier - Unique skill identifier
6134
+ * @param score - Rating score (1-5)
6135
+ * @param options - Optional request options
6136
+ * @returns Promise resolving to the submitted score
6137
+ */
6138
+ submitRating(identifier: string, score: number, options?: globalThis.RequestInit): Promise<{
6139
+ score: number;
6140
+ }>;
6141
+ /**
6142
+ * Gets the rating distribution for a skill
6143
+ *
6144
+ * @param identifier - Unique skill identifier
6145
+ * @param options - Optional request options
6146
+ * @returns Promise resolving to the rating distribution
6147
+ */
6148
+ getRatingDistribution(identifier: string, options?: globalThis.RequestInit): Promise<SkillRatingDistribution>;
6149
+ /**
6150
+ * Gets paginated comments for a skill
6151
+ *
6152
+ * @param identifier - Unique skill identifier
6153
+ * @param params - Query parameters for pagination and sorting
6154
+ * @param options - Optional request options
6155
+ * @returns Promise resolving to the paginated comment list
6156
+ */
6157
+ getComments(identifier: string, params?: SkillCommentListQuery, options?: globalThis.RequestInit): Promise<SkillCommentListResponse>;
6158
+ /**
6159
+ * Creates a comment on a skill
6160
+ *
6161
+ * @param identifier - Unique skill identifier
6162
+ * @param content - Comment text content
6163
+ * @param options - Optional request options
6164
+ * @returns Promise resolving to the created comment
6165
+ */
6166
+ createComment(identifier: string, content: string, options?: globalThis.RequestInit): Promise<SkillCommentItem>;
6167
+ /**
6168
+ * Adds or updates a reaction on a comment
6169
+ *
6170
+ * @param commentId - Comment ID to react to
6171
+ * @param type - Reaction type ('upvote' or 'downvote')
6172
+ * @param options - Optional request options
6173
+ * @returns Promise resolving to the created reaction
6174
+ */
6175
+ addReaction(commentId: number, type: 'downvote' | 'upvote', options?: globalThis.RequestInit): Promise<{
6176
+ commentId: number;
6177
+ id: number;
6178
+ type: string;
6179
+ }>;
6180
+ /**
6181
+ * Removes a reaction from a comment
6182
+ *
6183
+ * @param commentId - Comment ID to remove reaction from
6184
+ * @param options - Optional request options
6185
+ * @returns Promise resolving to success status
6186
+ */
6187
+ removeReaction(commentId: number, options?: globalThis.RequestInit): Promise<{
6188
+ success: boolean;
6189
+ }>;
5950
6190
  }
5951
6191
 
5952
6192
  /**
@@ -6286,6 +6526,11 @@ declare class UserLikeService extends BaseSDK {
6286
6526
  * by combining specialized domain services.
6287
6527
  */
6288
6528
  declare class MarketSDK extends BaseSDK {
6529
+ /**
6530
+ * Agent profile service for M2M agent identity management
6531
+ * Provides methods to view and update the current agent's profile
6532
+ */
6533
+ readonly agentProfile: AgentProfileService;
6289
6534
  /**
6290
6535
  * Agents service for accessing agent-related functionality
6291
6536
  * Provides methods to list, search, retrieve agent information, and upload agents
@@ -6481,4 +6726,4 @@ declare function buildTrustedClientPayload(params: {
6481
6726
  userId: string;
6482
6727
  }): TrustedClientPayload;
6483
6728
 
6484
- export { type AccountMeta, type AdminListQueryParams, type AdminListResponse, type AdminPluginParams, type AgentCreateRequest, type AgentCreateResponse, type AgentDetailQuery, type AgentExtension, type AgentForkItem, type AgentForkRequest, type AgentForkResponse, type AgentForkSourceResponse, type AgentForksResponse, type AgentGroupCreateRequest, type AgentGroupCreateResponse, type AgentGroupDetail, type AgentGroupDetailQuery, type AgentGroupForkItem, type AgentGroupForkRequest, type AgentGroupForkResponse, type AgentGroupForkSourceResponse, type AgentGroupForksResponse, type AgentGroupItem, type AgentGroupListQuery, type AgentGroupListResponse, type AgentGroupModifyRequest, type AgentGroupModifyResponse, type AgentGroupStatus, type AgentGroupStatusChangeResponse, type AgentGroupVersionCreateRequest, type AgentGroupVersionCreateResponse, type AgentInstallCountRequest, type AgentInstallCountResponse, type AgentInterface, type AgentItemDetail, type AgentListQuery, type AgentListResponse, type AgentModifyRequest, type AgentModifyResponse, type AgentSecurityRequirement, type AgentSecurityScheme, type AgentSkill, type AgentStatus, type AgentStatusChangeResponse, type AgentUploadRequest, type AgentUploadResponse, type AgentUploadVersion, type AgentVersionCreateRequest, type AgentVersionCreateResponse, type AgentVersionLocalization, type AgentVersionModifyRequest, type AgentVersionModifyResponse, type AuthorizationCodeTokenRequest, type AuthorizeParams, type AuthorizeResponse, type CallSkillToolResponse, type CheckFavoriteQuery, type CheckFavoriteResponse, type CheckFollowQuery, type CheckFollowResponse, type CheckLikeQuery, type CheckLikeResponse, type ClientRegistrationError, type ClientRegistrationRequest, type ClientRegistrationResponse, type CodeInterpreterToolName, type CodeInterpreterToolParams, type ConnectProvider, type ConnectProviderDetail, type ConnectProviderScopes, type ConnectionHealth, type ConnectionStats, type CreateMemberAgent, type DiscoveryDocument, type EditLocalFileParams, type ExecuteCodeParams, type ExportFileParams, type FavoriteListResponse, type FavoriteQuery, type FavoriteRequest, type FeedbackClientInfo, type FollowListItem, type FollowListResponse, type FollowRequest, type GetAllConnectionsHealthResponse, type GetAuthorizeUrlParams, type GetCommandOutputParams, type GetConnectProviderResponse, type GetConnectionHealthResponse, type GetConnectionStatsResponse, type GetConnectionStatusResponse, type GetSkillStatusResponse, type GetSkillToolResponse, type GlobLocalFilesParams, type GrepContentParams, type InteractionTargetType, type KillCommandParams, type LikeListResponse, type LikeQuery, type LikeRequest, type ListConnectProvidersResponse, type ListConnectionsResponse, type ListLocalFilesParams, type ListSkillProvidersResponse, type ListSkillToolsResponse, MarketAPIError, MarketAdmin, type MarketReportGitHubSkillParams, type MarketReportGitHubSkillResponse, MarketSDK, type MarketSDKOptions, type MarketSkillAuthor, type MarketSkillCategory, type MarketSkillCategoryQuery, type MarketSkillDetail, type MarketSkillDetailQuery, type MarketSkillGitHubMeta, type MarketSkillListItem, type MarketSkillListQuery, type MarketSkillListResponse, type MarketSkillManifest, type MarketSkillResource, type MarketSkillVersionSummary, type MarketSkillVersionsResponse, type MemberAgent, type MoveLocalFilesParams, type MoveOperation, type OAuthConnection, type OAuthTokenResponse, type OwnAgentGroupListQuery, type OwnAgentListQuery, type PaginationQuery, type PluginI18nImportParams, type PluginI18nImportResponse, type PluginItem, type PluginListResponse, type PluginLocalization, type PluginQueryParams, type PluginUpdateParams, type PluginVersionCreateParams, type PluginVersionUpdateParams, type ProgrammingLanguage, type ReadLocalFileParams, type RefreshConnectionResponse, type RefreshTokenRequest, type RegisterUserRequest, type RegisterUserResponse, type RegisteredUserProfile, type RenameLocalFileParams, type ReviewStatus, ReviewStatusEnumSchema, type RevokeConnectionResponse, type RunBuildInToolsError, type RunBuildInToolsRequest, type RunBuildInToolsResponse, type RunBuildInToolsSuccessData, type RunCommandParams, type SearchLocalFilesParams, type SharedTokenState, type SkillCallParams, type SkillErrorResponse, type SkillProviderInfo, type SkillProviderStatus, type SkillTool, StatusEnumSchema, type SubmitFeedbackRequest, type SubmitFeedbackResponse, type SuccessResponse, type ToggleLikeResponse, type TrustedClientPayload, type UnclaimedPluginItem, type UpdateMemberAgent, type UpdateUserInfoRequest, type UpdateUserInfoResponse, type UserAgentGroupItem, type UserAgentItem, type UserInfoQuery, type UserInfoResponse, type UserProfile, VisibilityEnumSchema, type WriteLocalFileParams, buildTrustedClientPayload, createTrustedClientToken, generateNonce };
6729
+ export { type AccountMeta, type AdminListQueryParams, type AdminListResponse, type AdminPluginParams, type AgentCreateRequest, type AgentCreateResponse, type AgentDetailQuery, type AgentExtension, type AgentForkItem, type AgentForkRequest, type AgentForkResponse, type AgentForkSourceResponse, type AgentForksResponse, type AgentGroupCreateRequest, type AgentGroupCreateResponse, type AgentGroupDetail, type AgentGroupDetailQuery, type AgentGroupForkItem, type AgentGroupForkRequest, type AgentGroupForkResponse, type AgentGroupForkSourceResponse, type AgentGroupForksResponse, type AgentGroupItem, type AgentGroupListQuery, type AgentGroupListResponse, type AgentGroupModifyRequest, type AgentGroupModifyResponse, type AgentGroupStatus, type AgentGroupStatusChangeResponse, type AgentGroupVersionCreateRequest, type AgentGroupVersionCreateResponse, type AgentInstallCountRequest, type AgentInstallCountResponse, type AgentInterface, type AgentItemDetail, type AgentListQuery, type AgentListResponse, type AgentModifyRequest, type AgentModifyResponse, type AgentProfileEntity, type AgentProfileResponse, type AgentSecurityRequirement, type AgentSecurityScheme, type AgentSkill, type AgentStatus, type AgentStatusChangeResponse, type AgentUploadRequest, type AgentUploadResponse, type AgentUploadVersion, type AgentVersionCreateRequest, type AgentVersionCreateResponse, type AgentVersionLocalization, type AgentVersionModifyRequest, type AgentVersionModifyResponse, type AuthorizationCodeTokenRequest, type AuthorizeParams, type AuthorizeResponse, type CallSkillToolResponse, type CheckFavoriteQuery, type CheckFavoriteResponse, type CheckFollowQuery, type CheckFollowResponse, type CheckLikeQuery, type CheckLikeResponse, type ClientRegistrationError, type ClientRegistrationRequest, type ClientRegistrationResponse, type CodeInterpreterToolName, type CodeInterpreterToolParams, type ConnectProvider, type ConnectProviderDetail, type ConnectProviderScopes, type ConnectionHealth, type ConnectionStats, type CreateMemberAgent, type DiscoveryDocument, type EditLocalFileParams, type ExecuteCodeParams, type ExportFileParams, type FavoriteListResponse, type FavoriteQuery, type FavoriteRequest, type FeedbackClientInfo, type FollowListItem, type FollowListResponse, type FollowRequest, type GetAllConnectionsHealthResponse, type GetAuthorizeUrlParams, type GetCommandOutputParams, type GetConnectProviderResponse, type GetConnectionHealthResponse, type GetConnectionStatsResponse, type GetConnectionStatusResponse, type GetSkillStatusResponse, type GetSkillToolResponse, type GlobLocalFilesParams, type GrepContentParams, type InteractionTargetType, type KillCommandParams, type LikeListResponse, type LikeQuery, type LikeRequest, type ListConnectProvidersResponse, type ListConnectionsResponse, type ListLocalFilesParams, type ListSkillProvidersResponse, type ListSkillToolsResponse, MarketAPIError, MarketAdmin, type MarketReportGitHubSkillParams, type MarketReportGitHubSkillResponse, MarketSDK, type MarketSDKOptions, type MarketSkillAuthor, type MarketSkillCategory, type MarketSkillCategoryQuery, type MarketSkillDetail, type MarketSkillDetailQuery, type MarketSkillGitHubMeta, type MarketSkillListItem, type MarketSkillListQuery, type MarketSkillListResponse, type MarketSkillManifest, type MarketSkillResource, type MarketSkillVersionSummary, type MarketSkillVersionsResponse, type MemberAgent, type MoveLocalFilesParams, type MoveOperation, type OAuthConnection, type OAuthTokenResponse, type OwnAgentGroupListQuery, type OwnAgentListQuery, type PaginationQuery, type PluginI18nImportParams, type PluginI18nImportResponse, type PluginItem, type PluginListResponse, type PluginLocalization, type PluginQueryParams, type PluginUpdateParams, type PluginVersionCreateParams, type PluginVersionUpdateParams, type ProgrammingLanguage, type ReadLocalFileParams, type RefreshConnectionResponse, type RefreshTokenRequest, type RegisterUserRequest, type RegisterUserResponse, type RegisteredUserProfile, type RenameLocalFileParams, type ReviewStatus, ReviewStatusEnumSchema, type RevokeConnectionResponse, type RunBuildInToolsError, type RunBuildInToolsRequest, type RunBuildInToolsResponse, type RunBuildInToolsSuccessData, type RunCommandParams, type SearchLocalFilesParams, type SharedTokenState, type SkillCallParams, type SkillCommentAuthor, type SkillCommentItem, type SkillCommentListQuery, type SkillCommentListResponse, type SkillErrorResponse, type SkillProviderInfo, type SkillProviderStatus, type SkillRatingDistribution, type SkillTool, StatusEnumSchema, type SubmitFeedbackRequest, type SubmitFeedbackResponse, type SuccessResponse, type ToggleLikeResponse, type TrustedClientPayload, type UnclaimedPluginItem, type UpdateAgentProfileRequest, type UpdateAgentProfileResponse, type UpdateMemberAgent, type UpdateUserInfoRequest, type UpdateUserInfoResponse, type UserAgentGroupItem, type UserAgentItem, type UserInfoQuery, type UserInfoResponse, type UserProfile, VisibilityEnumSchema, type WriteLocalFileParams, buildTrustedClientPayload, createTrustedClientToken, generateNonce };