@lobehub/market-sdk 0.43.0 → 0.45.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 +39 -3
- package/dist/index.mjs +34 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AgentMarketListQuery, AgentSkill, UserCredSummary, SandboxRunRequest, SandboxMode, AdminAgentCreateInput, AdminAgentCreateResponse, AgentItemDetail, AdminAgentVersionUpdateInput, AdminAgentVersionCreateInput, InstallFailureAnalysisQuery, InstallFailureAnalysis, RangeQuery, RangeStats, TopPluginsQuery, TopPlugin, OfficialMcpRegistryImportRequest, OfficialMcpRegistryImportResponse, OfficialMcpRegistrySyncRequest, OfficialMcpRegistrySyncResponse, PluginManifest, AdminPluginItem, AdminPluginItemDetail, PluginVersion, PluginVersionLocalization, AdminDeploymentOption, InstallationDetails, SystemDependency, IncompleteI18nPlugin, CreateSkillCollectionRequest, AdminSkillCollectionDetail, AdminSkillCollectionListQuery, AdminSkillCollectionListResponse, BatchUpsertSkillCollectionLocalizationsRequest, SkillCollectionLocalizationBatchResponse, SkillCollectionLocalization, UpdateSkillCollectionRequest, UpsertSkillCollectionLocalizationRequest, AdminSkillCreateRequest, AdminSkillUpdateResponse, AdminSkillGitHubImportRequest, AdminSkillImportResponse, AdminSkillDetail, AdminSkillUpdateRequest, AdminSkillListQuery, AdminSkillListResponse, AssetCategoryAdminListQuery, AssetCategoryAdminList, AssetCategoryType, AssetCategoryCreate, AssetCategory, AssetCategoryUpdate, AssetCategoryDelete, AdminSandboxSessionQuery, AdminSandboxSessionList, AdminSandboxSession, AdminSandboxEfsUsage, AdminSandboxStorageQuery, AdminSandboxStorageList, AdminSandboxStorage, AgentListResponse, SitemapResponse, AgentEventRequest, SkillCredStatus, InjectCredsRequest, InjectCredsResponse, InjectCredsForSkillRequest, InjectCredsForSkillResponse, PrepareDeploymentUploadRequest, IngestedDeploymentUpload, PluginListResponse, CategoryListQuery, CategoryItem, PluginItemDetail, InstallReportRequest, InstallReportResponse, CallReportRequest, CallReportResponse, PluginEventRequest, CloudGatewayRequest, CloudGatewayResponse, SandboxRunResponse, SandboxStorageInfo, SandboxStorageFileList, SandboxStorageFileContent, SandboxStorageWriteResult, SandboxSessionList, SandboxInstanceList, MyOrganizationItem, CreateOrganizationRequest, CreateOrganizationResponse, UpdateOrganizationRequest, OrganizationItem, OrganizationMemberItem, OrganizationMemberRole, AddMemberResponse, UpdateMemberRoleResponse, ReconcileMembersRequest, ReconcileMembersResponse, AssetCategoryItem, SandboxStorageClaim } from '@lobehub/market-types';
|
|
1
|
+
import { AgentMarketListQuery, AgentSkill, UserCredSummary, SandboxRunRequest, SandboxMode, AdminAgentCreateInput, AdminAgentCreateResponse, AgentItemDetail, AdminAgentVersionUpdateInput, AdminAgentVersionCreateInput, InstallFailureAnalysisQuery, InstallFailureAnalysis, RangeQuery, RangeStats, TopPluginsQuery, TopPlugin, OfficialMcpRegistryImportRequest, OfficialMcpRegistryImportResponse, OfficialMcpRegistrySyncRequest, OfficialMcpRegistrySyncResponse, PluginManifest, AdminPluginItem, AdminPluginItemDetail, PluginVersion, PluginVersionLocalization, AdminDeploymentOption, InstallationDetails, SystemDependency, IncompleteI18nPlugin, CreateSkillCollectionRequest, AdminSkillCollectionDetail, AdminSkillCollectionListQuery, AdminSkillCollectionListResponse, BatchUpsertSkillCollectionLocalizationsRequest, SkillCollectionLocalizationBatchResponse, SkillCollectionLocalization, UpdateSkillCollectionRequest, UpsertSkillCollectionLocalizationRequest, AdminSkillCreateRequest, AdminSkillUpdateResponse, AdminSkillGitHubImportRequest, AdminSkillImportResponse, AdminSkillDetail, AdminSkillUpdateRequest, AdminSkillListQuery, AdminSkillListResponse, AssetCategoryAdminListQuery, AssetCategoryAdminList, AssetCategoryType, AssetCategoryCreate, AssetCategory, AssetCategoryUpdate, AssetCategoryDelete, AdminSandboxSessionQuery, AdminSandboxSessionList, AdminSandboxSession, AdminSandboxEfsUsage, AdminSandboxStorageQuery, AdminSandboxStorageList, AdminSandboxStorageWorkspaceQuery, AdminSandboxStorageWorkspaceList, AdminSandboxStorage, AgentListResponse, SitemapResponse, AgentEventRequest, SkillCredStatus, InjectCredsRequest, InjectCredsResponse, InjectCredsForSkillRequest, InjectCredsForSkillResponse, PrepareDeploymentUploadRequest, IngestedDeploymentUpload, PluginListResponse, CategoryListQuery, CategoryItem, PluginItemDetail, InstallReportRequest, InstallReportResponse, CallReportRequest, CallReportResponse, PluginEventRequest, CloudGatewayRequest, CloudGatewayResponse, SandboxRunResponse, SandboxStorageInfo, SandboxStorageFileList, SandboxStorageFileContent, SandboxStorageWriteResult, SandboxSessionList, SandboxInstanceList, MyOrganizationItem, CreateOrganizationRequest, CreateOrganizationResponse, UpdateOrganizationRequest, OrganizationItem, OrganizationMemberItem, OrganizationMemberRole, AddMemberResponse, UpdateMemberRoleResponse, ReconcileMembersRequest, ReconcileMembersResponse, AssetCategoryItem, SandboxRunClaim, SandboxStorageClaim } from '@lobehub/market-types';
|
|
2
2
|
export * from '@lobehub/market-types';
|
|
3
3
|
export { AgentItemDetail, AgentListResponse, AgentSkill, CategoryItem, CategoryListQuery, CategoryListResponse, CredType, IngestedDeploymentUpload, InjectCredsForSkillRequest, InjectCredsForSkillResponse, InjectCredsRequest, InjectCredsResponse, InjectedFileInfo, MarketPluginItem as PluginItem, PluginListResponse, PrepareDeploymentUploadRequest, PublishPlanLimits, PublishTarget, SandboxEgress, SandboxEgressInject, SandboxInstance, SandboxInstanceList, SandboxInstanceSnapshot, SandboxRunErrorCode, SandboxRunErrorResponse, SandboxRunResponse, SandboxRunRuntime, SandboxRunSubject, SandboxSecretRef, SandboxSessionEndReason, SandboxSessionKind, SandboxSessionList, SandboxSessionRecord, SandboxStorageClaim, SandboxStorageFileContent, SandboxStorageFileEntry, SandboxStorageFileList, SandboxStorageInfo, SandboxStorageStatus, SandboxStorageWriteResult, SkillCredStatus, UserCredSummary } from '@lobehub/market-types';
|
|
4
4
|
import { z } from 'zod';
|
|
@@ -5614,6 +5614,8 @@ declare class SandboxStorageService$1 extends BaseSDK {
|
|
|
5614
5614
|
data: AdminSandboxEfsUsage;
|
|
5615
5615
|
}>;
|
|
5616
5616
|
list(params?: AdminSandboxStorageQuery): Promise<AdminSandboxStorageList>;
|
|
5617
|
+
/** Usage added up per workspace: its shared disk plus every member's own disk. */
|
|
5618
|
+
listWorkspaces(params?: AdminSandboxStorageWorkspaceQuery): Promise<AdminSandboxStorageWorkspaceList>;
|
|
5617
5619
|
get(key: string): Promise<{
|
|
5618
5620
|
data: AdminSandboxStorage;
|
|
5619
5621
|
}>;
|
|
@@ -7174,8 +7176,15 @@ declare class SandboxService extends BaseSDK {
|
|
|
7174
7176
|
* `/mnt/workspace/ws-.../reports/q3.md`).
|
|
7175
7177
|
*/
|
|
7176
7178
|
declare class SandboxStorageService extends BaseSDK {
|
|
7177
|
-
/**
|
|
7178
|
-
|
|
7179
|
+
/**
|
|
7180
|
+
* Storage directory, quota and the last measured usage.
|
|
7181
|
+
*
|
|
7182
|
+
* `query.drives` also lists every disk in a workspace-billed storage's pool
|
|
7183
|
+
* with its stored figure (`workspaceDrives`), in this one read.
|
|
7184
|
+
*/
|
|
7185
|
+
getStorage(key?: string, options?: globalThis.RequestInit, query?: {
|
|
7186
|
+
drives?: boolean;
|
|
7187
|
+
}): Promise<SandboxStorageInfo>;
|
|
7179
7188
|
/**
|
|
7180
7189
|
* Re-measure the storage size. Costs a sandbox round trip and walks the
|
|
7181
7190
|
* whole directory, so call it on demand rather than on every render.
|
|
@@ -7275,6 +7284,21 @@ declare class SandboxStorageService extends BaseSDK {
|
|
|
7275
7284
|
}, options?: globalThis.RequestInit): Promise<{
|
|
7276
7285
|
path: string;
|
|
7277
7286
|
}>;
|
|
7287
|
+
/**
|
|
7288
|
+
* Rename or move a file or folder inside the storage.
|
|
7289
|
+
*
|
|
7290
|
+
* Never overwrites: an existing `newPath` is refused with 409
|
|
7291
|
+
* `FILE_ALREADY_EXISTS`. The destination folder must already exist.
|
|
7292
|
+
* Always runs in a sandbox session, so it is slower than the other file
|
|
7293
|
+
* operations on a deployment that serves those directly.
|
|
7294
|
+
*/
|
|
7295
|
+
renameFile(params: SandboxStorageRequestContext & {
|
|
7296
|
+
key?: string;
|
|
7297
|
+
newPath: string;
|
|
7298
|
+
path: string;
|
|
7299
|
+
}, options?: globalThis.RequestInit): Promise<{
|
|
7300
|
+
path: string;
|
|
7301
|
+
}>;
|
|
7278
7302
|
}
|
|
7279
7303
|
|
|
7280
7304
|
/**
|
|
@@ -8811,6 +8835,8 @@ declare const SDK_USER_AGENT = "LobeHub-Market-SDK/0.31.3";
|
|
|
8811
8835
|
* name: 'John Doe',
|
|
8812
8836
|
* // Omit for the free tier; present for a plan that includes one.
|
|
8813
8837
|
* sandboxStorage: { key: 'ws-user_xxx', quotaBytes: 2 * 1024 ** 3 },
|
|
8838
|
+
* // Omit for the server default; present to raise (or lower) run concurrency.
|
|
8839
|
+
* sandboxRun: { maxConcurrency: 5 },
|
|
8814
8840
|
* };
|
|
8815
8841
|
*
|
|
8816
8842
|
* const token = createTrustedClientToken(payload, secret);
|
|
@@ -8834,6 +8860,15 @@ interface TrustedClientPayload {
|
|
|
8834
8860
|
name?: string;
|
|
8835
8861
|
/** Random nonce for uniqueness */
|
|
8836
8862
|
nonce: string;
|
|
8863
|
+
/**
|
|
8864
|
+
* One-shot sandbox run entitlement (`POST /api/v1/sandbox/runs`), resolved
|
|
8865
|
+
* from the caller's plan — the workspace's plan for workspace runs.
|
|
8866
|
+
*
|
|
8867
|
+
* Omit (or `null`) for the server default concurrency. When present,
|
|
8868
|
+
* `maxConcurrency` must be a positive integer or Market rejects the token;
|
|
8869
|
+
* Market clamps it to its own `SANDBOX_RUN_MAX_CONCURRENCY_CEILING`.
|
|
8870
|
+
*/
|
|
8871
|
+
sandboxRun?: SandboxRunClaim | null;
|
|
8837
8872
|
/**
|
|
8838
8873
|
* Persistent sandbox entitlement for this caller, resolved from their plan.
|
|
8839
8874
|
*
|
|
@@ -8882,6 +8917,7 @@ declare function buildTrustedClientPayload(params: {
|
|
|
8882
8917
|
email: string;
|
|
8883
8918
|
emailVerified?: boolean;
|
|
8884
8919
|
name?: string;
|
|
8920
|
+
sandboxRun?: SandboxRunClaim | null;
|
|
8885
8921
|
sandboxStorage?: SandboxStorageClaim | null;
|
|
8886
8922
|
userId: string;
|
|
8887
8923
|
workspaceId?: string;
|
package/dist/index.mjs
CHANGED
|
@@ -2062,6 +2062,10 @@ var SandboxStorageService = class extends BaseSDK {
|
|
|
2062
2062
|
list(params = {}) {
|
|
2063
2063
|
return this.request(`/admin/sandbox-storage${this.buildQueryString(params)}`);
|
|
2064
2064
|
}
|
|
2065
|
+
/** Usage added up per workspace: its shared disk plus every member's own disk. */
|
|
2066
|
+
listWorkspaces(params = {}) {
|
|
2067
|
+
return this.request(`/admin/sandbox-storage/workspaces${this.buildQueryString(params)}`);
|
|
2068
|
+
}
|
|
2065
2069
|
get(key) {
|
|
2066
2070
|
return this.request(`/admin/sandbox-storage/${encodeURIComponent(key)}`);
|
|
2067
2071
|
}
|
|
@@ -4715,11 +4719,17 @@ var SandboxService = class extends BaseSDK {
|
|
|
4715
4719
|
import debug26 from "debug";
|
|
4716
4720
|
var log26 = debug26("lobe-market-sdk:sandbox-storage");
|
|
4717
4721
|
var SandboxStorageService2 = class extends BaseSDK {
|
|
4718
|
-
/**
|
|
4719
|
-
|
|
4722
|
+
/**
|
|
4723
|
+
* Storage directory, quota and the last measured usage.
|
|
4724
|
+
*
|
|
4725
|
+
* `query.drives` also lists every disk in a workspace-billed storage's pool
|
|
4726
|
+
* with its stored figure (`workspaceDrives`), in this one read.
|
|
4727
|
+
*/
|
|
4728
|
+
async getStorage(key = "current", options, query) {
|
|
4720
4729
|
log26("Getting sandbox storage: %s", key);
|
|
4730
|
+
const suffix = (query == null ? void 0 : query.drives) ? "?drives=true" : "";
|
|
4721
4731
|
const result = await this.request(
|
|
4722
|
-
`/v1/sandbox/storages/${encodeURIComponent(key)}`,
|
|
4732
|
+
`/v1/sandbox/storages/${encodeURIComponent(key)}${suffix}`,
|
|
4723
4733
|
{ ...options, method: "GET" }
|
|
4724
4734
|
);
|
|
4725
4735
|
return result.data;
|
|
@@ -4879,6 +4889,27 @@ var SandboxStorageService2 = class extends BaseSDK {
|
|
|
4879
4889
|
);
|
|
4880
4890
|
return result.data;
|
|
4881
4891
|
}
|
|
4892
|
+
/**
|
|
4893
|
+
* Rename or move a file or folder inside the storage.
|
|
4894
|
+
*
|
|
4895
|
+
* Never overwrites: an existing `newPath` is refused with 409
|
|
4896
|
+
* `FILE_ALREADY_EXISTS`. The destination folder must already exist.
|
|
4897
|
+
* Always runs in a sandbox session, so it is slower than the other file
|
|
4898
|
+
* operations on a deployment that serves those directly.
|
|
4899
|
+
*/
|
|
4900
|
+
async renameFile(params, options) {
|
|
4901
|
+
const { key = "current", newPath, path, topicId } = params;
|
|
4902
|
+
log26("Renaming sandbox storage path: %s/%s -> %s", key, path, newPath);
|
|
4903
|
+
const result = await this.request(
|
|
4904
|
+
`/v1/sandbox/storages/${encodeURIComponent(key)}/rename`,
|
|
4905
|
+
{
|
|
4906
|
+
...options,
|
|
4907
|
+
body: JSON.stringify({ newPath, path, topicId }),
|
|
4908
|
+
method: "POST"
|
|
4909
|
+
}
|
|
4910
|
+
);
|
|
4911
|
+
return result.data;
|
|
4912
|
+
}
|
|
4882
4913
|
};
|
|
4883
4914
|
|
|
4884
4915
|
// src/market/services/SkillService.ts
|