@lobehub/market-sdk 0.31.1 → 0.31.3
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 +91 -1
- package/dist/index.mjs +44 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -1560,6 +1560,20 @@ interface MarketSDKOptions {
|
|
|
1560
1560
|
* ```
|
|
1561
1561
|
*/
|
|
1562
1562
|
trustedClientToken?: string;
|
|
1563
|
+
/**
|
|
1564
|
+
* Custom User-Agent string for identifying the client.
|
|
1565
|
+
*
|
|
1566
|
+
* If provided, this will be used instead of the default SDK User-Agent.
|
|
1567
|
+
* Useful for CLI tools or other clients that want to identify themselves.
|
|
1568
|
+
*
|
|
1569
|
+
* @example
|
|
1570
|
+
* ```typescript
|
|
1571
|
+
* const sdk = new MarketSDK({
|
|
1572
|
+
* userAgent: 'LobeHub-Market-CLI/1.0.0',
|
|
1573
|
+
* });
|
|
1574
|
+
* ```
|
|
1575
|
+
*/
|
|
1576
|
+
userAgent?: string;
|
|
1563
1577
|
}
|
|
1564
1578
|
/**
|
|
1565
1579
|
* Shared token state for SDK instances
|
|
@@ -2587,6 +2601,10 @@ interface MarketSkillListItem {
|
|
|
2587
2601
|
* Category
|
|
2588
2602
|
*/
|
|
2589
2603
|
category?: string;
|
|
2604
|
+
/**
|
|
2605
|
+
* Number of comments
|
|
2606
|
+
*/
|
|
2607
|
+
commentCount: number;
|
|
2590
2608
|
/**
|
|
2591
2609
|
* Creation timestamp (ISO string)
|
|
2592
2610
|
*/
|
|
@@ -2964,10 +2982,18 @@ interface MarketReportGitHubSkillResponse {
|
|
|
2964
2982
|
* Skill identifier
|
|
2965
2983
|
*/
|
|
2966
2984
|
identifier: string;
|
|
2985
|
+
/**
|
|
2986
|
+
* Skill identifiers (present when reporting a repository with multiple skills)
|
|
2987
|
+
*/
|
|
2988
|
+
identifiers?: string[];
|
|
2967
2989
|
/**
|
|
2968
2990
|
* Status message
|
|
2969
2991
|
*/
|
|
2970
2992
|
message: string;
|
|
2993
|
+
/**
|
|
2994
|
+
* Number of queued imports
|
|
2995
|
+
*/
|
|
2996
|
+
queuedCount?: number;
|
|
2971
2997
|
/**
|
|
2972
2998
|
* Status of the report
|
|
2973
2999
|
* - 'queued': Import request has been queued
|
|
@@ -2975,6 +3001,36 @@ interface MarketReportGitHubSkillResponse {
|
|
|
2975
3001
|
*/
|
|
2976
3002
|
status: 'exists' | 'queued';
|
|
2977
3003
|
}
|
|
3004
|
+
/**
|
|
3005
|
+
* Parameters for reporting a skill installation
|
|
3006
|
+
*/
|
|
3007
|
+
interface MarketReportSkillInstallParams {
|
|
3008
|
+
/** Error code if installation failed */
|
|
3009
|
+
errorCode?: string;
|
|
3010
|
+
/** Error message if installation failed */
|
|
3011
|
+
errorMessage?: string;
|
|
3012
|
+
/** Skill identifier */
|
|
3013
|
+
identifier: string;
|
|
3014
|
+
/** Installation duration in milliseconds */
|
|
3015
|
+
installDurationMs: number;
|
|
3016
|
+
/** Additional metadata */
|
|
3017
|
+
metadata?: Record<string, any>;
|
|
3018
|
+
/** Platform information */
|
|
3019
|
+
platform?: string;
|
|
3020
|
+
/** Whether the installation was successful */
|
|
3021
|
+
success: boolean;
|
|
3022
|
+
/** Skill version (optional, omit = latest) */
|
|
3023
|
+
version?: string;
|
|
3024
|
+
}
|
|
3025
|
+
/**
|
|
3026
|
+
* Response from reporting a skill installation
|
|
3027
|
+
*/
|
|
3028
|
+
interface MarketReportSkillInstallResponse {
|
|
3029
|
+
/** Message about the processing result */
|
|
3030
|
+
message: string;
|
|
3031
|
+
/** Whether the report was successfully recorded */
|
|
3032
|
+
success: boolean;
|
|
3033
|
+
}
|
|
2978
3034
|
/**
|
|
2979
3035
|
* Response for skill versions list
|
|
2980
3036
|
*/
|
|
@@ -6127,6 +6183,28 @@ declare class MarketSkillService extends BaseSDK {
|
|
|
6127
6183
|
* ```
|
|
6128
6184
|
*/
|
|
6129
6185
|
reportGitHubSkill(params: MarketReportGitHubSkillParams, options?: globalThis.RequestInit): Promise<MarketReportGitHubSkillResponse>;
|
|
6186
|
+
/**
|
|
6187
|
+
* Reports a skill installation attempt
|
|
6188
|
+
*
|
|
6189
|
+
* Submits installation telemetry data including success/failure status,
|
|
6190
|
+
* duration, and optional error information. Used by the CLI after
|
|
6191
|
+
* downloading and extracting a skill package.
|
|
6192
|
+
*
|
|
6193
|
+
* @param params - Installation report parameters
|
|
6194
|
+
* @param options - Optional request options
|
|
6195
|
+
* @returns Promise resolving to the report response
|
|
6196
|
+
*
|
|
6197
|
+
* @example
|
|
6198
|
+
* ```typescript
|
|
6199
|
+
* await sdk.marketSkills.reportSkillInstall({
|
|
6200
|
+
* identifier: 'github.owner.repo',
|
|
6201
|
+
* success: true,
|
|
6202
|
+
* installDurationMs: 1234,
|
|
6203
|
+
* platform: 'darwin-arm64',
|
|
6204
|
+
* });
|
|
6205
|
+
* ```
|
|
6206
|
+
*/
|
|
6207
|
+
reportSkillInstall(params: MarketReportSkillInstallParams, options?: globalThis.RequestInit): Promise<MarketReportSkillInstallResponse>;
|
|
6130
6208
|
/**
|
|
6131
6209
|
* Submits or updates a rating for a skill
|
|
6132
6210
|
*
|
|
@@ -6660,6 +6738,18 @@ declare class MarketAPIError extends Error {
|
|
|
6660
6738
|
toJSON(): any;
|
|
6661
6739
|
}
|
|
6662
6740
|
|
|
6741
|
+
/**
|
|
6742
|
+
* SDK Version
|
|
6743
|
+
*
|
|
6744
|
+
* This version should be kept in sync with package.json version.
|
|
6745
|
+
* It is used for User-Agent header to identify SDK requests.
|
|
6746
|
+
*/
|
|
6747
|
+
declare const SDK_VERSION = "0.31.3";
|
|
6748
|
+
/**
|
|
6749
|
+
* SDK User-Agent string
|
|
6750
|
+
*/
|
|
6751
|
+
declare const SDK_USER_AGENT = "LobeHub-Market-SDK/0.31.3";
|
|
6752
|
+
|
|
6663
6753
|
/**
|
|
6664
6754
|
* Trusted Client Token Utilities
|
|
6665
6755
|
*
|
|
@@ -6733,4 +6823,4 @@ declare function buildTrustedClientPayload(params: {
|
|
|
6733
6823
|
userId: string;
|
|
6734
6824
|
}): TrustedClientPayload;
|
|
6735
6825
|
|
|
6736
|
-
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 };
|
|
6826
|
+
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 };
|
package/dist/index.mjs
CHANGED
|
@@ -49,6 +49,10 @@ var MarketAPIError = class _MarketAPIError extends Error {
|
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
51
|
|
|
52
|
+
// src/core/version.ts
|
|
53
|
+
var SDK_VERSION = "0.31.3";
|
|
54
|
+
var SDK_USER_AGENT = `LobeHub-Market-SDK/${SDK_VERSION}`;
|
|
55
|
+
|
|
52
56
|
// src/core/BaseSDK.ts
|
|
53
57
|
var log = debug("lobe-market-sdk:core");
|
|
54
58
|
var BaseSDK = class {
|
|
@@ -69,14 +73,16 @@ var BaseSDK = class {
|
|
|
69
73
|
this.clientSecret = options.clientSecret;
|
|
70
74
|
this.sharedTokenState = sharedTokenState;
|
|
71
75
|
const apiKey = options.apiKey || process.env.MARKET_API_KEY;
|
|
76
|
+
const userAgent = options.userAgent || SDK_USER_AGENT;
|
|
72
77
|
if (sharedHeaders) {
|
|
73
78
|
this.headers = sharedHeaders;
|
|
74
79
|
log("Using shared headers object");
|
|
75
80
|
} else {
|
|
76
81
|
this.headers = {
|
|
77
|
-
"Content-Type": "application/json"
|
|
82
|
+
"Content-Type": "application/json",
|
|
83
|
+
"User-Agent": userAgent
|
|
78
84
|
};
|
|
79
|
-
log("Created new headers object");
|
|
85
|
+
log("Created new headers object with User-Agent: %s", userAgent);
|
|
80
86
|
}
|
|
81
87
|
if (apiKey) {
|
|
82
88
|
this.headers.Authorization = `Bearer ${apiKey}`;
|
|
@@ -3841,6 +3847,40 @@ var MarketSkillService = class extends BaseSDK {
|
|
|
3841
3847
|
log19("GitHub skill reported: %s (status: %s)", result.identifier, result.status);
|
|
3842
3848
|
return result;
|
|
3843
3849
|
}
|
|
3850
|
+
/**
|
|
3851
|
+
* Reports a skill installation attempt
|
|
3852
|
+
*
|
|
3853
|
+
* Submits installation telemetry data including success/failure status,
|
|
3854
|
+
* duration, and optional error information. Used by the CLI after
|
|
3855
|
+
* downloading and extracting a skill package.
|
|
3856
|
+
*
|
|
3857
|
+
* @param params - Installation report parameters
|
|
3858
|
+
* @param options - Optional request options
|
|
3859
|
+
* @returns Promise resolving to the report response
|
|
3860
|
+
*
|
|
3861
|
+
* @example
|
|
3862
|
+
* ```typescript
|
|
3863
|
+
* await sdk.marketSkills.reportSkillInstall({
|
|
3864
|
+
* identifier: 'github.owner.repo',
|
|
3865
|
+
* success: true,
|
|
3866
|
+
* installDurationMs: 1234,
|
|
3867
|
+
* platform: 'darwin-arm64',
|
|
3868
|
+
* });
|
|
3869
|
+
* ```
|
|
3870
|
+
*/
|
|
3871
|
+
async reportSkillInstall(params, options) {
|
|
3872
|
+
log19("Reporting skill install: %s (success: %s)", params.identifier, params.success);
|
|
3873
|
+
const result = await this.request(
|
|
3874
|
+
"/v1/skills/report/installation",
|
|
3875
|
+
{
|
|
3876
|
+
...options,
|
|
3877
|
+
body: JSON.stringify(params),
|
|
3878
|
+
method: "POST"
|
|
3879
|
+
}
|
|
3880
|
+
);
|
|
3881
|
+
log19("Skill install reported: %s", result.message);
|
|
3882
|
+
return result;
|
|
3883
|
+
}
|
|
3844
3884
|
/**
|
|
3845
3885
|
* Submits or updates a rating for a skill
|
|
3846
3886
|
*
|
|
@@ -4681,6 +4721,8 @@ export {
|
|
|
4681
4721
|
MarketAdmin,
|
|
4682
4722
|
MarketSDK,
|
|
4683
4723
|
ReviewStatusEnumSchema,
|
|
4724
|
+
SDK_USER_AGENT,
|
|
4725
|
+
SDK_VERSION,
|
|
4684
4726
|
StatusEnumSchema,
|
|
4685
4727
|
VisibilityEnumSchema,
|
|
4686
4728
|
buildTrustedClientPayload,
|