@lobehub/market-sdk 0.31.6 → 0.31.8
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 +264 -15
- package/dist/index.mjs +253 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1966,6 +1966,114 @@ interface CodeInterpreterToolParams {
|
|
|
1966
1966
|
searchLocalFiles: SearchLocalFilesParams;
|
|
1967
1967
|
writeLocalFile: WriteLocalFileParams;
|
|
1968
1968
|
}
|
|
1969
|
+
/**
|
|
1970
|
+
* Author information for a plugin comment
|
|
1971
|
+
*/
|
|
1972
|
+
interface PluginCommentAuthor {
|
|
1973
|
+
avatar?: string;
|
|
1974
|
+
background?: string | null;
|
|
1975
|
+
displayName?: string | null;
|
|
1976
|
+
id?: number;
|
|
1977
|
+
identifier?: string;
|
|
1978
|
+
sourceType?: string | null;
|
|
1979
|
+
tags?: string[];
|
|
1980
|
+
type: 'agent' | 'user';
|
|
1981
|
+
}
|
|
1982
|
+
/**
|
|
1983
|
+
* A single plugin comment item
|
|
1984
|
+
*/
|
|
1985
|
+
interface PluginCommentItem {
|
|
1986
|
+
author: PluginCommentAuthor | null;
|
|
1987
|
+
content: string;
|
|
1988
|
+
createdAt: string;
|
|
1989
|
+
downvotes: number;
|
|
1990
|
+
id: number;
|
|
1991
|
+
parentId: number | null;
|
|
1992
|
+
rating?: number;
|
|
1993
|
+
replyCount: number;
|
|
1994
|
+
updatedAt: string;
|
|
1995
|
+
upvotes: number;
|
|
1996
|
+
}
|
|
1997
|
+
/**
|
|
1998
|
+
* Created plugin comment entity
|
|
1999
|
+
*/
|
|
2000
|
+
interface PluginCommentCreateItem {
|
|
2001
|
+
agentId: number | null;
|
|
2002
|
+
content: string;
|
|
2003
|
+
createdAt: string;
|
|
2004
|
+
downvotes: number;
|
|
2005
|
+
id: number;
|
|
2006
|
+
parentId: number | null;
|
|
2007
|
+
pluginId: number;
|
|
2008
|
+
updatedAt: string;
|
|
2009
|
+
upvotes: number;
|
|
2010
|
+
userId: number | null;
|
|
2011
|
+
}
|
|
2012
|
+
/**
|
|
2013
|
+
* Rating payload returned when creating a comment with a score
|
|
2014
|
+
*/
|
|
2015
|
+
interface PluginCommentRating {
|
|
2016
|
+
score: number;
|
|
2017
|
+
}
|
|
2018
|
+
/**
|
|
2019
|
+
* Response returned by the create comment endpoint
|
|
2020
|
+
*/
|
|
2021
|
+
interface PluginCommentCreateResponse extends PluginCommentCreateItem {
|
|
2022
|
+
rating?: PluginCommentRating;
|
|
2023
|
+
}
|
|
2024
|
+
/**
|
|
2025
|
+
* Latest comment for the authenticated user/agent on a plugin
|
|
2026
|
+
*/
|
|
2027
|
+
interface PluginLatestOwnComment {
|
|
2028
|
+
createdAt: string;
|
|
2029
|
+
id: number;
|
|
2030
|
+
parentId: number | null;
|
|
2031
|
+
replyCount: number;
|
|
2032
|
+
}
|
|
2033
|
+
/**
|
|
2034
|
+
* Response returned by the delete comment endpoint
|
|
2035
|
+
*/
|
|
2036
|
+
interface PluginCommentDeleteResponse {
|
|
2037
|
+
success: boolean;
|
|
2038
|
+
}
|
|
2039
|
+
/**
|
|
2040
|
+
* Query parameters for listing plugin comments
|
|
2041
|
+
*/
|
|
2042
|
+
interface PluginCommentListQuery {
|
|
2043
|
+
order?: 'asc' | 'desc';
|
|
2044
|
+
page?: number;
|
|
2045
|
+
pageSize?: number;
|
|
2046
|
+
sort?: 'createdAt' | 'upvotes';
|
|
2047
|
+
}
|
|
2048
|
+
/**
|
|
2049
|
+
* Paginated response for plugin comments
|
|
2050
|
+
*/
|
|
2051
|
+
interface PluginCommentListResponse {
|
|
2052
|
+
currentPage: number;
|
|
2053
|
+
items: PluginCommentItem[];
|
|
2054
|
+
pageSize: number;
|
|
2055
|
+
totalCount: number;
|
|
2056
|
+
totalPages: number;
|
|
2057
|
+
}
|
|
2058
|
+
/**
|
|
2059
|
+
* Rating distribution counts by score (1-5)
|
|
2060
|
+
*/
|
|
2061
|
+
interface PluginRatingDistribution {
|
|
2062
|
+
1: number;
|
|
2063
|
+
2: number;
|
|
2064
|
+
3: number;
|
|
2065
|
+
4: number;
|
|
2066
|
+
5: number;
|
|
2067
|
+
totalCount: number;
|
|
2068
|
+
}
|
|
2069
|
+
/**
|
|
2070
|
+
* Reaction response type
|
|
2071
|
+
*/
|
|
2072
|
+
interface PluginCommentReactionResponse {
|
|
2073
|
+
commentId: number;
|
|
2074
|
+
id: number;
|
|
2075
|
+
type: string;
|
|
2076
|
+
}
|
|
1969
2077
|
|
|
1970
2078
|
/**
|
|
1971
2079
|
* Connect Types for LobeHub Market SDK
|
|
@@ -3050,10 +3158,12 @@ interface MarketSkillVersionsResponse {
|
|
|
3050
3158
|
* Author information for a skill comment
|
|
3051
3159
|
*/
|
|
3052
3160
|
interface SkillCommentAuthor {
|
|
3053
|
-
|
|
3161
|
+
avatar?: string;
|
|
3162
|
+
background?: string | null;
|
|
3054
3163
|
displayName?: string | null;
|
|
3055
|
-
id
|
|
3056
|
-
|
|
3164
|
+
id?: number;
|
|
3165
|
+
identifier?: string;
|
|
3166
|
+
sourceType?: string | null;
|
|
3057
3167
|
tags?: string[];
|
|
3058
3168
|
type: 'agent' | 'user';
|
|
3059
3169
|
}
|
|
@@ -3061,19 +3171,63 @@ interface SkillCommentAuthor {
|
|
|
3061
3171
|
* A single skill comment item
|
|
3062
3172
|
*/
|
|
3063
3173
|
interface SkillCommentItem {
|
|
3064
|
-
agentId: number | null;
|
|
3065
3174
|
author: SkillCommentAuthor | null;
|
|
3066
3175
|
content: string;
|
|
3067
3176
|
createdAt: string;
|
|
3068
3177
|
downvotes: number;
|
|
3069
3178
|
id: number;
|
|
3070
3179
|
parentId: number | null;
|
|
3180
|
+
rating?: number;
|
|
3071
3181
|
replyCount: number;
|
|
3182
|
+
updatedAt: string;
|
|
3183
|
+
upvotes: number;
|
|
3184
|
+
}
|
|
3185
|
+
/**
|
|
3186
|
+
* A single skill comment list item
|
|
3187
|
+
*/
|
|
3188
|
+
type SkillCommentListItem = SkillCommentItem;
|
|
3189
|
+
/**
|
|
3190
|
+
* Created skill comment entity
|
|
3191
|
+
*/
|
|
3192
|
+
interface SkillCommentCreateItem {
|
|
3193
|
+
agentId: number | null;
|
|
3194
|
+
content: string;
|
|
3195
|
+
createdAt: string;
|
|
3196
|
+
downvotes: number;
|
|
3197
|
+
id: number;
|
|
3198
|
+
parentId: number | null;
|
|
3072
3199
|
skillId: number;
|
|
3073
3200
|
updatedAt: string;
|
|
3074
3201
|
upvotes: number;
|
|
3075
3202
|
userId: number | null;
|
|
3076
3203
|
}
|
|
3204
|
+
/**
|
|
3205
|
+
* Rating payload returned when creating a comment with a score
|
|
3206
|
+
*/
|
|
3207
|
+
interface SkillCommentRating {
|
|
3208
|
+
score: number;
|
|
3209
|
+
}
|
|
3210
|
+
/**
|
|
3211
|
+
* Response returned by the create comment endpoint
|
|
3212
|
+
*/
|
|
3213
|
+
interface SkillCommentCreateResponse extends SkillCommentCreateItem {
|
|
3214
|
+
rating?: SkillCommentRating;
|
|
3215
|
+
}
|
|
3216
|
+
/**
|
|
3217
|
+
* Latest comment for the authenticated user/agent on a skill
|
|
3218
|
+
*/
|
|
3219
|
+
interface SkillLatestOwnComment {
|
|
3220
|
+
createdAt: string;
|
|
3221
|
+
id: number;
|
|
3222
|
+
parentId: number | null;
|
|
3223
|
+
replyCount: number;
|
|
3224
|
+
}
|
|
3225
|
+
/**
|
|
3226
|
+
* Response returned by the delete comment endpoint
|
|
3227
|
+
*/
|
|
3228
|
+
interface SkillCommentDeleteResponse {
|
|
3229
|
+
success: boolean;
|
|
3230
|
+
}
|
|
3077
3231
|
/**
|
|
3078
3232
|
* Query parameters for listing skill comments
|
|
3079
3233
|
*/
|
|
@@ -5886,6 +6040,93 @@ declare class PluginsService extends BaseSDK {
|
|
|
5886
6040
|
topicId: string;
|
|
5887
6041
|
userId: string;
|
|
5888
6042
|
}): Promise<RunBuildInToolsResponse>;
|
|
6043
|
+
/**
|
|
6044
|
+
* Submits or updates a rating for a plugin
|
|
6045
|
+
*
|
|
6046
|
+
* @param identifier - Unique plugin identifier
|
|
6047
|
+
* @param score - Rating score (1-5)
|
|
6048
|
+
* @param options - Optional request options
|
|
6049
|
+
* @returns Promise resolving to the submitted score
|
|
6050
|
+
*/
|
|
6051
|
+
submitRating(identifier: string, score: number, options?: globalThis.RequestInit): Promise<{
|
|
6052
|
+
score: number;
|
|
6053
|
+
}>;
|
|
6054
|
+
/**
|
|
6055
|
+
* Deletes the current user/agent's rating for a plugin
|
|
6056
|
+
*
|
|
6057
|
+
* @param identifier - Unique plugin identifier
|
|
6058
|
+
* @param options - Optional request options
|
|
6059
|
+
* @returns Promise resolving to success status
|
|
6060
|
+
*/
|
|
6061
|
+
deleteRating(identifier: string, options?: globalThis.RequestInit): Promise<{
|
|
6062
|
+
success: boolean;
|
|
6063
|
+
}>;
|
|
6064
|
+
/**
|
|
6065
|
+
* Gets the rating distribution for a plugin
|
|
6066
|
+
*
|
|
6067
|
+
* @param identifier - Unique plugin identifier
|
|
6068
|
+
* @param options - Optional request options
|
|
6069
|
+
* @returns Promise resolving to the rating distribution
|
|
6070
|
+
*/
|
|
6071
|
+
getRatingDistribution(identifier: string, options?: globalThis.RequestInit): Promise<PluginRatingDistribution>;
|
|
6072
|
+
/**
|
|
6073
|
+
* Gets paginated comments for a plugin
|
|
6074
|
+
*
|
|
6075
|
+
* @param identifier - Unique plugin identifier
|
|
6076
|
+
* @param params - Query parameters for pagination and sorting
|
|
6077
|
+
* @param options - Optional request options
|
|
6078
|
+
* @returns Promise resolving to the paginated comment list
|
|
6079
|
+
*/
|
|
6080
|
+
getComments(identifier: string, params?: PluginCommentListQuery, options?: globalThis.RequestInit): Promise<PluginCommentListResponse>;
|
|
6081
|
+
/**
|
|
6082
|
+
* Gets the latest comment for the authenticated user or agent on a plugin
|
|
6083
|
+
*
|
|
6084
|
+
* @param identifier - Unique plugin identifier
|
|
6085
|
+
* @param options - Optional request options
|
|
6086
|
+
* @returns Promise resolving to the latest own comment or null when none exists
|
|
6087
|
+
*/
|
|
6088
|
+
getLatestOwnComment(identifier: string, options?: globalThis.RequestInit): Promise<PluginLatestOwnComment | null>;
|
|
6089
|
+
/**
|
|
6090
|
+
* Creates a comment on a plugin, optionally with a rating
|
|
6091
|
+
*
|
|
6092
|
+
* @param identifier - Unique plugin identifier
|
|
6093
|
+
* @param data - Comment data with content, optional score, and optional parentId
|
|
6094
|
+
* @param options - Optional request options
|
|
6095
|
+
* @returns Promise resolving to the created comment (with optional rating field)
|
|
6096
|
+
*/
|
|
6097
|
+
createComment(identifier: string, data: {
|
|
6098
|
+
content: string;
|
|
6099
|
+
parentId?: number;
|
|
6100
|
+
score?: number;
|
|
6101
|
+
}, options?: globalThis.RequestInit): Promise<PluginCommentCreateResponse>;
|
|
6102
|
+
/**
|
|
6103
|
+
* Deletes a comment from a plugin
|
|
6104
|
+
*
|
|
6105
|
+
* @param identifier - Unique plugin identifier
|
|
6106
|
+
* @param commentId - Comment ID to delete
|
|
6107
|
+
* @param options - Optional request options
|
|
6108
|
+
* @returns Promise resolving to success status
|
|
6109
|
+
*/
|
|
6110
|
+
deleteComment(identifier: string, commentId: number, options?: globalThis.RequestInit): Promise<PluginCommentDeleteResponse>;
|
|
6111
|
+
/**
|
|
6112
|
+
* Adds or updates a reaction on a comment
|
|
6113
|
+
*
|
|
6114
|
+
* @param commentId - Comment ID to react to
|
|
6115
|
+
* @param type - Reaction type ('upvote' or 'downvote')
|
|
6116
|
+
* @param options - Optional request options
|
|
6117
|
+
* @returns Promise resolving to the created reaction
|
|
6118
|
+
*/
|
|
6119
|
+
addReaction(commentId: number, type: 'downvote' | 'upvote', options?: globalThis.RequestInit): Promise<PluginCommentReactionResponse>;
|
|
6120
|
+
/**
|
|
6121
|
+
* Removes a reaction from a comment
|
|
6122
|
+
*
|
|
6123
|
+
* @param commentId - Comment ID to remove reaction from
|
|
6124
|
+
* @param options - Optional request options
|
|
6125
|
+
* @returns Promise resolving to success status
|
|
6126
|
+
*/
|
|
6127
|
+
removeReaction(commentId: number, options?: globalThis.RequestInit): Promise<{
|
|
6128
|
+
success: boolean;
|
|
6129
|
+
}>;
|
|
5889
6130
|
}
|
|
5890
6131
|
|
|
5891
6132
|
/**
|
|
@@ -6240,6 +6481,14 @@ declare class MarketSkillService extends BaseSDK {
|
|
|
6240
6481
|
* @returns Promise resolving to the paginated comment list
|
|
6241
6482
|
*/
|
|
6242
6483
|
getComments(identifier: string, params?: SkillCommentListQuery, options?: globalThis.RequestInit): Promise<SkillCommentListResponse>;
|
|
6484
|
+
/**
|
|
6485
|
+
* Gets the latest comment for the authenticated user or agent on a skill
|
|
6486
|
+
*
|
|
6487
|
+
* @param identifier - Unique skill identifier
|
|
6488
|
+
* @param options - Optional request options
|
|
6489
|
+
* @returns Promise resolving to the latest own comment or null when none exists
|
|
6490
|
+
*/
|
|
6491
|
+
getLatestOwnComment(identifier: string, options?: globalThis.RequestInit): Promise<SkillLatestOwnComment | null>;
|
|
6243
6492
|
/**
|
|
6244
6493
|
* Creates a comment on a skill, optionally with a rating
|
|
6245
6494
|
*
|
|
@@ -6251,11 +6500,16 @@ declare class MarketSkillService extends BaseSDK {
|
|
|
6251
6500
|
createComment(identifier: string, data: {
|
|
6252
6501
|
content: string;
|
|
6253
6502
|
score?: number;
|
|
6254
|
-
}, options?: globalThis.RequestInit): Promise<
|
|
6255
|
-
|
|
6256
|
-
|
|
6257
|
-
|
|
6258
|
-
|
|
6503
|
+
}, options?: globalThis.RequestInit): Promise<SkillCommentCreateResponse>;
|
|
6504
|
+
/**
|
|
6505
|
+
* Deletes a comment from a skill
|
|
6506
|
+
*
|
|
6507
|
+
* @param identifier - Unique skill identifier
|
|
6508
|
+
* @param commentId - Comment ID to delete
|
|
6509
|
+
* @param options - Optional request options
|
|
6510
|
+
* @returns Promise resolving to success status
|
|
6511
|
+
*/
|
|
6512
|
+
deleteComment(identifier: string, commentId: number, options?: globalThis.RequestInit): Promise<SkillCommentDeleteResponse>;
|
|
6259
6513
|
/**
|
|
6260
6514
|
* Adds or updates a reaction on a comment
|
|
6261
6515
|
*
|
|
@@ -6718,11 +6972,6 @@ declare class MarketSDK extends BaseSDK {
|
|
|
6718
6972
|
registerClient(request: ClientRegistrationRequest): Promise<ClientRegistrationResponse>;
|
|
6719
6973
|
}
|
|
6720
6974
|
|
|
6721
|
-
/**
|
|
6722
|
-
* Market API Error
|
|
6723
|
-
*
|
|
6724
|
-
* Custom error class for Market API errors that preserves the structured error response.
|
|
6725
|
-
*/
|
|
6726
6975
|
declare class MarketAPIError extends Error {
|
|
6727
6976
|
/** HTTP status code */
|
|
6728
6977
|
readonly status: number;
|
|
@@ -6830,4 +7079,4 @@ declare function buildTrustedClientPayload(params: {
|
|
|
6830
7079
|
userId: string;
|
|
6831
7080
|
}): TrustedClientPayload;
|
|
6832
7081
|
|
|
6833
|
-
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, type MarketReportSkillInstallParams, type MarketReportSkillInstallResponse, 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, SDK_USER_AGENT, SDK_VERSION, 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 };
|
|
7082
|
+
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, type MarketReportSkillInstallParams, type MarketReportSkillInstallResponse, 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 PluginCommentAuthor, type PluginCommentCreateItem, type PluginCommentCreateResponse, type PluginCommentDeleteResponse, type PluginCommentItem, type PluginCommentListQuery, type PluginCommentListResponse, type PluginCommentRating, type PluginCommentReactionResponse, type PluginI18nImportParams, type PluginI18nImportResponse, type PluginItem, type PluginLatestOwnComment, type PluginListResponse, type PluginLocalization, type PluginQueryParams, type PluginRatingDistribution, type PluginUpdateParams, type PluginVersionCreateParams, type PluginVersionUpdateParams, type ProgrammingLanguage, type ReadLocalFileParams, type RefreshConnectionResponse, type RefreshTokenRequest, type RegisterUserRequest, type RegisterUserResponse, type RegisteredUserProfile, type RenameLocalFileParams, type ReviewStatus, ReviewStatusEnumSchema, type RevokeConnectionResponse, type RunBuildInToolsError, type RunBuildInToolsRequest, type RunBuildInToolsResponse, type RunBuildInToolsSuccessData, type RunCommandParams, SDK_USER_AGENT, SDK_VERSION, type SearchLocalFilesParams, type SharedTokenState, type SkillCallParams, type SkillCommentAuthor, type SkillCommentCreateItem, type SkillCommentCreateResponse, type SkillCommentDeleteResponse, type SkillCommentItem, type SkillCommentListItem, type SkillCommentListQuery, type SkillCommentListResponse, type SkillCommentRating, type SkillErrorResponse, type SkillLatestOwnComment, type SkillProviderInfo, type SkillProviderStatus, type SkillRatingDistribution, type SkillTool, StatusEnumSchema, type SubmitFeedbackRequest, type SubmitFeedbackResponse, type SuccessResponse, type ToggleLikeResponse, type TrustedClientPayload, type UnclaimedPluginItem, type UpdateAgentProfileRequest, type UpdateAgentProfileResponse, type UpdateMemberAgent, type UpdateUserInfoRequest, type UpdateUserInfoResponse, type UserAgentGroupItem, type UserAgentItem, type UserInfoQuery, type UserInfoResponse, type UserProfile, VisibilityEnumSchema, type WriteLocalFileParams, buildTrustedClientPayload, createTrustedClientToken, generateNonce };
|
package/dist/index.mjs
CHANGED
|
@@ -7,11 +7,30 @@ import { SignJWT } from "jose";
|
|
|
7
7
|
import urlJoin from "url-join";
|
|
8
8
|
|
|
9
9
|
// src/core/MarketAPIError.ts
|
|
10
|
+
var normalizeErrorDetails = (errorBody) => {
|
|
11
|
+
if (!errorBody) return void 0;
|
|
12
|
+
if (typeof errorBody.error === "object" && errorBody.error !== null) {
|
|
13
|
+
return errorBody.error;
|
|
14
|
+
}
|
|
15
|
+
if (typeof errorBody.error === "string") {
|
|
16
|
+
return {
|
|
17
|
+
...errorBody.code ? { code: errorBody.code } : {},
|
|
18
|
+
message: errorBody.error
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
if (typeof errorBody.message === "string") {
|
|
22
|
+
return {
|
|
23
|
+
...errorBody.code ? { code: errorBody.code } : {},
|
|
24
|
+
message: errorBody.message
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
return void 0;
|
|
28
|
+
};
|
|
10
29
|
var MarketAPIError = class _MarketAPIError extends Error {
|
|
11
30
|
constructor(status, statusText, errorBody) {
|
|
12
|
-
|
|
13
|
-
const errorCode =
|
|
14
|
-
const errorMessage =
|
|
31
|
+
const errorDetails = normalizeErrorDetails(errorBody);
|
|
32
|
+
const errorCode = errorDetails == null ? void 0 : errorDetails.code;
|
|
33
|
+
const errorMessage = errorDetails == null ? void 0 : errorDetails.message;
|
|
15
34
|
const message = errorMessage || statusText;
|
|
16
35
|
super(message);
|
|
17
36
|
this.name = "MarketAPIError";
|
|
@@ -32,8 +51,7 @@ var MarketAPIError = class _MarketAPIError extends Error {
|
|
|
32
51
|
* Get the full error details from the API response
|
|
33
52
|
*/
|
|
34
53
|
getErrorDetails() {
|
|
35
|
-
|
|
36
|
-
return (_a = this.errorBody) == null ? void 0 : _a.error;
|
|
54
|
+
return normalizeErrorDetails(this.errorBody);
|
|
37
55
|
}
|
|
38
56
|
/**
|
|
39
57
|
* Convert to a plain object for logging or serialization
|
|
@@ -3396,6 +3414,196 @@ var PluginsService = class extends BaseSDK {
|
|
|
3396
3414
|
async exportFile(path, uploadUrl, context) {
|
|
3397
3415
|
return this.runBuildInTool("exportFile", { path, uploadUrl }, context);
|
|
3398
3416
|
}
|
|
3417
|
+
// ============================================================================
|
|
3418
|
+
// Rating Methods
|
|
3419
|
+
// ============================================================================
|
|
3420
|
+
/**
|
|
3421
|
+
* Submits or updates a rating for a plugin
|
|
3422
|
+
*
|
|
3423
|
+
* @param identifier - Unique plugin identifier
|
|
3424
|
+
* @param score - Rating score (1-5)
|
|
3425
|
+
* @param options - Optional request options
|
|
3426
|
+
* @returns Promise resolving to the submitted score
|
|
3427
|
+
*/
|
|
3428
|
+
async submitRating(identifier, score, options) {
|
|
3429
|
+
log17("Submitting rating for plugin %s: %d", identifier, score);
|
|
3430
|
+
const result = await this.request(
|
|
3431
|
+
`/v1/plugins/${encodeURIComponent(identifier)}/ratings`,
|
|
3432
|
+
{
|
|
3433
|
+
...options,
|
|
3434
|
+
body: JSON.stringify({ score }),
|
|
3435
|
+
method: "POST"
|
|
3436
|
+
}
|
|
3437
|
+
);
|
|
3438
|
+
log17("Rating submitted for plugin %s: %d", identifier, result.score);
|
|
3439
|
+
return result;
|
|
3440
|
+
}
|
|
3441
|
+
/**
|
|
3442
|
+
* Deletes the current user/agent's rating for a plugin
|
|
3443
|
+
*
|
|
3444
|
+
* @param identifier - Unique plugin identifier
|
|
3445
|
+
* @param options - Optional request options
|
|
3446
|
+
* @returns Promise resolving to success status
|
|
3447
|
+
*/
|
|
3448
|
+
async deleteRating(identifier, options) {
|
|
3449
|
+
log17("Deleting rating for plugin %s", identifier);
|
|
3450
|
+
const result = await this.request(
|
|
3451
|
+
`/v1/plugins/${encodeURIComponent(identifier)}/ratings`,
|
|
3452
|
+
{
|
|
3453
|
+
...options,
|
|
3454
|
+
method: "DELETE"
|
|
3455
|
+
}
|
|
3456
|
+
);
|
|
3457
|
+
log17("Rating deleted for plugin %s", identifier);
|
|
3458
|
+
return result;
|
|
3459
|
+
}
|
|
3460
|
+
/**
|
|
3461
|
+
* Gets the rating distribution for a plugin
|
|
3462
|
+
*
|
|
3463
|
+
* @param identifier - Unique plugin identifier
|
|
3464
|
+
* @param options - Optional request options
|
|
3465
|
+
* @returns Promise resolving to the rating distribution
|
|
3466
|
+
*/
|
|
3467
|
+
async getRatingDistribution(identifier, options) {
|
|
3468
|
+
log17("Getting rating distribution for plugin: %s", identifier);
|
|
3469
|
+
const result = await this.request(
|
|
3470
|
+
`/v1/plugins/${encodeURIComponent(identifier)}/ratings/distribution`,
|
|
3471
|
+
options
|
|
3472
|
+
);
|
|
3473
|
+
log17("Rating distribution retrieved for plugin %s: %d total", identifier, result.totalCount);
|
|
3474
|
+
return result;
|
|
3475
|
+
}
|
|
3476
|
+
// ============================================================================
|
|
3477
|
+
// Comment Methods
|
|
3478
|
+
// ============================================================================
|
|
3479
|
+
/**
|
|
3480
|
+
* Gets paginated comments for a plugin
|
|
3481
|
+
*
|
|
3482
|
+
* @param identifier - Unique plugin identifier
|
|
3483
|
+
* @param params - Query parameters for pagination and sorting
|
|
3484
|
+
* @param options - Optional request options
|
|
3485
|
+
* @returns Promise resolving to the paginated comment list
|
|
3486
|
+
*/
|
|
3487
|
+
async getComments(identifier, params = {}, options) {
|
|
3488
|
+
const queryString = this.buildQueryString(params);
|
|
3489
|
+
log17("Getting comments for plugin %s: %O", identifier, params);
|
|
3490
|
+
const result = await this.request(
|
|
3491
|
+
`/v1/plugins/${encodeURIComponent(identifier)}/comments${queryString}`,
|
|
3492
|
+
options
|
|
3493
|
+
);
|
|
3494
|
+
log17(
|
|
3495
|
+
"Retrieved %d comments for plugin %s (page %d/%d)",
|
|
3496
|
+
result.items.length,
|
|
3497
|
+
identifier,
|
|
3498
|
+
result.currentPage,
|
|
3499
|
+
result.totalPages
|
|
3500
|
+
);
|
|
3501
|
+
return result;
|
|
3502
|
+
}
|
|
3503
|
+
/**
|
|
3504
|
+
* Gets the latest comment for the authenticated user or agent on a plugin
|
|
3505
|
+
*
|
|
3506
|
+
* @param identifier - Unique plugin identifier
|
|
3507
|
+
* @param options - Optional request options
|
|
3508
|
+
* @returns Promise resolving to the latest own comment or null when none exists
|
|
3509
|
+
*/
|
|
3510
|
+
async getLatestOwnComment(identifier, options) {
|
|
3511
|
+
log17("Getting latest own comment for plugin %s", identifier);
|
|
3512
|
+
const result = await this.request(
|
|
3513
|
+
`/v1/plugins/${encodeURIComponent(identifier)}/comments/latest`,
|
|
3514
|
+
options
|
|
3515
|
+
);
|
|
3516
|
+
if (result) {
|
|
3517
|
+
log17("Retrieved latest own comment for plugin %s: id=%d", identifier, result.id);
|
|
3518
|
+
} else {
|
|
3519
|
+
log17("No own comments found for plugin %s", identifier);
|
|
3520
|
+
}
|
|
3521
|
+
return result;
|
|
3522
|
+
}
|
|
3523
|
+
/**
|
|
3524
|
+
* Creates a comment on a plugin, optionally with a rating
|
|
3525
|
+
*
|
|
3526
|
+
* @param identifier - Unique plugin identifier
|
|
3527
|
+
* @param data - Comment data with content, optional score, and optional parentId
|
|
3528
|
+
* @param options - Optional request options
|
|
3529
|
+
* @returns Promise resolving to the created comment (with optional rating field)
|
|
3530
|
+
*/
|
|
3531
|
+
async createComment(identifier, data, options) {
|
|
3532
|
+
log17("Creating comment on plugin %s", identifier);
|
|
3533
|
+
const result = await this.request(
|
|
3534
|
+
`/v1/plugins/${encodeURIComponent(identifier)}/comments`,
|
|
3535
|
+
{
|
|
3536
|
+
...options,
|
|
3537
|
+
body: JSON.stringify(data),
|
|
3538
|
+
method: "POST"
|
|
3539
|
+
}
|
|
3540
|
+
);
|
|
3541
|
+
log17("Comment created on plugin %s: id=%d", identifier, result.id);
|
|
3542
|
+
return result;
|
|
3543
|
+
}
|
|
3544
|
+
/**
|
|
3545
|
+
* Deletes a comment from a plugin
|
|
3546
|
+
*
|
|
3547
|
+
* @param identifier - Unique plugin identifier
|
|
3548
|
+
* @param commentId - Comment ID to delete
|
|
3549
|
+
* @param options - Optional request options
|
|
3550
|
+
* @returns Promise resolving to success status
|
|
3551
|
+
*/
|
|
3552
|
+
async deleteComment(identifier, commentId, options) {
|
|
3553
|
+
log17("Deleting comment %d from plugin %s", commentId, identifier);
|
|
3554
|
+
const result = await this.request(
|
|
3555
|
+
`/v1/plugins/${encodeURIComponent(identifier)}/comments/${commentId}`,
|
|
3556
|
+
{
|
|
3557
|
+
...options,
|
|
3558
|
+
method: "DELETE"
|
|
3559
|
+
}
|
|
3560
|
+
);
|
|
3561
|
+
log17("Comment %d deleted from plugin %s", commentId, identifier);
|
|
3562
|
+
return result;
|
|
3563
|
+
}
|
|
3564
|
+
// ============================================================================
|
|
3565
|
+
// Reaction Methods
|
|
3566
|
+
// ============================================================================
|
|
3567
|
+
/**
|
|
3568
|
+
* Adds or updates a reaction on a comment
|
|
3569
|
+
*
|
|
3570
|
+
* @param commentId - Comment ID to react to
|
|
3571
|
+
* @param type - Reaction type ('upvote' or 'downvote')
|
|
3572
|
+
* @param options - Optional request options
|
|
3573
|
+
* @returns Promise resolving to the created reaction
|
|
3574
|
+
*/
|
|
3575
|
+
async addReaction(commentId, type, options) {
|
|
3576
|
+
log17("Adding %s reaction to comment %d", type, commentId);
|
|
3577
|
+
const result = await this.request(
|
|
3578
|
+
`/v1/plugins/comments/${commentId}/reactions`,
|
|
3579
|
+
{
|
|
3580
|
+
...options,
|
|
3581
|
+
body: JSON.stringify({ type }),
|
|
3582
|
+
method: "POST"
|
|
3583
|
+
}
|
|
3584
|
+
);
|
|
3585
|
+
log17("Reaction added to comment %d: %s (id=%d)", commentId, result.type, result.id);
|
|
3586
|
+
return result;
|
|
3587
|
+
}
|
|
3588
|
+
/**
|
|
3589
|
+
* Removes a reaction from a comment
|
|
3590
|
+
*
|
|
3591
|
+
* @param commentId - Comment ID to remove reaction from
|
|
3592
|
+
* @param options - Optional request options
|
|
3593
|
+
* @returns Promise resolving to success status
|
|
3594
|
+
*/
|
|
3595
|
+
async removeReaction(commentId, options) {
|
|
3596
|
+
log17("Removing reaction from comment %d", commentId);
|
|
3597
|
+
const result = await this.request(
|
|
3598
|
+
`/v1/plugins/comments/${commentId}/reactions`,
|
|
3599
|
+
{
|
|
3600
|
+
...options,
|
|
3601
|
+
method: "DELETE"
|
|
3602
|
+
}
|
|
3603
|
+
);
|
|
3604
|
+
log17("Reaction removed from comment %d", commentId);
|
|
3605
|
+
return result;
|
|
3606
|
+
}
|
|
3399
3607
|
};
|
|
3400
3608
|
|
|
3401
3609
|
// src/market/services/SkillService.ts
|
|
@@ -3942,6 +4150,26 @@ var MarketSkillService = class extends BaseSDK {
|
|
|
3942
4150
|
);
|
|
3943
4151
|
return result;
|
|
3944
4152
|
}
|
|
4153
|
+
/**
|
|
4154
|
+
* Gets the latest comment for the authenticated user or agent on a skill
|
|
4155
|
+
*
|
|
4156
|
+
* @param identifier - Unique skill identifier
|
|
4157
|
+
* @param options - Optional request options
|
|
4158
|
+
* @returns Promise resolving to the latest own comment or null when none exists
|
|
4159
|
+
*/
|
|
4160
|
+
async getLatestOwnComment(identifier, options) {
|
|
4161
|
+
log19("Getting latest own comment for skill %s", identifier);
|
|
4162
|
+
const result = await this.request(
|
|
4163
|
+
`/v1/skills/${encodeURIComponent(identifier)}/comments/latest`,
|
|
4164
|
+
options
|
|
4165
|
+
);
|
|
4166
|
+
if (result) {
|
|
4167
|
+
log19("Retrieved latest own comment for skill %s: id=%d", identifier, result.id);
|
|
4168
|
+
} else {
|
|
4169
|
+
log19("No own comments found for skill %s", identifier);
|
|
4170
|
+
}
|
|
4171
|
+
return result;
|
|
4172
|
+
}
|
|
3945
4173
|
/**
|
|
3946
4174
|
* Creates a comment on a skill, optionally with a rating
|
|
3947
4175
|
*
|
|
@@ -3963,6 +4191,26 @@ var MarketSkillService = class extends BaseSDK {
|
|
|
3963
4191
|
log19("Comment created on skill %s: id=%d", identifier, result.id);
|
|
3964
4192
|
return result;
|
|
3965
4193
|
}
|
|
4194
|
+
/**
|
|
4195
|
+
* Deletes a comment from a skill
|
|
4196
|
+
*
|
|
4197
|
+
* @param identifier - Unique skill identifier
|
|
4198
|
+
* @param commentId - Comment ID to delete
|
|
4199
|
+
* @param options - Optional request options
|
|
4200
|
+
* @returns Promise resolving to success status
|
|
4201
|
+
*/
|
|
4202
|
+
async deleteComment(identifier, commentId, options) {
|
|
4203
|
+
log19("Deleting comment %d from skill %s", commentId, identifier);
|
|
4204
|
+
const result = await this.request(
|
|
4205
|
+
`/v1/skills/${encodeURIComponent(identifier)}/comments/${commentId}`,
|
|
4206
|
+
{
|
|
4207
|
+
...options,
|
|
4208
|
+
method: "DELETE"
|
|
4209
|
+
}
|
|
4210
|
+
);
|
|
4211
|
+
log19("Comment %d deleted from skill %s", commentId, identifier);
|
|
4212
|
+
return result;
|
|
4213
|
+
}
|
|
3966
4214
|
/**
|
|
3967
4215
|
* Adds or updates a reaction on a comment
|
|
3968
4216
|
*
|