@lobehub/market-sdk 0.25.1 → 0.26.1
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 +255 -3
- package/dist/index.mjs +445 -274
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
1
2
|
import { AgentItem, MarketItemBase, PluginConnectionType, InstallFailureAnalysisQuery, InstallFailureAnalysis, RangeQuery, RangeStats, TopPluginsQuery, TopPlugin, PluginManifest, AdminPluginItem, AdminPluginItemDetail, PluginVersion, PluginVersionLocalization, AdminDeploymentOption, InstallationDetails, SystemDependency, IncompleteI18nPlugin, CategoryListQuery, CategoryItem, PluginItemDetail, InstallReportRequest, InstallReportResponse, CallReportRequest, CallReportResponse, CloudGatewayRequest, CloudGatewayResponse } from '@lobehub/market-types';
|
|
2
3
|
export * from '@lobehub/market-types';
|
|
3
4
|
export { CategoryItem, CategoryListQuery, CategoryListResponse } from '@lobehub/market-types';
|
|
4
|
-
import { z } from 'zod';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Visibility levels for plugins in the marketplace
|
|
@@ -1698,6 +1698,250 @@ declare class BaseSDK {
|
|
|
1698
1698
|
private fetchNewToken;
|
|
1699
1699
|
}
|
|
1700
1700
|
|
|
1701
|
+
/**
|
|
1702
|
+
* Admin Agent Item
|
|
1703
|
+
* Agent item with admin-specific fields for management
|
|
1704
|
+
*/
|
|
1705
|
+
interface AdminAgentItem {
|
|
1706
|
+
/** Author information */
|
|
1707
|
+
author?: {
|
|
1708
|
+
avatar?: string;
|
|
1709
|
+
name?: string;
|
|
1710
|
+
userName?: string;
|
|
1711
|
+
};
|
|
1712
|
+
/** Avatar URL or emoji */
|
|
1713
|
+
avatar?: string;
|
|
1714
|
+
/** Category name */
|
|
1715
|
+
category?: string;
|
|
1716
|
+
/** Agent configuration */
|
|
1717
|
+
config?: any;
|
|
1718
|
+
/** Creation timestamp */
|
|
1719
|
+
createdAt: string;
|
|
1720
|
+
/** Description */
|
|
1721
|
+
description?: string;
|
|
1722
|
+
/** Agent ID */
|
|
1723
|
+
id: string;
|
|
1724
|
+
/** Agent identifier */
|
|
1725
|
+
identifier: string;
|
|
1726
|
+
/** Install count */
|
|
1727
|
+
installCount?: number;
|
|
1728
|
+
/** Whether featured */
|
|
1729
|
+
isFeatured?: boolean;
|
|
1730
|
+
/** Whether officially maintained */
|
|
1731
|
+
isOfficial: boolean;
|
|
1732
|
+
/** Number of knowledge bases attached */
|
|
1733
|
+
knowledgeCount?: number;
|
|
1734
|
+
/** Display name */
|
|
1735
|
+
name: string;
|
|
1736
|
+
/** Owner ID */
|
|
1737
|
+
ownerId: number;
|
|
1738
|
+
/** Number of plugins attached */
|
|
1739
|
+
pluginCount?: number;
|
|
1740
|
+
/** Provider ID */
|
|
1741
|
+
providerId?: number;
|
|
1742
|
+
/** Safety check result */
|
|
1743
|
+
safetyCheck?: string | null;
|
|
1744
|
+
/** Publication status */
|
|
1745
|
+
status?: string;
|
|
1746
|
+
/** Tags */
|
|
1747
|
+
tags?: string[];
|
|
1748
|
+
/** Token usage */
|
|
1749
|
+
tokenUsage?: number;
|
|
1750
|
+
/** Update timestamp */
|
|
1751
|
+
updatedAt: string;
|
|
1752
|
+
/** URL */
|
|
1753
|
+
url?: string;
|
|
1754
|
+
/** Version name */
|
|
1755
|
+
versionName?: string;
|
|
1756
|
+
/** Version number */
|
|
1757
|
+
versionNumber?: number;
|
|
1758
|
+
/** Version list */
|
|
1759
|
+
versions?: Array<{
|
|
1760
|
+
isLatest: boolean;
|
|
1761
|
+
isValidated: boolean;
|
|
1762
|
+
updatedAt: string;
|
|
1763
|
+
version: string;
|
|
1764
|
+
versionNumber: number;
|
|
1765
|
+
}>;
|
|
1766
|
+
}
|
|
1767
|
+
/**
|
|
1768
|
+
* Admin Agent Item Detail
|
|
1769
|
+
* Extended agent detail with admin-specific fields
|
|
1770
|
+
*/
|
|
1771
|
+
interface AdminAgentItemDetail extends AgentItemDetail {
|
|
1772
|
+
/** Safety check result */
|
|
1773
|
+
safetyCheck?: string | null;
|
|
1774
|
+
}
|
|
1775
|
+
/**
|
|
1776
|
+
* Agent list query parameters for admin
|
|
1777
|
+
*/
|
|
1778
|
+
interface AdminAgentListQueryParams extends AdminListQueryParams {
|
|
1779
|
+
/** Filter by category */
|
|
1780
|
+
category?: string;
|
|
1781
|
+
/** Filter by official status */
|
|
1782
|
+
isOfficial?: 'true' | 'false';
|
|
1783
|
+
/** Filter by namespace */
|
|
1784
|
+
namespace?: string;
|
|
1785
|
+
/** Filter by status */
|
|
1786
|
+
status?: 'published' | 'unpublished' | 'archived' | 'deprecated' | 'all';
|
|
1787
|
+
/** Filter by visibility */
|
|
1788
|
+
visibility?: 'public' | 'private' | 'internal' | 'all';
|
|
1789
|
+
}
|
|
1790
|
+
/**
|
|
1791
|
+
* Agent update parameters
|
|
1792
|
+
*/
|
|
1793
|
+
interface AgentUpdateParams {
|
|
1794
|
+
/** Official homepage or repository URL for the agent */
|
|
1795
|
+
homepage?: string | null;
|
|
1796
|
+
/** Unique identifier for the agent */
|
|
1797
|
+
identifier?: string;
|
|
1798
|
+
/** Whether this agent is featured */
|
|
1799
|
+
isFeatured?: boolean;
|
|
1800
|
+
/** Whether this agent is officially maintained by LobeHub */
|
|
1801
|
+
isOfficial?: boolean;
|
|
1802
|
+
/** Default name of the agent */
|
|
1803
|
+
name?: string;
|
|
1804
|
+
/** Safety check result */
|
|
1805
|
+
safetyCheck?: string | null;
|
|
1806
|
+
/** Publication status */
|
|
1807
|
+
status?: 'published' | 'unpublished' | 'archived' | 'deprecated';
|
|
1808
|
+
/** Visibility level */
|
|
1809
|
+
visibility?: 'public' | 'private' | 'internal';
|
|
1810
|
+
}
|
|
1811
|
+
/**
|
|
1812
|
+
* Agent by status response item
|
|
1813
|
+
*/
|
|
1814
|
+
interface AgentByStatusItem {
|
|
1815
|
+
id: number;
|
|
1816
|
+
identifier: string;
|
|
1817
|
+
name: string;
|
|
1818
|
+
status: AgentStatus;
|
|
1819
|
+
updatedAt: string | null;
|
|
1820
|
+
}
|
|
1821
|
+
/**
|
|
1822
|
+
* Agent version by status response item
|
|
1823
|
+
*/
|
|
1824
|
+
interface AgentVersionByStatusItem {
|
|
1825
|
+
agentId: number;
|
|
1826
|
+
agentName: string;
|
|
1827
|
+
identifier: string;
|
|
1828
|
+
status: AgentStatus;
|
|
1829
|
+
updatedAt: string | null;
|
|
1830
|
+
version: string;
|
|
1831
|
+
versionId: number;
|
|
1832
|
+
}
|
|
1833
|
+
/**
|
|
1834
|
+
* Agent Management Service
|
|
1835
|
+
*
|
|
1836
|
+
* Provides administrative functionality for managing agents in the marketplace.
|
|
1837
|
+
* This service handles CRUD operations for agents, agent status, and visibility.
|
|
1838
|
+
*/
|
|
1839
|
+
declare class AgentService$1 extends BaseSDK {
|
|
1840
|
+
/**
|
|
1841
|
+
* Retrieves a list of agents with admin details
|
|
1842
|
+
*
|
|
1843
|
+
* Supports filtering, pagination, and sorting of results.
|
|
1844
|
+
*
|
|
1845
|
+
* @param params - Query parameters for filtering and pagination
|
|
1846
|
+
* @returns Promise resolving to the agent list response with admin details
|
|
1847
|
+
*/
|
|
1848
|
+
getAgents(params?: AdminAgentListQueryParams): Promise<AdminListResponse<AdminAgentItem>>;
|
|
1849
|
+
/**
|
|
1850
|
+
* Retrieves agents filtered by status
|
|
1851
|
+
*
|
|
1852
|
+
* @param status - The status to filter by
|
|
1853
|
+
* @returns Promise resolving to agents matching the status
|
|
1854
|
+
*/
|
|
1855
|
+
getAgentsByStatus(status: AgentStatus): Promise<{
|
|
1856
|
+
data: AgentByStatusItem[];
|
|
1857
|
+
total: number;
|
|
1858
|
+
}>;
|
|
1859
|
+
/**
|
|
1860
|
+
* Retrieves agent versions filtered by status
|
|
1861
|
+
*
|
|
1862
|
+
* @param status - The status to filter by
|
|
1863
|
+
* @returns Promise resolving to agent versions matching the status
|
|
1864
|
+
*/
|
|
1865
|
+
getAgentVersionsByStatus(status: AgentStatus): Promise<{
|
|
1866
|
+
data: AgentVersionByStatusItem[];
|
|
1867
|
+
total: number;
|
|
1868
|
+
}>;
|
|
1869
|
+
/**
|
|
1870
|
+
* Retrieves a single agent with full admin details
|
|
1871
|
+
*
|
|
1872
|
+
* @param id - Agent ID or identifier
|
|
1873
|
+
* @param options - Optional query parameters
|
|
1874
|
+
* @returns Promise resolving to the detailed agent information
|
|
1875
|
+
*/
|
|
1876
|
+
getAgent(id: number | string, options?: {
|
|
1877
|
+
locale?: string;
|
|
1878
|
+
version?: string;
|
|
1879
|
+
}): Promise<AdminAgentItemDetail>;
|
|
1880
|
+
/**
|
|
1881
|
+
* Updates agent information
|
|
1882
|
+
*
|
|
1883
|
+
* @param id - Agent ID or identifier
|
|
1884
|
+
* @param data - Agent update data containing fields to update
|
|
1885
|
+
* @returns Promise resolving to the updated agent
|
|
1886
|
+
*/
|
|
1887
|
+
updateAgent(id: number | string, data: AgentUpdateParams): Promise<AdminAgentItem>;
|
|
1888
|
+
/**
|
|
1889
|
+
* Updates agent publication status
|
|
1890
|
+
*
|
|
1891
|
+
* @param id - Agent ID or identifier
|
|
1892
|
+
* @param status - New status to set
|
|
1893
|
+
* @returns Promise resolving to success response
|
|
1894
|
+
*/
|
|
1895
|
+
updateAgentStatus(id: number | string, status: 'published' | 'unpublished' | 'archived' | 'deprecated'): Promise<{
|
|
1896
|
+
message: string;
|
|
1897
|
+
success: boolean;
|
|
1898
|
+
}>;
|
|
1899
|
+
/**
|
|
1900
|
+
* Updates agent visibility
|
|
1901
|
+
*
|
|
1902
|
+
* @param id - Agent ID or identifier
|
|
1903
|
+
* @param visibility - New visibility setting
|
|
1904
|
+
* @returns Promise resolving to success response
|
|
1905
|
+
*/
|
|
1906
|
+
updateAgentVisibility(id: number | string, visibility: 'public' | 'private' | 'internal'): Promise<{
|
|
1907
|
+
message: string;
|
|
1908
|
+
success: boolean;
|
|
1909
|
+
}>;
|
|
1910
|
+
/**
|
|
1911
|
+
* Deletes an agent
|
|
1912
|
+
*
|
|
1913
|
+
* @param id - Agent ID or identifier
|
|
1914
|
+
* @returns Promise resolving to success response
|
|
1915
|
+
*/
|
|
1916
|
+
deleteAgent(id: number | string): Promise<{
|
|
1917
|
+
message: string;
|
|
1918
|
+
success: boolean;
|
|
1919
|
+
}>;
|
|
1920
|
+
/**
|
|
1921
|
+
* Updates status for multiple agents in a single operation
|
|
1922
|
+
*
|
|
1923
|
+
* @param ids - Array of agent IDs to update
|
|
1924
|
+
* @param status - New status to set for all specified agents
|
|
1925
|
+
* @returns Promise resolving to success response
|
|
1926
|
+
*/
|
|
1927
|
+
batchUpdateAgentStatus(ids: number[], status: 'published' | 'unpublished' | 'archived' | 'deprecated'): Promise<{
|
|
1928
|
+
message: string;
|
|
1929
|
+
success: boolean;
|
|
1930
|
+
updatedCount: number;
|
|
1931
|
+
}>;
|
|
1932
|
+
/**
|
|
1933
|
+
* Deletes multiple agents in a single operation
|
|
1934
|
+
*
|
|
1935
|
+
* @param ids - Array of agent IDs to delete
|
|
1936
|
+
* @returns Promise resolving to success response
|
|
1937
|
+
*/
|
|
1938
|
+
batchDeleteAgents(ids: number[]): Promise<{
|
|
1939
|
+
deletedCount: number;
|
|
1940
|
+
message: string;
|
|
1941
|
+
success: boolean;
|
|
1942
|
+
}>;
|
|
1943
|
+
}
|
|
1944
|
+
|
|
1701
1945
|
/**
|
|
1702
1946
|
* Market Overview Statistics Interface
|
|
1703
1947
|
* Defines the structure for market overview data
|
|
@@ -2562,21 +2806,29 @@ declare class PluginEnvService extends BaseSDK {
|
|
|
2562
2806
|
* LobeHub Market Admin SDK Client
|
|
2563
2807
|
*
|
|
2564
2808
|
* Client for accessing administrative functionality of the LobeHub Marketplace.
|
|
2565
|
-
* This SDK provides privileged operations for managing plugins, reviews,
|
|
2809
|
+
* This SDK provides privileged operations for managing agents, plugins, reviews,
|
|
2566
2810
|
* system settings, and dependencies. It requires admin-level authentication.
|
|
2567
2811
|
*/
|
|
2568
2812
|
declare class MarketAdmin extends BaseSDK {
|
|
2813
|
+
/**
|
|
2814
|
+
* Agent management service
|
|
2815
|
+
* Provides methods for creating, updating, and managing agents
|
|
2816
|
+
*/
|
|
2817
|
+
readonly agents: AgentService$1;
|
|
2569
2818
|
/**
|
|
2570
2819
|
* Market analysis service
|
|
2571
2820
|
* Provides methods for accessing market analytics and statistics
|
|
2572
2821
|
*/
|
|
2573
2822
|
readonly analysis: AnalysisService;
|
|
2823
|
+
/**
|
|
2824
|
+
* Plugin environment service
|
|
2825
|
+
*/
|
|
2826
|
+
readonly env: PluginEnvService;
|
|
2574
2827
|
/**
|
|
2575
2828
|
* Plugin management service
|
|
2576
2829
|
* Provides methods for creating, updating, and managing plugins
|
|
2577
2830
|
*/
|
|
2578
2831
|
readonly plugins: PluginService;
|
|
2579
|
-
readonly env: PluginEnvService;
|
|
2580
2832
|
/**
|
|
2581
2833
|
* Review management service
|
|
2582
2834
|
* Provides methods for moderating and managing user reviews
|